var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var require_index_001 = __commonJS({
  "assets/index-Cr5cqAiU.js"(exports, module) {
    /**
    * @vue/shared v3.5.12
    * (c) 2018-present Yuxi (Evan) You and Vue contributors
    * @license MIT
    **/
    /*! #__NO_SIDE_EFFECTS__ */
    // @__NO_SIDE_EFFECTS__
    function makeMap(str) {
      const map2 = /* @__PURE__ */ Object.create(null);
      for (const key of str.split(",")) map2[key] = 1;
      return (val) => val in map2;
    }
    const EMPTY_OBJ = {};
    const EMPTY_ARR = [];
    const NOOP = () => {
    };
    const NO = () => false;
    const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
    (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
    const isModelListener = (key) => key.startsWith("onUpdate:");
    const extend = Object.assign;
    const remove = (arr, el) => {
      const i = arr.indexOf(el);
      if (i > -1) {
        arr.splice(i, 1);
      }
    };
    const hasOwnProperty$e = Object.prototype.hasOwnProperty;
    const hasOwn$1 = (val, key) => hasOwnProperty$e.call(val, key);
    const isArray$3 = Array.isArray;
    const isMap = (val) => toTypeString$1(val) === "[object Map]";
    const isSet = (val) => toTypeString$1(val) === "[object Set]";
    const isRegExp$1 = (val) => toTypeString$1(val) === "[object RegExp]";
    const isFunction$2 = (val) => typeof val === "function";
    const isString$2 = (val) => typeof val === "string";
    const isSymbol$1 = (val) => typeof val === "symbol";
    const isObject$4 = (val) => val !== null && typeof val === "object";
    const isPromise$1 = (val) => {
      return (isObject$4(val) || isFunction$2(val)) && isFunction$2(val.then) && isFunction$2(val.catch);
    };
    const objectToString$2 = Object.prototype.toString;
    const toTypeString$1 = (value) => objectToString$2.call(value);
    const toRawType = (value) => {
      return toTypeString$1(value).slice(8, -1);
    };
    const isPlainObject$3 = (val) => toTypeString$1(val) === "[object Object]";
    const isIntegerKey = (key) => isString$2(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
    const isReservedProp = /* @__PURE__ */ makeMap(
      // the leading comma is intentional so empty string "" is also included
      ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
    );
    const cacheStringFunction = (fn) => {
      const cache2 = /* @__PURE__ */ Object.create(null);
      return (str) => {
        const hit = cache2[str];
        return hit || (cache2[str] = fn(str));
      };
    };
    const camelizeRE = /-(\w)/g;
    const camelize = cacheStringFunction(
      (str) => {
        return str.replace(camelizeRE, (_, c2) => c2 ? c2.toUpperCase() : "");
      }
    );
    const hyphenateRE = /\B([A-Z])/g;
    const hyphenate = cacheStringFunction(
      (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
    );
    const capitalize$1 = cacheStringFunction((str) => {
      return str.charAt(0).toUpperCase() + str.slice(1);
    });
    const toHandlerKey = cacheStringFunction(
      (str) => {
        const s = str ? `on${capitalize$1(str)}` : ``;
        return s;
      }
    );
    const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
    const invokeArrayFns = (fns, ...arg) => {
      for (let i = 0; i < fns.length; i++) {
        fns[i](...arg);
      }
    };
    const def = (obj, key, value, writable = false) => {
      Object.defineProperty(obj, key, {
        configurable: true,
        enumerable: false,
        writable,
        value
      });
    };
    const looseToNumber = (val) => {
      const n = parseFloat(val);
      return isNaN(n) ? val : n;
    };
    const toNumber$1 = (val) => {
      const n = isString$2(val) ? Number(val) : NaN;
      return isNaN(n) ? val : n;
    };
    let _globalThis$1;
    const getGlobalThis$1 = () => {
      return _globalThis$1 || (_globalThis$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
    };
    function normalizeStyle(value) {
      if (isArray$3(value)) {
        const res = {};
        for (let i = 0; i < value.length; i++) {
          const item = value[i];
          const normalized = isString$2(item) ? parseStringStyle(item) : normalizeStyle(item);
          if (normalized) {
            for (const key in normalized) {
              res[key] = normalized[key];
            }
          }
        }
        return res;
      } else if (isString$2(value) || isObject$4(value)) {
        return value;
      }
    }
    const listDelimiterRE = /;(?![^(]*\))/g;
    const propertyDelimiterRE = /:([^]+)/;
    const styleCommentRE = /\/\*[^]*?\*\//g;
    function parseStringStyle(cssText) {
      const ret = {};
      cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
        if (item) {
          const tmp = item.split(propertyDelimiterRE);
          tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
        }
      });
      return ret;
    }
    function normalizeClass(value) {
      let res = "";
      if (isString$2(value)) {
        res = value;
      } else if (isArray$3(value)) {
        for (let i = 0; i < value.length; i++) {
          const normalized = normalizeClass(value[i]);
          if (normalized) {
            res += normalized + " ";
          }
        }
      } else if (isObject$4(value)) {
        for (const name in value) {
          if (value[name]) {
            res += name + " ";
          }
        }
      }
      return res.trim();
    }
    const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
    const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
    function includeBooleanAttr(value) {
      return !!value || value === "";
    }
    const isRef$1 = (val) => {
      return !!(val && val["__v_isRef"] === true);
    };
    const toDisplayString$1 = (val) => {
      return isString$2(val) ? val : val == null ? "" : isArray$3(val) || isObject$4(val) && (val.toString === objectToString$2 || !isFunction$2(val.toString)) ? isRef$1(val) ? toDisplayString$1(val.value) : JSON.stringify(val, replacer, 2) : String(val);
    };
    const replacer = (_key, val) => {
      if (isRef$1(val)) {
        return replacer(_key, val.value);
      } else if (isMap(val)) {
        return {
          [`Map(${val.size})`]: [...val.entries()].reduce(
            (entries, [key, val2], i) => {
              entries[stringifySymbol(key, i) + " =>"] = val2;
              return entries;
            },
            {}
          )
        };
      } else if (isSet(val)) {
        return {
          [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
        };
      } else if (isSymbol$1(val)) {
        return stringifySymbol(val);
      } else if (isObject$4(val) && !isArray$3(val) && !isPlainObject$3(val)) {
        return String(val);
      }
      return val;
    };
    const stringifySymbol = (v, i = "") => {
      var _a;
      return (
        // Symbol.description in es2019+ so we need to cast here to pass
        // the lib: es2016 check
        isSymbol$1(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
      );
    };
    /**
    * @vue/reactivity v3.5.12
    * (c) 2018-present Yuxi (Evan) You and Vue contributors
    * @license MIT
    **/
    let activeEffectScope;
    class EffectScope {
      constructor(detached = false) {
        this.detached = detached;
        this._active = true;
        this.effects = [];
        this.cleanups = [];
        this._isPaused = false;
        this.parent = activeEffectScope;
        if (!detached && activeEffectScope) {
          this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
            this
          ) - 1;
        }
      }
      get active() {
        return this._active;
      }
      pause() {
        if (this._active) {
          this._isPaused = true;
          let i, l;
          if (this.scopes) {
            for (i = 0, l = this.scopes.length; i < l; i++) {
              this.scopes[i].pause();
            }
          }
          for (i = 0, l = this.effects.length; i < l; i++) {
            this.effects[i].pause();
          }
        }
      }
      /**
       * Resumes the effect scope, including all child scopes and effects.
       */
      resume() {
        if (this._active) {
          if (this._isPaused) {
            this._isPaused = false;
            let i, l;
            if (this.scopes) {
              for (i = 0, l = this.scopes.length; i < l; i++) {
                this.scopes[i].resume();
              }
            }
            for (i = 0, l = this.effects.length; i < l; i++) {
              this.effects[i].resume();
            }
          }
        }
      }
      run(fn) {
        if (this._active) {
          const currentEffectScope = activeEffectScope;
          try {
            activeEffectScope = this;
            return fn();
          } finally {
            activeEffectScope = currentEffectScope;
          }
        }
      }
      /**
       * This should only be called on non-detached scopes
       * @internal
       */
      on() {
        activeEffectScope = this;
      }
      /**
       * This should only be called on non-detached scopes
       * @internal
       */
      off() {
        activeEffectScope = this.parent;
      }
      stop(fromParent) {
        if (this._active) {
          let i, l;
          for (i = 0, l = this.effects.length; i < l; i++) {
            this.effects[i].stop();
          }
          for (i = 0, l = this.cleanups.length; i < l; i++) {
            this.cleanups[i]();
          }
          if (this.scopes) {
            for (i = 0, l = this.scopes.length; i < l; i++) {
              this.scopes[i].stop(true);
            }
          }
          if (!this.detached && this.parent && !fromParent) {
            const last = this.parent.scopes.pop();
            if (last && last !== this) {
              this.parent.scopes[this.index] = last;
              last.index = this.index;
            }
          }
          this.parent = void 0;
          this._active = false;
        }
      }
    }
    function effectScope(detached) {
      return new EffectScope(detached);
    }
    function getCurrentScope() {
      return activeEffectScope;
    }
    function onScopeDispose(fn, failSilently = false) {
      if (activeEffectScope) {
        activeEffectScope.cleanups.push(fn);
      }
    }
    let activeSub;
    const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
    class ReactiveEffect {
      constructor(fn) {
        this.fn = fn;
        this.deps = void 0;
        this.depsTail = void 0;
        this.flags = 1 | 4;
        this.next = void 0;
        this.cleanup = void 0;
        this.scheduler = void 0;
        if (activeEffectScope && activeEffectScope.active) {
          activeEffectScope.effects.push(this);
        }
      }
      pause() {
        this.flags |= 64;
      }
      resume() {
        if (this.flags & 64) {
          this.flags &= ~64;
          if (pausedQueueEffects.has(this)) {
            pausedQueueEffects.delete(this);
            this.trigger();
          }
        }
      }
      /**
       * @internal
       */
      notify() {
        if (this.flags & 2 && !(this.flags & 32)) {
          return;
        }
        if (!(this.flags & 8)) {
          batch(this);
        }
      }
      run() {
        if (!(this.flags & 1)) {
          return this.fn();
        }
        this.flags |= 2;
        cleanupEffect(this);
        prepareDeps(this);
        const prevEffect = activeSub;
        const prevShouldTrack = shouldTrack;
        activeSub = this;
        shouldTrack = true;
        try {
          return this.fn();
        } finally {
          cleanupDeps(this);
          activeSub = prevEffect;
          shouldTrack = prevShouldTrack;
          this.flags &= ~2;
        }
      }
      stop() {
        if (this.flags & 1) {
          for (let link = this.deps; link; link = link.nextDep) {
            removeSub(link);
          }
          this.deps = this.depsTail = void 0;
          cleanupEffect(this);
          this.onStop && this.onStop();
          this.flags &= ~1;
        }
      }
      trigger() {
        if (this.flags & 64) {
          pausedQueueEffects.add(this);
        } else if (this.scheduler) {
          this.scheduler();
        } else {
          this.runIfDirty();
        }
      }
      /**
       * @internal
       */
      runIfDirty() {
        if (isDirty(this)) {
          this.run();
        }
      }
      get dirty() {
        return isDirty(this);
      }
    }
    let batchDepth = 0;
    let batchedSub;
    let batchedComputed;
    function batch(sub, isComputed2 = false) {
      sub.flags |= 8;
      if (isComputed2) {
        sub.next = batchedComputed;
        batchedComputed = sub;
        return;
      }
      sub.next = batchedSub;
      batchedSub = sub;
    }
    function startBatch() {
      batchDepth++;
    }
    function endBatch() {
      if (--batchDepth > 0) {
        return;
      }
      if (batchedComputed) {
        let e = batchedComputed;
        batchedComputed = void 0;
        while (e) {
          const next = e.next;
          e.next = void 0;
          e.flags &= ~8;
          e = next;
        }
      }
      let error2;
      while (batchedSub) {
        let e = batchedSub;
        batchedSub = void 0;
        while (e) {
          const next = e.next;
          e.next = void 0;
          e.flags &= ~8;
          if (e.flags & 1) {
            try {
              ;
              e.trigger();
            } catch (err) {
              if (!error2) error2 = err;
            }
          }
          e = next;
        }
      }
      if (error2) throw error2;
    }
    function prepareDeps(sub) {
      for (let link = sub.deps; link; link = link.nextDep) {
        link.version = -1;
        link.prevActiveLink = link.dep.activeLink;
        link.dep.activeLink = link;
      }
    }
    function cleanupDeps(sub) {
      let head;
      let tail = sub.depsTail;
      let link = tail;
      while (link) {
        const prev = link.prevDep;
        if (link.version === -1) {
          if (link === tail) tail = prev;
          removeSub(link);
          removeDep(link);
        } else {
          head = link;
        }
        link.dep.activeLink = link.prevActiveLink;
        link.prevActiveLink = void 0;
        link = prev;
      }
      sub.deps = head;
      sub.depsTail = tail;
    }
    function isDirty(sub) {
      for (let link = sub.deps; link; link = link.nextDep) {
        if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
          return true;
        }
      }
      if (sub._dirty) {
        return true;
      }
      return false;
    }
    function refreshComputed(computed2) {
      if (computed2.flags & 4 && !(computed2.flags & 16)) {
        return;
      }
      computed2.flags &= ~16;
      if (computed2.globalVersion === globalVersion) {
        return;
      }
      computed2.globalVersion = globalVersion;
      const dep = computed2.dep;
      computed2.flags |= 2;
      if (dep.version > 0 && !computed2.isSSR && computed2.deps && !isDirty(computed2)) {
        computed2.flags &= ~2;
        return;
      }
      const prevSub = activeSub;
      const prevShouldTrack = shouldTrack;
      activeSub = computed2;
      shouldTrack = true;
      try {
        prepareDeps(computed2);
        const value = computed2.fn(computed2._value);
        if (dep.version === 0 || hasChanged(value, computed2._value)) {
          computed2._value = value;
          dep.version++;
        }
      } catch (err) {
        dep.version++;
        throw err;
      } finally {
        activeSub = prevSub;
        shouldTrack = prevShouldTrack;
        cleanupDeps(computed2);
        computed2.flags &= ~2;
      }
    }
    function removeSub(link, soft = false) {
      const { dep, prevSub, nextSub } = link;
      if (prevSub) {
        prevSub.nextSub = nextSub;
        link.prevSub = void 0;
      }
      if (nextSub) {
        nextSub.prevSub = prevSub;
        link.nextSub = void 0;
      }
      if (dep.subs === link) {
        dep.subs = prevSub;
        if (!prevSub && dep.computed) {
          dep.computed.flags &= ~4;
          for (let l = dep.computed.deps; l; l = l.nextDep) {
            removeSub(l, true);
          }
        }
      }
      if (!soft && !--dep.sc && dep.map) {
        dep.map.delete(dep.key);
      }
    }
    function removeDep(link) {
      const { prevDep, nextDep } = link;
      if (prevDep) {
        prevDep.nextDep = nextDep;
        link.prevDep = void 0;
      }
      if (nextDep) {
        nextDep.prevDep = prevDep;
        link.nextDep = void 0;
      }
    }
    let shouldTrack = true;
    const trackStack = [];
    function pauseTracking() {
      trackStack.push(shouldTrack);
      shouldTrack = false;
    }
    function resetTracking() {
      const last = trackStack.pop();
      shouldTrack = last === void 0 ? true : last;
    }
    function cleanupEffect(e) {
      const { cleanup } = e;
      e.cleanup = void 0;
      if (cleanup) {
        const prevSub = activeSub;
        activeSub = void 0;
        try {
          cleanup();
        } finally {
          activeSub = prevSub;
        }
      }
    }
    let globalVersion = 0;
    class Link {
      constructor(sub, dep) {
        this.sub = sub;
        this.dep = dep;
        this.version = dep.version;
        this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
      }
    }
    class Dep {
      constructor(computed2) {
        this.computed = computed2;
        this.version = 0;
        this.activeLink = void 0;
        this.subs = void 0;
        this.map = void 0;
        this.key = void 0;
        this.sc = 0;
      }
      track(debugInfo) {
        if (!activeSub || !shouldTrack || activeSub === this.computed) {
          return;
        }
        let link = this.activeLink;
        if (link === void 0 || link.sub !== activeSub) {
          link = this.activeLink = new Link(activeSub, this);
          if (!activeSub.deps) {
            activeSub.deps = activeSub.depsTail = link;
          } else {
            link.prevDep = activeSub.depsTail;
            activeSub.depsTail.nextDep = link;
            activeSub.depsTail = link;
          }
          addSub(link);
        } else if (link.version === -1) {
          link.version = this.version;
          if (link.nextDep) {
            const next = link.nextDep;
            next.prevDep = link.prevDep;
            if (link.prevDep) {
              link.prevDep.nextDep = next;
            }
            link.prevDep = activeSub.depsTail;
            link.nextDep = void 0;
            activeSub.depsTail.nextDep = link;
            activeSub.depsTail = link;
            if (activeSub.deps === link) {
              activeSub.deps = next;
            }
          }
        }
        return link;
      }
      trigger(debugInfo) {
        this.version++;
        globalVersion++;
        this.notify(debugInfo);
      }
      notify(debugInfo) {
        startBatch();
        try {
          if (false) ;
          for (let link = this.subs; link; link = link.prevSub) {
            if (link.sub.notify()) {
              ;
              link.sub.dep.notify();
            }
          }
        } finally {
          endBatch();
        }
      }
    }
    function addSub(link) {
      link.dep.sc++;
      if (link.sub.flags & 4) {
        const computed2 = link.dep.computed;
        if (computed2 && !link.dep.subs) {
          computed2.flags |= 4 | 16;
          for (let l = computed2.deps; l; l = l.nextDep) {
            addSub(l);
          }
        }
        const currentTail = link.dep.subs;
        if (currentTail !== link) {
          link.prevSub = currentTail;
          if (currentTail) currentTail.nextSub = link;
        }
        link.dep.subs = link;
      }
    }
    const targetMap = /* @__PURE__ */ new WeakMap();
    const ITERATE_KEY = Symbol(
      ""
    );
    const MAP_KEY_ITERATE_KEY = Symbol(
      ""
    );
    const ARRAY_ITERATE_KEY = Symbol(
      ""
    );
    function track(target, type, key) {
      if (shouldTrack && activeSub) {
        let depsMap = targetMap.get(target);
        if (!depsMap) {
          targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
        }
        let dep = depsMap.get(key);
        if (!dep) {
          depsMap.set(key, dep = new Dep());
          dep.map = depsMap;
          dep.key = key;
        }
        {
          dep.track();
        }
      }
    }
    function trigger$1(target, type, key, newValue, oldValue, oldTarget) {
      const depsMap = targetMap.get(target);
      if (!depsMap) {
        globalVersion++;
        return;
      }
      const run = (dep) => {
        if (dep) {
          {
            dep.trigger();
          }
        }
      };
      startBatch();
      if (type === "clear") {
        depsMap.forEach(run);
      } else {
        const targetIsArray = isArray$3(target);
        const isArrayIndex = targetIsArray && isIntegerKey(key);
        if (targetIsArray && key === "length") {
          const newLength = Number(newValue);
          depsMap.forEach((dep, key2) => {
            if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol$1(key2) && key2 >= newLength) {
              run(dep);
            }
          });
        } else {
          if (key !== void 0 || depsMap.has(void 0)) {
            run(depsMap.get(key));
          }
          if (isArrayIndex) {
            run(depsMap.get(ARRAY_ITERATE_KEY));
          }
          switch (type) {
            case "add":
              if (!targetIsArray) {
                run(depsMap.get(ITERATE_KEY));
                if (isMap(target)) {
                  run(depsMap.get(MAP_KEY_ITERATE_KEY));
                }
              } else if (isArrayIndex) {
                run(depsMap.get("length"));
              }
              break;
            case "delete":
              if (!targetIsArray) {
                run(depsMap.get(ITERATE_KEY));
                if (isMap(target)) {
                  run(depsMap.get(MAP_KEY_ITERATE_KEY));
                }
              }
              break;
            case "set":
              if (isMap(target)) {
                run(depsMap.get(ITERATE_KEY));
              }
              break;
          }
        }
      }
      endBatch();
    }
    function getDepFromReactive(object, key) {
      const depMap = targetMap.get(object);
      return depMap && depMap.get(key);
    }
    function reactiveReadArray(array) {
      const raw = toRaw(array);
      if (raw === array) return raw;
      track(raw, "iterate", ARRAY_ITERATE_KEY);
      return isShallow(array) ? raw : raw.map(toReactive);
    }
    function shallowReadArray(arr) {
      track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
      return arr;
    }
    const arrayInstrumentations = {
      __proto__: null,
      [Symbol.iterator]() {
        return iterator(this, Symbol.iterator, toReactive);
      },
      concat(...args) {
        return reactiveReadArray(this).concat(
          ...args.map((x) => isArray$3(x) ? reactiveReadArray(x) : x)
        );
      },
      entries() {
        return iterator(this, "entries", (value) => {
          value[1] = toReactive(value[1]);
          return value;
        });
      },
      every(fn, thisArg) {
        return apply$2(this, "every", fn, thisArg, void 0, arguments);
      },
      filter(fn, thisArg) {
        return apply$2(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
      },
      find(fn, thisArg) {
        return apply$2(this, "find", fn, thisArg, toReactive, arguments);
      },
      findIndex(fn, thisArg) {
        return apply$2(this, "findIndex", fn, thisArg, void 0, arguments);
      },
      findLast(fn, thisArg) {
        return apply$2(this, "findLast", fn, thisArg, toReactive, arguments);
      },
      findLastIndex(fn, thisArg) {
        return apply$2(this, "findLastIndex", fn, thisArg, void 0, arguments);
      },
      // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
      forEach(fn, thisArg) {
        return apply$2(this, "forEach", fn, thisArg, void 0, arguments);
      },
      includes(...args) {
        return searchProxy(this, "includes", args);
      },
      indexOf(...args) {
        return searchProxy(this, "indexOf", args);
      },
      join(separator) {
        return reactiveReadArray(this).join(separator);
      },
      // keys() iterator only reads `length`, no optimisation required
      lastIndexOf(...args) {
        return searchProxy(this, "lastIndexOf", args);
      },
      map(fn, thisArg) {
        return apply$2(this, "map", fn, thisArg, void 0, arguments);
      },
      pop() {
        return noTracking(this, "pop");
      },
      push(...args) {
        return noTracking(this, "push", args);
      },
      reduce(fn, ...args) {
        return reduce(this, "reduce", fn, args);
      },
      reduceRight(fn, ...args) {
        return reduce(this, "reduceRight", fn, args);
      },
      shift() {
        return noTracking(this, "shift");
      },
      // slice could use ARRAY_ITERATE but also seems to beg for range tracking
      some(fn, thisArg) {
        return apply$2(this, "some", fn, thisArg, void 0, arguments);
      },
      splice(...args) {
        return noTracking(this, "splice", args);
      },
      toReversed() {
        return reactiveReadArray(this).toReversed();
      },
      toSorted(comparer) {
        return reactiveReadArray(this).toSorted(comparer);
      },
      toSpliced(...args) {
        return reactiveReadArray(this).toSpliced(...args);
      },
      unshift(...args) {
        return noTracking(this, "unshift", args);
      },
      values() {
        return iterator(this, "values", toReactive);
      }
    };
    function iterator(self2, method, wrapValue) {
      const arr = shallowReadArray(self2);
      const iter = arr[method]();
      if (arr !== self2 && !isShallow(self2)) {
        iter._next = iter.next;
        iter.next = () => {
          const result = iter._next();
          if (result.value) {
            result.value = wrapValue(result.value);
          }
          return result;
        };
      }
      return iter;
    }
    const arrayProto$1 = Array.prototype;
    function apply$2(self2, method, fn, thisArg, wrappedRetFn, args) {
      const arr = shallowReadArray(self2);
      const needsWrap = arr !== self2 && !isShallow(self2);
      const methodFn = arr[method];
      if (methodFn !== arrayProto$1[method]) {
        const result2 = methodFn.apply(self2, args);
        return needsWrap ? toReactive(result2) : result2;
      }
      let wrappedFn = fn;
      if (arr !== self2) {
        if (needsWrap) {
          wrappedFn = function(item, index) {
            return fn.call(this, toReactive(item), index, self2);
          };
        } else if (fn.length > 2) {
          wrappedFn = function(item, index) {
            return fn.call(this, item, index, self2);
          };
        }
      }
      const result = methodFn.call(arr, wrappedFn, thisArg);
      return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
    }
    function reduce(self2, method, fn, args) {
      const arr = shallowReadArray(self2);
      let wrappedFn = fn;
      if (arr !== self2) {
        if (!isShallow(self2)) {
          wrappedFn = function(acc, item, index) {
            return fn.call(this, acc, toReactive(item), index, self2);
          };
        } else if (fn.length > 3) {
          wrappedFn = function(acc, item, index) {
            return fn.call(this, acc, item, index, self2);
          };
        }
      }
      return arr[method](wrappedFn, ...args);
    }
    function searchProxy(self2, method, args) {
      const arr = toRaw(self2);
      track(arr, "iterate", ARRAY_ITERATE_KEY);
      const res = arr[method](...args);
      if ((res === -1 || res === false) && isProxy(args[0])) {
        args[0] = toRaw(args[0]);
        return arr[method](...args);
      }
      return res;
    }
    function noTracking(self2, method, args = []) {
      pauseTracking();
      startBatch();
      const res = toRaw(self2)[method].apply(self2, args);
      endBatch();
      resetTracking();
      return res;
    }
    const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
    const builtInSymbols = new Set(
      /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol$1)
    );
    function hasOwnProperty$d(key) {
      if (!isSymbol$1(key)) key = String(key);
      const obj = toRaw(this);
      track(obj, "has", key);
      return obj.hasOwnProperty(key);
    }
    class BaseReactiveHandler {
      constructor(_isReadonly = false, _isShallow = false) {
        this._isReadonly = _isReadonly;
        this._isShallow = _isShallow;
      }
      get(target, key, receiver) {
        const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
        if (key === "__v_isReactive") {
          return !isReadonly2;
        } else if (key === "__v_isReadonly") {
          return isReadonly2;
        } else if (key === "__v_isShallow") {
          return isShallow2;
        } else if (key === "__v_raw") {
          if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
          // this means the receiver is a user proxy of the reactive proxy
          Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
            return target;
          }
          return;
        }
        const targetIsArray = isArray$3(target);
        if (!isReadonly2) {
          let fn;
          if (targetIsArray && (fn = arrayInstrumentations[key])) {
            return fn;
          }
          if (key === "hasOwnProperty") {
            return hasOwnProperty$d;
          }
        }
        const res = Reflect.get(
          target,
          key,
          // if this is a proxy wrapping a ref, return methods using the raw ref
          // as receiver so that we don't have to call `toRaw` on the ref in all
          // its class methods
          isRef(target) ? target : receiver
        );
        if (isSymbol$1(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
          return res;
        }
        if (!isReadonly2) {
          track(target, "get", key);
        }
        if (isShallow2) {
          return res;
        }
        if (isRef(res)) {
          return targetIsArray && isIntegerKey(key) ? res : res.value;
        }
        if (isObject$4(res)) {
          return isReadonly2 ? readonly(res) : reactive(res);
        }
        return res;
      }
    }
    class MutableReactiveHandler extends BaseReactiveHandler {
      constructor(isShallow2 = false) {
        super(false, isShallow2);
      }
      set(target, key, value, receiver) {
        let oldValue = target[key];
        if (!this._isShallow) {
          const isOldValueReadonly = isReadonly(oldValue);
          if (!isShallow(value) && !isReadonly(value)) {
            oldValue = toRaw(oldValue);
            value = toRaw(value);
          }
          if (!isArray$3(target) && isRef(oldValue) && !isRef(value)) {
            if (isOldValueReadonly) {
              return false;
            } else {
              oldValue.value = value;
              return true;
            }
          }
        }
        const hadKey = isArray$3(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
        const result = Reflect.set(
          target,
          key,
          value,
          isRef(target) ? target : receiver
        );
        if (target === toRaw(receiver)) {
          if (!hadKey) {
            trigger$1(target, "add", key, value);
          } else if (hasChanged(value, oldValue)) {
            trigger$1(target, "set", key, value);
          }
        }
        return result;
      }
      deleteProperty(target, key) {
        const hadKey = hasOwn$1(target, key);
        target[key];
        const result = Reflect.deleteProperty(target, key);
        if (result && hadKey) {
          trigger$1(target, "delete", key, void 0);
        }
        return result;
      }
      has(target, key) {
        const result = Reflect.has(target, key);
        if (!isSymbol$1(key) || !builtInSymbols.has(key)) {
          track(target, "has", key);
        }
        return result;
      }
      ownKeys(target) {
        track(
          target,
          "iterate",
          isArray$3(target) ? "length" : ITERATE_KEY
        );
        return Reflect.ownKeys(target);
      }
    }
    class ReadonlyReactiveHandler extends BaseReactiveHandler {
      constructor(isShallow2 = false) {
        super(true, isShallow2);
      }
      set(target, key) {
        return true;
      }
      deleteProperty(target, key) {
        return true;
      }
    }
    const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
    const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
    const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
    const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
    const toShallow = (value) => value;
    const getProto = (v) => Reflect.getPrototypeOf(v);
    function createIterableMethod(method, isReadonly2, isShallow2) {
      return function(...args) {
        const target = this["__v_raw"];
        const rawTarget = toRaw(target);
        const targetIsMap = isMap(rawTarget);
        const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
        const isKeyOnly = method === "keys" && targetIsMap;
        const innerIterator = target[method](...args);
        const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
        !isReadonly2 && track(
          rawTarget,
          "iterate",
          isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
        );
        return {
          // iterator protocol
          next() {
            const { value, done } = innerIterator.next();
            return done ? { value, done } : {
              value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
              done
            };
          },
          // iterable protocol
          [Symbol.iterator]() {
            return this;
          }
        };
      };
    }
    function createReadonlyMethod(type) {
      return function(...args) {
        return type === "delete" ? false : type === "clear" ? void 0 : this;
      };
    }
    function createInstrumentations(readonly2, shallow) {
      const instrumentations = {
        get(key) {
          const target = this["__v_raw"];
          const rawTarget = toRaw(target);
          const rawKey = toRaw(key);
          if (!readonly2) {
            if (hasChanged(key, rawKey)) {
              track(rawTarget, "get", key);
            }
            track(rawTarget, "get", rawKey);
          }
          const { has } = getProto(rawTarget);
          const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
          if (has.call(rawTarget, key)) {
            return wrap(target.get(key));
          } else if (has.call(rawTarget, rawKey)) {
            return wrap(target.get(rawKey));
          } else if (target !== rawTarget) {
            target.get(key);
          }
        },
        get size() {
          const target = this["__v_raw"];
          !readonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
          return Reflect.get(target, "size", target);
        },
        has(key) {
          const target = this["__v_raw"];
          const rawTarget = toRaw(target);
          const rawKey = toRaw(key);
          if (!readonly2) {
            if (hasChanged(key, rawKey)) {
              track(rawTarget, "has", key);
            }
            track(rawTarget, "has", rawKey);
          }
          return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
        },
        forEach(callback, thisArg) {
          const observed = this;
          const target = observed["__v_raw"];
          const rawTarget = toRaw(target);
          const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
          !readonly2 && track(rawTarget, "iterate", ITERATE_KEY);
          return target.forEach((value, key) => {
            return callback.call(thisArg, wrap(value), wrap(key), observed);
          });
        }
      };
      extend(
        instrumentations,
        readonly2 ? {
          add: createReadonlyMethod("add"),
          set: createReadonlyMethod("set"),
          delete: createReadonlyMethod("delete"),
          clear: createReadonlyMethod("clear")
        } : {
          add(value) {
            if (!shallow && !isShallow(value) && !isReadonly(value)) {
              value = toRaw(value);
            }
            const target = toRaw(this);
            const proto = getProto(target);
            const hadKey = proto.has.call(target, value);
            if (!hadKey) {
              target.add(value);
              trigger$1(target, "add", value, value);
            }
            return this;
          },
          set(key, value) {
            if (!shallow && !isShallow(value) && !isReadonly(value)) {
              value = toRaw(value);
            }
            const target = toRaw(this);
            const { has, get: get2 } = getProto(target);
            let hadKey = has.call(target, key);
            if (!hadKey) {
              key = toRaw(key);
              hadKey = has.call(target, key);
            }
            const oldValue = get2.call(target, key);
            target.set(key, value);
            if (!hadKey) {
              trigger$1(target, "add", key, value);
            } else if (hasChanged(value, oldValue)) {
              trigger$1(target, "set", key, value);
            }
            return this;
          },
          delete(key) {
            const target = toRaw(this);
            const { has, get: get2 } = getProto(target);
            let hadKey = has.call(target, key);
            if (!hadKey) {
              key = toRaw(key);
              hadKey = has.call(target, key);
            }
            get2 ? get2.call(target, key) : void 0;
            const result = target.delete(key);
            if (hadKey) {
              trigger$1(target, "delete", key, void 0);
            }
            return result;
          },
          clear() {
            const target = toRaw(this);
            const hadItems = target.size !== 0;
            const result = target.clear();
            if (hadItems) {
              trigger$1(
                target,
                "clear",
                void 0,
                void 0
              );
            }
            return result;
          }
        }
      );
      const iteratorMethods = [
        "keys",
        "values",
        "entries",
        Symbol.iterator
      ];
      iteratorMethods.forEach((method) => {
        instrumentations[method] = createIterableMethod(method, readonly2, shallow);
      });
      return instrumentations;
    }
    function createInstrumentationGetter(isReadonly2, shallow) {
      const instrumentations = createInstrumentations(isReadonly2, shallow);
      return (target, key, receiver) => {
        if (key === "__v_isReactive") {
          return !isReadonly2;
        } else if (key === "__v_isReadonly") {
          return isReadonly2;
        } else if (key === "__v_raw") {
          return target;
        }
        return Reflect.get(
          hasOwn$1(instrumentations, key) && key in target ? instrumentations : target,
          key,
          receiver
        );
      };
    }
    const mutableCollectionHandlers = {
      get: /* @__PURE__ */ createInstrumentationGetter(false, false)
    };
    const shallowCollectionHandlers = {
      get: /* @__PURE__ */ createInstrumentationGetter(false, true)
    };
    const readonlyCollectionHandlers = {
      get: /* @__PURE__ */ createInstrumentationGetter(true, false)
    };
    const shallowReadonlyCollectionHandlers = {
      get: /* @__PURE__ */ createInstrumentationGetter(true, true)
    };
    const reactiveMap = /* @__PURE__ */ new WeakMap();
    const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
    const readonlyMap = /* @__PURE__ */ new WeakMap();
    const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
    function targetTypeMap(rawType) {
      switch (rawType) {
        case "Object":
        case "Array":
          return 1;
        case "Map":
        case "Set":
        case "WeakMap":
        case "WeakSet":
          return 2;
        default:
          return 0;
      }
    }
    function getTargetType(value) {
      return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
    }
    function reactive(target) {
      if (isReadonly(target)) {
        return target;
      }
      return createReactiveObject(
        target,
        false,
        mutableHandlers,
        mutableCollectionHandlers,
        reactiveMap
      );
    }
    function shallowReactive(target) {
      return createReactiveObject(
        target,
        false,
        shallowReactiveHandlers,
        shallowCollectionHandlers,
        shallowReactiveMap
      );
    }
    function readonly(target) {
      return createReactiveObject(
        target,
        true,
        readonlyHandlers,
        readonlyCollectionHandlers,
        readonlyMap
      );
    }
    function shallowReadonly(target) {
      return createReactiveObject(
        target,
        true,
        shallowReadonlyHandlers,
        shallowReadonlyCollectionHandlers,
        shallowReadonlyMap
      );
    }
    function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
      if (!isObject$4(target)) {
        return target;
      }
      if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
        return target;
      }
      const existingProxy = proxyMap.get(target);
      if (existingProxy) {
        return existingProxy;
      }
      const targetType = getTargetType(target);
      if (targetType === 0) {
        return target;
      }
      const proxy = new Proxy(
        target,
        targetType === 2 ? collectionHandlers : baseHandlers
      );
      proxyMap.set(target, proxy);
      return proxy;
    }
    function isReactive(value) {
      if (isReadonly(value)) {
        return isReactive(value["__v_raw"]);
      }
      return !!(value && value["__v_isReactive"]);
    }
    function isReadonly(value) {
      return !!(value && value["__v_isReadonly"]);
    }
    function isShallow(value) {
      return !!(value && value["__v_isShallow"]);
    }
    function isProxy(value) {
      return value ? !!value["__v_raw"] : false;
    }
    function toRaw(observed) {
      const raw = observed && observed["__v_raw"];
      return raw ? toRaw(raw) : observed;
    }
    function markRaw(value) {
      if (!hasOwn$1(value, "__v_skip") && Object.isExtensible(value)) {
        def(value, "__v_skip", true);
      }
      return value;
    }
    const toReactive = (value) => isObject$4(value) ? reactive(value) : value;
    const toReadonly = (value) => isObject$4(value) ? readonly(value) : value;
    function isRef(r) {
      return r ? r["__v_isRef"] === true : false;
    }
    function ref(value) {
      return createRef(value, false);
    }
    function shallowRef(value) {
      return createRef(value, true);
    }
    function createRef(rawValue, shallow) {
      if (isRef(rawValue)) {
        return rawValue;
      }
      return new RefImpl(rawValue, shallow);
    }
    class RefImpl {
      constructor(value, isShallow2) {
        this.dep = new Dep();
        this["__v_isRef"] = true;
        this["__v_isShallow"] = false;
        this._rawValue = isShallow2 ? value : toRaw(value);
        this._value = isShallow2 ? value : toReactive(value);
        this["__v_isShallow"] = isShallow2;
      }
      get value() {
        {
          this.dep.track();
        }
        return this._value;
      }
      set value(newValue) {
        const oldValue = this._rawValue;
        const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
        newValue = useDirectValue ? newValue : toRaw(newValue);
        if (hasChanged(newValue, oldValue)) {
          this._rawValue = newValue;
          this._value = useDirectValue ? newValue : toReactive(newValue);
          {
            this.dep.trigger();
          }
        }
      }
    }
    function unref(ref2) {
      return isRef(ref2) ? ref2.value : ref2;
    }
    const shallowUnwrapHandlers = {
      get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
      set: (target, key, value, receiver) => {
        const oldValue = target[key];
        if (isRef(oldValue) && !isRef(value)) {
          oldValue.value = value;
          return true;
        } else {
          return Reflect.set(target, key, value, receiver);
        }
      }
    };
    function proxyRefs(objectWithRefs) {
      return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
    }
    function toRefs(object) {
      const ret = isArray$3(object) ? new Array(object.length) : {};
      for (const key in object) {
        ret[key] = propertyToRef(object, key);
      }
      return ret;
    }
    class ObjectRefImpl {
      constructor(_object, _key, _defaultValue) {
        this._object = _object;
        this._key = _key;
        this._defaultValue = _defaultValue;
        this["__v_isRef"] = true;
        this._value = void 0;
      }
      get value() {
        const val = this._object[this._key];
        return this._value = val === void 0 ? this._defaultValue : val;
      }
      set value(newVal) {
        this._object[this._key] = newVal;
      }
      get dep() {
        return getDepFromReactive(toRaw(this._object), this._key);
      }
    }
    class GetterRefImpl {
      constructor(_getter) {
        this._getter = _getter;
        this["__v_isRef"] = true;
        this["__v_isReadonly"] = true;
        this._value = void 0;
      }
      get value() {
        return this._value = this._getter();
      }
    }
    function toRef(source, key, defaultValue) {
      if (isRef(source)) {
        return source;
      } else if (isFunction$2(source)) {
        return new GetterRefImpl(source);
      } else if (isObject$4(source) && arguments.length > 1) {
        return propertyToRef(source, key, defaultValue);
      } else {
        return ref(source);
      }
    }
    function propertyToRef(source, key, defaultValue) {
      const val = source[key];
      return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
    }
    class ComputedRefImpl {
      constructor(fn, setter, isSSR) {
        this.fn = fn;
        this.setter = setter;
        this._value = void 0;
        this.dep = new Dep(this);
        this.__v_isRef = true;
        this.deps = void 0;
        this.depsTail = void 0;
        this.flags = 16;
        this.globalVersion = globalVersion - 1;
        this.next = void 0;
        this.effect = this;
        this["__v_isReadonly"] = !setter;
        this.isSSR = isSSR;
      }
      /**
       * @internal
       */
      notify() {
        this.flags |= 16;
        if (!(this.flags & 8) && // avoid infinite self recursion
        activeSub !== this) {
          batch(this, true);
          return true;
        }
      }
      get value() {
        const link = this.dep.track();
        refreshComputed(this);
        if (link) {
          link.version = this.dep.version;
        }
        return this._value;
      }
      set value(newValue) {
        if (this.setter) {
          this.setter(newValue);
        }
      }
    }
    function computed$1(getterOrOptions, debugOptions, isSSR = false) {
      let getter;
      let setter;
      if (isFunction$2(getterOrOptions)) {
        getter = getterOrOptions;
      } else {
        getter = getterOrOptions.get;
        setter = getterOrOptions.set;
      }
      const cRef = new ComputedRefImpl(getter, setter, isSSR);
      return cRef;
    }
    const INITIAL_WATCHER_VALUE = {};
    const cleanupMap = /* @__PURE__ */ new WeakMap();
    let activeWatcher = void 0;
    function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
      if (owner) {
        let cleanups = cleanupMap.get(owner);
        if (!cleanups) cleanupMap.set(owner, cleanups = []);
        cleanups.push(cleanupFn);
      }
    }
    function watch$1(source, cb, options = EMPTY_OBJ) {
      const { immediate, deep, once, scheduler: scheduler2, augmentJob, call: call2 } = options;
      const reactiveGetter = (source2) => {
        if (deep) return source2;
        if (isShallow(source2) || deep === false || deep === 0)
          return traverse(source2, 1);
        return traverse(source2);
      };
      let effect2;
      let getter;
      let cleanup;
      let boundCleanup;
      let forceTrigger = false;
      let isMultiSource = false;
      if (isRef(source)) {
        getter = () => source.value;
        forceTrigger = isShallow(source);
      } else if (isReactive(source)) {
        getter = () => reactiveGetter(source);
        forceTrigger = true;
      } else if (isArray$3(source)) {
        isMultiSource = true;
        forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
        getter = () => source.map((s) => {
          if (isRef(s)) {
            return s.value;
          } else if (isReactive(s)) {
            return reactiveGetter(s);
          } else if (isFunction$2(s)) {
            return call2 ? call2(s, 2) : s();
          } else ;
        });
      } else if (isFunction$2(source)) {
        if (cb) {
          getter = call2 ? () => call2(source, 2) : source;
        } else {
          getter = () => {
            if (cleanup) {
              pauseTracking();
              try {
                cleanup();
              } finally {
                resetTracking();
              }
            }
            const currentEffect = activeWatcher;
            activeWatcher = effect2;
            try {
              return call2 ? call2(source, 3, [boundCleanup]) : source(boundCleanup);
            } finally {
              activeWatcher = currentEffect;
            }
          };
        }
      } else {
        getter = NOOP;
      }
      if (cb && deep) {
        const baseGetter = getter;
        const depth = deep === true ? Infinity : deep;
        getter = () => traverse(baseGetter(), depth);
      }
      const scope = getCurrentScope();
      const watchHandle = () => {
        effect2.stop();
        if (scope) {
          remove(scope.effects, effect2);
        }
      };
      if (once && cb) {
        const _cb = cb;
        cb = (...args) => {
          _cb(...args);
          watchHandle();
        };
      }
      let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
      const job = (immediateFirstRun) => {
        if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) {
          return;
        }
        if (cb) {
          const newValue = effect2.run();
          if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
            if (cleanup) {
              cleanup();
            }
            const currentWatcher = activeWatcher;
            activeWatcher = effect2;
            try {
              const args = [
                newValue,
                // pass undefined as the old value when it's changed for the first time
                oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
                boundCleanup
              ];
              call2 ? call2(cb, 3, args) : (
                // @ts-expect-error
                cb(...args)
              );
              oldValue = newValue;
            } finally {
              activeWatcher = currentWatcher;
            }
          }
        } else {
          effect2.run();
        }
      };
      if (augmentJob) {
        augmentJob(job);
      }
      effect2 = new ReactiveEffect(getter);
      effect2.scheduler = scheduler2 ? () => scheduler2(job, false) : job;
      boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2);
      cleanup = effect2.onStop = () => {
        const cleanups = cleanupMap.get(effect2);
        if (cleanups) {
          if (call2) {
            call2(cleanups, 4);
          } else {
            for (const cleanup2 of cleanups) cleanup2();
          }
          cleanupMap.delete(effect2);
        }
      };
      if (cb) {
        if (immediate) {
          job(true);
        } else {
          oldValue = effect2.run();
        }
      } else if (scheduler2) {
        scheduler2(job.bind(null, true), true);
      } else {
        effect2.run();
      }
      watchHandle.pause = effect2.pause.bind(effect2);
      watchHandle.resume = effect2.resume.bind(effect2);
      watchHandle.stop = watchHandle;
      return watchHandle;
    }
    function traverse(value, depth = Infinity, seen) {
      if (depth <= 0 || !isObject$4(value) || value["__v_skip"]) {
        return value;
      }
      seen = seen || /* @__PURE__ */ new Set();
      if (seen.has(value)) {
        return value;
      }
      seen.add(value);
      depth--;
      if (isRef(value)) {
        traverse(value.value, depth, seen);
      } else if (isArray$3(value)) {
        for (let i = 0; i < value.length; i++) {
          traverse(value[i], depth, seen);
        }
      } else if (isSet(value) || isMap(value)) {
        value.forEach((v) => {
          traverse(v, depth, seen);
        });
      } else if (isPlainObject$3(value)) {
        for (const key in value) {
          traverse(value[key], depth, seen);
        }
        for (const key of Object.getOwnPropertySymbols(value)) {
          if (Object.prototype.propertyIsEnumerable.call(value, key)) {
            traverse(value[key], depth, seen);
          }
        }
      }
      return value;
    }
    /**
    * @vue/runtime-core v3.5.12
    * (c) 2018-present Yuxi (Evan) You and Vue contributors
    * @license MIT
    **/
    const stack$1 = [];
    let isWarning = false;
    function warn$1$1(msg2, ...args) {
      if (isWarning) return;
      isWarning = true;
      pauseTracking();
      const instance = stack$1.length ? stack$1[stack$1.length - 1].component : null;
      const appWarnHandler = instance && instance.appContext.config.warnHandler;
      const trace = getComponentTrace();
      if (appWarnHandler) {
        callWithErrorHandling(
          appWarnHandler,
          instance,
          11,
          [
            // eslint-disable-next-line no-restricted-syntax
            msg2 + args.map((a) => {
              var _a, _b;
              return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
            }).join(""),
            instance && instance.proxy,
            trace.map(
              ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
            ).join("\n"),
            trace
          ]
        );
      } else {
        const warnArgs = [`[Vue warn]: ${msg2}`, ...args];
        if (trace.length && // avoid spamming console during tests
        true) {
          warnArgs.push(`
`, ...formatTrace(trace));
        }
        console.warn(...warnArgs);
      }
      resetTracking();
      isWarning = false;
    }
    function getComponentTrace() {
      let currentVNode = stack$1[stack$1.length - 1];
      if (!currentVNode) {
        return [];
      }
      const normalizedStack = [];
      while (currentVNode) {
        const last = normalizedStack[0];
        if (last && last.vnode === currentVNode) {
          last.recurseCount++;
        } else {
          normalizedStack.push({
            vnode: currentVNode,
            recurseCount: 0
          });
        }
        const parentInstance = currentVNode.component && currentVNode.component.parent;
        currentVNode = parentInstance && parentInstance.vnode;
      }
      return normalizedStack;
    }
    function formatTrace(trace) {
      const logs = [];
      trace.forEach((entry, i) => {
        logs.push(...i === 0 ? [] : [`
`], ...formatTraceEntry(entry));
      });
      return logs;
    }
    function formatTraceEntry({ vnode, recurseCount }) {
      const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
      const isRoot = vnode.component ? vnode.component.parent == null : false;
      const open = ` at <${formatComponentName(
        vnode.component,
        vnode.type,
        isRoot
      )}`;
      const close = `>` + postfix;
      return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
    }
    function formatProps(props) {
      const res = [];
      const keys2 = Object.keys(props);
      keys2.slice(0, 3).forEach((key) => {
        res.push(...formatProp(key, props[key]));
      });
      if (keys2.length > 3) {
        res.push(` ...`);
      }
      return res;
    }
    function formatProp(key, value, raw) {
      if (isString$2(value)) {
        value = JSON.stringify(value);
        return raw ? value : [`${key}=${value}`];
      } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
        return raw ? value : [`${key}=${value}`];
      } else if (isRef(value)) {
        value = formatProp(key, toRaw(value.value), true);
        return raw ? value : [`${key}=Ref<`, value, `>`];
      } else if (isFunction$2(value)) {
        return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
      } else {
        value = toRaw(value);
        return raw ? value : [`${key}=`, value];
      }
    }
    function callWithErrorHandling(fn, instance, type, args) {
      try {
        return args ? fn(...args) : fn();
      } catch (err) {
        handleError(err, instance, type);
      }
    }
    function callWithAsyncErrorHandling(fn, instance, type, args) {
      if (isFunction$2(fn)) {
        const res = callWithErrorHandling(fn, instance, type, args);
        if (res && isPromise$1(res)) {
          res.catch((err) => {
            handleError(err, instance, type);
          });
        }
        return res;
      }
      if (isArray$3(fn)) {
        const values = [];
        for (let i = 0; i < fn.length; i++) {
          values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
        }
        return values;
      }
    }
    function handleError(err, instance, type, throwInDev = true) {
      const contextVNode = instance ? instance.vnode : null;
      const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
      if (instance) {
        let cur = instance.parent;
        const exposedInstance = instance.proxy;
        const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
        while (cur) {
          const errorCapturedHooks = cur.ec;
          if (errorCapturedHooks) {
            for (let i = 0; i < errorCapturedHooks.length; i++) {
              if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
                return;
              }
            }
          }
          cur = cur.parent;
        }
        if (errorHandler) {
          pauseTracking();
          callWithErrorHandling(errorHandler, null, 10, [
            err,
            exposedInstance,
            errorInfo
          ]);
          resetTracking();
          return;
        }
      }
      logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
    }
    function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
      if (throwInProd) {
        throw err;
      } else {
        console.error(err);
      }
    }
    const queue = [];
    let flushIndex = -1;
    const pendingPostFlushCbs = [];
    let activePostFlushCbs = null;
    let postFlushIndex = 0;
    const resolvedPromise = /* @__PURE__ */ Promise.resolve();
    let currentFlushPromise = null;
    function nextTick(fn) {
      const p2 = currentFlushPromise || resolvedPromise;
      return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
    }
    function findInsertionIndex$1(id) {
      let start = flushIndex + 1;
      let end = queue.length;
      while (start < end) {
        const middle = start + end >>> 1;
        const middleJob = queue[middle];
        const middleJobId = getId(middleJob);
        if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
          start = middle + 1;
        } else {
          end = middle;
        }
      }
      return start;
    }
    function queueJob(job) {
      if (!(job.flags & 1)) {
        const jobId = getId(job);
        const lastJob = queue[queue.length - 1];
        if (!lastJob || // fast path when the job id is larger than the tail
        !(job.flags & 2) && jobId >= getId(lastJob)) {
          queue.push(job);
        } else {
          queue.splice(findInsertionIndex$1(jobId), 0, job);
        }
        job.flags |= 1;
        queueFlush();
      }
    }
    function queueFlush() {
      if (!currentFlushPromise) {
        currentFlushPromise = resolvedPromise.then(flushJobs);
      }
    }
    function queuePostFlushCb(cb) {
      if (!isArray$3(cb)) {
        if (activePostFlushCbs && cb.id === -1) {
          activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
        } else if (!(cb.flags & 1)) {
          pendingPostFlushCbs.push(cb);
          cb.flags |= 1;
        }
      } else {
        pendingPostFlushCbs.push(...cb);
      }
      queueFlush();
    }
    function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
      for (; i < queue.length; i++) {
        const cb = queue[i];
        if (cb && cb.flags & 2) {
          if (instance && cb.id !== instance.uid) {
            continue;
          }
          queue.splice(i, 1);
          i--;
          if (cb.flags & 4) {
            cb.flags &= ~1;
          }
          cb();
          if (!(cb.flags & 4)) {
            cb.flags &= ~1;
          }
        }
      }
    }
    function flushPostFlushCbs(seen) {
      if (pendingPostFlushCbs.length) {
        const deduped = [...new Set(pendingPostFlushCbs)].sort(
          (a, b) => getId(a) - getId(b)
        );
        pendingPostFlushCbs.length = 0;
        if (activePostFlushCbs) {
          activePostFlushCbs.push(...deduped);
          return;
        }
        activePostFlushCbs = deduped;
        for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
          const cb = activePostFlushCbs[postFlushIndex];
          if (cb.flags & 4) {
            cb.flags &= ~1;
          }
          if (!(cb.flags & 8)) cb();
          cb.flags &= ~1;
        }
        activePostFlushCbs = null;
        postFlushIndex = 0;
      }
    }
    const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
    function flushJobs(seen) {
      try {
        for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
          const job = queue[flushIndex];
          if (job && !(job.flags & 8)) {
            if (false) ;
            if (job.flags & 4) {
              job.flags &= ~1;
            }
            callWithErrorHandling(
              job,
              job.i,
              job.i ? 15 : 14
            );
            if (!(job.flags & 4)) {
              job.flags &= ~1;
            }
          }
        }
      } finally {
        for (; flushIndex < queue.length; flushIndex++) {
          const job = queue[flushIndex];
          if (job) {
            job.flags &= ~1;
          }
        }
        flushIndex = -1;
        queue.length = 0;
        flushPostFlushCbs();
        currentFlushPromise = null;
        if (queue.length || pendingPostFlushCbs.length) {
          flushJobs();
        }
      }
    }
    let currentRenderingInstance = null;
    let currentScopeId = null;
    function setCurrentRenderingInstance(instance) {
      const prev = currentRenderingInstance;
      currentRenderingInstance = instance;
      currentScopeId = instance && instance.type.__scopeId || null;
      return prev;
    }
    function withCtx(fn, ctx2 = currentRenderingInstance, isNonScopedSlot) {
      if (!ctx2) return fn;
      if (fn._n) {
        return fn;
      }
      const renderFnWithContext = (...args) => {
        if (renderFnWithContext._d) {
          setBlockTracking(-1);
        }
        const prevInstance = setCurrentRenderingInstance(ctx2);
        let res;
        try {
          res = fn(...args);
        } finally {
          setCurrentRenderingInstance(prevInstance);
          if (renderFnWithContext._d) {
            setBlockTracking(1);
          }
        }
        return res;
      };
      renderFnWithContext._n = true;
      renderFnWithContext._c = true;
      renderFnWithContext._d = true;
      return renderFnWithContext;
    }
    function withDirectives(vnode, directives) {
      if (currentRenderingInstance === null) {
        return vnode;
      }
      const instance = getComponentPublicInstance(currentRenderingInstance);
      const bindings = vnode.dirs || (vnode.dirs = []);
      for (let i = 0; i < directives.length; i++) {
        let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
        if (dir) {
          if (isFunction$2(dir)) {
            dir = {
              mounted: dir,
              updated: dir
            };
          }
          if (dir.deep) {
            traverse(value);
          }
          bindings.push({
            dir,
            instance,
            value,
            oldValue: void 0,
            arg,
            modifiers
          });
        }
      }
      return vnode;
    }
    function invokeDirectiveHook(vnode, prevVNode, instance, name) {
      const bindings = vnode.dirs;
      const oldBindings = prevVNode && prevVNode.dirs;
      for (let i = 0; i < bindings.length; i++) {
        const binding = bindings[i];
        if (oldBindings) {
          binding.oldValue = oldBindings[i].value;
        }
        let hook = binding.dir[name];
        if (hook) {
          pauseTracking();
          callWithAsyncErrorHandling(hook, instance, 8, [
            vnode.el,
            binding,
            vnode,
            prevVNode
          ]);
          resetTracking();
        }
      }
    }
    const TeleportEndKey = Symbol("_vte");
    const isTeleport = (type) => type.__isTeleport;
    const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
    const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
    const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
    const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
    const resolveTarget = (props, select) => {
      const targetSelector = props && props.to;
      if (isString$2(targetSelector)) {
        if (!select) {
          return null;
        } else {
          const target = select(targetSelector);
          return target;
        }
      } else {
        return targetSelector;
      }
    };
    const TeleportImpl = {
      name: "Teleport",
      __isTeleport: true,
      process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized, internals) {
        const {
          mc: mountChildren,
          pc: patchChildren,
          pbc: patchBlockChildren,
          o: { insert, querySelector, createText, createComment }
        } = internals;
        const disabled = isTeleportDisabled(n2.props);
        let { shapeFlag, children, dynamicChildren } = n2;
        if (n1 == null) {
          const placeholder = n2.el = createText("");
          const mainAnchor = n2.anchor = createText("");
          insert(placeholder, container, anchor);
          insert(mainAnchor, container, anchor);
          const mount2 = (container2, anchor2) => {
            if (shapeFlag & 16) {
              if (parentComponent && parentComponent.isCE) {
                parentComponent.ce._teleportTarget = container2;
              }
              mountChildren(
                children,
                container2,
                anchor2,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized
              );
            }
          };
          const mountToTarget = () => {
            const target = n2.target = resolveTarget(n2.props, querySelector);
            const targetAnchor = prepareAnchor(target, n2, createText, insert);
            if (target) {
              if (namespace2 !== "svg" && isTargetSVG(target)) {
                namespace2 = "svg";
              } else if (namespace2 !== "mathml" && isTargetMathML(target)) {
                namespace2 = "mathml";
              }
              if (!disabled) {
                mount2(target, targetAnchor);
                updateCssVars(n2, false);
              }
            }
          };
          if (disabled) {
            mount2(container, mainAnchor);
            updateCssVars(n2, true);
          }
          if (isTeleportDeferred(n2.props)) {
            queuePostRenderEffect(mountToTarget, parentSuspense);
          } else {
            mountToTarget();
          }
        } else {
          n2.el = n1.el;
          n2.targetStart = n1.targetStart;
          const mainAnchor = n2.anchor = n1.anchor;
          const target = n2.target = n1.target;
          const targetAnchor = n2.targetAnchor = n1.targetAnchor;
          const wasDisabled = isTeleportDisabled(n1.props);
          const currentContainer = wasDisabled ? container : target;
          const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
          if (namespace2 === "svg" || isTargetSVG(target)) {
            namespace2 = "svg";
          } else if (namespace2 === "mathml" || isTargetMathML(target)) {
            namespace2 = "mathml";
          }
          if (dynamicChildren) {
            patchBlockChildren(
              n1.dynamicChildren,
              dynamicChildren,
              currentContainer,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds
            );
            traverseStaticChildren(n1, n2, true);
          } else if (!optimized) {
            patchChildren(
              n1,
              n2,
              currentContainer,
              currentAnchor,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds,
              false
            );
          }
          if (disabled) {
            if (!wasDisabled) {
              moveTeleport(
                n2,
                container,
                mainAnchor,
                internals,
                1
              );
            } else {
              if (n2.props && n1.props && n2.props.to !== n1.props.to) {
                n2.props.to = n1.props.to;
              }
            }
          } else {
            if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
              const nextTarget = n2.target = resolveTarget(
                n2.props,
                querySelector
              );
              if (nextTarget) {
                moveTeleport(
                  n2,
                  nextTarget,
                  null,
                  internals,
                  0
                );
              }
            } else if (wasDisabled) {
              moveTeleport(
                n2,
                target,
                targetAnchor,
                internals,
                1
              );
            }
          }
          updateCssVars(n2, disabled);
        }
      },
      remove(vnode, parentComponent, parentSuspense, { um: unmount2, o: { remove: hostRemove } }, doRemove) {
        const {
          shapeFlag,
          children,
          anchor,
          targetStart,
          targetAnchor,
          target,
          props
        } = vnode;
        if (target) {
          hostRemove(targetStart);
          hostRemove(targetAnchor);
        }
        doRemove && hostRemove(anchor);
        if (shapeFlag & 16) {
          const shouldRemove = doRemove || !isTeleportDisabled(props);
          for (let i = 0; i < children.length; i++) {
            const child = children[i];
            unmount2(
              child,
              parentComponent,
              parentSuspense,
              shouldRemove,
              !!child.dynamicChildren
            );
          }
        }
      },
      move: moveTeleport,
      hydrate: hydrateTeleport
    };
    function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move2 }, moveType = 2) {
      if (moveType === 0) {
        insert(vnode.targetAnchor, container, parentAnchor);
      }
      const { el, anchor, shapeFlag, children, props } = vnode;
      const isReorder = moveType === 2;
      if (isReorder) {
        insert(el, container, parentAnchor);
      }
      if (!isReorder || isTeleportDisabled(props)) {
        if (shapeFlag & 16) {
          for (let i = 0; i < children.length; i++) {
            move2(
              children[i],
              container,
              parentAnchor,
              2
            );
          }
        }
      }
      if (isReorder) {
        insert(anchor, container, parentAnchor);
      }
    }
    function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
      o: { nextSibling, parentNode, querySelector, insert, createText }
    }, hydrateChildren) {
      const target = vnode.target = resolveTarget(
        vnode.props,
        querySelector
      );
      if (target) {
        const disabled = isTeleportDisabled(vnode.props);
        const targetNode = target._lpa || target.firstChild;
        if (vnode.shapeFlag & 16) {
          if (disabled) {
            vnode.anchor = hydrateChildren(
              nextSibling(node),
              vnode,
              parentNode(node),
              parentComponent,
              parentSuspense,
              slotScopeIds,
              optimized
            );
            vnode.targetStart = targetNode;
            vnode.targetAnchor = targetNode && nextSibling(targetNode);
          } else {
            vnode.anchor = nextSibling(node);
            let targetAnchor = targetNode;
            while (targetAnchor) {
              if (targetAnchor && targetAnchor.nodeType === 8) {
                if (targetAnchor.data === "teleport start anchor") {
                  vnode.targetStart = targetAnchor;
                } else if (targetAnchor.data === "teleport anchor") {
                  vnode.targetAnchor = targetAnchor;
                  target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
                  break;
                }
              }
              targetAnchor = nextSibling(targetAnchor);
            }
            if (!vnode.targetAnchor) {
              prepareAnchor(target, vnode, createText, insert);
            }
            hydrateChildren(
              targetNode && nextSibling(targetNode),
              vnode,
              target,
              parentComponent,
              parentSuspense,
              slotScopeIds,
              optimized
            );
          }
        }
        updateCssVars(vnode, disabled);
      }
      return vnode.anchor && nextSibling(vnode.anchor);
    }
    const Teleport = TeleportImpl;
    function updateCssVars(vnode, isDisabled2) {
      const ctx2 = vnode.ctx;
      if (ctx2 && ctx2.ut) {
        let node, anchor;
        if (isDisabled2) {
          node = vnode.el;
          anchor = vnode.anchor;
        } else {
          node = vnode.targetStart;
          anchor = vnode.targetAnchor;
        }
        while (node && node !== anchor) {
          if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx2.uid);
          node = node.nextSibling;
        }
        ctx2.ut();
      }
    }
    function prepareAnchor(target, vnode, createText, insert) {
      const targetStart = vnode.targetStart = createText("");
      const targetAnchor = vnode.targetAnchor = createText("");
      targetStart[TeleportEndKey] = targetAnchor;
      if (target) {
        insert(targetStart, target);
        insert(targetAnchor, target);
      }
      return targetAnchor;
    }
    const leaveCbKey = Symbol("_leaveCb");
    const enterCbKey$1 = Symbol("_enterCb");
    function useTransitionState() {
      const state = {
        isMounted: false,
        isLeaving: false,
        isUnmounting: false,
        leavingVNodes: /* @__PURE__ */ new Map()
      };
      onMounted(() => {
        state.isMounted = true;
      });
      onBeforeUnmount(() => {
        state.isUnmounting = true;
      });
      return state;
    }
    const TransitionHookValidator = [Function, Array];
    const BaseTransitionPropsValidators = {
      mode: String,
      appear: Boolean,
      persisted: Boolean,
      // enter
      onBeforeEnter: TransitionHookValidator,
      onEnter: TransitionHookValidator,
      onAfterEnter: TransitionHookValidator,
      onEnterCancelled: TransitionHookValidator,
      // leave
      onBeforeLeave: TransitionHookValidator,
      onLeave: TransitionHookValidator,
      onAfterLeave: TransitionHookValidator,
      onLeaveCancelled: TransitionHookValidator,
      // appear
      onBeforeAppear: TransitionHookValidator,
      onAppear: TransitionHookValidator,
      onAfterAppear: TransitionHookValidator,
      onAppearCancelled: TransitionHookValidator
    };
    const recursiveGetSubtree = (instance) => {
      const subTree = instance.subTree;
      return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
    };
    const BaseTransitionImpl = {
      name: `BaseTransition`,
      props: BaseTransitionPropsValidators,
      setup(props, { slots }) {
        const instance = getCurrentInstance();
        const state = useTransitionState();
        return () => {
          const children = slots.default && getTransitionRawChildren(slots.default(), true);
          if (!children || !children.length) {
            return;
          }
          const child = findNonCommentChild(children);
          const rawProps = toRaw(props);
          const { mode } = rawProps;
          if (state.isLeaving) {
            return emptyPlaceholder(child);
          }
          const innerChild = getInnerChild$1(child);
          if (!innerChild) {
            return emptyPlaceholder(child);
          }
          let enterHooks = resolveTransitionHooks(
            innerChild,
            rawProps,
            state,
            instance,
            // #11061, ensure enterHooks is fresh after clone
            (hooks) => enterHooks = hooks
          );
          if (innerChild.type !== Comment) {
            setTransitionHooks(innerChild, enterHooks);
          }
          const oldChild = instance.subTree;
          const oldInnerChild = oldChild && getInnerChild$1(oldChild);
          if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
            const leavingHooks = resolveTransitionHooks(
              oldInnerChild,
              rawProps,
              state,
              instance
            );
            setTransitionHooks(oldInnerChild, leavingHooks);
            if (mode === "out-in" && innerChild.type !== Comment) {
              state.isLeaving = true;
              leavingHooks.afterLeave = () => {
                state.isLeaving = false;
                if (!(instance.job.flags & 8)) {
                  instance.update();
                }
                delete leavingHooks.afterLeave;
              };
              return emptyPlaceholder(child);
            } else if (mode === "in-out" && innerChild.type !== Comment) {
              leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
                const leavingVNodesCache = getLeavingNodesForType(
                  state,
                  oldInnerChild
                );
                leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
                el[leaveCbKey] = () => {
                  earlyRemove();
                  el[leaveCbKey] = void 0;
                  delete enterHooks.delayedLeave;
                };
                enterHooks.delayedLeave = delayedLeave;
              };
            }
          }
          return child;
        };
      }
    };
    function findNonCommentChild(children) {
      let child = children[0];
      if (children.length > 1) {
        for (const c2 of children) {
          if (c2.type !== Comment) {
            child = c2;
            break;
          }
        }
      }
      return child;
    }
    const BaseTransition = BaseTransitionImpl;
    function getLeavingNodesForType(state, vnode) {
      const { leavingVNodes } = state;
      let leavingVNodesCache = leavingVNodes.get(vnode.type);
      if (!leavingVNodesCache) {
        leavingVNodesCache = /* @__PURE__ */ Object.create(null);
        leavingVNodes.set(vnode.type, leavingVNodesCache);
      }
      return leavingVNodesCache;
    }
    function resolveTransitionHooks(vnode, props, state, instance, postClone) {
      const {
        appear,
        mode,
        persisted = false,
        onBeforeEnter,
        onEnter,
        onAfterEnter,
        onEnterCancelled,
        onBeforeLeave,
        onLeave,
        onAfterLeave,
        onLeaveCancelled,
        onBeforeAppear,
        onAppear,
        onAfterAppear,
        onAppearCancelled
      } = props;
      const key = String(vnode.key);
      const leavingVNodesCache = getLeavingNodesForType(state, vnode);
      const callHook2 = (hook, args) => {
        hook && callWithAsyncErrorHandling(
          hook,
          instance,
          9,
          args
        );
      };
      const callAsyncHook = (hook, args) => {
        const done = args[1];
        callHook2(hook, args);
        if (isArray$3(hook)) {
          if (hook.every((hook2) => hook2.length <= 1)) done();
        } else if (hook.length <= 1) {
          done();
        }
      };
      const hooks = {
        mode,
        persisted,
        beforeEnter(el) {
          let hook = onBeforeEnter;
          if (!state.isMounted) {
            if (appear) {
              hook = onBeforeAppear || onBeforeEnter;
            } else {
              return;
            }
          }
          if (el[leaveCbKey]) {
            el[leaveCbKey](
              true
              /* cancelled */
            );
          }
          const leavingVNode = leavingVNodesCache[key];
          if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
            leavingVNode.el[leaveCbKey]();
          }
          callHook2(hook, [el]);
        },
        enter(el) {
          let hook = onEnter;
          let afterHook = onAfterEnter;
          let cancelHook = onEnterCancelled;
          if (!state.isMounted) {
            if (appear) {
              hook = onAppear || onEnter;
              afterHook = onAfterAppear || onAfterEnter;
              cancelHook = onAppearCancelled || onEnterCancelled;
            } else {
              return;
            }
          }
          let called = false;
          const done = el[enterCbKey$1] = (cancelled) => {
            if (called) return;
            called = true;
            if (cancelled) {
              callHook2(cancelHook, [el]);
            } else {
              callHook2(afterHook, [el]);
            }
            if (hooks.delayedLeave) {
              hooks.delayedLeave();
            }
            el[enterCbKey$1] = void 0;
          };
          if (hook) {
            callAsyncHook(hook, [el, done]);
          } else {
            done();
          }
        },
        leave(el, remove2) {
          const key2 = String(vnode.key);
          if (el[enterCbKey$1]) {
            el[enterCbKey$1](
              true
              /* cancelled */
            );
          }
          if (state.isUnmounting) {
            return remove2();
          }
          callHook2(onBeforeLeave, [el]);
          let called = false;
          const done = el[leaveCbKey] = (cancelled) => {
            if (called) return;
            called = true;
            remove2();
            if (cancelled) {
              callHook2(onLeaveCancelled, [el]);
            } else {
              callHook2(onAfterLeave, [el]);
            }
            el[leaveCbKey] = void 0;
            if (leavingVNodesCache[key2] === vnode) {
              delete leavingVNodesCache[key2];
            }
          };
          leavingVNodesCache[key2] = vnode;
          if (onLeave) {
            callAsyncHook(onLeave, [el, done]);
          } else {
            done();
          }
        },
        clone(vnode2) {
          const hooks2 = resolveTransitionHooks(
            vnode2,
            props,
            state,
            instance,
            postClone
          );
          if (postClone) postClone(hooks2);
          return hooks2;
        }
      };
      return hooks;
    }
    function emptyPlaceholder(vnode) {
      if (isKeepAlive(vnode)) {
        vnode = cloneVNode(vnode);
        vnode.children = null;
        return vnode;
      }
    }
    function getInnerChild$1(vnode) {
      if (!isKeepAlive(vnode)) {
        if (isTeleport(vnode.type) && vnode.children) {
          return findNonCommentChild(vnode.children);
        }
        return vnode;
      }
      const { shapeFlag, children } = vnode;
      if (children) {
        if (shapeFlag & 16) {
          return children[0];
        }
        if (shapeFlag & 32 && isFunction$2(children.default)) {
          return children.default();
        }
      }
    }
    function setTransitionHooks(vnode, hooks) {
      if (vnode.shapeFlag & 6 && vnode.component) {
        vnode.transition = hooks;
        setTransitionHooks(vnode.component.subTree, hooks);
      } else if (vnode.shapeFlag & 128) {
        vnode.ssContent.transition = hooks.clone(vnode.ssContent);
        vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
      } else {
        vnode.transition = hooks;
      }
    }
    function getTransitionRawChildren(children, keepComment = false, parentKey) {
      let ret = [];
      let keyedFragmentCount = 0;
      for (let i = 0; i < children.length; i++) {
        let child = children[i];
        const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
        if (child.type === Fragment) {
          if (child.patchFlag & 128) keyedFragmentCount++;
          ret = ret.concat(
            getTransitionRawChildren(child.children, keepComment, key)
          );
        } else if (keepComment || child.type !== Comment) {
          ret.push(key != null ? cloneVNode(child, { key }) : child);
        }
      }
      if (keyedFragmentCount > 1) {
        for (let i = 0; i < ret.length; i++) {
          ret[i].patchFlag = -2;
        }
      }
      return ret;
    }
    /*! #__NO_SIDE_EFFECTS__ */
    // @__NO_SIDE_EFFECTS__
    function defineComponent(options, extraOptions) {
      return isFunction$2(options) ? (
        // #8236: extend call and options.name access are considered side-effects
        // by Rollup, so we have to wrap it in a pure-annotated IIFE.
        /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
      ) : options;
    }
    function markAsyncBoundary(instance) {
      instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
    }
    function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
      if (isArray$3(rawRef)) {
        rawRef.forEach(
          (r, i) => setRef(
            r,
            oldRawRef && (isArray$3(oldRawRef) ? oldRawRef[i] : oldRawRef),
            parentSuspense,
            vnode,
            isUnmount
          )
        );
        return;
      }
      if (isAsyncWrapper(vnode) && !isUnmount) {
        return;
      }
      const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
      const value = isUnmount ? null : refValue;
      const { i: owner, r: ref3 } = rawRef;
      const oldRef = oldRawRef && oldRawRef.r;
      const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
      const setupState = owner.setupState;
      const rawSetupState = toRaw(setupState);
      const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
        return hasOwn$1(rawSetupState, key);
      };
      if (oldRef != null && oldRef !== ref3) {
        if (isString$2(oldRef)) {
          refs[oldRef] = null;
          if (canSetSetupRef(oldRef)) {
            setupState[oldRef] = null;
          }
        } else if (isRef(oldRef)) {
          oldRef.value = null;
        }
      }
      if (isFunction$2(ref3)) {
        callWithErrorHandling(ref3, owner, 12, [value, refs]);
      } else {
        const _isString = isString$2(ref3);
        const _isRef = isRef(ref3);
        if (_isString || _isRef) {
          const doSet = () => {
            if (rawRef.f) {
              const existing = _isString ? canSetSetupRef(ref3) ? setupState[ref3] : refs[ref3] : ref3.value;
              if (isUnmount) {
                isArray$3(existing) && remove(existing, refValue);
              } else {
                if (!isArray$3(existing)) {
                  if (_isString) {
                    refs[ref3] = [refValue];
                    if (canSetSetupRef(ref3)) {
                      setupState[ref3] = refs[ref3];
                    }
                  } else {
                    ref3.value = [refValue];
                    if (rawRef.k) refs[rawRef.k] = ref3.value;
                  }
                } else if (!existing.includes(refValue)) {
                  existing.push(refValue);
                }
              }
            } else if (_isString) {
              refs[ref3] = value;
              if (canSetSetupRef(ref3)) {
                setupState[ref3] = value;
              }
            } else if (_isRef) {
              ref3.value = value;
              if (rawRef.k) refs[rawRef.k] = value;
            } else ;
          };
          if (value) {
            doSet.id = -1;
            queuePostRenderEffect(doSet, parentSuspense);
          } else {
            doSet();
          }
        }
      }
    }
    getGlobalThis$1().requestIdleCallback || ((cb) => setTimeout(cb, 1));
    getGlobalThis$1().cancelIdleCallback || ((id) => clearTimeout(id));
    const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
    const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
    const KeepAliveImpl = {
      name: `KeepAlive`,
      // Marker for special handling inside the renderer. We are not using a ===
      // check directly on KeepAlive in the renderer, because importing it directly
      // would prevent it from being tree-shaken.
      __isKeepAlive: true,
      props: {
        include: [String, RegExp, Array],
        exclude: [String, RegExp, Array],
        max: [String, Number]
      },
      setup(props, { slots }) {
        const instance = getCurrentInstance();
        const sharedContext = instance.ctx;
        if (!sharedContext.renderer) {
          return () => {
            const children = slots.default && slots.default();
            return children && children.length === 1 ? children[0] : children;
          };
        }
        const cache2 = /* @__PURE__ */ new Map();
        const keys2 = /* @__PURE__ */ new Set();
        let current = null;
        const parentSuspense = instance.suspense;
        const {
          renderer: {
            p: patch,
            m: move2,
            um: _unmount,
            o: { createElement: createElement2 }
          }
        } = sharedContext;
        const storageContainer = createElement2("div");
        sharedContext.activate = (vnode, container, anchor, namespace2, optimized) => {
          const instance2 = vnode.component;
          move2(vnode, container, anchor, 0, parentSuspense);
          patch(
            instance2.vnode,
            vnode,
            container,
            anchor,
            instance2,
            parentSuspense,
            namespace2,
            vnode.slotScopeIds,
            optimized
          );
          queuePostRenderEffect(() => {
            instance2.isDeactivated = false;
            if (instance2.a) {
              invokeArrayFns(instance2.a);
            }
            const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
            if (vnodeHook) {
              invokeVNodeHook(vnodeHook, instance2.parent, vnode);
            }
          }, parentSuspense);
        };
        sharedContext.deactivate = (vnode) => {
          const instance2 = vnode.component;
          invalidateMount(instance2.m);
          invalidateMount(instance2.a);
          move2(vnode, storageContainer, null, 1, parentSuspense);
          queuePostRenderEffect(() => {
            if (instance2.da) {
              invokeArrayFns(instance2.da);
            }
            const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
            if (vnodeHook) {
              invokeVNodeHook(vnodeHook, instance2.parent, vnode);
            }
            instance2.isDeactivated = true;
          }, parentSuspense);
        };
        function unmount2(vnode) {
          resetShapeFlag(vnode);
          _unmount(vnode, instance, parentSuspense, true);
        }
        function pruneCache(filter) {
          cache2.forEach((vnode, key) => {
            const name = getComponentName(vnode.type);
            if (name && !filter(name)) {
              pruneCacheEntry(key);
            }
          });
        }
        function pruneCacheEntry(key) {
          const cached = cache2.get(key);
          if (cached && (!current || !isSameVNodeType(cached, current))) {
            unmount2(cached);
          } else if (current) {
            resetShapeFlag(current);
          }
          cache2.delete(key);
          keys2.delete(key);
        }
        watch(
          () => [props.include, props.exclude],
          ([include, exclude]) => {
            include && pruneCache((name) => matches(include, name));
            exclude && pruneCache((name) => !matches(exclude, name));
          },
          // prune post-render after `current` has been updated
          { flush: "post", deep: true }
        );
        let pendingCacheKey = null;
        const cacheSubtree = () => {
          if (pendingCacheKey != null) {
            if (isSuspense(instance.subTree.type)) {
              queuePostRenderEffect(() => {
                cache2.set(pendingCacheKey, getInnerChild(instance.subTree));
              }, instance.subTree.suspense);
            } else {
              cache2.set(pendingCacheKey, getInnerChild(instance.subTree));
            }
          }
        };
        onMounted(cacheSubtree);
        onUpdated(cacheSubtree);
        onBeforeUnmount(() => {
          cache2.forEach((cached) => {
            const { subTree, suspense } = instance;
            const vnode = getInnerChild(subTree);
            if (cached.type === vnode.type && cached.key === vnode.key) {
              resetShapeFlag(vnode);
              const da = vnode.component.da;
              da && queuePostRenderEffect(da, suspense);
              return;
            }
            unmount2(cached);
          });
        });
        return () => {
          pendingCacheKey = null;
          if (!slots.default) {
            return current = null;
          }
          const children = slots.default();
          const rawVNode = children[0];
          if (children.length > 1) {
            current = null;
            return children;
          } else if (!isVNode$1(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
            current = null;
            return rawVNode;
          }
          let vnode = getInnerChild(rawVNode);
          if (vnode.type === Comment) {
            current = null;
            return vnode;
          }
          const comp = vnode.type;
          const name = getComponentName(
            isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
          );
          const { include, exclude, max } = props;
          if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
            vnode.shapeFlag &= ~256;
            current = vnode;
            return rawVNode;
          }
          const key = vnode.key == null ? comp : vnode.key;
          const cachedVNode = cache2.get(key);
          if (vnode.el) {
            vnode = cloneVNode(vnode);
            if (rawVNode.shapeFlag & 128) {
              rawVNode.ssContent = vnode;
            }
          }
          pendingCacheKey = key;
          if (cachedVNode) {
            vnode.el = cachedVNode.el;
            vnode.component = cachedVNode.component;
            if (vnode.transition) {
              setTransitionHooks(vnode, vnode.transition);
            }
            vnode.shapeFlag |= 512;
            keys2.delete(key);
            keys2.add(key);
          } else {
            keys2.add(key);
            if (max && keys2.size > parseInt(max, 10)) {
              pruneCacheEntry(keys2.values().next().value);
            }
          }
          vnode.shapeFlag |= 256;
          current = vnode;
          return isSuspense(rawVNode.type) ? rawVNode : vnode;
        };
      }
    };
    const KeepAlive = KeepAliveImpl;
    function matches(pattern, name) {
      if (isArray$3(pattern)) {
        return pattern.some((p2) => matches(p2, name));
      } else if (isString$2(pattern)) {
        return pattern.split(",").includes(name);
      } else if (isRegExp$1(pattern)) {
        pattern.lastIndex = 0;
        return pattern.test(name);
      }
      return false;
    }
    function onActivated(hook, target) {
      registerKeepAliveHook(hook, "a", target);
    }
    function onDeactivated(hook, target) {
      registerKeepAliveHook(hook, "da", target);
    }
    function registerKeepAliveHook(hook, type, target = currentInstance) {
      const wrappedHook = hook.__wdc || (hook.__wdc = () => {
        let current = target;
        while (current) {
          if (current.isDeactivated) {
            return;
          }
          current = current.parent;
        }
        return hook();
      });
      injectHook(type, wrappedHook, target);
      if (target) {
        let current = target.parent;
        while (current && current.parent) {
          if (isKeepAlive(current.parent.vnode)) {
            injectToKeepAliveRoot(wrappedHook, type, target, current);
          }
          current = current.parent;
        }
      }
    }
    function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
      const injected = injectHook(
        type,
        hook,
        keepAliveRoot,
        true
        /* prepend */
      );
      onUnmounted(() => {
        remove(keepAliveRoot[type], injected);
      }, target);
    }
    function resetShapeFlag(vnode) {
      vnode.shapeFlag &= ~256;
      vnode.shapeFlag &= ~512;
    }
    function getInnerChild(vnode) {
      return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
    }
    function injectHook(type, hook, target = currentInstance, prepend = false) {
      if (target) {
        const hooks = target[type] || (target[type] = []);
        const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
          pauseTracking();
          const reset = setCurrentInstance(target);
          const res = callWithAsyncErrorHandling(hook, target, type, args);
          reset();
          resetTracking();
          return res;
        });
        if (prepend) {
          hooks.unshift(wrappedHook);
        } else {
          hooks.push(wrappedHook);
        }
        return wrappedHook;
      }
    }
    const createHook = (lifecycle) => (hook, target = currentInstance) => {
      if (!isInSSRComponentSetup || lifecycle === "sp") {
        injectHook(lifecycle, (...args) => hook(...args), target);
      }
    };
    const onBeforeMount = createHook("bm");
    const onMounted = createHook("m");
    const onBeforeUpdate = createHook(
      "bu"
    );
    const onUpdated = createHook("u");
    const onBeforeUnmount = createHook(
      "bum"
    );
    const onUnmounted = createHook("um");
    const onServerPrefetch = createHook(
      "sp"
    );
    const onRenderTriggered = createHook("rtg");
    const onRenderTracked = createHook("rtc");
    function onErrorCaptured(hook, target = currentInstance) {
      injectHook("ec", hook, target);
    }
    const COMPONENTS = "components";
    function resolveComponent(name, maybeSelfReference) {
      return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
    }
    const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
    function resolveDynamicComponent(component) {
      if (isString$2(component)) {
        return resolveAsset(COMPONENTS, component, false) || component;
      } else {
        return component || NULL_DYNAMIC_COMPONENT;
      }
    }
    function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
      const instance = currentRenderingInstance || currentInstance;
      if (instance) {
        const Component = instance.type;
        {
          const selfName = getComponentName(
            Component,
            false
          );
          if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize$1(camelize(name)))) {
            return Component;
          }
        }
        const res = (
          // local registration
          // check instance[type] first which is resolved for options API
          resolve(instance[type] || Component[type], name) || // global registration
          resolve(instance.appContext[type], name)
        );
        if (!res && maybeSelfReference) {
          return Component;
        }
        return res;
      }
    }
    function resolve(registry, name) {
      return registry && (registry[name] || registry[camelize(name)] || registry[capitalize$1(camelize(name))]);
    }
    function renderSlot(slots, name, props = {}, fallback, noSlotted) {
      if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
        return openBlock(), createBlock(
          Fragment,
          null,
          [createVNode("slot", props, fallback)],
          64
        );
      }
      let slot = slots[name];
      if (slot && slot._c) {
        slot._d = false;
      }
      openBlock();
      const validSlotContent = slot && ensureValidVNode$1(slot(props));
      const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
      // key attached in the `createSlots` helper, respect that
      validSlotContent && validSlotContent.key;
      const rendered = createBlock(
        Fragment,
        {
          key: (slotKey && !isSymbol$1(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
          (!validSlotContent && fallback ? "_fb" : "")
        },
        validSlotContent || [],
        validSlotContent && slots._ === 1 ? 64 : -2
      );
      if (rendered.scopeId) {
        rendered.slotScopeIds = [rendered.scopeId + "-s"];
      }
      if (slot && slot._c) {
        slot._d = true;
      }
      return rendered;
    }
    function ensureValidVNode$1(vnodes) {
      return vnodes.some((child) => {
        if (!isVNode$1(child)) return true;
        if (child.type === Comment) return false;
        if (child.type === Fragment && !ensureValidVNode$1(child.children))
          return false;
        return true;
      }) ? vnodes : null;
    }
    const getPublicInstance = (i) => {
      if (!i) return null;
      if (isStatefulComponent(i)) return getComponentPublicInstance(i);
      return getPublicInstance(i.parent);
    };
    const publicPropertiesMap = (
      // Move PURE marker to new line to workaround compiler discarding it
      // due to type annotation
      /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
        $: (i) => i,
        $el: (i) => i.vnode.el,
        $data: (i) => i.data,
        $props: (i) => i.props,
        $attrs: (i) => i.attrs,
        $slots: (i) => i.slots,
        $refs: (i) => i.refs,
        $parent: (i) => getPublicInstance(i.parent),
        $root: (i) => getPublicInstance(i.root),
        $host: (i) => i.ce,
        $emit: (i) => i.emit,
        $options: (i) => resolveMergedOptions(i),
        $forceUpdate: (i) => i.f || (i.f = () => {
          queueJob(i.update);
        }),
        $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
        $watch: (i) => instanceWatch.bind(i)
      })
    );
    const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
    const PublicInstanceProxyHandlers = {
      get({ _: instance }, key) {
        if (key === "__v_skip") {
          return true;
        }
        const { ctx: ctx2, setupState, data, props, accessCache, type, appContext } = instance;
        let normalizedProps;
        if (key[0] !== "$") {
          const n = accessCache[key];
          if (n !== void 0) {
            switch (n) {
              case 1:
                return setupState[key];
              case 2:
                return data[key];
              case 4:
                return ctx2[key];
              case 3:
                return props[key];
            }
          } else if (hasSetupBinding(setupState, key)) {
            accessCache[key] = 1;
            return setupState[key];
          } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
            accessCache[key] = 2;
            return data[key];
          } else if (
            // only cache other properties when instance has declared (thus stable)
            // props
            (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)
          ) {
            accessCache[key] = 3;
            return props[key];
          } else if (ctx2 !== EMPTY_OBJ && hasOwn$1(ctx2, key)) {
            accessCache[key] = 4;
            return ctx2[key];
          } else if (shouldCacheAccess) {
            accessCache[key] = 0;
          }
        }
        const publicGetter = publicPropertiesMap[key];
        let cssModule, globalProperties;
        if (publicGetter) {
          if (key === "$attrs") {
            track(instance.attrs, "get", "");
          }
          return publicGetter(instance);
        } else if (
          // css module (injected by vue-loader)
          (cssModule = type.__cssModules) && (cssModule = cssModule[key])
        ) {
          return cssModule;
        } else if (ctx2 !== EMPTY_OBJ && hasOwn$1(ctx2, key)) {
          accessCache[key] = 4;
          return ctx2[key];
        } else if (
          // global properties
          globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)
        ) {
          {
            return globalProperties[key];
          }
        } else ;
      },
      set({ _: instance }, key, value) {
        const { data, setupState, ctx: ctx2 } = instance;
        if (hasSetupBinding(setupState, key)) {
          setupState[key] = value;
          return true;
        } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
          data[key] = value;
          return true;
        } else if (hasOwn$1(instance.props, key)) {
          return false;
        }
        if (key[0] === "$" && key.slice(1) in instance) {
          return false;
        } else {
          {
            ctx2[key] = value;
          }
        }
        return true;
      },
      has({
        _: { data, setupState, accessCache, ctx: ctx2, appContext, propsOptions }
      }, key) {
        let normalizedProps;
        return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx2, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key);
      },
      defineProperty(target, key, descriptor) {
        if (descriptor.get != null) {
          target._.accessCache[key] = 0;
        } else if (hasOwn$1(descriptor, "value")) {
          this.set(target, key, descriptor.value, null);
        }
        return Reflect.defineProperty(target, key, descriptor);
      }
    };
    function normalizePropsOrEmits(props) {
      return isArray$3(props) ? props.reduce(
        (normalized, p2) => (normalized[p2] = null, normalized),
        {}
      ) : props;
    }
    let shouldCacheAccess = true;
    function applyOptions(instance) {
      const options = resolveMergedOptions(instance);
      const publicThis = instance.proxy;
      const ctx2 = instance.ctx;
      shouldCacheAccess = false;
      if (options.beforeCreate) {
        callHook$1(options.beforeCreate, instance, "bc");
      }
      const {
        // state
        data: dataOptions,
        computed: computedOptions,
        methods,
        watch: watchOptions,
        provide: provideOptions,
        inject: injectOptions,
        // lifecycle
        created,
        beforeMount,
        mounted,
        beforeUpdate,
        updated,
        activated,
        deactivated,
        beforeDestroy,
        beforeUnmount,
        destroyed,
        unmounted,
        render: render2,
        renderTracked,
        renderTriggered,
        errorCaptured,
        serverPrefetch,
        // public API
        expose,
        inheritAttrs,
        // assets
        components,
        directives,
        filters
      } = options;
      const checkDuplicateProperties = null;
      if (injectOptions) {
        resolveInjections(injectOptions, ctx2, checkDuplicateProperties);
      }
      if (methods) {
        for (const key in methods) {
          const methodHandler = methods[key];
          if (isFunction$2(methodHandler)) {
            {
              ctx2[key] = methodHandler.bind(publicThis);
            }
          }
        }
      }
      if (dataOptions) {
        const data = dataOptions.call(publicThis, publicThis);
        if (!isObject$4(data)) ;
        else {
          instance.data = reactive(data);
        }
      }
      shouldCacheAccess = true;
      if (computedOptions) {
        for (const key in computedOptions) {
          const opt = computedOptions[key];
          const get2 = isFunction$2(opt) ? opt.bind(publicThis, publicThis) : isFunction$2(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
          const set2 = !isFunction$2(opt) && isFunction$2(opt.set) ? opt.set.bind(publicThis) : NOOP;
          const c2 = computed({
            get: get2,
            set: set2
          });
          Object.defineProperty(ctx2, key, {
            enumerable: true,
            configurable: true,
            get: () => c2.value,
            set: (v) => c2.value = v
          });
        }
      }
      if (watchOptions) {
        for (const key in watchOptions) {
          createWatcher(watchOptions[key], ctx2, publicThis, key);
        }
      }
      if (provideOptions) {
        const provides = isFunction$2(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
        Reflect.ownKeys(provides).forEach((key) => {
          provide(key, provides[key]);
        });
      }
      if (created) {
        callHook$1(created, instance, "c");
      }
      function registerLifecycleHook(register, hook) {
        if (isArray$3(hook)) {
          hook.forEach((_hook) => register(_hook.bind(publicThis)));
        } else if (hook) {
          register(hook.bind(publicThis));
        }
      }
      registerLifecycleHook(onBeforeMount, beforeMount);
      registerLifecycleHook(onMounted, mounted);
      registerLifecycleHook(onBeforeUpdate, beforeUpdate);
      registerLifecycleHook(onUpdated, updated);
      registerLifecycleHook(onActivated, activated);
      registerLifecycleHook(onDeactivated, deactivated);
      registerLifecycleHook(onErrorCaptured, errorCaptured);
      registerLifecycleHook(onRenderTracked, renderTracked);
      registerLifecycleHook(onRenderTriggered, renderTriggered);
      registerLifecycleHook(onBeforeUnmount, beforeUnmount);
      registerLifecycleHook(onUnmounted, unmounted);
      registerLifecycleHook(onServerPrefetch, serverPrefetch);
      if (isArray$3(expose)) {
        if (expose.length) {
          const exposed = instance.exposed || (instance.exposed = {});
          expose.forEach((key) => {
            Object.defineProperty(exposed, key, {
              get: () => publicThis[key],
              set: (val) => publicThis[key] = val
            });
          });
        } else if (!instance.exposed) {
          instance.exposed = {};
        }
      }
      if (render2 && instance.render === NOOP) {
        instance.render = render2;
      }
      if (inheritAttrs != null) {
        instance.inheritAttrs = inheritAttrs;
      }
      if (components) instance.components = components;
      if (directives) instance.directives = directives;
      if (serverPrefetch) {
        markAsyncBoundary(instance);
      }
    }
    function resolveInjections(injectOptions, ctx2, checkDuplicateProperties = NOOP) {
      if (isArray$3(injectOptions)) {
        injectOptions = normalizeInject(injectOptions);
      }
      for (const key in injectOptions) {
        const opt = injectOptions[key];
        let injected;
        if (isObject$4(opt)) {
          if ("default" in opt) {
            injected = inject(
              opt.from || key,
              opt.default,
              true
            );
          } else {
            injected = inject(opt.from || key);
          }
        } else {
          injected = inject(opt);
        }
        if (isRef(injected)) {
          Object.defineProperty(ctx2, key, {
            enumerable: true,
            configurable: true,
            get: () => injected.value,
            set: (v) => injected.value = v
          });
        } else {
          ctx2[key] = injected;
        }
      }
    }
    function callHook$1(hook, instance, type) {
      callWithAsyncErrorHandling(
        isArray$3(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
        instance,
        type
      );
    }
    function createWatcher(raw, ctx2, publicThis, key) {
      let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
      if (isString$2(raw)) {
        const handler = ctx2[raw];
        if (isFunction$2(handler)) {
          {
            watch(getter, handler);
          }
        }
      } else if (isFunction$2(raw)) {
        {
          watch(getter, raw.bind(publicThis));
        }
      } else if (isObject$4(raw)) {
        if (isArray$3(raw)) {
          raw.forEach((r) => createWatcher(r, ctx2, publicThis, key));
        } else {
          const handler = isFunction$2(raw.handler) ? raw.handler.bind(publicThis) : ctx2[raw.handler];
          if (isFunction$2(handler)) {
            watch(getter, handler, raw);
          }
        }
      } else ;
    }
    function resolveMergedOptions(instance) {
      const base2 = instance.type;
      const { mixins, extends: extendsOptions } = base2;
      const {
        mixins: globalMixins,
        optionsCache: cache2,
        config: { optionMergeStrategies }
      } = instance.appContext;
      const cached = cache2.get(base2);
      let resolved;
      if (cached) {
        resolved = cached;
      } else if (!globalMixins.length && !mixins && !extendsOptions) {
        {
          resolved = base2;
        }
      } else {
        resolved = {};
        if (globalMixins.length) {
          globalMixins.forEach(
            (m) => mergeOptions$1(resolved, m, optionMergeStrategies, true)
          );
        }
        mergeOptions$1(resolved, base2, optionMergeStrategies);
      }
      if (isObject$4(base2)) {
        cache2.set(base2, resolved);
      }
      return resolved;
    }
    function mergeOptions$1(to, from, strats, asMixin = false) {
      const { mixins, extends: extendsOptions } = from;
      if (extendsOptions) {
        mergeOptions$1(to, extendsOptions, strats, true);
      }
      if (mixins) {
        mixins.forEach(
          (m) => mergeOptions$1(to, m, strats, true)
        );
      }
      for (const key in from) {
        if (asMixin && key === "expose") ;
        else {
          const strat = internalOptionMergeStrats[key] || strats && strats[key];
          to[key] = strat ? strat(to[key], from[key]) : from[key];
        }
      }
      return to;
    }
    const internalOptionMergeStrats = {
      data: mergeDataFn,
      props: mergeEmitsOrPropsOptions,
      emits: mergeEmitsOrPropsOptions,
      // objects
      methods: mergeObjectOptions,
      computed: mergeObjectOptions,
      // lifecycle
      beforeCreate: mergeAsArray,
      created: mergeAsArray,
      beforeMount: mergeAsArray,
      mounted: mergeAsArray,
      beforeUpdate: mergeAsArray,
      updated: mergeAsArray,
      beforeDestroy: mergeAsArray,
      beforeUnmount: mergeAsArray,
      destroyed: mergeAsArray,
      unmounted: mergeAsArray,
      activated: mergeAsArray,
      deactivated: mergeAsArray,
      errorCaptured: mergeAsArray,
      serverPrefetch: mergeAsArray,
      // assets
      components: mergeObjectOptions,
      directives: mergeObjectOptions,
      // watch
      watch: mergeWatchOptions,
      // provide / inject
      provide: mergeDataFn,
      inject: mergeInject
    };
    function mergeDataFn(to, from) {
      if (!from) {
        return to;
      }
      if (!to) {
        return from;
      }
      return function mergedDataFn() {
        return extend(
          isFunction$2(to) ? to.call(this, this) : to,
          isFunction$2(from) ? from.call(this, this) : from
        );
      };
    }
    function mergeInject(to, from) {
      return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
    }
    function normalizeInject(raw) {
      if (isArray$3(raw)) {
        const res = {};
        for (let i = 0; i < raw.length; i++) {
          res[raw[i]] = raw[i];
        }
        return res;
      }
      return raw;
    }
    function mergeAsArray(to, from) {
      return to ? [...new Set([].concat(to, from))] : from;
    }
    function mergeObjectOptions(to, from) {
      return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
    }
    function mergeEmitsOrPropsOptions(to, from) {
      if (to) {
        if (isArray$3(to) && isArray$3(from)) {
          return [.../* @__PURE__ */ new Set([...to, ...from])];
        }
        return extend(
          /* @__PURE__ */ Object.create(null),
          normalizePropsOrEmits(to),
          normalizePropsOrEmits(from != null ? from : {})
        );
      } else {
        return from;
      }
    }
    function mergeWatchOptions(to, from) {
      if (!to) return from;
      if (!from) return to;
      const merged = extend(/* @__PURE__ */ Object.create(null), to);
      for (const key in from) {
        merged[key] = mergeAsArray(to[key], from[key]);
      }
      return merged;
    }
    function createAppContext() {
      return {
        app: null,
        config: {
          isNativeTag: NO,
          performance: false,
          globalProperties: {},
          optionMergeStrategies: {},
          errorHandler: void 0,
          warnHandler: void 0,
          compilerOptions: {}
        },
        mixins: [],
        components: {},
        directives: {},
        provides: /* @__PURE__ */ Object.create(null),
        optionsCache: /* @__PURE__ */ new WeakMap(),
        propsCache: /* @__PURE__ */ new WeakMap(),
        emitsCache: /* @__PURE__ */ new WeakMap()
      };
    }
    let uid$1 = 0;
    function createAppAPI(render2, hydrate) {
      return function createApp2(rootComponent, rootProps = null) {
        if (!isFunction$2(rootComponent)) {
          rootComponent = extend({}, rootComponent);
        }
        if (rootProps != null && !isObject$4(rootProps)) {
          rootProps = null;
        }
        const context = createAppContext();
        const installedPlugins = /* @__PURE__ */ new WeakSet();
        const pluginCleanupFns = [];
        let isMounted2 = false;
        const app = context.app = {
          _uid: uid$1++,
          _component: rootComponent,
          _props: rootProps,
          _container: null,
          _context: context,
          _instance: null,
          version: version$1,
          get config() {
            return context.config;
          },
          set config(v) {
          },
          use(plugin2, ...options) {
            if (installedPlugins.has(plugin2)) ;
            else if (plugin2 && isFunction$2(plugin2.install)) {
              installedPlugins.add(plugin2);
              plugin2.install(app, ...options);
            } else if (isFunction$2(plugin2)) {
              installedPlugins.add(plugin2);
              plugin2(app, ...options);
            } else ;
            return app;
          },
          mixin(mixin) {
            {
              if (!context.mixins.includes(mixin)) {
                context.mixins.push(mixin);
              }
            }
            return app;
          },
          component(name, component) {
            if (!component) {
              return context.components[name];
            }
            context.components[name] = component;
            return app;
          },
          directive(name, directive) {
            if (!directive) {
              return context.directives[name];
            }
            context.directives[name] = directive;
            return app;
          },
          mount(rootContainer, isHydrate, namespace2) {
            if (!isMounted2) {
              const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
              vnode.appContext = context;
              if (namespace2 === true) {
                namespace2 = "svg";
              } else if (namespace2 === false) {
                namespace2 = void 0;
              }
              if (isHydrate && hydrate) {
                hydrate(vnode, rootContainer);
              } else {
                render2(vnode, rootContainer, namespace2);
              }
              isMounted2 = true;
              app._container = rootContainer;
              rootContainer.__vue_app__ = app;
              return getComponentPublicInstance(vnode.component);
            }
          },
          onUnmount(cleanupFn) {
            pluginCleanupFns.push(cleanupFn);
          },
          unmount() {
            if (isMounted2) {
              callWithAsyncErrorHandling(
                pluginCleanupFns,
                app._instance,
                16
              );
              render2(null, app._container);
              delete app._container.__vue_app__;
            }
          },
          provide(key, value) {
            context.provides[key] = value;
            return app;
          },
          runWithContext(fn) {
            const lastApp = currentApp;
            currentApp = app;
            try {
              return fn();
            } finally {
              currentApp = lastApp;
            }
          }
        };
        return app;
      };
    }
    let currentApp = null;
    function provide(key, value) {
      if (!currentInstance) ;
      else {
        let provides = currentInstance.provides;
        const parentProvides = currentInstance.parent && currentInstance.parent.provides;
        if (parentProvides === provides) {
          provides = currentInstance.provides = Object.create(parentProvides);
        }
        provides[key] = value;
      }
    }
    function inject(key, defaultValue, treatDefaultAsFactory = false) {
      const instance = currentInstance || currentRenderingInstance;
      if (instance || currentApp) {
        const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
        if (provides && key in provides) {
          return provides[key];
        } else if (arguments.length > 1) {
          return treatDefaultAsFactory && isFunction$2(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
        } else ;
      }
    }
    function hasInjectionContext() {
      return !!(currentInstance || currentRenderingInstance || currentApp);
    }
    const internalObjectProto = {};
    const createInternalObject = () => Object.create(internalObjectProto);
    const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
    function initProps(instance, rawProps, isStateful, isSSR = false) {
      const props = {};
      const attrs = createInternalObject();
      instance.propsDefaults = /* @__PURE__ */ Object.create(null);
      setFullProps(instance, rawProps, props, attrs);
      for (const key in instance.propsOptions[0]) {
        if (!(key in props)) {
          props[key] = void 0;
        }
      }
      if (isStateful) {
        instance.props = isSSR ? props : shallowReactive(props);
      } else {
        if (!instance.type.props) {
          instance.props = attrs;
        } else {
          instance.props = props;
        }
      }
      instance.attrs = attrs;
    }
    function updateProps(instance, rawProps, rawPrevProps, optimized) {
      const {
        props,
        attrs,
        vnode: { patchFlag }
      } = instance;
      const rawCurrentProps = toRaw(props);
      const [options] = instance.propsOptions;
      let hasAttrsChanged = false;
      if (
        // always force full diff in dev
        // - #1942 if hmr is enabled with sfc component
        // - vite#872 non-sfc component used by sfc component
        (optimized || patchFlag > 0) && !(patchFlag & 16)
      ) {
        if (patchFlag & 8) {
          const propsToUpdate = instance.vnode.dynamicProps;
          for (let i = 0; i < propsToUpdate.length; i++) {
            let key = propsToUpdate[i];
            if (isEmitListener(instance.emitsOptions, key)) {
              continue;
            }
            const value = rawProps[key];
            if (options) {
              if (hasOwn$1(attrs, key)) {
                if (value !== attrs[key]) {
                  attrs[key] = value;
                  hasAttrsChanged = true;
                }
              } else {
                const camelizedKey = camelize(key);
                props[camelizedKey] = resolvePropValue(
                  options,
                  rawCurrentProps,
                  camelizedKey,
                  value,
                  instance,
                  false
                );
              }
            } else {
              if (value !== attrs[key]) {
                attrs[key] = value;
                hasAttrsChanged = true;
              }
            }
          }
        }
      } else {
        if (setFullProps(instance, rawProps, props, attrs)) {
          hasAttrsChanged = true;
        }
        let kebabKey;
        for (const key in rawCurrentProps) {
          if (!rawProps || // for camelCase
          !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case
          // and converted to camelCase (#955)
          ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
            if (options) {
              if (rawPrevProps && // for camelCase
              (rawPrevProps[key] !== void 0 || // for kebab-case
              rawPrevProps[kebabKey] !== void 0)) {
                props[key] = resolvePropValue(
                  options,
                  rawCurrentProps,
                  key,
                  void 0,
                  instance,
                  true
                );
              }
            } else {
              delete props[key];
            }
          }
        }
        if (attrs !== rawCurrentProps) {
          for (const key in attrs) {
            if (!rawProps || !hasOwn$1(rawProps, key) && true) {
              delete attrs[key];
              hasAttrsChanged = true;
            }
          }
        }
      }
      if (hasAttrsChanged) {
        trigger$1(instance.attrs, "set", "");
      }
    }
    function setFullProps(instance, rawProps, props, attrs) {
      const [options, needCastKeys] = instance.propsOptions;
      let hasAttrsChanged = false;
      let rawCastValues;
      if (rawProps) {
        for (let key in rawProps) {
          if (isReservedProp(key)) {
            continue;
          }
          const value = rawProps[key];
          let camelKey;
          if (options && hasOwn$1(options, camelKey = camelize(key))) {
            if (!needCastKeys || !needCastKeys.includes(camelKey)) {
              props[camelKey] = value;
            } else {
              (rawCastValues || (rawCastValues = {}))[camelKey] = value;
            }
          } else if (!isEmitListener(instance.emitsOptions, key)) {
            if (!(key in attrs) || value !== attrs[key]) {
              attrs[key] = value;
              hasAttrsChanged = true;
            }
          }
        }
      }
      if (needCastKeys) {
        const rawCurrentProps = toRaw(props);
        const castValues = rawCastValues || EMPTY_OBJ;
        for (let i = 0; i < needCastKeys.length; i++) {
          const key = needCastKeys[i];
          props[key] = resolvePropValue(
            options,
            rawCurrentProps,
            key,
            castValues[key],
            instance,
            !hasOwn$1(castValues, key)
          );
        }
      }
      return hasAttrsChanged;
    }
    function resolvePropValue(options, props, key, value, instance, isAbsent) {
      const opt = options[key];
      if (opt != null) {
        const hasDefault = hasOwn$1(opt, "default");
        if (hasDefault && value === void 0) {
          const defaultValue = opt.default;
          if (opt.type !== Function && !opt.skipFactory && isFunction$2(defaultValue)) {
            const { propsDefaults } = instance;
            if (key in propsDefaults) {
              value = propsDefaults[key];
            } else {
              const reset = setCurrentInstance(instance);
              value = propsDefaults[key] = defaultValue.call(
                null,
                props
              );
              reset();
            }
          } else {
            value = defaultValue;
          }
          if (instance.ce) {
            instance.ce._setProp(key, value);
          }
        }
        if (opt[
          0
          /* shouldCast */
        ]) {
          if (isAbsent && !hasDefault) {
            value = false;
          } else if (opt[
            1
            /* shouldCastTrue */
          ] && (value === "" || value === hyphenate(key))) {
            value = true;
          }
        }
      }
      return value;
    }
    const mixinPropsCache = /* @__PURE__ */ new WeakMap();
    function normalizePropsOptions(comp, appContext, asMixin = false) {
      const cache2 = asMixin ? mixinPropsCache : appContext.propsCache;
      const cached = cache2.get(comp);
      if (cached) {
        return cached;
      }
      const raw = comp.props;
      const normalized = {};
      const needCastKeys = [];
      let hasExtends = false;
      if (!isFunction$2(comp)) {
        const extendProps = (raw2) => {
          hasExtends = true;
          const [props, keys2] = normalizePropsOptions(raw2, appContext, true);
          extend(normalized, props);
          if (keys2) needCastKeys.push(...keys2);
        };
        if (!asMixin && appContext.mixins.length) {
          appContext.mixins.forEach(extendProps);
        }
        if (comp.extends) {
          extendProps(comp.extends);
        }
        if (comp.mixins) {
          comp.mixins.forEach(extendProps);
        }
      }
      if (!raw && !hasExtends) {
        if (isObject$4(comp)) {
          cache2.set(comp, EMPTY_ARR);
        }
        return EMPTY_ARR;
      }
      if (isArray$3(raw)) {
        for (let i = 0; i < raw.length; i++) {
          const normalizedKey = camelize(raw[i]);
          if (validatePropName(normalizedKey)) {
            normalized[normalizedKey] = EMPTY_OBJ;
          }
        }
      } else if (raw) {
        for (const key in raw) {
          const normalizedKey = camelize(key);
          if (validatePropName(normalizedKey)) {
            const opt = raw[key];
            const prop = normalized[normalizedKey] = isArray$3(opt) || isFunction$2(opt) ? { type: opt } : extend({}, opt);
            const propType = prop.type;
            let shouldCast = false;
            let shouldCastTrue = true;
            if (isArray$3(propType)) {
              for (let index = 0; index < propType.length; ++index) {
                const type = propType[index];
                const typeName = isFunction$2(type) && type.name;
                if (typeName === "Boolean") {
                  shouldCast = true;
                  break;
                } else if (typeName === "String") {
                  shouldCastTrue = false;
                }
              }
            } else {
              shouldCast = isFunction$2(propType) && propType.name === "Boolean";
            }
            prop[
              0
              /* shouldCast */
            ] = shouldCast;
            prop[
              1
              /* shouldCastTrue */
            ] = shouldCastTrue;
            if (shouldCast || hasOwn$1(prop, "default")) {
              needCastKeys.push(normalizedKey);
            }
          }
        }
      }
      const res = [normalized, needCastKeys];
      if (isObject$4(comp)) {
        cache2.set(comp, res);
      }
      return res;
    }
    function validatePropName(key) {
      if (key[0] !== "$" && !isReservedProp(key)) {
        return true;
      }
      return false;
    }
    const isInternalKey = (key) => key[0] === "_" || key === "$stable";
    const normalizeSlotValue = (value) => isArray$3(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
    const normalizeSlot$1 = (key, rawSlot, ctx2) => {
      if (rawSlot._n) {
        return rawSlot;
      }
      const normalized = withCtx((...args) => {
        if (false) ;
        return normalizeSlotValue(rawSlot(...args));
      }, ctx2);
      normalized._c = false;
      return normalized;
    };
    const normalizeObjectSlots = (rawSlots, slots, instance) => {
      const ctx2 = rawSlots._ctx;
      for (const key in rawSlots) {
        if (isInternalKey(key)) continue;
        const value = rawSlots[key];
        if (isFunction$2(value)) {
          slots[key] = normalizeSlot$1(key, value, ctx2);
        } else if (value != null) {
          const normalized = normalizeSlotValue(value);
          slots[key] = () => normalized;
        }
      }
    };
    const normalizeVNodeSlots = (instance, children) => {
      const normalized = normalizeSlotValue(children);
      instance.slots.default = () => normalized;
    };
    const assignSlots = (slots, children, optimized) => {
      for (const key in children) {
        if (optimized || key !== "_") {
          slots[key] = children[key];
        }
      }
    };
    const initSlots = (instance, children, optimized) => {
      const slots = instance.slots = createInternalObject();
      if (instance.vnode.shapeFlag & 32) {
        const type = children._;
        if (type) {
          assignSlots(slots, children, optimized);
          if (optimized) {
            def(slots, "_", type, true);
          }
        } else {
          normalizeObjectSlots(children, slots);
        }
      } else if (children) {
        normalizeVNodeSlots(instance, children);
      }
    };
    const updateSlots = (instance, children, optimized) => {
      const { vnode, slots } = instance;
      let needDeletionCheck = true;
      let deletionComparisonTarget = EMPTY_OBJ;
      if (vnode.shapeFlag & 32) {
        const type = children._;
        if (type) {
          if (optimized && type === 1) {
            needDeletionCheck = false;
          } else {
            assignSlots(slots, children, optimized);
          }
        } else {
          needDeletionCheck = !children.$stable;
          normalizeObjectSlots(children, slots);
        }
        deletionComparisonTarget = children;
      } else if (children) {
        normalizeVNodeSlots(instance, children);
        deletionComparisonTarget = { default: 1 };
      }
      if (needDeletionCheck) {
        for (const key in slots) {
          if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
            delete slots[key];
          }
        }
      }
    };
    const queuePostRenderEffect = queueEffectWithSuspense;
    function createRenderer(options) {
      return baseCreateRenderer(options);
    }
    function baseCreateRenderer(options, createHydrationFns) {
      const target = getGlobalThis$1();
      target.__VUE__ = true;
      const {
        insert: hostInsert,
        remove: hostRemove,
        patchProp: hostPatchProp,
        createElement: hostCreateElement,
        createText: hostCreateText,
        createComment: hostCreateComment,
        setText: hostSetText,
        setElementText: hostSetElementText,
        parentNode: hostParentNode,
        nextSibling: hostNextSibling,
        setScopeId: hostSetScopeId = NOOP,
        insertStaticContent: hostInsertStaticContent
      } = options;
      const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace2 = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
        if (n1 === n2) {
          return;
        }
        if (n1 && !isSameVNodeType(n1, n2)) {
          anchor = getNextHostNode(n1);
          unmount2(n1, parentComponent, parentSuspense, true);
          n1 = null;
        }
        if (n2.patchFlag === -2) {
          optimized = false;
          n2.dynamicChildren = null;
        }
        const { type, ref: ref3, shapeFlag } = n2;
        switch (type) {
          case Text:
            processText(n1, n2, container, anchor);
            break;
          case Comment:
            processCommentNode(n1, n2, container, anchor);
            break;
          case Static:
            if (n1 == null) {
              mountStaticNode(n2, container, anchor, namespace2);
            }
            break;
          case Fragment:
            processFragment(
              n1,
              n2,
              container,
              anchor,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds,
              optimized
            );
            break;
          default:
            if (shapeFlag & 1) {
              processElement(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized
              );
            } else if (shapeFlag & 6) {
              processComponent(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized
              );
            } else if (shapeFlag & 64) {
              type.process(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized,
                internals
              );
            } else if (shapeFlag & 128) {
              type.process(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized,
                internals
              );
            } else ;
        }
        if (ref3 != null && parentComponent) {
          setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
        }
      };
      const processText = (n1, n2, container, anchor) => {
        if (n1 == null) {
          hostInsert(
            n2.el = hostCreateText(n2.children),
            container,
            anchor
          );
        } else {
          const el = n2.el = n1.el;
          if (n2.children !== n1.children) {
            hostSetText(el, n2.children);
          }
        }
      };
      const processCommentNode = (n1, n2, container, anchor) => {
        if (n1 == null) {
          hostInsert(
            n2.el = hostCreateComment(n2.children || ""),
            container,
            anchor
          );
        } else {
          n2.el = n1.el;
        }
      };
      const mountStaticNode = (n2, container, anchor, namespace2) => {
        [n2.el, n2.anchor] = hostInsertStaticContent(
          n2.children,
          container,
          anchor,
          namespace2,
          n2.el,
          n2.anchor
        );
      };
      const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
        let next;
        while (el && el !== anchor) {
          next = hostNextSibling(el);
          hostInsert(el, container, nextSibling);
          el = next;
        }
        hostInsert(anchor, container, nextSibling);
      };
      const removeStaticNode = ({ el, anchor }) => {
        let next;
        while (el && el !== anchor) {
          next = hostNextSibling(el);
          hostRemove(el);
          el = next;
        }
        hostRemove(anchor);
      };
      const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized) => {
        if (n2.type === "svg") {
          namespace2 = "svg";
        } else if (n2.type === "math") {
          namespace2 = "mathml";
        }
        if (n1 == null) {
          mountElement(
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace2,
            slotScopeIds,
            optimized
          );
        } else {
          patchElement(
            n1,
            n2,
            parentComponent,
            parentSuspense,
            namespace2,
            slotScopeIds,
            optimized
          );
        }
      };
      const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized) => {
        let el;
        let vnodeHook;
        const { props, shapeFlag, transition, dirs } = vnode;
        el = vnode.el = hostCreateElement(
          vnode.type,
          namespace2,
          props && props.is,
          props
        );
        if (shapeFlag & 8) {
          hostSetElementText(el, vnode.children);
        } else if (shapeFlag & 16) {
          mountChildren(
            vnode.children,
            el,
            null,
            parentComponent,
            parentSuspense,
            resolveChildrenNamespace(vnode, namespace2),
            slotScopeIds,
            optimized
          );
        }
        if (dirs) {
          invokeDirectiveHook(vnode, null, parentComponent, "created");
        }
        setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
        if (props) {
          for (const key in props) {
            if (key !== "value" && !isReservedProp(key)) {
              hostPatchProp(el, key, null, props[key], namespace2, parentComponent);
            }
          }
          if ("value" in props) {
            hostPatchProp(el, "value", null, props.value, namespace2);
          }
          if (vnodeHook = props.onVnodeBeforeMount) {
            invokeVNodeHook(vnodeHook, parentComponent, vnode);
          }
        }
        if (dirs) {
          invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
        }
        const needCallTransitionHooks = needTransition(parentSuspense, transition);
        if (needCallTransitionHooks) {
          transition.beforeEnter(el);
        }
        hostInsert(el, container, anchor);
        if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
          queuePostRenderEffect(() => {
            vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
            needCallTransitionHooks && transition.enter(el);
            dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
          }, parentSuspense);
        }
      };
      const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
        if (scopeId) {
          hostSetScopeId(el, scopeId);
        }
        if (slotScopeIds) {
          for (let i = 0; i < slotScopeIds.length; i++) {
            hostSetScopeId(el, slotScopeIds[i]);
          }
        }
        if (parentComponent) {
          let subTree = parentComponent.subTree;
          if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
            const parentVNode = parentComponent.vnode;
            setScopeId(
              el,
              parentVNode,
              parentVNode.scopeId,
              parentVNode.slotScopeIds,
              parentComponent.parent
            );
          }
        }
      };
      const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized, start = 0) => {
        for (let i = start; i < children.length; i++) {
          const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
          patch(
            null,
            child,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace2,
            slotScopeIds,
            optimized
          );
        }
      };
      const patchElement = (n1, n2, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized) => {
        const el = n2.el = n1.el;
        let { patchFlag, dynamicChildren, dirs } = n2;
        patchFlag |= n1.patchFlag & 16;
        const oldProps = n1.props || EMPTY_OBJ;
        const newProps = n2.props || EMPTY_OBJ;
        let vnodeHook;
        parentComponent && toggleRecurse(parentComponent, false);
        if (vnodeHook = newProps.onVnodeBeforeUpdate) {
          invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
        }
        if (dirs) {
          invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
        }
        parentComponent && toggleRecurse(parentComponent, true);
        if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
          hostSetElementText(el, "");
        }
        if (dynamicChildren) {
          patchBlockChildren(
            n1.dynamicChildren,
            dynamicChildren,
            el,
            parentComponent,
            parentSuspense,
            resolveChildrenNamespace(n2, namespace2),
            slotScopeIds
          );
        } else if (!optimized) {
          patchChildren(
            n1,
            n2,
            el,
            null,
            parentComponent,
            parentSuspense,
            resolveChildrenNamespace(n2, namespace2),
            slotScopeIds,
            false
          );
        }
        if (patchFlag > 0) {
          if (patchFlag & 16) {
            patchProps(el, oldProps, newProps, parentComponent, namespace2);
          } else {
            if (patchFlag & 2) {
              if (oldProps.class !== newProps.class) {
                hostPatchProp(el, "class", null, newProps.class, namespace2);
              }
            }
            if (patchFlag & 4) {
              hostPatchProp(el, "style", oldProps.style, newProps.style, namespace2);
            }
            if (patchFlag & 8) {
              const propsToUpdate = n2.dynamicProps;
              for (let i = 0; i < propsToUpdate.length; i++) {
                const key = propsToUpdate[i];
                const prev = oldProps[key];
                const next = newProps[key];
                if (next !== prev || key === "value") {
                  hostPatchProp(el, key, prev, next, namespace2, parentComponent);
                }
              }
            }
          }
          if (patchFlag & 1) {
            if (n1.children !== n2.children) {
              hostSetElementText(el, n2.children);
            }
          }
        } else if (!optimized && dynamicChildren == null) {
          patchProps(el, oldProps, newProps, parentComponent, namespace2);
        }
        if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
          queuePostRenderEffect(() => {
            vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
            dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
          }, parentSuspense);
        }
      };
      const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace2, slotScopeIds) => {
        for (let i = 0; i < newChildren.length; i++) {
          const oldVNode = oldChildren[i];
          const newVNode = newChildren[i];
          const container = (
            // oldVNode may be an errored async setup() component inside Suspense
            // which will not have a mounted element
            oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
            // of the Fragment itself so it can move its children.
            (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
            // which also requires the correct parent container
            !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
            oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
              // In other cases, the parent container is not actually used so we
              // just pass the block element here to avoid a DOM parentNode call.
              fallbackContainer
            )
          );
          patch(
            oldVNode,
            newVNode,
            container,
            null,
            parentComponent,
            parentSuspense,
            namespace2,
            slotScopeIds,
            true
          );
        }
      };
      const patchProps = (el, oldProps, newProps, parentComponent, namespace2) => {
        if (oldProps !== newProps) {
          if (oldProps !== EMPTY_OBJ) {
            for (const key in oldProps) {
              if (!isReservedProp(key) && !(key in newProps)) {
                hostPatchProp(
                  el,
                  key,
                  oldProps[key],
                  null,
                  namespace2,
                  parentComponent
                );
              }
            }
          }
          for (const key in newProps) {
            if (isReservedProp(key)) continue;
            const next = newProps[key];
            const prev = oldProps[key];
            if (next !== prev && key !== "value") {
              hostPatchProp(el, key, prev, next, namespace2, parentComponent);
            }
          }
          if ("value" in newProps) {
            hostPatchProp(el, "value", oldProps.value, newProps.value, namespace2);
          }
        }
      };
      const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized) => {
        const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
        const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
        let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
        if (fragmentSlotScopeIds) {
          slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
        }
        if (n1 == null) {
          hostInsert(fragmentStartAnchor, container, anchor);
          hostInsert(fragmentEndAnchor, container, anchor);
          mountChildren(
            // #10007
            // such fragment like `<></>` will be compiled into
            // a fragment which doesn't have a children.
            // In this case fallback to an empty array
            n2.children || [],
            container,
            fragmentEndAnchor,
            parentComponent,
            parentSuspense,
            namespace2,
            slotScopeIds,
            optimized
          );
        } else {
          if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
          // of renderSlot() with no valid children
          n1.dynamicChildren) {
            patchBlockChildren(
              n1.dynamicChildren,
              dynamicChildren,
              container,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds
            );
            if (
              // #2080 if the stable fragment has a key, it's a <template v-for> that may
              //  get moved around. Make sure all root level vnodes inherit el.
              // #2134 or if it's a component root, it may also get moved around
              // as the component is being moved.
              n2.key != null || parentComponent && n2 === parentComponent.subTree
            ) {
              traverseStaticChildren(
                n1,
                n2,
                true
                /* shallow */
              );
            }
          } else {
            patchChildren(
              n1,
              n2,
              container,
              fragmentEndAnchor,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds,
              optimized
            );
          }
        }
      };
      const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized) => {
        n2.slotScopeIds = slotScopeIds;
        if (n1 == null) {
          if (n2.shapeFlag & 512) {
            parentComponent.ctx.activate(
              n2,
              container,
              anchor,
              namespace2,
              optimized
            );
          } else {
            mountComponent(
              n2,
              container,
              anchor,
              parentComponent,
              parentSuspense,
              namespace2,
              optimized
            );
          }
        } else {
          updateComponent(n1, n2, optimized);
        }
      };
      const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace2, optimized) => {
        const instance = initialVNode.component = createComponentInstance(
          initialVNode,
          parentComponent,
          parentSuspense
        );
        if (isKeepAlive(initialVNode)) {
          instance.ctx.renderer = internals;
        }
        {
          setupComponent(instance, false, optimized);
        }
        if (instance.asyncDep) {
          parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
          if (!initialVNode.el) {
            const placeholder = instance.subTree = createVNode(Comment);
            processCommentNode(null, placeholder, container, anchor);
          }
        } else {
          setupRenderEffect(
            instance,
            initialVNode,
            container,
            anchor,
            parentSuspense,
            namespace2,
            optimized
          );
        }
      };
      const updateComponent = (n1, n2, optimized) => {
        const instance = n2.component = n1.component;
        if (shouldUpdateComponent(n1, n2, optimized)) {
          if (instance.asyncDep && !instance.asyncResolved) {
            updateComponentPreRender(instance, n2, optimized);
            return;
          } else {
            instance.next = n2;
            instance.update();
          }
        } else {
          n2.el = n1.el;
          instance.vnode = n2;
        }
      };
      const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace2, optimized) => {
        const componentUpdateFn = () => {
          if (!instance.isMounted) {
            let vnodeHook;
            const { el, props } = initialVNode;
            const { bm, m, parent, root: root2, type } = instance;
            const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
            toggleRecurse(instance, false);
            if (bm) {
              invokeArrayFns(bm);
            }
            if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
              invokeVNodeHook(vnodeHook, parent, initialVNode);
            }
            toggleRecurse(instance, true);
            if (el && hydrateNode) {
              const hydrateSubTree = () => {
                instance.subTree = renderComponentRoot(instance);
                hydrateNode(
                  el,
                  instance.subTree,
                  instance,
                  parentSuspense,
                  null
                );
              };
              if (isAsyncWrapperVNode && type.__asyncHydrate) {
                type.__asyncHydrate(
                  el,
                  instance,
                  hydrateSubTree
                );
              } else {
                hydrateSubTree();
              }
            } else {
              if (root2.ce) {
                root2.ce._injectChildStyle(type);
              }
              const subTree = instance.subTree = renderComponentRoot(instance);
              patch(
                null,
                subTree,
                container,
                anchor,
                instance,
                parentSuspense,
                namespace2
              );
              initialVNode.el = subTree.el;
            }
            if (m) {
              queuePostRenderEffect(m, parentSuspense);
            }
            if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
              const scopedInitialVNode = initialVNode;
              queuePostRenderEffect(
                () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
                parentSuspense
              );
            }
            if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
              instance.a && queuePostRenderEffect(instance.a, parentSuspense);
            }
            instance.isMounted = true;
            initialVNode = container = anchor = null;
          } else {
            let { next, bu, u, parent, vnode } = instance;
            {
              const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
              if (nonHydratedAsyncRoot) {
                if (next) {
                  next.el = vnode.el;
                  updateComponentPreRender(instance, next, optimized);
                }
                nonHydratedAsyncRoot.asyncDep.then(() => {
                  if (!instance.isUnmounted) {
                    componentUpdateFn();
                  }
                });
                return;
              }
            }
            let originNext = next;
            let vnodeHook;
            toggleRecurse(instance, false);
            if (next) {
              next.el = vnode.el;
              updateComponentPreRender(instance, next, optimized);
            } else {
              next = vnode;
            }
            if (bu) {
              invokeArrayFns(bu);
            }
            if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
              invokeVNodeHook(vnodeHook, parent, next, vnode);
            }
            toggleRecurse(instance, true);
            const nextTree = renderComponentRoot(instance);
            const prevTree = instance.subTree;
            instance.subTree = nextTree;
            patch(
              prevTree,
              nextTree,
              // parent may have changed if it's in a teleport
              hostParentNode(prevTree.el),
              // anchor may have changed if it's in a fragment
              getNextHostNode(prevTree),
              instance,
              parentSuspense,
              namespace2
            );
            next.el = nextTree.el;
            if (originNext === null) {
              updateHOCHostEl(instance, nextTree.el);
            }
            if (u) {
              queuePostRenderEffect(u, parentSuspense);
            }
            if (vnodeHook = next.props && next.props.onVnodeUpdated) {
              queuePostRenderEffect(
                () => invokeVNodeHook(vnodeHook, parent, next, vnode),
                parentSuspense
              );
            }
          }
        };
        instance.scope.on();
        const effect2 = instance.effect = new ReactiveEffect(componentUpdateFn);
        instance.scope.off();
        const update = instance.update = effect2.run.bind(effect2);
        const job = instance.job = effect2.runIfDirty.bind(effect2);
        job.i = instance;
        job.id = instance.uid;
        effect2.scheduler = () => queueJob(job);
        toggleRecurse(instance, true);
        update();
      };
      const updateComponentPreRender = (instance, nextVNode, optimized) => {
        nextVNode.component = instance;
        const prevProps = instance.vnode.props;
        instance.vnode = nextVNode;
        instance.next = null;
        updateProps(instance, nextVNode.props, prevProps, optimized);
        updateSlots(instance, nextVNode.children, optimized);
        pauseTracking();
        flushPreFlushCbs(instance);
        resetTracking();
      };
      const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized = false) => {
        const c1 = n1 && n1.children;
        const prevShapeFlag = n1 ? n1.shapeFlag : 0;
        const c2 = n2.children;
        const { patchFlag, shapeFlag } = n2;
        if (patchFlag > 0) {
          if (patchFlag & 128) {
            patchKeyedChildren(
              c1,
              c2,
              container,
              anchor,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds,
              optimized
            );
            return;
          } else if (patchFlag & 256) {
            patchUnkeyedChildren(
              c1,
              c2,
              container,
              anchor,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds,
              optimized
            );
            return;
          }
        }
        if (shapeFlag & 8) {
          if (prevShapeFlag & 16) {
            unmountChildren(c1, parentComponent, parentSuspense);
          }
          if (c2 !== c1) {
            hostSetElementText(container, c2);
          }
        } else {
          if (prevShapeFlag & 16) {
            if (shapeFlag & 16) {
              patchKeyedChildren(
                c1,
                c2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized
              );
            } else {
              unmountChildren(c1, parentComponent, parentSuspense, true);
            }
          } else {
            if (prevShapeFlag & 8) {
              hostSetElementText(container, "");
            }
            if (shapeFlag & 16) {
              mountChildren(
                c2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized
              );
            }
          }
        }
      };
      const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized) => {
        c1 = c1 || EMPTY_ARR;
        c2 = c2 || EMPTY_ARR;
        const oldLength = c1.length;
        const newLength = c2.length;
        const commonLength = Math.min(oldLength, newLength);
        let i;
        for (i = 0; i < commonLength; i++) {
          const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
          patch(
            c1[i],
            nextChild,
            container,
            null,
            parentComponent,
            parentSuspense,
            namespace2,
            slotScopeIds,
            optimized
          );
        }
        if (oldLength > newLength) {
          unmountChildren(
            c1,
            parentComponent,
            parentSuspense,
            true,
            false,
            commonLength
          );
        } else {
          mountChildren(
            c2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace2,
            slotScopeIds,
            optimized,
            commonLength
          );
        }
      };
      const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace2, slotScopeIds, optimized) => {
        let i = 0;
        const l2 = c2.length;
        let e1 = c1.length - 1;
        let e2 = l2 - 1;
        while (i <= e1 && i <= e2) {
          const n1 = c1[i];
          const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
          if (isSameVNodeType(n1, n2)) {
            patch(
              n1,
              n2,
              container,
              null,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds,
              optimized
            );
          } else {
            break;
          }
          i++;
        }
        while (i <= e1 && i <= e2) {
          const n1 = c1[e1];
          const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
          if (isSameVNodeType(n1, n2)) {
            patch(
              n1,
              n2,
              container,
              null,
              parentComponent,
              parentSuspense,
              namespace2,
              slotScopeIds,
              optimized
            );
          } else {
            break;
          }
          e1--;
          e2--;
        }
        if (i > e1) {
          if (i <= e2) {
            const nextPos = e2 + 1;
            const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
            while (i <= e2) {
              patch(
                null,
                c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized
              );
              i++;
            }
          }
        } else if (i > e2) {
          while (i <= e1) {
            unmount2(c1[i], parentComponent, parentSuspense, true);
            i++;
          }
        } else {
          const s1 = i;
          const s2 = i;
          const keyToNewIndexMap = /* @__PURE__ */ new Map();
          for (i = s2; i <= e2; i++) {
            const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
            if (nextChild.key != null) {
              keyToNewIndexMap.set(nextChild.key, i);
            }
          }
          let j;
          let patched = 0;
          const toBePatched = e2 - s2 + 1;
          let moved = false;
          let maxNewIndexSoFar = 0;
          const newIndexToOldIndexMap = new Array(toBePatched);
          for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
          for (i = s1; i <= e1; i++) {
            const prevChild = c1[i];
            if (patched >= toBePatched) {
              unmount2(prevChild, parentComponent, parentSuspense, true);
              continue;
            }
            let newIndex;
            if (prevChild.key != null) {
              newIndex = keyToNewIndexMap.get(prevChild.key);
            } else {
              for (j = s2; j <= e2; j++) {
                if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
                  newIndex = j;
                  break;
                }
              }
            }
            if (newIndex === void 0) {
              unmount2(prevChild, parentComponent, parentSuspense, true);
            } else {
              newIndexToOldIndexMap[newIndex - s2] = i + 1;
              if (newIndex >= maxNewIndexSoFar) {
                maxNewIndexSoFar = newIndex;
              } else {
                moved = true;
              }
              patch(
                prevChild,
                c2[newIndex],
                container,
                null,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized
              );
              patched++;
            }
          }
          const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
          j = increasingNewIndexSequence.length - 1;
          for (i = toBePatched - 1; i >= 0; i--) {
            const nextIndex = s2 + i;
            const nextChild = c2[nextIndex];
            const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
            if (newIndexToOldIndexMap[i] === 0) {
              patch(
                null,
                nextChild,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace2,
                slotScopeIds,
                optimized
              );
            } else if (moved) {
              if (j < 0 || i !== increasingNewIndexSequence[j]) {
                move2(nextChild, container, anchor, 2);
              } else {
                j--;
              }
            }
          }
        }
      };
      const move2 = (vnode, container, anchor, moveType, parentSuspense = null) => {
        const { el, type, transition, children, shapeFlag } = vnode;
        if (shapeFlag & 6) {
          move2(vnode.component.subTree, container, anchor, moveType);
          return;
        }
        if (shapeFlag & 128) {
          vnode.suspense.move(container, anchor, moveType);
          return;
        }
        if (shapeFlag & 64) {
          type.move(vnode, container, anchor, internals);
          return;
        }
        if (type === Fragment) {
          hostInsert(el, container, anchor);
          for (let i = 0; i < children.length; i++) {
            move2(children[i], container, anchor, moveType);
          }
          hostInsert(vnode.anchor, container, anchor);
          return;
        }
        if (type === Static) {
          moveStaticNode(vnode, container, anchor);
          return;
        }
        const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
        if (needTransition2) {
          if (moveType === 0) {
            transition.beforeEnter(el);
            hostInsert(el, container, anchor);
            queuePostRenderEffect(() => transition.enter(el), parentSuspense);
          } else {
            const { leave, delayLeave, afterLeave } = transition;
            const remove22 = () => hostInsert(el, container, anchor);
            const performLeave = () => {
              leave(el, () => {
                remove22();
                afterLeave && afterLeave();
              });
            };
            if (delayLeave) {
              delayLeave(el, remove22, performLeave);
            } else {
              performLeave();
            }
          }
        } else {
          hostInsert(el, container, anchor);
        }
      };
      const unmount2 = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
        const {
          type,
          props,
          ref: ref3,
          children,
          dynamicChildren,
          shapeFlag,
          patchFlag,
          dirs,
          cacheIndex
        } = vnode;
        if (patchFlag === -2) {
          optimized = false;
        }
        if (ref3 != null) {
          setRef(ref3, null, parentSuspense, vnode, true);
        }
        if (cacheIndex != null) {
          parentComponent.renderCache[cacheIndex] = void 0;
        }
        if (shapeFlag & 256) {
          parentComponent.ctx.deactivate(vnode);
          return;
        }
        const shouldInvokeDirs = shapeFlag & 1 && dirs;
        const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
        let vnodeHook;
        if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
          invokeVNodeHook(vnodeHook, parentComponent, vnode);
        }
        if (shapeFlag & 6) {
          unmountComponent(vnode.component, parentSuspense, doRemove);
        } else {
          if (shapeFlag & 128) {
            vnode.suspense.unmount(parentSuspense, doRemove);
            return;
          }
          if (shouldInvokeDirs) {
            invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
          }
          if (shapeFlag & 64) {
            vnode.type.remove(
              vnode,
              parentComponent,
              parentSuspense,
              internals,
              doRemove
            );
          } else if (dynamicChildren && // #5154
          // when v-once is used inside a block, setBlockTracking(-1) marks the
          // parent block with hasOnce: true
          // so that it doesn't take the fast path during unmount - otherwise
          // components nested in v-once are never unmounted.
          !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
          (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
            unmountChildren(
              dynamicChildren,
              parentComponent,
              parentSuspense,
              false,
              true
            );
          } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
            unmountChildren(children, parentComponent, parentSuspense);
          }
          if (doRemove) {
            remove2(vnode);
          }
        }
        if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
          queuePostRenderEffect(() => {
            vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
            shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
          }, parentSuspense);
        }
      };
      const remove2 = (vnode) => {
        const { type, el, anchor, transition } = vnode;
        if (type === Fragment) {
          {
            removeFragment(el, anchor);
          }
          return;
        }
        if (type === Static) {
          removeStaticNode(vnode);
          return;
        }
        const performRemove = () => {
          hostRemove(el);
          if (transition && !transition.persisted && transition.afterLeave) {
            transition.afterLeave();
          }
        };
        if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
          const { leave, delayLeave } = transition;
          const performLeave = () => leave(el, performRemove);
          if (delayLeave) {
            delayLeave(vnode.el, performRemove, performLeave);
          } else {
            performLeave();
          }
        } else {
          performRemove();
        }
      };
      const removeFragment = (cur, end) => {
        let next;
        while (cur !== end) {
          next = hostNextSibling(cur);
          hostRemove(cur);
          cur = next;
        }
        hostRemove(end);
      };
      const unmountComponent = (instance, parentSuspense, doRemove) => {
        const { bum, scope, job, subTree, um, m, a } = instance;
        invalidateMount(m);
        invalidateMount(a);
        if (bum) {
          invokeArrayFns(bum);
        }
        scope.stop();
        if (job) {
          job.flags |= 8;
          unmount2(subTree, instance, parentSuspense, doRemove);
        }
        if (um) {
          queuePostRenderEffect(um, parentSuspense);
        }
        queuePostRenderEffect(() => {
          instance.isUnmounted = true;
        }, parentSuspense);
        if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
          parentSuspense.deps--;
          if (parentSuspense.deps === 0) {
            parentSuspense.resolve();
          }
        }
      };
      const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
        for (let i = start; i < children.length; i++) {
          unmount2(children[i], parentComponent, parentSuspense, doRemove, optimized);
        }
      };
      const getNextHostNode = (vnode) => {
        if (vnode.shapeFlag & 6) {
          return getNextHostNode(vnode.component.subTree);
        }
        if (vnode.shapeFlag & 128) {
          return vnode.suspense.next();
        }
        const el = hostNextSibling(vnode.anchor || vnode.el);
        const teleportEnd = el && el[TeleportEndKey];
        return teleportEnd ? hostNextSibling(teleportEnd) : el;
      };
      let isFlushing = false;
      const render2 = (vnode, container, namespace2) => {
        if (vnode == null) {
          if (container._vnode) {
            unmount2(container._vnode, null, null, true);
          }
        } else {
          patch(
            container._vnode || null,
            vnode,
            container,
            null,
            null,
            null,
            namespace2
          );
        }
        container._vnode = vnode;
        if (!isFlushing) {
          isFlushing = true;
          flushPreFlushCbs();
          flushPostFlushCbs();
          isFlushing = false;
        }
      };
      const internals = {
        p: patch,
        um: unmount2,
        m: move2,
        r: remove2,
        mt: mountComponent,
        mc: mountChildren,
        pc: patchChildren,
        pbc: patchBlockChildren,
        n: getNextHostNode,
        o: options
      };
      let hydrate;
      let hydrateNode;
      return {
        render: render2,
        hydrate,
        createApp: createAppAPI(render2, hydrate)
      };
    }
    function resolveChildrenNamespace({ type, props }, currentNamespace) {
      return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
    }
    function toggleRecurse({ effect: effect2, job }, allowed) {
      if (allowed) {
        effect2.flags |= 32;
        job.flags |= 4;
      } else {
        effect2.flags &= ~32;
        job.flags &= ~4;
      }
    }
    function needTransition(parentSuspense, transition) {
      return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
    }
    function traverseStaticChildren(n1, n2, shallow = false) {
      const ch1 = n1.children;
      const ch2 = n2.children;
      if (isArray$3(ch1) && isArray$3(ch2)) {
        for (let i = 0; i < ch1.length; i++) {
          const c1 = ch1[i];
          let c2 = ch2[i];
          if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
            if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
              c2 = ch2[i] = cloneIfMounted(ch2[i]);
              c2.el = c1.el;
            }
            if (!shallow && c2.patchFlag !== -2)
              traverseStaticChildren(c1, c2);
          }
          if (c2.type === Text) {
            c2.el = c1.el;
          }
        }
      }
    }
    function getSequence(arr) {
      const p2 = arr.slice();
      const result = [0];
      let i, j, u, v, c2;
      const len2 = arr.length;
      for (i = 0; i < len2; i++) {
        const arrI = arr[i];
        if (arrI !== 0) {
          j = result[result.length - 1];
          if (arr[j] < arrI) {
            p2[i] = j;
            result.push(i);
            continue;
          }
          u = 0;
          v = result.length - 1;
          while (u < v) {
            c2 = u + v >> 1;
            if (arr[result[c2]] < arrI) {
              u = c2 + 1;
            } else {
              v = c2;
            }
          }
          if (arrI < arr[result[u]]) {
            if (u > 0) {
              p2[i] = result[u - 1];
            }
            result[u] = i;
          }
        }
      }
      u = result.length;
      v = result[u - 1];
      while (u-- > 0) {
        result[u] = v;
        v = p2[v];
      }
      return result;
    }
    function locateNonHydratedAsyncRoot(instance) {
      const subComponent = instance.subTree.component;
      if (subComponent) {
        if (subComponent.asyncDep && !subComponent.asyncResolved) {
          return subComponent;
        } else {
          return locateNonHydratedAsyncRoot(subComponent);
        }
      }
    }
    function invalidateMount(hooks) {
      if (hooks) {
        for (let i = 0; i < hooks.length; i++)
          hooks[i].flags |= 8;
      }
    }
    const ssrContextKey$1 = Symbol.for("v-scx");
    const useSSRContext = () => {
      {
        const ctx2 = inject(ssrContextKey$1);
        return ctx2;
      }
    };
    function watchEffect(effect2, options) {
      return doWatch(effect2, null, options);
    }
    function watchPostEffect(effect2, options) {
      return doWatch(
        effect2,
        null,
        { flush: "post" }
      );
    }
    function watch(source, cb, options) {
      return doWatch(source, cb, options);
    }
    function doWatch(source, cb, options = EMPTY_OBJ) {
      const { immediate, deep, flush, once } = options;
      const baseWatchOptions = extend({}, options);
      const runsImmediately = cb && immediate || !cb && flush !== "post";
      let ssrCleanup;
      if (isInSSRComponentSetup) {
        if (flush === "sync") {
          const ctx2 = useSSRContext();
          ssrCleanup = ctx2.__watcherHandles || (ctx2.__watcherHandles = []);
        } else if (!runsImmediately) {
          const watchStopHandle = () => {
          };
          watchStopHandle.stop = NOOP;
          watchStopHandle.resume = NOOP;
          watchStopHandle.pause = NOOP;
          return watchStopHandle;
        }
      }
      const instance = currentInstance;
      baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
      let isPre = false;
      if (flush === "post") {
        baseWatchOptions.scheduler = (job) => {
          queuePostRenderEffect(job, instance && instance.suspense);
        };
      } else if (flush !== "sync") {
        isPre = true;
        baseWatchOptions.scheduler = (job, isFirstRun) => {
          if (isFirstRun) {
            job();
          } else {
            queueJob(job);
          }
        };
      }
      baseWatchOptions.augmentJob = (job) => {
        if (cb) {
          job.flags |= 4;
        }
        if (isPre) {
          job.flags |= 2;
          if (instance) {
            job.id = instance.uid;
            job.i = instance;
          }
        }
      };
      const watchHandle = watch$1(source, cb, baseWatchOptions);
      if (isInSSRComponentSetup) {
        if (ssrCleanup) {
          ssrCleanup.push(watchHandle);
        } else if (runsImmediately) {
          watchHandle();
        }
      }
      return watchHandle;
    }
    function instanceWatch(source, value, options) {
      const publicThis = this.proxy;
      const getter = isString$2(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
      let cb;
      if (isFunction$2(value)) {
        cb = value;
      } else {
        cb = value.handler;
        options = value;
      }
      const reset = setCurrentInstance(this);
      const res = doWatch(getter, cb.bind(publicThis), options);
      reset();
      return res;
    }
    function createPathGetter(ctx2, path) {
      const segments = path.split(".");
      return () => {
        let cur = ctx2;
        for (let i = 0; i < segments.length && cur; i++) {
          cur = cur[segments[i]];
        }
        return cur;
      };
    }
    const getModelModifiers = (props, modelName) => {
      return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
    };
    function emit(instance, event, ...rawArgs) {
      if (instance.isUnmounted) return;
      const props = instance.vnode.props || EMPTY_OBJ;
      let args = rawArgs;
      const isModelListener2 = event.startsWith("update:");
      const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7));
      if (modifiers) {
        if (modifiers.trim) {
          args = rawArgs.map((a) => isString$2(a) ? a.trim() : a);
        }
        if (modifiers.number) {
          args = rawArgs.map(looseToNumber);
        }
      }
      let handlerName;
      let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
      props[handlerName = toHandlerKey(camelize(event))];
      if (!handler && isModelListener2) {
        handler = props[handlerName = toHandlerKey(hyphenate(event))];
      }
      if (handler) {
        callWithAsyncErrorHandling(
          handler,
          instance,
          6,
          args
        );
      }
      const onceHandler = props[handlerName + `Once`];
      if (onceHandler) {
        if (!instance.emitted) {
          instance.emitted = {};
        } else if (instance.emitted[handlerName]) {
          return;
        }
        instance.emitted[handlerName] = true;
        callWithAsyncErrorHandling(
          onceHandler,
          instance,
          6,
          args
        );
      }
    }
    function normalizeEmitsOptions(comp, appContext, asMixin = false) {
      const cache2 = appContext.emitsCache;
      const cached = cache2.get(comp);
      if (cached !== void 0) {
        return cached;
      }
      const raw = comp.emits;
      let normalized = {};
      let hasExtends = false;
      if (!isFunction$2(comp)) {
        const extendEmits = (raw2) => {
          const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
          if (normalizedFromExtend) {
            hasExtends = true;
            extend(normalized, normalizedFromExtend);
          }
        };
        if (!asMixin && appContext.mixins.length) {
          appContext.mixins.forEach(extendEmits);
        }
        if (comp.extends) {
          extendEmits(comp.extends);
        }
        if (comp.mixins) {
          comp.mixins.forEach(extendEmits);
        }
      }
      if (!raw && !hasExtends) {
        if (isObject$4(comp)) {
          cache2.set(comp, null);
        }
        return null;
      }
      if (isArray$3(raw)) {
        raw.forEach((key) => normalized[key] = null);
      } else {
        extend(normalized, raw);
      }
      if (isObject$4(comp)) {
        cache2.set(comp, normalized);
      }
      return normalized;
    }
    function isEmitListener(options, key) {
      if (!options || !isOn(key)) {
        return false;
      }
      key = key.slice(2).replace(/Once$/, "");
      return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
    }
    function markAttrsAccessed() {
    }
    function renderComponentRoot(instance) {
      const {
        type: Component,
        vnode,
        proxy,
        withProxy,
        propsOptions: [propsOptions],
        slots,
        attrs,
        emit: emit2,
        render: render2,
        renderCache,
        props,
        data,
        setupState,
        ctx: ctx2,
        inheritAttrs
      } = instance;
      const prev = setCurrentRenderingInstance(instance);
      let result;
      let fallthroughAttrs;
      try {
        if (vnode.shapeFlag & 4) {
          const proxyToUse = withProxy || proxy;
          const thisProxy = false ? new Proxy(proxyToUse, {
            get(target, key, receiver) {
              warn$1$1(
                `Property '${String(
                  key
                )}' was accessed via 'this'. Avoid using 'this' in templates.`
              );
              return Reflect.get(target, key, receiver);
            }
          }) : proxyToUse;
          result = normalizeVNode(
            render2.call(
              thisProxy,
              proxyToUse,
              renderCache,
              false ? shallowReadonly(props) : props,
              setupState,
              data,
              ctx2
            )
          );
          fallthroughAttrs = attrs;
        } else {
          const render22 = Component;
          if (false) ;
          result = normalizeVNode(
            render22.length > 1 ? render22(
              false ? shallowReadonly(props) : props,
              false ? {
                get attrs() {
                  markAttrsAccessed();
                  return shallowReadonly(attrs);
                },
                slots,
                emit: emit2
              } : { attrs, slots, emit: emit2 }
            ) : render22(
              false ? shallowReadonly(props) : props,
              null
            )
          );
          fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
        }
      } catch (err) {
        blockStack.length = 0;
        handleError(err, instance, 1);
        result = createVNode(Comment);
      }
      let root2 = result;
      if (fallthroughAttrs && inheritAttrs !== false) {
        const keys2 = Object.keys(fallthroughAttrs);
        const { shapeFlag } = root2;
        if (keys2.length) {
          if (shapeFlag & (1 | 6)) {
            if (propsOptions && keys2.some(isModelListener)) {
              fallthroughAttrs = filterModelListeners(
                fallthroughAttrs,
                propsOptions
              );
            }
            root2 = cloneVNode(root2, fallthroughAttrs, false, true);
          }
        }
      }
      if (vnode.dirs) {
        root2 = cloneVNode(root2, null, false, true);
        root2.dirs = root2.dirs ? root2.dirs.concat(vnode.dirs) : vnode.dirs;
      }
      if (vnode.transition) {
        setTransitionHooks(root2, vnode.transition);
      }
      {
        result = root2;
      }
      setCurrentRenderingInstance(prev);
      return result;
    }
    const getFunctionalFallthrough = (attrs) => {
      let res;
      for (const key in attrs) {
        if (key === "class" || key === "style" || isOn(key)) {
          (res || (res = {}))[key] = attrs[key];
        }
      }
      return res;
    };
    const filterModelListeners = (attrs, props) => {
      const res = {};
      for (const key in attrs) {
        if (!isModelListener(key) || !(key.slice(9) in props)) {
          res[key] = attrs[key];
        }
      }
      return res;
    };
    function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
      const { props: prevProps, children: prevChildren, component } = prevVNode;
      const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
      const emits = component.emitsOptions;
      if (nextVNode.dirs || nextVNode.transition) {
        return true;
      }
      if (optimized && patchFlag >= 0) {
        if (patchFlag & 1024) {
          return true;
        }
        if (patchFlag & 16) {
          if (!prevProps) {
            return !!nextProps;
          }
          return hasPropsChanged(prevProps, nextProps, emits);
        } else if (patchFlag & 8) {
          const dynamicProps = nextVNode.dynamicProps;
          for (let i = 0; i < dynamicProps.length; i++) {
            const key = dynamicProps[i];
            if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
              return true;
            }
          }
        }
      } else {
        if (prevChildren || nextChildren) {
          if (!nextChildren || !nextChildren.$stable) {
            return true;
          }
        }
        if (prevProps === nextProps) {
          return false;
        }
        if (!prevProps) {
          return !!nextProps;
        }
        if (!nextProps) {
          return true;
        }
        return hasPropsChanged(prevProps, nextProps, emits);
      }
      return false;
    }
    function hasPropsChanged(prevProps, nextProps, emitsOptions) {
      const nextKeys = Object.keys(nextProps);
      if (nextKeys.length !== Object.keys(prevProps).length) {
        return true;
      }
      for (let i = 0; i < nextKeys.length; i++) {
        const key = nextKeys[i];
        if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
          return true;
        }
      }
      return false;
    }
    function updateHOCHostEl({ vnode, parent }, el) {
      while (parent) {
        const root2 = parent.subTree;
        if (root2.suspense && root2.suspense.activeBranch === vnode) {
          root2.el = vnode.el;
        }
        if (root2 === vnode) {
          (vnode = parent.vnode).el = el;
          parent = parent.parent;
        } else {
          break;
        }
      }
    }
    const isSuspense = (type) => type.__isSuspense;
    function queueEffectWithSuspense(fn, suspense) {
      if (suspense && suspense.pendingBranch) {
        if (isArray$3(fn)) {
          suspense.effects.push(...fn);
        } else {
          suspense.effects.push(fn);
        }
      } else {
        queuePostFlushCb(fn);
      }
    }
    const Fragment = Symbol.for("v-fgt");
    const Text = Symbol.for("v-txt");
    const Comment = Symbol.for("v-cmt");
    const Static = Symbol.for("v-stc");
    const blockStack = [];
    let currentBlock = null;
    function openBlock(disableTracking = false) {
      blockStack.push(currentBlock = disableTracking ? null : []);
    }
    function closeBlock() {
      blockStack.pop();
      currentBlock = blockStack[blockStack.length - 1] || null;
    }
    let isBlockTreeEnabled = 1;
    function setBlockTracking(value) {
      isBlockTreeEnabled += value;
      if (value < 0 && currentBlock) {
        currentBlock.hasOnce = true;
      }
    }
    function setupBlock(vnode) {
      vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
      closeBlock();
      if (isBlockTreeEnabled > 0 && currentBlock) {
        currentBlock.push(vnode);
      }
      return vnode;
    }
    function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
      return setupBlock(
        createBaseVNode(
          type,
          props,
          children,
          patchFlag,
          dynamicProps,
          shapeFlag,
          true
        )
      );
    }
    function createBlock(type, props, children, patchFlag, dynamicProps) {
      return setupBlock(
        createVNode(
          type,
          props,
          children,
          patchFlag,
          dynamicProps,
          true
        )
      );
    }
    function isVNode$1(value) {
      return value ? value.__v_isVNode === true : false;
    }
    function isSameVNodeType(n1, n2) {
      return n1.type === n2.type && n1.key === n2.key;
    }
    const normalizeKey = ({ key }) => key != null ? key : null;
    const normalizeRef = ({
      ref: ref3,
      ref_key,
      ref_for
    }) => {
      if (typeof ref3 === "number") {
        ref3 = "" + ref3;
      }
      return ref3 != null ? isString$2(ref3) || isRef(ref3) || isFunction$2(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null;
    };
    function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
      const vnode = {
        __v_isVNode: true,
        __v_skip: true,
        type,
        props,
        key: props && normalizeKey(props),
        ref: props && normalizeRef(props),
        scopeId: currentScopeId,
        slotScopeIds: null,
        children,
        component: null,
        suspense: null,
        ssContent: null,
        ssFallback: null,
        dirs: null,
        transition: null,
        el: null,
        anchor: null,
        target: null,
        targetStart: null,
        targetAnchor: null,
        staticCount: 0,
        shapeFlag,
        patchFlag,
        dynamicProps,
        dynamicChildren: null,
        appContext: null,
        ctx: currentRenderingInstance
      };
      if (needFullChildrenNormalization) {
        normalizeChildren(vnode, children);
        if (shapeFlag & 128) {
          type.normalize(vnode);
        }
      } else if (children) {
        vnode.shapeFlag |= isString$2(children) ? 8 : 16;
      }
      if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
      !isBlockNode && // has current parent block
      currentBlock && // presence of a patch flag indicates this node needs patching on updates.
      // component nodes also should always be patched, because even if the
      // component doesn't need to update, it needs to persist the instance on to
      // the next vnode so that it can be properly unmounted later.
      (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
      // vnode should not be considered dynamic due to handler caching.
      vnode.patchFlag !== 32) {
        currentBlock.push(vnode);
      }
      return vnode;
    }
    const createVNode = _createVNode;
    function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
      if (!type || type === NULL_DYNAMIC_COMPONENT) {
        type = Comment;
      }
      if (isVNode$1(type)) {
        const cloned = cloneVNode(
          type,
          props,
          true
          /* mergeRef: true */
        );
        if (children) {
          normalizeChildren(cloned, children);
        }
        if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
          if (cloned.shapeFlag & 6) {
            currentBlock[currentBlock.indexOf(type)] = cloned;
          } else {
            currentBlock.push(cloned);
          }
        }
        cloned.patchFlag = -2;
        return cloned;
      }
      if (isClassComponent(type)) {
        type = type.__vccOpts;
      }
      if (props) {
        props = guardReactiveProps(props);
        let { class: klass, style: style2 } = props;
        if (klass && !isString$2(klass)) {
          props.class = normalizeClass(klass);
        }
        if (isObject$4(style2)) {
          if (isProxy(style2) && !isArray$3(style2)) {
            style2 = extend({}, style2);
          }
          props.style = normalizeStyle(style2);
        }
      }
      const shapeFlag = isString$2(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$4(type) ? 4 : isFunction$2(type) ? 2 : 0;
      return createBaseVNode(
        type,
        props,
        children,
        patchFlag,
        dynamicProps,
        shapeFlag,
        isBlockNode,
        true
      );
    }
    function guardReactiveProps(props) {
      if (!props) return null;
      return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
    }
    function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
      const { props, ref: ref3, patchFlag, children, transition } = vnode;
      const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
      const cloned = {
        __v_isVNode: true,
        __v_skip: true,
        type: vnode.type,
        props: mergedProps,
        key: mergedProps && normalizeKey(mergedProps),
        ref: extraProps && extraProps.ref ? (
          // #2078 in the case of <component :is="vnode" ref="extra"/>
          // if the vnode itself already has a ref, cloneVNode will need to merge
          // the refs so the single vnode can be set on multiple refs
          mergeRef && ref3 ? isArray$3(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps)
        ) : ref3,
        scopeId: vnode.scopeId,
        slotScopeIds: vnode.slotScopeIds,
        children,
        target: vnode.target,
        targetStart: vnode.targetStart,
        targetAnchor: vnode.targetAnchor,
        staticCount: vnode.staticCount,
        shapeFlag: vnode.shapeFlag,
        // if the vnode is cloned with extra props, we can no longer assume its
        // existing patch flag to be reliable and need to add the FULL_PROPS flag.
        // note: preserve flag for fragments since they use the flag for children
        // fast paths only.
        patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
        dynamicProps: vnode.dynamicProps,
        dynamicChildren: vnode.dynamicChildren,
        appContext: vnode.appContext,
        dirs: vnode.dirs,
        transition,
        // These should technically only be non-null on mounted VNodes. However,
        // they *should* be copied for kept-alive vnodes. So we just always copy
        // them since them being non-null during a mount doesn't affect the logic as
        // they will simply be overwritten.
        component: vnode.component,
        suspense: vnode.suspense,
        ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
        ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
        el: vnode.el,
        anchor: vnode.anchor,
        ctx: vnode.ctx,
        ce: vnode.ce
      };
      if (transition && cloneTransition) {
        setTransitionHooks(
          cloned,
          transition.clone(cloned)
        );
      }
      return cloned;
    }
    function createTextVNode(text = " ", flag = 0) {
      return createVNode(Text, null, text, flag);
    }
    function createStaticVNode(content, numberOfNodes) {
      const vnode = createVNode(Static, null, content);
      vnode.staticCount = numberOfNodes;
      return vnode;
    }
    function normalizeVNode(child) {
      if (child == null || typeof child === "boolean") {
        return createVNode(Comment);
      } else if (isArray$3(child)) {
        return createVNode(
          Fragment,
          null,
          // #3666, avoid reference pollution when reusing vnode
          child.slice()
        );
      } else if (isVNode$1(child)) {
        return cloneIfMounted(child);
      } else {
        return createVNode(Text, null, String(child));
      }
    }
    function cloneIfMounted(child) {
      return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
    }
    function normalizeChildren(vnode, children) {
      let type = 0;
      const { shapeFlag } = vnode;
      if (children == null) {
        children = null;
      } else if (isArray$3(children)) {
        type = 16;
      } else if (typeof children === "object") {
        if (shapeFlag & (1 | 64)) {
          const slot = children.default;
          if (slot) {
            slot._c && (slot._d = false);
            normalizeChildren(vnode, slot());
            slot._c && (slot._d = true);
          }
          return;
        } else {
          type = 32;
          const slotFlag = children._;
          if (!slotFlag && !isInternalObject(children)) {
            children._ctx = currentRenderingInstance;
          } else if (slotFlag === 3 && currentRenderingInstance) {
            if (currentRenderingInstance.slots._ === 1) {
              children._ = 1;
            } else {
              children._ = 2;
              vnode.patchFlag |= 1024;
            }
          }
        }
      } else if (isFunction$2(children)) {
        children = { default: children, _ctx: currentRenderingInstance };
        type = 32;
      } else {
        children = String(children);
        if (shapeFlag & 64) {
          type = 16;
          children = [createTextVNode(children)];
        } else {
          type = 8;
        }
      }
      vnode.children = children;
      vnode.shapeFlag |= type;
    }
    function mergeProps(...args) {
      const ret = {};
      for (let i = 0; i < args.length; i++) {
        const toMerge = args[i];
        for (const key in toMerge) {
          if (key === "class") {
            if (ret.class !== toMerge.class) {
              ret.class = normalizeClass([ret.class, toMerge.class]);
            }
          } else if (key === "style") {
            ret.style = normalizeStyle([ret.style, toMerge.style]);
          } else if (isOn(key)) {
            const existing = ret[key];
            const incoming = toMerge[key];
            if (incoming && existing !== incoming && !(isArray$3(existing) && existing.includes(incoming))) {
              ret[key] = existing ? [].concat(existing, incoming) : incoming;
            }
          } else if (key !== "") {
            ret[key] = toMerge[key];
          }
        }
      }
      return ret;
    }
    function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
      callWithAsyncErrorHandling(hook, instance, 7, [
        vnode,
        prevVNode
      ]);
    }
    const emptyAppContext = createAppContext();
    let uid = 0;
    function createComponentInstance(vnode, parent, suspense) {
      const type = vnode.type;
      const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
      const instance = {
        uid: uid++,
        vnode,
        type,
        parent,
        appContext,
        root: null,
        // to be immediately set
        next: null,
        subTree: null,
        // will be set synchronously right after creation
        effect: null,
        update: null,
        // will be set synchronously right after creation
        job: null,
        scope: new EffectScope(
          true
          /* detached */
        ),
        render: null,
        proxy: null,
        exposed: null,
        exposeProxy: null,
        withProxy: null,
        provides: parent ? parent.provides : Object.create(appContext.provides),
        ids: parent ? parent.ids : ["", 0, 0],
        accessCache: null,
        renderCache: [],
        // local resolved assets
        components: null,
        directives: null,
        // resolved props and emits options
        propsOptions: normalizePropsOptions(type, appContext),
        emitsOptions: normalizeEmitsOptions(type, appContext),
        // emit
        emit: null,
        // to be set immediately
        emitted: null,
        // props default value
        propsDefaults: EMPTY_OBJ,
        // inheritAttrs
        inheritAttrs: type.inheritAttrs,
        // state
        ctx: EMPTY_OBJ,
        data: EMPTY_OBJ,
        props: EMPTY_OBJ,
        attrs: EMPTY_OBJ,
        slots: EMPTY_OBJ,
        refs: EMPTY_OBJ,
        setupState: EMPTY_OBJ,
        setupContext: null,
        // suspense related
        suspense,
        suspenseId: suspense ? suspense.pendingId : 0,
        asyncDep: null,
        asyncResolved: false,
        // lifecycle hooks
        // not using enums here because it results in computed properties
        isMounted: false,
        isUnmounted: false,
        isDeactivated: false,
        bc: null,
        c: null,
        bm: null,
        m: null,
        bu: null,
        u: null,
        um: null,
        bum: null,
        da: null,
        a: null,
        rtg: null,
        rtc: null,
        ec: null,
        sp: null
      };
      {
        instance.ctx = { _: instance };
      }
      instance.root = parent ? parent.root : instance;
      instance.emit = emit.bind(null, instance);
      if (vnode.ce) {
        vnode.ce(instance);
      }
      return instance;
    }
    let currentInstance = null;
    const getCurrentInstance = () => currentInstance || currentRenderingInstance;
    let internalSetCurrentInstance;
    let setInSSRSetupState;
    {
      const g = getGlobalThis$1();
      const registerGlobalSetter = (key, setter) => {
        let setters;
        if (!(setters = g[key])) setters = g[key] = [];
        setters.push(setter);
        return (v) => {
          if (setters.length > 1) setters.forEach((set2) => set2(v));
          else setters[0](v);
        };
      };
      internalSetCurrentInstance = registerGlobalSetter(
        `__VUE_INSTANCE_SETTERS__`,
        (v) => currentInstance = v
      );
      setInSSRSetupState = registerGlobalSetter(
        `__VUE_SSR_SETTERS__`,
        (v) => isInSSRComponentSetup = v
      );
    }
    const setCurrentInstance = (instance) => {
      const prev = currentInstance;
      internalSetCurrentInstance(instance);
      instance.scope.on();
      return () => {
        instance.scope.off();
        internalSetCurrentInstance(prev);
      };
    };
    const unsetCurrentInstance = () => {
      currentInstance && currentInstance.scope.off();
      internalSetCurrentInstance(null);
    };
    function isStatefulComponent(instance) {
      return instance.vnode.shapeFlag & 4;
    }
    let isInSSRComponentSetup = false;
    function setupComponent(instance, isSSR = false, optimized = false) {
      isSSR && setInSSRSetupState(isSSR);
      const { props, children } = instance.vnode;
      const isStateful = isStatefulComponent(instance);
      initProps(instance, props, isStateful, isSSR);
      initSlots(instance, children, optimized);
      const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
      isSSR && setInSSRSetupState(false);
      return setupResult;
    }
    function setupStatefulComponent(instance, isSSR) {
      const Component = instance.type;
      instance.accessCache = /* @__PURE__ */ Object.create(null);
      instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
      const { setup } = Component;
      if (setup) {
        pauseTracking();
        const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
        const reset = setCurrentInstance(instance);
        const setupResult = callWithErrorHandling(
          setup,
          instance,
          0,
          [
            instance.props,
            setupContext
          ]
        );
        const isAsyncSetup = isPromise$1(setupResult);
        resetTracking();
        reset();
        if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
          markAsyncBoundary(instance);
        }
        if (isAsyncSetup) {
          setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
          if (isSSR) {
            return setupResult.then((resolvedResult) => {
              handleSetupResult(instance, resolvedResult, isSSR);
            }).catch((e) => {
              handleError(e, instance, 0);
            });
          } else {
            instance.asyncDep = setupResult;
          }
        } else {
          handleSetupResult(instance, setupResult, isSSR);
        }
      } else {
        finishComponentSetup(instance, isSSR);
      }
    }
    function handleSetupResult(instance, setupResult, isSSR) {
      if (isFunction$2(setupResult)) {
        if (instance.type.__ssrInlineRender) {
          instance.ssrRender = setupResult;
        } else {
          instance.render = setupResult;
        }
      } else if (isObject$4(setupResult)) {
        instance.setupState = proxyRefs(setupResult);
      } else ;
      finishComponentSetup(instance, isSSR);
    }
    let compile$1;
    function finishComponentSetup(instance, isSSR, skipOptions) {
      const Component = instance.type;
      if (!instance.render) {
        if (!isSSR && compile$1 && !Component.render) {
          const template = Component.template || resolveMergedOptions(instance).template;
          if (template) {
            const { isCustomElement, compilerOptions } = instance.appContext.config;
            const { delimiters, compilerOptions: componentCompilerOptions } = Component;
            const finalCompilerOptions = extend(
              extend(
                {
                  isCustomElement,
                  delimiters
                },
                compilerOptions
              ),
              componentCompilerOptions
            );
            Component.render = compile$1(template, finalCompilerOptions);
          }
        }
        instance.render = Component.render || NOOP;
      }
      {
        const reset = setCurrentInstance(instance);
        pauseTracking();
        try {
          applyOptions(instance);
        } finally {
          resetTracking();
          reset();
        }
      }
    }
    const attrsProxyHandlers = {
      get(target, key) {
        track(target, "get", "");
        return target[key];
      }
    };
    function createSetupContext(instance) {
      const expose = (exposed) => {
        instance.exposed = exposed || {};
      };
      {
        return {
          attrs: new Proxy(instance.attrs, attrsProxyHandlers),
          slots: instance.slots,
          emit: instance.emit,
          expose
        };
      }
    }
    function getComponentPublicInstance(instance) {
      if (instance.exposed) {
        return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
          get(target, key) {
            if (key in target) {
              return target[key];
            } else if (key in publicPropertiesMap) {
              return publicPropertiesMap[key](instance);
            }
          },
          has(target, key) {
            return key in target || key in publicPropertiesMap;
          }
        }));
      } else {
        return instance.proxy;
      }
    }
    const classifyRE = /(?:^|[-_])(\w)/g;
    const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
    function getComponentName(Component, includeInferred = true) {
      return isFunction$2(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
    }
    function formatComponentName(instance, Component, isRoot = false) {
      let name = getComponentName(Component);
      if (!name && Component.__file) {
        const match2 = Component.__file.match(/([^/\\]+)\.\w+$/);
        if (match2) {
          name = match2[1];
        }
      }
      if (!name && instance && instance.parent) {
        const inferFromRegistry = (registry) => {
          for (const key in registry) {
            if (registry[key] === Component) {
              return key;
            }
          }
        };
        name = inferFromRegistry(
          instance.components || instance.parent.type.components
        ) || inferFromRegistry(instance.appContext.components);
      }
      return name ? classify(name) : isRoot ? `App` : `Anonymous`;
    }
    function isClassComponent(value) {
      return isFunction$2(value) && "__vccOpts" in value;
    }
    const computed = (getterOrOptions, debugOptions) => {
      const c2 = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
      return c2;
    };
    function h(type, propsOrChildren, children) {
      const l = arguments.length;
      if (l === 2) {
        if (isObject$4(propsOrChildren) && !isArray$3(propsOrChildren)) {
          if (isVNode$1(propsOrChildren)) {
            return createVNode(type, null, [propsOrChildren]);
          }
          return createVNode(type, propsOrChildren);
        } else {
          return createVNode(type, null, propsOrChildren);
        }
      } else {
        if (l > 3) {
          children = Array.prototype.slice.call(arguments, 2);
        } else if (l === 3 && isVNode$1(children)) {
          children = [children];
        }
        return createVNode(type, propsOrChildren, children);
      }
    }
    const version$1 = "3.5.12";
    /**
    * @vue/runtime-dom v3.5.12
    * (c) 2018-present Yuxi (Evan) You and Vue contributors
    * @license MIT
    **/
    let policy = void 0;
    const tt = typeof window !== "undefined" && window.trustedTypes;
    if (tt) {
      try {
        policy = /* @__PURE__ */ tt.createPolicy("vue", {
          createHTML: (val) => val
        });
      } catch (e) {
      }
    }
    const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
    const svgNS = "http://www.w3.org/2000/svg";
    const mathmlNS = "http://www.w3.org/1998/Math/MathML";
    const doc = typeof document !== "undefined" ? document : null;
    const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
    const nodeOps = {
      insert: (child, parent, anchor) => {
        parent.insertBefore(child, anchor || null);
      },
      remove: (child) => {
        const parent = child.parentNode;
        if (parent) {
          parent.removeChild(child);
        }
      },
      createElement: (tag, namespace2, is, props) => {
        const el = namespace2 === "svg" ? doc.createElementNS(svgNS, tag) : namespace2 === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
        if (tag === "select" && props && props.multiple != null) {
          el.setAttribute("multiple", props.multiple);
        }
        return el;
      },
      createText: (text) => doc.createTextNode(text),
      createComment: (text) => doc.createComment(text),
      setText: (node, text) => {
        node.nodeValue = text;
      },
      setElementText: (el, text) => {
        el.textContent = text;
      },
      parentNode: (node) => node.parentNode,
      nextSibling: (node) => node.nextSibling,
      querySelector: (selector) => doc.querySelector(selector),
      setScopeId(el, id) {
        el.setAttribute(id, "");
      },
      // __UNSAFE__
      // Reason: innerHTML.
      // Static content here can only come from compiled templates.
      // As long as the user only uses trusted templates, this is safe.
      insertStaticContent(content, parent, anchor, namespace2, start, end) {
        const before = anchor ? anchor.previousSibling : parent.lastChild;
        if (start && (start === end || start.nextSibling)) {
          while (true) {
            parent.insertBefore(start.cloneNode(true), anchor);
            if (start === end || !(start = start.nextSibling)) break;
          }
        } else {
          templateContainer.innerHTML = unsafeToTrustedHTML(
            namespace2 === "svg" ? `<svg>${content}</svg>` : namespace2 === "mathml" ? `<math>${content}</math>` : content
          );
          const template = templateContainer.content;
          if (namespace2 === "svg" || namespace2 === "mathml") {
            const wrapper = template.firstChild;
            while (wrapper.firstChild) {
              template.appendChild(wrapper.firstChild);
            }
            template.removeChild(wrapper);
          }
          parent.insertBefore(template, anchor);
        }
        return [
          // first
          before ? before.nextSibling : parent.firstChild,
          // last
          anchor ? anchor.previousSibling : parent.lastChild
        ];
      }
    };
    const TRANSITION = "transition";
    const ANIMATION = "animation";
    const vtcKey = Symbol("_vtc");
    const DOMTransitionPropsValidators = {
      name: String,
      type: String,
      css: {
        type: Boolean,
        default: true
      },
      duration: [String, Number, Object],
      enterFromClass: String,
      enterActiveClass: String,
      enterToClass: String,
      appearFromClass: String,
      appearActiveClass: String,
      appearToClass: String,
      leaveFromClass: String,
      leaveActiveClass: String,
      leaveToClass: String
    };
    const TransitionPropsValidators = /* @__PURE__ */ extend(
      {},
      BaseTransitionPropsValidators,
      DOMTransitionPropsValidators
    );
    const decorate$1 = (t) => {
      t.displayName = "Transition";
      t.props = TransitionPropsValidators;
      return t;
    };
    const Transition = /* @__PURE__ */ decorate$1(
      (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
    );
    const callHook = (hook, args = []) => {
      if (isArray$3(hook)) {
        hook.forEach((h2) => h2(...args));
      } else if (hook) {
        hook(...args);
      }
    };
    const hasExplicitCallback = (hook) => {
      return hook ? isArray$3(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
    };
    function resolveTransitionProps(rawProps) {
      const baseProps = {};
      for (const key in rawProps) {
        if (!(key in DOMTransitionPropsValidators)) {
          baseProps[key] = rawProps[key];
        }
      }
      if (rawProps.css === false) {
        return baseProps;
      }
      const {
        name = "v",
        type,
        duration: duration2,
        enterFromClass = `${name}-enter-from`,
        enterActiveClass = `${name}-enter-active`,
        enterToClass = `${name}-enter-to`,
        appearFromClass = enterFromClass,
        appearActiveClass = enterActiveClass,
        appearToClass = enterToClass,
        leaveFromClass = `${name}-leave-from`,
        leaveActiveClass = `${name}-leave-active`,
        leaveToClass = `${name}-leave-to`
      } = rawProps;
      const durations = normalizeDuration(duration2);
      const enterDuration = durations && durations[0];
      const leaveDuration = durations && durations[1];
      const {
        onBeforeEnter,
        onEnter,
        onEnterCancelled,
        onLeave,
        onLeaveCancelled,
        onBeforeAppear = onBeforeEnter,
        onAppear = onEnter,
        onAppearCancelled = onEnterCancelled
      } = baseProps;
      const finishEnter = (el, isAppear, done) => {
        removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
        removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
        done && done();
      };
      const finishLeave = (el, done) => {
        el._isLeaving = false;
        removeTransitionClass(el, leaveFromClass);
        removeTransitionClass(el, leaveToClass);
        removeTransitionClass(el, leaveActiveClass);
        done && done();
      };
      const makeEnterHook = (isAppear) => {
        return (el, done) => {
          const hook = isAppear ? onAppear : onEnter;
          const resolve2 = () => finishEnter(el, isAppear, done);
          callHook(hook, [el, resolve2]);
          nextFrame(() => {
            removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
            addTransitionClass(el, isAppear ? appearToClass : enterToClass);
            if (!hasExplicitCallback(hook)) {
              whenTransitionEnds(el, type, enterDuration, resolve2);
            }
          });
        };
      };
      return extend(baseProps, {
        onBeforeEnter(el) {
          callHook(onBeforeEnter, [el]);
          addTransitionClass(el, enterFromClass);
          addTransitionClass(el, enterActiveClass);
        },
        onBeforeAppear(el) {
          callHook(onBeforeAppear, [el]);
          addTransitionClass(el, appearFromClass);
          addTransitionClass(el, appearActiveClass);
        },
        onEnter: makeEnterHook(false),
        onAppear: makeEnterHook(true),
        onLeave(el, done) {
          el._isLeaving = true;
          const resolve2 = () => finishLeave(el, done);
          addTransitionClass(el, leaveFromClass);
          addTransitionClass(el, leaveActiveClass);
          forceReflow();
          nextFrame(() => {
            if (!el._isLeaving) {
              return;
            }
            removeTransitionClass(el, leaveFromClass);
            addTransitionClass(el, leaveToClass);
            if (!hasExplicitCallback(onLeave)) {
              whenTransitionEnds(el, type, leaveDuration, resolve2);
            }
          });
          callHook(onLeave, [el, resolve2]);
        },
        onEnterCancelled(el) {
          finishEnter(el, false);
          callHook(onEnterCancelled, [el]);
        },
        onAppearCancelled(el) {
          finishEnter(el, true);
          callHook(onAppearCancelled, [el]);
        },
        onLeaveCancelled(el) {
          finishLeave(el);
          callHook(onLeaveCancelled, [el]);
        }
      });
    }
    function normalizeDuration(duration2) {
      if (duration2 == null) {
        return null;
      } else if (isObject$4(duration2)) {
        return [NumberOf(duration2.enter), NumberOf(duration2.leave)];
      } else {
        const n = NumberOf(duration2);
        return [n, n];
      }
    }
    function NumberOf(val) {
      const res = toNumber$1(val);
      return res;
    }
    function addTransitionClass(el, cls) {
      cls.split(/\s+/).forEach((c2) => c2 && el.classList.add(c2));
      (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
    }
    function removeTransitionClass(el, cls) {
      cls.split(/\s+/).forEach((c2) => c2 && el.classList.remove(c2));
      const _vtc = el[vtcKey];
      if (_vtc) {
        _vtc.delete(cls);
        if (!_vtc.size) {
          el[vtcKey] = void 0;
        }
      }
    }
    function nextFrame(cb) {
      requestAnimationFrame(() => {
        requestAnimationFrame(cb);
      });
    }
    let endId = 0;
    function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) {
      const id = el._endId = ++endId;
      const resolveIfNotStale = () => {
        if (id === el._endId) {
          resolve2();
        }
      };
      if (explicitTimeout != null) {
        return setTimeout(resolveIfNotStale, explicitTimeout);
      }
      const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
      if (!type) {
        return resolve2();
      }
      const endEvent = type + "end";
      let ended = 0;
      const end = () => {
        el.removeEventListener(endEvent, onEnd);
        resolveIfNotStale();
      };
      const onEnd = (e) => {
        if (e.target === el && ++ended >= propCount) {
          end();
        }
      };
      setTimeout(() => {
        if (ended < propCount) {
          end();
        }
      }, timeout + 1);
      el.addEventListener(endEvent, onEnd);
    }
    function getTransitionInfo(el, expectedType) {
      const styles2 = window.getComputedStyle(el);
      const getStyleProperties = (key) => (styles2[key] || "").split(", ");
      const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
      const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
      const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
      const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
      const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
      const animationTimeout = getTimeout(animationDelays, animationDurations);
      let type = null;
      let timeout = 0;
      let propCount = 0;
      if (expectedType === TRANSITION) {
        if (transitionTimeout > 0) {
          type = TRANSITION;
          timeout = transitionTimeout;
          propCount = transitionDurations.length;
        }
      } else if (expectedType === ANIMATION) {
        if (animationTimeout > 0) {
          type = ANIMATION;
          timeout = animationTimeout;
          propCount = animationDurations.length;
        }
      } else {
        timeout = Math.max(transitionTimeout, animationTimeout);
        type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
        propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
      }
      const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
        getStyleProperties(`${TRANSITION}Property`).toString()
      );
      return {
        type,
        timeout,
        propCount,
        hasTransform
      };
    }
    function getTimeout(delays, durations) {
      while (delays.length < durations.length) {
        delays = delays.concat(delays);
      }
      return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
    }
    function toMs(s) {
      if (s === "auto") return 0;
      return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
    }
    function forceReflow() {
      return document.body.offsetHeight;
    }
    function patchClass(el, value, isSVG2) {
      const transitionClasses = el[vtcKey];
      if (transitionClasses) {
        value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
      }
      if (value == null) {
        el.removeAttribute("class");
      } else if (isSVG2) {
        el.setAttribute("class", value);
      } else {
        el.className = value;
      }
    }
    const vShowOriginalDisplay = Symbol("_vod");
    const vShowHidden = Symbol("_vsh");
    const vShow = {
      beforeMount(el, { value }, { transition }) {
        el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
        if (transition && value) {
          transition.beforeEnter(el);
        } else {
          setDisplay(el, value);
        }
      },
      mounted(el, { value }, { transition }) {
        if (transition && value) {
          transition.enter(el);
        }
      },
      updated(el, { value, oldValue }, { transition }) {
        if (!value === !oldValue) return;
        if (transition) {
          if (value) {
            transition.beforeEnter(el);
            setDisplay(el, true);
            transition.enter(el);
          } else {
            transition.leave(el, () => {
              setDisplay(el, false);
            });
          }
        } else {
          setDisplay(el, value);
        }
      },
      beforeUnmount(el, { value }) {
        setDisplay(el, value);
      }
    };
    function setDisplay(el, value) {
      el.style.display = value ? el[vShowOriginalDisplay] : "none";
      el[vShowHidden] = !value;
    }
    const CSS_VAR_TEXT = Symbol("");
    function useCssVars(getter) {
      const instance = getCurrentInstance();
      if (!instance) {
        return;
      }
      const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
        Array.from(
          document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
        ).forEach((node) => setVarsOnNode(node, vars));
      };
      const setVars = () => {
        const vars = getter(instance.proxy);
        if (instance.ce) {
          setVarsOnNode(instance.ce, vars);
        } else {
          setVarsOnVNode(instance.subTree, vars);
        }
        updateTeleports(vars);
      };
      onBeforeMount(() => {
        watchPostEffect(setVars);
      });
      onMounted(() => {
        const ob = new MutationObserver(setVars);
        ob.observe(instance.subTree.el.parentNode, { childList: true });
        onUnmounted(() => ob.disconnect());
      });
    }
    function setVarsOnVNode(vnode, vars) {
      if (vnode.shapeFlag & 128) {
        const suspense = vnode.suspense;
        vnode = suspense.activeBranch;
        if (suspense.pendingBranch && !suspense.isHydrating) {
          suspense.effects.push(() => {
            setVarsOnVNode(suspense.activeBranch, vars);
          });
        }
      }
      while (vnode.component) {
        vnode = vnode.component.subTree;
      }
      if (vnode.shapeFlag & 1 && vnode.el) {
        setVarsOnNode(vnode.el, vars);
      } else if (vnode.type === Fragment) {
        vnode.children.forEach((c2) => setVarsOnVNode(c2, vars));
      } else if (vnode.type === Static) {
        let { el, anchor } = vnode;
        while (el) {
          setVarsOnNode(el, vars);
          if (el === anchor) break;
          el = el.nextSibling;
        }
      }
    }
    function setVarsOnNode(el, vars) {
      if (el.nodeType === 1) {
        const style2 = el.style;
        let cssText = "";
        for (const key in vars) {
          style2.setProperty(`--${key}`, vars[key]);
          cssText += `--${key}: ${vars[key]};`;
        }
        style2[CSS_VAR_TEXT] = cssText;
      }
    }
    const displayRE = /(^|;)\s*display\s*:/;
    function patchStyle(el, prev, next) {
      const style2 = el.style;
      const isCssString = isString$2(next);
      let hasControlledDisplay = false;
      if (next && !isCssString) {
        if (prev) {
          if (!isString$2(prev)) {
            for (const key in prev) {
              if (next[key] == null) {
                setStyle(style2, key, "");
              }
            }
          } else {
            for (const prevStyle of prev.split(";")) {
              const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
              if (next[key] == null) {
                setStyle(style2, key, "");
              }
            }
          }
        }
        for (const key in next) {
          if (key === "display") {
            hasControlledDisplay = true;
          }
          setStyle(style2, key, next[key]);
        }
      } else {
        if (isCssString) {
          if (prev !== next) {
            const cssVarText = style2[CSS_VAR_TEXT];
            if (cssVarText) {
              next += ";" + cssVarText;
            }
            style2.cssText = next;
            hasControlledDisplay = displayRE.test(next);
          }
        } else if (prev) {
          el.removeAttribute("style");
        }
      }
      if (vShowOriginalDisplay in el) {
        el[vShowOriginalDisplay] = hasControlledDisplay ? style2.display : "";
        if (el[vShowHidden]) {
          style2.display = "none";
        }
      }
    }
    const importantRE = /\s*!important$/;
    function setStyle(style2, name, val) {
      if (isArray$3(val)) {
        val.forEach((v) => setStyle(style2, name, v));
      } else {
        if (val == null) val = "";
        if (name.startsWith("--")) {
          style2.setProperty(name, val);
        } else {
          const prefixed = autoPrefix(style2, name);
          if (importantRE.test(val)) {
            style2.setProperty(
              hyphenate(prefixed),
              val.replace(importantRE, ""),
              "important"
            );
          } else {
            style2[prefixed] = val;
          }
        }
      }
    }
    const prefixes = ["Webkit", "Moz", "ms"];
    const prefixCache = {};
    function autoPrefix(style2, rawName) {
      const cached = prefixCache[rawName];
      if (cached) {
        return cached;
      }
      let name = camelize(rawName);
      if (name !== "filter" && name in style2) {
        return prefixCache[rawName] = name;
      }
      name = capitalize$1(name);
      for (let i = 0; i < prefixes.length; i++) {
        const prefixed = prefixes[i] + name;
        if (prefixed in style2) {
          return prefixCache[rawName] = prefixed;
        }
      }
      return rawName;
    }
    const xlinkNS = "http://www.w3.org/1999/xlink";
    function patchAttr(el, key, value, isSVG2, instance, isBoolean2 = isSpecialBooleanAttr(key)) {
      if (isSVG2 && key.startsWith("xlink:")) {
        if (value == null) {
          el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
        } else {
          el.setAttributeNS(xlinkNS, key, value);
        }
      } else {
        if (value == null || isBoolean2 && !includeBooleanAttr(value)) {
          el.removeAttribute(key);
        } else {
          el.setAttribute(
            key,
            isBoolean2 ? "" : isSymbol$1(value) ? String(value) : value
          );
        }
      }
    }
    function patchDOMProp(el, key, value, parentComponent, attrName) {
      if (key === "innerHTML" || key === "textContent") {
        if (value != null) {
          el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
        }
        return;
      }
      const tag = el.tagName;
      if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
      !tag.includes("-")) {
        const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
        const newValue = value == null ? (
          // #11647: value should be set as empty string for null and undefined,
          // but <input type="checkbox"> should be set as 'on'.
          el.type === "checkbox" ? "on" : ""
        ) : String(value);
        if (oldValue !== newValue || !("_value" in el)) {
          el.value = newValue;
        }
        if (value == null) {
          el.removeAttribute(key);
        }
        el._value = value;
        return;
      }
      let needRemove = false;
      if (value === "" || value == null) {
        const type = typeof el[key];
        if (type === "boolean") {
          value = includeBooleanAttr(value);
        } else if (value == null && type === "string") {
          value = "";
          needRemove = true;
        } else if (type === "number") {
          value = 0;
          needRemove = true;
        }
      }
      try {
        el[key] = value;
      } catch (e) {
      }
      needRemove && el.removeAttribute(attrName || key);
    }
    function addEventListener(el, event, handler, options) {
      el.addEventListener(event, handler, options);
    }
    function removeEventListener(el, event, handler, options) {
      el.removeEventListener(event, handler, options);
    }
    const veiKey = Symbol("_vei");
    function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
      const invokers = el[veiKey] || (el[veiKey] = {});
      const existingInvoker = invokers[rawName];
      if (nextValue && existingInvoker) {
        existingInvoker.value = nextValue;
      } else {
        const [name, options] = parseName(rawName);
        if (nextValue) {
          const invoker = invokers[rawName] = createInvoker(
            nextValue,
            instance
          );
          addEventListener(el, name, invoker, options);
        } else if (existingInvoker) {
          removeEventListener(el, name, existingInvoker, options);
          invokers[rawName] = void 0;
        }
      }
    }
    const optionsModifierRE = /(?:Once|Passive|Capture)$/;
    function parseName(name) {
      let options;
      if (optionsModifierRE.test(name)) {
        options = {};
        let m;
        while (m = name.match(optionsModifierRE)) {
          name = name.slice(0, name.length - m[0].length);
          options[m[0].toLowerCase()] = true;
        }
      }
      const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
      return [event, options];
    }
    let cachedNow = 0;
    const p = /* @__PURE__ */ Promise.resolve();
    const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
    function createInvoker(initialValue, instance) {
      const invoker = (e) => {
        if (!e._vts) {
          e._vts = Date.now();
        } else if (e._vts <= invoker.attached) {
          return;
        }
        callWithAsyncErrorHandling(
          patchStopImmediatePropagation(e, invoker.value),
          instance,
          5,
          [e]
        );
      };
      invoker.value = initialValue;
      invoker.attached = getNow();
      return invoker;
    }
    function patchStopImmediatePropagation(e, value) {
      if (isArray$3(value)) {
        const originalStop = e.stopImmediatePropagation;
        e.stopImmediatePropagation = () => {
          originalStop.call(e);
          e._stopped = true;
        };
        return value.map(
          (fn) => (e2) => !e2._stopped && fn && fn(e2)
        );
      } else {
        return value;
      }
    }
    const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
    key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
    const patchProp = (el, key, prevValue, nextValue, namespace2, parentComponent) => {
      const isSVG2 = namespace2 === "svg";
      if (key === "class") {
        patchClass(el, nextValue, isSVG2);
      } else if (key === "style") {
        patchStyle(el, prevValue, nextValue);
      } else if (isOn(key)) {
        if (!isModelListener(key)) {
          patchEvent(el, key, prevValue, nextValue, parentComponent);
        }
      } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG2)) {
        patchDOMProp(el, key, nextValue);
        if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
          patchAttr(el, key, nextValue, isSVG2, parentComponent, key !== "value");
        }
      } else if (
        // #11081 force set props for possible async custom element
        el._isVueCE && (/[A-Z]/.test(key) || !isString$2(nextValue))
      ) {
        patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
      } else {
        if (key === "true-value") {
          el._trueValue = nextValue;
        } else if (key === "false-value") {
          el._falseValue = nextValue;
        }
        patchAttr(el, key, nextValue, isSVG2);
      }
    };
    function shouldSetAsProp(el, key, value, isSVG2) {
      if (isSVG2) {
        if (key === "innerHTML" || key === "textContent") {
          return true;
        }
        if (key in el && isNativeOn(key) && isFunction$2(value)) {
          return true;
        }
        return false;
      }
      if (key === "spellcheck" || key === "draggable" || key === "translate") {
        return false;
      }
      if (key === "form") {
        return false;
      }
      if (key === "list" && el.tagName === "INPUT") {
        return false;
      }
      if (key === "type" && el.tagName === "TEXTAREA") {
        return false;
      }
      if (key === "width" || key === "height") {
        const tag = el.tagName;
        if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
          return false;
        }
      }
      if (isNativeOn(key) && isString$2(value)) {
        return false;
      }
      return key in el;
    }
    const positionMap = /* @__PURE__ */ new WeakMap();
    const newPositionMap = /* @__PURE__ */ new WeakMap();
    const moveCbKey = Symbol("_moveCb");
    const enterCbKey = Symbol("_enterCb");
    const decorate = (t) => {
      delete t.props.mode;
      return t;
    };
    const TransitionGroupImpl = /* @__PURE__ */ decorate({
      name: "TransitionGroup",
      props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
        tag: String,
        moveClass: String
      }),
      setup(props, { slots }) {
        const instance = getCurrentInstance();
        const state = useTransitionState();
        let prevChildren;
        let children;
        onUpdated(() => {
          if (!prevChildren.length) {
            return;
          }
          const moveClass = props.moveClass || `${props.name || "v"}-move`;
          if (!hasCSSTransform(
            prevChildren[0].el,
            instance.vnode.el,
            moveClass
          )) {
            return;
          }
          prevChildren.forEach(callPendingCbs);
          prevChildren.forEach(recordPosition);
          const movedChildren = prevChildren.filter(applyTranslation);
          forceReflow();
          movedChildren.forEach((c2) => {
            const el = c2.el;
            const style2 = el.style;
            addTransitionClass(el, moveClass);
            style2.transform = style2.webkitTransform = style2.transitionDuration = "";
            const cb = el[moveCbKey] = (e) => {
              if (e && e.target !== el) {
                return;
              }
              if (!e || /transform$/.test(e.propertyName)) {
                el.removeEventListener("transitionend", cb);
                el[moveCbKey] = null;
                removeTransitionClass(el, moveClass);
              }
            };
            el.addEventListener("transitionend", cb);
          });
        });
        return () => {
          const rawProps = toRaw(props);
          const cssTransitionProps = resolveTransitionProps(rawProps);
          let tag = rawProps.tag || Fragment;
          prevChildren = [];
          if (children) {
            for (let i = 0; i < children.length; i++) {
              const child = children[i];
              if (child.el && child.el instanceof Element) {
                prevChildren.push(child);
                setTransitionHooks(
                  child,
                  resolveTransitionHooks(
                    child,
                    cssTransitionProps,
                    state,
                    instance
                  )
                );
                positionMap.set(
                  child,
                  child.el.getBoundingClientRect()
                );
              }
            }
          }
          children = slots.default ? getTransitionRawChildren(slots.default()) : [];
          for (let i = 0; i < children.length; i++) {
            const child = children[i];
            if (child.key != null) {
              setTransitionHooks(
                child,
                resolveTransitionHooks(child, cssTransitionProps, state, instance)
              );
            }
          }
          return createVNode(tag, null, children);
        };
      }
    });
    const TransitionGroup = TransitionGroupImpl;
    function callPendingCbs(c2) {
      const el = c2.el;
      if (el[moveCbKey]) {
        el[moveCbKey]();
      }
      if (el[enterCbKey]) {
        el[enterCbKey]();
      }
    }
    function recordPosition(c2) {
      newPositionMap.set(c2, c2.el.getBoundingClientRect());
    }
    function applyTranslation(c2) {
      const oldPos = positionMap.get(c2);
      const newPos = newPositionMap.get(c2);
      const dx = oldPos.left - newPos.left;
      const dy = oldPos.top - newPos.top;
      if (dx || dy) {
        const s = c2.el.style;
        s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
        s.transitionDuration = "0s";
        return c2;
      }
    }
    function hasCSSTransform(el, root2, moveClass) {
      const clone = el.cloneNode();
      const _vtc = el[vtcKey];
      if (_vtc) {
        _vtc.forEach((cls) => {
          cls.split(/\s+/).forEach((c2) => c2 && clone.classList.remove(c2));
        });
      }
      moveClass.split(/\s+/).forEach((c2) => c2 && clone.classList.add(c2));
      clone.style.display = "none";
      const container = root2.nodeType === 1 ? root2 : root2.parentNode;
      container.appendChild(clone);
      const { hasTransform } = getTransitionInfo(clone);
      container.removeChild(clone);
      return hasTransform;
    }
    const systemModifiers = ["ctrl", "shift", "alt", "meta"];
    const modifierGuards = {
      stop: (e) => e.stopPropagation(),
      prevent: (e) => e.preventDefault(),
      self: (e) => e.target !== e.currentTarget,
      ctrl: (e) => !e.ctrlKey,
      shift: (e) => !e.shiftKey,
      alt: (e) => !e.altKey,
      meta: (e) => !e.metaKey,
      left: (e) => "button" in e && e.button !== 0,
      middle: (e) => "button" in e && e.button !== 1,
      right: (e) => "button" in e && e.button !== 2,
      exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
    };
    const withModifiers = (fn, modifiers) => {
      const cache2 = fn._withMods || (fn._withMods = {});
      const cacheKey = modifiers.join(".");
      return cache2[cacheKey] || (cache2[cacheKey] = (event, ...args) => {
        for (let i = 0; i < modifiers.length; i++) {
          const guard = modifierGuards[modifiers[i]];
          if (guard && guard(event, modifiers)) return;
        }
        return fn(event, ...args);
      });
    };
    const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
    let renderer;
    function ensureRenderer() {
      return renderer || (renderer = createRenderer(rendererOptions));
    }
    const createApp = (...args) => {
      const app = ensureRenderer().createApp(...args);
      const { mount: mount2 } = app;
      app.mount = (containerOrSelector) => {
        const container = normalizeContainer(containerOrSelector);
        if (!container) return;
        const component = app._component;
        if (!isFunction$2(component) && !component.render && !component.template) {
          component.template = container.innerHTML;
        }
        if (container.nodeType === 1) {
          container.textContent = "";
        }
        const proxy = mount2(container, false, resolveRootNamespace(container));
        if (container instanceof Element) {
          container.removeAttribute("v-cloak");
          container.setAttribute("data-v-app", "");
        }
        return proxy;
      };
      return app;
    };
    function resolveRootNamespace(container) {
      if (container instanceof SVGElement) {
        return "svg";
      }
      if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
        return "mathml";
      }
    }
    function normalizeContainer(container) {
      if (isString$2(container)) {
        const res = document.querySelector(container);
        return res;
      }
      return container;
    }
    /*!
      * vue-router v4.4.5
      * (c) 2024 Eduardo San Martin Morote
      * @license MIT
      */
    const isBrowser$3 = typeof document !== "undefined";
    function isRouteComponent(component) {
      return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
    }
    function isESModule(obj) {
      return obj.__esModule || obj[Symbol.toStringTag] === "Module" || // support CF with dynamic imports that do not
      // add the Module string tag
      obj.default && isRouteComponent(obj.default);
    }
    const assign$3 = Object.assign;
    function applyToParams(fn, params) {
      const newParams = {};
      for (const key in params) {
        const value = params[key];
        newParams[key] = isArray$2(value) ? value.map(fn) : fn(value);
      }
      return newParams;
    }
    const noop$1 = () => {
    };
    const isArray$2 = Array.isArray;
    const HASH_RE = /#/g;
    const AMPERSAND_RE = /&/g;
    const SLASH_RE = /\//g;
    const EQUAL_RE = /=/g;
    const IM_RE = /\?/g;
    const PLUS_RE = /\+/g;
    const ENC_BRACKET_OPEN_RE = /%5B/g;
    const ENC_BRACKET_CLOSE_RE = /%5D/g;
    const ENC_CARET_RE = /%5E/g;
    const ENC_BACKTICK_RE = /%60/g;
    const ENC_CURLY_OPEN_RE = /%7B/g;
    const ENC_PIPE_RE = /%7C/g;
    const ENC_CURLY_CLOSE_RE = /%7D/g;
    const ENC_SPACE_RE = /%20/g;
    function commonEncode(text) {
      return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
    }
    function encodeHash(text) {
      return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
    }
    function encodeQueryValue(text) {
      return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
    }
    function encodeQueryKey(text) {
      return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
    }
    function encodePath(text) {
      return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
    }
    function encodeParam(text) {
      return text == null ? "" : encodePath(text).replace(SLASH_RE, "%2F");
    }
    function decode(text) {
      try {
        return decodeURIComponent("" + text);
      } catch (err) {
      }
      return "" + text;
    }
    const TRAILING_SLASH_RE = /\/$/;
    const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
    function parseURL(parseQuery2, location2, currentLocation = "/") {
      let path, query = {}, searchString = "", hash = "";
      const hashPos = location2.indexOf("#");
      let searchPos = location2.indexOf("?");
      if (hashPos < searchPos && hashPos >= 0) {
        searchPos = -1;
      }
      if (searchPos > -1) {
        path = location2.slice(0, searchPos);
        searchString = location2.slice(searchPos + 1, hashPos > -1 ? hashPos : location2.length);
        query = parseQuery2(searchString);
      }
      if (hashPos > -1) {
        path = path || location2.slice(0, hashPos);
        hash = location2.slice(hashPos, location2.length);
      }
      path = resolveRelativePath(path != null ? path : location2, currentLocation);
      return {
        fullPath: path + (searchString && "?") + searchString + hash,
        path,
        query,
        hash: decode(hash)
      };
    }
    function stringifyURL(stringifyQuery2, location2) {
      const query = location2.query ? stringifyQuery2(location2.query) : "";
      return location2.path + (query && "?") + query + (location2.hash || "");
    }
    function stripBase(pathname, base2) {
      if (!base2 || !pathname.toLowerCase().startsWith(base2.toLowerCase()))
        return pathname;
      return pathname.slice(base2.length) || "/";
    }
    function isSameRouteLocation(stringifyQuery2, a, b) {
      const aLastIndex = a.matched.length - 1;
      const bLastIndex = b.matched.length - 1;
      return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) && isSameRouteLocationParams(a.params, b.params) && stringifyQuery2(a.query) === stringifyQuery2(b.query) && a.hash === b.hash;
    }
    function isSameRouteRecord(a, b) {
      return (a.aliasOf || a) === (b.aliasOf || b);
    }
    function isSameRouteLocationParams(a, b) {
      if (Object.keys(a).length !== Object.keys(b).length)
        return false;
      for (const key in a) {
        if (!isSameRouteLocationParamsValue(a[key], b[key]))
          return false;
      }
      return true;
    }
    function isSameRouteLocationParamsValue(a, b) {
      return isArray$2(a) ? isEquivalentArray(a, b) : isArray$2(b) ? isEquivalentArray(b, a) : a === b;
    }
    function isEquivalentArray(a, b) {
      return isArray$2(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
    }
    function resolveRelativePath(to, from) {
      if (to.startsWith("/"))
        return to;
      if (!to)
        return from;
      const fromSegments = from.split("/");
      const toSegments = to.split("/");
      const lastToSegment = toSegments[toSegments.length - 1];
      if (lastToSegment === ".." || lastToSegment === ".") {
        toSegments.push("");
      }
      let position = fromSegments.length - 1;
      let toPosition;
      let segment;
      for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
        segment = toSegments[toPosition];
        if (segment === ".")
          continue;
        if (segment === "..") {
          if (position > 1)
            position--;
        } else
          break;
      }
      return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
    }
    const START_LOCATION_NORMALIZED = {
      path: "/",
      // TODO: could we use a symbol in the future?
      name: void 0,
      params: {},
      query: {},
      hash: "",
      fullPath: "/",
      matched: [],
      meta: {},
      redirectedFrom: void 0
    };
    var NavigationType;
    (function(NavigationType2) {
      NavigationType2["pop"] = "pop";
      NavigationType2["push"] = "push";
    })(NavigationType || (NavigationType = {}));
    var NavigationDirection;
    (function(NavigationDirection2) {
      NavigationDirection2["back"] = "back";
      NavigationDirection2["forward"] = "forward";
      NavigationDirection2["unknown"] = "";
    })(NavigationDirection || (NavigationDirection = {}));
    function normalizeBase(base2) {
      if (!base2) {
        if (isBrowser$3) {
          const baseEl = document.querySelector("base");
          base2 = baseEl && baseEl.getAttribute("href") || "/";
          base2 = base2.replace(/^\w+:\/\/[^\/]+/, "");
        } else {
          base2 = "/";
        }
      }
      if (base2[0] !== "/" && base2[0] !== "#")
        base2 = "/" + base2;
      return removeTrailingSlash(base2);
    }
    const BEFORE_HASH_RE = /^[^#]+#/;
    function createHref(base2, location2) {
      return base2.replace(BEFORE_HASH_RE, "#") + location2;
    }
    function getElementPosition(el, offset) {
      const docRect = document.documentElement.getBoundingClientRect();
      const elRect = el.getBoundingClientRect();
      return {
        behavior: offset.behavior,
        left: elRect.left - docRect.left - (offset.left || 0),
        top: elRect.top - docRect.top - (offset.top || 0)
      };
    }
    const computeScrollPosition = () => ({
      left: window.scrollX,
      top: window.scrollY
    });
    function scrollToPosition(position) {
      let scrollToOptions;
      if ("el" in position) {
        const positionEl = position.el;
        const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
        const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
        if (!el) {
          return;
        }
        scrollToOptions = getElementPosition(el, position);
      } else {
        scrollToOptions = position;
      }
      if ("scrollBehavior" in document.documentElement.style)
        window.scrollTo(scrollToOptions);
      else {
        window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
      }
    }
    function getScrollKey(path, delta) {
      const position = history.state ? history.state.position - delta : -1;
      return position + path;
    }
    const scrollPositions = /* @__PURE__ */ new Map();
    function saveScrollPosition(key, scrollPosition) {
      scrollPositions.set(key, scrollPosition);
    }
    function getSavedScrollPosition(key) {
      const scroll = scrollPositions.get(key);
      scrollPositions.delete(key);
      return scroll;
    }
    let createBaseLocation = () => location.protocol + "//" + location.host;
    function createCurrentLocation(base2, location2) {
      const { pathname, search, hash } = location2;
      const hashPos = base2.indexOf("#");
      if (hashPos > -1) {
        let slicePos = hash.includes(base2.slice(hashPos)) ? base2.slice(hashPos).length : 1;
        let pathFromHash = hash.slice(slicePos);
        if (pathFromHash[0] !== "/")
          pathFromHash = "/" + pathFromHash;
        return stripBase(pathFromHash, "");
      }
      const path = stripBase(pathname, base2);
      return path + search + hash;
    }
    function useHistoryListeners(base2, historyState, currentLocation, replace) {
      let listeners = [];
      let teardowns = [];
      let pauseState = null;
      const popStateHandler = ({ state }) => {
        const to = createCurrentLocation(base2, location);
        const from = currentLocation.value;
        const fromState = historyState.value;
        let delta = 0;
        if (state) {
          currentLocation.value = to;
          historyState.value = state;
          if (pauseState && pauseState === from) {
            pauseState = null;
            return;
          }
          delta = fromState ? state.position - fromState.position : 0;
        } else {
          replace(to);
        }
        listeners.forEach((listener) => {
          listener(currentLocation.value, from, {
            delta,
            type: NavigationType.pop,
            direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
          });
        });
      };
      function pauseListeners() {
        pauseState = currentLocation.value;
      }
      function listen(callback) {
        listeners.push(callback);
        const teardown = () => {
          const index = listeners.indexOf(callback);
          if (index > -1)
            listeners.splice(index, 1);
        };
        teardowns.push(teardown);
        return teardown;
      }
      function beforeUnloadListener() {
        const { history: history2 } = window;
        if (!history2.state)
          return;
        history2.replaceState(assign$3({}, history2.state, { scroll: computeScrollPosition() }), "");
      }
      function destroy() {
        for (const teardown of teardowns)
          teardown();
        teardowns = [];
        window.removeEventListener("popstate", popStateHandler);
        window.removeEventListener("beforeunload", beforeUnloadListener);
      }
      window.addEventListener("popstate", popStateHandler);
      window.addEventListener("beforeunload", beforeUnloadListener, {
        passive: true
      });
      return {
        pauseListeners,
        listen,
        destroy
      };
    }
    function buildState(back, current, forward, replaced = false, computeScroll = false) {
      return {
        back,
        current,
        forward,
        replaced,
        position: window.history.length,
        scroll: computeScroll ? computeScrollPosition() : null
      };
    }
    function useHistoryStateNavigation(base2) {
      const { history: history2, location: location2 } = window;
      const currentLocation = {
        value: createCurrentLocation(base2, location2)
      };
      const historyState = { value: history2.state };
      if (!historyState.value) {
        changeLocation(currentLocation.value, {
          back: null,
          current: currentLocation.value,
          forward: null,
          // the length is off by one, we need to decrease it
          position: history2.length - 1,
          replaced: true,
          // don't add a scroll as the user may have an anchor, and we want
          // scrollBehavior to be triggered without a saved position
          scroll: null
        }, true);
      }
      function changeLocation(to, state, replace2) {
        const hashIndex = base2.indexOf("#");
        const url = hashIndex > -1 ? (location2.host && document.querySelector("base") ? base2 : base2.slice(hashIndex)) + to : createBaseLocation() + base2 + to;
        try {
          history2[replace2 ? "replaceState" : "pushState"](state, "", url);
          historyState.value = state;
        } catch (err) {
          {
            console.error(err);
          }
          location2[replace2 ? "replace" : "assign"](url);
        }
      }
      function replace(to, data) {
        const state = assign$3({}, history2.state, buildState(
          historyState.value.back,
          // keep back and forward entries but override current position
          to,
          historyState.value.forward,
          true
        ), data, { position: historyState.value.position });
        changeLocation(to, state, true);
        currentLocation.value = to;
      }
      function push(to, data) {
        const currentState = assign$3(
          {},
          // use current history state to gracefully handle a wrong call to
          // history.replaceState
          // https://github.com/vuejs/router/issues/366
          historyState.value,
          history2.state,
          {
            forward: to,
            scroll: computeScrollPosition()
          }
        );
        changeLocation(currentState.current, currentState, true);
        const state = assign$3({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data);
        changeLocation(to, state, false);
        currentLocation.value = to;
      }
      return {
        location: currentLocation,
        state: historyState,
        push,
        replace
      };
    }
    function createWebHistory(base2) {
      base2 = normalizeBase(base2);
      const historyNavigation = useHistoryStateNavigation(base2);
      const historyListeners = useHistoryListeners(base2, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
      function go(delta, triggerListeners = true) {
        if (!triggerListeners)
          historyListeners.pauseListeners();
        history.go(delta);
      }
      const routerHistory = assign$3({
        // it's overridden right after
        location: "",
        base: base2,
        go,
        createHref: createHref.bind(null, base2)
      }, historyNavigation, historyListeners);
      Object.defineProperty(routerHistory, "location", {
        enumerable: true,
        get: () => historyNavigation.location.value
      });
      Object.defineProperty(routerHistory, "state", {
        enumerable: true,
        get: () => historyNavigation.state.value
      });
      return routerHistory;
    }
    function createWebHashHistory(base2) {
      base2 = location.host ? base2 || location.pathname + location.search : "";
      if (!base2.includes("#"))
        base2 += "#";
      return createWebHistory(base2);
    }
    function isRouteLocation(route) {
      return typeof route === "string" || route && typeof route === "object";
    }
    function isRouteName(name) {
      return typeof name === "string" || typeof name === "symbol";
    }
    const NavigationFailureSymbol = Symbol("");
    var NavigationFailureType;
    (function(NavigationFailureType2) {
      NavigationFailureType2[NavigationFailureType2["aborted"] = 4] = "aborted";
      NavigationFailureType2[NavigationFailureType2["cancelled"] = 8] = "cancelled";
      NavigationFailureType2[NavigationFailureType2["duplicated"] = 16] = "duplicated";
    })(NavigationFailureType || (NavigationFailureType = {}));
    function createRouterError(type, params) {
      {
        return assign$3(new Error(), {
          type,
          [NavigationFailureSymbol]: true
        }, params);
      }
    }
    function isNavigationFailure(error2, type) {
      return error2 instanceof Error && NavigationFailureSymbol in error2 && (type == null || !!(error2.type & type));
    }
    const BASE_PARAM_PATTERN = "[^/]+?";
    const BASE_PATH_PARSER_OPTIONS = {
      sensitive: false,
      strict: false,
      start: true,
      end: true
    };
    const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
    function tokensToParser(segments, extraOptions) {
      const options = assign$3({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
      const score = [];
      let pattern = options.start ? "^" : "";
      const keys2 = [];
      for (const segment of segments) {
        const segmentScores = segment.length ? [] : [
          90
          /* PathScore.Root */
        ];
        if (options.strict && !segment.length)
          pattern += "/";
        for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
          const token = segment[tokenIndex];
          let subSegmentScore = 40 + (options.sensitive ? 0.25 : 0);
          if (token.type === 0) {
            if (!tokenIndex)
              pattern += "/";
            pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
            subSegmentScore += 40;
          } else if (token.type === 1) {
            const { value, repeatable, optional, regexp } = token;
            keys2.push({
              name: value,
              repeatable,
              optional
            });
            const re2 = regexp ? regexp : BASE_PARAM_PATTERN;
            if (re2 !== BASE_PARAM_PATTERN) {
              subSegmentScore += 10;
              try {
                new RegExp(`(${re2})`);
              } catch (err) {
                throw new Error(`Invalid custom RegExp for param "${value}" (${re2}): ` + err.message);
              }
            }
            let subPattern = repeatable ? `((?:${re2})(?:/(?:${re2}))*)` : `(${re2})`;
            if (!tokenIndex)
              subPattern = // avoid an optional / if there are more segments e.g. /:p?-static
              // or /:p?-:p2
              optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
            if (optional)
              subPattern += "?";
            pattern += subPattern;
            subSegmentScore += 20;
            if (optional)
              subSegmentScore += -8;
            if (repeatable)
              subSegmentScore += -20;
            if (re2 === ".*")
              subSegmentScore += -50;
          }
          segmentScores.push(subSegmentScore);
        }
        score.push(segmentScores);
      }
      if (options.strict && options.end) {
        const i = score.length - 1;
        score[i][score[i].length - 1] += 0.7000000000000001;
      }
      if (!options.strict)
        pattern += "/?";
      if (options.end)
        pattern += "$";
      else if (options.strict)
        pattern += "(?:/|$)";
      const re = new RegExp(pattern, options.sensitive ? "" : "i");
      function parse2(path) {
        const match2 = path.match(re);
        const params = {};
        if (!match2)
          return null;
        for (let i = 1; i < match2.length; i++) {
          const value = match2[i] || "";
          const key = keys2[i - 1];
          params[key.name] = value && key.repeatable ? value.split("/") : value;
        }
        return params;
      }
      function stringify(params) {
        let path = "";
        let avoidDuplicatedSlash = false;
        for (const segment of segments) {
          if (!avoidDuplicatedSlash || !path.endsWith("/"))
            path += "/";
          avoidDuplicatedSlash = false;
          for (const token of segment) {
            if (token.type === 0) {
              path += token.value;
            } else if (token.type === 1) {
              const { value, repeatable, optional } = token;
              const param = value in params ? params[value] : "";
              if (isArray$2(param) && !repeatable) {
                throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
              }
              const text = isArray$2(param) ? param.join("/") : param;
              if (!text) {
                if (optional) {
                  if (segment.length < 2) {
                    if (path.endsWith("/"))
                      path = path.slice(0, -1);
                    else
                      avoidDuplicatedSlash = true;
                  }
                } else
                  throw new Error(`Missing required param "${value}"`);
              }
              path += text;
            }
          }
        }
        return path || "/";
      }
      return {
        re,
        score,
        keys: keys2,
        parse: parse2,
        stringify
      };
    }
    function compareScoreArray(a, b) {
      let i = 0;
      while (i < a.length && i < b.length) {
        const diff = b[i] - a[i];
        if (diff)
          return diff;
        i++;
      }
      if (a.length < b.length) {
        return a.length === 1 && a[0] === 40 + 40 ? -1 : 1;
      } else if (a.length > b.length) {
        return b.length === 1 && b[0] === 40 + 40 ? 1 : -1;
      }
      return 0;
    }
    function comparePathParserScore(a, b) {
      let i = 0;
      const aScore = a.score;
      const bScore = b.score;
      while (i < aScore.length && i < bScore.length) {
        const comp = compareScoreArray(aScore[i], bScore[i]);
        if (comp)
          return comp;
        i++;
      }
      if (Math.abs(bScore.length - aScore.length) === 1) {
        if (isLastScoreNegative(aScore))
          return 1;
        if (isLastScoreNegative(bScore))
          return -1;
      }
      return bScore.length - aScore.length;
    }
    function isLastScoreNegative(score) {
      const last = score[score.length - 1];
      return score.length > 0 && last[last.length - 1] < 0;
    }
    const ROOT_TOKEN = {
      type: 0,
      value: ""
    };
    const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
    function tokenizePath(path) {
      if (!path)
        return [[]];
      if (path === "/")
        return [[ROOT_TOKEN]];
      if (!path.startsWith("/")) {
        throw new Error(`Invalid path "${path}"`);
      }
      function crash(message) {
        throw new Error(`ERR (${state})/"${buffer}": ${message}`);
      }
      let state = 0;
      let previousState = state;
      const tokens = [];
      let segment;
      function finalizeSegment() {
        if (segment)
          tokens.push(segment);
        segment = [];
      }
      let i = 0;
      let char;
      let buffer = "";
      let customRe = "";
      function consumeBuffer() {
        if (!buffer)
          return;
        if (state === 0) {
          segment.push({
            type: 0,
            value: buffer
          });
        } else if (state === 1 || state === 2 || state === 3) {
          if (segment.length > 1 && (char === "*" || char === "+"))
            crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
          segment.push({
            type: 1,
            value: buffer,
            regexp: customRe,
            repeatable: char === "*" || char === "+",
            optional: char === "*" || char === "?"
          });
        } else {
          crash("Invalid state to consume buffer");
        }
        buffer = "";
      }
      function addCharToBuffer() {
        buffer += char;
      }
      while (i < path.length) {
        char = path[i++];
        if (char === "\\" && state !== 2) {
          previousState = state;
          state = 4;
          continue;
        }
        switch (state) {
          case 0:
            if (char === "/") {
              if (buffer) {
                consumeBuffer();
              }
              finalizeSegment();
            } else if (char === ":") {
              consumeBuffer();
              state = 1;
            } else {
              addCharToBuffer();
            }
            break;
          case 4:
            addCharToBuffer();
            state = previousState;
            break;
          case 1:
            if (char === "(") {
              state = 2;
            } else if (VALID_PARAM_RE.test(char)) {
              addCharToBuffer();
            } else {
              consumeBuffer();
              state = 0;
              if (char !== "*" && char !== "?" && char !== "+")
                i--;
            }
            break;
          case 2:
            if (char === ")") {
              if (customRe[customRe.length - 1] == "\\")
                customRe = customRe.slice(0, -1) + char;
              else
                state = 3;
            } else {
              customRe += char;
            }
            break;
          case 3:
            consumeBuffer();
            state = 0;
            if (char !== "*" && char !== "?" && char !== "+")
              i--;
            customRe = "";
            break;
          default:
            crash("Unknown state");
            break;
        }
      }
      if (state === 2)
        crash(`Unfinished custom RegExp for param "${buffer}"`);
      consumeBuffer();
      finalizeSegment();
      return tokens;
    }
    function createRouteRecordMatcher(record, parent, options) {
      const parser = tokensToParser(tokenizePath(record.path), options);
      const matcher = assign$3(parser, {
        record,
        parent,
        // these needs to be populated by the parent
        children: [],
        alias: []
      });
      if (parent) {
        if (!matcher.record.aliasOf === !parent.record.aliasOf)
          parent.children.push(matcher);
      }
      return matcher;
    }
    function createRouterMatcher(routes, globalOptions) {
      const matchers = [];
      const matcherMap = /* @__PURE__ */ new Map();
      globalOptions = mergeOptions({ strict: false, end: true, sensitive: false }, globalOptions);
      function getRecordMatcher(name) {
        return matcherMap.get(name);
      }
      function addRoute(record, parent, originalRecord) {
        const isRootAdd = !originalRecord;
        const mainNormalizedRecord = normalizeRouteRecord(record);
        mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
        const options = mergeOptions(globalOptions, record);
        const normalizedRecords = [mainNormalizedRecord];
        if ("alias" in record) {
          const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
          for (const alias of aliases) {
            normalizedRecords.push(
              // we need to normalize again to ensure the `mods` property
              // being non enumerable
              normalizeRouteRecord(assign$3({}, mainNormalizedRecord, {
                // this allows us to hold a copy of the `components` option
                // so that async components cache is hold on the original record
                components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
                path: alias,
                // we might be the child of an alias
                aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
                // the aliases are always of the same kind as the original since they
                // are defined on the same record
              }))
            );
          }
        }
        let matcher;
        let originalMatcher;
        for (const normalizedRecord of normalizedRecords) {
          const { path } = normalizedRecord;
          if (parent && path[0] !== "/") {
            const parentPath = parent.record.path;
            const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
            normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
          }
          matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
          if (originalRecord) {
            originalRecord.alias.push(matcher);
          } else {
            originalMatcher = originalMatcher || matcher;
            if (originalMatcher !== matcher)
              originalMatcher.alias.push(matcher);
            if (isRootAdd && record.name && !isAliasRecord(matcher))
              removeRoute(record.name);
          }
          if (isMatchable(matcher)) {
            insertMatcher(matcher);
          }
          if (mainNormalizedRecord.children) {
            const children = mainNormalizedRecord.children;
            for (let i = 0; i < children.length; i++) {
              addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
            }
          }
          originalRecord = originalRecord || matcher;
        }
        return originalMatcher ? () => {
          removeRoute(originalMatcher);
        } : noop$1;
      }
      function removeRoute(matcherRef) {
        if (isRouteName(matcherRef)) {
          const matcher = matcherMap.get(matcherRef);
          if (matcher) {
            matcherMap.delete(matcherRef);
            matchers.splice(matchers.indexOf(matcher), 1);
            matcher.children.forEach(removeRoute);
            matcher.alias.forEach(removeRoute);
          }
        } else {
          const index = matchers.indexOf(matcherRef);
          if (index > -1) {
            matchers.splice(index, 1);
            if (matcherRef.record.name)
              matcherMap.delete(matcherRef.record.name);
            matcherRef.children.forEach(removeRoute);
            matcherRef.alias.forEach(removeRoute);
          }
        }
      }
      function getRoutes() {
        return matchers;
      }
      function insertMatcher(matcher) {
        const index = findInsertionIndex(matcher, matchers);
        matchers.splice(index, 0, matcher);
        if (matcher.record.name && !isAliasRecord(matcher))
          matcherMap.set(matcher.record.name, matcher);
      }
      function resolve2(location2, currentLocation) {
        let matcher;
        let params = {};
        let path;
        let name;
        if ("name" in location2 && location2.name) {
          matcher = matcherMap.get(location2.name);
          if (!matcher)
            throw createRouterError(1, {
              location: location2
            });
          name = matcher.record.name;
          params = assign$3(
            // paramsFromLocation is a new object
            paramsFromLocation(
              currentLocation.params,
              // only keep params that exist in the resolved location
              // only keep optional params coming from a parent record
              matcher.keys.filter((k) => !k.optional).concat(matcher.parent ? matcher.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)
            ),
            // discard any existing params in the current location that do not exist here
            // #1497 this ensures better active/exact matching
            location2.params && paramsFromLocation(location2.params, matcher.keys.map((k) => k.name))
          );
          path = matcher.stringify(params);
        } else if (location2.path != null) {
          path = location2.path;
          matcher = matchers.find((m) => m.re.test(path));
          if (matcher) {
            params = matcher.parse(path);
            name = matcher.record.name;
          }
        } else {
          matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
          if (!matcher)
            throw createRouterError(1, {
              location: location2,
              currentLocation
            });
          name = matcher.record.name;
          params = assign$3({}, currentLocation.params, location2.params);
          path = matcher.stringify(params);
        }
        const matched = [];
        let parentMatcher = matcher;
        while (parentMatcher) {
          matched.unshift(parentMatcher.record);
          parentMatcher = parentMatcher.parent;
        }
        return {
          name,
          path,
          params,
          matched,
          meta: mergeMetaFields(matched)
        };
      }
      routes.forEach((route) => addRoute(route));
      function clearRoutes() {
        matchers.length = 0;
        matcherMap.clear();
      }
      return {
        addRoute,
        resolve: resolve2,
        removeRoute,
        clearRoutes,
        getRoutes,
        getRecordMatcher
      };
    }
    function paramsFromLocation(params, keys2) {
      const newParams = {};
      for (const key of keys2) {
        if (key in params)
          newParams[key] = params[key];
      }
      return newParams;
    }
    function normalizeRouteRecord(record) {
      const normalized = {
        path: record.path,
        redirect: record.redirect,
        name: record.name,
        meta: record.meta || {},
        aliasOf: record.aliasOf,
        beforeEnter: record.beforeEnter,
        props: normalizeRecordProps(record),
        children: record.children || [],
        instances: {},
        leaveGuards: /* @__PURE__ */ new Set(),
        updateGuards: /* @__PURE__ */ new Set(),
        enterCallbacks: {},
        // must be declared afterwards
        // mods: {},
        components: "components" in record ? record.components || null : record.component && { default: record.component }
      };
      Object.defineProperty(normalized, "mods", {
        value: {}
      });
      return normalized;
    }
    function normalizeRecordProps(record) {
      const propsObject = {};
      const props = record.props || false;
      if ("component" in record) {
        propsObject.default = props;
      } else {
        for (const name in record.components)
          propsObject[name] = typeof props === "object" ? props[name] : props;
      }
      return propsObject;
    }
    function isAliasRecord(record) {
      while (record) {
        if (record.record.aliasOf)
          return true;
        record = record.parent;
      }
      return false;
    }
    function mergeMetaFields(matched) {
      return matched.reduce((meta, record) => assign$3(meta, record.meta), {});
    }
    function mergeOptions(defaults, partialOptions) {
      const options = {};
      for (const key in defaults) {
        options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
      }
      return options;
    }
    function findInsertionIndex(matcher, matchers) {
      let lower = 0;
      let upper = matchers.length;
      while (lower !== upper) {
        const mid = lower + upper >> 1;
        const sortOrder = comparePathParserScore(matcher, matchers[mid]);
        if (sortOrder < 0) {
          upper = mid;
        } else {
          lower = mid + 1;
        }
      }
      const insertionAncestor = getInsertionAncestor(matcher);
      if (insertionAncestor) {
        upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
      }
      return upper;
    }
    function getInsertionAncestor(matcher) {
      let ancestor = matcher;
      while (ancestor = ancestor.parent) {
        if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) {
          return ancestor;
        }
      }
      return;
    }
    function isMatchable({ record }) {
      return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
    }
    function parseQuery(search) {
      const query = {};
      if (search === "" || search === "?")
        return query;
      const hasLeadingIM = search[0] === "?";
      const searchParams = (hasLeadingIM ? search.slice(1) : search).split("&");
      for (let i = 0; i < searchParams.length; ++i) {
        const searchParam = searchParams[i].replace(PLUS_RE, " ");
        const eqPos = searchParam.indexOf("=");
        const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
        const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
        if (key in query) {
          let currentValue = query[key];
          if (!isArray$2(currentValue)) {
            currentValue = query[key] = [currentValue];
          }
          currentValue.push(value);
        } else {
          query[key] = value;
        }
      }
      return query;
    }
    function stringifyQuery(query) {
      let search = "";
      for (let key in query) {
        const value = query[key];
        key = encodeQueryKey(key);
        if (value == null) {
          if (value !== void 0) {
            search += (search.length ? "&" : "") + key;
          }
          continue;
        }
        const values = isArray$2(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)];
        values.forEach((value2) => {
          if (value2 !== void 0) {
            search += (search.length ? "&" : "") + key;
            if (value2 != null)
              search += "=" + value2;
          }
        });
      }
      return search;
    }
    function normalizeQuery(query) {
      const normalizedQuery = {};
      for (const key in query) {
        const value = query[key];
        if (value !== void 0) {
          normalizedQuery[key] = isArray$2(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
        }
      }
      return normalizedQuery;
    }
    const matchedRouteKey = Symbol("");
    const viewDepthKey = Symbol("");
    const routerKey = Symbol("");
    const routeLocationKey = Symbol("");
    const routerViewLocationKey = Symbol("");
    function useCallbacks() {
      let handlers = [];
      function add(handler) {
        handlers.push(handler);
        return () => {
          const i = handlers.indexOf(handler);
          if (i > -1)
            handlers.splice(i, 1);
        };
      }
      function reset() {
        handlers = [];
      }
      return {
        add,
        list: () => handlers.slice(),
        reset
      };
    }
    function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
      const enterCallbackArray = record && // name is defined if record is because of the function overload
      (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
      return () => new Promise((resolve2, reject) => {
        const next = (valid) => {
          if (valid === false) {
            reject(createRouterError(4, {
              from,
              to
            }));
          } else if (valid instanceof Error) {
            reject(valid);
          } else if (isRouteLocation(valid)) {
            reject(createRouterError(2, {
              from: to,
              to: valid
            }));
          } else {
            if (enterCallbackArray && // since enterCallbackArray is truthy, both record and name also are
            record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") {
              enterCallbackArray.push(valid);
            }
            resolve2();
          }
        };
        const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
        let guardCall = Promise.resolve(guardReturn);
        if (guard.length < 3)
          guardCall = guardCall.then(next);
        guardCall.catch((err) => reject(err));
      });
    }
    function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
      const guards = [];
      for (const record of matched) {
        for (const name in record.components) {
          let rawComponent = record.components[name];
          if (guardType !== "beforeRouteEnter" && !record.instances[name])
            continue;
          if (isRouteComponent(rawComponent)) {
            const options = rawComponent.__vccOpts || rawComponent;
            const guard = options[guardType];
            guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
          } else {
            let componentPromise = rawComponent();
            guards.push(() => componentPromise.then((resolved) => {
              if (!resolved)
                throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
              const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
              record.mods[name] = resolved;
              record.components[name] = resolvedComponent;
              const options = resolvedComponent.__vccOpts || resolvedComponent;
              const guard = options[guardType];
              return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
            }));
          }
        }
      }
      return guards;
    }
    function useLink(props) {
      const router2 = inject(routerKey);
      const currentRoute = inject(routeLocationKey);
      const route = computed(() => {
        const to = unref(props.to);
        return router2.resolve(to);
      });
      const activeRecordIndex = computed(() => {
        const { matched } = route.value;
        const { length } = matched;
        const routeMatched = matched[length - 1];
        const currentMatched = currentRoute.matched;
        if (!routeMatched || !currentMatched.length)
          return -1;
        const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
        if (index > -1)
          return index;
        const parentRecordPath = getOriginalPath(matched[length - 2]);
        return (
          // we are dealing with nested routes
          length > 1 && // if the parent and matched route have the same path, this link is
          // referring to the empty child. Or we currently are on a different
          // child of the same parent
          getOriginalPath(routeMatched) === parentRecordPath && // avoid comparing the child with its parent
          currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index
        );
      });
      const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
      const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
      function navigate(e = {}) {
        if (guardEvent(e)) {
          return router2[unref(props.replace) ? "replace" : "push"](
            unref(props.to)
            // avoid uncaught errors are they are logged anyway
          ).catch(noop$1);
        }
        return Promise.resolve();
      }
      return {
        route,
        href: computed(() => route.value.href),
        isActive,
        isExactActive,
        navigate
      };
    }
    const RouterLinkImpl = /* @__PURE__ */ defineComponent({
      name: "RouterLink",
      compatConfig: { MODE: 3 },
      props: {
        to: {
          type: [String, Object],
          required: true
        },
        replace: Boolean,
        activeClass: String,
        // inactiveClass: String,
        exactActiveClass: String,
        custom: Boolean,
        ariaCurrentValue: {
          type: String,
          default: "page"
        }
      },
      useLink,
      setup(props, { slots }) {
        const link = reactive(useLink(props));
        const { options } = inject(routerKey);
        const elClass = computed(() => ({
          [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
          // [getLinkClass(
          //   props.inactiveClass,
          //   options.linkInactiveClass,
          //   'router-link-inactive'
          // )]: !link.isExactActive,
          [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
        }));
        return () => {
          const children = slots.default && slots.default(link);
          return props.custom ? children : h("a", {
            "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
            href: link.href,
            // this would override user added attrs but Vue will still add
            // the listener, so we end up triggering both
            onClick: link.navigate,
            class: elClass.value
          }, children);
        };
      }
    });
    const RouterLink = RouterLinkImpl;
    function guardEvent(e) {
      if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
        return;
      if (e.defaultPrevented)
        return;
      if (e.button !== void 0 && e.button !== 0)
        return;
      if (e.currentTarget && e.currentTarget.getAttribute) {
        const target = e.currentTarget.getAttribute("target");
        if (/\b_blank\b/i.test(target))
          return;
      }
      if (e.preventDefault)
        e.preventDefault();
      return true;
    }
    function includesParams(outer, inner) {
      for (const key in inner) {
        const innerValue = inner[key];
        const outerValue = outer[key];
        if (typeof innerValue === "string") {
          if (innerValue !== outerValue)
            return false;
        } else {
          if (!isArray$2(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value !== outerValue[i]))
            return false;
        }
      }
      return true;
    }
    function getOriginalPath(record) {
      return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
    }
    const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
    const RouterViewImpl = /* @__PURE__ */ defineComponent({
      name: "RouterView",
      // #674 we manually inherit them
      inheritAttrs: false,
      props: {
        name: {
          type: String,
          default: "default"
        },
        route: Object
      },
      // Better compat for @vue/compat users
      // https://github.com/vuejs/router/issues/1315
      compatConfig: { MODE: 3 },
      setup(props, { attrs, slots }) {
        const injectedRoute = inject(routerViewLocationKey);
        const routeToDisplay = computed(() => props.route || injectedRoute.value);
        const injectedDepth = inject(viewDepthKey, 0);
        const depth = computed(() => {
          let initialDepth = unref(injectedDepth);
          const { matched } = routeToDisplay.value;
          let matchedRoute;
          while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) {
            initialDepth++;
          }
          return initialDepth;
        });
        const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
        provide(viewDepthKey, computed(() => depth.value + 1));
        provide(matchedRouteKey, matchedRouteRef);
        provide(routerViewLocationKey, routeToDisplay);
        const viewRef = ref();
        watch(() => [viewRef.value, matchedRouteRef.value, props.name], ([instance, to, name], [oldInstance, from, oldName]) => {
          if (to) {
            to.instances[name] = instance;
            if (from && from !== to && instance && instance === oldInstance) {
              if (!to.leaveGuards.size) {
                to.leaveGuards = from.leaveGuards;
              }
              if (!to.updateGuards.size) {
                to.updateGuards = from.updateGuards;
              }
            }
          }
          if (instance && to && // if there is no instance but to and from are the same this might be
          // the first visit
          (!from || !isSameRouteRecord(to, from) || !oldInstance)) {
            (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
          }
        }, { flush: "post" });
        return () => {
          const route = routeToDisplay.value;
          const currentName = props.name;
          const matchedRoute = matchedRouteRef.value;
          const ViewComponent = matchedRoute && matchedRoute.components[currentName];
          if (!ViewComponent) {
            return normalizeSlot(slots.default, { Component: ViewComponent, route });
          }
          const routePropsOption = matchedRoute.props[currentName];
          const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
          const onVnodeUnmounted = (vnode) => {
            if (vnode.component.isUnmounted) {
              matchedRoute.instances[currentName] = null;
            }
          };
          const component = h(ViewComponent, assign$3({}, routeProps, attrs, {
            onVnodeUnmounted,
            ref: viewRef
          }));
          return (
            // pass the vnode to the slot as a prop.
            // h and <component :is="..."> both accept vnodes
            normalizeSlot(slots.default, { Component: component, route }) || component
          );
        };
      }
    });
    function normalizeSlot(slot, data) {
      if (!slot)
        return null;
      const slotContent = slot(data);
      return slotContent.length === 1 ? slotContent[0] : slotContent;
    }
    const RouterView = RouterViewImpl;
    function createRouter(options) {
      const matcher = createRouterMatcher(options.routes, options);
      const parseQuery$1 = options.parseQuery || parseQuery;
      const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
      const routerHistory = options.history;
      const beforeGuards = useCallbacks();
      const beforeResolveGuards = useCallbacks();
      const afterGuards = useCallbacks();
      const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
      let pendingLocation = START_LOCATION_NORMALIZED;
      if (isBrowser$3 && options.scrollBehavior && "scrollRestoration" in history) {
        history.scrollRestoration = "manual";
      }
      const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
      const encodeParams = applyToParams.bind(null, encodeParam);
      const decodeParams = (
        // @ts-expect-error: intentionally avoid the type check
        applyToParams.bind(null, decode)
      );
      function addRoute(parentOrRoute, route) {
        let parent;
        let record;
        if (isRouteName(parentOrRoute)) {
          parent = matcher.getRecordMatcher(parentOrRoute);
          record = route;
        } else {
          record = parentOrRoute;
        }
        return matcher.addRoute(record, parent);
      }
      function removeRoute(name) {
        const recordMatcher = matcher.getRecordMatcher(name);
        if (recordMatcher) {
          matcher.removeRoute(recordMatcher);
        }
      }
      function getRoutes() {
        return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
      }
      function hasRoute(name) {
        return !!matcher.getRecordMatcher(name);
      }
      function resolve2(rawLocation, currentLocation) {
        currentLocation = assign$3({}, currentLocation || currentRoute.value);
        if (typeof rawLocation === "string") {
          const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
          const matchedRoute2 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
          const href2 = routerHistory.createHref(locationNormalized.fullPath);
          return assign$3(locationNormalized, matchedRoute2, {
            params: decodeParams(matchedRoute2.params),
            hash: decode(locationNormalized.hash),
            redirectedFrom: void 0,
            href: href2
          });
        }
        let matcherLocation;
        if (rawLocation.path != null) {
          matcherLocation = assign$3({}, rawLocation, {
            path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path
          });
        } else {
          const targetParams = assign$3({}, rawLocation.params);
          for (const key in targetParams) {
            if (targetParams[key] == null) {
              delete targetParams[key];
            }
          }
          matcherLocation = assign$3({}, rawLocation, {
            params: encodeParams(targetParams)
          });
          currentLocation.params = encodeParams(currentLocation.params);
        }
        const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
        const hash = rawLocation.hash || "";
        matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
        const fullPath = stringifyURL(stringifyQuery$1, assign$3({}, rawLocation, {
          hash: encodeHash(hash),
          path: matchedRoute.path
        }));
        const href = routerHistory.createHref(fullPath);
        return assign$3({
          fullPath,
          // keep the hash encoded so fullPath is effectively path + encodedQuery +
          // hash
          hash,
          query: (
            // if the user is using a custom query lib like qs, we might have
            // nested objects, so we keep the query as is, meaning it can contain
            // numbers at `$route.query`, but at the point, the user will have to
            // use their own type anyway.
            // https://github.com/vuejs/router/issues/328#issuecomment-649481567
            stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
          )
        }, matchedRoute, {
          redirectedFrom: void 0,
          href
        });
      }
      function locationAsObject(to) {
        return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign$3({}, to);
      }
      function checkCanceledNavigation(to, from) {
        if (pendingLocation !== to) {
          return createRouterError(8, {
            from,
            to
          });
        }
      }
      function push(to) {
        return pushWithRedirect(to);
      }
      function replace(to) {
        return push(assign$3(locationAsObject(to), { replace: true }));
      }
      function handleRedirectRecord(to) {
        const lastMatched = to.matched[to.matched.length - 1];
        if (lastMatched && lastMatched.redirect) {
          const { redirect } = lastMatched;
          let newTargetLocation = typeof redirect === "function" ? redirect(to) : redirect;
          if (typeof newTargetLocation === "string") {
            newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : (
              // force empty params
              { path: newTargetLocation }
            );
            newTargetLocation.params = {};
          }
          return assign$3({
            query: to.query,
            hash: to.hash,
            // avoid transferring params if the redirect has a path
            params: newTargetLocation.path != null ? {} : to.params
          }, newTargetLocation);
        }
      }
      function pushWithRedirect(to, redirectedFrom) {
        const targetLocation = pendingLocation = resolve2(to);
        const from = currentRoute.value;
        const data = to.state;
        const force = to.force;
        const replace2 = to.replace === true;
        const shouldRedirect = handleRedirectRecord(targetLocation);
        if (shouldRedirect)
          return pushWithRedirect(
            assign$3(locationAsObject(shouldRedirect), {
              state: typeof shouldRedirect === "object" ? assign$3({}, data, shouldRedirect.state) : data,
              force,
              replace: replace2
            }),
            // keep original redirectedFrom if it exists
            redirectedFrom || targetLocation
          );
        const toLocation = targetLocation;
        toLocation.redirectedFrom = redirectedFrom;
        let failure;
        if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
          failure = createRouterError(16, { to: toLocation, from });
          handleScroll(
            from,
            from,
            // this is a push, the only way for it to be triggered from a
            // history.listen is with a redirect, which makes it become a push
            true,
            // This cannot be the first navigation because the initial location
            // cannot be manually navigated to
            false
          );
        }
        return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error2) => isNavigationFailure(error2) ? (
          // navigation redirects still mark the router as ready
          isNavigationFailure(
            error2,
            2
            /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
          ) ? error2 : markAsReady(error2)
        ) : (
          // reject any unknown error
          triggerError(error2, toLocation, from)
        )).then((failure2) => {
          if (failure2) {
            if (isNavigationFailure(
              failure2,
              2
              /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
            )) {
              return pushWithRedirect(
                // keep options
                assign$3({
                  // preserve an existing replacement but allow the redirect to override it
                  replace: replace2
                }, locationAsObject(failure2.to), {
                  state: typeof failure2.to === "object" ? assign$3({}, data, failure2.to.state) : data,
                  force
                }),
                // preserve the original redirectedFrom if any
                redirectedFrom || toLocation
              );
            }
          } else {
            failure2 = finalizeNavigation(toLocation, from, true, replace2, data);
          }
          triggerAfterEach(toLocation, from, failure2);
          return failure2;
        });
      }
      function checkCanceledNavigationAndReject(to, from) {
        const error2 = checkCanceledNavigation(to, from);
        return error2 ? Promise.reject(error2) : Promise.resolve();
      }
      function runWithContext(fn) {
        const app = installedApps.values().next().value;
        return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
      }
      function navigate(to, from) {
        let guards;
        const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
        guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
        for (const record of leavingRecords) {
          record.leaveGuards.forEach((guard) => {
            guards.push(guardToPromiseFn(guard, to, from));
          });
        }
        const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
        guards.push(canceledNavigationCheck);
        return runGuardQueue(guards).then(() => {
          guards = [];
          for (const guard of beforeGuards.list()) {
            guards.push(guardToPromiseFn(guard, to, from));
          }
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).then(() => {
          guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
          for (const record of updatingRecords) {
            record.updateGuards.forEach((guard) => {
              guards.push(guardToPromiseFn(guard, to, from));
            });
          }
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).then(() => {
          guards = [];
          for (const record of enteringRecords) {
            if (record.beforeEnter) {
              if (isArray$2(record.beforeEnter)) {
                for (const beforeEnter of record.beforeEnter)
                  guards.push(guardToPromiseFn(beforeEnter, to, from));
              } else {
                guards.push(guardToPromiseFn(record.beforeEnter, to, from));
              }
            }
          }
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).then(() => {
          to.matched.forEach((record) => record.enterCallbacks = {});
          guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).then(() => {
          guards = [];
          for (const guard of beforeResolveGuards.list()) {
            guards.push(guardToPromiseFn(guard, to, from));
          }
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).catch((err) => isNavigationFailure(
          err,
          8
          /* ErrorTypes.NAVIGATION_CANCELLED */
        ) ? err : Promise.reject(err));
      }
      function triggerAfterEach(to, from, failure) {
        afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
      }
      function finalizeNavigation(toLocation, from, isPush, replace2, data) {
        const error2 = checkCanceledNavigation(toLocation, from);
        if (error2)
          return error2;
        const isFirstNavigation = from === START_LOCATION_NORMALIZED;
        const state = !isBrowser$3 ? {} : history.state;
        if (isPush) {
          if (replace2 || isFirstNavigation)
            routerHistory.replace(toLocation.fullPath, assign$3({
              scroll: isFirstNavigation && state && state.scroll
            }, data));
          else
            routerHistory.push(toLocation.fullPath, data);
        }
        currentRoute.value = toLocation;
        handleScroll(toLocation, from, isPush, isFirstNavigation);
        markAsReady();
      }
      let removeHistoryListener;
      function setupListeners() {
        if (removeHistoryListener)
          return;
        removeHistoryListener = routerHistory.listen((to, _from, info) => {
          if (!router2.listening)
            return;
          const toLocation = resolve2(to);
          const shouldRedirect = handleRedirectRecord(toLocation);
          if (shouldRedirect) {
            pushWithRedirect(assign$3(shouldRedirect, { replace: true }), toLocation).catch(noop$1);
            return;
          }
          pendingLocation = toLocation;
          const from = currentRoute.value;
          if (isBrowser$3) {
            saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
          }
          navigate(toLocation, from).catch((error2) => {
            if (isNavigationFailure(
              error2,
              4 | 8
              /* ErrorTypes.NAVIGATION_CANCELLED */
            )) {
              return error2;
            }
            if (isNavigationFailure(
              error2,
              2
              /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
            )) {
              pushWithRedirect(
                error2.to,
                toLocation
                // avoid an uncaught rejection, let push call triggerError
              ).then((failure) => {
                if (isNavigationFailure(
                  failure,
                  4 | 16
                  /* ErrorTypes.NAVIGATION_DUPLICATED */
                ) && !info.delta && info.type === NavigationType.pop) {
                  routerHistory.go(-1, false);
                }
              }).catch(noop$1);
              return Promise.reject();
            }
            if (info.delta) {
              routerHistory.go(-info.delta, false);
            }
            return triggerError(error2, toLocation, from);
          }).then((failure) => {
            failure = failure || finalizeNavigation(
              // after navigation, all matched components are resolved
              toLocation,
              from,
              false
            );
            if (failure) {
              if (info.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history
              // entry while a different route is displayed
              !isNavigationFailure(
                failure,
                8
                /* ErrorTypes.NAVIGATION_CANCELLED */
              )) {
                routerHistory.go(-info.delta, false);
              } else if (info.type === NavigationType.pop && isNavigationFailure(
                failure,
                4 | 16
                /* ErrorTypes.NAVIGATION_DUPLICATED */
              )) {
                routerHistory.go(-1, false);
              }
            }
            triggerAfterEach(toLocation, from, failure);
          }).catch(noop$1);
        });
      }
      let readyHandlers = useCallbacks();
      let errorListeners = useCallbacks();
      let ready;
      function triggerError(error2, to, from) {
        markAsReady(error2);
        const list = errorListeners.list();
        if (list.length) {
          list.forEach((handler) => handler(error2, to, from));
        } else {
          console.error(error2);
        }
        return Promise.reject(error2);
      }
      function isReady() {
        if (ready && currentRoute.value !== START_LOCATION_NORMALIZED)
          return Promise.resolve();
        return new Promise((resolve22, reject) => {
          readyHandlers.add([resolve22, reject]);
        });
      }
      function markAsReady(err) {
        if (!ready) {
          ready = !err;
          setupListeners();
          readyHandlers.list().forEach(([resolve22, reject]) => err ? reject(err) : resolve22());
          readyHandlers.reset();
        }
        return err;
      }
      function handleScroll(to, from, isPush, isFirstNavigation) {
        const { scrollBehavior } = options;
        if (!isBrowser$3 || !scrollBehavior)
          return Promise.resolve();
        const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
        return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
      }
      const go = (delta) => routerHistory.go(delta);
      let started;
      const installedApps = /* @__PURE__ */ new Set();
      const router2 = {
        currentRoute,
        listening: true,
        addRoute,
        removeRoute,
        clearRoutes: matcher.clearRoutes,
        hasRoute,
        getRoutes,
        resolve: resolve2,
        options,
        push,
        replace,
        go,
        back: () => go(-1),
        forward: () => go(1),
        beforeEach: beforeGuards.add,
        beforeResolve: beforeResolveGuards.add,
        afterEach: afterGuards.add,
        onError: errorListeners.add,
        isReady,
        install(app) {
          const router22 = this;
          app.component("RouterLink", RouterLink);
          app.component("RouterView", RouterView);
          app.config.globalProperties.$router = router22;
          Object.defineProperty(app.config.globalProperties, "$route", {
            enumerable: true,
            get: () => unref(currentRoute)
          });
          if (isBrowser$3 && // used for the initial navigation client side to avoid pushing
          // multiple times when the router is used in multiple apps
          !started && currentRoute.value === START_LOCATION_NORMALIZED) {
            started = true;
            push(routerHistory.location).catch((err) => {
            });
          }
          const reactiveRoute = {};
          for (const key in START_LOCATION_NORMALIZED) {
            Object.defineProperty(reactiveRoute, key, {
              get: () => currentRoute.value[key],
              enumerable: true
            });
          }
          app.provide(routerKey, router22);
          app.provide(routeLocationKey, shallowReactive(reactiveRoute));
          app.provide(routerViewLocationKey, currentRoute);
          const unmountApp = app.unmount;
          installedApps.add(app);
          app.unmount = function() {
            installedApps.delete(app);
            if (installedApps.size < 1) {
              pendingLocation = START_LOCATION_NORMALIZED;
              removeHistoryListener && removeHistoryListener();
              removeHistoryListener = null;
              currentRoute.value = START_LOCATION_NORMALIZED;
              started = false;
              ready = false;
            }
            unmountApp();
          };
        }
      };
      function runGuardQueue(guards) {
        return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
      }
      return router2;
    }
    function extractChangingRecords(to, from) {
      const leavingRecords = [];
      const updatingRecords = [];
      const enteringRecords = [];
      const len2 = Math.max(from.matched.length, to.matched.length);
      for (let i = 0; i < len2; i++) {
        const recordFrom = from.matched[i];
        if (recordFrom) {
          if (to.matched.find((record) => isSameRouteRecord(record, recordFrom)))
            updatingRecords.push(recordFrom);
          else
            leavingRecords.push(recordFrom);
        }
        const recordTo = to.matched[i];
        if (recordTo) {
          if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) {
            enteringRecords.push(recordTo);
          }
        }
      }
      return [leavingRecords, updatingRecords, enteringRecords];
    }
    let onceCbs = [];
    const paramsMap = /* @__PURE__ */ new WeakMap();
    function flushOnceCallbacks() {
      onceCbs.forEach((cb) => cb(...paramsMap.get(cb)));
      onceCbs = [];
    }
    function beforeNextFrameOnce(cb, ...params) {
      paramsMap.set(cb, params);
      if (onceCbs.includes(cb))
        return;
      onceCbs.push(cb) === 1 && requestAnimationFrame(flushOnceCallbacks);
    }
    function happensIn(e, dataSetPropName) {
      let { target } = e;
      while (target) {
        if (target.dataset) {
          if (target.dataset[dataSetPropName] !== void 0)
            return true;
        }
        target = target.parentElement;
      }
      return false;
    }
    function getPreciseEventTarget(event) {
      return event.composedPath()[0] || null;
    }
    function depx(value) {
      if (typeof value === "string") {
        if (value.endsWith("px")) {
          return Number(value.slice(0, value.length - 2));
        }
        return Number(value);
      }
      return value;
    }
    function pxfy(value) {
      if (value === void 0 || value === null)
        return void 0;
      if (typeof value === "number")
        return `${value}px`;
      if (value.endsWith("px"))
        return value;
      return `${value}px`;
    }
    function getMargin(value, position) {
      const parts = value.trim().split(/\s+/g);
      const margin = {
        top: parts[0]
      };
      switch (parts.length) {
        case 1:
          margin.right = parts[0];
          margin.bottom = parts[0];
          margin.left = parts[0];
          break;
        case 2:
          margin.right = parts[1];
          margin.left = parts[1];
          margin.bottom = parts[0];
          break;
        case 3:
          margin.right = parts[1];
          margin.bottom = parts[2];
          margin.left = parts[1];
          break;
        case 4:
          margin.right = parts[1];
          margin.bottom = parts[2];
          margin.left = parts[3];
          break;
        default:
          throw new Error("[seemly/getMargin]:" + value + " is not a valid value.");
      }
      if (position === void 0)
        return margin;
      return margin[position];
    }
    function getGap(value, orient) {
      const [rowGap, colGap] = value.split(" ");
      return {
        row: rowGap,
        col: colGap || rowGap
      };
    }
    const colors = {
      black: "#000",
      silver: "#C0C0C0",
      gray: "#808080",
      white: "#FFF",
      maroon: "#800000",
      red: "#F00",
      purple: "#800080",
      fuchsia: "#F0F",
      green: "#008000",
      lime: "#0F0",
      olive: "#808000",
      yellow: "#FF0",
      navy: "#000080",
      blue: "#00F",
      teal: "#008080",
      aqua: "#0FF",
      transparent: "#0000"
    };
    const prefix$1 = "^\\s*";
    const suffix = "\\s*$";
    const float = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*";
    const hex = "([0-9A-Fa-f])";
    const dhex = "([0-9A-Fa-f]{2})";
    const rgbRegex = new RegExp(`${prefix$1}rgb\\s*\\(${float},${float},${float}\\)${suffix}`);
    const rgbaRegex = new RegExp(`${prefix$1}rgba\\s*\\(${float},${float},${float},${float}\\)${suffix}`);
    const sHexRegex = new RegExp(`${prefix$1}#${hex}${hex}${hex}${suffix}`);
    const hexRegex = new RegExp(`${prefix$1}#${dhex}${dhex}${dhex}${suffix}`);
    const sHexaRegex = new RegExp(`${prefix$1}#${hex}${hex}${hex}${hex}${suffix}`);
    const hexaRegex = new RegExp(`${prefix$1}#${dhex}${dhex}${dhex}${dhex}${suffix}`);
    function parseHex(value) {
      return parseInt(value, 16);
    }
    function rgba(color) {
      try {
        let i;
        if (i = hexRegex.exec(color)) {
          return [parseHex(i[1]), parseHex(i[2]), parseHex(i[3]), 1];
        } else if (i = rgbRegex.exec(color)) {
          return [roundChannel(i[1]), roundChannel(i[5]), roundChannel(i[9]), 1];
        } else if (i = rgbaRegex.exec(color)) {
          return [
            roundChannel(i[1]),
            roundChannel(i[5]),
            roundChannel(i[9]),
            roundAlpha(i[13])
          ];
        } else if (i = sHexRegex.exec(color)) {
          return [
            parseHex(i[1] + i[1]),
            parseHex(i[2] + i[2]),
            parseHex(i[3] + i[3]),
            1
          ];
        } else if (i = hexaRegex.exec(color)) {
          return [
            parseHex(i[1]),
            parseHex(i[2]),
            parseHex(i[3]),
            roundAlpha(parseHex(i[4]) / 255)
          ];
        } else if (i = sHexaRegex.exec(color)) {
          return [
            parseHex(i[1] + i[1]),
            parseHex(i[2] + i[2]),
            parseHex(i[3] + i[3]),
            roundAlpha(parseHex(i[4] + i[4]) / 255)
          ];
        } else if (color in colors) {
          return rgba(colors[color]);
        }
        throw new Error(`[seemly/rgba]: Invalid color value ${color}.`);
      } catch (e) {
        throw e;
      }
    }
    function normalizeAlpha(alphaValue) {
      return alphaValue > 1 ? 1 : alphaValue < 0 ? 0 : alphaValue;
    }
    function stringifyRgba(r, g, b, a) {
      return `rgba(${roundChannel(r)}, ${roundChannel(g)}, ${roundChannel(b)}, ${normalizeAlpha(a)})`;
    }
    function compositeChannel(v1, a1, v2, a2, a) {
      return roundChannel((v1 * a1 * (1 - a2) + v2 * a2) / a);
    }
    function composite(background, overlay2) {
      if (!Array.isArray(background))
        background = rgba(background);
      if (!Array.isArray(overlay2))
        overlay2 = rgba(overlay2);
      const a1 = background[3];
      const a2 = overlay2[3];
      const alpha = roundAlpha(a1 + a2 - a1 * a2);
      return stringifyRgba(compositeChannel(background[0], a1, overlay2[0], a2, alpha), compositeChannel(background[1], a1, overlay2[1], a2, alpha), compositeChannel(background[2], a1, overlay2[2], a2, alpha), alpha);
    }
    function changeColor(base2, options) {
      const [r, g, b, a = 1] = Array.isArray(base2) ? base2 : rgba(base2);
      if (options.alpha) {
        return stringifyRgba(r, g, b, options.alpha);
      }
      return stringifyRgba(r, g, b, a);
    }
    function scaleColor(base2, options) {
      const [r, g, b, a = 1] = Array.isArray(base2) ? base2 : rgba(base2);
      const { lightness = 1, alpha = 1 } = options;
      return toRgbaString([r * lightness, g * lightness, b * lightness, a * alpha]);
    }
    function roundAlpha(value) {
      const v = Math.round(Number(value) * 100) / 100;
      if (v > 1)
        return 1;
      if (v < 0)
        return 0;
      return v;
    }
    function roundChannel(value) {
      const v = Math.round(Number(value));
      if (v > 255)
        return 255;
      if (v < 0)
        return 0;
      return v;
    }
    function toRgbaString(base2) {
      const [r, g, b] = base2;
      if (3 in base2) {
        return `rgba(${roundChannel(r)}, ${roundChannel(g)}, ${roundChannel(b)}, ${roundAlpha(base2[3])})`;
      }
      return `rgba(${roundChannel(r)}, ${roundChannel(g)}, ${roundChannel(b)}, 1)`;
    }
    function createId(length = 8) {
      return Math.random().toString(16).slice(2, 2 + length);
    }
    function getSlot$1(instance, slotName = "default", fallback = []) {
      const slots = instance.$slots;
      const slot = slots[slotName];
      if (slot === void 0) return fallback;
      return slot();
    }
    function keep(object, keys2 = [], rest) {
      const keepedObject = {};
      keys2.forEach((key) => {
        keepedObject[key] = object[key];
      });
      return Object.assign(keepedObject, rest);
    }
    function omit(object, keys2 = [], rest) {
      const omitedObject = {};
      const originalKeys = Object.getOwnPropertyNames(object);
      originalKeys.forEach((originalKey) => {
        if (!keys2.includes(originalKey)) {
          omitedObject[originalKey] = object[originalKey];
        }
      });
      return Object.assign(omitedObject, rest);
    }
    function flatten$2(vNodes, filterCommentNode = true, result = []) {
      vNodes.forEach((vNode) => {
        if (vNode === null) return;
        if (typeof vNode !== "object") {
          if (typeof vNode === "string" || typeof vNode === "number") {
            result.push(createTextVNode(String(vNode)));
          }
          return;
        }
        if (Array.isArray(vNode)) {
          flatten$2(vNode, filterCommentNode, result);
          return;
        }
        if (vNode.type === Fragment) {
          if (vNode.children === null) return;
          if (Array.isArray(vNode.children)) {
            flatten$2(vNode.children, filterCommentNode, result);
          }
        } else {
          if (vNode.type === Comment && filterCommentNode) return;
          result.push(vNode);
        }
      });
      return result;
    }
    function call(funcs, ...args) {
      if (Array.isArray(funcs)) {
        funcs.forEach((func) => call(func, ...args));
      } else {
        return funcs(...args);
      }
    }
    function keysOf(obj) {
      return Object.keys(obj);
    }
    function render$1(r, ...args) {
      if (typeof r === "function") {
        return r(...args);
      } else if (typeof r === "string") {
        return createTextVNode(r);
      } else if (typeof r === "number") {
        return createTextVNode(String(r));
      } else {
        return null;
      }
    }
    function warn$3(location2, message) {
      console.error(`[naive/${location2}]: ${message}`);
    }
    function error(location2, message, error2) {
      console.error(`[naive/${location2}]: ${message}`, error2);
    }
    function throwError(location2, message) {
      throw new Error(`[naive/${location2}]: ${message}`);
    }
    function getTitleAttribute(value) {
      switch (typeof value) {
        case "string":
          return value || void 0;
        case "number":
          return String(value);
        default:
          return void 0;
      }
    }
    function getFirstSlotVNode(slots, slotName = "default", props = void 0) {
      const slot = slots[slotName];
      if (!slot) {
        warn$3("getFirstSlotVNode", `slot[${slotName}] is empty`);
        return null;
      }
      const slotContent = flatten$2(slot(props));
      if (slotContent.length === 1) {
        return slotContent[0];
      } else {
        warn$3("getFirstSlotVNode", `slot[${slotName}] should have exactly one child`);
        return null;
      }
    }
    function createInjectionKey(key) {
      return key;
    }
    function ensureValidVNode(vnodes) {
      return vnodes.some((child) => {
        if (!isVNode$1(child)) {
          return true;
        }
        if (child.type === Comment) {
          return false;
        }
        if (child.type === Fragment && !ensureValidVNode(child.children)) {
          return false;
        }
        return true;
      }) ? vnodes : null;
    }
    function resolveSlot(slot, fallback) {
      return slot && ensureValidVNode(slot()) || fallback();
    }
    function resolveSlotWithProps(slot, props, fallback) {
      return slot && ensureValidVNode(slot(props)) || fallback(props);
    }
    function resolveWrappedSlot(slot, wrapper) {
      const children = slot && ensureValidVNode(slot());
      return wrapper(children || null);
    }
    function isSlotEmpty(slot) {
      return !(slot && ensureValidVNode(slot()));
    }
    function mergeEventHandlers(handlers) {
      const filteredHandlers = handlers.filter((handler) => handler !== void 0);
      if (filteredHandlers.length === 0) return void 0;
      if (filteredHandlers.length === 1) return filteredHandlers[0];
      return (e) => {
        handlers.forEach((handler) => {
          if (handler) {
            handler(e);
          }
        });
      };
    }
    const Wrapper = /* @__PURE__ */ defineComponent({
      render() {
        var _a, _b;
        return (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a);
      }
    });
    const pureNumberRegex = /^(\d|\.)+$/;
    const numberRegex = /(\d|\.)+/;
    function formatLength(length, {
      c: c2 = 1,
      offset = 0,
      attachPx = true
    } = {}) {
      if (typeof length === "number") {
        const result = (length + offset) * c2;
        if (result === 0) return "0";
        return `${result}px`;
      } else if (typeof length === "string") {
        if (pureNumberRegex.test(length)) {
          const result = (Number(length) + offset) * c2;
          if (attachPx) {
            if (result === 0) return "0";
            return `${result}px`;
          } else {
            return `${result}`;
          }
        } else {
          const result = numberRegex.exec(length);
          if (!result) return length;
          return length.replace(numberRegex, String((Number(result[0]) + offset) * c2));
        }
      }
      return length;
    }
    function color2Class(color) {
      return color.replace(/#|\(|\)|,|\s|\./g, "_");
    }
    function rtlInset(inset) {
      const {
        left,
        right,
        top,
        bottom
      } = getMargin(inset);
      return `${top} ${right} ${bottom} ${left}`;
    }
    function ampCount(selector) {
      let cnt = 0;
      for (let i = 0; i < selector.length; ++i) {
        if (selector[i] === "&")
          ++cnt;
      }
      return cnt;
    }
    const separatorRegex = /\s*,(?![^(]*\))\s*/g;
    const extraSpaceRegex = /\s+/g;
    function resolveSelectorWithAmp(amp, selector) {
      const nextAmp = [];
      selector.split(separatorRegex).forEach((partialSelector) => {
        let round = ampCount(partialSelector);
        if (!round) {
          amp.forEach((partialAmp) => {
            nextAmp.push(
              // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
              (partialAmp && partialAmp + " ") + partialSelector
            );
          });
          return;
        } else if (round === 1) {
          amp.forEach((partialAmp) => {
            nextAmp.push(partialSelector.replace("&", partialAmp));
          });
          return;
        }
        let partialNextAmp = [
          partialSelector
        ];
        while (round--) {
          const nextPartialNextAmp = [];
          partialNextAmp.forEach((selectorItr) => {
            amp.forEach((partialAmp) => {
              nextPartialNextAmp.push(selectorItr.replace("&", partialAmp));
            });
          });
          partialNextAmp = nextPartialNextAmp;
        }
        partialNextAmp.forEach((part) => nextAmp.push(part));
      });
      return nextAmp;
    }
    function resolveSelector(amp, selector) {
      const nextAmp = [];
      selector.split(separatorRegex).forEach((partialSelector) => {
        amp.forEach((partialAmp) => {
          nextAmp.push((partialAmp && partialAmp + " ") + partialSelector);
        });
      });
      return nextAmp;
    }
    function parseSelectorPath(selectorPaths) {
      let amp = [""];
      selectorPaths.forEach((selector) => {
        selector = selector && selector.trim();
        if (
          // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
          !selector
        ) {
          return;
        }
        if (selector.includes("&")) {
          amp = resolveSelectorWithAmp(amp, selector);
        } else {
          amp = resolveSelector(amp, selector);
        }
      });
      return amp.join(", ").replace(extraSpaceRegex, " ");
    }
    function removeElement(el) {
      if (!el)
        return;
      const parentElement = el.parentElement;
      if (parentElement)
        parentElement.removeChild(el);
    }
    function queryElement(id, parent) {
      return (parent !== null && parent !== void 0 ? parent : document.head).querySelector(`style[cssr-id="${id}"]`);
    }
    function createElement(id) {
      const el = document.createElement("style");
      el.setAttribute("cssr-id", id);
      return el;
    }
    function isMediaOrSupports(selector) {
      if (!selector)
        return false;
      return /^\s*@(s|m)/.test(selector);
    }
    const kebabRegex = /[A-Z]/g;
    function kebabCase$1(pattern) {
      return pattern.replace(kebabRegex, (match2) => "-" + match2.toLowerCase());
    }
    function unwrapProperty(prop, indent = "  ") {
      if (typeof prop === "object" && prop !== null) {
        return " {\n" + Object.entries(prop).map((v) => {
          return indent + `  ${kebabCase$1(v[0])}: ${v[1]};`;
        }).join("\n") + "\n" + indent + "}";
      }
      return `: ${prop};`;
    }
    function unwrapProperties(props, instance, params) {
      if (typeof props === "function") {
        return props({
          context: instance.context,
          props: params
        });
      }
      return props;
    }
    function createStyle(selector, props, instance, params) {
      if (!props)
        return "";
      const unwrappedProps = unwrapProperties(props, instance, params);
      if (!unwrappedProps)
        return "";
      if (typeof unwrappedProps === "string") {
        return `${selector} {
${unwrappedProps}
}`;
      }
      const propertyNames = Object.keys(unwrappedProps);
      if (propertyNames.length === 0) {
        if (instance.config.keepEmptyBlock)
          return selector + " {\n}";
        return "";
      }
      const statements = selector ? [
        selector + " {"
      ] : [];
      propertyNames.forEach((propertyName) => {
        const property2 = unwrappedProps[propertyName];
        if (propertyName === "raw") {
          statements.push("\n" + property2 + "\n");
          return;
        }
        propertyName = kebabCase$1(propertyName);
        if (property2 !== null && property2 !== void 0) {
          statements.push(`  ${propertyName}${unwrapProperty(property2)}`);
        }
      });
      if (selector) {
        statements.push("}");
      }
      return statements.join("\n");
    }
    function loopCNodeListWithCallback(children, options, callback) {
      if (!children)
        return;
      children.forEach((child) => {
        if (Array.isArray(child)) {
          loopCNodeListWithCallback(child, options, callback);
        } else if (typeof child === "function") {
          const grandChildren = child(options);
          if (Array.isArray(grandChildren)) {
            loopCNodeListWithCallback(grandChildren, options, callback);
          } else if (grandChildren) {
            callback(grandChildren);
          }
        } else if (child) {
          callback(child);
        }
      });
    }
    function traverseCNode(node, selectorPaths, styles2, instance, params) {
      const $ = node.$;
      let blockSelector = "";
      if (!$ || typeof $ === "string") {
        if (isMediaOrSupports($)) {
          blockSelector = $;
        } else {
          selectorPaths.push($);
        }
      } else if (typeof $ === "function") {
        const selector2 = $({
          context: instance.context,
          props: params
        });
        if (isMediaOrSupports(selector2)) {
          blockSelector = selector2;
        } else {
          selectorPaths.push(selector2);
        }
      } else {
        if ($.before)
          $.before(instance.context);
        if (!$.$ || typeof $.$ === "string") {
          if (isMediaOrSupports($.$)) {
            blockSelector = $.$;
          } else {
            selectorPaths.push($.$);
          }
        } else if ($.$) {
          const selector2 = $.$({
            context: instance.context,
            props: params
          });
          if (isMediaOrSupports(selector2)) {
            blockSelector = selector2;
          } else {
            selectorPaths.push(selector2);
          }
        }
      }
      const selector = parseSelectorPath(selectorPaths);
      const style2 = createStyle(selector, node.props, instance, params);
      if (blockSelector) {
        styles2.push(`${blockSelector} {`);
      } else if (style2.length) {
        styles2.push(style2);
      }
      if (node.children) {
        loopCNodeListWithCallback(node.children, {
          context: instance.context,
          props: params
        }, (childNode) => {
          if (typeof childNode === "string") {
            const style3 = createStyle(selector, { raw: childNode }, instance, params);
            styles2.push(style3);
          } else {
            traverseCNode(childNode, selectorPaths, styles2, instance, params);
          }
        });
      }
      selectorPaths.pop();
      if (blockSelector) {
        styles2.push("}");
      }
      if ($ && $.after)
        $.after(instance.context);
    }
    function render(node, instance, props) {
      const styles2 = [];
      traverseCNode(node, [], styles2, instance, props);
      return styles2.join("\n\n");
    }
    function murmur2(str) {
      var h2 = 0;
      var k, i = 0, len2 = str.length;
      for (; len2 >= 4; ++i, len2 -= 4) {
        k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
        k = /* Math.imul(k, m): */
        (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
        k ^= /* k >>> r: */
        k >>> 24;
        h2 = /* Math.imul(k, m): */
        (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
        (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
      }
      switch (len2) {
        case 3:
          h2 ^= (str.charCodeAt(i + 2) & 255) << 16;
        case 2:
          h2 ^= (str.charCodeAt(i + 1) & 255) << 8;
        case 1:
          h2 ^= str.charCodeAt(i) & 255;
          h2 = /* Math.imul(h, m): */
          (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
      }
      h2 ^= h2 >>> 13;
      h2 = /* Math.imul(h, m): */
      (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
      return ((h2 ^ h2 >>> 15) >>> 0).toString(36);
    }
    if (typeof window !== "undefined") {
      window.__cssrContext = {};
    }
    function unmount(instance, node, id, parent) {
      const { els } = node;
      if (id === void 0) {
        els.forEach(removeElement);
        node.els = [];
      } else {
        const target = queryElement(id, parent);
        if (target && els.includes(target)) {
          removeElement(target);
          node.els = els.filter((el) => el !== target);
        }
      }
    }
    function addElementToList(els, target) {
      els.push(target);
    }
    function mount(instance, node, id, props, head, force, anchorMetaName, parent, ssrAdapter2) {
      let style2;
      if (id === void 0) {
        style2 = node.render(props);
        id = murmur2(style2);
      }
      if (ssrAdapter2) {
        ssrAdapter2.adapter(id, style2 !== null && style2 !== void 0 ? style2 : node.render(props));
        return;
      }
      if (parent === void 0) {
        parent = document.head;
      }
      const queriedTarget = queryElement(id, parent);
      if (queriedTarget !== null && !force) {
        return queriedTarget;
      }
      const target = queriedTarget !== null && queriedTarget !== void 0 ? queriedTarget : createElement(id);
      if (style2 === void 0)
        style2 = node.render(props);
      target.textContent = style2;
      if (queriedTarget !== null)
        return queriedTarget;
      if (anchorMetaName) {
        const anchorMetaEl = parent.querySelector(`meta[name="${anchorMetaName}"]`);
        if (anchorMetaEl) {
          parent.insertBefore(target, anchorMetaEl);
          addElementToList(node.els, target);
          return target;
        }
      }
      if (head) {
        parent.insertBefore(target, parent.querySelector("style, link"));
      } else {
        parent.appendChild(target);
      }
      addElementToList(node.els, target);
      return target;
    }
    function wrappedRender(props) {
      return render(this, this.instance, props);
    }
    function wrappedMount(options = {}) {
      const { id, ssr, props, head = false, force = false, anchorMetaName, parent } = options;
      const targetElement = mount(this.instance, this, id, props, head, force, anchorMetaName, parent, ssr);
      return targetElement;
    }
    function wrappedUnmount(options = {}) {
      const { id, parent } = options;
      unmount(this.instance, this, id, parent);
    }
    const createCNode = function(instance, $, props, children) {
      return {
        instance,
        $,
        props,
        children,
        els: [],
        render: wrappedRender,
        mount: wrappedMount,
        unmount: wrappedUnmount
      };
    };
    const c$2 = function(instance, $, props, children) {
      if (Array.isArray($)) {
        return createCNode(instance, { $: null }, null, $);
      } else if (Array.isArray(props)) {
        return createCNode(instance, $, null, props);
      } else if (Array.isArray(children)) {
        return createCNode(instance, $, props, children);
      } else {
        return createCNode(instance, $, props, null);
      }
    };
    function CssRender(config = {}) {
      const cssr2 = {
        c: (...args) => c$2(cssr2, ...args),
        use: (plugin2, ...args) => plugin2.install(cssr2, ...args),
        find: queryElement,
        context: {},
        config
      };
      return cssr2;
    }
    function exists(id, ssr) {
      if (id === void 0)
        return false;
      if (ssr) {
        const { context: { ids } } = ssr;
        return ids.has(id);
      }
      return queryElement(id) !== null;
    }
    function plugin$1(options) {
      let _bPrefix = ".";
      let _ePrefix = "__";
      let _mPrefix = "--";
      let c2;
      if (options) {
        let t = options.blockPrefix;
        if (t) {
          _bPrefix = t;
        }
        t = options.elementPrefix;
        if (t) {
          _ePrefix = t;
        }
        t = options.modifierPrefix;
        if (t) {
          _mPrefix = t;
        }
      }
      const _plugin = {
        install(instance) {
          c2 = instance.c;
          const ctx2 = instance.context;
          ctx2.bem = {};
          ctx2.bem.b = null;
          ctx2.bem.els = null;
        }
      };
      function b(arg) {
        let memorizedB;
        let memorizedE;
        return {
          before(ctx2) {
            memorizedB = ctx2.bem.b;
            memorizedE = ctx2.bem.els;
            ctx2.bem.els = null;
          },
          after(ctx2) {
            ctx2.bem.b = memorizedB;
            ctx2.bem.els = memorizedE;
          },
          $({ context, props }) {
            arg = typeof arg === "string" ? arg : arg({ context, props });
            context.bem.b = arg;
            return `${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}`;
          }
        };
      }
      function e(arg) {
        let memorizedE;
        return {
          before(ctx2) {
            memorizedE = ctx2.bem.els;
          },
          after(ctx2) {
            ctx2.bem.els = memorizedE;
          },
          $({ context, props }) {
            arg = typeof arg === "string" ? arg : arg({ context, props });
            context.bem.els = arg.split(",").map((v) => v.trim());
            return context.bem.els.map((el) => `${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}${_ePrefix}${el}`).join(", ");
          }
        };
      }
      function m(arg) {
        return {
          $({ context, props }) {
            arg = typeof arg === "string" ? arg : arg({ context, props });
            const modifiers = arg.split(",").map((v) => v.trim());
            function elementToSelector(el) {
              return modifiers.map((modifier) => `&${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}${el !== void 0 ? `${_ePrefix}${el}` : ""}${_mPrefix}${modifier}`).join(", ");
            }
            const els = context.bem.els;
            if (els !== null) {
              return elementToSelector(els[0]);
            } else {
              return elementToSelector();
            }
          }
        };
      }
      function notM(arg) {
        return {
          $({ context, props }) {
            arg = typeof arg === "string" ? arg : arg({ context, props });
            const els = context.bem.els;
            return `&:not(${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}${els !== null && els.length > 0 ? `${_ePrefix}${els[0]}` : ""}${_mPrefix}${arg})`;
          }
        };
      }
      const cB2 = (...args) => c2(b(args[0]), args[1], args[2]);
      const cE2 = (...args) => c2(e(args[0]), args[1], args[2]);
      const cM2 = (...args) => c2(m(args[0]), args[1], args[2]);
      const cNotM2 = (...args) => c2(notM(args[0]), args[1], args[2]);
      Object.assign(_plugin, {
        cB: cB2,
        cE: cE2,
        cM: cM2,
        cNotM: cNotM2
      });
      return _plugin;
    }
    const namespace = "n";
    const prefix = `.${namespace}-`;
    const elementPrefix = "__";
    const modifierPrefix = "--";
    const cssr = CssRender();
    const plugin = plugin$1({
      blockPrefix: prefix,
      elementPrefix,
      modifierPrefix
    });
    cssr.use(plugin);
    const {
      c: c$1,
      find
    } = cssr;
    const {
      cB,
      cE,
      cM,
      cNotM
    } = plugin;
    function insideModal(style2) {
      return c$1(({
        props: {
          bPrefix
        }
      }) => `${bPrefix || prefix}modal, ${bPrefix || prefix}drawer`, [style2]);
    }
    function insidePopover(style2) {
      return c$1(({
        props: {
          bPrefix
        }
      }) => `${bPrefix || prefix}popover`, [style2]);
    }
    function asModal(style2) {
      return c$1(({
        props: {
          bPrefix
        }
      }) => `&${bPrefix || prefix}modal`, style2);
    }
    const cCB = (...args) => {
      return c$1(">", [cB(...args)]);
    };
    function createKey(prefix2, suffix2) {
      return prefix2 + (suffix2 === "default" ? "" : suffix2.replace(/^[a-z]/, (startChar) => startChar.toUpperCase()));
    }
    let _isJsdom;
    function isJsdom() {
      if (_isJsdom === void 0) {
        _isJsdom = navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom");
      }
      return _isJsdom;
    }
    const isBrowser$2 = typeof document !== "undefined" && typeof window !== "undefined";
    const eventSet = /* @__PURE__ */ new WeakSet();
    function markEventEffectPerformed(event) {
      eventSet.add(event);
    }
    function eventEffectNotPerformed(event) {
      return !eventSet.has(event);
    }
    function useFalseUntilTruthy(originalRef) {
      const currentRef = ref(!!originalRef.value);
      if (currentRef.value)
        return readonly(currentRef);
      const stop = watch(originalRef, (value) => {
        if (value) {
          currentRef.value = true;
          stop();
        }
      });
      return readonly(currentRef);
    }
    function useMemo(getterOrOptions) {
      const computedValueRef = computed(getterOrOptions);
      const valueRef = ref(computedValueRef.value);
      watch(computedValueRef, (value) => {
        valueRef.value = value;
      });
      if (typeof getterOrOptions === "function") {
        return valueRef;
      } else {
        return {
          __v_isRef: true,
          get value() {
            return valueRef.value;
          },
          set value(v) {
            getterOrOptions.set(v);
          }
        };
      }
    }
    function hasInstance() {
      return getCurrentInstance() !== null;
    }
    const isBrowser$1 = typeof window !== "undefined";
    let fontsReady;
    let isFontReady;
    const init$1 = () => {
      var _a, _b;
      fontsReady = isBrowser$1 ? (_b = (_a = document) === null || _a === void 0 ? void 0 : _a.fonts) === null || _b === void 0 ? void 0 : _b.ready : void 0;
      isFontReady = false;
      if (fontsReady !== void 0) {
        void fontsReady.then(() => {
          isFontReady = true;
        });
      } else {
        isFontReady = true;
      }
    };
    init$1();
    function onFontsReady(cb) {
      if (isFontReady)
        return;
      let deactivated = false;
      onMounted(() => {
        if (!isFontReady) {
          fontsReady === null || fontsReady === void 0 ? void 0 : fontsReady.then(() => {
            if (deactivated)
              return;
            cb();
          });
        }
      });
      onBeforeUnmount(() => {
        deactivated = true;
      });
    }
    function getEventTarget(e) {
      const path = e.composedPath();
      return path[0];
    }
    const traps = {
      mousemoveoutside: /* @__PURE__ */ new WeakMap(),
      clickoutside: /* @__PURE__ */ new WeakMap()
    };
    function createTrapHandler(name, el, originalHandler) {
      if (name === "mousemoveoutside") {
        const moveHandler = (e) => {
          if (el.contains(getEventTarget(e)))
            return;
          originalHandler(e);
        };
        return {
          mousemove: moveHandler,
          touchstart: moveHandler
        };
      } else if (name === "clickoutside") {
        let mouseDownOutside = false;
        const downHandler = (e) => {
          mouseDownOutside = !el.contains(getEventTarget(e));
        };
        const upHanlder = (e) => {
          if (!mouseDownOutside)
            return;
          if (el.contains(getEventTarget(e)))
            return;
          originalHandler(e);
        };
        return {
          mousedown: downHandler,
          mouseup: upHanlder,
          touchstart: downHandler,
          touchend: upHanlder
        };
      }
      console.error(
        // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
        `[evtd/create-trap-handler]: name \`${name}\` is invalid. This could be a bug of evtd.`
      );
      return {};
    }
    function ensureTrapHandlers(name, el, handler) {
      const handlers = traps[name];
      let elHandlers = handlers.get(el);
      if (elHandlers === void 0) {
        handlers.set(el, elHandlers = /* @__PURE__ */ new WeakMap());
      }
      let trapHandler = elHandlers.get(handler);
      if (trapHandler === void 0) {
        elHandlers.set(handler, trapHandler = createTrapHandler(name, el, handler));
      }
      return trapHandler;
    }
    function trapOn(name, el, handler, options) {
      if (name === "mousemoveoutside" || name === "clickoutside") {
        const trapHandlers = ensureTrapHandlers(name, el, handler);
        Object.keys(trapHandlers).forEach((key) => {
          on(key, document, trapHandlers[key], options);
        });
        return true;
      }
      return false;
    }
    function trapOff(name, el, handler, options) {
      if (name === "mousemoveoutside" || name === "clickoutside") {
        const trapHandlers = ensureTrapHandlers(name, el, handler);
        Object.keys(trapHandlers).forEach((key) => {
          off(key, document, trapHandlers[key], options);
        });
        return true;
      }
      return false;
    }
    function createDelegate() {
      if (typeof window === "undefined") {
        return {
          on: () => {
          },
          off: () => {
          }
        };
      }
      const propagationStopped = /* @__PURE__ */ new WeakMap();
      const immediatePropagationStopped = /* @__PURE__ */ new WeakMap();
      function trackPropagation() {
        propagationStopped.set(this, true);
      }
      function trackImmediate() {
        propagationStopped.set(this, true);
        immediatePropagationStopped.set(this, true);
      }
      function spy(event, propName, fn) {
        const source = event[propName];
        event[propName] = function() {
          fn.apply(event, arguments);
          return source.apply(event, arguments);
        };
        return event;
      }
      function unspy(event, propName) {
        event[propName] = Event.prototype[propName];
      }
      const currentTargets = /* @__PURE__ */ new WeakMap();
      const currentTargetDescriptor = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget");
      function getCurrentTarget() {
        var _a;
        return (_a = currentTargets.get(this)) !== null && _a !== void 0 ? _a : null;
      }
      function defineCurrentTarget(event, getter) {
        if (currentTargetDescriptor === void 0)
          return;
        Object.defineProperty(event, "currentTarget", {
          configurable: true,
          enumerable: true,
          get: getter !== null && getter !== void 0 ? getter : currentTargetDescriptor.get
        });
      }
      const phaseToTypeToElToHandlers = {
        bubble: {},
        capture: {}
      };
      const typeToWindowEventHandlers = {};
      function createUnifiedHandler() {
        const delegeteHandler = function(e) {
          const { type, eventPhase, bubbles } = e;
          const target = getEventTarget(e);
          if (eventPhase === 2)
            return;
          const phase = eventPhase === 1 ? "capture" : "bubble";
          let cursor = target;
          const path = [];
          while (true) {
            if (cursor === null)
              cursor = window;
            path.push(cursor);
            if (cursor === window) {
              break;
            }
            cursor = cursor.parentNode || null;
          }
          const captureElToHandlers = phaseToTypeToElToHandlers.capture[type];
          const bubbleElToHandlers = phaseToTypeToElToHandlers.bubble[type];
          spy(e, "stopPropagation", trackPropagation);
          spy(e, "stopImmediatePropagation", trackImmediate);
          defineCurrentTarget(e, getCurrentTarget);
          if (phase === "capture") {
            if (captureElToHandlers === void 0)
              return;
            for (let i = path.length - 1; i >= 0; --i) {
              if (propagationStopped.has(e))
                break;
              const target2 = path[i];
              const handlers = captureElToHandlers.get(target2);
              if (handlers !== void 0) {
                currentTargets.set(e, target2);
                for (const handler of handlers) {
                  if (immediatePropagationStopped.has(e))
                    break;
                  handler(e);
                }
              }
              if (i === 0 && !bubbles && bubbleElToHandlers !== void 0) {
                const bubbleHandlers = bubbleElToHandlers.get(target2);
                if (bubbleHandlers !== void 0) {
                  for (const handler of bubbleHandlers) {
                    if (immediatePropagationStopped.has(e))
                      break;
                    handler(e);
                  }
                }
              }
            }
          } else if (phase === "bubble") {
            if (bubbleElToHandlers === void 0)
              return;
            for (let i = 0; i < path.length; ++i) {
              if (propagationStopped.has(e))
                break;
              const target2 = path[i];
              const handlers = bubbleElToHandlers.get(target2);
              if (handlers !== void 0) {
                currentTargets.set(e, target2);
                for (const handler of handlers) {
                  if (immediatePropagationStopped.has(e))
                    break;
                  handler(e);
                }
              }
            }
          }
          unspy(e, "stopPropagation");
          unspy(e, "stopImmediatePropagation");
          defineCurrentTarget(e);
        };
        delegeteHandler.displayName = "evtdUnifiedHandler";
        return delegeteHandler;
      }
      function createUnifiedWindowEventHandler() {
        const delegateHandler = function(e) {
          const { type, eventPhase } = e;
          if (eventPhase !== 2)
            return;
          const handlers = typeToWindowEventHandlers[type];
          if (handlers === void 0)
            return;
          handlers.forEach((handler) => handler(e));
        };
        delegateHandler.displayName = "evtdUnifiedWindowEventHandler";
        return delegateHandler;
      }
      const unifiedHandler = createUnifiedHandler();
      const unfiendWindowEventHandler = createUnifiedWindowEventHandler();
      function ensureElToHandlers(phase, type) {
        const phaseHandlers = phaseToTypeToElToHandlers[phase];
        if (phaseHandlers[type] === void 0) {
          phaseHandlers[type] = /* @__PURE__ */ new Map();
          window.addEventListener(type, unifiedHandler, phase === "capture");
        }
        return phaseHandlers[type];
      }
      function ensureWindowEventHandlers(type) {
        const windowEventHandlers = typeToWindowEventHandlers[type];
        if (windowEventHandlers === void 0) {
          typeToWindowEventHandlers[type] = /* @__PURE__ */ new Set();
          window.addEventListener(type, unfiendWindowEventHandler);
        }
        return typeToWindowEventHandlers[type];
      }
      function ensureHandlers(elToHandlers, el) {
        let elHandlers = elToHandlers.get(el);
        if (elHandlers === void 0) {
          elToHandlers.set(el, elHandlers = /* @__PURE__ */ new Set());
        }
        return elHandlers;
      }
      function handlerExist(el, phase, type, handler) {
        const elToHandlers = phaseToTypeToElToHandlers[phase][type];
        if (elToHandlers !== void 0) {
          const handlers = elToHandlers.get(el);
          if (handlers !== void 0) {
            if (handlers.has(handler))
              return true;
          }
        }
        return false;
      }
      function windowEventHandlerExist(type, handler) {
        const handlers = typeToWindowEventHandlers[type];
        if (handlers !== void 0) {
          if (handlers.has(handler)) {
            return true;
          }
        }
        return false;
      }
      function on2(type, el, handler, options) {
        let mergedHandler;
        if (typeof options === "object" && options.once === true) {
          mergedHandler = (e) => {
            off2(type, el, mergedHandler, options);
            handler(e);
          };
        } else {
          mergedHandler = handler;
        }
        const trapped = trapOn(type, el, mergedHandler, options);
        if (trapped)
          return;
        const phase = options === true || typeof options === "object" && options.capture === true ? "capture" : "bubble";
        const elToHandlers = ensureElToHandlers(phase, type);
        const handlers = ensureHandlers(elToHandlers, el);
        if (!handlers.has(mergedHandler))
          handlers.add(mergedHandler);
        if (el === window) {
          const windowEventHandlers = ensureWindowEventHandlers(type);
          if (!windowEventHandlers.has(mergedHandler)) {
            windowEventHandlers.add(mergedHandler);
          }
        }
      }
      function off2(type, el, handler, options) {
        const trapped = trapOff(type, el, handler, options);
        if (trapped)
          return;
        const capture = options === true || typeof options === "object" && options.capture === true;
        const phase = capture ? "capture" : "bubble";
        const elToHandlers = ensureElToHandlers(phase, type);
        const handlers = ensureHandlers(elToHandlers, el);
        if (el === window) {
          const mirrorPhase = capture ? "bubble" : "capture";
          if (!handlerExist(el, mirrorPhase, type, handler) && windowEventHandlerExist(type, handler)) {
            const windowEventHandlers = typeToWindowEventHandlers[type];
            windowEventHandlers.delete(handler);
            if (windowEventHandlers.size === 0) {
              window.removeEventListener(type, unfiendWindowEventHandler);
              typeToWindowEventHandlers[type] = void 0;
            }
          }
        }
        if (handlers.has(handler))
          handlers.delete(handler);
        if (handlers.size === 0) {
          elToHandlers.delete(el);
        }
        if (elToHandlers.size === 0) {
          window.removeEventListener(type, unifiedHandler, phase === "capture");
          phaseToTypeToElToHandlers[phase][type] = void 0;
        }
      }
      return {
        on: on2,
        off: off2
      };
    }
    const { on, off } = createDelegate();
    const mousePositionRef = ref(null);
    function clickHandler(e) {
      if (e.clientX > 0 || e.clientY > 0) {
        mousePositionRef.value = {
          x: e.clientX,
          y: e.clientY
        };
      } else {
        const { target } = e;
        if (target instanceof Element) {
          const { left, top, width, height } = target.getBoundingClientRect();
          if (left > 0 || top > 0) {
            mousePositionRef.value = {
              x: left + width / 2,
              y: top + height / 2
            };
          } else {
            mousePositionRef.value = { x: 0, y: 0 };
          }
        } else {
          mousePositionRef.value = null;
        }
      }
    }
    let usedCount$2 = 0;
    let managable$2 = true;
    function useClickPosition() {
      if (!isBrowser$1)
        return readonly(ref(null));
      if (usedCount$2 === 0)
        on("click", document, clickHandler, true);
      const setup = () => {
        usedCount$2 += 1;
      };
      if (managable$2 && (managable$2 = hasInstance())) {
        onBeforeMount(setup);
        onBeforeUnmount(() => {
          usedCount$2 -= 1;
          if (usedCount$2 === 0)
            off("click", document, clickHandler, true);
        });
      } else {
        setup();
      }
      return readonly(mousePositionRef);
    }
    const clickedTimeRef = ref(void 0);
    let usedCount$1 = 0;
    function handleClick() {
      clickedTimeRef.value = Date.now();
    }
    let managable$1 = true;
    function useClicked(timeout) {
      if (!isBrowser$1)
        return readonly(ref(false));
      const clickedRef = ref(false);
      let timerId = null;
      function clearTimer() {
        if (timerId !== null)
          window.clearTimeout(timerId);
      }
      function clickedHandler() {
        clearTimer();
        clickedRef.value = true;
        timerId = window.setTimeout(() => {
          clickedRef.value = false;
        }, timeout);
      }
      if (usedCount$1 === 0) {
        on("click", window, handleClick, true);
      }
      const setup = () => {
        usedCount$1 += 1;
        on("click", window, clickedHandler, true);
      };
      if (managable$1 && (managable$1 = hasInstance())) {
        onBeforeMount(setup);
        onBeforeUnmount(() => {
          usedCount$1 -= 1;
          if (usedCount$1 === 0) {
            off("click", window, handleClick, true);
          }
          off("click", window, clickedHandler, true);
          clearTimer();
        });
      } else {
        setup();
      }
      return readonly(clickedRef);
    }
    let usedCount = 0;
    const supportMatchMedia = typeof window !== "undefined" && window.matchMedia !== void 0;
    const osTheme = ref(null);
    let darkMql;
    let lightMql;
    function handleDarkMqlChange(e) {
      if (e.matches) {
        osTheme.value = "dark";
      }
    }
    function handleLightMqlChange(e) {
      if (e.matches) {
        osTheme.value = "light";
      }
    }
    function init() {
      darkMql = window.matchMedia("(prefers-color-scheme: dark)");
      lightMql = window.matchMedia("(prefers-color-scheme: light)");
      if (darkMql.matches) {
        osTheme.value = "dark";
      } else if (lightMql.matches) {
        osTheme.value = "light";
      } else {
        osTheme.value = null;
      }
      if (darkMql.addEventListener) {
        darkMql.addEventListener("change", handleDarkMqlChange);
        lightMql.addEventListener("change", handleLightMqlChange);
      } else if (darkMql.addListener) {
        darkMql.addListener(handleDarkMqlChange);
        lightMql.addListener(handleLightMqlChange);
      }
    }
    function clean() {
      if ("removeEventListener" in darkMql) {
        darkMql.removeEventListener("change", handleDarkMqlChange);
        lightMql.removeEventListener("change", handleLightMqlChange);
      } else if ("removeListener" in darkMql) {
        darkMql.removeListener(handleDarkMqlChange);
        lightMql.removeListener(handleLightMqlChange);
      }
      darkMql = void 0;
      lightMql = void 0;
    }
    let managable = true;
    function useOsTheme() {
      if (!supportMatchMedia) {
        return readonly(osTheme);
      }
      if (usedCount === 0)
        init();
      if (managable && (managable = hasInstance())) {
        onBeforeMount(() => {
          usedCount += 1;
        });
        onBeforeUnmount(() => {
          usedCount -= 1;
          if (usedCount === 0)
            clean();
        });
      }
      return readonly(osTheme);
    }
    function useMergedState(controlledStateRef, uncontrolledStateRef) {
      watch(controlledStateRef, (value) => {
        if (value !== void 0) {
          uncontrolledStateRef.value = value;
        }
      });
      return computed(() => {
        if (controlledStateRef.value === void 0) {
          return uncontrolledStateRef.value;
        }
        return controlledStateRef.value;
      });
    }
    function isMounted() {
      const isMounted2 = ref(false);
      onMounted(() => {
        isMounted2.value = true;
      });
      return readonly(isMounted2);
    }
    function useCompitable(reactive2, keys2) {
      return computed(() => {
        for (const key of keys2) {
          if (reactive2[key] !== void 0)
            return reactive2[key];
        }
        return reactive2[keys2[keys2.length - 1]];
      });
    }
    const isIos = (typeof window === "undefined" ? false : /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
    !window.MSStream;
    function useIsIos() {
      return isIos;
    }
    const internalSelectionMenuInjectionKey = createInjectionKey("n-internal-select-menu");
    const internalSelectionMenuBodyInjectionKey = createInjectionKey("n-internal-select-menu-body");
    const modalBodyInjectionKey = createInjectionKey("n-modal-body");
    const modalProviderInjectionKey = createInjectionKey("n-modal-provider");
    const modalInjectionKey = createInjectionKey("n-modal");
    const drawerBodyInjectionKey = createInjectionKey("n-drawer-body");
    const drawerInjectionKey = createInjectionKey("n-drawer");
    const popoverBodyInjectionKey = createInjectionKey("n-popover-body");
    const teleportDisabled = "__disabled__";
    function useAdjustedTo(props) {
      const modal = inject(modalBodyInjectionKey, null);
      const drawer = inject(drawerBodyInjectionKey, null);
      const popover = inject(popoverBodyInjectionKey, null);
      const selectMenu = inject(internalSelectionMenuBodyInjectionKey, null);
      const fullscreenElementRef = ref();
      if (typeof document !== "undefined") {
        fullscreenElementRef.value = document.fullscreenElement;
        const handleFullscreenChange = () => {
          fullscreenElementRef.value = document.fullscreenElement;
        };
        onMounted(() => {
          on("fullscreenchange", document, handleFullscreenChange);
        });
        onBeforeUnmount(() => {
          off("fullscreenchange", document, handleFullscreenChange);
        });
      }
      return useMemo(() => {
        var _a;
        const {
          to
        } = props;
        if (to !== void 0) {
          if (to === false) return teleportDisabled;
          if (to === true) return fullscreenElementRef.value || "body";
          return to;
        }
        if (modal === null || modal === void 0 ? void 0 : modal.value) {
          return (_a = modal.value.$el) !== null && _a !== void 0 ? _a : modal.value;
        }
        if (drawer === null || drawer === void 0 ? void 0 : drawer.value) return drawer.value;
        if (popover === null || popover === void 0 ? void 0 : popover.value) return popover.value;
        if (selectMenu === null || selectMenu === void 0 ? void 0 : selectMenu.value) return selectMenu.value;
        return to !== null && to !== void 0 ? to : fullscreenElementRef.value || "body";
      });
    }
    useAdjustedTo.tdkey = teleportDisabled;
    useAdjustedTo.propTo = {
      type: [String, Object, Boolean],
      default: void 0
    };
    function getSlot(scope, slots, slotName = "default") {
      const slot = slots[slotName];
      if (slot === void 0) {
        throw new Error(`[vueuc/${scope}]: slot[${slotName}] is empty.`);
      }
      return slot();
    }
    function flatten$1(vNodes, filterCommentNode = true, result = []) {
      vNodes.forEach((vNode) => {
        if (vNode === null)
          return;
        if (typeof vNode !== "object") {
          if (typeof vNode === "string" || typeof vNode === "number") {
            result.push(createTextVNode(String(vNode)));
          }
          return;
        }
        if (Array.isArray(vNode)) {
          flatten$1(vNode, filterCommentNode, result);
          return;
        }
        if (vNode.type === Fragment) {
          if (vNode.children === null)
            return;
          if (Array.isArray(vNode.children)) {
            flatten$1(vNode.children, filterCommentNode, result);
          }
        } else if (vNode.type !== Comment) {
          result.push(vNode);
        }
      });
      return result;
    }
    function getFirstVNode(scope, slots, slotName = "default") {
      const slot = slots[slotName];
      if (slot === void 0) {
        throw new Error(`[vueuc/${scope}]: slot[${slotName}] is empty.`);
      }
      const content = flatten$1(slot());
      if (content.length === 1) {
        return content[0];
      } else {
        throw new Error(`[vueuc/${scope}]: slot[${slotName}] should have exactly one child.`);
      }
    }
    let viewMeasurer = null;
    function ensureViewBoundingRect() {
      if (viewMeasurer === null) {
        viewMeasurer = document.getElementById("v-binder-view-measurer");
        if (viewMeasurer === null) {
          viewMeasurer = document.createElement("div");
          viewMeasurer.id = "v-binder-view-measurer";
          const { style: style2 } = viewMeasurer;
          style2.position = "fixed";
          style2.left = "0";
          style2.right = "0";
          style2.top = "0";
          style2.bottom = "0";
          style2.pointerEvents = "none";
          style2.visibility = "hidden";
          document.body.appendChild(viewMeasurer);
        }
      }
      return viewMeasurer.getBoundingClientRect();
    }
    function getPointRect(x, y) {
      const viewRect = ensureViewBoundingRect();
      return {
        top: y,
        left: x,
        height: 0,
        width: 0,
        right: viewRect.width - x,
        bottom: viewRect.height - y
      };
    }
    function getRect(el) {
      const elRect = el.getBoundingClientRect();
      const viewRect = ensureViewBoundingRect();
      return {
        left: elRect.left - viewRect.left,
        top: elRect.top - viewRect.top,
        bottom: viewRect.height + viewRect.top - elRect.bottom,
        right: viewRect.width + viewRect.left - elRect.right,
        width: elRect.width,
        height: elRect.height
      };
    }
    function getParentNode(node) {
      if (node.nodeType === 9) {
        return null;
      }
      return node.parentNode;
    }
    function getScrollParent(node) {
      if (node === null)
        return null;
      const parentNode = getParentNode(node);
      if (parentNode === null) {
        return null;
      }
      if (parentNode.nodeType === 9) {
        return document;
      }
      if (parentNode.nodeType === 1) {
        const { overflow, overflowX, overflowY } = getComputedStyle(parentNode);
        if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
          return parentNode;
        }
      }
      return getScrollParent(parentNode);
    }
    const Binder = /* @__PURE__ */ defineComponent({
      name: "Binder",
      props: {
        syncTargetWithParent: Boolean,
        syncTarget: {
          type: Boolean,
          default: true
        }
      },
      setup(props) {
        var _a;
        provide("VBinder", (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy);
        const VBinder = inject("VBinder", null);
        const targetRef = ref(null);
        const setTargetRef = (el) => {
          targetRef.value = el;
          if (VBinder && props.syncTargetWithParent) {
            VBinder.setTargetRef(el);
          }
        };
        let scrollableNodes = [];
        const ensureScrollListener = () => {
          let cursor = targetRef.value;
          while (true) {
            cursor = getScrollParent(cursor);
            if (cursor === null)
              break;
            scrollableNodes.push(cursor);
          }
          for (const el of scrollableNodes) {
            on("scroll", el, onScroll, true);
          }
        };
        const removeScrollListeners = () => {
          for (const el of scrollableNodes) {
            off("scroll", el, onScroll, true);
          }
          scrollableNodes = [];
        };
        const followerScrollListeners = /* @__PURE__ */ new Set();
        const addScrollListener = (listener) => {
          if (followerScrollListeners.size === 0) {
            ensureScrollListener();
          }
          if (!followerScrollListeners.has(listener)) {
            followerScrollListeners.add(listener);
          }
        };
        const removeScrollListener = (listener) => {
          if (followerScrollListeners.has(listener)) {
            followerScrollListeners.delete(listener);
          }
          if (followerScrollListeners.size === 0) {
            removeScrollListeners();
          }
        };
        const onScroll = () => {
          beforeNextFrameOnce(onScrollRaf);
        };
        const onScrollRaf = () => {
          followerScrollListeners.forEach((listener) => listener());
        };
        const followerResizeListeners = /* @__PURE__ */ new Set();
        const addResizeListener = (listener) => {
          if (followerResizeListeners.size === 0) {
            on("resize", window, onResize);
          }
          if (!followerResizeListeners.has(listener)) {
            followerResizeListeners.add(listener);
          }
        };
        const removeResizeListener = (listener) => {
          if (followerResizeListeners.has(listener)) {
            followerResizeListeners.delete(listener);
          }
          if (followerResizeListeners.size === 0) {
            off("resize", window, onResize);
          }
        };
        const onResize = () => {
          followerResizeListeners.forEach((listener) => listener());
        };
        onBeforeUnmount(() => {
          off("resize", window, onResize);
          removeScrollListeners();
        });
        return {
          targetRef,
          setTargetRef,
          addScrollListener,
          removeScrollListener,
          addResizeListener,
          removeResizeListener
        };
      },
      render() {
        return getSlot("binder", this.$slots);
      }
    });
    const VTarget = /* @__PURE__ */ defineComponent({
      name: "Target",
      setup() {
        const { setTargetRef, syncTarget } = inject("VBinder");
        const setTargetDirective = {
          mounted: setTargetRef,
          updated: setTargetRef
        };
        return {
          syncTarget,
          setTargetDirective
        };
      },
      render() {
        const { syncTarget, setTargetDirective } = this;
        if (syncTarget) {
          return withDirectives(getFirstVNode("follower", this.$slots), [
            [setTargetDirective]
          ]);
        }
        return getFirstVNode("follower", this.$slots);
      }
    });
    const ctxKey$1 = "@@mmoContext";
    const mousemoveoutside = {
      mounted(el, { value }) {
        el[ctxKey$1] = {
          handler: void 0
        };
        if (typeof value === "function") {
          el[ctxKey$1].handler = value;
          on("mousemoveoutside", el, value);
        }
      },
      updated(el, { value }) {
        const ctx2 = el[ctxKey$1];
        if (typeof value === "function") {
          if (ctx2.handler) {
            if (ctx2.handler !== value) {
              off("mousemoveoutside", el, ctx2.handler);
              ctx2.handler = value;
              on("mousemoveoutside", el, value);
            }
          } else {
            el[ctxKey$1].handler = value;
            on("mousemoveoutside", el, value);
          }
        } else {
          if (ctx2.handler) {
            off("mousemoveoutside", el, ctx2.handler);
            ctx2.handler = void 0;
          }
        }
      },
      unmounted(el) {
        const { handler } = el[ctxKey$1];
        if (handler) {
          off("mousemoveoutside", el, handler);
        }
        el[ctxKey$1].handler = void 0;
      }
    };
    const ctxKey = "@@coContext";
    const clickoutside = {
      mounted(el, { value, modifiers }) {
        el[ctxKey] = {
          handler: void 0
        };
        if (typeof value === "function") {
          el[ctxKey].handler = value;
          on("clickoutside", el, value, {
            capture: modifiers.capture
          });
        }
      },
      updated(el, { value, modifiers }) {
        const ctx2 = el[ctxKey];
        if (typeof value === "function") {
          if (ctx2.handler) {
            if (ctx2.handler !== value) {
              off("clickoutside", el, ctx2.handler, {
                capture: modifiers.capture
              });
              ctx2.handler = value;
              on("clickoutside", el, value, {
                capture: modifiers.capture
              });
            }
          } else {
            el[ctxKey].handler = value;
            on("clickoutside", el, value, {
              capture: modifiers.capture
            });
          }
        } else {
          if (ctx2.handler) {
            off("clickoutside", el, ctx2.handler, {
              capture: modifiers.capture
            });
            ctx2.handler = void 0;
          }
        }
      },
      unmounted(el, { modifiers }) {
        const { handler } = el[ctxKey];
        if (handler) {
          off("clickoutside", el, handler, {
            capture: modifiers.capture
          });
        }
        el[ctxKey].handler = void 0;
      }
    };
    function warn$2(location2, message) {
      console.error(`[vdirs/${location2}]: ${message}`);
    }
    class ZIndexManager {
      constructor() {
        this.elementZIndex = /* @__PURE__ */ new Map();
        this.nextZIndex = 2e3;
      }
      get elementCount() {
        return this.elementZIndex.size;
      }
      ensureZIndex(el, zIndex) {
        const { elementZIndex } = this;
        if (zIndex !== void 0) {
          el.style.zIndex = `${zIndex}`;
          elementZIndex.delete(el);
          return;
        }
        const { nextZIndex } = this;
        if (elementZIndex.has(el)) {
          const currentZIndex = elementZIndex.get(el);
          if (currentZIndex + 1 === this.nextZIndex)
            return;
        }
        el.style.zIndex = `${nextZIndex}`;
        elementZIndex.set(el, nextZIndex);
        this.nextZIndex = nextZIndex + 1;
        this.squashState();
      }
      unregister(el, zIndex) {
        const { elementZIndex } = this;
        if (elementZIndex.has(el)) {
          elementZIndex.delete(el);
        } else if (zIndex === void 0) {
          warn$2("z-index-manager/unregister-element", "Element not found when unregistering.");
        }
        this.squashState();
      }
      squashState() {
        const { elementCount } = this;
        if (!elementCount) {
          this.nextZIndex = 2e3;
        }
        if (this.nextZIndex - elementCount > 2500)
          this.rearrange();
      }
      rearrange() {
        const elementZIndexPair = Array.from(this.elementZIndex.entries());
        elementZIndexPair.sort((pair1, pair2) => {
          return pair1[1] - pair2[1];
        });
        this.nextZIndex = 2e3;
        elementZIndexPair.forEach((pair) => {
          const el = pair[0];
          const zIndex = this.nextZIndex++;
          if (`${zIndex}` !== el.style.zIndex)
            el.style.zIndex = `${zIndex}`;
        });
      }
    }
    const zIndexManager = new ZIndexManager();
    const ctx = "@@ziContext";
    const zindexable = {
      mounted(el, bindings) {
        const { value = {} } = bindings;
        const { zIndex, enabled } = value;
        el[ctx] = {
          enabled: !!enabled,
          initialized: false
        };
        if (enabled) {
          zIndexManager.ensureZIndex(el, zIndex);
          el[ctx].initialized = true;
        }
      },
      updated(el, bindings) {
        const { value = {} } = bindings;
        const { zIndex, enabled } = value;
        const cachedEnabled = el[ctx].enabled;
        if (enabled && !cachedEnabled) {
          zIndexManager.ensureZIndex(el, zIndex);
          el[ctx].initialized = true;
        }
        el[ctx].enabled = !!enabled;
      },
      unmounted(el, bindings) {
        if (!el[ctx].initialized)
          return;
        const { value = {} } = bindings;
        const { zIndex } = value;
        zIndexManager.unregister(el, zIndex);
      }
    };
    const ssrContextKey = "@css-render/vue3-ssr";
    function createStyleString(id, style2) {
      return `<style cssr-id="${id}">
${style2}
</style>`;
    }
    function ssrAdapter(id, style2, ssrContext) {
      const { styles: styles2, ids } = ssrContext;
      if (ids.has(id))
        return;
      if (styles2 !== null) {
        ids.add(id);
        styles2.push(createStyleString(id, style2));
      }
    }
    const isBrowser = typeof document !== "undefined";
    function useSsrAdapter() {
      if (isBrowser)
        return void 0;
      const context = inject(ssrContextKey, null);
      if (context === null)
        return void 0;
      return {
        adapter: (id, style2) => ssrAdapter(id, style2, context),
        context
      };
    }
    function warn$1(location2, message) {
      console.error(`[vueuc/${location2}]: ${message}`);
    }
    const { c } = CssRender();
    const cssrAnchorMetaName$1 = "vueuc-style";
    function lowBit(n) {
      return n & -n;
    }
    class FinweckTree {
      /**
       * @param l length of the array
       * @param min min value of the array
       */
      constructor(l, min) {
        this.l = l;
        this.min = min;
        const ft = new Array(l + 1);
        for (let i = 0; i < l + 1; ++i) {
          ft[i] = 0;
        }
        this.ft = ft;
      }
      /**
       * Add arr[i] by n, start from 0
       * @param i the index of the element to be added
       * @param n the value to be added
       */
      add(i, n) {
        if (n === 0)
          return;
        const { l, ft } = this;
        i += 1;
        while (i <= l) {
          ft[i] += n;
          i += lowBit(i);
        }
      }
      /**
       * Get the value of index i
       * @param i index
       * @returns value of the index
       */
      get(i) {
        return this.sum(i + 1) - this.sum(i);
      }
      /**
       * Get the sum of first i elements
       * @param i count of head elements to be added
       * @returns the sum of first i elements
       */
      sum(i) {
        if (i === void 0)
          i = this.l;
        if (i <= 0)
          return 0;
        const { ft, min, l } = this;
        if (i > l)
          throw new Error("[FinweckTree.sum]: `i` is larger than length.");
        let ret = i * min;
        while (i > 0) {
          ret += ft[i];
          i -= lowBit(i);
        }
        return ret;
      }
      /**
       * Get the largest count of head elements whose sum are <= threshold
       * @param threshold
       * @returns the largest count of head elements whose sum are <= threshold
       */
      getBound(threshold) {
        let l = 0;
        let r = this.l;
        while (r > l) {
          const m = Math.floor((l + r) / 2);
          const sumM = this.sum(m);
          if (sumM > threshold) {
            r = m;
            continue;
          } else if (sumM < threshold) {
            if (l === m) {
              if (this.sum(l + 1) <= threshold)
                return l + 1;
              return m;
            }
            l = m;
          } else {
            return m;
          }
        }
        return l;
      }
    }
    function resolveTo(selector) {
      if (typeof selector === "string") {
        return document.querySelector(selector);
      }
      return selector();
    }
    const LazyTeleport = /* @__PURE__ */ defineComponent({
      name: "LazyTeleport",
      props: {
        to: {
          type: [String, Object],
          default: void 0
        },
        disabled: Boolean,
        show: {
          type: Boolean,
          required: true
        }
      },
      setup(props) {
        return {
          showTeleport: useFalseUntilTruthy(toRef(props, "show")),
          mergedTo: computed(() => {
            const { to } = props;
            return to !== null && to !== void 0 ? to : "body";
          })
        };
      },
      render() {
        return this.showTeleport ? this.disabled ? getSlot("lazy-teleport", this.$slots) : h(Teleport, {
          disabled: this.disabled,
          to: this.mergedTo
        }, getSlot("lazy-teleport", this.$slots)) : null;
      }
    });
    const oppositionPositions = {
      top: "bottom",
      bottom: "top",
      left: "right",
      right: "left"
    };
    const oppositeAligns = {
      start: "end",
      center: "center",
      end: "start"
    };
    const propToCompare = {
      top: "height",
      bottom: "height",
      left: "width",
      right: "width"
    };
    const transformOrigins = {
      "bottom-start": "top left",
      bottom: "top center",
      "bottom-end": "top right",
      "top-start": "bottom left",
      top: "bottom center",
      "top-end": "bottom right",
      "right-start": "top left",
      right: "center left",
      "right-end": "bottom left",
      "left-start": "top right",
      left: "center right",
      "left-end": "bottom right"
    };
    const overlapTransformOrigin = {
      "bottom-start": "bottom left",
      bottom: "bottom center",
      "bottom-end": "bottom right",
      "top-start": "top left",
      top: "top center",
      "top-end": "top right",
      "right-start": "top right",
      right: "center right",
      "right-end": "bottom right",
      "left-start": "top left",
      left: "center left",
      "left-end": "bottom left"
    };
    const oppositeAlignCssPositionProps = {
      "bottom-start": "right",
      "bottom-end": "left",
      "top-start": "right",
      "top-end": "left",
      "right-start": "bottom",
      "right-end": "top",
      "left-start": "bottom",
      "left-end": "top"
    };
    const keepOffsetDirection = {
      top: true,
      bottom: false,
      left: true,
      right: false
      // left--
    };
    const cssPositionToOppositeAlign = {
      top: "end",
      bottom: "start",
      left: "end",
      right: "start"
    };
    function getPlacementAndOffsetOfFollower(placement, targetRect, followerRect, shift, flip, overlap) {
      if (!flip || overlap) {
        return { placement, top: 0, left: 0 };
      }
      const [position, align] = placement.split("-");
      let properAlign = align !== null && align !== void 0 ? align : "center";
      let properOffset = {
        top: 0,
        left: 0
      };
      const deriveOffset = (oppositeAlignCssSizeProp, alignCssPositionProp, offsetVertically2) => {
        let left = 0;
        let top = 0;
        const diff = followerRect[oppositeAlignCssSizeProp] - targetRect[alignCssPositionProp] - targetRect[oppositeAlignCssSizeProp];
        if (diff > 0 && shift) {
          if (offsetVertically2) {
            top = keepOffsetDirection[alignCssPositionProp] ? diff : -diff;
          } else {
            left = keepOffsetDirection[alignCssPositionProp] ? diff : -diff;
          }
        }
        return {
          left,
          top
        };
      };
      const offsetVertically = position === "left" || position === "right";
      if (properAlign !== "center") {
        const oppositeAlignCssPositionProp = oppositeAlignCssPositionProps[placement];
        const currentAlignCssPositionProp = oppositionPositions[oppositeAlignCssPositionProp];
        const oppositeAlignCssSizeProp = propToCompare[oppositeAlignCssPositionProp];
        if (followerRect[oppositeAlignCssSizeProp] > targetRect[oppositeAlignCssSizeProp]) {
          if (
            // current space is not enough
            // ----------[ target ]---------|
            // -------[     follower        ]
            targetRect[oppositeAlignCssPositionProp] + targetRect[oppositeAlignCssSizeProp] < followerRect[oppositeAlignCssSizeProp]
          ) {
            const followerOverTargetSize = (followerRect[oppositeAlignCssSizeProp] - targetRect[oppositeAlignCssSizeProp]) / 2;
            if (targetRect[oppositeAlignCssPositionProp] < followerOverTargetSize || targetRect[currentAlignCssPositionProp] < followerOverTargetSize) {
              if (targetRect[oppositeAlignCssPositionProp] < targetRect[currentAlignCssPositionProp]) {
                properAlign = oppositeAligns[align];
                properOffset = deriveOffset(oppositeAlignCssSizeProp, currentAlignCssPositionProp, offsetVertically);
              } else {
                properOffset = deriveOffset(oppositeAlignCssSizeProp, oppositeAlignCssPositionProp, offsetVertically);
              }
            } else {
              properAlign = "center";
            }
          }
        } else if (followerRect[oppositeAlignCssSizeProp] < targetRect[oppositeAlignCssSizeProp]) {
          if (targetRect[currentAlignCssPositionProp] < 0 && // opposite align has larger space
          // ------------[   target   ]
          // ----------------[follower]
          targetRect[oppositeAlignCssPositionProp] > targetRect[currentAlignCssPositionProp]) {
            properAlign = oppositeAligns[align];
          }
        }
      } else {
        const possibleAlternativeAlignCssPositionProp1 = position === "bottom" || position === "top" ? "left" : "top";
        const possibleAlternativeAlignCssPositionProp2 = oppositionPositions[possibleAlternativeAlignCssPositionProp1];
        const alternativeAlignCssSizeProp = propToCompare[possibleAlternativeAlignCssPositionProp1];
        const followerOverTargetSize = (followerRect[alternativeAlignCssSizeProp] - targetRect[alternativeAlignCssSizeProp]) / 2;
        if (
          // center is not enough
          // ----------- [ target ]--|
          // -------[     follower     ]
          targetRect[possibleAlternativeAlignCssPositionProp1] < followerOverTargetSize || targetRect[possibleAlternativeAlignCssPositionProp2] < followerOverTargetSize
        ) {
          if (targetRect[possibleAlternativeAlignCssPositionProp1] > targetRect[possibleAlternativeAlignCssPositionProp2]) {
            properAlign = cssPositionToOppositeAlign[possibleAlternativeAlignCssPositionProp1];
            properOffset = deriveOffset(alternativeAlignCssSizeProp, possibleAlternativeAlignCssPositionProp1, offsetVertically);
          } else {
            properAlign = cssPositionToOppositeAlign[possibleAlternativeAlignCssPositionProp2];
            properOffset = deriveOffset(alternativeAlignCssSizeProp, possibleAlternativeAlignCssPositionProp2, offsetVertically);
          }
        }
      }
      let properPosition = position;
      if (
        // space is not enough
        targetRect[position] < followerRect[propToCompare[position]] && // opposite position's space is larger
        targetRect[position] < targetRect[oppositionPositions[position]]
      ) {
        properPosition = oppositionPositions[position];
      }
      return {
        placement: properAlign !== "center" ? `${properPosition}-${properAlign}` : properPosition,
        left: properOffset.left,
        top: properOffset.top
      };
    }
    function getProperTransformOrigin(placement, overlap) {
      if (overlap)
        return overlapTransformOrigin[placement];
      return transformOrigins[placement];
    }
    function getOffset(placement, offsetRect, targetRect, offsetTopToStandardPlacement, offsetLeftToStandardPlacement, overlap) {
      if (overlap) {
        switch (placement) {
          case "bottom-start":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left)}px`,
              transform: "translateY(-100%)"
            };
          case "bottom-end":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
              transform: "translateX(-100%) translateY(-100%)"
            };
          case "top-start":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left)}px`,
              transform: ""
            };
          case "top-end":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
              transform: "translateX(-100%)"
            };
          case "right-start":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
              transform: "translateX(-100%)"
            };
          case "right-end":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
              transform: "translateX(-100%) translateY(-100%)"
            };
          case "left-start":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left)}px`,
              transform: ""
            };
          case "left-end":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left)}px`,
              transform: "translateY(-100%)"
            };
          case "top":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width / 2)}px`,
              transform: "translateX(-50%)"
            };
          case "right":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height / 2)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
              transform: "translateX(-100%) translateY(-50%)"
            };
          case "left":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height / 2)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left)}px`,
              transform: "translateY(-50%)"
            };
          case "bottom":
          default:
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width / 2)}px`,
              transform: "translateX(-50%) translateY(-100%)"
            };
        }
      }
      switch (placement) {
        case "bottom-start":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
            transform: ""
          };
        case "bottom-end":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
            transform: "translateX(-100%)"
          };
        case "top-start":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
            transform: "translateY(-100%)"
          };
        case "top-end":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
            transform: "translateX(-100%) translateY(-100%)"
          };
        case "right-start":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
            transform: ""
          };
        case "right-end":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
            transform: "translateY(-100%)"
          };
        case "left-start":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
            transform: "translateX(-100%)"
          };
        case "left-end":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
            transform: "translateX(-100%) translateY(-100%)"
          };
        case "top":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width / 2 + offsetLeftToStandardPlacement)}px`,
            transform: "translateY(-100%) translateX(-50%)"
          };
        case "right":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height / 2 + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
            transform: "translateY(-50%)"
          };
        case "left":
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height / 2 + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
            transform: "translateY(-50%) translateX(-100%)"
          };
        case "bottom":
        default:
          return {
            top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
            left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width / 2 + offsetLeftToStandardPlacement)}px`,
            transform: "translateX(-50%)"
          };
      }
    }
    const style$u = c([
      c(".v-binder-follower-container", {
        position: "absolute",
        left: "0",
        right: "0",
        top: "0",
        height: "0",
        pointerEvents: "none",
        zIndex: "auto"
      }),
      c(".v-binder-follower-content", {
        position: "absolute",
        zIndex: "auto"
      }, [
        c("> *", {
          pointerEvents: "all"
        })
      ])
    ]);
    const VFollower = /* @__PURE__ */ defineComponent({
      name: "Follower",
      inheritAttrs: false,
      props: {
        show: Boolean,
        enabled: {
          type: Boolean,
          default: void 0
        },
        placement: {
          type: String,
          default: "bottom"
        },
        syncTrigger: {
          type: Array,
          default: ["resize", "scroll"]
        },
        to: [String, Object],
        flip: {
          type: Boolean,
          default: true
        },
        internalShift: Boolean,
        x: Number,
        y: Number,
        width: String,
        minWidth: String,
        containerClass: String,
        teleportDisabled: Boolean,
        zindexable: {
          type: Boolean,
          default: true
        },
        zIndex: Number,
        overlap: Boolean
      },
      setup(props) {
        const VBinder = inject("VBinder");
        const mergedEnabledRef = useMemo(() => {
          return props.enabled !== void 0 ? props.enabled : props.show;
        });
        const followerRef = ref(null);
        const offsetContainerRef = ref(null);
        const ensureListeners = () => {
          const { syncTrigger } = props;
          if (syncTrigger.includes("scroll")) {
            VBinder.addScrollListener(syncPosition);
          }
          if (syncTrigger.includes("resize")) {
            VBinder.addResizeListener(syncPosition);
          }
        };
        const removeListeners = () => {
          VBinder.removeScrollListener(syncPosition);
          VBinder.removeResizeListener(syncPosition);
        };
        onMounted(() => {
          if (mergedEnabledRef.value) {
            syncPosition();
            ensureListeners();
          }
        });
        const ssrAdapter2 = useSsrAdapter();
        style$u.mount({
          id: "vueuc/binder",
          head: true,
          anchorMetaName: cssrAnchorMetaName$1,
          ssr: ssrAdapter2
        });
        onBeforeUnmount(() => {
          removeListeners();
        });
        onFontsReady(() => {
          if (mergedEnabledRef.value) {
            syncPosition();
          }
        });
        const syncPosition = () => {
          if (!mergedEnabledRef.value) {
            return;
          }
          const follower = followerRef.value;
          if (follower === null)
            return;
          const target = VBinder.targetRef;
          const { x, y, overlap } = props;
          const targetRect = x !== void 0 && y !== void 0 ? getPointRect(x, y) : getRect(target);
          follower.style.setProperty("--v-target-width", `${Math.round(targetRect.width)}px`);
          follower.style.setProperty("--v-target-height", `${Math.round(targetRect.height)}px`);
          const { width, minWidth, placement, internalShift, flip } = props;
          follower.setAttribute("v-placement", placement);
          if (overlap) {
            follower.setAttribute("v-overlap", "");
          } else {
            follower.removeAttribute("v-overlap");
          }
          const { style: style2 } = follower;
          if (width === "target") {
            style2.width = `${targetRect.width}px`;
          } else if (width !== void 0) {
            style2.width = width;
          } else {
            style2.width = "";
          }
          if (minWidth === "target") {
            style2.minWidth = `${targetRect.width}px`;
          } else if (minWidth !== void 0) {
            style2.minWidth = minWidth;
          } else {
            style2.minWidth = "";
          }
          const followerRect = getRect(follower);
          const offsetContainerRect = getRect(offsetContainerRef.value);
          const { left: offsetLeftToStandardPlacement, top: offsetTopToStandardPlacement, placement: properPlacement } = getPlacementAndOffsetOfFollower(placement, targetRect, followerRect, internalShift, flip, overlap);
          const properTransformOrigin = getProperTransformOrigin(properPlacement, overlap);
          const { left, top, transform: transform2 } = getOffset(properPlacement, offsetContainerRect, targetRect, offsetTopToStandardPlacement, offsetLeftToStandardPlacement, overlap);
          follower.setAttribute("v-placement", properPlacement);
          follower.style.setProperty("--v-offset-left", `${Math.round(offsetLeftToStandardPlacement)}px`);
          follower.style.setProperty("--v-offset-top", `${Math.round(offsetTopToStandardPlacement)}px`);
          follower.style.transform = `translateX(${left}) translateY(${top}) ${transform2}`;
          follower.style.setProperty("--v-transform-origin", properTransformOrigin);
          follower.style.transformOrigin = properTransformOrigin;
        };
        watch(mergedEnabledRef, (value) => {
          if (value) {
            ensureListeners();
            syncOnNextTick();
          } else {
            removeListeners();
          }
        });
        const syncOnNextTick = () => {
          nextTick().then(syncPosition).catch((e) => console.error(e));
        };
        [
          "placement",
          "x",
          "y",
          "internalShift",
          "flip",
          "width",
          "overlap",
          "minWidth"
        ].forEach((prop) => {
          watch(toRef(props, prop), syncPosition);
        });
        ["teleportDisabled"].forEach((prop) => {
          watch(toRef(props, prop), syncOnNextTick);
        });
        watch(toRef(props, "syncTrigger"), (value) => {
          if (!value.includes("resize")) {
            VBinder.removeResizeListener(syncPosition);
          } else {
            VBinder.addResizeListener(syncPosition);
          }
          if (!value.includes("scroll")) {
            VBinder.removeScrollListener(syncPosition);
          } else {
            VBinder.addScrollListener(syncPosition);
          }
        });
        const isMountedRef = isMounted();
        const mergedToRef = useMemo(() => {
          const { to } = props;
          if (to !== void 0)
            return to;
          if (isMountedRef.value) {
            return void 0;
          }
          return void 0;
        });
        return {
          VBinder,
          mergedEnabled: mergedEnabledRef,
          offsetContainerRef,
          followerRef,
          mergedTo: mergedToRef,
          syncPosition
        };
      },
      render() {
        return h(LazyTeleport, {
          show: this.show,
          to: this.mergedTo,
          disabled: this.teleportDisabled
        }, {
          default: () => {
            var _a, _b;
            const vNode = h("div", {
              class: ["v-binder-follower-container", this.containerClass],
              ref: "offsetContainerRef"
            }, [
              h("div", {
                class: "v-binder-follower-content",
                ref: "followerRef"
              }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a))
            ]);
            if (this.zindexable) {
              return withDirectives(vNode, [
                [
                  zindexable,
                  {
                    enabled: this.mergedEnabled,
                    zIndex: this.zIndex
                  }
                ]
              ]);
            }
            return vNode;
          }
        });
      }
    });
    var resizeObservers = [];
    var hasActiveObservations = function() {
      return resizeObservers.some(function(ro) {
        return ro.activeTargets.length > 0;
      });
    };
    var hasSkippedObservations = function() {
      return resizeObservers.some(function(ro) {
        return ro.skippedTargets.length > 0;
      });
    };
    var msg = "ResizeObserver loop completed with undelivered notifications.";
    var deliverResizeLoopError = function() {
      var event;
      if (typeof ErrorEvent === "function") {
        event = new ErrorEvent("error", {
          message: msg
        });
      } else {
        event = document.createEvent("Event");
        event.initEvent("error", false, false);
        event.message = msg;
      }
      window.dispatchEvent(event);
    };
    var ResizeObserverBoxOptions;
    (function(ResizeObserverBoxOptions2) {
      ResizeObserverBoxOptions2["BORDER_BOX"] = "border-box";
      ResizeObserverBoxOptions2["CONTENT_BOX"] = "content-box";
      ResizeObserverBoxOptions2["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box";
    })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));
    var freeze = function(obj) {
      return Object.freeze(obj);
    };
    var ResizeObserverSize = /* @__PURE__ */ function() {
      function ResizeObserverSize2(inlineSize, blockSize) {
        this.inlineSize = inlineSize;
        this.blockSize = blockSize;
        freeze(this);
      }
      return ResizeObserverSize2;
    }();
    var DOMRectReadOnly = function() {
      function DOMRectReadOnly2(x, y, width, height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
        this.top = this.y;
        this.left = this.x;
        this.bottom = this.top + this.height;
        this.right = this.left + this.width;
        return freeze(this);
      }
      DOMRectReadOnly2.prototype.toJSON = function() {
        var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height;
        return { x, y, top, right, bottom, left, width, height };
      };
      DOMRectReadOnly2.fromRect = function(rectangle) {
        return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
      };
      return DOMRectReadOnly2;
    }();
    var isSVG = function(target) {
      return target instanceof SVGElement && "getBBox" in target;
    };
    var isHidden = function(target) {
      if (isSVG(target)) {
        var _a = target.getBBox(), width = _a.width, height = _a.height;
        return !width && !height;
      }
      var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;
      return !(offsetWidth || offsetHeight || target.getClientRects().length);
    };
    var isElement = function(obj) {
      var _a;
      if (obj instanceof Element) {
        return true;
      }
      var scope = (_a = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
      return !!(scope && obj instanceof scope.Element);
    };
    var isReplacedElement = function(target) {
      switch (target.tagName) {
        case "INPUT":
          if (target.type !== "image") {
            break;
          }
        case "VIDEO":
        case "AUDIO":
        case "EMBED":
        case "OBJECT":
        case "CANVAS":
        case "IFRAME":
        case "IMG":
          return true;
      }
      return false;
    };
    var global$1 = typeof window !== "undefined" ? window : {};
    var cache$1 = /* @__PURE__ */ new WeakMap();
    var scrollRegexp = /auto|scroll/;
    var verticalRegexp = /^tb|vertical/;
    var IE = /msie|trident/i.test(global$1.navigator && global$1.navigator.userAgent);
    var parseDimension = function(pixel) {
      return parseFloat(pixel || "0");
    };
    var size = function(inlineSize, blockSize, switchSizes) {
      if (inlineSize === void 0) {
        inlineSize = 0;
      }
      if (blockSize === void 0) {
        blockSize = 0;
      }
      if (switchSizes === void 0) {
        switchSizes = false;
      }
      return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
    };
    var zeroBoxes = freeze({
      devicePixelContentBoxSize: size(),
      borderBoxSize: size(),
      contentBoxSize: size(),
      contentRect: new DOMRectReadOnly(0, 0, 0, 0)
    });
    var calculateBoxSizes = function(target, forceRecalculation) {
      if (forceRecalculation === void 0) {
        forceRecalculation = false;
      }
      if (cache$1.has(target) && !forceRecalculation) {
        return cache$1.get(target);
      }
      if (isHidden(target)) {
        cache$1.set(target, zeroBoxes);
        return zeroBoxes;
      }
      var cs = getComputedStyle(target);
      var svg = isSVG(target) && target.ownerSVGElement && target.getBBox();
      var removePadding = !IE && cs.boxSizing === "border-box";
      var switchSizes = verticalRegexp.test(cs.writingMode || "");
      var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || "");
      var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || "");
      var paddingTop = svg ? 0 : parseDimension(cs.paddingTop);
      var paddingRight = svg ? 0 : parseDimension(cs.paddingRight);
      var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom);
      var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft);
      var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth);
      var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth);
      var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth);
      var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth);
      var horizontalPadding = paddingLeft + paddingRight;
      var verticalPadding = paddingTop + paddingBottom;
      var horizontalBorderArea = borderLeft + borderRight;
      var verticalBorderArea = borderTop + borderBottom;
      var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight;
      var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth;
      var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0;
      var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0;
      var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness;
      var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness;
      var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea;
      var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea;
      var boxes = freeze({
        devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
        borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes),
        contentBoxSize: size(contentWidth, contentHeight, switchSizes),
        contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight)
      });
      cache$1.set(target, boxes);
      return boxes;
    };
    var calculateBoxSize = function(target, observedBox, forceRecalculation) {
      var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize;
      switch (observedBox) {
        case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
          return devicePixelContentBoxSize;
        case ResizeObserverBoxOptions.BORDER_BOX:
          return borderBoxSize;
        default:
          return contentBoxSize;
      }
    };
    var ResizeObserverEntry = /* @__PURE__ */ function() {
      function ResizeObserverEntry2(target) {
        var boxes = calculateBoxSizes(target);
        this.target = target;
        this.contentRect = boxes.contentRect;
        this.borderBoxSize = freeze([boxes.borderBoxSize]);
        this.contentBoxSize = freeze([boxes.contentBoxSize]);
        this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
      }
      return ResizeObserverEntry2;
    }();
    var calculateDepthForNode = function(node) {
      if (isHidden(node)) {
        return Infinity;
      }
      var depth = 0;
      var parent = node.parentNode;
      while (parent) {
        depth += 1;
        parent = parent.parentNode;
      }
      return depth;
    };
    var broadcastActiveObservations = function() {
      var shallowestDepth = Infinity;
      var callbacks2 = [];
      resizeObservers.forEach(function processObserver(ro) {
        if (ro.activeTargets.length === 0) {
          return;
        }
        var entries = [];
        ro.activeTargets.forEach(function processTarget(ot) {
          var entry = new ResizeObserverEntry(ot.target);
          var targetDepth = calculateDepthForNode(ot.target);
          entries.push(entry);
          ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);
          if (targetDepth < shallowestDepth) {
            shallowestDepth = targetDepth;
          }
        });
        callbacks2.push(function resizeObserverCallback() {
          ro.callback.call(ro.observer, entries, ro.observer);
        });
        ro.activeTargets.splice(0, ro.activeTargets.length);
      });
      for (var _i = 0, callbacks_1 = callbacks2; _i < callbacks_1.length; _i++) {
        var callback = callbacks_1[_i];
        callback();
      }
      return shallowestDepth;
    };
    var gatherActiveObservationsAtDepth = function(depth) {
      resizeObservers.forEach(function processObserver(ro) {
        ro.activeTargets.splice(0, ro.activeTargets.length);
        ro.skippedTargets.splice(0, ro.skippedTargets.length);
        ro.observationTargets.forEach(function processTarget(ot) {
          if (ot.isActive()) {
            if (calculateDepthForNode(ot.target) > depth) {
              ro.activeTargets.push(ot);
            } else {
              ro.skippedTargets.push(ot);
            }
          }
        });
      });
    };
    var process = function() {
      var depth = 0;
      gatherActiveObservationsAtDepth(depth);
      while (hasActiveObservations()) {
        depth = broadcastActiveObservations();
        gatherActiveObservationsAtDepth(depth);
      }
      if (hasSkippedObservations()) {
        deliverResizeLoopError();
      }
      return depth > 0;
    };
    var trigger;
    var callbacks = [];
    var notify = function() {
      return callbacks.splice(0).forEach(function(cb) {
        return cb();
      });
    };
    var queueMicroTask = function(callback) {
      if (!trigger) {
        var toggle_1 = 0;
        var el_1 = document.createTextNode("");
        var config = { characterData: true };
        new MutationObserver(function() {
          return notify();
        }).observe(el_1, config);
        trigger = function() {
          el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
        };
      }
      callbacks.push(callback);
      trigger();
    };
    var queueResizeObserver = function(cb) {
      queueMicroTask(function ResizeObserver2() {
        requestAnimationFrame(cb);
      });
    };
    var watching = 0;
    var isWatching = function() {
      return !!watching;
    };
    var CATCH_PERIOD = 250;
    var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true };
    var events = [
      "resize",
      "load",
      "transitionend",
      "animationend",
      "animationstart",
      "animationiteration",
      "keyup",
      "keydown",
      "mouseup",
      "mousedown",
      "mouseover",
      "mouseout",
      "blur",
      "focus"
    ];
    var time = function(timeout) {
      if (timeout === void 0) {
        timeout = 0;
      }
      return Date.now() + timeout;
    };
    var scheduled = false;
    var Scheduler = function() {
      function Scheduler2() {
        var _this = this;
        this.stopped = true;
        this.listener = function() {
          return _this.schedule();
        };
      }
      Scheduler2.prototype.run = function(timeout) {
        var _this = this;
        if (timeout === void 0) {
          timeout = CATCH_PERIOD;
        }
        if (scheduled) {
          return;
        }
        scheduled = true;
        var until = time(timeout);
        queueResizeObserver(function() {
          var elementsHaveResized = false;
          try {
            elementsHaveResized = process();
          } finally {
            scheduled = false;
            timeout = until - time();
            if (!isWatching()) {
              return;
            }
            if (elementsHaveResized) {
              _this.run(1e3);
            } else if (timeout > 0) {
              _this.run(timeout);
            } else {
              _this.start();
            }
          }
        });
      };
      Scheduler2.prototype.schedule = function() {
        this.stop();
        this.run();
      };
      Scheduler2.prototype.observe = function() {
        var _this = this;
        var cb = function() {
          return _this.observer && _this.observer.observe(document.body, observerConfig);
        };
        document.body ? cb() : global$1.addEventListener("DOMContentLoaded", cb);
      };
      Scheduler2.prototype.start = function() {
        var _this = this;
        if (this.stopped) {
          this.stopped = false;
          this.observer = new MutationObserver(this.listener);
          this.observe();
          events.forEach(function(name) {
            return global$1.addEventListener(name, _this.listener, true);
          });
        }
      };
      Scheduler2.prototype.stop = function() {
        var _this = this;
        if (!this.stopped) {
          this.observer && this.observer.disconnect();
          events.forEach(function(name) {
            return global$1.removeEventListener(name, _this.listener, true);
          });
          this.stopped = true;
        }
      };
      return Scheduler2;
    }();
    var scheduler = new Scheduler();
    var updateCount = function(n) {
      !watching && n > 0 && scheduler.start();
      watching += n;
      !watching && scheduler.stop();
    };
    var skipNotifyOnElement = function(target) {
      return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline";
    };
    var ResizeObservation = function() {
      function ResizeObservation2(target, observedBox) {
        this.target = target;
        this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX;
        this.lastReportedSize = {
          inlineSize: 0,
          blockSize: 0
        };
      }
      ResizeObservation2.prototype.isActive = function() {
        var size2 = calculateBoxSize(this.target, this.observedBox, true);
        if (skipNotifyOnElement(this.target)) {
          this.lastReportedSize = size2;
        }
        if (this.lastReportedSize.inlineSize !== size2.inlineSize || this.lastReportedSize.blockSize !== size2.blockSize) {
          return true;
        }
        return false;
      };
      return ResizeObservation2;
    }();
    var ResizeObserverDetail = /* @__PURE__ */ function() {
      function ResizeObserverDetail2(resizeObserver, callback) {
        this.activeTargets = [];
        this.skippedTargets = [];
        this.observationTargets = [];
        this.observer = resizeObserver;
        this.callback = callback;
      }
      return ResizeObserverDetail2;
    }();
    var observerMap = /* @__PURE__ */ new WeakMap();
    var getObservationIndex = function(observationTargets, target) {
      for (var i = 0; i < observationTargets.length; i += 1) {
        if (observationTargets[i].target === target) {
          return i;
        }
      }
      return -1;
    };
    var ResizeObserverController = function() {
      function ResizeObserverController2() {
      }
      ResizeObserverController2.connect = function(resizeObserver, callback) {
        var detail = new ResizeObserverDetail(resizeObserver, callback);
        observerMap.set(resizeObserver, detail);
      };
      ResizeObserverController2.observe = function(resizeObserver, target, options) {
        var detail = observerMap.get(resizeObserver);
        var firstObservation = detail.observationTargets.length === 0;
        if (getObservationIndex(detail.observationTargets, target) < 0) {
          firstObservation && resizeObservers.push(detail);
          detail.observationTargets.push(new ResizeObservation(target, options && options.box));
          updateCount(1);
          scheduler.schedule();
        }
      };
      ResizeObserverController2.unobserve = function(resizeObserver, target) {
        var detail = observerMap.get(resizeObserver);
        var index = getObservationIndex(detail.observationTargets, target);
        var lastObservation = detail.observationTargets.length === 1;
        if (index >= 0) {
          lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);
          detail.observationTargets.splice(index, 1);
          updateCount(-1);
        }
      };
      ResizeObserverController2.disconnect = function(resizeObserver) {
        var _this = this;
        var detail = observerMap.get(resizeObserver);
        detail.observationTargets.slice().forEach(function(ot) {
          return _this.unobserve(resizeObserver, ot.target);
        });
        detail.activeTargets.splice(0, detail.activeTargets.length);
      };
      return ResizeObserverController2;
    }();
    var ResizeObserver = function() {
      function ResizeObserver2(callback) {
        if (arguments.length === 0) {
          throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
        }
        if (typeof callback !== "function") {
          throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
        }
        ResizeObserverController.connect(this, callback);
      }
      ResizeObserver2.prototype.observe = function(target, options) {
        if (arguments.length === 0) {
          throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
        }
        if (!isElement(target)) {
          throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
        }
        ResizeObserverController.observe(this, target, options);
      };
      ResizeObserver2.prototype.unobserve = function(target) {
        if (arguments.length === 0) {
          throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
        }
        if (!isElement(target)) {
          throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
        }
        ResizeObserverController.unobserve(this, target);
      };
      ResizeObserver2.prototype.disconnect = function() {
        ResizeObserverController.disconnect(this);
      };
      ResizeObserver2.toString = function() {
        return "function ResizeObserver () { [polyfill code] }";
      };
      return ResizeObserver2;
    }();
    class ResizeObserverDelegate {
      constructor() {
        this.handleResize = this.handleResize.bind(this);
        this.observer = new (typeof window !== "undefined" && window.ResizeObserver || ResizeObserver)(this.handleResize);
        this.elHandlersMap = /* @__PURE__ */ new Map();
      }
      handleResize(entries) {
        for (const entry of entries) {
          const handler = this.elHandlersMap.get(entry.target);
          if (handler !== void 0) {
            handler(entry);
          }
        }
      }
      registerHandler(el, handler) {
        this.elHandlersMap.set(el, handler);
        this.observer.observe(el);
      }
      unregisterHandler(el) {
        if (!this.elHandlersMap.has(el)) {
          return;
        }
        this.elHandlersMap.delete(el);
        this.observer.unobserve(el);
      }
    }
    const resizeObserverManager = new ResizeObserverDelegate();
    const VResizeObserver = /* @__PURE__ */ defineComponent({
      name: "ResizeObserver",
      props: {
        onResize: Function
      },
      setup(props) {
        let registered = false;
        const proxy = getCurrentInstance().proxy;
        function handleResize(entry) {
          const { onResize } = props;
          if (onResize !== void 0)
            onResize(entry);
        }
        onMounted(() => {
          const el = proxy.$el;
          if (el === void 0) {
            warn$1("resize-observer", "$el does not exist.");
            return;
          }
          if (el.nextElementSibling !== el.nextSibling) {
            if (el.nodeType === 3 && el.nodeValue !== "") {
              warn$1("resize-observer", "$el can not be observed (it may be a text node).");
              return;
            }
          }
          if (el.nextElementSibling !== null) {
            resizeObserverManager.registerHandler(el.nextElementSibling, handleResize);
            registered = true;
          }
        });
        onBeforeUnmount(() => {
          if (registered) {
            resizeObserverManager.unregisterHandler(proxy.$el.nextElementSibling);
          }
        });
      },
      render() {
        return renderSlot(this.$slots, "default");
      }
    });
    let maybeTouch;
    function ensureMaybeTouch() {
      if (typeof document === "undefined")
        return false;
      if (maybeTouch === void 0) {
        if ("matchMedia" in window) {
          maybeTouch = window.matchMedia("(pointer:coarse)").matches;
        } else {
          maybeTouch = false;
        }
      }
      return maybeTouch;
    }
    let wheelScale;
    function ensureWheelScale() {
      if (typeof document === "undefined")
        return 1;
      if (wheelScale === void 0) {
        wheelScale = "chrome" in window ? window.devicePixelRatio : 1;
      }
      return wheelScale;
    }
    const xScrollInjextionKey = "VVirtualListXScroll";
    function setupXScroll({ columnsRef, renderColRef, renderItemWithColsRef }) {
      const listWidthRef = ref(0);
      const scrollLeftRef = ref(0);
      const xFinweckTreeRef = computed(() => {
        const columns = columnsRef.value;
        if (columns.length === 0) {
          return null;
        }
        const ft = new FinweckTree(columns.length, 0);
        columns.forEach((column, index) => {
          ft.add(index, column.width);
        });
        return ft;
      });
      const startIndexRef = useMemo(() => {
        const xFinweckTree = xFinweckTreeRef.value;
        if (xFinweckTree !== null) {
          return Math.max(xFinweckTree.getBound(scrollLeftRef.value) - 1, 0);
        } else {
          return 0;
        }
      });
      const getLeft = (index) => {
        const xFinweckTree = xFinweckTreeRef.value;
        if (xFinweckTree !== null) {
          return xFinweckTree.sum(index);
        } else {
          return 0;
        }
      };
      const endIndexRef = useMemo(() => {
        const xFinweckTree = xFinweckTreeRef.value;
        if (xFinweckTree !== null) {
          return Math.min(xFinweckTree.getBound(scrollLeftRef.value + listWidthRef.value) + 1, columnsRef.value.length - 1);
        } else {
          return 0;
        }
      });
      provide(xScrollInjextionKey, {
        startIndexRef,
        endIndexRef,
        columnsRef,
        renderColRef,
        renderItemWithColsRef,
        getLeft
      });
      return {
        listWidthRef,
        scrollLeftRef
      };
    }
    const VirtualListRow = /* @__PURE__ */ defineComponent({
      name: "VirtualListRow",
      props: {
        index: { type: Number, required: true },
        item: {
          type: Object,
          required: true
        }
      },
      setup() {
        const { startIndexRef, endIndexRef, columnsRef, getLeft, renderColRef, renderItemWithColsRef } = (
          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
          inject(xScrollInjextionKey)
        );
        return {
          startIndex: startIndexRef,
          endIndex: endIndexRef,
          columns: columnsRef,
          renderCol: renderColRef,
          renderItemWithCols: renderItemWithColsRef,
          getLeft
        };
      },
      render() {
        const { startIndex, endIndex, columns, renderCol, renderItemWithCols, getLeft, item } = this;
        if (renderItemWithCols != null) {
          return renderItemWithCols({
            itemIndex: this.index,
            startColIndex: startIndex,
            endColIndex: endIndex,
            allColumns: columns,
            item,
            getLeft
          });
        }
        if (renderCol != null) {
          const items = [];
          for (let i = startIndex; i <= endIndex; ++i) {
            const column = columns[i];
            items.push(renderCol({ column, left: getLeft(i), item }));
          }
          return items;
        }
        return null;
      }
    });
    const styles = c(".v-vl", {
      maxHeight: "inherit",
      height: "100%",
      overflow: "auto",
      minWidth: "1px"
      // a zero width container won't be scrollable
    }, [
      c("&:not(.v-vl--show-scrollbar)", {
        scrollbarWidth: "none"
      }, [
        c("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb", {
          width: 0,
          height: 0,
          display: "none"
        })
      ])
    ]);
    const VVirtualList = /* @__PURE__ */ defineComponent({
      name: "VirtualList",
      inheritAttrs: false,
      props: {
        showScrollbar: {
          type: Boolean,
          default: true
        },
        columns: {
          type: Array,
          default: () => []
        },
        renderCol: Function,
        renderItemWithCols: Function,
        items: {
          type: Array,
          default: () => []
        },
        // it is suppose to be the min height
        itemSize: {
          type: Number,
          required: true
        },
        itemResizable: Boolean,
        itemsStyle: [String, Object],
        visibleItemsTag: {
          type: [String, Object],
          default: "div"
        },
        visibleItemsProps: Object,
        ignoreItemResize: Boolean,
        onScroll: Function,
        onWheel: Function,
        onResize: Function,
        defaultScrollKey: [Number, String],
        defaultScrollIndex: Number,
        keyField: {
          type: String,
          default: "key"
        },
        // Whether it is a good API?
        // ResizeObserver + footer & header is not enough.
        // Too complex for simple case
        paddingTop: {
          type: [Number, String],
          default: 0
        },
        paddingBottom: {
          type: [Number, String],
          default: 0
        }
      },
      setup(props) {
        const ssrAdapter2 = useSsrAdapter();
        styles.mount({
          id: "vueuc/virtual-list",
          head: true,
          anchorMetaName: cssrAnchorMetaName$1,
          ssr: ssrAdapter2
        });
        onMounted(() => {
          const { defaultScrollIndex, defaultScrollKey } = props;
          if (defaultScrollIndex !== void 0 && defaultScrollIndex !== null) {
            scrollTo({ index: defaultScrollIndex });
          } else if (defaultScrollKey !== void 0 && defaultScrollKey !== null) {
            scrollTo({ key: defaultScrollKey });
          }
        });
        let isDeactivated = false;
        let activateStateInitialized = false;
        onActivated(() => {
          isDeactivated = false;
          if (!activateStateInitialized) {
            activateStateInitialized = true;
            return;
          }
          scrollTo({ top: scrollTopRef.value, left: scrollLeftRef.value });
        });
        onDeactivated(() => {
          isDeactivated = true;
          if (!activateStateInitialized) {
            activateStateInitialized = true;
          }
        });
        const totalWidthRef = useMemo(() => {
          if (props.renderCol == null && props.renderItemWithCols == null) {
            return void 0;
          }
          if (props.columns.length === 0)
            return void 0;
          let width = 0;
          props.columns.forEach((column) => {
            width += column.width;
          });
          return width;
        });
        const keyIndexMapRef = computed(() => {
          const map2 = /* @__PURE__ */ new Map();
          const { keyField } = props;
          props.items.forEach((item, index) => {
            map2.set(item[keyField], index);
          });
          return map2;
        });
        const { scrollLeftRef, listWidthRef } = setupXScroll({
          columnsRef: toRef(props, "columns"),
          renderColRef: toRef(props, "renderCol"),
          renderItemWithColsRef: toRef(props, "renderItemWithCols")
        });
        const listElRef = ref(null);
        const listHeightRef = ref(void 0);
        const keyToHeightOffset = /* @__PURE__ */ new Map();
        const finweckTreeRef = computed(() => {
          const { items, itemSize, keyField } = props;
          const ft = new FinweckTree(items.length, itemSize);
          items.forEach((item, index) => {
            const key = item[keyField];
            const heightOffset = keyToHeightOffset.get(key);
            if (heightOffset !== void 0) {
              ft.add(index, heightOffset);
            }
          });
          return ft;
        });
        const finweckTreeUpdateTrigger = ref(0);
        const scrollTopRef = ref(0);
        const startIndexRef = useMemo(() => {
          return Math.max(finweckTreeRef.value.getBound(scrollTopRef.value - depx(props.paddingTop)) - 1, 0);
        });
        const viewportItemsRef = computed(() => {
          const { value: listHeight } = listHeightRef;
          if (listHeight === void 0)
            return [];
          const { items, itemSize } = props;
          const startIndex = startIndexRef.value;
          const endIndex = Math.min(startIndex + Math.ceil(listHeight / itemSize + 1), items.length - 1);
          const viewportItems = [];
          for (let i = startIndex; i <= endIndex; ++i) {
            viewportItems.push(items[i]);
          }
          return viewportItems;
        });
        const scrollTo = (options, y) => {
          if (typeof options === "number") {
            scrollToPosition2(options, y, "auto");
            return;
          }
          const { left, top, index, key, position, behavior, debounce: debounce2 = true } = options;
          if (left !== void 0 || top !== void 0) {
            scrollToPosition2(left, top, behavior);
          } else if (index !== void 0) {
            scrollToIndex(index, behavior, debounce2);
          } else if (key !== void 0) {
            const toIndex = keyIndexMapRef.value.get(key);
            if (toIndex !== void 0)
              scrollToIndex(toIndex, behavior, debounce2);
          } else if (position === "bottom") {
            scrollToPosition2(0, Number.MAX_SAFE_INTEGER, behavior);
          } else if (position === "top") {
            scrollToPosition2(0, 0, behavior);
          }
        };
        let anchorIndex;
        let anchorTimerId = null;
        function scrollToIndex(index, behavior, debounce2) {
          const { value: ft } = finweckTreeRef;
          const targetTop = ft.sum(index) + depx(props.paddingTop);
          if (!debounce2) {
            listElRef.value.scrollTo({
              left: 0,
              top: targetTop,
              behavior
            });
          } else {
            anchorIndex = index;
            if (anchorTimerId !== null) {
              window.clearTimeout(anchorTimerId);
            }
            anchorTimerId = window.setTimeout(() => {
              anchorIndex = void 0;
              anchorTimerId = null;
            }, 16);
            const { scrollTop, offsetHeight } = listElRef.value;
            if (targetTop > scrollTop) {
              const itemSize = ft.get(index);
              if (targetTop + itemSize <= scrollTop + offsetHeight) ;
              else {
                listElRef.value.scrollTo({
                  left: 0,
                  top: targetTop + itemSize - offsetHeight,
                  behavior
                });
              }
            } else {
              listElRef.value.scrollTo({
                left: 0,
                top: targetTop,
                behavior
              });
            }
          }
        }
        function scrollToPosition2(left, top, behavior) {
          listElRef.value.scrollTo({
            left,
            top,
            behavior
          });
        }
        function handleItemResize(key, entry) {
          var _a, _b, _c;
          if (isDeactivated)
            return;
          if (props.ignoreItemResize)
            return;
          if (isHideByVShow(entry.target))
            return;
          const { value: ft } = finweckTreeRef;
          const index = keyIndexMapRef.value.get(key);
          const previousHeight = ft.get(index);
          const height = (_c = (_b = (_a = entry.borderBoxSize) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.blockSize) !== null && _c !== void 0 ? _c : entry.contentRect.height;
          if (height === previousHeight)
            return;
          const offset = height - props.itemSize;
          if (offset === 0) {
            keyToHeightOffset.delete(key);
          } else {
            keyToHeightOffset.set(key, height - props.itemSize);
          }
          const delta = height - previousHeight;
          if (delta === 0)
            return;
          ft.add(index, delta);
          const listEl = listElRef.value;
          if (listEl != null) {
            if (anchorIndex === void 0) {
              const previousHeightSum = ft.sum(index);
              if (listEl.scrollTop > previousHeightSum) {
                listEl.scrollBy(0, delta);
              }
            } else {
              if (index < anchorIndex) {
                listEl.scrollBy(0, delta);
              } else if (index === anchorIndex) {
                const previousHeightSum = ft.sum(index);
                if (height + previousHeightSum > // Note, listEl shouldn't have border, nor offsetHeight won't be
                // correct
                listEl.scrollTop + listEl.offsetHeight) {
                  listEl.scrollBy(0, delta);
                }
              }
            }
            syncViewport();
          }
          finweckTreeUpdateTrigger.value++;
        }
        const mayUseWheel = !ensureMaybeTouch();
        let wheelCatched = false;
        function handleListScroll(e) {
          var _a;
          (_a = props.onScroll) === null || _a === void 0 ? void 0 : _a.call(props, e);
          if (!mayUseWheel || !wheelCatched) {
            syncViewport();
          }
        }
        function handleListWheel(e) {
          var _a;
          (_a = props.onWheel) === null || _a === void 0 ? void 0 : _a.call(props, e);
          if (mayUseWheel) {
            const listEl = listElRef.value;
            if (listEl != null) {
              if (e.deltaX === 0) {
                if (listEl.scrollTop === 0 && e.deltaY <= 0) {
                  return;
                }
                if (listEl.scrollTop + listEl.offsetHeight >= listEl.scrollHeight && e.deltaY >= 0) {
                  return;
                }
              }
              e.preventDefault();
              listEl.scrollTop += e.deltaY / ensureWheelScale();
              listEl.scrollLeft += e.deltaX / ensureWheelScale();
              syncViewport();
              wheelCatched = true;
              beforeNextFrameOnce(() => {
                wheelCatched = false;
              });
            }
          }
        }
        function handleListResize(entry) {
          if (isDeactivated)
            return;
          if (isHideByVShow(entry.target))
            return;
          if (props.renderCol == null && props.renderItemWithCols == null) {
            if (entry.contentRect.height === listHeightRef.value)
              return;
          } else {
            if (entry.contentRect.height === listHeightRef.value && entry.contentRect.width === listWidthRef.value) {
              return;
            }
          }
          listHeightRef.value = entry.contentRect.height;
          listWidthRef.value = entry.contentRect.width;
          const { onResize } = props;
          if (onResize !== void 0)
            onResize(entry);
        }
        function syncViewport() {
          const { value: listEl } = listElRef;
          if (listEl == null)
            return;
          scrollTopRef.value = listEl.scrollTop;
          scrollLeftRef.value = listEl.scrollLeft;
        }
        function isHideByVShow(el) {
          let cursor = el;
          while (cursor !== null) {
            if (cursor.style.display === "none")
              return true;
            cursor = cursor.parentElement;
          }
          return false;
        }
        return {
          listHeight: listHeightRef,
          listStyle: {
            overflow: "auto"
          },
          keyToIndex: keyIndexMapRef,
          itemsStyle: computed(() => {
            const { itemResizable } = props;
            const height = pxfy(finweckTreeRef.value.sum());
            finweckTreeUpdateTrigger.value;
            return [
              props.itemsStyle,
              {
                boxSizing: "content-box",
                width: pxfy(totalWidthRef.value),
                height: itemResizable ? "" : height,
                minHeight: itemResizable ? height : "",
                paddingTop: pxfy(props.paddingTop),
                paddingBottom: pxfy(props.paddingBottom)
              }
            ];
          }),
          visibleItemsStyle: computed(() => {
            finweckTreeUpdateTrigger.value;
            return {
              transform: `translateY(${pxfy(finweckTreeRef.value.sum(startIndexRef.value))})`
            };
          }),
          viewportItems: viewportItemsRef,
          listElRef,
          itemsElRef: ref(null),
          scrollTo,
          handleListResize,
          handleListScroll,
          handleListWheel,
          handleItemResize
        };
      },
      render() {
        const { itemResizable, keyField, keyToIndex, visibleItemsTag } = this;
        return h(VResizeObserver, {
          onResize: this.handleListResize
        }, {
          default: () => {
            var _a, _b;
            return h("div", mergeProps(this.$attrs, {
              class: ["v-vl", this.showScrollbar && "v-vl--show-scrollbar"],
              onScroll: this.handleListScroll,
              onWheel: this.handleListWheel,
              ref: "listElRef"
            }), [
              this.items.length !== 0 ? h("div", {
                ref: "itemsElRef",
                class: "v-vl-items",
                style: this.itemsStyle
              }, [
                h(visibleItemsTag, Object.assign({
                  class: "v-vl-visible-items",
                  style: this.visibleItemsStyle
                }, this.visibleItemsProps), {
                  default: () => {
                    const { renderCol, renderItemWithCols } = this;
                    return this.viewportItems.map((item) => {
                      const key = item[keyField];
                      const index = keyToIndex.get(key);
                      const renderedCols = renderCol != null ? h(VirtualListRow, {
                        index,
                        item
                      }) : void 0;
                      const renderedItemWithCols = renderItemWithCols != null ? h(VirtualListRow, {
                        index,
                        item
                      }) : void 0;
                      const itemVNode = this.$slots.default({
                        item,
                        renderedCols,
                        renderedItemWithCols,
                        index
                      })[0];
                      if (itemResizable) {
                        return h(VResizeObserver, {
                          key,
                          onResize: (entry) => this.handleItemResize(key, entry)
                        }, {
                          default: () => itemVNode
                        });
                      }
                      itemVNode.key = key;
                      return itemVNode;
                    });
                  }
                })
              ]) : (_b = (_a = this.$slots).empty) === null || _b === void 0 ? void 0 : _b.call(_a)
            ]);
          }
        });
      }
    });
    const hiddenAttr = "v-hidden";
    const style$t = c("[v-hidden]", {
      display: "none!important"
    });
    const VOverflow = /* @__PURE__ */ defineComponent({
      name: "Overflow",
      props: {
        getCounter: Function,
        getTail: Function,
        updateCounter: Function,
        onUpdateCount: Function,
        onUpdateOverflow: Function
      },
      setup(props, { slots }) {
        const selfRef = ref(null);
        const counterRef = ref(null);
        function deriveCounter(options) {
          const { value: self2 } = selfRef;
          const { getCounter, getTail } = props;
          let counter;
          if (getCounter !== void 0)
            counter = getCounter();
          else {
            counter = counterRef.value;
          }
          if (!self2 || !counter)
            return;
          if (counter.hasAttribute(hiddenAttr)) {
            counter.removeAttribute(hiddenAttr);
          }
          const { children } = self2;
          if (options.showAllItemsBeforeCalculate) {
            for (const child of children) {
              if (child.hasAttribute(hiddenAttr)) {
                child.removeAttribute(hiddenAttr);
              }
            }
          }
          const containerWidth = self2.offsetWidth;
          const childWidths = [];
          const tail = slots.tail ? getTail === null || getTail === void 0 ? void 0 : getTail() : null;
          let childWidthSum = tail ? tail.offsetWidth : 0;
          let overflow = false;
          const len2 = self2.children.length - (slots.tail ? 1 : 0);
          for (let i = 0; i < len2 - 1; ++i) {
            if (i < 0)
              continue;
            const child = children[i];
            if (overflow) {
              if (!child.hasAttribute(hiddenAttr)) {
                child.setAttribute(hiddenAttr, "");
              }
              continue;
            } else if (child.hasAttribute(hiddenAttr)) {
              child.removeAttribute(hiddenAttr);
            }
            const childWidth = child.offsetWidth;
            childWidthSum += childWidth;
            childWidths[i] = childWidth;
            if (childWidthSum > containerWidth) {
              const { updateCounter } = props;
              for (let j = i; j >= 0; --j) {
                const restCount = len2 - 1 - j;
                if (updateCounter !== void 0) {
                  updateCounter(restCount);
                } else {
                  counter.textContent = `${restCount}`;
                }
                const counterWidth = counter.offsetWidth;
                childWidthSum -= childWidths[j];
                if (childWidthSum + counterWidth <= containerWidth || j === 0) {
                  overflow = true;
                  i = j - 1;
                  if (tail) {
                    if (i === -1) {
                      tail.style.maxWidth = `${containerWidth - counterWidth}px`;
                      tail.style.boxSizing = "border-box";
                    } else {
                      tail.style.maxWidth = "";
                    }
                  }
                  const { onUpdateCount } = props;
                  if (onUpdateCount)
                    onUpdateCount(restCount);
                  break;
                }
              }
            }
          }
          const { onUpdateOverflow } = props;
          if (!overflow) {
            if (onUpdateOverflow !== void 0) {
              onUpdateOverflow(false);
            }
            counter.setAttribute(hiddenAttr, "");
          } else {
            if (onUpdateOverflow !== void 0) {
              onUpdateOverflow(true);
            }
          }
        }
        const ssrAdapter2 = useSsrAdapter();
        style$t.mount({
          id: "vueuc/overflow",
          head: true,
          anchorMetaName: cssrAnchorMetaName$1,
          ssr: ssrAdapter2
        });
        onMounted(() => deriveCounter({
          showAllItemsBeforeCalculate: false
        }));
        return {
          selfRef,
          counterRef,
          sync: deriveCounter
        };
      },
      render() {
        const { $slots } = this;
        nextTick(() => this.sync({
          showAllItemsBeforeCalculate: false
        }));
        return h("div", {
          class: "v-overflow",
          ref: "selfRef"
        }, [
          renderSlot($slots, "default"),
          // $slots.counter should only has 1 element
          $slots.counter ? $slots.counter() : h("span", {
            style: {
              display: "inline-block"
            },
            ref: "counterRef"
          }),
          // $slots.tail should only has 1 element
          $slots.tail ? $slots.tail() : null
        ]);
      }
    });
    function isHTMLElement(node) {
      return node instanceof HTMLElement;
    }
    function focusFirstDescendant(node) {
      for (let i = 0; i < node.childNodes.length; i++) {
        const child = node.childNodes[i];
        if (isHTMLElement(child)) {
          if (attemptFocus(child) || focusFirstDescendant(child)) {
            return true;
          }
        }
      }
      return false;
    }
    function focusLastDescendant(element) {
      for (let i = element.childNodes.length - 1; i >= 0; i--) {
        const child = element.childNodes[i];
        if (isHTMLElement(child)) {
          if (attemptFocus(child) || focusLastDescendant(child)) {
            return true;
          }
        }
      }
      return false;
    }
    function attemptFocus(element) {
      if (!isFocusable(element)) {
        return false;
      }
      try {
        element.focus({ preventScroll: true });
      } catch (e) {
      }
      return document.activeElement === element;
    }
    function isFocusable(element) {
      if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
        return true;
      }
      if (element.getAttribute("disabled")) {
        return false;
      }
      switch (element.nodeName) {
        case "A":
          return !!element.href && element.rel !== "ignore";
        case "INPUT":
          return element.type !== "hidden" && element.type !== "file";
        case "BUTTON":
        case "SELECT":
        case "TEXTAREA":
          return true;
        default:
          return false;
      }
    }
    let stack = [];
    const FocusTrap = /* @__PURE__ */ defineComponent({
      name: "FocusTrap",
      props: {
        disabled: Boolean,
        active: Boolean,
        autoFocus: {
          type: Boolean,
          default: true
        },
        onEsc: Function,
        initialFocusTo: String,
        finalFocusTo: String,
        returnFocusOnDeactivated: {
          type: Boolean,
          default: true
        }
      },
      setup(props) {
        const id = createId();
        const focusableStartRef = ref(null);
        const focusableEndRef = ref(null);
        let activated = false;
        let ignoreInternalFocusChange = false;
        const lastFocusedElement = typeof document === "undefined" ? null : document.activeElement;
        function isCurrentActive() {
          const currentActiveId = stack[stack.length - 1];
          return currentActiveId === id;
        }
        function handleDocumentKeydown(e) {
          var _a;
          if (e.code === "Escape") {
            if (isCurrentActive()) {
              (_a = props.onEsc) === null || _a === void 0 ? void 0 : _a.call(props, e);
            }
          }
        }
        onMounted(() => {
          watch(() => props.active, (value) => {
            if (value) {
              activate();
              on("keydown", document, handleDocumentKeydown);
            } else {
              off("keydown", document, handleDocumentKeydown);
              if (activated) {
                deactivate();
              }
            }
          }, {
            immediate: true
          });
        });
        onBeforeUnmount(() => {
          off("keydown", document, handleDocumentKeydown);
          if (activated)
            deactivate();
        });
        function handleDocumentFocus(e) {
          if (ignoreInternalFocusChange)
            return;
          if (isCurrentActive()) {
            const mainEl = getMainEl();
            if (mainEl === null)
              return;
            if (mainEl.contains(getPreciseEventTarget(e)))
              return;
            resetFocusTo("first");
          }
        }
        function getMainEl() {
          const focusableStartEl = focusableStartRef.value;
          if (focusableStartEl === null)
            return null;
          let mainEl = focusableStartEl;
          while (true) {
            mainEl = mainEl.nextSibling;
            if (mainEl === null)
              break;
            if (mainEl instanceof Element && mainEl.tagName === "DIV") {
              break;
            }
          }
          return mainEl;
        }
        function activate() {
          var _a;
          if (props.disabled)
            return;
          stack.push(id);
          if (props.autoFocus) {
            const { initialFocusTo } = props;
            if (initialFocusTo === void 0) {
              resetFocusTo("first");
            } else {
              (_a = resolveTo(initialFocusTo)) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
            }
          }
          activated = true;
          document.addEventListener("focus", handleDocumentFocus, true);
        }
        function deactivate() {
          var _a;
          if (props.disabled)
            return;
          document.removeEventListener("focus", handleDocumentFocus, true);
          stack = stack.filter((idInStack) => idInStack !== id);
          if (isCurrentActive())
            return;
          const { finalFocusTo } = props;
          if (finalFocusTo !== void 0) {
            (_a = resolveTo(finalFocusTo)) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
          } else if (props.returnFocusOnDeactivated) {
            if (lastFocusedElement instanceof HTMLElement) {
              ignoreInternalFocusChange = true;
              lastFocusedElement.focus({ preventScroll: true });
              ignoreInternalFocusChange = false;
            }
          }
        }
        function resetFocusTo(target) {
          if (!isCurrentActive())
            return;
          if (props.active) {
            const focusableStartEl = focusableStartRef.value;
            const focusableEndEl = focusableEndRef.value;
            if (focusableStartEl !== null && focusableEndEl !== null) {
              const mainEl = getMainEl();
              if (mainEl == null || mainEl === focusableEndEl) {
                ignoreInternalFocusChange = true;
                focusableStartEl.focus({ preventScroll: true });
                ignoreInternalFocusChange = false;
                return;
              }
              ignoreInternalFocusChange = true;
              const focused = target === "first" ? focusFirstDescendant(mainEl) : focusLastDescendant(mainEl);
              ignoreInternalFocusChange = false;
              if (!focused) {
                ignoreInternalFocusChange = true;
                focusableStartEl.focus({ preventScroll: true });
                ignoreInternalFocusChange = false;
              }
            }
          }
        }
        function handleStartFocus(e) {
          if (ignoreInternalFocusChange)
            return;
          const mainEl = getMainEl();
          if (mainEl === null)
            return;
          if (e.relatedTarget !== null && mainEl.contains(e.relatedTarget)) {
            resetFocusTo("last");
          } else {
            resetFocusTo("first");
          }
        }
        function handleEndFocus(e) {
          if (ignoreInternalFocusChange)
            return;
          if (e.relatedTarget !== null && e.relatedTarget === focusableStartRef.value) {
            resetFocusTo("last");
          } else {
            resetFocusTo("first");
          }
        }
        return {
          focusableStartRef,
          focusableEndRef,
          focusableStyle: "position: absolute; height: 0; width: 0;",
          handleStartFocus,
          handleEndFocus
        };
      },
      render() {
        const { default: defaultSlot } = this.$slots;
        if (defaultSlot === void 0)
          return null;
        if (this.disabled)
          return defaultSlot();
        const { active, focusableStyle } = this;
        return h(Fragment, null, [
          h("div", {
            "aria-hidden": "true",
            tabindex: active ? "0" : "-1",
            ref: "focusableStartRef",
            style: focusableStyle,
            onFocus: this.handleStartFocus
          }),
          defaultSlot(),
          h("div", {
            "aria-hidden": "true",
            style: focusableStyle,
            ref: "focusableEndRef",
            tabindex: active ? "0" : "-1",
            onFocus: this.handleEndFocus
          })
        ]);
      }
    });
    function useOnResize(elRef, onResize) {
      if (onResize) {
        onMounted(() => {
          const {
            value: el
          } = elRef;
          if (el) {
            resizeObserverManager.registerHandler(el, onResize);
          }
        });
        onBeforeUnmount(() => {
          const {
            value: el
          } = elRef;
          if (el) {
            resizeObserverManager.unregisterHandler(el);
          }
        });
      }
    }
    let lockCount = 0;
    let originalMarginRight = "";
    let originalOverflow = "";
    let originalOverflowX = "";
    let originalOverflowY = "";
    const lockHtmlScrollRightCompensationRef = ref("0px");
    function useLockHtmlScroll(lockRef) {
      if (typeof document === "undefined") return;
      const el = document.documentElement;
      let watchStopHandle;
      let activated = false;
      const unlock = () => {
        el.style.marginRight = originalMarginRight;
        el.style.overflow = originalOverflow;
        el.style.overflowX = originalOverflowX;
        el.style.overflowY = originalOverflowY;
        lockHtmlScrollRightCompensationRef.value = "0px";
      };
      onMounted(() => {
        watchStopHandle = watch(lockRef, (value) => {
          if (value) {
            if (!lockCount) {
              const scrollbarWidth = window.innerWidth - el.offsetWidth;
              if (scrollbarWidth > 0) {
                originalMarginRight = el.style.marginRight;
                el.style.marginRight = `${scrollbarWidth}px`;
                lockHtmlScrollRightCompensationRef.value = `${scrollbarWidth}px`;
              }
              originalOverflow = el.style.overflow;
              originalOverflowX = el.style.overflowX;
              originalOverflowY = el.style.overflowY;
              el.style.overflow = "hidden";
              el.style.overflowX = "hidden";
              el.style.overflowY = "hidden";
            }
            activated = true;
            lockCount++;
          } else {
            lockCount--;
            if (!lockCount) {
              unlock();
            }
            activated = false;
          }
        }, {
          immediate: true
        });
      });
      onBeforeUnmount(() => {
        watchStopHandle === null || watchStopHandle === void 0 ? void 0 : watchStopHandle();
        if (activated) {
          lockCount--;
          if (!lockCount) {
            unlock();
          }
          activated = false;
        }
      });
    }
    const isComposingRef = ref(false);
    function compositionStartHandler() {
      isComposingRef.value = true;
    }
    function compositionEndHandler() {
      isComposingRef.value = false;
    }
    let mountedCount = 0;
    function useIsComposing() {
      if (isBrowser$2) {
        onBeforeMount(() => {
          if (!mountedCount) {
            window.addEventListener("compositionstart", compositionStartHandler);
            window.addEventListener("compositionend", compositionEndHandler);
          }
          mountedCount++;
        });
        onBeforeUnmount(() => {
          if (mountedCount <= 1) {
            window.removeEventListener("compositionstart", compositionStartHandler);
            window.removeEventListener("compositionend", compositionEndHandler);
            mountedCount = 0;
          } else {
            mountedCount--;
          }
        });
      }
      return isComposingRef;
    }
    function useReactivated(callback) {
      const isDeactivatedRef = {
        isDeactivated: false
      };
      let activateStateInitialized = false;
      onActivated(() => {
        isDeactivatedRef.isDeactivated = false;
        if (!activateStateInitialized) {
          activateStateInitialized = true;
          return;
        }
        callback();
      });
      onDeactivated(() => {
        isDeactivatedRef.isDeactivated = true;
        if (!activateStateInitialized) {
          activateStateInitialized = true;
        }
      });
      return isDeactivatedRef;
    }
    function download(url, name) {
      if (!url) return;
      const a = document.createElement("a");
      a.href = url;
      if (name !== void 0) {
        a.download = name;
      }
      document.body.appendChild(a);
      a.click();
      document.body.removeChild(a);
    }
    const formItemInjectionKey = createInjectionKey("n-form-item");
    function useFormItem(props, {
      defaultSize = "medium",
      mergedSize,
      mergedDisabled
    } = {}) {
      const NFormItem = inject(formItemInjectionKey, null);
      provide(formItemInjectionKey, null);
      const mergedSizeRef = computed(mergedSize ? () => mergedSize(NFormItem) : () => {
        const {
          size: size2
        } = props;
        if (size2) return size2;
        if (NFormItem) {
          const {
            mergedSize: mergedSize2
          } = NFormItem;
          if (mergedSize2.value !== void 0) {
            return mergedSize2.value;
          }
        }
        return defaultSize;
      });
      const mergedDisabledRef = computed(mergedDisabled ? () => mergedDisabled(NFormItem) : () => {
        const {
          disabled
        } = props;
        if (disabled !== void 0) {
          return disabled;
        }
        if (NFormItem) {
          return NFormItem.disabled.value;
        }
        return false;
      });
      const mergedStatusRef = computed(() => {
        const {
          status
        } = props;
        if (status) return status;
        return NFormItem === null || NFormItem === void 0 ? void 0 : NFormItem.mergedValidationStatus.value;
      });
      onBeforeUnmount(() => {
        if (NFormItem) {
          NFormItem.restoreValidation();
        }
      });
      return {
        mergedSizeRef,
        mergedDisabledRef,
        mergedStatusRef,
        nTriggerFormBlur() {
          if (NFormItem) {
            NFormItem.handleContentBlur();
          }
        },
        nTriggerFormChange() {
          if (NFormItem) {
            NFormItem.handleContentChange();
          }
        },
        nTriggerFormFocus() {
          if (NFormItem) {
            NFormItem.handleContentFocus();
          }
        },
        nTriggerFormInput() {
          if (NFormItem) {
            NFormItem.handleContentInput();
          }
        }
      };
    }
    var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
    var freeSelf = typeof self == "object" && self && self.Object === Object && self;
    var root = freeGlobal || freeSelf || Function("return this")();
    var Symbol$1 = root.Symbol;
    var objectProto$e = Object.prototype;
    var hasOwnProperty$c = objectProto$e.hasOwnProperty;
    var nativeObjectToString$1 = objectProto$e.toString;
    var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
    function getRawTag(value) {
      var isOwn = hasOwnProperty$c.call(value, symToStringTag$1), tag = value[symToStringTag$1];
      try {
        value[symToStringTag$1] = void 0;
        var unmasked = true;
      } catch (e) {
      }
      var result = nativeObjectToString$1.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag$1] = tag;
        } else {
          delete value[symToStringTag$1];
        }
      }
      return result;
    }
    var objectProto$d = Object.prototype;
    var nativeObjectToString = objectProto$d.toString;
    function objectToString$1(value) {
      return nativeObjectToString.call(value);
    }
    var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
    var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
    function baseGetTag(value) {
      if (value == null) {
        return value === void 0 ? undefinedTag : nullTag;
      }
      return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString$1(value);
    }
    function isObjectLike(value) {
      return value != null && typeof value == "object";
    }
    var symbolTag$1 = "[object Symbol]";
    function isSymbol(value) {
      return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$1;
    }
    function arrayMap(array, iteratee) {
      var index = -1, length = array == null ? 0 : array.length, result = Array(length);
      while (++index < length) {
        result[index] = iteratee(array[index], index, array);
      }
      return result;
    }
    var isArray$1 = Array.isArray;
    var INFINITY$1 = 1 / 0;
    var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
    function baseToString(value) {
      if (typeof value == "string") {
        return value;
      }
      if (isArray$1(value)) {
        return arrayMap(value, baseToString) + "";
      }
      if (isSymbol(value)) {
        return symbolToString ? symbolToString.call(value) : "";
      }
      var result = value + "";
      return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
    }
    var reWhitespace = /\s/;
    function trimmedEndIndex(string) {
      var index = string.length;
      while (index-- && reWhitespace.test(string.charAt(index))) {
      }
      return index;
    }
    var reTrimStart = /^\s+/;
    function baseTrim(string) {
      return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
    }
    function isObject$3(value) {
      var type = typeof value;
      return value != null && (type == "object" || type == "function");
    }
    var NAN = 0 / 0;
    var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
    var reIsBinary = /^0b[01]+$/i;
    var reIsOctal = /^0o[0-7]+$/i;
    var freeParseInt = parseInt;
    function toNumber(value) {
      if (typeof value == "number") {
        return value;
      }
      if (isSymbol(value)) {
        return NAN;
      }
      if (isObject$3(value)) {
        var other = typeof value.valueOf == "function" ? value.valueOf() : value;
        value = isObject$3(other) ? other + "" : other;
      }
      if (typeof value != "string") {
        return value === 0 ? value : +value;
      }
      value = baseTrim(value);
      var isBinary = reIsBinary.test(value);
      return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
    }
    function identity(value) {
      return value;
    }
    var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
    function isFunction$1(value) {
      if (!isObject$3(value)) {
        return false;
      }
      var tag = baseGetTag(value);
      return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
    }
    var coreJsData = root["__core-js_shared__"];
    var maskSrcKey = function() {
      var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
      return uid2 ? "Symbol(src)_1." + uid2 : "";
    }();
    function isMasked(func) {
      return !!maskSrcKey && maskSrcKey in func;
    }
    var funcProto$2 = Function.prototype;
    var funcToString$2 = funcProto$2.toString;
    function toSource(func) {
      if (func != null) {
        try {
          return funcToString$2.call(func);
        } catch (e) {
        }
        try {
          return func + "";
        } catch (e) {
        }
      }
      return "";
    }
    var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
    var reIsHostCtor = /^\[object .+?Constructor\]$/;
    var funcProto$1 = Function.prototype, objectProto$c = Object.prototype;
    var funcToString$1 = funcProto$1.toString;
    var hasOwnProperty$b = objectProto$c.hasOwnProperty;
    var reIsNative = RegExp(
      "^" + funcToString$1.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
    );
    function baseIsNative(value) {
      if (!isObject$3(value) || isMasked(value)) {
        return false;
      }
      var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
      return pattern.test(toSource(value));
    }
    function getValue(object, key) {
      return object == null ? void 0 : object[key];
    }
    function getNative(object, key) {
      var value = getValue(object, key);
      return baseIsNative(value) ? value : void 0;
    }
    var WeakMap$1 = getNative(root, "WeakMap");
    var objectCreate = Object.create;
    var baseCreate = /* @__PURE__ */ function() {
      function object() {
      }
      return function(proto) {
        if (!isObject$3(proto)) {
          return {};
        }
        if (objectCreate) {
          return objectCreate(proto);
        }
        object.prototype = proto;
        var result = new object();
        object.prototype = void 0;
        return result;
      };
    }();
    function apply$1(func, thisArg, args) {
      switch (args.length) {
        case 0:
          return func.call(thisArg);
        case 1:
          return func.call(thisArg, args[0]);
        case 2:
          return func.call(thisArg, args[0], args[1]);
        case 3:
          return func.call(thisArg, args[0], args[1], args[2]);
      }
      return func.apply(thisArg, args);
    }
    function copyArray(source, array) {
      var index = -1, length = source.length;
      array || (array = Array(length));
      while (++index < length) {
        array[index] = source[index];
      }
      return array;
    }
    var HOT_COUNT = 800, HOT_SPAN = 16;
    var nativeNow = Date.now;
    function shortOut(func) {
      var count = 0, lastCalled = 0;
      return function() {
        var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
        lastCalled = stamp;
        if (remaining > 0) {
          if (++count >= HOT_COUNT) {
            return arguments[0];
          }
        } else {
          count = 0;
        }
        return func.apply(void 0, arguments);
      };
    }
    function constant(value) {
      return function() {
        return value;
      };
    }
    var defineProperty = function() {
      try {
        var func = getNative(Object, "defineProperty");
        func({}, "", {});
        return func;
      } catch (e) {
      }
    }();
    var baseSetToString = !defineProperty ? identity : function(func, string) {
      return defineProperty(func, "toString", {
        "configurable": true,
        "enumerable": false,
        "value": constant(string),
        "writable": true
      });
    };
    var setToString = shortOut(baseSetToString);
    var MAX_SAFE_INTEGER$1 = 9007199254740991;
    var reIsUint = /^(?:0|[1-9]\d*)$/;
    function isIndex(value, length) {
      var type = typeof value;
      length = length == null ? MAX_SAFE_INTEGER$1 : length;
      return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
    }
    function baseAssignValue(object, key, value) {
      if (key == "__proto__" && defineProperty) {
        defineProperty(object, key, {
          "configurable": true,
          "enumerable": true,
          "value": value,
          "writable": true
        });
      } else {
        object[key] = value;
      }
    }
    function eq(value, other) {
      return value === other || value !== value && other !== other;
    }
    var objectProto$b = Object.prototype;
    var hasOwnProperty$a = objectProto$b.hasOwnProperty;
    function assignValue(object, key, value) {
      var objValue = object[key];
      if (!(hasOwnProperty$a.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
        baseAssignValue(object, key, value);
      }
    }
    function copyObject(source, props, object, customizer) {
      var isNew = !object;
      object || (object = {});
      var index = -1, length = props.length;
      while (++index < length) {
        var key = props[index];
        var newValue = void 0;
        if (newValue === void 0) {
          newValue = source[key];
        }
        if (isNew) {
          baseAssignValue(object, key, newValue);
        } else {
          assignValue(object, key, newValue);
        }
      }
      return object;
    }
    var nativeMax$1 = Math.max;
    function overRest(func, start, transform2) {
      start = nativeMax$1(start === void 0 ? func.length - 1 : start, 0);
      return function() {
        var args = arguments, index = -1, length = nativeMax$1(args.length - start, 0), array = Array(length);
        while (++index < length) {
          array[index] = args[start + index];
        }
        index = -1;
        var otherArgs = Array(start + 1);
        while (++index < start) {
          otherArgs[index] = args[index];
        }
        otherArgs[start] = transform2(array);
        return apply$1(func, this, otherArgs);
      };
    }
    function baseRest(func, start) {
      return setToString(overRest(func, start, identity), func + "");
    }
    var MAX_SAFE_INTEGER = 9007199254740991;
    function isLength(value) {
      return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
    }
    function isArrayLike(value) {
      return value != null && isLength(value.length) && !isFunction$1(value);
    }
    function isIterateeCall(value, index, object) {
      if (!isObject$3(object)) {
        return false;
      }
      var type = typeof index;
      if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
        return eq(object[index], value);
      }
      return false;
    }
    function createAssigner(assigner) {
      return baseRest(function(object, sources) {
        var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
        customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          customizer = length < 3 ? void 0 : customizer;
          length = 1;
        }
        object = Object(object);
        while (++index < length) {
          var source = sources[index];
          if (source) {
            assigner(object, source, index, customizer);
          }
        }
        return object;
      });
    }
    var objectProto$a = Object.prototype;
    function isPrototype(value) {
      var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$a;
      return value === proto;
    }
    function baseTimes(n, iteratee) {
      var index = -1, result = Array(n);
      while (++index < n) {
        result[index] = iteratee(index);
      }
      return result;
    }
    var argsTag$2 = "[object Arguments]";
    function baseIsArguments(value) {
      return isObjectLike(value) && baseGetTag(value) == argsTag$2;
    }
    var objectProto$9 = Object.prototype;
    var hasOwnProperty$9 = objectProto$9.hasOwnProperty;
    var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
    var isArguments = baseIsArguments(/* @__PURE__ */ function() {
      return arguments;
    }()) ? baseIsArguments : function(value) {
      return isObjectLike(value) && hasOwnProperty$9.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
    };
    function stubFalse() {
      return false;
    }
    var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
    var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
    var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
    var Buffer$1 = moduleExports$2 ? root.Buffer : void 0;
    var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
    var isBuffer = nativeIsBuffer || stubFalse;
    var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", objectTag$3 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]";
    var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
    var typedArrayTags = {};
    typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
    typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
    function baseIsTypedArray(value) {
      return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
    }
    function baseUnary(func) {
      return function(value) {
        return func(value);
      };
    }
    var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
    var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
    var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
    var freeProcess = moduleExports$1 && freeGlobal.process;
    var nodeUtil = function() {
      try {
        var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
        if (types) {
          return types;
        }
        return freeProcess && freeProcess.binding && freeProcess.binding("util");
      } catch (e) {
      }
    }();
    var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
    var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
    var objectProto$8 = Object.prototype;
    var hasOwnProperty$8 = objectProto$8.hasOwnProperty;
    function arrayLikeKeys(value, inherited) {
      var isArr = isArray$1(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
      for (var key in value) {
        if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
        (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
        isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
        isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
        isIndex(key, length)))) {
          result.push(key);
        }
      }
      return result;
    }
    function overArg(func, transform2) {
      return function(arg) {
        return func(transform2(arg));
      };
    }
    var nativeKeys = overArg(Object.keys, Object);
    var objectProto$7 = Object.prototype;
    var hasOwnProperty$7 = objectProto$7.hasOwnProperty;
    function baseKeys(object) {
      if (!isPrototype(object)) {
        return nativeKeys(object);
      }
      var result = [];
      for (var key in Object(object)) {
        if (hasOwnProperty$7.call(object, key) && key != "constructor") {
          result.push(key);
        }
      }
      return result;
    }
    function keys(object) {
      return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
    }
    function nativeKeysIn(object) {
      var result = [];
      if (object != null) {
        for (var key in Object(object)) {
          result.push(key);
        }
      }
      return result;
    }
    var objectProto$6 = Object.prototype;
    var hasOwnProperty$6 = objectProto$6.hasOwnProperty;
    function baseKeysIn(object) {
      if (!isObject$3(object)) {
        return nativeKeysIn(object);
      }
      var isProto = isPrototype(object), result = [];
      for (var key in object) {
        if (!(key == "constructor" && (isProto || !hasOwnProperty$6.call(object, key)))) {
          result.push(key);
        }
      }
      return result;
    }
    function keysIn(object) {
      return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
    }
    var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
    function isKey(value, object) {
      if (isArray$1(value)) {
        return false;
      }
      var type = typeof value;
      if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
        return true;
      }
      return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
    }
    var nativeCreate = getNative(Object, "create");
    function hashClear() {
      this.__data__ = nativeCreate ? nativeCreate(null) : {};
      this.size = 0;
    }
    function hashDelete(key) {
      var result = this.has(key) && delete this.__data__[key];
      this.size -= result ? 1 : 0;
      return result;
    }
    var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
    var objectProto$5 = Object.prototype;
    var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
    function hashGet(key) {
      var data = this.__data__;
      if (nativeCreate) {
        var result = data[key];
        return result === HASH_UNDEFINED$2 ? void 0 : result;
      }
      return hasOwnProperty$5.call(data, key) ? data[key] : void 0;
    }
    var objectProto$4 = Object.prototype;
    var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
    function hashHas(key) {
      var data = this.__data__;
      return nativeCreate ? data[key] !== void 0 : hasOwnProperty$4.call(data, key);
    }
    var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
    function hashSet(key, value) {
      var data = this.__data__;
      this.size += this.has(key) ? 0 : 1;
      data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
      return this;
    }
    function Hash(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    Hash.prototype.clear = hashClear;
    Hash.prototype["delete"] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;
    function listCacheClear() {
      this.__data__ = [];
      this.size = 0;
    }
    function assocIndexOf(array, key) {
      var length = array.length;
      while (length--) {
        if (eq(array[length][0], key)) {
          return length;
        }
      }
      return -1;
    }
    var arrayProto = Array.prototype;
    var splice = arrayProto.splice;
    function listCacheDelete(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index == lastIndex) {
        data.pop();
      } else {
        splice.call(data, index, 1);
      }
      --this.size;
      return true;
    }
    function listCacheGet(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      return index < 0 ? void 0 : data[index][1];
    }
    function listCacheHas(key) {
      return assocIndexOf(this.__data__, key) > -1;
    }
    function listCacheSet(key, value) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        ++this.size;
        data.push([key, value]);
      } else {
        data[index][1] = value;
      }
      return this;
    }
    function ListCache(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype["delete"] = listCacheDelete;
    ListCache.prototype.get = listCacheGet;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet;
    var Map$1 = getNative(root, "Map");
    function mapCacheClear() {
      this.size = 0;
      this.__data__ = {
        "hash": new Hash(),
        "map": new (Map$1 || ListCache)(),
        "string": new Hash()
      };
    }
    function isKeyable(value) {
      var type = typeof value;
      return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
    }
    function getMapData(map2, key) {
      var data = map2.__data__;
      return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
    }
    function mapCacheDelete(key) {
      var result = getMapData(this, key)["delete"](key);
      this.size -= result ? 1 : 0;
      return result;
    }
    function mapCacheGet(key) {
      return getMapData(this, key).get(key);
    }
    function mapCacheHas(key) {
      return getMapData(this, key).has(key);
    }
    function mapCacheSet(key, value) {
      var data = getMapData(this, key), size2 = data.size;
      data.set(key, value);
      this.size += data.size == size2 ? 0 : 1;
      return this;
    }
    function MapCache(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype["delete"] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;
    var FUNC_ERROR_TEXT$2 = "Expected a function";
    function memoize(func, resolver) {
      if (typeof func != "function" || resolver != null && typeof resolver != "function") {
        throw new TypeError(FUNC_ERROR_TEXT$2);
      }
      var memoized = function() {
        var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
        if (cache2.has(key)) {
          return cache2.get(key);
        }
        var result = func.apply(this, args);
        memoized.cache = cache2.set(key, result) || cache2;
        return result;
      };
      memoized.cache = new (memoize.Cache || MapCache)();
      return memoized;
    }
    memoize.Cache = MapCache;
    var MAX_MEMOIZE_SIZE = 500;
    function memoizeCapped(func) {
      var result = memoize(func, function(key) {
        if (cache2.size === MAX_MEMOIZE_SIZE) {
          cache2.clear();
        }
        return key;
      });
      var cache2 = result.cache;
      return result;
    }
    var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
    var reEscapeChar = /\\(\\)?/g;
    var stringToPath = memoizeCapped(function(string) {
      var result = [];
      if (string.charCodeAt(0) === 46) {
        result.push("");
      }
      string.replace(rePropName, function(match2, number2, quote, subString) {
        result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match2);
      });
      return result;
    });
    function toString(value) {
      return value == null ? "" : baseToString(value);
    }
    function castPath(value, object) {
      if (isArray$1(value)) {
        return value;
      }
      return isKey(value, object) ? [value] : stringToPath(toString(value));
    }
    var INFINITY = 1 / 0;
    function toKey(value) {
      if (typeof value == "string" || isSymbol(value)) {
        return value;
      }
      var result = value + "";
      return result == "0" && 1 / value == -INFINITY ? "-0" : result;
    }
    function baseGet(object, path) {
      path = castPath(path, object);
      var index = 0, length = path.length;
      while (object != null && index < length) {
        object = object[toKey(path[index++])];
      }
      return index && index == length ? object : void 0;
    }
    function get$1(object, path, defaultValue) {
      var result = object == null ? void 0 : baseGet(object, path);
      return result === void 0 ? defaultValue : result;
    }
    function arrayPush(array, values) {
      var index = -1, length = values.length, offset = array.length;
      while (++index < length) {
        array[offset + index] = values[index];
      }
      return array;
    }
    var getPrototype = overArg(Object.getPrototypeOf, Object);
    var objectTag$2 = "[object Object]";
    var funcProto = Function.prototype, objectProto$3 = Object.prototype;
    var funcToString = funcProto.toString;
    var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
    var objectCtorString = funcToString.call(Object);
    function isPlainObject$2(value) {
      if (!isObjectLike(value) || baseGetTag(value) != objectTag$2) {
        return false;
      }
      var proto = getPrototype(value);
      if (proto === null) {
        return true;
      }
      var Ctor = hasOwnProperty$3.call(proto, "constructor") && proto.constructor;
      return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
    }
    function baseSlice(array, start, end) {
      var index = -1, length = array.length;
      if (start < 0) {
        start = -start > length ? 0 : length + start;
      }
      end = end > length ? length : end;
      if (end < 0) {
        end += length;
      }
      length = start > end ? 0 : end - start >>> 0;
      start >>>= 0;
      var result = Array(length);
      while (++index < length) {
        result[index] = array[index + start];
      }
      return result;
    }
    function castSlice(array, start, end) {
      var length = array.length;
      end = end === void 0 ? length : end;
      return !start && end >= length ? array : baseSlice(array, start, end);
    }
    var rsAstralRange$2 = "\\ud800-\\udfff", rsComboMarksRange$3 = "\\u0300-\\u036f", reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$3 = "\\u20d0-\\u20ff", rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3, rsVarRange$2 = "\\ufe0e\\ufe0f";
    var rsZWJ$2 = "\\u200d";
    var reHasUnicode = RegExp("[" + rsZWJ$2 + rsAstralRange$2 + rsComboRange$3 + rsVarRange$2 + "]");
    function hasUnicode(string) {
      return reHasUnicode.test(string);
    }
    function asciiToArray(string) {
      return string.split("");
    }
    var rsAstralRange$1 = "\\ud800-\\udfff", rsComboMarksRange$2 = "\\u0300-\\u036f", reComboHalfMarksRange$2 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$2 = "\\u20d0-\\u20ff", rsComboRange$2 = rsComboMarksRange$2 + reComboHalfMarksRange$2 + rsComboSymbolsRange$2, rsVarRange$1 = "\\ufe0e\\ufe0f";
    var rsAstral = "[" + rsAstralRange$1 + "]", rsCombo$2 = "[" + rsComboRange$2 + "]", rsFitz$1 = "\\ud83c[\\udffb-\\udfff]", rsModifier$1 = "(?:" + rsCombo$2 + "|" + rsFitz$1 + ")", rsNonAstral$1 = "[^" + rsAstralRange$1 + "]", rsRegional$1 = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair$1 = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ$1 = "\\u200d";
    var reOptMod$1 = rsModifier$1 + "?", rsOptVar$1 = "[" + rsVarRange$1 + "]?", rsOptJoin$1 = "(?:" + rsZWJ$1 + "(?:" + [rsNonAstral$1, rsRegional$1, rsSurrPair$1].join("|") + ")" + rsOptVar$1 + reOptMod$1 + ")*", rsSeq$1 = rsOptVar$1 + reOptMod$1 + rsOptJoin$1, rsSymbol = "(?:" + [rsNonAstral$1 + rsCombo$2 + "?", rsCombo$2, rsRegional$1, rsSurrPair$1, rsAstral].join("|") + ")";
    var reUnicode = RegExp(rsFitz$1 + "(?=" + rsFitz$1 + ")|" + rsSymbol + rsSeq$1, "g");
    function unicodeToArray(string) {
      return string.match(reUnicode) || [];
    }
    function stringToArray(string) {
      return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
    }
    function createCaseFirst(methodName) {
      return function(string) {
        string = toString(string);
        var strSymbols = hasUnicode(string) ? stringToArray(string) : void 0;
        var chr = strSymbols ? strSymbols[0] : string.charAt(0);
        var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
        return chr[methodName]() + trailing;
      };
    }
    var upperFirst = createCaseFirst("toUpperCase");
    function arrayReduce(array, iteratee, accumulator, initAccum) {
      var index = -1, length = array == null ? 0 : array.length;
      while (++index < length) {
        accumulator = iteratee(accumulator, array[index], index, array);
      }
      return accumulator;
    }
    function basePropertyOf(object) {
      return function(key) {
        return object == null ? void 0 : object[key];
      };
    }
    var deburredLetters = {
      // 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"
    };
    var deburrLetter = basePropertyOf(deburredLetters);
    var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
    var rsComboMarksRange$1 = "\\u0300-\\u036f", reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$1 = "\\u20d0-\\u20ff", rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
    var rsCombo$1 = "[" + rsComboRange$1 + "]";
    var reComboMark = RegExp(rsCombo$1, "g");
    function deburr(string) {
      string = toString(string);
      return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
    }
    var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
    function asciiWords(string) {
      return string.match(reAsciiWord) || [];
    }
    var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
    function hasUnicodeWord(string) {
      return reHasUnicodeWord.test(string);
    }
    var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\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", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
    var rsApos$1 = "['’]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
    var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos$1 + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos$1 + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
    var reUnicodeWord = RegExp([
      rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
      rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
      rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
      rsUpper + "+" + rsOptContrUpper,
      rsOrdUpper,
      rsOrdLower,
      rsDigits,
      rsEmoji
    ].join("|"), "g");
    function unicodeWords(string) {
      return string.match(reUnicodeWord) || [];
    }
    function words(string, pattern, guard) {
      string = toString(string);
      pattern = pattern;
      if (pattern === void 0) {
        return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
      }
      return string.match(pattern) || [];
    }
    var rsApos = "['’]";
    var reApos = RegExp(rsApos, "g");
    function createCompounder(callback) {
      return function(string) {
        return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
      };
    }
    function stackClear() {
      this.__data__ = new ListCache();
      this.size = 0;
    }
    function stackDelete(key) {
      var data = this.__data__, result = data["delete"](key);
      this.size = data.size;
      return result;
    }
    function stackGet(key) {
      return this.__data__.get(key);
    }
    function stackHas(key) {
      return this.__data__.has(key);
    }
    var LARGE_ARRAY_SIZE = 200;
    function stackSet(key, value) {
      var data = this.__data__;
      if (data instanceof ListCache) {
        var pairs = data.__data__;
        if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
          pairs.push([key, value]);
          this.size = ++data.size;
          return this;
        }
        data = this.__data__ = new MapCache(pairs);
      }
      data.set(key, value);
      this.size = data.size;
      return this;
    }
    function Stack(entries) {
      var data = this.__data__ = new ListCache(entries);
      this.size = data.size;
    }
    Stack.prototype.clear = stackClear;
    Stack.prototype["delete"] = stackDelete;
    Stack.prototype.get = stackGet;
    Stack.prototype.has = stackHas;
    Stack.prototype.set = stackSet;
    var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
    var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var Buffer2 = moduleExports ? root.Buffer : void 0;
    Buffer2 ? Buffer2.allocUnsafe : void 0;
    function cloneBuffer(buffer, isDeep) {
      {
        return buffer.slice();
      }
    }
    function arrayFilter(array, predicate) {
      var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
      while (++index < length) {
        var value = array[index];
        if (predicate(value, index, array)) {
          result[resIndex++] = value;
        }
      }
      return result;
    }
    function stubArray() {
      return [];
    }
    var objectProto$2 = Object.prototype;
    var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
    var nativeGetSymbols = Object.getOwnPropertySymbols;
    var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
      if (object == null) {
        return [];
      }
      object = Object(object);
      return arrayFilter(nativeGetSymbols(object), function(symbol) {
        return propertyIsEnumerable.call(object, symbol);
      });
    };
    function baseGetAllKeys(object, keysFunc, symbolsFunc) {
      var result = keysFunc(object);
      return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
    }
    function getAllKeys(object) {
      return baseGetAllKeys(object, keys, getSymbols);
    }
    var DataView = getNative(root, "DataView");
    var Promise$1 = getNative(root, "Promise");
    var Set$1 = getNative(root, "Set");
    var mapTag$1 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]";
    var dataViewTag$1 = "[object DataView]";
    var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
    var getTag = baseGetTag;
    if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$1 || Map$1 && getTag(new Map$1()) != mapTag$1 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$1 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag) {
      getTag = function(value) {
        var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
        if (ctorString) {
          switch (ctorString) {
            case dataViewCtorString:
              return dataViewTag$1;
            case mapCtorString:
              return mapTag$1;
            case promiseCtorString:
              return promiseTag;
            case setCtorString:
              return setTag$1;
            case weakMapCtorString:
              return weakMapTag;
          }
        }
        return result;
      };
    }
    var Uint8Array2 = root.Uint8Array;
    function cloneArrayBuffer(arrayBuffer) {
      var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
      new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
      return result;
    }
    function cloneTypedArray(typedArray, isDeep) {
      var buffer = cloneArrayBuffer(typedArray.buffer);
      return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
    }
    function initCloneObject(object) {
      return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
    }
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    function setCacheAdd(value) {
      this.__data__.set(value, HASH_UNDEFINED);
      return this;
    }
    function setCacheHas(value) {
      return this.__data__.has(value);
    }
    function SetCache(values) {
      var index = -1, length = values == null ? 0 : values.length;
      this.__data__ = new MapCache();
      while (++index < length) {
        this.add(values[index]);
      }
    }
    SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
    SetCache.prototype.has = setCacheHas;
    function arraySome(array, predicate) {
      var index = -1, length = array == null ? 0 : array.length;
      while (++index < length) {
        if (predicate(array[index], index, array)) {
          return true;
        }
      }
      return false;
    }
    function cacheHas(cache2, key) {
      return cache2.has(key);
    }
    var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
    function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
        return false;
      }
      var arrStacked = stack2.get(array);
      var othStacked = stack2.get(other);
      if (arrStacked && othStacked) {
        return arrStacked == other && othStacked == array;
      }
      var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
      stack2.set(array, other);
      stack2.set(other, array);
      while (++index < arrLength) {
        var arrValue = array[index], othValue = other[index];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack2) : customizer(arrValue, othValue, index, array, other, stack2);
        }
        if (compared !== void 0) {
          if (compared) {
            continue;
          }
          result = false;
          break;
        }
        if (seen) {
          if (!arraySome(other, function(othValue2, othIndex) {
            if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) {
              return seen.push(othIndex);
            }
          })) {
            result = false;
            break;
          }
        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) {
          result = false;
          break;
        }
      }
      stack2["delete"](array);
      stack2["delete"](other);
      return result;
    }
    function mapToArray(map2) {
      var index = -1, result = Array(map2.size);
      map2.forEach(function(value, key) {
        result[++index] = [key, value];
      });
      return result;
    }
    function setToArray(set2) {
      var index = -1, result = Array(set2.size);
      set2.forEach(function(value) {
        result[++index] = value;
      });
      return result;
    }
    var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
    var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
    var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
    var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
    function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack2) {
      switch (tag) {
        case dataViewTag:
          if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
            return false;
          }
          object = object.buffer;
          other = other.buffer;
        case arrayBufferTag:
          if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
            return false;
          }
          return true;
        case boolTag:
        case dateTag:
        case numberTag:
          return eq(+object, +other);
        case errorTag:
          return object.name == other.name && object.message == other.message;
        case regexpTag:
        case stringTag:
          return object == other + "";
        case mapTag:
          var convert = mapToArray;
        case setTag:
          var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
          convert || (convert = setToArray);
          if (object.size != other.size && !isPartial) {
            return false;
          }
          var stacked = stack2.get(object);
          if (stacked) {
            return stacked == other;
          }
          bitmask |= COMPARE_UNORDERED_FLAG$2;
          stack2.set(object, other);
          var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack2);
          stack2["delete"](object);
          return result;
        case symbolTag:
          if (symbolValueOf) {
            return symbolValueOf.call(object) == symbolValueOf.call(other);
          }
      }
      return false;
    }
    var COMPARE_PARTIAL_FLAG$3 = 1;
    var objectProto$1 = Object.prototype;
    var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
    function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
      if (objLength != othLength && !isPartial) {
        return false;
      }
      var index = objLength;
      while (index--) {
        var key = objProps[index];
        if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
          return false;
        }
      }
      var objStacked = stack2.get(object);
      var othStacked = stack2.get(other);
      if (objStacked && othStacked) {
        return objStacked == other && othStacked == object;
      }
      var result = true;
      stack2.set(object, other);
      stack2.set(other, object);
      var skipCtor = isPartial;
      while (++index < objLength) {
        key = objProps[index];
        var objValue = object[key], othValue = other[key];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack2) : customizer(objValue, othValue, key, object, other, stack2);
        }
        if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) {
          result = false;
          break;
        }
        skipCtor || (skipCtor = key == "constructor");
      }
      if (result && !skipCtor) {
        var objCtor = object.constructor, othCtor = other.constructor;
        if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
          result = false;
        }
      }
      stack2["delete"](object);
      stack2["delete"](other);
      return result;
    }
    var COMPARE_PARTIAL_FLAG$2 = 1;
    var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
    var objectProto = Object.prototype;
    var hasOwnProperty$1 = objectProto.hasOwnProperty;
    function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack2) {
      var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
      objTag = objTag == argsTag ? objectTag : objTag;
      othTag = othTag == argsTag ? objectTag : othTag;
      var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
      if (isSameTag && isBuffer(object)) {
        if (!isBuffer(other)) {
          return false;
        }
        objIsArr = true;
        objIsObj = false;
      }
      if (isSameTag && !objIsObj) {
        stack2 || (stack2 = new Stack());
        return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack2);
      }
      if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
        var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
        if (objIsWrapped || othIsWrapped) {
          var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
          stack2 || (stack2 = new Stack());
          return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack2);
        }
      }
      if (!isSameTag) {
        return false;
      }
      stack2 || (stack2 = new Stack());
      return equalObjects(object, other, bitmask, customizer, equalFunc, stack2);
    }
    function baseIsEqual(value, other, bitmask, customizer, stack2) {
      if (value === other) {
        return true;
      }
      if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
        return value !== value && other !== other;
      }
      return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack2);
    }
    var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
    function baseIsMatch(object, source, matchData, customizer) {
      var index = matchData.length, length = index;
      if (object == null) {
        return !length;
      }
      object = Object(object);
      while (index--) {
        var data = matchData[index];
        if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
          return false;
        }
      }
      while (++index < length) {
        data = matchData[index];
        var key = data[0], objValue = object[key], srcValue = data[1];
        if (data[2]) {
          if (objValue === void 0 && !(key in object)) {
            return false;
          }
        } else {
          var stack2 = new Stack();
          var result;
          if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack2) : result)) {
            return false;
          }
        }
      }
      return true;
    }
    function isStrictComparable(value) {
      return value === value && !isObject$3(value);
    }
    function getMatchData(object) {
      var result = keys(object), length = result.length;
      while (length--) {
        var key = result[length], value = object[key];
        result[length] = [key, value, isStrictComparable(value)];
      }
      return result;
    }
    function matchesStrictComparable(key, srcValue) {
      return function(object) {
        if (object == null) {
          return false;
        }
        return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
      };
    }
    function baseMatches(source) {
      var matchData = getMatchData(source);
      if (matchData.length == 1 && matchData[0][2]) {
        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
      }
      return function(object) {
        return object === source || baseIsMatch(object, source, matchData);
      };
    }
    function baseHasIn(object, key) {
      return object != null && key in Object(object);
    }
    function hasPath(object, path, hasFunc) {
      path = castPath(path, object);
      var index = -1, length = path.length, result = false;
      while (++index < length) {
        var key = toKey(path[index]);
        if (!(result = object != null && hasFunc(object, key))) {
          break;
        }
        object = object[key];
      }
      if (result || ++index != length) {
        return result;
      }
      length = object == null ? 0 : object.length;
      return !!length && isLength(length) && isIndex(key, length) && (isArray$1(object) || isArguments(object));
    }
    function hasIn(object, path) {
      return object != null && hasPath(object, path, baseHasIn);
    }
    var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
    function baseMatchesProperty(path, srcValue) {
      if (isKey(path) && isStrictComparable(srcValue)) {
        return matchesStrictComparable(toKey(path), srcValue);
      }
      return function(object) {
        var objValue = get$1(object, path);
        return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
      };
    }
    function baseProperty(key) {
      return function(object) {
        return object == null ? void 0 : object[key];
      };
    }
    function basePropertyDeep(path) {
      return function(object) {
        return baseGet(object, path);
      };
    }
    function property(path) {
      return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
    }
    function baseIteratee(value) {
      if (typeof value == "function") {
        return value;
      }
      if (value == null) {
        return identity;
      }
      if (typeof value == "object") {
        return isArray$1(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
      }
      return property(value);
    }
    function createBaseFor(fromRight) {
      return function(object, iteratee, keysFunc) {
        var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
        while (length--) {
          var key = props[++index];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object;
      };
    }
    var baseFor = createBaseFor();
    function baseForOwn(object, iteratee) {
      return object && baseFor(object, iteratee, keys);
    }
    function createBaseEach(eachFunc, fromRight) {
      return function(collection, iteratee) {
        if (collection == null) {
          return collection;
        }
        if (!isArrayLike(collection)) {
          return eachFunc(collection, iteratee);
        }
        var length = collection.length, index = -1, iterable = Object(collection);
        while (++index < length) {
          if (iteratee(iterable[index], index, iterable) === false) {
            break;
          }
        }
        return collection;
      };
    }
    var baseEach = createBaseEach(baseForOwn);
    var now = function() {
      return root.Date.now();
    };
    var FUNC_ERROR_TEXT$1 = "Expected a function";
    var nativeMax = Math.max, nativeMin = Math.min;
    function debounce(func, wait, options) {
      var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
      if (typeof func != "function") {
        throw new TypeError(FUNC_ERROR_TEXT$1);
      }
      wait = toNumber(wait) || 0;
      if (isObject$3(options)) {
        leading = !!options.leading;
        maxing = "maxWait" in options;
        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
        trailing = "trailing" in options ? !!options.trailing : trailing;
      }
      function invokeFunc(time2) {
        var args = lastArgs, thisArg = lastThis;
        lastArgs = lastThis = void 0;
        lastInvokeTime = time2;
        result = func.apply(thisArg, args);
        return result;
      }
      function leadingEdge(time2) {
        lastInvokeTime = time2;
        timerId = setTimeout(timerExpired, wait);
        return leading ? invokeFunc(time2) : result;
      }
      function remainingWait(time2) {
        var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
        return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
      }
      function shouldInvoke(time2) {
        var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
        return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
      }
      function timerExpired() {
        var time2 = now();
        if (shouldInvoke(time2)) {
          return trailingEdge(time2);
        }
        timerId = setTimeout(timerExpired, remainingWait(time2));
      }
      function trailingEdge(time2) {
        timerId = void 0;
        if (trailing && lastArgs) {
          return invokeFunc(time2);
        }
        lastArgs = lastThis = void 0;
        return result;
      }
      function cancel() {
        if (timerId !== void 0) {
          clearTimeout(timerId);
        }
        lastInvokeTime = 0;
        lastArgs = lastCallTime = lastThis = timerId = void 0;
      }
      function flush() {
        return timerId === void 0 ? result : trailingEdge(now());
      }
      function debounced() {
        var time2 = now(), isInvoking = shouldInvoke(time2);
        lastArgs = arguments;
        lastThis = this;
        lastCallTime = time2;
        if (isInvoking) {
          if (timerId === void 0) {
            return leadingEdge(lastCallTime);
          }
          if (maxing) {
            clearTimeout(timerId);
            timerId = setTimeout(timerExpired, wait);
            return invokeFunc(lastCallTime);
          }
        }
        if (timerId === void 0) {
          timerId = setTimeout(timerExpired, wait);
        }
        return result;
      }
      debounced.cancel = cancel;
      debounced.flush = flush;
      return debounced;
    }
    function assignMergeValue(object, key, value) {
      if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
        baseAssignValue(object, key, value);
      }
    }
    function isArrayLikeObject(value) {
      return isObjectLike(value) && isArrayLike(value);
    }
    function safeGet(object, key) {
      if (key === "constructor" && typeof object[key] === "function") {
        return;
      }
      if (key == "__proto__") {
        return;
      }
      return object[key];
    }
    function toPlainObject(value) {
      return copyObject(value, keysIn(value));
    }
    function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack2) {
      var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack2.get(srcValue);
      if (stacked) {
        assignMergeValue(object, key, stacked);
        return;
      }
      var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack2) : void 0;
      var isCommon = newValue === void 0;
      if (isCommon) {
        var isArr = isArray$1(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
        newValue = srcValue;
        if (isArr || isBuff || isTyped) {
          if (isArray$1(objValue)) {
            newValue = objValue;
          } else if (isArrayLikeObject(objValue)) {
            newValue = copyArray(objValue);
          } else if (isBuff) {
            isCommon = false;
            newValue = cloneBuffer(srcValue);
          } else if (isTyped) {
            isCommon = false;
            newValue = cloneTypedArray(srcValue);
          } else {
            newValue = [];
          }
        } else if (isPlainObject$2(srcValue) || isArguments(srcValue)) {
          newValue = objValue;
          if (isArguments(objValue)) {
            newValue = toPlainObject(objValue);
          } else if (!isObject$3(objValue) || isFunction$1(objValue)) {
            newValue = initCloneObject(srcValue);
          }
        } else {
          isCommon = false;
        }
      }
      if (isCommon) {
        stack2.set(srcValue, newValue);
        mergeFunc(newValue, srcValue, srcIndex, customizer, stack2);
        stack2["delete"](srcValue);
      }
      assignMergeValue(object, key, newValue);
    }
    function baseMerge(object, source, srcIndex, customizer, stack2) {
      if (object === source) {
        return;
      }
      baseFor(source, function(srcValue, key) {
        stack2 || (stack2 = new Stack());
        if (isObject$3(srcValue)) {
          baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack2);
        } else {
          var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack2) : void 0;
          if (newValue === void 0) {
            newValue = srcValue;
          }
          assignMergeValue(object, key, newValue);
        }
      }, keysIn);
    }
    function baseMap(collection, iteratee) {
      var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
      baseEach(collection, function(value, key, collection2) {
        result[++index] = iteratee(value, key, collection2);
      });
      return result;
    }
    function map(collection, iteratee) {
      var func = isArray$1(collection) ? arrayMap : baseMap;
      return func(collection, baseIteratee(iteratee));
    }
    var kebabCase = createCompounder(function(result, word, index) {
      return result + (index ? "-" : "") + word.toLowerCase();
    });
    var merge$1 = createAssigner(function(object, source, srcIndex) {
      baseMerge(object, source, srcIndex);
    });
    var FUNC_ERROR_TEXT = "Expected a function";
    function throttle(func, wait, options) {
      var leading = true, trailing = true;
      if (typeof func != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      if (isObject$3(options)) {
        leading = "leading" in options ? !!options.leading : leading;
        trailing = "trailing" in options ? !!options.trailing : trailing;
      }
      return debounce(func, wait, {
        "leading": leading,
        "maxWait": wait,
        "trailing": trailing
      });
    }
    const commonVariables$m = {
      fontFamily: 'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
      fontFamilyMono: "v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",
      fontWeight: "400",
      fontWeightStrong: "500",
      cubicBezierEaseInOut: "cubic-bezier(.4, 0, .2, 1)",
      cubicBezierEaseOut: "cubic-bezier(0, 0, .2, 1)",
      cubicBezierEaseIn: "cubic-bezier(.4, 0, 1, 1)",
      borderRadius: "3px",
      borderRadiusSmall: "2px",
      fontSize: "14px",
      fontSizeMini: "12px",
      fontSizeTiny: "12px",
      fontSizeSmall: "14px",
      fontSizeMedium: "14px",
      fontSizeLarge: "15px",
      fontSizeHuge: "16px",
      lineHeight: "1.6",
      heightMini: "16px",
      // private now, it's too small
      heightTiny: "22px",
      heightSmall: "28px",
      heightMedium: "34px",
      heightLarge: "40px",
      heightHuge: "46px"
    };
    const {
      fontSize,
      fontFamily,
      lineHeight
    } = commonVariables$m;
    const globalStyle = c$1("body", `
 margin: 0;
 font-size: ${fontSize};
 font-family: ${fontFamily};
 line-height: ${lineHeight};
 -webkit-text-size-adjust: 100%;
 -webkit-tap-highlight-color: transparent;
`, [c$1("input", `
 font-family: inherit;
 font-size: inherit;
 `)]);
    const configProviderInjectionKey = createInjectionKey("n-config-provider");
    const cssrAnchorMetaName = "naive-ui-style";
    function createTheme(theme) {
      return theme;
    }
    function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef) {
      const ssrAdapter2 = useSsrAdapter();
      const NConfigProvider2 = inject(configProviderInjectionKey, null);
      if (style2) {
        const mountStyle = () => {
          const clsPrefix = clsPrefixRef === null || clsPrefixRef === void 0 ? void 0 : clsPrefixRef.value;
          style2.mount({
            id: clsPrefix === void 0 ? mountId : clsPrefix + mountId,
            head: true,
            props: {
              bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
            },
            anchorMetaName: cssrAnchorMetaName,
            ssr: ssrAdapter2,
            parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
          });
          if (!(NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled)) {
            globalStyle.mount({
              id: "n-global",
              head: true,
              anchorMetaName: cssrAnchorMetaName,
              ssr: ssrAdapter2,
              parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
            });
          }
        };
        if (ssrAdapter2) {
          mountStyle();
        } else {
          onBeforeMount(mountStyle);
        }
      }
      const mergedThemeRef = computed(() => {
        var _a;
        const {
          theme: {
            common: selfCommon,
            self: self2,
            peers = {}
          } = {},
          themeOverrides: selfOverrides = {},
          builtinThemeOverrides: builtinOverrides = {}
        } = props;
        const {
          common: selfCommonOverrides,
          peers: peersOverrides
        } = selfOverrides;
        const {
          common: globalCommon = void 0,
          [resolveId]: {
            common: globalSelfCommon = void 0,
            self: globalSelf = void 0,
            peers: globalPeers = {}
          } = {}
        } = (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value) || {};
        const {
          common: globalCommonOverrides = void 0,
          [resolveId]: globalSelfOverrides = {}
        } = (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value) || {};
        const {
          common: globalSelfCommonOverrides,
          peers: globalPeersOverrides = {}
        } = globalSelfOverrides;
        const mergedCommon = merge$1({}, selfCommon || globalSelfCommon || globalCommon || defaultTheme.common, globalCommonOverrides, globalSelfCommonOverrides, selfCommonOverrides);
        const mergedSelf = merge$1(
          // {}, executed every time, no need for empty obj
          (_a = self2 || globalSelf || defaultTheme.self) === null || _a === void 0 ? void 0 : _a(mergedCommon),
          builtinOverrides,
          globalSelfOverrides,
          selfOverrides
        );
        return {
          common: mergedCommon,
          self: mergedSelf,
          peers: merge$1({}, defaultTheme.peers, globalPeers, peers),
          peerOverrides: merge$1({}, builtinOverrides.peers, globalPeersOverrides, peersOverrides)
        };
      });
      return mergedThemeRef;
    }
    useTheme.props = {
      theme: Object,
      themeOverrides: Object,
      builtinThemeOverrides: Object
    };
    const defaultClsPrefix = "n";
    function useConfig(props = {}, options = {
      defaultBordered: true
    }) {
      const NConfigProvider2 = inject(configProviderInjectionKey, null);
      return {
        // NConfigProvider,
        inlineThemeDisabled: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled,
        mergedRtlRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef,
        mergedComponentPropsRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef,
        mergedBreakpointsRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef,
        mergedBorderedRef: computed(() => {
          var _a, _b;
          const {
            bordered
          } = props;
          if (bordered !== void 0) return bordered;
          return (_b = (_a = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBorderedRef.value) !== null && _a !== void 0 ? _a : options.defaultBordered) !== null && _b !== void 0 ? _b : true;
        }),
        mergedClsPrefixRef: NConfigProvider2 ? NConfigProvider2.mergedClsPrefixRef : shallowRef(defaultClsPrefix),
        namespaceRef: computed(() => NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value)
      };
    }
    const enUS$1 = {
      name: "en-US",
      global: {
        undo: "Undo",
        redo: "Redo",
        confirm: "Confirm",
        clear: "Clear"
      },
      Popconfirm: {
        positiveText: "Confirm",
        negativeText: "Cancel"
      },
      Cascader: {
        placeholder: "Please Select",
        loading: "Loading",
        loadingRequiredMessage: (label) => `Please load all ${label}'s descendants before checking it.`
      },
      Time: {
        dateFormat: "yyyy-MM-dd",
        dateTimeFormat: "yyyy-MM-dd HH:mm:ss"
      },
      DatePicker: {
        yearFormat: "yyyy",
        monthFormat: "MMM",
        dayFormat: "eeeeee",
        yearTypeFormat: "yyyy",
        monthTypeFormat: "yyyy-MM",
        dateFormat: "yyyy-MM-dd",
        dateTimeFormat: "yyyy-MM-dd HH:mm:ss",
        quarterFormat: "yyyy-qqq",
        weekFormat: "YYYY-w",
        clear: "Clear",
        now: "Now",
        confirm: "Confirm",
        selectTime: "Select Time",
        selectDate: "Select Date",
        datePlaceholder: "Select Date",
        datetimePlaceholder: "Select Date and Time",
        monthPlaceholder: "Select Month",
        yearPlaceholder: "Select Year",
        quarterPlaceholder: "Select Quarter",
        weekPlaceholder: "Select Week",
        startDatePlaceholder: "Start Date",
        endDatePlaceholder: "End Date",
        startDatetimePlaceholder: "Start Date and Time",
        endDatetimePlaceholder: "End Date and Time",
        startMonthPlaceholder: "Start Month",
        endMonthPlaceholder: "End Month",
        monthBeforeYear: true,
        firstDayOfWeek: 6,
        today: "Today"
      },
      DataTable: {
        checkTableAll: "Select all in the table",
        uncheckTableAll: "Unselect all in the table",
        confirm: "Confirm",
        clear: "Clear"
      },
      LegacyTransfer: {
        sourceTitle: "Source",
        targetTitle: "Target"
      },
      Transfer: {
        selectAll: "Select all",
        unselectAll: "Unselect all",
        clearAll: "Clear",
        total: (num) => `Total ${num} items`,
        selected: (num) => `${num} items selected`
      },
      Empty: {
        description: "No Data"
      },
      Select: {
        placeholder: "Please Select"
      },
      TimePicker: {
        placeholder: "Select Time",
        positiveText: "OK",
        negativeText: "Cancel",
        now: "Now",
        clear: "Clear"
      },
      Pagination: {
        goto: "Goto",
        selectionSuffix: "page"
      },
      DynamicTags: {
        add: "Add"
      },
      Log: {
        loading: "Loading"
      },
      Input: {
        placeholder: "Please Input"
      },
      InputNumber: {
        placeholder: "Please Input"
      },
      DynamicInput: {
        create: "Create"
      },
      ThemeEditor: {
        title: "Theme Editor",
        clearAllVars: "Clear All Variables",
        clearSearch: "Clear Search",
        filterCompName: "Filter Component Name",
        filterVarName: "Filter Variable Name",
        import: "Import",
        export: "Export",
        restore: "Reset to Default"
      },
      Image: {
        tipPrevious: "Previous picture (←)",
        tipNext: "Next picture (→)",
        tipCounterclockwise: "Counterclockwise",
        tipClockwise: "Clockwise",
        tipZoomOut: "Zoom out",
        tipZoomIn: "Zoom in",
        tipDownload: "Download",
        tipClose: "Close (Esc)",
        // TODO: translation
        tipOriginalSize: "Zoom to original size"
      }
    };
    function buildFormatLongFn(args) {
      return (options = {}) => {
        const width = options.width ? String(options.width) : args.defaultWidth;
        const format2 = args.formats[width] || args.formats[args.defaultWidth];
        return format2;
      };
    }
    function buildLocalizeFn(args) {
      return (value, options) => {
        const context = options?.context ? String(options.context) : "standalone";
        let valuesArray;
        if (context === "formatting" && args.formattingValues) {
          const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
          const width = options?.width ? String(options.width) : defaultWidth;
          valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
        } else {
          const defaultWidth = args.defaultWidth;
          const width = options?.width ? String(options.width) : args.defaultWidth;
          valuesArray = args.values[width] || args.values[defaultWidth];
        }
        const index = args.argumentCallback ? args.argumentCallback(value) : value;
        return valuesArray[index];
      };
    }
    function buildMatchFn(args) {
      return (string, options = {}) => {
        const width = options.width;
        const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
        const matchResult = string.match(matchPattern);
        if (!matchResult) {
          return null;
        }
        const matchedString = matchResult[0];
        const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
        const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
          // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
          findKey(parsePatterns, (pattern) => pattern.test(matchedString))
        );
        let value;
        value = args.valueCallback ? args.valueCallback(key) : key;
        value = options.valueCallback ? (
          // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
          options.valueCallback(value)
        ) : value;
        const rest = string.slice(matchedString.length);
        return { value, rest };
      };
    }
    function findKey(object, predicate) {
      for (const key in object) {
        if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
          return key;
        }
      }
      return void 0;
    }
    function findIndex(array, predicate) {
      for (let key = 0; key < array.length; key++) {
        if (predicate(array[key])) {
          return key;
        }
      }
      return void 0;
    }
    function buildMatchPatternFn(args) {
      return (string, options = {}) => {
        const matchResult = string.match(args.matchPattern);
        if (!matchResult) return null;
        const matchedString = matchResult[0];
        const parseResult = string.match(args.parsePattern);
        if (!parseResult) return null;
        let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
        value = options.valueCallback ? options.valueCallback(value) : value;
        const rest = string.slice(matchedString.length);
        return { value, rest };
      };
    }
    const formatDistanceLocale = {
      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"
      }
    };
    const formatDistance = (token, count, options) => {
      let result;
      const tokenValue = formatDistanceLocale[token];
      if (typeof tokenValue === "string") {
        result = tokenValue;
      } else if (count === 1) {
        result = tokenValue.one;
      } else {
        result = tokenValue.other.replace("{{count}}", count.toString());
      }
      if (options?.addSuffix) {
        if (options.comparison && options.comparison > 0) {
          return "in " + result;
        } else {
          return result + " ago";
        }
      }
      return result;
    };
    const formatRelativeLocale = {
      lastWeek: "'last' eeee 'at' p",
      yesterday: "'yesterday at' p",
      today: "'today at' p",
      tomorrow: "'tomorrow at' p",
      nextWeek: "eeee 'at' p",
      other: "P"
    };
    const formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
    const eraValues = {
      narrow: ["B", "A"],
      abbreviated: ["BC", "AD"],
      wide: ["Before Christ", "Anno Domini"]
    };
    const quarterValues = {
      narrow: ["1", "2", "3", "4"],
      abbreviated: ["Q1", "Q2", "Q3", "Q4"],
      wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
    };
    const monthValues = {
      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"
      ]
    };
    const dayValues = {
      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"
      ]
    };
    const dayPeriodValues = {
      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"
      }
    };
    const formattingDayPeriodValues = {
      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"
      }
    };
    const ordinalNumber = (dirtyNumber, _options) => {
      const number2 = Number(dirtyNumber);
      const rem100 = number2 % 100;
      if (rem100 > 20 || rem100 < 10) {
        switch (rem100 % 10) {
          case 1:
            return number2 + "st";
          case 2:
            return number2 + "nd";
          case 3:
            return number2 + "rd";
        }
      }
      return number2 + "th";
    };
    const localize = {
      ordinalNumber,
      era: buildLocalizeFn({
        values: eraValues,
        defaultWidth: "wide"
      }),
      quarter: buildLocalizeFn({
        values: quarterValues,
        defaultWidth: "wide",
        argumentCallback: (quarter) => quarter - 1
      }),
      month: buildLocalizeFn({
        values: monthValues,
        defaultWidth: "wide"
      }),
      day: buildLocalizeFn({
        values: dayValues,
        defaultWidth: "wide"
      }),
      dayPeriod: buildLocalizeFn({
        values: dayPeriodValues,
        defaultWidth: "wide",
        formattingValues: formattingDayPeriodValues,
        defaultFormattingWidth: "wide"
      })
    };
    const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
    const parseOrdinalNumberPattern = /\d+/i;
    const matchEraPatterns = {
      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
    };
    const parseEraPatterns = {
      any: [/^b/i, /^(a|c)/i]
    };
    const matchQuarterPatterns = {
      narrow: /^[1234]/i,
      abbreviated: /^q[1234]/i,
      wide: /^[1234](th|st|nd|rd)? quarter/i
    };
    const parseQuarterPatterns = {
      any: [/1/i, /2/i, /3/i, /4/i]
    };
    const matchMonthPatterns = {
      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
    };
    const parseMonthPatterns = {
      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
      ]
    };
    const matchDayPatterns = {
      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
    };
    const parseDayPatterns = {
      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]
    };
    const matchDayPeriodPatterns = {
      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
    };
    const parseDayPeriodPatterns = {
      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
      }
    };
    const match = {
      ordinalNumber: buildMatchPatternFn({
        matchPattern: matchOrdinalNumberPattern,
        parsePattern: parseOrdinalNumberPattern,
        valueCallback: (value) => parseInt(value, 10)
      }),
      era: buildMatchFn({
        matchPatterns: matchEraPatterns,
        defaultMatchWidth: "wide",
        parsePatterns: parseEraPatterns,
        defaultParseWidth: "any"
      }),
      quarter: buildMatchFn({
        matchPatterns: matchQuarterPatterns,
        defaultMatchWidth: "wide",
        parsePatterns: parseQuarterPatterns,
        defaultParseWidth: "any",
        valueCallback: (index) => index + 1
      }),
      month: buildMatchFn({
        matchPatterns: matchMonthPatterns,
        defaultMatchWidth: "wide",
        parsePatterns: parseMonthPatterns,
        defaultParseWidth: "any"
      }),
      day: buildMatchFn({
        matchPatterns: matchDayPatterns,
        defaultMatchWidth: "wide",
        parsePatterns: parseDayPatterns,
        defaultParseWidth: "any"
      }),
      dayPeriod: buildMatchFn({
        matchPatterns: matchDayPeriodPatterns,
        defaultMatchWidth: "any",
        parsePatterns: parseDayPeriodPatterns,
        defaultParseWidth: "any"
      })
    };
    const dateFormats = {
      full: "EEEE, MMMM do, y",
      long: "MMMM do, y",
      medium: "MMM d, y",
      short: "MM/dd/yyyy"
    };
    const timeFormats = {
      full: "h:mm:ss a zzzz",
      long: "h:mm:ss a z",
      medium: "h:mm:ss a",
      short: "h:mm a"
    };
    const dateTimeFormats = {
      full: "{{date}} 'at' {{time}}",
      long: "{{date}} 'at' {{time}}",
      medium: "{{date}}, {{time}}",
      short: "{{date}}, {{time}}"
    };
    const formatLong = {
      date: buildFormatLongFn({
        formats: dateFormats,
        defaultWidth: "full"
      }),
      time: buildFormatLongFn({
        formats: timeFormats,
        defaultWidth: "full"
      }),
      dateTime: buildFormatLongFn({
        formats: dateTimeFormats,
        defaultWidth: "full"
      })
    };
    const enUS = {
      code: "en-US",
      formatDistance,
      formatLong,
      formatRelative,
      localize,
      match,
      options: {
        weekStartsOn: 0,
        firstWeekContainsDate: 1
      }
    };
    const dateEnUs = {
      name: "en-US",
      locale: enUS
    };
    function useLocale(ns) {
      const {
        mergedLocaleRef,
        mergedDateLocaleRef
      } = inject(configProviderInjectionKey, null) || {};
      const localeRef = computed(() => {
        var _a, _b;
        return (_b = (_a = mergedLocaleRef === null || mergedLocaleRef === void 0 ? void 0 : mergedLocaleRef.value) === null || _a === void 0 ? void 0 : _a[ns]) !== null && _b !== void 0 ? _b : enUS$1[ns];
      });
      const dateLocaleRef = computed(() => {
        var _a;
        return (_a = mergedDateLocaleRef === null || mergedDateLocaleRef === void 0 ? void 0 : mergedDateLocaleRef.value) !== null && _a !== void 0 ? _a : dateEnUs;
      });
      return {
        dateLocaleRef,
        localeRef
      };
    }
    function useStyle(mountId, style2, clsPrefixRef) {
      if (!style2) {
        return;
      }
      const ssrAdapter2 = useSsrAdapter();
      const NConfigProvider2 = inject(configProviderInjectionKey, null);
      const mountStyle = () => {
        const clsPrefix = clsPrefixRef.value;
        style2.mount({
          id: clsPrefix === void 0 ? mountId : clsPrefix + mountId,
          head: true,
          anchorMetaName: cssrAnchorMetaName,
          props: {
            bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
          },
          ssr: ssrAdapter2,
          parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
        });
        if (!(NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled)) {
          globalStyle.mount({
            id: "n-global",
            head: true,
            anchorMetaName: cssrAnchorMetaName,
            ssr: ssrAdapter2,
            parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
          });
        }
      };
      if (ssrAdapter2) {
        mountStyle();
      } else {
        onBeforeMount(mountStyle);
      }
    }
    function useHljs(props, shouldHighlightRef) {
      const NConfigProvider2 = inject(configProviderInjectionKey, null);
      return computed(() => {
        return props.hljs || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedHljsRef.value);
      });
    }
    function useThemeClass(componentName, hashRef, cssVarsRef, props) {
      if (!cssVarsRef) throwError("useThemeClass", "cssVarsRef is not passed");
      const NConfigProvider2 = inject(configProviderInjectionKey, null);
      const mergedThemeHashRef = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeHashRef;
      const styleMountTarget = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget;
      const themeClassRef = ref("");
      const ssrAdapter2 = useSsrAdapter();
      let renderCallback;
      const hashClassPrefix = `__${componentName}`;
      const mountStyle = () => {
        let finalThemeHash = hashClassPrefix;
        const hashValue = hashRef ? hashRef.value : void 0;
        const themeHash = mergedThemeHashRef === null || mergedThemeHashRef === void 0 ? void 0 : mergedThemeHashRef.value;
        if (themeHash) finalThemeHash += `-${themeHash}`;
        if (hashValue) finalThemeHash += `-${hashValue}`;
        const {
          themeOverrides,
          builtinThemeOverrides
        } = props;
        if (themeOverrides) {
          finalThemeHash += `-${murmur2(JSON.stringify(themeOverrides))}`;
        }
        if (builtinThemeOverrides) {
          finalThemeHash += `-${murmur2(JSON.stringify(builtinThemeOverrides))}`;
        }
        themeClassRef.value = finalThemeHash;
        renderCallback = () => {
          const cssVars = cssVarsRef.value;
          let style2 = "";
          for (const key in cssVars) {
            style2 += `${key}: ${cssVars[key]};`;
          }
          c$1(`.${finalThemeHash}`, style2).mount({
            id: finalThemeHash,
            ssr: ssrAdapter2,
            parent: styleMountTarget
          });
          renderCallback = void 0;
        };
      };
      watchEffect(() => {
        mountStyle();
      });
      return {
        themeClass: themeClassRef,
        onRender: () => {
          renderCallback === null || renderCallback === void 0 ? void 0 : renderCallback();
        }
      };
    }
    function useRtl(mountId, rtlStateRef, clsPrefixRef) {
      if (!rtlStateRef) return void 0;
      const ssrAdapter2 = useSsrAdapter();
      const componentRtlStateRef = computed(() => {
        const {
          value: rtlState
        } = rtlStateRef;
        if (!rtlState) {
          return void 0;
        }
        const componentRtlState = rtlState[mountId];
        if (!componentRtlState) {
          return void 0;
        }
        return componentRtlState;
      });
      const NConfigProvider2 = inject(configProviderInjectionKey, null);
      const mountStyle = () => {
        watchEffect(() => {
          const {
            value: clsPrefix
          } = clsPrefixRef;
          const id = `${clsPrefix}${mountId}Rtl`;
          if (exists(id, ssrAdapter2)) return;
          const {
            value: componentRtlState
          } = componentRtlStateRef;
          if (!componentRtlState) return;
          componentRtlState.style.mount({
            id,
            head: true,
            anchorMetaName: cssrAnchorMetaName,
            props: {
              bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
            },
            ssr: ssrAdapter2,
            parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
          });
        });
      };
      if (ssrAdapter2) {
        mountStyle();
      } else {
        onBeforeMount(mountStyle);
      }
      return componentRtlStateRef;
    }
    const AddIcon = /* @__PURE__ */ defineComponent({
      name: "Add",
      render() {
        return h("svg", {
          width: "512",
          height: "512",
          viewBox: "0 0 512 512",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg"
        }, h("path", {
          d: "M256 112V400M400 256H112",
          stroke: "currentColor",
          "stroke-width": "32",
          "stroke-linecap": "round",
          "stroke-linejoin": "round"
        }));
      }
    });
    function replaceable(name, icon) {
      return /* @__PURE__ */ defineComponent({
        name: upperFirst(name),
        setup() {
          var _a;
          const mergedIconsRef = (_a = inject(configProviderInjectionKey, null)) === null || _a === void 0 ? void 0 : _a.mergedIconsRef;
          return () => {
            var _a2;
            const iconOverride = (_a2 = mergedIconsRef === null || mergedIconsRef === void 0 ? void 0 : mergedIconsRef.value) === null || _a2 === void 0 ? void 0 : _a2[name];
            return iconOverride ? iconOverride() : icon;
          };
        }
      });
    }
    const AttachIcon = replaceable("attach", h("svg", {
      viewBox: "0 0 16 16",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      fill: "none",
      "fill-rule": "evenodd"
    }, h("g", {
      fill: "currentColor",
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"
    })))));
    const FinishedIcon = /* @__PURE__ */ defineComponent({
      name: "Checkmark",
      render() {
        return h("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 16 16"
        }, h("g", {
          fill: "none"
        }, h("path", {
          d: "M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",
          fill: "currentColor"
        })));
      }
    });
    const ErrorIcon$1 = replaceable("close", h("svg", {
      viewBox: "0 0 12 12",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg",
      "aria-hidden": true
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      fill: "none",
      "fill-rule": "evenodd"
    }, h("g", {
      fill: "currentColor",
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"
    })))));
    const EyeIcon = /* @__PURE__ */ defineComponent({
      name: "Eye",
      render() {
        return h("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 512 512"
        }, h("path", {
          d: "M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",
          fill: "none",
          stroke: "currentColor",
          "stroke-linecap": "round",
          "stroke-linejoin": "round",
          "stroke-width": "32"
        }), h("circle", {
          cx: "256",
          cy: "256",
          r: "80",
          fill: "none",
          stroke: "currentColor",
          "stroke-miterlimit": "10",
          "stroke-width": "32"
        }));
      }
    });
    const EyeOffIcon = /* @__PURE__ */ defineComponent({
      name: "EyeOff",
      render() {
        return h("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 512 512"
        }, h("path", {
          d: "M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",
          fill: "currentColor"
        }), h("path", {
          d: "M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",
          fill: "currentColor"
        }), h("path", {
          d: "M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",
          fill: "currentColor"
        }), h("path", {
          d: "M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",
          fill: "currentColor"
        }), h("path", {
          d: "M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",
          fill: "currentColor"
        }));
      }
    });
    const TrashIcon = replaceable("trash", h("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 512 512"
    }, h("path", {
      d: "M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",
      style: "fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"
    }), h("rect", {
      x: "32",
      y: "64",
      width: "448",
      height: "80",
      rx: "16",
      ry: "16",
      style: "fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"
    }), h("line", {
      x1: "312",
      y1: "240",
      x2: "200",
      y2: "352",
      style: "fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"
    }), h("line", {
      x1: "312",
      y1: "352",
      x2: "200",
      y2: "240",
      style: "fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"
    })));
    const DownloadIcon = replaceable("download", h("svg", {
      viewBox: "0 0 16 16",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      fill: "none",
      "fill-rule": "evenodd"
    }, h("g", {
      fill: "currentColor",
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"
    })))));
    const EmptyIcon = /* @__PURE__ */ defineComponent({
      name: "Empty",
      render() {
        return h("svg", {
          viewBox: "0 0 28 28",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg"
        }, h("path", {
          d: "M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",
          fill: "currentColor"
        }), h("path", {
          d: "M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",
          fill: "currentColor"
        }));
      }
    });
    const ErrorIcon = replaceable("error", h("svg", {
      viewBox: "0 0 48 48",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      "fill-rule": "evenodd"
    }, h("g", {
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"
    })))));
    const InfoIcon = replaceable("info", h("svg", {
      viewBox: "0 0 28 28",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      "fill-rule": "evenodd"
    }, h("g", {
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"
    })))));
    const RemoveIcon = /* @__PURE__ */ defineComponent({
      name: "Remove",
      render() {
        return h("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 512 512"
        }, h("line", {
          x1: "400",
          y1: "256",
          x2: "112",
          y2: "256",
          style: "\n        fill: none;\n        stroke: currentColor;\n        stroke-linecap: round;\n        stroke-linejoin: round;\n        stroke-width: 32px;\n      "
        }));
      }
    });
    const SuccessIcon = replaceable("success", h("svg", {
      viewBox: "0 0 48 48",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      "fill-rule": "evenodd"
    }, h("g", {
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"
    })))));
    const WarningIcon = replaceable("warning", h("svg", {
      viewBox: "0 0 24 24",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      "fill-rule": "evenodd"
    }, h("g", {
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"
    })))));
    const CancelIcon = replaceable("cancel", h("svg", {
      viewBox: "0 0 16 16",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      fill: "none",
      "fill-rule": "evenodd"
    }, h("g", {
      fill: "currentColor",
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3535534,3.35355339 L8.707,8 L13.3535534,12.6464466 C13.5271197,12.820013 13.5464049,13.0894374 13.4114088,13.2843055 L13.3535534,13.3535534 C13.179987,13.5271197 12.9105626,13.5464049 12.7156945,13.4114088 L12.6464466,13.3535534 L8,8.707 L3.35355339,13.3535534 C3.15829124,13.5488155 2.84170876,13.5488155 2.64644661,13.3535534 C2.45118446,13.1582912 2.45118446,12.8417088 2.64644661,12.6464466 L7.293,8 L2.64644661,3.35355339 C2.47288026,3.17998704 2.45359511,2.91056264 2.58859116,2.7156945 L2.64644661,2.64644661 L2.58859116,2.7156945 Z"
    })))));
    const ChevronDownIcon = /* @__PURE__ */ defineComponent({
      name: "ChevronDown",
      render() {
        return h("svg", {
          viewBox: "0 0 16 16",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg"
        }, h("path", {
          d: "M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",
          fill: "currentColor"
        }));
      }
    });
    const ClearIcon = replaceable("clear", h("svg", {
      viewBox: "0 0 16 16",
      version: "1.1",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("g", {
      stroke: "none",
      "stroke-width": "1",
      fill: "none",
      "fill-rule": "evenodd"
    }, h("g", {
      fill: "currentColor",
      "fill-rule": "nonzero"
    }, h("path", {
      d: "M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"
    })))));
    const RetryIcon = replaceable("retry", h("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 512 512"
    }, h("path", {
      d: "M320,146s24.36-12-64-12A160,160,0,1,0,416,294",
      style: "fill: none; stroke: currentcolor; stroke-linecap: round; stroke-miterlimit: 10; stroke-width: 32px;"
    }), h("polyline", {
      points: "256 58 336 138 256 218",
      style: "fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"
    })));
    const RotateClockwiseIcon = replaceable("rotateClockwise", h("svg", {
      viewBox: "0 0 20 20",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("path", {
      d: "M3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 12.7916 15.3658 15.2026 13 16.3265V14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5V17.5C12 17.7761 12.2239 18 12.5 18H15.5C15.7761 18 16 17.7761 16 17.5C16 17.2239 15.7761 17 15.5 17H13.8758C16.3346 15.6357 18 13.0128 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 10.2761 2.22386 10.5 2.5 10.5C2.77614 10.5 3 10.2761 3 10Z",
      fill: "currentColor"
    }), h("path", {
      d: "M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12ZM10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11Z",
      fill: "currentColor"
    })));
    const RotateCounterclockwiseIcon = replaceable("rotateClockwise", h("svg", {
      viewBox: "0 0 20 20",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("path", {
      d: "M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 12.7916 4.63419 15.2026 7 16.3265V14.5C7 14.2239 7.22386 14 7.5 14C7.77614 14 8 14.2239 8 14.5V17.5C8 17.7761 7.77614 18 7.5 18H4.5C4.22386 18 4 17.7761 4 17.5C4 17.2239 4.22386 17 4.5 17H6.12422C3.66539 15.6357 2 13.0128 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 10.2761 17.7761 10.5 17.5 10.5C17.2239 10.5 17 10.2761 17 10Z",
      fill: "currentColor"
    }), h("path", {
      d: "M10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10C12 11.1046 11.1046 12 10 12ZM10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",
      fill: "currentColor"
    })));
    const ZoomInIcon = replaceable("zoomIn", h("svg", {
      viewBox: "0 0 20 20",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("path", {
      d: "M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5Z",
      fill: "currentColor"
    }), h("path", {
      d: "M8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z",
      fill: "currentColor"
    })));
    const ZoomOutIcon = replaceable("zoomOut", h("svg", {
      viewBox: "0 0 20 20",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("path", {
      d: "M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11Z",
      fill: "currentColor"
    }), h("path", {
      d: "M14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z",
      fill: "currentColor"
    })));
    const ResizeSmallIcon = /* @__PURE__ */ defineComponent({
      name: "ResizeSmall",
      render() {
        return h("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 20 20"
        }, h("g", {
          fill: "none"
        }, h("path", {
          d: "M5.5 4A1.5 1.5 0 0 0 4 5.5v1a.5.5 0 0 1-1 0v-1A2.5 2.5 0 0 1 5.5 3h1a.5.5 0 0 1 0 1h-1zM16 5.5A1.5 1.5 0 0 0 14.5 4h-1a.5.5 0 0 1 0-1h1A2.5 2.5 0 0 1 17 5.5v1a.5.5 0 0 1-1 0v-1zm0 9a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 0 0 1h1a2.5 2.5 0 0 0 2.5-2.5v-1a.5.5 0 0 0-1 0v1zm-12 0A1.5 1.5 0 0 0 5.5 16h1.25a.5.5 0 0 1 0 1H5.5A2.5 2.5 0 0 1 3 14.5v-1.25a.5.5 0 0 1 1 0v1.25zM8.5 7A1.5 1.5 0 0 0 7 8.5v3A1.5 1.5 0 0 0 8.5 13h3a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 11.5 7h-3zM8 8.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3z",
          fill: "currentColor"
        })));
      }
    });
    const NIconSwitchTransition = /* @__PURE__ */ defineComponent({
      name: "BaseIconSwitchTransition",
      setup(_, {
        slots
      }) {
        const isMountedRef = isMounted();
        return () => h(Transition, {
          name: "icon-switch-transition",
          appear: isMountedRef.value
        }, slots);
      }
    });
    const NFadeInExpandTransition = /* @__PURE__ */ defineComponent({
      name: "FadeInExpandTransition",
      props: {
        appear: Boolean,
        group: Boolean,
        mode: String,
        onLeave: Function,
        onAfterLeave: Function,
        onAfterEnter: Function,
        width: Boolean,
        // reverse mode is only used in tree
        // it make it from expanded to collapsed after mounted
        reverse: Boolean
      },
      setup(props, {
        slots
      }) {
        function handleBeforeLeave(el) {
          if (props.width) {
            el.style.maxWidth = `${el.offsetWidth}px`;
          } else {
            el.style.maxHeight = `${el.offsetHeight}px`;
          }
          void el.offsetWidth;
        }
        function handleLeave(el) {
          if (props.width) {
            el.style.maxWidth = "0";
          } else {
            el.style.maxHeight = "0";
          }
          void el.offsetWidth;
          const {
            onLeave
          } = props;
          if (onLeave) onLeave();
        }
        function handleAfterLeave(el) {
          if (props.width) {
            el.style.maxWidth = "";
          } else {
            el.style.maxHeight = "";
          }
          const {
            onAfterLeave
          } = props;
          if (onAfterLeave) onAfterLeave();
        }
        function handleEnter(el) {
          el.style.transition = "none";
          if (props.width) {
            const memorizedWidth = el.offsetWidth;
            el.style.maxWidth = "0";
            void el.offsetWidth;
            el.style.transition = "";
            el.style.maxWidth = `${memorizedWidth}px`;
          } else {
            if (props.reverse) {
              el.style.maxHeight = `${el.offsetHeight}px`;
              void el.offsetHeight;
              el.style.transition = "";
              el.style.maxHeight = "0";
            } else {
              const memorizedHeight = el.offsetHeight;
              el.style.maxHeight = "0";
              void el.offsetWidth;
              el.style.transition = "";
              el.style.maxHeight = `${memorizedHeight}px`;
            }
          }
          void el.offsetWidth;
        }
        function handleAfterEnter(el) {
          var _a;
          if (props.width) {
            el.style.maxWidth = "";
          } else {
            if (!props.reverse) {
              el.style.maxHeight = "";
            }
          }
          (_a = props.onAfterEnter) === null || _a === void 0 ? void 0 : _a.call(props);
        }
        return () => {
          const {
            group,
            width,
            appear,
            mode
          } = props;
          const type = group ? TransitionGroup : Transition;
          const resolvedProps = {
            name: width ? "fade-in-width-expand-transition" : "fade-in-height-expand-transition",
            appear,
            onEnter: handleEnter,
            onAfterEnter: handleAfterEnter,
            onBeforeLeave: handleBeforeLeave,
            onLeave: handleLeave,
            onAfterLeave: handleAfterLeave
          };
          if (!group) {
            resolvedProps.mode = mode;
          }
          return h(type, resolvedProps, slots);
        };
      }
    });
    const style$s = cB("base-icon", `
 height: 1em;
 width: 1em;
 line-height: 1em;
 text-align: center;
 display: inline-block;
 position: relative;
 fill: currentColor;
 transform: translateZ(0);
`, [c$1("svg", `
 height: 1em;
 width: 1em;
 `)]);
    const NBaseIcon = /* @__PURE__ */ defineComponent({
      name: "BaseIcon",
      props: {
        role: String,
        ariaLabel: String,
        ariaDisabled: {
          type: Boolean,
          default: void 0
        },
        ariaHidden: {
          type: Boolean,
          default: void 0
        },
        clsPrefix: {
          type: String,
          required: true
        },
        onClick: Function,
        onMousedown: Function,
        onMouseup: Function
      },
      setup(props) {
        useStyle("-base-icon", style$s, toRef(props, "clsPrefix"));
      },
      render() {
        return h("i", {
          class: `${this.clsPrefix}-base-icon`,
          onClick: this.onClick,
          onMousedown: this.onMousedown,
          onMouseup: this.onMouseup,
          role: this.role,
          "aria-label": this.ariaLabel,
          "aria-hidden": this.ariaHidden,
          "aria-disabled": this.ariaDisabled
        }, this.$slots);
      }
    });
    const style$r = cB("base-close", `
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 background-color: transparent;
 color: var(--n-close-icon-color);
 border-radius: var(--n-close-border-radius);
 height: var(--n-close-size);
 width: var(--n-close-size);
 font-size: var(--n-close-icon-size);
 outline: none;
 border: none;
 position: relative;
 padding: 0;
`, [cM("absolute", `
 height: var(--n-close-icon-size);
 width: var(--n-close-icon-size);
 `), c$1("&::before", `
 content: "";
 position: absolute;
 width: var(--n-close-size);
 height: var(--n-close-size);
 left: 50%;
 top: 50%;
 transform: translateY(-50%) translateX(-50%);
 transition: inherit;
 border-radius: inherit;
 `), cNotM("disabled", [c$1("&:hover", `
 color: var(--n-close-icon-color-hover);
 `), c$1("&:hover::before", `
 background-color: var(--n-close-color-hover);
 `), c$1("&:focus::before", `
 background-color: var(--n-close-color-hover);
 `), c$1("&:active", `
 color: var(--n-close-icon-color-pressed);
 `), c$1("&:active::before", `
 background-color: var(--n-close-color-pressed);
 `)]), cM("disabled", `
 cursor: not-allowed;
 color: var(--n-close-icon-color-disabled);
 background-color: transparent;
 `), cM("round", [c$1("&::before", `
 border-radius: 50%;
 `)])]);
    const NBaseClose = /* @__PURE__ */ defineComponent({
      name: "BaseClose",
      props: {
        isButtonTag: {
          type: Boolean,
          default: true
        },
        clsPrefix: {
          type: String,
          required: true
        },
        disabled: {
          type: Boolean,
          default: void 0
        },
        focusable: {
          type: Boolean,
          default: true
        },
        round: Boolean,
        onClick: Function,
        absolute: Boolean
      },
      setup(props) {
        useStyle("-base-close", style$r, toRef(props, "clsPrefix"));
        return () => {
          const {
            clsPrefix,
            disabled,
            absolute,
            round,
            isButtonTag
          } = props;
          const Tag = isButtonTag ? "button" : "div";
          return h(Tag, {
            type: isButtonTag ? "button" : void 0,
            tabindex: disabled || !props.focusable ? -1 : 0,
            "aria-disabled": disabled,
            "aria-label": "close",
            role: isButtonTag ? void 0 : "button",
            disabled,
            class: [`${clsPrefix}-base-close`, absolute && `${clsPrefix}-base-close--absolute`, disabled && `${clsPrefix}-base-close--disabled`, round && `${clsPrefix}-base-close--round`],
            onMousedown: (e) => {
              if (!props.focusable) {
                e.preventDefault();
              }
            },
            onClick: props.onClick
          }, h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => h(ErrorIcon$1, null)
          }));
        };
      }
    });
    const FocusDetector = /* @__PURE__ */ defineComponent({
      props: {
        onFocus: Function,
        onBlur: Function
      },
      setup(props) {
        return () => h("div", {
          style: "width: 0; height: 0",
          tabindex: 0,
          onFocus: props.onFocus,
          onBlur: props.onBlur
        });
      }
    });
    const {
      cubicBezierEaseInOut: cubicBezierEaseInOut$3
    } = commonVariables$m;
    function iconSwitchTransition({
      originalTransform = "",
      left = 0,
      top = 0,
      transition = `all .3s ${cubicBezierEaseInOut$3} !important`
    } = {}) {
      return [c$1("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to", {
        transform: `${originalTransform} scale(0.75)`,
        left,
        top,
        opacity: 0
      }), c$1("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from", {
        transform: `scale(1) ${originalTransform}`,
        left,
        top,
        opacity: 1
      }), c$1("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active", {
        transformOrigin: "center",
        position: "absolute",
        left,
        top,
        transition
      })];
    }
    const style$q = c$1([c$1("@keyframes rotator", `
 0% {
 -webkit-transform: rotate(0deg);
 transform: rotate(0deg);
 }
 100% {
 -webkit-transform: rotate(360deg);
 transform: rotate(360deg);
 }`), cB("base-loading", `
 position: relative;
 line-height: 0;
 width: 1em;
 height: 1em;
 `, [cE("transition-wrapper", `
 position: absolute;
 width: 100%;
 height: 100%;
 `, [iconSwitchTransition()]), cE("placeholder", `
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translateX(-50%) translateY(-50%);
 `, [iconSwitchTransition({
      left: "50%",
      top: "50%",
      originalTransform: "translateX(-50%) translateY(-50%)"
    })]), cE("container", `
 animation: rotator 3s linear infinite both;
 `, [cE("icon", `
 height: 1em;
 width: 1em;
 `)])])]);
    const duration = "1.6s";
    const exposedLoadingProps = {
      strokeWidth: {
        type: Number,
        default: 28
      },
      stroke: {
        type: String,
        default: void 0
      }
    };
    const NBaseLoading = /* @__PURE__ */ defineComponent({
      name: "BaseLoading",
      props: Object.assign({
        clsPrefix: {
          type: String,
          required: true
        },
        show: {
          type: Boolean,
          default: true
        },
        scale: {
          type: Number,
          default: 1
        },
        radius: {
          type: Number,
          default: 100
        }
      }, exposedLoadingProps),
      setup(props) {
        useStyle("-base-loading", style$q, toRef(props, "clsPrefix"));
      },
      render() {
        const {
          clsPrefix,
          radius,
          strokeWidth,
          stroke,
          scale
        } = this;
        const scaledRadius = radius / scale;
        return h("div", {
          class: `${clsPrefix}-base-loading`,
          role: "img",
          "aria-label": "loading"
        }, h(NIconSwitchTransition, null, {
          default: () => this.show ? h("div", {
            key: "icon",
            class: `${clsPrefix}-base-loading__transition-wrapper`
          }, h("div", {
            class: `${clsPrefix}-base-loading__container`
          }, h("svg", {
            class: `${clsPrefix}-base-loading__icon`,
            viewBox: `0 0 ${2 * scaledRadius} ${2 * scaledRadius}`,
            xmlns: "http://www.w3.org/2000/svg",
            style: {
              color: stroke
            }
          }, h("g", null, h("animateTransform", {
            attributeName: "transform",
            type: "rotate",
            values: `0 ${scaledRadius} ${scaledRadius};270 ${scaledRadius} ${scaledRadius}`,
            begin: "0s",
            dur: duration,
            fill: "freeze",
            repeatCount: "indefinite"
          }), h("circle", {
            class: `${clsPrefix}-base-loading__icon`,
            fill: "none",
            stroke: "currentColor",
            "stroke-width": strokeWidth,
            "stroke-linecap": "round",
            cx: scaledRadius,
            cy: scaledRadius,
            r: radius - strokeWidth / 2,
            "stroke-dasharray": 5.67 * radius,
            "stroke-dashoffset": 18.48 * radius
          }, h("animateTransform", {
            attributeName: "transform",
            type: "rotate",
            values: `0 ${scaledRadius} ${scaledRadius};135 ${scaledRadius} ${scaledRadius};450 ${scaledRadius} ${scaledRadius}`,
            begin: "0s",
            dur: duration,
            fill: "freeze",
            repeatCount: "indefinite"
          }), h("animate", {
            attributeName: "stroke-dashoffset",
            values: `${5.67 * radius};${1.42 * radius};${5.67 * radius}`,
            begin: "0s",
            dur: duration,
            fill: "freeze",
            repeatCount: "indefinite"
          })))))) : h("div", {
            key: "placeholder",
            class: `${clsPrefix}-base-loading__placeholder`
          }, this.$slots)
        }));
      }
    });
    function toArray(arg) {
      if (Array.isArray(arg))
        return arg;
      return [arg];
    }
    const TRAVERSE_COMMAND = {
      STOP: "STOP"
    };
    function traverseWithCb(treeNode, callback) {
      const command = callback(treeNode);
      if (treeNode.children !== void 0 && command !== TRAVERSE_COMMAND.STOP) {
        treeNode.children.forEach((childNode) => traverseWithCb(childNode, callback));
      }
    }
    function getNonLeafKeys(treeNodes, options = {}) {
      const { preserveGroup = false } = options;
      const keys2 = [];
      const cb = preserveGroup ? (node) => {
        if (!node.isLeaf) {
          keys2.push(node.key);
          traverse2(node.children);
        }
      } : (node) => {
        if (!node.isLeaf) {
          if (!node.isGroup)
            keys2.push(node.key);
          traverse2(node.children);
        }
      };
      function traverse2(nodes) {
        nodes.forEach(cb);
      }
      traverse2(treeNodes);
      return keys2;
    }
    function isLeaf(rawNode, getChildren) {
      const { isLeaf: isLeaf2 } = rawNode;
      if (isLeaf2 !== void 0)
        return isLeaf2;
      else if (!getChildren(rawNode))
        return true;
      return false;
    }
    function defaultGetChildren(node) {
      return node.children;
    }
    function defaultGetKey(node) {
      return node.key;
    }
    function isIgnored() {
      return false;
    }
    function isShallowLoaded(rawNode, getChildren) {
      const { isLeaf: isLeaf2 } = rawNode;
      if (isLeaf2 === false && !Array.isArray(getChildren(rawNode)))
        return false;
      return true;
    }
    function isDisabled(rawNode) {
      return rawNode.disabled === true;
    }
    function isExpilicitlyNotLoaded(rawNode, getChildren) {
      return rawNode.isLeaf === false && !Array.isArray(getChildren(rawNode));
    }
    function unwrapCheckedKeys(result) {
      var _a;
      if (result === void 0 || result === null)
        return [];
      if (Array.isArray(result))
        return result;
      return (_a = result.checkedKeys) !== null && _a !== void 0 ? _a : [];
    }
    function unwrapIndeterminateKeys(result) {
      var _a;
      if (result === void 0 || result === null || Array.isArray(result)) {
        return [];
      }
      return (_a = result.indeterminateKeys) !== null && _a !== void 0 ? _a : [];
    }
    function merge(originalKeys, keysToAdd) {
      const set2 = new Set(originalKeys);
      keysToAdd.forEach((key) => {
        if (!set2.has(key)) {
          set2.add(key);
        }
      });
      return Array.from(set2);
    }
    function minus(originalKeys, keysToRemove) {
      const set2 = new Set(originalKeys);
      keysToRemove.forEach((key) => {
        if (set2.has(key)) {
          set2.delete(key);
        }
      });
      return Array.from(set2);
    }
    function isGroup(rawNode) {
      return (rawNode === null || rawNode === void 0 ? void 0 : rawNode.type) === "group";
    }
    function createIndexGetter(treeNodes) {
      const map2 = /* @__PURE__ */ new Map();
      treeNodes.forEach((treeNode, i) => {
        map2.set(treeNode.key, i);
      });
      return (key) => {
        var _a;
        return (_a = map2.get(key)) !== null && _a !== void 0 ? _a : null;
      };
    }
    class SubtreeNotLoadedError extends Error {
      constructor() {
        super();
        this.message = "SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded.";
      }
    }
    function getExtendedCheckedKeySetAfterCheck(checkKeys, currentCheckedKeys, treeMate, allowNotLoaded) {
      return getExtendedCheckedKeySet(currentCheckedKeys.concat(checkKeys), treeMate, allowNotLoaded, false);
    }
    function getAvailableAscendantNodeSet(uncheckedKeys, treeMate) {
      const visitedKeys = /* @__PURE__ */ new Set();
      uncheckedKeys.forEach((uncheckedKey) => {
        const uncheckedTreeNode = treeMate.treeNodeMap.get(uncheckedKey);
        if (uncheckedTreeNode !== void 0) {
          let nodeCursor = uncheckedTreeNode.parent;
          while (nodeCursor !== null) {
            if (nodeCursor.disabled)
              break;
            if (visitedKeys.has(nodeCursor.key))
              break;
            else {
              visitedKeys.add(nodeCursor.key);
            }
            nodeCursor = nodeCursor.parent;
          }
        }
      });
      return visitedKeys;
    }
    function getExtendedCheckedKeySetAfterUncheck(uncheckedKeys, currentCheckedKeys, treeMate, allowNotLoaded) {
      const extendedCheckedKeySet = getExtendedCheckedKeySet(currentCheckedKeys, treeMate, allowNotLoaded, false);
      const extendedKeySetToUncheck = getExtendedCheckedKeySet(uncheckedKeys, treeMate, allowNotLoaded, true);
      const ascendantKeySet = getAvailableAscendantNodeSet(uncheckedKeys, treeMate);
      const keysToRemove = [];
      extendedCheckedKeySet.forEach((key) => {
        if (extendedKeySetToUncheck.has(key) || ascendantKeySet.has(key)) {
          keysToRemove.push(key);
        }
      });
      keysToRemove.forEach((key) => extendedCheckedKeySet.delete(key));
      return extendedCheckedKeySet;
    }
    function getCheckedKeys(options, treeMate) {
      const { checkedKeys, keysToCheck, keysToUncheck, indeterminateKeys, cascade, leafOnly, checkStrategy, allowNotLoaded } = options;
      if (!cascade) {
        if (keysToCheck !== void 0) {
          return {
            checkedKeys: merge(checkedKeys, keysToCheck),
            indeterminateKeys: Array.from(indeterminateKeys)
          };
        } else if (keysToUncheck !== void 0) {
          return {
            checkedKeys: minus(checkedKeys, keysToUncheck),
            indeterminateKeys: Array.from(indeterminateKeys)
          };
        } else {
          return {
            checkedKeys: Array.from(checkedKeys),
            indeterminateKeys: Array.from(indeterminateKeys)
          };
        }
      }
      const { levelTreeNodeMap } = treeMate;
      let extendedCheckedKeySet;
      if (keysToUncheck !== void 0) {
        extendedCheckedKeySet = getExtendedCheckedKeySetAfterUncheck(keysToUncheck, checkedKeys, treeMate, allowNotLoaded);
      } else if (keysToCheck !== void 0) {
        extendedCheckedKeySet = getExtendedCheckedKeySetAfterCheck(keysToCheck, checkedKeys, treeMate, allowNotLoaded);
      } else {
        extendedCheckedKeySet = getExtendedCheckedKeySet(checkedKeys, treeMate, allowNotLoaded, false);
      }
      const checkStrategyIsParent = checkStrategy === "parent";
      const checkStrategyIsChild = checkStrategy === "child" || leafOnly;
      const syntheticCheckedKeySet = extendedCheckedKeySet;
      const syntheticIndeterminateKeySet = /* @__PURE__ */ new Set();
      const maxLevel = Math.max.apply(null, Array.from(levelTreeNodeMap.keys()));
      for (let level = maxLevel; level >= 0; level -= 1) {
        const levelIsZero = level === 0;
        const levelTreeNodes = levelTreeNodeMap.get(level);
        for (const levelTreeNode of levelTreeNodes) {
          if (levelTreeNode.isLeaf)
            continue;
          const { key: levelTreeNodeKey, shallowLoaded } = levelTreeNode;
          if (checkStrategyIsChild && shallowLoaded) {
            levelTreeNode.children.forEach((v) => {
              if (!v.disabled && !v.isLeaf && v.shallowLoaded && syntheticCheckedKeySet.has(v.key)) {
                syntheticCheckedKeySet.delete(v.key);
              }
            });
          }
          if (levelTreeNode.disabled || !shallowLoaded) {
            continue;
          }
          let fullyChecked = true;
          let partialChecked = false;
          let allDisabled = true;
          for (const childNode of levelTreeNode.children) {
            const childKey = childNode.key;
            if (childNode.disabled)
              continue;
            if (allDisabled)
              allDisabled = false;
            if (syntheticCheckedKeySet.has(childKey)) {
              partialChecked = true;
            } else if (syntheticIndeterminateKeySet.has(childKey)) {
              partialChecked = true;
              fullyChecked = false;
              break;
            } else {
              fullyChecked = false;
              if (partialChecked) {
                break;
              }
            }
          }
          if (fullyChecked && !allDisabled) {
            if (checkStrategyIsParent) {
              levelTreeNode.children.forEach((v) => {
                if (!v.disabled && syntheticCheckedKeySet.has(v.key)) {
                  syntheticCheckedKeySet.delete(v.key);
                }
              });
            }
            syntheticCheckedKeySet.add(levelTreeNodeKey);
          } else if (partialChecked) {
            syntheticIndeterminateKeySet.add(levelTreeNodeKey);
          }
          if (levelIsZero && checkStrategyIsChild && syntheticCheckedKeySet.has(levelTreeNodeKey)) {
            syntheticCheckedKeySet.delete(levelTreeNodeKey);
          }
        }
      }
      return {
        checkedKeys: Array.from(syntheticCheckedKeySet),
        indeterminateKeys: Array.from(syntheticIndeterminateKeySet)
      };
    }
    function getExtendedCheckedKeySet(checkedKeys, treeMate, allowNotLoaded, isUnchecking) {
      const { treeNodeMap, getChildren } = treeMate;
      const visitedKeySet = /* @__PURE__ */ new Set();
      const extendedKeySet = new Set(checkedKeys);
      checkedKeys.forEach((checkedKey) => {
        const checkedTreeNode = treeNodeMap.get(checkedKey);
        if (checkedTreeNode !== void 0) {
          traverseWithCb(checkedTreeNode, (treeNode) => {
            if (treeNode.disabled) {
              return TRAVERSE_COMMAND.STOP;
            }
            const { key } = treeNode;
            if (visitedKeySet.has(key))
              return;
            visitedKeySet.add(key);
            extendedKeySet.add(key);
            if (isExpilicitlyNotLoaded(treeNode.rawNode, getChildren)) {
              if (isUnchecking) {
                return TRAVERSE_COMMAND.STOP;
              } else if (!allowNotLoaded) {
                throw new SubtreeNotLoadedError();
              }
            }
          });
        }
      });
      return extendedKeySet;
    }
    function getPath(key, { includeGroup = false, includeSelf = true }, treeMate) {
      var _a;
      const treeNodeMap = treeMate.treeNodeMap;
      let treeNode = key === null || key === void 0 ? null : (_a = treeNodeMap.get(key)) !== null && _a !== void 0 ? _a : null;
      const mergedPath = {
        keyPath: [],
        treeNodePath: [],
        treeNode
      };
      if (treeNode === null || treeNode === void 0 ? void 0 : treeNode.ignored) {
        mergedPath.treeNode = null;
        return mergedPath;
      }
      while (treeNode) {
        if (!treeNode.ignored && (includeGroup || !treeNode.isGroup)) {
          mergedPath.treeNodePath.push(treeNode);
        }
        treeNode = treeNode.parent;
      }
      mergedPath.treeNodePath.reverse();
      if (!includeSelf)
        mergedPath.treeNodePath.pop();
      mergedPath.keyPath = mergedPath.treeNodePath.map((treeNode2) => treeNode2.key);
      return mergedPath;
    }
    function getFirstAvailableNode(nodes) {
      if (nodes.length === 0)
        return null;
      const node = nodes[0];
      if (node.isGroup || node.ignored || node.disabled) {
        return node.getNext();
      }
      return node;
    }
    function rawGetNext(node, loop) {
      const sibs = node.siblings;
      const l = sibs.length;
      const { index } = node;
      if (loop) {
        return sibs[(index + 1) % l];
      } else {
        if (index === sibs.length - 1)
          return null;
        return sibs[index + 1];
      }
    }
    function move(fromNode, dir, { loop = false, includeDisabled = false } = {}) {
      const iterate = dir === "prev" ? rawGetPrev : rawGetNext;
      const getChildOptions = {
        reverse: dir === "prev"
      };
      let meet = false;
      let endNode = null;
      function traverse2(node) {
        if (node === null)
          return;
        if (node === fromNode) {
          if (!meet) {
            meet = true;
          } else if (!fromNode.disabled && !fromNode.isGroup) {
            endNode = fromNode;
            return;
          }
        } else {
          if ((!node.disabled || includeDisabled) && !node.ignored && !node.isGroup) {
            endNode = node;
            return;
          }
        }
        if (node.isGroup) {
          const child = getChild(node, getChildOptions);
          if (child !== null) {
            endNode = child;
          } else {
            traverse2(iterate(node, loop));
          }
        } else {
          const nextNode = iterate(node, false);
          if (nextNode !== null) {
            traverse2(nextNode);
          } else {
            const parent = rawGetParent(node);
            if (parent === null || parent === void 0 ? void 0 : parent.isGroup) {
              traverse2(iterate(parent, loop));
            } else if (loop) {
              traverse2(iterate(node, true));
            }
          }
        }
      }
      traverse2(fromNode);
      return endNode;
    }
    function rawGetPrev(node, loop) {
      const sibs = node.siblings;
      const l = sibs.length;
      const { index } = node;
      if (loop) {
        return sibs[(index - 1 + l) % l];
      } else {
        if (index === 0)
          return null;
        return sibs[index - 1];
      }
    }
    function rawGetParent(node) {
      return node.parent;
    }
    function getChild(node, options = {}) {
      const { reverse = false } = options;
      const { children } = node;
      if (children) {
        const { length } = children;
        const start = reverse ? length - 1 : 0;
        const end = reverse ? -1 : length;
        const delta = reverse ? -1 : 1;
        for (let i = start; i !== end; i += delta) {
          const child = children[i];
          if (!child.disabled && !child.ignored) {
            if (child.isGroup) {
              const childInGroup = getChild(child, options);
              if (childInGroup !== null)
                return childInGroup;
            } else {
              return child;
            }
          }
        }
      }
      return null;
    }
    const moveMethods = {
      getChild() {
        if (this.ignored)
          return null;
        return getChild(this);
      },
      getParent() {
        const { parent } = this;
        if (parent === null || parent === void 0 ? void 0 : parent.isGroup) {
          return parent.getParent();
        }
        return parent;
      },
      getNext(options = {}) {
        return move(this, "next", options);
      },
      getPrev(options = {}) {
        return move(this, "prev", options);
      }
    };
    function flatten(treeNodes, expandedKeys) {
      const expandedKeySet = expandedKeys ? new Set(expandedKeys) : void 0;
      const flattenedNodes = [];
      function traverse2(treeNodes2) {
        treeNodes2.forEach((treeNode) => {
          flattenedNodes.push(treeNode);
          if (treeNode.isLeaf || !treeNode.children || treeNode.ignored)
            return;
          if (treeNode.isGroup) {
            traverse2(treeNode.children);
          } else if (
            // normal non-leaf node
            expandedKeySet === void 0 || expandedKeySet.has(treeNode.key)
          ) {
            traverse2(treeNode.children);
          }
        });
      }
      traverse2(treeNodes);
      return flattenedNodes;
    }
    function contains(parent, child) {
      const parentKey = parent.key;
      while (child) {
        if (child.key === parentKey)
          return true;
        child = child.parent;
      }
      return false;
    }
    function createTreeNodes(rawNodes, treeNodeMap, levelTreeNodeMap, nodeProto, getChildren, parent = null, level = 0) {
      const treeNodes = [];
      rawNodes.forEach((rawNode, index) => {
        var _a;
        const treeNode = Object.create(nodeProto);
        treeNode.rawNode = rawNode;
        treeNode.siblings = treeNodes;
        treeNode.level = level;
        treeNode.index = index;
        treeNode.isFirstChild = index === 0;
        treeNode.isLastChild = index + 1 === rawNodes.length;
        treeNode.parent = parent;
        if (!treeNode.ignored) {
          const rawChildren = getChildren(rawNode);
          if (Array.isArray(rawChildren)) {
            treeNode.children = createTreeNodes(rawChildren, treeNodeMap, levelTreeNodeMap, nodeProto, getChildren, treeNode, level + 1);
          }
        }
        treeNodes.push(treeNode);
        treeNodeMap.set(treeNode.key, treeNode);
        if (!levelTreeNodeMap.has(level))
          levelTreeNodeMap.set(level, []);
        (_a = levelTreeNodeMap.get(level)) === null || _a === void 0 ? void 0 : _a.push(treeNode);
      });
      return treeNodes;
    }
    function createTreeMate(rawNodes, options = {}) {
      var _a;
      const treeNodeMap = /* @__PURE__ */ new Map();
      const levelTreeNodeMap = /* @__PURE__ */ new Map();
      const { getDisabled = isDisabled, getIgnored: getIgnored2 = isIgnored, getIsGroup: getIsGroup2 = isGroup, getKey = defaultGetKey } = options;
      const _getChildren = (_a = options.getChildren) !== null && _a !== void 0 ? _a : defaultGetChildren;
      const getChildren = options.ignoreEmptyChildren ? (node) => {
        const children = _getChildren(node);
        if (Array.isArray(children)) {
          if (!children.length)
            return null;
          return children;
        }
        return children;
      } : _getChildren;
      const nodeProto = Object.assign({
        get key() {
          return getKey(this.rawNode);
        },
        get disabled() {
          return getDisabled(this.rawNode);
        },
        get isGroup() {
          return getIsGroup2(this.rawNode);
        },
        get isLeaf() {
          return isLeaf(this.rawNode, getChildren);
        },
        get shallowLoaded() {
          return isShallowLoaded(this.rawNode, getChildren);
        },
        get ignored() {
          return getIgnored2(this.rawNode);
        },
        contains(node) {
          return contains(this, node);
        }
      }, moveMethods);
      const treeNodes = createTreeNodes(rawNodes, treeNodeMap, levelTreeNodeMap, nodeProto, getChildren);
      function getNode(key) {
        if (key === null || key === void 0)
          return null;
        const tmNode = treeNodeMap.get(key);
        if (tmNode && !tmNode.isGroup && !tmNode.ignored) {
          return tmNode;
        }
        return null;
      }
      function _getNode(key) {
        if (key === null || key === void 0)
          return null;
        const tmNode = treeNodeMap.get(key);
        if (tmNode && !tmNode.ignored) {
          return tmNode;
        }
        return null;
      }
      function getPrev(key, options2) {
        const node = _getNode(key);
        if (!node)
          return null;
        return node.getPrev(options2);
      }
      function getNext(key, options2) {
        const node = _getNode(key);
        if (!node)
          return null;
        return node.getNext(options2);
      }
      function getParent(key) {
        const node = _getNode(key);
        if (!node)
          return null;
        return node.getParent();
      }
      function getChild2(key) {
        const node = _getNode(key);
        if (!node)
          return null;
        return node.getChild();
      }
      const treemate = {
        treeNodes,
        treeNodeMap,
        levelTreeNodeMap,
        maxLevel: Math.max(...levelTreeNodeMap.keys()),
        getChildren,
        getFlattenedNodes(expandedKeys) {
          return flatten(treeNodes, expandedKeys);
        },
        getNode,
        getPrev,
        getNext,
        getParent,
        getChild: getChild2,
        getFirstAvailableNode() {
          return getFirstAvailableNode(treeNodes);
        },
        getPath(key, options2 = {}) {
          return getPath(key, options2, treemate);
        },
        getCheckedKeys(checkedKeys, options2 = {}) {
          const { cascade = true, leafOnly = false, checkStrategy = "all", allowNotLoaded = false } = options2;
          return getCheckedKeys({
            checkedKeys: unwrapCheckedKeys(checkedKeys),
            indeterminateKeys: unwrapIndeterminateKeys(checkedKeys),
            cascade,
            leafOnly,
            checkStrategy,
            allowNotLoaded
          }, treemate);
        },
        check(keysToCheck, checkedKeys, options2 = {}) {
          const { cascade = true, leafOnly = false, checkStrategy = "all", allowNotLoaded = false } = options2;
          return getCheckedKeys({
            checkedKeys: unwrapCheckedKeys(checkedKeys),
            indeterminateKeys: unwrapIndeterminateKeys(checkedKeys),
            keysToCheck: keysToCheck === void 0 || keysToCheck === null ? [] : toArray(keysToCheck),
            cascade,
            leafOnly,
            checkStrategy,
            allowNotLoaded
          }, treemate);
        },
        uncheck(keysToUncheck, checkedKeys, options2 = {}) {
          const { cascade = true, leafOnly = false, checkStrategy = "all", allowNotLoaded = false } = options2;
          return getCheckedKeys({
            checkedKeys: unwrapCheckedKeys(checkedKeys),
            indeterminateKeys: unwrapIndeterminateKeys(checkedKeys),
            keysToUncheck: keysToUncheck === null || keysToUncheck === void 0 ? [] : toArray(keysToUncheck),
            cascade,
            leafOnly,
            checkStrategy,
            allowNotLoaded
          }, treemate);
        },
        getNonLeafKeys(options2 = {}) {
          return getNonLeafKeys(treeNodes, options2);
        }
      };
      return treemate;
    }
    const base$1 = {
      neutralBase: "#000",
      neutralInvertBase: "#fff",
      neutralTextBase: "#fff",
      neutralPopover: "rgb(72, 72, 78)",
      neutralCard: "rgb(24, 24, 28)",
      neutralModal: "rgb(44, 44, 50)",
      neutralBody: "rgb(16, 16, 20)",
      alpha1: "0.9",
      alpha2: "0.82",
      alpha3: "0.52",
      alpha4: "0.38",
      alpha5: "0.28",
      alphaClose: "0.52",
      alphaDisabled: "0.38",
      alphaDisabledInput: "0.06",
      alphaPending: "0.09",
      alphaTablePending: "0.06",
      alphaTableStriped: "0.05",
      alphaPressed: "0.05",
      alphaAvatar: "0.18",
      alphaRail: "0.2",
      alphaProgressRail: "0.12",
      alphaBorder: "0.24",
      alphaDivider: "0.09",
      alphaInput: "0.1",
      alphaAction: "0.06",
      alphaTab: "0.04",
      alphaScrollbar: "0.2",
      alphaScrollbarHover: "0.3",
      alphaCode: "0.12",
      alphaTag: "0.2",
      // primary
      primaryHover: "#7fe7c4",
      primaryDefault: "#63e2b7",
      primaryActive: "#5acea7",
      primarySuppl: "rgb(42, 148, 125)",
      // info
      infoHover: "#8acbec",
      infoDefault: "#70c0e8",
      infoActive: "#66afd3",
      infoSuppl: "rgb(56, 137, 197)",
      // error
      errorHover: "#e98b8b",
      errorDefault: "#e88080",
      errorActive: "#e57272",
      errorSuppl: "rgb(208, 58, 82)",
      // warning
      warningHover: "#f5d599",
      warningDefault: "#f2c97d",
      warningActive: "#e6c260",
      warningSuppl: "rgb(240, 138, 0)",
      // success
      successHover: "#7fe7c4",
      successDefault: "#63e2b7",
      successActive: "#5acea7",
      successSuppl: "rgb(42, 148, 125)"
    };
    const baseBackgroundRgb$1 = rgba(base$1.neutralBase);
    const baseInvertBackgroundRgb$1 = rgba(base$1.neutralInvertBase);
    const overlayPrefix$1 = `rgba(${baseInvertBackgroundRgb$1.slice(0, 3).join(", ")}, `;
    function overlay$1(alpha) {
      return `${overlayPrefix$1 + String(alpha)})`;
    }
    function neutral$1(alpha) {
      const overlayRgba = Array.from(baseInvertBackgroundRgb$1);
      overlayRgba[3] = Number(alpha);
      return composite(baseBackgroundRgb$1, overlayRgba);
    }
    const derived$1 = Object.assign(Object.assign({
      name: "common"
    }, commonVariables$m), {
      baseColor: base$1.neutralBase,
      // primary color
      primaryColor: base$1.primaryDefault,
      primaryColorHover: base$1.primaryHover,
      primaryColorPressed: base$1.primaryActive,
      primaryColorSuppl: base$1.primarySuppl,
      // info color
      infoColor: base$1.infoDefault,
      infoColorHover: base$1.infoHover,
      infoColorPressed: base$1.infoActive,
      infoColorSuppl: base$1.infoSuppl,
      // success color
      successColor: base$1.successDefault,
      successColorHover: base$1.successHover,
      successColorPressed: base$1.successActive,
      successColorSuppl: base$1.successSuppl,
      // warning color
      warningColor: base$1.warningDefault,
      warningColorHover: base$1.warningHover,
      warningColorPressed: base$1.warningActive,
      warningColorSuppl: base$1.warningSuppl,
      // error color
      errorColor: base$1.errorDefault,
      errorColorHover: base$1.errorHover,
      errorColorPressed: base$1.errorActive,
      errorColorSuppl: base$1.errorSuppl,
      // text color
      textColorBase: base$1.neutralTextBase,
      textColor1: overlay$1(base$1.alpha1),
      textColor2: overlay$1(base$1.alpha2),
      textColor3: overlay$1(base$1.alpha3),
      // textColor4: overlay(base.alpha4), // disabled, placeholder, icon
      // textColor5: overlay(base.alpha5),
      textColorDisabled: overlay$1(base$1.alpha4),
      placeholderColor: overlay$1(base$1.alpha4),
      placeholderColorDisabled: overlay$1(base$1.alpha5),
      iconColor: overlay$1(base$1.alpha4),
      iconColorDisabled: overlay$1(base$1.alpha5),
      iconColorHover: overlay$1(Number(base$1.alpha4) * 1.25),
      iconColorPressed: overlay$1(Number(base$1.alpha4) * 0.8),
      opacity1: base$1.alpha1,
      opacity2: base$1.alpha2,
      opacity3: base$1.alpha3,
      opacity4: base$1.alpha4,
      opacity5: base$1.alpha5,
      dividerColor: overlay$1(base$1.alphaDivider),
      borderColor: overlay$1(base$1.alphaBorder),
      // close
      closeIconColorHover: overlay$1(Number(base$1.alphaClose)),
      closeIconColor: overlay$1(Number(base$1.alphaClose)),
      closeIconColorPressed: overlay$1(Number(base$1.alphaClose)),
      closeColorHover: "rgba(255, 255, 255, .12)",
      closeColorPressed: "rgba(255, 255, 255, .08)",
      // clear
      clearColor: overlay$1(base$1.alpha4),
      clearColorHover: scaleColor(overlay$1(base$1.alpha4), {
        alpha: 1.25
      }),
      clearColorPressed: scaleColor(overlay$1(base$1.alpha4), {
        alpha: 0.8
      }),
      scrollbarColor: overlay$1(base$1.alphaScrollbar),
      scrollbarColorHover: overlay$1(base$1.alphaScrollbarHover),
      scrollbarWidth: "5px",
      scrollbarHeight: "5px",
      scrollbarBorderRadius: "5px",
      progressRailColor: overlay$1(base$1.alphaProgressRail),
      railColor: overlay$1(base$1.alphaRail),
      popoverColor: base$1.neutralPopover,
      tableColor: base$1.neutralCard,
      cardColor: base$1.neutralCard,
      modalColor: base$1.neutralModal,
      bodyColor: base$1.neutralBody,
      tagColor: neutral$1(base$1.alphaTag),
      avatarColor: overlay$1(base$1.alphaAvatar),
      invertedColor: base$1.neutralBase,
      inputColor: overlay$1(base$1.alphaInput),
      codeColor: overlay$1(base$1.alphaCode),
      tabColor: overlay$1(base$1.alphaTab),
      actionColor: overlay$1(base$1.alphaAction),
      tableHeaderColor: overlay$1(base$1.alphaAction),
      hoverColor: overlay$1(base$1.alphaPending),
      tableColorHover: overlay$1(base$1.alphaTablePending),
      tableColorStriped: overlay$1(base$1.alphaTableStriped),
      pressedColor: overlay$1(base$1.alphaPressed),
      opacityDisabled: base$1.alphaDisabled,
      inputColorDisabled: overlay$1(base$1.alphaDisabledInput),
      buttonColor2: "rgba(255, 255, 255, .08)",
      buttonColor2Hover: "rgba(255, 255, 255, .12)",
      buttonColor2Pressed: "rgba(255, 255, 255, .08)",
      boxShadow1: "0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",
      boxShadow2: "0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",
      boxShadow3: "0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"
    });
    const base = {
      neutralBase: "#FFF",
      neutralInvertBase: "#000",
      neutralTextBase: "#000",
      neutralPopover: "#fff",
      neutralCard: "#fff",
      neutralModal: "#fff",
      neutralBody: "#fff",
      alpha1: "0.82",
      alpha2: "0.72",
      alpha3: "0.38",
      alpha4: "0.24",
      // disabled text, placeholder, icon
      alpha5: "0.18",
      // disabled placeholder
      alphaClose: "0.6",
      alphaDisabled: "0.5",
      alphaDisabledInput: "0.02",
      alphaPending: "0.05",
      alphaTablePending: "0.02",
      alphaPressed: "0.07",
      alphaAvatar: "0.2",
      alphaRail: "0.14",
      alphaProgressRail: ".08",
      alphaBorder: "0.12",
      alphaDivider: "0.06",
      alphaInput: "0",
      alphaAction: "0.02",
      alphaTab: "0.04",
      alphaScrollbar: "0.25",
      alphaScrollbarHover: "0.4",
      alphaCode: "0.05",
      alphaTag: "0.02",
      // primary
      primaryHover: "#36ad6a",
      primaryDefault: "#18a058",
      primaryActive: "#0c7a43",
      primarySuppl: "#36ad6a",
      // info
      infoHover: "#4098fc",
      infoDefault: "#2080f0",
      infoActive: "#1060c9",
      infoSuppl: "#4098fc",
      // error
      errorHover: "#de576d",
      errorDefault: "#d03050",
      errorActive: "#ab1f3f",
      errorSuppl: "#de576d",
      // warning
      warningHover: "#fcb040",
      warningDefault: "#f0a020",
      warningActive: "#c97c10",
      warningSuppl: "#fcb040",
      // success
      successHover: "#36ad6a",
      successDefault: "#18a058",
      successActive: "#0c7a43",
      successSuppl: "#36ad6a"
    };
    const baseBackgroundRgb = rgba(base.neutralBase);
    const baseInvertBackgroundRgb = rgba(base.neutralInvertBase);
    const overlayPrefix = `rgba(${baseInvertBackgroundRgb.slice(0, 3).join(", ")}, `;
    function overlay(alpha) {
      return `${overlayPrefix + String(alpha)})`;
    }
    function neutral(alpha) {
      const overlayRgba = Array.from(baseInvertBackgroundRgb);
      overlayRgba[3] = Number(alpha);
      return composite(baseBackgroundRgb, overlayRgba);
    }
    const derived = Object.assign(Object.assign({
      name: "common"
    }, commonVariables$m), {
      baseColor: base.neutralBase,
      // primary color
      primaryColor: base.primaryDefault,
      primaryColorHover: base.primaryHover,
      primaryColorPressed: base.primaryActive,
      primaryColorSuppl: base.primarySuppl,
      // info color
      infoColor: base.infoDefault,
      infoColorHover: base.infoHover,
      infoColorPressed: base.infoActive,
      infoColorSuppl: base.infoSuppl,
      // success color
      successColor: base.successDefault,
      successColorHover: base.successHover,
      successColorPressed: base.successActive,
      successColorSuppl: base.successSuppl,
      // warning color
      warningColor: base.warningDefault,
      warningColorHover: base.warningHover,
      warningColorPressed: base.warningActive,
      warningColorSuppl: base.warningSuppl,
      // error color
      errorColor: base.errorDefault,
      errorColorHover: base.errorHover,
      errorColorPressed: base.errorActive,
      errorColorSuppl: base.errorSuppl,
      // text color
      textColorBase: base.neutralTextBase,
      textColor1: "rgb(31, 34, 37)",
      textColor2: "rgb(51, 54, 57)",
      textColor3: "rgb(118, 124, 130)",
      // textColor4: neutral(base.alpha4), // disabled, placeholder, icon
      // textColor5: neutral(base.alpha5),
      textColorDisabled: neutral(base.alpha4),
      placeholderColor: neutral(base.alpha4),
      placeholderColorDisabled: neutral(base.alpha5),
      iconColor: neutral(base.alpha4),
      iconColorHover: scaleColor(neutral(base.alpha4), {
        lightness: 0.75
      }),
      iconColorPressed: scaleColor(neutral(base.alpha4), {
        lightness: 0.9
      }),
      iconColorDisabled: neutral(base.alpha5),
      opacity1: base.alpha1,
      opacity2: base.alpha2,
      opacity3: base.alpha3,
      opacity4: base.alpha4,
      opacity5: base.alpha5,
      dividerColor: "rgb(239, 239, 245)",
      borderColor: "rgb(224, 224, 230)",
      // close
      closeIconColor: neutral(Number(base.alphaClose)),
      closeIconColorHover: neutral(Number(base.alphaClose)),
      closeIconColorPressed: neutral(Number(base.alphaClose)),
      closeColorHover: "rgba(0, 0, 0, .09)",
      closeColorPressed: "rgba(0, 0, 0, .13)",
      // clear
      clearColor: neutral(base.alpha4),
      clearColorHover: scaleColor(neutral(base.alpha4), {
        lightness: 0.75
      }),
      clearColorPressed: scaleColor(neutral(base.alpha4), {
        lightness: 0.9
      }),
      scrollbarColor: overlay(base.alphaScrollbar),
      scrollbarColorHover: overlay(base.alphaScrollbarHover),
      scrollbarWidth: "5px",
      scrollbarHeight: "5px",
      scrollbarBorderRadius: "5px",
      progressRailColor: neutral(base.alphaProgressRail),
      railColor: "rgb(219, 219, 223)",
      popoverColor: base.neutralPopover,
      tableColor: base.neutralCard,
      cardColor: base.neutralCard,
      modalColor: base.neutralModal,
      bodyColor: base.neutralBody,
      tagColor: "#eee",
      avatarColor: neutral(base.alphaAvatar),
      invertedColor: "rgb(0, 20, 40)",
      inputColor: neutral(base.alphaInput),
      codeColor: "rgb(244, 244, 248)",
      tabColor: "rgb(247, 247, 250)",
      actionColor: "rgb(250, 250, 252)",
      tableHeaderColor: "rgb(250, 250, 252)",
      hoverColor: "rgb(243, 243, 245)",
      // use color with alpha since it can be nested with header filter & sorter effect
      tableColorHover: "rgba(0, 0, 100, 0.03)",
      tableColorStriped: "rgba(0, 0, 100, 0.02)",
      pressedColor: "rgb(237, 237, 239)",
      opacityDisabled: base.alphaDisabled,
      inputColorDisabled: "rgb(250, 250, 252)",
      // secondary button color
      // can also be used in tertiary button & quaternary button
      buttonColor2: "rgba(46, 51, 56, .05)",
      buttonColor2Hover: "rgba(46, 51, 56, .09)",
      buttonColor2Pressed: "rgba(46, 51, 56, .13)",
      boxShadow1: "0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",
      boxShadow2: "0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",
      boxShadow3: "0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"
    });
    const commonVars$e = {
      iconSizeTiny: "28px",
      iconSizeSmall: "34px",
      iconSizeMedium: "40px",
      iconSizeLarge: "46px",
      iconSizeHuge: "52px"
    };
    function self$Y(vars) {
      const {
        textColorDisabled,
        iconColor,
        textColor2,
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        fontSizeHuge
      } = vars;
      return Object.assign(Object.assign({}, commonVars$e), {
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        fontSizeHuge,
        textColor: textColorDisabled,
        iconColor,
        extraTextColor: textColor2
      });
    }
    const emptyLight = {
      name: "Empty",
      common: derived,
      self: self$Y
    };
    const emptyDark = {
      name: "Empty",
      common: derived$1,
      self: self$Y
    };
    const style$p = cB("empty", `
 display: flex;
 flex-direction: column;
 align-items: center;
 font-size: var(--n-font-size);
`, [cE("icon", `
 width: var(--n-icon-size);
 height: var(--n-icon-size);
 font-size: var(--n-icon-size);
 line-height: var(--n-icon-size);
 color: var(--n-icon-color);
 transition:
 color .3s var(--n-bezier);
 `, [c$1("+", [cE("description", `
 margin-top: 8px;
 `)])]), cE("description", `
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
 `), cE("extra", `
 text-align: center;
 transition: color .3s var(--n-bezier);
 margin-top: 12px;
 color: var(--n-extra-text-color);
 `)]);
    const emptyProps = Object.assign(Object.assign({}, useTheme.props), {
      description: String,
      showDescription: {
        type: Boolean,
        default: true
      },
      showIcon: {
        type: Boolean,
        default: true
      },
      size: {
        type: String,
        default: "medium"
      },
      renderIcon: Function
    });
    const NEmpty = /* @__PURE__ */ defineComponent({
      name: "Empty",
      props: emptyProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled,
          mergedComponentPropsRef
        } = useConfig(props);
        const themeRef = useTheme("Empty", "-empty", style$p, emptyLight, props, mergedClsPrefixRef);
        const {
          localeRef
        } = useLocale("Empty");
        const mergedDescriptionRef = computed(() => {
          var _a, _b, _c;
          return (_a = props.description) !== null && _a !== void 0 ? _a : (_c = (_b = mergedComponentPropsRef === null || mergedComponentPropsRef === void 0 ? void 0 : mergedComponentPropsRef.value) === null || _b === void 0 ? void 0 : _b.Empty) === null || _c === void 0 ? void 0 : _c.description;
        });
        const mergedRenderIconRef = computed(() => {
          var _a, _b;
          return ((_b = (_a = mergedComponentPropsRef === null || mergedComponentPropsRef === void 0 ? void 0 : mergedComponentPropsRef.value) === null || _a === void 0 ? void 0 : _a.Empty) === null || _b === void 0 ? void 0 : _b.renderIcon) || (() => h(EmptyIcon, null));
        });
        const cssVarsRef = computed(() => {
          const {
            size: size2
          } = props;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              [createKey("iconSize", size2)]: iconSize,
              [createKey("fontSize", size2)]: fontSize2,
              textColor,
              iconColor,
              extraTextColor
            }
          } = themeRef.value;
          return {
            "--n-icon-size": iconSize,
            "--n-font-size": fontSize2,
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-text-color": textColor,
            "--n-icon-color": iconColor,
            "--n-extra-text-color": extraTextColor
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("empty", computed(() => {
          let hash = "";
          const {
            size: size2
          } = props;
          hash += size2[0];
          return hash;
        }), cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          mergedRenderIcon: mergedRenderIconRef,
          localizedDescription: computed(() => {
            return mergedDescriptionRef.value || localeRef.value.description;
          }),
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        const {
          $slots,
          mergedClsPrefix,
          onRender
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h("div", {
          class: [`${mergedClsPrefix}-empty`, this.themeClass],
          style: this.cssVars
        }, this.showIcon ? h("div", {
          class: `${mergedClsPrefix}-empty__icon`
        }, $slots.icon ? $slots.icon() : h(NBaseIcon, {
          clsPrefix: mergedClsPrefix
        }, {
          default: this.mergedRenderIcon
        })) : null, this.showDescription ? h("div", {
          class: `${mergedClsPrefix}-empty__description`
        }, $slots.default ? $slots.default() : this.localizedDescription) : null, $slots.extra ? h("div", {
          class: `${mergedClsPrefix}-empty__extra`
        }, $slots.extra()) : null);
      }
    });
    const commonVars$d = {
      railInsetHorizontalBottom: "auto 2px 4px 2px",
      railInsetHorizontalTop: "4px 2px auto 2px",
      railInsetVerticalRight: "2px 4px 2px auto",
      railInsetVerticalLeft: "2px auto 2px 4px",
      railColor: "transparent"
    };
    function self$X(vars) {
      const {
        scrollbarColor,
        scrollbarColorHover,
        scrollbarHeight,
        scrollbarWidth,
        scrollbarBorderRadius
      } = vars;
      return Object.assign(Object.assign({}, commonVars$d), {
        height: scrollbarHeight,
        width: scrollbarWidth,
        borderRadius: scrollbarBorderRadius,
        color: scrollbarColor,
        colorHover: scrollbarColorHover
      });
    }
    const scrollbarLight = {
      name: "Scrollbar",
      common: derived,
      self: self$X
    };
    const scrollbarDark = {
      name: "Scrollbar",
      common: derived$1,
      self: self$X
    };
    const {
      cubicBezierEaseInOut: cubicBezierEaseInOut$2
    } = commonVariables$m;
    function fadeInTransition({
      name = "fade-in",
      enterDuration = "0.2s",
      leaveDuration = "0.2s",
      enterCubicBezier = cubicBezierEaseInOut$2,
      leaveCubicBezier = cubicBezierEaseInOut$2
    } = {}) {
      return [c$1(`&.${name}-transition-enter-active`, {
        transition: `all ${enterDuration} ${enterCubicBezier}!important`
      }), c$1(`&.${name}-transition-leave-active`, {
        transition: `all ${leaveDuration} ${leaveCubicBezier}!important`
      }), c$1(`&.${name}-transition-enter-from, &.${name}-transition-leave-to`, {
        opacity: 0
      }), c$1(`&.${name}-transition-leave-from, &.${name}-transition-enter-to`, {
        opacity: 1
      })];
    }
    const style$o = cB("scrollbar", `
 overflow: hidden;
 position: relative;
 z-index: auto;
 height: 100%;
 width: 100%;
`, [c$1(">", [cB("scrollbar-container", `
 width: 100%;
 overflow: scroll;
 height: 100%;
 min-height: inherit;
 max-height: inherit;
 scrollbar-width: none;
 `, [c$1("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb", `
 width: 0;
 height: 0;
 display: none;
 `), c$1(">", [
      // We can't set overflow hidden since it affects positioning.
      cB("scrollbar-content", `
 box-sizing: border-box;
 min-width: 100%;
 `)
    ])])]), c$1(">, +", [cB("scrollbar-rail", `
 position: absolute;
 pointer-events: none;
 user-select: none;
 background: var(--n-scrollbar-rail-color);
 -webkit-user-select: none;
 `, [cM("horizontal", `
 height: var(--n-scrollbar-height);
 `, [c$1(">", [cE("scrollbar", `
 height: var(--n-scrollbar-height);
 border-radius: var(--n-scrollbar-border-radius);
 right: 0;
 `)])]), cM("horizontal--top", `
 inset: var(--n-scrollbar-rail-inset-horizontal-top); 
 `), cM("horizontal--bottom", `
 inset: var(--n-scrollbar-rail-inset-horizontal-bottom); 
 `), cM("vertical", `
 width: var(--n-scrollbar-width);
 `, [c$1(">", [cE("scrollbar", `
 width: var(--n-scrollbar-width);
 border-radius: var(--n-scrollbar-border-radius);
 bottom: 0;
 `)])]), cM("vertical--left", `
 inset: var(--n-scrollbar-rail-inset-vertical-left); 
 `), cM("vertical--right", `
 inset: var(--n-scrollbar-rail-inset-vertical-right); 
 `), cM("disabled", [c$1(">", [cE("scrollbar", "pointer-events: none;")])]), c$1(">", [cE("scrollbar", `
 z-index: 1;
 position: absolute;
 cursor: pointer;
 pointer-events: all;
 background-color: var(--n-scrollbar-color);
 transition: background-color .2s var(--n-scrollbar-bezier);
 `, [fadeInTransition(), c$1("&:hover", "background-color: var(--n-scrollbar-color-hover);")])])])])]);
    const scrollbarProps = Object.assign(Object.assign({}, useTheme.props), {
      duration: {
        type: Number,
        default: 0
      },
      scrollable: {
        type: Boolean,
        default: true
      },
      xScrollable: Boolean,
      trigger: {
        type: String,
        default: "hover"
      },
      useUnifiedContainer: Boolean,
      triggerDisplayManually: Boolean,
      // If container is set, resize observer won't not attached
      container: Function,
      content: Function,
      containerClass: String,
      containerStyle: [String, Object],
      contentClass: [String, Array],
      contentStyle: [String, Object],
      horizontalRailStyle: [String, Object],
      verticalRailStyle: [String, Object],
      onScroll: Function,
      onWheel: Function,
      onResize: Function,
      internalOnUpdateScrollLeft: Function,
      internalHoistYRail: Boolean,
      yPlacement: {
        type: String,
        default: "right"
      },
      xPlacement: {
        type: String,
        default: "bottom"
      }
    });
    const Scrollbar = /* @__PURE__ */ defineComponent({
      name: "Scrollbar",
      props: scrollbarProps,
      inheritAttrs: false,
      setup(props) {
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled,
          mergedRtlRef
        } = useConfig(props);
        const rtlEnabledRef = useRtl("Scrollbar", mergedRtlRef, mergedClsPrefixRef);
        const wrapperRef = ref(null);
        const containerRef = ref(null);
        const contentRef = ref(null);
        const yRailRef = ref(null);
        const xRailRef = ref(null);
        const contentHeightRef = ref(null);
        const contentWidthRef = ref(null);
        const containerHeightRef = ref(null);
        const containerWidthRef = ref(null);
        const yRailSizeRef = ref(null);
        const xRailSizeRef = ref(null);
        const containerScrollTopRef = ref(0);
        const containerScrollLeftRef = ref(0);
        const isShowXBarRef = ref(false);
        const isShowYBarRef = ref(false);
        let yBarPressed = false;
        let xBarPressed = false;
        let xBarVanishTimerId;
        let yBarVanishTimerId;
        let memoYTop = 0;
        let memoXLeft = 0;
        let memoMouseX = 0;
        let memoMouseY = 0;
        const isIos2 = useIsIos();
        const themeRef = useTheme("Scrollbar", "-scrollbar", style$o, scrollbarLight, props, mergedClsPrefixRef);
        const yBarSizeRef = computed(() => {
          const {
            value: containerHeight
          } = containerHeightRef;
          const {
            value: contentHeight
          } = contentHeightRef;
          const {
            value: yRailSize
          } = yRailSizeRef;
          if (containerHeight === null || contentHeight === null || yRailSize === null) {
            return 0;
          } else {
            return Math.min(containerHeight, yRailSize * containerHeight / contentHeight + depx(themeRef.value.self.width) * 1.5);
          }
        });
        const yBarSizePxRef = computed(() => {
          return `${yBarSizeRef.value}px`;
        });
        const xBarSizeRef = computed(() => {
          const {
            value: containerWidth
          } = containerWidthRef;
          const {
            value: contentWidth
          } = contentWidthRef;
          const {
            value: xRailSize
          } = xRailSizeRef;
          if (containerWidth === null || contentWidth === null || xRailSize === null) {
            return 0;
          } else {
            return xRailSize * containerWidth / contentWidth + depx(themeRef.value.self.height) * 1.5;
          }
        });
        const xBarSizePxRef = computed(() => {
          return `${xBarSizeRef.value}px`;
        });
        const yBarTopRef = computed(() => {
          const {
            value: containerHeight
          } = containerHeightRef;
          const {
            value: containerScrollTop
          } = containerScrollTopRef;
          const {
            value: contentHeight
          } = contentHeightRef;
          const {
            value: yRailSize
          } = yRailSizeRef;
          if (containerHeight === null || contentHeight === null || yRailSize === null) {
            return 0;
          } else {
            const heightDiff = contentHeight - containerHeight;
            if (!heightDiff) return 0;
            return containerScrollTop / heightDiff * (yRailSize - yBarSizeRef.value);
          }
        });
        const yBarTopPxRef = computed(() => {
          return `${yBarTopRef.value}px`;
        });
        const xBarLeftRef = computed(() => {
          const {
            value: containerWidth
          } = containerWidthRef;
          const {
            value: containerScrollLeft
          } = containerScrollLeftRef;
          const {
            value: contentWidth
          } = contentWidthRef;
          const {
            value: xRailSize
          } = xRailSizeRef;
          if (containerWidth === null || contentWidth === null || xRailSize === null) {
            return 0;
          } else {
            const widthDiff = contentWidth - containerWidth;
            if (!widthDiff) return 0;
            return containerScrollLeft / widthDiff * (xRailSize - xBarSizeRef.value);
          }
        });
        const xBarLeftPxRef = computed(() => {
          return `${xBarLeftRef.value}px`;
        });
        const needYBarRef = computed(() => {
          const {
            value: containerHeight
          } = containerHeightRef;
          const {
            value: contentHeight
          } = contentHeightRef;
          return containerHeight !== null && contentHeight !== null && contentHeight > containerHeight;
        });
        const needXBarRef = computed(() => {
          const {
            value: containerWidth
          } = containerWidthRef;
          const {
            value: contentWidth
          } = contentWidthRef;
          return containerWidth !== null && contentWidth !== null && contentWidth > containerWidth;
        });
        const mergedShowXBarRef = computed(() => {
          const {
            trigger: trigger2
          } = props;
          return trigger2 === "none" || isShowXBarRef.value;
        });
        const mergedShowYBarRef = computed(() => {
          const {
            trigger: trigger2
          } = props;
          return trigger2 === "none" || isShowYBarRef.value;
        });
        const mergedContainerRef = computed(() => {
          const {
            container
          } = props;
          if (container) return container();
          return containerRef.value;
        });
        const mergedContentRef = computed(() => {
          const {
            content
          } = props;
          if (content) return content();
          return contentRef.value;
        });
        const scrollTo = (options, y) => {
          if (!props.scrollable) return;
          if (typeof options === "number") {
            scrollToPosition2(options, y !== null && y !== void 0 ? y : 0, 0, false, "auto");
            return;
          }
          const {
            left,
            top,
            index,
            elSize,
            position,
            behavior,
            el,
            debounce: debounce2 = true
          } = options;
          if (left !== void 0 || top !== void 0) {
            scrollToPosition2(left !== null && left !== void 0 ? left : 0, top !== null && top !== void 0 ? top : 0, 0, false, behavior);
          }
          if (el !== void 0) {
            scrollToPosition2(0, el.offsetTop, el.offsetHeight, debounce2, behavior);
          } else if (index !== void 0 && elSize !== void 0) {
            scrollToPosition2(0, index * elSize, elSize, debounce2, behavior);
          } else if (position === "bottom") {
            scrollToPosition2(0, Number.MAX_SAFE_INTEGER, 0, false, behavior);
          } else if (position === "top") {
            scrollToPosition2(0, 0, 0, false, behavior);
          }
        };
        const activateState = useReactivated(() => {
          if (!props.container) {
            scrollTo({
              top: containerScrollTopRef.value,
              left: containerScrollLeftRef.value
            });
          }
        });
        const handleContentResize = () => {
          if (activateState.isDeactivated) return;
          sync();
        };
        const handleContainerResize = (e) => {
          if (activateState.isDeactivated) return;
          const {
            onResize
          } = props;
          if (onResize) onResize(e);
          sync();
        };
        const scrollBy = (options, y) => {
          if (!props.scrollable) return;
          const {
            value: container
          } = mergedContainerRef;
          if (!container) return;
          if (typeof options === "object") {
            container.scrollBy(options);
          } else {
            container.scrollBy(options, y || 0);
          }
        };
        function scrollToPosition2(left, top, elSize, debounce2, behavior) {
          const {
            value: container
          } = mergedContainerRef;
          if (!container) return;
          if (debounce2) {
            const {
              scrollTop,
              offsetHeight
            } = container;
            if (top > scrollTop) {
              if (top + elSize <= scrollTop + offsetHeight) ;
              else {
                container.scrollTo({
                  left,
                  top: top + elSize - offsetHeight,
                  behavior
                });
              }
              return;
            }
          }
          container.scrollTo({
            left,
            top,
            behavior
          });
        }
        function handleMouseEnterWrapper() {
          showXBar();
          showYBar();
          sync();
        }
        function handleMouseLeaveWrapper() {
          hideBar();
        }
        function hideBar() {
          hideYBar();
          hideXBar();
        }
        function hideYBar() {
          if (yBarVanishTimerId !== void 0) {
            window.clearTimeout(yBarVanishTimerId);
          }
          yBarVanishTimerId = window.setTimeout(() => {
            isShowYBarRef.value = false;
          }, props.duration);
        }
        function hideXBar() {
          if (xBarVanishTimerId !== void 0) {
            window.clearTimeout(xBarVanishTimerId);
          }
          xBarVanishTimerId = window.setTimeout(() => {
            isShowXBarRef.value = false;
          }, props.duration);
        }
        function showXBar() {
          if (xBarVanishTimerId !== void 0) {
            window.clearTimeout(xBarVanishTimerId);
          }
          isShowXBarRef.value = true;
        }
        function showYBar() {
          if (yBarVanishTimerId !== void 0) {
            window.clearTimeout(yBarVanishTimerId);
          }
          isShowYBarRef.value = true;
        }
        function handleScroll(e) {
          const {
            onScroll
          } = props;
          if (onScroll) onScroll(e);
          syncScrollState();
        }
        function syncScrollState() {
          const {
            value: container
          } = mergedContainerRef;
          if (container) {
            containerScrollTopRef.value = container.scrollTop;
            containerScrollLeftRef.value = container.scrollLeft * ((rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? -1 : 1);
          }
        }
        function syncPositionState() {
          const {
            value: content
          } = mergedContentRef;
          if (content) {
            contentHeightRef.value = content.offsetHeight;
            contentWidthRef.value = content.offsetWidth;
          }
          const {
            value: container
          } = mergedContainerRef;
          if (container) {
            containerHeightRef.value = container.offsetHeight;
            containerWidthRef.value = container.offsetWidth;
          }
          const {
            value: xRailEl
          } = xRailRef;
          const {
            value: yRailEl
          } = yRailRef;
          if (xRailEl) {
            xRailSizeRef.value = xRailEl.offsetWidth;
          }
          if (yRailEl) {
            yRailSizeRef.value = yRailEl.offsetHeight;
          }
        }
        function syncUnifiedContainer() {
          const {
            value: container
          } = mergedContainerRef;
          if (container) {
            containerScrollTopRef.value = container.scrollTop;
            containerScrollLeftRef.value = container.scrollLeft * ((rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? -1 : 1);
            containerHeightRef.value = container.offsetHeight;
            containerWidthRef.value = container.offsetWidth;
            contentHeightRef.value = container.scrollHeight;
            contentWidthRef.value = container.scrollWidth;
          }
          const {
            value: xRailEl
          } = xRailRef;
          const {
            value: yRailEl
          } = yRailRef;
          if (xRailEl) {
            xRailSizeRef.value = xRailEl.offsetWidth;
          }
          if (yRailEl) {
            yRailSizeRef.value = yRailEl.offsetHeight;
          }
        }
        function sync() {
          if (!props.scrollable) return;
          if (props.useUnifiedContainer) {
            syncUnifiedContainer();
          } else {
            syncPositionState();
            syncScrollState();
          }
        }
        function isMouseUpAway(e) {
          var _a;
          return !((_a = wrapperRef.value) === null || _a === void 0 ? void 0 : _a.contains(getPreciseEventTarget(e)));
        }
        function handleXScrollMouseDown(e) {
          e.preventDefault();
          e.stopPropagation();
          xBarPressed = true;
          on("mousemove", window, handleXScrollMouseMove, true);
          on("mouseup", window, handleXScrollMouseUp, true);
          memoXLeft = containerScrollLeftRef.value;
          memoMouseX = (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? window.innerWidth - e.clientX : e.clientX;
        }
        function handleXScrollMouseMove(e) {
          if (!xBarPressed) return;
          if (xBarVanishTimerId !== void 0) {
            window.clearTimeout(xBarVanishTimerId);
          }
          if (yBarVanishTimerId !== void 0) {
            window.clearTimeout(yBarVanishTimerId);
          }
          const {
            value: containerWidth
          } = containerWidthRef;
          const {
            value: contentWidth
          } = contentWidthRef;
          const {
            value: xBarSize
          } = xBarSizeRef;
          if (containerWidth === null || contentWidth === null) return;
          const dX = (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? window.innerWidth - e.clientX - memoMouseX : e.clientX - memoMouseX;
          const dScrollLeft = dX * (contentWidth - containerWidth) / (containerWidth - xBarSize);
          const toScrollLeftUpperBound = contentWidth - containerWidth;
          let toScrollLeft = memoXLeft + dScrollLeft;
          toScrollLeft = Math.min(toScrollLeftUpperBound, toScrollLeft);
          toScrollLeft = Math.max(toScrollLeft, 0);
          const {
            value: container
          } = mergedContainerRef;
          if (container) {
            container.scrollLeft = toScrollLeft * ((rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? -1 : 1);
            const {
              internalOnUpdateScrollLeft
            } = props;
            if (internalOnUpdateScrollLeft) internalOnUpdateScrollLeft(toScrollLeft);
          }
        }
        function handleXScrollMouseUp(e) {
          e.preventDefault();
          e.stopPropagation();
          off("mousemove", window, handleXScrollMouseMove, true);
          off("mouseup", window, handleXScrollMouseUp, true);
          xBarPressed = false;
          sync();
          if (isMouseUpAway(e)) {
            hideBar();
          }
        }
        function handleYScrollMouseDown(e) {
          e.preventDefault();
          e.stopPropagation();
          yBarPressed = true;
          on("mousemove", window, handleYScrollMouseMove, true);
          on("mouseup", window, handleYScrollMouseUp, true);
          memoYTop = containerScrollTopRef.value;
          memoMouseY = e.clientY;
        }
        function handleYScrollMouseMove(e) {
          if (!yBarPressed) return;
          if (xBarVanishTimerId !== void 0) {
            window.clearTimeout(xBarVanishTimerId);
          }
          if (yBarVanishTimerId !== void 0) {
            window.clearTimeout(yBarVanishTimerId);
          }
          const {
            value: containerHeight
          } = containerHeightRef;
          const {
            value: contentHeight
          } = contentHeightRef;
          const {
            value: yBarSize
          } = yBarSizeRef;
          if (containerHeight === null || contentHeight === null) return;
          const dY = e.clientY - memoMouseY;
          const dScrollTop = dY * (contentHeight - containerHeight) / (containerHeight - yBarSize);
          const toScrollTopUpperBound = contentHeight - containerHeight;
          let toScrollTop = memoYTop + dScrollTop;
          toScrollTop = Math.min(toScrollTopUpperBound, toScrollTop);
          toScrollTop = Math.max(toScrollTop, 0);
          const {
            value: container
          } = mergedContainerRef;
          if (container) {
            container.scrollTop = toScrollTop;
          }
        }
        function handleYScrollMouseUp(e) {
          e.preventDefault();
          e.stopPropagation();
          off("mousemove", window, handleYScrollMouseMove, true);
          off("mouseup", window, handleYScrollMouseUp, true);
          yBarPressed = false;
          sync();
          if (isMouseUpAway(e)) {
            hideBar();
          }
        }
        watchEffect(() => {
          const {
            value: needXBar
          } = needXBarRef;
          const {
            value: needYBar
          } = needYBarRef;
          const {
            value: mergedClsPrefix
          } = mergedClsPrefixRef;
          const {
            value: xRailEl
          } = xRailRef;
          const {
            value: yRailEl
          } = yRailRef;
          if (xRailEl) {
            if (!needXBar) {
              xRailEl.classList.add(`${mergedClsPrefix}-scrollbar-rail--disabled`);
            } else {
              xRailEl.classList.remove(`${mergedClsPrefix}-scrollbar-rail--disabled`);
            }
          }
          if (yRailEl) {
            if (!needYBar) {
              yRailEl.classList.add(`${mergedClsPrefix}-scrollbar-rail--disabled`);
            } else {
              yRailEl.classList.remove(`${mergedClsPrefix}-scrollbar-rail--disabled`);
            }
          }
        });
        onMounted(() => {
          if (props.container) return;
          sync();
        });
        onBeforeUnmount(() => {
          if (xBarVanishTimerId !== void 0) {
            window.clearTimeout(xBarVanishTimerId);
          }
          if (yBarVanishTimerId !== void 0) {
            window.clearTimeout(yBarVanishTimerId);
          }
          off("mousemove", window, handleYScrollMouseMove, true);
          off("mouseup", window, handleYScrollMouseUp, true);
        });
        const cssVarsRef = computed(() => {
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              color,
              colorHover,
              height,
              width,
              borderRadius,
              railInsetHorizontalTop,
              railInsetHorizontalBottom,
              railInsetVerticalRight,
              railInsetVerticalLeft,
              railColor
            }
          } = themeRef.value;
          return {
            "--n-scrollbar-bezier": cubicBezierEaseInOut2,
            "--n-scrollbar-color": color,
            "--n-scrollbar-color-hover": colorHover,
            "--n-scrollbar-border-radius": borderRadius,
            "--n-scrollbar-width": width,
            "--n-scrollbar-height": height,
            "--n-scrollbar-rail-inset-horizontal-top": railInsetHorizontalTop,
            "--n-scrollbar-rail-inset-horizontal-bottom": railInsetHorizontalBottom,
            "--n-scrollbar-rail-inset-vertical-right": (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? rtlInset(railInsetVerticalRight) : railInsetVerticalRight,
            "--n-scrollbar-rail-inset-vertical-left": (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? rtlInset(railInsetVerticalLeft) : railInsetVerticalLeft,
            "--n-scrollbar-rail-color": railColor
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("scrollbar", void 0, cssVarsRef, props) : void 0;
        const exposedMethods = {
          scrollTo,
          scrollBy,
          sync,
          syncUnifiedContainer,
          handleMouseEnterWrapper,
          handleMouseLeaveWrapper
        };
        return Object.assign(Object.assign({}, exposedMethods), {
          mergedClsPrefix: mergedClsPrefixRef,
          rtlEnabled: rtlEnabledRef,
          containerScrollTop: containerScrollTopRef,
          wrapperRef,
          containerRef,
          contentRef,
          yRailRef,
          xRailRef,
          needYBar: needYBarRef,
          needXBar: needXBarRef,
          yBarSizePx: yBarSizePxRef,
          xBarSizePx: xBarSizePxRef,
          yBarTopPx: yBarTopPxRef,
          xBarLeftPx: xBarLeftPxRef,
          isShowXBar: mergedShowXBarRef,
          isShowYBar: mergedShowYBarRef,
          isIos: isIos2,
          handleScroll,
          handleContentResize,
          handleContainerResize,
          handleYScrollMouseDown,
          handleXScrollMouseDown,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        });
      },
      render() {
        var _a;
        const {
          $slots,
          mergedClsPrefix,
          triggerDisplayManually,
          rtlEnabled,
          internalHoistYRail,
          yPlacement,
          xPlacement,
          xScrollable
        } = this;
        if (!this.scrollable) return (_a = $slots.default) === null || _a === void 0 ? void 0 : _a.call($slots);
        const triggerIsNone = this.trigger === "none";
        const createYRail = (className, style2) => {
          return h("div", {
            ref: "yRailRef",
            class: [`${mergedClsPrefix}-scrollbar-rail`, `${mergedClsPrefix}-scrollbar-rail--vertical`, `${mergedClsPrefix}-scrollbar-rail--vertical--${yPlacement}`, className],
            "data-scrollbar-rail": true,
            style: [style2 || "", this.verticalRailStyle],
            "aria-hidden": true
          }, h(triggerIsNone ? Wrapper : Transition, triggerIsNone ? null : {
            name: "fade-in-transition"
          }, {
            default: () => this.needYBar && this.isShowYBar && !this.isIos ? h("div", {
              class: `${mergedClsPrefix}-scrollbar-rail__scrollbar`,
              style: {
                height: this.yBarSizePx,
                top: this.yBarTopPx
              },
              onMousedown: this.handleYScrollMouseDown
            }) : null
          }));
        };
        const createChildren = () => {
          var _a2, _b;
          (_a2 = this.onRender) === null || _a2 === void 0 ? void 0 : _a2.call(this);
          return h("div", mergeProps(this.$attrs, {
            role: "none",
            ref: "wrapperRef",
            class: [`${mergedClsPrefix}-scrollbar`, this.themeClass, rtlEnabled && `${mergedClsPrefix}-scrollbar--rtl`],
            style: this.cssVars,
            onMouseenter: triggerDisplayManually ? void 0 : this.handleMouseEnterWrapper,
            onMouseleave: triggerDisplayManually ? void 0 : this.handleMouseLeaveWrapper
          }), [this.container ? (_b = $slots.default) === null || _b === void 0 ? void 0 : _b.call($slots) : h("div", {
            role: "none",
            ref: "containerRef",
            class: [`${mergedClsPrefix}-scrollbar-container`, this.containerClass],
            style: this.containerStyle,
            onScroll: this.handleScroll,
            onWheel: this.onWheel
          }, h(VResizeObserver, {
            onResize: this.handleContentResize
          }, {
            default: () => h("div", {
              ref: "contentRef",
              role: "none",
              style: [{
                width: this.xScrollable ? "fit-content" : null
              }, this.contentStyle],
              class: [`${mergedClsPrefix}-scrollbar-content`, this.contentClass]
            }, $slots)
          })), internalHoistYRail ? null : createYRail(void 0, void 0), xScrollable && h("div", {
            ref: "xRailRef",
            class: [`${mergedClsPrefix}-scrollbar-rail`, `${mergedClsPrefix}-scrollbar-rail--horizontal`, `${mergedClsPrefix}-scrollbar-rail--horizontal--${xPlacement}`],
            style: this.horizontalRailStyle,
            "data-scrollbar-rail": true,
            "aria-hidden": true
          }, h(triggerIsNone ? Wrapper : Transition, triggerIsNone ? null : {
            name: "fade-in-transition"
          }, {
            default: () => this.needXBar && this.isShowXBar && !this.isIos ? h("div", {
              class: `${mergedClsPrefix}-scrollbar-rail__scrollbar`,
              style: {
                width: this.xBarSizePx,
                right: rtlEnabled ? this.xBarLeftPx : void 0,
                left: rtlEnabled ? void 0 : this.xBarLeftPx
              },
              onMousedown: this.handleXScrollMouseDown
            }) : null
          }))]);
        };
        const scrollbarNode = this.container ? createChildren() : h(VResizeObserver, {
          onResize: this.handleContainerResize
        }, {
          default: createChildren
        });
        if (internalHoistYRail) {
          return h(Fragment, null, scrollbarNode, createYRail(this.themeClass, this.cssVars));
        } else {
          return scrollbarNode;
        }
      }
    });
    const XScrollbar = Scrollbar;
    const commonVariables$l = {
      height: "calc(var(--n-option-height) * 7.6)",
      paddingTiny: "4px 0",
      paddingSmall: "4px 0",
      paddingMedium: "4px 0",
      paddingLarge: "4px 0",
      paddingHuge: "4px 0",
      optionPaddingTiny: "0 12px",
      optionPaddingSmall: "0 12px",
      optionPaddingMedium: "0 12px",
      optionPaddingLarge: "0 12px",
      optionPaddingHuge: "0 12px",
      loadingSize: "18px"
    };
    function self$W(vars) {
      const {
        borderRadius,
        popoverColor,
        textColor3,
        dividerColor,
        textColor2,
        primaryColorPressed,
        textColorDisabled,
        primaryColor,
        opacityDisabled,
        hoverColor,
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        fontSizeHuge,
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        heightHuge
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$l), {
        optionFontSizeTiny: fontSizeTiny,
        optionFontSizeSmall: fontSizeSmall,
        optionFontSizeMedium: fontSizeMedium,
        optionFontSizeLarge: fontSizeLarge,
        optionFontSizeHuge: fontSizeHuge,
        optionHeightTiny: heightTiny,
        optionHeightSmall: heightSmall,
        optionHeightMedium: heightMedium,
        optionHeightLarge: heightLarge,
        optionHeightHuge: heightHuge,
        borderRadius,
        color: popoverColor,
        groupHeaderTextColor: textColor3,
        actionDividerColor: dividerColor,
        optionTextColor: textColor2,
        optionTextColorPressed: primaryColorPressed,
        optionTextColorDisabled: textColorDisabled,
        optionTextColorActive: primaryColor,
        optionOpacityDisabled: opacityDisabled,
        optionCheckColor: primaryColor,
        optionColorPending: hoverColor,
        optionColorActive: "rgba(0, 0, 0, 0)",
        optionColorActivePending: hoverColor,
        actionTextColor: textColor2,
        loadingColor: primaryColor
      });
    }
    const internalSelectMenuLight = createTheme({
      name: "InternalSelectMenu",
      common: derived,
      peers: {
        Scrollbar: scrollbarLight,
        Empty: emptyLight
      },
      self: self$W
    });
    const internalSelectMenuDark = {
      name: "InternalSelectMenu",
      common: derived$1,
      peers: {
        Scrollbar: scrollbarDark,
        Empty: emptyDark
      },
      self: self$W
    };
    function renderCheckMark(show, clsPrefix) {
      return h(Transition, {
        name: "fade-in-scale-up-transition"
      }, {
        default: () => show ? h(NBaseIcon, {
          clsPrefix,
          class: `${clsPrefix}-base-select-option__check`
        }, {
          default: () => h(FinishedIcon)
        }) : null
      });
    }
    const NSelectOption = /* @__PURE__ */ defineComponent({
      name: "NBaseSelectOption",
      props: {
        clsPrefix: {
          type: String,
          required: true
        },
        tmNode: {
          type: Object,
          required: true
        }
      },
      setup(props) {
        const {
          valueRef,
          pendingTmNodeRef,
          multipleRef,
          valueSetRef,
          renderLabelRef,
          renderOptionRef,
          labelFieldRef,
          valueFieldRef,
          showCheckmarkRef,
          nodePropsRef,
          handleOptionClick,
          handleOptionMouseEnter
        } = inject(internalSelectionMenuInjectionKey);
        const isPendingRef = useMemo(() => {
          const {
            value: pendingTmNode
          } = pendingTmNodeRef;
          if (!pendingTmNode) return false;
          return props.tmNode.key === pendingTmNode.key;
        });
        function handleClick2(e) {
          const {
            tmNode
          } = props;
          if (tmNode.disabled) return;
          handleOptionClick(e, tmNode);
        }
        function handleMouseEnter(e) {
          const {
            tmNode
          } = props;
          if (tmNode.disabled) return;
          handleOptionMouseEnter(e, tmNode);
        }
        function handleMouseMove(e) {
          const {
            tmNode
          } = props;
          const {
            value: isPending
          } = isPendingRef;
          if (tmNode.disabled || isPending) return;
          handleOptionMouseEnter(e, tmNode);
        }
        return {
          multiple: multipleRef,
          isGrouped: useMemo(() => {
            const {
              tmNode
            } = props;
            const {
              parent
            } = tmNode;
            return parent && parent.rawNode.type === "group";
          }),
          showCheckmark: showCheckmarkRef,
          nodeProps: nodePropsRef,
          isPending: isPendingRef,
          isSelected: useMemo(() => {
            const {
              value
            } = valueRef;
            const {
              value: multiple
            } = multipleRef;
            if (value === null) return false;
            const optionValue = props.tmNode.rawNode[valueFieldRef.value];
            if (multiple) {
              const {
                value: valueSet
              } = valueSetRef;
              return valueSet.has(optionValue);
            } else {
              return value === optionValue;
            }
          }),
          labelField: labelFieldRef,
          renderLabel: renderLabelRef,
          renderOption: renderOptionRef,
          handleMouseMove,
          handleMouseEnter,
          handleClick: handleClick2
        };
      },
      render() {
        const {
          clsPrefix,
          tmNode: {
            rawNode
          },
          isSelected,
          isPending,
          isGrouped,
          showCheckmark,
          nodeProps,
          renderOption,
          renderLabel,
          handleClick: handleClick2,
          handleMouseEnter,
          handleMouseMove
        } = this;
        const checkmark = renderCheckMark(isSelected, clsPrefix);
        const children = renderLabel ? [renderLabel(rawNode, isSelected), showCheckmark && checkmark] : [render$1(rawNode[this.labelField], rawNode, isSelected), showCheckmark && checkmark];
        const attrs = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(rawNode);
        const node = h("div", Object.assign({}, attrs, {
          class: [`${clsPrefix}-base-select-option`, rawNode.class, attrs === null || attrs === void 0 ? void 0 : attrs.class, {
            [`${clsPrefix}-base-select-option--disabled`]: rawNode.disabled,
            [`${clsPrefix}-base-select-option--selected`]: isSelected,
            [`${clsPrefix}-base-select-option--grouped`]: isGrouped,
            [`${clsPrefix}-base-select-option--pending`]: isPending,
            [`${clsPrefix}-base-select-option--show-checkmark`]: showCheckmark
          }],
          style: [(attrs === null || attrs === void 0 ? void 0 : attrs.style) || "", rawNode.style || ""],
          onClick: mergeEventHandlers([handleClick2, attrs === null || attrs === void 0 ? void 0 : attrs.onClick]),
          onMouseenter: mergeEventHandlers([handleMouseEnter, attrs === null || attrs === void 0 ? void 0 : attrs.onMouseenter]),
          onMousemove: mergeEventHandlers([handleMouseMove, attrs === null || attrs === void 0 ? void 0 : attrs.onMousemove])
        }), h("div", {
          class: `${clsPrefix}-base-select-option__content`
        }, children));
        return rawNode.render ? rawNode.render({
          node,
          option: rawNode,
          selected: isSelected
        }) : renderOption ? renderOption({
          node,
          option: rawNode,
          selected: isSelected
        }) : node;
      }
    });
    const NSelectGroupHeader = /* @__PURE__ */ defineComponent({
      name: "NBaseSelectGroupHeader",
      props: {
        clsPrefix: {
          type: String,
          required: true
        },
        tmNode: {
          type: Object,
          required: true
        }
      },
      setup() {
        const {
          renderLabelRef,
          renderOptionRef,
          labelFieldRef,
          nodePropsRef
        } = inject(internalSelectionMenuInjectionKey);
        return {
          labelField: labelFieldRef,
          nodeProps: nodePropsRef,
          renderLabel: renderLabelRef,
          renderOption: renderOptionRef
        };
      },
      render() {
        const {
          clsPrefix,
          renderLabel,
          renderOption,
          nodeProps,
          tmNode: {
            rawNode
          }
        } = this;
        const attrs = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(rawNode);
        const children = renderLabel ? renderLabel(rawNode, false) : render$1(rawNode[this.labelField], rawNode, false);
        const node = h("div", Object.assign({}, attrs, {
          class: [`${clsPrefix}-base-select-group-header`, attrs === null || attrs === void 0 ? void 0 : attrs.class]
        }), children);
        return rawNode.render ? rawNode.render({
          node,
          option: rawNode
        }) : renderOption ? renderOption({
          node,
          option: rawNode,
          selected: false
        }) : node;
      }
    });
    const {
      cubicBezierEaseIn: cubicBezierEaseIn$5,
      cubicBezierEaseOut: cubicBezierEaseOut$5
    } = commonVariables$m;
    function fadeInScaleUpTransition({
      transformOrigin = "inherit",
      duration: duration2 = ".2s",
      enterScale = ".9",
      originalTransform = "",
      originalTransition = ""
    } = {}) {
      return [c$1("&.fade-in-scale-up-transition-leave-active", {
        transformOrigin,
        transition: `opacity ${duration2} ${cubicBezierEaseIn$5}, transform ${duration2} ${cubicBezierEaseIn$5} ${originalTransition && `,${originalTransition}`}`
      }), c$1("&.fade-in-scale-up-transition-enter-active", {
        transformOrigin,
        transition: `opacity ${duration2} ${cubicBezierEaseOut$5}, transform ${duration2} ${cubicBezierEaseOut$5} ${originalTransition && `,${originalTransition}`}`
      }), c$1("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to", {
        opacity: 0,
        transform: `${originalTransform} scale(${enterScale})`
      }), c$1("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to", {
        opacity: 1,
        transform: `${originalTransform} scale(1)`
      })];
    }
    const style$n = cB("base-select-menu", `
 line-height: 1.5;
 outline: none;
 z-index: 0;
 position: relative;
 border-radius: var(--n-border-radius);
 transition:
 background-color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier);
 background-color: var(--n-color);
`, [cB("scrollbar", `
 max-height: var(--n-height);
 `), cB("virtual-list", `
 max-height: var(--n-height);
 `), cB("base-select-option", `
 min-height: var(--n-option-height);
 font-size: var(--n-option-font-size);
 display: flex;
 align-items: center;
 `, [cE("content", `
 z-index: 1;
 white-space: nowrap;
 text-overflow: ellipsis;
 overflow: hidden;
 `)]), cB("base-select-group-header", `
 min-height: var(--n-option-height);
 font-size: .93em;
 display: flex;
 align-items: center;
 `), cB("base-select-menu-option-wrapper", `
 position: relative;
 width: 100%;
 `), cE("loading, empty", `
 display: flex;
 padding: 12px 32px;
 flex: 1;
 justify-content: center;
 `), cE("loading", `
 color: var(--n-loading-color);
 font-size: var(--n-loading-size);
 `), cE("header", `
 padding: 8px var(--n-option-padding-left);
 font-size: var(--n-option-font-size);
 transition: 
 color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 border-bottom: 1px solid var(--n-action-divider-color);
 color: var(--n-action-text-color);
 `), cE("action", `
 padding: 8px var(--n-option-padding-left);
 font-size: var(--n-option-font-size);
 transition: 
 color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 border-top: 1px solid var(--n-action-divider-color);
 color: var(--n-action-text-color);
 `), cB("base-select-group-header", `
 position: relative;
 cursor: default;
 padding: var(--n-option-padding);
 color: var(--n-group-header-text-color);
 `), cB("base-select-option", `
 cursor: pointer;
 position: relative;
 padding: var(--n-option-padding);
 transition:
 color .3s var(--n-bezier),
 opacity .3s var(--n-bezier);
 box-sizing: border-box;
 color: var(--n-option-text-color);
 opacity: 1;
 `, [cM("show-checkmark", `
 padding-right: calc(var(--n-option-padding-right) + 20px);
 `), c$1("&::before", `
 content: "";
 position: absolute;
 left: 4px;
 right: 4px;
 top: 0;
 bottom: 0;
 border-radius: var(--n-border-radius);
 transition: background-color .3s var(--n-bezier);
 `), c$1("&:active", `
 color: var(--n-option-text-color-pressed);
 `), cM("grouped", `
 padding-left: calc(var(--n-option-padding-left) * 1.5);
 `), cM("pending", [c$1("&::before", `
 background-color: var(--n-option-color-pending);
 `)]), cM("selected", `
 color: var(--n-option-text-color-active);
 `, [c$1("&::before", `
 background-color: var(--n-option-color-active);
 `), cM("pending", [c$1("&::before", `
 background-color: var(--n-option-color-active-pending);
 `)])]), cM("disabled", `
 cursor: not-allowed;
 `, [cNotM("selected", `
 color: var(--n-option-text-color-disabled);
 `), cM("selected", `
 opacity: var(--n-option-opacity-disabled);
 `)]), cE("check", `
 font-size: 16px;
 position: absolute;
 right: calc(var(--n-option-padding-right) - 4px);
 top: calc(50% - 7px);
 color: var(--n-option-check-color);
 transition: color .3s var(--n-bezier);
 `, [fadeInScaleUpTransition({
      enterScale: "0.5"
    })])])]);
    const NInternalSelectMenu = /* @__PURE__ */ defineComponent({
      name: "InternalSelectMenu",
      props: Object.assign(Object.assign({}, useTheme.props), {
        clsPrefix: {
          type: String,
          required: true
        },
        scrollable: {
          type: Boolean,
          default: true
        },
        treeMate: {
          type: Object,
          required: true
        },
        multiple: Boolean,
        size: {
          type: String,
          default: "medium"
        },
        value: {
          type: [String, Number, Array],
          default: null
        },
        autoPending: Boolean,
        virtualScroll: {
          type: Boolean,
          default: true
        },
        // show is used to toggle pending state initialization
        show: {
          type: Boolean,
          default: true
        },
        labelField: {
          type: String,
          default: "label"
        },
        valueField: {
          type: String,
          default: "value"
        },
        loading: Boolean,
        focusable: Boolean,
        renderLabel: Function,
        renderOption: Function,
        nodeProps: Function,
        showCheckmark: {
          type: Boolean,
          default: true
        },
        onMousedown: Function,
        onScroll: Function,
        onFocus: Function,
        onBlur: Function,
        onKeyup: Function,
        onKeydown: Function,
        onTabOut: Function,
        onMouseenter: Function,
        onMouseleave: Function,
        onResize: Function,
        resetMenuOnOptionsChange: {
          type: Boolean,
          default: true
        },
        inlineThemeDisabled: Boolean,
        // deprecated
        onToggle: Function
      }),
      setup(props) {
        const {
          mergedClsPrefixRef,
          mergedRtlRef
        } = useConfig(props);
        const rtlEnabledRef = useRtl("InternalSelectMenu", mergedRtlRef, mergedClsPrefixRef);
        const themeRef = useTheme("InternalSelectMenu", "-internal-select-menu", style$n, internalSelectMenuLight, props, toRef(props, "clsPrefix"));
        const selfRef = ref(null);
        const virtualListRef = ref(null);
        const scrollbarRef = ref(null);
        const flattenedNodesRef = computed(() => props.treeMate.getFlattenedNodes());
        const fIndexGetterRef = computed(() => createIndexGetter(flattenedNodesRef.value));
        const pendingNodeRef = ref(null);
        function initPendingNode() {
          const {
            treeMate
          } = props;
          let defaultPendingNode = null;
          const {
            value
          } = props;
          if (value === null) {
            defaultPendingNode = treeMate.getFirstAvailableNode();
          } else {
            if (props.multiple) {
              defaultPendingNode = treeMate.getNode((value || [])[(value || []).length - 1]);
            } else {
              defaultPendingNode = treeMate.getNode(value);
            }
            if (!defaultPendingNode || defaultPendingNode.disabled) {
              defaultPendingNode = treeMate.getFirstAvailableNode();
            }
          }
          if (defaultPendingNode) {
            setPendingTmNode(defaultPendingNode);
          } else {
            setPendingTmNode(null);
          }
        }
        function clearPendingNodeIfInvalid() {
          const {
            value: pendingNode
          } = pendingNodeRef;
          if (pendingNode && !props.treeMate.getNode(pendingNode.key)) {
            pendingNodeRef.value = null;
          }
        }
        let initPendingNodeWatchStopHandle;
        watch(() => props.show, (show) => {
          if (show) {
            initPendingNodeWatchStopHandle = watch(() => props.treeMate, () => {
              if (props.resetMenuOnOptionsChange) {
                if (props.autoPending) {
                  initPendingNode();
                } else {
                  clearPendingNodeIfInvalid();
                }
                void nextTick(scrollToPendingNode);
              } else {
                clearPendingNodeIfInvalid();
              }
            }, {
              immediate: true
            });
          } else {
            initPendingNodeWatchStopHandle === null || initPendingNodeWatchStopHandle === void 0 ? void 0 : initPendingNodeWatchStopHandle();
          }
        }, {
          immediate: true
        });
        onBeforeUnmount(() => {
          initPendingNodeWatchStopHandle === null || initPendingNodeWatchStopHandle === void 0 ? void 0 : initPendingNodeWatchStopHandle();
        });
        const itemSizeRef = computed(() => {
          return depx(themeRef.value.self[createKey("optionHeight", props.size)]);
        });
        const paddingRef = computed(() => {
          return getMargin(themeRef.value.self[createKey("padding", props.size)]);
        });
        const valueSetRef = computed(() => {
          if (props.multiple && Array.isArray(props.value)) {
            return new Set(props.value);
          }
          return /* @__PURE__ */ new Set();
        });
        const emptyRef = computed(() => {
          const tmNodes = flattenedNodesRef.value;
          return tmNodes && tmNodes.length === 0;
        });
        function doToggle(tmNode) {
          const {
            onToggle
          } = props;
          if (onToggle) onToggle(tmNode);
        }
        function doScroll(e) {
          const {
            onScroll
          } = props;
          if (onScroll) onScroll(e);
        }
        function handleVirtualListScroll(e) {
          var _a;
          (_a = scrollbarRef.value) === null || _a === void 0 ? void 0 : _a.sync();
          doScroll(e);
        }
        function handleVirtualListResize() {
          var _a;
          (_a = scrollbarRef.value) === null || _a === void 0 ? void 0 : _a.sync();
        }
        function getPendingTmNode() {
          const {
            value: pendingTmNode
          } = pendingNodeRef;
          if (pendingTmNode) return pendingTmNode;
          return null;
        }
        function handleOptionMouseEnter(e, tmNode) {
          if (tmNode.disabled) return;
          setPendingTmNode(tmNode, false);
        }
        function handleOptionClick(e, tmNode) {
          if (tmNode.disabled) return;
          doToggle(tmNode);
        }
        function handleKeyUp(e) {
          var _a;
          if (happensIn(e, "action")) return;
          (_a = props.onKeyup) === null || _a === void 0 ? void 0 : _a.call(props, e);
        }
        function handleKeyDown(e) {
          var _a;
          if (happensIn(e, "action")) return;
          (_a = props.onKeydown) === null || _a === void 0 ? void 0 : _a.call(props, e);
        }
        function handleMouseDown(e) {
          var _a;
          (_a = props.onMousedown) === null || _a === void 0 ? void 0 : _a.call(props, e);
          if (props.focusable) return;
          e.preventDefault();
        }
        function next() {
          const {
            value: pendingTmNode
          } = pendingNodeRef;
          if (pendingTmNode) {
            setPendingTmNode(pendingTmNode.getNext({
              loop: true
            }), true);
          }
        }
        function prev() {
          const {
            value: pendingTmNode
          } = pendingNodeRef;
          if (pendingTmNode) {
            setPendingTmNode(pendingTmNode.getPrev({
              loop: true
            }), true);
          }
        }
        function setPendingTmNode(tmNode, doScroll2 = false) {
          pendingNodeRef.value = tmNode;
          if (doScroll2) scrollToPendingNode();
        }
        function scrollToPendingNode() {
          var _a, _b;
          const tmNode = pendingNodeRef.value;
          if (!tmNode) return;
          const fIndex = fIndexGetterRef.value(tmNode.key);
          if (fIndex === null) return;
          if (props.virtualScroll) {
            (_a = virtualListRef.value) === null || _a === void 0 ? void 0 : _a.scrollTo({
              index: fIndex
            });
          } else {
            (_b = scrollbarRef.value) === null || _b === void 0 ? void 0 : _b.scrollTo({
              index: fIndex,
              elSize: itemSizeRef.value
            });
          }
        }
        function handleFocusin(e) {
          var _a, _b;
          if ((_a = selfRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
            (_b = props.onFocus) === null || _b === void 0 ? void 0 : _b.call(props, e);
          }
        }
        function handleFocusout(e) {
          var _a, _b;
          if (!((_a = selfRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
            (_b = props.onBlur) === null || _b === void 0 ? void 0 : _b.call(props, e);
          }
        }
        provide(internalSelectionMenuInjectionKey, {
          handleOptionMouseEnter,
          handleOptionClick,
          valueSetRef,
          pendingTmNodeRef: pendingNodeRef,
          nodePropsRef: toRef(props, "nodeProps"),
          showCheckmarkRef: toRef(props, "showCheckmark"),
          multipleRef: toRef(props, "multiple"),
          valueRef: toRef(props, "value"),
          renderLabelRef: toRef(props, "renderLabel"),
          renderOptionRef: toRef(props, "renderOption"),
          labelFieldRef: toRef(props, "labelField"),
          valueFieldRef: toRef(props, "valueField")
        });
        provide(internalSelectionMenuBodyInjectionKey, selfRef);
        onMounted(() => {
          const {
            value
          } = scrollbarRef;
          if (value) value.sync();
        });
        const cssVarsRef = computed(() => {
          const {
            size: size2
          } = props;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              height,
              borderRadius,
              color,
              groupHeaderTextColor,
              actionDividerColor,
              optionTextColorPressed,
              optionTextColor,
              optionTextColorDisabled,
              optionTextColorActive,
              optionOpacityDisabled,
              optionCheckColor,
              actionTextColor,
              optionColorPending,
              optionColorActive,
              loadingColor,
              loadingSize,
              optionColorActivePending,
              [createKey("optionFontSize", size2)]: fontSize2,
              [createKey("optionHeight", size2)]: optionHeight,
              [createKey("optionPadding", size2)]: optionPadding
            }
          } = themeRef.value;
          return {
            "--n-height": height,
            "--n-action-divider-color": actionDividerColor,
            "--n-action-text-color": actionTextColor,
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-border-radius": borderRadius,
            "--n-color": color,
            "--n-option-font-size": fontSize2,
            "--n-group-header-text-color": groupHeaderTextColor,
            "--n-option-check-color": optionCheckColor,
            "--n-option-color-pending": optionColorPending,
            "--n-option-color-active": optionColorActive,
            "--n-option-color-active-pending": optionColorActivePending,
            "--n-option-height": optionHeight,
            "--n-option-opacity-disabled": optionOpacityDisabled,
            "--n-option-text-color": optionTextColor,
            "--n-option-text-color-active": optionTextColorActive,
            "--n-option-text-color-disabled": optionTextColorDisabled,
            "--n-option-text-color-pressed": optionTextColorPressed,
            "--n-option-padding": optionPadding,
            "--n-option-padding-left": getMargin(optionPadding, "left"),
            "--n-option-padding-right": getMargin(optionPadding, "right"),
            "--n-loading-color": loadingColor,
            "--n-loading-size": loadingSize
          };
        });
        const {
          inlineThemeDisabled
        } = props;
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("internal-select-menu", computed(() => props.size[0]), cssVarsRef, props) : void 0;
        const exposedProps = {
          selfRef,
          next,
          prev,
          getPendingTmNode
        };
        useOnResize(selfRef, props.onResize);
        return Object.assign({
          mergedTheme: themeRef,
          mergedClsPrefix: mergedClsPrefixRef,
          rtlEnabled: rtlEnabledRef,
          virtualListRef,
          scrollbarRef,
          itemSize: itemSizeRef,
          padding: paddingRef,
          flattenedNodes: flattenedNodesRef,
          empty: emptyRef,
          virtualListContainer() {
            const {
              value
            } = virtualListRef;
            return value === null || value === void 0 ? void 0 : value.listElRef;
          },
          virtualListContent() {
            const {
              value
            } = virtualListRef;
            return value === null || value === void 0 ? void 0 : value.itemsElRef;
          },
          doScroll,
          handleFocusin,
          handleFocusout,
          handleKeyUp,
          handleKeyDown,
          handleMouseDown,
          handleVirtualListResize,
          handleVirtualListScroll,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        }, exposedProps);
      },
      render() {
        const {
          $slots,
          virtualScroll,
          clsPrefix,
          mergedTheme,
          themeClass,
          onRender
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h("div", {
          ref: "selfRef",
          tabindex: this.focusable ? 0 : -1,
          class: [`${clsPrefix}-base-select-menu`, this.rtlEnabled && `${clsPrefix}-base-select-menu--rtl`, themeClass, this.multiple && `${clsPrefix}-base-select-menu--multiple`],
          style: this.cssVars,
          onFocusin: this.handleFocusin,
          onFocusout: this.handleFocusout,
          onKeyup: this.handleKeyUp,
          onKeydown: this.handleKeyDown,
          onMousedown: this.handleMouseDown,
          onMouseenter: this.onMouseenter,
          onMouseleave: this.onMouseleave
        }, resolveWrappedSlot($slots.header, (children) => children && h("div", {
          class: `${clsPrefix}-base-select-menu__header`,
          "data-header": true,
          key: "header"
        }, children)), this.loading ? h("div", {
          class: `${clsPrefix}-base-select-menu__loading`
        }, h(NBaseLoading, {
          clsPrefix,
          strokeWidth: 20
        })) : !this.empty ? h(Scrollbar, {
          ref: "scrollbarRef",
          theme: mergedTheme.peers.Scrollbar,
          themeOverrides: mergedTheme.peerOverrides.Scrollbar,
          scrollable: this.scrollable,
          container: virtualScroll ? this.virtualListContainer : void 0,
          content: virtualScroll ? this.virtualListContent : void 0,
          onScroll: virtualScroll ? void 0 : this.doScroll
        }, {
          default: () => {
            return virtualScroll ? h(VVirtualList, {
              ref: "virtualListRef",
              class: `${clsPrefix}-virtual-list`,
              items: this.flattenedNodes,
              itemSize: this.itemSize,
              showScrollbar: false,
              paddingTop: this.padding.top,
              paddingBottom: this.padding.bottom,
              onResize: this.handleVirtualListResize,
              onScroll: this.handleVirtualListScroll,
              itemResizable: true
            }, {
              default: ({
                item: tmNode
              }) => {
                return tmNode.isGroup ? h(NSelectGroupHeader, {
                  key: tmNode.key,
                  clsPrefix,
                  tmNode
                }) : tmNode.ignored ? null : h(NSelectOption, {
                  clsPrefix,
                  key: tmNode.key,
                  tmNode
                });
              }
            }) : h("div", {
              class: `${clsPrefix}-base-select-menu-option-wrapper`,
              style: {
                paddingTop: this.padding.top,
                paddingBottom: this.padding.bottom
              }
            }, this.flattenedNodes.map((tmNode) => tmNode.isGroup ? h(NSelectGroupHeader, {
              key: tmNode.key,
              clsPrefix,
              tmNode
            }) : h(NSelectOption, {
              clsPrefix,
              key: tmNode.key,
              tmNode
            })));
          }
        }) : h("div", {
          class: `${clsPrefix}-base-select-menu__empty`,
          "data-empty": true
        }, resolveSlot($slots.empty, () => [h(NEmpty, {
          theme: mergedTheme.peers.Empty,
          themeOverrides: mergedTheme.peerOverrides.Empty,
          size: this.size
        })])), resolveWrappedSlot($slots.action, (children) => children && [h("div", {
          class: `${clsPrefix}-base-select-menu__action`,
          "data-action": true,
          key: "action"
        }, children), h(FocusDetector, {
          onFocus: this.onTabOut,
          key: "focus-detector"
        })]));
      }
    });
    const style$m = cB("base-wave", `
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 border-radius: inherit;
`);
    const NBaseWave = /* @__PURE__ */ defineComponent({
      name: "BaseWave",
      props: {
        clsPrefix: {
          type: String,
          required: true
        }
      },
      setup(props) {
        useStyle("-base-wave", style$m, toRef(props, "clsPrefix"));
        const selfRef = ref(null);
        const activeRef = ref(false);
        let animationTimerId = null;
        onBeforeUnmount(() => {
          if (animationTimerId !== null) {
            window.clearTimeout(animationTimerId);
          }
        });
        return {
          active: activeRef,
          selfRef,
          play() {
            if (animationTimerId !== null) {
              window.clearTimeout(animationTimerId);
              activeRef.value = false;
              animationTimerId = null;
            }
            void nextTick(() => {
              var _a;
              void ((_a = selfRef.value) === null || _a === void 0 ? void 0 : _a.offsetHeight);
              activeRef.value = true;
              animationTimerId = window.setTimeout(() => {
                activeRef.value = false;
                animationTimerId = null;
              }, 1e3);
            });
          }
        };
      },
      render() {
        const {
          clsPrefix
        } = this;
        return h("div", {
          ref: "selfRef",
          "aria-hidden": true,
          class: [`${clsPrefix}-base-wave`, this.active && `${clsPrefix}-base-wave--active`]
        });
      }
    });
    const commonVariables$k = {
      space: "6px",
      spaceArrow: "10px",
      arrowOffset: "10px",
      arrowOffsetVertical: "10px",
      arrowHeight: "6px",
      padding: "8px 14px"
    };
    function self$V(vars) {
      const {
        boxShadow2,
        popoverColor,
        textColor2,
        borderRadius,
        fontSize: fontSize2,
        dividerColor
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$k), {
        fontSize: fontSize2,
        borderRadius,
        color: popoverColor,
        dividerColor,
        textColor: textColor2,
        boxShadow: boxShadow2
      });
    }
    const popoverLight = {
      name: "Popover",
      common: derived,
      self: self$V
    };
    const popoverDark = {
      name: "Popover",
      common: derived$1,
      self: self$V
    };
    const oppositePlacement = {
      top: "bottom",
      bottom: "top",
      left: "right",
      right: "left"
    };
    const arrowSize = "var(--n-arrow-height) * 1.414";
    const style$l = c$1([cB("popover", `
 transition:
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 position: relative;
 font-size: var(--n-font-size);
 color: var(--n-text-color);
 box-shadow: var(--n-box-shadow);
 word-break: break-word;
 `, [c$1(">", [cB("scrollbar", `
 height: inherit;
 max-height: inherit;
 `)]), cNotM("raw", `
 background-color: var(--n-color);
 border-radius: var(--n-border-radius);
 `, [cNotM("scrollable", [cNotM("show-header-or-footer", "padding: var(--n-padding);")])]), cE("header", `
 padding: var(--n-padding);
 border-bottom: 1px solid var(--n-divider-color);
 transition: border-color .3s var(--n-bezier);
 `), cE("footer", `
 padding: var(--n-padding);
 border-top: 1px solid var(--n-divider-color);
 transition: border-color .3s var(--n-bezier);
 `), cM("scrollable, show-header-or-footer", [cE("content", `
 padding: var(--n-padding);
 `)])]), cB("popover-shared", `
 transform-origin: inherit;
 `, [
      cB("popover-arrow-wrapper", `
 position: absolute;
 overflow: hidden;
 pointer-events: none;
 `, [cB("popover-arrow", `
 transition: background-color .3s var(--n-bezier);
 position: absolute;
 display: block;
 width: calc(${arrowSize});
 height: calc(${arrowSize});
 box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
 transform: rotate(45deg);
 background-color: var(--n-color);
 pointer-events: all;
 `)]),
      // body transition
      c$1("&.popover-transition-enter-from, &.popover-transition-leave-to", `
 opacity: 0;
 transform: scale(.85);
 `),
      c$1("&.popover-transition-enter-to, &.popover-transition-leave-from", `
 transform: scale(1);
 opacity: 1;
 `),
      c$1("&.popover-transition-enter-active", `
 transition:
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 opacity .15s var(--n-bezier-ease-out),
 transform .15s var(--n-bezier-ease-out);
 `),
      c$1("&.popover-transition-leave-active", `
 transition:
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 opacity .15s var(--n-bezier-ease-in),
 transform .15s var(--n-bezier-ease-in);
 `)
    ]), placementStyle("top-start", `
 top: calc(${arrowSize} / -2);
 left: calc(${getArrowOffset("top-start")} - var(--v-offset-left));
 `), placementStyle("top", `
 top: calc(${arrowSize} / -2);
 transform: translateX(calc(${arrowSize} / -2)) rotate(45deg);
 left: 50%;
 `), placementStyle("top-end", `
 top: calc(${arrowSize} / -2);
 right: calc(${getArrowOffset("top-end")} + var(--v-offset-left));
 `), placementStyle("bottom-start", `
 bottom: calc(${arrowSize} / -2);
 left: calc(${getArrowOffset("bottom-start")} - var(--v-offset-left));
 `), placementStyle("bottom", `
 bottom: calc(${arrowSize} / -2);
 transform: translateX(calc(${arrowSize} / -2)) rotate(45deg);
 left: 50%;
 `), placementStyle("bottom-end", `
 bottom: calc(${arrowSize} / -2);
 right: calc(${getArrowOffset("bottom-end")} + var(--v-offset-left));
 `), placementStyle("left-start", `
 left: calc(${arrowSize} / -2);
 top: calc(${getArrowOffset("left-start")} - var(--v-offset-top));
 `), placementStyle("left", `
 left: calc(${arrowSize} / -2);
 transform: translateY(calc(${arrowSize} / -2)) rotate(45deg);
 top: 50%;
 `), placementStyle("left-end", `
 left: calc(${arrowSize} / -2);
 bottom: calc(${getArrowOffset("left-end")} + var(--v-offset-top));
 `), placementStyle("right-start", `
 right: calc(${arrowSize} / -2);
 top: calc(${getArrowOffset("right-start")} - var(--v-offset-top));
 `), placementStyle("right", `
 right: calc(${arrowSize} / -2);
 transform: translateY(calc(${arrowSize} / -2)) rotate(45deg);
 top: 50%;
 `), placementStyle("right-end", `
 right: calc(${arrowSize} / -2);
 bottom: calc(${getArrowOffset("right-end")} + var(--v-offset-top));
 `), ...map({
      top: ["right-start", "left-start"],
      right: ["top-end", "bottom-end"],
      bottom: ["right-end", "left-end"],
      left: ["top-start", "bottom-start"]
    }, (placements, direction) => {
      const isVertical = ["right", "left"].includes(direction);
      const sizeType = isVertical ? "width" : "height";
      return placements.map((placement) => {
        const isReverse = placement.split("-")[1] === "end";
        const targetSize = `var(--v-target-${sizeType}, 0px)`;
        const centerOffset = `calc((${targetSize} - ${arrowSize}) / 2)`;
        const offset = getArrowOffset(placement);
        return c$1(`[v-placement="${placement}"] >`, [cB("popover-shared", [cM("center-arrow", [cB("popover-arrow", `${direction}: calc(max(${centerOffset}, ${offset}) ${isReverse ? "+" : "-"} var(--v-offset-${isVertical ? "left" : "top"}));`)])])]);
      });
    })]);
    function getArrowOffset(placement) {
      return ["top", "bottom"].includes(placement.split("-")[0]) ? "var(--n-arrow-offset)" : "var(--n-arrow-offset-vertical)";
    }
    function placementStyle(placement, arrowStyleLiteral) {
      const position = placement.split("-")[0];
      const sizeStyle = ["top", "bottom"].includes(position) ? "height: var(--n-space-arrow);" : "width: var(--n-space-arrow);";
      return c$1(`[v-placement="${placement}"] >`, [cB("popover-shared", `
 margin-${oppositePlacement[position]}: var(--n-space);
 `, [cM("show-arrow", `
 margin-${oppositePlacement[position]}: var(--n-space-arrow);
 `), cM("overlap", `
 margin: 0;
 `), cCB("popover-arrow-wrapper", `
 right: 0;
 left: 0;
 top: 0;
 bottom: 0;
 ${position}: 100%;
 ${oppositePlacement[position]}: auto;
 ${sizeStyle}
 `, [cB("popover-arrow", arrowStyleLiteral)])])]);
    }
    const popoverBodyProps = Object.assign(Object.assign({}, useTheme.props), {
      to: useAdjustedTo.propTo,
      show: Boolean,
      trigger: String,
      showArrow: Boolean,
      delay: Number,
      duration: Number,
      raw: Boolean,
      arrowPointToCenter: Boolean,
      arrowClass: String,
      arrowStyle: [String, Object],
      arrowWrapperClass: String,
      arrowWrapperStyle: [String, Object],
      displayDirective: String,
      x: Number,
      y: Number,
      flip: Boolean,
      overlap: Boolean,
      placement: String,
      width: [Number, String],
      keepAliveOnHover: Boolean,
      scrollable: Boolean,
      contentClass: String,
      contentStyle: [Object, String],
      headerClass: String,
      headerStyle: [Object, String],
      footerClass: String,
      footerStyle: [Object, String],
      // private
      internalDeactivateImmediately: Boolean,
      animated: Boolean,
      onClickoutside: Function,
      internalTrapFocus: Boolean,
      internalOnAfterLeave: Function,
      // deprecated
      minWidth: Number,
      maxWidth: Number
    });
    function renderArrow({
      arrowClass,
      arrowStyle,
      arrowWrapperClass,
      arrowWrapperStyle,
      clsPrefix
    }) {
      return h("div", {
        key: "__popover-arrow__",
        style: arrowWrapperStyle,
        class: [`${clsPrefix}-popover-arrow-wrapper`, arrowWrapperClass]
      }, h("div", {
        class: [`${clsPrefix}-popover-arrow`, arrowClass],
        style: arrowStyle
      }));
    }
    const NPopoverBody = /* @__PURE__ */ defineComponent({
      name: "PopoverBody",
      inheritAttrs: false,
      props: popoverBodyProps,
      setup(props, {
        slots,
        attrs
      }) {
        const {
          namespaceRef,
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Popover", "-popover", style$l, popoverLight, props, mergedClsPrefixRef);
        const followerRef = ref(null);
        const NPopover2 = inject("NPopover");
        const bodyRef = ref(null);
        const followerEnabledRef = ref(props.show);
        const displayedRef = ref(false);
        watchEffect(() => {
          const {
            show
          } = props;
          if (show && !isJsdom() && !props.internalDeactivateImmediately) {
            displayedRef.value = true;
          }
        });
        const directivesRef = computed(() => {
          const {
            trigger: trigger2,
            onClickoutside
          } = props;
          const directives = [];
          const {
            positionManuallyRef: {
              value: positionManually
            }
          } = NPopover2;
          if (!positionManually) {
            if (trigger2 === "click" && !onClickoutside) {
              directives.push([clickoutside, handleClickOutside, void 0, {
                capture: true
              }]);
            }
            if (trigger2 === "hover") {
              directives.push([mousemoveoutside, handleMouseMoveOutside]);
            }
          }
          if (onClickoutside) {
            directives.push([clickoutside, handleClickOutside, void 0, {
              capture: true
            }]);
          }
          if (props.displayDirective === "show" || props.animated && displayedRef.value) {
            directives.push([vShow, props.show]);
          }
          return directives;
        });
        const cssVarsRef = computed(() => {
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2,
              cubicBezierEaseIn: cubicBezierEaseIn2,
              cubicBezierEaseOut: cubicBezierEaseOut2
            },
            self: {
              space,
              spaceArrow,
              padding,
              fontSize: fontSize2,
              textColor,
              dividerColor,
              color,
              boxShadow,
              borderRadius,
              arrowHeight,
              arrowOffset,
              arrowOffsetVertical
            }
          } = themeRef.value;
          return {
            "--n-box-shadow": boxShadow,
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-bezier-ease-in": cubicBezierEaseIn2,
            "--n-bezier-ease-out": cubicBezierEaseOut2,
            "--n-font-size": fontSize2,
            "--n-text-color": textColor,
            "--n-color": color,
            "--n-divider-color": dividerColor,
            "--n-border-radius": borderRadius,
            "--n-arrow-height": arrowHeight,
            "--n-arrow-offset": arrowOffset,
            "--n-arrow-offset-vertical": arrowOffsetVertical,
            "--n-padding": padding,
            "--n-space": space,
            "--n-space-arrow": spaceArrow
          };
        });
        const styleRef = computed(() => {
          const width = props.width === "trigger" ? void 0 : formatLength(props.width);
          const style2 = [];
          if (width) {
            style2.push({
              width
            });
          }
          const {
            maxWidth,
            minWidth
          } = props;
          if (maxWidth) {
            style2.push({
              maxWidth: formatLength(maxWidth)
            });
          }
          if (minWidth) {
            style2.push({
              maxWidth: formatLength(minWidth)
            });
          }
          if (!inlineThemeDisabled) {
            style2.push(cssVarsRef.value);
          }
          return style2;
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("popover", void 0, cssVarsRef, props) : void 0;
        NPopover2.setBodyInstance({
          syncPosition
        });
        onBeforeUnmount(() => {
          NPopover2.setBodyInstance(null);
        });
        watch(toRef(props, "show"), (value) => {
          if (props.animated) return;
          if (value) {
            followerEnabledRef.value = true;
          } else {
            followerEnabledRef.value = false;
          }
        });
        function syncPosition() {
          var _a;
          (_a = followerRef.value) === null || _a === void 0 ? void 0 : _a.syncPosition();
        }
        function handleMouseEnter(e) {
          if (props.trigger === "hover" && props.keepAliveOnHover && props.show) {
            NPopover2.handleMouseEnter(e);
          }
        }
        function handleMouseLeave(e) {
          if (props.trigger === "hover" && props.keepAliveOnHover) {
            NPopover2.handleMouseLeave(e);
          }
        }
        function handleMouseMoveOutside(e) {
          if (props.trigger === "hover" && !getTriggerElement().contains(getPreciseEventTarget(e))) {
            NPopover2.handleMouseMoveOutside(e);
          }
        }
        function handleClickOutside(e) {
          if (props.trigger === "click" && !getTriggerElement().contains(getPreciseEventTarget(e)) || props.onClickoutside) {
            NPopover2.handleClickOutside(e);
          }
        }
        function getTriggerElement() {
          return NPopover2.getTriggerElement();
        }
        provide(popoverBodyInjectionKey, bodyRef);
        provide(drawerBodyInjectionKey, null);
        provide(modalBodyInjectionKey, null);
        function renderContentNode() {
          themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender();
          const shouldRenderDom = props.displayDirective === "show" || props.show || props.animated && displayedRef.value;
          if (!shouldRenderDom) {
            return null;
          }
          let contentNode;
          const renderBody = NPopover2.internalRenderBodyRef.value;
          const {
            value: mergedClsPrefix
          } = mergedClsPrefixRef;
          if (!renderBody) {
            const {
              value: extraClass
            } = NPopover2.extraClassRef;
            const {
              internalTrapFocus
            } = props;
            const hasHeaderOrFooter = !isSlotEmpty(slots.header) || !isSlotEmpty(slots.footer);
            const renderContentInnerNode = () => {
              var _a, _b;
              const body = hasHeaderOrFooter ? h(Fragment, null, resolveWrappedSlot(slots.header, (children) => {
                return children ? h("div", {
                  class: [`${mergedClsPrefix}-popover__header`, props.headerClass],
                  style: props.headerStyle
                }, children) : null;
              }), resolveWrappedSlot(slots.default, (children) => {
                return children ? h("div", {
                  class: [`${mergedClsPrefix}-popover__content`, props.contentClass],
                  style: props.contentStyle
                }, slots) : null;
              }), resolveWrappedSlot(slots.footer, (children) => {
                return children ? h("div", {
                  class: [`${mergedClsPrefix}-popover__footer`, props.footerClass],
                  style: props.footerStyle
                }, children) : null;
              })) : props.scrollable ? (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots) : h("div", {
                class: [`${mergedClsPrefix}-popover__content`, props.contentClass],
                style: props.contentStyle
              }, slots);
              const maybeScrollableBody = props.scrollable ? h(XScrollbar, {
                contentClass: hasHeaderOrFooter ? void 0 : `${mergedClsPrefix}-popover__content ${(_b = props.contentClass) !== null && _b !== void 0 ? _b : ""}`,
                contentStyle: hasHeaderOrFooter ? void 0 : props.contentStyle
              }, {
                default: () => body
              }) : body;
              const arrow = props.showArrow ? renderArrow({
                arrowClass: props.arrowClass,
                arrowStyle: props.arrowStyle,
                arrowWrapperClass: props.arrowWrapperClass,
                arrowWrapperStyle: props.arrowWrapperStyle,
                clsPrefix: mergedClsPrefix
              }) : null;
              return [maybeScrollableBody, arrow];
            };
            contentNode = h("div", mergeProps({
              class: [`${mergedClsPrefix}-popover`, `${mergedClsPrefix}-popover-shared`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, extraClass.map((v) => `${mergedClsPrefix}-${v}`), {
                [`${mergedClsPrefix}-popover--scrollable`]: props.scrollable,
                [`${mergedClsPrefix}-popover--show-header-or-footer`]: hasHeaderOrFooter,
                [`${mergedClsPrefix}-popover--raw`]: props.raw,
                [`${mergedClsPrefix}-popover-shared--overlap`]: props.overlap,
                [`${mergedClsPrefix}-popover-shared--show-arrow`]: props.showArrow,
                [`${mergedClsPrefix}-popover-shared--center-arrow`]: props.arrowPointToCenter
              }],
              ref: bodyRef,
              style: styleRef.value,
              onKeydown: NPopover2.handleKeydown,
              onMouseenter: handleMouseEnter,
              onMouseleave: handleMouseLeave
            }, attrs), internalTrapFocus ? h(FocusTrap, {
              active: props.show,
              autoFocus: true
            }, {
              default: renderContentInnerNode
            }) : renderContentInnerNode());
          } else {
            contentNode = renderBody(
              // The popover class and overlap class must exists, they will be used
              // to place the body & transition animation.
              // Shadow class exists for reuse box-shadow.
              [`${mergedClsPrefix}-popover-shared`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, props.overlap && `${mergedClsPrefix}-popover-shared--overlap`, props.showArrow && `${mergedClsPrefix}-popover-shared--show-arrow`, props.arrowPointToCenter && `${mergedClsPrefix}-popover-shared--center-arrow`],
              bodyRef,
              styleRef.value,
              handleMouseEnter,
              handleMouseLeave
            );
          }
          return withDirectives(contentNode, directivesRef.value);
        }
        return {
          displayed: displayedRef,
          namespace: namespaceRef,
          isMounted: NPopover2.isMountedRef,
          zIndex: NPopover2.zIndexRef,
          followerRef,
          adjustedTo: useAdjustedTo(props),
          followerEnabled: followerEnabledRef,
          renderContentNode
        };
      },
      render() {
        return h(VFollower, {
          ref: "followerRef",
          zIndex: this.zIndex,
          show: this.show,
          enabled: this.followerEnabled,
          to: this.adjustedTo,
          x: this.x,
          y: this.y,
          flip: this.flip,
          placement: this.placement,
          containerClass: this.namespace,
          overlap: this.overlap,
          width: this.width === "trigger" ? "target" : void 0,
          teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey
        }, {
          default: () => {
            return this.animated ? h(Transition, {
              name: "popover-transition",
              appear: this.isMounted,
              // Don't use watch to enable follower, since the transition may
              // make position sync timing very subtle and buggy.
              onEnter: () => {
                this.followerEnabled = true;
              },
              onAfterLeave: () => {
                var _a;
                (_a = this.internalOnAfterLeave) === null || _a === void 0 ? void 0 : _a.call(this);
                this.followerEnabled = false;
                this.displayed = false;
              }
            }, {
              default: this.renderContentNode
            }) : this.renderContentNode();
          }
        });
      }
    });
    const bodyPropKeys = Object.keys(popoverBodyProps);
    const triggerEventMap = {
      focus: ["onFocus", "onBlur"],
      click: ["onClick"],
      hover: ["onMouseenter", "onMouseleave"],
      manual: [],
      nested: ["onFocus", "onBlur", "onMouseenter", "onMouseleave", "onClick"]
    };
    function appendEvents(vNode, trigger2, events2) {
      triggerEventMap[trigger2].forEach((eventName) => {
        if (!vNode.props) {
          vNode.props = {};
        } else {
          vNode.props = Object.assign({}, vNode.props);
        }
        const originalHandler = vNode.props[eventName];
        const handler = events2[eventName];
        if (!originalHandler) {
          vNode.props[eventName] = handler;
        } else {
          vNode.props[eventName] = (...args) => {
            originalHandler(...args);
            handler(...args);
          };
        }
      });
    }
    const popoverBaseProps = {
      show: {
        type: Boolean,
        default: void 0
      },
      defaultShow: Boolean,
      showArrow: {
        type: Boolean,
        default: true
      },
      trigger: {
        type: String,
        default: "hover"
      },
      delay: {
        type: Number,
        default: 100
      },
      duration: {
        type: Number,
        default: 100
      },
      raw: Boolean,
      placement: {
        type: String,
        default: "top"
      },
      x: Number,
      y: Number,
      arrowPointToCenter: Boolean,
      disabled: Boolean,
      getDisabled: Function,
      displayDirective: {
        type: String,
        default: "if"
      },
      arrowClass: String,
      arrowStyle: [String, Object],
      arrowWrapperClass: String,
      arrowWrapperStyle: [String, Object],
      flip: {
        type: Boolean,
        default: true
      },
      animated: {
        type: Boolean,
        default: true
      },
      width: {
        type: [Number, String],
        default: void 0
      },
      overlap: Boolean,
      keepAliveOnHover: {
        type: Boolean,
        default: true
      },
      zIndex: Number,
      to: useAdjustedTo.propTo,
      scrollable: Boolean,
      contentClass: String,
      contentStyle: [Object, String],
      headerClass: String,
      headerStyle: [Object, String],
      footerClass: String,
      footerStyle: [Object, String],
      // events
      onClickoutside: Function,
      "onUpdate:show": [Function, Array],
      onUpdateShow: [Function, Array],
      // internal
      internalDeactivateImmediately: Boolean,
      internalSyncTargetWithParent: Boolean,
      internalInheritedEventHandlers: {
        type: Array,
        default: () => []
      },
      internalTrapFocus: Boolean,
      internalExtraClass: {
        type: Array,
        default: () => []
      },
      // deprecated
      onShow: [Function, Array],
      onHide: [Function, Array],
      arrow: {
        type: Boolean,
        default: void 0
      },
      minWidth: Number,
      maxWidth: Number
    };
    const popoverProps = Object.assign(Object.assign(Object.assign({}, useTheme.props), popoverBaseProps), {
      internalOnAfterLeave: Function,
      internalRenderBody: Function
    });
    const NPopover = /* @__PURE__ */ defineComponent({
      name: "Popover",
      inheritAttrs: false,
      props: popoverProps,
      __popover__: true,
      setup(props) {
        const isMountedRef = isMounted();
        const binderInstRef = ref(null);
        const controlledShowRef = computed(() => props.show);
        const uncontrolledShowRef = ref(props.defaultShow);
        const mergedShowWithoutDisabledRef = useMergedState(controlledShowRef, uncontrolledShowRef);
        const mergedShowConsideringDisabledPropRef = useMemo(() => {
          if (props.disabled) return false;
          return mergedShowWithoutDisabledRef.value;
        });
        const getMergedDisabled = () => {
          if (props.disabled) return true;
          const {
            getDisabled
          } = props;
          if (getDisabled === null || getDisabled === void 0 ? void 0 : getDisabled()) return true;
          return false;
        };
        const getMergedShow = () => {
          if (getMergedDisabled()) return false;
          return mergedShowWithoutDisabledRef.value;
        };
        const compatibleShowArrowRef = useCompitable(props, ["arrow", "showArrow"]);
        const mergedShowArrowRef = computed(() => {
          if (props.overlap) return false;
          return compatibleShowArrowRef.value;
        });
        let bodyInstance = null;
        const showTimerIdRef = ref(null);
        const hideTimerIdRef = ref(null);
        const positionManuallyRef = useMemo(() => {
          return props.x !== void 0 && props.y !== void 0;
        });
        function doUpdateShow(value) {
          const {
            "onUpdate:show": _onUpdateShow,
            onUpdateShow,
            onShow,
            onHide
          } = props;
          uncontrolledShowRef.value = value;
          if (_onUpdateShow) {
            call(_onUpdateShow, value);
          }
          if (onUpdateShow) {
            call(onUpdateShow, value);
          }
          if (value && onShow) {
            call(onShow, true);
          }
          if (value && onHide) {
            call(onHide, false);
          }
        }
        function syncPosition() {
          if (bodyInstance) {
            bodyInstance.syncPosition();
          }
        }
        function clearShowTimer() {
          const {
            value: showTimerId
          } = showTimerIdRef;
          if (showTimerId) {
            window.clearTimeout(showTimerId);
            showTimerIdRef.value = null;
          }
        }
        function clearHideTimer() {
          const {
            value: hideTimerId
          } = hideTimerIdRef;
          if (hideTimerId) {
            window.clearTimeout(hideTimerId);
            hideTimerIdRef.value = null;
          }
        }
        function handleFocus() {
          const mergedDisabled = getMergedDisabled();
          if (props.trigger === "focus" && !mergedDisabled) {
            if (getMergedShow()) return;
            doUpdateShow(true);
          }
        }
        function handleBlur() {
          const mergedDisabled = getMergedDisabled();
          if (props.trigger === "focus" && !mergedDisabled) {
            if (!getMergedShow()) return;
            doUpdateShow(false);
          }
        }
        function handleMouseEnter() {
          const mergedDisabled = getMergedDisabled();
          if (props.trigger === "hover" && !mergedDisabled) {
            clearHideTimer();
            if (showTimerIdRef.value !== null) return;
            if (getMergedShow()) return;
            const delayCallback = () => {
              doUpdateShow(true);
              showTimerIdRef.value = null;
            };
            const {
              delay
            } = props;
            if (delay === 0) {
              delayCallback();
            } else {
              showTimerIdRef.value = window.setTimeout(delayCallback, delay);
            }
          }
        }
        function handleMouseLeave() {
          const mergedDisabled = getMergedDisabled();
          if (props.trigger === "hover" && !mergedDisabled) {
            clearShowTimer();
            if (hideTimerIdRef.value !== null) return;
            if (!getMergedShow()) return;
            const delayedCallback = () => {
              doUpdateShow(false);
              hideTimerIdRef.value = null;
            };
            const {
              duration: duration2
            } = props;
            if (duration2 === 0) {
              delayedCallback();
            } else {
              hideTimerIdRef.value = window.setTimeout(delayedCallback, duration2);
            }
          }
        }
        function handleMouseMoveOutside() {
          handleMouseLeave();
        }
        function handleClickOutside(e) {
          var _a;
          if (!getMergedShow()) return;
          if (props.trigger === "click") {
            clearShowTimer();
            clearHideTimer();
            doUpdateShow(false);
          }
          (_a = props.onClickoutside) === null || _a === void 0 ? void 0 : _a.call(props, e);
        }
        function handleClick2() {
          if (props.trigger === "click" && !getMergedDisabled()) {
            clearShowTimer();
            clearHideTimer();
            const nextShow = !getMergedShow();
            doUpdateShow(nextShow);
          }
        }
        function handleKeydown(e) {
          if (!props.internalTrapFocus) return;
          if (e.key === "Escape") {
            clearShowTimer();
            clearHideTimer();
            doUpdateShow(false);
          }
        }
        function setShow(value) {
          uncontrolledShowRef.value = value;
        }
        function getTriggerElement() {
          var _a;
          return (_a = binderInstRef.value) === null || _a === void 0 ? void 0 : _a.targetRef;
        }
        function setBodyInstance(value) {
          bodyInstance = value;
        }
        provide("NPopover", {
          getTriggerElement,
          handleKeydown,
          handleMouseEnter,
          handleMouseLeave,
          handleClickOutside,
          handleMouseMoveOutside,
          setBodyInstance,
          positionManuallyRef,
          isMountedRef,
          zIndexRef: toRef(props, "zIndex"),
          extraClassRef: toRef(props, "internalExtraClass"),
          internalRenderBodyRef: toRef(props, "internalRenderBody")
        });
        watchEffect(() => {
          if (mergedShowWithoutDisabledRef.value && getMergedDisabled()) {
            doUpdateShow(false);
          }
        });
        const returned = {
          binderInstRef,
          positionManually: positionManuallyRef,
          mergedShowConsideringDisabledProp: mergedShowConsideringDisabledPropRef,
          // if to show popover body
          uncontrolledShow: uncontrolledShowRef,
          mergedShowArrow: mergedShowArrowRef,
          getMergedShow,
          setShow,
          handleClick: handleClick2,
          handleMouseEnter,
          handleMouseLeave,
          handleFocus,
          handleBlur,
          syncPosition
        };
        return returned;
      },
      render() {
        var _a;
        const {
          positionManually,
          $slots: slots
        } = this;
        let triggerVNode;
        let popoverInside = false;
        if (!positionManually) {
          if (slots.activator) {
            triggerVNode = getFirstSlotVNode(slots, "activator");
          } else {
            triggerVNode = getFirstSlotVNode(slots, "trigger");
          }
          if (triggerVNode) {
            triggerVNode = cloneVNode(triggerVNode);
            triggerVNode = triggerVNode.type === Text ? h("span", [triggerVNode]) : triggerVNode;
            const handlers = {
              onClick: this.handleClick,
              onMouseenter: this.handleMouseEnter,
              onMouseleave: this.handleMouseLeave,
              onFocus: this.handleFocus,
              onBlur: this.handleBlur
            };
            if ((_a = triggerVNode.type) === null || _a === void 0 ? void 0 : _a.__popover__) {
              popoverInside = true;
              if (!triggerVNode.props) {
                triggerVNode.props = {
                  internalSyncTargetWithParent: true,
                  internalInheritedEventHandlers: []
                };
              }
              triggerVNode.props.internalSyncTargetWithParent = true;
              if (!triggerVNode.props.internalInheritedEventHandlers) {
                triggerVNode.props.internalInheritedEventHandlers = [handlers];
              } else {
                triggerVNode.props.internalInheritedEventHandlers = [handlers, ...triggerVNode.props.internalInheritedEventHandlers];
              }
            } else {
              const {
                internalInheritedEventHandlers
              } = this;
              const ascendantAndCurrentHandlers = [handlers, ...internalInheritedEventHandlers];
              const mergedHandlers = {
                onBlur: (e) => {
                  ascendantAndCurrentHandlers.forEach((_handlers) => {
                    _handlers.onBlur(e);
                  });
                },
                onFocus: (e) => {
                  ascendantAndCurrentHandlers.forEach((_handlers) => {
                    _handlers.onFocus(e);
                  });
                },
                onClick: (e) => {
                  ascendantAndCurrentHandlers.forEach((_handlers) => {
                    _handlers.onClick(e);
                  });
                },
                onMouseenter: (e) => {
                  ascendantAndCurrentHandlers.forEach((_handlers) => {
                    _handlers.onMouseenter(e);
                  });
                },
                onMouseleave: (e) => {
                  ascendantAndCurrentHandlers.forEach((_handlers) => {
                    _handlers.onMouseleave(e);
                  });
                }
              };
              appendEvents(triggerVNode, internalInheritedEventHandlers ? "nested" : positionManually ? "manual" : this.trigger, mergedHandlers);
            }
          }
        }
        return h(Binder, {
          ref: "binderInstRef",
          syncTarget: !popoverInside,
          syncTargetWithParent: this.internalSyncTargetWithParent
        }, {
          default: () => {
            void this.mergedShowConsideringDisabledProp;
            const mergedShow = this.getMergedShow();
            return [this.internalTrapFocus && mergedShow ? withDirectives(h("div", {
              style: {
                position: "fixed",
                inset: 0
              }
            }), [[zindexable, {
              enabled: mergedShow,
              zIndex: this.zIndex
            }]]) : null, positionManually ? null : h(VTarget, null, {
              default: () => triggerVNode
            }), h(NPopoverBody, keep(this.$props, bodyPropKeys, Object.assign(Object.assign({}, this.$attrs), {
              showArrow: this.mergedShowArrow,
              show: mergedShow
            })), {
              default: () => {
                var _a2, _b;
                return (_b = (_a2 = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a2);
              },
              header: () => {
                var _a2, _b;
                return (_b = (_a2 = this.$slots).header) === null || _b === void 0 ? void 0 : _b.call(_a2);
              },
              footer: () => {
                var _a2, _b;
                return (_b = (_a2 = this.$slots).footer) === null || _b === void 0 ? void 0 : _b.call(_a2);
              }
            })];
          }
        });
      }
    });
    const commonVariables$j = {
      closeIconSizeTiny: "12px",
      closeIconSizeSmall: "12px",
      closeIconSizeMedium: "14px",
      closeIconSizeLarge: "14px",
      closeSizeTiny: "16px",
      closeSizeSmall: "16px",
      closeSizeMedium: "18px",
      closeSizeLarge: "18px",
      padding: "0 7px",
      closeMargin: "0 0 0 4px"
    };
    const tagDark = {
      name: "Tag",
      common: derived$1,
      self(vars) {
        const {
          textColor2,
          primaryColorHover,
          primaryColorPressed,
          primaryColor,
          infoColor,
          successColor,
          warningColor,
          errorColor,
          baseColor,
          borderColor,
          tagColor,
          opacityDisabled,
          closeIconColor,
          closeIconColorHover,
          closeIconColorPressed,
          closeColorHover,
          closeColorPressed,
          borderRadiusSmall: borderRadius,
          fontSizeMini,
          fontSizeTiny,
          fontSizeSmall,
          fontSizeMedium,
          heightMini,
          heightTiny,
          heightSmall,
          heightMedium,
          buttonColor2Hover,
          buttonColor2Pressed,
          fontWeightStrong
        } = vars;
        return Object.assign(Object.assign({}, commonVariables$j), {
          closeBorderRadius: borderRadius,
          heightTiny: heightMini,
          heightSmall: heightTiny,
          heightMedium: heightSmall,
          heightLarge: heightMedium,
          borderRadius,
          opacityDisabled,
          fontSizeTiny: fontSizeMini,
          fontSizeSmall: fontSizeTiny,
          fontSizeMedium: fontSizeSmall,
          fontSizeLarge: fontSizeMedium,
          fontWeightStrong,
          // checked
          textColorCheckable: textColor2,
          textColorHoverCheckable: textColor2,
          textColorPressedCheckable: textColor2,
          textColorChecked: baseColor,
          colorCheckable: "#0000",
          colorHoverCheckable: buttonColor2Hover,
          colorPressedCheckable: buttonColor2Pressed,
          colorChecked: primaryColor,
          colorCheckedHover: primaryColorHover,
          colorCheckedPressed: primaryColorPressed,
          // default
          border: `1px solid ${borderColor}`,
          textColor: textColor2,
          color: tagColor,
          colorBordered: "#0000",
          closeIconColor,
          closeIconColorHover,
          closeIconColorPressed,
          closeColorHover,
          closeColorPressed,
          borderPrimary: `1px solid ${changeColor(primaryColor, {
            alpha: 0.3
          })}`,
          textColorPrimary: primaryColor,
          colorPrimary: changeColor(primaryColor, {
            alpha: 0.16
          }),
          colorBorderedPrimary: "#0000",
          closeIconColorPrimary: scaleColor(primaryColor, {
            lightness: 0.7
          }),
          closeIconColorHoverPrimary: scaleColor(primaryColor, {
            lightness: 0.7
          }),
          closeIconColorPressedPrimary: scaleColor(primaryColor, {
            lightness: 0.7
          }),
          closeColorHoverPrimary: changeColor(primaryColor, {
            alpha: 0.16
          }),
          closeColorPressedPrimary: changeColor(primaryColor, {
            alpha: 0.12
          }),
          borderInfo: `1px solid ${changeColor(infoColor, {
            alpha: 0.3
          })}`,
          textColorInfo: infoColor,
          colorInfo: changeColor(infoColor, {
            alpha: 0.16
          }),
          colorBorderedInfo: "#0000",
          closeIconColorInfo: scaleColor(infoColor, {
            alpha: 0.7
          }),
          closeIconColorHoverInfo: scaleColor(infoColor, {
            alpha: 0.7
          }),
          closeIconColorPressedInfo: scaleColor(infoColor, {
            alpha: 0.7
          }),
          closeColorHoverInfo: changeColor(infoColor, {
            alpha: 0.16
          }),
          closeColorPressedInfo: changeColor(infoColor, {
            alpha: 0.12
          }),
          borderSuccess: `1px solid ${changeColor(successColor, {
            alpha: 0.3
          })}`,
          textColorSuccess: successColor,
          colorSuccess: changeColor(successColor, {
            alpha: 0.16
          }),
          colorBorderedSuccess: "#0000",
          closeIconColorSuccess: scaleColor(successColor, {
            alpha: 0.7
          }),
          closeIconColorHoverSuccess: scaleColor(successColor, {
            alpha: 0.7
          }),
          closeIconColorPressedSuccess: scaleColor(successColor, {
            alpha: 0.7
          }),
          closeColorHoverSuccess: changeColor(successColor, {
            alpha: 0.16
          }),
          closeColorPressedSuccess: changeColor(successColor, {
            alpha: 0.12
          }),
          borderWarning: `1px solid ${changeColor(warningColor, {
            alpha: 0.3
          })}`,
          textColorWarning: warningColor,
          colorWarning: changeColor(warningColor, {
            alpha: 0.16
          }),
          colorBorderedWarning: "#0000",
          closeIconColorWarning: scaleColor(warningColor, {
            alpha: 0.7
          }),
          closeIconColorHoverWarning: scaleColor(warningColor, {
            alpha: 0.7
          }),
          closeIconColorPressedWarning: scaleColor(warningColor, {
            alpha: 0.7
          }),
          closeColorHoverWarning: changeColor(warningColor, {
            alpha: 0.16
          }),
          closeColorPressedWarning: changeColor(warningColor, {
            alpha: 0.11
          }),
          borderError: `1px solid ${changeColor(errorColor, {
            alpha: 0.3
          })}`,
          textColorError: errorColor,
          colorError: changeColor(errorColor, {
            alpha: 0.16
          }),
          colorBorderedError: "#0000",
          closeIconColorError: scaleColor(errorColor, {
            alpha: 0.7
          }),
          closeIconColorHoverError: scaleColor(errorColor, {
            alpha: 0.7
          }),
          closeIconColorPressedError: scaleColor(errorColor, {
            alpha: 0.7
          }),
          closeColorHoverError: changeColor(errorColor, {
            alpha: 0.16
          }),
          closeColorPressedError: changeColor(errorColor, {
            alpha: 0.12
          })
        });
      }
    };
    function self$U(vars) {
      const {
        textColor2,
        primaryColorHover,
        primaryColorPressed,
        primaryColor,
        infoColor,
        successColor,
        warningColor,
        errorColor,
        baseColor,
        borderColor,
        opacityDisabled,
        tagColor,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        borderRadiusSmall: borderRadius,
        fontSizeMini,
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        heightMini,
        heightTiny,
        heightSmall,
        heightMedium,
        closeColorHover,
        closeColorPressed,
        buttonColor2Hover,
        buttonColor2Pressed,
        fontWeightStrong
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$j), {
        closeBorderRadius: borderRadius,
        heightTiny: heightMini,
        heightSmall: heightTiny,
        heightMedium: heightSmall,
        heightLarge: heightMedium,
        borderRadius,
        opacityDisabled,
        fontSizeTiny: fontSizeMini,
        fontSizeSmall: fontSizeTiny,
        fontSizeMedium: fontSizeSmall,
        fontSizeLarge: fontSizeMedium,
        fontWeightStrong,
        // checked
        textColorCheckable: textColor2,
        textColorHoverCheckable: textColor2,
        textColorPressedCheckable: textColor2,
        textColorChecked: baseColor,
        colorCheckable: "#0000",
        colorHoverCheckable: buttonColor2Hover,
        colorPressedCheckable: buttonColor2Pressed,
        colorChecked: primaryColor,
        colorCheckedHover: primaryColorHover,
        colorCheckedPressed: primaryColorPressed,
        // default
        border: `1px solid ${borderColor}`,
        textColor: textColor2,
        color: tagColor,
        colorBordered: "rgb(250, 250, 252)",
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeColorHover,
        closeColorPressed,
        borderPrimary: `1px solid ${changeColor(primaryColor, {
          alpha: 0.3
        })}`,
        textColorPrimary: primaryColor,
        colorPrimary: changeColor(primaryColor, {
          alpha: 0.12
        }),
        colorBorderedPrimary: changeColor(primaryColor, {
          alpha: 0.1
        }),
        closeIconColorPrimary: primaryColor,
        closeIconColorHoverPrimary: primaryColor,
        closeIconColorPressedPrimary: primaryColor,
        closeColorHoverPrimary: changeColor(primaryColor, {
          alpha: 0.12
        }),
        closeColorPressedPrimary: changeColor(primaryColor, {
          alpha: 0.18
        }),
        borderInfo: `1px solid ${changeColor(infoColor, {
          alpha: 0.3
        })}`,
        textColorInfo: infoColor,
        colorInfo: changeColor(infoColor, {
          alpha: 0.12
        }),
        colorBorderedInfo: changeColor(infoColor, {
          alpha: 0.1
        }),
        closeIconColorInfo: infoColor,
        closeIconColorHoverInfo: infoColor,
        closeIconColorPressedInfo: infoColor,
        closeColorHoverInfo: changeColor(infoColor, {
          alpha: 0.12
        }),
        closeColorPressedInfo: changeColor(infoColor, {
          alpha: 0.18
        }),
        borderSuccess: `1px solid ${changeColor(successColor, {
          alpha: 0.3
        })}`,
        textColorSuccess: successColor,
        colorSuccess: changeColor(successColor, {
          alpha: 0.12
        }),
        colorBorderedSuccess: changeColor(successColor, {
          alpha: 0.1
        }),
        closeIconColorSuccess: successColor,
        closeIconColorHoverSuccess: successColor,
        closeIconColorPressedSuccess: successColor,
        closeColorHoverSuccess: changeColor(successColor, {
          alpha: 0.12
        }),
        closeColorPressedSuccess: changeColor(successColor, {
          alpha: 0.18
        }),
        borderWarning: `1px solid ${changeColor(warningColor, {
          alpha: 0.35
        })}`,
        textColorWarning: warningColor,
        colorWarning: changeColor(warningColor, {
          alpha: 0.15
        }),
        colorBorderedWarning: changeColor(warningColor, {
          alpha: 0.12
        }),
        closeIconColorWarning: warningColor,
        closeIconColorHoverWarning: warningColor,
        closeIconColorPressedWarning: warningColor,
        closeColorHoverWarning: changeColor(warningColor, {
          alpha: 0.12
        }),
        closeColorPressedWarning: changeColor(warningColor, {
          alpha: 0.18
        }),
        borderError: `1px solid ${changeColor(errorColor, {
          alpha: 0.23
        })}`,
        textColorError: errorColor,
        colorError: changeColor(errorColor, {
          alpha: 0.1
        }),
        colorBorderedError: changeColor(errorColor, {
          alpha: 0.08
        }),
        closeIconColorError: errorColor,
        closeIconColorHoverError: errorColor,
        closeIconColorPressedError: errorColor,
        closeColorHoverError: changeColor(errorColor, {
          alpha: 0.12
        }),
        closeColorPressedError: changeColor(errorColor, {
          alpha: 0.18
        })
      });
    }
    const tagLight = {
      name: "Tag",
      common: derived,
      self: self$U
    };
    const commonProps = {
      color: Object,
      type: {
        type: String,
        default: "default"
      },
      round: Boolean,
      size: {
        type: String,
        default: "medium"
      },
      closable: Boolean,
      disabled: {
        type: Boolean,
        default: void 0
      }
    };
    const style$k = cB("tag", `
 --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
 white-space: nowrap;
 position: relative;
 box-sizing: border-box;
 cursor: default;
 display: inline-flex;
 align-items: center;
 flex-wrap: nowrap;
 padding: var(--n-padding);
 border-radius: var(--n-border-radius);
 color: var(--n-text-color);
 background-color: var(--n-color);
 transition: 
 border-color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier),
 opacity .3s var(--n-bezier);
 line-height: 1;
 height: var(--n-height);
 font-size: var(--n-font-size);
`, [cM("strong", `
 font-weight: var(--n-font-weight-strong);
 `), cE("border", `
 pointer-events: none;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 border-radius: inherit;
 border: var(--n-border);
 transition: border-color .3s var(--n-bezier);
 `), cE("icon", `
 display: flex;
 margin: 0 4px 0 0;
 color: var(--n-text-color);
 transition: color .3s var(--n-bezier);
 font-size: var(--n-avatar-size-override);
 `), cE("avatar", `
 display: flex;
 margin: 0 6px 0 0;
 `), cE("close", `
 margin: var(--n-close-margin);
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `), cM("round", `
 padding: 0 calc(var(--n-height) / 3);
 border-radius: calc(var(--n-height) / 2);
 `, [cE("icon", `
 margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
 `), cE("avatar", `
 margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
 `), cM("closable", `
 padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
 `)]), cM("icon, avatar", [cM("round", `
 padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
 `)]), cM("disabled", `
 cursor: not-allowed !important;
 opacity: var(--n-opacity-disabled);
 `), cM("checkable", `
 cursor: pointer;
 box-shadow: none;
 color: var(--n-text-color-checkable);
 background-color: var(--n-color-checkable);
 `, [cNotM("disabled", [c$1("&:hover", "background-color: var(--n-color-hover-checkable);", [cNotM("checked", "color: var(--n-text-color-hover-checkable);")]), c$1("&:active", "background-color: var(--n-color-pressed-checkable);", [cNotM("checked", "color: var(--n-text-color-pressed-checkable);")])]), cM("checked", `
 color: var(--n-text-color-checked);
 background-color: var(--n-color-checked);
 `, [cNotM("disabled", [c$1("&:hover", "background-color: var(--n-color-checked-hover);"), c$1("&:active", "background-color: var(--n-color-checked-pressed);")])])])]);
    const tagProps = Object.assign(Object.assign(Object.assign({}, useTheme.props), commonProps), {
      bordered: {
        type: Boolean,
        default: void 0
      },
      checked: Boolean,
      checkable: Boolean,
      strong: Boolean,
      triggerClickOnClose: Boolean,
      onClose: [Array, Function],
      onMouseenter: Function,
      onMouseleave: Function,
      "onUpdate:checked": Function,
      onUpdateChecked: Function,
      // private
      internalCloseFocusable: {
        type: Boolean,
        default: true
      },
      internalCloseIsButtonTag: {
        type: Boolean,
        default: true
      },
      // deprecated
      onCheckedChange: Function
    });
    const tagInjectionKey = createInjectionKey("n-tag");
    const NTag = /* @__PURE__ */ defineComponent({
      name: "Tag",
      props: tagProps,
      setup(props) {
        const contentRef = ref(null);
        const {
          mergedBorderedRef,
          mergedClsPrefixRef,
          inlineThemeDisabled,
          mergedRtlRef
        } = useConfig(props);
        const themeRef = useTheme("Tag", "-tag", style$k, tagLight, props, mergedClsPrefixRef);
        provide(tagInjectionKey, {
          roundRef: toRef(props, "round")
        });
        function handleClick2() {
          if (!props.disabled) {
            if (props.checkable) {
              const {
                checked,
                onCheckedChange,
                onUpdateChecked,
                "onUpdate:checked": _onUpdateChecked
              } = props;
              if (onUpdateChecked) onUpdateChecked(!checked);
              if (_onUpdateChecked) _onUpdateChecked(!checked);
              if (onCheckedChange) onCheckedChange(!checked);
            }
          }
        }
        function handleCloseClick(e) {
          if (!props.triggerClickOnClose) {
            e.stopPropagation();
          }
          if (!props.disabled) {
            const {
              onClose
            } = props;
            if (onClose) call(onClose, e);
          }
        }
        const tagPublicMethods = {
          setTextContent(textContent) {
            const {
              value
            } = contentRef;
            if (value) value.textContent = textContent;
          }
        };
        const rtlEnabledRef = useRtl("Tag", mergedRtlRef, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            type,
            size: size2,
            color: {
              color,
              textColor
            } = {}
          } = props;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              padding,
              closeMargin,
              borderRadius,
              opacityDisabled,
              textColorCheckable,
              textColorHoverCheckable,
              textColorPressedCheckable,
              textColorChecked,
              colorCheckable,
              colorHoverCheckable,
              colorPressedCheckable,
              colorChecked,
              colorCheckedHover,
              colorCheckedPressed,
              closeBorderRadius,
              fontWeightStrong,
              [createKey("colorBordered", type)]: colorBordered,
              [createKey("closeSize", size2)]: closeSize,
              [createKey("closeIconSize", size2)]: closeIconSize,
              [createKey("fontSize", size2)]: fontSize2,
              [createKey("height", size2)]: height,
              [createKey("color", type)]: typedColor,
              [createKey("textColor", type)]: typeTextColor,
              [createKey("border", type)]: border,
              [createKey("closeIconColor", type)]: closeIconColor,
              [createKey("closeIconColorHover", type)]: closeIconColorHover,
              [createKey("closeIconColorPressed", type)]: closeIconColorPressed,
              [createKey("closeColorHover", type)]: closeColorHover,
              [createKey("closeColorPressed", type)]: closeColorPressed
            }
          } = themeRef.value;
          const closeMarginDiscrete = getMargin(closeMargin);
          return {
            "--n-font-weight-strong": fontWeightStrong,
            "--n-avatar-size-override": `calc(${height} - 8px)`,
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-border-radius": borderRadius,
            "--n-border": border,
            "--n-close-icon-size": closeIconSize,
            "--n-close-color-pressed": closeColorPressed,
            "--n-close-color-hover": closeColorHover,
            "--n-close-border-radius": closeBorderRadius,
            "--n-close-icon-color": closeIconColor,
            "--n-close-icon-color-hover": closeIconColorHover,
            "--n-close-icon-color-pressed": closeIconColorPressed,
            "--n-close-icon-color-disabled": closeIconColor,
            "--n-close-margin-top": closeMarginDiscrete.top,
            "--n-close-margin-right": closeMarginDiscrete.right,
            "--n-close-margin-bottom": closeMarginDiscrete.bottom,
            "--n-close-margin-left": closeMarginDiscrete.left,
            "--n-close-size": closeSize,
            "--n-color": color || (mergedBorderedRef.value ? colorBordered : typedColor),
            "--n-color-checkable": colorCheckable,
            "--n-color-checked": colorChecked,
            "--n-color-checked-hover": colorCheckedHover,
            "--n-color-checked-pressed": colorCheckedPressed,
            "--n-color-hover-checkable": colorHoverCheckable,
            "--n-color-pressed-checkable": colorPressedCheckable,
            "--n-font-size": fontSize2,
            "--n-height": height,
            "--n-opacity-disabled": opacityDisabled,
            "--n-padding": padding,
            "--n-text-color": textColor || typeTextColor,
            "--n-text-color-checkable": textColorCheckable,
            "--n-text-color-checked": textColorChecked,
            "--n-text-color-hover-checkable": textColorHoverCheckable,
            "--n-text-color-pressed-checkable": textColorPressedCheckable
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("tag", computed(() => {
          let hash = "";
          const {
            type,
            size: size2,
            color: {
              color,
              textColor
            } = {}
          } = props;
          hash += type[0];
          hash += size2[0];
          if (color) {
            hash += `a${color2Class(color)}`;
          }
          if (textColor) {
            hash += `b${color2Class(textColor)}`;
          }
          if (mergedBorderedRef.value) {
            hash += "c";
          }
          return hash;
        }), cssVarsRef, props) : void 0;
        return Object.assign(Object.assign({}, tagPublicMethods), {
          rtlEnabled: rtlEnabledRef,
          mergedClsPrefix: mergedClsPrefixRef,
          contentRef,
          mergedBordered: mergedBorderedRef,
          handleClick: handleClick2,
          handleCloseClick,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        });
      },
      render() {
        var _a, _b;
        const {
          mergedClsPrefix,
          rtlEnabled,
          closable,
          color: {
            borderColor
          } = {},
          round,
          onRender,
          $slots
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        const avatarNode = resolveWrappedSlot($slots.avatar, (children) => children && h("div", {
          class: `${mergedClsPrefix}-tag__avatar`
        }, children));
        const iconNode = resolveWrappedSlot($slots.icon, (children) => children && h("div", {
          class: `${mergedClsPrefix}-tag__icon`
        }, children));
        return h("div", {
          class: [`${mergedClsPrefix}-tag`, this.themeClass, {
            [`${mergedClsPrefix}-tag--rtl`]: rtlEnabled,
            [`${mergedClsPrefix}-tag--strong`]: this.strong,
            [`${mergedClsPrefix}-tag--disabled`]: this.disabled,
            [`${mergedClsPrefix}-tag--checkable`]: this.checkable,
            [`${mergedClsPrefix}-tag--checked`]: this.checkable && this.checked,
            [`${mergedClsPrefix}-tag--round`]: round,
            [`${mergedClsPrefix}-tag--avatar`]: avatarNode,
            [`${mergedClsPrefix}-tag--icon`]: iconNode,
            [`${mergedClsPrefix}-tag--closable`]: closable
          }],
          style: this.cssVars,
          onClick: this.handleClick,
          onMouseenter: this.onMouseenter,
          onMouseleave: this.onMouseleave
        }, iconNode || avatarNode, h("span", {
          class: `${mergedClsPrefix}-tag__content`,
          ref: "contentRef"
        }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a)), !this.checkable && closable ? h(NBaseClose, {
          clsPrefix: mergedClsPrefix,
          class: `${mergedClsPrefix}-tag__close`,
          disabled: this.disabled,
          onClick: this.handleCloseClick,
          focusable: this.internalCloseFocusable,
          round,
          isButtonTag: this.internalCloseIsButtonTag,
          absolute: true
        }) : null, !this.checkable && this.mergedBordered ? h("div", {
          class: `${mergedClsPrefix}-tag__border`,
          style: {
            borderColor
          }
        }) : null);
      }
    });
    const style$j = cB("base-clear", `
 flex-shrink: 0;
 height: 1em;
 width: 1em;
 position: relative;
`, [c$1(">", [cE("clear", `
 font-size: var(--n-clear-size);
 height: 1em;
 width: 1em;
 cursor: pointer;
 color: var(--n-clear-color);
 transition: color .3s var(--n-bezier);
 display: flex;
 `, [c$1("&:hover", `
 color: var(--n-clear-color-hover)!important;
 `), c$1("&:active", `
 color: var(--n-clear-color-pressed)!important;
 `)]), cE("placeholder", `
 display: flex;
 `), cE("clear, placeholder", `
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translateX(-50%) translateY(-50%);
 `, [iconSwitchTransition({
      originalTransform: "translateX(-50%) translateY(-50%)",
      left: "50%",
      top: "50%"
    })])])]);
    const NBaseClear = /* @__PURE__ */ defineComponent({
      name: "BaseClear",
      props: {
        clsPrefix: {
          type: String,
          required: true
        },
        show: Boolean,
        onClear: Function
      },
      setup(props) {
        useStyle("-base-clear", style$j, toRef(props, "clsPrefix"));
        return {
          handleMouseDown(e) {
            e.preventDefault();
          }
        };
      },
      render() {
        const {
          clsPrefix
        } = this;
        return h("div", {
          class: `${clsPrefix}-base-clear`
        }, h(NIconSwitchTransition, null, {
          default: () => {
            var _a, _b;
            return this.show ? h("div", {
              key: "dismiss",
              class: `${clsPrefix}-base-clear__clear`,
              onClick: this.onClear,
              onMousedown: this.handleMouseDown,
              "data-clear": true
            }, resolveSlot(this.$slots.icon, () => [h(NBaseIcon, {
              clsPrefix
            }, {
              default: () => h(ClearIcon, null)
            })])) : h("div", {
              key: "icon",
              class: `${clsPrefix}-base-clear__placeholder`
            }, (_b = (_a = this.$slots).placeholder) === null || _b === void 0 ? void 0 : _b.call(_a));
          }
        }));
      }
    });
    const NBaseSuffix = /* @__PURE__ */ defineComponent({
      name: "InternalSelectionSuffix",
      props: {
        clsPrefix: {
          type: String,
          required: true
        },
        showArrow: {
          type: Boolean,
          default: void 0
        },
        showClear: {
          type: Boolean,
          default: void 0
        },
        loading: {
          type: Boolean,
          default: false
        },
        onClear: Function
      },
      setup(props, {
        slots
      }) {
        return () => {
          const {
            clsPrefix
          } = props;
          return h(NBaseLoading, {
            clsPrefix,
            class: `${clsPrefix}-base-suffix`,
            strokeWidth: 24,
            scale: 0.85,
            show: props.loading
          }, {
            default: () => props.showArrow ? h(NBaseClear, {
              clsPrefix,
              show: props.showClear,
              onClear: props.onClear
            }, {
              placeholder: () => h(NBaseIcon, {
                clsPrefix,
                class: `${clsPrefix}-base-suffix__arrow`
              }, {
                default: () => resolveSlot(slots.default, () => [h(ChevronDownIcon, null)])
              })
            }) : null
          });
        };
      }
    });
    const commonVars$c = {
      paddingSingle: "0 26px 0 12px",
      paddingMultiple: "3px 26px 0 12px",
      clearSize: "16px",
      arrowSize: "16px"
    };
    function self$T(vars) {
      const {
        borderRadius,
        textColor2,
        textColorDisabled,
        inputColor,
        inputColorDisabled,
        primaryColor,
        primaryColorHover,
        warningColor,
        warningColorHover,
        errorColor,
        errorColorHover,
        borderColor,
        iconColor,
        iconColorDisabled,
        clearColor,
        clearColorHover,
        clearColorPressed,
        placeholderColor,
        placeholderColorDisabled,
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge
      } = vars;
      return Object.assign(Object.assign({}, commonVars$c), {
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        borderRadius,
        // default
        textColor: textColor2,
        textColorDisabled,
        placeholderColor,
        placeholderColorDisabled,
        color: inputColor,
        colorDisabled: inputColorDisabled,
        colorActive: inputColor,
        border: `1px solid ${borderColor}`,
        borderHover: `1px solid ${primaryColorHover}`,
        borderActive: `1px solid ${primaryColor}`,
        borderFocus: `1px solid ${primaryColorHover}`,
        boxShadowHover: "none",
        boxShadowActive: `0 0 0 2px ${changeColor(primaryColor, {
          alpha: 0.2
        })}`,
        boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, {
          alpha: 0.2
        })}`,
        caretColor: primaryColor,
        arrowColor: iconColor,
        arrowColorDisabled: iconColorDisabled,
        loadingColor: primaryColor,
        // warning
        borderWarning: `1px solid ${warningColor}`,
        borderHoverWarning: `1px solid ${warningColorHover}`,
        borderActiveWarning: `1px solid ${warningColor}`,
        borderFocusWarning: `1px solid ${warningColorHover}`,
        boxShadowHoverWarning: "none",
        boxShadowActiveWarning: `0 0 0 2px ${changeColor(warningColor, {
          alpha: 0.2
        })}`,
        boxShadowFocusWarning: `0 0 0 2px ${changeColor(warningColor, {
          alpha: 0.2
        })}`,
        colorActiveWarning: inputColor,
        caretColorWarning: warningColor,
        // error
        borderError: `1px solid ${errorColor}`,
        borderHoverError: `1px solid ${errorColorHover}`,
        borderActiveError: `1px solid ${errorColor}`,
        borderFocusError: `1px solid ${errorColorHover}`,
        boxShadowHoverError: "none",
        boxShadowActiveError: `0 0 0 2px ${changeColor(errorColor, {
          alpha: 0.2
        })}`,
        boxShadowFocusError: `0 0 0 2px ${changeColor(errorColor, {
          alpha: 0.2
        })}`,
        colorActiveError: inputColor,
        caretColorError: errorColor,
        clearColor,
        clearColorHover,
        clearColorPressed
      });
    }
    const internalSelectionLight = createTheme({
      name: "InternalSelection",
      common: derived,
      peers: {
        Popover: popoverLight
      },
      self: self$T
    });
    const internalSelectionDark = {
      name: "InternalSelection",
      common: derived$1,
      peers: {
        Popover: popoverDark
      },
      self(vars) {
        const {
          borderRadius,
          textColor2,
          textColorDisabled,
          inputColor,
          inputColorDisabled,
          primaryColor,
          primaryColorHover,
          warningColor,
          warningColorHover,
          errorColor,
          errorColorHover,
          iconColor,
          iconColorDisabled,
          clearColor,
          clearColorHover,
          clearColorPressed,
          placeholderColor,
          placeholderColorDisabled,
          fontSizeTiny,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          heightTiny,
          heightSmall,
          heightMedium,
          heightLarge
        } = vars;
        return Object.assign(Object.assign({}, commonVars$c), {
          fontSizeTiny,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          heightTiny,
          heightSmall,
          heightMedium,
          heightLarge,
          borderRadius,
          // default
          textColor: textColor2,
          textColorDisabled,
          placeholderColor,
          placeholderColorDisabled,
          color: inputColor,
          colorDisabled: inputColorDisabled,
          colorActive: changeColor(primaryColor, {
            alpha: 0.1
          }),
          border: "1px solid #0000",
          borderHover: `1px solid ${primaryColorHover}`,
          borderActive: `1px solid ${primaryColor}`,
          borderFocus: `1px solid ${primaryColorHover}`,
          boxShadowHover: "none",
          boxShadowActive: `0 0 8px 0 ${changeColor(primaryColor, {
            alpha: 0.4
          })}`,
          boxShadowFocus: `0 0 8px 0 ${changeColor(primaryColor, {
            alpha: 0.4
          })}`,
          caretColor: primaryColor,
          arrowColor: iconColor,
          arrowColorDisabled: iconColorDisabled,
          loadingColor: primaryColor,
          // warning
          borderWarning: `1px solid ${warningColor}`,
          borderHoverWarning: `1px solid ${warningColorHover}`,
          borderActiveWarning: `1px solid ${warningColor}`,
          borderFocusWarning: `1px solid ${warningColorHover}`,
          boxShadowHoverWarning: "none",
          boxShadowActiveWarning: `0 0 8px 0 ${changeColor(warningColor, {
            alpha: 0.4
          })}`,
          boxShadowFocusWarning: `0 0 8px 0 ${changeColor(warningColor, {
            alpha: 0.4
          })}`,
          colorActiveWarning: changeColor(warningColor, {
            alpha: 0.1
          }),
          caretColorWarning: warningColor,
          // error
          borderError: `1px solid ${errorColor}`,
          borderHoverError: `1px solid ${errorColorHover}`,
          borderActiveError: `1px solid ${errorColor}`,
          borderFocusError: `1px solid ${errorColorHover}`,
          boxShadowHoverError: "none",
          boxShadowActiveError: `0 0 8px 0 ${changeColor(errorColor, {
            alpha: 0.4
          })}`,
          boxShadowFocusError: `0 0 8px 0 ${changeColor(errorColor, {
            alpha: 0.4
          })}`,
          colorActiveError: changeColor(errorColor, {
            alpha: 0.1
          }),
          caretColorError: errorColor,
          clearColor,
          clearColorHover,
          clearColorPressed
        });
      }
    };
    const style$i = c$1([cB("base-selection", `
 --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
 --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
 position: relative;
 z-index: auto;
 box-shadow: none;
 width: 100%;
 max-width: 100%;
 display: inline-block;
 vertical-align: bottom;
 border-radius: var(--n-border-radius);
 min-height: var(--n-height);
 line-height: 1.5;
 font-size: var(--n-font-size);
 `, [cB("base-loading", `
 color: var(--n-loading-color);
 `), cB("base-selection-tags", "min-height: var(--n-height);"), cE("border, state-border", `
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 pointer-events: none;
 border: var(--n-border);
 border-radius: inherit;
 transition:
 box-shadow .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `), cE("state-border", `
 z-index: 1;
 border-color: #0000;
 `), cB("base-suffix", `
 cursor: pointer;
 position: absolute;
 top: 50%;
 transform: translateY(-50%);
 right: 10px;
 `, [cE("arrow", `
 font-size: var(--n-arrow-size);
 color: var(--n-arrow-color);
 transition: color .3s var(--n-bezier);
 `)]), cB("base-selection-overlay", `
 display: flex;
 align-items: center;
 white-space: nowrap;
 pointer-events: none;
 position: absolute;
 top: 0;
 right: 0;
 bottom: 0;
 left: 0;
 padding: var(--n-padding-single);
 transition: color .3s var(--n-bezier);
 `, [cE("wrapper", `
 flex-basis: 0;
 flex-grow: 1;
 overflow: hidden;
 text-overflow: ellipsis;
 `)]), cB("base-selection-placeholder", `
 color: var(--n-placeholder-color);
 `, [cE("inner", `
 max-width: 100%;
 overflow: hidden;
 `)]), cB("base-selection-tags", `
 cursor: pointer;
 outline: none;
 box-sizing: border-box;
 position: relative;
 z-index: auto;
 display: flex;
 padding: var(--n-padding-multiple);
 flex-wrap: wrap;
 align-items: center;
 width: 100%;
 vertical-align: bottom;
 background-color: var(--n-color);
 border-radius: inherit;
 transition:
 color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 `), cB("base-selection-label", `
 height: var(--n-height);
 display: inline-flex;
 width: 100%;
 vertical-align: bottom;
 cursor: pointer;
 outline: none;
 z-index: auto;
 box-sizing: border-box;
 position: relative;
 transition:
 color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 border-radius: inherit;
 background-color: var(--n-color);
 align-items: center;
 `, [cB("base-selection-input", `
 font-size: inherit;
 line-height: inherit;
 outline: none;
 cursor: pointer;
 box-sizing: border-box;
 border:none;
 width: 100%;
 padding: var(--n-padding-single);
 background-color: #0000;
 color: var(--n-text-color);
 transition: color .3s var(--n-bezier);
 caret-color: var(--n-caret-color);
 `, [cE("content", `
 text-overflow: ellipsis;
 overflow: hidden;
 white-space: nowrap; 
 `)]), cE("render-label", `
 color: var(--n-text-color);
 `)]), cNotM("disabled", [c$1("&:hover", [cE("state-border", `
 box-shadow: var(--n-box-shadow-hover);
 border: var(--n-border-hover);
 `)]), cM("focus", [cE("state-border", `
 box-shadow: var(--n-box-shadow-focus);
 border: var(--n-border-focus);
 `)]), cM("active", [cE("state-border", `
 box-shadow: var(--n-box-shadow-active);
 border: var(--n-border-active);
 `), cB("base-selection-label", "background-color: var(--n-color-active);"), cB("base-selection-tags", "background-color: var(--n-color-active);")])]), cM("disabled", "cursor: not-allowed;", [cE("arrow", `
 color: var(--n-arrow-color-disabled);
 `), cB("base-selection-label", `
 cursor: not-allowed;
 background-color: var(--n-color-disabled);
 `, [cB("base-selection-input", `
 cursor: not-allowed;
 color: var(--n-text-color-disabled);
 `), cE("render-label", `
 color: var(--n-text-color-disabled);
 `)]), cB("base-selection-tags", `
 cursor: not-allowed;
 background-color: var(--n-color-disabled);
 `), cB("base-selection-placeholder", `
 cursor: not-allowed;
 color: var(--n-placeholder-color-disabled);
 `)]), cB("base-selection-input-tag", `
 height: calc(var(--n-height) - 6px);
 line-height: calc(var(--n-height) - 6px);
 outline: none;
 display: none;
 position: relative;
 margin-bottom: 3px;
 max-width: 100%;
 vertical-align: bottom;
 `, [cE("input", `
 font-size: inherit;
 font-family: inherit;
 min-width: 1px;
 padding: 0;
 background-color: #0000;
 outline: none;
 border: none;
 max-width: 100%;
 overflow: hidden;
 width: 1em;
 line-height: inherit;
 cursor: pointer;
 color: var(--n-text-color);
 caret-color: var(--n-caret-color);
 `), cE("mirror", `
 position: absolute;
 left: 0;
 top: 0;
 white-space: pre;
 visibility: hidden;
 user-select: none;
 -webkit-user-select: none;
 opacity: 0;
 `)]), ["warning", "error"].map((status) => cM(`${status}-status`, [cE("state-border", `border: var(--n-border-${status});`), cNotM("disabled", [c$1("&:hover", [cE("state-border", `
 box-shadow: var(--n-box-shadow-hover-${status});
 border: var(--n-border-hover-${status});
 `)]), cM("active", [cE("state-border", `
 box-shadow: var(--n-box-shadow-active-${status});
 border: var(--n-border-active-${status});
 `), cB("base-selection-label", `background-color: var(--n-color-active-${status});`), cB("base-selection-tags", `background-color: var(--n-color-active-${status});`)]), cM("focus", [cE("state-border", `
 box-shadow: var(--n-box-shadow-focus-${status});
 border: var(--n-border-focus-${status});
 `)])])]))]), cB("base-selection-popover", `
 margin-bottom: -3px;
 display: flex;
 flex-wrap: wrap;
 margin-right: -8px;
 `), cB("base-selection-tag-wrapper", `
 max-width: 100%;
 display: inline-flex;
 padding: 0 7px 3px 0;
 `, [c$1("&:last-child", "padding-right: 0;"), cB("tag", `
 font-size: 14px;
 max-width: 100%;
 `, [cE("content", `
 line-height: 1.25;
 text-overflow: ellipsis;
 overflow: hidden;
 `)])])]);
    const NInternalSelection = /* @__PURE__ */ defineComponent({
      name: "InternalSelection",
      props: Object.assign(Object.assign({}, useTheme.props), {
        clsPrefix: {
          type: String,
          required: true
        },
        bordered: {
          type: Boolean,
          default: void 0
        },
        active: Boolean,
        pattern: {
          type: String,
          default: ""
        },
        placeholder: String,
        selectedOption: {
          type: Object,
          default: null
        },
        selectedOptions: {
          type: Array,
          default: null
        },
        labelField: {
          type: String,
          default: "label"
        },
        valueField: {
          type: String,
          default: "value"
        },
        multiple: Boolean,
        filterable: Boolean,
        clearable: Boolean,
        disabled: Boolean,
        size: {
          type: String,
          default: "medium"
        },
        loading: Boolean,
        autofocus: Boolean,
        showArrow: {
          type: Boolean,
          default: true
        },
        inputProps: Object,
        focused: Boolean,
        renderTag: Function,
        onKeydown: Function,
        onClick: Function,
        onBlur: Function,
        onFocus: Function,
        onDeleteOption: Function,
        maxTagCount: [String, Number],
        ellipsisTagPopoverProps: Object,
        onClear: Function,
        onPatternInput: Function,
        onPatternFocus: Function,
        onPatternBlur: Function,
        renderLabel: Function,
        status: String,
        inlineThemeDisabled: Boolean,
        ignoreComposition: {
          type: Boolean,
          default: true
        },
        onResize: Function
      }),
      setup(props) {
        const {
          mergedClsPrefixRef,
          mergedRtlRef
        } = useConfig(props);
        const rtlEnabledRef = useRtl("InternalSelection", mergedRtlRef, mergedClsPrefixRef);
        const patternInputMirrorRef = ref(null);
        const patternInputRef = ref(null);
        const selfRef = ref(null);
        const multipleElRef = ref(null);
        const singleElRef = ref(null);
        const patternInputWrapperRef = ref(null);
        const counterRef = ref(null);
        const counterWrapperRef = ref(null);
        const overflowRef = ref(null);
        const inputTagElRef = ref(null);
        const showTagsPopoverRef = ref(false);
        const patternInputFocusedRef = ref(false);
        const hoverRef = ref(false);
        const themeRef = useTheme("InternalSelection", "-internal-selection", style$i, internalSelectionLight, props, toRef(props, "clsPrefix"));
        const mergedClearableRef = computed(() => {
          return props.clearable && !props.disabled && (hoverRef.value || props.active);
        });
        const filterablePlaceholderRef = computed(() => {
          return props.selectedOption ? props.renderTag ? props.renderTag({
            option: props.selectedOption,
            handleClose: () => {
            }
          }) : props.renderLabel ? props.renderLabel(props.selectedOption, true) : render$1(props.selectedOption[props.labelField], props.selectedOption, true) : props.placeholder;
        });
        const labelRef = computed(() => {
          const option = props.selectedOption;
          if (!option) return void 0;
          return option[props.labelField];
        });
        const selectedRef = computed(() => {
          if (props.multiple) {
            return !!(Array.isArray(props.selectedOptions) && props.selectedOptions.length);
          } else {
            return props.selectedOption !== null;
          }
        });
        function syncMirrorWidth() {
          var _a;
          const {
            value: patternInputMirrorEl
          } = patternInputMirrorRef;
          if (patternInputMirrorEl) {
            const {
              value: patternInputEl
            } = patternInputRef;
            if (patternInputEl) {
              patternInputEl.style.width = `${patternInputMirrorEl.offsetWidth}px`;
              if (props.maxTagCount !== "responsive") {
                (_a = overflowRef.value) === null || _a === void 0 ? void 0 : _a.sync({
                  showAllItemsBeforeCalculate: false
                });
              }
            }
          }
        }
        function hideInputTag() {
          const {
            value: inputTagEl
          } = inputTagElRef;
          if (inputTagEl) inputTagEl.style.display = "none";
        }
        function showInputTag() {
          const {
            value: inputTagEl
          } = inputTagElRef;
          if (inputTagEl) inputTagEl.style.display = "inline-block";
        }
        watch(toRef(props, "active"), (value) => {
          if (!value) hideInputTag();
        });
        watch(toRef(props, "pattern"), () => {
          if (props.multiple) {
            void nextTick(syncMirrorWidth);
          }
        });
        function doFocus(e) {
          const {
            onFocus
          } = props;
          if (onFocus) onFocus(e);
        }
        function doBlur(e) {
          const {
            onBlur
          } = props;
          if (onBlur) onBlur(e);
        }
        function doDeleteOption(value) {
          const {
            onDeleteOption
          } = props;
          if (onDeleteOption) onDeleteOption(value);
        }
        function doClear(e) {
          const {
            onClear
          } = props;
          if (onClear) onClear(e);
        }
        function doPatternInput(value) {
          const {
            onPatternInput
          } = props;
          if (onPatternInput) onPatternInput(value);
        }
        function handleFocusin(e) {
          var _a;
          if (!e.relatedTarget || !((_a = selfRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
            doFocus(e);
          }
        }
        function handleFocusout(e) {
          var _a;
          if ((_a = selfRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget)) return;
          doBlur(e);
        }
        function handleClear(e) {
          doClear(e);
        }
        function handleMouseEnter() {
          hoverRef.value = true;
        }
        function handleMouseLeave() {
          hoverRef.value = false;
        }
        function handleMouseDown(e) {
          if (!props.active || !props.filterable) return;
          if (e.target === patternInputRef.value) return;
          e.preventDefault();
        }
        function handleDeleteOption(option) {
          doDeleteOption(option);
        }
        const isComposingRef2 = ref(false);
        function handlePatternKeyDown(e) {
          if (e.key === "Backspace" && !isComposingRef2.value) {
            if (!props.pattern.length) {
              const {
                selectedOptions
              } = props;
              if (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) {
                handleDeleteOption(selectedOptions[selectedOptions.length - 1]);
              }
            }
          }
        }
        let cachedInputEvent = null;
        function handlePatternInputInput(e) {
          const {
            value: patternInputMirrorEl
          } = patternInputMirrorRef;
          if (patternInputMirrorEl) {
            const inputText = e.target.value;
            patternInputMirrorEl.textContent = inputText;
            syncMirrorWidth();
          }
          if (props.ignoreComposition) {
            if (!isComposingRef2.value) {
              doPatternInput(e);
            } else {
              cachedInputEvent = e;
            }
          } else {
            doPatternInput(e);
          }
        }
        function handleCompositionStart() {
          isComposingRef2.value = true;
        }
        function handleCompositionEnd() {
          isComposingRef2.value = false;
          if (props.ignoreComposition) {
            doPatternInput(cachedInputEvent);
          }
          cachedInputEvent = null;
        }
        function handlePatternInputFocus(e) {
          var _a;
          patternInputFocusedRef.value = true;
          (_a = props.onPatternFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
        }
        function handlePatternInputBlur(e) {
          var _a;
          patternInputFocusedRef.value = false;
          (_a = props.onPatternBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
        }
        function blur() {
          var _a, _b;
          if (props.filterable) {
            patternInputFocusedRef.value = false;
            (_a = patternInputWrapperRef.value) === null || _a === void 0 ? void 0 : _a.blur();
            (_b = patternInputRef.value) === null || _b === void 0 ? void 0 : _b.blur();
          } else if (props.multiple) {
            const {
              value: multipleEl
            } = multipleElRef;
            multipleEl === null || multipleEl === void 0 ? void 0 : multipleEl.blur();
          } else {
            const {
              value: singleEl
            } = singleElRef;
            singleEl === null || singleEl === void 0 ? void 0 : singleEl.blur();
          }
        }
        function focus() {
          var _a, _b, _c;
          if (props.filterable) {
            patternInputFocusedRef.value = false;
            (_a = patternInputWrapperRef.value) === null || _a === void 0 ? void 0 : _a.focus();
          } else if (props.multiple) {
            (_b = multipleElRef.value) === null || _b === void 0 ? void 0 : _b.focus();
          } else {
            (_c = singleElRef.value) === null || _c === void 0 ? void 0 : _c.focus();
          }
        }
        function focusInput() {
          const {
            value: patternInputEl
          } = patternInputRef;
          if (patternInputEl) {
            showInputTag();
            patternInputEl.focus();
          }
        }
        function blurInput() {
          const {
            value: patternInputEl
          } = patternInputRef;
          if (patternInputEl) {
            patternInputEl.blur();
          }
        }
        function updateCounter(count) {
          const {
            value
          } = counterRef;
          if (value) {
            value.setTextContent(`+${count}`);
          }
        }
        function getCounter() {
          const {
            value
          } = counterWrapperRef;
          return value;
        }
        function getTail() {
          return patternInputRef.value;
        }
        let enterTimerId = null;
        function clearEnterTimer() {
          if (enterTimerId !== null) window.clearTimeout(enterTimerId);
        }
        function handleMouseEnterCounter() {
          if (props.active) return;
          clearEnterTimer();
          enterTimerId = window.setTimeout(() => {
            if (selectedRef.value) {
              showTagsPopoverRef.value = true;
            }
          }, 100);
        }
        function handleMouseLeaveCounter() {
          clearEnterTimer();
        }
        function onPopoverUpdateShow(show) {
          if (!show) {
            clearEnterTimer();
            showTagsPopoverRef.value = false;
          }
        }
        watch(selectedRef, (value) => {
          if (!value) {
            showTagsPopoverRef.value = false;
          }
        });
        onMounted(() => {
          watchEffect(() => {
            const patternInputWrapperEl = patternInputWrapperRef.value;
            if (!patternInputWrapperEl) return;
            if (props.disabled) {
              patternInputWrapperEl.removeAttribute("tabindex");
            } else {
              patternInputWrapperEl.tabIndex = patternInputFocusedRef.value ? -1 : 0;
            }
          });
        });
        useOnResize(selfRef, props.onResize);
        const {
          inlineThemeDisabled
        } = props;
        const cssVarsRef = computed(() => {
          const {
            size: size2
          } = props;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              borderRadius,
              color,
              placeholderColor,
              textColor,
              paddingSingle,
              paddingMultiple,
              caretColor,
              colorDisabled,
              textColorDisabled,
              placeholderColorDisabled,
              colorActive,
              boxShadowFocus,
              boxShadowActive,
              boxShadowHover,
              border,
              borderFocus,
              borderHover,
              borderActive,
              arrowColor,
              arrowColorDisabled,
              loadingColor,
              // form warning
              colorActiveWarning,
              boxShadowFocusWarning,
              boxShadowActiveWarning,
              boxShadowHoverWarning,
              borderWarning,
              borderFocusWarning,
              borderHoverWarning,
              borderActiveWarning,
              // form error
              colorActiveError,
              boxShadowFocusError,
              boxShadowActiveError,
              boxShadowHoverError,
              borderError,
              borderFocusError,
              borderHoverError,
              borderActiveError,
              // clear
              clearColor,
              clearColorHover,
              clearColorPressed,
              clearSize,
              // arrow
              arrowSize: arrowSize2,
              [createKey("height", size2)]: height,
              [createKey("fontSize", size2)]: fontSize2
            }
          } = themeRef.value;
          const paddingSingleDiscrete = getMargin(paddingSingle);
          const paddingMultipleDiscrete = getMargin(paddingMultiple);
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-border": border,
            "--n-border-active": borderActive,
            "--n-border-focus": borderFocus,
            "--n-border-hover": borderHover,
            "--n-border-radius": borderRadius,
            "--n-box-shadow-active": boxShadowActive,
            "--n-box-shadow-focus": boxShadowFocus,
            "--n-box-shadow-hover": boxShadowHover,
            "--n-caret-color": caretColor,
            "--n-color": color,
            "--n-color-active": colorActive,
            "--n-color-disabled": colorDisabled,
            "--n-font-size": fontSize2,
            "--n-height": height,
            "--n-padding-single-top": paddingSingleDiscrete.top,
            "--n-padding-multiple-top": paddingMultipleDiscrete.top,
            "--n-padding-single-right": paddingSingleDiscrete.right,
            "--n-padding-multiple-right": paddingMultipleDiscrete.right,
            "--n-padding-single-left": paddingSingleDiscrete.left,
            "--n-padding-multiple-left": paddingMultipleDiscrete.left,
            "--n-padding-single-bottom": paddingSingleDiscrete.bottom,
            "--n-padding-multiple-bottom": paddingMultipleDiscrete.bottom,
            "--n-placeholder-color": placeholderColor,
            "--n-placeholder-color-disabled": placeholderColorDisabled,
            "--n-text-color": textColor,
            "--n-text-color-disabled": textColorDisabled,
            "--n-arrow-color": arrowColor,
            "--n-arrow-color-disabled": arrowColorDisabled,
            "--n-loading-color": loadingColor,
            // form warning
            "--n-color-active-warning": colorActiveWarning,
            "--n-box-shadow-focus-warning": boxShadowFocusWarning,
            "--n-box-shadow-active-warning": boxShadowActiveWarning,
            "--n-box-shadow-hover-warning": boxShadowHoverWarning,
            "--n-border-warning": borderWarning,
            "--n-border-focus-warning": borderFocusWarning,
            "--n-border-hover-warning": borderHoverWarning,
            "--n-border-active-warning": borderActiveWarning,
            // form error
            "--n-color-active-error": colorActiveError,
            "--n-box-shadow-focus-error": boxShadowFocusError,
            "--n-box-shadow-active-error": boxShadowActiveError,
            "--n-box-shadow-hover-error": boxShadowHoverError,
            "--n-border-error": borderError,
            "--n-border-focus-error": borderFocusError,
            "--n-border-hover-error": borderHoverError,
            "--n-border-active-error": borderActiveError,
            // clear
            "--n-clear-size": clearSize,
            "--n-clear-color": clearColor,
            "--n-clear-color-hover": clearColorHover,
            "--n-clear-color-pressed": clearColorPressed,
            // arrow-size
            "--n-arrow-size": arrowSize2
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("internal-selection", computed(() => {
          return props.size[0];
        }), cssVarsRef, props) : void 0;
        return {
          mergedTheme: themeRef,
          mergedClearable: mergedClearableRef,
          mergedClsPrefix: mergedClsPrefixRef,
          rtlEnabled: rtlEnabledRef,
          patternInputFocused: patternInputFocusedRef,
          filterablePlaceholder: filterablePlaceholderRef,
          label: labelRef,
          selected: selectedRef,
          showTagsPanel: showTagsPopoverRef,
          isComposing: isComposingRef2,
          // dom ref
          counterRef,
          counterWrapperRef,
          patternInputMirrorRef,
          patternInputRef,
          selfRef,
          multipleElRef,
          singleElRef,
          patternInputWrapperRef,
          overflowRef,
          inputTagElRef,
          handleMouseDown,
          handleFocusin,
          handleClear,
          handleMouseEnter,
          handleMouseLeave,
          handleDeleteOption,
          handlePatternKeyDown,
          handlePatternInputInput,
          handlePatternInputBlur,
          handlePatternInputFocus,
          handleMouseEnterCounter,
          handleMouseLeaveCounter,
          handleFocusout,
          handleCompositionEnd,
          handleCompositionStart,
          onPopoverUpdateShow,
          focus,
          focusInput,
          blur,
          blurInput,
          updateCounter,
          getCounter,
          getTail,
          renderLabel: props.renderLabel,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        const {
          status,
          multiple,
          size: size2,
          disabled,
          filterable,
          maxTagCount,
          bordered,
          clsPrefix,
          ellipsisTagPopoverProps,
          onRender,
          renderTag,
          renderLabel
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        const maxTagCountResponsive = maxTagCount === "responsive";
        const maxTagCountNumeric = typeof maxTagCount === "number";
        const useMaxTagCount = maxTagCountResponsive || maxTagCountNumeric;
        const suffix2 = h(Wrapper, null, {
          default: () => h(NBaseSuffix, {
            clsPrefix,
            loading: this.loading,
            showArrow: this.showArrow,
            showClear: this.mergedClearable && this.selected,
            onClear: this.handleClear
          }, {
            default: () => {
              var _a, _b;
              return (_b = (_a = this.$slots).arrow) === null || _b === void 0 ? void 0 : _b.call(_a);
            }
          })
        });
        let body;
        if (multiple) {
          const {
            labelField
          } = this;
          const createTag = (option) => h("div", {
            class: `${clsPrefix}-base-selection-tag-wrapper`,
            key: option.value
          }, renderTag ? renderTag({
            option,
            handleClose: () => {
              this.handleDeleteOption(option);
            }
          }) : h(NTag, {
            size: size2,
            closable: !option.disabled,
            disabled,
            onClose: () => {
              this.handleDeleteOption(option);
            },
            internalCloseIsButtonTag: false,
            internalCloseFocusable: false
          }, {
            default: () => renderLabel ? renderLabel(option, true) : render$1(option[labelField], option, true)
          }));
          const createOriginalTagNodes = () => (maxTagCountNumeric ? this.selectedOptions.slice(0, maxTagCount) : this.selectedOptions).map(createTag);
          const input = filterable ? h("div", {
            class: `${clsPrefix}-base-selection-input-tag`,
            ref: "inputTagElRef",
            key: "__input-tag__"
          }, h("input", Object.assign({}, this.inputProps, {
            ref: "patternInputRef",
            tabindex: -1,
            disabled,
            value: this.pattern,
            autofocus: this.autofocus,
            class: `${clsPrefix}-base-selection-input-tag__input`,
            onBlur: this.handlePatternInputBlur,
            onFocus: this.handlePatternInputFocus,
            onKeydown: this.handlePatternKeyDown,
            onInput: this.handlePatternInputInput,
            onCompositionstart: this.handleCompositionStart,
            onCompositionend: this.handleCompositionEnd
          })), h("span", {
            ref: "patternInputMirrorRef",
            class: `${clsPrefix}-base-selection-input-tag__mirror`
          }, this.pattern)) : null;
          const renderCounter = maxTagCountResponsive ? () => h("div", {
            class: `${clsPrefix}-base-selection-tag-wrapper`,
            ref: "counterWrapperRef"
          }, h(NTag, {
            size: size2,
            ref: "counterRef",
            onMouseenter: this.handleMouseEnterCounter,
            onMouseleave: this.handleMouseLeaveCounter,
            disabled
          })) : void 0;
          let counter;
          if (maxTagCountNumeric) {
            const rest = this.selectedOptions.length - maxTagCount;
            if (rest > 0) {
              counter = h("div", {
                class: `${clsPrefix}-base-selection-tag-wrapper`,
                key: "__counter__"
              }, h(NTag, {
                size: size2,
                ref: "counterRef",
                onMouseenter: this.handleMouseEnterCounter,
                disabled
              }, {
                default: () => `+${rest}`
              }));
            }
          }
          const tags = maxTagCountResponsive ? filterable ? h(VOverflow, {
            ref: "overflowRef",
            updateCounter: this.updateCounter,
            getCounter: this.getCounter,
            getTail: this.getTail,
            style: {
              width: "100%",
              display: "flex",
              overflow: "hidden"
            }
          }, {
            default: createOriginalTagNodes,
            counter: renderCounter,
            tail: () => input
          }) : h(VOverflow, {
            ref: "overflowRef",
            updateCounter: this.updateCounter,
            getCounter: this.getCounter,
            style: {
              width: "100%",
              display: "flex",
              overflow: "hidden"
            }
          }, {
            default: createOriginalTagNodes,
            counter: renderCounter
          }) : maxTagCountNumeric && counter ? createOriginalTagNodes().concat(counter) : createOriginalTagNodes();
          const renderPopover = useMaxTagCount ? () => h("div", {
            class: `${clsPrefix}-base-selection-popover`
          }, maxTagCountResponsive ? createOriginalTagNodes() : this.selectedOptions.map(createTag)) : void 0;
          const popoverProps2 = useMaxTagCount ? Object.assign({
            show: this.showTagsPanel,
            trigger: "hover",
            overlap: true,
            placement: "top",
            width: "trigger",
            onUpdateShow: this.onPopoverUpdateShow,
            theme: this.mergedTheme.peers.Popover,
            themeOverrides: this.mergedTheme.peerOverrides.Popover
          }, ellipsisTagPopoverProps) : null;
          const showPlaceholder = this.selected ? false : this.active ? !this.pattern && !this.isComposing : true;
          const placeholder = showPlaceholder ? h("div", {
            class: `${clsPrefix}-base-selection-placeholder ${clsPrefix}-base-selection-overlay`
          }, h("div", {
            class: `${clsPrefix}-base-selection-placeholder__inner`
          }, this.placeholder)) : null;
          const popoverTrigger = filterable ? h("div", {
            ref: "patternInputWrapperRef",
            class: `${clsPrefix}-base-selection-tags`
          }, tags, maxTagCountResponsive ? null : input, suffix2) : h("div", {
            ref: "multipleElRef",
            class: `${clsPrefix}-base-selection-tags`,
            tabindex: disabled ? void 0 : 0
          }, tags, suffix2);
          body = h(Fragment, null, useMaxTagCount ? h(NPopover, Object.assign({}, popoverProps2, {
            scrollable: true,
            style: "max-height: calc(var(--v-target-height) * 6.6);"
          }), {
            trigger: () => popoverTrigger,
            default: renderPopover
          }) : popoverTrigger, placeholder);
        } else {
          if (filterable) {
            const hasInput = this.pattern || this.isComposing;
            const showPlaceholder = this.active ? !hasInput : !this.selected;
            const showSelectedLabel = this.active ? false : this.selected;
            body = h("div", {
              ref: "patternInputWrapperRef",
              class: `${clsPrefix}-base-selection-label`,
              title: this.patternInputFocused ? void 0 : getTitleAttribute(this.label)
            }, h("input", Object.assign({}, this.inputProps, {
              ref: "patternInputRef",
              class: `${clsPrefix}-base-selection-input`,
              value: this.active ? this.pattern : "",
              placeholder: "",
              readonly: disabled,
              disabled,
              tabindex: -1,
              autofocus: this.autofocus,
              onFocus: this.handlePatternInputFocus,
              onBlur: this.handlePatternInputBlur,
              onInput: this.handlePatternInputInput,
              onCompositionstart: this.handleCompositionStart,
              onCompositionend: this.handleCompositionEnd
            })), showSelectedLabel ? h("div", {
              class: `${clsPrefix}-base-selection-label__render-label ${clsPrefix}-base-selection-overlay`,
              key: "input"
            }, h("div", {
              class: `${clsPrefix}-base-selection-overlay__wrapper`
            }, renderTag ? renderTag({
              option: this.selectedOption,
              handleClose: () => {
              }
            }) : renderLabel ? renderLabel(this.selectedOption, true) : render$1(this.label, this.selectedOption, true))) : null, showPlaceholder ? h("div", {
              class: `${clsPrefix}-base-selection-placeholder ${clsPrefix}-base-selection-overlay`,
              key: "placeholder"
            }, h("div", {
              class: `${clsPrefix}-base-selection-overlay__wrapper`
            }, this.filterablePlaceholder)) : null, suffix2);
          } else {
            body = h("div", {
              ref: "singleElRef",
              class: `${clsPrefix}-base-selection-label`,
              tabindex: this.disabled ? void 0 : 0
            }, this.label !== void 0 ? h("div", {
              class: `${clsPrefix}-base-selection-input`,
              title: getTitleAttribute(this.label),
              key: "input"
            }, h("div", {
              class: `${clsPrefix}-base-selection-input__content`
            }, renderTag ? renderTag({
              option: this.selectedOption,
              handleClose: () => {
              }
            }) : renderLabel ? renderLabel(this.selectedOption, true) : render$1(this.label, this.selectedOption, true))) : h("div", {
              class: `${clsPrefix}-base-selection-placeholder ${clsPrefix}-base-selection-overlay`,
              key: "placeholder"
            }, h("div", {
              class: `${clsPrefix}-base-selection-placeholder__inner`
            }, this.placeholder)), suffix2);
          }
        }
        return h("div", {
          ref: "selfRef",
          class: [`${clsPrefix}-base-selection`, this.rtlEnabled && `${clsPrefix}-base-selection--rtl`, this.themeClass, status && `${clsPrefix}-base-selection--${status}-status`, {
            [`${clsPrefix}-base-selection--active`]: this.active,
            [`${clsPrefix}-base-selection--selected`]: this.selected || this.active && this.pattern,
            [`${clsPrefix}-base-selection--disabled`]: this.disabled,
            [`${clsPrefix}-base-selection--multiple`]: this.multiple,
            // focus is not controlled by selection itself since it always need
            // to be managed together with menu. provide :focus style will cause
            // many redundant codes.
            [`${clsPrefix}-base-selection--focus`]: this.focused
          }],
          style: this.cssVars,
          onClick: this.onClick,
          onMouseenter: this.handleMouseEnter,
          onMouseleave: this.handleMouseLeave,
          onKeydown: this.onKeydown,
          onFocusin: this.handleFocusin,
          onFocusout: this.handleFocusout,
          onMousedown: this.handleMouseDown
        }, body, bordered ? h("div", {
          class: `${clsPrefix}-base-selection__border`
        }) : null, bordered ? h("div", {
          class: `${clsPrefix}-base-selection__state-border`
        }) : null);
      }
    });
    const {
      cubicBezierEaseInOut: cubicBezierEaseInOut$1
    } = commonVariables$m;
    function fadeInWidthExpandTransition({
      duration: duration2 = ".2s",
      delay = ".1s"
    } = {}) {
      return [c$1("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to", {
        opacity: 1
      }), c$1("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from", `
 opacity: 0!important;
 margin-left: 0!important;
 margin-right: 0!important;
 `), c$1("&.fade-in-width-expand-transition-leave-active", `
 overflow: hidden;
 transition:
 opacity ${duration2} ${cubicBezierEaseInOut$1},
 max-width ${duration2} ${cubicBezierEaseInOut$1} ${delay},
 margin-left ${duration2} ${cubicBezierEaseInOut$1} ${delay},
 margin-right ${duration2} ${cubicBezierEaseInOut$1} ${delay};
 `), c$1("&.fade-in-width-expand-transition-enter-active", `
 overflow: hidden;
 transition:
 opacity ${duration2} ${cubicBezierEaseInOut$1} ${delay},
 max-width ${duration2} ${cubicBezierEaseInOut$1},
 margin-left ${duration2} ${cubicBezierEaseInOut$1},
 margin-right ${duration2} ${cubicBezierEaseInOut$1};
 `)];
    }
    const commonVars$b = {
      iconMargin: "11px 8px 0 12px",
      iconMarginRtl: "11px 12px 0 8px",
      iconSize: "24px",
      closeIconSize: "16px",
      closeSize: "20px",
      closeMargin: "13px 14px 0 0",
      closeMarginRtl: "13px 0 0 14px",
      padding: "13px"
    };
    const alertDark = {
      name: "Alert",
      common: derived$1,
      self(vars) {
        const {
          lineHeight: lineHeight2,
          borderRadius,
          fontWeightStrong,
          dividerColor,
          inputColor,
          textColor1,
          textColor2,
          closeColorHover,
          closeColorPressed,
          closeIconColor,
          closeIconColorHover,
          closeIconColorPressed,
          infoColorSuppl,
          successColorSuppl,
          warningColorSuppl,
          errorColorSuppl,
          fontSize: fontSize2
        } = vars;
        return Object.assign(Object.assign({}, commonVars$b), {
          fontSize: fontSize2,
          lineHeight: lineHeight2,
          titleFontWeight: fontWeightStrong,
          borderRadius,
          border: `1px solid ${dividerColor}`,
          color: inputColor,
          titleTextColor: textColor1,
          iconColor: textColor2,
          contentTextColor: textColor2,
          closeBorderRadius: borderRadius,
          closeColorHover,
          closeColorPressed,
          closeIconColor,
          closeIconColorHover,
          closeIconColorPressed,
          borderInfo: `1px solid ${changeColor(infoColorSuppl, {
            alpha: 0.35
          })}`,
          colorInfo: changeColor(infoColorSuppl, {
            alpha: 0.25
          }),
          titleTextColorInfo: textColor1,
          iconColorInfo: infoColorSuppl,
          contentTextColorInfo: textColor2,
          closeColorHoverInfo: closeColorHover,
          closeColorPressedInfo: closeColorPressed,
          closeIconColorInfo: closeIconColor,
          closeIconColorHoverInfo: closeIconColorHover,
          closeIconColorPressedInfo: closeIconColorPressed,
          borderSuccess: `1px solid ${changeColor(successColorSuppl, {
            alpha: 0.35
          })}`,
          colorSuccess: changeColor(successColorSuppl, {
            alpha: 0.25
          }),
          titleTextColorSuccess: textColor1,
          iconColorSuccess: successColorSuppl,
          contentTextColorSuccess: textColor2,
          closeColorHoverSuccess: closeColorHover,
          closeColorPressedSuccess: closeColorPressed,
          closeIconColorSuccess: closeIconColor,
          closeIconColorHoverSuccess: closeIconColorHover,
          closeIconColorPressedSuccess: closeIconColorPressed,
          borderWarning: `1px solid ${changeColor(warningColorSuppl, {
            alpha: 0.35
          })}`,
          colorWarning: changeColor(warningColorSuppl, {
            alpha: 0.25
          }),
          titleTextColorWarning: textColor1,
          iconColorWarning: warningColorSuppl,
          contentTextColorWarning: textColor2,
          closeColorHoverWarning: closeColorHover,
          closeColorPressedWarning: closeColorPressed,
          closeIconColorWarning: closeIconColor,
          closeIconColorHoverWarning: closeIconColorHover,
          closeIconColorPressedWarning: closeIconColorPressed,
          borderError: `1px solid ${changeColor(errorColorSuppl, {
            alpha: 0.35
          })}`,
          colorError: changeColor(errorColorSuppl, {
            alpha: 0.25
          }),
          titleTextColorError: textColor1,
          iconColorError: errorColorSuppl,
          contentTextColorError: textColor2,
          closeColorHoverError: closeColorHover,
          closeColorPressedError: closeColorPressed,
          closeIconColorError: closeIconColor,
          closeIconColorHoverError: closeIconColorHover,
          closeIconColorPressedError: closeIconColorPressed
        });
      }
    };
    const {
      cubicBezierEaseInOut,
      cubicBezierEaseOut: cubicBezierEaseOut$4,
      cubicBezierEaseIn: cubicBezierEaseIn$4
    } = commonVariables$m;
    function fadeInHeightExpandTransition({
      overflow = "hidden",
      duration: duration2 = ".3s",
      originalTransition = "",
      leavingDelay = "0s",
      foldPadding = false,
      enterToProps = void 0,
      leaveToProps = void 0,
      reverse = false
    } = {}) {
      const enterClass = reverse ? "leave" : "enter";
      const leaveClass = reverse ? "enter" : "leave";
      return [c$1(`&.fade-in-height-expand-transition-${leaveClass}-from,
 &.fade-in-height-expand-transition-${enterClass}-to`, Object.assign(Object.assign({}, enterToProps), {
        opacity: 1
      })), c$1(`&.fade-in-height-expand-transition-${leaveClass}-to,
 &.fade-in-height-expand-transition-${enterClass}-from`, Object.assign(Object.assign({}, leaveToProps), {
        opacity: 0,
        marginTop: "0 !important",
        marginBottom: "0 !important",
        paddingTop: foldPadding ? "0 !important" : void 0,
        paddingBottom: foldPadding ? "0 !important" : void 0
      })), c$1(`&.fade-in-height-expand-transition-${leaveClass}-active`, `
 overflow: ${overflow};
 transition:
 max-height ${duration2} ${cubicBezierEaseInOut} ${leavingDelay},
 opacity ${duration2} ${cubicBezierEaseOut$4} ${leavingDelay},
 margin-top ${duration2} ${cubicBezierEaseInOut} ${leavingDelay},
 margin-bottom ${duration2} ${cubicBezierEaseInOut} ${leavingDelay},
 padding-top ${duration2} ${cubicBezierEaseInOut} ${leavingDelay},
 padding-bottom ${duration2} ${cubicBezierEaseInOut} ${leavingDelay}
 ${originalTransition ? `,${originalTransition}` : ""}
 `), c$1(`&.fade-in-height-expand-transition-${enterClass}-active`, `
 overflow: ${overflow};
 transition:
 max-height ${duration2} ${cubicBezierEaseInOut},
 opacity ${duration2} ${cubicBezierEaseIn$4},
 margin-top ${duration2} ${cubicBezierEaseInOut},
 margin-bottom ${duration2} ${cubicBezierEaseInOut},
 padding-top ${duration2} ${cubicBezierEaseInOut},
 padding-bottom ${duration2} ${cubicBezierEaseInOut}
 ${originalTransition ? `,${originalTransition}` : ""}
 `)];
    }
    const commonVars$a = {
      linkFontSize: "13px",
      linkPadding: "0 0 0 16px",
      railWidth: "4px"
    };
    function self$S(vars) {
      const {
        borderRadius,
        railColor,
        primaryColor,
        primaryColorHover,
        primaryColorPressed,
        textColor2
      } = vars;
      return Object.assign(Object.assign({}, commonVars$a), {
        borderRadius,
        railColor,
        railColorActive: primaryColor,
        linkColor: changeColor(primaryColor, {
          alpha: 0.15
        }),
        linkTextColor: textColor2,
        linkTextColorHover: primaryColorHover,
        linkTextColorPressed: primaryColorPressed,
        linkTextColorActive: primaryColor
      });
    }
    const anchorDark = {
      name: "Anchor",
      common: derived$1,
      self: self$S
    };
    function getIsGroup(option) {
      return option.type === "group";
    }
    function getIgnored(option) {
      return option.type === "ignored";
    }
    function patternMatched(pattern, value) {
      try {
        return !!(1 + value.toString().toLowerCase().indexOf(pattern.trim().toLowerCase()));
      } catch (_a) {
        return false;
      }
    }
    function createTmOptions(valueField, childrenField) {
      const options = {
        getIsGroup,
        getIgnored,
        getKey(option) {
          if (getIsGroup(option)) {
            return option.name || option.key || "key-required";
          }
          return option[valueField];
        },
        getChildren(option) {
          return option[childrenField];
        }
      };
      return options;
    }
    function filterOptions(originalOpts, filter, pattern, childrenField) {
      if (!filter) return originalOpts;
      function traverse2(options) {
        if (!Array.isArray(options)) return [];
        const filteredOptions = [];
        for (const option of options) {
          if (getIsGroup(option)) {
            const children = traverse2(option[childrenField]);
            if (children.length) {
              filteredOptions.push(Object.assign({}, option, {
                [childrenField]: children
              }));
            }
          } else if (getIgnored(option)) {
            continue;
          } else if (filter(pattern, option)) {
            filteredOptions.push(option);
          }
        }
        return filteredOptions;
      }
      return traverse2(originalOpts);
    }
    function createValOptMap(options, valueField, childrenField) {
      const valOptMap = /* @__PURE__ */ new Map();
      options.forEach((option) => {
        if (getIsGroup(option)) {
          option[childrenField].forEach((selectGroupOption) => {
            valOptMap.set(selectGroupOption[valueField], selectGroupOption);
          });
        } else {
          valOptMap.set(option[valueField], option);
        }
      });
      return valOptMap;
    }
    const isChrome = isBrowser$2 && "chrome" in window;
    isBrowser$2 && navigator.userAgent.includes("Firefox");
    const isSafari = isBrowser$2 && navigator.userAgent.includes("Safari") && !isChrome;
    const commonVariables$i = {
      paddingTiny: "0 8px",
      paddingSmall: "0 10px",
      paddingMedium: "0 12px",
      paddingLarge: "0 14px",
      clearSize: "16px"
    };
    const inputDark = {
      name: "Input",
      common: derived$1,
      self(vars) {
        const {
          textColor2,
          textColor3,
          textColorDisabled,
          primaryColor,
          primaryColorHover,
          inputColor,
          inputColorDisabled,
          warningColor,
          warningColorHover,
          errorColor,
          errorColorHover,
          borderRadius,
          lineHeight: lineHeight2,
          fontSizeTiny,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          heightTiny,
          heightSmall,
          heightMedium,
          heightLarge,
          clearColor,
          clearColorHover,
          clearColorPressed,
          placeholderColor,
          placeholderColorDisabled,
          iconColor,
          iconColorDisabled,
          iconColorHover,
          iconColorPressed
        } = vars;
        return Object.assign(Object.assign({}, commonVariables$i), {
          countTextColorDisabled: textColorDisabled,
          countTextColor: textColor3,
          heightTiny,
          heightSmall,
          heightMedium,
          heightLarge,
          fontSizeTiny,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          lineHeight: lineHeight2,
          lineHeightTextarea: lineHeight2,
          borderRadius,
          iconSize: "16px",
          groupLabelColor: inputColor,
          textColor: textColor2,
          textColorDisabled,
          textDecorationColor: textColor2,
          groupLabelTextColor: textColor2,
          caretColor: primaryColor,
          placeholderColor,
          placeholderColorDisabled,
          color: inputColor,
          colorDisabled: inputColorDisabled,
          colorFocus: changeColor(primaryColor, {
            alpha: 0.1
          }),
          groupLabelBorder: "1px solid #0000",
          border: "1px solid #0000",
          borderHover: `1px solid ${primaryColorHover}`,
          borderDisabled: "1px solid #0000",
          borderFocus: `1px solid ${primaryColorHover}`,
          boxShadowFocus: `0 0 8px 0 ${changeColor(primaryColor, {
            alpha: 0.3
          })}`,
          loadingColor: primaryColor,
          // warning
          loadingColorWarning: warningColor,
          borderWarning: `1px solid ${warningColor}`,
          borderHoverWarning: `1px solid ${warningColorHover}`,
          colorFocusWarning: changeColor(warningColor, {
            alpha: 0.1
          }),
          borderFocusWarning: `1px solid ${warningColorHover}`,
          boxShadowFocusWarning: `0 0 8px 0 ${changeColor(warningColor, {
            alpha: 0.3
          })}`,
          caretColorWarning: warningColor,
          // error
          loadingColorError: errorColor,
          borderError: `1px solid ${errorColor}`,
          borderHoverError: `1px solid ${errorColorHover}`,
          colorFocusError: changeColor(errorColor, {
            alpha: 0.1
          }),
          borderFocusError: `1px solid ${errorColorHover}`,
          boxShadowFocusError: `0 0 8px 0 ${changeColor(errorColor, {
            alpha: 0.3
          })}`,
          caretColorError: errorColor,
          clearColor,
          clearColorHover,
          clearColorPressed,
          iconColor,
          iconColorDisabled,
          iconColorHover,
          iconColorPressed,
          suffixTextColor: textColor2
        });
      }
    };
    function self$R(vars) {
      const {
        textColor2,
        textColor3,
        textColorDisabled,
        primaryColor,
        primaryColorHover,
        inputColor,
        inputColorDisabled,
        borderColor,
        warningColor,
        warningColorHover,
        errorColor,
        errorColorHover,
        borderRadius,
        lineHeight: lineHeight2,
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        actionColor,
        clearColor,
        clearColorHover,
        clearColorPressed,
        placeholderColor,
        placeholderColorDisabled,
        iconColor,
        iconColorDisabled,
        iconColorHover,
        iconColorPressed
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$i), {
        countTextColorDisabled: textColorDisabled,
        countTextColor: textColor3,
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        lineHeight: lineHeight2,
        lineHeightTextarea: lineHeight2,
        borderRadius,
        iconSize: "16px",
        groupLabelColor: actionColor,
        groupLabelTextColor: textColor2,
        textColor: textColor2,
        textColorDisabled,
        textDecorationColor: textColor2,
        caretColor: primaryColor,
        placeholderColor,
        placeholderColorDisabled,
        color: inputColor,
        colorDisabled: inputColorDisabled,
        colorFocus: inputColor,
        groupLabelBorder: `1px solid ${borderColor}`,
        border: `1px solid ${borderColor}`,
        borderHover: `1px solid ${primaryColorHover}`,
        borderDisabled: `1px solid ${borderColor}`,
        borderFocus: `1px solid ${primaryColorHover}`,
        boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, {
          alpha: 0.2
        })}`,
        loadingColor: primaryColor,
        // warning
        loadingColorWarning: warningColor,
        borderWarning: `1px solid ${warningColor}`,
        borderHoverWarning: `1px solid ${warningColorHover}`,
        colorFocusWarning: inputColor,
        borderFocusWarning: `1px solid ${warningColorHover}`,
        boxShadowFocusWarning: `0 0 0 2px ${changeColor(warningColor, {
          alpha: 0.2
        })}`,
        caretColorWarning: warningColor,
        // error
        loadingColorError: errorColor,
        borderError: `1px solid ${errorColor}`,
        borderHoverError: `1px solid ${errorColorHover}`,
        colorFocusError: inputColor,
        borderFocusError: `1px solid ${errorColorHover}`,
        boxShadowFocusError: `0 0 0 2px ${changeColor(errorColor, {
          alpha: 0.2
        })}`,
        caretColorError: errorColor,
        clearColor,
        clearColorHover,
        clearColorPressed,
        iconColor,
        iconColorDisabled,
        iconColorHover,
        iconColorPressed,
        suffixTextColor: textColor2
      });
    }
    const inputLight = {
      name: "Input",
      common: derived,
      self: self$R
    };
    const inputInjectionKey = createInjectionKey("n-input");
    function len(s) {
      let count = 0;
      for (const _ of s) {
        count++;
      }
      return count;
    }
    function isEmptyInputValue(value) {
      return value === "" || value == null;
    }
    function useCursor(inputElRef) {
      const selectionRef = ref(null);
      function recordCursor() {
        const {
          value: input
        } = inputElRef;
        if (!(input === null || input === void 0 ? void 0 : input.focus)) {
          reset();
          return;
        }
        const {
          selectionStart,
          selectionEnd,
          value
        } = input;
        if (selectionStart == null || selectionEnd == null) {
          reset();
          return;
        }
        selectionRef.value = {
          start: selectionStart,
          end: selectionEnd,
          beforeText: value.slice(0, selectionStart),
          afterText: value.slice(selectionEnd)
        };
      }
      function restoreCursor() {
        var _a;
        const {
          value: selection
        } = selectionRef;
        const {
          value: inputEl
        } = inputElRef;
        if (!selection || !inputEl) {
          return;
        }
        const {
          value
        } = inputEl;
        const {
          start,
          beforeText,
          afterText
        } = selection;
        let startPos = value.length;
        if (value.endsWith(afterText)) {
          startPos = value.length - afterText.length;
        } else if (value.startsWith(beforeText)) {
          startPos = beforeText.length;
        } else {
          const beforeLastChar = beforeText[start - 1];
          const newIndex = value.indexOf(beforeLastChar, start - 1);
          if (newIndex !== -1) {
            startPos = newIndex + 1;
          }
        }
        (_a = inputEl.setSelectionRange) === null || _a === void 0 ? void 0 : _a.call(inputEl, startPos, startPos);
      }
      function reset() {
        selectionRef.value = null;
      }
      watch(inputElRef, reset);
      return {
        recordCursor,
        restoreCursor
      };
    }
    const WordCount = /* @__PURE__ */ defineComponent({
      name: "InputWordCount",
      setup(_, {
        slots
      }) {
        const {
          mergedValueRef,
          maxlengthRef,
          mergedClsPrefixRef,
          countGraphemesRef
        } = inject(inputInjectionKey);
        const wordCountRef = computed(() => {
          const {
            value: mergedValue
          } = mergedValueRef;
          if (mergedValue === null || Array.isArray(mergedValue)) return 0;
          return (countGraphemesRef.value || len)(mergedValue);
        });
        return () => {
          const {
            value: maxlength
          } = maxlengthRef;
          const {
            value: mergedValue
          } = mergedValueRef;
          return h("span", {
            class: `${mergedClsPrefixRef.value}-input-word-count`
          }, resolveSlotWithProps(slots.default, {
            value: mergedValue === null || Array.isArray(mergedValue) ? "" : mergedValue
          }, () => [maxlength === void 0 ? wordCountRef.value : `${wordCountRef.value} / ${maxlength}`]));
        };
      }
    });
    const style$h = cB("input", `
 max-width: 100%;
 cursor: text;
 line-height: 1.5;
 z-index: auto;
 outline: none;
 box-sizing: border-box;
 position: relative;
 display: inline-flex;
 border-radius: var(--n-border-radius);
 background-color: var(--n-color);
 transition: background-color .3s var(--n-bezier);
 font-size: var(--n-font-size);
 --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
`, [
      // common
      cE("input, textarea", `
 overflow: hidden;
 flex-grow: 1;
 position: relative;
 `),
      cE("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder", `
 box-sizing: border-box;
 font-size: inherit;
 line-height: 1.5;
 font-family: inherit;
 border: none;
 outline: none;
 background-color: #0000;
 text-align: inherit;
 transition:
 -webkit-text-fill-color .3s var(--n-bezier),
 caret-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 text-decoration-color .3s var(--n-bezier);
 `),
      cE("input-el, textarea-el", `
 -webkit-appearance: none;
 scrollbar-width: none;
 width: 100%;
 min-width: 0;
 text-decoration-color: var(--n-text-decoration-color);
 color: var(--n-text-color);
 caret-color: var(--n-caret-color);
 background-color: transparent;
 `, [c$1("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb", `
 width: 0;
 height: 0;
 display: none;
 `), c$1("&::placeholder", `
 color: #0000;
 -webkit-text-fill-color: transparent !important;
 `), c$1("&:-webkit-autofill ~", [cE("placeholder", "display: none;")])]),
      cM("round", [cNotM("textarea", "border-radius: calc(var(--n-height) / 2);")]),
      cE("placeholder", `
 pointer-events: none;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 overflow: hidden;
 color: var(--n-placeholder-color);
 `, [c$1("span", `
 width: 100%;
 display: inline-block;
 `)]),
      cM("textarea", [cE("placeholder", "overflow: visible;")]),
      cNotM("autosize", "width: 100%;"),
      cM("autosize", [cE("textarea-el, input-el", `
 position: absolute;
 top: 0;
 left: 0;
 height: 100%;
 `)]),
      // input
      cB("input-wrapper", `
 overflow: hidden;
 display: inline-flex;
 flex-grow: 1;
 position: relative;
 padding-left: var(--n-padding-left);
 padding-right: var(--n-padding-right);
 `),
      cE("input-mirror", `
 padding: 0;
 height: var(--n-height);
 line-height: var(--n-height);
 overflow: hidden;
 visibility: hidden;
 position: static;
 white-space: pre;
 pointer-events: none;
 `),
      cE("input-el", `
 padding: 0;
 height: var(--n-height);
 line-height: var(--n-height);
 `, [c$1("&[type=password]::-ms-reveal", "display: none;"), c$1("+", [cE("placeholder", `
 display: flex;
 align-items: center; 
 `)])]),
      cNotM("textarea", [cE("placeholder", "white-space: nowrap;")]),
      cE("eye", `
 display: flex;
 align-items: center;
 justify-content: center;
 transition: color .3s var(--n-bezier);
 `),
      // textarea
      cM("textarea", "width: 100%;", [cB("input-word-count", `
 position: absolute;
 right: var(--n-padding-right);
 bottom: var(--n-padding-vertical);
 `), cM("resizable", [cB("input-wrapper", `
 resize: vertical;
 min-height: var(--n-height);
 `)]), cE("textarea-el, textarea-mirror, placeholder", `
 height: 100%;
 padding-left: 0;
 padding-right: 0;
 padding-top: var(--n-padding-vertical);
 padding-bottom: var(--n-padding-vertical);
 word-break: break-word;
 display: inline-block;
 vertical-align: bottom;
 box-sizing: border-box;
 line-height: var(--n-line-height-textarea);
 margin: 0;
 resize: none;
 white-space: pre-wrap;
 scroll-padding-block-end: var(--n-padding-vertical);
 `), cE("textarea-mirror", `
 width: 100%;
 pointer-events: none;
 overflow: hidden;
 visibility: hidden;
 position: static;
 white-space: pre-wrap;
 overflow-wrap: break-word;
 `)]),
      // pair
      cM("pair", [cE("input-el, placeholder", "text-align: center;"), cE("separator", `
 display: flex;
 align-items: center;
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
 white-space: nowrap;
 `, [cB("icon", `
 color: var(--n-icon-color);
 `), cB("base-icon", `
 color: var(--n-icon-color);
 `)])]),
      cM("disabled", `
 cursor: not-allowed;
 background-color: var(--n-color-disabled);
 `, [cE("border", "border: var(--n-border-disabled);"), cE("input-el, textarea-el", `
 cursor: not-allowed;
 color: var(--n-text-color-disabled);
 text-decoration-color: var(--n-text-color-disabled);
 `), cE("placeholder", "color: var(--n-placeholder-color-disabled);"), cE("separator", "color: var(--n-text-color-disabled);", [cB("icon", `
 color: var(--n-icon-color-disabled);
 `), cB("base-icon", `
 color: var(--n-icon-color-disabled);
 `)]), cB("input-word-count", `
 color: var(--n-count-text-color-disabled);
 `), cE("suffix, prefix", "color: var(--n-text-color-disabled);", [cB("icon", `
 color: var(--n-icon-color-disabled);
 `), cB("internal-icon", `
 color: var(--n-icon-color-disabled);
 `)])]),
      cNotM("disabled", [cE("eye", `
 color: var(--n-icon-color);
 cursor: pointer;
 `, [c$1("&:hover", `
 color: var(--n-icon-color-hover);
 `), c$1("&:active", `
 color: var(--n-icon-color-pressed);
 `)]), c$1("&:hover", [cE("state-border", "border: var(--n-border-hover);")]), cM("focus", "background-color: var(--n-color-focus);", [cE("state-border", `
 border: var(--n-border-focus);
 box-shadow: var(--n-box-shadow-focus);
 `)])]),
      cE("border, state-border", `
 box-sizing: border-box;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 pointer-events: none;
 border-radius: inherit;
 border: var(--n-border);
 transition:
 box-shadow .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `),
      cE("state-border", `
 border-color: #0000;
 z-index: 1;
 `),
      cE("prefix", "margin-right: 4px;"),
      cE("suffix", `
 margin-left: 4px;
 `),
      cE("suffix, prefix", `
 transition: color .3s var(--n-bezier);
 flex-wrap: nowrap;
 flex-shrink: 0;
 line-height: var(--n-height);
 white-space: nowrap;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 color: var(--n-suffix-text-color);
 `, [cB("base-loading", `
 font-size: var(--n-icon-size);
 margin: 0 2px;
 color: var(--n-loading-color);
 `), cB("base-clear", `
 font-size: var(--n-icon-size);
 `, [cE("placeholder", [cB("base-icon", `
 transition: color .3s var(--n-bezier);
 color: var(--n-icon-color);
 font-size: var(--n-icon-size);
 `)])]), c$1(">", [cB("icon", `
 transition: color .3s var(--n-bezier);
 color: var(--n-icon-color);
 font-size: var(--n-icon-size);
 `)]), cB("base-icon", `
 font-size: var(--n-icon-size);
 `)]),
      cB("input-word-count", `
 pointer-events: none;
 line-height: 1.5;
 font-size: .85em;
 color: var(--n-count-text-color);
 transition: color .3s var(--n-bezier);
 margin-left: 4px;
 font-variant: tabular-nums;
 `),
      ["warning", "error"].map((status) => cM(`${status}-status`, [cNotM("disabled", [cB("base-loading", `
 color: var(--n-loading-color-${status})
 `), cE("input-el, textarea-el", `
 caret-color: var(--n-caret-color-${status});
 `), cE("state-border", `
 border: var(--n-border-${status});
 `), c$1("&:hover", [cE("state-border", `
 border: var(--n-border-hover-${status});
 `)]), c$1("&:focus", `
 background-color: var(--n-color-focus-${status});
 `, [cE("state-border", `
 box-shadow: var(--n-box-shadow-focus-${status});
 border: var(--n-border-focus-${status});
 `)]), cM("focus", `
 background-color: var(--n-color-focus-${status});
 `, [cE("state-border", `
 box-shadow: var(--n-box-shadow-focus-${status});
 border: var(--n-border-focus-${status});
 `)])])]))
    ]);
    const safariStyle = cB("input", [cM("disabled", [cE("input-el, textarea-el", `
 -webkit-text-fill-color: var(--n-text-color-disabled);
 `)])]);
    const inputProps = Object.assign(Object.assign({}, useTheme.props), {
      bordered: {
        type: Boolean,
        default: void 0
      },
      type: {
        type: String,
        default: "text"
      },
      placeholder: [Array, String],
      defaultValue: {
        type: [String, Array],
        default: null
      },
      value: [String, Array],
      disabled: {
        type: Boolean,
        default: void 0
      },
      size: String,
      rows: {
        type: [Number, String],
        default: 3
      },
      round: Boolean,
      minlength: [String, Number],
      maxlength: [String, Number],
      clearable: Boolean,
      autosize: {
        type: [Boolean, Object],
        default: false
      },
      pair: Boolean,
      separator: String,
      readonly: {
        type: [String, Boolean],
        default: false
      },
      passivelyActivated: Boolean,
      showPasswordOn: String,
      stateful: {
        type: Boolean,
        default: true
      },
      autofocus: Boolean,
      inputProps: Object,
      resizable: {
        type: Boolean,
        default: true
      },
      showCount: Boolean,
      loading: {
        type: Boolean,
        default: void 0
      },
      allowInput: Function,
      renderCount: Function,
      onMousedown: Function,
      onKeydown: Function,
      onKeyup: [Function, Array],
      onInput: [Function, Array],
      onFocus: [Function, Array],
      onBlur: [Function, Array],
      onClick: [Function, Array],
      onChange: [Function, Array],
      onClear: [Function, Array],
      countGraphemes: Function,
      status: String,
      "onUpdate:value": [Function, Array],
      onUpdateValue: [Function, Array],
      /** private */
      textDecoration: [String, Array],
      attrSize: {
        type: Number,
        default: 20
      },
      onInputBlur: [Function, Array],
      onInputFocus: [Function, Array],
      onDeactivate: [Function, Array],
      onActivate: [Function, Array],
      onWrapperFocus: [Function, Array],
      onWrapperBlur: [Function, Array],
      internalDeactivateOnEnter: Boolean,
      internalForceFocus: Boolean,
      internalLoadingBeforeSuffix: {
        type: Boolean,
        default: true
      },
      /** deprecated */
      showPasswordToggle: Boolean
    });
    const NInput = /* @__PURE__ */ defineComponent({
      name: "Input",
      props: inputProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          mergedBorderedRef,
          inlineThemeDisabled,
          mergedRtlRef
        } = useConfig(props);
        const themeRef = useTheme("Input", "-input", style$h, inputLight, props, mergedClsPrefixRef);
        if (isSafari) {
          useStyle("-input-safari", safariStyle, mergedClsPrefixRef);
        }
        const wrapperElRef = ref(null);
        const textareaElRef = ref(null);
        const textareaMirrorElRef = ref(null);
        const inputMirrorElRef = ref(null);
        const inputElRef = ref(null);
        const inputEl2Ref = ref(null);
        const currentFocusedInputRef = ref(null);
        const focusedInputCursorControl = useCursor(currentFocusedInputRef);
        const textareaScrollbarInstRef = ref(null);
        const {
          localeRef
        } = useLocale("Input");
        const uncontrolledValueRef = ref(props.defaultValue);
        const controlledValueRef = toRef(props, "value");
        const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
        const formItem = useFormItem(props);
        const {
          mergedSizeRef,
          mergedDisabledRef,
          mergedStatusRef
        } = formItem;
        const focusedRef = ref(false);
        const hoverRef = ref(false);
        const isComposingRef2 = ref(false);
        const activatedRef = ref(false);
        let syncSource = null;
        const mergedPlaceholderRef = computed(() => {
          const {
            placeholder,
            pair
          } = props;
          if (pair) {
            if (Array.isArray(placeholder)) {
              return placeholder;
            } else if (placeholder === void 0) {
              return ["", ""];
            }
            return [placeholder, placeholder];
          } else if (placeholder === void 0) {
            return [localeRef.value.placeholder];
          } else {
            return [placeholder];
          }
        });
        const showPlaceholder1Ref = computed(() => {
          const {
            value: isComposing
          } = isComposingRef2;
          const {
            value: mergedValue
          } = mergedValueRef;
          const {
            value: mergedPlaceholder
          } = mergedPlaceholderRef;
          return !isComposing && (isEmptyInputValue(mergedValue) || Array.isArray(mergedValue) && isEmptyInputValue(mergedValue[0])) && mergedPlaceholder[0];
        });
        const showPlaceholder2Ref = computed(() => {
          const {
            value: isComposing
          } = isComposingRef2;
          const {
            value: mergedValue
          } = mergedValueRef;
          const {
            value: mergedPlaceholder
          } = mergedPlaceholderRef;
          return !isComposing && mergedPlaceholder[1] && (isEmptyInputValue(mergedValue) || Array.isArray(mergedValue) && isEmptyInputValue(mergedValue[1]));
        });
        const mergedFocusRef = useMemo(() => {
          return props.internalForceFocus || focusedRef.value;
        });
        const showClearButton = useMemo(() => {
          if (mergedDisabledRef.value || props.readonly || !props.clearable || !mergedFocusRef.value && !hoverRef.value) {
            return false;
          }
          const {
            value: mergedValue
          } = mergedValueRef;
          const {
            value: mergedFocus
          } = mergedFocusRef;
          if (props.pair) {
            return !!(Array.isArray(mergedValue) && (mergedValue[0] || mergedValue[1])) && (hoverRef.value || mergedFocus);
          } else {
            return !!mergedValue && (hoverRef.value || mergedFocus);
          }
        });
        const mergedShowPasswordOnRef = computed(() => {
          const {
            showPasswordOn
          } = props;
          if (showPasswordOn) {
            return showPasswordOn;
          }
          if (props.showPasswordToggle) return "click";
          return void 0;
        });
        const passwordVisibleRef = ref(false);
        const textDecorationStyleRef = computed(() => {
          const {
            textDecoration
          } = props;
          if (!textDecoration) return ["", ""];
          if (Array.isArray(textDecoration)) {
            return textDecoration.map((v) => ({
              textDecoration: v
            }));
          }
          return [{
            textDecoration
          }];
        });
        const textAreaScrollContainerWidthRef = ref(void 0);
        const updateTextAreaStyle = () => {
          var _a, _b;
          if (props.type === "textarea") {
            const {
              autosize
            } = props;
            if (autosize) {
              textAreaScrollContainerWidthRef.value = (_b = (_a = textareaScrollbarInstRef.value) === null || _a === void 0 ? void 0 : _a.$el) === null || _b === void 0 ? void 0 : _b.offsetWidth;
            }
            if (!textareaElRef.value) return;
            if (typeof autosize === "boolean") return;
            const {
              paddingTop: stylePaddingTop,
              paddingBottom: stylePaddingBottom,
              lineHeight: styleLineHeight
            } = window.getComputedStyle(textareaElRef.value);
            const paddingTop = Number(stylePaddingTop.slice(0, -2));
            const paddingBottom = Number(stylePaddingBottom.slice(0, -2));
            const lineHeight2 = Number(styleLineHeight.slice(0, -2));
            const {
              value: textareaMirrorEl
            } = textareaMirrorElRef;
            if (!textareaMirrorEl) return;
            if (autosize.minRows) {
              const minRows = Math.max(autosize.minRows, 1);
              const styleMinHeight = `${paddingTop + paddingBottom + lineHeight2 * minRows}px`;
              textareaMirrorEl.style.minHeight = styleMinHeight;
            }
            if (autosize.maxRows) {
              const styleMaxHeight = `${paddingTop + paddingBottom + lineHeight2 * autosize.maxRows}px`;
              textareaMirrorEl.style.maxHeight = styleMaxHeight;
            }
          }
        };
        const maxlengthRef = computed(() => {
          const {
            maxlength
          } = props;
          return maxlength === void 0 ? void 0 : Number(maxlength);
        });
        onMounted(() => {
          const {
            value
          } = mergedValueRef;
          if (!Array.isArray(value)) {
            syncMirror(value);
          }
        });
        const vm = getCurrentInstance().proxy;
        function doUpdateValue(value, meta) {
          const {
            onUpdateValue,
            "onUpdate:value": _onUpdateValue,
            onInput
          } = props;
          const {
            nTriggerFormInput
          } = formItem;
          if (onUpdateValue) call(onUpdateValue, value, meta);
          if (_onUpdateValue) call(_onUpdateValue, value, meta);
          if (onInput) call(onInput, value, meta);
          uncontrolledValueRef.value = value;
          nTriggerFormInput();
        }
        function doChange(value, meta) {
          const {
            onChange
          } = props;
          const {
            nTriggerFormChange
          } = formItem;
          if (onChange) call(onChange, value, meta);
          uncontrolledValueRef.value = value;
          nTriggerFormChange();
        }
        function doBlur(e) {
          const {
            onBlur
          } = props;
          const {
            nTriggerFormBlur
          } = formItem;
          if (onBlur) call(onBlur, e);
          nTriggerFormBlur();
        }
        function doFocus(e) {
          const {
            onFocus
          } = props;
          const {
            nTriggerFormFocus
          } = formItem;
          if (onFocus) call(onFocus, e);
          nTriggerFormFocus();
        }
        function doClear(e) {
          const {
            onClear
          } = props;
          if (onClear) call(onClear, e);
        }
        function doUpdateValueBlur(e) {
          const {
            onInputBlur
          } = props;
          if (onInputBlur) call(onInputBlur, e);
        }
        function doUpdateValueFocus(e) {
          const {
            onInputFocus
          } = props;
          if (onInputFocus) call(onInputFocus, e);
        }
        function doDeactivate() {
          const {
            onDeactivate
          } = props;
          if (onDeactivate) call(onDeactivate);
        }
        function doActivate() {
          const {
            onActivate
          } = props;
          if (onActivate) call(onActivate);
        }
        function doClick(e) {
          const {
            onClick
          } = props;
          if (onClick) call(onClick, e);
        }
        function doWrapperFocus(e) {
          const {
            onWrapperFocus
          } = props;
          if (onWrapperFocus) call(onWrapperFocus, e);
        }
        function doWrapperBlur(e) {
          const {
            onWrapperBlur
          } = props;
          if (onWrapperBlur) call(onWrapperBlur, e);
        }
        function handleCompositionStart() {
          isComposingRef2.value = true;
        }
        function handleCompositionEnd(e) {
          isComposingRef2.value = false;
          if (e.target === inputEl2Ref.value) {
            handleInput(e, 1);
          } else {
            handleInput(e, 0);
          }
        }
        function handleInput(e, index = 0, event = "input") {
          const targetValue = e.target.value;
          syncMirror(targetValue);
          if (e instanceof InputEvent && !e.isComposing) {
            isComposingRef2.value = false;
          }
          if (props.type === "textarea") {
            const {
              value: textareaScrollbarInst
            } = textareaScrollbarInstRef;
            if (textareaScrollbarInst) {
              textareaScrollbarInst.syncUnifiedContainer();
            }
          }
          syncSource = targetValue;
          if (isComposingRef2.value) return;
          focusedInputCursorControl.recordCursor();
          const isIncomingValueValid = allowInput(targetValue);
          if (isIncomingValueValid) {
            if (!props.pair) {
              if (event === "input") {
                doUpdateValue(targetValue, {
                  source: index
                });
              } else {
                doChange(targetValue, {
                  source: index
                });
              }
            } else {
              let {
                value
              } = mergedValueRef;
              if (!Array.isArray(value)) {
                value = ["", ""];
              } else {
                value = [value[0], value[1]];
              }
              value[index] = targetValue;
              if (event === "input") {
                doUpdateValue(value, {
                  source: index
                });
              } else {
                doChange(value, {
                  source: index
                });
              }
            }
          }
          vm.$forceUpdate();
          if (!isIncomingValueValid) {
            void nextTick(focusedInputCursorControl.restoreCursor);
          }
        }
        function allowInput(value) {
          const {
            countGraphemes,
            maxlength,
            minlength
          } = props;
          if (countGraphemes) {
            let graphemesCount;
            if (maxlength !== void 0) {
              if (graphemesCount === void 0) {
                graphemesCount = countGraphemes(value);
              }
              if (graphemesCount > Number(maxlength)) return false;
            }
            if (minlength !== void 0) {
              if (graphemesCount === void 0) {
                graphemesCount = countGraphemes(value);
              }
              if (graphemesCount < Number(maxlength)) return false;
            }
          }
          const {
            allowInput: allowInput2
          } = props;
          if (typeof allowInput2 === "function") {
            return allowInput2(value);
          }
          return true;
        }
        function handleInputBlur(e) {
          doUpdateValueBlur(e);
          if (e.relatedTarget === wrapperElRef.value) {
            doDeactivate();
          }
          if (!(e.relatedTarget !== null && (e.relatedTarget === inputElRef.value || e.relatedTarget === inputEl2Ref.value || e.relatedTarget === textareaElRef.value))) {
            activatedRef.value = false;
          }
          dealWithEvent(e, "blur");
          currentFocusedInputRef.value = null;
        }
        function handleInputFocus(e, index) {
          doUpdateValueFocus(e);
          focusedRef.value = true;
          activatedRef.value = true;
          doActivate();
          dealWithEvent(e, "focus");
          if (index === 0) {
            currentFocusedInputRef.value = inputElRef.value;
          } else if (index === 1) {
            currentFocusedInputRef.value = inputEl2Ref.value;
          } else if (index === 2) {
            currentFocusedInputRef.value = textareaElRef.value;
          }
        }
        function handleWrapperBlur(e) {
          if (props.passivelyActivated) {
            doWrapperBlur(e);
            dealWithEvent(e, "blur");
          }
        }
        function handleWrapperFocus(e) {
          if (props.passivelyActivated) {
            focusedRef.value = true;
            doWrapperFocus(e);
            dealWithEvent(e, "focus");
          }
        }
        function dealWithEvent(e, type) {
          if (e.relatedTarget !== null && (e.relatedTarget === inputElRef.value || e.relatedTarget === inputEl2Ref.value || e.relatedTarget === textareaElRef.value || e.relatedTarget === wrapperElRef.value)) ;
          else {
            if (type === "focus") {
              doFocus(e);
              focusedRef.value = true;
            } else if (type === "blur") {
              doBlur(e);
              focusedRef.value = false;
            }
          }
        }
        function handleChange(e, index) {
          handleInput(e, index, "change");
        }
        function handleClick2(e) {
          doClick(e);
        }
        function handleClear(e) {
          doClear(e);
          clearValue();
        }
        function clearValue() {
          if (props.pair) {
            doUpdateValue(["", ""], {
              source: "clear"
            });
            doChange(["", ""], {
              source: "clear"
            });
          } else {
            doUpdateValue("", {
              source: "clear"
            });
            doChange("", {
              source: "clear"
            });
          }
        }
        function handleMouseDown(e) {
          const {
            onMousedown
          } = props;
          if (onMousedown) onMousedown(e);
          const {
            tagName
          } = e.target;
          if (tagName !== "INPUT" && tagName !== "TEXTAREA") {
            if (props.resizable) {
              const {
                value: wrapperEl
              } = wrapperElRef;
              if (wrapperEl) {
                const {
                  left,
                  top,
                  width,
                  height
                } = wrapperEl.getBoundingClientRect();
                const resizeHandleSize = 14;
                if (left + width - resizeHandleSize < e.clientX && e.clientX < left + width && top + height - resizeHandleSize < e.clientY && e.clientY < top + height) {
                  return;
                }
              }
            }
            e.preventDefault();
            if (!focusedRef.value) {
              focus();
            }
          }
        }
        function handleMouseEnter() {
          var _a;
          hoverRef.value = true;
          if (props.type === "textarea") {
            (_a = textareaScrollbarInstRef.value) === null || _a === void 0 ? void 0 : _a.handleMouseEnterWrapper();
          }
        }
        function handleMouseLeave() {
          var _a;
          hoverRef.value = false;
          if (props.type === "textarea") {
            (_a = textareaScrollbarInstRef.value) === null || _a === void 0 ? void 0 : _a.handleMouseLeaveWrapper();
          }
        }
        function handlePasswordToggleClick() {
          if (mergedDisabledRef.value) return;
          if (mergedShowPasswordOnRef.value !== "click") return;
          passwordVisibleRef.value = !passwordVisibleRef.value;
        }
        function handlePasswordToggleMousedown(e) {
          if (mergedDisabledRef.value) return;
          e.preventDefault();
          const preventDefaultOnce = (e2) => {
            e2.preventDefault();
            off("mouseup", document, preventDefaultOnce);
          };
          on("mouseup", document, preventDefaultOnce);
          if (mergedShowPasswordOnRef.value !== "mousedown") return;
          passwordVisibleRef.value = true;
          const hidePassword = () => {
            passwordVisibleRef.value = false;
            off("mouseup", document, hidePassword);
          };
          on("mouseup", document, hidePassword);
        }
        function handleWrapperKeyup(e) {
          if (props.onKeyup) call(props.onKeyup, e);
        }
        function handleWrapperKeydown(e) {
          if (props.onKeydown) call(props.onKeydown, e);
          switch (e.key) {
            case "Escape":
              handleWrapperKeydownEsc();
              break;
            case "Enter":
              handleWrapperKeydownEnter(e);
              break;
          }
        }
        function handleWrapperKeydownEnter(e) {
          var _a, _b;
          if (props.passivelyActivated) {
            const {
              value: focused
            } = activatedRef;
            if (focused) {
              if (props.internalDeactivateOnEnter) {
                handleWrapperKeydownEsc();
              }
              return;
            }
            e.preventDefault();
            if (props.type === "textarea") {
              (_a = textareaElRef.value) === null || _a === void 0 ? void 0 : _a.focus();
            } else {
              (_b = inputElRef.value) === null || _b === void 0 ? void 0 : _b.focus();
            }
          }
        }
        function handleWrapperKeydownEsc() {
          if (props.passivelyActivated) {
            activatedRef.value = false;
            void nextTick(() => {
              var _a;
              (_a = wrapperElRef.value) === null || _a === void 0 ? void 0 : _a.focus();
            });
          }
        }
        function focus() {
          var _a, _b, _c;
          if (mergedDisabledRef.value) return;
          if (props.passivelyActivated) {
            (_a = wrapperElRef.value) === null || _a === void 0 ? void 0 : _a.focus();
          } else {
            (_b = textareaElRef.value) === null || _b === void 0 ? void 0 : _b.focus();
            (_c = inputElRef.value) === null || _c === void 0 ? void 0 : _c.focus();
          }
        }
        function blur() {
          var _a;
          if ((_a = wrapperElRef.value) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement)) {
            document.activeElement.blur();
          }
        }
        function select() {
          var _a, _b;
          (_a = textareaElRef.value) === null || _a === void 0 ? void 0 : _a.select();
          (_b = inputElRef.value) === null || _b === void 0 ? void 0 : _b.select();
        }
        function activate() {
          if (mergedDisabledRef.value) return;
          if (textareaElRef.value) textareaElRef.value.focus();
          else if (inputElRef.value) inputElRef.value.focus();
        }
        function deactivate() {
          const {
            value: wrapperEl
          } = wrapperElRef;
          if ((wrapperEl === null || wrapperEl === void 0 ? void 0 : wrapperEl.contains(document.activeElement)) && wrapperEl !== document.activeElement) {
            handleWrapperKeydownEsc();
          }
        }
        function scrollTo(options) {
          if (props.type === "textarea") {
            const {
              value: textareaEl
            } = textareaElRef;
            textareaEl === null || textareaEl === void 0 ? void 0 : textareaEl.scrollTo(options);
          } else {
            const {
              value: inputEl
            } = inputElRef;
            inputEl === null || inputEl === void 0 ? void 0 : inputEl.scrollTo(options);
          }
        }
        function syncMirror(value) {
          const {
            type,
            pair,
            autosize
          } = props;
          if (!pair && autosize) {
            if (type === "textarea") {
              const {
                value: textareaMirrorEl
              } = textareaMirrorElRef;
              if (textareaMirrorEl) {
                textareaMirrorEl.textContent = `${value !== null && value !== void 0 ? value : ""}\r
`;
              }
            } else {
              const {
                value: inputMirrorEl
              } = inputMirrorElRef;
              if (inputMirrorEl) {
                if (value) {
                  inputMirrorEl.textContent = value;
                } else {
                  inputMirrorEl.innerHTML = "&nbsp;";
                }
              }
            }
          }
        }
        function handleTextAreaMirrorResize() {
          updateTextAreaStyle();
        }
        const placeholderStyleRef = ref({
          top: "0"
        });
        function handleTextAreaScroll(e) {
          var _a;
          const {
            scrollTop
          } = e.target;
          placeholderStyleRef.value.top = `${-scrollTop}px`;
          (_a = textareaScrollbarInstRef.value) === null || _a === void 0 ? void 0 : _a.syncUnifiedContainer();
        }
        let stopWatchMergedValue1 = null;
        watchEffect(() => {
          const {
            autosize,
            type
          } = props;
          if (autosize && type === "textarea") {
            stopWatchMergedValue1 = watch(mergedValueRef, (value) => {
              if (!Array.isArray(value) && value !== syncSource) {
                syncMirror(value);
              }
            });
          } else {
            stopWatchMergedValue1 === null || stopWatchMergedValue1 === void 0 ? void 0 : stopWatchMergedValue1();
          }
        });
        let stopWatchMergedValue2 = null;
        watchEffect(() => {
          if (props.type === "textarea") {
            stopWatchMergedValue2 = watch(mergedValueRef, (value) => {
              var _a;
              if (!Array.isArray(value) && value !== syncSource) {
                (_a = textareaScrollbarInstRef.value) === null || _a === void 0 ? void 0 : _a.syncUnifiedContainer();
              }
            });
          } else {
            stopWatchMergedValue2 === null || stopWatchMergedValue2 === void 0 ? void 0 : stopWatchMergedValue2();
          }
        });
        provide(inputInjectionKey, {
          mergedValueRef,
          maxlengthRef,
          mergedClsPrefixRef,
          countGraphemesRef: toRef(props, "countGraphemes")
        });
        const exposedProps = {
          wrapperElRef,
          inputElRef,
          textareaElRef,
          isCompositing: isComposingRef2,
          clear: clearValue,
          focus,
          blur,
          select,
          deactivate,
          activate,
          scrollTo
        };
        const rtlEnabledRef = useRtl("Input", mergedRtlRef, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            value: size2
          } = mergedSizeRef;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              color,
              borderRadius,
              textColor,
              caretColor,
              caretColorError,
              caretColorWarning,
              textDecorationColor,
              border,
              borderDisabled,
              borderHover,
              borderFocus,
              placeholderColor,
              placeholderColorDisabled,
              lineHeightTextarea,
              colorDisabled,
              colorFocus,
              textColorDisabled,
              boxShadowFocus,
              iconSize,
              colorFocusWarning,
              boxShadowFocusWarning,
              borderWarning,
              borderFocusWarning,
              borderHoverWarning,
              colorFocusError,
              boxShadowFocusError,
              borderError,
              borderFocusError,
              borderHoverError,
              clearSize,
              clearColor,
              clearColorHover,
              clearColorPressed,
              iconColor,
              iconColorDisabled,
              suffixTextColor,
              countTextColor,
              countTextColorDisabled,
              iconColorHover,
              iconColorPressed,
              loadingColor,
              loadingColorError,
              loadingColorWarning,
              [createKey("padding", size2)]: padding,
              [createKey("fontSize", size2)]: fontSize2,
              [createKey("height", size2)]: height
            }
          } = themeRef.value;
          const {
            left: paddingLeft,
            right: paddingRight
          } = getMargin(padding);
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-count-text-color": countTextColor,
            "--n-count-text-color-disabled": countTextColorDisabled,
            "--n-color": color,
            "--n-font-size": fontSize2,
            "--n-border-radius": borderRadius,
            "--n-height": height,
            "--n-padding-left": paddingLeft,
            "--n-padding-right": paddingRight,
            "--n-text-color": textColor,
            "--n-caret-color": caretColor,
            "--n-text-decoration-color": textDecorationColor,
            "--n-border": border,
            "--n-border-disabled": borderDisabled,
            "--n-border-hover": borderHover,
            "--n-border-focus": borderFocus,
            "--n-placeholder-color": placeholderColor,
            "--n-placeholder-color-disabled": placeholderColorDisabled,
            "--n-icon-size": iconSize,
            "--n-line-height-textarea": lineHeightTextarea,
            "--n-color-disabled": colorDisabled,
            "--n-color-focus": colorFocus,
            "--n-text-color-disabled": textColorDisabled,
            "--n-box-shadow-focus": boxShadowFocus,
            "--n-loading-color": loadingColor,
            // form warning
            "--n-caret-color-warning": caretColorWarning,
            "--n-color-focus-warning": colorFocusWarning,
            "--n-box-shadow-focus-warning": boxShadowFocusWarning,
            "--n-border-warning": borderWarning,
            "--n-border-focus-warning": borderFocusWarning,
            "--n-border-hover-warning": borderHoverWarning,
            "--n-loading-color-warning": loadingColorWarning,
            // form error
            "--n-caret-color-error": caretColorError,
            "--n-color-focus-error": colorFocusError,
            "--n-box-shadow-focus-error": boxShadowFocusError,
            "--n-border-error": borderError,
            "--n-border-focus-error": borderFocusError,
            "--n-border-hover-error": borderHoverError,
            "--n-loading-color-error": loadingColorError,
            // clear-button
            "--n-clear-color": clearColor,
            "--n-clear-size": clearSize,
            "--n-clear-color-hover": clearColorHover,
            "--n-clear-color-pressed": clearColorPressed,
            "--n-icon-color": iconColor,
            "--n-icon-color-hover": iconColorHover,
            "--n-icon-color-pressed": iconColorPressed,
            "--n-icon-color-disabled": iconColorDisabled,
            "--n-suffix-text-color": suffixTextColor
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("input", computed(() => {
          const {
            value: size2
          } = mergedSizeRef;
          return size2[0];
        }), cssVarsRef, props) : void 0;
        return Object.assign(Object.assign({}, exposedProps), {
          // DOM ref
          wrapperElRef,
          inputElRef,
          inputMirrorElRef,
          inputEl2Ref,
          textareaElRef,
          textareaMirrorElRef,
          textareaScrollbarInstRef,
          // value
          rtlEnabled: rtlEnabledRef,
          uncontrolledValue: uncontrolledValueRef,
          mergedValue: mergedValueRef,
          passwordVisible: passwordVisibleRef,
          mergedPlaceholder: mergedPlaceholderRef,
          showPlaceholder1: showPlaceholder1Ref,
          showPlaceholder2: showPlaceholder2Ref,
          mergedFocus: mergedFocusRef,
          isComposing: isComposingRef2,
          activated: activatedRef,
          showClearButton,
          mergedSize: mergedSizeRef,
          mergedDisabled: mergedDisabledRef,
          textDecorationStyle: textDecorationStyleRef,
          mergedClsPrefix: mergedClsPrefixRef,
          mergedBordered: mergedBorderedRef,
          mergedShowPasswordOn: mergedShowPasswordOnRef,
          placeholderStyle: placeholderStyleRef,
          mergedStatus: mergedStatusRef,
          textAreaScrollContainerWidth: textAreaScrollContainerWidthRef,
          // methods
          handleTextAreaScroll,
          handleCompositionStart,
          handleCompositionEnd,
          handleInput,
          handleInputBlur,
          handleInputFocus,
          handleWrapperBlur,
          handleWrapperFocus,
          handleMouseEnter,
          handleMouseLeave,
          handleMouseDown,
          handleChange,
          handleClick: handleClick2,
          handleClear,
          handlePasswordToggleClick,
          handlePasswordToggleMousedown,
          handleWrapperKeydown,
          handleWrapperKeyup,
          handleTextAreaMirrorResize,
          getTextareaScrollContainer: () => {
            return textareaElRef.value;
          },
          mergedTheme: themeRef,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        });
      },
      render() {
        var _a, _b;
        const {
          mergedClsPrefix,
          mergedStatus,
          themeClass,
          type,
          countGraphemes,
          onRender
        } = this;
        const $slots = this.$slots;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h("div", {
          ref: "wrapperElRef",
          class: [`${mergedClsPrefix}-input`, themeClass, mergedStatus && `${mergedClsPrefix}-input--${mergedStatus}-status`, {
            [`${mergedClsPrefix}-input--rtl`]: this.rtlEnabled,
            [`${mergedClsPrefix}-input--disabled`]: this.mergedDisabled,
            [`${mergedClsPrefix}-input--textarea`]: type === "textarea",
            [`${mergedClsPrefix}-input--resizable`]: this.resizable && !this.autosize,
            [`${mergedClsPrefix}-input--autosize`]: this.autosize,
            [`${mergedClsPrefix}-input--round`]: this.round && !(type === "textarea"),
            [`${mergedClsPrefix}-input--pair`]: this.pair,
            [`${mergedClsPrefix}-input--focus`]: this.mergedFocus,
            [`${mergedClsPrefix}-input--stateful`]: this.stateful
          }],
          style: this.cssVars,
          tabindex: !this.mergedDisabled && this.passivelyActivated && !this.activated ? 0 : void 0,
          onFocus: this.handleWrapperFocus,
          onBlur: this.handleWrapperBlur,
          onClick: this.handleClick,
          onMousedown: this.handleMouseDown,
          onMouseenter: this.handleMouseEnter,
          onMouseleave: this.handleMouseLeave,
          onCompositionstart: this.handleCompositionStart,
          onCompositionend: this.handleCompositionEnd,
          onKeyup: this.handleWrapperKeyup,
          onKeydown: this.handleWrapperKeydown
        }, h("div", {
          class: `${mergedClsPrefix}-input-wrapper`
        }, resolveWrappedSlot($slots.prefix, (children) => children && h("div", {
          class: `${mergedClsPrefix}-input__prefix`
        }, children)), type === "textarea" ? h(Scrollbar, {
          ref: "textareaScrollbarInstRef",
          class: `${mergedClsPrefix}-input__textarea`,
          container: this.getTextareaScrollContainer,
          triggerDisplayManually: true,
          useUnifiedContainer: true,
          internalHoistYRail: true
        }, {
          default: () => {
            var _a2, _b2;
            const {
              textAreaScrollContainerWidth
            } = this;
            const scrollContainerWidthStyle = {
              width: this.autosize && textAreaScrollContainerWidth && `${textAreaScrollContainerWidth}px`
            };
            return h(Fragment, null, h("textarea", Object.assign({}, this.inputProps, {
              ref: "textareaElRef",
              class: [`${mergedClsPrefix}-input__textarea-el`, (_a2 = this.inputProps) === null || _a2 === void 0 ? void 0 : _a2.class],
              autofocus: this.autofocus,
              rows: Number(this.rows),
              placeholder: this.placeholder,
              value: this.mergedValue,
              disabled: this.mergedDisabled,
              maxlength: countGraphemes ? void 0 : this.maxlength,
              minlength: countGraphemes ? void 0 : this.minlength,
              readonly: this.readonly,
              tabindex: this.passivelyActivated && !this.activated ? -1 : void 0,
              style: [this.textDecorationStyle[0], (_b2 = this.inputProps) === null || _b2 === void 0 ? void 0 : _b2.style, scrollContainerWidthStyle],
              onBlur: this.handleInputBlur,
              onFocus: (e) => {
                this.handleInputFocus(e, 2);
              },
              onInput: this.handleInput,
              onChange: this.handleChange,
              onScroll: this.handleTextAreaScroll
            })), this.showPlaceholder1 ? h("div", {
              class: `${mergedClsPrefix}-input__placeholder`,
              style: [this.placeholderStyle, scrollContainerWidthStyle],
              key: "placeholder"
            }, this.mergedPlaceholder[0]) : null, this.autosize ? h(VResizeObserver, {
              onResize: this.handleTextAreaMirrorResize
            }, {
              default: () => h("div", {
                ref: "textareaMirrorElRef",
                class: `${mergedClsPrefix}-input__textarea-mirror`,
                key: "mirror"
              })
            }) : null);
          }
        }) : h("div", {
          class: `${mergedClsPrefix}-input__input`
        }, h("input", Object.assign({
          type: type === "password" && this.mergedShowPasswordOn && this.passwordVisible ? "text" : type
        }, this.inputProps, {
          ref: "inputElRef",
          class: [`${mergedClsPrefix}-input__input-el`, (_a = this.inputProps) === null || _a === void 0 ? void 0 : _a.class],
          style: [this.textDecorationStyle[0], (_b = this.inputProps) === null || _b === void 0 ? void 0 : _b.style],
          tabindex: this.passivelyActivated && !this.activated ? -1 : void 0,
          placeholder: this.mergedPlaceholder[0],
          disabled: this.mergedDisabled,
          maxlength: countGraphemes ? void 0 : this.maxlength,
          minlength: countGraphemes ? void 0 : this.minlength,
          value: Array.isArray(this.mergedValue) ? this.mergedValue[0] : this.mergedValue,
          readonly: this.readonly,
          autofocus: this.autofocus,
          size: this.attrSize,
          onBlur: this.handleInputBlur,
          onFocus: (e) => {
            this.handleInputFocus(e, 0);
          },
          onInput: (e) => {
            this.handleInput(e, 0);
          },
          onChange: (e) => {
            this.handleChange(e, 0);
          }
        })), this.showPlaceholder1 ? h("div", {
          class: `${mergedClsPrefix}-input__placeholder`
        }, h("span", null, this.mergedPlaceholder[0])) : null, this.autosize ? h("div", {
          class: `${mergedClsPrefix}-input__input-mirror`,
          key: "mirror",
          ref: "inputMirrorElRef"
        }, " ") : null), !this.pair && resolveWrappedSlot($slots.suffix, (children) => {
          return children || this.clearable || this.showCount || this.mergedShowPasswordOn || this.loading !== void 0 ? h("div", {
            class: `${mergedClsPrefix}-input__suffix`
          }, [resolveWrappedSlot($slots["clear-icon-placeholder"], (children2) => {
            return (this.clearable || children2) && h(NBaseClear, {
              clsPrefix: mergedClsPrefix,
              show: this.showClearButton,
              onClear: this.handleClear
            }, {
              placeholder: () => children2,
              icon: () => {
                var _a2, _b2;
                return (_b2 = (_a2 = this.$slots)["clear-icon"]) === null || _b2 === void 0 ? void 0 : _b2.call(_a2);
              }
            });
          }), !this.internalLoadingBeforeSuffix ? children : null, this.loading !== void 0 ? h(NBaseSuffix, {
            clsPrefix: mergedClsPrefix,
            loading: this.loading,
            showArrow: false,
            showClear: false,
            style: this.cssVars
          }) : null, this.internalLoadingBeforeSuffix ? children : null, this.showCount && this.type !== "textarea" ? h(WordCount, null, {
            default: (props) => {
              var _a2;
              return (_a2 = $slots.count) === null || _a2 === void 0 ? void 0 : _a2.call($slots, props);
            }
          }) : null, this.mergedShowPasswordOn && this.type === "password" ? h("div", {
            class: `${mergedClsPrefix}-input__eye`,
            onMousedown: this.handlePasswordToggleMousedown,
            onClick: this.handlePasswordToggleClick
          }, this.passwordVisible ? resolveSlot($slots["password-visible-icon"], () => [h(NBaseIcon, {
            clsPrefix: mergedClsPrefix
          }, {
            default: () => h(EyeIcon, null)
          })]) : resolveSlot($slots["password-invisible-icon"], () => [h(NBaseIcon, {
            clsPrefix: mergedClsPrefix
          }, {
            default: () => h(EyeOffIcon, null)
          })])) : null]) : null;
        })), this.pair ? h("span", {
          class: `${mergedClsPrefix}-input__separator`
        }, resolveSlot($slots.separator, () => [this.separator])) : null, this.pair ? h("div", {
          class: `${mergedClsPrefix}-input-wrapper`
        }, h("div", {
          class: `${mergedClsPrefix}-input__input`
        }, h("input", {
          ref: "inputEl2Ref",
          type: this.type,
          class: `${mergedClsPrefix}-input__input-el`,
          tabindex: this.passivelyActivated && !this.activated ? -1 : void 0,
          placeholder: this.mergedPlaceholder[1],
          disabled: this.mergedDisabled,
          maxlength: countGraphemes ? void 0 : this.maxlength,
          minlength: countGraphemes ? void 0 : this.minlength,
          value: Array.isArray(this.mergedValue) ? this.mergedValue[1] : void 0,
          readonly: this.readonly,
          style: this.textDecorationStyle[1],
          onBlur: this.handleInputBlur,
          onFocus: (e) => {
            this.handleInputFocus(e, 1);
          },
          onInput: (e) => {
            this.handleInput(e, 1);
          },
          onChange: (e) => {
            this.handleChange(e, 1);
          }
        }), this.showPlaceholder2 ? h("div", {
          class: `${mergedClsPrefix}-input__placeholder`
        }, h("span", null, this.mergedPlaceholder[1])) : null), resolveWrappedSlot($slots.suffix, (children) => {
          return (this.clearable || children) && h("div", {
            class: `${mergedClsPrefix}-input__suffix`
          }, [this.clearable && h(NBaseClear, {
            clsPrefix: mergedClsPrefix,
            show: this.showClearButton,
            onClear: this.handleClear
          }, {
            icon: () => {
              var _a2;
              return (_a2 = $slots["clear-icon"]) === null || _a2 === void 0 ? void 0 : _a2.call($slots);
            },
            placeholder: () => {
              var _a2;
              return (_a2 = $slots["clear-icon-placeholder"]) === null || _a2 === void 0 ? void 0 : _a2.call($slots);
            }
          }), children]);
        })) : null, this.mergedBordered ? h("div", {
          class: `${mergedClsPrefix}-input__border`
        }) : null, this.mergedBordered ? h("div", {
          class: `${mergedClsPrefix}-input__state-border`
        }) : null, this.showCount && type === "textarea" ? h(WordCount, null, {
          default: (props) => {
            var _a2;
            const {
              renderCount
            } = this;
            if (renderCount) {
              return renderCount(props);
            }
            return (_a2 = $slots.count) === null || _a2 === void 0 ? void 0 : _a2.call($slots, props);
          }
        }) : null);
      }
    });
    function self$Q(vars) {
      const {
        boxShadow2
      } = vars;
      return {
        menuBoxShadow: boxShadow2
      };
    }
    const autoCompleteDark = {
      name: "AutoComplete",
      common: derived$1,
      peers: {
        InternalSelectMenu: internalSelectMenuDark,
        Input: inputDark
      },
      self: self$Q
    };
    const isImageSupportNativeLazy = isBrowser$2 && "loading" in document.createElement("img");
    function resolveOptionsAndHash(options = {}) {
      var _a;
      const {
        root: root2 = null
      } = options;
      return {
        hash: `${options.rootMargin || "0px 0px 0px 0px"}-${Array.isArray(options.threshold) ? options.threshold.join(",") : (_a = options.threshold) !== null && _a !== void 0 ? _a : "0"}`,
        options: Object.assign(Object.assign({}, options), {
          root: (typeof root2 === "string" ? document.querySelector(root2) : root2) || document.documentElement
        })
      };
    }
    const observers = /* @__PURE__ */ new WeakMap();
    const unobserveHandleMap = /* @__PURE__ */ new WeakMap();
    const shouldStartLoadingRefMap = /* @__PURE__ */ new WeakMap();
    const observeIntersection = (el, options, shouldStartLoadingRef) => {
      if (!el) return () => {
      };
      const resolvedOptionsAndHash = resolveOptionsAndHash(options);
      const {
        root: root2
      } = resolvedOptionsAndHash.options;
      let rootObservers;
      const _rootObservers = observers.get(root2);
      if (_rootObservers) {
        rootObservers = _rootObservers;
      } else {
        rootObservers = /* @__PURE__ */ new Map();
        observers.set(root2, rootObservers);
      }
      let observer;
      let observerAndObservedElements;
      if (rootObservers.has(resolvedOptionsAndHash.hash)) {
        observerAndObservedElements = rootObservers.get(resolvedOptionsAndHash.hash);
        if (!observerAndObservedElements[1].has(el)) {
          observer = observerAndObservedElements[0];
          observerAndObservedElements[1].add(el);
          observer.observe(el);
        }
      } else {
        observer = new IntersectionObserver((entries) => {
          entries.forEach((entry) => {
            if (entry.isIntersecting) {
              const _unobserve = unobserveHandleMap.get(entry.target);
              const _shouldStartLoadingRef = shouldStartLoadingRefMap.get(entry.target);
              if (_unobserve) _unobserve();
              if (_shouldStartLoadingRef) {
                _shouldStartLoadingRef.value = true;
              }
            }
          });
        }, resolvedOptionsAndHash.options);
        observer.observe(el);
        observerAndObservedElements = [observer, /* @__PURE__ */ new Set([el])];
        rootObservers.set(resolvedOptionsAndHash.hash, observerAndObservedElements);
      }
      let unobservered = false;
      const unobserve = () => {
        if (unobservered) return;
        unobserveHandleMap.delete(el);
        shouldStartLoadingRefMap.delete(el);
        unobservered = true;
        if (observerAndObservedElements[1].has(el)) {
          observerAndObservedElements[0].unobserve(el);
          observerAndObservedElements[1].delete(el);
        }
        if (observerAndObservedElements[1].size <= 0) {
          rootObservers.delete(resolvedOptionsAndHash.hash);
        }
        if (!rootObservers.size) {
          observers.delete(root2);
        }
      };
      unobserveHandleMap.set(el, unobserve);
      shouldStartLoadingRefMap.set(el, shouldStartLoadingRef);
      return unobserve;
    };
    function self$P(vars) {
      const {
        borderRadius,
        avatarColor,
        cardColor,
        fontSize: fontSize2,
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        heightHuge,
        modalColor,
        popoverColor
      } = vars;
      return {
        borderRadius,
        fontSize: fontSize2,
        border: `2px solid ${cardColor}`,
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        heightHuge,
        color: composite(cardColor, avatarColor),
        colorModal: composite(modalColor, avatarColor),
        colorPopover: composite(popoverColor, avatarColor)
      };
    }
    const avatarDark = {
      name: "Avatar",
      common: derived$1,
      self: self$P
    };
    function self$O() {
      return {
        gap: "-12px"
      };
    }
    const avatarGroupDark = {
      name: "AvatarGroup",
      common: derived$1,
      peers: {
        Avatar: avatarDark
      },
      self: self$O
    };
    const commonVariables$h = {
      width: "44px",
      height: "44px",
      borderRadius: "22px",
      iconSize: "26px"
    };
    const backTopDark = {
      name: "BackTop",
      common: derived$1,
      self(vars) {
        const {
          popoverColor,
          textColor2,
          primaryColorHover,
          primaryColorPressed
        } = vars;
        return Object.assign(Object.assign({}, commonVariables$h), {
          color: popoverColor,
          textColor: textColor2,
          iconColor: textColor2,
          iconColorHover: primaryColorHover,
          iconColorPressed: primaryColorPressed,
          boxShadow: "0 2px 8px 0px rgba(0, 0, 0, .12)",
          boxShadowHover: "0 2px 12px 0px rgba(0, 0, 0, .18)",
          boxShadowPressed: "0 2px 12px 0px rgba(0, 0, 0, .18)"
        });
      }
    };
    const badgeDark = {
      name: "Badge",
      common: derived$1,
      self(vars) {
        const {
          errorColorSuppl,
          infoColorSuppl,
          successColorSuppl,
          warningColorSuppl,
          fontFamily: fontFamily2
        } = vars;
        return {
          color: errorColorSuppl,
          colorInfo: infoColorSuppl,
          colorSuccess: successColorSuppl,
          colorError: errorColorSuppl,
          colorWarning: warningColorSuppl,
          fontSize: "12px",
          fontFamily: fontFamily2
        };
      }
    };
    const commonVariables$g = {
      fontWeightActive: "400"
    };
    function self$N(vars) {
      const {
        fontSize: fontSize2,
        textColor3,
        textColor2,
        borderRadius,
        buttonColor2Hover,
        buttonColor2Pressed
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$g), {
        fontSize: fontSize2,
        itemLineHeight: "1.25",
        itemTextColor: textColor3,
        itemTextColorHover: textColor2,
        itemTextColorPressed: textColor2,
        itemTextColorActive: textColor2,
        itemBorderRadius: borderRadius,
        itemColorHover: buttonColor2Hover,
        itemColorPressed: buttonColor2Pressed,
        separatorColor: textColor3
      });
    }
    const breadcrumbDark = {
      name: "Breadcrumb",
      common: derived$1,
      self: self$N
    };
    function createHoverColor(rgb) {
      return composite(rgb, [255, 255, 255, 0.16]);
    }
    function createPressedColor(rgb) {
      return composite(rgb, [0, 0, 0, 0.12]);
    }
    const buttonGroupInjectionKey = createInjectionKey("n-button-group");
    const commonVariables$f = {
      paddingTiny: "0 6px",
      paddingSmall: "0 10px",
      paddingMedium: "0 14px",
      paddingLarge: "0 18px",
      paddingRoundTiny: "0 10px",
      paddingRoundSmall: "0 14px",
      paddingRoundMedium: "0 18px",
      paddingRoundLarge: "0 22px",
      iconMarginTiny: "6px",
      iconMarginSmall: "6px",
      iconMarginMedium: "6px",
      iconMarginLarge: "6px",
      iconSizeTiny: "14px",
      iconSizeSmall: "18px",
      iconSizeMedium: "18px",
      iconSizeLarge: "20px",
      rippleDuration: ".6s"
    };
    function self$M(vars) {
      const {
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        borderRadius,
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        opacityDisabled,
        textColor2,
        textColor3,
        primaryColorHover,
        primaryColorPressed,
        borderColor,
        primaryColor,
        baseColor,
        infoColor,
        infoColorHover,
        infoColorPressed,
        successColor,
        successColorHover,
        successColorPressed,
        warningColor,
        warningColorHover,
        warningColorPressed,
        errorColor,
        errorColorHover,
        errorColorPressed,
        fontWeight,
        buttonColor2,
        buttonColor2Hover,
        buttonColor2Pressed,
        fontWeightStrong
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$f), {
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        borderRadiusTiny: borderRadius,
        borderRadiusSmall: borderRadius,
        borderRadiusMedium: borderRadius,
        borderRadiusLarge: borderRadius,
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        opacityDisabled,
        // secondary
        colorOpacitySecondary: "0.16",
        colorOpacitySecondaryHover: "0.22",
        colorOpacitySecondaryPressed: "0.28",
        colorSecondary: buttonColor2,
        colorSecondaryHover: buttonColor2Hover,
        colorSecondaryPressed: buttonColor2Pressed,
        // tertiary
        colorTertiary: buttonColor2,
        colorTertiaryHover: buttonColor2Hover,
        colorTertiaryPressed: buttonColor2Pressed,
        // quaternary
        colorQuaternary: "#0000",
        colorQuaternaryHover: buttonColor2Hover,
        colorQuaternaryPressed: buttonColor2Pressed,
        // default type
        color: "#0000",
        colorHover: "#0000",
        colorPressed: "#0000",
        colorFocus: "#0000",
        colorDisabled: "#0000",
        textColor: textColor2,
        textColorTertiary: textColor3,
        textColorHover: primaryColorHover,
        textColorPressed: primaryColorPressed,
        textColorFocus: primaryColorHover,
        textColorDisabled: textColor2,
        textColorText: textColor2,
        textColorTextHover: primaryColorHover,
        textColorTextPressed: primaryColorPressed,
        textColorTextFocus: primaryColorHover,
        textColorTextDisabled: textColor2,
        textColorGhost: textColor2,
        textColorGhostHover: primaryColorHover,
        textColorGhostPressed: primaryColorPressed,
        textColorGhostFocus: primaryColorHover,
        textColorGhostDisabled: textColor2,
        border: `1px solid ${borderColor}`,
        borderHover: `1px solid ${primaryColorHover}`,
        borderPressed: `1px solid ${primaryColorPressed}`,
        borderFocus: `1px solid ${primaryColorHover}`,
        borderDisabled: `1px solid ${borderColor}`,
        rippleColor: primaryColor,
        // primary
        colorPrimary: primaryColor,
        colorHoverPrimary: primaryColorHover,
        colorPressedPrimary: primaryColorPressed,
        colorFocusPrimary: primaryColorHover,
        colorDisabledPrimary: primaryColor,
        textColorPrimary: baseColor,
        textColorHoverPrimary: baseColor,
        textColorPressedPrimary: baseColor,
        textColorFocusPrimary: baseColor,
        textColorDisabledPrimary: baseColor,
        textColorTextPrimary: primaryColor,
        textColorTextHoverPrimary: primaryColorHover,
        textColorTextPressedPrimary: primaryColorPressed,
        textColorTextFocusPrimary: primaryColorHover,
        textColorTextDisabledPrimary: textColor2,
        textColorGhostPrimary: primaryColor,
        textColorGhostHoverPrimary: primaryColorHover,
        textColorGhostPressedPrimary: primaryColorPressed,
        textColorGhostFocusPrimary: primaryColorHover,
        textColorGhostDisabledPrimary: primaryColor,
        borderPrimary: `1px solid ${primaryColor}`,
        borderHoverPrimary: `1px solid ${primaryColorHover}`,
        borderPressedPrimary: `1px solid ${primaryColorPressed}`,
        borderFocusPrimary: `1px solid ${primaryColorHover}`,
        borderDisabledPrimary: `1px solid ${primaryColor}`,
        rippleColorPrimary: primaryColor,
        // info
        colorInfo: infoColor,
        colorHoverInfo: infoColorHover,
        colorPressedInfo: infoColorPressed,
        colorFocusInfo: infoColorHover,
        colorDisabledInfo: infoColor,
        textColorInfo: baseColor,
        textColorHoverInfo: baseColor,
        textColorPressedInfo: baseColor,
        textColorFocusInfo: baseColor,
        textColorDisabledInfo: baseColor,
        textColorTextInfo: infoColor,
        textColorTextHoverInfo: infoColorHover,
        textColorTextPressedInfo: infoColorPressed,
        textColorTextFocusInfo: infoColorHover,
        textColorTextDisabledInfo: textColor2,
        textColorGhostInfo: infoColor,
        textColorGhostHoverInfo: infoColorHover,
        textColorGhostPressedInfo: infoColorPressed,
        textColorGhostFocusInfo: infoColorHover,
        textColorGhostDisabledInfo: infoColor,
        borderInfo: `1px solid ${infoColor}`,
        borderHoverInfo: `1px solid ${infoColorHover}`,
        borderPressedInfo: `1px solid ${infoColorPressed}`,
        borderFocusInfo: `1px solid ${infoColorHover}`,
        borderDisabledInfo: `1px solid ${infoColor}`,
        rippleColorInfo: infoColor,
        // success
        colorSuccess: successColor,
        colorHoverSuccess: successColorHover,
        colorPressedSuccess: successColorPressed,
        colorFocusSuccess: successColorHover,
        colorDisabledSuccess: successColor,
        textColorSuccess: baseColor,
        textColorHoverSuccess: baseColor,
        textColorPressedSuccess: baseColor,
        textColorFocusSuccess: baseColor,
        textColorDisabledSuccess: baseColor,
        textColorTextSuccess: successColor,
        textColorTextHoverSuccess: successColorHover,
        textColorTextPressedSuccess: successColorPressed,
        textColorTextFocusSuccess: successColorHover,
        textColorTextDisabledSuccess: textColor2,
        textColorGhostSuccess: successColor,
        textColorGhostHoverSuccess: successColorHover,
        textColorGhostPressedSuccess: successColorPressed,
        textColorGhostFocusSuccess: successColorHover,
        textColorGhostDisabledSuccess: successColor,
        borderSuccess: `1px solid ${successColor}`,
        borderHoverSuccess: `1px solid ${successColorHover}`,
        borderPressedSuccess: `1px solid ${successColorPressed}`,
        borderFocusSuccess: `1px solid ${successColorHover}`,
        borderDisabledSuccess: `1px solid ${successColor}`,
        rippleColorSuccess: successColor,
        // warning
        colorWarning: warningColor,
        colorHoverWarning: warningColorHover,
        colorPressedWarning: warningColorPressed,
        colorFocusWarning: warningColorHover,
        colorDisabledWarning: warningColor,
        textColorWarning: baseColor,
        textColorHoverWarning: baseColor,
        textColorPressedWarning: baseColor,
        textColorFocusWarning: baseColor,
        textColorDisabledWarning: baseColor,
        textColorTextWarning: warningColor,
        textColorTextHoverWarning: warningColorHover,
        textColorTextPressedWarning: warningColorPressed,
        textColorTextFocusWarning: warningColorHover,
        textColorTextDisabledWarning: textColor2,
        textColorGhostWarning: warningColor,
        textColorGhostHoverWarning: warningColorHover,
        textColorGhostPressedWarning: warningColorPressed,
        textColorGhostFocusWarning: warningColorHover,
        textColorGhostDisabledWarning: warningColor,
        borderWarning: `1px solid ${warningColor}`,
        borderHoverWarning: `1px solid ${warningColorHover}`,
        borderPressedWarning: `1px solid ${warningColorPressed}`,
        borderFocusWarning: `1px solid ${warningColorHover}`,
        borderDisabledWarning: `1px solid ${warningColor}`,
        rippleColorWarning: warningColor,
        // error
        colorError: errorColor,
        colorHoverError: errorColorHover,
        colorPressedError: errorColorPressed,
        colorFocusError: errorColorHover,
        colorDisabledError: errorColor,
        textColorError: baseColor,
        textColorHoverError: baseColor,
        textColorPressedError: baseColor,
        textColorFocusError: baseColor,
        textColorDisabledError: baseColor,
        textColorTextError: errorColor,
        textColorTextHoverError: errorColorHover,
        textColorTextPressedError: errorColorPressed,
        textColorTextFocusError: errorColorHover,
        textColorTextDisabledError: textColor2,
        textColorGhostError: errorColor,
        textColorGhostHoverError: errorColorHover,
        textColorGhostPressedError: errorColorPressed,
        textColorGhostFocusError: errorColorHover,
        textColorGhostDisabledError: errorColor,
        borderError: `1px solid ${errorColor}`,
        borderHoverError: `1px solid ${errorColorHover}`,
        borderPressedError: `1px solid ${errorColorPressed}`,
        borderFocusError: `1px solid ${errorColorHover}`,
        borderDisabledError: `1px solid ${errorColor}`,
        rippleColorError: errorColor,
        waveOpacity: "0.6",
        fontWeight,
        fontWeightStrong
      });
    }
    const buttonLight = {
      name: "Button",
      common: derived,
      self: self$M
    };
    const buttonDark = {
      name: "Button",
      common: derived$1,
      self(vars) {
        const commonSelf = self$M(vars);
        commonSelf.waveOpacity = "0.8";
        commonSelf.colorOpacitySecondary = "0.16";
        commonSelf.colorOpacitySecondaryHover = "0.2";
        commonSelf.colorOpacitySecondaryPressed = "0.12";
        return commonSelf;
      }
    };
    const style$g = c$1([cB("button", `
 margin: 0;
 font-weight: var(--n-font-weight);
 line-height: 1;
 font-family: inherit;
 padding: var(--n-padding);
 height: var(--n-height);
 font-size: var(--n-font-size);
 border-radius: var(--n-border-radius);
 color: var(--n-text-color);
 background-color: var(--n-color);
 width: var(--n-width);
 white-space: nowrap;
 outline: none;
 position: relative;
 z-index: auto;
 border: none;
 display: inline-flex;
 flex-wrap: nowrap;
 flex-shrink: 0;
 align-items: center;
 justify-content: center;
 user-select: none;
 -webkit-user-select: none;
 text-align: center;
 cursor: pointer;
 text-decoration: none;
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 opacity .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `, [cM("color", [cE("border", {
      borderColor: "var(--n-border-color)"
    }), cM("disabled", [cE("border", {
      borderColor: "var(--n-border-color-disabled)"
    })]), cNotM("disabled", [c$1("&:focus", [cE("state-border", {
      borderColor: "var(--n-border-color-focus)"
    })]), c$1("&:hover", [cE("state-border", {
      borderColor: "var(--n-border-color-hover)"
    })]), c$1("&:active", [cE("state-border", {
      borderColor: "var(--n-border-color-pressed)"
    })]), cM("pressed", [cE("state-border", {
      borderColor: "var(--n-border-color-pressed)"
    })])])]), cM("disabled", {
      backgroundColor: "var(--n-color-disabled)",
      color: "var(--n-text-color-disabled)"
    }, [cE("border", {
      border: "var(--n-border-disabled)"
    })]), cNotM("disabled", [c$1("&:focus", {
      backgroundColor: "var(--n-color-focus)",
      color: "var(--n-text-color-focus)"
    }, [cE("state-border", {
      border: "var(--n-border-focus)"
    })]), c$1("&:hover", {
      backgroundColor: "var(--n-color-hover)",
      color: "var(--n-text-color-hover)"
    }, [cE("state-border", {
      border: "var(--n-border-hover)"
    })]), c$1("&:active", {
      backgroundColor: "var(--n-color-pressed)",
      color: "var(--n-text-color-pressed)"
    }, [cE("state-border", {
      border: "var(--n-border-pressed)"
    })]), cM("pressed", {
      backgroundColor: "var(--n-color-pressed)",
      color: "var(--n-text-color-pressed)"
    }, [cE("state-border", {
      border: "var(--n-border-pressed)"
    })])]), cM("loading", "cursor: wait;"), cB("base-wave", `
 pointer-events: none;
 top: 0;
 right: 0;
 bottom: 0;
 left: 0;
 animation-iteration-count: 1;
 animation-duration: var(--n-ripple-duration);
 animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);
 `, [cM("active", {
      zIndex: 1,
      animationName: "button-wave-spread, button-wave-opacity"
    })]), isBrowser$2 && "MozBoxSizing" in document.createElement("div").style ? c$1("&::moz-focus-inner", {
      border: 0
    }) : null, cE("border, state-border", `
 position: absolute;
 left: 0;
 top: 0;
 right: 0;
 bottom: 0;
 border-radius: inherit;
 transition: border-color .3s var(--n-bezier);
 pointer-events: none;
 `), cE("border", {
      border: "var(--n-border)"
    }), cE("state-border", {
      border: "var(--n-border)",
      borderColor: "#0000",
      zIndex: 1
    }), cE("icon", `
 margin: var(--n-icon-margin);
 margin-left: 0;
 height: var(--n-icon-size);
 width: var(--n-icon-size);
 max-width: var(--n-icon-size);
 font-size: var(--n-icon-size);
 position: relative;
 flex-shrink: 0;
 `, [cB("icon-slot", `
 height: var(--n-icon-size);
 width: var(--n-icon-size);
 position: absolute;
 left: 0;
 top: 50%;
 transform: translateY(-50%);
 display: flex;
 align-items: center;
 justify-content: center;
 `, [iconSwitchTransition({
      top: "50%",
      originalTransform: "translateY(-50%)"
    })]), fadeInWidthExpandTransition()]), cE("content", `
 display: flex;
 align-items: center;
 flex-wrap: nowrap;
 min-width: 0;
 `, [c$1("~", [cE("icon", {
      margin: "var(--n-icon-margin)",
      marginRight: 0
    })])]), cM("block", `
 display: flex;
 width: 100%;
 `), cM("dashed", [cE("border, state-border", {
      borderStyle: "dashed !important"
    })]), cM("disabled", {
      cursor: "not-allowed",
      opacity: "var(--n-opacity-disabled)"
    })]), c$1("@keyframes button-wave-spread", {
      from: {
        boxShadow: "0 0 0.5px 0 var(--n-ripple-color)"
      },
      to: {
        // don't use exact 5px since chrome will display the animation with glitches
        boxShadow: "0 0 0.5px 4.5px var(--n-ripple-color)"
      }
    }), c$1("@keyframes button-wave-opacity", {
      from: {
        opacity: "var(--n-wave-opacity)"
      },
      to: {
        opacity: 0
      }
    })]);
    const buttonProps = Object.assign(Object.assign({}, useTheme.props), {
      color: String,
      textColor: String,
      text: Boolean,
      block: Boolean,
      loading: Boolean,
      disabled: Boolean,
      circle: Boolean,
      size: String,
      ghost: Boolean,
      round: Boolean,
      secondary: Boolean,
      tertiary: Boolean,
      quaternary: Boolean,
      strong: Boolean,
      focusable: {
        type: Boolean,
        default: true
      },
      keyboard: {
        type: Boolean,
        default: true
      },
      tag: {
        type: String,
        default: "button"
      },
      type: {
        type: String,
        default: "default"
      },
      dashed: Boolean,
      renderIcon: Function,
      iconPlacement: {
        type: String,
        default: "left"
      },
      attrType: {
        type: String,
        default: "button"
      },
      bordered: {
        type: Boolean,
        default: true
      },
      onClick: [Function, Array],
      nativeFocusBehavior: {
        type: Boolean,
        default: !isSafari
      }
    });
    const Button = /* @__PURE__ */ defineComponent({
      name: "Button",
      props: buttonProps,
      setup(props) {
        const selfElRef = ref(null);
        const waveElRef = ref(null);
        const enterPressedRef = ref(false);
        const showBorderRef = useMemo(() => {
          return !props.quaternary && !props.tertiary && !props.secondary && !props.text && (!props.color || props.ghost || props.dashed) && props.bordered;
        });
        const NButtonGroup = inject(buttonGroupInjectionKey, {});
        const {
          mergedSizeRef
        } = useFormItem({}, {
          defaultSize: "medium",
          mergedSize: (NFormItem) => {
            const {
              size: size2
            } = props;
            if (size2) return size2;
            const {
              size: buttonGroupSize
            } = NButtonGroup;
            if (buttonGroupSize) return buttonGroupSize;
            const {
              mergedSize: formItemSize
            } = NFormItem || {};
            if (formItemSize) {
              return formItemSize.value;
            }
            return "medium";
          }
        });
        const mergedFocusableRef = computed(() => {
          return props.focusable && !props.disabled;
        });
        const handleMousedown = (e) => {
          var _a;
          if (!mergedFocusableRef.value) {
            e.preventDefault();
          }
          if (props.nativeFocusBehavior) {
            return;
          }
          e.preventDefault();
          if (props.disabled) {
            return;
          }
          if (mergedFocusableRef.value) {
            (_a = selfElRef.value) === null || _a === void 0 ? void 0 : _a.focus({
              preventScroll: true
            });
          }
        };
        const handleClick2 = (e) => {
          var _a;
          if (!props.disabled && !props.loading) {
            const {
              onClick
            } = props;
            if (onClick) call(onClick, e);
            if (!props.text) {
              (_a = waveElRef.value) === null || _a === void 0 ? void 0 : _a.play();
            }
          }
        };
        const handleKeyup = (e) => {
          switch (e.key) {
            case "Enter":
              if (!props.keyboard) {
                return;
              }
              enterPressedRef.value = false;
          }
        };
        const handleKeydown = (e) => {
          switch (e.key) {
            case "Enter":
              if (!props.keyboard || props.loading) {
                e.preventDefault();
                return;
              }
              enterPressedRef.value = true;
          }
        };
        const handleBlur = () => {
          enterPressedRef.value = false;
        };
        const {
          inlineThemeDisabled,
          mergedClsPrefixRef,
          mergedRtlRef
        } = useConfig(props);
        const themeRef = useTheme("Button", "-button", style$g, buttonLight, props, mergedClsPrefixRef);
        const rtlEnabledRef = useRtl("Button", mergedRtlRef, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const theme = themeRef.value;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2,
              cubicBezierEaseOut: cubicBezierEaseOut2
            },
            self: self2
          } = theme;
          const {
            rippleDuration,
            opacityDisabled,
            fontWeight,
            fontWeightStrong
          } = self2;
          const size2 = mergedSizeRef.value;
          const {
            dashed,
            type,
            ghost,
            text,
            color,
            round,
            circle,
            textColor,
            secondary,
            tertiary,
            quaternary,
            strong
          } = props;
          const fontProps = {
            "--n-font-weight": strong ? fontWeightStrong : fontWeight
          };
          let colorProps = {
            "--n-color": "initial",
            "--n-color-hover": "initial",
            "--n-color-pressed": "initial",
            "--n-color-focus": "initial",
            "--n-color-disabled": "initial",
            "--n-ripple-color": "initial",
            "--n-text-color": "initial",
            "--n-text-color-hover": "initial",
            "--n-text-color-pressed": "initial",
            "--n-text-color-focus": "initial",
            "--n-text-color-disabled": "initial"
          };
          const typeIsTertiary = type === "tertiary";
          const typeIsDefault = type === "default";
          const mergedType = typeIsTertiary ? "default" : type;
          if (text) {
            const propTextColor = textColor || color;
            const mergedTextColor = propTextColor || self2[createKey("textColorText", mergedType)];
            colorProps = {
              "--n-color": "#0000",
              "--n-color-hover": "#0000",
              "--n-color-pressed": "#0000",
              "--n-color-focus": "#0000",
              "--n-color-disabled": "#0000",
              "--n-ripple-color": "#0000",
              "--n-text-color": mergedTextColor,
              "--n-text-color-hover": propTextColor ? createHoverColor(propTextColor) : self2[createKey("textColorTextHover", mergedType)],
              "--n-text-color-pressed": propTextColor ? createPressedColor(propTextColor) : self2[createKey("textColorTextPressed", mergedType)],
              "--n-text-color-focus": propTextColor ? createHoverColor(propTextColor) : self2[createKey("textColorTextHover", mergedType)],
              "--n-text-color-disabled": propTextColor || self2[createKey("textColorTextDisabled", mergedType)]
            };
          } else if (ghost || dashed) {
            const mergedTextColor = textColor || color;
            colorProps = {
              "--n-color": "#0000",
              "--n-color-hover": "#0000",
              "--n-color-pressed": "#0000",
              "--n-color-focus": "#0000",
              "--n-color-disabled": "#0000",
              "--n-ripple-color": color || self2[createKey("rippleColor", mergedType)],
              "--n-text-color": mergedTextColor || self2[createKey("textColorGhost", mergedType)],
              "--n-text-color-hover": mergedTextColor ? createHoverColor(mergedTextColor) : self2[createKey("textColorGhostHover", mergedType)],
              "--n-text-color-pressed": mergedTextColor ? createPressedColor(mergedTextColor) : self2[createKey("textColorGhostPressed", mergedType)],
              "--n-text-color-focus": mergedTextColor ? createHoverColor(mergedTextColor) : self2[createKey("textColorGhostHover", mergedType)],
              "--n-text-color-disabled": mergedTextColor || self2[createKey("textColorGhostDisabled", mergedType)]
            };
          } else if (secondary) {
            const typeTextColor = typeIsDefault ? self2.textColor : typeIsTertiary ? self2.textColorTertiary : self2[createKey("color", mergedType)];
            const mergedTextColor = color || typeTextColor;
            const isColoredType = type !== "default" && type !== "tertiary";
            colorProps = {
              "--n-color": isColoredType ? changeColor(mergedTextColor, {
                alpha: Number(self2.colorOpacitySecondary)
              }) : self2.colorSecondary,
              "--n-color-hover": isColoredType ? changeColor(mergedTextColor, {
                alpha: Number(self2.colorOpacitySecondaryHover)
              }) : self2.colorSecondaryHover,
              "--n-color-pressed": isColoredType ? changeColor(mergedTextColor, {
                alpha: Number(self2.colorOpacitySecondaryPressed)
              }) : self2.colorSecondaryPressed,
              "--n-color-focus": isColoredType ? changeColor(mergedTextColor, {
                alpha: Number(self2.colorOpacitySecondaryHover)
              }) : self2.colorSecondaryHover,
              "--n-color-disabled": self2.colorSecondary,
              "--n-ripple-color": "#0000",
              "--n-text-color": mergedTextColor,
              "--n-text-color-hover": mergedTextColor,
              "--n-text-color-pressed": mergedTextColor,
              "--n-text-color-focus": mergedTextColor,
              "--n-text-color-disabled": mergedTextColor
            };
          } else if (tertiary || quaternary) {
            const typeColor = typeIsDefault ? self2.textColor : typeIsTertiary ? self2.textColorTertiary : self2[createKey("color", mergedType)];
            const mergedColor = color || typeColor;
            if (tertiary) {
              colorProps["--n-color"] = self2.colorTertiary;
              colorProps["--n-color-hover"] = self2.colorTertiaryHover;
              colorProps["--n-color-pressed"] = self2.colorTertiaryPressed;
              colorProps["--n-color-focus"] = self2.colorSecondaryHover;
              colorProps["--n-color-disabled"] = self2.colorTertiary;
            } else {
              colorProps["--n-color"] = self2.colorQuaternary;
              colorProps["--n-color-hover"] = self2.colorQuaternaryHover;
              colorProps["--n-color-pressed"] = self2.colorQuaternaryPressed;
              colorProps["--n-color-focus"] = self2.colorQuaternaryHover;
              colorProps["--n-color-disabled"] = self2.colorQuaternary;
            }
            colorProps["--n-ripple-color"] = "#0000";
            colorProps["--n-text-color"] = mergedColor;
            colorProps["--n-text-color-hover"] = mergedColor;
            colorProps["--n-text-color-pressed"] = mergedColor;
            colorProps["--n-text-color-focus"] = mergedColor;
            colorProps["--n-text-color-disabled"] = mergedColor;
          } else {
            colorProps = {
              "--n-color": color || self2[createKey("color", mergedType)],
              "--n-color-hover": color ? createHoverColor(color) : self2[createKey("colorHover", mergedType)],
              "--n-color-pressed": color ? createPressedColor(color) : self2[createKey("colorPressed", mergedType)],
              "--n-color-focus": color ? createHoverColor(color) : self2[createKey("colorFocus", mergedType)],
              "--n-color-disabled": color || self2[createKey("colorDisabled", mergedType)],
              "--n-ripple-color": color || self2[createKey("rippleColor", mergedType)],
              "--n-text-color": textColor || (color ? self2.textColorPrimary : typeIsTertiary ? self2.textColorTertiary : self2[createKey("textColor", mergedType)]),
              "--n-text-color-hover": textColor || (color ? self2.textColorHoverPrimary : self2[createKey("textColorHover", mergedType)]),
              "--n-text-color-pressed": textColor || (color ? self2.textColorPressedPrimary : self2[createKey("textColorPressed", mergedType)]),
              "--n-text-color-focus": textColor || (color ? self2.textColorFocusPrimary : self2[createKey("textColorFocus", mergedType)]),
              "--n-text-color-disabled": textColor || (color ? self2.textColorDisabledPrimary : self2[createKey("textColorDisabled", mergedType)])
            };
          }
          let borderProps = {
            "--n-border": "initial",
            "--n-border-hover": "initial",
            "--n-border-pressed": "initial",
            "--n-border-focus": "initial",
            "--n-border-disabled": "initial"
          };
          if (text) {
            borderProps = {
              "--n-border": "none",
              "--n-border-hover": "none",
              "--n-border-pressed": "none",
              "--n-border-focus": "none",
              "--n-border-disabled": "none"
            };
          } else {
            borderProps = {
              "--n-border": self2[createKey("border", mergedType)],
              "--n-border-hover": self2[createKey("borderHover", mergedType)],
              "--n-border-pressed": self2[createKey("borderPressed", mergedType)],
              "--n-border-focus": self2[createKey("borderFocus", mergedType)],
              "--n-border-disabled": self2[createKey("borderDisabled", mergedType)]
            };
          }
          const {
            [createKey("height", size2)]: height,
            [createKey("fontSize", size2)]: fontSize2,
            [createKey("padding", size2)]: padding,
            [createKey("paddingRound", size2)]: paddingRound,
            [createKey("iconSize", size2)]: iconSize,
            [createKey("borderRadius", size2)]: borderRadius,
            [createKey("iconMargin", size2)]: iconMargin,
            waveOpacity
          } = self2;
          const sizeProps = {
            "--n-width": circle && !text ? height : "initial",
            "--n-height": text ? "initial" : height,
            "--n-font-size": fontSize2,
            "--n-padding": circle ? "initial" : text ? "initial" : round ? paddingRound : padding,
            "--n-icon-size": iconSize,
            "--n-icon-margin": iconMargin,
            "--n-border-radius": text ? "initial" : circle || round ? height : borderRadius
          };
          return Object.assign(Object.assign(Object.assign(Object.assign({
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-bezier-ease-out": cubicBezierEaseOut2,
            "--n-ripple-duration": rippleDuration,
            "--n-opacity-disabled": opacityDisabled,
            "--n-wave-opacity": waveOpacity
          }, fontProps), colorProps), borderProps), sizeProps);
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("button", computed(() => {
          let hash = "";
          const {
            dashed,
            type,
            ghost,
            text,
            color,
            round,
            circle,
            textColor,
            secondary,
            tertiary,
            quaternary,
            strong
          } = props;
          if (dashed) hash += "a";
          if (ghost) hash += "b";
          if (text) hash += "c";
          if (round) hash += "d";
          if (circle) hash += "e";
          if (secondary) hash += "f";
          if (tertiary) hash += "g";
          if (quaternary) hash += "h";
          if (strong) hash += "i";
          if (color) hash += `j${color2Class(color)}`;
          if (textColor) hash += `k${color2Class(textColor)}`;
          const {
            value: size2
          } = mergedSizeRef;
          hash += `l${size2[0]}`;
          hash += `m${type[0]}`;
          return hash;
        }), cssVarsRef, props) : void 0;
        return {
          selfElRef,
          waveElRef,
          mergedClsPrefix: mergedClsPrefixRef,
          mergedFocusable: mergedFocusableRef,
          mergedSize: mergedSizeRef,
          showBorder: showBorderRef,
          enterPressed: enterPressedRef,
          rtlEnabled: rtlEnabledRef,
          handleMousedown,
          handleKeydown,
          handleBlur,
          handleKeyup,
          handleClick: handleClick2,
          customColorCssVars: computed(() => {
            const {
              color
            } = props;
            if (!color) return null;
            const hoverColor = createHoverColor(color);
            return {
              "--n-border-color": color,
              "--n-border-color-hover": hoverColor,
              "--n-border-color-pressed": createPressedColor(color),
              "--n-border-color-focus": hoverColor,
              "--n-border-color-disabled": color
            };
          }),
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        const {
          mergedClsPrefix,
          tag: Component,
          onRender
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        const children = resolveWrappedSlot(this.$slots.default, (children2) => children2 && h("span", {
          class: `${mergedClsPrefix}-button__content`
        }, children2));
        return h(Component, {
          ref: "selfElRef",
          class: [
            this.themeClass,
            `${mergedClsPrefix}-button`,
            `${mergedClsPrefix}-button--${this.type}-type`,
            `${mergedClsPrefix}-button--${this.mergedSize}-type`,
            this.rtlEnabled && `${mergedClsPrefix}-button--rtl`,
            this.disabled && `${mergedClsPrefix}-button--disabled`,
            this.block && `${mergedClsPrefix}-button--block`,
            this.enterPressed && `${mergedClsPrefix}-button--pressed`,
            !this.text && this.dashed && `${mergedClsPrefix}-button--dashed`,
            this.color && `${mergedClsPrefix}-button--color`,
            this.secondary && `${mergedClsPrefix}-button--secondary`,
            this.loading && `${mergedClsPrefix}-button--loading`,
            this.ghost && `${mergedClsPrefix}-button--ghost`
            // required for button group border collapse
          ],
          tabindex: this.mergedFocusable ? 0 : -1,
          type: this.attrType,
          style: this.cssVars,
          disabled: this.disabled,
          onClick: this.handleClick,
          onBlur: this.handleBlur,
          onMousedown: this.handleMousedown,
          onKeyup: this.handleKeyup,
          onKeydown: this.handleKeydown
        }, this.iconPlacement === "right" && children, h(NFadeInExpandTransition, {
          width: true
        }, {
          default: () => resolveWrappedSlot(this.$slots.icon, (children2) => (this.loading || this.renderIcon || children2) && h("span", {
            class: `${mergedClsPrefix}-button__icon`,
            style: {
              margin: isSlotEmpty(this.$slots.default) ? "0" : ""
            }
          }, h(NIconSwitchTransition, null, {
            default: () => this.loading ? h(NBaseLoading, {
              clsPrefix: mergedClsPrefix,
              key: "loading",
              class: `${mergedClsPrefix}-icon-slot`,
              strokeWidth: 20
            }) : h("div", {
              key: "icon",
              class: `${mergedClsPrefix}-icon-slot`,
              role: "none"
            }, this.renderIcon ? this.renderIcon() : children2)
          })))
        }), this.iconPlacement === "left" && children, !this.text ? h(NBaseWave, {
          ref: "waveElRef",
          clsPrefix: mergedClsPrefix
        }) : null, this.showBorder ? h("div", {
          "aria-hidden": true,
          class: `${mergedClsPrefix}-button__border`,
          style: this.customColorCssVars
        }) : null, this.showBorder ? h("div", {
          "aria-hidden": true,
          class: `${mergedClsPrefix}-button__state-border`,
          style: this.customColorCssVars
        }) : null);
      }
    });
    const XButton = Button;
    const commonVariables$e = {
      titleFontSize: "22px"
    };
    function self$L(vars) {
      const {
        borderRadius,
        fontSize: fontSize2,
        lineHeight: lineHeight2,
        textColor2,
        textColor1,
        textColorDisabled,
        dividerColor,
        fontWeightStrong,
        primaryColor,
        baseColor,
        hoverColor,
        cardColor,
        modalColor,
        popoverColor
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$e), {
        borderRadius,
        borderColor: composite(cardColor, dividerColor),
        borderColorModal: composite(modalColor, dividerColor),
        borderColorPopover: composite(popoverColor, dividerColor),
        textColor: textColor2,
        titleFontWeight: fontWeightStrong,
        titleTextColor: textColor1,
        dayTextColor: textColorDisabled,
        fontSize: fontSize2,
        lineHeight: lineHeight2,
        dateColorCurrent: primaryColor,
        dateTextColorCurrent: baseColor,
        cellColorHover: composite(cardColor, hoverColor),
        cellColorHoverModal: composite(modalColor, hoverColor),
        cellColorHoverPopover: composite(popoverColor, hoverColor),
        cellColor: cardColor,
        cellColorModal: modalColor,
        cellColorPopover: popoverColor,
        barColor: primaryColor
      });
    }
    const calendarDark = {
      name: "Calendar",
      common: derived$1,
      peers: {
        Button: buttonDark
      },
      self: self$L
    };
    function self$K(vars) {
      const {
        fontSize: fontSize2,
        boxShadow2,
        popoverColor,
        textColor2,
        borderRadius,
        borderColor,
        heightSmall,
        heightMedium,
        heightLarge,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        dividerColor
      } = vars;
      return {
        panelFontSize: fontSize2,
        boxShadow: boxShadow2,
        color: popoverColor,
        textColor: textColor2,
        borderRadius,
        border: `1px solid ${borderColor}`,
        heightSmall,
        heightMedium,
        heightLarge,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        dividerColor
      };
    }
    const colorPickerDark = {
      name: "ColorPicker",
      common: derived$1,
      peers: {
        Input: inputDark,
        Button: buttonDark
      },
      self: self$K
    };
    const commonVariables$d = {
      paddingSmall: "12px 16px 12px",
      paddingMedium: "19px 24px 20px",
      paddingLarge: "23px 32px 24px",
      paddingHuge: "27px 40px 28px",
      titleFontSizeSmall: "16px",
      titleFontSizeMedium: "18px",
      titleFontSizeLarge: "18px",
      titleFontSizeHuge: "18px",
      closeIconSize: "18px",
      closeSize: "22px"
    };
    function self$J(vars) {
      const {
        primaryColor,
        borderRadius,
        lineHeight: lineHeight2,
        fontSize: fontSize2,
        cardColor,
        textColor2,
        textColor1,
        dividerColor,
        fontWeightStrong,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeColorHover,
        closeColorPressed,
        modalColor,
        boxShadow1,
        popoverColor,
        actionColor
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$d), {
        lineHeight: lineHeight2,
        color: cardColor,
        colorModal: modalColor,
        colorPopover: popoverColor,
        colorTarget: primaryColor,
        colorEmbedded: actionColor,
        colorEmbeddedModal: actionColor,
        colorEmbeddedPopover: actionColor,
        textColor: textColor2,
        titleTextColor: textColor1,
        borderColor: dividerColor,
        actionColor,
        titleFontWeight: fontWeightStrong,
        closeColorHover,
        closeColorPressed,
        closeBorderRadius: borderRadius,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        fontSizeSmall: fontSize2,
        fontSizeMedium: fontSize2,
        fontSizeLarge: fontSize2,
        fontSizeHuge: fontSize2,
        boxShadow: boxShadow1,
        borderRadius
      });
    }
    const cardLight = {
      name: "Card",
      common: derived,
      self: self$J
    };
    const cardDark = {
      name: "Card",
      common: derived$1,
      self(vars) {
        const commonSelf = self$J(vars);
        const {
          cardColor,
          modalColor,
          popoverColor
        } = vars;
        commonSelf.colorEmbedded = cardColor;
        commonSelf.colorEmbeddedModal = modalColor;
        commonSelf.colorEmbeddedPopover = popoverColor;
        return commonSelf;
      }
    };
    const style$f = c$1([cB("card", `
 font-size: var(--n-font-size);
 line-height: var(--n-line-height);
 display: flex;
 flex-direction: column;
 width: 100%;
 box-sizing: border-box;
 position: relative;
 border-radius: var(--n-border-radius);
 background-color: var(--n-color);
 color: var(--n-text-color);
 word-break: break-word;
 transition: 
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `, [asModal({
      background: "var(--n-color-modal)"
    }), cM("hoverable", [c$1("&:hover", "box-shadow: var(--n-box-shadow);")]), cM("content-segmented", [c$1(">", [cE("content", {
      paddingTop: "var(--n-padding-bottom)"
    })])]), cM("content-soft-segmented", [c$1(">", [cE("content", `
 margin: 0 var(--n-padding-left);
 padding: var(--n-padding-bottom) 0;
 `)])]), cM("footer-segmented", [c$1(">", [cE("footer", {
      paddingTop: "var(--n-padding-bottom)"
    })])]), cM("footer-soft-segmented", [c$1(">", [cE("footer", `
 padding: var(--n-padding-bottom) 0;
 margin: 0 var(--n-padding-left);
 `)])]), c$1(">", [cB("card-header", `
 box-sizing: border-box;
 display: flex;
 align-items: center;
 font-size: var(--n-title-font-size);
 padding:
 var(--n-padding-top)
 var(--n-padding-left)
 var(--n-padding-bottom)
 var(--n-padding-left);
 `, [cE("main", `
 font-weight: var(--n-title-font-weight);
 transition: color .3s var(--n-bezier);
 flex: 1;
 min-width: 0;
 color: var(--n-title-text-color);
 `), cE("extra", `
 display: flex;
 align-items: center;
 font-size: var(--n-font-size);
 font-weight: 400;
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
 `), cE("close", `
 margin: 0 0 0 8px;
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `)]), cE("action", `
 box-sizing: border-box;
 transition:
 background-color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 background-clip: padding-box;
 background-color: var(--n-action-color);
 `), cE("content", "flex: 1; min-width: 0;"), cE("content, footer", `
 box-sizing: border-box;
 padding: 0 var(--n-padding-left) var(--n-padding-bottom) var(--n-padding-left);
 font-size: var(--n-font-size);
 `, [c$1("&:first-child", {
      paddingTop: "var(--n-padding-bottom)"
    })]), cE("action", `
 background-color: var(--n-action-color);
 padding: var(--n-padding-bottom) var(--n-padding-left);
 border-bottom-left-radius: var(--n-border-radius);
 border-bottom-right-radius: var(--n-border-radius);
 `)]), cB("card-cover", `
 overflow: hidden;
 width: 100%;
 border-radius: var(--n-border-radius) var(--n-border-radius) 0 0;
 `, [c$1("img", `
 display: block;
 width: 100%;
 `)]), cM("bordered", `
 border: 1px solid var(--n-border-color);
 `, [c$1("&:target", "border-color: var(--n-color-target);")]), cM("action-segmented", [c$1(">", [cE("action", [c$1("&:not(:first-child)", {
      borderTop: "1px solid var(--n-border-color)"
    })])])]), cM("content-segmented, content-soft-segmented", [c$1(">", [cE("content", {
      transition: "border-color 0.3s var(--n-bezier)"
    }, [c$1("&:not(:first-child)", {
      borderTop: "1px solid var(--n-border-color)"
    })])])]), cM("footer-segmented, footer-soft-segmented", [c$1(">", [cE("footer", {
      transition: "border-color 0.3s var(--n-bezier)"
    }, [c$1("&:not(:first-child)", {
      borderTop: "1px solid var(--n-border-color)"
    })])])]), cM("embedded", `
 background-color: var(--n-color-embedded);
 `)]), insideModal(cB("card", `
 background: var(--n-color-modal);
 `, [cM("embedded", `
 background-color: var(--n-color-embedded-modal);
 `)])), insidePopover(cB("card", `
 background: var(--n-color-popover);
 `, [cM("embedded", `
 background-color: var(--n-color-embedded-popover);
 `)]))]);
    const cardBaseProps = {
      title: [String, Function],
      contentClass: String,
      contentStyle: [Object, String],
      headerClass: String,
      headerStyle: [Object, String],
      headerExtraClass: String,
      headerExtraStyle: [Object, String],
      footerClass: String,
      footerStyle: [Object, String],
      embedded: Boolean,
      segmented: {
        type: [Boolean, Object],
        default: false
      },
      size: {
        type: String,
        default: "medium"
      },
      bordered: {
        type: Boolean,
        default: true
      },
      closable: Boolean,
      hoverable: Boolean,
      role: String,
      onClose: [Function, Array],
      tag: {
        type: String,
        default: "div"
      },
      cover: Function,
      content: [String, Function],
      footer: Function,
      action: Function,
      headerExtra: Function
    };
    const cardBasePropKeys = keysOf(cardBaseProps);
    const cardProps = Object.assign(Object.assign({}, useTheme.props), cardBaseProps);
    const NCard = /* @__PURE__ */ defineComponent({
      name: "Card",
      props: cardProps,
      setup(props) {
        const handleCloseClick = () => {
          const {
            onClose
          } = props;
          if (onClose) call(onClose);
        };
        const {
          inlineThemeDisabled,
          mergedClsPrefixRef,
          mergedRtlRef
        } = useConfig(props);
        const themeRef = useTheme("Card", "-card", style$f, cardLight, props, mergedClsPrefixRef);
        const rtlEnabledRef = useRtl("Card", mergedRtlRef, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            size: size2
          } = props;
          const {
            self: {
              color,
              colorModal,
              colorTarget,
              textColor,
              titleTextColor,
              titleFontWeight,
              borderColor,
              actionColor,
              borderRadius,
              lineHeight: lineHeight2,
              closeIconColor,
              closeIconColorHover,
              closeIconColorPressed,
              closeColorHover,
              closeColorPressed,
              closeBorderRadius,
              closeIconSize,
              closeSize,
              boxShadow,
              colorPopover,
              colorEmbedded,
              colorEmbeddedModal,
              colorEmbeddedPopover,
              [createKey("padding", size2)]: padding,
              [createKey("fontSize", size2)]: fontSize2,
              [createKey("titleFontSize", size2)]: titleFontSize
            },
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            }
          } = themeRef.value;
          const {
            top: paddingTop,
            left: paddingLeft,
            bottom: paddingBottom
          } = getMargin(padding);
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-border-radius": borderRadius,
            "--n-color": color,
            "--n-color-modal": colorModal,
            "--n-color-popover": colorPopover,
            "--n-color-embedded": colorEmbedded,
            "--n-color-embedded-modal": colorEmbeddedModal,
            "--n-color-embedded-popover": colorEmbeddedPopover,
            "--n-color-target": colorTarget,
            "--n-text-color": textColor,
            "--n-line-height": lineHeight2,
            "--n-action-color": actionColor,
            "--n-title-text-color": titleTextColor,
            "--n-title-font-weight": titleFontWeight,
            "--n-close-icon-color": closeIconColor,
            "--n-close-icon-color-hover": closeIconColorHover,
            "--n-close-icon-color-pressed": closeIconColorPressed,
            "--n-close-color-hover": closeColorHover,
            "--n-close-color-pressed": closeColorPressed,
            "--n-border-color": borderColor,
            "--n-box-shadow": boxShadow,
            // size
            "--n-padding-top": paddingTop,
            "--n-padding-bottom": paddingBottom,
            "--n-padding-left": paddingLeft,
            "--n-font-size": fontSize2,
            "--n-title-font-size": titleFontSize,
            "--n-close-size": closeSize,
            "--n-close-icon-size": closeIconSize,
            "--n-close-border-radius": closeBorderRadius
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("card", computed(() => {
          return props.size[0];
        }), cssVarsRef, props) : void 0;
        return {
          rtlEnabled: rtlEnabledRef,
          mergedClsPrefix: mergedClsPrefixRef,
          mergedTheme: themeRef,
          handleCloseClick,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        const {
          segmented,
          bordered,
          hoverable,
          mergedClsPrefix,
          rtlEnabled,
          onRender,
          embedded,
          tag: Component,
          $slots
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h(Component, {
          class: [`${mergedClsPrefix}-card`, this.themeClass, embedded && `${mergedClsPrefix}-card--embedded`, {
            [`${mergedClsPrefix}-card--rtl`]: rtlEnabled,
            [`${mergedClsPrefix}-card--content${typeof segmented !== "boolean" && segmented.content === "soft" ? "-soft" : ""}-segmented`]: segmented === true || segmented !== false && segmented.content,
            [`${mergedClsPrefix}-card--footer${typeof segmented !== "boolean" && segmented.footer === "soft" ? "-soft" : ""}-segmented`]: segmented === true || segmented !== false && segmented.footer,
            [`${mergedClsPrefix}-card--action-segmented`]: segmented === true || segmented !== false && segmented.action,
            [`${mergedClsPrefix}-card--bordered`]: bordered,
            [`${mergedClsPrefix}-card--hoverable`]: hoverable
          }],
          style: this.cssVars,
          role: this.role
        }, resolveWrappedSlot($slots.cover, (children) => {
          const mergedChildren = this.cover ? ensureValidVNode([this.cover()]) : children;
          return mergedChildren && h("div", {
            class: `${mergedClsPrefix}-card-cover`,
            role: "none"
          }, mergedChildren);
        }), resolveWrappedSlot($slots.header, (children) => {
          const {
            title
          } = this;
          const mergedChildren = title ? ensureValidVNode(typeof title === "function" ? [title()] : [title]) : children;
          return mergedChildren || this.closable ? h("div", {
            class: [`${mergedClsPrefix}-card-header`, this.headerClass],
            style: this.headerStyle,
            role: "heading"
          }, h("div", {
            class: `${mergedClsPrefix}-card-header__main`,
            role: "heading"
          }, mergedChildren), resolveWrappedSlot($slots["header-extra"], (children2) => {
            const mergedChildren2 = this.headerExtra ? ensureValidVNode([this.headerExtra()]) : children2;
            return mergedChildren2 && h("div", {
              class: [`${mergedClsPrefix}-card-header__extra`, this.headerExtraClass],
              style: this.headerExtraStyle
            }, mergedChildren2);
          }), this.closable && h(NBaseClose, {
            clsPrefix: mergedClsPrefix,
            class: `${mergedClsPrefix}-card-header__close`,
            onClick: this.handleCloseClick,
            absolute: true
          })) : null;
        }), resolveWrappedSlot($slots.default, (children) => {
          const {
            content
          } = this;
          const mergedChildren = content ? ensureValidVNode(typeof content === "function" ? [content()] : [content]) : children;
          return mergedChildren && h("div", {
            class: [`${mergedClsPrefix}-card__content`, this.contentClass],
            style: this.contentStyle,
            role: "none"
          }, mergedChildren);
        }), resolveWrappedSlot($slots.footer, (children) => {
          const mergedChildren = this.footer ? ensureValidVNode([this.footer()]) : children;
          return mergedChildren && h("div", {
            class: [`${mergedClsPrefix}-card__footer`, this.footerClass],
            style: this.footerStyle,
            role: "none"
          }, mergedChildren);
        }), resolveWrappedSlot($slots.action, (children) => {
          const mergedChildren = this.action ? ensureValidVNode([this.action()]) : children;
          return mergedChildren && h("div", {
            class: `${mergedClsPrefix}-card__action`,
            role: "none"
          }, mergedChildren);
        }));
      }
    });
    function self$I() {
      return {
        dotSize: "8px",
        dotColor: "rgba(255, 255, 255, .3)",
        dotColorActive: "rgba(255, 255, 255, 1)",
        dotColorFocus: "rgba(255, 255, 255, .5)",
        dotLineWidth: "16px",
        dotLineWidthActive: "24px",
        arrowColor: "#eee"
      };
    }
    const carouselDark = {
      name: "Carousel",
      common: derived$1,
      self: self$I
    };
    const commonVariables$c = {
      sizeSmall: "14px",
      sizeMedium: "16px",
      sizeLarge: "18px",
      labelPadding: "0 8px",
      labelFontWeight: "400"
    };
    function self$H(vars) {
      const {
        baseColor,
        inputColorDisabled,
        cardColor,
        modalColor,
        popoverColor,
        textColorDisabled,
        borderColor,
        primaryColor,
        textColor2,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        borderRadiusSmall,
        lineHeight: lineHeight2
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$c), {
        labelLineHeight: lineHeight2,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        borderRadius: borderRadiusSmall,
        color: baseColor,
        colorChecked: primaryColor,
        colorDisabled: inputColorDisabled,
        colorDisabledChecked: inputColorDisabled,
        colorTableHeader: cardColor,
        colorTableHeaderModal: modalColor,
        colorTableHeaderPopover: popoverColor,
        checkMarkColor: baseColor,
        checkMarkColorDisabled: textColorDisabled,
        checkMarkColorDisabledChecked: textColorDisabled,
        border: `1px solid ${borderColor}`,
        borderDisabled: `1px solid ${borderColor}`,
        borderDisabledChecked: `1px solid ${borderColor}`,
        borderChecked: `1px solid ${primaryColor}`,
        borderFocus: `1px solid ${primaryColor}`,
        boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, {
          alpha: 0.3
        })}`,
        textColor: textColor2,
        textColorDisabled
      });
    }
    const checkboxDark = {
      name: "Checkbox",
      common: derived$1,
      self(vars) {
        const {
          cardColor
        } = vars;
        const commonSelf = self$H(vars);
        commonSelf.color = "#0000";
        commonSelf.checkMarkColor = cardColor;
        return commonSelf;
      }
    };
    function self$G(vars) {
      const {
        borderRadius,
        boxShadow2,
        popoverColor,
        textColor2,
        textColor3,
        primaryColor,
        textColorDisabled,
        dividerColor,
        hoverColor,
        fontSizeMedium,
        heightMedium
      } = vars;
      return {
        menuBorderRadius: borderRadius,
        menuColor: popoverColor,
        menuBoxShadow: boxShadow2,
        menuDividerColor: dividerColor,
        menuHeight: "calc(var(--n-option-height) * 6.6)",
        optionArrowColor: textColor3,
        optionHeight: heightMedium,
        optionFontSize: fontSizeMedium,
        optionColorHover: hoverColor,
        optionTextColor: textColor2,
        optionTextColorActive: primaryColor,
        optionTextColorDisabled: textColorDisabled,
        optionCheckMarkColor: primaryColor,
        loadingColor: primaryColor,
        columnWidth: "180px"
      };
    }
    const cascaderDark = {
      name: "Cascader",
      common: derived$1,
      peers: {
        InternalSelectMenu: internalSelectMenuDark,
        InternalSelection: internalSelectionDark,
        Scrollbar: scrollbarDark,
        Checkbox: checkboxDark,
        Empty: emptyLight
      },
      self: self$G
    };
    const codeDark = {
      name: "Code",
      common: derived$1,
      self(vars) {
        const {
          textColor2,
          fontSize: fontSize2,
          fontWeightStrong,
          textColor3
        } = vars;
        return {
          textColor: textColor2,
          fontSize: fontSize2,
          fontWeightStrong,
          // extracted from hljs atom-one-dark.scss
          "mono-3": "#5c6370",
          "hue-1": "#56b6c2",
          "hue-2": "#61aeee",
          "hue-3": "#c678dd",
          "hue-4": "#98c379",
          "hue-5": "#e06c75",
          "hue-5-2": "#be5046",
          "hue-6": "#d19a66",
          "hue-6-2": "#e6c07b",
          // line-number styles
          lineNumberTextColor: textColor3
        };
      }
    };
    function self$F(vars) {
      const {
        textColor2,
        fontSize: fontSize2,
        fontWeightStrong,
        textColor3
      } = vars;
      return {
        textColor: textColor2,
        fontSize: fontSize2,
        fontWeightStrong,
        // extracted from hljs atom-one-light.scss
        "mono-3": "#a0a1a7",
        "hue-1": "#0184bb",
        "hue-2": "#4078f2",
        "hue-3": "#a626a4",
        "hue-4": "#50a14f",
        "hue-5": "#e45649",
        "hue-5-2": "#c91243",
        "hue-6": "#986801",
        "hue-6-2": "#c18401",
        // line-number styles
        lineNumberTextColor: textColor3
      };
    }
    const codeLight = {
      name: "Code",
      common: derived,
      self: self$F
    };
    const style$e = c$1([cB("code", `
 font-size: var(--n-font-size);
 font-family: var(--n-font-family);
 `, [cM("show-line-numbers", `
 display: flex;
 `), cE("line-numbers", `
 user-select: none;
 padding-right: 12px;
 text-align: right;
 transition: color .3s var(--n-bezier);
 color: var(--n-line-number-text-color);
 `), cM("word-wrap", [c$1("pre", `
 white-space: pre-wrap;
 word-break: break-all;
 `)]), c$1("pre", `
 margin: 0;
 line-height: inherit;
 font-size: inherit;
 font-family: inherit;
 `), c$1("[class^=hljs]", `
 color: var(--n-text-color);
 transition: 
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 `)]), ({
      props
    }) => {
      const codeClass = `${props.bPrefix}code`;
      return [`${codeClass} .hljs-comment,
 ${codeClass} .hljs-quote {
 color: var(--n-mono-3);
 font-style: italic;
 }`, `${codeClass} .hljs-doctag,
 ${codeClass} .hljs-keyword,
 ${codeClass} .hljs-formula {
 color: var(--n-hue-3);
 }`, `${codeClass} .hljs-section,
 ${codeClass} .hljs-name,
 ${codeClass} .hljs-selector-tag,
 ${codeClass} .hljs-deletion,
 ${codeClass} .hljs-subst {
 color: var(--n-hue-5);
 }`, `${codeClass} .hljs-literal {
 color: var(--n-hue-1);
 }`, `${codeClass} .hljs-string,
 ${codeClass} .hljs-regexp,
 ${codeClass} .hljs-addition,
 ${codeClass} .hljs-attribute,
 ${codeClass} .hljs-meta-string {
 color: var(--n-hue-4);
 }`, `${codeClass} .hljs-built_in,
 ${codeClass} .hljs-class .hljs-title {
 color: var(--n-hue-6-2);
 }`, `${codeClass} .hljs-attr,
 ${codeClass} .hljs-variable,
 ${codeClass} .hljs-template-variable,
 ${codeClass} .hljs-type,
 ${codeClass} .hljs-selector-class,
 ${codeClass} .hljs-selector-attr,
 ${codeClass} .hljs-selector-pseudo,
 ${codeClass} .hljs-number {
 color: var(--n-hue-6);
 }`, `${codeClass} .hljs-symbol,
 ${codeClass} .hljs-bullet,
 ${codeClass} .hljs-link,
 ${codeClass} .hljs-meta,
 ${codeClass} .hljs-selector-id,
 ${codeClass} .hljs-title {
 color: var(--n-hue-2);
 }`, `${codeClass} .hljs-emphasis {
 font-style: italic;
 }`, `${codeClass} .hljs-strong {
 font-weight: var(--n-font-weight-strong);
 }`, `${codeClass} .hljs-link {
 text-decoration: underline;
 }`];
    }]);
    const codeProps = Object.assign(Object.assign({}, useTheme.props), {
      language: String,
      code: {
        type: String,
        default: ""
      },
      trim: {
        type: Boolean,
        default: true
      },
      hljs: Object,
      uri: Boolean,
      inline: Boolean,
      wordWrap: Boolean,
      showLineNumbers: Boolean,
      // In n-log, we only need to mount code's style for highlight
      internalFontSize: Number,
      internalNoHighlight: Boolean
    });
    const NCode = /* @__PURE__ */ defineComponent({
      name: "Code",
      props: codeProps,
      setup(props, {
        slots
      }) {
        const {
          internalNoHighlight
        } = props;
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig();
        const codeRef = ref(null);
        const hljsRef = internalNoHighlight ? {
          value: void 0
        } : useHljs(props);
        const createCodeHtml = (language, code2, trim) => {
          const {
            value: hljs
          } = hljsRef;
          if (!hljs) {
            return null;
          }
          if (!(language && hljs.getLanguage(language))) {
            return null;
          }
          return hljs.highlight(trim ? code2.trim() : code2, {
            language
          }).value;
        };
        const mergedShowLineNumbersRef = computed(() => {
          if (props.inline || props.wordWrap) return false;
          return props.showLineNumbers;
        });
        const setCode = () => {
          if (slots.default) return;
          const {
            value: codeEl
          } = codeRef;
          if (!codeEl) return;
          const {
            language
          } = props;
          const code2 = props.uri ? window.decodeURIComponent(props.code) : props.code;
          if (language) {
            const html = createCodeHtml(language, code2, props.trim);
            if (html !== null) {
              if (props.inline) {
                codeEl.innerHTML = html;
              } else {
                const prevPreEl = codeEl.querySelector(".__code__");
                if (prevPreEl) codeEl.removeChild(prevPreEl);
                const preEl = document.createElement("pre");
                preEl.className = "__code__";
                preEl.innerHTML = html;
                codeEl.appendChild(preEl);
              }
              return;
            }
          }
          if (props.inline) {
            codeEl.textContent = code2;
            return;
          }
          const maybePreEl = codeEl.querySelector(".__code__");
          if (maybePreEl) {
            maybePreEl.textContent = code2;
          } else {
            const wrap = document.createElement("pre");
            wrap.className = "__code__";
            wrap.textContent = code2;
            codeEl.innerHTML = "";
            codeEl.appendChild(wrap);
          }
        };
        onMounted(setCode);
        watch(toRef(props, "language"), setCode);
        watch(toRef(props, "code"), setCode);
        if (!internalNoHighlight) watch(hljsRef, setCode);
        const themeRef = useTheme("Code", "-code", style$e, codeLight, props, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2,
              fontFamilyMono
            },
            self: {
              textColor,
              fontSize: fontSize2,
              fontWeightStrong,
              lineNumberTextColor,
              // extracted from hljs atom-one-light.scss
              "mono-3": $1,
              "hue-1": $2,
              "hue-2": $3,
              "hue-3": $4,
              "hue-4": $5,
              "hue-5": $6,
              "hue-5-2": $7,
              "hue-6": $8,
              "hue-6-2": $9
            }
          } = themeRef.value;
          const {
            internalFontSize
          } = props;
          return {
            "--n-font-size": internalFontSize ? `${internalFontSize}px` : fontSize2,
            "--n-font-family": fontFamilyMono,
            "--n-font-weight-strong": fontWeightStrong,
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-text-color": textColor,
            "--n-mono-3": $1,
            "--n-hue-1": $2,
            "--n-hue-2": $3,
            "--n-hue-3": $4,
            "--n-hue-4": $5,
            "--n-hue-5": $6,
            "--n-hue-5-2": $7,
            "--n-hue-6": $8,
            "--n-hue-6-2": $9,
            "--n-line-number-text-color": lineNumberTextColor
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("code", computed(() => {
          return `${props.internalFontSize || "a"}`;
        }), cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          codeRef,
          mergedShowLineNumbers: mergedShowLineNumbersRef,
          lineNumbers: computed(() => {
            let number2 = 1;
            const numbers = [];
            let lastIsLineWrap = false;
            for (const char of props.code) {
              if (char === "\n") {
                lastIsLineWrap = true;
                numbers.push(number2++);
              } else {
                lastIsLineWrap = false;
              }
            }
            if (!lastIsLineWrap) {
              numbers.push(number2++);
            }
            return numbers.join("\n");
          }),
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        var _a, _b;
        const {
          mergedClsPrefix,
          wordWrap,
          mergedShowLineNumbers,
          onRender
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h("code", {
          class: [`${mergedClsPrefix}-code`, this.themeClass, wordWrap && `${mergedClsPrefix}-code--word-wrap`, mergedShowLineNumbers && `${mergedClsPrefix}-code--show-line-numbers`],
          style: this.cssVars,
          ref: "codeRef"
        }, mergedShowLineNumbers ? h("pre", {
          class: `${mergedClsPrefix}-code__line-numbers`
        }, this.lineNumbers) : null, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a));
      }
    });
    function self$E(vars) {
      const {
        fontWeight,
        textColor1,
        textColor2,
        textColorDisabled,
        dividerColor,
        fontSize: fontSize2
      } = vars;
      return {
        titleFontSize: fontSize2,
        titleFontWeight: fontWeight,
        dividerColor,
        titleTextColor: textColor1,
        titleTextColorDisabled: textColorDisabled,
        fontSize: fontSize2,
        textColor: textColor2,
        arrowColor: textColor2,
        arrowColorDisabled: textColorDisabled,
        itemMargin: "16px 0 0 0",
        titlePadding: "16px 0 0 0"
      };
    }
    const collapseDark = {
      name: "Collapse",
      common: derived$1,
      self: self$E
    };
    function self$D(vars) {
      const {
        cubicBezierEaseInOut: cubicBezierEaseInOut2
      } = vars;
      return {
        bezier: cubicBezierEaseInOut2
      };
    }
    const collapseTransitionDark = {
      name: "CollapseTransition",
      common: derived$1,
      self: self$D
    };
    const configProviderProps = {
      abstract: Boolean,
      bordered: {
        type: Boolean,
        default: void 0
      },
      clsPrefix: String,
      locale: Object,
      dateLocale: Object,
      namespace: String,
      rtl: Array,
      tag: {
        type: String,
        default: "div"
      },
      hljs: Object,
      katex: Object,
      theme: Object,
      themeOverrides: Object,
      componentOptions: Object,
      icons: Object,
      breakpoints: Object,
      preflightStyleDisabled: Boolean,
      styleMountTarget: Object,
      inlineThemeDisabled: {
        type: Boolean,
        default: void 0
      },
      // deprecated
      as: {
        type: String,
        validator: () => {
          warn$3("config-provider", "`as` is deprecated, please use `tag` instead.");
          return true;
        },
        default: void 0
      }
    };
    const NConfigProvider = /* @__PURE__ */ defineComponent({
      name: "ConfigProvider",
      alias: ["App"],
      props: configProviderProps,
      setup(props) {
        const NConfigProvider2 = inject(configProviderInjectionKey, null);
        const mergedThemeRef = computed(() => {
          const {
            theme
          } = props;
          if (theme === null) return void 0;
          const inheritedTheme = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value;
          return theme === void 0 ? inheritedTheme : inheritedTheme === void 0 ? theme : Object.assign({}, inheritedTheme, theme);
        });
        const mergedThemeOverridesRef = computed(() => {
          const {
            themeOverrides
          } = props;
          if (themeOverrides === null) return void 0;
          if (themeOverrides === void 0) {
            return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
          } else {
            const inheritedThemeOverrides = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
            if (inheritedThemeOverrides === void 0) {
              return themeOverrides;
            } else {
              return merge$1({}, inheritedThemeOverrides, themeOverrides);
            }
          }
        });
        const mergedNamespaceRef = useMemo(() => {
          const {
            namespace: namespace2
          } = props;
          return namespace2 === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value : namespace2;
        });
        const mergedBorderedRef = useMemo(() => {
          const {
            bordered
          } = props;
          return bordered === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBorderedRef.value : bordered;
        });
        const mergedIconsRef = computed(() => {
          const {
            icons
          } = props;
          return icons === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedIconsRef.value : icons;
        });
        const mergedComponentPropsRef = computed(() => {
          const {
            componentOptions
          } = props;
          if (componentOptions !== void 0) return componentOptions;
          return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef.value;
        });
        const mergedClsPrefixRef = computed(() => {
          const {
            clsPrefix
          } = props;
          if (clsPrefix !== void 0) return clsPrefix;
          if (NConfigProvider2) return NConfigProvider2.mergedClsPrefixRef.value;
          return defaultClsPrefix;
        });
        const mergedRtlRef = computed(() => {
          var _a;
          const {
            rtl
          } = props;
          if (rtl === void 0) {
            return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef.value;
          }
          const rtlEnabledState = {};
          for (const rtlInfo of rtl) {
            rtlEnabledState[rtlInfo.name] = markRaw(rtlInfo);
            (_a = rtlInfo.peers) === null || _a === void 0 ? void 0 : _a.forEach((peerRtlInfo) => {
              if (!(peerRtlInfo.name in rtlEnabledState)) {
                rtlEnabledState[peerRtlInfo.name] = markRaw(peerRtlInfo);
              }
            });
          }
          return rtlEnabledState;
        });
        const mergedBreakpointsRef = computed(() => {
          return props.breakpoints || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef.value);
        });
        const inlineThemeDisabled = props.inlineThemeDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled);
        const preflightStyleDisabled = props.preflightStyleDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled);
        const styleMountTarget = props.styleMountTarget || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget);
        const mergedThemeHashRef = computed(() => {
          const {
            value: theme
          } = mergedThemeRef;
          const {
            value: mergedThemeOverrides
          } = mergedThemeOverridesRef;
          const hasThemeOverrides = mergedThemeOverrides && Object.keys(mergedThemeOverrides).length !== 0;
          const themeName = theme === null || theme === void 0 ? void 0 : theme.name;
          if (themeName) {
            if (hasThemeOverrides) {
              return `${themeName}-${murmur2(JSON.stringify(mergedThemeOverridesRef.value))}`;
            }
            return themeName;
          } else {
            if (hasThemeOverrides) {
              return murmur2(JSON.stringify(mergedThemeOverridesRef.value));
            }
            return "";
          }
        });
        provide(configProviderInjectionKey, {
          mergedThemeHashRef,
          mergedBreakpointsRef,
          mergedRtlRef,
          mergedIconsRef,
          mergedComponentPropsRef,
          mergedBorderedRef,
          mergedNamespaceRef,
          mergedClsPrefixRef,
          mergedLocaleRef: computed(() => {
            const {
              locale
            } = props;
            if (locale === null) return void 0;
            return locale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedLocaleRef.value : locale;
          }),
          mergedDateLocaleRef: computed(() => {
            const {
              dateLocale
            } = props;
            if (dateLocale === null) return void 0;
            return dateLocale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedDateLocaleRef.value : dateLocale;
          }),
          mergedHljsRef: computed(() => {
            const {
              hljs
            } = props;
            return hljs === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedHljsRef.value : hljs;
          }),
          mergedKatexRef: computed(() => {
            const {
              katex
            } = props;
            return katex === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedKatexRef.value : katex;
          }),
          mergedThemeRef,
          mergedThemeOverridesRef,
          inlineThemeDisabled: inlineThemeDisabled || false,
          preflightStyleDisabled: preflightStyleDisabled || false,
          styleMountTarget
        });
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          mergedBordered: mergedBorderedRef,
          mergedNamespace: mergedNamespaceRef,
          mergedTheme: mergedThemeRef,
          mergedThemeOverrides: mergedThemeOverridesRef
        };
      },
      render() {
        var _a, _b, _c, _d;
        return !this.abstract ? h(this.as || this.tag, {
          class: `${this.mergedClsPrefix || defaultClsPrefix}-config-provider`
        }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a)) : (_d = (_c = this.$slots).default) === null || _d === void 0 ? void 0 : _d.call(_c);
      }
    });
    const popselect = {
      name: "Popselect",
      common: derived$1,
      peers: {
        Popover: popoverDark,
        InternalSelectMenu: internalSelectMenuDark
      }
    };
    function self$C(vars) {
      const {
        boxShadow2
      } = vars;
      return {
        menuBoxShadow: boxShadow2
      };
    }
    const selectLight = createTheme({
      name: "Select",
      common: derived,
      peers: {
        InternalSelection: internalSelectionLight,
        InternalSelectMenu: internalSelectMenuLight
      },
      self: self$C
    });
    const selectDark = {
      name: "Select",
      common: derived$1,
      peers: {
        InternalSelection: internalSelectionDark,
        InternalSelectMenu: internalSelectMenuDark
      },
      self: self$C
    };
    const style$d = c$1([cB("select", `
 z-index: auto;
 outline: none;
 width: 100%;
 position: relative;
 `), cB("select-menu", `
 margin: 4px 0;
 box-shadow: var(--n-menu-box-shadow);
 `, [fadeInScaleUpTransition({
      originalTransition: "background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"
    })])]);
    const selectProps = Object.assign(Object.assign({}, useTheme.props), {
      to: useAdjustedTo.propTo,
      bordered: {
        type: Boolean,
        default: void 0
      },
      clearable: Boolean,
      clearFilterAfterSelect: {
        type: Boolean,
        default: true
      },
      options: {
        type: Array,
        default: () => []
      },
      defaultValue: {
        type: [String, Number, Array],
        default: null
      },
      keyboard: {
        type: Boolean,
        default: true
      },
      value: [String, Number, Array],
      placeholder: String,
      menuProps: Object,
      multiple: Boolean,
      size: String,
      menuSize: {
        type: String
      },
      filterable: Boolean,
      disabled: {
        type: Boolean,
        default: void 0
      },
      remote: Boolean,
      loading: Boolean,
      filter: Function,
      placement: {
        type: String,
        default: "bottom-start"
      },
      widthMode: {
        type: String,
        default: "trigger"
      },
      tag: Boolean,
      onCreate: Function,
      fallbackOption: {
        type: [Function, Boolean],
        default: void 0
      },
      show: {
        type: Boolean,
        default: void 0
      },
      showArrow: {
        type: Boolean,
        default: true
      },
      maxTagCount: [Number, String],
      ellipsisTagPopoverProps: Object,
      consistentMenuWidth: {
        type: Boolean,
        default: true
      },
      virtualScroll: {
        type: Boolean,
        default: true
      },
      labelField: {
        type: String,
        default: "label"
      },
      valueField: {
        type: String,
        default: "value"
      },
      childrenField: {
        type: String,
        default: "children"
      },
      renderLabel: Function,
      renderOption: Function,
      renderTag: Function,
      "onUpdate:value": [Function, Array],
      inputProps: Object,
      nodeProps: Function,
      ignoreComposition: {
        type: Boolean,
        default: true
      },
      showOnFocus: Boolean,
      // for jsx
      onUpdateValue: [Function, Array],
      onBlur: [Function, Array],
      onClear: [Function, Array],
      onFocus: [Function, Array],
      onScroll: [Function, Array],
      onSearch: [Function, Array],
      onUpdateShow: [Function, Array],
      "onUpdate:show": [Function, Array],
      displayDirective: {
        type: String,
        default: "show"
      },
      resetMenuOnOptionsChange: {
        type: Boolean,
        default: true
      },
      status: String,
      showCheckmark: {
        type: Boolean,
        default: true
      },
      /** deprecated */
      onChange: [Function, Array],
      items: Array
    });
    const NSelect = /* @__PURE__ */ defineComponent({
      name: "Select",
      props: selectProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          mergedBorderedRef,
          namespaceRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Select", "-select", style$d, selectLight, props, mergedClsPrefixRef);
        const uncontrolledValueRef = ref(props.defaultValue);
        const controlledValueRef = toRef(props, "value");
        const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
        const focusedRef = ref(false);
        const patternRef = ref("");
        const compitableOptionsRef = useCompitable(props, ["items", "options"]);
        const createdOptionsRef = ref([]);
        const beingCreatedOptionsRef = ref([]);
        const localOptionsRef = computed(() => {
          return beingCreatedOptionsRef.value.concat(createdOptionsRef.value).concat(compitableOptionsRef.value);
        });
        const resolvedFilterRef = computed(() => {
          const {
            filter
          } = props;
          if (filter) return filter;
          const {
            labelField,
            valueField
          } = props;
          return (pattern, option) => {
            if (!option) return false;
            const label = option[labelField];
            if (typeof label === "string") {
              return patternMatched(pattern, label);
            }
            const value = option[valueField];
            if (typeof value === "string") {
              return patternMatched(pattern, value);
            }
            if (typeof value === "number") {
              return patternMatched(pattern, String(value));
            }
            return false;
          };
        });
        const filteredOptionsRef = computed(() => {
          if (props.remote) {
            return compitableOptionsRef.value;
          } else {
            const {
              value: localOptions
            } = localOptionsRef;
            const {
              value: pattern
            } = patternRef;
            if (!pattern.length || !props.filterable) {
              return localOptions;
            } else {
              return filterOptions(localOptions, resolvedFilterRef.value, pattern, props.childrenField);
            }
          }
        });
        const treeMateRef = computed(() => {
          const {
            valueField,
            childrenField
          } = props;
          const options = createTmOptions(valueField, childrenField);
          return createTreeMate(filteredOptionsRef.value, options);
        });
        const valOptMapRef = computed(() => createValOptMap(localOptionsRef.value, props.valueField, props.childrenField));
        const uncontrolledShowRef = ref(false);
        const mergedShowRef = useMergedState(toRef(props, "show"), uncontrolledShowRef);
        const triggerRef = ref(null);
        const followerRef = ref(null);
        const menuRef = ref(null);
        const {
          localeRef
        } = useLocale("Select");
        const localizedPlaceholderRef = computed(() => {
          var _a;
          return (_a = props.placeholder) !== null && _a !== void 0 ? _a : localeRef.value.placeholder;
        });
        const emptyArray = [];
        const memoValOptMapRef = ref(/* @__PURE__ */ new Map());
        const wrappedFallbackOptionRef = computed(() => {
          const {
            fallbackOption
          } = props;
          if (fallbackOption === void 0) {
            const {
              labelField,
              valueField
            } = props;
            return (value) => ({
              [labelField]: String(value),
              [valueField]: value
            });
          }
          if (fallbackOption === false) return false;
          return (value) => {
            return Object.assign(fallbackOption(value), {
              value
            });
          };
        });
        function getMergedOptions(values) {
          const remote = props.remote;
          const {
            value: memoValOptMap
          } = memoValOptMapRef;
          const {
            value: valOptMap
          } = valOptMapRef;
          const {
            value: wrappedFallbackOption
          } = wrappedFallbackOptionRef;
          const options = [];
          values.forEach((value) => {
            if (valOptMap.has(value)) {
              options.push(valOptMap.get(value));
            } else if (remote && memoValOptMap.has(value)) {
              options.push(memoValOptMap.get(value));
            } else if (wrappedFallbackOption) {
              const option = wrappedFallbackOption(value);
              if (option) {
                options.push(option);
              }
            }
          });
          return options;
        }
        const selectedOptionsRef = computed(() => {
          if (props.multiple) {
            const {
              value: values
            } = mergedValueRef;
            if (!Array.isArray(values)) return [];
            return getMergedOptions(values);
          }
          return null;
        });
        const selectedOptionRef = computed(() => {
          const {
            value: mergedValue
          } = mergedValueRef;
          if (!props.multiple && !Array.isArray(mergedValue)) {
            if (mergedValue === null) return null;
            return getMergedOptions([mergedValue])[0] || null;
          }
          return null;
        });
        const formItem = useFormItem(props);
        const {
          mergedSizeRef,
          mergedDisabledRef,
          mergedStatusRef
        } = formItem;
        function doUpdateValue(value, option) {
          const {
            onChange,
            "onUpdate:value": _onUpdateValue,
            onUpdateValue
          } = props;
          const {
            nTriggerFormChange,
            nTriggerFormInput
          } = formItem;
          if (onChange) call(onChange, value, option);
          if (onUpdateValue) call(onUpdateValue, value, option);
          if (_onUpdateValue) {
            call(_onUpdateValue, value, option);
          }
          uncontrolledValueRef.value = value;
          nTriggerFormChange();
          nTriggerFormInput();
        }
        function doBlur(e) {
          const {
            onBlur
          } = props;
          const {
            nTriggerFormBlur
          } = formItem;
          if (onBlur) call(onBlur, e);
          nTriggerFormBlur();
        }
        function doClear() {
          const {
            onClear
          } = props;
          if (onClear) call(onClear);
        }
        function doFocus(e) {
          const {
            onFocus,
            showOnFocus
          } = props;
          const {
            nTriggerFormFocus
          } = formItem;
          if (onFocus) call(onFocus, e);
          nTriggerFormFocus();
          if (showOnFocus) {
            openMenu();
          }
        }
        function doSearch(value) {
          const {
            onSearch
          } = props;
          if (onSearch) call(onSearch, value);
        }
        function doScroll(e) {
          const {
            onScroll
          } = props;
          if (onScroll) call(onScroll, e);
        }
        function updateMemorizedOptions() {
          var _a;
          const {
            remote,
            multiple
          } = props;
          if (remote) {
            const {
              value: memoValOptMap
            } = memoValOptMapRef;
            if (multiple) {
              const {
                valueField
              } = props;
              (_a = selectedOptionsRef.value) === null || _a === void 0 ? void 0 : _a.forEach((option) => {
                memoValOptMap.set(option[valueField], option);
              });
            } else {
              const option = selectedOptionRef.value;
              if (option) {
                memoValOptMap.set(option[props.valueField], option);
              }
            }
          }
        }
        function doUpdateShow(value) {
          const {
            onUpdateShow,
            "onUpdate:show": _onUpdateShow
          } = props;
          if (onUpdateShow) call(onUpdateShow, value);
          if (_onUpdateShow) call(_onUpdateShow, value);
          uncontrolledShowRef.value = value;
        }
        function openMenu() {
          if (!mergedDisabledRef.value) {
            doUpdateShow(true);
            uncontrolledShowRef.value = true;
            if (props.filterable) {
              focusSelectionInput();
            }
          }
        }
        function closeMenu() {
          doUpdateShow(false);
        }
        function handleMenuAfterLeave() {
          patternRef.value = "";
          beingCreatedOptionsRef.value = emptyArray;
        }
        const activeWithoutMenuOpenRef = ref(false);
        function onTriggerInputFocus() {
          if (props.filterable) {
            activeWithoutMenuOpenRef.value = true;
          }
        }
        function onTriggerInputBlur() {
          if (props.filterable) {
            activeWithoutMenuOpenRef.value = false;
            if (!mergedShowRef.value) {
              handleMenuAfterLeave();
            }
          }
        }
        function handleTriggerClick() {
          if (mergedDisabledRef.value) return;
          if (!mergedShowRef.value) {
            openMenu();
          } else {
            if (!props.filterable) {
              closeMenu();
            } else {
              focusSelectionInput();
            }
          }
        }
        function handleTriggerBlur(e) {
          var _a, _b;
          if ((_b = (_a = menuRef.value) === null || _a === void 0 ? void 0 : _a.selfRef) === null || _b === void 0 ? void 0 : _b.contains(e.relatedTarget)) {
            return;
          }
          focusedRef.value = false;
          doBlur(e);
          closeMenu();
        }
        function handleTriggerFocus(e) {
          doFocus(e);
          focusedRef.value = true;
        }
        function handleMenuFocus() {
          focusedRef.value = true;
        }
        function handleMenuBlur(e) {
          var _a;
          if ((_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains(e.relatedTarget)) return;
          focusedRef.value = false;
          doBlur(e);
          closeMenu();
        }
        function handleMenuTabOut() {
          var _a;
          (_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.focus();
          closeMenu();
        }
        function handleMenuClickOutside(e) {
          var _a;
          if (mergedShowRef.value) {
            if (!((_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains(getPreciseEventTarget(e)))) {
              closeMenu();
            }
          }
        }
        function createClearedMultipleSelectValue(value) {
          if (!Array.isArray(value)) return [];
          if (wrappedFallbackOptionRef.value) {
            return Array.from(value);
          } else {
            const {
              remote
            } = props;
            const {
              value: valOptMap
            } = valOptMapRef;
            if (remote) {
              const {
                value: memoValOptMap
              } = memoValOptMapRef;
              return value.filter((v) => valOptMap.has(v) || memoValOptMap.has(v));
            } else {
              return value.filter((v) => valOptMap.has(v));
            }
          }
        }
        function handleToggleByTmNode(tmNode) {
          handleToggleByOption(tmNode.rawNode);
        }
        function handleToggleByOption(option) {
          if (mergedDisabledRef.value) return;
          const {
            tag,
            remote,
            clearFilterAfterSelect,
            valueField
          } = props;
          if (tag && !remote) {
            const {
              value: beingCreatedOptions
            } = beingCreatedOptionsRef;
            const beingCreatedOption = beingCreatedOptions[0] || null;
            if (beingCreatedOption) {
              const createdOptions = createdOptionsRef.value;
              if (!createdOptions.length) {
                createdOptionsRef.value = [beingCreatedOption];
              } else {
                createdOptions.push(beingCreatedOption);
              }
              beingCreatedOptionsRef.value = emptyArray;
            }
          }
          if (remote) {
            memoValOptMapRef.value.set(option[valueField], option);
          }
          if (props.multiple) {
            const changedValue = createClearedMultipleSelectValue(mergedValueRef.value);
            const index = changedValue.findIndex((value) => value === option[valueField]);
            if (~index) {
              changedValue.splice(index, 1);
              if (tag && !remote) {
                const createdOptionIndex = getCreatedOptionIndex(option[valueField]);
                if (~createdOptionIndex) {
                  createdOptionsRef.value.splice(createdOptionIndex, 1);
                  if (clearFilterAfterSelect) patternRef.value = "";
                }
              }
            } else {
              changedValue.push(option[valueField]);
              if (clearFilterAfterSelect) patternRef.value = "";
            }
            doUpdateValue(changedValue, getMergedOptions(changedValue));
          } else {
            if (tag && !remote) {
              const createdOptionIndex = getCreatedOptionIndex(option[valueField]);
              if (~createdOptionIndex) {
                createdOptionsRef.value = [createdOptionsRef.value[createdOptionIndex]];
              } else {
                createdOptionsRef.value = emptyArray;
              }
            }
            focusSelection();
            closeMenu();
            doUpdateValue(option[valueField], option);
          }
        }
        function getCreatedOptionIndex(optionValue) {
          const createdOptions = createdOptionsRef.value;
          return createdOptions.findIndex((createdOption) => createdOption[props.valueField] === optionValue);
        }
        function handlePatternInput(e) {
          if (!mergedShowRef.value) {
            openMenu();
          }
          const {
            value
          } = e.target;
          patternRef.value = value;
          const {
            tag,
            remote
          } = props;
          doSearch(value);
          if (tag && !remote) {
            if (!value) {
              beingCreatedOptionsRef.value = emptyArray;
              return;
            }
            const {
              onCreate
            } = props;
            const optionBeingCreated = onCreate ? onCreate(value) : {
              [props.labelField]: value,
              [props.valueField]: value
            };
            const {
              valueField,
              labelField
            } = props;
            if (compitableOptionsRef.value.some((option) => {
              return option[valueField] === optionBeingCreated[valueField] || option[labelField] === optionBeingCreated[labelField];
            }) || createdOptionsRef.value.some((option) => {
              return option[valueField] === optionBeingCreated[valueField] || option[labelField] === optionBeingCreated[labelField];
            })) {
              beingCreatedOptionsRef.value = emptyArray;
            } else {
              beingCreatedOptionsRef.value = [optionBeingCreated];
            }
          }
        }
        function handleClear(e) {
          e.stopPropagation();
          const {
            multiple
          } = props;
          if (!multiple && props.filterable) {
            closeMenu();
          }
          doClear();
          if (multiple) {
            doUpdateValue([], []);
          } else {
            doUpdateValue(null, null);
          }
        }
        function handleMenuMousedown(e) {
          if (!happensIn(e, "action") && !happensIn(e, "empty") && !happensIn(e, "header")) {
            e.preventDefault();
          }
        }
        function handleMenuScroll(e) {
          doScroll(e);
        }
        function handleKeydown(e) {
          var _a, _b, _c, _d, _e;
          if (!props.keyboard) {
            e.preventDefault();
            return;
          }
          switch (e.key) {
            case " ":
              if (props.filterable) {
                break;
              } else {
                e.preventDefault();
              }
            case "Enter":
              if (!((_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.isComposing)) {
                if (mergedShowRef.value) {
                  const pendingTmNode = (_b = menuRef.value) === null || _b === void 0 ? void 0 : _b.getPendingTmNode();
                  if (pendingTmNode) {
                    handleToggleByTmNode(pendingTmNode);
                  } else if (!props.filterable) {
                    closeMenu();
                    focusSelection();
                  }
                } else {
                  openMenu();
                  if (props.tag && activeWithoutMenuOpenRef.value) {
                    const beingCreatedOption = beingCreatedOptionsRef.value[0];
                    if (beingCreatedOption) {
                      const optionValue = beingCreatedOption[props.valueField];
                      const {
                        value: mergedValue
                      } = mergedValueRef;
                      if (props.multiple) {
                        if (Array.isArray(mergedValue) && mergedValue.includes(optionValue)) ;
                        else {
                          handleToggleByOption(beingCreatedOption);
                        }
                      } else {
                        handleToggleByOption(beingCreatedOption);
                      }
                    }
                  }
                }
              }
              e.preventDefault();
              break;
            case "ArrowUp":
              e.preventDefault();
              if (props.loading) return;
              if (mergedShowRef.value) {
                (_c = menuRef.value) === null || _c === void 0 ? void 0 : _c.prev();
              }
              break;
            case "ArrowDown":
              e.preventDefault();
              if (props.loading) return;
              if (mergedShowRef.value) {
                (_d = menuRef.value) === null || _d === void 0 ? void 0 : _d.next();
              } else {
                openMenu();
              }
              break;
            case "Escape":
              if (mergedShowRef.value) {
                markEventEffectPerformed(e);
                closeMenu();
              }
              (_e = triggerRef.value) === null || _e === void 0 ? void 0 : _e.focus();
              break;
          }
        }
        function focusSelection() {
          var _a;
          (_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.focus();
        }
        function focusSelectionInput() {
          var _a;
          (_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.focusInput();
        }
        function handleTriggerOrMenuResize() {
          var _a;
          if (!mergedShowRef.value) return;
          (_a = followerRef.value) === null || _a === void 0 ? void 0 : _a.syncPosition();
        }
        updateMemorizedOptions();
        watch(toRef(props, "options"), updateMemorizedOptions);
        const exposedMethods = {
          focus: () => {
            var _a;
            (_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.focus();
          },
          focusInput: () => {
            var _a;
            (_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.focusInput();
          },
          blur: () => {
            var _a;
            (_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.blur();
          },
          blurInput: () => {
            var _a;
            (_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.blurInput();
          }
        };
        const cssVarsRef = computed(() => {
          const {
            self: {
              menuBoxShadow
            }
          } = themeRef.value;
          return {
            "--n-menu-box-shadow": menuBoxShadow
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("select", void 0, cssVarsRef, props) : void 0;
        return Object.assign(Object.assign({}, exposedMethods), {
          mergedStatus: mergedStatusRef,
          mergedClsPrefix: mergedClsPrefixRef,
          mergedBordered: mergedBorderedRef,
          namespace: namespaceRef,
          treeMate: treeMateRef,
          isMounted: isMounted(),
          triggerRef,
          menuRef,
          pattern: patternRef,
          uncontrolledShow: uncontrolledShowRef,
          mergedShow: mergedShowRef,
          adjustedTo: useAdjustedTo(props),
          uncontrolledValue: uncontrolledValueRef,
          mergedValue: mergedValueRef,
          followerRef,
          localizedPlaceholder: localizedPlaceholderRef,
          selectedOption: selectedOptionRef,
          selectedOptions: selectedOptionsRef,
          mergedSize: mergedSizeRef,
          mergedDisabled: mergedDisabledRef,
          focused: focusedRef,
          activeWithoutMenuOpen: activeWithoutMenuOpenRef,
          inlineThemeDisabled,
          onTriggerInputFocus,
          onTriggerInputBlur,
          handleTriggerOrMenuResize,
          handleMenuFocus,
          handleMenuBlur,
          handleMenuTabOut,
          handleTriggerClick,
          handleToggle: handleToggleByTmNode,
          handleDeleteOption: handleToggleByOption,
          handlePatternInput,
          handleClear,
          handleTriggerBlur,
          handleTriggerFocus,
          handleKeydown,
          handleMenuAfterLeave,
          handleMenuClickOutside,
          handleMenuScroll,
          handleMenuKeydown: handleKeydown,
          handleMenuMousedown,
          mergedTheme: themeRef,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        });
      },
      render() {
        return h("div", {
          class: `${this.mergedClsPrefix}-select`
        }, h(Binder, null, {
          default: () => [h(VTarget, null, {
            default: () => h(NInternalSelection, {
              ref: "triggerRef",
              inlineThemeDisabled: this.inlineThemeDisabled,
              status: this.mergedStatus,
              inputProps: this.inputProps,
              clsPrefix: this.mergedClsPrefix,
              showArrow: this.showArrow,
              maxTagCount: this.maxTagCount,
              ellipsisTagPopoverProps: this.ellipsisTagPopoverProps,
              bordered: this.mergedBordered,
              active: this.activeWithoutMenuOpen || this.mergedShow,
              pattern: this.pattern,
              placeholder: this.localizedPlaceholder,
              selectedOption: this.selectedOption,
              selectedOptions: this.selectedOptions,
              multiple: this.multiple,
              renderTag: this.renderTag,
              renderLabel: this.renderLabel,
              filterable: this.filterable,
              clearable: this.clearable,
              disabled: this.mergedDisabled,
              size: this.mergedSize,
              theme: this.mergedTheme.peers.InternalSelection,
              labelField: this.labelField,
              valueField: this.valueField,
              themeOverrides: this.mergedTheme.peerOverrides.InternalSelection,
              loading: this.loading,
              focused: this.focused,
              onClick: this.handleTriggerClick,
              onDeleteOption: this.handleDeleteOption,
              onPatternInput: this.handlePatternInput,
              onClear: this.handleClear,
              onBlur: this.handleTriggerBlur,
              onFocus: this.handleTriggerFocus,
              onKeydown: this.handleKeydown,
              onPatternBlur: this.onTriggerInputBlur,
              onPatternFocus: this.onTriggerInputFocus,
              onResize: this.handleTriggerOrMenuResize,
              ignoreComposition: this.ignoreComposition
            }, {
              arrow: () => {
                var _a, _b;
                return [(_b = (_a = this.$slots).arrow) === null || _b === void 0 ? void 0 : _b.call(_a)];
              }
            })
          }), h(VFollower, {
            ref: "followerRef",
            show: this.mergedShow,
            to: this.adjustedTo,
            teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey,
            containerClass: this.namespace,
            width: this.consistentMenuWidth ? "target" : void 0,
            minWidth: "target",
            placement: this.placement
          }, {
            default: () => h(Transition, {
              name: "fade-in-scale-up-transition",
              appear: this.isMounted,
              onAfterLeave: this.handleMenuAfterLeave
            }, {
              default: () => {
                var _a, _b, _c;
                if (!(this.mergedShow || this.displayDirective === "show")) {
                  return null;
                }
                (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
                return withDirectives(h(NInternalSelectMenu, Object.assign({}, this.menuProps, {
                  ref: "menuRef",
                  onResize: this.handleTriggerOrMenuResize,
                  inlineThemeDisabled: this.inlineThemeDisabled,
                  virtualScroll: this.consistentMenuWidth && this.virtualScroll,
                  class: [`${this.mergedClsPrefix}-select-menu`, this.themeClass, (_b = this.menuProps) === null || _b === void 0 ? void 0 : _b.class],
                  clsPrefix: this.mergedClsPrefix,
                  focusable: true,
                  labelField: this.labelField,
                  valueField: this.valueField,
                  autoPending: true,
                  nodeProps: this.nodeProps,
                  theme: this.mergedTheme.peers.InternalSelectMenu,
                  themeOverrides: this.mergedTheme.peerOverrides.InternalSelectMenu,
                  treeMate: this.treeMate,
                  multiple: this.multiple,
                  size: this.menuSize,
                  renderOption: this.renderOption,
                  renderLabel: this.renderLabel,
                  value: this.mergedValue,
                  style: [(_c = this.menuProps) === null || _c === void 0 ? void 0 : _c.style, this.cssVars],
                  onToggle: this.handleToggle,
                  onScroll: this.handleMenuScroll,
                  onFocus: this.handleMenuFocus,
                  onBlur: this.handleMenuBlur,
                  onKeydown: this.handleMenuKeydown,
                  onTabOut: this.handleMenuTabOut,
                  onMousedown: this.handleMenuMousedown,
                  show: this.mergedShow,
                  showCheckmark: this.showCheckmark,
                  resetMenuOnOptionsChange: this.resetMenuOnOptionsChange
                }), {
                  empty: () => {
                    var _a2, _b2;
                    return [(_b2 = (_a2 = this.$slots).empty) === null || _b2 === void 0 ? void 0 : _b2.call(_a2)];
                  },
                  header: () => {
                    var _a2, _b2;
                    return [(_b2 = (_a2 = this.$slots).header) === null || _b2 === void 0 ? void 0 : _b2.call(_a2)];
                  },
                  action: () => {
                    var _a2, _b2;
                    return [(_b2 = (_a2 = this.$slots).action) === null || _b2 === void 0 ? void 0 : _b2.call(_a2)];
                  }
                }), this.displayDirective === "show" ? [[vShow, this.mergedShow], [clickoutside, this.handleMenuClickOutside, void 0, {
                  capture: true
                }]] : [[clickoutside, this.handleMenuClickOutside, void 0, {
                  capture: true
                }]]);
              }
            })
          })]
        }));
      }
    });
    const commonVariables$b = {
      itemPaddingSmall: "0 4px",
      itemMarginSmall: "0 0 0 8px",
      itemMarginSmallRtl: "0 8px 0 0",
      itemPaddingMedium: "0 4px",
      itemMarginMedium: "0 0 0 8px",
      itemMarginMediumRtl: "0 8px 0 0",
      itemPaddingLarge: "0 4px",
      itemMarginLarge: "0 0 0 8px",
      itemMarginLargeRtl: "0 8px 0 0",
      buttonIconSizeSmall: "14px",
      buttonIconSizeMedium: "16px",
      buttonIconSizeLarge: "18px",
      inputWidthSmall: "60px",
      selectWidthSmall: "unset",
      inputMarginSmall: "0 0 0 8px",
      inputMarginSmallRtl: "0 8px 0 0",
      selectMarginSmall: "0 0 0 8px",
      prefixMarginSmall: "0 8px 0 0",
      suffixMarginSmall: "0 0 0 8px",
      inputWidthMedium: "60px",
      selectWidthMedium: "unset",
      inputMarginMedium: "0 0 0 8px",
      inputMarginMediumRtl: "0 8px 0 0",
      selectMarginMedium: "0 0 0 8px",
      prefixMarginMedium: "0 8px 0 0",
      suffixMarginMedium: "0 0 0 8px",
      inputWidthLarge: "60px",
      selectWidthLarge: "unset",
      inputMarginLarge: "0 0 0 8px",
      inputMarginLargeRtl: "0 8px 0 0",
      selectMarginLarge: "0 0 0 8px",
      prefixMarginLarge: "0 8px 0 0",
      suffixMarginLarge: "0 0 0 8px"
    };
    function self$B(vars) {
      const {
        textColor2,
        primaryColor,
        primaryColorHover,
        primaryColorPressed,
        inputColorDisabled,
        textColorDisabled,
        borderColor,
        borderRadius,
        // item font size
        fontSizeTiny,
        fontSizeSmall,
        fontSizeMedium,
        // item size
        heightTiny,
        heightSmall,
        heightMedium
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$b), {
        buttonColor: "#0000",
        buttonColorHover: "#0000",
        buttonColorPressed: "#0000",
        buttonBorder: `1px solid ${borderColor}`,
        buttonBorderHover: `1px solid ${borderColor}`,
        buttonBorderPressed: `1px solid ${borderColor}`,
        buttonIconColor: textColor2,
        buttonIconColorHover: textColor2,
        buttonIconColorPressed: textColor2,
        itemTextColor: textColor2,
        itemTextColorHover: primaryColorHover,
        itemTextColorPressed: primaryColorPressed,
        itemTextColorActive: primaryColor,
        itemTextColorDisabled: textColorDisabled,
        itemColor: "#0000",
        itemColorHover: "#0000",
        itemColorPressed: "#0000",
        itemColorActive: "#0000",
        itemColorActiveHover: "#0000",
        itemColorDisabled: inputColorDisabled,
        itemBorder: "1px solid #0000",
        itemBorderHover: "1px solid #0000",
        itemBorderPressed: "1px solid #0000",
        itemBorderActive: `1px solid ${primaryColor}`,
        itemBorderDisabled: `1px solid ${borderColor}`,
        itemBorderRadius: borderRadius,
        itemSizeSmall: heightTiny,
        itemSizeMedium: heightSmall,
        itemSizeLarge: heightMedium,
        itemFontSizeSmall: fontSizeTiny,
        itemFontSizeMedium: fontSizeSmall,
        itemFontSizeLarge: fontSizeMedium,
        jumperFontSizeSmall: fontSizeTiny,
        jumperFontSizeMedium: fontSizeSmall,
        jumperFontSizeLarge: fontSizeMedium,
        jumperTextColor: textColor2,
        jumperTextColorDisabled: textColorDisabled
      });
    }
    const paginationDark = {
      name: "Pagination",
      common: derived$1,
      peers: {
        Select: selectDark,
        Input: inputDark,
        Popselect: popselect
      },
      self(vars) {
        const {
          primaryColor,
          opacity3
        } = vars;
        const borderColorActive = changeColor(primaryColor, {
          alpha: Number(opacity3)
        });
        const commonSelf = self$B(vars);
        commonSelf.itemBorderActive = `1px solid ${borderColorActive}`;
        commonSelf.itemBorderDisabled = "1px solid #0000";
        return commonSelf;
      }
    };
    const commonVars$9 = {
      padding: "8px 14px"
    };
    const tooltipDark = {
      name: "Tooltip",
      common: derived$1,
      peers: {
        Popover: popoverDark
      },
      self(vars) {
        const {
          borderRadius,
          boxShadow2,
          popoverColor,
          textColor2
        } = vars;
        return Object.assign(Object.assign({}, commonVars$9), {
          borderRadius,
          boxShadow: boxShadow2,
          color: popoverColor,
          textColor: textColor2
        });
      }
    };
    function self$A(vars) {
      const {
        borderRadius,
        boxShadow2,
        baseColor
      } = vars;
      return Object.assign(Object.assign({}, commonVars$9), {
        borderRadius,
        boxShadow: boxShadow2,
        color: composite(baseColor, "rgba(0, 0, 0, .85)"),
        textColor: baseColor
      });
    }
    const tooltipLight = createTheme({
      name: "Tooltip",
      common: derived,
      peers: {
        Popover: popoverLight
      },
      self: self$A
    });
    const ellipsisDark = {
      name: "Ellipsis",
      common: derived$1,
      peers: {
        Tooltip: tooltipDark
      }
    };
    const commonVariables$a = {
      radioSizeSmall: "14px",
      radioSizeMedium: "16px",
      radioSizeLarge: "18px",
      labelPadding: "0 8px",
      labelFontWeight: "400"
    };
    const radioDark = {
      name: "Radio",
      common: derived$1,
      self(vars) {
        const {
          borderColor,
          primaryColor,
          baseColor,
          textColorDisabled,
          inputColorDisabled,
          textColor2,
          opacityDisabled,
          borderRadius,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          heightSmall,
          heightMedium,
          heightLarge,
          lineHeight: lineHeight2
        } = vars;
        return Object.assign(Object.assign({}, commonVariables$a), {
          labelLineHeight: lineHeight2,
          buttonHeightSmall: heightSmall,
          buttonHeightMedium: heightMedium,
          buttonHeightLarge: heightLarge,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          boxShadow: `inset 0 0 0 1px ${borderColor}`,
          boxShadowActive: `inset 0 0 0 1px ${primaryColor}`,
          boxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${changeColor(primaryColor, {
            alpha: 0.3
          })}`,
          boxShadowHover: `inset 0 0 0 1px ${primaryColor}`,
          boxShadowDisabled: `inset 0 0 0 1px ${borderColor}`,
          color: "#0000",
          colorDisabled: inputColorDisabled,
          colorActive: "#0000",
          textColor: textColor2,
          textColorDisabled,
          dotColorActive: primaryColor,
          dotColorDisabled: borderColor,
          buttonBorderColor: borderColor,
          buttonBorderColorActive: primaryColor,
          buttonBorderColorHover: primaryColor,
          buttonColor: "#0000",
          buttonColorActive: primaryColor,
          buttonTextColor: textColor2,
          buttonTextColorActive: baseColor,
          buttonTextColorHover: primaryColor,
          opacityDisabled,
          buttonBoxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${changeColor(primaryColor, {
            alpha: 0.3
          })}`,
          buttonBoxShadowHover: `inset 0 0 0 1px ${primaryColor}`,
          buttonBoxShadow: "inset 0 0 0 1px #0000",
          buttonBorderRadius: borderRadius
        });
      }
    };
    const commonVariables$9 = {
      padding: "4px 0",
      optionIconSizeSmall: "14px",
      optionIconSizeMedium: "16px",
      optionIconSizeLarge: "16px",
      optionIconSizeHuge: "18px",
      optionSuffixWidthSmall: "14px",
      optionSuffixWidthMedium: "14px",
      optionSuffixWidthLarge: "16px",
      optionSuffixWidthHuge: "16px",
      optionIconSuffixWidthSmall: "32px",
      optionIconSuffixWidthMedium: "32px",
      optionIconSuffixWidthLarge: "36px",
      optionIconSuffixWidthHuge: "36px",
      optionPrefixWidthSmall: "14px",
      optionPrefixWidthMedium: "14px",
      optionPrefixWidthLarge: "16px",
      optionPrefixWidthHuge: "16px",
      optionIconPrefixWidthSmall: "36px",
      optionIconPrefixWidthMedium: "36px",
      optionIconPrefixWidthLarge: "40px",
      optionIconPrefixWidthHuge: "40px"
    };
    function self$z(vars) {
      const {
        primaryColor,
        textColor2,
        dividerColor,
        hoverColor,
        popoverColor,
        invertedColor,
        borderRadius,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        fontSizeHuge,
        heightSmall,
        heightMedium,
        heightLarge,
        heightHuge,
        textColor3,
        opacityDisabled
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$9), {
        optionHeightSmall: heightSmall,
        optionHeightMedium: heightMedium,
        optionHeightLarge: heightLarge,
        optionHeightHuge: heightHuge,
        borderRadius,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        fontSizeHuge,
        // non-inverted
        optionTextColor: textColor2,
        optionTextColorHover: textColor2,
        optionTextColorActive: primaryColor,
        optionTextColorChildActive: primaryColor,
        color: popoverColor,
        dividerColor,
        suffixColor: textColor2,
        prefixColor: textColor2,
        optionColorHover: hoverColor,
        optionColorActive: changeColor(primaryColor, {
          alpha: 0.1
        }),
        groupHeaderTextColor: textColor3,
        // inverted
        optionTextColorInverted: "#BBB",
        optionTextColorHoverInverted: "#FFF",
        optionTextColorActiveInverted: "#FFF",
        optionTextColorChildActiveInverted: "#FFF",
        colorInverted: invertedColor,
        dividerColorInverted: "#BBB",
        suffixColorInverted: "#BBB",
        prefixColorInverted: "#BBB",
        optionColorHoverInverted: primaryColor,
        optionColorActiveInverted: primaryColor,
        groupHeaderTextColorInverted: "#AAA",
        optionOpacityDisabled: opacityDisabled
      });
    }
    const dropdownDark = {
      name: "Dropdown",
      common: derived$1,
      peers: {
        Popover: popoverDark
      },
      self(vars) {
        const {
          primaryColorSuppl,
          primaryColor,
          popoverColor
        } = vars;
        const commonSelf = self$z(vars);
        commonSelf.colorInverted = popoverColor;
        commonSelf.optionColorActive = changeColor(primaryColor, {
          alpha: 0.15
        });
        commonSelf.optionColorActiveInverted = primaryColorSuppl;
        commonSelf.optionColorHoverInverted = primaryColorSuppl;
        return commonSelf;
      }
    };
    const commonVariables$8 = {
      thPaddingSmall: "8px",
      thPaddingMedium: "12px",
      thPaddingLarge: "12px",
      tdPaddingSmall: "8px",
      tdPaddingMedium: "12px",
      tdPaddingLarge: "12px",
      sorterSize: "15px",
      resizableContainerSize: "8px",
      resizableSize: "2px",
      filterSize: "15px",
      paginationMargin: "12px 0 0 0",
      emptyPadding: "48px 0",
      actionPadding: "8px 12px",
      actionButtonMargin: "0 8px 0 0"
    };
    function self$y(vars) {
      const {
        cardColor,
        modalColor,
        popoverColor,
        textColor2,
        textColor1,
        tableHeaderColor,
        tableColorHover,
        iconColor,
        primaryColor,
        fontWeightStrong,
        borderRadius,
        lineHeight: lineHeight2,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        dividerColor,
        heightSmall,
        opacityDisabled,
        tableColorStriped
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$8), {
        actionDividerColor: dividerColor,
        lineHeight: lineHeight2,
        borderRadius,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        borderColor: composite(cardColor, dividerColor),
        tdColorHover: composite(cardColor, tableColorHover),
        tdColorSorting: composite(cardColor, tableColorHover),
        tdColorStriped: composite(cardColor, tableColorStriped),
        thColor: composite(cardColor, tableHeaderColor),
        thColorHover: composite(composite(cardColor, tableHeaderColor), tableColorHover),
        thColorSorting: composite(composite(cardColor, tableHeaderColor), tableColorHover),
        tdColor: cardColor,
        tdTextColor: textColor2,
        thTextColor: textColor1,
        thFontWeight: fontWeightStrong,
        thButtonColorHover: tableColorHover,
        thIconColor: iconColor,
        thIconColorActive: primaryColor,
        // modal
        borderColorModal: composite(modalColor, dividerColor),
        tdColorHoverModal: composite(modalColor, tableColorHover),
        tdColorSortingModal: composite(modalColor, tableColorHover),
        tdColorStripedModal: composite(modalColor, tableColorStriped),
        thColorModal: composite(modalColor, tableHeaderColor),
        thColorHoverModal: composite(composite(modalColor, tableHeaderColor), tableColorHover),
        thColorSortingModal: composite(composite(modalColor, tableHeaderColor), tableColorHover),
        tdColorModal: modalColor,
        // popover
        borderColorPopover: composite(popoverColor, dividerColor),
        tdColorHoverPopover: composite(popoverColor, tableColorHover),
        tdColorSortingPopover: composite(popoverColor, tableColorHover),
        tdColorStripedPopover: composite(popoverColor, tableColorStriped),
        thColorPopover: composite(popoverColor, tableHeaderColor),
        thColorHoverPopover: composite(composite(popoverColor, tableHeaderColor), tableColorHover),
        thColorSortingPopover: composite(composite(popoverColor, tableHeaderColor), tableColorHover),
        tdColorPopover: popoverColor,
        boxShadowBefore: "inset -12px 0 8px -12px rgba(0, 0, 0, .18)",
        boxShadowAfter: "inset 12px 0 8px -12px rgba(0, 0, 0, .18)",
        // loading
        loadingColor: primaryColor,
        loadingSize: heightSmall,
        opacityLoading: opacityDisabled
      });
    }
    const dataTableDark = {
      name: "DataTable",
      common: derived$1,
      peers: {
        Button: buttonDark,
        Checkbox: checkboxDark,
        Radio: radioDark,
        Pagination: paginationDark,
        Scrollbar: scrollbarDark,
        Empty: emptyDark,
        Popover: popoverDark,
        Ellipsis: ellipsisDark,
        Dropdown: dropdownDark
      },
      self(vars) {
        const commonSelf = self$y(vars);
        commonSelf.boxShadowAfter = "inset 12px 0 8px -12px rgba(0, 0, 0, .36)";
        commonSelf.boxShadowBefore = "inset -12px 0 8px -12px rgba(0, 0, 0, .36)";
        return commonSelf;
      }
    };
    const tooltipProps = Object.assign(Object.assign({}, popoverBaseProps), useTheme.props);
    const NTooltip = /* @__PURE__ */ defineComponent({
      name: "Tooltip",
      props: tooltipProps,
      __popover__: true,
      setup(props) {
        const {
          mergedClsPrefixRef
        } = useConfig(props);
        const themeRef = useTheme("Tooltip", "-tooltip", void 0, tooltipLight, props, mergedClsPrefixRef);
        const popoverRef = ref(null);
        const tooltipExposedMethod = {
          syncPosition() {
            popoverRef.value.syncPosition();
          },
          setShow(show) {
            popoverRef.value.setShow(show);
          }
        };
        return Object.assign(Object.assign({}, tooltipExposedMethod), {
          popoverRef,
          mergedTheme: themeRef,
          popoverThemeOverrides: computed(() => {
            return themeRef.value.self;
          })
        });
      },
      render() {
        const {
          mergedTheme,
          internalExtraClass
        } = this;
        return h(NPopover, Object.assign(Object.assign({}, this.$props), {
          theme: mergedTheme.peers.Popover,
          themeOverrides: mergedTheme.peerOverrides.Popover,
          builtinThemeOverrides: this.popoverThemeOverrides,
          internalExtraClass: internalExtraClass.concat("tooltip"),
          ref: "popoverRef"
        }), this.$slots);
      }
    });
    function self$x(vars) {
      const {
        textColorBase,
        opacity1,
        opacity2,
        opacity3,
        opacity4,
        opacity5
      } = vars;
      return {
        color: textColorBase,
        opacity1Depth: opacity1,
        opacity2Depth: opacity2,
        opacity3Depth: opacity3,
        opacity4Depth: opacity4,
        opacity5Depth: opacity5
      };
    }
    const iconLight = {
      name: "Icon",
      common: derived,
      self: self$x
    };
    const iconDark$1 = {
      name: "Icon",
      common: derived$1,
      self: self$x
    };
    const style$c = cB("icon", `
 height: 1em;
 width: 1em;
 line-height: 1em;
 text-align: center;
 display: inline-block;
 position: relative;
 fill: currentColor;
 transform: translateZ(0);
`, [cM("color-transition", {
      transition: "color .3s var(--n-bezier)"
    }), cM("depth", {
      color: "var(--n-color)"
    }, [c$1("svg", {
      opacity: "var(--n-opacity)",
      transition: "opacity .3s var(--n-bezier)"
    })]), c$1("svg", {
      height: "1em",
      width: "1em"
    })]);
    const iconProps = Object.assign(Object.assign({}, useTheme.props), {
      depth: [String, Number],
      size: [Number, String],
      color: String,
      component: [Object, Function]
    });
    const NIcon = /* @__PURE__ */ defineComponent({
      _n_icon__: true,
      name: "Icon",
      inheritAttrs: false,
      props: iconProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Icon", "-icon", style$c, iconLight, props, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            depth
          } = props;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: self2
          } = themeRef.value;
          if (depth !== void 0) {
            const {
              color,
              [`opacity${depth}Depth`]: opacity
            } = self2;
            return {
              "--n-bezier": cubicBezierEaseInOut2,
              "--n-color": color,
              "--n-opacity": opacity
            };
          }
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-color": "",
            "--n-opacity": ""
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("icon", computed(() => `${props.depth || "d"}`), cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          mergedStyle: computed(() => {
            const {
              size: size2,
              color
            } = props;
            return {
              fontSize: formatLength(size2),
              color
            };
          }),
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        var _a;
        const {
          $parent,
          depth,
          mergedClsPrefix,
          component,
          onRender,
          themeClass
        } = this;
        if ((_a = $parent === null || $parent === void 0 ? void 0 : $parent.$options) === null || _a === void 0 ? void 0 : _a._n_icon__) {
          warn$3("icon", "don't wrap `n-icon` inside `n-icon`");
        }
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h("i", mergeProps(this.$attrs, {
          role: "img",
          class: [`${mergedClsPrefix}-icon`, themeClass, {
            [`${mergedClsPrefix}-icon--depth`]: depth,
            [`${mergedClsPrefix}-icon--color-transition`]: depth !== void 0
          }],
          style: [this.cssVars, this.mergedStyle]
        }), component ? h(component) : this.$slots);
      }
    });
    const commonVars$8 = {
      itemFontSize: "12px",
      itemHeight: "36px",
      itemWidth: "52px",
      panelActionPadding: "8px 0"
    };
    function self$w(vars) {
      const {
        popoverColor,
        textColor2,
        primaryColor,
        hoverColor,
        dividerColor,
        opacityDisabled,
        boxShadow2,
        borderRadius,
        iconColor,
        iconColorDisabled
      } = vars;
      return Object.assign(Object.assign({}, commonVars$8), {
        panelColor: popoverColor,
        panelBoxShadow: boxShadow2,
        panelDividerColor: dividerColor,
        itemTextColor: textColor2,
        itemTextColorActive: primaryColor,
        itemColorHover: hoverColor,
        itemOpacityDisabled: opacityDisabled,
        itemBorderRadius: borderRadius,
        borderRadius,
        iconColor,
        iconColorDisabled
      });
    }
    const timePickerDark = {
      name: "TimePicker",
      common: derived$1,
      peers: {
        Scrollbar: scrollbarDark,
        Button: buttonDark,
        Input: inputDark
      },
      self: self$w
    };
    const commonVars$7 = {
      itemSize: "24px",
      itemCellWidth: "38px",
      itemCellHeight: "32px",
      scrollItemWidth: "80px",
      scrollItemHeight: "40px",
      panelExtraFooterPadding: "8px 12px",
      panelActionPadding: "8px 12px",
      calendarTitlePadding: "0",
      calendarTitleHeight: "28px",
      arrowSize: "14px",
      panelHeaderPadding: "8px 12px",
      calendarDaysHeight: "32px",
      calendarTitleGridTempateColumns: "28px 28px 1fr 28px 28px",
      // type
      calendarLeftPaddingDate: "6px 12px 4px 12px",
      calendarLeftPaddingDatetime: "4px 12px",
      calendarLeftPaddingDaterange: "6px 12px 4px 12px",
      calendarLeftPaddingDatetimerange: "4px 12px",
      calendarLeftPaddingMonth: "0",
      // TODO: make it actually effective
      calendarLeftPaddingYear: "0",
      calendarLeftPaddingQuarter: "0",
      calendarLeftPaddingMonthrange: "0",
      calendarLeftPaddingQuarterrange: "0",
      calendarLeftPaddingYearrange: "0",
      calendarLeftPaddingWeek: "6px 12px 4px 12px",
      calendarRightPaddingDate: "6px 12px 4px 12px",
      calendarRightPaddingDatetime: "4px 12px",
      calendarRightPaddingDaterange: "6px 12px 4px 12px",
      calendarRightPaddingDatetimerange: "4px 12px",
      calendarRightPaddingMonth: "0",
      calendarRightPaddingYear: "0",
      calendarRightPaddingQuarter: "0",
      calendarRightPaddingMonthrange: "0",
      calendarRightPaddingQuarterrange: "0",
      calendarRightPaddingYearrange: "0",
      calendarRightPaddingWeek: "0"
    };
    function self$v(vars) {
      const {
        hoverColor,
        fontSize: fontSize2,
        textColor2,
        textColorDisabled,
        popoverColor,
        primaryColor,
        borderRadiusSmall,
        iconColor,
        iconColorDisabled,
        textColor1,
        dividerColor,
        boxShadow2,
        borderRadius,
        fontWeightStrong
      } = vars;
      return Object.assign(Object.assign({}, commonVars$7), {
        itemFontSize: fontSize2,
        calendarDaysFontSize: fontSize2,
        calendarTitleFontSize: fontSize2,
        itemTextColor: textColor2,
        itemTextColorDisabled: textColorDisabled,
        itemTextColorActive: popoverColor,
        itemTextColorCurrent: primaryColor,
        itemColorIncluded: changeColor(primaryColor, {
          alpha: 0.1
        }),
        itemColorHover: hoverColor,
        itemColorDisabled: hoverColor,
        itemColorActive: primaryColor,
        itemBorderRadius: borderRadiusSmall,
        panelColor: popoverColor,
        panelTextColor: textColor2,
        arrowColor: iconColor,
        calendarTitleTextColor: textColor1,
        calendarTitleColorHover: hoverColor,
        calendarDaysTextColor: textColor2,
        panelHeaderDividerColor: dividerColor,
        calendarDaysDividerColor: dividerColor,
        calendarDividerColor: dividerColor,
        panelActionDividerColor: dividerColor,
        panelBoxShadow: boxShadow2,
        panelBorderRadius: borderRadius,
        calendarTitleFontWeight: fontWeightStrong,
        scrollItemBorderRadius: borderRadius,
        iconColor,
        iconColorDisabled
      });
    }
    const datePickerDark = {
      name: "DatePicker",
      common: derived$1,
      peers: {
        Input: inputDark,
        Button: buttonDark,
        TimePicker: timePickerDark,
        Scrollbar: scrollbarDark
      },
      self(vars) {
        const {
          popoverColor,
          hoverColor,
          primaryColor
        } = vars;
        const commonSelf = self$v(vars);
        commonSelf.itemColorDisabled = composite(popoverColor, hoverColor);
        commonSelf.itemColorIncluded = changeColor(primaryColor, {
          alpha: 0.15
        });
        commonSelf.itemColorHover = composite(popoverColor, hoverColor);
        return commonSelf;
      }
    };
    const commonVariables$7 = {
      thPaddingBorderedSmall: "8px 12px",
      thPaddingBorderedMedium: "12px 16px",
      thPaddingBorderedLarge: "16px 24px",
      thPaddingSmall: "0",
      thPaddingMedium: "0",
      thPaddingLarge: "0",
      tdPaddingBorderedSmall: "8px 12px",
      tdPaddingBorderedMedium: "12px 16px",
      tdPaddingBorderedLarge: "16px 24px",
      tdPaddingSmall: "0 0 8px 0",
      tdPaddingMedium: "0 0 12px 0",
      tdPaddingLarge: "0 0 16px 0"
    };
    function self$u(vars) {
      const {
        tableHeaderColor,
        textColor2,
        textColor1,
        cardColor,
        modalColor,
        popoverColor,
        dividerColor,
        borderRadius,
        fontWeightStrong,
        lineHeight: lineHeight2,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$7), {
        lineHeight: lineHeight2,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        titleTextColor: textColor1,
        thColor: composite(cardColor, tableHeaderColor),
        thColorModal: composite(modalColor, tableHeaderColor),
        thColorPopover: composite(popoverColor, tableHeaderColor),
        thTextColor: textColor1,
        thFontWeight: fontWeightStrong,
        tdTextColor: textColor2,
        tdColor: cardColor,
        tdColorModal: modalColor,
        tdColorPopover: popoverColor,
        borderColor: composite(cardColor, dividerColor),
        borderColorModal: composite(modalColor, dividerColor),
        borderColorPopover: composite(popoverColor, dividerColor),
        borderRadius
      });
    }
    const descriptionsDark = {
      name: "Descriptions",
      common: derived$1,
      self: self$u
    };
    const commonVars$6 = {
      titleFontSize: "18px",
      padding: "16px 28px 20px 28px",
      iconSize: "28px",
      actionSpace: "12px",
      contentMargin: "8px 0 16px 0",
      iconMargin: "0 4px 0 0",
      iconMarginIconTop: "4px 0 8px 0",
      closeSize: "22px",
      closeIconSize: "18px",
      closeMargin: "20px 26px 0 0",
      closeMarginIconTop: "10px 16px 0 0"
    };
    function self$t(vars) {
      const {
        textColor1,
        textColor2,
        modalColor,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeColorHover,
        closeColorPressed,
        infoColor,
        successColor,
        warningColor,
        errorColor,
        primaryColor,
        dividerColor,
        borderRadius,
        fontWeightStrong,
        lineHeight: lineHeight2,
        fontSize: fontSize2
      } = vars;
      return Object.assign(Object.assign({}, commonVars$6), {
        fontSize: fontSize2,
        lineHeight: lineHeight2,
        border: `1px solid ${dividerColor}`,
        titleTextColor: textColor1,
        textColor: textColor2,
        color: modalColor,
        closeColorHover,
        closeColorPressed,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeBorderRadius: borderRadius,
        iconColor: primaryColor,
        iconColorInfo: infoColor,
        iconColorSuccess: successColor,
        iconColorWarning: warningColor,
        iconColorError: errorColor,
        borderRadius,
        titleFontWeight: fontWeightStrong
      });
    }
    const dialogLight = createTheme({
      name: "Dialog",
      common: derived,
      peers: {
        Button: buttonLight
      },
      self: self$t
    });
    const dialogDark = {
      name: "Dialog",
      common: derived$1,
      peers: {
        Button: buttonDark
      },
      self: self$t
    };
    const dialogProps = {
      icon: Function,
      type: {
        type: String,
        default: "default"
      },
      title: [String, Function],
      closable: {
        type: Boolean,
        default: true
      },
      negativeText: String,
      positiveText: String,
      positiveButtonProps: Object,
      negativeButtonProps: Object,
      content: [String, Function],
      action: Function,
      showIcon: {
        type: Boolean,
        default: true
      },
      loading: Boolean,
      bordered: Boolean,
      iconPlacement: String,
      titleClass: [String, Array],
      titleStyle: [String, Object],
      contentClass: [String, Array],
      contentStyle: [String, Object],
      actionClass: [String, Array],
      actionStyle: [String, Object],
      onPositiveClick: Function,
      onNegativeClick: Function,
      onClose: Function
    };
    const dialogPropKeys = keysOf(dialogProps);
    const style$b = c$1([cB("dialog", `
 --n-icon-margin: var(--n-icon-margin-top) var(--n-icon-margin-right) var(--n-icon-margin-bottom) var(--n-icon-margin-left);
 word-break: break-word;
 line-height: var(--n-line-height);
 position: relative;
 background: var(--n-color);
 color: var(--n-text-color);
 box-sizing: border-box;
 margin: auto;
 border-radius: var(--n-border-radius);
 padding: var(--n-padding);
 transition: 
 border-color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `, [cE("icon", {
      color: "var(--n-icon-color)"
    }), cM("bordered", {
      border: "var(--n-border)"
    }), cM("icon-top", [cE("close", {
      margin: "var(--n-close-margin)"
    }), cE("icon", {
      margin: "var(--n-icon-margin)"
    }), cE("content", {
      textAlign: "center"
    }), cE("title", {
      justifyContent: "center"
    }), cE("action", {
      justifyContent: "center"
    })]), cM("icon-left", [cE("icon", {
      margin: "var(--n-icon-margin)"
    }), cM("closable", [cE("title", `
 padding-right: calc(var(--n-close-size) + 6px);
 `)])]), cE("close", `
 position: absolute;
 right: 0;
 top: 0;
 margin: var(--n-close-margin);
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 z-index: 1;
 `), cE("content", `
 font-size: var(--n-font-size);
 margin: var(--n-content-margin);
 position: relative;
 word-break: break-word;
 `, [cM("last", "margin-bottom: 0;")]), cE("action", `
 display: flex;
 justify-content: flex-end;
 `, [c$1("> *:not(:last-child)", `
 margin-right: var(--n-action-space);
 `)]), cE("icon", `
 font-size: var(--n-icon-size);
 transition: color .3s var(--n-bezier);
 `), cE("title", `
 transition: color .3s var(--n-bezier);
 display: flex;
 align-items: center;
 font-size: var(--n-title-font-size);
 font-weight: var(--n-title-font-weight);
 color: var(--n-title-text-color);
 `), cB("dialog-icon-container", `
 display: flex;
 justify-content: center;
 `)]), insideModal(cB("dialog", `
 width: 446px;
 max-width: calc(100vw - 32px);
 `)), cB("dialog", [asModal(`
 width: 446px;
 max-width: calc(100vw - 32px);
 `)])]);
    const iconRenderMap$1 = {
      default: () => h(InfoIcon, null),
      info: () => h(InfoIcon, null),
      success: () => h(SuccessIcon, null),
      warning: () => h(WarningIcon, null),
      error: () => h(ErrorIcon, null)
    };
    const NDialog = /* @__PURE__ */ defineComponent({
      name: "Dialog",
      alias: [
        "NimbusConfirmCard",
        // deprecated
        "Confirm"
        // deprecated
      ],
      props: Object.assign(Object.assign({}, useTheme.props), dialogProps),
      setup(props) {
        const {
          mergedComponentPropsRef,
          mergedClsPrefixRef,
          inlineThemeDisabled,
          mergedRtlRef
        } = useConfig(props);
        const rtlEnabledRef = useRtl("Dialog", mergedRtlRef, mergedClsPrefixRef);
        const mergedIconPlacementRef = computed(() => {
          var _a, _b;
          const {
            iconPlacement
          } = props;
          return iconPlacement || ((_b = (_a = mergedComponentPropsRef === null || mergedComponentPropsRef === void 0 ? void 0 : mergedComponentPropsRef.value) === null || _a === void 0 ? void 0 : _a.Dialog) === null || _b === void 0 ? void 0 : _b.iconPlacement) || "left";
        });
        function handlePositiveClick(e) {
          const {
            onPositiveClick
          } = props;
          if (onPositiveClick) onPositiveClick(e);
        }
        function handleNegativeClick(e) {
          const {
            onNegativeClick
          } = props;
          if (onNegativeClick) onNegativeClick(e);
        }
        function handleCloseClick() {
          const {
            onClose
          } = props;
          if (onClose) onClose();
        }
        const themeRef = useTheme("Dialog", "-dialog", style$b, dialogLight, props, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            type
          } = props;
          const iconPlacement = mergedIconPlacementRef.value;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              fontSize: fontSize2,
              lineHeight: lineHeight2,
              border,
              titleTextColor,
              textColor,
              color,
              closeBorderRadius,
              closeColorHover,
              closeColorPressed,
              closeIconColor,
              closeIconColorHover,
              closeIconColorPressed,
              closeIconSize,
              borderRadius,
              titleFontWeight,
              titleFontSize,
              padding,
              iconSize,
              actionSpace,
              contentMargin,
              closeSize,
              [iconPlacement === "top" ? "iconMarginIconTop" : "iconMargin"]: iconMargin,
              [iconPlacement === "top" ? "closeMarginIconTop" : "closeMargin"]: closeMargin,
              [createKey("iconColor", type)]: iconColor
            }
          } = themeRef.value;
          const iconMarginDiscrete = getMargin(iconMargin);
          return {
            "--n-font-size": fontSize2,
            "--n-icon-color": iconColor,
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-close-margin": closeMargin,
            "--n-icon-margin-top": iconMarginDiscrete.top,
            "--n-icon-margin-right": iconMarginDiscrete.right,
            "--n-icon-margin-bottom": iconMarginDiscrete.bottom,
            "--n-icon-margin-left": iconMarginDiscrete.left,
            "--n-icon-size": iconSize,
            "--n-close-size": closeSize,
            "--n-close-icon-size": closeIconSize,
            "--n-close-border-radius": closeBorderRadius,
            "--n-close-color-hover": closeColorHover,
            "--n-close-color-pressed": closeColorPressed,
            "--n-close-icon-color": closeIconColor,
            "--n-close-icon-color-hover": closeIconColorHover,
            "--n-close-icon-color-pressed": closeIconColorPressed,
            "--n-color": color,
            "--n-text-color": textColor,
            "--n-border-radius": borderRadius,
            "--n-padding": padding,
            "--n-line-height": lineHeight2,
            "--n-border": border,
            "--n-content-margin": contentMargin,
            "--n-title-font-size": titleFontSize,
            "--n-title-font-weight": titleFontWeight,
            "--n-title-text-color": titleTextColor,
            "--n-action-space": actionSpace
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("dialog", computed(() => `${props.type[0]}${mergedIconPlacementRef.value[0]}`), cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          rtlEnabled: rtlEnabledRef,
          mergedIconPlacement: mergedIconPlacementRef,
          mergedTheme: themeRef,
          handlePositiveClick,
          handleNegativeClick,
          handleCloseClick,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        var _a;
        const {
          bordered,
          mergedIconPlacement,
          cssVars,
          closable,
          showIcon,
          title,
          content,
          action,
          negativeText,
          positiveText,
          positiveButtonProps,
          negativeButtonProps,
          handlePositiveClick,
          handleNegativeClick,
          mergedTheme,
          loading,
          type,
          mergedClsPrefix
        } = this;
        (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
        const icon = showIcon ? h(NBaseIcon, {
          clsPrefix: mergedClsPrefix,
          class: `${mergedClsPrefix}-dialog__icon`
        }, {
          default: () => resolveWrappedSlot(this.$slots.icon, (children) => children || (this.icon ? render$1(this.icon) : iconRenderMap$1[this.type]()))
        }) : null;
        const actionNode = resolveWrappedSlot(this.$slots.action, (children) => children || positiveText || negativeText || action ? h("div", {
          class: [`${mergedClsPrefix}-dialog__action`, this.actionClass],
          style: this.actionStyle
        }, children || (action ? [render$1(action)] : [this.negativeText && h(Button, Object.assign({
          theme: mergedTheme.peers.Button,
          themeOverrides: mergedTheme.peerOverrides.Button,
          ghost: true,
          size: "small",
          onClick: handleNegativeClick
        }, negativeButtonProps), {
          default: () => render$1(this.negativeText)
        }), this.positiveText && h(Button, Object.assign({
          theme: mergedTheme.peers.Button,
          themeOverrides: mergedTheme.peerOverrides.Button,
          size: "small",
          type: type === "default" ? "primary" : type,
          disabled: loading,
          loading,
          onClick: handlePositiveClick
        }, positiveButtonProps), {
          default: () => render$1(this.positiveText)
        })])) : null);
        return h("div", {
          class: [`${mergedClsPrefix}-dialog`, this.themeClass, this.closable && `${mergedClsPrefix}-dialog--closable`, `${mergedClsPrefix}-dialog--icon-${mergedIconPlacement}`, bordered && `${mergedClsPrefix}-dialog--bordered`, this.rtlEnabled && `${mergedClsPrefix}-dialog--rtl`],
          style: cssVars,
          role: "dialog"
        }, closable ? resolveWrappedSlot(this.$slots.close, (node) => {
          const classNames = [`${mergedClsPrefix}-dialog__close`, this.rtlEnabled && `${mergedClsPrefix}-dialog--rtl`];
          return node ? h("div", {
            class: classNames
          }, node) : h(NBaseClose, {
            clsPrefix: mergedClsPrefix,
            class: classNames,
            onClick: this.handleCloseClick
          });
        }) : null, showIcon && mergedIconPlacement === "top" ? h("div", {
          class: `${mergedClsPrefix}-dialog-icon-container`
        }, icon) : null, h("div", {
          class: [`${mergedClsPrefix}-dialog__title`, this.titleClass],
          style: this.titleStyle
        }, showIcon && mergedIconPlacement === "left" ? icon : null, resolveSlot(this.$slots.header, () => [render$1(title)])), h("div", {
          class: [`${mergedClsPrefix}-dialog__content`, actionNode ? "" : `${mergedClsPrefix}-dialog__content--last`, this.contentClass],
          style: this.contentStyle
        }, resolveSlot(this.$slots.default, () => [render$1(content)])), actionNode);
      }
    });
    const dialogProviderInjectionKey = createInjectionKey("n-dialog-provider");
    const dialogApiInjectionKey = createInjectionKey("n-dialog-api");
    const dialogReactiveListInjectionKey = createInjectionKey("n-dialog-reactive-list");
    function self$s(vars) {
      const {
        modalColor,
        textColor2,
        boxShadow3
      } = vars;
      return {
        color: modalColor,
        textColor: textColor2,
        boxShadow: boxShadow3
      };
    }
    const modalLight = createTheme({
      name: "Modal",
      common: derived,
      peers: {
        Scrollbar: scrollbarLight,
        Dialog: dialogLight,
        Card: cardLight
      },
      self: self$s
    });
    const modalDark = {
      name: "Modal",
      common: derived$1,
      peers: {
        Scrollbar: scrollbarDark,
        Dialog: dialogDark,
        Card: cardDark
      },
      self: self$s
    };
    const presetProps = Object.assign(Object.assign({}, cardBaseProps), dialogProps);
    const presetPropsKeys = keysOf(presetProps);
    const NModalBodyWrapper = /* @__PURE__ */ defineComponent({
      name: "ModalBody",
      inheritAttrs: false,
      props: Object.assign(Object.assign({
        show: {
          type: Boolean,
          required: true
        },
        preset: String,
        displayDirective: {
          type: String,
          required: true
        },
        trapFocus: {
          type: Boolean,
          default: true
        },
        autoFocus: {
          type: Boolean,
          default: true
        },
        blockScroll: Boolean
      }, presetProps), {
        renderMask: Function,
        // events
        onClickoutside: Function,
        onBeforeLeave: {
          type: Function,
          required: true
        },
        onAfterLeave: {
          type: Function,
          required: true
        },
        onPositiveClick: {
          type: Function,
          required: true
        },
        onNegativeClick: {
          type: Function,
          required: true
        },
        onClose: {
          type: Function,
          required: true
        },
        onAfterEnter: Function,
        onEsc: Function
      }),
      setup(props) {
        const bodyRef = ref(null);
        const scrollbarRef = ref(null);
        const displayedRef = ref(props.show);
        const transformOriginXRef = ref(null);
        const transformOriginYRef = ref(null);
        watch(toRef(props, "show"), (value) => {
          if (value) displayedRef.value = true;
        });
        useLockHtmlScroll(computed(() => props.blockScroll && displayedRef.value));
        const NModal2 = inject(modalInjectionKey);
        function styleTransformOrigin() {
          if (NModal2.transformOriginRef.value === "center") {
            return "";
          }
          const {
            value: transformOriginX
          } = transformOriginXRef;
          const {
            value: transformOriginY
          } = transformOriginYRef;
          if (transformOriginX === null || transformOriginY === null) {
            return "";
          } else if (scrollbarRef.value) {
            const scrollTop = scrollbarRef.value.containerScrollTop;
            return `${transformOriginX}px ${transformOriginY + scrollTop}px`;
          }
          return "";
        }
        function syncTransformOrigin(el) {
          if (NModal2.transformOriginRef.value === "center") {
            return;
          }
          const mousePosition = NModal2.getMousePosition();
          if (!mousePosition) {
            return;
          }
          if (!scrollbarRef.value) return;
          const scrollTop = scrollbarRef.value.containerScrollTop;
          const {
            offsetLeft,
            offsetTop
          } = el;
          if (mousePosition) {
            const top = mousePosition.y;
            const left = mousePosition.x;
            transformOriginXRef.value = -(offsetLeft - left);
            transformOriginYRef.value = -(offsetTop - top - scrollTop);
          }
          el.style.transformOrigin = styleTransformOrigin();
        }
        function handleEnter(el) {
          void nextTick(() => {
            syncTransformOrigin(el);
          });
        }
        function handleBeforeLeave(el) {
          el.style.transformOrigin = styleTransformOrigin();
          props.onBeforeLeave();
        }
        function handleAfterLeave() {
          displayedRef.value = false;
          transformOriginXRef.value = null;
          transformOriginYRef.value = null;
          props.onAfterLeave();
        }
        function handleCloseClick() {
          const {
            onClose
          } = props;
          if (onClose) {
            onClose();
          }
        }
        function handleNegativeClick() {
          props.onNegativeClick();
        }
        function handlePositiveClick() {
          props.onPositiveClick();
        }
        const childNodeRef = ref(null);
        watch(childNodeRef, (node) => {
          if (node) {
            void nextTick(() => {
              const el = node.el;
              if (el && bodyRef.value !== el) {
                bodyRef.value = el;
              }
            });
          }
        });
        provide(modalBodyInjectionKey, bodyRef);
        provide(drawerBodyInjectionKey, null);
        provide(popoverBodyInjectionKey, null);
        return {
          mergedTheme: NModal2.mergedThemeRef,
          appear: NModal2.appearRef,
          isMounted: NModal2.isMountedRef,
          mergedClsPrefix: NModal2.mergedClsPrefixRef,
          bodyRef,
          scrollbarRef,
          displayed: displayedRef,
          childNodeRef,
          handlePositiveClick,
          handleNegativeClick,
          handleCloseClick,
          handleAfterLeave,
          handleBeforeLeave,
          handleEnter
        };
      },
      render() {
        const {
          $slots,
          $attrs,
          handleEnter,
          handleAfterLeave,
          handleBeforeLeave,
          preset,
          mergedClsPrefix
        } = this;
        let childNode = null;
        if (!preset) {
          childNode = getFirstSlotVNode($slots);
          if (!childNode) {
            warn$3("modal", "default slot is empty");
            return;
          }
          childNode = cloneVNode(childNode);
          childNode.props = mergeProps({
            class: `${mergedClsPrefix}-modal`
          }, $attrs, childNode.props || {});
        }
        return this.displayDirective === "show" || this.displayed || this.show ? withDirectives(h("div", {
          role: "none",
          class: `${mergedClsPrefix}-modal-body-wrapper`
        }, h(Scrollbar, {
          ref: "scrollbarRef",
          theme: this.mergedTheme.peers.Scrollbar,
          themeOverrides: this.mergedTheme.peerOverrides.Scrollbar,
          contentClass: `${mergedClsPrefix}-modal-scroll-content`
        }, {
          default: () => {
            var _a;
            return [(_a = this.renderMask) === null || _a === void 0 ? void 0 : _a.call(this), h(FocusTrap, {
              disabled: !this.trapFocus,
              active: this.show,
              onEsc: this.onEsc,
              autoFocus: this.autoFocus
            }, {
              default: () => {
                var _a2;
                return h(Transition, {
                  name: "fade-in-scale-up-transition",
                  appear: (_a2 = this.appear) !== null && _a2 !== void 0 ? _a2 : this.isMounted,
                  onEnter: handleEnter,
                  onAfterEnter: this.onAfterEnter,
                  onAfterLeave: handleAfterLeave,
                  onBeforeLeave: handleBeforeLeave
                }, {
                  default: () => {
                    const dirs = [[vShow, this.show]];
                    const {
                      onClickoutside
                    } = this;
                    if (onClickoutside) {
                      dirs.push([clickoutside, this.onClickoutside, void 0, {
                        capture: true
                      }]);
                    }
                    return withDirectives(this.preset === "confirm" || this.preset === "dialog" ? h(NDialog, Object.assign({}, this.$attrs, {
                      class: [`${mergedClsPrefix}-modal`, this.$attrs.class],
                      ref: "bodyRef",
                      theme: this.mergedTheme.peers.Dialog,
                      themeOverrides: this.mergedTheme.peerOverrides.Dialog
                    }, keep(this.$props, dialogPropKeys), {
                      "aria-modal": "true"
                    }), $slots) : this.preset === "card" ? h(NCard, Object.assign({}, this.$attrs, {
                      ref: "bodyRef",
                      class: [`${mergedClsPrefix}-modal`, this.$attrs.class],
                      theme: this.mergedTheme.peers.Card,
                      themeOverrides: this.mergedTheme.peerOverrides.Card
                    }, keep(this.$props, cardBasePropKeys), {
                      "aria-modal": "true",
                      role: "dialog"
                    }), $slots) : this.childNodeRef = childNode, dirs);
                  }
                });
              }
            })];
          }
        })), [[vShow, this.displayDirective === "if" || this.displayed || this.show]]) : null;
      }
    });
    const style$a = c$1([cB("modal-container", `
 position: fixed;
 left: 0;
 top: 0;
 height: 0;
 width: 0;
 display: flex;
 `), cB("modal-mask", `
 position: fixed;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 background-color: rgba(0, 0, 0, .4);
 `, [fadeInTransition({
      enterDuration: ".25s",
      leaveDuration: ".25s",
      enterCubicBezier: "var(--n-bezier-ease-out)",
      leaveCubicBezier: "var(--n-bezier-ease-out)"
    })]), cB("modal-body-wrapper", `
 position: fixed;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 overflow: visible;
 `, [cB("modal-scroll-content", `
 min-height: 100%;
 display: flex;
 position: relative;
 `)]), cB("modal", `
 position: relative;
 align-self: center;
 color: var(--n-text-color);
 margin: auto;
 box-shadow: var(--n-box-shadow);
 `, [fadeInScaleUpTransition({
      duration: ".25s",
      enterScale: ".5"
    })])]);
    const modalProps = Object.assign(Object.assign(Object.assign(Object.assign({}, useTheme.props), {
      show: Boolean,
      unstableShowMask: {
        type: Boolean,
        default: true
      },
      maskClosable: {
        type: Boolean,
        default: true
      },
      preset: String,
      to: [String, Object],
      displayDirective: {
        type: String,
        default: "if"
      },
      transformOrigin: {
        type: String,
        default: "mouse"
      },
      zIndex: Number,
      autoFocus: {
        type: Boolean,
        default: true
      },
      trapFocus: {
        type: Boolean,
        default: true
      },
      closeOnEsc: {
        type: Boolean,
        default: true
      },
      blockScroll: {
        type: Boolean,
        default: true
      }
    }), presetProps), {
      // events
      onEsc: Function,
      "onUpdate:show": [Function, Array],
      onUpdateShow: [Function, Array],
      onAfterEnter: Function,
      onBeforeLeave: Function,
      onAfterLeave: Function,
      onClose: Function,
      onPositiveClick: Function,
      onNegativeClick: Function,
      onMaskClick: Function,
      // private
      internalDialog: Boolean,
      internalModal: Boolean,
      internalAppear: {
        type: Boolean,
        default: void 0
      },
      // deprecated
      overlayStyle: [String, Object],
      onBeforeHide: Function,
      onAfterHide: Function,
      onHide: Function
    });
    const NModal = /* @__PURE__ */ defineComponent({
      name: "Modal",
      inheritAttrs: false,
      props: modalProps,
      setup(props) {
        const containerRef = ref(null);
        const {
          mergedClsPrefixRef,
          namespaceRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Modal", "-modal", style$a, modalLight, props, mergedClsPrefixRef);
        const clickedRef = useClicked(64);
        const clickedPositionRef = useClickPosition();
        const isMountedRef = isMounted();
        const NDialogProvider2 = props.internalDialog ? inject(dialogProviderInjectionKey, null) : null;
        const NModalProvider = props.internalModal ? inject(modalProviderInjectionKey, null) : null;
        const isComposingRef2 = useIsComposing();
        function doUpdateShow(show) {
          const {
            onUpdateShow,
            "onUpdate:show": _onUpdateShow,
            onHide
          } = props;
          if (onUpdateShow) call(onUpdateShow, show);
          if (_onUpdateShow) call(_onUpdateShow, show);
          if (onHide && !show) onHide(show);
        }
        function handleCloseClick() {
          const {
            onClose
          } = props;
          if (onClose) {
            void Promise.resolve(onClose()).then((value) => {
              if (value === false) return;
              doUpdateShow(false);
            });
          } else {
            doUpdateShow(false);
          }
        }
        function handlePositiveClick() {
          const {
            onPositiveClick
          } = props;
          if (onPositiveClick) {
            void Promise.resolve(onPositiveClick()).then((value) => {
              if (value === false) return;
              doUpdateShow(false);
            });
          } else {
            doUpdateShow(false);
          }
        }
        function handleNegativeClick() {
          const {
            onNegativeClick
          } = props;
          if (onNegativeClick) {
            void Promise.resolve(onNegativeClick()).then((value) => {
              if (value === false) return;
              doUpdateShow(false);
            });
          } else {
            doUpdateShow(false);
          }
        }
        function handleBeforeLeave() {
          const {
            onBeforeLeave,
            onBeforeHide
          } = props;
          if (onBeforeLeave) call(onBeforeLeave);
          if (onBeforeHide) onBeforeHide();
        }
        function handleAfterLeave() {
          const {
            onAfterLeave,
            onAfterHide
          } = props;
          if (onAfterLeave) call(onAfterLeave);
          if (onAfterHide) onAfterHide();
        }
        function handleClickoutside(e) {
          var _a;
          const {
            onMaskClick
          } = props;
          if (onMaskClick) {
            onMaskClick(e);
          }
          if (props.maskClosable) {
            if ((_a = containerRef.value) === null || _a === void 0 ? void 0 : _a.contains(getPreciseEventTarget(e))) {
              doUpdateShow(false);
            }
          }
        }
        function handleEsc(e) {
          var _a;
          (_a = props.onEsc) === null || _a === void 0 ? void 0 : _a.call(props);
          if (props.show && props.closeOnEsc && eventEffectNotPerformed(e)) {
            if (!isComposingRef2.value) {
              doUpdateShow(false);
            }
          }
        }
        provide(modalInjectionKey, {
          getMousePosition: () => {
            const mergedProvider = NDialogProvider2 || NModalProvider;
            if (mergedProvider) {
              const {
                clickedRef: clickedRef2,
                clickedPositionRef: clickedPositionRef2
              } = mergedProvider;
              if (clickedRef2.value && clickedPositionRef2.value) {
                return clickedPositionRef2.value;
              }
            }
            if (clickedRef.value) {
              return clickedPositionRef.value;
            }
            return null;
          },
          mergedClsPrefixRef,
          mergedThemeRef: themeRef,
          isMountedRef,
          appearRef: toRef(props, "internalAppear"),
          transformOriginRef: toRef(props, "transformOrigin")
        });
        const cssVarsRef = computed(() => {
          const {
            common: {
              cubicBezierEaseOut: cubicBezierEaseOut2
            },
            self: {
              boxShadow,
              color,
              textColor
            }
          } = themeRef.value;
          return {
            "--n-bezier-ease-out": cubicBezierEaseOut2,
            "--n-box-shadow": boxShadow,
            "--n-color": color,
            "--n-text-color": textColor
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("theme-class", void 0, cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          namespace: namespaceRef,
          isMounted: isMountedRef,
          containerRef,
          presetProps: computed(() => {
            const pickedProps = keep(props, presetPropsKeys);
            return pickedProps;
          }),
          handleEsc,
          handleAfterLeave,
          handleClickoutside,
          handleBeforeLeave,
          doUpdateShow,
          handleNegativeClick,
          handlePositiveClick,
          handleCloseClick,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        const {
          mergedClsPrefix
        } = this;
        return h(LazyTeleport, {
          to: this.to,
          show: this.show
        }, {
          default: () => {
            var _a;
            (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
            const {
              unstableShowMask
            } = this;
            return withDirectives(h("div", {
              role: "none",
              ref: "containerRef",
              class: [`${mergedClsPrefix}-modal-container`, this.themeClass, this.namespace],
              style: this.cssVars
            }, h(NModalBodyWrapper, Object.assign({
              style: this.overlayStyle
            }, this.$attrs, {
              ref: "bodyWrapper",
              displayDirective: this.displayDirective,
              show: this.show,
              preset: this.preset,
              autoFocus: this.autoFocus,
              trapFocus: this.trapFocus,
              blockScroll: this.blockScroll
            }, this.presetProps, {
              onEsc: this.handleEsc,
              onClose: this.handleCloseClick,
              onNegativeClick: this.handleNegativeClick,
              onPositiveClick: this.handlePositiveClick,
              onBeforeLeave: this.handleBeforeLeave,
              onAfterEnter: this.onAfterEnter,
              onAfterLeave: this.handleAfterLeave,
              onClickoutside: unstableShowMask ? void 0 : this.handleClickoutside,
              renderMask: unstableShowMask ? () => {
                var _a2;
                return h(Transition, {
                  name: "fade-in-transition",
                  key: "mask",
                  appear: (_a2 = this.internalAppear) !== null && _a2 !== void 0 ? _a2 : this.isMounted
                }, {
                  default: () => {
                    return this.show ? h("div", {
                      "aria-hidden": true,
                      ref: "containerRef",
                      class: `${mergedClsPrefix}-modal-mask`,
                      onClick: this.handleClickoutside
                    }) : null;
                  }
                });
              } : void 0
            }), this.$slots)), [[zindexable, {
              zIndex: this.zIndex,
              enabled: this.show
            }]]);
          }
        });
      }
    });
    const exposedDialogEnvProps = Object.assign(Object.assign({}, dialogProps), {
      onAfterEnter: Function,
      onAfterLeave: Function,
      transformOrigin: String,
      blockScroll: {
        type: Boolean,
        default: true
      },
      closeOnEsc: {
        type: Boolean,
        default: true
      },
      onEsc: Function,
      autoFocus: {
        type: Boolean,
        default: true
      },
      internalStyle: [String, Object],
      maskClosable: {
        type: Boolean,
        default: true
      },
      onPositiveClick: Function,
      onNegativeClick: Function,
      onClose: Function,
      onMaskClick: Function
    });
    const NDialogEnvironment = /* @__PURE__ */ defineComponent({
      name: "DialogEnvironment",
      props: Object.assign(Object.assign({}, exposedDialogEnvProps), {
        internalKey: {
          type: String,
          required: true
        },
        to: [String, Object],
        // private
        onInternalAfterLeave: {
          type: Function,
          required: true
        }
      }),
      setup(props) {
        const showRef = ref(true);
        function handleAfterLeave() {
          const {
            onInternalAfterLeave,
            internalKey,
            onAfterLeave
          } = props;
          if (onInternalAfterLeave) onInternalAfterLeave(internalKey);
          if (onAfterLeave) onAfterLeave();
        }
        function handlePositiveClick(e) {
          const {
            onPositiveClick
          } = props;
          if (onPositiveClick) {
            void Promise.resolve(onPositiveClick(e)).then((result) => {
              if (result === false) return;
              hide();
            });
          } else {
            hide();
          }
        }
        function handleNegativeClick(e) {
          const {
            onNegativeClick
          } = props;
          if (onNegativeClick) {
            void Promise.resolve(onNegativeClick(e)).then((result) => {
              if (result === false) return;
              hide();
            });
          } else {
            hide();
          }
        }
        function handleCloseClick() {
          const {
            onClose
          } = props;
          if (onClose) {
            void Promise.resolve(onClose()).then((result) => {
              if (result === false) return;
              hide();
            });
          } else {
            hide();
          }
        }
        function handleMaskClick(e) {
          const {
            onMaskClick,
            maskClosable
          } = props;
          if (onMaskClick) {
            onMaskClick(e);
            if (maskClosable) {
              hide();
            }
          }
        }
        function handleEsc() {
          const {
            onEsc
          } = props;
          if (onEsc) {
            onEsc();
          }
        }
        function hide() {
          showRef.value = false;
        }
        function handleUpdateShow(value) {
          showRef.value = value;
        }
        return {
          show: showRef,
          hide,
          handleUpdateShow,
          handleAfterLeave,
          handleCloseClick,
          handleNegativeClick,
          handlePositiveClick,
          handleMaskClick,
          handleEsc
        };
      },
      render() {
        const {
          handlePositiveClick,
          handleUpdateShow,
          handleNegativeClick,
          handleCloseClick,
          handleAfterLeave,
          handleMaskClick,
          handleEsc,
          to,
          maskClosable,
          show
        } = this;
        return h(NModal, {
          show,
          onUpdateShow: handleUpdateShow,
          onMaskClick: handleMaskClick,
          onEsc: handleEsc,
          to,
          maskClosable,
          onAfterEnter: this.onAfterEnter,
          onAfterLeave: handleAfterLeave,
          closeOnEsc: this.closeOnEsc,
          blockScroll: this.blockScroll,
          autoFocus: this.autoFocus,
          transformOrigin: this.transformOrigin,
          internalAppear: true,
          internalDialog: true
        }, {
          default: () => h(NDialog, Object.assign({}, keep(this.$props, dialogPropKeys), {
            style: this.internalStyle,
            onClose: handleCloseClick,
            onNegativeClick: handleNegativeClick,
            onPositiveClick: handlePositiveClick
          }))
        });
      }
    });
    const dialogProviderProps = {
      injectionKey: String,
      to: [String, Object]
    };
    const NDialogProvider = /* @__PURE__ */ defineComponent({
      name: "DialogProvider",
      props: dialogProviderProps,
      setup() {
        const dialogListRef = ref([]);
        const dialogInstRefs = {};
        function create2(options = {}) {
          const key = createId();
          const dialogReactive = reactive(Object.assign(Object.assign({}, options), {
            key,
            destroy: () => {
              var _a;
              (_a = dialogInstRefs[`n-dialog-${key}`]) === null || _a === void 0 ? void 0 : _a.hide();
            }
          }));
          dialogListRef.value.push(dialogReactive);
          return dialogReactive;
        }
        const typedApi = ["info", "success", "warning", "error"].map((type) => (options) => {
          return create2(Object.assign(Object.assign({}, options), {
            type
          }));
        });
        function handleAfterLeave(key) {
          const {
            value: dialogList
          } = dialogListRef;
          dialogList.splice(dialogList.findIndex((dialog) => dialog.key === key), 1);
        }
        function destroyAll() {
          Object.values(dialogInstRefs).forEach((dialogInstRef) => {
            dialogInstRef === null || dialogInstRef === void 0 ? void 0 : dialogInstRef.hide();
          });
        }
        const api = {
          create: create2,
          destroyAll,
          info: typedApi[0],
          success: typedApi[1],
          warning: typedApi[2],
          error: typedApi[3]
        };
        provide(dialogApiInjectionKey, api);
        provide(dialogProviderInjectionKey, {
          clickedRef: useClicked(64),
          clickedPositionRef: useClickPosition()
        });
        provide(dialogReactiveListInjectionKey, dialogListRef);
        return Object.assign(Object.assign({}, api), {
          dialogList: dialogListRef,
          dialogInstRefs,
          handleAfterLeave
        });
      },
      render() {
        var _a, _b;
        return h(Fragment, null, [this.dialogList.map((dialog) => h(NDialogEnvironment, omit(dialog, ["destroy", "style"], {
          internalStyle: dialog.style,
          to: this.to,
          ref: (inst) => {
            if (inst === null) {
              delete this.dialogInstRefs[`n-dialog-${dialog.key}`];
            } else {
              this.dialogInstRefs[`n-dialog-${dialog.key}`] = inst;
            }
          },
          internalKey: dialog.key,
          onInternalAfterLeave: this.handleAfterLeave
        }))), (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a)]);
      }
    });
    function useDialog() {
      const dialog = inject(dialogApiInjectionKey, null);
      if (dialog === null) {
        throwError("use-dialog", "No outer <n-dialog-provider /> founded.");
      }
      return dialog;
    }
    function self$r(vars) {
      const {
        textColor1,
        dividerColor,
        fontWeightStrong
      } = vars;
      return {
        textColor: textColor1,
        color: dividerColor,
        fontWeight: fontWeightStrong
      };
    }
    const dividerLight = {
      name: "Divider",
      common: derived,
      self: self$r
    };
    const dividerDark = {
      name: "Divider",
      common: derived$1,
      self: self$r
    };
    const style$9 = cB("divider", `
 position: relative;
 display: flex;
 width: 100%;
 box-sizing: border-box;
 font-size: 16px;
 color: var(--n-text-color);
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
`, [cNotM("vertical", `
 margin-top: 24px;
 margin-bottom: 24px;
 `, [cNotM("no-title", `
 display: flex;
 align-items: center;
 `)]), cE("title", `
 display: flex;
 align-items: center;
 margin-left: 12px;
 margin-right: 12px;
 white-space: nowrap;
 font-weight: var(--n-font-weight);
 `), cM("title-position-left", [cE("line", [cM("left", {
      width: "28px"
    })])]), cM("title-position-right", [cE("line", [cM("right", {
      width: "28px"
    })])]), cM("dashed", [cE("line", `
 background-color: #0000;
 height: 0px;
 width: 100%;
 border-style: dashed;
 border-width: 1px 0 0;
 `)]), cM("vertical", `
 display: inline-block;
 height: 1em;
 margin: 0 8px;
 vertical-align: middle;
 width: 1px;
 `), cE("line", `
 border: none;
 transition: background-color .3s var(--n-bezier), border-color .3s var(--n-bezier);
 height: 1px;
 width: 100%;
 margin: 0;
 `), cNotM("dashed", [cE("line", {
      backgroundColor: "var(--n-color)"
    })]), cM("dashed", [cE("line", {
      borderColor: "var(--n-color)"
    })]), cM("vertical", {
      backgroundColor: "var(--n-color)"
    })]);
    const dividerProps = Object.assign(Object.assign({}, useTheme.props), {
      titlePlacement: {
        type: String,
        default: "center"
      },
      dashed: Boolean,
      vertical: Boolean
    });
    const NDivider = /* @__PURE__ */ defineComponent({
      name: "Divider",
      props: dividerProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Divider", "-divider", style$9, dividerLight, props, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              color,
              textColor,
              fontWeight
            }
          } = themeRef.value;
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-color": color,
            "--n-text-color": textColor,
            "--n-font-weight": fontWeight
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("divider", void 0, cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        var _a;
        const {
          $slots,
          titlePlacement,
          vertical,
          dashed,
          cssVars,
          mergedClsPrefix
        } = this;
        (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
        return h("div", {
          role: "separator",
          class: [`${mergedClsPrefix}-divider`, this.themeClass, {
            [`${mergedClsPrefix}-divider--vertical`]: vertical,
            [`${mergedClsPrefix}-divider--no-title`]: !$slots.default,
            [`${mergedClsPrefix}-divider--dashed`]: dashed,
            [`${mergedClsPrefix}-divider--title-position-${titlePlacement}`]: $slots.default && titlePlacement
          }],
          style: cssVars
        }, !vertical ? h("div", {
          class: `${mergedClsPrefix}-divider__line ${mergedClsPrefix}-divider__line--left`
        }) : null, !vertical && $slots.default ? h(Fragment, null, h("div", {
          class: `${mergedClsPrefix}-divider__title`
        }, this.$slots), h("div", {
          class: `${mergedClsPrefix}-divider__line ${mergedClsPrefix}-divider__line--right`
        })) : null);
      }
    });
    function self$q(vars) {
      const {
        modalColor,
        textColor1,
        textColor2,
        boxShadow3,
        lineHeight: lineHeight2,
        fontWeightStrong,
        dividerColor,
        closeColorHover,
        closeColorPressed,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        borderRadius,
        primaryColorHover
      } = vars;
      return {
        bodyPadding: "16px 24px",
        borderRadius,
        headerPadding: "16px 24px",
        footerPadding: "16px 24px",
        color: modalColor,
        textColor: textColor2,
        titleTextColor: textColor1,
        titleFontSize: "18px",
        titleFontWeight: fontWeightStrong,
        boxShadow: boxShadow3,
        lineHeight: lineHeight2,
        headerBorderBottom: `1px solid ${dividerColor}`,
        footerBorderTop: `1px solid ${dividerColor}`,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeSize: "22px",
        closeIconSize: "18px",
        closeColorHover,
        closeColorPressed,
        closeBorderRadius: borderRadius,
        resizableTriggerColorHover: primaryColorHover
      };
    }
    const drawerLight = createTheme({
      name: "Drawer",
      common: derived,
      peers: {
        Scrollbar: scrollbarLight
      },
      self: self$q
    });
    const drawerDark = {
      name: "Drawer",
      common: derived$1,
      peers: {
        Scrollbar: scrollbarDark
      },
      self: self$q
    };
    const NDrawerBodyWrapper = /* @__PURE__ */ defineComponent({
      name: "NDrawerContent",
      inheritAttrs: false,
      props: {
        blockScroll: Boolean,
        show: {
          type: Boolean,
          default: void 0
        },
        displayDirective: {
          type: String,
          required: true
        },
        placement: {
          type: String,
          required: true
        },
        contentClass: String,
        contentStyle: [Object, String],
        nativeScrollbar: {
          type: Boolean,
          required: true
        },
        scrollbarProps: Object,
        trapFocus: {
          type: Boolean,
          default: true
        },
        autoFocus: {
          type: Boolean,
          default: true
        },
        showMask: {
          type: [Boolean, String],
          required: true
        },
        maxWidth: Number,
        maxHeight: Number,
        minWidth: Number,
        minHeight: Number,
        resizable: Boolean,
        onClickoutside: Function,
        onAfterLeave: Function,
        onAfterEnter: Function,
        onEsc: Function
      },
      setup(props) {
        const displayedRef = ref(!!props.show);
        const bodyRef = ref(null);
        const NDrawer2 = inject(drawerInjectionKey);
        let startPosition = 0;
        let memoizedBodyStyleCursor = "";
        let hoverTimerId = null;
        const isHoverOnResizeTriggerRef = ref(false);
        const isDraggingRef = ref(false);
        const isVertical = computed(() => {
          return props.placement === "top" || props.placement === "bottom";
        });
        const {
          mergedClsPrefixRef,
          mergedRtlRef
        } = useConfig(props);
        const rtlEnabledRef = useRtl("Drawer", mergedRtlRef, mergedClsPrefixRef);
        const handleBodyMouseleave = handleBodyMouseup;
        const handleMousedownResizeTrigger = (e) => {
          isDraggingRef.value = true;
          startPosition = isVertical.value ? e.clientY : e.clientX;
          memoizedBodyStyleCursor = document.body.style.cursor;
          document.body.style.cursor = isVertical.value ? "ns-resize" : "ew-resize";
          document.body.addEventListener("mousemove", handleBodyMousemove);
          document.body.addEventListener("mouseleave", handleBodyMouseleave);
          document.body.addEventListener("mouseup", handleBodyMouseup);
        };
        const handleMouseenterResizeTrigger = () => {
          if (hoverTimerId !== null) {
            window.clearTimeout(hoverTimerId);
            hoverTimerId = null;
          }
          if (isDraggingRef.value) {
            isHoverOnResizeTriggerRef.value = true;
          } else {
            hoverTimerId = window.setTimeout(() => {
              isHoverOnResizeTriggerRef.value = true;
            }, 300);
          }
        };
        const handleMouseleaveResizeTrigger = () => {
          if (hoverTimerId !== null) {
            window.clearTimeout(hoverTimerId);
            hoverTimerId = null;
          }
          isHoverOnResizeTriggerRef.value = false;
        };
        const {
          doUpdateHeight,
          doUpdateWidth
        } = NDrawer2;
        const regulateWidth = (size2) => {
          const {
            maxWidth
          } = props;
          if (maxWidth && size2 > maxWidth) return maxWidth;
          const {
            minWidth
          } = props;
          if (minWidth && size2 < minWidth) return minWidth;
          return size2;
        };
        const regulateHeight = (size2) => {
          const {
            maxHeight
          } = props;
          if (maxHeight && size2 > maxHeight) return maxHeight;
          const {
            minHeight
          } = props;
          if (minHeight && size2 < minHeight) return minHeight;
          return size2;
        };
        function handleBodyMousemove(e) {
          var _a, _b;
          if (isDraggingRef.value) {
            if (isVertical.value) {
              let height = ((_a = bodyRef.value) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0;
              const increment = startPosition - e.clientY;
              height += props.placement === "bottom" ? increment : -increment;
              height = regulateHeight(height);
              doUpdateHeight(height);
              startPosition = e.clientY;
            } else {
              let width = ((_b = bodyRef.value) === null || _b === void 0 ? void 0 : _b.offsetWidth) || 0;
              const increment = startPosition - e.clientX;
              width += props.placement === "right" ? increment : -increment;
              width = regulateWidth(width);
              doUpdateWidth(width);
              startPosition = e.clientX;
            }
          }
        }
        function handleBodyMouseup() {
          if (isDraggingRef.value) {
            startPosition = 0;
            isDraggingRef.value = false;
            document.body.style.cursor = memoizedBodyStyleCursor;
            document.body.removeEventListener("mousemove", handleBodyMousemove);
            document.body.removeEventListener("mouseup", handleBodyMouseup);
            document.body.removeEventListener("mouseleave", handleBodyMouseleave);
          }
        }
        watchEffect(() => {
          if (props.show) displayedRef.value = true;
        });
        watch(() => props.show, (value) => {
          if (!value) {
            handleBodyMouseup();
          }
        });
        onBeforeUnmount(() => {
          handleBodyMouseup();
        });
        const bodyDirectivesRef = computed(() => {
          const {
            show
          } = props;
          const directives = [[vShow, show]];
          if (!props.showMask) {
            directives.push([clickoutside, props.onClickoutside, void 0, {
              capture: true
            }]);
          }
          return directives;
        });
        function handleAfterLeave() {
          var _a;
          displayedRef.value = false;
          (_a = props.onAfterLeave) === null || _a === void 0 ? void 0 : _a.call(props);
        }
        useLockHtmlScroll(computed(() => props.blockScroll && displayedRef.value));
        provide(drawerBodyInjectionKey, bodyRef);
        provide(popoverBodyInjectionKey, null);
        provide(modalBodyInjectionKey, null);
        return {
          bodyRef,
          rtlEnabled: rtlEnabledRef,
          mergedClsPrefix: NDrawer2.mergedClsPrefixRef,
          isMounted: NDrawer2.isMountedRef,
          mergedTheme: NDrawer2.mergedThemeRef,
          displayed: displayedRef,
          transitionName: computed(() => {
            return {
              right: "slide-in-from-right-transition",
              left: "slide-in-from-left-transition",
              top: "slide-in-from-top-transition",
              bottom: "slide-in-from-bottom-transition"
            }[props.placement];
          }),
          handleAfterLeave,
          bodyDirectives: bodyDirectivesRef,
          handleMousedownResizeTrigger,
          handleMouseenterResizeTrigger,
          handleMouseleaveResizeTrigger,
          isDragging: isDraggingRef,
          isHoverOnResizeTrigger: isHoverOnResizeTriggerRef
        };
      },
      render() {
        const {
          $slots,
          mergedClsPrefix
        } = this;
        return this.displayDirective === "show" || this.displayed || this.show ? withDirectives(
          /* Keep the wrapper dom. Make sure the drawer has a host.
            Nor the detached content will disappear without transition */
          h("div", {
            role: "none"
          }, h(FocusTrap, {
            disabled: !this.showMask || !this.trapFocus,
            active: this.show,
            autoFocus: this.autoFocus,
            onEsc: this.onEsc
          }, {
            default: () => h(Transition, {
              name: this.transitionName,
              appear: this.isMounted,
              onAfterEnter: this.onAfterEnter,
              onAfterLeave: this.handleAfterLeave
            }, {
              default: () => withDirectives(h("div", mergeProps(this.$attrs, {
                role: "dialog",
                ref: "bodyRef",
                "aria-modal": "true",
                class: [
                  `${mergedClsPrefix}-drawer`,
                  this.rtlEnabled && `${mergedClsPrefix}-drawer--rtl`,
                  `${mergedClsPrefix}-drawer--${this.placement}-placement`,
                  /**
                   * When the mouse is pressed to resize the drawer,
                   * disable text selection
                   */
                  this.isDragging && `${mergedClsPrefix}-drawer--unselectable`,
                  this.nativeScrollbar && `${mergedClsPrefix}-drawer--native-scrollbar`
                ]
              }), [this.resizable ? h("div", {
                class: [`${mergedClsPrefix}-drawer__resize-trigger`, (this.isDragging || this.isHoverOnResizeTrigger) && `${mergedClsPrefix}-drawer__resize-trigger--hover`],
                onMouseenter: this.handleMouseenterResizeTrigger,
                onMouseleave: this.handleMouseleaveResizeTrigger,
                onMousedown: this.handleMousedownResizeTrigger
              }) : null, this.nativeScrollbar ? h("div", {
                class: [`${mergedClsPrefix}-drawer-content-wrapper`, this.contentClass],
                style: this.contentStyle,
                role: "none"
              }, $slots) : h(Scrollbar, Object.assign({}, this.scrollbarProps, {
                contentStyle: this.contentStyle,
                contentClass: [`${mergedClsPrefix}-drawer-content-wrapper`, this.contentClass],
                theme: this.mergedTheme.peers.Scrollbar,
                themeOverrides: this.mergedTheme.peerOverrides.Scrollbar
              }), $slots)]), this.bodyDirectives)
            })
          })),
          [[vShow, this.displayDirective === "if" || this.displayed || this.show]]
        ) : null;
      }
    });
    const {
      cubicBezierEaseIn: cubicBezierEaseIn$3,
      cubicBezierEaseOut: cubicBezierEaseOut$3
    } = commonVariables$m;
    function slideInFromRightTransition({
      duration: duration2 = "0.3s",
      leaveDuration = "0.2s",
      name = "slide-in-from-right"
    } = {}) {
      return [c$1(`&.${name}-transition-leave-active`, {
        transition: `transform ${leaveDuration} ${cubicBezierEaseIn$3}`
      }), c$1(`&.${name}-transition-enter-active`, {
        transition: `transform ${duration2} ${cubicBezierEaseOut$3}`
      }), c$1(`&.${name}-transition-enter-to`, {
        transform: "translateX(0)"
      }), c$1(`&.${name}-transition-enter-from`, {
        transform: "translateX(100%)"
      }), c$1(`&.${name}-transition-leave-from`, {
        transform: "translateX(0)"
      }), c$1(`&.${name}-transition-leave-to`, {
        transform: "translateX(100%)"
      })];
    }
    const {
      cubicBezierEaseIn: cubicBezierEaseIn$2,
      cubicBezierEaseOut: cubicBezierEaseOut$2
    } = commonVariables$m;
    function slideInFromLeftTransition({
      duration: duration2 = "0.3s",
      leaveDuration = "0.2s",
      name = "slide-in-from-left"
    } = {}) {
      return [c$1(`&.${name}-transition-leave-active`, {
        transition: `transform ${leaveDuration} ${cubicBezierEaseIn$2}`
      }), c$1(`&.${name}-transition-enter-active`, {
        transition: `transform ${duration2} ${cubicBezierEaseOut$2}`
      }), c$1(`&.${name}-transition-enter-to`, {
        transform: "translateX(0)"
      }), c$1(`&.${name}-transition-enter-from`, {
        transform: "translateX(-100%)"
      }), c$1(`&.${name}-transition-leave-from`, {
        transform: "translateX(0)"
      }), c$1(`&.${name}-transition-leave-to`, {
        transform: "translateX(-100%)"
      })];
    }
    const {
      cubicBezierEaseIn: cubicBezierEaseIn$1,
      cubicBezierEaseOut: cubicBezierEaseOut$1
    } = commonVariables$m;
    function slideInFromTopTransition({
      duration: duration2 = "0.3s",
      leaveDuration = "0.2s",
      name = "slide-in-from-top"
    } = {}) {
      return [c$1(`&.${name}-transition-leave-active`, {
        transition: `transform ${leaveDuration} ${cubicBezierEaseIn$1}`
      }), c$1(`&.${name}-transition-enter-active`, {
        transition: `transform ${duration2} ${cubicBezierEaseOut$1}`
      }), c$1(`&.${name}-transition-enter-to`, {
        transform: "translateY(0)"
      }), c$1(`&.${name}-transition-enter-from`, {
        transform: "translateY(-100%)"
      }), c$1(`&.${name}-transition-leave-from`, {
        transform: "translateY(0)"
      }), c$1(`&.${name}-transition-leave-to`, {
        transform: "translateY(-100%)"
      })];
    }
    const {
      cubicBezierEaseIn,
      cubicBezierEaseOut
    } = commonVariables$m;
    function slideInFromBottomTransition({
      duration: duration2 = "0.3s",
      leaveDuration = "0.2s",
      name = "slide-in-from-bottom"
    } = {}) {
      return [c$1(`&.${name}-transition-leave-active`, {
        transition: `transform ${leaveDuration} ${cubicBezierEaseIn}`
      }), c$1(`&.${name}-transition-enter-active`, {
        transition: `transform ${duration2} ${cubicBezierEaseOut}`
      }), c$1(`&.${name}-transition-enter-to`, {
        transform: "translateY(0)"
      }), c$1(`&.${name}-transition-enter-from`, {
        transform: "translateY(100%)"
      }), c$1(`&.${name}-transition-leave-from`, {
        transform: "translateY(0)"
      }), c$1(`&.${name}-transition-leave-to`, {
        transform: "translateY(100%)"
      })];
    }
    const style$8 = c$1([cB("drawer", `
 word-break: break-word;
 line-height: var(--n-line-height);
 position: absolute;
 pointer-events: all;
 box-shadow: var(--n-box-shadow);
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 background-color: var(--n-color);
 color: var(--n-text-color);
 box-sizing: border-box;
 `, [slideInFromRightTransition(), slideInFromLeftTransition(), slideInFromTopTransition(), slideInFromBottomTransition(), cM("unselectable", `
 user-select: none; 
 -webkit-user-select: none;
 `), cM("native-scrollbar", [cB("drawer-content-wrapper", `
 overflow: auto;
 height: 100%;
 `)]), cE("resize-trigger", `
 position: absolute;
 background-color: #0000;
 transition: background-color .3s var(--n-bezier);
 `, [cM("hover", `
 background-color: var(--n-resize-trigger-color-hover);
 `)]), cB("drawer-content-wrapper", `
 box-sizing: border-box;
 `), cB("drawer-content", `
 height: 100%;
 display: flex;
 flex-direction: column;
 `, [cM("native-scrollbar", [cB("drawer-body-content-wrapper", `
 height: 100%;
 overflow: auto;
 `)]), cB("drawer-body", `
 flex: 1 0 0;
 overflow: hidden;
 `), cB("drawer-body-content-wrapper", `
 box-sizing: border-box;
 padding: var(--n-body-padding);
 `), cB("drawer-header", `
 font-weight: var(--n-title-font-weight);
 line-height: 1;
 font-size: var(--n-title-font-size);
 color: var(--n-title-text-color);
 padding: var(--n-header-padding);
 transition: border .3s var(--n-bezier);
 border-bottom: 1px solid var(--n-divider-color);
 border-bottom: var(--n-header-border-bottom);
 display: flex;
 justify-content: space-between;
 align-items: center;
 `, [cE("main", `
 flex: 1;
 `), cE("close", `
 margin-left: 6px;
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `)]), cB("drawer-footer", `
 display: flex;
 justify-content: flex-end;
 border-top: var(--n-footer-border-top);
 transition: border .3s var(--n-bezier);
 padding: var(--n-footer-padding);
 `)]), cM("right-placement", `
 top: 0;
 bottom: 0;
 right: 0;
 border-top-left-radius: var(--n-border-radius);
 border-bottom-left-radius: var(--n-border-radius);
 `, [cE("resize-trigger", `
 width: 3px;
 height: 100%;
 top: 0;
 left: 0;
 transform: translateX(-1.5px);
 cursor: ew-resize;
 `)]), cM("left-placement", `
 top: 0;
 bottom: 0;
 left: 0;
 border-top-right-radius: var(--n-border-radius);
 border-bottom-right-radius: var(--n-border-radius);
 `, [cE("resize-trigger", `
 width: 3px;
 height: 100%;
 top: 0;
 right: 0;
 transform: translateX(1.5px);
 cursor: ew-resize;
 `)]), cM("top-placement", `
 top: 0;
 left: 0;
 right: 0;
 border-bottom-left-radius: var(--n-border-radius);
 border-bottom-right-radius: var(--n-border-radius);
 `, [cE("resize-trigger", `
 width: 100%;
 height: 3px;
 bottom: 0;
 left: 0;
 transform: translateY(1.5px);
 cursor: ns-resize;
 `)]), cM("bottom-placement", `
 left: 0;
 bottom: 0;
 right: 0;
 border-top-left-radius: var(--n-border-radius);
 border-top-right-radius: var(--n-border-radius);
 `, [cE("resize-trigger", `
 width: 100%;
 height: 3px;
 top: 0;
 left: 0;
 transform: translateY(-1.5px);
 cursor: ns-resize;
 `)])]), c$1("body", [c$1(">", [cB("drawer-container", `
 position: fixed;
 `)])]), cB("drawer-container", `
 position: relative;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 pointer-events: none;
 `, [c$1("> *", `
 pointer-events: all;
 `)]), cB("drawer-mask", `
 background-color: rgba(0, 0, 0, .3);
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 `, [cM("invisible", `
 background-color: rgba(0, 0, 0, 0)
 `), fadeInTransition({
      enterDuration: "0.2s",
      leaveDuration: "0.2s",
      enterCubicBezier: "var(--n-bezier-in)",
      leaveCubicBezier: "var(--n-bezier-out)"
    })])]);
    const drawerProps = Object.assign(Object.assign({}, useTheme.props), {
      show: Boolean,
      width: [Number, String],
      height: [Number, String],
      placement: {
        type: String,
        default: "right"
      },
      maskClosable: {
        type: Boolean,
        default: true
      },
      showMask: {
        type: [Boolean, String],
        default: true
      },
      to: [String, Object],
      displayDirective: {
        type: String,
        default: "if"
      },
      nativeScrollbar: {
        type: Boolean,
        default: true
      },
      zIndex: Number,
      onMaskClick: Function,
      scrollbarProps: Object,
      contentClass: String,
      contentStyle: [Object, String],
      trapFocus: {
        type: Boolean,
        default: true
      },
      onEsc: Function,
      autoFocus: {
        type: Boolean,
        default: true
      },
      closeOnEsc: {
        type: Boolean,
        default: true
      },
      blockScroll: {
        type: Boolean,
        default: true
      },
      maxWidth: Number,
      maxHeight: Number,
      minWidth: Number,
      minHeight: Number,
      resizable: Boolean,
      defaultWidth: {
        type: [Number, String],
        default: 251
      },
      defaultHeight: {
        type: [Number, String],
        default: 251
      },
      onUpdateWidth: [Function, Array],
      onUpdateHeight: [Function, Array],
      "onUpdate:width": [Function, Array],
      "onUpdate:height": [Function, Array],
      "onUpdate:show": [Function, Array],
      onUpdateShow: [Function, Array],
      onAfterEnter: Function,
      onAfterLeave: Function,
      /** @deprecated */
      drawerStyle: [String, Object],
      drawerClass: String,
      target: null,
      onShow: Function,
      onHide: Function
    });
    const NDrawer = /* @__PURE__ */ defineComponent({
      name: "Drawer",
      inheritAttrs: false,
      props: drawerProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          namespaceRef,
          inlineThemeDisabled
        } = useConfig(props);
        const isMountedRef = isMounted();
        const themeRef = useTheme("Drawer", "-drawer", style$8, drawerLight, props, mergedClsPrefixRef);
        const uncontrolledWidthRef = ref(props.defaultWidth);
        const uncontrolledHeightRef = ref(props.defaultHeight);
        const mergedWidthRef = useMergedState(toRef(props, "width"), uncontrolledWidthRef);
        const mergedHeightRef = useMergedState(toRef(props, "height"), uncontrolledHeightRef);
        const styleWidthRef = computed(() => {
          const {
            placement
          } = props;
          if (placement === "top" || placement === "bottom") return "";
          return formatLength(mergedWidthRef.value);
        });
        const styleHeightRef = computed(() => {
          const {
            placement
          } = props;
          if (placement === "left" || placement === "right") return "";
          return formatLength(mergedHeightRef.value);
        });
        const doUpdateWidth = (value) => {
          const {
            onUpdateWidth,
            "onUpdate:width": _onUpdateWidth
          } = props;
          if (onUpdateWidth) call(onUpdateWidth, value);
          if (_onUpdateWidth) call(_onUpdateWidth, value);
          uncontrolledWidthRef.value = value;
        };
        const doUpdateHeight = (value) => {
          const {
            onUpdateHeight,
            "onUpdate:width": _onUpdateHeight
          } = props;
          if (onUpdateHeight) call(onUpdateHeight, value);
          if (_onUpdateHeight) call(_onUpdateHeight, value);
          uncontrolledHeightRef.value = value;
        };
        const mergedBodyStyleRef = computed(() => {
          return [{
            width: styleWidthRef.value,
            height: styleHeightRef.value
          }, props.drawerStyle || ""];
        });
        function handleMaskClick(e) {
          const {
            onMaskClick,
            maskClosable
          } = props;
          if (maskClosable) {
            doUpdateShow(false);
          }
          if (onMaskClick) onMaskClick(e);
        }
        function handleOutsideClick(e) {
          handleMaskClick(e);
        }
        const isComposingRef2 = useIsComposing();
        function handleEsc(e) {
          var _a;
          (_a = props.onEsc) === null || _a === void 0 ? void 0 : _a.call(props);
          if (props.show && props.closeOnEsc && eventEffectNotPerformed(e)) {
            if (!isComposingRef2.value) {
              doUpdateShow(false);
            }
          }
        }
        function doUpdateShow(show) {
          const {
            onHide,
            onUpdateShow,
            "onUpdate:show": _onUpdateShow
          } = props;
          if (onUpdateShow) call(onUpdateShow, show);
          if (_onUpdateShow) call(_onUpdateShow, show);
          if (onHide && !show) call(onHide, show);
        }
        provide(drawerInjectionKey, {
          isMountedRef,
          mergedThemeRef: themeRef,
          mergedClsPrefixRef,
          doUpdateShow,
          doUpdateHeight,
          doUpdateWidth
        });
        const cssVarsRef = computed(() => {
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2,
              cubicBezierEaseIn: cubicBezierEaseIn2,
              cubicBezierEaseOut: cubicBezierEaseOut2
            },
            self: {
              color,
              textColor,
              boxShadow,
              lineHeight: lineHeight2,
              headerPadding,
              footerPadding,
              borderRadius,
              bodyPadding,
              titleFontSize,
              titleTextColor,
              titleFontWeight,
              headerBorderBottom,
              footerBorderTop,
              closeIconColor,
              closeIconColorHover,
              closeIconColorPressed,
              closeColorHover,
              closeColorPressed,
              closeIconSize,
              closeSize,
              closeBorderRadius,
              resizableTriggerColorHover
            }
          } = themeRef.value;
          return {
            "--n-line-height": lineHeight2,
            "--n-color": color,
            "--n-border-radius": borderRadius,
            "--n-text-color": textColor,
            "--n-box-shadow": boxShadow,
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-bezier-out": cubicBezierEaseOut2,
            "--n-bezier-in": cubicBezierEaseIn2,
            "--n-header-padding": headerPadding,
            "--n-body-padding": bodyPadding,
            "--n-footer-padding": footerPadding,
            "--n-title-text-color": titleTextColor,
            "--n-title-font-size": titleFontSize,
            "--n-title-font-weight": titleFontWeight,
            "--n-header-border-bottom": headerBorderBottom,
            "--n-footer-border-top": footerBorderTop,
            "--n-close-icon-color": closeIconColor,
            "--n-close-icon-color-hover": closeIconColorHover,
            "--n-close-icon-color-pressed": closeIconColorPressed,
            "--n-close-size": closeSize,
            "--n-close-color-hover": closeColorHover,
            "--n-close-color-pressed": closeColorPressed,
            "--n-close-icon-size": closeIconSize,
            "--n-close-border-radius": closeBorderRadius,
            "--n-resize-trigger-color-hover": resizableTriggerColorHover
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("drawer", void 0, cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          namespace: namespaceRef,
          mergedBodyStyle: mergedBodyStyleRef,
          handleOutsideClick,
          handleMaskClick,
          handleEsc,
          mergedTheme: themeRef,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
          isMounted: isMountedRef
        };
      },
      render() {
        const {
          mergedClsPrefix
        } = this;
        return h(LazyTeleport, {
          to: this.to,
          show: this.show
        }, {
          default: () => {
            var _a;
            (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
            return withDirectives(h("div", {
              class: [`${mergedClsPrefix}-drawer-container`, this.namespace, this.themeClass],
              style: this.cssVars,
              role: "none"
            }, this.showMask ? h(Transition, {
              name: "fade-in-transition",
              appear: this.isMounted
            }, {
              default: () => this.show ? h("div", {
                "aria-hidden": true,
                class: [`${mergedClsPrefix}-drawer-mask`, this.showMask === "transparent" && `${mergedClsPrefix}-drawer-mask--invisible`],
                onClick: this.handleMaskClick
              }) : null
            }) : null, h(NDrawerBodyWrapper, Object.assign({}, this.$attrs, {
              class: [this.drawerClass, this.$attrs.class],
              style: [this.mergedBodyStyle, this.$attrs.style],
              blockScroll: this.blockScroll,
              contentStyle: this.contentStyle,
              contentClass: this.contentClass,
              placement: this.placement,
              scrollbarProps: this.scrollbarProps,
              show: this.show,
              displayDirective: this.displayDirective,
              nativeScrollbar: this.nativeScrollbar,
              onAfterEnter: this.onAfterEnter,
              onAfterLeave: this.onAfterLeave,
              trapFocus: this.trapFocus,
              autoFocus: this.autoFocus,
              resizable: this.resizable,
              maxHeight: this.maxHeight,
              minHeight: this.minHeight,
              maxWidth: this.maxWidth,
              minWidth: this.minWidth,
              showMask: this.showMask,
              onEsc: this.handleEsc,
              onClickoutside: this.handleOutsideClick
            }), this.$slots)), [[zindexable, {
              zIndex: this.zIndex,
              enabled: this.show
            }]]);
          }
        });
      }
    });
    const drawerContentProps = {
      title: String,
      headerClass: String,
      headerStyle: [Object, String],
      footerClass: String,
      footerStyle: [Object, String],
      bodyClass: String,
      bodyStyle: [Object, String],
      bodyContentClass: String,
      bodyContentStyle: [Object, String],
      nativeScrollbar: {
        type: Boolean,
        default: true
      },
      scrollbarProps: Object,
      closable: Boolean
    };
    const NDrawerContent = /* @__PURE__ */ defineComponent({
      name: "DrawerContent",
      props: drawerContentProps,
      setup() {
        const NDrawer2 = inject(drawerInjectionKey, null);
        if (!NDrawer2) {
          throwError("drawer-content", "`n-drawer-content` must be placed inside `n-drawer`.");
        }
        const {
          doUpdateShow
        } = NDrawer2;
        function handleCloseClick() {
          doUpdateShow(false);
        }
        return {
          handleCloseClick,
          mergedTheme: NDrawer2.mergedThemeRef,
          mergedClsPrefix: NDrawer2.mergedClsPrefixRef
        };
      },
      render() {
        const {
          title,
          mergedClsPrefix,
          nativeScrollbar,
          mergedTheme,
          bodyClass,
          bodyStyle,
          bodyContentClass,
          bodyContentStyle,
          headerClass,
          headerStyle,
          footerClass,
          footerStyle,
          scrollbarProps: scrollbarProps2,
          closable,
          $slots
        } = this;
        return h("div", {
          role: "none",
          class: [`${mergedClsPrefix}-drawer-content`, nativeScrollbar && `${mergedClsPrefix}-drawer-content--native-scrollbar`]
        }, $slots.header || title || closable ? h("div", {
          class: [`${mergedClsPrefix}-drawer-header`, headerClass],
          style: headerStyle,
          role: "none"
        }, h("div", {
          class: `${mergedClsPrefix}-drawer-header__main`,
          role: "heading",
          "aria-level": "1"
        }, $slots.header !== void 0 ? $slots.header() : title), closable && h(NBaseClose, {
          onClick: this.handleCloseClick,
          clsPrefix: mergedClsPrefix,
          class: `${mergedClsPrefix}-drawer-header__close`,
          absolute: true
        })) : null, nativeScrollbar ? h("div", {
          class: [`${mergedClsPrefix}-drawer-body`, bodyClass],
          style: bodyStyle,
          role: "none"
        }, h("div", {
          class: [`${mergedClsPrefix}-drawer-body-content-wrapper`, bodyContentClass],
          style: bodyContentStyle,
          role: "none"
        }, $slots)) : h(Scrollbar, Object.assign({
          themeOverrides: mergedTheme.peerOverrides.Scrollbar,
          theme: mergedTheme.peers.Scrollbar
        }, scrollbarProps2, {
          class: `${mergedClsPrefix}-drawer-body`,
          contentClass: [`${mergedClsPrefix}-drawer-body-content-wrapper`, bodyContentClass],
          contentStyle: bodyContentStyle
        }), $slots), $slots.footer ? h("div", {
          class: [`${mergedClsPrefix}-drawer-footer`, footerClass],
          style: footerStyle,
          role: "none"
        }, $slots.footer()) : null);
      }
    });
    const commonVariables$6 = {
      actionMargin: "0 0 0 20px",
      actionMarginRtl: "0 20px 0 0"
    };
    const dynamicInputDark = {
      name: "DynamicInput",
      common: derived$1,
      peers: {
        Input: inputDark,
        Button: buttonDark
      },
      self() {
        return commonVariables$6;
      }
    };
    const commonVars$5 = {
      gapSmall: "4px 8px",
      gapMedium: "8px 12px",
      gapLarge: "12px 16px"
    };
    const spaceDark = {
      name: "Space",
      self() {
        return commonVars$5;
      }
    };
    function self$p() {
      return commonVars$5;
    }
    const spaceLight = {
      name: "Space",
      self: self$p
    };
    let supportFlexGap;
    function ensureSupportFlexGap() {
      if (!isBrowser$2) return true;
      if (supportFlexGap === void 0) {
        const flex = document.createElement("div");
        flex.style.display = "flex";
        flex.style.flexDirection = "column";
        flex.style.rowGap = "1px";
        flex.appendChild(document.createElement("div"));
        flex.appendChild(document.createElement("div"));
        document.body.appendChild(flex);
        const isSupported = flex.scrollHeight === 1;
        document.body.removeChild(flex);
        return supportFlexGap = isSupported;
      }
      return supportFlexGap;
    }
    const spaceProps = Object.assign(Object.assign({}, useTheme.props), {
      align: String,
      justify: {
        type: String,
        default: "start"
      },
      inline: Boolean,
      vertical: Boolean,
      reverse: Boolean,
      size: {
        type: [String, Number, Array],
        default: "medium"
      },
      wrapItem: {
        type: Boolean,
        default: true
      },
      itemClass: String,
      itemStyle: [String, Object],
      wrap: {
        type: Boolean,
        default: true
      },
      // internal
      internalUseGap: {
        type: Boolean,
        default: void 0
      }
    });
    const NSpace = /* @__PURE__ */ defineComponent({
      name: "Space",
      props: spaceProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          mergedRtlRef
        } = useConfig(props);
        const themeRef = useTheme("Space", "-space", void 0, spaceLight, props, mergedClsPrefixRef);
        const rtlEnabledRef = useRtl("Space", mergedRtlRef, mergedClsPrefixRef);
        return {
          useGap: ensureSupportFlexGap(),
          rtlEnabled: rtlEnabledRef,
          mergedClsPrefix: mergedClsPrefixRef,
          margin: computed(() => {
            const {
              size: size2
            } = props;
            if (Array.isArray(size2)) {
              return {
                horizontal: size2[0],
                vertical: size2[1]
              };
            }
            if (typeof size2 === "number") {
              return {
                horizontal: size2,
                vertical: size2
              };
            }
            const {
              self: {
                [createKey("gap", size2)]: gap
              }
            } = themeRef.value;
            const {
              row,
              col
            } = getGap(gap);
            return {
              horizontal: depx(col),
              vertical: depx(row)
            };
          })
        };
      },
      render() {
        const {
          vertical,
          reverse,
          align,
          inline,
          justify,
          itemClass,
          itemStyle,
          margin,
          wrap,
          mergedClsPrefix,
          rtlEnabled,
          useGap,
          wrapItem,
          internalUseGap
        } = this;
        const children = flatten$2(getSlot$1(this), false);
        if (!children.length) return null;
        const horizontalMargin = `${margin.horizontal}px`;
        const semiHorizontalMargin = `${margin.horizontal / 2}px`;
        const verticalMargin = `${margin.vertical}px`;
        const semiVerticalMargin = `${margin.vertical / 2}px`;
        const lastIndex = children.length - 1;
        const isJustifySpace = justify.startsWith("space-");
        return h("div", {
          role: "none",
          class: [`${mergedClsPrefix}-space`, rtlEnabled && `${mergedClsPrefix}-space--rtl`],
          style: {
            display: inline ? "inline-flex" : "flex",
            flexDirection: (() => {
              if (vertical && !reverse) return "column";
              if (vertical && reverse) return "column-reverse";
              if (!vertical && reverse) return "row-reverse";
              else return "row";
            })(),
            justifyContent: ["start", "end"].includes(justify) ? `flex-${justify}` : justify,
            flexWrap: !wrap || vertical ? "nowrap" : "wrap",
            marginTop: useGap || vertical ? "" : `-${semiVerticalMargin}`,
            marginBottom: useGap || vertical ? "" : `-${semiVerticalMargin}`,
            alignItems: align,
            gap: useGap ? `${margin.vertical}px ${margin.horizontal}px` : ""
          }
        }, !wrapItem && (useGap || internalUseGap) ? children : children.map((child, index) => child.type === Comment ? child : h("div", {
          role: "none",
          class: itemClass,
          style: [itemStyle, {
            maxWidth: "100%"
          }, useGap ? "" : vertical ? {
            marginBottom: index !== lastIndex ? verticalMargin : ""
          } : rtlEnabled ? {
            marginLeft: isJustifySpace ? justify === "space-between" && index === lastIndex ? "" : semiHorizontalMargin : index !== lastIndex ? horizontalMargin : "",
            marginRight: isJustifySpace ? justify === "space-between" && index === 0 ? "" : semiHorizontalMargin : "",
            paddingTop: semiVerticalMargin,
            paddingBottom: semiVerticalMargin
          } : {
            marginRight: isJustifySpace ? justify === "space-between" && index === lastIndex ? "" : semiHorizontalMargin : index !== lastIndex ? horizontalMargin : "",
            marginLeft: isJustifySpace ? justify === "space-between" && index === 0 ? "" : semiHorizontalMargin : "",
            paddingTop: semiVerticalMargin,
            paddingBottom: semiVerticalMargin
          }]
        }, child)));
      }
    });
    const dynamicTagsDark = {
      name: "DynamicTags",
      common: derived$1,
      peers: {
        Input: inputDark,
        Button: buttonDark,
        Tag: tagDark,
        Space: spaceDark
      },
      self() {
        return {
          inputWidth: "64px"
        };
      }
    };
    const elementDark = {
      name: "Element",
      common: derived$1
    };
    const commonVars$4 = {
      gapSmall: "4px 8px",
      gapMedium: "8px 12px",
      gapLarge: "12px 16px"
    };
    const flexDark = {
      name: "Flex",
      self() {
        return commonVars$4;
      }
    };
    const commonVariables$5 = {
      feedbackPadding: "4px 0 0 2px",
      feedbackHeightSmall: "24px",
      feedbackHeightMedium: "24px",
      feedbackHeightLarge: "26px",
      feedbackFontSizeSmall: "13px",
      feedbackFontSizeMedium: "14px",
      feedbackFontSizeLarge: "14px",
      labelFontSizeLeftSmall: "14px",
      labelFontSizeLeftMedium: "14px",
      labelFontSizeLeftLarge: "15px",
      labelFontSizeTopSmall: "13px",
      labelFontSizeTopMedium: "14px",
      labelFontSizeTopLarge: "14px",
      labelHeightSmall: "24px",
      labelHeightMedium: "26px",
      labelHeightLarge: "28px",
      labelPaddingVertical: "0 0 6px 2px",
      labelPaddingHorizontal: "0 12px 0 0",
      labelTextAlignVertical: "left",
      labelTextAlignHorizontal: "right",
      labelFontWeight: "400"
    };
    function self$o(vars) {
      const {
        heightSmall,
        heightMedium,
        heightLarge,
        textColor1,
        errorColor,
        warningColor,
        lineHeight: lineHeight2,
        textColor3
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$5), {
        blankHeightSmall: heightSmall,
        blankHeightMedium: heightMedium,
        blankHeightLarge: heightLarge,
        lineHeight: lineHeight2,
        labelTextColor: textColor1,
        asteriskColor: errorColor,
        feedbackTextColorError: errorColor,
        feedbackTextColorWarning: warningColor,
        feedbackTextColor: textColor3
      });
    }
    const formItemDark = {
      name: "Form",
      common: derived$1,
      self: self$o
    };
    const commonVars$3 = {
      closeMargin: "16px 12px",
      closeSize: "20px",
      closeIconSize: "16px",
      width: "365px",
      padding: "16px",
      titleFontSize: "16px",
      metaFontSize: "12px",
      descriptionFontSize: "12px"
    };
    function self$n(vars) {
      const {
        textColor2,
        successColor,
        infoColor,
        warningColor,
        errorColor,
        popoverColor,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeColorHover,
        closeColorPressed,
        textColor1,
        textColor3,
        borderRadius,
        fontWeightStrong,
        boxShadow2,
        lineHeight: lineHeight2,
        fontSize: fontSize2
      } = vars;
      return Object.assign(Object.assign({}, commonVars$3), {
        borderRadius,
        lineHeight: lineHeight2,
        fontSize: fontSize2,
        headerFontWeight: fontWeightStrong,
        iconColor: textColor2,
        iconColorSuccess: successColor,
        iconColorInfo: infoColor,
        iconColorWarning: warningColor,
        iconColorError: errorColor,
        color: popoverColor,
        textColor: textColor2,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeBorderRadius: borderRadius,
        closeColorHover,
        closeColorPressed,
        headerTextColor: textColor1,
        descriptionTextColor: textColor3,
        actionTextColor: textColor2,
        boxShadow: boxShadow2
      });
    }
    const notificationLight = createTheme({
      name: "Notification",
      common: derived,
      peers: {
        Scrollbar: scrollbarLight
      },
      self: self$n
    });
    const notificationDark = {
      name: "Notification",
      common: derived$1,
      peers: {
        Scrollbar: scrollbarDark
      },
      self: self$n
    };
    const commonVariables$4 = {
      margin: "0 0 8px 0",
      padding: "10px 20px",
      maxWidth: "720px",
      minWidth: "420px",
      iconMargin: "0 10px 0 0",
      closeMargin: "0 0 0 10px",
      closeSize: "20px",
      closeIconSize: "16px",
      iconSize: "20px",
      fontSize: "14px"
    };
    function self$m(vars) {
      const {
        textColor2,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        infoColor,
        successColor,
        errorColor,
        warningColor,
        popoverColor,
        boxShadow2,
        primaryColor,
        lineHeight: lineHeight2,
        borderRadius,
        closeColorHover,
        closeColorPressed
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$4), {
        closeBorderRadius: borderRadius,
        textColor: textColor2,
        textColorInfo: textColor2,
        textColorSuccess: textColor2,
        textColorError: textColor2,
        textColorWarning: textColor2,
        textColorLoading: textColor2,
        color: popoverColor,
        colorInfo: popoverColor,
        colorSuccess: popoverColor,
        colorError: popoverColor,
        colorWarning: popoverColor,
        colorLoading: popoverColor,
        boxShadow: boxShadow2,
        boxShadowInfo: boxShadow2,
        boxShadowSuccess: boxShadow2,
        boxShadowError: boxShadow2,
        boxShadowWarning: boxShadow2,
        boxShadowLoading: boxShadow2,
        iconColor: textColor2,
        iconColorInfo: infoColor,
        iconColorSuccess: successColor,
        iconColorWarning: warningColor,
        iconColorError: errorColor,
        iconColorLoading: primaryColor,
        closeColorHover,
        closeColorPressed,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeColorHoverInfo: closeColorHover,
        closeColorPressedInfo: closeColorPressed,
        closeIconColorInfo: closeIconColor,
        closeIconColorHoverInfo: closeIconColorHover,
        closeIconColorPressedInfo: closeIconColorPressed,
        closeColorHoverSuccess: closeColorHover,
        closeColorPressedSuccess: closeColorPressed,
        closeIconColorSuccess: closeIconColor,
        closeIconColorHoverSuccess: closeIconColorHover,
        closeIconColorPressedSuccess: closeIconColorPressed,
        closeColorHoverError: closeColorHover,
        closeColorPressedError: closeColorPressed,
        closeIconColorError: closeIconColor,
        closeIconColorHoverError: closeIconColorHover,
        closeIconColorPressedError: closeIconColorPressed,
        closeColorHoverWarning: closeColorHover,
        closeColorPressedWarning: closeColorPressed,
        closeIconColorWarning: closeIconColor,
        closeIconColorHoverWarning: closeIconColorHover,
        closeIconColorPressedWarning: closeIconColorPressed,
        closeColorHoverLoading: closeColorHover,
        closeColorPressedLoading: closeColorPressed,
        closeIconColorLoading: closeIconColor,
        closeIconColorHoverLoading: closeIconColorHover,
        closeIconColorPressedLoading: closeIconColorPressed,
        loadingColor: primaryColor,
        lineHeight: lineHeight2,
        borderRadius
      });
    }
    const messageDark = {
      name: "Message",
      common: derived$1,
      self: self$m
    };
    const buttonGroupDark = {
      name: "ButtonGroup",
      common: derived$1
    };
    const gradientTextDark = {
      name: "GradientText",
      common: derived$1,
      self(vars) {
        const {
          primaryColor,
          successColor,
          warningColor,
          errorColor,
          infoColor,
          primaryColorSuppl,
          successColorSuppl,
          warningColorSuppl,
          errorColorSuppl,
          infoColorSuppl,
          fontWeightStrong
        } = vars;
        return {
          fontWeight: fontWeightStrong,
          rotate: "252deg",
          colorStartPrimary: primaryColor,
          colorEndPrimary: primaryColorSuppl,
          colorStartInfo: infoColor,
          colorEndInfo: infoColorSuppl,
          colorStartWarning: warningColor,
          colorEndWarning: warningColorSuppl,
          colorStartError: errorColor,
          colorEndError: errorColorSuppl,
          colorStartSuccess: successColor,
          colorEndSuccess: successColorSuppl
        };
      }
    };
    const inputNumberDark = {
      name: "InputNumber",
      common: derived$1,
      peers: {
        Button: buttonDark,
        Input: inputDark
      },
      self(vars) {
        const {
          textColorDisabled
        } = vars;
        return {
          iconColorDisabled: textColorDisabled
        };
      }
    };
    function self$l(vars) {
      const {
        textColorDisabled
      } = vars;
      return {
        iconColorDisabled: textColorDisabled
      };
    }
    const inputNumberLight = createTheme({
      name: "InputNumber",
      common: derived,
      peers: {
        Button: buttonLight,
        Input: inputLight
      },
      self: self$l
    });
    const layoutDark = {
      name: "Layout",
      common: derived$1,
      peers: {
        Scrollbar: scrollbarDark
      },
      self(vars) {
        const {
          textColor2,
          bodyColor,
          popoverColor,
          cardColor,
          dividerColor,
          scrollbarColor,
          scrollbarColorHover
        } = vars;
        return {
          textColor: textColor2,
          textColorInverted: textColor2,
          color: bodyColor,
          colorEmbedded: bodyColor,
          headerColor: cardColor,
          headerColorInverted: cardColor,
          footerColor: cardColor,
          footerColorInverted: cardColor,
          headerBorderColor: dividerColor,
          headerBorderColorInverted: dividerColor,
          footerBorderColor: dividerColor,
          footerBorderColorInverted: dividerColor,
          siderBorderColor: dividerColor,
          siderBorderColorInverted: dividerColor,
          siderColor: cardColor,
          siderColorInverted: cardColor,
          siderToggleButtonBorder: "1px solid transparent",
          siderToggleButtonColor: popoverColor,
          siderToggleButtonIconColor: textColor2,
          siderToggleButtonIconColorInverted: textColor2,
          siderToggleBarColor: composite(bodyColor, scrollbarColor),
          siderToggleBarColorHover: composite(bodyColor, scrollbarColorHover),
          __invertScrollbar: "false"
        };
      }
    };
    function self$k(vars) {
      const {
        textColor2,
        cardColor,
        modalColor,
        popoverColor,
        dividerColor,
        borderRadius,
        fontSize: fontSize2,
        hoverColor
      } = vars;
      return {
        textColor: textColor2,
        color: cardColor,
        colorHover: hoverColor,
        colorModal: modalColor,
        colorHoverModal: composite(modalColor, hoverColor),
        colorPopover: popoverColor,
        colorHoverPopover: composite(popoverColor, hoverColor),
        borderColor: dividerColor,
        borderColorModal: composite(modalColor, dividerColor),
        borderColorPopover: composite(popoverColor, dividerColor),
        borderRadius,
        fontSize: fontSize2
      };
    }
    const listDark$1 = {
      name: "List",
      common: derived$1,
      self: self$k
    };
    const loadingBarDark = {
      name: "LoadingBar",
      common: derived$1,
      self(vars) {
        const {
          primaryColor
        } = vars;
        return {
          colorError: "red",
          colorLoading: primaryColor,
          height: "2px"
        };
      }
    };
    const logDark = {
      name: "Log",
      common: derived$1,
      peers: {
        Scrollbar: scrollbarDark,
        Code: codeDark
      },
      self(vars) {
        const {
          textColor2,
          inputColor,
          fontSize: fontSize2,
          primaryColor
        } = vars;
        return {
          loaderFontSize: fontSize2,
          loaderTextColor: textColor2,
          loaderColor: inputColor,
          loaderBorder: "1px solid #0000",
          loadingColor: primaryColor
        };
      }
    };
    function self$j(vars) {
      const {
        textColor2,
        modalColor,
        borderColor,
        fontSize: fontSize2,
        primaryColor
      } = vars;
      return {
        loaderFontSize: fontSize2,
        loaderTextColor: textColor2,
        loaderColor: modalColor,
        loaderBorder: `1px solid ${borderColor}`,
        loadingColor: primaryColor
      };
    }
    const logLight = createTheme({
      name: "Log",
      common: derived,
      peers: {
        Scrollbar: scrollbarLight,
        Code: codeLight
      },
      self: self$j
    });
    const listDark = {
      name: "Mention",
      common: derived$1,
      peers: {
        InternalSelectMenu: internalSelectMenuDark,
        Input: inputDark
      },
      self(vars) {
        const {
          boxShadow2
        } = vars;
        return {
          menuBoxShadow: boxShadow2
        };
      }
    };
    function createPartialInvertedVars(color, activeItemColor, activeTextColor, groupTextColor) {
      return {
        itemColorHoverInverted: "#0000",
        itemColorActiveInverted: activeItemColor,
        itemColorActiveHoverInverted: activeItemColor,
        itemColorActiveCollapsedInverted: activeItemColor,
        itemTextColorInverted: color,
        itemTextColorHoverInverted: activeTextColor,
        itemTextColorChildActiveInverted: activeTextColor,
        itemTextColorChildActiveHoverInverted: activeTextColor,
        itemTextColorActiveInverted: activeTextColor,
        itemTextColorActiveHoverInverted: activeTextColor,
        itemTextColorHorizontalInverted: color,
        itemTextColorHoverHorizontalInverted: activeTextColor,
        itemTextColorChildActiveHorizontalInverted: activeTextColor,
        itemTextColorChildActiveHoverHorizontalInverted: activeTextColor,
        itemTextColorActiveHorizontalInverted: activeTextColor,
        itemTextColorActiveHoverHorizontalInverted: activeTextColor,
        itemIconColorInverted: color,
        itemIconColorHoverInverted: activeTextColor,
        itemIconColorActiveInverted: activeTextColor,
        itemIconColorActiveHoverInverted: activeTextColor,
        itemIconColorChildActiveInverted: activeTextColor,
        itemIconColorChildActiveHoverInverted: activeTextColor,
        itemIconColorCollapsedInverted: color,
        itemIconColorHorizontalInverted: color,
        itemIconColorHoverHorizontalInverted: activeTextColor,
        itemIconColorActiveHorizontalInverted: activeTextColor,
        itemIconColorActiveHoverHorizontalInverted: activeTextColor,
        itemIconColorChildActiveHorizontalInverted: activeTextColor,
        itemIconColorChildActiveHoverHorizontalInverted: activeTextColor,
        arrowColorInverted: color,
        arrowColorHoverInverted: activeTextColor,
        arrowColorActiveInverted: activeTextColor,
        arrowColorActiveHoverInverted: activeTextColor,
        arrowColorChildActiveInverted: activeTextColor,
        arrowColorChildActiveHoverInverted: activeTextColor,
        groupTextColorInverted: groupTextColor
      };
    }
    function self$i(vars) {
      const {
        borderRadius,
        textColor3,
        primaryColor,
        textColor2,
        textColor1,
        fontSize: fontSize2,
        dividerColor,
        hoverColor,
        primaryColorHover
      } = vars;
      return Object.assign({
        borderRadius,
        color: "#0000",
        groupTextColor: textColor3,
        itemColorHover: hoverColor,
        itemColorActive: changeColor(primaryColor, {
          alpha: 0.1
        }),
        itemColorActiveHover: changeColor(primaryColor, {
          alpha: 0.1
        }),
        itemColorActiveCollapsed: changeColor(primaryColor, {
          alpha: 0.1
        }),
        itemTextColor: textColor2,
        itemTextColorHover: textColor2,
        itemTextColorActive: primaryColor,
        itemTextColorActiveHover: primaryColor,
        itemTextColorChildActive: primaryColor,
        itemTextColorChildActiveHover: primaryColor,
        itemTextColorHorizontal: textColor2,
        itemTextColorHoverHorizontal: primaryColorHover,
        itemTextColorActiveHorizontal: primaryColor,
        itemTextColorActiveHoverHorizontal: primaryColor,
        itemTextColorChildActiveHorizontal: primaryColor,
        itemTextColorChildActiveHoverHorizontal: primaryColor,
        itemIconColor: textColor1,
        itemIconColorHover: textColor1,
        itemIconColorActive: primaryColor,
        itemIconColorActiveHover: primaryColor,
        itemIconColorChildActive: primaryColor,
        itemIconColorChildActiveHover: primaryColor,
        itemIconColorCollapsed: textColor1,
        itemIconColorHorizontal: textColor1,
        itemIconColorHoverHorizontal: primaryColorHover,
        itemIconColorActiveHorizontal: primaryColor,
        itemIconColorActiveHoverHorizontal: primaryColor,
        itemIconColorChildActiveHorizontal: primaryColor,
        itemIconColorChildActiveHoverHorizontal: primaryColor,
        itemHeight: "42px",
        arrowColor: textColor2,
        arrowColorHover: textColor2,
        arrowColorActive: primaryColor,
        arrowColorActiveHover: primaryColor,
        arrowColorChildActive: primaryColor,
        arrowColorChildActiveHover: primaryColor,
        colorInverted: "#0000",
        borderColorHorizontal: "#0000",
        fontSize: fontSize2,
        dividerColor
      }, createPartialInvertedVars("#BBB", primaryColor, "#FFF", "#AAA"));
    }
    const menuDark = {
      name: "Menu",
      common: derived$1,
      peers: {
        Tooltip: tooltipDark,
        Dropdown: dropdownDark
      },
      self(vars) {
        const {
          primaryColor,
          primaryColorSuppl
        } = vars;
        const commonSelf = self$i(vars);
        commonSelf.itemColorActive = changeColor(primaryColor, {
          alpha: 0.15
        });
        commonSelf.itemColorActiveHover = changeColor(primaryColor, {
          alpha: 0.15
        });
        commonSelf.itemColorActiveCollapsed = changeColor(primaryColor, {
          alpha: 0.15
        });
        commonSelf.itemColorActiveInverted = primaryColorSuppl;
        commonSelf.itemColorActiveHoverInverted = primaryColorSuppl;
        commonSelf.itemColorActiveCollapsedInverted = primaryColorSuppl;
        return commonSelf;
      }
    };
    const common = {
      titleFontSize: "18px",
      backSize: "22px"
    };
    function self$h(vars) {
      const {
        textColor1,
        textColor2,
        textColor3,
        fontSize: fontSize2,
        fontWeightStrong,
        primaryColorHover,
        primaryColorPressed
      } = vars;
      return Object.assign(Object.assign({}, common), {
        titleFontWeight: fontWeightStrong,
        fontSize: fontSize2,
        titleTextColor: textColor1,
        backColor: textColor2,
        backColorHover: primaryColorHover,
        backColorPressed: primaryColorPressed,
        subtitleTextColor: textColor3
      });
    }
    const pageHeaderDark = {
      name: "PageHeader",
      common: derived$1,
      self: self$h
    };
    const commonVars$2 = {
      iconSize: "22px"
    };
    function self$g(vars) {
      const {
        fontSize: fontSize2,
        warningColor
      } = vars;
      return Object.assign(Object.assign({}, commonVars$2), {
        fontSize: fontSize2,
        iconColor: warningColor
      });
    }
    const popconfirmDark = {
      name: "Popconfirm",
      common: derived$1,
      peers: {
        Button: buttonDark,
        Popover: popoverDark
      },
      self: self$g
    };
    function self$f(vars) {
      const {
        infoColor,
        successColor,
        warningColor,
        errorColor,
        textColor2,
        progressRailColor,
        fontSize: fontSize2,
        fontWeight
      } = vars;
      return {
        fontSize: fontSize2,
        fontSizeCircle: "28px",
        fontWeightCircle: fontWeight,
        railColor: progressRailColor,
        railHeight: "8px",
        iconSizeCircle: "36px",
        iconSizeLine: "18px",
        iconColor: infoColor,
        iconColorInfo: infoColor,
        iconColorSuccess: successColor,
        iconColorWarning: warningColor,
        iconColorError: errorColor,
        textColorCircle: textColor2,
        textColorLineInner: "rgb(255, 255, 255)",
        textColorLineOuter: textColor2,
        fillColor: infoColor,
        fillColorInfo: infoColor,
        fillColorSuccess: successColor,
        fillColorWarning: warningColor,
        fillColorError: errorColor,
        lineBgProcessing: "linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"
      };
    }
    const progressLight = {
      name: "Progress",
      common: derived,
      self: self$f
    };
    const progressDark = {
      name: "Progress",
      common: derived$1,
      self(vars) {
        const commonSelf = self$f(vars);
        commonSelf.textColorLineInner = "rgb(0, 0, 0)";
        commonSelf.lineBgProcessing = "linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)";
        return commonSelf;
      }
    };
    const rateDark = {
      name: "Rate",
      common: derived$1,
      self(vars) {
        const {
          railColor
        } = vars;
        return {
          itemColor: railColor,
          itemColorActive: "#CCAA33",
          itemSize: "20px",
          sizeSmall: "16px",
          sizeMedium: "20px",
          sizeLarge: "24px"
        };
      }
    };
    const commonVariables$3 = {
      titleFontSizeSmall: "26px",
      titleFontSizeMedium: "32px",
      titleFontSizeLarge: "40px",
      titleFontSizeHuge: "48px",
      fontSizeSmall: "14px",
      fontSizeMedium: "14px",
      fontSizeLarge: "15px",
      fontSizeHuge: "16px",
      iconSizeSmall: "64px",
      iconSizeMedium: "80px",
      iconSizeLarge: "100px",
      iconSizeHuge: "125px",
      iconColor418: void 0,
      iconColor404: void 0,
      iconColor403: void 0,
      iconColor500: void 0
    };
    function self$e(vars) {
      const {
        textColor2,
        textColor1,
        errorColor,
        successColor,
        infoColor,
        warningColor,
        lineHeight: lineHeight2,
        fontWeightStrong
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$3), {
        lineHeight: lineHeight2,
        titleFontWeight: fontWeightStrong,
        titleTextColor: textColor1,
        textColor: textColor2,
        iconColorError: errorColor,
        iconColorSuccess: successColor,
        iconColorInfo: infoColor,
        iconColorWarning: warningColor
      });
    }
    const resultDark = {
      name: "Result",
      common: derived$1,
      self: self$e
    };
    const sizeVariables$3 = {
      railHeight: "4px",
      railWidthVertical: "4px",
      handleSize: "18px",
      dotHeight: "8px",
      dotWidth: "8px",
      dotBorderRadius: "4px"
    };
    const sliderDark = {
      name: "Slider",
      common: derived$1,
      self(vars) {
        const boxShadow = "0 2px 8px 0 rgba(0, 0, 0, 0.12)";
        const {
          railColor,
          modalColor,
          primaryColorSuppl,
          popoverColor,
          textColor2,
          cardColor,
          borderRadius,
          fontSize: fontSize2,
          opacityDisabled
        } = vars;
        return Object.assign(Object.assign({}, sizeVariables$3), {
          fontSize: fontSize2,
          markFontSize: fontSize2,
          railColor,
          railColorHover: railColor,
          fillColor: primaryColorSuppl,
          fillColorHover: primaryColorSuppl,
          opacityDisabled,
          handleColor: "#FFF",
          dotColor: cardColor,
          dotColorModal: modalColor,
          dotColorPopover: popoverColor,
          handleBoxShadow: "0px 2px 4px 0 rgba(0, 0, 0, 0.4)",
          handleBoxShadowHover: "0px 2px 4px 0 rgba(0, 0, 0, 0.4)",
          handleBoxShadowActive: "0px 2px 4px 0 rgba(0, 0, 0, 0.4)",
          handleBoxShadowFocus: "0px 2px 4px 0 rgba(0, 0, 0, 0.4)",
          indicatorColor: popoverColor,
          indicatorBoxShadow: boxShadow,
          indicatorTextColor: textColor2,
          indicatorBorderRadius: borderRadius,
          dotBorder: `2px solid ${railColor}`,
          dotBorderActive: `2px solid ${primaryColorSuppl}`,
          dotBoxShadow: ""
        });
      }
    };
    function self$d(vars) {
      const {
        opacityDisabled,
        heightTiny,
        heightSmall,
        heightMedium,
        heightLarge,
        heightHuge,
        primaryColor,
        fontSize: fontSize2
      } = vars;
      return {
        fontSize: fontSize2,
        textColor: primaryColor,
        sizeTiny: heightTiny,
        sizeSmall: heightSmall,
        sizeMedium: heightMedium,
        sizeLarge: heightLarge,
        sizeHuge: heightHuge,
        color: primaryColor,
        opacitySpinning: opacityDisabled
      };
    }
    const spinDark = {
      name: "Spin",
      common: derived$1,
      self: self$d
    };
    function self$c(vars) {
      const {
        textColor2,
        textColor3,
        fontSize: fontSize2,
        fontWeight
      } = vars;
      return {
        labelFontSize: fontSize2,
        labelFontWeight: fontWeight,
        valueFontWeight: fontWeight,
        valueFontSize: "24px",
        labelTextColor: textColor3,
        valuePrefixTextColor: textColor2,
        valueSuffixTextColor: textColor2,
        valueTextColor: textColor2
      };
    }
    const statisticDark = {
      name: "Statistic",
      common: derived$1,
      self: self$c
    };
    const commonVariables$2 = {
      stepHeaderFontSizeSmall: "14px",
      stepHeaderFontSizeMedium: "16px",
      indicatorIndexFontSizeSmall: "14px",
      indicatorIndexFontSizeMedium: "16px",
      indicatorSizeSmall: "22px",
      indicatorSizeMedium: "28px",
      indicatorIconSizeSmall: "14px",
      indicatorIconSizeMedium: "18px"
    };
    function self$b(vars) {
      const {
        fontWeightStrong,
        baseColor,
        textColorDisabled,
        primaryColor,
        errorColor,
        textColor1,
        textColor2
      } = vars;
      return Object.assign(Object.assign({}, commonVariables$2), {
        stepHeaderFontWeight: fontWeightStrong,
        indicatorTextColorProcess: baseColor,
        indicatorTextColorWait: textColorDisabled,
        indicatorTextColorFinish: primaryColor,
        indicatorTextColorError: errorColor,
        indicatorBorderColorProcess: primaryColor,
        indicatorBorderColorWait: textColorDisabled,
        indicatorBorderColorFinish: primaryColor,
        indicatorBorderColorError: errorColor,
        indicatorColorProcess: primaryColor,
        indicatorColorWait: "#0000",
        indicatorColorFinish: "#0000",
        indicatorColorError: "#0000",
        splitorColorProcess: textColorDisabled,
        splitorColorWait: textColorDisabled,
        splitorColorFinish: primaryColor,
        splitorColorError: textColorDisabled,
        headerTextColorProcess: textColor1,
        headerTextColorWait: textColorDisabled,
        headerTextColorFinish: textColorDisabled,
        headerTextColorError: errorColor,
        descriptionTextColorProcess: textColor2,
        descriptionTextColorWait: textColorDisabled,
        descriptionTextColorFinish: textColorDisabled,
        descriptionTextColorError: errorColor
      });
    }
    const stepsDark = {
      name: "Steps",
      common: derived$1,
      self: self$b
    };
    const commonVars$1 = {
      buttonHeightSmall: "14px",
      buttonHeightMedium: "18px",
      buttonHeightLarge: "22px",
      buttonWidthSmall: "14px",
      buttonWidthMedium: "18px",
      buttonWidthLarge: "22px",
      buttonWidthPressedSmall: "20px",
      buttonWidthPressedMedium: "24px",
      buttonWidthPressedLarge: "28px",
      railHeightSmall: "18px",
      railHeightMedium: "22px",
      railHeightLarge: "26px",
      railWidthSmall: "32px",
      railWidthMedium: "40px",
      railWidthLarge: "48px"
    };
    const switchDark = {
      name: "Switch",
      common: derived$1,
      self(vars) {
        const {
          primaryColorSuppl,
          opacityDisabled,
          borderRadius,
          primaryColor,
          textColor2,
          baseColor
        } = vars;
        const railOverlayColor = "rgba(255, 255, 255, .20)";
        return Object.assign(Object.assign({}, commonVars$1), {
          iconColor: baseColor,
          textColor: textColor2,
          loadingColor: primaryColorSuppl,
          opacityDisabled,
          railColor: railOverlayColor,
          railColorActive: primaryColorSuppl,
          buttonBoxShadow: "0px 2px 4px 0 rgba(0, 0, 0, 0.4)",
          buttonColor: "#FFF",
          railBorderRadiusSmall: borderRadius,
          railBorderRadiusMedium: borderRadius,
          railBorderRadiusLarge: borderRadius,
          buttonBorderRadiusSmall: borderRadius,
          buttonBorderRadiusMedium: borderRadius,
          buttonBorderRadiusLarge: borderRadius,
          boxShadowFocus: `0 0 8px 0 ${changeColor(primaryColor, {
            alpha: 0.3
          })}`
        });
      }
    };
    function self$a(vars) {
      const {
        primaryColor,
        opacityDisabled,
        borderRadius,
        textColor3
      } = vars;
      const railOverlayColor = "rgba(0, 0, 0, .14)";
      return Object.assign(Object.assign({}, commonVars$1), {
        iconColor: textColor3,
        textColor: "white",
        loadingColor: primaryColor,
        opacityDisabled,
        railColor: railOverlayColor,
        railColorActive: primaryColor,
        buttonBoxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",
        buttonColor: "#FFF",
        railBorderRadiusSmall: borderRadius,
        railBorderRadiusMedium: borderRadius,
        railBorderRadiusLarge: borderRadius,
        buttonBorderRadiusSmall: borderRadius,
        buttonBorderRadiusMedium: borderRadius,
        buttonBorderRadiusLarge: borderRadius,
        boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, {
          alpha: 0.2
        })}`
      });
    }
    const switchLight = {
      name: "Switch",
      common: derived,
      self: self$a
    };
    const sizeVariables$2 = {
      thPaddingSmall: "6px",
      thPaddingMedium: "12px",
      thPaddingLarge: "12px",
      tdPaddingSmall: "6px",
      tdPaddingMedium: "12px",
      tdPaddingLarge: "12px"
    };
    function self$9(vars) {
      const {
        dividerColor,
        cardColor,
        modalColor,
        popoverColor,
        tableHeaderColor,
        tableColorStriped,
        textColor1,
        textColor2,
        borderRadius,
        fontWeightStrong,
        lineHeight: lineHeight2,
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge
      } = vars;
      return Object.assign(Object.assign({}, sizeVariables$2), {
        fontSizeSmall,
        fontSizeMedium,
        fontSizeLarge,
        lineHeight: lineHeight2,
        borderRadius,
        borderColor: composite(cardColor, dividerColor),
        borderColorModal: composite(modalColor, dividerColor),
        borderColorPopover: composite(popoverColor, dividerColor),
        tdColor: cardColor,
        tdColorModal: modalColor,
        tdColorPopover: popoverColor,
        tdColorStriped: composite(cardColor, tableColorStriped),
        tdColorStripedModal: composite(modalColor, tableColorStriped),
        tdColorStripedPopover: composite(popoverColor, tableColorStriped),
        thColor: composite(cardColor, tableHeaderColor),
        thColorModal: composite(modalColor, tableHeaderColor),
        thColorPopover: composite(popoverColor, tableHeaderColor),
        thTextColor: textColor1,
        tdTextColor: textColor2,
        thFontWeight: fontWeightStrong
      });
    }
    const tableDark = {
      name: "Table",
      common: derived$1,
      self: self$9
    };
    const sizeVariables$1 = {
      tabFontSizeSmall: "14px",
      tabFontSizeMedium: "14px",
      tabFontSizeLarge: "16px",
      tabGapSmallLine: "36px",
      tabGapMediumLine: "36px",
      tabGapLargeLine: "36px",
      tabGapSmallLineVertical: "8px",
      tabGapMediumLineVertical: "8px",
      tabGapLargeLineVertical: "8px",
      tabPaddingSmallLine: "6px 0",
      tabPaddingMediumLine: "10px 0",
      tabPaddingLargeLine: "14px 0",
      tabPaddingVerticalSmallLine: "6px 12px",
      tabPaddingVerticalMediumLine: "8px 16px",
      tabPaddingVerticalLargeLine: "10px 20px",
      tabGapSmallBar: "36px",
      tabGapMediumBar: "36px",
      tabGapLargeBar: "36px",
      tabGapSmallBarVertical: "8px",
      tabGapMediumBarVertical: "8px",
      tabGapLargeBarVertical: "8px",
      tabPaddingSmallBar: "4px 0",
      tabPaddingMediumBar: "6px 0",
      tabPaddingLargeBar: "10px 0",
      tabPaddingVerticalSmallBar: "6px 12px",
      tabPaddingVerticalMediumBar: "8px 16px",
      tabPaddingVerticalLargeBar: "10px 20px",
      tabGapSmallCard: "4px",
      tabGapMediumCard: "4px",
      tabGapLargeCard: "4px",
      tabGapSmallCardVertical: "4px",
      tabGapMediumCardVertical: "4px",
      tabGapLargeCardVertical: "4px",
      tabPaddingSmallCard: "8px 16px",
      tabPaddingMediumCard: "10px 20px",
      tabPaddingLargeCard: "12px 24px",
      tabPaddingSmallSegment: "4px 0",
      tabPaddingMediumSegment: "6px 0",
      tabPaddingLargeSegment: "8px 0",
      tabPaddingVerticalLargeSegment: "0 8px",
      tabPaddingVerticalSmallCard: "8px 12px",
      tabPaddingVerticalMediumCard: "10px 16px",
      tabPaddingVerticalLargeCard: "12px 20px",
      tabPaddingVerticalSmallSegment: "0 4px",
      tabPaddingVerticalMediumSegment: "0 6px",
      tabGapSmallSegment: "0",
      tabGapMediumSegment: "0",
      tabGapLargeSegment: "0",
      tabGapSmallSegmentVertical: "0",
      tabGapMediumSegmentVertical: "0",
      tabGapLargeSegmentVertical: "0",
      panePaddingSmall: "8px 0 0 0",
      panePaddingMedium: "12px 0 0 0",
      panePaddingLarge: "16px 0 0 0",
      closeSize: "18px",
      closeIconSize: "14px"
    };
    function self$8(vars) {
      const {
        textColor2,
        primaryColor,
        textColorDisabled,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeColorHover,
        closeColorPressed,
        tabColor,
        baseColor,
        dividerColor,
        fontWeight,
        textColor1,
        borderRadius,
        fontSize: fontSize2,
        fontWeightStrong
      } = vars;
      return Object.assign(Object.assign({}, sizeVariables$1), {
        colorSegment: tabColor,
        tabFontSizeCard: fontSize2,
        tabTextColorLine: textColor1,
        tabTextColorActiveLine: primaryColor,
        tabTextColorHoverLine: primaryColor,
        tabTextColorDisabledLine: textColorDisabled,
        tabTextColorSegment: textColor1,
        tabTextColorActiveSegment: textColor2,
        tabTextColorHoverSegment: textColor2,
        tabTextColorDisabledSegment: textColorDisabled,
        tabTextColorBar: textColor1,
        tabTextColorActiveBar: primaryColor,
        tabTextColorHoverBar: primaryColor,
        tabTextColorDisabledBar: textColorDisabled,
        tabTextColorCard: textColor1,
        tabTextColorHoverCard: textColor1,
        tabTextColorActiveCard: primaryColor,
        tabTextColorDisabledCard: textColorDisabled,
        barColor: primaryColor,
        closeIconColor,
        closeIconColorHover,
        closeIconColorPressed,
        closeColorHover,
        closeColorPressed,
        closeBorderRadius: borderRadius,
        tabColor,
        tabColorSegment: baseColor,
        tabBorderColor: dividerColor,
        tabFontWeightActive: fontWeight,
        tabFontWeight: fontWeight,
        tabBorderRadius: borderRadius,
        paneTextColor: textColor2,
        fontWeightStrong
      });
    }
    const tabsDark = {
      name: "Tabs",
      common: derived$1,
      self(vars) {
        const commonSelf = self$8(vars);
        const {
          inputColor
        } = vars;
        commonSelf.colorSegment = inputColor;
        commonSelf.tabColorSegment = inputColor;
        return commonSelf;
      }
    };
    function self$7(vars) {
      const {
        textColor1,
        textColor2,
        fontWeightStrong,
        fontSize: fontSize2
      } = vars;
      return {
        fontSize: fontSize2,
        titleTextColor: textColor1,
        textColor: textColor2,
        titleFontWeight: fontWeightStrong
      };
    }
    const thingDark = {
      name: "Thing",
      common: derived$1,
      self: self$7
    };
    const sizeVariables = {
      titleMarginMedium: "0 0 6px 0",
      titleMarginLarge: "-2px 0 6px 0",
      titleFontSizeMedium: "14px",
      titleFontSizeLarge: "16px",
      iconSizeMedium: "14px",
      iconSizeLarge: "14px"
    };
    const timelineDark = {
      name: "Timeline",
      common: derived$1,
      self(vars) {
        const {
          textColor3,
          infoColorSuppl,
          errorColorSuppl,
          successColorSuppl,
          warningColorSuppl,
          textColor1,
          textColor2,
          railColor,
          fontWeightStrong,
          fontSize: fontSize2
        } = vars;
        return Object.assign(Object.assign({}, sizeVariables), {
          contentFontSize: fontSize2,
          titleFontWeight: fontWeightStrong,
          circleBorder: `2px solid ${textColor3}`,
          circleBorderInfo: `2px solid ${infoColorSuppl}`,
          circleBorderError: `2px solid ${errorColorSuppl}`,
          circleBorderSuccess: `2px solid ${successColorSuppl}`,
          circleBorderWarning: `2px solid ${warningColorSuppl}`,
          iconColor: textColor3,
          iconColorInfo: infoColorSuppl,
          iconColorError: errorColorSuppl,
          iconColorSuccess: successColorSuppl,
          iconColorWarning: warningColorSuppl,
          titleTextColor: textColor1,
          contentTextColor: textColor2,
          metaTextColor: textColor3,
          lineColor: railColor
        });
      }
    };
    const commonVariables$1 = {
      extraFontSizeSmall: "12px",
      extraFontSizeMedium: "12px",
      extraFontSizeLarge: "14px",
      titleFontSizeSmall: "14px",
      titleFontSizeMedium: "16px",
      titleFontSizeLarge: "16px",
      closeSize: "20px",
      closeIconSize: "16px",
      headerHeightSmall: "44px",
      headerHeightMedium: "44px",
      headerHeightLarge: "50px"
    };
    const transferDark$1 = {
      name: "Transfer",
      common: derived$1,
      peers: {
        Checkbox: checkboxDark,
        Scrollbar: scrollbarDark,
        Input: inputDark,
        Empty: emptyDark,
        Button: buttonDark
      },
      self(vars) {
        const {
          fontWeight,
          fontSizeLarge,
          fontSizeMedium,
          fontSizeSmall,
          heightLarge,
          heightMedium,
          borderRadius,
          inputColor,
          tableHeaderColor,
          textColor1,
          textColorDisabled,
          textColor2,
          textColor3,
          hoverColor,
          closeColorHover,
          closeColorPressed,
          closeIconColor,
          closeIconColorHover,
          closeIconColorPressed,
          dividerColor
        } = vars;
        return Object.assign(Object.assign({}, commonVariables$1), {
          itemHeightSmall: heightMedium,
          itemHeightMedium: heightMedium,
          itemHeightLarge: heightLarge,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          borderRadius,
          dividerColor,
          borderColor: "#0000",
          listColor: inputColor,
          headerColor: tableHeaderColor,
          titleTextColor: textColor1,
          titleTextColorDisabled: textColorDisabled,
          extraTextColor: textColor3,
          extraTextColorDisabled: textColorDisabled,
          itemTextColor: textColor2,
          itemTextColorDisabled: textColorDisabled,
          itemColorPending: hoverColor,
          titleFontWeight: fontWeight,
          closeColorHover,
          closeColorPressed,
          closeIconColor,
          closeIconColorHover,
          closeIconColorPressed
        });
      }
    };
    function self$6(vars) {
      const {
        borderRadiusSmall,
        dividerColor,
        hoverColor,
        pressedColor,
        primaryColor,
        textColor3,
        textColor2,
        textColorDisabled,
        fontSize: fontSize2
      } = vars;
      return {
        fontSize: fontSize2,
        lineHeight: "1.5",
        nodeHeight: "30px",
        nodeWrapperPadding: "3px 0",
        nodeBorderRadius: borderRadiusSmall,
        nodeColorHover: hoverColor,
        nodeColorPressed: pressedColor,
        nodeColorActive: changeColor(primaryColor, {
          alpha: 0.1
        }),
        arrowColor: textColor3,
        nodeTextColor: textColor2,
        nodeTextColorDisabled: textColorDisabled,
        loadingColor: primaryColor,
        dropMarkColor: primaryColor,
        lineColor: dividerColor
      };
    }
    const treeDark = {
      name: "Tree",
      common: derived$1,
      peers: {
        Checkbox: checkboxDark,
        Scrollbar: scrollbarDark,
        Empty: emptyDark
      },
      self(vars) {
        const {
          primaryColor
        } = vars;
        const commonSelf = self$6(vars);
        commonSelf.nodeColorActive = changeColor(primaryColor, {
          alpha: 0.15
        });
        return commonSelf;
      }
    };
    const treeSelectDark = {
      name: "TreeSelect",
      common: derived$1,
      peers: {
        Tree: treeDark,
        Empty: emptyDark,
        InternalSelection: internalSelectionDark
      }
    };
    const commonVars = {
      headerFontSize1: "30px",
      headerFontSize2: "22px",
      headerFontSize3: "18px",
      headerFontSize4: "16px",
      headerFontSize5: "16px",
      headerFontSize6: "16px",
      headerMargin1: "28px 0 20px 0",
      headerMargin2: "28px 0 20px 0",
      headerMargin3: "28px 0 20px 0",
      headerMargin4: "28px 0 18px 0",
      headerMargin5: "28px 0 18px 0",
      headerMargin6: "28px 0 18px 0",
      headerPrefixWidth1: "16px",
      headerPrefixWidth2: "16px",
      headerPrefixWidth3: "12px",
      headerPrefixWidth4: "12px",
      headerPrefixWidth5: "12px",
      headerPrefixWidth6: "12px",
      headerBarWidth1: "4px",
      headerBarWidth2: "4px",
      headerBarWidth3: "3px",
      headerBarWidth4: "3px",
      headerBarWidth5: "3px",
      headerBarWidth6: "3px",
      pMargin: "16px 0 16px 0",
      liMargin: ".25em 0 0 0",
      olPadding: "0 0 0 2em",
      ulPadding: "0 0 0 2em"
    };
    function self$5(vars) {
      const {
        primaryColor,
        textColor2,
        borderColor,
        lineHeight: lineHeight2,
        fontSize: fontSize2,
        borderRadiusSmall,
        dividerColor,
        fontWeightStrong,
        textColor1,
        textColor3,
        infoColor,
        warningColor,
        errorColor,
        successColor,
        codeColor
      } = vars;
      return Object.assign(Object.assign({}, commonVars), {
        aTextColor: primaryColor,
        blockquoteTextColor: textColor2,
        blockquotePrefixColor: borderColor,
        blockquoteLineHeight: lineHeight2,
        blockquoteFontSize: fontSize2,
        codeBorderRadius: borderRadiusSmall,
        liTextColor: textColor2,
        liLineHeight: lineHeight2,
        liFontSize: fontSize2,
        hrColor: dividerColor,
        headerFontWeight: fontWeightStrong,
        headerTextColor: textColor1,
        pTextColor: textColor2,
        pTextColor1Depth: textColor1,
        pTextColor2Depth: textColor2,
        pTextColor3Depth: textColor3,
        pLineHeight: lineHeight2,
        pFontSize: fontSize2,
        headerBarColor: primaryColor,
        headerBarColorPrimary: primaryColor,
        headerBarColorInfo: infoColor,
        headerBarColorError: errorColor,
        headerBarColorWarning: warningColor,
        headerBarColorSuccess: successColor,
        textColor: textColor2,
        textColor1Depth: textColor1,
        textColor2Depth: textColor2,
        textColor3Depth: textColor3,
        textColorPrimary: primaryColor,
        textColorInfo: infoColor,
        textColorSuccess: successColor,
        textColorWarning: warningColor,
        textColorError: errorColor,
        codeTextColor: textColor2,
        codeColor,
        codeBorder: "1px solid #0000"
      });
    }
    const typographyLight = {
      name: "Typography",
      common: derived,
      self: self$5
    };
    const typographyDark = {
      name: "Typography",
      common: derived$1,
      self: self$5
    };
    function self$4(vars) {
      const {
        iconColor,
        primaryColor,
        errorColor,
        textColor2,
        successColor,
        opacityDisabled,
        actionColor,
        borderColor,
        hoverColor,
        lineHeight: lineHeight2,
        borderRadius,
        fontSize: fontSize2
      } = vars;
      return {
        fontSize: fontSize2,
        lineHeight: lineHeight2,
        borderRadius,
        draggerColor: actionColor,
        draggerBorder: `1px dashed ${borderColor}`,
        draggerBorderHover: `1px dashed ${primaryColor}`,
        itemColorHover: hoverColor,
        itemColorHoverError: changeColor(errorColor, {
          alpha: 0.06
        }),
        itemTextColor: textColor2,
        itemTextColorError: errorColor,
        itemTextColorSuccess: successColor,
        itemIconColor: iconColor,
        itemDisabledOpacity: opacityDisabled,
        itemBorderImageCardError: `1px solid ${errorColor}`,
        itemBorderImageCard: `1px solid ${borderColor}`
      };
    }
    const uploadLight = createTheme({
      name: "Upload",
      common: derived,
      peers: {
        Button: buttonLight,
        Progress: progressLight
      },
      self: self$4
    });
    const uploadDark = {
      name: "Upload",
      common: derived$1,
      peers: {
        Button: buttonDark,
        Progress: progressDark
      },
      self(vars) {
        const {
          errorColor
        } = vars;
        const commonSelf = self$4(vars);
        commonSelf.itemColorHoverError = changeColor(errorColor, {
          alpha: 0.09
        });
        return commonSelf;
      }
    };
    const watermarkDark = {
      name: "Watermark",
      common: derived$1,
      self(vars) {
        const {
          fontFamily: fontFamily2
        } = vars;
        return {
          fontFamily: fontFamily2
        };
      }
    };
    const rowDark = {
      name: "Row",
      common: derived$1
    };
    const floatButtonDark = {
      name: "FloatButton",
      common: derived$1,
      self(vars) {
        const {
          popoverColor,
          textColor2,
          buttonColor2Hover,
          buttonColor2Pressed,
          primaryColor,
          primaryColorHover,
          primaryColorPressed,
          baseColor,
          borderRadius
        } = vars;
        return {
          color: popoverColor,
          textColor: textColor2,
          boxShadow: "0 2px 8px 0px rgba(0, 0, 0, .12)",
          boxShadowHover: "0 2px 12px 0px rgba(0, 0, 0, .18)",
          boxShadowPressed: "0 2px 12px 0px rgba(0, 0, 0, .18)",
          colorHover: buttonColor2Hover,
          colorPressed: buttonColor2Pressed,
          colorPrimary: primaryColor,
          colorPrimaryHover: primaryColorHover,
          colorPrimaryPressed: primaryColorPressed,
          textColorPrimary: baseColor,
          borderRadiusSquare: borderRadius
        };
      }
    };
    const NGlobalStyle = /* @__PURE__ */ defineComponent({
      name: "GlobalStyle",
      setup() {
        if (typeof document === "undefined") return;
        const NConfigProvider2 = inject(configProviderInjectionKey, null);
        const {
          body
        } = document;
        const {
          style: style2
        } = body;
        let styleApplied = false;
        let firstApply = true;
        onBeforeMount(() => {
          watchEffect(() => {
            var _a, _b;
            const {
              textColor2,
              fontSize: fontSize2,
              fontFamily: fontFamily2,
              bodyColor,
              cubicBezierEaseInOut: cubicBezierEaseInOut2,
              lineHeight: lineHeight2
            } = NConfigProvider2 ? merge$1({}, ((_a = NConfigProvider2.mergedThemeRef.value) === null || _a === void 0 ? void 0 : _a.common) || derived, (_b = NConfigProvider2.mergedThemeOverridesRef.value) === null || _b === void 0 ? void 0 : _b.common) : derived;
            if (styleApplied || !body.hasAttribute("n-styled")) {
              style2.setProperty("-webkit-text-size-adjust", "100%");
              style2.setProperty("-webkit-tap-highlight-color", "transparent");
              style2.padding = "0";
              style2.margin = "0";
              style2.backgroundColor = bodyColor;
              style2.color = textColor2;
              style2.fontSize = fontSize2;
              style2.fontFamily = fontFamily2;
              style2.lineHeight = lineHeight2;
              const transition = `color .3s ${cubicBezierEaseInOut2}, background-color .3s ${cubicBezierEaseInOut2}`;
              if (firstApply) {
                setTimeout(() => {
                  style2.transition = transition;
                }, 0);
              } else {
                style2.transition = transition;
              }
              body.setAttribute("n-styled", "");
              styleApplied = true;
              firstApply = false;
            }
          });
        });
        onUnmounted(() => {
          if (styleApplied) {
            body.removeAttribute("n-styled");
          }
        });
      },
      render() {
        return null;
      }
    });
    function self$3(vars) {
      const {
        primaryColor,
        baseColor
      } = vars;
      return {
        color: primaryColor,
        iconColor: baseColor
      };
    }
    const iconDark = {
      name: "IconWrapper",
      common: derived$1,
      self: self$3
    };
    const imagePreviewSharedProps = Object.assign(Object.assign({}, useTheme.props), {
      onPreviewPrev: Function,
      onPreviewNext: Function,
      showToolbar: {
        type: Boolean,
        default: true
      },
      showToolbarTooltip: Boolean,
      renderToolbar: Function
    });
    const imageContextKey = createInjectionKey("n-image");
    function self$2() {
      return {
        toolbarIconColor: "rgba(255, 255, 255, .9)",
        toolbarColor: "rgba(0, 0, 0, .35)",
        toolbarBoxShadow: "none",
        toolbarBorderRadius: "24px"
      };
    }
    const imageLight = createTheme({
      name: "Image",
      common: derived,
      peers: {
        Tooltip: tooltipLight
      },
      self: self$2
    });
    const imageDark = {
      name: "Image",
      common: derived$1,
      peers: {
        Tooltip: tooltipDark
      },
      self: (vars) => {
        const {
          textColor2
        } = vars;
        return {
          toolbarIconColor: textColor2,
          toolbarColor: "rgba(0, 0, 0, .35)",
          toolbarBoxShadow: "none",
          toolbarBorderRadius: "24px"
        };
      }
    };
    const prevIcon = h("svg", {
      viewBox: "0 0 20 20",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("path", {
      d: "M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z",
      fill: "currentColor"
    }));
    const nextIcon = h("svg", {
      viewBox: "0 0 20 20",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("path", {
      d: "M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z",
      fill: "currentColor"
    }));
    const closeIcon = h("svg", {
      viewBox: "0 0 20 20",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, h("path", {
      d: "M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z",
      fill: "currentColor"
    }));
    const style$7 = c$1([c$1("body >", [cB("image-container", "position: fixed;")]), cB("image-preview-container", `
 position: fixed;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 display: flex;
 `), cB("image-preview-overlay", `
 z-index: -1;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 background: rgba(0, 0, 0, .3);
 `, [fadeInTransition()]), cB("image-preview-toolbar", `
 z-index: 1;
 position: absolute;
 left: 50%;
 transform: translateX(-50%);
 border-radius: var(--n-toolbar-border-radius);
 height: 48px;
 bottom: 40px;
 padding: 0 12px;
 background: var(--n-toolbar-color);
 box-shadow: var(--n-toolbar-box-shadow);
 color: var(--n-toolbar-icon-color);
 transition: color .3s var(--n-bezier);
 display: flex;
 align-items: center;
 `, [cB("base-icon", `
 padding: 0 8px;
 font-size: 28px;
 cursor: pointer;
 `), fadeInTransition()]), cB("image-preview-wrapper", `
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 display: flex;
 pointer-events: none;
 `, [fadeInScaleUpTransition()]), cB("image-preview", `
 user-select: none;
 -webkit-user-select: none;
 pointer-events: all;
 margin: auto;
 max-height: calc(100vh - 32px);
 max-width: calc(100vw - 32px);
 transition: transform .3s var(--n-bezier);
 `), cB("image", `
 display: inline-flex;
 max-height: 100%;
 max-width: 100%;
 `, [cNotM("preview-disabled", `
 cursor: pointer;
 `), c$1("img", `
 border-radius: inherit;
 `)])]);
    const BLEEDING = 32;
    const NImagePreview = /* @__PURE__ */ defineComponent({
      name: "ImagePreview",
      props: Object.assign(Object.assign({}, imagePreviewSharedProps), {
        onNext: Function,
        onPrev: Function,
        clsPrefix: {
          type: String,
          required: true
        }
      }),
      setup(props) {
        const themeRef = useTheme("Image", "-image", style$7, imageLight, props, toRef(props, "clsPrefix"));
        let thumbnailEl = null;
        const previewRef = ref(null);
        const previewWrapperRef = ref(null);
        const previewSrcRef = ref(void 0);
        const showRef = ref(false);
        const displayedRef = ref(false);
        const {
          localeRef
        } = useLocale("Image");
        function syncTransformOrigin() {
          const {
            value: previewWrapper
          } = previewWrapperRef;
          if (!thumbnailEl || !previewWrapper) return;
          const {
            style: style2
          } = previewWrapper;
          const tbox = thumbnailEl.getBoundingClientRect();
          const tx = tbox.left + tbox.width / 2;
          const ty = tbox.top + tbox.height / 2;
          style2.transformOrigin = `${tx}px ${ty}px`;
        }
        function handleKeydown(e) {
          var _a, _b;
          switch (e.key) {
            case " ":
              e.preventDefault();
              break;
            case "ArrowLeft":
              (_a = props.onPrev) === null || _a === void 0 ? void 0 : _a.call(props);
              break;
            case "ArrowRight":
              (_b = props.onNext) === null || _b === void 0 ? void 0 : _b.call(props);
              break;
            case "Escape":
              toggleShow();
              break;
          }
        }
        watch(showRef, (value) => {
          if (value) {
            on("keydown", document, handleKeydown);
          } else {
            off("keydown", document, handleKeydown);
          }
        });
        onBeforeUnmount(() => {
          off("keydown", document, handleKeydown);
        });
        let startX = 0;
        let startY = 0;
        let offsetX = 0;
        let offsetY = 0;
        let startOffsetX = 0;
        let startOffsetY = 0;
        let mouseDownClientX = 0;
        let mouseDownClientY = 0;
        let dragging = false;
        function handleMouseMove(e) {
          const {
            clientX,
            clientY
          } = e;
          offsetX = clientX - startX;
          offsetY = clientY - startY;
          beforeNextFrameOnce(derivePreviewStyle);
        }
        function getMoveStrategy(opts) {
          const {
            mouseUpClientX,
            mouseUpClientY,
            mouseDownClientX: mouseDownClientX2,
            mouseDownClientY: mouseDownClientY2
          } = opts;
          const deltaHorizontal = mouseDownClientX2 - mouseUpClientX;
          const deltaVertical = mouseDownClientY2 - mouseUpClientY;
          const moveVerticalDirection = `vertical${deltaVertical > 0 ? "Top" : "Bottom"}`;
          const moveHorizontalDirection = `horizontal${deltaHorizontal > 0 ? "Left" : "Right"}`;
          return {
            moveVerticalDirection,
            moveHorizontalDirection,
            deltaHorizontal,
            deltaVertical
          };
        }
        function getDerivedOffset(moveStrategy) {
          const {
            value: preview
          } = previewRef;
          if (!preview) return {
            offsetX: 0,
            offsetY: 0
          };
          const pbox = preview.getBoundingClientRect();
          const {
            moveVerticalDirection,
            moveHorizontalDirection,
            deltaHorizontal,
            deltaVertical
          } = moveStrategy || {};
          let nextOffsetX = 0;
          let nextOffsetY = 0;
          if (pbox.width <= window.innerWidth) {
            nextOffsetX = 0;
          } else if (pbox.left > 0) {
            nextOffsetX = (pbox.width - window.innerWidth) / 2;
          } else if (pbox.right < window.innerWidth) {
            nextOffsetX = -(pbox.width - window.innerWidth) / 2;
          } else if (moveHorizontalDirection === "horizontalRight") {
            nextOffsetX = Math.min((pbox.width - window.innerWidth) / 2, startOffsetX - (deltaHorizontal !== null && deltaHorizontal !== void 0 ? deltaHorizontal : 0));
          } else {
            nextOffsetX = Math.max(-((pbox.width - window.innerWidth) / 2), startOffsetX - (deltaHorizontal !== null && deltaHorizontal !== void 0 ? deltaHorizontal : 0));
          }
          if (pbox.height <= window.innerHeight) {
            nextOffsetY = 0;
          } else if (pbox.top > 0) {
            nextOffsetY = (pbox.height - window.innerHeight) / 2;
          } else if (pbox.bottom < window.innerHeight) {
            nextOffsetY = -(pbox.height - window.innerHeight) / 2;
          } else if (moveVerticalDirection === "verticalBottom") {
            nextOffsetY = Math.min((pbox.height - window.innerHeight) / 2, startOffsetY - (deltaVertical !== null && deltaVertical !== void 0 ? deltaVertical : 0));
          } else {
            nextOffsetY = Math.max(-((pbox.height - window.innerHeight) / 2), startOffsetY - (deltaVertical !== null && deltaVertical !== void 0 ? deltaVertical : 0));
          }
          return {
            offsetX: nextOffsetX,
            offsetY: nextOffsetY
          };
        }
        function handleMouseUp(e) {
          off("mousemove", document, handleMouseMove);
          off("mouseup", document, handleMouseUp);
          const {
            clientX: mouseUpClientX,
            clientY: mouseUpClientY
          } = e;
          dragging = false;
          const moveStrategy = getMoveStrategy({
            mouseUpClientX,
            mouseUpClientY,
            mouseDownClientX,
            mouseDownClientY
          });
          const offset = getDerivedOffset(moveStrategy);
          offsetX = offset.offsetX;
          offsetY = offset.offsetY;
          derivePreviewStyle();
        }
        const imageContext = inject(imageContextKey, null);
        function handlePreviewMousedown(e) {
          var _a, _b;
          (_b = (_a = imageContext === null || imageContext === void 0 ? void 0 : imageContext.previewedImgPropsRef.value) === null || _a === void 0 ? void 0 : _a.onMousedown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
          if (e.button !== 0) return;
          const {
            clientX,
            clientY
          } = e;
          dragging = true;
          startX = clientX - offsetX;
          startY = clientY - offsetY;
          startOffsetX = offsetX;
          startOffsetY = offsetY;
          mouseDownClientX = clientX;
          mouseDownClientY = clientY;
          derivePreviewStyle();
          on("mousemove", document, handleMouseMove);
          on("mouseup", document, handleMouseUp);
        }
        const scaleRadix = 1.5;
        let scaleExp = 0;
        let scale = 1;
        let rotate = 0;
        function handlePreviewDblclick(e) {
          var _a, _b;
          (_b = (_a = imageContext === null || imageContext === void 0 ? void 0 : imageContext.previewedImgPropsRef.value) === null || _a === void 0 ? void 0 : _a.onDblclick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
          const originalImageSizeScale = getOrignalImageSizeScale();
          scale = scale === originalImageSizeScale ? 1 : originalImageSizeScale;
          derivePreviewStyle();
        }
        function resetScale() {
          scale = 1;
          scaleExp = 0;
        }
        function handleSwitchPrev() {
          var _a;
          resetScale();
          rotate = 0;
          (_a = props.onPrev) === null || _a === void 0 ? void 0 : _a.call(props);
        }
        function handleSwitchNext() {
          var _a;
          resetScale();
          rotate = 0;
          (_a = props.onNext) === null || _a === void 0 ? void 0 : _a.call(props);
        }
        function rotateCounterclockwise() {
          rotate -= 90;
          derivePreviewStyle();
        }
        function rotateClockwise() {
          rotate += 90;
          derivePreviewStyle();
        }
        function getMaxScale() {
          const {
            value: preview
          } = previewRef;
          if (!preview) return 1;
          const {
            innerWidth,
            innerHeight
          } = window;
          const heightMaxScale = Math.max(1, preview.naturalHeight / (innerHeight - BLEEDING));
          const widthMaxScale = Math.max(1, preview.naturalWidth / (innerWidth - BLEEDING));
          return Math.max(3, heightMaxScale * 2, widthMaxScale * 2);
        }
        function getOrignalImageSizeScale() {
          const {
            value: preview
          } = previewRef;
          if (!preview) return 1;
          const {
            innerWidth,
            innerHeight
          } = window;
          const heightScale = preview.naturalHeight / (innerHeight - BLEEDING);
          const widthScale = preview.naturalWidth / (innerWidth - BLEEDING);
          if (heightScale < 1 && widthScale < 1) {
            return 1;
          }
          return Math.max(heightScale, widthScale);
        }
        function zoomIn() {
          const maxScale = getMaxScale();
          if (scale < maxScale) {
            scaleExp += 1;
            scale = Math.min(maxScale, Math.pow(scaleRadix, scaleExp));
            derivePreviewStyle();
          }
        }
        function zoomOut() {
          if (scale > 0.5) {
            const originalScale = scale;
            scaleExp -= 1;
            scale = Math.max(0.5, Math.pow(scaleRadix, scaleExp));
            const diff = originalScale - scale;
            derivePreviewStyle(false);
            const offset = getDerivedOffset();
            scale += diff;
            derivePreviewStyle(false);
            scale -= diff;
            offsetX = offset.offsetX;
            offsetY = offset.offsetY;
            derivePreviewStyle();
          }
        }
        function handleDownloadClick() {
          const src = previewSrcRef.value;
          if (src) {
            download(src, void 0);
          }
        }
        function derivePreviewStyle(transition = true) {
          var _a;
          const {
            value: preview
          } = previewRef;
          if (!preview) return;
          const {
            style: style2
          } = preview;
          const controlledStyle = normalizeStyle((_a = imageContext === null || imageContext === void 0 ? void 0 : imageContext.previewedImgPropsRef.value) === null || _a === void 0 ? void 0 : _a.style);
          let controlledStyleString = "";
          if (typeof controlledStyle === "string") {
            controlledStyleString = `${controlledStyle};`;
          } else {
            for (const key in controlledStyle) {
              controlledStyleString += `${kebabCase(key)}: ${controlledStyle[key]};`;
            }
          }
          const transformStyle = `transform-origin: center; transform: translateX(${offsetX}px) translateY(${offsetY}px) rotate(${rotate}deg) scale(${scale});`;
          if (dragging) {
            style2.cssText = `${controlledStyleString}cursor: grabbing; transition: none;${transformStyle}`;
          } else {
            style2.cssText = `${controlledStyleString}cursor: grab;${transformStyle}${transition ? "" : "transition: none;"}`;
          }
          if (!transition) {
            void preview.offsetHeight;
          }
        }
        function toggleShow() {
          showRef.value = !showRef.value;
          displayedRef.value = true;
        }
        function resizeToOrignalImageSize() {
          scale = getOrignalImageSizeScale();
          scaleExp = Math.ceil(Math.log(scale) / Math.log(scaleRadix));
          offsetX = 0;
          offsetY = 0;
          derivePreviewStyle();
        }
        const exposedMethods = {
          setPreviewSrc: (src) => {
            previewSrcRef.value = src;
          },
          setThumbnailEl: (el) => {
            thumbnailEl = el;
          },
          toggleShow
        };
        function withTooltip(node, tooltipKey) {
          if (props.showToolbarTooltip) {
            const {
              value: theme
            } = themeRef;
            return h(NTooltip, {
              to: false,
              theme: theme.peers.Tooltip,
              themeOverrides: theme.peerOverrides.Tooltip,
              keepAliveOnHover: false
            }, {
              default: () => {
                return localeRef.value[tooltipKey];
              },
              trigger: () => node
            });
          } else {
            return node;
          }
        }
        const cssVarsRef = computed(() => {
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              toolbarIconColor,
              toolbarBorderRadius,
              toolbarBoxShadow,
              toolbarColor
            }
          } = themeRef.value;
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-toolbar-icon-color": toolbarIconColor,
            "--n-toolbar-color": toolbarColor,
            "--n-toolbar-border-radius": toolbarBorderRadius,
            "--n-toolbar-box-shadow": toolbarBoxShadow
          };
        });
        const {
          inlineThemeDisabled
        } = useConfig();
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("image-preview", void 0, cssVarsRef, props) : void 0;
        return Object.assign({
          previewRef,
          previewWrapperRef,
          previewSrc: previewSrcRef,
          show: showRef,
          appear: isMounted(),
          displayed: displayedRef,
          previewedImgProps: imageContext === null || imageContext === void 0 ? void 0 : imageContext.previewedImgPropsRef,
          handleWheel(e) {
            e.preventDefault();
          },
          handlePreviewMousedown,
          handlePreviewDblclick,
          syncTransformOrigin,
          handleAfterLeave: () => {
            resetScale();
            rotate = 0;
            displayedRef.value = false;
          },
          handleDragStart: (e) => {
            var _a, _b;
            (_b = (_a = imageContext === null || imageContext === void 0 ? void 0 : imageContext.previewedImgPropsRef.value) === null || _a === void 0 ? void 0 : _a.onDragstart) === null || _b === void 0 ? void 0 : _b.call(_a, e);
            e.preventDefault();
          },
          zoomIn,
          zoomOut,
          handleDownloadClick,
          rotateCounterclockwise,
          rotateClockwise,
          handleSwitchPrev,
          handleSwitchNext,
          withTooltip,
          resizeToOrignalImageSize,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        }, exposedMethods);
      },
      render() {
        var _a, _b;
        const {
          clsPrefix,
          renderToolbar,
          withTooltip
        } = this;
        const prevNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.handleSwitchPrev
        }, {
          default: () => prevIcon
        }), "tipPrevious");
        const nextNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.handleSwitchNext
        }, {
          default: () => nextIcon
        }), "tipNext");
        const rotateCounterclockwiseNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.rotateCounterclockwise
        }, {
          default: () => h(RotateCounterclockwiseIcon, null)
        }), "tipCounterclockwise");
        const rotateClockwiseNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.rotateClockwise
        }, {
          default: () => h(RotateClockwiseIcon, null)
        }), "tipClockwise");
        const originalSizeNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.resizeToOrignalImageSize
        }, {
          default: () => {
            return h(ResizeSmallIcon, null);
          }
        }), "tipOriginalSize");
        const zoomOutNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.zoomOut
        }, {
          default: () => h(ZoomOutIcon, null)
        }), "tipZoomOut");
        const downloadNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.handleDownloadClick
        }, {
          default: () => h(DownloadIcon, null)
        }), "tipDownload");
        const closeNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.toggleShow
        }, {
          default: () => closeIcon
        }), "tipClose");
        const zoomInNode = withTooltip(h(NBaseIcon, {
          clsPrefix,
          onClick: this.zoomIn
        }, {
          default: () => h(ZoomInIcon, null)
        }), "tipZoomIn");
        return h(Fragment, null, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a), h(LazyTeleport, {
          show: this.show
        }, {
          default: () => {
            var _a2;
            if (!(this.show || this.displayed)) {
              return null;
            }
            (_a2 = this.onRender) === null || _a2 === void 0 ? void 0 : _a2.call(this);
            return withDirectives(h("div", {
              class: [`${clsPrefix}-image-preview-container`, this.themeClass],
              style: this.cssVars,
              onWheel: this.handleWheel
            }, h(Transition, {
              name: "fade-in-transition",
              appear: this.appear
            }, {
              default: () => this.show ? h("div", {
                class: `${clsPrefix}-image-preview-overlay`,
                onClick: this.toggleShow
              }) : null
            }), this.showToolbar ? h(Transition, {
              name: "fade-in-transition",
              appear: this.appear
            }, {
              default: () => {
                if (!this.show) return null;
                return h("div", {
                  class: `${clsPrefix}-image-preview-toolbar`
                }, renderToolbar ? renderToolbar({
                  nodes: {
                    prev: prevNode,
                    next: nextNode,
                    rotateCounterclockwise: rotateCounterclockwiseNode,
                    rotateClockwise: rotateClockwiseNode,
                    resizeToOriginalSize: originalSizeNode,
                    zoomOut: zoomOutNode,
                    zoomIn: zoomInNode,
                    download: downloadNode,
                    close: closeNode
                  }
                }) : h(Fragment, null, this.onPrev ? h(Fragment, null, prevNode, nextNode) : null, rotateCounterclockwiseNode, rotateClockwiseNode, originalSizeNode, zoomOutNode, zoomInNode, downloadNode, closeNode));
              }
            }) : null, h(Transition, {
              name: "fade-in-scale-up-transition",
              onAfterLeave: this.handleAfterLeave,
              appear: this.appear,
              // BUG:
              // onEnter will be called twice, I don't know why
              // Maybe it is a bug of vue
              onEnter: this.syncTransformOrigin,
              onBeforeLeave: this.syncTransformOrigin
            }, {
              default: () => {
                const {
                  previewedImgProps = {}
                } = this;
                return withDirectives(h("div", {
                  class: `${clsPrefix}-image-preview-wrapper`,
                  ref: "previewWrapperRef"
                }, h("img", Object.assign({}, previewedImgProps, {
                  draggable: false,
                  onMousedown: this.handlePreviewMousedown,
                  onDblclick: this.handlePreviewDblclick,
                  class: [`${clsPrefix}-image-preview`, previewedImgProps.class],
                  key: this.previewSrc,
                  src: this.previewSrc,
                  ref: "previewRef",
                  onDragstart: this.handleDragStart
                }))), [[vShow, this.show]]);
              }
            })), [[zindexable, {
              enabled: this.show
            }]]);
          }
        }));
      }
    });
    const imageGroupInjectionKey = createInjectionKey("n-image-group");
    const imageGroupProps = imagePreviewSharedProps;
    const NImageGroup = /* @__PURE__ */ defineComponent({
      name: "ImageGroup",
      props: imageGroupProps,
      setup(props) {
        let currentSrc;
        const {
          mergedClsPrefixRef
        } = useConfig(props);
        const groupId = `c${createId()}`;
        const vm = getCurrentInstance();
        const previewInstRef = ref(null);
        const setPreviewSrc = (src) => {
          var _a;
          currentSrc = src;
          (_a = previewInstRef.value) === null || _a === void 0 ? void 0 : _a.setPreviewSrc(src);
        };
        function go(step) {
          var _a, _b;
          if (!(vm === null || vm === void 0 ? void 0 : vm.proxy)) return;
          const container = vm.proxy.$el.parentElement;
          const imgs = container.querySelectorAll(`[data-group-id=${groupId}]:not([data-error=true])`);
          if (!imgs.length) return;
          const index = Array.from(imgs).findIndex((img) => img.dataset.previewSrc === currentSrc);
          if (~index) {
            setPreviewSrc(imgs[(index + step + imgs.length) % imgs.length].dataset.previewSrc);
          } else {
            setPreviewSrc(imgs[0].dataset.previewSrc);
          }
          if (step === 1) {
            (_a = props.onPreviewNext) === null || _a === void 0 ? void 0 : _a.call(props);
          } else {
            (_b = props.onPreviewPrev) === null || _b === void 0 ? void 0 : _b.call(props);
          }
        }
        provide(imageGroupInjectionKey, {
          mergedClsPrefixRef,
          setPreviewSrc,
          setThumbnailEl: (el) => {
            var _a;
            (_a = previewInstRef.value) === null || _a === void 0 ? void 0 : _a.setThumbnailEl(el);
          },
          toggleShow: () => {
            var _a;
            (_a = previewInstRef.value) === null || _a === void 0 ? void 0 : _a.toggleShow();
          },
          groupId,
          renderToolbarRef: toRef(props, "renderToolbar")
        });
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          previewInstRef,
          next: () => {
            go(1);
          },
          prev: () => {
            go(-1);
          }
        };
      },
      render() {
        return h(NImagePreview, {
          theme: this.theme,
          themeOverrides: this.themeOverrides,
          clsPrefix: this.mergedClsPrefix,
          ref: "previewInstRef",
          onPrev: this.prev,
          onNext: this.next,
          showToolbar: this.showToolbar,
          showToolbarTooltip: this.showToolbarTooltip,
          renderToolbar: this.renderToolbar
        }, this.$slots);
      }
    });
    const imageProps = Object.assign({
      alt: String,
      height: [String, Number],
      imgProps: Object,
      previewedImgProps: Object,
      lazy: Boolean,
      intersectionObserverOptions: Object,
      objectFit: {
        type: String,
        default: "fill"
      },
      previewSrc: String,
      fallbackSrc: String,
      width: [String, Number],
      src: String,
      previewDisabled: Boolean,
      loadDescription: String,
      onError: Function,
      onLoad: Function
    }, imagePreviewSharedProps);
    const NImage = /* @__PURE__ */ defineComponent({
      name: "Image",
      props: imageProps,
      inheritAttrs: false,
      setup(props) {
        const imageRef = ref(null);
        const showErrorRef = ref(false);
        const previewInstRef = ref(null);
        const imageGroupHandle = inject(imageGroupInjectionKey, null);
        const {
          mergedClsPrefixRef
        } = imageGroupHandle || useConfig(props);
        const exposedMethods = {
          click: () => {
            if (props.previewDisabled || showErrorRef.value) return;
            const mergedPreviewSrc = props.previewSrc || props.src;
            if (imageGroupHandle) {
              imageGroupHandle.setPreviewSrc(mergedPreviewSrc);
              imageGroupHandle.setThumbnailEl(imageRef.value);
              imageGroupHandle.toggleShow();
              return;
            }
            const {
              value: previewInst
            } = previewInstRef;
            if (!previewInst) return;
            previewInst.setPreviewSrc(mergedPreviewSrc);
            previewInst.setThumbnailEl(imageRef.value);
            previewInst.toggleShow();
          }
        };
        const shouldStartLoadingRef = ref(!props.lazy);
        onMounted(() => {
          var _a;
          (_a = imageRef.value) === null || _a === void 0 ? void 0 : _a.setAttribute("data-group-id", (imageGroupHandle === null || imageGroupHandle === void 0 ? void 0 : imageGroupHandle.groupId) || "");
        });
        onMounted(() => {
          if (props.lazy && props.intersectionObserverOptions) {
            let unobserve;
            const stopWatchHandle = watchEffect(() => {
              unobserve === null || unobserve === void 0 ? void 0 : unobserve();
              unobserve = void 0;
              unobserve = observeIntersection(imageRef.value, props.intersectionObserverOptions, shouldStartLoadingRef);
            });
            onBeforeUnmount(() => {
              stopWatchHandle();
              unobserve === null || unobserve === void 0 ? void 0 : unobserve();
            });
          }
        });
        watchEffect(() => {
          var _a;
          void (props.src || ((_a = props.imgProps) === null || _a === void 0 ? void 0 : _a.src));
          showErrorRef.value = false;
        });
        const loadedRef = ref(false);
        provide(imageContextKey, {
          previewedImgPropsRef: toRef(props, "previewedImgProps")
        });
        return Object.assign({
          mergedClsPrefix: mergedClsPrefixRef,
          groupId: imageGroupHandle === null || imageGroupHandle === void 0 ? void 0 : imageGroupHandle.groupId,
          previewInstRef,
          imageRef,
          showError: showErrorRef,
          shouldStartLoading: shouldStartLoadingRef,
          loaded: loadedRef,
          mergedOnClick: (e) => {
            var _a, _b;
            exposedMethods.click();
            (_b = (_a = props.imgProps) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
          },
          mergedOnError: (e) => {
            if (!shouldStartLoadingRef.value) return;
            showErrorRef.value = true;
            const {
              onError,
              imgProps: {
                onError: imgPropsOnError
              } = {}
            } = props;
            onError === null || onError === void 0 ? void 0 : onError(e);
            imgPropsOnError === null || imgPropsOnError === void 0 ? void 0 : imgPropsOnError(e);
          },
          mergedOnLoad: (e) => {
            const {
              onLoad,
              imgProps: {
                onLoad: imgPropsOnLoad
              } = {}
            } = props;
            onLoad === null || onLoad === void 0 ? void 0 : onLoad(e);
            imgPropsOnLoad === null || imgPropsOnLoad === void 0 ? void 0 : imgPropsOnLoad(e);
            loadedRef.value = true;
          }
        }, exposedMethods);
      },
      render() {
        var _a, _b;
        const {
          mergedClsPrefix,
          imgProps = {},
          loaded,
          $attrs,
          lazy
        } = this;
        const placeholderNode = (_b = (_a = this.$slots).placeholder) === null || _b === void 0 ? void 0 : _b.call(_a);
        const loadSrc = this.src || imgProps.src;
        const imgNode = h("img", Object.assign(Object.assign({}, imgProps), {
          ref: "imageRef",
          width: this.width || imgProps.width,
          height: this.height || imgProps.height,
          src: this.showError ? this.fallbackSrc : lazy && this.intersectionObserverOptions ? this.shouldStartLoading ? loadSrc : void 0 : loadSrc,
          alt: this.alt || imgProps.alt,
          "aria-label": this.alt || imgProps.alt,
          onClick: this.mergedOnClick,
          onError: this.mergedOnError,
          onLoad: this.mergedOnLoad,
          // If interseciton observer options is set, do not use native lazy
          loading: isImageSupportNativeLazy && lazy && !this.intersectionObserverOptions ? "lazy" : "eager",
          style: [imgProps.style || "", placeholderNode && !loaded ? {
            height: "0",
            width: "0",
            visibility: "hidden"
          } : "", {
            objectFit: this.objectFit
          }],
          "data-error": this.showError,
          "data-preview-src": this.previewSrc || this.src
        }));
        return h("div", Object.assign({}, $attrs, {
          role: "none",
          class: [$attrs.class, `${mergedClsPrefix}-image`, (this.previewDisabled || this.showError) && `${mergedClsPrefix}-image--preview-disabled`]
        }), this.groupId ? imgNode : h(NImagePreview, {
          theme: this.theme,
          themeOverrides: this.themeOverrides,
          clsPrefix: mergedClsPrefix,
          ref: "previewInstRef",
          showToolbar: this.showToolbar,
          showToolbarTooltip: this.showToolbarTooltip,
          renderToolbar: this.renderToolbar
        }, {
          default: () => imgNode,
          toolbar: () => {
            var _a2, _b2;
            return (_b2 = (_a2 = this.$slots).toolbar) === null || _b2 === void 0 ? void 0 : _b2.call(_a2);
          }
        }), !loaded && placeholderNode);
      }
    });
    function parse$1(value) {
      if (value === void 0 || value === null || typeof value === "string" && value.trim() === "") {
        return null;
      }
      return Number(value);
    }
    function isWipValue(value) {
      return value.includes(".") && (/^(-)?\d+.*(\.|0)$/.test(value) || /^\.\d+$/.test(value));
    }
    function validator(value) {
      if (value === void 0 || value === null) return true;
      if (Number.isNaN(value)) return false;
      return true;
    }
    function format$2(value, precision) {
      if (typeof value !== "number") return "";
      return precision === void 0 ? String(value) : value.toFixed(precision);
    }
    function parseNumber(number2) {
      if (number2 === null) return null;
      if (typeof number2 === "number") {
        return number2;
      } else {
        const parsedNumber = Number(number2);
        if (Number.isNaN(parsedNumber)) {
          return null;
        } else {
          return parsedNumber;
        }
      }
    }
    const style$6 = c$1([cB("input-number-suffix", `
 display: inline-block;
 margin-right: 10px;
 `), cB("input-number-prefix", `
 display: inline-block;
 margin-left: 10px;
 `)]);
    const HOLDING_CHANGE_THRESHOLD = 800;
    const HOLDING_CHANGE_INTERVAL = 100;
    const inputNumberProps = Object.assign(Object.assign({}, useTheme.props), {
      autofocus: Boolean,
      loading: {
        type: Boolean,
        default: void 0
      },
      placeholder: String,
      defaultValue: {
        type: Number,
        default: null
      },
      value: Number,
      step: {
        type: [Number, String],
        default: 1
      },
      min: [Number, String],
      max: [Number, String],
      size: String,
      disabled: {
        type: Boolean,
        default: void 0
      },
      validator: Function,
      bordered: {
        type: Boolean,
        default: void 0
      },
      showButton: {
        type: Boolean,
        default: true
      },
      buttonPlacement: {
        type: String,
        default: "right"
      },
      inputProps: Object,
      readonly: Boolean,
      clearable: Boolean,
      keyboard: {
        type: Object,
        default: {}
      },
      updateValueOnInput: {
        type: Boolean,
        default: true
      },
      round: {
        type: Boolean,
        default: void 0
      },
      parse: Function,
      format: Function,
      precision: Number,
      status: String,
      "onUpdate:value": [Function, Array],
      onUpdateValue: [Function, Array],
      onFocus: [Function, Array],
      onBlur: [Function, Array],
      onClear: [Function, Array],
      // deprecated
      onChange: [Function, Array]
    });
    const NInputNumber = /* @__PURE__ */ defineComponent({
      name: "InputNumber",
      props: inputNumberProps,
      setup(props) {
        const {
          mergedBorderedRef,
          mergedClsPrefixRef,
          mergedRtlRef
        } = useConfig(props);
        const themeRef = useTheme("InputNumber", "-input-number", style$6, inputNumberLight, props, mergedClsPrefixRef);
        const {
          localeRef
        } = useLocale("InputNumber");
        const formItem = useFormItem(props);
        const {
          mergedSizeRef,
          mergedDisabledRef,
          mergedStatusRef
        } = formItem;
        const inputInstRef = ref(null);
        const minusButtonInstRef = ref(null);
        const addButtonInstRef = ref(null);
        const uncontrolledValueRef = ref(props.defaultValue);
        const controlledValueRef = toRef(props, "value");
        const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
        const displayedValueRef = ref("");
        const getPrecision = (value) => {
          const fraction = String(value).split(".")[1];
          return fraction ? fraction.length : 0;
        };
        const getMaxPrecision = (currentValue) => {
          const precisions = [props.min, props.max, props.step, currentValue].map((value) => {
            if (value === void 0) return 0;
            return getPrecision(value);
          });
          return Math.max(...precisions);
        };
        const mergedPlaceholderRef = useMemo(() => {
          const {
            placeholder
          } = props;
          if (placeholder !== void 0) return placeholder;
          return localeRef.value.placeholder;
        });
        const mergedStepRef = useMemo(() => {
          const parsedNumber = parseNumber(props.step);
          if (parsedNumber !== null) {
            return parsedNumber === 0 ? 1 : Math.abs(parsedNumber);
          }
          return 1;
        });
        const mergedMinRef = useMemo(() => {
          const parsedNumber = parseNumber(props.min);
          if (parsedNumber !== null) return parsedNumber;
          else return null;
        });
        const mergedMaxRef = useMemo(() => {
          const parsedNumber = parseNumber(props.max);
          if (parsedNumber !== null) return parsedNumber;
          else return null;
        });
        const deriveDisplayedValueFromValue = () => {
          const {
            value: mergedValue
          } = mergedValueRef;
          if (validator(mergedValue)) {
            const {
              format: formatProp2,
              precision
            } = props;
            if (formatProp2) {
              displayedValueRef.value = formatProp2(mergedValue);
            } else {
              if (mergedValue === null || precision === void 0 || getPrecision(mergedValue) > precision) {
                displayedValueRef.value = format$2(mergedValue, void 0);
              } else {
                displayedValueRef.value = format$2(mergedValue, precision);
              }
            }
          } else {
            displayedValueRef.value = String(mergedValue);
          }
        };
        deriveDisplayedValueFromValue();
        const doUpdateValue = (value) => {
          const {
            value: mergedValue
          } = mergedValueRef;
          if (value === mergedValue) {
            deriveDisplayedValueFromValue();
            return;
          }
          const {
            "onUpdate:value": _onUpdateValue,
            onUpdateValue,
            onChange
          } = props;
          const {
            nTriggerFormInput,
            nTriggerFormChange
          } = formItem;
          if (onChange) call(onChange, value);
          if (onUpdateValue) call(onUpdateValue, value);
          if (_onUpdateValue) call(_onUpdateValue, value);
          uncontrolledValueRef.value = value;
          nTriggerFormInput();
          nTriggerFormChange();
        };
        const deriveValueFromDisplayedValue = ({
          offset,
          doUpdateIfValid,
          fixPrecision,
          isInputing
        }) => {
          const {
            value: displayedValue
          } = displayedValueRef;
          if (isInputing && isWipValue(displayedValue)) {
            return false;
          }
          const parsedValue = (props.parse || parse$1)(displayedValue);
          if (parsedValue === null) {
            if (doUpdateIfValid) doUpdateValue(null);
            return null;
          }
          if (validator(parsedValue)) {
            const currentPrecision = getPrecision(parsedValue);
            const {
              precision
            } = props;
            if (precision !== void 0 && precision < currentPrecision && !fixPrecision) {
              return false;
            }
            let nextValue = Number.parseFloat((parsedValue + offset).toFixed(precision !== null && precision !== void 0 ? precision : getMaxPrecision(parsedValue)));
            if (validator(nextValue)) {
              const {
                value: mergedMax
              } = mergedMaxRef;
              const {
                value: mergedMin
              } = mergedMinRef;
              if (mergedMax !== null && nextValue > mergedMax) {
                if (!doUpdateIfValid || isInputing) return false;
                nextValue = mergedMax;
              }
              if (mergedMin !== null && nextValue < mergedMin) {
                if (!doUpdateIfValid || isInputing) return false;
                nextValue = mergedMin;
              }
              if (props.validator && !props.validator(nextValue)) return false;
              if (doUpdateIfValid) doUpdateValue(nextValue);
              return nextValue;
            }
          }
          return false;
        };
        const displayedValueInvalidRef = useMemo(() => {
          const derivedValue = deriveValueFromDisplayedValue({
            offset: 0,
            doUpdateIfValid: false,
            isInputing: false,
            fixPrecision: false
          });
          return derivedValue === false;
        });
        const minusableRef = useMemo(() => {
          const {
            value: mergedValue
          } = mergedValueRef;
          if (props.validator && mergedValue === null) {
            return false;
          }
          const {
            value: mergedStep
          } = mergedStepRef;
          const derivedNextValue = deriveValueFromDisplayedValue({
            offset: -mergedStep,
            doUpdateIfValid: false,
            isInputing: false,
            fixPrecision: false
          });
          return derivedNextValue !== false;
        });
        const addableRef = useMemo(() => {
          const {
            value: mergedValue
          } = mergedValueRef;
          if (props.validator && mergedValue === null) {
            return false;
          }
          const {
            value: mergedStep
          } = mergedStepRef;
          const derivedNextValue = deriveValueFromDisplayedValue({
            offset: +mergedStep,
            doUpdateIfValid: false,
            isInputing: false,
            fixPrecision: false
          });
          return derivedNextValue !== false;
        });
        function doFocus(e) {
          const {
            onFocus
          } = props;
          const {
            nTriggerFormFocus
          } = formItem;
          if (onFocus) call(onFocus, e);
          nTriggerFormFocus();
        }
        function doBlur(e) {
          var _a, _b;
          if (e.target === ((_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.wrapperElRef)) {
            return;
          }
          const value = deriveValueFromDisplayedValue({
            offset: 0,
            doUpdateIfValid: true,
            isInputing: false,
            fixPrecision: true
          });
          if (value !== false) {
            const inputElRef = (_b = inputInstRef.value) === null || _b === void 0 ? void 0 : _b.inputElRef;
            if (inputElRef) {
              inputElRef.value = String(value || "");
            }
            if (mergedValueRef.value === value) {
              deriveDisplayedValueFromValue();
            }
          } else {
            deriveDisplayedValueFromValue();
          }
          const {
            onBlur
          } = props;
          const {
            nTriggerFormBlur
          } = formItem;
          if (onBlur) call(onBlur, e);
          nTriggerFormBlur();
          void nextTick(() => {
            deriveDisplayedValueFromValue();
          });
        }
        function doClear(e) {
          const {
            onClear
          } = props;
          if (onClear) call(onClear, e);
        }
        function doAdd() {
          const {
            value: addable
          } = addableRef;
          if (!addable) {
            clearAddHoldTimeout();
            return;
          }
          const {
            value: mergedValue
          } = mergedValueRef;
          if (mergedValue === null) {
            if (!props.validator) {
              doUpdateValue(createValidValue());
            }
          } else {
            const {
              value: mergedStep
            } = mergedStepRef;
            deriveValueFromDisplayedValue({
              offset: mergedStep,
              doUpdateIfValid: true,
              isInputing: false,
              fixPrecision: true
            });
          }
        }
        function doMinus() {
          const {
            value: minusable
          } = minusableRef;
          if (!minusable) {
            clearMinusHoldTimeout();
            return;
          }
          const {
            value: mergedValue
          } = mergedValueRef;
          if (mergedValue === null) {
            if (!props.validator) {
              doUpdateValue(createValidValue());
            }
          } else {
            const {
              value: mergedStep
            } = mergedStepRef;
            deriveValueFromDisplayedValue({
              offset: -mergedStep,
              doUpdateIfValid: true,
              isInputing: false,
              fixPrecision: true
            });
          }
        }
        const handleFocus = doFocus;
        const handleBlur = doBlur;
        function createValidValue() {
          if (props.validator) return null;
          const {
            value: mergedMin
          } = mergedMinRef;
          const {
            value: mergedMax
          } = mergedMaxRef;
          if (mergedMin !== null) {
            return Math.max(0, mergedMin);
          } else if (mergedMax !== null) {
            return Math.min(0, mergedMax);
          } else {
            return 0;
          }
        }
        function handleClear(e) {
          doClear(e);
          doUpdateValue(null);
        }
        function handleMouseDown(e) {
          var _a, _b, _c;
          if ((_a = addButtonInstRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains(e.target)) {
            e.preventDefault();
          }
          if ((_b = minusButtonInstRef.value) === null || _b === void 0 ? void 0 : _b.$el.contains(e.target)) {
            e.preventDefault();
          }
          (_c = inputInstRef.value) === null || _c === void 0 ? void 0 : _c.activate();
        }
        let minusHoldStateIntervalId = null;
        let addHoldStateIntervalId = null;
        let firstMinusMousedownId = null;
        function clearMinusHoldTimeout() {
          if (firstMinusMousedownId) {
            window.clearTimeout(firstMinusMousedownId);
            firstMinusMousedownId = null;
          }
          if (minusHoldStateIntervalId) {
            window.clearInterval(minusHoldStateIntervalId);
            minusHoldStateIntervalId = null;
          }
        }
        let firstAddMousedownId = null;
        function clearAddHoldTimeout() {
          if (firstAddMousedownId) {
            window.clearTimeout(firstAddMousedownId);
            firstAddMousedownId = null;
          }
          if (addHoldStateIntervalId) {
            window.clearInterval(addHoldStateIntervalId);
            addHoldStateIntervalId = null;
          }
        }
        function handleMinusMousedown() {
          clearMinusHoldTimeout();
          firstMinusMousedownId = window.setTimeout(() => {
            minusHoldStateIntervalId = window.setInterval(() => {
              doMinus();
            }, HOLDING_CHANGE_INTERVAL);
          }, HOLDING_CHANGE_THRESHOLD);
          on("mouseup", document, clearMinusHoldTimeout, {
            once: true
          });
        }
        function handleAddMousedown() {
          clearAddHoldTimeout();
          firstAddMousedownId = window.setTimeout(() => {
            addHoldStateIntervalId = window.setInterval(() => {
              doAdd();
            }, HOLDING_CHANGE_INTERVAL);
          }, HOLDING_CHANGE_THRESHOLD);
          on("mouseup", document, clearAddHoldTimeout, {
            once: true
          });
        }
        const handleAddClick = () => {
          if (addHoldStateIntervalId) return;
          doAdd();
        };
        const handleMinusClick = () => {
          if (minusHoldStateIntervalId) return;
          doMinus();
        };
        function handleKeyDown(e) {
          var _a, _b;
          if (e.key === "Enter") {
            if (e.target === ((_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.wrapperElRef)) {
              return;
            }
            const value = deriveValueFromDisplayedValue({
              offset: 0,
              doUpdateIfValid: true,
              isInputing: false,
              fixPrecision: true
            });
            if (value !== false) {
              (_b = inputInstRef.value) === null || _b === void 0 ? void 0 : _b.deactivate();
            }
          } else if (e.key === "ArrowUp") {
            if (!addableRef.value) return;
            if (props.keyboard.ArrowUp === false) return;
            e.preventDefault();
            const value = deriveValueFromDisplayedValue({
              offset: 0,
              doUpdateIfValid: true,
              isInputing: false,
              fixPrecision: true
            });
            if (value !== false) {
              doAdd();
            }
          } else if (e.key === "ArrowDown") {
            if (!minusableRef.value) return;
            if (props.keyboard.ArrowDown === false) return;
            e.preventDefault();
            const value = deriveValueFromDisplayedValue({
              offset: 0,
              doUpdateIfValid: true,
              isInputing: false,
              fixPrecision: true
            });
            if (value !== false) {
              doMinus();
            }
          }
        }
        function handleUpdateDisplayedValue(value) {
          displayedValueRef.value = value;
          if (props.updateValueOnInput && !props.format && !props.parse && props.precision === void 0) {
            deriveValueFromDisplayedValue({
              offset: 0,
              doUpdateIfValid: true,
              isInputing: true,
              fixPrecision: false
            });
          }
        }
        watch(mergedValueRef, () => {
          deriveDisplayedValueFromValue();
        });
        const exposedMethods = {
          focus: () => {
            var _a;
            return (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.focus();
          },
          blur: () => {
            var _a;
            return (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.blur();
          },
          select: () => {
            var _a;
            return (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.select();
          }
        };
        const rtlEnabledRef = useRtl("InputNumber", mergedRtlRef, mergedClsPrefixRef);
        return Object.assign(Object.assign({}, exposedMethods), {
          rtlEnabled: rtlEnabledRef,
          inputInstRef,
          minusButtonInstRef,
          addButtonInstRef,
          mergedClsPrefix: mergedClsPrefixRef,
          mergedBordered: mergedBorderedRef,
          uncontrolledValue: uncontrolledValueRef,
          mergedValue: mergedValueRef,
          mergedPlaceholder: mergedPlaceholderRef,
          displayedValueInvalid: displayedValueInvalidRef,
          mergedSize: mergedSizeRef,
          mergedDisabled: mergedDisabledRef,
          displayedValue: displayedValueRef,
          addable: addableRef,
          minusable: minusableRef,
          mergedStatus: mergedStatusRef,
          handleFocus,
          handleBlur,
          handleClear,
          handleMouseDown,
          handleAddClick,
          handleMinusClick,
          handleAddMousedown,
          handleMinusMousedown,
          handleKeyDown,
          handleUpdateDisplayedValue,
          // theme
          mergedTheme: themeRef,
          inputThemeOverrides: {
            paddingSmall: "0 8px 0 10px",
            paddingMedium: "0 8px 0 12px",
            paddingLarge: "0 8px 0 14px"
          },
          buttonThemeOverrides: computed(() => {
            const {
              self: {
                iconColorDisabled
              }
            } = themeRef.value;
            const [r, g, b, a] = rgba(iconColorDisabled);
            return {
              textColorTextDisabled: `rgb(${r}, ${g}, ${b})`,
              opacityDisabled: `${a}`
            };
          })
        });
      },
      render() {
        const {
          mergedClsPrefix,
          $slots
        } = this;
        const renderMinusButton = () => {
          return h(XButton, {
            text: true,
            disabled: !this.minusable || this.mergedDisabled || this.readonly,
            focusable: false,
            theme: this.mergedTheme.peers.Button,
            themeOverrides: this.mergedTheme.peerOverrides.Button,
            builtinThemeOverrides: this.buttonThemeOverrides,
            onClick: this.handleMinusClick,
            onMousedown: this.handleMinusMousedown,
            ref: "minusButtonInstRef"
          }, {
            icon: () => resolveSlot($slots["minus-icon"], () => [h(NBaseIcon, {
              clsPrefix: mergedClsPrefix
            }, {
              default: () => h(RemoveIcon, null)
            })])
          });
        };
        const renderAddButton = () => {
          return h(XButton, {
            text: true,
            disabled: !this.addable || this.mergedDisabled || this.readonly,
            focusable: false,
            theme: this.mergedTheme.peers.Button,
            themeOverrides: this.mergedTheme.peerOverrides.Button,
            builtinThemeOverrides: this.buttonThemeOverrides,
            onClick: this.handleAddClick,
            onMousedown: this.handleAddMousedown,
            ref: "addButtonInstRef"
          }, {
            icon: () => resolveSlot($slots["add-icon"], () => [h(NBaseIcon, {
              clsPrefix: mergedClsPrefix
            }, {
              default: () => h(AddIcon, null)
            })])
          });
        };
        return h("div", {
          class: [`${mergedClsPrefix}-input-number`, this.rtlEnabled && `${mergedClsPrefix}-input-number--rtl`]
        }, h(NInput, {
          ref: "inputInstRef",
          autofocus: this.autofocus,
          status: this.mergedStatus,
          bordered: this.mergedBordered,
          loading: this.loading,
          value: this.displayedValue,
          onUpdateValue: this.handleUpdateDisplayedValue,
          theme: this.mergedTheme.peers.Input,
          themeOverrides: this.mergedTheme.peerOverrides.Input,
          builtinThemeOverrides: this.inputThemeOverrides,
          size: this.mergedSize,
          placeholder: this.mergedPlaceholder,
          disabled: this.mergedDisabled,
          readonly: this.readonly,
          round: this.round,
          textDecoration: this.displayedValueInvalid ? "line-through" : void 0,
          onFocus: this.handleFocus,
          onBlur: this.handleBlur,
          onKeydown: this.handleKeyDown,
          onMousedown: this.handleMouseDown,
          onClear: this.handleClear,
          clearable: this.clearable,
          inputProps: this.inputProps,
          internalLoadingBeforeSuffix: true
        }, {
          prefix: () => {
            var _a;
            return this.showButton && this.buttonPlacement === "both" ? [renderMinusButton(), resolveWrappedSlot($slots.prefix, (children) => {
              if (children) {
                return h("span", {
                  class: `${mergedClsPrefix}-input-number-prefix`
                }, children);
              }
              return null;
            })] : (_a = $slots.prefix) === null || _a === void 0 ? void 0 : _a.call($slots);
          },
          suffix: () => {
            var _a;
            return this.showButton ? [resolveWrappedSlot($slots.suffix, (children) => {
              if (children) {
                return h("span", {
                  class: `${mergedClsPrefix}-input-number-suffix`
                }, children);
              }
              return null;
            }), this.buttonPlacement === "right" ? renderMinusButton() : null, renderAddButton()] : (_a = $slots.suffix) === null || _a === void 0 ? void 0 : _a.call($slots);
          }
        }));
      }
    });
    const commonVariables = {
      extraFontSize: "12px",
      width: "440px"
    };
    const transferDark = {
      name: "Transfer",
      common: derived$1,
      peers: {
        Checkbox: checkboxDark,
        Scrollbar: scrollbarDark,
        Input: inputDark,
        Empty: emptyDark,
        Button: buttonDark
      },
      self(vars) {
        const {
          iconColorDisabled,
          iconColor,
          fontWeight,
          fontSizeLarge,
          fontSizeMedium,
          fontSizeSmall,
          heightLarge,
          heightMedium,
          heightSmall,
          borderRadius,
          inputColor,
          tableHeaderColor,
          textColor1,
          textColorDisabled,
          textColor2,
          hoverColor
        } = vars;
        return Object.assign(Object.assign({}, commonVariables), {
          itemHeightSmall: heightSmall,
          itemHeightMedium: heightMedium,
          itemHeightLarge: heightLarge,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          borderRadius,
          borderColor: "#0000",
          listColor: inputColor,
          headerColor: tableHeaderColor,
          titleTextColor: textColor1,
          titleTextColorDisabled: textColorDisabled,
          extraTextColor: textColor2,
          filterDividerColor: "#0000",
          itemTextColor: textColor2,
          itemTextColorDisabled: textColorDisabled,
          itemColorPending: hoverColor,
          titleFontWeight: fontWeight,
          iconColor,
          iconColorDisabled
        });
      }
    };
    const NLogLoader = /* @__PURE__ */ defineComponent({
      name: "LogLoader",
      props: {
        clsPrefix: {
          type: String,
          required: true
        }
      },
      setup() {
        return {
          locale: useLocale("Log").localeRef
        };
      },
      render() {
        const {
          clsPrefix
        } = this;
        return h("div", {
          class: `${clsPrefix}-log-loader`
        }, h(NBaseLoading, {
          clsPrefix,
          strokeWidth: 24,
          scale: 0.85
        }), h("span", {
          class: `${clsPrefix}-log-loader__content`
        }, this.locale.loading));
      }
    });
    const logInjectionKey = createInjectionKey("n-log");
    const NLogLine = /* @__PURE__ */ defineComponent({
      props: {
        line: {
          type: String,
          default: ""
        }
      },
      setup(props) {
        const {
          trimRef,
          highlightRef,
          languageRef,
          mergedHljsRef
        } = inject(logInjectionKey);
        const selfRef = ref(null);
        const maybeTrimmedLinesRef = computed(() => {
          return trimRef.value ? props.line.trim() : props.line;
        });
        function setInnerHTML() {
          if (selfRef.value) {
            selfRef.value.innerHTML = generateCodeHTML(languageRef.value, maybeTrimmedLinesRef.value);
          }
        }
        function generateCodeHTML(language, code2) {
          const {
            value: hljs
          } = mergedHljsRef;
          if (hljs) {
            if (language && hljs.getLanguage(language)) {
              return hljs.highlight(code2, {
                language
              }).value;
            }
          }
          return code2;
        }
        onMounted(() => {
          if (highlightRef.value) {
            setInnerHTML();
          }
        });
        watch(toRef(props, "line"), () => {
          if (highlightRef.value) {
            setInnerHTML();
          }
        });
        return {
          highlight: highlightRef,
          selfRef,
          maybeTrimmedLines: maybeTrimmedLinesRef
        };
      },
      render() {
        const {
          highlight,
          maybeTrimmedLines
        } = this;
        return h("pre", {
          ref: "selfRef"
        }, highlight ? null : maybeTrimmedLines);
      }
    });
    const style$5 = cB("log", `
 position: relative;
 box-sizing: border-box;
 transition: border-color .3s var(--n-bezier);
`, [c$1("pre", `
 white-space: pre-wrap;
 word-break: break-word;
 margin: 0;
 `), cB("log-loader", `
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 box-sizing: border-box;
 position: absolute;
 right: 16px;
 top: 8px;
 height: 34px;
 border-radius: 17px;
 line-height: 34px;
 white-space: nowrap;
 overflow: hidden;
 border: var(--n-loader-border);
 color: var(--n-loader-text-color);
 background-color: var(--n-loader-color);
 font-size: var(--n-loader-font-size);
 `, [fadeInScaleUpTransition(), cE("content", `
 display: inline-block;
 vertical-align: bottom;
 line-height: 34px;
 padding-left: 40px;
 padding-right: 20px;
 white-space: nowrap;
 `), cB("base-loading", `
 color: var(--n-loading-color);
 position: absolute;
 left: 12px;
 top: calc(50% - 10px);
 font-size: 20px;
 width: 20px;
 height: 20px;
 display: inline-block;
 `)])]);
    const logProps = Object.assign(Object.assign({}, useTheme.props), {
      loading: Boolean,
      trim: Boolean,
      log: String,
      fontSize: {
        type: Number,
        default: 14
      },
      lines: {
        type: Array,
        default: () => []
      },
      lineHeight: {
        type: Number,
        default: 1.25
      },
      language: String,
      rows: {
        type: Number,
        default: 15
      },
      offsetTop: {
        type: Number,
        default: 0
      },
      offsetBottom: {
        type: Number,
        default: 0
      },
      hljs: Object,
      onReachTop: Function,
      onReachBottom: Function,
      onRequireMore: Function
    });
    const NLog = /* @__PURE__ */ defineComponent({
      name: "Log",
      props: logProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig(props);
        const silentRef = ref(false);
        const highlightRef = computed(() => {
          return props.language !== void 0;
        });
        const styleHeightRef = computed(() => {
          return `calc(${Math.round(props.rows * props.lineHeight * props.fontSize)}px)`;
        });
        const mergedLinesRef = computed(() => {
          const {
            log
          } = props;
          if (log) {
            return log.split("\n");
          }
          return props.lines;
        });
        const scrollbarRef = ref(null);
        const themeRef = useTheme("Log", "-log", style$5, logLight, props, mergedClsPrefixRef);
        function handleScroll(e) {
          const container = e.target;
          const content = container.firstElementChild;
          if (silentRef.value) {
            void nextTick(() => {
              silentRef.value = false;
            });
            return;
          }
          const containerHeight = container.offsetHeight;
          const containerScrollTop = container.scrollTop;
          const contentHeight = content.offsetHeight;
          const scrollTop = containerScrollTop;
          const scrollBottom = contentHeight - containerScrollTop - containerHeight;
          if (scrollTop <= props.offsetTop) {
            const {
              onReachTop,
              onRequireMore
            } = props;
            if (onRequireMore) onRequireMore("top");
            if (onReachTop) onReachTop();
          }
          if (scrollBottom <= props.offsetBottom) {
            const {
              onReachBottom,
              onRequireMore
            } = props;
            if (onRequireMore) onRequireMore("bottom");
            if (onReachBottom) onReachBottom();
          }
        }
        const handleWheel = throttle(_handleWheel, 300);
        function _handleWheel(e) {
          if (silentRef.value) {
            void nextTick(() => {
              silentRef.value = false;
            });
            return;
          }
          if (scrollbarRef.value) {
            const {
              containerRef,
              contentRef
            } = scrollbarRef.value;
            if (containerRef && contentRef) {
              const containerHeight = containerRef.offsetHeight;
              const containerScrollTop = containerRef.scrollTop;
              const contentHeight = contentRef.offsetHeight;
              const scrollTop = containerScrollTop;
              const scrollBottom = contentHeight - containerScrollTop - containerHeight;
              const deltaY = e.deltaY;
              if (scrollTop === 0 && deltaY < 0) {
                const {
                  onRequireMore
                } = props;
                if (onRequireMore) onRequireMore("top");
              }
              if (scrollBottom <= 0 && deltaY > 0) {
                const {
                  onRequireMore
                } = props;
                if (onRequireMore) onRequireMore("bottom");
              }
            }
          }
        }
        function scrollTo(options) {
          const {
            value: scrollbarInst
          } = scrollbarRef;
          if (!scrollbarInst) return;
          const {
            silent,
            top,
            position
          } = options;
          if (silent) {
            silentRef.value = true;
          }
          if (top !== void 0) {
            scrollbarInst.scrollTo({
              left: 0,
              top
            });
          } else if (position === "bottom" || position === "top") {
            scrollbarInst.scrollTo({
              position
            });
          }
        }
        function scrollToTop(silent = false) {
          warn$3("log", "`scrollToTop` is deprecated, please use `scrollTo({ position: 'top'})` instead.");
          scrollTo({
            position: "top",
            silent
          });
        }
        function scrollToBottom(silent = false) {
          warn$3("log", "`scrollToTop` is deprecated, please use `scrollTo({ position: 'bottom'})` instead.");
          scrollTo({
            position: "bottom",
            silent
          });
        }
        provide(logInjectionKey, {
          languageRef: toRef(props, "language"),
          mergedHljsRef: useHljs(props),
          trimRef: toRef(props, "trim"),
          highlightRef
        });
        const exportedMethods = {
          scrollTo
        };
        const cssVarsRef = computed(() => {
          const {
            self: {
              loaderFontSize,
              loaderTextColor,
              loaderColor,
              loaderBorder,
              loadingColor
            },
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            }
          } = themeRef.value;
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-loader-font-size": loaderFontSize,
            "--n-loader-border": loaderBorder,
            "--n-loader-color": loaderColor,
            "--n-loader-text-color": loaderTextColor,
            "--n-loading-color": loadingColor
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("log", void 0, cssVarsRef, props) : void 0;
        return Object.assign(Object.assign({}, exportedMethods), {
          mergedClsPrefix: mergedClsPrefixRef,
          scrollbarRef,
          mergedTheme: themeRef,
          styleHeight: styleHeightRef,
          mergedLines: mergedLinesRef,
          scrollToTop,
          scrollToBottom,
          handleWheel,
          handleScroll,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        });
      },
      render() {
        const {
          mergedClsPrefix,
          mergedTheme,
          onRender
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h("div", {
          class: [`${mergedClsPrefix}-log`, this.themeClass],
          style: [{
            lineHeight: this.lineHeight,
            height: this.styleHeight
          }, this.cssVars],
          onWheelPassive: this.handleWheel
        }, [h(Scrollbar, {
          ref: "scrollbarRef",
          theme: mergedTheme.peers.Scrollbar,
          themeOverrides: mergedTheme.peerOverrides.Scrollbar,
          onScroll: this.handleScroll
        }, {
          default: () => h(NCode, {
            internalNoHighlight: true,
            internalFontSize: this.fontSize,
            theme: mergedTheme.peers.Code,
            themeOverrides: mergedTheme.peerOverrides.Code
          }, {
            default: () => this.mergedLines.map((line, index) => {
              return h(NLogLine, {
                key: index,
                line
              });
            })
          })
        }), h(Transition, {
          name: "fade-in-scale-up-transition"
        }, {
          default: () => this.loading ? h(NLogLoader, {
            clsPrefix: mergedClsPrefix
          }) : null
        })]);
      }
    });
    const notificationProviderInjectionKey = createInjectionKey("n-notification-provider");
    const NotificationContainer = /* @__PURE__ */ defineComponent({
      name: "NotificationContainer",
      props: {
        scrollable: {
          type: Boolean,
          required: true
        },
        placement: {
          type: String,
          required: true
        }
      },
      setup() {
        const {
          mergedThemeRef,
          mergedClsPrefixRef,
          wipTransitionCountRef
        } = inject(notificationProviderInjectionKey);
        const selfRef = ref(null);
        watchEffect(() => {
          var _a, _b;
          if (wipTransitionCountRef.value > 0) {
            (_a = selfRef === null || selfRef === void 0 ? void 0 : selfRef.value) === null || _a === void 0 ? void 0 : _a.classList.add("transitioning");
          } else {
            (_b = selfRef === null || selfRef === void 0 ? void 0 : selfRef.value) === null || _b === void 0 ? void 0 : _b.classList.remove("transitioning");
          }
        });
        return {
          selfRef,
          mergedTheme: mergedThemeRef,
          mergedClsPrefix: mergedClsPrefixRef,
          transitioning: wipTransitionCountRef
        };
      },
      render() {
        const {
          $slots,
          scrollable,
          mergedClsPrefix,
          mergedTheme,
          placement
        } = this;
        return h("div", {
          ref: "selfRef",
          class: [`${mergedClsPrefix}-notification-container`, scrollable && `${mergedClsPrefix}-notification-container--scrollable`, `${mergedClsPrefix}-notification-container--${placement}`]
        }, scrollable ? h(Scrollbar, {
          theme: mergedTheme.peers.Scrollbar,
          themeOverrides: mergedTheme.peerOverrides.Scrollbar,
          contentStyle: {
            overflow: "hidden"
          }
        }, $slots) : $slots);
      }
    });
    const iconRenderMap = {
      info: () => h(InfoIcon, null),
      success: () => h(SuccessIcon, null),
      warning: () => h(WarningIcon, null),
      error: () => h(ErrorIcon, null),
      default: () => null
    };
    const notificationProps = {
      closable: {
        type: Boolean,
        default: true
      },
      type: {
        type: String,
        default: "default"
      },
      avatar: Function,
      title: [String, Function],
      description: [String, Function],
      content: [String, Function],
      meta: [String, Function],
      action: [String, Function],
      onClose: {
        type: Function,
        required: true
      },
      keepAliveOnHover: Boolean,
      onMouseenter: Function,
      onMouseleave: Function
    };
    const notificationPropKeys = keysOf(notificationProps);
    const Notification = /* @__PURE__ */ defineComponent({
      name: "Notification",
      props: notificationProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          mergedThemeRef,
          props: providerProps
        } = inject(notificationProviderInjectionKey);
        const {
          inlineThemeDisabled,
          mergedRtlRef
        } = useConfig();
        const rtlEnabledRef = useRtl("Notification", mergedRtlRef, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            type
          } = props;
          const {
            self: {
              color,
              textColor,
              closeIconColor,
              closeIconColorHover,
              closeIconColorPressed,
              headerTextColor,
              descriptionTextColor,
              actionTextColor,
              borderRadius,
              headerFontWeight,
              boxShadow,
              lineHeight: lineHeight2,
              fontSize: fontSize2,
              closeMargin,
              closeSize,
              width,
              padding,
              closeIconSize,
              closeBorderRadius,
              closeColorHover,
              closeColorPressed,
              titleFontSize,
              metaFontSize,
              descriptionFontSize,
              [createKey("iconColor", type)]: iconColor
            },
            common: {
              cubicBezierEaseOut: cubicBezierEaseOut2,
              cubicBezierEaseIn: cubicBezierEaseIn2,
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            }
          } = mergedThemeRef.value;
          const {
            left,
            right,
            top,
            bottom
          } = getMargin(padding);
          return {
            "--n-color": color,
            "--n-font-size": fontSize2,
            "--n-text-color": textColor,
            "--n-description-text-color": descriptionTextColor,
            "--n-action-text-color": actionTextColor,
            "--n-title-text-color": headerTextColor,
            "--n-title-font-weight": headerFontWeight,
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-bezier-ease-out": cubicBezierEaseOut2,
            "--n-bezier-ease-in": cubicBezierEaseIn2,
            "--n-border-radius": borderRadius,
            "--n-box-shadow": boxShadow,
            "--n-close-border-radius": closeBorderRadius,
            "--n-close-color-hover": closeColorHover,
            "--n-close-color-pressed": closeColorPressed,
            "--n-close-icon-color": closeIconColor,
            "--n-close-icon-color-hover": closeIconColorHover,
            "--n-close-icon-color-pressed": closeIconColorPressed,
            "--n-line-height": lineHeight2,
            "--n-icon-color": iconColor,
            "--n-close-margin": closeMargin,
            "--n-close-size": closeSize,
            "--n-close-icon-size": closeIconSize,
            "--n-width": width,
            "--n-padding-left": left,
            "--n-padding-right": right,
            "--n-padding-top": top,
            "--n-padding-bottom": bottom,
            "--n-title-font-size": titleFontSize,
            "--n-meta-font-size": metaFontSize,
            "--n-description-font-size": descriptionFontSize
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("notification", computed(() => props.type[0]), cssVarsRef, providerProps) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          showAvatar: computed(() => {
            return props.avatar || props.type !== "default";
          }),
          handleCloseClick() {
            props.onClose();
          },
          rtlEnabled: rtlEnabledRef,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        var _a;
        const {
          mergedClsPrefix
        } = this;
        (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
        return h("div", {
          class: [`${mergedClsPrefix}-notification-wrapper`, this.themeClass],
          onMouseenter: this.onMouseenter,
          onMouseleave: this.onMouseleave,
          style: this.cssVars
        }, h("div", {
          class: [`${mergedClsPrefix}-notification`, this.rtlEnabled && `${mergedClsPrefix}-notification--rtl`, this.themeClass, {
            [`${mergedClsPrefix}-notification--closable`]: this.closable,
            [`${mergedClsPrefix}-notification--show-avatar`]: this.showAvatar
          }],
          style: this.cssVars
        }, this.showAvatar ? h("div", {
          class: `${mergedClsPrefix}-notification__avatar`
        }, this.avatar ? render$1(this.avatar) : this.type !== "default" ? h(NBaseIcon, {
          clsPrefix: mergedClsPrefix
        }, {
          default: () => iconRenderMap[this.type]()
        }) : null) : null, this.closable ? h(NBaseClose, {
          clsPrefix: mergedClsPrefix,
          class: `${mergedClsPrefix}-notification__close`,
          onClick: this.handleCloseClick
        }) : null, h("div", {
          ref: "bodyRef",
          class: `${mergedClsPrefix}-notification-main`
        }, this.title ? h("div", {
          class: `${mergedClsPrefix}-notification-main__header`
        }, render$1(this.title)) : null, this.description ? h("div", {
          class: `${mergedClsPrefix}-notification-main__description`
        }, render$1(this.description)) : null, this.content ? h("pre", {
          class: `${mergedClsPrefix}-notification-main__content`
        }, render$1(this.content)) : null, this.meta || this.action ? h("div", {
          class: `${mergedClsPrefix}-notification-main-footer`
        }, this.meta ? h("div", {
          class: `${mergedClsPrefix}-notification-main-footer__meta`
        }, render$1(this.meta)) : null, this.action ? h("div", {
          class: `${mergedClsPrefix}-notification-main-footer__action`
        }, render$1(this.action)) : null) : null)));
      }
    });
    const notificationEnvOptions = Object.assign(Object.assign({}, notificationProps), {
      duration: Number,
      onClose: Function,
      onLeave: Function,
      onAfterEnter: Function,
      onAfterLeave: Function,
      /** @deprecated */
      onHide: Function,
      /** @deprecated */
      onAfterShow: Function,
      /** @deprecated */
      onAfterHide: Function
    });
    const NotificationEnvironment = /* @__PURE__ */ defineComponent({
      name: "NotificationEnvironment",
      props: Object.assign(Object.assign({}, notificationEnvOptions), {
        // private
        internalKey: {
          type: String,
          required: true
        },
        onInternalAfterLeave: {
          type: Function,
          required: true
        }
      }),
      setup(props) {
        const {
          wipTransitionCountRef
        } = inject(notificationProviderInjectionKey);
        const showRef = ref(true);
        let timerId = null;
        function hide() {
          showRef.value = false;
          if (timerId) {
            window.clearTimeout(timerId);
          }
        }
        function handleBeforeEnter(el) {
          wipTransitionCountRef.value++;
          void nextTick(() => {
            el.style.height = `${el.offsetHeight}px`;
            el.style.maxHeight = "0";
            el.style.transition = "none";
            void el.offsetHeight;
            el.style.transition = "";
            el.style.maxHeight = el.style.height;
          });
        }
        function handleAfterEnter(el) {
          wipTransitionCountRef.value--;
          el.style.height = "";
          el.style.maxHeight = "";
          const {
            onAfterEnter,
            onAfterShow
          } = props;
          if (onAfterEnter) onAfterEnter();
          if (onAfterShow) onAfterShow();
        }
        function handleBeforeLeave(el) {
          wipTransitionCountRef.value++;
          el.style.maxHeight = `${el.offsetHeight}px`;
          el.style.height = `${el.offsetHeight}px`;
          void el.offsetHeight;
        }
        function handleLeave(el) {
          const {
            onHide
          } = props;
          if (onHide) onHide();
          el.style.maxHeight = "0";
          void el.offsetHeight;
        }
        function handleAfterLeave() {
          wipTransitionCountRef.value--;
          const {
            onAfterLeave,
            onInternalAfterLeave,
            onAfterHide,
            internalKey
          } = props;
          if (onAfterLeave) onAfterLeave();
          onInternalAfterLeave(internalKey);
          if (onAfterHide) onAfterHide();
        }
        function setHideTimeout() {
          const {
            duration: duration2
          } = props;
          if (duration2) {
            timerId = window.setTimeout(hide, duration2);
          }
        }
        function handleMouseenter(e) {
          if (e.currentTarget !== e.target) return;
          if (timerId !== null) {
            window.clearTimeout(timerId);
            timerId = null;
          }
        }
        function handleMouseleave(e) {
          if (e.currentTarget !== e.target) return;
          setHideTimeout();
        }
        function handleClose() {
          const {
            onClose
          } = props;
          if (onClose) {
            void Promise.resolve(onClose()).then((feedback) => {
              if (feedback === false) return;
              hide();
            });
          } else {
            hide();
          }
        }
        onMounted(() => {
          if (props.duration) {
            timerId = window.setTimeout(hide, props.duration);
          }
        });
        return {
          show: showRef,
          hide,
          handleClose,
          handleAfterLeave,
          handleLeave,
          handleBeforeLeave,
          handleAfterEnter,
          handleBeforeEnter,
          handleMouseenter,
          handleMouseleave
        };
      },
      render() {
        return h(Transition, {
          name: "notification-transition",
          appear: true,
          // convert to any since Element is not compatible with HTMLElement
          onBeforeEnter: this.handleBeforeEnter,
          onAfterEnter: this.handleAfterEnter,
          onBeforeLeave: this.handleBeforeLeave,
          onLeave: this.handleLeave,
          onAfterLeave: this.handleAfterLeave
        }, {
          default: () => {
            return this.show ? h(Notification, Object.assign({}, keep(this.$props, notificationPropKeys), {
              onClose: this.handleClose,
              onMouseenter: this.duration && this.keepAliveOnHover ? this.handleMouseenter : void 0,
              onMouseleave: this.duration && this.keepAliveOnHover ? this.handleMouseleave : void 0
            })) : null;
          }
        });
      }
    });
    const style$4 = c$1([cB("notification-container", `
 z-index: 4000;
 position: fixed;
 overflow: visible;
 display: flex;
 flex-direction: column;
 align-items: flex-end;
 `, [c$1(">", [cB("scrollbar", `
 width: initial;
 overflow: visible;
 height: -moz-fit-content !important;
 height: fit-content !important;
 max-height: 100vh !important;
 `, [c$1(">", [cB("scrollbar-container", `
 height: -moz-fit-content !important;
 height: fit-content !important;
 max-height: 100vh !important;
 `, [cB("scrollbar-content", `
 padding-top: 12px;
 padding-bottom: 33px;
 `)])])])]), cM("top, top-right, top-left", `
 top: 12px;
 `, [c$1("&.transitioning >", [cB("scrollbar", [c$1(">", [cB("scrollbar-container", `
 min-height: 100vh !important;
 `)])])])]), cM("bottom, bottom-right, bottom-left", `
 bottom: 12px;
 `, [c$1(">", [cB("scrollbar", [c$1(">", [cB("scrollbar-container", [cB("scrollbar-content", `
 padding-bottom: 12px;
 `)])])])]), cB("notification-wrapper", `
 display: flex;
 align-items: flex-end;
 margin-bottom: 0;
 margin-top: 12px;
 `)]), cM("top, bottom", `
 left: 50%;
 transform: translateX(-50%);
 `, [cB("notification-wrapper", [c$1("&.notification-transition-enter-from, &.notification-transition-leave-to", `
 transform: scale(0.85);
 `), c$1("&.notification-transition-leave-from, &.notification-transition-enter-to", `
 transform: scale(1);
 `)])]), cM("top", [cB("notification-wrapper", `
 transform-origin: top center;
 `)]), cM("bottom", [cB("notification-wrapper", `
 transform-origin: bottom center;
 `)]), cM("top-right, bottom-right", [cB("notification", `
 margin-left: 28px;
 margin-right: 16px;
 `)]), cM("top-left, bottom-left", [cB("notification", `
 margin-left: 16px;
 margin-right: 28px;
 `)]), cM("top-right", `
 right: 0;
 `, [placementTransformStyle("top-right")]), cM("top-left", `
 left: 0;
 `, [placementTransformStyle("top-left")]), cM("bottom-right", `
 right: 0;
 `, [placementTransformStyle("bottom-right")]), cM("bottom-left", `
 left: 0;
 `, [placementTransformStyle("bottom-left")]), cM("scrollable", [cM("top-right", `
 top: 0;
 `), cM("top-left", `
 top: 0;
 `), cM("bottom-right", `
 bottom: 0;
 `), cM("bottom-left", `
 bottom: 0;
 `)]), cB("notification-wrapper", `
 margin-bottom: 12px;
 `, [c$1("&.notification-transition-enter-from, &.notification-transition-leave-to", `
 opacity: 0;
 margin-top: 0 !important;
 margin-bottom: 0 !important;
 `), c$1("&.notification-transition-leave-from, &.notification-transition-enter-to", `
 opacity: 1;
 `), c$1("&.notification-transition-leave-active", `
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 opacity .3s var(--n-bezier),
 transform .3s var(--n-bezier-ease-in),
 max-height .3s var(--n-bezier),
 margin-top .3s linear,
 margin-bottom .3s linear,
 box-shadow .3s var(--n-bezier);
 `), c$1("&.notification-transition-enter-active", `
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 opacity .3s var(--n-bezier),
 transform .3s var(--n-bezier-ease-out),
 max-height .3s var(--n-bezier),
 margin-top .3s linear,
 margin-bottom .3s linear,
 box-shadow .3s var(--n-bezier);
 `)]), cB("notification", `
 background-color: var(--n-color);
 color: var(--n-text-color);
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 opacity .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier);
 font-family: inherit;
 font-size: var(--n-font-size);
 font-weight: 400;
 position: relative;
 display: flex;
 overflow: hidden;
 flex-shrink: 0;
 padding-left: var(--n-padding-left);
 padding-right: var(--n-padding-right);
 width: var(--n-width);
 max-width: calc(100vw - 16px - 16px);
 border-radius: var(--n-border-radius);
 box-shadow: var(--n-box-shadow);
 box-sizing: border-box;
 opacity: 1;
 `, [cE("avatar", [cB("icon", `
 color: var(--n-icon-color);
 `), cB("base-icon", `
 color: var(--n-icon-color);
 `)]), cM("show-avatar", [cB("notification-main", `
 margin-left: 40px;
 width: calc(100% - 40px); 
 `)]), cM("closable", [cB("notification-main", [c$1("> *:first-child", `
 padding-right: 20px;
 `)]), cE("close", `
 position: absolute;
 top: 0;
 right: 0;
 margin: var(--n-close-margin);
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `)]), cE("avatar", `
 position: absolute;
 top: var(--n-padding-top);
 left: var(--n-padding-left);
 width: 28px;
 height: 28px;
 font-size: 28px;
 display: flex;
 align-items: center;
 justify-content: center;
 `, [cB("icon", "transition: color .3s var(--n-bezier);")]), cB("notification-main", `
 padding-top: var(--n-padding-top);
 padding-bottom: var(--n-padding-bottom);
 box-sizing: border-box;
 display: flex;
 flex-direction: column;
 margin-left: 8px;
 width: calc(100% - 8px);
 `, [cB("notification-main-footer", `
 display: flex;
 align-items: center;
 justify-content: space-between;
 margin-top: 12px;
 `, [cE("meta", `
 font-size: var(--n-meta-font-size);
 transition: color .3s var(--n-bezier-ease-out);
 color: var(--n-description-text-color);
 `), cE("action", `
 cursor: pointer;
 transition: color .3s var(--n-bezier-ease-out);
 color: var(--n-action-text-color);
 `)]), cE("header", `
 font-weight: var(--n-title-font-weight);
 font-size: var(--n-title-font-size);
 transition: color .3s var(--n-bezier-ease-out);
 color: var(--n-title-text-color);
 `), cE("description", `
 margin-top: 8px;
 font-size: var(--n-description-font-size);
 white-space: pre-wrap;
 word-wrap: break-word;
 transition: color .3s var(--n-bezier-ease-out);
 color: var(--n-description-text-color);
 `), cE("content", `
 line-height: var(--n-line-height);
 margin: 12px 0 0 0;
 font-family: inherit;
 white-space: pre-wrap;
 word-wrap: break-word;
 transition: color .3s var(--n-bezier-ease-out);
 color: var(--n-text-color);
 `, [c$1("&:first-child", "margin: 0;")])])])])]);
    function placementTransformStyle(placement) {
      const direction = placement.split("-")[1];
      const transformXEnter = direction === "left" ? "calc(-100%)" : "calc(100%)";
      const transformXLeave = "0";
      return cB("notification-wrapper", [c$1("&.notification-transition-enter-from, &.notification-transition-leave-to", `
 transform: translate(${transformXEnter}, 0);
 `), c$1("&.notification-transition-leave-from, &.notification-transition-enter-to", `
 transform: translate(${transformXLeave}, 0);
 `)]);
    }
    const notificationApiInjectionKey = createInjectionKey("n-notification-api");
    const notificationProviderProps = Object.assign(Object.assign({}, useTheme.props), {
      containerClass: String,
      containerStyle: [String, Object],
      to: [String, Object],
      scrollable: {
        type: Boolean,
        default: true
      },
      max: Number,
      placement: {
        type: String,
        default: "top-right"
      },
      keepAliveOnHover: Boolean
    });
    const NNotificationProvider = /* @__PURE__ */ defineComponent({
      name: "NotificationProvider",
      props: notificationProviderProps,
      setup(props) {
        const {
          mergedClsPrefixRef
        } = useConfig(props);
        const notificationListRef = ref([]);
        const notificationRefs = {};
        const leavingKeySet = /* @__PURE__ */ new Set();
        function create2(options) {
          const key = createId();
          const destroy = () => {
            leavingKeySet.add(key);
            if (notificationRefs[key]) {
              notificationRefs[key].hide();
            }
          };
          const notificationReactive = reactive(Object.assign(Object.assign({}, options), {
            key,
            destroy,
            hide: destroy,
            deactivate: destroy
          }));
          const {
            max
          } = props;
          if (max && notificationListRef.value.length - leavingKeySet.size >= max) {
            let someoneMountedRemoved = false;
            let index = 0;
            for (const notification of notificationListRef.value) {
              if (!leavingKeySet.has(notification.key)) {
                if (notificationRefs[notification.key]) {
                  notification.destroy();
                  someoneMountedRemoved = true;
                }
                break;
              }
              index++;
            }
            if (!someoneMountedRemoved) {
              notificationListRef.value.splice(index, 1);
            }
          }
          notificationListRef.value.push(notificationReactive);
          return notificationReactive;
        }
        const apis = ["info", "success", "warning", "error"].map((type) => {
          return (options) => create2(Object.assign(Object.assign({}, options), {
            type
          }));
        });
        function handleAfterLeave(key) {
          leavingKeySet.delete(key);
          notificationListRef.value.splice(notificationListRef.value.findIndex((notification) => notification.key === key), 1);
        }
        const themeRef = useTheme("Notification", "-notification", style$4, notificationLight, props, mergedClsPrefixRef);
        const api = {
          create: create2,
          info: apis[0],
          success: apis[1],
          warning: apis[2],
          error: apis[3],
          open,
          destroyAll
        };
        const wipTransitionCountRef = ref(0);
        provide(notificationApiInjectionKey, api);
        provide(notificationProviderInjectionKey, {
          props,
          mergedClsPrefixRef,
          mergedThemeRef: themeRef,
          wipTransitionCountRef
        });
        function open(options) {
          return create2(options);
        }
        function destroyAll() {
          Object.values(notificationListRef.value).forEach((notification) => {
            notification.hide();
          });
        }
        return Object.assign({
          mergedClsPrefix: mergedClsPrefixRef,
          notificationList: notificationListRef,
          notificationRefs,
          handleAfterLeave
        }, api);
      },
      render() {
        var _a, _b, _c;
        const {
          placement
        } = this;
        return h(Fragment, null, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a), this.notificationList.length ? h(Teleport, {
          to: (_c = this.to) !== null && _c !== void 0 ? _c : "body"
        }, h(NotificationContainer, {
          class: this.containerClass,
          style: this.containerStyle,
          scrollable: this.scrollable && placement !== "top" && placement !== "bottom",
          placement
        }, {
          default: () => {
            return this.notificationList.map((notification) => {
              return h(NotificationEnvironment, Object.assign({
                ref: (inst) => {
                  const refKey = notification.key;
                  if (inst === null) {
                    delete this.notificationRefs[refKey];
                  } else {
                    this.notificationRefs[refKey] = inst;
                  }
                }
              }, omit(notification, ["destroy", "hide", "deactivate"]), {
                internalKey: notification.key,
                onInternalAfterLeave: this.handleAfterLeave,
                keepAliveOnHover: notification.keepAliveOnHover === void 0 ? this.keepAliveOnHover : notification.keepAliveOnHover
              }));
            });
          }
        })) : null);
      }
    });
    function useNotification() {
      const api = inject(notificationApiInjectionKey, null);
      if (api === null) {
        throwError("use-notification", "No outer `n-notification-provider` found.");
      }
      return api;
    }
    const style$3 = c$1([cB("progress", {
      display: "inline-block"
    }, [cB("progress-icon", `
 color: var(--n-icon-color);
 transition: color .3s var(--n-bezier);
 `), cM("line", `
 width: 100%;
 display: block;
 `, [cB("progress-content", `
 display: flex;
 align-items: center;
 `, [cB("progress-graph", {
      flex: 1
    })]), cB("progress-custom-content", {
      marginLeft: "14px"
    }), cB("progress-icon", `
 width: 30px;
 padding-left: 14px;
 height: var(--n-icon-size-line);
 line-height: var(--n-icon-size-line);
 font-size: var(--n-icon-size-line);
 `, [cM("as-text", `
 color: var(--n-text-color-line-outer);
 text-align: center;
 width: 40px;
 font-size: var(--n-font-size);
 padding-left: 4px;
 transition: color .3s var(--n-bezier);
 `)])]), cM("circle, dashboard", {
      width: "120px"
    }, [cB("progress-custom-content", `
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translateX(-50%) translateY(-50%);
 display: flex;
 align-items: center;
 justify-content: center;
 `), cB("progress-text", `
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translateX(-50%) translateY(-50%);
 display: flex;
 align-items: center;
 color: inherit;
 font-size: var(--n-font-size-circle);
 color: var(--n-text-color-circle);
 font-weight: var(--n-font-weight-circle);
 transition: color .3s var(--n-bezier);
 white-space: nowrap;
 `), cB("progress-icon", `
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translateX(-50%) translateY(-50%);
 display: flex;
 align-items: center;
 color: var(--n-icon-color);
 font-size: var(--n-icon-size-circle);
 `)]), cM("multiple-circle", `
 width: 200px;
 color: inherit;
 `, [cB("progress-text", `
 font-weight: var(--n-font-weight-circle);
 color: var(--n-text-color-circle);
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translateX(-50%) translateY(-50%);
 display: flex;
 align-items: center;
 justify-content: center;
 transition: color .3s var(--n-bezier);
 `)]), cB("progress-content", {
      position: "relative"
    }), cB("progress-graph", {
      position: "relative"
    }, [cB("progress-graph-circle", [c$1("svg", {
      verticalAlign: "bottom"
    }), cB("progress-graph-circle-fill", `
 stroke: var(--n-fill-color);
 transition:
 opacity .3s var(--n-bezier),
 stroke .3s var(--n-bezier),
 stroke-dasharray .3s var(--n-bezier);
 `, [cM("empty", {
      opacity: 0
    })]), cB("progress-graph-circle-rail", `
 transition: stroke .3s var(--n-bezier);
 overflow: hidden;
 stroke: var(--n-rail-color);
 `)]), cB("progress-graph-line", [cM("indicator-inside", [cB("progress-graph-line-rail", `
 height: 16px;
 line-height: 16px;
 border-radius: 10px;
 `, [cB("progress-graph-line-fill", `
 height: inherit;
 border-radius: 10px;
 `), cB("progress-graph-line-indicator", `
 background: #0000;
 white-space: nowrap;
 text-align: right;
 margin-left: 14px;
 margin-right: 14px;
 height: inherit;
 font-size: 12px;
 color: var(--n-text-color-line-inner);
 transition: color .3s var(--n-bezier);
 `)])]), cM("indicator-inside-label", `
 height: 16px;
 display: flex;
 align-items: center;
 `, [cB("progress-graph-line-rail", `
 flex: 1;
 transition: background-color .3s var(--n-bezier);
 `), cB("progress-graph-line-indicator", `
 background: var(--n-fill-color);
 font-size: 12px;
 transform: translateZ(0);
 display: flex;
 vertical-align: middle;
 height: 16px;
 line-height: 16px;
 padding: 0 10px;
 border-radius: 10px;
 position: absolute;
 white-space: nowrap;
 color: var(--n-text-color-line-inner);
 transition:
 right .2s var(--n-bezier),
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 `)]), cB("progress-graph-line-rail", `
 position: relative;
 overflow: hidden;
 height: var(--n-rail-height);
 border-radius: 5px;
 background-color: var(--n-rail-color);
 transition: background-color .3s var(--n-bezier);
 `, [cB("progress-graph-line-fill", `
 background: var(--n-fill-color);
 position: relative;
 border-radius: 5px;
 height: inherit;
 width: 100%;
 max-width: 0%;
 transition:
 background-color .3s var(--n-bezier),
 max-width .2s var(--n-bezier);
 `, [cM("processing", [c$1("&::after", `
 content: "";
 background-image: var(--n-line-bg-processing);
 animation: progress-processing-animation 2s var(--n-bezier) infinite;
 `)])])])])])]), c$1("@keyframes progress-processing-animation", `
 0% {
 position: absolute;
 left: 0;
 top: 0;
 bottom: 0;
 right: 100%;
 opacity: 1;
 }
 66% {
 position: absolute;
 left: 0;
 top: 0;
 bottom: 0;
 right: 0;
 opacity: 0;
 }
 100% {
 position: absolute;
 left: 0;
 top: 0;
 bottom: 0;
 right: 0;
 opacity: 0;
 }
 `)]);
    const iconMap$1 = {
      success: h(SuccessIcon, null),
      error: h(ErrorIcon, null),
      warning: h(WarningIcon, null),
      info: h(InfoIcon, null)
    };
    const Line = /* @__PURE__ */ defineComponent({
      name: "ProgressLine",
      props: {
        clsPrefix: {
          type: String,
          required: true
        },
        percentage: {
          type: Number,
          default: 0
        },
        railColor: String,
        railStyle: [String, Object],
        fillColor: String,
        status: {
          type: String,
          required: true
        },
        indicatorPlacement: {
          type: String,
          required: true
        },
        indicatorTextColor: String,
        unit: {
          type: String,
          default: "%"
        },
        processing: {
          type: Boolean,
          required: true
        },
        showIndicator: {
          type: Boolean,
          required: true
        },
        height: [String, Number],
        railBorderRadius: [String, Number],
        fillBorderRadius: [String, Number]
      },
      setup(props, {
        slots
      }) {
        const styleHeightRef = computed(() => {
          return formatLength(props.height);
        });
        const styleRailBorderRadiusRef = computed(() => {
          if (props.railBorderRadius !== void 0) {
            return formatLength(props.railBorderRadius);
          }
          if (props.height !== void 0) {
            return formatLength(props.height, {
              c: 0.5
            });
          }
          return "";
        });
        const styleFillBorderRadiusRef = computed(() => {
          if (props.fillBorderRadius !== void 0) {
            return formatLength(props.fillBorderRadius);
          }
          if (props.railBorderRadius !== void 0) {
            return formatLength(props.railBorderRadius);
          }
          if (props.height !== void 0) {
            return formatLength(props.height, {
              c: 0.5
            });
          }
          return "";
        });
        return () => {
          const {
            indicatorPlacement,
            railColor,
            railStyle,
            percentage,
            unit,
            indicatorTextColor,
            status,
            showIndicator,
            fillColor,
            processing,
            clsPrefix
          } = props;
          return h("div", {
            class: `${clsPrefix}-progress-content`,
            role: "none"
          }, h("div", {
            class: `${clsPrefix}-progress-graph`,
            "aria-hidden": true
          }, h("div", {
            class: [`${clsPrefix}-progress-graph-line`, {
              [`${clsPrefix}-progress-graph-line--indicator-${indicatorPlacement}`]: true
            }]
          }, h("div", {
            class: `${clsPrefix}-progress-graph-line-rail`,
            style: [{
              backgroundColor: railColor,
              height: styleHeightRef.value,
              borderRadius: styleRailBorderRadiusRef.value
            }, railStyle]
          }, h("div", {
            class: [`${clsPrefix}-progress-graph-line-fill`, processing && `${clsPrefix}-progress-graph-line-fill--processing`],
            style: {
              maxWidth: `${props.percentage}%`,
              backgroundColor: fillColor,
              height: styleHeightRef.value,
              lineHeight: styleHeightRef.value,
              borderRadius: styleFillBorderRadiusRef.value
            }
          }, indicatorPlacement === "inside" ? h("div", {
            class: `${clsPrefix}-progress-graph-line-indicator`,
            style: {
              color: indicatorTextColor
            }
          }, slots.default ? slots.default() : `${percentage}${unit}`) : null)))), showIndicator && indicatorPlacement === "outside" ? h("div", null, slots.default ? h("div", {
            class: `${clsPrefix}-progress-custom-content`,
            style: {
              color: indicatorTextColor
            },
            role: "none"
          }, slots.default()) : status === "default" ? h("div", {
            role: "none",
            class: `${clsPrefix}-progress-icon ${clsPrefix}-progress-icon--as-text`,
            style: {
              color: indicatorTextColor
            }
          }, percentage, unit) : h("div", {
            class: `${clsPrefix}-progress-icon`,
            "aria-hidden": true
          }, h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => iconMap$1[status]
          }))) : null);
        };
      }
    });
    const iconMap = {
      success: h(SuccessIcon, null),
      error: h(ErrorIcon, null),
      warning: h(WarningIcon, null),
      info: h(InfoIcon, null)
    };
    const Circle = /* @__PURE__ */ defineComponent({
      name: "ProgressCircle",
      props: {
        clsPrefix: {
          type: String,
          required: true
        },
        status: {
          type: String,
          required: true
        },
        strokeWidth: {
          type: Number,
          required: true
        },
        fillColor: String,
        railColor: String,
        railStyle: [String, Object],
        percentage: {
          type: Number,
          default: 0
        },
        offsetDegree: {
          type: Number,
          default: 0
        },
        showIndicator: {
          type: Boolean,
          required: true
        },
        indicatorTextColor: String,
        unit: String,
        viewBoxWidth: {
          type: Number,
          required: true
        },
        gapDegree: {
          type: Number,
          required: true
        },
        gapOffsetDegree: {
          type: Number,
          default: 0
        }
      },
      setup(props, {
        slots
      }) {
        function getPathStyles(percent, offsetDegree, strokeColor) {
          const {
            gapDegree,
            viewBoxWidth,
            strokeWidth
          } = props;
          const radius = 50;
          const beginPositionX = 0;
          const beginPositionY = radius;
          const endPositionX = 0;
          const endPositionY = 2 * radius;
          const centerX = 50 + strokeWidth / 2;
          const pathString = `M ${centerX},${centerX} m ${beginPositionX},${beginPositionY}
      a ${radius},${radius} 0 1 1 ${endPositionX},${-endPositionY}
      a ${radius},${radius} 0 1 1 ${-endPositionX},${endPositionY}`;
          const len2 = Math.PI * 2 * radius;
          const pathStyle = {
            stroke: strokeColor,
            strokeDasharray: `${percent / 100 * (len2 - gapDegree)}px ${viewBoxWidth * 8}px`,
            strokeDashoffset: `-${gapDegree / 2}px`,
            transformOrigin: offsetDegree ? "center" : void 0,
            transform: offsetDegree ? `rotate(${offsetDegree}deg)` : void 0
          };
          return {
            pathString,
            pathStyle
          };
        }
        return () => {
          const {
            fillColor,
            railColor,
            strokeWidth,
            offsetDegree,
            status,
            percentage,
            showIndicator,
            indicatorTextColor,
            unit,
            gapOffsetDegree,
            clsPrefix
          } = props;
          const {
            pathString: railPathString,
            pathStyle: railPathStyle
          } = getPathStyles(100, 0, railColor);
          const {
            pathString: fillPathString,
            pathStyle: fillPathStyle
          } = getPathStyles(percentage, offsetDegree, fillColor);
          const viewBoxSize = 100 + strokeWidth;
          return h("div", {
            class: `${clsPrefix}-progress-content`,
            role: "none"
          }, h("div", {
            class: `${clsPrefix}-progress-graph`,
            "aria-hidden": true
          }, h("div", {
            class: `${clsPrefix}-progress-graph-circle`,
            style: {
              transform: gapOffsetDegree ? `rotate(${gapOffsetDegree}deg)` : void 0
            }
          }, h("svg", {
            viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`
          }, h("g", null, h("path", {
            class: `${clsPrefix}-progress-graph-circle-rail`,
            d: railPathString,
            "stroke-width": strokeWidth,
            "stroke-linecap": "round",
            fill: "none",
            style: railPathStyle
          })), h("g", null, h("path", {
            class: [`${clsPrefix}-progress-graph-circle-fill`, percentage === 0 && `${clsPrefix}-progress-graph-circle-fill--empty`],
            d: fillPathString,
            "stroke-width": strokeWidth,
            "stroke-linecap": "round",
            fill: "none",
            style: fillPathStyle
          }))))), showIndicator ? h("div", null, slots.default ? h("div", {
            class: `${clsPrefix}-progress-custom-content`,
            role: "none"
          }, slots.default()) : status !== "default" ? h("div", {
            class: `${clsPrefix}-progress-icon`,
            "aria-hidden": true
          }, h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => iconMap[status]
          })) : h("div", {
            class: `${clsPrefix}-progress-text`,
            style: {
              color: indicatorTextColor
            },
            role: "none"
          }, h("span", {
            class: `${clsPrefix}-progress-text__percentage`
          }, percentage), h("span", {
            class: `${clsPrefix}-progress-text__unit`
          }, unit))) : null);
        };
      }
    });
    function circlePath(r, sw, vw = 100) {
      return `m ${vw / 2} ${vw / 2 - r} a ${r} ${r} 0 1 1 0 ${2 * r} a ${r} ${r} 0 1 1 0 -${2 * r}`;
    }
    const MultipleCircle = /* @__PURE__ */ defineComponent({
      name: "ProgressMultipleCircle",
      props: {
        clsPrefix: {
          type: String,
          required: true
        },
        viewBoxWidth: {
          type: Number,
          required: true
        },
        percentage: {
          type: Array,
          default: [0]
        },
        strokeWidth: {
          type: Number,
          required: true
        },
        circleGap: {
          type: Number,
          required: true
        },
        showIndicator: {
          type: Boolean,
          required: true
        },
        fillColor: {
          type: Array,
          default: () => []
        },
        railColor: {
          type: Array,
          default: () => []
        },
        railStyle: {
          type: Array,
          default: () => []
        }
      },
      setup(props, {
        slots
      }) {
        const strokeDasharrayRef = computed(() => {
          const strokeDasharrays = props.percentage.map((v, i) => `${Math.PI * v / 100 * (props.viewBoxWidth / 2 - props.strokeWidth / 2 * (1 + 2 * i) - props.circleGap * i) * 2}, ${props.viewBoxWidth * 8}`);
          return strokeDasharrays;
        });
        return () => {
          const {
            viewBoxWidth,
            strokeWidth,
            circleGap,
            showIndicator,
            fillColor,
            railColor,
            railStyle,
            percentage,
            clsPrefix
          } = props;
          return h("div", {
            class: `${clsPrefix}-progress-content`,
            role: "none"
          }, h("div", {
            class: `${clsPrefix}-progress-graph`,
            "aria-hidden": true
          }, h("div", {
            class: `${clsPrefix}-progress-graph-circle`
          }, h("svg", {
            viewBox: `0 0 ${viewBoxWidth} ${viewBoxWidth}`
          }, percentage.map((p2, index) => {
            return h("g", {
              key: index
            }, h("path", {
              class: `${clsPrefix}-progress-graph-circle-rail`,
              d: circlePath(viewBoxWidth / 2 - strokeWidth / 2 * (1 + 2 * index) - circleGap * index, strokeWidth, viewBoxWidth),
              "stroke-width": strokeWidth,
              "stroke-linecap": "round",
              fill: "none",
              style: [{
                strokeDashoffset: 0,
                stroke: railColor[index]
              }, railStyle[index]]
            }), h("path", {
              class: [`${clsPrefix}-progress-graph-circle-fill`, p2 === 0 && `${clsPrefix}-progress-graph-circle-fill--empty`],
              d: circlePath(viewBoxWidth / 2 - strokeWidth / 2 * (1 + 2 * index) - circleGap * index, strokeWidth, viewBoxWidth),
              "stroke-width": strokeWidth,
              "stroke-linecap": "round",
              fill: "none",
              style: {
                strokeDasharray: strokeDasharrayRef.value[index],
                strokeDashoffset: 0,
                stroke: fillColor[index]
              }
            }));
          })))), showIndicator && slots.default ? h("div", null, h("div", {
            class: `${clsPrefix}-progress-text`
          }, slots.default())) : null);
        };
      }
    });
    const progressProps = Object.assign(Object.assign({}, useTheme.props), {
      processing: Boolean,
      type: {
        type: String,
        default: "line"
      },
      gapDegree: Number,
      gapOffsetDegree: Number,
      status: {
        type: String,
        default: "default"
      },
      railColor: [String, Array],
      railStyle: [String, Array],
      color: [String, Array],
      viewBoxWidth: {
        type: Number,
        default: 100
      },
      strokeWidth: {
        type: Number,
        default: 7
      },
      percentage: [Number, Array],
      unit: {
        type: String,
        default: "%"
      },
      showIndicator: {
        type: Boolean,
        default: true
      },
      indicatorPosition: {
        type: String,
        default: "outside"
      },
      indicatorPlacement: {
        type: String,
        default: "outside"
      },
      indicatorTextColor: String,
      circleGap: {
        type: Number,
        default: 1
      },
      height: Number,
      borderRadius: [String, Number],
      fillBorderRadius: [String, Number],
      offsetDegree: Number
    });
    const NProgress = /* @__PURE__ */ defineComponent({
      name: "Progress",
      props: progressProps,
      setup(props) {
        const mergedIndicatorPlacementRef = computed(() => {
          return props.indicatorPlacement || props.indicatorPosition;
        });
        const gapDeg = computed(() => {
          if (props.gapDegree || props.gapDegree === 0) {
            return props.gapDegree;
          }
          if (props.type === "dashboard") {
            return 75;
          }
          return void 0;
        });
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Progress", "-progress", style$3, progressLight, props, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            status
          } = props;
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              fontSize: fontSize2,
              fontSizeCircle,
              railColor,
              railHeight,
              iconSizeCircle,
              iconSizeLine,
              textColorCircle,
              textColorLineInner,
              textColorLineOuter,
              lineBgProcessing,
              fontWeightCircle,
              [createKey("iconColor", status)]: iconColor,
              [createKey("fillColor", status)]: fillColor
            }
          } = themeRef.value;
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-fill-color": fillColor,
            "--n-font-size": fontSize2,
            "--n-font-size-circle": fontSizeCircle,
            "--n-font-weight-circle": fontWeightCircle,
            "--n-icon-color": iconColor,
            "--n-icon-size-circle": iconSizeCircle,
            "--n-icon-size-line": iconSizeLine,
            "--n-line-bg-processing": lineBgProcessing,
            "--n-rail-color": railColor,
            "--n-rail-height": railHeight,
            "--n-text-color-circle": textColorCircle,
            "--n-text-color-line-inner": textColorLineInner,
            "--n-text-color-line-outer": textColorLineOuter
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("progress", computed(() => props.status[0]), cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          mergedIndicatorPlacement: mergedIndicatorPlacementRef,
          gapDeg,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        const {
          type,
          cssVars,
          indicatorTextColor,
          showIndicator,
          status,
          railColor,
          railStyle,
          color,
          percentage,
          viewBoxWidth,
          strokeWidth,
          mergedIndicatorPlacement,
          unit,
          borderRadius,
          fillBorderRadius,
          height,
          processing,
          circleGap,
          mergedClsPrefix,
          gapDeg,
          gapOffsetDegree,
          themeClass,
          $slots,
          onRender
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h("div", {
          class: [themeClass, `${mergedClsPrefix}-progress`, `${mergedClsPrefix}-progress--${type}`, `${mergedClsPrefix}-progress--${status}`],
          style: cssVars,
          "aria-valuemax": 100,
          "aria-valuemin": 0,
          "aria-valuenow": percentage,
          role: type === "circle" || type === "line" || type === "dashboard" ? "progressbar" : "none"
        }, type === "circle" || type === "dashboard" ? h(Circle, {
          clsPrefix: mergedClsPrefix,
          status,
          showIndicator,
          indicatorTextColor,
          railColor,
          fillColor: color,
          railStyle,
          offsetDegree: this.offsetDegree,
          percentage,
          viewBoxWidth,
          strokeWidth,
          gapDegree: gapDeg === void 0 ? type === "dashboard" ? 75 : 0 : gapDeg,
          gapOffsetDegree,
          unit
        }, $slots) : type === "line" ? h(Line, {
          clsPrefix: mergedClsPrefix,
          status,
          showIndicator,
          indicatorTextColor,
          railColor,
          fillColor: color,
          railStyle,
          percentage,
          processing,
          indicatorPlacement: mergedIndicatorPlacement,
          unit,
          fillBorderRadius,
          railBorderRadius: borderRadius,
          height
        }, $slots) : type === "multiple-circle" ? h(MultipleCircle, {
          clsPrefix: mergedClsPrefix,
          strokeWidth,
          railColor,
          fillColor: color,
          railStyle,
          viewBoxWidth,
          percentage,
          showIndicator,
          circleGap
        }, $slots) : null);
      }
    });
    const qrcodeDark = {
      name: "QrCode",
      common: derived$1,
      self: (vars) => {
        return {
          borderRadius: vars.borderRadius
        };
      }
    };
    const skeletonDark = {
      name: "Skeleton",
      common: derived$1,
      self(vars) {
        const {
          heightSmall,
          heightMedium,
          heightLarge,
          borderRadius
        } = vars;
        return {
          color: "rgba(255, 255, 255, 0.12)",
          colorEnd: "rgba(255, 255, 255, 0.18)",
          borderRadius,
          heightSmall,
          heightMedium,
          heightLarge
        };
      }
    };
    const splitDark = {
      name: "Split",
      common: derived$1
    };
    const style$2 = cB("switch", `
 height: var(--n-height);
 min-width: var(--n-width);
 vertical-align: middle;
 user-select: none;
 -webkit-user-select: none;
 display: inline-flex;
 outline: none;
 justify-content: center;
 align-items: center;
`, [cE("children-placeholder", `
 height: var(--n-rail-height);
 display: flex;
 flex-direction: column;
 overflow: hidden;
 pointer-events: none;
 visibility: hidden;
 `), cE("rail-placeholder", `
 display: flex;
 flex-wrap: none;
 `), cE("button-placeholder", `
 width: calc(1.75 * var(--n-rail-height));
 height: var(--n-rail-height);
 `), cB("base-loading", `
 position: absolute;
 top: 50%;
 left: 50%;
 transform: translateX(-50%) translateY(-50%);
 font-size: calc(var(--n-button-width) - 4px);
 color: var(--n-loading-color);
 transition: color .3s var(--n-bezier);
 `, [iconSwitchTransition({
      left: "50%",
      top: "50%",
      originalTransform: "translateX(-50%) translateY(-50%)"
    })]), cE("checked, unchecked", `
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
 box-sizing: border-box;
 position: absolute;
 white-space: nowrap;
 top: 0;
 bottom: 0;
 display: flex;
 align-items: center;
 line-height: 1;
 `), cE("checked", `
 right: 0;
 padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));
 `), cE("unchecked", `
 left: 0;
 justify-content: flex-end;
 padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));
 `), c$1("&:focus", [cE("rail", `
 box-shadow: var(--n-box-shadow-focus);
 `)]), cM("round", [cE("rail", "border-radius: calc(var(--n-rail-height) / 2);", [cE("button", "border-radius: calc(var(--n-button-height) / 2);")])]), cNotM("disabled", [cNotM("icon", [cM("rubber-band", [cM("pressed", [cE("rail", [cE("button", "max-width: var(--n-button-width-pressed);")])]), cE("rail", [c$1("&:active", [cE("button", "max-width: var(--n-button-width-pressed);")])]), cM("active", [cM("pressed", [cE("rail", [cE("button", "left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]), cE("rail", [c$1("&:active", [cE("button", "left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]), cM("active", [cE("rail", [cE("button", "left: calc(100% - var(--n-button-width) - var(--n-offset))")])]), cE("rail", `
 overflow: hidden;
 height: var(--n-rail-height);
 min-width: var(--n-rail-width);
 border-radius: var(--n-rail-border-radius);
 cursor: pointer;
 position: relative;
 transition:
 opacity .3s var(--n-bezier),
 background .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier);
 background-color: var(--n-rail-color);
 `, [cE("button-icon", `
 color: var(--n-icon-color);
 transition: color .3s var(--n-bezier);
 font-size: calc(var(--n-button-height) - 4px);
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 display: flex;
 justify-content: center;
 align-items: center;
 line-height: 1;
 `, [iconSwitchTransition()]), cE("button", `
 align-items: center; 
 top: var(--n-offset);
 left: var(--n-offset);
 height: var(--n-button-height);
 width: var(--n-button-width-pressed);
 max-width: var(--n-button-width);
 border-radius: var(--n-button-border-radius);
 background-color: var(--n-button-color);
 box-shadow: var(--n-button-box-shadow);
 box-sizing: border-box;
 cursor: inherit;
 content: "";
 position: absolute;
 transition:
 background-color .3s var(--n-bezier),
 left .3s var(--n-bezier),
 opacity .3s var(--n-bezier),
 max-width .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier);
 `)]), cM("active", [cE("rail", "background-color: var(--n-rail-color-active);")]), cM("loading", [cE("rail", `
 cursor: wait;
 `)]), cM("disabled", [cE("rail", `
 cursor: not-allowed;
 opacity: .5;
 `)])]);
    const switchProps = Object.assign(Object.assign({}, useTheme.props), {
      size: {
        type: String,
        default: "medium"
      },
      value: {
        type: [String, Number, Boolean],
        default: void 0
      },
      loading: Boolean,
      defaultValue: {
        type: [String, Number, Boolean],
        default: false
      },
      disabled: {
        type: Boolean,
        default: void 0
      },
      round: {
        type: Boolean,
        default: true
      },
      "onUpdate:value": [Function, Array],
      onUpdateValue: [Function, Array],
      checkedValue: {
        type: [String, Number, Boolean],
        default: true
      },
      uncheckedValue: {
        type: [String, Number, Boolean],
        default: false
      },
      railStyle: Function,
      rubberBand: {
        type: Boolean,
        default: true
      },
      /** @deprecated */
      onChange: [Function, Array]
    });
    let supportCssMax;
    const NSwitch = /* @__PURE__ */ defineComponent({
      name: "Switch",
      props: switchProps,
      setup(props) {
        if (supportCssMax === void 0) {
          if (typeof CSS !== "undefined") {
            if (typeof CSS.supports !== "undefined") {
              supportCssMax = CSS.supports("width", "max(1px)");
            } else {
              supportCssMax = false;
            }
          } else {
            supportCssMax = true;
          }
        }
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Switch", "-switch", style$2, switchLight, props, mergedClsPrefixRef);
        const formItem = useFormItem(props);
        const {
          mergedSizeRef,
          mergedDisabledRef
        } = formItem;
        const uncontrolledValueRef = ref(props.defaultValue);
        const controlledValueRef = toRef(props, "value");
        const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
        const checkedRef = computed(() => {
          return mergedValueRef.value === props.checkedValue;
        });
        const pressedRef = ref(false);
        const focusedRef = ref(false);
        const mergedRailStyleRef = computed(() => {
          const {
            railStyle
          } = props;
          if (!railStyle) return void 0;
          return railStyle({
            focused: focusedRef.value,
            checked: checkedRef.value
          });
        });
        function doUpdateValue(value) {
          const {
            "onUpdate:value": _onUpdateValue,
            onChange,
            onUpdateValue
          } = props;
          const {
            nTriggerFormInput,
            nTriggerFormChange
          } = formItem;
          if (_onUpdateValue) call(_onUpdateValue, value);
          if (onUpdateValue) call(onUpdateValue, value);
          if (onChange) call(onChange, value);
          uncontrolledValueRef.value = value;
          nTriggerFormInput();
          nTriggerFormChange();
        }
        function doFocus() {
          const {
            nTriggerFormFocus
          } = formItem;
          nTriggerFormFocus();
        }
        function doBlur() {
          const {
            nTriggerFormBlur
          } = formItem;
          nTriggerFormBlur();
        }
        function handleClick2() {
          if (props.loading || mergedDisabledRef.value) return;
          if (mergedValueRef.value !== props.checkedValue) {
            doUpdateValue(props.checkedValue);
          } else {
            doUpdateValue(props.uncheckedValue);
          }
        }
        function handleFocus() {
          focusedRef.value = true;
          doFocus();
        }
        function handleBlur() {
          focusedRef.value = false;
          doBlur();
          pressedRef.value = false;
        }
        function handleKeyup(e) {
          if (props.loading || mergedDisabledRef.value) return;
          if (e.key === " ") {
            if (mergedValueRef.value !== props.checkedValue) {
              doUpdateValue(props.checkedValue);
            } else {
              doUpdateValue(props.uncheckedValue);
            }
            pressedRef.value = false;
          }
        }
        function handleKeydown(e) {
          if (props.loading || mergedDisabledRef.value) return;
          if (e.key === " ") {
            e.preventDefault();
            pressedRef.value = true;
          }
        }
        const cssVarsRef = computed(() => {
          const {
            value: size2
          } = mergedSizeRef;
          const {
            self: {
              opacityDisabled,
              railColor,
              railColorActive,
              buttonBoxShadow,
              buttonColor,
              boxShadowFocus,
              loadingColor,
              textColor,
              iconColor,
              [createKey("buttonHeight", size2)]: buttonHeight,
              [createKey("buttonWidth", size2)]: buttonWidth,
              [createKey("buttonWidthPressed", size2)]: buttonWidthPressed,
              [createKey("railHeight", size2)]: railHeight,
              [createKey("railWidth", size2)]: railWidth,
              [createKey("railBorderRadius", size2)]: railBorderRadius,
              [createKey("buttonBorderRadius", size2)]: buttonBorderRadius
            },
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            }
          } = themeRef.value;
          let offset;
          let height;
          let width;
          if (supportCssMax) {
            offset = `calc((${railHeight} - ${buttonHeight}) / 2)`;
            height = `max(${railHeight}, ${buttonHeight})`;
            width = `max(${railWidth}, calc(${railWidth} + ${buttonHeight} - ${railHeight}))`;
          } else {
            offset = pxfy((depx(railHeight) - depx(buttonHeight)) / 2);
            height = pxfy(Math.max(depx(railHeight), depx(buttonHeight)));
            width = depx(railHeight) > depx(buttonHeight) ? railWidth : pxfy(depx(railWidth) + depx(buttonHeight) - depx(railHeight));
          }
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-button-border-radius": buttonBorderRadius,
            "--n-button-box-shadow": buttonBoxShadow,
            "--n-button-color": buttonColor,
            "--n-button-width": buttonWidth,
            "--n-button-width-pressed": buttonWidthPressed,
            "--n-button-height": buttonHeight,
            "--n-height": height,
            "--n-offset": offset,
            "--n-opacity-disabled": opacityDisabled,
            "--n-rail-border-radius": railBorderRadius,
            "--n-rail-color": railColor,
            "--n-rail-color-active": railColorActive,
            "--n-rail-height": railHeight,
            "--n-rail-width": railWidth,
            "--n-width": width,
            "--n-box-shadow-focus": boxShadowFocus,
            "--n-loading-color": loadingColor,
            "--n-text-color": textColor,
            "--n-icon-color": iconColor
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("switch", computed(() => {
          return mergedSizeRef.value[0];
        }), cssVarsRef, props) : void 0;
        return {
          handleClick: handleClick2,
          handleBlur,
          handleFocus,
          handleKeyup,
          handleKeydown,
          mergedRailStyle: mergedRailStyleRef,
          pressed: pressedRef,
          mergedClsPrefix: mergedClsPrefixRef,
          mergedValue: mergedValueRef,
          checked: checkedRef,
          mergedDisabled: mergedDisabledRef,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        const {
          mergedClsPrefix,
          mergedDisabled,
          checked,
          mergedRailStyle,
          onRender,
          $slots
        } = this;
        onRender === null || onRender === void 0 ? void 0 : onRender();
        const {
          checked: checkedSlot,
          unchecked: uncheckedSlot,
          icon: iconSlot,
          "checked-icon": checkedIconSlot,
          "unchecked-icon": uncheckedIconSlot
        } = $slots;
        const hasIcon = !(isSlotEmpty(iconSlot) && isSlotEmpty(checkedIconSlot) && isSlotEmpty(uncheckedIconSlot));
        return h("div", {
          role: "switch",
          "aria-checked": checked,
          class: [`${mergedClsPrefix}-switch`, this.themeClass, hasIcon && `${mergedClsPrefix}-switch--icon`, checked && `${mergedClsPrefix}-switch--active`, mergedDisabled && `${mergedClsPrefix}-switch--disabled`, this.round && `${mergedClsPrefix}-switch--round`, this.loading && `${mergedClsPrefix}-switch--loading`, this.pressed && `${mergedClsPrefix}-switch--pressed`, this.rubberBand && `${mergedClsPrefix}-switch--rubber-band`],
          tabindex: !this.mergedDisabled ? 0 : void 0,
          style: this.cssVars,
          onClick: this.handleClick,
          onFocus: this.handleFocus,
          onBlur: this.handleBlur,
          onKeyup: this.handleKeyup,
          onKeydown: this.handleKeydown
        }, h("div", {
          class: `${mergedClsPrefix}-switch__rail`,
          "aria-hidden": "true",
          style: mergedRailStyle
        }, resolveWrappedSlot(checkedSlot, (checkedSlotChildren) => resolveWrappedSlot(uncheckedSlot, (uncheckedSlotChildren) => {
          if (checkedSlotChildren || uncheckedSlotChildren) {
            return h("div", {
              "aria-hidden": true,
              class: `${mergedClsPrefix}-switch__children-placeholder`
            }, h("div", {
              class: `${mergedClsPrefix}-switch__rail-placeholder`
            }, h("div", {
              class: `${mergedClsPrefix}-switch__button-placeholder`
            }), checkedSlotChildren), h("div", {
              class: `${mergedClsPrefix}-switch__rail-placeholder`
            }, h("div", {
              class: `${mergedClsPrefix}-switch__button-placeholder`
            }), uncheckedSlotChildren));
          }
          return null;
        })), h("div", {
          class: `${mergedClsPrefix}-switch__button`
        }, resolveWrappedSlot(iconSlot, (icon) => resolveWrappedSlot(checkedIconSlot, (checkedIcon) => resolveWrappedSlot(uncheckedIconSlot, (uncheckedIcon) => {
          return h(NIconSwitchTransition, null, {
            default: () => this.loading ? h(NBaseLoading, {
              key: "loading",
              clsPrefix: mergedClsPrefix,
              strokeWidth: 20
            }) : this.checked && (checkedIcon || icon) ? h("div", {
              class: `${mergedClsPrefix}-switch__button-icon`,
              key: checkedIcon ? "checked-icon" : "icon"
            }, checkedIcon || icon) : !this.checked && (uncheckedIcon || icon) ? h("div", {
              class: `${mergedClsPrefix}-switch__button-icon`,
              key: uncheckedIcon ? "unchecked-icon" : "icon"
            }, uncheckedIcon || icon) : null
          });
        }))), resolveWrappedSlot(checkedSlot, (children) => children && h("div", {
          key: "checked",
          class: `${mergedClsPrefix}-switch__checked`
        }, children)), resolveWrappedSlot(uncheckedSlot, (children) => children && h("div", {
          key: "unchecked",
          class: `${mergedClsPrefix}-switch__unchecked`
        }, children)))));
      }
    });
    const style$1 = cB("text", `
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
`, [cM("strong", `
 font-weight: var(--n-font-weight-strong);
 `), cM("italic", {
      fontStyle: "italic"
    }), cM("underline", {
      textDecoration: "underline"
    }), cM("code", `
 line-height: 1.4;
 display: inline-block;
 font-family: var(--n-font-famliy-mono);
 transition: 
 color .3s var(--n-bezier),
 border-color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 box-sizing: border-box;
 padding: .05em .35em 0 .35em;
 border-radius: var(--n-code-border-radius);
 font-size: .9em;
 color: var(--n-code-text-color);
 background-color: var(--n-code-color);
 border: var(--n-code-border);
 `)]);
    const textProps = Object.assign(Object.assign({}, useTheme.props), {
      code: Boolean,
      type: {
        type: String,
        default: "default"
      },
      delete: Boolean,
      strong: Boolean,
      italic: Boolean,
      underline: Boolean,
      depth: [String, Number],
      tag: String,
      // deprecated
      as: {
        type: String,
        validator: () => {
          return true;
        },
        default: void 0
      }
    });
    const NText = /* @__PURE__ */ defineComponent({
      name: "Text",
      props: textProps,
      setup(props) {
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Typography", "-text", style$1, typographyLight, props, mergedClsPrefixRef);
        const cssVarsRef = computed(() => {
          const {
            depth,
            type
          } = props;
          const textColorKey = type === "default" ? depth === void 0 ? "textColor" : `textColor${depth}Depth` : createKey("textColor", type);
          const {
            common: {
              fontWeightStrong,
              fontFamilyMono,
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              codeTextColor,
              codeBorderRadius,
              codeColor,
              codeBorder,
              [textColorKey]: textColor
            }
          } = themeRef.value;
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-text-color": textColor,
            "--n-font-weight-strong": fontWeightStrong,
            "--n-font-famliy-mono": fontFamilyMono,
            "--n-code-border-radius": codeBorderRadius,
            "--n-code-text-color": codeTextColor,
            "--n-code-color": codeColor,
            "--n-code-border": codeBorder
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("text", computed(() => `${props.type[0]}${props.depth || ""}`), cssVarsRef, props) : void 0;
        return {
          mergedClsPrefix: mergedClsPrefixRef,
          compitableTag: useCompitable(props, ["as", "tag"]),
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
        };
      },
      render() {
        var _a, _b, _c;
        const {
          mergedClsPrefix
        } = this;
        (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
        const textClass = [`${mergedClsPrefix}-text`, this.themeClass, {
          [`${mergedClsPrefix}-text--code`]: this.code,
          [`${mergedClsPrefix}-text--delete`]: this.delete,
          [`${mergedClsPrefix}-text--strong`]: this.strong,
          [`${mergedClsPrefix}-text--italic`]: this.italic,
          [`${mergedClsPrefix}-text--underline`]: this.underline
        }];
        const children = (_c = (_b = this.$slots).default) === null || _c === void 0 ? void 0 : _c.call(_b);
        return this.code ? h("code", {
          class: textClass,
          style: this.cssVars
        }, this.delete ? h("del", null, children) : children) : this.delete ? h("del", {
          class: textClass,
          style: this.cssVars
        }, children) : h(this.compitableTag || "span", {
          class: textClass,
          style: this.cssVars
        }, children);
      }
    });
    const uploadInjectionKey = createInjectionKey("n-upload");
    const uploadDraggerKey = "__UPLOAD_DRAGGER__";
    const NUploadDragger = /* @__PURE__ */ defineComponent({
      name: "UploadDragger",
      [uploadDraggerKey]: true,
      setup(_, {
        slots
      }) {
        const NUpload2 = inject(uploadInjectionKey, null);
        if (!NUpload2) {
          throwError("upload-dragger", "`n-upload-dragger` must be placed inside `n-upload`.");
        }
        return () => {
          const {
            mergedClsPrefixRef: {
              value: mergedClsPrefix
            },
            mergedDisabledRef: {
              value: mergedDisabled
            },
            maxReachedRef: {
              value: maxReached
            }
          } = NUpload2;
          return h("div", {
            class: [`${mergedClsPrefix}-upload-dragger`, (mergedDisabled || maxReached) && `${mergedClsPrefix}-upload-dragger--disabled`]
          }, slots);
        };
      }
    });
    var __awaiter$2 = function(thisArg, _arguments, P, generator) {
      function adopt(value) {
        return value instanceof P ? value : new P(function(resolve2) {
          resolve2(value);
        });
      }
      return new (P || (P = Promise))(function(resolve2, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e) {
            reject(e);
          }
        }
        function step(result) {
          result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    };
    function isImageFileType(type) {
      return type.includes("image/");
    }
    function getExtname(url = "") {
      const temp = url.split("/");
      const filename = temp[temp.length - 1];
      const filenameWithoutSuffix = filename.split(/#|\?/)[0];
      return (/\.[^./\\]*$/.exec(filenameWithoutSuffix) || [""])[0];
    }
    const imageExtensionRegex = /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i;
    const isImageFile = (file) => {
      if (file.type) {
        return isImageFileType(file.type);
      }
      const fileNameExtension = getExtname(file.name || "");
      if (imageExtensionRegex.test(fileNameExtension)) {
        return true;
      }
      const url = file.thumbnailUrl || file.url || "";
      const urlExtension = getExtname(url);
      if (/^data:image\//.test(url) || imageExtensionRegex.test(urlExtension)) {
        return true;
      }
      return false;
    };
    function createImageDataUrl(file) {
      return __awaiter$2(this, void 0, void 0, function* () {
        return yield new Promise((resolve2) => {
          if (!file.type || !isImageFileType(file.type)) {
            resolve2("");
            return;
          }
          resolve2(window.URL.createObjectURL(file));
        });
      });
    }
    const environmentSupportFile = isBrowser$2 && window.FileReader && window.File;
    function isFileSystemDirectoryEntry(item) {
      return item.isDirectory;
    }
    function isFileSystemFileEntry(item) {
      return item.isFile;
    }
    function getFilesFromEntries(entries, directory) {
      return __awaiter$2(this, void 0, void 0, function* () {
        const fileAndEntries = [];
        function _getFilesFromEntries(entries2) {
          return __awaiter$2(this, void 0, void 0, function* () {
            for (const entry of entries2) {
              if (!entry) continue;
              if (directory && isFileSystemDirectoryEntry(entry)) {
                const directoryReader = entry.createReader();
                let allEntries = [];
                let readEntries;
                try {
                  do {
                    readEntries = yield new Promise((resolve2, reject) => {
                      directoryReader.readEntries(resolve2, reject);
                    });
                    allEntries = allEntries.concat(readEntries);
                  } while (readEntries.length > 0);
                } catch (e) {
                  error("upload", "error happens when handling directory upload", e);
                }
                yield _getFilesFromEntries(allEntries);
              } else if (isFileSystemFileEntry(entry)) {
                try {
                  const file = yield new Promise((resolve2, reject) => {
                    entry.file(resolve2, reject);
                  });
                  fileAndEntries.push({
                    file,
                    entry,
                    source: "dnd"
                  });
                } catch (e) {
                  error("upload", "error happens when handling file upload", e);
                }
              }
            }
          });
        }
        yield _getFilesFromEntries(entries);
        return fileAndEntries;
      });
    }
    function createSettledFileInfo(fileInfo) {
      const {
        id,
        name,
        percentage,
        status,
        url,
        file,
        thumbnailUrl,
        type,
        fullPath,
        batchId
      } = fileInfo;
      return {
        id,
        name,
        percentage: percentage !== null && percentage !== void 0 ? percentage : null,
        status,
        url: url !== null && url !== void 0 ? url : null,
        file: file !== null && file !== void 0 ? file : null,
        thumbnailUrl: thumbnailUrl !== null && thumbnailUrl !== void 0 ? thumbnailUrl : null,
        type: type !== null && type !== void 0 ? type : null,
        fullPath: fullPath !== null && fullPath !== void 0 ? fullPath : null,
        batchId: batchId !== null && batchId !== void 0 ? batchId : null
      };
    }
    function matchType(name, mimeType, accept) {
      name = name.toLowerCase();
      mimeType = mimeType.toLocaleLowerCase();
      accept = accept.toLocaleLowerCase();
      const acceptAtoms = accept.split(",").map((acceptAtom) => acceptAtom.trim()).filter(Boolean);
      return acceptAtoms.some((acceptAtom) => {
        if (acceptAtom.startsWith(".")) {
          if (name.endsWith(acceptAtom)) return true;
        } else if (acceptAtom.includes("/")) {
          const [type, subtype] = mimeType.split("/");
          const [acceptType, acceptSubtype] = acceptAtom.split("/");
          if (acceptType === "*" || type && acceptType && acceptType === type) {
            if (acceptSubtype === "*" || subtype && acceptSubtype && acceptSubtype === subtype) {
              return true;
            }
          }
        } else {
          return true;
        }
        return false;
      });
    }
    const NUploadTrigger = /* @__PURE__ */ defineComponent({
      name: "UploadTrigger",
      props: {
        abstract: Boolean
      },
      setup(props, {
        slots
      }) {
        const NUpload2 = inject(uploadInjectionKey, null);
        if (!NUpload2) {
          throwError("upload-trigger", "`n-upload-trigger` must be placed inside `n-upload`.");
        }
        const {
          mergedClsPrefixRef,
          mergedDisabledRef,
          maxReachedRef,
          listTypeRef,
          dragOverRef,
          openOpenFileDialog,
          draggerInsideRef,
          handleFileAddition,
          mergedDirectoryDndRef,
          triggerClassRef,
          triggerStyleRef
        } = NUpload2;
        const isImageCardTypeRef = computed(() => listTypeRef.value === "image-card");
        function handleTriggerClick() {
          if (mergedDisabledRef.value || maxReachedRef.value) return;
          openOpenFileDialog();
        }
        function handleTriggerDragOver(e) {
          e.preventDefault();
          dragOverRef.value = true;
        }
        function handleTriggerDragEnter(e) {
          e.preventDefault();
          dragOverRef.value = true;
        }
        function handleTriggerDragLeave(e) {
          e.preventDefault();
          dragOverRef.value = false;
        }
        function handleTriggerDrop(e) {
          var _a;
          e.preventDefault();
          if (!draggerInsideRef.value || mergedDisabledRef.value || maxReachedRef.value) {
            dragOverRef.value = false;
            return;
          }
          const dataTransferItems = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.items;
          if (dataTransferItems === null || dataTransferItems === void 0 ? void 0 : dataTransferItems.length) {
            void getFilesFromEntries(Array.from(dataTransferItems).map((item) => item.webkitGetAsEntry()), mergedDirectoryDndRef.value).then((files) => {
              handleFileAddition(files);
            }).finally(() => {
              dragOverRef.value = false;
            });
          } else {
            dragOverRef.value = false;
          }
        }
        return () => {
          var _a;
          const {
            value: mergedClsPrefix
          } = mergedClsPrefixRef;
          return props.abstract ? (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, {
            handleClick: handleTriggerClick,
            handleDrop: handleTriggerDrop,
            handleDragOver: handleTriggerDragOver,
            handleDragEnter: handleTriggerDragEnter,
            handleDragLeave: handleTriggerDragLeave
          }) : h("div", {
            class: [`${mergedClsPrefix}-upload-trigger`, (mergedDisabledRef.value || maxReachedRef.value) && `${mergedClsPrefix}-upload-trigger--disabled`, isImageCardTypeRef.value && `${mergedClsPrefix}-upload-trigger--image-card`, triggerClassRef.value],
            style: triggerStyleRef.value,
            onClick: handleTriggerClick,
            onDrop: handleTriggerDrop,
            onDragover: handleTriggerDragOver,
            onDragenter: handleTriggerDragEnter,
            onDragleave: handleTriggerDragLeave
          }, isImageCardTypeRef.value ? h(NUploadDragger, null, {
            default: () => resolveSlot(slots.default, () => [h(NBaseIcon, {
              clsPrefix: mergedClsPrefix
            }, {
              default: () => h(AddIcon, null)
            })])
          }) : slots);
        };
      }
    });
    const NUploadProgress = /* @__PURE__ */ defineComponent({
      name: "UploadProgress",
      props: {
        show: Boolean,
        percentage: {
          type: Number,
          required: true
        },
        status: {
          type: String,
          required: true
        }
      },
      setup() {
        const NUpload2 = inject(uploadInjectionKey);
        return {
          mergedTheme: NUpload2.mergedThemeRef
        };
      },
      render() {
        return h(NFadeInExpandTransition, null, {
          default: () => this.show ? h(NProgress, {
            type: "line",
            showIndicator: false,
            percentage: this.percentage,
            status: this.status,
            height: 2,
            theme: this.mergedTheme.peers.Progress,
            themeOverrides: this.mergedTheme.peerOverrides.Progress
          }) : null
        });
      }
    });
    const imageIcon = h("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 28 28"
    }, h("g", {
      fill: "none"
    }, h("path", {
      d: "M21.75 3A3.25 3.25 0 0 1 25 6.25v15.5A3.25 3.25 0 0 1 21.75 25H6.25A3.25 3.25 0 0 1 3 21.75V6.25A3.25 3.25 0 0 1 6.25 3h15.5zm.583 20.4l-7.807-7.68a.75.75 0 0 0-.968-.07l-.084.07l-7.808 7.68c.183.065.38.1.584.1h15.5c.204 0 .4-.035.583-.1l-7.807-7.68l7.807 7.68zM21.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v15.5c0 .208.036.408.103.593l7.82-7.692a2.25 2.25 0 0 1 3.026-.117l.129.117l7.82 7.692c.066-.185.102-.385.102-.593V6.25a1.75 1.75 0 0 0-1.75-1.75zm-3.25 3a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zm0 1.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2z",
      fill: "currentColor"
    })));
    const documentIcon = h("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 28 28"
    }, h("g", {
      fill: "none"
    }, h("path", {
      d: "M6.4 2A2.4 2.4 0 0 0 4 4.4v19.2A2.4 2.4 0 0 0 6.4 26h15.2a2.4 2.4 0 0 0 2.4-2.4V11.578c0-.729-.29-1.428-.805-1.944l-6.931-6.931A2.4 2.4 0 0 0 14.567 2H6.4zm-.9 2.4a.9.9 0 0 1 .9-.9H14V10a2 2 0 0 0 2 2h6.5v11.6a.9.9 0 0 1-.9.9H6.4a.9.9 0 0 1-.9-.9V4.4zm16.44 6.1H16a.5.5 0 0 1-.5-.5V4.06l6.44 6.44z",
      fill: "currentColor"
    })));
    var __awaiter$1 = function(thisArg, _arguments, P, generator) {
      function adopt(value) {
        return value instanceof P ? value : new P(function(resolve2) {
          resolve2(value);
        });
      }
      return new (P || (P = Promise))(function(resolve2, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e) {
            reject(e);
          }
        }
        function step(result) {
          result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    };
    const buttonThemeOverrides = {
      paddingMedium: "0 3px",
      heightMedium: "24px",
      iconSizeMedium: "18px"
    };
    const NUploadFile = /* @__PURE__ */ defineComponent({
      name: "UploadFile",
      props: {
        clsPrefix: {
          type: String,
          required: true
        },
        file: {
          type: Object,
          required: true
        },
        listType: {
          type: String,
          required: true
        },
        index: {
          type: Number,
          required: true
        }
      },
      setup(props) {
        const NUpload2 = inject(uploadInjectionKey);
        const imageRef = ref(null);
        const thumbnailUrlRef = ref("");
        const progressStatusRef = computed(() => {
          const {
            file
          } = props;
          if (file.status === "finished") return "success";
          if (file.status === "error") return "error";
          return "info";
        });
        const buttonTypeRef = computed(() => {
          const {
            file
          } = props;
          if (file.status === "error") return "error";
          return void 0;
        });
        const showProgressRef = computed(() => {
          const {
            file
          } = props;
          return file.status === "uploading";
        });
        const showCancelButtonRef = computed(() => {
          if (!NUpload2.showCancelButtonRef.value) return false;
          const {
            file
          } = props;
          return ["uploading", "pending", "error"].includes(file.status);
        });
        const showRemoveButtonRef = computed(() => {
          if (!NUpload2.showRemoveButtonRef.value) return false;
          const {
            file
          } = props;
          return ["finished"].includes(file.status);
        });
        const showDownloadButtonRef = computed(() => {
          if (!NUpload2.showDownloadButtonRef.value) return false;
          const {
            file
          } = props;
          return ["finished"].includes(file.status);
        });
        const showRetryButtonRef = computed(() => {
          if (!NUpload2.showRetryButtonRef.value) return false;
          const {
            file
          } = props;
          return ["error"].includes(file.status);
        });
        const mergedThumbnailUrlRef = useMemo(() => {
          return thumbnailUrlRef.value || props.file.thumbnailUrl || props.file.url;
        });
        const showPreviewButtonRef = computed(() => {
          if (!NUpload2.showPreviewButtonRef.value) return false;
          const {
            file: {
              status
            },
            listType
          } = props;
          return ["finished"].includes(status) && mergedThumbnailUrlRef.value && listType === "image-card";
        });
        function handleRetryClick() {
          return __awaiter$1(this, void 0, void 0, function* () {
            const onRetry = NUpload2.onRetryRef.value;
            if (onRetry) {
              const onRetryReturn = yield onRetry({
                file: props.file
              });
              if (onRetryReturn === false) {
                return;
              }
            }
            NUpload2.submit(props.file.id);
          });
        }
        function handleRemoveOrCancelClick(e) {
          e.preventDefault();
          const {
            file
          } = props;
          if (["finished", "pending", "error"].includes(file.status)) {
            handleRemove(file);
          } else if (["uploading"].includes(file.status)) {
            handleAbort(file);
          } else {
            warn$3("upload", "The button clicked type is unknown.");
          }
        }
        function handleDownloadClick(e) {
          e.preventDefault();
          handleDownload(props.file);
        }
        function handleRemove(file) {
          const {
            xhrMap,
            doChange,
            onRemoveRef: {
              value: onRemove
            },
            mergedFileListRef: {
              value: mergedFileList
            }
          } = NUpload2;
          void Promise.resolve(onRemove ? onRemove({
            file: Object.assign({}, file),
            fileList: mergedFileList,
            index: props.index
          }) : true).then((result) => {
            if (result === false) return;
            const fileAfterChange = Object.assign({}, file, {
              status: "removed"
            });
            xhrMap.delete(file.id);
            doChange(fileAfterChange, void 0, {
              remove: true
            });
          });
        }
        function handleDownload(file) {
          const {
            onDownloadRef: {
              value: onDownload
            }
          } = NUpload2;
          void Promise.resolve(onDownload ? onDownload(Object.assign({}, file)) : true).then((res) => {
            if (res !== false) {
              download(file.url, file.name);
            }
          });
        }
        function handleAbort(file) {
          const {
            xhrMap
          } = NUpload2;
          const xhr = xhrMap.get(file.id);
          xhr === null || xhr === void 0 ? void 0 : xhr.abort();
          handleRemove(Object.assign({}, file));
        }
        function handlePreviewClick(e) {
          const {
            onPreviewRef: {
              value: onPreview
            }
          } = NUpload2;
          if (onPreview) {
            onPreview(props.file, {
              event: e
            });
          } else if (props.listType === "image-card") {
            const {
              value
            } = imageRef;
            if (!value) return;
            value.click();
          }
        }
        const deriveFileThumbnailUrl = () => __awaiter$1(this, void 0, void 0, function* () {
          const {
            listType
          } = props;
          if (listType !== "image" && listType !== "image-card") {
            return;
          }
          if (NUpload2.shouldUseThumbnailUrlRef.value(props.file)) {
            thumbnailUrlRef.value = yield NUpload2.getFileThumbnailUrlResolver(props.file);
          }
        });
        watchEffect(() => {
          void deriveFileThumbnailUrl();
        });
        return {
          mergedTheme: NUpload2.mergedThemeRef,
          progressStatus: progressStatusRef,
          buttonType: buttonTypeRef,
          showProgress: showProgressRef,
          disabled: NUpload2.mergedDisabledRef,
          showCancelButton: showCancelButtonRef,
          showRemoveButton: showRemoveButtonRef,
          showDownloadButton: showDownloadButtonRef,
          showRetryButton: showRetryButtonRef,
          showPreviewButton: showPreviewButtonRef,
          mergedThumbnailUrl: mergedThumbnailUrlRef,
          shouldUseThumbnailUrl: NUpload2.shouldUseThumbnailUrlRef,
          renderIcon: NUpload2.renderIconRef,
          imageRef,
          handleRemoveOrCancelClick,
          handleDownloadClick,
          handleRetryClick,
          handlePreviewClick
        };
      },
      render() {
        const {
          clsPrefix,
          mergedTheme,
          listType,
          file,
          renderIcon
        } = this;
        let icon;
        const isImageType = listType === "image";
        const isImageCardType = listType === "image-card";
        if (isImageType || isImageCardType) {
          icon = !this.shouldUseThumbnailUrl(file) || !this.mergedThumbnailUrl ? h("span", {
            class: `${clsPrefix}-upload-file-info__thumbnail`
          }, renderIcon ? renderIcon(file) : isImageFile(file) ? h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => imageIcon
          }) : h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => documentIcon
          })) : h("a", {
            rel: "noopener noreferer",
            target: "_blank",
            href: file.url || void 0,
            class: `${clsPrefix}-upload-file-info__thumbnail`,
            onClick: this.handlePreviewClick
          }, listType === "image-card" ? h(NImage, {
            src: this.mergedThumbnailUrl || void 0,
            previewSrc: file.url || void 0,
            alt: file.name,
            ref: "imageRef"
          }) : h("img", {
            src: this.mergedThumbnailUrl || void 0,
            alt: file.name
          }));
        } else {
          icon = h("span", {
            class: `${clsPrefix}-upload-file-info__thumbnail`
          }, renderIcon ? renderIcon(file) : h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => h(AttachIcon, null)
          }));
        }
        const progress = h(NUploadProgress, {
          show: this.showProgress,
          percentage: file.percentage || 0,
          status: this.progressStatus
        });
        const showName = listType === "text" || listType === "image";
        return h("div", {
          class: [`${clsPrefix}-upload-file`, `${clsPrefix}-upload-file--${this.progressStatus}-status`, file.url && file.status !== "error" && listType !== "image-card" && `${clsPrefix}-upload-file--with-url`, `${clsPrefix}-upload-file--${listType}-type`]
        }, h("div", {
          class: `${clsPrefix}-upload-file-info`
        }, icon, h("div", {
          class: `${clsPrefix}-upload-file-info__name`
        }, showName && (file.url && file.status !== "error" ? h("a", {
          rel: "noopener noreferer",
          target: "_blank",
          href: file.url || void 0,
          onClick: this.handlePreviewClick
        }, file.name) : h("span", {
          onClick: this.handlePreviewClick
        }, file.name)), isImageType && progress), h("div", {
          class: [`${clsPrefix}-upload-file-info__action`, `${clsPrefix}-upload-file-info__action--${listType}-type`]
        }, this.showPreviewButton ? h(Button, {
          key: "preview",
          quaternary: true,
          type: this.buttonType,
          onClick: this.handlePreviewClick,
          theme: mergedTheme.peers.Button,
          themeOverrides: mergedTheme.peerOverrides.Button,
          builtinThemeOverrides: buttonThemeOverrides
        }, {
          icon: () => h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => h(EyeIcon, null)
          })
        }) : null, (this.showRemoveButton || this.showCancelButton) && !this.disabled && h(Button, {
          key: "cancelOrTrash",
          theme: mergedTheme.peers.Button,
          themeOverrides: mergedTheme.peerOverrides.Button,
          quaternary: true,
          builtinThemeOverrides: buttonThemeOverrides,
          type: this.buttonType,
          onClick: this.handleRemoveOrCancelClick
        }, {
          icon: () => h(NIconSwitchTransition, null, {
            default: () => this.showRemoveButton ? h(NBaseIcon, {
              clsPrefix,
              key: "trash"
            }, {
              default: () => h(TrashIcon, null)
            }) : h(NBaseIcon, {
              clsPrefix,
              key: "cancel"
            }, {
              default: () => h(CancelIcon, null)
            })
          })
        }), this.showRetryButton && !this.disabled && h(Button, {
          key: "retry",
          quaternary: true,
          type: this.buttonType,
          onClick: this.handleRetryClick,
          theme: mergedTheme.peers.Button,
          themeOverrides: mergedTheme.peerOverrides.Button,
          builtinThemeOverrides: buttonThemeOverrides
        }, {
          icon: () => h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => h(RetryIcon, null)
          })
        }), this.showDownloadButton ? h(Button, {
          key: "download",
          quaternary: true,
          type: this.buttonType,
          onClick: this.handleDownloadClick,
          theme: mergedTheme.peers.Button,
          themeOverrides: mergedTheme.peerOverrides.Button,
          builtinThemeOverrides: buttonThemeOverrides
        }, {
          icon: () => h(NBaseIcon, {
            clsPrefix
          }, {
            default: () => h(DownloadIcon, null)
          })
        }) : null)), !isImageType && progress);
      }
    });
    const NUploadFileList = /* @__PURE__ */ defineComponent({
      name: "UploadFileList",
      setup(_, {
        slots
      }) {
        const NUpload2 = inject(uploadInjectionKey, null);
        if (!NUpload2) {
          throwError("upload-file-list", "`n-upload-file-list` must be placed inside `n-upload`.");
        }
        const {
          abstractRef,
          mergedClsPrefixRef,
          listTypeRef,
          mergedFileListRef,
          fileListClassRef,
          fileListStyleRef,
          cssVarsRef,
          themeClassRef,
          maxReachedRef,
          showTriggerRef,
          imageGroupPropsRef
        } = NUpload2;
        const isImageCardTypeRef = computed(() => listTypeRef.value === "image-card");
        const renderFileList = () => mergedFileListRef.value.map((file, index) => h(NUploadFile, {
          clsPrefix: mergedClsPrefixRef.value,
          key: file.id,
          file,
          index,
          listType: listTypeRef.value
        }));
        const renderUploadFileList = () => isImageCardTypeRef.value ? h(NImageGroup, Object.assign({}, imageGroupPropsRef.value), {
          default: renderFileList
        }) : h(NFadeInExpandTransition, {
          group: true
        }, {
          default: renderFileList
        });
        return () => {
          const {
            value: mergedClsPrefix
          } = mergedClsPrefixRef;
          const {
            value: abstract
          } = abstractRef;
          return h("div", {
            class: [`${mergedClsPrefix}-upload-file-list`, isImageCardTypeRef.value && `${mergedClsPrefix}-upload-file-list--grid`, abstract ? themeClassRef === null || themeClassRef === void 0 ? void 0 : themeClassRef.value : void 0, fileListClassRef.value],
            style: [abstract && cssVarsRef ? cssVarsRef.value : "", fileListStyleRef.value]
          }, renderUploadFileList(), showTriggerRef.value && !maxReachedRef.value && isImageCardTypeRef.value && h(NUploadTrigger, null, slots));
        };
      }
    });
    const style = c$1([cB("upload", "width: 100%;", [cM("dragger-inside", [cB("upload-trigger", `
 display: block;
 `)]), cM("drag-over", [cB("upload-dragger", `
 border: var(--n-dragger-border-hover);
 `)])]), cB("upload-dragger", `
 cursor: pointer;
 box-sizing: border-box;
 width: 100%;
 text-align: center;
 border-radius: var(--n-border-radius);
 padding: 24px;
 opacity: 1;
 transition:
 opacity .3s var(--n-bezier),
 border-color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 background-color: var(--n-dragger-color);
 border: var(--n-dragger-border);
 `, [c$1("&:hover", `
 border: var(--n-dragger-border-hover);
 `), cM("disabled", `
 cursor: not-allowed;
 `)]), cB("upload-trigger", `
 display: inline-block;
 box-sizing: border-box;
 opacity: 1;
 transition: opacity .3s var(--n-bezier);
 `, [c$1("+", [cB("upload-file-list", "margin-top: 8px;")]), cM("disabled", `
 opacity: var(--n-item-disabled-opacity);
 cursor: not-allowed;
 `), cM("image-card", `
 width: 96px;
 height: 96px;
 `, [cB("base-icon", `
 font-size: 24px;
 `), cB("upload-dragger", `
 padding: 0;
 height: 100%;
 width: 100%;
 display: flex;
 align-items: center;
 justify-content: center;
 `)])]), cB("upload-file-list", `
 line-height: var(--n-line-height);
 opacity: 1;
 transition: opacity .3s var(--n-bezier);
 `, [c$1("a, img", "outline: none;"), cM("disabled", `
 opacity: var(--n-item-disabled-opacity);
 cursor: not-allowed;
 `, [cB("upload-file", "cursor: not-allowed;")]), cM("grid", `
 display: grid;
 grid-template-columns: repeat(auto-fill, 96px);
 grid-gap: 8px;
 margin-top: 0;
 `), cB("upload-file", `
 display: block;
 box-sizing: border-box;
 cursor: default;
 padding: 0px 12px 0 6px;
 transition: background-color .3s var(--n-bezier);
 border-radius: var(--n-border-radius);
 `, [fadeInHeightExpandTransition(), cB("progress", [fadeInHeightExpandTransition({
      foldPadding: true
    })]), c$1("&:hover", `
 background-color: var(--n-item-color-hover);
 `, [cB("upload-file-info", [cE("action", `
 opacity: 1;
 `)])]), cM("image-type", `
 border-radius: var(--n-border-radius);
 text-decoration: underline;
 text-decoration-color: #0000;
 `, [cB("upload-file-info", `
 padding-top: 0px;
 padding-bottom: 0px;
 width: 100%;
 height: 100%;
 display: flex;
 justify-content: space-between;
 align-items: center;
 padding: 6px 0;
 `, [cB("progress", `
 padding: 2px 0;
 margin-bottom: 0;
 `), cE("name", `
 padding: 0 8px;
 `), cE("thumbnail", `
 width: 32px;
 height: 32px;
 font-size: 28px;
 display: flex;
 justify-content: center;
 align-items: center;
 `, [c$1("img", `
 width: 100%;
 `)])])]), cM("text-type", [cB("progress", `
 box-sizing: border-box;
 padding-bottom: 6px;
 margin-bottom: 6px;
 `)]), cM("image-card-type", `
 position: relative;
 width: 96px;
 height: 96px;
 border: var(--n-item-border-image-card);
 border-radius: var(--n-border-radius);
 padding: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier);
 border-radius: var(--n-border-radius);
 overflow: hidden;
 `, [cB("progress", `
 position: absolute;
 left: 8px;
 bottom: 8px;
 right: 8px;
 width: unset;
 `), cB("upload-file-info", `
 padding: 0;
 width: 100%;
 height: 100%;
 `, [cE("thumbnail", `
 width: 100%;
 height: 100%;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 font-size: 36px;
 `, [c$1("img", `
 width: 100%;
 `)])]), c$1("&::before", `
 position: absolute;
 z-index: 1;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 border-radius: inherit;
 opacity: 0;
 transition: opacity .2s var(--n-bezier);
 content: "";
 `), c$1("&:hover", [c$1("&::before", "opacity: 1;"), cB("upload-file-info", [cE("thumbnail", "opacity: .12;")])])]), cM("error-status", [c$1("&:hover", `
 background-color: var(--n-item-color-hover-error);
 `), cB("upload-file-info", [cE("name", "color: var(--n-item-text-color-error);"), cE("thumbnail", "color: var(--n-item-text-color-error);")]), cM("image-card-type", `
 border: var(--n-item-border-image-card-error);
 `)]), cM("with-url", `
 cursor: pointer;
 `, [cB("upload-file-info", [cE("name", `
 color: var(--n-item-text-color-success);
 text-decoration-color: var(--n-item-text-color-success);
 `, [c$1("a", `
 text-decoration: underline;
 `)])])]), cB("upload-file-info", `
 position: relative;
 padding-top: 6px;
 padding-bottom: 6px;
 display: flex;
 flex-wrap: nowrap;
 `, [cE("thumbnail", `
 font-size: 18px;
 opacity: 1;
 transition: opacity .2s var(--n-bezier);
 color: var(--n-item-icon-color);
 `, [cB("base-icon", `
 margin-right: 2px;
 vertical-align: middle;
 transition: color .3s var(--n-bezier);
 `)]), cE("action", `
 padding-top: inherit;
 padding-bottom: inherit;
 position: absolute;
 right: 0;
 top: 0;
 bottom: 0;
 width: 80px;
 display: flex;
 align-items: center;
 transition: opacity .2s var(--n-bezier);
 justify-content: flex-end;
 opacity: 0;
 `, [cB("button", [c$1("&:not(:last-child)", {
      marginRight: "4px"
    }), cB("base-icon", [c$1("svg", [iconSwitchTransition()])])]), cM("image-type", `
 position: relative;
 max-width: 80px;
 width: auto;
 `), cM("image-card-type", `
 z-index: 2;
 position: absolute;
 width: 100%;
 height: 100%;
 left: 0;
 right: 0;
 bottom: 0;
 top: 0;
 display: flex;
 justify-content: center;
 align-items: center;
 `)]), cE("name", `
 color: var(--n-item-text-color);
 flex: 1;
 display: flex;
 justify-content: center;
 text-overflow: ellipsis;
 overflow: hidden;
 flex-direction: column;
 text-decoration-color: #0000;
 font-size: var(--n-font-size);
 transition:
 color .3s var(--n-bezier),
 text-decoration-color .3s var(--n-bezier); 
 `, [c$1("a", `
 color: inherit;
 text-decoration: underline;
 `)])])])]), cB("upload-file-input", `
 display: none;
 width: 0;
 height: 0;
 opacity: 0;
 `)]);
    var __awaiter = function(thisArg, _arguments, P, generator) {
      function adopt(value) {
        return value instanceof P ? value : new P(function(resolve2) {
          resolve2(value);
        });
      }
      return new (P || (P = Promise))(function(resolve2, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e) {
            reject(e);
          }
        }
        function step(result) {
          result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    };
    function createXhrHandlers(inst, file, xhr) {
      const {
        doChange,
        xhrMap
      } = inst;
      let percentage = 0;
      function handleXHRError(e) {
        var _a;
        let fileAfterChange = Object.assign({}, file, {
          status: "error",
          percentage
        });
        xhrMap.delete(file.id);
        fileAfterChange = createSettledFileInfo(((_a = inst.onError) === null || _a === void 0 ? void 0 : _a.call(inst, {
          file: fileAfterChange,
          event: e
        })) || fileAfterChange);
        doChange(fileAfterChange, e);
      }
      function handleXHRLoad(e) {
        var _a;
        if (inst.isErrorState) {
          if (inst.isErrorState(xhr)) {
            handleXHRError(e);
            return;
          }
        } else {
          if (xhr.status < 200 || xhr.status >= 300) {
            handleXHRError(e);
            return;
          }
        }
        let fileAfterChange = Object.assign({}, file, {
          status: "finished",
          percentage
        });
        xhrMap.delete(file.id);
        fileAfterChange = createSettledFileInfo(((_a = inst.onFinish) === null || _a === void 0 ? void 0 : _a.call(inst, {
          file: fileAfterChange,
          event: e
        })) || fileAfterChange);
        doChange(fileAfterChange, e);
      }
      return {
        handleXHRLoad,
        handleXHRError,
        handleXHRAbort(e) {
          const fileAfterChange = Object.assign({}, file, {
            status: "removed",
            file: null,
            percentage
          });
          xhrMap.delete(file.id);
          doChange(fileAfterChange, e);
        },
        handleXHRProgress(e) {
          const fileAfterChange = Object.assign({}, file, {
            status: "uploading"
          });
          if (e.lengthComputable) {
            const progress = Math.ceil(e.loaded / e.total * 100);
            fileAfterChange.percentage = progress;
            percentage = progress;
          }
          doChange(fileAfterChange, e);
        }
      };
    }
    function customSubmitImpl(options) {
      const {
        inst,
        file,
        data,
        headers,
        withCredentials,
        action,
        customRequest
      } = options;
      const {
        doChange
      } = options.inst;
      let percentage = 0;
      customRequest({
        file,
        data,
        headers,
        withCredentials,
        action,
        onProgress(event) {
          const fileAfterChange = Object.assign({}, file, {
            status: "uploading"
          });
          const progress = event.percent;
          fileAfterChange.percentage = progress;
          percentage = progress;
          doChange(fileAfterChange);
        },
        onFinish() {
          var _a;
          let fileAfterChange = Object.assign({}, file, {
            status: "finished",
            percentage
          });
          fileAfterChange = createSettledFileInfo(((_a = inst.onFinish) === null || _a === void 0 ? void 0 : _a.call(inst, {
            file: fileAfterChange
          })) || fileAfterChange);
          doChange(fileAfterChange);
        },
        onError() {
          var _a;
          let fileAfterChange = Object.assign({}, file, {
            status: "error",
            percentage
          });
          fileAfterChange = createSettledFileInfo(((_a = inst.onError) === null || _a === void 0 ? void 0 : _a.call(inst, {
            file: fileAfterChange
          })) || fileAfterChange);
          doChange(fileAfterChange);
        }
      });
    }
    function registerHandler(inst, file, request) {
      const handlers = createXhrHandlers(inst, file, request);
      request.onabort = handlers.handleXHRAbort;
      request.onerror = handlers.handleXHRError;
      request.onload = handlers.handleXHRLoad;
      if (request.upload) {
        request.upload.onprogress = handlers.handleXHRProgress;
      }
    }
    function unwrapFunctionValue(data, file) {
      if (typeof data === "function") {
        return data({
          file
        });
      }
      if (data) return data;
      return {};
    }
    function setHeaders(request, headers, file) {
      const headersObject = unwrapFunctionValue(headers, file);
      if (!headersObject) return;
      Object.keys(headersObject).forEach((key) => {
        request.setRequestHeader(key, headersObject[key]);
      });
    }
    function appendData(formData, data, file) {
      const dataObject = unwrapFunctionValue(data, file);
      if (!dataObject) return;
      Object.keys(dataObject).forEach((key) => {
        formData.append(key, dataObject[key]);
      });
    }
    function submitImpl(inst, fieldName, file, {
      method,
      action,
      withCredentials,
      responseType,
      headers,
      data
    }) {
      const request = new XMLHttpRequest();
      request.responseType = responseType;
      inst.xhrMap.set(file.id, request);
      request.withCredentials = withCredentials;
      const formData = new FormData();
      appendData(formData, data, file);
      if (file.file !== null) {
        formData.append(fieldName, file.file);
      }
      registerHandler(inst, file, request);
      if (action !== void 0) {
        request.open(method.toUpperCase(), action);
        setHeaders(request, headers, file);
        request.send(formData);
        const fileAfterChange = Object.assign({}, file, {
          status: "uploading"
        });
        inst.doChange(fileAfterChange);
      }
    }
    const uploadProps = Object.assign(Object.assign({}, useTheme.props), {
      name: {
        type: String,
        default: "file"
      },
      accept: String,
      action: String,
      customRequest: Function,
      directory: Boolean,
      directoryDnd: {
        type: Boolean,
        default: void 0
      },
      method: {
        type: String,
        default: "POST"
      },
      multiple: Boolean,
      showFileList: {
        type: Boolean,
        default: true
      },
      data: [Object, Function],
      headers: [Object, Function],
      withCredentials: Boolean,
      responseType: {
        type: String,
        default: ""
      },
      disabled: {
        type: Boolean,
        default: void 0
      },
      onChange: Function,
      onRemove: Function,
      onFinish: Function,
      onError: Function,
      onRetry: Function,
      onBeforeUpload: Function,
      isErrorState: Function,
      /** currently not used */
      onDownload: Function,
      defaultUpload: {
        type: Boolean,
        default: true
      },
      fileList: Array,
      "onUpdate:fileList": [Function, Array],
      onUpdateFileList: [Function, Array],
      fileListClass: String,
      fileListStyle: [String, Object],
      defaultFileList: {
        type: Array,
        default: () => []
      },
      showCancelButton: {
        type: Boolean,
        default: true
      },
      showRemoveButton: {
        type: Boolean,
        default: true
      },
      showDownloadButton: Boolean,
      showRetryButton: {
        type: Boolean,
        default: true
      },
      showPreviewButton: {
        type: Boolean,
        default: true
      },
      listType: {
        type: String,
        default: "text"
      },
      onPreview: Function,
      shouldUseThumbnailUrl: {
        type: Function,
        default: (file) => {
          if (!environmentSupportFile) return false;
          return isImageFile(file);
        }
      },
      createThumbnailUrl: Function,
      abstract: Boolean,
      max: Number,
      showTrigger: {
        type: Boolean,
        default: true
      },
      imageGroupProps: Object,
      inputProps: Object,
      triggerClass: String,
      triggerStyle: [String, Object],
      renderIcon: Function
    });
    const NUpload = /* @__PURE__ */ defineComponent({
      name: "Upload",
      props: uploadProps,
      setup(props) {
        if (props.abstract && props.listType === "image-card") {
          throwError("upload", "when the list-type is image-card, abstract is not supported.");
        }
        const {
          mergedClsPrefixRef,
          inlineThemeDisabled
        } = useConfig(props);
        const themeRef = useTheme("Upload", "-upload", style, uploadLight, props, mergedClsPrefixRef);
        const formItem = useFormItem(props);
        const uncontrolledFileListRef = ref(props.defaultFileList);
        const controlledFileListRef = toRef(props, "fileList");
        const inputElRef = ref(null);
        const draggerInsideRef = {
          value: false
        };
        const dragOverRef = ref(false);
        const xhrMap = /* @__PURE__ */ new Map();
        const _mergedFileListRef = useMergedState(controlledFileListRef, uncontrolledFileListRef);
        const mergedFileListRef = computed(() => _mergedFileListRef.value.map(createSettledFileInfo));
        const maxReachedRef = computed(() => {
          const {
            max
          } = props;
          if (max !== void 0) {
            return mergedFileListRef.value.length >= max;
          }
          return false;
        });
        function openOpenFileDialog() {
          var _a;
          (_a = inputElRef.value) === null || _a === void 0 ? void 0 : _a.click();
        }
        function handleFileInputChange(e) {
          const target = e.target;
          handleFileAddition(target.files ? Array.from(target.files).map((file) => ({
            file,
            entry: null,
            source: "input"
          })) : null, e);
          target.value = "";
        }
        function doUpdateFileList(files) {
          const {
            "onUpdate:fileList": _onUpdateFileList,
            onUpdateFileList
          } = props;
          if (_onUpdateFileList) call(_onUpdateFileList, files);
          if (onUpdateFileList) call(onUpdateFileList, files);
          uncontrolledFileListRef.value = files;
        }
        const mergedMultipleRef = computed(() => props.multiple || props.directory);
        const doChange = (fileAfterChange, event, options = {
          append: false,
          remove: false
        }) => {
          const {
            append,
            remove: remove2
          } = options;
          const fileListAfterChange = Array.from(mergedFileListRef.value);
          const fileIndex = fileListAfterChange.findIndex((file) => file.id === fileAfterChange.id);
          if (append || remove2 || ~fileIndex) {
            if (append) {
              fileListAfterChange.push(fileAfterChange);
            } else if (remove2) {
              fileListAfterChange.splice(fileIndex, 1);
            } else {
              fileListAfterChange.splice(fileIndex, 1, fileAfterChange);
            }
            const {
              onChange
            } = props;
            if (onChange) {
              onChange({
                file: fileAfterChange,
                fileList: fileListAfterChange,
                event
              });
            }
            doUpdateFileList(fileListAfterChange);
          }
        };
        function handleFileAddition(fileAndEntries, e) {
          if (!fileAndEntries || fileAndEntries.length === 0) return;
          const {
            onBeforeUpload
          } = props;
          fileAndEntries = mergedMultipleRef.value ? fileAndEntries : [fileAndEntries[0]];
          const {
            max,
            accept
          } = props;
          fileAndEntries = fileAndEntries.filter(({
            file,
            source
          }) => {
            if (source === "dnd" && (accept === null || accept === void 0 ? void 0 : accept.trim())) {
              return matchType(file.name, file.type, accept);
            } else {
              return true;
            }
          });
          if (max) {
            fileAndEntries = fileAndEntries.slice(0, max - mergedFileListRef.value.length);
          }
          const batchId = createId();
          void Promise.all(fileAndEntries.map((_a) => __awaiter(this, [_a], void 0, function* ({
            file,
            entry
          }) {
            var _b;
            const fileInfo = {
              id: createId(),
              batchId,
              name: file.name,
              status: "pending",
              percentage: 0,
              file,
              url: null,
              type: file.type,
              thumbnailUrl: null,
              fullPath: (_b = entry === null || entry === void 0 ? void 0 : entry.fullPath) !== null && _b !== void 0 ? _b : `/${file.webkitRelativePath || file.name}`
            };
            if (!onBeforeUpload || (yield onBeforeUpload({
              file: fileInfo,
              fileList: mergedFileListRef.value
            })) !== false) {
              return fileInfo;
            }
            return null;
          }))).then((fileInfos) => __awaiter(this, void 0, void 0, function* () {
            let nextTickChain = Promise.resolve();
            fileInfos.forEach((fileInfo) => {
              nextTickChain = nextTickChain.then(nextTick).then(() => {
                if (fileInfo) {
                  doChange(fileInfo, e, {
                    append: true
                  });
                }
              });
            });
            yield nextTickChain;
          })).then(() => {
            if (props.defaultUpload) {
              submit();
            }
          });
        }
        function submit(fileId) {
          const {
            method,
            action,
            withCredentials,
            headers,
            data,
            name: fieldName
          } = props;
          const filesToUpload = fileId !== void 0 ? mergedFileListRef.value.filter((file) => file.id === fileId) : mergedFileListRef.value;
          const shouldReupload = fileId !== void 0;
          filesToUpload.forEach((file) => {
            const {
              status
            } = file;
            if (status === "pending" || status === "error" && shouldReupload) {
              if (props.customRequest) {
                customSubmitImpl({
                  inst: {
                    doChange,
                    xhrMap,
                    onFinish: props.onFinish,
                    onError: props.onError
                  },
                  file,
                  action,
                  withCredentials,
                  headers,
                  data,
                  customRequest: props.customRequest
                });
              } else {
                submitImpl({
                  doChange,
                  xhrMap,
                  onFinish: props.onFinish,
                  onError: props.onError,
                  isErrorState: props.isErrorState
                }, fieldName, file, {
                  method,
                  action,
                  withCredentials,
                  responseType: props.responseType,
                  headers,
                  data
                });
              }
            }
          });
        }
        function getFileThumbnailUrlResolver(file) {
          var _a;
          if (file.thumbnailUrl) return file.thumbnailUrl;
          const {
            createThumbnailUrl
          } = props;
          if (createThumbnailUrl) {
            return (_a = createThumbnailUrl(file.file, file)) !== null && _a !== void 0 ? _a : file.url || "";
          }
          if (file.url) {
            return file.url;
          } else if (file.file) {
            return createImageDataUrl(file.file);
          }
          return "";
        }
        const cssVarsRef = computed(() => {
          const {
            common: {
              cubicBezierEaseInOut: cubicBezierEaseInOut2
            },
            self: {
              draggerColor,
              draggerBorder,
              draggerBorderHover,
              itemColorHover,
              itemColorHoverError,
              itemTextColorError,
              itemTextColorSuccess,
              itemTextColor,
              itemIconColor,
              itemDisabledOpacity,
              lineHeight: lineHeight2,
              borderRadius,
              fontSize: fontSize2,
              itemBorderImageCardError,
              itemBorderImageCard
            }
          } = themeRef.value;
          return {
            "--n-bezier": cubicBezierEaseInOut2,
            "--n-border-radius": borderRadius,
            "--n-dragger-border": draggerBorder,
            "--n-dragger-border-hover": draggerBorderHover,
            "--n-dragger-color": draggerColor,
            "--n-font-size": fontSize2,
            "--n-item-color-hover": itemColorHover,
            "--n-item-color-hover-error": itemColorHoverError,
            "--n-item-disabled-opacity": itemDisabledOpacity,
            "--n-item-icon-color": itemIconColor,
            "--n-item-text-color": itemTextColor,
            "--n-item-text-color-error": itemTextColorError,
            "--n-item-text-color-success": itemTextColorSuccess,
            "--n-line-height": lineHeight2,
            "--n-item-border-image-card-error": itemBorderImageCardError,
            "--n-item-border-image-card": itemBorderImageCard
          };
        });
        const themeClassHandle = inlineThemeDisabled ? useThemeClass("upload", void 0, cssVarsRef, props) : void 0;
        provide(uploadInjectionKey, {
          mergedClsPrefixRef,
          mergedThemeRef: themeRef,
          showCancelButtonRef: toRef(props, "showCancelButton"),
          showDownloadButtonRef: toRef(props, "showDownloadButton"),
          showRemoveButtonRef: toRef(props, "showRemoveButton"),
          showRetryButtonRef: toRef(props, "showRetryButton"),
          onRemoveRef: toRef(props, "onRemove"),
          onDownloadRef: toRef(props, "onDownload"),
          mergedFileListRef,
          triggerClassRef: toRef(props, "triggerClass"),
          triggerStyleRef: toRef(props, "triggerStyle"),
          shouldUseThumbnailUrlRef: toRef(props, "shouldUseThumbnailUrl"),
          renderIconRef: toRef(props, "renderIcon"),
          xhrMap,
          submit,
          doChange,
          showPreviewButtonRef: toRef(props, "showPreviewButton"),
          onPreviewRef: toRef(props, "onPreview"),
          getFileThumbnailUrlResolver,
          listTypeRef: toRef(props, "listType"),
          dragOverRef,
          openOpenFileDialog,
          draggerInsideRef,
          handleFileAddition,
          mergedDisabledRef: formItem.mergedDisabledRef,
          maxReachedRef,
          fileListClassRef: toRef(props, "fileListClass"),
          fileListStyleRef: toRef(props, "fileListStyle"),
          abstractRef: toRef(props, "abstract"),
          acceptRef: toRef(props, "accept"),
          cssVarsRef: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClassRef: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
          showTriggerRef: toRef(props, "showTrigger"),
          imageGroupPropsRef: toRef(props, "imageGroupProps"),
          mergedDirectoryDndRef: computed(() => {
            var _a;
            return (_a = props.directoryDnd) !== null && _a !== void 0 ? _a : props.directory;
          }),
          onRetryRef: toRef(props, "onRetry")
        });
        const exposedMethods = {
          clear: () => {
            uncontrolledFileListRef.value = [];
          },
          submit,
          openOpenFileDialog
        };
        return Object.assign({
          mergedClsPrefix: mergedClsPrefixRef,
          draggerInsideRef,
          inputElRef,
          mergedTheme: themeRef,
          dragOver: dragOverRef,
          mergedMultiple: mergedMultipleRef,
          cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
          themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
          onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
          handleFileInputChange
        }, exposedMethods);
      },
      render() {
        var _a, _b;
        const {
          draggerInsideRef,
          mergedClsPrefix,
          $slots,
          directory,
          onRender
        } = this;
        if ($slots.default && !this.abstract) {
          const firstChild = $slots.default()[0];
          if ((_a = firstChild === null || firstChild === void 0 ? void 0 : firstChild.type) === null || _a === void 0 ? void 0 : _a[uploadDraggerKey]) {
            draggerInsideRef.value = true;
          }
        }
        const inputNode = h("input", Object.assign({}, this.inputProps, {
          ref: "inputElRef",
          type: "file",
          class: `${mergedClsPrefix}-upload-file-input`,
          accept: this.accept,
          multiple: this.mergedMultiple,
          onChange: this.handleFileInputChange,
          // @ts-expect-error // seems vue-tsc will add the prop, so we can't use expect-error
          webkitdirectory: directory || void 0,
          directory: directory || void 0
        }));
        if (this.abstract) {
          return h(Fragment, null, (_b = $slots.default) === null || _b === void 0 ? void 0 : _b.call($slots), h(Teleport, {
            to: "body"
          }, inputNode));
        }
        onRender === null || onRender === void 0 ? void 0 : onRender();
        return h("div", {
          class: [`${mergedClsPrefix}-upload`, draggerInsideRef.value && `${mergedClsPrefix}-upload--dragger-inside`, this.dragOver && `${mergedClsPrefix}-upload--drag-over`, this.themeClass],
          style: this.cssVars
        }, inputNode, this.showTrigger && this.listType !== "image-card" && h(NUploadTrigger, null, $slots), this.showFileList && h(NUploadFileList, null, $slots));
      }
    });
    const version = "2.40.1";
    function create({
      componentPrefix = "N",
      components = []
    } = {}) {
      const installTargets = [];
      function registerComponent(app, name, component) {
        const registered = app.component(componentPrefix + name);
        if (!registered) {
          app.component(componentPrefix + name, component);
        }
      }
      function install(app) {
        if (installTargets.includes(app)) return;
        installTargets.push(app);
        components.forEach((component) => {
          const {
            name,
            alias
          } = component;
          registerComponent(app, name, component);
          if (alias) {
            alias.forEach((aliasName) => {
              registerComponent(app, aliasName, component);
            });
          }
        });
      }
      return {
        version,
        componentPrefix,
        install
      };
    }
    const self$1 = () => ({});
    const equationDark = {
      name: "Equation",
      common: derived$1,
      self: self$1
    };
    const floatButtonGroupDark = {
      name: "FloatButtonGroup",
      common: derived$1,
      self(vars) {
        const {
          popoverColor,
          dividerColor,
          borderRadius
        } = vars;
        return {
          color: popoverColor,
          buttonBorderColor: dividerColor,
          borderRadiusSquare: borderRadius,
          boxShadow: "0 2px 8px 0px rgba(0, 0, 0, .12)"
        };
      }
    };
    const darkTheme = {
      name: "dark",
      common: derived$1,
      Alert: alertDark,
      Anchor: anchorDark,
      AutoComplete: autoCompleteDark,
      Avatar: avatarDark,
      AvatarGroup: avatarGroupDark,
      BackTop: backTopDark,
      Badge: badgeDark,
      Breadcrumb: breadcrumbDark,
      Button: buttonDark,
      ButtonGroup: buttonGroupDark,
      Calendar: calendarDark,
      Card: cardDark,
      Carousel: carouselDark,
      Cascader: cascaderDark,
      Checkbox: checkboxDark,
      Code: codeDark,
      Collapse: collapseDark,
      CollapseTransition: collapseTransitionDark,
      ColorPicker: colorPickerDark,
      DataTable: dataTableDark,
      DatePicker: datePickerDark,
      Descriptions: descriptionsDark,
      Dialog: dialogDark,
      Divider: dividerDark,
      Drawer: drawerDark,
      Dropdown: dropdownDark,
      DynamicInput: dynamicInputDark,
      DynamicTags: dynamicTagsDark,
      Element: elementDark,
      Empty: emptyDark,
      Ellipsis: ellipsisDark,
      Equation: equationDark,
      Flex: flexDark,
      Form: formItemDark,
      GradientText: gradientTextDark,
      Icon: iconDark$1,
      IconWrapper: iconDark,
      Image: imageDark,
      Input: inputDark,
      InputNumber: inputNumberDark,
      LegacyTransfer: transferDark,
      Layout: layoutDark,
      List: listDark$1,
      LoadingBar: loadingBarDark,
      Log: logDark,
      Menu: menuDark,
      Mention: listDark,
      Message: messageDark,
      Modal: modalDark,
      Notification: notificationDark,
      PageHeader: pageHeaderDark,
      Pagination: paginationDark,
      Popconfirm: popconfirmDark,
      Popover: popoverDark,
      Popselect: popselect,
      Progress: progressDark,
      QrCode: qrcodeDark,
      Radio: radioDark,
      Rate: rateDark,
      Result: resultDark,
      Row: rowDark,
      Scrollbar: scrollbarDark,
      Select: selectDark,
      Skeleton: skeletonDark,
      Slider: sliderDark,
      Space: spaceDark,
      Spin: spinDark,
      Statistic: statisticDark,
      Steps: stepsDark,
      Switch: switchDark,
      Table: tableDark,
      Tabs: tabsDark,
      Tag: tagDark,
      Thing: thingDark,
      TimePicker: timePickerDark,
      Timeline: timelineDark,
      Tooltip: tooltipDark,
      Transfer: transferDark$1,
      Tree: treeDark,
      TreeSelect: treeSelectDark,
      Typography: typographyDark,
      Upload: uploadDark,
      Watermark: watermarkDark,
      Split: splitDark,
      FloatButton: floatButtonDark,
      FloatButtonGroup: floatButtonGroupDark
    };
    var isVue2 = false;
    /*!
     * pinia v2.2.6
     * (c) 2024 Eduardo San Martin Morote
     * @license MIT
     */
    let activePinia;
    const setActivePinia = (pinia2) => activePinia = pinia2;
    const piniaSymbol = (
      /* istanbul ignore next */
      Symbol()
    );
    function isPlainObject$1(o) {
      return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
    }
    var MutationType;
    (function(MutationType2) {
      MutationType2["direct"] = "direct";
      MutationType2["patchObject"] = "patch object";
      MutationType2["patchFunction"] = "patch function";
    })(MutationType || (MutationType = {}));
    function createPinia() {
      const scope = effectScope(true);
      const state = scope.run(() => ref({}));
      let _p = [];
      let toBeInstalled = [];
      const pinia2 = markRaw({
        install(app) {
          setActivePinia(pinia2);
          {
            pinia2._a = app;
            app.provide(piniaSymbol, pinia2);
            app.config.globalProperties.$pinia = pinia2;
            toBeInstalled.forEach((plugin2) => _p.push(plugin2));
            toBeInstalled = [];
          }
        },
        use(plugin2) {
          if (!this._a && !isVue2) {
            toBeInstalled.push(plugin2);
          } else {
            _p.push(plugin2);
          }
          return this;
        },
        _p,
        // it's actually undefined here
        // @ts-expect-error
        _a: null,
        _e: scope,
        _s: /* @__PURE__ */ new Map(),
        state
      });
      return pinia2;
    }
    const noop = () => {
    };
    function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
      subscriptions.push(callback);
      const removeSubscription = () => {
        const idx = subscriptions.indexOf(callback);
        if (idx > -1) {
          subscriptions.splice(idx, 1);
          onCleanup();
        }
      };
      if (!detached && getCurrentScope()) {
        onScopeDispose(removeSubscription);
      }
      return removeSubscription;
    }
    function triggerSubscriptions(subscriptions, ...args) {
      subscriptions.slice().forEach((callback) => {
        callback(...args);
      });
    }
    const fallbackRunWithContext = (fn) => fn();
    const ACTION_MARKER = Symbol();
    const ACTION_NAME = Symbol();
    function mergeReactiveObjects(target, patchToApply) {
      if (target instanceof Map && patchToApply instanceof Map) {
        patchToApply.forEach((value, key) => target.set(key, value));
      } else if (target instanceof Set && patchToApply instanceof Set) {
        patchToApply.forEach(target.add, target);
      }
      for (const key in patchToApply) {
        if (!patchToApply.hasOwnProperty(key))
          continue;
        const subPatch = patchToApply[key];
        const targetValue = target[key];
        if (isPlainObject$1(targetValue) && isPlainObject$1(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
          target[key] = mergeReactiveObjects(targetValue, subPatch);
        } else {
          target[key] = subPatch;
        }
      }
      return target;
    }
    const skipHydrateSymbol = (
      /* istanbul ignore next */
      Symbol()
    );
    function shouldHydrate(obj) {
      return !isPlainObject$1(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
    }
    const { assign: assign$2 } = Object;
    function isComputed(o) {
      return !!(isRef(o) && o.effect);
    }
    function createOptionsStore(id, options, pinia2, hot) {
      const { state, actions, getters } = options;
      const initialState = pinia2.state.value[id];
      let store;
      function setup() {
        if (!initialState && true) {
          {
            pinia2.state.value[id] = state ? state() : {};
          }
        }
        const localState = toRefs(pinia2.state.value[id]);
        return assign$2(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
          computedGetters[name] = markRaw(computed(() => {
            setActivePinia(pinia2);
            const store2 = pinia2._s.get(id);
            return getters[name].call(store2, store2);
          }));
          return computedGetters;
        }, {}));
      }
      store = createSetupStore(id, setup, options, pinia2, hot, true);
      return store;
    }
    function createSetupStore($id, setup, options = {}, pinia2, hot, isOptionsStore) {
      let scope;
      const optionsForPlugin = assign$2({ actions: {} }, options);
      const $subscribeOptions = { deep: true };
      let isListening;
      let isSyncListening;
      let subscriptions = [];
      let actionSubscriptions = [];
      let debuggerEvents;
      const initialState = pinia2.state.value[$id];
      if (!isOptionsStore && !initialState && true) {
        {
          pinia2.state.value[$id] = {};
        }
      }
      ref({});
      let activeListener;
      function $patch(partialStateOrMutator) {
        let subscriptionMutation;
        isListening = isSyncListening = false;
        if (typeof partialStateOrMutator === "function") {
          partialStateOrMutator(pinia2.state.value[$id]);
          subscriptionMutation = {
            type: MutationType.patchFunction,
            storeId: $id,
            events: debuggerEvents
          };
        } else {
          mergeReactiveObjects(pinia2.state.value[$id], partialStateOrMutator);
          subscriptionMutation = {
            type: MutationType.patchObject,
            payload: partialStateOrMutator,
            storeId: $id,
            events: debuggerEvents
          };
        }
        const myListenerId = activeListener = Symbol();
        nextTick().then(() => {
          if (activeListener === myListenerId) {
            isListening = true;
          }
        });
        isSyncListening = true;
        triggerSubscriptions(subscriptions, subscriptionMutation, pinia2.state.value[$id]);
      }
      const $reset = isOptionsStore ? function $reset2() {
        const { state } = options;
        const newState = state ? state() : {};
        this.$patch(($state) => {
          assign$2($state, newState);
        });
      } : (
        /* istanbul ignore next */
        noop
      );
      function $dispose() {
        scope.stop();
        subscriptions = [];
        actionSubscriptions = [];
        pinia2._s.delete($id);
      }
      const action = (fn, name = "") => {
        if (ACTION_MARKER in fn) {
          fn[ACTION_NAME] = name;
          return fn;
        }
        const wrappedAction = function() {
          setActivePinia(pinia2);
          const args = Array.from(arguments);
          const afterCallbackList = [];
          const onErrorCallbackList = [];
          function after(callback) {
            afterCallbackList.push(callback);
          }
          function onError(callback) {
            onErrorCallbackList.push(callback);
          }
          triggerSubscriptions(actionSubscriptions, {
            args,
            name: wrappedAction[ACTION_NAME],
            store,
            after,
            onError
          });
          let ret;
          try {
            ret = fn.apply(this && this.$id === $id ? this : store, args);
          } catch (error2) {
            triggerSubscriptions(onErrorCallbackList, error2);
            throw error2;
          }
          if (ret instanceof Promise) {
            return ret.then((value) => {
              triggerSubscriptions(afterCallbackList, value);
              return value;
            }).catch((error2) => {
              triggerSubscriptions(onErrorCallbackList, error2);
              return Promise.reject(error2);
            });
          }
          triggerSubscriptions(afterCallbackList, ret);
          return ret;
        };
        wrappedAction[ACTION_MARKER] = true;
        wrappedAction[ACTION_NAME] = name;
        return wrappedAction;
      };
      const partialStore = {
        _p: pinia2,
        // _s: scope,
        $id,
        $onAction: addSubscription.bind(null, actionSubscriptions),
        $patch,
        $reset,
        $subscribe(callback, options2 = {}) {
          const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
          const stopWatcher = scope.run(() => watch(() => pinia2.state.value[$id], (state) => {
            if (options2.flush === "sync" ? isSyncListening : isListening) {
              callback({
                storeId: $id,
                type: MutationType.direct,
                events: debuggerEvents
              }, state);
            }
          }, assign$2({}, $subscribeOptions, options2)));
          return removeSubscription;
        },
        $dispose
      };
      const store = reactive(partialStore);
      pinia2._s.set($id, store);
      const runWithContext = pinia2._a && pinia2._a.runWithContext || fallbackRunWithContext;
      const setupStore = runWithContext(() => pinia2._e.run(() => (scope = effectScope()).run(() => setup({ action }))));
      for (const key in setupStore) {
        const prop = setupStore[key];
        if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
          if (!isOptionsStore) {
            if (initialState && shouldHydrate(prop)) {
              if (isRef(prop)) {
                prop.value = initialState[key];
              } else {
                mergeReactiveObjects(prop, initialState[key]);
              }
            }
            {
              pinia2.state.value[$id][key] = prop;
            }
          }
        } else if (typeof prop === "function") {
          const actionValue = action(prop, key);
          {
            setupStore[key] = actionValue;
          }
          optionsForPlugin.actions[key] = prop;
        } else ;
      }
      {
        assign$2(store, setupStore);
        assign$2(toRaw(store), setupStore);
      }
      Object.defineProperty(store, "$state", {
        get: () => pinia2.state.value[$id],
        set: (state) => {
          $patch(($state) => {
            assign$2($state, state);
          });
        }
      });
      pinia2._p.forEach((extender) => {
        {
          assign$2(store, scope.run(() => extender({
            store,
            app: pinia2._a,
            pinia: pinia2,
            options: optionsForPlugin
          })));
        }
      });
      if (initialState && isOptionsStore && options.hydrate) {
        options.hydrate(store.$state, initialState);
      }
      isListening = true;
      isSyncListening = true;
      return store;
    }
    /*! #__NO_SIDE_EFFECTS__ */
    // @__NO_SIDE_EFFECTS__
    function defineStore(idOrOptions, setup, setupOptions) {
      let id;
      let options;
      const isSetupStore = typeof setup === "function";
      if (typeof idOrOptions === "string") {
        id = idOrOptions;
        options = isSetupStore ? setupOptions : setup;
      } else {
        options = idOrOptions;
        id = idOrOptions.id;
      }
      function useStore(pinia2, hot) {
        const hasContext = hasInjectionContext();
        pinia2 = // in test mode, ignore the argument provided as we can always retrieve a
        // pinia instance with getActivePinia()
        pinia2 || (hasContext ? inject(piniaSymbol, null) : null);
        if (pinia2)
          setActivePinia(pinia2);
        pinia2 = activePinia;
        if (!pinia2._s.has(id)) {
          if (isSetupStore) {
            createSetupStore(id, setup, options, pinia2);
          } else {
            createOptionsStore(id, options, pinia2);
          }
        }
        const store = pinia2._s.get(id);
        return store;
      }
      useStore.$id = id;
      return useStore;
    }
    function storeToRefs(store) {
      {
        const rawStore = toRaw(store);
        const refs = {};
        for (const key in rawStore) {
          const value = rawStore[key];
          if (isRef(value) || isReactive(value)) {
            refs[key] = // ---
            toRef(store, key);
          }
        }
        return refs;
      }
    }
    /*!
      * shared v9.14.1
      * (c) 2024 kazuya kawaguchi
      * Released under the MIT License.
      */
    const inBrowser = typeof window !== "undefined";
    const makeSymbol = (name, shareable = false) => !shareable ? Symbol(name) : Symbol.for(name);
    const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
    const friendlyJSONstringify = (json) => JSON.stringify(json).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027");
    const isNumber = (val) => typeof val === "number" && isFinite(val);
    const isDate = (val) => toTypeString(val) === "[object Date]";
    const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
    const isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;
    const assign$1 = Object.assign;
    let _globalThis;
    const getGlobalThis = () => {
      return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
    };
    function escapeHtml(rawText) {
      return rawText.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
    }
    const hasOwnProperty = Object.prototype.hasOwnProperty;
    function hasOwn(obj, key) {
      return hasOwnProperty.call(obj, key);
    }
    const isArray = Array.isArray;
    const isFunction = (val) => typeof val === "function";
    const isString$1 = (val) => typeof val === "string";
    const isBoolean = (val) => typeof val === "boolean";
    const isObject$2 = (val) => val !== null && typeof val === "object";
    const isPromise = (val) => {
      return isObject$2(val) && isFunction(val.then) && isFunction(val.catch);
    };
    const objectToString = Object.prototype.toString;
    const toTypeString = (value) => objectToString.call(value);
    const isPlainObject = (val) => {
      if (!isObject$2(val))
        return false;
      const proto = Object.getPrototypeOf(val);
      return proto === null || proto.constructor === Object;
    };
    const toDisplayString = (val) => {
      return val == null ? "" : isArray(val) || isPlainObject(val) && val.toString === objectToString ? JSON.stringify(val, null, 2) : String(val);
    };
    function join$1(items, separator = "") {
      return items.reduce((str, item, index) => index === 0 ? str + item : str + separator + item, "");
    }
    function incrementer(code2) {
      let current = code2;
      return () => ++current;
    }
    function warn(msg2, err) {
      if (typeof console !== "undefined") {
        console.warn(`[intlify] ` + msg2);
        if (err) {
          console.warn(err.stack);
        }
      }
    }
    const isNotObjectOrIsArray = (val) => !isObject$2(val) || isArray(val);
    function deepCopy(src, des) {
      if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
        throw new Error("Invalid value");
      }
      const stack2 = [{ src, des }];
      while (stack2.length) {
        const { src: src2, des: des2 } = stack2.pop();
        Object.keys(src2).forEach((key) => {
          if (isObject$2(src2[key]) && !isObject$2(des2[key])) {
            des2[key] = Array.isArray(src2[key]) ? [] : {};
          }
          if (isNotObjectOrIsArray(des2[key]) || isNotObjectOrIsArray(src2[key])) {
            des2[key] = src2[key];
          } else {
            stack2.push({ src: src2[key], des: des2[key] });
          }
        });
      }
    }
    /*!
      * message-compiler v9.14.1
      * (c) 2024 kazuya kawaguchi
      * Released under the MIT License.
      */
    function createPosition(line, column, offset) {
      return { line, column, offset };
    }
    function createLocation(start, end, source) {
      const loc = { start, end };
      return loc;
    }
    const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
    function format$1(message, ...args) {
      if (args.length === 1 && isObject$1(args[0])) {
        args = args[0];
      }
      if (!args || !args.hasOwnProperty) {
        args = {};
      }
      return message.replace(RE_ARGS, (match2, identifier) => {
        return args.hasOwnProperty(identifier) ? args[identifier] : "";
      });
    }
    const assign = Object.assign;
    const isString = (val) => typeof val === "string";
    const isObject$1 = (val) => val !== null && typeof val === "object";
    function join(items, separator = "") {
      return items.reduce((str, item, index) => index === 0 ? str + item : str + separator + item, "");
    }
    const CompileWarnCodes = {
      USE_MODULO_SYNTAX: 1,
      __EXTEND_POINT__: 2
    };
    const warnMessages = {
      [CompileWarnCodes.USE_MODULO_SYNTAX]: `Use modulo before '{{0}}'.`
    };
    function createCompileWarn(code2, loc, ...args) {
      const msg2 = format$1(warnMessages[code2], ...args || []);
      const message = { message: String(msg2), code: code2 };
      if (loc) {
        message.location = loc;
      }
      return message;
    }
    const CompileErrorCodes = {
      // tokenizer error codes
      EXPECTED_TOKEN: 1,
      INVALID_TOKEN_IN_PLACEHOLDER: 2,
      UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
      UNKNOWN_ESCAPE_SEQUENCE: 4,
      INVALID_UNICODE_ESCAPE_SEQUENCE: 5,
      UNBALANCED_CLOSING_BRACE: 6,
      UNTERMINATED_CLOSING_BRACE: 7,
      EMPTY_PLACEHOLDER: 8,
      NOT_ALLOW_NEST_PLACEHOLDER: 9,
      INVALID_LINKED_FORMAT: 10,
      // parser error codes
      MUST_HAVE_MESSAGES_IN_PLURAL: 11,
      UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
      UNEXPECTED_EMPTY_LINKED_KEY: 13,
      UNEXPECTED_LEXICAL_ANALYSIS: 14,
      // generator error codes
      UNHANDLED_CODEGEN_NODE_TYPE: 15,
      // minifier error codes
      UNHANDLED_MINIFIER_NODE_TYPE: 16,
      // Special value for higher-order compilers to pick up the last code
      // to avoid collision of error codes. This should always be kept as the last
      // item.
      __EXTEND_POINT__: 17
    };
    const errorMessages = {
      // tokenizer error messages
      [CompileErrorCodes.EXPECTED_TOKEN]: `Expected token: '{0}'`,
      [CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]: `Invalid token in placeholder: '{0}'`,
      [CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: `Unterminated single quote in placeholder`,
      [CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]: `Unknown escape sequence: \\{0}`,
      [CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]: `Invalid unicode escape sequence: {0}`,
      [CompileErrorCodes.UNBALANCED_CLOSING_BRACE]: `Unbalanced closing brace`,
      [CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]: `Unterminated closing brace`,
      [CompileErrorCodes.EMPTY_PLACEHOLDER]: `Empty placeholder`,
      [CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]: `Not allowed nest placeholder`,
      [CompileErrorCodes.INVALID_LINKED_FORMAT]: `Invalid linked format`,
      // parser error messages
      [CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]: `Plural must have messages`,
      [CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]: `Unexpected empty linked modifier`,
      [CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]: `Unexpected empty linked key`,
      [CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]: `Unexpected lexical analysis in token: '{0}'`,
      // generator error messages
      [CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]: `unhandled codegen node type: '{0}'`,
      // minimizer error messages
      [CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]: `unhandled mimifier node type: '{0}'`
    };
    function createCompileError(code2, loc, options = {}) {
      const { domain, messages, args } = options;
      const msg2 = format$1((messages || errorMessages)[code2] || "", ...args || []);
      const error2 = new SyntaxError(String(msg2));
      error2.code = code2;
      if (loc) {
        error2.location = loc;
      }
      error2.domain = domain;
      return error2;
    }
    function defaultOnError(error2) {
      throw error2;
    }
    const CHAR_SP = " ";
    const CHAR_CR = "\r";
    const CHAR_LF = "\n";
    const CHAR_LS = String.fromCharCode(8232);
    const CHAR_PS = String.fromCharCode(8233);
    function createScanner(str) {
      const _buf = str;
      let _index = 0;
      let _line = 1;
      let _column = 1;
      let _peekOffset = 0;
      const isCRLF = (index2) => _buf[index2] === CHAR_CR && _buf[index2 + 1] === CHAR_LF;
      const isLF = (index2) => _buf[index2] === CHAR_LF;
      const isPS = (index2) => _buf[index2] === CHAR_PS;
      const isLS = (index2) => _buf[index2] === CHAR_LS;
      const isLineEnd = (index2) => isCRLF(index2) || isLF(index2) || isPS(index2) || isLS(index2);
      const index = () => _index;
      const line = () => _line;
      const column = () => _column;
      const peekOffset = () => _peekOffset;
      const charAt = (offset) => isCRLF(offset) || isPS(offset) || isLS(offset) ? CHAR_LF : _buf[offset];
      const currentChar = () => charAt(_index);
      const currentPeek = () => charAt(_index + _peekOffset);
      function next() {
        _peekOffset = 0;
        if (isLineEnd(_index)) {
          _line++;
          _column = 0;
        }
        if (isCRLF(_index)) {
          _index++;
        }
        _index++;
        _column++;
        return _buf[_index];
      }
      function peek() {
        if (isCRLF(_index + _peekOffset)) {
          _peekOffset++;
        }
        _peekOffset++;
        return _buf[_index + _peekOffset];
      }
      function reset() {
        _index = 0;
        _line = 1;
        _column = 1;
        _peekOffset = 0;
      }
      function resetPeek(offset = 0) {
        _peekOffset = offset;
      }
      function skipToPeek() {
        const target = _index + _peekOffset;
        while (target !== _index) {
          next();
        }
        _peekOffset = 0;
      }
      return {
        index,
        line,
        column,
        peekOffset,
        charAt,
        currentChar,
        currentPeek,
        next,
        peek,
        reset,
        resetPeek,
        skipToPeek
      };
    }
    const EOF = void 0;
    const DOT = ".";
    const LITERAL_DELIMITER = "'";
    const ERROR_DOMAIN$3 = "tokenizer";
    function createTokenizer(source, options = {}) {
      const location2 = options.location !== false;
      const _scnr = createScanner(source);
      const currentOffset = () => _scnr.index();
      const currentPosition = () => createPosition(_scnr.line(), _scnr.column(), _scnr.index());
      const _initLoc = currentPosition();
      const _initOffset = currentOffset();
      const _context = {
        currentType: 14,
        offset: _initOffset,
        startLoc: _initLoc,
        endLoc: _initLoc,
        lastType: 14,
        lastOffset: _initOffset,
        lastStartLoc: _initLoc,
        lastEndLoc: _initLoc,
        braceNest: 0,
        inLinked: false,
        text: ""
      };
      const context = () => _context;
      const { onError } = options;
      function emitError(code2, pos, offset, ...args) {
        const ctx2 = context();
        pos.column += offset;
        pos.offset += offset;
        if (onError) {
          const loc = location2 ? createLocation(ctx2.startLoc, pos) : null;
          const err = createCompileError(code2, loc, {
            domain: ERROR_DOMAIN$3,
            args
          });
          onError(err);
        }
      }
      function getToken(context2, type, value) {
        context2.endLoc = currentPosition();
        context2.currentType = type;
        const token = { type };
        if (location2) {
          token.loc = createLocation(context2.startLoc, context2.endLoc);
        }
        if (value != null) {
          token.value = value;
        }
        return token;
      }
      const getEndToken = (context2) => getToken(
        context2,
        14
        /* TokenTypes.EOF */
      );
      function eat(scnr, ch) {
        if (scnr.currentChar() === ch) {
          scnr.next();
          return ch;
        } else {
          emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
          return "";
        }
      }
      function peekSpaces(scnr) {
        let buf = "";
        while (scnr.currentPeek() === CHAR_SP || scnr.currentPeek() === CHAR_LF) {
          buf += scnr.currentPeek();
          scnr.peek();
        }
        return buf;
      }
      function skipSpaces(scnr) {
        const buf = peekSpaces(scnr);
        scnr.skipToPeek();
        return buf;
      }
      function isIdentifierStart(ch) {
        if (ch === EOF) {
          return false;
        }
        const cc = ch.charCodeAt(0);
        return cc >= 97 && cc <= 122 || // a-z
        cc >= 65 && cc <= 90 || // A-Z
        cc === 95;
      }
      function isNumberStart(ch) {
        if (ch === EOF) {
          return false;
        }
        const cc = ch.charCodeAt(0);
        return cc >= 48 && cc <= 57;
      }
      function isNamedIdentifierStart(scnr, context2) {
        const { currentType } = context2;
        if (currentType !== 2) {
          return false;
        }
        peekSpaces(scnr);
        const ret = isIdentifierStart(scnr.currentPeek());
        scnr.resetPeek();
        return ret;
      }
      function isListIdentifierStart(scnr, context2) {
        const { currentType } = context2;
        if (currentType !== 2) {
          return false;
        }
        peekSpaces(scnr);
        const ch = scnr.currentPeek() === "-" ? scnr.peek() : scnr.currentPeek();
        const ret = isNumberStart(ch);
        scnr.resetPeek();
        return ret;
      }
      function isLiteralStart(scnr, context2) {
        const { currentType } = context2;
        if (currentType !== 2) {
          return false;
        }
        peekSpaces(scnr);
        const ret = scnr.currentPeek() === LITERAL_DELIMITER;
        scnr.resetPeek();
        return ret;
      }
      function isLinkedDotStart(scnr, context2) {
        const { currentType } = context2;
        if (currentType !== 8) {
          return false;
        }
        peekSpaces(scnr);
        const ret = scnr.currentPeek() === ".";
        scnr.resetPeek();
        return ret;
      }
      function isLinkedModifierStart(scnr, context2) {
        const { currentType } = context2;
        if (currentType !== 9) {
          return false;
        }
        peekSpaces(scnr);
        const ret = isIdentifierStart(scnr.currentPeek());
        scnr.resetPeek();
        return ret;
      }
      function isLinkedDelimiterStart(scnr, context2) {
        const { currentType } = context2;
        if (!(currentType === 8 || currentType === 12)) {
          return false;
        }
        peekSpaces(scnr);
        const ret = scnr.currentPeek() === ":";
        scnr.resetPeek();
        return ret;
      }
      function isLinkedReferStart(scnr, context2) {
        const { currentType } = context2;
        if (currentType !== 10) {
          return false;
        }
        const fn = () => {
          const ch = scnr.currentPeek();
          if (ch === "{") {
            return isIdentifierStart(scnr.peek());
          } else if (ch === "@" || ch === "%" || ch === "|" || ch === ":" || ch === "." || ch === CHAR_SP || !ch) {
            return false;
          } else if (ch === CHAR_LF) {
            scnr.peek();
            return fn();
          } else {
            return isTextStart(scnr, false);
          }
        };
        const ret = fn();
        scnr.resetPeek();
        return ret;
      }
      function isPluralStart(scnr) {
        peekSpaces(scnr);
        const ret = scnr.currentPeek() === "|";
        scnr.resetPeek();
        return ret;
      }
      function detectModuloStart(scnr) {
        const spaces = peekSpaces(scnr);
        const ret = scnr.currentPeek() === "%" && scnr.peek() === "{";
        scnr.resetPeek();
        return {
          isModulo: ret,
          hasSpace: spaces.length > 0
        };
      }
      function isTextStart(scnr, reset = true) {
        const fn = (hasSpace = false, prev = "", detectModulo = false) => {
          const ch = scnr.currentPeek();
          if (ch === "{") {
            return prev === "%" ? false : hasSpace;
          } else if (ch === "@" || !ch) {
            return prev === "%" ? true : hasSpace;
          } else if (ch === "%") {
            scnr.peek();
            return fn(hasSpace, "%", true);
          } else if (ch === "|") {
            return prev === "%" || detectModulo ? true : !(prev === CHAR_SP || prev === CHAR_LF);
          } else if (ch === CHAR_SP) {
            scnr.peek();
            return fn(true, CHAR_SP, detectModulo);
          } else if (ch === CHAR_LF) {
            scnr.peek();
            return fn(true, CHAR_LF, detectModulo);
          } else {
            return true;
          }
        };
        const ret = fn();
        reset && scnr.resetPeek();
        return ret;
      }
      function takeChar(scnr, fn) {
        const ch = scnr.currentChar();
        if (ch === EOF) {
          return EOF;
        }
        if (fn(ch)) {
          scnr.next();
          return ch;
        }
        return null;
      }
      function isIdentifier(ch) {
        const cc = ch.charCodeAt(0);
        return cc >= 97 && cc <= 122 || // a-z
        cc >= 65 && cc <= 90 || // A-Z
        cc >= 48 && cc <= 57 || // 0-9
        cc === 95 || // _
        cc === 36;
      }
      function takeIdentifierChar(scnr) {
        return takeChar(scnr, isIdentifier);
      }
      function isNamedIdentifier(ch) {
        const cc = ch.charCodeAt(0);
        return cc >= 97 && cc <= 122 || // a-z
        cc >= 65 && cc <= 90 || // A-Z
        cc >= 48 && cc <= 57 || // 0-9
        cc === 95 || // _
        cc === 36 || // $
        cc === 45;
      }
      function takeNamedIdentifierChar(scnr) {
        return takeChar(scnr, isNamedIdentifier);
      }
      function isDigit(ch) {
        const cc = ch.charCodeAt(0);
        return cc >= 48 && cc <= 57;
      }
      function takeDigit(scnr) {
        return takeChar(scnr, isDigit);
      }
      function isHexDigit(ch) {
        const cc = ch.charCodeAt(0);
        return cc >= 48 && cc <= 57 || // 0-9
        cc >= 65 && cc <= 70 || // A-F
        cc >= 97 && cc <= 102;
      }
      function takeHexDigit(scnr) {
        return takeChar(scnr, isHexDigit);
      }
      function getDigits(scnr) {
        let ch = "";
        let num = "";
        while (ch = takeDigit(scnr)) {
          num += ch;
        }
        return num;
      }
      function readModulo(scnr) {
        skipSpaces(scnr);
        const ch = scnr.currentChar();
        if (ch !== "%") {
          emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
        }
        scnr.next();
        return "%";
      }
      function readText(scnr) {
        let buf = "";
        while (true) {
          const ch = scnr.currentChar();
          if (ch === "{" || ch === "}" || ch === "@" || ch === "|" || !ch) {
            break;
          } else if (ch === "%") {
            if (isTextStart(scnr)) {
              buf += ch;
              scnr.next();
            } else {
              break;
            }
          } else if (ch === CHAR_SP || ch === CHAR_LF) {
            if (isTextStart(scnr)) {
              buf += ch;
              scnr.next();
            } else if (isPluralStart(scnr)) {
              break;
            } else {
              buf += ch;
              scnr.next();
            }
          } else {
            buf += ch;
            scnr.next();
          }
        }
        return buf;
      }
      function readNamedIdentifier(scnr) {
        skipSpaces(scnr);
        let ch = "";
        let name = "";
        while (ch = takeNamedIdentifierChar(scnr)) {
          name += ch;
        }
        if (scnr.currentChar() === EOF) {
          emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
        }
        return name;
      }
      function readListIdentifier(scnr) {
        skipSpaces(scnr);
        let value = "";
        if (scnr.currentChar() === "-") {
          scnr.next();
          value += `-${getDigits(scnr)}`;
        } else {
          value += getDigits(scnr);
        }
        if (scnr.currentChar() === EOF) {
          emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
        }
        return value;
      }
      function isLiteral2(ch) {
        return ch !== LITERAL_DELIMITER && ch !== CHAR_LF;
      }
      function readLiteral(scnr) {
        skipSpaces(scnr);
        eat(scnr, `'`);
        let ch = "";
        let literal = "";
        while (ch = takeChar(scnr, isLiteral2)) {
          if (ch === "\\") {
            literal += readEscapeSequence(scnr);
          } else {
            literal += ch;
          }
        }
        const current = scnr.currentChar();
        if (current === CHAR_LF || current === EOF) {
          emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, currentPosition(), 0);
          if (current === CHAR_LF) {
            scnr.next();
            eat(scnr, `'`);
          }
          return literal;
        }
        eat(scnr, `'`);
        return literal;
      }
      function readEscapeSequence(scnr) {
        const ch = scnr.currentChar();
        switch (ch) {
          case "\\":
          case `'`:
            scnr.next();
            return `\\${ch}`;
          case "u":
            return readUnicodeEscapeSequence(scnr, ch, 4);
          case "U":
            return readUnicodeEscapeSequence(scnr, ch, 6);
          default:
            emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE, currentPosition(), 0, ch);
            return "";
        }
      }
      function readUnicodeEscapeSequence(scnr, unicode, digits) {
        eat(scnr, unicode);
        let sequence = "";
        for (let i = 0; i < digits; i++) {
          const ch = takeHexDigit(scnr);
          if (!ch) {
            emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
            break;
          }
          sequence += ch;
        }
        return `\\${unicode}${sequence}`;
      }
      function isInvalidIdentifier(ch) {
        return ch !== "{" && ch !== "}" && ch !== CHAR_SP && ch !== CHAR_LF;
      }
      function readInvalidIdentifier(scnr) {
        skipSpaces(scnr);
        let ch = "";
        let identifiers = "";
        while (ch = takeChar(scnr, isInvalidIdentifier)) {
          identifiers += ch;
        }
        return identifiers;
      }
      function readLinkedModifier(scnr) {
        let ch = "";
        let name = "";
        while (ch = takeIdentifierChar(scnr)) {
          name += ch;
        }
        return name;
      }
      function readLinkedRefer(scnr) {
        const fn = (buf) => {
          const ch = scnr.currentChar();
          if (ch === "{" || ch === "%" || ch === "@" || ch === "|" || ch === "(" || ch === ")" || !ch) {
            return buf;
          } else if (ch === CHAR_SP) {
            return buf;
          } else if (ch === CHAR_LF || ch === DOT) {
            buf += ch;
            scnr.next();
            return fn(buf);
          } else {
            buf += ch;
            scnr.next();
            return fn(buf);
          }
        };
        return fn("");
      }
      function readPlural(scnr) {
        skipSpaces(scnr);
        const plural = eat(
          scnr,
          "|"
          /* TokenChars.Pipe */
        );
        skipSpaces(scnr);
        return plural;
      }
      function readTokenInPlaceholder(scnr, context2) {
        let token = null;
        const ch = scnr.currentChar();
        switch (ch) {
          case "{":
            if (context2.braceNest >= 1) {
              emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0);
            }
            scnr.next();
            token = getToken(
              context2,
              2,
              "{"
              /* TokenChars.BraceLeft */
            );
            skipSpaces(scnr);
            context2.braceNest++;
            return token;
          case "}":
            if (context2.braceNest > 0 && context2.currentType === 2) {
              emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0);
            }
            scnr.next();
            token = getToken(
              context2,
              3,
              "}"
              /* TokenChars.BraceRight */
            );
            context2.braceNest--;
            context2.braceNest > 0 && skipSpaces(scnr);
            if (context2.inLinked && context2.braceNest === 0) {
              context2.inLinked = false;
            }
            return token;
          case "@":
            if (context2.braceNest > 0) {
              emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
            }
            token = readTokenInLinked(scnr, context2) || getEndToken(context2);
            context2.braceNest = 0;
            return token;
          default: {
            let validNamedIdentifier = true;
            let validListIdentifier = true;
            let validLiteral = true;
            if (isPluralStart(scnr)) {
              if (context2.braceNest > 0) {
                emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
              }
              token = getToken(context2, 1, readPlural(scnr));
              context2.braceNest = 0;
              context2.inLinked = false;
              return token;
            }
            if (context2.braceNest > 0 && (context2.currentType === 5 || context2.currentType === 6 || context2.currentType === 7)) {
              emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
              context2.braceNest = 0;
              return readToken(scnr, context2);
            }
            if (validNamedIdentifier = isNamedIdentifierStart(scnr, context2)) {
              token = getToken(context2, 5, readNamedIdentifier(scnr));
              skipSpaces(scnr);
              return token;
            }
            if (validListIdentifier = isListIdentifierStart(scnr, context2)) {
              token = getToken(context2, 6, readListIdentifier(scnr));
              skipSpaces(scnr);
              return token;
            }
            if (validLiteral = isLiteralStart(scnr, context2)) {
              token = getToken(context2, 7, readLiteral(scnr));
              skipSpaces(scnr);
              return token;
            }
            if (!validNamedIdentifier && !validListIdentifier && !validLiteral) {
              token = getToken(context2, 13, readInvalidIdentifier(scnr));
              emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);
              skipSpaces(scnr);
              return token;
            }
            break;
          }
        }
        return token;
      }
      function readTokenInLinked(scnr, context2) {
        const { currentType } = context2;
        let token = null;
        const ch = scnr.currentChar();
        if ((currentType === 8 || currentType === 9 || currentType === 12 || currentType === 10) && (ch === CHAR_LF || ch === CHAR_SP)) {
          emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
        }
        switch (ch) {
          case "@":
            scnr.next();
            token = getToken(
              context2,
              8,
              "@"
              /* TokenChars.LinkedAlias */
            );
            context2.inLinked = true;
            return token;
          case ".":
            skipSpaces(scnr);
            scnr.next();
            return getToken(
              context2,
              9,
              "."
              /* TokenChars.LinkedDot */
            );
          case ":":
            skipSpaces(scnr);
            scnr.next();
            return getToken(
              context2,
              10,
              ":"
              /* TokenChars.LinkedDelimiter */
            );
          default:
            if (isPluralStart(scnr)) {
              token = getToken(context2, 1, readPlural(scnr));
              context2.braceNest = 0;
              context2.inLinked = false;
              return token;
            }
            if (isLinkedDotStart(scnr, context2) || isLinkedDelimiterStart(scnr, context2)) {
              skipSpaces(scnr);
              return readTokenInLinked(scnr, context2);
            }
            if (isLinkedModifierStart(scnr, context2)) {
              skipSpaces(scnr);
              return getToken(context2, 12, readLinkedModifier(scnr));
            }
            if (isLinkedReferStart(scnr, context2)) {
              skipSpaces(scnr);
              if (ch === "{") {
                return readTokenInPlaceholder(scnr, context2) || token;
              } else {
                return getToken(context2, 11, readLinkedRefer(scnr));
              }
            }
            if (currentType === 8) {
              emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
            }
            context2.braceNest = 0;
            context2.inLinked = false;
            return readToken(scnr, context2);
        }
      }
      function readToken(scnr, context2) {
        let token = {
          type: 14
          /* TokenTypes.EOF */
        };
        if (context2.braceNest > 0) {
          return readTokenInPlaceholder(scnr, context2) || getEndToken(context2);
        }
        if (context2.inLinked) {
          return readTokenInLinked(scnr, context2) || getEndToken(context2);
        }
        const ch = scnr.currentChar();
        switch (ch) {
          case "{":
            return readTokenInPlaceholder(scnr, context2) || getEndToken(context2);
          case "}":
            emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0);
            scnr.next();
            return getToken(
              context2,
              3,
              "}"
              /* TokenChars.BraceRight */
            );
          case "@":
            return readTokenInLinked(scnr, context2) || getEndToken(context2);
          default: {
            if (isPluralStart(scnr)) {
              token = getToken(context2, 1, readPlural(scnr));
              context2.braceNest = 0;
              context2.inLinked = false;
              return token;
            }
            const { isModulo, hasSpace } = detectModuloStart(scnr);
            if (isModulo) {
              return hasSpace ? getToken(context2, 0, readText(scnr)) : getToken(context2, 4, readModulo(scnr));
            }
            if (isTextStart(scnr)) {
              return getToken(context2, 0, readText(scnr));
            }
            break;
          }
        }
        return token;
      }
      function nextToken() {
        const { currentType, offset, startLoc, endLoc } = _context;
        _context.lastType = currentType;
        _context.lastOffset = offset;
        _context.lastStartLoc = startLoc;
        _context.lastEndLoc = endLoc;
        _context.offset = currentOffset();
        _context.startLoc = currentPosition();
        if (_scnr.currentChar() === EOF) {
          return getToken(
            _context,
            14
            /* TokenTypes.EOF */
          );
        }
        return readToken(_scnr, _context);
      }
      return {
        nextToken,
        currentOffset,
        currentPosition,
        context
      };
    }
    const ERROR_DOMAIN$2 = "parser";
    const KNOWN_ESCAPES = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
    function fromEscapeSequence(match2, codePoint4, codePoint6) {
      switch (match2) {
        case `\\\\`:
          return `\\`;
        case `\\'`:
          return `'`;
        default: {
          const codePoint = parseInt(codePoint4 || codePoint6, 16);
          if (codePoint <= 55295 || codePoint >= 57344) {
            return String.fromCodePoint(codePoint);
          }
          return "�";
        }
      }
    }
    function createParser(options = {}) {
      const location2 = options.location !== false;
      const { onError, onWarn } = options;
      function emitError(tokenzer, code2, start, offset, ...args) {
        const end = tokenzer.currentPosition();
        end.offset += offset;
        end.column += offset;
        if (onError) {
          const loc = location2 ? createLocation(start, end) : null;
          const err = createCompileError(code2, loc, {
            domain: ERROR_DOMAIN$2,
            args
          });
          onError(err);
        }
      }
      function emitWarn(tokenzer, code2, start, offset, ...args) {
        const end = tokenzer.currentPosition();
        end.offset += offset;
        end.column += offset;
        if (onWarn) {
          const loc = location2 ? createLocation(start, end) : null;
          onWarn(createCompileWarn(code2, loc, args));
        }
      }
      function startNode(type, offset, loc) {
        const node = { type };
        if (location2) {
          node.start = offset;
          node.end = offset;
          node.loc = { start: loc, end: loc };
        }
        return node;
      }
      function endNode(node, offset, pos, type) {
        if (location2) {
          node.end = offset;
          if (node.loc) {
            node.loc.end = pos;
          }
        }
      }
      function parseText(tokenizer, value) {
        const context = tokenizer.context();
        const node = startNode(3, context.offset, context.startLoc);
        node.value = value;
        endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
        return node;
      }
      function parseList(tokenizer, index) {
        const context = tokenizer.context();
        const { lastOffset: offset, lastStartLoc: loc } = context;
        const node = startNode(5, offset, loc);
        node.index = parseInt(index, 10);
        tokenizer.nextToken();
        endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
        return node;
      }
      function parseNamed(tokenizer, key, modulo) {
        const context = tokenizer.context();
        const { lastOffset: offset, lastStartLoc: loc } = context;
        const node = startNode(4, offset, loc);
        node.key = key;
        if (modulo === true) {
          node.modulo = true;
        }
        tokenizer.nextToken();
        endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
        return node;
      }
      function parseLiteral(tokenizer, value) {
        const context = tokenizer.context();
        const { lastOffset: offset, lastStartLoc: loc } = context;
        const node = startNode(9, offset, loc);
        node.value = value.replace(KNOWN_ESCAPES, fromEscapeSequence);
        tokenizer.nextToken();
        endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
        return node;
      }
      function parseLinkedModifier(tokenizer) {
        const token = tokenizer.nextToken();
        const context = tokenizer.context();
        const { lastOffset: offset, lastStartLoc: loc } = context;
        const node = startNode(8, offset, loc);
        if (token.type !== 12) {
          emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);
          node.value = "";
          endNode(node, offset, loc);
          return {
            nextConsumeToken: token,
            node
          };
        }
        if (token.value == null) {
          emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
        }
        node.value = token.value || "";
        endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
        return {
          node
        };
      }
      function parseLinkedKey(tokenizer, value) {
        const context = tokenizer.context();
        const node = startNode(7, context.offset, context.startLoc);
        node.value = value;
        endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
        return node;
      }
      function parseLinked(tokenizer) {
        const context = tokenizer.context();
        const linkedNode = startNode(6, context.offset, context.startLoc);
        let token = tokenizer.nextToken();
        if (token.type === 9) {
          const parsed = parseLinkedModifier(tokenizer);
          linkedNode.modifier = parsed.node;
          token = parsed.nextConsumeToken || tokenizer.nextToken();
        }
        if (token.type !== 10) {
          emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
        }
        token = tokenizer.nextToken();
        if (token.type === 2) {
          token = tokenizer.nextToken();
        }
        switch (token.type) {
          case 11:
            if (token.value == null) {
              emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
            }
            linkedNode.key = parseLinkedKey(tokenizer, token.value || "");
            break;
          case 5:
            if (token.value == null) {
              emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
            }
            linkedNode.key = parseNamed(tokenizer, token.value || "");
            break;
          case 6:
            if (token.value == null) {
              emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
            }
            linkedNode.key = parseList(tokenizer, token.value || "");
            break;
          case 7:
            if (token.value == null) {
              emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
            }
            linkedNode.key = parseLiteral(tokenizer, token.value || "");
            break;
          default: {
            emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0);
            const nextContext = tokenizer.context();
            const emptyLinkedKeyNode = startNode(7, nextContext.offset, nextContext.startLoc);
            emptyLinkedKeyNode.value = "";
            endNode(emptyLinkedKeyNode, nextContext.offset, nextContext.startLoc);
            linkedNode.key = emptyLinkedKeyNode;
            endNode(linkedNode, nextContext.offset, nextContext.startLoc);
            return {
              nextConsumeToken: token,
              node: linkedNode
            };
          }
        }
        endNode(linkedNode, tokenizer.currentOffset(), tokenizer.currentPosition());
        return {
          node: linkedNode
        };
      }
      function parseMessage(tokenizer) {
        const context = tokenizer.context();
        const startOffset = context.currentType === 1 ? tokenizer.currentOffset() : context.offset;
        const startLoc = context.currentType === 1 ? context.endLoc : context.startLoc;
        const node = startNode(2, startOffset, startLoc);
        node.items = [];
        let nextToken = null;
        let modulo = null;
        do {
          const token = nextToken || tokenizer.nextToken();
          nextToken = null;
          switch (token.type) {
            case 0:
              if (token.value == null) {
                emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
              }
              node.items.push(parseText(tokenizer, token.value || ""));
              break;
            case 6:
              if (token.value == null) {
                emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
              }
              node.items.push(parseList(tokenizer, token.value || ""));
              break;
            case 4:
              modulo = true;
              break;
            case 5:
              if (token.value == null) {
                emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
              }
              node.items.push(parseNamed(tokenizer, token.value || "", !!modulo));
              if (modulo) {
                emitWarn(tokenizer, CompileWarnCodes.USE_MODULO_SYNTAX, context.lastStartLoc, 0, getTokenCaption(token));
                modulo = null;
              }
              break;
            case 7:
              if (token.value == null) {
                emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
              }
              node.items.push(parseLiteral(tokenizer, token.value || ""));
              break;
            case 8: {
              const parsed = parseLinked(tokenizer);
              node.items.push(parsed.node);
              nextToken = parsed.nextConsumeToken || null;
              break;
            }
          }
        } while (context.currentType !== 14 && context.currentType !== 1);
        const endOffset = context.currentType === 1 ? context.lastOffset : tokenizer.currentOffset();
        const endLoc = context.currentType === 1 ? context.lastEndLoc : tokenizer.currentPosition();
        endNode(node, endOffset, endLoc);
        return node;
      }
      function parsePlural(tokenizer, offset, loc, msgNode) {
        const context = tokenizer.context();
        let hasEmptyMessage = msgNode.items.length === 0;
        const node = startNode(1, offset, loc);
        node.cases = [];
        node.cases.push(msgNode);
        do {
          const msg2 = parseMessage(tokenizer);
          if (!hasEmptyMessage) {
            hasEmptyMessage = msg2.items.length === 0;
          }
          node.cases.push(msg2);
        } while (context.currentType !== 14);
        if (hasEmptyMessage) {
          emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);
        }
        endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
        return node;
      }
      function parseResource(tokenizer) {
        const context = tokenizer.context();
        const { offset, startLoc } = context;
        const msgNode = parseMessage(tokenizer);
        if (context.currentType === 14) {
          return msgNode;
        } else {
          return parsePlural(tokenizer, offset, startLoc, msgNode);
        }
      }
      function parse2(source) {
        const tokenizer = createTokenizer(source, assign({}, options));
        const context = tokenizer.context();
        const node = startNode(0, context.offset, context.startLoc);
        if (location2 && node.loc) {
          node.loc.source = source;
        }
        node.body = parseResource(tokenizer);
        if (options.onCacheKey) {
          node.cacheKey = options.onCacheKey(source);
        }
        if (context.currentType !== 14) {
          emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || "");
        }
        endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
        return node;
      }
      return { parse: parse2 };
    }
    function getTokenCaption(token) {
      if (token.type === 14) {
        return "EOF";
      }
      const name = (token.value || "").replace(/\r?\n/gu, "\\n");
      return name.length > 10 ? name.slice(0, 9) + "…" : name;
    }
    function createTransformer(ast, options = {}) {
      const _context = {
        ast,
        helpers: /* @__PURE__ */ new Set()
      };
      const context = () => _context;
      const helper = (name) => {
        _context.helpers.add(name);
        return name;
      };
      return { context, helper };
    }
    function traverseNodes(nodes, transformer) {
      for (let i = 0; i < nodes.length; i++) {
        traverseNode(nodes[i], transformer);
      }
    }
    function traverseNode(node, transformer) {
      switch (node.type) {
        case 1:
          traverseNodes(node.cases, transformer);
          transformer.helper(
            "plural"
            /* HelperNameMap.PLURAL */
          );
          break;
        case 2:
          traverseNodes(node.items, transformer);
          break;
        case 6: {
          const linked = node;
          traverseNode(linked.key, transformer);
          transformer.helper(
            "linked"
            /* HelperNameMap.LINKED */
          );
          transformer.helper(
            "type"
            /* HelperNameMap.TYPE */
          );
          break;
        }
        case 5:
          transformer.helper(
            "interpolate"
            /* HelperNameMap.INTERPOLATE */
          );
          transformer.helper(
            "list"
            /* HelperNameMap.LIST */
          );
          break;
        case 4:
          transformer.helper(
            "interpolate"
            /* HelperNameMap.INTERPOLATE */
          );
          transformer.helper(
            "named"
            /* HelperNameMap.NAMED */
          );
          break;
      }
    }
    function transform(ast, options = {}) {
      const transformer = createTransformer(ast);
      transformer.helper(
        "normalize"
        /* HelperNameMap.NORMALIZE */
      );
      ast.body && traverseNode(ast.body, transformer);
      const context = transformer.context();
      ast.helpers = Array.from(context.helpers);
    }
    function optimize(ast) {
      const body = ast.body;
      if (body.type === 2) {
        optimizeMessageNode(body);
      } else {
        body.cases.forEach((c2) => optimizeMessageNode(c2));
      }
      return ast;
    }
    function optimizeMessageNode(message) {
      if (message.items.length === 1) {
        const item = message.items[0];
        if (item.type === 3 || item.type === 9) {
          message.static = item.value;
          delete item.value;
        }
      } else {
        const values = [];
        for (let i = 0; i < message.items.length; i++) {
          const item = message.items[i];
          if (!(item.type === 3 || item.type === 9)) {
            break;
          }
          if (item.value == null) {
            break;
          }
          values.push(item.value);
        }
        if (values.length === message.items.length) {
          message.static = join(values);
          for (let i = 0; i < message.items.length; i++) {
            const item = message.items[i];
            if (item.type === 3 || item.type === 9) {
              delete item.value;
            }
          }
        }
      }
    }
    const ERROR_DOMAIN$1 = "minifier";
    function minify(node) {
      node.t = node.type;
      switch (node.type) {
        case 0: {
          const resource = node;
          minify(resource.body);
          resource.b = resource.body;
          delete resource.body;
          break;
        }
        case 1: {
          const plural = node;
          const cases = plural.cases;
          for (let i = 0; i < cases.length; i++) {
            minify(cases[i]);
          }
          plural.c = cases;
          delete plural.cases;
          break;
        }
        case 2: {
          const message = node;
          const items = message.items;
          for (let i = 0; i < items.length; i++) {
            minify(items[i]);
          }
          message.i = items;
          delete message.items;
          if (message.static) {
            message.s = message.static;
            delete message.static;
          }
          break;
        }
        case 3:
        case 9:
        case 8:
        case 7: {
          const valueNode = node;
          if (valueNode.value) {
            valueNode.v = valueNode.value;
            delete valueNode.value;
          }
          break;
        }
        case 6: {
          const linked = node;
          minify(linked.key);
          linked.k = linked.key;
          delete linked.key;
          if (linked.modifier) {
            minify(linked.modifier);
            linked.m = linked.modifier;
            delete linked.modifier;
          }
          break;
        }
        case 5: {
          const list = node;
          list.i = list.index;
          delete list.index;
          break;
        }
        case 4: {
          const named = node;
          named.k = named.key;
          delete named.key;
          break;
        }
        default: {
          throw createCompileError(CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE, null, {
            domain: ERROR_DOMAIN$1,
            args: [node.type]
          });
        }
      }
      delete node.type;
    }
    const ERROR_DOMAIN = "parser";
    function createCodeGenerator(ast, options) {
      const { sourceMap, filename, breakLineCode, needIndent: _needIndent } = options;
      const location2 = options.location !== false;
      const _context = {
        filename,
        code: "",
        column: 1,
        line: 1,
        offset: 0,
        map: void 0,
        breakLineCode,
        needIndent: _needIndent,
        indentLevel: 0
      };
      if (location2 && ast.loc) {
        _context.source = ast.loc.source;
      }
      const context = () => _context;
      function push(code2, node) {
        _context.code += code2;
      }
      function _newline(n, withBreakLine = true) {
        const _breakLineCode = withBreakLine ? breakLineCode : "";
        push(_needIndent ? _breakLineCode + `  `.repeat(n) : _breakLineCode);
      }
      function indent(withNewLine = true) {
        const level = ++_context.indentLevel;
        withNewLine && _newline(level);
      }
      function deindent(withNewLine = true) {
        const level = --_context.indentLevel;
        withNewLine && _newline(level);
      }
      function newline() {
        _newline(_context.indentLevel);
      }
      const helper = (key) => `_${key}`;
      const needIndent = () => _context.needIndent;
      return {
        context,
        push,
        indent,
        deindent,
        newline,
        helper,
        needIndent
      };
    }
    function generateLinkedNode(generator, node) {
      const { helper } = generator;
      generator.push(`${helper(
        "linked"
        /* HelperNameMap.LINKED */
      )}(`);
      generateNode(generator, node.key);
      if (node.modifier) {
        generator.push(`, `);
        generateNode(generator, node.modifier);
        generator.push(`, _type`);
      } else {
        generator.push(`, undefined, _type`);
      }
      generator.push(`)`);
    }
    function generateMessageNode(generator, node) {
      const { helper, needIndent } = generator;
      generator.push(`${helper(
        "normalize"
        /* HelperNameMap.NORMALIZE */
      )}([`);
      generator.indent(needIndent());
      const length = node.items.length;
      for (let i = 0; i < length; i++) {
        generateNode(generator, node.items[i]);
        if (i === length - 1) {
          break;
        }
        generator.push(", ");
      }
      generator.deindent(needIndent());
      generator.push("])");
    }
    function generatePluralNode(generator, node) {
      const { helper, needIndent } = generator;
      if (node.cases.length > 1) {
        generator.push(`${helper(
          "plural"
          /* HelperNameMap.PLURAL */
        )}([`);
        generator.indent(needIndent());
        const length = node.cases.length;
        for (let i = 0; i < length; i++) {
          generateNode(generator, node.cases[i]);
          if (i === length - 1) {
            break;
          }
          generator.push(", ");
        }
        generator.deindent(needIndent());
        generator.push(`])`);
      }
    }
    function generateResource(generator, node) {
      if (node.body) {
        generateNode(generator, node.body);
      } else {
        generator.push("null");
      }
    }
    function generateNode(generator, node) {
      const { helper } = generator;
      switch (node.type) {
        case 0:
          generateResource(generator, node);
          break;
        case 1:
          generatePluralNode(generator, node);
          break;
        case 2:
          generateMessageNode(generator, node);
          break;
        case 6:
          generateLinkedNode(generator, node);
          break;
        case 8:
          generator.push(JSON.stringify(node.value), node);
          break;
        case 7:
          generator.push(JSON.stringify(node.value), node);
          break;
        case 5:
          generator.push(`${helper(
            "interpolate"
            /* HelperNameMap.INTERPOLATE */
          )}(${helper(
            "list"
            /* HelperNameMap.LIST */
          )}(${node.index}))`, node);
          break;
        case 4:
          generator.push(`${helper(
            "interpolate"
            /* HelperNameMap.INTERPOLATE */
          )}(${helper(
            "named"
            /* HelperNameMap.NAMED */
          )}(${JSON.stringify(node.key)}))`, node);
          break;
        case 9:
          generator.push(JSON.stringify(node.value), node);
          break;
        case 3:
          generator.push(JSON.stringify(node.value), node);
          break;
        default: {
          throw createCompileError(CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE, null, {
            domain: ERROR_DOMAIN,
            args: [node.type]
          });
        }
      }
    }
    const generate = (ast, options = {}) => {
      const mode = isString(options.mode) ? options.mode : "normal";
      const filename = isString(options.filename) ? options.filename : "message.intl";
      const sourceMap = !!options.sourceMap;
      const breakLineCode = options.breakLineCode != null ? options.breakLineCode : mode === "arrow" ? ";" : "\n";
      const needIndent = options.needIndent ? options.needIndent : mode !== "arrow";
      const helpers = ast.helpers || [];
      const generator = createCodeGenerator(ast, {
        mode,
        filename,
        sourceMap,
        breakLineCode,
        needIndent
      });
      generator.push(mode === "normal" ? `function __msg__ (ctx) {` : `(ctx) => {`);
      generator.indent(needIndent);
      if (helpers.length > 0) {
        generator.push(`const { ${join(helpers.map((s) => `${s}: _${s}`), ", ")} } = ctx`);
        generator.newline();
      }
      generator.push(`return `);
      generateNode(generator, ast);
      generator.deindent(needIndent);
      generator.push(`}`);
      delete ast.helpers;
      const { code: code2, map: map2 } = generator.context();
      return {
        ast,
        code: code2,
        map: map2 ? map2.toJSON() : void 0
        // eslint-disable-line @typescript-eslint/no-explicit-any
      };
    };
    function baseCompile$1(source, options = {}) {
      const assignedOptions = assign({}, options);
      const jit = !!assignedOptions.jit;
      const enalbeMinify = !!assignedOptions.minify;
      const enambeOptimize = assignedOptions.optimize == null ? true : assignedOptions.optimize;
      const parser = createParser(assignedOptions);
      const ast = parser.parse(source);
      if (!jit) {
        transform(ast, assignedOptions);
        return generate(ast, assignedOptions);
      } else {
        enambeOptimize && optimize(ast);
        enalbeMinify && minify(ast);
        return { ast, code: "" };
      }
    }
    /*!
      * core-base v9.14.1
      * (c) 2024 kazuya kawaguchi
      * Released under the MIT License.
      */
    function initFeatureFlags$1() {
      if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
        getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
      }
      if (typeof __INTLIFY_JIT_COMPILATION__ !== "boolean") {
        getGlobalThis().__INTLIFY_JIT_COMPILATION__ = false;
      }
      if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== "boolean") {
        getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;
      }
    }
    const pathStateMachine = [];
    pathStateMachine[
      0
      /* States.BEFORE_PATH */
    ] = {
      [
        "w"
        /* PathCharTypes.WORKSPACE */
      ]: [
        0
        /* States.BEFORE_PATH */
      ],
      [
        "i"
        /* PathCharTypes.IDENT */
      ]: [
        3,
        0
        /* Actions.APPEND */
      ],
      [
        "["
        /* PathCharTypes.LEFT_BRACKET */
      ]: [
        4
        /* States.IN_SUB_PATH */
      ],
      [
        "o"
        /* PathCharTypes.END_OF_FAIL */
      ]: [
        7
        /* States.AFTER_PATH */
      ]
    };
    pathStateMachine[
      1
      /* States.IN_PATH */
    ] = {
      [
        "w"
        /* PathCharTypes.WORKSPACE */
      ]: [
        1
        /* States.IN_PATH */
      ],
      [
        "."
        /* PathCharTypes.DOT */
      ]: [
        2
        /* States.BEFORE_IDENT */
      ],
      [
        "["
        /* PathCharTypes.LEFT_BRACKET */
      ]: [
        4
        /* States.IN_SUB_PATH */
      ],
      [
        "o"
        /* PathCharTypes.END_OF_FAIL */
      ]: [
        7
        /* States.AFTER_PATH */
      ]
    };
    pathStateMachine[
      2
      /* States.BEFORE_IDENT */
    ] = {
      [
        "w"
        /* PathCharTypes.WORKSPACE */
      ]: [
        2
        /* States.BEFORE_IDENT */
      ],
      [
        "i"
        /* PathCharTypes.IDENT */
      ]: [
        3,
        0
        /* Actions.APPEND */
      ],
      [
        "0"
        /* PathCharTypes.ZERO */
      ]: [
        3,
        0
        /* Actions.APPEND */
      ]
    };
    pathStateMachine[
      3
      /* States.IN_IDENT */
    ] = {
      [
        "i"
        /* PathCharTypes.IDENT */
      ]: [
        3,
        0
        /* Actions.APPEND */
      ],
      [
        "0"
        /* PathCharTypes.ZERO */
      ]: [
        3,
        0
        /* Actions.APPEND */
      ],
      [
        "w"
        /* PathCharTypes.WORKSPACE */
      ]: [
        1,
        1
        /* Actions.PUSH */
      ],
      [
        "."
        /* PathCharTypes.DOT */
      ]: [
        2,
        1
        /* Actions.PUSH */
      ],
      [
        "["
        /* PathCharTypes.LEFT_BRACKET */
      ]: [
        4,
        1
        /* Actions.PUSH */
      ],
      [
        "o"
        /* PathCharTypes.END_OF_FAIL */
      ]: [
        7,
        1
        /* Actions.PUSH */
      ]
    };
    pathStateMachine[
      4
      /* States.IN_SUB_PATH */
    ] = {
      [
        "'"
        /* PathCharTypes.SINGLE_QUOTE */
      ]: [
        5,
        0
        /* Actions.APPEND */
      ],
      [
        '"'
        /* PathCharTypes.DOUBLE_QUOTE */
      ]: [
        6,
        0
        /* Actions.APPEND */
      ],
      [
        "["
        /* PathCharTypes.LEFT_BRACKET */
      ]: [
        4,
        2
        /* Actions.INC_SUB_PATH_DEPTH */
      ],
      [
        "]"
        /* PathCharTypes.RIGHT_BRACKET */
      ]: [
        1,
        3
        /* Actions.PUSH_SUB_PATH */
      ],
      [
        "o"
        /* PathCharTypes.END_OF_FAIL */
      ]: 8,
      [
        "l"
        /* PathCharTypes.ELSE */
      ]: [
        4,
        0
        /* Actions.APPEND */
      ]
    };
    pathStateMachine[
      5
      /* States.IN_SINGLE_QUOTE */
    ] = {
      [
        "'"
        /* PathCharTypes.SINGLE_QUOTE */
      ]: [
        4,
        0
        /* Actions.APPEND */
      ],
      [
        "o"
        /* PathCharTypes.END_OF_FAIL */
      ]: 8,
      [
        "l"
        /* PathCharTypes.ELSE */
      ]: [
        5,
        0
        /* Actions.APPEND */
      ]
    };
    pathStateMachine[
      6
      /* States.IN_DOUBLE_QUOTE */
    ] = {
      [
        '"'
        /* PathCharTypes.DOUBLE_QUOTE */
      ]: [
        4,
        0
        /* Actions.APPEND */
      ],
      [
        "o"
        /* PathCharTypes.END_OF_FAIL */
      ]: 8,
      [
        "l"
        /* PathCharTypes.ELSE */
      ]: [
        6,
        0
        /* Actions.APPEND */
      ]
    };
    const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
    function isLiteral(exp) {
      return literalValueRE.test(exp);
    }
    function stripQuotes(str) {
      const a = str.charCodeAt(0);
      const b = str.charCodeAt(str.length - 1);
      return a === b && (a === 34 || a === 39) ? str.slice(1, -1) : str;
    }
    function getPathCharType(ch) {
      if (ch === void 0 || ch === null) {
        return "o";
      }
      const code2 = ch.charCodeAt(0);
      switch (code2) {
        case 91:
        case 93:
        case 46:
        case 34:
        case 39:
          return ch;
        case 95:
        case 36:
        case 45:
          return "i";
        case 9:
        case 10:
        case 13:
        case 160:
        case 65279:
        case 8232:
        case 8233:
          return "w";
      }
      return "i";
    }
    function formatSubPath(path) {
      const trimmed = path.trim();
      if (path.charAt(0) === "0" && isNaN(parseInt(path))) {
        return false;
      }
      return isLiteral(trimmed) ? stripQuotes(trimmed) : "*" + trimmed;
    }
    function parse(path) {
      const keys2 = [];
      let index = -1;
      let mode = 0;
      let subPathDepth = 0;
      let c2;
      let key;
      let newChar;
      let type;
      let transition;
      let action;
      let typeMap;
      const actions = [];
      actions[
        0
        /* Actions.APPEND */
      ] = () => {
        if (key === void 0) {
          key = newChar;
        } else {
          key += newChar;
        }
      };
      actions[
        1
        /* Actions.PUSH */
      ] = () => {
        if (key !== void 0) {
          keys2.push(key);
          key = void 0;
        }
      };
      actions[
        2
        /* Actions.INC_SUB_PATH_DEPTH */
      ] = () => {
        actions[
          0
          /* Actions.APPEND */
        ]();
        subPathDepth++;
      };
      actions[
        3
        /* Actions.PUSH_SUB_PATH */
      ] = () => {
        if (subPathDepth > 0) {
          subPathDepth--;
          mode = 4;
          actions[
            0
            /* Actions.APPEND */
          ]();
        } else {
          subPathDepth = 0;
          if (key === void 0) {
            return false;
          }
          key = formatSubPath(key);
          if (key === false) {
            return false;
          } else {
            actions[
              1
              /* Actions.PUSH */
            ]();
          }
        }
      };
      function maybeUnescapeQuote() {
        const nextChar = path[index + 1];
        if (mode === 5 && nextChar === "'" || mode === 6 && nextChar === '"') {
          index++;
          newChar = "\\" + nextChar;
          actions[
            0
            /* Actions.APPEND */
          ]();
          return true;
        }
      }
      while (mode !== null) {
        index++;
        c2 = path[index];
        if (c2 === "\\" && maybeUnescapeQuote()) {
          continue;
        }
        type = getPathCharType(c2);
        typeMap = pathStateMachine[mode];
        transition = typeMap[type] || typeMap[
          "l"
          /* PathCharTypes.ELSE */
        ] || 8;
        if (transition === 8) {
          return;
        }
        mode = transition[0];
        if (transition[1] !== void 0) {
          action = actions[transition[1]];
          if (action) {
            newChar = c2;
            if (action() === false) {
              return;
            }
          }
        }
        if (mode === 7) {
          return keys2;
        }
      }
    }
    const cache = /* @__PURE__ */ new Map();
    function resolveWithKeyValue(obj, path) {
      return isObject$2(obj) ? obj[path] : null;
    }
    function resolveValue(obj, path) {
      if (!isObject$2(obj)) {
        return null;
      }
      let hit = cache.get(path);
      if (!hit) {
        hit = parse(path);
        if (hit) {
          cache.set(path, hit);
        }
      }
      if (!hit) {
        return null;
      }
      const len2 = hit.length;
      let last = obj;
      let i = 0;
      while (i < len2) {
        const val = last[hit[i]];
        if (val === void 0) {
          return null;
        }
        if (isFunction(last)) {
          return null;
        }
        last = val;
        i++;
      }
      return last;
    }
    const DEFAULT_MODIFIER = (str) => str;
    const DEFAULT_MESSAGE = (ctx2) => "";
    const DEFAULT_MESSAGE_DATA_TYPE = "text";
    const DEFAULT_NORMALIZE = (values) => values.length === 0 ? "" : join$1(values);
    const DEFAULT_INTERPOLATE = toDisplayString;
    function pluralDefault(choice, choicesLength) {
      choice = Math.abs(choice);
      if (choicesLength === 2) {
        return choice ? choice > 1 ? 1 : 0 : 1;
      }
      return choice ? Math.min(choice, 2) : 0;
    }
    function getPluralIndex(options) {
      const index = isNumber(options.pluralIndex) ? options.pluralIndex : -1;
      return options.named && (isNumber(options.named.count) || isNumber(options.named.n)) ? isNumber(options.named.count) ? options.named.count : isNumber(options.named.n) ? options.named.n : index : index;
    }
    function normalizeNamed(pluralIndex, props) {
      if (!props.count) {
        props.count = pluralIndex;
      }
      if (!props.n) {
        props.n = pluralIndex;
      }
    }
    function createMessageContext(options = {}) {
      const locale = options.locale;
      const pluralIndex = getPluralIndex(options);
      const pluralRule = isObject$2(options.pluralRules) && isString$1(locale) && isFunction(options.pluralRules[locale]) ? options.pluralRules[locale] : pluralDefault;
      const orgPluralRule = isObject$2(options.pluralRules) && isString$1(locale) && isFunction(options.pluralRules[locale]) ? pluralDefault : void 0;
      const plural = (messages) => {
        return messages[pluralRule(pluralIndex, messages.length, orgPluralRule)];
      };
      const _list = options.list || [];
      const list = (index) => _list[index];
      const _named = options.named || {};
      isNumber(options.pluralIndex) && normalizeNamed(pluralIndex, _named);
      const named = (key) => _named[key];
      function message(key) {
        const msg2 = isFunction(options.messages) ? options.messages(key) : isObject$2(options.messages) ? options.messages[key] : false;
        return !msg2 ? options.parent ? options.parent.message(key) : DEFAULT_MESSAGE : msg2;
      }
      const _modifier = (name) => options.modifiers ? options.modifiers[name] : DEFAULT_MODIFIER;
      const normalize = isPlainObject(options.processor) && isFunction(options.processor.normalize) ? options.processor.normalize : DEFAULT_NORMALIZE;
      const interpolate = isPlainObject(options.processor) && isFunction(options.processor.interpolate) ? options.processor.interpolate : DEFAULT_INTERPOLATE;
      const type = isPlainObject(options.processor) && isString$1(options.processor.type) ? options.processor.type : DEFAULT_MESSAGE_DATA_TYPE;
      const linked = (key, ...args) => {
        const [arg1, arg2] = args;
        let type2 = "text";
        let modifier = "";
        if (args.length === 1) {
          if (isObject$2(arg1)) {
            modifier = arg1.modifier || modifier;
            type2 = arg1.type || type2;
          } else if (isString$1(arg1)) {
            modifier = arg1 || modifier;
          }
        } else if (args.length === 2) {
          if (isString$1(arg1)) {
            modifier = arg1 || modifier;
          }
          if (isString$1(arg2)) {
            type2 = arg2 || type2;
          }
        }
        const ret = message(key)(ctx2);
        const msg2 = (
          // The message in vnode resolved with linked are returned as an array by processor.nomalize
          type2 === "vnode" && isArray(ret) && modifier ? ret[0] : ret
        );
        return modifier ? _modifier(modifier)(msg2, type2) : msg2;
      };
      const ctx2 = {
        [
          "list"
          /* HelperNameMap.LIST */
        ]: list,
        [
          "named"
          /* HelperNameMap.NAMED */
        ]: named,
        [
          "plural"
          /* HelperNameMap.PLURAL */
        ]: plural,
        [
          "linked"
          /* HelperNameMap.LINKED */
        ]: linked,
        [
          "message"
          /* HelperNameMap.MESSAGE */
        ]: message,
        [
          "type"
          /* HelperNameMap.TYPE */
        ]: type,
        [
          "interpolate"
          /* HelperNameMap.INTERPOLATE */
        ]: interpolate,
        [
          "normalize"
          /* HelperNameMap.NORMALIZE */
        ]: normalize,
        [
          "values"
          /* HelperNameMap.VALUES */
        ]: assign$1({}, _list, _named)
      };
      return ctx2;
    }
    let devtools = null;
    function setDevToolsHook(hook) {
      devtools = hook;
    }
    function initI18nDevTools(i18n2, version2, meta) {
      devtools && devtools.emit("i18n:init", {
        timestamp: Date.now(),
        i18n: i18n2,
        version: version2,
        meta
      });
    }
    const translateDevTools = /* @__PURE__ */ createDevToolsHook(
      "function:translate"
      /* IntlifyDevToolsHooks.FunctionTranslate */
    );
    function createDevToolsHook(hook) {
      return (payloads) => devtools && devtools.emit(hook, payloads);
    }
    const code$1$1 = CompileWarnCodes.__EXTEND_POINT__;
    const inc$1$1 = incrementer(code$1$1);
    const CoreWarnCodes = {
      NOT_FOUND_KEY: code$1$1,
      // 2
      FALLBACK_TO_TRANSLATE: inc$1$1(),
      // 3
      CANNOT_FORMAT_NUMBER: inc$1$1(),
      // 4
      FALLBACK_TO_NUMBER_FORMAT: inc$1$1(),
      // 5
      CANNOT_FORMAT_DATE: inc$1$1(),
      // 6
      FALLBACK_TO_DATE_FORMAT: inc$1$1(),
      // 7
      EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: inc$1$1(),
      // 8
      __EXTEND_POINT__: inc$1$1()
      // 9
    };
    const code$2 = CompileErrorCodes.__EXTEND_POINT__;
    const inc$2 = incrementer(code$2);
    const CoreErrorCodes = {
      INVALID_ARGUMENT: code$2,
      // 17
      INVALID_DATE_ARGUMENT: inc$2(),
      // 18
      INVALID_ISO_DATE_ARGUMENT: inc$2(),
      // 19
      NOT_SUPPORT_NON_STRING_MESSAGE: inc$2(),
      // 20
      NOT_SUPPORT_LOCALE_PROMISE_VALUE: inc$2(),
      // 21
      NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: inc$2(),
      // 22
      NOT_SUPPORT_LOCALE_TYPE: inc$2(),
      // 23
      __EXTEND_POINT__: inc$2()
      // 24
    };
    function createCoreError(code2) {
      return createCompileError(code2, null, void 0);
    }
    function getLocale(context, options) {
      return options.locale != null ? resolveLocale(options.locale) : resolveLocale(context.locale);
    }
    let _resolveLocale;
    function resolveLocale(locale) {
      if (isString$1(locale)) {
        return locale;
      } else {
        if (isFunction(locale)) {
          if (locale.resolvedOnce && _resolveLocale != null) {
            return _resolveLocale;
          } else if (locale.constructor.name === "Function") {
            const resolve2 = locale();
            if (isPromise(resolve2)) {
              throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
            }
            return _resolveLocale = resolve2;
          } else {
            throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
          }
        } else {
          throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE);
        }
      }
    }
    function fallbackWithSimple(ctx2, fallback, start) {
      return [.../* @__PURE__ */ new Set([
        start,
        ...isArray(fallback) ? fallback : isObject$2(fallback) ? Object.keys(fallback) : isString$1(fallback) ? [fallback] : [start]
      ])];
    }
    function fallbackWithLocaleChain(ctx2, fallback, start) {
      const startLocale = isString$1(start) ? start : DEFAULT_LOCALE;
      const context = ctx2;
      if (!context.__localeChainCache) {
        context.__localeChainCache = /* @__PURE__ */ new Map();
      }
      let chain = context.__localeChainCache.get(startLocale);
      if (!chain) {
        chain = [];
        let block = [start];
        while (isArray(block)) {
          block = appendBlockToChain(chain, block, fallback);
        }
        const defaults = isArray(fallback) || !isPlainObject(fallback) ? fallback : fallback["default"] ? fallback["default"] : null;
        block = isString$1(defaults) ? [defaults] : defaults;
        if (isArray(block)) {
          appendBlockToChain(chain, block, false);
        }
        context.__localeChainCache.set(startLocale, chain);
      }
      return chain;
    }
    function appendBlockToChain(chain, block, blocks) {
      let follow = true;
      for (let i = 0; i < block.length && isBoolean(follow); i++) {
        const locale = block[i];
        if (isString$1(locale)) {
          follow = appendLocaleToChain(chain, block[i], blocks);
        }
      }
      return follow;
    }
    function appendLocaleToChain(chain, locale, blocks) {
      let follow;
      const tokens = locale.split("-");
      do {
        const target = tokens.join("-");
        follow = appendItemToChain(chain, target, blocks);
        tokens.splice(-1, 1);
      } while (tokens.length && follow === true);
      return follow;
    }
    function appendItemToChain(chain, target, blocks) {
      let follow = false;
      if (!chain.includes(target)) {
        follow = true;
        if (target) {
          follow = target[target.length - 1] !== "!";
          const locale = target.replace(/!/g, "");
          chain.push(locale);
          if ((isArray(blocks) || isPlainObject(blocks)) && blocks[locale]) {
            follow = blocks[locale];
          }
        }
      }
      return follow;
    }
    const VERSION$1 = "9.14.1";
    const NOT_REOSLVED = -1;
    const DEFAULT_LOCALE = "en-US";
    const MISSING_RESOLVE_VALUE = "";
    const capitalize = (str) => `${str.charAt(0).toLocaleUpperCase()}${str.substr(1)}`;
    function getDefaultLinkedModifiers() {
      return {
        upper: (val, type) => {
          return type === "text" && isString$1(val) ? val.toUpperCase() : type === "vnode" && isObject$2(val) && "__v_isVNode" in val ? val.children.toUpperCase() : val;
        },
        lower: (val, type) => {
          return type === "text" && isString$1(val) ? val.toLowerCase() : type === "vnode" && isObject$2(val) && "__v_isVNode" in val ? val.children.toLowerCase() : val;
        },
        capitalize: (val, type) => {
          return type === "text" && isString$1(val) ? capitalize(val) : type === "vnode" && isObject$2(val) && "__v_isVNode" in val ? capitalize(val.children) : val;
        }
      };
    }
    let _compiler;
    function registerMessageCompiler(compiler) {
      _compiler = compiler;
    }
    let _resolver;
    function registerMessageResolver(resolver) {
      _resolver = resolver;
    }
    let _fallbacker;
    function registerLocaleFallbacker(fallbacker) {
      _fallbacker = fallbacker;
    }
    let _additionalMeta = null;
    const setAdditionalMeta = /* @__NO_SIDE_EFFECTS__ */ (meta) => {
      _additionalMeta = meta;
    };
    const getAdditionalMeta = /* @__NO_SIDE_EFFECTS__ */ () => _additionalMeta;
    let _fallbackContext = null;
    const setFallbackContext = (context) => {
      _fallbackContext = context;
    };
    const getFallbackContext = () => _fallbackContext;
    let _cid = 0;
    function createCoreContext(options = {}) {
      const onWarn = isFunction(options.onWarn) ? options.onWarn : warn;
      const version2 = isString$1(options.version) ? options.version : VERSION$1;
      const locale = isString$1(options.locale) || isFunction(options.locale) ? options.locale : DEFAULT_LOCALE;
      const _locale = isFunction(locale) ? DEFAULT_LOCALE : locale;
      const fallbackLocale = isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || isString$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale;
      const messages = isPlainObject(options.messages) ? options.messages : { [_locale]: {} };
      const datetimeFormats = isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale]: {} };
      const numberFormats = isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale]: {} };
      const modifiers = assign$1({}, options.modifiers || {}, getDefaultLinkedModifiers());
      const pluralRules = options.pluralRules || {};
      const missing = isFunction(options.missing) ? options.missing : null;
      const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
      const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
      const fallbackFormat = !!options.fallbackFormat;
      const unresolving = !!options.unresolving;
      const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
      const processor = isPlainObject(options.processor) ? options.processor : null;
      const warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
      const escapeParameter = !!options.escapeParameter;
      const messageCompiler = isFunction(options.messageCompiler) ? options.messageCompiler : _compiler;
      const messageResolver = isFunction(options.messageResolver) ? options.messageResolver : _resolver || resolveWithKeyValue;
      const localeFallbacker = isFunction(options.localeFallbacker) ? options.localeFallbacker : _fallbacker || fallbackWithSimple;
      const fallbackContext = isObject$2(options.fallbackContext) ? options.fallbackContext : void 0;
      const internalOptions = options;
      const __datetimeFormatters = isObject$2(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map();
      const __numberFormatters = isObject$2(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map();
      const __meta = isObject$2(internalOptions.__meta) ? internalOptions.__meta : {};
      _cid++;
      const context = {
        version: version2,
        cid: _cid,
        locale,
        fallbackLocale,
        messages,
        modifiers,
        pluralRules,
        missing,
        missingWarn,
        fallbackWarn,
        fallbackFormat,
        unresolving,
        postTranslation,
        processor,
        warnHtmlMessage,
        escapeParameter,
        messageCompiler,
        messageResolver,
        localeFallbacker,
        fallbackContext,
        onWarn,
        __meta
      };
      {
        context.datetimeFormats = datetimeFormats;
        context.numberFormats = numberFormats;
        context.__datetimeFormatters = __datetimeFormatters;
        context.__numberFormatters = __numberFormatters;
      }
      if (__INTLIFY_PROD_DEVTOOLS__) {
        initI18nDevTools(context, version2, __meta);
      }
      return context;
    }
    function handleMissing(context, key, locale, missingWarn, type) {
      const { missing, onWarn } = context;
      if (missing !== null) {
        const ret = missing(context, locale, key, type);
        return isString$1(ret) ? ret : key;
      } else {
        return key;
      }
    }
    function updateFallbackLocale(ctx2, locale, fallback) {
      const context = ctx2;
      context.__localeChainCache = /* @__PURE__ */ new Map();
      ctx2.localeFallbacker(ctx2, fallback, locale);
    }
    function isAlmostSameLocale(locale, compareLocale) {
      if (locale === compareLocale)
        return false;
      return locale.split("-")[0] === compareLocale.split("-")[0];
    }
    function isImplicitFallback(targetLocale, locales) {
      const index = locales.indexOf(targetLocale);
      if (index === -1) {
        return false;
      }
      for (let i = index + 1; i < locales.length; i++) {
        if (isAlmostSameLocale(targetLocale, locales[i])) {
          return true;
        }
      }
      return false;
    }
    function format(ast) {
      const msg2 = (ctx2) => formatParts(ctx2, ast);
      return msg2;
    }
    function formatParts(ctx2, ast) {
      const body = ast.b || ast.body;
      if ((body.t || body.type) === 1) {
        const plural = body;
        const cases = plural.c || plural.cases;
        return ctx2.plural(cases.reduce((messages, c2) => [
          ...messages,
          formatMessageParts(ctx2, c2)
        ], []));
      } else {
        return formatMessageParts(ctx2, body);
      }
    }
    function formatMessageParts(ctx2, node) {
      const _static = node.s || node.static;
      if (_static) {
        return ctx2.type === "text" ? _static : ctx2.normalize([_static]);
      } else {
        const messages = (node.i || node.items).reduce((acm, c2) => [...acm, formatMessagePart(ctx2, c2)], []);
        return ctx2.normalize(messages);
      }
    }
    function formatMessagePart(ctx2, node) {
      const type = node.t || node.type;
      switch (type) {
        case 3: {
          const text = node;
          return text.v || text.value;
        }
        case 9: {
          const literal = node;
          return literal.v || literal.value;
        }
        case 4: {
          const named = node;
          return ctx2.interpolate(ctx2.named(named.k || named.key));
        }
        case 5: {
          const list = node;
          return ctx2.interpolate(ctx2.list(list.i != null ? list.i : list.index));
        }
        case 6: {
          const linked = node;
          const modifier = linked.m || linked.modifier;
          return ctx2.linked(formatMessagePart(ctx2, linked.k || linked.key), modifier ? formatMessagePart(ctx2, modifier) : void 0, ctx2.type);
        }
        case 7: {
          const linkedKey = node;
          return linkedKey.v || linkedKey.value;
        }
        case 8: {
          const linkedModifier = node;
          return linkedModifier.v || linkedModifier.value;
        }
        default:
          throw new Error(`unhandled node type on format message part: ${type}`);
      }
    }
    const defaultOnCacheKey = (message) => message;
    let compileCache = /* @__PURE__ */ Object.create(null);
    const isMessageAST = (val) => isObject$2(val) && (val.t === 0 || val.type === 0) && ("b" in val || "body" in val);
    function baseCompile(message, options = {}) {
      let detectError = false;
      const onError = options.onError || defaultOnError;
      options.onError = (err) => {
        detectError = true;
        onError(err);
      };
      return { ...baseCompile$1(message, options), detectError };
    }
    const compileToFunction = /* @__NO_SIDE_EFFECTS__ */ (message, context) => {
      if (!isString$1(message)) {
        throw createCoreError(CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE);
      }
      {
        isBoolean(context.warnHtmlMessage) ? context.warnHtmlMessage : true;
        const onCacheKey = context.onCacheKey || defaultOnCacheKey;
        const cacheKey = onCacheKey(message);
        const cached = compileCache[cacheKey];
        if (cached) {
          return cached;
        }
        const { code: code2, detectError } = baseCompile(message, context);
        const msg2 = new Function(`return ${code2}`)();
        return !detectError ? compileCache[cacheKey] = msg2 : msg2;
      }
    };
    function compile(message, context) {
      if (__INTLIFY_JIT_COMPILATION__ && !__INTLIFY_DROP_MESSAGE_COMPILER__ && isString$1(message)) {
        isBoolean(context.warnHtmlMessage) ? context.warnHtmlMessage : true;
        const onCacheKey = context.onCacheKey || defaultOnCacheKey;
        const cacheKey = onCacheKey(message);
        const cached = compileCache[cacheKey];
        if (cached) {
          return cached;
        }
        const { ast, detectError } = baseCompile(message, {
          ...context,
          location: false,
          jit: true
        });
        const msg2 = format(ast);
        return !detectError ? compileCache[cacheKey] = msg2 : msg2;
      } else {
        const cacheKey = message.cacheKey;
        if (cacheKey) {
          const cached = compileCache[cacheKey];
          if (cached) {
            return cached;
          }
          return compileCache[cacheKey] = format(message);
        } else {
          return format(message);
        }
      }
    }
    const NOOP_MESSAGE_FUNCTION = () => "";
    const isMessageFunction = (val) => isFunction(val);
    function translate(context, ...args) {
      const { fallbackFormat, postTranslation, unresolving, messageCompiler, fallbackLocale, messages } = context;
      const [key, options] = parseTranslateArgs(...args);
      const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
      const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
      const escapeParameter = isBoolean(options.escapeParameter) ? options.escapeParameter : context.escapeParameter;
      const resolvedMessage = !!options.resolvedMessage;
      const defaultMsgOrKey = isString$1(options.default) || isBoolean(options.default) ? !isBoolean(options.default) ? options.default : !messageCompiler ? () => key : key : fallbackFormat ? !messageCompiler ? () => key : key : "";
      const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== "";
      const locale = getLocale(context, options);
      escapeParameter && escapeParams(options);
      let [formatScope, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) : [
        key,
        locale,
        messages[locale] || {}
      ];
      let format2 = formatScope;
      let cacheBaseKey = key;
      if (!resolvedMessage && !(isString$1(format2) || isMessageAST(format2) || isMessageFunction(format2))) {
        if (enableDefaultMsg) {
          format2 = defaultMsgOrKey;
          cacheBaseKey = format2;
        }
      }
      if (!resolvedMessage && (!(isString$1(format2) || isMessageAST(format2) || isMessageFunction(format2)) || !isString$1(targetLocale))) {
        return unresolving ? NOT_REOSLVED : key;
      }
      let occurred = false;
      const onError = () => {
        occurred = true;
      };
      const msg2 = !isMessageFunction(format2) ? compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, onError) : format2;
      if (occurred) {
        return format2;
      }
      const ctxOptions = getMessageContextOptions(context, targetLocale, message, options);
      const msgContext = createMessageContext(ctxOptions);
      const messaged = evaluateMessage(context, msg2, msgContext);
      const ret = postTranslation ? postTranslation(messaged, key) : messaged;
      if (__INTLIFY_PROD_DEVTOOLS__) {
        const payloads = {
          timestamp: Date.now(),
          key: isString$1(key) ? key : isMessageFunction(format2) ? format2.key : "",
          locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""),
          format: isString$1(format2) ? format2 : isMessageFunction(format2) ? format2.source : "",
          message: ret
        };
        payloads.meta = assign$1({}, context.__meta, /* @__PURE__ */ getAdditionalMeta() || {});
        translateDevTools(payloads);
      }
      return ret;
    }
    function escapeParams(options) {
      if (isArray(options.list)) {
        options.list = options.list.map((item) => isString$1(item) ? escapeHtml(item) : item);
      } else if (isObject$2(options.named)) {
        Object.keys(options.named).forEach((key) => {
          if (isString$1(options.named[key])) {
            options.named[key] = escapeHtml(options.named[key]);
          }
        });
      }
    }
    function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {
      const { messages, onWarn, messageResolver: resolveValue2, localeFallbacker } = context;
      const locales = localeFallbacker(context, fallbackLocale, locale);
      let message = {};
      let targetLocale;
      let format2 = null;
      const type = "translate";
      for (let i = 0; i < locales.length; i++) {
        targetLocale = locales[i];
        message = messages[targetLocale] || {};
        if ((format2 = resolveValue2(message, key)) === null) {
          format2 = message[key];
        }
        if (isString$1(format2) || isMessageAST(format2) || isMessageFunction(format2)) {
          break;
        }
        if (!isImplicitFallback(targetLocale, locales)) {
          const missingRet = handleMissing(
            context,
            // eslint-disable-line @typescript-eslint/no-explicit-any
            key,
            targetLocale,
            missingWarn,
            type
          );
          if (missingRet !== key) {
            format2 = missingRet;
          }
        }
      }
      return [format2, targetLocale, message];
    }
    function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, onError) {
      const { messageCompiler, warnHtmlMessage } = context;
      if (isMessageFunction(format2)) {
        const msg22 = format2;
        msg22.locale = msg22.locale || targetLocale;
        msg22.key = msg22.key || key;
        return msg22;
      }
      if (messageCompiler == null) {
        const msg22 = () => format2;
        msg22.locale = targetLocale;
        msg22.key = key;
        return msg22;
      }
      const msg2 = messageCompiler(format2, getCompileContext(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, onError));
      msg2.locale = targetLocale;
      msg2.key = key;
      msg2.source = format2;
      return msg2;
    }
    function evaluateMessage(context, msg2, msgCtx) {
      const messaged = msg2(msgCtx);
      return messaged;
    }
    function parseTranslateArgs(...args) {
      const [arg1, arg2, arg3] = args;
      const options = {};
      if (!isString$1(arg1) && !isNumber(arg1) && !isMessageFunction(arg1) && !isMessageAST(arg1)) {
        throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
      }
      const key = isNumber(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1;
      if (isNumber(arg2)) {
        options.plural = arg2;
      } else if (isString$1(arg2)) {
        options.default = arg2;
      } else if (isPlainObject(arg2) && !isEmptyObject(arg2)) {
        options.named = arg2;
      } else if (isArray(arg2)) {
        options.list = arg2;
      }
      if (isNumber(arg3)) {
        options.plural = arg3;
      } else if (isString$1(arg3)) {
        options.default = arg3;
      } else if (isPlainObject(arg3)) {
        assign$1(options, arg3);
      }
      return [key, options];
    }
    function getCompileContext(context, locale, key, source, warnHtmlMessage, onError) {
      return {
        locale,
        key,
        warnHtmlMessage,
        onError: (err) => {
          onError && onError(err);
          {
            throw err;
          }
        },
        onCacheKey: (source2) => generateFormatCacheKey(locale, key, source2)
      };
    }
    function getMessageContextOptions(context, locale, message, options) {
      const { modifiers, pluralRules, messageResolver: resolveValue2, fallbackLocale, fallbackWarn, missingWarn, fallbackContext } = context;
      const resolveMessage = (key) => {
        let val = resolveValue2(message, key);
        if (val == null && fallbackContext) {
          const [, , message2] = resolveMessageFormat(fallbackContext, key, locale, fallbackLocale, fallbackWarn, missingWarn);
          val = resolveValue2(message2, key);
        }
        if (isString$1(val) || isMessageAST(val)) {
          let occurred = false;
          const onError = () => {
            occurred = true;
          };
          const msg2 = compileMessageFormat(context, key, locale, val, key, onError);
          return !occurred ? msg2 : NOOP_MESSAGE_FUNCTION;
        } else if (isMessageFunction(val)) {
          return val;
        } else {
          return NOOP_MESSAGE_FUNCTION;
        }
      };
      const ctxOptions = {
        locale,
        modifiers,
        pluralRules,
        messages: resolveMessage
      };
      if (context.processor) {
        ctxOptions.processor = context.processor;
      }
      if (options.list) {
        ctxOptions.list = options.list;
      }
      if (options.named) {
        ctxOptions.named = options.named;
      }
      if (isNumber(options.plural)) {
        ctxOptions.pluralIndex = options.plural;
      }
      return ctxOptions;
    }
    function datetime(context, ...args) {
      const { datetimeFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;
      const { __datetimeFormatters } = context;
      const [key, value, options, overrides] = parseDateTimeArgs(...args);
      const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
      isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
      const part = !!options.part;
      const locale = getLocale(context, options);
      const locales = localeFallbacker(
        context,
        // eslint-disable-line @typescript-eslint/no-explicit-any
        fallbackLocale,
        locale
      );
      if (!isString$1(key) || key === "") {
        return new Intl.DateTimeFormat(locale, overrides).format(value);
      }
      let datetimeFormat = {};
      let targetLocale;
      let format2 = null;
      const type = "datetime format";
      for (let i = 0; i < locales.length; i++) {
        targetLocale = locales[i];
        datetimeFormat = datetimeFormats[targetLocale] || {};
        format2 = datetimeFormat[key];
        if (isPlainObject(format2))
          break;
        handleMissing(context, key, targetLocale, missingWarn, type);
      }
      if (!isPlainObject(format2) || !isString$1(targetLocale)) {
        return unresolving ? NOT_REOSLVED : key;
      }
      let id = `${targetLocale}__${key}`;
      if (!isEmptyObject(overrides)) {
        id = `${id}__${JSON.stringify(overrides)}`;
      }
      let formatter = __datetimeFormatters.get(id);
      if (!formatter) {
        formatter = new Intl.DateTimeFormat(targetLocale, assign$1({}, format2, overrides));
        __datetimeFormatters.set(id, formatter);
      }
      return !part ? formatter.format(value) : formatter.formatToParts(value);
    }
    const DATETIME_FORMAT_OPTIONS_KEYS = [
      "localeMatcher",
      "weekday",
      "era",
      "year",
      "month",
      "day",
      "hour",
      "minute",
      "second",
      "timeZoneName",
      "formatMatcher",
      "hour12",
      "timeZone",
      "dateStyle",
      "timeStyle",
      "calendar",
      "dayPeriod",
      "numberingSystem",
      "hourCycle",
      "fractionalSecondDigits"
    ];
    function parseDateTimeArgs(...args) {
      const [arg1, arg2, arg3, arg4] = args;
      const options = {};
      let overrides = {};
      let value;
      if (isString$1(arg1)) {
        const matches2 = arg1.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
        if (!matches2) {
          throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
        }
        const dateTime = matches2[3] ? matches2[3].trim().startsWith("T") ? `${matches2[1].trim()}${matches2[3].trim()}` : `${matches2[1].trim()}T${matches2[3].trim()}` : matches2[1].trim();
        value = new Date(dateTime);
        try {
          value.toISOString();
        } catch (e) {
          throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
        }
      } else if (isDate(arg1)) {
        if (isNaN(arg1.getTime())) {
          throw createCoreError(CoreErrorCodes.INVALID_DATE_ARGUMENT);
        }
        value = arg1;
      } else if (isNumber(arg1)) {
        value = arg1;
      } else {
        throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
      }
      if (isString$1(arg2)) {
        options.key = arg2;
      } else if (isPlainObject(arg2)) {
        Object.keys(arg2).forEach((key) => {
          if (DATETIME_FORMAT_OPTIONS_KEYS.includes(key)) {
            overrides[key] = arg2[key];
          } else {
            options[key] = arg2[key];
          }
        });
      }
      if (isString$1(arg3)) {
        options.locale = arg3;
      } else if (isPlainObject(arg3)) {
        overrides = arg3;
      }
      if (isPlainObject(arg4)) {
        overrides = arg4;
      }
      return [options.key || "", value, options, overrides];
    }
    function clearDateTimeFormat(ctx2, locale, format2) {
      const context = ctx2;
      for (const key in format2) {
        const id = `${locale}__${key}`;
        if (!context.__datetimeFormatters.has(id)) {
          continue;
        }
        context.__datetimeFormatters.delete(id);
      }
    }
    function number(context, ...args) {
      const { numberFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;
      const { __numberFormatters } = context;
      const [key, value, options, overrides] = parseNumberArgs(...args);
      const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
      isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
      const part = !!options.part;
      const locale = getLocale(context, options);
      const locales = localeFallbacker(
        context,
        // eslint-disable-line @typescript-eslint/no-explicit-any
        fallbackLocale,
        locale
      );
      if (!isString$1(key) || key === "") {
        return new Intl.NumberFormat(locale, overrides).format(value);
      }
      let numberFormat = {};
      let targetLocale;
      let format2 = null;
      const type = "number format";
      for (let i = 0; i < locales.length; i++) {
        targetLocale = locales[i];
        numberFormat = numberFormats[targetLocale] || {};
        format2 = numberFormat[key];
        if (isPlainObject(format2))
          break;
        handleMissing(context, key, targetLocale, missingWarn, type);
      }
      if (!isPlainObject(format2) || !isString$1(targetLocale)) {
        return unresolving ? NOT_REOSLVED : key;
      }
      let id = `${targetLocale}__${key}`;
      if (!isEmptyObject(overrides)) {
        id = `${id}__${JSON.stringify(overrides)}`;
      }
      let formatter = __numberFormatters.get(id);
      if (!formatter) {
        formatter = new Intl.NumberFormat(targetLocale, assign$1({}, format2, overrides));
        __numberFormatters.set(id, formatter);
      }
      return !part ? formatter.format(value) : formatter.formatToParts(value);
    }
    const NUMBER_FORMAT_OPTIONS_KEYS = [
      "localeMatcher",
      "style",
      "currency",
      "currencyDisplay",
      "currencySign",
      "useGrouping",
      "minimumIntegerDigits",
      "minimumFractionDigits",
      "maximumFractionDigits",
      "minimumSignificantDigits",
      "maximumSignificantDigits",
      "compactDisplay",
      "notation",
      "signDisplay",
      "unit",
      "unitDisplay",
      "roundingMode",
      "roundingPriority",
      "roundingIncrement",
      "trailingZeroDisplay"
    ];
    function parseNumberArgs(...args) {
      const [arg1, arg2, arg3, arg4] = args;
      const options = {};
      let overrides = {};
      if (!isNumber(arg1)) {
        throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
      }
      const value = arg1;
      if (isString$1(arg2)) {
        options.key = arg2;
      } else if (isPlainObject(arg2)) {
        Object.keys(arg2).forEach((key) => {
          if (NUMBER_FORMAT_OPTIONS_KEYS.includes(key)) {
            overrides[key] = arg2[key];
          } else {
            options[key] = arg2[key];
          }
        });
      }
      if (isString$1(arg3)) {
        options.locale = arg3;
      } else if (isPlainObject(arg3)) {
        overrides = arg3;
      }
      if (isPlainObject(arg4)) {
        overrides = arg4;
      }
      return [options.key || "", value, options, overrides];
    }
    function clearNumberFormat(ctx2, locale, format2) {
      const context = ctx2;
      for (const key in format2) {
        const id = `${locale}__${key}`;
        if (!context.__numberFormatters.has(id)) {
          continue;
        }
        context.__numberFormatters.delete(id);
      }
    }
    {
      initFeatureFlags$1();
    }
    /*!
      * vue-i18n v9.14.1
      * (c) 2024 kazuya kawaguchi
      * Released under the MIT License.
      */
    const VERSION = "9.14.1";
    function initFeatureFlags() {
      if (typeof __VUE_I18N_FULL_INSTALL__ !== "boolean") {
        getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true;
      }
      if (typeof __VUE_I18N_LEGACY_API__ !== "boolean") {
        getGlobalThis().__VUE_I18N_LEGACY_API__ = true;
      }
      if (typeof __INTLIFY_JIT_COMPILATION__ !== "boolean") {
        getGlobalThis().__INTLIFY_JIT_COMPILATION__ = false;
      }
      if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== "boolean") {
        getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;
      }
      if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
        getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
      }
    }
    const code$1 = CoreWarnCodes.__EXTEND_POINT__;
    const inc$1 = incrementer(code$1);
    ({
      FALLBACK_TO_ROOT: code$1,
      // 9
      NOT_SUPPORTED_PRESERVE: inc$1(),
      // 10
      NOT_SUPPORTED_FORMATTER: inc$1(),
      // 11
      NOT_SUPPORTED_PRESERVE_DIRECTIVE: inc$1(),
      // 12
      NOT_SUPPORTED_GET_CHOICE_INDEX: inc$1(),
      // 13
      COMPONENT_NAME_LEGACY_COMPATIBLE: inc$1(),
      // 14
      NOT_FOUND_PARENT_SCOPE: inc$1(),
      // 15
      IGNORE_OBJ_FLATTEN: inc$1(),
      // 16
      NOTICE_DROP_ALLOW_COMPOSITION: inc$1(),
      // 17
      NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG: inc$1()
      // 18
    });
    const code = CoreErrorCodes.__EXTEND_POINT__;
    const inc = incrementer(code);
    const I18nErrorCodes = {
      // composer module errors
      UNEXPECTED_RETURN_TYPE: code,
      // 24
      // legacy module errors
      INVALID_ARGUMENT: inc(),
      // 25
      // i18n module errors
      MUST_BE_CALL_SETUP_TOP: inc(),
      // 26
      NOT_INSTALLED: inc(),
      // 27
      NOT_AVAILABLE_IN_LEGACY_MODE: inc(),
      // 28
      // directive module errors
      REQUIRED_VALUE: inc(),
      // 29
      INVALID_VALUE: inc(),
      // 30
      // vue-devtools errors
      CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: inc(),
      // 31
      NOT_INSTALLED_WITH_PROVIDE: inc(),
      // 32
      // unexpected error
      UNEXPECTED_ERROR: inc(),
      // 33
      // not compatible legacy vue-i18n constructor
      NOT_COMPATIBLE_LEGACY_VUE_I18N: inc(),
      // 34
      // bridge support vue 2.x only
      BRIDGE_SUPPORT_VUE_2_ONLY: inc(),
      // 35
      // need to define `i18n` option in `allowComposition: true` and `useScope: 'local' at `useI18n``
      MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION: inc(),
      // 36
      // Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
      NOT_AVAILABLE_COMPOSITION_IN_LEGACY: inc(),
      // 37
      // for enhancement
      __EXTEND_POINT__: inc()
      // 38
    };
    function createI18nError(code2, ...args) {
      return createCompileError(code2, null, void 0);
    }
    const TranslateVNodeSymbol = /* @__PURE__ */ makeSymbol("__translateVNode");
    const DatetimePartsSymbol = /* @__PURE__ */ makeSymbol("__datetimeParts");
    const NumberPartsSymbol = /* @__PURE__ */ makeSymbol("__numberParts");
    const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
    const InejctWithOptionSymbol = /* @__PURE__ */ makeSymbol("__injectWithOption");
    const DisposeSymbol = /* @__PURE__ */ makeSymbol("__dispose");
    function handleFlatJson(obj) {
      if (!isObject$2(obj)) {
        return obj;
      }
      for (const key in obj) {
        if (!hasOwn(obj, key)) {
          continue;
        }
        if (!key.includes(".")) {
          if (isObject$2(obj[key])) {
            handleFlatJson(obj[key]);
          }
        } else {
          const subKeys = key.split(".");
          const lastIndex = subKeys.length - 1;
          let currentObj = obj;
          let hasStringValue = false;
          for (let i = 0; i < lastIndex; i++) {
            if (!(subKeys[i] in currentObj)) {
              currentObj[subKeys[i]] = {};
            }
            if (!isObject$2(currentObj[subKeys[i]])) {
              hasStringValue = true;
              break;
            }
            currentObj = currentObj[subKeys[i]];
          }
          if (!hasStringValue) {
            currentObj[subKeys[lastIndex]] = obj[key];
            delete obj[key];
          }
          if (isObject$2(currentObj[subKeys[lastIndex]])) {
            handleFlatJson(currentObj[subKeys[lastIndex]]);
          }
        }
      }
      return obj;
    }
    function getLocaleMessages(locale, options) {
      const { messages, __i18n, messageResolver, flatJson } = options;
      const ret = isPlainObject(messages) ? messages : isArray(__i18n) ? {} : { [locale]: {} };
      if (isArray(__i18n)) {
        __i18n.forEach((custom) => {
          if ("locale" in custom && "resource" in custom) {
            const { locale: locale2, resource } = custom;
            if (locale2) {
              ret[locale2] = ret[locale2] || {};
              deepCopy(resource, ret[locale2]);
            } else {
              deepCopy(resource, ret);
            }
          } else {
            isString$1(custom) && deepCopy(JSON.parse(custom), ret);
          }
        });
      }
      if (messageResolver == null && flatJson) {
        for (const key in ret) {
          if (hasOwn(ret, key)) {
            handleFlatJson(ret[key]);
          }
        }
      }
      return ret;
    }
    function getComponentOptions(instance) {
      return instance.type;
    }
    function adjustI18nResources(gl, options, componentOptions) {
      let messages = isObject$2(options.messages) ? options.messages : {};
      if ("__i18nGlobal" in componentOptions) {
        messages = getLocaleMessages(gl.locale.value, {
          messages,
          __i18n: componentOptions.__i18nGlobal
        });
      }
      const locales = Object.keys(messages);
      if (locales.length) {
        locales.forEach((locale) => {
          gl.mergeLocaleMessage(locale, messages[locale]);
        });
      }
      {
        if (isObject$2(options.datetimeFormats)) {
          const locales2 = Object.keys(options.datetimeFormats);
          if (locales2.length) {
            locales2.forEach((locale) => {
              gl.mergeDateTimeFormat(locale, options.datetimeFormats[locale]);
            });
          }
        }
        if (isObject$2(options.numberFormats)) {
          const locales2 = Object.keys(options.numberFormats);
          if (locales2.length) {
            locales2.forEach((locale) => {
              gl.mergeNumberFormat(locale, options.numberFormats[locale]);
            });
          }
        }
      }
    }
    function createTextNode(key) {
      return createVNode(Text, null, key, 0);
    }
    const DEVTOOLS_META = "__INTLIFY_META__";
    const NOOP_RETURN_ARRAY = () => [];
    const NOOP_RETURN_FALSE = () => false;
    let composerID = 0;
    function defineCoreMissingHandler(missing) {
      return (ctx2, locale, key, type) => {
        return missing(locale, key, getCurrentInstance() || void 0, type);
      };
    }
    const getMetaInfo = /* @__NO_SIDE_EFFECTS__ */ () => {
      const instance = getCurrentInstance();
      let meta = null;
      return instance && (meta = getComponentOptions(instance)[DEVTOOLS_META]) ? { [DEVTOOLS_META]: meta } : null;
    };
    function createComposer(options = {}, VueI18nLegacy) {
      const { __root, __injectWithOption } = options;
      const _isGlobal = __root === void 0;
      const flatJson = options.flatJson;
      const _ref = inBrowser ? ref : shallowRef;
      const translateExistCompatible = !!options.translateExistCompatible;
      let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
      const _locale = _ref(
        // prettier-ignore
        __root && _inheritLocale ? __root.locale.value : isString$1(options.locale) ? options.locale : DEFAULT_LOCALE
      );
      const _fallbackLocale = _ref(
        // prettier-ignore
        __root && _inheritLocale ? __root.fallbackLocale.value : isString$1(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
      );
      const _messages = _ref(getLocaleMessages(_locale.value, options));
      const _datetimeFormats = _ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
      const _numberFormats = _ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
      let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
      let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
      let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
      let _fallbackFormat = !!options.fallbackFormat;
      let _missing = isFunction(options.missing) ? options.missing : null;
      let _runtimeMissing = isFunction(options.missing) ? defineCoreMissingHandler(options.missing) : null;
      let _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
      let _warnHtmlMessage = __root ? __root.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
      let _escapeParameter = !!options.escapeParameter;
      const _modifiers = __root ? __root.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
      let _pluralRules = options.pluralRules || __root && __root.pluralRules;
      let _context;
      const getCoreContext = () => {
        _isGlobal && setFallbackContext(null);
        const ctxOptions = {
          version: VERSION,
          locale: _locale.value,
          fallbackLocale: _fallbackLocale.value,
          messages: _messages.value,
          modifiers: _modifiers,
          pluralRules: _pluralRules,
          missing: _runtimeMissing === null ? void 0 : _runtimeMissing,
          missingWarn: _missingWarn,
          fallbackWarn: _fallbackWarn,
          fallbackFormat: _fallbackFormat,
          unresolving: true,
          postTranslation: _postTranslation === null ? void 0 : _postTranslation,
          warnHtmlMessage: _warnHtmlMessage,
          escapeParameter: _escapeParameter,
          messageResolver: options.messageResolver,
          messageCompiler: options.messageCompiler,
          __meta: { framework: "vue" }
        };
        {
          ctxOptions.datetimeFormats = _datetimeFormats.value;
          ctxOptions.numberFormats = _numberFormats.value;
          ctxOptions.__datetimeFormatters = isPlainObject(_context) ? _context.__datetimeFormatters : void 0;
          ctxOptions.__numberFormatters = isPlainObject(_context) ? _context.__numberFormatters : void 0;
        }
        const ctx2 = createCoreContext(ctxOptions);
        _isGlobal && setFallbackContext(ctx2);
        return ctx2;
      };
      _context = getCoreContext();
      updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
      function trackReactivityValues() {
        return [
          _locale.value,
          _fallbackLocale.value,
          _messages.value,
          _datetimeFormats.value,
          _numberFormats.value
        ];
      }
      const locale = computed({
        get: () => _locale.value,
        set: (val) => {
          _locale.value = val;
          _context.locale = _locale.value;
        }
      });
      const fallbackLocale = computed({
        get: () => _fallbackLocale.value,
        set: (val) => {
          _fallbackLocale.value = val;
          _context.fallbackLocale = _fallbackLocale.value;
          updateFallbackLocale(_context, _locale.value, val);
        }
      });
      const messages = computed(() => _messages.value);
      const datetimeFormats = /* @__PURE__ */ computed(() => _datetimeFormats.value);
      const numberFormats = /* @__PURE__ */ computed(() => _numberFormats.value);
      function getPostTranslationHandler() {
        return isFunction(_postTranslation) ? _postTranslation : null;
      }
      function setPostTranslationHandler(handler) {
        _postTranslation = handler;
        _context.postTranslation = handler;
      }
      function getMissingHandler() {
        return _missing;
      }
      function setMissingHandler(handler) {
        if (handler !== null) {
          _runtimeMissing = defineCoreMissingHandler(handler);
        }
        _missing = handler;
        _context.missing = _runtimeMissing;
      }
      const wrapWithDeps = (fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) => {
        trackReactivityValues();
        let ret;
        try {
          if (__INTLIFY_PROD_DEVTOOLS__) {
            /* @__PURE__ */ setAdditionalMeta(/* @__PURE__ */ getMetaInfo());
          }
          if (!_isGlobal) {
            _context.fallbackContext = __root ? getFallbackContext() : void 0;
          }
          ret = fn(_context);
        } finally {
          if (__INTLIFY_PROD_DEVTOOLS__) ;
          if (!_isGlobal) {
            _context.fallbackContext = void 0;
          }
        }
        if (warnType !== "translate exists" && // for not `te` (e.g `t`)
        isNumber(ret) && ret === NOT_REOSLVED || warnType === "translate exists" && !ret) {
          const [key, arg2] = argumentParser();
          return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
        } else if (successCondition(ret)) {
          return ret;
        } else {
          throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE);
        }
      };
      function t(...args) {
        return wrapWithDeps((context) => Reflect.apply(translate, null, [context, ...args]), () => parseTranslateArgs(...args), "translate", (root2) => Reflect.apply(root2.t, root2, [...args]), (key) => key, (val) => isString$1(val));
      }
      function rt(...args) {
        const [arg1, arg2, arg3] = args;
        if (arg3 && !isObject$2(arg3)) {
          throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
        }
        return t(...[arg1, arg2, assign$1({ resolvedMessage: true }, arg3 || {})]);
      }
      function d(...args) {
        return wrapWithDeps((context) => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), "datetime format", (root2) => Reflect.apply(root2.d, root2, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val));
      }
      function n(...args) {
        return wrapWithDeps((context) => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), "number format", (root2) => Reflect.apply(root2.n, root2, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val));
      }
      function normalize(values) {
        return values.map((val) => isString$1(val) || isNumber(val) || isBoolean(val) ? createTextNode(String(val)) : val);
      }
      const interpolate = (val) => val;
      const processor = {
        normalize,
        interpolate,
        type: "vnode"
      };
      function translateVNode(...args) {
        return wrapWithDeps(
          (context) => {
            let ret;
            const _context2 = context;
            try {
              _context2.processor = processor;
              ret = Reflect.apply(translate, null, [_context2, ...args]);
            } finally {
              _context2.processor = null;
            }
            return ret;
          },
          () => parseTranslateArgs(...args),
          "translate",
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
          (root2) => root2[TranslateVNodeSymbol](...args),
          (key) => [createTextNode(key)],
          (val) => isArray(val)
        );
      }
      function numberParts(...args) {
        return wrapWithDeps(
          (context) => Reflect.apply(number, null, [context, ...args]),
          () => parseNumberArgs(...args),
          "number format",
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
          (root2) => root2[NumberPartsSymbol](...args),
          NOOP_RETURN_ARRAY,
          (val) => isString$1(val) || isArray(val)
        );
      }
      function datetimeParts(...args) {
        return wrapWithDeps(
          (context) => Reflect.apply(datetime, null, [context, ...args]),
          () => parseDateTimeArgs(...args),
          "datetime format",
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
          (root2) => root2[DatetimePartsSymbol](...args),
          NOOP_RETURN_ARRAY,
          (val) => isString$1(val) || isArray(val)
        );
      }
      function setPluralRules(rules) {
        _pluralRules = rules;
        _context.pluralRules = _pluralRules;
      }
      function te(key, locale2) {
        return wrapWithDeps(() => {
          if (!key) {
            return false;
          }
          const targetLocale = isString$1(locale2) ? locale2 : _locale.value;
          const message = getLocaleMessage(targetLocale);
          const resolved = _context.messageResolver(message, key);
          return !translateExistCompatible ? isMessageAST(resolved) || isMessageFunction(resolved) || isString$1(resolved) : resolved != null;
        }, () => [key], "translate exists", (root2) => {
          return Reflect.apply(root2.te, root2, [key, locale2]);
        }, NOOP_RETURN_FALSE, (val) => isBoolean(val));
      }
      function resolveMessages(key) {
        let messages2 = null;
        const locales = fallbackWithLocaleChain(_context, _fallbackLocale.value, _locale.value);
        for (let i = 0; i < locales.length; i++) {
          const targetLocaleMessages = _messages.value[locales[i]] || {};
          const messageValue = _context.messageResolver(targetLocaleMessages, key);
          if (messageValue != null) {
            messages2 = messageValue;
            break;
          }
        }
        return messages2;
      }
      function tm(key) {
        const messages2 = resolveMessages(key);
        return messages2 != null ? messages2 : __root ? __root.tm(key) || {} : {};
      }
      function getLocaleMessage(locale2) {
        return _messages.value[locale2] || {};
      }
      function setLocaleMessage(locale2, message) {
        if (flatJson) {
          const _message = { [locale2]: message };
          for (const key in _message) {
            if (hasOwn(_message, key)) {
              handleFlatJson(_message[key]);
            }
          }
          message = _message[locale2];
        }
        _messages.value[locale2] = message;
        _context.messages = _messages.value;
      }
      function mergeLocaleMessage(locale2, message) {
        _messages.value[locale2] = _messages.value[locale2] || {};
        const _message = { [locale2]: message };
        if (flatJson) {
          for (const key in _message) {
            if (hasOwn(_message, key)) {
              handleFlatJson(_message[key]);
            }
          }
        }
        message = _message[locale2];
        deepCopy(message, _messages.value[locale2]);
        _context.messages = _messages.value;
      }
      function getDateTimeFormat(locale2) {
        return _datetimeFormats.value[locale2] || {};
      }
      function setDateTimeFormat(locale2, format2) {
        _datetimeFormats.value[locale2] = format2;
        _context.datetimeFormats = _datetimeFormats.value;
        clearDateTimeFormat(_context, locale2, format2);
      }
      function mergeDateTimeFormat(locale2, format2) {
        _datetimeFormats.value[locale2] = assign$1(_datetimeFormats.value[locale2] || {}, format2);
        _context.datetimeFormats = _datetimeFormats.value;
        clearDateTimeFormat(_context, locale2, format2);
      }
      function getNumberFormat(locale2) {
        return _numberFormats.value[locale2] || {};
      }
      function setNumberFormat(locale2, format2) {
        _numberFormats.value[locale2] = format2;
        _context.numberFormats = _numberFormats.value;
        clearNumberFormat(_context, locale2, format2);
      }
      function mergeNumberFormat(locale2, format2) {
        _numberFormats.value[locale2] = assign$1(_numberFormats.value[locale2] || {}, format2);
        _context.numberFormats = _numberFormats.value;
        clearNumberFormat(_context, locale2, format2);
      }
      composerID++;
      if (__root && inBrowser) {
        watch(__root.locale, (val) => {
          if (_inheritLocale) {
            _locale.value = val;
            _context.locale = val;
            updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
          }
        });
        watch(__root.fallbackLocale, (val) => {
          if (_inheritLocale) {
            _fallbackLocale.value = val;
            _context.fallbackLocale = val;
            updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
          }
        });
      }
      const composer = {
        id: composerID,
        locale,
        fallbackLocale,
        get inheritLocale() {
          return _inheritLocale;
        },
        set inheritLocale(val) {
          _inheritLocale = val;
          if (val && __root) {
            _locale.value = __root.locale.value;
            _fallbackLocale.value = __root.fallbackLocale.value;
            updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
          }
        },
        get availableLocales() {
          return Object.keys(_messages.value).sort();
        },
        messages,
        get modifiers() {
          return _modifiers;
        },
        get pluralRules() {
          return _pluralRules || {};
        },
        get isGlobal() {
          return _isGlobal;
        },
        get missingWarn() {
          return _missingWarn;
        },
        set missingWarn(val) {
          _missingWarn = val;
          _context.missingWarn = _missingWarn;
        },
        get fallbackWarn() {
          return _fallbackWarn;
        },
        set fallbackWarn(val) {
          _fallbackWarn = val;
          _context.fallbackWarn = _fallbackWarn;
        },
        get fallbackRoot() {
          return _fallbackRoot;
        },
        set fallbackRoot(val) {
          _fallbackRoot = val;
        },
        get fallbackFormat() {
          return _fallbackFormat;
        },
        set fallbackFormat(val) {
          _fallbackFormat = val;
          _context.fallbackFormat = _fallbackFormat;
        },
        get warnHtmlMessage() {
          return _warnHtmlMessage;
        },
        set warnHtmlMessage(val) {
          _warnHtmlMessage = val;
          _context.warnHtmlMessage = val;
        },
        get escapeParameter() {
          return _escapeParameter;
        },
        set escapeParameter(val) {
          _escapeParameter = val;
          _context.escapeParameter = val;
        },
        t,
        getLocaleMessage,
        setLocaleMessage,
        mergeLocaleMessage,
        getPostTranslationHandler,
        setPostTranslationHandler,
        getMissingHandler,
        setMissingHandler,
        [SetPluralRulesSymbol]: setPluralRules
      };
      {
        composer.datetimeFormats = datetimeFormats;
        composer.numberFormats = numberFormats;
        composer.rt = rt;
        composer.te = te;
        composer.tm = tm;
        composer.d = d;
        composer.n = n;
        composer.getDateTimeFormat = getDateTimeFormat;
        composer.setDateTimeFormat = setDateTimeFormat;
        composer.mergeDateTimeFormat = mergeDateTimeFormat;
        composer.getNumberFormat = getNumberFormat;
        composer.setNumberFormat = setNumberFormat;
        composer.mergeNumberFormat = mergeNumberFormat;
        composer[InejctWithOptionSymbol] = __injectWithOption;
        composer[TranslateVNodeSymbol] = translateVNode;
        composer[DatetimePartsSymbol] = datetimeParts;
        composer[NumberPartsSymbol] = numberParts;
      }
      return composer;
    }
    function convertComposerOptions(options) {
      const locale = isString$1(options.locale) ? options.locale : DEFAULT_LOCALE;
      const fallbackLocale = isString$1(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
      const missing = isFunction(options.missing) ? options.missing : void 0;
      const missingWarn = isBoolean(options.silentTranslationWarn) || isRegExp(options.silentTranslationWarn) ? !options.silentTranslationWarn : true;
      const fallbackWarn = isBoolean(options.silentFallbackWarn) || isRegExp(options.silentFallbackWarn) ? !options.silentFallbackWarn : true;
      const fallbackRoot = isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
      const fallbackFormat = !!options.formatFallbackMessages;
      const modifiers = isPlainObject(options.modifiers) ? options.modifiers : {};
      const pluralizationRules = options.pluralizationRules;
      const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : void 0;
      const warnHtmlMessage = isString$1(options.warnHtmlInMessage) ? options.warnHtmlInMessage !== "off" : true;
      const escapeParameter = !!options.escapeParameterHtml;
      const inheritLocale = isBoolean(options.sync) ? options.sync : true;
      let messages = options.messages;
      if (isPlainObject(options.sharedMessages)) {
        const sharedMessages = options.sharedMessages;
        const locales = Object.keys(sharedMessages);
        messages = locales.reduce((messages2, locale2) => {
          const message = messages2[locale2] || (messages2[locale2] = {});
          assign$1(message, sharedMessages[locale2]);
          return messages2;
        }, messages || {});
      }
      const { __i18n, __root, __injectWithOption } = options;
      const datetimeFormats = options.datetimeFormats;
      const numberFormats = options.numberFormats;
      const flatJson = options.flatJson;
      const translateExistCompatible = options.translateExistCompatible;
      return {
        locale,
        fallbackLocale,
        messages,
        flatJson,
        datetimeFormats,
        numberFormats,
        missing,
        missingWarn,
        fallbackWarn,
        fallbackRoot,
        fallbackFormat,
        modifiers,
        pluralRules: pluralizationRules,
        postTranslation,
        warnHtmlMessage,
        escapeParameter,
        messageResolver: options.messageResolver,
        inheritLocale,
        translateExistCompatible,
        __i18n,
        __root,
        __injectWithOption
      };
    }
    function createVueI18n(options = {}, VueI18nLegacy) {
      {
        const composer = createComposer(convertComposerOptions(options));
        const { __extender } = options;
        const vueI18n = {
          // id
          id: composer.id,
          // locale
          get locale() {
            return composer.locale.value;
          },
          set locale(val) {
            composer.locale.value = val;
          },
          // fallbackLocale
          get fallbackLocale() {
            return composer.fallbackLocale.value;
          },
          set fallbackLocale(val) {
            composer.fallbackLocale.value = val;
          },
          // messages
          get messages() {
            return composer.messages.value;
          },
          // datetimeFormats
          get datetimeFormats() {
            return composer.datetimeFormats.value;
          },
          // numberFormats
          get numberFormats() {
            return composer.numberFormats.value;
          },
          // availableLocales
          get availableLocales() {
            return composer.availableLocales;
          },
          // formatter
          get formatter() {
            return {
              interpolate() {
                return [];
              }
            };
          },
          set formatter(val) {
          },
          // missing
          get missing() {
            return composer.getMissingHandler();
          },
          set missing(handler) {
            composer.setMissingHandler(handler);
          },
          // silentTranslationWarn
          get silentTranslationWarn() {
            return isBoolean(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
          },
          set silentTranslationWarn(val) {
            composer.missingWarn = isBoolean(val) ? !val : val;
          },
          // silentFallbackWarn
          get silentFallbackWarn() {
            return isBoolean(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
          },
          set silentFallbackWarn(val) {
            composer.fallbackWarn = isBoolean(val) ? !val : val;
          },
          // modifiers
          get modifiers() {
            return composer.modifiers;
          },
          // formatFallbackMessages
          get formatFallbackMessages() {
            return composer.fallbackFormat;
          },
          set formatFallbackMessages(val) {
            composer.fallbackFormat = val;
          },
          // postTranslation
          get postTranslation() {
            return composer.getPostTranslationHandler();
          },
          set postTranslation(handler) {
            composer.setPostTranslationHandler(handler);
          },
          // sync
          get sync() {
            return composer.inheritLocale;
          },
          set sync(val) {
            composer.inheritLocale = val;
          },
          // warnInHtmlMessage
          get warnHtmlInMessage() {
            return composer.warnHtmlMessage ? "warn" : "off";
          },
          set warnHtmlInMessage(val) {
            composer.warnHtmlMessage = val !== "off";
          },
          // escapeParameterHtml
          get escapeParameterHtml() {
            return composer.escapeParameter;
          },
          set escapeParameterHtml(val) {
            composer.escapeParameter = val;
          },
          // preserveDirectiveContent
          get preserveDirectiveContent() {
            return true;
          },
          set preserveDirectiveContent(val) {
          },
          // pluralizationRules
          get pluralizationRules() {
            return composer.pluralRules || {};
          },
          // for internal
          __composer: composer,
          // t
          t(...args) {
            const [arg1, arg2, arg3] = args;
            const options2 = {};
            let list = null;
            let named = null;
            if (!isString$1(arg1)) {
              throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
            }
            const key = arg1;
            if (isString$1(arg2)) {
              options2.locale = arg2;
            } else if (isArray(arg2)) {
              list = arg2;
            } else if (isPlainObject(arg2)) {
              named = arg2;
            }
            if (isArray(arg3)) {
              list = arg3;
            } else if (isPlainObject(arg3)) {
              named = arg3;
            }
            return Reflect.apply(composer.t, composer, [
              key,
              list || named || {},
              options2
            ]);
          },
          rt(...args) {
            return Reflect.apply(composer.rt, composer, [...args]);
          },
          // tc
          tc(...args) {
            const [arg1, arg2, arg3] = args;
            const options2 = { plural: 1 };
            let list = null;
            let named = null;
            if (!isString$1(arg1)) {
              throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
            }
            const key = arg1;
            if (isString$1(arg2)) {
              options2.locale = arg2;
            } else if (isNumber(arg2)) {
              options2.plural = arg2;
            } else if (isArray(arg2)) {
              list = arg2;
            } else if (isPlainObject(arg2)) {
              named = arg2;
            }
            if (isString$1(arg3)) {
              options2.locale = arg3;
            } else if (isArray(arg3)) {
              list = arg3;
            } else if (isPlainObject(arg3)) {
              named = arg3;
            }
            return Reflect.apply(composer.t, composer, [
              key,
              list || named || {},
              options2
            ]);
          },
          // te
          te(key, locale) {
            return composer.te(key, locale);
          },
          // tm
          tm(key) {
            return composer.tm(key);
          },
          // getLocaleMessage
          getLocaleMessage(locale) {
            return composer.getLocaleMessage(locale);
          },
          // setLocaleMessage
          setLocaleMessage(locale, message) {
            composer.setLocaleMessage(locale, message);
          },
          // mergeLocaleMessage
          mergeLocaleMessage(locale, message) {
            composer.mergeLocaleMessage(locale, message);
          },
          // d
          d(...args) {
            return Reflect.apply(composer.d, composer, [...args]);
          },
          // getDateTimeFormat
          getDateTimeFormat(locale) {
            return composer.getDateTimeFormat(locale);
          },
          // setDateTimeFormat
          setDateTimeFormat(locale, format2) {
            composer.setDateTimeFormat(locale, format2);
          },
          // mergeDateTimeFormat
          mergeDateTimeFormat(locale, format2) {
            composer.mergeDateTimeFormat(locale, format2);
          },
          // n
          n(...args) {
            return Reflect.apply(composer.n, composer, [...args]);
          },
          // getNumberFormat
          getNumberFormat(locale) {
            return composer.getNumberFormat(locale);
          },
          // setNumberFormat
          setNumberFormat(locale, format2) {
            composer.setNumberFormat(locale, format2);
          },
          // mergeNumberFormat
          mergeNumberFormat(locale, format2) {
            composer.mergeNumberFormat(locale, format2);
          },
          // getChoiceIndex
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          getChoiceIndex(choice, choicesLength) {
            return -1;
          }
        };
        vueI18n.__extender = __extender;
        return vueI18n;
      }
    }
    const baseFormatProps = {
      tag: {
        type: [String, Object]
      },
      locale: {
        type: String
      },
      scope: {
        type: String,
        // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
        validator: (val) => val === "parent" || val === "global",
        default: "parent"
        /* ComponentI18nScope */
      },
      i18n: {
        type: Object
      }
    };
    function getInterpolateArg({ slots }, keys2) {
      if (keys2.length === 1 && keys2[0] === "default") {
        const ret = slots.default ? slots.default() : [];
        return ret.reduce((slot, current) => {
          return [
            ...slot,
            // prettier-ignore
            ...current.type === Fragment ? current.children : [current]
          ];
        }, []);
      } else {
        return keys2.reduce((arg, key) => {
          const slot = slots[key];
          if (slot) {
            arg[key] = slot();
          }
          return arg;
        }, {});
      }
    }
    function getFragmentableTag(tag) {
      return Fragment;
    }
    const TranslationImpl = /* @__PURE__ */ defineComponent({
      /* eslint-disable */
      name: "i18n-t",
      props: assign$1({
        keypath: {
          type: String,
          required: true
        },
        plural: {
          type: [Number, String],
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
          validator: (val) => isNumber(val) || !isNaN(val)
        }
      }, baseFormatProps),
      /* eslint-enable */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      setup(props, context) {
        const { slots, attrs } = context;
        const i18n2 = props.i18n || useI18n({
          useScope: props.scope,
          __useComponent: true
        });
        return () => {
          const keys2 = Object.keys(slots).filter((key) => key !== "_");
          const options = {};
          if (props.locale) {
            options.locale = props.locale;
          }
          if (props.plural !== void 0) {
            options.plural = isString$1(props.plural) ? +props.plural : props.plural;
          }
          const arg = getInterpolateArg(context, keys2);
          const children = i18n2[TranslateVNodeSymbol](props.keypath, arg, options);
          const assignedAttrs = assign$1({}, attrs);
          const tag = isString$1(props.tag) || isObject$2(props.tag) ? props.tag : getFragmentableTag();
          return h(tag, assignedAttrs, children);
        };
      }
    });
    const Translation = TranslationImpl;
    function isVNode(target) {
      return isArray(target) && !isString$1(target[0]);
    }
    function renderFormatter(props, context, slotKeys, partFormatter) {
      const { slots, attrs } = context;
      return () => {
        const options = { part: true };
        let overrides = {};
        if (props.locale) {
          options.locale = props.locale;
        }
        if (isString$1(props.format)) {
          options.key = props.format;
        } else if (isObject$2(props.format)) {
          if (isString$1(props.format.key)) {
            options.key = props.format.key;
          }
          overrides = Object.keys(props.format).reduce((options2, prop) => {
            return slotKeys.includes(prop) ? assign$1({}, options2, { [prop]: props.format[prop] }) : options2;
          }, {});
        }
        const parts = partFormatter(...[props.value, options, overrides]);
        let children = [options.key];
        if (isArray(parts)) {
          children = parts.map((part, index) => {
            const slot = slots[part.type];
            const node = slot ? slot({ [part.type]: part.value, index, parts }) : [part.value];
            if (isVNode(node)) {
              node[0].key = `${part.type}-${index}`;
            }
            return node;
          });
        } else if (isString$1(parts)) {
          children = [parts];
        }
        const assignedAttrs = assign$1({}, attrs);
        const tag = isString$1(props.tag) || isObject$2(props.tag) ? props.tag : getFragmentableTag();
        return h(tag, assignedAttrs, children);
      };
    }
    const NumberFormatImpl = /* @__PURE__ */ defineComponent({
      /* eslint-disable */
      name: "i18n-n",
      props: assign$1({
        value: {
          type: Number,
          required: true
        },
        format: {
          type: [String, Object]
        }
      }, baseFormatProps),
      /* eslint-enable */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      setup(props, context) {
        const i18n2 = props.i18n || useI18n({
          useScope: props.scope,
          __useComponent: true
        });
        return renderFormatter(props, context, NUMBER_FORMAT_OPTIONS_KEYS, (...args) => (
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
          i18n2[NumberPartsSymbol](...args)
        ));
      }
    });
    const NumberFormat = NumberFormatImpl;
    const DatetimeFormatImpl = /* @__PURE__ */ defineComponent({
      /* eslint-disable */
      name: "i18n-d",
      props: assign$1({
        value: {
          type: [Number, Date],
          required: true
        },
        format: {
          type: [String, Object]
        }
      }, baseFormatProps),
      /* eslint-enable */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      setup(props, context) {
        const i18n2 = props.i18n || useI18n({
          useScope: props.scope,
          __useComponent: true
        });
        return renderFormatter(props, context, DATETIME_FORMAT_OPTIONS_KEYS, (...args) => (
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
          i18n2[DatetimePartsSymbol](...args)
        ));
      }
    });
    const DatetimeFormat = DatetimeFormatImpl;
    function getComposer$2(i18n2, instance) {
      const i18nInternal = i18n2;
      if (i18n2.mode === "composition") {
        return i18nInternal.__getInstance(instance) || i18n2.global;
      } else {
        const vueI18n = i18nInternal.__getInstance(instance);
        return vueI18n != null ? vueI18n.__composer : i18n2.global.__composer;
      }
    }
    function vTDirective(i18n2) {
      const _process = (binding) => {
        const { instance, modifiers, value } = binding;
        if (!instance || !instance.$) {
          throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
        }
        const composer = getComposer$2(i18n2, instance.$);
        const parsedValue = parseValue(value);
        return [
          Reflect.apply(composer.t, composer, [...makeParams(parsedValue)]),
          composer
        ];
      };
      const register = (el, binding) => {
        const [textContent, composer] = _process(binding);
        if (inBrowser && i18n2.global === composer) {
          el.__i18nWatcher = watch(composer.locale, () => {
            binding.instance && binding.instance.$forceUpdate();
          });
        }
        el.__composer = composer;
        el.textContent = textContent;
      };
      const unregister = (el) => {
        if (inBrowser && el.__i18nWatcher) {
          el.__i18nWatcher();
          el.__i18nWatcher = void 0;
          delete el.__i18nWatcher;
        }
        if (el.__composer) {
          el.__composer = void 0;
          delete el.__composer;
        }
      };
      const update = (el, { value }) => {
        if (el.__composer) {
          const composer = el.__composer;
          const parsedValue = parseValue(value);
          el.textContent = Reflect.apply(composer.t, composer, [
            ...makeParams(parsedValue)
          ]);
        }
      };
      const getSSRProps = (binding) => {
        const [textContent] = _process(binding);
        return { textContent };
      };
      return {
        created: register,
        unmounted: unregister,
        beforeUpdate: update,
        getSSRProps
      };
    }
    function parseValue(value) {
      if (isString$1(value)) {
        return { path: value };
      } else if (isPlainObject(value)) {
        if (!("path" in value)) {
          throw createI18nError(I18nErrorCodes.REQUIRED_VALUE, "path");
        }
        return value;
      } else {
        throw createI18nError(I18nErrorCodes.INVALID_VALUE);
      }
    }
    function makeParams(value) {
      const { path, locale, args, choice, plural } = value;
      const options = {};
      const named = args || {};
      if (isString$1(locale)) {
        options.locale = locale;
      }
      if (isNumber(choice)) {
        options.plural = choice;
      }
      if (isNumber(plural)) {
        options.plural = plural;
      }
      return [path, named, options];
    }
    function apply(app, i18n2, ...options) {
      const pluginOptions = isPlainObject(options[0]) ? options[0] : {};
      const useI18nComponentName = !!pluginOptions.useI18nComponentName;
      const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
      if (globalInstall) {
        [!useI18nComponentName ? Translation.name : "i18n", "I18nT"].forEach((name) => app.component(name, Translation));
        [NumberFormat.name, "I18nN"].forEach((name) => app.component(name, NumberFormat));
        [DatetimeFormat.name, "I18nD"].forEach((name) => app.component(name, DatetimeFormat));
      }
      {
        app.directive("t", vTDirective(i18n2));
      }
    }
    function defineMixin(vuei18n, composer, i18n2) {
      return {
        beforeCreate() {
          const instance = getCurrentInstance();
          if (!instance) {
            throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
          }
          const options = this.$options;
          if (options.i18n) {
            const optionsI18n = options.i18n;
            if (options.__i18n) {
              optionsI18n.__i18n = options.__i18n;
            }
            optionsI18n.__root = composer;
            if (this === this.$root) {
              this.$i18n = mergeToGlobal(vuei18n, optionsI18n);
            } else {
              optionsI18n.__injectWithOption = true;
              optionsI18n.__extender = i18n2.__vueI18nExtend;
              this.$i18n = createVueI18n(optionsI18n);
              const _vueI18n = this.$i18n;
              if (_vueI18n.__extender) {
                _vueI18n.__disposer = _vueI18n.__extender(this.$i18n);
              }
            }
          } else if (options.__i18n) {
            if (this === this.$root) {
              this.$i18n = mergeToGlobal(vuei18n, options);
            } else {
              this.$i18n = createVueI18n({
                __i18n: options.__i18n,
                __injectWithOption: true,
                __extender: i18n2.__vueI18nExtend,
                __root: composer
              });
              const _vueI18n = this.$i18n;
              if (_vueI18n.__extender) {
                _vueI18n.__disposer = _vueI18n.__extender(this.$i18n);
              }
            }
          } else {
            this.$i18n = vuei18n;
          }
          if (options.__i18nGlobal) {
            adjustI18nResources(composer, options, options);
          }
          this.$t = (...args) => this.$i18n.t(...args);
          this.$rt = (...args) => this.$i18n.rt(...args);
          this.$tc = (...args) => this.$i18n.tc(...args);
          this.$te = (key, locale) => this.$i18n.te(key, locale);
          this.$d = (...args) => this.$i18n.d(...args);
          this.$n = (...args) => this.$i18n.n(...args);
          this.$tm = (key) => this.$i18n.tm(key);
          i18n2.__setInstance(instance, this.$i18n);
        },
        mounted() {
        },
        unmounted() {
          const instance = getCurrentInstance();
          if (!instance) {
            throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
          }
          const _vueI18n = this.$i18n;
          delete this.$t;
          delete this.$rt;
          delete this.$tc;
          delete this.$te;
          delete this.$d;
          delete this.$n;
          delete this.$tm;
          if (_vueI18n.__disposer) {
            _vueI18n.__disposer();
            delete _vueI18n.__disposer;
            delete _vueI18n.__extender;
          }
          i18n2.__deleteInstance(instance);
          delete this.$i18n;
        }
      };
    }
    function mergeToGlobal(g, options) {
      g.locale = options.locale || g.locale;
      g.fallbackLocale = options.fallbackLocale || g.fallbackLocale;
      g.missing = options.missing || g.missing;
      g.silentTranslationWarn = options.silentTranslationWarn || g.silentFallbackWarn;
      g.silentFallbackWarn = options.silentFallbackWarn || g.silentFallbackWarn;
      g.formatFallbackMessages = options.formatFallbackMessages || g.formatFallbackMessages;
      g.postTranslation = options.postTranslation || g.postTranslation;
      g.warnHtmlInMessage = options.warnHtmlInMessage || g.warnHtmlInMessage;
      g.escapeParameterHtml = options.escapeParameterHtml || g.escapeParameterHtml;
      g.sync = options.sync || g.sync;
      g.__composer[SetPluralRulesSymbol](options.pluralizationRules || g.pluralizationRules);
      const messages = getLocaleMessages(g.locale, {
        messages: options.messages,
        __i18n: options.__i18n
      });
      Object.keys(messages).forEach((locale) => g.mergeLocaleMessage(locale, messages[locale]));
      if (options.datetimeFormats) {
        Object.keys(options.datetimeFormats).forEach((locale) => g.mergeDateTimeFormat(locale, options.datetimeFormats[locale]));
      }
      if (options.numberFormats) {
        Object.keys(options.numberFormats).forEach((locale) => g.mergeNumberFormat(locale, options.numberFormats[locale]));
      }
      return g;
    }
    const I18nInjectionKey = /* @__PURE__ */ makeSymbol("global-vue-i18n");
    function createI18n(options = {}, VueI18nLegacy) {
      const __legacyMode = __VUE_I18N_LEGACY_API__ && isBoolean(options.legacy) ? options.legacy : __VUE_I18N_LEGACY_API__;
      const __globalInjection = isBoolean(options.globalInjection) ? options.globalInjection : true;
      const __allowComposition = __VUE_I18N_LEGACY_API__ && __legacyMode ? !!options.allowComposition : true;
      const __instances = /* @__PURE__ */ new Map();
      const [globalScope, __global] = createGlobal(options, __legacyMode);
      const symbol = /* @__PURE__ */ makeSymbol("");
      function __getInstance(component) {
        return __instances.get(component) || null;
      }
      function __setInstance(component, instance) {
        __instances.set(component, instance);
      }
      function __deleteInstance(component) {
        __instances.delete(component);
      }
      {
        const i18n2 = {
          // mode
          get mode() {
            return __VUE_I18N_LEGACY_API__ && __legacyMode ? "legacy" : "composition";
          },
          // allowComposition
          get allowComposition() {
            return __allowComposition;
          },
          // install plugin
          async install(app, ...options2) {
            app.__VUE_I18N_SYMBOL__ = symbol;
            app.provide(app.__VUE_I18N_SYMBOL__, i18n2);
            if (isPlainObject(options2[0])) {
              const opts = options2[0];
              i18n2.__composerExtend = opts.__composerExtend;
              i18n2.__vueI18nExtend = opts.__vueI18nExtend;
            }
            let globalReleaseHandler = null;
            if (!__legacyMode && __globalInjection) {
              globalReleaseHandler = injectGlobalFields(app, i18n2.global);
            }
            if (__VUE_I18N_FULL_INSTALL__) {
              apply(app, i18n2, ...options2);
            }
            if (__VUE_I18N_LEGACY_API__ && __legacyMode) {
              app.mixin(defineMixin(__global, __global.__composer, i18n2));
            }
            const unmountApp = app.unmount;
            app.unmount = () => {
              globalReleaseHandler && globalReleaseHandler();
              i18n2.dispose();
              unmountApp();
            };
          },
          // global accessor
          get global() {
            return __global;
          },
          dispose() {
            globalScope.stop();
          },
          // @internal
          __instances,
          // @internal
          __getInstance,
          // @internal
          __setInstance,
          // @internal
          __deleteInstance
        };
        return i18n2;
      }
    }
    function useI18n(options = {}) {
      const instance = getCurrentInstance();
      if (instance == null) {
        throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);
      }
      if (!instance.isCE && instance.appContext.app != null && !instance.appContext.app.__VUE_I18N_SYMBOL__) {
        throw createI18nError(I18nErrorCodes.NOT_INSTALLED);
      }
      const i18n2 = getI18nInstance(instance);
      const gl = getGlobalComposer(i18n2);
      const componentOptions = getComponentOptions(instance);
      const scope = getScope(options, componentOptions);
      if (__VUE_I18N_LEGACY_API__) {
        if (i18n2.mode === "legacy" && !options.__useComponent) {
          if (!i18n2.allowComposition) {
            throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE);
          }
          return useI18nForLegacy(instance, scope, gl, options);
        }
      }
      if (scope === "global") {
        adjustI18nResources(gl, options, componentOptions);
        return gl;
      }
      if (scope === "parent") {
        let composer2 = getComposer(i18n2, instance, options.__useComponent);
        if (composer2 == null) {
          composer2 = gl;
        }
        return composer2;
      }
      const i18nInternal = i18n2;
      let composer = i18nInternal.__getInstance(instance);
      if (composer == null) {
        const composerOptions = assign$1({}, options);
        if ("__i18n" in componentOptions) {
          composerOptions.__i18n = componentOptions.__i18n;
        }
        if (gl) {
          composerOptions.__root = gl;
        }
        composer = createComposer(composerOptions);
        if (i18nInternal.__composerExtend) {
          composer[DisposeSymbol] = i18nInternal.__composerExtend(composer);
        }
        setupLifeCycle(i18nInternal, instance, composer);
        i18nInternal.__setInstance(instance, composer);
      }
      return composer;
    }
    function createGlobal(options, legacyMode, VueI18nLegacy) {
      const scope = effectScope();
      {
        const obj = __VUE_I18N_LEGACY_API__ && legacyMode ? scope.run(() => createVueI18n(options)) : scope.run(() => createComposer(options));
        if (obj == null) {
          throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
        }
        return [scope, obj];
      }
    }
    function getI18nInstance(instance) {
      {
        const i18n2 = inject(!instance.isCE ? instance.appContext.app.__VUE_I18N_SYMBOL__ : I18nInjectionKey);
        if (!i18n2) {
          throw createI18nError(!instance.isCE ? I18nErrorCodes.UNEXPECTED_ERROR : I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE);
        }
        return i18n2;
      }
    }
    function getScope(options, componentOptions) {
      return isEmptyObject(options) ? "__i18n" in componentOptions ? "local" : "global" : !options.useScope ? "local" : options.useScope;
    }
    function getGlobalComposer(i18n2) {
      return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
    }
    function getComposer(i18n2, target, useComponent = false) {
      let composer = null;
      const root2 = target.root;
      let current = getParentComponentInstance(target, useComponent);
      while (current != null) {
        const i18nInternal = i18n2;
        if (i18n2.mode === "composition") {
          composer = i18nInternal.__getInstance(current);
        } else {
          if (__VUE_I18N_LEGACY_API__) {
            const vueI18n = i18nInternal.__getInstance(current);
            if (vueI18n != null) {
              composer = vueI18n.__composer;
              if (useComponent && composer && !composer[InejctWithOptionSymbol]) {
                composer = null;
              }
            }
          }
        }
        if (composer != null) {
          break;
        }
        if (root2 === current) {
          break;
        }
        current = current.parent;
      }
      return composer;
    }
    function getParentComponentInstance(target, useComponent = false) {
      if (target == null) {
        return null;
      }
      {
        return !useComponent ? target.parent : target.vnode.ctx || target.parent;
      }
    }
    function setupLifeCycle(i18n2, target, composer) {
      {
        onMounted(() => {
        }, target);
        onUnmounted(() => {
          const _composer = composer;
          i18n2.__deleteInstance(target);
          const dispose = _composer[DisposeSymbol];
          if (dispose) {
            dispose();
            delete _composer[DisposeSymbol];
          }
        }, target);
      }
    }
    function useI18nForLegacy(instance, scope, root2, options = {}) {
      const isLocalScope = scope === "local";
      const _composer = shallowRef(null);
      if (isLocalScope && instance.proxy && !(instance.proxy.$options.i18n || instance.proxy.$options.__i18n)) {
        throw createI18nError(I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);
      }
      const _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : !isString$1(options.locale);
      const _locale = ref(
        // prettier-ignore
        !isLocalScope || _inheritLocale ? root2.locale.value : isString$1(options.locale) ? options.locale : DEFAULT_LOCALE
      );
      const _fallbackLocale = ref(
        // prettier-ignore
        !isLocalScope || _inheritLocale ? root2.fallbackLocale.value : isString$1(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
      );
      const _messages = ref(getLocaleMessages(_locale.value, options));
      const _datetimeFormats = ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
      const _numberFormats = ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
      const _missingWarn = isLocalScope ? root2.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
      const _fallbackWarn = isLocalScope ? root2.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
      const _fallbackRoot = isLocalScope ? root2.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
      const _fallbackFormat = !!options.fallbackFormat;
      const _missing = isFunction(options.missing) ? options.missing : null;
      const _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
      const _warnHtmlMessage = isLocalScope ? root2.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
      const _escapeParameter = !!options.escapeParameter;
      const _modifiers = isLocalScope ? root2.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
      const _pluralRules = options.pluralRules || isLocalScope && root2.pluralRules;
      function trackReactivityValues() {
        return [
          _locale.value,
          _fallbackLocale.value,
          _messages.value,
          _datetimeFormats.value,
          _numberFormats.value
        ];
      }
      const locale = computed({
        get: () => {
          return _composer.value ? _composer.value.locale.value : _locale.value;
        },
        set: (val) => {
          if (_composer.value) {
            _composer.value.locale.value = val;
          }
          _locale.value = val;
        }
      });
      const fallbackLocale = computed({
        get: () => {
          return _composer.value ? _composer.value.fallbackLocale.value : _fallbackLocale.value;
        },
        set: (val) => {
          if (_composer.value) {
            _composer.value.fallbackLocale.value = val;
          }
          _fallbackLocale.value = val;
        }
      });
      const messages = computed(() => {
        if (_composer.value) {
          return _composer.value.messages.value;
        } else {
          return _messages.value;
        }
      });
      const datetimeFormats = computed(() => _datetimeFormats.value);
      const numberFormats = computed(() => _numberFormats.value);
      function getPostTranslationHandler() {
        return _composer.value ? _composer.value.getPostTranslationHandler() : _postTranslation;
      }
      function setPostTranslationHandler(handler) {
        if (_composer.value) {
          _composer.value.setPostTranslationHandler(handler);
        }
      }
      function getMissingHandler() {
        return _composer.value ? _composer.value.getMissingHandler() : _missing;
      }
      function setMissingHandler(handler) {
        if (_composer.value) {
          _composer.value.setMissingHandler(handler);
        }
      }
      function warpWithDeps(fn) {
        trackReactivityValues();
        return fn();
      }
      function t(...args) {
        return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.t, null, [...args])) : warpWithDeps(() => "");
      }
      function rt(...args) {
        return _composer.value ? Reflect.apply(_composer.value.rt, null, [...args]) : "";
      }
      function d(...args) {
        return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.d, null, [...args])) : warpWithDeps(() => "");
      }
      function n(...args) {
        return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.n, null, [...args])) : warpWithDeps(() => "");
      }
      function tm(key) {
        return _composer.value ? _composer.value.tm(key) : {};
      }
      function te(key, locale2) {
        return _composer.value ? _composer.value.te(key, locale2) : false;
      }
      function getLocaleMessage(locale2) {
        return _composer.value ? _composer.value.getLocaleMessage(locale2) : {};
      }
      function setLocaleMessage(locale2, message) {
        if (_composer.value) {
          _composer.value.setLocaleMessage(locale2, message);
          _messages.value[locale2] = message;
        }
      }
      function mergeLocaleMessage(locale2, message) {
        if (_composer.value) {
          _composer.value.mergeLocaleMessage(locale2, message);
        }
      }
      function getDateTimeFormat(locale2) {
        return _composer.value ? _composer.value.getDateTimeFormat(locale2) : {};
      }
      function setDateTimeFormat(locale2, format2) {
        if (_composer.value) {
          _composer.value.setDateTimeFormat(locale2, format2);
          _datetimeFormats.value[locale2] = format2;
        }
      }
      function mergeDateTimeFormat(locale2, format2) {
        if (_composer.value) {
          _composer.value.mergeDateTimeFormat(locale2, format2);
        }
      }
      function getNumberFormat(locale2) {
        return _composer.value ? _composer.value.getNumberFormat(locale2) : {};
      }
      function setNumberFormat(locale2, format2) {
        if (_composer.value) {
          _composer.value.setNumberFormat(locale2, format2);
          _numberFormats.value[locale2] = format2;
        }
      }
      function mergeNumberFormat(locale2, format2) {
        if (_composer.value) {
          _composer.value.mergeNumberFormat(locale2, format2);
        }
      }
      const wrapper = {
        get id() {
          return _composer.value ? _composer.value.id : -1;
        },
        locale,
        fallbackLocale,
        messages,
        datetimeFormats,
        numberFormats,
        get inheritLocale() {
          return _composer.value ? _composer.value.inheritLocale : _inheritLocale;
        },
        set inheritLocale(val) {
          if (_composer.value) {
            _composer.value.inheritLocale = val;
          }
        },
        get availableLocales() {
          return _composer.value ? _composer.value.availableLocales : Object.keys(_messages.value);
        },
        get modifiers() {
          return _composer.value ? _composer.value.modifiers : _modifiers;
        },
        get pluralRules() {
          return _composer.value ? _composer.value.pluralRules : _pluralRules;
        },
        get isGlobal() {
          return _composer.value ? _composer.value.isGlobal : false;
        },
        get missingWarn() {
          return _composer.value ? _composer.value.missingWarn : _missingWarn;
        },
        set missingWarn(val) {
          if (_composer.value) {
            _composer.value.missingWarn = val;
          }
        },
        get fallbackWarn() {
          return _composer.value ? _composer.value.fallbackWarn : _fallbackWarn;
        },
        set fallbackWarn(val) {
          if (_composer.value) {
            _composer.value.missingWarn = val;
          }
        },
        get fallbackRoot() {
          return _composer.value ? _composer.value.fallbackRoot : _fallbackRoot;
        },
        set fallbackRoot(val) {
          if (_composer.value) {
            _composer.value.fallbackRoot = val;
          }
        },
        get fallbackFormat() {
          return _composer.value ? _composer.value.fallbackFormat : _fallbackFormat;
        },
        set fallbackFormat(val) {
          if (_composer.value) {
            _composer.value.fallbackFormat = val;
          }
        },
        get warnHtmlMessage() {
          return _composer.value ? _composer.value.warnHtmlMessage : _warnHtmlMessage;
        },
        set warnHtmlMessage(val) {
          if (_composer.value) {
            _composer.value.warnHtmlMessage = val;
          }
        },
        get escapeParameter() {
          return _composer.value ? _composer.value.escapeParameter : _escapeParameter;
        },
        set escapeParameter(val) {
          if (_composer.value) {
            _composer.value.escapeParameter = val;
          }
        },
        t,
        getPostTranslationHandler,
        setPostTranslationHandler,
        getMissingHandler,
        setMissingHandler,
        rt,
        d,
        n,
        tm,
        te,
        getLocaleMessage,
        setLocaleMessage,
        mergeLocaleMessage,
        getDateTimeFormat,
        setDateTimeFormat,
        mergeDateTimeFormat,
        getNumberFormat,
        setNumberFormat,
        mergeNumberFormat
      };
      function sync(composer) {
        composer.locale.value = _locale.value;
        composer.fallbackLocale.value = _fallbackLocale.value;
        Object.keys(_messages.value).forEach((locale2) => {
          composer.mergeLocaleMessage(locale2, _messages.value[locale2]);
        });
        Object.keys(_datetimeFormats.value).forEach((locale2) => {
          composer.mergeDateTimeFormat(locale2, _datetimeFormats.value[locale2]);
        });
        Object.keys(_numberFormats.value).forEach((locale2) => {
          composer.mergeNumberFormat(locale2, _numberFormats.value[locale2]);
        });
        composer.escapeParameter = _escapeParameter;
        composer.fallbackFormat = _fallbackFormat;
        composer.fallbackRoot = _fallbackRoot;
        composer.fallbackWarn = _fallbackWarn;
        composer.missingWarn = _missingWarn;
        composer.warnHtmlMessage = _warnHtmlMessage;
      }
      onBeforeMount(() => {
        if (instance.proxy == null || instance.proxy.$i18n == null) {
          throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);
        }
        const composer = _composer.value = instance.proxy.$i18n.__composer;
        if (scope === "global") {
          _locale.value = composer.locale.value;
          _fallbackLocale.value = composer.fallbackLocale.value;
          _messages.value = composer.messages.value;
          _datetimeFormats.value = composer.datetimeFormats.value;
          _numberFormats.value = composer.numberFormats.value;
        } else if (isLocalScope) {
          sync(composer);
        }
      });
      return wrapper;
    }
    const globalExportProps = [
      "locale",
      "fallbackLocale",
      "availableLocales"
    ];
    const globalExportMethods = ["t", "rt", "d", "n", "tm", "te"];
    function injectGlobalFields(app, composer) {
      const i18n2 = /* @__PURE__ */ Object.create(null);
      globalExportProps.forEach((prop) => {
        const desc = Object.getOwnPropertyDescriptor(composer, prop);
        if (!desc) {
          throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
        }
        const wrap = isRef(desc.value) ? {
          get() {
            return desc.value.value;
          },
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
          set(val) {
            desc.value.value = val;
          }
        } : {
          get() {
            return desc.get && desc.get();
          }
        };
        Object.defineProperty(i18n2, prop, wrap);
      });
      app.config.globalProperties.$i18n = i18n2;
      globalExportMethods.forEach((method) => {
        const desc = Object.getOwnPropertyDescriptor(composer, method);
        if (!desc || !desc.value) {
          throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
        }
        Object.defineProperty(app.config.globalProperties, `$${method}`, desc);
      });
      const dispose = () => {
        delete app.config.globalProperties.$i18n;
        globalExportMethods.forEach((method) => {
          delete app.config.globalProperties[`$${method}`];
        });
      };
      return dispose;
    }
    {
      initFeatureFlags();
    }
    if (__INTLIFY_JIT_COMPILATION__) {
      registerMessageCompiler(compile);
    } else {
      registerMessageCompiler(compileToFunction);
    }
    registerMessageResolver(resolveValue);
    registerLocaleFallbacker(fallbackWithLocaleChain);
    if (__INTLIFY_PROD_DEVTOOLS__) {
      const target = getGlobalThis();
      target.__INTLIFY__ = true;
      setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
    }
    const en = {
      MyProgress: {
        text0: "Processing started",
        text1: "Processing in progress",
        text2: "Please add an image",
        text3: "Image list is empty",
        text4: "Processing terminated",
        text5: "Processing failed, skipping",
        text6: "START",
        text7: "TERMINATE",
        text8: "LOG",
        text9: "Processing failed",
        text10: "Please click on the log to view the error message"
      },
      Final2xHome: {
        text0: "Removal successful",
        text1: "Click or drag and drop images or folders here to upload"
      },
      Final2xSettings: {
        text10: "Device",
        text11: "Model",
        text15: "Custom Scale",
        text16: "Default",
        text17: "Output Folder",
        text18: "Proxy"
      }
    };
    const zh = {
      MyProgress: {
        text0: "开始处理",
        text1: "处理中",
        text2: "请添加图片",
        text3: "图片列表为空",
        text4: "已终止处理",
        text5: "处理失败，跳过",
        text6: "开始",
        text7: "终止",
        text8: "日志",
        text9: "处理失败",
        text10: "请点击日志查看错误信息"
      },
      Final2xHome: {
        text0: "移除成功",
        text1: "点击或拖拽图片或文件夹到此处上传"
      },
      Final2xSettings: {
        text10: "设备",
        text11: "模型",
        text15: "自定义倍率",
        text16: "默认",
        text17: "输出文件夹",
        text18: "下载代理"
      }
    };
    const ja = {
      MyProgress: {
        text0: "処理を開始します",
        text1: "処理中です",
        text2: "画像を追加してください",
        text3: "画像リストは空です",
        text4: "処理が中断されました",
        text5: "処理に失敗しました。スキップします",
        text6: "開始",
        text7: "中止",
        text8: "ログ",
        text9: "処理失敗",
        text10: "エラーメッセージを確認するには、ログをクリックしてください"
      },
      Final2xHome: {
        text0: "削除が成功しました",
        text1: "画像やフォルダをここにクリックまたはドラッグ＆ドロップしてアップロードしてください"
      },
      Final2xSettings: {
        text10: "デバイス",
        text11: "モデル",
        text15: "Custom Scale",
        text16: "Default",
        text17: "出力フォルダ",
        text18: "プロキシ"
      }
    };
    const fr = {
      MyProgress: {
        text0: "Traitement commencé",
        text1: "Traitement en cours",
        text2: "Veuillez ajouter une image",
        text3: "La liste d'images est vide",
        text4: "Traitement terminé",
        text5: "Échec du traitement, passage à la suite",
        text6: "DÉMARRER",
        text7: "ARRÊTER",
        text8: "JOURNAL",
        text9: "Échec du traitement",
        text10: "Veuillez cliquer sur le journal pour voir le message d'erreur"
      },
      Final2xHome: {
        text0: "Suppression réussie",
        text1: "Cliquez ou faites glisser les images ou dossiers ici pour les téléverser"
      },
      Final2xSettings: {
        text10: "Périph.",
        text11: "Modèle",
        text15: "Échelle (num.)",
        text16: "Par déf.",
        text17: "Dossier de sortie",
        text18: "Proxy"
      }
    };
    const LANG_LIST = ["en", "zh", "ja", "fr"];
    const i18n = createI18n({
      legacy: false,
      fallbackLocale: "en",
      globalInjection: true,
      // 全局注册$t方法
      messages: {
        en,
        zh,
        ja,
        fr
      }
    });
    class Utils {
      /**
       * @description 返回语言，和语言数量
       * @param id 语言id 0-> en, 1-> zh, 2-> ja, 3-> fr
       */
      static getLanguage(id) {
        const langs = LANG_LIST;
        return {
          lang: langs[id],
          numLang: langs.length
        };
      }
      /**
       * @description 等待一段时间
       * @param timeout 等待时间，单位毫秒
       */
      static sleep(timeout) {
        return new Promise((resolve2) => setTimeout(resolve2, timeout));
      }
      /**
       * @description Deep, Dark, Fantasy? 真·深度睡眠
       * @param miliseconds 等待时间，单位毫秒
       */
      static DeepDeepSleep(miliseconds) {
        const currentTime = (/* @__PURE__ */ new Date()).getTime();
        while (currentTime + miliseconds >= (/* @__PURE__ */ new Date()).getTime()) {
        }
      }
      /**
       * @description 生成超长随机字符串
       */
      static getRandString() {
        return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
      }
      /**
       * @description: 防抖函数装饰器，防止用户频繁点击
       * @param fn  需要防抖的函数
       * @param delay 防抖的时间间隔，默认500ms
       */
      static clickDebounce(fn, delay = 500) {
        let timer = null;
        let immediate = true;
        return (...args) => {
          if (timer) {
            clearTimeout(timer);
          }
          if (immediate) {
            fn(...args);
            immediate = false;
          }
          timer = setTimeout(() => {
            immediate = true;
          }, delay);
        };
      }
    }
    const { getLanguage, sleep, DeepDeepSleep, getRandString, clickDebounce } = Utils;
    const useGlobalSettingsStore = /* @__PURE__ */ defineStore(
      "GlobalSettings",
      () => {
        const darkMode = ref("system");
        const globalcolor = ref("#fffafa");
        const naiveTheme = ref(void 0);
        const changeRoute = ref(false);
        const langsNum = ref(114514);
        const selectedTorchDevice = ref("auto");
        const torchDeviceList = ref([
          { value: "auto", label: "Auto" },
          { value: "cuda", label: "CUDA" },
          { value: "mps", label: "MPS" },
          { value: "cpu", label: "CPU" }
        ]);
        const ProgressPercentage = ref(0);
        const CommandLOG = ref("");
        const logInstRef = ref(null);
        const StartCommandLock = ref(false);
        const SrSuccess = ref(false);
        const openOutputFolder = ref(true);
        return {
          darkMode,
          globalcolor,
          naiveTheme,
          changeRoute,
          langsNum,
          selectedTorchDevice,
          torchDeviceList,
          ProgressPercentage,
          CommandLOG,
          StartCommandLock,
          SrSuccess,
          logInstRef,
          openOutputFolder
        };
      },
      {
        persist: {
          storage: localStorage,
          paths: [
            "langsNum",
            "selectedTorchDevice",
            "darkMode",
            "naiveTheme",
            "globalcolor",
            "openOutputFolder"
          ]
        }
      }
    );
    const _hoisted_1$e = { class: "container" };
    const _hoisted_2$b = { key: 0 };
    const _hoisted_3$7 = { key: 1 };
    const _sfc_main$9 = /* @__PURE__ */ defineComponent({
      __name: "TrafficLightsButtons",
      setup(__props) {
        const isFocus = ref(true);
        const handleFocus = () => {
          isFocus.value = true;
        };
        const handleBlur = () => {
          isFocus.value = false;
        };
        onMounted(() => {
          window.addEventListener("focus", handleFocus);
          window.addEventListener("blur", handleBlur);
        });
        onUnmounted(() => {
          window.removeEventListener("focus", handleFocus);
          window.removeEventListener("blur", handleBlur);
        });
        function handleClose() {
          window.electron.ipcRenderer.send("close");
        }
        function handleMinimize() {
          window.electron.ipcRenderer.send("minimize");
        }
        function handleMaximize() {
          window.electron.ipcRenderer.send("maximize");
        }
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", _hoisted_1$e, [
            _cache[0] || (_cache[0] = createBaseVNode("div", { class: "drag-area" }, null, -1)),
            !isFocus.value ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
              createBaseVNode("div", { class: "example" }, [
                createBaseVNode("div", { class: "traffic-lights" }, [
                  createBaseVNode("button", {
                    id: "close",
                    class: "traffic-light traffic-light-close",
                    onClick: handleClose
                  }),
                  createBaseVNode("button", {
                    id: "minimize",
                    class: "traffic-light traffic-light-minimize",
                    onClick: handleMinimize
                  }),
                  createBaseVNode("button", {
                    id: "maximize",
                    class: "traffic-light traffic-light-maximize",
                    onClick: handleMaximize
                  })
                ])
              ])
            ])) : (openBlock(), createElementBlock("div", _hoisted_3$7, [
              createBaseVNode("div", { class: "example focus" }, [
                createBaseVNode("div", { class: "traffic-lights" }, [
                  createBaseVNode("button", {
                    id: "close",
                    class: "traffic-light traffic-light-close",
                    onClick: handleClose
                  }),
                  createBaseVNode("button", {
                    id: "minimize",
                    class: "traffic-light traffic-light-minimize",
                    onClick: handleMinimize
                  }),
                  createBaseVNode("button", {
                    id: "maximize",
                    class: "traffic-light traffic-light-maximize",
                    onClick: handleMaximize
                  })
                ])
              ])
            ]))
          ]);
        };
      }
    });
    const _export_sfc = (sfc, props) => {
      const target = sfc.__vccOpts || sfc;
      for (const [key, val] of props) {
        target[key] = val;
      }
      return target;
    };
    const TrafficLightsButtons = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-2f11aa11"]]);
    const useSRSettingsStore = /* @__PURE__ */ defineStore(
      "SRSettings",
      () => {
        const selectedSRModel = ref("RealESRGAN_RealESRGAN_x2plus_2x.pth");
        const ghProxy = ref(null);
        const targetScale = ref(null);
        return {
          selectedSRModel,
          ghProxy,
          targetScale
        };
      },
      {
        persist: {
          storage: localStorage,
          paths: ["selectedSRModel", "ghProxy", "targetScale"]
        }
      }
    );
    const useIOPathStore = /* @__PURE__ */ defineStore(
      "IOPath",
      () => {
        const inputpathMap = ref(/* @__PURE__ */ new Map());
        const outputpath = ref("");
        const outputpathLock = ref(false);
        const inputFileList = ref([]);
        return {
          inputpathMap,
          outputpath,
          outputpathLock,
          inputFileList
        };
      },
      {
        persist: {
          storage: localStorage,
          paths: ["outputpath", "outputpathLock"]
        }
      }
    );
    class PathFormat {
      rootpath;
      constructor() {
        this.rootpath = "";
      }
      /**
       * @description 设置本次上传的根目录
       */
      setRootPath(path) {
        const segments = path.split(/[/\\]/);
        if (segments.length > 1) {
          segments.pop();
          this.rootpath = segments.join(path.startsWith("/") ? "/" : "\\");
        }
      }
      /**
       * @description 返回本次上传的根目录
       */
      getRootPath() {
        return this.rootpath;
      }
      /**
       * @description 相对于本次上传的根目录，返回拼接后的真实路径
       */
      getNewPath(path) {
        const segments = path.split(/[/\\]/);
        return this.rootpath + segments.join(this.rootpath.startsWith("/") ? "/" : "\\");
      }
      /**
       * @description 检查路径格式是否正确
       */
      static checkPath(path) {
        return path.startsWith("/") || path.includes("\\");
      }
      /**
       * @description 返回文件名
       */
      static getFileName(path) {
        const segments = path.split(/[/\\]/);
        return segments[segments.length - 1];
      }
    }
    class ioPATH {
      /**
       * @description Add a new inputpath to inputpathMap
       * @param id inputpath id
       * @param path inputpath
       */
      static add(id, path) {
        const { inputpathMap } = storeToRefs(useIOPathStore());
        if (path != "") {
          inputpathMap.value.set(id, path);
        }
      }
      /**
       * @description Delete an inputpath from inputpathMap by id
       * @param id inputpath id
       */
      static delete(id) {
        const { inputpathMap } = storeToRefs(useIOPathStore());
        inputpathMap.value.delete(id);
      }
      /**
       * @description 检查 id 是否存在，因为 naive-ui 生成的 id 长度较短，所以这里只检查 inputpathMap 即可
       * @param id inputpath id
       */
      static checkID(id) {
        const { inputpathMap } = storeToRefs(useIOPathStore());
        return inputpathMap.value.get(id) != void 0;
      }
      /**
       * @description Get an inputpath from inputpathMap by id
       * @param id inputpath id
       */
      static getByID(id) {
        const { inputpathMap } = storeToRefs(useIOPathStore());
        return inputpathMap.value.get(id) || "";
      }
      /**
       * @description Get all inputpath from inputpathMap
       * @returns inputpathMap with string
       */
      static getAllPath() {
        const { inputpathMap } = storeToRefs(useIOPathStore());
        let inputpath = "";
        inputpathMap.value.forEach((value, key) => {
          inputpath += key + " : " + value + "\n";
        });
        return inputpath;
      }
      /**
       * @description Get all inputpath from inputpathMap
       * @returns inputpathMap string list
       */
      static getList() {
        const { inputpathMap } = storeToRefs(useIOPathStore());
        return Array.from(inputpathMap.value.values());
      }
      /**
       * @description check inputpathMap is empty
       */
      static isEmpty() {
        const { inputpathMap } = storeToRefs(useIOPathStore());
        return inputpathMap.value.size == 0;
      }
      /**
       * @description Get all inputpath from inputpathMap
       * @returns inputpathMap with string
       */
      static show() {
        const inputpathList = ioPATH.getList();
        console.log("inputpathList: ", inputpathList);
        let inputpathListString = "";
        for (const i in inputpathList) {
          inputpathListString += inputpathList[i] + "\n";
        }
        return inputpathListString;
      }
      /**
       * @description Set outputpath by manual, and lock outputpath
       */
      static setoutputpathManual(path) {
        const { outputpath, outputpathLock } = storeToRefs(useIOPathStore());
        if (path != "") {
          outputpath.value = path;
          outputpathLock.value = true;
          console.log("outputpath SET SUCCESS!");
        }
      }
      /**
       * @description Set outputpath if outputpathLock is false or outputpath is invalid
       */
      static setoutputpath(path) {
        const { outputpath, outputpathLock } = storeToRefs(useIOPathStore());
        if (path != "" && (outputpathLock.value == false || !PathFormat.checkPath(outputpath.value))) {
          outputpath.value = path;
        } else {
          console.log("outputpath Lock!");
        }
      }
      /**
       * @description get outputpath
       */
      static getoutputpath() {
        const { outputpath } = storeToRefs(useIOPathStore());
        return outputpath.value;
      }
      /**
       * @description clear all inputpath
       */
      static clearALL() {
        const { inputpathMap, inputFileList } = storeToRefs(useIOPathStore());
        inputpathMap.value.clear();
        inputFileList.value = [];
      }
    }
    function getOutPutPATH() {
      if (!PathFormat.checkPath(ioPATH.getoutputpath())) {
        const inputPATHList = ioPATH.getList();
        const pathFormat = new PathFormat();
        pathFormat.setRootPath(inputPATHList[0]);
        ioPATH.setoutputpath(pathFormat.getRootPath());
      }
      return ioPATH.getoutputpath();
    }
    const getFinal2xconfig = () => {
      const { selectedSRModel, ghProxy, targetScale } = storeToRefs(useSRSettingsStore());
      const { selectedTorchDevice } = storeToRefs(useGlobalSettingsStore());
      const inputPATHList = ioPATH.getList();
      const outputPATH = getOutPutPATH();
      let _gh_proxy;
      if (ghProxy.value === "") {
        _gh_proxy = null;
      } else {
        _gh_proxy = ghProxy.value;
      }
      return JSON.stringify({
        pretrained_model_name: selectedSRModel.value,
        device: selectedTorchDevice.value,
        gh_proxy: _gh_proxy,
        target_scale: targetScale.value,
        output_path: outputPATH,
        input_path: inputPATHList
      });
    };
    const _hoisted_1$d = { class: "control" };
    const _sfc_main$8 = /* @__PURE__ */ defineComponent({
      __name: "MyProgress",
      setup(__props) {
        const { t } = useI18n();
        const notification = useNotification();
        const dialog = useDialog();
        const {
          CommandLOG,
          logInstRef,
          StartCommandLock,
          SrSuccess,
          ProgressPercentage,
          openOutputFolder
        } = storeToRefs(useGlobalSettingsStore());
        const showLOG = ref(false);
        onMounted(() => {
          watchEffect(() => {
            if (CommandLOG.value) {
              nextTick(() => {
                logInstRef.value?.scrollTo({ position: "bottom", silent: true });
              });
            }
          });
        });
        function handleCommandLOG(log) {
          CommandLOG.value += log;
          const skipImageRegex = /______Skip_Image______:(.+)/;
          const processingRegex = /Processing------\[ ([\d.]+)% /;
          const srSuccessRegex = /______SR_COMPLETED______/;
          const skipImageMatch = log.match(skipImageRegex);
          const processingMatch = log.match(processingRegex);
          const srSuccessMatch = log.match(srSuccessRegex);
          if (skipImageMatch) {
            const imagePath = skipImageMatch[1];
            MyProgressNotifications.SkipImage(imagePath);
          }
          if (processingMatch) {
            ProgressPercentage.value = parseFloat(processingMatch[1]);
          }
          if (srSuccessMatch) {
            SrSuccess.value = true;
          }
        }
        class MyProgressNotifications {
          static StartSR() {
            notification.success({
              title: t("MyProgress.text0"),
              duration: 1500
            });
          }
          static SRprocessing() {
            notification.warning({
              title: t("MyProgress.text1"),
              duration: 1500
            });
          }
          static SRListEmpty() {
            notification.warning({
              title: t("MyProgress.text2"),
              content: t("MyProgress.text3"),
              duration: 1500,
              keepAliveOnHover: true
            });
          }
          static TerminateSR() {
            notification.error({
              title: t("MyProgress.text4"),
              duration: 1500,
              keepAliveOnHover: true
            });
          }
          static SkipImage(imagePath) {
            notification.warning({
              title: t("MyProgress.text5"),
              content: imagePath,
              duration: 2e3,
              keepAliveOnHover: true
            });
          }
        }
        class MyProgressDialogs {
          static SrFailed() {
            dialog.error({
              title: t("MyProgress.text9"),
              content: t("MyProgress.text10")
            });
          }
        }
        function StartSR() {
          if (StartCommandLock.value) {
            MyProgressNotifications.SRprocessing();
            return;
          }
          if (ioPATH.isEmpty()) {
            MyProgressNotifications.SRListEmpty();
            return;
          }
          StartCommandLock.value = true;
          SrSuccess.value = false;
          MyProgressNotifications.StartSR();
          const command = getFinal2xconfig();
          CommandLOG.value += "\n" + command + "\n";
          CommandLOG.value += "OPEN OUTPUT FOLDER: " + openOutputFolder.value + "\n";
          window.electron.ipcRenderer.send("execute-command", command, openOutputFolder.value);
        }
        function TerminateSR() {
          window.electron.ipcRenderer.send("kill-command");
          MyProgressNotifications.TerminateSR();
        }
        watchEffect(() => {
          window.electron.ipcRenderer.on("command-stdout", (event, data) => {
            handleCommandLOG(data);
          });
          window.electron.ipcRenderer.on("command-stderr", (event, data) => {
            handleCommandLOG(data);
          });
          window.electron.ipcRenderer.on("command-close-code", (event, data) => {
            handleCommandLOG("CLOSE CODE:" + data);
            StartCommandLock.value = false;
            if (!SrSuccess.value) {
              MyProgressDialogs.SrFailed();
            } else {
              ioPATH.clearALL();
            }
          });
        });
        return (_ctx, _cache) => {
          const _component_n_progress = resolveComponent("n-progress");
          const _component_n_button = resolveComponent("n-button");
          const _component_n_log = resolveComponent("n-log");
          const _component_n_card = resolveComponent("n-card");
          const _component_n_drawer_content = resolveComponent("n-drawer-content");
          const _component_n_drawer = resolveComponent("n-drawer");
          const _component_n_divider = resolveComponent("n-divider");
          return openBlock(), createElementBlock("div", null, [
            createBaseVNode("div", _hoisted_1$d, [
              createVNode(_component_n_progress, {
                percentage: unref(ProgressPercentage),
                color: "green",
                height: 34,
                "indicator-placement": "inside",
                processing: "",
                type: "line"
              }, null, 8, ["percentage"]),
              createVNode(_component_n_button, {
                round: "",
                secondary: "",
                strong: "",
                type: "success",
                onClick: StartSR
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString$1(unref(t)("MyProgress.text6")), 1)
                ]),
                _: 1
              }),
              createVNode(_component_n_button, {
                round: "",
                secondary: "",
                strong: "",
                type: "error",
                onClick: TerminateSR
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString$1(unref(t)("MyProgress.text7")), 1)
                ]),
                _: 1
              }),
              createVNode(_component_n_button, {
                round: "",
                secondary: "",
                strong: "",
                type: "warning",
                onClick: _cache[0] || (_cache[0] = ($event) => showLOG.value = !showLOG.value)
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString$1(unref(t)("MyProgress.text8")), 1)
                ]),
                _: 1
              })
            ]),
            createVNode(_component_n_drawer, {
              show: showLOG.value,
              "onUpdate:show": _cache[1] || (_cache[1] = ($event) => showLOG.value = $event),
              height: "385",
              placement: "top"
            }, {
              default: withCtx(() => [
                createVNode(_component_n_drawer_content, {
                  "native-scrollbar": false,
                  title: ""
                }, {
                  default: withCtx(() => [
                    _cache[2] || (_cache[2] = createBaseVNode("br", null, null, -1)),
                    createVNode(_component_n_card, {
                      hoverable: "",
                      size: "small",
                      title: "Log"
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_n_log, {
                          ref_key: "logInstRef",
                          ref: logInstRef,
                          log: unref(CommandLOG),
                          trim: ""
                        }, null, 8, ["log"])
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["show"]),
            createVNode(_component_n_divider, { class: "n-divider" })
          ]);
        };
      }
    });
    const _hoisted_1$c = {
      xmlns: "http://www.w3.org/2000/svg",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      viewBox: "0 0 512 512"
    };
    const _hoisted_2$a = /* @__PURE__ */ createBaseVNode(
      "path",
      {
        d: "M256 32C132.29 32 32 132.29 32 256s100.29 224 224 224s224-100.29 224-224S379.71 32 256 32zM128.72 383.28A180 180 0 0 1 256 76v360a178.82 178.82 0 0 1-127.28-52.72z",
        fill: "currentColor"
      },
      null,
      -1
      /* HOISTED */
    );
    const _hoisted_3$6 = [_hoisted_2$a];
    const ContrastSharp = /* @__PURE__ */ defineComponent({
      name: "ContrastSharp",
      render: function render2(_ctx, _cache) {
        return openBlock(), createElementBlock("svg", _hoisted_1$c, _hoisted_3$6);
      }
    });
    const _hoisted_1$b = {
      xmlns: "http://www.w3.org/2000/svg",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      viewBox: "0 0 512 512"
    };
    const _hoisted_2$9 = /* @__PURE__ */ createStaticVNode('<rect x="48" y="96" width="416" height="320" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="384" y="336" width="80" height="80" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="384" y="256" width="80" height="80" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="384" y="176" width="80" height="80" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="384" y="96" width="80" height="80" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="48" y="336" width="80" height="80" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="48" y="256" width="80" height="80" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="48" y="176" width="80" height="80" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="48" y="96" width="80" height="80" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="128" y="96" width="256" height="160" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect><rect x="128" y="256" width="256" height="160" rx="28" ry="28" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"></rect>', 11);
    const _hoisted_13 = [_hoisted_2$9];
    const FilmOutline = /* @__PURE__ */ defineComponent({
      name: "FilmOutline",
      render: function render2(_ctx, _cache) {
        return openBlock(), createElementBlock("svg", _hoisted_1$b, _hoisted_13);
      }
    });
    const _hoisted_1$a = {
      xmlns: "http://www.w3.org/2000/svg",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      viewBox: "0 0 512 512"
    };
    const _hoisted_2$8 = /* @__PURE__ */ createBaseVNode(
      "path",
      {
        d: "M160 136c0-30.62 4.51-61.61 16-88C99.57 81.27 48 159.32 48 248c0 119.29 96.71 216 216 216c88.68 0 166.73-51.57 200-128c-26.39 11.49-57.38 16-88 16c-119.29 0-216-96.71-216-216z",
        fill: "none",
        stroke: "currentColor",
        "stroke-linecap": "round",
        "stroke-linejoin": "round",
        "stroke-width": "32"
      },
      null,
      -1
      /* HOISTED */
    );
    const _hoisted_3$5 = [_hoisted_2$8];
    const MoonOutline = /* @__PURE__ */ defineComponent({
      name: "MoonOutline",
      render: function render2(_ctx, _cache) {
        return openBlock(), createElementBlock("svg", _hoisted_1$a, _hoisted_3$5);
      }
    });
    const _hoisted_1$9 = {
      xmlns: "http://www.w3.org/2000/svg",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      viewBox: "0 0 512 512"
    };
    const _hoisted_2$7 = /* @__PURE__ */ createStaticVNode('<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M256 48v48"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M256 416v48"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M403.08 108.92l-33.94 33.94"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M142.86 369.14l-33.94 33.94"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M464 256h-48"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M96 256H48"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M403.08 403.08l-33.94-33.94"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M142.86 142.86l-33.94-33.94"></path><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32"></circle>', 9);
    const _hoisted_11 = [_hoisted_2$7];
    const SunnyOutline = /* @__PURE__ */ defineComponent({
      name: "SunnyOutline",
      render: function render2(_ctx, _cache) {
        return openBlock(), createElementBlock("svg", _hoisted_1$9, _hoisted_11);
      }
    });
    const _hoisted_1$8 = { class: "MyExternalLink" };
    const _sfc_main$7 = /* @__PURE__ */ defineComponent({
      __name: "MyExternalLink",
      setup(__props) {
        class openWebsite {
          static async FinalRip() {
            const Link2 = "https://github.com/TensoRaws/FinalRip";
            window.open(Link2, "_blank");
          }
        }
        return (_ctx, _cache) => {
          const _component_n_icon = resolveComponent("n-icon");
          const _component_n_button = resolveComponent("n-button");
          const _component_n_space = resolveComponent("n-space");
          return openBlock(), createElementBlock("div", _hoisted_1$8, [
            createVNode(_component_n_space, null, {
              default: withCtx(() => [
                createVNode(_component_n_button, {
                  style: { "font-size": "36px" },
                  text: "",
                  onClick: openWebsite.FinalRip
                }, {
                  default: withCtx(() => [
                    createVNode(_component_n_icon, null, {
                      default: withCtx(() => [
                        createVNode(unref(FilmOutline))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["onClick"])
              ]),
              _: 1
            })
          ]);
        };
      }
    });
    const MyExternalLink = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-621adcf9"]]);
    function switchLanguage() {
      const { langsNum } = storeToRefs(useGlobalSettingsStore());
      if (langsNum.value === 114514) {
        langsNum.value = 1;
      } else {
        langsNum.value = (langsNum.value + 1) % getLanguage(0).numLang;
      }
    }
    const _hoisted_1$7 = {
      xmlns: "http://www.w3.org/2000/svg",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      viewBox: "0 0 1024 1024"
    };
    const _hoisted_2$6 = /* @__PURE__ */ createBaseVNode(
      "path",
      {
        d: "M553.1 509.1l-77.8 99.2l-41.1-52.4a8 8 0 0 0-12.6 0l-99.8 127.2a7.98 7.98 0 0 0 6.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 0 0-12.7 0zM360 442a40 40 0 1 0 80 0a40 40 0 1 0-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z",
        fill: "currentColor"
      },
      null,
      -1
      /* HOISTED */
    );
    const _hoisted_3$4 = [_hoisted_2$6];
    const FileImageOutlined = /* @__PURE__ */ defineComponent({
      name: "FileImageOutlined",
      render: function render2(_ctx, _cache) {
        return openBlock(), createElementBlock("svg", _hoisted_1$7, _hoisted_3$4);
      }
    });
    const _hoisted_1$6 = {
      xmlns: "http://www.w3.org/2000/svg",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      viewBox: "0 0 1024 1024"
    };
    const _hoisted_2$5 = /* @__PURE__ */ createBaseVNode(
      "path",
      {
        d: "M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 0 0-44.4 0L77.5 505a63.9 63.9 0 0 0-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0 0 18.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7l23.1 23.1L882 542.3h-96.1z",
        fill: "currentColor"
      },
      null,
      -1
      /* HOISTED */
    );
    const _hoisted_3$3 = [_hoisted_2$5];
    const HomeOutlined = /* @__PURE__ */ defineComponent({
      name: "HomeOutlined",
      render: function render2(_ctx, _cache) {
        return openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_3$3);
      }
    });
    const _hoisted_1$5 = {
      xmlns: "http://www.w3.org/2000/svg",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      viewBox: "0 0 1024 1024"
    };
    const _hoisted_2$4 = /* @__PURE__ */ createBaseVNode(
      "path",
      {
        d: "M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 0 0 9.3-35.2l-.9-2.6a443.74 443.74 0 0 0-79.7-137.9l-1.8-2.1a32.12 32.12 0 0 0-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 0 0-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 0 0-25.8 25.7l-15.8 85.4a351.86 351.86 0 0 0-99 57.4l-81.9-29.1a32 32 0 0 0-35.1 9.5l-1.8 2.1a446.02 446.02 0 0 0-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1c0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 0 0-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0 0 35.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0 0 25.8 25.7l2.7.5a449.4 449.4 0 0 0 159 0l2.7-.5a32.05 32.05 0 0 0 25.8-25.7l15.7-85a350 350 0 0 0 99.7-57.6l81.3 28.9a32 32 0 0 0 35.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1l74.7 63.9a370.03 370.03 0 0 1-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3l-17.9 97a377.5 377.5 0 0 1-85 0l-17.9-97.2l-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9l-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5l-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5c0-15.3 1.2-30.6 3.7-45.5l6.5-40l-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2l31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3l17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97l38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8l92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176s-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 0 1 512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 0 1 400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 0 1 624 502c0 29.9-11.7 58-32.8 79.2z",
        fill: "currentColor"
      },
      null,
      -1
      /* HOISTED */
    );
    const _hoisted_3$2 = [_hoisted_2$4];
    const SettingOutlined = /* @__PURE__ */ defineComponent({
      name: "SettingOutlined",
      render: function render2(_ctx, _cache) {
        return openBlock(), createElementBlock("svg", _hoisted_1$5, _hoisted_3$2);
      }
    });
    const _hoisted_1$4 = {
      xmlns: "http://www.w3.org/2000/svg",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      viewBox: "0 0 1024 1024"
    };
    const _hoisted_2$3 = /* @__PURE__ */ createBaseVNode(
      "defs",
      null,
      null,
      -1
      /* HOISTED */
    );
    const _hoisted_3$1 = /* @__PURE__ */ createBaseVNode(
      "path",
      {
        d: "M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z",
        fill: "currentColor"
      },
      null,
      -1
      /* HOISTED */
    );
    const _hoisted_4$1 = /* @__PURE__ */ createBaseVNode(
      "path",
      {
        d: "M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6c0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2L426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z",
        fill: "currentColor"
      },
      null,
      -1
      /* HOISTED */
    );
    const _hoisted_5$1 = [_hoisted_2$3, _hoisted_3$1, _hoisted_4$1];
    const TranslationOutlined = /* @__PURE__ */ defineComponent({
      name: "TranslationOutlined",
      render: function render2(_ctx, _cache) {
        return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_5$1);
      }
    });
    const _hoisted_1$3 = { class: "file-drag-zone-logo-text" };
    const _hoisted_2$2 = { style: { "margin-bottom": "12px" } };
    const _sfc_main$6 = /* @__PURE__ */ defineComponent({
      __name: "Final2xHome",
      setup(__props) {
        const { t } = useI18n();
        const notification = useNotification();
        const useIOPath = useIOPathStore();
        const { inputFileList } = storeToRefs(useIOPath);
        const pathFormat = new PathFormat();
        class Final2xHomeNotifications {
          static handleremove(s) {
            notification.success({
              title: t("Final2xHome.text0"),
              content: s,
              duration: 1e3
            });
          }
        }
        function handleClickUpload() {
          const handleSelected = (e, path) => {
            if (path != void 0) {
              path.forEach((p2) => {
                let pathid = getRandString();
                while (ioPATH.checkID(pathid)) {
                  pathid = getRandString();
                }
                ioPATH.add(pathid, p2);
                inputFileList.value.push({
                  fullPath: p2,
                  id: pathid,
                  name: PathFormat.getFileName(p2),
                  percentage: 0,
                  status: "pending",
                  thumbnailUrl: null,
                  type: "image/png",
                  url: null
                });
              });
            }
          };
          window.electron.ipcRenderer.removeAllListeners("selectedItem");
          window.electron.ipcRenderer.send("open-directory-dialog", ["openFile", "multiSelections"]);
          window.electron.ipcRenderer.on("selectedItem", handleSelected);
        }
        onMounted(() => {
          const dragWrapper = document.getElementById("file_drag");
          dragWrapper?.addEventListener("drop", (e) => {
            e.preventDefault();
            const files = e.dataTransfer?.files;
            if (files && files.length > 0) {
              const path = files[0].path;
              console.log(path);
              pathFormat.setRootPath(path);
              console.log(pathFormat.getRootPath());
              ioPATH.setoutputpath(pathFormat.getRootPath());
            }
          });
          dragWrapper?.addEventListener("dragover", (e) => {
            e.preventDefault();
          });
        });
        function handleUploadChange(data) {
          inputFileList.value = data.fileList;
        }
        function handleBeforeUpload(options) {
          ioPATH.add(options.file.id, pathFormat.getNewPath(String(options.file.fullPath)));
          return options.file;
        }
        function handleRemove(options) {
          Final2xHomeNotifications.handleremove(ioPATH.getByID(options.file.id));
          ioPATH.delete(options.file.id);
          return true;
        }
        return (_ctx, _cache) => {
          const _component_n_icon = resolveComponent("n-icon");
          const _component_n_text = resolveComponent("n-text");
          const _component_n_upload_dragger = resolveComponent("n-upload-dragger");
          const _component_n_upload = resolveComponent("n-upload");
          return openBlock(), createElementBlock("div", {
            id: "file_drag",
            class: "for_file_drag",
            onClick: _cache[1] || (_cache[1] = withModifiers(() => {
            }, ["prevent"]))
          }, [
            createVNode(_component_n_upload, {
              "file-list": unref(inputFileList),
              "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => isRef(inputFileList) ? inputFileList.value = $event : null),
              multiple: "",
              "directory-dnd": "",
              class: "n-upload",
              onRemove: handleRemove,
              onBeforeUpload: handleBeforeUpload,
              onChange: handleUploadChange
            }, {
              default: withCtx(() => [
                createVNode(_component_n_upload_dragger, {
                  class: "file-drag-zone",
                  onClick: handleClickUpload
                }, {
                  default: withCtx(() => [
                    createBaseVNode("div", _hoisted_1$3, [
                      createBaseVNode("div", _hoisted_2$2, [
                        createVNode(_component_n_icon, {
                          size: "48",
                          depth: "3.0"
                        }, {
                          default: withCtx(() => [
                            createVNode(unref(FileImageOutlined))
                          ]),
                          _: 1
                        })
                      ]),
                      createVNode(_component_n_text, { style: { "font-size": "16px" } }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString$1(unref(t)("Final2xHome.text1")), 1)
                        ]),
                        _: 1
                      })
                    ])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["file-list"])
          ]);
        };
      }
    });
    const Final2xHome = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-feb915b2"]]);
    const modelOptions = [
      { label: "RealESRGAN_RealESRGAN_x4plus_4x", value: "RealESRGAN_RealESRGAN_x4plus_4x.pth" },
      { label: "RealESRGAN_RealESRGAN_x4plus_anime_6B_4x", value: "RealESRGAN_RealESRGAN_x4plus_anime_6B_4x.pth" },
      { label: "RealESRGAN_RealESRGAN_x2plus_2x", value: "RealESRGAN_RealESRGAN_x2plus_2x.pth" },
      { label: "RealESRGAN_realesr_animevideov3_4x", value: "RealESRGAN_realesr_animevideov3_4x.pth" },
      { label: "RealESRGAN_AnimeJaNai_HD_V3_Compact_2x", value: "RealESRGAN_AnimeJaNai_HD_V3_Compact_2x.pth" },
      { label: "RealESRGAN_AniScale_2_Compact_2x", value: "RealESRGAN_AniScale_2_Compact_2x.pth" },
      { label: "RealESRGAN_Ani4Kv2_Compact_2x", value: "RealESRGAN_Ani4Kv2_Compact_2x.pth" },
      { label: "RealESRGAN_APISR_RRDB_GAN_generator_2x", value: "RealESRGAN_APISR_RRDB_GAN_generator_2x.pth" },
      { label: "RealESRGAN_APISR_RRDB_GAN_generator_4x", value: "RealESRGAN_APISR_RRDB_GAN_generator_4x.pth" },
      { label: "RealCUGAN_Conservative_2x", value: "RealCUGAN_Conservative_2x.pth" },
      { label: "RealCUGAN_Denoise1x_2x", value: "RealCUGAN_Denoise1x_2x.pth" },
      { label: "RealCUGAN_Denoise2x_2x", value: "RealCUGAN_Denoise2x_2x.pth" },
      { label: "RealCUGAN_Denoise3x_2x", value: "RealCUGAN_Denoise3x_2x.pth" },
      { label: "RealCUGAN_No_Denoise_2x", value: "RealCUGAN_No_Denoise_2x.pth" },
      { label: "RealCUGAN_Conservative_3x", value: "RealCUGAN_Conservative_3x.pth" },
      { label: "RealCUGAN_Denoise3x_3x", value: "RealCUGAN_Denoise3x_3x.pth" },
      { label: "RealCUGAN_No_Denoise_3x", value: "RealCUGAN_No_Denoise_3x.pth" },
      { label: "RealCUGAN_Conservative_4x", value: "RealCUGAN_Conservative_4x.pth" },
      { label: "RealCUGAN_Denoise3x_4x", value: "RealCUGAN_Denoise3x_4x.pth" },
      { label: "RealCUGAN_No_Denoise_4x", value: "RealCUGAN_No_Denoise_4x.pth" },
      { label: "RealCUGAN_Pro_Conservative_2x", value: "RealCUGAN_Pro_Conservative_2x.pth" },
      { label: "RealCUGAN_Pro_Denoise3x_2x", value: "RealCUGAN_Pro_Denoise3x_2x.pth" },
      { label: "RealCUGAN_Pro_No_Denoise_2x", value: "RealCUGAN_Pro_No_Denoise_2x.pth" },
      { label: "RealCUGAN_Pro_Conservative_3x", value: "RealCUGAN_Pro_Conservative_3x.pth" },
      { label: "RealCUGAN_Pro_Denoise3x_3x", value: "RealCUGAN_Pro_Denoise3x_3x.pth" },
      { label: "RealCUGAN_Pro_No_Denoise_3x", value: "RealCUGAN_Pro_No_Denoise_3x.pth" },
      { label: "EDSR_Mx2_f64b16_DIV2K_official_2x", value: "EDSR_Mx2_f64b16_DIV2K_official_2x.pth" },
      { label: "EDSR_Mx3_f64b16_DIV2K_official_3x", value: "EDSR_Mx3_f64b16_DIV2K_official_3x.pth" },
      { label: "EDSR_Mx4_f64b16_DIV2K_official_4x", value: "EDSR_Mx4_f64b16_DIV2K_official_4x.pth" },
      { label: "SwinIR_classicalSR_DF2K_s64w8_SwinIR_M_2x", value: "SwinIR_classicalSR_DF2K_s64w8_SwinIR_M_2x.pth" },
      { label: "SwinIR_lightweightSR_DIV2K_s64w8_SwinIR_S_2x", value: "SwinIR_lightweightSR_DIV2K_s64w8_SwinIR_S_2x.pth" },
      { label: "SwinIR_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR_L_GAN_4x", value: "SwinIR_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR_L_GAN_4x.pth" },
      { label: "SwinIR_realSR_BSRGAN_DFO_s64w8_SwinIR_M_GAN_2x", value: "SwinIR_realSR_BSRGAN_DFO_s64w8_SwinIR_M_GAN_2x.pth" },
      { label: "SwinIR_realSR_BSRGAN_DFO_s64w8_SwinIR_M_GAN_4x", value: "SwinIR_realSR_BSRGAN_DFO_s64w8_SwinIR_M_GAN_4x.pth" },
      { label: "SwinIR_Bubble_AnimeScale_SwinIR_Small_v1_2x", value: "SwinIR_Bubble_AnimeScale_SwinIR_Small_v1_2x.pth" },
      { label: "SCUNet_color_50_1x", value: "SCUNet_color_50_1x.pth" },
      { label: "SCUNet_color_real_psnr_1x", value: "SCUNet_color_real_psnr_1x.pth" },
      { label: "SCUNet_color_real_gan_1x", value: "SCUNet_color_real_gan_1x.pth" },
      { label: "DAT_S_2x", value: "DAT_S_2x.pth" },
      { label: "DAT_S_3x", value: "DAT_S_3x.pth" },
      { label: "DAT_S_4x", value: "DAT_S_4x.pth" },
      { label: "DAT_2x", value: "DAT_2x.pth" },
      { label: "DAT_3x", value: "DAT_3x.pth" },
      { label: "DAT_4x", value: "DAT_4x.pth" },
      { label: "DAT_2_2x", value: "DAT_2_2x.pth" },
      { label: "DAT_2_3x", value: "DAT_2_3x.pth" },
      { label: "DAT_2_4x", value: "DAT_2_4x.pth" },
      { label: "DAT_light_2x", value: "DAT_light_2x.pth" },
      { label: "DAT_light_3x", value: "DAT_light_3x.pth" },
      { label: "DAT_light_4x", value: "DAT_light_4x.pth" },
      { label: "DAT_APISR_GAN_generator_4x", value: "DAT_APISR_GAN_generator_4x.pth" }
    ];
    const _sfc_main$5 = /* @__PURE__ */ defineComponent({
      __name: "Final2xSettings",
      setup(__props) {
        const { selectedTorchDevice, torchDeviceList, openOutputFolder } = storeToRefs(useGlobalSettingsStore());
        const { selectedSRModel, ghProxy, targetScale } = storeToRefs(useSRSettingsStore());
        const { outputpath } = storeToRefs(useIOPathStore());
        const { t } = useI18n();
        function getPath2() {
          const handleSelected = (e, path) => {
            if (path[0] != void 0) {
              ioPATH.setoutputpathManual(path[0]);
            }
          };
          window.electron.ipcRenderer.removeAllListeners("selectedItem");
          window.electron.ipcRenderer.send("open-directory-dialog", ["openDirectory"]);
          window.electron.ipcRenderer.on("selectedItem", handleSelected);
        }
        return (_ctx, _cache) => {
          const _component_n_button = resolveComponent("n-button");
          const _component_n_select = resolveComponent("n-select");
          const _component_n_space = resolveComponent("n-space");
          const _component_n_input_number = resolveComponent("n-input-number");
          const _component_n_input = resolveComponent("n-input");
          const _component_n_switch = resolveComponent("n-switch");
          const _component_n_card = resolveComponent("n-card");
          return openBlock(), createBlock(_component_n_card, {
            bordered: false,
            class: "settings-card"
          }, {
            default: withCtx(() => [
              createVNode(_component_n_space, {
                class: "vertical",
                vertical: "",
                justify: "center"
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_space, null, {
                    default: withCtx(() => [
                      createVNode(_component_n_button, {
                        dashed: "",
                        type: "success",
                        style: { "width": "80px" }
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString$1(unref(t)("Final2xSettings.text11")), 1)
                        ]),
                        _: 1
                      }),
                      createVNode(_component_n_select, {
                        value: unref(selectedSRModel),
                        "onUpdate:value": _cache[0] || (_cache[0] = ($event) => isRef(selectedSRModel) ? selectedSRModel.value = $event : null),
                        options: unref(modelOptions),
                        style: { "width": "465px" }
                      }, null, 8, ["value", "options"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_n_space, null, {
                    default: withCtx(() => [
                      createVNode(_component_n_button, {
                        dashed: "",
                        type: "success",
                        style: { "width": "80px" }
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString$1(unref(t)("Final2xSettings.text10")), 1)
                        ]),
                        _: 1
                      }),
                      createVNode(_component_n_select, {
                        value: unref(selectedTorchDevice),
                        "onUpdate:value": _cache[1] || (_cache[1] = ($event) => isRef(selectedTorchDevice) ? selectedTorchDevice.value = $event : null),
                        options: unref(torchDeviceList),
                        style: { "width": "150px" }
                      }, null, 8, ["value", "options"]),
                      createVNode(_component_n_button, {
                        dashed: "",
                        type: "success",
                        style: { "width": "120px" }
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString$1(unref(t)("Final2xSettings.text15")), 1)
                        ]),
                        _: 1
                      }),
                      createVNode(_component_n_input_number, {
                        value: unref(targetScale),
                        "onUpdate:value": _cache[2] || (_cache[2] = ($event) => isRef(targetScale) ? targetScale.value = $event : null),
                        max: 99999999,
                        min: 0,
                        step: 0.2,
                        placeholder: unref(t)("Final2xSettings.text16"),
                        style: { "width": "171px" }
                      }, null, 8, ["value", "placeholder"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_n_space, null, {
                    default: withCtx(() => [
                      createVNode(_component_n_button, {
                        dashed: "",
                        type: "success",
                        style: { "width": "80px" }
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString$1(unref(t)("Final2xSettings.text18")), 1)
                        ]),
                        _: 1
                      }),
                      createVNode(_component_n_input, {
                        value: unref(ghProxy),
                        "onUpdate:value": _cache[3] || (_cache[3] = ($event) => isRef(ghProxy) ? ghProxy.value = $event : null),
                        placeholder: "Github Proxy, Example: https://github.abskoop.workers.dev/",
                        style: { "width": "465px" }
                      }, null, 8, ["value"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_n_space, null, {
                    default: withCtx(() => [
                      createVNode(_component_n_button, {
                        round: "",
                        type: "success",
                        style: { "height": "35px", "width": "150px" },
                        onClick: getPath2
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString$1(unref(t)("Final2xSettings.text17")), 1)
                        ]),
                        _: 1
                      }),
                      createVNode(_component_n_switch, {
                        value: unref(openOutputFolder),
                        "onUpdate:value": _cache[4] || (_cache[4] = ($event) => isRef(openOutputFolder) ? openOutputFolder.value = $event : null),
                        size: "large",
                        style: { "height": "35px", "width": "76px" }
                      }, {
                        checked: withCtx(() => _cache[6] || (_cache[6] = [
                          createTextVNode(" OPEN ")
                        ])),
                        _: 1
                      }, 8, ["value"]),
                      createVNode(_component_n_input, {
                        value: unref(outputpath),
                        "onUpdate:value": _cache[5] || (_cache[5] = ($event) => isRef(outputpath) ? outputpath.value = $event : null),
                        placeholder: unref(outputpath),
                        round: "",
                        style: { "width": "308px" }
                      }, null, 8, ["value", "placeholder"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            _: 1
          });
        };
      }
    });
    const Final2xSettings = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-a71cb454"]]);
    const router = createRouter({
      history: createWebHashHistory(),
      routes: [
        {
          path: "/",
          redirect: "/Final2xHome"
        },
        {
          path: "/Final2xHome",
          name: "Final2xHome",
          component: Final2xHome
        },
        {
          path: "/Final2xSettings",
          name: "Final2xSettings",
          component: Final2xSettings
        }
      ]
    });
    const _hoisted_1$2 = { key: 0 };
    const _hoisted_2$1 = { key: 1 };
    const _hoisted_3 = { key: 0 };
    const _hoisted_4 = { key: 1 };
    const _hoisted_5 = { key: 2 };
    const _sfc_main$4 = /* @__PURE__ */ defineComponent({
      __name: "MySetting",
      setup(__props) {
        const { darkMode, changeRoute } = storeToRefs(useGlobalSettingsStore());
        function handleRoute() {
          if (changeRoute.value === false) {
            changeRoute.value = true;
            router.push("/Final2xSettings");
          } else {
            changeRoute.value = false;
            router.push("/");
          }
        }
        const handleDarkMode = clickDebounce(function changeDarkMode() {
          if (darkMode.value === "system") {
            darkMode.value = "light";
          } else if (darkMode.value === "light") {
            darkMode.value = "dark";
          } else {
            darkMode.value = "system";
          }
        });
        return (_ctx, _cache) => {
          const _component_n_icon = resolveComponent("n-icon");
          const _component_n_button = resolveComponent("n-button");
          const _component_n_space = resolveComponent("n-space");
          return openBlock(), createElementBlock("div", null, [
            createVNode(_component_n_space, { class: "main-buttons" }, {
              default: withCtx(() => [
                createVNode(_component_n_button, {
                  style: { "font-size": "36px" },
                  text: "",
                  onClick: handleRoute
                }, {
                  default: withCtx(() => [
                    createVNode(_component_n_icon, null, {
                      default: withCtx(() => [
                        unref(changeRoute) === false ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
                          createVNode(unref(SettingOutlined))
                        ])) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
                          createVNode(unref(HomeOutlined))
                        ]))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }),
                createVNode(_component_n_button, {
                  style: { "font-size": "36px" },
                  text: "",
                  onClick: unref(switchLanguage)
                }, {
                  default: withCtx(() => [
                    createVNode(_component_n_icon, null, {
                      default: withCtx(() => [
                        createVNode(unref(TranslationOutlined))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["onClick"]),
                createVNode(_component_n_button, {
                  style: { "font-size": "36px" },
                  text: "",
                  onClick: unref(handleDarkMode)
                }, {
                  default: withCtx(() => [
                    createVNode(_component_n_icon, null, {
                      default: withCtx(() => [
                        unref(darkMode) === "light" ? (openBlock(), createElementBlock("div", _hoisted_3, [
                          createVNode(unref(SunnyOutline))
                        ])) : unref(darkMode) === "dark" ? (openBlock(), createElementBlock("div", _hoisted_4, [
                          createVNode(unref(MoonOutline))
                        ])) : (openBlock(), createElementBlock("div", _hoisted_5, [
                          createVNode(unref(ContrastSharp))
                        ]))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["onClick"])
              ]),
              _: 1
            })
          ]);
        };
      }
    });
    const MySetting = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-5a562fa9"]]);
    const _hoisted_1$1 = { class: "position" };
    const _sfc_main$3 = /* @__PURE__ */ defineComponent({
      __name: "bottomNavigation",
      setup(__props) {
        return (_ctx, _cache) => {
          const _component_n_divider = resolveComponent("n-divider");
          const _component_n_space = resolveComponent("n-space");
          return openBlock(), createElementBlock("div", _hoisted_1$1, [
            createVNode(_component_n_divider, { class: "n-divider" }),
            createVNode(_component_n_space, {
              class: "n-space",
              justify: "space-between"
            }, {
              default: withCtx(() => [
                createVNode(MySetting),
                createVNode(MyExternalLink)
              ]),
              _: 1
            })
          ]);
        };
      }
    });
    const BottomNavigation = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-70b090e9"]]);
    const _sfc_main$2 = /* @__PURE__ */ defineComponent({
      __name: "NaiveDarkMode",
      props: {
        darkMode: {
          type: String,
          default: () => "system"
        },
        designDark: {
          type: String,
          default: () => "#000000"
        },
        designLight: {
          type: String,
          default: () => "#ffffff"
        },
        fadeLayer: {
          type: Number,
          default: () => 25
        },
        color: {
          type: String,
          default: () => "#ffffff"
        },
        naivetheme: {
          type: Object,
          default: () => void 0
        }
      },
      emits: ["update:color", "update:naivetheme"],
      setup(__props, { emit: __emit }) {
        const osThemeRef = useOsTheme();
        const DarkMode = ref(void 0);
        const globalcolor = ref("");
        const DarkTheme = ref(void 0);
        const DesignDarkColor = ref("#000000");
        const DesignLightColor = ref("#ffffff");
        const FadeLayer = ref(25);
        const props = __props;
        const emits = __emit;
        watch(
          () => globalcolor.value,
          (value) => {
            emits("update:color", value);
          }
        );
        watch(
          () => DarkTheme.value,
          (value) => {
            emits("update:naivetheme", value ? darkTheme : void 0);
          }
        );
        onBeforeMount(() => {
          DarkMode.value = props.darkMode;
          DesignDarkColor.value = props.designDark;
          DesignLightColor.value = props.designLight;
          globalcolor.value = props.designLight;
          FadeLayer.value = props.fadeLayer;
        });
        watch(
          () => props.darkMode,
          (value) => {
            DarkMode.value = value;
          }
        );
        watch(
          () => props.designDark,
          (value) => {
            if (globalcolor.value === DesignDarkColor.value) {
              globalcolor.value = value;
            }
            DesignDarkColor.value = value;
          }
        );
        watch(
          () => props.designLight,
          (value) => {
            if (globalcolor.value === DesignLightColor.value) {
              globalcolor.value = value;
            }
            DesignLightColor.value = value;
          }
        );
        watch(
          () => props.fadeLayer,
          (value) => {
            FadeLayer.value = value;
          }
        );
        function handleDarkModeChange(mode) {
          if (mode === "system" || mode === void 0) {
            DarkTheme.value = osThemeRef.value === "dark";
          } else {
            DarkTheme.value = mode === "dark";
          }
        }
        onMounted(() => {
          handleDarkModeChange(DarkMode.value);
        });
        watch(DarkMode, (value) => {
          handleDarkModeChange(value);
        });
        watch(osThemeRef, (value) => {
          if (DarkMode.value === "system" || DarkMode.value === void 0) {
            DarkTheme.value = value === "dark";
          }
        });
        watch(DarkTheme, (value) => {
          if (value) {
            if (isCSSLight()) {
              switchCSSStyle("dark");
            }
          } else {
            if (isCSSDark()) {
              switchCSSStyle("light");
            }
          }
        });
        function interpolateColor(color1, color2, factor) {
          if (factor === 0) return color1;
          if (factor === 1) return color2;
          const c1 = hexToRgb(color1);
          const c2 = hexToRgb(color2);
          const r = Math.round(interpolate(c1.r, c2.r, factor));
          const g = Math.round(interpolate(c1.g, c2.g, factor));
          const b = Math.round(interpolate(c1.b, c2.b, factor));
          return `rgb(${r}, ${g}, ${b})`;
        }
        function interpolate(start, end, factor) {
          return start + (end - start) * factor;
        }
        function hexToRgb(hex2) {
          const r = parseInt(hex2.slice(1, 3), 16);
          const g = parseInt(hex2.slice(3, 5), 16);
          const b = parseInt(hex2.slice(5, 7), 16);
          return { r, g, b };
        }
        function switchCSSStyle(mode) {
          if (mode === "system") {
            const osThemeRef2 = useOsTheme();
            mode = osThemeRef2.value === "dark" ? "dark" : "light";
          }
          const targetColor = mode === "dark" ? DesignDarkColor.value : DesignLightColor.value;
          const initialColor = mode === "dark" ? DesignLightColor.value : DesignDarkColor.value;
          const layer = Math.ceil(FadeLayer.value);
          if (layer < 1) {
            globalcolor.value = targetColor;
            return;
          }
          for (let i = 1; i <= layer; i++) {
            setTimeout(() => {
              nextTick(() => {
                globalcolor.value = interpolateColor(initialColor, targetColor, i / layer);
              });
            }, layer * i);
          }
        }
        function isCSSDark() {
          return globalcolor.value === DesignDarkColor.value;
        }
        function isCSSLight() {
          return globalcolor.value === DesignLightColor.value;
        }
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div");
        };
      }
    });
    const _sfc_main$1 = /* @__PURE__ */ defineComponent({
      __name: "MyDarkMode",
      setup(__props) {
        const { darkMode, globalcolor, naiveTheme } = storeToRefs(useGlobalSettingsStore());
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", null, [
            createVNode(_sfc_main$2, {
              color: unref(globalcolor),
              "onUpdate:color": _cache[0] || (_cache[0] = ($event) => isRef(globalcolor) ? globalcolor.value = $event : null),
              naivetheme: unref(naiveTheme),
              "onUpdate:naivetheme": _cache[1] || (_cache[1] = ($event) => isRef(naiveTheme) ? naiveTheme.value = $event : null),
              "dark-mode": unref(darkMode),
              "design-dark": "#101015",
              "design-light": "#fffafa",
              "fade-layer": 0,
              class: "naive-dark-mode"
            }, null, 8, ["color", "naivetheme", "dark-mode"])
          ]);
        };
      }
    });
    const _hoisted_1 = { class: "background" };
    const _hoisted_2 = { class: "view" };
    const _sfc_main = /* @__PURE__ */ defineComponent({
      __name: "App",
      setup(__props) {
        useCssVars((_ctx) => ({
          "57fc2328": unref(globalcolor)
        }));
        const { locale } = useI18n();
        const { langsNum, naiveTheme, globalcolor } = storeToRefs(useGlobalSettingsStore());
        watch(langsNum, () => {
          locale.value = getLanguage(langsNum.value).lang;
          console.log("locale: ", locale.value);
        });
        onMounted(async () => {
          if (langsNum.value !== 114514) {
            locale.value = getLanguage(langsNum.value).lang;
          }
        });
        const themeOverrides = {
          Select: {
            peers: {
              InternalSelectMenu: {
                height: "200px"
              }
            }
          }
        };
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(NConfigProvider), {
            theme: unref(naiveTheme),
            "theme-overrides": themeOverrides
          }, {
            default: withCtx(() => [
              createVNode(unref(NGlobalStyle)),
              createVNode(unref(NNotificationProvider), {
                class: "n-config-provider",
                placement: "top"
              }, {
                default: withCtx(() => [
                  createVNode(unref(NDialogProvider), null, {
                    default: withCtx(() => [
                      createBaseVNode("div", _hoisted_1, [
                        createVNode(_sfc_main$1),
                        createVNode(TrafficLightsButtons),
                        createVNode(_sfc_main$8),
                        createBaseVNode("div", _hoisted_2, [
                          createVNode(unref(RouterView), null, {
                            default: withCtx(({ Component }) => [
                              createVNode(Transition, {
                                mode: "out-in",
                                name: "custom-fade"
                              }, {
                                default: withCtx(() => [
                                  (openBlock(), createBlock(KeepAlive, null, [
                                    (openBlock(), createBlock(resolveDynamicComponent(Component)))
                                  ], 1024))
                                ]),
                                _: 2
                              }, 1024)
                            ]),
                            _: 1
                          })
                        ]),
                        createVNode(BottomNavigation)
                      ])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["theme"]);
        };
      }
    });
    const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-30730302"]]);
    function isObject(v) {
      return typeof v === "object" && v !== null;
    }
    function normalizeOptions(options, factoryOptions) {
      options = isObject(options) ? options : /* @__PURE__ */ Object.create(null);
      return new Proxy(options, {
        get(target, key, receiver) {
          if (key === "key")
            return Reflect.get(target, key, receiver);
          return Reflect.get(target, key, receiver) || Reflect.get(factoryOptions, key, receiver);
        }
      });
    }
    function get(state, path) {
      return path.reduce((obj, p2) => {
        return obj == null ? void 0 : obj[p2];
      }, state);
    }
    function set(state, path, val) {
      return path.slice(0, -1).reduce((obj, p2) => {
        if (/^(__proto__)$/.test(p2))
          return {};
        else return obj[p2] = obj[p2] || {};
      }, state)[path[path.length - 1]] = val, state;
    }
    function pick(baseState, paths) {
      return paths.reduce((substate, path) => {
        const pathArray = path.split(".");
        return set(substate, pathArray, get(baseState, pathArray));
      }, {});
    }
    function parsePersistence(factoryOptions, store) {
      return (o) => {
        var _a;
        try {
          const {
            storage = localStorage,
            beforeRestore = void 0,
            afterRestore = void 0,
            serializer = {
              serialize: JSON.stringify,
              deserialize: JSON.parse
            },
            key = store.$id,
            paths = null,
            debug = false
          } = o;
          return {
            storage,
            beforeRestore,
            afterRestore,
            serializer,
            key: ((_a = factoryOptions.key) != null ? _a : (k) => k)(typeof key == "string" ? key : key(store.$id)),
            paths,
            debug
          };
        } catch (e) {
          if (o.debug)
            console.error("[pinia-plugin-persistedstate]", e);
          return null;
        }
      };
    }
    function hydrateStore(store, { storage, serializer, key, debug }) {
      try {
        const fromStorage = storage == null ? void 0 : storage.getItem(key);
        if (fromStorage)
          store.$patch(serializer == null ? void 0 : serializer.deserialize(fromStorage));
      } catch (e) {
        if (debug)
          console.error("[pinia-plugin-persistedstate]", e);
      }
    }
    function persistState(state, { storage, serializer, key, paths, debug }) {
      try {
        const toStore = Array.isArray(paths) ? pick(state, paths) : state;
        storage.setItem(key, serializer.serialize(toStore));
      } catch (e) {
        if (debug)
          console.error("[pinia-plugin-persistedstate]", e);
      }
    }
    function createPersistedState(factoryOptions = {}) {
      return (context) => {
        const { auto = false } = factoryOptions;
        const {
          options: { persist = auto },
          store,
          pinia: pinia2
        } = context;
        if (!persist)
          return;
        if (!(store.$id in pinia2.state.value)) {
          const original_store = pinia2._s.get(store.$id.replace("__hot:", ""));
          if (original_store)
            Promise.resolve().then(() => original_store.$persist());
          return;
        }
        const persistences = (Array.isArray(persist) ? persist.map((p2) => normalizeOptions(p2, factoryOptions)) : [normalizeOptions(persist, factoryOptions)]).map(parsePersistence(factoryOptions, store)).filter(Boolean);
        store.$persist = () => {
          persistences.forEach((persistence) => {
            persistState(store.$state, persistence);
          });
        };
        store.$hydrate = ({ runHooks = true } = {}) => {
          persistences.forEach((persistence) => {
            const { beforeRestore, afterRestore } = persistence;
            if (runHooks)
              beforeRestore == null ? void 0 : beforeRestore(context);
            hydrateStore(store, persistence);
            if (runHooks)
              afterRestore == null ? void 0 : afterRestore(context);
          });
        };
        persistences.forEach((persistence) => {
          const { beforeRestore, afterRestore } = persistence;
          beforeRestore == null ? void 0 : beforeRestore(context);
          hydrateStore(store, persistence);
          afterRestore == null ? void 0 : afterRestore(context);
          store.$subscribe(
            (_mutation, state) => {
              persistState(state, persistence);
            },
            {
              detached: true
            }
          );
        });
      };
    }
    var src_default = createPersistedState();
    const naive = create({
      components: [
        Button,
        NDivider,
        NSpace,
        NIcon,
        NImage,
        NCard,
        NDrawer,
        NDrawerContent,
        NLog,
        NProgress,
        NText,
        NUpload,
        NUploadDragger,
        NInput,
        NInputNumber,
        NPopover,
        NSelect,
        NSwitch
      ]
    });
    const pinia = createPinia();
    pinia.use(src_default);
    createApp(App).use(naive).use(i18n).use(pinia).use(router).mount("#app");
  }
});
export default require_index_001();
