const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphView-HVeNbkaW.js","./index-jXPKy3pP.js","./index-5HFeZax4.js","./index-B-aVupP5.js","./keybindingService-Bx7YdkXn.js","./serverConfigStore-CvyKFVuP.js","./GraphView-CIRWBKTm.css","./UserSelectView-B3jYchWu.js","./BaseViewTemplate-BNGF4K22.js","./ServerStartView-CIDTUh4x.js","./ServerStartView-CnyN4Ib6.css","./InstallView-CAcYt0HL.js","./InstallView-CwQdoH-C.css","./WelcomeView-N0ZXLjdi.js","./WelcomeView-Brz3-luE.css","./NotSupportedView-Drz3x2d-.js","./NotSupportedView-bFzHmqNj.css","./DownloadGitView-DeC7MBzG.js","./ManualConfigurationView-Bi_qHE-n.js","./ManualConfigurationView-B6ecEClB.css","./KeybindingPanel-Dc3C4lG1.js","./index-B5F0uxTQ.js","./KeybindingPanel-DvrUYZ4S.css","./ExtensionPanel-D4Phn0Zr.js","./ServerConfigPanel-Be4StJmv.js","./index-Bordpmzt.js","./index-BRhY6FpL.css"])))=>i.map(i=>d[i]);
var __defProp2 = Object.defineProperty;
var __name = (target, value4) => __defProp2(target, "name", { value: value4, configurable: true });
(/* @__PURE__ */ __name(function polyfill() {
  const relList = document.createElement("link").relList;
  if (relList && relList.supports && relList.supports("modulepreload")) {
    return;
  }
  for (const link2 of document.querySelectorAll('link[rel="modulepreload"]')) {
    processPreload(link2);
  }
  new MutationObserver((mutations) => {
    for (const mutation of mutations) {
      if (mutation.type !== "childList") {
        continue;
      }
      for (const node3 of mutation.addedNodes) {
        if (node3.tagName === "LINK" && node3.rel === "modulepreload")
          processPreload(node3);
      }
    }
  }).observe(document, { childList: true, subtree: true });
  function getFetchOpts(link2) {
    const fetchOpts = {};
    if (link2.integrity) fetchOpts.integrity = link2.integrity;
    if (link2.referrerPolicy) fetchOpts.referrerPolicy = link2.referrerPolicy;
    if (link2.crossOrigin === "use-credentials")
      fetchOpts.credentials = "include";
    else if (link2.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
    else fetchOpts.credentials = "same-origin";
    return fetchOpts;
  }
  __name(getFetchOpts, "getFetchOpts");
  function processPreload(link2) {
    if (link2.ep)
      return;
    link2.ep = true;
    const fetchOpts = getFetchOpts(link2);
    fetch(link2.href, fetchOpts);
  }
  __name(processPreload, "processPreload");
}, "polyfill"))();
var __defProp$2 = Object.defineProperty;
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
var __defNormalProp$2 = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp$2");
var __spreadValues$1 = /* @__PURE__ */ __name((a, b) => {
  for (var prop2 in b || (b = {}))
    if (__hasOwnProp$1.call(b, prop2))
      __defNormalProp$2(a, prop2, b[prop2]);
  if (__getOwnPropSymbols$1)
    for (var prop2 of __getOwnPropSymbols$1(b)) {
      if (__propIsEnum$1.call(b, prop2))
        __defNormalProp$2(a, prop2, b[prop2]);
    }
  return a;
}, "__spreadValues$1");
function isEmpty$1(value4) {
  return value4 === null || value4 === void 0 || value4 === "" || Array.isArray(value4) && value4.length === 0 || !(value4 instanceof Date) && typeof value4 === "object" && Object.keys(value4).length === 0;
}
__name(isEmpty$1, "isEmpty$1");
function compare$1(value1, value22, comparator2, order = 1) {
  let result = -1;
  const emptyValue1 = isEmpty$1(value1);
  const emptyValue2 = isEmpty$1(value22);
  if (emptyValue1 && emptyValue2) result = 0;
  else if (emptyValue1) result = order;
  else if (emptyValue2) result = -order;
  else if (typeof value1 === "string" && typeof value22 === "string") result = comparator2(value1, value22);
  else result = value1 < value22 ? -1 : value1 > value22 ? 1 : 0;
  return result;
}
__name(compare$1, "compare$1");
function deepEquals(obj1, obj2) {
  if (obj1 === obj2) return true;
  if (obj1 && obj2 && typeof obj1 == "object" && typeof obj2 == "object") {
    var arrObj1 = Array.isArray(obj1), arrObj2 = Array.isArray(obj2), i2, length, key;
    if (arrObj1 && arrObj2) {
      length = obj1.length;
      if (length != obj2.length) return false;
      for (i2 = length; i2-- !== 0; ) if (!deepEquals(obj1[i2], obj2[i2])) return false;
      return true;
    }
    if (arrObj1 != arrObj2) return false;
    var dateObj1 = obj1 instanceof Date, dateObj2 = obj2 instanceof Date;
    if (dateObj1 != dateObj2) return false;
    if (dateObj1 && dateObj2) return obj1.getTime() == obj2.getTime();
    var regexpObj1 = obj1 instanceof RegExp, regexpObj2 = obj2 instanceof RegExp;
    if (regexpObj1 != regexpObj2) return false;
    if (regexpObj1 && regexpObj2) return obj1.toString() == obj2.toString();
    var keys2 = Object.keys(obj1);
    length = keys2.length;
    if (length !== Object.keys(obj2).length) return false;
    for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(obj2, keys2[i2])) return false;
    for (i2 = length; i2-- !== 0; ) {
      key = keys2[i2];
      if (!deepEquals(obj1[key], obj2[key])) return false;
    }
    return true;
  }
  return obj1 !== obj1 && obj2 !== obj2;
}
__name(deepEquals, "deepEquals");
function isFunction$5(value4) {
  return !!(value4 && value4.constructor && value4.call && value4.apply);
}
__name(isFunction$5, "isFunction$5");
function isNotEmpty(value4) {
  return !isEmpty$1(value4);
}
__name(isNotEmpty, "isNotEmpty");
function resolveFieldData(data24, field) {
  if (!data24 || !field) {
    return null;
  }
  try {
    const value4 = data24[field];
    if (isNotEmpty(value4)) return value4;
  } catch (e2) {
  }
  if (Object.keys(data24).length) {
    if (isFunction$5(field)) {
      return field(data24);
    } else if (field.indexOf(".") === -1) {
      return data24[field];
    } else {
      let fields = field.split(".");
      let value4 = data24;
      for (let i2 = 0, len = fields.length; i2 < len; ++i2) {
        if (value4 == null) {
          return null;
        }
        value4 = value4[fields[i2]];
      }
      return value4;
    }
  }
  return null;
}
__name(resolveFieldData, "resolveFieldData");
function equals(obj1, obj2, field) {
  if (field) return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
  else return deepEquals(obj1, obj2);
}
__name(equals, "equals");
function contains(value4, list2) {
  if (value4 != null && list2 && list2.length) {
    for (let val of list2) {
      if (equals(value4, val)) return true;
    }
  }
  return false;
}
__name(contains, "contains");
function filter(value4, fields, filterValue) {
  let filteredItems = [];
  if (value4) {
    for (let item3 of value4) {
      for (let field of fields) {
        if (String(resolveFieldData(item3, field)).toLowerCase().indexOf(filterValue.toLowerCase()) > -1) {
          filteredItems.push(item3);
          break;
        }
      }
    }
  }
  return filteredItems;
}
__name(filter, "filter");
function findIndexInList(value4, list2) {
  let index2 = -1;
  if (list2) {
    for (let i2 = 0; i2 < list2.length; i2++) {
      if (list2[i2] === value4) {
        index2 = i2;
        break;
      }
    }
  }
  return index2;
}
__name(findIndexInList, "findIndexInList");
function findLast$1(arr, callback) {
  let item3;
  if (isNotEmpty(arr)) {
    try {
      item3 = arr.findLast(callback);
    } catch (e2) {
      item3 = [...arr].reverse().find(callback);
    }
  }
  return item3;
}
__name(findLast$1, "findLast$1");
function findLastIndex(arr, callback) {
  let index2 = -1;
  if (isNotEmpty(arr)) {
    try {
      index2 = arr.findLastIndex(callback);
    } catch (e2) {
      index2 = arr.lastIndexOf([...arr].reverse().find(callback));
    }
  }
  return index2;
}
__name(findLastIndex, "findLastIndex");
function isObject$7(value4, empty3 = true) {
  return value4 instanceof Object && value4.constructor === Object && (empty3 || Object.keys(value4).length !== 0);
}
__name(isObject$7, "isObject$7");
function resolve$1(obj, ...params) {
  return isFunction$5(obj) ? obj(...params) : obj;
}
__name(resolve$1, "resolve$1");
function isString$8(value4, empty3 = true) {
  return typeof value4 === "string" && (empty3 || value4 !== "");
}
__name(isString$8, "isString$8");
function toFlatCase(str) {
  return isString$8(str) ? str.replace(/(-|_)/g, "").toLowerCase() : str;
}
__name(toFlatCase, "toFlatCase");
function getKeyValue(obj, key = "", params = {}) {
  const fKeys = toFlatCase(key).split(".");
  const fKey = fKeys.shift();
  return fKey ? isObject$7(obj) ? getKeyValue(resolve$1(obj[Object.keys(obj).find((k) => toFlatCase(k) === fKey) || ""], params), fKeys.join("."), params) : void 0 : resolve$1(obj, params);
}
__name(getKeyValue, "getKeyValue");
function insertIntoOrderedArray(item3, index2, arr, sourceArr) {
  if (arr.length > 0) {
    let injected = false;
    for (let i2 = 0; i2 < arr.length; i2++) {
      let currentItemIndex = findIndexInList(arr[i2], sourceArr);
      if (currentItemIndex > index2) {
        arr.splice(i2, 0, item3);
        injected = true;
        break;
      }
    }
    if (!injected) {
      arr.push(item3);
    }
  } else {
    arr.push(item3);
  }
}
__name(insertIntoOrderedArray, "insertIntoOrderedArray");
function isArray$5(value4, empty3 = true) {
  return Array.isArray(value4) && (empty3 || value4.length !== 0);
}
__name(isArray$5, "isArray$5");
function isDate$3(value4) {
  return value4 instanceof Date && value4.constructor === Date;
}
__name(isDate$3, "isDate$3");
function isNumber$5(value4) {
  return isNotEmpty(value4) && !isNaN(value4);
}
__name(isNumber$5, "isNumber$5");
function isPrintableCharacter(char = "") {
  return isNotEmpty(char) && char.length === 1 && !!char.match(/\S| /);
}
__name(isPrintableCharacter, "isPrintableCharacter");
function localeComparator() {
  return new Intl.Collator(void 0, { numeric: true }).compare;
}
__name(localeComparator, "localeComparator");
function matchRegex(str, regex2) {
  if (regex2) {
    const match2 = regex2.test(str);
    regex2.lastIndex = 0;
    return match2;
  }
  return false;
}
__name(matchRegex, "matchRegex");
function mergeKeys(...args) {
  const _mergeKeys = /* @__PURE__ */ __name((target = {}, source = {}) => {
    const mergedObj = __spreadValues$1({}, target);
    Object.keys(source).forEach((key) => {
      if (isObject$7(source[key]) && key in target && isObject$7(target[key])) {
        mergedObj[key] = _mergeKeys(target[key], source[key]);
      } else {
        mergedObj[key] = source[key];
      }
    });
    return mergedObj;
  }, "_mergeKeys");
  return args.reduce((acc, obj, i2) => i2 === 0 ? obj : _mergeKeys(acc, obj), {});
}
__name(mergeKeys, "mergeKeys");
function minifyCSS(css3) {
  return css3 ? css3.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/ ([{:}]) /g, "$1").replace(/([;,]) /g, "$1").replace(/ !/g, "!").replace(/: /g, ":") : css3;
}
__name(minifyCSS, "minifyCSS");
function nestedKeys(obj = {}, parentKey = "") {
  return Object.entries(obj).reduce((o, [key, value4]) => {
    const currentKey = parentKey ? `${parentKey}.${key}` : key;
    isObject$7(value4) ? o = o.concat(nestedKeys(value4, currentKey)) : o.push(currentKey);
    return o;
  }, []);
}
__name(nestedKeys, "nestedKeys");
function removeAccents(str) {
  if (str && str.search(/[\xC0-\xFF]/g) > -1) {
    str = str.replace(/[\xC0-\xC5]/g, "A").replace(/[\xC6]/g, "AE").replace(/[\xC7]/g, "C").replace(/[\xC8-\xCB]/g, "E").replace(/[\xCC-\xCF]/g, "I").replace(/[\xD0]/g, "D").replace(/[\xD1]/g, "N").replace(/[\xD2-\xD6\xD8]/g, "O").replace(/[\xD9-\xDC]/g, "U").replace(/[\xDD]/g, "Y").replace(/[\xDE]/g, "P").replace(/[\xE0-\xE5]/g, "a").replace(/[\xE6]/g, "ae").replace(/[\xE7]/g, "c").replace(/[\xE8-\xEB]/g, "e").replace(/[\xEC-\xEF]/g, "i").replace(/[\xF1]/g, "n").replace(/[\xF2-\xF6\xF8]/g, "o").replace(/[\xF9-\xFC]/g, "u").replace(/[\xFE]/g, "p").replace(/[\xFD\xFF]/g, "y");
  }
  return str;
}
__name(removeAccents, "removeAccents");
function reorderArray(value4, from2, to) {
  if (value4 && from2 !== to) {
    if (to >= value4.length) {
      to %= value4.length;
      from2 %= value4.length;
    }
    value4.splice(to, 0, value4.splice(from2, 1)[0]);
  }
}
__name(reorderArray, "reorderArray");
function sort(value1, value22, order = 1, comparator2, nullSortOrder = 1) {
  const result = compare$1(value1, value22, comparator2, order);
  let finalSortOrder = order;
  if (isEmpty$1(value1) || isEmpty$1(value22)) {
    finalSortOrder = nullSortOrder === 1 ? order : nullSortOrder;
  }
  return finalSortOrder * result;
}
__name(sort, "sort");
function stringify(value4, indent = 2, currentIndent = 0) {
  const currentIndentStr = " ".repeat(currentIndent);
  const nextIndentStr = " ".repeat(currentIndent + indent);
  if (isArray$5(value4)) {
    return "[" + value4.map((v2) => stringify(v2, indent, currentIndent + indent)).join(", ") + "]";
  } else if (isDate$3(value4)) {
    return value4.toISOString();
  } else if (isFunction$5(value4)) {
    return value4.toString();
  } else if (isObject$7(value4)) {
    return "{\n" + Object.entries(value4).map(([k, v2]) => `${nextIndentStr}${k}: ${stringify(v2, indent, currentIndent + indent)}`).join(",\n") + `
${currentIndentStr}}`;
  } else {
    return JSON.stringify(value4);
  }
}
__name(stringify, "stringify");
function toCapitalCase(str) {
  return isString$8(str, false) ? str[0].toUpperCase() + str.slice(1) : str;
}
__name(toCapitalCase, "toCapitalCase");
function toKebabCase(str) {
  return isString$8(str) ? str.replace(/(_)/g, "-").replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "-" + c.toLowerCase()).toLowerCase() : str;
}
__name(toKebabCase, "toKebabCase");
function toTokenKey$1(str) {
  return isString$8(str) ? str.replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "." + c.toLowerCase()).toLowerCase() : str;
}
__name(toTokenKey$1, "toTokenKey$1");
function EventBus() {
  const allHandlers = /* @__PURE__ */ new Map();
  return {
    on(type, handler6) {
      let handlers2 = allHandlers.get(type);
      if (!handlers2) handlers2 = [handler6];
      else handlers2.push(handler6);
      allHandlers.set(type, handlers2);
      return this;
    },
    off(type, handler6) {
      let handlers2 = allHandlers.get(type);
      if (handlers2) {
        handlers2.splice(handlers2.indexOf(handler6) >>> 0, 1);
      }
      return this;
    },
    emit(type, evt) {
      let handlers2 = allHandlers.get(type);
      if (handlers2) {
        handlers2.slice().map((handler6) => {
          handler6(evt);
        });
      }
    },
    clear() {
      allHandlers.clear();
    }
  };
}
__name(EventBus, "EventBus");
var __defProp$1 = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp$1 = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp$1");
var __spreadValues = /* @__PURE__ */ __name((a, b) => {
  for (var prop2 in b || (b = {}))
    if (__hasOwnProp.call(b, prop2))
      __defNormalProp$1(a, prop2, b[prop2]);
  if (__getOwnPropSymbols)
    for (var prop2 of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop2))
        __defNormalProp$1(a, prop2, b[prop2]);
    }
  return a;
}, "__spreadValues");
var __spreadProps = /* @__PURE__ */ __name((a, b) => __defProps(a, __getOwnPropDescs(b)), "__spreadProps");
var __objRest = /* @__PURE__ */ __name((source, exclude) => {
  var target = {};
  for (var prop2 in source)
    if (__hasOwnProp.call(source, prop2) && exclude.indexOf(prop2) < 0)
      target[prop2] = source[prop2];
  if (source != null && __getOwnPropSymbols)
    for (var prop2 of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop2) < 0 && __propIsEnum.call(source, prop2))
        target[prop2] = source[prop2];
    }
  return target;
}, "__objRest");
function definePreset(...presets) {
  return mergeKeys(...presets);
}
__name(definePreset, "definePreset");
var ThemeService = EventBus();
var service_default = ThemeService;
function toTokenKey(str) {
  return isString$8(str) ? str.replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "." + c.toLowerCase()).toLowerCase() : str;
}
__name(toTokenKey, "toTokenKey");
function merge$1(value1, value22) {
  if (isArray$5(value1)) {
    value1.push(...value22 || []);
  } else if (isObject$7(value1)) {
    Object.assign(value1, value22);
  }
}
__name(merge$1, "merge$1");
function toValue$2(value4) {
  return isObject$7(value4) && value4.hasOwnProperty("value") && value4.hasOwnProperty("type") ? value4.value : value4;
}
__name(toValue$2, "toValue$2");
function toUnit(value4, variable = "") {
  const excludedProperties = ["opacity", "z-index", "line-height", "font-weight", "flex", "flex-grow", "flex-shrink", "order"];
  if (!excludedProperties.some((property) => variable.endsWith(property))) {
    const val = `${value4}`.trim();
    const valArr = val.split(" ");
    return valArr.map((v2) => isNumber$5(v2) ? `${v2}px` : v2).join(" ");
  }
  return value4;
}
__name(toUnit, "toUnit");
function toNormalizePrefix(prefix2) {
  return prefix2.replaceAll(/ /g, "").replace(/[^\w]/g, "-");
}
__name(toNormalizePrefix, "toNormalizePrefix");
function toNormalizeVariable(prefix2 = "", variable = "") {
  return toNormalizePrefix(`${isString$8(prefix2, false) && isString$8(variable, false) ? `${prefix2}-` : prefix2}${variable}`);
}
__name(toNormalizeVariable, "toNormalizeVariable");
function getVariableName(prefix2 = "", variable = "") {
  return `--${toNormalizeVariable(prefix2, variable)}`;
}
__name(getVariableName, "getVariableName");
function getVariableValue(value4, variable = "", prefix2 = "", excludedKeyRegexes = [], fallback) {
  if (isString$8(value4)) {
    const regex2 = /{([^}]*)}/g;
    const val = value4.trim();
    if (matchRegex(val, regex2)) {
      const _val = val.replaceAll(regex2, (v2) => {
        const path = v2.replace(/{|}/g, "");
        const keys2 = path.split(".").filter((_v) => !excludedKeyRegexes.some((_r) => matchRegex(_v, _r)));
        return `var(${getVariableName(prefix2, toKebabCase(keys2.join("-")))}${isNotEmpty(fallback) ? `, ${fallback}` : ""})`;
      });
      const calculationRegex = /(\d+\s+[\+\-\*\/]\s+\d+)/g;
      const cleanedVarRegex = /var\([^)]+\)/g;
      return matchRegex(_val.replace(cleanedVarRegex, "0"), calculationRegex) ? `calc(${_val})` : _val;
    }
    return toUnit(val, variable);
  } else if (isNumber$5(value4)) {
    return toUnit(value4, variable);
  }
  return void 0;
}
__name(getVariableValue, "getVariableValue");
function getComputedValue(obj = {}, value4) {
  if (isString$8(value4)) {
    const regex2 = /{([^}]*)}/g;
    const val = value4.trim();
    return matchRegex(val, regex2) ? val.replaceAll(regex2, (v2) => getKeyValue(obj, v2.replace(/{|}/g, ""))) : val;
  } else if (isNumber$5(value4)) {
    return value4;
  }
  return void 0;
}
__name(getComputedValue, "getComputedValue");
function setProperty(properties, key, value4) {
  if (isString$8(key, false)) {
    properties.push(`${key}:${value4};`);
  }
}
__name(setProperty, "setProperty");
function getRule(selector, properties) {
  if (selector) {
    return `${selector}{${properties}}`;
  }
  return "";
}
__name(getRule, "getRule");
function normalizeColor(color2) {
  if (color2.length === 4) {
    return `#${color2[1]}${color2[1]}${color2[2]}${color2[2]}${color2[3]}${color2[3]}`;
  }
  return color2;
}
__name(normalizeColor, "normalizeColor");
function hexToRgb$1(hex) {
  var bigint = parseInt(hex.substring(1), 16);
  var r = bigint >> 16 & 255;
  var g2 = bigint >> 8 & 255;
  var b = bigint & 255;
  return { r, g: g2, b };
}
__name(hexToRgb$1, "hexToRgb$1");
function rgbToHex(r, g2, b) {
  return `#${r.toString(16).padStart(2, "0")}${g2.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`;
}
__name(rgbToHex, "rgbToHex");
var mix_default = /* @__PURE__ */ __name((color1, color2, weight) => {
  color1 = normalizeColor(color1);
  color2 = normalizeColor(color2);
  var p2 = weight / 100;
  var w = p2 * 2 - 1;
  var w1 = (w + 1) / 2;
  var w2 = 1 - w1;
  var rgb1 = hexToRgb$1(color1);
  var rgb2 = hexToRgb$1(color2);
  var r = Math.round(rgb1.r * w1 + rgb2.r * w2);
  var g2 = Math.round(rgb1.g * w1 + rgb2.g * w2);
  var b = Math.round(rgb1.b * w1 + rgb2.b * w2);
  return rgbToHex(r, g2, b);
}, "mix_default");
var shade_default = /* @__PURE__ */ __name((color2, percent) => mix_default("#000000", color2, percent), "shade_default");
var tint_default = /* @__PURE__ */ __name((color2, percent) => mix_default("#ffffff", color2, percent), "tint_default");
var scales = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
var palette_default = /* @__PURE__ */ __name((color2) => {
  if (/{([^}]*)}/g.test(color2)) {
    const token = color2.replace(/{|}/g, "");
    return scales.reduce((acc, scale) => (acc[scale] = `{${token}.${scale}}`, acc), {});
  }
  return typeof color2 === "string" ? scales.reduce((acc, scale, i2) => (acc[scale] = i2 <= 5 ? tint_default(color2, (5 - i2) * 19) : shade_default(color2, (i2 - 5) * 15), acc), {}) : color2;
}, "palette_default");
var $dt = /* @__PURE__ */ __name((tokenPath) => {
  var _a2;
  const theme40 = config_default.getTheme();
  const variable = dtwt(theme40, tokenPath, void 0, "variable");
  const name2 = (_a2 = variable.match(/--[\w-]+/g)) == null ? void 0 : _a2[0];
  const value4 = dtwt(theme40, tokenPath, void 0, "value");
  return {
    name: name2,
    variable,
    value: value4
  };
}, "$dt");
var dt = /* @__PURE__ */ __name((...args) => {
  return dtwt(config_default.getTheme(), ...args);
}, "dt");
var dtwt = /* @__PURE__ */ __name((theme40 = {}, tokenPath, fallback, type = "variable") => {
  if (tokenPath) {
    const { variable: VARIABLE, options: OPTIONS } = config_default.defaults || {};
    const { prefix: prefix2, transform: transform2 } = (theme40 == null ? void 0 : theme40.options) || OPTIONS || {};
    const regex2 = /{([^}]*)}/g;
    const token = matchRegex(tokenPath, regex2) ? tokenPath : `{${tokenPath}}`;
    const isStrictTransform = type === "value" || transform2 === "strict";
    return isStrictTransform ? config_default.getTokenValue(tokenPath) : getVariableValue(token, void 0, prefix2, [VARIABLE.excludedKeyRegex], fallback);
  }
  return "";
}, "dtwt");
function css$2(style2) {
  return resolve$1(style2, { dt });
}
__name(css$2, "css$2");
var $t = /* @__PURE__ */ __name((theme40 = {}) => {
  let { preset: _preset, options: _options } = theme40;
  return {
    preset(value4) {
      _preset = _preset ? mergeKeys(_preset, value4) : value4;
      return this;
    },
    options(value4) {
      _options = _options ? __spreadValues(__spreadValues({}, _options), value4) : value4;
      return this;
    },
    // features
    primaryPalette(primary) {
      const { semantic } = _preset || {};
      _preset = __spreadProps(__spreadValues({}, _preset), { semantic: __spreadProps(__spreadValues({}, semantic), { primary }) });
      return this;
    },
    surfacePalette(surface) {
      var _a2, _b;
      const { semantic } = _preset || {};
      const lightSurface = (surface == null ? void 0 : surface.hasOwnProperty("light")) ? surface == null ? void 0 : surface.light : surface;
      const darkSurface = (surface == null ? void 0 : surface.hasOwnProperty("dark")) ? surface == null ? void 0 : surface.dark : surface;
      const newColorScheme = {
        colorScheme: {
          light: __spreadValues(__spreadValues({}, (_a2 = semantic == null ? void 0 : semantic.colorScheme) == null ? void 0 : _a2.light), !!lightSurface && { surface: lightSurface }),
          dark: __spreadValues(__spreadValues({}, (_b = semantic == null ? void 0 : semantic.colorScheme) == null ? void 0 : _b.dark), !!darkSurface && { surface: darkSurface })
        }
      };
      _preset = __spreadProps(__spreadValues({}, _preset), { semantic: __spreadValues(__spreadValues({}, semantic), newColorScheme) });
      return this;
    },
    // actions
    define({ useDefaultPreset = false, useDefaultOptions = false } = {}) {
      return {
        preset: useDefaultPreset ? config_default.getPreset() : _preset,
        options: useDefaultOptions ? config_default.getOptions() : _options
      };
    },
    update({ mergePresets = true, mergeOptions: mergeOptions2 = true } = {}) {
      const newTheme = {
        preset: mergePresets ? mergeKeys(config_default.getPreset(), _preset) : _preset,
        options: mergeOptions2 ? __spreadValues(__spreadValues({}, config_default.getOptions()), _options) : _options
      };
      config_default.setTheme(newTheme);
      return newTheme;
    },
    use(options4) {
      const newTheme = this.define(options4);
      config_default.setTheme(newTheme);
      return newTheme;
    }
  };
}, "$t");
function toVariables_default(theme40, options4 = {}) {
  const VARIABLE = config_default.defaults.variable;
  const { prefix: prefix2 = VARIABLE.prefix, selector = VARIABLE.selector, excludedKeyRegex = VARIABLE.excludedKeyRegex } = options4;
  const _toVariables = /* @__PURE__ */ __name((_theme, _prefix = "") => {
    return Object.entries(_theme).reduce(
      (acc, [key, value4]) => {
        const px = matchRegex(key, excludedKeyRegex) ? toNormalizeVariable(_prefix) : toNormalizeVariable(_prefix, toKebabCase(key));
        const v2 = toValue$2(value4);
        if (isObject$7(v2)) {
          const { variables: variables2, tokens: tokens2 } = _toVariables(v2, px);
          merge$1(acc["tokens"], tokens2);
          merge$1(acc["variables"], variables2);
        } else {
          acc["tokens"].push((prefix2 ? px.replace(`${prefix2}-`, "") : px).replaceAll("-", "."));
          setProperty(acc["variables"], getVariableName(px), getVariableValue(v2, px, prefix2, [excludedKeyRegex]));
        }
        return acc;
      },
      { variables: [], tokens: [] }
    );
  }, "_toVariables");
  const { variables, tokens } = _toVariables(theme40, prefix2);
  return {
    value: variables,
    tokens,
    declarations: variables.join(""),
    css: getRule(selector, variables.join(""))
  };
}
__name(toVariables_default, "toVariables_default");
var themeUtils_default = {
  regex: {
    rules: {
      class: {
        pattern: /^\.([a-zA-Z][\w-]*)$/,
        resolve(value4) {
          return { type: "class", selector: value4, matched: this.pattern.test(value4.trim()) };
        }
      },
      attr: {
        pattern: /^\[(.*)\]$/,
        resolve(value4) {
          return { type: "attr", selector: `:root${value4}`, matched: this.pattern.test(value4.trim()) };
        }
      },
      media: {
        pattern: /^@media (.*)$/,
        resolve(value4) {
          return { type: "media", selector: `${value4}{:root{[CSS]}}`, matched: this.pattern.test(value4.trim()) };
        }
      },
      system: {
        pattern: /^system$/,
        resolve(value4) {
          return { type: "system", selector: "@media (prefers-color-scheme: dark){:root{[CSS]}}", matched: this.pattern.test(value4.trim()) };
        }
      },
      custom: {
        resolve(value4) {
          return { type: "custom", selector: value4, matched: true };
        }
      }
    },
    resolve(value4) {
      const rules = Object.keys(this.rules).filter((k) => k !== "custom").map((r) => this.rules[r]);
      return [value4].flat().map((v2) => {
        var _a2;
        return (_a2 = rules.map((r) => r.resolve(v2)).find((rr) => rr.matched)) != null ? _a2 : this.rules.custom.resolve(v2);
      });
    }
  },
  _toVariables(theme40, options4) {
    return toVariables_default(theme40, { prefix: options4 == null ? void 0 : options4.prefix });
  },
  getCommon({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) {
    var _c, _d, _e, _f;
    const { preset, options: options4 } = theme40;
    let primitive_css, primitive_tokens, semantic_css, semantic_tokens;
    if (isNotEmpty(preset)) {
      const { primitive, semantic } = preset;
      const _a2 = semantic || {}, { colorScheme } = _a2, sRest = __objRest(_a2, ["colorScheme"]);
      const _b = colorScheme || {}, { dark: dark2 } = _b, csRest = __objRest(_b, ["dark"]);
      const prim_var = isNotEmpty(primitive) ? this._toVariables({ primitive }, options4) : {};
      const sRest_var = isNotEmpty(sRest) ? this._toVariables({ semantic: sRest }, options4) : {};
      const csRest_var = isNotEmpty(csRest) ? this._toVariables({ light: csRest }, options4) : {};
      const dark_var = isNotEmpty(dark2) ? this._toVariables({ dark: dark2 }, options4) : {};
      const [prim_css, prim_tokens] = [(_c = prim_var.declarations) != null ? _c : "", prim_var.tokens];
      const [sRest_css, sRest_tokens] = [(_d = sRest_var.declarations) != null ? _d : "", sRest_var.tokens || []];
      const [csRest_css, csRest_tokens] = [(_e = csRest_var.declarations) != null ? _e : "", csRest_var.tokens || []];
      const [dark_css, dark_tokens] = [(_f = dark_var.declarations) != null ? _f : "", dark_var.tokens || []];
      primitive_css = this.transformCSS(name2, prim_css, "light", "variable", options4, set3, defaults2);
      primitive_tokens = prim_tokens;
      const semantic_light_css = this.transformCSS(name2, `${sRest_css}${csRest_css}color-scheme:light`, "light", "variable", options4, set3, defaults2);
      const semantic_dark_css = this.transformCSS(name2, `${dark_css}color-scheme:dark`, "dark", "variable", options4, set3, defaults2);
      semantic_css = `${semantic_light_css}${semantic_dark_css}`;
      semantic_tokens = [.../* @__PURE__ */ new Set([...sRest_tokens, ...csRest_tokens, ...dark_tokens])];
    }
    return {
      primitive: {
        css: primitive_css,
        tokens: primitive_tokens
      },
      semantic: {
        css: semantic_css,
        tokens: semantic_tokens
      }
    };
  },
  getPreset({ name: name2 = "", preset = {}, options: options4, params, set: set3, defaults: defaults2, selector }) {
    var _c, _d, _e;
    const _name = name2.replace("-directive", "");
    const _a2 = preset, { colorScheme } = _a2, vRest = __objRest(_a2, ["colorScheme"]);
    const _b = colorScheme || {}, { dark: dark2 } = _b, csRest = __objRest(_b, ["dark"]);
    const vRest_var = isNotEmpty(vRest) ? this._toVariables({ [_name]: vRest }, options4) : {};
    const csRest_var = isNotEmpty(csRest) ? this._toVariables({ [_name]: csRest }, options4) : {};
    const dark_var = isNotEmpty(dark2) ? this._toVariables({ [_name]: dark2 }, options4) : {};
    const [vRest_css, vRest_tokens] = [(_c = vRest_var.declarations) != null ? _c : "", vRest_var.tokens || []];
    const [csRest_css, csRest_tokens] = [(_d = csRest_var.declarations) != null ? _d : "", csRest_var.tokens || []];
    const [dark_css, dark_tokens] = [(_e = dark_var.declarations) != null ? _e : "", dark_var.tokens || []];
    const tokens = [.../* @__PURE__ */ new Set([...vRest_tokens, ...csRest_tokens, ...dark_tokens])];
    const light_variable_css = this.transformCSS(_name, `${vRest_css}${csRest_css}`, "light", "variable", options4, set3, defaults2, selector);
    const dark_variable_css = this.transformCSS(_name, dark_css, "dark", "variable", options4, set3, defaults2, selector);
    return {
      css: `${light_variable_css}${dark_variable_css}`,
      tokens
    };
  },
  getPresetC({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) {
    var _a2;
    const { preset, options: options4 } = theme40;
    const cPreset = (_a2 = preset == null ? void 0 : preset.components) == null ? void 0 : _a2[name2];
    return this.getPreset({ name: name2, preset: cPreset, options: options4, params, set: set3, defaults: defaults2 });
  },
  getPresetD({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) {
    var _a2;
    const dName = name2.replace("-directive", "");
    const { preset, options: options4 } = theme40;
    const dPreset = (_a2 = preset == null ? void 0 : preset.directives) == null ? void 0 : _a2[dName];
    return this.getPreset({ name: dName, preset: dPreset, options: options4, params, set: set3, defaults: defaults2 });
  },
  getColorSchemeOption(options4, defaults2) {
    var _a2;
    return this.regex.resolve((_a2 = options4.darkModeSelector) != null ? _a2 : defaults2.options.darkModeSelector);
  },
  getLayerOrder(name2, options4 = {}, params, defaults2) {
    const { cssLayer } = options4;
    if (cssLayer) {
      const order = resolve$1(cssLayer.order || "primeui", params);
      return `@layer ${order}`;
    }
    return "";
  },
  getCommonStyleSheet({ name: name2 = "", theme: theme40 = {}, params, props = {}, set: set3, defaults: defaults2 }) {
    const common = this.getCommon({ name: name2, theme: theme40, params, set: set3, defaults: defaults2 });
    const _props = Object.entries(props).reduce((acc, [k, v2]) => acc.push(`${k}="${v2}"`) && acc, []).join(" ");
    return Object.entries(common || {}).reduce((acc, [key, value4]) => {
      if (value4 == null ? void 0 : value4.css) {
        const _css = minifyCSS(value4 == null ? void 0 : value4.css);
        const id3 = `${key}-variables`;
        acc.push(`<style type="text/css" data-primevue-style-id="${id3}" ${_props}>${_css}</style>`);
      }
      return acc;
    }, []).join("");
  },
  getStyleSheet({ name: name2 = "", theme: theme40 = {}, params, props = {}, set: set3, defaults: defaults2 }) {
    var _a2;
    const options4 = { name: name2, theme: theme40, params, set: set3, defaults: defaults2 };
    const preset_css = (_a2 = name2.includes("-directive") ? this.getPresetD(options4) : this.getPresetC(options4)) == null ? void 0 : _a2.css;
    const _props = Object.entries(props).reduce((acc, [k, v2]) => acc.push(`${k}="${v2}"`) && acc, []).join(" ");
    return preset_css ? `<style type="text/css" data-primevue-style-id="${name2}-variables" ${_props}>${minifyCSS(preset_css)}</style>` : "";
  },
  createTokens(obj = {}, defaults2, parentKey = "", parentPath = "", tokens = {}) {
    Object.entries(obj).forEach(([key, value4]) => {
      const currentKey = matchRegex(key, defaults2.variable.excludedKeyRegex) ? parentKey : parentKey ? `${parentKey}.${toTokenKey$1(key)}` : toTokenKey$1(key);
      const currentPath = parentPath ? `${parentPath}.${key}` : key;
      if (isObject$7(value4)) {
        this.createTokens(value4, defaults2, currentKey, currentPath, tokens);
      } else {
        tokens[currentKey] || (tokens[currentKey] = {
          paths: [],
          computed(colorScheme, tokenPathMap = {}) {
            if (colorScheme) {
              const path = this.paths.find((p2) => p2.scheme === colorScheme) || this.paths.find((p2) => p2.scheme === "none");
              return path == null ? void 0 : path.computed(colorScheme, tokenPathMap["binding"]);
            }
            return this.paths.map((p2) => p2.computed(p2.scheme, tokenPathMap[p2.scheme]));
          }
        });
        tokens[currentKey].paths.push({
          path: currentPath,
          value: value4,
          scheme: currentPath.includes("colorScheme.light") ? "light" : currentPath.includes("colorScheme.dark") ? "dark" : "none",
          computed(colorScheme, tokenPathMap = {}) {
            const regex2 = /{([^}]*)}/g;
            let computedValue = value4;
            tokenPathMap["name"] = this.path;
            tokenPathMap["binding"] || (tokenPathMap["binding"] = {});
            if (matchRegex(value4, regex2)) {
              const val = value4.trim();
              const _val = val.replaceAll(regex2, (v2) => {
                var _a2, _b;
                const path = v2.replace(/{|}/g, "");
                return (_b = (_a2 = tokens[path]) == null ? void 0 : _a2.computed(colorScheme, tokenPathMap)) == null ? void 0 : _b.value;
              });
              const calculationRegex = /(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g;
              const cleanedVarRegex = /var\([^)]+\)/g;
              computedValue = matchRegex(_val.replace(cleanedVarRegex, "0"), calculationRegex) ? `calc(${_val})` : _val;
            }
            isEmpty$1(tokenPathMap["binding"]) && delete tokenPathMap["binding"];
            return {
              colorScheme,
              path: this.path,
              paths: tokenPathMap,
              value: computedValue.includes("undefined") ? void 0 : computedValue
            };
          }
        });
      }
    });
    return tokens;
  },
  getTokenValue(tokens, path, defaults2) {
    var _a2;
    const normalizePath = /* @__PURE__ */ __name((str) => {
      const strArr = str.split(".");
      return strArr.filter((s) => !matchRegex(s.toLowerCase(), defaults2.variable.excludedKeyRegex)).join(".");
    }, "normalizePath");
    const token = normalizePath(path);
    const colorScheme = path.includes("colorScheme.light") ? "light" : path.includes("colorScheme.dark") ? "dark" : void 0;
    const computedValues = [(_a2 = tokens[token]) == null ? void 0 : _a2.computed(colorScheme)].flat().filter((computed2) => computed2);
    return computedValues.length === 1 ? computedValues[0].value : computedValues.reduce((acc = {}, computed2) => {
      const _a22 = computed2, { colorScheme: cs } = _a22, rest = __objRest(_a22, ["colorScheme"]);
      acc[cs] = rest;
      return acc;
    }, void 0);
  },
  transformCSS(name2, css22, mode2, type, options4 = {}, set3, defaults2, selector) {
    if (isNotEmpty(css22)) {
      const { cssLayer } = options4;
      if (type !== "style") {
        const colorSchemeOption = this.getColorSchemeOption(options4, defaults2);
        const _css = selector ? getRule(selector, css22) : css22;
        css22 = mode2 === "dark" ? colorSchemeOption.reduce((acc, { selector: _selector }) => {
          if (isNotEmpty(_selector)) {
            acc += _selector.includes("[CSS]") ? _selector.replace("[CSS]", _css) : getRule(_selector, _css);
          }
          return acc;
        }, "") : getRule(selector != null ? selector : ":root", css22);
      }
      if (cssLayer) {
        const layerOptions = {
          name: "primeui",
          order: "primeui"
        };
        isObject$7(cssLayer) && (layerOptions.name = resolve$1(cssLayer.name, { name: name2, type }));
        if (isNotEmpty(layerOptions.name)) {
          css22 = getRule(`@layer ${layerOptions.name}`, css22);
          set3 == null ? void 0 : set3.layerNames(layerOptions.name);
        }
      }
      return css22;
    }
    return "";
  }
};
var config_default = {
  defaults: {
    variable: {
      prefix: "p",
      selector: ":root",
      excludedKeyRegex: /^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states)$/gi
    },
    options: {
      prefix: "p",
      darkModeSelector: "system",
      cssLayer: false
    }
  },
  _theme: void 0,
  _layerNames: /* @__PURE__ */ new Set(),
  _loadedStyleNames: /* @__PURE__ */ new Set(),
  _loadingStyles: /* @__PURE__ */ new Set(),
  _tokens: {},
  update(newValues = {}) {
    const { theme: theme40 } = newValues;
    if (theme40) {
      this._theme = __spreadProps(__spreadValues({}, theme40), {
        options: __spreadValues(__spreadValues({}, this.defaults.options), theme40.options)
      });
      this._tokens = themeUtils_default.createTokens(this.preset, this.defaults);
      this.clearLoadedStyleNames();
    }
  },
  get theme() {
    return this._theme;
  },
  get preset() {
    var _a2;
    return ((_a2 = this.theme) == null ? void 0 : _a2.preset) || {};
  },
  get options() {
    var _a2;
    return ((_a2 = this.theme) == null ? void 0 : _a2.options) || {};
  },
  get tokens() {
    return this._tokens;
  },
  getTheme() {
    return this.theme;
  },
  setTheme(newValue2) {
    this.update({ theme: newValue2 });
    service_default.emit("theme:change", newValue2);
  },
  getPreset() {
    return this.preset;
  },
  setPreset(newValue2) {
    this._theme = __spreadProps(__spreadValues({}, this.theme), { preset: newValue2 });
    this._tokens = themeUtils_default.createTokens(newValue2, this.defaults);
    this.clearLoadedStyleNames();
    service_default.emit("preset:change", newValue2);
    service_default.emit("theme:change", this.theme);
  },
  getOptions() {
    return this.options;
  },
  setOptions(newValue2) {
    this._theme = __spreadProps(__spreadValues({}, this.theme), { options: newValue2 });
    this.clearLoadedStyleNames();
    service_default.emit("options:change", newValue2);
    service_default.emit("theme:change", this.theme);
  },
  getLayerNames() {
    return [...this._layerNames];
  },
  setLayerNames(layerName) {
    this._layerNames.add(layerName);
  },
  getLoadedStyleNames() {
    return this._loadedStyleNames;
  },
  isStyleNameLoaded(name2) {
    return this._loadedStyleNames.has(name2);
  },
  setLoadedStyleName(name2) {
    this._loadedStyleNames.add(name2);
  },
  deleteLoadedStyleName(name2) {
    this._loadedStyleNames.delete(name2);
  },
  clearLoadedStyleNames() {
    this._loadedStyleNames.clear();
  },
  getTokenValue(tokenPath) {
    return themeUtils_default.getTokenValue(this.tokens, tokenPath, this.defaults);
  },
  getCommon(name2 = "", params) {
    return themeUtils_default.getCommon({ name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
  },
  getComponent(name2 = "", params) {
    const options4 = { name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
    return themeUtils_default.getPresetC(options4);
  },
  getDirective(name2 = "", params) {
    const options4 = { name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
    return themeUtils_default.getPresetD(options4);
  },
  getCustomPreset(name2 = "", preset, selector, params) {
    const options4 = { name: name2, preset, options: this.options, selector, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
    return themeUtils_default.getPreset(options4);
  },
  getLayerOrderCSS(name2 = "") {
    return themeUtils_default.getLayerOrder(name2, this.options, { names: this.getLayerNames() }, this.defaults);
  },
  transformCSS(name2 = "", css22, type = "style", mode2) {
    return themeUtils_default.transformCSS(name2, css22, mode2, type, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults);
  },
  getCommonStyleSheet(name2 = "", params, props = {}) {
    return themeUtils_default.getCommonStyleSheet({ name: name2, theme: this.theme, params, props, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
  },
  getStyleSheet(name2, params, props = {}) {
    return themeUtils_default.getStyleSheet({ name: name2, theme: this.theme, params, props, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
  },
  onStyleMounted(name2) {
    this._loadingStyles.add(name2);
  },
  onStyleUpdated(name2) {
    this._loadingStyles.add(name2);
  },
  onStyleLoaded(event, { name: name2 }) {
    if (this._loadingStyles.size) {
      this._loadingStyles.delete(name2);
      service_default.emit(`theme:${name2}:load`, event);
      !this._loadingStyles.size && service_default.emit("theme:load");
    }
  }
};
function updatePreset(...presets) {
  const newPreset = mergeKeys(config_default.getPreset(), ...presets);
  config_default.setPreset(newPreset);
  return newPreset;
}
__name(updatePreset, "updatePreset");
function updatePrimaryPalette(primary) {
  return $t().primaryPalette(primary).update().preset;
}
__name(updatePrimaryPalette, "updatePrimaryPalette");
function updateSurfacePalette(palette) {
  return $t().surfacePalette(palette).update().preset;
}
__name(updateSurfacePalette, "updateSurfacePalette");
function usePreset(...presets) {
  const newPreset = mergeKeys(...presets);
  config_default.setPreset(newPreset);
  return newPreset;
}
__name(usePreset, "usePreset");
function useTheme(theme40) {
  return $t(theme40).update({ mergePresets: false });
}
__name(useTheme, "useTheme");
var index$1n = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  panel: {
    borderWidth: "0 0 1px 0",
    borderColor: "{content.border.color}"
  },
  header: {
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    activeColor: "{text.color}",
    padding: "1.125rem",
    fontWeight: "600",
    borderRadius: "0",
    borderWidth: "0",
    borderColor: "{content.border.color}",
    background: "{content.background}",
    hoverBackground: "{content.background}",
    activeBackground: "{content.background}",
    activeHoverBackground: "{content.background}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    },
    toggleIcon: {
      color: "{text.muted.color}",
      hoverColor: "{text.color}",
      activeColor: "{text.color}",
      activeHoverColor: "{text.color}"
    },
    first: {
      topBorderRadius: "{content.border.radius}",
      borderWidth: "0"
    },
    last: {
      bottomBorderRadius: "{content.border.radius}",
      activeBottomBorderRadius: "0"
    }
  },
  content: {
    borderWidth: "0",
    borderColor: "{content.border.color}",
    background: "{content.background}",
    color: "{text.color}",
    padding: "0 1.125rem 1.125rem 1.125rem"
  }
};
var index$1m = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    filledFocusBackground: "{form.field.filled.focus.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    placeholderColor: "{form.field.placeholder.color}",
    shadow: "{form.field.shadow}",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  overlay: {
    background: "{overlay.select.background}",
    borderColor: "{overlay.select.border.color}",
    borderRadius: "{overlay.select.border.radius}",
    color: "{overlay.select.color}",
    shadow: "{overlay.select.shadow}"
  },
  list: {
    padding: "{list.padding}",
    gap: "{list.gap}"
  },
  option: {
    focusBackground: "{list.option.focus.background}",
    selectedBackground: "{list.option.selected.background}",
    selectedFocusBackground: "{list.option.selected.focus.background}",
    color: "{list.option.color}",
    focusColor: "{list.option.focus.color}",
    selectedColor: "{list.option.selected.color}",
    selectedFocusColor: "{list.option.selected.focus.color}",
    padding: "{list.option.padding}",
    borderRadius: "{list.option.border.radius}"
  },
  optionGroup: {
    background: "{list.option.group.background}",
    color: "{list.option.group.color}",
    fontWeight: "{list.option.group.font.weight}",
    padding: "{list.option.group.padding}"
  },
  dropdown: {
    width: "2.5rem",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.border.color}",
    activeBorderColor: "{form.field.border.color}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  chip: {
    borderRadius: "{border.radius.sm}"
  },
  emptyMessage: {
    padding: "{list.option.padding}"
  },
  colorScheme: {
    light: {
      dropdown: {
        background: "{surface.100}",
        hoverBackground: "{surface.200}",
        activeBackground: "{surface.300}",
        color: "{surface.600}",
        hoverColor: "{surface.700}",
        activeColor: "{surface.800}"
      }
    },
    dark: {
      dropdown: {
        background: "{surface.800}",
        hoverBackground: "{surface.700}",
        activeBackground: "{surface.600}",
        color: "{surface.300}",
        hoverColor: "{surface.200}",
        activeColor: "{surface.100}"
      }
    }
  }
};
var index$1l = {
  root: {
    width: "2rem",
    height: "2rem",
    fontSize: "1rem",
    background: "{content.border.color}",
    borderRadius: "{content.border.radius}"
  },
  group: {
    borderColor: "{content.background}",
    offset: "-1rem"
  },
  lg: {
    width: "3rem",
    height: "3rem",
    fontSize: "1.5rem"
  },
  xl: {
    width: "4rem",
    height: "4rem",
    fontSize: "2rem"
  }
};
var index$1k = {
  root: {
    borderRadius: "{border.radius.md}",
    padding: "0 0.5rem",
    fontSize: "0.75rem",
    fontWeight: "700",
    minWidth: "1.5rem",
    height: "1.5rem"
  },
  dot: {
    size: "0.5rem"
  },
  sm: {
    fontSize: "0.625rem",
    minWidth: "1.25rem",
    height: "1.25rem"
  },
  lg: {
    fontSize: "0.875rem",
    minWidth: "1.75rem",
    height: "1.75rem"
  },
  xl: {
    fontSize: "1rem",
    minWidth: "2rem",
    height: "2rem"
  },
  colorScheme: {
    light: {
      primary: {
        background: "{primary.color}",
        color: "{primary.contrast.color}"
      },
      secondary: {
        background: "{surface.100}",
        color: "{surface.600}"
      },
      success: {
        background: "{green.500}",
        color: "{surface.0}"
      },
      info: {
        background: "{sky.500}",
        color: "{surface.0}"
      },
      warn: {
        background: "{orange.500}",
        color: "{surface.0}"
      },
      danger: {
        background: "{red.500}",
        color: "{surface.0}"
      },
      contrast: {
        background: "{surface.950}",
        color: "{surface.0}"
      }
    },
    dark: {
      primary: {
        background: "{primary.color}",
        color: "{primary.contrast.color}"
      },
      secondary: {
        background: "{surface.800}",
        color: "{surface.300}"
      },
      success: {
        background: "{green.400}",
        color: "{green.950}"
      },
      info: {
        background: "{sky.400}",
        color: "{sky.950}"
      },
      warn: {
        background: "{orange.400}",
        color: "{orange.950}"
      },
      danger: {
        background: "{red.400}",
        color: "{red.950}"
      },
      contrast: {
        background: "{surface.0}",
        color: "{surface.950}"
      }
    }
  }
};
var index$1j = {
  root: {
    borderRadius: "{content.border.radius}"
  }
};
var index$1i = {
  root: {
    padding: "1rem",
    background: "{content.background}",
    gap: "0.5rem",
    transitionDuration: "{transition.duration}"
  },
  item: {
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    borderRadius: "{content.border.radius}",
    gap: "{navigation.item.gap}",
    icon: {
      color: "{navigation.item.icon.color}",
      hoverColor: "{navigation.item.icon.focus.color}"
    },
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  separator: {
    color: "{navigation.item.icon.color}"
  }
};
var index$1h = {
  root: {
    borderRadius: "{form.field.border.radius}",
    roundedBorderRadius: "2rem",
    gap: "0.5rem",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    iconOnlyWidth: "2.5rem",
    sm: {
      fontSize: "0.875rem",
      paddingX: "0.625rem",
      paddingY: "0.375rem"
    },
    lg: {
      fontSize: "1.125rem",
      paddingX: "0.875rem",
      paddingY: "0.625rem"
    },
    label: {
      fontWeight: "500"
    },
    raisedShadow: "0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      offset: "{focus.ring.offset}"
    },
    badgeSize: "1rem",
    transitionDuration: "{form.field.transition.duration}"
  },
  colorScheme: {
    light: {
      root: {
        primary: {
          background: "{primary.color}",
          hoverBackground: "{primary.hover.color}",
          activeBackground: "{primary.active.color}",
          borderColor: "{primary.color}",
          hoverBorderColor: "{primary.hover.color}",
          activeBorderColor: "{primary.active.color}",
          color: "{primary.contrast.color}",
          hoverColor: "{primary.contrast.color}",
          activeColor: "{primary.contrast.color}",
          focusRing: {
            color: "{primary.color}",
            shadow: "none"
          }
        },
        secondary: {
          background: "{surface.100}",
          hoverBackground: "{surface.200}",
          activeBackground: "{surface.300}",
          borderColor: "{surface.100}",
          hoverBorderColor: "{surface.200}",
          activeBorderColor: "{surface.300}",
          color: "{surface.600}",
          hoverColor: "{surface.700}",
          activeColor: "{surface.800}",
          focusRing: {
            color: "{surface.600}",
            shadow: "none"
          }
        },
        info: {
          background: "{sky.500}",
          hoverBackground: "{sky.600}",
          activeBackground: "{sky.700}",
          borderColor: "{sky.500}",
          hoverBorderColor: "{sky.600}",
          activeBorderColor: "{sky.700}",
          color: "#ffffff",
          hoverColor: "#ffffff",
          activeColor: "#ffffff",
          focusRing: {
            color: "{sky.500}",
            shadow: "none"
          }
        },
        success: {
          background: "{green.500}",
          hoverBackground: "{green.600}",
          activeBackground: "{green.700}",
          borderColor: "{green.500}",
          hoverBorderColor: "{green.600}",
          activeBorderColor: "{green.700}",
          color: "#ffffff",
          hoverColor: "#ffffff",
          activeColor: "#ffffff",
          focusRing: {
            color: "{green.500}",
            shadow: "none"
          }
        },
        warn: {
          background: "{orange.500}",
          hoverBackground: "{orange.600}",
          activeBackground: "{orange.700}",
          borderColor: "{orange.500}",
          hoverBorderColor: "{orange.600}",
          activeBorderColor: "{orange.700}",
          color: "#ffffff",
          hoverColor: "#ffffff",
          activeColor: "#ffffff",
          focusRing: {
            color: "{orange.500}",
            shadow: "none"
          }
        },
        help: {
          background: "{purple.500}",
          hoverBackground: "{purple.600}",
          activeBackground: "{purple.700}",
          borderColor: "{purple.500}",
          hoverBorderColor: "{purple.600}",
          activeBorderColor: "{purple.700}",
          color: "#ffffff",
          hoverColor: "#ffffff",
          activeColor: "#ffffff",
          focusRing: {
            color: "{purple.500}",
            shadow: "none"
          }
        },
        danger: {
          background: "{red.500}",
          hoverBackground: "{red.600}",
          activeBackground: "{red.700}",
          borderColor: "{red.500}",
          hoverBorderColor: "{red.600}",
          activeBorderColor: "{red.700}",
          color: "#ffffff",
          hoverColor: "#ffffff",
          activeColor: "#ffffff",
          focusRing: {
            color: "{red.500}",
            shadow: "none"
          }
        },
        contrast: {
          background: "{surface.950}",
          hoverBackground: "{surface.900}",
          activeBackground: "{surface.800}",
          borderColor: "{surface.950}",
          hoverBorderColor: "{surface.900}",
          activeBorderColor: "{surface.800}",
          color: "{surface.0}",
          hoverColor: "{surface.0}",
          activeColor: "{surface.0}",
          focusRing: {
            color: "{surface.950}",
            shadow: "none"
          }
        }
      },
      outlined: {
        primary: {
          hoverBackground: "{primary.50}",
          activeBackground: "{primary.100}",
          borderColor: "{primary.200}",
          color: "{primary.color}"
        },
        secondary: {
          hoverBackground: "{surface.50}",
          activeBackground: "{surface.100}",
          borderColor: "{surface.200}",
          color: "{surface.500}"
        },
        success: {
          hoverBackground: "{green.50}",
          activeBackground: "{green.100}",
          borderColor: "{green.200}",
          color: "{green.500}"
        },
        info: {
          hoverBackground: "{sky.50}",
          activeBackground: "{sky.100}",
          borderColor: "{sky.200}",
          color: "{sky.500}"
        },
        warn: {
          hoverBackground: "{orange.50}",
          activeBackground: "{orange.100}",
          borderColor: "{orange.200}",
          color: "{orange.500}"
        },
        help: {
          hoverBackground: "{purple.50}",
          activeBackground: "{purple.100}",
          borderColor: "{purple.200}",
          color: "{purple.500}"
        },
        danger: {
          hoverBackground: "{red.50}",
          activeBackground: "{red.100}",
          borderColor: "{red.200}",
          color: "{red.500}"
        },
        contrast: {
          hoverBackground: "{surface.50}",
          activeBackground: "{surface.100}",
          borderColor: "{surface.700}",
          color: "{surface.950}"
        },
        plain: {
          hoverBackground: "{surface.50}",
          activeBackground: "{surface.100}",
          borderColor: "{surface.200}",
          color: "{surface.700}"
        }
      },
      text: {
        primary: {
          hoverBackground: "{primary.50}",
          activeBackground: "{primary.100}",
          color: "{primary.color}"
        },
        secondary: {
          hoverBackground: "{surface.50}",
          activeBackground: "{surface.100}",
          color: "{surface.500}"
        },
        success: {
          hoverBackground: "{green.50}",
          activeBackground: "{green.100}",
          color: "{green.500}"
        },
        info: {
          hoverBackground: "{sky.50}",
          activeBackground: "{sky.100}",
          color: "{sky.500}"
        },
        warn: {
          hoverBackground: "{orange.50}",
          activeBackground: "{orange.100}",
          color: "{orange.500}"
        },
        help: {
          hoverBackground: "{purple.50}",
          activeBackground: "{purple.100}",
          color: "{purple.500}"
        },
        danger: {
          hoverBackground: "{red.50}",
          activeBackground: "{red.100}",
          color: "{red.500}"
        },
        plain: {
          hoverBackground: "{surface.50}",
          activeBackground: "{surface.100}",
          color: "{surface.700}"
        }
      },
      link: {
        color: "{primary.color}",
        hoverColor: "{primary.color}",
        activeColor: "{primary.color}"
      }
    },
    dark: {
      root: {
        primary: {
          background: "{primary.color}",
          hoverBackground: "{primary.hover.color}",
          activeBackground: "{primary.active.color}",
          borderColor: "{primary.color}",
          hoverBorderColor: "{primary.hover.color}",
          activeBorderColor: "{primary.active.color}",
          color: "{primary.contrast.color}",
          hoverColor: "{primary.contrast.color}",
          activeColor: "{primary.contrast.color}",
          focusRing: {
            color: "{primary.color}",
            shadow: "none"
          }
        },
        secondary: {
          background: "{surface.800}",
          hoverBackground: "{surface.700}",
          activeBackground: "{surface.600}",
          borderColor: "{surface.800}",
          hoverBorderColor: "{surface.700}",
          activeBorderColor: "{surface.600}",
          color: "{surface.300}",
          hoverColor: "{surface.200}",
          activeColor: "{surface.100}",
          focusRing: {
            color: "{surface.300}",
            shadow: "none"
          }
        },
        info: {
          background: "{sky.400}",
          hoverBackground: "{sky.300}",
          activeBackground: "{sky.200}",
          borderColor: "{sky.400}",
          hoverBorderColor: "{sky.300}",
          activeBorderColor: "{sky.200}",
          color: "{sky.950}",
          hoverColor: "{sky.950}",
          activeColor: "{sky.950}",
          focusRing: {
            color: "{sky.400}",
            shadow: "none"
          }
        },
        success: {
          background: "{green.400}",
          hoverBackground: "{green.300}",
          activeBackground: "{green.200}",
          borderColor: "{green.400}",
          hoverBorderColor: "{green.300}",
          activeBorderColor: "{green.200}",
          color: "{green.950}",
          hoverColor: "{green.950}",
          activeColor: "{green.950}",
          focusRing: {
            color: "{green.400}",
            shadow: "none"
          }
        },
        warn: {
          background: "{orange.400}",
          hoverBackground: "{orange.300}",
          activeBackground: "{orange.200}",
          borderColor: "{orange.400}",
          hoverBorderColor: "{orange.300}",
          activeBorderColor: "{orange.200}",
          color: "{orange.950}",
          hoverColor: "{orange.950}",
          activeColor: "{orange.950}",
          focusRing: {
            color: "{orange.400}",
            shadow: "none"
          }
        },
        help: {
          background: "{purple.400}",
          hoverBackground: "{purple.300}",
          activeBackground: "{purple.200}",
          borderColor: "{purple.400}",
          hoverBorderColor: "{purple.300}",
          activeBorderColor: "{purple.200}",
          color: "{purple.950}",
          hoverColor: "{purple.950}",
          activeColor: "{purple.950}",
          focusRing: {
            color: "{purple.400}",
            shadow: "none"
          }
        },
        danger: {
          background: "{red.400}",
          hoverBackground: "{red.300}",
          activeBackground: "{red.200}",
          borderColor: "{red.400}",
          hoverBorderColor: "{red.300}",
          activeBorderColor: "{red.200}",
          color: "{red.950}",
          hoverColor: "{red.950}",
          activeColor: "{red.950}",
          focusRing: {
            color: "{red.400}",
            shadow: "none"
          }
        },
        contrast: {
          background: "{surface.0}",
          hoverBackground: "{surface.100}",
          activeBackground: "{surface.200}",
          borderColor: "{surface.0}",
          hoverBorderColor: "{surface.100}",
          activeBorderColor: "{surface.200}",
          color: "{surface.950}",
          hoverColor: "{surface.950}",
          activeColor: "{surface.950}",
          focusRing: {
            color: "{surface.0}",
            shadow: "none"
          }
        }
      },
      outlined: {
        primary: {
          hoverBackground: "color-mix(in srgb, {primary.color}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {primary.color}, transparent 84%)",
          borderColor: "{primary.700}",
          color: "{primary.color}"
        },
        secondary: {
          hoverBackground: "rgba(255,255,255,0.04)",
          activeBackground: "rgba(255,255,255,0.16)",
          borderColor: "{surface.700}",
          color: "{surface.400}"
        },
        success: {
          hoverBackground: "color-mix(in srgb, {green.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {green.400}, transparent 84%)",
          borderColor: "{green.700}",
          color: "{green.400}"
        },
        info: {
          hoverBackground: "color-mix(in srgb, {sky.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {sky.400}, transparent 84%)",
          borderColor: "{sky.700}",
          color: "{sky.400}"
        },
        warn: {
          hoverBackground: "color-mix(in srgb, {orange.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {orange.400}, transparent 84%)",
          borderColor: "{orange.700}",
          color: "{orange.400}"
        },
        help: {
          hoverBackground: "color-mix(in srgb, {purple.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {purple.400}, transparent 84%)",
          borderColor: "{purple.700}",
          color: "{purple.400}"
        },
        danger: {
          hoverBackground: "color-mix(in srgb, {red.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {red.400}, transparent 84%)",
          borderColor: "{red.700}",
          color: "{red.400}"
        },
        contrast: {
          hoverBackground: "{surface.800}",
          activeBackground: "{surface.700}",
          borderColor: "{surface.500}",
          color: "{surface.0}"
        },
        plain: {
          hoverBackground: "{surface.800}",
          activeBackground: "{surface.700}",
          borderColor: "{surface.600}",
          color: "{surface.0}"
        }
      },
      text: {
        primary: {
          hoverBackground: "color-mix(in srgb, {primary.color}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {primary.color}, transparent 84%)",
          color: "{primary.color}"
        },
        secondary: {
          hoverBackground: "{surface.800}",
          activeBackground: "{surface.700}",
          color: "{surface.400}"
        },
        success: {
          hoverBackground: "color-mix(in srgb, {green.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {green.400}, transparent 84%)",
          color: "{green.400}"
        },
        info: {
          hoverBackground: "color-mix(in srgb, {sky.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {sky.400}, transparent 84%)",
          color: "{sky.400}"
        },
        warn: {
          hoverBackground: "color-mix(in srgb, {orange.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {orange.400}, transparent 84%)",
          color: "{orange.400}"
        },
        help: {
          hoverBackground: "color-mix(in srgb, {purple.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {purple.400}, transparent 84%)",
          color: "{purple.400}"
        },
        danger: {
          hoverBackground: "color-mix(in srgb, {red.400}, transparent 96%)",
          activeBackground: "color-mix(in srgb, {red.400}, transparent 84%)",
          color: "{red.400}"
        },
        plain: {
          hoverBackground: "{surface.800}",
          activeBackground: "{surface.700}",
          color: "{surface.0}"
        }
      },
      link: {
        color: "{primary.color}",
        hoverColor: "{primary.color}",
        activeColor: "{primary.color}"
      }
    }
  }
};
var index$1g = {
  root: {
    background: "{content.background}",
    borderRadius: "{border.radius.xl}",
    color: "{content.color}",
    shadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"
  },
  body: {
    padding: "1.25rem",
    gap: "0.5rem"
  },
  caption: {
    gap: "0.5rem"
  },
  title: {
    fontSize: "1.25rem",
    fontWeight: "500"
  },
  subtitle: {
    color: "{text.muted.color}"
  }
};
var index$1f = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  content: {
    gap: "0.25rem"
  },
  indicatorList: {
    padding: "1rem",
    gap: "0.5rem"
  },
  indicator: {
    width: "2rem",
    height: "0.5rem",
    borderRadius: "{content.border.radius}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  colorScheme: {
    light: {
      indicator: {
        background: "{surface.200}",
        hoverBackground: "{surface.300}",
        activeBackground: "{primary.color}"
      }
    },
    dark: {
      indicator: {
        background: "{surface.700}",
        hoverBackground: "{surface.600}",
        activeBackground: "{primary.color}"
      }
    }
  }
};
var index$1e = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    filledFocusBackground: "{form.field.filled.focus.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    placeholderColor: "{form.field.placeholder.color}",
    shadow: "{form.field.shadow}",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  dropdown: {
    width: "2.5rem",
    color: "{form.field.icon.color}"
  },
  overlay: {
    background: "{overlay.select.background}",
    borderColor: "{overlay.select.border.color}",
    borderRadius: "{overlay.select.border.radius}",
    color: "{overlay.select.color}",
    shadow: "{overlay.select.shadow}"
  },
  list: {
    padding: "{list.padding}",
    gap: "{list.gap}"
  },
  option: {
    focusBackground: "{list.option.focus.background}",
    selectedBackground: "{list.option.selected.background}",
    selectedFocusBackground: "{list.option.selected.focus.background}",
    color: "{list.option.color}",
    focusColor: "{list.option.focus.color}",
    selectedColor: "{list.option.selected.color}",
    selectedFocusColor: "{list.option.selected.focus.color}",
    padding: "{list.option.padding}",
    borderRadius: "{list.option.border.radius}",
    icon: {
      color: "{list.option.icon.color}",
      focusColor: "{list.option.icon.focus.color}",
      size: "0.875rem"
    }
  }
};
var index$1d = {
  root: {
    borderRadius: "{border.radius.sm}",
    width: "1.25rem",
    height: "1.25rem",
    background: "{form.field.background}",
    checkedBackground: "{primary.color}",
    checkedHoverBackground: "{primary.hover.color}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.border.color}",
    checkedBorderColor: "{primary.color}",
    checkedHoverBorderColor: "{primary.hover.color}",
    checkedFocusBorderColor: "{primary.color}",
    checkedDisabledBorderColor: "{form.field.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    shadow: "{form.field.shadow}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  icon: {
    size: "0.875rem",
    color: "{form.field.color}",
    checkedColor: "{primary.contrast.color}",
    checkedHoverColor: "{primary.contrast.color}",
    disabledColor: "{form.field.disabled.color}"
  }
};
var index$1c = {
  root: {
    borderRadius: "16px",
    paddingX: "0.75rem",
    paddingY: "0.5rem",
    gap: "0.5rem",
    transitionDuration: "{transition.duration}"
  },
  image: {
    width: "2rem",
    height: "2rem"
  },
  icon: {
    size: "1rem"
  },
  removeIcon: {
    size: "1rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    }
  },
  colorScheme: {
    light: {
      root: {
        background: "{surface.100}",
        color: "{surface.800}"
      },
      icon: {
        color: "{surface.800}"
      },
      removeIcon: {
        color: "{surface.800}"
      }
    },
    dark: {
      root: {
        background: "{surface.800}",
        color: "{surface.0}"
      },
      icon: {
        color: "{surface.0}"
      },
      removeIcon: {
        color: "{surface.0}"
      }
    }
  }
};
var index$1b = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  preview: {
    width: "1.5rem",
    height: "1.5rem",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  panel: {
    shadow: "{overlay.popover.shadow}",
    borderRadius: "{overlay.popover.borderRadius}"
  },
  colorScheme: {
    light: {
      panel: {
        background: "{surface.800}",
        borderColor: "{surface.900}"
      },
      handle: {
        color: "{surface.0}"
      }
    },
    dark: {
      panel: {
        background: "{surface.900}",
        borderColor: "{surface.700}"
      },
      handle: {
        color: "{surface.0}"
      }
    }
  }
};
var index$1a = {
  icon: {
    size: "2rem",
    color: "{overlay.modal.color}"
  },
  content: {
    gap: "1rem"
  }
};
var index$19 = {
  root: {
    background: "{overlay.popover.background}",
    borderColor: "{overlay.popover.border.color}",
    color: "{overlay.popover.color}",
    borderRadius: "{overlay.popover.border.radius}",
    shadow: "{overlay.popover.shadow}",
    gutter: "10px",
    arrowOffset: "1.25rem"
  },
  content: {
    padding: "{overlay.popover.padding}",
    gap: "1rem"
  },
  icon: {
    size: "1.5rem",
    color: "{overlay.popover.color}"
  },
  footer: {
    gap: "0.5rem",
    padding: "0 {overlay.popover.padding} {overlay.popover.padding} {overlay.popover.padding}"
  }
};
var index$18 = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    borderRadius: "{content.border.radius}",
    shadow: "{overlay.navigation.shadow}",
    transitionDuration: "{transition.duration}"
  },
  list: {
    padding: "{navigation.list.padding}",
    gap: "{navigation.list.gap}"
  },
  item: {
    focusBackground: "{navigation.item.focus.background}",
    activeBackground: "{navigation.item.active.background}",
    color: "{navigation.item.color}",
    focusColor: "{navigation.item.focus.color}",
    activeColor: "{navigation.item.active.color}",
    padding: "{navigation.item.padding}",
    borderRadius: "{navigation.item.border.radius}",
    gap: "{navigation.item.gap}",
    icon: {
      color: "{navigation.item.icon.color}",
      focusColor: "{navigation.item.icon.focus.color}",
      activeColor: "{navigation.item.icon.active.color}"
    }
  },
  submenuIcon: {
    size: "{navigation.submenu.icon.size}",
    color: "{navigation.submenu.icon.color}",
    focusColor: "{navigation.submenu.icon.focus.color}",
    activeColor: "{navigation.submenu.icon.active.color}"
  },
  separator: {
    borderColor: "{content.border.color}"
  }
};
var index$17 = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  header: {
    background: "{content.background}",
    borderColor: "{datatable.border.color}",
    color: "{content.color}",
    borderWidth: "0 0 1px 0",
    padding: "0.75rem 1rem"
  },
  headerCell: {
    background: "{content.background}",
    hoverBackground: "{content.hover.background}",
    selectedBackground: "{highlight.background}",
    borderColor: "{datatable.border.color}",
    color: "{content.color}",
    hoverColor: "{content.hover.color}",
    selectedColor: "{highlight.color}",
    gap: "0.5rem",
    padding: "0.75rem 1rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "-1px",
      shadow: "{focus.ring.shadow}"
    }
  },
  columnTitle: {
    fontWeight: "600"
  },
  row: {
    background: "{content.background}",
    hoverBackground: "{content.hover.background}",
    selectedBackground: "{highlight.background}",
    color: "{content.color}",
    hoverColor: "{content.hover.color}",
    selectedColor: "{highlight.color}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "-1px",
      shadow: "{focus.ring.shadow}"
    }
  },
  bodyCell: {
    borderColor: "{datatable.border.color}",
    padding: "0.75rem 1rem"
  },
  footerCell: {
    background: "{content.background}",
    borderColor: "{datatable.border.color}",
    color: "{content.color}",
    padding: "0.75rem 1rem"
  },
  columnFooter: {
    fontWeight: "600"
  },
  footer: {
    background: "{content.background}",
    borderColor: "{datatable.border.color}",
    color: "{content.color}",
    borderWidth: "0 0 1px 0",
    padding: "0.75rem 1rem"
  },
  dropPointColor: "{primary.color}",
  columnResizerWidth: "0.5rem",
  resizeIndicator: {
    width: "1px",
    color: "{primary.color}"
  },
  sortIcon: {
    color: "{text.muted.color}",
    hoverColor: "{text.hover.muted.color}"
  },
  loadingIcon: {
    size: "2rem"
  },
  rowToggleButton: {
    hoverBackground: "{content.hover.background}",
    selectedHoverBackground: "{content.background}",
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    selectedHoverColor: "{primary.color}",
    size: "1.75rem",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  filter: {
    inlineGap: "0.5rem",
    overlaySelect: {
      background: "{overlay.select.background}",
      borderColor: "{overlay.select.border.color}",
      borderRadius: "{overlay.select.border.radius}",
      color: "{overlay.select.color}",
      shadow: "{overlay.select.shadow}"
    },
    overlayPopover: {
      background: "{overlay.popover.background}",
      borderColor: "{overlay.popover.border.color}",
      borderRadius: "{overlay.popover.border.radius}",
      color: "{overlay.popover.color}",
      shadow: "{overlay.popover.shadow}",
      padding: "{overlay.popover.padding}",
      gap: "0.5rem"
    },
    rule: {
      borderColor: "{content.border.color}"
    },
    constraintList: {
      padding: "{list.padding}",
      gap: "{list.gap}"
    },
    constraint: {
      focusBackground: "{list.option.focus.background}",
      selectedBackground: "{list.option.selected.background}",
      selectedFocusBackground: "{list.option.selected.focus.background}",
      color: "{list.option.color}",
      focusColor: "{list.option.focus.color}",
      selectedColor: "{list.option.selected.color}",
      selectedFocusColor: "{list.option.selected.focus.color}",
      separator: {
        borderColor: "{content.border.color}"
      },
      padding: "{list.option.padding}",
      borderRadius: "{list.option.border.radius}"
    }
  },
  paginatorTop: {
    borderColor: "{datatable.border.color}",
    borderWidth: "0 0 1px 0"
  },
  paginatorBottom: {
    borderColor: "{datatable.border.color}",
    borderWidth: "0 0 1px 0"
  },
  colorScheme: {
    light: {
      root: {
        borderColor: "{content.border.color}"
      },
      row: {
        stripedBackground: "{surface.50}"
      },
      bodyCell: {
        selectedBorderColor: "{primary.100}"
      }
    },
    dark: {
      root: {
        borderColor: "{surface.800}"
      },
      row: {
        stripedBackground: "{surface.950}"
      },
      bodyCell: {
        selectedBorderColor: "{primary.900}"
      }
    }
  }
};
var index$16 = {
  root: {
    borderColor: "transparent",
    borderWidth: "0",
    borderRadius: "0",
    padding: "0"
  },
  header: {
    background: "{content.background}",
    color: "{content.color}",
    borderColor: "{content.border.color}",
    borderWidth: "0 0 1px 0",
    padding: "0.75rem 1rem",
    borderRadius: "0"
  },
  content: {
    background: "{content.background}",
    color: "{content.color}",
    borderColor: "transparent",
    borderWidth: "0",
    padding: "0",
    borderRadius: "0"
  },
  footer: {
    background: "{content.background}",
    color: "{content.color}",
    borderColor: "{content.border.color}",
    borderWidth: "1px 0 0 0",
    padding: "0.75rem 1rem",
    borderRadius: "0"
  },
  paginatorTop: {
    borderColor: "{content.border.color}",
    borderWidth: "0 0 1px 0"
  },
  paginatorBottom: {
    borderColor: "{content.border.color}",
    borderWidth: "1px 0 0 0"
  }
};
var index$15 = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  panel: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    borderRadius: "{content.border.radius}",
    shadow: "{overlay.popover.shadow}",
    padding: "{overlay.popover.padding}"
  },
  header: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    padding: "0 0 0.5rem 0",
    fontWeight: "500",
    gap: "0.5rem"
  },
  title: {
    gap: "0.5rem",
    fontWeight: "500"
  },
  dropdown: {
    width: "2.5rem",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.border.color}",
    activeBorderColor: "{form.field.border.color}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  inputIcon: {
    color: "{form.field.icon.color}"
  },
  selectMonth: {
    hoverBackground: "{content.hover.background}",
    color: "{content.color}",
    hoverColor: "{content.hover.color}",
    padding: "0.25rem 0.5rem",
    borderRadius: "{content.border.radius}"
  },
  selectYear: {
    hoverBackground: "{content.hover.background}",
    color: "{content.color}",
    hoverColor: "{content.hover.color}",
    padding: "0.25rem 0.5rem",
    borderRadius: "{content.border.radius}"
  },
  group: {
    borderColor: "{content.border.color}",
    gap: "{overlay.popover.padding}"
  },
  dayView: {
    margin: "0.5rem 0 0 0"
  },
  weekDay: {
    padding: "0.25rem",
    fontWeight: "500",
    color: "{content.color}"
  },
  date: {
    hoverBackground: "{content.hover.background}",
    selectedBackground: "{primary.color}",
    rangeSelectedBackground: "{highlight.background}",
    color: "{content.color}",
    hoverColor: "{content.hover.color}",
    selectedColor: "{primary.contrast.color}",
    rangeSelectedColor: "{highlight.color}",
    width: "2rem",
    height: "2rem",
    borderRadius: "50%",
    padding: "0.25rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  monthView: {
    margin: "0.5rem 0 0 0"
  },
  month: {
    borderRadius: "{content.border.radius}"
  },
  yearView: {
    margin: "0.5rem 0 0 0"
  },
  year: {
    borderRadius: "{content.border.radius}"
  },
  buttonbar: {
    padding: "0.5rem 0 0 0",
    borderColor: "{content.border.color}"
  },
  timePicker: {
    padding: "0.5rem 0 0 0",
    borderColor: "{content.border.color}",
    gap: "0.5rem",
    buttonGap: "0.25rem"
  },
  colorScheme: {
    light: {
      dropdown: {
        background: "{surface.100}",
        hoverBackground: "{surface.200}",
        activeBackground: "{surface.300}",
        color: "{surface.600}",
        hoverColor: "{surface.700}",
        activeColor: "{surface.800}"
      },
      today: {
        background: "{surface.200}",
        color: "{surface.900}"
      }
    },
    dark: {
      dropdown: {
        background: "{surface.800}",
        hoverBackground: "{surface.700}",
        activeBackground: "{surface.600}",
        color: "{surface.300}",
        hoverColor: "{surface.200}",
        activeColor: "{surface.100}"
      },
      today: {
        background: "{surface.700}",
        color: "{surface.0}"
      }
    }
  }
};
var index$14 = {
  root: {
    background: "{overlay.modal.background}",
    borderColor: "{overlay.modal.border.color}",
    color: "{overlay.modal.color}",
    borderRadius: "{overlay.modal.border.radius}",
    shadow: "{overlay.modal.shadow}"
  },
  header: {
    padding: "{overlay.modal.padding}",
    gap: "0.5rem"
  },
  title: {
    fontSize: "1.25rem",
    fontWeight: "600"
  },
  content: {
    padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}"
  },
  footer: {
    padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}",
    gap: "0.5rem"
  }
};
var index$13 = {
  root: {
    borderColor: "{content.border.color}"
  },
  content: {
    background: "{content.background}",
    color: "{text.color}"
  },
  horizontal: {
    margin: "1rem 0",
    padding: "0 1rem",
    content: {
      padding: "0 0.5rem"
    }
  },
  vertical: {
    margin: "0 1rem",
    padding: "0.5rem 0",
    content: {
      padding: "0.5rem 0"
    }
  }
};
var index$12 = {
  root: {
    background: "rgba(255, 255, 255, 0.1)",
    borderColor: "rgba(255, 255, 255, 0.2)",
    padding: "0.5rem",
    borderRadius: "{border.radius.xl}"
  },
  item: {
    borderRadius: "{content.border.radius}",
    padding: "0.5rem",
    size: "3rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  }
};
var index$11 = {
  root: {
    background: "{overlay.modal.background}",
    borderColor: "{overlay.modal.border.color}",
    color: "{overlay.modal.color}",
    borderRadius: "{overlay.modal.border.radius}",
    shadow: "{overlay.modal.shadow}"
  },
  header: {
    padding: "{overlay.modal.padding}"
  },
  title: {
    fontSize: "1.5rem",
    fontWeight: "600"
  },
  content: {
    padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}"
  }
};
var index$10 = {
  toolbar: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    borderRadius: "{content.border.radius}"
  },
  toolbarItem: {
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    activeColor: "{primary.color}"
  },
  overlay: {
    background: "{overlay.select.background}",
    borderColor: "{overlay.select.border.color}",
    borderRadius: "{overlay.select.border.radius}",
    color: "{overlay.select.color}",
    shadow: "{overlay.select.shadow}",
    padding: "{list.padding}"
  },
  overlayOption: {
    focusBackground: "{list.option.focus.background}",
    color: "{list.option.color}",
    focusColor: "{list.option.focus.color}",
    padding: "{list.option.padding}",
    borderRadius: "{list.option.border.radius}"
  },
  content: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    borderRadius: "{content.border.radius}"
  }
};
var index$$ = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    color: "{content.color}",
    padding: "0 1.125rem 1.125rem 1.125rem",
    transitionDuration: "{transition.duration}"
  },
  legend: {
    background: "{content.background}",
    hoverBackground: "{content.hover.background}",
    color: "{content.color}",
    hoverColor: "{content.hover.color}",
    borderRadius: "{content.border.radius}",
    borderWidth: "1px",
    borderColor: "transparent",
    padding: "0.5rem 0.75rem",
    gap: "0.5rem",
    fontWeight: "600",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  toggleIcon: {
    color: "{text.muted.color}",
    hoverColor: "{text.hover.muted.color}"
  },
  content: {
    padding: "0"
  }
};
var index$_ = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    borderRadius: "{content.border.radius}",
    transitionDuration: "{transition.duration}"
  },
  header: {
    background: "transparent",
    color: "{text.color}",
    padding: "1.125rem",
    borderWidth: "0",
    borderRadius: "0",
    gap: "0.5rem"
  },
  content: {
    highlightBorderColor: "{primary.color}",
    padding: "0 1.125rem 1.125rem 1.125rem"
  },
  file: {
    padding: "1rem",
    gap: "1rem",
    borderColor: "{content.border.color}",
    info: {
      gap: "0.5rem"
    }
  },
  progressbar: {
    height: "0.25rem"
  },
  basic: {
    gap: "0.5rem"
  }
};
var index$Z = {
  root: {
    color: "{form.field.float.label.color}",
    focusColor: "{form.field.float.label.focus.color}",
    invalidColor: "{form.field.float.label.invalid.color}",
    transitionDuration: "0.2s"
  }
};
var index$Y = {
  root: {
    borderWidth: "1px",
    borderColor: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    transitionDuration: "{transition.duration}"
  },
  navButton: {
    background: "rgba(255, 255, 255, 0.1)",
    hoverBackground: "rgba(255, 255, 255, 0.2)",
    color: "{surface.100}",
    hoverColor: "{surface.0}",
    size: "3rem",
    gutter: "0.5rem",
    prev: {
      borderRadius: "50%"
    },
    next: {
      borderRadius: "50%"
    },
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  navIcon: {
    size: "1.5rem"
  },
  thumbnailsContent: {
    background: "{content.background}",
    padding: "1rem 0.25rem"
  },
  thumbnailNavButton: {
    size: "2rem",
    borderRadius: "{content.border.radius}",
    gutter: "0.5rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  thumbnailNavButtonIcon: {
    size: "1rem"
  },
  caption: {
    background: "rgba(0, 0, 0, 0.5)",
    color: "{surface.100}",
    padding: "1rem"
  },
  indicatorList: {
    gap: "0.5rem",
    padding: "1rem"
  },
  indicatorButton: {
    width: "1rem",
    height: "1rem",
    activeBackground: "{primary.color}",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  insetIndicatorList: {
    background: "rgba(0, 0, 0, 0.5)"
  },
  insetIndicatorButton: {
    background: "rgba(255, 255, 255, 0.4)",
    hoverBackground: "rgba(255, 255, 255, 0.6)",
    activeBackground: "rgba(255, 255, 255, 0.9)"
  },
  mask: {
    background: "{mask.background}",
    color: "{mask.color}"
  },
  closeButton: {
    size: "3rem",
    gutter: "0.5rem",
    background: "rgba(255, 255, 255, 0.1)",
    hoverBackground: "rgba(255, 255, 255, 0.2)",
    color: "{surface.50}",
    hoverColor: "{surface.0}",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  closeButtonIcon: {
    size: "1.5rem"
  },
  colorScheme: {
    light: {
      thumbnailNavButton: {
        hoverBackground: "{surface.100}",
        color: "{surface.600}",
        hoverColor: "{surface.700}"
      },
      indicatorButton: {
        background: "{surface.200}",
        hoverBackground: "{surface.300}"
      }
    },
    dark: {
      thumbnailNavButton: {
        hoverBackground: "{surface.700}",
        color: "{surface.400}",
        hoverColor: "{surface.0}"
      },
      indicatorButton: {
        background: "{surface.700}",
        hoverBackground: "{surface.600}"
      }
    }
  }
};
var index$X = {
  icon: {
    color: "{form.field.icon.color}"
  }
};
var index$W = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  preview: {
    icon: {
      size: "1.5rem"
    },
    mask: {
      background: "{mask.background}",
      color: "{mask.color}"
    }
  },
  toolbar: {
    position: {
      left: "auto",
      right: "1rem",
      top: "1rem",
      bottom: "auto"
    },
    blur: "8px",
    background: "rgba(255,255,255,0.1)",
    borderColor: "rgba(255,255,255,0.2)",
    borderWidth: "1px",
    borderRadius: "30px",
    padding: ".5rem",
    gap: "0.5rem"
  },
  action: {
    hoverBackground: "rgba(255,255,255,0.1)",
    color: "{surface.50}",
    hoverColor: "{surface.0}",
    size: "3rem",
    iconSize: "1.5rem",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  }
};
var index$V = {
  root: {
    padding: "{form.field.padding.y} {form.field.padding.x}",
    borderRadius: "{content.border.radius}",
    gap: "0.5rem"
  },
  text: {
    fontWeight: "500"
  },
  icon: {
    size: "1rem"
  },
  colorScheme: {
    light: {
      info: {
        background: "color-mix(in srgb, {blue.50}, transparent 5%)",
        borderColor: "{blue.200}",
        color: "{blue.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)"
      },
      success: {
        background: "color-mix(in srgb, {green.50}, transparent 5%)",
        borderColor: "{green.200}",
        color: "{green.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)"
      },
      warn: {
        background: "color-mix(in srgb,{yellow.50}, transparent 5%)",
        borderColor: "{yellow.200}",
        color: "{yellow.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)"
      },
      error: {
        background: "color-mix(in srgb, {red.50}, transparent 5%)",
        borderColor: "{red.200}",
        color: "{red.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)"
      },
      secondary: {
        background: "{surface.100}",
        borderColor: "{surface.200}",
        color: "{surface.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)"
      },
      contrast: {
        background: "{surface.900}",
        borderColor: "{surface.950}",
        color: "{surface.50}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)"
      }
    },
    dark: {
      info: {
        background: "color-mix(in srgb, {blue.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)",
        color: "{blue.500}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)"
      },
      success: {
        background: "color-mix(in srgb, {green.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {green.700}, transparent 64%)",
        color: "{green.500}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)"
      },
      warn: {
        background: "color-mix(in srgb, {yellow.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)",
        color: "{yellow.500}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)"
      },
      error: {
        background: "color-mix(in srgb, {red.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {red.700}, transparent 64%)",
        color: "{red.500}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)"
      },
      secondary: {
        background: "{surface.800}",
        borderColor: "{surface.700}",
        color: "{surface.300}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)"
      },
      contrast: {
        background: "{surface.0}",
        borderColor: "{surface.100}",
        color: "{surface.950}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)"
      }
    }
  }
};
var index$U = {
  root: {
    padding: "{form.field.padding.y} {form.field.padding.x}",
    borderRadius: "{content.border.radius}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    },
    transitionDuration: "{transition.duration}"
  },
  display: {
    hoverBackground: "{content.hover.background}",
    hoverColor: "{content.hover.color}"
  }
};
var index$T = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    filledFocusBackground: "{form.field.filled.focus.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    placeholderColor: "{form.field.placeholder.color}",
    shadow: "{form.field.shadow}",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  chip: {
    borderRadius: "{border.radius.sm}"
  },
  colorScheme: {
    light: {
      chip: {
        focusBackground: "{surface.200}",
        color: "{surface.800}"
      }
    },
    dark: {
      chip: {
        focusBackground: "{surface.700}",
        color: "{surface.0}"
      }
    }
  }
};
var index$S = {
  addon: {
    background: "{form.field.background}",
    borderColor: "{form.field.border.color}",
    color: "{form.field.icon.color}",
    borderRadius: "{form.field.border.radius}"
  }
};
var index$R = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  button: {
    width: "2.5rem",
    borderRadius: "{form.field.border.radius}",
    verticalPadding: "{form.field.padding.y}"
  },
  colorScheme: {
    light: {
      button: {
        background: "transparent",
        hoverBackground: "{surface.100}",
        activeBackground: "{surface.200}",
        borderColor: "{form.field.border.color}",
        hoverBorderColor: "{form.field.border.color}",
        activeBorderColor: "{form.field.border.color}",
        color: "{surface.400}",
        hoverColor: "{surface.500}",
        activeColor: "{surface.600}"
      }
    },
    dark: {
      button: {
        background: "transparent",
        hoverBackground: "{surface.800}",
        activeBackground: "{surface.700}",
        borderColor: "{form.field.border.color}",
        hoverBorderColor: "{form.field.border.color}",
        activeBorderColor: "{form.field.border.color}",
        color: "{surface.400}",
        hoverColor: "{surface.300}",
        activeColor: "{surface.200}"
      }
    }
  }
};
var index$Q = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    filledFocusBackground: "{form.field.filled.focus.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    placeholderColor: "{form.field.placeholder.color}",
    shadow: "{form.field.shadow}",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}",
    sm: {
      fontSize: "0.875rem",
      paddingX: "0.625rem",
      paddingY: "0.375rem"
    },
    lg: {
      fontSize: "1.125rem",
      paddingX: "0.875rem",
      paddingY: "0.625rem"
    }
  }
};
var index$P = {
  root: {
    transitionDuration: "{transition.duration}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  value: {
    background: "{primary.color}"
  },
  range: {
    background: "{content.border.color}"
  },
  text: {
    color: "{text.muted.color}"
  }
};
var index$O = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    shadow: "{form.field.shadow}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  list: {
    padding: "{list.padding}",
    gap: "{list.gap}",
    header: {
      padding: "{list.header.padding}"
    }
  },
  option: {
    focusBackground: "{list.option.focus.background}",
    selectedBackground: "{list.option.selected.background}",
    selectedFocusBackground: "{list.option.selected.focus.background}",
    color: "{list.option.color}",
    focusColor: "{list.option.focus.color}",
    selectedColor: "{list.option.selected.color}",
    selectedFocusColor: "{list.option.selected.focus.color}",
    padding: "{list.option.padding}",
    borderRadius: "{list.option.border.radius}"
  },
  optionGroup: {
    background: "{list.option.group.background}",
    color: "{list.option.group.color}",
    fontWeight: "{list.option.group.font.weight}",
    padding: "{list.option.group.padding}"
  },
  checkmark: {
    color: "{list.option.color}",
    gutterStart: "-0.375rem",
    gutterEnd: "0.375rem"
  },
  emptyMessage: {
    padding: "{list.option.padding}"
  },
  colorScheme: {
    light: {
      option: {
        stripedBackground: "{surface.50}"
      }
    },
    dark: {
      option: {
        stripedBackground: "{surface.900}"
      }
    }
  }
};
var index$N = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    color: "{content.color}",
    gap: "0.5rem",
    verticalOrientation: {
      padding: "{navigation.list.padding}",
      gap: "0"
    },
    horizontalOrientation: {
      padding: "0.5rem 0.75rem"
    },
    transitionDuration: "{transition.duration}"
  },
  baseItem: {
    borderRadius: "{content.border.radius}",
    padding: "{navigation.item.padding}"
  },
  item: {
    focusBackground: "{navigation.item.focus.background}",
    activeBackground: "{navigation.item.active.background}",
    color: "{navigation.item.color}",
    focusColor: "{navigation.item.focus.color}",
    activeColor: "{navigation.item.active.color}",
    padding: "{navigation.item.padding}",
    borderRadius: "{navigation.item.border.radius}",
    gap: "{navigation.item.gap}",
    icon: {
      color: "{navigation.item.icon.color}",
      focusColor: "{navigation.item.icon.focus.color}",
      activeColor: "{navigation.item.icon.active.color}"
    }
  },
  overlay: {
    padding: "0",
    background: "{content.background}",
    borderColor: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    color: "{content.color}",
    shadow: "{overlay.navigation.shadow}",
    gap: "0.5rem"
  },
  submenu: {
    padding: "{navigation.list.padding}",
    gap: "{navigation.list.gap}"
  },
  submenuLabel: {
    padding: "{navigation.submenu.label.padding}",
    fontWeight: "{navigation.submenu.label.font.weight}",
    background: "{navigation.submenu.label.background.}",
    color: "{navigation.submenu.label.color}"
  },
  submenuIcon: {
    size: "{navigation.submenu.icon.size}",
    color: "{navigation.submenu.icon.color}",
    focusColor: "{navigation.submenu.icon.focus.color}",
    activeColor: "{navigation.submenu.icon.active.color}"
  },
  separator: {
    borderColor: "{content.border.color}"
  },
  mobileButton: {
    borderRadius: "50%",
    size: "1.75rem",
    color: "{text.muted.color}",
    hoverColor: "{text.muted.hover.color}",
    hoverBackground: "{content.hover.background}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  }
};
var index$M = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    borderRadius: "{content.border.radius}",
    shadow: "{overlay.navigation.shadow}",
    transitionDuration: "{transition.duration}"
  },
  list: {
    padding: "{navigation.list.padding}",
    gap: "{navigation.list.gap}"
  },
  item: {
    focusBackground: "{navigation.item.focus.background}",
    color: "{navigation.item.color}",
    focusColor: "{navigation.item.focus.color}",
    padding: "{navigation.item.padding}",
    borderRadius: "{navigation.item.border.radius}",
    gap: "{navigation.item.gap}",
    icon: {
      color: "{navigation.item.icon.color}",
      focusColor: "{navigation.item.icon.focus.color}"
    }
  },
  submenuLabel: {
    padding: "{navigation.submenu.label.padding}",
    fontWeight: "{navigation.submenu.label.font.weight}",
    background: "{navigation.submenu.label.background}",
    color: "{navigation.submenu.label.color}"
  },
  separator: {
    borderColor: "{content.border.color}"
  }
};
var index$L = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    color: "{content.color}",
    gap: "0.5rem",
    padding: "0.5rem 0.75rem",
    transitionDuration: "{transition.duration}"
  },
  baseItem: {
    borderRadius: "{content.border.radius}",
    padding: "{navigation.item.padding}"
  },
  item: {
    focusBackground: "{navigation.item.focus.background}",
    activeBackground: "{navigation.item.active.background}",
    color: "{navigation.item.color}",
    focusColor: "{navigation.item.focus.color}",
    activeColor: "{navigation.item.active.color}",
    padding: "{navigation.item.padding}",
    borderRadius: "{navigation.item.border.radius}",
    gap: "{navigation.item.gap}",
    icon: {
      color: "{navigation.item.icon.color}",
      focusColor: "{navigation.item.icon.focus.color}",
      activeColor: "{navigation.item.icon.active.color}"
    }
  },
  submenu: {
    padding: "{navigation.list.padding}",
    gap: "{navigation.list.gap}",
    background: "{content.background}",
    borderColor: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    shadow: "{overlay.navigation.shadow}",
    mobileIndent: "1rem"
  },
  submenuIcon: {
    size: "{navigation.submenu.icon.size}",
    color: "{navigation.submenu.icon.color}",
    focusColor: "{navigation.submenu.icon.focus.color}",
    activeColor: "{navigation.submenu.icon.active.color}"
  },
  separator: {
    borderColor: "{content.border.color}"
  },
  mobileButton: {
    borderRadius: "50%",
    size: "1.75rem",
    color: "{text.muted.color}",
    hoverColor: "{text.muted.hover.color}",
    hoverBackground: "{content.hover.background}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  }
};
var index$K = {
  root: {
    borderRadius: "{content.border.radius}",
    borderWidth: "1px",
    transitionDuration: "{transition.duration}"
  },
  content: {
    padding: "0.5rem 0.75rem",
    gap: "0.5rem"
  },
  text: {
    fontSize: "1rem",
    fontWeight: "500"
  },
  icon: {
    size: "1.125rem"
  },
  closeButton: {
    width: "1.75rem",
    height: "1.75rem",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      offset: "{focus.ring.offset}"
    }
  },
  closeIcon: {
    size: "1rem"
  },
  colorScheme: {
    light: {
      info: {
        background: "color-mix(in srgb, {blue.50}, transparent 5%)",
        borderColor: "{blue.200}",
        color: "{blue.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{blue.100}",
          focusRing: {
            color: "{blue.600}",
            shadow: "none"
          }
        }
      },
      success: {
        background: "color-mix(in srgb, {green.50}, transparent 5%)",
        borderColor: "{green.200}",
        color: "{green.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{green.100}",
          focusRing: {
            color: "{green.600}",
            shadow: "none"
          }
        }
      },
      warn: {
        background: "color-mix(in srgb,{yellow.50}, transparent 5%)",
        borderColor: "{yellow.200}",
        color: "{yellow.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{yellow.100}",
          focusRing: {
            color: "{yellow.600}",
            shadow: "none"
          }
        }
      },
      error: {
        background: "color-mix(in srgb, {red.50}, transparent 5%)",
        borderColor: "{red.200}",
        color: "{red.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{red.100}",
          focusRing: {
            color: "{red.600}",
            shadow: "none"
          }
        }
      },
      secondary: {
        background: "{surface.100}",
        borderColor: "{surface.200}",
        color: "{surface.600}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{surface.200}",
          focusRing: {
            color: "{surface.600}",
            shadow: "none"
          }
        }
      },
      contrast: {
        background: "{surface.900}",
        borderColor: "{surface.950}",
        color: "{surface.50}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",
        closeButton: {
          hoverBackground: "{surface.800}",
          focusRing: {
            color: "{surface.50}",
            shadow: "none"
          }
        }
      }
    },
    dark: {
      info: {
        background: "color-mix(in srgb, {blue.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)",
        color: "{blue.500}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "rgba(255, 255, 255, 0.05)",
          focusRing: {
            color: "{blue.500}",
            shadow: "none"
          }
        }
      },
      success: {
        background: "color-mix(in srgb, {green.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {green.700}, transparent 64%)",
        color: "{green.500}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "rgba(255, 255, 255, 0.05)",
          focusRing: {
            color: "{green.500}",
            shadow: "none"
          }
        }
      },
      warn: {
        background: "color-mix(in srgb, {yellow.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)",
        color: "{yellow.500}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "rgba(255, 255, 255, 0.05)",
          focusRing: {
            color: "{yellow.500}",
            shadow: "none"
          }
        }
      },
      error: {
        background: "color-mix(in srgb, {red.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {red.700}, transparent 64%)",
        color: "{red.500}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "rgba(255, 255, 255, 0.05)",
          focusRing: {
            color: "{red.500}",
            shadow: "none"
          }
        }
      },
      secondary: {
        background: "{surface.800}",
        borderColor: "{surface.700}",
        color: "{surface.300}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{surface.700}",
          focusRing: {
            color: "{surface.300}",
            shadow: "none"
          }
        }
      },
      contrast: {
        background: "{surface.0}",
        borderColor: "{surface.100}",
        color: "{surface.950}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",
        closeButton: {
          hoverBackground: "{surface.100}",
          focusRing: {
            color: "{surface.950}",
            shadow: "none"
          }
        }
      }
    }
  }
};
var index$J = {
  root: {
    borderRadius: "{content.border.radius}",
    gap: "1rem"
  },
  meters: {
    background: "{content.border.color}",
    size: "0.5rem"
  },
  label: {
    gap: "0.5rem"
  },
  labelMarker: {
    size: "0.5rem"
  },
  labelIcon: {
    size: "1rem"
  },
  labelList: {
    verticalGap: "0.5rem",
    horizontalGap: "1rem"
  }
};
var index$I = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    filledFocusBackground: "{form.field.filled.focus.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    placeholderColor: "{form.field.placeholder.color}",
    shadow: "{form.field.shadow}",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  dropdown: {
    width: "2.5rem",
    color: "{form.field.icon.color}"
  },
  overlay: {
    background: "{overlay.select.background}",
    borderColor: "{overlay.select.border.color}",
    borderRadius: "{overlay.select.border.radius}",
    color: "{overlay.select.color}",
    shadow: "{overlay.select.shadow}"
  },
  list: {
    padding: "{list.padding}",
    gap: "{list.gap}",
    header: {
      padding: "{list.header.padding}"
    }
  },
  option: {
    focusBackground: "{list.option.focus.background}",
    selectedBackground: "{list.option.selected.background}",
    selectedFocusBackground: "{list.option.selected.focus.background}",
    color: "{list.option.color}",
    focusColor: "{list.option.focus.color}",
    selectedColor: "{list.option.selected.color}",
    selectedFocusColor: "{list.option.selected.focus.color}",
    padding: "{list.option.padding}",
    borderRadius: "{list.option.border.radius}",
    gap: "0.5rem"
  },
  optionGroup: {
    background: "{list.option.group.background}",
    color: "{list.option.group.color}",
    fontWeight: "{list.option.group.font.weight}",
    padding: "{list.option.group.padding}"
  },
  chip: {
    borderRadius: "{border.radius.sm}"
  },
  emptyMessage: {
    padding: "{list.option.padding}"
  }
};
var index$H = {
  root: {
    gap: "1.125rem"
  },
  controls: {
    gap: "0.5rem"
  }
};
var index$G = {
  root: {
    gutter: "0.75rem",
    transitionDuration: "{transition.duration}"
  },
  node: {
    background: "{content.background}",
    hoverBackground: "{content.hover.background}",
    selectedBackground: "{highlight.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    selectedColor: "{highlight.color}",
    hoverColor: "{content.hover.color}",
    padding: "0.75rem 1rem",
    toggleablePadding: "0.75rem 1rem 1.25rem 1rem",
    borderRadius: "{content.border.radius}"
  },
  nodeToggleButton: {
    background: "{content.background}",
    hoverBackground: "{content.hover.background}",
    borderColor: "{content.border.color}",
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    size: "1.5rem",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  connector: {
    color: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    height: "24px"
  }
};
var index$F = {
  root: {
    outline: {
      width: "2px",
      color: "{content.background}"
    }
  }
};
var index$E = {
  root: {
    padding: "0.5rem 1rem",
    gap: "0.25rem",
    borderRadius: "{content.border.radius}",
    background: "{content.background}",
    color: "{content.color}",
    transitionDuration: "{transition.duration}"
  },
  navButton: {
    background: "transparent",
    hoverBackground: "{content.hover.background}",
    selectedBackground: "{highlight.background}",
    color: "{text.muted.color}",
    hoverColor: "{text.hover.muted.color}",
    selectedColor: "{highlight.color}",
    width: "2.5rem",
    height: "2.5rem",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  currentPageReport: {
    color: "{text.muted.color}"
  },
  jumpToPageInput: {
    maxWidth: "2.5rem"
  }
};
var index$D = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    borderRadius: "{content.border.radius}"
  },
  header: {
    background: "transparent",
    color: "{text.color}",
    padding: "1.125rem",
    borderColor: "{content.border.color}",
    borderWidth: "0",
    borderRadius: "0"
  },
  toggleableHeader: {
    padding: "0.375rem 1.125rem"
  },
  title: {
    fontWeight: "600"
  },
  content: {
    padding: "0 1.125rem 1.125rem 1.125rem"
  },
  footer: {
    padding: "0 1.125rem 1.125rem 1.125rem"
  }
};
var index$C = {
  root: {
    gap: "0.5rem",
    transitionDuration: "{transition.duration}"
  },
  panel: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    borderWidth: "1px",
    color: "{content.color}",
    padding: "0.25rem 0.25rem",
    borderRadius: "{content.border.radius}",
    first: {
      borderWidth: "1px",
      topBorderRadius: "{content.border.radius}"
    },
    last: {
      borderWidth: "1px",
      bottomBorderRadius: "{content.border.radius}"
    }
  },
  item: {
    focusBackground: "{navigation.item.focus.background}",
    color: "{navigation.item.color}",
    focusColor: "{navigation.item.focus.color}",
    gap: "0.5rem",
    padding: "{navigation.item.padding}",
    borderRadius: "{content.border.radius}",
    icon: {
      color: "{navigation.item.icon.color}",
      focusColor: "{navigation.item.icon.focus.color}"
    }
  },
  submenu: {
    indent: "1rem"
  },
  submenuIcon: {
    color: "{navigation.submenu.icon.color}",
    focusColor: "{navigation.submenu.icon.focus.color}"
  }
};
var index$B = {
  meter: {
    background: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    height: ".75rem"
  },
  icon: {
    color: "{form.field.icon.color}"
  },
  overlay: {
    background: "{overlay.popover.background}",
    borderColor: "{overlay.popover.border.color}",
    borderRadius: "{overlay.popover.border.radius}",
    color: "{overlay.popover.color}",
    padding: "{overlay.popover.padding}",
    shadow: "{overlay.popover.shadow}"
  },
  content: {
    gap: "0.5rem"
  },
  colorScheme: {
    light: {
      strength: {
        weakBackground: "{red.500}",
        mediumBackground: "{amber.500}",
        strongBackground: "{green.500}"
      }
    },
    dark: {
      strength: {
        weakBackground: "{red.400}",
        mediumBackground: "{amber.400}",
        strongBackground: "{green.400}"
      }
    }
  }
};
var index$A = {
  root: {
    gap: "1.125rem"
  },
  controls: {
    gap: "0.5rem"
  }
};
var index$z = {
  root: {
    background: "{overlay.popover.background}",
    borderColor: "{overlay.popover.border.color}",
    color: "{overlay.popover.color}",
    borderRadius: "{overlay.popover.border.radius}",
    shadow: "{overlay.popover.shadow}",
    gutter: "10px",
    arrowOffset: "1.25rem"
  },
  content: {
    padding: "{overlay.popover.padding}"
  }
};
var index$y = {
  root: {
    background: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    height: "1.25rem"
  },
  value: {
    background: "{primary.color}"
  },
  label: {
    color: "{primary.contrast.color}",
    fontSize: "0.75rem",
    fontWeight: "600"
  }
};
var index$x = {
  colorScheme: {
    light: {
      root: {
        "color.1": "{red.500}",
        "color.2": "{blue.500}",
        "color.3": "{green.500}",
        "color.4": "{yellow.500}"
      }
    },
    dark: {
      root: {
        "color.1": "{red.400}",
        "color.2": "{blue.400}",
        "color.3": "{green.400}",
        "color.4": "{yellow.400}"
      }
    }
  }
};
var index$w = {
  root: {
    width: "1.25rem",
    height: "1.25rem",
    background: "{form.field.background}",
    checkedBackground: "{primary.color}",
    checkedHoverBackground: "{primary.hover.color}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.border.color}",
    checkedBorderColor: "{primary.color}",
    checkedHoverBorderColor: "{primary.hover.color}",
    checkedFocusBorderColor: "{primary.color}",
    checkedDisabledBorderColor: "{form.field.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    shadow: "{form.field.shadow}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  icon: {
    size: "0.75rem",
    checkedColor: "{primary.contrast.color}",
    checkedHoverColor: "{primary.contrast.color}",
    disabledColor: "{form.field.disabled.color}"
  }
};
var index$v = {
  root: {
    gap: "0.25rem",
    transitionDuration: "{transition.duration}"
  },
  icon: {
    size: "1rem",
    color: "{text.muted.color}",
    hoverColor: "{primary.color}",
    activeColor: "{primary.color}"
  }
};
var index$u = {
  colorScheme: {
    light: {
      root: {
        background: "rgba(0,0,0,0.1)"
      }
    },
    dark: {
      root: {
        background: "rgba(255,255,255,0.3)"
      }
    }
  }
};
var index$t = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  bar: {
    size: "9px",
    borderRadius: "{border.radius.sm}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  colorScheme: {
    light: {
      bar: {
        background: "{surface.100}"
      }
    },
    dark: {
      bar: {
        background: "{surface.800}"
      }
    }
  }
};
var index$s = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    filledFocusBackground: "{form.field.filled.focus.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    placeholderColor: "{form.field.placeholder.color}",
    shadow: "{form.field.shadow}",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  dropdown: {
    width: "2.5rem",
    color: "{form.field.icon.color}"
  },
  overlay: {
    background: "{overlay.select.background}",
    borderColor: "{overlay.select.border.color}",
    borderRadius: "{overlay.select.border.radius}",
    color: "{overlay.select.color}",
    shadow: "{overlay.select.shadow}"
  },
  list: {
    padding: "{list.padding}",
    gap: "{list.gap}",
    header: {
      padding: "{list.header.padding}"
    }
  },
  option: {
    focusBackground: "{list.option.focus.background}",
    selectedBackground: "{list.option.selected.background}",
    selectedFocusBackground: "{list.option.selected.focus.background}",
    color: "{list.option.color}",
    focusColor: "{list.option.focus.color}",
    selectedColor: "{list.option.selected.color}",
    selectedFocusColor: "{list.option.selected.focus.color}",
    padding: "{list.option.padding}",
    borderRadius: "{list.option.border.radius}"
  },
  optionGroup: {
    background: "{list.option.group.background}",
    color: "{list.option.group.color}",
    fontWeight: "{list.option.group.font.weight}",
    padding: "{list.option.group.padding}"
  },
  clearIcon: {
    color: "{form.field.icon.color}"
  },
  checkmark: {
    color: "{list.option.color}",
    gutterStart: "-0.375rem",
    gutterEnd: "0.375rem"
  },
  emptyMessage: {
    padding: "{list.option.padding}"
  }
};
var index$r = {
  root: {
    borderRadius: "{form.field.border.radius}"
  },
  colorScheme: {
    light: {
      root: {
        invalidBorderColor: "{form.field.invalid.border.color}"
      }
    },
    dark: {
      root: {
        invalidBorderColor: "{form.field.invalid.border.color}"
      }
    }
  }
};
var index$q = {
  root: {
    borderRadius: "{content.border.radius}"
  },
  colorScheme: {
    light: {
      root: {
        background: "{surface.200}",
        animationBackground: "rgba(255,255,255,0.4)"
      }
    },
    dark: {
      root: {
        background: "rgba(255, 255, 255, 0.06)",
        animationBackground: "rgba(255, 255, 255, 0.04)"
      }
    }
  }
};
var index$p = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  track: {
    background: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    size: "3px"
  },
  range: {
    background: "{primary.color}"
  },
  handle: {
    width: "20px",
    height: "20px",
    borderRadius: "50%",
    background: "{content.border.color}",
    hoverBackground: "{content.border.color}",
    content: {
      borderRadius: "50%",
      hoverBackground: "{content.background}",
      width: "16px",
      height: "16px",
      shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.08), 0px 1px 1px 0px rgba(0, 0, 0, 0.14)"
    },
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  colorScheme: {
    light: {
      handle: {
        contentBackground: "{surface.0}"
      }
    },
    dark: {
      handle: {
        contentBackground: "{surface.950}"
      }
    }
  }
};
var index$o = {
  root: {
    gap: "0.5rem",
    transitionDuration: "{transition.duration}"
  }
};
var index$n = {
  root: {
    borderRadius: "{form.field.border.radius}",
    roundedBorderRadius: "2rem",
    raisedShadow: "0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)"
  }
};
var index$m = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    transitionDuration: "{transition.duration}"
  },
  gutter: {
    background: "{content.border.color}"
  },
  handle: {
    size: "24px",
    background: "transparent",
    borderRadius: "{content.border.radius}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  }
};
var index$l = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  separator: {
    background: "{content.border.color}",
    activeBackground: "{primary.color}",
    margin: "0 0 0 1.625rem",
    size: "2px"
  },
  step: {
    padding: "0.5rem",
    gap: "1rem"
  },
  stepHeader: {
    padding: "0",
    borderRadius: "{content.border.radius}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    },
    gap: "0.5rem"
  },
  stepTitle: {
    color: "{text.muted.color}",
    activeColor: "{primary.color}",
    fontWeight: "500"
  },
  stepNumber: {
    background: "{content.background}",
    activeBackground: "{content.background}",
    borderColor: "{content.border.color}",
    activeBorderColor: "{content.border.color}",
    color: "{text.muted.color}",
    activeColor: "{primary.color}",
    size: "2rem",
    fontSize: "1.143rem",
    fontWeight: "500",
    borderRadius: "50%",
    shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)"
  },
  steppanels: {
    padding: "0.875rem 0.5rem 1.125rem 0.5rem"
  },
  steppanel: {
    background: "{content.background}",
    color: "{content.color}",
    padding: "0 0 0 1rem"
  }
};
var index$k = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  separator: {
    background: "{content.border.color}"
  },
  itemLink: {
    borderRadius: "{content.border.radius}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    },
    gap: "0.5rem"
  },
  itemLabel: {
    color: "{text.muted.color}",
    activeColor: "{primary.color}",
    fontWeight: "500"
  },
  itemNumber: {
    background: "{content.background}",
    activeBackground: "{content.background}",
    borderColor: "{content.border.color}",
    activeBorderColor: "{content.border.color}",
    color: "{text.muted.color}",
    activeColor: "{primary.color}",
    size: "2rem",
    fontSize: "1.143rem",
    fontWeight: "500",
    borderRadius: "50%",
    shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)"
  }
};
var index$j = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  tablist: {
    borderWidth: "0 0 1px 0",
    background: "{content.background}",
    borderColor: "{content.border.color}"
  },
  item: {
    background: "transparent",
    hoverBackground: "transparent",
    activeBackground: "transparent",
    borderWidth: "0 0 1px 0",
    borderColor: "{content.border.color}",
    hoverBorderColor: "{content.border.color}",
    activeBorderColor: "{primary.color}",
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    activeColor: "{primary.color}",
    padding: "1rem 1.125rem",
    fontWeight: "600",
    margin: "0 0 -1px 0",
    gap: "0.5rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  itemIcon: {
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    activeColor: "{primary.color}"
  },
  activeBar: {
    height: "1px",
    bottom: "-1px",
    background: "{primary.color}"
  }
};
var index$i = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  tablist: {
    borderWidth: "0 0 1px 0",
    background: "{content.background}",
    borderColor: "{content.border.color}"
  },
  tab: {
    background: "transparent",
    hoverBackground: "transparent",
    activeBackground: "transparent",
    borderWidth: "0 0 1px 0",
    borderColor: "{content.border.color}",
    hoverBorderColor: "{content.border.color}",
    activeBorderColor: "{primary.color}",
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    activeColor: "{primary.color}",
    padding: "1rem 1.125rem",
    fontWeight: "600",
    margin: "0 0 -1px 0",
    gap: "0.5rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "-1px",
      shadow: "{focus.ring.shadow}"
    }
  },
  tabpanel: {
    background: "{content.background}",
    color: "{content.color}",
    padding: "0.875rem 1.125rem 1.125rem 1.125rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "inset {focus.ring.shadow}"
    }
  },
  navButton: {
    background: "{content.background}",
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    width: "2.5rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "-1px",
      shadow: "{focus.ring.shadow}"
    }
  },
  activeBar: {
    height: "1px",
    bottom: "-1px",
    background: "{primary.color}"
  },
  colorScheme: {
    light: {
      navButton: {
        shadow: "0px 0px 10px 50px rgba(255, 255, 255, 0.6)"
      }
    },
    dark: {
      navButton: {
        shadow: "0px 0px 10px 50px color-mix(in srgb, {content.background}, transparent 50%)"
      }
    }
  }
};
var index$h = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  tabList: {
    background: "{content.background}",
    borderColor: "{content.border.color}"
  },
  tab: {
    borderColor: "{content.border.color}",
    activeBorderColor: "{primary.color}",
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    activeColor: "{primary.color}"
  },
  tabPanel: {
    background: "{content.background}",
    color: "{content.color}"
  },
  navButton: {
    background: "{content.background}",
    color: "{text.muted.color}",
    hoverColor: "{text.color}"
  },
  colorScheme: {
    light: {
      navButton: {
        shadow: "0px 0px 10px 50px rgba(255, 255, 255, 0.6)"
      }
    },
    dark: {
      navButton: {
        shadow: "0px 0px 10px 50px color-mix(in srgb, {content.background}, transparent 50%)"
      }
    }
  }
};
var index$g = {
  root: {
    fontSize: "0.875rem",
    fontWeight: "700",
    padding: "0.25rem 0.5rem",
    gap: "0.25rem",
    borderRadius: "{content.border.radius}",
    roundedBorderRadius: "{border.radius.xl}"
  },
  icon: {
    size: "0.75rem"
  },
  colorScheme: {
    light: {
      primary: {
        background: "{primary.100}",
        color: "{primary.700}"
      },
      secondary: {
        background: "{surface.100}",
        color: "{surface.600}"
      },
      success: {
        background: "{green.100}",
        color: "{green.700}"
      },
      info: {
        background: "{sky.100}",
        color: "{sky.700}"
      },
      warn: {
        background: "{orange.100}",
        color: "{orange.700}"
      },
      danger: {
        background: "{red.100}",
        color: "{red.700}"
      },
      contrast: {
        background: "{surface.950}",
        color: "{surface.0}"
      }
    },
    dark: {
      primary: {
        background: "color-mix(in srgb, {primary.500}, transparent 84%)",
        color: "{primary.300}"
      },
      secondary: {
        background: "{surface.800}",
        color: "{surface.300}"
      },
      success: {
        background: "color-mix(in srgb, {green.500}, transparent 84%)",
        color: "{green.300}"
      },
      info: {
        background: "color-mix(in srgb, {sky.500}, transparent 84%)",
        color: "{sky.300}"
      },
      warn: {
        background: "color-mix(in srgb, {orange.500}, transparent 84%)",
        color: "{orange.300}"
      },
      danger: {
        background: "color-mix(in srgb, {red.500}, transparent 84%)",
        color: "{red.300}"
      },
      contrast: {
        background: "{surface.0}",
        color: "{surface.950}"
      }
    }
  }
};
var index$f = {
  root: {
    background: "{form.field.background}",
    borderColor: "{form.field.border.color}",
    color: "{form.field.color}",
    height: "18rem",
    padding: "{form.field.padding.y} {form.field.padding.x}",
    borderRadius: "{form.field.border.radius}"
  },
  prompt: {
    gap: "0.25rem"
  },
  commandResponse: {
    margin: "2px 0"
  }
};
var index$e = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    filledFocusBackground: "{form.field.filled.focus.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    placeholderColor: "{form.field.placeholder.color}",
    shadow: "{form.field.shadow}",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  }
};
var index$d = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    color: "{content.color}",
    borderRadius: "{content.border.radius}",
    shadow: "{overlay.navigation.shadow}",
    transitionDuration: "{transition.duration}"
  },
  list: {
    padding: "{navigation.list.padding}",
    gap: "{navigation.list.gap}"
  },
  item: {
    focusBackground: "{navigation.item.focus.background}",
    activeBackground: "{navigation.item.active.background}",
    color: "{navigation.item.color}",
    focusColor: "{navigation.item.focus.color}",
    activeColor: "{navigation.item.active.color}",
    padding: "{navigation.item.padding}",
    borderRadius: "{navigation.item.border.radius}",
    gap: "{navigation.item.gap}",
    icon: {
      color: "{navigation.item.icon.color}",
      focusColor: "{navigation.item.icon.focus.color}",
      activeColor: "{navigation.item.icon.active.color}"
    }
  },
  submenuLabel: {
    padding: "{navigation.submenu.label.padding}",
    fontWeight: "{navigation.submenu.label.font.weight}",
    background: "{navigation.submenu.label.background.}",
    color: "{navigation.submenu.label.color}"
  },
  submenuIcon: {
    size: "{navigation.submenu.icon.size}",
    color: "{navigation.submenu.icon.color}",
    focusColor: "{navigation.submenu.icon.focus.color}",
    activeColor: "{navigation.submenu.icon.active.color}"
  },
  separator: {
    borderColor: "{content.border.color}"
  }
};
var index$c = {
  event: {
    minHeight: "5rem"
  },
  horizontal: {
    eventContent: {
      padding: "1rem 0"
    }
  },
  vertical: {
    eventContent: {
      padding: "0 1rem"
    }
  },
  eventMarker: {
    size: "1.125rem",
    borderRadius: "50%",
    borderWidth: "2px",
    background: "{content.background}",
    borderColor: "{content.border.color}",
    content: {
      borderRadius: "50%",
      size: "0.375rem",
      background: "{primary.color}",
      insetShadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)"
    }
  },
  eventConnector: {
    color: "{content.border.color}",
    size: "2px"
  }
};
var index$b = {
  root: {
    width: "25rem",
    borderRadius: "{content.border.radius}",
    borderWidth: "1px",
    transitionDuration: "{transition.duration}"
  },
  icon: {
    size: "1.125rem"
  },
  content: {
    padding: "{overlay.popover.padding}",
    gap: "0.5rem"
  },
  text: {
    gap: "0.5rem"
  },
  summary: {
    fontWeight: "500",
    fontSize: "1rem"
  },
  detail: {
    fontWeight: "500",
    fontSize: "0.875rem"
  },
  closeButton: {
    width: "1.75rem",
    height: "1.75rem",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      offset: "{focus.ring.offset}"
    }
  },
  closeIcon: {
    size: "1rem"
  },
  colorScheme: {
    light: {
      blur: "1.5px",
      info: {
        background: "color-mix(in srgb, {blue.50}, transparent 5%)",
        borderColor: "{blue.200}",
        color: "{blue.600}",
        detailColor: "{surface.700}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{blue.100}",
          focusRing: {
            color: "{blue.600}",
            shadow: "none"
          }
        }
      },
      success: {
        background: "color-mix(in srgb, {green.50}, transparent 5%)",
        borderColor: "{green.200}",
        color: "{green.600}",
        detailColor: "{surface.700}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{green.100}",
          focusRing: {
            color: "{green.600}",
            shadow: "none"
          }
        }
      },
      warn: {
        background: "color-mix(in srgb,{yellow.50}, transparent 5%)",
        borderColor: "{yellow.200}",
        color: "{yellow.600}",
        detailColor: "{surface.700}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{yellow.100}",
          focusRing: {
            color: "{yellow.600}",
            shadow: "none"
          }
        }
      },
      error: {
        background: "color-mix(in srgb, {red.50}, transparent 5%)",
        borderColor: "{red.200}",
        color: "{red.600}",
        detailColor: "{surface.700}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{red.100}",
          focusRing: {
            color: "{red.600}",
            shadow: "none"
          }
        }
      },
      secondary: {
        background: "{surface.100}",
        borderColor: "{surface.200}",
        color: "{surface.600}",
        detailColor: "{surface.700}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{surface.200}",
          focusRing: {
            color: "{surface.600}",
            shadow: "none"
          }
        }
      },
      contrast: {
        background: "{surface.900}",
        borderColor: "{surface.950}",
        color: "{surface.50}",
        detailColor: "{surface.0}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",
        closeButton: {
          hoverBackground: "{surface.800}",
          focusRing: {
            color: "{surface.50}",
            shadow: "none"
          }
        }
      }
    },
    dark: {
      blur: "10px",
      info: {
        background: "color-mix(in srgb, {blue.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)",
        color: "{blue.500}",
        detailColor: "{surface.0}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "rgba(255, 255, 255, 0.05)",
          focusRing: {
            color: "{blue.500}",
            shadow: "none"
          }
        }
      },
      success: {
        background: "color-mix(in srgb, {green.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {green.700}, transparent 64%)",
        color: "{green.500}",
        detailColor: "{surface.0}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "rgba(255, 255, 255, 0.05)",
          focusRing: {
            color: "{green.500}",
            shadow: "none"
          }
        }
      },
      warn: {
        background: "color-mix(in srgb, {yellow.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)",
        color: "{yellow.500}",
        detailColor: "{surface.0}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "rgba(255, 255, 255, 0.05)",
          focusRing: {
            color: "{yellow.500}",
            shadow: "none"
          }
        }
      },
      error: {
        background: "color-mix(in srgb, {red.500}, transparent 84%)",
        borderColor: "color-mix(in srgb, {red.700}, transparent 64%)",
        color: "{red.500}",
        detailColor: "{surface.0}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "rgba(255, 255, 255, 0.05)",
          focusRing: {
            color: "{red.500}",
            shadow: "none"
          }
        }
      },
      secondary: {
        background: "{surface.800}",
        borderColor: "{surface.700}",
        color: "{surface.300}",
        detailColor: "{surface.0}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)",
        closeButton: {
          hoverBackground: "{surface.700}",
          focusRing: {
            color: "{surface.300}",
            shadow: "none"
          }
        }
      },
      contrast: {
        background: "{surface.0}",
        borderColor: "{surface.100}",
        color: "{surface.950}",
        detailColor: "{surface.950}",
        shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)",
        closeButton: {
          hoverBackground: "{surface.100}",
          focusRing: {
            color: "{surface.950}",
            shadow: "none"
          }
        }
      }
    }
  }
};
var index$a = {
  root: {
    padding: "0.5rem 1rem",
    borderRadius: "{content.border.radius}",
    gap: "0.5rem",
    fontWeight: "500",
    disabledBackground: "{form.field.disabled.background}",
    disabledBorderColor: "{form.field.disabled.background}",
    disabledColor: "{form.field.disabled.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  icon: {
    disabledColor: "{form.field.disabled.color}"
  },
  content: {
    left: "0.25rem",
    top: "0.25rem",
    checkedShadow: "0px 1px 2px 0px rgba(0, 0, 0, 0.02), 0px 1px 2px 0px rgba(0, 0, 0, 0.04)"
  },
  colorScheme: {
    light: {
      root: {
        background: "{surface.100}",
        checkedBackground: "{surface.100}",
        hoverBackground: "{surface.100}",
        borderColor: "{surface.100}",
        color: "{surface.500}",
        hoverColor: "{surface.700}",
        checkedColor: "{surface.900}",
        checkedBorderColor: "{surface.100}"
      },
      content: {
        checkedBackground: "{surface.0}"
      },
      icon: {
        color: "{surface.500}",
        hoverColor: "{surface.700}",
        checkedColor: "{surface.900}"
      }
    },
    dark: {
      root: {
        background: "{surface.950}",
        checkedBackground: "{surface.950}",
        hoverBackground: "{surface.950}",
        borderColor: "{surface.950}",
        color: "{surface.400}",
        hoverColor: "{surface.300}",
        checkedColor: "{surface.0}",
        checkedBorderColor: "{surface.950}"
      },
      content: {
        checkedBackground: "{surface.800}"
      },
      icon: {
        color: "{surface.400}",
        hoverColor: "{surface.300}",
        checkedColor: "{surface.0}"
      }
    }
  }
};
var index$9 = {
  root: {
    width: "2.5rem",
    height: "1.5rem",
    borderRadius: "30px",
    gap: "0.25rem",
    shadow: "{form.field.shadow}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    },
    borderWidth: "1px",
    borderColor: "transparent",
    hoverBorderColor: "transparent",
    checkedBorderColor: "transparent",
    checkedHoverBorderColor: "transparent",
    invalidBorderColor: "{form.field.invalid.border.color}",
    transitionDuration: "{form.field.transition.duration}",
    slideDuration: "0.2s",
    disabledBackground: "{form.field.disabled.background}"
  },
  handle: {
    borderRadius: "50%",
    size: "1rem",
    disabledBackground: "{form.field.disabled.color}"
  },
  colorScheme: {
    light: {
      root: {
        background: "{surface.300}",
        hoverBackground: "{surface.400}",
        checkedBackground: "{primary.color}",
        checkedHoverBackground: "{primary.hover.color}"
      },
      handle: {
        background: "{surface.0}",
        hoverBackground: "{surface.0}",
        checkedBackground: "{surface.0}",
        checkedHoverBackground: "{surface.0}"
      }
    },
    dark: {
      root: {
        background: "{surface.700}",
        hoverBackground: "{surface.600}",
        checkedBackground: "{primary.color}",
        checkedHoverBackground: "{primary.hover.color}"
      },
      handle: {
        background: "{surface.400}",
        hoverBackground: "{surface.300}",
        checkedBackground: "{surface.900}",
        checkedHoverBackground: "{surface.900}"
      }
    }
  }
};
var index$8 = {
  root: {
    background: "{content.background}",
    borderColor: "{content.border.color}",
    borderRadius: "{content.border.radius}",
    color: "{content.color}",
    gap: "0.5rem",
    padding: "0.75rem"
  }
};
var index$7 = {
  root: {
    maxWidth: "12.5rem",
    gutter: "0.25rem",
    shadow: "{overlay.popover.shadow}",
    padding: "0.5rem 0.75rem",
    borderRadius: "{overlay.popover.border.radius}"
  },
  colorScheme: {
    light: {
      root: {
        background: "{surface.700}",
        color: "{surface.0}"
      }
    },
    dark: {
      root: {
        background: "{surface.700}",
        color: "{surface.0}"
      }
    }
  }
};
var index$6 = {
  root: {
    background: "{content.background}",
    color: "{content.color}",
    padding: "1rem",
    gap: "2px",
    indent: "1rem",
    transitionDuration: "{transition.duration}"
  },
  node: {
    padding: "0.25rem 0.5rem",
    borderRadius: "{content.border.radius}",
    hoverBackground: "{content.hover.background}",
    selectedBackground: "{highlight.background}",
    color: "{text.color}",
    hoverColor: "{text.hover.color}",
    selectedColor: "{highlight.color}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "-1px",
      shadow: "{focus.ring.shadow}"
    },
    gap: "0.25rem"
  },
  nodeIcon: {
    color: "{text.muted.color}",
    hoverColor: "{text.hover.muted.color}",
    selectedColor: "{highlight.color}"
  },
  nodeToggleButton: {
    borderRadius: "50%",
    size: "1.75rem",
    hoverBackground: "{content.hover.background}",
    selectedHoverBackground: "{content.background}",
    color: "{text.muted.color}",
    hoverColor: "{text.hover.muted.color}",
    selectedHoverColor: "{primary.color}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  loadingIcon: {
    size: "2rem"
  }
};
var index$5 = {
  root: {
    background: "{form.field.background}",
    disabledBackground: "{form.field.disabled.background}",
    filledBackground: "{form.field.filled.background}",
    filledFocusBackground: "{form.field.filled.focus.background}",
    borderColor: "{form.field.border.color}",
    hoverBorderColor: "{form.field.hover.border.color}",
    focusBorderColor: "{form.field.focus.border.color}",
    invalidBorderColor: "{form.field.invalid.border.color}",
    color: "{form.field.color}",
    disabledColor: "{form.field.disabled.color}",
    placeholderColor: "{form.field.placeholder.color}",
    shadow: "{form.field.shadow}",
    paddingX: "{form.field.padding.x}",
    paddingY: "{form.field.padding.y}",
    borderRadius: "{form.field.border.radius}",
    focusRing: {
      width: "{form.field.focus.ring.width}",
      style: "{form.field.focus.ring.style}",
      color: "{form.field.focus.ring.color}",
      offset: "{form.field.focus.ring.offset}",
      shadow: "{form.field.focus.ring.shadow}"
    },
    transitionDuration: "{form.field.transition.duration}"
  },
  dropdown: {
    width: "2.5rem",
    color: "{form.field.icon.color}"
  },
  overlay: {
    background: "{overlay.select.background}",
    borderColor: "{overlay.select.border.color}",
    borderRadius: "{overlay.select.border.radius}",
    color: "{overlay.select.color}",
    shadow: "{overlay.select.shadow}"
  },
  tree: {
    padding: "{list.padding}"
  },
  emptyMessage: {
    padding: "{list.option.padding}"
  },
  chip: {
    borderRadius: "{border.radius.sm}"
  }
};
var index$4 = {
  root: {
    transitionDuration: "{transition.duration}"
  },
  header: {
    background: "{content.background}",
    borderColor: "{treetable.border.color}",
    color: "{content.color}",
    borderWidth: "0 0 1px 0",
    padding: "0.75rem 1rem"
  },
  headerCell: {
    background: "{content.background}",
    hoverBackground: "{content.hover.background}",
    selectedBackground: "{highlight.background}",
    borderColor: "{treetable.border.color}",
    color: "{content.color}",
    hoverColor: "{content.hover.color}",
    selectedColor: "{highlight.color}",
    gap: "0.5rem",
    padding: "0.75rem 1rem",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "-1px",
      shadow: "{focus.ring.shadow}"
    }
  },
  columnTitle: {
    fontWeight: "600"
  },
  row: {
    background: "{content.background}",
    hoverBackground: "{content.hover.background}",
    selectedBackground: "{highlight.background}",
    color: "{content.color}",
    hoverColor: "{content.hover.color}",
    selectedColor: "{highlight.color}",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "-1px",
      shadow: "{focus.ring.shadow}"
    }
  },
  bodyCell: {
    borderColor: "{treetable.border.color}",
    padding: "0.75rem 1rem",
    gap: "0.5rem"
  },
  footerCell: {
    background: "{content.background}",
    borderColor: "{treetable.border.color}",
    color: "{content.color}",
    padding: "0.75rem 1rem"
  },
  columnFooter: {
    fontWeight: "600"
  },
  footer: {
    background: "{content.background}",
    borderColor: "{treetable.border.color}",
    color: "{content.color}",
    borderWidth: "0 0 1px 0",
    padding: "0.75rem 1rem"
  },
  columnResizerWidth: "0.5rem",
  resizeIndicator: {
    width: "1px",
    color: "{primary.color}"
  },
  sortIcon: {
    color: "{text.muted.color}",
    hoverColor: "{text.hover.muted.color}"
  },
  loadingIcon: {
    size: "2rem"
  },
  nodeToggleButton: {
    hoverBackground: "{content.hover.background}",
    selectedHoverBackground: "{content.background}",
    color: "{text.muted.color}",
    hoverColor: "{text.color}",
    selectedHoverColor: "{primary.color}",
    size: "1.75rem",
    borderRadius: "50%",
    focusRing: {
      width: "{focus.ring.width}",
      style: "{focus.ring.style}",
      color: "{focus.ring.color}",
      offset: "{focus.ring.offset}",
      shadow: "{focus.ring.shadow}"
    }
  },
  paginatorTop: {
    borderColor: "{content.border.color}",
    borderWidth: "0 0 1px 0"
  },
  paginatorBottom: {
    borderColor: "{content.border.color}",
    borderWidth: "0 0 1px 0"
  },
  colorScheme: {
    light: {
      root: {
        borderColor: "{content.border.color}"
      },
      bodyCell: {
        selectedBorderColor: "{primary.100}"
      }
    },
    dark: {
      root: {
        borderColor: "{surface.800}"
      },
      bodyCell: {
        selectedBorderColor: "{primary.900}"
      }
    }
  }
};
var index$3 = {
  loader: {
    mask: {
      background: "{content.background}",
      color: "{text.muted.color}"
    },
    icon: {
      size: "2rem"
    }
  }
};
var index$2 = {
  primitive: {
    borderRadius: {
      none: "0",
      xs: "2px",
      sm: "4px",
      md: "6px",
      lg: "8px",
      xl: "12px"
    },
    emerald: {
      50: "#ecfdf5",
      100: "#d1fae5",
      200: "#a7f3d0",
      300: "#6ee7b7",
      400: "#34d399",
      500: "#10b981",
      600: "#059669",
      700: "#047857",
      800: "#065f46",
      900: "#064e3b",
      950: "#022c22"
    },
    green: {
      50: "#f0fdf4",
      100: "#dcfce7",
      200: "#bbf7d0",
      300: "#86efac",
      400: "#4ade80",
      500: "#22c55e",
      600: "#16a34a",
      700: "#15803d",
      800: "#166534",
      900: "#14532d",
      950: "#052e16"
    },
    lime: {
      50: "#f7fee7",
      100: "#ecfccb",
      200: "#d9f99d",
      300: "#bef264",
      400: "#a3e635",
      500: "#84cc16",
      600: "#65a30d",
      700: "#4d7c0f",
      800: "#3f6212",
      900: "#365314",
      950: "#1a2e05"
    },
    red: {
      50: "#fef2f2",
      100: "#fee2e2",
      200: "#fecaca",
      300: "#fca5a5",
      400: "#f87171",
      500: "#ef4444",
      600: "#dc2626",
      700: "#b91c1c",
      800: "#991b1b",
      900: "#7f1d1d",
      950: "#450a0a"
    },
    orange: {
      50: "#fff7ed",
      100: "#ffedd5",
      200: "#fed7aa",
      300: "#fdba74",
      400: "#fb923c",
      500: "#f97316",
      600: "#ea580c",
      700: "#c2410c",
      800: "#9a3412",
      900: "#7c2d12",
      950: "#431407"
    },
    amber: {
      50: "#fffbeb",
      100: "#fef3c7",
      200: "#fde68a",
      300: "#fcd34d",
      400: "#fbbf24",
      500: "#f59e0b",
      600: "#d97706",
      700: "#b45309",
      800: "#92400e",
      900: "#78350f",
      950: "#451a03"
    },
    yellow: {
      50: "#fefce8",
      100: "#fef9c3",
      200: "#fef08a",
      300: "#fde047",
      400: "#facc15",
      500: "#eab308",
      600: "#ca8a04",
      700: "#a16207",
      800: "#854d0e",
      900: "#713f12",
      950: "#422006"
    },
    teal: {
      50: "#f0fdfa",
      100: "#ccfbf1",
      200: "#99f6e4",
      300: "#5eead4",
      400: "#2dd4bf",
      500: "#14b8a6",
      600: "#0d9488",
      700: "#0f766e",
      800: "#115e59",
      900: "#134e4a",
      950: "#042f2e"
    },
    cyan: {
      50: "#ecfeff",
      100: "#cffafe",
      200: "#a5f3fc",
      300: "#67e8f9",
      400: "#22d3ee",
      500: "#06b6d4",
      600: "#0891b2",
      700: "#0e7490",
      800: "#155e75",
      900: "#164e63",
      950: "#083344"
    },
    sky: {
      50: "#f0f9ff",
      100: "#e0f2fe",
      200: "#bae6fd",
      300: "#7dd3fc",
      400: "#38bdf8",
      500: "#0ea5e9",
      600: "#0284c7",
      700: "#0369a1",
      800: "#075985",
      900: "#0c4a6e",
      950: "#082f49"
    },
    blue: {
      50: "#eff6ff",
      100: "#dbeafe",
      200: "#bfdbfe",
      300: "#93c5fd",
      400: "#60a5fa",
      500: "#3b82f6",
      600: "#2563eb",
      700: "#1d4ed8",
      800: "#1e40af",
      900: "#1e3a8a",
      950: "#172554"
    },
    indigo: {
      50: "#eef2ff",
      100: "#e0e7ff",
      200: "#c7d2fe",
      300: "#a5b4fc",
      400: "#818cf8",
      500: "#6366f1",
      600: "#4f46e5",
      700: "#4338ca",
      800: "#3730a3",
      900: "#312e81",
      950: "#1e1b4b"
    },
    violet: {
      50: "#f5f3ff",
      100: "#ede9fe",
      200: "#ddd6fe",
      300: "#c4b5fd",
      400: "#a78bfa",
      500: "#8b5cf6",
      600: "#7c3aed",
      700: "#6d28d9",
      800: "#5b21b6",
      900: "#4c1d95",
      950: "#2e1065"
    },
    purple: {
      50: "#faf5ff",
      100: "#f3e8ff",
      200: "#e9d5ff",
      300: "#d8b4fe",
      400: "#c084fc",
      500: "#a855f7",
      600: "#9333ea",
      700: "#7e22ce",
      800: "#6b21a8",
      900: "#581c87",
      950: "#3b0764"
    },
    fuchsia: {
      50: "#fdf4ff",
      100: "#fae8ff",
      200: "#f5d0fe",
      300: "#f0abfc",
      400: "#e879f9",
      500: "#d946ef",
      600: "#c026d3",
      700: "#a21caf",
      800: "#86198f",
      900: "#701a75",
      950: "#4a044e"
    },
    pink: {
      50: "#fdf2f8",
      100: "#fce7f3",
      200: "#fbcfe8",
      300: "#f9a8d4",
      400: "#f472b6",
      500: "#ec4899",
      600: "#db2777",
      700: "#be185d",
      800: "#9d174d",
      900: "#831843",
      950: "#500724"
    },
    rose: {
      50: "#fff1f2",
      100: "#ffe4e6",
      200: "#fecdd3",
      300: "#fda4af",
      400: "#fb7185",
      500: "#f43f5e",
      600: "#e11d48",
      700: "#be123c",
      800: "#9f1239",
      900: "#881337",
      950: "#4c0519"
    },
    slate: {
      50: "#f8fafc",
      100: "#f1f5f9",
      200: "#e2e8f0",
      300: "#cbd5e1",
      400: "#94a3b8",
      500: "#64748b",
      600: "#475569",
      700: "#334155",
      800: "#1e293b",
      900: "#0f172a",
      950: "#020617"
    },
    gray: {
      50: "#f9fafb",
      100: "#f3f4f6",
      200: "#e5e7eb",
      300: "#d1d5db",
      400: "#9ca3af",
      500: "#6b7280",
      600: "#4b5563",
      700: "#374151",
      800: "#1f2937",
      900: "#111827",
      950: "#030712"
    },
    zinc: {
      50: "#fafafa",
      100: "#f4f4f5",
      200: "#e4e4e7",
      300: "#d4d4d8",
      400: "#a1a1aa",
      500: "#71717a",
      600: "#52525b",
      700: "#3f3f46",
      800: "#27272a",
      900: "#18181b",
      950: "#09090b"
    },
    neutral: {
      50: "#fafafa",
      100: "#f5f5f5",
      200: "#e5e5e5",
      300: "#d4d4d4",
      400: "#a3a3a3",
      500: "#737373",
      600: "#525252",
      700: "#404040",
      800: "#262626",
      900: "#171717",
      950: "#0a0a0a"
    },
    stone: {
      50: "#fafaf9",
      100: "#f5f5f4",
      200: "#e7e5e4",
      300: "#d6d3d1",
      400: "#a8a29e",
      500: "#78716c",
      600: "#57534e",
      700: "#44403c",
      800: "#292524",
      900: "#1c1917",
      950: "#0c0a09"
    }
  },
  semantic: {
    transitionDuration: "0.2s",
    focusRing: {
      width: "1px",
      style: "solid",
      color: "{primary.color}",
      offset: "2px",
      shadow: "none"
    },
    disabledOpacity: "0.6",
    iconSize: "1rem",
    anchorGutter: "2px",
    primary: {
      50: "{emerald.50}",
      100: "{emerald.100}",
      200: "{emerald.200}",
      300: "{emerald.300}",
      400: "{emerald.400}",
      500: "{emerald.500}",
      600: "{emerald.600}",
      700: "{emerald.700}",
      800: "{emerald.800}",
      900: "{emerald.900}",
      950: "{emerald.950}"
    },
    formField: {
      paddingX: "0.75rem",
      paddingY: "0.5rem",
      borderRadius: "{border.radius.md}",
      focusRing: {
        width: "0",
        style: "none",
        color: "transparent",
        offset: "0",
        shadow: "none"
      },
      transitionDuration: "{transition.duration}"
    },
    list: {
      padding: "0.25rem 0.25rem",
      gap: "2px",
      header: {
        padding: "0.5rem 1rem 0.25rem 1rem"
      },
      option: {
        padding: "0.5rem 0.75rem",
        borderRadius: "{border.radius.sm}"
      },
      optionGroup: {
        padding: "0.5rem 0.75rem",
        fontWeight: "600"
      }
    },
    content: {
      borderRadius: "{border.radius.md}"
    },
    mask: {
      transitionDuration: "0.15s"
    },
    navigation: {
      list: {
        padding: "0.25rem 0.25rem",
        gap: "2px"
      },
      item: {
        padding: "0.5rem 0.75rem",
        borderRadius: "{border.radius.sm}",
        gap: "0.5rem"
      },
      submenuLabel: {
        padding: "0.5rem 0.75rem",
        fontWeight: "600"
      },
      submenuIcon: {
        size: "0.875rem"
      }
    },
    overlay: {
      select: {
        borderRadius: "{border.radius.md}",
        shadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"
      },
      popover: {
        borderRadius: "{border.radius.md}",
        padding: "0.75rem",
        shadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"
      },
      modal: {
        borderRadius: "{border.radius.xl}",
        padding: "1.25rem",
        shadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"
      },
      navigation: {
        shadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"
      }
    },
    colorScheme: {
      light: {
        surface: {
          0: "#ffffff",
          50: "{slate.50}",
          100: "{slate.100}",
          200: "{slate.200}",
          300: "{slate.300}",
          400: "{slate.400}",
          500: "{slate.500}",
          600: "{slate.600}",
          700: "{slate.700}",
          800: "{slate.800}",
          900: "{slate.900}",
          950: "{slate.950}"
        },
        primary: {
          color: "{primary.500}",
          contrastColor: "#ffffff",
          hoverColor: "{primary.600}",
          activeColor: "{primary.700}"
        },
        highlight: {
          background: "{primary.50}",
          focusBackground: "{primary.100}",
          color: "{primary.700}",
          focusColor: "{primary.800}"
        },
        mask: {
          background: "rgba(0,0,0,0.4)",
          color: "{surface.200}"
        },
        formField: {
          background: "{surface.0}",
          disabledBackground: "{surface.200}",
          filledBackground: "{surface.50}",
          filledFocusBackground: "{surface.50}",
          borderColor: "{surface.300}",
          hoverBorderColor: "{surface.400}",
          focusBorderColor: "{primary.color}",
          invalidBorderColor: "{red.400}",
          color: "{surface.700}",
          disabledColor: "{surface.500}",
          placeholderColor: "{surface.500}",
          floatLabelColor: "{surface.500}",
          floatLabelFocusColor: "{surface.500}",
          floatLabelInvalidColor: "{red.400}",
          iconColor: "{surface.400}",
          shadow: "0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)"
        },
        text: {
          color: "{surface.700}",
          hoverColor: "{surface.800}",
          mutedColor: "{surface.500}",
          hoverMutedColor: "{surface.600}"
        },
        content: {
          background: "{surface.0}",
          hoverBackground: "{surface.100}",
          borderColor: "{surface.200}",
          color: "{text.color}",
          hoverColor: "{text.hover.color}"
        },
        overlay: {
          select: {
            background: "{surface.0}",
            borderColor: "{surface.200}",
            color: "{text.color}"
          },
          popover: {
            background: "{surface.0}",
            borderColor: "{surface.200}",
            color: "{text.color}"
          },
          modal: {
            background: "{surface.0}",
            borderColor: "{surface.200}",
            color: "{text.color}"
          }
        },
        list: {
          option: {
            focusBackground: "{surface.100}",
            selectedBackground: "{highlight.background}",
            selectedFocusBackground: "{highlight.focus.background}",
            color: "{text.color}",
            focusColor: "{text.hover.color}",
            selectedColor: "{highlight.color}",
            selectedFocusColor: "{highlight.focus.color}",
            icon: {
              color: "{surface.400}",
              focusColor: "{surface.500}"
            }
          },
          optionGroup: {
            background: "transparent",
            color: "{text.muted.color}"
          }
        },
        navigation: {
          item: {
            focusBackground: "{surface.100}",
            activeBackground: "{surface.100}",
            color: "{text.color}",
            focusColor: "{text.hover.color}",
            activeColor: "{text.hover.color}",
            icon: {
              color: "{surface.400}",
              focusColor: "{surface.500}",
              activeColor: "{surface.500}"
            }
          },
          submenuLabel: {
            background: "transparent",
            color: "{text.muted.color}"
          },
          submenuIcon: {
            color: "{surface.400}",
            focusColor: "{surface.500}",
            activeColor: "{surface.500}"
          }
        }
      },
      dark: {
        surface: {
          0: "#ffffff",
          50: "{zinc.50}",
          100: "{zinc.100}",
          200: "{zinc.200}",
          300: "{zinc.300}",
          400: "{zinc.400}",
          500: "{zinc.500}",
          600: "{zinc.600}",
          700: "{zinc.700}",
          800: "{zinc.800}",
          900: "{zinc.900}",
          950: "{zinc.950}"
        },
        primary: {
          color: "{primary.400}",
          contrastColor: "{surface.900}",
          hoverColor: "{primary.300}",
          activeColor: "{primary.200}"
        },
        highlight: {
          background: "color-mix(in srgb, {primary.400}, transparent 84%)",
          focusBackground: "color-mix(in srgb, {primary.400}, transparent 76%)",
          color: "rgba(255,255,255,.87)",
          focusColor: "rgba(255,255,255,.87)"
        },
        mask: {
          background: "rgba(0,0,0,0.6)",
          color: "{surface.200}"
        },
        formField: {
          background: "{surface.950}",
          disabledBackground: "{surface.700}",
          filledBackground: "{surface.800}",
          filledFocusBackground: "{surface.800}",
          borderColor: "{surface.700}",
          hoverBorderColor: "{surface.600}",
          focusBorderColor: "{primary.color}",
          invalidBorderColor: "{red.300}",
          color: "{surface.0}",
          disabledColor: "{surface.400}",
          placeholderColor: "{surface.400}",
          floatLabelColor: "{surface.400}",
          floatLabelFocusColor: "{surface.400}",
          floatLabelInvalidColor: "{red.300}",
          iconColor: "{surface.400}",
          shadow: "0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)"
        },
        text: {
          color: "{surface.0}",
          hoverColor: "{surface.0}",
          mutedColor: "{surface.400}",
          hoverMutedColor: "{surface.300}"
        },
        content: {
          background: "{surface.900}",
          hoverBackground: "{surface.800}",
          borderColor: "{surface.700}",
          color: "{text.color}",
          hoverColor: "{text.hover.color}"
        },
        overlay: {
          select: {
            background: "{surface.900}",
            borderColor: "{surface.700}",
            color: "{text.color}"
          },
          popover: {
            background: "{surface.900}",
            borderColor: "{surface.700}",
            color: "{text.color}"
          },
          modal: {
            background: "{surface.900}",
            borderColor: "{surface.700}",
            color: "{text.color}"
          }
        },
        list: {
          option: {
            focusBackground: "{surface.800}",
            selectedBackground: "{highlight.background}",
            selectedFocusBackground: "{highlight.focus.background}",
            color: "{text.color}",
            focusColor: "{text.hover.color}",
            selectedColor: "{highlight.color}",
            selectedFocusColor: "{highlight.focus.color}",
            icon: {
              color: "{surface.500}",
              focusColor: "{surface.400}"
            }
          },
          optionGroup: {
            background: "transparent",
            color: "{text.muted.color}"
          }
        },
        navigation: {
          item: {
            focusBackground: "{surface.800}",
            activeBackground: "{surface.800}",
            color: "{text.color}",
            focusColor: "{text.hover.color}",
            activeColor: "{text.hover.color}",
            icon: {
              color: "{surface.500}",
              focusColor: "{surface.400}",
              activeColor: "{surface.400}"
            }
          },
          submenuLabel: {
            background: "transparent",
            color: "{text.muted.color}"
          },
          submenuIcon: {
            color: "{surface.500}",
            focusColor: "{surface.400}",
            activeColor: "{surface.400}"
          }
        }
      }
    }
  },
  components: {
    accordion: index$1n,
    autocomplete: index$1m,
    avatar: index$1l,
    badge: index$1k,
    blockui: index$1j,
    breadcrumb: index$1i,
    button: index$1h,
    datepicker: index$15,
    card: index$1g,
    carousel: index$1f,
    cascadeselect: index$1e,
    checkbox: index$1d,
    chip: index$1c,
    colorpicker: index$1b,
    confirmdialog: index$1a,
    confirmpopup: index$19,
    contextmenu: index$18,
    dataview: index$16,
    datatable: index$17,
    dialog: index$14,
    divider: index$13,
    dock: index$12,
    drawer: index$11,
    editor: index$10,
    fieldset: index$$,
    fileupload: index$_,
    floatlabel: index$Z,
    galleria: index$Y,
    iconfield: index$X,
    image: index$W,
    inlinemessage: index$V,
    inplace: index$U,
    inputchips: index$T,
    inputgroup: index$S,
    inputnumber: index$R,
    inputtext: index$Q,
    knob: index$P,
    listbox: index$O,
    megamenu: index$N,
    menu: index$M,
    menubar: index$L,
    message: index$K,
    metergroup: index$J,
    multiselect: index$I,
    orderlist: index$H,
    organizationchart: index$G,
    overlaybadge: index$F,
    popover: index$z,
    paginator: index$E,
    password: index$B,
    panel: index$D,
    panelmenu: index$C,
    picklist: index$A,
    progressbar: index$y,
    progressspinner: index$x,
    radiobutton: index$w,
    rating: index$v,
    scrollpanel: index$t,
    select: index$s,
    selectbutton: index$r,
    skeleton: index$q,
    slider: index$p,
    speeddial: index$o,
    splitter: index$m,
    splitbutton: index$n,
    stepper: index$l,
    steps: index$k,
    tabmenu: index$j,
    tabs: index$i,
    tabview: index$h,
    textarea: index$e,
    tieredmenu: index$d,
    tag: index$g,
    terminal: index$f,
    timeline: index$c,
    togglebutton: index$a,
    toggleswitch: index$9,
    tree: index$6,
    treeselect: index$5,
    treetable: index$4,
    toast: index$b,
    toolbar: index$8,
    virtualscroller: index$3
  },
  directives: {
    tooltip: index$7,
    ripple: index$u
  }
};
/**
* @vue/shared v3.4.31
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function makeMap(str, expectsLowerCase) {
  const set3 = new Set(str.split(","));
  return expectsLowerCase ? (val) => set3.has(val.toLowerCase()) : (val) => set3.has(val);
}
__name(makeMap, "makeMap");
const EMPTY_OBJ = false ? Object.freeze({}) : {};
const EMPTY_ARR = false ? Object.freeze([]) : [];
const NOOP = /* @__PURE__ */ __name(() => {
}, "NOOP");
const NO = /* @__PURE__ */ __name(() => false, "NO");
const isOn = /* @__PURE__ */ __name((key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97), "isOn");
const isModelListener = /* @__PURE__ */ __name((key) => key.startsWith("onUpdate:"), "isModelListener");
const extend$1 = Object.assign;
const remove$1 = /* @__PURE__ */ __name((arr, el) => {
  const i2 = arr.indexOf(el);
  if (i2 > -1) {
    arr.splice(i2, 1);
  }
}, "remove$1");
const hasOwnProperty$3 = Object.prototype.hasOwnProperty;
const hasOwn$3 = /* @__PURE__ */ __name((val, key) => hasOwnProperty$3.call(val, key), "hasOwn$3");
const isArray$4 = Array.isArray;
const isMap = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Map]", "isMap");
const isSet = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Set]", "isSet");
const isDate$2 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Date]", "isDate$2");
const isRegExp$4 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object RegExp]", "isRegExp$4");
const isFunction$4 = /* @__PURE__ */ __name((val) => typeof val === "function", "isFunction$4");
const isString$7 = /* @__PURE__ */ __name((val) => typeof val === "string", "isString$7");
const isSymbol$1 = /* @__PURE__ */ __name((val) => typeof val === "symbol", "isSymbol$1");
const isObject$6 = /* @__PURE__ */ __name((val) => val !== null && typeof val === "object", "isObject$6");
const isPromise$1 = /* @__PURE__ */ __name((val) => {
  return (isObject$6(val) || isFunction$4(val)) && isFunction$4(val.then) && isFunction$4(val.catch);
}, "isPromise$1");
const objectToString$1 = Object.prototype.toString;
const toTypeString$1 = /* @__PURE__ */ __name((value4) => objectToString$1.call(value4), "toTypeString$1");
const toRawType = /* @__PURE__ */ __name((value4) => {
  return toTypeString$1(value4).slice(8, -1);
}, "toRawType");
const isPlainObject$4 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Object]", "isPlainObject$4");
const isIntegerKey = /* @__PURE__ */ __name((key) => isString$7(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key, "isIntegerKey");
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 isBuiltInDirective = /* @__PURE__ */ makeMap(
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
);
const cacheStringFunction$1 = /* @__PURE__ */ __name((fn) => {
  const cache2 = /* @__PURE__ */ Object.create(null);
  return (str) => {
    const hit = cache2[str];
    return hit || (cache2[str] = fn(str));
  };
}, "cacheStringFunction$1");
const camelizeRE$1 = /-(\w)/g;
const camelize$1 = cacheStringFunction$1((str) => {
  return str.replace(camelizeRE$1, (_2, c) => c ? c.toUpperCase() : "");
});
const hyphenateRE$1 = /\B([A-Z])/g;
const hyphenate$1 = cacheStringFunction$1(
  (str) => str.replace(hyphenateRE$1, "-$1").toLowerCase()
);
const capitalize$1 = cacheStringFunction$1((str) => {
  return str.charAt(0).toUpperCase() + str.slice(1);
});
const toHandlerKey = cacheStringFunction$1((str) => {
  const s = str ? `on${capitalize$1(str)}` : ``;
  return s;
});
const hasChanged = /* @__PURE__ */ __name((value4, oldValue2) => !Object.is(value4, oldValue2), "hasChanged");
const invokeArrayFns = /* @__PURE__ */ __name((fns, ...arg) => {
  for (let i2 = 0; i2 < fns.length; i2++) {
    fns[i2](...arg);
  }
}, "invokeArrayFns");
const def = /* @__PURE__ */ __name((obj, key, value4, writable = false) => {
  Object.defineProperty(obj, key, {
    configurable: true,
    enumerable: false,
    writable,
    value: value4
  });
}, "def");
const looseToNumber = /* @__PURE__ */ __name((val) => {
  const n = parseFloat(val);
  return isNaN(n) ? val : n;
}, "looseToNumber");
const toNumber = /* @__PURE__ */ __name((val) => {
  const n = isString$7(val) ? Number(val) : NaN;
  return isNaN(n) ? val : n;
}, "toNumber");
let _globalThis$1;
const getGlobalThis$1 = /* @__PURE__ */ __name(() => {
  return _globalThis$1 || (_globalThis$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
}, "getGlobalThis$1");
const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
function genPropsAccessExp(name2) {
  return identRE.test(name2) ? `__props.${name2}` : `__props[${JSON.stringify(name2)}]`;
}
__name(genPropsAccessExp, "genPropsAccessExp");
const PatchFlags = {
  "TEXT": 1,
  "1": "TEXT",
  "CLASS": 2,
  "2": "CLASS",
  "STYLE": 4,
  "4": "STYLE",
  "PROPS": 8,
  "8": "PROPS",
  "FULL_PROPS": 16,
  "16": "FULL_PROPS",
  "NEED_HYDRATION": 32,
  "32": "NEED_HYDRATION",
  "STABLE_FRAGMENT": 64,
  "64": "STABLE_FRAGMENT",
  "KEYED_FRAGMENT": 128,
  "128": "KEYED_FRAGMENT",
  "UNKEYED_FRAGMENT": 256,
  "256": "UNKEYED_FRAGMENT",
  "NEED_PATCH": 512,
  "512": "NEED_PATCH",
  "DYNAMIC_SLOTS": 1024,
  "1024": "DYNAMIC_SLOTS",
  "DEV_ROOT_FRAGMENT": 2048,
  "2048": "DEV_ROOT_FRAGMENT",
  "HOISTED": -1,
  "-1": "HOISTED",
  "BAIL": -2,
  "-2": "BAIL"
};
const PatchFlagNames = {
  [1]: `TEXT`,
  [2]: `CLASS`,
  [4]: `STYLE`,
  [8]: `PROPS`,
  [16]: `FULL_PROPS`,
  [32]: `NEED_HYDRATION`,
  [64]: `STABLE_FRAGMENT`,
  [128]: `KEYED_FRAGMENT`,
  [256]: `UNKEYED_FRAGMENT`,
  [512]: `NEED_PATCH`,
  [1024]: `DYNAMIC_SLOTS`,
  [2048]: `DEV_ROOT_FRAGMENT`,
  [-1]: `HOISTED`,
  [-2]: `BAIL`
};
const ShapeFlags = {
  "ELEMENT": 1,
  "1": "ELEMENT",
  "FUNCTIONAL_COMPONENT": 2,
  "2": "FUNCTIONAL_COMPONENT",
  "STATEFUL_COMPONENT": 4,
  "4": "STATEFUL_COMPONENT",
  "TEXT_CHILDREN": 8,
  "8": "TEXT_CHILDREN",
  "ARRAY_CHILDREN": 16,
  "16": "ARRAY_CHILDREN",
  "SLOTS_CHILDREN": 32,
  "32": "SLOTS_CHILDREN",
  "TELEPORT": 64,
  "64": "TELEPORT",
  "SUSPENSE": 128,
  "128": "SUSPENSE",
  "COMPONENT_SHOULD_KEEP_ALIVE": 256,
  "256": "COMPONENT_SHOULD_KEEP_ALIVE",
  "COMPONENT_KEPT_ALIVE": 512,
  "512": "COMPONENT_KEPT_ALIVE",
  "COMPONENT": 6,
  "6": "COMPONENT"
};
const SlotFlags = {
  "STABLE": 1,
  "1": "STABLE",
  "DYNAMIC": 2,
  "2": "DYNAMIC",
  "FORWARDED": 3,
  "3": "FORWARDED"
};
const slotFlagsText = {
  [1]: "STABLE",
  [2]: "DYNAMIC",
  [3]: "FORWARDED"
};
const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
const isGloballyWhitelisted = isGloballyAllowed;
const range = 2;
function generateCodeFrame$1(source, start2 = 0, end = source.length) {
  start2 = Math.max(0, Math.min(start2, source.length));
  end = Math.max(0, Math.min(end, source.length));
  if (start2 > end) return "";
  let lines = source.split(/(\r?\n)/);
  const newlineSequences = lines.filter((_2, idx) => idx % 2 === 1);
  lines = lines.filter((_2, idx) => idx % 2 === 0);
  let count = 0;
  const res = [];
  for (let i2 = 0; i2 < lines.length; i2++) {
    count += lines[i2].length + (newlineSequences[i2] && newlineSequences[i2].length || 0);
    if (count >= start2) {
      for (let j = i2 - range; j <= i2 + range || end > count; j++) {
        if (j < 0 || j >= lines.length) continue;
        const line = j + 1;
        res.push(
          `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}|  ${lines[j]}`
        );
        const lineLength = lines[j].length;
        const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
        if (j === i2) {
          const pad = start2 - (count - (lineLength + newLineSeqLength));
          const length = Math.max(
            1,
            end > count ? lineLength - pad : end - start2
          );
          res.push(`   |  ` + " ".repeat(pad) + "^".repeat(length));
        } else if (j > i2) {
          if (end > count) {
            const length = Math.max(Math.min(end - count, lineLength), 1);
            res.push(`   |  ` + "^".repeat(length));
          }
          count += lineLength + newLineSeqLength;
        }
      }
      break;
    }
  }
  return res.join("\n");
}
__name(generateCodeFrame$1, "generateCodeFrame$1");
function normalizeStyle(value4) {
  if (isArray$4(value4)) {
    const res = {};
    for (let i2 = 0; i2 < value4.length; i2++) {
      const item3 = value4[i2];
      const normalized = isString$7(item3) ? parseStringStyle(item3) : normalizeStyle(item3);
      if (normalized) {
        for (const key in normalized) {
          res[key] = normalized[key];
        }
      }
    }
    return res;
  } else if (isString$7(value4) || isObject$6(value4)) {
    return value4;
  }
}
__name(normalizeStyle, "normalizeStyle");
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:([^]+)/;
const styleCommentRE = /\/\*[^]*?\*\//g;
function parseStringStyle(cssText) {
  const ret = {};
  cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item3) => {
    if (item3) {
      const tmp = item3.split(propertyDelimiterRE);
      tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
    }
  });
  return ret;
}
__name(parseStringStyle, "parseStringStyle");
function stringifyStyle(styles) {
  let ret = "";
  if (!styles || isString$7(styles)) {
    return ret;
  }
  for (const key in styles) {
    const value4 = styles[key];
    if (isString$7(value4) || typeof value4 === "number") {
      const normalizedKey = key.startsWith(`--`) ? key : hyphenate$1(key);
      ret += `${normalizedKey}:${value4};`;
    }
  }
  return ret;
}
__name(stringifyStyle, "stringifyStyle");
function normalizeClass(value4) {
  let res = "";
  if (isString$7(value4)) {
    res = value4;
  } else if (isArray$4(value4)) {
    for (let i2 = 0; i2 < value4.length; i2++) {
      const normalized = normalizeClass(value4[i2]);
      if (normalized) {
        res += normalized + " ";
      }
    }
  } else if (isObject$6(value4)) {
    for (const name2 in value4) {
      if (value4[name2]) {
        res += name2 + " ";
      }
    }
  }
  return res.trim();
}
__name(normalizeClass, "normalizeClass");
function normalizeProps(props) {
  if (!props) return null;
  let { class: klass, style: style2 } = props;
  if (klass && !isString$7(klass)) {
    props.class = normalizeClass(klass);
  }
  if (style2) {
    props.style = normalizeStyle(style2);
  }
  return props;
}
__name(normalizeProps, "normalizeProps");
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
const isBooleanAttr = /* @__PURE__ */ makeMap(
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
);
function includeBooleanAttr(value4) {
  return !!value4 || value4 === "";
}
__name(includeBooleanAttr, "includeBooleanAttr");
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
const attrValidationCache = {};
function isSSRSafeAttrName(name2) {
  if (attrValidationCache.hasOwnProperty(name2)) {
    return attrValidationCache[name2];
  }
  const isUnsafe = unsafeAttrCharRE.test(name2);
  if (isUnsafe) {
    console.error(`unsafe attribute name: ${name2}`);
  }
  return attrValidationCache[name2] = !isUnsafe;
}
__name(isSSRSafeAttrName, "isSSRSafeAttrName");
const propsToAttrMap = {
  acceptCharset: "accept-charset",
  className: "class",
  htmlFor: "for",
  httpEquiv: "http-equiv"
};
const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
);
const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
);
function isRenderableAttrValue(value4) {
  if (value4 == null) {
    return false;
  }
  const type = typeof value4;
  return type === "string" || type === "number" || type === "boolean";
}
__name(isRenderableAttrValue, "isRenderableAttrValue");
const escapeRE$2 = /["'&<>]/;
function escapeHtml$2(string) {
  const str = "" + string;
  const match2 = escapeRE$2.exec(str);
  if (!match2) {
    return str;
  }
  let html = "";
  let escaped;
  let index2;
  let lastIndex2 = 0;
  for (index2 = match2.index; index2 < str.length; index2++) {
    switch (str.charCodeAt(index2)) {
      case 34:
        escaped = "&quot;";
        break;
      case 38:
        escaped = "&amp;";
        break;
      case 39:
        escaped = "&#39;";
        break;
      case 60:
        escaped = "&lt;";
        break;
      case 62:
        escaped = "&gt;";
        break;
      default:
        continue;
    }
    if (lastIndex2 !== index2) {
      html += str.slice(lastIndex2, index2);
    }
    lastIndex2 = index2 + 1;
    html += escaped;
  }
  return lastIndex2 !== index2 ? html + str.slice(lastIndex2, index2) : html;
}
__name(escapeHtml$2, "escapeHtml$2");
const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
function escapeHtmlComment(src) {
  return src.replace(commentStripRE, "");
}
__name(escapeHtmlComment, "escapeHtmlComment");
function looseCompareArrays(a, b) {
  if (a.length !== b.length) return false;
  let equal = true;
  for (let i2 = 0; equal && i2 < a.length; i2++) {
    equal = looseEqual(a[i2], b[i2]);
  }
  return equal;
}
__name(looseCompareArrays, "looseCompareArrays");
function looseEqual(a, b) {
  if (a === b) return true;
  let aValidType = isDate$2(a);
  let bValidType = isDate$2(b);
  if (aValidType || bValidType) {
    return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  }
  aValidType = isSymbol$1(a);
  bValidType = isSymbol$1(b);
  if (aValidType || bValidType) {
    return a === b;
  }
  aValidType = isArray$4(a);
  bValidType = isArray$4(b);
  if (aValidType || bValidType) {
    return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  }
  aValidType = isObject$6(a);
  bValidType = isObject$6(b);
  if (aValidType || bValidType) {
    if (!aValidType || !bValidType) {
      return false;
    }
    const aKeysCount = Object.keys(a).length;
    const bKeysCount = Object.keys(b).length;
    if (aKeysCount !== bKeysCount) {
      return false;
    }
    for (const key in a) {
      const aHasKey = a.hasOwnProperty(key);
      const bHasKey = b.hasOwnProperty(key);
      if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
        return false;
      }
    }
  }
  return String(a) === String(b);
}
__name(looseEqual, "looseEqual");
function looseIndexOf(arr, val) {
  return arr.findIndex((item3) => looseEqual(item3, val));
}
__name(looseIndexOf, "looseIndexOf");
const isRef$1 = /* @__PURE__ */ __name((val) => {
  return !!(val && val.__v_isRef === true);
}, "isRef$1");
const toDisplayString$1 = /* @__PURE__ */ __name((val) => {
  return isString$7(val) ? val : val == null ? "" : isArray$4(val) || isObject$6(val) && (val.toString === objectToString$1 || !isFunction$4(val.toString)) ? isRef$1(val) ? toDisplayString$1(val.value) : JSON.stringify(val, replacer, 2) : String(val);
}, "toDisplayString$1");
const replacer = /* @__PURE__ */ __name((_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], i2) => {
          entries[stringifySymbol(key, i2) + " =>"] = val2;
          return entries;
        },
        {}
      )
    };
  } else if (isSet(val)) {
    return {
      [`Set(${val.size})`]: [...val.values()].map((v2) => stringifySymbol(v2))
    };
  } else if (isSymbol$1(val)) {
    return stringifySymbol(val);
  } else if (isObject$6(val) && !isArray$4(val) && !isPlainObject$4(val)) {
    return String(val);
  }
  return val;
}, "replacer");
const stringifySymbol = /* @__PURE__ */ __name((v2, i2 = "") => {
  var _a2;
  return (
    // Symbol.description in es2019+ so we need to cast here to pass
    // the lib: es2016 check
    isSymbol$1(v2) ? `Symbol(${(_a2 = v2.description) != null ? _a2 : i2})` : v2
  );
}, "stringifySymbol");
/**
* @vue/reactivity v3.4.31
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function warn$4(msg, ...args) {
  console.warn(`[Vue warn] ${msg}`, ...args);
}
__name(warn$4, "warn$4");
let activeEffectScope;
class EffectScope {
  static {
    __name(this, "EffectScope");
  }
  constructor(detached = false) {
    this.detached = detached;
    this._active = true;
    this.effects = [];
    this.cleanups = [];
    this.parent = activeEffectScope;
    if (!detached && activeEffectScope) {
      this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
        this
      ) - 1;
    }
  }
  get active() {
    return this._active;
  }
  run(fn) {
    if (this._active) {
      const currentEffectScope = activeEffectScope;
      try {
        activeEffectScope = this;
        return fn();
      } finally {
        activeEffectScope = currentEffectScope;
      }
    } else if (false) {
      warn$4(`cannot run an inactive effect scope.`);
    }
  }
  /**
   * 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 i2, l;
      for (i2 = 0, l = this.effects.length; i2 < l; i2++) {
        this.effects[i2].stop();
      }
      for (i2 = 0, l = this.cleanups.length; i2 < l; i2++) {
        this.cleanups[i2]();
      }
      if (this.scopes) {
        for (i2 = 0, l = this.scopes.length; i2 < l; i2++) {
          this.scopes[i2].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);
}
__name(effectScope, "effectScope");
function recordEffectScope(effect2, scope = activeEffectScope) {
  if (scope && scope.active) {
    scope.effects.push(effect2);
  }
}
__name(recordEffectScope, "recordEffectScope");
function getCurrentScope() {
  return activeEffectScope;
}
__name(getCurrentScope, "getCurrentScope");
function onScopeDispose(fn) {
  if (activeEffectScope) {
    activeEffectScope.cleanups.push(fn);
  } else if (false) {
    warn$4(
      `onScopeDispose() is called when there is no active effect scope to be associated with.`
    );
  }
}
__name(onScopeDispose, "onScopeDispose");
let activeEffect;
class ReactiveEffect {
  static {
    __name(this, "ReactiveEffect");
  }
  constructor(fn, trigger2, scheduler, scope) {
    this.fn = fn;
    this.trigger = trigger2;
    this.scheduler = scheduler;
    this.active = true;
    this.deps = [];
    this._dirtyLevel = 4;
    this._trackId = 0;
    this._runnings = 0;
    this._shouldSchedule = false;
    this._depsLength = 0;
    recordEffectScope(this, scope);
  }
  get dirty() {
    if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
      this._dirtyLevel = 1;
      pauseTracking();
      for (let i2 = 0; i2 < this._depsLength; i2++) {
        const dep = this.deps[i2];
        if (dep.computed) {
          triggerComputed(dep.computed);
          if (this._dirtyLevel >= 4) {
            break;
          }
        }
      }
      if (this._dirtyLevel === 1) {
        this._dirtyLevel = 0;
      }
      resetTracking();
    }
    return this._dirtyLevel >= 4;
  }
  set dirty(v2) {
    this._dirtyLevel = v2 ? 4 : 0;
  }
  run() {
    this._dirtyLevel = 0;
    if (!this.active) {
      return this.fn();
    }
    let lastShouldTrack = shouldTrack;
    let lastEffect = activeEffect;
    try {
      shouldTrack = true;
      activeEffect = this;
      this._runnings++;
      preCleanupEffect(this);
      return this.fn();
    } finally {
      postCleanupEffect(this);
      this._runnings--;
      activeEffect = lastEffect;
      shouldTrack = lastShouldTrack;
    }
  }
  stop() {
    if (this.active) {
      preCleanupEffect(this);
      postCleanupEffect(this);
      this.onStop && this.onStop();
      this.active = false;
    }
  }
}
function triggerComputed(computed2) {
  return computed2.value;
}
__name(triggerComputed, "triggerComputed");
function preCleanupEffect(effect2) {
  effect2._trackId++;
  effect2._depsLength = 0;
}
__name(preCleanupEffect, "preCleanupEffect");
function postCleanupEffect(effect2) {
  if (effect2.deps.length > effect2._depsLength) {
    for (let i2 = effect2._depsLength; i2 < effect2.deps.length; i2++) {
      cleanupDepEffect(effect2.deps[i2], effect2);
    }
    effect2.deps.length = effect2._depsLength;
  }
}
__name(postCleanupEffect, "postCleanupEffect");
function cleanupDepEffect(dep, effect2) {
  const trackId = dep.get(effect2);
  if (trackId !== void 0 && effect2._trackId !== trackId) {
    dep.delete(effect2);
    if (dep.size === 0) {
      dep.cleanup();
    }
  }
}
__name(cleanupDepEffect, "cleanupDepEffect");
function effect(fn, options4) {
  if (fn.effect instanceof ReactiveEffect) {
    fn = fn.effect.fn;
  }
  const _effect = new ReactiveEffect(fn, NOOP, () => {
    if (_effect.dirty) {
      _effect.run();
    }
  });
  if (options4) {
    extend$1(_effect, options4);
    if (options4.scope) recordEffectScope(_effect, options4.scope);
  }
  if (!options4 || !options4.lazy) {
    _effect.run();
  }
  const runner = _effect.run.bind(_effect);
  runner.effect = _effect;
  return runner;
}
__name(effect, "effect");
function stop(runner) {
  runner.effect.stop();
}
__name(stop, "stop");
let shouldTrack = true;
let pauseScheduleStack = 0;
const trackStack = [];
function pauseTracking() {
  trackStack.push(shouldTrack);
  shouldTrack = false;
}
__name(pauseTracking, "pauseTracking");
function enableTracking() {
  trackStack.push(shouldTrack);
  shouldTrack = true;
}
__name(enableTracking, "enableTracking");
function resetTracking() {
  const last = trackStack.pop();
  shouldTrack = last === void 0 ? true : last;
}
__name(resetTracking, "resetTracking");
function pauseScheduling() {
  pauseScheduleStack++;
}
__name(pauseScheduling, "pauseScheduling");
function resetScheduling() {
  pauseScheduleStack--;
  while (!pauseScheduleStack && queueEffectSchedulers.length) {
    queueEffectSchedulers.shift()();
  }
}
__name(resetScheduling, "resetScheduling");
function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  var _a2;
  if (dep.get(effect2) !== effect2._trackId) {
    dep.set(effect2, effect2._trackId);
    const oldDep = effect2.deps[effect2._depsLength];
    if (oldDep !== dep) {
      if (oldDep) {
        cleanupDepEffect(oldDep, effect2);
      }
      effect2.deps[effect2._depsLength++] = dep;
    } else {
      effect2._depsLength++;
    }
    if (false) {
      (_a2 = effect2.onTrack) == null ? void 0 : _a2.call(effect2, extend$1({ effect: effect2 }, debuggerEventExtraInfo));
    }
  }
}
__name(trackEffect, "trackEffect");
const queueEffectSchedulers = [];
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  var _a2;
  pauseScheduling();
  for (const effect2 of dep.keys()) {
    let tracking;
    if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
      effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
      effect2._dirtyLevel = dirtyLevel;
    }
    if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
      if (false) {
        (_a2 = effect2.onTrigger) == null ? void 0 : _a2.call(effect2, extend$1({ effect: effect2 }, debuggerEventExtraInfo));
      }
      effect2.trigger();
      if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
        effect2._shouldSchedule = false;
        if (effect2.scheduler) {
          queueEffectSchedulers.push(effect2.scheduler);
        }
      }
    }
  }
  resetScheduling();
}
__name(triggerEffects, "triggerEffects");
const createDep = /* @__PURE__ */ __name((cleanup, computed2) => {
  const dep = /* @__PURE__ */ new Map();
  dep.cleanup = cleanup;
  dep.computed = computed2;
  return dep;
}, "createDep");
const targetMap = /* @__PURE__ */ new WeakMap();
const ITERATE_KEY = Symbol(false ? "iterate" : "");
const MAP_KEY_ITERATE_KEY = Symbol(false ? "Map key iterate" : "");
function track(target, type, key) {
  if (shouldTrack && activeEffect) {
    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 = createDep(() => depsMap.delete(key)));
    }
    trackEffect(
      activeEffect,
      dep,
      false ? {
        target,
        type,
        key
      } : void 0
    );
  }
}
__name(track, "track");
function trigger(target, type, key, newValue2, oldValue2, oldTarget) {
  const depsMap = targetMap.get(target);
  if (!depsMap) {
    return;
  }
  let deps = [];
  if (type === "clear") {
    deps = [...depsMap.values()];
  } else if (key === "length" && isArray$4(target)) {
    const newLength = Number(newValue2);
    depsMap.forEach((dep, key2) => {
      if (key2 === "length" || !isSymbol$1(key2) && key2 >= newLength) {
        deps.push(dep);
      }
    });
  } else {
    if (key !== void 0) {
      deps.push(depsMap.get(key));
    }
    switch (type) {
      case "add":
        if (!isArray$4(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
          if (isMap(target)) {
            deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
          }
        } else if (isIntegerKey(key)) {
          deps.push(depsMap.get("length"));
        }
        break;
      case "delete":
        if (!isArray$4(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
          if (isMap(target)) {
            deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
          }
        }
        break;
      case "set":
        if (isMap(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
        }
        break;
    }
  }
  pauseScheduling();
  for (const dep of deps) {
    if (dep) {
      triggerEffects(
        dep,
        4,
        false ? {
          target,
          type,
          key,
          newValue: newValue2,
          oldValue: oldValue2,
          oldTarget
        } : void 0
      );
    }
  }
  resetScheduling();
}
__name(trigger, "trigger");
function getDepFromReactive(object, key) {
  const depsMap = targetMap.get(object);
  return depsMap && depsMap.get(key);
}
__name(getDepFromReactive, "getDepFromReactive");
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)
);
const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
function createArrayInstrumentations() {
  const instrumentations = {};
  ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
    instrumentations[key] = function(...args) {
      const arr = toRaw(this);
      for (let i2 = 0, l = this.length; i2 < l; i2++) {
        track(arr, "get", i2 + "");
      }
      const res = arr[key](...args);
      if (res === -1 || res === false) {
        return arr[key](...args.map(toRaw));
      } else {
        return res;
      }
    };
  });
  ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
    instrumentations[key] = function(...args) {
      pauseTracking();
      pauseScheduling();
      const res = toRaw(this)[key].apply(this, args);
      resetScheduling();
      resetTracking();
      return res;
    };
  });
  return instrumentations;
}
__name(createArrayInstrumentations, "createArrayInstrumentations");
function hasOwnProperty$2(key) {
  if (!isSymbol$1(key)) key = String(key);
  const obj = toRaw(this);
  track(obj, "has", key);
  return obj.hasOwnProperty(key);
}
__name(hasOwnProperty$2, "hasOwnProperty$2");
class BaseReactiveHandler {
  static {
    __name(this, "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 reciever is a user proxy of the reactive proxy
      Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
        return target;
      }
      return;
    }
    const targetIsArray = isArray$4(target);
    if (!isReadonly2) {
      if (targetIsArray && hasOwn$3(arrayInstrumentations, key)) {
        return Reflect.get(arrayInstrumentations, key, receiver);
      }
      if (key === "hasOwnProperty") {
        return hasOwnProperty$2;
      }
    }
    const res = Reflect.get(target, key, 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$6(res)) {
      return isReadonly2 ? readonly(res) : reactive(res);
    }
    return res;
  }
}
class MutableReactiveHandler extends BaseReactiveHandler {
  static {
    __name(this, "MutableReactiveHandler");
  }
  constructor(isShallow2 = false) {
    super(false, isShallow2);
  }
  set(target, key, value4, receiver) {
    let oldValue2 = target[key];
    if (!this._isShallow) {
      const isOldValueReadonly = isReadonly(oldValue2);
      if (!isShallow(value4) && !isReadonly(value4)) {
        oldValue2 = toRaw(oldValue2);
        value4 = toRaw(value4);
      }
      if (!isArray$4(target) && isRef(oldValue2) && !isRef(value4)) {
        if (isOldValueReadonly) {
          return false;
        } else {
          oldValue2.value = value4;
          return true;
        }
      }
    }
    const hadKey = isArray$4(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$3(target, key);
    const result = Reflect.set(target, key, value4, receiver);
    if (target === toRaw(receiver)) {
      if (!hadKey) {
        trigger(target, "add", key, value4);
      } else if (hasChanged(value4, oldValue2)) {
        trigger(target, "set", key, value4, oldValue2);
      }
    }
    return result;
  }
  deleteProperty(target, key) {
    const hadKey = hasOwn$3(target, key);
    const oldValue2 = target[key];
    const result = Reflect.deleteProperty(target, key);
    if (result && hadKey) {
      trigger(target, "delete", key, void 0, oldValue2);
    }
    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$4(target) ? "length" : ITERATE_KEY
    );
    return Reflect.ownKeys(target);
  }
}
class ReadonlyReactiveHandler extends BaseReactiveHandler {
  static {
    __name(this, "ReadonlyReactiveHandler");
  }
  constructor(isShallow2 = false) {
    super(true, isShallow2);
  }
  set(target, key) {
    if (false) {
      warn$4(
        `Set operation on key "${String(key)}" failed: target is readonly.`,
        target
      );
    }
    return true;
  }
  deleteProperty(target, key) {
    if (false) {
      warn$4(
        `Delete operation on key "${String(key)}" failed: target is readonly.`,
        target
      );
    }
    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 = /* @__PURE__ */ __name((value4) => value4, "toShallow");
const getProto = /* @__PURE__ */ __name((v2) => Reflect.getPrototypeOf(v2), "getProto");
function get$3(target, key, isReadonly2 = false, isShallow2 = false) {
  target = target["__v_raw"];
  const rawTarget = toRaw(target);
  const rawKey = toRaw(key);
  if (!isReadonly2) {
    if (hasChanged(key, rawKey)) {
      track(rawTarget, "get", key);
    }
    track(rawTarget, "get", rawKey);
  }
  const { has: has2 } = getProto(rawTarget);
  const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1;
  if (has2.call(rawTarget, key)) {
    return wrap2(target.get(key));
  } else if (has2.call(rawTarget, rawKey)) {
    return wrap2(target.get(rawKey));
  } else if (target !== rawTarget) {
    target.get(key);
  }
}
__name(get$3, "get$3");
function has$1(key, isReadonly2 = false) {
  const target = this["__v_raw"];
  const rawTarget = toRaw(target);
  const rawKey = toRaw(key);
  if (!isReadonly2) {
    if (hasChanged(key, rawKey)) {
      track(rawTarget, "has", key);
    }
    track(rawTarget, "has", rawKey);
  }
  return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
}
__name(has$1, "has$1");
function size(target, isReadonly2 = false) {
  target = target["__v_raw"];
  !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  return Reflect.get(target, "size", target);
}
__name(size, "size");
function add$1(value4) {
  value4 = toRaw(value4);
  const target = toRaw(this);
  const proto = getProto(target);
  const hadKey = proto.has.call(target, value4);
  if (!hadKey) {
    target.add(value4);
    trigger(target, "add", value4, value4);
  }
  return this;
}
__name(add$1, "add$1");
function set$4(key, value4) {
  value4 = toRaw(value4);
  const target = toRaw(this);
  const { has: has2, get: get22 } = getProto(target);
  let hadKey = has2.call(target, key);
  if (!hadKey) {
    key = toRaw(key);
    hadKey = has2.call(target, key);
  } else if (false) {
    checkIdentityKeys(target, has2, key);
  }
  const oldValue2 = get22.call(target, key);
  target.set(key, value4);
  if (!hadKey) {
    trigger(target, "add", key, value4);
  } else if (hasChanged(value4, oldValue2)) {
    trigger(target, "set", key, value4, oldValue2);
  }
  return this;
}
__name(set$4, "set$4");
function deleteEntry(key) {
  const target = toRaw(this);
  const { has: has2, get: get22 } = getProto(target);
  let hadKey = has2.call(target, key);
  if (!hadKey) {
    key = toRaw(key);
    hadKey = has2.call(target, key);
  } else if (false) {
    checkIdentityKeys(target, has2, key);
  }
  const oldValue2 = get22 ? get22.call(target, key) : void 0;
  const result = target.delete(key);
  if (hadKey) {
    trigger(target, "delete", key, void 0, oldValue2);
  }
  return result;
}
__name(deleteEntry, "deleteEntry");
function clear() {
  const target = toRaw(this);
  const hadItems = target.size !== 0;
  const oldTarget = false ? isMap(target) ? new Map(target) : new Set(target) : void 0;
  const result = target.clear();
  if (hadItems) {
    trigger(target, "clear", void 0, void 0, oldTarget);
  }
  return result;
}
__name(clear, "clear");
function createForEach(isReadonly2, isShallow2) {
  return /* @__PURE__ */ __name(function forEach3(callback, thisArg) {
    const observed = this;
    const target = observed["__v_raw"];
    const rawTarget = toRaw(target);
    const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1;
    !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
    return target.forEach((value4, key) => {
      return callback.call(thisArg, wrap2(value4), wrap2(key), observed);
    });
  }, "forEach");
}
__name(createForEach, "createForEach");
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 wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1;
    !isReadonly2 && track(
      rawTarget,
      "iterate",
      isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
    );
    return {
      // iterator protocol
      next() {
        const { value: value4, done } = innerIterator.next();
        return done ? { value: value4, done } : {
          value: isPair ? [wrap2(value4[0]), wrap2(value4[1])] : wrap2(value4),
          done
        };
      },
      // iterable protocol
      [Symbol.iterator]() {
        return this;
      }
    };
  };
}
__name(createIterableMethod, "createIterableMethod");
function createReadonlyMethod(type) {
  return function(...args) {
    if (false) {
      const key = args[0] ? `on key "${args[0]}" ` : ``;
      warn$4(
        `${capitalize$1(type)} operation ${key}failed: target is readonly.`,
        toRaw(this)
      );
    }
    return type === "delete" ? false : type === "clear" ? void 0 : this;
  };
}
__name(createReadonlyMethod, "createReadonlyMethod");
function createInstrumentations() {
  const mutableInstrumentations2 = {
    get(key) {
      return get$3(this, key);
    },
    get size() {
      return size(this);
    },
    has: has$1,
    add: add$1,
    set: set$4,
    delete: deleteEntry,
    clear,
    forEach: createForEach(false, false)
  };
  const shallowInstrumentations2 = {
    get(key) {
      return get$3(this, key, false, true);
    },
    get size() {
      return size(this);
    },
    has: has$1,
    add: add$1,
    set: set$4,
    delete: deleteEntry,
    clear,
    forEach: createForEach(false, true)
  };
  const readonlyInstrumentations2 = {
    get(key) {
      return get$3(this, key, true);
    },
    get size() {
      return size(this, true);
    },
    has(key) {
      return has$1.call(this, key, true);
    },
    add: createReadonlyMethod("add"),
    set: createReadonlyMethod("set"),
    delete: createReadonlyMethod("delete"),
    clear: createReadonlyMethod("clear"),
    forEach: createForEach(true, false)
  };
  const shallowReadonlyInstrumentations2 = {
    get(key) {
      return get$3(this, key, true, true);
    },
    get size() {
      return size(this, true);
    },
    has(key) {
      return has$1.call(this, key, true);
    },
    add: createReadonlyMethod("add"),
    set: createReadonlyMethod("set"),
    delete: createReadonlyMethod("delete"),
    clear: createReadonlyMethod("clear"),
    forEach: createForEach(true, true)
  };
  const iteratorMethods = [
    "keys",
    "values",
    "entries",
    Symbol.iterator
  ];
  iteratorMethods.forEach((method) => {
    mutableInstrumentations2[method] = createIterableMethod(method, false, false);
    readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
    shallowInstrumentations2[method] = createIterableMethod(method, false, true);
    shallowReadonlyInstrumentations2[method] = createIterableMethod(
      method,
      true,
      true
    );
  });
  return [
    mutableInstrumentations2,
    readonlyInstrumentations2,
    shallowInstrumentations2,
    shallowReadonlyInstrumentations2
  ];
}
__name(createInstrumentations, "createInstrumentations");
const [
  mutableInstrumentations,
  readonlyInstrumentations,
  shallowInstrumentations,
  shallowReadonlyInstrumentations
] = /* @__PURE__ */ createInstrumentations();
function createInstrumentationGetter(isReadonly2, shallow) {
  const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  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$3(instrumentations, key) && key in target ? instrumentations : target,
      key,
      receiver
    );
  };
}
__name(createInstrumentationGetter, "createInstrumentationGetter");
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)
};
function checkIdentityKeys(target, has2, key) {
  const rawKey = toRaw(key);
  if (rawKey !== key && has2.call(target, rawKey)) {
    const type = toRawType(target);
    warn$4(
      `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
    );
  }
}
__name(checkIdentityKeys, "checkIdentityKeys");
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;
  }
}
__name(targetTypeMap, "targetTypeMap");
function getTargetType(value4) {
  return value4["__v_skip"] || !Object.isExtensible(value4) ? 0 : targetTypeMap(toRawType(value4));
}
__name(getTargetType, "getTargetType");
function reactive(target) {
  if (isReadonly(target)) {
    return target;
  }
  return createReactiveObject(
    target,
    false,
    mutableHandlers,
    mutableCollectionHandlers,
    reactiveMap
  );
}
__name(reactive, "reactive");
function shallowReactive(target) {
  return createReactiveObject(
    target,
    false,
    shallowReactiveHandlers,
    shallowCollectionHandlers,
    shallowReactiveMap
  );
}
__name(shallowReactive, "shallowReactive");
function readonly(target) {
  return createReactiveObject(
    target,
    true,
    readonlyHandlers,
    readonlyCollectionHandlers,
    readonlyMap
  );
}
__name(readonly, "readonly");
function shallowReadonly(target) {
  return createReactiveObject(
    target,
    true,
    shallowReadonlyHandlers,
    shallowReadonlyCollectionHandlers,
    shallowReadonlyMap
  );
}
__name(shallowReadonly, "shallowReadonly");
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  if (!isObject$6(target)) {
    if (false) {
      warn$4(
        `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
          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;
}
__name(createReactiveObject, "createReactiveObject");
function isReactive(value4) {
  if (isReadonly(value4)) {
    return isReactive(value4["__v_raw"]);
  }
  return !!(value4 && value4["__v_isReactive"]);
}
__name(isReactive, "isReactive");
function isReadonly(value4) {
  return !!(value4 && value4["__v_isReadonly"]);
}
__name(isReadonly, "isReadonly");
function isShallow(value4) {
  return !!(value4 && value4["__v_isShallow"]);
}
__name(isShallow, "isShallow");
function isProxy(value4) {
  return value4 ? !!value4["__v_raw"] : false;
}
__name(isProxy, "isProxy");
function toRaw(observed) {
  const raw = observed && observed["__v_raw"];
  return raw ? toRaw(raw) : observed;
}
__name(toRaw, "toRaw");
function markRaw(value4) {
  if (Object.isExtensible(value4)) {
    def(value4, "__v_skip", true);
  }
  return value4;
}
__name(markRaw, "markRaw");
const toReactive$1 = /* @__PURE__ */ __name((value4) => isObject$6(value4) ? reactive(value4) : value4, "toReactive$1");
const toReadonly = /* @__PURE__ */ __name((value4) => isObject$6(value4) ? readonly(value4) : value4, "toReadonly");
const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided.  Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
class ComputedRefImpl {
  static {
    __name(this, "ComputedRefImpl");
  }
  constructor(getter, _setter, isReadonly2, isSSR) {
    this.getter = getter;
    this._setter = _setter;
    this.dep = void 0;
    this.__v_isRef = true;
    this["__v_isReadonly"] = false;
    this.effect = new ReactiveEffect(
      () => getter(this._value),
      () => triggerRefValue(
        this,
        this.effect._dirtyLevel === 2 ? 2 : 3
      )
    );
    this.effect.computed = this;
    this.effect.active = this._cacheable = !isSSR;
    this["__v_isReadonly"] = isReadonly2;
  }
  get value() {
    const self2 = toRaw(this);
    if ((!self2._cacheable || self2.effect.dirty) && hasChanged(self2._value, self2._value = self2.effect.run())) {
      triggerRefValue(self2, 4);
    }
    trackRefValue(self2);
    if (self2.effect._dirtyLevel >= 2) {
      if (false) {
        warn$4(COMPUTED_SIDE_EFFECT_WARN, `

getter: `, this.getter);
      }
      triggerRefValue(self2, 2);
    }
    return self2._value;
  }
  set value(newValue2) {
    this._setter(newValue2);
  }
  // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  get _dirty() {
    return this.effect.dirty;
  }
  set _dirty(v2) {
    this.effect.dirty = v2;
  }
  // #endregion
}
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  let getter;
  let setter;
  const onlyGetter = isFunction$4(getterOrOptions);
  if (onlyGetter) {
    getter = getterOrOptions;
    setter = false ? () => {
      warn$4("Write operation failed: computed value is readonly");
    } : NOOP;
  } else {
    getter = getterOrOptions.get;
    setter = getterOrOptions.set;
  }
  const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  if (false) {
    cRef.effect.onTrack = debugOptions.onTrack;
    cRef.effect.onTrigger = debugOptions.onTrigger;
  }
  return cRef;
}
__name(computed$1, "computed$1");
function trackRefValue(ref2) {
  var _a2;
  if (shouldTrack && activeEffect) {
    ref2 = toRaw(ref2);
    trackEffect(
      activeEffect,
      (_a2 = ref2.dep) != null ? _a2 : ref2.dep = createDep(
        () => ref2.dep = void 0,
        ref2 instanceof ComputedRefImpl ? ref2 : void 0
      ),
      false ? {
        target: ref2,
        type: "get",
        key: "value"
      } : void 0
    );
  }
}
__name(trackRefValue, "trackRefValue");
function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
  ref2 = toRaw(ref2);
  const dep = ref2.dep;
  if (dep) {
    triggerEffects(
      dep,
      dirtyLevel,
      false ? {
        target: ref2,
        type: "set",
        key: "value",
        newValue: newVal,
        oldValue: oldVal
      } : void 0
    );
  }
}
__name(triggerRefValue, "triggerRefValue");
function isRef(r) {
  return !!(r && r.__v_isRef === true);
}
__name(isRef, "isRef");
function ref(value4) {
  return createRef(value4, false);
}
__name(ref, "ref");
function shallowRef(value4) {
  return createRef(value4, true);
}
__name(shallowRef, "shallowRef");
function createRef(rawValue, shallow) {
  if (isRef(rawValue)) {
    return rawValue;
  }
  return new RefImpl(rawValue, shallow);
}
__name(createRef, "createRef");
class RefImpl {
  static {
    __name(this, "RefImpl");
  }
  constructor(value4, __v_isShallow) {
    this.__v_isShallow = __v_isShallow;
    this.dep = void 0;
    this.__v_isRef = true;
    this._rawValue = __v_isShallow ? value4 : toRaw(value4);
    this._value = __v_isShallow ? value4 : toReactive$1(value4);
  }
  get value() {
    trackRefValue(this);
    return this._value;
  }
  set value(newVal) {
    const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
    newVal = useDirectValue ? newVal : toRaw(newVal);
    if (hasChanged(newVal, this._rawValue)) {
      const oldVal = this._rawValue;
      this._rawValue = newVal;
      this._value = useDirectValue ? newVal : toReactive$1(newVal);
      triggerRefValue(this, 4, newVal, oldVal);
    }
  }
}
function triggerRef(ref2) {
  triggerRefValue(ref2, 4, false ? ref2.value : void 0);
}
__name(triggerRef, "triggerRef");
function unref(ref2) {
  return isRef(ref2) ? ref2.value : ref2;
}
__name(unref, "unref");
function toValue$1(source) {
  return isFunction$4(source) ? source() : unref(source);
}
__name(toValue$1, "toValue$1");
const shallowUnwrapHandlers = {
  get: /* @__PURE__ */ __name((target, key, receiver) => unref(Reflect.get(target, key, receiver)), "get"),
  set: /* @__PURE__ */ __name((target, key, value4, receiver) => {
    const oldValue2 = target[key];
    if (isRef(oldValue2) && !isRef(value4)) {
      oldValue2.value = value4;
      return true;
    } else {
      return Reflect.set(target, key, value4, receiver);
    }
  }, "set")
};
function proxyRefs(objectWithRefs) {
  return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
}
__name(proxyRefs, "proxyRefs");
class CustomRefImpl {
  static {
    __name(this, "CustomRefImpl");
  }
  constructor(factory) {
    this.dep = void 0;
    this.__v_isRef = true;
    const { get: get22, set: set22 } = factory(
      () => trackRefValue(this),
      () => triggerRefValue(this)
    );
    this._get = get22;
    this._set = set22;
  }
  get value() {
    return this._get();
  }
  set value(newVal) {
    this._set(newVal);
  }
}
function customRef(factory) {
  return new CustomRefImpl(factory);
}
__name(customRef, "customRef");
function toRefs$1(object) {
  if (false) {
    warn$4(`toRefs() expects a reactive object but received a plain one.`);
  }
  const ret = isArray$4(object) ? new Array(object.length) : {};
  for (const key in object) {
    ret[key] = propertyToRef(object, key);
  }
  return ret;
}
__name(toRefs$1, "toRefs$1");
class ObjectRefImpl {
  static {
    __name(this, "ObjectRefImpl");
  }
  constructor(_object, _key, _defaultValue) {
    this._object = _object;
    this._key = _key;
    this._defaultValue = _defaultValue;
    this.__v_isRef = true;
  }
  get value() {
    const val = this._object[this._key];
    return 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 {
  static {
    __name(this, "GetterRefImpl");
  }
  constructor(_getter) {
    this._getter = _getter;
    this.__v_isRef = true;
    this.__v_isReadonly = true;
  }
  get value() {
    return this._getter();
  }
}
function toRef$1(source, key, defaultValue) {
  if (isRef(source)) {
    return source;
  } else if (isFunction$4(source)) {
    return new GetterRefImpl(source);
  } else if (isObject$6(source) && arguments.length > 1) {
    return propertyToRef(source, key, defaultValue);
  } else {
    return ref(source);
  }
}
__name(toRef$1, "toRef$1");
function propertyToRef(source, key, defaultValue) {
  const val = source[key];
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
}
__name(propertyToRef, "propertyToRef");
const deferredComputed = computed$1;
const TrackOpTypes = {
  "GET": "get",
  "HAS": "has",
  "ITERATE": "iterate"
};
const TriggerOpTypes = {
  "SET": "set",
  "ADD": "add",
  "DELETE": "delete",
  "CLEAR": "clear"
};
const ReactiveFlags = {
  "SKIP": "__v_skip",
  "IS_REACTIVE": "__v_isReactive",
  "IS_READONLY": "__v_isReadonly",
  "IS_SHALLOW": "__v_isShallow",
  "RAW": "__v_raw"
};
/**
* @vue/runtime-core v3.4.31
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
const stack = [];
function pushWarningContext(vnode) {
  stack.push(vnode);
}
__name(pushWarningContext, "pushWarningContext");
function popWarningContext() {
  stack.pop();
}
__name(popWarningContext, "popWarningContext");
function warn$1$1(msg, ...args) {
  pauseTracking();
  const instance = stack.length ? stack[stack.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
        msg + args.map((a) => {
          var _a2, _b;
          return (_b = (_a2 = a.toString) == null ? void 0 : _a2.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]: ${msg}`, ...args];
    if (trace.length && // avoid spamming console during tests
    true) {
      warnArgs.push(`
`, ...formatTrace(trace));
    }
    console.warn(...warnArgs);
  }
  resetTracking();
}
__name(warn$1$1, "warn$1$1");
function getComponentTrace() {
  let currentVNode = stack[stack.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;
}
__name(getComponentTrace, "getComponentTrace");
function formatTrace(trace) {
  const logs = [];
  trace.forEach((entry, i2) => {
    logs.push(...i2 === 0 ? [] : [`
`], ...formatTraceEntry(entry));
  });
  return logs;
}
__name(formatTrace, "formatTrace");
function formatTraceEntry({ vnode, recurseCount }) {
  const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  const isRoot = vnode.component ? vnode.component.parent == null : false;
  const open2 = ` at <${formatComponentName(
    vnode.component,
    vnode.type,
    isRoot
  )}`;
  const close5 = `>` + postfix;
  return vnode.props ? [open2, ...formatProps(vnode.props), close5] : [open2 + close5];
}
__name(formatTraceEntry, "formatTraceEntry");
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;
}
__name(formatProps, "formatProps");
function formatProp(key, value4, raw) {
  if (isString$7(value4)) {
    value4 = JSON.stringify(value4);
    return raw ? value4 : [`${key}=${value4}`];
  } else if (typeof value4 === "number" || typeof value4 === "boolean" || value4 == null) {
    return raw ? value4 : [`${key}=${value4}`];
  } else if (isRef(value4)) {
    value4 = formatProp(key, toRaw(value4.value), true);
    return raw ? value4 : [`${key}=Ref<`, value4, `>`];
  } else if (isFunction$4(value4)) {
    return [`${key}=fn${value4.name ? `<${value4.name}>` : ``}`];
  } else {
    value4 = toRaw(value4);
    return raw ? value4 : [`${key}=`, value4];
  }
}
__name(formatProp, "formatProp");
function assertNumber(val, type) {
  if (true) return;
  if (val === void 0) {
    return;
  } else if (typeof val !== "number") {
    warn$1$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  } else if (isNaN(val)) {
    warn$1$1(`${type} is NaN - the duration expression might be incorrect.`);
  }
}
__name(assertNumber, "assertNumber");
const ErrorCodes = {
  "SETUP_FUNCTION": 0,
  "0": "SETUP_FUNCTION",
  "RENDER_FUNCTION": 1,
  "1": "RENDER_FUNCTION",
  "WATCH_GETTER": 2,
  "2": "WATCH_GETTER",
  "WATCH_CALLBACK": 3,
  "3": "WATCH_CALLBACK",
  "WATCH_CLEANUP": 4,
  "4": "WATCH_CLEANUP",
  "NATIVE_EVENT_HANDLER": 5,
  "5": "NATIVE_EVENT_HANDLER",
  "COMPONENT_EVENT_HANDLER": 6,
  "6": "COMPONENT_EVENT_HANDLER",
  "VNODE_HOOK": 7,
  "7": "VNODE_HOOK",
  "DIRECTIVE_HOOK": 8,
  "8": "DIRECTIVE_HOOK",
  "TRANSITION_HOOK": 9,
  "9": "TRANSITION_HOOK",
  "APP_ERROR_HANDLER": 10,
  "10": "APP_ERROR_HANDLER",
  "APP_WARN_HANDLER": 11,
  "11": "APP_WARN_HANDLER",
  "FUNCTION_REF": 12,
  "12": "FUNCTION_REF",
  "ASYNC_COMPONENT_LOADER": 13,
  "13": "ASYNC_COMPONENT_LOADER",
  "SCHEDULER": 14,
  "14": "SCHEDULER"
};
const ErrorTypeStrings$1 = {
  ["sp"]: "serverPrefetch hook",
  ["bc"]: "beforeCreate hook",
  ["c"]: "created hook",
  ["bm"]: "beforeMount hook",
  ["m"]: "mounted hook",
  ["bu"]: "beforeUpdate hook",
  ["u"]: "updated",
  ["bum"]: "beforeUnmount hook",
  ["um"]: "unmounted hook",
  ["a"]: "activated hook",
  ["da"]: "deactivated hook",
  ["ec"]: "errorCaptured hook",
  ["rtc"]: "renderTracked hook",
  ["rtg"]: "renderTriggered hook",
  [0]: "setup function",
  [1]: "render function",
  [2]: "watcher getter",
  [3]: "watcher callback",
  [4]: "watcher cleanup function",
  [5]: "native event handler",
  [6]: "component event handler",
  [7]: "vnode hook",
  [8]: "directive hook",
  [9]: "transition hook",
  [10]: "app errorHandler",
  [11]: "app warnHandler",
  [12]: "ref function",
  [13]: "async component loader",
  [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
};
function callWithErrorHandling(fn, instance, type, args) {
  try {
    return args ? fn(...args) : fn();
  } catch (err) {
    handleError(err, instance, type);
  }
}
__name(callWithErrorHandling, "callWithErrorHandling");
function callWithAsyncErrorHandling(fn, instance, type, args) {
  if (isFunction$4(fn)) {
    const res = callWithErrorHandling(fn, instance, type, args);
    if (res && isPromise$1(res)) {
      res.catch((err) => {
        handleError(err, instance, type);
      });
    }
    return res;
  }
  if (isArray$4(fn)) {
    const values = [];
    for (let i2 = 0; i2 < fn.length; i2++) {
      values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args));
    }
    return values;
  } else if (false) {
    warn$1$1(
      `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
    );
  }
}
__name(callWithAsyncErrorHandling, "callWithAsyncErrorHandling");
function handleError(err, instance, type, throwInDev = true) {
  const contextVNode = instance ? instance.vnode : null;
  if (instance) {
    let cur = instance.parent;
    const exposedInstance = instance.proxy;
    const errorInfo = false ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
    while (cur) {
      const errorCapturedHooks = cur.ec;
      if (errorCapturedHooks) {
        for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) {
          if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) {
            return;
          }
        }
      }
      cur = cur.parent;
    }
    const appErrorHandler = instance.appContext.config.errorHandler;
    if (appErrorHandler) {
      pauseTracking();
      callWithErrorHandling(
        appErrorHandler,
        null,
        10,
        [err, exposedInstance, errorInfo]
      );
      resetTracking();
      return;
    }
  }
  logError(err, type, contextVNode, throwInDev);
}
__name(handleError, "handleError");
function logError(err, type, contextVNode, throwInDev = true) {
  if (false) {
    const info = ErrorTypeStrings$1[type];
    if (contextVNode) {
      pushWarningContext(contextVNode);
    }
    warn$1$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
    if (contextVNode) {
      popWarningContext();
    }
    if (throwInDev) {
      throw err;
    } else {
      console.error(err);
    }
  } else {
    console.error(err);
  }
}
__name(logError, "logError");
let isFlushing = false;
let isFlushPending = false;
const queue = [];
let flushIndex = 0;
const pendingPostFlushCbs = [];
let activePostFlushCbs = null;
let postFlushIndex = 0;
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
let currentFlushPromise = null;
const RECURSION_LIMIT = 100;
function nextTick(fn) {
  const p2 = currentFlushPromise || resolvedPromise;
  return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
}
__name(nextTick, "nextTick");
function findInsertionIndex$1(id3) {
  let start2 = flushIndex + 1;
  let end = queue.length;
  while (start2 < end) {
    const middle = start2 + end >>> 1;
    const middleJob = queue[middle];
    const middleJobId = getId(middleJob);
    if (middleJobId < id3 || middleJobId === id3 && middleJob.pre) {
      start2 = middle + 1;
    } else {
      end = middle;
    }
  }
  return start2;
}
__name(findInsertionIndex$1, "findInsertionIndex$1");
function queueJob(job) {
  if (!queue.length || !queue.includes(
    job,
    isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  )) {
    if (job.id == null) {
      queue.push(job);
    } else {
      queue.splice(findInsertionIndex$1(job.id), 0, job);
    }
    queueFlush();
  }
}
__name(queueJob, "queueJob");
function queueFlush() {
  if (!isFlushing && !isFlushPending) {
    isFlushPending = true;
    currentFlushPromise = resolvedPromise.then(flushJobs);
  }
}
__name(queueFlush, "queueFlush");
function invalidateJob(job) {
  const i2 = queue.indexOf(job);
  if (i2 > flushIndex) {
    queue.splice(i2, 1);
  }
}
__name(invalidateJob, "invalidateJob");
function queuePostFlushCb(cb) {
  if (!isArray$4(cb)) {
    if (!activePostFlushCbs || !activePostFlushCbs.includes(
      cb,
      cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
    )) {
      pendingPostFlushCbs.push(cb);
    }
  } else {
    pendingPostFlushCbs.push(...cb);
  }
  queueFlush();
}
__name(queuePostFlushCb, "queuePostFlushCb");
function flushPreFlushCbs(instance, seen2, i2 = isFlushing ? flushIndex + 1 : 0) {
  if (false) {
    seen2 = seen2 || /* @__PURE__ */ new Map();
  }
  for (; i2 < queue.length; i2++) {
    const cb = queue[i2];
    if (cb && cb.pre) {
      if (instance && cb.id !== instance.uid) {
        continue;
      }
      if (false) {
        continue;
      }
      queue.splice(i2, 1);
      i2--;
      cb();
    }
  }
}
__name(flushPreFlushCbs, "flushPreFlushCbs");
function flushPostFlushCbs(seen2) {
  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;
    if (false) {
      seen2 = seen2 || /* @__PURE__ */ new Map();
    }
    for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
      const cb = activePostFlushCbs[postFlushIndex];
      if (false) {
        continue;
      }
      if (cb.active !== false) cb();
    }
    activePostFlushCbs = null;
    postFlushIndex = 0;
  }
}
__name(flushPostFlushCbs, "flushPostFlushCbs");
const getId = /* @__PURE__ */ __name((job) => job.id == null ? Infinity : job.id, "getId");
const comparator = /* @__PURE__ */ __name((a, b) => {
  const diff2 = getId(a) - getId(b);
  if (diff2 === 0) {
    if (a.pre && !b.pre) return -1;
    if (b.pre && !a.pre) return 1;
  }
  return diff2;
}, "comparator");
function flushJobs(seen2) {
  isFlushPending = false;
  isFlushing = true;
  if (false) {
    seen2 = seen2 || /* @__PURE__ */ new Map();
  }
  queue.sort(comparator);
  const check = false ? (job) => checkRecursiveUpdates(seen2, job) : NOOP;
  try {
    for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
      const job = queue[flushIndex];
      if (job && job.active !== false) {
        if (false) {
          continue;
        }
        callWithErrorHandling(job, null, 14);
      }
    }
  } finally {
    flushIndex = 0;
    queue.length = 0;
    flushPostFlushCbs(seen2);
    isFlushing = false;
    currentFlushPromise = null;
    if (queue.length || pendingPostFlushCbs.length) {
      flushJobs(seen2);
    }
  }
}
__name(flushJobs, "flushJobs");
function checkRecursiveUpdates(seen2, fn) {
  if (!seen2.has(fn)) {
    seen2.set(fn, 1);
  } else {
    const count = seen2.get(fn);
    if (count > RECURSION_LIMIT) {
      const instance = fn.ownerInstance;
      const componentName = instance && getComponentName(instance.type);
      handleError(
        `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
        null,
        10
      );
      return true;
    } else {
      seen2.set(fn, count + 1);
    }
  }
}
__name(checkRecursiveUpdates, "checkRecursiveUpdates");
let isHmrUpdating = false;
const hmrDirtyComponents = /* @__PURE__ */ new Set();
if (false) {
  getGlobalThis$1().__VUE_HMR_RUNTIME__ = {
    createRecord: tryWrap(createRecord),
    rerender: tryWrap(rerender),
    reload: tryWrap(reload)
  };
}
const map$1 = /* @__PURE__ */ new Map();
function registerHMR(instance) {
  const id3 = instance.type.__hmrId;
  let record = map$1.get(id3);
  if (!record) {
    createRecord(id3, instance.type);
    record = map$1.get(id3);
  }
  record.instances.add(instance);
}
__name(registerHMR, "registerHMR");
function unregisterHMR(instance) {
  map$1.get(instance.type.__hmrId).instances.delete(instance);
}
__name(unregisterHMR, "unregisterHMR");
function createRecord(id3, initialDef) {
  if (map$1.has(id3)) {
    return false;
  }
  map$1.set(id3, {
    initialDef: normalizeClassComponent(initialDef),
    instances: /* @__PURE__ */ new Set()
  });
  return true;
}
__name(createRecord, "createRecord");
function normalizeClassComponent(component) {
  return isClassComponent(component) ? component.__vccOpts : component;
}
__name(normalizeClassComponent, "normalizeClassComponent");
function rerender(id3, newRender) {
  const record = map$1.get(id3);
  if (!record) {
    return;
  }
  record.initialDef.render = newRender;
  [...record.instances].forEach((instance) => {
    if (newRender) {
      instance.render = newRender;
      normalizeClassComponent(instance.type).render = newRender;
    }
    instance.renderCache = [];
    isHmrUpdating = true;
    instance.effect.dirty = true;
    instance.update();
    isHmrUpdating = false;
  });
}
__name(rerender, "rerender");
function reload(id3, newComp) {
  const record = map$1.get(id3);
  if (!record) return;
  newComp = normalizeClassComponent(newComp);
  updateComponentDef(record.initialDef, newComp);
  const instances = [...record.instances];
  for (const instance of instances) {
    const oldComp = normalizeClassComponent(instance.type);
    if (!hmrDirtyComponents.has(oldComp)) {
      if (oldComp !== record.initialDef) {
        updateComponentDef(oldComp, newComp);
      }
      hmrDirtyComponents.add(oldComp);
    }
    instance.appContext.propsCache.delete(instance.type);
    instance.appContext.emitsCache.delete(instance.type);
    instance.appContext.optionsCache.delete(instance.type);
    if (instance.ceReload) {
      hmrDirtyComponents.add(oldComp);
      instance.ceReload(newComp.styles);
      hmrDirtyComponents.delete(oldComp);
    } else if (instance.parent) {
      instance.parent.effect.dirty = true;
      queueJob(() => {
        instance.parent.update();
        hmrDirtyComponents.delete(oldComp);
      });
    } else if (instance.appContext.reload) {
      instance.appContext.reload();
    } else if (typeof window !== "undefined") {
      window.location.reload();
    } else {
      console.warn(
        "[HMR] Root or manually mounted instance modified. Full reload required."
      );
    }
  }
  queuePostFlushCb(() => {
    for (const instance of instances) {
      hmrDirtyComponents.delete(
        normalizeClassComponent(instance.type)
      );
    }
  });
}
__name(reload, "reload");
function updateComponentDef(oldComp, newComp) {
  extend$1(oldComp, newComp);
  for (const key in oldComp) {
    if (key !== "__file" && !(key in newComp)) {
      delete oldComp[key];
    }
  }
}
__name(updateComponentDef, "updateComponentDef");
function tryWrap(fn) {
  return (id3, arg) => {
    try {
      return fn(id3, arg);
    } catch (e2) {
      console.error(e2);
      console.warn(
        `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
      );
    }
  };
}
__name(tryWrap, "tryWrap");
let devtools$1;
let buffer = [];
let devtoolsNotInstalled = false;
function emit$1(event, ...args) {
  if (devtools$1) {
    devtools$1.emit(event, ...args);
  } else if (!devtoolsNotInstalled) {
    buffer.push({ event, args });
  }
}
__name(emit$1, "emit$1");
function setDevtoolsHook$1(hook, target) {
  var _a2, _b;
  devtools$1 = hook;
  if (devtools$1) {
    devtools$1.enabled = true;
    buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
    buffer = [];
  } else if (
    // handle late devtools injection - only do this if we are in an actual
    // browser environment to avoid the timer handle stalling test runner exit
    // (#4815)
    typeof window !== "undefined" && // some envs mock window but not fully
    window.HTMLElement && // also exclude jsdom
    // eslint-disable-next-line no-restricted-syntax
    !((_b = (_a2 = window.navigator) == null ? void 0 : _a2.userAgent) == null ? void 0 : _b.includes("jsdom"))
  ) {
    const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
    replay.push((newHook) => {
      setDevtoolsHook$1(newHook, target);
    });
    setTimeout(() => {
      if (!devtools$1) {
        target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
        devtoolsNotInstalled = true;
        buffer = [];
      }
    }, 3e3);
  } else {
    devtoolsNotInstalled = true;
    buffer = [];
  }
}
__name(setDevtoolsHook$1, "setDevtoolsHook$1");
function devtoolsInitApp(app2, version2) {
  emit$1("app:init", app2, version2, {
    Fragment: Fragment$1,
    Text: Text$4,
    Comment,
    Static
  });
}
__name(devtoolsInitApp, "devtoolsInitApp");
function devtoolsUnmountApp(app2) {
  emit$1("app:unmount", app2);
}
__name(devtoolsUnmountApp, "devtoolsUnmountApp");
const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:added"
  /* COMPONENT_ADDED */
);
const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:updated"
  /* COMPONENT_UPDATED */
);
const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:removed"
  /* COMPONENT_REMOVED */
);
const devtoolsComponentRemoved = /* @__PURE__ */ __name((component) => {
  if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  !devtools$1.cleanupBuffer(component)) {
    _devtoolsComponentRemoved(component);
  }
}, "devtoolsComponentRemoved");
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function createDevtoolsComponentHook(hook) {
  return (component) => {
    emit$1(
      hook,
      component.appContext.app,
      component.uid,
      component.parent ? component.parent.uid : void 0,
      component
    );
  };
}
__name(createDevtoolsComponentHook, "createDevtoolsComponentHook");
const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  "perf:start"
  /* PERFORMANCE_START */
);
const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  "perf:end"
  /* PERFORMANCE_END */
);
function createDevtoolsPerformanceHook(hook) {
  return (component, type, time) => {
    emit$1(hook, component.appContext.app, component.uid, component, type, time);
  };
}
__name(createDevtoolsPerformanceHook, "createDevtoolsPerformanceHook");
function devtoolsComponentEmit(component, event, params) {
  emit$1(
    "component:emit",
    component.appContext.app,
    component,
    event,
    params
  );
}
__name(devtoolsComponentEmit, "devtoolsComponentEmit");
function emit(instance, event, ...rawArgs) {
  if (instance.isUnmounted) return;
  const props = instance.vnode.props || EMPTY_OBJ;
  if (false) {
    const {
      emitsOptions,
      propsOptions: [propsOptions]
    } = instance;
    if (emitsOptions) {
      if (!(event in emitsOptions) && true) {
        if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
          warn$1$1(
            `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
          );
        }
      } else {
        const validator3 = emitsOptions[event];
        if (isFunction$4(validator3)) {
          const isValid2 = validator3(...rawArgs);
          if (!isValid2) {
            warn$1$1(
              `Invalid event arguments: event validation failed for event "${event}".`
            );
          }
        }
      }
    }
  }
  let args = rawArgs;
  const isModelListener2 = event.startsWith("update:");
  const modelArg = isModelListener2 && event.slice(7);
  if (modelArg && modelArg in props) {
    const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
    const { number: number2, trim: trim2 } = props[modifiersKey] || EMPTY_OBJ;
    if (trim2) {
      args = rawArgs.map((a) => isString$7(a) ? a.trim() : a);
    }
    if (number2) {
      args = rawArgs.map(looseToNumber);
    }
  }
  if (false) {
    devtoolsComponentEmit(instance, event, args);
  }
  if (false) {
    const lowerCaseEvent = event.toLowerCase();
    if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
      warn$1$1(
        `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
          instance,
          instance.type
        )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate$1(
          event
        )}" instead of "${event}".`
      );
    }
  }
  let handlerName;
  let handler6 = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  props[handlerName = toHandlerKey(camelize$1(event))];
  if (!handler6 && isModelListener2) {
    handler6 = props[handlerName = toHandlerKey(hyphenate$1(event))];
  }
  if (handler6) {
    callWithAsyncErrorHandling(
      handler6,
      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
    );
  }
}
__name(emit, "emit");
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$4(comp)) {
    const extendEmits = /* @__PURE__ */ __name((raw2) => {
      const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
      if (normalizedFromExtend) {
        hasExtends = true;
        extend$1(normalized, normalizedFromExtend);
      }
    }, "extendEmits");
    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$6(comp)) {
      cache2.set(comp, null);
    }
    return null;
  }
  if (isArray$4(raw)) {
    raw.forEach((key) => normalized[key] = null);
  } else {
    extend$1(normalized, raw);
  }
  if (isObject$6(comp)) {
    cache2.set(comp, normalized);
  }
  return normalized;
}
__name(normalizeEmitsOptions, "normalizeEmitsOptions");
function isEmitListener(options4, key) {
  if (!options4 || !isOn(key)) {
    return false;
  }
  key = key.slice(2).replace(/Once$/, "");
  return hasOwn$3(options4, key[0].toLowerCase() + key.slice(1)) || hasOwn$3(options4, hyphenate$1(key)) || hasOwn$3(options4, key);
}
__name(isEmitListener, "isEmitListener");
let currentRenderingInstance = null;
let currentScopeId = null;
function setCurrentRenderingInstance(instance) {
  const prev2 = currentRenderingInstance;
  currentRenderingInstance = instance;
  currentScopeId = instance && instance.type.__scopeId || null;
  return prev2;
}
__name(setCurrentRenderingInstance, "setCurrentRenderingInstance");
function pushScopeId(id3) {
  currentScopeId = id3;
}
__name(pushScopeId, "pushScopeId");
function popScopeId() {
  currentScopeId = null;
}
__name(popScopeId, "popScopeId");
const withScopeId = /* @__PURE__ */ __name((_id2) => withCtx, "withScopeId");
function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  if (!ctx) return fn;
  if (fn._n) {
    return fn;
  }
  const renderFnWithContext = /* @__PURE__ */ __name((...args) => {
    if (renderFnWithContext._d) {
      setBlockTracking(-1);
    }
    const prevInstance = setCurrentRenderingInstance(ctx);
    let res;
    try {
      res = fn(...args);
    } finally {
      setCurrentRenderingInstance(prevInstance);
      if (renderFnWithContext._d) {
        setBlockTracking(1);
      }
    }
    if (false) {
      devtoolsComponentUpdated(ctx);
    }
    return res;
  }, "renderFnWithContext");
  renderFnWithContext._n = true;
  renderFnWithContext._c = true;
  renderFnWithContext._d = true;
  return renderFnWithContext;
}
__name(withCtx, "withCtx");
let accessedAttrs = false;
function markAttrsAccessed() {
  accessedAttrs = true;
}
__name(markAttrsAccessed, "markAttrsAccessed");
function renderComponentRoot(instance) {
  const {
    type: Component,
    vnode,
    proxy,
    withProxy,
    propsOptions: [propsOptions],
    slots,
    attrs: attrs4,
    emit: emit2,
    render: render2,
    renderCache,
    props,
    data: data24,
    setupState,
    ctx,
    inheritAttrs
  } = instance;
  const prev2 = setCurrentRenderingInstance(instance);
  let result;
  let fallthroughAttrs;
  if (false) {
    accessedAttrs = false;
  }
  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,
          data24,
          ctx
        )
      );
      fallthroughAttrs = attrs4;
    } else {
      const render22 = Component;
      if (false) {
        markAttrsAccessed();
      }
      result = normalizeVNode(
        render22.length > 1 ? render22(
          false ? shallowReadonly(props) : props,
          false ? {
            get attrs() {
              markAttrsAccessed();
              return shallowReadonly(attrs4);
            },
            slots,
            emit: emit2
          } : { attrs: attrs4, slots, emit: emit2 }
        ) : render22(
          false ? shallowReadonly(props) : props,
          null
        )
      );
      fallthroughAttrs = Component.props ? attrs4 : getFunctionalFallthrough(attrs4);
    }
  } catch (err) {
    blockStack.length = 0;
    handleError(err, instance, 1);
    result = createVNode(Comment);
  }
  let root24 = result;
  let setRoot = void 0;
  if (false) {
    [root24, setRoot] = getChildRoot(result);
  }
  if (fallthroughAttrs && inheritAttrs !== false) {
    const keys2 = Object.keys(fallthroughAttrs);
    const { shapeFlag } = root24;
    if (keys2.length) {
      if (shapeFlag & (1 | 6)) {
        if (propsOptions && keys2.some(isModelListener)) {
          fallthroughAttrs = filterModelListeners(
            fallthroughAttrs,
            propsOptions
          );
        }
        root24 = cloneVNode(root24, fallthroughAttrs, false, true);
      } else if (false) {
        const allAttrs = Object.keys(attrs4);
        const eventAttrs = [];
        const extraAttrs = [];
        for (let i2 = 0, l = allAttrs.length; i2 < l; i2++) {
          const key = allAttrs[i2];
          if (isOn(key)) {
            if (!isModelListener(key)) {
              eventAttrs.push(key[2].toLowerCase() + key.slice(3));
            }
          } else {
            extraAttrs.push(key);
          }
        }
        if (extraAttrs.length) {
          warn$1$1(
            `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
          );
        }
        if (eventAttrs.length) {
          warn$1$1(
            `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
          );
        }
      }
    }
  }
  if (vnode.dirs) {
    if (false) {
      warn$1$1(
        `Runtime directive used on component with non-element root node. The directives will not function as intended.`
      );
    }
    root24 = cloneVNode(root24, null, false, true);
    root24.dirs = root24.dirs ? root24.dirs.concat(vnode.dirs) : vnode.dirs;
  }
  if (vnode.transition) {
    if (false) {
      warn$1$1(
        `Component inside <Transition> renders non-element root node that cannot be animated.`
      );
    }
    root24.transition = vnode.transition;
  }
  if (false) {
    setRoot(root24);
  } else {
    result = root24;
  }
  setCurrentRenderingInstance(prev2);
  return result;
}
__name(renderComponentRoot, "renderComponentRoot");
const getChildRoot = /* @__PURE__ */ __name((vnode) => {
  const rawChildren = vnode.children;
  const dynamicChildren = vnode.dynamicChildren;
  const childRoot = filterSingleRoot(rawChildren, false);
  if (!childRoot) {
    return [vnode, void 0];
  } else if (false) {
    return getChildRoot(childRoot);
  }
  const index2 = rawChildren.indexOf(childRoot);
  const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  const setRoot = /* @__PURE__ */ __name((updatedRoot) => {
    rawChildren[index2] = updatedRoot;
    if (dynamicChildren) {
      if (dynamicIndex > -1) {
        dynamicChildren[dynamicIndex] = updatedRoot;
      } else if (updatedRoot.patchFlag > 0) {
        vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
      }
    }
  }, "setRoot");
  return [normalizeVNode(childRoot), setRoot];
}, "getChildRoot");
function filterSingleRoot(children, recurse = true) {
  let singleRoot;
  for (let i2 = 0; i2 < children.length; i2++) {
    const child = children[i2];
    if (isVNode$1(child)) {
      if (child.type !== Comment || child.children === "v-if") {
        if (singleRoot) {
          return;
        } else {
          singleRoot = child;
          if (false) {
            return filterSingleRoot(singleRoot.children);
          }
        }
      }
    } else {
      return;
    }
  }
  return singleRoot;
}
__name(filterSingleRoot, "filterSingleRoot");
const getFunctionalFallthrough = /* @__PURE__ */ __name((attrs4) => {
  let res;
  for (const key in attrs4) {
    if (key === "class" || key === "style" || isOn(key)) {
      (res || (res = {}))[key] = attrs4[key];
    }
  }
  return res;
}, "getFunctionalFallthrough");
const filterModelListeners = /* @__PURE__ */ __name((attrs4, props) => {
  const res = {};
  for (const key in attrs4) {
    if (!isModelListener(key) || !(key.slice(9) in props)) {
      res[key] = attrs4[key];
    }
  }
  return res;
}, "filterModelListeners");
const isElementRoot = /* @__PURE__ */ __name((vnode) => {
  return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
}, "isElementRoot");
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  const { props: prevProps, children: prevChildren, component } = prevVNode;
  const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  const emits = component.emitsOptions;
  if (false) {
    return true;
  }
  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 i2 = 0; i2 < dynamicProps.length; i2++) {
        const key = dynamicProps[i2];
        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;
}
__name(shouldUpdateComponent, "shouldUpdateComponent");
function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  const nextKeys = Object.keys(nextProps);
  if (nextKeys.length !== Object.keys(prevProps).length) {
    return true;
  }
  for (let i2 = 0; i2 < nextKeys.length; i2++) {
    const key = nextKeys[i2];
    if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
      return true;
    }
  }
  return false;
}
__name(hasPropsChanged, "hasPropsChanged");
function updateHOCHostEl({ vnode, parent }, el) {
  while (parent) {
    const root24 = parent.subTree;
    if (root24.suspense && root24.suspense.activeBranch === vnode) {
      root24.el = vnode.el;
    }
    if (root24 === vnode) {
      (vnode = parent.vnode).el = el;
      parent = parent.parent;
    } else {
      break;
    }
  }
}
__name(updateHOCHostEl, "updateHOCHostEl");
const COMPONENTS = "components";
const DIRECTIVES = "directives";
function resolveComponent(name2, maybeSelfReference) {
  return resolveAsset(COMPONENTS, name2, true, maybeSelfReference) || name2;
}
__name(resolveComponent, "resolveComponent");
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
function resolveDynamicComponent(component) {
  if (isString$7(component)) {
    return resolveAsset(COMPONENTS, component, false) || component;
  } else {
    return component || NULL_DYNAMIC_COMPONENT;
  }
}
__name(resolveDynamicComponent, "resolveDynamicComponent");
function resolveDirective(name2) {
  return resolveAsset(DIRECTIVES, name2);
}
__name(resolveDirective, "resolveDirective");
function resolveAsset(type, name2, warnMissing = true, maybeSelfReference = false) {
  const instance = currentRenderingInstance || currentInstance;
  if (instance) {
    const Component = instance.type;
    if (type === COMPONENTS) {
      const selfName = getComponentName(
        Component,
        false
      );
      if (selfName && (selfName === name2 || selfName === camelize$1(name2) || selfName === capitalize$1(camelize$1(name2)))) {
        return Component;
      }
    }
    const res = (
      // local registration
      // check instance[type] first which is resolved for options API
      resolve(instance[type] || Component[type], name2) || // global registration
      resolve(instance.appContext[type], name2)
    );
    if (!res && maybeSelfReference) {
      return Component;
    }
    if (false) {
      const extra = type === COMPONENTS ? `
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
      warn$1$1(`Failed to resolve ${type.slice(0, -1)}: ${name2}${extra}`);
    }
    return res;
  } else if (false) {
    warn$1$1(
      `resolve${capitalize$1(type.slice(0, -1))} can only be used in render() or setup().`
    );
  }
}
__name(resolveAsset, "resolveAsset");
function resolve(registry, name2) {
  return registry && (registry[name2] || registry[camelize$1(name2)] || registry[capitalize$1(camelize$1(name2))]);
}
__name(resolve, "resolve");
const isSuspense = /* @__PURE__ */ __name((type) => type.__isSuspense, "isSuspense");
let suspenseId = 0;
const SuspenseImpl = {
  name: "Suspense",
  // In order to make Suspense tree-shakable, we need to avoid importing it
  // directly in the renderer. The renderer checks for the __isSuspense flag
  // on a vnode's type and calls the `process` method, passing in renderer
  // internals.
  __isSuspense: true,
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
    if (n1 == null) {
      mountSuspense(
        n2,
        container,
        anchor,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized,
        rendererInternals
      );
    } else {
      if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
        n2.suspense = n1.suspense;
        n2.suspense.vnode = n2;
        n2.el = n1.el;
        return;
      }
      patchSuspense(
        n1,
        n2,
        container,
        anchor,
        parentComponent,
        namespace,
        slotScopeIds,
        optimized,
        rendererInternals
      );
    }
  },
  hydrate: hydrateSuspense,
  normalize: normalizeSuspenseChildren
};
const Suspense = SuspenseImpl;
function triggerEvent(vnode, name2) {
  const eventListener = vnode.props && vnode.props[name2];
  if (isFunction$4(eventListener)) {
    eventListener();
  }
}
__name(triggerEvent, "triggerEvent");
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  const {
    p: patch2,
    o: { createElement: createElement2 }
  } = rendererInternals;
  const hiddenContainer = createElement2("div");
  const suspense = vnode.suspense = createSuspenseBoundary(
    vnode,
    parentSuspense,
    parentComponent,
    container,
    hiddenContainer,
    anchor,
    namespace,
    slotScopeIds,
    optimized,
    rendererInternals
  );
  patch2(
    null,
    suspense.pendingBranch = vnode.ssContent,
    hiddenContainer,
    null,
    parentComponent,
    suspense,
    namespace,
    slotScopeIds
  );
  if (suspense.deps > 0) {
    triggerEvent(vnode, "onPending");
    triggerEvent(vnode, "onFallback");
    patch2(
      null,
      vnode.ssFallback,
      container,
      anchor,
      parentComponent,
      null,
      // fallback tree will not have suspense context
      namespace,
      slotScopeIds
    );
    setActiveBranch(suspense, vnode.ssFallback);
  } else {
    suspense.resolve(false, true);
  }
}
__name(mountSuspense, "mountSuspense");
function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch2, um: unmount, o: { createElement: createElement2 } }) {
  const suspense = n2.suspense = n1.suspense;
  suspense.vnode = n2;
  n2.el = n1.el;
  const newBranch = n2.ssContent;
  const newFallback = n2.ssFallback;
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  if (pendingBranch) {
    suspense.pendingBranch = newBranch;
    if (isSameVNodeType(newBranch, pendingBranch)) {
      patch2(
        pendingBranch,
        newBranch,
        suspense.hiddenContainer,
        null,
        parentComponent,
        suspense,
        namespace,
        slotScopeIds,
        optimized
      );
      if (suspense.deps <= 0) {
        suspense.resolve();
      } else if (isInFallback) {
        if (!isHydrating) {
          patch2(
            activeBranch,
            newFallback,
            container,
            anchor,
            parentComponent,
            null,
            // fallback tree will not have suspense context
            namespace,
            slotScopeIds,
            optimized
          );
          setActiveBranch(suspense, newFallback);
        }
      }
    } else {
      suspense.pendingId = suspenseId++;
      if (isHydrating) {
        suspense.isHydrating = false;
        suspense.activeBranch = pendingBranch;
      } else {
        unmount(pendingBranch, parentComponent, suspense);
      }
      suspense.deps = 0;
      suspense.effects.length = 0;
      suspense.hiddenContainer = createElement2("div");
      if (isInFallback) {
        patch2(
          null,
          newBranch,
          suspense.hiddenContainer,
          null,
          parentComponent,
          suspense,
          namespace,
          slotScopeIds,
          optimized
        );
        if (suspense.deps <= 0) {
          suspense.resolve();
        } else {
          patch2(
            activeBranch,
            newFallback,
            container,
            anchor,
            parentComponent,
            null,
            // fallback tree will not have suspense context
            namespace,
            slotScopeIds,
            optimized
          );
          setActiveBranch(suspense, newFallback);
        }
      } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
        patch2(
          activeBranch,
          newBranch,
          container,
          anchor,
          parentComponent,
          suspense,
          namespace,
          slotScopeIds,
          optimized
        );
        suspense.resolve(true);
      } else {
        patch2(
          null,
          newBranch,
          suspense.hiddenContainer,
          null,
          parentComponent,
          suspense,
          namespace,
          slotScopeIds,
          optimized
        );
        if (suspense.deps <= 0) {
          suspense.resolve();
        }
      }
    }
  } else {
    if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
      patch2(
        activeBranch,
        newBranch,
        container,
        anchor,
        parentComponent,
        suspense,
        namespace,
        slotScopeIds,
        optimized
      );
      setActiveBranch(suspense, newBranch);
    } else {
      triggerEvent(n2, "onPending");
      suspense.pendingBranch = newBranch;
      if (newBranch.shapeFlag & 512) {
        suspense.pendingId = newBranch.component.suspenseId;
      } else {
        suspense.pendingId = suspenseId++;
      }
      patch2(
        null,
        newBranch,
        suspense.hiddenContainer,
        null,
        parentComponent,
        suspense,
        namespace,
        slotScopeIds,
        optimized
      );
      if (suspense.deps <= 0) {
        suspense.resolve();
      } else {
        const { timeout, pendingId } = suspense;
        if (timeout > 0) {
          setTimeout(() => {
            if (suspense.pendingId === pendingId) {
              suspense.fallback(newFallback);
            }
          }, timeout);
        } else if (timeout === 0) {
          suspense.fallback(newFallback);
        }
      }
    }
  }
}
__name(patchSuspense, "patchSuspense");
let hasWarned$1 = false;
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  if (false) {
    hasWarned$1 = true;
    console[console.info ? "info" : "log"](
      `<Suspense> is an experimental feature and its API will likely change.`
    );
  }
  const {
    p: patch2,
    m: move,
    um: unmount,
    n: next2,
    o: { parentNode: parentNode2, remove: remove22 }
  } = rendererInternals;
  let parentSuspenseId;
  const isSuspensible = isVNodeSuspensible(vnode);
  if (isSuspensible) {
    if (parentSuspense && parentSuspense.pendingBranch) {
      parentSuspenseId = parentSuspense.pendingId;
      parentSuspense.deps++;
    }
  }
  const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  if (false) {
    assertNumber(timeout, `Suspense timeout`);
  }
  const initialAnchor = anchor;
  const suspense = {
    vnode,
    parent: parentSuspense,
    parentComponent,
    namespace,
    container,
    hiddenContainer,
    deps: 0,
    pendingId: suspenseId++,
    timeout: typeof timeout === "number" ? timeout : -1,
    activeBranch: null,
    pendingBranch: null,
    isInFallback: !isHydrating,
    isHydrating,
    isUnmounted: false,
    effects: [],
    resolve(resume = false, sync = false) {
      if (false) {
        if (!resume && !suspense.pendingBranch) {
          throw new Error(
            `suspense.resolve() is called without a pending branch.`
          );
        }
        if (suspense.isUnmounted) {
          throw new Error(
            `suspense.resolve() is called on an already unmounted suspense boundary.`
          );
        }
      }
      const {
        vnode: vnode2,
        activeBranch,
        pendingBranch,
        pendingId,
        effects,
        parentComponent: parentComponent2,
        container: container2
      } = suspense;
      let delayEnter = false;
      if (suspense.isHydrating) {
        suspense.isHydrating = false;
      } else if (!resume) {
        delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
        if (delayEnter) {
          activeBranch.transition.afterLeave = () => {
            if (pendingId === suspense.pendingId) {
              move(
                pendingBranch,
                container2,
                anchor === initialAnchor ? next2(activeBranch) : anchor,
                0
              );
              queuePostFlushCb(effects);
            }
          };
        }
        if (activeBranch) {
          if (parentNode2(activeBranch.el) !== suspense.hiddenContainer) {
            anchor = next2(activeBranch);
          }
          unmount(activeBranch, parentComponent2, suspense, true);
        }
        if (!delayEnter) {
          move(pendingBranch, container2, anchor, 0);
        }
      }
      setActiveBranch(suspense, pendingBranch);
      suspense.pendingBranch = null;
      suspense.isInFallback = false;
      let parent = suspense.parent;
      let hasUnresolvedAncestor = false;
      while (parent) {
        if (parent.pendingBranch) {
          parent.effects.push(...effects);
          hasUnresolvedAncestor = true;
          break;
        }
        parent = parent.parent;
      }
      if (!hasUnresolvedAncestor && !delayEnter) {
        queuePostFlushCb(effects);
      }
      suspense.effects = [];
      if (isSuspensible) {
        if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
          parentSuspense.deps--;
          if (parentSuspense.deps === 0 && !sync) {
            parentSuspense.resolve();
          }
        }
      }
      triggerEvent(vnode2, "onResolve");
    },
    fallback(fallbackVNode) {
      if (!suspense.pendingBranch) {
        return;
      }
      const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
      triggerEvent(vnode2, "onFallback");
      const anchor2 = next2(activeBranch);
      const mountFallback = /* @__PURE__ */ __name(() => {
        if (!suspense.isInFallback) {
          return;
        }
        patch2(
          null,
          fallbackVNode,
          container2,
          anchor2,
          parentComponent2,
          null,
          // fallback tree will not have suspense context
          namespace2,
          slotScopeIds,
          optimized
        );
        setActiveBranch(suspense, fallbackVNode);
      }, "mountFallback");
      const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
      if (delayEnter) {
        activeBranch.transition.afterLeave = mountFallback;
      }
      suspense.isInFallback = true;
      unmount(
        activeBranch,
        parentComponent2,
        null,
        // no suspense so unmount hooks fire now
        true
        // shouldRemove
      );
      if (!delayEnter) {
        mountFallback();
      }
    },
    move(container2, anchor2, type) {
      suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
      suspense.container = container2;
    },
    next() {
      return suspense.activeBranch && next2(suspense.activeBranch);
    },
    registerDep(instance, setupRenderEffect, optimized2) {
      const isInPendingSuspense = !!suspense.pendingBranch;
      if (isInPendingSuspense) {
        suspense.deps++;
      }
      const hydratedEl = instance.vnode.el;
      instance.asyncDep.catch((err) => {
        handleError(err, instance, 0);
      }).then((asyncSetupResult) => {
        if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
          return;
        }
        instance.asyncResolved = true;
        const { vnode: vnode2 } = instance;
        if (false) {
          pushWarningContext(vnode2);
        }
        handleSetupResult(instance, asyncSetupResult, false);
        if (hydratedEl) {
          vnode2.el = hydratedEl;
        }
        const placeholder = !hydratedEl && instance.subTree.el;
        setupRenderEffect(
          instance,
          vnode2,
          // component may have been moved before resolve.
          // if this is not a hydration, instance.subTree will be the comment
          // placeholder.
          parentNode2(hydratedEl || instance.subTree.el),
          // anchor will not be used if this is hydration, so only need to
          // consider the comment placeholder case.
          hydratedEl ? null : next2(instance.subTree),
          suspense,
          namespace,
          optimized2
        );
        if (placeholder) {
          remove22(placeholder);
        }
        updateHOCHostEl(instance, vnode2.el);
        if (false) {
          popWarningContext();
        }
        if (isInPendingSuspense && --suspense.deps === 0) {
          suspense.resolve();
        }
      });
    },
    unmount(parentSuspense2, doRemove) {
      suspense.isUnmounted = true;
      if (suspense.activeBranch) {
        unmount(
          suspense.activeBranch,
          parentComponent,
          parentSuspense2,
          doRemove
        );
      }
      if (suspense.pendingBranch) {
        unmount(
          suspense.pendingBranch,
          parentComponent,
          parentSuspense2,
          doRemove
        );
      }
    }
  };
  return suspense;
}
__name(createSuspenseBoundary, "createSuspenseBoundary");
function hydrateSuspense(node3, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  const suspense = vnode.suspense = createSuspenseBoundary(
    vnode,
    parentSuspense,
    parentComponent,
    node3.parentNode,
    // eslint-disable-next-line no-restricted-globals
    document.createElement("div"),
    null,
    namespace,
    slotScopeIds,
    optimized,
    rendererInternals,
    true
  );
  const result = hydrateNode(
    node3,
    suspense.pendingBranch = vnode.ssContent,
    parentComponent,
    suspense,
    slotScopeIds,
    optimized
  );
  if (suspense.deps === 0) {
    suspense.resolve(false, true);
  }
  return result;
}
__name(hydrateSuspense, "hydrateSuspense");
function normalizeSuspenseChildren(vnode) {
  const { shapeFlag, children } = vnode;
  const isSlotChildren = shapeFlag & 32;
  vnode.ssContent = normalizeSuspenseSlot(
    isSlotChildren ? children.default : children
  );
  vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
}
__name(normalizeSuspenseChildren, "normalizeSuspenseChildren");
function normalizeSuspenseSlot(s) {
  let block3;
  if (isFunction$4(s)) {
    const trackBlock = isBlockTreeEnabled && s._c;
    if (trackBlock) {
      s._d = false;
      openBlock();
    }
    s = s();
    if (trackBlock) {
      s._d = true;
      block3 = currentBlock;
      closeBlock();
    }
  }
  if (isArray$4(s)) {
    const singleChild = filterSingleRoot(s);
    if (false) {
      warn$1$1(`<Suspense> slots expect a single root node.`);
    }
    s = singleChild;
  }
  s = normalizeVNode(s);
  if (block3 && !s.dynamicChildren) {
    s.dynamicChildren = block3.filter((c) => c !== s);
  }
  return s;
}
__name(normalizeSuspenseSlot, "normalizeSuspenseSlot");
function queueEffectWithSuspense(fn, suspense) {
  if (suspense && suspense.pendingBranch) {
    if (isArray$4(fn)) {
      suspense.effects.push(...fn);
    } else {
      suspense.effects.push(fn);
    }
  } else {
    queuePostFlushCb(fn);
  }
}
__name(queueEffectWithSuspense, "queueEffectWithSuspense");
function setActiveBranch(suspense, branch) {
  suspense.activeBranch = branch;
  const { vnode, parentComponent } = suspense;
  let el = branch.el;
  while (!el && branch.component) {
    branch = branch.component.subTree;
    el = branch.el;
  }
  vnode.el = el;
  if (parentComponent && parentComponent.subTree === vnode) {
    parentComponent.vnode.el = el;
    updateHOCHostEl(parentComponent, el);
  }
}
__name(setActiveBranch, "setActiveBranch");
function isVNodeSuspensible(vnode) {
  const suspensible = vnode.props && vnode.props.suspensible;
  return suspensible != null && suspensible !== false;
}
__name(isVNodeSuspensible, "isVNodeSuspensible");
function injectHook(type, hook, target = currentInstance, prepend2 = false) {
  if (target) {
    const hooks = target[type] || (target[type] = []);
    const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
      pauseTracking();
      const reset2 = setCurrentInstance(target);
      const res = callWithAsyncErrorHandling(hook, target, type, args);
      reset2();
      resetTracking();
      return res;
    });
    if (prepend2) {
      hooks.unshift(wrappedHook);
    } else {
      hooks.push(wrappedHook);
    }
    return wrappedHook;
  } else if (false) {
    const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
    warn$1$1(
      `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`
    );
  }
}
__name(injectHook, "injectHook");
const createHook = /* @__PURE__ */ __name((lifecycle2) => (hook, target = currentInstance) => {
  if (!isInSSRComponentSetup || lifecycle2 === "sp") {
    injectHook(lifecycle2, (...args) => hook(...args), target);
  }
}, "createHook");
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);
}
__name(onErrorCaptured, "onErrorCaptured");
function validateDirectiveName(name2) {
  if (isBuiltInDirective(name2)) {
    warn$1$1("Do not use built-in directive ids as custom directive id: " + name2);
  }
}
__name(validateDirectiveName, "validateDirectiveName");
function withDirectives(vnode, directives) {
  if (currentRenderingInstance === null) {
    return vnode;
  }
  const instance = getComponentPublicInstance(currentRenderingInstance);
  const bindings = vnode.dirs || (vnode.dirs = []);
  for (let i2 = 0; i2 < directives.length; i2++) {
    let [dir, value4, arg, modifiers2 = EMPTY_OBJ] = directives[i2];
    if (dir) {
      if (isFunction$4(dir)) {
        dir = {
          mounted: dir,
          updated: dir
        };
      }
      if (dir.deep) {
        traverse(value4);
      }
      bindings.push({
        dir,
        instance,
        value: value4,
        oldValue: void 0,
        arg,
        modifiers: modifiers2
      });
    }
  }
  return vnode;
}
__name(withDirectives, "withDirectives");
function invokeDirectiveHook(vnode, prevVNode, instance, name2) {
  const bindings = vnode.dirs;
  const oldBindings = prevVNode && prevVNode.dirs;
  for (let i2 = 0; i2 < bindings.length; i2++) {
    const binding = bindings[i2];
    if (oldBindings) {
      binding.oldValue = oldBindings[i2].value;
    }
    let hook = binding.dir[name2];
    if (hook) {
      pauseTracking();
      callWithAsyncErrorHandling(hook, instance, 8, [
        vnode.el,
        binding,
        vnode,
        prevVNode
      ]);
      resetTracking();
    }
  }
}
__name(invokeDirectiveHook, "invokeDirectiveHook");
function renderList(source, renderItem, cache2, index2) {
  let ret;
  const cached = cache2 && cache2[index2];
  if (isArray$4(source) || isString$7(source)) {
    ret = new Array(source.length);
    for (let i2 = 0, l = source.length; i2 < l; i2++) {
      ret[i2] = renderItem(source[i2], i2, void 0, cached && cached[i2]);
    }
  } else if (typeof source === "number") {
    if (false) {
      warn$1$1(`The v-for range expect an integer value but got ${source}.`);
    }
    ret = new Array(source);
    for (let i2 = 0; i2 < source; i2++) {
      ret[i2] = renderItem(i2 + 1, i2, void 0, cached && cached[i2]);
    }
  } else if (isObject$6(source)) {
    if (source[Symbol.iterator]) {
      ret = Array.from(
        source,
        (item3, i2) => renderItem(item3, i2, void 0, cached && cached[i2])
      );
    } else {
      const keys2 = Object.keys(source);
      ret = new Array(keys2.length);
      for (let i2 = 0, l = keys2.length; i2 < l; i2++) {
        const key = keys2[i2];
        ret[i2] = renderItem(source[key], key, i2, cached && cached[i2]);
      }
    }
  } else {
    ret = [];
  }
  if (cache2) {
    cache2[index2] = ret;
  }
  return ret;
}
__name(renderList, "renderList");
function createSlots(slots, dynamicSlots) {
  for (let i2 = 0; i2 < dynamicSlots.length; i2++) {
    const slot = dynamicSlots[i2];
    if (isArray$4(slot)) {
      for (let j = 0; j < slot.length; j++) {
        slots[slot[j].name] = slot[j].fn;
      }
    } else if (slot) {
      slots[slot.name] = slot.key ? (...args) => {
        const res = slot.fn(...args);
        if (res) res.key = slot.key;
        return res;
      } : slot.fn;
    }
  }
  return slots;
}
__name(createSlots, "createSlots");
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function defineComponent(options4, extraOptions) {
  return isFunction$4(options4) ? (
    // #8326: 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$1({ name: options4.name }, extraOptions, { setup: options4 }))()
  ) : options4;
}
__name(defineComponent, "defineComponent");
const isAsyncWrapper = /* @__PURE__ */ __name((i2) => !!i2.type.__asyncLoader, "isAsyncWrapper");
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function defineAsyncComponent(source) {
  if (isFunction$4(source)) {
    source = { loader: source };
  }
  const {
    loader,
    loadingComponent,
    errorComponent,
    delay = 200,
    timeout,
    // undefined = never times out
    suspensible = true,
    onError: userOnError
  } = source;
  let pendingRequest = null;
  let resolvedComp;
  let retries = 0;
  const retry = /* @__PURE__ */ __name(() => {
    retries++;
    pendingRequest = null;
    return load2();
  }, "retry");
  const load2 = /* @__PURE__ */ __name(() => {
    let thisRequest;
    return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
      err = err instanceof Error ? err : new Error(String(err));
      if (userOnError) {
        return new Promise((resolve2, reject3) => {
          const userRetry = /* @__PURE__ */ __name(() => resolve2(retry()), "userRetry");
          const userFail = /* @__PURE__ */ __name(() => reject3(err), "userFail");
          userOnError(err, userRetry, userFail, retries + 1);
        });
      } else {
        throw err;
      }
    }).then((comp) => {
      if (thisRequest !== pendingRequest && pendingRequest) {
        return pendingRequest;
      }
      if (false) {
        warn$1$1(
          `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
        );
      }
      if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
        comp = comp.default;
      }
      if (false) {
        throw new Error(`Invalid async component load result: ${comp}`);
      }
      resolvedComp = comp;
      return comp;
    }));
  }, "load");
  return /* @__PURE__ */ defineComponent({
    name: "AsyncComponentWrapper",
    __asyncLoader: load2,
    get __asyncResolved() {
      return resolvedComp;
    },
    setup() {
      const instance = currentInstance;
      if (resolvedComp) {
        return () => createInnerComp(resolvedComp, instance);
      }
      const onError = /* @__PURE__ */ __name((err) => {
        pendingRequest = null;
        handleError(
          err,
          instance,
          13,
          !errorComponent
        );
      }, "onError");
      if (suspensible && instance.suspense || isInSSRComponentSetup) {
        return load2().then((comp) => {
          return () => createInnerComp(comp, instance);
        }).catch((err) => {
          onError(err);
          return () => errorComponent ? createVNode(errorComponent, {
            error: err
          }) : null;
        });
      }
      const loaded = ref(false);
      const error2 = ref();
      const delayed = ref(!!delay);
      if (delay) {
        setTimeout(() => {
          delayed.value = false;
        }, delay);
      }
      if (timeout != null) {
        setTimeout(() => {
          if (!loaded.value && !error2.value) {
            const err = new Error(
              `Async component timed out after ${timeout}ms.`
            );
            onError(err);
            error2.value = err;
          }
        }, timeout);
      }
      load2().then(() => {
        loaded.value = true;
        if (instance.parent && isKeepAlive(instance.parent.vnode)) {
          instance.parent.effect.dirty = true;
          queueJob(instance.parent.update);
        }
      }).catch((err) => {
        onError(err);
        error2.value = err;
      });
      return () => {
        if (loaded.value && resolvedComp) {
          return createInnerComp(resolvedComp, instance);
        } else if (error2.value && errorComponent) {
          return createVNode(errorComponent, {
            error: error2.value
          });
        } else if (loadingComponent && !delayed.value) {
          return createVNode(loadingComponent);
        }
      };
    }
  });
}
__name(defineAsyncComponent, "defineAsyncComponent");
function createInnerComp(comp, parent) {
  const { ref: ref22, props, children, ce } = parent.vnode;
  const vnode = createVNode(comp, props, children);
  vnode.ref = ref22;
  vnode.ce = ce;
  delete parent.vnode.ce;
  return vnode;
}
__name(createInnerComp, "createInnerComp");
function renderSlot(slots, name2, props = {}, fallback, noSlotted) {
  if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
    if (name2 !== "default") props.name = name2;
    return createVNode("slot", props, fallback && fallback());
  }
  let slot = slots[name2];
  if (false) {
    warn$1$1(
      `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
    );
    slot = /* @__PURE__ */ __name(() => [], "slot");
  }
  if (slot && slot._c) {
    slot._d = false;
  }
  openBlock();
  const validSlotContent = slot && ensureValidVNode(slot(props));
  const rendered = createBlock(
    Fragment$1,
    {
      key: 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 || `_${name2}`
    },
    validSlotContent || (fallback ? fallback() : []),
    validSlotContent && slots._ === 1 ? 64 : -2
  );
  if (!noSlotted && rendered.scopeId) {
    rendered.slotScopeIds = [rendered.scopeId + "-s"];
  }
  if (slot && slot._c) {
    slot._d = true;
  }
  return rendered;
}
__name(renderSlot, "renderSlot");
function ensureValidVNode(vnodes) {
  return vnodes.some((child) => {
    if (!isVNode$1(child)) return true;
    if (child.type === Comment) return false;
    if (child.type === Fragment$1 && !ensureValidVNode(child.children))
      return false;
    return true;
  }) ? vnodes : null;
}
__name(ensureValidVNode, "ensureValidVNode");
function toHandlers(obj, preserveCaseIfNecessary) {
  const ret = {};
  if (false) {
    warn$1$1(`v-on with no argument expects an object value.`);
    return ret;
  }
  for (const key in obj) {
    ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  }
  return ret;
}
__name(toHandlers, "toHandlers");
const getPublicInstance = /* @__PURE__ */ __name((i2) => {
  if (!i2) return null;
  if (isStatefulComponent(i2)) return getComponentPublicInstance(i2);
  return getPublicInstance(i2.parent);
}, "getPublicInstance");
const publicPropertiesMap = (
  // Move PURE marker to new line to workaround compiler discarding it
  // due to type annotation
  /* @__PURE__ */ extend$1(/* @__PURE__ */ Object.create(null), {
    $: /* @__PURE__ */ __name((i2) => i2, "$"),
    $el: /* @__PURE__ */ __name((i2) => i2.vnode.el, "$el"),
    $data: /* @__PURE__ */ __name((i2) => i2.data, "$data"),
    $props: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.props) : i2.props, "$props"),
    $attrs: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.attrs) : i2.attrs, "$attrs"),
    $slots: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.slots) : i2.slots, "$slots"),
    $refs: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.refs) : i2.refs, "$refs"),
    $parent: /* @__PURE__ */ __name((i2) => getPublicInstance(i2.parent), "$parent"),
    $root: /* @__PURE__ */ __name((i2) => getPublicInstance(i2.root), "$root"),
    $emit: /* @__PURE__ */ __name((i2) => i2.emit, "$emit"),
    $options: /* @__PURE__ */ __name((i2) => true ? resolveMergedOptions(i2) : i2.type, "$options"),
    $forceUpdate: /* @__PURE__ */ __name((i2) => i2.f || (i2.f = () => {
      i2.effect.dirty = true;
      queueJob(i2.update);
    }), "$forceUpdate"),
    $nextTick: /* @__PURE__ */ __name((i2) => i2.n || (i2.n = nextTick.bind(i2.proxy)), "$nextTick"),
    $watch: /* @__PURE__ */ __name((i2) => true ? instanceWatch.bind(i2) : NOOP, "$watch")
  })
);
const isReservedPrefix = /* @__PURE__ */ __name((key) => key === "_" || key === "$", "isReservedPrefix");
const hasSetupBinding = /* @__PURE__ */ __name((state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$3(state, key), "hasSetupBinding");
const PublicInstanceProxyHandlers = {
  get({ _: instance }, key) {
    if (key === "__v_skip") {
      return true;
    }
    const { ctx, setupState, data: data24, props, accessCache, type, appContext } = instance;
    if (false) {
      return true;
    }
    let normalizedProps;
    if (key[0] !== "$") {
      const n = accessCache[key];
      if (n !== void 0) {
        switch (n) {
          case 1:
            return setupState[key];
          case 2:
            return data24[key];
          case 4:
            return ctx[key];
          case 3:
            return props[key];
        }
      } else if (hasSetupBinding(setupState, key)) {
        accessCache[key] = 1;
        return setupState[key];
      } else if (data24 !== EMPTY_OBJ && hasOwn$3(data24, key)) {
        accessCache[key] = 2;
        return data24[key];
      } else if (
        // only cache other properties when instance has declared (thus stable)
        // props
        (normalizedProps = instance.propsOptions[0]) && hasOwn$3(normalizedProps, key)
      ) {
        accessCache[key] = 3;
        return props[key];
      } else if (ctx !== EMPTY_OBJ && hasOwn$3(ctx, key)) {
        accessCache[key] = 4;
        return ctx[key];
      } else if (shouldCacheAccess) {
        accessCache[key] = 0;
      }
    }
    const publicGetter = publicPropertiesMap[key];
    let cssModule, globalProperties;
    if (publicGetter) {
      if (key === "$attrs") {
        track(instance.attrs, "get", "");
      } else if (false) {
        track(instance, "get", key);
      }
      return publicGetter(instance);
    } else if (
      // css module (injected by vue-loader)
      (cssModule = type.__cssModules) && (cssModule = cssModule[key])
    ) {
      return cssModule;
    } else if (ctx !== EMPTY_OBJ && hasOwn$3(ctx, key)) {
      accessCache[key] = 4;
      return ctx[key];
    } else if (
      // global properties
      globalProperties = appContext.config.globalProperties, hasOwn$3(globalProperties, key)
    ) {
      {
        return globalProperties[key];
      }
    } else if (false) {
      if (data24 !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$3(data24, key)) {
        warn$1$1(
          `Property ${JSON.stringify(
            key
          )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
        );
      } else if (instance === currentRenderingInstance) {
        warn$1$1(
          `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
        );
      }
    }
  },
  set({ _: instance }, key, value4) {
    const { data: data24, setupState, ctx } = instance;
    if (hasSetupBinding(setupState, key)) {
      setupState[key] = value4;
      return true;
    } else if (false) {
      warn$1$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
      return false;
    } else if (data24 !== EMPTY_OBJ && hasOwn$3(data24, key)) {
      data24[key] = value4;
      return true;
    } else if (hasOwn$3(instance.props, key)) {
      return false;
    }
    if (key[0] === "$" && key.slice(1) in instance) {
      return false;
    } else {
      if (false) {
        Object.defineProperty(ctx, key, {
          enumerable: true,
          configurable: true,
          value: value4
        });
      } else {
        ctx[key] = value4;
      }
    }
    return true;
  },
  has({
    _: { data: data24, setupState, accessCache, ctx, appContext, propsOptions }
  }, key) {
    let normalizedProps;
    return !!accessCache[key] || data24 !== EMPTY_OBJ && hasOwn$3(data24, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$3(normalizedProps, key) || hasOwn$3(ctx, key) || hasOwn$3(publicPropertiesMap, key) || hasOwn$3(appContext.config.globalProperties, key);
  },
  defineProperty(target, key, descriptor) {
    if (descriptor.get != null) {
      target._.accessCache[key] = 0;
    } else if (hasOwn$3(descriptor, "value")) {
      this.set(target, key, descriptor.value, null);
    }
    return Reflect.defineProperty(target, key, descriptor);
  }
};
if (false) {
  PublicInstanceProxyHandlers.ownKeys = (target) => {
    warn$1$1(
      `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
    );
    return Reflect.ownKeys(target);
  };
}
const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend$1(
  {},
  PublicInstanceProxyHandlers,
  {
    get(target, key) {
      if (key === Symbol.unscopables) {
        return;
      }
      return PublicInstanceProxyHandlers.get(target, key, target);
    },
    has(_2, key) {
      const has2 = key[0] !== "_" && !isGloballyAllowed(key);
      if (false) {
        warn$1$1(
          `Property ${JSON.stringify(
            key
          )} should not start with _ which is a reserved prefix for Vue internals.`
        );
      }
      return has2;
    }
  }
);
function createDevRenderContext(instance) {
  const target = {};
  Object.defineProperty(target, `_`, {
    configurable: true,
    enumerable: false,
    get: /* @__PURE__ */ __name(() => instance, "get")
  });
  Object.keys(publicPropertiesMap).forEach((key) => {
    Object.defineProperty(target, key, {
      configurable: true,
      enumerable: false,
      get: /* @__PURE__ */ __name(() => publicPropertiesMap[key](instance), "get"),
      // intercepted by the proxy so no need for implementation,
      // but needed to prevent set errors
      set: NOOP
    });
  });
  return target;
}
__name(createDevRenderContext, "createDevRenderContext");
function exposePropsOnRenderContext(instance) {
  const {
    ctx,
    propsOptions: [propsOptions]
  } = instance;
  if (propsOptions) {
    Object.keys(propsOptions).forEach((key) => {
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: /* @__PURE__ */ __name(() => instance.props[key], "get"),
        set: NOOP
      });
    });
  }
}
__name(exposePropsOnRenderContext, "exposePropsOnRenderContext");
function exposeSetupStateOnRenderContext(instance) {
  const { ctx, setupState } = instance;
  Object.keys(toRaw(setupState)).forEach((key) => {
    if (!setupState.__isScriptSetup) {
      if (isReservedPrefix(key[0])) {
        warn$1$1(
          `setup() return property ${JSON.stringify(
            key
          )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
        );
        return;
      }
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: /* @__PURE__ */ __name(() => setupState[key], "get"),
        set: NOOP
      });
    }
  });
}
__name(exposeSetupStateOnRenderContext, "exposeSetupStateOnRenderContext");
const warnRuntimeUsage = /* @__PURE__ */ __name((method) => warn$1$1(
  `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
), "warnRuntimeUsage");
function defineProps() {
  if (false) {
    warnRuntimeUsage(`defineProps`);
  }
  return null;
}
__name(defineProps, "defineProps");
function defineEmits() {
  if (false) {
    warnRuntimeUsage(`defineEmits`);
  }
  return null;
}
__name(defineEmits, "defineEmits");
function defineExpose(exposed) {
  if (false) {
    warnRuntimeUsage(`defineExpose`);
  }
}
__name(defineExpose, "defineExpose");
function defineOptions(options4) {
  if (false) {
    warnRuntimeUsage(`defineOptions`);
  }
}
__name(defineOptions, "defineOptions");
function defineSlots() {
  if (false) {
    warnRuntimeUsage(`defineSlots`);
  }
  return null;
}
__name(defineSlots, "defineSlots");
function defineModel() {
  if (false) {
    warnRuntimeUsage("defineModel");
  }
}
__name(defineModel, "defineModel");
function withDefaults(props, defaults2) {
  if (false) {
    warnRuntimeUsage(`withDefaults`);
  }
  return null;
}
__name(withDefaults, "withDefaults");
function useSlots() {
  return getContext().slots;
}
__name(useSlots, "useSlots");
function useAttrs() {
  return getContext().attrs;
}
__name(useAttrs, "useAttrs");
function getContext() {
  const i2 = getCurrentInstance();
  if (false) {
    warn$1$1(`useContext() called without active instance.`);
  }
  return i2.setupContext || (i2.setupContext = createSetupContext(i2));
}
__name(getContext, "getContext");
function normalizePropsOrEmits(props) {
  return isArray$4(props) ? props.reduce(
    (normalized, p2) => (normalized[p2] = null, normalized),
    {}
  ) : props;
}
__name(normalizePropsOrEmits, "normalizePropsOrEmits");
function mergeDefaults(raw, defaults2) {
  const props = normalizePropsOrEmits(raw);
  for (const key in defaults2) {
    if (key.startsWith("__skip")) continue;
    let opt = props[key];
    if (opt) {
      if (isArray$4(opt) || isFunction$4(opt)) {
        opt = props[key] = { type: opt, default: defaults2[key] };
      } else {
        opt.default = defaults2[key];
      }
    } else if (opt === null) {
      opt = props[key] = { default: defaults2[key] };
    } else if (false) {
      warn$1$1(`props default key "${key}" has no corresponding declaration.`);
    }
    if (opt && defaults2[`__skip_${key}`]) {
      opt.skipFactory = true;
    }
  }
  return props;
}
__name(mergeDefaults, "mergeDefaults");
function mergeModels(a, b) {
  if (!a || !b) return a || b;
  if (isArray$4(a) && isArray$4(b)) return a.concat(b);
  return extend$1({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
}
__name(mergeModels, "mergeModels");
function createPropsRestProxy(props, excludedKeys) {
  const ret = {};
  for (const key in props) {
    if (!excludedKeys.includes(key)) {
      Object.defineProperty(ret, key, {
        enumerable: true,
        get: /* @__PURE__ */ __name(() => props[key], "get")
      });
    }
  }
  return ret;
}
__name(createPropsRestProxy, "createPropsRestProxy");
function withAsyncContext(getAwaitable) {
  const ctx = getCurrentInstance();
  if (false) {
    warn$1$1(
      `withAsyncContext called without active current instance. This is likely a bug.`
    );
  }
  let awaitable = getAwaitable();
  unsetCurrentInstance();
  if (isPromise$1(awaitable)) {
    awaitable = awaitable.catch((e2) => {
      setCurrentInstance(ctx);
      throw e2;
    });
  }
  return [awaitable, () => setCurrentInstance(ctx)];
}
__name(withAsyncContext, "withAsyncContext");
function createDuplicateChecker() {
  const cache2 = /* @__PURE__ */ Object.create(null);
  return (type, key) => {
    if (cache2[key]) {
      warn$1$1(`${type} property "${key}" is already defined in ${cache2[key]}.`);
    } else {
      cache2[key] = type;
    }
  };
}
__name(createDuplicateChecker, "createDuplicateChecker");
let shouldCacheAccess = true;
function applyOptions(instance) {
  const options4 = resolveMergedOptions(instance);
  const publicThis = instance.proxy;
  const ctx = instance.ctx;
  shouldCacheAccess = false;
  if (options4.beforeCreate) {
    callHook$1(options4.beforeCreate, instance, "bc");
  }
  const {
    // state
    data: dataOptions,
    computed: computedOptions,
    methods,
    watch: watchOptions,
    provide: provideOptions,
    inject: injectOptions,
    // lifecycle
    created: created3,
    beforeMount: beforeMount4,
    mounted: mounted23,
    beforeUpdate: beforeUpdate2,
    updated: updated13,
    activated,
    deactivated,
    beforeDestroy,
    beforeUnmount: beforeUnmount15,
    destroyed,
    unmounted: unmounted6,
    render: render2,
    renderTracked,
    renderTriggered,
    errorCaptured,
    serverPrefetch,
    // public API
    expose,
    inheritAttrs,
    // assets
    components,
    directives,
    filters
  } = options4;
  const checkDuplicateProperties = false ? createDuplicateChecker() : null;
  if (false) {
    const [propsOptions] = instance.propsOptions;
    if (propsOptions) {
      for (const key in propsOptions) {
        checkDuplicateProperties("Props", key);
      }
    }
  }
  if (injectOptions) {
    resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  }
  if (methods) {
    for (const key in methods) {
      const methodHandler = methods[key];
      if (isFunction$4(methodHandler)) {
        if (false) {
          Object.defineProperty(ctx, key, {
            value: methodHandler.bind(publicThis),
            configurable: true,
            enumerable: true,
            writable: true
          });
        } else {
          ctx[key] = methodHandler.bind(publicThis);
        }
        if (false) {
          checkDuplicateProperties("Methods", key);
        }
      } else if (false) {
        warn$1$1(
          `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
        );
      }
    }
  }
  if (dataOptions) {
    if (false) {
      warn$1$1(
        `The data option must be a function. Plain object usage is no longer supported.`
      );
    }
    const data24 = dataOptions.call(publicThis, publicThis);
    if (false) {
      warn$1$1(
        `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
      );
    }
    if (!isObject$6(data24)) {
    } else {
      instance.data = reactive(data24);
      if (false) {
        for (const key in data24) {
          checkDuplicateProperties("Data", key);
          if (!isReservedPrefix(key[0])) {
            Object.defineProperty(ctx, key, {
              configurable: true,
              enumerable: true,
              get: /* @__PURE__ */ __name(() => data24[key], "get"),
              set: NOOP
            });
          }
        }
      }
    }
  }
  shouldCacheAccess = true;
  if (computedOptions) {
    for (const key in computedOptions) {
      const opt = computedOptions[key];
      const get3 = isFunction$4(opt) ? opt.bind(publicThis, publicThis) : isFunction$4(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
      if (false) {
        warn$1$1(`Computed property "${key}" has no getter.`);
      }
      const set3 = !isFunction$4(opt) && isFunction$4(opt.set) ? opt.set.bind(publicThis) : false ? () => {
        warn$1$1(
          `Write operation failed: computed property "${key}" is readonly.`
        );
      } : NOOP;
      const c = computed({
        get: get3,
        set: set3
      });
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: /* @__PURE__ */ __name(() => c.value, "get"),
        set: /* @__PURE__ */ __name((v2) => c.value = v2, "set")
      });
      if (false) {
        checkDuplicateProperties("Computed", key);
      }
    }
  }
  if (watchOptions) {
    for (const key in watchOptions) {
      createWatcher(watchOptions[key], ctx, publicThis, key);
    }
  }
  if (provideOptions) {
    const provides = isFunction$4(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
    Reflect.ownKeys(provides).forEach((key) => {
      provide(key, provides[key]);
    });
  }
  if (created3) {
    callHook$1(created3, instance, "c");
  }
  function registerLifecycleHook(register3, hook) {
    if (isArray$4(hook)) {
      hook.forEach((_hook3) => register3(_hook3.bind(publicThis)));
    } else if (hook) {
      register3(hook.bind(publicThis));
    }
  }
  __name(registerLifecycleHook, "registerLifecycleHook");
  registerLifecycleHook(onBeforeMount, beforeMount4);
  registerLifecycleHook(onMounted, mounted23);
  registerLifecycleHook(onBeforeUpdate, beforeUpdate2);
  registerLifecycleHook(onUpdated, updated13);
  registerLifecycleHook(onActivated, activated);
  registerLifecycleHook(onDeactivated, deactivated);
  registerLifecycleHook(onErrorCaptured, errorCaptured);
  registerLifecycleHook(onRenderTracked, renderTracked);
  registerLifecycleHook(onRenderTriggered, renderTriggered);
  registerLifecycleHook(onBeforeUnmount, beforeUnmount15);
  registerLifecycleHook(onUnmounted, unmounted6);
  registerLifecycleHook(onServerPrefetch, serverPrefetch);
  if (isArray$4(expose)) {
    if (expose.length) {
      const exposed = instance.exposed || (instance.exposed = {});
      expose.forEach((key) => {
        Object.defineProperty(exposed, key, {
          get: /* @__PURE__ */ __name(() => publicThis[key], "get"),
          set: /* @__PURE__ */ __name((val) => publicThis[key] = val, "set")
        });
      });
    } 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;
}
__name(applyOptions, "applyOptions");
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  if (isArray$4(injectOptions)) {
    injectOptions = normalizeInject(injectOptions);
  }
  for (const key in injectOptions) {
    const opt = injectOptions[key];
    let injected;
    if (isObject$6(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(ctx, key, {
        enumerable: true,
        configurable: true,
        get: /* @__PURE__ */ __name(() => injected.value, "get"),
        set: /* @__PURE__ */ __name((v2) => injected.value = v2, "set")
      });
    } else {
      ctx[key] = injected;
    }
    if (false) {
      checkDuplicateProperties("Inject", key);
    }
  }
}
__name(resolveInjections, "resolveInjections");
function callHook$1(hook, instance, type) {
  callWithAsyncErrorHandling(
    isArray$4(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
    instance,
    type
  );
}
__name(callHook$1, "callHook$1");
function createWatcher(raw, ctx, publicThis, key) {
  const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  if (isString$7(raw)) {
    const handler6 = ctx[raw];
    if (isFunction$4(handler6)) {
      watch(getter, handler6);
    } else if (false) {
      warn$1$1(`Invalid watch handler specified by key "${raw}"`, handler6);
    }
  } else if (isFunction$4(raw)) {
    watch(getter, raw.bind(publicThis));
  } else if (isObject$6(raw)) {
    if (isArray$4(raw)) {
      raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
    } else {
      const handler6 = isFunction$4(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
      if (isFunction$4(handler6)) {
        watch(getter, handler6, raw);
      } else if (false) {
        warn$1$1(`Invalid watch handler specified by key "${raw.handler}"`, handler6);
      }
    }
  } else if (false) {
    warn$1$1(`Invalid watch option: "${key}"`, raw);
  }
}
__name(createWatcher, "createWatcher");
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$6(base2)) {
    cache2.set(base2, resolved);
  }
  return resolved;
}
__name(resolveMergedOptions, "resolveMergedOptions");
function mergeOptions$1(to, from2, strats, asMixin = false) {
  const { mixins, extends: extendsOptions } = from2;
  if (extendsOptions) {
    mergeOptions$1(to, extendsOptions, strats, true);
  }
  if (mixins) {
    mixins.forEach(
      (m) => mergeOptions$1(to, m, strats, true)
    );
  }
  for (const key in from2) {
    if (asMixin && key === "expose") {
    } else {
      const strat = internalOptionMergeStrats[key] || strats && strats[key];
      to[key] = strat ? strat(to[key], from2[key]) : from2[key];
    }
  }
  return to;
}
__name(mergeOptions$1, "mergeOptions$1");
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, from2) {
  if (!from2) {
    return to;
  }
  if (!to) {
    return from2;
  }
  return /* @__PURE__ */ __name(function mergedDataFn() {
    return extend$1(
      isFunction$4(to) ? to.call(this, this) : to,
      isFunction$4(from2) ? from2.call(this, this) : from2
    );
  }, "mergedDataFn");
}
__name(mergeDataFn, "mergeDataFn");
function mergeInject(to, from2) {
  return mergeObjectOptions(normalizeInject(to), normalizeInject(from2));
}
__name(mergeInject, "mergeInject");
function normalizeInject(raw) {
  if (isArray$4(raw)) {
    const res = {};
    for (let i2 = 0; i2 < raw.length; i2++) {
      res[raw[i2]] = raw[i2];
    }
    return res;
  }
  return raw;
}
__name(normalizeInject, "normalizeInject");
function mergeAsArray(to, from2) {
  return to ? [...new Set([].concat(to, from2))] : from2;
}
__name(mergeAsArray, "mergeAsArray");
function mergeObjectOptions(to, from2) {
  return to ? extend$1(/* @__PURE__ */ Object.create(null), to, from2) : from2;
}
__name(mergeObjectOptions, "mergeObjectOptions");
function mergeEmitsOrPropsOptions(to, from2) {
  if (to) {
    if (isArray$4(to) && isArray$4(from2)) {
      return [.../* @__PURE__ */ new Set([...to, ...from2])];
    }
    return extend$1(
      /* @__PURE__ */ Object.create(null),
      normalizePropsOrEmits(to),
      normalizePropsOrEmits(from2 != null ? from2 : {})
    );
  } else {
    return from2;
  }
}
__name(mergeEmitsOrPropsOptions, "mergeEmitsOrPropsOptions");
function mergeWatchOptions(to, from2) {
  if (!to) return from2;
  if (!from2) return to;
  const merged = extend$1(/* @__PURE__ */ Object.create(null), to);
  for (const key in from2) {
    merged[key] = mergeAsArray(to[key], from2[key]);
  }
  return merged;
}
__name(mergeWatchOptions, "mergeWatchOptions");
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()
  };
}
__name(createAppContext, "createAppContext");
let uid$1 = 0;
function createAppAPI(render2, hydrate2) {
  return /* @__PURE__ */ __name(function createApp2(rootComponent, rootProps = null) {
    if (!isFunction$4(rootComponent)) {
      rootComponent = extend$1({}, rootComponent);
    }
    if (rootProps != null && !isObject$6(rootProps)) {
      rootProps = null;
    }
    const context = createAppContext();
    const installedPlugins = /* @__PURE__ */ new WeakSet();
    let isMounted = false;
    const app2 = context.app = {
      _uid: uid$1++,
      _component: rootComponent,
      _props: rootProps,
      _container: null,
      _context: context,
      _instance: null,
      version,
      get config() {
        return context.config;
      },
      set config(v2) {
        if (false) {
          warn$1$1(
            `app.config cannot be replaced. Modify individual options instead.`
          );
        }
      },
      use(plugin, ...options4) {
        if (installedPlugins.has(plugin)) {
        } else if (plugin && isFunction$4(plugin.install)) {
          installedPlugins.add(plugin);
          plugin.install(app2, ...options4);
        } else if (isFunction$4(plugin)) {
          installedPlugins.add(plugin);
          plugin(app2, ...options4);
        } else if (false) {
          warn$1$1(
            `A plugin must either be a function or an object with an "install" function.`
          );
        }
        return app2;
      },
      mixin(mixin) {
        if (true) {
          if (!context.mixins.includes(mixin)) {
            context.mixins.push(mixin);
          } else if (false) {
            warn$1$1(
              "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
            );
          }
        } else if (false) {
          warn$1$1("Mixins are only available in builds supporting Options API");
        }
        return app2;
      },
      component(name2, component) {
        if (false) {
          validateComponentName(name2, context.config);
        }
        if (!component) {
          return context.components[name2];
        }
        if (false) {
          warn$1$1(`Component "${name2}" has already been registered in target app.`);
        }
        context.components[name2] = component;
        return app2;
      },
      directive(name2, directive) {
        if (false) {
          validateDirectiveName(name2);
        }
        if (!directive) {
          return context.directives[name2];
        }
        if (false) {
          warn$1$1(`Directive "${name2}" has already been registered in target app.`);
        }
        context.directives[name2] = directive;
        return app2;
      },
      mount(rootContainer, isHydrate, namespace) {
        if (!isMounted) {
          if (false) {
            warn$1$1(
              `There is already an app instance mounted on the host container.
 If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
            );
          }
          const vnode = createVNode(rootComponent, rootProps);
          vnode.appContext = context;
          if (namespace === true) {
            namespace = "svg";
          } else if (namespace === false) {
            namespace = void 0;
          }
          if (false) {
            context.reload = () => {
              render2(
                cloneVNode(vnode),
                rootContainer,
                namespace
              );
            };
          }
          if (isHydrate && hydrate2) {
            hydrate2(vnode, rootContainer);
          } else {
            render2(vnode, rootContainer, namespace);
          }
          isMounted = true;
          app2._container = rootContainer;
          rootContainer.__vue_app__ = app2;
          if (false) {
            app2._instance = vnode.component;
            devtoolsInitApp(app2, version);
          }
          return getComponentPublicInstance(vnode.component);
        } else if (false) {
          warn$1$1(
            `App has already been mounted.
If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
          );
        }
      },
      unmount() {
        if (isMounted) {
          render2(null, app2._container);
          if (false) {
            app2._instance = null;
            devtoolsUnmountApp(app2);
          }
          delete app2._container.__vue_app__;
        } else if (false) {
          warn$1$1(`Cannot unmount an app that is not mounted.`);
        }
      },
      provide(key, value4) {
        if (false) {
          warn$1$1(
            `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
          );
        }
        context.provides[key] = value4;
        return app2;
      },
      runWithContext(fn) {
        const lastApp = currentApp;
        currentApp = app2;
        try {
          return fn();
        } finally {
          currentApp = lastApp;
        }
      }
    };
    return app2;
  }, "createApp");
}
__name(createAppAPI, "createAppAPI");
let currentApp = null;
function provide(key, value4) {
  if (!currentInstance) {
    if (false) {
      warn$1$1(`provide() can only be used inside setup().`);
    }
  } else {
    let provides = currentInstance.provides;
    const parentProvides = currentInstance.parent && currentInstance.parent.provides;
    if (parentProvides === provides) {
      provides = currentInstance.provides = Object.create(parentProvides);
    }
    provides[key] = value4;
  }
}
__name(provide, "provide");
function inject(key, defaultValue, treatDefaultAsFactory = false) {
  const instance = currentInstance || currentRenderingInstance;
  if (instance || currentApp) {
    const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
    if (provides && key in provides) {
      return provides[key];
    } else if (arguments.length > 1) {
      return treatDefaultAsFactory && isFunction$4(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
    } else if (false) {
      warn$1$1(`injection "${String(key)}" not found.`);
    }
  } else if (false) {
    warn$1$1(`inject() can only be used inside setup() or functional components.`);
  }
}
__name(inject, "inject");
function hasInjectionContext() {
  return !!(currentInstance || currentRenderingInstance || currentApp);
}
__name(hasInjectionContext, "hasInjectionContext");
const internalObjectProto = {};
const createInternalObject = /* @__PURE__ */ __name(() => Object.create(internalObjectProto), "createInternalObject");
const isInternalObject = /* @__PURE__ */ __name((obj) => Object.getPrototypeOf(obj) === internalObjectProto, "isInternalObject");
function initProps(instance, rawProps, isStateful, isSSR = false) {
  const props = {};
  const attrs4 = createInternalObject();
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  setFullProps(instance, rawProps, props, attrs4);
  for (const key in instance.propsOptions[0]) {
    if (!(key in props)) {
      props[key] = void 0;
    }
  }
  if (false) {
    validateProps(rawProps || {}, props, instance);
  }
  if (isStateful) {
    instance.props = isSSR ? props : shallowReactive(props);
  } else {
    if (!instance.type.props) {
      instance.props = attrs4;
    } else {
      instance.props = props;
    }
  }
  instance.attrs = attrs4;
}
__name(initProps, "initProps");
function isInHmrContext(instance) {
  while (instance) {
    if (instance.type.__hmrId) return true;
    instance = instance.parent;
  }
}
__name(isInHmrContext, "isInHmrContext");
function updateProps(instance, rawProps, rawPrevProps, optimized) {
  const {
    props,
    attrs: attrs4,
    vnode: { patchFlag }
  } = instance;
  const rawCurrentProps = toRaw(props);
  const [options4] = 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 i2 = 0; i2 < propsToUpdate.length; i2++) {
        let key = propsToUpdate[i2];
        if (isEmitListener(instance.emitsOptions, key)) {
          continue;
        }
        const value4 = rawProps[key];
        if (options4) {
          if (hasOwn$3(attrs4, key)) {
            if (value4 !== attrs4[key]) {
              attrs4[key] = value4;
              hasAttrsChanged = true;
            }
          } else {
            const camelizedKey = camelize$1(key);
            props[camelizedKey] = resolvePropValue(
              options4,
              rawCurrentProps,
              camelizedKey,
              value4,
              instance,
              false
            );
          }
        } else {
          if (value4 !== attrs4[key]) {
            attrs4[key] = value4;
            hasAttrsChanged = true;
          }
        }
      }
    }
  } else {
    if (setFullProps(instance, rawProps, props, attrs4)) {
      hasAttrsChanged = true;
    }
    let kebabKey;
    for (const key in rawCurrentProps) {
      if (!rawProps || // for camelCase
      !hasOwn$3(rawProps, key) && // it's possible the original props was passed in as kebab-case
      // and converted to camelCase (#955)
      ((kebabKey = hyphenate$1(key)) === key || !hasOwn$3(rawProps, kebabKey))) {
        if (options4) {
          if (rawPrevProps && // for camelCase
          (rawPrevProps[key] !== void 0 || // for kebab-case
          rawPrevProps[kebabKey] !== void 0)) {
            props[key] = resolvePropValue(
              options4,
              rawCurrentProps,
              key,
              void 0,
              instance,
              true
            );
          }
        } else {
          delete props[key];
        }
      }
    }
    if (attrs4 !== rawCurrentProps) {
      for (const key in attrs4) {
        if (!rawProps || !hasOwn$3(rawProps, key) && true) {
          delete attrs4[key];
          hasAttrsChanged = true;
        }
      }
    }
  }
  if (hasAttrsChanged) {
    trigger(instance.attrs, "set", "");
  }
  if (false) {
    validateProps(rawProps || {}, props, instance);
  }
}
__name(updateProps, "updateProps");
function setFullProps(instance, rawProps, props, attrs4) {
  const [options4, needCastKeys] = instance.propsOptions;
  let hasAttrsChanged = false;
  let rawCastValues;
  if (rawProps) {
    for (let key in rawProps) {
      if (isReservedProp(key)) {
        continue;
      }
      const value4 = rawProps[key];
      let camelKey;
      if (options4 && hasOwn$3(options4, camelKey = camelize$1(key))) {
        if (!needCastKeys || !needCastKeys.includes(camelKey)) {
          props[camelKey] = value4;
        } else {
          (rawCastValues || (rawCastValues = {}))[camelKey] = value4;
        }
      } else if (!isEmitListener(instance.emitsOptions, key)) {
        if (!(key in attrs4) || value4 !== attrs4[key]) {
          attrs4[key] = value4;
          hasAttrsChanged = true;
        }
      }
    }
  }
  if (needCastKeys) {
    const rawCurrentProps = toRaw(props);
    const castValues = rawCastValues || EMPTY_OBJ;
    for (let i2 = 0; i2 < needCastKeys.length; i2++) {
      const key = needCastKeys[i2];
      props[key] = resolvePropValue(
        options4,
        rawCurrentProps,
        key,
        castValues[key],
        instance,
        !hasOwn$3(castValues, key)
      );
    }
  }
  return hasAttrsChanged;
}
__name(setFullProps, "setFullProps");
function resolvePropValue(options4, props, key, value4, instance, isAbsent) {
  const opt = options4[key];
  if (opt != null) {
    const hasDefault = hasOwn$3(opt, "default");
    if (hasDefault && value4 === void 0) {
      const defaultValue = opt.default;
      if (opt.type !== Function && !opt.skipFactory && isFunction$4(defaultValue)) {
        const { propsDefaults } = instance;
        if (key in propsDefaults) {
          value4 = propsDefaults[key];
        } else {
          const reset2 = setCurrentInstance(instance);
          value4 = propsDefaults[key] = defaultValue.call(
            null,
            props
          );
          reset2();
        }
      } else {
        value4 = defaultValue;
      }
    }
    if (opt[
      0
      /* shouldCast */
    ]) {
      if (isAbsent && !hasDefault) {
        value4 = false;
      } else if (opt[
        1
        /* shouldCastTrue */
      ] && (value4 === "" || value4 === hyphenate$1(key))) {
        value4 = true;
      }
    }
  }
  return value4;
}
__name(resolvePropValue, "resolvePropValue");
function normalizePropsOptions(comp, appContext, asMixin = false) {
  const cache2 = appContext.propsCache;
  const cached = cache2.get(comp);
  if (cached) {
    return cached;
  }
  const raw = comp.props;
  const normalized = {};
  const needCastKeys = [];
  let hasExtends = false;
  if (!isFunction$4(comp)) {
    const extendProps = /* @__PURE__ */ __name((raw2) => {
      hasExtends = true;
      const [props, keys2] = normalizePropsOptions(raw2, appContext, true);
      extend$1(normalized, props);
      if (keys2) needCastKeys.push(...keys2);
    }, "extendProps");
    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$6(comp)) {
      cache2.set(comp, EMPTY_ARR);
    }
    return EMPTY_ARR;
  }
  if (isArray$4(raw)) {
    for (let i2 = 0; i2 < raw.length; i2++) {
      if (false) {
        warn$1$1(`props must be strings when using array syntax.`, raw[i2]);
      }
      const normalizedKey = camelize$1(raw[i2]);
      if (validatePropName(normalizedKey)) {
        normalized[normalizedKey] = EMPTY_OBJ;
      }
    }
  } else if (raw) {
    if (false) {
      warn$1$1(`invalid props options`, raw);
    }
    for (const key in raw) {
      const normalizedKey = camelize$1(key);
      if (validatePropName(normalizedKey)) {
        const opt = raw[key];
        const prop2 = normalized[normalizedKey] = isArray$4(opt) || isFunction$4(opt) ? { type: opt } : extend$1({}, opt);
        if (prop2) {
          const booleanIndex = getTypeIndex(Boolean, prop2.type);
          const stringIndex = getTypeIndex(String, prop2.type);
          prop2[
            0
            /* shouldCast */
          ] = booleanIndex > -1;
          prop2[
            1
            /* shouldCastTrue */
          ] = stringIndex < 0 || booleanIndex < stringIndex;
          if (booleanIndex > -1 || hasOwn$3(prop2, "default")) {
            needCastKeys.push(normalizedKey);
          }
        }
      }
    }
  }
  const res = [normalized, needCastKeys];
  if (isObject$6(comp)) {
    cache2.set(comp, res);
  }
  return res;
}
__name(normalizePropsOptions, "normalizePropsOptions");
function validatePropName(key) {
  if (key[0] !== "$" && !isReservedProp(key)) {
    return true;
  } else if (false) {
    warn$1$1(`Invalid prop name: "${key}" is a reserved property.`);
  }
  return false;
}
__name(validatePropName, "validatePropName");
function getType$1(ctor) {
  if (ctor === null) {
    return "null";
  }
  if (typeof ctor === "function") {
    return ctor.name || "";
  } else if (typeof ctor === "object") {
    const name2 = ctor.constructor && ctor.constructor.name;
    return name2 || "";
  }
  return "";
}
__name(getType$1, "getType$1");
function isSameType(a, b) {
  return getType$1(a) === getType$1(b);
}
__name(isSameType, "isSameType");
function getTypeIndex(type, expectedTypes) {
  if (isArray$4(expectedTypes)) {
    return expectedTypes.findIndex((t2) => isSameType(t2, type));
  } else if (isFunction$4(expectedTypes)) {
    return isSameType(expectedTypes, type) ? 0 : -1;
  }
  return -1;
}
__name(getTypeIndex, "getTypeIndex");
function validateProps(rawProps, props, instance) {
  const resolvedValues = toRaw(props);
  const options4 = instance.propsOptions[0];
  for (const key in options4) {
    let opt = options4[key];
    if (opt == null) continue;
    validateProp(
      key,
      resolvedValues[key],
      opt,
      false ? shallowReadonly(resolvedValues) : resolvedValues,
      !hasOwn$3(rawProps, key) && !hasOwn$3(rawProps, hyphenate$1(key))
    );
  }
}
__name(validateProps, "validateProps");
function validateProp(name2, value4, prop2, props, isAbsent) {
  const { type, required, validator: validator3, skipCheck } = prop2;
  if (required && isAbsent) {
    warn$1$1('Missing required prop: "' + name2 + '"');
    return;
  }
  if (value4 == null && !required) {
    return;
  }
  if (type != null && type !== true && !skipCheck) {
    let isValid2 = false;
    const types = isArray$4(type) ? type : [type];
    const expectedTypes = [];
    for (let i2 = 0; i2 < types.length && !isValid2; i2++) {
      const { valid, expectedType } = assertType(value4, types[i2]);
      expectedTypes.push(expectedType || "");
      isValid2 = valid;
    }
    if (!isValid2) {
      warn$1$1(getInvalidTypeMessage(name2, value4, expectedTypes));
      return;
    }
  }
  if (validator3 && !validator3(value4, props)) {
    warn$1$1('Invalid prop: custom validator check failed for prop "' + name2 + '".');
  }
}
__name(validateProp, "validateProp");
const isSimpleType = /* @__PURE__ */ makeMap(
  "String,Number,Boolean,Function,Symbol,BigInt"
);
function assertType(value4, type) {
  let valid;
  const expectedType = getType$1(type);
  if (isSimpleType(expectedType)) {
    const t2 = typeof value4;
    valid = t2 === expectedType.toLowerCase();
    if (!valid && t2 === "object") {
      valid = value4 instanceof type;
    }
  } else if (expectedType === "Object") {
    valid = isObject$6(value4);
  } else if (expectedType === "Array") {
    valid = isArray$4(value4);
  } else if (expectedType === "null") {
    valid = value4 === null;
  } else {
    valid = value4 instanceof type;
  }
  return {
    valid,
    expectedType
  };
}
__name(assertType, "assertType");
function getInvalidTypeMessage(name2, value4, expectedTypes) {
  if (expectedTypes.length === 0) {
    return `Prop type [] for prop "${name2}" won't match anything. Did you mean to use type Array instead?`;
  }
  let message3 = `Invalid prop: type check failed for prop "${name2}". Expected ${expectedTypes.map(capitalize$1).join(" | ")}`;
  const expectedType = expectedTypes[0];
  const receivedType = toRawType(value4);
  const expectedValue = styleValue(value4, expectedType);
  const receivedValue = styleValue(value4, receivedType);
  if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean$3(expectedType, receivedType)) {
    message3 += ` with value ${expectedValue}`;
  }
  message3 += `, got ${receivedType} `;
  if (isExplicable(receivedType)) {
    message3 += `with value ${receivedValue}.`;
  }
  return message3;
}
__name(getInvalidTypeMessage, "getInvalidTypeMessage");
function styleValue(value4, type) {
  if (type === "String") {
    return `"${value4}"`;
  } else if (type === "Number") {
    return `${Number(value4)}`;
  } else {
    return `${value4}`;
  }
}
__name(styleValue, "styleValue");
function isExplicable(type) {
  const explicitTypes = ["string", "number", "boolean"];
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
}
__name(isExplicable, "isExplicable");
function isBoolean$3(...args) {
  return args.some((elem) => elem.toLowerCase() === "boolean");
}
__name(isBoolean$3, "isBoolean$3");
const isInternalKey = /* @__PURE__ */ __name((key) => key[0] === "_" || key === "$stable", "isInternalKey");
const normalizeSlotValue = /* @__PURE__ */ __name((value4) => isArray$4(value4) ? value4.map(normalizeVNode) : [normalizeVNode(value4)], "normalizeSlotValue");
const normalizeSlot$1 = /* @__PURE__ */ __name((key, rawSlot, ctx) => {
  if (rawSlot._n) {
    return rawSlot;
  }
  const normalized = withCtx((...args) => {
    if (false) {
      warn$1$1(
        `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
      );
    }
    return normalizeSlotValue(rawSlot(...args));
  }, ctx);
  normalized._c = false;
  return normalized;
}, "normalizeSlot$1");
const normalizeObjectSlots = /* @__PURE__ */ __name((rawSlots, slots, instance) => {
  const ctx = rawSlots._ctx;
  for (const key in rawSlots) {
    if (isInternalKey(key)) continue;
    const value4 = rawSlots[key];
    if (isFunction$4(value4)) {
      slots[key] = normalizeSlot$1(key, value4, ctx);
    } else if (value4 != null) {
      if (false) {
        warn$1$1(
          `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
        );
      }
      const normalized = normalizeSlotValue(value4);
      slots[key] = () => normalized;
    }
  }
}, "normalizeObjectSlots");
const normalizeVNodeSlots = /* @__PURE__ */ __name((instance, children) => {
  if (false) {
    warn$1$1(
      `Non-function value encountered for default slot. Prefer function slots for better performance.`
    );
  }
  const normalized = normalizeSlotValue(children);
  instance.slots.default = () => normalized;
}, "normalizeVNodeSlots");
const initSlots = /* @__PURE__ */ __name((instance, children) => {
  const slots = instance.slots = createInternalObject();
  if (instance.vnode.shapeFlag & 32) {
    const type = children._;
    if (type) {
      extend$1(slots, children);
      def(slots, "_", type, true);
    } else {
      normalizeObjectSlots(children, slots);
    }
  } else if (children) {
    normalizeVNodeSlots(instance, children);
  }
}, "initSlots");
const updateSlots = /* @__PURE__ */ __name((instance, children, optimized) => {
  const { vnode, slots } = instance;
  let needDeletionCheck = true;
  let deletionComparisonTarget = EMPTY_OBJ;
  if (vnode.shapeFlag & 32) {
    const type = children._;
    if (type) {
      if (false) {
        extend$1(slots, children);
        trigger(instance, "set", "$slots");
      } else if (optimized && type === 1) {
        needDeletionCheck = false;
      } else {
        extend$1(slots, children);
        if (!optimized && type === 1) {
          delete slots._;
        }
      }
    } 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];
      }
    }
  }
}, "updateSlots");
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  if (isArray$4(rawRef)) {
    rawRef.forEach(
      (r, i2) => setRef(
        r,
        oldRawRef && (isArray$4(oldRawRef) ? oldRawRef[i2] : oldRawRef),
        parentSuspense,
        vnode,
        isUnmount
      )
    );
    return;
  }
  if (isAsyncWrapper(vnode) && !isUnmount) {
    return;
  }
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  const value4 = isUnmount ? null : refValue;
  const { i: owner, r: ref3 } = rawRef;
  if (false) {
    warn$1$1(
      `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
    );
    return;
  }
  const oldRef = oldRawRef && oldRawRef.r;
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  const setupState = owner.setupState;
  if (oldRef != null && oldRef !== ref3) {
    if (isString$7(oldRef)) {
      refs[oldRef] = null;
      if (hasOwn$3(setupState, oldRef)) {
        setupState[oldRef] = null;
      }
    } else if (isRef(oldRef)) {
      oldRef.value = null;
    }
  }
  if (isFunction$4(ref3)) {
    callWithErrorHandling(ref3, owner, 12, [value4, refs]);
  } else {
    const _isString = isString$7(ref3);
    const _isRef = isRef(ref3);
    if (_isString || _isRef) {
      const doSet = /* @__PURE__ */ __name(() => {
        if (rawRef.f) {
          const existing = _isString ? hasOwn$3(setupState, ref3) ? setupState[ref3] : refs[ref3] : ref3.value;
          if (isUnmount) {
            isArray$4(existing) && remove$1(existing, refValue);
          } else {
            if (!isArray$4(existing)) {
              if (_isString) {
                refs[ref3] = [refValue];
                if (hasOwn$3(setupState, 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] = value4;
          if (hasOwn$3(setupState, ref3)) {
            setupState[ref3] = value4;
          }
        } else if (_isRef) {
          ref3.value = value4;
          if (rawRef.k) refs[rawRef.k] = value4;
        } else if (false) {
          warn$1$1("Invalid template ref type:", ref3, `(${typeof ref3})`);
        }
      }, "doSet");
      if (value4) {
        doSet.id = -1;
        queuePostRenderEffect(doSet, parentSuspense);
      } else {
        doSet();
      }
    } else if (false) {
      warn$1$1("Invalid template ref type:", ref3, `(${typeof ref3})`);
    }
  }
}
__name(setRef, "setRef");
let hasLoggedMismatchError = false;
const logMismatchError = /* @__PURE__ */ __name(() => {
  if (hasLoggedMismatchError) {
    return;
  }
  console.error("Hydration completed but contains mismatches.");
  hasLoggedMismatchError = true;
}, "logMismatchError");
const isSVGContainer = /* @__PURE__ */ __name((container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject", "isSVGContainer");
const isMathMLContainer = /* @__PURE__ */ __name((container) => container.namespaceURI.includes("MathML"), "isMathMLContainer");
const getContainerType = /* @__PURE__ */ __name((container) => {
  if (isSVGContainer(container)) return "svg";
  if (isMathMLContainer(container)) return "mathml";
  return void 0;
}, "getContainerType");
const isComment = /* @__PURE__ */ __name((node3) => node3.nodeType === 8, "isComment");
function createHydrationFunctions(rendererInternals) {
  const {
    mt: mountComponent,
    p: patch2,
    o: {
      patchProp: patchProp2,
      createText,
      nextSibling,
      parentNode: parentNode2,
      remove: remove22,
      insert: insert2,
      createComment
    }
  } = rendererInternals;
  const hydrate2 = /* @__PURE__ */ __name((vnode, container) => {
    if (!container.hasChildNodes()) {
      patch2(null, vnode, container);
      flushPostFlushCbs();
      container._vnode = vnode;
      return;
    }
    hydrateNode(container.firstChild, vnode, null, null, null);
    flushPostFlushCbs();
    container._vnode = vnode;
  }, "hydrate");
  const hydrateNode = /* @__PURE__ */ __name((node3, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
    optimized = optimized || !!vnode.dynamicChildren;
    const isFragmentStart = isComment(node3) && node3.data === "[";
    const onMismatch = /* @__PURE__ */ __name(() => handleMismatch(
      node3,
      vnode,
      parentComponent,
      parentSuspense,
      slotScopeIds,
      isFragmentStart
    ), "onMismatch");
    const { type, ref: ref3, shapeFlag, patchFlag } = vnode;
    let domType = node3.nodeType;
    vnode.el = node3;
    if (false) {
      def(node3, "__vnode", vnode, true);
      def(node3, "__vueParentComponent", parentComponent, true);
    }
    if (patchFlag === -2) {
      optimized = false;
      vnode.dynamicChildren = null;
    }
    let nextNode = null;
    switch (type) {
      case Text$4:
        if (domType !== 3) {
          if (vnode.children === "") {
            insert2(vnode.el = createText(""), parentNode2(node3), node3);
            nextNode = node3;
          } else {
            nextNode = onMismatch();
          }
        } else {
          if (node3.data !== vnode.children) {
            logMismatchError();
            node3.data = vnode.children;
          }
          nextNode = nextSibling(node3);
        }
        break;
      case Comment:
        if (isTemplateNode(node3)) {
          nextNode = nextSibling(node3);
          replaceNode(
            vnode.el = node3.content.firstChild,
            node3,
            parentComponent
          );
        } else if (domType !== 8 || isFragmentStart) {
          nextNode = onMismatch();
        } else {
          nextNode = nextSibling(node3);
        }
        break;
      case Static:
        if (isFragmentStart) {
          node3 = nextSibling(node3);
          domType = node3.nodeType;
        }
        if (domType === 1 || domType === 3) {
          nextNode = node3;
          const needToAdoptContent = !vnode.children.length;
          for (let i2 = 0; i2 < vnode.staticCount; i2++) {
            if (needToAdoptContent)
              vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
            if (i2 === vnode.staticCount - 1) {
              vnode.anchor = nextNode;
            }
            nextNode = nextSibling(nextNode);
          }
          return isFragmentStart ? nextSibling(nextNode) : nextNode;
        } else {
          onMismatch();
        }
        break;
      case Fragment$1:
        if (!isFragmentStart) {
          nextNode = onMismatch();
        } else {
          nextNode = hydrateFragment(
            node3,
            vnode,
            parentComponent,
            parentSuspense,
            slotScopeIds,
            optimized
          );
        }
        break;
      default:
        if (shapeFlag & 1) {
          if ((domType !== 1 || vnode.type.toLowerCase() !== node3.tagName.toLowerCase()) && !isTemplateNode(node3)) {
            nextNode = onMismatch();
          } else {
            nextNode = hydrateElement(
              node3,
              vnode,
              parentComponent,
              parentSuspense,
              slotScopeIds,
              optimized
            );
          }
        } else if (shapeFlag & 6) {
          vnode.slotScopeIds = slotScopeIds;
          const container = parentNode2(node3);
          if (isFragmentStart) {
            nextNode = locateClosingAnchor(node3);
          } else if (isComment(node3) && node3.data === "teleport start") {
            nextNode = locateClosingAnchor(node3, node3.data, "teleport end");
          } else {
            nextNode = nextSibling(node3);
          }
          mountComponent(
            vnode,
            container,
            null,
            parentComponent,
            parentSuspense,
            getContainerType(container),
            optimized
          );
          if (isAsyncWrapper(vnode)) {
            let subTree;
            if (isFragmentStart) {
              subTree = createVNode(Fragment$1);
              subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
            } else {
              subTree = node3.nodeType === 3 ? createTextVNode("") : createVNode("div");
            }
            subTree.el = node3;
            vnode.component.subTree = subTree;
          }
        } else if (shapeFlag & 64) {
          if (domType !== 8) {
            nextNode = onMismatch();
          } else {
            nextNode = vnode.type.hydrate(
              node3,
              vnode,
              parentComponent,
              parentSuspense,
              slotScopeIds,
              optimized,
              rendererInternals,
              hydrateChildren
            );
          }
        } else if (shapeFlag & 128) {
          nextNode = vnode.type.hydrate(
            node3,
            vnode,
            parentComponent,
            parentSuspense,
            getContainerType(parentNode2(node3)),
            slotScopeIds,
            optimized,
            rendererInternals,
            hydrateNode
          );
        } else if (false) {
          warn$1$1("Invalid HostVNode type:", type, `(${typeof type})`);
        }
    }
    if (ref3 != null) {
      setRef(ref3, null, parentSuspense, vnode);
    }
    return nextNode;
  }, "hydrateNode");
  const hydrateElement = /* @__PURE__ */ __name((el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
    optimized = optimized || !!vnode.dynamicChildren;
    const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
    const forcePatch = type === "input" || type === "option";
    if (forcePatch || patchFlag !== -1) {
      if (dirs) {
        invokeDirectiveHook(vnode, null, parentComponent, "created");
      }
      let needCallTransitionHooks = false;
      if (isTemplateNode(el)) {
        needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
        const content2 = el.content.firstChild;
        if (needCallTransitionHooks) {
          transition.beforeEnter(content2);
        }
        replaceNode(content2, el, parentComponent);
        vnode.el = el = content2;
      }
      if (shapeFlag & 16 && // skip if element has innerHTML / textContent
      !(props && (props.innerHTML || props.textContent))) {
        let next2 = hydrateChildren(
          el.firstChild,
          vnode,
          el,
          parentComponent,
          parentSuspense,
          slotScopeIds,
          optimized
        );
        let hasWarned2 = false;
        while (next2) {
          if (false) {
            warn$1$1(
              `Hydration children mismatch on`,
              el,
              `
Server rendered element contains more child nodes than client vdom.`
            );
            hasWarned2 = true;
          }
          logMismatchError();
          const cur = next2;
          next2 = next2.nextSibling;
          remove22(cur);
        }
      } else if (shapeFlag & 8) {
        if (el.textContent !== vnode.children) {
          logMismatchError();
          el.textContent = vnode.children;
        }
      }
      if (props) {
        if (forcePatch || !optimized || patchFlag & (16 | 32)) {
          for (const key in props) {
            if (false) {
              logMismatchError();
            }
            if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
            key[0] === ".") {
              patchProp2(
                el,
                key,
                null,
                props[key],
                void 0,
                void 0,
                parentComponent
              );
            }
          }
        } else if (props.onClick) {
          patchProp2(
            el,
            "onClick",
            null,
            props.onClick,
            void 0,
            void 0,
            parentComponent
          );
        }
      }
      let vnodeHooks;
      if (vnodeHooks = props && props.onVnodeBeforeMount) {
        invokeVNodeHook(vnodeHooks, parentComponent, vnode);
      }
      if (dirs) {
        invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
      }
      if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
        queueEffectWithSuspense(() => {
          vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
          needCallTransitionHooks && transition.enter(el);
          dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
        }, parentSuspense);
      }
    }
    return el.nextSibling;
  }, "hydrateElement");
  const hydrateChildren = /* @__PURE__ */ __name((node3, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
    optimized = optimized || !!parentVNode.dynamicChildren;
    const children = parentVNode.children;
    const l = children.length;
    let hasWarned2 = false;
    for (let i2 = 0; i2 < l; i2++) {
      const vnode = optimized ? children[i2] : children[i2] = normalizeVNode(children[i2]);
      if (node3) {
        node3 = hydrateNode(
          node3,
          vnode,
          parentComponent,
          parentSuspense,
          slotScopeIds,
          optimized
        );
      } else if (vnode.type === Text$4 && !vnode.children) {
        insert2(vnode.el = createText(""), container);
      } else {
        if (false) {
          warn$1$1(
            `Hydration children mismatch on`,
            container,
            `
Server rendered element contains fewer child nodes than client vdom.`
          );
          hasWarned2 = true;
        }
        logMismatchError();
        patch2(
          null,
          vnode,
          container,
          null,
          parentComponent,
          parentSuspense,
          getContainerType(container),
          slotScopeIds
        );
      }
    }
    return node3;
  }, "hydrateChildren");
  const hydrateFragment = /* @__PURE__ */ __name((node3, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
    const { slotScopeIds: fragmentSlotScopeIds } = vnode;
    if (fragmentSlotScopeIds) {
      slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
    }
    const container = parentNode2(node3);
    const next2 = hydrateChildren(
      nextSibling(node3),
      vnode,
      container,
      parentComponent,
      parentSuspense,
      slotScopeIds,
      optimized
    );
    if (next2 && isComment(next2) && next2.data === "]") {
      return nextSibling(vnode.anchor = next2);
    } else {
      logMismatchError();
      insert2(vnode.anchor = createComment(`]`), container, next2);
      return next2;
    }
  }, "hydrateFragment");
  const handleMismatch = /* @__PURE__ */ __name((node3, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment2) => {
    logMismatchError();
    vnode.el = null;
    if (isFragment2) {
      const end = locateClosingAnchor(node3);
      while (true) {
        const next22 = nextSibling(node3);
        if (next22 && next22 !== end) {
          remove22(next22);
        } else {
          break;
        }
      }
    }
    const next2 = nextSibling(node3);
    const container = parentNode2(node3);
    remove22(node3);
    patch2(
      null,
      vnode,
      container,
      next2,
      parentComponent,
      parentSuspense,
      getContainerType(container),
      slotScopeIds
    );
    return next2;
  }, "handleMismatch");
  const locateClosingAnchor = /* @__PURE__ */ __name((node3, open2 = "[", close5 = "]") => {
    let match2 = 0;
    while (node3) {
      node3 = nextSibling(node3);
      if (node3 && isComment(node3)) {
        if (node3.data === open2) match2++;
        if (node3.data === close5) {
          if (match2 === 0) {
            return nextSibling(node3);
          } else {
            match2--;
          }
        }
      }
    }
    return node3;
  }, "locateClosingAnchor");
  const replaceNode = /* @__PURE__ */ __name((newNode, oldNode, parentComponent) => {
    const parentNode22 = oldNode.parentNode;
    if (parentNode22) {
      parentNode22.replaceChild(newNode, oldNode);
    }
    let parent = parentComponent;
    while (parent) {
      if (parent.vnode.el === oldNode) {
        parent.vnode.el = parent.subTree.el = newNode;
      }
      parent = parent.parent;
    }
  }, "replaceNode");
  const isTemplateNode = /* @__PURE__ */ __name((node3) => {
    return node3.nodeType === 1 && node3.tagName.toLowerCase() === "template";
  }, "isTemplateNode");
  return [hydrate2, hydrateNode];
}
__name(createHydrationFunctions, "createHydrationFunctions");
function propHasMismatch(el, key, clientValue, vnode, instance) {
  let mismatchType;
  let mismatchKey;
  let actual;
  let expected;
  if (key === "class") {
    actual = el.getAttribute("class");
    expected = normalizeClass(clientValue);
    if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
      mismatchType = mismatchKey = `class`;
    }
  } else if (key === "style") {
    actual = el.getAttribute("style") || "";
    expected = isString$7(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
    const actualMap = toStyleMap(actual);
    const expectedMap = toStyleMap(expected);
    if (vnode.dirs) {
      for (const { dir, value: value4 } of vnode.dirs) {
        if (dir.name === "show" && !value4) {
          expectedMap.set("display", "none");
        }
      }
    }
    if (instance) {
      resolveCssVars(instance, vnode, expectedMap);
    }
    if (!isMapEqual(actualMap, expectedMap)) {
      mismatchType = mismatchKey = "style";
    }
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
    if (isBooleanAttr(key)) {
      actual = el.hasAttribute(key);
      expected = includeBooleanAttr(clientValue);
    } else if (clientValue == null) {
      actual = el.hasAttribute(key);
      expected = false;
    } else {
      if (el.hasAttribute(key)) {
        actual = el.getAttribute(key);
      } else if (key === "value" && el.tagName === "TEXTAREA") {
        actual = el.value;
      } else {
        actual = false;
      }
      expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
    }
    if (actual !== expected) {
      mismatchType = `attribute`;
      mismatchKey = key;
    }
  }
  if (mismatchType) {
    const format2 = /* @__PURE__ */ __name((v2) => v2 === false ? `(not rendered)` : `${mismatchKey}="${v2}"`, "format");
    const preSegment = `Hydration ${mismatchType} mismatch on`;
    const postSegment = `
  - rendered on server: ${format2(actual)}
  - expected on client: ${format2(expected)}
  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  You should fix the source of the mismatch.`;
    {
      warn$1$1(preSegment, el, postSegment);
    }
    return true;
  }
  return false;
}
__name(propHasMismatch, "propHasMismatch");
function toClassSet(str) {
  return new Set(str.trim().split(/\s+/));
}
__name(toClassSet, "toClassSet");
function isSetEqual(a, b) {
  if (a.size !== b.size) {
    return false;
  }
  for (const s of a) {
    if (!b.has(s)) {
      return false;
    }
  }
  return true;
}
__name(isSetEqual, "isSetEqual");
function toStyleMap(str) {
  const styleMap = /* @__PURE__ */ new Map();
  for (const item3 of str.split(";")) {
    let [key, value4] = item3.split(":");
    key = key.trim();
    value4 = value4 && value4.trim();
    if (key && value4) {
      styleMap.set(key, value4);
    }
  }
  return styleMap;
}
__name(toStyleMap, "toStyleMap");
function isMapEqual(a, b) {
  if (a.size !== b.size) {
    return false;
  }
  for (const [key, value4] of a) {
    if (value4 !== b.get(key)) {
      return false;
    }
  }
  return true;
}
__name(isMapEqual, "isMapEqual");
function resolveCssVars(instance, vnode, expectedMap) {
  const root24 = instance.subTree;
  if (instance.getCssVars && (vnode === root24 || root24 && root24.type === Fragment$1 && root24.children.includes(vnode))) {
    const cssVars = instance.getCssVars();
    for (const key in cssVars) {
      expectedMap.set(`--${key}`, String(cssVars[key]));
    }
  }
  if (vnode === root24 && instance.parent) {
    resolveCssVars(instance.parent, instance.vnode, expectedMap);
  }
}
__name(resolveCssVars, "resolveCssVars");
let supported$1;
let perf$1;
function startMeasure(instance, type) {
  if (instance.appContext.config.performance && isSupported()) {
    perf$1.mark(`vue-${type}-${instance.uid}`);
  }
  if (false) {
    devtoolsPerfStart(instance, type, isSupported() ? perf$1.now() : Date.now());
  }
}
__name(startMeasure, "startMeasure");
function endMeasure(instance, type) {
  if (instance.appContext.config.performance && isSupported()) {
    const startTag = `vue-${type}-${instance.uid}`;
    const endTag = startTag + `:end`;
    perf$1.mark(endTag);
    perf$1.measure(
      `<${formatComponentName(instance, instance.type)}> ${type}`,
      startTag,
      endTag
    );
    perf$1.clearMarks(startTag);
    perf$1.clearMarks(endTag);
  }
  if (false) {
    devtoolsPerfEnd(instance, type, isSupported() ? perf$1.now() : Date.now());
  }
}
__name(endMeasure, "endMeasure");
function isSupported() {
  if (supported$1 !== void 0) {
    return supported$1;
  }
  if (typeof window !== "undefined" && window.performance) {
    supported$1 = true;
    perf$1 = window.performance;
  } else {
    supported$1 = false;
  }
  return supported$1;
}
__name(isSupported, "isSupported");
function initFeatureFlags$2() {
  const needWarn = [];
  if (false) {
    getGlobalThis$1().__VUE_OPTIONS_API__ = true;
  }
  if (false) {
    getGlobalThis$1().__VUE_PROD_DEVTOOLS__ = false;
  }
  if (false) {
    getGlobalThis$1().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
  }
  if (false) {
    const multi2 = needWarn.length > 1;
    console.warn(
      `Feature flag${multi2 ? `s` : ``} ${needWarn.join(", ")} ${multi2 ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.

For more details, see https://link.vuejs.org/feature-flags.`
    );
  }
}
__name(initFeatureFlags$2, "initFeatureFlags$2");
const queuePostRenderEffect = queueEffectWithSuspense;
function createRenderer(options4) {
  return baseCreateRenderer(options4);
}
__name(createRenderer, "createRenderer");
function createHydrationRenderer(options4) {
  return baseCreateRenderer(options4, createHydrationFunctions);
}
__name(createHydrationRenderer, "createHydrationRenderer");
function baseCreateRenderer(options4, createHydrationFns) {
  {
    initFeatureFlags$2();
  }
  const target = getGlobalThis$1();
  target.__VUE__ = true;
  if (false) {
    setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  }
  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
  } = options4;
  const patch2 = /* @__PURE__ */ __name((n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = false ? false : !!n2.dynamicChildren) => {
    if (n1 === n2) {
      return;
    }
    if (n1 && !isSameVNodeType(n1, n2)) {
      anchor = getNextHostNode(n1);
      unmount(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$4:
        processText(n1, n2, container, anchor);
        break;
      case Comment:
        processCommentNode(n1, n2, container, anchor);
        break;
      case Static:
        if (n1 == null) {
          mountStaticNode(n2, container, anchor, namespace);
        } else if (false) {
          patchStaticNode(n1, n2, container, namespace);
        }
        break;
      case Fragment$1:
        processFragment(
          n1,
          n2,
          container,
          anchor,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
        break;
      default:
        if (shapeFlag & 1) {
          processElement(
            n1,
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else if (shapeFlag & 6) {
          processComponent(
            n1,
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else if (shapeFlag & 64) {
          type.process(
            n1,
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized,
            internals
          );
        } else if (shapeFlag & 128) {
          type.process(
            n1,
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized,
            internals
          );
        } else if (false) {
          warn$1$1("Invalid VNode type:", type, `(${typeof type})`);
        }
    }
    if (ref3 != null && parentComponent) {
      setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
    }
  }, "patch");
  const processText = /* @__PURE__ */ __name((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);
      }
    }
  }, "processText");
  const processCommentNode = /* @__PURE__ */ __name((n1, n2, container, anchor) => {
    if (n1 == null) {
      hostInsert(
        n2.el = hostCreateComment(n2.children || ""),
        container,
        anchor
      );
    } else {
      n2.el = n1.el;
    }
  }, "processCommentNode");
  const mountStaticNode = /* @__PURE__ */ __name((n2, container, anchor, namespace) => {
    [n2.el, n2.anchor] = hostInsertStaticContent(
      n2.children,
      container,
      anchor,
      namespace,
      n2.el,
      n2.anchor
    );
  }, "mountStaticNode");
  const patchStaticNode = /* @__PURE__ */ __name((n1, n2, container, namespace) => {
    if (n2.children !== n1.children) {
      const anchor = hostNextSibling(n1.anchor);
      removeStaticNode(n1);
      [n2.el, n2.anchor] = hostInsertStaticContent(
        n2.children,
        container,
        anchor,
        namespace
      );
    } else {
      n2.el = n1.el;
      n2.anchor = n1.anchor;
    }
  }, "patchStaticNode");
  const moveStaticNode = /* @__PURE__ */ __name(({ el, anchor }, container, nextSibling) => {
    let next2;
    while (el && el !== anchor) {
      next2 = hostNextSibling(el);
      hostInsert(el, container, nextSibling);
      el = next2;
    }
    hostInsert(anchor, container, nextSibling);
  }, "moveStaticNode");
  const removeStaticNode = /* @__PURE__ */ __name(({ el, anchor }) => {
    let next2;
    while (el && el !== anchor) {
      next2 = hostNextSibling(el);
      hostRemove(el);
      el = next2;
    }
    hostRemove(anchor);
  }, "removeStaticNode");
  const processElement = /* @__PURE__ */ __name((n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    if (n2.type === "svg") {
      namespace = "svg";
    } else if (n2.type === "math") {
      namespace = "mathml";
    }
    if (n1 == null) {
      mountElement(
        n2,
        container,
        anchor,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized
      );
    } else {
      patchElement(
        n1,
        n2,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized
      );
    }
  }, "processElement");
  const mountElement = /* @__PURE__ */ __name((vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    let el;
    let vnodeHook;
    const { props, shapeFlag, transition, dirs } = vnode;
    el = vnode.el = hostCreateElement(
      vnode.type,
      namespace,
      props && props.is,
      props
    );
    if (shapeFlag & 8) {
      hostSetElementText(el, vnode.children);
    } else if (shapeFlag & 16) {
      mountChildren(
        vnode.children,
        el,
        null,
        parentComponent,
        parentSuspense,
        resolveChildrenNamespace(vnode, namespace),
        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],
            namespace,
            vnode.children,
            parentComponent,
            parentSuspense,
            unmountChildren
          );
        }
      }
      if ("value" in props) {
        hostPatchProp(el, "value", null, props.value, namespace);
      }
      if (vnodeHook = props.onVnodeBeforeMount) {
        invokeVNodeHook(vnodeHook, parentComponent, vnode);
      }
    }
    if (false) {
      def(el, "__vnode", vnode, true);
      def(el, "__vueParentComponent", parentComponent, true);
    }
    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);
    }
  }, "mountElement");
  const setScopeId = /* @__PURE__ */ __name((el, vnode, scopeId, slotScopeIds, parentComponent) => {
    if (scopeId) {
      hostSetScopeId(el, scopeId);
    }
    if (slotScopeIds) {
      for (let i2 = 0; i2 < slotScopeIds.length; i2++) {
        hostSetScopeId(el, slotScopeIds[i2]);
      }
    }
    if (parentComponent) {
      let subTree = parentComponent.subTree;
      if (false) {
        subTree = filterSingleRoot(subTree.children) || subTree;
      }
      if (vnode === subTree) {
        const parentVNode = parentComponent.vnode;
        setScopeId(
          el,
          parentVNode,
          parentVNode.scopeId,
          parentVNode.slotScopeIds,
          parentComponent.parent
        );
      }
    }
  }, "setScopeId");
  const mountChildren = /* @__PURE__ */ __name((children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start2 = 0) => {
    for (let i2 = start2; i2 < children.length; i2++) {
      const child = children[i2] = optimized ? cloneIfMounted(children[i2]) : normalizeVNode(children[i2]);
      patch2(
        null,
        child,
        container,
        anchor,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized
      );
    }
  }, "mountChildren");
  const patchElement = /* @__PURE__ */ __name((n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    const el = n2.el = n1.el;
    if (false) {
      el.__vnode = n2;
    }
    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 (false) {
      patchFlag = 0;
      optimized = false;
      dynamicChildren = null;
    }
    if (dynamicChildren) {
      patchBlockChildren(
        n1.dynamicChildren,
        dynamicChildren,
        el,
        parentComponent,
        parentSuspense,
        resolveChildrenNamespace(n2, namespace),
        slotScopeIds
      );
      if (false) {
        traverseStaticChildren(n1, n2);
      }
    } else if (!optimized) {
      patchChildren(
        n1,
        n2,
        el,
        null,
        parentComponent,
        parentSuspense,
        resolveChildrenNamespace(n2, namespace),
        slotScopeIds,
        false
      );
    }
    if (patchFlag > 0) {
      if (patchFlag & 16) {
        patchProps(
          el,
          n2,
          oldProps,
          newProps,
          parentComponent,
          parentSuspense,
          namespace
        );
      } else {
        if (patchFlag & 2) {
          if (oldProps.class !== newProps.class) {
            hostPatchProp(el, "class", null, newProps.class, namespace);
          }
        }
        if (patchFlag & 4) {
          hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
        }
        if (patchFlag & 8) {
          const propsToUpdate = n2.dynamicProps;
          for (let i2 = 0; i2 < propsToUpdate.length; i2++) {
            const key = propsToUpdate[i2];
            const prev2 = oldProps[key];
            const next2 = newProps[key];
            if (next2 !== prev2 || key === "value") {
              hostPatchProp(
                el,
                key,
                prev2,
                next2,
                namespace,
                n1.children,
                parentComponent,
                parentSuspense,
                unmountChildren
              );
            }
          }
        }
      }
      if (patchFlag & 1) {
        if (n1.children !== n2.children) {
          hostSetElementText(el, n2.children);
        }
      }
    } else if (!optimized && dynamicChildren == null) {
      patchProps(
        el,
        n2,
        oldProps,
        newProps,
        parentComponent,
        parentSuspense,
        namespace
      );
    }
    if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
      queuePostRenderEffect(() => {
        vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
        dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
      }, parentSuspense);
    }
  }, "patchElement");
  const patchBlockChildren = /* @__PURE__ */ __name((oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
    for (let i2 = 0; i2 < newChildren.length; i2++) {
      const oldVNode = oldChildren[i2];
      const newVNode = newChildren[i2];
      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$1 || // - 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
        )
      );
      patch2(
        oldVNode,
        newVNode,
        container,
        null,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        true
      );
    }
  }, "patchBlockChildren");
  const patchProps = /* @__PURE__ */ __name((el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
    if (oldProps !== newProps) {
      if (oldProps !== EMPTY_OBJ) {
        for (const key in oldProps) {
          if (!isReservedProp(key) && !(key in newProps)) {
            hostPatchProp(
              el,
              key,
              oldProps[key],
              null,
              namespace,
              vnode.children,
              parentComponent,
              parentSuspense,
              unmountChildren
            );
          }
        }
      }
      for (const key in newProps) {
        if (isReservedProp(key)) continue;
        const next2 = newProps[key];
        const prev2 = oldProps[key];
        if (next2 !== prev2 && key !== "value") {
          hostPatchProp(
            el,
            key,
            prev2,
            next2,
            namespace,
            vnode.children,
            parentComponent,
            parentSuspense,
            unmountChildren
          );
        }
      }
      if ("value" in newProps) {
        hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
      }
    }
  }, "patchProps");
  const processFragment = /* @__PURE__ */ __name((n1, n2, container, anchor, parentComponent, parentSuspense, namespace, 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 (false) {
      patchFlag = 0;
      optimized = false;
      dynamicChildren = null;
    }
    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,
        namespace,
        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,
          namespace,
          slotScopeIds
        );
        if (false) {
          traverseStaticChildren(n1, n2);
        } else 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,
          namespace,
          slotScopeIds,
          optimized
        );
      }
    }
  }, "processFragment");
  const processComponent = /* @__PURE__ */ __name((n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    n2.slotScopeIds = slotScopeIds;
    if (n1 == null) {
      if (n2.shapeFlag & 512) {
        parentComponent.ctx.activate(
          n2,
          container,
          anchor,
          namespace,
          optimized
        );
      } else {
        mountComponent(
          n2,
          container,
          anchor,
          parentComponent,
          parentSuspense,
          namespace,
          optimized
        );
      }
    } else {
      updateComponent(n1, n2, optimized);
    }
  }, "processComponent");
  const mountComponent = /* @__PURE__ */ __name((initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
    const instance = initialVNode.component = createComponentInstance(
      initialVNode,
      parentComponent,
      parentSuspense
    );
    if (false) {
      registerHMR(instance);
    }
    if (false) {
      pushWarningContext(initialVNode);
      startMeasure(instance, `mount`);
    }
    if (isKeepAlive(initialVNode)) {
      instance.ctx.renderer = internals;
    }
    {
      if (false) {
        startMeasure(instance, `init`);
      }
      setupComponent(instance);
      if (false) {
        endMeasure(instance, `init`);
      }
    }
    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,
        namespace,
        optimized
      );
    }
    if (false) {
      popWarningContext();
      endMeasure(instance, `mount`);
    }
  }, "mountComponent");
  const updateComponent = /* @__PURE__ */ __name((n1, n2, optimized) => {
    const instance = n2.component = n1.component;
    if (shouldUpdateComponent(n1, n2, optimized)) {
      if (instance.asyncDep && !instance.asyncResolved) {
        if (false) {
          pushWarningContext(n2);
        }
        updateComponentPreRender(instance, n2, optimized);
        if (false) {
          popWarningContext();
        }
        return;
      } else {
        instance.next = n2;
        invalidateJob(instance.update);
        instance.effect.dirty = true;
        instance.update();
      }
    } else {
      n2.el = n1.el;
      instance.vnode = n2;
    }
  }, "updateComponent");
  const setupRenderEffect = /* @__PURE__ */ __name((instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
    const componentUpdateFn = /* @__PURE__ */ __name(() => {
      if (!instance.isMounted) {
        let vnodeHook;
        const { el, props } = initialVNode;
        const { bm, m, parent } = 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 = /* @__PURE__ */ __name(() => {
            if (false) {
              startMeasure(instance, `render`);
            }
            instance.subTree = renderComponentRoot(instance);
            if (false) {
              endMeasure(instance, `render`);
            }
            if (false) {
              startMeasure(instance, `hydrate`);
            }
            hydrateNode(
              el,
              instance.subTree,
              instance,
              parentSuspense,
              null
            );
            if (false) {
              endMeasure(instance, `hydrate`);
            }
          }, "hydrateSubTree");
          if (isAsyncWrapperVNode) {
            initialVNode.type.__asyncLoader().then(
              // note: we are moving the render call into an async callback,
              // which means it won't track dependencies - but it's ok because
              // a server-rendered async wrapper is already in resolved state
              // and it will never need to change.
              () => !instance.isUnmounted && hydrateSubTree()
            );
          } else {
            hydrateSubTree();
          }
        } else {
          if (false) {
            startMeasure(instance, `render`);
          }
          const subTree = instance.subTree = renderComponentRoot(instance);
          if (false) {
            endMeasure(instance, `render`);
          }
          if (false) {
            startMeasure(instance, `patch`);
          }
          patch2(
            null,
            subTree,
            container,
            anchor,
            instance,
            parentSuspense,
            namespace
          );
          if (false) {
            endMeasure(instance, `patch`);
          }
          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;
        if (false) {
          devtoolsComponentAdded(instance);
        }
        initialVNode = container = anchor = null;
      } else {
        let { next: next2, bu, u, parent, vnode } = instance;
        {
          const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
          if (nonHydratedAsyncRoot) {
            if (next2) {
              next2.el = vnode.el;
              updateComponentPreRender(instance, next2, optimized);
            }
            nonHydratedAsyncRoot.asyncDep.then(() => {
              if (!instance.isUnmounted) {
                componentUpdateFn();
              }
            });
            return;
          }
        }
        let originNext = next2;
        let vnodeHook;
        if (false) {
          pushWarningContext(next2 || instance.vnode);
        }
        toggleRecurse(instance, false);
        if (next2) {
          next2.el = vnode.el;
          updateComponentPreRender(instance, next2, optimized);
        } else {
          next2 = vnode;
        }
        if (bu) {
          invokeArrayFns(bu);
        }
        if (vnodeHook = next2.props && next2.props.onVnodeBeforeUpdate) {
          invokeVNodeHook(vnodeHook, parent, next2, vnode);
        }
        toggleRecurse(instance, true);
        if (false) {
          startMeasure(instance, `render`);
        }
        const nextTree = renderComponentRoot(instance);
        if (false) {
          endMeasure(instance, `render`);
        }
        const prevTree = instance.subTree;
        instance.subTree = nextTree;
        if (false) {
          startMeasure(instance, `patch`);
        }
        patch2(
          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,
          namespace
        );
        if (false) {
          endMeasure(instance, `patch`);
        }
        next2.el = nextTree.el;
        if (originNext === null) {
          updateHOCHostEl(instance, nextTree.el);
        }
        if (u) {
          queuePostRenderEffect(u, parentSuspense);
        }
        if (vnodeHook = next2.props && next2.props.onVnodeUpdated) {
          queuePostRenderEffect(
            () => invokeVNodeHook(vnodeHook, parent, next2, vnode),
            parentSuspense
          );
        }
        if (false) {
          devtoolsComponentUpdated(instance);
        }
        if (false) {
          popWarningContext();
        }
      }
    }, "componentUpdateFn");
    const effect2 = instance.effect = new ReactiveEffect(
      componentUpdateFn,
      NOOP,
      () => queueJob(update),
      instance.scope
      // track it in component's effect scope
    );
    const update = instance.update = () => {
      if (effect2.dirty) {
        effect2.run();
      }
    };
    update.id = instance.uid;
    toggleRecurse(instance, true);
    if (false) {
      effect2.onTrack = instance.rtc ? (e2) => invokeArrayFns(instance.rtc, e2) : void 0;
      effect2.onTrigger = instance.rtg ? (e2) => invokeArrayFns(instance.rtg, e2) : void 0;
      update.ownerInstance = instance;
    }
    update();
  }, "setupRenderEffect");
  const updateComponentPreRender = /* @__PURE__ */ __name((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();
  }, "updateComponentPreRender");
  const patchChildren = /* @__PURE__ */ __name((n1, n2, container, anchor, parentComponent, parentSuspense, namespace, 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,
          namespace,
          slotScopeIds,
          optimized
        );
        return;
      } else if (patchFlag & 256) {
        patchUnkeyedChildren(
          c1,
          c2,
          container,
          anchor,
          parentComponent,
          parentSuspense,
          namespace,
          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,
            namespace,
            slotScopeIds,
            optimized
          );
        } else {
          unmountChildren(c1, parentComponent, parentSuspense, true);
        }
      } else {
        if (prevShapeFlag & 8) {
          hostSetElementText(container, "");
        }
        if (shapeFlag & 16) {
          mountChildren(
            c2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        }
      }
    }
  }, "patchChildren");
  const patchUnkeyedChildren = /* @__PURE__ */ __name((c1, c2, container, anchor, parentComponent, parentSuspense, namespace, 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 i2;
    for (i2 = 0; i2 < commonLength; i2++) {
      const nextChild = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
      patch2(
        c1[i2],
        nextChild,
        container,
        null,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized
      );
    }
    if (oldLength > newLength) {
      unmountChildren(
        c1,
        parentComponent,
        parentSuspense,
        true,
        false,
        commonLength
      );
    } else {
      mountChildren(
        c2,
        container,
        anchor,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized,
        commonLength
      );
    }
  }, "patchUnkeyedChildren");
  const patchKeyedChildren = /* @__PURE__ */ __name((c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    let i2 = 0;
    const l2 = c2.length;
    let e1 = c1.length - 1;
    let e2 = l2 - 1;
    while (i2 <= e1 && i2 <= e2) {
      const n1 = c1[i2];
      const n2 = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
      if (isSameVNodeType(n1, n2)) {
        patch2(
          n1,
          n2,
          container,
          null,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
      } else {
        break;
      }
      i2++;
    }
    while (i2 <= e1 && i2 <= e2) {
      const n1 = c1[e1];
      const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
      if (isSameVNodeType(n1, n2)) {
        patch2(
          n1,
          n2,
          container,
          null,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
      } else {
        break;
      }
      e1--;
      e2--;
    }
    if (i2 > e1) {
      if (i2 <= e2) {
        const nextPos = e2 + 1;
        const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
        while (i2 <= e2) {
          patch2(
            null,
            c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]),
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
          i2++;
        }
      }
    } else if (i2 > e2) {
      while (i2 <= e1) {
        unmount(c1[i2], parentComponent, parentSuspense, true);
        i2++;
      }
    } else {
      const s1 = i2;
      const s2 = i2;
      const keyToNewIndexMap = /* @__PURE__ */ new Map();
      for (i2 = s2; i2 <= e2; i2++) {
        const nextChild = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
        if (nextChild.key != null) {
          if (false) {
            warn$1$1(
              `Duplicate keys found during update:`,
              JSON.stringify(nextChild.key),
              `Make sure keys are unique.`
            );
          }
          keyToNewIndexMap.set(nextChild.key, i2);
        }
      }
      let j;
      let patched = 0;
      const toBePatched = e2 - s2 + 1;
      let moved = false;
      let maxNewIndexSoFar = 0;
      const newIndexToOldIndexMap = new Array(toBePatched);
      for (i2 = 0; i2 < toBePatched; i2++) newIndexToOldIndexMap[i2] = 0;
      for (i2 = s1; i2 <= e1; i2++) {
        const prevChild = c1[i2];
        if (patched >= toBePatched) {
          unmount(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) {
          unmount(prevChild, parentComponent, parentSuspense, true);
        } else {
          newIndexToOldIndexMap[newIndex - s2] = i2 + 1;
          if (newIndex >= maxNewIndexSoFar) {
            maxNewIndexSoFar = newIndex;
          } else {
            moved = true;
          }
          patch2(
            prevChild,
            c2[newIndex],
            container,
            null,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
          patched++;
        }
      }
      const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
      j = increasingNewIndexSequence.length - 1;
      for (i2 = toBePatched - 1; i2 >= 0; i2--) {
        const nextIndex = s2 + i2;
        const nextChild = c2[nextIndex];
        const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
        if (newIndexToOldIndexMap[i2] === 0) {
          patch2(
            null,
            nextChild,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else if (moved) {
          if (j < 0 || i2 !== increasingNewIndexSequence[j]) {
            move(nextChild, container, anchor, 2);
          } else {
            j--;
          }
        }
      }
    }
  }, "patchKeyedChildren");
  const move = /* @__PURE__ */ __name((vnode, container, anchor, moveType, parentSuspense = null) => {
    const { el, type, transition, children, shapeFlag } = vnode;
    if (shapeFlag & 6) {
      move(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$1) {
      hostInsert(el, container, anchor);
      for (let i2 = 0; i2 < children.length; i2++) {
        move(children[i2], 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 remove222 = /* @__PURE__ */ __name(() => hostInsert(el, container, anchor), "remove22");
        const performLeave = /* @__PURE__ */ __name(() => {
          leave(el, () => {
            remove222();
            afterLeave && afterLeave();
          });
        }, "performLeave");
        if (delayLeave) {
          delayLeave(el, remove222, performLeave);
        } else {
          performLeave();
        }
      }
    } else {
      hostInsert(el, container, anchor);
    }
  }, "move");
  const unmount = /* @__PURE__ */ __name((vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
    const {
      type,
      props,
      ref: ref3,
      children,
      dynamicChildren,
      shapeFlag,
      patchFlag,
      dirs,
      memoIndex
    } = vnode;
    if (patchFlag === -2) {
      optimized = false;
    }
    if (ref3 != null) {
      setRef(ref3, null, parentSuspense, vnode, true);
    }
    if (memoIndex != null) {
      parentComponent.renderCache[memoIndex] = 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 && // #1153: fast path should not be taken for non-stable (v-for) fragments
      (type !== Fragment$1 || patchFlag > 0 && patchFlag & 64)) {
        unmountChildren(
          dynamicChildren,
          parentComponent,
          parentSuspense,
          false,
          true
        );
      } else if (type === Fragment$1 && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
        unmountChildren(children, parentComponent, parentSuspense);
      }
      if (doRemove) {
        remove22(vnode);
      }
    }
    if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
      queuePostRenderEffect(() => {
        vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
        shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
      }, parentSuspense);
    }
  }, "unmount");
  const remove22 = /* @__PURE__ */ __name((vnode) => {
    const { type, el, anchor, transition } = vnode;
    if (type === Fragment$1) {
      if (false) {
        vnode.children.forEach((child) => {
          if (child.type === Comment) {
            hostRemove(child.el);
          } else {
            remove22(child);
          }
        });
      } else {
        removeFragment(el, anchor);
      }
      return;
    }
    if (type === Static) {
      removeStaticNode(vnode);
      return;
    }
    const performRemove = /* @__PURE__ */ __name(() => {
      hostRemove(el);
      if (transition && !transition.persisted && transition.afterLeave) {
        transition.afterLeave();
      }
    }, "performRemove");
    if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
      const { leave, delayLeave } = transition;
      const performLeave = /* @__PURE__ */ __name(() => leave(el, performRemove), "performLeave");
      if (delayLeave) {
        delayLeave(vnode.el, performRemove, performLeave);
      } else {
        performLeave();
      }
    } else {
      performRemove();
    }
  }, "remove2");
  const removeFragment = /* @__PURE__ */ __name((cur, end) => {
    let next2;
    while (cur !== end) {
      next2 = hostNextSibling(cur);
      hostRemove(cur);
      cur = next2;
    }
    hostRemove(end);
  }, "removeFragment");
  const unmountComponent = /* @__PURE__ */ __name((instance, parentSuspense, doRemove) => {
    if (false) {
      unregisterHMR(instance);
    }
    const { bum, scope, update, subTree, um, m, a } = instance;
    invalidateMount(m);
    invalidateMount(a);
    if (bum) {
      invokeArrayFns(bum);
    }
    scope.stop();
    if (update) {
      update.active = false;
      unmount(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();
      }
    }
    if (false) {
      devtoolsComponentRemoved(instance);
    }
  }, "unmountComponent");
  const unmountChildren = /* @__PURE__ */ __name((children, parentComponent, parentSuspense, doRemove = false, optimized = false, start2 = 0) => {
    for (let i2 = start2; i2 < children.length; i2++) {
      unmount(children[i2], parentComponent, parentSuspense, doRemove, optimized);
    }
  }, "unmountChildren");
  const getNextHostNode = /* @__PURE__ */ __name((vnode) => {
    if (vnode.shapeFlag & 6) {
      return getNextHostNode(vnode.component.subTree);
    }
    if (vnode.shapeFlag & 128) {
      return vnode.suspense.next();
    }
    return hostNextSibling(vnode.anchor || vnode.el);
  }, "getNextHostNode");
  let isFlushing2 = false;
  const render2 = /* @__PURE__ */ __name((vnode, container, namespace) => {
    if (vnode == null) {
      if (container._vnode) {
        unmount(container._vnode, null, null, true);
      }
    } else {
      patch2(
        container._vnode || null,
        vnode,
        container,
        null,
        null,
        null,
        namespace
      );
    }
    if (!isFlushing2) {
      isFlushing2 = true;
      flushPreFlushCbs();
      flushPostFlushCbs();
      isFlushing2 = false;
    }
    container._vnode = vnode;
  }, "render");
  const internals = {
    p: patch2,
    um: unmount,
    m: move,
    r: remove22,
    mt: mountComponent,
    mc: mountChildren,
    pc: patchChildren,
    pbc: patchBlockChildren,
    n: getNextHostNode,
    o: options4
  };
  let hydrate2;
  let hydrateNode;
  if (createHydrationFns) {
    [hydrate2, hydrateNode] = createHydrationFns(
      internals
    );
  }
  return {
    render: render2,
    hydrate: hydrate2,
    createApp: createAppAPI(render2, hydrate2)
  };
}
__name(baseCreateRenderer, "baseCreateRenderer");
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;
}
__name(resolveChildrenNamespace, "resolveChildrenNamespace");
function toggleRecurse({ effect: effect2, update }, allowed) {
  effect2.allowRecurse = update.allowRecurse = allowed;
}
__name(toggleRecurse, "toggleRecurse");
function needTransition(parentSuspense, transition) {
  return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
}
__name(needTransition, "needTransition");
function traverseStaticChildren(n1, n2, shallow = false) {
  const ch1 = n1.children;
  const ch2 = n2.children;
  if (isArray$4(ch1) && isArray$4(ch2)) {
    for (let i2 = 0; i2 < ch1.length; i2++) {
      const c1 = ch1[i2];
      let c2 = ch2[i2];
      if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
        if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
          c2 = ch2[i2] = cloneIfMounted(ch2[i2]);
          c2.el = c1.el;
        }
        if (!shallow && c2.patchFlag !== -2)
          traverseStaticChildren(c1, c2);
      }
      if (c2.type === Text$4) {
        c2.el = c1.el;
      }
      if (false) {
        c2.el = c1.el;
      }
    }
  }
}
__name(traverseStaticChildren, "traverseStaticChildren");
function getSequence(arr) {
  const p2 = arr.slice();
  const result = [0];
  let i2, j, u, v2, c;
  const len = arr.length;
  for (i2 = 0; i2 < len; i2++) {
    const arrI = arr[i2];
    if (arrI !== 0) {
      j = result[result.length - 1];
      if (arr[j] < arrI) {
        p2[i2] = j;
        result.push(i2);
        continue;
      }
      u = 0;
      v2 = result.length - 1;
      while (u < v2) {
        c = u + v2 >> 1;
        if (arr[result[c]] < arrI) {
          u = c + 1;
        } else {
          v2 = c;
        }
      }
      if (arrI < arr[result[u]]) {
        if (u > 0) {
          p2[i2] = result[u - 1];
        }
        result[u] = i2;
      }
    }
  }
  u = result.length;
  v2 = result[u - 1];
  while (u-- > 0) {
    result[u] = v2;
    v2 = p2[v2];
  }
  return result;
}
__name(getSequence, "getSequence");
function locateNonHydratedAsyncRoot(instance) {
  const subComponent = instance.subTree.component;
  if (subComponent) {
    if (subComponent.asyncDep && !subComponent.asyncResolved) {
      return subComponent;
    } else {
      return locateNonHydratedAsyncRoot(subComponent);
    }
  }
}
__name(locateNonHydratedAsyncRoot, "locateNonHydratedAsyncRoot");
function invalidateMount(hooks) {
  if (hooks) {
    for (let i2 = 0; i2 < hooks.length; i2++) hooks[i2].active = false;
  }
}
__name(invalidateMount, "invalidateMount");
const ssrContextKey = Symbol.for("v-scx");
const useSSRContext = /* @__PURE__ */ __name(() => {
  {
    const ctx = inject(ssrContextKey);
    if (!ctx) {
    }
    return ctx;
  }
}, "useSSRContext");
function watchEffect(effect2, options4) {
  return doWatch(effect2, null, options4);
}
__name(watchEffect, "watchEffect");
function watchPostEffect(effect2, options4) {
  return doWatch(
    effect2,
    null,
    false ? extend$1({}, options4, { flush: "post" }) : { flush: "post" }
  );
}
__name(watchPostEffect, "watchPostEffect");
function watchSyncEffect(effect2, options4) {
  return doWatch(
    effect2,
    null,
    false ? extend$1({}, options4, { flush: "sync" }) : { flush: "sync" }
  );
}
__name(watchSyncEffect, "watchSyncEffect");
const INITIAL_WATCHER_VALUE = {};
function watch(source, cb, options4) {
  if (false) {
    warn$1$1(
      `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
    );
  }
  return doWatch(source, cb, options4);
}
__name(watch, "watch");
function doWatch(source, cb, {
  immediate,
  deep,
  flush,
  once: once2,
  onTrack,
  onTrigger
} = EMPTY_OBJ) {
  if (cb && once2) {
    const _cb = cb;
    cb = /* @__PURE__ */ __name((...args) => {
      _cb(...args);
      unwatch();
    }, "cb");
  }
  if (false) {
    warn$1$1(
      `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
    );
  }
  if (false) {
    if (immediate !== void 0) {
      warn$1$1(
        `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
    if (deep !== void 0) {
      warn$1$1(
        `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
    if (once2 !== void 0) {
      warn$1$1(
        `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
  }
  const warnInvalidSource = /* @__PURE__ */ __name((s) => {
    warn$1$1(
      `Invalid watch source: `,
      s,
      `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
    );
  }, "warnInvalidSource");
  const instance = currentInstance;
  const reactiveGetter = /* @__PURE__ */ __name((source2) => deep === true ? source2 : (
    // for deep: false, only traverse root-level properties
    traverse(source2, deep === false ? 1 : void 0)
  ), "reactiveGetter");
  let getter;
  let forceTrigger = false;
  let isMultiSource = false;
  if (isRef(source)) {
    getter = /* @__PURE__ */ __name(() => source.value, "getter");
    forceTrigger = isShallow(source);
  } else if (isReactive(source)) {
    getter = /* @__PURE__ */ __name(() => reactiveGetter(source), "getter");
    forceTrigger = true;
  } else if (isArray$4(source)) {
    isMultiSource = true;
    forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
    getter = /* @__PURE__ */ __name(() => source.map((s) => {
      if (isRef(s)) {
        return s.value;
      } else if (isReactive(s)) {
        return reactiveGetter(s);
      } else if (isFunction$4(s)) {
        return callWithErrorHandling(s, instance, 2);
      } else {
      }
    }), "getter");
  } else if (isFunction$4(source)) {
    if (cb) {
      getter = /* @__PURE__ */ __name(() => callWithErrorHandling(source, instance, 2), "getter");
    } else {
      getter = /* @__PURE__ */ __name(() => {
        if (cleanup) {
          cleanup();
        }
        return callWithAsyncErrorHandling(
          source,
          instance,
          3,
          [onCleanup]
        );
      }, "getter");
    }
  } else {
    getter = NOOP;
  }
  if (cb && deep) {
    const baseGetter = getter;
    getter = /* @__PURE__ */ __name(() => traverse(baseGetter()), "getter");
  }
  let cleanup;
  let onCleanup = /* @__PURE__ */ __name((fn) => {
    cleanup = effect2.onStop = () => {
      callWithErrorHandling(fn, instance, 4);
      cleanup = effect2.onStop = void 0;
    };
  }, "onCleanup");
  let ssrCleanup;
  if (isInSSRComponentSetup) {
    onCleanup = NOOP;
    if (!cb) {
      getter();
    } else if (immediate) {
      callWithAsyncErrorHandling(cb, instance, 3, [
        getter(),
        isMultiSource ? [] : void 0,
        onCleanup
      ]);
    }
    if (flush === "sync") {
      const ctx = useSSRContext();
      ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
    } else {
      return NOOP;
    }
  }
  let oldValue2 = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  const job = /* @__PURE__ */ __name(() => {
    if (!effect2.active || !effect2.dirty) {
      return;
    }
    if (cb) {
      const newValue2 = effect2.run();
      if (deep || forceTrigger || (isMultiSource ? newValue2.some((v2, i2) => hasChanged(v2, oldValue2[i2])) : hasChanged(newValue2, oldValue2)) || false) {
        if (cleanup) {
          cleanup();
        }
        callWithAsyncErrorHandling(cb, instance, 3, [
          newValue2,
          // pass undefined as the old value when it's changed for the first time
          oldValue2 === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue2[0] === INITIAL_WATCHER_VALUE ? [] : oldValue2,
          onCleanup
        ]);
        oldValue2 = newValue2;
      }
    } else {
      effect2.run();
    }
  }, "job");
  job.allowRecurse = !!cb;
  let scheduler;
  if (flush === "sync") {
    scheduler = job;
  } else if (flush === "post") {
    scheduler = /* @__PURE__ */ __name(() => queuePostRenderEffect(job, instance && instance.suspense), "scheduler");
  } else {
    job.pre = true;
    if (instance) job.id = instance.uid;
    scheduler = /* @__PURE__ */ __name(() => queueJob(job), "scheduler");
  }
  const effect2 = new ReactiveEffect(getter, NOOP, scheduler);
  const scope = getCurrentScope();
  const unwatch = /* @__PURE__ */ __name(() => {
    effect2.stop();
    if (scope) {
      remove$1(scope.effects, effect2);
    }
  }, "unwatch");
  if (false) {
    effect2.onTrack = onTrack;
    effect2.onTrigger = onTrigger;
  }
  if (cb) {
    if (immediate) {
      job();
    } else {
      oldValue2 = effect2.run();
    }
  } else if (flush === "post") {
    queuePostRenderEffect(
      effect2.run.bind(effect2),
      instance && instance.suspense
    );
  } else {
    effect2.run();
  }
  if (ssrCleanup) ssrCleanup.push(unwatch);
  return unwatch;
}
__name(doWatch, "doWatch");
function instanceWatch(source, value4, options4) {
  const publicThis = this.proxy;
  const getter = isString$7(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  let cb;
  if (isFunction$4(value4)) {
    cb = value4;
  } else {
    cb = value4.handler;
    options4 = value4;
  }
  const reset2 = setCurrentInstance(this);
  const res = doWatch(getter, cb.bind(publicThis), options4);
  reset2();
  return res;
}
__name(instanceWatch, "instanceWatch");
function createPathGetter(ctx, path) {
  const segments = path.split(".");
  return () => {
    let cur = ctx;
    for (let i2 = 0; i2 < segments.length && cur; i2++) {
      cur = cur[segments[i2]];
    }
    return cur;
  };
}
__name(createPathGetter, "createPathGetter");
function traverse(value4, depth = Infinity, seen2) {
  if (depth <= 0 || !isObject$6(value4) || value4["__v_skip"]) {
    return value4;
  }
  seen2 = seen2 || /* @__PURE__ */ new Set();
  if (seen2.has(value4)) {
    return value4;
  }
  seen2.add(value4);
  depth--;
  if (isRef(value4)) {
    traverse(value4.value, depth, seen2);
  } else if (isArray$4(value4)) {
    for (let i2 = 0; i2 < value4.length; i2++) {
      traverse(value4[i2], depth, seen2);
    }
  } else if (isSet(value4) || isMap(value4)) {
    value4.forEach((v2) => {
      traverse(v2, depth, seen2);
    });
  } else if (isPlainObject$4(value4)) {
    for (const key in value4) {
      traverse(value4[key], depth, seen2);
    }
    for (const key of Object.getOwnPropertySymbols(value4)) {
      if (Object.prototype.propertyIsEnumerable.call(value4, key)) {
        traverse(value4[key], depth, seen2);
      }
    }
  }
  return value4;
}
__name(traverse, "traverse");
const isKeepAlive = /* @__PURE__ */ __name((vnode) => vnode.type.__isKeepAlive, "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;
    if (false) {
      instance.__v_cache = cache2;
    }
    const parentSuspense = instance.suspense;
    const {
      renderer: {
        p: patch2,
        m: move,
        um: _unmount,
        o: { createElement: createElement2 }
      }
    } = sharedContext;
    const storageContainer = createElement2("div");
    sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
      const instance2 = vnode.component;
      move(vnode, container, anchor, 0, parentSuspense);
      patch2(
        instance2.vnode,
        vnode,
        container,
        anchor,
        instance2,
        parentSuspense,
        namespace,
        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);
      if (false) {
        devtoolsComponentAdded(instance2);
      }
    };
    sharedContext.deactivate = (vnode) => {
      const instance2 = vnode.component;
      invalidateMount(instance2.m);
      invalidateMount(instance2.a);
      move(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);
      if (false) {
        devtoolsComponentAdded(instance2);
      }
    };
    function unmount(vnode) {
      resetShapeFlag(vnode);
      _unmount(vnode, instance, parentSuspense, true);
    }
    __name(unmount, "unmount");
    function pruneCache(filter4) {
      cache2.forEach((vnode, key) => {
        const name2 = getComponentName(vnode.type);
        if (name2 && (!filter4 || !filter4(name2))) {
          pruneCacheEntry(key);
        }
      });
    }
    __name(pruneCache, "pruneCache");
    function pruneCacheEntry(key) {
      const cached = cache2.get(key);
      if (!current || !isSameVNodeType(cached, current)) {
        unmount(cached);
      } else if (current) {
        resetShapeFlag(current);
      }
      cache2.delete(key);
      keys2.delete(key);
    }
    __name(pruneCacheEntry, "pruneCacheEntry");
    watch(
      () => [props.include, props.exclude],
      ([include, exclude]) => {
        include && pruneCache((name2) => matches$1(include, name2));
        exclude && pruneCache((name2) => !matches$1(exclude, name2));
      },
      // prune post-render after `current` has been updated
      { flush: "post", deep: true }
    );
    let pendingCacheKey = null;
    const cacheSubtree = /* @__PURE__ */ __name(() => {
      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));
        }
      }
    }, "cacheSubtree");
    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;
        }
        unmount(cached);
      });
    });
    return () => {
      pendingCacheKey = null;
      if (!slots.default) {
        return null;
      }
      const children = slots.default();
      const rawVNode = children[0];
      if (children.length > 1) {
        if (false) {
          warn$1$1(`KeepAlive should contain exactly one component child.`);
        }
        current = null;
        return children;
      } else if (!isVNode$1(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
        current = null;
        return rawVNode;
      }
      let vnode = getInnerChild(rawVNode);
      const comp = vnode.type;
      const name2 = getComponentName(
        isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
      );
      const { include, exclude, max } = props;
      if (include && (!name2 || !matches$1(include, name2)) || exclude && name2 && matches$1(exclude, name2)) {
        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$1(pattern, name2) {
  if (isArray$4(pattern)) {
    return pattern.some((p2) => matches$1(p2, name2));
  } else if (isString$7(pattern)) {
    return pattern.split(",").includes(name2);
  } else if (isRegExp$4(pattern)) {
    return pattern.test(name2);
  }
  return false;
}
__name(matches$1, "matches$1");
function onActivated(hook, target) {
  registerKeepAliveHook(hook, "a", target);
}
__name(onActivated, "onActivated");
function onDeactivated(hook, target) {
  registerKeepAliveHook(hook, "da", target);
}
__name(onDeactivated, "onDeactivated");
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;
    }
  }
}
__name(registerKeepAliveHook, "registerKeepAliveHook");
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  const injected = injectHook(
    type,
    hook,
    keepAliveRoot,
    true
    /* prepend */
  );
  onUnmounted(() => {
    remove$1(keepAliveRoot[type], injected);
  }, target);
}
__name(injectToKeepAliveRoot, "injectToKeepAliveRoot");
function resetShapeFlag(vnode) {
  vnode.shapeFlag &= ~256;
  vnode.shapeFlag &= ~512;
}
__name(resetShapeFlag, "resetShapeFlag");
function getInnerChild(vnode) {
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
}
__name(getInnerChild, "getInnerChild");
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;
}
__name(useTransitionState, "useTransitionState");
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 = /* @__PURE__ */ __name((instance) => {
  const subTree = instance.subTree;
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
}, "recursiveGetSubtree");
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;
      }
      let child = children[0];
      if (children.length > 1) {
        let hasFound = false;
        for (const c of children) {
          if (c.type !== Comment) {
            if (false) {
              warn$1$1(
                "<transition> can only be used on a single element or component. Use <transition-group> for lists."
              );
              break;
            }
            child = c;
            hasFound = true;
            if (true) break;
          }
        }
      }
      const rawProps = toRaw(props);
      const { mode: mode2 } = rawProps;
      if (false) {
        warn$1$1(`invalid <transition> mode: ${mode2}`);
      }
      if (state.isLeaving) {
        return emptyPlaceholder(child);
      }
      const innerChild = getKeepAliveChild(child);
      if (!innerChild) {
        return emptyPlaceholder(child);
      }
      let enterHooks = resolveTransitionHooks(
        innerChild,
        rawProps,
        state,
        instance,
        // #11061, ensure enterHooks is fresh after clone
        (hooks) => enterHooks = hooks
      );
      setTransitionHooks(innerChild, enterHooks);
      const oldChild = instance.subTree;
      const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
      if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
        const leavingHooks = resolveTransitionHooks(
          oldInnerChild,
          rawProps,
          state,
          instance
        );
        setTransitionHooks(oldInnerChild, leavingHooks);
        if (mode2 === "out-in" && innerChild.type !== Comment) {
          state.isLeaving = true;
          leavingHooks.afterLeave = () => {
            state.isLeaving = false;
            if (instance.update.active !== false) {
              instance.effect.dirty = true;
              instance.update();
            }
          };
          return emptyPlaceholder(child);
        } else if (mode2 === "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;
    };
  }
};
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;
}
__name(getLeavingNodesForType, "getLeavingNodesForType");
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  const {
    appear,
    mode: mode2,
    persisted = false,
    onBeforeEnter: onBeforeEnter3,
    onEnter: onEnter7,
    onAfterEnter: onAfterEnter4,
    onEnterCancelled,
    onBeforeLeave: onBeforeLeave3,
    onLeave: onLeave5,
    onAfterLeave: onAfterLeave6,
    onLeaveCancelled,
    onBeforeAppear,
    onAppear,
    onAfterAppear,
    onAppearCancelled
  } = props;
  const key = String(vnode.key);
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  const callHook2 = /* @__PURE__ */ __name((hook, args) => {
    hook && callWithAsyncErrorHandling(
      hook,
      instance,
      9,
      args
    );
  }, "callHook2");
  const callAsyncHook = /* @__PURE__ */ __name((hook, args) => {
    const done = args[1];
    callHook2(hook, args);
    if (isArray$4(hook)) {
      if (hook.every((hook2) => hook2.length <= 1)) done();
    } else if (hook.length <= 1) {
      done();
    }
  }, "callAsyncHook");
  const hooks = {
    mode: mode2,
    persisted,
    beforeEnter(el) {
      let hook = onBeforeEnter3;
      if (!state.isMounted) {
        if (appear) {
          hook = onBeforeAppear || onBeforeEnter3;
        } 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 = onEnter7;
      let afterHook = onAfterEnter4;
      let cancelHook = onEnterCancelled;
      if (!state.isMounted) {
        if (appear) {
          hook = onAppear || onEnter7;
          afterHook = onAfterAppear || onAfterEnter4;
          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, remove22) {
      const key2 = String(vnode.key);
      if (el[enterCbKey$1]) {
        el[enterCbKey$1](
          true
          /* cancelled */
        );
      }
      if (state.isUnmounting) {
        return remove22();
      }
      callHook2(onBeforeLeave3, [el]);
      let called = false;
      const done = el[leaveCbKey] = (cancelled) => {
        if (called) return;
        called = true;
        remove22();
        if (cancelled) {
          callHook2(onLeaveCancelled, [el]);
        } else {
          callHook2(onAfterLeave6, [el]);
        }
        el[leaveCbKey] = void 0;
        if (leavingVNodesCache[key2] === vnode) {
          delete leavingVNodesCache[key2];
        }
      };
      leavingVNodesCache[key2] = vnode;
      if (onLeave5) {
        callAsyncHook(onLeave5, [el, done]);
      } else {
        done();
      }
    },
    clone(vnode2) {
      const hooks2 = resolveTransitionHooks(
        vnode2,
        props,
        state,
        instance,
        postClone
      );
      if (postClone) postClone(hooks2);
      return hooks2;
    }
  };
  return hooks;
}
__name(resolveTransitionHooks, "resolveTransitionHooks");
function emptyPlaceholder(vnode) {
  if (isKeepAlive(vnode)) {
    vnode = cloneVNode(vnode);
    vnode.children = null;
    return vnode;
  }
}
__name(emptyPlaceholder, "emptyPlaceholder");
function getKeepAliveChild(vnode) {
  if (!isKeepAlive(vnode)) {
    return vnode;
  }
  if (false) {
    return vnode.component.subTree;
  }
  const { shapeFlag, children } = vnode;
  if (children) {
    if (shapeFlag & 16) {
      return children[0];
    }
    if (shapeFlag & 32 && isFunction$4(children.default)) {
      return children.default();
    }
  }
}
__name(getKeepAliveChild, "getKeepAliveChild");
function setTransitionHooks(vnode, hooks) {
  if (vnode.shapeFlag & 6 && vnode.component) {
    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;
  }
}
__name(setTransitionHooks, "setTransitionHooks");
function getTransitionRawChildren(children, keepComment = false, parentKey) {
  let ret = [];
  let keyedFragmentCount = 0;
  for (let i2 = 0; i2 < children.length; i2++) {
    let child = children[i2];
    const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i2);
    if (child.type === Fragment$1) {
      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 i2 = 0; i2 < ret.length; i2++) {
      ret[i2].patchFlag = -2;
    }
  }
  return ret;
}
__name(getTransitionRawChildren, "getTransitionRawChildren");
const isTeleport = /* @__PURE__ */ __name((type) => type.__isTeleport, "isTeleport");
const isTeleportDisabled = /* @__PURE__ */ __name((props) => props && (props.disabled || props.disabled === ""), "isTeleportDisabled");
const isTargetSVG = /* @__PURE__ */ __name((target) => typeof SVGElement !== "undefined" && target instanceof SVGElement, "isTargetSVG");
const isTargetMathML = /* @__PURE__ */ __name((target) => typeof MathMLElement === "function" && target instanceof MathMLElement, "isTargetMathML");
const resolveTarget = /* @__PURE__ */ __name((props, select) => {
  const targetSelector = props && props.to;
  if (isString$7(targetSelector)) {
    if (!select) {
      return null;
    } else {
      const target = select(targetSelector);
      if (false) {
        warn$1$1(
          `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
        );
      }
      return target;
    }
  } else {
    if (false) {
      warn$1$1(`Invalid Teleport target: ${targetSelector}`);
    }
    return targetSelector;
  }
}, "resolveTarget");
const TeleportImpl = {
  name: "Teleport",
  __isTeleport: true,
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
    const {
      mc: mountChildren,
      pc: patchChildren,
      pbc: patchBlockChildren,
      o: { insert: insert2, querySelector, createText, createComment }
    } = internals;
    const disabled2 = isTeleportDisabled(n2.props);
    let { shapeFlag, children, dynamicChildren } = n2;
    if (false) {
      optimized = false;
      dynamicChildren = null;
    }
    if (n1 == null) {
      const placeholder = n2.el = false ? createComment("teleport start") : createText("");
      const mainAnchor = n2.anchor = false ? createComment("teleport end") : createText("");
      insert2(placeholder, container, anchor);
      insert2(mainAnchor, container, anchor);
      const target = n2.target = resolveTarget(n2.props, querySelector);
      const targetAnchor = n2.targetAnchor = createText("");
      if (target) {
        insert2(targetAnchor, target);
        if (namespace === "svg" || isTargetSVG(target)) {
          namespace = "svg";
        } else if (namespace === "mathml" || isTargetMathML(target)) {
          namespace = "mathml";
        }
      } else if (false) {
        warn$1$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
      }
      const mount2 = /* @__PURE__ */ __name((container2, anchor2) => {
        if (shapeFlag & 16) {
          mountChildren(
            children,
            container2,
            anchor2,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        }
      }, "mount");
      if (disabled2) {
        mount2(container, mainAnchor);
      } else if (target) {
        mount2(target, targetAnchor);
      }
    } else {
      n2.el = n1.el;
      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 (namespace === "svg" || isTargetSVG(target)) {
        namespace = "svg";
      } else if (namespace === "mathml" || isTargetMathML(target)) {
        namespace = "mathml";
      }
      if (dynamicChildren) {
        patchBlockChildren(
          n1.dynamicChildren,
          dynamicChildren,
          currentContainer,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds
        );
        traverseStaticChildren(n1, n2, true);
      } else if (!optimized) {
        patchChildren(
          n1,
          n2,
          currentContainer,
          currentAnchor,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          false
        );
      }
      if (disabled2) {
        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 (false) {
            warn$1$1(
              "Invalid Teleport target on update:",
              target,
              `(${typeof target})`
            );
          }
        } else if (wasDisabled) {
          moveTeleport(
            n2,
            target,
            targetAnchor,
            internals,
            1
          );
        }
      }
    }
    updateCssVars(n2);
  },
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
    const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
    if (target) {
      hostRemove(targetAnchor);
    }
    doRemove && hostRemove(anchor);
    if (shapeFlag & 16) {
      const shouldRemove = doRemove || !isTeleportDisabled(props);
      for (let i2 = 0; i2 < children.length; i2++) {
        const child = children[i2];
        unmount(
          child,
          parentComponent,
          parentSuspense,
          shouldRemove,
          !!child.dynamicChildren
        );
      }
    }
  },
  move: moveTeleport,
  hydrate: hydrateTeleport
};
function moveTeleport(vnode, container, parentAnchor, { o: { insert: insert2 }, m: move }, moveType = 2) {
  if (moveType === 0) {
    insert2(vnode.targetAnchor, container, parentAnchor);
  }
  const { el, anchor, shapeFlag, children, props } = vnode;
  const isReorder = moveType === 2;
  if (isReorder) {
    insert2(el, container, parentAnchor);
  }
  if (!isReorder || isTeleportDisabled(props)) {
    if (shapeFlag & 16) {
      for (let i2 = 0; i2 < children.length; i2++) {
        move(
          children[i2],
          container,
          parentAnchor,
          2
        );
      }
    }
  }
  if (isReorder) {
    insert2(anchor, container, parentAnchor);
  }
}
__name(moveTeleport, "moveTeleport");
function hydrateTeleport(node3, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  o: { nextSibling, parentNode: parentNode2, querySelector }
}, hydrateChildren) {
  const target = vnode.target = resolveTarget(
    vnode.props,
    querySelector
  );
  if (target) {
    const targetNode = target._lpa || target.firstChild;
    if (vnode.shapeFlag & 16) {
      if (isTeleportDisabled(vnode.props)) {
        vnode.anchor = hydrateChildren(
          nextSibling(node3),
          vnode,
          parentNode2(node3),
          parentComponent,
          parentSuspense,
          slotScopeIds,
          optimized
        );
        vnode.targetAnchor = targetNode;
      } else {
        vnode.anchor = nextSibling(node3);
        let targetAnchor = targetNode;
        while (targetAnchor) {
          targetAnchor = nextSibling(targetAnchor);
          if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
            vnode.targetAnchor = targetAnchor;
            target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
            break;
          }
        }
        hydrateChildren(
          targetNode,
          vnode,
          target,
          parentComponent,
          parentSuspense,
          slotScopeIds,
          optimized
        );
      }
    }
    updateCssVars(vnode);
  }
  return vnode.anchor && nextSibling(vnode.anchor);
}
__name(hydrateTeleport, "hydrateTeleport");
const Teleport = TeleportImpl;
function updateCssVars(vnode) {
  const ctx = vnode.ctx;
  if (ctx && ctx.ut) {
    let node3 = vnode.children[0].el;
    while (node3 && node3 !== vnode.targetAnchor) {
      if (node3.nodeType === 1) node3.setAttribute("data-v-owner", ctx.uid);
      node3 = node3.nextSibling;
    }
    ctx.ut();
  }
}
__name(updateCssVars, "updateCssVars");
const Fragment$1 = Symbol.for("v-fgt");
const Text$4 = 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 : []);
}
__name(openBlock, "openBlock");
function closeBlock() {
  blockStack.pop();
  currentBlock = blockStack[blockStack.length - 1] || null;
}
__name(closeBlock, "closeBlock");
let isBlockTreeEnabled = 1;
function setBlockTracking(value4) {
  isBlockTreeEnabled += value4;
}
__name(setBlockTracking, "setBlockTracking");
function setupBlock(vnode) {
  vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  closeBlock();
  if (isBlockTreeEnabled > 0 && currentBlock) {
    currentBlock.push(vnode);
  }
  return vnode;
}
__name(setupBlock, "setupBlock");
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  return setupBlock(
    createBaseVNode(
      type,
      props,
      children,
      patchFlag,
      dynamicProps,
      shapeFlag,
      true
    )
  );
}
__name(createElementBlock, "createElementBlock");
function createBlock(type, props, children, patchFlag, dynamicProps) {
  return setupBlock(
    createVNode(
      type,
      props,
      children,
      patchFlag,
      dynamicProps,
      true
    )
  );
}
__name(createBlock, "createBlock");
function isVNode$1(value4) {
  return value4 ? value4.__v_isVNode === true : false;
}
__name(isVNode$1, "isVNode$1");
function isSameVNodeType(n1, n2) {
  if (false) {
    n1.shapeFlag &= ~256;
    n2.shapeFlag &= ~512;
    return false;
  }
  return n1.type === n2.type && n1.key === n2.key;
}
__name(isSameVNodeType, "isSameVNodeType");
let vnodeArgsTransformer;
function transformVNodeArgs(transformer) {
  vnodeArgsTransformer = transformer;
}
__name(transformVNodeArgs, "transformVNodeArgs");
const createVNodeWithArgsTransform = /* @__PURE__ */ __name((...args) => {
  return _createVNode(
    ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  );
}, "createVNodeWithArgsTransform");
const normalizeKey = /* @__PURE__ */ __name(({ key }) => key != null ? key : null, "normalizeKey");
const normalizeRef = /* @__PURE__ */ __name(({
  ref: ref3,
  ref_key,
  ref_for
}) => {
  if (typeof ref3 === "number") {
    ref3 = "" + ref3;
  }
  return ref3 != null ? isString$7(ref3) || isRef(ref3) || isFunction$4(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null;
}, "normalizeRef");
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment$1 ? 0 : 1, isBlockNode2 = 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,
    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$7(children) ? 8 : 16;
  }
  if (false) {
    warn$1$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  }
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  !isBlockNode2 && // 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;
}
__name(createBaseVNode, "createBaseVNode");
const createVNode = false ? createVNodeWithArgsTransform : _createVNode;
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode2 = false) {
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
    if (false) {
      warn$1$1(`Invalid vnode type when creating vnode: ${type}.`);
    }
    type = Comment;
  }
  if (isVNode$1(type)) {
    const cloned = cloneVNode(
      type,
      props,
      true
      /* mergeRef: true */
    );
    if (children) {
      normalizeChildren(cloned, children);
    }
    if (isBlockTreeEnabled > 0 && !isBlockNode2 && 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$7(klass)) {
      props.class = normalizeClass(klass);
    }
    if (isObject$6(style2)) {
      if (isProxy(style2) && !isArray$4(style2)) {
        style2 = extend$1({}, style2);
      }
      props.style = normalizeStyle(style2);
    }
  }
  const shapeFlag = isString$7(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$6(type) ? 4 : isFunction$4(type) ? 2 : 0;
  if (false) {
    type = toRaw(type);
    warn$1$1(
      `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
      `
Component that was made reactive: `,
      type
    );
  }
  return createBaseVNode(
    type,
    props,
    children,
    patchFlag,
    dynamicProps,
    shapeFlag,
    isBlockNode2,
    true
  );
}
__name(_createVNode, "_createVNode");
function guardReactiveProps(props) {
  if (!props) return null;
  return isProxy(props) || isInternalObject(props) ? extend$1({}, props) : props;
}
__name(guardReactiveProps, "guardReactiveProps");
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$4(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps)
    ) : ref3,
    scopeId: vnode.scopeId,
    slotScopeIds: vnode.slotScopeIds,
    children: false ? children.map(deepCloneVNode) : children,
    target: vnode.target,
    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$1 ? 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;
}
__name(cloneVNode, "cloneVNode");
function deepCloneVNode(vnode) {
  const cloned = cloneVNode(vnode);
  if (isArray$4(vnode.children)) {
    cloned.children = vnode.children.map(deepCloneVNode);
  }
  return cloned;
}
__name(deepCloneVNode, "deepCloneVNode");
function createTextVNode(text2 = " ", flag = 0) {
  return createVNode(Text$4, null, text2, flag);
}
__name(createTextVNode, "createTextVNode");
function createStaticVNode(content2, numberOfNodes) {
  const vnode = createVNode(Static, null, content2);
  vnode.staticCount = numberOfNodes;
  return vnode;
}
__name(createStaticVNode, "createStaticVNode");
function createCommentVNode(text2 = "", asBlock = false) {
  return asBlock ? (openBlock(), createBlock(Comment, null, text2)) : createVNode(Comment, null, text2);
}
__name(createCommentVNode, "createCommentVNode");
function normalizeVNode(child) {
  if (child == null || typeof child === "boolean") {
    return createVNode(Comment);
  } else if (isArray$4(child)) {
    return createVNode(
      Fragment$1,
      null,
      // #3666, avoid reference pollution when reusing vnode
      child.slice()
    );
  } else if (typeof child === "object") {
    return cloneIfMounted(child);
  } else {
    return createVNode(Text$4, null, String(child));
  }
}
__name(normalizeVNode, "normalizeVNode");
function cloneIfMounted(child) {
  return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
}
__name(cloneIfMounted, "cloneIfMounted");
function normalizeChildren(vnode, children) {
  let type = 0;
  const { shapeFlag } = vnode;
  if (children == null) {
    children = null;
  } else if (isArray$4(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$4(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;
}
__name(normalizeChildren, "normalizeChildren");
function mergeProps(...args) {
  const ret = {};
  for (let i2 = 0; i2 < args.length; i2++) {
    const toMerge = args[i2];
    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$4(existing) && existing.includes(incoming))) {
          ret[key] = existing ? [].concat(existing, incoming) : incoming;
        }
      } else if (key !== "") {
        ret[key] = toMerge[key];
      }
    }
  }
  return ret;
}
__name(mergeProps, "mergeProps");
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  callWithAsyncErrorHandling(hook, instance, 7, [
    vnode,
    prevVNode
  ]);
}
__name(invokeVNodeHook, "invokeVNodeHook");
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
    scope: new EffectScope(
      true
      /* detached */
    ),
    render: null,
    proxy: null,
    exposed: null,
    exposeProxy: null,
    withProxy: null,
    provides: parent ? parent.provides : Object.create(appContext.provides),
    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,
    attrsProxy: null,
    slotsProxy: 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
  };
  if (false) {
    instance.ctx = createDevRenderContext(instance);
  } else {
    instance.ctx = { _: instance };
  }
  instance.root = parent ? parent.root : instance;
  instance.emit = emit.bind(null, instance);
  if (vnode.ce) {
    vnode.ce(instance);
  }
  return instance;
}
__name(createComponentInstance, "createComponentInstance");
let currentInstance = null;
const getCurrentInstance = /* @__PURE__ */ __name(() => currentInstance || currentRenderingInstance, "getCurrentInstance");
let internalSetCurrentInstance;
let setInSSRSetupState;
{
  const g2 = getGlobalThis$1();
  const registerGlobalSetter = /* @__PURE__ */ __name((key, setter) => {
    let setters;
    if (!(setters = g2[key])) setters = g2[key] = [];
    setters.push(setter);
    return (v2) => {
      if (setters.length > 1) setters.forEach((set3) => set3(v2));
      else setters[0](v2);
    };
  }, "registerGlobalSetter");
  internalSetCurrentInstance = registerGlobalSetter(
    `__VUE_INSTANCE_SETTERS__`,
    (v2) => currentInstance = v2
  );
  setInSSRSetupState = registerGlobalSetter(
    `__VUE_SSR_SETTERS__`,
    (v2) => isInSSRComponentSetup = v2
  );
}
const setCurrentInstance = /* @__PURE__ */ __name((instance) => {
  const prev2 = currentInstance;
  internalSetCurrentInstance(instance);
  instance.scope.on();
  return () => {
    instance.scope.off();
    internalSetCurrentInstance(prev2);
  };
}, "setCurrentInstance");
const unsetCurrentInstance = /* @__PURE__ */ __name(() => {
  currentInstance && currentInstance.scope.off();
  internalSetCurrentInstance(null);
}, "unsetCurrentInstance");
const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
function validateComponentName(name2, { isNativeTag }) {
  if (isBuiltInTag(name2) || isNativeTag(name2)) {
    warn$1$1(
      "Do not use built-in or reserved HTML elements as component id: " + name2
    );
  }
}
__name(validateComponentName, "validateComponentName");
function isStatefulComponent(instance) {
  return instance.vnode.shapeFlag & 4;
}
__name(isStatefulComponent, "isStatefulComponent");
let isInSSRComponentSetup = false;
function setupComponent(instance, isSSR = false) {
  isSSR && setInSSRSetupState(isSSR);
  const { props, children } = instance.vnode;
  const isStateful = isStatefulComponent(instance);
  initProps(instance, props, isStateful, isSSR);
  initSlots(instance, children);
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  isSSR && setInSSRSetupState(false);
  return setupResult;
}
__name(setupComponent, "setupComponent");
function setupStatefulComponent(instance, isSSR) {
  var _a2;
  const Component = instance.type;
  if (false) {
    if (Component.name) {
      validateComponentName(Component.name, instance.appContext.config);
    }
    if (Component.components) {
      const names = Object.keys(Component.components);
      for (let i2 = 0; i2 < names.length; i2++) {
        validateComponentName(names[i2], instance.appContext.config);
      }
    }
    if (Component.directives) {
      const names = Object.keys(Component.directives);
      for (let i2 = 0; i2 < names.length; i2++) {
        validateDirectiveName(names[i2]);
      }
    }
    if (Component.compilerOptions && isRuntimeOnly()) {
      warn$1$1(
        `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
      );
    }
  }
  instance.accessCache = /* @__PURE__ */ Object.create(null);
  instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  if (false) {
    exposePropsOnRenderContext(instance);
  }
  const { setup: setup2 } = Component;
  if (setup2) {
    const setupContext = instance.setupContext = setup2.length > 1 ? createSetupContext(instance) : null;
    const reset2 = setCurrentInstance(instance);
    pauseTracking();
    const setupResult = callWithErrorHandling(
      setup2,
      instance,
      0,
      [
        false ? shallowReadonly(instance.props) : instance.props,
        setupContext
      ]
    );
    resetTracking();
    reset2();
    if (isPromise$1(setupResult)) {
      setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
      if (isSSR) {
        return setupResult.then((resolvedResult) => {
          handleSetupResult(instance, resolvedResult, isSSR);
        }).catch((e2) => {
          handleError(e2, instance, 0);
        });
      } else {
        instance.asyncDep = setupResult;
        if (false) {
          const name2 = (_a2 = Component.name) != null ? _a2 : "Anonymous";
          warn$1$1(
            `Component <${name2}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
          );
        }
      }
    } else {
      handleSetupResult(instance, setupResult, isSSR);
    }
  } else {
    finishComponentSetup(instance, isSSR);
  }
}
__name(setupStatefulComponent, "setupStatefulComponent");
function handleSetupResult(instance, setupResult, isSSR) {
  if (isFunction$4(setupResult)) {
    if (instance.type.__ssrInlineRender) {
      instance.ssrRender = setupResult;
    } else {
      instance.render = setupResult;
    }
  } else if (isObject$6(setupResult)) {
    if (false) {
      warn$1$1(
        `setup() should not return VNodes directly - return a render function instead.`
      );
    }
    if (false) {
      instance.devtoolsRawSetupState = setupResult;
    }
    instance.setupState = proxyRefs(setupResult);
    if (false) {
      exposeSetupStateOnRenderContext(instance);
    }
  } else if (false) {
    warn$1$1(
      `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
    );
  }
  finishComponentSetup(instance, isSSR);
}
__name(handleSetupResult, "handleSetupResult");
let compile$3;
let installWithProxy;
function registerRuntimeCompiler(_compile) {
  compile$3 = _compile;
  installWithProxy = /* @__PURE__ */ __name((i2) => {
    if (i2.render._rc) {
      i2.withProxy = new Proxy(i2.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
    }
  }, "installWithProxy");
}
__name(registerRuntimeCompiler, "registerRuntimeCompiler");
const isRuntimeOnly = /* @__PURE__ */ __name(() => !compile$3, "isRuntimeOnly");
function finishComponentSetup(instance, isSSR, skipOptions) {
  const Component = instance.type;
  if (!instance.render) {
    if (!isSSR && compile$3 && !Component.render) {
      const template = Component.template || resolveMergedOptions(instance).template;
      if (template) {
        if (false) {
          startMeasure(instance, `compile`);
        }
        const { isCustomElement, compilerOptions } = instance.appContext.config;
        const { delimiters, compilerOptions: componentCompilerOptions } = Component;
        const finalCompilerOptions = extend$1(
          extend$1(
            {
              isCustomElement,
              delimiters
            },
            compilerOptions
          ),
          componentCompilerOptions
        );
        Component.render = compile$3(template, finalCompilerOptions);
        if (false) {
          endMeasure(instance, `compile`);
        }
      }
    }
    instance.render = Component.render || NOOP;
    if (installWithProxy) {
      installWithProxy(instance);
    }
  }
  if (true) {
    const reset2 = setCurrentInstance(instance);
    pauseTracking();
    try {
      applyOptions(instance);
    } finally {
      resetTracking();
      reset2();
    }
  }
  if (false) {
    if (!compile$3 && Component.template) {
      warn$1$1(
        `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
      );
    } else {
      warn$1$1(`Component is missing template or render function: `, Component);
    }
  }
}
__name(finishComponentSetup, "finishComponentSetup");
const attrsProxyHandlers = false ? {
  get(target, key) {
    markAttrsAccessed();
    track(target, "get", "");
    return target[key];
  },
  set() {
    warn$1$1(`setupContext.attrs is readonly.`);
    return false;
  },
  deleteProperty() {
    warn$1$1(`setupContext.attrs is readonly.`);
    return false;
  }
} : {
  get(target, key) {
    track(target, "get", "");
    return target[key];
  }
};
function getSlotsProxy(instance) {
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
    get(target, key) {
      track(instance, "get", "$slots");
      return target[key];
    }
  }));
}
__name(getSlotsProxy, "getSlotsProxy");
function createSetupContext(instance) {
  const expose = /* @__PURE__ */ __name((exposed) => {
    if (false) {
      if (instance.exposed) {
        warn$1$1(`expose() should be called only once per setup().`);
      }
      if (exposed != null) {
        let exposedType = typeof exposed;
        if (exposedType === "object") {
          if (isArray$4(exposed)) {
            exposedType = "array";
          } else if (isRef(exposed)) {
            exposedType = "ref";
          }
        }
        if (exposedType !== "object") {
          warn$1$1(
            `expose() should be passed a plain object, received ${exposedType}.`
          );
        }
      }
    }
    instance.exposed = exposed || {};
  }, "expose");
  if (false) {
    let attrsProxy;
    return Object.freeze({
      get attrs() {
        return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
      },
      get slots() {
        return getSlotsProxy(instance);
      },
      get emit() {
        return (event, ...args) => instance.emit(event, ...args);
      },
      expose
    });
  } else {
    return {
      attrs: new Proxy(instance.attrs, attrsProxyHandlers),
      slots: instance.slots,
      emit: instance.emit,
      expose
    };
  }
}
__name(createSetupContext, "createSetupContext");
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;
  }
}
__name(getComponentPublicInstance, "getComponentPublicInstance");
const classifyRE = /(?:^|[-_])(\w)/g;
const classify = /* @__PURE__ */ __name((str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""), "classify");
function getComponentName(Component, includeInferred = true) {
  return isFunction$4(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
}
__name(getComponentName, "getComponentName");
function formatComponentName(instance, Component, isRoot = false) {
  let name2 = getComponentName(Component);
  if (!name2 && Component.__file) {
    const match2 = Component.__file.match(/([^/\\]+)\.\w+$/);
    if (match2) {
      name2 = match2[1];
    }
  }
  if (!name2 && instance && instance.parent) {
    const inferFromRegistry = /* @__PURE__ */ __name((registry) => {
      for (const key in registry) {
        if (registry[key] === Component) {
          return key;
        }
      }
    }, "inferFromRegistry");
    name2 = inferFromRegistry(
      instance.components || instance.parent.type.components
    ) || inferFromRegistry(instance.appContext.components);
  }
  return name2 ? classify(name2) : isRoot ? `App` : `Anonymous`;
}
__name(formatComponentName, "formatComponentName");
function isClassComponent(value4) {
  return isFunction$4(value4) && "__vccOpts" in value4;
}
__name(isClassComponent, "isClassComponent");
const computed = /* @__PURE__ */ __name((getterOrOptions, debugOptions) => {
  const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  if (false) {
    const i2 = getCurrentInstance();
    if (i2 && i2.appContext.config.warnRecursiveComputed) {
      c._warnRecursive = true;
    }
  }
  return c;
}, "computed");
function useModel(props, name2, options4 = EMPTY_OBJ) {
  const i2 = getCurrentInstance();
  if (false) {
    warn$1$1(`useModel() called without active instance.`);
    return ref();
  }
  if (false) {
    warn$1$1(`useModel() called with prop "${name2}" which is not declared.`);
    return ref();
  }
  const camelizedName = camelize$1(name2);
  const hyphenatedName = hyphenate$1(name2);
  const res = customRef((track2, trigger2) => {
    let localValue;
    watchSyncEffect(() => {
      const propValue = props[name2];
      if (hasChanged(localValue, propValue)) {
        localValue = propValue;
        trigger2();
      }
    });
    return {
      get() {
        track2();
        return options4.get ? options4.get(localValue) : localValue;
      },
      set(value4) {
        const rawProps = i2.vnode.props;
        if (!(rawProps && // check if parent has passed v-model
        (name2 in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name2}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value4, localValue)) {
          localValue = value4;
          trigger2();
        }
        i2.emit(`update:${name2}`, options4.set ? options4.set(value4) : value4);
      }
    };
  });
  const modifierKey = name2 === "modelValue" ? "modelModifiers" : `${name2}Modifiers`;
  res[Symbol.iterator] = () => {
    let i22 = 0;
    return {
      next() {
        if (i22 < 2) {
          return { value: i22++ ? props[modifierKey] || {} : res, done: false };
        } else {
          return { done: true };
        }
      }
    };
  };
  return res;
}
__name(useModel, "useModel");
function h(type, propsOrChildren, children) {
  const l = arguments.length;
  if (l === 2) {
    if (isObject$6(propsOrChildren) && !isArray$4(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);
  }
}
__name(h, "h");
function initCustomFormatter() {
  if (true) {
    return;
  }
  const vueStyle = { style: "color:#3ba776" };
  const numberStyle = { style: "color:#1677ff" };
  const stringStyle = { style: "color:#f5222d" };
  const keywordStyle = { style: "color:#eb2f96" };
  const formatter = {
    header(obj) {
      if (!isObject$6(obj)) {
        return null;
      }
      if (obj.__isVue) {
        return ["div", vueStyle, `VueInstance`];
      } else if (isRef(obj)) {
        return [
          "div",
          {},
          ["span", vueStyle, genRefFlag(obj)],
          "<",
          formatValue2(obj.value),
          `>`
        ];
      } else if (isReactive(obj)) {
        return [
          "div",
          {},
          ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
          "<",
          formatValue2(obj),
          `>${isReadonly(obj) ? ` (readonly)` : ``}`
        ];
      } else if (isReadonly(obj)) {
        return [
          "div",
          {},
          ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
          "<",
          formatValue2(obj),
          ">"
        ];
      }
      return null;
    },
    hasBody(obj) {
      return obj && obj.__isVue;
    },
    body(obj) {
      if (obj && obj.__isVue) {
        return [
          "div",
          {},
          ...formatInstance(obj.$)
        ];
      }
    }
  };
  function formatInstance(instance) {
    const blocks = [];
    if (instance.type.props && instance.props) {
      blocks.push(createInstanceBlock("props", toRaw(instance.props)));
    }
    if (instance.setupState !== EMPTY_OBJ) {
      blocks.push(createInstanceBlock("setup", instance.setupState));
    }
    if (instance.data !== EMPTY_OBJ) {
      blocks.push(createInstanceBlock("data", toRaw(instance.data)));
    }
    const computed2 = extractKeys(instance, "computed");
    if (computed2) {
      blocks.push(createInstanceBlock("computed", computed2));
    }
    const injected = extractKeys(instance, "inject");
    if (injected) {
      blocks.push(createInstanceBlock("injected", injected));
    }
    blocks.push([
      "div",
      {},
      [
        "span",
        {
          style: keywordStyle.style + ";opacity:0.66"
        },
        "$ (internal): "
      ],
      ["object", { object: instance }]
    ]);
    return blocks;
  }
  __name(formatInstance, "formatInstance");
  function createInstanceBlock(type, target) {
    target = extend$1({}, target);
    if (!Object.keys(target).length) {
      return ["span", {}];
    }
    return [
      "div",
      { style: "line-height:1.25em;margin-bottom:0.6em" },
      [
        "div",
        {
          style: "color:#476582"
        },
        type
      ],
      [
        "div",
        {
          style: "padding-left:1.25em"
        },
        ...Object.keys(target).map((key) => {
          return [
            "div",
            {},
            ["span", keywordStyle, key + ": "],
            formatValue2(target[key], false)
          ];
        })
      ]
    ];
  }
  __name(createInstanceBlock, "createInstanceBlock");
  function formatValue2(v2, asRaw = true) {
    if (typeof v2 === "number") {
      return ["span", numberStyle, v2];
    } else if (typeof v2 === "string") {
      return ["span", stringStyle, JSON.stringify(v2)];
    } else if (typeof v2 === "boolean") {
      return ["span", keywordStyle, v2];
    } else if (isObject$6(v2)) {
      return ["object", { object: asRaw ? toRaw(v2) : v2 }];
    } else {
      return ["span", stringStyle, String(v2)];
    }
  }
  __name(formatValue2, "formatValue");
  function extractKeys(instance, type) {
    const Comp = instance.type;
    if (isFunction$4(Comp)) {
      return;
    }
    const extracted = {};
    for (const key in instance.ctx) {
      if (isKeyOfType(Comp, key, type)) {
        extracted[key] = instance.ctx[key];
      }
    }
    return extracted;
  }
  __name(extractKeys, "extractKeys");
  function isKeyOfType(Comp, key, type) {
    const opts = Comp[type];
    if (isArray$4(opts) && opts.includes(key) || isObject$6(opts) && key in opts) {
      return true;
    }
    if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
      return true;
    }
    if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
      return true;
    }
  }
  __name(isKeyOfType, "isKeyOfType");
  function genRefFlag(v2) {
    if (isShallow(v2)) {
      return `ShallowRef`;
    }
    if (v2.effect) {
      return `ComputedRef`;
    }
    return `Ref`;
  }
  __name(genRefFlag, "genRefFlag");
  if (window.devtoolsFormatters) {
    window.devtoolsFormatters.push(formatter);
  } else {
    window.devtoolsFormatters = [formatter];
  }
}
__name(initCustomFormatter, "initCustomFormatter");
function withMemo(memo, render2, cache2, index2) {
  const cached = cache2[index2];
  if (cached && isMemoSame(cached, memo)) {
    return cached;
  }
  const ret = render2();
  ret.memo = memo.slice();
  ret.memoIndex = index2;
  return cache2[index2] = ret;
}
__name(withMemo, "withMemo");
function isMemoSame(cached, memo) {
  const prev2 = cached.memo;
  if (prev2.length != memo.length) {
    return false;
  }
  for (let i2 = 0; i2 < prev2.length; i2++) {
    if (hasChanged(prev2[i2], memo[i2])) {
      return false;
    }
  }
  if (isBlockTreeEnabled > 0 && currentBlock) {
    currentBlock.push(cached);
  }
  return true;
}
__name(isMemoSame, "isMemoSame");
const version = "3.4.31";
const warn$3 = false ? warn$1$1 : NOOP;
const ErrorTypeStrings = ErrorTypeStrings$1;
const devtools$2 = true ? devtools$1 : void 0;
const setDevtoolsHook = true ? setDevtoolsHook$1 : NOOP;
const _ssrUtils = {
  createComponentInstance,
  setupComponent,
  renderComponentRoot,
  setCurrentRenderingInstance,
  isVNode: isVNode$1,
  normalizeVNode,
  getComponentPublicInstance
};
const ssrUtils = _ssrUtils;
const resolveFilter = null;
const compatUtils = null;
const DeprecationTypes = null;
/**
* @vue/runtime-dom v3.4.31
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
const svgNS = "http://www.w3.org/2000/svg";
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
const doc$2 = typeof document !== "undefined" ? document : null;
const templateContainer = doc$2 && /* @__PURE__ */ doc$2.createElement("template");
const nodeOps = {
  insert: /* @__PURE__ */ __name((child, parent, anchor) => {
    parent.insertBefore(child, anchor || null);
  }, "insert"),
  remove: /* @__PURE__ */ __name((child) => {
    const parent = child.parentNode;
    if (parent) {
      parent.removeChild(child);
    }
  }, "remove"),
  createElement: /* @__PURE__ */ __name((tag, namespace, is, props) => {
    const el = namespace === "svg" ? doc$2.createElementNS(svgNS, tag) : namespace === "mathml" ? doc$2.createElementNS(mathmlNS, tag) : is ? doc$2.createElement(tag, { is }) : doc$2.createElement(tag);
    if (tag === "select" && props && props.multiple != null) {
      el.setAttribute("multiple", props.multiple);
    }
    return el;
  }, "createElement"),
  createText: /* @__PURE__ */ __name((text2) => doc$2.createTextNode(text2), "createText"),
  createComment: /* @__PURE__ */ __name((text2) => doc$2.createComment(text2), "createComment"),
  setText: /* @__PURE__ */ __name((node3, text2) => {
    node3.nodeValue = text2;
  }, "setText"),
  setElementText: /* @__PURE__ */ __name((el, text2) => {
    el.textContent = text2;
  }, "setElementText"),
  parentNode: /* @__PURE__ */ __name((node3) => node3.parentNode, "parentNode"),
  nextSibling: /* @__PURE__ */ __name((node3) => node3.nextSibling, "nextSibling"),
  querySelector: /* @__PURE__ */ __name((selector) => doc$2.querySelector(selector), "querySelector"),
  setScopeId(el, id3) {
    el.setAttribute(id3, "");
  },
  // __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(content2, parent, anchor, namespace, start2, end) {
    const before = anchor ? anchor.previousSibling : parent.lastChild;
    if (start2 && (start2 === end || start2.nextSibling)) {
      while (true) {
        parent.insertBefore(start2.cloneNode(true), anchor);
        if (start2 === end || !(start2 = start2.nextSibling)) break;
      }
    } else {
      templateContainer.innerHTML = namespace === "svg" ? `<svg>${content2}</svg>` : namespace === "mathml" ? `<math>${content2}</math>` : content2;
      const template = templateContainer.content;
      if (namespace === "svg" || namespace === "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 Transition = /* @__PURE__ */ __name((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots), "Transition");
Transition.displayName = "Transition";
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 = Transition.props = /* @__PURE__ */ extend$1(
  {},
  BaseTransitionPropsValidators,
  DOMTransitionPropsValidators
);
const callHook = /* @__PURE__ */ __name((hook, args = []) => {
  if (isArray$4(hook)) {
    hook.forEach((h2) => h2(...args));
  } else if (hook) {
    hook(...args);
  }
}, "callHook");
const hasExplicitCallback = /* @__PURE__ */ __name((hook) => {
  return hook ? isArray$4(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
}, "hasExplicitCallback");
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: name2 = "v",
    type,
    duration,
    enterFromClass = `${name2}-enter-from`,
    enterActiveClass = `${name2}-enter-active`,
    enterToClass = `${name2}-enter-to`,
    appearFromClass = enterFromClass,
    appearActiveClass = enterActiveClass,
    appearToClass = enterToClass,
    leaveFromClass = `${name2}-leave-from`,
    leaveActiveClass = `${name2}-leave-active`,
    leaveToClass = `${name2}-leave-to`
  } = rawProps;
  const durations = normalizeDuration(duration);
  const enterDuration = durations && durations[0];
  const leaveDuration = durations && durations[1];
  const {
    onBeforeEnter: onBeforeEnter3,
    onEnter: onEnter7,
    onEnterCancelled,
    onLeave: onLeave5,
    onLeaveCancelled,
    onBeforeAppear = onBeforeEnter3,
    onAppear = onEnter7,
    onAppearCancelled = onEnterCancelled
  } = baseProps;
  const finishEnter = /* @__PURE__ */ __name((el, isAppear, done) => {
    removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
    removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
    done && done();
  }, "finishEnter");
  const finishLeave = /* @__PURE__ */ __name((el, done) => {
    el._isLeaving = false;
    removeTransitionClass(el, leaveFromClass);
    removeTransitionClass(el, leaveToClass);
    removeTransitionClass(el, leaveActiveClass);
    done && done();
  }, "finishLeave");
  const makeEnterHook = /* @__PURE__ */ __name((isAppear) => {
    return (el, done) => {
      const hook = isAppear ? onAppear : onEnter7;
      const resolve2 = /* @__PURE__ */ __name(() => finishEnter(el, isAppear, done), "resolve");
      callHook(hook, [el, resolve2]);
      nextFrame(() => {
        removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
        addTransitionClass(el, isAppear ? appearToClass : enterToClass);
        if (!hasExplicitCallback(hook)) {
          whenTransitionEnds(el, type, enterDuration, resolve2);
        }
      });
    };
  }, "makeEnterHook");
  return extend$1(baseProps, {
    onBeforeEnter(el) {
      callHook(onBeforeEnter3, [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 = /* @__PURE__ */ __name(() => finishLeave(el, done), "resolve");
      addTransitionClass(el, leaveFromClass);
      addTransitionClass(el, leaveActiveClass);
      forceReflow();
      nextFrame(() => {
        if (!el._isLeaving) {
          return;
        }
        removeTransitionClass(el, leaveFromClass);
        addTransitionClass(el, leaveToClass);
        if (!hasExplicitCallback(onLeave5)) {
          whenTransitionEnds(el, type, leaveDuration, resolve2);
        }
      });
      callHook(onLeave5, [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]);
    }
  });
}
__name(resolveTransitionProps, "resolveTransitionProps");
function normalizeDuration(duration) {
  if (duration == null) {
    return null;
  } else if (isObject$6(duration)) {
    return [NumberOf(duration.enter), NumberOf(duration.leave)];
  } else {
    const n = NumberOf(duration);
    return [n, n];
  }
}
__name(normalizeDuration, "normalizeDuration");
function NumberOf(val) {
  const res = toNumber(val);
  if (false) {
    assertNumber(res, "<transition> explicit duration");
  }
  return res;
}
__name(NumberOf, "NumberOf");
function addTransitionClass(el, cls) {
  cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
}
__name(addTransitionClass, "addTransitionClass");
function removeTransitionClass(el, cls) {
  cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  const _vtc = el[vtcKey];
  if (_vtc) {
    _vtc.delete(cls);
    if (!_vtc.size) {
      el[vtcKey] = void 0;
    }
  }
}
__name(removeTransitionClass, "removeTransitionClass");
function nextFrame(cb) {
  requestAnimationFrame(() => {
    requestAnimationFrame(cb);
  });
}
__name(nextFrame, "nextFrame");
let endId = 0;
function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) {
  const id3 = el._endId = ++endId;
  const resolveIfNotStale = /* @__PURE__ */ __name(() => {
    if (id3 === el._endId) {
      resolve2();
    }
  }, "resolveIfNotStale");
  if (explicitTimeout) {
    return setTimeout(resolveIfNotStale, explicitTimeout);
  }
  const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  if (!type) {
    return resolve2();
  }
  const endEvent = type + "end";
  let ended = 0;
  const end = /* @__PURE__ */ __name(() => {
    el.removeEventListener(endEvent, onEnd);
    resolveIfNotStale();
  }, "end");
  const onEnd = /* @__PURE__ */ __name((e2) => {
    if (e2.target === el && ++ended >= propCount) {
      end();
    }
  }, "onEnd");
  setTimeout(() => {
    if (ended < propCount) {
      end();
    }
  }, timeout + 1);
  el.addEventListener(endEvent, onEnd);
}
__name(whenTransitionEnds, "whenTransitionEnds");
function getTransitionInfo(el, expectedType) {
  const styles = window.getComputedStyle(el);
  const getStyleProperties = /* @__PURE__ */ __name((key) => (styles[key] || "").split(", "), "getStyleProperties");
  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
  };
}
__name(getTransitionInfo, "getTransitionInfo");
function getTimeout(delays, durations) {
  while (delays.length < durations.length) {
    delays = delays.concat(delays);
  }
  return Math.max(...durations.map((d, i2) => toMs(d) + toMs(delays[i2])));
}
__name(getTimeout, "getTimeout");
function toMs(s) {
  if (s === "auto") return 0;
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
}
__name(toMs, "toMs");
function forceReflow() {
  return document.body.offsetHeight;
}
__name(forceReflow, "forceReflow");
function patchClass(el, value4, isSVG) {
  const transitionClasses = el[vtcKey];
  if (transitionClasses) {
    value4 = (value4 ? [value4, ...transitionClasses] : [...transitionClasses]).join(" ");
  }
  if (value4 == null) {
    el.removeAttribute("class");
  } else if (isSVG) {
    el.setAttribute("class", value4);
  } else {
    el.className = value4;
  }
}
__name(patchClass, "patchClass");
const vShowOriginalDisplay = Symbol("_vod");
const vShowHidden = Symbol("_vsh");
const vShow = {
  beforeMount(el, { value: value4 }, { transition }) {
    el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
    if (transition && value4) {
      transition.beforeEnter(el);
    } else {
      setDisplay(el, value4);
    }
  },
  mounted(el, { value: value4 }, { transition }) {
    if (transition && value4) {
      transition.enter(el);
    }
  },
  updated(el, { value: value4, oldValue: oldValue2 }, { transition }) {
    if (!value4 === !oldValue2) return;
    if (transition) {
      if (value4) {
        transition.beforeEnter(el);
        setDisplay(el, true);
        transition.enter(el);
      } else {
        transition.leave(el, () => {
          setDisplay(el, false);
        });
      }
    } else {
      setDisplay(el, value4);
    }
  },
  beforeUnmount(el, { value: value4 }) {
    setDisplay(el, value4);
  }
};
if (false) {
  vShow.name = "show";
}
function setDisplay(el, value4) {
  el.style.display = value4 ? el[vShowOriginalDisplay] : "none";
  el[vShowHidden] = !value4;
}
__name(setDisplay, "setDisplay");
function initVShowForSSR() {
  vShow.getSSRProps = ({ value: value4 }) => {
    if (!value4) {
      return { style: { display: "none" } };
    }
  };
}
__name(initVShowForSSR, "initVShowForSSR");
const CSS_VAR_TEXT = Symbol(false ? "CSS_VAR_TEXT" : "");
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((node3) => setVarsOnNode(node3, vars));
  };
  if (false) {
    instance.getCssVars = () => getter(instance.proxy);
  }
  const setVars = /* @__PURE__ */ __name(() => {
    const vars = getter(instance.proxy);
    setVarsOnVNode(instance.subTree, vars);
    updateTeleports(vars);
  }, "setVars");
  onMounted(() => {
    watchPostEffect(setVars);
    const ob = new MutationObserver(setVars);
    ob.observe(instance.subTree.el.parentNode, { childList: true });
    onUnmounted(() => ob.disconnect());
  });
}
__name(useCssVars, "useCssVars");
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$1) {
    vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  } else if (vnode.type === Static) {
    let { el, anchor } = vnode;
    while (el) {
      setVarsOnNode(el, vars);
      if (el === anchor) break;
      el = el.nextSibling;
    }
  }
}
__name(setVarsOnVNode, "setVarsOnVNode");
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;
  }
}
__name(setVarsOnNode, "setVarsOnNode");
const displayRE = /(^|;)\s*display\s*:/;
function patchStyle(el, prev2, next2) {
  const style2 = el.style;
  const isCssString = isString$7(next2);
  let hasControlledDisplay = false;
  if (next2 && !isCssString) {
    if (prev2) {
      if (!isString$7(prev2)) {
        for (const key in prev2) {
          if (next2[key] == null) {
            setStyle(style2, key, "");
          }
        }
      } else {
        for (const prevStyle of prev2.split(";")) {
          const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
          if (next2[key] == null) {
            setStyle(style2, key, "");
          }
        }
      }
    }
    for (const key in next2) {
      if (key === "display") {
        hasControlledDisplay = true;
      }
      setStyle(style2, key, next2[key]);
    }
  } else {
    if (isCssString) {
      if (prev2 !== next2) {
        const cssVarText = style2[CSS_VAR_TEXT];
        if (cssVarText) {
          next2 += ";" + cssVarText;
        }
        style2.cssText = next2;
        hasControlledDisplay = displayRE.test(next2);
      }
    } else if (prev2) {
      el.removeAttribute("style");
    }
  }
  if (vShowOriginalDisplay in el) {
    el[vShowOriginalDisplay] = hasControlledDisplay ? style2.display : "";
    if (el[vShowHidden]) {
      style2.display = "none";
    }
  }
}
__name(patchStyle, "patchStyle");
const semicolonRE = /[^\\];\s*$/;
const importantRE = /\s*!important$/;
function setStyle(style2, name2, val) {
  if (isArray$4(val)) {
    val.forEach((v2) => setStyle(style2, name2, v2));
  } else {
    if (val == null) val = "";
    if (false) {
      if (semicolonRE.test(val)) {
        warn$3(
          `Unexpected semicolon at the end of '${name2}' style value: '${val}'`
        );
      }
    }
    if (name2.startsWith("--")) {
      style2.setProperty(name2, val);
    } else {
      const prefixed = autoPrefix(style2, name2);
      if (importantRE.test(val)) {
        style2.setProperty(
          hyphenate$1(prefixed),
          val.replace(importantRE, ""),
          "important"
        );
      } else {
        style2[prefixed] = val;
      }
    }
  }
}
__name(setStyle, "setStyle");
const prefixes = ["Webkit", "Moz", "ms"];
const prefixCache = {};
function autoPrefix(style2, rawName) {
  const cached = prefixCache[rawName];
  if (cached) {
    return cached;
  }
  let name2 = camelize$1(rawName);
  if (name2 !== "filter" && name2 in style2) {
    return prefixCache[rawName] = name2;
  }
  name2 = capitalize$1(name2);
  for (let i2 = 0; i2 < prefixes.length; i2++) {
    const prefixed = prefixes[i2] + name2;
    if (prefixed in style2) {
      return prefixCache[rawName] = prefixed;
    }
  }
  return rawName;
}
__name(autoPrefix, "autoPrefix");
const xlinkNS = "http://www.w3.org/1999/xlink";
function patchAttr(el, key, value4, isSVG, instance, isBoolean2 = isSpecialBooleanAttr(key)) {
  if (isSVG && key.startsWith("xlink:")) {
    if (value4 == null) {
      el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
    } else {
      el.setAttributeNS(xlinkNS, key, value4);
    }
  } else {
    if (value4 == null || isBoolean2 && !includeBooleanAttr(value4)) {
      el.removeAttribute(key);
    } else {
      el.setAttribute(
        key,
        isBoolean2 ? "" : isSymbol$1(value4) ? String(value4) : value4
      );
    }
  }
}
__name(patchAttr, "patchAttr");
function patchDOMProp(el, key, value4, prevChildren, parentComponent, parentSuspense, unmountChildren) {
  if (key === "innerHTML" || key === "textContent") {
    if (prevChildren) {
      unmountChildren(prevChildren, parentComponent, parentSuspense);
    }
    el[key] = value4 == null ? "" : value4;
    return;
  }
  const tag = el.tagName;
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  !tag.includes("-")) {
    const oldValue2 = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
    const newValue2 = value4 == null ? "" : String(value4);
    if (oldValue2 !== newValue2 || !("_value" in el)) {
      el.value = newValue2;
    }
    if (value4 == null) {
      el.removeAttribute(key);
    }
    el._value = value4;
    return;
  }
  let needRemove = false;
  if (value4 === "" || value4 == null) {
    const type = typeof el[key];
    if (type === "boolean") {
      value4 = includeBooleanAttr(value4);
    } else if (value4 == null && type === "string") {
      value4 = "";
      needRemove = true;
    } else if (type === "number") {
      value4 = 0;
      needRemove = true;
    }
  }
  try {
    el[key] = value4;
  } catch (e2) {
    if (false) {
      warn$3(
        `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value4} is invalid.`,
        e2
      );
    }
  }
  needRemove && el.removeAttribute(key);
}
__name(patchDOMProp, "patchDOMProp");
function addEventListener(el, event, handler6, options4) {
  el.addEventListener(event, handler6, options4);
}
__name(addEventListener, "addEventListener");
function removeEventListener(el, event, handler6, options4) {
  el.removeEventListener(event, handler6, options4);
}
__name(removeEventListener, "removeEventListener");
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 = false ? sanitizeEventValue(nextValue, rawName) : nextValue;
  } else {
    const [name2, options4] = parseName(rawName);
    if (nextValue) {
      const invoker = invokers[rawName] = createInvoker(
        false ? sanitizeEventValue(nextValue, rawName) : nextValue,
        instance
      );
      addEventListener(el, name2, invoker, options4);
    } else if (existingInvoker) {
      removeEventListener(el, name2, existingInvoker, options4);
      invokers[rawName] = void 0;
    }
  }
}
__name(patchEvent, "patchEvent");
const optionsModifierRE = /(?:Once|Passive|Capture)$/;
function parseName(name2) {
  let options4;
  if (optionsModifierRE.test(name2)) {
    options4 = {};
    let m;
    while (m = name2.match(optionsModifierRE)) {
      name2 = name2.slice(0, name2.length - m[0].length);
      options4[m[0].toLowerCase()] = true;
    }
  }
  const event = name2[2] === ":" ? name2.slice(3) : hyphenate$1(name2.slice(2));
  return [event, options4];
}
__name(parseName, "parseName");
let cachedNow = 0;
const p = /* @__PURE__ */ Promise.resolve();
const getNow = /* @__PURE__ */ __name(() => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()), "getNow");
function createInvoker(initialValue, instance) {
  const invoker = /* @__PURE__ */ __name((e2) => {
    if (!e2._vts) {
      e2._vts = Date.now();
    } else if (e2._vts <= invoker.attached) {
      return;
    }
    callWithAsyncErrorHandling(
      patchStopImmediatePropagation(e2, invoker.value),
      instance,
      5,
      [e2]
    );
  }, "invoker");
  invoker.value = initialValue;
  invoker.attached = getNow();
  return invoker;
}
__name(createInvoker, "createInvoker");
function sanitizeEventValue(value4, propName) {
  if (isFunction$4(value4) || isArray$4(value4)) {
    return value4;
  }
  warn$3(
    `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
Expected function or array of functions, received type ${typeof value4}.`
  );
  return NOOP;
}
__name(sanitizeEventValue, "sanitizeEventValue");
function patchStopImmediatePropagation(e2, value4) {
  if (isArray$4(value4)) {
    const originalStop = e2.stopImmediatePropagation;
    e2.stopImmediatePropagation = () => {
      originalStop.call(e2);
      e2._stopped = true;
    };
    return value4.map(
      (fn) => (e22) => !e22._stopped && fn && fn(e22)
    );
  } else {
    return value4;
  }
}
__name(patchStopImmediatePropagation, "patchStopImmediatePropagation");
const isNativeOn = /* @__PURE__ */ __name((key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123, "isNativeOn");
const patchProp = /* @__PURE__ */ __name((el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
  const isSVG = namespace === "svg";
  if (key === "class") {
    patchClass(el, nextValue, isSVG);
  } 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, isSVG)) {
    patchDOMProp(
      el,
      key,
      nextValue,
      prevChildren,
      parentComponent,
      parentSuspense,
      unmountChildren
    );
    if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
      patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
    }
  } else {
    if (key === "true-value") {
      el._trueValue = nextValue;
    } else if (key === "false-value") {
      el._falseValue = nextValue;
    }
    patchAttr(el, key, nextValue, isSVG);
  }
}, "patchProp");
function shouldSetAsProp(el, key, value4, isSVG) {
  if (isSVG) {
    if (key === "innerHTML" || key === "textContent") {
      return true;
    }
    if (key in el && isNativeOn(key) && isFunction$4(value4)) {
      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$7(value4)) {
    return false;
  }
  return key in el;
}
__name(shouldSetAsProp, "shouldSetAsProp");
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function defineCustomElement(options4, extraOptions, hydrate2) {
  const Comp = /* @__PURE__ */ defineComponent(options4, extraOptions);
  class VueCustomElement extends VueElement {
    static {
      __name(this, "VueCustomElement");
    }
    constructor(initialProps) {
      super(Comp, initialProps, hydrate2);
    }
  }
  VueCustomElement.def = Comp;
  return VueCustomElement;
}
__name(defineCustomElement, "defineCustomElement");
/*! #__NO_SIDE_EFFECTS__ */
const defineSSRCustomElement = /* @__PURE__ */ __name(/* @__NO_SIDE_EFFECTS__ */ (options4, extraOptions) => {
  return /* @__PURE__ */ defineCustomElement(options4, extraOptions, hydrate);
}, "defineSSRCustomElement");
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
};
class VueElement extends BaseClass {
  static {
    __name(this, "VueElement");
  }
  constructor(_def, _props = {}, hydrate2) {
    super();
    this._def = _def;
    this._props = _props;
    this._instance = null;
    this._connected = false;
    this._resolved = false;
    this._numberProps = null;
    this._ob = null;
    if (this.shadowRoot && hydrate2) {
      hydrate2(this._createVNode(), this.shadowRoot);
    } else {
      if (false) {
        warn$3(
          `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
        );
      }
      this.attachShadow({ mode: "open" });
      if (!this._def.__asyncLoader) {
        this._resolveProps(this._def);
      }
    }
  }
  connectedCallback() {
    this._connected = true;
    if (!this._instance) {
      if (this._resolved) {
        this._update();
      } else {
        this._resolveDef();
      }
    }
  }
  disconnectedCallback() {
    this._connected = false;
    nextTick(() => {
      if (!this._connected) {
        if (this._ob) {
          this._ob.disconnect();
          this._ob = null;
        }
        render$Y(null, this.shadowRoot);
        this._instance = null;
      }
    });
  }
  /**
   * resolve inner component definition (handle possible async component)
   */
  _resolveDef() {
    this._resolved = true;
    for (let i2 = 0; i2 < this.attributes.length; i2++) {
      this._setAttr(this.attributes[i2].name);
    }
    this._ob = new MutationObserver((mutations) => {
      for (const m of mutations) {
        this._setAttr(m.attributeName);
      }
    });
    this._ob.observe(this, { attributes: true });
    const resolve2 = /* @__PURE__ */ __name((def2, isAsync2 = false) => {
      const { props, styles } = def2;
      let numberProps;
      if (props && !isArray$4(props)) {
        for (const key in props) {
          const opt = props[key];
          if (opt === Number || opt && opt.type === Number) {
            if (key in this._props) {
              this._props[key] = toNumber(this._props[key]);
            }
            (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize$1(key)] = true;
          }
        }
      }
      this._numberProps = numberProps;
      if (isAsync2) {
        this._resolveProps(def2);
      }
      this._applyStyles(styles);
      this._update();
    }, "resolve");
    const asyncDef = this._def.__asyncLoader;
    if (asyncDef) {
      asyncDef().then((def2) => resolve2(def2, true));
    } else {
      resolve2(this._def);
    }
  }
  _resolveProps(def2) {
    const { props } = def2;
    const declaredPropKeys = isArray$4(props) ? props : Object.keys(props || {});
    for (const key of Object.keys(this)) {
      if (key[0] !== "_" && declaredPropKeys.includes(key)) {
        this._setProp(key, this[key], true, false);
      }
    }
    for (const key of declaredPropKeys.map(camelize$1)) {
      Object.defineProperty(this, key, {
        get() {
          return this._getProp(key);
        },
        set(val) {
          this._setProp(key, val);
        }
      });
    }
  }
  _setAttr(key) {
    let value4 = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
    const camelKey = camelize$1(key);
    if (this._numberProps && this._numberProps[camelKey]) {
      value4 = toNumber(value4);
    }
    this._setProp(camelKey, value4, false);
  }
  /**
   * @internal
   */
  _getProp(key) {
    return this._props[key];
  }
  /**
   * @internal
   */
  _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
    if (val !== this._props[key]) {
      this._props[key] = val;
      if (shouldUpdate && this._instance) {
        this._update();
      }
      if (shouldReflect) {
        if (val === true) {
          this.setAttribute(hyphenate$1(key), "");
        } else if (typeof val === "string" || typeof val === "number") {
          this.setAttribute(hyphenate$1(key), val + "");
        } else if (!val) {
          this.removeAttribute(hyphenate$1(key));
        }
      }
    }
  }
  _update() {
    render$Y(this._createVNode(), this.shadowRoot);
  }
  _createVNode() {
    const vnode = createVNode(this._def, extend$1({}, this._props));
    if (!this._instance) {
      vnode.ce = (instance) => {
        this._instance = instance;
        instance.isCE = true;
        if (false) {
          instance.ceReload = (newStyles) => {
            if (this._styles) {
              this._styles.forEach((s) => this.shadowRoot.removeChild(s));
              this._styles.length = 0;
            }
            this._applyStyles(newStyles);
            this._instance = null;
            this._update();
          };
        }
        const dispatch = /* @__PURE__ */ __name((event, args) => {
          this.dispatchEvent(
            new CustomEvent(event, {
              detail: args
            })
          );
        }, "dispatch");
        instance.emit = (event, ...args) => {
          dispatch(event, args);
          if (hyphenate$1(event) !== event) {
            dispatch(hyphenate$1(event), args);
          }
        };
        let parent = this;
        while (parent = parent && (parent.parentNode || parent.host)) {
          if (parent instanceof VueElement) {
            instance.parent = parent._instance;
            instance.provides = parent._instance.provides;
            break;
          }
        }
      };
    }
    return vnode;
  }
  _applyStyles(styles) {
    if (styles) {
      styles.forEach((css3) => {
        const s = document.createElement("style");
        s.textContent = css3;
        this.shadowRoot.appendChild(s);
        if (false) {
          (this._styles || (this._styles = [])).push(s);
        }
      });
    }
  }
}
function useCssModule(name2 = "$style") {
  {
    const instance = getCurrentInstance();
    if (!instance) {
      return EMPTY_OBJ;
    }
    const modules = instance.type.__cssModules;
    if (!modules) {
      return EMPTY_OBJ;
    }
    const mod = modules[name2];
    if (!mod) {
      return EMPTY_OBJ;
    }
    return mod;
  }
}
__name(useCssModule, "useCssModule");
const positionMap = /* @__PURE__ */ new WeakMap();
const newPositionMap = /* @__PURE__ */ new WeakMap();
const moveCbKey = Symbol("_moveCb");
const enterCbKey = Symbol("_enterCb");
const TransitionGroupImpl = {
  name: "TransitionGroup",
  props: /* @__PURE__ */ extend$1({}, 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((c) => {
        const el = c.el;
        const style2 = el.style;
        addTransitionClass(el, moveClass);
        style2.transform = style2.webkitTransform = style2.transitionDuration = "";
        const cb = el[moveCbKey] = (e2) => {
          if (e2 && e2.target !== el) {
            return;
          }
          if (!e2 || /transform$/.test(e2.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$1;
      prevChildren = [];
      if (children) {
        for (let i2 = 0; i2 < children.length; i2++) {
          const child = children[i2];
          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 i2 = 0; i2 < children.length; i2++) {
        const child = children[i2];
        if (child.key != null) {
          setTransitionHooks(
            child,
            resolveTransitionHooks(child, cssTransitionProps, state, instance)
          );
        } else if (false) {
          warn$3(`<TransitionGroup> children must be keyed.`);
        }
      }
      return createVNode(tag, null, children);
    };
  }
};
const removeMode = /* @__PURE__ */ __name((props) => delete props.mode, "removeMode");
/* @__PURE__ */ removeMode(TransitionGroupImpl.props);
const TransitionGroup = TransitionGroupImpl;
function callPendingCbs(c) {
  const el = c.el;
  if (el[moveCbKey]) {
    el[moveCbKey]();
  }
  if (el[enterCbKey]) {
    el[enterCbKey]();
  }
}
__name(callPendingCbs, "callPendingCbs");
function recordPosition(c) {
  newPositionMap.set(c, c.el.getBoundingClientRect());
}
__name(recordPosition, "recordPosition");
function applyTranslation(c) {
  const oldPos = positionMap.get(c);
  const newPos = newPositionMap.get(c);
  const dx = oldPos.left - newPos.left;
  const dy = oldPos.top - newPos.top;
  if (dx || dy) {
    const s = c.el.style;
    s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
    s.transitionDuration = "0s";
    return c;
  }
}
__name(applyTranslation, "applyTranslation");
function hasCSSTransform(el, root24, moveClass) {
  const clone2 = el.cloneNode();
  const _vtc = el[vtcKey];
  if (_vtc) {
    _vtc.forEach((cls) => {
      cls.split(/\s+/).forEach((c) => c && clone2.classList.remove(c));
    });
  }
  moveClass.split(/\s+/).forEach((c) => c && clone2.classList.add(c));
  clone2.style.display = "none";
  const container = root24.nodeType === 1 ? root24 : root24.parentNode;
  container.appendChild(clone2);
  const { hasTransform } = getTransitionInfo(clone2);
  container.removeChild(clone2);
  return hasTransform;
}
__name(hasCSSTransform, "hasCSSTransform");
const getModelAssigner = /* @__PURE__ */ __name((vnode) => {
  const fn = vnode.props["onUpdate:modelValue"] || false;
  return isArray$4(fn) ? (value4) => invokeArrayFns(fn, value4) : fn;
}, "getModelAssigner");
function onCompositionStart(e2) {
  e2.target.composing = true;
}
__name(onCompositionStart, "onCompositionStart");
function onCompositionEnd(e2) {
  const target = e2.target;
  if (target.composing) {
    target.composing = false;
    target.dispatchEvent(new Event("input"));
  }
}
__name(onCompositionEnd, "onCompositionEnd");
const assignKey = Symbol("_assign");
const vModelText = {
  created(el, { modifiers: { lazy, trim: trim2, number: number2 } }, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    const castToNumber = number2 || vnode.props && vnode.props.type === "number";
    addEventListener(el, lazy ? "change" : "input", (e2) => {
      if (e2.target.composing) return;
      let domValue = el.value;
      if (trim2) {
        domValue = domValue.trim();
      }
      if (castToNumber) {
        domValue = looseToNumber(domValue);
      }
      el[assignKey](domValue);
    });
    if (trim2) {
      addEventListener(el, "change", () => {
        el.value = el.value.trim();
      });
    }
    if (!lazy) {
      addEventListener(el, "compositionstart", onCompositionStart);
      addEventListener(el, "compositionend", onCompositionEnd);
      addEventListener(el, "change", onCompositionEnd);
    }
  },
  // set value on mounted so it's after min/max for type="range"
  mounted(el, { value: value4 }) {
    el.value = value4 == null ? "" : value4;
  },
  beforeUpdate(el, { value: value4, oldValue: oldValue2, modifiers: { lazy, trim: trim2, number: number2 } }, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    if (el.composing) return;
    const elValue = (number2 || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
    const newValue2 = value4 == null ? "" : value4;
    if (elValue === newValue2) {
      return;
    }
    if (document.activeElement === el && el.type !== "range") {
      if (lazy && value4 === oldValue2) {
        return;
      }
      if (trim2 && el.value.trim() === newValue2) {
        return;
      }
    }
    el.value = newValue2;
  }
};
const vModelCheckbox = {
  // #4096 array checkboxes need to be deep traversed
  deep: true,
  created(el, _2, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    addEventListener(el, "change", () => {
      const modelValue3 = el._modelValue;
      const elementValue = getValue$1(el);
      const checked4 = el.checked;
      const assign2 = el[assignKey];
      if (isArray$4(modelValue3)) {
        const index2 = looseIndexOf(modelValue3, elementValue);
        const found2 = index2 !== -1;
        if (checked4 && !found2) {
          assign2(modelValue3.concat(elementValue));
        } else if (!checked4 && found2) {
          const filtered = [...modelValue3];
          filtered.splice(index2, 1);
          assign2(filtered);
        }
      } else if (isSet(modelValue3)) {
        const cloned = new Set(modelValue3);
        if (checked4) {
          cloned.add(elementValue);
        } else {
          cloned.delete(elementValue);
        }
        assign2(cloned);
      } else {
        assign2(getCheckboxValue(el, checked4));
      }
    });
  },
  // set initial checked on mount to wait for true-value/false-value
  mounted: setChecked,
  beforeUpdate(el, binding, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    setChecked(el, binding, vnode);
  }
};
function setChecked(el, { value: value4, oldValue: oldValue2 }, vnode) {
  el._modelValue = value4;
  if (isArray$4(value4)) {
    el.checked = looseIndexOf(value4, vnode.props.value) > -1;
  } else if (isSet(value4)) {
    el.checked = value4.has(vnode.props.value);
  } else if (value4 !== oldValue2) {
    el.checked = looseEqual(value4, getCheckboxValue(el, true));
  }
}
__name(setChecked, "setChecked");
const vModelRadio = {
  created(el, { value: value4 }, vnode) {
    el.checked = looseEqual(value4, vnode.props.value);
    el[assignKey] = getModelAssigner(vnode);
    addEventListener(el, "change", () => {
      el[assignKey](getValue$1(el));
    });
  },
  beforeUpdate(el, { value: value4, oldValue: oldValue2 }, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    if (value4 !== oldValue2) {
      el.checked = looseEqual(value4, vnode.props.value);
    }
  }
};
const vModelSelect = {
  // <select multiple> value need to be deep traversed
  deep: true,
  created(el, { value: value4, modifiers: { number: number2 } }, vnode) {
    const isSetModel = isSet(value4);
    addEventListener(el, "change", () => {
      const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
        (o) => number2 ? looseToNumber(getValue$1(o)) : getValue$1(o)
      );
      el[assignKey](
        el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
      );
      el._assigning = true;
      nextTick(() => {
        el._assigning = false;
      });
    });
    el[assignKey] = getModelAssigner(vnode);
  },
  // set value in mounted & updated because <select> relies on its children
  // <option>s.
  mounted(el, { value: value4, modifiers: { number: number2 } }) {
    setSelected(el, value4);
  },
  beforeUpdate(el, _binding, vnode) {
    el[assignKey] = getModelAssigner(vnode);
  },
  updated(el, { value: value4, modifiers: { number: number2 } }) {
    if (!el._assigning) {
      setSelected(el, value4);
    }
  }
};
function setSelected(el, value4, number2) {
  const isMultiple = el.multiple;
  const isArrayValue = isArray$4(value4);
  if (isMultiple && !isArrayValue && !isSet(value4)) {
    return;
  }
  for (let i2 = 0, l = el.options.length; i2 < l; i2++) {
    const option3 = el.options[i2];
    const optionValue = getValue$1(option3);
    if (isMultiple) {
      if (isArrayValue) {
        const optionType = typeof optionValue;
        if (optionType === "string" || optionType === "number") {
          option3.selected = value4.some((v2) => String(v2) === String(optionValue));
        } else {
          option3.selected = looseIndexOf(value4, optionValue) > -1;
        }
      } else {
        option3.selected = value4.has(optionValue);
      }
    } else if (looseEqual(getValue$1(option3), value4)) {
      if (el.selectedIndex !== i2) el.selectedIndex = i2;
      return;
    }
  }
  if (!isMultiple && el.selectedIndex !== -1) {
    el.selectedIndex = -1;
  }
}
__name(setSelected, "setSelected");
function getValue$1(el) {
  return "_value" in el ? el._value : el.value;
}
__name(getValue$1, "getValue$1");
function getCheckboxValue(el, checked4) {
  const key = checked4 ? "_trueValue" : "_falseValue";
  return key in el ? el[key] : checked4;
}
__name(getCheckboxValue, "getCheckboxValue");
const vModelDynamic = {
  created(el, binding, vnode) {
    callModelHook(el, binding, vnode, null, "created");
  },
  mounted(el, binding, vnode) {
    callModelHook(el, binding, vnode, null, "mounted");
  },
  beforeUpdate(el, binding, vnode, prevVNode) {
    callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  },
  updated(el, binding, vnode, prevVNode) {
    callModelHook(el, binding, vnode, prevVNode, "updated");
  }
};
function resolveDynamicModel(tagName, type) {
  switch (tagName) {
    case "SELECT":
      return vModelSelect;
    case "TEXTAREA":
      return vModelText;
    default:
      switch (type) {
        case "checkbox":
          return vModelCheckbox;
        case "radio":
          return vModelRadio;
        default:
          return vModelText;
      }
  }
}
__name(resolveDynamicModel, "resolveDynamicModel");
function callModelHook(el, binding, vnode, prevVNode, hook) {
  const modelToUse = resolveDynamicModel(
    el.tagName,
    vnode.props && vnode.props.type
  );
  const fn = modelToUse[hook];
  fn && fn(el, binding, vnode, prevVNode);
}
__name(callModelHook, "callModelHook");
function initVModelForSSR() {
  vModelText.getSSRProps = ({ value: value4 }) => ({ value: value4 });
  vModelRadio.getSSRProps = ({ value: value4 }, vnode) => {
    if (vnode.props && looseEqual(vnode.props.value, value4)) {
      return { checked: true };
    }
  };
  vModelCheckbox.getSSRProps = ({ value: value4 }, vnode) => {
    if (isArray$4(value4)) {
      if (vnode.props && looseIndexOf(value4, vnode.props.value) > -1) {
        return { checked: true };
      }
    } else if (isSet(value4)) {
      if (vnode.props && value4.has(vnode.props.value)) {
        return { checked: true };
      }
    } else if (value4) {
      return { checked: true };
    }
  };
  vModelDynamic.getSSRProps = (binding, vnode) => {
    if (typeof vnode.type !== "string") {
      return;
    }
    const modelToUse = resolveDynamicModel(
      // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
      vnode.type.toUpperCase(),
      vnode.props && vnode.props.type
    );
    if (modelToUse.getSSRProps) {
      return modelToUse.getSSRProps(binding, vnode);
    }
  };
}
__name(initVModelForSSR, "initVModelForSSR");
const systemModifiers = ["ctrl", "shift", "alt", "meta"];
const modifierGuards = {
  stop: /* @__PURE__ */ __name((e2) => e2.stopPropagation(), "stop"),
  prevent: /* @__PURE__ */ __name((e2) => e2.preventDefault(), "prevent"),
  self: /* @__PURE__ */ __name((e2) => e2.target !== e2.currentTarget, "self"),
  ctrl: /* @__PURE__ */ __name((e2) => !e2.ctrlKey, "ctrl"),
  shift: /* @__PURE__ */ __name((e2) => !e2.shiftKey, "shift"),
  alt: /* @__PURE__ */ __name((e2) => !e2.altKey, "alt"),
  meta: /* @__PURE__ */ __name((e2) => !e2.metaKey, "meta"),
  left: /* @__PURE__ */ __name((e2) => "button" in e2 && e2.button !== 0, "left"),
  middle: /* @__PURE__ */ __name((e2) => "button" in e2 && e2.button !== 1, "middle"),
  right: /* @__PURE__ */ __name((e2) => "button" in e2 && e2.button !== 2, "right"),
  exact: /* @__PURE__ */ __name((e2, modifiers2) => systemModifiers.some((m) => e2[`${m}Key`] && !modifiers2.includes(m)), "exact")
};
const withModifiers = /* @__PURE__ */ __name((fn, modifiers2) => {
  const cache2 = fn._withMods || (fn._withMods = {});
  const cacheKey = modifiers2.join(".");
  return cache2[cacheKey] || (cache2[cacheKey] = (event, ...args) => {
    for (let i2 = 0; i2 < modifiers2.length; i2++) {
      const guard = modifierGuards[modifiers2[i2]];
      if (guard && guard(event, modifiers2)) return;
    }
    return fn(event, ...args);
  });
}, "withModifiers");
const keyNames = {
  esc: "escape",
  space: " ",
  up: "arrow-up",
  left: "arrow-left",
  right: "arrow-right",
  down: "arrow-down",
  delete: "backspace"
};
const withKeys = /* @__PURE__ */ __name((fn, modifiers2) => {
  const cache2 = fn._withKeys || (fn._withKeys = {});
  const cacheKey = modifiers2.join(".");
  return cache2[cacheKey] || (cache2[cacheKey] = (event) => {
    if (!("key" in event)) {
      return;
    }
    const eventKey = hyphenate$1(event.key);
    if (modifiers2.some((k) => k === eventKey || keyNames[k] === eventKey)) {
      return fn(event);
    }
  });
}, "withKeys");
const rendererOptions = /* @__PURE__ */ extend$1({ patchProp }, nodeOps);
let renderer;
let enabledHydration = false;
function ensureRenderer() {
  return renderer || (renderer = createRenderer(rendererOptions));
}
__name(ensureRenderer, "ensureRenderer");
function ensureHydrationRenderer() {
  renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  enabledHydration = true;
  return renderer;
}
__name(ensureHydrationRenderer, "ensureHydrationRenderer");
const render$Y = /* @__PURE__ */ __name((...args) => {
  ensureRenderer().render(...args);
}, "render$Y");
const hydrate = /* @__PURE__ */ __name((...args) => {
  ensureHydrationRenderer().hydrate(...args);
}, "hydrate");
const createApp = /* @__PURE__ */ __name((...args) => {
  const app2 = ensureRenderer().createApp(...args);
  if (false) {
    injectNativeTagCheck(app2);
    injectCompilerOptionsCheck(app2);
  }
  const { mount: mount2 } = app2;
  app2.mount = (containerOrSelector) => {
    const container = normalizeContainer(containerOrSelector);
    if (!container) return;
    const component = app2._component;
    if (!isFunction$4(component) && !component.render && !component.template) {
      component.template = container.innerHTML;
    }
    container.innerHTML = "";
    const proxy = mount2(container, false, resolveRootNamespace(container));
    if (container instanceof Element) {
      container.removeAttribute("v-cloak");
      container.setAttribute("data-v-app", "");
    }
    return proxy;
  };
  return app2;
}, "createApp");
const createSSRApp = /* @__PURE__ */ __name((...args) => {
  const app2 = ensureHydrationRenderer().createApp(...args);
  if (false) {
    injectNativeTagCheck(app2);
    injectCompilerOptionsCheck(app2);
  }
  const { mount: mount2 } = app2;
  app2.mount = (containerOrSelector) => {
    const container = normalizeContainer(containerOrSelector);
    if (container) {
      return mount2(container, true, resolveRootNamespace(container));
    }
  };
  return app2;
}, "createSSRApp");
function resolveRootNamespace(container) {
  if (container instanceof SVGElement) {
    return "svg";
  }
  if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
    return "mathml";
  }
}
__name(resolveRootNamespace, "resolveRootNamespace");
function injectNativeTagCheck(app2) {
  Object.defineProperty(app2.config, "isNativeTag", {
    value: /* @__PURE__ */ __name((tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), "value"),
    writable: false
  });
}
__name(injectNativeTagCheck, "injectNativeTagCheck");
function injectCompilerOptionsCheck(app2) {
  if (isRuntimeOnly()) {
    const isCustomElement = app2.config.isCustomElement;
    Object.defineProperty(app2.config, "isCustomElement", {
      get() {
        return isCustomElement;
      },
      set() {
        warn$3(
          `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
        );
      }
    });
    const compilerOptions = app2.config.compilerOptions;
    const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
    Object.defineProperty(app2.config, "compilerOptions", {
      get() {
        warn$3(msg);
        return compilerOptions;
      },
      set() {
        warn$3(msg);
      }
    });
  }
}
__name(injectCompilerOptionsCheck, "injectCompilerOptionsCheck");
function normalizeContainer(container) {
  if (isString$7(container)) {
    const res = document.querySelector(container);
    if (false) {
      warn$3(
        `Failed to mount app: mount target selector "${container}" returned null.`
      );
    }
    return res;
  }
  if (false) {
    warn$3(
      `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
    );
  }
  return container;
}
__name(normalizeContainer, "normalizeContainer");
let ssrDirectiveInitialized = false;
const initDirectivesForSSR = /* @__PURE__ */ __name(() => {
  if (!ssrDirectiveInitialized) {
    ssrDirectiveInitialized = true;
    initVModelForSSR();
    initVShowForSSR();
  }
}, "initDirectivesForSSR");
/**
* vue v3.4.31
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function initDev() {
  {
    initCustomFormatter();
  }
}
__name(initDev, "initDev");
if (false) {
  initDev();
}
const compile$2 = /* @__PURE__ */ __name(() => {
  if (false) {
    warn$3(
      `Runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
    );
  }
}, "compile$2");
const vue_runtime_esmBundler = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseTransition,
  BaseTransitionPropsValidators,
  Comment,
  DeprecationTypes,
  EffectScope,
  ErrorCodes,
  ErrorTypeStrings,
  Fragment: Fragment$1,
  KeepAlive,
  ReactiveEffect,
  Static,
  Suspense,
  Teleport,
  Text: Text$4,
  TrackOpTypes,
  Transition,
  TransitionGroup,
  TriggerOpTypes,
  VueElement,
  assertNumber,
  callWithAsyncErrorHandling,
  callWithErrorHandling,
  camelize: camelize$1,
  capitalize: capitalize$1,
  cloneVNode,
  compatUtils,
  compile: compile$2,
  computed,
  createApp,
  createBlock,
  createCommentVNode,
  createElementBlock,
  createElementVNode: createBaseVNode,
  createHydrationRenderer,
  createPropsRestProxy,
  createRenderer,
  createSSRApp,
  createSlots,
  createStaticVNode,
  createTextVNode,
  createVNode,
  customRef,
  defineAsyncComponent,
  defineComponent,
  defineCustomElement,
  defineEmits,
  defineExpose,
  defineModel,
  defineOptions,
  defineProps,
  defineSSRCustomElement,
  defineSlots,
  devtools: devtools$2,
  effect,
  effectScope,
  getCurrentInstance,
  getCurrentScope,
  getTransitionRawChildren,
  guardReactiveProps,
  h,
  handleError,
  hasInjectionContext,
  hydrate,
  initCustomFormatter,
  initDirectivesForSSR,
  inject,
  isMemoSame,
  isProxy,
  isReactive,
  isReadonly,
  isRef,
  isRuntimeOnly,
  isShallow,
  isVNode: isVNode$1,
  markRaw,
  mergeDefaults,
  mergeModels,
  mergeProps,
  nextTick,
  normalizeClass,
  normalizeProps,
  normalizeStyle,
  onActivated,
  onBeforeMount,
  onBeforeUnmount,
  onBeforeUpdate,
  onDeactivated,
  onErrorCaptured,
  onMounted,
  onRenderTracked,
  onRenderTriggered,
  onScopeDispose,
  onServerPrefetch,
  onUnmounted,
  onUpdated,
  openBlock,
  popScopeId,
  provide,
  proxyRefs,
  pushScopeId,
  queuePostFlushCb,
  reactive,
  readonly,
  ref,
  registerRuntimeCompiler,
  render: render$Y,
  renderList,
  renderSlot,
  resolveComponent,
  resolveDirective,
  resolveDynamicComponent,
  resolveFilter,
  resolveTransitionHooks,
  setBlockTracking,
  setDevtoolsHook,
  setTransitionHooks,
  shallowReactive,
  shallowReadonly,
  shallowRef,
  ssrContextKey,
  ssrUtils,
  stop,
  toDisplayString: toDisplayString$1,
  toHandlerKey,
  toHandlers,
  toRaw,
  toRef: toRef$1,
  toRefs: toRefs$1,
  toValue: toValue$1,
  transformVNodeArgs,
  triggerRef,
  unref,
  useAttrs,
  useCssModule,
  useCssVars,
  useModel,
  useSSRContext,
  useSlots,
  useTransitionState,
  vModelCheckbox,
  vModelDynamic,
  vModelRadio,
  vModelSelect,
  vModelText,
  vShow,
  version,
  warn: warn$3,
  watch,
  watchEffect,
  watchPostEffect,
  watchSyncEffect,
  withAsyncContext,
  withCtx,
  withDefaults,
  withDirectives,
  withKeys,
  withMemo,
  withModifiers,
  withScopeId
}, Symbol.toStringTag, { value: "Module" }));
var isVue2$2 = false;
var isVue3$2 = true;
var Vue2$2 = void 0;
function install$8() {
}
__name(install$8, "install$8");
function set$3(target, key, val) {
  if (Array.isArray(target)) {
    target.length = Math.max(target.length, key);
    target.splice(key, 1, val);
    return val;
  }
  target[key] = val;
  return val;
}
__name(set$3, "set$3");
function del$3(target, key) {
  if (Array.isArray(target)) {
    target.splice(key, 1);
    return;
  }
  delete target[key];
}
__name(del$3, "del$3");
function getDevtoolsGlobalHook() {
  return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
__name(getDevtoolsGlobalHook, "getDevtoolsGlobalHook");
function getTarget() {
  return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : {};
}
__name(getTarget, "getTarget");
const isProxyAvailable = typeof Proxy === "function";
const HOOK_SETUP = "devtools-plugin:setup";
const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
let supported;
let perf;
function isPerformanceSupported() {
  var _a2;
  if (supported !== void 0) {
    return supported;
  }
  if (typeof window !== "undefined" && window.performance) {
    supported = true;
    perf = window.performance;
  } else if (typeof globalThis !== "undefined" && ((_a2 = globalThis.perf_hooks) === null || _a2 === void 0 ? void 0 : _a2.performance)) {
    supported = true;
    perf = globalThis.perf_hooks.performance;
  } else {
    supported = false;
  }
  return supported;
}
__name(isPerformanceSupported, "isPerformanceSupported");
function now$1() {
  return isPerformanceSupported() ? perf.now() : Date.now();
}
__name(now$1, "now$1");
class ApiProxy {
  static {
    __name(this, "ApiProxy");
  }
  constructor(plugin, hook) {
    this.target = null;
    this.targetQueue = [];
    this.onQueue = [];
    this.plugin = plugin;
    this.hook = hook;
    const defaultSettings = {};
    if (plugin.settings) {
      for (const id3 in plugin.settings) {
        const item3 = plugin.settings[id3];
        defaultSettings[id3] = item3.defaultValue;
      }
    }
    const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
    let currentSettings = Object.assign({}, defaultSettings);
    try {
      const raw = localStorage.getItem(localSettingsSaveId);
      const data24 = JSON.parse(raw);
      Object.assign(currentSettings, data24);
    } catch (e2) {
    }
    this.fallbacks = {
      getSettings() {
        return currentSettings;
      },
      setSettings(value4) {
        try {
          localStorage.setItem(localSettingsSaveId, JSON.stringify(value4));
        } catch (e2) {
        }
        currentSettings = value4;
      },
      now() {
        return now$1();
      }
    };
    if (hook) {
      hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value4) => {
        if (pluginId === this.plugin.id) {
          this.fallbacks.setSettings(value4);
        }
      });
    }
    this.proxiedOn = new Proxy({}, {
      get: /* @__PURE__ */ __name((_target, prop2) => {
        if (this.target) {
          return this.target.on[prop2];
        } else {
          return (...args) => {
            this.onQueue.push({
              method: prop2,
              args
            });
          };
        }
      }, "get")
    });
    this.proxiedTarget = new Proxy({}, {
      get: /* @__PURE__ */ __name((_target, prop2) => {
        if (this.target) {
          return this.target[prop2];
        } else if (prop2 === "on") {
          return this.proxiedOn;
        } else if (Object.keys(this.fallbacks).includes(prop2)) {
          return (...args) => {
            this.targetQueue.push({
              method: prop2,
              args,
              resolve: /* @__PURE__ */ __name(() => {
              }, "resolve")
            });
            return this.fallbacks[prop2](...args);
          };
        } else {
          return (...args) => {
            return new Promise((resolve2) => {
              this.targetQueue.push({
                method: prop2,
                args,
                resolve: resolve2
              });
            });
          };
        }
      }, "get")
    });
  }
  async setRealTarget(target) {
    this.target = target;
    for (const item3 of this.onQueue) {
      this.target.on[item3.method](...item3.args);
    }
    for (const item3 of this.targetQueue) {
      item3.resolve(await this.target[item3.method](...item3.args));
    }
  }
}
function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
  const descriptor = pluginDescriptor;
  const target = getTarget();
  const hook = getDevtoolsGlobalHook();
  const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;
  if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
    hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
  } else {
    const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;
    const list2 = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
    list2.push({
      pluginDescriptor: descriptor,
      setupFn,
      proxy
    });
    if (proxy) {
      setupFn(proxy.proxiedTarget);
    }
  }
}
__name(setupDevtoolsPlugin, "setupDevtoolsPlugin");
/*!
 * pinia v2.2.2
 * (c) 2024 Eduardo San Martin Morote
 * @license MIT
 */
let activePinia;
const setActivePinia = /* @__PURE__ */ __name((pinia2) => activePinia = pinia2, "setActivePinia");
const getActivePinia = /* @__PURE__ */ __name(() => hasInjectionContext() && inject(piniaSymbol) || activePinia, "getActivePinia");
const piniaSymbol = false ? Symbol("pinia") : (
  /* istanbul ignore next */
  Symbol()
);
function isPlainObject$3(o) {
  return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
}
__name(isPlainObject$3, "isPlainObject$3");
var MutationType;
(function(MutationType2) {
  MutationType2["direct"] = "direct";
  MutationType2["patchObject"] = "patch object";
  MutationType2["patchFunction"] = "patch function";
})(MutationType || (MutationType = {}));
const IS_CLIENT = typeof window !== "undefined";
const _global$2 = /* @__PURE__ */ (() => typeof window === "object" && window.window === window ? window : typeof self === "object" && self.self === self ? self : typeof global === "object" && global.global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement: null })();
function bom(blob, { autoBom = false } = {}) {
  if (autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
    return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
  }
  return blob;
}
__name(bom, "bom");
function download(url, name2, opts) {
  const xhr = new XMLHttpRequest();
  xhr.open("GET", url);
  xhr.responseType = "blob";
  xhr.onload = function() {
    saveAs$1(xhr.response, name2, opts);
  };
  xhr.onerror = function() {
    console.error("could not download file");
  };
  xhr.send();
}
__name(download, "download");
function corsEnabled(url) {
  const xhr = new XMLHttpRequest();
  xhr.open("HEAD", url, false);
  try {
    xhr.send();
  } catch (e2) {
  }
  return xhr.status >= 200 && xhr.status <= 299;
}
__name(corsEnabled, "corsEnabled");
function click(node3) {
  try {
    node3.dispatchEvent(new MouseEvent("click"));
  } catch (e2) {
    const evt = document.createEvent("MouseEvents");
    evt.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
    node3.dispatchEvent(evt);
  }
}
__name(click, "click");
const _navigator = typeof navigator === "object" ? navigator : { userAgent: "" };
const isMacOSWebView = /* @__PURE__ */ (() => /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent))();
const saveAs$1 = !IS_CLIENT ? () => {
} : (
  // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
  typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : (
    // Use msSaveOrOpenBlob as a second approach
    "msSaveOrOpenBlob" in _navigator ? msSaveAs : (
      // Fallback to using FileReader and a popup
      fileSaverSaveAs
    )
  )
);
function downloadSaveAs(blob, name2 = "download", opts) {
  const a = document.createElement("a");
  a.download = name2;
  a.rel = "noopener";
  if (typeof blob === "string") {
    a.href = blob;
    if (a.origin !== location.origin) {
      if (corsEnabled(a.href)) {
        download(blob, name2, opts);
      } else {
        a.target = "_blank";
        click(a);
      }
    } else {
      click(a);
    }
  } else {
    a.href = URL.createObjectURL(blob);
    setTimeout(function() {
      URL.revokeObjectURL(a.href);
    }, 4e4);
    setTimeout(function() {
      click(a);
    }, 0);
  }
}
__name(downloadSaveAs, "downloadSaveAs");
function msSaveAs(blob, name2 = "download", opts) {
  if (typeof blob === "string") {
    if (corsEnabled(blob)) {
      download(blob, name2, opts);
    } else {
      const a = document.createElement("a");
      a.href = blob;
      a.target = "_blank";
      setTimeout(function() {
        click(a);
      });
    }
  } else {
    navigator.msSaveOrOpenBlob(bom(blob, opts), name2);
  }
}
__name(msSaveAs, "msSaveAs");
function fileSaverSaveAs(blob, name2, opts, popup) {
  popup = popup || open("", "_blank");
  if (popup) {
    popup.document.title = popup.document.body.innerText = "downloading...";
  }
  if (typeof blob === "string")
    return download(blob, name2, opts);
  const force = blob.type === "application/octet-stream";
  const isSafari3 = /constructor/i.test(String(_global$2.HTMLElement)) || "safari" in _global$2;
  const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
  if ((isChromeIOS || force && isSafari3 || isMacOSWebView) && typeof FileReader !== "undefined") {
    const reader = new FileReader();
    reader.onloadend = function() {
      let url = reader.result;
      if (typeof url !== "string") {
        popup = null;
        throw new Error("Wrong reader.result type");
      }
      url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;");
      if (popup) {
        popup.location.href = url;
      } else {
        location.assign(url);
      }
      popup = null;
    };
    reader.readAsDataURL(blob);
  } else {
    const url = URL.createObjectURL(blob);
    if (popup)
      popup.location.assign(url);
    else
      location.href = url;
    popup = null;
    setTimeout(function() {
      URL.revokeObjectURL(url);
    }, 4e4);
  }
}
__name(fileSaverSaveAs, "fileSaverSaveAs");
function toastMessage(message3, type) {
  const piniaMessage = "🍍 " + message3;
  if (typeof __VUE_DEVTOOLS_TOAST__ === "function") {
    __VUE_DEVTOOLS_TOAST__(piniaMessage, type);
  } else if (type === "error") {
    console.error(piniaMessage);
  } else if (type === "warn") {
    console.warn(piniaMessage);
  } else {
    console.log(piniaMessage);
  }
}
__name(toastMessage, "toastMessage");
function isPinia(o) {
  return "_a" in o && "install" in o;
}
__name(isPinia, "isPinia");
function checkClipboardAccess() {
  if (!("clipboard" in navigator)) {
    toastMessage(`Your browser doesn't support the Clipboard API`, "error");
    return true;
  }
}
__name(checkClipboardAccess, "checkClipboardAccess");
function checkNotFocusedError(error2) {
  if (error2 instanceof Error && error2.message.toLowerCase().includes("document is not focused")) {
    toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn");
    return true;
  }
  return false;
}
__name(checkNotFocusedError, "checkNotFocusedError");
async function actionGlobalCopyState(pinia2) {
  if (checkClipboardAccess())
    return;
  try {
    await navigator.clipboard.writeText(JSON.stringify(pinia2.state.value));
    toastMessage("Global state copied to clipboard.");
  } catch (error2) {
    if (checkNotFocusedError(error2))
      return;
    toastMessage(`Failed to serialize the state. Check the console for more details.`, "error");
    console.error(error2);
  }
}
__name(actionGlobalCopyState, "actionGlobalCopyState");
async function actionGlobalPasteState(pinia2) {
  if (checkClipboardAccess())
    return;
  try {
    loadStoresState(pinia2, JSON.parse(await navigator.clipboard.readText()));
    toastMessage("Global state pasted from clipboard.");
  } catch (error2) {
    if (checkNotFocusedError(error2))
      return;
    toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, "error");
    console.error(error2);
  }
}
__name(actionGlobalPasteState, "actionGlobalPasteState");
async function actionGlobalSaveState(pinia2) {
  try {
    saveAs$1(new Blob([JSON.stringify(pinia2.state.value)], {
      type: "text/plain;charset=utf-8"
    }), "pinia-state.json");
  } catch (error2) {
    toastMessage(`Failed to export the state as JSON. Check the console for more details.`, "error");
    console.error(error2);
  }
}
__name(actionGlobalSaveState, "actionGlobalSaveState");
let fileInput;
function getFileOpener() {
  if (!fileInput) {
    fileInput = document.createElement("input");
    fileInput.type = "file";
    fileInput.accept = ".json";
  }
  function openFile() {
    return new Promise((resolve2, reject3) => {
      fileInput.onchange = async () => {
        const files = fileInput.files;
        if (!files)
          return resolve2(null);
        const file = files.item(0);
        if (!file)
          return resolve2(null);
        return resolve2({ text: await file.text(), file });
      };
      fileInput.oncancel = () => resolve2(null);
      fileInput.onerror = reject3;
      fileInput.click();
    });
  }
  __name(openFile, "openFile");
  return openFile;
}
__name(getFileOpener, "getFileOpener");
async function actionGlobalOpenStateFile(pinia2) {
  try {
    const open2 = getFileOpener();
    const result = await open2();
    if (!result)
      return;
    const { text: text2, file } = result;
    loadStoresState(pinia2, JSON.parse(text2));
    toastMessage(`Global state imported from "${file.name}".`);
  } catch (error2) {
    toastMessage(`Failed to import the state from JSON. Check the console for more details.`, "error");
    console.error(error2);
  }
}
__name(actionGlobalOpenStateFile, "actionGlobalOpenStateFile");
function loadStoresState(pinia2, state) {
  for (const key in state) {
    const storeState = pinia2.state.value[key];
    if (storeState) {
      Object.assign(storeState, state[key]);
    } else {
      pinia2.state.value[key] = state[key];
    }
  }
}
__name(loadStoresState, "loadStoresState");
function formatDisplay$1(display) {
  return {
    _custom: {
      display
    }
  };
}
__name(formatDisplay$1, "formatDisplay$1");
const PINIA_ROOT_LABEL = "🍍 Pinia (root)";
const PINIA_ROOT_ID = "_root";
function formatStoreForInspectorTree(store) {
  return isPinia(store) ? {
    id: PINIA_ROOT_ID,
    label: PINIA_ROOT_LABEL
  } : {
    id: store.$id,
    label: store.$id
  };
}
__name(formatStoreForInspectorTree, "formatStoreForInspectorTree");
function formatStoreForInspectorState(store) {
  if (isPinia(store)) {
    const storeNames = Array.from(store._s.keys());
    const storeMap = store._s;
    const state2 = {
      state: storeNames.map((storeId) => ({
        editable: true,
        key: storeId,
        value: store.state.value[storeId]
      })),
      getters: storeNames.filter((id3) => storeMap.get(id3)._getters).map((id3) => {
        const store2 = storeMap.get(id3);
        return {
          editable: false,
          key: id3,
          value: store2._getters.reduce((getters, key) => {
            getters[key] = store2[key];
            return getters;
          }, {})
        };
      })
    };
    return state2;
  }
  const state = {
    state: Object.keys(store.$state).map((key) => ({
      editable: true,
      key,
      value: store.$state[key]
    }))
  };
  if (store._getters && store._getters.length) {
    state.getters = store._getters.map((getterName) => ({
      editable: false,
      key: getterName,
      value: store[getterName]
    }));
  }
  if (store._customProperties.size) {
    state.customProperties = Array.from(store._customProperties).map((key) => ({
      editable: true,
      key,
      value: store[key]
    }));
  }
  return state;
}
__name(formatStoreForInspectorState, "formatStoreForInspectorState");
function formatEventData(events2) {
  if (!events2)
    return {};
  if (Array.isArray(events2)) {
    return events2.reduce((data24, event) => {
      data24.keys.push(event.key);
      data24.operations.push(event.type);
      data24.oldValue[event.key] = event.oldValue;
      data24.newValue[event.key] = event.newValue;
      return data24;
    }, {
      oldValue: {},
      keys: [],
      operations: [],
      newValue: {}
    });
  } else {
    return {
      operation: formatDisplay$1(events2.type),
      key: formatDisplay$1(events2.key),
      oldValue: events2.oldValue,
      newValue: events2.newValue
    };
  }
}
__name(formatEventData, "formatEventData");
function formatMutationType(type) {
  switch (type) {
    case MutationType.direct:
      return "mutation";
    case MutationType.patchFunction:
      return "$patch";
    case MutationType.patchObject:
      return "$patch";
    default:
      return "unknown";
  }
}
__name(formatMutationType, "formatMutationType");
let isTimelineActive = true;
const componentStateTypes = [];
const MUTATIONS_LAYER_ID = "pinia:mutations";
const INSPECTOR_ID = "pinia";
const { assign: assign$1$1 } = Object;
const getStoreType = /* @__PURE__ */ __name((id3) => "🍍 " + id3, "getStoreType");
function registerPiniaDevtools(app2, pinia2) {
  setupDevtoolsPlugin({
    id: "dev.esm.pinia",
    label: "Pinia 🍍",
    logo: "https://pinia.vuejs.org/logo.svg",
    packageName: "pinia",
    homepage: "https://pinia.vuejs.org",
    componentStateTypes,
    app: app2
  }, (api2) => {
    if (typeof api2.now !== "function") {
      toastMessage("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.");
    }
    api2.addTimelineLayer({
      id: MUTATIONS_LAYER_ID,
      label: `Pinia 🍍`,
      color: 15064968
    });
    api2.addInspector({
      id: INSPECTOR_ID,
      label: "Pinia 🍍",
      icon: "storage",
      treeFilterPlaceholder: "Search stores",
      actions: [
        {
          icon: "content_copy",
          action: /* @__PURE__ */ __name(() => {
            actionGlobalCopyState(pinia2);
          }, "action"),
          tooltip: "Serialize and copy the state"
        },
        {
          icon: "content_paste",
          action: /* @__PURE__ */ __name(async () => {
            await actionGlobalPasteState(pinia2);
            api2.sendInspectorTree(INSPECTOR_ID);
            api2.sendInspectorState(INSPECTOR_ID);
          }, "action"),
          tooltip: "Replace the state with the content of your clipboard"
        },
        {
          icon: "save",
          action: /* @__PURE__ */ __name(() => {
            actionGlobalSaveState(pinia2);
          }, "action"),
          tooltip: "Save the state as a JSON file"
        },
        {
          icon: "folder_open",
          action: /* @__PURE__ */ __name(async () => {
            await actionGlobalOpenStateFile(pinia2);
            api2.sendInspectorTree(INSPECTOR_ID);
            api2.sendInspectorState(INSPECTOR_ID);
          }, "action"),
          tooltip: "Import the state from a JSON file"
        }
      ],
      nodeActions: [
        {
          icon: "restore",
          tooltip: 'Reset the state (with "$reset")',
          action: /* @__PURE__ */ __name((nodeId) => {
            const store = pinia2._s.get(nodeId);
            if (!store) {
              toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, "warn");
            } else if (typeof store.$reset !== "function") {
              toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, "warn");
            } else {
              store.$reset();
              toastMessage(`Store "${nodeId}" reset.`);
            }
          }, "action")
        }
      ]
    });
    api2.on.inspectComponent((payload, ctx) => {
      const proxy = payload.componentInstance && payload.componentInstance.proxy;
      if (proxy && proxy._pStores) {
        const piniaStores = payload.componentInstance.proxy._pStores;
        Object.values(piniaStores).forEach((store) => {
          payload.instanceData.state.push({
            type: getStoreType(store.$id),
            key: "state",
            editable: true,
            value: store._isOptionsAPI ? {
              _custom: {
                value: toRaw(store.$state),
                actions: [
                  {
                    icon: "restore",
                    tooltip: "Reset the state of this store",
                    action: /* @__PURE__ */ __name(() => store.$reset(), "action")
                  }
                ]
              }
            } : (
              // NOTE: workaround to unwrap transferred refs
              Object.keys(store.$state).reduce((state, key) => {
                state[key] = store.$state[key];
                return state;
              }, {})
            )
          });
          if (store._getters && store._getters.length) {
            payload.instanceData.state.push({
              type: getStoreType(store.$id),
              key: "getters",
              editable: false,
              value: store._getters.reduce((getters, key) => {
                try {
                  getters[key] = store[key];
                } catch (error2) {
                  getters[key] = error2;
                }
                return getters;
              }, {})
            });
          }
        });
      }
    });
    api2.on.getInspectorTree((payload) => {
      if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
        let stores = [pinia2];
        stores = stores.concat(Array.from(pinia2._s.values()));
        payload.rootNodes = (payload.filter ? stores.filter((store) => "$id" in store ? store.$id.toLowerCase().includes(payload.filter.toLowerCase()) : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) : stores).map(formatStoreForInspectorTree);
      }
    });
    globalThis.$pinia = pinia2;
    api2.on.getInspectorState((payload) => {
      if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
        const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia2 : pinia2._s.get(payload.nodeId);
        if (!inspectedStore) {
          return;
        }
        if (inspectedStore) {
          if (payload.nodeId !== PINIA_ROOT_ID)
            globalThis.$store = toRaw(inspectedStore);
          payload.state = formatStoreForInspectorState(inspectedStore);
        }
      }
    });
    api2.on.editInspectorState((payload, ctx) => {
      if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
        const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia2 : pinia2._s.get(payload.nodeId);
        if (!inspectedStore) {
          return toastMessage(`store "${payload.nodeId}" not found`, "error");
        }
        const { path } = payload;
        if (!isPinia(inspectedStore)) {
          if (path.length !== 1 || !inspectedStore._customProperties.has(path[0]) || path[0] in inspectedStore.$state) {
            path.unshift("$state");
          }
        } else {
          path.unshift("state");
        }
        isTimelineActive = false;
        payload.set(inspectedStore, path, payload.state.value);
        isTimelineActive = true;
      }
    });
    api2.on.editComponentState((payload) => {
      if (payload.type.startsWith("🍍")) {
        const storeId = payload.type.replace(/^🍍\s*/, "");
        const store = pinia2._s.get(storeId);
        if (!store) {
          return toastMessage(`store "${storeId}" not found`, "error");
        }
        const { path } = payload;
        if (path[0] !== "state") {
          return toastMessage(`Invalid path for store "${storeId}":
${path}
Only state can be modified.`);
        }
        path[0] = "$state";
        isTimelineActive = false;
        payload.set(store, path, payload.state.value);
        isTimelineActive = true;
      }
    });
  });
}
__name(registerPiniaDevtools, "registerPiniaDevtools");
function addStoreToDevtools(app2, store) {
  if (!componentStateTypes.includes(getStoreType(store.$id))) {
    componentStateTypes.push(getStoreType(store.$id));
  }
  setupDevtoolsPlugin({
    id: "dev.esm.pinia",
    label: "Pinia 🍍",
    logo: "https://pinia.vuejs.org/logo.svg",
    packageName: "pinia",
    homepage: "https://pinia.vuejs.org",
    componentStateTypes,
    app: app2,
    settings: {
      logStoreChanges: {
        label: "Notify about new/deleted stores",
        type: "boolean",
        defaultValue: true
      }
      // useEmojis: {
      //   label: 'Use emojis in messages ⚡️',
      //   type: 'boolean',
      //   defaultValue: true,
      // },
    }
  }, (api2) => {
    const now2 = typeof api2.now === "function" ? api2.now.bind(api2) : Date.now;
    store.$onAction(({ after, onError, name: name2, args }) => {
      const groupId = runningActionId++;
      api2.addTimelineEvent({
        layerId: MUTATIONS_LAYER_ID,
        event: {
          time: now2(),
          title: "🛫 " + name2,
          subtitle: "start",
          data: {
            store: formatDisplay$1(store.$id),
            action: formatDisplay$1(name2),
            args
          },
          groupId
        }
      });
      after((result) => {
        activeAction = void 0;
        api2.addTimelineEvent({
          layerId: MUTATIONS_LAYER_ID,
          event: {
            time: now2(),
            title: "🛬 " + name2,
            subtitle: "end",
            data: {
              store: formatDisplay$1(store.$id),
              action: formatDisplay$1(name2),
              args,
              result
            },
            groupId
          }
        });
      });
      onError((error2) => {
        activeAction = void 0;
        api2.addTimelineEvent({
          layerId: MUTATIONS_LAYER_ID,
          event: {
            time: now2(),
            logType: "error",
            title: "💥 " + name2,
            subtitle: "end",
            data: {
              store: formatDisplay$1(store.$id),
              action: formatDisplay$1(name2),
              args,
              error: error2
            },
            groupId
          }
        });
      });
    }, true);
    store._customProperties.forEach((name2) => {
      watch(() => unref(store[name2]), (newValue2, oldValue2) => {
        api2.notifyComponentUpdate();
        api2.sendInspectorState(INSPECTOR_ID);
        if (isTimelineActive) {
          api2.addTimelineEvent({
            layerId: MUTATIONS_LAYER_ID,
            event: {
              time: now2(),
              title: "Change",
              subtitle: name2,
              data: {
                newValue: newValue2,
                oldValue: oldValue2
              },
              groupId: activeAction
            }
          });
        }
      }, { deep: true });
    });
    store.$subscribe(({ events: events2, type }, state) => {
      api2.notifyComponentUpdate();
      api2.sendInspectorState(INSPECTOR_ID);
      if (!isTimelineActive)
        return;
      const eventData = {
        time: now2(),
        title: formatMutationType(type),
        data: assign$1$1({ store: formatDisplay$1(store.$id) }, formatEventData(events2)),
        groupId: activeAction
      };
      if (type === MutationType.patchFunction) {
        eventData.subtitle = "⤵️";
      } else if (type === MutationType.patchObject) {
        eventData.subtitle = "🧩";
      } else if (events2 && !Array.isArray(events2)) {
        eventData.subtitle = events2.type;
      }
      if (events2) {
        eventData.data["rawEvent(s)"] = {
          _custom: {
            display: "DebuggerEvent",
            type: "object",
            tooltip: "raw DebuggerEvent[]",
            value: events2
          }
        };
      }
      api2.addTimelineEvent({
        layerId: MUTATIONS_LAYER_ID,
        event: eventData
      });
    }, { detached: true, flush: "sync" });
    const hotUpdate = store._hotUpdate;
    store._hotUpdate = markRaw((newStore) => {
      hotUpdate(newStore);
      api2.addTimelineEvent({
        layerId: MUTATIONS_LAYER_ID,
        event: {
          time: now2(),
          title: "🔥 " + store.$id,
          subtitle: "HMR update",
          data: {
            store: formatDisplay$1(store.$id),
            info: formatDisplay$1(`HMR update`)
          }
        }
      });
      api2.notifyComponentUpdate();
      api2.sendInspectorTree(INSPECTOR_ID);
      api2.sendInspectorState(INSPECTOR_ID);
    });
    const { $dispose } = store;
    store.$dispose = () => {
      $dispose();
      api2.notifyComponentUpdate();
      api2.sendInspectorTree(INSPECTOR_ID);
      api2.sendInspectorState(INSPECTOR_ID);
      api2.getSettings().logStoreChanges && toastMessage(`Disposed "${store.$id}" store 🗑`);
    };
    api2.notifyComponentUpdate();
    api2.sendInspectorTree(INSPECTOR_ID);
    api2.sendInspectorState(INSPECTOR_ID);
    api2.getSettings().logStoreChanges && toastMessage(`"${store.$id}" store installed 🆕`);
  });
}
__name(addStoreToDevtools, "addStoreToDevtools");
let runningActionId = 0;
let activeAction;
function patchActionForGrouping(store, actionNames, wrapWithProxy) {
  const actions = actionNames.reduce((storeActions, actionName) => {
    storeActions[actionName] = toRaw(store)[actionName];
    return storeActions;
  }, {});
  for (const actionName in actions) {
    store[actionName] = function() {
      const _actionId = runningActionId;
      const trackedStore = wrapWithProxy ? new Proxy(store, {
        get(...args) {
          activeAction = _actionId;
          return Reflect.get(...args);
        },
        set(...args) {
          activeAction = _actionId;
          return Reflect.set(...args);
        }
      }) : store;
      activeAction = _actionId;
      const retValue = actions[actionName].apply(trackedStore, arguments);
      activeAction = void 0;
      return retValue;
    };
  }
}
__name(patchActionForGrouping, "patchActionForGrouping");
function devtoolsPlugin({ app: app2, store, options: options4 }) {
  if (store.$id.startsWith("__hot:")) {
    return;
  }
  store._isOptionsAPI = !!options4.state;
  if (!store._p._testing) {
    patchActionForGrouping(store, Object.keys(options4.actions), store._isOptionsAPI);
    const originalHotUpdate = store._hotUpdate;
    toRaw(store)._hotUpdate = function(newStore) {
      originalHotUpdate.apply(this, arguments);
      patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);
    };
  }
  addStoreToDevtools(
    app2,
    // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
    store
  );
}
__name(devtoolsPlugin, "devtoolsPlugin");
function createPinia() {
  const scope = effectScope(true);
  const state = scope.run(() => ref({}));
  let _p = [];
  let toBeInstalled = [];
  const pinia2 = markRaw({
    install(app2) {
      setActivePinia(pinia2);
      if (!isVue2$2) {
        pinia2._a = app2;
        app2.provide(piniaSymbol, pinia2);
        app2.config.globalProperties.$pinia = pinia2;
        if (false) {
          registerPiniaDevtools(app2, pinia2);
        }
        toBeInstalled.forEach((plugin) => _p.push(plugin));
        toBeInstalled = [];
      }
    },
    use(plugin) {
      if (!this._a && !isVue2$2) {
        toBeInstalled.push(plugin);
      } else {
        _p.push(plugin);
      }
      return this;
    },
    _p,
    // it's actually undefined here
    // @ts-expect-error
    _a: null,
    _e: scope,
    _s: /* @__PURE__ */ new Map(),
    state
  });
  if (false) {
    pinia2.use(devtoolsPlugin);
  }
  return pinia2;
}
__name(createPinia, "createPinia");
function disposePinia(pinia2) {
  pinia2._e.stop();
  pinia2._s.clear();
  pinia2._p.splice(0);
  pinia2.state.value = {};
  pinia2._a = null;
}
__name(disposePinia, "disposePinia");
const isUseStore = /* @__PURE__ */ __name((fn) => {
  return typeof fn === "function" && typeof fn.$id === "string";
}, "isUseStore");
function patchObject(newState, oldState) {
  for (const key in oldState) {
    const subPatch = oldState[key];
    if (!(key in newState)) {
      continue;
    }
    const targetValue = newState[key];
    if (isPlainObject$3(targetValue) && isPlainObject$3(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) {
      newState[key] = patchObject(targetValue, subPatch);
    } else {
      if (isVue2$2) {
        set$3(newState, key, subPatch);
      } else {
        newState[key] = subPatch;
      }
    }
  }
  return newState;
}
__name(patchObject, "patchObject");
function acceptHMRUpdate(initialUseStore, hot) {
  if (true) {
    return () => {
    };
  }
  return (newModule) => {
    const pinia2 = hot.data.pinia || initialUseStore._pinia;
    if (!pinia2) {
      return;
    }
    hot.data.pinia = pinia2;
    for (const exportName in newModule) {
      const useStore = newModule[exportName];
      if (isUseStore(useStore) && pinia2._s.has(useStore.$id)) {
        const id3 = useStore.$id;
        if (id3 !== initialUseStore.$id) {
          console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id3}". Reloading.`);
          return hot.invalidate();
        }
        const existingStore = pinia2._s.get(id3);
        if (!existingStore) {
          console.log(`[Pinia]: skipping hmr because store doesn't exist yet`);
          return;
        }
        useStore(pinia2, existingStore);
      }
    }
  };
}
__name(acceptHMRUpdate, "acceptHMRUpdate");
const noop$4 = /* @__PURE__ */ __name(() => {
}, "noop$4");
function addSubscription(subscriptions, callback, detached, onCleanup = noop$4) {
  subscriptions.push(callback);
  const removeSubscription = /* @__PURE__ */ __name(() => {
    const idx = subscriptions.indexOf(callback);
    if (idx > -1) {
      subscriptions.splice(idx, 1);
      onCleanup();
    }
  }, "removeSubscription");
  if (!detached && getCurrentScope()) {
    onScopeDispose(removeSubscription);
  }
  return removeSubscription;
}
__name(addSubscription, "addSubscription");
function triggerSubscriptions(subscriptions, ...args) {
  subscriptions.slice().forEach((callback) => {
    callback(...args);
  });
}
__name(triggerSubscriptions, "triggerSubscriptions");
const fallbackRunWithContext = /* @__PURE__ */ __name((fn) => fn(), "fallbackRunWithContext");
const ACTION_MARKER = Symbol();
const ACTION_NAME = Symbol();
function mergeReactiveObjects(target, patchToApply) {
  if (target instanceof Map && patchToApply instanceof Map) {
    patchToApply.forEach((value4, key) => target.set(key, value4));
  } 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$3(targetValue) && isPlainObject$3(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
      target[key] = mergeReactiveObjects(targetValue, subPatch);
    } else {
      target[key] = subPatch;
    }
  }
  return target;
}
__name(mergeReactiveObjects, "mergeReactiveObjects");
const skipHydrateSymbol = false ? Symbol("pinia:skipHydration") : (
  /* istanbul ignore next */
  Symbol()
);
const skipHydrateMap = /* @__PURE__ */ new WeakMap();
function skipHydrate(obj) {
  return isVue2$2 ? (
    // in @vue/composition-api, the refs are sealed so defineProperty doesn't work...
    /* istanbul ignore next */
    skipHydrateMap.set(obj, 1) && obj
  ) : Object.defineProperty(obj, skipHydrateSymbol, {});
}
__name(skipHydrate, "skipHydrate");
function shouldHydrate(obj) {
  return isVue2$2 ? (
    /* istanbul ignore next */
    !skipHydrateMap.has(obj)
  ) : !isPlainObject$3(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
}
__name(shouldHydrate, "shouldHydrate");
const { assign: assign$6 } = Object;
function isComputed(o) {
  return !!(isRef(o) && o.effect);
}
__name(isComputed, "isComputed");
function createOptionsStore(id3, options4, pinia2, hot) {
  const { state, actions, getters } = options4;
  const initialState = pinia2.state.value[id3];
  let store;
  function setup2() {
    if (!initialState && true) {
      if (isVue2$2) {
        set$3(pinia2.state.value, id3, state ? state() : {});
      } else {
        pinia2.state.value[id3] = state ? state() : {};
      }
    }
    const localState = false ? (
      // use ref() to unwrap refs inside state TODO: check if this is still necessary
      toRefs$1(ref(state ? state() : {}).value)
    ) : toRefs$1(pinia2.state.value[id3]);
    return assign$6(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name2) => {
      if (false) {
        console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name2}" in store "${id3}".`);
      }
      computedGetters[name2] = markRaw(computed(() => {
        setActivePinia(pinia2);
        const store2 = pinia2._s.get(id3);
        if (isVue2$2 && !store2._r)
          return;
        return getters[name2].call(store2, store2);
      }));
      return computedGetters;
    }, {}));
  }
  __name(setup2, "setup");
  store = createSetupStore(id3, setup2, options4, pinia2, hot, true);
  return store;
}
__name(createOptionsStore, "createOptionsStore");
function createSetupStore($id, setup2, options4 = {}, pinia2, hot, isOptionsStore) {
  let scope;
  const optionsForPlugin = assign$6({ actions: {} }, options4);
  if (false) {
    throw new Error("Pinia destroyed");
  }
  const $subscribeOptions = { deep: true };
  if (false) {
    $subscribeOptions.onTrigger = (event) => {
      if (isListening) {
        debuggerEvents = event;
      } else if (isListening == false && !store._hotUpdating) {
        if (Array.isArray(debuggerEvents)) {
          debuggerEvents.push(event);
        } else {
          console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
        }
      }
    };
  }
  let isListening;
  let isSyncListening;
  let subscriptions = [];
  let actionSubscriptions = [];
  let debuggerEvents;
  const initialState = pinia2.state.value[$id];
  if (!isOptionsStore && !initialState && true) {
    if (isVue2$2) {
      set$3(pinia2.state.value, $id, {});
    } else {
      pinia2.state.value[$id] = {};
    }
  }
  const hotState = ref({});
  let activeListener;
  function $patch(partialStateOrMutator) {
    let subscriptionMutation;
    isListening = isSyncListening = false;
    if (false) {
      debuggerEvents = [];
    }
    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]);
  }
  __name($patch, "$patch");
  const $reset = isOptionsStore ? /* @__PURE__ */ __name(function $reset2() {
    const { state } = options4;
    const newState = state ? state() : {};
    this.$patch(($state) => {
      assign$6($state, newState);
    });
  }, "$reset2") : (
    /* istanbul ignore next */
    false ? () => {
      throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
    } : noop$4
  );
  function $dispose() {
    scope.stop();
    subscriptions = [];
    actionSubscriptions = [];
    pinia2._s.delete($id);
  }
  __name($dispose, "$dispose");
  const action = /* @__PURE__ */ __name((fn, name2 = "") => {
    if (ACTION_MARKER in fn) {
      fn[ACTION_NAME] = name2;
      return fn;
    }
    const wrappedAction = /* @__PURE__ */ __name(function() {
      setActivePinia(pinia2);
      const args = Array.from(arguments);
      const afterCallbackList = [];
      const onErrorCallbackList = [];
      function after(callback) {
        afterCallbackList.push(callback);
      }
      __name(after, "after");
      function onError(callback) {
        onErrorCallbackList.push(callback);
      }
      __name(onError, "onError");
      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((value4) => {
          triggerSubscriptions(afterCallbackList, value4);
          return value4;
        }).catch((error2) => {
          triggerSubscriptions(onErrorCallbackList, error2);
          return Promise.reject(error2);
        });
      }
      triggerSubscriptions(afterCallbackList, ret);
      return ret;
    }, "wrappedAction");
    wrappedAction[ACTION_MARKER] = true;
    wrappedAction[ACTION_NAME] = name2;
    return wrappedAction;
  }, "action");
  const _hmrPayload = /* @__PURE__ */ markRaw({
    actions: {},
    getters: {},
    state: [],
    hotState
  });
  const partialStore = {
    _p: pinia2,
    // _s: scope,
    $id,
    $onAction: addSubscription.bind(null, actionSubscriptions),
    $patch,
    $reset,
    $subscribe(callback, options22 = {}) {
      const removeSubscription = addSubscription(subscriptions, callback, options22.detached, () => stopWatcher());
      const stopWatcher = scope.run(() => watch(() => pinia2.state.value[$id], (state) => {
        if (options22.flush === "sync" ? isSyncListening : isListening) {
          callback({
            storeId: $id,
            type: MutationType.direct,
            events: debuggerEvents
          }, state);
        }
      }, assign$6({}, $subscribeOptions, options22)));
      return removeSubscription;
    },
    $dispose
  };
  if (isVue2$2) {
    partialStore._r = false;
  }
  const store = reactive(false ? assign$6(
    {
      _hmrPayload,
      _customProperties: markRaw(/* @__PURE__ */ new Set())
      // devtools custom properties
    },
    partialStore
    // must be added later
    // setupStore
  ) : partialStore);
  pinia2._s.set($id, store);
  const runWithContext = pinia2._a && pinia2._a.runWithContext || fallbackRunWithContext;
  const setupStore = runWithContext(() => pinia2._e.run(() => (scope = effectScope()).run(() => setup2({ action }))));
  for (const key in setupStore) {
    const prop2 = setupStore[key];
    if (isRef(prop2) && !isComputed(prop2) || isReactive(prop2)) {
      if (false) {
        set$3(hotState.value, key, toRef$1(setupStore, key));
      } else if (!isOptionsStore) {
        if (initialState && shouldHydrate(prop2)) {
          if (isRef(prop2)) {
            prop2.value = initialState[key];
          } else {
            mergeReactiveObjects(prop2, initialState[key]);
          }
        }
        if (isVue2$2) {
          set$3(pinia2.state.value[$id], key, prop2);
        } else {
          pinia2.state.value[$id][key] = prop2;
        }
      }
      if (false) {
        _hmrPayload.state.push(key);
      }
    } else if (typeof prop2 === "function") {
      const actionValue = false ? prop2 : action(prop2, key);
      if (isVue2$2) {
        set$3(setupStore, key, actionValue);
      } else {
        setupStore[key] = actionValue;
      }
      if (false) {
        _hmrPayload.actions[key] = prop2;
      }
      optionsForPlugin.actions[key] = prop2;
    } else if (false) {
      if (isComputed(prop2)) {
        _hmrPayload.getters[key] = isOptionsStore ? (
          // @ts-expect-error
          options4.getters[key]
        ) : prop2;
        if (IS_CLIENT) {
          const getters = setupStore._getters || // @ts-expect-error: same
          (setupStore._getters = markRaw([]));
          getters.push(key);
        }
      }
    }
  }
  if (isVue2$2) {
    Object.keys(setupStore).forEach((key) => {
      set$3(store, key, setupStore[key]);
    });
  } else {
    assign$6(store, setupStore);
    assign$6(toRaw(store), setupStore);
  }
  Object.defineProperty(store, "$state", {
    get: /* @__PURE__ */ __name(() => false ? hotState.value : pinia2.state.value[$id], "get"),
    set: /* @__PURE__ */ __name((state) => {
      if (false) {
        throw new Error("cannot set hotState");
      }
      $patch(($state) => {
        assign$6($state, state);
      });
    }, "set")
  });
  if (false) {
    store._hotUpdate = markRaw((newStore) => {
      store._hotUpdating = true;
      newStore._hmrPayload.state.forEach((stateKey) => {
        if (stateKey in store.$state) {
          const newStateTarget = newStore.$state[stateKey];
          const oldStateSource = store.$state[stateKey];
          if (typeof newStateTarget === "object" && isPlainObject$3(newStateTarget) && isPlainObject$3(oldStateSource)) {
            patchObject(newStateTarget, oldStateSource);
          } else {
            newStore.$state[stateKey] = oldStateSource;
          }
        }
        set$3(store, stateKey, toRef$1(newStore.$state, stateKey));
      });
      Object.keys(store.$state).forEach((stateKey) => {
        if (!(stateKey in newStore.$state)) {
          del$3(store, stateKey);
        }
      });
      isListening = false;
      isSyncListening = false;
      pinia2.state.value[$id] = toRef$1(newStore._hmrPayload, "hotState");
      isSyncListening = true;
      nextTick().then(() => {
        isListening = true;
      });
      for (const actionName in newStore._hmrPayload.actions) {
        const actionFn = newStore[actionName];
        set$3(store, actionName, action(actionFn, actionName));
      }
      for (const getterName in newStore._hmrPayload.getters) {
        const getter = newStore._hmrPayload.getters[getterName];
        const getterValue = isOptionsStore ? (
          // special handling of options api
          computed(() => {
            setActivePinia(pinia2);
            return getter.call(store, store);
          })
        ) : getter;
        set$3(store, getterName, getterValue);
      }
      Object.keys(store._hmrPayload.getters).forEach((key) => {
        if (!(key in newStore._hmrPayload.getters)) {
          del$3(store, key);
        }
      });
      Object.keys(store._hmrPayload.actions).forEach((key) => {
        if (!(key in newStore._hmrPayload.actions)) {
          del$3(store, key);
        }
      });
      store._hmrPayload = newStore._hmrPayload;
      store._getters = newStore._getters;
      store._hotUpdating = false;
    });
  }
  if (false) {
    const nonEnumerable = {
      writable: true,
      configurable: true,
      // avoid warning on devtools trying to display this property
      enumerable: false
    };
    ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p2) => {
      Object.defineProperty(store, p2, assign$6({ value: store[p2] }, nonEnumerable));
    });
  }
  if (isVue2$2) {
    store._r = true;
  }
  pinia2._p.forEach((extender) => {
    if (false) {
      const extensions = scope.run(() => extender({
        store,
        app: pinia2._a,
        pinia: pinia2,
        options: optionsForPlugin
      }));
      Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));
      assign$6(store, extensions);
    } else {
      assign$6(store, scope.run(() => extender({
        store,
        app: pinia2._a,
        pinia: pinia2,
        options: optionsForPlugin
      })));
    }
  });
  if (false) {
    console.warn(`[🍍]: The "state" must be a plain object. It cannot be
	state: () => new MyClass()
Found in store "${store.$id}".`);
  }
  if (initialState && isOptionsStore && options4.hydrate) {
    options4.hydrate(store.$state, initialState);
  }
  isListening = true;
  isSyncListening = true;
  return store;
}
__name(createSetupStore, "createSetupStore");
// @__NO_SIDE_EFFECTS__
function defineStore(idOrOptions, setup2, setupOptions) {
  let id3;
  let options4;
  const isSetupStore = typeof setup2 === "function";
  if (typeof idOrOptions === "string") {
    id3 = idOrOptions;
    options4 = isSetupStore ? setupOptions : setup2;
  } else {
    options4 = idOrOptions;
    id3 = idOrOptions.id;
    if (false) {
      throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`);
    }
  }
  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()
    (false ? null : pinia2) || (hasContext ? inject(piniaSymbol, null) : null);
    if (pinia2)
      setActivePinia(pinia2);
    if (false) {
      throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
This will fail in production.`);
    }
    pinia2 = activePinia;
    if (!pinia2._s.has(id3)) {
      if (isSetupStore) {
        createSetupStore(id3, setup2, options4, pinia2);
      } else {
        createOptionsStore(id3, options4, pinia2);
      }
      if (false) {
        useStore._pinia = pinia2;
      }
    }
    const store = pinia2._s.get(id3);
    if (false) {
      const hotId = "__hot:" + id3;
      const newStore = isSetupStore ? createSetupStore(hotId, setup2, options4, pinia2, true) : createOptionsStore(hotId, assign$6({}, options4), pinia2, true);
      hot._hotUpdate(newStore);
      delete pinia2.state.value[hotId];
      pinia2._s.delete(hotId);
    }
    if (false) {
      const currentInstance2 = getCurrentInstance();
      if (currentInstance2 && currentInstance2.proxy && // avoid adding stores that are just built for hot module replacement
      !hot) {
        const vm = currentInstance2.proxy;
        const cache2 = "_pStores" in vm ? vm._pStores : vm._pStores = {};
        cache2[id3] = store;
      }
    }
    return store;
  }
  __name(useStore, "useStore");
  useStore.$id = id3;
  return useStore;
}
__name(defineStore, "defineStore");
let mapStoreSuffix = "Store";
function setMapStoreSuffix(suffix2) {
  mapStoreSuffix = suffix2;
}
__name(setMapStoreSuffix, "setMapStoreSuffix");
function mapStores(...stores) {
  if (false) {
    console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:
Replace
	mapStores([useAuthStore, useCartStore])
with
	mapStores(useAuthStore, useCartStore)
This will fail in production if not fixed.`);
    stores = stores[0];
  }
  return stores.reduce((reduced, useStore) => {
    reduced[useStore.$id + mapStoreSuffix] = function() {
      return useStore(this.$pinia);
    };
    return reduced;
  }, {});
}
__name(mapStores, "mapStores");
function mapState(useStore, keysOrMapper) {
  return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
    reduced[key] = function() {
      return useStore(this.$pinia)[key];
    };
    return reduced;
  }, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
    reduced[key] = function() {
      const store = useStore(this.$pinia);
      const storeKey = keysOrMapper[key];
      return typeof storeKey === "function" ? storeKey.call(this, store) : store[storeKey];
    };
    return reduced;
  }, {});
}
__name(mapState, "mapState");
const mapGetters = mapState;
function mapActions(useStore, keysOrMapper) {
  return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
    reduced[key] = function(...args) {
      return useStore(this.$pinia)[key](...args);
    };
    return reduced;
  }, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
    reduced[key] = function(...args) {
      return useStore(this.$pinia)[keysOrMapper[key]](...args);
    };
    return reduced;
  }, {});
}
__name(mapActions, "mapActions");
function mapWritableState(useStore, keysOrMapper) {
  return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
    reduced[key] = {
      get() {
        return useStore(this.$pinia)[key];
      },
      set(value4) {
        return useStore(this.$pinia)[key] = value4;
      }
    };
    return reduced;
  }, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
    reduced[key] = {
      get() {
        return useStore(this.$pinia)[keysOrMapper[key]];
      },
      set(value4) {
        return useStore(this.$pinia)[keysOrMapper[key]] = value4;
      }
    };
    return reduced;
  }, {});
}
__name(mapWritableState, "mapWritableState");
function storeToRefs(store) {
  if (isVue2$2) {
    return toRefs$1(store);
  } else {
    store = toRaw(store);
    const refs = {};
    for (const key in store) {
      const value4 = store[key];
      if (isRef(value4) || isReactive(value4)) {
        refs[key] = // ---
        toRef$1(store, key);
      }
    }
    return refs;
  }
}
__name(storeToRefs, "storeToRefs");
const PiniaVuePlugin = /* @__PURE__ */ __name(function(_Vue) {
  _Vue.mixin({
    beforeCreate() {
      const options4 = this.$options;
      if (options4.pinia) {
        const pinia2 = options4.pinia;
        if (!this._provided) {
          const provideCache = {};
          Object.defineProperty(this, "_provided", {
            get: /* @__PURE__ */ __name(() => provideCache, "get"),
            set: /* @__PURE__ */ __name((v2) => Object.assign(provideCache, v2), "set")
          });
        }
        this._provided[piniaSymbol] = pinia2;
        if (!this.$pinia) {
          this.$pinia = pinia2;
        }
        pinia2._a = this;
        if (IS_CLIENT) {
          setActivePinia(pinia2);
        }
        if (false) {
          registerPiniaDevtools(pinia2._a, pinia2);
        }
      } else if (!this.$pinia && options4.parent && options4.parent.$pinia) {
        this.$pinia = options4.parent.$pinia;
      }
    },
    destroyed() {
      delete this._pStores;
    }
  });
}, "PiniaVuePlugin");
var FilterMatchMode = {
  STARTS_WITH: "startsWith",
  CONTAINS: "contains",
  NOT_CONTAINS: "notContains",
  ENDS_WITH: "endsWith",
  EQUALS: "equals",
  NOT_EQUALS: "notEquals",
  IN: "in",
  LESS_THAN: "lt",
  LESS_THAN_OR_EQUAL_TO: "lte",
  GREATER_THAN: "gt",
  GREATER_THAN_OR_EQUAL_TO: "gte",
  BETWEEN: "between",
  DATE_IS: "dateIs",
  DATE_IS_NOT: "dateIsNot",
  DATE_BEFORE: "dateBefore",
  DATE_AFTER: "dateAfter"
};
var FilterOperator = {
  AND: "and",
  OR: "or"
};
function _createForOfIteratorHelper$4(r, e2) {
  var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (!t2) {
    if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$j(r)) || e2) {
      t2 && (r = t2);
      var _n = 0, F = /* @__PURE__ */ __name(function F2() {
      }, "F");
      return { s: F, n: /* @__PURE__ */ __name(function n() {
        return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
      }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
        throw r2;
      }, "e"), f: F };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var o, a = true, u = false;
  return { s: /* @__PURE__ */ __name(function s() {
    t2 = t2.call(r);
  }, "s"), n: /* @__PURE__ */ __name(function n() {
    var r2 = t2.next();
    return a = r2.done, r2;
  }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
    u = true, o = r2;
  }, "e"), f: /* @__PURE__ */ __name(function f() {
    try {
      a || null == t2["return"] || t2["return"]();
    } finally {
      if (u) throw o;
    }
  }, "f") };
}
__name(_createForOfIteratorHelper$4, "_createForOfIteratorHelper$4");
function _unsupportedIterableToArray$j(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$j(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$j(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$j, "_unsupportedIterableToArray$j");
function _arrayLikeToArray$j(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$j, "_arrayLikeToArray$j");
var FilterService = {
  filter: /* @__PURE__ */ __name(function filter2(value4, fields, filterValue, filterMatchMode, filterLocale) {
    var filteredItems = [];
    if (!value4) {
      return filteredItems;
    }
    var _iterator = _createForOfIteratorHelper$4(value4), _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done; ) {
        var item3 = _step.value;
        if (typeof item3 === "string") {
          if (this.filters[filterMatchMode](item3, filterValue, filterLocale)) {
            filteredItems.push(item3);
            continue;
          }
        } else {
          var _iterator2 = _createForOfIteratorHelper$4(fields), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var field = _step2.value;
              var fieldValue = resolveFieldData(item3, field);
              if (this.filters[filterMatchMode](fieldValue, filterValue, filterLocale)) {
                filteredItems.push(item3);
                break;
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
        }
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    return filteredItems;
  }, "filter"),
  filters: {
    startsWith: /* @__PURE__ */ __name(function startsWith(value4, filter4, filterLocale) {
      if (filter4 === void 0 || filter4 === null || filter4 === "") {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      var filterValue = removeAccents(filter4.toString()).toLocaleLowerCase(filterLocale);
      var stringValue = removeAccents(value4.toString()).toLocaleLowerCase(filterLocale);
      return stringValue.slice(0, filterValue.length) === filterValue;
    }, "startsWith"),
    contains: /* @__PURE__ */ __name(function contains2(value4, filter4, filterLocale) {
      if (filter4 === void 0 || filter4 === null || filter4 === "") {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      var filterValue = removeAccents(filter4.toString()).toLocaleLowerCase(filterLocale);
      var stringValue = removeAccents(value4.toString()).toLocaleLowerCase(filterLocale);
      return stringValue.indexOf(filterValue) !== -1;
    }, "contains"),
    notContains: /* @__PURE__ */ __name(function notContains(value4, filter4, filterLocale) {
      if (filter4 === void 0 || filter4 === null || filter4 === "") {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      var filterValue = removeAccents(filter4.toString()).toLocaleLowerCase(filterLocale);
      var stringValue = removeAccents(value4.toString()).toLocaleLowerCase(filterLocale);
      return stringValue.indexOf(filterValue) === -1;
    }, "notContains"),
    endsWith: /* @__PURE__ */ __name(function endsWith2(value4, filter4, filterLocale) {
      if (filter4 === void 0 || filter4 === null || filter4 === "") {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      var filterValue = removeAccents(filter4.toString()).toLocaleLowerCase(filterLocale);
      var stringValue = removeAccents(value4.toString()).toLocaleLowerCase(filterLocale);
      return stringValue.indexOf(filterValue, stringValue.length - filterValue.length) !== -1;
    }, "endsWith"),
    equals: /* @__PURE__ */ __name(function equals2(value4, filter4, filterLocale) {
      if (filter4 === void 0 || filter4 === null || filter4 === "") {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      if (value4.getTime && filter4.getTime) return value4.getTime() === filter4.getTime();
      else return removeAccents(value4.toString()).toLocaleLowerCase(filterLocale) == removeAccents(filter4.toString()).toLocaleLowerCase(filterLocale);
    }, "equals"),
    notEquals: /* @__PURE__ */ __name(function notEquals(value4, filter4, filterLocale) {
      if (filter4 === void 0 || filter4 === null || filter4 === "") {
        return false;
      }
      if (value4 === void 0 || value4 === null) {
        return true;
      }
      if (value4.getTime && filter4.getTime) return value4.getTime() !== filter4.getTime();
      else return removeAccents(value4.toString()).toLocaleLowerCase(filterLocale) != removeAccents(filter4.toString()).toLocaleLowerCase(filterLocale);
    }, "notEquals"),
    "in": /* @__PURE__ */ __name(function _in(value4, filter4) {
      if (filter4 === void 0 || filter4 === null || filter4.length === 0) {
        return true;
      }
      for (var i2 = 0; i2 < filter4.length; i2++) {
        if (equals(value4, filter4[i2])) {
          return true;
        }
      }
      return false;
    }, "_in"),
    between: /* @__PURE__ */ __name(function between(value4, filter4) {
      if (filter4 == null || filter4[0] == null || filter4[1] == null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      if (value4.getTime) return filter4[0].getTime() <= value4.getTime() && value4.getTime() <= filter4[1].getTime();
      else return filter4[0] <= value4 && value4 <= filter4[1];
    }, "between"),
    lt: /* @__PURE__ */ __name(function lt(value4, filter4) {
      if (filter4 === void 0 || filter4 === null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      if (value4.getTime && filter4.getTime) return value4.getTime() < filter4.getTime();
      else return value4 < filter4;
    }, "lt"),
    lte: /* @__PURE__ */ __name(function lte(value4, filter4) {
      if (filter4 === void 0 || filter4 === null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      if (value4.getTime && filter4.getTime) return value4.getTime() <= filter4.getTime();
      else return value4 <= filter4;
    }, "lte"),
    gt: /* @__PURE__ */ __name(function gt(value4, filter4) {
      if (filter4 === void 0 || filter4 === null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      if (value4.getTime && filter4.getTime) return value4.getTime() > filter4.getTime();
      else return value4 > filter4;
    }, "gt"),
    gte: /* @__PURE__ */ __name(function gte(value4, filter4) {
      if (filter4 === void 0 || filter4 === null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      if (value4.getTime && filter4.getTime) return value4.getTime() >= filter4.getTime();
      else return value4 >= filter4;
    }, "gte"),
    dateIs: /* @__PURE__ */ __name(function dateIs(value4, filter4) {
      if (filter4 === void 0 || filter4 === null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      return value4.toDateString() === filter4.toDateString();
    }, "dateIs"),
    dateIsNot: /* @__PURE__ */ __name(function dateIsNot(value4, filter4) {
      if (filter4 === void 0 || filter4 === null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      return value4.toDateString() !== filter4.toDateString();
    }, "dateIsNot"),
    dateBefore: /* @__PURE__ */ __name(function dateBefore(value4, filter4) {
      if (filter4 === void 0 || filter4 === null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      return value4.getTime() < filter4.getTime();
    }, "dateBefore"),
    dateAfter: /* @__PURE__ */ __name(function dateAfter(value4, filter4) {
      if (filter4 === void 0 || filter4 === null) {
        return true;
      }
      if (value4 === void 0 || value4 === null) {
        return false;
      }
      return value4.getTime() > filter4.getTime();
    }, "dateAfter")
  },
  register: /* @__PURE__ */ __name(function register2(rule, fn) {
    this.filters[rule] = fn;
  }, "register")
};
var PrimeIcons = {
  ALIGN_CENTER: "pi pi-align-center",
  ALIGN_JUSTIFY: "pi pi-align-justify",
  ALIGN_LEFT: "pi pi-align-left",
  ALIGN_RIGHT: "pi pi-align-right",
  AMAZON: "pi pi-amazon",
  ANDROID: "pi pi-android",
  ANGLE_DOUBLE_DOWN: "pi pi-angle-double-down",
  ANGLE_DOUBLE_LEFT: "pi pi-angle-double-left",
  ANGLE_DOUBLE_RIGHT: "pi pi-angle-double-right",
  ANGLE_DOUBLE_UP: "pi pi-angle-double-up",
  ANGLE_DOWN: "pi pi-angle-down",
  ANGLE_LEFT: "pi pi-angle-left",
  ANGLE_RIGHT: "pi pi-angle-right",
  ANGLE_UP: "pi pi-angle-up",
  APPLE: "pi pi-apple",
  ARROW_CIRCLE_DOWN: "pi pi-arrow-circle-down",
  ARROW_CIRCLE_LEFT: "pi pi-arrow-circle-left",
  ARROW_CIRCLE_RIGHT: "pi pi-arrow-circle-right",
  ARROW_CIRCLE_UP: "pi pi-arrow-circle-up",
  ARROW_DOWN: "pi pi-arrow-down",
  ARROW_DOWN_LEFT: "pi pi-arrow-down-left",
  ARROW_DOWN_RIGHT: "pi pi-arrow-down-right",
  ARROW_LEFT: "pi pi-arrow-left",
  ARROW_RIGHT: "pi pi-arrow-right",
  ARROW_RIGHT_ARROW_LEFT: "pi pi-arrow-right-arrow-left",
  ARROW_UP: "pi pi-arrow-up",
  ARROW_UP_LEFT: "pi pi-arrow-up-left",
  ARROW_UP_RIGHT: "pi pi-arrow-up-right",
  ARROW_H: "pi pi-arrows-h",
  ARROW_V: "pi pi-arrows-v",
  ARROW_A: "pi pi-arrows-alt",
  AT: "pi pi-at",
  BACKWARD: "pi pi-backward",
  BAN: "pi pi-ban",
  BARS: "pi pi-bars",
  BELL: "pi pi-bell",
  BITCOIN: "pi pi-bitcoin",
  BOLT: "pi pi-bolt",
  BOOK: "pi pi-book",
  BOOKMARK: "pi pi-bookmark",
  BOOKMARK_FILL: "pi pi-bookmark-fill",
  BOX: "pi pi-box",
  BRIEFCASE: "pi pi-briefcase",
  BUILDING: "pi pi-building",
  CALENDAR: "pi pi-calendar",
  CALENDAR_MINUS: "pi pi-calendar-minus",
  CALENDAR_PLUS: "pi pi-calendar-plus",
  CALENDAR_TIMES: "pi pi-calendar-times",
  CALCULATOR: "pi pi-calculator",
  CAMERA: "pi pi-camera",
  CAR: "pi pi-car",
  CARET_DOWN: "pi pi-caret-down",
  CARET_LEFT: "pi pi-caret-left",
  CARET_RIGHT: "pi pi-caret-right",
  CARET_UP: "pi pi-caret-up",
  CART_PLUS: "pi pi-cart-plus",
  CHART_BAR: "pi pi-chart-bar",
  CHART_LINE: "pi pi-chart-line",
  CHART_PIE: "pi pi-chart-pie",
  CHECK: "pi pi-check",
  CHECK_CIRCLE: "pi pi-check-circle",
  CHECK_SQUARE: "pi pi-check-square",
  CHEVRON_CIRCLE_DOWN: "pi pi-chevron-circle-down",
  CHEVRON_CIRCLE_LEFT: "pi pi-chevron-circle-left",
  CHEVRON_CIRCLE_RIGHT: "pi pi-chevron-circle-right",
  CHEVRON_CIRCLE_UP: "pi pi-chevron-circle-up",
  CHEVRON_DOWN: "pi pi-chevron-down",
  CHEVRON_LEFT: "pi pi-chevron-left",
  CHEVRON_RIGHT: "pi pi-chevron-right",
  CHEVRON_UP: "pi pi-chevron-up",
  CIRCLE: "pi pi-circle",
  CIRCLE_FILL: "pi pi-circle-fill",
  CLOCK: "pi pi-clock",
  CLONE: "pi pi-clone",
  CLOUD: "pi pi-cloud",
  CLOUD_DOWNLOAD: "pi pi-cloud-download",
  CLOUD_UPLOAD: "pi pi-cloud-upload",
  CODE: "pi pi-code",
  COG: "pi pi-cog",
  COMMENT: "pi pi-comment",
  COMMENTS: "pi pi-comments",
  COMPASS: "pi pi-compass",
  COPY: "pi pi-copy",
  CREDIT_CARD: "pi pi-credit-card",
  DATABASE: "pi pi-database",
  DELETELEFT: "pi pi-delete-left",
  DESKTOP: "pi pi-desktop",
  DIRECTIONS: "pi pi-directions",
  DIRECTIONS_ALT: "pi pi-directions-alt",
  DISCORD: "pi pi-discord",
  DOLLAR: "pi pi-dollar",
  DOWNLOAD: "pi pi-download",
  EJECT: "pi pi-eject",
  ELLIPSIS_H: "pi pi-ellipsis-h",
  ELLIPSIS_V: "pi pi-ellipsis-v",
  ENVELOPE: "pi pi-envelope",
  ERASER: "pi pi-eraser",
  EURO: "pi pi-euro",
  EXCLAMATION_CIRCLE: "pi pi-exclamation-circle",
  EXCLAMATION_TRIANGLE: "pi pi-exclamation-triangle",
  EXTERNAL_LINK: "pi pi-external-link",
  EYE: "pi pi-eye",
  EYE_SLASH: "pi pi-eye-slash",
  FACEBOOK: "pi pi-facebook",
  FAST_BACKWARD: "pi pi-fast-backward",
  FAST_FORWARD: "pi pi-fast-forward",
  FILE: "pi pi-file",
  FILE_EDIT: "pi pi-file-edit",
  FILE_EXCEL: "pi pi-file-excel",
  FILE_EXPORT: "pi pi-file-export",
  FILE_IMPORT: "pi pi-file-import",
  FILE_PDF: "pi pi-file-pdf",
  FILE_WORD: "pi pi-file-word",
  FILTER: "pi pi-filter",
  FILTER_FILL: "pi pi-filter-fill",
  FILTER_SLASH: "pi pi-filter-slash",
  FLAG: "pi pi-flag",
  FLAG_FILL: "pi pi-flag-fill",
  FOLDER: "pi pi-folder",
  FOLDER_OPEN: "pi pi-folder-open",
  FORWARD: "pi pi-forward",
  GIFT: "pi pi-gift",
  GITHUB: "pi pi-github",
  GLOBE: "pi pi-globe",
  GOOGLE: "pi pi-google",
  HASHTAG: "pi pi-hashtag",
  HEART: "pi pi-heart",
  HEART_FILL: "pi pi-heart-fill",
  HISTORY: "pi pi-history",
  HOURGLASS: "pi pi-hourglass",
  HOME: "pi pi-home",
  ID_CARD: "pi pi-id-card",
  IMAGE: "pi pi-image",
  IMAGES: "pi pi-images",
  INBOX: "pi pi-inbox",
  INFO: "pi pi-info",
  INFO_CIRCLE: "pi pi-info-circle",
  INSTAGRAM: "pi pi-instagram",
  KEY: "pi pi-key",
  LANGUAGE: "pi pi-language",
  LINK: "pi pi-link",
  LINKEDIN: "pi pi-linkedin",
  LIST: "pi pi-list",
  LOCK: "pi pi-lock",
  LOCK_OPEN: "pi pi-lock-open",
  MAP: "pi pi-map",
  MAP_MARKER: "pi pi-map-marker",
  MEGAPHONE: "pi pi-megaphone",
  MICREPHONE: "pi pi-microphone",
  MICROSOFT: "pi pi-microsoft",
  MINUS: "pi pi-minus",
  MINUS_CIRCLE: "pi pi-minus-circle",
  MOBILE: "pi pi-mobile",
  MONEY_BILL: "pi pi-money-bill",
  MOON: "pi pi-moon",
  PALETTE: "pi pi-palette",
  PAPERCLIP: "pi pi-paperclip",
  PAUSE: "pi pi-pause",
  PAYPAL: "pi pi-paypal",
  PENCIL: "pi pi-pencil",
  PERCENTAGE: "pi pi-percentage",
  PHONE: "pi pi-phone",
  PLAY: "pi pi-play",
  PLUS: "pi pi-plus",
  PLUS_CIRCLE: "pi pi-plus-circle",
  POUND: "pi pi-pound",
  POWER_OFF: "pi pi-power-off",
  PRIME: "pi pi-prime",
  PRINT: "pi pi-print",
  QRCODE: "pi pi-qrcode",
  QUESTION: "pi pi-question",
  QUESTION_CIRCLE: "pi pi-question-circle",
  REDDIT: "pi pi-reddit",
  REFRESH: "pi pi-refresh",
  REPLAY: "pi pi-replay",
  REPLY: "pi pi-reply",
  SAVE: "pi pi-save",
  SEARCH: "pi pi-search",
  SEARCH_MINUS: "pi pi-search-minus",
  SEARCH_PLUS: "pi pi-search-plus",
  SEND: "pi pi-send",
  SERVER: "pi pi-server",
  SHARE_ALT: "pi pi-share-alt",
  SHIELD: "pi pi-shield",
  SHOPPING_BAG: "pi pi-shopping-bag",
  SHOPPING_CART: "pi pi-shopping-cart",
  SIGN_IN: "pi pi-sign-in",
  SIGN_OUT: "pi pi-sign-out",
  SITEMAP: "pi pi-sitemap",
  SLACK: "pi pi-slack",
  SLIDERS_H: "pi pi-sliders-h",
  SLIDERS_V: "pi pi-sliders-v",
  SORT: "pi pi-sort",
  SORT_ALPHA_DOWN: "pi pi-sort-alpha-down",
  SORT_ALPHA_ALT_DOWN: "pi pi-sort-alpha-down-alt",
  SORT_ALPHA_UP: "pi pi-sort-alpha-up",
  SORT_ALPHA_ALT_UP: "pi pi-sort-alpha-up-alt",
  SORT_ALT: "pi pi-sort-alt",
  SORT_ALT_SLASH: "pi pi-sort-alt-slash",
  SORT_AMOUNT_DOWN: "pi pi-sort-amount-down",
  SORT_AMOUNT_DOWN_ALT: "pi pi-sort-amount-down-alt",
  SORT_AMOUNT_UP: "pi pi-sort-amount-up",
  SORT_AMOUNT_UP_ALT: "pi pi-sort-amount-up-alt",
  SORT_DOWN: "pi pi-sort-down",
  SORT_NUMERIC_DOWN: "pi pi-sort-numeric-down",
  SORT_NUMERIC_ALT_DOWN: "pi pi-sort-numeric-down-alt",
  SORT_NUMERIC_UP: "pi pi-sort-numeric-up",
  SORT_NUMERIC_ALT_UP: "pi pi-sort-numeric-up-alt",
  SORT_UP: "pi pi-sort-up",
  SPINNER: "pi pi-spinner",
  STAR: "pi pi-star",
  STAR_FILL: "pi pi-star-fill",
  STEP_BACKWARD: "pi pi-step-backward",
  STEP_BACKWARD_ALT: "pi pi-step-backward-alt",
  STEP_FORWARD: "pi pi-step-forward",
  STEP_FORWARD_ALT: "pi pi-step-forward-alt",
  STOP: "pi pi-stop",
  STOPWATCH: "pi pi-stopwatch",
  STOP_CIRCLE: "pi pi-stop-circle",
  SUN: "pi pi-sun",
  SYNC: "pi pi-sync",
  TABLE: "pi pi-table",
  TABLET: "pi pi-tablet",
  TAG: "pi pi-tag",
  TAGS: "pi pi-tags",
  TELEGRAM: "pi pi-telegram",
  TH_LARGE: "pi pi-th-large",
  THUMBS_DOWN: "pi pi-thumbs-down",
  THUMBS_DOWN_FILL: "pi pi-thumbs-down-fill",
  THUMBS_UP: "pi pi-thumbs-up",
  THUMBS_UP_FILL: "pi pi-thumbs-up-fill",
  TICKET: "pi pi-ticket",
  TIMES: "pi pi-times",
  TIMES_CIRCLE: "pi pi-times-circle",
  TRASH: "pi pi-trash",
  TRUCK: "pi pi-truck",
  TWITTER: "pi pi-twitter",
  UNDO: "pi pi-undo",
  UNLOCK: "pi pi-unlock",
  UPLOAD: "pi pi-upload",
  USER: "pi pi-user",
  USER_EDIT: "pi pi-user-edit",
  USER_MINUS: "pi pi-user-minus",
  USER_PLUS: "pi pi-user-plus",
  USERS: "pi pi-users",
  VERIFIED: "pi pi-verified",
  VIDEO: "pi pi-video",
  VIMEO: "pi pi-vimeo",
  VOLUME_DOWN: "pi pi-volume-down",
  VOLUME_OFF: "pi pi-volume-off",
  VOLUME_UP: "pi pi-volume-up",
  WALLET: "pi pi-wallet",
  WHATSAPP: "pi pi-whatsapp",
  WIFI: "pi pi-wifi",
  WINDOW_MAXIMIZE: "pi pi-window-maximize",
  WINDOW_MINIMIZE: "pi pi-window-minimize",
  WRENCH: "pi pi-wrench",
  YOUTUBE: "pi pi-youtube"
};
var ToastSeverities = {
  INFO: "info",
  WARN: "warn",
  ERROR: "error",
  SUCCESS: "success"
};
function hasClass(element, className) {
  if (element) {
    if (element.classList) return element.classList.contains(className);
    else return new RegExp("(^| )" + className + "( |$)", "gi").test(element.className);
  }
  return false;
}
__name(hasClass, "hasClass");
function addClass(element, className) {
  if (element && className) {
    const fn = /* @__PURE__ */ __name((_className) => {
      if (!hasClass(element, _className)) {
        if (element.classList) element.classList.add(_className);
        else element.className += " " + _className;
      }
    }, "fn");
    [className].flat().filter(Boolean).forEach((_classNames) => _classNames.split(" ").forEach(fn));
  }
}
__name(addClass, "addClass");
function calculateBodyScrollbarWidth() {
  return window.innerWidth - document.documentElement.offsetWidth;
}
__name(calculateBodyScrollbarWidth, "calculateBodyScrollbarWidth");
function getCSSVariableByRegex(variableRegex) {
  for (const sheet of document == null ? void 0 : document.styleSheets) {
    try {
      for (const rule of sheet == null ? void 0 : sheet.cssRules) {
        for (const property of rule == null ? void 0 : rule.style) {
          if (variableRegex.test(property)) {
            return { name: property, value: rule.style.getPropertyValue(property).trim() };
          }
        }
      }
    } catch (e2) {
    }
  }
  return null;
}
__name(getCSSVariableByRegex, "getCSSVariableByRegex");
function blockBodyScroll(className = "p-overflow-hidden") {
  const variableData = getCSSVariableByRegex(/-scrollbar-width$/);
  (variableData == null ? void 0 : variableData.name) && document.body.style.setProperty(variableData.name, calculateBodyScrollbarWidth() + "px");
  addClass(document.body, className);
}
__name(blockBodyScroll, "blockBodyScroll");
function saveAs(file) {
  if (file) {
    let link2 = document.createElement("a");
    if (link2.download !== void 0) {
      const { name: name2, src } = file;
      link2.setAttribute("href", src);
      link2.setAttribute("download", name2);
      link2.style.display = "none";
      document.body.appendChild(link2);
      link2.click();
      document.body.removeChild(link2);
      return true;
    }
  }
  return false;
}
__name(saveAs, "saveAs");
function exportCSV(csv, filename) {
  let blob = new Blob([csv], {
    type: "application/csv;charset=utf-8;"
  });
  if (window.navigator.msSaveOrOpenBlob) {
    navigator.msSaveOrOpenBlob(blob, filename + ".csv");
  } else {
    const isDownloaded = saveAs({ name: filename + ".csv", src: URL.createObjectURL(blob) });
    if (!isDownloaded) {
      csv = "data:text/csv;charset=utf-8," + csv;
      window.open(encodeURI(csv));
    }
  }
}
__name(exportCSV, "exportCSV");
function removeClass(element, className) {
  if (element && className) {
    const fn = /* @__PURE__ */ __name((_className) => {
      if (element.classList) element.classList.remove(_className);
      else element.className = element.className.replace(new RegExp("(^|\\b)" + _className.split(" ").join("|") + "(\\b|$)", "gi"), " ");
    }, "fn");
    [className].flat().filter(Boolean).forEach((_classNames) => _classNames.split(" ").forEach(fn));
  }
}
__name(removeClass, "removeClass");
function unblockBodyScroll(className = "p-overflow-hidden") {
  const variableData = getCSSVariableByRegex(/-scrollbar-width$/);
  (variableData == null ? void 0 : variableData.name) && document.body.style.removeProperty(variableData.name);
  removeClass(document.body, className);
}
__name(unblockBodyScroll, "unblockBodyScroll");
function getHiddenElementDimensions(element) {
  let dimensions = { width: 0, height: 0 };
  if (element) {
    element.style.visibility = "hidden";
    element.style.display = "block";
    dimensions.width = element.offsetWidth;
    dimensions.height = element.offsetHeight;
    element.style.display = "none";
    element.style.visibility = "visible";
  }
  return dimensions;
}
__name(getHiddenElementDimensions, "getHiddenElementDimensions");
function getViewport() {
  let win = window, d = document, e2 = d.documentElement, g2 = d.getElementsByTagName("body")[0], w = win.innerWidth || e2.clientWidth || g2.clientWidth, h2 = win.innerHeight || e2.clientHeight || g2.clientHeight;
  return { width: w, height: h2 };
}
__name(getViewport, "getViewport");
function getWindowScrollLeft() {
  let doc2 = document.documentElement;
  return (window.pageXOffset || doc2.scrollLeft) - (doc2.clientLeft || 0);
}
__name(getWindowScrollLeft, "getWindowScrollLeft");
function getWindowScrollTop() {
  let doc2 = document.documentElement;
  return (window.pageYOffset || doc2.scrollTop) - (doc2.clientTop || 0);
}
__name(getWindowScrollTop, "getWindowScrollTop");
function absolutePosition(element, target, gutter = true) {
  var _a2, _b, _c, _d;
  if (element) {
    const elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : getHiddenElementDimensions(element);
    const elementOuterHeight = elementDimensions.height;
    const elementOuterWidth = elementDimensions.width;
    const targetOuterHeight = target.offsetHeight;
    const targetOuterWidth = target.offsetWidth;
    const targetOffset = target.getBoundingClientRect();
    const windowScrollTop = getWindowScrollTop();
    const windowScrollLeft = getWindowScrollLeft();
    const viewport = getViewport();
    let top, left, origin2 = "top";
    if (targetOffset.top + targetOuterHeight + elementOuterHeight > viewport.height) {
      top = targetOffset.top + windowScrollTop - elementOuterHeight;
      origin2 = "bottom";
      if (top < 0) {
        top = windowScrollTop;
      }
    } else {
      top = targetOuterHeight + targetOffset.top + windowScrollTop;
    }
    if (targetOffset.left + elementOuterWidth > viewport.width) left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);
    else left = targetOffset.left + windowScrollLeft;
    element.style.top = top + "px";
    element.style.left = left + "px";
    element.style.transformOrigin = origin2;
    gutter && (element.style.marginTop = origin2 === "bottom" ? `calc(${(_b = (_a2 = getCSSVariableByRegex(/-anchor-gutter$/)) == null ? void 0 : _a2.value) != null ? _b : "2px"} * -1)` : (_d = (_c = getCSSVariableByRegex(/-anchor-gutter$/)) == null ? void 0 : _c.value) != null ? _d : "");
  }
}
__name(absolutePosition, "absolutePosition");
function addStyle(element, style2) {
  if (element) {
    if (typeof style2 === "string") {
      element.style.cssText = style2;
    } else {
      Object.entries(style2 || {}).forEach(([key, value4]) => element.style[key] = value4);
    }
  }
}
__name(addStyle, "addStyle");
function getOuterWidth(element, margin) {
  if (element instanceof HTMLElement) {
    let width2 = element.offsetWidth;
    if (margin) {
      let style2 = getComputedStyle(element);
      width2 += parseFloat(style2.marginLeft) + parseFloat(style2.marginRight);
    }
    return width2;
  }
  return 0;
}
__name(getOuterWidth, "getOuterWidth");
function relativePosition(element, target, gutter = true) {
  var _a2, _b, _c, _d;
  if (element) {
    const elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : getHiddenElementDimensions(element);
    const targetHeight = target.offsetHeight;
    const targetOffset = target.getBoundingClientRect();
    const viewport = getViewport();
    let top, left, origin2 = "top";
    if (targetOffset.top + targetHeight + elementDimensions.height > viewport.height) {
      top = -1 * elementDimensions.height;
      origin2 = "bottom";
      if (targetOffset.top + top < 0) {
        top = -1 * targetOffset.top;
      }
    } else {
      top = targetHeight;
    }
    if (elementDimensions.width > viewport.width) {
      left = targetOffset.left * -1;
    } else if (targetOffset.left + elementDimensions.width > viewport.width) {
      left = (targetOffset.left + elementDimensions.width - viewport.width) * -1;
    } else {
      left = 0;
    }
    element.style.top = top + "px";
    element.style.left = left + "px";
    element.style.transformOrigin = origin2;
    gutter && (element.style.marginTop = origin2 === "bottom" ? `calc(${(_b = (_a2 = getCSSVariableByRegex(/-anchor-gutter$/)) == null ? void 0 : _a2.value) != null ? _b : "2px"} * -1)` : (_d = (_c = getCSSVariableByRegex(/-anchor-gutter$/)) == null ? void 0 : _c.value) != null ? _d : "");
  }
}
__name(relativePosition, "relativePosition");
function alignOverlay(overlay, target, appendTo, calculateMinWidth = true) {
  if (overlay && target) {
    if (appendTo === "self") {
      relativePosition(overlay, target);
    } else {
      calculateMinWidth && (overlay.style.minWidth = getOuterWidth(target) + "px");
      absolutePosition(overlay, target);
    }
  }
}
__name(alignOverlay, "alignOverlay");
function isElement(element) {
  return typeof HTMLElement === "object" ? element instanceof HTMLElement : element && typeof element === "object" && element !== null && element.nodeType === 1 && typeof element.nodeName === "string";
}
__name(isElement, "isElement");
function toElement(element) {
  let target = element;
  if (element && typeof element === "object") {
    if (element.hasOwnProperty("current")) {
      target = element.current;
    } else if (element.hasOwnProperty("el")) {
      if (element.el.hasOwnProperty("nativeElement")) {
        target = element.el.nativeElement;
      } else {
        target = element.el;
      }
    }
  }
  return isElement(target) ? target : void 0;
}
__name(toElement, "toElement");
function appendChild(element, child) {
  const target = toElement(element);
  if (target) target.appendChild(child);
  else throw new Error("Cannot append " + child + " to " + element);
}
__name(appendChild, "appendChild");
var calculatedScrollbarHeight = void 0;
function calculateScrollbarHeight(element) {
  if (element) {
    let style2 = getComputedStyle(element);
    return element.offsetHeight - element.clientHeight - parseFloat(style2.borderTopWidth) - parseFloat(style2.borderBottomWidth);
  } else {
    if (calculatedScrollbarHeight != null) return calculatedScrollbarHeight;
    let scrollDiv = document.createElement("div");
    addStyle(scrollDiv, {
      width: "100px",
      height: "100px",
      overflow: "scroll",
      position: "absolute",
      top: "-9999px"
    });
    document.body.appendChild(scrollDiv);
    let scrollbarHeight = scrollDiv.offsetHeight - scrollDiv.clientHeight;
    document.body.removeChild(scrollDiv);
    calculatedScrollbarHeight = scrollbarHeight;
    return scrollbarHeight;
  }
}
__name(calculateScrollbarHeight, "calculateScrollbarHeight");
var calculatedScrollbarWidth = void 0;
function calculateScrollbarWidth(element) {
  if (element) {
    let style2 = getComputedStyle(element);
    return element.offsetWidth - element.clientWidth - parseFloat(style2.borderLeftWidth) - parseFloat(style2.borderRightWidth);
  } else {
    if (calculatedScrollbarWidth != null) return calculatedScrollbarWidth;
    let scrollDiv = document.createElement("div");
    addStyle(scrollDiv, {
      width: "100px",
      height: "100px",
      overflow: "scroll",
      position: "absolute",
      top: "-9999px"
    });
    document.body.appendChild(scrollDiv);
    let scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
    document.body.removeChild(scrollDiv);
    calculatedScrollbarWidth = scrollbarWidth;
    return scrollbarWidth;
  }
}
__name(calculateScrollbarWidth, "calculateScrollbarWidth");
function clearSelection() {
  if (window.getSelection) {
    const selection = window.getSelection() || {};
    if (selection.empty) {
      selection.empty();
    } else if (selection.removeAllRanges && selection.rangeCount > 0 && selection.getRangeAt(0).getClientRects().length > 0) {
      selection.removeAllRanges();
    }
  }
}
__name(clearSelection, "clearSelection");
function setAttributes(element, attributes = {}) {
  if (isElement(element)) {
    const computedStyles = /* @__PURE__ */ __name((rule, value4) => {
      var _a2, _b;
      const styles = ((_a2 = element == null ? void 0 : element.$attrs) == null ? void 0 : _a2[rule]) ? [(_b = element == null ? void 0 : element.$attrs) == null ? void 0 : _b[rule]] : [];
      return [value4].flat().reduce((cv, v2) => {
        if (v2 !== null && v2 !== void 0) {
          const type = typeof v2;
          if (type === "string" || type === "number") {
            cv.push(v2);
          } else if (type === "object") {
            const _cv = Array.isArray(v2) ? computedStyles(rule, v2) : Object.entries(v2).map(([_k, _v]) => rule === "style" && (!!_v || _v === 0) ? `${_k.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}:${_v}` : !!_v ? _k : void 0);
            cv = _cv.length ? cv.concat(_cv.filter((c) => !!c)) : cv;
          }
        }
        return cv;
      }, styles);
    }, "computedStyles");
    Object.entries(attributes).forEach(([key, value4]) => {
      if (value4 !== void 0 && value4 !== null) {
        const matchedEvent = key.match(/^on(.+)/);
        if (matchedEvent) {
          element.addEventListener(matchedEvent[1].toLowerCase(), value4);
        } else if (key === "p-bind") {
          setAttributes(element, value4);
        } else {
          value4 = key === "class" ? [...new Set(computedStyles("class", value4))].join(" ").trim() : key === "style" ? computedStyles("style", value4).join(";").trim() : value4;
          (element.$attrs = element.$attrs || {}) && (element.$attrs[key] = value4);
          element.setAttribute(key, value4);
        }
      }
    });
  }
}
__name(setAttributes, "setAttributes");
function createElement(type, attributes = {}, ...children) {
  if (type) {
    const element = document.createElement(type);
    setAttributes(element, attributes);
    element.append(...children);
    return element;
  }
  return void 0;
}
__name(createElement, "createElement");
function createStyleAsString(css3, options4 = {}) {
  return css3 ? `'<style type="text/css" ${Object.entries(options4).reduce((s, [k, v2]) => s + `${k}="${v2}"`, " ")}>${css3}</style>'` : "";
}
__name(createStyleAsString, "createStyleAsString");
function createStyleTag$1(attributes = {}, container) {
  let element = document.createElement("style");
  setAttributes(element, attributes);
  if (!container) {
    container = document.head;
  }
  container.appendChild(element);
  return element;
}
__name(createStyleTag$1, "createStyleTag$1");
function fadeIn(element, duration) {
  if (element) {
    element.style.opacity = "0";
    let last = +/* @__PURE__ */ new Date();
    let opacity = "0";
    let tick = /* @__PURE__ */ __name(function() {
      opacity = `${+element.style.opacity + ((/* @__PURE__ */ new Date()).getTime() - last) / duration}`;
      element.style.opacity = opacity;
      last = +/* @__PURE__ */ new Date();
      if (+opacity < 1) {
        !!window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 16);
      }
    }, "tick");
    tick();
  }
}
__name(fadeIn, "fadeIn");
function fadeOut(element, duration) {
  if (element) {
    let opacity = 1, interval = 50, gap = interval / duration;
    let fading = setInterval(() => {
      opacity -= gap;
      if (opacity <= 0) {
        opacity = 0;
        clearInterval(fading);
      }
      element.style.opacity = opacity.toString();
    }, interval);
  }
}
__name(fadeOut, "fadeOut");
function find$1(element, selector) {
  return isElement(element) ? Array.from(element.querySelectorAll(selector)) : [];
}
__name(find$1, "find$1");
function findSingle(element, selector) {
  return isElement(element) ? element.matches(selector) ? element : element.querySelector(selector) : null;
}
__name(findSingle, "findSingle");
function focus$1(element, options4) {
  element && document.activeElement !== element && element.focus(options4);
}
__name(focus$1, "focus$1");
function getAttribute(element, name2) {
  if (isElement(element)) {
    const value4 = element.getAttribute(name2);
    if (!isNaN(value4)) {
      return +value4;
    }
    if (value4 === "true" || value4 === "false") {
      return value4 === "true";
    }
    return value4;
  }
  return void 0;
}
__name(getAttribute, "getAttribute");
function resolveUserAgent() {
  let ua = navigator.userAgent.toLowerCase();
  let match2 = /(chrome)[ ]([\w.]+)/.exec(ua) || /(webkit)[ ]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ ]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || [];
  return {
    browser: match2[1] || "",
    version: match2[2] || "0"
  };
}
__name(resolveUserAgent, "resolveUserAgent");
var browser = null;
function getBrowser() {
  if (!browser) {
    browser = {};
    let matched = resolveUserAgent();
    if (matched.browser) {
      browser[matched.browser] = true;
      browser["version"] = matched.version;
    }
    if (browser["chrome"]) {
      browser["webkit"] = true;
    } else if (browser["webkit"]) {
      browser["safari"] = true;
    }
  }
  return browser;
}
__name(getBrowser, "getBrowser");
function getCursorOffset(element, prevText, nextText, currentText) {
  if (element) {
    let style2 = getComputedStyle(element);
    let ghostDiv = document.createElement("div");
    ghostDiv.style.position = "absolute";
    ghostDiv.style.top = "0px";
    ghostDiv.style.left = "0px";
    ghostDiv.style.visibility = "hidden";
    ghostDiv.style.pointerEvents = "none";
    ghostDiv.style.overflow = style2.overflow;
    ghostDiv.style.width = style2.width;
    ghostDiv.style.height = style2.height;
    ghostDiv.style.padding = style2.padding;
    ghostDiv.style.border = style2.border;
    ghostDiv.style.overflowWrap = style2.overflowWrap;
    ghostDiv.style.whiteSpace = style2.whiteSpace;
    ghostDiv.style.lineHeight = style2.lineHeight;
    ghostDiv.innerHTML = prevText.replace(/\r\n|\r|\n/g, "<br />");
    let ghostSpan = document.createElement("span");
    ghostSpan.textContent = currentText;
    ghostDiv.appendChild(ghostSpan);
    let text2 = document.createTextNode(nextText);
    ghostDiv.appendChild(text2);
    document.body.appendChild(ghostDiv);
    const { offsetLeft, offsetTop, clientHeight } = ghostSpan;
    document.body.removeChild(ghostDiv);
    return {
      left: Math.abs(offsetLeft - element.scrollLeft),
      top: Math.abs(offsetTop - element.scrollTop) + clientHeight
    };
  }
  return {
    top: "auto",
    left: "auto"
  };
}
__name(getCursorOffset, "getCursorOffset");
function getFocusableElements(element, selector = "") {
  let focusableElements = find$1(
    element,
    `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector}`
  );
  let visibleFocusableElements = [];
  for (let focusableElement of focusableElements) {
    if (getComputedStyle(focusableElement).display != "none" && getComputedStyle(focusableElement).visibility != "hidden") visibleFocusableElements.push(focusableElement);
  }
  return visibleFocusableElements;
}
__name(getFocusableElements, "getFocusableElements");
function getFirstFocusableElement(element, selector) {
  const focusableElements = getFocusableElements(element, selector);
  return focusableElements.length > 0 ? focusableElements[0] : null;
}
__name(getFirstFocusableElement, "getFirstFocusableElement");
function getHeight(element) {
  if (element) {
    let height = element.offsetHeight;
    let style2 = getComputedStyle(element);
    height -= parseFloat(style2.paddingTop) + parseFloat(style2.paddingBottom) + parseFloat(style2.borderTopWidth) + parseFloat(style2.borderBottomWidth);
    return height;
  }
  return 0;
}
__name(getHeight, "getHeight");
function getHiddenElementOuterHeight(element) {
  if (element) {
    element.style.visibility = "hidden";
    element.style.display = "block";
    let elementHeight = element.offsetHeight;
    element.style.display = "none";
    element.style.visibility = "visible";
    return elementHeight;
  }
  return 0;
}
__name(getHiddenElementOuterHeight, "getHiddenElementOuterHeight");
function getHiddenElementOuterWidth(element) {
  if (element) {
    element.style.visibility = "hidden";
    element.style.display = "block";
    let elementWidth = element.offsetWidth;
    element.style.display = "none";
    element.style.visibility = "visible";
    return elementWidth;
  }
  return 0;
}
__name(getHiddenElementOuterWidth, "getHiddenElementOuterWidth");
function getParentNode(element) {
  if (element) {
    let parent = element.parentNode;
    if (parent && parent instanceof ShadowRoot && parent.host) {
      parent = parent.host;
    }
    return parent;
  }
  return null;
}
__name(getParentNode, "getParentNode");
function getIndex(element) {
  var _a2;
  if (element) {
    let children = (_a2 = getParentNode(element)) == null ? void 0 : _a2.childNodes;
    let num = 0;
    if (children) {
      for (let i2 = 0; i2 < children.length; i2++) {
        if (children[i2] === element) return num;
        if (children[i2].nodeType === 1) num++;
      }
    }
  }
  return -1;
}
__name(getIndex, "getIndex");
function getInnerWidth(element) {
  if (element) {
    let width2 = element.offsetWidth;
    let style2 = getComputedStyle(element);
    width2 -= parseFloat(style2.borderLeft) + parseFloat(style2.borderRight);
    return width2;
  }
  return 0;
}
__name(getInnerWidth, "getInnerWidth");
function getLastFocusableElement(element, selector) {
  const focusableElements = getFocusableElements(element, selector);
  return focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;
}
__name(getLastFocusableElement, "getLastFocusableElement");
function getNextElementSibling(element, selector) {
  let nextElement = element.nextElementSibling;
  while (nextElement) {
    if (nextElement.matches(selector)) {
      return nextElement;
    } else {
      nextElement = nextElement.nextElementSibling;
    }
  }
  return null;
}
__name(getNextElementSibling, "getNextElementSibling");
function getNextFocusableElement(container, element, selector) {
  const focusableElements = getFocusableElements(container, selector);
  const index2 = focusableElements.length > 0 ? focusableElements.findIndex((el) => el === element) : -1;
  const nextIndex = index2 > -1 && focusableElements.length >= index2 + 1 ? index2 + 1 : -1;
  return nextIndex > -1 ? focusableElements[nextIndex] : null;
}
__name(getNextFocusableElement, "getNextFocusableElement");
function getOffset(element) {
  if (element) {
    let rect = element.getBoundingClientRect();
    return {
      top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
      left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
    };
  }
  return {
    top: "auto",
    left: "auto"
  };
}
__name(getOffset, "getOffset");
function getOuterHeight(element, margin) {
  if (element) {
    let height = element.offsetHeight;
    if (margin) {
      let style2 = getComputedStyle(element);
      height += parseFloat(style2.marginTop) + parseFloat(style2.marginBottom);
    }
    return height;
  }
  return 0;
}
__name(getOuterHeight, "getOuterHeight");
function getParents(element, parents = []) {
  const parent = getParentNode(element);
  return parent === null ? parents : getParents(parent, parents.concat([parent]));
}
__name(getParents, "getParents");
function getPreviousElementSibling(element, selector) {
  let previousElement = element.previousElementSibling;
  while (previousElement) {
    if (previousElement.matches(selector)) {
      return previousElement;
    } else {
      previousElement = previousElement.previousElementSibling;
    }
  }
  return null;
}
__name(getPreviousElementSibling, "getPreviousElementSibling");
function getScrollableParents(element) {
  let scrollableParents = [];
  if (element) {
    let parents = getParents(element);
    const overflowRegex = /(auto|scroll)/;
    const overflowCheck = /* @__PURE__ */ __name((node3) => {
      try {
        let styleDeclaration = window["getComputedStyle"](node3, null);
        return overflowRegex.test(styleDeclaration.getPropertyValue("overflow")) || overflowRegex.test(styleDeclaration.getPropertyValue("overflowX")) || overflowRegex.test(styleDeclaration.getPropertyValue("overflowY"));
      } catch (err) {
        return false;
      }
    }, "overflowCheck");
    for (let parent of parents) {
      let scrollSelectors = parent.nodeType === 1 && parent.dataset["scrollselectors"];
      if (scrollSelectors) {
        let selectors = scrollSelectors.split(",");
        for (let selector of selectors) {
          let el = findSingle(parent, selector);
          if (el && overflowCheck(el)) {
            scrollableParents.push(el);
          }
        }
      }
      if (parent.nodeType !== 9 && overflowCheck(parent)) {
        scrollableParents.push(parent);
      }
    }
  }
  return scrollableParents;
}
__name(getScrollableParents, "getScrollableParents");
function getSelection$1() {
  if (window.getSelection) return window.getSelection().toString();
  else if (document.getSelection) return document.getSelection().toString();
  return void 0;
}
__name(getSelection$1, "getSelection$1");
function isExist(element) {
  return !!(element !== null && typeof element !== "undefined" && element.nodeName && getParentNode(element));
}
__name(isExist, "isExist");
function getTargetElement(target, currentElement) {
  var _a2;
  if (!target) return void 0;
  switch (target) {
    case "document":
      return document;
    case "window":
      return window;
    case "@next":
      return currentElement == null ? void 0 : currentElement.nextElementSibling;
    case "@prev":
      return currentElement == null ? void 0 : currentElement.previousElementSibling;
    case "@parent":
      return currentElement == null ? void 0 : currentElement.parentElement;
    case "@grandparent":
      return (_a2 = currentElement == null ? void 0 : currentElement.parentElement) == null ? void 0 : _a2.parentElement;
    default:
      if (typeof target === "string") {
        return document.querySelector(target);
      }
      const isFunction2 = /* @__PURE__ */ __name((obj) => !!(obj && obj.constructor && obj.call && obj.apply), "isFunction");
      const element = toElement(isFunction2(target) ? target() : target);
      return (element == null ? void 0 : element.nodeType) === 9 || isExist(element) ? element : void 0;
  }
}
__name(getTargetElement, "getTargetElement");
function getUserAgent() {
  return navigator.userAgent;
}
__name(getUserAgent, "getUserAgent");
function getWidth(element) {
  if (element) {
    let width2 = element.offsetWidth;
    let style2 = getComputedStyle(element);
    width2 -= parseFloat(style2.paddingLeft) + parseFloat(style2.paddingRight) + parseFloat(style2.borderLeftWidth) + parseFloat(style2.borderRightWidth);
    return width2;
  }
  return 0;
}
__name(getWidth, "getWidth");
function hasCSSAnimation(element) {
  if (element) {
    const style2 = getComputedStyle(element);
    const animationDuration = parseFloat(style2.getPropertyValue("animation-duration") || "0");
    return animationDuration > 0;
  }
  return false;
}
__name(hasCSSAnimation, "hasCSSAnimation");
function hasCSSTransition(element) {
  if (element) {
    const style2 = getComputedStyle(element);
    const transitionDuration = parseFloat(style2.getPropertyValue("transition-duration") || "0");
    return transitionDuration > 0;
  }
  return false;
}
__name(hasCSSTransition, "hasCSSTransition");
function invokeElementMethod(element, methodName, args) {
  element[methodName].apply(element, args);
}
__name(invokeElementMethod, "invokeElementMethod");
function isAndroid$2() {
  return /(android)/i.test(navigator.userAgent);
}
__name(isAndroid$2, "isAndroid$2");
function isAttributeEquals(element, name2, value4) {
  return isElement(element) ? getAttribute(element, name2) === value4 : false;
}
__name(isAttributeEquals, "isAttributeEquals");
function isAttributeNotEquals(element, name2, value4) {
  return !isAttributeEquals(element, name2, value4);
}
__name(isAttributeNotEquals, "isAttributeNotEquals");
function isClickable(element) {
  if (element) {
    const targetNode = element.nodeName;
    const parentNode2 = element.parentElement && element.parentElement.nodeName;
    return targetNode === "INPUT" || targetNode === "TEXTAREA" || targetNode === "BUTTON" || targetNode === "A" || parentNode2 === "INPUT" || parentNode2 === "TEXTAREA" || parentNode2 === "BUTTON" || parentNode2 === "A" || !!element.closest(".p-button, .p-checkbox, .p-radiobutton");
  }
  return false;
}
__name(isClickable, "isClickable");
function isClient$1() {
  return !!(typeof window !== "undefined" && window.document && window.document.createElement);
}
__name(isClient$1, "isClient$1");
function isFocusableElement(element, selector = "") {
  return isElement(element) ? element.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
            [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector}`) : false;
}
__name(isFocusableElement, "isFocusableElement");
function isVisible(element) {
  return !!(element && element.offsetParent != null);
}
__name(isVisible, "isVisible");
function isHidden(element) {
  return !isVisible(element);
}
__name(isHidden, "isHidden");
function isIOS$1() {
  return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window["MSStream"];
}
__name(isIOS$1, "isIOS$1");
function isTouchDevice() {
  return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
}
__name(isTouchDevice, "isTouchDevice");
function nestedPosition(element, level) {
  var _a2;
  if (element) {
    const parentItem = element.parentElement;
    const elementOffset = getOffset(parentItem);
    const viewport = getViewport();
    const sublistWidth = element.offsetParent ? element.offsetWidth : getHiddenElementOuterWidth(element);
    const itemOuterWidth = getOuterWidth((_a2 = parentItem == null ? void 0 : parentItem.children) == null ? void 0 : _a2[0]);
    let left = "";
    if (elementOffset.left + itemOuterWidth + sublistWidth > viewport.width - calculateScrollbarWidth()) {
      if (elementOffset.left < sublistWidth) {
        if (level % 2 === 1) {
          left = elementOffset.left ? "-" + elementOffset.left + "px" : "100%";
        } else if (level % 2 === 0) {
          left = viewport.width - sublistWidth - calculateScrollbarWidth() + "px";
        }
      } else {
        left = "-100%";
      }
    } else {
      left = "100%";
    }
    element.style.top = "0px";
    element.style.left = left;
  }
}
__name(nestedPosition, "nestedPosition");
function remove(element) {
  var _a2;
  if (element) {
    if (!("remove" in Element.prototype)) (_a2 = element.parentNode) == null ? void 0 : _a2.removeChild(element);
    else element.remove();
  }
}
__name(remove, "remove");
function removeChild(element, child) {
  const target = toElement(element);
  if (target) target.removeChild(child);
  else throw new Error("Cannot remove " + child + " from " + element);
}
__name(removeChild, "removeChild");
function removeStyleTag(element) {
  var _a2;
  if (isExist(element)) {
    try {
      (_a2 = element.parentNode) == null ? void 0 : _a2.removeChild(element);
    } catch (error2) {
    }
    return null;
  }
  return element;
}
__name(removeStyleTag, "removeStyleTag");
function scrollInView(container, item3) {
  let borderTopValue = getComputedStyle(container).getPropertyValue("borderTopWidth");
  let borderTop = borderTopValue ? parseFloat(borderTopValue) : 0;
  let paddingTopValue = getComputedStyle(container).getPropertyValue("paddingTop");
  let paddingTop = paddingTopValue ? parseFloat(paddingTopValue) : 0;
  let containerRect = container.getBoundingClientRect();
  let itemRect = item3.getBoundingClientRect();
  let offset = itemRect.top + document.body.scrollTop - (containerRect.top + document.body.scrollTop) - borderTop - paddingTop;
  let scroll = container.scrollTop;
  let elementHeight = container.clientHeight;
  let itemHeight = getOuterHeight(item3);
  if (offset < 0) {
    container.scrollTop = scroll + offset;
  } else if (offset + itemHeight > elementHeight) {
    container.scrollTop = scroll + offset - elementHeight + itemHeight;
  }
}
__name(scrollInView, "scrollInView");
function setAttribute(element, attribute2 = "", value4) {
  if (isElement(element) && value4 !== null && value4 !== void 0) {
    element.setAttribute(attribute2, value4);
  }
}
__name(setAttribute, "setAttribute");
function _typeof$l(o) {
  "@babel/helpers - typeof";
  return _typeof$l = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$l(o);
}
__name(_typeof$l, "_typeof$l");
function ownKeys$j(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$j, "ownKeys$j");
function _objectSpread$j(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$j(Object(t2), true).forEach(function(r2) {
      _defineProperty$l(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$j(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$j, "_objectSpread$j");
function _defineProperty$l(e2, r, t2) {
  return (r = _toPropertyKey$k(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$l, "_defineProperty$l");
function _toPropertyKey$k(t2) {
  var i2 = _toPrimitive$k(t2, "string");
  return "symbol" == _typeof$l(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$k, "_toPropertyKey$k");
function _toPrimitive$k(t2, r) {
  if ("object" != _typeof$l(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$l(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$k, "_toPrimitive$k");
function tryOnMounted$1(fn) {
  var sync = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
  if (getCurrentInstance()) onMounted(fn);
  else if (sync) fn();
  else nextTick(fn);
}
__name(tryOnMounted$1, "tryOnMounted$1");
var _id$1 = 0;
function useStyle(css3) {
  var options4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  var isLoaded = ref(false);
  var cssRef = ref(css3);
  var styleRef = ref(null);
  var defaultDocument2 = isClient$1() ? window.document : void 0;
  var _options$document = options4.document, document2 = _options$document === void 0 ? defaultDocument2 : _options$document, _options$immediate = options4.immediate, immediate = _options$immediate === void 0 ? true : _options$immediate, _options$manual = options4.manual, manual = _options$manual === void 0 ? false : _options$manual, _options$name = options4.name, name2 = _options$name === void 0 ? "style_".concat(++_id$1) : _options$name, _options$id = options4.id, id3 = _options$id === void 0 ? void 0 : _options$id, _options$media = options4.media, media = _options$media === void 0 ? void 0 : _options$media, _options$nonce = options4.nonce, nonce = _options$nonce === void 0 ? void 0 : _options$nonce, _options$first = options4.first, first2 = _options$first === void 0 ? false : _options$first, _options$onMounted = options4.onMounted, onStyleMounted = _options$onMounted === void 0 ? void 0 : _options$onMounted, _options$onUpdated = options4.onUpdated, onStyleUpdated = _options$onUpdated === void 0 ? void 0 : _options$onUpdated, _options$onLoad = options4.onLoad, onStyleLoaded = _options$onLoad === void 0 ? void 0 : _options$onLoad, _options$props = options4.props, props = _options$props === void 0 ? {} : _options$props;
  var stop2 = /* @__PURE__ */ __name(function stop3() {
  }, "stop");
  var load2 = /* @__PURE__ */ __name(function load3(_css) {
    var _props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (!document2) return;
    var _styleProps = _objectSpread$j(_objectSpread$j({}, props), _props);
    var _name = _styleProps.name || name2, _id2 = _styleProps.id || id3, _nonce = _styleProps.nonce || nonce;
    styleRef.value = document2.querySelector('style[data-primevue-style-id="'.concat(_name, '"]')) || document2.getElementById(_id2) || document2.createElement("style");
    if (!styleRef.value.isConnected) {
      cssRef.value = _css || css3;
      setAttributes(styleRef.value, {
        type: "text/css",
        id: _id2,
        media,
        nonce: _nonce
      });
      first2 ? document2.head.prepend(styleRef.value) : document2.head.appendChild(styleRef.value);
      setAttribute(styleRef.value, "data-primevue-style-id", _name);
      setAttributes(styleRef.value, _styleProps);
      styleRef.value.onload = function(event) {
        return onStyleLoaded === null || onStyleLoaded === void 0 ? void 0 : onStyleLoaded(event, {
          name: _name
        });
      };
      onStyleMounted === null || onStyleMounted === void 0 || onStyleMounted(_name);
    }
    if (isLoaded.value) return;
    stop2 = watch(cssRef, function(value4) {
      styleRef.value.textContent = value4;
      onStyleUpdated === null || onStyleUpdated === void 0 || onStyleUpdated(_name);
    }, {
      immediate: true
    });
    isLoaded.value = true;
  }, "load");
  var unload = /* @__PURE__ */ __name(function unload2() {
    if (!document2 || !isLoaded.value) return;
    stop2();
    isExist(styleRef.value) && document2.head.removeChild(styleRef.value);
    isLoaded.value = false;
  }, "unload");
  if (immediate && !manual) tryOnMounted$1(load2);
  return {
    id: id3,
    name: name2,
    el: styleRef,
    css: cssRef,
    unload,
    load: load2,
    isLoaded: readonly(isLoaded)
  };
}
__name(useStyle, "useStyle");
function _typeof$k(o) {
  "@babel/helpers - typeof";
  return _typeof$k = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$k(o);
}
__name(_typeof$k, "_typeof$k");
function _slicedToArray$4(r, e2) {
  return _arrayWithHoles$4(r) || _iterableToArrayLimit$4(r, e2) || _unsupportedIterableToArray$i(r, e2) || _nonIterableRest$4();
}
__name(_slicedToArray$4, "_slicedToArray$4");
function _nonIterableRest$4() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableRest$4, "_nonIterableRest$4");
function _unsupportedIterableToArray$i(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$i(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$i(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$i, "_unsupportedIterableToArray$i");
function _arrayLikeToArray$i(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$i, "_arrayLikeToArray$i");
function _iterableToArrayLimit$4(r, l) {
  var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (null != t2) {
    var e2, n, i2, u, a = [], f = true, o = false;
    try {
      if (i2 = (t2 = t2.call(r)).next, 0 === l) ;
      else for (; !(f = (e2 = i2.call(t2)).done) && (a.push(e2.value), a.length !== l); f = true) ;
    } catch (r2) {
      o = true, n = r2;
    } finally {
      try {
        if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
      } finally {
        if (o) throw n;
      }
    }
    return a;
  }
}
__name(_iterableToArrayLimit$4, "_iterableToArrayLimit$4");
function _arrayWithHoles$4(r) {
  if (Array.isArray(r)) return r;
}
__name(_arrayWithHoles$4, "_arrayWithHoles$4");
function ownKeys$i(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$i, "ownKeys$i");
function _objectSpread$i(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$i(Object(t2), true).forEach(function(r2) {
      _defineProperty$k(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$i(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$i, "_objectSpread$i");
function _defineProperty$k(e2, r, t2) {
  return (r = _toPropertyKey$j(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$k, "_defineProperty$k");
function _toPropertyKey$j(t2) {
  var i2 = _toPrimitive$j(t2, "string");
  return "symbol" == _typeof$k(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$j, "_toPropertyKey$j");
function _toPrimitive$j(t2, r) {
  if ("object" != _typeof$k(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$k(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$j, "_toPrimitive$j");
var theme$B = /* @__PURE__ */ __name(function theme2(_ref) {
  var dt2 = _ref.dt;
  return "\n* {\n    box-sizing: border-box;\n}\n\n/* Non vue overlay animations */\n.p-connected-overlay {\n    opacity: 0;\n    transform: scaleY(0.8);\n    transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1),\n        opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.p-connected-overlay-visible {\n    opacity: 1;\n    transform: scaleY(1);\n}\n\n.p-connected-overlay-hidden {\n    opacity: 0;\n    transform: scaleY(1);\n    transition: opacity 0.1s linear;\n}\n\n/* Vue based overlay animations */\n.p-connected-overlay-enter-from {\n    opacity: 0;\n    transform: scaleY(0.8);\n}\n\n.p-connected-overlay-leave-to {\n    opacity: 0;\n}\n\n.p-connected-overlay-enter-active {\n    transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1),\n        opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.p-connected-overlay-leave-active {\n    transition: opacity 0.1s linear;\n}\n\n/* Toggleable Content */\n.p-toggleable-content-enter-from,\n.p-toggleable-content-leave-to {\n    max-height: 0;\n}\n\n.p-toggleable-content-enter-to,\n.p-toggleable-content-leave-from {\n    max-height: 1000px;\n}\n\n.p-toggleable-content-leave-active {\n    overflow: hidden;\n    transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);\n}\n\n.p-toggleable-content-enter-active {\n    overflow: hidden;\n    transition: max-height 1s ease-in-out;\n}\n\n.p-disabled,\n.p-disabled * {\n    cursor: default;\n    pointer-events: none;\n    user-select: none;\n}\n\n.p-disabled,\n.p-component:disabled {\n    opacity: ".concat(dt2("disabled.opacity"), ";\n}\n\n.pi {\n    font-size: ").concat(dt2("icon.size"), ";\n}\n\n.p-icon {\n    width: ").concat(dt2("icon.size"), ";\n    height: ").concat(dt2("icon.size"), ";\n}\n\n.p-overlay-mask {\n    background: ").concat(dt2("mask.background"), ";\n    color: ").concat(dt2("mask.color"), ";\n    position: fixed;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n}\n\n.p-overlay-mask-enter {\n    animation: p-overlay-mask-enter-animation ").concat(dt2("mask.transition.duration"), " forwards;\n}\n\n.p-overlay-mask-leave {\n    animation: p-overlay-mask-leave-animation ").concat(dt2("mask.transition.duration"), " forwards;\n}\n\n@keyframes p-overlay-mask-enter-animation {\n    from {\n        background: transparent;\n    }\n    to {\n        background: ").concat(dt2("mask.background"), ";\n    }\n}\n@keyframes p-overlay-mask-leave-animation {\n    from {\n        background: ").concat(dt2("mask.background"), ";\n    }\n    to {\n        background: transparent;\n    }\n}\n");
}, "theme");
var css$1 = /* @__PURE__ */ __name(function css2(_ref2) {
  var dt2 = _ref2.dt;
  return "\n.p-hidden-accessible {\n    border: 0;\n    clip: rect(0 0 0 0);\n    height: 1px;\n    margin: -1px;\n    overflow: hidden;\n    padding: 0;\n    position: absolute;\n    width: 1px;\n}\n\n.p-hidden-accessible input,\n.p-hidden-accessible select {\n    transform: scale(0);\n}\n\n.p-overflow-hidden {\n    overflow: hidden;\n    padding-right: ".concat(dt2("scrollbar.width"), ";\n}\n");
}, "css");
var classes$D = {};
var inlineStyles$4 = {};
var BaseStyle = {
  name: "base",
  css: css$1,
  theme: theme$B,
  classes: classes$D,
  inlineStyles: inlineStyles$4,
  load: /* @__PURE__ */ __name(function load(style2) {
    var options4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var transform2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(cs) {
      return cs;
    };
    var computedStyle = transform2(resolve$1(style2, {
      dt
    }));
    return computedStyle ? useStyle(minifyCSS(computedStyle), _objectSpread$i({
      name: this.name
    }, options4)) : {};
  }, "load"),
  loadCSS: /* @__PURE__ */ __name(function loadCSS() {
    var options4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    return this.load(this.css, options4);
  }, "loadCSS"),
  loadTheme: /* @__PURE__ */ __name(function loadTheme() {
    var _this = this;
    var options4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    return this.load(this.theme, options4, function(computedStyle) {
      return config_default.transformCSS(options4.name || _this.name, computedStyle);
    });
  }, "loadTheme"),
  getCommonTheme: /* @__PURE__ */ __name(function getCommonTheme(params) {
    return config_default.getCommon(this.name, params);
  }, "getCommonTheme"),
  getComponentTheme: /* @__PURE__ */ __name(function getComponentTheme(params) {
    return config_default.getComponent(this.name, params);
  }, "getComponentTheme"),
  getDirectiveTheme: /* @__PURE__ */ __name(function getDirectiveTheme(params) {
    return config_default.getDirective(this.name, params);
  }, "getDirectiveTheme"),
  getPresetTheme: /* @__PURE__ */ __name(function getPresetTheme(preset, selector, params) {
    return config_default.getCustomPreset(this.name, preset, selector, params);
  }, "getPresetTheme"),
  getLayerOrderThemeCSS: /* @__PURE__ */ __name(function getLayerOrderThemeCSS() {
    return config_default.getLayerOrderCSS(this.name);
  }, "getLayerOrderThemeCSS"),
  getStyleSheet: /* @__PURE__ */ __name(function getStyleSheet() {
    var extendedCSS = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
    var props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (this.css) {
      var _css = resolve$1(this.css, {
        dt
      });
      var _style = minifyCSS("".concat(_css).concat(extendedCSS));
      var _props = Object.entries(props).reduce(function(acc, _ref3) {
        var _ref4 = _slicedToArray$4(_ref3, 2), k = _ref4[0], v2 = _ref4[1];
        return acc.push("".concat(k, '="').concat(v2, '"')) && acc;
      }, []).join(" ");
      return '<style type="text/css" data-primevue-style-id="'.concat(this.name, '" ').concat(_props, ">").concat(_style, "</style>");
    }
    return "";
  }, "getStyleSheet"),
  getCommonThemeStyleSheet: /* @__PURE__ */ __name(function getCommonThemeStyleSheet(params) {
    var props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return config_default.getCommonStyleSheet(this.name, params, props);
  }, "getCommonThemeStyleSheet"),
  getThemeStyleSheet: /* @__PURE__ */ __name(function getThemeStyleSheet(params) {
    var props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var css3 = [config_default.getStyleSheet(this.name, params, props)];
    if (this.theme) {
      var name2 = this.name === "base" ? "global-style" : "".concat(this.name, "-style");
      var _css = resolve$1(this.theme, {
        dt
      });
      var _style = minifyCSS(config_default.transformCSS(name2, _css));
      var _props = Object.entries(props).reduce(function(acc, _ref5) {
        var _ref6 = _slicedToArray$4(_ref5, 2), k = _ref6[0], v2 = _ref6[1];
        return acc.push("".concat(k, '="').concat(v2, '"')) && acc;
      }, []).join(" ");
      css3.push('<style type="text/css" data-primevue-style-id="'.concat(name2, '" ').concat(_props, ">").concat(_style, "</style>"));
    }
    return css3.join("");
  }, "getThemeStyleSheet"),
  extend: /* @__PURE__ */ __name(function extend2(style2) {
    return _objectSpread$i(_objectSpread$i({}, this), {}, {
      css: void 0,
      theme: void 0
    }, style2);
  }, "extend")
};
var PrimeVueService = EventBus();
var lastIds = {};
function uuid(prefix2 = "pui_id_") {
  if (!lastIds.hasOwnProperty(prefix2)) {
    lastIds[prefix2] = 0;
  }
  lastIds[prefix2]++;
  return `${prefix2}${lastIds[prefix2]}`;
}
__name(uuid, "uuid");
function handler() {
  let zIndexes = [];
  const generateZIndex = /* @__PURE__ */ __name((key, autoZIndex, baseZIndex = 999) => {
    const lastZIndex = getLastZIndex(key, autoZIndex, baseZIndex);
    const newZIndex = lastZIndex.value + (lastZIndex.key === key ? 0 : baseZIndex) + 1;
    zIndexes.push({ key, value: newZIndex });
    return newZIndex;
  }, "generateZIndex");
  const revertZIndex = /* @__PURE__ */ __name((zIndex) => {
    zIndexes = zIndexes.filter((obj) => obj.value !== zIndex);
  }, "revertZIndex");
  const getCurrentZIndex = /* @__PURE__ */ __name((key, autoZIndex) => {
    return getLastZIndex(key, autoZIndex).value;
  }, "getCurrentZIndex");
  const getLastZIndex = /* @__PURE__ */ __name((key, autoZIndex, baseZIndex = 0) => {
    return [...zIndexes].reverse().find((obj) => autoZIndex ? true : obj.key === key) || { key, value: baseZIndex };
  }, "getLastZIndex");
  const getZIndex = /* @__PURE__ */ __name((element) => {
    return element ? parseInt(element.style.zIndex, 10) || 0 : 0;
  }, "getZIndex");
  return {
    get: getZIndex,
    set: /* @__PURE__ */ __name((key, element, baseZIndex) => {
      if (element) {
        element.style.zIndex = String(generateZIndex(key, true, baseZIndex));
      }
    }, "set"),
    clear: /* @__PURE__ */ __name((element) => {
      if (element) {
        revertZIndex(getZIndex(element));
        element.style.zIndex = "";
      }
    }, "clear"),
    getCurrent: /* @__PURE__ */ __name((key) => getCurrentZIndex(key, true), "getCurrent")
  };
}
__name(handler, "handler");
var ZIndex = handler();
function _typeof$j(o) {
  "@babel/helpers - typeof";
  return _typeof$j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$j(o);
}
__name(_typeof$j, "_typeof$j");
function ownKeys$h(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$h, "ownKeys$h");
function _objectSpread$h(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$h(Object(t2), true).forEach(function(r2) {
      _defineProperty$j(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$h(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$h, "_objectSpread$h");
function _defineProperty$j(e2, r, t2) {
  return (r = _toPropertyKey$i(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$j, "_defineProperty$j");
function _toPropertyKey$i(t2) {
  var i2 = _toPrimitive$i(t2, "string");
  return "symbol" == _typeof$j(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$i, "_toPropertyKey$i");
function _toPrimitive$i(t2, r) {
  if ("object" != _typeof$j(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$j(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$i, "_toPrimitive$i");
var defaultOptions$2 = {
  ripple: false,
  inputStyle: null,
  inputVariant: null,
  locale: {
    startsWith: "Starts with",
    contains: "Contains",
    notContains: "Not contains",
    endsWith: "Ends with",
    equals: "Equals",
    notEquals: "Not equals",
    noFilter: "No Filter",
    lt: "Less than",
    lte: "Less than or equal to",
    gt: "Greater than",
    gte: "Greater than or equal to",
    dateIs: "Date is",
    dateIsNot: "Date is not",
    dateBefore: "Date is before",
    dateAfter: "Date is after",
    clear: "Clear",
    apply: "Apply",
    matchAll: "Match All",
    matchAny: "Match Any",
    addRule: "Add Rule",
    removeRule: "Remove Rule",
    accept: "Yes",
    reject: "No",
    choose: "Choose",
    upload: "Upload",
    cancel: "Cancel",
    completed: "Completed",
    pending: "Pending",
    fileSizeTypes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
    dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
    dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
    monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
    monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
    chooseYear: "Choose Year",
    chooseMonth: "Choose Month",
    chooseDate: "Choose Date",
    prevDecade: "Previous Decade",
    nextDecade: "Next Decade",
    prevYear: "Previous Year",
    nextYear: "Next Year",
    prevMonth: "Previous Month",
    nextMonth: "Next Month",
    prevHour: "Previous Hour",
    nextHour: "Next Hour",
    prevMinute: "Previous Minute",
    nextMinute: "Next Minute",
    prevSecond: "Previous Second",
    nextSecond: "Next Second",
    am: "am",
    pm: "pm",
    today: "Today",
    weekHeader: "Wk",
    firstDayOfWeek: 0,
    showMonthAfterYear: false,
    dateFormat: "mm/dd/yy",
    weak: "Weak",
    medium: "Medium",
    strong: "Strong",
    passwordPrompt: "Enter a password",
    emptyFilterMessage: "No results found",
    searchMessage: "{0} results are available",
    selectionMessage: "{0} items selected",
    emptySelectionMessage: "No selected item",
    emptySearchMessage: "No results found",
    fileChosenMessage: "{0} files",
    noFileChosenMessage: "No file chosen",
    emptyMessage: "No available options",
    aria: {
      trueLabel: "True",
      falseLabel: "False",
      nullLabel: "Not Selected",
      star: "1 star",
      stars: "{star} stars",
      selectAll: "All items selected",
      unselectAll: "All items unselected",
      close: "Close",
      previous: "Previous",
      next: "Next",
      navigation: "Navigation",
      scrollTop: "Scroll Top",
      moveTop: "Move Top",
      moveUp: "Move Up",
      moveDown: "Move Down",
      moveBottom: "Move Bottom",
      moveToTarget: "Move to Target",
      moveToSource: "Move to Source",
      moveAllToTarget: "Move All to Target",
      moveAllToSource: "Move All to Source",
      pageLabel: "Page {page}",
      firstPageLabel: "First Page",
      lastPageLabel: "Last Page",
      nextPageLabel: "Next Page",
      prevPageLabel: "Previous Page",
      rowsPerPageLabel: "Rows per page",
      jumpToPageDropdownLabel: "Jump to Page Dropdown",
      jumpToPageInputLabel: "Jump to Page Input",
      selectRow: "Row Selected",
      unselectRow: "Row Unselected",
      expandRow: "Row Expanded",
      collapseRow: "Row Collapsed",
      showFilterMenu: "Show Filter Menu",
      hideFilterMenu: "Hide Filter Menu",
      filterOperator: "Filter Operator",
      filterConstraint: "Filter Constraint",
      editRow: "Row Edit",
      saveEdit: "Save Edit",
      cancelEdit: "Cancel Edit",
      listView: "List View",
      gridView: "Grid View",
      slide: "Slide",
      slideNumber: "{slideNumber}",
      zoomImage: "Zoom Image",
      zoomIn: "Zoom In",
      zoomOut: "Zoom Out",
      rotateRight: "Rotate Right",
      rotateLeft: "Rotate Left",
      listLabel: "Option List"
    }
  },
  filterMatchModeOptions: {
    text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS],
    numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],
    date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]
  },
  zIndex: {
    modal: 1100,
    overlay: 1e3,
    menu: 1e3,
    tooltip: 1100
  },
  theme: void 0,
  unstyled: false,
  pt: void 0,
  ptOptions: {
    mergeSections: true,
    mergeProps: false
  },
  csp: {
    nonce: void 0
  }
};
var PrimeVueSymbol = Symbol();
function usePrimeVue() {
  var PrimeVue2 = inject(PrimeVueSymbol);
  if (!PrimeVue2) {
    throw new Error("PrimeVue is not installed!");
  }
  return PrimeVue2;
}
__name(usePrimeVue, "usePrimeVue");
function setup(app2, options4) {
  var PrimeVue2 = {
    config: reactive(options4)
  };
  app2.config.globalProperties.$primevue = PrimeVue2;
  app2.provide(PrimeVueSymbol, PrimeVue2);
  clearConfig();
  setupConfig(app2, PrimeVue2);
  return PrimeVue2;
}
__name(setup, "setup");
var stopWatchers = [];
function clearConfig() {
  service_default.clear();
  stopWatchers.forEach(function(fn) {
    return fn === null || fn === void 0 ? void 0 : fn();
  });
  stopWatchers = [];
}
__name(clearConfig, "clearConfig");
function setupConfig(app2, PrimeVue2) {
  var isThemeChanged = ref(false);
  var loadCommonTheme = /* @__PURE__ */ __name(function loadCommonTheme2() {
    if (!config_default.isStyleNameLoaded("common")) {
      var _BaseStyle$getCommonT, _PrimeVue$config;
      var _ref = ((_BaseStyle$getCommonT = BaseStyle.getCommonTheme) === null || _BaseStyle$getCommonT === void 0 ? void 0 : _BaseStyle$getCommonT.call(BaseStyle)) || {}, primitive = _ref.primitive, semantic = _ref.semantic;
      var styleOptions = {
        nonce: (_PrimeVue$config = PrimeVue2.config) === null || _PrimeVue$config === void 0 || (_PrimeVue$config = _PrimeVue$config.csp) === null || _PrimeVue$config === void 0 ? void 0 : _PrimeVue$config.nonce
      };
      BaseStyle.load(primitive === null || primitive === void 0 ? void 0 : primitive.css, _objectSpread$h({
        name: "primitive-variables"
      }, styleOptions));
      BaseStyle.load(semantic === null || semantic === void 0 ? void 0 : semantic.css, _objectSpread$h({
        name: "semantic-variables"
      }, styleOptions));
      BaseStyle.loadTheme(_objectSpread$h({
        name: "global-style"
      }, styleOptions));
      config_default.setLoadedStyleName("common");
    }
  }, "loadCommonTheme");
  service_default.on("theme:change", function(newTheme) {
    if (!isThemeChanged.value) {
      app2.config.globalProperties.$primevue.config.theme = newTheme;
      isThemeChanged.value = true;
    }
  });
  var stopConfigWatcher = watch(PrimeVue2.config, function(newValue2, oldValue2) {
    PrimeVueService.emit("config:change", {
      newValue: newValue2,
      oldValue: oldValue2
    });
  }, {
    immediate: true,
    deep: true
  });
  var stopRippleWatcher = watch(function() {
    return PrimeVue2.config.ripple;
  }, function(newValue2, oldValue2) {
    PrimeVueService.emit("config:ripple:change", {
      newValue: newValue2,
      oldValue: oldValue2
    });
  }, {
    immediate: true,
    deep: true
  });
  var stopThemeWatcher = watch(function() {
    return PrimeVue2.config.theme;
  }, function(newValue2, oldValue2) {
    if (!isThemeChanged.value) {
      config_default.setTheme(newValue2);
    }
    if (!PrimeVue2.config.unstyled) {
      loadCommonTheme();
    }
    isThemeChanged.value = false;
    PrimeVueService.emit("config:theme:change", {
      newValue: newValue2,
      oldValue: oldValue2
    });
  }, {
    immediate: true,
    deep: true
  });
  var stopUnstyledWatcher = watch(function() {
    return PrimeVue2.config.unstyled;
  }, function(newValue2, oldValue2) {
    if (!newValue2 && PrimeVue2.config.theme) {
      loadCommonTheme();
    }
    PrimeVueService.emit("config:unstyled:change", {
      newValue: newValue2,
      oldValue: oldValue2
    });
  }, {
    immediate: true,
    deep: true
  });
  stopWatchers.push(stopConfigWatcher);
  stopWatchers.push(stopRippleWatcher);
  stopWatchers.push(stopThemeWatcher);
  stopWatchers.push(stopUnstyledWatcher);
}
__name(setupConfig, "setupConfig");
var PrimeVue = {
  install: /* @__PURE__ */ __name(function install2(app2, options4) {
    var configOptions = mergeKeys(defaultOptions$2, options4);
    setup(app2, configOptions);
  }, "install")
};
var ConfirmationEventBus = EventBus();
var PrimeVueConfirmSymbol = Symbol();
function useConfirm() {
  var PrimeVueConfirm = inject(PrimeVueConfirmSymbol);
  if (!PrimeVueConfirm) {
    throw new Error("No PrimeVue Confirmation provided!");
  }
  return PrimeVueConfirm;
}
__name(useConfirm, "useConfirm");
var ConfirmationService = {
  install: /* @__PURE__ */ __name(function install3(app2) {
    var ConfirmationService2 = {
      require: /* @__PURE__ */ __name(function require2(options4) {
        ConfirmationEventBus.emit("confirm", options4);
      }, "require"),
      close: /* @__PURE__ */ __name(function close5() {
        ConfirmationEventBus.emit("close");
      }, "close")
    };
    app2.config.globalProperties.$confirm = ConfirmationService2;
    app2.provide(PrimeVueConfirmSymbol, ConfirmationService2);
  }, "install")
};
var ToastEventBus = EventBus();
var PrimeVueToastSymbol = Symbol();
function useToast() {
  var PrimeVueToast = inject(PrimeVueToastSymbol);
  if (!PrimeVueToast) {
    throw new Error("No PrimeVue Toast provided!");
  }
  return PrimeVueToast;
}
__name(useToast, "useToast");
var ToastService = {
  install: /* @__PURE__ */ __name(function install4(app2) {
    var ToastService2 = {
      add: /* @__PURE__ */ __name(function add3(message3) {
        ToastEventBus.emit("add", message3);
      }, "add"),
      remove: /* @__PURE__ */ __name(function remove4(message3) {
        ToastEventBus.emit("remove", message3);
      }, "remove"),
      removeGroup: /* @__PURE__ */ __name(function removeGroup(group) {
        ToastEventBus.emit("remove-group", group);
      }, "removeGroup"),
      removeAllGroups: /* @__PURE__ */ __name(function removeAllGroups() {
        ToastEventBus.emit("remove-all-groups");
      }, "removeAllGroups")
    };
    app2.config.globalProperties.$toast = ToastService2;
    app2.provide(PrimeVueToastSymbol, ToastService2);
  }, "install")
};
function _typeof$1$2(o) {
  "@babel/helpers - typeof";
  return _typeof$1$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$1$2(o);
}
__name(_typeof$1$2, "_typeof$1$2");
function _classCallCheck$1(a, n) {
  if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
__name(_classCallCheck$1, "_classCallCheck$1");
function _defineProperties$1(e2, r) {
  for (var t2 = 0; t2 < r.length; t2++) {
    var o = r[t2];
    o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e2, _toPropertyKey$1$2(o.key), o);
  }
}
__name(_defineProperties$1, "_defineProperties$1");
function _createClass$1(e2, r, t2) {
  return r && _defineProperties$1(e2.prototype, r), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
__name(_createClass$1, "_createClass$1");
function _toPropertyKey$1$2(t2) {
  var i2 = _toPrimitive$1$2(t2, "string");
  return "symbol" == _typeof$1$2(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$1$2, "_toPropertyKey$1$2");
function _toPrimitive$1$2(t2, r) {
  if ("object" != _typeof$1$2(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r);
    if ("object" != _typeof$1$2(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return String(t2);
}
__name(_toPrimitive$1$2, "_toPrimitive$1$2");
var ConnectedOverlayScrollHandler = /* @__PURE__ */ function() {
  function ConnectedOverlayScrollHandler2(element) {
    var listener = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {
    };
    _classCallCheck$1(this, ConnectedOverlayScrollHandler2);
    this.element = element;
    this.listener = listener;
  }
  __name(ConnectedOverlayScrollHandler2, "ConnectedOverlayScrollHandler");
  return _createClass$1(ConnectedOverlayScrollHandler2, [{
    key: "bindScrollListener",
    value: /* @__PURE__ */ __name(function bindScrollListener6() {
      this.scrollableParents = getScrollableParents(this.element);
      for (var i2 = 0; i2 < this.scrollableParents.length; i2++) {
        this.scrollableParents[i2].addEventListener("scroll", this.listener);
      }
    }, "bindScrollListener")
  }, {
    key: "unbindScrollListener",
    value: /* @__PURE__ */ __name(function unbindScrollListener6() {
      if (this.scrollableParents) {
        for (var i2 = 0; i2 < this.scrollableParents.length; i2++) {
          this.scrollableParents[i2].removeEventListener("scroll", this.listener);
        }
      }
    }, "unbindScrollListener")
  }, {
    key: "destroy",
    value: /* @__PURE__ */ __name(function destroy() {
      this.unbindScrollListener();
      this.element = null;
      this.listener = null;
      this.scrollableParents = null;
    }, "destroy")
  }]);
}();
function _typeof$i(o) {
  "@babel/helpers - typeof";
  return _typeof$i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$i(o);
}
__name(_typeof$i, "_typeof$i");
function _toConsumableArray$c(r) {
  return _arrayWithoutHoles$c(r) || _iterableToArray$d(r) || _unsupportedIterableToArray$h(r) || _nonIterableSpread$c();
}
__name(_toConsumableArray$c, "_toConsumableArray$c");
function _nonIterableSpread$c() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$c, "_nonIterableSpread$c");
function _unsupportedIterableToArray$h(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$h(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$h(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$h, "_unsupportedIterableToArray$h");
function _iterableToArray$d(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$d, "_iterableToArray$d");
function _arrayWithoutHoles$c(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$h(r);
}
__name(_arrayWithoutHoles$c, "_arrayWithoutHoles$c");
function _arrayLikeToArray$h(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$h, "_arrayLikeToArray$h");
function _classCallCheck(a, n) {
  if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
__name(_classCallCheck, "_classCallCheck");
function _defineProperties(e2, r) {
  for (var t2 = 0; t2 < r.length; t2++) {
    var o = r[t2];
    o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e2, _toPropertyKey$h(o.key), o);
  }
}
__name(_defineProperties, "_defineProperties");
function _createClass(e2, r, t2) {
  return r && _defineProperties(e2.prototype, r), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
__name(_createClass, "_createClass");
function _defineProperty$i(e2, r, t2) {
  return (r = _toPropertyKey$h(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$i, "_defineProperty$i");
function _toPropertyKey$h(t2) {
  var i2 = _toPrimitive$h(t2, "string");
  return "symbol" == _typeof$i(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$h, "_toPropertyKey$h");
function _toPrimitive$h(t2, r) {
  if ("object" != _typeof$i(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r);
    if ("object" != _typeof$i(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return String(t2);
}
__name(_toPrimitive$h, "_toPrimitive$h");
var _default = /* @__PURE__ */ function() {
  function _default6(_ref) {
    var init3 = _ref.init, type = _ref.type;
    _classCallCheck(this, _default6);
    _defineProperty$i(this, "helpers", void 0);
    _defineProperty$i(this, "type", void 0);
    this.helpers = new Set(init3);
    this.type = type;
  }
  __name(_default6, "_default");
  return _createClass(_default6, [{
    key: "add",
    value: /* @__PURE__ */ __name(function add3(instance) {
      this.helpers.add(instance);
    }, "add")
  }, {
    key: "update",
    value: /* @__PURE__ */ __name(function update() {
    }, "update")
  }, {
    key: "delete",
    value: /* @__PURE__ */ __name(function _delete(instance) {
      this.helpers["delete"](instance);
    }, "_delete")
  }, {
    key: "clear",
    value: /* @__PURE__ */ __name(function clear2() {
      this.helpers.clear();
    }, "clear")
  }, {
    key: "get",
    value: /* @__PURE__ */ __name(function get3(parentInstance, slots) {
      var children = this._get(parentInstance, slots);
      var computed2 = children ? this._recursive(_toConsumableArray$c(this.helpers), children) : null;
      return isNotEmpty(computed2) ? computed2 : null;
    }, "get")
  }, {
    key: "_isMatched",
    value: /* @__PURE__ */ __name(function _isMatched(instance, key) {
      var _parent$vnode;
      var parent = instance === null || instance === void 0 ? void 0 : instance.parent;
      return (parent === null || parent === void 0 || (_parent$vnode = parent.vnode) === null || _parent$vnode === void 0 ? void 0 : _parent$vnode.key) === key || parent && this._isMatched(parent, key) || false;
    }, "_isMatched")
  }, {
    key: "_get",
    value: /* @__PURE__ */ __name(function _get(parentInstance, slots) {
      var _ref2, _ref2$default;
      return ((_ref2 = slots || (parentInstance === null || parentInstance === void 0 ? void 0 : parentInstance.$slots)) === null || _ref2 === void 0 || (_ref2$default = _ref2["default"]) === null || _ref2$default === void 0 ? void 0 : _ref2$default.call(_ref2)) || null;
    }, "_get")
  }, {
    key: "_recursive",
    value: /* @__PURE__ */ __name(function _recursive() {
      var _this = this;
      var helpers2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
      var children = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
      var components = [];
      children.forEach(function(child) {
        if (child.children instanceof Array) {
          components = components.concat(_this._recursive(components, child.children));
        } else if (child.type.name === _this.type) {
          components.push(child);
        } else if (isNotEmpty(child.key)) {
          components = components.concat(helpers2.filter(function(c) {
            return _this._isMatched(c, child.key);
          }).map(function(c) {
            return c.vnode;
          }));
        }
      });
      return components;
    }, "_recursive")
  }]);
}();
function UniqueComponentId() {
  var prefix2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "pv_id_";
  return uuid(prefix2);
}
__name(UniqueComponentId, "UniqueComponentId");
function getVNodeProp(vnode, prop2) {
  if (vnode) {
    var props = vnode.props;
    if (props) {
      var kebabProp = prop2.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
      var propName = Object.prototype.hasOwnProperty.call(props, kebabProp) ? kebabProp : prop2;
      return vnode.type["extends"].props[prop2].type === Boolean && props[propName] === "" ? true : props[propName];
    }
  }
  return null;
}
__name(getVNodeProp, "getVNodeProp");
var Base = {
  _loadedStyleNames: /* @__PURE__ */ new Set(),
  getLoadedStyleNames: /* @__PURE__ */ __name(function getLoadedStyleNames() {
    return this._loadedStyleNames;
  }, "getLoadedStyleNames"),
  isStyleNameLoaded: /* @__PURE__ */ __name(function isStyleNameLoaded(name2) {
    return this._loadedStyleNames.has(name2);
  }, "isStyleNameLoaded"),
  setLoadedStyleName: /* @__PURE__ */ __name(function setLoadedStyleName(name2) {
    this._loadedStyleNames.add(name2);
  }, "setLoadedStyleName"),
  deleteLoadedStyleName: /* @__PURE__ */ __name(function deleteLoadedStyleName(name2) {
    this._loadedStyleNames["delete"](name2);
  }, "deleteLoadedStyleName"),
  clearLoadedStyleNames: /* @__PURE__ */ __name(function clearLoadedStyleNames() {
    this._loadedStyleNames.clear();
  }, "clearLoadedStyleNames")
};
function _typeof$h(o) {
  "@babel/helpers - typeof";
  return _typeof$h = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$h(o);
}
__name(_typeof$h, "_typeof$h");
function _slicedToArray$3(r, e2) {
  return _arrayWithHoles$3(r) || _iterableToArrayLimit$3(r, e2) || _unsupportedIterableToArray$g(r, e2) || _nonIterableRest$3();
}
__name(_slicedToArray$3, "_slicedToArray$3");
function _nonIterableRest$3() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableRest$3, "_nonIterableRest$3");
function _unsupportedIterableToArray$g(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$g(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$g(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$g, "_unsupportedIterableToArray$g");
function _arrayLikeToArray$g(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$g, "_arrayLikeToArray$g");
function _iterableToArrayLimit$3(r, l) {
  var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (null != t2) {
    var e2, n, i2, u, a = [], f = true, o = false;
    try {
      if (i2 = (t2 = t2.call(r)).next, 0 === l) ;
      else for (; !(f = (e2 = i2.call(t2)).done) && (a.push(e2.value), a.length !== l); f = true) ;
    } catch (r2) {
      o = true, n = r2;
    } finally {
      try {
        if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
      } finally {
        if (o) throw n;
      }
    }
    return a;
  }
}
__name(_iterableToArrayLimit$3, "_iterableToArrayLimit$3");
function _arrayWithHoles$3(r) {
  if (Array.isArray(r)) return r;
}
__name(_arrayWithHoles$3, "_arrayWithHoles$3");
function ownKeys$g(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$g, "ownKeys$g");
function _objectSpread$g(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$g(Object(t2), true).forEach(function(r2) {
      _defineProperty$h(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$g(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$g, "_objectSpread$g");
function _defineProperty$h(e2, r, t2) {
  return (r = _toPropertyKey$g(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$h, "_defineProperty$h");
function _toPropertyKey$g(t2) {
  var i2 = _toPrimitive$g(t2, "string");
  return "symbol" == _typeof$h(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$g, "_toPropertyKey$g");
function _toPrimitive$g(t2, r) {
  if ("object" != _typeof$h(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$h(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$g, "_toPrimitive$g");
var BaseDirective = {
  _getMeta: /* @__PURE__ */ __name(function _getMeta() {
    return [isObject$7(arguments.length <= 0 ? void 0 : arguments[0]) ? void 0 : arguments.length <= 0 ? void 0 : arguments[0], resolve$1(isObject$7(arguments.length <= 0 ? void 0 : arguments[0]) ? arguments.length <= 0 ? void 0 : arguments[0] : arguments.length <= 1 ? void 0 : arguments[1])];
  }, "_getMeta"),
  _getConfig: /* @__PURE__ */ __name(function _getConfig(binding, vnode) {
    var _ref, _binding$instance, _vnode$ctx;
    return (_ref = (binding === null || binding === void 0 || (_binding$instance = binding.instance) === null || _binding$instance === void 0 ? void 0 : _binding$instance.$primevue) || (vnode === null || vnode === void 0 || (_vnode$ctx = vnode.ctx) === null || _vnode$ctx === void 0 || (_vnode$ctx = _vnode$ctx.appContext) === null || _vnode$ctx === void 0 || (_vnode$ctx = _vnode$ctx.config) === null || _vnode$ctx === void 0 || (_vnode$ctx = _vnode$ctx.globalProperties) === null || _vnode$ctx === void 0 ? void 0 : _vnode$ctx.$primevue)) === null || _ref === void 0 ? void 0 : _ref.config;
  }, "_getConfig"),
  _getOptionValue: getKeyValue,
  _getPTValue: /* @__PURE__ */ __name(function _getPTValue() {
    var _instance$binding, _instance$$primevueCo;
    var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var obj = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
    var params = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    var searchInDefaultPT = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
    var getValue2 = /* @__PURE__ */ __name(function getValue3() {
      var value4 = BaseDirective._getOptionValue.apply(BaseDirective, arguments);
      return isString$8(value4) || isArray$5(value4) ? {
        "class": value4
      } : value4;
    }, "getValue");
    var _ref2 = ((_instance$binding = instance.binding) === null || _instance$binding === void 0 || (_instance$binding = _instance$binding.value) === null || _instance$binding === void 0 ? void 0 : _instance$binding.ptOptions) || ((_instance$$primevueCo = instance.$primevueConfig) === null || _instance$$primevueCo === void 0 ? void 0 : _instance$$primevueCo.ptOptions) || {}, _ref2$mergeSections = _ref2.mergeSections, mergeSections = _ref2$mergeSections === void 0 ? true : _ref2$mergeSections, _ref2$mergeProps = _ref2.mergeProps, useMergeProps = _ref2$mergeProps === void 0 ? false : _ref2$mergeProps;
    var global2 = searchInDefaultPT ? BaseDirective._useDefaultPT(instance, instance.defaultPT(), getValue2, key, params) : void 0;
    var self2 = BaseDirective._usePT(instance, BaseDirective._getPT(obj, instance.$name), getValue2, key, _objectSpread$g(_objectSpread$g({}, params), {}, {
      global: global2 || {}
    }));
    var datasets = BaseDirective._getPTDatasets(instance, key);
    return mergeSections || !mergeSections && self2 ? useMergeProps ? BaseDirective._mergeProps(instance, useMergeProps, global2, self2, datasets) : _objectSpread$g(_objectSpread$g(_objectSpread$g({}, global2), self2), datasets) : _objectSpread$g(_objectSpread$g({}, self2), datasets);
  }, "_getPTValue"),
  _getPTDatasets: /* @__PURE__ */ __name(function _getPTDatasets() {
    var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
    var datasetPrefix = "data-pc-";
    return _objectSpread$g(_objectSpread$g({}, key === "root" && _defineProperty$h({}, "".concat(datasetPrefix, "name"), toFlatCase(instance.$name))), {}, _defineProperty$h({}, "".concat(datasetPrefix, "section"), toFlatCase(key)));
  }, "_getPTDatasets"),
  _getPT: /* @__PURE__ */ __name(function _getPT(pt) {
    var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
    var callback = arguments.length > 2 ? arguments[2] : void 0;
    var getValue2 = /* @__PURE__ */ __name(function getValue3(value4) {
      var _computedValue$_key;
      var computedValue = callback ? callback(value4) : value4;
      var _key = toFlatCase(key);
      return (_computedValue$_key = computedValue === null || computedValue === void 0 ? void 0 : computedValue[_key]) !== null && _computedValue$_key !== void 0 ? _computedValue$_key : computedValue;
    }, "getValue");
    return pt !== null && pt !== void 0 && pt.hasOwnProperty("_usept") ? {
      _usept: pt["_usept"],
      originalValue: getValue2(pt.originalValue),
      value: getValue2(pt.value)
    } : getValue2(pt);
  }, "_getPT"),
  _usePT: /* @__PURE__ */ __name(function _usePT() {
    var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var pt = arguments.length > 1 ? arguments[1] : void 0;
    var callback = arguments.length > 2 ? arguments[2] : void 0;
    var key = arguments.length > 3 ? arguments[3] : void 0;
    var params = arguments.length > 4 ? arguments[4] : void 0;
    var fn = /* @__PURE__ */ __name(function fn2(value5) {
      return callback(value5, key, params);
    }, "fn");
    if (pt !== null && pt !== void 0 && pt.hasOwnProperty("_usept")) {
      var _instance$$primevueCo2;
      var _ref4 = pt["_usept"] || ((_instance$$primevueCo2 = instance.$primevueConfig) === null || _instance$$primevueCo2 === void 0 ? void 0 : _instance$$primevueCo2.ptOptions) || {}, _ref4$mergeSections = _ref4.mergeSections, mergeSections = _ref4$mergeSections === void 0 ? true : _ref4$mergeSections, _ref4$mergeProps = _ref4.mergeProps, useMergeProps = _ref4$mergeProps === void 0 ? false : _ref4$mergeProps;
      var originalValue = fn(pt.originalValue);
      var value4 = fn(pt.value);
      if (originalValue === void 0 && value4 === void 0) return void 0;
      else if (isString$8(value4)) return value4;
      else if (isString$8(originalValue)) return originalValue;
      return mergeSections || !mergeSections && value4 ? useMergeProps ? BaseDirective._mergeProps(instance, useMergeProps, originalValue, value4) : _objectSpread$g(_objectSpread$g({}, originalValue), value4) : value4;
    }
    return fn(pt);
  }, "_usePT"),
  _useDefaultPT: /* @__PURE__ */ __name(function _useDefaultPT() {
    var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var defaultPT2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var callback = arguments.length > 2 ? arguments[2] : void 0;
    var key = arguments.length > 3 ? arguments[3] : void 0;
    var params = arguments.length > 4 ? arguments[4] : void 0;
    return BaseDirective._usePT(instance, defaultPT2, callback, key, params);
  }, "_useDefaultPT"),
  _loadStyles: /* @__PURE__ */ __name(function _loadStyles(el, binding, vnode) {
    var _config$csp;
    var config2 = BaseDirective._getConfig(binding, vnode);
    var useStyleOptions = {
      nonce: config2 === null || config2 === void 0 || (_config$csp = config2.csp) === null || _config$csp === void 0 ? void 0 : _config$csp.nonce
    };
    BaseDirective._loadCoreStyles(el.$instance, useStyleOptions);
    BaseDirective._loadThemeStyles(el.$instance, useStyleOptions);
    BaseDirective._loadScopedThemeStyles(el.$instance, useStyleOptions);
    BaseDirective._themeChangeListener(function() {
      return BaseDirective._loadThemeStyles(el.$instance, useStyleOptions);
    });
  }, "_loadStyles"),
  _loadCoreStyles: /* @__PURE__ */ __name(function _loadCoreStyles() {
    var _instance$$style, _instance$$style2;
    var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var useStyleOptions = arguments.length > 1 ? arguments[1] : void 0;
    if (!Base.isStyleNameLoaded((_instance$$style = instance.$style) === null || _instance$$style === void 0 ? void 0 : _instance$$style.name) && (_instance$$style2 = instance.$style) !== null && _instance$$style2 !== void 0 && _instance$$style2.name) {
      var _instance$$style3;
      BaseStyle.loadCSS(useStyleOptions);
      instance.isUnstyled() && ((_instance$$style3 = instance.$style) === null || _instance$$style3 === void 0 ? void 0 : _instance$$style3.loadCSS(useStyleOptions));
      Base.setLoadedStyleName(instance.$style.name);
    }
  }, "_loadCoreStyles"),
  _loadThemeStyles: /* @__PURE__ */ __name(function _loadThemeStyles() {
    var _instance$$style5, _instance$$style6;
    var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var useStyleOptions = arguments.length > 1 ? arguments[1] : void 0;
    if (instance !== null && instance !== void 0 && instance.isUnstyled()) return;
    if (!config_default.isStyleNameLoaded("common")) {
      var _instance$$style4, _instance$$style4$get;
      var _ref5 = ((_instance$$style4 = instance.$style) === null || _instance$$style4 === void 0 || (_instance$$style4$get = _instance$$style4.getCommonTheme) === null || _instance$$style4$get === void 0 ? void 0 : _instance$$style4$get.call(_instance$$style4)) || {}, primitive = _ref5.primitive, semantic = _ref5.semantic;
      BaseStyle.load(primitive === null || primitive === void 0 ? void 0 : primitive.css, _objectSpread$g({
        name: "primitive-variables"
      }, useStyleOptions));
      BaseStyle.load(semantic === null || semantic === void 0 ? void 0 : semantic.css, _objectSpread$g({
        name: "semantic-variables"
      }, useStyleOptions));
      BaseStyle.loadTheme(_objectSpread$g({
        name: "global-style"
      }, useStyleOptions));
      config_default.setLoadedStyleName("common");
    }
    if (!config_default.isStyleNameLoaded((_instance$$style5 = instance.$style) === null || _instance$$style5 === void 0 ? void 0 : _instance$$style5.name) && (_instance$$style6 = instance.$style) !== null && _instance$$style6 !== void 0 && _instance$$style6.name) {
      var _instance$$style7, _instance$$style7$get, _instance$$style8, _instance$$style9;
      var _ref6 = ((_instance$$style7 = instance.$style) === null || _instance$$style7 === void 0 || (_instance$$style7$get = _instance$$style7.getDirectiveTheme) === null || _instance$$style7$get === void 0 ? void 0 : _instance$$style7$get.call(_instance$$style7)) || {}, css3 = _ref6.css;
      (_instance$$style8 = instance.$style) === null || _instance$$style8 === void 0 || _instance$$style8.load(css3, _objectSpread$g({
        name: "".concat(instance.$style.name, "-variables")
      }, useStyleOptions));
      (_instance$$style9 = instance.$style) === null || _instance$$style9 === void 0 || _instance$$style9.loadTheme(_objectSpread$g({
        name: "".concat(instance.$style.name, "-style")
      }, useStyleOptions));
      config_default.setLoadedStyleName(instance.$style.name);
    }
    if (!config_default.isStyleNameLoaded("layer-order")) {
      var _instance$$style10, _instance$$style10$ge;
      var layerOrder = (_instance$$style10 = instance.$style) === null || _instance$$style10 === void 0 || (_instance$$style10$ge = _instance$$style10.getLayerOrderThemeCSS) === null || _instance$$style10$ge === void 0 ? void 0 : _instance$$style10$ge.call(_instance$$style10);
      BaseStyle.load(layerOrder, _objectSpread$g({
        name: "layer-order",
        first: true
      }, useStyleOptions));
      config_default.setLoadedStyleName("layer-order");
    }
  }, "_loadThemeStyles"),
  _loadScopedThemeStyles: /* @__PURE__ */ __name(function _loadScopedThemeStyles() {
    var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var useStyleOptions = arguments.length > 1 ? arguments[1] : void 0;
    var preset = instance.preset();
    if (preset && instance.$attrSelector) {
      var _instance$$style11, _instance$$style11$ge, _instance$$style12;
      var _ref7 = ((_instance$$style11 = instance.$style) === null || _instance$$style11 === void 0 || (_instance$$style11$ge = _instance$$style11.getPresetTheme) === null || _instance$$style11$ge === void 0 ? void 0 : _instance$$style11$ge.call(_instance$$style11, preset, "[".concat(instance.$attrSelector, "]"))) || {}, css3 = _ref7.css;
      var scopedStyle = (_instance$$style12 = instance.$style) === null || _instance$$style12 === void 0 ? void 0 : _instance$$style12.load(css3, _objectSpread$g({
        name: "".concat(instance.$attrSelector, "-").concat(instance.$style.name)
      }, useStyleOptions));
      instance.scopedStyleEl = scopedStyle.el;
    }
  }, "_loadScopedThemeStyles"),
  _themeChangeListener: /* @__PURE__ */ __name(function _themeChangeListener() {
    var callback = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {
    };
    Base.clearLoadedStyleNames();
    service_default.on("theme:change", callback);
  }, "_themeChangeListener"),
  _hook: /* @__PURE__ */ __name(function _hook(directiveName, hookName, el, binding, vnode, prevVnode) {
    var _binding$value, _config$pt;
    var name2 = "on".concat(toCapitalCase(hookName));
    var config2 = BaseDirective._getConfig(binding, vnode);
    var instance = el === null || el === void 0 ? void 0 : el.$instance;
    var selfHook = BaseDirective._usePT(instance, BaseDirective._getPT(binding === null || binding === void 0 || (_binding$value = binding.value) === null || _binding$value === void 0 ? void 0 : _binding$value.pt, directiveName), BaseDirective._getOptionValue, "hooks.".concat(name2));
    var defaultHook = BaseDirective._useDefaultPT(instance, config2 === null || config2 === void 0 || (_config$pt = config2.pt) === null || _config$pt === void 0 || (_config$pt = _config$pt.directives) === null || _config$pt === void 0 ? void 0 : _config$pt[directiveName], BaseDirective._getOptionValue, "hooks.".concat(name2));
    var options4 = {
      el,
      binding,
      vnode,
      prevVnode
    };
    selfHook === null || selfHook === void 0 || selfHook(instance, options4);
    defaultHook === null || defaultHook === void 0 || defaultHook(instance, options4);
  }, "_hook"),
  _mergeProps: /* @__PURE__ */ __name(function _mergeProps() {
    var fn = arguments.length > 1 ? arguments[1] : void 0;
    for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key2 = 2; _key2 < _len; _key2++) {
      args[_key2 - 2] = arguments[_key2];
    }
    return isFunction$5(fn) ? fn.apply(void 0, args) : mergeProps.apply(void 0, args);
  }, "_mergeProps"),
  _extend: /* @__PURE__ */ __name(function _extend(name2) {
    var options4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var handleHook = /* @__PURE__ */ __name(function handleHook2(hook, el, binding, vnode, prevVnode) {
      var _el$$instance$hook, _el$$instance9, _el$$pd;
      el._$instances = el._$instances || {};
      var config2 = BaseDirective._getConfig(binding, vnode);
      var $prevInstance = el._$instances[name2] || {};
      var $options = isEmpty$1($prevInstance) ? _objectSpread$g(_objectSpread$g({}, options4), options4 === null || options4 === void 0 ? void 0 : options4.methods) : {};
      el._$instances[name2] = _objectSpread$g(_objectSpread$g({}, $prevInstance), {}, {
        /* new instance variables to pass in directive methods */
        $name: name2,
        $host: el,
        $binding: binding,
        $modifiers: binding === null || binding === void 0 ? void 0 : binding.modifiers,
        $value: binding === null || binding === void 0 ? void 0 : binding.value,
        $el: $prevInstance["$el"] || el || void 0,
        $style: _objectSpread$g({
          classes: void 0,
          inlineStyles: void 0,
          load: /* @__PURE__ */ __name(function load2() {
          }, "load"),
          loadCSS: /* @__PURE__ */ __name(function loadCSS2() {
          }, "loadCSS"),
          loadTheme: /* @__PURE__ */ __name(function loadTheme2() {
          }, "loadTheme")
        }, options4 === null || options4 === void 0 ? void 0 : options4.style),
        $primevueConfig: config2,
        $attrSelector: el.$attrSelector,
        /* computed instance variables */
        defaultPT: /* @__PURE__ */ __name(function defaultPT2() {
          return BaseDirective._getPT(config2 === null || config2 === void 0 ? void 0 : config2.pt, void 0, function(value4) {
            var _value$directives;
            return value4 === null || value4 === void 0 || (_value$directives = value4.directives) === null || _value$directives === void 0 ? void 0 : _value$directives[name2];
          });
        }, "defaultPT"),
        isUnstyled: /* @__PURE__ */ __name(function isUnstyled2() {
          var _el$$instance, _el$$instance2;
          return ((_el$$instance = el.$instance) === null || _el$$instance === void 0 || (_el$$instance = _el$$instance.$binding) === null || _el$$instance === void 0 || (_el$$instance = _el$$instance.value) === null || _el$$instance === void 0 ? void 0 : _el$$instance.unstyled) !== void 0 ? (_el$$instance2 = el.$instance) === null || _el$$instance2 === void 0 || (_el$$instance2 = _el$$instance2.$binding) === null || _el$$instance2 === void 0 || (_el$$instance2 = _el$$instance2.value) === null || _el$$instance2 === void 0 ? void 0 : _el$$instance2.unstyled : config2 === null || config2 === void 0 ? void 0 : config2.unstyled;
        }, "isUnstyled"),
        theme: /* @__PURE__ */ __name(function theme40() {
          var _el$$instance3;
          return (_el$$instance3 = el.$instance) === null || _el$$instance3 === void 0 || (_el$$instance3 = _el$$instance3.$primevueConfig) === null || _el$$instance3 === void 0 ? void 0 : _el$$instance3.theme;
        }, "theme"),
        preset: /* @__PURE__ */ __name(function preset() {
          var _el$$instance4;
          return (_el$$instance4 = el.$instance) === null || _el$$instance4 === void 0 || (_el$$instance4 = _el$$instance4.$binding) === null || _el$$instance4 === void 0 || (_el$$instance4 = _el$$instance4.value) === null || _el$$instance4 === void 0 ? void 0 : _el$$instance4.dt;
        }, "preset"),
        /* instance's methods */
        ptm: /* @__PURE__ */ __name(function ptm2() {
          var _el$$instance5;
          var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
          var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          return BaseDirective._getPTValue(el.$instance, (_el$$instance5 = el.$instance) === null || _el$$instance5 === void 0 || (_el$$instance5 = _el$$instance5.$binding) === null || _el$$instance5 === void 0 || (_el$$instance5 = _el$$instance5.value) === null || _el$$instance5 === void 0 ? void 0 : _el$$instance5.pt, key, _objectSpread$g({}, params));
        }, "ptm"),
        ptmo: /* @__PURE__ */ __name(function ptmo2() {
          var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
          var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          return BaseDirective._getPTValue(el.$instance, obj, key, params, false);
        }, "ptmo"),
        cx: /* @__PURE__ */ __name(function cx2() {
          var _el$$instance6, _el$$instance7;
          var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
          var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
          return !((_el$$instance6 = el.$instance) !== null && _el$$instance6 !== void 0 && _el$$instance6.isUnstyled()) ? BaseDirective._getOptionValue((_el$$instance7 = el.$instance) === null || _el$$instance7 === void 0 || (_el$$instance7 = _el$$instance7.$style) === null || _el$$instance7 === void 0 ? void 0 : _el$$instance7.classes, key, _objectSpread$g({}, params)) : void 0;
        }, "cx"),
        sx: /* @__PURE__ */ __name(function sx2() {
          var _el$$instance8;
          var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
          var when = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
          var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
          return when ? BaseDirective._getOptionValue((_el$$instance8 = el.$instance) === null || _el$$instance8 === void 0 || (_el$$instance8 = _el$$instance8.$style) === null || _el$$instance8 === void 0 ? void 0 : _el$$instance8.inlineStyles, key, _objectSpread$g({}, params)) : void 0;
        }, "sx")
      }, $options);
      el.$instance = el._$instances[name2];
      (_el$$instance$hook = (_el$$instance9 = el.$instance)[hook]) === null || _el$$instance$hook === void 0 || _el$$instance$hook.call(_el$$instance9, el, binding, vnode, prevVnode);
      el["$".concat(name2)] = el.$instance;
      BaseDirective._hook(name2, hook, el, binding, vnode, prevVnode);
      el.$pd || (el.$pd = {});
      el.$pd[name2] = _objectSpread$g(_objectSpread$g({}, (_el$$pd = el.$pd) === null || _el$$pd === void 0 ? void 0 : _el$$pd[name2]), {}, {
        name: name2,
        instance: el.$instance
      });
    }, "handleHook");
    var handleWatch = /* @__PURE__ */ __name(function handleWatch2(el) {
      var _el$$instance10, _watchers$config, _el$$instance11, _watchers$configRipp, _el$$instance12;
      var watchers = (_el$$instance10 = el.$instance) === null || _el$$instance10 === void 0 ? void 0 : _el$$instance10.watch;
      watchers === null || watchers === void 0 || (_watchers$config = watchers["config"]) === null || _watchers$config === void 0 || _watchers$config.call(el.$instance, (_el$$instance11 = el.$instance) === null || _el$$instance11 === void 0 ? void 0 : _el$$instance11.$primevueConfig);
      PrimeVueService.on("config:change", function(_ref8) {
        var _watchers$config2;
        var newValue2 = _ref8.newValue, oldValue2 = _ref8.oldValue;
        return watchers === null || watchers === void 0 || (_watchers$config2 = watchers["config"]) === null || _watchers$config2 === void 0 ? void 0 : _watchers$config2.call(el.$instance, newValue2, oldValue2);
      });
      watchers === null || watchers === void 0 || (_watchers$configRipp = watchers["config.ripple"]) === null || _watchers$configRipp === void 0 || _watchers$configRipp.call(el.$instance, (_el$$instance12 = el.$instance) === null || _el$$instance12 === void 0 || (_el$$instance12 = _el$$instance12.$primevueConfig) === null || _el$$instance12 === void 0 ? void 0 : _el$$instance12.ripple);
      PrimeVueService.on("config:ripple:change", function(_ref9) {
        var _watchers$configRipp2;
        var newValue2 = _ref9.newValue, oldValue2 = _ref9.oldValue;
        return watchers === null || watchers === void 0 || (_watchers$configRipp2 = watchers["config.ripple"]) === null || _watchers$configRipp2 === void 0 ? void 0 : _watchers$configRipp2.call(el.$instance, newValue2, oldValue2);
      });
    }, "handleWatch");
    return {
      created: /* @__PURE__ */ __name(function created3(el, binding, vnode, prevVnode) {
        handleHook("created", el, binding, vnode, prevVnode);
      }, "created"),
      beforeMount: /* @__PURE__ */ __name(function beforeMount4(el, binding, vnode, prevVnode) {
        el.$attrSelector = UniqueComponentId("pd");
        BaseDirective._loadStyles(el, binding, vnode);
        handleHook("beforeMount", el, binding, vnode, prevVnode);
        handleWatch(el);
      }, "beforeMount"),
      mounted: /* @__PURE__ */ __name(function mounted23(el, binding, vnode, prevVnode) {
        BaseDirective._loadStyles(el, binding, vnode);
        handleHook("mounted", el, binding, vnode, prevVnode);
      }, "mounted"),
      beforeUpdate: /* @__PURE__ */ __name(function beforeUpdate2(el, binding, vnode, prevVnode) {
        handleHook("beforeUpdate", el, binding, vnode, prevVnode);
      }, "beforeUpdate"),
      updated: /* @__PURE__ */ __name(function updated13(el, binding, vnode, prevVnode) {
        BaseDirective._loadStyles(el, binding, vnode);
        handleHook("updated", el, binding, vnode, prevVnode);
      }, "updated"),
      beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount15(el, binding, vnode, prevVnode) {
        handleHook("beforeUnmount", el, binding, vnode, prevVnode);
      }, "beforeUnmount"),
      unmounted: /* @__PURE__ */ __name(function unmounted6(el, binding, vnode, prevVnode) {
        var _el$$instance13;
        (_el$$instance13 = el.$instance) === null || _el$$instance13 === void 0 || (_el$$instance13 = _el$$instance13.scopedStyleEl) === null || _el$$instance13 === void 0 || (_el$$instance13 = _el$$instance13.value) === null || _el$$instance13 === void 0 || _el$$instance13.remove();
        handleHook("unmounted", el, binding, vnode, prevVnode);
      }, "unmounted")
    };
  }, "_extend"),
  extend: /* @__PURE__ */ __name(function extend3() {
    var _BaseDirective$_getMe = BaseDirective._getMeta.apply(BaseDirective, arguments), _BaseDirective$_getMe2 = _slicedToArray$3(_BaseDirective$_getMe, 2), name2 = _BaseDirective$_getMe2[0], options4 = _BaseDirective$_getMe2[1];
    return _objectSpread$g({
      extend: /* @__PURE__ */ __name(function extend4() {
        var _BaseDirective$_getMe3 = BaseDirective._getMeta.apply(BaseDirective, arguments), _BaseDirective$_getMe4 = _slicedToArray$3(_BaseDirective$_getMe3, 2), _name = _BaseDirective$_getMe4[0], _options = _BaseDirective$_getMe4[1];
        return BaseDirective.extend(_name, _objectSpread$g(_objectSpread$g(_objectSpread$g({}, options4), options4 === null || options4 === void 0 ? void 0 : options4.methods), _options));
      }, "extend")
    }, BaseDirective._extend(name2, options4));
  }, "extend")
};
var theme$A = /* @__PURE__ */ __name(function theme3(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-tooltip {\n    position: absolute;\n    display: none;\n    max-width: ".concat(dt2("tooltip.max.width"), ";\n}\n\n.p-tooltip-right,\n.p-tooltip-left {\n    padding: 0 ").concat(dt2("tooltip.gutter"), ";\n}\n\n.p-tooltip-top,\n.p-tooltip-bottom {\n    padding: ").concat(dt2("tooltip.gutter"), " 0;\n}\n\n.p-tooltip-text {\n    white-space: pre-line;\n    word-break: break-word;\n    background: ").concat(dt2("tooltip.background"), ";\n    color: ").concat(dt2("tooltip.color"), ";\n    padding: ").concat(dt2("tooltip.padding"), ";\n    box-shadow: ").concat(dt2("tooltip.shadow"), ";\n    border-radius: ").concat(dt2("tooltip.border.radius"), ";\n}\n\n.p-tooltip-arrow {\n    position: absolute;\n    width: 0;\n    height: 0;\n    border-color: transparent;\n    border-style: solid;\n    scale: 2;\n}\n\n.p-tooltip-right .p-tooltip-arrow {\n    margin-top: calc(-1 * ").concat(dt2("tooltip.gutter"), ");\n    border-width: ").concat(dt2("tooltip.gutter"), " ").concat(dt2("tooltip.gutter"), " ").concat(dt2("tooltip.gutter"), " 0;\n    border-right-color: ").concat(dt2("tooltip.background"), ";\n}\n\n.p-tooltip-left .p-tooltip-arrow {\n    margin-top: calc(-1 * ").concat(dt2("tooltip.gutter"), ");\n    border-width: ").concat(dt2("tooltip.gutter"), " 0 ").concat(dt2("tooltip.gutter"), " ").concat(dt2("tooltip.gutter"), ";\n    border-left-color: ").concat(dt2("tooltip.background"), ";\n}\n\n.p-tooltip-top .p-tooltip-arrow {\n    margin-left: calc(-1 * ").concat(dt2("tooltip.gutter"), ");\n    border-width: ").concat(dt2("tooltip.gutter"), " ").concat(dt2("tooltip.gutter"), " 0 ").concat(dt2("tooltip.gutter"), ";\n    border-top-color: ").concat(dt2("tooltip.background"), ";\n    border-bottom-color: ").concat(dt2("tooltip.background"), ";\n}\n\n.p-tooltip-bottom .p-tooltip-arrow {\n    margin-left: calc(-1 * ").concat(dt2("tooltip.gutter"), ");\n    border-width: 0 ").concat(dt2("tooltip.gutter"), " ").concat(dt2("tooltip.gutter"), " ").concat(dt2("tooltip.gutter"), ";\n    border-top-color: ").concat(dt2("tooltip.background"), ";\n    border-bottom-color: ").concat(dt2("tooltip.background"), ";\n}\n");
}, "theme");
var classes$C = {
  root: "p-tooltip p-component",
  arrow: "p-tooltip-arrow",
  text: "p-tooltip-text"
};
var TooltipStyle = BaseStyle.extend({
  name: "tooltip-directive",
  theme: theme$A,
  classes: classes$C
});
var BaseTooltip = BaseDirective.extend({
  style: TooltipStyle
});
function _slicedToArray$2(r, e2) {
  return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e2) || _unsupportedIterableToArray$f(r, e2) || _nonIterableRest$2();
}
__name(_slicedToArray$2, "_slicedToArray$2");
function _nonIterableRest$2() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableRest$2, "_nonIterableRest$2");
function _unsupportedIterableToArray$f(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$f(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$f(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$f, "_unsupportedIterableToArray$f");
function _arrayLikeToArray$f(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$f, "_arrayLikeToArray$f");
function _iterableToArrayLimit$2(r, l) {
  var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (null != t2) {
    var e2, n, i2, u, a = [], f = true, o = false;
    try {
      if (i2 = (t2 = t2.call(r)).next, 0 === l) ;
      else for (; !(f = (e2 = i2.call(t2)).done) && (a.push(e2.value), a.length !== l); f = true) ;
    } catch (r2) {
      o = true, n = r2;
    } finally {
      try {
        if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
      } finally {
        if (o) throw n;
      }
    }
    return a;
  }
}
__name(_iterableToArrayLimit$2, "_iterableToArrayLimit$2");
function _arrayWithHoles$2(r) {
  if (Array.isArray(r)) return r;
}
__name(_arrayWithHoles$2, "_arrayWithHoles$2");
function _defineProperty$g(e2, r, t2) {
  return (r = _toPropertyKey$f(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$g, "_defineProperty$g");
function _toPropertyKey$f(t2) {
  var i2 = _toPrimitive$f(t2, "string");
  return "symbol" == _typeof$g(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$f, "_toPropertyKey$f");
function _toPrimitive$f(t2, r) {
  if ("object" != _typeof$g(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$g(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$f, "_toPrimitive$f");
function _typeof$g(o) {
  "@babel/helpers - typeof";
  return _typeof$g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$g(o);
}
__name(_typeof$g, "_typeof$g");
var Tooltip = BaseTooltip.extend("tooltip", {
  beforeMount: /* @__PURE__ */ __name(function beforeMount(el, options4) {
    var _options$instance$$pr;
    var target = this.getTarget(el);
    target.$_ptooltipModifiers = this.getModifiers(options4);
    if (!options4.value) return;
    else if (typeof options4.value === "string") {
      target.$_ptooltipValue = options4.value;
      target.$_ptooltipDisabled = false;
      target.$_ptooltipEscape = true;
      target.$_ptooltipClass = null;
      target.$_ptooltipFitContent = true;
      target.$_ptooltipIdAttr = UniqueComponentId() + "_tooltip";
      target.$_ptooltipShowDelay = 0;
      target.$_ptooltipHideDelay = 0;
      target.$_ptooltipAutoHide = true;
    } else if (_typeof$g(options4.value) === "object" && options4.value) {
      if (isEmpty$1(options4.value.value) || options4.value.value.trim() === "") return;
      else {
        target.$_ptooltipValue = options4.value.value;
        target.$_ptooltipDisabled = !!options4.value.disabled === options4.value.disabled ? options4.value.disabled : false;
        target.$_ptooltipEscape = !!options4.value.escape === options4.value.escape ? options4.value.escape : true;
        target.$_ptooltipClass = options4.value["class"] || "";
        target.$_ptooltipFitContent = !!options4.value.fitContent === options4.value.fitContent ? options4.value.fitContent : true;
        target.$_ptooltipIdAttr = options4.value.id || UniqueComponentId() + "_tooltip";
        target.$_ptooltipShowDelay = options4.value.showDelay || 0;
        target.$_ptooltipHideDelay = options4.value.hideDelay || 0;
        target.$_ptooltipAutoHide = !!options4.value.autoHide === options4.value.autoHide ? options4.value.autoHide : true;
      }
    }
    target.$_ptooltipZIndex = (_options$instance$$pr = options4.instance.$primevue) === null || _options$instance$$pr === void 0 || (_options$instance$$pr = _options$instance$$pr.config) === null || _options$instance$$pr === void 0 || (_options$instance$$pr = _options$instance$$pr.zIndex) === null || _options$instance$$pr === void 0 ? void 0 : _options$instance$$pr.tooltip;
    this.bindEvents(target, options4);
    el.setAttribute("data-pd-tooltip", true);
  }, "beforeMount"),
  updated: /* @__PURE__ */ __name(function updated(el, options4) {
    var target = this.getTarget(el);
    target.$_ptooltipModifiers = this.getModifiers(options4);
    this.unbindEvents(target);
    if (!options4.value) {
      return;
    }
    if (typeof options4.value === "string") {
      target.$_ptooltipValue = options4.value;
      target.$_ptooltipDisabled = false;
      target.$_ptooltipEscape = true;
      target.$_ptooltipClass = null;
      target.$_ptooltipIdAttr = target.$_ptooltipIdAttr || UniqueComponentId() + "_tooltip";
      target.$_ptooltipShowDelay = 0;
      target.$_ptooltipHideDelay = 0;
      target.$_ptooltipAutoHide = true;
      this.bindEvents(target, options4);
    } else if (_typeof$g(options4.value) === "object" && options4.value) {
      if (isEmpty$1(options4.value.value) || options4.value.value.trim() === "") {
        this.unbindEvents(target, options4);
        return;
      } else {
        target.$_ptooltipValue = options4.value.value;
        target.$_ptooltipDisabled = !!options4.value.disabled === options4.value.disabled ? options4.value.disabled : false;
        target.$_ptooltipEscape = !!options4.value.escape === options4.value.escape ? options4.value.escape : true;
        target.$_ptooltipClass = options4.value["class"] || "";
        target.$_ptooltipFitContent = !!options4.value.fitContent === options4.value.fitContent ? options4.value.fitContent : true;
        target.$_ptooltipIdAttr = options4.value.id || target.$_ptooltipIdAttr || UniqueComponentId() + "_tooltip";
        target.$_ptooltipShowDelay = options4.value.showDelay || 0;
        target.$_ptooltipHideDelay = options4.value.hideDelay || 0;
        target.$_ptooltipAutoHide = !!options4.value.autoHide === options4.value.autoHide ? options4.value.autoHide : true;
        this.bindEvents(target, options4);
      }
    }
  }, "updated"),
  unmounted: /* @__PURE__ */ __name(function unmounted(el, options4) {
    var target = this.getTarget(el);
    this.remove(target);
    this.unbindEvents(target, options4);
    if (target.$_ptooltipScrollHandler) {
      target.$_ptooltipScrollHandler.destroy();
      target.$_ptooltipScrollHandler = null;
    }
  }, "unmounted"),
  timer: void 0,
  methods: {
    bindEvents: /* @__PURE__ */ __name(function bindEvents(el, options4) {
      var _this = this;
      var modifiers2 = el.$_ptooltipModifiers;
      if (modifiers2.focus) {
        el.$_focusevent = function(event) {
          return _this.onFocus(event, options4);
        };
        el.addEventListener("focus", el.$_focusevent);
        el.addEventListener("blur", this.onBlur.bind(this));
      } else {
        el.$_mouseenterevent = function(event) {
          return _this.onMouseEnter(event, options4);
        };
        el.addEventListener("mouseenter", el.$_mouseenterevent);
        el.addEventListener("mouseleave", this.onMouseLeave.bind(this));
        el.addEventListener("click", this.onClick.bind(this));
      }
      el.addEventListener("keydown", this.onKeydown.bind(this));
    }, "bindEvents"),
    unbindEvents: /* @__PURE__ */ __name(function unbindEvents(el) {
      var modifiers2 = el.$_ptooltipModifiers;
      if (modifiers2.focus) {
        el.removeEventListener("focus", el.$_focusevent);
        el.$_focusevent = null;
        el.removeEventListener("blur", this.onBlur.bind(this));
      } else {
        el.removeEventListener("mouseenter", el.$_mouseenterevent);
        el.$_mouseenterevent = null;
        el.removeEventListener("mouseleave", this.onMouseLeave.bind(this));
        el.removeEventListener("click", this.onClick.bind(this));
      }
      el.removeEventListener("keydown", this.onKeydown.bind(this));
    }, "unbindEvents"),
    bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener(el) {
      var _this2 = this;
      if (!el.$_ptooltipScrollHandler) {
        el.$_ptooltipScrollHandler = new ConnectedOverlayScrollHandler(el, function() {
          _this2.hide(el);
        });
      }
      el.$_ptooltipScrollHandler.bindScrollListener();
    }, "bindScrollListener"),
    unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener(el) {
      if (el.$_ptooltipScrollHandler) {
        el.$_ptooltipScrollHandler.unbindScrollListener();
      }
    }, "unbindScrollListener"),
    onMouseEnter: /* @__PURE__ */ __name(function onMouseEnter(event, options4) {
      var el = event.currentTarget;
      var showDelay = el.$_ptooltipShowDelay;
      this.show(el, options4, showDelay);
    }, "onMouseEnter"),
    onMouseLeave: /* @__PURE__ */ __name(function onMouseLeave(event) {
      var el = event.currentTarget;
      var hideDelay = el.$_ptooltipHideDelay;
      var autoHide = el.$_ptooltipAutoHide;
      if (!autoHide) {
        var valid = getAttribute(event.target, "data-pc-name") === "tooltip" || getAttribute(event.target, "data-pc-section") === "arrow" || getAttribute(event.target, "data-pc-section") === "text" || getAttribute(event.relatedTarget, "data-pc-name") === "tooltip" || getAttribute(event.relatedTarget, "data-pc-section") === "arrow" || getAttribute(event.relatedTarget, "data-pc-section") === "text";
        !valid && this.hide(el, hideDelay);
      } else {
        this.hide(el, hideDelay);
      }
    }, "onMouseLeave"),
    onFocus: /* @__PURE__ */ __name(function onFocus(event, options4) {
      var el = event.currentTarget;
      var showDelay = el.$_ptooltipShowDelay;
      this.show(el, options4, showDelay);
    }, "onFocus"),
    onBlur: /* @__PURE__ */ __name(function onBlur(event) {
      var el = event.currentTarget;
      var hideDelay = el.$_ptooltipHideDelay;
      this.hide(el, hideDelay);
    }, "onBlur"),
    onClick: /* @__PURE__ */ __name(function onClick(event) {
      var el = event.currentTarget;
      var hideDelay = el.$_ptooltipHideDelay;
      this.hide(el, hideDelay);
    }, "onClick"),
    onKeydown: /* @__PURE__ */ __name(function onKeydown(event) {
      var el = event.currentTarget;
      var hideDelay = el.$_ptooltipHideDelay;
      event.code === "Escape" && this.hide(event.currentTarget, hideDelay);
    }, "onKeydown"),
    tooltipActions: /* @__PURE__ */ __name(function tooltipActions(el, options4) {
      if (el.$_ptooltipDisabled || !isExist(el)) {
        return;
      }
      var tooltipElement = this.create(el, options4);
      this.align(el);
      !this.isUnstyled() && fadeIn(tooltipElement, 250);
      var $this = this;
      window.addEventListener("resize", /* @__PURE__ */ __name(function onWindowResize() {
        if (!isTouchDevice()) {
          $this.hide(el);
        }
        window.removeEventListener("resize", onWindowResize);
      }, "onWindowResize"));
      tooltipElement.addEventListener("mouseleave", /* @__PURE__ */ __name(function onTooltipLeave() {
        $this.hide(el);
        tooltipElement.removeEventListener("mouseleave", onTooltipLeave);
      }, "onTooltipLeave"));
      this.bindScrollListener(el);
      ZIndex.set("tooltip", tooltipElement, el.$_ptooltipZIndex);
    }, "tooltipActions"),
    show: /* @__PURE__ */ __name(function show(el, options4, showDelay) {
      var _this3 = this;
      if (showDelay !== void 0) {
        this.timer = setTimeout(function() {
          return _this3.tooltipActions(el, options4);
        }, showDelay);
      } else {
        this.tooltipActions(el, options4);
      }
    }, "show"),
    tooltipRemoval: /* @__PURE__ */ __name(function tooltipRemoval(el) {
      this.remove(el);
      this.unbindScrollListener(el);
    }, "tooltipRemoval"),
    hide: /* @__PURE__ */ __name(function hide(el, hideDelay) {
      var _this4 = this;
      clearTimeout(this.timer);
      if (hideDelay !== void 0) {
        setTimeout(function() {
          return _this4.tooltipRemoval(el);
        }, hideDelay);
      } else {
        this.tooltipRemoval(el);
      }
    }, "hide"),
    getTooltipElement: /* @__PURE__ */ __name(function getTooltipElement(el) {
      return document.getElementById(el.$_ptooltipId);
    }, "getTooltipElement"),
    create: /* @__PURE__ */ __name(function create2(el) {
      var modifiers2 = el.$_ptooltipModifiers;
      var tooltipArrow = createElement("div", {
        "class": !this.isUnstyled() && this.cx("arrow"),
        "p-bind": this.ptm("arrow", {
          context: modifiers2
        })
      });
      var tooltipText = createElement("div", {
        "class": !this.isUnstyled() && this.cx("text"),
        "p-bind": this.ptm("text", {
          context: modifiers2
        })
      });
      if (!el.$_ptooltipEscape) {
        tooltipText.innerHTML = el.$_ptooltipValue;
      } else {
        tooltipText.innerHTML = "";
        tooltipText.appendChild(document.createTextNode(el.$_ptooltipValue));
      }
      var container = createElement("div", _defineProperty$g(_defineProperty$g({
        id: el.$_ptooltipIdAttr,
        role: "tooltip",
        style: {
          display: "inline-block",
          width: el.$_ptooltipFitContent ? "fit-content" : void 0,
          pointerEvents: !this.isUnstyled() && el.$_ptooltipAutoHide && "none"
        },
        "class": [!this.isUnstyled() && this.cx("root"), el.$_ptooltipClass]
      }, this.$attrSelector, ""), "p-bind", this.ptm("root", {
        context: modifiers2
      })), tooltipArrow, tooltipText);
      document.body.appendChild(container);
      el.$_ptooltipId = container.id;
      this.$el = container;
      return container;
    }, "create"),
    remove: /* @__PURE__ */ __name(function remove2(el) {
      if (el) {
        var tooltipElement = this.getTooltipElement(el);
        if (tooltipElement && tooltipElement.parentElement) {
          ZIndex.clear(tooltipElement);
          document.body.removeChild(tooltipElement);
        }
        el.$_ptooltipId = null;
      }
    }, "remove"),
    align: /* @__PURE__ */ __name(function align(el) {
      var modifiers2 = el.$_ptooltipModifiers;
      if (modifiers2.top) {
        this.alignTop(el);
        if (this.isOutOfBounds(el)) {
          this.alignBottom(el);
          if (this.isOutOfBounds(el)) {
            this.alignTop(el);
          }
        }
      } else if (modifiers2.left) {
        this.alignLeft(el);
        if (this.isOutOfBounds(el)) {
          this.alignRight(el);
          if (this.isOutOfBounds(el)) {
            this.alignTop(el);
            if (this.isOutOfBounds(el)) {
              this.alignBottom(el);
              if (this.isOutOfBounds(el)) {
                this.alignLeft(el);
              }
            }
          }
        }
      } else if (modifiers2.bottom) {
        this.alignBottom(el);
        if (this.isOutOfBounds(el)) {
          this.alignTop(el);
          if (this.isOutOfBounds(el)) {
            this.alignBottom(el);
          }
        }
      } else {
        this.alignRight(el);
        if (this.isOutOfBounds(el)) {
          this.alignLeft(el);
          if (this.isOutOfBounds(el)) {
            this.alignTop(el);
            if (this.isOutOfBounds(el)) {
              this.alignBottom(el);
              if (this.isOutOfBounds(el)) {
                this.alignRight(el);
              }
            }
          }
        }
      }
    }, "align"),
    getHostOffset: /* @__PURE__ */ __name(function getHostOffset(el) {
      var offset = el.getBoundingClientRect();
      var targetLeft = offset.left + getWindowScrollLeft();
      var targetTop = offset.top + getWindowScrollTop();
      return {
        left: targetLeft,
        top: targetTop
      };
    }, "getHostOffset"),
    alignRight: /* @__PURE__ */ __name(function alignRight(el) {
      this.preAlign(el, "right");
      var tooltipElement = this.getTooltipElement(el);
      var hostOffset = this.getHostOffset(el);
      var left = hostOffset.left + getOuterWidth(el);
      var top = hostOffset.top + (getOuterHeight(el) - getOuterHeight(tooltipElement)) / 2;
      tooltipElement.style.left = left + "px";
      tooltipElement.style.top = top + "px";
    }, "alignRight"),
    alignLeft: /* @__PURE__ */ __name(function alignLeft(el) {
      this.preAlign(el, "left");
      var tooltipElement = this.getTooltipElement(el);
      var hostOffset = this.getHostOffset(el);
      var left = hostOffset.left - getOuterWidth(tooltipElement);
      var top = hostOffset.top + (getOuterHeight(el) - getOuterHeight(tooltipElement)) / 2;
      tooltipElement.style.left = left + "px";
      tooltipElement.style.top = top + "px";
    }, "alignLeft"),
    alignTop: /* @__PURE__ */ __name(function alignTop(el) {
      this.preAlign(el, "top");
      var tooltipElement = this.getTooltipElement(el);
      var hostOffset = this.getHostOffset(el);
      var left = hostOffset.left + (getOuterWidth(el) - getOuterWidth(tooltipElement)) / 2;
      var top = hostOffset.top - getOuterHeight(tooltipElement);
      tooltipElement.style.left = left + "px";
      tooltipElement.style.top = top + "px";
    }, "alignTop"),
    alignBottom: /* @__PURE__ */ __name(function alignBottom(el) {
      this.preAlign(el, "bottom");
      var tooltipElement = this.getTooltipElement(el);
      var hostOffset = this.getHostOffset(el);
      var left = hostOffset.left + (getOuterWidth(el) - getOuterWidth(tooltipElement)) / 2;
      var top = hostOffset.top + getOuterHeight(el);
      tooltipElement.style.left = left + "px";
      tooltipElement.style.top = top + "px";
    }, "alignBottom"),
    preAlign: /* @__PURE__ */ __name(function preAlign(el, position3) {
      var tooltipElement = this.getTooltipElement(el);
      tooltipElement.style.left = "-999px";
      tooltipElement.style.top = "-999px";
      removeClass(tooltipElement, "p-tooltip-".concat(tooltipElement.$_ptooltipPosition));
      !this.isUnstyled() && addClass(tooltipElement, "p-tooltip-".concat(position3));
      tooltipElement.$_ptooltipPosition = position3;
      tooltipElement.setAttribute("data-p-position", position3);
      var arrowElement = findSingle(tooltipElement, '[data-pc-section="arrow"]');
      arrowElement.style.top = position3 === "bottom" ? "0" : position3 === "right" || position3 === "left" || position3 !== "right" && position3 !== "left" && position3 !== "top" && position3 !== "bottom" ? "50%" : null;
      arrowElement.style.bottom = position3 === "top" ? "0" : null;
      arrowElement.style.left = position3 === "right" || position3 !== "right" && position3 !== "left" && position3 !== "top" && position3 !== "bottom" ? "0" : position3 === "top" || position3 === "bottom" ? "50%" : null;
      arrowElement.style.right = position3 === "left" ? "0" : null;
    }, "preAlign"),
    isOutOfBounds: /* @__PURE__ */ __name(function isOutOfBounds(el) {
      var tooltipElement = this.getTooltipElement(el);
      var offset = tooltipElement.getBoundingClientRect();
      var targetTop = offset.top;
      var targetLeft = offset.left;
      var width2 = getOuterWidth(tooltipElement);
      var height = getOuterHeight(tooltipElement);
      var viewport = getViewport();
      return targetLeft + width2 > viewport.width || targetLeft < 0 || targetTop < 0 || targetTop + height > viewport.height;
    }, "isOutOfBounds"),
    getTarget: /* @__PURE__ */ __name(function getTarget2(el) {
      return hasClass(el, "p-inputwrapper") ? findSingle(el, "input") : el;
    }, "getTarget"),
    getModifiers: /* @__PURE__ */ __name(function getModifiers(options4) {
      if (options4.modifiers && Object.keys(options4.modifiers).length) {
        return options4.modifiers;
      }
      if (options4.arg && _typeof$g(options4.arg) === "object") {
        return Object.entries(options4.arg).reduce(function(acc, _ref) {
          var _ref2 = _slicedToArray$2(_ref, 2), key = _ref2[0], val = _ref2[1];
          if (key === "event" || key === "position") acc[val] = true;
          return acc;
        }, {});
      }
      return {};
    }, "getModifiers")
  }
});
const scriptRel = "modulepreload";
const assetsURL = /* @__PURE__ */ __name(function(dep, importerUrl) {
  return new URL(dep, importerUrl).href;
}, "assetsURL");
const seen = {};
const __vitePreload = /* @__PURE__ */ __name(function preload(baseModule, deps, importerUrl) {
  let promise = Promise.resolve();
  if (deps && deps.length > 0) {
    const links = document.getElementsByTagName("link");
    const cspNonceMeta = document.querySelector(
      "meta[property=csp-nonce]"
    );
    const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
    promise = Promise.allSettled(
      deps.map((dep) => {
        dep = assetsURL(dep, importerUrl);
        if (dep in seen) return;
        seen[dep] = true;
        const isCss = dep.endsWith(".css");
        const cssSelector = isCss ? '[rel="stylesheet"]' : "";
        const isBaseRelative = !!importerUrl;
        if (isBaseRelative) {
          for (let i2 = links.length - 1; i2 >= 0; i2--) {
            const link22 = links[i2];
            if (link22.href === dep && (!isCss || link22.rel === "stylesheet")) {
              return;
            }
          }
        } else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
          return;
        }
        const link2 = document.createElement("link");
        link2.rel = isCss ? "stylesheet" : scriptRel;
        if (!isCss) {
          link2.as = "script";
        }
        link2.crossOrigin = "";
        link2.href = dep;
        if (cspNonce) {
          link2.setAttribute("nonce", cspNonce);
        }
        document.head.appendChild(link2);
        if (isCss) {
          return new Promise((res, rej) => {
            link2.addEventListener("load", res);
            link2.addEventListener(
              "error",
              () => rej(new Error(`Unable to preload CSS for ${dep}`))
            );
          });
        }
      })
    );
  }
  function handlePreloadError(err) {
    const e2 = new Event("vite:preloadError", {
      cancelable: true
    });
    e2.payload = err;
    window.dispatchEvent(e2);
    if (!e2.defaultPrevented) {
      throw err;
    }
  }
  __name(handlePreloadError, "handlePreloadError");
  return promise.then((res) => {
    for (const item3 of res || []) {
      if (item3.status !== "rejected") continue;
      handlePreloadError(item3.reason);
    }
    return baseModule().catch(handlePreloadError);
  });
}, "preload");
/*!
  * vue-router v4.4.3
  * (c) 2024 Eduardo San Martin Morote
  * @license MIT
  */
const isBrowser = typeof document !== "undefined";
function isESModule(obj) {
  return obj.__esModule || obj[Symbol.toStringTag] === "Module";
}
__name(isESModule, "isESModule");
const assign$5 = Object.assign;
function applyToParams(fn, params) {
  const newParams = {};
  for (const key in params) {
    const value4 = params[key];
    newParams[key] = isArray$3(value4) ? value4.map(fn) : fn(value4);
  }
  return newParams;
}
__name(applyToParams, "applyToParams");
const noop$3 = /* @__PURE__ */ __name(() => {
}, "noop$3");
const isArray$3 = Array.isArray;
function warn$2(msg) {
  const args = Array.from(arguments).slice(1);
  console.warn.apply(console, ["[Vue Router warn]: " + msg].concat(args));
}
__name(warn$2, "warn$2");
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(text2) {
  return encodeURI("" + text2).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
}
__name(commonEncode, "commonEncode");
function encodeHash(text2) {
  return commonEncode(text2).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
}
__name(encodeHash, "encodeHash");
function encodeQueryValue(text2) {
  return commonEncode(text2).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, "^");
}
__name(encodeQueryValue, "encodeQueryValue");
function encodeQueryKey(text2) {
  return encodeQueryValue(text2).replace(EQUAL_RE, "%3D");
}
__name(encodeQueryKey, "encodeQueryKey");
function encodePath(text2) {
  return commonEncode(text2).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
}
__name(encodePath, "encodePath");
function encodeParam(text2) {
  return text2 == null ? "" : encodePath(text2).replace(SLASH_RE, "%2F");
}
__name(encodeParam, "encodeParam");
function decode$3(text2) {
  try {
    return decodeURIComponent("" + text2);
  } catch (err) {
  }
  return "" + text2;
}
__name(decode$3, "decode$3");
const TRAILING_SLASH_RE = /\/$/;
const removeTrailingSlash = /* @__PURE__ */ __name((path) => path.replace(TRAILING_SLASH_RE, ""), "removeTrailingSlash");
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$3(hash)
  };
}
__name(parseURL, "parseURL");
function stringifyURL(stringifyQuery2, location2) {
  const query = location2.query ? stringifyQuery2(location2.query) : "";
  return location2.path + (query && "?") + query + (location2.hash || "");
}
__name(stringifyURL, "stringifyURL");
function stripBase(pathname, base2) {
  if (!base2 || !pathname.toLowerCase().startsWith(base2.toLowerCase()))
    return pathname;
  return pathname.slice(base2.length) || "/";
}
__name(stripBase, "stripBase");
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;
}
__name(isSameRouteLocation, "isSameRouteLocation");
function isSameRouteRecord(a, b) {
  return (a.aliasOf || a) === (b.aliasOf || b);
}
__name(isSameRouteRecord, "isSameRouteRecord");
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;
}
__name(isSameRouteLocationParams, "isSameRouteLocationParams");
function isSameRouteLocationParamsValue(a, b) {
  return isArray$3(a) ? isEquivalentArray(a, b) : isArray$3(b) ? isEquivalentArray(b, a) : a === b;
}
__name(isSameRouteLocationParamsValue, "isSameRouteLocationParamsValue");
function isEquivalentArray(a, b) {
  return isArray$3(b) ? a.length === b.length && a.every((value4, i2) => value4 === b[i2]) : a.length === 1 && a[0] === b;
}
__name(isEquivalentArray, "isEquivalentArray");
function resolveRelativePath(to, from2) {
  if (to.startsWith("/"))
    return to;
  if (false) {
    warn$2(`Cannot resolve a relative location without an absolute path. Trying to resolve "${to}" from "${from2}". It should look like "/${from2}".`);
    return to;
  }
  if (!to)
    return from2;
  const fromSegments = from2.split("/");
  const toSegments = to.split("/");
  const lastToSegment = toSegments[toSegments.length - 1];
  if (lastToSegment === ".." || lastToSegment === ".") {
    toSegments.push("");
  }
  let position3 = fromSegments.length - 1;
  let toPosition;
  let segment;
  for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
    segment = toSegments[toPosition];
    if (segment === ".")
      continue;
    if (segment === "..") {
      if (position3 > 1)
        position3--;
    } else
      break;
  }
  return fromSegments.slice(0, position3).join("/") + "/" + toSegments.slice(toPosition).join("/");
}
__name(resolveRelativePath, "resolveRelativePath");
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 = {}));
const START = "";
function normalizeBase(base2) {
  if (!base2) {
    if (isBrowser) {
      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);
}
__name(normalizeBase, "normalizeBase");
const BEFORE_HASH_RE = /^[^#]+#/;
function createHref(base2, location2) {
  return base2.replace(BEFORE_HASH_RE, "#") + location2;
}
__name(createHref, "createHref");
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)
  };
}
__name(getElementPosition, "getElementPosition");
const computeScrollPosition = /* @__PURE__ */ __name(() => ({
  left: window.scrollX,
  top: window.scrollY
}), "computeScrollPosition");
function scrollToPosition(position3) {
  let scrollToOptions;
  if ("el" in position3) {
    const positionEl = position3.el;
    const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
    if (false) {
      if (!isIdSelector || !document.getElementById(position3.el.slice(1))) {
        try {
          const foundEl = document.querySelector(position3.el);
          if (isIdSelector && foundEl) {
            warn$2(`The selector "${position3.el}" should be passed as "el: document.querySelector('${position3.el}')" because it starts with "#".`);
            return;
          }
        } catch (err) {
          warn$2(`The selector "${position3.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);
          return;
        }
      }
    }
    const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
    if (!el) {
      return;
    }
    scrollToOptions = getElementPosition(el, position3);
  } else {
    scrollToOptions = position3;
  }
  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);
  }
}
__name(scrollToPosition, "scrollToPosition");
function getScrollKey(path, delta2) {
  const position3 = history.state ? history.state.position - delta2 : -1;
  return position3 + path;
}
__name(getScrollKey, "getScrollKey");
const scrollPositions = /* @__PURE__ */ new Map();
function saveScrollPosition(key, scrollPosition) {
  scrollPositions.set(key, scrollPosition);
}
__name(saveScrollPosition, "saveScrollPosition");
function getSavedScrollPosition(key) {
  const scroll = scrollPositions.get(key);
  scrollPositions.delete(key);
  return scroll;
}
__name(getSavedScrollPosition, "getSavedScrollPosition");
let createBaseLocation = /* @__PURE__ */ __name(() => location.protocol + "//" + location.host, "createBaseLocation");
function createCurrentLocation(base2, location2) {
  const { pathname, search: search2, 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 + search2 + hash;
}
__name(createCurrentLocation, "createCurrentLocation");
function useHistoryListeners(base2, historyState, currentLocation, replace2) {
  let listeners = [];
  let teardowns = [];
  let pauseState = null;
  const popStateHandler = /* @__PURE__ */ __name(({ state }) => {
    const to = createCurrentLocation(base2, location);
    const from2 = currentLocation.value;
    const fromState = historyState.value;
    let delta2 = 0;
    if (state) {
      currentLocation.value = to;
      historyState.value = state;
      if (pauseState && pauseState === from2) {
        pauseState = null;
        return;
      }
      delta2 = fromState ? state.position - fromState.position : 0;
    } else {
      replace2(to);
    }
    listeners.forEach((listener) => {
      listener(currentLocation.value, from2, {
        delta: delta2,
        type: NavigationType.pop,
        direction: delta2 ? delta2 > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
      });
    });
  }, "popStateHandler");
  function pauseListeners() {
    pauseState = currentLocation.value;
  }
  __name(pauseListeners, "pauseListeners");
  function listen(callback) {
    listeners.push(callback);
    const teardown = /* @__PURE__ */ __name(() => {
      const index2 = listeners.indexOf(callback);
      if (index2 > -1)
        listeners.splice(index2, 1);
    }, "teardown");
    teardowns.push(teardown);
    return teardown;
  }
  __name(listen, "listen");
  function beforeUnloadListener() {
    const { history: history2 } = window;
    if (!history2.state)
      return;
    history2.replaceState(assign$5({}, history2.state, { scroll: computeScrollPosition() }), "");
  }
  __name(beforeUnloadListener, "beforeUnloadListener");
  function destroy() {
    for (const teardown of teardowns)
      teardown();
    teardowns = [];
    window.removeEventListener("popstate", popStateHandler);
    window.removeEventListener("beforeunload", beforeUnloadListener);
  }
  __name(destroy, "destroy");
  window.addEventListener("popstate", popStateHandler);
  window.addEventListener("beforeunload", beforeUnloadListener, {
    passive: true
  });
  return {
    pauseListeners,
    listen,
    destroy
  };
}
__name(useHistoryListeners, "useHistoryListeners");
function buildState(back, current, forward, replaced = false, computeScroll = false) {
  return {
    back,
    current,
    forward,
    replaced,
    position: window.history.length,
    scroll: computeScroll ? computeScrollPosition() : null
  };
}
__name(buildState, "buildState");
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, replace22) {
    const hashIndex = base2.indexOf("#");
    const url = hashIndex > -1 ? (location2.host && document.querySelector("base") ? base2 : base2.slice(hashIndex)) + to : createBaseLocation() + base2 + to;
    try {
      history2[replace22 ? "replaceState" : "pushState"](state, "", url);
      historyState.value = state;
    } catch (err) {
      if (false) {
        warn$2("Error with push/replace State", err);
      } else {
        console.error(err);
      }
      location2[replace22 ? "replace" : "assign"](url);
    }
  }
  __name(changeLocation, "changeLocation");
  function replace2(to, data24) {
    const state = assign$5({}, history2.state, buildState(
      historyState.value.back,
      // keep back and forward entries but override current position
      to,
      historyState.value.forward,
      true
    ), data24, { position: historyState.value.position });
    changeLocation(to, state, true);
    currentLocation.value = to;
  }
  __name(replace2, "replace");
  function push(to, data24) {
    const currentState = assign$5(
      {},
      // 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()
      }
    );
    if (false) {
      warn$2(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:

history.replaceState(history.state, '', url)

You can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state`);
    }
    changeLocation(currentState.current, currentState, true);
    const state = assign$5({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data24);
    changeLocation(to, state, false);
    currentLocation.value = to;
  }
  __name(push, "push");
  return {
    location: currentLocation,
    state: historyState,
    push,
    replace: replace2
  };
}
__name(useHistoryStateNavigation, "useHistoryStateNavigation");
function createWebHistory(base2) {
  base2 = normalizeBase(base2);
  const historyNavigation = useHistoryStateNavigation(base2);
  const historyListeners = useHistoryListeners(base2, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
  function go(delta2, triggerListeners = true) {
    if (!triggerListeners)
      historyListeners.pauseListeners();
    history.go(delta2);
  }
  __name(go, "go");
  const routerHistory = assign$5({
    // it's overridden right after
    location: "",
    base: base2,
    go,
    createHref: createHref.bind(null, base2)
  }, historyNavigation, historyListeners);
  Object.defineProperty(routerHistory, "location", {
    enumerable: true,
    get: /* @__PURE__ */ __name(() => historyNavigation.location.value, "get")
  });
  Object.defineProperty(routerHistory, "state", {
    enumerable: true,
    get: /* @__PURE__ */ __name(() => historyNavigation.state.value, "get")
  });
  return routerHistory;
}
__name(createWebHistory, "createWebHistory");
function createMemoryHistory(base2 = "") {
  let listeners = [];
  let queue2 = [START];
  let position3 = 0;
  base2 = normalizeBase(base2);
  function setLocation(location2) {
    position3++;
    if (position3 !== queue2.length) {
      queue2.splice(position3);
    }
    queue2.push(location2);
  }
  __name(setLocation, "setLocation");
  function triggerListeners(to, from2, { direction, delta: delta2 }) {
    const info = {
      direction,
      delta: delta2,
      type: NavigationType.pop
    };
    for (const callback of listeners) {
      callback(to, from2, info);
    }
  }
  __name(triggerListeners, "triggerListeners");
  const routerHistory = {
    // rewritten by Object.defineProperty
    location: START,
    // TODO: should be kept in queue
    state: {},
    base: base2,
    createHref: createHref.bind(null, base2),
    replace(to) {
      queue2.splice(position3--, 1);
      setLocation(to);
    },
    push(to, data24) {
      setLocation(to);
    },
    listen(callback) {
      listeners.push(callback);
      return () => {
        const index2 = listeners.indexOf(callback);
        if (index2 > -1)
          listeners.splice(index2, 1);
      };
    },
    destroy() {
      listeners = [];
      queue2 = [START];
      position3 = 0;
    },
    go(delta2, shouldTrigger = true) {
      const from2 = this.location;
      const direction = (
        // we are considering delta === 0 going forward, but in abstract mode
        // using 0 for the delta doesn't make sense like it does in html5 where
        // it reloads the page
        delta2 < 0 ? NavigationDirection.back : NavigationDirection.forward
      );
      position3 = Math.max(0, Math.min(position3 + delta2, queue2.length - 1));
      if (shouldTrigger) {
        triggerListeners(this.location, from2, {
          direction,
          delta: delta2
        });
      }
    }
  };
  Object.defineProperty(routerHistory, "location", {
    enumerable: true,
    get: /* @__PURE__ */ __name(() => queue2[position3], "get")
  });
  return routerHistory;
}
__name(createMemoryHistory, "createMemoryHistory");
function createWebHashHistory(base2) {
  base2 = location.host ? base2 || location.pathname + location.search : "";
  if (!base2.includes("#"))
    base2 += "#";
  if (false) {
    warn$2(`A hash base must end with a "#":
"${base2}" should be "${base2.replace(/#.*$/, "#")}".`);
  }
  return createWebHistory(base2);
}
__name(createWebHashHistory, "createWebHashHistory");
function isRouteLocation(route) {
  return typeof route === "string" || route && typeof route === "object";
}
__name(isRouteLocation, "isRouteLocation");
function isRouteName(name2) {
  return typeof name2 === "string" || typeof name2 === "symbol";
}
__name(isRouteName, "isRouteName");
const NavigationFailureSymbol = Symbol(false ? "navigation failure" : "");
var NavigationFailureType;
(function(NavigationFailureType2) {
  NavigationFailureType2[NavigationFailureType2["aborted"] = 4] = "aborted";
  NavigationFailureType2[NavigationFailureType2["cancelled"] = 8] = "cancelled";
  NavigationFailureType2[NavigationFailureType2["duplicated"] = 16] = "duplicated";
})(NavigationFailureType || (NavigationFailureType = {}));
const ErrorTypeMessages = {
  [
    1
    /* ErrorTypes.MATCHER_NOT_FOUND */
  ]({ location: location2, currentLocation }) {
    return `No match for
 ${JSON.stringify(location2)}${currentLocation ? "\nwhile being at\n" + JSON.stringify(currentLocation) : ""}`;
  },
  [
    2
    /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
  ]({ from: from2, to }) {
    return `Redirected from "${from2.fullPath}" to "${stringifyRoute(to)}" via a navigation guard.`;
  },
  [
    4
    /* ErrorTypes.NAVIGATION_ABORTED */
  ]({ from: from2, to }) {
    return `Navigation aborted from "${from2.fullPath}" to "${to.fullPath}" via a navigation guard.`;
  },
  [
    8
    /* ErrorTypes.NAVIGATION_CANCELLED */
  ]({ from: from2, to }) {
    return `Navigation cancelled from "${from2.fullPath}" to "${to.fullPath}" with a new navigation.`;
  },
  [
    16
    /* ErrorTypes.NAVIGATION_DUPLICATED */
  ]({ from: from2, to }) {
    return `Avoided redundant navigation to current location: "${from2.fullPath}".`;
  }
};
function createRouterError(type, params) {
  if (false) {
    return assign$5(new Error(ErrorTypeMessages[type](params)), {
      type,
      [NavigationFailureSymbol]: true
    }, params);
  } else {
    return assign$5(new Error(), {
      type,
      [NavigationFailureSymbol]: true
    }, params);
  }
}
__name(createRouterError, "createRouterError");
function isNavigationFailure(error2, type) {
  return error2 instanceof Error && NavigationFailureSymbol in error2 && (type == null || !!(error2.type & type));
}
__name(isNavigationFailure, "isNavigationFailure");
const propertiesToLog = ["params", "query", "hash"];
function stringifyRoute(to) {
  if (typeof to === "string")
    return to;
  if (to.path != null)
    return to.path;
  const location2 = {};
  for (const key of propertiesToLog) {
    if (key in to)
      location2[key] = to[key];
  }
  return JSON.stringify(location2, null, 2);
}
__name(stringifyRoute, "stringifyRoute");
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 options4 = assign$5({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
  const score = [];
  let pattern = options4.start ? "^" : "";
  const keys2 = [];
  for (const segment of segments) {
    const segmentScores = segment.length ? [] : [
      90
      /* PathScore.Root */
    ];
    if (options4.strict && !segment.length)
      pattern += "/";
    for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
      const token = segment[tokenIndex];
      let subSegmentScore = 40 + (options4.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: value4, repeatable, optional, regexp: regexp2 } = token;
        keys2.push({
          name: value4,
          repeatable,
          optional
        });
        const re2 = regexp2 ? regexp2 : BASE_PARAM_PATTERN;
        if (re2 !== BASE_PARAM_PATTERN) {
          subSegmentScore += 10;
          try {
            new RegExp(`(${re2})`);
          } catch (err) {
            throw new Error(`Invalid custom RegExp for param "${value4}" (${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 (options4.strict && options4.end) {
    const i2 = score.length - 1;
    score[i2][score[i2].length - 1] += 0.7000000000000001;
  }
  if (!options4.strict)
    pattern += "/?";
  if (options4.end)
    pattern += "$";
  else if (options4.strict)
    pattern += "(?:/|$)";
  const re = new RegExp(pattern, options4.sensitive ? "" : "i");
  function parse2(path) {
    const match2 = path.match(re);
    const params = {};
    if (!match2)
      return null;
    for (let i2 = 1; i2 < match2.length; i2++) {
      const value4 = match2[i2] || "";
      const key = keys2[i2 - 1];
      params[key.name] = value4 && key.repeatable ? value4.split("/") : value4;
    }
    return params;
  }
  __name(parse2, "parse");
  function stringify2(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: value4, repeatable, optional } = token;
          const param = value4 in params ? params[value4] : "";
          if (isArray$3(param) && !repeatable) {
            throw new Error(`Provided param "${value4}" is an array but it is not repeatable (* or + modifiers)`);
          }
          const text2 = isArray$3(param) ? param.join("/") : param;
          if (!text2) {
            if (optional) {
              if (segment.length < 2) {
                if (path.endsWith("/"))
                  path = path.slice(0, -1);
                else
                  avoidDuplicatedSlash = true;
              }
            } else
              throw new Error(`Missing required param "${value4}"`);
          }
          path += text2;
        }
      }
    }
    return path || "/";
  }
  __name(stringify2, "stringify");
  return {
    re,
    score,
    keys: keys2,
    parse: parse2,
    stringify: stringify2
  };
}
__name(tokensToParser, "tokensToParser");
function compareScoreArray(a, b) {
  let i2 = 0;
  while (i2 < a.length && i2 < b.length) {
    const diff2 = b[i2] - a[i2];
    if (diff2)
      return diff2;
    i2++;
  }
  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;
}
__name(compareScoreArray, "compareScoreArray");
function comparePathParserScore(a, b) {
  let i2 = 0;
  const aScore = a.score;
  const bScore = b.score;
  while (i2 < aScore.length && i2 < bScore.length) {
    const comp = compareScoreArray(aScore[i2], bScore[i2]);
    if (comp)
      return comp;
    i2++;
  }
  if (Math.abs(bScore.length - aScore.length) === 1) {
    if (isLastScoreNegative(aScore))
      return 1;
    if (isLastScoreNegative(bScore))
      return -1;
  }
  return bScore.length - aScore.length;
}
__name(comparePathParserScore, "comparePathParserScore");
function isLastScoreNegative(score) {
  const last = score[score.length - 1];
  return score.length > 0 && last[last.length - 1] < 0;
}
__name(isLastScoreNegative, "isLastScoreNegative");
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(false ? `Route paths should start with a "/": "${path}" should be "/${path}".` : `Invalid path "${path}"`);
  }
  function crash(message3) {
    throw new Error(`ERR (${state})/"${buffer2}": ${message3}`);
  }
  __name(crash, "crash");
  let state = 0;
  let previousState = state;
  const tokens = [];
  let segment;
  function finalizeSegment() {
    if (segment)
      tokens.push(segment);
    segment = [];
  }
  __name(finalizeSegment, "finalizeSegment");
  let i2 = 0;
  let char;
  let buffer2 = "";
  let customRe = "";
  function consumeBuffer() {
    if (!buffer2)
      return;
    if (state === 0) {
      segment.push({
        type: 0,
        value: buffer2
      });
    } else if (state === 1 || state === 2 || state === 3) {
      if (segment.length > 1 && (char === "*" || char === "+"))
        crash(`A repeatable param (${buffer2}) must be alone in its segment. eg: '/:ids+.`);
      segment.push({
        type: 1,
        value: buffer2,
        regexp: customRe,
        repeatable: char === "*" || char === "+",
        optional: char === "*" || char === "?"
      });
    } else {
      crash("Invalid state to consume buffer");
    }
    buffer2 = "";
  }
  __name(consumeBuffer, "consumeBuffer");
  function addCharToBuffer() {
    buffer2 += char;
  }
  __name(addCharToBuffer, "addCharToBuffer");
  while (i2 < path.length) {
    char = path[i2++];
    if (char === "\\" && state !== 2) {
      previousState = state;
      state = 4;
      continue;
    }
    switch (state) {
      case 0:
        if (char === "/") {
          if (buffer2) {
            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 !== "+")
            i2--;
        }
        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 !== "+")
          i2--;
        customRe = "";
        break;
      default:
        crash("Unknown state");
        break;
    }
  }
  if (state === 2)
    crash(`Unfinished custom RegExp for param "${buffer2}"`);
  consumeBuffer();
  finalizeSegment();
  return tokens;
}
__name(tokenizePath, "tokenizePath");
function createRouteRecordMatcher(record, parent, options4) {
  const parser = tokensToParser(tokenizePath(record.path), options4);
  if (false) {
    const existingKeys = /* @__PURE__ */ new Set();
    for (const key of parser.keys) {
      if (existingKeys.has(key.name))
        warn$2(`Found duplicated params with name "${key.name}" for path "${record.path}". Only the last one will be available on "$route.params".`);
      existingKeys.add(key.name);
    }
  }
  const matcher = assign$5(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;
}
__name(createRouteRecordMatcher, "createRouteRecordMatcher");
function createRouterMatcher(routes, globalOptions) {
  const matchers = [];
  const matcherMap = /* @__PURE__ */ new Map();
  globalOptions = mergeOptions({ strict: false, end: true, sensitive: false }, globalOptions);
  function getRecordMatcher(name2) {
    return matcherMap.get(name2);
  }
  __name(getRecordMatcher, "getRecordMatcher");
  function addRoute(record, parent, originalRecord) {
    const isRootAdd = !originalRecord;
    const mainNormalizedRecord = normalizeRouteRecord(record);
    if (false) {
      checkChildMissingNameWithEmptyPath(mainNormalizedRecord, parent);
    }
    mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
    const options4 = 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(assign$5({}, 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);
      }
      if (false) {
        throw new Error('Catch all routes ("*") must now be defined using a param with a custom regexp.\nSee more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.');
      }
      matcher = createRouteRecordMatcher(normalizedRecord, parent, options4);
      if (false)
        checkMissingParamsInAbsolutePath(matcher, parent);
      if (originalRecord) {
        originalRecord.alias.push(matcher);
        if (false) {
          checkSameParams(originalRecord, 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 i2 = 0; i2 < children.length; i2++) {
          addRoute(children[i2], matcher, originalRecord && originalRecord.children[i2]);
        }
      }
      originalRecord = originalRecord || matcher;
    }
    return originalMatcher ? () => {
      removeRoute(originalMatcher);
    } : noop$3;
  }
  __name(addRoute, "addRoute");
  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 index2 = matchers.indexOf(matcherRef);
      if (index2 > -1) {
        matchers.splice(index2, 1);
        if (matcherRef.record.name)
          matcherMap.delete(matcherRef.record.name);
        matcherRef.children.forEach(removeRoute);
        matcherRef.alias.forEach(removeRoute);
      }
    }
  }
  __name(removeRoute, "removeRoute");
  function getRoutes() {
    return matchers;
  }
  __name(getRoutes, "getRoutes");
  function insertMatcher(matcher) {
    const index2 = findInsertionIndex(matcher, matchers);
    matchers.splice(index2, 0, matcher);
    if (matcher.record.name && !isAliasRecord(matcher))
      matcherMap.set(matcher.record.name, matcher);
  }
  __name(insertMatcher, "insertMatcher");
  function resolve2(location2, currentLocation) {
    let matcher;
    let params = {};
    let path;
    let name2;
    if ("name" in location2 && location2.name) {
      matcher = matcherMap.get(location2.name);
      if (!matcher)
        throw createRouterError(1, {
          location: location2
        });
      if (false) {
        const invalidParams = Object.keys(location2.params || {}).filter((paramName) => !matcher.keys.find((k) => k.name === paramName));
        if (invalidParams.length) {
          warn$2(`Discarded invalid param(s) "${invalidParams.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
        }
      }
      name2 = matcher.record.name;
      params = assign$5(
        // 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;
      if (false) {
        warn$2(`The Matcher cannot resolve relative paths but received "${path}". Unless you directly called \`matcher.resolve("${path}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`);
      }
      matcher = matchers.find((m) => m.re.test(path));
      if (matcher) {
        params = matcher.parse(path);
        name2 = 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
        });
      name2 = matcher.record.name;
      params = assign$5({}, currentLocation.params, location2.params);
      path = matcher.stringify(params);
    }
    const matched = [];
    let parentMatcher = matcher;
    while (parentMatcher) {
      matched.unshift(parentMatcher.record);
      parentMatcher = parentMatcher.parent;
    }
    return {
      name: name2,
      path,
      params,
      matched,
      meta: mergeMetaFields(matched)
    };
  }
  __name(resolve2, "resolve");
  routes.forEach((route) => addRoute(route));
  function clearRoutes() {
    matchers.length = 0;
    matcherMap.clear();
  }
  __name(clearRoutes, "clearRoutes");
  return {
    addRoute,
    resolve: resolve2,
    removeRoute,
    clearRoutes,
    getRoutes,
    getRecordMatcher
  };
}
__name(createRouterMatcher, "createRouterMatcher");
function paramsFromLocation(params, keys2) {
  const newParams = {};
  for (const key of keys2) {
    if (key in params)
      newParams[key] = params[key];
  }
  return newParams;
}
__name(paramsFromLocation, "paramsFromLocation");
function normalizeRouteRecord(record) {
  return {
    path: record.path,
    redirect: record.redirect,
    name: record.name,
    meta: record.meta || {},
    aliasOf: void 0,
    beforeEnter: record.beforeEnter,
    props: normalizeRecordProps(record),
    children: record.children || [],
    instances: {},
    leaveGuards: /* @__PURE__ */ new Set(),
    updateGuards: /* @__PURE__ */ new Set(),
    enterCallbacks: {},
    components: "components" in record ? record.components || null : record.component && { default: record.component }
  };
}
__name(normalizeRouteRecord, "normalizeRouteRecord");
function normalizeRecordProps(record) {
  const propsObject = {};
  const props = record.props || false;
  if ("component" in record) {
    propsObject.default = props;
  } else {
    for (const name2 in record.components)
      propsObject[name2] = typeof props === "object" ? props[name2] : props;
  }
  return propsObject;
}
__name(normalizeRecordProps, "normalizeRecordProps");
function isAliasRecord(record) {
  while (record) {
    if (record.record.aliasOf)
      return true;
    record = record.parent;
  }
  return false;
}
__name(isAliasRecord, "isAliasRecord");
function mergeMetaFields(matched) {
  return matched.reduce((meta, record) => assign$5(meta, record.meta), {});
}
__name(mergeMetaFields, "mergeMetaFields");
function mergeOptions(defaults2, partialOptions) {
  const options4 = {};
  for (const key in defaults2) {
    options4[key] = key in partialOptions ? partialOptions[key] : defaults2[key];
  }
  return options4;
}
__name(mergeOptions, "mergeOptions");
function isSameParam(a, b) {
  return a.name === b.name && a.optional === b.optional && a.repeatable === b.repeatable;
}
__name(isSameParam, "isSameParam");
function checkSameParams(a, b) {
  for (const key of a.keys) {
    if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))
      return warn$2(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
  }
  for (const key of b.keys) {
    if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))
      return warn$2(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
  }
}
__name(checkSameParams, "checkSameParams");
function checkChildMissingNameWithEmptyPath(mainNormalizedRecord, parent) {
  if (parent && parent.record.name && !mainNormalizedRecord.name && !mainNormalizedRecord.path) {
    warn$2(`The route named "${String(parent.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
  }
}
__name(checkChildMissingNameWithEmptyPath, "checkChildMissingNameWithEmptyPath");
function checkMissingParamsInAbsolutePath(record, parent) {
  for (const key of parent.keys) {
    if (!record.keys.find(isSameParam.bind(null, key)))
      return warn$2(`Absolute path "${record.record.path}" must have the exact same param named "${key.name}" as its parent "${parent.record.path}".`);
  }
}
__name(checkMissingParamsInAbsolutePath, "checkMissingParamsInAbsolutePath");
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);
    if (false) {
      warn$2(`Finding ancestor route "${insertionAncestor.record.path}" failed for "${matcher.record.path}"`);
    }
  }
  return upper;
}
__name(findInsertionIndex, "findInsertionIndex");
function getInsertionAncestor(matcher) {
  let ancestor = matcher;
  while (ancestor = ancestor.parent) {
    if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) {
      return ancestor;
    }
  }
  return;
}
__name(getInsertionAncestor, "getInsertionAncestor");
function isMatchable({ record }) {
  return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
}
__name(isMatchable, "isMatchable");
function parseQuery$1(search2) {
  const query = {};
  if (search2 === "" || search2 === "?")
    return query;
  const hasLeadingIM = search2[0] === "?";
  const searchParams = (hasLeadingIM ? search2.slice(1) : search2).split("&");
  for (let i2 = 0; i2 < searchParams.length; ++i2) {
    const searchParam = searchParams[i2].replace(PLUS_RE, " ");
    const eqPos = searchParam.indexOf("=");
    const key = decode$3(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
    const value4 = eqPos < 0 ? null : decode$3(searchParam.slice(eqPos + 1));
    if (key in query) {
      let currentValue = query[key];
      if (!isArray$3(currentValue)) {
        currentValue = query[key] = [currentValue];
      }
      currentValue.push(value4);
    } else {
      query[key] = value4;
    }
  }
  return query;
}
__name(parseQuery$1, "parseQuery$1");
function stringifyQuery(query) {
  let search2 = "";
  for (let key in query) {
    const value4 = query[key];
    key = encodeQueryKey(key);
    if (value4 == null) {
      if (value4 !== void 0) {
        search2 += (search2.length ? "&" : "") + key;
      }
      continue;
    }
    const values = isArray$3(value4) ? value4.map((v2) => v2 && encodeQueryValue(v2)) : [value4 && encodeQueryValue(value4)];
    values.forEach((value22) => {
      if (value22 !== void 0) {
        search2 += (search2.length ? "&" : "") + key;
        if (value22 != null)
          search2 += "=" + value22;
      }
    });
  }
  return search2;
}
__name(stringifyQuery, "stringifyQuery");
function normalizeQuery(query) {
  const normalizedQuery = {};
  for (const key in query) {
    const value4 = query[key];
    if (value4 !== void 0) {
      normalizedQuery[key] = isArray$3(value4) ? value4.map((v2) => v2 == null ? null : "" + v2) : value4 == null ? value4 : "" + value4;
    }
  }
  return normalizedQuery;
}
__name(normalizeQuery, "normalizeQuery");
const matchedRouteKey = Symbol(false ? "router view location matched" : "");
const viewDepthKey = Symbol(false ? "router view depth" : "");
const routerKey = Symbol(false ? "router" : "");
const routeLocationKey = Symbol(false ? "route location" : "");
const routerViewLocationKey = Symbol(false ? "router view location" : "");
function useCallbacks() {
  let handlers2 = [];
  function add3(handler6) {
    handlers2.push(handler6);
    return () => {
      const i2 = handlers2.indexOf(handler6);
      if (i2 > -1)
        handlers2.splice(i2, 1);
    };
  }
  __name(add3, "add");
  function reset2() {
    handlers2 = [];
  }
  __name(reset2, "reset");
  return {
    add: add3,
    list: /* @__PURE__ */ __name(() => handlers2.slice(), "list"),
    reset: reset2
  };
}
__name(useCallbacks, "useCallbacks");
function registerGuard(record, name2, guard) {
  const removeFromList = /* @__PURE__ */ __name(() => {
    record[name2].delete(guard);
  }, "removeFromList");
  onUnmounted(removeFromList);
  onDeactivated(removeFromList);
  onActivated(() => {
    record[name2].add(guard);
  });
  record[name2].add(guard);
}
__name(registerGuard, "registerGuard");
function onBeforeRouteLeave(leaveGuard) {
  if (false) {
    warn$2("getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function");
    return;
  }
  const activeRecord = inject(
    matchedRouteKey,
    // to avoid warning
    {}
  ).value;
  if (!activeRecord) {
    return;
  }
  registerGuard(activeRecord, "leaveGuards", leaveGuard);
}
__name(onBeforeRouteLeave, "onBeforeRouteLeave");
function onBeforeRouteUpdate(updateGuard) {
  if (false) {
    warn$2("getCurrentInstance() returned null. onBeforeRouteUpdate() must be called at the top of a setup function");
    return;
  }
  const activeRecord = inject(
    matchedRouteKey,
    // to avoid warning
    {}
  ).value;
  if (!activeRecord) {
    return;
  }
  registerGuard(activeRecord, "updateGuards", updateGuard);
}
__name(onBeforeRouteUpdate, "onBeforeRouteUpdate");
function guardToPromiseFn(guard, to, from2, record, name2, runWithContext = (fn) => fn()) {
  const enterCallbackArray = record && // name is defined if record is because of the function overload
  (record.enterCallbacks[name2] = record.enterCallbacks[name2] || []);
  return () => new Promise((resolve2, reject3) => {
    const next2 = /* @__PURE__ */ __name((valid) => {
      if (valid === false) {
        reject3(createRouterError(4, {
          from: from2,
          to
        }));
      } else if (valid instanceof Error) {
        reject3(valid);
      } else if (isRouteLocation(valid)) {
        reject3(createRouterError(2, {
          from: to,
          to: valid
        }));
      } else {
        if (enterCallbackArray && // since enterCallbackArray is truthy, both record and name also are
        record.enterCallbacks[name2] === enterCallbackArray && typeof valid === "function") {
          enterCallbackArray.push(valid);
        }
        resolve2();
      }
    }, "next");
    const guardReturn = runWithContext(() => guard.call(record && record.instances[name2], to, from2, false ? canOnlyBeCalledOnce(next2, to, from2) : next2));
    let guardCall = Promise.resolve(guardReturn);
    if (guard.length < 3)
      guardCall = guardCall.then(next2);
    if (false) {
      const message3 = `The "next" callback was never called inside of ${guard.name ? '"' + guard.name + '"' : ""}:
${guard.toString()}
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;
      if (typeof guardReturn === "object" && "then" in guardReturn) {
        guardCall = guardCall.then((resolvedValue) => {
          if (!next2._called) {
            warn$2(message3);
            return Promise.reject(new Error("Invalid navigation guard"));
          }
          return resolvedValue;
        });
      } else if (guardReturn !== void 0) {
        if (!next2._called) {
          warn$2(message3);
          reject3(new Error("Invalid navigation guard"));
          return;
        }
      }
    }
    guardCall.catch((err) => reject3(err));
  });
}
__name(guardToPromiseFn, "guardToPromiseFn");
function canOnlyBeCalledOnce(next2, to, from2) {
  let called = 0;
  return function() {
    if (called++ === 1)
      warn$2(`The "next" callback was called more than once in one navigation guard when going from "${from2.fullPath}" to "${to.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`);
    next2._called = true;
    if (called === 1)
      next2.apply(null, arguments);
  };
}
__name(canOnlyBeCalledOnce, "canOnlyBeCalledOnce");
function extractComponentsGuards(matched, guardType, to, from2, runWithContext = (fn) => fn()) {
  const guards = [];
  for (const record of matched) {
    if (false) {
      warn$2(`Record with path "${record.path}" is either missing a "component(s)" or "children" property.`);
    }
    for (const name2 in record.components) {
      let rawComponent = record.components[name2];
      if (false) {
        if (!rawComponent || typeof rawComponent !== "object" && typeof rawComponent !== "function") {
          warn$2(`Component "${name2}" in record with path "${record.path}" is not a valid component. Received "${String(rawComponent)}".`);
          throw new Error("Invalid route component");
        } else if ("then" in rawComponent) {
          warn$2(`Component "${name2}" in record with path "${record.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);
          const promise = rawComponent;
          rawComponent = /* @__PURE__ */ __name(() => promise, "rawComponent");
        } else if (rawComponent.__asyncLoader && // warn only once per component
        !rawComponent.__warnedDefineAsync) {
          rawComponent.__warnedDefineAsync = true;
          warn$2(`Component "${name2}" in record with path "${record.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`);
        }
      }
      if (guardType !== "beforeRouteEnter" && !record.instances[name2])
        continue;
      if (isRouteComponent(rawComponent)) {
        const options4 = rawComponent.__vccOpts || rawComponent;
        const guard = options4[guardType];
        guard && guards.push(guardToPromiseFn(guard, to, from2, record, name2, runWithContext));
      } else {
        let componentPromise = rawComponent();
        if (false) {
          warn$2(`Component "${name2}" in record with path "${record.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`);
          componentPromise = Promise.resolve(componentPromise);
        }
        guards.push(() => componentPromise.then((resolved) => {
          if (!resolved)
            return Promise.reject(new Error(`Couldn't resolve component "${name2}" at "${record.path}"`));
          const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
          record.components[name2] = resolvedComponent;
          const options4 = resolvedComponent.__vccOpts || resolvedComponent;
          const guard = options4[guardType];
          return guard && guardToPromiseFn(guard, to, from2, record, name2, runWithContext)();
        }));
      }
    }
  }
  return guards;
}
__name(extractComponentsGuards, "extractComponentsGuards");
function isRouteComponent(component) {
  return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
}
__name(isRouteComponent, "isRouteComponent");
function loadRouteLocation(route) {
  return route.matched.every((record) => record.redirect) ? Promise.reject(new Error("Cannot load a route that redirects.")) : Promise.all(route.matched.map((record) => record.components && Promise.all(Object.keys(record.components).reduce((promises, name2) => {
    const rawComponent = record.components[name2];
    if (typeof rawComponent === "function" && !("displayName" in rawComponent)) {
      promises.push(rawComponent().then((resolved) => {
        if (!resolved)
          return Promise.reject(new Error(`Couldn't resolve component "${name2}" at "${record.path}". Ensure you passed a function that returns a promise.`));
        const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
        record.components[name2] = resolvedComponent;
        return;
      }));
    }
    return promises;
  }, [])))).then(() => route);
}
__name(loadRouteLocation, "loadRouteLocation");
function useLink(props) {
  const router2 = inject(routerKey);
  const currentRoute = inject(routeLocationKey);
  let hasPrevious = false;
  let previousTo = null;
  const route = computed(() => {
    const to = unref(props.to);
    if (false) {
      if (!isRouteLocation(to)) {
        if (hasPrevious) {
          warn$2(`Invalid value for prop "to" in useLink()
- to:`, to, `
- previous to:`, previousTo, `
- props:`, props);
        } else {
          warn$2(`Invalid value for prop "to" in useLink()
- to:`, to, `
- props:`, props);
        }
      }
      previousTo = to;
      hasPrevious = true;
    }
    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 index2 = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
    if (index2 > -1)
      return index2;
    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])) : index2
    );
  });
  const isActive2 = 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(e2 = {}) {
    if (guardEvent(e2)) {
      return router2[unref(props.replace) ? "replace" : "push"](
        unref(props.to)
        // avoid uncaught errors are they are logged anyway
      ).catch(noop$3);
    }
    return Promise.resolve();
  }
  __name(navigate, "navigate");
  if (false) {
    const instance = getCurrentInstance();
    if (instance) {
      const linkContextDevtools = {
        route: route.value,
        isActive: isActive2.value,
        isExactActive: isExactActive.value,
        error: null
      };
      instance.__vrl_devtools = instance.__vrl_devtools || [];
      instance.__vrl_devtools.push(linkContextDevtools);
      watchEffect(() => {
        linkContextDevtools.route = route.value;
        linkContextDevtools.isActive = isActive2.value;
        linkContextDevtools.isExactActive = isExactActive.value;
        linkContextDevtools.error = isRouteLocation(unref(props.to)) ? null : 'Invalid "to" value';
      }, { flush: "post" });
    }
  }
  return {
    route,
    href: computed(() => route.value.href),
    isActive: isActive2,
    isExactActive,
    navigate
  };
}
__name(useLink, "useLink");
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 link2 = reactive(useLink(props));
    const { options: options4 } = inject(routerKey);
    const elClass = computed(() => ({
      [getLinkClass(props.activeClass, options4.linkActiveClass, "router-link-active")]: link2.isActive,
      // [getLinkClass(
      //   props.inactiveClass,
      //   options.linkInactiveClass,
      //   'router-link-inactive'
      // )]: !link.isExactActive,
      [getLinkClass(props.exactActiveClass, options4.linkExactActiveClass, "router-link-exact-active")]: link2.isExactActive
    }));
    return () => {
      const children = slots.default && slots.default(link2);
      return props.custom ? children : h("a", {
        "aria-current": link2.isExactActive ? props.ariaCurrentValue : null,
        href: link2.href,
        // this would override user added attrs but Vue will still add
        // the listener, so we end up triggering both
        onClick: link2.navigate,
        class: elClass.value
      }, children);
    };
  }
});
const RouterLink = RouterLinkImpl;
function guardEvent(e2) {
  if (e2.metaKey || e2.altKey || e2.ctrlKey || e2.shiftKey)
    return;
  if (e2.defaultPrevented)
    return;
  if (e2.button !== void 0 && e2.button !== 0)
    return;
  if (e2.currentTarget && e2.currentTarget.getAttribute) {
    const target = e2.currentTarget.getAttribute("target");
    if (/\b_blank\b/i.test(target))
      return;
  }
  if (e2.preventDefault)
    e2.preventDefault();
  return true;
}
__name(guardEvent, "guardEvent");
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$3(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value4, i2) => value4 !== outerValue[i2]))
        return false;
    }
  }
  return true;
}
__name(includesParams, "includesParams");
function getOriginalPath(record) {
  return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
}
__name(getOriginalPath, "getOriginalPath");
const getLinkClass = /* @__PURE__ */ __name((propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass, "getLinkClass");
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: attrs4, 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, name2], [oldInstance, from2, oldName]) => {
      if (to) {
        to.instances[name2] = instance;
        if (from2 && from2 !== to && instance && instance === oldInstance) {
          if (!to.leaveGuards.size) {
            to.leaveGuards = from2.leaveGuards;
          }
          if (!to.updateGuards.size) {
            to.updateGuards = from2.updateGuards;
          }
        }
      }
      if (instance && to && // if there is no instance but to and from are the same this might be
      // the first visit
      (!from2 || !isSameRouteRecord(to, from2) || !oldInstance)) {
        (to.enterCallbacks[name2] || []).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 = /* @__PURE__ */ __name((vnode) => {
        if (vnode.component.isUnmounted) {
          matchedRoute.instances[currentName] = null;
        }
      }, "onVnodeUnmounted");
      const component = h(ViewComponent, assign$5({}, routeProps, attrs4, {
        onVnodeUnmounted,
        ref: viewRef
      }));
      if (false) {
        const info = {
          depth: depth.value,
          name: matchedRoute.name,
          path: matchedRoute.path,
          meta: matchedRoute.meta
        };
        const internalInstances = isArray$3(component.ref) ? component.ref.map((r) => r.i) : [component.ref.i];
        internalInstances.forEach((instance) => {
          instance.__vrv_devtools = info;
        });
      }
      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, data24) {
  if (!slot)
    return null;
  const slotContent = slot(data24);
  return slotContent.length === 1 ? slotContent[0] : slotContent;
}
__name(normalizeSlot, "normalizeSlot");
const RouterView = RouterViewImpl;
function warnDeprecatedUsage() {
  const instance = getCurrentInstance();
  const parentName = instance.parent && instance.parent.type.name;
  const parentSubTreeType = instance.parent && instance.parent.subTree && instance.parent.subTree.type;
  if (parentName && (parentName === "KeepAlive" || parentName.includes("Transition")) && typeof parentSubTreeType === "object" && parentSubTreeType.name === "RouterView") {
    const comp = parentName === "KeepAlive" ? "keep-alive" : "transition";
    warn$2(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
Use slot props instead:

<router-view v-slot="{ Component }">
  <${comp}>
    <component :is="Component" />
  </${comp}>
</router-view>`);
  }
}
__name(warnDeprecatedUsage, "warnDeprecatedUsage");
function formatRouteLocation(routeLocation, tooltip) {
  const copy2 = assign$5({}, routeLocation, {
    // remove variables that can contain vue instances
    matched: routeLocation.matched.map((matched) => omit(matched, ["instances", "children", "aliasOf"]))
  });
  return {
    _custom: {
      type: null,
      readOnly: true,
      display: routeLocation.fullPath,
      tooltip,
      value: copy2
    }
  };
}
__name(formatRouteLocation, "formatRouteLocation");
function formatDisplay(display) {
  return {
    _custom: {
      display
    }
  };
}
__name(formatDisplay, "formatDisplay");
let routerId = 0;
function addDevtools(app2, router2, matcher) {
  if (router2.__hasDevtools)
    return;
  router2.__hasDevtools = true;
  const id3 = routerId++;
  setupDevtoolsPlugin({
    id: "org.vuejs.router" + (id3 ? "." + id3 : ""),
    label: "Vue Router",
    packageName: "vue-router",
    homepage: "https://router.vuejs.org",
    logo: "https://router.vuejs.org/logo.png",
    componentStateTypes: ["Routing"],
    app: app2
  }, (api2) => {
    if (typeof api2.now !== "function") {
      console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.");
    }
    api2.on.inspectComponent((payload, ctx) => {
      if (payload.instanceData) {
        payload.instanceData.state.push({
          type: "Routing",
          key: "$route",
          editable: false,
          value: formatRouteLocation(router2.currentRoute.value, "Current Route")
        });
      }
    });
    api2.on.visitComponentTree(({ treeNode: node3, componentInstance }) => {
      if (componentInstance.__vrv_devtools) {
        const info = componentInstance.__vrv_devtools;
        node3.tags.push({
          label: (info.name ? `${info.name.toString()}: ` : "") + info.path,
          textColor: 0,
          tooltip: "This component is rendered by &lt;router-view&gt;",
          backgroundColor: PINK_500
        });
      }
      if (isArray$3(componentInstance.__vrl_devtools)) {
        componentInstance.__devtoolsApi = api2;
        componentInstance.__vrl_devtools.forEach((devtoolsData) => {
          let label5 = devtoolsData.route.path;
          let backgroundColor = ORANGE_400;
          let tooltip = "";
          let textColor = 0;
          if (devtoolsData.error) {
            label5 = devtoolsData.error;
            backgroundColor = RED_100;
            textColor = RED_700;
          } else if (devtoolsData.isExactActive) {
            backgroundColor = LIME_500;
            tooltip = "This is exactly active";
          } else if (devtoolsData.isActive) {
            backgroundColor = BLUE_600;
            tooltip = "This link is active";
          }
          node3.tags.push({
            label: label5,
            textColor,
            tooltip,
            backgroundColor
          });
        });
      }
    });
    watch(router2.currentRoute, () => {
      refreshRoutesView();
      api2.notifyComponentUpdate();
      api2.sendInspectorTree(routerInspectorId);
      api2.sendInspectorState(routerInspectorId);
    });
    const navigationsLayerId = "router:navigations:" + id3;
    api2.addTimelineLayer({
      id: navigationsLayerId,
      label: `Router${id3 ? " " + id3 : ""} Navigations`,
      color: 4237508
    });
    router2.onError((error2, to) => {
      api2.addTimelineEvent({
        layerId: navigationsLayerId,
        event: {
          title: "Error during Navigation",
          subtitle: to.fullPath,
          logType: "error",
          time: api2.now(),
          data: { error: error2 },
          groupId: to.meta.__navigationId
        }
      });
    });
    let navigationId = 0;
    router2.beforeEach((to, from2) => {
      const data24 = {
        guard: formatDisplay("beforeEach"),
        from: formatRouteLocation(from2, "Current Location during this navigation"),
        to: formatRouteLocation(to, "Target location")
      };
      Object.defineProperty(to.meta, "__navigationId", {
        value: navigationId++
      });
      api2.addTimelineEvent({
        layerId: navigationsLayerId,
        event: {
          time: api2.now(),
          title: "Start of navigation",
          subtitle: to.fullPath,
          data: data24,
          groupId: to.meta.__navigationId
        }
      });
    });
    router2.afterEach((to, from2, failure) => {
      const data24 = {
        guard: formatDisplay("afterEach")
      };
      if (failure) {
        data24.failure = {
          _custom: {
            type: Error,
            readOnly: true,
            display: failure ? failure.message : "",
            tooltip: "Navigation Failure",
            value: failure
          }
        };
        data24.status = formatDisplay("❌");
      } else {
        data24.status = formatDisplay("✅");
      }
      data24.from = formatRouteLocation(from2, "Current Location during this navigation");
      data24.to = formatRouteLocation(to, "Target location");
      api2.addTimelineEvent({
        layerId: navigationsLayerId,
        event: {
          title: "End of navigation",
          subtitle: to.fullPath,
          time: api2.now(),
          data: data24,
          logType: failure ? "warning" : "default",
          groupId: to.meta.__navigationId
        }
      });
    });
    const routerInspectorId = "router-inspector:" + id3;
    api2.addInspector({
      id: routerInspectorId,
      label: "Routes" + (id3 ? " " + id3 : ""),
      icon: "book",
      treeFilterPlaceholder: "Search routes"
    });
    function refreshRoutesView() {
      if (!activeRoutesPayload)
        return;
      const payload = activeRoutesPayload;
      let routes = matcher.getRoutes().filter((route) => !route.parent || // these routes have a parent with no component which will not appear in the view
      // therefore we still need to include them
      !route.parent.record.components);
      routes.forEach(resetMatchStateOnRouteRecord);
      if (payload.filter) {
        routes = routes.filter((route) => (
          // save matches state based on the payload
          isRouteMatching(route, payload.filter.toLowerCase())
        ));
      }
      routes.forEach((route) => markRouteRecordActive(route, router2.currentRoute.value));
      payload.rootNodes = routes.map(formatRouteRecordForInspector);
    }
    __name(refreshRoutesView, "refreshRoutesView");
    let activeRoutesPayload;
    api2.on.getInspectorTree((payload) => {
      activeRoutesPayload = payload;
      if (payload.app === app2 && payload.inspectorId === routerInspectorId) {
        refreshRoutesView();
      }
    });
    api2.on.getInspectorState((payload) => {
      if (payload.app === app2 && payload.inspectorId === routerInspectorId) {
        const routes = matcher.getRoutes();
        const route = routes.find((route2) => route2.record.__vd_id === payload.nodeId);
        if (route) {
          payload.state = {
            options: formatRouteRecordMatcherForStateInspector(route)
          };
        }
      }
    });
    api2.sendInspectorTree(routerInspectorId);
    api2.sendInspectorState(routerInspectorId);
  });
}
__name(addDevtools, "addDevtools");
function modifierForKey(key) {
  if (key.optional) {
    return key.repeatable ? "*" : "?";
  } else {
    return key.repeatable ? "+" : "";
  }
}
__name(modifierForKey, "modifierForKey");
function formatRouteRecordMatcherForStateInspector(route) {
  const { record } = route;
  const fields = [
    { editable: false, key: "path", value: record.path }
  ];
  if (record.name != null) {
    fields.push({
      editable: false,
      key: "name",
      value: record.name
    });
  }
  fields.push({ editable: false, key: "regexp", value: route.re });
  if (route.keys.length) {
    fields.push({
      editable: false,
      key: "keys",
      value: {
        _custom: {
          type: null,
          readOnly: true,
          display: route.keys.map((key) => `${key.name}${modifierForKey(key)}`).join(" "),
          tooltip: "Param keys",
          value: route.keys
        }
      }
    });
  }
  if (record.redirect != null) {
    fields.push({
      editable: false,
      key: "redirect",
      value: record.redirect
    });
  }
  if (route.alias.length) {
    fields.push({
      editable: false,
      key: "aliases",
      value: route.alias.map((alias) => alias.record.path)
    });
  }
  if (Object.keys(route.record.meta).length) {
    fields.push({
      editable: false,
      key: "meta",
      value: route.record.meta
    });
  }
  fields.push({
    key: "score",
    editable: false,
    value: {
      _custom: {
        type: null,
        readOnly: true,
        display: route.score.map((score) => score.join(", ")).join(" | "),
        tooltip: "Score used to sort routes",
        value: route.score
      }
    }
  });
  return fields;
}
__name(formatRouteRecordMatcherForStateInspector, "formatRouteRecordMatcherForStateInspector");
const PINK_500 = 15485081;
const BLUE_600 = 2450411;
const LIME_500 = 8702998;
const CYAN_400 = 2282478;
const ORANGE_400 = 16486972;
const DARK = 6710886;
const RED_100 = 16704226;
const RED_700 = 12131356;
function formatRouteRecordForInspector(route) {
  const tags = [];
  const { record } = route;
  if (record.name != null) {
    tags.push({
      label: String(record.name),
      textColor: 0,
      backgroundColor: CYAN_400
    });
  }
  if (record.aliasOf) {
    tags.push({
      label: "alias",
      textColor: 0,
      backgroundColor: ORANGE_400
    });
  }
  if (route.__vd_match) {
    tags.push({
      label: "matches",
      textColor: 0,
      backgroundColor: PINK_500
    });
  }
  if (route.__vd_exactActive) {
    tags.push({
      label: "exact",
      textColor: 0,
      backgroundColor: LIME_500
    });
  }
  if (route.__vd_active) {
    tags.push({
      label: "active",
      textColor: 0,
      backgroundColor: BLUE_600
    });
  }
  if (record.redirect) {
    tags.push({
      label: typeof record.redirect === "string" ? `redirect: ${record.redirect}` : "redirects",
      textColor: 16777215,
      backgroundColor: DARK
    });
  }
  let id3 = record.__vd_id;
  if (id3 == null) {
    id3 = String(routeRecordId++);
    record.__vd_id = id3;
  }
  return {
    id: id3,
    label: record.path,
    tags,
    children: route.children.map(formatRouteRecordForInspector)
  };
}
__name(formatRouteRecordForInspector, "formatRouteRecordForInspector");
let routeRecordId = 0;
const EXTRACT_REGEXP_RE = /^\/(.*)\/([a-z]*)$/;
function markRouteRecordActive(route, currentRoute) {
  const isExactActive = currentRoute.matched.length && isSameRouteRecord(currentRoute.matched[currentRoute.matched.length - 1], route.record);
  route.__vd_exactActive = route.__vd_active = isExactActive;
  if (!isExactActive) {
    route.__vd_active = currentRoute.matched.some((match2) => isSameRouteRecord(match2, route.record));
  }
  route.children.forEach((childRoute) => markRouteRecordActive(childRoute, currentRoute));
}
__name(markRouteRecordActive, "markRouteRecordActive");
function resetMatchStateOnRouteRecord(route) {
  route.__vd_match = false;
  route.children.forEach(resetMatchStateOnRouteRecord);
}
__name(resetMatchStateOnRouteRecord, "resetMatchStateOnRouteRecord");
function isRouteMatching(route, filter4) {
  const found2 = String(route.re).match(EXTRACT_REGEXP_RE);
  route.__vd_match = false;
  if (!found2 || found2.length < 3) {
    return false;
  }
  const nonEndingRE = new RegExp(found2[1].replace(/\$$/, ""), found2[2]);
  if (nonEndingRE.test(filter4)) {
    route.children.forEach((child) => isRouteMatching(child, filter4));
    if (route.record.path !== "/" || filter4 === "/") {
      route.__vd_match = route.re.test(filter4);
      return true;
    }
    return false;
  }
  const path = route.record.path.toLowerCase();
  const decodedPath = decode$3(path);
  if (!filter4.startsWith("/") && (decodedPath.includes(filter4) || path.includes(filter4)))
    return true;
  if (decodedPath.startsWith(filter4) || path.startsWith(filter4))
    return true;
  if (route.record.name && String(route.record.name).includes(filter4))
    return true;
  return route.children.some((child) => isRouteMatching(child, filter4));
}
__name(isRouteMatching, "isRouteMatching");
function omit(obj, keys2) {
  const ret = {};
  for (const key in obj) {
    if (!keys2.includes(key)) {
      ret[key] = obj[key];
    }
  }
  return ret;
}
__name(omit, "omit");
function createRouter(options4) {
  const matcher = createRouterMatcher(options4.routes, options4);
  const parseQuery$1$1 = options4.parseQuery || parseQuery$1;
  const stringifyQuery$1 = options4.stringifyQuery || stringifyQuery;
  const routerHistory = options4.history;
  if (false)
    throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');
  const beforeGuards = useCallbacks();
  const beforeResolveGuards = useCallbacks();
  const afterGuards = useCallbacks();
  const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
  let pendingLocation = START_LOCATION_NORMALIZED;
  if (isBrowser && options4.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$3)
  );
  function addRoute(parentOrRoute, route) {
    let parent;
    let record;
    if (isRouteName(parentOrRoute)) {
      parent = matcher.getRecordMatcher(parentOrRoute);
      if (false) {
        warn$2(`Parent route "${String(parentOrRoute)}" not found when adding child route`, route);
      }
      record = route;
    } else {
      record = parentOrRoute;
    }
    return matcher.addRoute(record, parent);
  }
  __name(addRoute, "addRoute");
  function removeRoute(name2) {
    const recordMatcher = matcher.getRecordMatcher(name2);
    if (recordMatcher) {
      matcher.removeRoute(recordMatcher);
    } else if (false) {
      warn$2(`Cannot remove non-existent route "${String(name2)}"`);
    }
  }
  __name(removeRoute, "removeRoute");
  function getRoutes() {
    return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
  }
  __name(getRoutes, "getRoutes");
  function hasRoute(name2) {
    return !!matcher.getRecordMatcher(name2);
  }
  __name(hasRoute, "hasRoute");
  function resolve2(rawLocation, currentLocation) {
    currentLocation = assign$5({}, currentLocation || currentRoute.value);
    if (typeof rawLocation === "string") {
      const locationNormalized = parseURL(parseQuery$1$1, rawLocation, currentLocation.path);
      const matchedRoute2 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
      const href2 = routerHistory.createHref(locationNormalized.fullPath);
      if (false) {
        if (href2.startsWith("//"))
          warn$2(`Location "${rawLocation}" resolved to "${href2}". A resolved location cannot start with multiple slashes.`);
        else if (!matchedRoute2.matched.length) {
          warn$2(`No match found for location with path "${rawLocation}"`);
        }
      }
      return assign$5(locationNormalized, matchedRoute2, {
        params: decodeParams(matchedRoute2.params),
        hash: decode$3(locationNormalized.hash),
        redirectedFrom: void 0,
        href: href2
      });
    }
    if (false) {
      warn$2(`router.resolve() was passed an invalid location. This will fail in production.
- Location:`, rawLocation);
      return resolve2({});
    }
    let matcherLocation;
    if (rawLocation.path != null) {
      if (false) {
        warn$2(`Path "${rawLocation.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`);
      }
      matcherLocation = assign$5({}, rawLocation, {
        path: parseURL(parseQuery$1$1, rawLocation.path, currentLocation.path).path
      });
    } else {
      const targetParams = assign$5({}, rawLocation.params);
      for (const key in targetParams) {
        if (targetParams[key] == null) {
          delete targetParams[key];
        }
      }
      matcherLocation = assign$5({}, rawLocation, {
        params: encodeParams(targetParams)
      });
      currentLocation.params = encodeParams(currentLocation.params);
    }
    const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
    const hash = rawLocation.hash || "";
    if (false) {
      warn$2(`A \`hash\` should always start with the character "#". Replace "${hash}" with "#${hash}".`);
    }
    matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
    const fullPath = stringifyURL(stringifyQuery$1, assign$5({}, rawLocation, {
      hash: encodeHash(hash),
      path: matchedRoute.path
    }));
    const href = routerHistory.createHref(fullPath);
    if (false) {
      if (href.startsWith("//")) {
        warn$2(`Location "${rawLocation}" resolved to "${href}". A resolved location cannot start with multiple slashes.`);
      } else if (!matchedRoute.matched.length) {
        warn$2(`No match found for location with path "${rawLocation.path != null ? rawLocation.path : rawLocation}"`);
      }
    }
    return assign$5({
      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
    });
  }
  __name(resolve2, "resolve");
  function locationAsObject(to) {
    return typeof to === "string" ? parseURL(parseQuery$1$1, to, currentRoute.value.path) : assign$5({}, to);
  }
  __name(locationAsObject, "locationAsObject");
  function checkCanceledNavigation(to, from2) {
    if (pendingLocation !== to) {
      return createRouterError(8, {
        from: from2,
        to
      });
    }
  }
  __name(checkCanceledNavigation, "checkCanceledNavigation");
  function push(to) {
    return pushWithRedirect(to);
  }
  __name(push, "push");
  function replace2(to) {
    return push(assign$5(locationAsObject(to), { replace: true }));
  }
  __name(replace2, "replace");
  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 = {};
      }
      if (false) {
        warn$2(`Invalid redirect found:
${JSON.stringify(newTargetLocation, null, 2)}
 when navigating to "${to.fullPath}". A redirect must contain a name or path. This will break in production.`);
        throw new Error("Invalid redirect");
      }
      return assign$5({
        query: to.query,
        hash: to.hash,
        // avoid transferring params if the redirect has a path
        params: newTargetLocation.path != null ? {} : to.params
      }, newTargetLocation);
    }
  }
  __name(handleRedirectRecord, "handleRedirectRecord");
  function pushWithRedirect(to, redirectedFrom) {
    const targetLocation = pendingLocation = resolve2(to);
    const from2 = currentRoute.value;
    const data24 = to.state;
    const force = to.force;
    const replace22 = to.replace === true;
    const shouldRedirect = handleRedirectRecord(targetLocation);
    if (shouldRedirect)
      return pushWithRedirect(
        assign$5(locationAsObject(shouldRedirect), {
          state: typeof shouldRedirect === "object" ? assign$5({}, data24, shouldRedirect.state) : data24,
          force,
          replace: replace22
        }),
        // keep original redirectedFrom if it exists
        redirectedFrom || targetLocation
      );
    const toLocation = targetLocation;
    toLocation.redirectedFrom = redirectedFrom;
    let failure;
    if (!force && isSameRouteLocation(stringifyQuery$1, from2, targetLocation)) {
      failure = createRouterError(16, { to: toLocation, from: from2 });
      handleScroll(
        from2,
        from2,
        // 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, from2)).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, from2)
    )).then((failure2) => {
      if (failure2) {
        if (isNavigationFailure(
          failure2,
          2
          /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
        )) {
          if (false) {
            warn$2(`Detected a possibly infinite redirection in a navigation guard when going from "${from2.fullPath}" to "${toLocation.fullPath}". Aborting to avoid a Stack Overflow.
 Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`);
            return Promise.reject(new Error("Infinite redirect in navigation guard"));
          }
          return pushWithRedirect(
            // keep options
            assign$5({
              // preserve an existing replacement but allow the redirect to override it
              replace: replace22
            }, locationAsObject(failure2.to), {
              state: typeof failure2.to === "object" ? assign$5({}, data24, failure2.to.state) : data24,
              force
            }),
            // preserve the original redirectedFrom if any
            redirectedFrom || toLocation
          );
        }
      } else {
        failure2 = finalizeNavigation(toLocation, from2, true, replace22, data24);
      }
      triggerAfterEach(toLocation, from2, failure2);
      return failure2;
    });
  }
  __name(pushWithRedirect, "pushWithRedirect");
  function checkCanceledNavigationAndReject(to, from2) {
    const error2 = checkCanceledNavigation(to, from2);
    return error2 ? Promise.reject(error2) : Promise.resolve();
  }
  __name(checkCanceledNavigationAndReject, "checkCanceledNavigationAndReject");
  function runWithContext(fn) {
    const app2 = installedApps.values().next().value;
    return app2 && typeof app2.runWithContext === "function" ? app2.runWithContext(fn) : fn();
  }
  __name(runWithContext, "runWithContext");
  function navigate(to, from2) {
    let guards;
    const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from2);
    guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from2);
    for (const record of leavingRecords) {
      record.leaveGuards.forEach((guard) => {
        guards.push(guardToPromiseFn(guard, to, from2));
      });
    }
    const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from2);
    guards.push(canceledNavigationCheck);
    return runGuardQueue(guards).then(() => {
      guards = [];
      for (const guard of beforeGuards.list()) {
        guards.push(guardToPromiseFn(guard, to, from2));
      }
      guards.push(canceledNavigationCheck);
      return runGuardQueue(guards);
    }).then(() => {
      guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from2);
      for (const record of updatingRecords) {
        record.updateGuards.forEach((guard) => {
          guards.push(guardToPromiseFn(guard, to, from2));
        });
      }
      guards.push(canceledNavigationCheck);
      return runGuardQueue(guards);
    }).then(() => {
      guards = [];
      for (const record of enteringRecords) {
        if (record.beforeEnter) {
          if (isArray$3(record.beforeEnter)) {
            for (const beforeEnter of record.beforeEnter)
              guards.push(guardToPromiseFn(beforeEnter, to, from2));
          } else {
            guards.push(guardToPromiseFn(record.beforeEnter, to, from2));
          }
        }
      }
      guards.push(canceledNavigationCheck);
      return runGuardQueue(guards);
    }).then(() => {
      to.matched.forEach((record) => record.enterCallbacks = {});
      guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from2, runWithContext);
      guards.push(canceledNavigationCheck);
      return runGuardQueue(guards);
    }).then(() => {
      guards = [];
      for (const guard of beforeResolveGuards.list()) {
        guards.push(guardToPromiseFn(guard, to, from2));
      }
      guards.push(canceledNavigationCheck);
      return runGuardQueue(guards);
    }).catch((err) => isNavigationFailure(
      err,
      8
      /* ErrorTypes.NAVIGATION_CANCELLED */
    ) ? err : Promise.reject(err));
  }
  __name(navigate, "navigate");
  function triggerAfterEach(to, from2, failure) {
    afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from2, failure)));
  }
  __name(triggerAfterEach, "triggerAfterEach");
  function finalizeNavigation(toLocation, from2, isPush, replace22, data24) {
    const error2 = checkCanceledNavigation(toLocation, from2);
    if (error2)
      return error2;
    const isFirstNavigation = from2 === START_LOCATION_NORMALIZED;
    const state = !isBrowser ? {} : history.state;
    if (isPush) {
      if (replace22 || isFirstNavigation)
        routerHistory.replace(toLocation.fullPath, assign$5({
          scroll: isFirstNavigation && state && state.scroll
        }, data24));
      else
        routerHistory.push(toLocation.fullPath, data24);
    }
    currentRoute.value = toLocation;
    handleScroll(toLocation, from2, isPush, isFirstNavigation);
    markAsReady();
  }
  __name(finalizeNavigation, "finalizeNavigation");
  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$5(shouldRedirect, { replace: true }), toLocation).catch(noop$3);
        return;
      }
      pendingLocation = toLocation;
      const from2 = currentRoute.value;
      if (isBrowser) {
        saveScrollPosition(getScrollKey(from2.fullPath, info.delta), computeScrollPosition());
      }
      navigate(toLocation, from2).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$3);
          return Promise.reject();
        }
        if (info.delta) {
          routerHistory.go(-info.delta, false);
        }
        return triggerError(error2, toLocation, from2);
      }).then((failure) => {
        failure = failure || finalizeNavigation(
          // after navigation, all matched components are resolved
          toLocation,
          from2,
          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, from2, failure);
      }).catch(noop$3);
    });
  }
  __name(setupListeners, "setupListeners");
  let readyHandlers = useCallbacks();
  let errorListeners = useCallbacks();
  let ready;
  function triggerError(error2, to, from2) {
    markAsReady(error2);
    const list2 = errorListeners.list();
    if (list2.length) {
      list2.forEach((handler6) => handler6(error2, to, from2));
    } else {
      if (false) {
        warn$2("uncaught error during route navigation:");
      }
      console.error(error2);
    }
    return Promise.reject(error2);
  }
  __name(triggerError, "triggerError");
  function isReady() {
    if (ready && currentRoute.value !== START_LOCATION_NORMALIZED)
      return Promise.resolve();
    return new Promise((resolve22, reject3) => {
      readyHandlers.add([resolve22, reject3]);
    });
  }
  __name(isReady, "isReady");
  function markAsReady(err) {
    if (!ready) {
      ready = !err;
      setupListeners();
      readyHandlers.list().forEach(([resolve22, reject3]) => err ? reject3(err) : resolve22());
      readyHandlers.reset();
    }
    return err;
  }
  __name(markAsReady, "markAsReady");
  function handleScroll(to, from2, isPush, isFirstNavigation) {
    const { scrollBehavior } = options4;
    if (!isBrowser || !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, from2, scrollPosition)).then((position3) => position3 && scrollToPosition(position3)).catch((err) => triggerError(err, to, from2));
  }
  __name(handleScroll, "handleScroll");
  const go = /* @__PURE__ */ __name((delta2) => routerHistory.go(delta2), "go");
  let started;
  const installedApps = /* @__PURE__ */ new Set();
  const router2 = {
    currentRoute,
    listening: true,
    addRoute,
    removeRoute,
    clearRoutes: matcher.clearRoutes,
    hasRoute,
    getRoutes,
    resolve: resolve2,
    options: options4,
    push,
    replace: replace2,
    go,
    back: /* @__PURE__ */ __name(() => go(-1), "back"),
    forward: /* @__PURE__ */ __name(() => go(1), "forward"),
    beforeEach: beforeGuards.add,
    beforeResolve: beforeResolveGuards.add,
    afterEach: afterGuards.add,
    onError: errorListeners.add,
    isReady,
    install(app2) {
      const router22 = this;
      app2.component("RouterLink", RouterLink);
      app2.component("RouterView", RouterView);
      app2.config.globalProperties.$router = router22;
      Object.defineProperty(app2.config.globalProperties, "$route", {
        enumerable: true,
        get: /* @__PURE__ */ __name(() => unref(currentRoute), "get")
      });
      if (isBrowser && // 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) => {
          if (false)
            warn$2("Unexpected error when starting the router:", err);
        });
      }
      const reactiveRoute = {};
      for (const key in START_LOCATION_NORMALIZED) {
        Object.defineProperty(reactiveRoute, key, {
          get: /* @__PURE__ */ __name(() => currentRoute.value[key], "get"),
          enumerable: true
        });
      }
      app2.provide(routerKey, router22);
      app2.provide(routeLocationKey, shallowReactive(reactiveRoute));
      app2.provide(routerViewLocationKey, currentRoute);
      const unmountApp = app2.unmount;
      installedApps.add(app2);
      app2.unmount = function() {
        installedApps.delete(app2);
        if (installedApps.size < 1) {
          pendingLocation = START_LOCATION_NORMALIZED;
          removeHistoryListener && removeHistoryListener();
          removeHistoryListener = null;
          currentRoute.value = START_LOCATION_NORMALIZED;
          started = false;
          ready = false;
        }
        unmountApp();
      };
      if (false) {
        addDevtools(app2, router22, matcher);
      }
    }
  };
  function runGuardQueue(guards) {
    return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
  }
  __name(runGuardQueue, "runGuardQueue");
  return router2;
}
__name(createRouter, "createRouter");
function extractChangingRecords(to, from2) {
  const leavingRecords = [];
  const updatingRecords = [];
  const enteringRecords = [];
  const len = Math.max(from2.matched.length, to.matched.length);
  for (let i2 = 0; i2 < len; i2++) {
    const recordFrom = from2.matched[i2];
    if (recordFrom) {
      if (to.matched.find((record) => isSameRouteRecord(record, recordFrom)))
        updatingRecords.push(recordFrom);
      else
        leavingRecords.push(recordFrom);
    }
    const recordTo = to.matched[i2];
    if (recordTo) {
      if (!from2.matched.find((record) => isSameRouteRecord(record, recordTo))) {
        enteringRecords.push(recordTo);
      }
    }
  }
  return [leavingRecords, updatingRecords, enteringRecords];
}
__name(extractChangingRecords, "extractChangingRecords");
function useRouter() {
  return inject(routerKey);
}
__name(useRouter, "useRouter");
function useRoute(_name) {
  return inject(routeLocationKey);
}
__name(useRoute, "useRoute");
const _export_sfc = /* @__PURE__ */ __name((sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
}, "_export_sfc");
const _sfc_main$_ = {};
const _hoisted_1$1r = { class: "w-full min-h-screen overflow-hidden relative" };
function _sfc_render$1(_ctx, _cache) {
  const _component_router_view = resolveComponent("router-view");
  return openBlock(), createElementBlock("main", _hoisted_1$1r, [
    createVNode(_component_router_view)
  ]);
}
__name(_sfc_render$1, "_sfc_render$1");
const LayoutDefault = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$1]]);
"use strict";
function bind$3(fn, thisArg) {
  return /* @__PURE__ */ __name(function wrap2() {
    return fn.apply(thisArg, arguments);
  }, "wrap");
}
__name(bind$3, "bind$3");
"use strict";
const { toString: toString$2 } = Object.prototype;
const { getPrototypeOf } = Object;
const kindOf = /* @__PURE__ */ ((cache2) => (thing) => {
  const str = toString$2.call(thing);
  return cache2[str] || (cache2[str] = str.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null));
const kindOfTest = /* @__PURE__ */ __name((type) => {
  type = type.toLowerCase();
  return (thing) => kindOf(thing) === type;
}, "kindOfTest");
const typeOfTest = /* @__PURE__ */ __name((type) => (thing) => typeof thing === type, "typeOfTest");
const { isArray: isArray$2 } = Array;
const isUndefined = typeOfTest("undefined");
function isBuffer(val) {
  return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$3(val.constructor.isBuffer) && val.constructor.isBuffer(val);
}
__name(isBuffer, "isBuffer");
const isArrayBuffer = kindOfTest("ArrayBuffer");
function isArrayBufferView(val) {
  let result;
  if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
    result = ArrayBuffer.isView(val);
  } else {
    result = val && val.buffer && isArrayBuffer(val.buffer);
  }
  return result;
}
__name(isArrayBufferView, "isArrayBufferView");
const isString$6 = typeOfTest("string");
const isFunction$3 = typeOfTest("function");
const isNumber$4 = typeOfTest("number");
const isObject$5 = /* @__PURE__ */ __name((thing) => thing !== null && typeof thing === "object", "isObject$5");
const isBoolean$2 = /* @__PURE__ */ __name((thing) => thing === true || thing === false, "isBoolean$2");
const isPlainObject$2 = /* @__PURE__ */ __name((val) => {
  if (kindOf(val) !== "object") {
    return false;
  }
  const prototype2 = getPrototypeOf(val);
  return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
}, "isPlainObject$2");
const isDate$1 = kindOfTest("Date");
const isFile = kindOfTest("File");
const isBlob = kindOfTest("Blob");
const isFileList = kindOfTest("FileList");
const isStream = /* @__PURE__ */ __name((val) => isObject$5(val) && isFunction$3(val.pipe), "isStream");
const isFormData = /* @__PURE__ */ __name((thing) => {
  let kind;
  return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$3(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
  kind === "object" && isFunction$3(thing.toString) && thing.toString() === "[object FormData]"));
}, "isFormData");
const isURLSearchParams = kindOfTest("URLSearchParams");
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
const trim = /* @__PURE__ */ __name((str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), "trim");
function forEach$1(obj, fn, { allOwnKeys = false } = {}) {
  if (obj === null || typeof obj === "undefined") {
    return;
  }
  let i2;
  let l;
  if (typeof obj !== "object") {
    obj = [obj];
  }
  if (isArray$2(obj)) {
    for (i2 = 0, l = obj.length; i2 < l; i2++) {
      fn.call(null, obj[i2], i2, obj);
    }
  } else {
    const keys2 = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
    const len = keys2.length;
    let key;
    for (i2 = 0; i2 < len; i2++) {
      key = keys2[i2];
      fn.call(null, obj[key], key, obj);
    }
  }
}
__name(forEach$1, "forEach$1");
function findKey(obj, key) {
  key = key.toLowerCase();
  const keys2 = Object.keys(obj);
  let i2 = keys2.length;
  let _key;
  while (i2-- > 0) {
    _key = keys2[i2];
    if (key === _key.toLowerCase()) {
      return _key;
    }
  }
  return null;
}
__name(findKey, "findKey");
const _global$1 = (() => {
  if (typeof globalThis !== "undefined") return globalThis;
  return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
})();
const isContextDefined = /* @__PURE__ */ __name((context) => !isUndefined(context) && context !== _global$1, "isContextDefined");
function merge() {
  const { caseless } = isContextDefined(this) && this || {};
  const result = {};
  const assignValue = /* @__PURE__ */ __name((val, key) => {
    const targetKey = caseless && findKey(result, key) || key;
    if (isPlainObject$2(result[targetKey]) && isPlainObject$2(val)) {
      result[targetKey] = merge(result[targetKey], val);
    } else if (isPlainObject$2(val)) {
      result[targetKey] = merge({}, val);
    } else if (isArray$2(val)) {
      result[targetKey] = val.slice();
    } else {
      result[targetKey] = val;
    }
  }, "assignValue");
  for (let i2 = 0, l = arguments.length; i2 < l; i2++) {
    arguments[i2] && forEach$1(arguments[i2], assignValue);
  }
  return result;
}
__name(merge, "merge");
const extend = /* @__PURE__ */ __name((a, b, thisArg, { allOwnKeys } = {}) => {
  forEach$1(b, (val, key) => {
    if (thisArg && isFunction$3(val)) {
      a[key] = bind$3(val, thisArg);
    } else {
      a[key] = val;
    }
  }, { allOwnKeys });
  return a;
}, "extend");
const stripBOM = /* @__PURE__ */ __name((content2) => {
  if (content2.charCodeAt(0) === 65279) {
    content2 = content2.slice(1);
  }
  return content2;
}, "stripBOM");
const inherits = /* @__PURE__ */ __name((constructor, superConstructor, props, descriptors2) => {
  constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
  constructor.prototype.constructor = constructor;
  Object.defineProperty(constructor, "super", {
    value: superConstructor.prototype
  });
  props && Object.assign(constructor.prototype, props);
}, "inherits");
const toFlatObject = /* @__PURE__ */ __name((sourceObj, destObj, filter4, propFilter) => {
  let props;
  let i2;
  let prop2;
  const merged = {};
  destObj = destObj || {};
  if (sourceObj == null) return destObj;
  do {
    props = Object.getOwnPropertyNames(sourceObj);
    i2 = props.length;
    while (i2-- > 0) {
      prop2 = props[i2];
      if ((!propFilter || propFilter(prop2, sourceObj, destObj)) && !merged[prop2]) {
        destObj[prop2] = sourceObj[prop2];
        merged[prop2] = true;
      }
    }
    sourceObj = filter4 !== false && getPrototypeOf(sourceObj);
  } while (sourceObj && (!filter4 || filter4(sourceObj, destObj)) && sourceObj !== Object.prototype);
  return destObj;
}, "toFlatObject");
const endsWith = /* @__PURE__ */ __name((str, searchString, position3) => {
  str = String(str);
  if (position3 === void 0 || position3 > str.length) {
    position3 = str.length;
  }
  position3 -= searchString.length;
  const lastIndex2 = str.indexOf(searchString, position3);
  return lastIndex2 !== -1 && lastIndex2 === position3;
}, "endsWith");
const toArray = /* @__PURE__ */ __name((thing) => {
  if (!thing) return null;
  if (isArray$2(thing)) return thing;
  let i2 = thing.length;
  if (!isNumber$4(i2)) return null;
  const arr = new Array(i2);
  while (i2-- > 0) {
    arr[i2] = thing[i2];
  }
  return arr;
}, "toArray");
const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
  return (thing) => {
    return TypedArray && thing instanceof TypedArray;
  };
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
const forEachEntry = /* @__PURE__ */ __name((obj, fn) => {
  const generator = obj && obj[Symbol.iterator];
  const iterator = generator.call(obj);
  let result;
  while ((result = iterator.next()) && !result.done) {
    const pair = result.value;
    fn.call(obj, pair[0], pair[1]);
  }
}, "forEachEntry");
const matchAll = /* @__PURE__ */ __name((regExp, str) => {
  let matches2;
  const arr = [];
  while ((matches2 = regExp.exec(str)) !== null) {
    arr.push(matches2);
  }
  return arr;
}, "matchAll");
const isHTMLForm = kindOfTest("HTMLFormElement");
const toCamelCase = /* @__PURE__ */ __name((str) => {
  return str.toLowerCase().replace(
    /[-_\s]([a-z\d])(\w*)/g,
    /* @__PURE__ */ __name(function replacer2(m, p1, p2) {
      return p1.toUpperCase() + p2;
    }, "replacer")
  );
}, "toCamelCase");
const hasOwnProperty$1 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop2) => hasOwnProperty2.call(obj, prop2))(Object.prototype);
const isRegExp$3 = kindOfTest("RegExp");
const reduceDescriptors = /* @__PURE__ */ __name((obj, reducer) => {
  const descriptors2 = Object.getOwnPropertyDescriptors(obj);
  const reducedDescriptors = {};
  forEach$1(descriptors2, (descriptor, name2) => {
    let ret;
    if ((ret = reducer(descriptor, name2, obj)) !== false) {
      reducedDescriptors[name2] = ret || descriptor;
    }
  });
  Object.defineProperties(obj, reducedDescriptors);
}, "reduceDescriptors");
const freezeMethods = /* @__PURE__ */ __name((obj) => {
  reduceDescriptors(obj, (descriptor, name2) => {
    if (isFunction$3(obj) && ["arguments", "caller", "callee"].indexOf(name2) !== -1) {
      return false;
    }
    const value4 = obj[name2];
    if (!isFunction$3(value4)) return;
    descriptor.enumerable = false;
    if ("writable" in descriptor) {
      descriptor.writable = false;
      return;
    }
    if (!descriptor.set) {
      descriptor.set = () => {
        throw Error("Can not rewrite read-only method '" + name2 + "'");
      };
    }
  });
}, "freezeMethods");
const toObjectSet = /* @__PURE__ */ __name((arrayOrString, delimiter2) => {
  const obj = {};
  const define = /* @__PURE__ */ __name((arr) => {
    arr.forEach((value4) => {
      obj[value4] = true;
    });
  }, "define");
  isArray$2(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter2));
  return obj;
}, "toObjectSet");
const noop$2 = /* @__PURE__ */ __name(() => {
}, "noop$2");
const toFiniteNumber = /* @__PURE__ */ __name((value4, defaultValue) => {
  return value4 != null && Number.isFinite(value4 = +value4) ? value4 : defaultValue;
}, "toFiniteNumber");
const ALPHA = "abcdefghijklmnopqrstuvwxyz";
const DIGIT$1 = "0123456789";
const ALPHABET = {
  DIGIT: DIGIT$1,
  ALPHA,
  ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT$1
};
const generateString = /* @__PURE__ */ __name((size2 = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
  let str = "";
  const { length } = alphabet;
  while (size2--) {
    str += alphabet[Math.random() * length | 0];
  }
  return str;
}, "generateString");
function isSpecCompliantForm(thing) {
  return !!(thing && isFunction$3(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
}
__name(isSpecCompliantForm, "isSpecCompliantForm");
const toJSONObject = /* @__PURE__ */ __name((obj) => {
  const stack2 = new Array(10);
  const visit = /* @__PURE__ */ __name((source, i2) => {
    if (isObject$5(source)) {
      if (stack2.indexOf(source) >= 0) {
        return;
      }
      if (!("toJSON" in source)) {
        stack2[i2] = source;
        const target = isArray$2(source) ? [] : {};
        forEach$1(source, (value4, key) => {
          const reducedValue = visit(value4, i2 + 1);
          !isUndefined(reducedValue) && (target[key] = reducedValue);
        });
        stack2[i2] = void 0;
        return target;
      }
    }
    return source;
  }, "visit");
  return visit(obj, 0);
}, "toJSONObject");
const isAsyncFn = kindOfTest("AsyncFunction");
const isThenable = /* @__PURE__ */ __name((thing) => thing && (isObject$5(thing) || isFunction$3(thing)) && isFunction$3(thing.then) && isFunction$3(thing.catch), "isThenable");
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
  if (setImmediateSupported) {
    return setImmediate;
  }
  return postMessageSupported ? ((token, callbacks) => {
    _global$1.addEventListener("message", ({ source, data: data24 }) => {
      if (source === _global$1 && data24 === token) {
        callbacks.length && callbacks.shift()();
      }
    }, false);
    return (cb) => {
      callbacks.push(cb);
      _global$1.postMessage(token, "*");
    };
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
})(
  typeof setImmediate === "function",
  isFunction$3(_global$1.postMessage)
);
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global$1) : typeof process !== "undefined" && process.nextTick || _setImmediate;
const utils$2 = {
  isArray: isArray$2,
  isArrayBuffer,
  isBuffer,
  isFormData,
  isArrayBufferView,
  isString: isString$6,
  isNumber: isNumber$4,
  isBoolean: isBoolean$2,
  isObject: isObject$5,
  isPlainObject: isPlainObject$2,
  isReadableStream,
  isRequest,
  isResponse,
  isHeaders,
  isUndefined,
  isDate: isDate$1,
  isFile,
  isBlob,
  isRegExp: isRegExp$3,
  isFunction: isFunction$3,
  isStream,
  isURLSearchParams,
  isTypedArray,
  isFileList,
  forEach: forEach$1,
  merge,
  extend,
  trim,
  stripBOM,
  inherits,
  toFlatObject,
  kindOf,
  kindOfTest,
  endsWith,
  toArray,
  forEachEntry,
  matchAll,
  isHTMLForm,
  hasOwnProperty: hasOwnProperty$1,
  hasOwnProp: hasOwnProperty$1,
  // an alias to avoid ESLint no-prototype-builtins detection
  reduceDescriptors,
  freezeMethods,
  toObjectSet,
  toCamelCase,
  noop: noop$2,
  toFiniteNumber,
  findKey,
  global: _global$1,
  isContextDefined,
  ALPHABET,
  generateString,
  isSpecCompliantForm,
  toJSONObject,
  isAsyncFn,
  isThenable,
  setImmediate: _setImmediate,
  asap
};
"use strict";
function AxiosError$1(message3, code2, config2, request, response) {
  Error.call(this);
  if (Error.captureStackTrace) {
    Error.captureStackTrace(this, this.constructor);
  } else {
    this.stack = new Error().stack;
  }
  this.message = message3;
  this.name = "AxiosError";
  code2 && (this.code = code2);
  config2 && (this.config = config2);
  request && (this.request = request);
  response && (this.response = response);
}
__name(AxiosError$1, "AxiosError$1");
utils$2.inherits(AxiosError$1, Error, {
  toJSON: /* @__PURE__ */ __name(function toJSON() {
    return {
      // Standard
      message: this.message,
      name: this.name,
      // Microsoft
      description: this.description,
      number: this.number,
      // Mozilla
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      // Axios
      config: utils$2.toJSONObject(this.config),
      code: this.code,
      status: this.response && this.response.status ? this.response.status : null
    };
  }, "toJSON")
});
const prototype$1 = AxiosError$1.prototype;
const descriptors = {};
[
  "ERR_BAD_OPTION_VALUE",
  "ERR_BAD_OPTION",
  "ECONNABORTED",
  "ETIMEDOUT",
  "ERR_NETWORK",
  "ERR_FR_TOO_MANY_REDIRECTS",
  "ERR_DEPRECATED",
  "ERR_BAD_RESPONSE",
  "ERR_BAD_REQUEST",
  "ERR_CANCELED",
  "ERR_NOT_SUPPORT",
  "ERR_INVALID_URL"
  // eslint-disable-next-line func-names
].forEach((code2) => {
  descriptors[code2] = { value: code2 };
});
Object.defineProperties(AxiosError$1, descriptors);
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
AxiosError$1.from = (error2, code2, config2, request, response, customProps) => {
  const axiosError = Object.create(prototype$1);
  utils$2.toFlatObject(error2, axiosError, /* @__PURE__ */ __name(function filter4(obj) {
    return obj !== Error.prototype;
  }, "filter"), (prop2) => {
    return prop2 !== "isAxiosError";
  });
  AxiosError$1.call(axiosError, error2.message, code2, config2, request, response);
  axiosError.cause = error2;
  axiosError.name = error2.name;
  customProps && Object.assign(axiosError, customProps);
  return axiosError;
};
const httpAdapter = null;
"use strict";
function isVisitable(thing) {
  return utils$2.isPlainObject(thing) || utils$2.isArray(thing);
}
__name(isVisitable, "isVisitable");
function removeBrackets(key) {
  return utils$2.endsWith(key, "[]") ? key.slice(0, -2) : key;
}
__name(removeBrackets, "removeBrackets");
function renderKey(path, key, dots) {
  if (!path) return key;
  return path.concat(key).map(/* @__PURE__ */ __name(function each(token, i2) {
    token = removeBrackets(token);
    return !dots && i2 ? "[" + token + "]" : token;
  }, "each")).join(dots ? "." : "");
}
__name(renderKey, "renderKey");
function isFlatArray(arr) {
  return utils$2.isArray(arr) && !arr.some(isVisitable);
}
__name(isFlatArray, "isFlatArray");
const predicates = utils$2.toFlatObject(utils$2, {}, null, /* @__PURE__ */ __name(function filter3(prop2) {
  return /^is[A-Z]/.test(prop2);
}, "filter"));
function toFormData$1(obj, formData, options4) {
  if (!utils$2.isObject(obj)) {
    throw new TypeError("target must be an object");
  }
  formData = formData || new (httpAdapter || FormData)();
  options4 = utils$2.toFlatObject(options4, {
    metaTokens: true,
    dots: false,
    indexes: false
  }, false, /* @__PURE__ */ __name(function defined(option3, source) {
    return !utils$2.isUndefined(source[option3]);
  }, "defined"));
  const metaTokens = options4.metaTokens;
  const visitor = options4.visitor || defaultVisitor;
  const dots = options4.dots;
  const indexes = options4.indexes;
  const _Blob = options4.Blob || typeof Blob !== "undefined" && Blob;
  const useBlob = _Blob && utils$2.isSpecCompliantForm(formData);
  if (!utils$2.isFunction(visitor)) {
    throw new TypeError("visitor must be a function");
  }
  function convertValue(value4) {
    if (value4 === null) return "";
    if (utils$2.isDate(value4)) {
      return value4.toISOString();
    }
    if (!useBlob && utils$2.isBlob(value4)) {
      throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
    }
    if (utils$2.isArrayBuffer(value4) || utils$2.isTypedArray(value4)) {
      return useBlob && typeof Blob === "function" ? new Blob([value4]) : Buffer.from(value4);
    }
    return value4;
  }
  __name(convertValue, "convertValue");
  function defaultVisitor(value4, key, path) {
    let arr = value4;
    if (value4 && !path && typeof value4 === "object") {
      if (utils$2.endsWith(key, "{}")) {
        key = metaTokens ? key : key.slice(0, -2);
        value4 = JSON.stringify(value4);
      } else if (utils$2.isArray(value4) && isFlatArray(value4) || (utils$2.isFileList(value4) || utils$2.endsWith(key, "[]")) && (arr = utils$2.toArray(value4))) {
        key = removeBrackets(key);
        arr.forEach(/* @__PURE__ */ __name(function each(el, index2) {
          !(utils$2.isUndefined(el) || el === null) && formData.append(
            // eslint-disable-next-line no-nested-ternary
            indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
            convertValue(el)
          );
        }, "each"));
        return false;
      }
    }
    if (isVisitable(value4)) {
      return true;
    }
    formData.append(renderKey(path, key, dots), convertValue(value4));
    return false;
  }
  __name(defaultVisitor, "defaultVisitor");
  const stack2 = [];
  const exposedHelpers = Object.assign(predicates, {
    defaultVisitor,
    convertValue,
    isVisitable
  });
  function build(value4, path) {
    if (utils$2.isUndefined(value4)) return;
    if (stack2.indexOf(value4) !== -1) {
      throw Error("Circular reference detected in " + path.join("."));
    }
    stack2.push(value4);
    utils$2.forEach(value4, /* @__PURE__ */ __name(function each(el, key) {
      const result = !(utils$2.isUndefined(el) || el === null) && visitor.call(
        formData,
        el,
        utils$2.isString(key) ? key.trim() : key,
        path,
        exposedHelpers
      );
      if (result === true) {
        build(el, path ? path.concat(key) : [key]);
      }
    }, "each"));
    stack2.pop();
  }
  __name(build, "build");
  if (!utils$2.isObject(obj)) {
    throw new TypeError("data must be an object");
  }
  build(obj);
  return formData;
}
__name(toFormData$1, "toFormData$1");
"use strict";
function encode$4(str) {
  const charMap = {
    "!": "%21",
    "'": "%27",
    "(": "%28",
    ")": "%29",
    "~": "%7E",
    "%20": "+",
    "%00": "\0"
  };
  return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, /* @__PURE__ */ __name(function replacer2(match2) {
    return charMap[match2];
  }, "replacer"));
}
__name(encode$4, "encode$4");
function AxiosURLSearchParams(params, options4) {
  this._pairs = [];
  params && toFormData$1(params, this, options4);
}
__name(AxiosURLSearchParams, "AxiosURLSearchParams");
const prototype = AxiosURLSearchParams.prototype;
prototype.append = /* @__PURE__ */ __name(function append(name2, value4) {
  this._pairs.push([name2, value4]);
}, "append");
prototype.toString = /* @__PURE__ */ __name(function toString2(encoder) {
  const _encode = encoder ? function(value4) {
    return encoder.call(this, value4, encode$4);
  } : encode$4;
  return this._pairs.map(/* @__PURE__ */ __name(function each(pair) {
    return _encode(pair[0]) + "=" + _encode(pair[1]);
  }, "each"), "").join("&");
}, "toString");
"use strict";
function encode$3(val) {
  return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
__name(encode$3, "encode$3");
function buildURL(url, params, options4) {
  if (!params) {
    return url;
  }
  const _encode = options4 && options4.encode || encode$3;
  const serializeFn = options4 && options4.serialize;
  let serializedParams;
  if (serializeFn) {
    serializedParams = serializeFn(params, options4);
  } else {
    serializedParams = utils$2.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options4).toString(_encode);
  }
  if (serializedParams) {
    const hashmarkIndex = url.indexOf("#");
    if (hashmarkIndex !== -1) {
      url = url.slice(0, hashmarkIndex);
    }
    url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  }
  return url;
}
__name(buildURL, "buildURL");
"use strict";
class InterceptorManager {
  static {
    __name(this, "InterceptorManager");
  }
  constructor() {
    this.handlers = [];
  }
  /**
   * Add a new interceptor to the stack
   *
   * @param {Function} fulfilled The function to handle `then` for a `Promise`
   * @param {Function} rejected The function to handle `reject` for a `Promise`
   *
   * @return {Number} An ID used to remove interceptor later
   */
  use(fulfilled, rejected, options4) {
    this.handlers.push({
      fulfilled,
      rejected,
      synchronous: options4 ? options4.synchronous : false,
      runWhen: options4 ? options4.runWhen : null
    });
    return this.handlers.length - 1;
  }
  /**
   * Remove an interceptor from the stack
   *
   * @param {Number} id The ID that was returned by `use`
   *
   * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
   */
  eject(id3) {
    if (this.handlers[id3]) {
      this.handlers[id3] = null;
    }
  }
  /**
   * Clear all interceptors from the stack
   *
   * @returns {void}
   */
  clear() {
    if (this.handlers) {
      this.handlers = [];
    }
  }
  /**
   * Iterate over all the registered interceptors
   *
   * This method is particularly useful for skipping over any
   * interceptors that may have become `null` calling `eject`.
   *
   * @param {Function} fn The function to call for each interceptor
   *
   * @returns {void}
   */
  forEach(fn) {
    utils$2.forEach(this.handlers, /* @__PURE__ */ __name(function forEachHandler(h2) {
      if (h2 !== null) {
        fn(h2);
      }
    }, "forEachHandler"));
  }
}
"use strict";
const transitionalDefaults = {
  silentJSONParsing: true,
  forcedJSONParsing: true,
  clarifyTimeoutError: false
};
"use strict";
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
"use strict";
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
"use strict";
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
const platform$1 = {
  isBrowser: true,
  classes: {
    URLSearchParams: URLSearchParams$1,
    FormData: FormData$1,
    Blob: Blob$1
  },
  protocols: ["http", "https", "file", "blob", "url", "data"]
};
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
const hasStandardBrowserEnv = ((product) => {
  return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
})(typeof navigator !== "undefined" && navigator.product);
const hasStandardBrowserWebWorkerEnv = (() => {
  return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
  self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
})();
const origin = hasBrowserEnv && window.location.href || "http://localhost";
const utils$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  hasBrowserEnv,
  hasStandardBrowserEnv,
  hasStandardBrowserWebWorkerEnv,
  origin
}, Symbol.toStringTag, { value: "Module" }));
const platform = {
  ...utils$1,
  ...platform$1
};
"use strict";
function toURLEncodedForm(data24, options4) {
  return toFormData$1(data24, new platform.classes.URLSearchParams(), Object.assign({
    visitor: /* @__PURE__ */ __name(function(value4, key, path, helpers2) {
      if (platform.isNode && utils$2.isBuffer(value4)) {
        this.append(key, value4.toString("base64"));
        return false;
      }
      return helpers2.defaultVisitor.apply(this, arguments);
    }, "visitor")
  }, options4));
}
__name(toURLEncodedForm, "toURLEncodedForm");
"use strict";
function parsePropPath(name2) {
  return utils$2.matchAll(/\w+|\[(\w*)]/g, name2).map((match2) => {
    return match2[0] === "[]" ? "" : match2[1] || match2[0];
  });
}
__name(parsePropPath, "parsePropPath");
function arrayToObject(arr) {
  const obj = {};
  const keys2 = Object.keys(arr);
  let i2;
  const len = keys2.length;
  let key;
  for (i2 = 0; i2 < len; i2++) {
    key = keys2[i2];
    obj[key] = arr[key];
  }
  return obj;
}
__name(arrayToObject, "arrayToObject");
function formDataToJSON(formData) {
  function buildPath(path, value4, target, index2) {
    let name2 = path[index2++];
    if (name2 === "__proto__") return true;
    const isNumericKey = Number.isFinite(+name2);
    const isLast = index2 >= path.length;
    name2 = !name2 && utils$2.isArray(target) ? target.length : name2;
    if (isLast) {
      if (utils$2.hasOwnProp(target, name2)) {
        target[name2] = [target[name2], value4];
      } else {
        target[name2] = value4;
      }
      return !isNumericKey;
    }
    if (!target[name2] || !utils$2.isObject(target[name2])) {
      target[name2] = [];
    }
    const result = buildPath(path, value4, target[name2], index2);
    if (result && utils$2.isArray(target[name2])) {
      target[name2] = arrayToObject(target[name2]);
    }
    return !isNumericKey;
  }
  __name(buildPath, "buildPath");
  if (utils$2.isFormData(formData) && utils$2.isFunction(formData.entries)) {
    const obj = {};
    utils$2.forEachEntry(formData, (name2, value4) => {
      buildPath(parsePropPath(name2), value4, obj, 0);
    });
    return obj;
  }
  return null;
}
__name(formDataToJSON, "formDataToJSON");
"use strict";
function stringifySafely(rawValue, parser, encoder) {
  if (utils$2.isString(rawValue)) {
    try {
      (parser || JSON.parse)(rawValue);
      return utils$2.trim(rawValue);
    } catch (e2) {
      if (e2.name !== "SyntaxError") {
        throw e2;
      }
    }
  }
  return (encoder || JSON.stringify)(rawValue);
}
__name(stringifySafely, "stringifySafely");
const defaults$2 = {
  transitional: transitionalDefaults,
  adapter: ["xhr", "http", "fetch"],
  transformRequest: [/* @__PURE__ */ __name(function transformRequest(data24, headers) {
    const contentType = headers.getContentType() || "";
    const hasJSONContentType = contentType.indexOf("application/json") > -1;
    const isObjectPayload = utils$2.isObject(data24);
    if (isObjectPayload && utils$2.isHTMLForm(data24)) {
      data24 = new FormData(data24);
    }
    const isFormData2 = utils$2.isFormData(data24);
    if (isFormData2) {
      return hasJSONContentType ? JSON.stringify(formDataToJSON(data24)) : data24;
    }
    if (utils$2.isArrayBuffer(data24) || utils$2.isBuffer(data24) || utils$2.isStream(data24) || utils$2.isFile(data24) || utils$2.isBlob(data24) || utils$2.isReadableStream(data24)) {
      return data24;
    }
    if (utils$2.isArrayBufferView(data24)) {
      return data24.buffer;
    }
    if (utils$2.isURLSearchParams(data24)) {
      headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
      return data24.toString();
    }
    let isFileList2;
    if (isObjectPayload) {
      if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
        return toURLEncodedForm(data24, this.formSerializer).toString();
      }
      if ((isFileList2 = utils$2.isFileList(data24)) || contentType.indexOf("multipart/form-data") > -1) {
        const _FormData = this.env && this.env.FormData;
        return toFormData$1(
          isFileList2 ? { "files[]": data24 } : data24,
          _FormData && new _FormData(),
          this.formSerializer
        );
      }
    }
    if (isObjectPayload || hasJSONContentType) {
      headers.setContentType("application/json", false);
      return stringifySafely(data24);
    }
    return data24;
  }, "transformRequest")],
  transformResponse: [/* @__PURE__ */ __name(function transformResponse(data24) {
    const transitional2 = this.transitional || defaults$2.transitional;
    const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
    const JSONRequested = this.responseType === "json";
    if (utils$2.isResponse(data24) || utils$2.isReadableStream(data24)) {
      return data24;
    }
    if (data24 && utils$2.isString(data24) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
      const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
      const strictJSONParsing = !silentJSONParsing && JSONRequested;
      try {
        return JSON.parse(data24);
      } catch (e2) {
        if (strictJSONParsing) {
          if (e2.name === "SyntaxError") {
            throw AxiosError$1.from(e2, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
          }
          throw e2;
        }
      }
    }
    return data24;
  }, "transformResponse")],
  /**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */
  timeout: 0,
  xsrfCookieName: "XSRF-TOKEN",
  xsrfHeaderName: "X-XSRF-TOKEN",
  maxContentLength: -1,
  maxBodyLength: -1,
  env: {
    FormData: platform.classes.FormData,
    Blob: platform.classes.Blob
  },
  validateStatus: /* @__PURE__ */ __name(function validateStatus(status) {
    return status >= 200 && status < 300;
  }, "validateStatus"),
  headers: {
    common: {
      "Accept": "application/json, text/plain, */*",
      "Content-Type": void 0
    }
  }
};
utils$2.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
  defaults$2.headers[method] = {};
});
"use strict";
const ignoreDuplicateOf = utils$2.toObjectSet([
  "age",
  "authorization",
  "content-length",
  "content-type",
  "etag",
  "expires",
  "from",
  "host",
  "if-modified-since",
  "if-unmodified-since",
  "last-modified",
  "location",
  "max-forwards",
  "proxy-authorization",
  "referer",
  "retry-after",
  "user-agent"
]);
const parseHeaders = /* @__PURE__ */ __name((rawHeaders) => {
  const parsed = {};
  let key;
  let val;
  let i2;
  rawHeaders && rawHeaders.split("\n").forEach(/* @__PURE__ */ __name(function parser(line) {
    i2 = line.indexOf(":");
    key = line.substring(0, i2).trim().toLowerCase();
    val = line.substring(i2 + 1).trim();
    if (!key || parsed[key] && ignoreDuplicateOf[key]) {
      return;
    }
    if (key === "set-cookie") {
      if (parsed[key]) {
        parsed[key].push(val);
      } else {
        parsed[key] = [val];
      }
    } else {
      parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
    }
  }, "parser"));
  return parsed;
}, "parseHeaders");
"use strict";
const $internals = Symbol("internals");
function normalizeHeader(header3) {
  return header3 && String(header3).trim().toLowerCase();
}
__name(normalizeHeader, "normalizeHeader");
function normalizeValue(value4) {
  if (value4 === false || value4 == null) {
    return value4;
  }
  return utils$2.isArray(value4) ? value4.map(normalizeValue) : String(value4);
}
__name(normalizeValue, "normalizeValue");
function parseTokens(str) {
  const tokens = /* @__PURE__ */ Object.create(null);
  const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  let match2;
  while (match2 = tokensRE.exec(str)) {
    tokens[match2[1]] = match2[2];
  }
  return tokens;
}
__name(parseTokens, "parseTokens");
const isValidHeaderName = /* @__PURE__ */ __name((str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()), "isValidHeaderName");
function matchHeaderValue(context, value4, header3, filter4, isHeaderNameFilter) {
  if (utils$2.isFunction(filter4)) {
    return filter4.call(this, value4, header3);
  }
  if (isHeaderNameFilter) {
    value4 = header3;
  }
  if (!utils$2.isString(value4)) return;
  if (utils$2.isString(filter4)) {
    return value4.indexOf(filter4) !== -1;
  }
  if (utils$2.isRegExp(filter4)) {
    return filter4.test(value4);
  }
}
__name(matchHeaderValue, "matchHeaderValue");
function formatHeader(header3) {
  return header3.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
    return char.toUpperCase() + str;
  });
}
__name(formatHeader, "formatHeader");
function buildAccessors(obj, header3) {
  const accessorName = utils$2.toCamelCase(" " + header3);
  ["get", "set", "has"].forEach((methodName) => {
    Object.defineProperty(obj, methodName + accessorName, {
      value: /* @__PURE__ */ __name(function(arg1, arg2, arg3) {
        return this[methodName].call(this, header3, arg1, arg2, arg3);
      }, "value"),
      configurable: true
    });
  });
}
__name(buildAccessors, "buildAccessors");
let AxiosHeaders$1 = class AxiosHeaders2 {
  static {
    __name(this, "AxiosHeaders");
  }
  constructor(headers) {
    headers && this.set(headers);
  }
  set(header3, valueOrRewrite, rewrite) {
    const self2 = this;
    function setHeader(_value, _header, _rewrite) {
      const lHeader = normalizeHeader(_header);
      if (!lHeader) {
        throw new Error("header name must be a non-empty string");
      }
      const key = utils$2.findKey(self2, lHeader);
      if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
        self2[key || _header] = normalizeValue(_value);
      }
    }
    __name(setHeader, "setHeader");
    const setHeaders = /* @__PURE__ */ __name((headers, _rewrite) => utils$2.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)), "setHeaders");
    if (utils$2.isPlainObject(header3) || header3 instanceof this.constructor) {
      setHeaders(header3, valueOrRewrite);
    } else if (utils$2.isString(header3) && (header3 = header3.trim()) && !isValidHeaderName(header3)) {
      setHeaders(parseHeaders(header3), valueOrRewrite);
    } else if (utils$2.isHeaders(header3)) {
      for (const [key, value4] of header3.entries()) {
        setHeader(value4, key, rewrite);
      }
    } else {
      header3 != null && setHeader(valueOrRewrite, header3, rewrite);
    }
    return this;
  }
  get(header3, parser) {
    header3 = normalizeHeader(header3);
    if (header3) {
      const key = utils$2.findKey(this, header3);
      if (key) {
        const value4 = this[key];
        if (!parser) {
          return value4;
        }
        if (parser === true) {
          return parseTokens(value4);
        }
        if (utils$2.isFunction(parser)) {
          return parser.call(this, value4, key);
        }
        if (utils$2.isRegExp(parser)) {
          return parser.exec(value4);
        }
        throw new TypeError("parser must be boolean|regexp|function");
      }
    }
  }
  has(header3, matcher) {
    header3 = normalizeHeader(header3);
    if (header3) {
      const key = utils$2.findKey(this, header3);
      return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
    }
    return false;
  }
  delete(header3, matcher) {
    const self2 = this;
    let deleted = false;
    function deleteHeader(_header) {
      _header = normalizeHeader(_header);
      if (_header) {
        const key = utils$2.findKey(self2, _header);
        if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
          delete self2[key];
          deleted = true;
        }
      }
    }
    __name(deleteHeader, "deleteHeader");
    if (utils$2.isArray(header3)) {
      header3.forEach(deleteHeader);
    } else {
      deleteHeader(header3);
    }
    return deleted;
  }
  clear(matcher) {
    const keys2 = Object.keys(this);
    let i2 = keys2.length;
    let deleted = false;
    while (i2--) {
      const key = keys2[i2];
      if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
        delete this[key];
        deleted = true;
      }
    }
    return deleted;
  }
  normalize(format2) {
    const self2 = this;
    const headers = {};
    utils$2.forEach(this, (value4, header3) => {
      const key = utils$2.findKey(headers, header3);
      if (key) {
        self2[key] = normalizeValue(value4);
        delete self2[header3];
        return;
      }
      const normalized = format2 ? formatHeader(header3) : String(header3).trim();
      if (normalized !== header3) {
        delete self2[header3];
      }
      self2[normalized] = normalizeValue(value4);
      headers[normalized] = true;
    });
    return this;
  }
  concat(...targets) {
    return this.constructor.concat(this, ...targets);
  }
  toJSON(asStrings) {
    const obj = /* @__PURE__ */ Object.create(null);
    utils$2.forEach(this, (value4, header3) => {
      value4 != null && value4 !== false && (obj[header3] = asStrings && utils$2.isArray(value4) ? value4.join(", ") : value4);
    });
    return obj;
  }
  [Symbol.iterator]() {
    return Object.entries(this.toJSON())[Symbol.iterator]();
  }
  toString() {
    return Object.entries(this.toJSON()).map(([header3, value4]) => header3 + ": " + value4).join("\n");
  }
  get [Symbol.toStringTag]() {
    return "AxiosHeaders";
  }
  static from(thing) {
    return thing instanceof this ? thing : new this(thing);
  }
  static concat(first2, ...targets) {
    const computed2 = new this(first2);
    targets.forEach((target) => computed2.set(target));
    return computed2;
  }
  static accessor(header3) {
    const internals = this[$internals] = this[$internals] = {
      accessors: {}
    };
    const accessors = internals.accessors;
    const prototype2 = this.prototype;
    function defineAccessor(_header) {
      const lHeader = normalizeHeader(_header);
      if (!accessors[lHeader]) {
        buildAccessors(prototype2, _header);
        accessors[lHeader] = true;
      }
    }
    __name(defineAccessor, "defineAccessor");
    utils$2.isArray(header3) ? header3.forEach(defineAccessor) : defineAccessor(header3);
    return this;
  }
};
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
utils$2.reduceDescriptors(AxiosHeaders$1.prototype, ({ value: value4 }, key) => {
  let mapped = key[0].toUpperCase() + key.slice(1);
  return {
    get: /* @__PURE__ */ __name(() => value4, "get"),
    set(headerValue) {
      this[mapped] = headerValue;
    }
  };
});
utils$2.freezeMethods(AxiosHeaders$1);
"use strict";
function transformData(fns, response) {
  const config2 = this || defaults$2;
  const context = response || config2;
  const headers = AxiosHeaders$1.from(context.headers);
  let data24 = context.data;
  utils$2.forEach(fns, /* @__PURE__ */ __name(function transform2(fn) {
    data24 = fn.call(config2, data24, headers.normalize(), response ? response.status : void 0);
  }, "transform"));
  headers.normalize();
  return data24;
}
__name(transformData, "transformData");
"use strict";
function isCancel$1(value4) {
  return !!(value4 && value4.__CANCEL__);
}
__name(isCancel$1, "isCancel$1");
"use strict";
function CanceledError$1(message3, config2, request) {
  AxiosError$1.call(this, message3 == null ? "canceled" : message3, AxiosError$1.ERR_CANCELED, config2, request);
  this.name = "CanceledError";
}
__name(CanceledError$1, "CanceledError$1");
utils$2.inherits(CanceledError$1, AxiosError$1, {
  __CANCEL__: true
});
"use strict";
function settle(resolve2, reject3, response) {
  const validateStatus2 = response.config.validateStatus;
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
    resolve2(response);
  } else {
    reject3(new AxiosError$1(
      "Request failed with status code " + response.status,
      [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
      response.config,
      response.request,
      response
    ));
  }
}
__name(settle, "settle");
"use strict";
function parseProtocol(url) {
  const match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  return match2 && match2[1] || "";
}
__name(parseProtocol, "parseProtocol");
"use strict";
function speedometer(samplesCount, min) {
  samplesCount = samplesCount || 10;
  const bytes = new Array(samplesCount);
  const timestamps = new Array(samplesCount);
  let head = 0;
  let tail = 0;
  let firstSampleTS;
  min = min !== void 0 ? min : 1e3;
  return /* @__PURE__ */ __name(function push(chunkLength) {
    const now2 = Date.now();
    const startedAt = timestamps[tail];
    if (!firstSampleTS) {
      firstSampleTS = now2;
    }
    bytes[head] = chunkLength;
    timestamps[head] = now2;
    let i2 = tail;
    let bytesCount = 0;
    while (i2 !== head) {
      bytesCount += bytes[i2++];
      i2 = i2 % samplesCount;
    }
    head = (head + 1) % samplesCount;
    if (head === tail) {
      tail = (tail + 1) % samplesCount;
    }
    if (now2 - firstSampleTS < min) {
      return;
    }
    const passed = startedAt && now2 - startedAt;
    return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
  }, "push");
}
__name(speedometer, "speedometer");
function throttle(fn, freq) {
  let timestamp2 = 0;
  let threshold = 1e3 / freq;
  let lastArgs;
  let timer;
  const invoke2 = /* @__PURE__ */ __name((args, now2 = Date.now()) => {
    timestamp2 = now2;
    lastArgs = null;
    if (timer) {
      clearTimeout(timer);
      timer = null;
    }
    fn.apply(null, args);
  }, "invoke");
  const throttled = /* @__PURE__ */ __name((...args) => {
    const now2 = Date.now();
    const passed = now2 - timestamp2;
    if (passed >= threshold) {
      invoke2(args, now2);
    } else {
      lastArgs = args;
      if (!timer) {
        timer = setTimeout(() => {
          timer = null;
          invoke2(lastArgs);
        }, threshold - passed);
      }
    }
  }, "throttled");
  const flush = /* @__PURE__ */ __name(() => lastArgs && invoke2(lastArgs), "flush");
  return [throttled, flush];
}
__name(throttle, "throttle");
const progressEventReducer = /* @__PURE__ */ __name((listener, isDownloadStream, freq = 3) => {
  let bytesNotified = 0;
  const _speedometer = speedometer(50, 250);
  return throttle((e2) => {
    const loaded = e2.loaded;
    const total = e2.lengthComputable ? e2.total : void 0;
    const progressBytes = loaded - bytesNotified;
    const rate = _speedometer(progressBytes);
    const inRange = loaded <= total;
    bytesNotified = loaded;
    const data24 = {
      loaded,
      total,
      progress: total ? loaded / total : void 0,
      bytes: progressBytes,
      rate: rate ? rate : void 0,
      estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
      event: e2,
      lengthComputable: total != null,
      [isDownloadStream ? "download" : "upload"]: true
    };
    listener(data24);
  }, freq);
}, "progressEventReducer");
const progressEventDecorator = /* @__PURE__ */ __name((total, throttled) => {
  const lengthComputable = total != null;
  return [(loaded) => throttled[0]({
    lengthComputable,
    total,
    loaded
  }), throttled[1]];
}, "progressEventDecorator");
const asyncDecorator = /* @__PURE__ */ __name((fn) => (...args) => utils$2.asap(() => fn(...args)), "asyncDecorator");
"use strict";
const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
  // Standard browser envs have full support of the APIs needed to test
  // whether the request URL is of the same origin as current location.
  (/* @__PURE__ */ __name(function standardBrowserEnv() {
    const msie = /(msie|trident)/i.test(navigator.userAgent);
    const urlParsingNode = document.createElement("a");
    let originURL;
    function resolveURL(url) {
      let href = url;
      if (msie) {
        urlParsingNode.setAttribute("href", href);
        href = urlParsingNode.href;
      }
      urlParsingNode.setAttribute("href", href);
      return {
        href: urlParsingNode.href,
        protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
        host: urlParsingNode.host,
        search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
        hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
        hostname: urlParsingNode.hostname,
        port: urlParsingNode.port,
        pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
      };
    }
    __name(resolveURL, "resolveURL");
    originURL = resolveURL(window.location.href);
    return /* @__PURE__ */ __name(function isURLSameOrigin2(requestURL) {
      const parsed = utils$2.isString(requestURL) ? resolveURL(requestURL) : requestURL;
      return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
    }, "isURLSameOrigin");
  }, "standardBrowserEnv"))()
) : (
  // Non standard browser envs (web workers, react-native) lack needed support.
  (/* @__PURE__ */ __name(function nonStandardBrowserEnv() {
    return /* @__PURE__ */ __name(function isURLSameOrigin2() {
      return true;
    }, "isURLSameOrigin");
  }, "nonStandardBrowserEnv"))()
);
const cookies = platform.hasStandardBrowserEnv ? (
  // Standard browser envs support document.cookie
  {
    write(name2, value4, expires, path, domain2, secure) {
      const cookie = [name2 + "=" + encodeURIComponent(value4)];
      utils$2.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
      utils$2.isString(path) && cookie.push("path=" + path);
      utils$2.isString(domain2) && cookie.push("domain=" + domain2);
      secure === true && cookie.push("secure");
      document.cookie = cookie.join("; ");
    },
    read(name2) {
      const match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
      return match2 ? decodeURIComponent(match2[3]) : null;
    },
    remove(name2) {
      this.write(name2, "", Date.now() - 864e5);
    }
  }
) : (
  // Non-standard browser env (web workers, react-native) lack needed support.
  {
    write() {
    },
    read() {
      return null;
    },
    remove() {
    }
  }
);
"use strict";
function isAbsoluteURL$1(url) {
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
}
__name(isAbsoluteURL$1, "isAbsoluteURL$1");
"use strict";
function combineURLs(baseURL, relativeURL) {
  return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
}
__name(combineURLs, "combineURLs");
"use strict";
function buildFullPath(baseURL, requestedURL) {
  if (baseURL && !isAbsoluteURL$1(requestedURL)) {
    return combineURLs(baseURL, requestedURL);
  }
  return requestedURL;
}
__name(buildFullPath, "buildFullPath");
"use strict";
const headersToObject$1 = /* @__PURE__ */ __name((thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing, "headersToObject$1");
function mergeConfig$1(config1, config2) {
  config2 = config2 || {};
  const config3 = {};
  function getMergedValue(target, source, caseless) {
    if (utils$2.isPlainObject(target) && utils$2.isPlainObject(source)) {
      return utils$2.merge.call({ caseless }, target, source);
    } else if (utils$2.isPlainObject(source)) {
      return utils$2.merge({}, source);
    } else if (utils$2.isArray(source)) {
      return source.slice();
    }
    return source;
  }
  __name(getMergedValue, "getMergedValue");
  function mergeDeepProperties(a, b, caseless) {
    if (!utils$2.isUndefined(b)) {
      return getMergedValue(a, b, caseless);
    } else if (!utils$2.isUndefined(a)) {
      return getMergedValue(void 0, a, caseless);
    }
  }
  __name(mergeDeepProperties, "mergeDeepProperties");
  function valueFromConfig2(a, b) {
    if (!utils$2.isUndefined(b)) {
      return getMergedValue(void 0, b);
    }
  }
  __name(valueFromConfig2, "valueFromConfig2");
  function defaultToConfig2(a, b) {
    if (!utils$2.isUndefined(b)) {
      return getMergedValue(void 0, b);
    } else if (!utils$2.isUndefined(a)) {
      return getMergedValue(void 0, a);
    }
  }
  __name(defaultToConfig2, "defaultToConfig2");
  function mergeDirectKeys(a, b, prop2) {
    if (prop2 in config2) {
      return getMergedValue(a, b);
    } else if (prop2 in config1) {
      return getMergedValue(void 0, a);
    }
  }
  __name(mergeDirectKeys, "mergeDirectKeys");
  const mergeMap = {
    url: valueFromConfig2,
    method: valueFromConfig2,
    data: valueFromConfig2,
    baseURL: defaultToConfig2,
    transformRequest: defaultToConfig2,
    transformResponse: defaultToConfig2,
    paramsSerializer: defaultToConfig2,
    timeout: defaultToConfig2,
    timeoutMessage: defaultToConfig2,
    withCredentials: defaultToConfig2,
    withXSRFToken: defaultToConfig2,
    adapter: defaultToConfig2,
    responseType: defaultToConfig2,
    xsrfCookieName: defaultToConfig2,
    xsrfHeaderName: defaultToConfig2,
    onUploadProgress: defaultToConfig2,
    onDownloadProgress: defaultToConfig2,
    decompress: defaultToConfig2,
    maxContentLength: defaultToConfig2,
    maxBodyLength: defaultToConfig2,
    beforeRedirect: defaultToConfig2,
    transport: defaultToConfig2,
    httpAgent: defaultToConfig2,
    httpsAgent: defaultToConfig2,
    cancelToken: defaultToConfig2,
    socketPath: defaultToConfig2,
    responseEncoding: defaultToConfig2,
    validateStatus: mergeDirectKeys,
    headers: /* @__PURE__ */ __name((a, b) => mergeDeepProperties(headersToObject$1(a), headersToObject$1(b), true), "headers")
  };
  utils$2.forEach(Object.keys(Object.assign({}, config1, config2)), /* @__PURE__ */ __name(function computeConfigValue(prop2) {
    const merge2 = mergeMap[prop2] || mergeDeepProperties;
    const configValue = merge2(config1[prop2], config2[prop2], prop2);
    utils$2.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config3[prop2] = configValue);
  }, "computeConfigValue"));
  return config3;
}
__name(mergeConfig$1, "mergeConfig$1");
const resolveConfig = /* @__PURE__ */ __name((config2) => {
  const newConfig = mergeConfig$1({}, config2);
  let { data: data24, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
  newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config2.params, config2.paramsSerializer);
  if (auth) {
    headers.set(
      "Authorization",
      "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
    );
  }
  let contentType;
  if (utils$2.isFormData(data24)) {
    if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
      headers.setContentType(void 0);
    } else if ((contentType = headers.getContentType()) !== false) {
      const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
      headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
    }
  }
  if (platform.hasStandardBrowserEnv) {
    withXSRFToken && utils$2.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
    if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
      const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
      if (xsrfValue) {
        headers.set(xsrfHeaderName, xsrfValue);
      }
    }
  }
  return newConfig;
}, "resolveConfig");
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
const xhrAdapter = isXHRAdapterSupported && function(config2) {
  return new Promise(/* @__PURE__ */ __name(function dispatchXhrRequest(resolve2, reject3) {
    const _config = resolveConfig(config2);
    let requestData = _config.data;
    const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
    let { responseType, onUploadProgress, onDownloadProgress } = _config;
    let onCanceled;
    let uploadThrottled, downloadThrottled;
    let flushUpload, flushDownload;
    function done() {
      flushUpload && flushUpload();
      flushDownload && flushDownload();
      _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
      _config.signal && _config.signal.removeEventListener("abort", onCanceled);
    }
    __name(done, "done");
    let request = new XMLHttpRequest();
    request.open(_config.method.toUpperCase(), _config.url, true);
    request.timeout = _config.timeout;
    function onloadend() {
      if (!request) {
        return;
      }
      const responseHeaders = AxiosHeaders$1.from(
        "getAllResponseHeaders" in request && request.getAllResponseHeaders()
      );
      const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
      const response = {
        data: responseData,
        status: request.status,
        statusText: request.statusText,
        headers: responseHeaders,
        config: config2,
        request
      };
      settle(/* @__PURE__ */ __name(function _resolve(value4) {
        resolve2(value4);
        done();
      }, "_resolve"), /* @__PURE__ */ __name(function _reject(err) {
        reject3(err);
        done();
      }, "_reject"), response);
      request = null;
    }
    __name(onloadend, "onloadend");
    if ("onloadend" in request) {
      request.onloadend = onloadend;
    } else {
      request.onreadystatechange = /* @__PURE__ */ __name(function handleLoad() {
        if (!request || request.readyState !== 4) {
          return;
        }
        if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
          return;
        }
        setTimeout(onloadend);
      }, "handleLoad");
    }
    request.onabort = /* @__PURE__ */ __name(function handleAbort() {
      if (!request) {
        return;
      }
      reject3(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config2, request));
      request = null;
    }, "handleAbort");
    request.onerror = /* @__PURE__ */ __name(function handleError2() {
      reject3(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config2, request));
      request = null;
    }, "handleError");
    request.ontimeout = /* @__PURE__ */ __name(function handleTimeout() {
      let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
      const transitional2 = _config.transitional || transitionalDefaults;
      if (_config.timeoutErrorMessage) {
        timeoutErrorMessage = _config.timeoutErrorMessage;
      }
      reject3(new AxiosError$1(
        timeoutErrorMessage,
        transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
        config2,
        request
      ));
      request = null;
    }, "handleTimeout");
    requestData === void 0 && requestHeaders.setContentType(null);
    if ("setRequestHeader" in request) {
      utils$2.forEach(requestHeaders.toJSON(), /* @__PURE__ */ __name(function setRequestHeader(val, key) {
        request.setRequestHeader(key, val);
      }, "setRequestHeader"));
    }
    if (!utils$2.isUndefined(_config.withCredentials)) {
      request.withCredentials = !!_config.withCredentials;
    }
    if (responseType && responseType !== "json") {
      request.responseType = _config.responseType;
    }
    if (onDownloadProgress) {
      [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
      request.addEventListener("progress", downloadThrottled);
    }
    if (onUploadProgress && request.upload) {
      [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
      request.upload.addEventListener("progress", uploadThrottled);
      request.upload.addEventListener("loadend", flushUpload);
    }
    if (_config.cancelToken || _config.signal) {
      onCanceled = /* @__PURE__ */ __name((cancel) => {
        if (!request) {
          return;
        }
        reject3(!cancel || cancel.type ? new CanceledError$1(null, config2, request) : cancel);
        request.abort();
        request = null;
      }, "onCanceled");
      _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
      if (_config.signal) {
        _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
      }
    }
    const protocol = parseProtocol(_config.url);
    if (protocol && platform.protocols.indexOf(protocol) === -1) {
      reject3(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config2));
      return;
    }
    request.send(requestData || null);
  }, "dispatchXhrRequest"));
};
const composeSignals = /* @__PURE__ */ __name((signals, timeout) => {
  let controller = new AbortController();
  let aborted;
  const onabort = /* @__PURE__ */ __name(function(cancel) {
    if (!aborted) {
      aborted = true;
      unsubscribe();
      const err = cancel instanceof Error ? cancel : this.reason;
      controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
    }
  }, "onabort");
  let timer = timeout && setTimeout(() => {
    onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
  }, timeout);
  const unsubscribe = /* @__PURE__ */ __name(() => {
    if (signals) {
      timer && clearTimeout(timer);
      timer = null;
      signals.forEach((signal2) => {
        signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort));
      });
      signals = null;
    }
  }, "unsubscribe");
  signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort));
  const { signal } = controller;
  signal.unsubscribe = unsubscribe;
  return [signal, () => {
    timer && clearTimeout(timer);
    timer = null;
  }];
}, "composeSignals");
const streamChunk = /* @__PURE__ */ __name(function* (chunk, chunkSize) {
  let len = chunk.byteLength;
  if (!chunkSize || len < chunkSize) {
    yield chunk;
    return;
  }
  let pos2 = 0;
  let end;
  while (pos2 < len) {
    end = pos2 + chunkSize;
    yield chunk.slice(pos2, end);
    pos2 = end;
  }
}, "streamChunk");
const readBytes = /* @__PURE__ */ __name(async function* (iterable, chunkSize, encode2) {
  for await (const chunk of iterable) {
    yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : await encode2(String(chunk)), chunkSize);
  }
}, "readBytes");
const trackStream = /* @__PURE__ */ __name((stream, chunkSize, onProgress, onFinish, encode2) => {
  const iterator = readBytes(stream, chunkSize, encode2);
  let bytes = 0;
  let done;
  let _onFinish = /* @__PURE__ */ __name((e2) => {
    if (!done) {
      done = true;
      onFinish && onFinish(e2);
    }
  }, "_onFinish");
  return new ReadableStream({
    async pull(controller) {
      try {
        const { done: done2, value: value4 } = await iterator.next();
        if (done2) {
          _onFinish();
          controller.close();
          return;
        }
        let len = value4.byteLength;
        if (onProgress) {
          let loadedBytes = bytes += len;
          onProgress(loadedBytes);
        }
        controller.enqueue(new Uint8Array(value4));
      } catch (err) {
        _onFinish(err);
        throw err;
      }
    },
    cancel(reason) {
      _onFinish(reason);
      return iterator.return();
    }
  }, {
    highWaterMark: 2
  });
}, "trackStream");
const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
const test$1 = /* @__PURE__ */ __name((fn, ...args) => {
  try {
    return !!fn(...args);
  } catch (e2) {
    return false;
  }
}, "test$1");
const supportsRequestStream = isReadableStreamSupported && test$1(() => {
  let duplexAccessed = false;
  const hasContentType = new Request(platform.origin, {
    body: new ReadableStream(),
    method: "POST",
    get duplex() {
      duplexAccessed = true;
      return "half";
    }
  }).headers.has("Content-Type");
  return duplexAccessed && !hasContentType;
});
const DEFAULT_CHUNK_SIZE = 64 * 1024;
const supportsResponseStream = isReadableStreamSupported && test$1(() => utils$2.isReadableStream(new Response("").body));
const resolvers = {
  stream: supportsResponseStream && ((res) => res.body)
};
isFetchSupported && ((res) => {
  ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
    !resolvers[type] && (resolvers[type] = utils$2.isFunction(res[type]) ? (res2) => res2[type]() : (_2, config2) => {
      throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config2);
    });
  });
})(new Response());
const getBodyLength = /* @__PURE__ */ __name(async (body) => {
  if (body == null) {
    return 0;
  }
  if (utils$2.isBlob(body)) {
    return body.size;
  }
  if (utils$2.isSpecCompliantForm(body)) {
    return (await new Request(body).arrayBuffer()).byteLength;
  }
  if (utils$2.isArrayBufferView(body) || utils$2.isArrayBuffer(body)) {
    return body.byteLength;
  }
  if (utils$2.isURLSearchParams(body)) {
    body = body + "";
  }
  if (utils$2.isString(body)) {
    return (await encodeText(body)).byteLength;
  }
}, "getBodyLength");
const resolveBodyLength = /* @__PURE__ */ __name(async (headers, body) => {
  const length = utils$2.toFiniteNumber(headers.getContentLength());
  return length == null ? getBodyLength(body) : length;
}, "resolveBodyLength");
const fetchAdapter = isFetchSupported && (async (config2) => {
  let {
    url,
    method,
    data: data24,
    signal,
    cancelToken,
    timeout,
    onDownloadProgress,
    onUploadProgress,
    responseType,
    headers,
    withCredentials = "same-origin",
    fetchOptions
  } = resolveConfig(config2);
  responseType = responseType ? (responseType + "").toLowerCase() : "text";
  let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals([signal, cancelToken], timeout) : [];
  let finished, request;
  const onFinish = /* @__PURE__ */ __name(() => {
    !finished && setTimeout(() => {
      composedSignal && composedSignal.unsubscribe();
    });
    finished = true;
  }, "onFinish");
  let requestContentLength;
  try {
    if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data24)) !== 0) {
      let _request = new Request(url, {
        method: "POST",
        body: data24,
        duplex: "half"
      });
      let contentTypeHeader;
      if (utils$2.isFormData(data24) && (contentTypeHeader = _request.headers.get("content-type"))) {
        headers.setContentType(contentTypeHeader);
      }
      if (_request.body) {
        const [onProgress, flush] = progressEventDecorator(
          requestContentLength,
          progressEventReducer(asyncDecorator(onUploadProgress))
        );
        data24 = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
      }
    }
    if (!utils$2.isString(withCredentials)) {
      withCredentials = withCredentials ? "include" : "omit";
    }
    request = new Request(url, {
      ...fetchOptions,
      signal: composedSignal,
      method: method.toUpperCase(),
      headers: headers.normalize().toJSON(),
      body: data24,
      duplex: "half",
      credentials: withCredentials
    });
    let response = await fetch(request);
    const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
    if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
      const options4 = {};
      ["status", "statusText", "headers"].forEach((prop2) => {
        options4[prop2] = response[prop2];
      });
      const responseContentLength = utils$2.toFiniteNumber(response.headers.get("content-length"));
      const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
        responseContentLength,
        progressEventReducer(asyncDecorator(onDownloadProgress), true)
      ) || [];
      response = new Response(
        trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
          flush && flush();
          isStreamResponse && onFinish();
        }, encodeText),
        options4
      );
    }
    responseType = responseType || "text";
    let responseData = await resolvers[utils$2.findKey(resolvers, responseType) || "text"](response, config2);
    !isStreamResponse && onFinish();
    stopTimeout && stopTimeout();
    return await new Promise((resolve2, reject3) => {
      settle(resolve2, reject3, {
        data: responseData,
        headers: AxiosHeaders$1.from(response.headers),
        status: response.status,
        statusText: response.statusText,
        config: config2,
        request
      });
    });
  } catch (err) {
    onFinish();
    if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
      throw Object.assign(
        new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config2, request),
        {
          cause: err.cause || err
        }
      );
    }
    throw AxiosError$1.from(err, err && err.code, config2, request);
  }
});
const knownAdapters = {
  http: httpAdapter,
  xhr: xhrAdapter,
  fetch: fetchAdapter
};
utils$2.forEach(knownAdapters, (fn, value4) => {
  if (fn) {
    try {
      Object.defineProperty(fn, "name", { value: value4 });
    } catch (e2) {
    }
    Object.defineProperty(fn, "adapterName", { value: value4 });
  }
});
const renderReason = /* @__PURE__ */ __name((reason) => `- ${reason}`, "renderReason");
const isResolvedHandle = /* @__PURE__ */ __name((adapter2) => utils$2.isFunction(adapter2) || adapter2 === null || adapter2 === false, "isResolvedHandle");
const adapters = {
  getAdapter: /* @__PURE__ */ __name((adapters2) => {
    adapters2 = utils$2.isArray(adapters2) ? adapters2 : [adapters2];
    const { length } = adapters2;
    let nameOrAdapter;
    let adapter2;
    const rejectedReasons = {};
    for (let i2 = 0; i2 < length; i2++) {
      nameOrAdapter = adapters2[i2];
      let id3;
      adapter2 = nameOrAdapter;
      if (!isResolvedHandle(nameOrAdapter)) {
        adapter2 = knownAdapters[(id3 = String(nameOrAdapter)).toLowerCase()];
        if (adapter2 === void 0) {
          throw new AxiosError$1(`Unknown adapter '${id3}'`);
        }
      }
      if (adapter2) {
        break;
      }
      rejectedReasons[id3 || "#" + i2] = adapter2;
    }
    if (!adapter2) {
      const reasons = Object.entries(rejectedReasons).map(
        ([id3, state]) => `adapter ${id3} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
      );
      let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
      throw new AxiosError$1(
        `There is no suitable adapter to dispatch the request ` + s,
        "ERR_NOT_SUPPORT"
      );
    }
    return adapter2;
  }, "getAdapter"),
  adapters: knownAdapters
};
"use strict";
function throwIfCancellationRequested(config2) {
  if (config2.cancelToken) {
    config2.cancelToken.throwIfRequested();
  }
  if (config2.signal && config2.signal.aborted) {
    throw new CanceledError$1(null, config2);
  }
}
__name(throwIfCancellationRequested, "throwIfCancellationRequested");
function dispatchRequest(config2) {
  throwIfCancellationRequested(config2);
  config2.headers = AxiosHeaders$1.from(config2.headers);
  config2.data = transformData.call(
    config2,
    config2.transformRequest
  );
  if (["post", "put", "patch"].indexOf(config2.method) !== -1) {
    config2.headers.setContentType("application/x-www-form-urlencoded", false);
  }
  const adapter2 = adapters.getAdapter(config2.adapter || defaults$2.adapter);
  return adapter2(config2).then(/* @__PURE__ */ __name(function onAdapterResolution(response) {
    throwIfCancellationRequested(config2);
    response.data = transformData.call(
      config2,
      config2.transformResponse,
      response
    );
    response.headers = AxiosHeaders$1.from(response.headers);
    return response;
  }, "onAdapterResolution"), /* @__PURE__ */ __name(function onAdapterRejection(reason) {
    if (!isCancel$1(reason)) {
      throwIfCancellationRequested(config2);
      if (reason && reason.response) {
        reason.response.data = transformData.call(
          config2,
          config2.transformResponse,
          reason.response
        );
        reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
      }
    }
    return Promise.reject(reason);
  }, "onAdapterRejection"));
}
__name(dispatchRequest, "dispatchRequest");
const VERSION$3 = "1.7.4";
"use strict";
const validators$1 = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i2) => {
  validators$1[type] = /* @__PURE__ */ __name(function validator3(thing) {
    return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type;
  }, "validator");
});
const deprecatedWarnings = {};
validators$1.transitional = /* @__PURE__ */ __name(function transitional(validator3, version2, message3) {
  function formatMessage(opt, desc) {
    return "[Axios v" + VERSION$3 + "] Transitional option '" + opt + "'" + desc + (message3 ? ". " + message3 : "");
  }
  __name(formatMessage, "formatMessage");
  return (value4, opt, opts) => {
    if (validator3 === false) {
      throw new AxiosError$1(
        formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")),
        AxiosError$1.ERR_DEPRECATED
      );
    }
    if (version2 && !deprecatedWarnings[opt]) {
      deprecatedWarnings[opt] = true;
      console.warn(
        formatMessage(
          opt,
          " has been deprecated since v" + version2 + " and will be removed in the near future"
        )
      );
    }
    return validator3 ? validator3(value4, opt, opts) : true;
  };
}, "transitional");
function assertOptions(options4, schema2, allowUnknown) {
  if (typeof options4 !== "object") {
    throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
  }
  const keys2 = Object.keys(options4);
  let i2 = keys2.length;
  while (i2-- > 0) {
    const opt = keys2[i2];
    const validator3 = schema2[opt];
    if (validator3) {
      const value4 = options4[opt];
      const result = value4 === void 0 || validator3(value4, opt, options4);
      if (result !== true) {
        throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
      }
      continue;
    }
    if (allowUnknown !== true) {
      throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
    }
  }
}
__name(assertOptions, "assertOptions");
const validator = {
  assertOptions,
  validators: validators$1
};
"use strict";
const validators = validator.validators;
let Axios$1 = class Axios2 {
  static {
    __name(this, "Axios");
  }
  constructor(instanceConfig) {
    this.defaults = instanceConfig;
    this.interceptors = {
      request: new InterceptorManager(),
      response: new InterceptorManager()
    };
  }
  /**
   * Dispatch a request
   *
   * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
   * @param {?Object} config
   *
   * @returns {Promise} The Promise to be fulfilled
   */
  async request(configOrUrl, config2) {
    try {
      return await this._request(configOrUrl, config2);
    } catch (err) {
      if (err instanceof Error) {
        let dummy;
        Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
        const stack2 = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
        try {
          if (!err.stack) {
            err.stack = stack2;
          } else if (stack2 && !String(err.stack).endsWith(stack2.replace(/^.+\n.+\n/, ""))) {
            err.stack += "\n" + stack2;
          }
        } catch (e2) {
        }
      }
      throw err;
    }
  }
  _request(configOrUrl, config2) {
    if (typeof configOrUrl === "string") {
      config2 = config2 || {};
      config2.url = configOrUrl;
    } else {
      config2 = configOrUrl || {};
    }
    config2 = mergeConfig$1(this.defaults, config2);
    const { transitional: transitional2, paramsSerializer, headers } = config2;
    if (transitional2 !== void 0) {
      validator.assertOptions(transitional2, {
        silentJSONParsing: validators.transitional(validators.boolean),
        forcedJSONParsing: validators.transitional(validators.boolean),
        clarifyTimeoutError: validators.transitional(validators.boolean)
      }, false);
    }
    if (paramsSerializer != null) {
      if (utils$2.isFunction(paramsSerializer)) {
        config2.paramsSerializer = {
          serialize: paramsSerializer
        };
      } else {
        validator.assertOptions(paramsSerializer, {
          encode: validators.function,
          serialize: validators.function
        }, true);
      }
    }
    config2.method = (config2.method || this.defaults.method || "get").toLowerCase();
    let contextHeaders = headers && utils$2.merge(
      headers.common,
      headers[config2.method]
    );
    headers && utils$2.forEach(
      ["delete", "get", "head", "post", "put", "patch", "common"],
      (method) => {
        delete headers[method];
      }
    );
    config2.headers = AxiosHeaders$1.concat(contextHeaders, headers);
    const requestInterceptorChain = [];
    let synchronousRequestInterceptors = true;
    this.interceptors.request.forEach(/* @__PURE__ */ __name(function unshiftRequestInterceptors(interceptor) {
      if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) {
        return;
      }
      synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
      requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
    }, "unshiftRequestInterceptors"));
    const responseInterceptorChain = [];
    this.interceptors.response.forEach(/* @__PURE__ */ __name(function pushResponseInterceptors(interceptor) {
      responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
    }, "pushResponseInterceptors"));
    let promise;
    let i2 = 0;
    let len;
    if (!synchronousRequestInterceptors) {
      const chain = [dispatchRequest.bind(this), void 0];
      chain.unshift.apply(chain, requestInterceptorChain);
      chain.push.apply(chain, responseInterceptorChain);
      len = chain.length;
      promise = Promise.resolve(config2);
      while (i2 < len) {
        promise = promise.then(chain[i2++], chain[i2++]);
      }
      return promise;
    }
    len = requestInterceptorChain.length;
    let newConfig = config2;
    i2 = 0;
    while (i2 < len) {
      const onFulfilled = requestInterceptorChain[i2++];
      const onRejected = requestInterceptorChain[i2++];
      try {
        newConfig = onFulfilled(newConfig);
      } catch (error2) {
        onRejected.call(this, error2);
        break;
      }
    }
    try {
      promise = dispatchRequest.call(this, newConfig);
    } catch (error2) {
      return Promise.reject(error2);
    }
    i2 = 0;
    len = responseInterceptorChain.length;
    while (i2 < len) {
      promise = promise.then(responseInterceptorChain[i2++], responseInterceptorChain[i2++]);
    }
    return promise;
  }
  getUri(config2) {
    config2 = mergeConfig$1(this.defaults, config2);
    const fullPath = buildFullPath(config2.baseURL, config2.url);
    return buildURL(fullPath, config2.params, config2.paramsSerializer);
  }
};
utils$2.forEach(["delete", "get", "head", "options"], /* @__PURE__ */ __name(function forEachMethodNoData(method) {
  Axios$1.prototype[method] = function(url, config2) {
    return this.request(mergeConfig$1(config2 || {}, {
      method,
      url,
      data: (config2 || {}).data
    }));
  };
}, "forEachMethodNoData"));
utils$2.forEach(["post", "put", "patch"], /* @__PURE__ */ __name(function forEachMethodWithData(method) {
  function generateHTTPMethod(isForm) {
    return /* @__PURE__ */ __name(function httpMethod(url, data24, config2) {
      return this.request(mergeConfig$1(config2 || {}, {
        method,
        headers: isForm ? {
          "Content-Type": "multipart/form-data"
        } : {},
        url,
        data: data24
      }));
    }, "httpMethod");
  }
  __name(generateHTTPMethod, "generateHTTPMethod");
  Axios$1.prototype[method] = generateHTTPMethod();
  Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
}, "forEachMethodWithData"));
"use strict";
let CancelToken$1 = class CancelToken2 {
  static {
    __name(this, "CancelToken");
  }
  constructor(executor) {
    if (typeof executor !== "function") {
      throw new TypeError("executor must be a function.");
    }
    let resolvePromise;
    this.promise = new Promise(/* @__PURE__ */ __name(function promiseExecutor(resolve2) {
      resolvePromise = resolve2;
    }, "promiseExecutor"));
    const token = this;
    this.promise.then((cancel) => {
      if (!token._listeners) return;
      let i2 = token._listeners.length;
      while (i2-- > 0) {
        token._listeners[i2](cancel);
      }
      token._listeners = null;
    });
    this.promise.then = (onfulfilled) => {
      let _resolve;
      const promise = new Promise((resolve2) => {
        token.subscribe(resolve2);
        _resolve = resolve2;
      }).then(onfulfilled);
      promise.cancel = /* @__PURE__ */ __name(function reject3() {
        token.unsubscribe(_resolve);
      }, "reject");
      return promise;
    };
    executor(/* @__PURE__ */ __name(function cancel(message3, config2, request) {
      if (token.reason) {
        return;
      }
      token.reason = new CanceledError$1(message3, config2, request);
      resolvePromise(token.reason);
    }, "cancel"));
  }
  /**
   * Throws a `CanceledError` if cancellation has been requested.
   */
  throwIfRequested() {
    if (this.reason) {
      throw this.reason;
    }
  }
  /**
   * Subscribe to the cancel signal
   */
  subscribe(listener) {
    if (this.reason) {
      listener(this.reason);
      return;
    }
    if (this._listeners) {
      this._listeners.push(listener);
    } else {
      this._listeners = [listener];
    }
  }
  /**
   * Unsubscribe from the cancel signal
   */
  unsubscribe(listener) {
    if (!this._listeners) {
      return;
    }
    const index2 = this._listeners.indexOf(listener);
    if (index2 !== -1) {
      this._listeners.splice(index2, 1);
    }
  }
  /**
   * Returns an object that contains a new `CancelToken` and a function that, when called,
   * cancels the `CancelToken`.
   */
  static source() {
    let cancel;
    const token = new CancelToken2(/* @__PURE__ */ __name(function executor(c) {
      cancel = c;
    }, "executor"));
    return {
      token,
      cancel
    };
  }
};
"use strict";
function spread$1(callback) {
  return /* @__PURE__ */ __name(function wrap2(arr) {
    return callback.apply(null, arr);
  }, "wrap");
}
__name(spread$1, "spread$1");
"use strict";
function isAxiosError$1(payload) {
  return utils$2.isObject(payload) && payload.isAxiosError === true;
}
__name(isAxiosError$1, "isAxiosError$1");
const HttpStatusCode$1 = {
  Continue: 100,
  SwitchingProtocols: 101,
  Processing: 102,
  EarlyHints: 103,
  Ok: 200,
  Created: 201,
  Accepted: 202,
  NonAuthoritativeInformation: 203,
  NoContent: 204,
  ResetContent: 205,
  PartialContent: 206,
  MultiStatus: 207,
  AlreadyReported: 208,
  ImUsed: 226,
  MultipleChoices: 300,
  MovedPermanently: 301,
  Found: 302,
  SeeOther: 303,
  NotModified: 304,
  UseProxy: 305,
  Unused: 306,
  TemporaryRedirect: 307,
  PermanentRedirect: 308,
  BadRequest: 400,
  Unauthorized: 401,
  PaymentRequired: 402,
  Forbidden: 403,
  NotFound: 404,
  MethodNotAllowed: 405,
  NotAcceptable: 406,
  ProxyAuthenticationRequired: 407,
  RequestTimeout: 408,
  Conflict: 409,
  Gone: 410,
  LengthRequired: 411,
  PreconditionFailed: 412,
  PayloadTooLarge: 413,
  UriTooLong: 414,
  UnsupportedMediaType: 415,
  RangeNotSatisfiable: 416,
  ExpectationFailed: 417,
  ImATeapot: 418,
  MisdirectedRequest: 421,
  UnprocessableEntity: 422,
  Locked: 423,
  FailedDependency: 424,
  TooEarly: 425,
  UpgradeRequired: 426,
  PreconditionRequired: 428,
  TooManyRequests: 429,
  RequestHeaderFieldsTooLarge: 431,
  UnavailableForLegalReasons: 451,
  InternalServerError: 500,
  NotImplemented: 501,
  BadGateway: 502,
  ServiceUnavailable: 503,
  GatewayTimeout: 504,
  HttpVersionNotSupported: 505,
  VariantAlsoNegotiates: 506,
  InsufficientStorage: 507,
  LoopDetected: 508,
  NotExtended: 510,
  NetworkAuthenticationRequired: 511
};
Object.entries(HttpStatusCode$1).forEach(([key, value4]) => {
  HttpStatusCode$1[value4] = key;
});
"use strict";
function createInstance(defaultConfig) {
  const context = new Axios$1(defaultConfig);
  const instance = bind$3(Axios$1.prototype.request, context);
  utils$2.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
  utils$2.extend(instance, context, null, { allOwnKeys: true });
  instance.create = /* @__PURE__ */ __name(function create3(instanceConfig) {
    return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
  }, "create");
  return instance;
}
__name(createInstance, "createInstance");
const axios = createInstance(defaults$2);
axios.Axios = Axios$1;
axios.CanceledError = CanceledError$1;
axios.CancelToken = CancelToken$1;
axios.isCancel = isCancel$1;
axios.VERSION = VERSION$3;
axios.toFormData = toFormData$1;
axios.AxiosError = AxiosError$1;
axios.Cancel = axios.CanceledError;
axios.all = /* @__PURE__ */ __name(function all2(promises) {
  return Promise.all(promises);
}, "all");
axios.spread = spread$1;
axios.isAxiosError = isAxiosError$1;
axios.mergeConfig = mergeConfig$1;
axios.AxiosHeaders = AxiosHeaders$1;
axios.formToJSON = (thing) => formDataToJSON(utils$2.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.getAdapter = adapters.getAdapter;
axios.HttpStatusCode = HttpStatusCode$1;
axios.default = axios;
const {
  Axios,
  AxiosError,
  CanceledError,
  isCancel,
  CancelToken,
  VERSION: VERSION$2,
  all,
  Cancel,
  isAxiosError,
  spread,
  toFormData,
  AxiosHeaders,
  HttpStatusCode,
  formToJSON,
  getAdapter,
  mergeConfig
} = axios;
var util;
(function(util2) {
  util2.assertEqual = (val) => val;
  function assertIs(_arg) {
  }
  __name(assertIs, "assertIs");
  util2.assertIs = assertIs;
  function assertNever(_x) {
    throw new Error();
  }
  __name(assertNever, "assertNever");
  util2.assertNever = assertNever;
  util2.arrayToEnum = (items2) => {
    const obj = {};
    for (const item3 of items2) {
      obj[item3] = item3;
    }
    return obj;
  };
  util2.getValidEnumValues = (obj) => {
    const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
    const filtered = {};
    for (const k of validKeys) {
      filtered[k] = obj[k];
    }
    return util2.objectValues(filtered);
  };
  util2.objectValues = (obj) => {
    return util2.objectKeys(obj).map(function(e2) {
      return obj[e2];
    });
  };
  util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
    const keys2 = [];
    for (const key in object) {
      if (Object.prototype.hasOwnProperty.call(object, key)) {
        keys2.push(key);
      }
    }
    return keys2;
  };
  util2.find = (arr, checker) => {
    for (const item3 of arr) {
      if (checker(item3))
        return item3;
    }
    return void 0;
  };
  util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
  function joinValues(array, separator = " | ") {
    return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
  }
  __name(joinValues, "joinValues");
  util2.joinValues = joinValues;
  util2.jsonStringifyReplacer = (_2, value4) => {
    if (typeof value4 === "bigint") {
      return value4.toString();
    }
    return value4;
  };
})(util || (util = {}));
var objectUtil;
(function(objectUtil2) {
  objectUtil2.mergeShapes = (first2, second) => {
    return {
      ...first2,
      ...second
      // second overwrites first
    };
  };
})(objectUtil || (objectUtil = {}));
const ZodParsedType = util.arrayToEnum([
  "string",
  "nan",
  "number",
  "integer",
  "float",
  "boolean",
  "date",
  "bigint",
  "symbol",
  "function",
  "undefined",
  "null",
  "array",
  "object",
  "unknown",
  "promise",
  "void",
  "never",
  "map",
  "set"
]);
const getParsedType = /* @__PURE__ */ __name((data24) => {
  const t2 = typeof data24;
  switch (t2) {
    case "undefined":
      return ZodParsedType.undefined;
    case "string":
      return ZodParsedType.string;
    case "number":
      return isNaN(data24) ? ZodParsedType.nan : ZodParsedType.number;
    case "boolean":
      return ZodParsedType.boolean;
    case "function":
      return ZodParsedType.function;
    case "bigint":
      return ZodParsedType.bigint;
    case "symbol":
      return ZodParsedType.symbol;
    case "object":
      if (Array.isArray(data24)) {
        return ZodParsedType.array;
      }
      if (data24 === null) {
        return ZodParsedType.null;
      }
      if (data24.then && typeof data24.then === "function" && data24.catch && typeof data24.catch === "function") {
        return ZodParsedType.promise;
      }
      if (typeof Map !== "undefined" && data24 instanceof Map) {
        return ZodParsedType.map;
      }
      if (typeof Set !== "undefined" && data24 instanceof Set) {
        return ZodParsedType.set;
      }
      if (typeof Date !== "undefined" && data24 instanceof Date) {
        return ZodParsedType.date;
      }
      return ZodParsedType.object;
    default:
      return ZodParsedType.unknown;
  }
}, "getParsedType");
const ZodIssueCode = util.arrayToEnum([
  "invalid_type",
  "invalid_literal",
  "custom",
  "invalid_union",
  "invalid_union_discriminator",
  "invalid_enum_value",
  "unrecognized_keys",
  "invalid_arguments",
  "invalid_return_type",
  "invalid_date",
  "invalid_string",
  "too_small",
  "too_big",
  "invalid_intersection_types",
  "not_multiple_of",
  "not_finite"
]);
const quotelessJson = /* @__PURE__ */ __name((obj) => {
  const json = JSON.stringify(obj, null, 2);
  return json.replace(/"([^"]+)":/g, "$1:");
}, "quotelessJson");
class ZodError extends Error {
  static {
    __name(this, "ZodError");
  }
  constructor(issues) {
    super();
    this.issues = [];
    this.addIssue = (sub) => {
      this.issues = [...this.issues, sub];
    };
    this.addIssues = (subs = []) => {
      this.issues = [...this.issues, ...subs];
    };
    const actualProto = new.target.prototype;
    if (Object.setPrototypeOf) {
      Object.setPrototypeOf(this, actualProto);
    } else {
      this.__proto__ = actualProto;
    }
    this.name = "ZodError";
    this.issues = issues;
  }
  get errors() {
    return this.issues;
  }
  format(_mapper) {
    const mapper = _mapper || function(issue) {
      return issue.message;
    };
    const fieldErrors = { _errors: [] };
    const processError = /* @__PURE__ */ __name((error2) => {
      for (const issue of error2.issues) {
        if (issue.code === "invalid_union") {
          issue.unionErrors.map(processError);
        } else if (issue.code === "invalid_return_type") {
          processError(issue.returnTypeError);
        } else if (issue.code === "invalid_arguments") {
          processError(issue.argumentsError);
        } else if (issue.path.length === 0) {
          fieldErrors._errors.push(mapper(issue));
        } else {
          let curr = fieldErrors;
          let i2 = 0;
          while (i2 < issue.path.length) {
            const el = issue.path[i2];
            const terminal = i2 === issue.path.length - 1;
            if (!terminal) {
              curr[el] = curr[el] || { _errors: [] };
            } else {
              curr[el] = curr[el] || { _errors: [] };
              curr[el]._errors.push(mapper(issue));
            }
            curr = curr[el];
            i2++;
          }
        }
      }
    }, "processError");
    processError(this);
    return fieldErrors;
  }
  static assert(value4) {
    if (!(value4 instanceof ZodError)) {
      throw new Error(`Not a ZodError: ${value4}`);
    }
  }
  toString() {
    return this.message;
  }
  get message() {
    return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
  }
  get isEmpty() {
    return this.issues.length === 0;
  }
  flatten(mapper = (issue) => issue.message) {
    const fieldErrors = {};
    const formErrors = [];
    for (const sub of this.issues) {
      if (sub.path.length > 0) {
        fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
        fieldErrors[sub.path[0]].push(mapper(sub));
      } else {
        formErrors.push(mapper(sub));
      }
    }
    return { formErrors, fieldErrors };
  }
  get formErrors() {
    return this.flatten();
  }
}
ZodError.create = (issues) => {
  const error2 = new ZodError(issues);
  return error2;
};
const errorMap$1 = /* @__PURE__ */ __name((issue, _ctx) => {
  let message3;
  switch (issue.code) {
    case ZodIssueCode.invalid_type:
      if (issue.received === ZodParsedType.undefined) {
        message3 = "Required";
      } else {
        message3 = `Expected ${issue.expected}, received ${issue.received}`;
      }
      break;
    case ZodIssueCode.invalid_literal:
      message3 = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
      break;
    case ZodIssueCode.unrecognized_keys:
      message3 = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
      break;
    case ZodIssueCode.invalid_union:
      message3 = `Invalid input`;
      break;
    case ZodIssueCode.invalid_union_discriminator:
      message3 = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
      break;
    case ZodIssueCode.invalid_enum_value:
      message3 = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
      break;
    case ZodIssueCode.invalid_arguments:
      message3 = `Invalid function arguments`;
      break;
    case ZodIssueCode.invalid_return_type:
      message3 = `Invalid function return type`;
      break;
    case ZodIssueCode.invalid_date:
      message3 = `Invalid date`;
      break;
    case ZodIssueCode.invalid_string:
      if (typeof issue.validation === "object") {
        if ("includes" in issue.validation) {
          message3 = `Invalid input: must include "${issue.validation.includes}"`;
          if (typeof issue.validation.position === "number") {
            message3 = `${message3} at one or more positions greater than or equal to ${issue.validation.position}`;
          }
        } else if ("startsWith" in issue.validation) {
          message3 = `Invalid input: must start with "${issue.validation.startsWith}"`;
        } else if ("endsWith" in issue.validation) {
          message3 = `Invalid input: must end with "${issue.validation.endsWith}"`;
        } else {
          util.assertNever(issue.validation);
        }
      } else if (issue.validation !== "regex") {
        message3 = `Invalid ${issue.validation}`;
      } else {
        message3 = "Invalid";
      }
      break;
    case ZodIssueCode.too_small:
      if (issue.type === "array")
        message3 = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
      else if (issue.type === "string")
        message3 = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
      else if (issue.type === "number")
        message3 = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
      else if (issue.type === "date")
        message3 = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
      else
        message3 = "Invalid input";
      break;
    case ZodIssueCode.too_big:
      if (issue.type === "array")
        message3 = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
      else if (issue.type === "string")
        message3 = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
      else if (issue.type === "number")
        message3 = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
      else if (issue.type === "bigint")
        message3 = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
      else if (issue.type === "date")
        message3 = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
      else
        message3 = "Invalid input";
      break;
    case ZodIssueCode.custom:
      message3 = `Invalid input`;
      break;
    case ZodIssueCode.invalid_intersection_types:
      message3 = `Intersection results could not be merged`;
      break;
    case ZodIssueCode.not_multiple_of:
      message3 = `Number must be a multiple of ${issue.multipleOf}`;
      break;
    case ZodIssueCode.not_finite:
      message3 = "Number must be finite";
      break;
    default:
      message3 = _ctx.defaultError;
      util.assertNever(issue);
  }
  return { message: message3 };
}, "errorMap$1");
let overrideErrorMap = errorMap$1;
function setErrorMap(map3) {
  overrideErrorMap = map3;
}
__name(setErrorMap, "setErrorMap");
function getErrorMap() {
  return overrideErrorMap;
}
__name(getErrorMap, "getErrorMap");
const makeIssue = /* @__PURE__ */ __name((params) => {
  const { data: data24, path, errorMaps, issueData } = params;
  const fullPath = [...path, ...issueData.path || []];
  const fullIssue = {
    ...issueData,
    path: fullPath
  };
  if (issueData.message !== void 0) {
    return {
      ...issueData,
      path: fullPath,
      message: issueData.message
    };
  }
  let errorMessage = "";
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
  for (const map3 of maps) {
    errorMessage = map3(fullIssue, { data: data24, defaultError: errorMessage }).message;
  }
  return {
    ...issueData,
    path: fullPath,
    message: errorMessage
  };
}, "makeIssue");
const EMPTY_PATH = [];
function addIssueToContext(ctx, issueData) {
  const overrideMap = getErrorMap();
  const issue = makeIssue({
    issueData,
    data: ctx.data,
    path: ctx.path,
    errorMaps: [
      ctx.common.contextualErrorMap,
      ctx.schemaErrorMap,
      overrideMap,
      overrideMap === errorMap$1 ? void 0 : errorMap$1
      // then global default map
    ].filter((x2) => !!x2)
  });
  ctx.common.issues.push(issue);
}
__name(addIssueToContext, "addIssueToContext");
class ParseStatus {
  static {
    __name(this, "ParseStatus");
  }
  constructor() {
    this.value = "valid";
  }
  dirty() {
    if (this.value === "valid")
      this.value = "dirty";
  }
  abort() {
    if (this.value !== "aborted")
      this.value = "aborted";
  }
  static mergeArray(status, results) {
    const arrayValue = [];
    for (const s of results) {
      if (s.status === "aborted")
        return INVALID;
      if (s.status === "dirty")
        status.dirty();
      arrayValue.push(s.value);
    }
    return { status: status.value, value: arrayValue };
  }
  static async mergeObjectAsync(status, pairs) {
    const syncPairs = [];
    for (const pair of pairs) {
      const key = await pair.key;
      const value4 = await pair.value;
      syncPairs.push({
        key,
        value: value4
      });
    }
    return ParseStatus.mergeObjectSync(status, syncPairs);
  }
  static mergeObjectSync(status, pairs) {
    const finalObject = {};
    for (const pair of pairs) {
      const { key, value: value4 } = pair;
      if (key.status === "aborted")
        return INVALID;
      if (value4.status === "aborted")
        return INVALID;
      if (key.status === "dirty")
        status.dirty();
      if (value4.status === "dirty")
        status.dirty();
      if (key.value !== "__proto__" && (typeof value4.value !== "undefined" || pair.alwaysSet)) {
        finalObject[key.value] = value4.value;
      }
    }
    return { status: status.value, value: finalObject };
  }
}
const INVALID = Object.freeze({
  status: "aborted"
});
const DIRTY = /* @__PURE__ */ __name((value4) => ({ status: "dirty", value: value4 }), "DIRTY");
const OK = /* @__PURE__ */ __name((value4) => ({ status: "valid", value: value4 }), "OK");
const isAborted = /* @__PURE__ */ __name((x2) => x2.status === "aborted", "isAborted");
const isDirty = /* @__PURE__ */ __name((x2) => x2.status === "dirty", "isDirty");
const isValid = /* @__PURE__ */ __name((x2) => x2.status === "valid", "isValid");
const isAsync = /* @__PURE__ */ __name((x2) => typeof Promise !== "undefined" && x2 instanceof Promise, "isAsync");
function __classPrivateFieldGet(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
__name(__classPrivateFieldGet, "__classPrivateFieldGet");
function __classPrivateFieldSet(receiver, state, value4, kind, f) {
  if (kind === "m") throw new TypeError("Private method is not writable");
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return kind === "a" ? f.call(receiver, value4) : f ? f.value = value4 : state.set(receiver, value4), value4;
}
__name(__classPrivateFieldSet, "__classPrivateFieldSet");
typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message3) {
  var e2 = new Error(message3);
  return e2.name = "SuppressedError", e2.error = error2, e2.suppressed = suppressed, e2;
};
var errorUtil;
(function(errorUtil2) {
  errorUtil2.errToObj = (message3) => typeof message3 === "string" ? { message: message3 } : message3 || {};
  errorUtil2.toString = (message3) => typeof message3 === "string" ? message3 : message3 === null || message3 === void 0 ? void 0 : message3.message;
})(errorUtil || (errorUtil = {}));
var _ZodEnum_cache, _ZodNativeEnum_cache;
class ParseInputLazyPath {
  static {
    __name(this, "ParseInputLazyPath");
  }
  constructor(parent, value4, path, key) {
    this._cachedPath = [];
    this.parent = parent;
    this.data = value4;
    this._path = path;
    this._key = key;
  }
  get path() {
    if (!this._cachedPath.length) {
      if (this._key instanceof Array) {
        this._cachedPath.push(...this._path, ...this._key);
      } else {
        this._cachedPath.push(...this._path, this._key);
      }
    }
    return this._cachedPath;
  }
}
const handleResult = /* @__PURE__ */ __name((ctx, result) => {
  if (isValid(result)) {
    return { success: true, data: result.value };
  } else {
    if (!ctx.common.issues.length) {
      throw new Error("Validation failed but no issues detected.");
    }
    return {
      success: false,
      get error() {
        if (this._error)
          return this._error;
        const error2 = new ZodError(ctx.common.issues);
        this._error = error2;
        return this._error;
      }
    };
  }
}, "handleResult");
function processCreateParams(params) {
  if (!params)
    return {};
  const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
  if (errorMap2 && (invalid_type_error || required_error)) {
    throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
  }
  if (errorMap2)
    return { errorMap: errorMap2, description };
  const customMap = /* @__PURE__ */ __name((iss, ctx) => {
    var _a2, _b;
    const { message: message3 } = params;
    if (iss.code === "invalid_enum_value") {
      return { message: message3 !== null && message3 !== void 0 ? message3 : ctx.defaultError };
    }
    if (typeof ctx.data === "undefined") {
      return { message: (_a2 = message3 !== null && message3 !== void 0 ? message3 : required_error) !== null && _a2 !== void 0 ? _a2 : ctx.defaultError };
    }
    if (iss.code !== "invalid_type")
      return { message: ctx.defaultError };
    return { message: (_b = message3 !== null && message3 !== void 0 ? message3 : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
  }, "customMap");
  return { errorMap: customMap, description };
}
__name(processCreateParams, "processCreateParams");
class ZodType {
  static {
    __name(this, "ZodType");
  }
  constructor(def2) {
    this.spa = this.safeParseAsync;
    this._def = def2;
    this.parse = this.parse.bind(this);
    this.safeParse = this.safeParse.bind(this);
    this.parseAsync = this.parseAsync.bind(this);
    this.safeParseAsync = this.safeParseAsync.bind(this);
    this.spa = this.spa.bind(this);
    this.refine = this.refine.bind(this);
    this.refinement = this.refinement.bind(this);
    this.superRefine = this.superRefine.bind(this);
    this.optional = this.optional.bind(this);
    this.nullable = this.nullable.bind(this);
    this.nullish = this.nullish.bind(this);
    this.array = this.array.bind(this);
    this.promise = this.promise.bind(this);
    this.or = this.or.bind(this);
    this.and = this.and.bind(this);
    this.transform = this.transform.bind(this);
    this.brand = this.brand.bind(this);
    this.default = this.default.bind(this);
    this.catch = this.catch.bind(this);
    this.describe = this.describe.bind(this);
    this.pipe = this.pipe.bind(this);
    this.readonly = this.readonly.bind(this);
    this.isNullable = this.isNullable.bind(this);
    this.isOptional = this.isOptional.bind(this);
  }
  get description() {
    return this._def.description;
  }
  _getType(input) {
    return getParsedType(input.data);
  }
  _getOrReturnCtx(input, ctx) {
    return ctx || {
      common: input.parent.common,
      data: input.data,
      parsedType: getParsedType(input.data),
      schemaErrorMap: this._def.errorMap,
      path: input.path,
      parent: input.parent
    };
  }
  _processInputParams(input) {
    return {
      status: new ParseStatus(),
      ctx: {
        common: input.parent.common,
        data: input.data,
        parsedType: getParsedType(input.data),
        schemaErrorMap: this._def.errorMap,
        path: input.path,
        parent: input.parent
      }
    };
  }
  _parseSync(input) {
    const result = this._parse(input);
    if (isAsync(result)) {
      throw new Error("Synchronous parse encountered promise.");
    }
    return result;
  }
  _parseAsync(input) {
    const result = this._parse(input);
    return Promise.resolve(result);
  }
  parse(data24, params) {
    const result = this.safeParse(data24, params);
    if (result.success)
      return result.data;
    throw result.error;
  }
  safeParse(data24, params) {
    var _a2;
    const ctx = {
      common: {
        issues: [],
        async: (_a2 = params === null || params === void 0 ? void 0 : params.async) !== null && _a2 !== void 0 ? _a2 : false,
        contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
      },
      path: (params === null || params === void 0 ? void 0 : params.path) || [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: data24,
      parsedType: getParsedType(data24)
    };
    const result = this._parseSync({ data: data24, path: ctx.path, parent: ctx });
    return handleResult(ctx, result);
  }
  async parseAsync(data24, params) {
    const result = await this.safeParseAsync(data24, params);
    if (result.success)
      return result.data;
    throw result.error;
  }
  async safeParseAsync(data24, params) {
    const ctx = {
      common: {
        issues: [],
        contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
        async: true
      },
      path: (params === null || params === void 0 ? void 0 : params.path) || [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: data24,
      parsedType: getParsedType(data24)
    };
    const maybeAsyncResult = this._parse({ data: data24, path: ctx.path, parent: ctx });
    const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
    return handleResult(ctx, result);
  }
  refine(check, message3) {
    const getIssueProperties = /* @__PURE__ */ __name((val) => {
      if (typeof message3 === "string" || typeof message3 === "undefined") {
        return { message: message3 };
      } else if (typeof message3 === "function") {
        return message3(val);
      } else {
        return message3;
      }
    }, "getIssueProperties");
    return this._refinement((val, ctx) => {
      const result = check(val);
      const setError = /* @__PURE__ */ __name(() => ctx.addIssue({
        code: ZodIssueCode.custom,
        ...getIssueProperties(val)
      }), "setError");
      if (typeof Promise !== "undefined" && result instanceof Promise) {
        return result.then((data24) => {
          if (!data24) {
            setError();
            return false;
          } else {
            return true;
          }
        });
      }
      if (!result) {
        setError();
        return false;
      } else {
        return true;
      }
    });
  }
  refinement(check, refinementData) {
    return this._refinement((val, ctx) => {
      if (!check(val)) {
        ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
        return false;
      } else {
        return true;
      }
    });
  }
  _refinement(refinement) {
    return new ZodEffects({
      schema: this,
      typeName: ZodFirstPartyTypeKind.ZodEffects,
      effect: { type: "refinement", refinement }
    });
  }
  superRefine(refinement) {
    return this._refinement(refinement);
  }
  optional() {
    return ZodOptional.create(this, this._def);
  }
  nullable() {
    return ZodNullable.create(this, this._def);
  }
  nullish() {
    return this.nullable().optional();
  }
  array() {
    return ZodArray.create(this, this._def);
  }
  promise() {
    return ZodPromise.create(this, this._def);
  }
  or(option3) {
    return ZodUnion.create([this, option3], this._def);
  }
  and(incoming) {
    return ZodIntersection.create(this, incoming, this._def);
  }
  transform(transform2) {
    return new ZodEffects({
      ...processCreateParams(this._def),
      schema: this,
      typeName: ZodFirstPartyTypeKind.ZodEffects,
      effect: { type: "transform", transform: transform2 }
    });
  }
  default(def2) {
    const defaultValueFunc = typeof def2 === "function" ? def2 : () => def2;
    return new ZodDefault({
      ...processCreateParams(this._def),
      innerType: this,
      defaultValue: defaultValueFunc,
      typeName: ZodFirstPartyTypeKind.ZodDefault
    });
  }
  brand() {
    return new ZodBranded({
      typeName: ZodFirstPartyTypeKind.ZodBranded,
      type: this,
      ...processCreateParams(this._def)
    });
  }
  catch(def2) {
    const catchValueFunc = typeof def2 === "function" ? def2 : () => def2;
    return new ZodCatch({
      ...processCreateParams(this._def),
      innerType: this,
      catchValue: catchValueFunc,
      typeName: ZodFirstPartyTypeKind.ZodCatch
    });
  }
  describe(description) {
    const This = this.constructor;
    return new This({
      ...this._def,
      description
    });
  }
  pipe(target) {
    return ZodPipeline.create(this, target);
  }
  readonly() {
    return ZodReadonly.create(this);
  }
  isOptional() {
    return this.safeParse(void 0).success;
  }
  isNullable() {
    return this.safeParse(null).success;
  }
}
const cuidRegex = /^c[^\s-]{8,}$/i;
const cuid2Regex = /^[0-9a-z]+$/;
const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
const nanoidRegex = /^[a-z0-9_-]{21}$/i;
const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
let emojiRegex;
const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
const dateRegex = new RegExp(`^${dateRegexSource}$`);
function timeRegexSource(args) {
  let regex2 = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
  if (args.precision) {
    regex2 = `${regex2}\\.\\d{${args.precision}}`;
  } else if (args.precision == null) {
    regex2 = `${regex2}(\\.\\d+)?`;
  }
  return regex2;
}
__name(timeRegexSource, "timeRegexSource");
function timeRegex(args) {
  return new RegExp(`^${timeRegexSource(args)}$`);
}
__name(timeRegex, "timeRegex");
function datetimeRegex(args) {
  let regex2 = `${dateRegexSource}T${timeRegexSource(args)}`;
  const opts = [];
  opts.push(args.local ? `Z?` : `Z`);
  if (args.offset)
    opts.push(`([+-]\\d{2}:?\\d{2})`);
  regex2 = `${regex2}(${opts.join("|")})`;
  return new RegExp(`^${regex2}$`);
}
__name(datetimeRegex, "datetimeRegex");
function isValidIP(ip, version2) {
  if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
    return true;
  }
  if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
    return true;
  }
  return false;
}
__name(isValidIP, "isValidIP");
class ZodString extends ZodType {
  static {
    __name(this, "ZodString");
  }
  _parse(input) {
    if (this._def.coerce) {
      input.data = String(input.data);
    }
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.string) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.string,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    const status = new ParseStatus();
    let ctx = void 0;
    for (const check of this._def.checks) {
      if (check.kind === "min") {
        if (input.data.length < check.value) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_small,
            minimum: check.value,
            type: "string",
            inclusive: true,
            exact: false,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "max") {
        if (input.data.length > check.value) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_big,
            maximum: check.value,
            type: "string",
            inclusive: true,
            exact: false,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "length") {
        const tooBig = input.data.length > check.value;
        const tooSmall = input.data.length < check.value;
        if (tooBig || tooSmall) {
          ctx = this._getOrReturnCtx(input, ctx);
          if (tooBig) {
            addIssueToContext(ctx, {
              code: ZodIssueCode.too_big,
              maximum: check.value,
              type: "string",
              inclusive: true,
              exact: true,
              message: check.message
            });
          } else if (tooSmall) {
            addIssueToContext(ctx, {
              code: ZodIssueCode.too_small,
              minimum: check.value,
              type: "string",
              inclusive: true,
              exact: true,
              message: check.message
            });
          }
          status.dirty();
        }
      } else if (check.kind === "email") {
        if (!emailRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "email",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "emoji") {
        if (!emojiRegex) {
          emojiRegex = new RegExp(_emojiRegex, "u");
        }
        if (!emojiRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "emoji",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "uuid") {
        if (!uuidRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "uuid",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "nanoid") {
        if (!nanoidRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "nanoid",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "cuid") {
        if (!cuidRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "cuid",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "cuid2") {
        if (!cuid2Regex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "cuid2",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "ulid") {
        if (!ulidRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "ulid",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "url") {
        try {
          new URL(input.data);
        } catch (_a2) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "url",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "regex") {
        check.regex.lastIndex = 0;
        const testResult = check.regex.test(input.data);
        if (!testResult) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "regex",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "trim") {
        input.data = input.data.trim();
      } else if (check.kind === "includes") {
        if (!input.data.includes(check.value, check.position)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_string,
            validation: { includes: check.value, position: check.position },
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "toLowerCase") {
        input.data = input.data.toLowerCase();
      } else if (check.kind === "toUpperCase") {
        input.data = input.data.toUpperCase();
      } else if (check.kind === "startsWith") {
        if (!input.data.startsWith(check.value)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_string,
            validation: { startsWith: check.value },
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "endsWith") {
        if (!input.data.endsWith(check.value)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_string,
            validation: { endsWith: check.value },
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "datetime") {
        const regex2 = datetimeRegex(check);
        if (!regex2.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_string,
            validation: "datetime",
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "date") {
        const regex2 = dateRegex;
        if (!regex2.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_string,
            validation: "date",
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "time") {
        const regex2 = timeRegex(check);
        if (!regex2.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_string,
            validation: "time",
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "duration") {
        if (!durationRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "duration",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "ip") {
        if (!isValidIP(input.data, check.version)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "ip",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "base64") {
        if (!base64Regex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "base64",
            code: ZodIssueCode.invalid_string,
            message: check.message
          });
          status.dirty();
        }
      } else {
        util.assertNever(check);
      }
    }
    return { status: status.value, value: input.data };
  }
  _regex(regex2, validation, message3) {
    return this.refinement((data24) => regex2.test(data24), {
      validation,
      code: ZodIssueCode.invalid_string,
      ...errorUtil.errToObj(message3)
    });
  }
  _addCheck(check) {
    return new ZodString({
      ...this._def,
      checks: [...this._def.checks, check]
    });
  }
  email(message3) {
    return this._addCheck({ kind: "email", ...errorUtil.errToObj(message3) });
  }
  url(message3) {
    return this._addCheck({ kind: "url", ...errorUtil.errToObj(message3) });
  }
  emoji(message3) {
    return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message3) });
  }
  uuid(message3) {
    return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message3) });
  }
  nanoid(message3) {
    return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message3) });
  }
  cuid(message3) {
    return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message3) });
  }
  cuid2(message3) {
    return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message3) });
  }
  ulid(message3) {
    return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message3) });
  }
  base64(message3) {
    return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message3) });
  }
  ip(options4) {
    return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options4) });
  }
  datetime(options4) {
    var _a2, _b;
    if (typeof options4 === "string") {
      return this._addCheck({
        kind: "datetime",
        precision: null,
        offset: false,
        local: false,
        message: options4
      });
    }
    return this._addCheck({
      kind: "datetime",
      precision: typeof (options4 === null || options4 === void 0 ? void 0 : options4.precision) === "undefined" ? null : options4 === null || options4 === void 0 ? void 0 : options4.precision,
      offset: (_a2 = options4 === null || options4 === void 0 ? void 0 : options4.offset) !== null && _a2 !== void 0 ? _a2 : false,
      local: (_b = options4 === null || options4 === void 0 ? void 0 : options4.local) !== null && _b !== void 0 ? _b : false,
      ...errorUtil.errToObj(options4 === null || options4 === void 0 ? void 0 : options4.message)
    });
  }
  date(message3) {
    return this._addCheck({ kind: "date", message: message3 });
  }
  time(options4) {
    if (typeof options4 === "string") {
      return this._addCheck({
        kind: "time",
        precision: null,
        message: options4
      });
    }
    return this._addCheck({
      kind: "time",
      precision: typeof (options4 === null || options4 === void 0 ? void 0 : options4.precision) === "undefined" ? null : options4 === null || options4 === void 0 ? void 0 : options4.precision,
      ...errorUtil.errToObj(options4 === null || options4 === void 0 ? void 0 : options4.message)
    });
  }
  duration(message3) {
    return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message3) });
  }
  regex(regex2, message3) {
    return this._addCheck({
      kind: "regex",
      regex: regex2,
      ...errorUtil.errToObj(message3)
    });
  }
  includes(value4, options4) {
    return this._addCheck({
      kind: "includes",
      value: value4,
      position: options4 === null || options4 === void 0 ? void 0 : options4.position,
      ...errorUtil.errToObj(options4 === null || options4 === void 0 ? void 0 : options4.message)
    });
  }
  startsWith(value4, message3) {
    return this._addCheck({
      kind: "startsWith",
      value: value4,
      ...errorUtil.errToObj(message3)
    });
  }
  endsWith(value4, message3) {
    return this._addCheck({
      kind: "endsWith",
      value: value4,
      ...errorUtil.errToObj(message3)
    });
  }
  min(minLength, message3) {
    return this._addCheck({
      kind: "min",
      value: minLength,
      ...errorUtil.errToObj(message3)
    });
  }
  max(maxLength, message3) {
    return this._addCheck({
      kind: "max",
      value: maxLength,
      ...errorUtil.errToObj(message3)
    });
  }
  length(len, message3) {
    return this._addCheck({
      kind: "length",
      value: len,
      ...errorUtil.errToObj(message3)
    });
  }
  /**
   * @deprecated Use z.string().min(1) instead.
   * @see {@link ZodString.min}
   */
  nonempty(message3) {
    return this.min(1, errorUtil.errToObj(message3));
  }
  trim() {
    return new ZodString({
      ...this._def,
      checks: [...this._def.checks, { kind: "trim" }]
    });
  }
  toLowerCase() {
    return new ZodString({
      ...this._def,
      checks: [...this._def.checks, { kind: "toLowerCase" }]
    });
  }
  toUpperCase() {
    return new ZodString({
      ...this._def,
      checks: [...this._def.checks, { kind: "toUpperCase" }]
    });
  }
  get isDatetime() {
    return !!this._def.checks.find((ch) => ch.kind === "datetime");
  }
  get isDate() {
    return !!this._def.checks.find((ch) => ch.kind === "date");
  }
  get isTime() {
    return !!this._def.checks.find((ch) => ch.kind === "time");
  }
  get isDuration() {
    return !!this._def.checks.find((ch) => ch.kind === "duration");
  }
  get isEmail() {
    return !!this._def.checks.find((ch) => ch.kind === "email");
  }
  get isURL() {
    return !!this._def.checks.find((ch) => ch.kind === "url");
  }
  get isEmoji() {
    return !!this._def.checks.find((ch) => ch.kind === "emoji");
  }
  get isUUID() {
    return !!this._def.checks.find((ch) => ch.kind === "uuid");
  }
  get isNANOID() {
    return !!this._def.checks.find((ch) => ch.kind === "nanoid");
  }
  get isCUID() {
    return !!this._def.checks.find((ch) => ch.kind === "cuid");
  }
  get isCUID2() {
    return !!this._def.checks.find((ch) => ch.kind === "cuid2");
  }
  get isULID() {
    return !!this._def.checks.find((ch) => ch.kind === "ulid");
  }
  get isIP() {
    return !!this._def.checks.find((ch) => ch.kind === "ip");
  }
  get isBase64() {
    return !!this._def.checks.find((ch) => ch.kind === "base64");
  }
  get minLength() {
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      }
    }
    return min;
  }
  get maxLength() {
    let max = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return max;
  }
}
ZodString.create = (params) => {
  var _a2;
  return new ZodString({
    checks: [],
    typeName: ZodFirstPartyTypeKind.ZodString,
    coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
    ...processCreateParams(params)
  });
};
function floatSafeRemainder(val, step3) {
  const valDecCount = (val.toString().split(".")[1] || "").length;
  const stepDecCount = (step3.toString().split(".")[1] || "").length;
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
  const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
  const stepInt = parseInt(step3.toFixed(decCount).replace(".", ""));
  return valInt % stepInt / Math.pow(10, decCount);
}
__name(floatSafeRemainder, "floatSafeRemainder");
class ZodNumber extends ZodType {
  static {
    __name(this, "ZodNumber");
  }
  constructor() {
    super(...arguments);
    this.min = this.gte;
    this.max = this.lte;
    this.step = this.multipleOf;
  }
  _parse(input) {
    if (this._def.coerce) {
      input.data = Number(input.data);
    }
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.number) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.number,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    let ctx = void 0;
    const status = new ParseStatus();
    for (const check of this._def.checks) {
      if (check.kind === "int") {
        if (!util.isInteger(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: "integer",
            received: "float",
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "min") {
        const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
        if (tooSmall) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_small,
            minimum: check.value,
            type: "number",
            inclusive: check.inclusive,
            exact: false,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "max") {
        const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
        if (tooBig) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_big,
            maximum: check.value,
            type: "number",
            inclusive: check.inclusive,
            exact: false,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "multipleOf") {
        if (floatSafeRemainder(input.data, check.value) !== 0) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.not_multiple_of,
            multipleOf: check.value,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "finite") {
        if (!Number.isFinite(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.not_finite,
            message: check.message
          });
          status.dirty();
        }
      } else {
        util.assertNever(check);
      }
    }
    return { status: status.value, value: input.data };
  }
  gte(value4, message3) {
    return this.setLimit("min", value4, true, errorUtil.toString(message3));
  }
  gt(value4, message3) {
    return this.setLimit("min", value4, false, errorUtil.toString(message3));
  }
  lte(value4, message3) {
    return this.setLimit("max", value4, true, errorUtil.toString(message3));
  }
  lt(value4, message3) {
    return this.setLimit("max", value4, false, errorUtil.toString(message3));
  }
  setLimit(kind, value4, inclusive, message3) {
    return new ZodNumber({
      ...this._def,
      checks: [
        ...this._def.checks,
        {
          kind,
          value: value4,
          inclusive,
          message: errorUtil.toString(message3)
        }
      ]
    });
  }
  _addCheck(check) {
    return new ZodNumber({
      ...this._def,
      checks: [...this._def.checks, check]
    });
  }
  int(message3) {
    return this._addCheck({
      kind: "int",
      message: errorUtil.toString(message3)
    });
  }
  positive(message3) {
    return this._addCheck({
      kind: "min",
      value: 0,
      inclusive: false,
      message: errorUtil.toString(message3)
    });
  }
  negative(message3) {
    return this._addCheck({
      kind: "max",
      value: 0,
      inclusive: false,
      message: errorUtil.toString(message3)
    });
  }
  nonpositive(message3) {
    return this._addCheck({
      kind: "max",
      value: 0,
      inclusive: true,
      message: errorUtil.toString(message3)
    });
  }
  nonnegative(message3) {
    return this._addCheck({
      kind: "min",
      value: 0,
      inclusive: true,
      message: errorUtil.toString(message3)
    });
  }
  multipleOf(value4, message3) {
    return this._addCheck({
      kind: "multipleOf",
      value: value4,
      message: errorUtil.toString(message3)
    });
  }
  finite(message3) {
    return this._addCheck({
      kind: "finite",
      message: errorUtil.toString(message3)
    });
  }
  safe(message3) {
    return this._addCheck({
      kind: "min",
      inclusive: true,
      value: Number.MIN_SAFE_INTEGER,
      message: errorUtil.toString(message3)
    })._addCheck({
      kind: "max",
      inclusive: true,
      value: Number.MAX_SAFE_INTEGER,
      message: errorUtil.toString(message3)
    });
  }
  get minValue() {
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      }
    }
    return min;
  }
  get maxValue() {
    let max = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return max;
  }
  get isInt() {
    return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
  }
  get isFinite() {
    let max = null, min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
        return true;
      } else if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      } else if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return Number.isFinite(min) && Number.isFinite(max);
  }
}
ZodNumber.create = (params) => {
  return new ZodNumber({
    checks: [],
    typeName: ZodFirstPartyTypeKind.ZodNumber,
    coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
    ...processCreateParams(params)
  });
};
class ZodBigInt extends ZodType {
  static {
    __name(this, "ZodBigInt");
  }
  constructor() {
    super(...arguments);
    this.min = this.gte;
    this.max = this.lte;
  }
  _parse(input) {
    if (this._def.coerce) {
      input.data = BigInt(input.data);
    }
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.bigint) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.bigint,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    let ctx = void 0;
    const status = new ParseStatus();
    for (const check of this._def.checks) {
      if (check.kind === "min") {
        const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
        if (tooSmall) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_small,
            type: "bigint",
            minimum: check.value,
            inclusive: check.inclusive,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "max") {
        const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
        if (tooBig) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_big,
            type: "bigint",
            maximum: check.value,
            inclusive: check.inclusive,
            message: check.message
          });
          status.dirty();
        }
      } else if (check.kind === "multipleOf") {
        if (input.data % check.value !== BigInt(0)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.not_multiple_of,
            multipleOf: check.value,
            message: check.message
          });
          status.dirty();
        }
      } else {
        util.assertNever(check);
      }
    }
    return { status: status.value, value: input.data };
  }
  gte(value4, message3) {
    return this.setLimit("min", value4, true, errorUtil.toString(message3));
  }
  gt(value4, message3) {
    return this.setLimit("min", value4, false, errorUtil.toString(message3));
  }
  lte(value4, message3) {
    return this.setLimit("max", value4, true, errorUtil.toString(message3));
  }
  lt(value4, message3) {
    return this.setLimit("max", value4, false, errorUtil.toString(message3));
  }
  setLimit(kind, value4, inclusive, message3) {
    return new ZodBigInt({
      ...this._def,
      checks: [
        ...this._def.checks,
        {
          kind,
          value: value4,
          inclusive,
          message: errorUtil.toString(message3)
        }
      ]
    });
  }
  _addCheck(check) {
    return new ZodBigInt({
      ...this._def,
      checks: [...this._def.checks, check]
    });
  }
  positive(message3) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: false,
      message: errorUtil.toString(message3)
    });
  }
  negative(message3) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: false,
      message: errorUtil.toString(message3)
    });
  }
  nonpositive(message3) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: true,
      message: errorUtil.toString(message3)
    });
  }
  nonnegative(message3) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: true,
      message: errorUtil.toString(message3)
    });
  }
  multipleOf(value4, message3) {
    return this._addCheck({
      kind: "multipleOf",
      value: value4,
      message: errorUtil.toString(message3)
    });
  }
  get minValue() {
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      }
    }
    return min;
  }
  get maxValue() {
    let max = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return max;
  }
}
ZodBigInt.create = (params) => {
  var _a2;
  return new ZodBigInt({
    checks: [],
    typeName: ZodFirstPartyTypeKind.ZodBigInt,
    coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
    ...processCreateParams(params)
  });
};
class ZodBoolean extends ZodType {
  static {
    __name(this, "ZodBoolean");
  }
  _parse(input) {
    if (this._def.coerce) {
      input.data = Boolean(input.data);
    }
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.boolean) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.boolean,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
}
ZodBoolean.create = (params) => {
  return new ZodBoolean({
    typeName: ZodFirstPartyTypeKind.ZodBoolean,
    coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
    ...processCreateParams(params)
  });
};
class ZodDate extends ZodType {
  static {
    __name(this, "ZodDate");
  }
  _parse(input) {
    if (this._def.coerce) {
      input.data = new Date(input.data);
    }
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.date) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.date,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    if (isNaN(input.data.getTime())) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode.invalid_date
      });
      return INVALID;
    }
    const status = new ParseStatus();
    let ctx = void 0;
    for (const check of this._def.checks) {
      if (check.kind === "min") {
        if (input.data.getTime() < check.value) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_small,
            message: check.message,
            inclusive: true,
            exact: false,
            minimum: check.value,
            type: "date"
          });
          status.dirty();
        }
      } else if (check.kind === "max") {
        if (input.data.getTime() > check.value) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_big,
            message: check.message,
            inclusive: true,
            exact: false,
            maximum: check.value,
            type: "date"
          });
          status.dirty();
        }
      } else {
        util.assertNever(check);
      }
    }
    return {
      status: status.value,
      value: new Date(input.data.getTime())
    };
  }
  _addCheck(check) {
    return new ZodDate({
      ...this._def,
      checks: [...this._def.checks, check]
    });
  }
  min(minDate, message3) {
    return this._addCheck({
      kind: "min",
      value: minDate.getTime(),
      message: errorUtil.toString(message3)
    });
  }
  max(maxDate, message3) {
    return this._addCheck({
      kind: "max",
      value: maxDate.getTime(),
      message: errorUtil.toString(message3)
    });
  }
  get minDate() {
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      }
    }
    return min != null ? new Date(min) : null;
  }
  get maxDate() {
    let max = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return max != null ? new Date(max) : null;
  }
}
ZodDate.create = (params) => {
  return new ZodDate({
    checks: [],
    coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
    typeName: ZodFirstPartyTypeKind.ZodDate,
    ...processCreateParams(params)
  });
};
class ZodSymbol extends ZodType {
  static {
    __name(this, "ZodSymbol");
  }
  _parse(input) {
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.symbol) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.symbol,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
}
ZodSymbol.create = (params) => {
  return new ZodSymbol({
    typeName: ZodFirstPartyTypeKind.ZodSymbol,
    ...processCreateParams(params)
  });
};
class ZodUndefined extends ZodType {
  static {
    __name(this, "ZodUndefined");
  }
  _parse(input) {
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.undefined) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.undefined,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
}
ZodUndefined.create = (params) => {
  return new ZodUndefined({
    typeName: ZodFirstPartyTypeKind.ZodUndefined,
    ...processCreateParams(params)
  });
};
class ZodNull extends ZodType {
  static {
    __name(this, "ZodNull");
  }
  _parse(input) {
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.null) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.null,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
}
ZodNull.create = (params) => {
  return new ZodNull({
    typeName: ZodFirstPartyTypeKind.ZodNull,
    ...processCreateParams(params)
  });
};
class ZodAny extends ZodType {
  static {
    __name(this, "ZodAny");
  }
  constructor() {
    super(...arguments);
    this._any = true;
  }
  _parse(input) {
    return OK(input.data);
  }
}
ZodAny.create = (params) => {
  return new ZodAny({
    typeName: ZodFirstPartyTypeKind.ZodAny,
    ...processCreateParams(params)
  });
};
class ZodUnknown extends ZodType {
  static {
    __name(this, "ZodUnknown");
  }
  constructor() {
    super(...arguments);
    this._unknown = true;
  }
  _parse(input) {
    return OK(input.data);
  }
}
ZodUnknown.create = (params) => {
  return new ZodUnknown({
    typeName: ZodFirstPartyTypeKind.ZodUnknown,
    ...processCreateParams(params)
  });
};
class ZodNever extends ZodType {
  static {
    __name(this, "ZodNever");
  }
  _parse(input) {
    const ctx = this._getOrReturnCtx(input);
    addIssueToContext(ctx, {
      code: ZodIssueCode.invalid_type,
      expected: ZodParsedType.never,
      received: ctx.parsedType
    });
    return INVALID;
  }
}
ZodNever.create = (params) => {
  return new ZodNever({
    typeName: ZodFirstPartyTypeKind.ZodNever,
    ...processCreateParams(params)
  });
};
class ZodVoid extends ZodType {
  static {
    __name(this, "ZodVoid");
  }
  _parse(input) {
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.undefined) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.void,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
}
ZodVoid.create = (params) => {
  return new ZodVoid({
    typeName: ZodFirstPartyTypeKind.ZodVoid,
    ...processCreateParams(params)
  });
};
class ZodArray extends ZodType {
  static {
    __name(this, "ZodArray");
  }
  _parse(input) {
    const { ctx, status } = this._processInputParams(input);
    const def2 = this._def;
    if (ctx.parsedType !== ZodParsedType.array) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.array,
        received: ctx.parsedType
      });
      return INVALID;
    }
    if (def2.exactLength !== null) {
      const tooBig = ctx.data.length > def2.exactLength.value;
      const tooSmall = ctx.data.length < def2.exactLength.value;
      if (tooBig || tooSmall) {
        addIssueToContext(ctx, {
          code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
          minimum: tooSmall ? def2.exactLength.value : void 0,
          maximum: tooBig ? def2.exactLength.value : void 0,
          type: "array",
          inclusive: true,
          exact: true,
          message: def2.exactLength.message
        });
        status.dirty();
      }
    }
    if (def2.minLength !== null) {
      if (ctx.data.length < def2.minLength.value) {
        addIssueToContext(ctx, {
          code: ZodIssueCode.too_small,
          minimum: def2.minLength.value,
          type: "array",
          inclusive: true,
          exact: false,
          message: def2.minLength.message
        });
        status.dirty();
      }
    }
    if (def2.maxLength !== null) {
      if (ctx.data.length > def2.maxLength.value) {
        addIssueToContext(ctx, {
          code: ZodIssueCode.too_big,
          maximum: def2.maxLength.value,
          type: "array",
          inclusive: true,
          exact: false,
          message: def2.maxLength.message
        });
        status.dirty();
      }
    }
    if (ctx.common.async) {
      return Promise.all([...ctx.data].map((item3, i2) => {
        return def2.type._parseAsync(new ParseInputLazyPath(ctx, item3, ctx.path, i2));
      })).then((result2) => {
        return ParseStatus.mergeArray(status, result2);
      });
    }
    const result = [...ctx.data].map((item3, i2) => {
      return def2.type._parseSync(new ParseInputLazyPath(ctx, item3, ctx.path, i2));
    });
    return ParseStatus.mergeArray(status, result);
  }
  get element() {
    return this._def.type;
  }
  min(minLength, message3) {
    return new ZodArray({
      ...this._def,
      minLength: { value: minLength, message: errorUtil.toString(message3) }
    });
  }
  max(maxLength, message3) {
    return new ZodArray({
      ...this._def,
      maxLength: { value: maxLength, message: errorUtil.toString(message3) }
    });
  }
  length(len, message3) {
    return new ZodArray({
      ...this._def,
      exactLength: { value: len, message: errorUtil.toString(message3) }
    });
  }
  nonempty(message3) {
    return this.min(1, message3);
  }
}
ZodArray.create = (schema2, params) => {
  return new ZodArray({
    type: schema2,
    minLength: null,
    maxLength: null,
    exactLength: null,
    typeName: ZodFirstPartyTypeKind.ZodArray,
    ...processCreateParams(params)
  });
};
function deepPartialify(schema2) {
  if (schema2 instanceof ZodObject) {
    const newShape = {};
    for (const key in schema2.shape) {
      const fieldSchema = schema2.shape[key];
      newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
    }
    return new ZodObject({
      ...schema2._def,
      shape: /* @__PURE__ */ __name(() => newShape, "shape")
    });
  } else if (schema2 instanceof ZodArray) {
    return new ZodArray({
      ...schema2._def,
      type: deepPartialify(schema2.element)
    });
  } else if (schema2 instanceof ZodOptional) {
    return ZodOptional.create(deepPartialify(schema2.unwrap()));
  } else if (schema2 instanceof ZodNullable) {
    return ZodNullable.create(deepPartialify(schema2.unwrap()));
  } else if (schema2 instanceof ZodTuple) {
    return ZodTuple.create(schema2.items.map((item3) => deepPartialify(item3)));
  } else {
    return schema2;
  }
}
__name(deepPartialify, "deepPartialify");
class ZodObject extends ZodType {
  static {
    __name(this, "ZodObject");
  }
  constructor() {
    super(...arguments);
    this._cached = null;
    this.nonstrict = this.passthrough;
    this.augment = this.extend;
  }
  _getCached() {
    if (this._cached !== null)
      return this._cached;
    const shape = this._def.shape();
    const keys2 = util.objectKeys(shape);
    return this._cached = { shape, keys: keys2 };
  }
  _parse(input) {
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.object) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.object,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    const { status, ctx } = this._processInputParams(input);
    const { shape, keys: shapeKeys } = this._getCached();
    const extraKeys = [];
    if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
      for (const key in ctx.data) {
        if (!shapeKeys.includes(key)) {
          extraKeys.push(key);
        }
      }
    }
    const pairs = [];
    for (const key of shapeKeys) {
      const keyValidator = shape[key];
      const value4 = ctx.data[key];
      pairs.push({
        key: { status: "valid", value: key },
        value: keyValidator._parse(new ParseInputLazyPath(ctx, value4, ctx.path, key)),
        alwaysSet: key in ctx.data
      });
    }
    if (this._def.catchall instanceof ZodNever) {
      const unknownKeys = this._def.unknownKeys;
      if (unknownKeys === "passthrough") {
        for (const key of extraKeys) {
          pairs.push({
            key: { status: "valid", value: key },
            value: { status: "valid", value: ctx.data[key] }
          });
        }
      } else if (unknownKeys === "strict") {
        if (extraKeys.length > 0) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.unrecognized_keys,
            keys: extraKeys
          });
          status.dirty();
        }
      } else if (unknownKeys === "strip") ;
      else {
        throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
      }
    } else {
      const catchall = this._def.catchall;
      for (const key of extraKeys) {
        const value4 = ctx.data[key];
        pairs.push({
          key: { status: "valid", value: key },
          value: catchall._parse(
            new ParseInputLazyPath(ctx, value4, ctx.path, key)
            //, ctx.child(key), value, getParsedType(value)
          ),
          alwaysSet: key in ctx.data
        });
      }
    }
    if (ctx.common.async) {
      return Promise.resolve().then(async () => {
        const syncPairs = [];
        for (const pair of pairs) {
          const key = await pair.key;
          const value4 = await pair.value;
          syncPairs.push({
            key,
            value: value4,
            alwaysSet: pair.alwaysSet
          });
        }
        return syncPairs;
      }).then((syncPairs) => {
        return ParseStatus.mergeObjectSync(status, syncPairs);
      });
    } else {
      return ParseStatus.mergeObjectSync(status, pairs);
    }
  }
  get shape() {
    return this._def.shape();
  }
  strict(message3) {
    errorUtil.errToObj;
    return new ZodObject({
      ...this._def,
      unknownKeys: "strict",
      ...message3 !== void 0 ? {
        errorMap: /* @__PURE__ */ __name((issue, ctx) => {
          var _a2, _b, _c, _d;
          const defaultError = (_c = (_b = (_a2 = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a2, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
          if (issue.code === "unrecognized_keys")
            return {
              message: (_d = errorUtil.errToObj(message3).message) !== null && _d !== void 0 ? _d : defaultError
            };
          return {
            message: defaultError
          };
        }, "errorMap")
      } : {}
    });
  }
  strip() {
    return new ZodObject({
      ...this._def,
      unknownKeys: "strip"
    });
  }
  passthrough() {
    return new ZodObject({
      ...this._def,
      unknownKeys: "passthrough"
    });
  }
  // const AugmentFactory =
  //   <Def extends ZodObjectDef>(def: Def) =>
  //   <Augmentation extends ZodRawShape>(
  //     augmentation: Augmentation
  //   ): ZodObject<
  //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
  //     Def["unknownKeys"],
  //     Def["catchall"]
  //   > => {
  //     return new ZodObject({
  //       ...def,
  //       shape: () => ({
  //         ...def.shape(),
  //         ...augmentation,
  //       }),
  //     }) as any;
  //   };
  extend(augmentation) {
    return new ZodObject({
      ...this._def,
      shape: /* @__PURE__ */ __name(() => ({
        ...this._def.shape(),
        ...augmentation
      }), "shape")
    });
  }
  /**
   * Prior to zod@1.0.12 there was a bug in the
   * inferred type of merged objects. Please
   * upgrade if you are experiencing issues.
   */
  merge(merging) {
    const merged = new ZodObject({
      unknownKeys: merging._def.unknownKeys,
      catchall: merging._def.catchall,
      shape: /* @__PURE__ */ __name(() => ({
        ...this._def.shape(),
        ...merging._def.shape()
      }), "shape"),
      typeName: ZodFirstPartyTypeKind.ZodObject
    });
    return merged;
  }
  // merge<
  //   Incoming extends AnyZodObject,
  //   Augmentation extends Incoming["shape"],
  //   NewOutput extends {
  //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
  //       ? Augmentation[k]["_output"]
  //       : k extends keyof Output
  //       ? Output[k]
  //       : never;
  //   },
  //   NewInput extends {
  //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
  //       ? Augmentation[k]["_input"]
  //       : k extends keyof Input
  //       ? Input[k]
  //       : never;
  //   }
  // >(
  //   merging: Incoming
  // ): ZodObject<
  //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
  //   Incoming["_def"]["unknownKeys"],
  //   Incoming["_def"]["catchall"],
  //   NewOutput,
  //   NewInput
  // > {
  //   const merged: any = new ZodObject({
  //     unknownKeys: merging._def.unknownKeys,
  //     catchall: merging._def.catchall,
  //     shape: () =>
  //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
  //     typeName: ZodFirstPartyTypeKind.ZodObject,
  //   }) as any;
  //   return merged;
  // }
  setKey(key, schema2) {
    return this.augment({ [key]: schema2 });
  }
  // merge<Incoming extends AnyZodObject>(
  //   merging: Incoming
  // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
  // ZodObject<
  //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
  //   Incoming["_def"]["unknownKeys"],
  //   Incoming["_def"]["catchall"]
  // > {
  //   // const mergedShape = objectUtil.mergeShapes(
  //   //   this._def.shape(),
  //   //   merging._def.shape()
  //   // );
  //   const merged: any = new ZodObject({
  //     unknownKeys: merging._def.unknownKeys,
  //     catchall: merging._def.catchall,
  //     shape: () =>
  //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
  //     typeName: ZodFirstPartyTypeKind.ZodObject,
  //   }) as any;
  //   return merged;
  // }
  catchall(index2) {
    return new ZodObject({
      ...this._def,
      catchall: index2
    });
  }
  pick(mask3) {
    const shape = {};
    util.objectKeys(mask3).forEach((key) => {
      if (mask3[key] && this.shape[key]) {
        shape[key] = this.shape[key];
      }
    });
    return new ZodObject({
      ...this._def,
      shape: /* @__PURE__ */ __name(() => shape, "shape")
    });
  }
  omit(mask3) {
    const shape = {};
    util.objectKeys(this.shape).forEach((key) => {
      if (!mask3[key]) {
        shape[key] = this.shape[key];
      }
    });
    return new ZodObject({
      ...this._def,
      shape: /* @__PURE__ */ __name(() => shape, "shape")
    });
  }
  /**
   * @deprecated
   */
  deepPartial() {
    return deepPartialify(this);
  }
  partial(mask3) {
    const newShape = {};
    util.objectKeys(this.shape).forEach((key) => {
      const fieldSchema = this.shape[key];
      if (mask3 && !mask3[key]) {
        newShape[key] = fieldSchema;
      } else {
        newShape[key] = fieldSchema.optional();
      }
    });
    return new ZodObject({
      ...this._def,
      shape: /* @__PURE__ */ __name(() => newShape, "shape")
    });
  }
  required(mask3) {
    const newShape = {};
    util.objectKeys(this.shape).forEach((key) => {
      if (mask3 && !mask3[key]) {
        newShape[key] = this.shape[key];
      } else {
        const fieldSchema = this.shape[key];
        let newField = fieldSchema;
        while (newField instanceof ZodOptional) {
          newField = newField._def.innerType;
        }
        newShape[key] = newField;
      }
    });
    return new ZodObject({
      ...this._def,
      shape: /* @__PURE__ */ __name(() => newShape, "shape")
    });
  }
  keyof() {
    return createZodEnum(util.objectKeys(this.shape));
  }
}
ZodObject.create = (shape, params) => {
  return new ZodObject({
    shape: /* @__PURE__ */ __name(() => shape, "shape"),
    unknownKeys: "strip",
    catchall: ZodNever.create(),
    typeName: ZodFirstPartyTypeKind.ZodObject,
    ...processCreateParams(params)
  });
};
ZodObject.strictCreate = (shape, params) => {
  return new ZodObject({
    shape: /* @__PURE__ */ __name(() => shape, "shape"),
    unknownKeys: "strict",
    catchall: ZodNever.create(),
    typeName: ZodFirstPartyTypeKind.ZodObject,
    ...processCreateParams(params)
  });
};
ZodObject.lazycreate = (shape, params) => {
  return new ZodObject({
    shape,
    unknownKeys: "strip",
    catchall: ZodNever.create(),
    typeName: ZodFirstPartyTypeKind.ZodObject,
    ...processCreateParams(params)
  });
};
class ZodUnion extends ZodType {
  static {
    __name(this, "ZodUnion");
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    const options4 = this._def.options;
    function handleResults(results) {
      for (const result of results) {
        if (result.result.status === "valid") {
          return result.result;
        }
      }
      for (const result of results) {
        if (result.result.status === "dirty") {
          ctx.common.issues.push(...result.ctx.common.issues);
          return result.result;
        }
      }
      const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_union,
        unionErrors
      });
      return INVALID;
    }
    __name(handleResults, "handleResults");
    if (ctx.common.async) {
      return Promise.all(options4.map(async (option3) => {
        const childCtx = {
          ...ctx,
          common: {
            ...ctx.common,
            issues: []
          },
          parent: null
        };
        return {
          result: await option3._parseAsync({
            data: ctx.data,
            path: ctx.path,
            parent: childCtx
          }),
          ctx: childCtx
        };
      })).then(handleResults);
    } else {
      let dirty = void 0;
      const issues = [];
      for (const option3 of options4) {
        const childCtx = {
          ...ctx,
          common: {
            ...ctx.common,
            issues: []
          },
          parent: null
        };
        const result = option3._parseSync({
          data: ctx.data,
          path: ctx.path,
          parent: childCtx
        });
        if (result.status === "valid") {
          return result;
        } else if (result.status === "dirty" && !dirty) {
          dirty = { result, ctx: childCtx };
        }
        if (childCtx.common.issues.length) {
          issues.push(childCtx.common.issues);
        }
      }
      if (dirty) {
        ctx.common.issues.push(...dirty.ctx.common.issues);
        return dirty.result;
      }
      const unionErrors = issues.map((issues2) => new ZodError(issues2));
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_union,
        unionErrors
      });
      return INVALID;
    }
  }
  get options() {
    return this._def.options;
  }
}
ZodUnion.create = (types, params) => {
  return new ZodUnion({
    options: types,
    typeName: ZodFirstPartyTypeKind.ZodUnion,
    ...processCreateParams(params)
  });
};
const getDiscriminator = /* @__PURE__ */ __name((type) => {
  if (type instanceof ZodLazy) {
    return getDiscriminator(type.schema);
  } else if (type instanceof ZodEffects) {
    return getDiscriminator(type.innerType());
  } else if (type instanceof ZodLiteral) {
    return [type.value];
  } else if (type instanceof ZodEnum) {
    return type.options;
  } else if (type instanceof ZodNativeEnum) {
    return util.objectValues(type.enum);
  } else if (type instanceof ZodDefault) {
    return getDiscriminator(type._def.innerType);
  } else if (type instanceof ZodUndefined) {
    return [void 0];
  } else if (type instanceof ZodNull) {
    return [null];
  } else if (type instanceof ZodOptional) {
    return [void 0, ...getDiscriminator(type.unwrap())];
  } else if (type instanceof ZodNullable) {
    return [null, ...getDiscriminator(type.unwrap())];
  } else if (type instanceof ZodBranded) {
    return getDiscriminator(type.unwrap());
  } else if (type instanceof ZodReadonly) {
    return getDiscriminator(type.unwrap());
  } else if (type instanceof ZodCatch) {
    return getDiscriminator(type._def.innerType);
  } else {
    return [];
  }
}, "getDiscriminator");
class ZodDiscriminatedUnion extends ZodType {
  static {
    __name(this, "ZodDiscriminatedUnion");
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.object) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.object,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const discriminator = this.discriminator;
    const discriminatorValue = ctx.data[discriminator];
    const option3 = this.optionsMap.get(discriminatorValue);
    if (!option3) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_union_discriminator,
        options: Array.from(this.optionsMap.keys()),
        path: [discriminator]
      });
      return INVALID;
    }
    if (ctx.common.async) {
      return option3._parseAsync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      });
    } else {
      return option3._parseSync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      });
    }
  }
  get discriminator() {
    return this._def.discriminator;
  }
  get options() {
    return this._def.options;
  }
  get optionsMap() {
    return this._def.optionsMap;
  }
  /**
   * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
   * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
   * have a different value for each object in the union.
   * @param discriminator the name of the discriminator property
   * @param types an array of object schemas
   * @param params
   */
  static create(discriminator, options4, params) {
    const optionsMap = /* @__PURE__ */ new Map();
    for (const type of options4) {
      const discriminatorValues = getDiscriminator(type.shape[discriminator]);
      if (!discriminatorValues.length) {
        throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
      }
      for (const value4 of discriminatorValues) {
        if (optionsMap.has(value4)) {
          throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value4)}`);
        }
        optionsMap.set(value4, type);
      }
    }
    return new ZodDiscriminatedUnion({
      typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
      discriminator,
      options: options4,
      optionsMap,
      ...processCreateParams(params)
    });
  }
}
function mergeValues(a, b) {
  const aType = getParsedType(a);
  const bType = getParsedType(b);
  if (a === b) {
    return { valid: true, data: a };
  } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
    const bKeys = util.objectKeys(b);
    const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
    const newObj = { ...a, ...b };
    for (const key of sharedKeys) {
      const sharedValue = mergeValues(a[key], b[key]);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newObj[key] = sharedValue.data;
    }
    return { valid: true, data: newObj };
  } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
    if (a.length !== b.length) {
      return { valid: false };
    }
    const newArray = [];
    for (let index2 = 0; index2 < a.length; index2++) {
      const itemA = a[index2];
      const itemB = b[index2];
      const sharedValue = mergeValues(itemA, itemB);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newArray.push(sharedValue.data);
    }
    return { valid: true, data: newArray };
  } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
    return { valid: true, data: a };
  } else {
    return { valid: false };
  }
}
__name(mergeValues, "mergeValues");
class ZodIntersection extends ZodType {
  static {
    __name(this, "ZodIntersection");
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    const handleParsed = /* @__PURE__ */ __name((parsedLeft, parsedRight) => {
      if (isAborted(parsedLeft) || isAborted(parsedRight)) {
        return INVALID;
      }
      const merged = mergeValues(parsedLeft.value, parsedRight.value);
      if (!merged.valid) {
        addIssueToContext(ctx, {
          code: ZodIssueCode.invalid_intersection_types
        });
        return INVALID;
      }
      if (isDirty(parsedLeft) || isDirty(parsedRight)) {
        status.dirty();
      }
      return { status: status.value, value: merged.data };
    }, "handleParsed");
    if (ctx.common.async) {
      return Promise.all([
        this._def.left._parseAsync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        }),
        this._def.right._parseAsync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        })
      ]).then(([left, right]) => handleParsed(left, right));
    } else {
      return handleParsed(this._def.left._parseSync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      }), this._def.right._parseSync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      }));
    }
  }
}
ZodIntersection.create = (left, right, params) => {
  return new ZodIntersection({
    left,
    right,
    typeName: ZodFirstPartyTypeKind.ZodIntersection,
    ...processCreateParams(params)
  });
};
class ZodTuple extends ZodType {
  static {
    __name(this, "ZodTuple");
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.array) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.array,
        received: ctx.parsedType
      });
      return INVALID;
    }
    if (ctx.data.length < this._def.items.length) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.too_small,
        minimum: this._def.items.length,
        inclusive: true,
        exact: false,
        type: "array"
      });
      return INVALID;
    }
    const rest = this._def.rest;
    if (!rest && ctx.data.length > this._def.items.length) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.too_big,
        maximum: this._def.items.length,
        inclusive: true,
        exact: false,
        type: "array"
      });
      status.dirty();
    }
    const items2 = [...ctx.data].map((item3, itemIndex) => {
      const schema2 = this._def.items[itemIndex] || this._def.rest;
      if (!schema2)
        return null;
      return schema2._parse(new ParseInputLazyPath(ctx, item3, ctx.path, itemIndex));
    }).filter((x2) => !!x2);
    if (ctx.common.async) {
      return Promise.all(items2).then((results) => {
        return ParseStatus.mergeArray(status, results);
      });
    } else {
      return ParseStatus.mergeArray(status, items2);
    }
  }
  get items() {
    return this._def.items;
  }
  rest(rest) {
    return new ZodTuple({
      ...this._def,
      rest
    });
  }
}
ZodTuple.create = (schemas, params) => {
  if (!Array.isArray(schemas)) {
    throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
  }
  return new ZodTuple({
    items: schemas,
    typeName: ZodFirstPartyTypeKind.ZodTuple,
    rest: null,
    ...processCreateParams(params)
  });
};
class ZodRecord extends ZodType {
  static {
    __name(this, "ZodRecord");
  }
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.object) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.object,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const pairs = [];
    const keyType = this._def.keyType;
    const valueType = this._def.valueType;
    for (const key in ctx.data) {
      pairs.push({
        key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
        value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
        alwaysSet: key in ctx.data
      });
    }
    if (ctx.common.async) {
      return ParseStatus.mergeObjectAsync(status, pairs);
    } else {
      return ParseStatus.mergeObjectSync(status, pairs);
    }
  }
  get element() {
    return this._def.valueType;
  }
  static create(first2, second, third) {
    if (second instanceof ZodType) {
      return new ZodRecord({
        keyType: first2,
        valueType: second,
        typeName: ZodFirstPartyTypeKind.ZodRecord,
        ...processCreateParams(third)
      });
    }
    return new ZodRecord({
      keyType: ZodString.create(),
      valueType: first2,
      typeName: ZodFirstPartyTypeKind.ZodRecord,
      ...processCreateParams(second)
    });
  }
}
class ZodMap extends ZodType {
  static {
    __name(this, "ZodMap");
  }
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.map) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.map,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const keyType = this._def.keyType;
    const valueType = this._def.valueType;
    const pairs = [...ctx.data.entries()].map(([key, value4], index2) => {
      return {
        key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index2, "key"])),
        value: valueType._parse(new ParseInputLazyPath(ctx, value4, ctx.path, [index2, "value"]))
      };
    });
    if (ctx.common.async) {
      const finalMap = /* @__PURE__ */ new Map();
      return Promise.resolve().then(async () => {
        for (const pair of pairs) {
          const key = await pair.key;
          const value4 = await pair.value;
          if (key.status === "aborted" || value4.status === "aborted") {
            return INVALID;
          }
          if (key.status === "dirty" || value4.status === "dirty") {
            status.dirty();
          }
          finalMap.set(key.value, value4.value);
        }
        return { status: status.value, value: finalMap };
      });
    } else {
      const finalMap = /* @__PURE__ */ new Map();
      for (const pair of pairs) {
        const key = pair.key;
        const value4 = pair.value;
        if (key.status === "aborted" || value4.status === "aborted") {
          return INVALID;
        }
        if (key.status === "dirty" || value4.status === "dirty") {
          status.dirty();
        }
        finalMap.set(key.value, value4.value);
      }
      return { status: status.value, value: finalMap };
    }
  }
}
ZodMap.create = (keyType, valueType, params) => {
  return new ZodMap({
    valueType,
    keyType,
    typeName: ZodFirstPartyTypeKind.ZodMap,
    ...processCreateParams(params)
  });
};
class ZodSet extends ZodType {
  static {
    __name(this, "ZodSet");
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.set) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.set,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const def2 = this._def;
    if (def2.minSize !== null) {
      if (ctx.data.size < def2.minSize.value) {
        addIssueToContext(ctx, {
          code: ZodIssueCode.too_small,
          minimum: def2.minSize.value,
          type: "set",
          inclusive: true,
          exact: false,
          message: def2.minSize.message
        });
        status.dirty();
      }
    }
    if (def2.maxSize !== null) {
      if (ctx.data.size > def2.maxSize.value) {
        addIssueToContext(ctx, {
          code: ZodIssueCode.too_big,
          maximum: def2.maxSize.value,
          type: "set",
          inclusive: true,
          exact: false,
          message: def2.maxSize.message
        });
        status.dirty();
      }
    }
    const valueType = this._def.valueType;
    function finalizeSet(elements2) {
      const parsedSet = /* @__PURE__ */ new Set();
      for (const element of elements2) {
        if (element.status === "aborted")
          return INVALID;
        if (element.status === "dirty")
          status.dirty();
        parsedSet.add(element.value);
      }
      return { status: status.value, value: parsedSet };
    }
    __name(finalizeSet, "finalizeSet");
    const elements = [...ctx.data.values()].map((item3, i2) => valueType._parse(new ParseInputLazyPath(ctx, item3, ctx.path, i2)));
    if (ctx.common.async) {
      return Promise.all(elements).then((elements2) => finalizeSet(elements2));
    } else {
      return finalizeSet(elements);
    }
  }
  min(minSize, message3) {
    return new ZodSet({
      ...this._def,
      minSize: { value: minSize, message: errorUtil.toString(message3) }
    });
  }
  max(maxSize, message3) {
    return new ZodSet({
      ...this._def,
      maxSize: { value: maxSize, message: errorUtil.toString(message3) }
    });
  }
  size(size2, message3) {
    return this.min(size2, message3).max(size2, message3);
  }
  nonempty(message3) {
    return this.min(1, message3);
  }
}
ZodSet.create = (valueType, params) => {
  return new ZodSet({
    valueType,
    minSize: null,
    maxSize: null,
    typeName: ZodFirstPartyTypeKind.ZodSet,
    ...processCreateParams(params)
  });
};
class ZodFunction extends ZodType {
  static {
    __name(this, "ZodFunction");
  }
  constructor() {
    super(...arguments);
    this.validate = this.implement;
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.function) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.function,
        received: ctx.parsedType
      });
      return INVALID;
    }
    function makeArgsIssue(args, error2) {
      return makeIssue({
        data: args,
        path: ctx.path,
        errorMaps: [
          ctx.common.contextualErrorMap,
          ctx.schemaErrorMap,
          getErrorMap(),
          errorMap$1
        ].filter((x2) => !!x2),
        issueData: {
          code: ZodIssueCode.invalid_arguments,
          argumentsError: error2
        }
      });
    }
    __name(makeArgsIssue, "makeArgsIssue");
    function makeReturnsIssue(returns, error2) {
      return makeIssue({
        data: returns,
        path: ctx.path,
        errorMaps: [
          ctx.common.contextualErrorMap,
          ctx.schemaErrorMap,
          getErrorMap(),
          errorMap$1
        ].filter((x2) => !!x2),
        issueData: {
          code: ZodIssueCode.invalid_return_type,
          returnTypeError: error2
        }
      });
    }
    __name(makeReturnsIssue, "makeReturnsIssue");
    const params = { errorMap: ctx.common.contextualErrorMap };
    const fn = ctx.data;
    if (this._def.returns instanceof ZodPromise) {
      const me = this;
      return OK(async function(...args) {
        const error2 = new ZodError([]);
        const parsedArgs = await me._def.args.parseAsync(args, params).catch((e2) => {
          error2.addIssue(makeArgsIssue(args, e2));
          throw error2;
        });
        const result = await Reflect.apply(fn, this, parsedArgs);
        const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e2) => {
          error2.addIssue(makeReturnsIssue(result, e2));
          throw error2;
        });
        return parsedReturns;
      });
    } else {
      const me = this;
      return OK(function(...args) {
        const parsedArgs = me._def.args.safeParse(args, params);
        if (!parsedArgs.success) {
          throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
        }
        const result = Reflect.apply(fn, this, parsedArgs.data);
        const parsedReturns = me._def.returns.safeParse(result, params);
        if (!parsedReturns.success) {
          throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
        }
        return parsedReturns.data;
      });
    }
  }
  parameters() {
    return this._def.args;
  }
  returnType() {
    return this._def.returns;
  }
  args(...items2) {
    return new ZodFunction({
      ...this._def,
      args: ZodTuple.create(items2).rest(ZodUnknown.create())
    });
  }
  returns(returnType) {
    return new ZodFunction({
      ...this._def,
      returns: returnType
    });
  }
  implement(func) {
    const validatedFunc = this.parse(func);
    return validatedFunc;
  }
  strictImplement(func) {
    const validatedFunc = this.parse(func);
    return validatedFunc;
  }
  static create(args, returns, params) {
    return new ZodFunction({
      args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
      returns: returns || ZodUnknown.create(),
      typeName: ZodFirstPartyTypeKind.ZodFunction,
      ...processCreateParams(params)
    });
  }
}
class ZodLazy extends ZodType {
  static {
    __name(this, "ZodLazy");
  }
  get schema() {
    return this._def.getter();
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    const lazySchema = this._def.getter();
    return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
  }
}
ZodLazy.create = (getter, params) => {
  return new ZodLazy({
    getter,
    typeName: ZodFirstPartyTypeKind.ZodLazy,
    ...processCreateParams(params)
  });
};
class ZodLiteral extends ZodType {
  static {
    __name(this, "ZodLiteral");
  }
  _parse(input) {
    if (input.data !== this._def.value) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        received: ctx.data,
        code: ZodIssueCode.invalid_literal,
        expected: this._def.value
      });
      return INVALID;
    }
    return { status: "valid", value: input.data };
  }
  get value() {
    return this._def.value;
  }
}
ZodLiteral.create = (value4, params) => {
  return new ZodLiteral({
    value: value4,
    typeName: ZodFirstPartyTypeKind.ZodLiteral,
    ...processCreateParams(params)
  });
};
function createZodEnum(values, params) {
  return new ZodEnum({
    values,
    typeName: ZodFirstPartyTypeKind.ZodEnum,
    ...processCreateParams(params)
  });
}
__name(createZodEnum, "createZodEnum");
class ZodEnum extends ZodType {
  static {
    __name(this, "ZodEnum");
  }
  constructor() {
    super(...arguments);
    _ZodEnum_cache.set(this, void 0);
  }
  _parse(input) {
    if (typeof input.data !== "string") {
      const ctx = this._getOrReturnCtx(input);
      const expectedValues = this._def.values;
      addIssueToContext(ctx, {
        expected: util.joinValues(expectedValues),
        received: ctx.parsedType,
        code: ZodIssueCode.invalid_type
      });
      return INVALID;
    }
    if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
      __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
    }
    if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
      const ctx = this._getOrReturnCtx(input);
      const expectedValues = this._def.values;
      addIssueToContext(ctx, {
        received: ctx.data,
        code: ZodIssueCode.invalid_enum_value,
        options: expectedValues
      });
      return INVALID;
    }
    return OK(input.data);
  }
  get options() {
    return this._def.values;
  }
  get enum() {
    const enumValues = {};
    for (const val of this._def.values) {
      enumValues[val] = val;
    }
    return enumValues;
  }
  get Values() {
    const enumValues = {};
    for (const val of this._def.values) {
      enumValues[val] = val;
    }
    return enumValues;
  }
  get Enum() {
    const enumValues = {};
    for (const val of this._def.values) {
      enumValues[val] = val;
    }
    return enumValues;
  }
  extract(values, newDef = this._def) {
    return ZodEnum.create(values, {
      ...this._def,
      ...newDef
    });
  }
  exclude(values, newDef = this._def) {
    return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
      ...this._def,
      ...newDef
    });
  }
}
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
ZodEnum.create = createZodEnum;
class ZodNativeEnum extends ZodType {
  static {
    __name(this, "ZodNativeEnum");
  }
  constructor() {
    super(...arguments);
    _ZodNativeEnum_cache.set(this, void 0);
  }
  _parse(input) {
    const nativeEnumValues = util.getValidEnumValues(this._def.values);
    const ctx = this._getOrReturnCtx(input);
    if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
      const expectedValues = util.objectValues(nativeEnumValues);
      addIssueToContext(ctx, {
        expected: util.joinValues(expectedValues),
        received: ctx.parsedType,
        code: ZodIssueCode.invalid_type
      });
      return INVALID;
    }
    if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
      __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
    }
    if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
      const expectedValues = util.objectValues(nativeEnumValues);
      addIssueToContext(ctx, {
        received: ctx.data,
        code: ZodIssueCode.invalid_enum_value,
        options: expectedValues
      });
      return INVALID;
    }
    return OK(input.data);
  }
  get enum() {
    return this._def.values;
  }
}
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
ZodNativeEnum.create = (values, params) => {
  return new ZodNativeEnum({
    values,
    typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
    ...processCreateParams(params)
  });
};
class ZodPromise extends ZodType {
  static {
    __name(this, "ZodPromise");
  }
  unwrap() {
    return this._def.type;
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.promise,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
    return OK(promisified.then((data24) => {
      return this._def.type.parseAsync(data24, {
        path: ctx.path,
        errorMap: ctx.common.contextualErrorMap
      });
    }));
  }
}
ZodPromise.create = (schema2, params) => {
  return new ZodPromise({
    type: schema2,
    typeName: ZodFirstPartyTypeKind.ZodPromise,
    ...processCreateParams(params)
  });
};
class ZodEffects extends ZodType {
  static {
    __name(this, "ZodEffects");
  }
  innerType() {
    return this._def.schema;
  }
  sourceType() {
    return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    const effect2 = this._def.effect || null;
    const checkCtx = {
      addIssue: /* @__PURE__ */ __name((arg) => {
        addIssueToContext(ctx, arg);
        if (arg.fatal) {
          status.abort();
        } else {
          status.dirty();
        }
      }, "addIssue"),
      get path() {
        return ctx.path;
      }
    };
    checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
    if (effect2.type === "preprocess") {
      const processed = effect2.transform(ctx.data, checkCtx);
      if (ctx.common.async) {
        return Promise.resolve(processed).then(async (processed2) => {
          if (status.value === "aborted")
            return INVALID;
          const result = await this._def.schema._parseAsync({
            data: processed2,
            path: ctx.path,
            parent: ctx
          });
          if (result.status === "aborted")
            return INVALID;
          if (result.status === "dirty")
            return DIRTY(result.value);
          if (status.value === "dirty")
            return DIRTY(result.value);
          return result;
        });
      } else {
        if (status.value === "aborted")
          return INVALID;
        const result = this._def.schema._parseSync({
          data: processed,
          path: ctx.path,
          parent: ctx
        });
        if (result.status === "aborted")
          return INVALID;
        if (result.status === "dirty")
          return DIRTY(result.value);
        if (status.value === "dirty")
          return DIRTY(result.value);
        return result;
      }
    }
    if (effect2.type === "refinement") {
      const executeRefinement = /* @__PURE__ */ __name((acc) => {
        const result = effect2.refinement(acc, checkCtx);
        if (ctx.common.async) {
          return Promise.resolve(result);
        }
        if (result instanceof Promise) {
          throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
        }
        return acc;
      }, "executeRefinement");
      if (ctx.common.async === false) {
        const inner = this._def.schema._parseSync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        });
        if (inner.status === "aborted")
          return INVALID;
        if (inner.status === "dirty")
          status.dirty();
        executeRefinement(inner.value);
        return { status: status.value, value: inner.value };
      } else {
        return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
          if (inner.status === "aborted")
            return INVALID;
          if (inner.status === "dirty")
            status.dirty();
          return executeRefinement(inner.value).then(() => {
            return { status: status.value, value: inner.value };
          });
        });
      }
    }
    if (effect2.type === "transform") {
      if (ctx.common.async === false) {
        const base2 = this._def.schema._parseSync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        });
        if (!isValid(base2))
          return base2;
        const result = effect2.transform(base2.value, checkCtx);
        if (result instanceof Promise) {
          throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
        }
        return { status: status.value, value: result };
      } else {
        return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base2) => {
          if (!isValid(base2))
            return base2;
          return Promise.resolve(effect2.transform(base2.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
        });
      }
    }
    util.assertNever(effect2);
  }
}
ZodEffects.create = (schema2, effect2, params) => {
  return new ZodEffects({
    schema: schema2,
    typeName: ZodFirstPartyTypeKind.ZodEffects,
    effect: effect2,
    ...processCreateParams(params)
  });
};
ZodEffects.createWithPreprocess = (preprocess, schema2, params) => {
  return new ZodEffects({
    schema: schema2,
    effect: { type: "preprocess", transform: preprocess },
    typeName: ZodFirstPartyTypeKind.ZodEffects,
    ...processCreateParams(params)
  });
};
class ZodOptional extends ZodType {
  static {
    __name(this, "ZodOptional");
  }
  _parse(input) {
    const parsedType = this._getType(input);
    if (parsedType === ZodParsedType.undefined) {
      return OK(void 0);
    }
    return this._def.innerType._parse(input);
  }
  unwrap() {
    return this._def.innerType;
  }
}
ZodOptional.create = (type, params) => {
  return new ZodOptional({
    innerType: type,
    typeName: ZodFirstPartyTypeKind.ZodOptional,
    ...processCreateParams(params)
  });
};
class ZodNullable extends ZodType {
  static {
    __name(this, "ZodNullable");
  }
  _parse(input) {
    const parsedType = this._getType(input);
    if (parsedType === ZodParsedType.null) {
      return OK(null);
    }
    return this._def.innerType._parse(input);
  }
  unwrap() {
    return this._def.innerType;
  }
}
ZodNullable.create = (type, params) => {
  return new ZodNullable({
    innerType: type,
    typeName: ZodFirstPartyTypeKind.ZodNullable,
    ...processCreateParams(params)
  });
};
class ZodDefault extends ZodType {
  static {
    __name(this, "ZodDefault");
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    let data24 = ctx.data;
    if (ctx.parsedType === ZodParsedType.undefined) {
      data24 = this._def.defaultValue();
    }
    return this._def.innerType._parse({
      data: data24,
      path: ctx.path,
      parent: ctx
    });
  }
  removeDefault() {
    return this._def.innerType;
  }
}
ZodDefault.create = (type, params) => {
  return new ZodDefault({
    innerType: type,
    typeName: ZodFirstPartyTypeKind.ZodDefault,
    defaultValue: typeof params.default === "function" ? params.default : () => params.default,
    ...processCreateParams(params)
  });
};
class ZodCatch extends ZodType {
  static {
    __name(this, "ZodCatch");
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    const newCtx = {
      ...ctx,
      common: {
        ...ctx.common,
        issues: []
      }
    };
    const result = this._def.innerType._parse({
      data: newCtx.data,
      path: newCtx.path,
      parent: {
        ...newCtx
      }
    });
    if (isAsync(result)) {
      return result.then((result2) => {
        return {
          status: "valid",
          value: result2.status === "valid" ? result2.value : this._def.catchValue({
            get error() {
              return new ZodError(newCtx.common.issues);
            },
            input: newCtx.data
          })
        };
      });
    } else {
      return {
        status: "valid",
        value: result.status === "valid" ? result.value : this._def.catchValue({
          get error() {
            return new ZodError(newCtx.common.issues);
          },
          input: newCtx.data
        })
      };
    }
  }
  removeCatch() {
    return this._def.innerType;
  }
}
ZodCatch.create = (type, params) => {
  return new ZodCatch({
    innerType: type,
    typeName: ZodFirstPartyTypeKind.ZodCatch,
    catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
    ...processCreateParams(params)
  });
};
class ZodNaN extends ZodType {
  static {
    __name(this, "ZodNaN");
  }
  _parse(input) {
    const parsedType = this._getType(input);
    if (parsedType !== ZodParsedType.nan) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.nan,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return { status: "valid", value: input.data };
  }
}
ZodNaN.create = (params) => {
  return new ZodNaN({
    typeName: ZodFirstPartyTypeKind.ZodNaN,
    ...processCreateParams(params)
  });
};
const BRAND = Symbol("zod_brand");
class ZodBranded extends ZodType {
  static {
    __name(this, "ZodBranded");
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    const data24 = ctx.data;
    return this._def.type._parse({
      data: data24,
      path: ctx.path,
      parent: ctx
    });
  }
  unwrap() {
    return this._def.type;
  }
}
class ZodPipeline extends ZodType {
  static {
    __name(this, "ZodPipeline");
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.common.async) {
      const handleAsync = /* @__PURE__ */ __name(async () => {
        const inResult = await this._def.in._parseAsync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        });
        if (inResult.status === "aborted")
          return INVALID;
        if (inResult.status === "dirty") {
          status.dirty();
          return DIRTY(inResult.value);
        } else {
          return this._def.out._parseAsync({
            data: inResult.value,
            path: ctx.path,
            parent: ctx
          });
        }
      }, "handleAsync");
      return handleAsync();
    } else {
      const inResult = this._def.in._parseSync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      });
      if (inResult.status === "aborted")
        return INVALID;
      if (inResult.status === "dirty") {
        status.dirty();
        return {
          status: "dirty",
          value: inResult.value
        };
      } else {
        return this._def.out._parseSync({
          data: inResult.value,
          path: ctx.path,
          parent: ctx
        });
      }
    }
  }
  static create(a, b) {
    return new ZodPipeline({
      in: a,
      out: b,
      typeName: ZodFirstPartyTypeKind.ZodPipeline
    });
  }
}
class ZodReadonly extends ZodType {
  static {
    __name(this, "ZodReadonly");
  }
  _parse(input) {
    const result = this._def.innerType._parse(input);
    const freeze = /* @__PURE__ */ __name((data24) => {
      if (isValid(data24)) {
        data24.value = Object.freeze(data24.value);
      }
      return data24;
    }, "freeze");
    return isAsync(result) ? result.then((data24) => freeze(data24)) : freeze(result);
  }
  unwrap() {
    return this._def.innerType;
  }
}
ZodReadonly.create = (type, params) => {
  return new ZodReadonly({
    innerType: type,
    typeName: ZodFirstPartyTypeKind.ZodReadonly,
    ...processCreateParams(params)
  });
};
function custom(check, params = {}, fatal) {
  if (check)
    return ZodAny.create().superRefine((data24, ctx) => {
      var _a2, _b;
      if (!check(data24)) {
        const p2 = typeof params === "function" ? params(data24) : typeof params === "string" ? { message: params } : params;
        const _fatal = (_b = (_a2 = p2.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
        const p22 = typeof p2 === "string" ? { message: p2 } : p2;
        ctx.addIssue({ code: "custom", ...p22, fatal: _fatal });
      }
    });
  return ZodAny.create();
}
__name(custom, "custom");
const late = {
  object: ZodObject.lazycreate
};
var ZodFirstPartyTypeKind;
(function(ZodFirstPartyTypeKind2) {
  ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
  ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber";
  ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN";
  ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt";
  ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean";
  ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate";
  ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol";
  ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined";
  ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull";
  ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny";
  ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown";
  ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever";
  ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid";
  ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray";
  ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject";
  ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion";
  ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
  ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection";
  ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple";
  ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord";
  ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap";
  ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet";
  ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction";
  ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy";
  ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral";
  ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum";
  ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects";
  ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum";
  ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional";
  ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable";
  ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault";
  ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch";
  ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
  ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
  ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
  ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
const instanceOfType = /* @__PURE__ */ __name((cls, params = {
  message: `Input not instance of ${cls.name}`
}) => custom((data24) => data24 instanceof cls, params), "instanceOfType");
const stringType = ZodString.create;
const numberType = ZodNumber.create;
const nanType = ZodNaN.create;
const bigIntType = ZodBigInt.create;
const booleanType = ZodBoolean.create;
const dateType = ZodDate.create;
const symbolType = ZodSymbol.create;
const undefinedType = ZodUndefined.create;
const nullType = ZodNull.create;
const anyType = ZodAny.create;
const unknownType = ZodUnknown.create;
const neverType = ZodNever.create;
const voidType = ZodVoid.create;
const arrayType = ZodArray.create;
const objectType = ZodObject.create;
const strictObjectType = ZodObject.strictCreate;
const unionType = ZodUnion.create;
const discriminatedUnionType = ZodDiscriminatedUnion.create;
const intersectionType = ZodIntersection.create;
const tupleType = ZodTuple.create;
const recordType = ZodRecord.create;
const mapType = ZodMap.create;
const setType = ZodSet.create;
const functionType = ZodFunction.create;
const lazyType = ZodLazy.create;
const literalType = ZodLiteral.create;
const enumType = ZodEnum.create;
const nativeEnumType = ZodNativeEnum.create;
const promiseType = ZodPromise.create;
const effectsType = ZodEffects.create;
const optionalType = ZodOptional.create;
const nullableType = ZodNullable.create;
const preprocessType = ZodEffects.createWithPreprocess;
const pipelineType = ZodPipeline.create;
const ostring = /* @__PURE__ */ __name(() => stringType().optional(), "ostring");
const onumber = /* @__PURE__ */ __name(() => numberType().optional(), "onumber");
const oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), "oboolean");
const coerce = {
  string: /* @__PURE__ */ __name((arg) => ZodString.create({ ...arg, coerce: true }), "string"),
  number: /* @__PURE__ */ __name((arg) => ZodNumber.create({ ...arg, coerce: true }), "number"),
  boolean: /* @__PURE__ */ __name((arg) => ZodBoolean.create({
    ...arg,
    coerce: true
  }), "boolean"),
  bigint: /* @__PURE__ */ __name((arg) => ZodBigInt.create({ ...arg, coerce: true }), "bigint"),
  date: /* @__PURE__ */ __name((arg) => ZodDate.create({ ...arg, coerce: true }), "date")
};
const NEVER = INVALID;
var z = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  defaultErrorMap: errorMap$1,
  setErrorMap,
  getErrorMap,
  makeIssue,
  EMPTY_PATH,
  addIssueToContext,
  ParseStatus,
  INVALID,
  DIRTY,
  OK,
  isAborted,
  isDirty,
  isValid,
  isAsync,
  get util() {
    return util;
  },
  get objectUtil() {
    return objectUtil;
  },
  ZodParsedType,
  getParsedType,
  ZodType,
  datetimeRegex,
  ZodString,
  ZodNumber,
  ZodBigInt,
  ZodBoolean,
  ZodDate,
  ZodSymbol,
  ZodUndefined,
  ZodNull,
  ZodAny,
  ZodUnknown,
  ZodNever,
  ZodVoid,
  ZodArray,
  ZodObject,
  ZodUnion,
  ZodDiscriminatedUnion,
  ZodIntersection,
  ZodTuple,
  ZodRecord,
  ZodMap,
  ZodSet,
  ZodFunction,
  ZodLazy,
  ZodLiteral,
  ZodEnum,
  ZodNativeEnum,
  ZodPromise,
  ZodEffects,
  ZodTransformer: ZodEffects,
  ZodOptional,
  ZodNullable,
  ZodDefault,
  ZodCatch,
  ZodNaN,
  BRAND,
  ZodBranded,
  ZodPipeline,
  ZodReadonly,
  custom,
  Schema: ZodType,
  ZodSchema: ZodType,
  late,
  get ZodFirstPartyTypeKind() {
    return ZodFirstPartyTypeKind;
  },
  coerce,
  any: anyType,
  array: arrayType,
  bigint: bigIntType,
  boolean: booleanType,
  date: dateType,
  discriminatedUnion: discriminatedUnionType,
  effect: effectsType,
  "enum": enumType,
  "function": functionType,
  "instanceof": instanceOfType,
  intersection: intersectionType,
  lazy: lazyType,
  literal: literalType,
  map: mapType,
  nan: nanType,
  nativeEnum: nativeEnumType,
  never: neverType,
  "null": nullType,
  nullable: nullableType,
  number: numberType,
  object: objectType,
  oboolean,
  onumber,
  optional: optionalType,
  ostring,
  pipeline: pipelineType,
  preprocess: preprocessType,
  promise: promiseType,
  record: recordType,
  set: setType,
  strictObject: strictObjectType,
  string: stringType,
  symbol: symbolType,
  transformer: effectsType,
  tuple: tupleType,
  "undefined": undefinedType,
  union: unionType,
  unknown: unknownType,
  "void": voidType,
  NEVER,
  ZodIssueCode,
  quotelessJson,
  ZodError
});
function isZodErrorLike(err) {
  return err instanceof Error && err.name === "ZodError" && "issues" in err && Array.isArray(err.issues);
}
__name(isZodErrorLike, "isZodErrorLike");
var ValidationError = class extends Error {
  static {
    __name(this, "ValidationError");
  }
  name;
  details;
  constructor(message3, options4) {
    super(message3, options4);
    this.name = "ZodValidationError";
    this.details = getIssuesFromErrorOptions(options4);
  }
  toString() {
    return this.message;
  }
};
function getIssuesFromErrorOptions(options4) {
  if (options4) {
    const cause = options4.cause;
    if (isZodErrorLike(cause)) {
      return cause.issues;
    }
  }
  return [];
}
__name(getIssuesFromErrorOptions, "getIssuesFromErrorOptions");
function isValidationError(err) {
  return err instanceof ValidationError;
}
__name(isValidationError, "isValidationError");
function isValidationErrorLike(err) {
  return err instanceof Error && err.name === "ZodValidationError";
}
__name(isValidationErrorLike, "isValidationErrorLike");
var ISSUE_SEPARATOR = "; ";
var MAX_ISSUES_IN_MESSAGE = 99;
var PREFIX = "Validation error";
var PREFIX_SEPARATOR = ": ";
var UNION_SEPARATOR = ", or ";
function prefixMessage(message3, prefix2, prefixSeparator) {
  if (prefix2 !== null) {
    if (message3.length > 0) {
      return [prefix2, message3].join(prefixSeparator);
    }
    return prefix2;
  }
  if (message3.length > 0) {
    return message3;
  }
  return PREFIX;
}
__name(prefixMessage, "prefixMessage");
var identifierRegex = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;
function joinPath(path) {
  if (path.length === 1) {
    return path[0].toString();
  }
  return path.reduce((acc, item3) => {
    if (typeof item3 === "number") {
      return acc + "[" + item3.toString() + "]";
    }
    if (item3.includes('"')) {
      return acc + '["' + escapeQuotes(item3) + '"]';
    }
    if (!identifierRegex.test(item3)) {
      return acc + '["' + item3 + '"]';
    }
    const separator = acc.length === 0 ? "" : ".";
    return acc + separator + item3;
  }, "");
}
__name(joinPath, "joinPath");
function escapeQuotes(str) {
  return str.replace(/"/g, '\\"');
}
__name(escapeQuotes, "escapeQuotes");
function isNonEmptyArray(value4) {
  return value4.length !== 0;
}
__name(isNonEmptyArray, "isNonEmptyArray");
function getMessageFromZodIssue(props) {
  const { issue, issueSeparator, unionSeparator, includePath } = props;
  if (issue.code === "invalid_union") {
    return issue.unionErrors.reduce((acc, zodError) => {
      const newIssues = zodError.issues.map(
        (issue2) => getMessageFromZodIssue({
          issue: issue2,
          issueSeparator,
          unionSeparator,
          includePath
        })
      ).join(issueSeparator);
      if (!acc.includes(newIssues)) {
        acc.push(newIssues);
      }
      return acc;
    }, []).join(unionSeparator);
  }
  if (issue.code === "invalid_arguments") {
    return [
      issue.message,
      ...issue.argumentsError.issues.map(
        (issue2) => getMessageFromZodIssue({
          issue: issue2,
          issueSeparator,
          unionSeparator,
          includePath
        })
      )
    ].join(issueSeparator);
  }
  if (issue.code === "invalid_return_type") {
    return [
      issue.message,
      ...issue.returnTypeError.issues.map(
        (issue2) => getMessageFromZodIssue({
          issue: issue2,
          issueSeparator,
          unionSeparator,
          includePath
        })
      )
    ].join(issueSeparator);
  }
  if (includePath && isNonEmptyArray(issue.path)) {
    if (issue.path.length === 1) {
      const identifier = issue.path[0];
      if (typeof identifier === "number") {
        return `${issue.message} at index ${identifier}`;
      }
    }
    return `${issue.message} at "${joinPath(issue.path)}"`;
  }
  return issue.message;
}
__name(getMessageFromZodIssue, "getMessageFromZodIssue");
function fromZodIssue(issue, options4 = {}) {
  const {
    issueSeparator = ISSUE_SEPARATOR,
    unionSeparator = UNION_SEPARATOR,
    prefixSeparator = PREFIX_SEPARATOR,
    prefix: prefix2 = PREFIX,
    includePath = true
  } = options4;
  const reason = getMessageFromZodIssue({
    issue,
    issueSeparator,
    unionSeparator,
    includePath
  });
  const message3 = prefixMessage(reason, prefix2, prefixSeparator);
  return new ValidationError(message3, { cause: new ZodError([issue]) });
}
__name(fromZodIssue, "fromZodIssue");
var errorMap = /* @__PURE__ */ __name((issue, ctx) => {
  const error2 = fromZodIssue({
    ...issue,
    // fallback to the default error message
    // when issue does not have a message
    message: issue.message ?? ctx.defaultError
  });
  return {
    message: error2.message
  };
}, "errorMap");
function fromZodError(zodError, options4 = {}) {
  if (!isZodErrorLike(zodError)) {
    throw new TypeError(
      `Invalid zodError param; expected instance of ZodError. Did you mean to use the "${fromError.name}" method instead?`
    );
  }
  return fromZodErrorWithoutRuntimeCheck(zodError, options4);
}
__name(fromZodError, "fromZodError");
function fromZodErrorWithoutRuntimeCheck(zodError, options4 = {}) {
  const {
    maxIssuesInMessage = MAX_ISSUES_IN_MESSAGE,
    issueSeparator = ISSUE_SEPARATOR,
    unionSeparator = UNION_SEPARATOR,
    prefixSeparator = PREFIX_SEPARATOR,
    prefix: prefix2 = PREFIX,
    includePath = true
  } = options4;
  const zodIssues = zodError.errors;
  const reason = zodIssues.length === 0 ? zodError.message : zodIssues.slice(0, maxIssuesInMessage).map(
    (issue) => getMessageFromZodIssue({
      issue,
      issueSeparator,
      unionSeparator,
      includePath
    })
  ).join(issueSeparator);
  const message3 = prefixMessage(reason, prefix2, prefixSeparator);
  return new ValidationError(message3, { cause: zodError });
}
__name(fromZodErrorWithoutRuntimeCheck, "fromZodErrorWithoutRuntimeCheck");
var toValidationError = /* @__PURE__ */ __name((options4 = {}) => (err) => {
  if (isZodErrorLike(err)) {
    return fromZodErrorWithoutRuntimeCheck(err, options4);
  }
  if (err instanceof Error) {
    return new ValidationError(err.message, { cause: err });
  }
  return new ValidationError("Unknown error");
}, "toValidationError");
function fromError(err, options4 = {}) {
  return toValidationError(options4)(err);
}
__name(fromError, "fromError");
class LLink {
  static {
    __name(this, "LLink");
  }
  /** Link ID */
  id;
  parentId;
  type;
  /** Output node ID */
  origin_id;
  /** Output slot index */
  origin_slot;
  /** Input node ID */
  target_id;
  /** Input slot index */
  target_slot;
  data;
  _data;
  /** Centre point of the link, calculated during render only - can be inaccurate */
  _pos;
  /** @todo Clean up - never implemented in comfy. */
  _last_time;
  /** The last canvas 2D path that was used to render this link */
  path;
  /** @inheritdoc */
  _centreAngle;
  #color;
  /** Custom colour for this link only */
  get color() {
    return this.#color;
  }
  set color(value4) {
    this.#color = value4 === "" ? null : value4;
  }
  constructor(id3, type, origin_id, origin_slot, target_id, target_slot, parentId) {
    this.id = id3;
    this.type = type;
    this.origin_id = origin_id;
    this.origin_slot = origin_slot;
    this.target_id = target_id;
    this.target_slot = target_slot;
    this.parentId = parentId;
    this._data = null;
    this._pos = new Float32Array(2);
  }
  /** @deprecated Use {@link LLink.create} */
  static createFromArray(data24) {
    return new LLink(data24[0], data24[5], data24[1], data24[2], data24[3], data24[4]);
  }
  /**
   * LLink static factory: creates a new LLink from the provided data.
   * @param data Serialised LLink data to create the link from
   * @returns A new LLink
   */
  static create(data24) {
    return new LLink(
      data24.id,
      data24.type,
      data24.origin_id,
      data24.origin_slot,
      data24.target_id,
      data24.target_slot,
      data24.parentId
    );
  }
  /**
   * Gets all reroutes from the output slot to this segment.  If this segment is a reroute, it will be the last element.
   * @returns An ordered array of all reroutes from the node output to
   * this reroute or the reroute before it.  Otherwise, an empty array.
   */
  static getReroutes(network, linkSegment) {
    return network.reroutes.get(linkSegment.parentId)?.getReroutes() ?? [];
  }
  /**
   * Finds the reroute in the chain after the provided reroute ID.
   * @param network The network this link belongs to
   * @param linkSegment The starting point of the search (input side).
   * Typically the LLink object itself, but can be any link segment.
   * @param rerouteId The matching reroute will have this set as its {@link parentId}.
   * @returns The reroute that was found, `undefined` if no reroute was found, or `null` if an infinite loop was detected.
   */
  static findNextReroute(network, linkSegment, rerouteId) {
    return network.reroutes.get(linkSegment.parentId)?.findNextReroute(rerouteId);
  }
  configure(o) {
    if (Array.isArray(o)) {
      this.id = o[0];
      this.origin_id = o[1];
      this.origin_slot = o[2];
      this.target_id = o[3];
      this.target_slot = o[4];
      this.type = o[5];
    } else {
      this.id = o.id;
      this.type = o.type;
      this.origin_id = o.origin_id;
      this.origin_slot = o.origin_slot;
      this.target_id = o.target_id;
      this.target_slot = o.target_slot;
      this.parentId = o.parentId;
    }
  }
  /**
   * Disconnects a link and removes it from the graph, cleaning up any reroutes that are no longer used
   * @param network The container (LGraph) where reroutes should be updated
   * @param keepReroutes If `true`, reroutes will not be garbage collected.
   */
  disconnect(network, keepReroutes) {
    const reroutes = LLink.getReroutes(network, this);
    for (const reroute of reroutes) {
      reroute.linkIds.delete(this.id);
      if (!keepReroutes && !reroute.linkIds.size)
        network.reroutes.delete(reroute.id);
    }
    network.links.delete(this.id);
  }
  /**
   * @deprecated Prefer {@link LLink.asSerialisable} (returns an object, not an array)
   * @returns An array representing this LLink
   */
  serialize() {
    return [
      this.id,
      this.origin_id,
      this.origin_slot,
      this.target_id,
      this.target_slot,
      this.type
    ];
  }
  asSerialisable() {
    const copy2 = {
      id: this.id,
      origin_id: this.origin_id,
      origin_slot: this.origin_slot,
      target_id: this.target_id,
      target_slot: this.target_slot,
      type: this.type
    };
    if (this.parentId) copy2.parentId = this.parentId;
    return copy2;
  }
}
var NodeSlotType = /* @__PURE__ */ ((NodeSlotType2) => {
  NodeSlotType2[NodeSlotType2["INPUT"] = 1] = "INPUT";
  NodeSlotType2[NodeSlotType2["OUTPUT"] = 2] = "OUTPUT";
  return NodeSlotType2;
})(NodeSlotType || {});
var RenderShape = /* @__PURE__ */ ((RenderShape2) => {
  RenderShape2[RenderShape2["BOX"] = 1] = "BOX";
  RenderShape2[RenderShape2["ROUND"] = 2] = "ROUND";
  RenderShape2[RenderShape2["CIRCLE"] = 3] = "CIRCLE";
  RenderShape2[RenderShape2["CARD"] = 4] = "CARD";
  RenderShape2[RenderShape2["ARROW"] = 5] = "ARROW";
  RenderShape2[RenderShape2["GRID"] = 6] = "GRID";
  RenderShape2[RenderShape2["HollowCircle"] = 7] = "HollowCircle";
  return RenderShape2;
})(RenderShape || {});
var CanvasItem = /* @__PURE__ */ ((CanvasItem2) => {
  CanvasItem2[CanvasItem2["Nothing"] = 0] = "Nothing";
  CanvasItem2[CanvasItem2["Node"] = 1] = "Node";
  CanvasItem2[CanvasItem2["Group"] = 2] = "Group";
  CanvasItem2[CanvasItem2["Reroute"] = 4] = "Reroute";
  CanvasItem2[CanvasItem2["Link"] = 8] = "Link";
  CanvasItem2[CanvasItem2["ResizeSe"] = 16] = "ResizeSe";
  return CanvasItem2;
})(CanvasItem || {});
var LinkDirection = /* @__PURE__ */ ((LinkDirection2) => {
  LinkDirection2[LinkDirection2["NONE"] = 0] = "NONE";
  LinkDirection2[LinkDirection2["UP"] = 1] = "UP";
  LinkDirection2[LinkDirection2["DOWN"] = 2] = "DOWN";
  LinkDirection2[LinkDirection2["LEFT"] = 3] = "LEFT";
  LinkDirection2[LinkDirection2["RIGHT"] = 4] = "RIGHT";
  LinkDirection2[LinkDirection2["CENTER"] = 5] = "CENTER";
  return LinkDirection2;
})(LinkDirection || {});
var LinkRenderType = /* @__PURE__ */ ((LinkRenderType2) => {
  LinkRenderType2[LinkRenderType2["HIDDEN_LINK"] = -1] = "HIDDEN_LINK";
  LinkRenderType2[LinkRenderType2["STRAIGHT_LINK"] = 0] = "STRAIGHT_LINK";
  LinkRenderType2[LinkRenderType2["LINEAR_LINK"] = 1] = "LINEAR_LINK";
  LinkRenderType2[LinkRenderType2["SPLINE_LINK"] = 2] = "SPLINE_LINK";
  return LinkRenderType2;
})(LinkRenderType || {});
var LinkMarkerShape = /* @__PURE__ */ ((LinkMarkerShape2) => {
  LinkMarkerShape2[LinkMarkerShape2["None"] = 0] = "None";
  LinkMarkerShape2[LinkMarkerShape2["Circle"] = 1] = "Circle";
  LinkMarkerShape2[LinkMarkerShape2["Arrow"] = 2] = "Arrow";
  return LinkMarkerShape2;
})(LinkMarkerShape || {});
var TitleMode = /* @__PURE__ */ ((TitleMode2) => {
  TitleMode2[TitleMode2["NORMAL_TITLE"] = 0] = "NORMAL_TITLE";
  TitleMode2[TitleMode2["NO_TITLE"] = 1] = "NO_TITLE";
  TitleMode2[TitleMode2["TRANSPARENT_TITLE"] = 2] = "TRANSPARENT_TITLE";
  TitleMode2[TitleMode2["AUTOHIDE_TITLE"] = 3] = "AUTOHIDE_TITLE";
  return TitleMode2;
})(TitleMode || {});
var LGraphEventMode = /* @__PURE__ */ ((LGraphEventMode2) => {
  LGraphEventMode2[LGraphEventMode2["ALWAYS"] = 0] = "ALWAYS";
  LGraphEventMode2[LGraphEventMode2["ON_EVENT"] = 1] = "ON_EVENT";
  LGraphEventMode2[LGraphEventMode2["NEVER"] = 2] = "NEVER";
  LGraphEventMode2[LGraphEventMode2["ON_TRIGGER"] = 3] = "ON_TRIGGER";
  LGraphEventMode2[LGraphEventMode2["BYPASS"] = 4] = "BYPASS";
  return LGraphEventMode2;
})(LGraphEventMode || {});
var EaseFunction = /* @__PURE__ */ ((EaseFunction2) => {
  EaseFunction2["LINEAR"] = "linear";
  EaseFunction2["EASE_IN_QUAD"] = "easeInQuad";
  EaseFunction2["EASE_OUT_QUAD"] = "easeOutQuad";
  EaseFunction2["EASE_IN_OUT_QUAD"] = "easeInOutQuad";
  return EaseFunction2;
})(EaseFunction || {});
function distance(a, b) {
  return Math.sqrt(
    (b[0] - a[0]) * (b[0] - a[0]) + (b[1] - a[1]) * (b[1] - a[1])
  );
}
__name(distance, "distance");
function dist2(x1, y1, x2, y2) {
  return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
__name(dist2, "dist2");
function isInRectangle(x2, y2, left, top, width2, height) {
  return x2 >= left && x2 < left + width2 && y2 >= top && y2 < top + height;
}
__name(isInRectangle, "isInRectangle");
function isPointInRect(point, rect) {
  return point[0] >= rect[0] && point[0] < rect[0] + rect[2] && point[1] >= rect[1] && point[1] < rect[1] + rect[3];
}
__name(isPointInRect, "isPointInRect");
function isInRect(x2, y2, rect) {
  return x2 >= rect[0] && x2 < rect[0] + rect[2] && y2 >= rect[1] && y2 < rect[1] + rect[3];
}
__name(isInRect, "isInRect");
function isInsideRectangle(x2, y2, left, top, width2, height) {
  return left < x2 && left + width2 > x2 && top < y2 && top + height > y2;
}
__name(isInsideRectangle, "isInsideRectangle");
function isSortaInsideOctagon(x2, y2, radius) {
  const sum = Math.min(radius, Math.abs(x2)) + Math.min(radius, Math.abs(y2));
  return sum < radius * 0.75;
}
__name(isSortaInsideOctagon, "isSortaInsideOctagon");
function overlapBounding(a, b) {
  const aRight = a[0] + a[2];
  const aBottom = a[1] + a[3];
  const bRight = b[0] + b[2];
  const bBottom = b[1] + b[3];
  return a[0] > bRight || a[1] > bBottom || aRight < b[0] || aBottom < b[1] ? false : true;
}
__name(overlapBounding, "overlapBounding");
function containsCentre(a, b) {
  const centreX = b[0] + b[2] * 0.5;
  const centreY = b[1] + b[3] * 0.5;
  return isInRect(centreX, centreY, a);
}
__name(containsCentre, "containsCentre");
function containsRect(a, b) {
  const aRight = a[0] + a[2];
  const aBottom = a[1] + a[3];
  const bRight = b[0] + b[2];
  const bBottom = b[1] + b[3];
  const identical = a[0] === b[0] && a[1] === b[1] && aRight === bRight && aBottom === bBottom;
  return !identical && a[0] <= b[0] && a[1] <= b[1] && aRight >= bRight && aBottom >= bBottom;
}
__name(containsRect, "containsRect");
function findPointOnCurve(out, a, b, controlA, controlB, t2 = 0.5) {
  const iT = 1 - t2;
  const c1 = iT * iT * iT;
  const c2 = 3 * (iT * iT) * t2;
  const c3 = 3 * iT * (t2 * t2);
  const c4 = t2 * t2 * t2;
  out[0] = c1 * a[0] + c2 * controlA[0] + c3 * controlB[0] + c4 * b[0];
  out[1] = c1 * a[1] + c2 * controlA[1] + c3 * controlB[1] + c4 * b[1];
}
__name(findPointOnCurve, "findPointOnCurve");
function createBounds(objects, padding = 10) {
  const bounds = new Float32Array([Infinity, Infinity, -Infinity, -Infinity]);
  for (const obj of objects) {
    const rect = obj.boundingRect;
    bounds[0] = Math.min(bounds[0], rect[0]);
    bounds[1] = Math.min(bounds[1], rect[1]);
    bounds[2] = Math.max(bounds[2], rect[0] + rect[2]);
    bounds[3] = Math.max(bounds[3], rect[1] + rect[3]);
  }
  if (!bounds.every((x2) => isFinite(x2))) return null;
  return [
    bounds[0] - padding,
    bounds[1] - padding,
    bounds[2] - bounds[0] + 2 * padding,
    bounds[3] - bounds[1] + 2 * padding
  ];
}
__name(createBounds, "createBounds");
function snapPoint(pos2, snapTo) {
  if (!snapTo) return false;
  pos2[0] = snapTo * Math.round(pos2[0] / snapTo);
  pos2[1] = snapTo * Math.round(pos2[1] / snapTo);
  return true;
}
__name(snapPoint, "snapPoint");
class Reroute {
  static {
    __name(this, "Reroute");
  }
  /**
   * Initialises a new link reroute object.
   * @param id Unique identifier for this reroute
   * @param network The network of links this reroute belongs to.  Internally converted to a WeakRef.
   * @param pos Position in graph coordinates
   * @param linkIds Link IDs ({@link LLink.id}) of all links that use this reroute
   */
  constructor(id3, network, pos2, parentId, linkIds) {
    this.id = id3;
    this.#network = new WeakRef(network);
    this.update(parentId, pos2, linkIds);
    this.linkIds ??= /* @__PURE__ */ new Set();
  }
  static radius = 10;
  #malloc = new Float32Array(8);
  /** The network this reroute belongs to.  Contains all valid links and reroutes. */
  #network;
  #parentId;
  /** @inheritdoc */
  get parentId() {
    return this.#parentId;
  }
  /** Ignores attempts to create an infinite loop. @inheritdoc */
  set parentId(value4) {
    if (value4 === this.id) return;
    if (this.getReroutes() === null) return;
    this.#parentId = value4;
  }
  #pos = this.#malloc.subarray(0, 2);
  /** @inheritdoc */
  get pos() {
    return this.#pos;
  }
  set pos(value4) {
    if (!(value4?.length >= 2))
      throw new TypeError("Reroute.pos is an x,y point, and expects an indexable with at least two values.");
    this.#pos[0] = value4[0];
    this.#pos[1] = value4[1];
  }
  /** @inheritdoc */
  get boundingRect() {
    const { radius } = Reroute;
    const [x2, y2] = this.#pos;
    return [x2 - radius, y2 - radius, 2 * radius, 2 * radius];
  }
  /** @inheritdoc */
  selected;
  /** The ID ({@link LLink.id}) of every link using this reroute */
  linkIds;
  /** The averaged angle of every link through this reroute. */
  otherAngle = 0;
  /** Cached cos */
  cos = 0;
  sin = 0;
  /** Bezier curve control point for the "target" (input) side of the link */
  controlPoint = this.#malloc.subarray(4, 6);
  /** @inheritdoc */
  path;
  /** @inheritdoc */
  _centreAngle;
  /** @inheritdoc */
  _pos = this.#malloc.subarray(6, 8);
  /** Colour of the first link that rendered this reroute */
  _colour;
  /**
   * Used to ensure reroute angles are only executed once per frame.
   * @todo Calculate on change instead.
   */
  #lastRenderTime = -Infinity;
  #buffer = this.#malloc.subarray(2, 4);
  /** @inheritdoc */
  get origin_id() {
    return this.#network.deref()?.links.get(this.linkIds.values().next().value)?.origin_id;
  }
  /** @inheritdoc */
  get origin_slot() {
    return this.#network.deref()?.links.get(this.linkIds.values().next().value)?.origin_slot;
  }
  /**
   * Applies a new parentId to the reroute, and optinoally a new position and linkId.
   * Primarily used for deserialisation.
   * @param parentId The ID of the reroute prior to this reroute, or
   * `undefined` if it is the first reroute connected to a nodes output
   * @param pos The position of this reroute
   * @param linkIds All link IDs that pass through this reroute
   */
  update(parentId, pos2, linkIds) {
    this.parentId = parentId;
    if (pos2) this.pos = pos2;
    if (linkIds) this.linkIds = new Set(linkIds);
  }
  /**
   * Validates the linkIds this reroute has.  Removes broken links.
   * @param links Collection of valid links
   * @returns true if any links remain after validation
   */
  validateLinks(links) {
    const { linkIds } = this;
    for (const linkId of linkIds) {
      if (!links.get(linkId)) linkIds.delete(linkId);
    }
    return linkIds.size > 0;
  }
  /**
   * Retrieves an ordered array of all reroutes from the node output.
   * @param visited Internal.  A set of reroutes that this function
   * has already visited whilst recursing up the chain.
   * @returns An ordered array of all reroutes from the node output to this reroute, inclusive.
   * `null` if an infinite loop is detected.
   * `undefined` if the reroute chain or {@link LinkNetwork} are invalid.
   */
  getReroutes(visited = /* @__PURE__ */ new Set()) {
    if (this.#parentId === void 0) return [this];
    if (visited.has(this)) return null;
    visited.add(this);
    const parent = this.#network.deref()?.reroutes.get(this.#parentId);
    if (!parent) {
      this.#parentId = void 0;
      return [this];
    }
    const reroutes = parent.getReroutes(visited);
    reroutes?.push(this);
    return reroutes;
  }
  /**
   * Internal.  Called by {@link LLink.findNextReroute}.  Not intended for use by itself.
   * @param withParentId The rerouteId to look for
   * @param visited A set of reroutes that have already been visited
   * @returns The reroute that was found, `undefined` if no reroute was found, or `null` if an infinite loop was detected.
   */
  findNextReroute(withParentId, visited = /* @__PURE__ */ new Set()) {
    if (this.#parentId === withParentId) return this;
    if (visited.has(this)) return null;
    visited.add(this);
    return this.#network.deref()?.reroutes.get(this.#parentId)?.findNextReroute(withParentId, visited);
  }
  /** @inheritdoc */
  move(deltaX, deltaY) {
    this.#pos[0] += deltaX;
    this.#pos[1] += deltaY;
  }
  /** @inheritdoc */
  snapToGrid(snapTo) {
    if (!snapTo) return false;
    const { pos: pos2 } = this;
    pos2[0] = snapTo * Math.round(pos2[0] / snapTo);
    pos2[1] = snapTo * Math.round(pos2[1] / snapTo);
    return true;
  }
  calculateAngle(lastRenderTime, network, linkStart) {
    if (!(lastRenderTime > this.#lastRenderTime)) return;
    this.#lastRenderTime = lastRenderTime;
    const { links } = network;
    const { linkIds, id: id3 } = this;
    const angles = [];
    let sum = 0;
    for (const linkId of linkIds) {
      const link2 = links.get(linkId);
      if (!link2) continue;
      const pos2 = LLink.findNextReroute(network, link2, id3)?.pos ?? network.getNodeById(link2.target_id)?.getConnectionPos(true, link2.target_slot, this.#buffer);
      if (!pos2) continue;
      const angle = Math.atan2(pos2[1] - this.#pos[1], pos2[0] - this.#pos[0]);
      angles.push(angle);
      sum += angle;
    }
    if (!angles.length) return;
    sum /= angles.length;
    const originToReroute = Math.atan2(
      this.#pos[1] - linkStart[1],
      this.#pos[0] - linkStart[0]
    );
    let diff2 = (originToReroute - sum) * 0.5;
    if (Math.abs(diff2) > Math.PI * 0.5) diff2 += Math.PI;
    const dist3 = Math.min(80, distance(linkStart, this.#pos) * 0.25);
    const originDiff = originToReroute - diff2;
    const cos = Math.cos(originDiff);
    const sin = Math.sin(originDiff);
    this.otherAngle = originDiff;
    this.cos = cos;
    this.sin = sin;
    this.controlPoint[0] = dist3 * -cos;
    this.controlPoint[1] = dist3 * -sin;
    return;
  }
  /**
   * Renders the reroute on the canvas.
   * @param ctx Canvas context to draw on
   * @remarks Leaves {@link ctx}.fillStyle, strokeStyle, and lineWidth dirty (perf.).
   */
  draw(ctx) {
    const { pos: pos2 } = this;
    ctx.fillStyle = this._colour;
    ctx.beginPath();
    ctx.arc(pos2[0], pos2[1], Reroute.radius, 0, 2 * Math.PI);
    ctx.fill();
    ctx.lineWidth = Reroute.radius * 0.1;
    ctx.strokeStyle = "rgb(0,0,0,0.5)";
    ctx.stroke();
    ctx.fillStyle = "#ffffff55";
    ctx.strokeStyle = "rgb(0,0,0,0.3)";
    ctx.beginPath();
    ctx.arc(pos2[0], pos2[1], Reroute.radius * 0.8, 0, 2 * Math.PI);
    ctx.fill();
    ctx.stroke();
    if (this.selected) {
      ctx.strokeStyle = "#fff";
      ctx.beginPath();
      ctx.arc(pos2[0], pos2[1], Reroute.radius * 1.2, 0, 2 * Math.PI);
      ctx.stroke();
    }
  }
  /** @inheritdoc */
  asSerialisable() {
    return {
      id: this.id,
      parentId: this.parentId,
      pos: [this.pos[0], this.pos[1]],
      linkIds: [...this.linkIds]
    };
  }
}
var BadgePosition = /* @__PURE__ */ ((BadgePosition2) => {
  BadgePosition2["TopLeft"] = "top-left";
  BadgePosition2["TopRight"] = "top-right";
  return BadgePosition2;
})(BadgePosition || {});
class LGraphBadge {
  static {
    __name(this, "LGraphBadge");
  }
  text;
  fgColor;
  bgColor;
  fontSize;
  padding;
  height;
  cornerRadius;
  constructor({
    text: text2,
    fgColor = "white",
    bgColor = "#0F1F0F",
    fontSize = 12,
    padding = 6,
    height = 20,
    cornerRadius = 5
  }) {
    this.text = text2;
    this.fgColor = fgColor;
    this.bgColor = bgColor;
    this.fontSize = fontSize;
    this.padding = padding;
    this.height = height;
    this.cornerRadius = cornerRadius;
  }
  get visible() {
    return this.text.length > 0;
  }
  getWidth(ctx) {
    if (!this.visible) return 0;
    const { font } = ctx;
    ctx.font = `${this.fontSize}px sans-serif`;
    const textWidth = ctx.measureText(this.text).width;
    ctx.font = font;
    return textWidth + this.padding * 2;
  }
  draw(ctx, x2, y2) {
    if (!this.visible) return;
    const { fillStyle } = ctx;
    ctx.font = `${this.fontSize}px sans-serif`;
    const badgeWidth = this.getWidth(ctx);
    const badgeX = 0;
    ctx.fillStyle = this.bgColor;
    ctx.beginPath();
    if (ctx.roundRect) {
      ctx.roundRect(x2 + badgeX, y2, badgeWidth, this.height, this.cornerRadius);
    } else {
      ctx.rect(x2 + badgeX, y2, badgeWidth, this.height);
    }
    ctx.fill();
    ctx.fillStyle = this.fgColor;
    ctx.fillText(
      this.text,
      x2 + badgeX + this.padding,
      y2 + this.height - this.padding
    );
    ctx.fillStyle = fillStyle;
  }
}
class LGraphNode {
  static {
    __name(this, "LGraphNode");
  }
  // Static properties used by dynamic child classes
  static title;
  static MAX_CONSOLE;
  static type;
  static category;
  static supported_extensions;
  static filter;
  static skip_list;
  /** Default setting for {@link LGraphNode.connectInputToOutput}. @see {@link INodeFlags.keepAllLinksOnBypass} */
  static keepAllLinksOnBypass = false;
  title;
  graph = null;
  id;
  type = null;
  inputs = [];
  outputs = [];
  // Not used
  connections = [];
  properties = {};
  properties_info = [];
  flags = {};
  widgets;
  locked;
  // Execution order, automatically computed during run
  order;
  mode;
  last_serialization;
  serialize_widgets;
  color;
  bgcolor;
  boxcolor;
  exec_version;
  action_call;
  execute_triggered;
  action_triggered;
  widgets_up;
  widgets_start_y;
  lostFocusAt;
  gotFocusAt;
  badges = [];
  badgePosition = BadgePosition.TopLeft;
  _collapsed_width;
  horizontal;
  console;
  _level;
  _shape;
  subgraph;
  skip_subgraph_button;
  mouseOver;
  redraw_on_mouse;
  // Appears unused
  optional_inputs;
  // Appears unused
  optional_outputs;
  resizable;
  clonable;
  _relative_id;
  clip_area;
  ignore_remove;
  has_errors;
  removable;
  block_delete;
  selected;
  showAdvanced;
  /** @inheritdoc {@link renderArea} */
  #renderArea = new Float32Array(4);
  /**
   * Rect describing the node area, including shadows and any protrusions.
   * Determines if the node is visible.  Calculated once at the start of every frame.
   */
  get renderArea() {
    return this.#renderArea;
  }
  /** @inheritdoc {@link boundingRect} */
  #boundingRect = new Float32Array(4);
  /**
   * Cached node position & area as `x, y, width, height`.  Includes changes made by {@link onBounding}, if present.
   *
   * Determines the node hitbox and other rendering effects.  Calculated once at the start of every frame.
   */
  get boundingRect() {
    return this.#boundingRect;
  }
  /** {@link pos} and {@link size} values are backed by this {@link Rect}. */
  _posSize = new Float32Array(4);
  _pos = this._posSize.subarray(0, 2);
  _size = this._posSize.subarray(2, 4);
  get pos() {
    return this._pos;
  }
  set pos(value4) {
    if (!value4 || value4.length < 2) return;
    this._pos[0] = value4[0];
    this._pos[1] = value4[1];
  }
  get size() {
    return this._size;
  }
  set size(value4) {
    if (!value4 || value4.length < 2) return;
    this._size[0] = value4[0];
    this._size[1] = value4[1];
  }
  get shape() {
    return this._shape;
  }
  set shape(v2) {
    switch (v2) {
      case "default":
        delete this._shape;
        break;
      case "box":
        this._shape = RenderShape.BOX;
        break;
      case "round":
        this._shape = RenderShape.ROUND;
        break;
      case "circle":
        this._shape = RenderShape.CIRCLE;
        break;
      case "card":
        this._shape = RenderShape.CARD;
        break;
      default:
        this._shape = v2;
    }
  }
  get is_selected() {
    return this.selected;
  }
  set is_selected(value4) {
    this.selected = value4;
  }
  constructor(title) {
    this.id = LiteGraph.use_uuids ? LiteGraph.uuidv4() : -1;
    this.title = title || "Unnamed";
    this.size = [LiteGraph.NODE_WIDTH, 60];
    this.pos = [10, 10];
  }
  /**
   * configure a node from an object containing the serialized info
   */
  configure(info) {
    if (this.graph) {
      this.graph._version++;
    }
    for (const j in info) {
      if (j == "properties") {
        for (const k in info.properties) {
          this.properties[k] = info.properties[k];
          this.onPropertyChanged?.(k, info.properties[k]);
        }
        continue;
      }
      if (info[j] == null) {
        continue;
      } else if (typeof info[j] == "object") {
        if (this[j]?.configure) {
          this[j]?.configure(info[j]);
        } else {
          this[j] = LiteGraph.cloneObject(info[j], this[j]);
        }
      } else {
        this[j] = info[j];
      }
    }
    if (!info.title) {
      this.title = this.constructor.title;
    }
    if (this.inputs) {
      for (let i2 = 0; i2 < this.inputs.length; ++i2) {
        const input = this.inputs[i2];
        const link2 = this.graph ? this.graph._links.get(input.link) : null;
        this.onConnectionsChange?.(NodeSlotType.INPUT, i2, true, link2, input);
        this.onInputAdded?.(input);
      }
    }
    if (this.outputs) {
      for (let i2 = 0; i2 < this.outputs.length; ++i2) {
        const output = this.outputs[i2];
        if (!output.links) {
          continue;
        }
        for (let j = 0; j < output.links.length; ++j) {
          const link2 = this.graph ? this.graph._links.get(output.links[j]) : null;
          this.onConnectionsChange?.(NodeSlotType.OUTPUT, i2, true, link2, output);
        }
        this.onOutputAdded?.(output);
      }
    }
    if (this.widgets) {
      for (let i2 = 0; i2 < this.widgets.length; ++i2) {
        const w = this.widgets[i2];
        if (!w) continue;
        if (w.options?.property && this.properties[w.options.property] != void 0)
          w.value = JSON.parse(JSON.stringify(this.properties[w.options.property]));
      }
      if (info.widgets_values) {
        for (let i2 = 0; i2 < info.widgets_values.length; ++i2) {
          if (this.widgets[i2]) {
            this.widgets[i2].value = info.widgets_values[i2];
          }
        }
      }
    }
    if (this.pinned) this.pin(true);
    this.onConfigure?.(info);
  }
  /**
   * serialize the content
   */
  serialize() {
    const o = {
      id: this.id,
      type: this.type,
      pos: [this.pos[0], this.pos[1]],
      size: [this.size[0], this.size[1]],
      flags: LiteGraph.cloneObject(this.flags),
      order: this.order,
      mode: this.mode,
      showAdvanced: this.showAdvanced
    };
    if (this.constructor === LGraphNode && this.last_serialization)
      return this.last_serialization;
    if (this.inputs) o.inputs = this.inputs;
    if (this.outputs) {
      for (let i2 = 0; i2 < this.outputs.length; i2++) {
        delete this.outputs[i2]._data;
      }
      o.outputs = this.outputs;
    }
    if (this.title && this.title != this.constructor.title) o.title = this.title;
    if (this.properties) o.properties = LiteGraph.cloneObject(this.properties);
    if (this.widgets && this.serialize_widgets) {
      o.widgets_values = [];
      for (let i2 = 0; i2 < this.widgets.length; ++i2) {
        if (this.widgets[i2])
          o.widgets_values[i2] = this.widgets[i2].value;
        else
          o.widgets_values[i2] = null;
      }
    }
    if (!o.type) o.type = this.constructor.type;
    if (this.color) o.color = this.color;
    if (this.bgcolor) o.bgcolor = this.bgcolor;
    if (this.boxcolor) o.boxcolor = this.boxcolor;
    if (this.shape) o.shape = this.shape;
    if (this.onSerialize?.(o)) console.warn("node onSerialize shouldnt return anything, data should be stored in the object pass in the first parameter");
    return o;
  }
  /* Creates a clone of this node */
  clone() {
    const node22 = LiteGraph.createNode(this.type);
    if (!node22) return null;
    const data24 = LiteGraph.cloneObject(this.serialize());
    if (data24.inputs) {
      for (let i2 = 0; i2 < data24.inputs.length; ++i2) {
        data24.inputs[i2].link = null;
      }
    }
    if (data24.outputs) {
      for (let i2 = 0; i2 < data24.outputs.length; ++i2) {
        if (data24.outputs[i2].links) {
          data24.outputs[i2].links.length = 0;
        }
      }
    }
    delete data24.id;
    if (LiteGraph.use_uuids) data24.id = LiteGraph.uuidv4();
    node22.configure(data24);
    return node22;
  }
  /**
   * serialize and stringify
   */
  toString() {
    return JSON.stringify(this.serialize());
  }
  /**
   * get the title string
   */
  getTitle() {
    return this.title || this.constructor.title;
  }
  /**
   * sets the value of a property
   * @param name
   * @param value
   */
  setProperty(name2, value4) {
    this.properties ||= {};
    if (value4 === this.properties[name2]) return;
    const prev_value = this.properties[name2];
    this.properties[name2] = value4;
    if (this.onPropertyChanged?.(name2, value4, prev_value) === false)
      this.properties[name2] = prev_value;
    if (this.widgets) {
      for (let i2 = 0; i2 < this.widgets.length; ++i2) {
        const w = this.widgets[i2];
        if (!w) continue;
        if (w.options.property == name2) {
          w.value = value4;
          break;
        }
      }
    }
  }
  /**
   * sets the output data
   * @param slot
   * @param data
   */
  setOutputData(slot, data24) {
    if (!this.outputs) return;
    if (slot == -1 || slot >= this.outputs.length) return;
    const output_info = this.outputs[slot];
    if (!output_info) return;
    output_info._data = data24;
    if (this.outputs[slot].links) {
      for (let i2 = 0; i2 < this.outputs[slot].links.length; i2++) {
        const link_id = this.outputs[slot].links[i2];
        const link2 = this.graph._links.get(link_id);
        if (link2) link2.data = data24;
      }
    }
  }
  /**
   * sets the output data type, useful when you want to be able to overwrite the data type
   */
  setOutputDataType(slot, type) {
    if (!this.outputs) return;
    if (slot == -1 || slot >= this.outputs.length) return;
    const output_info = this.outputs[slot];
    if (!output_info) return;
    output_info.type = type;
    if (this.outputs[slot].links) {
      for (let i2 = 0; i2 < this.outputs[slot].links.length; i2++) {
        const link_id = this.outputs[slot].links[i2];
        this.graph._links.get(link_id).type = type;
      }
    }
  }
  /**
   * Retrieves the input data (data traveling through the connection) from one slot
   * @param slot
   * @param force_update if set to true it will force the connected node of this slot to output data into this link
   * @returns data or if it is not connected returns undefined
   */
  getInputData(slot, force_update) {
    if (!this.inputs) return;
    if (slot >= this.inputs.length || this.inputs[slot].link == null) return;
    const link_id = this.inputs[slot].link;
    const link2 = this.graph._links.get(link_id);
    if (!link2) return null;
    if (!force_update) return link2.data;
    const node22 = this.graph.getNodeById(link2.origin_id);
    if (!node22) return link2.data;
    if (node22.updateOutputData) {
      node22.updateOutputData(link2.origin_slot);
    } else {
      node22.onExecute?.();
    }
    return link2.data;
  }
  /**
   * Retrieves the input data type (in case this supports multiple input types)
   * @param slot
   * @returns datatype in string format
   */
  getInputDataType(slot) {
    if (!this.inputs) return null;
    if (slot >= this.inputs.length || this.inputs[slot].link == null) return null;
    const link_id = this.inputs[slot].link;
    const link2 = this.graph._links.get(link_id);
    if (!link2) return null;
    const node22 = this.graph.getNodeById(link2.origin_id);
    if (!node22) return link2.type;
    const output_info = node22.outputs[link2.origin_slot];
    return output_info ? output_info.type : null;
  }
  /**
   * Retrieves the input data from one slot using its name instead of slot number
   * @param slot_name
   * @param force_update if set to true it will force the connected node of this slot to output data into this link
   * @returns data or if it is not connected returns null
   */
  getInputDataByName(slot_name, force_update) {
    const slot = this.findInputSlot(slot_name);
    return slot == -1 ? null : this.getInputData(slot, force_update);
  }
  /**
   * tells you if there is a connection in one input slot
   * @param slot The 0-based index of the input to check
   * @returns `true` if the input slot has a link ID (does not perform validation)
   */
  isInputConnected(slot) {
    if (!this.inputs) return false;
    return slot < this.inputs.length && this.inputs[slot].link != null;
  }
  /**
   * tells you info about an input connection (which node, type, etc)
   * @returns object or null { link: id, name: string, type: string or 0 }
   */
  getInputInfo(slot) {
    return !this.inputs || !(slot < this.inputs.length) ? null : this.inputs[slot];
  }
  /**
   * Returns the link info in the connection of an input slot
   * @returns object or null
   */
  getInputLink(slot) {
    if (!this.inputs) return null;
    if (slot < this.inputs.length) {
      const slot_info = this.inputs[slot];
      return this.graph._links.get(slot_info.link);
    }
    return null;
  }
  /**
   * returns the node connected in the input slot
   * @returns node or null
   */
  getInputNode(slot) {
    if (!this.inputs) return null;
    if (slot >= this.inputs.length) return null;
    const input = this.inputs[slot];
    if (!input || input.link === null) return null;
    const link_info = this.graph._links.get(input.link);
    if (!link_info) return null;
    return this.graph.getNodeById(link_info.origin_id);
  }
  /**
   * returns the value of an input with this name, otherwise checks if there is a property with that name
   * @returns value
   */
  getInputOrProperty(name2) {
    if (!this.inputs || !this.inputs.length) {
      return this.properties ? this.properties[name2] : null;
    }
    for (let i2 = 0, l = this.inputs.length; i2 < l; ++i2) {
      const input_info = this.inputs[i2];
      if (name2 == input_info.name && input_info.link != null) {
        const link2 = this.graph._links.get(input_info.link);
        if (link2) return link2.data;
      }
    }
    return this.properties[name2];
  }
  /**
   * tells you the last output data that went in that slot
   * @returns object or null
   */
  getOutputData(slot) {
    if (!this.outputs) return null;
    if (slot >= this.outputs.length) return null;
    const info = this.outputs[slot];
    return info._data;
  }
  /**
   * tells you info about an output connection (which node, type, etc)
   * @returns object or null { name: string, type: string, links: [ ids of links in number ] }
   */
  getOutputInfo(slot) {
    return !this.outputs || !(slot < this.outputs.length) ? null : this.outputs[slot];
  }
  /**
   * tells you if there is a connection in one output slot
   */
  isOutputConnected(slot) {
    if (!this.outputs) return false;
    return slot < this.outputs.length && this.outputs[slot].links?.length > 0;
  }
  /**
   * tells you if there is any connection in the output slots
   */
  isAnyOutputConnected() {
    if (!this.outputs) return false;
    for (let i2 = 0; i2 < this.outputs.length; ++i2) {
      if (this.outputs[i2].links && this.outputs[i2].links.length) {
        return true;
      }
    }
    return false;
  }
  /**
   * retrieves all the nodes connected to this output slot
   */
  getOutputNodes(slot) {
    if (!this.outputs || this.outputs.length == 0) return null;
    if (slot >= this.outputs.length) return null;
    const output = this.outputs[slot];
    if (!output.links || output.links.length == 0) return null;
    const r = [];
    for (let i2 = 0; i2 < output.links.length; i2++) {
      const link_id = output.links[i2];
      const link2 = this.graph._links.get(link_id);
      if (link2) {
        const target_node = this.graph.getNodeById(link2.target_id);
        if (target_node) {
          r.push(target_node);
        }
      }
    }
    return r;
  }
  addOnTriggerInput() {
    const trigS = this.findInputSlot("onTrigger");
    if (trigS == -1) {
      this.addInput("onTrigger", LiteGraph.EVENT, {
        optional: true,
        nameLocked: true
      });
      return this.findInputSlot("onTrigger");
    }
    return trigS;
  }
  addOnExecutedOutput() {
    const trigS = this.findOutputSlot("onExecuted");
    if (trigS == -1) {
      this.addOutput("onExecuted", LiteGraph.ACTION, {
        optional: true,
        nameLocked: true
      });
      return this.findOutputSlot("onExecuted");
    }
    return trigS;
  }
  onAfterExecuteNode(param, options4) {
    const trigS = this.findOutputSlot("onExecuted");
    if (trigS != -1) {
      this.triggerSlot(trigS, param, null, options4);
    }
  }
  changeMode(modeTo) {
    switch (modeTo) {
      case LGraphEventMode.ON_EVENT:
        break;
      case LGraphEventMode.ON_TRIGGER:
        this.addOnTriggerInput();
        this.addOnExecutedOutput();
        break;
      case LGraphEventMode.NEVER:
        break;
      case LGraphEventMode.ALWAYS:
        break;
      case LiteGraph.ON_REQUEST:
        break;
      default:
        return false;
    }
    this.mode = modeTo;
    return true;
  }
  /**
   * Triggers the node code execution, place a boolean/counter to mark the node as being executed
   */
  doExecute(param, options4) {
    options4 = options4 || {};
    if (this.onExecute) {
      options4.action_call ||= this.id + "_exec_" + Math.floor(Math.random() * 9999);
      this.graph.nodes_executing[this.id] = true;
      this.onExecute(param, options4);
      this.graph.nodes_executing[this.id] = false;
      this.exec_version = this.graph.iteration;
      if (options4?.action_call) {
        this.action_call = options4.action_call;
        this.graph.nodes_executedAction[this.id] = options4.action_call;
      }
    }
    this.execute_triggered = 2;
    this.onAfterExecuteNode?.(param, options4);
  }
  /**
   * Triggers an action, wrapped by logics to control execution flow
   * @param action name
   */
  actionDo(action, param, options4) {
    options4 = options4 || {};
    if (this.onAction) {
      options4.action_call ||= this.id + "_" + (action ? action : "action") + "_" + Math.floor(Math.random() * 9999);
      this.graph.nodes_actioning[this.id] = action ? action : "actioning";
      this.onAction(action, param, options4);
      this.graph.nodes_actioning[this.id] = false;
      if (options4?.action_call) {
        this.action_call = options4.action_call;
        this.graph.nodes_executedAction[this.id] = options4.action_call;
      }
    }
    this.action_triggered = 2;
    this.onAfterExecuteNode?.(param, options4);
  }
  /**
   * Triggers an event in this node, this will trigger any output with the same name
   * @param action name ( "on_play", ... ) if action is equivalent to false then the event is send to all
   */
  trigger(action, param, options4) {
    if (!this.outputs || !this.outputs.length) {
      return;
    }
    if (this.graph) this.graph._last_trigger_time = LiteGraph.getTime();
    for (let i2 = 0; i2 < this.outputs.length; ++i2) {
      const output = this.outputs[i2];
      if (!output || output.type !== LiteGraph.EVENT || action && output.name != action)
        continue;
      this.triggerSlot(i2, param, null, options4);
    }
  }
  /**
   * Triggers a slot event in this node: cycle output slots and launch execute/action on connected nodes
   * @param slot the index of the output slot
   * @param link_id [optional] in case you want to trigger and specific output link in a slot
   */
  triggerSlot(slot, param, link_id, options4) {
    options4 = options4 || {};
    if (!this.outputs) return;
    if (slot == null) {
      console.error("slot must be a number");
      return;
    }
    if (typeof slot !== "number")
      console.warn("slot must be a number, use node.trigger('name') if you want to use a string");
    const output = this.outputs[slot];
    if (!output) return;
    const links = output.links;
    if (!links || !links.length) return;
    if (this.graph) this.graph._last_trigger_time = LiteGraph.getTime();
    for (let k = 0; k < links.length; ++k) {
      const id3 = links[k];
      if (link_id != null && link_id != id3) continue;
      const link_info = this.graph._links.get(id3);
      if (!link_info) continue;
      link_info._last_time = LiteGraph.getTime();
      const node22 = this.graph.getNodeById(link_info.target_id);
      if (!node22) continue;
      if (node22.mode === LGraphEventMode.ON_TRIGGER) {
        if (!options4.action_call)
          options4.action_call = this.id + "_trigg_" + Math.floor(Math.random() * 9999);
        node22.doExecute?.(param, options4);
      } else if (node22.onAction) {
        if (!options4.action_call)
          options4.action_call = this.id + "_act_" + Math.floor(Math.random() * 9999);
        const target_connection = node22.inputs[link_info.target_slot];
        node22.actionDo(target_connection.name, param, options4);
      }
    }
  }
  /**
   * clears the trigger slot animation
   * @param slot the index of the output slot
   * @param link_id [optional] in case you want to trigger and specific output link in a slot
   */
  clearTriggeredSlot(slot, link_id) {
    if (!this.outputs) return;
    const output = this.outputs[slot];
    if (!output) return;
    const links = output.links;
    if (!links || !links.length) return;
    for (let k = 0; k < links.length; ++k) {
      const id3 = links[k];
      if (link_id != null && link_id != id3) continue;
      const link_info = this.graph._links.get(id3);
      if (!link_info) continue;
      link_info._last_time = 0;
    }
  }
  /**
   * changes node size and triggers callback
   */
  setSize(size2) {
    this.size = size2;
    this.onResize?.(this.size);
  }
  /**
   * add a new property to this node
   * @param type string defining the output type ("vec3","number",...)
   * @param extra_info this can be used to have special properties of the property (like values, etc)
   */
  addProperty(name2, default_value, type, extra_info) {
    const o = {
      name: name2,
      type,
      default_value
    };
    if (extra_info) {
      for (const i2 in extra_info) {
        o[i2] = extra_info[i2];
      }
    }
    this.properties_info ||= [];
    this.properties_info.push(o);
    this.properties ||= {};
    this.properties[name2] = default_value;
    return o;
  }
  /**
   * add a new output slot to use in this node
   * @param type string defining the output type ("vec3","number",...)
   * @param extra_info this can be used to have special properties of an output (label, special color, position, etc)
   */
  addOutput(name2, type, extra_info) {
    const output = { name: name2, type, links: null };
    if (extra_info) {
      for (const i2 in extra_info) {
        output[i2] = extra_info[i2];
      }
    }
    this.outputs ||= [];
    this.outputs.push(output);
    this.onOutputAdded?.(output);
    if (LiteGraph.auto_load_slot_types)
      LiteGraph.registerNodeAndSlotType(this, type, true);
    this.setSize(this.computeSize());
    this.setDirtyCanvas(true, true);
    return output;
  }
  /**
   * add a new output slot to use in this node
   * @param array of triplets like [[name,type,extra_info],[...]]
   */
  addOutputs(array) {
    for (let i2 = 0; i2 < array.length; ++i2) {
      const info = array[i2];
      const o = { name: info[0], type: info[1], links: null };
      if (array[2]) {
        for (const j in info[2]) {
          o[j] = info[2][j];
        }
      }
      this.outputs ||= [];
      this.outputs.push(o);
      this.onOutputAdded?.(o);
      if (LiteGraph.auto_load_slot_types)
        LiteGraph.registerNodeAndSlotType(this, info[1], true);
    }
    this.setSize(this.computeSize());
    this.setDirtyCanvas(true, true);
  }
  /**
   * remove an existing output slot
   */
  removeOutput(slot) {
    this.disconnectOutput(slot);
    this.outputs.splice(slot, 1);
    for (let i2 = slot; i2 < this.outputs.length; ++i2) {
      if (!this.outputs[i2] || !this.outputs[i2].links) continue;
      const links = this.outputs[i2].links;
      for (let j = 0; j < links.length; ++j) {
        const link2 = this.graph._links.get(links[j]);
        if (!link2) continue;
        link2.origin_slot -= 1;
      }
    }
    this.setSize(this.computeSize());
    this.onOutputRemoved?.(slot);
    this.setDirtyCanvas(true, true);
  }
  /**
   * add a new input slot to use in this node
   * @param type string defining the input type ("vec3","number",...), it its a generic one use 0
   * @param extra_info this can be used to have special properties of an input (label, color, position, etc)
   */
  addInput(name2, type, extra_info) {
    type = type || 0;
    const input = { name: name2, type, link: null };
    if (extra_info) {
      for (const i2 in extra_info) {
        input[i2] = extra_info[i2];
      }
    }
    this.inputs ||= [];
    this.inputs.push(input);
    this.setSize(this.computeSize());
    this.onInputAdded?.(input);
    LiteGraph.registerNodeAndSlotType(this, type);
    this.setDirtyCanvas(true, true);
    return input;
  }
  /**
   * add several new input slots in this node
   * @param array of triplets like [[name,type,extra_info],[...]]
   */
  addInputs(array) {
    for (let i2 = 0; i2 < array.length; ++i2) {
      const info = array[i2];
      const o = { name: info[0], type: info[1], link: null };
      if (array[2]) {
        for (const j in info[2]) {
          o[j] = info[2][j];
        }
      }
      this.inputs ||= [];
      this.inputs.push(o);
      this.onInputAdded?.(o);
      LiteGraph.registerNodeAndSlotType(this, info[1]);
    }
    this.setSize(this.computeSize());
    this.setDirtyCanvas(true, true);
  }
  /**
   * remove an existing input slot
   */
  removeInput(slot) {
    this.disconnectInput(slot);
    const slot_info = this.inputs.splice(slot, 1);
    for (let i2 = slot; i2 < this.inputs.length; ++i2) {
      if (!this.inputs[i2]) continue;
      const link2 = this.graph._links.get(this.inputs[i2].link);
      if (!link2) continue;
      link2.target_slot -= 1;
    }
    this.setSize(this.computeSize());
    this.onInputRemoved?.(slot, slot_info[0]);
    this.setDirtyCanvas(true, true);
  }
  /**
   * add an special connection to this node (used for special kinds of graphs)
   * @param type string defining the input type ("vec3","number",...)
   * @param pos position of the connection inside the node
   * @param direction if is input or output
   */
  addConnection(name2, type, pos2, direction) {
    const o = {
      name: name2,
      type,
      pos: pos2,
      direction,
      links: null
    };
    this.connections.push(o);
    return o;
  }
  /**
   * computes the minimum size of a node according to its inputs and output slots
   * @returns the total size
   */
  computeSize(out) {
    const ctorSize = this.constructor.size;
    if (ctorSize) return [ctorSize[0], ctorSize[1]];
    let rows = Math.max(
      this.inputs ? this.inputs.length : 1,
      this.outputs ? this.outputs.length : 1
    );
    const size2 = out || new Float32Array([0, 0]);
    rows = Math.max(rows, 1);
    const font_size = LiteGraph.NODE_TEXT_SIZE;
    const title_width = compute_text_size(this.title);
    let input_width = 0;
    let output_width = 0;
    if (this.inputs) {
      for (let i2 = 0, l = this.inputs.length; i2 < l; ++i2) {
        const input = this.inputs[i2];
        const text2 = input.label || input.localized_name || input.name || "";
        const text_width = compute_text_size(text2);
        if (input_width < text_width)
          input_width = text_width;
      }
    }
    if (this.outputs) {
      for (let i2 = 0, l = this.outputs.length; i2 < l; ++i2) {
        const output = this.outputs[i2];
        const text2 = output.label || output.localized_name || output.name || "";
        const text_width = compute_text_size(text2);
        if (output_width < text_width)
          output_width = text_width;
      }
    }
    size2[0] = Math.max(input_width + output_width + 10, title_width);
    size2[0] = Math.max(size2[0], LiteGraph.NODE_WIDTH);
    if (this.widgets?.length)
      size2[0] = Math.max(size2[0], LiteGraph.NODE_WIDTH * 1.5);
    size2[1] = (this.constructor.slot_start_y || 0) + rows * LiteGraph.NODE_SLOT_HEIGHT;
    let widgets_height = 0;
    if (this.widgets?.length) {
      for (let i2 = 0, l = this.widgets.length; i2 < l; ++i2) {
        const widget2 = this.widgets[i2];
        if (widget2.hidden || widget2.advanced && !this.showAdvanced) continue;
        widgets_height += widget2.computeSize ? widget2.computeSize(size2[0])[1] + 4 : LiteGraph.NODE_WIDGET_HEIGHT + 4;
      }
      widgets_height += 8;
    }
    if (this.widgets_up)
      size2[1] = Math.max(size2[1], widgets_height);
    else if (this.widgets_start_y != null)
      size2[1] = Math.max(size2[1], widgets_height + this.widgets_start_y);
    else
      size2[1] += widgets_height;
    function compute_text_size(text2) {
      return text2 ? font_size * text2.length * 0.6 : 0;
    }
    __name(compute_text_size, "compute_text_size");
    if (this.constructor.min_height && size2[1] < this.constructor.min_height) {
      size2[1] = this.constructor.min_height;
    }
    size2[1] += 6;
    return size2;
  }
  inResizeCorner(canvasX, canvasY) {
    const rows = this.outputs ? this.outputs.length : 1;
    const outputs_offset = (this.constructor.slot_start_y || 0) + rows * LiteGraph.NODE_SLOT_HEIGHT;
    return isInRectangle(
      canvasX,
      canvasY,
      this.pos[0] + this.size[0] - 15,
      this.pos[1] + Math.max(this.size[1] - 15, outputs_offset),
      20,
      20
    );
  }
  /**
   * returns all the info available about a property of this node.
   * @param property name of the property
   * @returns the object with all the available info
   */
  getPropertyInfo(property) {
    let info = null;
    if (this.properties_info) {
      for (let i2 = 0; i2 < this.properties_info.length; ++i2) {
        if (this.properties_info[i2].name == property) {
          info = this.properties_info[i2];
          break;
        }
      }
    }
    if (this.constructor["@" + property])
      info = this.constructor["@" + property];
    if (this.constructor.widgets_info?.[property])
      info = this.constructor.widgets_info[property];
    if (!info && this.onGetPropertyInfo) {
      info = this.onGetPropertyInfo(property);
    }
    info ||= {};
    info.type ||= typeof this.properties[property];
    if (info.widget == "combo") info.type = "enum";
    return info;
  }
  /**
   * Defines a widget inside the node, it will be rendered on top of the node, you can control lots of properties
   * @param type the widget type (could be "number","string","combo"
   * @param name the text to show on the widget
   * @param value the default value
   * @param callback function to call when it changes (optionally, it can be the name of the property to modify)
   * @param options the object that contains special properties of this widget
   * @returns the created widget object
   */
  addWidget(type, name2, value4, callback, options4) {
    this.widgets ||= [];
    if (!options4 && callback && typeof callback === "object") {
      options4 = callback;
      callback = null;
    }
    if (options4 && typeof options4 === "string")
      options4 = { property: options4 };
    if (callback && typeof callback === "string") {
      options4 ||= {};
      options4.property = callback;
      callback = null;
    }
    if (callback && typeof callback !== "function") {
      console.warn("addWidget: callback must be a function");
      callback = null;
    }
    const w = {
      // @ts-expect-error Type check or just assert?
      type: type.toLowerCase(),
      name: name2,
      value: value4,
      callback,
      options: options4 || {}
    };
    if (w.options.y !== void 0) {
      w.y = w.options.y;
    }
    if (!callback && !w.options.callback && !w.options.property) {
      console.warn("LiteGraph addWidget(...) without a callback or property assigned");
    }
    if (type == "combo" && !w.options.values) {
      throw "LiteGraph addWidget('combo',...) requires to pass values in options: { values:['red','blue'] }";
    }
    this.widgets.push(w);
    this.setSize(this.computeSize());
    return w;
  }
  addCustomWidget(custom_widget) {
    this.widgets ||= [];
    this.widgets.push(custom_widget);
    return custom_widget;
  }
  move(deltaX, deltaY) {
    if (this.pinned) return;
    this.pos[0] += deltaX;
    this.pos[1] += deltaY;
  }
  /**
   * Internal method to measure the node for rendering.  Prefer {@link boundingRect} where possible.
   *
   * Populates {@link out} with the results in graph space.
   * Adjusts for title and collapsed status, but does not call {@link onBounding}.
   * @param out `x, y, width, height` are written to this array.
   * @param pad Expands the area by this amount on each side.  Default: 0
   */
  measure(out, pad = 0) {
    const titleMode = this.constructor.title_mode;
    const renderTitle = titleMode != TitleMode.TRANSPARENT_TITLE && titleMode != TitleMode.NO_TITLE;
    const titleHeight = renderTitle ? LiteGraph.NODE_TITLE_HEIGHT : 0;
    out[0] = this.pos[0] - pad;
    out[1] = this.pos[1] + -titleHeight - pad;
    if (!this.flags?.collapsed) {
      out[2] = this.size[0] + 2 * pad;
      out[3] = this.size[1] + titleHeight + 2 * pad;
    } else {
      out[2] = (this._collapsed_width || LiteGraph.NODE_COLLAPSED_WIDTH) + 2 * pad;
      out[3] = LiteGraph.NODE_TITLE_HEIGHT + 2 * pad;
    }
  }
  /**
   * returns the bounding of the object, used for rendering purposes
   * @param out {Float32Array[4]?} [optional] a place to store the output, to free garbage
   * @param includeExternal {boolean?} [optional] set to true to
   * include the shadow and connection points in the bounding calculation
   * @returns the bounding box in format of [topleft_cornerx, topleft_cornery, width, height]
   */
  getBounding(out, includeExternal) {
    out ||= new Float32Array(4);
    const rect = includeExternal ? this.renderArea : this.boundingRect;
    out[0] = rect[0];
    out[1] = rect[1];
    out[2] = rect[2];
    out[3] = rect[3];
    return out;
  }
  /**
   * Calculates the render area of this node, populating both {@link boundingRect} and {@link renderArea}.
   * Called automatically at the start of every frame.
   */
  updateArea() {
    const bounds = this.#boundingRect;
    this.measure(bounds);
    this.onBounding?.(bounds);
    const renderArea = this.#renderArea;
    renderArea.set(bounds);
    renderArea[0] -= 4;
    renderArea[1] -= 4;
    renderArea[2] += 6 + 4;
    renderArea[3] += 5 + 4;
  }
  /**
   * checks if a point is inside the shape of a node
   */
  isPointInside(x2, y2) {
    return isInRect(x2, y2, this.boundingRect);
  }
  /**
   * Checks if the provided point is inside this node's collapse button area.
   * @param x X co-ordinate to check
   * @param y Y co-ordinate to check
   * @returns true if the x,y point is in the collapse button area, otherwise false
   */
  isPointInCollapse(x2, y2) {
    const squareLength = LiteGraph.NODE_TITLE_HEIGHT;
    return isInRectangle(
      x2,
      y2,
      this.pos[0],
      this.pos[1] - squareLength,
      squareLength,
      squareLength
    );
  }
  /**
   * checks if a point is inside a node slot, and returns info about which slot
   * @param x
   * @param y
   * @returns if found the object contains { input|output: slot object, slot: number, link_pos: [x,y] }
   */
  getSlotInPosition(x2, y2) {
    const link_pos = new Float32Array(2);
    if (this.inputs) {
      for (let i2 = 0, l = this.inputs.length; i2 < l; ++i2) {
        const input = this.inputs[i2];
        this.getConnectionPos(true, i2, link_pos);
        if (isInRectangle(x2, y2, link_pos[0] - 10, link_pos[1] - 5, 20, 10)) {
          return { input, slot: i2, link_pos };
        }
      }
    }
    if (this.outputs) {
      for (let i2 = 0, l = this.outputs.length; i2 < l; ++i2) {
        const output = this.outputs[i2];
        this.getConnectionPos(false, i2, link_pos);
        if (isInRectangle(x2, y2, link_pos[0] - 10, link_pos[1] - 5, 20, 10)) {
          return { output, slot: i2, link_pos };
        }
      }
    }
    return null;
  }
  /**
   * Gets the widget on this node at the given co-ordinates.
   * @param canvasX X co-ordinate in graph space
   * @param canvasY Y co-ordinate in graph space
   * @returns The widget found, otherwise `null`
   */
  getWidgetOnPos(canvasX, canvasY, includeDisabled = false) {
    const { widgets, pos: pos2, size: size2 } = this;
    if (!widgets?.length) return null;
    const x2 = canvasX - pos2[0];
    const y2 = canvasY - pos2[1];
    const nodeWidth = size2[0];
    for (const widget2 of widgets) {
      if (!widget2 || widget2.disabled && !includeDisabled || widget2.hidden || widget2.advanced && !this.showAdvanced)
        continue;
      const h2 = widget2.computeSize ? widget2.computeSize(nodeWidth)[1] : LiteGraph.NODE_WIDGET_HEIGHT;
      const w = widget2.width || nodeWidth;
      if (widget2.last_y !== void 0 && isInRectangle(x2, y2, 6, widget2.last_y, w - 12, h2))
        return widget2;
    }
    return null;
  }
  findInputSlot(name2, returnObj = false) {
    if (!this.inputs) return -1;
    for (let i2 = 0, l = this.inputs.length; i2 < l; ++i2) {
      if (name2 == this.inputs[i2].name) {
        return !returnObj ? i2 : this.inputs[i2];
      }
    }
    return -1;
  }
  findOutputSlot(name2, returnObj = false) {
    if (!this.outputs) return -1;
    for (let i2 = 0, l = this.outputs.length; i2 < l; ++i2) {
      if (name2 == this.outputs[i2].name) {
        return !returnObj ? i2 : this.outputs[i2];
      }
    }
    return -1;
  }
  findInputSlotFree(optsIn) {
    return this.#findFreeSlot(this.inputs, optsIn);
  }
  findOutputSlotFree(optsIn) {
    return this.#findFreeSlot(this.outputs, optsIn);
  }
  /**
   * Finds the next free slot
   * @param slots The slots to search, i.e. this.inputs or this.outputs
   */
  #findFreeSlot(slots, options4) {
    const defaults2 = {
      returnObj: false,
      typesNotAccepted: []
    };
    const opts = Object.assign(defaults2, options4 || {});
    const length = slots?.length;
    if (!(length > 0)) return -1;
    for (let i2 = 0; i2 < length; ++i2) {
      const slot = slots[i2];
      if (!slot || slot.link || slot.links?.length) continue;
      if (opts.typesNotAccepted?.includes?.(slot.type)) continue;
      return !opts.returnObj ? i2 : slot;
    }
    return -1;
  }
  findInputSlotByType(type, returnObj, preferFreeSlot, doNotUseOccupied) {
    return this.#findSlotByType(
      this.inputs,
      type,
      returnObj,
      preferFreeSlot,
      doNotUseOccupied
    );
  }
  findOutputSlotByType(type, returnObj, preferFreeSlot, doNotUseOccupied) {
    return this.#findSlotByType(
      this.outputs,
      type,
      returnObj,
      preferFreeSlot,
      doNotUseOccupied
    );
  }
  findSlotByType(input, type, returnObj, preferFreeSlot, doNotUseOccupied) {
    return input ? this.#findSlotByType(
      this.inputs,
      type,
      returnObj,
      preferFreeSlot,
      doNotUseOccupied
    ) : this.#findSlotByType(
      this.outputs,
      type,
      returnObj,
      preferFreeSlot,
      doNotUseOccupied
    );
  }
  /**
   * Finds a matching slot from those provided, returning the slot itself or its index in {@link slots}.
   * @param slots Slots to search (this.inputs or this.outputs)
   * @param type Type of slot to look for
   * @param returnObj If true, returns the slot itself.  Otherwise, the index.
   * @param preferFreeSlot Prefer a free slot, but if none are found, fall back to an occupied slot.
   * @param doNotUseOccupied Do not fall back to occupied slots.
   * @see {findSlotByType}
   * @see {findOutputSlotByType}
   * @see {findInputSlotByType}
   * @returns If a match is found, the slot if returnObj is true, otherwise the index.  If no matches are found, -1
   */
  #findSlotByType(slots, type, returnObj, preferFreeSlot, doNotUseOccupied) {
    const length = slots?.length;
    if (!length) return -1;
    if (type == "" || type == "*") type = 0;
    const sourceTypes = String(type).toLowerCase().split(",");
    let occupiedSlot = null;
    for (let i2 = 0; i2 < length; ++i2) {
      const slot = slots[i2];
      const destTypes = slot.type == "0" || slot.type == "*" ? ["0"] : String(slot.type).toLowerCase().split(",");
      for (const sourceType of sourceTypes) {
        const source = sourceType == "_event_" ? LiteGraph.EVENT : sourceType;
        for (const destType of destTypes) {
          const dest = destType == "_event_" ? LiteGraph.EVENT : destType;
          if (source == dest || source === "*" || dest === "*") {
            if (preferFreeSlot && (slot.links?.length || slot.link != null)) {
              occupiedSlot ??= returnObj ? slot : i2;
              continue;
            }
            return returnObj ? slot : i2;
          }
        }
      }
    }
    return doNotUseOccupied ? -1 : occupiedSlot ?? -1;
  }
  /**
   * Determines the slot index to connect to when attempting to connect by type.
   * @param findInputs If true, searches for an input.  Otherwise, an output.
   * @param node The node at the other end of the connection.
   * @param slotType The type of slot at the other end of the connection.
   * @param options Search restrictions to adhere to.
   * @see {connectByType}
   * @see {connectByTypeOutput}
   */
  findConnectByTypeSlot(findInputs, node22, slotType, options4) {
    if (options4 && typeof options4 === "object") {
      if ("firstFreeIfInputGeneralInCase" in options4) options4.wildcardToTyped = !!options4.firstFreeIfInputGeneralInCase;
      if ("firstFreeIfOutputGeneralInCase" in options4) options4.wildcardToTyped = !!options4.firstFreeIfOutputGeneralInCase;
      if ("generalTypeInCase" in options4) options4.typedToWildcard = !!options4.generalTypeInCase;
    }
    const optsDef = {
      createEventInCase: true,
      wildcardToTyped: true,
      typedToWildcard: true
    };
    const opts = Object.assign(optsDef, options4);
    if (node22 && typeof node22 === "number") {
      node22 = this.graph.getNodeById(node22);
    }
    const slot = node22.findSlotByType(findInputs, slotType, false, true);
    if (slot >= 0 && slot !== null) return slot;
    if (opts.createEventInCase && slotType == LiteGraph.EVENT) {
      if (findInputs) return -1;
      if (LiteGraph.do_add_triggers_slots) return node22.addOnExecutedOutput();
    }
    if (opts.typedToWildcard) {
      const generalSlot = node22.findSlotByType(findInputs, 0, false, true, true);
      if (generalSlot >= 0) return generalSlot;
    }
    if (opts.wildcardToTyped && (slotType == 0 || slotType == "*" || slotType == "")) {
      const opt = { typesNotAccepted: [LiteGraph.EVENT] };
      const nonEventSlot = findInputs ? node22.findInputSlotFree(opt) : node22.findOutputSlotFree(opt);
      if (nonEventSlot >= 0) return nonEventSlot;
    }
    return null;
  }
  /**
   * connect this node output to the input of another node BY TYPE
   * @param slot (could be the number of the slot or the string with the name of the slot)
   * @param target_node the target node
   * @param target_slotType the input slot type of the target node
   * @returns the link_info is created, otherwise null
   */
  connectByType(slot, target_node, target_slotType, optsIn) {
    const slotIndex = this.findConnectByTypeSlot(
      true,
      target_node,
      target_slotType,
      optsIn
    );
    if (slotIndex !== null)
      return this.connect(slot, target_node, slotIndex, optsIn?.afterRerouteId);
    console.debug("[connectByType]: no way to connect type: ", target_slotType, " to node: ", target_node);
    return null;
  }
  /**
   * connect this node input to the output of another node BY TYPE
   * @param slot (could be the number of the slot or the string with the name of the slot)
   * @param source_node the target node
   * @param source_slotType the output slot type of the target node
   * @returns the link_info is created, otherwise null
   */
  connectByTypeOutput(slot, source_node, source_slotType, optsIn) {
    if (typeof optsIn === "object") {
      if ("firstFreeIfInputGeneralInCase" in optsIn) optsIn.wildcardToTyped = !!optsIn.firstFreeIfInputGeneralInCase;
      if ("generalTypeInCase" in optsIn) optsIn.typedToWildcard = !!optsIn.generalTypeInCase;
    }
    const slotIndex = this.findConnectByTypeSlot(
      false,
      source_node,
      source_slotType,
      optsIn
    );
    if (slotIndex !== null)
      return source_node.connect(slotIndex, this, slot, optsIn?.afterRerouteId);
    console.debug("[connectByType]: no way to connect type: ", source_slotType, " to node: ", source_node);
    return null;
  }
  /**
   * Connect an output of this node to an input of another node
   * @param slot (could be the number of the slot or the string with the name of the slot)
   * @param target_node the target node
   * @param target_slot the input slot of the target node (could be the number of the slot or the string with the name of the slot, or -1 to connect a trigger)
   * @returns the link_info is created, otherwise null
   */
  connect(slot, target_node, target_slot, afterRerouteId) {
    let targetIndex;
    const graph = this.graph;
    if (!graph) {
      console.log("Connect: Error, node doesn't belong to any graph. Nodes must be added first to a graph before connecting them.");
      return null;
    }
    if (typeof slot === "string") {
      slot = this.findOutputSlot(slot);
      if (slot == -1) {
        if (LiteGraph.debug) console.log("Connect: Error, no slot of name " + slot);
        return null;
      }
    } else if (!this.outputs || slot >= this.outputs.length) {
      if (LiteGraph.debug) console.log("Connect: Error, slot number not found");
      return null;
    }
    if (target_node && typeof target_node === "number") {
      target_node = graph.getNodeById(target_node);
    }
    if (!target_node) throw "target node is null";
    if (target_node == this) return null;
    if (typeof target_slot === "string") {
      targetIndex = target_node.findInputSlot(target_slot);
      if (targetIndex == -1) {
        if (LiteGraph.debug) console.log("Connect: Error, no slot of name " + targetIndex);
        return null;
      }
    } else if (target_slot === LiteGraph.EVENT) {
      if (LiteGraph.do_add_triggers_slots) {
        target_node.changeMode(LGraphEventMode.ON_TRIGGER);
        targetIndex = target_node.findInputSlot("onTrigger");
      } else {
        return null;
      }
    } else if (typeof target_slot === "number") {
      targetIndex = target_slot;
    } else {
      targetIndex = 0;
    }
    if (target_node.onBeforeConnectInput) {
      const requestedIndex = target_node.onBeforeConnectInput(targetIndex, target_slot);
      targetIndex = typeof requestedIndex === "number" ? requestedIndex : null;
    }
    if (targetIndex === null || !target_node.inputs || targetIndex >= target_node.inputs.length) {
      if (LiteGraph.debug) console.log("Connect: Error, slot number not found");
      return null;
    }
    let changed = false;
    const input = target_node.inputs[targetIndex];
    let link_info = null;
    const output = this.outputs[slot];
    if (!this.outputs[slot]) return null;
    if (!LiteGraph.isValidConnection(output.type, input.type)) {
      this.setDirtyCanvas(false, true);
      if (changed) graph.connectionChange(this, link_info);
      return null;
    }
    if (target_node.onConnectInput?.(targetIndex, output.type, output, this, slot) === false)
      return null;
    if (this.onConnectOutput?.(slot, input.type, input, target_node, targetIndex) === false)
      return null;
    if (target_node.inputs[targetIndex]?.link != null) {
      graph.beforeChange();
      target_node.disconnectInput(targetIndex, true);
      changed = true;
    }
    if (output.links?.length) {
      if (output.type === LiteGraph.EVENT && !LiteGraph.allow_multi_output_for_events) {
        graph.beforeChange();
        this.disconnectOutput(slot, false, { doProcessChange: false });
        changed = true;
      }
    }
    const nextId = ++graph.state.lastLinkId;
    link_info = new LLink(
      nextId,
      input.type || output.type,
      this.id,
      slot,
      target_node.id,
      targetIndex,
      afterRerouteId
    );
    graph._links.set(link_info.id, link_info);
    output.links ??= [];
    output.links.push(link_info.id);
    target_node.inputs[targetIndex].link = link_info.id;
    LLink.getReroutes(graph, link_info).forEach((x2) => x2?.linkIds.add(nextId));
    graph._version++;
    this.onConnectionsChange?.(
      NodeSlotType.OUTPUT,
      slot,
      true,
      link_info,
      output
    );
    target_node.onConnectionsChange?.(
      NodeSlotType.INPUT,
      targetIndex,
      true,
      link_info,
      input
    );
    graph.onNodeConnectionChange?.(
      NodeSlotType.INPUT,
      target_node,
      targetIndex,
      this,
      slot
    );
    graph.onNodeConnectionChange?.(
      NodeSlotType.OUTPUT,
      this,
      slot,
      target_node,
      targetIndex
    );
    this.setDirtyCanvas(false, true);
    graph.afterChange();
    graph.connectionChange(this);
    return link_info;
  }
  /**
   * disconnect one output to an specific node
   * @param slot (could be the number of the slot or the string with the name of the slot)
   * @param target_node the target node to which this slot is connected [Optional,
   * if not target_node is specified all nodes will be disconnected]
   * @returns if it was disconnected successfully
   */
  disconnectOutput(slot, target_node) {
    if (typeof slot === "string") {
      slot = this.findOutputSlot(slot);
      if (slot == -1) {
        if (LiteGraph.debug) console.log("Connect: Error, no slot of name " + slot);
        return false;
      }
    } else if (!this.outputs || slot >= this.outputs.length) {
      if (LiteGraph.debug) console.log("Connect: Error, slot number not found");
      return false;
    }
    const output = this.outputs[slot];
    if (!output || !output.links || output.links.length == 0) return false;
    const graph = this.graph;
    if (target_node) {
      if (typeof target_node === "number")
        target_node = graph.getNodeById(target_node);
      if (!target_node) throw "Target Node not found";
      for (let i2 = 0, l = output.links.length; i2 < l; i2++) {
        const link_id = output.links[i2];
        const link_info = graph._links.get(link_id);
        if (link_info.target_id == target_node.id) {
          output.links.splice(i2, 1);
          const input = target_node.inputs[link_info.target_slot];
          input.link = null;
          graph._links.delete(link_id);
          graph._version++;
          target_node.onConnectionsChange?.(
            NodeSlotType.INPUT,
            link_info.target_slot,
            false,
            link_info,
            input
          );
          this.onConnectionsChange?.(
            NodeSlotType.OUTPUT,
            slot,
            false,
            link_info,
            output
          );
          graph.onNodeConnectionChange?.(NodeSlotType.OUTPUT, this, slot);
          graph.onNodeConnectionChange?.(NodeSlotType.INPUT, target_node, link_info.target_slot);
          break;
        }
      }
    } else {
      for (let i2 = 0, l = output.links.length; i2 < l; i2++) {
        const link_id = output.links[i2];
        const link_info = graph._links.get(link_id);
        if (!link_info) continue;
        target_node = graph.getNodeById(link_info.target_id);
        graph._version++;
        if (target_node) {
          const input = target_node.inputs[link_info.target_slot];
          input.link = null;
          target_node.onConnectionsChange?.(
            NodeSlotType.INPUT,
            link_info.target_slot,
            false,
            link_info,
            input
          );
        }
        graph._links.delete(link_id);
        this.onConnectionsChange?.(
          NodeSlotType.OUTPUT,
          slot,
          false,
          link_info,
          output
        );
        graph.onNodeConnectionChange?.(NodeSlotType.OUTPUT, this, slot);
        graph.onNodeConnectionChange?.(NodeSlotType.INPUT, target_node, link_info.target_slot);
      }
      output.links = null;
    }
    this.setDirtyCanvas(false, true);
    graph.connectionChange(this);
    return true;
  }
  /**
   * Disconnect one input
   * @param slot Input slot index, or the name of the slot
   * @param keepReroutes If `true`, reroutes will not be garbage collected.
   * @returns true if disconnected successfully or already disconnected, otherwise false
   */
  disconnectInput(slot, keepReroutes) {
    if (typeof slot === "string") {
      slot = this.findInputSlot(slot);
      if (slot == -1) {
        if (LiteGraph.debug) console.log("Connect: Error, no slot of name " + slot);
        return false;
      }
    } else if (!this.inputs || slot >= this.inputs.length) {
      if (LiteGraph.debug) {
        console.log("Connect: Error, slot number not found");
      }
      return false;
    }
    const input = this.inputs[slot];
    if (!input) return false;
    const link_id = this.inputs[slot].link;
    if (link_id != null) {
      this.inputs[slot].link = null;
      const link_info = this.graph._links.get(link_id);
      if (link_info) {
        const target_node = this.graph.getNodeById(link_info.origin_id);
        if (!target_node) return false;
        const output = target_node.outputs[link_info.origin_slot];
        if (!(output?.links?.length > 0)) return false;
        let i2 = 0;
        for (const l = output.links.length; i2 < l; i2++) {
          if (output.links[i2] == link_id) {
            output.links.splice(i2, 1);
            break;
          }
        }
        link_info.disconnect(this.graph, keepReroutes);
        if (this.graph) this.graph._version++;
        this.onConnectionsChange?.(
          NodeSlotType.INPUT,
          slot,
          false,
          link_info,
          input
        );
        target_node.onConnectionsChange?.(
          NodeSlotType.OUTPUT,
          i2,
          false,
          link_info,
          output
        );
        this.graph?.onNodeConnectionChange?.(NodeSlotType.OUTPUT, target_node, i2);
        this.graph?.onNodeConnectionChange?.(NodeSlotType.INPUT, this, slot);
      }
    }
    this.setDirtyCanvas(false, true);
    this.graph?.connectionChange(this);
    return true;
  }
  /**
   * returns the center of a connection point in canvas coords
   * @param is_input true if if a input slot, false if it is an output
   * @param slot_number (could be the number of the slot or the string with the name of the slot)
   * @param out [optional] a place to store the output, to free garbage
   * @returns the position
   */
  getConnectionPos(is_input, slot_number, out) {
    out ||= new Float32Array(2);
    const num_slots = is_input ? this.inputs?.length ?? 0 : this.outputs?.length ?? 0;
    const offset = LiteGraph.NODE_SLOT_HEIGHT * 0.5;
    if (this.flags.collapsed) {
      const w = this._collapsed_width || LiteGraph.NODE_COLLAPSED_WIDTH;
      if (this.horizontal) {
        out[0] = this.pos[0] + w * 0.5;
        out[1] = is_input ? this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT : this.pos[1];
      } else {
        out[0] = is_input ? this.pos[0] : this.pos[0] + w;
        out[1] = this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT * 0.5;
      }
      return out;
    }
    if (is_input && slot_number == -1) {
      out[0] = this.pos[0] + LiteGraph.NODE_TITLE_HEIGHT * 0.5;
      out[1] = this.pos[1] + LiteGraph.NODE_TITLE_HEIGHT * 0.5;
      return out;
    }
    if (is_input && num_slots > slot_number && this.inputs[slot_number].pos) {
      out[0] = this.pos[0] + this.inputs[slot_number].pos[0];
      out[1] = this.pos[1] + this.inputs[slot_number].pos[1];
      return out;
    } else if (!is_input && num_slots > slot_number && this.outputs[slot_number].pos) {
      out[0] = this.pos[0] + this.outputs[slot_number].pos[0];
      out[1] = this.pos[1] + this.outputs[slot_number].pos[1];
      return out;
    }
    if (this.horizontal) {
      out[0] = this.pos[0] + (slot_number + 0.5) * (this.size[0] / num_slots);
      out[1] = is_input ? this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT : this.pos[1] + this.size[1];
      return out;
    }
    out[0] = is_input ? this.pos[0] + offset : this.pos[0] + this.size[0] + 1 - offset;
    out[1] = this.pos[1] + (slot_number + 0.7) * LiteGraph.NODE_SLOT_HEIGHT + (this.constructor.slot_start_y || 0);
    return out;
  }
  /** @inheritdoc */
  snapToGrid(snapTo) {
    return this.pinned ? false : snapPoint(this.pos, snapTo);
  }
  /** @see {@link snapToGrid} */
  alignToGrid() {
    this.snapToGrid(LiteGraph.CANVAS_GRID_SIZE);
  }
  /* Console output */
  trace(msg) {
    this.console ||= [];
    this.console.push(msg);
    if (this.console.length > LGraphNode.MAX_CONSOLE)
      this.console.shift();
    this.graph.onNodeTrace?.(this, msg);
  }
  /* Forces to redraw or the main canvas (LGraphNode) or the bg canvas (links) */
  setDirtyCanvas(dirty_foreground, dirty_background) {
    this.graph?.canvasAction((c) => c.setDirty(dirty_foreground, dirty_background));
  }
  loadImage(url) {
    const img = new Image();
    img.src = LiteGraph.node_images_path + url;
    img.ready = false;
    const that = this;
    img.onload = function() {
      this.ready = true;
      that.setDirtyCanvas(true);
    };
    return img;
  }
  /* Allows to get onMouseMove and onMouseUp events even if the mouse is out of focus */
  captureInput(v2) {
    if (!this.graph || !this.graph.list_of_graphcanvas) return;
    const list2 = this.graph.list_of_graphcanvas;
    for (let i2 = 0; i2 < list2.length; ++i2) {
      const c = list2[i2];
      if (!v2 && c.node_capturing_input != this) continue;
      c.node_capturing_input = v2 ? this : null;
    }
  }
  get collapsed() {
    return !!this.flags.collapsed;
  }
  get collapsible() {
    return !this.pinned && this.constructor.collapsable !== false;
  }
  /**
   * Toggle node collapse (makes it smaller on the canvas)
   */
  collapse(force) {
    if (!this.collapsible && !force) return;
    this.graph._version++;
    this.flags.collapsed = !this.flags.collapsed;
    this.setDirtyCanvas(true, true);
  }
  /**
   * Toggles advanced mode of the node, showing advanced widgets
   */
  toggleAdvanced() {
    if (!this.widgets?.some((w) => w.advanced)) return;
    this.graph._version++;
    this.showAdvanced = !this.showAdvanced;
    const prefSize = this.computeSize();
    if (this.size[0] < prefSize[0] || this.size[1] < prefSize[1]) {
      this.setSize([
        Math.max(this.size[0], prefSize[0]),
        Math.max(this.size[1], prefSize[1])
      ]);
    }
    this.setDirtyCanvas(true, true);
  }
  get pinned() {
    return !!this.flags.pinned;
  }
  /**
   * Prevents the node being accidentally moved or resized by mouse interaction.
   * Toggles pinned state if no value is provided.
   */
  pin(v2) {
    if (this.graph) {
      this.graph._version++;
    }
    this.flags.pinned = v2 ?? !this.flags.pinned;
    this.resizable = !this.pinned;
    if (!this.pinned) delete this.flags.pinned;
  }
  unpin() {
    this.pin(false);
  }
  localToScreen(x2, y2, dragAndScale) {
    return [
      (x2 + this.pos[0]) * dragAndScale.scale + dragAndScale.offset[0],
      (y2 + this.pos[1]) * dragAndScale.scale + dragAndScale.offset[1]
    ];
  }
  get width() {
    return this.collapsed ? this._collapsed_width || LiteGraph.NODE_COLLAPSED_WIDTH : this.size[0];
  }
  get height() {
    return this.collapsed ? LiteGraph.NODE_COLLAPSED_HEIGHT : this.size[1];
  }
  drawBadges(ctx, { gap = 2 } = {}) {
    const badgeInstances = this.badges.map((badge) => badge instanceof LGraphBadge ? badge : badge());
    const isLeftAligned = this.badgePosition === BadgePosition.TopLeft;
    let currentX = isLeftAligned ? 0 : this.width - badgeInstances.reduce((acc, badge) => acc + badge.getWidth(ctx) + gap, 0);
    const y2 = -(LiteGraph.NODE_TITLE_HEIGHT + gap);
    for (const badge of badgeInstances) {
      badge.draw(ctx, currentX, y2 - badge.height);
      currentX += badge.getWidth(ctx) + gap;
    }
  }
  /**
   * Attempts to gracefully bypass this node in all of its connections by reconnecting all links.
   *
   * Each input is checked against each output.  This is done on a matching index basis, i.e. input 3 -> output 3.
   * If there are any input links remaining,
   * and {@link flags}.{@link INodeFlags.keepAllLinksOnBypass keepAllLinksOnBypass} is `true`,
   * each input will check for outputs that match, and take the first one that matches
   * `true`: Try the index matching first, then every input to every output.
   * `false`: Only matches indexes, e.g. input 3 to output 3.
   *
   * If {@link flags}.{@link INodeFlags.keepAllLinksOnBypass keepAllLinksOnBypass} is `undefined`, it will fall back to
   * the static {@link keepAllLinksOnBypass}.
   * @returns `true` if any new links were established, otherwise `false`.
   * @todo Decision: Change API to return array of new links instead?
   */
  connectInputToOutput() {
    const { inputs, outputs, graph } = this;
    if (!inputs || !outputs) return;
    const { _links } = graph;
    let madeAnyConnections = false;
    for (const [index2, input] of inputs.entries()) {
      const output = outputs[index2];
      if (!output || !LiteGraph.isValidConnection(input.type, output.type)) continue;
      const inLink = _links.get(input.link);
      const inNode = graph.getNodeById(inLink?.origin_id);
      if (!inNode) continue;
      bypassAllLinks(output, inNode, inLink);
    }
    if (!(this.flags.keepAllLinksOnBypass ?? LGraphNode.keepAllLinksOnBypass))
      return madeAnyConnections;
    for (const input of inputs) {
      const inLink = _links.get(input.link);
      const inNode = graph.getNodeById(inLink?.origin_id);
      if (!inNode) continue;
      for (const output of outputs) {
        if (!LiteGraph.isValidConnection(input.type, output.type)) continue;
        bypassAllLinks(output, inNode, inLink);
        break;
      }
    }
    return madeAnyConnections;
    function bypassAllLinks(output, inNode, inLink) {
      const outLinks = output.links?.map((x2) => _links.get(x2)).filter((x2) => !!x2);
      if (!outLinks?.length) return;
      for (const outLink of outLinks) {
        const outNode = graph.getNodeById(outLink.target_id);
        if (!outNode) return;
        const result = inNode.connect(
          inLink.origin_slot,
          outNode,
          outLink.target_slot,
          inLink.parentId
        );
        madeAnyConnections ||= !!result;
      }
    }
    __name(bypassAllLinks, "bypassAllLinks");
  }
}
class LGraphGroup {
  static {
    __name(this, "LGraphGroup");
  }
  static minWidth = 140;
  static minHeight = 80;
  static resizeLength = 10;
  static padding = 4;
  static defaultColour = "#335";
  id;
  color;
  title;
  font;
  font_size = LiteGraph.DEFAULT_GROUP_FONT || 24;
  _bounding = new Float32Array([
    10,
    10,
    LGraphGroup.minWidth,
    LGraphGroup.minHeight
  ]);
  _pos = this._bounding.subarray(0, 2);
  _size = this._bounding.subarray(2, 4);
  /** @deprecated See {@link _children} */
  _nodes = [];
  _children = /* @__PURE__ */ new Set();
  graph = null;
  flags = {};
  selected;
  constructor(title, id3) {
    this.id = id3 ?? -1;
    this.title = title || "Group";
    this.color = LGraphCanvas.node_colors.pale_blue ? LGraphCanvas.node_colors.pale_blue.groupcolor : "#AAA";
  }
  /** Position of the group, as x,y co-ordinates in graph space */
  get pos() {
    return this._pos;
  }
  set pos(v2) {
    if (!v2 || v2.length < 2) return;
    this._pos[0] = v2[0];
    this._pos[1] = v2[1];
  }
  /** Size of the group, as width,height in graph units */
  get size() {
    return this._size;
  }
  set size(v2) {
    if (!v2 || v2.length < 2) return;
    this._size[0] = Math.max(LGraphGroup.minWidth, v2[0]);
    this._size[1] = Math.max(LGraphGroup.minHeight, v2[1]);
  }
  get boundingRect() {
    return this._bounding;
  }
  get nodes() {
    return this._nodes;
  }
  get titleHeight() {
    return this.font_size * 1.4;
  }
  get children() {
    return this._children;
  }
  get pinned() {
    return !!this.flags.pinned;
  }
  /**
   * Prevents the group being accidentally moved or resized by mouse interaction.
   * Toggles pinned state if no value is provided.
   */
  pin(value4) {
    const newState = value4 === void 0 ? !this.pinned : value4;
    if (newState) this.flags.pinned = true;
    else delete this.flags.pinned;
  }
  unpin() {
    this.pin(false);
  }
  configure(o) {
    this.id = o.id;
    this.title = o.title;
    this._bounding.set(o.bounding);
    this.color = o.color;
    this.flags = o.flags || this.flags;
    if (o.font_size) this.font_size = o.font_size;
  }
  serialize() {
    const b = this._bounding;
    return {
      id: this.id,
      title: this.title,
      bounding: [...b],
      color: this.color,
      font_size: this.font_size,
      flags: this.flags
    };
  }
  /**
   * Draws the group on the canvas
   * @param graphCanvas
   * @param ctx
   */
  draw(graphCanvas, ctx) {
    const { padding, resizeLength, defaultColour } = LGraphGroup;
    const font_size = this.font_size || LiteGraph.DEFAULT_GROUP_FONT_SIZE;
    const [x2, y2] = this._pos;
    const [width2, height] = this._size;
    ctx.globalAlpha = 0.25 * graphCanvas.editor_alpha;
    ctx.fillStyle = this.color || defaultColour;
    ctx.strokeStyle = this.color || defaultColour;
    ctx.beginPath();
    ctx.rect(x2 + 0.5, y2 + 0.5, width2, font_size * 1.4);
    ctx.fill();
    ctx.fillStyle = this.color;
    ctx.strokeStyle = this.color;
    ctx.beginPath();
    ctx.rect(x2 + 0.5, y2 + 0.5, width2, height);
    ctx.fill();
    ctx.globalAlpha = graphCanvas.editor_alpha;
    ctx.stroke();
    ctx.beginPath();
    ctx.moveTo(x2 + width2, y2 + height);
    ctx.lineTo(x2 + width2 - resizeLength, y2 + height);
    ctx.lineTo(x2 + width2, y2 + height - resizeLength);
    ctx.fill();
    ctx.font = font_size + "px Arial";
    ctx.textAlign = "left";
    ctx.fillText(this.title + (this.pinned ? "📌" : ""), x2 + padding, y2 + font_size);
    if (LiteGraph.highlight_selected_group && this.selected) {
      graphCanvas.strokeShape(ctx, this._bounding, {
        title_height: this.titleHeight,
        padding
      });
    }
  }
  resize(width2, height) {
    if (this.pinned) return false;
    this._size[0] = Math.max(LGraphGroup.minWidth, width2);
    this._size[1] = Math.max(LGraphGroup.minHeight, height);
    return true;
  }
  move(deltaX, deltaY, skipChildren = false) {
    if (this.pinned) return;
    this._pos[0] += deltaX;
    this._pos[1] += deltaY;
    if (skipChildren === true) return;
    for (const item3 of this._children) {
      item3.move(deltaX, deltaY);
    }
  }
  /** @inheritdoc */
  snapToGrid(snapTo) {
    return this.pinned ? false : snapPoint(this.pos, snapTo);
  }
  recomputeInsideNodes() {
    const { nodes, reroutes, groups } = this.graph;
    const children = this._children;
    this._nodes.length = 0;
    children.clear();
    for (const node22 of nodes) {
      if (containsCentre(this._bounding, node22.boundingRect)) {
        this._nodes.push(node22);
        children.add(node22);
      }
    }
    for (const reroute of reroutes.values()) {
      if (isPointInRect(reroute.pos, this._bounding))
        children.add(reroute);
    }
    for (const group of groups) {
      if (containsRect(this._bounding, group._bounding))
        children.add(group);
    }
    groups.sort((a, b) => {
      if (a === this) {
        return children.has(b) ? -1 : 0;
      } else if (b === this) {
        return children.has(a) ? 1 : 0;
      }
    });
  }
  /**
   * Resizes and moves the group to neatly fit all given {@link objects}.
   * @param objects All objects that should be inside the group
   * @param padding Value in graph units to add to all sides of the group.  Default: 10
   */
  resizeTo(objects, padding = 10) {
    const boundingBox = createBounds(objects, padding);
    if (boundingBox === null) return;
    this.pos[0] = boundingBox[0];
    this.pos[1] = boundingBox[1] - this.titleHeight;
    this.size[0] = boundingBox[2];
    this.size[1] = boundingBox[3] + this.titleHeight;
  }
  /**
   * Add nodes to the group and adjust the group's position and size accordingly
   * @param nodes The nodes to add to the group
   * @param padding The padding around the group
   */
  addNodes(nodes, padding = 10) {
    if (!this._nodes && nodes.length === 0) return;
    this.resizeTo([...this.children, ...this._nodes, ...nodes], padding);
  }
  getMenuOptions() {
    return [
      {
        content: this.pinned ? "Unpin" : "Pin",
        callback: /* @__PURE__ */ __name(() => {
          if (this.pinned) this.unpin();
          else this.pin();
          this.setDirtyCanvas(false, true);
        }, "callback")
      },
      null,
      { content: "Title", callback: LGraphCanvas.onShowPropertyEditor },
      {
        content: "Color",
        has_submenu: true,
        callback: LGraphCanvas.onMenuNodeColors
      },
      {
        content: "Font size",
        property: "font_size",
        type: "Number",
        callback: LGraphCanvas.onShowPropertyEditor
      },
      null,
      { content: "Remove", callback: LGraphCanvas.onMenuNodeRemove }
    ];
  }
  isPointInTitlebar(x2, y2) {
    const b = this.boundingRect;
    return isInRectangle(x2, y2, b[0], b[1], b[2], this.titleHeight);
  }
  isInResize(x2, y2) {
    const b = this.boundingRect;
    const right = b[0] + b[2];
    const bottom = b[1] + b[3];
    return x2 < right && y2 < bottom && x2 - right + (y2 - bottom) > -LGraphGroup.resizeLength;
  }
  isPointInside = LGraphNode.prototype.isPointInside;
  setDirtyCanvas = LGraphNode.prototype.setDirtyCanvas;
}
var SlotType = /* @__PURE__ */ ((SlotType2) => {
  SlotType2["Array"] = "array";
  SlotType2[SlotType2["Event"] = -1] = "Event";
  return SlotType2;
})(SlotType || {});
var SlotShape = ((SlotShape2) => {
  SlotShape2[SlotShape2["Box"] = RenderShape.BOX] = "Box";
  SlotShape2[SlotShape2["Arrow"] = RenderShape.ARROW] = "Arrow";
  SlotShape2[SlotShape2["Grid"] = RenderShape.GRID] = "Grid";
  SlotShape2[SlotShape2["Circle"] = RenderShape.CIRCLE] = "Circle";
  SlotShape2[SlotShape2["HollowCircle"] = RenderShape.HollowCircle] = "HollowCircle";
  return SlotShape2;
})(SlotShape || {});
var SlotDirection = ((SlotDirection2) => {
  SlotDirection2[SlotDirection2["Up"] = LinkDirection.UP] = "Up";
  SlotDirection2[SlotDirection2["Right"] = LinkDirection.RIGHT] = "Right";
  SlotDirection2[SlotDirection2["Down"] = LinkDirection.DOWN] = "Down";
  SlotDirection2[SlotDirection2["Left"] = LinkDirection.LEFT] = "Left";
  return SlotDirection2;
})(SlotDirection || {});
var LabelPosition = /* @__PURE__ */ ((LabelPosition2) => {
  LabelPosition2["Left"] = "left";
  LabelPosition2["Right"] = "right";
  return LabelPosition2;
})(LabelPosition || {});
function drawSlot(ctx, slot, pos2, {
  label_color = "#AAA",
  label_position = "right",
  horizontal: horizontal2 = false,
  low_quality = false,
  render_text = true,
  do_stroke = false,
  highlight = false
} = {}) {
  const originalFillStyle = ctx.fillStyle;
  const originalStrokeStyle = ctx.strokeStyle;
  const originalLineWidth = ctx.lineWidth;
  const slot_type = slot.type;
  const slot_shape = slot_type === "array" ? SlotShape.Grid : slot.shape;
  ctx.beginPath();
  let doStroke = do_stroke;
  let doFill = true;
  if (slot_type === -1 || slot_shape === SlotShape.Box) {
    if (horizontal2) {
      ctx.rect(pos2[0] - 5 + 0.5, pos2[1] - 8 + 0.5, 10, 14);
    } else {
      ctx.rect(pos2[0] - 6 + 0.5, pos2[1] - 5 + 0.5, 14, 10);
    }
  } else if (slot_shape === SlotShape.Arrow) {
    ctx.moveTo(pos2[0] + 8, pos2[1] + 0.5);
    ctx.lineTo(pos2[0] - 4, pos2[1] + 6 + 0.5);
    ctx.lineTo(pos2[0] - 4, pos2[1] - 6 + 0.5);
    ctx.closePath();
  } else if (slot_shape === SlotShape.Grid) {
    const gridSize = 3;
    const cellSize = 2;
    const spacing = 3;
    for (let x2 = 0; x2 < gridSize; x2++) {
      for (let y2 = 0; y2 < gridSize; y2++) {
        ctx.rect(
          pos2[0] - 4 + x2 * spacing,
          pos2[1] - 4 + y2 * spacing,
          cellSize,
          cellSize
        );
      }
    }
    doStroke = false;
  } else {
    if (low_quality) {
      ctx.rect(pos2[0] - 4, pos2[1] - 4, 8, 8);
    } else {
      let radius;
      if (slot_shape === SlotShape.HollowCircle) {
        doFill = false;
        doStroke = true;
        ctx.lineWidth = 3;
        ctx.strokeStyle = ctx.fillStyle;
        radius = highlight ? 4 : 3;
      } else {
        radius = highlight ? 5 : 4;
      }
      ctx.arc(pos2[0], pos2[1], radius, 0, Math.PI * 2);
    }
  }
  if (doFill) ctx.fill();
  if (!low_quality && doStroke) ctx.stroke();
  if (render_text) {
    const text2 = slot.label || slot.localized_name || slot.name;
    if (text2) {
      ctx.fillStyle = label_color;
      if (label_position === "right") {
        if (horizontal2 || slot.dir == LinkDirection.UP) {
          ctx.fillText(text2, pos2[0], pos2[1] - 10);
        } else {
          ctx.fillText(text2, pos2[0] + 10, pos2[1] + 5);
        }
      } else {
        if (horizontal2 || slot.dir == LinkDirection.DOWN) {
          ctx.fillText(text2, pos2[0], pos2[1] - 8);
        } else {
          ctx.fillText(text2, pos2[0] - 10, pos2[1] + 5);
        }
      }
    }
  }
  ctx.fillStyle = originalFillStyle;
  ctx.strokeStyle = originalStrokeStyle;
  ctx.lineWidth = originalLineWidth;
}
__name(drawSlot, "drawSlot");
class DragAndScale {
  static {
    __name(this, "DragAndScale");
  }
  /**
   * The state of this DragAndScale instance.
   *
   * Implemented as a POCO that can be proxied without side-effects.
   */
  state;
  /** Maximum scale (zoom in) */
  max_scale;
  /** Minimum scale (zoom out) */
  min_scale;
  enabled;
  last_mouse;
  element;
  visible_area;
  _binded_mouse_callback;
  dragging;
  viewport;
  get offset() {
    return this.state.offset;
  }
  set offset(value4) {
    this.state.offset = value4;
  }
  get scale() {
    return this.state.scale;
  }
  set scale(value4) {
    this.state.scale = value4;
  }
  constructor(element, skip_events) {
    this.state = {
      offset: new Float32Array([0, 0]),
      scale: 1
    };
    this.max_scale = 10;
    this.min_scale = 0.1;
    this.onredraw = null;
    this.enabled = true;
    this.last_mouse = [0, 0];
    this.element = null;
    this.visible_area = new Float32Array(4);
    if (element) {
      this.element = element;
      if (!skip_events) {
        this.bindEvents(element);
      }
    }
  }
  /** @deprecated Has not been kept up to date */
  bindEvents(element) {
    this.last_mouse = new Float32Array(2);
    this._binded_mouse_callback = this.onMouse.bind(this);
    LiteGraph.pointerListenerAdd(element, "down", this._binded_mouse_callback);
    LiteGraph.pointerListenerAdd(element, "move", this._binded_mouse_callback);
    LiteGraph.pointerListenerAdd(element, "up", this._binded_mouse_callback);
    element.addEventListener("mousewheel", this._binded_mouse_callback, false);
    element.addEventListener("wheel", this._binded_mouse_callback, false);
  }
  computeVisibleArea(viewport) {
    if (!this.element) {
      this.visible_area[0] = this.visible_area[1] = this.visible_area[2] = this.visible_area[3] = 0;
      return;
    }
    let width2 = this.element.width;
    let height = this.element.height;
    let startx = -this.offset[0];
    let starty = -this.offset[1];
    if (viewport) {
      startx += viewport[0] / this.scale;
      starty += viewport[1] / this.scale;
      width2 = viewport[2];
      height = viewport[3];
    }
    const endx = startx + width2 / this.scale;
    const endy = starty + height / this.scale;
    this.visible_area[0] = startx;
    this.visible_area[1] = starty;
    this.visible_area[2] = endx - startx;
    this.visible_area[3] = endy - starty;
  }
  /** @deprecated Has not been kept up to date */
  onMouse(e2) {
    if (!this.enabled) {
      return;
    }
    const canvas = this.element;
    const rect = canvas.getBoundingClientRect();
    const x2 = e2.clientX - rect.left;
    const y2 = e2.clientY - rect.top;
    e2.canvasx = x2;
    e2.canvasy = y2;
    e2.dragging = this.dragging;
    const is_inside = !this.viewport || isInRect(x2, y2, this.viewport);
    let ignore = false;
    if (this.onmouse) {
      ignore = this.onmouse(e2);
    }
    if (e2.type == LiteGraph.pointerevents_method + "down" && is_inside) {
      this.dragging = true;
      LiteGraph.pointerListenerRemove(canvas, "move", this._binded_mouse_callback);
      LiteGraph.pointerListenerAdd(document, "move", this._binded_mouse_callback);
      LiteGraph.pointerListenerAdd(document, "up", this._binded_mouse_callback);
    } else if (e2.type == LiteGraph.pointerevents_method + "move") {
      if (!ignore) {
        const deltax = x2 - this.last_mouse[0];
        const deltay = y2 - this.last_mouse[1];
        if (this.dragging) {
          this.mouseDrag(deltax, deltay);
        }
      }
    } else if (e2.type == LiteGraph.pointerevents_method + "up") {
      this.dragging = false;
      LiteGraph.pointerListenerRemove(document, "move", this._binded_mouse_callback);
      LiteGraph.pointerListenerRemove(document, "up", this._binded_mouse_callback);
      LiteGraph.pointerListenerAdd(canvas, "move", this._binded_mouse_callback);
    } else if (is_inside && (e2.type == "mousewheel" || e2.type == "wheel" || e2.type == "DOMMouseScroll")) {
      e2.eventType = "mousewheel";
      if (e2.type == "wheel") e2.wheel = -e2.deltaY;
      else e2.wheel = e2.wheelDeltaY != null ? e2.wheelDeltaY : e2.detail * -60;
      e2.delta = e2.wheelDelta ? e2.wheelDelta / 40 : e2.deltaY ? -e2.deltaY / 3 : 0;
      this.changeDeltaScale(1 + e2.delta * 0.05);
    }
    this.last_mouse[0] = x2;
    this.last_mouse[1] = y2;
    if (is_inside) {
      e2.preventDefault();
      e2.stopPropagation();
      return false;
    }
  }
  toCanvasContext(ctx) {
    ctx.scale(this.scale, this.scale);
    ctx.translate(this.offset[0], this.offset[1]);
  }
  convertOffsetToCanvas(pos2) {
    return [
      (pos2[0] + this.offset[0]) * this.scale,
      (pos2[1] + this.offset[1]) * this.scale
    ];
  }
  convertCanvasToOffset(pos2, out) {
    out = out || [0, 0];
    out[0] = pos2[0] / this.scale - this.offset[0];
    out[1] = pos2[1] / this.scale - this.offset[1];
    return out;
  }
  /** @deprecated Has not been kept up to date */
  mouseDrag(x2, y2) {
    this.offset[0] += x2 / this.scale;
    this.offset[1] += y2 / this.scale;
    this.onredraw?.(this);
  }
  changeScale(value4, zooming_center) {
    if (value4 < this.min_scale) {
      value4 = this.min_scale;
    } else if (value4 > this.max_scale) {
      value4 = this.max_scale;
    }
    if (value4 == this.scale) return;
    if (!this.element) return;
    const rect = this.element.getBoundingClientRect();
    if (!rect) return;
    zooming_center = zooming_center || [rect.width * 0.5, rect.height * 0.5];
    zooming_center[0] -= rect.x;
    zooming_center[1] -= rect.y;
    const center = this.convertCanvasToOffset(zooming_center);
    this.scale = value4;
    if (Math.abs(this.scale - 1) < 0.01) this.scale = 1;
    const new_center = this.convertCanvasToOffset(zooming_center);
    const delta_offset = [
      new_center[0] - center[0],
      new_center[1] - center[1]
    ];
    this.offset[0] += delta_offset[0];
    this.offset[1] += delta_offset[1];
    this.onredraw?.(this);
  }
  changeDeltaScale(value4, zooming_center) {
    this.changeScale(this.scale * value4, zooming_center);
  }
  reset() {
    this.scale = 1;
    this.offset[0] = 0;
    this.offset[1] = 0;
  }
}
function stringOrNull(value4) {
  return value4 == null ? null : String(value4);
}
__name(stringOrNull, "stringOrNull");
function stringOrEmpty(value4) {
  return value4 == null ? "" : String(value4);
}
__name(stringOrEmpty, "stringOrEmpty");
function getBoundaryNodes(nodes) {
  const valid = nodes?.find((x2) => x2);
  if (!valid) return null;
  let top = valid;
  let right = valid;
  let bottom = valid;
  let left = valid;
  for (const node22 of nodes) {
    if (!node22) continue;
    const [x2, y2] = node22.pos;
    const [width2, height] = node22.size;
    if (y2 < top.pos[1]) top = node22;
    if (x2 + width2 > right.pos[0] + right.size[0]) right = node22;
    if (y2 + height > bottom.pos[1] + bottom.size[1]) bottom = node22;
    if (x2 < left.pos[0]) left = node22;
  }
  return {
    top,
    right,
    bottom,
    left
  };
}
__name(getBoundaryNodes, "getBoundaryNodes");
function distributeNodes(nodes, horizontal2) {
  const nodeCount = nodes?.length;
  if (!(nodeCount > 1)) return;
  const index2 = horizontal2 ? 0 : 1;
  let total = 0;
  let highest = -Infinity;
  for (const node22 of nodes) {
    total += node22.size[index2];
    const high = node22.pos[index2] + node22.size[index2];
    if (high > highest) highest = high;
  }
  const sorted = [...nodes].sort((a, b) => a.pos[index2] - b.pos[index2]);
  const lowest = sorted[0].pos[index2];
  const gap = (highest - lowest - total) / (nodeCount - 1);
  let startAt = lowest;
  for (let i2 = 0; i2 < nodeCount; i2++) {
    const node22 = sorted[i2];
    node22.pos[index2] = startAt + gap * i2;
    startAt += node22.size[index2];
  }
}
__name(distributeNodes, "distributeNodes");
function alignNodes(nodes, direction, align_to) {
  if (!nodes) return;
  const boundary = align_to === void 0 ? getBoundaryNodes(nodes) : { top: align_to, right: align_to, bottom: align_to, left: align_to };
  if (boundary === null) return;
  for (const node22 of nodes) {
    switch (direction) {
      case "right":
        node22.pos[0] = boundary.right.pos[0] + boundary.right.size[0] - node22.size[0];
        break;
      case "left":
        node22.pos[0] = boundary.left.pos[0];
        break;
      case "top":
        node22.pos[1] = boundary.top.pos[1];
        break;
      case "bottom":
        node22.pos[1] = boundary.bottom.pos[1] + boundary.bottom.size[1] - node22.size[1];
        break;
    }
  }
}
__name(alignNodes, "alignNodes");
function getAllNestedItems(items2) {
  const allItems = /* @__PURE__ */ new Set();
  items2?.forEach((x2) => addRecursively(x2, allItems));
  return allItems;
  function addRecursively(item3, flatSet) {
    if (flatSet.has(item3) || item3.pinned) return;
    flatSet.add(item3);
    item3.children?.forEach((x2) => addRecursively(x2, flatSet));
  }
  __name(addRecursively, "addRecursively");
}
__name(getAllNestedItems, "getAllNestedItems");
function findFirstNode(items2) {
  for (const item3 of items2) {
    if (item3 instanceof LGraphNode) return item3;
  }
}
__name(findFirstNode, "findFirstNode");
class CanvasPointer {
  static {
    __name(this, "CanvasPointer");
  }
  /** Maximum time in milliseconds to ignore click drift */
  static bufferTime = 150;
  /** Maximum gap between pointerup and pointerdown events to be considered as a double click */
  static doubleClickTime = 300;
  /** Maximum offset from click location */
  static get maxClickDrift() {
    return this.#maxClickDrift;
  }
  static set maxClickDrift(value4) {
    this.#maxClickDrift = value4;
    this.#maxClickDrift2 = value4 * value4;
  }
  static #maxClickDrift = 6;
  /** {@link maxClickDrift} squared.  Used to calculate click drift without `sqrt`. */
  static #maxClickDrift2 = this.#maxClickDrift ** 2;
  /** The element this PointerState should capture input against when dragging. */
  element;
  /** Pointer ID used by drag capture. */
  pointerId;
  /** Set to true when if the pointer moves far enough after a down event, before the corresponding up event is fired. */
  dragStarted = false;
  /** The {@link eUp} from the last successful click */
  eLastDown;
  /** Used downstream for touch event support. */
  isDouble = false;
  /** Used downstream for touch event support. */
  isDown = false;
  /**
   * If `true`, {@link eDown}, {@link eMove}, and {@link eUp} will be set to
   * `null` when {@link reset} is called.
   *
   * Default: `true`
   */
  clearEventsOnReset = true;
  /** The last pointerdown event for the primary button */
  eDown = null;
  /** The last pointermove event for the primary button */
  eMove = null;
  /** The last pointerup event for the primary button */
  eUp = null;
  /**
   * Run-once callback, called at the end of any click or drag, whether or not it was successful in any way.
   *
   * The setter of this callback will call the existing value before replacing it.
   * Therefore, simply setting this value twice will execute the first callback.
   */
  get finally() {
    return this.#finally;
  }
  set finally(value4) {
    try {
      this.#finally?.();
    } finally {
      this.#finally = value4;
    }
  }
  #finally;
  constructor(element) {
    this.element = element;
  }
  /**
   * Callback for `pointerdown` events.  To be used as the event handler (or called by it).
   * @param e The `pointerdown` event
   */
  down(e2) {
    this.reset();
    this.eDown = e2;
    this.pointerId = e2.pointerId;
    this.element.setPointerCapture(e2.pointerId);
  }
  /**
   * Callback for `pointermove` events.  To be used as the event handler (or called by it).
   * @param e The `pointermove` event
   */
  move(e2) {
    const { eDown } = this;
    if (!eDown) return;
    if (!e2.buttons) {
      this.reset();
      return;
    }
    if (!(e2.buttons & eDown.buttons)) {
      this.#completeClick(e2);
      this.reset();
      return;
    }
    this.eMove = e2;
    this.onDrag?.(e2);
    if (this.dragStarted) return;
    const longerThanBufferTime = e2.timeStamp - eDown.timeStamp > CanvasPointer.bufferTime;
    if (longerThanBufferTime || !this.#hasSamePosition(e2, eDown)) {
      this.#setDragStarted();
    }
  }
  /**
   * Callback for `pointerup` events.  To be used as the event handler (or called by it).
   * @param e The `pointerup` event
   */
  up(e2) {
    if (e2.button !== this.eDown?.button) return false;
    this.#completeClick(e2);
    const { dragStarted } = this;
    this.reset();
    return !dragStarted;
  }
  #completeClick(e2) {
    const { eDown } = this;
    if (!eDown) return;
    this.eUp = e2;
    if (this.dragStarted) {
      this.onDragEnd?.(e2);
    } else if (!this.#hasSamePosition(e2, eDown)) {
      this.#setDragStarted();
      this.onDragEnd?.(e2);
    } else if (this.onDoubleClick && this.#isDoubleClick()) {
      this.onDoubleClick(e2);
      this.eLastDown = void 0;
    } else {
      this.onClick?.(e2);
      this.eLastDown = eDown;
    }
  }
  /**
   * Checks if two events occurred near each other - not further apart than the maximum click drift.
   * @param a The first event to compare
   * @param b The second event to compare
   * @param tolerance2 The maximum distance (squared) before the positions are considered different
   * @returns `true` if the two events were no more than {@link maxClickDrift} apart, otherwise `false`
   */
  #hasSamePosition(a, b, tolerance2 = CanvasPointer.#maxClickDrift2) {
    const drift = dist2(a.clientX, a.clientY, b.clientX, b.clientY);
    return drift <= tolerance2;
  }
  /**
   * Checks whether the pointer is currently past the max click drift threshold.
   * @returns `true` if the latest pointer event is past the the click drift threshold
   */
  #isDoubleClick() {
    const { eDown, eLastDown } = this;
    if (!eDown || !eLastDown) return false;
    const tolerance2 = (3 * CanvasPointer.#maxClickDrift) ** 2;
    const diff2 = eDown.timeStamp - eLastDown.timeStamp;
    return diff2 > 0 && diff2 < CanvasPointer.doubleClickTime && this.#hasSamePosition(eDown, eLastDown, tolerance2);
  }
  #setDragStarted() {
    this.dragStarted = true;
    this.onDragStart?.(this);
    delete this.onDragStart;
  }
  /**
   * Resets the state of this {@link CanvasPointer} instance.
   *
   * The {@link finally} callback is first executed, then all callbacks and intra-click
   * state is cleared.
   */
  reset() {
    this.finally = void 0;
    delete this.onClick;
    delete this.onDoubleClick;
    delete this.onDragStart;
    delete this.onDrag;
    delete this.onDragEnd;
    this.isDown = false;
    this.isDouble = false;
    this.dragStarted = false;
    if (this.clearEventsOnReset) {
      this.eDown = null;
      this.eMove = null;
      this.eUp = null;
    }
    const { element, pointerId } = this;
    if (element.hasPointerCapture(pointerId))
      element.releasePointerCapture(pointerId);
  }
}
class LGraphCanvas {
  static {
    __name(this, "LGraphCanvas");
  }
  // Optimised buffers used during rendering
  static #temp = new Float32Array(4);
  static #temp_vec2 = new Float32Array(2);
  static #tmp_area = new Float32Array(4);
  static #margin_area = new Float32Array(4);
  static #link_bounding = new Float32Array(4);
  static #tempA = new Float32Array(2);
  static #tempB = new Float32Array(2);
  static #lTempA = new Float32Array(2);
  static #lTempB = new Float32Array(2);
  static #lTempC = new Float32Array(2);
  static DEFAULT_BACKGROUND_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQBJREFUeNrs1rEKwjAUhlETUkj3vP9rdmr1Ysammk2w5wdxuLgcMHyptfawuZX4pJSWZTnfnu/lnIe/jNNxHHGNn//HNbbv+4dr6V+11uF527arU7+u63qfa/bnmh8sWLBgwYJlqRf8MEptXPBXJXa37BSl3ixYsGDBMliwFLyCV/DeLIMFCxYsWLBMwSt4Be/NggXLYMGCBUvBK3iNruC9WbBgwYJlsGApeAWv4L1ZBgsWLFiwYJmCV/AK3psFC5bBggULloJX8BpdwXuzYMGCBctgwVLwCl7Be7MMFixYsGDBsu8FH1FaSmExVfAxBa/gvVmwYMGCZbBg/W4vAQYA5tRF9QYlv/QAAAAASUVORK5CYII=";
  /** Initialised from LiteGraphGlobal static block to avoid circular dependency. */
  static link_type_colors;
  static gradients = {};
  // cache of gradients
  static search_limit = -1;
  static node_colors = {
    red: { color: "#322", bgcolor: "#533", groupcolor: "#A88" },
    brown: { color: "#332922", bgcolor: "#593930", groupcolor: "#b06634" },
    green: { color: "#232", bgcolor: "#353", groupcolor: "#8A8" },
    blue: { color: "#223", bgcolor: "#335", groupcolor: "#88A" },
    pale_blue: {
      color: "#2a363b",
      bgcolor: "#3f5159",
      groupcolor: "#3f789e"
    },
    cyan: { color: "#233", bgcolor: "#355", groupcolor: "#8AA" },
    purple: { color: "#323", bgcolor: "#535", groupcolor: "#a1309b" },
    yellow: { color: "#432", bgcolor: "#653", groupcolor: "#b58b2a" },
    black: { color: "#222", bgcolor: "#000", groupcolor: "#444" }
  };
  /**
   * The state of this canvas, e.g. whether it is being dragged, or read-only.
   *
   * Implemented as a POCO that can be proxied without side-effects.
   */
  state = {
    draggingItems: false,
    draggingCanvas: false,
    readOnly: false,
    hoveringOver: CanvasItem.Nothing,
    shouldSetCursor: true
  };
  #updateCursorStyle() {
    if (this.state.shouldSetCursor) {
      let cursor = "default";
      if (this.state.draggingCanvas) {
        cursor = "grabbing";
      } else if (this.state.readOnly) {
        cursor = "grab";
      } else if (this.state.hoveringOver & CanvasItem.ResizeSe) {
        cursor = "se-resize";
      } else if (this.state.hoveringOver & CanvasItem.Node) {
        cursor = "crosshair";
      }
      this.canvas.style.cursor = cursor;
    }
  }
  // Whether the canvas was previously being dragged prior to pressing space key.
  // null if space key is not pressed.
  _previously_dragging_canvas = null;
  // #region Legacy accessors
  /** @deprecated @inheritdoc {@link LGraphCanvasState.readOnly} */
  get read_only() {
    return this.state.readOnly;
  }
  set read_only(value4) {
    this.state.readOnly = value4;
    this.#updateCursorStyle();
  }
  get isDragging() {
    return this.state.draggingItems;
  }
  set isDragging(value4) {
    this.state.draggingItems = value4;
  }
  get hoveringOver() {
    return this.state.hoveringOver;
  }
  set hoveringOver(value4) {
    this.state.hoveringOver = value4;
    this.#updateCursorStyle();
  }
  /** @deprecated Replace all references with {@link pointer}.{@link CanvasPointer.isDown isDown}. */
  get pointer_is_down() {
    return this.pointer.isDown;
  }
  /** @deprecated Replace all references with {@link pointer}.{@link CanvasPointer.isDouble isDouble}. */
  get pointer_is_double() {
    return this.pointer.isDouble;
  }
  /** @deprecated @inheritdoc {@link LGraphCanvasState.draggingCanvas} */
  get dragging_canvas() {
    return this.state.draggingCanvas;
  }
  set dragging_canvas(value4) {
    this.state.draggingCanvas = value4;
    this.#updateCursorStyle();
  }
  // #endregion Legacy accessors
  get title_text_font() {
    return `${LiteGraph.NODE_TEXT_SIZE}px Arial`;
  }
  get inner_text_font() {
    return `normal ${LiteGraph.NODE_SUBTEXT_SIZE}px Arial`;
  }
  #maximumFrameGap = 0;
  /** Maximum frames per second to render. 0: unlimited. Default: 0 */
  get maximumFps() {
    return this.#maximumFrameGap > Number.EPSILON ? this.#maximumFrameGap / 1e3 : 0;
  }
  set maximumFps(value4) {
    this.#maximumFrameGap = value4 > Number.EPSILON ? 1e3 / value4 : 0;
  }
  options;
  background_image;
  ds;
  pointer;
  zoom_modify_alpha;
  zoom_speed;
  node_title_color;
  default_link_color;
  default_connection_color;
  default_connection_color_byType;
  default_connection_color_byTypeOff;
  highquality_render;
  use_gradients;
  editor_alpha;
  pause_rendering;
  clear_background;
  clear_background_color;
  render_only_selected;
  show_info;
  allow_dragcanvas;
  allow_dragnodes;
  allow_interaction;
  multi_select;
  allow_searchbox;
  allow_reconnect_links;
  align_to_grid;
  drag_mode;
  dragging_rectangle;
  filter;
  set_canvas_dirty_on_mouse_event;
  always_render_background;
  render_shadows;
  render_canvas_border;
  render_connections_shadows;
  render_connections_border;
  render_curved_connections;
  render_connection_arrows;
  render_collapsed_slots;
  render_execution_order;
  render_title_colored;
  render_link_tooltip;
  /** Controls whether reroutes are rendered at all. */
  reroutesEnabled = false;
  /** Shape of the markers shown at the midpoint of links.  Default: Circle */
  linkMarkerShape = LinkMarkerShape.Circle;
  links_render_mode;
  /** mouse in canvas coordinates, where 0,0 is the top-left corner of the blue rectangle */
  mouse;
  /** mouse in graph coordinates, where 0,0 is the top-left corner of the blue rectangle */
  graph_mouse;
  /** @deprecated LEGACY: REMOVE THIS, USE {@link graph_mouse} INSTEAD */
  canvas_mouse;
  /** to personalize the search box */
  onSearchBox;
  onSearchBoxSelection;
  onMouse;
  /** to render background objects (behind nodes and connections) in the canvas affected by transform */
  onDrawBackground;
  /** to render foreground objects (above nodes and connections) in the canvas affected by transform */
  onDrawForeground;
  connections_width;
  round_radius;
  /** The current node being drawn by {@link drawNode}.  This should NOT be used to determine the currently selected node.  See {@link selectedItems} */
  current_node;
  /** used for widgets */
  node_widget;
  /** The link to draw a tooltip for. */
  over_link_center;
  last_mouse_position;
  /** The visible area of this canvas.  Tightly coupled with {@link ds}. */
  visible_area;
  /** Contains all links and reroutes that were rendered.  Repopulated every render cycle. */
  renderedPaths = /* @__PURE__ */ new Set();
  visible_links;
  connecting_links;
  /** The viewport of this canvas.  Tightly coupled with {@link ds}. */
  viewport;
  autoresize;
  static active_canvas;
  frame = 0;
  last_draw_time = 0;
  render_time = 0;
  fps = 0;
  /** @deprecated See {@link LGraphCanvas.selectedItems} */
  selected_nodes = {};
  /** All selected nodes, groups, and reroutes */
  selectedItems = /* @__PURE__ */ new Set();
  /** The group currently being resized. */
  resizingGroup = null;
  /** @deprecated See {@link LGraphCanvas.selectedItems} */
  selected_group = null;
  visible_nodes = [];
  node_over;
  node_capturing_input;
  highlighted_links = {};
  link_over_widget;
  link_over_widget_type;
  dirty_canvas = true;
  dirty_bgcanvas = true;
  /** A map of nodes that require selective-redraw */
  dirty_nodes = /* @__PURE__ */ new Map();
  dirty_area;
  /** @deprecated Unused */
  node_in_panel;
  last_mouse = [0, 0];
  last_mouseclick = 0;
  graph;
  _graph_stack = null;
  canvas;
  bgcanvas;
  ctx;
  _events_binded;
  /** @deprecated WebGL */
  gl;
  bgctx;
  is_rendering;
  /** @deprecated Panels */
  block_click;
  /** @deprecated Panels */
  last_click_position;
  resizing_node;
  /** @deprecated See {@link LGraphCanvas.resizingGroup} */
  selected_group_resizing;
  /** @deprecated See {@link pointer}.{@link CanvasPointer.dragStarted dragStarted} */
  last_mouse_dragging;
  onMouseDown;
  _highlight_pos;
  _highlight_input;
  // TODO: Check if panels are used
  /** @deprecated Panels */
  node_panel;
  /** @deprecated Panels */
  options_panel;
  onDropItem;
  _bg_img;
  _pattern;
  _pattern_img;
  // TODO: This looks like another panel thing
  prompt_box;
  search_box;
  /** @deprecated Panels */
  SELECTED_NODE;
  /** @deprecated Panels */
  NODEPANEL_IS_OPEN;
  /** Once per frame check of snap to grid value.  @todo Update on change. */
  #snapToGrid;
  /** Set on keydown, keyup. @todo */
  #shiftDown = false;
  static active_node;
  onClear;
  /** called after moving a node @deprecated Does not handle multi-node move, and can return the wrong node. */
  onNodeMoved;
  /** called if the selection changes */
  onSelectionChange;
  /** called when rendering a tooltip */
  onDrawLinkTooltip;
  /** to render foreground objects not affected by transform (for GUIs) */
  onDrawOverlay;
  onRenderBackground;
  onNodeDblClicked;
  onShowNodePanel;
  onNodeSelected;
  onNodeDeselected;
  onRender;
  /** Implement this function to allow conversion of widget types to input types, e.g. number -> INT or FLOAT for widget link validation checks */
  getWidgetLinkType;
  /**
   * Creates a new instance of LGraphCanvas.
   * @param canvas The canvas HTML element (or its id) to use, or null / undefined to leave blank.
   * @param graph The graph that owns this canvas.
   * @param options
   */
  constructor(canvas, graph, options4) {
    options4 ||= {};
    this.options = options4;
    this.background_image = LGraphCanvas.DEFAULT_BACKGROUND_IMAGE;
    this.ds = new DragAndScale();
    this.pointer = new CanvasPointer(this.canvas);
    this.zoom_modify_alpha = true;
    this.zoom_speed = 1.1;
    this.node_title_color = LiteGraph.NODE_TITLE_COLOR;
    this.default_link_color = LiteGraph.LINK_COLOR;
    this.default_connection_color = {
      input_off: "#778",
      input_on: "#7F7",
      // "#BBD"
      output_off: "#778",
      output_on: "#7F7"
      // "#BBD"
    };
    this.default_connection_color_byType = {
      /* number: "#7F7",
            string: "#77F",
            boolean: "#F77", */
    };
    this.default_connection_color_byTypeOff = {
      /* number: "#474",
            string: "#447",
            boolean: "#744", */
    };
    this.highquality_render = true;
    this.use_gradients = false;
    this.editor_alpha = 1;
    this.pause_rendering = false;
    this.clear_background = true;
    this.clear_background_color = "#222";
    this.render_only_selected = true;
    this.show_info = true;
    this.allow_dragcanvas = true;
    this.allow_dragnodes = true;
    this.allow_interaction = true;
    this.multi_select = false;
    this.allow_searchbox = true;
    this.allow_reconnect_links = true;
    this.align_to_grid = false;
    this.drag_mode = false;
    this.dragging_rectangle = null;
    this.filter = null;
    this.set_canvas_dirty_on_mouse_event = true;
    this.always_render_background = false;
    this.render_shadows = true;
    this.render_canvas_border = true;
    this.render_connections_shadows = false;
    this.render_connections_border = true;
    this.render_curved_connections = false;
    this.render_connection_arrows = false;
    this.render_collapsed_slots = true;
    this.render_execution_order = false;
    this.render_title_colored = true;
    this.render_link_tooltip = true;
    this.links_render_mode = LinkRenderType.SPLINE_LINK;
    this.mouse = [0, 0];
    this.graph_mouse = [0, 0];
    this.canvas_mouse = this.graph_mouse;
    this.onSearchBox = null;
    this.onSearchBoxSelection = null;
    this.onMouse = null;
    this.onDrawBackground = null;
    this.onDrawForeground = null;
    this.onDrawOverlay = null;
    this.onDrawLinkTooltip = null;
    this.onNodeMoved = null;
    this.onSelectionChange = null;
    this.onConnectingChange = null;
    this.onBeforeChange = null;
    this.onAfterChange = null;
    this.connections_width = 3;
    this.round_radius = 8;
    this.current_node = null;
    this.node_widget = null;
    this.over_link_center = null;
    this.last_mouse_position = [0, 0];
    this.visible_area = this.ds.visible_area;
    this.visible_links = [];
    this.connecting_links = null;
    this.viewport = options4.viewport || null;
    graph?.attachCanvas(this);
    this.setCanvas(canvas, options4.skip_events);
    this.clear();
    if (!options4.skip_render) {
      this.startRendering();
    }
    this.autoresize = options4.autoresize;
  }
  static getFileExtension(url) {
    const question = url.indexOf("?");
    if (question !== -1) url = url.substring(0, question);
    const point = url.lastIndexOf(".");
    return point === -1 ? "" : url.substring(point + 1).toLowerCase();
  }
  static onGroupAdd(info, entry, mouse_event) {
    const canvas = LGraphCanvas.active_canvas;
    const group = new LiteGraph.LGraphGroup();
    group.pos = canvas.convertEventToCanvasOffset(mouse_event);
    canvas.graph.add(group);
  }
  /**
   * @deprecated Functionality moved to {@link getBoundaryNodes}.  The new function returns null on failure, instead of an object with all null properties.
   * Determines the furthest nodes in each direction
   * @param nodes the nodes to from which boundary nodes will be extracted
   * @returns
   */
  static getBoundaryNodes(nodes) {
    const _nodes = Array.isArray(nodes) ? nodes : Object.values(nodes);
    return getBoundaryNodes(_nodes) ?? {
      top: null,
      right: null,
      bottom: null,
      left: null
    };
  }
  /**
   * @deprecated Functionality moved to {@link alignNodes}.  The new function does not set dirty canvas.
   * @param nodes a list of nodes
   * @param direction Direction to align the nodes
   * @param align_to Node to align to (if null, align to the furthest node in the given direction)
   */
  static alignNodes(nodes, direction, align_to) {
    alignNodes(Object.values(nodes), direction, align_to);
    LGraphCanvas.active_canvas.setDirty(true, true);
  }
  static onNodeAlign(value4, options4, event, prev_menu, node22) {
    new LiteGraph.ContextMenu(["Top", "Bottom", "Left", "Right"], {
      event,
      callback: inner_clicked,
      parentMenu: prev_menu
    });
    function inner_clicked(value22) {
      alignNodes(
        Object.values(LGraphCanvas.active_canvas.selected_nodes),
        value22.toLowerCase(),
        node22
      );
      LGraphCanvas.active_canvas.setDirty(true, true);
    }
    __name(inner_clicked, "inner_clicked");
  }
  static onGroupAlign(value4, options4, event, prev_menu) {
    new LiteGraph.ContextMenu(["Top", "Bottom", "Left", "Right"], {
      event,
      callback: inner_clicked,
      parentMenu: prev_menu
    });
    function inner_clicked(value22) {
      alignNodes(
        Object.values(LGraphCanvas.active_canvas.selected_nodes),
        value22.toLowerCase()
      );
      LGraphCanvas.active_canvas.setDirty(true, true);
    }
    __name(inner_clicked, "inner_clicked");
  }
  static createDistributeMenu(value4, options4, event, prev_menu, node22) {
    new LiteGraph.ContextMenu(["Vertically", "Horizontally"], {
      event,
      callback: inner_clicked,
      parentMenu: prev_menu
    });
    function inner_clicked(value22) {
      const canvas = LGraphCanvas.active_canvas;
      distributeNodes(Object.values(canvas.selected_nodes), value22 === "Horizontally");
      canvas.setDirty(true, true);
    }
    __name(inner_clicked, "inner_clicked");
  }
  static onMenuAdd(node22, options4, e2, prev_menu, callback) {
    const canvas = LGraphCanvas.active_canvas;
    const ref_window = canvas.getCanvasWindow();
    const graph = canvas.graph;
    if (!graph) return;
    function inner_onMenuAdded(base_category, prev_menu2) {
      const categories = LiteGraph.getNodeTypesCategories(canvas.filter || graph.filter).filter(function(category) {
        return category.startsWith(base_category);
      });
      const entries = [];
      categories.map(function(category) {
        if (!category) return;
        const base_category_regex = new RegExp("^(" + base_category + ")");
        const category_name = category.replace(base_category_regex, "").split("/")[0];
        const category_path = base_category === "" ? category_name + "/" : base_category + category_name + "/";
        let name2 = category_name;
        if (name2.indexOf("::") != -1)
          name2 = name2.split("::")[1];
        const index2 = entries.findIndex(function(entry) {
          return entry.value === category_path;
        });
        if (index2 === -1) {
          entries.push({
            value: category_path,
            content: name2,
            has_submenu: true,
            callback: /* @__PURE__ */ __name(function(value4, event, mouseEvent, contextMenu) {
              inner_onMenuAdded(value4.value, contextMenu);
            }, "callback")
          });
        }
      });
      const nodes = LiteGraph.getNodeTypesInCategory(
        base_category.slice(0, -1),
        canvas.filter || graph.filter
      );
      nodes.map(function(node3) {
        if (node3.skip_list) return;
        const entry = {
          value: node3.type,
          content: node3.title,
          has_submenu: false,
          callback: /* @__PURE__ */ __name(function(value4, event, mouseEvent, contextMenu) {
            const first_event = contextMenu.getFirstEvent();
            canvas.graph.beforeChange();
            const node4 = LiteGraph.createNode(value4.value);
            if (node4) {
              node4.pos = canvas.convertEventToCanvasOffset(first_event);
              canvas.graph.add(node4);
            }
            callback?.(node4);
            canvas.graph.afterChange();
          }, "callback")
        };
        entries.push(entry);
      });
      new LiteGraph.ContextMenu(entries, { event: e2, parentMenu: prev_menu2 }, ref_window);
    }
    __name(inner_onMenuAdded, "inner_onMenuAdded");
    inner_onMenuAdded("", prev_menu);
    return false;
  }
  static onMenuCollapseAll() {
  }
  static onMenuNodeEdit() {
  }
  /** @param options Parameter is never used */
  static showMenuNodeOptionalInputs(v2, options4, e2, prev_menu, node22) {
    if (!node22) return;
    const that = this;
    const canvas = LGraphCanvas.active_canvas;
    const ref_window = canvas.getCanvasWindow();
    options4 = node22.onGetInputs ? node22.onGetInputs() : node22.optional_inputs;
    let entries = [];
    if (options4) {
      for (let i2 = 0; i2 < options4.length; i2++) {
        const entry = options4[i2];
        if (!entry) {
          entries.push(null);
          continue;
        }
        let label5 = entry[0];
        entry[2] ||= {};
        if (entry[2].label) {
          label5 = entry[2].label;
        }
        entry[2].removable = true;
        const data24 = { content: label5, value: entry };
        if (entry[1] == LiteGraph.ACTION) {
          data24.className = "event";
        }
        entries.push(data24);
      }
    }
    const retEntries = node22.onMenuNodeInputs?.(entries);
    if (retEntries) entries = retEntries;
    if (!entries.length) {
      console.log("no input entries");
      return;
    }
    new LiteGraph.ContextMenu(
      entries,
      {
        event: e2,
        callback: inner_clicked,
        parentMenu: prev_menu,
        node: node22
      },
      // @ts-expect-error Unused param
      ref_window
    );
    function inner_clicked(v3, e3, prev2) {
      if (!node22) return;
      v3.callback?.call(that, node22, v3, e3, prev2);
      if (!v3.value) return;
      node22.graph.beforeChange();
      node22.addInput(v3.value[0], v3.value[1], v3.value[2]);
      node22.onNodeInputAdd?.(v3.value);
      canvas.setDirty(true, true);
      node22.graph.afterChange();
    }
    __name(inner_clicked, "inner_clicked");
    return false;
  }
  /** @param options Parameter is never used */
  static showMenuNodeOptionalOutputs(v2, options4, e2, prev_menu, node22) {
    if (!node22) return;
    const that = this;
    const canvas = LGraphCanvas.active_canvas;
    const ref_window = canvas.getCanvasWindow();
    options4 = node22.onGetOutputs ? node22.onGetOutputs() : node22.optional_outputs;
    let entries = [];
    if (options4) {
      for (let i2 = 0; i2 < options4.length; i2++) {
        const entry = options4[i2];
        if (!entry) {
          entries.push(null);
          continue;
        }
        if (node22.flags && node22.flags.skip_repeated_outputs && node22.findOutputSlot(entry[0]) != -1) {
          continue;
        }
        let label5 = entry[0];
        entry[2] ||= {};
        if (entry[2].label) {
          label5 = entry[2].label;
        }
        entry[2].removable = true;
        const data24 = { content: label5, value: entry };
        if (entry[1] == LiteGraph.EVENT) {
          data24.className = "event";
        }
        entries.push(data24);
      }
    }
    if (this.onMenuNodeOutputs) entries = this.onMenuNodeOutputs(entries);
    if (LiteGraph.do_add_triggers_slots) {
      if (node22.findOutputSlot("onExecuted") == -1) {
        entries.push({ content: "On Executed", value: ["onExecuted", LiteGraph.EVENT, { nameLocked: true }], className: "event" });
      }
    }
    const retEntries = node22.onMenuNodeOutputs?.(entries);
    if (retEntries) entries = retEntries;
    if (!entries.length) return;
    new LiteGraph.ContextMenu(
      entries,
      {
        event: e2,
        callback: inner_clicked,
        parentMenu: prev_menu,
        node: node22
      },
      // @ts-expect-error Unused
      ref_window
    );
    function inner_clicked(v3, e3, prev2) {
      if (!node22) return;
      if (v3.callback) v3.callback.call(that, node22, v3, e3, prev2);
      if (!v3.value) return;
      const value4 = v3.value[1];
      if (value4 && (typeof value4 === "object" || Array.isArray(value4))) {
        const entries2 = [];
        for (const i2 in value4) {
          entries2.push({ content: i2, value: value4[i2] });
        }
        new LiteGraph.ContextMenu(entries2, {
          event: e3,
          callback: inner_clicked,
          parentMenu: prev_menu,
          node: node22
        });
        return false;
      }
      const graph = node22.graph;
      graph.beforeChange();
      node22.addOutput(v3.value[0], v3.value[1], v3.value[2]);
      node22.onNodeOutputAdd?.(v3.value);
      canvas.setDirty(true, true);
      graph.afterChange();
    }
    __name(inner_clicked, "inner_clicked");
    return false;
  }
  /** @param value Parameter is never used */
  static onShowMenuNodeProperties(value4, options4, e2, prev_menu, node22) {
    if (!node22 || !node22.properties) return;
    const canvas = LGraphCanvas.active_canvas;
    const ref_window = canvas.getCanvasWindow();
    const entries = [];
    for (const i2 in node22.properties) {
      value4 = node22.properties[i2] !== void 0 ? node22.properties[i2] : " ";
      if (typeof value4 == "object")
        value4 = JSON.stringify(value4);
      const info = node22.getPropertyInfo(i2);
      if (info.type == "enum" || info.type == "combo")
        value4 = LGraphCanvas.getPropertyPrintableValue(value4, info.values);
      value4 = LGraphCanvas.decodeHTML(stringOrNull(value4));
      entries.push({
        content: "<span class='property_name'>" + (info.label || i2) + "</span><span class='property_value'>" + value4 + "</span>",
        value: i2
      });
    }
    if (!entries.length) {
      return;
    }
    new LiteGraph.ContextMenu(
      entries,
      {
        event: e2,
        callback: inner_clicked,
        parentMenu: prev_menu,
        allow_html: true,
        node: node22
      },
      // @ts-expect-error Unused
      ref_window
    );
    function inner_clicked(v2) {
      if (!node22) return;
      const rect = this.getBoundingClientRect();
      canvas.showEditPropertyValue(node22, v2.value, {
        position: [rect.left, rect.top]
      });
    }
    __name(inner_clicked, "inner_clicked");
    return false;
  }
  static decodeHTML(str) {
    const e2 = document.createElement("div");
    e2.innerText = str;
    return e2.innerHTML;
  }
  static onMenuResizeNode(value4, options4, e2, menu2, node22) {
    if (!node22) return;
    const fApplyMultiNode = /* @__PURE__ */ __name(function(node3) {
      node3.size = node3.computeSize();
      node3.onResize?.(node3.size);
    }, "fApplyMultiNode");
    const canvas = LGraphCanvas.active_canvas;
    if (!canvas.selected_nodes || Object.keys(canvas.selected_nodes).length <= 1) {
      fApplyMultiNode(node22);
    } else {
      for (const i2 in canvas.selected_nodes) {
        fApplyMultiNode(canvas.selected_nodes[i2]);
      }
    }
    canvas.setDirty(true, true);
  }
  // TODO refactor :: this is used fot title but not for properties!
  static onShowPropertyEditor(item3, options4, e2, menu2, node22) {
    const property = item3.property || "title";
    const value4 = node22[property];
    const dialog = document.createElement("div");
    dialog.is_modified = false;
    dialog.className = "graphdialog";
    dialog.innerHTML = "<span class='name'></span><input autofocus type='text' class='value'/><button>OK</button>";
    dialog.close = function() {
      dialog.parentNode?.removeChild(dialog);
    };
    const title = dialog.querySelector(".name");
    title.innerText = property;
    const input = dialog.querySelector(".value");
    if (input) {
      input.value = value4;
      input.addEventListener("blur", function() {
        this.focus();
      });
      input.addEventListener("keydown", function(e3) {
        dialog.is_modified = true;
        if (e3.keyCode == 27) {
          dialog.close();
        } else if (e3.keyCode == 13) {
          inner();
        } else if (e3.keyCode != 13 && e3.target.localName != "textarea") {
          return;
        }
        e3.preventDefault();
        e3.stopPropagation();
      });
    }
    const canvas = LGraphCanvas.active_canvas;
    const canvasEl = canvas.canvas;
    const rect = canvasEl.getBoundingClientRect();
    let offsetx = -20;
    let offsety = -20;
    if (rect) {
      offsetx -= rect.left;
      offsety -= rect.top;
    }
    if (e2) {
      dialog.style.left = e2.clientX + offsetx + "px";
      dialog.style.top = e2.clientY + offsety + "px";
    } else {
      dialog.style.left = canvasEl.width * 0.5 + offsetx + "px";
      dialog.style.top = canvasEl.height * 0.5 + offsety + "px";
    }
    const button = dialog.querySelector("button");
    button.addEventListener("click", inner);
    canvasEl.parentNode.appendChild(dialog);
    input?.focus();
    let dialogCloseTimer = null;
    dialog.addEventListener("mouseleave", function() {
      if (LiteGraph.dialog_close_on_mouse_leave) {
        if (!dialog.is_modified && LiteGraph.dialog_close_on_mouse_leave)
          dialogCloseTimer = setTimeout(
            dialog.close,
            LiteGraph.dialog_close_on_mouse_leave_delay
          );
      }
    });
    dialog.addEventListener("mouseenter", function() {
      if (LiteGraph.dialog_close_on_mouse_leave) {
        if (dialogCloseTimer) clearTimeout(dialogCloseTimer);
      }
    });
    function inner() {
      if (input) setValue2(input.value);
    }
    __name(inner, "inner");
    function setValue2(value22) {
      if (item3.type == "Number") {
        value22 = Number(value22);
      } else if (item3.type == "Boolean") {
        value22 = Boolean(value22);
      }
      node22[property] = value22;
      dialog.parentNode?.removeChild(dialog);
      canvas.setDirty(true, true);
    }
    __name(setValue2, "setValue");
  }
  static getPropertyPrintableValue(value4, values) {
    if (!values) return String(value4);
    if (Array.isArray(values)) {
      return String(value4);
    }
    if (typeof values === "object") {
      let desc_value = "";
      for (const k in values) {
        if (values[k] != value4) continue;
        desc_value = k;
        break;
      }
      return String(value4) + " (" + desc_value + ")";
    }
  }
  static onMenuNodeCollapse(value4, options4, e2, menu2, node22) {
    node22.graph.beforeChange(
      /* ? */
    );
    const fApplyMultiNode = /* @__PURE__ */ __name(function(node3) {
      node3.collapse();
    }, "fApplyMultiNode");
    const graphcanvas = LGraphCanvas.active_canvas;
    if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1) {
      fApplyMultiNode(node22);
    } else {
      for (const i2 in graphcanvas.selected_nodes) {
        fApplyMultiNode(graphcanvas.selected_nodes[i2]);
      }
    }
    node22.graph.afterChange(
      /* ? */
    );
  }
  static onMenuToggleAdvanced(value4, options4, e2, menu2, node22) {
    node22.graph.beforeChange(
      /* ? */
    );
    const fApplyMultiNode = /* @__PURE__ */ __name(function(node3) {
      node3.toggleAdvanced();
    }, "fApplyMultiNode");
    const graphcanvas = LGraphCanvas.active_canvas;
    if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1) {
      fApplyMultiNode(node22);
    } else {
      for (const i2 in graphcanvas.selected_nodes) {
        fApplyMultiNode(graphcanvas.selected_nodes[i2]);
      }
    }
    node22.graph.afterChange(
      /* ? */
    );
  }
  static onMenuNodePin(value4, options4, e2, menu2, node22) {
  }
  static onMenuNodeMode(value4, options4, e2, menu2, node22) {
    new LiteGraph.ContextMenu(
      LiteGraph.NODE_MODES,
      { event: e2, callback: inner_clicked, parentMenu: menu2, node: node22 }
    );
    function inner_clicked(v2) {
      if (!node22) return;
      const kV = Object.values(LiteGraph.NODE_MODES).indexOf(v2);
      const fApplyMultiNode = /* @__PURE__ */ __name(function(node3) {
        if (kV >= 0 && LiteGraph.NODE_MODES[kV])
          node3.changeMode(kV);
        else {
          console.warn("unexpected mode: " + v2);
          node3.changeMode(LGraphEventMode.ALWAYS);
        }
      }, "fApplyMultiNode");
      const graphcanvas = LGraphCanvas.active_canvas;
      if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1) {
        fApplyMultiNode(node22);
      } else {
        for (const i2 in graphcanvas.selected_nodes) {
          fApplyMultiNode(graphcanvas.selected_nodes[i2]);
        }
      }
    }
    __name(inner_clicked, "inner_clicked");
    return false;
  }
  /** @param value Parameter is never used */
  static onMenuNodeColors(value4, options4, e2, menu2, node22) {
    if (!node22) throw "no node for color";
    const values = [];
    values.push({
      value: null,
      content: "<span style='display: block; padding-left: 4px;'>No color</span>"
    });
    for (const i2 in LGraphCanvas.node_colors) {
      const color2 = LGraphCanvas.node_colors[i2];
      value4 = {
        value: i2,
        content: "<span style='display: block; color: #999; padding-left: 4px; border-left: 8px solid " + color2.color + "; background-color:" + color2.bgcolor + "'>" + i2 + "</span>"
      };
      values.push(value4);
    }
    new LiteGraph.ContextMenu(values, {
      event: e2,
      callback: inner_clicked,
      parentMenu: menu2,
      node: node22
    });
    function inner_clicked(v2) {
      if (!node22) return;
      const color2 = v2.value ? LGraphCanvas.node_colors[v2.value] : null;
      const fApplyColor = /* @__PURE__ */ __name(function(node3) {
        if (color2) {
          if (node3 instanceof LGraphGroup) {
            node3.color = color2.groupcolor;
          } else {
            node3.color = color2.color;
            node3.bgcolor = color2.bgcolor;
          }
        } else {
          delete node3.color;
          delete node3.bgcolor;
        }
      }, "fApplyColor");
      const canvas = LGraphCanvas.active_canvas;
      if (!canvas.selected_nodes || Object.keys(canvas.selected_nodes).length <= 1) {
        fApplyColor(node22);
      } else {
        for (const i2 in canvas.selected_nodes) {
          fApplyColor(canvas.selected_nodes[i2]);
        }
      }
      canvas.setDirty(true, true);
    }
    __name(inner_clicked, "inner_clicked");
    return false;
  }
  static onMenuNodeShapes(value4, options4, e2, menu2, node22) {
    if (!node22) throw "no node passed";
    new LiteGraph.ContextMenu(LiteGraph.VALID_SHAPES, {
      event: e2,
      callback: inner_clicked,
      parentMenu: menu2,
      node: node22
    });
    function inner_clicked(v2) {
      if (!node22) return;
      node22.graph.beforeChange(
        /* ? */
      );
      const fApplyMultiNode = /* @__PURE__ */ __name(function(node3) {
        node3.shape = v2;
      }, "fApplyMultiNode");
      const canvas = LGraphCanvas.active_canvas;
      if (!canvas.selected_nodes || Object.keys(canvas.selected_nodes).length <= 1) {
        fApplyMultiNode(node22);
      } else {
        for (const i2 in canvas.selected_nodes) {
          fApplyMultiNode(canvas.selected_nodes[i2]);
        }
      }
      node22.graph.afterChange(
        /* ? */
      );
      canvas.setDirty(true);
    }
    __name(inner_clicked, "inner_clicked");
    return false;
  }
  static onMenuNodeRemove(value4, options4, e2, menu2, node22) {
    if (!node22) throw "no node passed";
    const graph = node22.graph;
    graph.beforeChange();
    const fApplyMultiNode = /* @__PURE__ */ __name(function(node3) {
      if (node3.removable === false) return;
      graph.remove(node3);
    }, "fApplyMultiNode");
    const canvas = LGraphCanvas.active_canvas;
    if (!canvas.selected_nodes || Object.keys(canvas.selected_nodes).length <= 1) {
      fApplyMultiNode(node22);
    } else {
      for (const i2 in canvas.selected_nodes) {
        fApplyMultiNode(canvas.selected_nodes[i2]);
      }
    }
    graph.afterChange();
    canvas.setDirty(true, true);
  }
  static onMenuNodeToSubgraph(value4, options4, e2, menu2, node22) {
    const graph = node22.graph;
    const canvas = LGraphCanvas.active_canvas;
    if (!canvas) return;
    let nodes_list = Object.values(canvas.selected_nodes || {});
    if (!nodes_list.length) nodes_list = [node22];
    const subgraph_node = LiteGraph.createNode("graph/subgraph");
    subgraph_node.pos = node22.pos.concat();
    graph.add(subgraph_node);
    subgraph_node.buildFromNodes(nodes_list);
    canvas.deselectAll();
    canvas.setDirty(true, true);
  }
  static onMenuNodeClone(value4, options4, e2, menu2, node22) {
    const graph = node22.graph;
    graph.beforeChange();
    const newSelected = /* @__PURE__ */ new Set();
    const fApplyMultiNode = /* @__PURE__ */ __name(function(node3, newNodes) {
      if (node3.clonable === false) return;
      const newnode = node3.clone();
      if (!newnode) return;
      newnode.pos = [node3.pos[0] + 5, node3.pos[1] + 5];
      node3.graph.add(newnode);
      newNodes.add(newnode);
    }, "fApplyMultiNode");
    const canvas = LGraphCanvas.active_canvas;
    if (!canvas.selected_nodes || Object.keys(canvas.selected_nodes).length <= 1) {
      fApplyMultiNode(node22, newSelected);
    } else {
      for (const i2 in canvas.selected_nodes) {
        fApplyMultiNode(canvas.selected_nodes[i2], newSelected);
      }
    }
    if (newSelected.size) {
      canvas.selectNodes([...newSelected]);
    }
    graph.afterChange();
    canvas.setDirty(true, true);
  }
  /**
   * clears all the data inside
   *
   */
  clear() {
    this.frame = 0;
    this.last_draw_time = 0;
    this.render_time = 0;
    this.fps = 0;
    this.dragging_rectangle = null;
    this.selected_nodes = {};
    this.selected_group = null;
    this.visible_nodes = [];
    this.node_over = null;
    this.node_capturing_input = null;
    this.connecting_links = null;
    this.highlighted_links = {};
    this.dragging_canvas = false;
    this.#dirty();
    this.dirty_area = null;
    this.node_in_panel = null;
    this.node_widget = null;
    this.last_mouse = [0, 0];
    this.last_mouseclick = 0;
    this.pointer.reset();
    this.visible_area.set([0, 0, 0, 0]);
    this.onClear?.();
  }
  /**
   * assigns a graph, you can reassign graphs to the same canvas
   * @param graph
   */
  setGraph(graph, skip_clear) {
    if (this.graph == graph) return;
    if (!skip_clear) this.clear();
    if (!graph && this.graph) {
      this.graph.detachCanvas(this);
      return;
    }
    graph.attachCanvas(this);
    this._graph_stack &&= null;
    this.setDirty(true, true);
  }
  /**
   * @returns the top level graph (in case there are subgraphs open on the canvas)
   */
  getTopGraph() {
    return this._graph_stack.length ? this._graph_stack[0] : this.graph;
  }
  /**
   * @returns the visually active graph (in case there are more in the stack)
   */
  getCurrentGraph() {
    return this.graph;
  }
  /**
   * Finds the canvas if required, throwing on failure.
   * @param canvas Canvas element, or its element ID
   * @returns The canvas element
   * @throws If {@link canvas} is an element ID that does not belong to a valid HTML canvas element
   */
  #validateCanvas(canvas) {
    if (typeof canvas === "string") {
      const el = document.getElementById(canvas);
      if (!(el instanceof HTMLCanvasElement)) throw "Error validating LiteGraph canvas: Canvas element not found";
      return el;
    }
    return canvas;
  }
  /**
   * Sets the current HTML canvas element.
   * Calls bindEvents to add input event listeners, and (re)creates the background canvas.
   * @param canvas The canvas element to assign, or its HTML element ID.  If null or undefined, the current reference is cleared.
   * @param skip_events If true, events on the previous canvas will not be removed.  Has no effect on the first invocation.
   */
  setCanvas(canvas, skip_events) {
    const element = this.#validateCanvas(canvas);
    if (element === this.canvas) return;
    if (!element && this.canvas && !skip_events) this.unbindEvents();
    this.canvas = element;
    this.ds.element = element;
    this.pointer.element = element;
    if (!element) return;
    element.className += " lgraphcanvas";
    element.data = this;
    element.tabindex = "1";
    this.bgcanvas = null;
    if (!this.bgcanvas) {
      this.bgcanvas = document.createElement("canvas");
      this.bgcanvas.width = this.canvas.width;
      this.bgcanvas.height = this.canvas.height;
    }
    if (element.getContext == null) {
      if (element.localName != "canvas") {
        throw "Element supplied for LGraphCanvas must be a <canvas> element, you passed a " + element.localName;
      }
      throw "This browser doesn't support Canvas";
    }
    const ctx = this.ctx = element.getContext("2d");
    if (ctx == null) {
      if (!element.webgl_enabled) {
        console.warn("This canvas seems to be WebGL, enabling WebGL renderer");
      }
      this.enableWebGL();
    }
    if (!skip_events) this.bindEvents();
  }
  /** Captures an event and prevents default - returns false. */
  _doNothing(e2) {
    e2.preventDefault();
    return false;
  }
  /** Captures an event and prevents default - returns true. */
  _doReturnTrue(e2) {
    e2.preventDefault();
    return true;
  }
  /**
   * binds mouse, keyboard, touch and drag events to the canvas
   */
  bindEvents() {
    if (this._events_binded) {
      console.warn("LGraphCanvas: events already binded");
      return;
    }
    const canvas = this.canvas;
    const ref_window = this.getCanvasWindow();
    const document2 = ref_window.document;
    this._mousedown_callback = this.processMouseDown.bind(this);
    this._mousewheel_callback = this.processMouseWheel.bind(this);
    this._mousemove_callback = this.processMouseMove.bind(this);
    this._mouseup_callback = this.processMouseUp.bind(this);
    this._mouseout_callback = this.processMouseOut.bind(this);
    this._mousecancel_callback = this.processMouseCancel.bind(this);
    LiteGraph.pointerListenerAdd(canvas, "down", this._mousedown_callback, true);
    canvas.addEventListener("mousewheel", this._mousewheel_callback, false);
    LiteGraph.pointerListenerAdd(canvas, "up", this._mouseup_callback, true);
    LiteGraph.pointerListenerAdd(canvas, "move", this._mousemove_callback);
    canvas.addEventListener("pointerout", this._mouseout_callback);
    canvas.addEventListener("pointercancel", this._mousecancel_callback, true);
    canvas.addEventListener("contextmenu", this._doNothing);
    canvas.addEventListener(
      "DOMMouseScroll",
      this._mousewheel_callback,
      false
    );
    this._key_callback = this.processKey.bind(this);
    canvas.addEventListener("keydown", this._key_callback, true);
    document2.addEventListener("keyup", this._key_callback, true);
    this._ondrop_callback = this.processDrop.bind(this);
    canvas.addEventListener("dragover", this._doNothing, false);
    canvas.addEventListener("dragend", this._doNothing, false);
    canvas.addEventListener("drop", this._ondrop_callback, false);
    canvas.addEventListener("dragenter", this._doReturnTrue, false);
    this._events_binded = true;
  }
  /**
   * unbinds mouse events from the canvas
   */
  unbindEvents() {
    if (!this._events_binded) {
      console.warn("LGraphCanvas: no events binded");
      return;
    }
    const ref_window = this.getCanvasWindow();
    const document2 = ref_window.document;
    this.canvas.removeEventListener("pointercancel", this._mousecancel_callback);
    this.canvas.removeEventListener("pointerout", this._mouseout_callback);
    LiteGraph.pointerListenerRemove(this.canvas, "move", this._mousemove_callback);
    LiteGraph.pointerListenerRemove(this.canvas, "up", this._mouseup_callback);
    LiteGraph.pointerListenerRemove(this.canvas, "down", this._mousedown_callback);
    this.canvas.removeEventListener(
      "mousewheel",
      this._mousewheel_callback
    );
    this.canvas.removeEventListener(
      "DOMMouseScroll",
      this._mousewheel_callback
    );
    this.canvas.removeEventListener("keydown", this._key_callback);
    document2.removeEventListener("keyup", this._key_callback);
    this.canvas.removeEventListener("contextmenu", this._doNothing);
    this.canvas.removeEventListener("drop", this._ondrop_callback);
    this.canvas.removeEventListener("dragenter", this._doReturnTrue);
    this._mousedown_callback = null;
    this._mousewheel_callback = null;
    this._key_callback = null;
    this._ondrop_callback = null;
    this._events_binded = false;
  }
  /**
   * this function allows to render the canvas using WebGL instead of Canvas2D
   * this is useful if you plant to render 3D objects inside your nodes, it uses litegl.js for webgl and canvas2DtoWebGL to emulate the Canvas2D calls in webGL
   */
  enableWebGL() {
    if (typeof GL === "undefined") {
      throw "litegl.js must be included to use a WebGL canvas";
    }
    if (typeof enableWebGLCanvas === "undefined") {
      throw "webglCanvas.js must be included to use this feature";
    }
    this.gl = this.ctx = enableWebGLCanvas(this.canvas);
    this.ctx.webgl = true;
    this.bgcanvas = this.canvas;
    this.bgctx = this.gl;
    this.canvas.webgl_enabled = true;
  }
  /**
   * Ensures the canvas will be redrawn on the next frame by setting the dirty flag(s).
   * Without parameters, this function does nothing.
   * @todo Impl. `setDirty()` or similar as shorthand to redraw everything.
   * @param fgcanvas If true, marks the foreground canvas as dirty (nodes and anything drawn on top of them).  Default: false
   * @param bgcanvas If true, mark the background canvas as dirty (background, groups, links).  Default: false
   */
  setDirty(fgcanvas, bgcanvas) {
    if (fgcanvas) this.dirty_canvas = true;
    if (bgcanvas) this.dirty_bgcanvas = true;
  }
  /** Marks the entire canvas as dirty. */
  #dirty() {
    this.dirty_canvas = true;
    this.dirty_bgcanvas = true;
  }
  /**
   * Used to attach the canvas in a popup
   * @returns returns the window where the canvas is attached (the DOM root node)
   */
  getCanvasWindow() {
    if (!this.canvas) return window;
    const doc2 = this.canvas.ownerDocument;
    return doc2.defaultView || doc2.parentWindow;
  }
  /**
   * starts rendering the content of the canvas when needed
   *
   */
  startRendering() {
    if (this.is_rendering) return;
    this.is_rendering = true;
    renderFrame.call(this);
    function renderFrame() {
      if (!this.pause_rendering) {
        this.draw();
      }
      const window2 = this.getCanvasWindow();
      if (this.is_rendering) {
        if (this.#maximumFrameGap > 0) {
          const gap = this.#maximumFrameGap - (LiteGraph.getTime() - this.last_draw_time);
          setTimeout(renderFrame.bind(this), Math.max(1, gap));
        } else {
          window2.requestAnimationFrame(renderFrame.bind(this));
        }
      }
    }
    __name(renderFrame, "renderFrame");
  }
  /**
   * stops rendering the content of the canvas (to save resources)
   *
   */
  stopRendering() {
    this.is_rendering = false;
  }
  /* LiteGraphCanvas input */
  // used to block future mouse events (because of im gui)
  blockClick() {
    this.block_click = true;
    this.last_mouseclick = 0;
  }
  /**
   * Gets the widget at the current cursor position
   * @param node Optional node to check for widgets under cursor
   * @returns The widget located at the current cursor position or null
   */
  getWidgetAtCursor(node22) {
    node22 ??= this.node_over;
    if (!node22.widgets) return null;
    const graphPos = this.graph_mouse;
    const x2 = graphPos[0] - node22.pos[0];
    const y2 = graphPos[1] - node22.pos[1];
    for (const widget2 of node22.widgets) {
      if (widget2.hidden || widget2.advanced && !node22.showAdvanced) continue;
      let widgetWidth, widgetHeight;
      if (widget2.computeSize) {
        [widgetWidth, widgetHeight] = widget2.computeSize(node22.size[0]);
      } else {
        widgetWidth = widget2.width || node22.size[0];
        widgetHeight = LiteGraph.NODE_WIDGET_HEIGHT;
      }
      if (widget2.last_y !== void 0 && x2 >= 6 && x2 <= widgetWidth - 12 && y2 >= widget2.last_y && y2 <= widget2.last_y + widgetHeight) {
        return widget2;
      }
    }
    return null;
  }
  /**
   * Clears highlight and mouse-over information from nodes that should not have it.
   *
   * Intended to be called when the pointer moves away from a node.
   * @param node The node that the mouse is now over
   * @param e MouseEvent that is triggering this
   */
  updateMouseOverNodes(node22, e2) {
    const nodes = this.graph._nodes;
    const l = nodes.length;
    for (let i2 = 0; i2 < l; ++i2) {
      if (nodes[i2].mouseOver && node22 != nodes[i2]) {
        nodes[i2].mouseOver = null;
        this._highlight_input = null;
        this._highlight_pos = null;
        this.link_over_widget = null;
        nodes[i2].lostFocusAt = LiteGraph.getTime();
        this.node_over?.onMouseLeave?.(e2);
        this.node_over = null;
        this.dirty_canvas = true;
      }
    }
  }
  processMouseDown(e2) {
    const { graph, pointer: pointer2 } = this;
    this.adjustMouseEvent(e2);
    if (e2.isPrimary) pointer2.down(e2);
    if (this.set_canvas_dirty_on_mouse_event) this.dirty_canvas = true;
    if (!graph) return;
    const ref_window = this.getCanvasWindow();
    LGraphCanvas.active_canvas = this;
    const x2 = e2.clientX;
    const y2 = e2.clientY;
    this.ds.viewport = this.viewport;
    const is_inside = !this.viewport || isInRect(x2, y2, this.viewport);
    if (!is_inside) return;
    const node22 = graph.getNodeOnPos(e2.canvasX, e2.canvasY, this.visible_nodes);
    this.mouse[0] = x2;
    this.mouse[1] = y2;
    this.graph_mouse[0] = e2.canvasX;
    this.graph_mouse[1] = e2.canvasY;
    this.last_click_position = [this.mouse[0], this.mouse[1]];
    pointer2.isDouble = pointer2.isDown && e2.isPrimary;
    pointer2.isDown = true;
    this.canvas.focus();
    LiteGraph.closeAllContextMenus(ref_window);
    if (this.onMouse?.(e2) == true) return;
    if (e2.button === 0 && !pointer2.isDouble) {
      this.#processPrimaryButton(e2, node22);
    } else if (e2.button === 1) {
      this.#processMiddleButton(e2, node22);
    } else if ((e2.button === 2 || pointer2.isDouble) && this.allow_interaction && !this.read_only) {
      if (node22) this.processSelect(node22, e2, true);
      this.processContextMenu(node22, e2);
    }
    this.last_mouse = [x2, y2];
    this.last_mouseclick = LiteGraph.getTime();
    this.last_mouse_dragging = true;
    graph.change();
    if (!ref_window.document.activeElement || ref_window.document.activeElement.nodeName.toLowerCase() != "input" && ref_window.document.activeElement.nodeName.toLowerCase() != "textarea") {
      e2.preventDefault();
    }
    e2.stopPropagation();
    this.onMouseDown?.(e2);
  }
  #processPrimaryButton(e2, node22) {
    const { pointer: pointer2, graph } = this;
    const x2 = e2.canvasX;
    const y2 = e2.canvasY;
    const ctrlOrMeta = e2.ctrlKey || e2.metaKey;
    if (ctrlOrMeta && !e2.altKey) {
      const dragRect = new Float32Array(4);
      dragRect[0] = x2;
      dragRect[1] = y2;
      dragRect[2] = 1;
      dragRect[3] = 1;
      pointer2.onClick = (eUp) => {
        const clickedItem = node22 ?? (this.reroutesEnabled ? graph.getRerouteOnPos(eUp.canvasX, eUp.canvasY) : null) ?? graph.getGroupTitlebarOnPos(eUp.canvasX, eUp.canvasY);
        this.processSelect(clickedItem, eUp);
      };
      pointer2.onDragStart = () => this.dragging_rectangle = dragRect;
      pointer2.onDragEnd = (upEvent2) => this.#handleMultiSelect(upEvent2, dragRect);
      pointer2.finally = () => this.dragging_rectangle = null;
      return;
    }
    if (this.read_only) {
      pointer2.finally = () => this.dragging_canvas = false;
      this.dragging_canvas = true;
      return;
    }
    if (LiteGraph.alt_drag_do_clone_nodes && e2.altKey && !e2.ctrlKey && node22 && this.allow_interaction) {
      const node_data = node22.clone()?.serialize();
      const cloned = LiteGraph.createNode(node_data.type);
      if (cloned) {
        cloned.configure(node_data);
        cloned.pos[0] += 5;
        cloned.pos[1] += 5;
        if (this.allow_dragnodes) {
          pointer2.onDragStart = (pointer3) => {
            graph.add(cloned, false);
            this.#startDraggingItems(cloned, pointer3);
          };
          pointer2.onDragEnd = (e3) => this.#processDraggedItems(e3);
        } else {
          graph.beforeChange();
          graph.add(cloned, false);
          graph.afterChange();
        }
        return;
      }
    }
    if (node22 && (this.allow_interaction || node22.flags.allow_interaction)) {
      this.#processNodeClick(e2, ctrlOrMeta, node22);
    } else {
      if (this.reroutesEnabled && this.links_render_mode !== LinkRenderType.HIDDEN_LINK) {
        const reroute = graph.getRerouteOnPos(x2, y2);
        if (reroute) {
          if (e2.shiftKey) {
            const link2 = graph._links.get(reroute.linkIds.values().next().value);
            const outputNode = graph.getNodeById(link2.origin_id);
            const slot = link2.origin_slot;
            const connecting = {
              node: outputNode,
              slot,
              input: null,
              pos: outputNode.getConnectionPos(false, slot),
              afterRerouteId: reroute.id
            };
            this.connecting_links = [connecting];
            pointer2.onDragStart = () => connecting.output = outputNode.outputs[slot];
            this.dirty_bgcanvas = true;
          }
          pointer2.onClick = () => this.processSelect(reroute, e2);
          if (!pointer2.onDragStart) {
            pointer2.onDragStart = (pointer3) => this.#startDraggingItems(reroute, pointer3, true);
            pointer2.onDragEnd = (e3) => this.#processDraggedItems(e3);
          }
          return;
        }
      }
      const { lineWidth } = this.ctx;
      this.ctx.lineWidth = this.connections_width + 7;
      const dpi = window?.devicePixelRatio || 1;
      for (const linkSegment of this.renderedPaths) {
        const centre = linkSegment._pos;
        if (!centre) continue;
        if ((e2.shiftKey || e2.altKey) && linkSegment.path && this.ctx.isPointInStroke(linkSegment.path, x2 * dpi, y2 * dpi)) {
          this.ctx.lineWidth = lineWidth;
          if (e2.shiftKey && !e2.altKey) {
            const slot = linkSegment.origin_slot;
            const originNode = graph._nodes_by_id[linkSegment.origin_id];
            const connecting = {
              node: originNode,
              slot,
              pos: originNode.getConnectionPos(false, slot)
            };
            this.connecting_links = [connecting];
            if (linkSegment.parentId) connecting.afterRerouteId = linkSegment.parentId;
            pointer2.onDragStart = () => connecting.output = originNode.outputs[slot];
            return;
          } else if (this.reroutesEnabled && e2.altKey && !e2.shiftKey) {
            const newReroute = graph.createReroute([x2, y2], linkSegment);
            pointer2.onDragStart = (pointer3) => this.#startDraggingItems(newReroute, pointer3);
            pointer2.onDragEnd = (e3) => this.#processDraggedItems(e3);
            return;
          }
        } else if (isInRectangle(x2, y2, centre[0] - 4, centre[1] - 4, 8, 8)) {
          this.ctx.lineWidth = lineWidth;
          pointer2.onClick = () => this.showLinkMenu(linkSegment, e2);
          pointer2.onDragStart = () => this.dragging_canvas = true;
          pointer2.finally = () => this.dragging_canvas = false;
          this.over_link_center = null;
          return;
        }
      }
      this.ctx.lineWidth = lineWidth;
      const group = graph.getGroupOnPos(x2, y2);
      this.selected_group = group;
      if (group) {
        if (group.isInResize(x2, y2)) {
          const b = group.boundingRect;
          const offsetX = x2 - (b[0] + b[2]);
          const offsetY = y2 - (b[1] + b[3]);
          pointer2.onDragStart = () => this.resizingGroup = group;
          pointer2.onDrag = (eMove) => {
            if (this.read_only) return;
            const pos2 = [
              eMove.canvasX - group.pos[0] - offsetX,
              eMove.canvasY - group.pos[1] - offsetY
            ];
            snapPoint(pos2, this.#snapToGrid);
            const resized = group.resize(pos2[0], pos2[1]);
            if (resized) this.dirty_bgcanvas = true;
          };
          pointer2.finally = () => this.resizingGroup = null;
        } else {
          const f = group.font_size || LiteGraph.DEFAULT_GROUP_FONT_SIZE;
          const headerHeight = f * 1.4;
          if (isInRectangle(
            x2,
            y2,
            group.pos[0],
            group.pos[1],
            group.size[0],
            headerHeight
          )) {
            pointer2.onClick = () => this.processSelect(group, e2);
            pointer2.onDragStart = (pointer3) => {
              group.recomputeInsideNodes();
              this.#startDraggingItems(group, pointer3, true);
            };
            pointer2.onDragEnd = (e3) => this.#processDraggedItems(e3);
          }
        }
        pointer2.onDoubleClick = () => {
          this.emitEvent({
            subType: "group-double-click",
            originalEvent: e2,
            group
          });
        };
      } else {
        pointer2.onDoubleClick = () => {
          if (this.allow_searchbox) {
            this.showSearchBox(e2);
            e2.preventDefault();
          }
          this.emitEvent({
            subType: "empty-double-click",
            originalEvent: e2
          });
        };
      }
    }
    if (!pointer2.onDragStart && !pointer2.onClick && !pointer2.onDrag && this.allow_dragcanvas) {
      pointer2.onClick = () => this.processSelect(null, e2);
      pointer2.finally = () => this.dragging_canvas = false;
      this.dragging_canvas = true;
    }
  }
  /**
   * Processes a pointerdown event inside the bounds of a node.  Part of {@link processMouseDown}.
   * @param e The pointerdown event
   * @param ctrlOrMeta Ctrl or meta key is pressed
   * @param node The node to process a click event for
   */
  #processNodeClick(e2, ctrlOrMeta, node22) {
    const { pointer: pointer2, graph } = this;
    const x2 = e2.canvasX;
    const y2 = e2.canvasY;
    pointer2.onClick = () => this.processSelect(node22, e2);
    if (!node22.flags.pinned) {
      this.bringToFront(node22);
    }
    const inCollapse = node22.isPointInCollapse(x2, y2);
    if (inCollapse) {
      pointer2.onClick = () => {
        node22.collapse();
        this.setDirty(true, true);
      };
    } else if (!node22.flags.collapsed) {
      if (node22.resizable !== false && node22.inResizeCorner(x2, y2)) {
        const b = node22.boundingRect;
        const offsetX = x2 - (b[0] + b[2]);
        const offsetY = y2 - (b[1] + b[3]);
        pointer2.onDragStart = () => {
          graph.beforeChange();
          this.resizing_node = node22;
        };
        pointer2.onDrag = (eMove) => {
          if (this.read_only) return;
          const pos3 = [
            eMove.canvasX - node22.pos[0] - offsetX,
            eMove.canvasY - node22.pos[1] - offsetY
          ];
          snapPoint(pos3, this.#snapToGrid);
          const min = node22.computeSize();
          pos3[0] = Math.max(min[0], pos3[0]);
          pos3[1] = Math.max(min[1], pos3[1]);
          node22.setSize(pos3);
          this.#dirty();
        };
        pointer2.onDragEnd = (upEvent2) => {
          this.#dirty();
          graph.afterChange(this.resizing_node);
        };
        pointer2.finally = () => this.resizing_node = null;
        this.canvas.style.cursor = "se-resize";
        return;
      }
      if (node22.outputs) {
        for (let i2 = 0, l = node22.outputs.length; i2 < l; ++i2) {
          const output = node22.outputs[i2];
          const link_pos = node22.getConnectionPos(false, i2);
          if (isInRectangle(x2, y2, link_pos[0] - 15, link_pos[1] - 10, 30, 20)) {
            if (e2.shiftKey && output.links?.length > 0) {
              this.connecting_links = [];
              for (const linkId of output.links) {
                const link2 = graph._links.get(linkId);
                const slot = link2.target_slot;
                const linked_node = graph._nodes_by_id[link2.target_id];
                const input = linked_node.inputs[slot];
                const pos3 = linked_node.getConnectionPos(true, slot);
                this.connecting_links.push({
                  node: linked_node,
                  slot,
                  input,
                  output: null,
                  pos: pos3,
                  direction: node22.horizontal !== true ? LinkDirection.RIGHT : LinkDirection.CENTER
                });
              }
              return;
            }
            output.slot_index = i2;
            this.connecting_links = [
              {
                node: node22,
                slot: i2,
                input: null,
                output,
                pos: link_pos
              }
            ];
            if (LiteGraph.shift_click_do_break_link_from) {
              if (e2.shiftKey) {
                node22.disconnectOutput(i2);
              }
            } else if (LiteGraph.ctrl_alt_click_do_break_link) {
              if (ctrlOrMeta && e2.altKey && !e2.shiftKey) {
                node22.disconnectOutput(i2);
              }
            }
            pointer2.onDoubleClick = () => node22.onOutputDblClick?.(i2, e2);
            pointer2.onClick = () => node22.onOutputClick?.(i2, e2);
            return;
          }
        }
      }
      if (node22.inputs) {
        for (let i2 = 0, l = node22.inputs.length; i2 < l; ++i2) {
          const input = node22.inputs[i2];
          const link_pos = node22.getConnectionPos(true, i2);
          if (isInRectangle(x2, y2, link_pos[0] - 15, link_pos[1] - 10, 30, 20)) {
            pointer2.onDoubleClick = () => node22.onInputDblClick?.(i2, e2);
            pointer2.onClick = () => node22.onInputClick?.(i2, e2);
            if (input.link !== null) {
              const link_info = graph._links.get(input.link);
              const slot = link_info.origin_slot;
              const linked_node = graph._nodes_by_id[link_info.origin_id];
              if (LiteGraph.click_do_break_link_to || LiteGraph.ctrl_alt_click_do_break_link && ctrlOrMeta && e2.altKey && !e2.shiftKey) {
                node22.disconnectInput(i2);
              } else if (e2.shiftKey || this.allow_reconnect_links) {
                const connecting = {
                  node: linked_node,
                  slot,
                  output: linked_node.outputs[slot],
                  pos: linked_node.getConnectionPos(false, slot)
                };
                this.connecting_links = [connecting];
                pointer2.onDragStart = () => {
                  if (this.allow_reconnect_links && !LiteGraph.click_do_break_link_to)
                    node22.disconnectInput(i2);
                  connecting.output = linked_node.outputs[slot];
                };
                this.dirty_bgcanvas = true;
              }
            }
            if (!pointer2.onDragStart) {
              const connecting = {
                node: node22,
                slot: i2,
                output: null,
                pos: link_pos
              };
              this.connecting_links = [connecting];
              pointer2.onDragStart = () => connecting.input = input;
              this.dirty_bgcanvas = true;
            }
            return;
          }
        }
      }
    }
    const pos2 = [x2 - node22.pos[0], y2 - node22.pos[1]];
    const widget2 = node22.getWidgetOnPos(x2, y2);
    if (widget2) {
      this.#processWidgetClick(e2, node22, widget2);
      this.node_widget = [node22, widget2];
    } else {
      pointer2.onDoubleClick = () => {
        if (pos2[1] < 0 && !inCollapse) {
          node22.onNodeTitleDblClick?.(e2, pos2, this);
        }
        node22.onDblClick?.(e2, pos2, this);
        this.emitEvent({
          subType: "node-double-click",
          originalEvent: e2,
          node: node22
        });
        this.processNodeDblClicked(node22);
      };
      if (node22.onMouseDown?.(e2, pos2, this) || !this.allow_dragnodes)
        return;
      pointer2.onDragStart = (pointer3) => this.#startDraggingItems(node22, pointer3, true);
      pointer2.onDragEnd = (e3) => this.#processDraggedItems(e3);
    }
    this.dirty_canvas = true;
  }
  #processWidgetClick(e, node, widget) {
    const { pointer } = this;
    if (typeof widget.onPointerDown === "function") {
      const handled = widget.onPointerDown(pointer, node, this);
      if (handled) return;
    }
    const width = widget.width || node.width;
    const oldValue = widget.value;
    const pos = this.graph_mouse;
    const x = pos[0] - node.pos[0];
    const y = pos[1] - node.pos[1];
    switch (widget.type) {
      case "button":
        pointer.onClick = () => {
          widget.callback?.(widget, this, node, pos, e);
          widget.clicked = true;
          this.dirty_canvas = true;
        };
        break;
      case "slider": {
        if (widget.options.read_only) break;
        pointer.onDrag = (eMove) => {
          const x2 = eMove.canvasX - node.pos[0];
          const slideFactor = clamp$1((x2 - 15) / (width - 30), 0, 1);
          widget.value = widget.options.min + (widget.options.max - widget.options.min) * slideFactor;
          if (oldValue != widget.value) {
            setWidgetValue(this, node, widget, widget.value);
          }
          this.dirty_canvas = true;
        };
        break;
      }
      case "number": {
        const delta = x < 40 ? -1 : x > width - 40 ? 1 : 0;
        pointer.onClick = (upEvent) => {
          let newValue = widget.value + delta * 0.1 * (widget.options.step || 1);
          if (widget.options.min != null && newValue < widget.options.min) {
            newValue = widget.options.min;
          }
          if (widget.options.max != null && newValue > widget.options.max) {
            newValue = widget.options.max;
          }
          if (newValue !== widget.value) setWidgetValue(this, node, widget, newValue);
          if (delta !== 0) return;
          this.prompt("Value", widget.value, (v) => {
            if (/^[0-9+\-*/()\s]+|\d+\.\d+$/.test(v)) {
              try {
                v = eval(v);
              } catch {
              }
            }
            widget.value = Number(v);
            setWidgetValue(this, node, widget, widget.value);
          }, e);
          this.dirty_canvas = true;
        };
        pointer.onDrag = (eMove) => {
          const x2 = eMove.canvasX - node.pos[0];
          if (delta && (x2 > -3 && x2 < width + 3)) return;
          let newValue2 = widget.value;
          if (eMove.deltaX) newValue2 += eMove.deltaX * 0.1 * (widget.options.step || 1);
          if (widget.options.min != null && newValue2 < widget.options.min) {
            newValue2 = widget.options.min;
          }
          if (widget.options.max != null && newValue2 > widget.options.max) {
            newValue2 = widget.options.max;
          }
          if (newValue2 !== widget.value) setWidgetValue(this, node, widget, newValue2);
        };
        break;
      }
      case "combo": {
        let values;
        let values_list;
        pointer.onClick = (upEvent2) => {
          const delta2 = x < 40 ? -1 : x > width - 40 ? 1 : 0;
          values = widget.options.values;
          if (typeof values === "function") {
            values = values(widget, node);
          }
          values_list = null;
          values_list = Array.isArray(values) ? values : Object.keys(values);
          if (delta2) {
            let index2 = -1;
            this.last_mouseclick = 0;
            index2 = typeof values === "object" ? values_list.indexOf(String(widget.value)) + delta2 : values_list.indexOf(widget.value) + delta2;
            if (index2 >= values_list.length) index2 = values_list.length - 1;
            if (index2 < 0) index2 = 0;
            widget.value = Array.isArray(values) ? values[index2] : index2;
            if (oldValue != widget.value) setWidgetValue(this, node, widget, widget.value);
            this.dirty_canvas = true;
            return;
          }
          const text_values = values != values_list ? Object.values(values) : values;
          new LiteGraph.ContextMenu(text_values, {
            scale: Math.max(1, this.ds.scale),
            event: e,
            className: "dark",
            callback: /* @__PURE__ */ __name((value4) => {
              widget.value = values != values_list ? text_values.indexOf(value4) : value4;
              setWidgetValue(this, node, widget, widget.value);
              this.dirty_canvas = true;
              return false;
            }, "callback")
          });
        };
        break;
      }
      case "toggle":
        pointer.onClick = () => {
          widget.value = !widget.value;
          setWidgetValue(this, node, widget, widget.value);
        };
        break;
      case "string":
      case "text":
        pointer.onClick = () => this.prompt(
          "Value",
          widget.value,
          (v2) => setWidgetValue(this, node, widget, v2),
          e,
          widget.options ? widget.options.multiline : false
        );
        break;
      default:
        if (widget.mouse) {
          const result = widget.mouse(e, [x, y], node);
          if (result != null) this.dirty_canvas = result;
        }
        break;
    }
    if (oldValue != widget.value) {
      node.onWidgetChanged?.(widget.name, widget.value, oldValue, widget);
      node.graph._version++;
    }
    pointer.finally = () => {
      if (widget.mouse) {
        const { eUp } = pointer;
        const { canvasX, canvasY } = eUp;
        widget.mouse(eUp, [canvasX - node.pos[0], canvasY - node.pos[1]], node);
      }
      this.node_widget = null;
    };
    function setWidgetValue(canvas, node22, widget2, value4) {
      const v2 = widget2.type === "number" ? Number(value4) : value4;
      widget2.value = v2;
      if (widget2.options?.property && node22.properties[widget2.options.property] !== void 0) {
        node22.setProperty(widget2.options.property, v2);
      }
      widget2.callback?.(widget2.value, canvas, node22, pos, e);
      node22.onWidgetChanged?.(widget2.name, v2, oldValue, widget2);
      node22.graph._version++;
    }
    __name(setWidgetValue, "setWidgetValue");
  }
  /**
   * Pointer middle button click processing.  Part of {@link processMouseDown}.
   * @param e The pointerdown event
   * @param node The node to process a click event for
   */
  #processMiddleButton(e2, node22) {
    const { pointer: pointer2 } = this;
    if (LiteGraph.middle_click_slot_add_default_node && node22 && this.allow_interaction && !this.read_only && !this.connecting_links && !node22.flags.collapsed) {
      let mClikSlot = false;
      let mClikSlot_index = false;
      let mClikSlot_isOut = false;
      if (node22.outputs) {
        for (let i2 = 0, l = node22.outputs.length; i2 < l; ++i2) {
          const output = node22.outputs[i2];
          const link_pos = node22.getConnectionPos(false, i2);
          if (isInRectangle(e2.canvasX, e2.canvasY, link_pos[0] - 15, link_pos[1] - 10, 30, 20)) {
            mClikSlot = output;
            mClikSlot_index = i2;
            mClikSlot_isOut = true;
            break;
          }
        }
      }
      if (node22.inputs) {
        for (let i2 = 0, l = node22.inputs.length; i2 < l; ++i2) {
          const input = node22.inputs[i2];
          const link_pos = node22.getConnectionPos(true, i2);
          if (isInRectangle(e2.canvasX, e2.canvasY, link_pos[0] - 15, link_pos[1] - 10, 30, 20)) {
            mClikSlot = input;
            mClikSlot_index = i2;
            mClikSlot_isOut = false;
            break;
          }
        }
      }
      if (mClikSlot && mClikSlot_index !== false) {
        const alphaPosY = 0.5 - (mClikSlot_index + 1) / (mClikSlot_isOut ? node22.outputs.length : node22.inputs.length);
        const node_bounding = node22.getBounding();
        const posRef = [
          !mClikSlot_isOut ? node_bounding[0] : node_bounding[0] + node_bounding[2],
          e2.canvasY - 80
        ];
        pointer2.onClick = () => this.createDefaultNodeForSlot({
          nodeFrom: !mClikSlot_isOut ? null : node22,
          slotFrom: !mClikSlot_isOut ? null : mClikSlot_index,
          nodeTo: !mClikSlot_isOut ? node22 : null,
          slotTo: !mClikSlot_isOut ? mClikSlot_index : null,
          position: posRef,
          nodeType: "AUTO",
          posAdd: [!mClikSlot_isOut ? -30 : 30, -alphaPosY * 130],
          posSizeFix: [!mClikSlot_isOut ? -1 : 0, 0]
        });
      }
    }
    if (this.allow_dragcanvas) {
      pointer2.onDragStart = () => this.dragging_canvas = true;
      pointer2.finally = () => this.dragging_canvas = false;
    }
  }
  /**
   * Called when a mouse move event has to be processed
   */
  processMouseMove(e2) {
    if (this.autoresize) this.resize();
    if (this.set_canvas_dirty_on_mouse_event) this.dirty_canvas = true;
    if (!this.graph) return;
    LGraphCanvas.active_canvas = this;
    this.adjustMouseEvent(e2);
    const mouse = [e2.clientX, e2.clientY];
    this.mouse[0] = mouse[0];
    this.mouse[1] = mouse[1];
    const delta2 = [
      mouse[0] - this.last_mouse[0],
      mouse[1] - this.last_mouse[1]
    ];
    this.last_mouse = mouse;
    this.graph_mouse[0] = e2.canvasX;
    this.graph_mouse[1] = e2.canvasY;
    if (e2.isPrimary) this.pointer.move(e2);
    if (this.block_click) {
      e2.preventDefault();
      return;
    }
    e2.dragging = this.last_mouse_dragging;
    if (this.node_widget) {
      const [node3, widget2] = this.node_widget;
      if (widget2?.mouse) {
        const x2 = e2.canvasX - node3.pos[0];
        const y2 = e2.canvasY - node3.pos[1];
        const result = widget2.mouse(e2, [x2, y2], node3);
        if (result != null) this.dirty_canvas = result;
      }
    }
    let underPointer = CanvasItem.Nothing;
    const node22 = this.graph.getNodeOnPos(
      e2.canvasX,
      e2.canvasY,
      this.visible_nodes
    );
    const { resizingGroup } = this;
    const dragRect = this.dragging_rectangle;
    if (dragRect) {
      dragRect[2] = e2.canvasX - dragRect[0];
      dragRect[3] = e2.canvasY - dragRect[1];
      this.dirty_canvas = true;
    } else if (resizingGroup) {
      underPointer |= CanvasItem.ResizeSe | CanvasItem.Group;
    } else if (this.dragging_canvas) {
      this.ds.offset[0] += delta2[0] / this.ds.scale;
      this.ds.offset[1] += delta2[1] / this.ds.scale;
      this.#dirty();
    } else if ((this.allow_interaction || node22 && node22.flags.allow_interaction) && !this.read_only) {
      if (this.connecting_links) this.dirty_canvas = true;
      this.updateMouseOverNodes(node22, e2);
      if (node22) {
        underPointer |= CanvasItem.Node;
        if (node22.redraw_on_mouse) this.dirty_canvas = true;
        const pos2 = [0, 0];
        const inputId = this.isOverNodeInput(node22, e2.canvasX, e2.canvasY, pos2);
        const outputId = this.isOverNodeOutput(node22, e2.canvasX, e2.canvasY, pos2);
        const overWidget = this.getWidgetAtCursor(node22);
        if (!node22.mouseOver) {
          node22.mouseOver = {
            inputId: null,
            outputId: null,
            overWidget: null
          };
          this.node_over = node22;
          this.dirty_canvas = true;
          node22.onMouseEnter?.(e2);
        }
        node22.onMouseMove?.(e2, [e2.canvasX - node22.pos[0], e2.canvasY - node22.pos[1]], this);
        if (node22.mouseOver.inputId !== inputId || node22.mouseOver.outputId !== outputId || node22.mouseOver.overWidget !== overWidget) {
          node22.mouseOver.inputId = inputId;
          node22.mouseOver.outputId = outputId;
          node22.mouseOver.overWidget = overWidget;
          if (this.connecting_links?.length) {
            const firstLink = this.connecting_links[0];
            let highlightPos = null;
            let highlightInput = null;
            let linkOverWidget = null;
            if (firstLink.node === node22) ;
            else if (firstLink.output) {
              if (inputId === -1 && outputId === -1) {
                if (this.getWidgetLinkType && overWidget) {
                  const widgetLinkType = this.getWidgetLinkType(overWidget, node22);
                  if (widgetLinkType && LiteGraph.isValidConnection(firstLink.output.type, widgetLinkType)) {
                    if (firstLink.node.isValidWidgetLink?.(firstLink.output.slot_index, node22, overWidget) !== false) {
                      linkOverWidget = overWidget;
                      this.link_over_widget_type = widgetLinkType;
                    }
                  }
                }
                if (!linkOverWidget) {
                  const targetSlotId = firstLink.node.findConnectByTypeSlot(true, node22, firstLink.output.type);
                  if (targetSlotId !== null && targetSlotId >= 0) {
                    node22.getConnectionPos(true, targetSlotId, pos2);
                    highlightPos = pos2;
                    highlightInput = node22.inputs[targetSlotId];
                  }
                }
              } else if (inputId != -1 && node22.inputs[inputId] && LiteGraph.isValidConnection(firstLink.output.type, node22.inputs[inputId].type)) {
                if (inputId != -1 && node22.inputs[inputId] && LiteGraph.isValidConnection(firstLink.output.type, node22.inputs[inputId].type)) {
                  highlightPos = pos2;
                  highlightInput = node22.inputs[inputId];
                }
              }
            } else if (firstLink.input) {
              if (inputId === -1 && outputId === -1) {
                const targetSlotId = firstLink.node.findConnectByTypeSlot(false, node22, firstLink.input.type);
                if (targetSlotId !== null && targetSlotId >= 0) {
                  node22.getConnectionPos(false, targetSlotId, pos2);
                  highlightPos = pos2;
                }
              } else {
                if (outputId != -1 && node22.outputs[outputId] && LiteGraph.isValidConnection(firstLink.input.type, node22.outputs[outputId].type)) {
                  highlightPos = pos2;
                }
              }
            }
            this._highlight_pos = highlightPos;
            this._highlight_input = highlightInput;
            this.link_over_widget = linkOverWidget;
          }
          this.dirty_canvas = true;
        }
        if (node22.inResizeCorner(e2.canvasX, e2.canvasY)) {
          underPointer |= CanvasItem.ResizeSe;
        }
      } else {
        const segment = this.#getLinkCentreOnPos(e2);
        if (this.over_link_center !== segment) {
          underPointer |= CanvasItem.Link;
          this.over_link_center = segment;
          this.dirty_bgcanvas = true;
        }
        if (this.canvas) {
          const group = this.graph.getGroupOnPos(e2.canvasX, e2.canvasY);
          if (group && !e2.ctrlKey && !this.read_only && group.isInResize(e2.canvasX, e2.canvasY)) {
            underPointer |= CanvasItem.ResizeSe;
          }
        }
      }
      if (this.node_capturing_input && this.node_capturing_input != node22) {
        this.node_capturing_input.onMouseMove?.(
          e2,
          [
            e2.canvasX - this.node_capturing_input.pos[0],
            e2.canvasY - this.node_capturing_input.pos[1]
          ],
          this
        );
      }
      if (this.isDragging) {
        const selected2 = this.selectedItems;
        const allItems = e2.ctrlKey ? selected2 : getAllNestedItems(selected2);
        const deltaX = delta2[0] / this.ds.scale;
        const deltaY = delta2[1] / this.ds.scale;
        for (const item3 of allItems) {
          item3.move(deltaX, deltaY, true);
        }
        this.#dirty();
      }
      if (this.resizing_node) underPointer |= CanvasItem.ResizeSe;
    }
    this.hoveringOver = underPointer;
    e2.preventDefault();
    return;
  }
  /**
   * Start dragging an item, optionally including all other selected items.
   *
   * ** This function sets the {@link CanvasPointer.finally}() callback. **
   * @param item The item that the drag event started on
   * @param pointer The pointer event that initiated the drag, e.g. pointerdown
   * @param sticky If `true`, the item is added to the selection - see {@link processSelect}
   */
  #startDraggingItems(item3, pointer2, sticky = false) {
    this.emitBeforeChange();
    this.graph.beforeChange();
    pointer2.finally = () => {
      this.isDragging = false;
      this.graph.afterChange();
      this.emitAfterChange();
    };
    this.processSelect(item3, pointer2.eDown, sticky);
    this.isDragging = true;
  }
  /**
   * Handles shared clean up and placement after items have been dragged.
   * @param e The event that completed the drag, e.g. pointerup, pointermove
   */
  #processDraggedItems(e2) {
    const { graph } = this;
    if (e2.shiftKey || LiteGraph.alwaysSnapToGrid)
      graph.snapToGrid(this.selectedItems);
    this.dirty_canvas = true;
    this.dirty_bgcanvas = true;
    this.onNodeMoved?.(findFirstNode(this.selectedItems));
  }
  /**
   * Called when a mouse up event has to be processed
   */
  processMouseUp(e2) {
    if (e2.isPrimary === false) return;
    const { graph, pointer: pointer2 } = this;
    if (!graph) return;
    LGraphCanvas.active_canvas = this;
    this.adjustMouseEvent(e2);
    const now2 = LiteGraph.getTime();
    e2.click_time = now2 - this.last_mouseclick;
    const isClick = pointer2.up(e2);
    if (isClick === true) {
      pointer2.isDown = false;
      pointer2.isDouble = false;
      this.connecting_links = null;
      this.dragging_canvas = false;
      graph.change();
      e2.stopPropagation();
      e2.preventDefault();
      return;
    }
    this.last_mouse_dragging = false;
    this.last_click_position = null;
    this.block_click &&= false;
    if (e2.button === 0) {
      this.selected_group = null;
      this.isDragging = false;
      const x2 = e2.canvasX;
      const y2 = e2.canvasY;
      const node22 = graph.getNodeOnPos(x2, y2, this.visible_nodes);
      if (this.connecting_links?.length) {
        const firstLink = this.connecting_links[0];
        if (node22) {
          for (const link2 of this.connecting_links) {
            this.#dirty();
            if (link2.output) {
              const slot = this.isOverNodeInput(node22, x2, y2);
              if (slot != -1) {
                link2.node.connect(link2.slot, node22, slot, link2.afterRerouteId);
              } else if (this.link_over_widget) {
                this.emitEvent({
                  subType: "connectingWidgetLink",
                  link: link2,
                  node: node22,
                  widget: this.link_over_widget
                });
                this.link_over_widget = null;
              } else {
                link2.node.connectByType(link2.slot, node22, link2.output.type, {
                  afterRerouteId: link2.afterRerouteId
                });
              }
            } else if (link2.input) {
              const slot = this.isOverNodeOutput(node22, x2, y2);
              if (slot != -1) {
                node22.connect(slot, link2.node, link2.slot, link2.afterRerouteId);
              } else {
                link2.node.connectByTypeOutput(
                  link2.slot,
                  node22,
                  link2.input.type,
                  { afterRerouteId: link2.afterRerouteId }
                );
              }
            }
          }
        } else if (firstLink.input || firstLink.output) {
          const linkReleaseContext = firstLink.output ? {
            node_from: firstLink.node,
            slot_from: firstLink.output,
            type_filter_in: firstLink.output.type
          } : {
            node_to: firstLink.node,
            slot_from: firstLink.input,
            type_filter_out: firstLink.input.type
          };
          const linkReleaseContextExtended = {
            links: this.connecting_links
          };
          this.emitEvent({
            subType: "empty-release",
            originalEvent: e2,
            linkReleaseContext: linkReleaseContextExtended
          });
          if (LiteGraph.release_link_on_empty_shows_menu) {
            if (e2.shiftKey) {
              if (this.allow_searchbox) {
                this.showSearchBox(e2, linkReleaseContext);
              }
            } else {
              if (firstLink.output) {
                this.showConnectionMenu({ nodeFrom: firstLink.node, slotFrom: firstLink.output, e: e2 });
              } else if (firstLink.input) {
                this.showConnectionMenu({ nodeTo: firstLink.node, slotTo: firstLink.input, e: e2 });
              }
            }
          }
        }
      } else {
        this.dirty_canvas = true;
        this.node_over?.onMouseUp?.(e2, [x2 - this.node_over.pos[0], y2 - this.node_over.pos[1]], this);
        this.node_capturing_input?.onMouseUp?.(e2, [
          x2 - this.node_capturing_input.pos[0],
          y2 - this.node_capturing_input.pos[1]
        ]);
      }
      this.connecting_links = null;
    } else if (e2.button === 1) {
      this.dirty_canvas = true;
      this.dragging_canvas = false;
    } else if (e2.button === 2) {
      this.dirty_canvas = true;
    }
    pointer2.isDown = false;
    pointer2.isDouble = false;
    graph.change();
    e2.stopPropagation();
    e2.preventDefault();
    return;
  }
  /**
   * Called when the mouse moves off the canvas.  Clears all node hover states.
   * @param e
   */
  processMouseOut(e2) {
    this.adjustMouseEvent(e2);
    this.updateMouseOverNodes(null, e2);
  }
  processMouseCancel(e2) {
    console.warn("Pointer cancel!");
    this.pointer.reset();
  }
  /**
   * Called when a mouse wheel event has to be processed
   */
  processMouseWheel(e2) {
    if (!this.graph || !this.allow_dragcanvas) return;
    const delta2 = e2.wheelDeltaY ?? e2.detail * -60;
    this.adjustMouseEvent(e2);
    const pos2 = [e2.clientX, e2.clientY];
    if (this.viewport && !isPointInRect(pos2, this.viewport)) return;
    let scale = this.ds.scale;
    if (delta2 > 0) scale *= this.zoom_speed;
    else if (delta2 < 0) scale *= 1 / this.zoom_speed;
    this.ds.changeScale(scale, [e2.clientX, e2.clientY]);
    this.graph.change();
    e2.preventDefault();
    return;
  }
  /**
   * returns the INDEX if a position (in graph space) is on top of a node input slot
   */
  isOverNodeInput(node22, canvasx, canvasy, slot_pos) {
    if (node22.inputs) {
      for (let i2 = 0, l = node22.inputs.length; i2 < l; ++i2) {
        const input = node22.inputs[i2];
        const link_pos = node22.getConnectionPos(true, i2);
        let is_inside = false;
        if (node22.horizontal) {
          is_inside = isInRectangle(
            canvasx,
            canvasy,
            link_pos[0] - 5,
            link_pos[1] - 10,
            10,
            20
          );
        } else {
          const width2 = 20 + ((input.label?.length ?? input.localized_name?.length ?? input.name?.length) || 3) * 7;
          is_inside = isInRectangle(
            canvasx,
            canvasy,
            link_pos[0] - 10,
            link_pos[1] - 10,
            width2,
            20
          );
        }
        if (is_inside) {
          if (slot_pos) {
            slot_pos[0] = link_pos[0];
            slot_pos[1] = link_pos[1];
          }
          return i2;
        }
      }
    }
    return -1;
  }
  /**
   * returns the INDEX if a position (in graph space) is on top of a node output slot
   */
  isOverNodeOutput(node22, canvasx, canvasy, slot_pos) {
    if (node22.outputs) {
      for (let i2 = 0, l = node22.outputs.length; i2 < l; ++i2) {
        const link_pos = node22.getConnectionPos(false, i2);
        let is_inside = false;
        if (node22.horizontal) {
          is_inside = isInRectangle(
            canvasx,
            canvasy,
            link_pos[0] - 5,
            link_pos[1] - 10,
            10,
            20
          );
        } else {
          is_inside = isInRectangle(
            canvasx,
            canvasy,
            link_pos[0] - 10,
            link_pos[1] - 10,
            40,
            20
          );
        }
        if (is_inside) {
          if (slot_pos) {
            slot_pos[0] = link_pos[0];
            slot_pos[1] = link_pos[1];
          }
          return i2;
        }
      }
    }
    return -1;
  }
  /**
   * process a key event
   */
  processKey(e2) {
    this.#shiftDown = e2.shiftKey;
    if (!this.graph) return;
    let block_default = false;
    if (e2.target.localName == "input") return;
    if (e2.type == "keydown") {
      if (e2.keyCode == 32) {
        this.read_only = true;
        if (this._previously_dragging_canvas === null) {
          this._previously_dragging_canvas = this.dragging_canvas;
        }
        this.dragging_canvas = this.pointer.isDown;
        block_default = true;
      } else if (e2.keyCode == 27) {
        this.node_panel?.close();
        this.options_panel?.close();
        block_default = true;
      } else if (e2.keyCode == 65 && e2.ctrlKey) {
        this.selectItems();
        block_default = true;
      } else if (e2.keyCode === 67 && (e2.metaKey || e2.ctrlKey) && !e2.shiftKey) {
        if (this.selected_nodes) {
          this.copyToClipboard();
          block_default = true;
        }
      } else if (e2.keyCode === 86 && (e2.metaKey || e2.ctrlKey)) {
        this.pasteFromClipboard(e2.shiftKey);
      } else if (e2.keyCode == 46 || e2.keyCode == 8) {
        if (e2.target.localName != "input" && e2.target.localName != "textarea") {
          this.deleteSelected();
          block_default = true;
        }
      }
      if (this.selected_nodes) {
        for (const i2 in this.selected_nodes) {
          this.selected_nodes[i2].onKeyDown?.(e2);
        }
      }
    } else if (e2.type == "keyup") {
      if (e2.keyCode == 32) {
        this.read_only = false;
        this.dragging_canvas = (this._previously_dragging_canvas ?? false) && this.pointer.isDown;
        this._previously_dragging_canvas = null;
      }
      if (this.selected_nodes) {
        for (const i2 in this.selected_nodes) {
          this.selected_nodes[i2].onKeyUp?.(e2);
        }
      }
    }
    this.graph.change();
    if (block_default) {
      e2.preventDefault();
      e2.stopImmediatePropagation();
      return false;
    }
  }
  /**
   * Copies canvas items to an internal, app-specific clipboard backed by local storage.
   * When called without parameters, it copies {@link selectedItems}.
   * @param items The items to copy.  If nullish, all selected items are copied.
   */
  copyToClipboard(items2) {
    const serialisable = {
      nodes: [],
      groups: [],
      reroutes: [],
      links: []
    };
    for (const item3 of items2 ?? this.selectedItems) {
      if (item3 instanceof LGraphNode) {
        if (item3.clonable === false) continue;
        const cloned = item3.clone()?.serialize();
        if (!cloned) continue;
        cloned.id = item3.id;
        serialisable.nodes.push(cloned);
        const links = item3.inputs?.map((input) => this.graph._links.get(input?.link)?.asSerialisable()).filter((x2) => !!x2);
        if (!links) continue;
        serialisable.links.push(...links);
      } else if (item3 instanceof LGraphGroup) {
        serialisable.groups.push(item3.serialize());
      } else if (this.reroutesEnabled && item3 instanceof Reroute) {
        serialisable.reroutes.push(item3.asSerialisable());
      }
    }
    localStorage.setItem(
      "litegrapheditor_clipboard",
      JSON.stringify(serialisable)
    );
  }
  emitEvent(detail) {
    this.canvas.dispatchEvent(
      new CustomEvent("litegraph:canvas", {
        bubbles: true,
        detail
      })
    );
  }
  /** @todo Refactor to where it belongs - e.g. Deleting / creating nodes is not actually canvas event. */
  emitBeforeChange() {
    this.emitEvent({
      subType: "before-change"
    });
  }
  /** @todo See {@link emitBeforeChange} */
  emitAfterChange() {
    this.emitEvent({
      subType: "after-change"
    });
  }
  /**
   * Pastes the items from the canvas "clipbaord" - a local storage variable.
   * @param connectInputs If `true`, always attempt to connect inputs of pasted nodes - including to nodes that were not pasted.
   */
  _pasteFromClipboard(connectInputs = false) {
    if (!LiteGraph.ctrl_shift_v_paste_connect_unselected_outputs && connectInputs) return;
    const data24 = localStorage.getItem("litegrapheditor_clipboard");
    if (!data24) return;
    const { graph } = this;
    graph.beforeChange();
    const parsed = JSON.parse(data24);
    parsed.nodes ??= [];
    parsed.groups ??= [];
    parsed.reroutes ??= [];
    parsed.links ??= [];
    let offsetX = Infinity;
    let offsetY = Infinity;
    for (const item3 of [...parsed.nodes, ...parsed.reroutes]) {
      if (item3.pos[0] < offsetX) offsetX = item3.pos[0];
      if (item3.pos[1] < offsetY) offsetY = item3.pos[1];
    }
    if (parsed.groups) {
      for (const group of parsed.groups) {
        if (group.bounding[0] < offsetX) offsetX = group.bounding[0];
        if (group.bounding[1] < offsetY) offsetY = group.bounding[1];
      }
    }
    const results = {
      created: [],
      nodes: /* @__PURE__ */ new Map(),
      links: /* @__PURE__ */ new Map(),
      reroutes: /* @__PURE__ */ new Map()
    };
    const { created: created3, nodes, links, reroutes } = results;
    for (const info of parsed.groups) {
      info.id = void 0;
      const group = new LGraphGroup();
      group.configure(info);
      graph.add(group);
      created3.push(group);
    }
    for (const info of parsed.nodes) {
      const node22 = LiteGraph.createNode(info.type);
      if (!node22) {
        continue;
      }
      nodes.set(info.id, node22);
      info.id = void 0;
      node22.configure(info);
      graph.add(node22);
      created3.push(node22);
    }
    for (const info of parsed.reroutes) {
      const { id: id3 } = info;
      info.id = void 0;
      const reroute = graph.setReroute(info);
      created3.push(reroute);
      reroutes.set(id3, reroute);
    }
    for (const reroute of reroutes.values()) {
      const mapped = reroutes.get(reroute.parentId);
      if (mapped) reroute.parentId = mapped.id;
    }
    for (const info of parsed.links) {
      let outNode = nodes.get(info.origin_id);
      let afterRerouteId = reroutes.get(info.parentId)?.id;
      if (connectInputs && LiteGraph.ctrl_shift_v_paste_connect_unselected_outputs) {
        outNode ??= graph.getNodeById(info.origin_id);
        afterRerouteId ??= info.parentId;
      }
      const inNode = nodes.get(info.target_id);
      if (inNode) {
        const link2 = outNode?.connect(
          info.origin_slot,
          inNode,
          info.target_slot,
          afterRerouteId
        );
        if (link2) links.set(info.id, link2);
      }
    }
    for (const reroute of reroutes.values()) {
      const ids = [...reroute.linkIds].map((x2) => links.get(x2)?.id ?? x2);
      reroute.update(reroute.parentId, void 0, ids);
      if (!reroute.validateLinks(graph.links)) graph.removeReroute(reroute.id);
    }
    for (const item3 of created3) {
      item3.pos[0] += this.graph_mouse[0] - offsetX;
      item3.pos[1] += this.graph_mouse[1] - offsetY;
    }
    this.selectItems(created3);
    graph.afterChange();
    return results;
  }
  pasteFromClipboard(isConnectUnselected = false) {
    this.emitBeforeChange();
    try {
      this._pasteFromClipboard(isConnectUnselected);
    } finally {
      this.emitAfterChange();
    }
  }
  /**
   * process a item drop event on top the canvas
   */
  processDrop(e2) {
    e2.preventDefault();
    this.adjustMouseEvent(e2);
    const x2 = e2.clientX;
    const y2 = e2.clientY;
    const is_inside = !this.viewport || isInRect(x2, y2, this.viewport);
    if (!is_inside) return;
    const pos2 = [e2.canvasX, e2.canvasY];
    const node22 = this.graph ? this.graph.getNodeOnPos(pos2[0], pos2[1]) : null;
    if (!node22) {
      const r = this.onDropItem?.(e2);
      if (!r) this.checkDropItem(e2);
      return;
    }
    if (node22.onDropFile || node22.onDropData) {
      const files = e2.dataTransfer.files;
      if (files && files.length) {
        for (let i2 = 0; i2 < files.length; i2++) {
          const file = e2.dataTransfer.files[0];
          const filename = file.name;
          node22.onDropFile?.(file);
          if (node22.onDropData) {
            const reader = new FileReader();
            reader.onload = function(event) {
              const data24 = event.target.result;
              node22.onDropData(data24, filename, file);
            };
            const type = file.type.split("/")[0];
            if (type == "text" || type == "") {
              reader.readAsText(file);
            } else if (type == "image") {
              reader.readAsDataURL(file);
            } else {
              reader.readAsArrayBuffer(file);
            }
          }
        }
      }
    }
    if (node22.onDropItem?.(e2)) return true;
    return this.onDropItem ? this.onDropItem(e2) : false;
  }
  // called if the graph doesn't have a default drop item behaviour
  checkDropItem(e2) {
    if (!e2.dataTransfer.files.length) return;
    const file = e2.dataTransfer.files[0];
    const ext = LGraphCanvas.getFileExtension(file.name).toLowerCase();
    const nodetype = LiteGraph.node_types_by_file_extension[ext];
    if (!nodetype) return;
    this.graph.beforeChange();
    const node22 = LiteGraph.createNode(nodetype.type);
    node22.pos = [e2.canvasX, e2.canvasY];
    this.graph.add(node22);
    node22.onDropFile?.(file);
    this.graph.afterChange();
  }
  processNodeDblClicked(n) {
    this.onShowNodePanel?.(n);
    this.onNodeDblClicked?.(n);
    this.setDirty(true);
  }
  #handleMultiSelect(e2, dragRect) {
    const { graph, selectedItems } = this;
    const w = Math.abs(dragRect[2]);
    const h2 = Math.abs(dragRect[3]);
    if (dragRect[2] < 0) dragRect[0] -= w;
    if (dragRect[3] < 0) dragRect[1] -= h2;
    dragRect[2] = w;
    dragRect[3] = h2;
    const isSelected5 = [];
    const notSelected = [];
    for (const nodeX of graph._nodes) {
      if (!overlapBounding(dragRect, nodeX.boundingRect)) continue;
      if (!nodeX.selected || !selectedItems.has(nodeX))
        notSelected.push(nodeX);
      else isSelected5.push(nodeX);
    }
    for (const group of graph.groups) {
      if (!containsRect(dragRect, group._bounding)) continue;
      group.recomputeInsideNodes();
      if (!group.selected || !selectedItems.has(group))
        notSelected.push(group);
      else isSelected5.push(group);
    }
    for (const reroute of graph.reroutes.values()) {
      if (!isPointInRect(reroute.pos, dragRect)) continue;
      selectedItems.add(reroute);
      reroute.selected = true;
      if (!reroute.selected || !selectedItems.has(reroute))
        notSelected.push(reroute);
      else isSelected5.push(reroute);
    }
    if (e2.shiftKey) {
      for (const item3 of notSelected) this.select(item3);
    } else if (e2.altKey) {
      for (const item3 of isSelected5) this.deselect(item3);
    } else {
      for (const item3 of selectedItems.values()) {
        if (!isSelected5.includes(item3)) this.deselect(item3);
      }
      for (const item3 of notSelected) this.select(item3);
    }
  }
  /**
   * Determines whether to select or deselect an item that has received a pointer event.  Will deselect other nodes if
   * @param item Canvas item to select/deselect
   * @param e The MouseEvent to handle
   * @param sticky Prevents deselecting individual nodes (as used by aux/right-click)
   * @remarks
   * Accessibility: anyone using {@link mutli_select} always deselects when clicking empty space.
   */
  processSelect(item3, e2, sticky = false) {
    const addModifier = e2?.shiftKey;
    const subtractModifier = e2 != null && (e2.metaKey || e2.ctrlKey);
    const eitherModifier = addModifier || subtractModifier;
    const modifySelection = eitherModifier || this.multi_select;
    if (!item3) {
      if (!eitherModifier || this.multi_select) this.deselectAll();
    } else if (!item3.selected || !this.selectedItems.has(item3)) {
      if (!modifySelection) this.deselectAll(item3);
      this.select(item3);
    } else if (modifySelection && !sticky) {
      this.deselect(item3);
    } else if (!sticky) {
      this.deselectAll(item3);
    } else {
      return;
    }
    this.onSelectionChange?.(this.selected_nodes);
    this.setDirty(true);
  }
  /**
   * Selects a {@link Positionable} item.
   * @param item The canvas item to add to the selection.
   */
  select(item3) {
    if (item3.selected && this.selectedItems.has(item3)) return;
    item3.selected = true;
    this.selectedItems.add(item3);
    if (!(item3 instanceof LGraphNode)) return;
    item3.onSelected?.();
    this.selected_nodes[item3.id] = item3;
    this.onNodeSelected?.(item3);
    item3.inputs?.forEach((input) => this.highlighted_links[input.link] = true);
    item3.outputs?.flatMap((x2) => x2.links).forEach((id3) => this.highlighted_links[id3] = true);
  }
  /**
   * Deselects a {@link Positionable} item.
   * @param item The canvas item to remove from the selection.
   */
  deselect(item3) {
    if (!item3.selected && !this.selectedItems.has(item3)) return;
    item3.selected = false;
    this.selectedItems.delete(item3);
    if (!(item3 instanceof LGraphNode)) return;
    item3.onDeselected?.();
    delete this.selected_nodes[item3.id];
    this.onNodeDeselected?.(item3);
    item3.inputs?.forEach((input) => delete this.highlighted_links[input.link]);
    item3.outputs?.flatMap((x2) => x2.links).forEach((id3) => delete this.highlighted_links[id3]);
  }
  /** @deprecated See {@link LGraphCanvas.processSelect} */
  processNodeSelected(item3, e2) {
    this.processSelect(
      item3,
      e2,
      e2 && (e2.shiftKey || e2.metaKey || e2.ctrlKey || this.multi_select)
    );
  }
  /** @deprecated See {@link LGraphCanvas.select} */
  selectNode(node22, add_to_current_selection) {
    if (node22 == null) {
      this.deselectAll();
    } else {
      this.selectNodes([node22], add_to_current_selection);
    }
  }
  get empty() {
    return this.graph.empty;
  }
  get positionableItems() {
    return this.graph.positionableItems();
  }
  /**
   * Selects several items.
   * @param items Items to select - if falsy, all items on the canvas will be selected
   * @param add_to_current_selection If set, the items will be added to the current selection instead of replacing it
   */
  selectItems(items2, add_to_current_selection) {
    const itemsToSelect = items2 ?? this.positionableItems;
    if (!add_to_current_selection) this.deselectAll();
    for (const item3 of itemsToSelect) this.select(item3);
    this.onSelectionChange?.(this.selected_nodes);
    this.setDirty(true);
  }
  /**
   * selects several nodes (or adds them to the current selection)
   * @deprecated See {@link LGraphCanvas.selectItems}
   */
  selectNodes(nodes, add_to_current_selection) {
    this.selectItems(nodes, add_to_current_selection);
  }
  /** @deprecated See {@link LGraphCanvas.deselect} */
  deselectNode(node22) {
    this.deselect(node22);
  }
  /**
   * Deselects all items on the canvas.
   * @param keepSelected If set, this item will not be removed from the selection.
   */
  deselectAll(keepSelected) {
    if (!this.graph) return;
    const selected2 = this.selectedItems;
    let wasSelected;
    for (const sel of selected2) {
      if (sel === keepSelected) {
        wasSelected = sel;
        continue;
      }
      sel.onDeselected?.();
      sel.selected = false;
    }
    selected2.clear();
    if (wasSelected) selected2.add(wasSelected);
    this.setDirty(true);
    const oldNode = keepSelected?.id == null ? null : this.selected_nodes[keepSelected.id];
    this.selected_nodes = {};
    this.current_node = null;
    this.highlighted_links = {};
    if (keepSelected instanceof LGraphNode) {
      if (oldNode) this.selected_nodes[oldNode.id] = oldNode;
      keepSelected.inputs?.forEach((input) => this.highlighted_links[input.link] = true);
      keepSelected.outputs?.flatMap((x2) => x2.links).forEach((id3) => this.highlighted_links[id3] = true);
    }
    this.onSelectionChange?.(this.selected_nodes);
  }
  /** @deprecated See {@link LGraphCanvas.deselectAll} */
  deselectAllNodes() {
    this.deselectAll();
  }
  /**
   * Deletes all selected items from the graph.
   * @todo Refactor deletion task to LGraph.  Selection is a canvas property, delete is a graph action.
   */
  deleteSelected() {
    const { graph } = this;
    this.emitBeforeChange();
    graph.beforeChange();
    for (const item3 of this.selectedItems) {
      if (item3 instanceof LGraphNode) {
        const node22 = item3;
        if (node22.block_delete) continue;
        node22.connectInputToOutput();
        graph.remove(node22);
        this.onNodeDeselected?.(node22);
      } else if (item3 instanceof LGraphGroup) {
        graph.remove(item3);
      } else if (item3 instanceof Reroute) {
        graph.removeReroute(item3.id);
      }
    }
    this.selectedItems.clear();
    this.selected_nodes = {};
    this.selectedItems.clear();
    this.current_node = null;
    this.highlighted_links = {};
    this.setDirty(true);
    graph.afterChange();
    this.emitAfterChange();
  }
  /**
   * deletes all nodes in the current selection from the graph
   * @deprecated See {@link LGraphCanvas.deleteSelected}
   */
  deleteSelectedNodes() {
    this.deleteSelected();
  }
  /**
   * centers the camera on a given node
   */
  centerOnNode(node22) {
    const dpi = window?.devicePixelRatio || 1;
    this.ds.offset[0] = -node22.pos[0] - node22.size[0] * 0.5 + this.canvas.width * 0.5 / (this.ds.scale * dpi);
    this.ds.offset[1] = -node22.pos[1] - node22.size[1] * 0.5 + this.canvas.height * 0.5 / (this.ds.scale * dpi);
    this.setDirty(true, true);
  }
  /**
   * adds some useful properties to a mouse event, like the position in graph coordinates
   */
  adjustMouseEvent(e2) {
    let clientX_rel = e2.clientX;
    let clientY_rel = e2.clientY;
    if (this.canvas) {
      const b = this.canvas.getBoundingClientRect();
      clientX_rel -= b.left;
      clientY_rel -= b.top;
    }
    e2.safeOffsetX = clientX_rel;
    e2.safeOffsetY = clientY_rel;
    if (e2.deltaX === void 0)
      e2.deltaX = clientX_rel - this.last_mouse_position[0];
    if (e2.deltaY === void 0)
      e2.deltaY = clientY_rel - this.last_mouse_position[1];
    this.last_mouse_position[0] = clientX_rel;
    this.last_mouse_position[1] = clientY_rel;
    e2.canvasX = clientX_rel / this.ds.scale - this.ds.offset[0];
    e2.canvasY = clientY_rel / this.ds.scale - this.ds.offset[1];
  }
  /**
   * changes the zoom level of the graph (default is 1), you can pass also a place used to pivot the zoom
   */
  setZoom(value4, zooming_center) {
    this.ds.changeScale(value4, zooming_center);
    this.#dirty();
  }
  /**
   * converts a coordinate from graph coordinates to canvas2D coordinates
   */
  convertOffsetToCanvas(pos2, out) {
    return this.ds.convertOffsetToCanvas(pos2, out);
  }
  /**
   * converts a coordinate from Canvas2D coordinates to graph space
   */
  convertCanvasToOffset(pos2, out) {
    return this.ds.convertCanvasToOffset(pos2, out);
  }
  // converts event coordinates from canvas2D to graph coordinates
  convertEventToCanvasOffset(e2) {
    const rect = this.canvas.getBoundingClientRect();
    return this.convertCanvasToOffset([
      e2.clientX - rect.left,
      e2.clientY - rect.top
    ]);
  }
  /**
   * brings a node to front (above all other nodes)
   */
  bringToFront(node22) {
    const i2 = this.graph._nodes.indexOf(node22);
    if (i2 == -1) return;
    this.graph._nodes.splice(i2, 1);
    this.graph._nodes.push(node22);
  }
  /**
   * sends a node to the back (below all other nodes)
   */
  sendToBack(node22) {
    const i2 = this.graph._nodes.indexOf(node22);
    if (i2 == -1) return;
    this.graph._nodes.splice(i2, 1);
    this.graph._nodes.unshift(node22);
  }
  /**
   * Determines which nodes are visible and populates {@link out} with the results.
   * @param nodes The list of nodes to check - if falsy, all nodes in the graph will be checked
   * @param out Array to write visible nodes into - if falsy, a new array is created instead
   * @returns Array passed ({@link out}), or a new array containing all visible nodes
   */
  computeVisibleNodes(nodes, out) {
    const visible_nodes = out || [];
    visible_nodes.length = 0;
    const _nodes = nodes || this.graph._nodes;
    for (const node22 of _nodes) {
      node22.updateArea();
      if (!overlapBounding(this.visible_area, node22.renderArea)) continue;
      visible_nodes.push(node22);
    }
    return visible_nodes;
  }
  /**
   * renders the whole canvas content, by rendering in two separated canvas, one containing the background grid and the connections, and one containing the nodes)
   */
  draw(force_canvas, force_bgcanvas) {
    if (!this.canvas || this.canvas.width == 0 || this.canvas.height == 0) return;
    const now2 = LiteGraph.getTime();
    this.render_time = (now2 - this.last_draw_time) * 1e-3;
    this.last_draw_time = now2;
    if (this.graph) this.ds.computeVisibleArea(this.viewport);
    if (this.dirty_canvas || force_canvas)
      this.computeVisibleNodes(null, this.visible_nodes);
    if (this.dirty_bgcanvas || force_bgcanvas || this.always_render_background || this.graph?._last_trigger_time && now2 - this.graph._last_trigger_time < 1e3) {
      this.drawBackCanvas();
    }
    if (this.dirty_canvas || force_canvas) this.drawFrontCanvas();
    this.fps = this.render_time ? 1 / this.render_time : 0;
    this.frame++;
  }
  /**
   * draws the front canvas (the one containing all the nodes)
   */
  drawFrontCanvas() {
    this.dirty_canvas = false;
    if (!this.ctx) {
      this.ctx = this.bgcanvas.getContext("2d");
    }
    const ctx = this.ctx;
    if (!ctx) return;
    const canvas = this.canvas;
    if (ctx.start2D && !this.viewport) {
      ctx.start2D();
      ctx.restore();
      ctx.setTransform(1, 0, 0, 1, 0, 0);
    }
    const area = this.viewport || this.dirty_area;
    if (area) {
      ctx.save();
      ctx.beginPath();
      ctx.rect(area[0], area[1], area[2], area[3]);
      ctx.clip();
    }
    this.#snapToGrid = this.#shiftDown || LiteGraph.alwaysSnapToGrid ? this.graph.getSnapToGridSize() : void 0;
    if (this.clear_background) {
      if (area) ctx.clearRect(area[0], area[1], area[2], area[3]);
      else ctx.clearRect(0, 0, canvas.width, canvas.height);
    }
    if (this.bgcanvas == this.canvas) {
      this.drawBackCanvas();
    } else {
      const scale = window.devicePixelRatio;
      ctx.drawImage(
        this.bgcanvas,
        0,
        0,
        this.bgcanvas.width / scale,
        this.bgcanvas.height / scale
      );
    }
    this.onRender?.(canvas, ctx);
    if (this.show_info) {
      this.renderInfo(ctx, area ? area[0] : 0, area ? area[1] : 0);
    }
    if (this.graph) {
      ctx.save();
      this.ds.toCanvasContext(ctx);
      const visible_nodes = this.visible_nodes;
      const drawSnapGuides = this.#snapToGrid && this.isDragging;
      for (let i2 = 0; i2 < visible_nodes.length; ++i2) {
        const node22 = visible_nodes[i2];
        ctx.save();
        if (drawSnapGuides && this.selectedItems.has(node22))
          this.drawSnapGuide(ctx, node22);
        ctx.translate(node22.pos[0], node22.pos[1]);
        this.drawNode(node22, ctx);
        ctx.restore();
      }
      if (this.render_execution_order) {
        this.drawExecutionOrder(ctx);
      }
      if (this.graph.config.links_ontop) {
        this.drawConnections(ctx);
      }
      if (this.connecting_links?.length) {
        for (const link2 of this.connecting_links) {
          ctx.lineWidth = this.connections_width;
          let link_color = null;
          const connInOrOut = link2.output || link2.input;
          const connType = connInOrOut?.type;
          let connDir = connInOrOut?.dir;
          if (connDir == null) {
            if (link2.output)
              connDir = link2.node.horizontal ? LinkDirection.DOWN : LinkDirection.RIGHT;
            else
              connDir = link2.node.horizontal ? LinkDirection.UP : LinkDirection.LEFT;
          }
          const connShape = connInOrOut?.shape;
          switch (connType) {
            case LiteGraph.EVENT:
              link_color = LiteGraph.EVENT_LINK_COLOR;
              break;
            default:
              link_color = LiteGraph.CONNECTING_LINK_COLOR;
          }
          const pos2 = this.graph.reroutes.get(link2.afterRerouteId)?.pos ?? link2.pos;
          const highlightPos = this.#getHighlightPosition();
          this.renderLink(
            ctx,
            pos2,
            highlightPos,
            null,
            false,
            null,
            link_color,
            connDir,
            link2.direction ?? LinkDirection.CENTER
          );
          ctx.beginPath();
          if (connType === LiteGraph.EVENT || connShape === RenderShape.BOX) {
            ctx.rect(pos2[0] - 6 + 0.5, pos2[1] - 5 + 0.5, 14, 10);
            ctx.fill();
            ctx.beginPath();
            ctx.rect(
              this.graph_mouse[0] - 6 + 0.5,
              this.graph_mouse[1] - 5 + 0.5,
              14,
              10
            );
          } else if (connShape === RenderShape.ARROW) {
            ctx.moveTo(pos2[0] + 8, pos2[1] + 0.5);
            ctx.lineTo(pos2[0] - 4, pos2[1] + 6 + 0.5);
            ctx.lineTo(pos2[0] - 4, pos2[1] - 6 + 0.5);
            ctx.closePath();
          } else {
            ctx.arc(pos2[0], pos2[1], 4, 0, Math.PI * 2);
            ctx.fill();
            ctx.beginPath();
            ctx.arc(this.graph_mouse[0], this.graph_mouse[1], 4, 0, Math.PI * 2);
          }
          ctx.fill();
          this.#renderSnapHighlight(ctx, highlightPos);
        }
      }
      if (this.dragging_rectangle) {
        const { eDown, eMove } = this.pointer;
        ctx.strokeStyle = "#FFF";
        if (eDown && eMove) {
          const transform2 = ctx.getTransform();
          const ratio = window.devicePixelRatio;
          ctx.setTransform(ratio, 0, 0, ratio, 0, 0);
          const x2 = eDown.safeOffsetX;
          const y2 = eDown.safeOffsetY;
          ctx.strokeRect(x2, y2, eMove.safeOffsetX - x2, eMove.safeOffsetY - y2);
          ctx.setTransform(transform2);
        } else {
          const [x2, y2, w, h2] = this.dragging_rectangle;
          ctx.strokeRect(x2, y2, w, h2);
        }
      }
      if (this.over_link_center && this.render_link_tooltip)
        this.drawLinkTooltip(ctx, this.over_link_center);
      else
        this.onDrawLinkTooltip?.(ctx, null);
      this.onDrawForeground?.(ctx, this.visible_area);
      ctx.restore();
    }
    this.onDrawOverlay?.(ctx);
    if (area) ctx.restore();
    if (ctx.finish2D) ctx.finish2D();
  }
  /** @returns If the pointer is over a link centre marker, the link segment it belongs to.  Otherwise, `undefined`.  */
  #getLinkCentreOnPos(e2) {
    for (const linkSegment of this.renderedPaths) {
      const centre = linkSegment._pos;
      if (!centre) continue;
      if (isInRectangle(e2.canvasX, e2.canvasY, centre[0] - 4, centre[1] - 4, 8, 8)) {
        return linkSegment;
      }
    }
  }
  /** Get the target snap / highlight point in graph space */
  #getHighlightPosition() {
    return LiteGraph.snaps_for_comfy ? this._highlight_pos ?? this.graph_mouse : this.graph_mouse;
  }
  /**
   * Renders indicators showing where a link will connect if released.
   * Partial border over target node and a highlight over the slot itself.
   * @param ctx Canvas 2D context
   */
  #renderSnapHighlight(ctx, highlightPos) {
    if (!this._highlight_pos) return;
    ctx.fillStyle = "#ffcc00";
    ctx.beginPath();
    const shape = this._highlight_input?.shape;
    if (shape === RenderShape.ARROW) {
      ctx.moveTo(highlightPos[0] + 8, highlightPos[1] + 0.5);
      ctx.lineTo(highlightPos[0] - 4, highlightPos[1] + 6 + 0.5);
      ctx.lineTo(highlightPos[0] - 4, highlightPos[1] - 6 + 0.5);
      ctx.closePath();
    } else {
      ctx.arc(highlightPos[0], highlightPos[1], 6, 0, Math.PI * 2);
    }
    ctx.fill();
    if (!LiteGraph.snap_highlights_node) return;
    const node22 = this.node_over;
    if (!(node22 && this.connecting_links?.[0])) return;
    const { strokeStyle, lineWidth } = ctx;
    const area = node22.boundingRect;
    const gap = 3;
    const radius = this.round_radius + gap;
    const x2 = area[0] - gap;
    const y2 = area[1] - gap;
    const width2 = area[2] + gap * 2;
    const height = area[3] + gap * 2;
    ctx.beginPath();
    ctx.roundRect(x2, y2, width2, height, radius);
    const start2 = this.connecting_links[0].output === null ? 0 : 1;
    const inverter = start2 ? -1 : 1;
    const hx = highlightPos[0];
    const hy = highlightPos[1];
    const gRadius = width2 < height ? width2 : width2 * Math.max(height / width2, 0.5);
    const gradient = ctx.createRadialGradient(hx, hy, 0, hx, hy, gRadius);
    gradient.addColorStop(1, "#00000000");
    gradient.addColorStop(0, "#ffcc00aa");
    const linearGradient = ctx.createLinearGradient(x2, y2, x2 + width2, y2);
    linearGradient.addColorStop(0.5, "#00000000");
    linearGradient.addColorStop(start2 + 0.67 * inverter, "#ddeeff33");
    linearGradient.addColorStop(start2 + inverter, "#ffcc0055");
    ctx.setLineDash([radius, radius * 1e-3]);
    ctx.lineWidth = 1;
    ctx.strokeStyle = linearGradient;
    ctx.stroke();
    ctx.strokeStyle = gradient;
    ctx.stroke();
    ctx.setLineDash([]);
    ctx.lineWidth = lineWidth;
    ctx.strokeStyle = strokeStyle;
  }
  /**
   * draws some useful stats in the corner of the canvas
   */
  renderInfo(ctx, x2, y2) {
    x2 = x2 || 10;
    y2 = y2 || this.canvas.offsetHeight - 80;
    ctx.save();
    ctx.translate(x2, y2);
    ctx.font = "10px Arial";
    ctx.fillStyle = "#888";
    ctx.textAlign = "left";
    if (this.graph) {
      ctx.fillText("T: " + this.graph.globaltime.toFixed(2) + "s", 5, 13 * 1);
      ctx.fillText("I: " + this.graph.iteration, 5, 13 * 2);
      ctx.fillText("N: " + this.graph._nodes.length + " [" + this.visible_nodes.length + "]", 5, 13 * 3);
      ctx.fillText("V: " + this.graph._version, 5, 13 * 4);
      ctx.fillText("FPS:" + this.fps.toFixed(2), 5, 13 * 5);
    } else {
      ctx.fillText("No graph selected", 5, 13 * 1);
    }
    ctx.restore();
  }
  /**
   * draws the back canvas (the one containing the background and the connections)
   */
  drawBackCanvas() {
    const canvas = this.bgcanvas;
    if (canvas.width != this.canvas.width || canvas.height != this.canvas.height) {
      canvas.width = this.canvas.width;
      canvas.height = this.canvas.height;
    }
    if (!this.bgctx) {
      this.bgctx = this.bgcanvas.getContext("2d");
    }
    const ctx = this.bgctx;
    if (ctx.start) ctx.start();
    const viewport = this.viewport || [0, 0, ctx.canvas.width, ctx.canvas.height];
    if (this.clear_background) {
      ctx.clearRect(viewport[0], viewport[1], viewport[2], viewport[3]);
    }
    if (this._graph_stack?.length) {
      ctx.save();
      const subgraph_node = this.graph._subgraph_node;
      ctx.strokeStyle = subgraph_node.bgcolor;
      ctx.lineWidth = 10;
      ctx.strokeRect(1, 1, canvas.width - 2, canvas.height - 2);
      ctx.lineWidth = 1;
      ctx.font = "40px Arial";
      ctx.textAlign = "center";
      ctx.fillStyle = subgraph_node.bgcolor || "#AAA";
      let title = "";
      for (let i2 = 1; i2 < this._graph_stack.length; ++i2) {
        title += this._graph_stack[i2]._subgraph_node.getTitle() + " >> ";
      }
      ctx.fillText(title + subgraph_node.getTitle(), canvas.width * 0.5, 40);
      ctx.restore();
    }
    const bg_already_painted = this.onRenderBackground ? this.onRenderBackground(canvas, ctx) : false;
    if (!this.viewport) {
      const scale = window.devicePixelRatio;
      ctx.restore();
      ctx.setTransform(scale, 0, 0, scale, 0, 0);
    }
    this.visible_links.length = 0;
    if (this.graph) {
      ctx.save();
      this.ds.toCanvasContext(ctx);
      if (this.ds.scale < 1.5 && !bg_already_painted && this.clear_background_color) {
        ctx.fillStyle = this.clear_background_color;
        ctx.fillRect(
          this.visible_area[0],
          this.visible_area[1],
          this.visible_area[2],
          this.visible_area[3]
        );
      }
      if (this.background_image && this.ds.scale > 0.5 && !bg_already_painted) {
        if (this.zoom_modify_alpha) {
          ctx.globalAlpha = (1 - 0.5 / this.ds.scale) * this.editor_alpha;
        } else {
          ctx.globalAlpha = this.editor_alpha;
        }
        ctx.imageSmoothingEnabled = false;
        if (!this._bg_img || this._bg_img.name != this.background_image) {
          this._bg_img = new Image();
          this._bg_img.name = this.background_image;
          this._bg_img.src = this.background_image;
          const that = this;
          this._bg_img.onload = function() {
            that.draw(true, true);
          };
        }
        let pattern = this._pattern;
        if (pattern == null && this._bg_img.width > 0) {
          pattern = ctx.createPattern(this._bg_img, "repeat");
          this._pattern_img = this._bg_img;
          this._pattern = pattern;
        }
        if (pattern) {
          ctx.fillStyle = pattern;
          ctx.fillRect(
            this.visible_area[0],
            this.visible_area[1],
            this.visible_area[2],
            this.visible_area[3]
          );
          ctx.fillStyle = "transparent";
        }
        ctx.globalAlpha = 1;
        ctx.imageSmoothingEnabled = true;
      }
      if (this.graph._groups.length) {
        this.drawGroups(canvas, ctx);
      }
      this.onDrawBackground?.(ctx, this.visible_area);
      if (this.render_canvas_border) {
        ctx.strokeStyle = "#235";
        ctx.strokeRect(0, 0, canvas.width, canvas.height);
      }
      if (this.render_connections_shadows) {
        ctx.shadowColor = "#000";
        ctx.shadowOffsetX = 0;
        ctx.shadowOffsetY = 0;
        ctx.shadowBlur = 6;
      } else {
        ctx.shadowColor = "rgba(0,0,0,0)";
      }
      this.drawConnections(ctx);
      ctx.shadowColor = "rgba(0,0,0,0)";
      ctx.restore();
    }
    ctx.finish?.();
    this.dirty_bgcanvas = false;
    this.dirty_canvas = true;
  }
  /**
   * draws the given node inside the canvas
   */
  drawNode(node22, ctx) {
    this.current_node = node22;
    const color2 = node22.color || node22.constructor.color || LiteGraph.NODE_DEFAULT_COLOR;
    const bgcolor = node22.bgcolor || node22.constructor.bgcolor || LiteGraph.NODE_DEFAULT_BGCOLOR;
    const low_quality = this.ds.scale < 0.6;
    const editor_alpha = this.editor_alpha;
    ctx.globalAlpha = editor_alpha;
    if (this.render_shadows && !low_quality) {
      ctx.shadowColor = LiteGraph.DEFAULT_SHADOW_COLOR;
      ctx.shadowOffsetX = 2 * this.ds.scale;
      ctx.shadowOffsetY = 2 * this.ds.scale;
      ctx.shadowBlur = 3 * this.ds.scale;
    } else {
      ctx.shadowColor = "transparent";
    }
    if (node22.flags.collapsed && node22.onDrawCollapsed?.(ctx, this) == true)
      return;
    const shape = node22._shape || RenderShape.BOX;
    const size2 = LGraphCanvas.#temp_vec2;
    LGraphCanvas.#temp_vec2.set(node22.size);
    const horizontal2 = node22.horizontal;
    if (node22.flags.collapsed) {
      ctx.font = this.inner_text_font;
      const title = node22.getTitle ? node22.getTitle() : node22.title;
      if (title != null) {
        node22._collapsed_width = Math.min(
          node22.size[0],
          ctx.measureText(title).width + LiteGraph.NODE_TITLE_HEIGHT * 2
        );
        size2[0] = node22._collapsed_width;
        size2[1] = 0;
      }
    }
    if (node22.clip_area) {
      ctx.save();
      ctx.beginPath();
      if (shape == RenderShape.BOX) {
        ctx.rect(0, 0, size2[0], size2[1]);
      } else if (shape == RenderShape.ROUND) {
        ctx.roundRect(0, 0, size2[0], size2[1], [10]);
      } else if (shape == RenderShape.CIRCLE) {
        ctx.arc(size2[0] * 0.5, size2[1] * 0.5, size2[0] * 0.5, 0, Math.PI * 2);
      }
      ctx.clip();
    }
    this.drawNodeShape(
      node22,
      ctx,
      size2,
      color2,
      bgcolor,
      node22.selected
    );
    if (!low_quality) {
      node22.drawBadges(ctx);
    }
    ctx.shadowColor = "transparent";
    ctx.strokeStyle = LiteGraph.NODE_BOX_OUTLINE_COLOR;
    node22.onDrawForeground?.(ctx, this, this.canvas);
    ctx.textAlign = horizontal2 ? "center" : "left";
    ctx.font = this.inner_text_font;
    const render_text = !low_quality;
    const highlightColour = LiteGraph.NODE_TEXT_HIGHLIGHT_COLOR ?? LiteGraph.NODE_SELECTED_TITLE_COLOR ?? LiteGraph.NODE_TEXT_COLOR;
    const out_slot = this.connecting_links?.[0]?.output;
    const in_slot = this.connecting_links?.[0]?.input;
    ctx.lineWidth = 1;
    let max_y = 0;
    const slot_pos = new Float32Array(2);
    if (!node22.flags.collapsed) {
      if (node22.inputs) {
        for (let i2 = 0; i2 < node22.inputs.length; i2++) {
          const slot = node22.inputs[i2];
          const slot_type = slot.type;
          const isValid2 = !this.connecting_links || out_slot && LiteGraph.isValidConnection(slot.type, out_slot.type);
          const highlight = isValid2 && node22.mouseOver?.inputId === i2;
          const label_color = highlight ? highlightColour : LiteGraph.NODE_TEXT_COLOR;
          ctx.globalAlpha = isValid2 ? editor_alpha : 0.4 * editor_alpha;
          ctx.fillStyle = slot.link != null ? slot.color_on || this.default_connection_color_byType[slot_type] || this.default_connection_color.input_on : slot.color_off || this.default_connection_color_byTypeOff[slot_type] || this.default_connection_color_byType[slot_type] || this.default_connection_color.input_off;
          const pos2 = node22.getConnectionPos(true, i2, slot_pos);
          pos2[0] -= node22.pos[0];
          pos2[1] -= node22.pos[1];
          if (max_y < pos2[1] + LiteGraph.NODE_SLOT_HEIGHT * 0.5) {
            max_y = pos2[1] + LiteGraph.NODE_SLOT_HEIGHT * 0.5;
          }
          drawSlot(ctx, slot, pos2, {
            horizontal: horizontal2,
            low_quality,
            render_text,
            label_color,
            label_position: LabelPosition.Right,
            // Input slot is not stroked.
            do_stroke: false,
            highlight
          });
        }
      }
      ctx.textAlign = horizontal2 ? "center" : "right";
      ctx.strokeStyle = "black";
      if (node22.outputs) {
        for (let i2 = 0; i2 < node22.outputs.length; i2++) {
          const slot = node22.outputs[i2];
          const slot_type = slot.type;
          const isValid2 = !this.connecting_links || in_slot && LiteGraph.isValidConnection(slot_type, in_slot.type);
          const highlight = isValid2 && node22.mouseOver?.outputId === i2;
          const label_color = highlight ? highlightColour : LiteGraph.NODE_TEXT_COLOR;
          ctx.globalAlpha = isValid2 ? editor_alpha : 0.4 * editor_alpha;
          const pos2 = node22.getConnectionPos(false, i2, slot_pos);
          pos2[0] -= node22.pos[0];
          pos2[1] -= node22.pos[1];
          if (max_y < pos2[1] + LiteGraph.NODE_SLOT_HEIGHT * 0.5) {
            max_y = pos2[1] + LiteGraph.NODE_SLOT_HEIGHT * 0.5;
          }
          ctx.fillStyle = slot.links && slot.links.length ? slot.color_on || this.default_connection_color_byType[slot_type] || this.default_connection_color.output_on : slot.color_off || this.default_connection_color_byTypeOff[slot_type] || this.default_connection_color_byType[slot_type] || this.default_connection_color.output_off;
          drawSlot(ctx, slot, pos2, {
            horizontal: horizontal2,
            low_quality,
            render_text,
            label_color,
            label_position: LabelPosition.Left,
            do_stroke: true,
            highlight
          });
        }
      }
      ctx.textAlign = "left";
      ctx.globalAlpha = 1;
      if (node22.widgets) {
        let widgets_y = max_y;
        if (horizontal2 || node22.widgets_up) {
          widgets_y = 2;
        }
        if (node22.widgets_start_y != null) widgets_y = node22.widgets_start_y;
        this.drawNodeWidgets(
          node22,
          widgets_y,
          ctx,
          this.node_widget && this.node_widget[0] == node22 ? this.node_widget[1] : null
        );
      }
    } else if (this.render_collapsed_slots) {
      let input_slot = null;
      let output_slot = null;
      let slot;
      if (node22.inputs) {
        for (let i2 = 0; i2 < node22.inputs.length; i2++) {
          slot = node22.inputs[i2];
          if (slot.link == null) {
            continue;
          }
          input_slot = slot;
          break;
        }
      }
      if (node22.outputs) {
        for (let i2 = 0; i2 < node22.outputs.length; i2++) {
          slot = node22.outputs[i2];
          if (!slot.links || !slot.links.length) {
            continue;
          }
          output_slot = slot;
        }
      }
      if (input_slot) {
        let x2 = 0;
        let y2 = LiteGraph.NODE_TITLE_HEIGHT * -0.5;
        if (horizontal2) {
          x2 = node22._collapsed_width * 0.5;
          y2 = -LiteGraph.NODE_TITLE_HEIGHT;
        }
        ctx.fillStyle = "#686";
        ctx.beginPath();
        if (slot.type === LiteGraph.EVENT || slot.shape === RenderShape.BOX) {
          ctx.rect(x2 - 7 + 0.5, y2 - 4, 14, 8);
        } else if (slot.shape === RenderShape.ARROW) {
          ctx.moveTo(x2 + 8, y2);
          ctx.lineTo(x2 + -4, y2 - 4);
          ctx.lineTo(x2 + -4, y2 + 4);
          ctx.closePath();
        } else {
          ctx.arc(x2, y2, 4, 0, Math.PI * 2);
        }
        ctx.fill();
      }
      if (output_slot) {
        let x2 = node22._collapsed_width;
        let y2 = LiteGraph.NODE_TITLE_HEIGHT * -0.5;
        if (horizontal2) {
          x2 = node22._collapsed_width * 0.5;
          y2 = 0;
        }
        ctx.fillStyle = "#686";
        ctx.strokeStyle = "black";
        ctx.beginPath();
        if (slot.type === LiteGraph.EVENT || slot.shape === RenderShape.BOX) {
          ctx.rect(x2 - 7 + 0.5, y2 - 4, 14, 8);
        } else if (slot.shape === RenderShape.ARROW) {
          ctx.moveTo(x2 + 6, y2);
          ctx.lineTo(x2 - 6, y2 - 4);
          ctx.lineTo(x2 - 6, y2 + 4);
          ctx.closePath();
        } else {
          ctx.arc(x2, y2, 4, 0, Math.PI * 2);
        }
        ctx.fill();
      }
    }
    if (node22.clip_area) {
      ctx.restore();
    }
    ctx.globalAlpha = 1;
  }
  /**
   * Draws the link mouseover effect and tooltip.
   * @param ctx Canvas 2D context to draw on
   * @param link The link to render the mouseover effect for
   * @remarks
   * Called against {@link LGraphCanvas.over_link_center}.
   * @todo Split tooltip from hover, so it can be drawn / eased separately
   */
  drawLinkTooltip(ctx, link2) {
    const pos2 = link2._pos;
    ctx.fillStyle = "black";
    ctx.beginPath();
    if (this.linkMarkerShape === LinkMarkerShape.Arrow) {
      const transform2 = ctx.getTransform();
      ctx.translate(pos2[0], pos2[1]);
      if (Number.isFinite(link2._centreAngle)) ctx.rotate(link2._centreAngle);
      ctx.moveTo(-2, -3);
      ctx.lineTo(4, 0);
      ctx.lineTo(-2, 3);
      ctx.setTransform(transform2);
    } else if (this.linkMarkerShape == null || this.linkMarkerShape === LinkMarkerShape.Circle) {
      ctx.arc(pos2[0], pos2[1], 3, 0, Math.PI * 2);
    }
    ctx.fill();
    const data24 = link2.data;
    if (data24 == null) return;
    if (this.onDrawLinkTooltip?.(ctx, link2, this) == true) return;
    let text2 = null;
    if (typeof data24 === "number")
      text2 = data24.toFixed(2);
    else if (typeof data24 === "string")
      text2 = '"' + data24 + '"';
    else if (typeof data24 === "boolean")
      text2 = String(data24);
    else if (data24.toToolTip)
      text2 = data24.toToolTip();
    else
      text2 = "[" + data24.constructor.name + "]";
    if (text2 == null) return;
    text2 = text2.substring(0, 30);
    ctx.font = "14px Courier New";
    const info = ctx.measureText(text2);
    const w = info.width + 20;
    const h2 = 24;
    ctx.shadowColor = "black";
    ctx.shadowOffsetX = 2;
    ctx.shadowOffsetY = 2;
    ctx.shadowBlur = 3;
    ctx.fillStyle = "#454";
    ctx.beginPath();
    ctx.roundRect(pos2[0] - w * 0.5, pos2[1] - 15 - h2, w, h2, [3]);
    ctx.moveTo(pos2[0] - 10, pos2[1] - 15);
    ctx.lineTo(pos2[0] + 10, pos2[1] - 15);
    ctx.lineTo(pos2[0], pos2[1] - 5);
    ctx.fill();
    ctx.shadowColor = "transparent";
    ctx.textAlign = "center";
    ctx.fillStyle = "#CEC";
    ctx.fillText(text2, pos2[0], pos2[1] - 15 - h2 * 0.3);
  }
  /**
   * Draws the shape of the given node on the canvas
   * @param node The node to draw
   * @param ctx 2D canvas rendering context used to draw
   * @param size Size of the background to draw, in graph units.  Differs from node size if collapsed, etc.
   * @param fgcolor Foreground colour - used for text
   * @param bgcolor Background colour of the node
   * @param selected Whether to render the node as selected.  Likely to be removed in future, as current usage is simply the selected property of the node.
   */
  drawNodeShape(node22, ctx, size2, fgcolor, bgcolor, selected2) {
    ctx.strokeStyle = fgcolor;
    ctx.fillStyle = LiteGraph.use_legacy_node_error_indicator ? "#F00" : bgcolor;
    const title_height = LiteGraph.NODE_TITLE_HEIGHT;
    const low_quality = this.ds.scale < 0.5;
    const { collapsed } = node22.flags;
    const shape = node22._shape || node22.constructor.shape || LiteGraph.NODE_DEFAULT_SHAPE;
    const { title_mode } = node22.constructor;
    const render_title = title_mode == TitleMode.TRANSPARENT_TITLE || title_mode == TitleMode.NO_TITLE ? false : true;
    const area = LGraphCanvas.#tmp_area;
    node22.measure(area);
    area[0] -= node22.pos[0];
    area[1] -= node22.pos[1];
    const old_alpha = ctx.globalAlpha;
    ctx.beginPath();
    if (shape == RenderShape.BOX || low_quality) {
      ctx.fillRect(area[0], area[1], area[2], area[3]);
    } else if (shape == RenderShape.ROUND || shape == RenderShape.CARD) {
      ctx.roundRect(
        area[0],
        area[1],
        area[2],
        area[3],
        shape == RenderShape.CARD ? [this.round_radius, this.round_radius, 0, 0] : [this.round_radius]
      );
    } else if (shape == RenderShape.CIRCLE) {
      ctx.arc(size2[0] * 0.5, size2[1] * 0.5, size2[0] * 0.5, 0, Math.PI * 2);
    }
    ctx.fill();
    if (node22.has_errors && !LiteGraph.use_legacy_node_error_indicator) {
      this.strokeShape(ctx, area, {
        shape,
        title_mode,
        title_height,
        padding: 12,
        colour: LiteGraph.NODE_ERROR_COLOUR,
        collapsed,
        thickness: 10
      });
    }
    if (!collapsed && render_title) {
      ctx.shadowColor = "transparent";
      ctx.fillStyle = "rgba(0,0,0,0.2)";
      ctx.fillRect(0, -1, area[2], 2);
    }
    ctx.shadowColor = "transparent";
    node22.onDrawBackground?.(ctx, this, this.canvas, this.graph_mouse);
    if (render_title || title_mode == TitleMode.TRANSPARENT_TITLE) {
      if (node22.onDrawTitleBar) {
        node22.onDrawTitleBar(ctx, title_height, size2, this.ds.scale, fgcolor);
      } else if (title_mode != TitleMode.TRANSPARENT_TITLE && (node22.constructor.title_color || this.render_title_colored)) {
        const title_color = node22.constructor.title_color || fgcolor;
        if (collapsed) {
          ctx.shadowColor = LiteGraph.DEFAULT_SHADOW_COLOR;
        }
        ctx.fillStyle = title_color;
        ctx.beginPath();
        if (shape == RenderShape.BOX || low_quality) {
          ctx.rect(0, -title_height, size2[0], title_height);
        } else if (shape == RenderShape.ROUND || shape == RenderShape.CARD) {
          ctx.roundRect(
            0,
            -title_height,
            size2[0],
            title_height,
            collapsed ? [this.round_radius] : [this.round_radius, this.round_radius, 0, 0]
          );
        }
        ctx.fill();
        ctx.shadowColor = "transparent";
      }
      let colState = LiteGraph.node_box_coloured_by_mode && LiteGraph.NODE_MODES_COLORS[node22.mode] ? LiteGraph.NODE_MODES_COLORS[node22.mode] : false;
      if (LiteGraph.node_box_coloured_when_on) {
        colState = node22.action_triggered ? "#FFF" : node22.execute_triggered ? "#AAA" : colState;
      }
      const box_size = 10;
      if (node22.onDrawTitleBox) {
        node22.onDrawTitleBox(ctx, title_height, size2, this.ds.scale);
      } else if (shape == RenderShape.ROUND || shape == RenderShape.CIRCLE || shape == RenderShape.CARD) {
        if (low_quality) {
          ctx.fillStyle = "black";
          ctx.beginPath();
          ctx.arc(
            title_height * 0.5,
            title_height * -0.5,
            box_size * 0.5 + 1,
            0,
            Math.PI * 2
          );
          ctx.fill();
        }
        ctx.fillStyle = node22.boxcolor || colState || LiteGraph.NODE_DEFAULT_BOXCOLOR;
        if (low_quality)
          ctx.fillRect(
            title_height * 0.5 - box_size * 0.5,
            title_height * -0.5 - box_size * 0.5,
            box_size,
            box_size
          );
        else {
          ctx.beginPath();
          ctx.arc(
            title_height * 0.5,
            title_height * -0.5,
            box_size * 0.5,
            0,
            Math.PI * 2
          );
          ctx.fill();
        }
      } else {
        if (low_quality) {
          ctx.fillStyle = "black";
          ctx.fillRect(
            (title_height - box_size) * 0.5 - 1,
            (title_height + box_size) * -0.5 - 1,
            box_size + 2,
            box_size + 2
          );
        }
        ctx.fillStyle = node22.boxcolor || colState || LiteGraph.NODE_DEFAULT_BOXCOLOR;
        ctx.fillRect(
          (title_height - box_size) * 0.5,
          (title_height + box_size) * -0.5,
          box_size,
          box_size
        );
      }
      ctx.globalAlpha = old_alpha;
      if (node22.onDrawTitleText) {
        node22.onDrawTitleText(
          ctx,
          title_height,
          size2,
          this.ds.scale,
          this.title_text_font,
          selected2
        );
      }
      if (!low_quality) {
        ctx.font = this.title_text_font;
        const rawTitle = node22.getTitle() ?? `❌ ${node22.type}`;
        const title = String(rawTitle) + (node22.pinned ? "📌" : "");
        if (title) {
          if (selected2) {
            ctx.fillStyle = LiteGraph.NODE_SELECTED_TITLE_COLOR;
          } else {
            ctx.fillStyle = node22.constructor.title_text_color || this.node_title_color;
          }
          if (collapsed) {
            ctx.textAlign = "left";
            ctx.fillText(
              title.substr(0, 20),
              // avoid urls too long
              title_height,
              // + measure.width * 0.5,
              LiteGraph.NODE_TITLE_TEXT_Y - title_height
            );
            ctx.textAlign = "left";
          } else {
            ctx.textAlign = "left";
            ctx.fillText(
              title,
              title_height,
              LiteGraph.NODE_TITLE_TEXT_Y - title_height
            );
          }
        }
      }
      if (!collapsed && node22.subgraph && !node22.skip_subgraph_button) {
        const w = LiteGraph.NODE_TITLE_HEIGHT;
        const x2 = node22.size[0] - w;
        const over = LiteGraph.isInsideRectangle(
          this.graph_mouse[0] - node22.pos[0],
          this.graph_mouse[1] - node22.pos[1],
          x2 + 2,
          -w + 2,
          w - 4,
          w - 4
        );
        ctx.fillStyle = over ? "#888" : "#555";
        if (shape == RenderShape.BOX || low_quality) {
          ctx.fillRect(x2 + 2, -w + 2, w - 4, w - 4);
        } else {
          ctx.beginPath();
          ctx.roundRect(x2 + 2, -w + 2, w - 4, w - 4, [4]);
          ctx.fill();
        }
        ctx.fillStyle = "#333";
        ctx.beginPath();
        ctx.moveTo(x2 + w * 0.2, -w * 0.6);
        ctx.lineTo(x2 + w * 0.8, -w * 0.6);
        ctx.lineTo(x2 + w * 0.5, -w * 0.3);
        ctx.fill();
      }
      node22.onDrawTitle?.(ctx);
    }
    if (selected2) {
      node22.onBounding?.(area);
      const padding = node22.has_errors && !LiteGraph.use_legacy_node_error_indicator ? 20 : void 0;
      this.strokeShape(ctx, area, {
        shape,
        title_height,
        title_mode,
        padding,
        collapsed: node22.flags?.collapsed
      });
    }
    if (node22.execute_triggered > 0) node22.execute_triggered--;
    if (node22.action_triggered > 0) node22.action_triggered--;
  }
  /**
   * Draws only the path of a shape on the canvas, without filling.
   * Used to draw indicators for node status, e.g. "selected".
   * @param ctx The 2D context to draw on
   * @param area The position and size of the shape to render
   */
  strokeShape(ctx, area, {
    /** The shape to render */
    shape = RenderShape.BOX,
    /** Shape will extend above the Y-axis 0 by this amount */
    title_height = LiteGraph.NODE_TITLE_HEIGHT,
    /** @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */
    title_mode = TitleMode.NORMAL_TITLE,
    /** The colour that should be drawn */
    colour = LiteGraph.NODE_BOX_OUTLINE_COLOR,
    /** The distance between the edge of the {@link area} and the middle of the line */
    padding = 6,
    /** @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */
    collapsed = false,
    /** Thickness of the line drawn (`lineWidth`) */
    thickness = 1
  } = {}) {
    if (title_mode === TitleMode.TRANSPARENT_TITLE) {
      area[1] -= title_height;
      area[3] += title_height;
    }
    const { lineWidth, strokeStyle } = ctx;
    ctx.lineWidth = thickness;
    ctx.globalAlpha = 0.8;
    ctx.strokeStyle = colour;
    ctx.beginPath();
    const [x2, y2, width2, height] = area;
    switch (shape) {
      case RenderShape.BOX: {
        ctx.rect(
          x2 - padding,
          y2 - padding,
          width2 + 2 * padding,
          height + 2 * padding
        );
        break;
      }
      case RenderShape.ROUND:
      case RenderShape.CARD: {
        const radius = this.round_radius + padding;
        const isCollapsed = shape === RenderShape.CARD && collapsed;
        const cornerRadii = isCollapsed || shape === RenderShape.ROUND ? [radius] : [radius, 2, radius, 2];
        ctx.roundRect(
          x2 - padding,
          y2 - padding,
          width2 + 2 * padding,
          height + 2 * padding,
          cornerRadii
        );
        break;
      }
      case RenderShape.CIRCLE: {
        const centerX = x2 + width2 / 2;
        const centerY = y2 + height / 2;
        const radius = Math.max(width2, height) / 2 + padding;
        ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
        break;
      }
    }
    ctx.stroke();
    ctx.lineWidth = lineWidth;
    ctx.strokeStyle = strokeStyle;
    ctx.globalAlpha = 1;
  }
  /**
   * Draws a snap guide for a {@link Positionable} item.
   *
   * Initial design was a simple white rectangle representing the location the
   * item would land if dropped.
   * @param ctx The 2D canvas context to draw on
   * @param item The item to draw a snap guide for
   * @param shape The shape of the snap guide to draw
   * @todo Update to align snapping with boundingRect
   * @todo Shapes
   */
  drawSnapGuide(ctx, item3, shape = RenderShape.ROUND) {
    const snapGuide = LGraphCanvas.#temp;
    snapGuide.set(item3.boundingRect);
    const { pos: pos2 } = item3;
    const offsetX = pos2[0] - snapGuide[0];
    const offsetY = pos2[1] - snapGuide[1];
    snapGuide[0] += offsetX;
    snapGuide[1] += offsetY;
    snapPoint(snapGuide, this.#snapToGrid);
    snapGuide[0] -= offsetX;
    snapGuide[1] -= offsetY;
    const { globalAlpha } = ctx;
    ctx.globalAlpha = 1;
    ctx.beginPath();
    const [x2, y2, w, h2] = snapGuide;
    if (shape === RenderShape.CIRCLE) {
      const midX = x2 + w * 0.5;
      const midY = y2 + h2 * 0.5;
      const radius = Math.min(w * 0.5, h2 * 0.5);
      ctx.arc(midX, midY, radius, 0, Math.PI * 2);
    } else {
      ctx.rect(x2, y2, w, h2);
    }
    ctx.lineWidth = 0.5;
    ctx.strokeStyle = "#FFFFFF66";
    ctx.fillStyle = "#FFFFFF22";
    ctx.fill();
    ctx.stroke();
    ctx.globalAlpha = globalAlpha;
  }
  drawConnections(ctx) {
    const rendered = this.renderedPaths;
    rendered.clear();
    if (this.links_render_mode === LinkRenderType.HIDDEN_LINK) return;
    const visibleReroutes = [];
    const now2 = LiteGraph.getTime();
    const visible_area = this.visible_area;
    LGraphCanvas.#margin_area[0] = visible_area[0] - 20;
    LGraphCanvas.#margin_area[1] = visible_area[1] - 20;
    LGraphCanvas.#margin_area[2] = visible_area[2] + 40;
    LGraphCanvas.#margin_area[3] = visible_area[3] + 40;
    ctx.lineWidth = this.connections_width;
    ctx.fillStyle = "#AAA";
    ctx.strokeStyle = "#AAA";
    ctx.globalAlpha = this.editor_alpha;
    const nodes = this.graph._nodes;
    for (let n = 0, l = nodes.length; n < l; ++n) {
      const node22 = nodes[n];
      if (!node22.inputs || !node22.inputs.length) continue;
      for (let i2 = 0; i2 < node22.inputs.length; ++i2) {
        const input = node22.inputs[i2];
        if (!input || input.link == null) continue;
        const link_id = input.link;
        const link2 = this.graph._links.get(link_id);
        if (!link2) continue;
        const start_node = this.graph.getNodeById(link2.origin_id);
        if (start_node == null) continue;
        const outputId = link2.origin_slot;
        const start_node_slotpos = outputId == -1 ? [start_node.pos[0] + 10, start_node.pos[1] + 10] : start_node.getConnectionPos(false, outputId, LGraphCanvas.#tempA);
        const end_node_slotpos = node22.getConnectionPos(true, i2, LGraphCanvas.#tempB);
        const reroutes = this.reroutesEnabled ? LLink.getReroutes(this.graph, link2) : [];
        const points = [
          start_node_slotpos,
          ...reroutes.map((x2) => x2.pos),
          end_node_slotpos
        ];
        const pointsX = points.map((x2) => x2[0]);
        const pointsY = points.map((x2) => x2[1]);
        LGraphCanvas.#link_bounding[0] = Math.min(...pointsX);
        LGraphCanvas.#link_bounding[1] = Math.min(...pointsY);
        LGraphCanvas.#link_bounding[2] = Math.max(...pointsX) - LGraphCanvas.#link_bounding[0];
        LGraphCanvas.#link_bounding[3] = Math.max(...pointsY) - LGraphCanvas.#link_bounding[1];
        if (!overlapBounding(LGraphCanvas.#link_bounding, LGraphCanvas.#margin_area))
          continue;
        const start_slot = start_node.outputs[outputId];
        const end_slot = node22.inputs[i2];
        if (!start_slot || !end_slot) continue;
        const start_dir = start_slot.dir || (start_node.horizontal ? LinkDirection.DOWN : LinkDirection.RIGHT);
        const end_dir = end_slot.dir || (node22.horizontal ? LinkDirection.UP : LinkDirection.LEFT);
        if (reroutes.length) {
          let startControl;
          const l2 = reroutes.length;
          for (let j = 0; j < l2; j++) {
            const reroute = reroutes[j];
            if (!rendered.has(reroute)) {
              rendered.add(reroute);
              visibleReroutes.push(reroute);
              reroute._colour = link2.color || LGraphCanvas.link_type_colors[link2.type] || this.default_link_color;
              const prevReroute = this.graph.reroutes.get(reroute.parentId);
              const startPos = prevReroute?.pos ?? start_node_slotpos;
              reroute.calculateAngle(this.last_draw_time, this.graph, startPos);
              this.renderLink(
                ctx,
                startPos,
                reroute.pos,
                link2,
                false,
                0,
                null,
                start_dir,
                end_dir,
                {
                  startControl,
                  endControl: reroute.controlPoint,
                  reroute
                }
              );
            }
            const nextPos = reroutes[j + 1]?.pos ?? end_node_slotpos;
            const dist3 = Math.min(80, distance(reroute.pos, nextPos) * 0.25);
            startControl = [dist3 * reroute.cos, dist3 * reroute.sin];
          }
          this.renderLink(
            ctx,
            points.at(-2),
            points.at(-1),
            link2,
            false,
            0,
            null,
            start_dir,
            end_dir,
            { startControl }
          );
        } else {
          this.renderLink(
            ctx,
            start_node_slotpos,
            end_node_slotpos,
            link2,
            false,
            0,
            null,
            start_dir,
            end_dir
          );
        }
        rendered.add(link2);
        if (link2 && link2._last_time && now2 - link2._last_time < 1e3) {
          const f = 2 - (now2 - link2._last_time) * 2e-3;
          const tmp = ctx.globalAlpha;
          ctx.globalAlpha = tmp * f;
          this.renderLink(
            ctx,
            start_node_slotpos,
            end_node_slotpos,
            link2,
            true,
            f,
            "white",
            start_dir,
            end_dir
          );
          ctx.globalAlpha = tmp;
        }
      }
    }
    for (const reroute of visibleReroutes) {
      if (this.#snapToGrid && this.isDragging && this.selectedItems.has(reroute))
        this.drawSnapGuide(ctx, reroute, RenderShape.CIRCLE);
      reroute.draw(ctx);
    }
    ctx.globalAlpha = 1;
  }
  /**
   * draws a link between two points
   * @param ctx Canvas 2D rendering context
   * @param a start pos
   * @param b end pos
   * @param link the link object with all the link info
   * @param skip_border ignore the shadow of the link
   * @param flow show flow animation (for events)
   * @param color the color for the link
   * @param start_dir the direction enum
   * @param end_dir the direction enum
   */
  renderLink(ctx, a, b, link2, skip_border, flow, color2, start_dir, end_dir, {
    startControl,
    endControl,
    reroute,
    num_sublines = 1
  } = {}) {
    if (link2) this.visible_links.push(link2);
    const linkColour = link2 != null && this.highlighted_links[link2.id] ? "#FFF" : color2 || link2?.color || LGraphCanvas.link_type_colors[link2.type] || this.default_link_color;
    const startDir = start_dir || LinkDirection.RIGHT;
    const endDir = end_dir || LinkDirection.LEFT;
    const dist3 = this.links_render_mode == LinkRenderType.SPLINE_LINK && (!endControl || !startControl) ? distance(a, b) : null;
    if (this.render_connections_border && this.ds.scale > 0.6) {
      ctx.lineWidth = this.connections_width + 4;
    }
    ctx.lineJoin = "round";
    num_sublines ||= 1;
    if (num_sublines > 1) ctx.lineWidth = 0.5;
    const path = new Path2D();
    const linkSegment = reroute ?? link2;
    if (linkSegment) linkSegment.path = path;
    const innerA = LGraphCanvas.#lTempA;
    const innerB = LGraphCanvas.#lTempB;
    const pos2 = linkSegment?._pos ?? [0, 0];
    for (let i2 = 0; i2 < num_sublines; i2 += 1) {
      const offsety = (i2 - (num_sublines - 1) * 0.5) * 5;
      innerA[0] = a[0];
      innerA[1] = a[1];
      innerB[0] = b[0];
      innerB[1] = b[1];
      if (this.links_render_mode == LinkRenderType.SPLINE_LINK) {
        if (endControl) {
          innerB[0] = b[0] + endControl[0];
          innerB[1] = b[1] + endControl[1];
        } else {
          this.#addSplineOffset(innerB, endDir, dist3);
        }
        if (startControl) {
          innerA[0] = a[0] + startControl[0];
          innerA[1] = a[1] + startControl[1];
        } else {
          this.#addSplineOffset(innerA, startDir, dist3);
        }
        path.moveTo(a[0], a[1] + offsety);
        path.bezierCurveTo(
          innerA[0],
          innerA[1] + offsety,
          innerB[0],
          innerB[1] + offsety,
          b[0],
          b[1] + offsety
        );
        findPointOnCurve(pos2, a, b, innerA, innerB, 0.5);
        if (linkSegment && this.linkMarkerShape === LinkMarkerShape.Arrow) {
          const justPastCentre = LGraphCanvas.#lTempC;
          findPointOnCurve(justPastCentre, a, b, innerA, innerB, 0.51);
          linkSegment._centreAngle = Math.atan2(
            justPastCentre[1] - pos2[1],
            justPastCentre[0] - pos2[0]
          );
        }
      } else if (this.links_render_mode == LinkRenderType.LINEAR_LINK) {
        const l = 15;
        switch (startDir) {
          case LinkDirection.LEFT:
            innerA[0] += -l;
            break;
          case LinkDirection.RIGHT:
            innerA[0] += l;
            break;
          case LinkDirection.UP:
            innerA[1] += -l;
            break;
          case LinkDirection.DOWN:
            innerA[1] += l;
            break;
        }
        switch (endDir) {
          case LinkDirection.LEFT:
            innerB[0] += -l;
            break;
          case LinkDirection.RIGHT:
            innerB[0] += l;
            break;
          case LinkDirection.UP:
            innerB[1] += -l;
            break;
          case LinkDirection.DOWN:
            innerB[1] += l;
            break;
        }
        path.moveTo(a[0], a[1] + offsety);
        path.lineTo(innerA[0], innerA[1] + offsety);
        path.lineTo(innerB[0], innerB[1] + offsety);
        path.lineTo(b[0], b[1] + offsety);
        pos2[0] = (innerA[0] + innerB[0]) * 0.5;
        pos2[1] = (innerA[1] + innerB[1]) * 0.5;
        if (linkSegment && this.linkMarkerShape === LinkMarkerShape.Arrow) {
          linkSegment._centreAngle = Math.atan2(
            innerB[1] - innerA[1],
            innerB[0] - innerA[0]
          );
        }
      } else if (this.links_render_mode == LinkRenderType.STRAIGHT_LINK) {
        if (startDir == LinkDirection.RIGHT) {
          innerA[0] += 10;
        } else {
          innerA[1] += 10;
        }
        if (endDir == LinkDirection.LEFT) {
          innerB[0] -= 10;
        } else {
          innerB[1] -= 10;
        }
        const midX = (innerA[0] + innerB[0]) * 0.5;
        path.moveTo(a[0], a[1]);
        path.lineTo(innerA[0], innerA[1]);
        path.lineTo(midX, innerA[1]);
        path.lineTo(midX, innerB[1]);
        path.lineTo(innerB[0], innerB[1]);
        path.lineTo(b[0], b[1]);
        pos2[0] = midX;
        pos2[1] = (innerA[1] + innerB[1]) * 0.5;
        if (linkSegment && this.linkMarkerShape === LinkMarkerShape.Arrow) {
          const diff2 = innerB[1] - innerA[1];
          if (Math.abs(diff2) < 4) linkSegment._centreAngle = 0;
          else if (diff2 > 0) linkSegment._centreAngle = Math.PI * 0.5;
          else linkSegment._centreAngle = -(Math.PI * 0.5);
        }
      } else {
        return;
      }
    }
    if (this.render_connections_border && this.ds.scale > 0.6 && !skip_border) {
      ctx.strokeStyle = "rgba(0,0,0,0.5)";
      ctx.stroke(path);
    }
    ctx.lineWidth = this.connections_width;
    ctx.fillStyle = ctx.strokeStyle = linkColour;
    ctx.stroke(path);
    if (this.ds.scale >= 0.6 && this.highquality_render && linkSegment && // TODO: Re-assess this usage - likely a workaround that linkSegment truthy check resolves
    endDir != LinkDirection.CENTER) {
      if (this.render_connection_arrows) {
        const posA = this.computeConnectionPoint(a, b, 0.25, startDir, endDir);
        const posB = this.computeConnectionPoint(a, b, 0.26, startDir, endDir);
        const posC = this.computeConnectionPoint(a, b, 0.75, startDir, endDir);
        const posD = this.computeConnectionPoint(a, b, 0.76, startDir, endDir);
        let angleA = 0;
        let angleB = 0;
        if (this.render_curved_connections) {
          angleA = -Math.atan2(posB[0] - posA[0], posB[1] - posA[1]);
          angleB = -Math.atan2(posD[0] - posC[0], posD[1] - posC[1]);
        } else {
          angleB = angleA = b[1] > a[1] ? 0 : Math.PI;
        }
        const transform2 = ctx.getTransform();
        ctx.translate(posA[0], posA[1]);
        ctx.rotate(angleA);
        ctx.beginPath();
        ctx.moveTo(-5, -3);
        ctx.lineTo(0, 7);
        ctx.lineTo(5, -3);
        ctx.fill();
        ctx.setTransform(transform2);
        ctx.translate(posC[0], posC[1]);
        ctx.rotate(angleB);
        ctx.beginPath();
        ctx.moveTo(-5, -3);
        ctx.lineTo(0, 7);
        ctx.lineTo(5, -3);
        ctx.fill();
        ctx.setTransform(transform2);
      }
      ctx.beginPath();
      if (this.linkMarkerShape === LinkMarkerShape.Arrow) {
        const transform2 = ctx.getTransform();
        ctx.translate(pos2[0], pos2[1]);
        ctx.rotate(linkSegment._centreAngle);
        ctx.moveTo(-3.2, -5);
        ctx.lineTo(7, 0);
        ctx.lineTo(-3.2, 5);
        ctx.fill();
        ctx.setTransform(transform2);
      } else if (this.linkMarkerShape == null || this.linkMarkerShape === LinkMarkerShape.Circle) {
        ctx.arc(pos2[0], pos2[1], 5, 0, Math.PI * 2);
      }
      ctx.fill();
    }
    if (flow) {
      ctx.fillStyle = linkColour;
      for (let i2 = 0; i2 < 5; ++i2) {
        const f = (LiteGraph.getTime() * 1e-3 + i2 * 0.2) % 1;
        const flowPos = this.computeConnectionPoint(a, b, f, startDir, endDir);
        ctx.beginPath();
        ctx.arc(flowPos[0], flowPos[1], 5, 0, 2 * Math.PI);
        ctx.fill();
      }
    }
  }
  /**
   * Finds a point along a spline represented by a to b, with spline endpoint directions dictacted by start_dir and end_dir.
   * @param a Start point
   * @param b End point
   * @param t Time: distance between points (e.g 0.25 is 25% along the line)
   * @param start_dir Spline start direction
   * @param end_dir Spline end direction
   * @returns The point at {@link t} distance along the spline a-b.
   */
  computeConnectionPoint(a, b, t2, start_dir, end_dir) {
    start_dir ||= LinkDirection.RIGHT;
    end_dir ||= LinkDirection.LEFT;
    const dist3 = distance(a, b);
    const pa = [a[0], a[1]];
    const pb = [b[0], b[1]];
    this.#addSplineOffset(pa, start_dir, dist3);
    this.#addSplineOffset(pb, end_dir, dist3);
    const c1 = (1 - t2) * (1 - t2) * (1 - t2);
    const c2 = 3 * ((1 - t2) * (1 - t2)) * t2;
    const c3 = 3 * (1 - t2) * (t2 * t2);
    const c4 = t2 * t2 * t2;
    const x2 = c1 * a[0] + c2 * pa[0] + c3 * pb[0] + c4 * b[0];
    const y2 = c1 * a[1] + c2 * pa[1] + c3 * pb[1] + c4 * b[1];
    return [x2, y2];
  }
  /**
   * Modifies an existing point, adding a single-axis offset.
   * @param point The point to add the offset to
   * @param direction The direction to add the offset in
   * @param dist Distance to offset
   * @param factor Distance is mulitplied by this value.  Default: 0.25
   */
  #addSplineOffset(point, direction, dist3, factor = 0.25) {
    switch (direction) {
      case LinkDirection.LEFT:
        point[0] += dist3 * -factor;
        break;
      case LinkDirection.RIGHT:
        point[0] += dist3 * factor;
        break;
      case LinkDirection.UP:
        point[1] += dist3 * -factor;
        break;
      case LinkDirection.DOWN:
        point[1] += dist3 * factor;
        break;
    }
  }
  drawExecutionOrder(ctx) {
    ctx.shadowColor = "transparent";
    ctx.globalAlpha = 0.25;
    ctx.textAlign = "center";
    ctx.strokeStyle = "white";
    ctx.globalAlpha = 0.75;
    const visible_nodes = this.visible_nodes;
    for (let i2 = 0; i2 < visible_nodes.length; ++i2) {
      const node22 = visible_nodes[i2];
      ctx.fillStyle = "black";
      ctx.fillRect(
        node22.pos[0] - LiteGraph.NODE_TITLE_HEIGHT,
        node22.pos[1] - LiteGraph.NODE_TITLE_HEIGHT,
        LiteGraph.NODE_TITLE_HEIGHT,
        LiteGraph.NODE_TITLE_HEIGHT
      );
      if (node22.order == 0) {
        ctx.strokeRect(
          node22.pos[0] - LiteGraph.NODE_TITLE_HEIGHT + 0.5,
          node22.pos[1] - LiteGraph.NODE_TITLE_HEIGHT + 0.5,
          LiteGraph.NODE_TITLE_HEIGHT,
          LiteGraph.NODE_TITLE_HEIGHT
        );
      }
      ctx.fillStyle = "#FFF";
      ctx.fillText(
        stringOrEmpty(node22.order),
        node22.pos[0] + LiteGraph.NODE_TITLE_HEIGHT * -0.5,
        node22.pos[1] - 6
      );
    }
    ctx.globalAlpha = 1;
  }
  /**
   * draws the widgets stored inside a node
   */
  drawNodeWidgets(node22, posY, ctx, active_widget) {
    if (!node22.widgets || !node22.widgets.length) return 0;
    const width2 = node22.size[0];
    const widgets = node22.widgets;
    posY += 2;
    const H = LiteGraph.NODE_WIDGET_HEIGHT;
    const show_text = this.ds.scale > 0.5;
    ctx.save();
    ctx.globalAlpha = this.editor_alpha;
    const background_color = LiteGraph.WIDGET_BGCOLOR;
    const text_color = LiteGraph.WIDGET_TEXT_COLOR;
    const secondary_text_color = LiteGraph.WIDGET_SECONDARY_TEXT_COLOR;
    const margin = 15;
    for (let i2 = 0; i2 < widgets.length; ++i2) {
      const w = widgets[i2];
      if (w.hidden || w.advanced && !node22.showAdvanced) continue;
      const y2 = w.y || posY;
      const outline_color = w.advanced ? LiteGraph.WIDGET_ADVANCED_OUTLINE_COLOR : LiteGraph.WIDGET_OUTLINE_COLOR;
      if (w === this.link_over_widget) {
        ctx.fillStyle = this.default_connection_color_byType[this.link_over_widget_type] || this.default_connection_color.input_on;
        drawSlot(ctx, {}, [10, y2 + 10], {});
      }
      w.last_y = y2;
      ctx.strokeStyle = outline_color;
      ctx.fillStyle = "#222";
      ctx.textAlign = "left";
      if (w.disabled) ctx.globalAlpha *= 0.5;
      const widget_width = w.width || width2;
      switch (w.type) {
        case "button":
          ctx.fillStyle = background_color;
          if (w.clicked) {
            ctx.fillStyle = "#AAA";
            w.clicked = false;
            this.dirty_canvas = true;
          }
          ctx.fillRect(margin, y2, widget_width - margin * 2, H);
          if (show_text && !w.disabled)
            ctx.strokeRect(margin, y2, widget_width - margin * 2, H);
          if (show_text) {
            ctx.textAlign = "center";
            ctx.fillStyle = text_color;
            ctx.fillText(w.label || w.name, widget_width * 0.5, y2 + H * 0.7);
          }
          break;
        case "toggle":
          ctx.textAlign = "left";
          ctx.strokeStyle = outline_color;
          ctx.fillStyle = background_color;
          ctx.beginPath();
          if (show_text)
            ctx.roundRect(margin, y2, widget_width - margin * 2, H, [H * 0.5]);
          else ctx.rect(margin, y2, widget_width - margin * 2, H);
          ctx.fill();
          if (show_text && !w.disabled) ctx.stroke();
          ctx.fillStyle = w.value ? "#89A" : "#333";
          ctx.beginPath();
          ctx.arc(
            widget_width - margin * 2,
            y2 + H * 0.5,
            H * 0.36,
            0,
            Math.PI * 2
          );
          ctx.fill();
          if (show_text) {
            ctx.fillStyle = secondary_text_color;
            const label5 = w.label || w.name;
            if (label5 != null) {
              ctx.fillText(label5, margin * 2, y2 + H * 0.7);
            }
            ctx.fillStyle = w.value ? text_color : secondary_text_color;
            ctx.textAlign = "right";
            ctx.fillText(
              w.value ? w.options.on || "true" : w.options.off || "false",
              widget_width - 40,
              y2 + H * 0.7
            );
          }
          break;
        case "slider": {
          ctx.fillStyle = background_color;
          ctx.fillRect(margin, y2, widget_width - margin * 2, H);
          const range2 = w.options.max - w.options.min;
          let nvalue = (w.value - w.options.min) / range2;
          if (nvalue < 0) nvalue = 0;
          if (nvalue > 1) nvalue = 1;
          ctx.fillStyle = w.options.hasOwnProperty("slider_color") ? w.options.slider_color : active_widget == w ? "#89A" : "#678";
          ctx.fillRect(margin, y2, nvalue * (widget_width - margin * 2), H);
          if (show_text && !w.disabled)
            ctx.strokeRect(margin, y2, widget_width - margin * 2, H);
          if (w.marker) {
            let marker_nvalue = (w.marker - w.options.min) / range2;
            if (marker_nvalue < 0) marker_nvalue = 0;
            if (marker_nvalue > 1) marker_nvalue = 1;
            ctx.fillStyle = w.options.hasOwnProperty("marker_color") ? w.options.marker_color : "#AA9";
            ctx.fillRect(
              margin + marker_nvalue * (widget_width - margin * 2),
              y2,
              2,
              H
            );
          }
          if (show_text) {
            ctx.textAlign = "center";
            ctx.fillStyle = text_color;
            ctx.fillText(
              (w.label || w.name) + "  " + Number(w.value).toFixed(
                w.options.precision != null ? w.options.precision : 3
              ),
              widget_width * 0.5,
              y2 + H * 0.7
            );
          }
          break;
        }
        case "number":
        case "combo":
          ctx.textAlign = "left";
          ctx.strokeStyle = outline_color;
          ctx.fillStyle = background_color;
          ctx.beginPath();
          if (show_text)
            ctx.roundRect(margin, y2, widget_width - margin * 2, H, [H * 0.5]);
          else ctx.rect(margin, y2, widget_width - margin * 2, H);
          ctx.fill();
          if (show_text) {
            if (!w.disabled) ctx.stroke();
            ctx.fillStyle = text_color;
            if (!w.disabled) {
              ctx.beginPath();
              ctx.moveTo(margin + 16, y2 + 5);
              ctx.lineTo(margin + 6, y2 + H * 0.5);
              ctx.lineTo(margin + 16, y2 + H - 5);
              ctx.fill();
              ctx.beginPath();
              ctx.moveTo(widget_width - margin - 16, y2 + 5);
              ctx.lineTo(widget_width - margin - 6, y2 + H * 0.5);
              ctx.lineTo(widget_width - margin - 16, y2 + H - 5);
              ctx.fill();
            }
            ctx.fillStyle = secondary_text_color;
            ctx.fillText(w.label || w.name, margin * 2 + 5, y2 + H * 0.7);
            ctx.fillStyle = text_color;
            ctx.textAlign = "right";
            if (w.type == "number") {
              ctx.fillText(
                Number(w.value).toFixed(
                  w.options.precision !== void 0 ? w.options.precision : 3
                ),
                widget_width - margin * 2 - 20,
                y2 + H * 0.7
              );
            } else {
              let v2 = typeof w.value === "number" ? String(w.value) : w.value;
              if (w.options.values) {
                let values = w.options.values;
                if (typeof values === "function")
                  values = values();
                if (values && !Array.isArray(values))
                  v2 = values[w.value];
              }
              const labelWidth = ctx.measureText(w.label || w.name).width + margin * 2;
              const inputWidth = widget_width - margin * 4;
              const availableWidth = inputWidth - labelWidth;
              const textWidth = ctx.measureText(v2).width;
              if (textWidth > availableWidth) {
                const ELLIPSIS = "…";
                const ellipsisWidth = ctx.measureText(ELLIPSIS).width;
                const charWidthAvg = ctx.measureText("a").width;
                if (availableWidth <= ellipsisWidth) {
                  v2 = "․";
                } else {
                  v2 = `${v2}`;
                  const overflowWidth = textWidth + ellipsisWidth - availableWidth;
                  if (overflowWidth + charWidthAvg * 3 > availableWidth) {
                    const preciseRange = availableWidth + charWidthAvg * 3;
                    const preTruncateCt = Math.floor((preciseRange - ellipsisWidth) / charWidthAvg);
                    v2 = v2.substr(0, preTruncateCt);
                  }
                  while (ctx.measureText(v2).width + ellipsisWidth > availableWidth) {
                    v2 = v2.substr(0, v2.length - 1);
                  }
                  v2 += ELLIPSIS;
                }
              }
              ctx.fillText(
                v2,
                widget_width - margin * 2 - 20,
                y2 + H * 0.7
              );
            }
          }
          break;
        case "string":
        case "text":
          ctx.textAlign = "left";
          ctx.strokeStyle = outline_color;
          ctx.fillStyle = background_color;
          ctx.beginPath();
          if (show_text)
            ctx.roundRect(margin, y2, widget_width - margin * 2, H, [H * 0.5]);
          else
            ctx.rect(margin, y2, widget_width - margin * 2, H);
          ctx.fill();
          if (show_text) {
            if (!w.disabled) ctx.stroke();
            ctx.save();
            ctx.beginPath();
            ctx.rect(margin, y2, widget_width - margin * 2, H);
            ctx.clip();
            ctx.fillStyle = secondary_text_color;
            const label5 = w.label || w.name;
            if (label5 != null) ctx.fillText(label5, margin * 2, y2 + H * 0.7);
            ctx.fillStyle = text_color;
            ctx.textAlign = "right";
            ctx.fillText(
              String(w.value).substr(0, 30),
              widget_width - margin * 2,
              y2 + H * 0.7
            );
            ctx.restore();
          }
          break;
        default:
          w.draw?.(ctx, node22, widget_width, y2, H);
          break;
      }
      posY += (w.computeSize ? w.computeSize(widget_width)[1] : H) + 4;
      ctx.globalAlpha = this.editor_alpha;
    }
    ctx.restore();
    ctx.textAlign = "left";
  }
  /**
   * draws every group area in the background
   */
  drawGroups(canvas, ctx) {
    if (!this.graph) return;
    const groups = this.graph._groups;
    ctx.save();
    ctx.globalAlpha = 0.5 * this.editor_alpha;
    const drawSnapGuides = this.#snapToGrid && this.isDragging;
    for (let i2 = 0; i2 < groups.length; ++i2) {
      const group = groups[i2];
      if (!overlapBounding(this.visible_area, group._bounding)) {
        continue;
      }
      if (drawSnapGuides && this.selectedItems.has(group))
        this.drawSnapGuide(ctx, group);
      group.draw(this, ctx);
    }
    ctx.restore();
  }
  adjustNodesSize() {
    const nodes = this.graph._nodes;
    for (let i2 = 0; i2 < nodes.length; ++i2) {
      nodes[i2].size = nodes[i2].computeSize();
    }
    this.setDirty(true, true);
  }
  /**
   * resizes the canvas to a given size, if no size is passed, then it tries to fill the parentNode
   * @todo Remove or rewrite
   */
  resize(width2, height) {
    if (!width2 && !height) {
      const parent = this.canvas.parentElement;
      width2 = parent.offsetWidth;
      height = parent.offsetHeight;
    }
    if (this.canvas.width == width2 && this.canvas.height == height) return;
    this.canvas.width = width2;
    this.canvas.height = height;
    this.bgcanvas.width = this.canvas.width;
    this.bgcanvas.height = this.canvas.height;
    this.setDirty(true, true);
  }
  onNodeSelectionChange() {
  }
  /**
   * Determines the furthest nodes in each direction for the currently selected nodes
   */
  boundaryNodesForSelection() {
    return LGraphCanvas.getBoundaryNodes(this.selected_nodes);
  }
  showLinkMenu(segment, e2) {
    const { graph } = this;
    const node_left = graph.getNodeById(segment.origin_id);
    const fromType = node_left?.outputs?.[segment.origin_slot]?.type ?? "*";
    const options4 = ["Add Node", null, "Delete", null];
    if (this.reroutesEnabled) options4.splice(1, 0, "Add Reroute");
    const title = "data" in segment && segment.data != null ? segment.data.constructor.name : null;
    const menu2 = new LiteGraph.ContextMenu(options4, {
      event: e2,
      title,
      callback: inner_clicked.bind(this)
    });
    function inner_clicked(v2, options22, e3) {
      switch (v2) {
        case "Add Node":
          LGraphCanvas.onMenuAdd(null, null, e3, menu2, function(node22) {
            if (!node22.inputs?.length || !node22.outputs?.length) return;
            const options32 = this.reroutesEnabled ? { afterRerouteId: segment.parentId } : void 0;
            if (node_left.connectByType(segment.origin_slot, node22, fromType, options32)) {
              node22.pos[0] -= node22.size[0] * 0.5;
            }
          });
          break;
        case "Add Reroute": {
          this.adjustMouseEvent(e3);
          graph.createReroute([e3.canvasX, e3.canvasY], segment);
          this.setDirty(false, true);
          break;
        }
        case "Delete":
          graph.removeLink(segment.id);
          break;
      }
    }
    __name(inner_clicked, "inner_clicked");
    return false;
  }
  createDefaultNodeForSlot(optPass) {
    const opts = Object.assign({
      nodeFrom: null,
      slotFrom: null,
      nodeTo: null,
      slotTo: null,
      position: [0, 0],
      nodeType: null,
      posAdd: [0, 0],
      posSizeFix: [0, 0]
    }, optPass || {});
    const { afterRerouteId } = opts;
    const isFrom = opts.nodeFrom && opts.slotFrom !== null;
    const isTo = !isFrom && opts.nodeTo && opts.slotTo !== null;
    if (!isFrom && !isTo) {
      console.warn("No data passed to createDefaultNodeForSlot " + opts.nodeFrom + " " + opts.slotFrom + " " + opts.nodeTo + " " + opts.slotTo);
      return false;
    }
    if (!opts.nodeType) {
      console.warn("No type to createDefaultNodeForSlot");
      return false;
    }
    const nodeX = isFrom ? opts.nodeFrom : opts.nodeTo;
    let slotX = isFrom ? opts.slotFrom : opts.slotTo;
    let iSlotConn = false;
    switch (typeof slotX) {
      case "string":
        iSlotConn = isFrom ? nodeX.findOutputSlot(slotX, false) : nodeX.findInputSlot(slotX, false);
        slotX = isFrom ? nodeX.outputs[slotX] : nodeX.inputs[slotX];
        break;
      case "object":
        iSlotConn = isFrom ? nodeX.findOutputSlot(slotX.name) : nodeX.findInputSlot(slotX.name);
        break;
      case "number":
        iSlotConn = slotX;
        slotX = isFrom ? nodeX.outputs[slotX] : nodeX.inputs[slotX];
        break;
      case "undefined":
      default:
        console.warn("Cant get slot information " + slotX);
        return false;
    }
    const fromSlotType = slotX.type == LiteGraph.EVENT ? "_event_" : slotX.type;
    const slotTypesDefault = isFrom ? LiteGraph.slot_types_default_out : LiteGraph.slot_types_default_in;
    if (slotTypesDefault?.[fromSlotType]) {
      let nodeNewType = false;
      if (typeof slotTypesDefault[fromSlotType] == "object") {
        for (const typeX in slotTypesDefault[fromSlotType]) {
          if (opts.nodeType == slotTypesDefault[fromSlotType][typeX] || opts.nodeType == "AUTO") {
            nodeNewType = slotTypesDefault[fromSlotType][typeX];
            break;
          }
        }
      } else if (opts.nodeType == slotTypesDefault[fromSlotType] || opts.nodeType == "AUTO") {
        nodeNewType = slotTypesDefault[fromSlotType];
      }
      if (nodeNewType) {
        let nodeNewOpts = false;
        if (typeof nodeNewType == "object" && nodeNewType.node) {
          nodeNewOpts = nodeNewType;
          nodeNewType = nodeNewType.node;
        }
        const newNode = LiteGraph.createNode(nodeNewType);
        if (newNode) {
          if (nodeNewOpts) {
            if (nodeNewOpts.properties) {
              for (const i2 in nodeNewOpts.properties) {
                newNode.addProperty(i2, nodeNewOpts.properties[i2]);
              }
            }
            if (nodeNewOpts.inputs) {
              newNode.inputs = [];
              for (const i2 in nodeNewOpts.inputs) {
                newNode.addOutput(
                  nodeNewOpts.inputs[i2][0],
                  nodeNewOpts.inputs[i2][1]
                );
              }
            }
            if (nodeNewOpts.outputs) {
              newNode.outputs = [];
              for (const i2 in nodeNewOpts.outputs) {
                newNode.addOutput(
                  nodeNewOpts.outputs[i2][0],
                  nodeNewOpts.outputs[i2][1]
                );
              }
            }
            if (nodeNewOpts.title) {
              newNode.title = nodeNewOpts.title;
            }
            if (nodeNewOpts.json) {
              newNode.configure(nodeNewOpts.json);
            }
          }
          this.graph.add(newNode);
          newNode.pos = [
            opts.position[0] + opts.posAdd[0] + (opts.posSizeFix[0] ? opts.posSizeFix[0] * newNode.size[0] : 0),
            opts.position[1] + opts.posAdd[1] + (opts.posSizeFix[1] ? opts.posSizeFix[1] * newNode.size[1] : 0)
          ];
          if (isFrom) {
            opts.nodeFrom.connectByType(iSlotConn, newNode, fromSlotType, { afterRerouteId });
          } else {
            opts.nodeTo.connectByTypeOutput(iSlotConn, newNode, fromSlotType, { afterRerouteId });
          }
          return true;
        }
        console.log("failed creating " + nodeNewType);
      }
    }
    return false;
  }
  showConnectionMenu(optPass) {
    const opts = Object.assign({
      nodeFrom: null,
      slotFrom: null,
      nodeTo: null,
      slotTo: null,
      e: null,
      allow_searchbox: this.allow_searchbox,
      showSearchBox: this.showSearchBox
    }, optPass || {});
    const that = this;
    const { afterRerouteId } = opts;
    const isFrom = opts.nodeFrom && opts.slotFrom;
    const isTo = !isFrom && opts.nodeTo && opts.slotTo;
    if (!isFrom && !isTo) {
      console.warn("No data passed to showConnectionMenu");
      return;
    }
    const nodeX = isFrom ? opts.nodeFrom : opts.nodeTo;
    let slotX = isFrom ? opts.slotFrom : opts.slotTo;
    let iSlotConn;
    switch (typeof slotX) {
      case "string":
        iSlotConn = isFrom ? nodeX.findOutputSlot(slotX, false) : nodeX.findInputSlot(slotX, false);
        slotX = isFrom ? nodeX.outputs[slotX] : nodeX.inputs[slotX];
        break;
      case "object":
        iSlotConn = isFrom ? nodeX.findOutputSlot(slotX.name) : nodeX.findInputSlot(slotX.name);
        break;
      case "number":
        iSlotConn = slotX;
        slotX = isFrom ? nodeX.outputs[slotX] : nodeX.inputs[slotX];
        break;
      default:
        console.warn("Cant get slot information " + slotX);
        return;
    }
    const options4 = ["Add Node", null];
    if (opts.allow_searchbox) {
      options4.push("Search");
      options4.push(null);
    }
    const fromSlotType = slotX.type == LiteGraph.EVENT ? "_event_" : slotX.type;
    const slotTypesDefault = isFrom ? LiteGraph.slot_types_default_out : LiteGraph.slot_types_default_in;
    if (slotTypesDefault?.[fromSlotType]) {
      if (typeof slotTypesDefault[fromSlotType] == "object") {
        for (const typeX in slotTypesDefault[fromSlotType]) {
          options4.push(slotTypesDefault[fromSlotType][typeX]);
        }
      } else {
        options4.push(slotTypesDefault[fromSlotType]);
      }
    }
    const menu2 = new LiteGraph.ContextMenu(options4, {
      event: opts.e,
      title: (slotX && slotX.name != "" ? slotX.name + (fromSlotType ? " | " : "") : "") + (slotX && fromSlotType ? fromSlotType : ""),
      callback: inner_clicked
    });
    function inner_clicked(v2, options22, e2) {
      switch (v2) {
        case "Add Node":
          LGraphCanvas.onMenuAdd(null, null, e2, menu2, function(node22) {
            if (isFrom) {
              opts.nodeFrom.connectByType(iSlotConn, node22, fromSlotType, { afterRerouteId });
            } else {
              opts.nodeTo.connectByTypeOutput(iSlotConn, node22, fromSlotType, { afterRerouteId });
            }
          });
          break;
        case "Search":
          if (isFrom) {
            opts.showSearchBox(e2, { node_from: opts.nodeFrom, slot_from: slotX, type_filter_in: fromSlotType });
          } else {
            opts.showSearchBox(e2, { node_to: opts.nodeTo, slot_from: slotX, type_filter_out: fromSlotType });
          }
          break;
        default: {
          that.createDefaultNodeForSlot(Object.assign(opts, {
            position: [opts.e.canvasX, opts.e.canvasY],
            nodeType: v2,
            afterRerouteId
          }));
          break;
        }
      }
    }
    __name(inner_clicked, "inner_clicked");
  }
  // refactor: there are different dialogs, some uses createDialog some dont
  prompt(title, value4, callback, event, multiline) {
    const that = this;
    title = title || "";
    const dialog = document.createElement("div");
    dialog.is_modified = false;
    dialog.className = "graphdialog rounded";
    dialog.innerHTML = multiline ? "<span class='name'></span> <textarea autofocus class='value'></textarea><button class='rounded'>OK</button>" : "<span class='name'></span> <input autofocus type='text' class='value'/><button class='rounded'>OK</button>";
    dialog.close = function() {
      that.prompt_box = null;
      if (dialog.parentNode) {
        dialog.parentNode.removeChild(dialog);
      }
    };
    const graphcanvas = LGraphCanvas.active_canvas;
    const canvas = graphcanvas.canvas;
    canvas.parentNode.appendChild(dialog);
    if (this.ds.scale > 1) dialog.style.transform = "scale(" + this.ds.scale + ")";
    let dialogCloseTimer = null;
    let prevent_timeout = 0;
    LiteGraph.pointerListenerAdd(dialog, "leave", function() {
      if (prevent_timeout) return;
      if (LiteGraph.dialog_close_on_mouse_leave) {
        if (!dialog.is_modified && LiteGraph.dialog_close_on_mouse_leave)
          dialogCloseTimer = setTimeout(
            dialog.close,
            LiteGraph.dialog_close_on_mouse_leave_delay
          );
      }
    });
    LiteGraph.pointerListenerAdd(dialog, "enter", function() {
      if (LiteGraph.dialog_close_on_mouse_leave && dialogCloseTimer)
        clearTimeout(dialogCloseTimer);
    });
    const selInDia = dialog.querySelectorAll("select");
    if (selInDia) {
      for (const selIn of selInDia) {
        selIn.addEventListener("click", function() {
          prevent_timeout++;
        });
        selIn.addEventListener("blur", function() {
          prevent_timeout = 0;
        });
        selIn.addEventListener("change", function() {
          prevent_timeout = -1;
        });
      }
    }
    this.prompt_box?.close();
    this.prompt_box = dialog;
    const name_element = dialog.querySelector(".name");
    name_element.innerText = title;
    const value_element = dialog.querySelector(".value");
    value_element.value = value4;
    value_element.select();
    const input = value_element;
    input.addEventListener("keydown", function(e2) {
      dialog.is_modified = true;
      if (e2.keyCode == 27) {
        dialog.close();
      } else if (e2.keyCode == 13 && e2.target.localName != "textarea") {
        if (callback) {
          callback(this.value);
        }
        dialog.close();
      } else {
        return;
      }
      e2.preventDefault();
      e2.stopPropagation();
    });
    const button = dialog.querySelector("button");
    button.addEventListener("click", function() {
      callback?.(input.value);
      that.setDirty(true);
      dialog.close();
    });
    const rect = canvas.getBoundingClientRect();
    let offsetx = -20;
    let offsety = -20;
    if (rect) {
      offsetx -= rect.left;
      offsety -= rect.top;
    }
    if (event) {
      dialog.style.left = event.clientX + offsetx + "px";
      dialog.style.top = event.clientY + offsety + "px";
    } else {
      dialog.style.left = canvas.width * 0.5 + offsetx + "px";
      dialog.style.top = canvas.height * 0.5 + offsety + "px";
    }
    setTimeout(function() {
      input.focus();
      const clickTime = Date.now();
      function handleOutsideClick(e2) {
        if (e2.target === canvas && Date.now() - clickTime > 256) {
          dialog.close();
          canvas.parentNode.removeEventListener("click", handleOutsideClick);
          canvas.parentNode.removeEventListener("touchend", handleOutsideClick);
        }
      }
      __name(handleOutsideClick, "handleOutsideClick");
      canvas.parentNode.addEventListener("click", handleOutsideClick);
      canvas.parentNode.addEventListener("touchend", handleOutsideClick);
    }, 10);
    return dialog;
  }
  showSearchBox(event, options4) {
    const def_options = {
      slot_from: null,
      node_from: null,
      node_to: null,
      do_type_filter: LiteGraph.search_filter_enabled,
      // TODO check for registered_slot_[in/out]_types not empty // this will be checked for functionality enabled : filter on slot type, in and out
      // @ts-expect-error
      type_filter_in: false,
      // these are default: pass to set initially set values
      type_filter_out: false,
      show_general_if_none_on_typefilter: true,
      show_general_after_typefiltered: true,
      hide_on_mouse_leave: LiteGraph.search_hide_on_mouse_leave,
      show_all_if_empty: true,
      show_all_on_open: LiteGraph.search_show_all_on_open
    };
    options4 = Object.assign(def_options, options4 || {});
    const that = this;
    const graphcanvas = LGraphCanvas.active_canvas;
    const canvas = graphcanvas.canvas;
    const root_document = canvas.ownerDocument || document;
    const dialog = document.createElement("div");
    dialog.className = "litegraph litesearchbox graphdialog rounded";
    dialog.innerHTML = "<span class='name'>Search</span> <input autofocus type='text' class='value rounded'/>";
    if (options4.do_type_filter) {
      dialog.innerHTML += "<select class='slot_in_type_filter'><option value=''></option></select>";
      dialog.innerHTML += "<select class='slot_out_type_filter'><option value=''></option></select>";
    }
    dialog.innerHTML += "<div class='helper'></div>";
    if (root_document.fullscreenElement)
      root_document.fullscreenElement.appendChild(dialog);
    else {
      root_document.body.appendChild(dialog);
      root_document.body.style.overflow = "hidden";
    }
    let selIn;
    let selOut;
    if (options4.do_type_filter) {
      selIn = dialog.querySelector(".slot_in_type_filter");
      selOut = dialog.querySelector(".slot_out_type_filter");
    }
    dialog.close = function() {
      that.search_box = null;
      this.blur();
      canvas.focus();
      root_document.body.style.overflow = "";
      setTimeout(function() {
        that.canvas.focus();
      }, 20);
      dialog.parentNode?.removeChild(dialog);
    };
    if (this.ds.scale > 1) {
      dialog.style.transform = "scale(" + this.ds.scale + ")";
    }
    if (options4.hide_on_mouse_leave) {
      let prevent_timeout = false;
      let timeout_close = null;
      LiteGraph.pointerListenerAdd(dialog, "enter", function() {
        if (timeout_close) {
          clearTimeout(timeout_close);
          timeout_close = null;
        }
      });
      LiteGraph.pointerListenerAdd(dialog, "leave", function() {
        if (prevent_timeout)
          return;
        timeout_close = setTimeout(function() {
          dialog.close();
        }, typeof options4.hide_on_mouse_leave === "number" ? options4.hide_on_mouse_leave : 500);
      });
      if (options4.do_type_filter) {
        selIn.addEventListener("click", function() {
          prevent_timeout++;
        });
        selIn.addEventListener("blur", function() {
          prevent_timeout = 0;
        });
        selIn.addEventListener("change", function() {
          prevent_timeout = -1;
        });
        selOut.addEventListener("click", function() {
          prevent_timeout++;
        });
        selOut.addEventListener("blur", function() {
          prevent_timeout = 0;
        });
        selOut.addEventListener("change", function() {
          prevent_timeout = -1;
        });
      }
    }
    that.search_box?.close();
    that.search_box = dialog;
    const helper = dialog.querySelector(".helper");
    let first2 = null;
    let timeout = null;
    let selected2 = null;
    const input = dialog.querySelector("input");
    if (input) {
      input.addEventListener("blur", function() {
        this.focus();
      });
      input.addEventListener("keydown", function(e2) {
        if (e2.keyCode == 38) {
          changeSelection(false);
        } else if (e2.keyCode == 40) {
          changeSelection(true);
        } else if (e2.keyCode == 27) {
          dialog.close();
        } else if (e2.keyCode == 13) {
          if (selected2) {
            select(unescape(selected2.dataset["type"]));
          } else if (first2) {
            select(first2);
          } else {
            dialog.close();
          }
        } else {
          if (timeout) {
            clearInterval(timeout);
          }
          timeout = setTimeout(refreshHelper, 10);
          return;
        }
        e2.preventDefault();
        e2.stopPropagation();
        e2.stopImmediatePropagation();
        return true;
      });
    }
    if (options4.do_type_filter) {
      if (selIn) {
        const aSlots = LiteGraph.slot_types_in;
        const nSlots = aSlots.length;
        if (options4.type_filter_in == LiteGraph.EVENT || options4.type_filter_in == LiteGraph.ACTION)
          options4.type_filter_in = "_event_";
        for (let iK = 0; iK < nSlots; iK++) {
          const opt = document.createElement("option");
          opt.value = aSlots[iK];
          opt.innerHTML = aSlots[iK];
          selIn.appendChild(opt);
          if (
            // @ts-expect-error
            options4.type_filter_in !== false && (options4.type_filter_in + "").toLowerCase() == (aSlots[iK] + "").toLowerCase()
          ) {
            opt.selected = true;
          }
        }
        selIn.addEventListener("change", function() {
          refreshHelper();
        });
      }
      if (selOut) {
        const aSlots = LiteGraph.slot_types_out;
        const nSlots = aSlots.length;
        if (options4.type_filter_out == LiteGraph.EVENT || options4.type_filter_out == LiteGraph.ACTION)
          options4.type_filter_out = "_event_";
        for (let iK = 0; iK < nSlots; iK++) {
          const opt = document.createElement("option");
          opt.value = aSlots[iK];
          opt.innerHTML = aSlots[iK];
          selOut.appendChild(opt);
          if (options4.type_filter_out !== false && (options4.type_filter_out + "").toLowerCase() == (aSlots[iK] + "").toLowerCase())
            opt.selected = true;
        }
        selOut.addEventListener("change", function() {
          refreshHelper();
        });
      }
    }
    const rect = canvas.getBoundingClientRect();
    const left = (event ? event.clientX : rect.left + rect.width * 0.5) - 80;
    const top = (event ? event.clientY : rect.top + rect.height * 0.5) - 20;
    dialog.style.left = left + "px";
    dialog.style.top = top + "px";
    if (event.layerY > rect.height - 200)
      helper.style.maxHeight = rect.height - event.layerY - 20 + "px";
    requestAnimationFrame(function() {
      input.focus();
    });
    if (options4.show_all_on_open) refreshHelper();
    function select(name2) {
      if (name2) {
        if (that.onSearchBoxSelection) {
          that.onSearchBoxSelection(name2, event, graphcanvas);
        } else {
          const extra = LiteGraph.searchbox_extras[name2.toLowerCase()];
          if (extra) name2 = extra.type;
          graphcanvas.graph.beforeChange();
          const node22 = LiteGraph.createNode(name2);
          if (node22) {
            node22.pos = graphcanvas.convertEventToCanvasOffset(event);
            graphcanvas.graph.add(node22, false);
          }
          if (extra?.data) {
            if (extra.data.properties) {
              for (const i2 in extra.data.properties) {
                node22.addProperty(i2, extra.data.properties[i2]);
              }
            }
            if (extra.data.inputs) {
              node22.inputs = [];
              for (const i2 in extra.data.inputs) {
                node22.addOutput(
                  extra.data.inputs[i2][0],
                  extra.data.inputs[i2][1]
                );
              }
            }
            if (extra.data.outputs) {
              node22.outputs = [];
              for (const i2 in extra.data.outputs) {
                node22.addOutput(
                  extra.data.outputs[i2][0],
                  extra.data.outputs[i2][1]
                );
              }
            }
            if (extra.data.title) {
              node22.title = extra.data.title;
            }
            if (extra.data.json) {
              node22.configure(extra.data.json);
            }
          }
          if (options4.node_from) {
            let iS = false;
            switch (typeof options4.slot_from) {
              case "string":
                iS = options4.node_from.findOutputSlot(options4.slot_from);
                break;
              case "object":
                iS = options4.slot_from.name ? options4.node_from.findOutputSlot(options4.slot_from.name) : -1;
                if (iS == -1 && typeof options4.slot_from.slot_index !== "undefined") iS = options4.slot_from.slot_index;
                break;
              case "number":
                iS = options4.slot_from;
                break;
              default:
                iS = 0;
            }
            if (typeof options4.node_from.outputs[iS] !== "undefined") {
              if (iS !== false && iS > -1) {
                options4.node_from.connectByType(iS, node22, options4.node_from.outputs[iS].type);
              }
            }
          }
          if (options4.node_to) {
            let iS = false;
            switch (typeof options4.slot_from) {
              case "string":
                iS = options4.node_to.findInputSlot(options4.slot_from);
                break;
              case "object":
                iS = options4.slot_from.name ? options4.node_to.findInputSlot(options4.slot_from.name) : -1;
                if (iS == -1 && typeof options4.slot_from.slot_index !== "undefined") iS = options4.slot_from.slot_index;
                break;
              case "number":
                iS = options4.slot_from;
                break;
              default:
                iS = 0;
            }
            if (typeof options4.node_to.inputs[iS] !== "undefined") {
              if (iS !== false && iS > -1) {
                options4.node_to.connectByTypeOutput(iS, node22, options4.node_to.inputs[iS].type);
              }
            }
          }
          graphcanvas.graph.afterChange();
        }
      }
      dialog.close();
    }
    __name(select, "select");
    function changeSelection(forward) {
      const prev2 = selected2;
      if (!selected2) {
        selected2 = forward ? helper.childNodes[0] : helper.childNodes[helper.childNodes.length];
      } else {
        selected2.classList.remove("selected");
        selected2 = forward ? selected2.nextSibling : selected2.previousSibling;
        selected2 ||= prev2;
      }
      if (!selected2) return;
      selected2.classList.add("selected");
      selected2.scrollIntoView({ block: "end", behavior: "smooth" });
    }
    __name(changeSelection, "changeSelection");
    function refreshHelper() {
      timeout = null;
      let str = input.value;
      first2 = null;
      helper.innerHTML = "";
      if (!str && !options4.show_all_if_empty) return;
      if (that.onSearchBox) {
        const list2 = that.onSearchBox(helper, str, graphcanvas);
        if (list2) {
          for (let i2 = 0; i2 < list2.length; ++i2) {
            addResult(list2[i2]);
          }
        }
      } else {
        let inner_test_filter = /* @__PURE__ */ __name(function(type, optsIn) {
          optsIn = optsIn || {};
          const optsDef = {
            skipFilter: false,
            inTypeOverride: false,
            outTypeOverride: false
          };
          const opts = Object.assign(optsDef, optsIn);
          const ctor = LiteGraph.registered_node_types[type];
          if (filter4 && ctor.filter != filter4) return false;
          if ((!options4.show_all_if_empty || str) && type.toLowerCase().indexOf(str) === -1 && (!ctor.title || ctor.title.toLowerCase().indexOf(str) === -1))
            return false;
          if (options4.do_type_filter && !opts.skipFilter) {
            const sType = type;
            let sV = opts.inTypeOverride !== false ? opts.inTypeOverride : sIn.value;
            if (sIn && sV && LiteGraph.registered_slot_in_types[sV]?.nodes) {
              const doesInc = LiteGraph.registered_slot_in_types[sV].nodes.includes(sType);
              if (doesInc === false) return false;
            }
            sV = sOut.value;
            if (opts.outTypeOverride !== false) sV = opts.outTypeOverride;
            if (sOut && sV && LiteGraph.registered_slot_out_types[sV]?.nodes) {
              const doesInc = LiteGraph.registered_slot_out_types[sV].nodes.includes(sType);
              if (doesInc === false) return false;
            }
          }
          return true;
        }, "inner_test_filter");
        let c = 0;
        str = str.toLowerCase();
        const filter4 = graphcanvas.filter || graphcanvas.graph.filter;
        let sIn = false;
        let sOut = false;
        if (options4.do_type_filter && that.search_box) {
          sIn = that.search_box.querySelector(".slot_in_type_filter");
          sOut = that.search_box.querySelector(".slot_out_type_filter");
        }
        for (const i2 in LiteGraph.searchbox_extras) {
          const extra = LiteGraph.searchbox_extras[i2];
          if ((!options4.show_all_if_empty || str) && extra.desc.toLowerCase().indexOf(str) === -1)
            continue;
          const ctor = LiteGraph.registered_node_types[extra.type];
          if (ctor && ctor.filter != filter4) continue;
          if (!inner_test_filter(extra.type)) continue;
          addResult(extra.desc, "searchbox_extra");
          if (LGraphCanvas.search_limit !== -1 && c++ > LGraphCanvas.search_limit) {
            break;
          }
        }
        let filtered = null;
        if (Array.prototype.filter) {
          const keys2 = Object.keys(LiteGraph.registered_node_types);
          filtered = keys2.filter(inner_test_filter);
        } else {
          filtered = [];
          for (const i2 in LiteGraph.registered_node_types) {
            if (inner_test_filter(i2)) filtered.push(i2);
          }
        }
        for (let i2 = 0; i2 < filtered.length; i2++) {
          addResult(filtered[i2]);
          if (LGraphCanvas.search_limit !== -1 && c++ > LGraphCanvas.search_limit)
            break;
        }
        if (options4.show_general_after_typefiltered && (sIn.value || sOut.value)) {
          filtered_extra = [];
          for (const i2 in LiteGraph.registered_node_types) {
            if (inner_test_filter(i2, {
              inTypeOverride: sIn && sIn.value ? "*" : false,
              outTypeOverride: sOut && sOut.value ? "*" : false
            }))
              filtered_extra.push(i2);
          }
          for (let i2 = 0; i2 < filtered_extra.length; i2++) {
            addResult(filtered_extra[i2], "generic_type");
            if (LGraphCanvas.search_limit !== -1 && c++ > LGraphCanvas.search_limit)
              break;
          }
        }
        if ((sIn.value || sOut.value) && helper.childNodes.length == 0 && options4.show_general_if_none_on_typefilter) {
          filtered_extra = [];
          for (const i2 in LiteGraph.registered_node_types) {
            if (inner_test_filter(i2, { skipFilter: true }))
              filtered_extra.push(i2);
          }
          for (let i2 = 0; i2 < filtered_extra.length; i2++) {
            addResult(filtered_extra[i2], "not_in_filter");
            if (LGraphCanvas.search_limit !== -1 && c++ > LGraphCanvas.search_limit)
              break;
          }
        }
      }
      function addResult(type, className) {
        const help = document.createElement("div");
        first2 ||= type;
        const nodeType = LiteGraph.registered_node_types[type];
        if (nodeType?.title) {
          help.innerText = nodeType?.title;
          const typeEl = document.createElement("span");
          typeEl.className = "litegraph lite-search-item-type";
          typeEl.textContent = type;
          help.append(typeEl);
        } else {
          help.innerText = type;
        }
        help.dataset["type"] = escape(type);
        help.className = "litegraph lite-search-item";
        if (className) {
          help.className += " " + className;
        }
        help.addEventListener("click", function() {
          select(unescape(this.dataset["type"]));
        });
        helper.appendChild(help);
      }
      __name(addResult, "addResult");
    }
    __name(refreshHelper, "refreshHelper");
    return dialog;
  }
  showEditPropertyValue(node22, property, options4) {
    if (!node22 || node22.properties[property] === void 0) return;
    options4 = options4 || {};
    const info = node22.getPropertyInfo(property);
    const type = info.type;
    let input_html = "";
    if (type == "string" || type == "number" || type == "array" || type == "object") {
      input_html = "<input autofocus type='text' class='value'/>";
    } else if ((type == "enum" || type == "combo") && info.values) {
      input_html = "<select autofocus type='text' class='value'>";
      for (const i2 in info.values) {
        const v2 = Array.isArray(info.values) ? info.values[i2] : i2;
        input_html += "<option value='" + v2 + "' " + (v2 == node22.properties[property] ? "selected" : "") + ">" + info.values[i2] + "</option>";
      }
      input_html += "</select>";
    } else if (type == "boolean" || type == "toggle") {
      input_html = "<input autofocus type='checkbox' class='value' " + (node22.properties[property] ? "checked" : "") + "/>";
    } else {
      console.warn("unknown type: " + type);
      return;
    }
    const dialog = this.createDialog(
      "<span class='name'>" + (info.label || property) + "</span>" + input_html + "<button>OK</button>",
      options4
    );
    let input;
    if ((type == "enum" || type == "combo") && info.values) {
      input = dialog.querySelector("select");
      input.addEventListener("change", function(e2) {
        dialog.modified();
        setValue2(e2.target?.value);
      });
    } else if (type == "boolean" || type == "toggle") {
      input = dialog.querySelector("input");
      input?.addEventListener("click", function() {
        dialog.modified();
        setValue2(!!input.checked);
      });
    } else {
      input = dialog.querySelector("input");
      if (input) {
        input.addEventListener("blur", function() {
          this.focus();
        });
        let v2 = node22.properties[property] !== void 0 ? node22.properties[property] : "";
        if (type !== "string") {
          v2 = JSON.stringify(v2);
        }
        input.value = v2;
        input.addEventListener("keydown", function(e2) {
          if (e2.keyCode == 27) {
            dialog.close();
          } else if (e2.keyCode == 13) {
            inner();
          } else if (e2.keyCode != 13) {
            dialog.modified();
            return;
          }
          e2.preventDefault();
          e2.stopPropagation();
        });
      }
    }
    input?.focus();
    const button = dialog.querySelector("button");
    button.addEventListener("click", inner);
    function inner() {
      setValue2(input.value);
    }
    __name(inner, "inner");
    function setValue2(value4) {
      if (info?.values && typeof info.values === "object" && info.values[value4] != void 0)
        value4 = info.values[value4];
      if (typeof node22.properties[property] == "number") {
        value4 = Number(value4);
      }
      if (type == "array" || type == "object") {
        value4 = JSON.parse(value4);
      }
      node22.properties[property] = value4;
      if (node22.graph) {
        node22.graph._version++;
      }
      node22.onPropertyChanged?.(property, value4);
      options4.onclose?.();
      dialog.close();
      this.setDirty(true, true);
    }
    __name(setValue2, "setValue");
    return dialog;
  }
  // TODO refactor, theer are different dialog, some uses createDialog, some dont
  createDialog(html, options4) {
    const def_options = {
      checkForInput: false,
      closeOnLeave: true,
      closeOnLeave_checkModified: true
    };
    options4 = Object.assign(def_options, options4 || {});
    const dialog = document.createElement("div");
    dialog.className = "graphdialog";
    dialog.innerHTML = html;
    dialog.is_modified = false;
    const rect = this.canvas.getBoundingClientRect();
    let offsetx = -20;
    let offsety = -20;
    if (rect) {
      offsetx -= rect.left;
      offsety -= rect.top;
    }
    if (options4.position) {
      offsetx += options4.position[0];
      offsety += options4.position[1];
    } else if (options4.event) {
      offsetx += options4.event.clientX;
      offsety += options4.event.clientY;
    } else {
      offsetx += this.canvas.width * 0.5;
      offsety += this.canvas.height * 0.5;
    }
    dialog.style.left = offsetx + "px";
    dialog.style.top = offsety + "px";
    this.canvas.parentNode.appendChild(dialog);
    if (options4.checkForInput) {
      const aI = dialog.querySelectorAll("input");
      aI?.forEach(function(iX) {
        iX.addEventListener("keydown", function(e2) {
          dialog.modified();
          if (e2.keyCode == 27) {
            dialog.close();
          } else if (e2.keyCode != 13) {
            return;
          }
          e2.preventDefault();
          e2.stopPropagation();
        });
        iX.focus();
      });
    }
    dialog.modified = function() {
      dialog.is_modified = true;
    };
    dialog.close = function() {
      dialog.parentNode?.removeChild(dialog);
    };
    let dialogCloseTimer = null;
    let prevent_timeout = 0;
    dialog.addEventListener("mouseleave", function() {
      if (prevent_timeout) return;
      if (!dialog.is_modified && LiteGraph.dialog_close_on_mouse_leave)
        dialogCloseTimer = setTimeout(
          dialog.close,
          LiteGraph.dialog_close_on_mouse_leave_delay
        );
    });
    dialog.addEventListener("mouseenter", function() {
      if (options4.closeOnLeave || LiteGraph.dialog_close_on_mouse_leave) {
        if (dialogCloseTimer) clearTimeout(dialogCloseTimer);
      }
    });
    const selInDia = dialog.querySelectorAll("select");
    selInDia?.forEach(function(selIn) {
      selIn.addEventListener("click", function() {
        prevent_timeout++;
      });
      selIn.addEventListener("blur", function() {
        prevent_timeout = 0;
      });
      selIn.addEventListener("change", function() {
        prevent_timeout = -1;
      });
    });
    return dialog;
  }
  createPanel(title, options4) {
    options4 = options4 || {};
    const ref_window = options4.window || window;
    const root24 = document.createElement("div");
    root24.className = "litegraph dialog";
    root24.innerHTML = "<div class='dialog-header'><span class='dialog-title'></span></div><div class='dialog-content'></div><div style='display:none;' class='dialog-alt-content'></div><div class='dialog-footer'></div>";
    root24.header = root24.querySelector(".dialog-header");
    if (options4.width)
      root24.style.width = options4.width + (typeof options4.width === "number" ? "px" : "");
    if (options4.height)
      root24.style.height = options4.height + (typeof options4.height === "number" ? "px" : "");
    if (options4.closable) {
      const close5 = document.createElement("span");
      close5.innerHTML = "&#10005;";
      close5.classList.add("close");
      close5.addEventListener("click", function() {
        root24.close();
      });
      root24.header.appendChild(close5);
    }
    root24.title_element = root24.querySelector(".dialog-title");
    root24.title_element.innerText = title;
    root24.content = root24.querySelector(".dialog-content");
    root24.alt_content = root24.querySelector(".dialog-alt-content");
    root24.footer = root24.querySelector(".dialog-footer");
    root24.close = function() {
      if (typeof root24.onClose == "function") root24.onClose();
      root24.parentNode?.removeChild(root24);
      this.parentNode?.removeChild(this);
    };
    root24.toggleAltContent = function(force) {
      let vTo;
      let vAlt;
      if (typeof force != "undefined") {
        vTo = force ? "block" : "none";
        vAlt = force ? "none" : "block";
      } else {
        vTo = root24.alt_content.style.display != "block" ? "block" : "none";
        vAlt = root24.alt_content.style.display != "block" ? "none" : "block";
      }
      root24.alt_content.style.display = vTo;
      root24.content.style.display = vAlt;
    };
    root24.toggleFooterVisibility = function(force) {
      let vTo;
      if (typeof force != "undefined") {
        vTo = force ? "block" : "none";
      } else {
        vTo = root24.footer.style.display != "block" ? "block" : "none";
      }
      root24.footer.style.display = vTo;
    };
    root24.clear = function() {
      this.content.innerHTML = "";
    };
    root24.addHTML = function(code2, classname, on_footer) {
      const elem = document.createElement("div");
      if (classname) elem.className = classname;
      elem.innerHTML = code2;
      if (on_footer) root24.footer.appendChild(elem);
      else root24.content.appendChild(elem);
      return elem;
    };
    root24.addButton = function(name2, callback, options22) {
      const elem = document.createElement("button");
      elem.innerText = name2;
      elem.options = options22;
      elem.classList.add("btn");
      elem.addEventListener("click", callback);
      root24.footer.appendChild(elem);
      return elem;
    };
    root24.addSeparator = function() {
      const elem = document.createElement("div");
      elem.className = "separator";
      root24.content.appendChild(elem);
    };
    root24.addWidget = function(type, name2, value4, options22, callback) {
      options22 = options22 || {};
      let str_value = String(value4);
      type = type.toLowerCase();
      if (type == "number") str_value = value4.toFixed(3);
      const elem = document.createElement("div");
      elem.className = "property";
      elem.innerHTML = "<span class='property_name'></span><span class='property_value'></span>";
      elem.querySelector(".property_name").innerText = options22.label || name2;
      const value_element = elem.querySelector(".property_value");
      value_element.innerText = str_value;
      elem.dataset["property"] = name2;
      elem.dataset["type"] = options22.type || type;
      elem.options = options22;
      elem.value = value4;
      if (type == "code")
        elem.addEventListener("click", function() {
          root24.inner_showCodePad(this.dataset["property"]);
        });
      else if (type == "boolean") {
        elem.classList.add("boolean");
        if (value4) elem.classList.add("bool-on");
        elem.addEventListener("click", function() {
          const propname = this.dataset["property"];
          this.value = !this.value;
          this.classList.toggle("bool-on");
          this.querySelector(".property_value").innerText = this.value ? "true" : "false";
          innerChange(propname, this.value);
        });
      } else if (type == "string" || type == "number") {
        value_element.setAttribute("contenteditable", true);
        value_element.addEventListener("keydown", function(e2) {
          if (e2.code == "Enter" && (type != "string" || !e2.shiftKey)) {
            e2.preventDefault();
            this.blur();
          }
        });
        value_element.addEventListener("blur", function() {
          let v2 = this.innerText;
          const propname = this.parentNode.dataset["property"];
          const proptype = this.parentNode.dataset["type"];
          if (proptype == "number") v2 = Number(v2);
          innerChange(propname, v2);
        });
      } else if (type == "enum" || type == "combo") {
        const str_value2 = LGraphCanvas.getPropertyPrintableValue(value4, options22.values);
        value_element.innerText = str_value2;
        value_element.addEventListener("click", function(event) {
          const values = options22.values || [];
          const propname = this.parentNode.dataset["property"];
          const elem_that = this;
          new LiteGraph.ContextMenu(
            values,
            {
              event,
              className: "dark",
              callback: inner_clicked
            },
            // @ts-expect-error
            ref_window
          );
          function inner_clicked(v2) {
            elem_that.innerText = v2;
            innerChange(propname, v2);
            return false;
          }
          __name(inner_clicked, "inner_clicked");
        });
      }
      root24.content.appendChild(elem);
      function innerChange(name22, value22) {
        options22.callback?.(name22, value22, options22);
        callback?.(name22, value22, options22);
      }
      __name(innerChange, "innerChange");
      return elem;
    };
    if (root24.onOpen && typeof root24.onOpen == "function") root24.onOpen();
    return root24;
  }
  closePanels() {
    document.querySelector("#node-panel")?.close();
    document.querySelector("#option-panel")?.close();
  }
  showShowNodePanel(node22) {
    this.SELECTED_NODE = node22;
    this.closePanels();
    const ref_window = this.getCanvasWindow();
    const graphcanvas = this;
    const panel2 = this.createPanel(node22.title || "", {
      closable: true,
      window: ref_window,
      onOpen: /* @__PURE__ */ __name(function() {
        graphcanvas.NODEPANEL_IS_OPEN = true;
      }, "onOpen"),
      onClose: /* @__PURE__ */ __name(function() {
        graphcanvas.NODEPANEL_IS_OPEN = false;
        graphcanvas.node_panel = null;
      }, "onClose")
    });
    graphcanvas.node_panel = panel2;
    panel2.id = "node-panel";
    panel2.node = node22;
    panel2.classList.add("settings");
    function inner_refresh() {
      panel2.content.innerHTML = "";
      panel2.addHTML(`<span class='node_type'>${node22.type}</span><span class='node_desc'>${node22.constructor.desc || ""}</span><span class='separator'></span>`);
      panel2.addHTML("<h3>Properties</h3>");
      const fUpdate = /* @__PURE__ */ __name(function(name2, value4) {
        graphcanvas.graph.beforeChange(node22);
        switch (name2) {
          case "Title":
            node22.title = value4;
            break;
          case "Mode": {
            const kV = Object.values(LiteGraph.NODE_MODES).indexOf(value4);
            if (kV >= 0 && LiteGraph.NODE_MODES[kV]) {
              node22.changeMode(kV);
            } else {
              console.warn("unexpected mode: " + value4);
            }
            break;
          }
          case "Color":
            if (LGraphCanvas.node_colors[value4]) {
              node22.color = LGraphCanvas.node_colors[value4].color;
              node22.bgcolor = LGraphCanvas.node_colors[value4].bgcolor;
            } else {
              console.warn("unexpected color: " + value4);
            }
            break;
          default:
            node22.setProperty(name2, value4);
            break;
        }
        graphcanvas.graph.afterChange();
        graphcanvas.dirty_canvas = true;
      }, "fUpdate");
      panel2.addWidget("string", "Title", node22.title, {}, fUpdate);
      panel2.addWidget("combo", "Mode", LiteGraph.NODE_MODES[node22.mode], { values: LiteGraph.NODE_MODES }, fUpdate);
      const nodeCol = node22.color !== void 0 ? Object.keys(LGraphCanvas.node_colors).filter(function(nK) {
        return LGraphCanvas.node_colors[nK].color == node22.color;
      }) : "";
      panel2.addWidget("combo", "Color", nodeCol, { values: Object.keys(LGraphCanvas.node_colors) }, fUpdate);
      for (const pName in node22.properties) {
        const value4 = node22.properties[pName];
        const info = node22.getPropertyInfo(pName);
        if (node22.onAddPropertyToPanel?.(pName, panel2)) continue;
        panel2.addWidget(info.widget || info.type, pName, value4, info, fUpdate);
      }
      panel2.addSeparator();
      node22.onShowCustomPanelInfo?.(panel2);
      panel2.footer.innerHTML = "";
      panel2.addButton("Delete", function() {
        if (node22.block_delete)
          return;
        node22.graph.remove(node22);
        panel2.close();
      }).classList.add("delete");
    }
    __name(inner_refresh, "inner_refresh");
    panel2.inner_showCodePad = function(propname) {
      panel2.classList.remove("settings");
      panel2.classList.add("centered");
      panel2.alt_content.innerHTML = "<textarea class='code'></textarea>";
      const textarea = panel2.alt_content.querySelector("textarea");
      const fDoneWith = /* @__PURE__ */ __name(function() {
        panel2.toggleAltContent(false);
        panel2.toggleFooterVisibility(true);
        textarea.parentNode.removeChild(textarea);
        panel2.classList.add("settings");
        panel2.classList.remove("centered");
        inner_refresh();
      }, "fDoneWith");
      textarea.value = node22.properties[propname];
      textarea.addEventListener("keydown", function(e2) {
        if (e2.code == "Enter" && e2.ctrlKey) {
          node22.setProperty(propname, textarea.value);
          fDoneWith();
        }
      });
      panel2.toggleAltContent(true);
      panel2.toggleFooterVisibility(false);
      textarea.style.height = "calc(100% - 40px)";
      const assign2 = panel2.addButton("Assign", function() {
        node22.setProperty(propname, textarea.value);
        fDoneWith();
      });
      panel2.alt_content.appendChild(assign2);
      const button = panel2.addButton("Close", fDoneWith);
      button.style.float = "right";
      panel2.alt_content.appendChild(button);
    };
    inner_refresh();
    this.canvas.parentNode.appendChild(panel2);
  }
  checkPanels() {
    if (!this.canvas) return;
    const panels = this.canvas.parentNode.querySelectorAll(".litegraph.dialog");
    for (let i2 = 0; i2 < panels.length; ++i2) {
      const panel2 = panels[i2];
      if (!panel2.node) continue;
      if (!panel2.node.graph || panel2.graph != this.graph) panel2.close();
    }
  }
  getCanvasMenuOptions() {
    let options4 = null;
    if (this.getMenuOptions) {
      options4 = this.getMenuOptions();
    } else {
      options4 = [
        {
          content: "Add Node",
          has_submenu: true,
          // @ts-expect-error Might be broken?  Or just param overlap
          callback: LGraphCanvas.onMenuAdd
        },
        { content: "Add Group", callback: LGraphCanvas.onGroupAdd }
        // { content: "Arrange", callback: that.graph.arrange },
        // {content:"Collapse All", callback: LGraphCanvas.onMenuCollapseAll }
      ];
      if (Object.keys(this.selected_nodes).length > 1) {
        options4.push({
          content: "Align",
          has_submenu: true,
          callback: LGraphCanvas.onGroupAlign
        });
      }
    }
    const extra = this.getExtraMenuOptions?.(this, options4);
    return Array.isArray(extra) ? options4.concat(extra) : options4;
  }
  // called by processContextMenu to extract the menu list
  getNodeMenuOptions(node22) {
    let options4 = null;
    if (node22.getMenuOptions) {
      options4 = node22.getMenuOptions(this);
    } else {
      options4 = [
        {
          content: "Inputs",
          has_submenu: true,
          disabled: true,
          callback: LGraphCanvas.showMenuNodeOptionalInputs
        },
        {
          content: "Outputs",
          has_submenu: true,
          disabled: true,
          callback: LGraphCanvas.showMenuNodeOptionalOutputs
        },
        null,
        {
          content: "Properties",
          has_submenu: true,
          callback: LGraphCanvas.onShowMenuNodeProperties
        },
        {
          content: "Properties Panel",
          callback: /* @__PURE__ */ __name(function(item3, options22, e2, menu2, node3) {
            LGraphCanvas.active_canvas.showShowNodePanel(node3);
          }, "callback")
        },
        null,
        {
          content: "Title",
          callback: LGraphCanvas.onShowPropertyEditor
        },
        {
          content: "Mode",
          has_submenu: true,
          callback: LGraphCanvas.onMenuNodeMode
        }
      ];
      if (node22.resizable !== false) {
        options4.push({
          content: "Resize",
          callback: LGraphCanvas.onMenuResizeNode
        });
      }
      if (node22.collapsible) {
        options4.push({
          content: node22.collapsed ? "Expand" : "Collapse",
          callback: LGraphCanvas.onMenuNodeCollapse
        });
      }
      if (node22.widgets?.some((w) => w.advanced)) {
        options4.push({
          content: node22.showAdvanced ? "Hide Advanced" : "Show Advanced",
          callback: LGraphCanvas.onMenuToggleAdvanced
        });
      }
      options4.push(
        {
          content: node22.pinned ? "Unpin" : "Pin",
          callback: /* @__PURE__ */ __name((...args) => {
            LGraphCanvas.onMenuNodePin(...args);
            for (const i2 in this.selected_nodes) {
              const node3 = this.selected_nodes[i2];
              node3.pin();
            }
            this.setDirty(true, true);
          }, "callback")
        },
        {
          content: "Colors",
          has_submenu: true,
          callback: LGraphCanvas.onMenuNodeColors
        },
        {
          content: "Shapes",
          has_submenu: true,
          callback: LGraphCanvas.onMenuNodeShapes
        },
        null
      );
    }
    const inputs = node22.onGetInputs?.();
    if (inputs?.length) options4[0].disabled = false;
    const outputs = node22.onGetOutputs?.();
    if (outputs?.length) options4[1].disabled = false;
    const extra = node22.getExtraMenuOptions?.(this, options4);
    if (Array.isArray(extra) && extra.length > 0) {
      extra.push(null);
      options4 = extra.concat(options4);
    }
    if (node22.clonable !== false) {
      options4.push({
        content: "Clone",
        callback: LGraphCanvas.onMenuNodeClone
      });
    }
    if (Object.keys(this.selected_nodes).length > 1) {
      options4.push({
        content: "Align Selected To",
        has_submenu: true,
        callback: LGraphCanvas.onNodeAlign
      });
      options4.push({
        content: "Distribute Nodes",
        has_submenu: true,
        callback: LGraphCanvas.createDistributeMenu
      });
    }
    options4.push(null, {
      content: "Remove",
      disabled: !(node22.removable !== false && !node22.block_delete),
      callback: LGraphCanvas.onMenuNodeRemove
    });
    node22.graph?.onGetNodeMenuOptions?.(options4, node22);
    return options4;
  }
  getGroupMenuOptions(group) {
    console.warn("LGraphCanvas.getGroupMenuOptions is deprecated, use LGraphGroup.getMenuOptions instead");
    return group.getMenuOptions();
  }
  processContextMenu(node22, event) {
    const that = this;
    const canvas = LGraphCanvas.active_canvas;
    const ref_window = canvas.getCanvasWindow();
    let menu_info = null;
    const options4 = {
      event,
      callback: inner_option_clicked,
      extra: node22
    };
    if (node22) options4.title = node22.type;
    let slot = null;
    if (node22) {
      slot = node22.getSlotInPosition(event.canvasX, event.canvasY);
      LGraphCanvas.active_node = node22;
    }
    if (slot) {
      menu_info = [];
      if (node22.getSlotMenuOptions) {
        menu_info = node22.getSlotMenuOptions(slot);
      } else {
        if (slot?.output?.links?.length)
          menu_info.push({ content: "Disconnect Links", slot });
        const _slot = slot.input || slot.output;
        if (_slot.removable) {
          menu_info.push(
            _slot.locked ? "Cannot remove" : { content: "Remove Slot", slot }
          );
        }
        if (!_slot.nameLocked)
          menu_info.push({ content: "Rename Slot", slot });
      }
      options4.title = (slot.input ? slot.input.type : slot.output.type) || "*";
      if (slot.input && slot.input.type == LiteGraph.ACTION)
        options4.title = "Action";
      if (slot.output && slot.output.type == LiteGraph.EVENT)
        options4.title = "Event";
    } else if (node22) {
      menu_info = this.getNodeMenuOptions(node22);
    } else {
      menu_info = this.getCanvasMenuOptions();
      if (this.reroutesEnabled && this.links_render_mode !== LinkRenderType.HIDDEN_LINK) {
        const reroute = this.graph.getRerouteOnPos(event.canvasX, event.canvasY);
        if (reroute) {
          menu_info.unshift({
            content: "Delete Reroute",
            callback: /* @__PURE__ */ __name(() => this.graph.removeReroute(reroute.id), "callback")
          }, null);
        }
      }
      const group = this.graph.getGroupOnPos(
        event.canvasX,
        event.canvasY
      );
      if (group) {
        menu_info.push(null, {
          content: "Edit Group",
          has_submenu: true,
          submenu: {
            title: "Group",
            extra: group,
            options: group.getMenuOptions()
          }
        });
      }
    }
    if (!menu_info) return;
    new LiteGraph.ContextMenu(menu_info, options4, ref_window);
    function inner_option_clicked(v2, options22) {
      if (!v2) return;
      if (v2.content == "Remove Slot") {
        const info = v2.slot;
        node22.graph.beforeChange();
        if (info.input) {
          node22.removeInput(info.slot);
        } else if (info.output) {
          node22.removeOutput(info.slot);
        }
        node22.graph.afterChange();
        return;
      } else if (v2.content == "Disconnect Links") {
        const info = v2.slot;
        node22.graph.beforeChange();
        if (info.output) {
          node22.disconnectOutput(info.slot);
        } else if (info.input) {
          node22.disconnectInput(info.slot);
        }
        node22.graph.afterChange();
        return;
      } else if (v2.content == "Rename Slot") {
        const info = v2.slot;
        const slot_info = info.input ? node22.getInputInfo(info.slot) : node22.getOutputInfo(info.slot);
        const dialog = that.createDialog(
          "<span class='name'>Name</span><input autofocus type='text'/><button>OK</button>",
          options22
        );
        const input = dialog.querySelector("input");
        if (input && slot_info) {
          input.value = slot_info.label || "";
        }
        const inner = /* @__PURE__ */ __name(function() {
          node22.graph.beforeChange();
          if (input.value) {
            if (slot_info) {
              slot_info.label = input.value;
            }
            that.setDirty(true);
          }
          dialog.close();
          node22.graph.afterChange();
        }, "inner");
        dialog.querySelector("button").addEventListener("click", inner);
        input.addEventListener("keydown", function(e2) {
          dialog.is_modified = true;
          if (e2.keyCode == 27) {
            dialog.close();
          } else if (e2.keyCode == 13) {
            inner();
          } else if (e2.keyCode != 13 && e2.target.localName != "textarea") {
            return;
          }
          e2.preventDefault();
          e2.stopPropagation();
        });
        input.focus();
      }
    }
    __name(inner_option_clicked, "inner_option_clicked");
  }
  /**
   * Starts an animation to fit the view around the specified selection of nodes.
   * @param bounds The bounds to animate the view to, defined by a rectangle.
   */
  animateToBounds(bounds, {
    duration = 350,
    zoom = 0.75,
    easing = EaseFunction.EASE_IN_OUT_QUAD
  } = {}) {
    const easeFunctions = {
      linear: /* @__PURE__ */ __name((t2) => t2, "linear"),
      easeInQuad: /* @__PURE__ */ __name((t2) => t2 * t2, "easeInQuad"),
      easeOutQuad: /* @__PURE__ */ __name((t2) => t2 * (2 - t2), "easeOutQuad"),
      easeInOutQuad: /* @__PURE__ */ __name((t2) => t2 < 0.5 ? 2 * t2 * t2 : -1 + (4 - 2 * t2) * t2, "easeInOutQuad")
    };
    const easeFunction = easeFunctions[easing] ?? easeFunctions.linear;
    let animationId = null;
    const startTimestamp = performance.now();
    const startX = this.ds.offset[0];
    const startY = this.ds.offset[1];
    const startScale = this.ds.scale;
    const cw = this.canvas.width / window.devicePixelRatio;
    const ch = this.canvas.height / window.devicePixelRatio;
    let targetScale = startScale;
    let targetX = startX;
    let targetY = startY;
    if (zoom > 0) {
      const targetScaleX = zoom * cw / Math.max(bounds[2], 300);
      const targetScaleY = zoom * ch / Math.max(bounds[3], 300);
      targetScale = Math.min(targetScaleX, targetScaleY, this.ds.max_scale);
    }
    targetX = -bounds[0] - bounds[2] * 0.5 + cw * 0.5 / targetScale;
    targetY = -bounds[1] - bounds[3] * 0.5 + ch * 0.5 / targetScale;
    const animate = /* @__PURE__ */ __name((timestamp2) => {
      const elapsed = timestamp2 - startTimestamp;
      const progress = Math.min(elapsed / duration, 1);
      const easedProgress = easeFunction(progress);
      this.ds.offset[0] = startX + (targetX - startX) * easedProgress;
      this.ds.offset[1] = startY + (targetY - startY) * easedProgress;
      if (zoom > 0) {
        this.ds.scale = startScale + (targetScale - startScale) * easedProgress;
      }
      this.setDirty(true, true);
      if (progress < 1) {
        animationId = requestAnimationFrame(animate);
      } else {
        cancelAnimationFrame(animationId);
      }
    }, "animate");
    animationId = requestAnimationFrame(animate);
  }
  /**
   * Fits the view to the selected nodes with animation.
   * If nothing is selected, the view is fitted around all items in the graph.
   */
  fitViewToSelectionAnimated(options4 = {}) {
    const items2 = this.selectedItems.size ? Array.from(this.selectedItems) : this.positionableItems;
    this.animateToBounds(createBounds(items2), options4);
  }
}
class MapProxyHandler {
  static {
    __name(this, "MapProxyHandler");
  }
  getOwnPropertyDescriptor(target, p2) {
    const value4 = this.get(target, p2);
    if (value4) return {
      configurable: true,
      enumerable: true,
      value: value4
    };
  }
  has(target, p2) {
    if (typeof p2 === "symbol") return false;
    const int = parseInt(p2, 10);
    return target.has(!isNaN(int) ? int : p2);
  }
  ownKeys(target) {
    return [...target.keys()].map((x2) => String(x2));
  }
  get(target, p2) {
    if (p2 in target) return Reflect.get(target, p2, target);
    if (typeof p2 === "symbol") return;
    const int = parseInt(p2, 10);
    return target.get(!isNaN(int) ? int : p2);
  }
  set(target, p2, newValue2) {
    if (typeof p2 === "symbol") return false;
    const int = parseInt(p2, 10);
    target.set(!isNaN(int) ? int : p2, newValue2);
    return true;
  }
  deleteProperty(target, p2) {
    return target.delete(p2);
  }
  static bindAllMethods(map3) {
    map3.clear = map3.clear.bind(map3);
    map3.delete = map3.delete.bind(map3);
    map3.forEach = map3.forEach.bind(map3);
    map3.get = map3.get.bind(map3);
    map3.has = map3.has.bind(map3);
    map3.set = map3.set.bind(map3);
    map3.entries = map3.entries.bind(map3);
    map3.keys = map3.keys.bind(map3);
    map3.values = map3.values.bind(map3);
  }
}
let LGraph$1 = class LGraph2 {
  static {
    __name(this, "LGraph");
  }
  static serialisedSchemaVersion = 1;
  // default supported types
  static supported_types = ["number", "string", "boolean"];
  static STATUS_STOPPED = 1;
  static STATUS_RUNNING = 2;
  _version;
  /** The backing store for links.  Keys are wrapped in String() */
  _links = /* @__PURE__ */ new Map();
  /**
   * Indexed property access is deprecated.
   * Backwards compatibility with a Proxy has been added, but will eventually be removed.
   *
   * Use {@link Map} methods:
   * ```
   * const linkId = 123
   * const link = graph.links.get(linkId)
   * // Deprecated: const link = graph.links[linkId]
   * ```
   */
  links;
  list_of_graphcanvas;
  status;
  state;
  _nodes;
  _nodes_by_id;
  _nodes_in_order;
  _nodes_executable;
  _groups;
  iteration;
  globaltime;
  runningtime;
  fixedtime;
  fixedtime_lapse;
  elapsed_time;
  last_update_time;
  starttime;
  catch_errors;
  execution_timer_id;
  errors_in_execution;
  execution_time;
  _last_trigger_time;
  filter;
  _subgraph_node;
  /** Must contain serialisable values, e.g. primitive types */
  config;
  vars;
  nodes_executing;
  nodes_actioning;
  nodes_executedAction;
  extra;
  inputs;
  outputs;
  /** @returns Whether the graph has no items */
  get empty() {
    return this._nodes.length + this._groups.length + this.reroutes.size === 0;
  }
  /** @returns All items on the canvas that can be selected */
  *positionableItems() {
    for (const node22 of this._nodes) yield node22;
    for (const group of this._groups) yield group;
    for (const reroute of this.reroutes.values()) yield reroute;
    return;
  }
  #reroutes = /* @__PURE__ */ new Map();
  /** All reroutes in this graph. */
  get reroutes() {
    return this.#reroutes;
  }
  set reroutes(value4) {
    if (!value4) throw new TypeError("Attempted to set LGraph.reroutes to a falsy value.");
    const reroutes = this.#reroutes;
    if (value4.size === 0) {
      reroutes.clear();
      return;
    }
    for (const rerouteId of reroutes.keys()) {
      if (!value4.has(rerouteId)) reroutes.delete(rerouteId);
    }
    for (const [id3, reroute] of value4) {
      reroutes.set(id3, reroute);
    }
  }
  /** @deprecated See {@link state}.{@link LGraphState.lastNodeId lastNodeId} */
  get last_node_id() {
    return this.state.lastNodeId;
  }
  set last_node_id(value4) {
    this.state.lastNodeId = value4;
  }
  /** @deprecated See {@link state}.{@link LGraphState.lastLinkId lastLinkId} */
  get last_link_id() {
    return this.state.lastLinkId;
  }
  set last_link_id(value4) {
    this.state.lastLinkId = value4;
  }
  _input_nodes;
  /**
   * See {@link LGraph}
   * @param o data from previous serialization [optional]
   */
  constructor(o) {
    if (LiteGraph.debug) console.log("Graph created");
    const links = this._links;
    MapProxyHandler.bindAllMethods(links);
    const handler6 = new MapProxyHandler();
    this.links = new Proxy(links, handler6);
    this.list_of_graphcanvas = null;
    this.clear();
    if (o) this.configure(o);
  }
  // TODO: Remove
  // used to know which types of connections support this graph (some graphs do not allow certain types)
  getSupportedTypes() {
    return this.supported_types || LGraph2.supported_types;
  }
  /**
   * Removes all nodes from this graph
   */
  clear() {
    this.stop();
    this.status = LGraph2.STATUS_STOPPED;
    this.state = {
      lastGroupId: 0,
      lastNodeId: 0,
      lastLinkId: 0,
      lastRerouteId: 0
    };
    this._version = -1;
    if (this._nodes) {
      for (let i2 = 0; i2 < this._nodes.length; ++i2) {
        this._nodes[i2].onRemoved?.();
      }
    }
    this._nodes = [];
    this._nodes_by_id = {};
    this._nodes_in_order = [];
    this._nodes_executable = null;
    this._links.clear();
    this.reroutes.clear();
    this._groups = [];
    this.iteration = 0;
    this.config = {};
    this.vars = {};
    this.extra = {};
    this.globaltime = 0;
    this.runningtime = 0;
    this.fixedtime = 0;
    this.fixedtime_lapse = 0.01;
    this.elapsed_time = 0.01;
    this.last_update_time = 0;
    this.starttime = 0;
    this.catch_errors = true;
    this.nodes_executing = [];
    this.nodes_actioning = [];
    this.nodes_executedAction = [];
    this.inputs = {};
    this.outputs = {};
    this.change();
    this.canvasAction((c) => c.clear());
  }
  get nodes() {
    return this._nodes;
  }
  get groups() {
    return this._groups;
  }
  /**
   * Attach Canvas to this graph
   */
  attachCanvas(graphcanvas) {
    if (graphcanvas.constructor != LGraphCanvas)
      throw "attachCanvas expects a LGraphCanvas instance";
    if (graphcanvas.graph != this)
      graphcanvas.graph?.detachCanvas(graphcanvas);
    graphcanvas.graph = this;
    this.list_of_graphcanvas ||= [];
    this.list_of_graphcanvas.push(graphcanvas);
  }
  /**
   * Detach Canvas from this graph
   */
  detachCanvas(graphcanvas) {
    if (!this.list_of_graphcanvas) return;
    const pos2 = this.list_of_graphcanvas.indexOf(graphcanvas);
    if (pos2 == -1) return;
    graphcanvas.graph = null;
    this.list_of_graphcanvas.splice(pos2, 1);
  }
  /**
   * Starts running this graph every interval milliseconds.
   * @param interval amount of milliseconds between executions, if 0 then it renders to the monitor refresh rate
   */
  start(interval) {
    if (this.status == LGraph2.STATUS_RUNNING) return;
    this.status = LGraph2.STATUS_RUNNING;
    this.onPlayEvent?.();
    this.sendEventToAllNodes("onStart");
    this.starttime = LiteGraph.getTime();
    this.last_update_time = this.starttime;
    interval ||= 0;
    const that = this;
    if (interval == 0 && typeof window != "undefined" && window.requestAnimationFrame) {
      let on_frame = /* @__PURE__ */ __name(function() {
        if (that.execution_timer_id != -1) return;
        window.requestAnimationFrame(on_frame);
        that.onBeforeStep?.();
        that.runStep(1, !that.catch_errors);
        that.onAfterStep?.();
      }, "on_frame");
      this.execution_timer_id = -1;
      on_frame();
    } else {
      this.execution_timer_id = setInterval(function() {
        that.onBeforeStep?.();
        that.runStep(1, !that.catch_errors);
        that.onAfterStep?.();
      }, interval);
    }
  }
  /**
   * Stops the execution loop of the graph
   */
  stop() {
    if (this.status == LGraph2.STATUS_STOPPED) return;
    this.status = LGraph2.STATUS_STOPPED;
    this.onStopEvent?.();
    if (this.execution_timer_id != null) {
      if (this.execution_timer_id != -1) {
        clearInterval(this.execution_timer_id);
      }
      this.execution_timer_id = null;
    }
    this.sendEventToAllNodes("onStop");
  }
  /**
   * Run N steps (cycles) of the graph
   * @param num number of steps to run, default is 1
   * @param do_not_catch_errors [optional] if you want to try/catch errors
   * @param limit max number of nodes to execute (used to execute from start to a node)
   */
  runStep(num, do_not_catch_errors, limit) {
    num = num || 1;
    const start2 = LiteGraph.getTime();
    this.globaltime = 1e-3 * (start2 - this.starttime);
    const nodes = this._nodes_executable ? this._nodes_executable : this._nodes;
    if (!nodes) return;
    limit = limit || nodes.length;
    if (do_not_catch_errors) {
      for (let i2 = 0; i2 < num; i2++) {
        for (let j = 0; j < limit; ++j) {
          const node22 = nodes[j];
          if (node22.mode == LGraphEventMode.ALWAYS && node22.onExecute) {
            node22.doExecute?.();
          }
        }
        this.fixedtime += this.fixedtime_lapse;
        this.onExecuteStep?.();
      }
      this.onAfterExecute?.();
    } else {
      try {
        for (let i2 = 0; i2 < num; i2++) {
          for (let j = 0; j < limit; ++j) {
            const node22 = nodes[j];
            if (node22.mode == LGraphEventMode.ALWAYS) {
              node22.onExecute?.();
            }
          }
          this.fixedtime += this.fixedtime_lapse;
          this.onExecuteStep?.();
        }
        this.onAfterExecute?.();
        this.errors_in_execution = false;
      } catch (err) {
        this.errors_in_execution = true;
        if (LiteGraph.throw_errors) throw err;
        if (LiteGraph.debug) console.log("Error during execution: " + err);
        this.stop();
      }
    }
    const now2 = LiteGraph.getTime();
    let elapsed = now2 - start2;
    if (elapsed == 0) elapsed = 1;
    this.execution_time = 1e-3 * elapsed;
    this.globaltime += 1e-3 * elapsed;
    this.iteration += 1;
    this.elapsed_time = (now2 - this.last_update_time) * 1e-3;
    this.last_update_time = now2;
    this.nodes_executing = [];
    this.nodes_actioning = [];
    this.nodes_executedAction = [];
  }
  /**
   * Updates the graph execution order according to relevance of the nodes (nodes with only outputs have more relevance than
   * nodes with only inputs.
   */
  updateExecutionOrder() {
    this._nodes_in_order = this.computeExecutionOrder(false);
    this._nodes_executable = [];
    for (let i2 = 0; i2 < this._nodes_in_order.length; ++i2) {
      if (this._nodes_in_order[i2].onExecute) {
        this._nodes_executable.push(this._nodes_in_order[i2]);
      }
    }
  }
  // This is more internal, it computes the executable nodes in order and returns it
  computeExecutionOrder(only_onExecute, set_level) {
    const L = [];
    const S = [];
    const M = {};
    const visited_links = {};
    const remaining_links = {};
    for (let i2 = 0, l2 = this._nodes.length; i2 < l2; ++i2) {
      const node22 = this._nodes[i2];
      if (only_onExecute && !node22.onExecute) {
        continue;
      }
      M[node22.id] = node22;
      let num = 0;
      if (node22.inputs) {
        for (let j = 0, l22 = node22.inputs.length; j < l22; j++) {
          if (node22.inputs[j]?.link != null) {
            num += 1;
          }
        }
      }
      if (num == 0) {
        S.push(node22);
        if (set_level) node22._level = 1;
      } else {
        if (set_level) node22._level = 0;
        remaining_links[node22.id] = num;
      }
    }
    while (true) {
      const node22 = S.shift();
      if (node22 === void 0) break;
      L.push(node22);
      delete M[node22.id];
      if (!node22.outputs) continue;
      for (let i2 = 0; i2 < node22.outputs.length; i2++) {
        const output = node22.outputs[i2];
        if (output?.links == null || output.links.length == 0)
          continue;
        for (let j = 0; j < output.links.length; j++) {
          const link_id = output.links[j];
          const link2 = this._links.get(link_id);
          if (!link2) continue;
          if (visited_links[link2.id]) continue;
          const target_node = this.getNodeById(link2.target_id);
          if (target_node == null) {
            visited_links[link2.id] = true;
            continue;
          }
          if (set_level && (!target_node._level || target_node._level <= node22._level)) {
            target_node._level = node22._level + 1;
          }
          visited_links[link2.id] = true;
          remaining_links[target_node.id] -= 1;
          if (remaining_links[target_node.id] == 0) S.push(target_node);
        }
      }
    }
    for (const i2 in M) {
      L.push(M[i2]);
    }
    if (L.length != this._nodes.length && LiteGraph.debug)
      console.warn("something went wrong, nodes missing");
    L.length;
    function setOrder(nodes) {
      const l2 = nodes.length;
      for (let i2 = 0; i2 < l2; ++i2) {
        nodes[i2].order = i2;
      }
    }
    __name(setOrder, "setOrder");
    setOrder(L);
    L.sort(function(A, B) {
      const Ap = A.constructor.priority || A.priority || 0;
      const Bp = B.constructor.priority || B.priority || 0;
      return Ap == Bp ? A.order - B.order : Ap - Bp;
    });
    setOrder(L);
    return L;
  }
  /**
   * Returns all the nodes that could affect this one (ancestors) by crawling all the inputs recursively.
   * It doesn't include the node itself
   * @returns an array with all the LGraphNodes that affect this node, in order of execution
   */
  getAncestors(node22) {
    const ancestors = [];
    const pending = [node22];
    const visited = {};
    while (pending.length) {
      const current = pending.shift();
      if (!current?.inputs) continue;
      if (!visited[current.id] && current != node22) {
        visited[current.id] = true;
        ancestors.push(current);
      }
      for (let i2 = 0; i2 < current.inputs.length; ++i2) {
        const input = current.getInputNode(i2);
        if (input && ancestors.indexOf(input) == -1) {
          pending.push(input);
        }
      }
    }
    ancestors.sort(function(a, b) {
      return a.order - b.order;
    });
    return ancestors;
  }
  /**
   * Positions every node in a more readable manner
   */
  arrange(margin, layout) {
    margin = margin || 100;
    const nodes = this.computeExecutionOrder(false, true);
    const columns = [];
    for (let i2 = 0; i2 < nodes.length; ++i2) {
      const node22 = nodes[i2];
      const col = node22._level || 1;
      columns[col] ||= [];
      columns[col].push(node22);
    }
    let x2 = margin;
    for (let i2 = 0; i2 < columns.length; ++i2) {
      const column = columns[i2];
      if (!column) continue;
      let max_size = 100;
      let y2 = margin + LiteGraph.NODE_TITLE_HEIGHT;
      for (let j = 0; j < column.length; ++j) {
        const node22 = column[j];
        node22.pos[0] = layout == LiteGraph.VERTICAL_LAYOUT ? y2 : x2;
        node22.pos[1] = layout == LiteGraph.VERTICAL_LAYOUT ? x2 : y2;
        const max_size_index = layout == LiteGraph.VERTICAL_LAYOUT ? 1 : 0;
        if (node22.size[max_size_index] > max_size) {
          max_size = node22.size[max_size_index];
        }
        const node_size_index = layout == LiteGraph.VERTICAL_LAYOUT ? 0 : 1;
        y2 += node22.size[node_size_index] + margin + LiteGraph.NODE_TITLE_HEIGHT;
      }
      x2 += max_size + margin;
    }
    this.setDirtyCanvas(true, true);
  }
  /**
   * Returns the amount of time the graph has been running in milliseconds
   * @returns number of milliseconds the graph has been running
   */
  getTime() {
    return this.globaltime;
  }
  /**
   * Returns the amount of time accumulated using the fixedtime_lapse var.
   * This is used in context where the time increments should be constant
   * @returns number of milliseconds the graph has been running
   */
  getFixedTime() {
    return this.fixedtime;
  }
  /**
   * Returns the amount of time it took to compute the latest iteration.
   * Take into account that this number could be not correct
   * if the nodes are using graphical actions
   * @returns number of milliseconds it took the last cycle
   */
  getElapsedTime() {
    return this.elapsed_time;
  }
  /**
   * Sends an event to all the nodes, useful to trigger stuff
   * @param eventname the name of the event (function to be called)
   * @param params parameters in array format
   */
  sendEventToAllNodes(eventname, params, mode2) {
    mode2 = mode2 || LGraphEventMode.ALWAYS;
    const nodes = this._nodes_in_order ? this._nodes_in_order : this._nodes;
    if (!nodes) return;
    for (let j = 0, l = nodes.length; j < l; ++j) {
      const node22 = nodes[j];
      if (node22.constructor === LiteGraph.Subgraph && eventname != "onExecute") {
        if (node22.mode == mode2) {
          node22.sendEventToAllNodes(eventname, params, mode2);
        }
        continue;
      }
      if (!node22[eventname] || node22.mode != mode2) continue;
      if (params === void 0) {
        node22[eventname]();
      } else if (params && params.constructor === Array) {
        node22[eventname].apply(node22, params);
      } else {
        node22[eventname](params);
      }
    }
  }
  /**
   * Runs an action on every canvas registered to this graph.
   * @param action Action to run for every canvas
   */
  canvasAction(action) {
    this.list_of_graphcanvas?.forEach(action);
  }
  /** @deprecated See {@link LGraph.canvasAction} */
  sendActionToCanvas(action, params) {
    if (!this.list_of_graphcanvas) return;
    for (let i2 = 0; i2 < this.list_of_graphcanvas.length; ++i2) {
      const c = this.list_of_graphcanvas[i2];
      c[action]?.apply(c, params);
    }
  }
  /**
   * Adds a new node instance to this graph
   * @param node the instance of the node
   */
  add(node22, skip_compute_order) {
    if (!node22) return;
    const { state } = this;
    if (LiteGraph.alwaysSnapToGrid) {
      const snapTo = this.getSnapToGridSize();
      if (snapTo) node22.snapToGrid(snapTo);
    }
    if (node22 instanceof LGraphGroup) {
      if (node22.id == null || node22.id === -1) node22.id = ++state.lastGroupId;
      if (node22.id > state.lastGroupId) state.lastGroupId = node22.id;
      this._groups.push(node22);
      this.setDirtyCanvas(true);
      this.change();
      node22.graph = this;
      this._version++;
      return;
    }
    if (node22.id != -1 && this._nodes_by_id[node22.id] != null) {
      console.warn(
        "LiteGraph: there is already a node with this ID, changing it"
      );
      node22.id = LiteGraph.use_uuids ? LiteGraph.uuidv4() : ++state.lastNodeId;
    }
    if (this._nodes.length >= LiteGraph.MAX_NUMBER_OF_NODES) {
      throw "LiteGraph: max number of nodes in a graph reached";
    }
    if (LiteGraph.use_uuids) {
      if (node22.id == null || node22.id == -1)
        node22.id = LiteGraph.uuidv4();
    } else {
      if (node22.id == null || node22.id == -1) {
        node22.id = ++state.lastNodeId;
      } else if (typeof node22.id === "number" && state.lastNodeId < node22.id) {
        state.lastNodeId = node22.id;
      }
    }
    node22.graph = this;
    this._version++;
    this._nodes.push(node22);
    this._nodes_by_id[node22.id] = node22;
    node22.onAdded?.(this);
    if (this.config.align_to_grid) node22.alignToGrid();
    if (!skip_compute_order) this.updateExecutionOrder();
    this.onNodeAdded?.(node22);
    this.setDirtyCanvas(true);
    this.change();
    return node22;
  }
  /**
   * Removes a node from the graph
   * @param node the instance of the node
   */
  remove(node22) {
    if (node22 instanceof LGraphGroup) {
      const index2 = this._groups.indexOf(node22);
      if (index2 != -1) {
        this._groups.splice(index2, 1);
      }
      node22.graph = null;
      this._version++;
      this.setDirtyCanvas(true, true);
      this.change();
      return;
    }
    if (this._nodes_by_id[node22.id] == null) return;
    if (node22.ignore_remove) return;
    this.beforeChange();
    if (node22.inputs) {
      for (let i2 = 0; i2 < node22.inputs.length; i2++) {
        const slot = node22.inputs[i2];
        if (slot.link != null) node22.disconnectInput(i2);
      }
    }
    if (node22.outputs) {
      for (let i2 = 0; i2 < node22.outputs.length; i2++) {
        const slot = node22.outputs[i2];
        if (slot.links?.length) node22.disconnectOutput(i2);
      }
    }
    node22.onRemoved?.();
    node22.graph = null;
    this._version++;
    if (this.list_of_graphcanvas) {
      for (let i2 = 0; i2 < this.list_of_graphcanvas.length; ++i2) {
        const canvas = this.list_of_graphcanvas[i2];
        if (canvas.selected_nodes[node22.id])
          delete canvas.selected_nodes[node22.id];
      }
    }
    const pos2 = this._nodes.indexOf(node22);
    if (pos2 != -1) this._nodes.splice(pos2, 1);
    delete this._nodes_by_id[node22.id];
    this.onNodeRemoved?.(node22);
    this.canvasAction((c) => c.checkPanels());
    this.setDirtyCanvas(true, true);
    this.afterChange();
    this.change();
    this.updateExecutionOrder();
  }
  /**
   * Returns a node by its id.
   */
  getNodeById(id3) {
    return id3 != null ? this._nodes_by_id[id3] : null;
  }
  /**
   * Returns a list of nodes that matches a class
   * @param classObject the class itself (not an string)
   * @returns a list with all the nodes of this type
   */
  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
  findNodesByClass(classObject, result) {
    result = result || [];
    result.length = 0;
    for (let i2 = 0, l = this._nodes.length; i2 < l; ++i2) {
      if (this._nodes[i2].constructor === classObject)
        result.push(this._nodes[i2]);
    }
    return result;
  }
  /**
   * Returns a list of nodes that matches a type
   * @param type the name of the node type
   * @returns a list with all the nodes of this type
   */
  findNodesByType(type, result) {
    const matchType = type.toLowerCase();
    result = result || [];
    result.length = 0;
    for (let i2 = 0, l = this._nodes.length; i2 < l; ++i2) {
      if (this._nodes[i2].type?.toLowerCase() == matchType)
        result.push(this._nodes[i2]);
    }
    return result;
  }
  /**
   * Returns the first node that matches a name in its title
   * @param title the name of the node to search
   * @returns the node or null
   */
  findNodeByTitle(title) {
    for (let i2 = 0, l = this._nodes.length; i2 < l; ++i2) {
      if (this._nodes[i2].title == title)
        return this._nodes[i2];
    }
    return null;
  }
  /**
   * Returns a list of nodes that matches a name
   * @param title the name of the node to search
   * @returns a list with all the nodes with this name
   */
  findNodesByTitle(title) {
    const result = [];
    for (let i2 = 0, l = this._nodes.length; i2 < l; ++i2) {
      if (this._nodes[i2].title == title)
        result.push(this._nodes[i2]);
    }
    return result;
  }
  /**
   * Returns the top-most node in this position of the canvas
   * @param x the x coordinate in canvas space
   * @param y the y coordinate in canvas space
   * @param nodeList a list with all the nodes to search from, by default is all the nodes in the graph
   * @returns the node at this position or null
   */
  getNodeOnPos(x2, y2, nodeList) {
    const nodes = nodeList || this._nodes;
    let i2 = nodes.length;
    while (--i2 >= 0) {
      const node22 = nodes[i2];
      if (node22.isPointInside(x2, y2)) return node22;
    }
    return null;
  }
  /**
   * Returns the top-most group in that position
   * @param x The x coordinate in canvas space
   * @param y The y coordinate in canvas space
   * @returns The group or null
   */
  getGroupOnPos(x2, y2) {
    return this._groups.toReversed().find((g2) => g2.isPointInside(x2, y2));
  }
  /**
   * Returns the top-most group with a titlebar in the provided position.
   * @param x The x coordinate in canvas space
   * @param y The y coordinate in canvas space
   * @returns The group or null
   */
  getGroupTitlebarOnPos(x2, y2) {
    return this._groups.toReversed().find((g2) => g2.isPointInTitlebar(x2, y2));
  }
  /**
   * Finds a reroute a the given graph point
   * @param x X co-ordinate in graph space
   * @param y Y co-ordinate in graph space
   * @returns The first reroute under the given co-ordinates, or undefined
   */
  getRerouteOnPos(x2, y2) {
    for (const reroute of this.reroutes.values()) {
      const { pos: pos2 } = reroute;
      if (isSortaInsideOctagon(x2 - pos2[0], y2 - pos2[1], 2 * Reroute.radius))
        return reroute;
    }
  }
  /**
   * Snaps the provided items to a grid.
   *
   * Item positions are reounded to the nearest multiple of {@link LiteGraph.CANVAS_GRID_SIZE}.
   *
   * When {@link LiteGraph.alwaysSnapToGrid} is enabled
   * and the grid size is falsy, a default of 1 is used.
   * @param items The items to be snapped to the grid
   * @todo Currently only snaps nodes.
   */
  snapToGrid(items2) {
    const snapTo = this.getSnapToGridSize();
    if (!snapTo) return;
    getAllNestedItems(items2).forEach((item3) => {
      if (!item3.pinned) item3.snapToGrid(snapTo);
    });
  }
  /**
   * Finds the size of the grid that items should be snapped to when moved.
   * @returns The size of the grid that items should be snapped to
   */
  getSnapToGridSize() {
    return LiteGraph.alwaysSnapToGrid ? LiteGraph.CANVAS_GRID_SIZE || 1 : LiteGraph.CANVAS_GRID_SIZE;
  }
  /**
   * Checks that the node type matches the node type registered,
   * used when replacing a nodetype by a newer version during execution
   * this replaces the ones using the old version with the new version
   */
  checkNodeTypes() {
    for (let i2 = 0; i2 < this._nodes.length; i2++) {
      const node22 = this._nodes[i2];
      const ctor = LiteGraph.registered_node_types[node22.type];
      if (node22.constructor == ctor) continue;
      console.log("node being replaced by newer version: " + node22.type);
      const newnode = LiteGraph.createNode(node22.type);
      this._nodes[i2] = newnode;
      newnode.configure(node22.serialize());
      newnode.graph = this;
      this._nodes_by_id[newnode.id] = newnode;
      if (node22.inputs) newnode.inputs = node22.inputs.concat();
      if (node22.outputs) newnode.outputs = node22.outputs.concat();
    }
    this.updateExecutionOrder();
  }
  // ********** GLOBALS *****************
  onAction(action, param, options4) {
    this._input_nodes = this.findNodesByClass(
      // @ts-expect-error Never impl.
      LiteGraph.GraphInput,
      this._input_nodes
    );
    for (let i2 = 0; i2 < this._input_nodes.length; ++i2) {
      const node22 = this._input_nodes[i2];
      if (node22.properties.name != action) continue;
      node22.actionDo(action, param, options4);
      break;
    }
  }
  trigger(action, param) {
    this.onTrigger?.(action, param);
  }
  /**
   * Tell this graph it has a global graph input of this type
   */
  addInput(name2, type, value4) {
    const input = this.inputs[name2];
    if (input) return;
    this.beforeChange();
    this.inputs[name2] = { name: name2, type, value: value4 };
    this._version++;
    this.afterChange();
    this.onInputAdded?.(name2, type);
    this.onInputsOutputsChange?.();
  }
  /**
   * Assign a data to the global graph input
   */
  setInputData(name2, data24) {
    const input = this.inputs[name2];
    if (!input) return;
    input.value = data24;
  }
  /**
   * Returns the current value of a global graph input
   */
  getInputData(name2) {
    const input = this.inputs[name2];
    return input ? input.value : null;
  }
  /**
   * Changes the name of a global graph input
   */
  renameInput(old_name, name2) {
    if (name2 == old_name) return;
    if (!this.inputs[old_name]) return false;
    if (this.inputs[name2]) {
      console.error("there is already one input with that name");
      return false;
    }
    this.inputs[name2] = this.inputs[old_name];
    delete this.inputs[old_name];
    this._version++;
    this.onInputRenamed?.(old_name, name2);
    this.onInputsOutputsChange?.();
  }
  /**
   * Changes the type of a global graph input
   */
  changeInputType(name2, type) {
    if (!this.inputs[name2]) return false;
    if (this.inputs[name2].type && String(this.inputs[name2].type).toLowerCase() == String(type).toLowerCase()) {
      return;
    }
    this.inputs[name2].type = type;
    this._version++;
    this.onInputTypeChanged?.(name2, type);
  }
  /**
   * Removes a global graph input
   */
  removeInput(name2) {
    if (!this.inputs[name2]) return false;
    delete this.inputs[name2];
    this._version++;
    this.onInputRemoved?.(name2);
    this.onInputsOutputsChange?.();
    return true;
  }
  /**
   * Creates a global graph output
   */
  addOutput(name2, type, value4) {
    this.outputs[name2] = { name: name2, type, value: value4 };
    this._version++;
    this.onOutputAdded?.(name2, type);
    this.onInputsOutputsChange?.();
  }
  /**
   * Assign a data to the global output
   */
  setOutputData(name2, value4) {
    const output = this.outputs[name2];
    if (!output) return;
    output.value = value4;
  }
  /**
   * Returns the current value of a global graph output
   */
  getOutputData(name2) {
    const output = this.outputs[name2];
    if (!output) return null;
    return output.value;
  }
  /**
   * Renames a global graph output
   */
  renameOutput(old_name, name2) {
    if (!this.outputs[old_name]) return false;
    if (this.outputs[name2]) {
      console.error("there is already one output with that name");
      return false;
    }
    this.outputs[name2] = this.outputs[old_name];
    delete this.outputs[old_name];
    this._version++;
    this.onOutputRenamed?.(old_name, name2);
    this.onInputsOutputsChange?.();
  }
  /**
   * Changes the type of a global graph output
   */
  changeOutputType(name2, type) {
    if (!this.outputs[name2]) return false;
    if (this.outputs[name2].type && String(this.outputs[name2].type).toLowerCase() == String(type).toLowerCase()) {
      return;
    }
    this.outputs[name2].type = type;
    this._version++;
    this.onOutputTypeChanged?.(name2, type);
  }
  /**
   * Removes a global graph output
   */
  removeOutput(name2) {
    if (!this.outputs[name2]) return false;
    delete this.outputs[name2];
    this._version++;
    this.onOutputRemoved?.(name2);
    this.onInputsOutputsChange?.();
    return true;
  }
  /** @todo Clean up - never implemented. */
  triggerInput(name2, value4) {
    const nodes = this.findNodesByTitle(name2);
    for (let i2 = 0; i2 < nodes.length; ++i2) {
      nodes[i2].onTrigger(value4);
    }
  }
  /** @todo Clean up - never implemented. */
  setCallback(name2, func) {
    const nodes = this.findNodesByTitle(name2);
    for (let i2 = 0; i2 < nodes.length; ++i2) {
      nodes[i2].setTrigger(func);
    }
  }
  // used for undo, called before any change is made to the graph
  beforeChange(info) {
    this.onBeforeChange?.(this, info);
    this.canvasAction((c) => c.onBeforeChange?.(this));
  }
  // used to resend actions, called after any change is made to the graph
  afterChange(info) {
    this.onAfterChange?.(this, info);
    this.canvasAction((c) => c.onAfterChange?.(this));
  }
  connectionChange(node22) {
    this.updateExecutionOrder();
    this.onConnectionChange?.(node22);
    this._version++;
    this.canvasAction((c) => c.onConnectionChange?.());
  }
  /**
   * clears the triggered slot animation in all links (stop visual animation)
   */
  clearTriggeredSlots() {
    for (const link_info of this._links.values()) {
      if (!link_info) continue;
      if (link_info._last_time) link_info._last_time = 0;
    }
  }
  /* Called when something visually changed (not the graph!) */
  change() {
    if (LiteGraph.debug) {
      console.log("Graph changed");
    }
    this.canvasAction((c) => c.setDirty(true, true));
    this.on_change?.(this);
  }
  setDirtyCanvas(fg, bg) {
    this.canvasAction((c) => c.setDirty(fg, bg));
  }
  /**
   * Configures a reroute on the graph where ID is already known (probably deserialisation).
   * Creates the object if it does not exist.
   * @param serialisedReroute See {@link SerialisableReroute}
   */
  setReroute({ id: id3, parentId, pos: pos2, linkIds }) {
    id3 ??= ++this.state.lastRerouteId;
    if (id3 > this.state.lastRerouteId) this.state.lastRerouteId = id3;
    const reroute = this.reroutes.get(id3) ?? new Reroute(id3, this);
    reroute.update(parentId, pos2, linkIds);
    this.reroutes.set(id3, reroute);
    return reroute;
  }
  /**
   * Creates a new reroute and adds it to the graph.
   * @param pos Position in graph space
   * @param before The existing link segment (reroute, link) that will be after this reroute,
   * going from the node output to input.
   * @returns The newly created reroute - typically ignored.
   */
  createReroute(pos2, before) {
    const rerouteId = ++this.state.lastRerouteId;
    const linkIds = before instanceof Reroute ? before.linkIds : [before.id];
    const reroute = new Reroute(rerouteId, this, pos2, before.parentId, linkIds);
    this.reroutes.set(rerouteId, reroute);
    for (const linkId of linkIds) {
      const link2 = this._links.get(linkId);
      if (!link2) continue;
      if (link2.parentId === before.parentId) link2.parentId = rerouteId;
      LLink.getReroutes(this, link2)?.filter((x2) => x2.parentId === before.parentId).forEach((x2) => x2.parentId = rerouteId);
    }
    return reroute;
  }
  /**
   * Removes a reroute from the graph
   * @param id ID of reroute to remove
   */
  removeReroute(id3) {
    const { reroutes } = this;
    const reroute = reroutes.get(id3);
    if (!reroute) return;
    const { parentId, linkIds } = reroute;
    for (const reroute2 of reroutes.values()) {
      if (reroute2.parentId === id3) reroute2.parentId = parentId;
    }
    for (const linkId of linkIds) {
      const link2 = this._links.get(linkId);
      if (link2 && link2.parentId === id3) link2.parentId = parentId;
    }
    reroutes.delete(id3);
    this.setDirtyCanvas(false, true);
  }
  /**
   * Destroys a link
   */
  removeLink(link_id) {
    const link2 = this._links.get(link_id);
    if (!link2) return;
    const node22 = this.getNodeById(link2.target_id);
    node22?.disconnectInput(link2.target_slot);
    link2.disconnect(this);
  }
  /**
   * Creates a Object containing all the info about this graph, it can be serialized
   * @deprecated Use {@link asSerialisable}, which returns the newer schema version.
   * @returns value of the node
   */
  serialize(option3) {
    const { config: config2, state, groups, nodes, reroutes, extra } = this.asSerialisable(option3);
    const linkArray = [...this._links.values()];
    const links = linkArray.map((x2) => x2.serialize());
    if (reroutes.length) {
      extra.reroutes = reroutes;
      extra.linkExtensions = linkArray.filter((x2) => x2.parentId !== void 0).map((x2) => ({ id: x2.id, parentId: x2.parentId }));
    }
    return {
      last_node_id: state.lastNodeId,
      last_link_id: state.lastLinkId,
      nodes,
      links,
      groups,
      config: config2,
      extra,
      version: LiteGraph.VERSION
    };
  }
  /**
   * Prepares a shallow copy of this object for immediate serialisation or structuredCloning.
   * The return value should be discarded immediately.
   * @param options Serialise options = currently `sortNodes: boolean`, whether to sort nodes by ID.
   * @returns A shallow copy of parts of this graph, with shallow copies of its serialisable objects.
   * Mutating the properties of the return object may result in changes to your graph.
   * It is intended for use with {@link structuredClone} or {@link JSON.stringify}.
   */
  asSerialisable(options4) {
    const { config: config2, state, extra } = this;
    const nodeList = !LiteGraph.use_uuids && options4?.sortNodes ? [...this._nodes].sort((a, b) => a.id - b.id) : this._nodes;
    const nodes = nodeList.map((node22) => node22.serialize());
    const groups = this._groups.map((x2) => x2.serialize());
    const links = [...this._links.values()].map((x2) => x2.asSerialisable());
    const reroutes = [...this.reroutes.values()].map((x2) => x2.asSerialisable());
    const data24 = {
      version: LGraph2.serialisedSchemaVersion,
      config: config2,
      state,
      groups,
      nodes,
      links,
      reroutes,
      extra
    };
    this.onSerialize?.(data24);
    return data24;
  }
  /**
   * Configure a graph from a JSON string
   * @param data The deserialised object to configure this graph from
   * @param keep_old If `true`, the graph will not be cleared prior to
   * adding the configuration.
   */
  configure(data24, keep_old) {
    if (!data24) return;
    if (!keep_old) this.clear();
    const { extra } = data24;
    let reroutes;
    if (data24.version === 0.4) {
      if (Array.isArray(data24.links)) {
        for (const linkData of data24.links) {
          const link2 = LLink.createFromArray(linkData);
          this._links.set(link2.id, link2);
        }
      }
      if (Array.isArray(extra?.linkExtensions)) {
        for (const linkEx of extra.linkExtensions) {
          const link2 = this._links.get(linkEx.id);
          if (link2) link2.parentId = linkEx.parentId;
        }
      }
      reroutes = extra?.reroutes;
    } else {
      if (data24.state) {
        const { state: { lastGroupId, lastLinkId, lastNodeId, lastRerouteId } } = data24;
        if (lastGroupId != null) this.state.lastGroupId = lastGroupId;
        if (lastLinkId != null) this.state.lastLinkId = lastLinkId;
        if (lastNodeId != null) this.state.lastNodeId = lastNodeId;
        if (lastRerouteId != null) this.state.lastRerouteId = lastRerouteId;
      }
      if (Array.isArray(data24.links)) {
        for (const linkData of data24.links) {
          const link2 = LLink.create(linkData);
          this._links.set(link2.id, link2);
        }
      }
      reroutes = data24.reroutes;
    }
    if (Array.isArray(reroutes)) {
      for (const rerouteData of reroutes) {
        const reroute = this.setReroute(rerouteData);
        if (!reroute.validateLinks(this._links))
          this.reroutes.delete(rerouteData.id);
      }
    }
    const nodesData = data24.nodes;
    for (const i2 in data24) {
      if (i2 == "nodes" || i2 == "groups" || i2 == "links" || i2 === "state" || i2 === "reroutes")
        continue;
      this[i2] = data24[i2];
    }
    let error2 = false;
    this._nodes = [];
    if (nodesData) {
      for (let i2 = 0, l = nodesData.length; i2 < l; ++i2) {
        const n_info = nodesData[i2];
        let node22 = LiteGraph.createNode(n_info.type, n_info.title);
        if (!node22) {
          if (LiteGraph.debug) console.log("Node not found or has errors: " + n_info.type);
          node22 = new LGraphNode(void 0);
          node22.last_serialization = n_info;
          node22.has_errors = true;
          error2 = true;
        }
        node22.id = n_info.id;
        this.add(node22, true);
      }
      for (let i2 = 0, l = nodesData.length; i2 < l; ++i2) {
        const n_info = nodesData[i2];
        const node22 = this.getNodeById(n_info.id);
        node22?.configure(n_info);
      }
    }
    this._groups.length = 0;
    if (data24.groups) {
      for (let i2 = 0; i2 < data24.groups.length; ++i2) {
        const group = new LiteGraph.LGraphGroup();
        group.configure(data24.groups[i2]);
        this.add(group);
      }
    }
    this.updateExecutionOrder();
    this.extra = data24.extra || {};
    this.onConfigure?.(data24);
    this._version++;
    this.setDirtyCanvas(true, true);
    return error2;
  }
  load(url, callback) {
    const that = this;
    if (url instanceof Blob || url instanceof File) {
      const reader = new FileReader();
      reader.addEventListener("load", function(event) {
        const data24 = JSON.parse(event.target.result.toString());
        that.configure(data24);
        callback?.();
      });
      reader.readAsText(url);
      return;
    }
    const req = new XMLHttpRequest();
    req.open("GET", url, true);
    req.send(null);
    req.onload = function() {
      if (req.status !== 200) {
        console.error("Error loading graph:", req.status, req.response);
        return;
      }
      const data24 = JSON.parse(req.response);
      that.configure(data24);
      callback?.();
    };
    req.onerror = function(err) {
      console.error("Error loading graph:", err);
    };
  }
  onNodeTrace(node22, msg) {
  }
};
class ContextMenu {
  static {
    __name(this, "ContextMenu");
  }
  options;
  parentMenu;
  root;
  current_submenu;
  lock;
  /**
   * @todo Interface for values requires functionality change - currently accepts
   * an array of strings, functions, objects, nulls, or undefined.
   * @param values (allows object { title: "Nice text", callback: function ... })
   * @param options [optional] Some options:\
   * - title: title to show on top of the menu
   * - callback: function to call when an option is clicked, it receives the item information
   * - ignore_item_callbacks: ignores the callback inside the item, it just calls the options.callback
   * - event: you can pass a MouseEvent, this way the ContextMenu appears in that position
   */
  constructor(values, options4) {
    options4 ||= {};
    this.options = options4;
    const parent = options4.parentMenu;
    if (parent) {
      if (!(parent instanceof ContextMenu)) {
        console.error("parentMenu must be of class ContextMenu, ignoring it");
        options4.parentMenu = null;
      } else {
        this.parentMenu = parent;
        this.parentMenu.lock = true;
        this.parentMenu.current_submenu = this;
      }
      if (parent.options?.className === "dark") {
        options4.className = "dark";
      }
    }
    const eventClass = options4.event ? options4.event.constructor.name : null;
    if (eventClass !== "MouseEvent" && eventClass !== "CustomEvent" && eventClass !== "PointerEvent") {
      console.error(`Event passed to ContextMenu is not of type MouseEvent or CustomEvent. Ignoring it. (${eventClass})`);
      options4.event = null;
    }
    const root24 = document.createElement("div");
    let classes2 = "litegraph litecontextmenu litemenubar-panel";
    if (options4.className) classes2 += " " + options4.className;
    root24.className = classes2;
    root24.style.minWidth = "100";
    root24.style.minHeight = "100";
    root24.style.pointerEvents = "none";
    setTimeout(function() {
      root24.style.pointerEvents = "auto";
    }, 100);
    LiteGraph.pointerListenerAdd(
      root24,
      "up",
      function(e2) {
        e2.preventDefault();
        return true;
      },
      true
    );
    root24.addEventListener(
      "contextmenu",
      function(e2) {
        if (e2.button != 2) return false;
        e2.preventDefault();
        return false;
      },
      true
    );
    LiteGraph.pointerListenerAdd(
      root24,
      "down",
      (e2) => {
        if (e2.button == 2) {
          this.close();
          e2.preventDefault();
          return true;
        }
      },
      true
    );
    this.root = root24;
    if (options4.title) {
      const element = document.createElement("div");
      element.className = "litemenu-title";
      element.innerHTML = options4.title;
      root24.appendChild(element);
    }
    for (let i2 = 0; i2 < values.length; i2++) {
      const value4 = values[i2];
      let name2 = Array.isArray(values) ? value4 : String(i2);
      if (typeof name2 !== "string") {
        name2 = name2 != null ? name2.content === void 0 ? String(name2) : name2.content : name2;
      }
      this.addItem(name2, value4, options4);
    }
    LiteGraph.pointerListenerAdd(root24, "enter", function() {
      if (root24.closing_timer) {
        clearTimeout(root24.closing_timer);
      }
    });
    const ownerDocument = (options4.event?.target).ownerDocument;
    const root_document = ownerDocument || document;
    if (root_document.fullscreenElement)
      root_document.fullscreenElement.appendChild(root24);
    else
      root_document.body.appendChild(root24);
    let left = options4.left || 0;
    let top = options4.top || 0;
    if (options4.event) {
      left = options4.event.clientX - 10;
      top = options4.event.clientY - 10;
      if (options4.title) top -= 20;
      if (parent) {
        const rect = parent.root.getBoundingClientRect();
        left = rect.left + rect.width;
      }
      const body_rect = document.body.getBoundingClientRect();
      const root_rect = root24.getBoundingClientRect();
      if (body_rect.height == 0)
        console.error("document.body height is 0. That is dangerous, set html,body { height: 100%; }");
      if (body_rect.width && left > body_rect.width - root_rect.width - 10)
        left = body_rect.width - root_rect.width - 10;
      if (body_rect.height && top > body_rect.height - root_rect.height - 10)
        top = body_rect.height - root_rect.height - 10;
    }
    root24.style.left = left + "px";
    root24.style.top = top + "px";
    if (options4.scale) root24.style.transform = `scale(${Math.round(options4.scale * 4) * 0.25})`;
  }
  addItem(name2, value4, options4) {
    options4 ||= {};
    const element = document.createElement("div");
    element.className = "litemenu-entry submenu";
    let disabled2 = false;
    if (value4 === null) {
      element.classList.add("separator");
    } else {
      if (typeof value4 === "string") {
        element.innerHTML = name2;
      } else {
        element.innerHTML = value4?.title ?? name2;
        if (value4.disabled) {
          disabled2 = true;
          element.classList.add("disabled");
          element.setAttribute("aria-disabled", "true");
        }
        if (value4.submenu || value4.has_submenu) {
          element.classList.add("has_submenu");
          element.setAttribute("aria-haspopup", "true");
          element.setAttribute("aria-expanded", "false");
        }
        if (value4.className) element.className += " " + value4.className;
      }
      element.value = value4;
      element.setAttribute("role", "menuitem");
      if (typeof value4 === "function") {
        element.dataset["value"] = name2;
        element.onclick_callback = value4;
      } else {
        element.dataset["value"] = String(value4);
      }
    }
    this.root.appendChild(element);
    if (!disabled2) element.addEventListener("click", inner_onclick);
    if (!disabled2 && options4.autoopen)
      LiteGraph.pointerListenerAdd(element, "enter", inner_over);
    const setAriaExpanded = /* @__PURE__ */ __name(() => {
      const entries = this.root.querySelectorAll("div.litemenu-entry.has_submenu");
      if (entries) {
        for (let i2 = 0; i2 < entries.length; i2++) {
          entries[i2].setAttribute("aria-expanded", "false");
        }
      }
      element.setAttribute("aria-expanded", "true");
    }, "setAriaExpanded");
    function inner_over(e2) {
      const value22 = this.value;
      if (!value22 || !value22.has_submenu) return;
      inner_onclick.call(this, e2);
      setAriaExpanded();
    }
    __name(inner_over, "inner_over");
    const that = this;
    function inner_onclick(e2) {
      const value22 = this.value;
      let close_parent = true;
      that.current_submenu?.close(e2);
      if (value22?.has_submenu || value22?.submenu) {
        setAriaExpanded();
      }
      if (options4.callback) {
        const r = options4.callback.call(
          this,
          value22,
          options4,
          e2,
          that,
          options4.node
        );
        if (r === true) close_parent = false;
      }
      if (typeof value22 === "object") {
        if (value22.callback && !options4.ignore_item_callbacks && value22.disabled !== true) {
          const r = value22.callback.call(
            this,
            value22,
            options4,
            e2,
            that,
            options4.extra
          );
          if (r === true) close_parent = false;
        }
        if (value22.submenu) {
          if (!value22.submenu.options) throw "ContextMenu submenu needs options";
          new that.constructor(value22.submenu.options, {
            callback: value22.submenu.callback,
            event: e2,
            parentMenu: that,
            ignore_item_callbacks: value22.submenu.ignore_item_callbacks,
            title: value22.submenu.title,
            extra: value22.submenu.extra,
            autoopen: options4.autoopen
          });
          close_parent = false;
        }
      }
      if (close_parent && !that.lock) that.close();
    }
    __name(inner_onclick, "inner_onclick");
    return element;
  }
  close(e2, ignore_parent_menu) {
    this.root.remove();
    if (this.parentMenu && !ignore_parent_menu) {
      this.parentMenu.lock = false;
      this.parentMenu.current_submenu = null;
      if (e2 === void 0) {
        this.parentMenu.close();
      } else if (e2 && !ContextMenu.isCursorOverElement(e2, this.parentMenu.root)) {
        ContextMenu.trigger(
          this.parentMenu.root,
          LiteGraph.pointerevents_method + "leave",
          e2
        );
      }
    }
    this.current_submenu?.close(e2, true);
    if (this.root.closing_timer) clearTimeout(this.root.closing_timer);
  }
  // this code is used to trigger events easily (used in the context menu mouseleave
  static trigger(element, event_name, params, origin2) {
    const evt = document.createEvent("CustomEvent");
    evt.initCustomEvent(event_name, true, true, params);
    if (element.dispatchEvent) element.dispatchEvent(evt);
    else if (element.__events) element.__events.dispatchEvent(evt);
    return evt;
  }
  // returns the top most menu
  getTopMenu() {
    return this.options.parentMenu ? this.options.parentMenu.getTopMenu() : this;
  }
  getFirstEvent() {
    return this.options.parentMenu ? this.options.parentMenu.getFirstEvent() : this.options.event;
  }
  static isCursorOverElement(event, element) {
    const left = event.clientX;
    const top = event.clientY;
    const rect = element.getBoundingClientRect();
    if (!rect) return false;
    if (top > rect.top && top < rect.top + rect.height && left > rect.left && left < rect.left + rect.width) {
      return true;
    }
    return false;
  }
}
class CurveEditor {
  static {
    __name(this, "CurveEditor");
  }
  points;
  selected;
  nearest;
  size;
  must_update;
  margin;
  _nearest;
  constructor(points) {
    this.points = points;
    this.selected = -1;
    this.nearest = -1;
    this.size = null;
    this.must_update = true;
    this.margin = 5;
  }
  static sampleCurve(f, points) {
    if (!points) return;
    for (let i2 = 0; i2 < points.length - 1; ++i2) {
      const p2 = points[i2];
      const pn = points[i2 + 1];
      if (pn[0] < f) continue;
      const r = pn[0] - p2[0];
      if (Math.abs(r) < 1e-5) return p2[1];
      const local_f = (f - p2[0]) / r;
      return p2[1] * (1 - local_f) + pn[1] * local_f;
    }
    return 0;
  }
  draw(ctx, size2, graphcanvas, background_color, line_color, inactive = false) {
    const points = this.points;
    if (!points) return;
    this.size = size2;
    const w = size2[0] - this.margin * 2;
    const h2 = size2[1] - this.margin * 2;
    line_color = line_color || "#666";
    ctx.save();
    ctx.translate(this.margin, this.margin);
    if (background_color) {
      ctx.fillStyle = "#111";
      ctx.fillRect(0, 0, w, h2);
      ctx.fillStyle = "#222";
      ctx.fillRect(w * 0.5, 0, 1, h2);
      ctx.strokeStyle = "#333";
      ctx.strokeRect(0, 0, w, h2);
    }
    ctx.strokeStyle = line_color;
    if (inactive) ctx.globalAlpha = 0.5;
    ctx.beginPath();
    for (let i2 = 0; i2 < points.length; ++i2) {
      const p2 = points[i2];
      ctx.lineTo(p2[0] * w, (1 - p2[1]) * h2);
    }
    ctx.stroke();
    ctx.globalAlpha = 1;
    if (!inactive)
      for (let i2 = 0; i2 < points.length; ++i2) {
        const p2 = points[i2];
        ctx.fillStyle = this.selected == i2 ? "#FFF" : this.nearest == i2 ? "#DDD" : "#AAA";
        ctx.beginPath();
        ctx.arc(p2[0] * w, (1 - p2[1]) * h2, 2, 0, Math.PI * 2);
        ctx.fill();
      }
    ctx.restore();
  }
  // localpos is mouse in curve editor space
  onMouseDown(localpos, graphcanvas) {
    const points = this.points;
    if (!points) return;
    if (localpos[1] < 0) return;
    const w = this.size[0] - this.margin * 2;
    const h2 = this.size[1] - this.margin * 2;
    const x2 = localpos[0] - this.margin;
    const y2 = localpos[1] - this.margin;
    const pos2 = [x2, y2];
    const max_dist = 30 / graphcanvas.ds.scale;
    this.selected = this.getCloserPoint(pos2, max_dist);
    if (this.selected == -1) {
      const point = [x2 / w, 1 - y2 / h2];
      points.push(point);
      points.sort(function(a, b) {
        return a[0] - b[0];
      });
      this.selected = points.indexOf(point);
      this.must_update = true;
    }
    if (this.selected != -1) return true;
  }
  onMouseMove(localpos, graphcanvas) {
    const points = this.points;
    if (!points) return;
    const s = this.selected;
    if (s < 0) return;
    const x2 = (localpos[0] - this.margin) / (this.size[0] - this.margin * 2);
    const y2 = (localpos[1] - this.margin) / (this.size[1] - this.margin * 2);
    const curvepos = [
      localpos[0] - this.margin,
      localpos[1] - this.margin
    ];
    const max_dist = 30 / graphcanvas.ds.scale;
    this._nearest = this.getCloserPoint(curvepos, max_dist);
    const point = points[s];
    if (point) {
      const is_edge_point = s == 0 || s == points.length - 1;
      if (!is_edge_point && (localpos[0] < -10 || localpos[0] > this.size[0] + 10 || localpos[1] < -10 || localpos[1] > this.size[1] + 10)) {
        points.splice(s, 1);
        this.selected = -1;
        return;
      }
      if (!is_edge_point) point[0] = clamp$1(x2, 0, 1);
      else point[0] = s == 0 ? 0 : 1;
      point[1] = 1 - clamp$1(y2, 0, 1);
      points.sort(function(a, b) {
        return a[0] - b[0];
      });
      this.selected = points.indexOf(point);
      this.must_update = true;
    }
  }
  // Former params: localpos, graphcanvas
  onMouseUp() {
    this.selected = -1;
    return false;
  }
  getCloserPoint(pos2, max_dist) {
    const points = this.points;
    if (!points) return -1;
    max_dist = max_dist || 30;
    const w = this.size[0] - this.margin * 2;
    const h2 = this.size[1] - this.margin * 2;
    const num = points.length;
    const p2 = [0, 0];
    let min_dist = 1e6;
    let closest = -1;
    for (let i2 = 0; i2 < num; ++i2) {
      const p3 = points[i2];
      p2[0] = p3[0] * w;
      p2[1] = (1 - p3[1]) * h2;
      const dist3 = distance(pos2, p2);
      if (dist3 > min_dist || dist3 > max_dist) continue;
      closest = i2;
      min_dist = dist3;
    }
    return closest;
  }
}
class LiteGraphGlobal {
  static {
    __name(this, "LiteGraphGlobal");
  }
  // Enums
  SlotShape = SlotShape;
  SlotDirection = SlotDirection;
  SlotType = SlotType;
  LabelPosition = LabelPosition;
  /** Used in serialised graphs at one point. */
  VERSION = 0.4;
  CANVAS_GRID_SIZE = 10;
  NODE_TITLE_HEIGHT = 30;
  NODE_TITLE_TEXT_Y = 20;
  NODE_SLOT_HEIGHT = 20;
  NODE_WIDGET_HEIGHT = 20;
  NODE_WIDTH = 140;
  NODE_MIN_WIDTH = 50;
  NODE_COLLAPSED_RADIUS = 10;
  NODE_COLLAPSED_WIDTH = 80;
  NODE_TITLE_COLOR = "#999";
  NODE_SELECTED_TITLE_COLOR = "#FFF";
  NODE_TEXT_SIZE = 14;
  NODE_TEXT_COLOR = "#AAA";
  NODE_TEXT_HIGHLIGHT_COLOR = "#EEE";
  NODE_SUBTEXT_SIZE = 12;
  NODE_DEFAULT_COLOR = "#333";
  NODE_DEFAULT_BGCOLOR = "#353535";
  NODE_DEFAULT_BOXCOLOR = "#666";
  NODE_DEFAULT_SHAPE = RenderShape.ROUND;
  NODE_BOX_OUTLINE_COLOR = "#FFF";
  NODE_ERROR_COLOUR = "#E00";
  DEFAULT_SHADOW_COLOR = "rgba(0,0,0,0.5)";
  DEFAULT_GROUP_FONT = 24;
  DEFAULT_GROUP_FONT_SIZE;
  WIDGET_BGCOLOR = "#222";
  WIDGET_OUTLINE_COLOR = "#666";
  WIDGET_ADVANCED_OUTLINE_COLOR = "rgba(56, 139, 253, 0.8)";
  WIDGET_TEXT_COLOR = "#DDD";
  WIDGET_SECONDARY_TEXT_COLOR = "#999";
  LINK_COLOR = "#9A9";
  // TODO: This is a workaround until LGraphCanvas.link_type_colors is no longer static.
  static DEFAULT_EVENT_LINK_COLOR = "#A86";
  EVENT_LINK_COLOR = "#A86";
  CONNECTING_LINK_COLOR = "#AFA";
  /** avoid infinite loops */
  MAX_NUMBER_OF_NODES = 1e4;
  /** default node position */
  DEFAULT_POSITION = [100, 100];
  /** ,"circle" */
  VALID_SHAPES = ["default", "box", "round", "card"];
  // shapes are used for nodes but also for slots
  BOX_SHAPE = RenderShape.BOX;
  ROUND_SHAPE = RenderShape.ROUND;
  CIRCLE_SHAPE = RenderShape.CIRCLE;
  CARD_SHAPE = RenderShape.CARD;
  ARROW_SHAPE = RenderShape.ARROW;
  /** intended for slot arrays */
  GRID_SHAPE = RenderShape.GRID;
  // enums
  INPUT = NodeSlotType.INPUT;
  OUTPUT = NodeSlotType.OUTPUT;
  // TODO: -1 can lead to ambiguity in JS; these should be updated to a more explicit constant or Symbol.
  /** for outputs */
  EVENT = -1;
  /** for inputs */
  ACTION = -1;
  /** helper, will add "On Request" and more in the future */
  NODE_MODES = ["Always", "On Event", "Never", "On Trigger"];
  /** use with node_box_coloured_by_mode */
  NODE_MODES_COLORS = ["#666", "#422", "#333", "#224", "#626"];
  ALWAYS = LGraphEventMode.ALWAYS;
  ON_EVENT = LGraphEventMode.ON_EVENT;
  NEVER = LGraphEventMode.NEVER;
  ON_TRIGGER = LGraphEventMode.ON_TRIGGER;
  UP = LinkDirection.UP;
  DOWN = LinkDirection.DOWN;
  LEFT = LinkDirection.LEFT;
  RIGHT = LinkDirection.RIGHT;
  CENTER = LinkDirection.CENTER;
  /** helper */
  LINK_RENDER_MODES = ["Straight", "Linear", "Spline"];
  HIDDEN_LINK = LinkRenderType.HIDDEN_LINK;
  STRAIGHT_LINK = LinkRenderType.STRAIGHT_LINK;
  LINEAR_LINK = LinkRenderType.LINEAR_LINK;
  SPLINE_LINK = LinkRenderType.SPLINE_LINK;
  NORMAL_TITLE = TitleMode.NORMAL_TITLE;
  NO_TITLE = TitleMode.NO_TITLE;
  TRANSPARENT_TITLE = TitleMode.TRANSPARENT_TITLE;
  AUTOHIDE_TITLE = TitleMode.AUTOHIDE_TITLE;
  /** arrange nodes vertically */
  VERTICAL_LAYOUT = "vertical";
  /** used to redirect calls */
  proxy = null;
  node_images_path = "";
  debug = false;
  catch_exceptions = true;
  throw_errors = true;
  allow_scripts = false;
  // if set to true some nodes like Formula would be allowed to evaluate code that comes from unsafe sources (like node configuration), which could lead to exploits
  /** nodetypes by string */
  registered_node_types = {};
  /** used for dropping files in the canvas */
  node_types_by_file_extension = {};
  /** node types by classname */
  Nodes = {};
  /** used to store vars between graphs */
  Globals = {};
  /** used to add extra features to the search box */
  searchbox_extras = {};
  /** [true!] If set to true, will automatically sort node types / categories in the context menus */
  auto_sort_node_types = false;
  /** [true!] this make the nodes box (top left circle) coloured when triggered (execute/action), visual feedback */
  node_box_coloured_when_on = false;
  /** [true!] nodebox based on node mode, visual feedback */
  node_box_coloured_by_mode = false;
  /** [false on mobile] better true if not touch device, TODO add an helper/listener to close if false */
  dialog_close_on_mouse_leave = false;
  dialog_close_on_mouse_leave_delay = 500;
  /** [false!] prefer false if results too easy to break links - implement with ALT or TODO custom keys */
  shift_click_do_break_link_from = false;
  /** [false!]prefer false, way too easy to break links */
  click_do_break_link_to = false;
  /** [true!] who accidentally ctrl-alt-clicks on an in/output? nobody! that's who! */
  ctrl_alt_click_do_break_link = true;
  /** [true!] snaps links when dragging connections over valid targets */
  snaps_for_comfy = true;
  /** [true!] renders a partial border to highlight when a dragged link is snapped to a node */
  snap_highlights_node = true;
  /**
   * If `true`, items always snap to the grid - modifier keys are ignored.
   * When {@link snapToGrid} is falsy, a value of `1` is used.
   * Default: `false`
   */
  alwaysSnapToGrid;
  /**
   * When set to a positive number, when nodes are moved their positions will
   * be rounded to the nearest multiple of this value.  Half up.
   * Default: `undefined`
   * @todo Not implemented - see {@link LiteGraph.CANVAS_GRID_SIZE}
   */
  snapToGrid;
  /** [false on mobile] better true if not touch device, TODO add an helper/listener to close if false */
  search_hide_on_mouse_leave = true;
  /**
   * [true!] enable filtering slots type in the search widget
   * !requires auto_load_slot_types or manual set registered_slot_[in/out]_types and slot_types_[in/out]
   */
  search_filter_enabled = false;
  /** [true!] opens the results list when opening the search widget */
  search_show_all_on_open = true;
  /**
   * [if want false, use true, run, get vars values to be statically set, than disable]
   * nodes types and nodeclass association with node types need to be calculated,
   * if dont want this, calculate once and set registered_slot_[in/out]_types and slot_types_[in/out]
   */
  auto_load_slot_types = false;
  // set these values if not using auto_load_slot_types
  /** slot types for nodeclass */
  registered_slot_in_types = {};
  /** slot types for nodeclass */
  registered_slot_out_types = {};
  /** slot types IN */
  slot_types_in = [];
  /** slot types OUT */
  slot_types_out = [];
  /**
   * specify for each IN slot type a(/many) default node(s), use single string, array, or object
   * (with node, title, parameters, ..) like for search
   */
  slot_types_default_in = {};
  /**
   * specify for each OUT slot type a(/many) default node(s), use single string, array, or object
   * (with node, title, parameters, ..) like for search
   */
  slot_types_default_out = {};
  /** [true!] very handy, ALT click to clone and drag the new node */
  alt_drag_do_clone_nodes = false;
  /**
   * [true!] will create and connect event slots when using action/events connections,
   * !WILL CHANGE node mode when using onTrigger (enable mode colors), onExecuted does not need this
   */
  do_add_triggers_slots = false;
  /** [false!] being events, it is strongly reccomended to use them sequentially, one by one */
  allow_multi_output_for_events = true;
  /** [true!] allows to create and connect a ndoe clicking with the third button (wheel) */
  middle_click_slot_add_default_node = false;
  /** [true!] dragging a link to empty space will open a menu, add from list, search or defaults */
  release_link_on_empty_shows_menu = false;
  /** "mouse"|"pointer" use mouse for retrocompatibility issues? (none found @ now) */
  pointerevents_method = "pointer";
  /**
   * [true!] allows ctrl + shift + v to paste nodes with the outputs of the unselected nodes connected
   * with the inputs of the newly pasted nodes
   */
  ctrl_shift_v_paste_connect_unselected_outputs = true;
  // if true, all newly created nodes/links will use string UUIDs for their id fields instead of integers.
  // use this if you must have node IDs that are unique across all graphs and subgraphs.
  use_uuids = false;
  // Whether to highlight the bounding box of selected groups
  highlight_selected_group = true;
  /** If `true`, the old "eye-melting-red" error indicator will be used for nodes */
  use_legacy_node_error_indicator = false;
  // TODO: Remove legacy accessors
  LGraph = LGraph$1;
  LLink = LLink;
  LGraphNode = LGraphNode;
  LGraphGroup = LGraphGroup;
  DragAndScale = DragAndScale;
  LGraphCanvas = LGraphCanvas;
  ContextMenu = ContextMenu;
  CurveEditor = CurveEditor;
  Reroute = Reroute;
  static {
    LGraphCanvas.link_type_colors = {
      "-1": LiteGraphGlobal.DEFAULT_EVENT_LINK_COLOR,
      "number": "#AAA",
      "node": "#DCA"
    };
  }
  constructor() {
    if (typeof performance != "undefined") {
      this.getTime = performance.now.bind(performance);
    } else if (typeof Date != "undefined" && Date.now) {
      this.getTime = Date.now.bind(Date);
    } else if (typeof process != "undefined") {
      this.getTime = function() {
        const t2 = process.hrtime();
        return t2[0] * 1e-3 + t2[1] * 1e-6;
      };
    } else {
      this.getTime = function() {
        return (/* @__PURE__ */ new Date()).getTime();
      };
    }
  }
  /**
   * Register a node class so it can be listed when the user wants to create a new one
   * @param type name of the node and path
   * @param base_class class containing the structure of a node
   */
  registerNodeType(type, base_class) {
    if (!base_class.prototype)
      throw "Cannot register a simple object, it must be a class with a prototype";
    base_class.type = type;
    if (this.debug) console.log("Node registered: " + type);
    const classname = base_class.name;
    const pos2 = type.lastIndexOf("/");
    base_class.category = type.substring(0, pos2);
    base_class.title ||= classname;
    for (const i2 in LGraphNode.prototype) {
      base_class.prototype[i2] ||= LGraphNode.prototype[i2];
    }
    const prev2 = this.registered_node_types[type];
    if (prev2) {
      console.log("replacing node type: " + type);
    }
    if (!Object.prototype.hasOwnProperty.call(base_class.prototype, "shape")) {
      Object.defineProperty(base_class.prototype, "shape", {
        set(v2) {
          switch (v2) {
            case "default":
              delete this._shape;
              break;
            case "box":
              this._shape = RenderShape.BOX;
              break;
            case "round":
              this._shape = RenderShape.ROUND;
              break;
            case "circle":
              this._shape = RenderShape.CIRCLE;
              break;
            case "card":
              this._shape = RenderShape.CARD;
              break;
            default:
              this._shape = v2;
          }
        },
        get() {
          return this._shape;
        },
        enumerable: true,
        configurable: true
      });
      if (base_class.supported_extensions) {
        for (const i2 in base_class.supported_extensions) {
          const ext = base_class.supported_extensions[i2];
          if (ext && typeof ext === "string") {
            this.node_types_by_file_extension[ext.toLowerCase()] = base_class;
          }
        }
      }
    }
    this.registered_node_types[type] = base_class;
    if (base_class.constructor.name) this.Nodes[classname] = base_class;
    this.onNodeTypeRegistered?.(type, base_class);
    if (prev2) this.onNodeTypeReplaced?.(type, base_class, prev2);
    if (base_class.prototype.onPropertyChange)
      console.warn(`LiteGraph node class ${type} has onPropertyChange method, it must be called onPropertyChanged with d at the end`);
    if (this.auto_load_slot_types) new base_class(base_class.title || "tmpnode");
  }
  /**
   * removes a node type from the system
   * @param type name of the node or the node constructor itself
   */
  unregisterNodeType(type) {
    const base_class = typeof type === "string" ? this.registered_node_types[type] : type;
    if (!base_class) throw "node type not found: " + type;
    delete this.registered_node_types[base_class.type];
    const name2 = base_class.constructor.name;
    if (name2) delete this.Nodes[name2];
  }
  /**
   * Save a slot type and his node
   * @param type name of the node or the node constructor itself
   * @param slot_type name of the slot type (variable type), eg. string, number, array, boolean, ..
   */
  registerNodeAndSlotType(type, slot_type, out) {
    out ||= false;
    const base_class = typeof type === "string" && this.registered_node_types[type] !== "anonymous" ? this.registered_node_types[type] : type;
    const class_type = base_class.constructor.type;
    let allTypes = [];
    if (typeof slot_type === "string") {
      allTypes = slot_type.split(",");
    } else if (slot_type == this.EVENT || slot_type == this.ACTION) {
      allTypes = ["_event_"];
    } else {
      allTypes = ["*"];
    }
    for (let i2 = 0; i2 < allTypes.length; ++i2) {
      let slotType = allTypes[i2];
      if (slotType === "") slotType = "*";
      const registerTo = out ? "registered_slot_out_types" : "registered_slot_in_types";
      if (this[registerTo][slotType] === void 0)
        this[registerTo][slotType] = { nodes: [] };
      if (!this[registerTo][slotType].nodes.includes(class_type))
        this[registerTo][slotType].nodes.push(class_type);
      const types = out ? this.slot_types_out : this.slot_types_in;
      if (!types.includes(slotType.toLowerCase())) {
        types.push(slotType.toLowerCase());
        types.sort();
      }
    }
  }
  /**
   * Create a new nodetype by passing a function, it wraps it with a proper class and
   * generates inputs according to the parameters of the function.
   * Useful to wrap simple methods that do not require properties, and that only process some input to generate an output.
   * @param name node name with namespace (p.e.: 'math/sum')
   * @param func
   * @param param_types [optional] an array containing the type of every parameter,
   * otherwise parameters will accept any type
   * @param return_type [optional] string with the return type, otherwise it will be generic
   * @param properties [optional] properties to be configurable
   */
  wrapFunctionAsNode(name2, func, param_types, return_type, properties) {
    const params = Array(func.length);
    let code2 = "";
    const names = this.getParameterNames(func);
    for (let i2 = 0; i2 < names.length; ++i2) {
      code2 += `this.addInput('${names[i2]}',${param_types && param_types[i2] ? `'${param_types[i2]}'` : "0"});
`;
    }
    code2 += `this.addOutput('out',${return_type ? `'${return_type}'` : 0});
`;
    if (properties) code2 += `this.properties = ${JSON.stringify(properties)};
`;
    const classobj = Function(code2);
    classobj.title = name2.split("/").pop();
    classobj.desc = "Generated from " + func.name;
    classobj.prototype.onExecute = /* @__PURE__ */ __name(function onExecute() {
      for (let i2 = 0; i2 < params.length; ++i2) {
        params[i2] = this.getInputData(i2);
      }
      const r = func.apply(this, params);
      this.setOutputData(0, r);
    }, "onExecute");
    this.registerNodeType(name2, classobj);
  }
  /**
   * Removes all previously registered node's types
   */
  clearRegisteredTypes() {
    this.registered_node_types = {};
    this.node_types_by_file_extension = {};
    this.Nodes = {};
    this.searchbox_extras = {};
  }
  /**
   * Adds this method to all nodetypes, existing and to be created
   * (You can add it to LGraphNode.prototype but then existing node types wont have it)
   */
  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
  addNodeMethod(name2, func) {
    LGraphNode.prototype[name2] = func;
    for (const i2 in this.registered_node_types) {
      const type = this.registered_node_types[i2];
      if (type.prototype[name2]) type.prototype["_" + name2] = type.prototype[name2];
      type.prototype[name2] = func;
    }
  }
  /**
   * Create a node of a given type with a name. The node is not attached to any graph yet.
   * @param type full name of the node class. p.e. "math/sin"
   * @param title a name to distinguish from other nodes
   * @param options to set options
   */
  createNode(type, title, options4) {
    const base_class = this.registered_node_types[type];
    if (!base_class) {
      if (this.debug) console.log(`GraphNode type "${type}" not registered.`);
      return null;
    }
    title = title || base_class.title || type;
    let node22 = null;
    if (this.catch_exceptions) {
      try {
        node22 = new base_class(title);
      } catch (err) {
        console.error(err);
        return null;
      }
    } else {
      node22 = new base_class(title);
    }
    node22.type = type;
    if (!node22.title && title) node22.title = title;
    node22.properties ||= {};
    node22.properties_info ||= [];
    node22.flags ||= {};
    node22.size ||= node22.computeSize();
    node22.pos ||= this.DEFAULT_POSITION.concat();
    node22.mode ||= LGraphEventMode.ALWAYS;
    if (options4) {
      for (const i2 in options4) {
        node22[i2] = options4[i2];
      }
    }
    node22.onNodeCreated?.();
    return node22;
  }
  /**
   * Returns a registered node type with a given name
   * @param type full name of the node class. p.e. "math/sin"
   * @returns the node class
   */
  getNodeType(type) {
    return this.registered_node_types[type];
  }
  /**
   * Returns a list of node types matching one category
   * @param category category name
   * @returns array with all the node classes
   */
  getNodeTypesInCategory(category, filter4) {
    const r = [];
    for (const i2 in this.registered_node_types) {
      const type = this.registered_node_types[i2];
      if (type.filter != filter4) continue;
      if (category == "") {
        if (type.category == null) r.push(type);
      } else if (type.category == category) {
        r.push(type);
      }
    }
    if (this.auto_sort_node_types) {
      r.sort(function(a, b) {
        return a.title.localeCompare(b.title);
      });
    }
    return r;
  }
  /**
   * Returns a list with all the node type categories
   * @param filter only nodes with ctor.filter equal can be shown
   * @returns array with all the names of the categories
   */
  getNodeTypesCategories(filter4) {
    const categories = { "": 1 };
    for (const i2 in this.registered_node_types) {
      const type = this.registered_node_types[i2];
      if (type.category && !type.skip_list) {
        if (type.filter != filter4) continue;
        categories[type.category] = 1;
      }
    }
    const result = [];
    for (const i2 in categories) {
      result.push(i2);
    }
    return this.auto_sort_node_types ? result.sort() : result;
  }
  // debug purposes: reloads all the js scripts that matches a wildcard
  reloadNodes(folder_wildcard) {
    const tmp = document.getElementsByTagName("script");
    const script_files = [];
    for (let i2 = 0; i2 < tmp.length; i2++) {
      script_files.push(tmp[i2]);
    }
    const docHeadObj = document.getElementsByTagName("head")[0];
    folder_wildcard = document.location.href + folder_wildcard;
    for (let i2 = 0; i2 < script_files.length; i2++) {
      const src = script_files[i2].src;
      if (!src || src.substr(0, folder_wildcard.length) != folder_wildcard)
        continue;
      try {
        if (this.debug) console.log("Reloading: " + src);
        const dynamicScript = document.createElement("script");
        dynamicScript.type = "text/javascript";
        dynamicScript.src = src;
        docHeadObj.appendChild(dynamicScript);
        docHeadObj.removeChild(script_files[i2]);
      } catch (err) {
        if (this.throw_errors) throw err;
        if (this.debug) console.log("Error while reloading " + src);
      }
    }
    if (this.debug) console.log("Nodes reloaded");
  }
  // separated just to improve if it doesn't work
  cloneObject(obj, target) {
    if (obj == null) return null;
    const r = JSON.parse(JSON.stringify(obj));
    if (!target) return r;
    for (const i2 in r) {
      target[i2] = r[i2];
    }
    return target;
  }
  /*
   * https://gist.github.com/jed/982883?permalink_comment_id=852670#gistcomment-852670
   */
  uuidv4() {
    return ("10000000-1000-4000-8000" + -1e11).replace(/[018]/g, (a) => (a ^ Math.random() * 16 >> a / 4).toString(16));
  }
  /**
   * Returns if the types of two slots are compatible (taking into account wildcards, etc)
   * @param type_a output
   * @param type_b input
   * @returns true if they can be connected
   */
  isValidConnection(type_a, type_b) {
    if (type_a == "" || type_a === "*") type_a = 0;
    if (type_b == "" || type_b === "*") type_b = 0;
    if (!type_a || !type_b || type_a == type_b || type_a == this.EVENT && type_b == this.ACTION)
      return true;
    type_a = String(type_a);
    type_b = String(type_b);
    type_a = type_a.toLowerCase();
    type_b = type_b.toLowerCase();
    if (type_a.indexOf(",") == -1 && type_b.indexOf(",") == -1)
      return type_a == type_b;
    const supported_types_a = type_a.split(",");
    const supported_types_b = type_b.split(",");
    for (let i2 = 0; i2 < supported_types_a.length; ++i2) {
      for (let j = 0; j < supported_types_b.length; ++j) {
        if (this.isValidConnection(supported_types_a[i2], supported_types_b[j]))
          return true;
      }
    }
    return false;
  }
  /**
   * Register a string in the search box so when the user types it it will recommend this node
   * @param node_type the node recommended
   * @param description text to show next to it
   * @param data it could contain info of how the node should be configured
   */
  registerSearchboxExtra(node_type, description, data24) {
    this.searchbox_extras[description.toLowerCase()] = {
      type: node_type,
      desc: description,
      data: data24
    };
  }
  /**
   * Wrapper to load files (from url using fetch or from file using FileReader)
   * @param url the url of the file (or the file itself)
   * @param type an string to know how to fetch it: "text","arraybuffer","json","blob"
   * @param on_complete callback(data)
   * @param on_error in case of an error
   * @returns returns the object used to
   */
  fetchFile(url, type, on_complete, on_error) {
    if (!url) return null;
    type = type || "text";
    if (typeof url === "string") {
      if (url.substr(0, 4) == "http" && this.proxy)
        url = this.proxy + url.substr(url.indexOf(":") + 3);
      return fetch(url).then(function(response) {
        if (!response.ok)
          throw new Error("File not found");
        if (type == "arraybuffer")
          return response.arrayBuffer();
        else if (type == "text" || type == "string")
          return response.text();
        else if (type == "json")
          return response.json();
        else if (type == "blob")
          return response.blob();
      }).then(function(data24) {
        on_complete?.(data24);
      }).catch(function(error2) {
        console.error("error fetching file:", url);
        on_error?.(error2);
      });
    } else if (url instanceof File || url instanceof Blob) {
      const reader = new FileReader();
      reader.onload = function(e2) {
        let v2 = e2.target.result;
        if (type == "json")
          v2 = JSON.parse(v2);
        on_complete?.(v2);
      };
      if (type == "arraybuffer")
        return reader.readAsArrayBuffer(url);
      else if (type == "text" || type == "json")
        return reader.readAsText(url);
      else if (type == "blob")
        return reader.readAsBinaryString(url);
    }
    return null;
  }
  // used to create nodes from wrapping functions
  getParameterNames(func) {
    return (func + "").replace(/[/][/].*$/gm, "").replace(/\s+/g, "").replace(/[/][*][^/*]*[*][/]/g, "").split("){", 1)[0].replace(/^[^(]*[(]/, "").replace(/=[^,]+/g, "").split(",").filter(Boolean);
  }
  /* helper for interaction: pointer, touch, mouse Listeners
    used by LGraphCanvas DragAndScale ContextMenu */
  pointerListenerAdd(oDOM, sEvIn, fCall, capture = false) {
    if (!oDOM || !oDOM.addEventListener || !sEvIn || typeof fCall !== "function") return;
    let sMethod = this.pointerevents_method;
    let sEvent = sEvIn;
    if (sMethod == "pointer" && !window.PointerEvent) {
      console.warn("sMethod=='pointer' && !window.PointerEvent");
      console.log("Converting pointer[" + sEvent + "] : down move up cancel enter TO touchstart touchmove touchend, etc ..");
      switch (sEvent) {
        case "down": {
          sMethod = "touch";
          sEvent = "start";
          break;
        }
        case "move": {
          sMethod = "touch";
          break;
        }
        case "up": {
          sMethod = "touch";
          sEvent = "end";
          break;
        }
        case "cancel": {
          sMethod = "touch";
          break;
        }
        case "enter": {
          console.log("debug: Should I send a move event?");
          break;
        }
        default: {
          console.warn("PointerEvent not available in this browser ? The event " + sEvent + " would not be called");
        }
      }
    }
    switch (sEvent) {
      case "down":
      case "up":
      case "move":
      case "over":
      case "out":
      case "enter": {
        oDOM.addEventListener(sMethod + sEvent, fCall, capture);
      }
      case "leave":
      case "cancel":
      case "gotpointercapture":
      case "lostpointercapture": {
        if (sMethod != "mouse") {
          return oDOM.addEventListener(sMethod + sEvent, fCall, capture);
        }
      }
      default:
        return oDOM.addEventListener(sEvent, fCall, capture);
    }
  }
  pointerListenerRemove(oDOM, sEvent, fCall, capture = false) {
    if (!oDOM || !oDOM.removeEventListener || !sEvent || typeof fCall !== "function") return;
    switch (sEvent) {
      case "down":
      case "up":
      case "move":
      case "over":
      case "out":
      case "enter": {
        if (this.pointerevents_method == "pointer" || this.pointerevents_method == "mouse") {
          oDOM.removeEventListener(this.pointerevents_method + sEvent, fCall, capture);
        }
      }
      case "leave":
      case "cancel":
      case "gotpointercapture":
      case "lostpointercapture": {
        if (this.pointerevents_method == "pointer") {
          return oDOM.removeEventListener(this.pointerevents_method + sEvent, fCall, capture);
        }
      }
      default:
        return oDOM.removeEventListener(sEvent, fCall, capture);
    }
  }
  getTime;
  compareObjects(a, b) {
    for (const i2 in a) {
      if (a[i2] != b[i2]) return false;
    }
    return true;
  }
  distance = distance;
  colorToString(c) {
    return "rgba(" + Math.round(c[0] * 255).toFixed() + "," + Math.round(c[1] * 255).toFixed() + "," + Math.round(c[2] * 255).toFixed() + "," + (c.length == 4 ? c[3].toFixed(2) : "1.0") + ")";
  }
  isInsideRectangle = isInsideRectangle;
  // [minx,miny,maxx,maxy]
  growBounding(bounding, x2, y2) {
    if (x2 < bounding[0]) {
      bounding[0] = x2;
    } else if (x2 > bounding[2]) {
      bounding[2] = x2;
    }
    if (y2 < bounding[1]) {
      bounding[1] = y2;
    } else if (y2 > bounding[3]) {
      bounding[3] = y2;
    }
  }
  overlapBounding = overlapBounding;
  // point inside bounding box
  isInsideBounding(p2, bb) {
    if (p2[0] < bb[0][0] || p2[1] < bb[0][1] || p2[0] > bb[1][0] || p2[1] > bb[1][1]) {
      return false;
    }
    return true;
  }
  // Convert a hex value to its decimal value - the inputted hex must be in the
  // format of a hex triplet - the kind we use for HTML colours. The function
  // will return an array with three values.
  hex2num(hex) {
    if (hex.charAt(0) == "#") {
      hex = hex.slice(1);
    }
    hex = hex.toUpperCase();
    const hex_alphabets = "0123456789ABCDEF";
    const value4 = new Array(3);
    let k = 0;
    let int1, int2;
    for (let i2 = 0; i2 < 6; i2 += 2) {
      int1 = hex_alphabets.indexOf(hex.charAt(i2));
      int2 = hex_alphabets.indexOf(hex.charAt(i2 + 1));
      value4[k] = int1 * 16 + int2;
      k++;
    }
    return value4;
  }
  // Give a array with three values as the argument and the function will return
  // the corresponding hex triplet.
  num2hex(triplet) {
    const hex_alphabets = "0123456789ABCDEF";
    let hex = "#";
    let int1, int2;
    for (let i2 = 0; i2 < 3; i2++) {
      int1 = triplet[i2] / 16;
      int2 = triplet[i2] % 16;
      hex += hex_alphabets.charAt(int1) + hex_alphabets.charAt(int2);
    }
    return hex;
  }
  closeAllContextMenus(ref_window) {
    ref_window = ref_window || window;
    const elements = ref_window.document.querySelectorAll(".litecontextmenu");
    if (!elements.length) return;
    const result = [];
    for (let i2 = 0; i2 < elements.length; i2++) {
      result.push(elements[i2]);
    }
    for (let i2 = 0; i2 < result.length; i2++) {
      if (result[i2].close) {
        result[i2].close();
      } else if (result[i2].parentNode) {
        result[i2].parentNode.removeChild(result[i2]);
      }
    }
  }
  extendClass(target, origin2) {
    for (const i2 in origin2) {
      if (target.hasOwnProperty(i2)) continue;
      target[i2] = origin2[i2];
    }
    if (origin2.prototype) {
      for (const i2 in origin2.prototype) {
        if (!origin2.prototype.hasOwnProperty(i2)) continue;
        if (target.prototype.hasOwnProperty(i2)) continue;
        if (origin2.prototype.__lookupGetter__(i2)) {
          target.prototype.__defineGetter__(
            i2,
            origin2.prototype.__lookupGetter__(i2)
          );
        } else {
          target.prototype[i2] = origin2.prototype[i2];
        }
        if (origin2.prototype.__lookupSetter__(i2)) {
          target.prototype.__defineSetter__(
            i2,
            origin2.prototype.__lookupSetter__(i2)
          );
        }
      }
    }
  }
}
function loadPolyfills() {
  if (typeof window != "undefined" && window.CanvasRenderingContext2D && !window.CanvasRenderingContext2D.prototype.roundRect) {
    window.CanvasRenderingContext2D.prototype.roundRect = function(x2, y2, w, h2, radius, radius_low) {
      let top_left_radius = 0;
      let top_right_radius = 0;
      let bottom_left_radius = 0;
      let bottom_right_radius = 0;
      if (radius === 0) {
        this.rect(x2, y2, w, h2);
        return;
      }
      if (radius_low === void 0) radius_low = radius;
      if (radius != null && radius.constructor === Array) {
        if (radius.length == 1)
          top_left_radius = top_right_radius = bottom_left_radius = bottom_right_radius = radius[0];
        else if (radius.length == 2) {
          top_left_radius = bottom_right_radius = radius[0];
          top_right_radius = bottom_left_radius = radius[1];
        } else if (radius.length == 4) {
          top_left_radius = radius[0];
          top_right_radius = radius[1];
          bottom_left_radius = radius[2];
          bottom_right_radius = radius[3];
        } else {
          return;
        }
      } else {
        top_left_radius = radius || 0;
        top_right_radius = radius || 0;
        bottom_left_radius = radius_low || 0;
        bottom_right_radius = radius_low || 0;
      }
      this.moveTo(x2 + top_left_radius, y2);
      this.lineTo(x2 + w - top_right_radius, y2);
      this.quadraticCurveTo(x2 + w, y2, x2 + w, y2 + top_right_radius);
      this.lineTo(x2 + w, y2 + h2 - bottom_right_radius);
      this.quadraticCurveTo(
        x2 + w,
        y2 + h2,
        x2 + w - bottom_right_radius,
        y2 + h2
      );
      this.lineTo(x2 + bottom_right_radius, y2 + h2);
      this.quadraticCurveTo(x2, y2 + h2, x2, y2 + h2 - bottom_left_radius);
      this.lineTo(x2, y2 + bottom_left_radius);
      this.quadraticCurveTo(x2, y2, x2 + top_left_radius, y2);
    };
  }
  if (typeof window != "undefined" && !window["requestAnimationFrame"]) {
    window.requestAnimationFrame = // @ts-expect-error Legacy code
    window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
      window.setTimeout(callback, 1e3 / 60);
    };
  }
}
__name(loadPolyfills, "loadPolyfills");
const LiteGraph = new LiteGraphGlobal();
function clamp$1(v2, a, b) {
  return a > v2 ? a : b < v2 ? b : v2;
}
__name(clamp$1, "clamp$1");
loadPolyfills();
const nodeSlotSchema = z.object({
  CLIP: z.string(),
  CLIP_VISION: z.string(),
  CLIP_VISION_OUTPUT: z.string(),
  CONDITIONING: z.string(),
  CONTROL_NET: z.string(),
  IMAGE: z.string(),
  LATENT: z.string(),
  MASK: z.string(),
  MODEL: z.string(),
  STYLE_MODEL: z.string(),
  VAE: z.string(),
  NOISE: z.string(),
  GUIDER: z.string(),
  SAMPLER: z.string(),
  SIGMAS: z.string(),
  TAESD: z.string()
});
const litegraphBaseSchema = z.object({
  BACKGROUND_IMAGE: z.string(),
  CLEAR_BACKGROUND_COLOR: z.string(),
  NODE_TITLE_COLOR: z.string(),
  NODE_SELECTED_TITLE_COLOR: z.string(),
  NODE_TEXT_SIZE: z.number(),
  NODE_TEXT_COLOR: z.string(),
  NODE_SUBTEXT_SIZE: z.number(),
  NODE_DEFAULT_COLOR: z.string(),
  NODE_DEFAULT_BGCOLOR: z.string(),
  NODE_DEFAULT_BOXCOLOR: z.string(),
  NODE_DEFAULT_SHAPE: z.union([
    z.literal(LiteGraph.BOX_SHAPE),
    z.literal(LiteGraph.ROUND_SHAPE),
    z.literal(LiteGraph.CARD_SHAPE),
    // Legacy palettes have string field for NODE_DEFAULT_SHAPE.
    z.string()
  ]),
  NODE_BOX_OUTLINE_COLOR: z.string(),
  NODE_BYPASS_BGCOLOR: z.string(),
  NODE_ERROR_COLOUR: z.string(),
  DEFAULT_SHADOW_COLOR: z.string(),
  DEFAULT_GROUP_FONT: z.number(),
  WIDGET_BGCOLOR: z.string(),
  WIDGET_OUTLINE_COLOR: z.string(),
  WIDGET_TEXT_COLOR: z.string(),
  WIDGET_SECONDARY_TEXT_COLOR: z.string(),
  LINK_COLOR: z.string(),
  EVENT_LINK_COLOR: z.string(),
  CONNECTING_LINK_COLOR: z.string(),
  BADGE_FG_COLOR: z.string(),
  BADGE_BG_COLOR: z.string()
});
const comfyBaseSchema = z.object({
  ["fg-color"]: z.string(),
  ["bg-color"]: z.string(),
  ["bg-img"]: z.string().optional(),
  ["comfy-menu-bg"]: z.string(),
  ["comfy-menu-secondary-bg"]: z.string(),
  ["comfy-input-bg"]: z.string(),
  ["input-text"]: z.string(),
  ["descrip-text"]: z.string(),
  ["drag-text"]: z.string(),
  ["error-text"]: z.string(),
  ["border-color"]: z.string(),
  ["tr-even-bg-color"]: z.string(),
  ["tr-odd-bg-color"]: z.string(),
  ["content-bg"]: z.string(),
  ["content-fg"]: z.string(),
  ["content-hover-bg"]: z.string(),
  ["content-hover-fg"]: z.string(),
  ["bar-shadow"]: z.string()
});
const colorsSchema = z.object({
  node_slot: nodeSlotSchema,
  litegraph_base: litegraphBaseSchema,
  comfy_base: comfyBaseSchema
});
const partialColorsSchema = z.object({
  node_slot: nodeSlotSchema.partial(),
  litegraph_base: litegraphBaseSchema.partial(),
  comfy_base: comfyBaseSchema.partial()
});
const paletteSchema = z.object({
  id: z.string(),
  name: z.string(),
  colors: partialColorsSchema
}).passthrough();
const completedPaletteSchema = z.object({
  id: z.string(),
  name: z.string(),
  colors: colorsSchema
}).passthrough();
const colorPalettesSchema = z.record(paletteSchema);
const zNodeId = z.union([z.number().int(), z.string()]);
const zSlotIndex = z.union([
  z.number().int(),
  z.string().transform((val) => parseInt(val)).refine((val) => !isNaN(val), {
    message: "Invalid number"
  })
]);
const zDataType = z.union([z.string(), z.array(z.string()), z.number()]);
const zVector2 = z.union([
  z.object({ 0: z.number(), 1: z.number() }).passthrough().transform((v2) => [v2[0], v2[1]]),
  z.tuple([z.number(), z.number()])
]);
const zModelFile = z.object({
  name: z.string(),
  url: z.string().url(),
  hash: z.string().optional(),
  hash_type: z.string().optional(),
  directory: z.string()
});
const zGraphState = z.object({
  lastGroupid: z.number().optional(),
  lastNodeId: z.number().optional(),
  lastLinkId: z.number().optional(),
  lastRerouteId: z.number().optional()
}).passthrough();
const zComfyLink = z.tuple([
  z.number(),
  // Link id
  zNodeId,
  // Node id of source node
  zSlotIndex,
  // Output slot# of source node
  zNodeId,
  // Node id of destination node
  zSlotIndex,
  // Input slot# of destination node
  zDataType
  // Data type
]);
const zComfyLinkExtension = z.object({
  id: z.number(),
  parentId: z.number()
}).passthrough();
const zComfyLinkObject = z.object({
  id: z.number(),
  origin_id: zNodeId,
  origin_slot: zSlotIndex,
  target_id: zNodeId,
  target_slot: zSlotIndex,
  type: zDataType,
  parentId: z.number().optional()
}).passthrough();
const zReroute = z.object({
  id: z.number(),
  parentId: z.number().optional(),
  pos: zVector2,
  linkIds: z.array(z.number()).nullish()
}).passthrough();
const zNodeOutput = z.object({
  name: z.string(),
  type: zDataType,
  links: z.array(z.number()).nullable().optional(),
  slot_index: zSlotIndex.optional()
}).passthrough();
const zNodeInput = z.object({
  name: z.string(),
  type: zDataType,
  link: z.number().nullable().optional(),
  slot_index: zSlotIndex.optional()
}).passthrough();
const zFlags = z.object({
  collapsed: z.boolean().optional(),
  pinned: z.boolean().optional(),
  allow_interaction: z.boolean().optional(),
  horizontal: z.boolean().optional(),
  skip_repeated_outputs: z.boolean().optional()
}).passthrough();
const zProperties = z.object({
  ["Node name for S&R"]: z.string().optional()
}).passthrough();
const zWidgetValues = z.union([z.array(z.any()), z.record(z.any())]);
const zComfyNode = z.object({
  id: zNodeId,
  type: z.string(),
  pos: zVector2,
  size: zVector2,
  flags: zFlags,
  order: z.number(),
  mode: z.number(),
  inputs: z.array(zNodeInput).optional(),
  outputs: z.array(zNodeOutput).optional(),
  properties: zProperties,
  widgets_values: zWidgetValues.optional(),
  color: z.string().optional(),
  bgcolor: z.string().optional()
}).passthrough();
const zGroup = z.object({
  title: z.string(),
  bounding: z.tuple([z.number(), z.number(), z.number(), z.number()]),
  color: z.string().optional(),
  font_size: z.number().optional(),
  locked: z.boolean().optional()
}).passthrough();
const zInfo = z.object({
  name: z.string(),
  author: z.string(),
  description: z.string(),
  version: z.string(),
  created: z.string(),
  modified: z.string(),
  software: z.string()
}).passthrough();
const zDS = z.object({
  scale: z.number(),
  offset: zVector2
}).passthrough();
const zConfig = z.object({
  links_ontop: z.boolean().optional(),
  align_to_grid: z.boolean().optional()
}).passthrough();
const zExtra = z.object({
  ds: zDS.optional(),
  info: zInfo.optional(),
  linkExtensions: z.array(zComfyLinkExtension).optional(),
  reroutes: z.array(zReroute).optional()
}).passthrough();
const zComfyWorkflow = z.object({
  last_node_id: zNodeId,
  last_link_id: z.number(),
  nodes: z.array(zComfyNode),
  links: z.array(zComfyLink),
  groups: z.array(zGroup).optional(),
  config: zConfig.optional().nullable(),
  extra: zExtra.optional().nullable(),
  version: z.number(),
  models: z.array(zModelFile).optional()
}).passthrough();
const zComfyWorkflow1 = z.object({
  version: z.literal(1),
  config: zConfig.optional().nullable(),
  state: zGraphState,
  groups: z.array(zGroup).optional(),
  nodes: z.array(zComfyNode),
  links: z.array(zComfyLinkObject).optional(),
  reroutes: z.array(zReroute).optional(),
  extra: zExtra.optional().nullable(),
  models: z.array(zModelFile).optional()
}).passthrough();
const zWorkflowVersion = z.object({
  version: z.number()
});
async function validateComfyWorkflow(data24, onError = console.warn) {
  const versionResult = zWorkflowVersion.safeParse(data24);
  let result;
  if (!versionResult.success) {
    const error22 = fromZodError(versionResult.error);
    onError(`Workflow does not contain a valid version.  Zod error:
${error22}`);
    return null;
  } else if (versionResult.data.version === 1) {
    result = await zComfyWorkflow1.safeParseAsync(data24);
  } else {
    result = await zComfyWorkflow.safeParseAsync(data24);
  }
  if (result.success) return result.data;
  const error2 = fromZodError(result.error);
  onError(`Invalid workflow against zod schema:
${error2}`);
  return null;
}
__name(validateComfyWorkflow, "validateComfyWorkflow");
const zKeyCombo = z.object({
  key: z.string(),
  ctrl: z.boolean().optional(),
  alt: z.boolean().optional(),
  shift: z.boolean().optional(),
  meta: z.boolean().optional()
});
const zKeybinding = z.object({
  commandId: z.string(),
  combo: zKeyCombo,
  // Optional target element CSS selector to limit keybinding to.
  // Note: Currently only used to distinguish between global keybindings
  // and litegraph canvas keybindings.
  // Do NOT use this field in extensions as it has no effect.
  targetSelector: z.string().optional()
});
var NodeSourceType = /* @__PURE__ */ ((NodeSourceType2) => {
  NodeSourceType2["Core"] = "core";
  NodeSourceType2["CustomNodes"] = "custom_nodes";
  NodeSourceType2["Unknown"] = "unknown";
  return NodeSourceType2;
})(NodeSourceType || {});
const UNKNOWN_NODE_SOURCE = {
  type: "unknown",
  className: "comfy-unknown",
  displayText: "Unknown",
  badgeText: "?"
};
const shortenNodeName = /* @__PURE__ */ __name((name2) => {
  return name2.replace(/^(ComfyUI-|ComfyUI_|Comfy-|Comfy_)/, "").replace(/(-ComfyUI|_ComfyUI|-Comfy|_Comfy)$/, "");
}, "shortenNodeName");
const getNodeSource = /* @__PURE__ */ __name((python_module) => {
  if (!python_module) {
    return UNKNOWN_NODE_SOURCE;
  }
  const modules = python_module.split(".");
  if (["nodes", "comfy_extras"].includes(modules[0])) {
    return {
      type: "core",
      className: "comfy-core",
      displayText: "Comfy Core",
      badgeText: "🦊"
    };
  } else if (modules[0] === "custom_nodes") {
    const moduleName = modules[1];
    const customNodeName = moduleName.split("@")[0];
    const displayName = shortenNodeName(customNodeName);
    return {
      type: "custom_nodes",
      className: "comfy-custom-nodes",
      displayText: displayName,
      badgeText: displayName
    };
  } else {
    return UNKNOWN_NODE_SOURCE;
  }
}, "getNodeSource");
var NodeBadgeMode = /* @__PURE__ */ ((NodeBadgeMode2) => {
  NodeBadgeMode2["None"] = "None";
  NodeBadgeMode2["ShowAll"] = "Show all";
  NodeBadgeMode2["HideBuiltIn"] = "Hide built-in";
  return NodeBadgeMode2;
})(NodeBadgeMode || {});
var LinkReleaseTriggerMode = /* @__PURE__ */ ((LinkReleaseTriggerMode2) => {
  LinkReleaseTriggerMode2["ALWAYS"] = "always";
  LinkReleaseTriggerMode2["HOLD_SHIFT"] = "hold shift";
  LinkReleaseTriggerMode2["NOT_HOLD_SHIFT"] = "NOT hold shift";
  return LinkReleaseTriggerMode2;
})(LinkReleaseTriggerMode || {});
var LinkReleaseTriggerAction = /* @__PURE__ */ ((LinkReleaseTriggerAction2) => {
  LinkReleaseTriggerAction2["CONTEXT_MENU"] = "context menu";
  LinkReleaseTriggerAction2["SEARCH_BOX"] = "search box";
  LinkReleaseTriggerAction2["NO_ACTION"] = "no action";
  return LinkReleaseTriggerAction2;
})(LinkReleaseTriggerAction || {});
const zNodeType = z.string();
const zQueueIndex = z.number();
const zPromptId = z.string();
const zResultItem = z.object({
  filename: z.string().optional(),
  subfolder: z.string().optional(),
  type: z.string().optional()
});
const zOutputs = z.object({
  audio: z.array(zResultItem).optional(),
  images: z.array(zResultItem).optional(),
  animated: z.array(z.boolean()).optional()
}).passthrough();
const zStatusWsMessageStatus = z.object({
  exec_info: z.object({
    queue_remaining: z.number().int()
  })
});
const zStatusWsMessage = z.object({
  status: zStatusWsMessageStatus.nullish(),
  sid: z.string().nullish()
});
const zProgressWsMessage = z.object({
  value: z.number().int(),
  max: z.number().int(),
  prompt_id: zPromptId,
  node: zNodeId
});
const zExecutingWsMessage = z.object({
  node: zNodeId,
  display_node: zNodeId,
  prompt_id: zPromptId
});
const zExecutedWsMessage = zExecutingWsMessage.extend({
  output: zOutputs,
  merge: z.boolean().optional()
});
const zExecutionWsMessageBase = z.object({
  prompt_id: zPromptId,
  timestamp: z.number().int()
});
const zExecutionStartWsMessage = zExecutionWsMessageBase;
const zExecutionSuccessWsMessage = zExecutionWsMessageBase;
const zExecutionCachedWsMessage = zExecutionWsMessageBase.extend({
  nodes: z.array(zNodeId)
});
const zExecutionInterruptedWsMessage = zExecutionWsMessageBase.extend({
  node_id: zNodeId,
  node_type: zNodeType,
  executed: z.array(zNodeId)
});
const zExecutionErrorWsMessage = zExecutionWsMessageBase.extend({
  node_id: zNodeId,
  node_type: zNodeType,
  executed: z.array(zNodeId),
  exception_message: z.string(),
  exception_type: z.string(),
  traceback: z.array(z.string()),
  current_inputs: z.any(),
  current_outputs: z.any()
});
const zTerminalSize = z.object({
  cols: z.number(),
  row: z.number()
});
const zLogEntry = z.object({
  t: z.string(),
  m: z.string()
});
const zLogsWsMessage = z.object({
  size: zTerminalSize.optional(),
  entries: z.array(zLogEntry)
});
const zLogRawResponse = z.object({
  size: zTerminalSize,
  entries: z.array(zLogEntry)
});
const zPromptInputItem = z.object({
  inputs: z.record(z.string(), z.any()),
  class_type: zNodeType
});
const zPromptInputs = z.record(zPromptInputItem);
const zExtraPngInfo = z.object({
  workflow: zComfyWorkflow
}).passthrough();
const zExtraData = z.object({
  /** extra_pnginfo can be missing is backend execution gets a validation error. */
  extra_pnginfo: zExtraPngInfo.optional(),
  client_id: z.string()
});
const zOutputsToExecute = z.array(zNodeId);
const zExecutionStartMessage = z.tuple([
  z.literal("execution_start"),
  zExecutionStartWsMessage
]);
const zExecutionSuccessMessage = z.tuple([
  z.literal("execution_success"),
  zExecutionSuccessWsMessage
]);
const zExecutionCachedMessage = z.tuple([
  z.literal("execution_cached"),
  zExecutionCachedWsMessage
]);
const zExecutionInterruptedMessage = z.tuple([
  z.literal("execution_interrupted"),
  zExecutionInterruptedWsMessage
]);
const zExecutionErrorMessage = z.tuple([
  z.literal("execution_error"),
  zExecutionErrorWsMessage
]);
const zStatusMessage = z.union([
  zExecutionStartMessage,
  zExecutionSuccessMessage,
  zExecutionCachedMessage,
  zExecutionInterruptedMessage,
  zExecutionErrorMessage
]);
const zStatus = z.object({
  status_str: z.enum(["success", "error"]),
  completed: z.boolean(),
  messages: z.array(zStatusMessage)
});
const zTaskPrompt = z.tuple([
  zQueueIndex,
  zPromptId,
  zPromptInputs,
  zExtraData,
  zOutputsToExecute
]);
const zRunningTaskItem = z.object({
  taskType: z.literal("Running"),
  prompt: zTaskPrompt,
  // @Deprecated
  remove: z.object({
    name: z.literal("Cancel"),
    cb: z.function()
  })
});
const zPendingTaskItem = z.object({
  taskType: z.literal("Pending"),
  prompt: zTaskPrompt
});
const zTaskOutput = z.record(zNodeId, zOutputs);
const zNodeOutputsMeta = z.object({
  node_id: zNodeId,
  display_node: zNodeId,
  prompt_id: zPromptId.optional(),
  read_node_id: zNodeId.optional()
});
const zTaskMeta = z.record(zNodeId, zNodeOutputsMeta);
const zHistoryTaskItem = z.object({
  taskType: z.literal("History"),
  prompt: zTaskPrompt,
  status: zStatus.optional(),
  outputs: zTaskOutput,
  meta: zTaskMeta.optional()
});
const zTaskItem = z.union([
  zRunningTaskItem,
  zPendingTaskItem,
  zHistoryTaskItem
]);
const zTaskType = z.union([
  z.literal("Running"),
  z.literal("Pending"),
  z.literal("History")
]);
function validateTaskItem(taskItem) {
  const result = zTaskItem.safeParse(taskItem);
  if (!result.success) {
    const zodError = fromZodError(result.error);
    console.warn(
      `Invalid TaskItem: ${JSON.stringify(taskItem)}
${zodError.message}`
    );
  }
  return result;
}
__name(validateTaskItem, "validateTaskItem");
function inputSpec(spec, allowUpcast = true) {
  const [inputType, inputSpec2] = spec;
  const upcastTypes = allowUpcast ? [inputType.transform((type) => [type, {}])] : [];
  return z.union([
    z.tuple([inputType, inputSpec2]),
    z.tuple([inputType]).transform(([type]) => [type, {}]),
    ...upcastTypes
  ]);
}
__name(inputSpec, "inputSpec");
const zBaseInputSpecValue = z.object({
  default: z.any().optional(),
  defaultInput: z.boolean().optional(),
  forceInput: z.boolean().optional(),
  lazy: z.boolean().optional(),
  rawLink: z.boolean().optional(),
  tooltip: z.string().optional(),
  hidden: z.boolean().optional(),
  advanced: z.boolean().optional()
}).passthrough();
const zIntInputSpec = inputSpec([
  z.literal("INT"),
  zBaseInputSpecValue.extend({
    min: z.number().optional(),
    max: z.number().optional(),
    step: z.number().optional(),
    // Note: Many node authors are using INT to pass list of INT.
    // TODO: Add list of ints type.
    default: z.union([z.number(), z.array(z.number())]).optional()
  })
]);
const zFloatInputSpec = inputSpec([
  z.literal("FLOAT"),
  zBaseInputSpecValue.extend({
    min: z.number().optional(),
    max: z.number().optional(),
    step: z.number().optional(),
    round: z.union([z.number(), z.literal(false)]).optional(),
    // Note: Many node authors are using FLOAT to pass list of FLOAT.
    // TODO: Add list of floats type.
    default: z.union([z.number(), z.array(z.number())]).optional()
  })
]);
const zBooleanInputSpec = inputSpec([
  z.literal("BOOLEAN"),
  zBaseInputSpecValue.extend({
    label_on: z.string().optional(),
    label_off: z.string().optional(),
    default: z.boolean().optional()
  })
]);
const zStringInputSpec = inputSpec([
  z.literal("STRING"),
  zBaseInputSpecValue.extend({
    default: z.string().optional(),
    multiline: z.boolean().optional(),
    dynamicPrompts: z.boolean().optional(),
    // Multiline-only fields
    defaultVal: z.string().optional(),
    placeholder: z.string().optional()
  })
]);
const zComboInputSpec = inputSpec(
  [
    z.array(z.any()),
    zBaseInputSpecValue.extend({
      control_after_generate: z.boolean().optional(),
      image_upload: z.boolean().optional()
    })
  ],
  /* allowUpcast=*/
  false
);
const excludedLiterals = /* @__PURE__ */ new Set(["INT", "FLOAT", "BOOLEAN", "STRING", "COMBO"]);
const zCustomInputSpec = inputSpec([
  z.string().refine((value4) => !excludedLiterals.has(value4)),
  zBaseInputSpecValue
]);
const zInputSpec = z.union([
  zIntInputSpec,
  zFloatInputSpec,
  zBooleanInputSpec,
  zStringInputSpec,
  zComboInputSpec,
  zCustomInputSpec
]);
const zComfyInputsSpec = z.object({
  required: z.record(zInputSpec).optional(),
  optional: z.record(zInputSpec).optional(),
  // Frontend repo is not using it, but some custom nodes are using the
  // hidden field to pass various values.
  hidden: z.record(z.any()).optional()
});
const zComfyNodeDataType = z.string();
const zComfyComboOutput = z.array(z.any());
const zComfyOutputTypesSpec = z.array(
  z.union([zComfyNodeDataType, zComfyComboOutput])
);
const zComfyNodeDef = z.object({
  input: zComfyInputsSpec.optional(),
  output: zComfyOutputTypesSpec.optional(),
  output_is_list: z.array(z.boolean()).optional(),
  output_name: z.array(z.string()).optional(),
  output_tooltips: z.array(z.string()).optional(),
  name: z.string(),
  display_name: z.string(),
  description: z.string(),
  category: z.string(),
  output_node: z.boolean(),
  python_module: z.string(),
  deprecated: z.boolean().optional(),
  experimental: z.boolean().optional()
});
function validateComfyNodeDef(data24, onError = console.warn) {
  const result = zComfyNodeDef.safeParse(data24);
  if (!result.success) {
    const zodError = fromZodError(result.error);
    onError(
      `Invalid ComfyNodeDef: ${JSON.stringify(data24)}
${zodError.message}`
    );
    return null;
  }
  return result.data;
}
__name(validateComfyNodeDef, "validateComfyNodeDef");
const zEmbeddingsResponse = z.array(z.string());
const zExtensionsResponse = z.array(z.string());
const zPromptResponse = z.object({
  node_errors: z.array(z.string()).optional(),
  prompt_id: z.string().optional(),
  exec_info: z.object({
    queue_remaining: z.number().optional()
  }).optional()
});
const zDeviceStats = z.object({
  name: z.string(),
  type: z.string(),
  index: z.number(),
  vram_total: z.number(),
  vram_free: z.number(),
  torch_vram_total: z.number(),
  torch_vram_free: z.number()
});
const zSystemStats = z.object({
  system: z.object({
    os: z.string(),
    python_version: z.string(),
    embedded_python: z.boolean(),
    comfyui_version: z.string(),
    pytorch_version: z.string(),
    argv: z.array(z.string()),
    ram_total: z.number(),
    ram_free: z.number()
  }),
  devices: z.array(zDeviceStats)
});
const zUser = z.object({
  storage: z.enum(["server"]),
  // `migrated` is only available in single-user mode.
  migrated: z.boolean().optional(),
  // `users` is only available in multi-user server mode.
  users: z.record(z.string(), z.string()).optional()
});
const zUserData = z.array(z.array(z.string(), z.string()));
const zUserDataFullInfo = z.object({
  path: z.string(),
  size: z.number(),
  modified: z.number()
});
const zBookmarkCustomization = z.object({
  icon: z.string().optional(),
  color: z.string().optional()
});
const zLinkReleaseTriggerAction = z.enum(
  Object.values(LinkReleaseTriggerAction)
);
const zNodeBadgeMode = z.enum(
  Object.values(NodeBadgeMode)
);
const zSettings = z.record(z.any()).and(
  z.object({
    "Comfy.ColorPalette": z.string(),
    "Comfy.CustomColorPalettes": colorPalettesSchema,
    "Comfy.ConfirmClear": z.boolean(),
    "Comfy.DevMode": z.boolean(),
    "Comfy.Workflow.ShowMissingNodesWarning": z.boolean(),
    "Comfy.Workflow.ShowMissingModelsWarning": z.boolean(),
    "Comfy.DisableFloatRounding": z.boolean(),
    "Comfy.DisableSliders": z.boolean(),
    "Comfy.DOMClippingEnabled": z.boolean(),
    "Comfy.EditAttention.Delta": z.number(),
    "Comfy.EnableTooltips": z.boolean(),
    "Comfy.EnableWorkflowViewRestore": z.boolean(),
    "Comfy.FloatRoundingPrecision": z.number(),
    "Comfy.Graph.CanvasInfo": z.boolean(),
    "Comfy.Graph.ZoomSpeed": z.number(),
    "Comfy.Group.DoubleClickTitleToEdit": z.boolean(),
    "Comfy.GroupSelectedNodes.Padding": z.number(),
    "Comfy.InvertMenuScrolling": z.boolean(),
    "Comfy.Locale": z.string(),
    "Comfy.Logging.Enabled": z.boolean(),
    "Comfy.NodeLibrary.Bookmarks": z.array(z.string()),
    "Comfy.NodeLibrary.Bookmarks.V2": z.array(z.string()),
    "Comfy.NodeLibrary.BookmarksCustomization": z.record(
      z.string(),
      zBookmarkCustomization
    ),
    "Comfy.NodeInputConversionSubmenus": z.boolean(),
    "Comfy.LinkRelease.Action": zLinkReleaseTriggerAction,
    "Comfy.LinkRelease.ActionShift": zLinkReleaseTriggerAction,
    "Comfy.NodeSearchBoxImpl.NodePreview": z.boolean(),
    "Comfy.NodeSearchBoxImpl": z.enum(["default", "simple"]),
    "Comfy.NodeSearchBoxImpl.ShowCategory": z.boolean(),
    "Comfy.NodeSearchBoxImpl.ShowIdName": z.boolean(),
    "Comfy.NodeSuggestions.number": z.number(),
    "Comfy.Node.ShowDeprecated": z.boolean(),
    "Comfy.Node.ShowExperimental": z.boolean(),
    "Comfy.PreviewFormat": z.string(),
    "Comfy.PromptFilename": z.boolean(),
    "Comfy.Sidebar.Location": z.enum(["left", "right"]),
    "Comfy.Sidebar.Size": z.enum(["small", "normal"]),
    "Comfy.SwitchUser": z.any(),
    "Comfy.SnapToGrid.GridSize": z.number(),
    "Comfy.TextareaWidget.FontSize": z.number(),
    "Comfy.TextareaWidget.Spellcheck": z.boolean(),
    "Comfy.UseNewMenu": z.enum(["Disabled", "Top", "Bottom"]),
    "Comfy.TreeExplorer.ItemPadding": z.number(),
    "Comfy.Validation.Workflows": z.boolean(),
    "Comfy.Workflow.SortNodeIdOnSave": z.boolean(),
    "Comfy.Queue.ImageFit": z.enum(["contain", "cover"]),
    "Comfy.Workflow.WorkflowTabsPosition": z.enum(["Sidebar", "Topbar"]),
    "Comfy.Node.DoubleClickTitleToEdit": z.boolean(),
    "Comfy.Window.UnloadConfirmation": z.boolean(),
    "Comfy.NodeBadge.NodeSourceBadgeMode": zNodeBadgeMode,
    "Comfy.NodeBadge.NodeIdBadgeMode": zNodeBadgeMode,
    "Comfy.NodeBadge.NodeLifeCycleBadgeMode": zNodeBadgeMode,
    "Comfy.QueueButton.BatchCountLimit": z.number(),
    "Comfy.Keybinding.UnsetBindings": z.array(zKeybinding),
    "Comfy.Keybinding.NewBindings": z.array(zKeybinding),
    "Comfy.Extension.Disabled": z.array(z.string()),
    "Comfy.Settings.ExtensionPanel": z.boolean(),
    "Comfy.LinkRenderMode": z.number(),
    "Comfy.Node.AutoSnapLinkToSlot": z.boolean(),
    "Comfy.Node.SnapHighlightsNode": z.boolean(),
    "Comfy.Server.ServerConfigValues": z.record(z.string(), z.any()),
    "Comfy.Server.LaunchArgs": z.record(z.string(), z.string()),
    "LiteGraph.Canvas.MaximumFps": z.number(),
    "Comfy.Workflow.ConfirmDelete": z.boolean()
  }).optional()
);
class ComfyApi extends EventTarget {
  static {
    __name(this, "ComfyApi");
  }
  #registered = /* @__PURE__ */ new Set();
  api_host;
  api_base;
  /**
   * The client id from the initial session storage.
   */
  initialClientId;
  /**
   * The current client id from websocket status updates.
   */
  clientId;
  /**
   * The current user id.
   */
  user;
  socket = null;
  reportedUnknownMessageTypes = /* @__PURE__ */ new Set();
  constructor() {
    super();
    this.user = "";
    this.api_host = location.host;
    this.api_base = location.pathname.split("/").slice(0, -1).join("/");
    console.log("Running on", this.api_host);
    this.initialClientId = sessionStorage.getItem("clientId");
  }
  internalURL(route) {
    return this.api_base + "/internal" + route;
  }
  apiURL(route) {
    return this.api_base + "/api" + route;
  }
  fileURL(route) {
    return this.api_base + route;
  }
  fetchApi(route, options4) {
    if (!options4) {
      options4 = {};
    }
    if (!options4.headers) {
      options4.headers = {};
    }
    if (!options4.cache) {
      options4.cache = "no-cache";
    }
    if (Array.isArray(options4.headers)) {
      options4.headers.push(["Comfy-User", this.user]);
    } else if (options4.headers instanceof Headers) {
      options4.headers.set("Comfy-User", this.user);
    } else {
      options4.headers["Comfy-User"] = this.user;
    }
    return fetch(this.apiURL(route), options4);
  }
  addEventListener(type, callback, options4) {
    super.addEventListener(type, callback, options4);
    this.#registered.add(type);
  }
  removeEventListener(type, callback, options4) {
    super.removeEventListener(type, callback, options4);
  }
  dispatchCustomEvent(type, detail) {
    const event = detail === void 0 ? new CustomEvent(type) : new CustomEvent(type, { detail });
    return super.dispatchEvent(event);
  }
  /** @deprecated Use {@link dispatchCustomEvent}. */
  dispatchEvent(event) {
    return super.dispatchEvent(event);
  }
  /**
   * Poll status  for colab and other things that don't support websockets.
   */
  #pollQueue() {
    setInterval(async () => {
      try {
        const resp = await this.fetchApi("/prompt");
        const status = await resp.json();
        this.dispatchCustomEvent("status", status);
      } catch (error2) {
        this.dispatchCustomEvent("status", null);
      }
    }, 1e3);
  }
  /**
   * Creates and connects a WebSocket for realtime updates
   * @param {boolean} isReconnect If the socket is connection is a reconnect attempt
   */
  #createSocket(isReconnect) {
    if (this.socket) {
      return;
    }
    let opened = false;
    let existingSession = window.name;
    if (existingSession) {
      existingSession = "?clientId=" + existingSession;
    }
    this.socket = new WebSocket(
      `ws${window.location.protocol === "https:" ? "s" : ""}://${this.api_host}${this.api_base}/ws${existingSession}`
    );
    this.socket.binaryType = "arraybuffer";
    this.socket.addEventListener("open", () => {
      opened = true;
      if (isReconnect) {
        this.dispatchCustomEvent("reconnected");
      }
    });
    this.socket.addEventListener("error", () => {
      if (this.socket) this.socket.close();
      if (!isReconnect && !opened) {
        this.#pollQueue();
      }
    });
    this.socket.addEventListener("close", () => {
      setTimeout(() => {
        this.socket = null;
        this.#createSocket(true);
      }, 300);
      if (opened) {
        this.dispatchCustomEvent("status", null);
        this.dispatchCustomEvent("reconnecting");
      }
    });
    this.socket.addEventListener("message", (event) => {
      try {
        if (event.data instanceof ArrayBuffer) {
          const view = new DataView(event.data);
          const eventType = view.getUint32(0);
          const buffer2 = event.data.slice(4);
          switch (eventType) {
            case 1:
              const view2 = new DataView(event.data);
              const imageType = view2.getUint32(0);
              let imageMime;
              switch (imageType) {
                case 1:
                default:
                  imageMime = "image/jpeg";
                  break;
                case 2:
                  imageMime = "image/png";
              }
              const imageBlob = new Blob([buffer2.slice(4)], {
                type: imageMime
              });
              this.dispatchCustomEvent("b_preview", imageBlob);
              break;
            default:
              throw new Error(
                `Unknown binary websocket message of type ${eventType}`
              );
          }
        } else {
          const msg = JSON.parse(event.data);
          switch (msg.type) {
            case "status":
              if (msg.data.sid) {
                const clientId = msg.data.sid;
                this.clientId = clientId;
                window.name = clientId;
                sessionStorage.setItem("clientId", clientId);
              }
              this.dispatchCustomEvent("status", msg.data.status ?? null);
              break;
            case "executing":
              this.dispatchCustomEvent(
                "executing",
                msg.data.display_node || msg.data.node
              );
              break;
            case "execution_start":
            case "execution_error":
            case "execution_cached":
            case "execution_success":
            case "progress":
            case "executed":
            case "graphChanged":
            case "promptQueued":
            case "logs":
            case "b_preview":
              this.dispatchCustomEvent(msg.type, msg.data);
              break;
            default:
              if (this.#registered.has(msg.type)) {
                super.dispatchEvent(
                  new CustomEvent(msg.type, { detail: msg.data })
                );
              } else if (!this.reportedUnknownMessageTypes.has(msg.type)) {
                this.reportedUnknownMessageTypes.add(msg.type);
                throw new Error(`Unknown message type ${msg.type}`);
              }
          }
        }
      } catch (error2) {
        console.warn("Unhandled message:", event.data, error2);
      }
    });
  }
  /**
   * Initialises sockets and realtime updates
   */
  init() {
    this.#createSocket();
  }
  /**
   * Gets a list of extension urls
   */
  async getExtensions() {
    const resp = await this.fetchApi("/extensions", { cache: "no-store" });
    return await resp.json();
  }
  /**
   * Gets the available workflow templates from custom nodes.
   * @returns A map of custom_node names and associated template workflow names.
   */
  async getWorkflowTemplates() {
    const res = await this.fetchApi("/workflow_templates");
    return await res.json();
  }
  /**
   * Gets a list of embedding names
   */
  async getEmbeddings() {
    const resp = await this.fetchApi("/embeddings", { cache: "no-store" });
    return await resp.json();
  }
  /**
   * Loads node object definitions for the graph
   * @returns The node definitions
   */
  async getNodeDefs({ validate = false } = {}) {
    const resp = await this.fetchApi("/object_info", { cache: "no-store" });
    const objectInfoUnsafe = await resp.json();
    if (!validate) {
      return objectInfoUnsafe;
    }
    const objectInfo = {};
    for (const key in objectInfoUnsafe) {
      const validatedDef = validateComfyNodeDef(
        objectInfoUnsafe[key],
        /* onError=*/
        (errorMessage) => {
          console.warn(
            `Skipping invalid node definition: ${key}. See debug log for more information.`
          );
          console.debug(errorMessage);
        }
      );
      if (validatedDef !== null) {
        objectInfo[key] = validatedDef;
      }
    }
    return objectInfo;
  }
  /**
   *
   * @param {number} number The index at which to queue the prompt, passing -1 will insert the prompt at the front of the queue
   * @param {object} prompt The prompt data to queue
   */
  async queuePrompt(number2, {
    output,
    workflow
  }) {
    const body = {
      client_id: this.clientId ?? "",
      // TODO: Unify clientId access
      prompt: output,
      extra_data: { extra_pnginfo: { workflow } }
    };
    if (number2 === -1) {
      body.front = true;
    } else if (number2 != 0) {
      body.number = number2;
    }
    const res = await this.fetchApi("/prompt", {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(body)
    });
    if (res.status !== 200) {
      throw {
        response: await res.json()
      };
    }
    return await res.json();
  }
  /**
   * Gets a list of model folder keys (eg ['checkpoints', 'loras', ...])
   * @returns The list of model folder keys
   */
  async getModelFolders() {
    const res = await this.fetchApi(`/experiment/models`);
    if (res.status === 404) {
      return [];
    }
    const folderBlacklist = ["configs", "custom_nodes"];
    return (await res.json()).filter(
      (folder) => !folderBlacklist.includes(folder)
    );
  }
  /**
   * Gets a list of models in the specified folder
   * @param {string} folder The folder to list models from, such as 'checkpoints'
   * @returns The list of model filenames within the specified folder
   */
  async getModels(folder) {
    const res = await this.fetchApi(`/experiment/models/${folder}`);
    if (res.status === 404) {
      return [];
    }
    return await res.json();
  }
  /**
   * Gets the metadata for a model
   * @param {string} folder The folder containing the model
   * @param {string} model The model to get metadata for
   * @returns The metadata for the model
   */
  async viewMetadata(folder, model) {
    const res = await this.fetchApi(
      `/view_metadata/${folder}?filename=${encodeURIComponent(model)}`
    );
    const rawResponse = await res.text();
    if (!rawResponse) {
      return null;
    }
    try {
      return JSON.parse(rawResponse);
    } catch (error2) {
      console.error(
        "Error viewing metadata",
        res.status,
        res.statusText,
        rawResponse,
        error2
      );
      return null;
    }
  }
  /**
   * Loads a list of items (queue or history)
   * @param {string} type The type of items to load, queue or history
   * @returns The items of the specified type grouped by their status
   */
  async getItems(type) {
    if (type === "queue") {
      return this.getQueue();
    }
    return this.getHistory();
  }
  /**
   * Gets the current state of the queue
   * @returns The currently running and queued items
   */
  async getQueue() {
    try {
      const res = await this.fetchApi("/queue");
      const data24 = await res.json();
      return {
        // Running action uses a different endpoint for cancelling
        Running: data24.queue_running.map((prompt) => ({
          taskType: "Running",
          prompt,
          remove: { name: "Cancel", cb: /* @__PURE__ */ __name(() => api.interrupt(), "cb") }
        })),
        Pending: data24.queue_pending.map((prompt) => ({
          taskType: "Pending",
          prompt
        }))
      };
    } catch (error2) {
      console.error(error2);
      return { Running: [], Pending: [] };
    }
  }
  /**
   * Gets the prompt execution history
   * @returns Prompt history including node outputs
   */
  async getHistory(max_items = 200) {
    try {
      const res = await this.fetchApi(`/history?max_items=${max_items}`);
      const json = await res.json();
      return {
        History: Object.values(json).map((item3) => ({
          ...item3,
          taskType: "History"
        }))
      };
    } catch (error2) {
      console.error(error2);
      return { History: [] };
    }
  }
  /**
   * Gets system & device stats
   * @returns System stats such as python version, OS, per device info
   */
  async getSystemStats() {
    const res = await this.fetchApi("/system_stats");
    return await res.json();
  }
  /**
   * Sends a POST request to the API
   * @param {*} type The endpoint to post to
   * @param {*} body Optional POST data
   */
  async #postItem(type, body) {
    try {
      await this.fetchApi("/" + type, {
        method: "POST",
        headers: {
          "Content-Type": "application/json"
        },
        body: body ? JSON.stringify(body) : void 0
      });
    } catch (error2) {
      console.error(error2);
    }
  }
  /**
   * Deletes an item from the specified list
   * @param {string} type The type of item to delete, queue or history
   * @param {number} id The id of the item to delete
   */
  async deleteItem(type, id3) {
    await this.#postItem(type, { delete: [id3] });
  }
  /**
   * Clears the specified list
   * @param {string} type The type of list to clear, queue or history
   */
  async clearItems(type) {
    await this.#postItem(type, { clear: true });
  }
  /**
   * Interrupts the execution of the running prompt
   */
  async interrupt() {
    await this.#postItem("interrupt", null);
  }
  /**
   * Gets user configuration data and where data should be stored
   */
  async getUserConfig() {
    return (await this.fetchApi("/users")).json();
  }
  /**
   * Creates a new user
   * @param { string } username
   * @returns The fetch response
   */
  createUser(username) {
    return this.fetchApi("/users", {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ username })
    });
  }
  /**
   * Gets all setting values for the current user
   * @returns { Promise<string, unknown> } A dictionary of id -> value
   */
  async getSettings() {
    return (await this.fetchApi("/settings")).json();
  }
  /**
   * Gets a setting for the current user
   * @param { string } id The id of the setting to fetch
   * @returns { Promise<unknown> } The setting value
   */
  async getSetting(id3) {
    return (await this.fetchApi(`/settings/${encodeURIComponent(id3)}`)).json();
  }
  /**
   * Stores a dictionary of settings for the current user
   */
  async storeSettings(settings) {
    return this.fetchApi(`/settings`, {
      method: "POST",
      body: JSON.stringify(settings)
    });
  }
  /**
   * Stores a setting for the current user
   */
  async storeSetting(id3, value4) {
    return this.fetchApi(`/settings/${encodeURIComponent(id3)}`, {
      method: "POST",
      body: JSON.stringify(value4)
    });
  }
  /**
   * Gets a user data file for the current user
   */
  async getUserData(file, options4) {
    return this.fetchApi(`/userdata/${encodeURIComponent(file)}`, options4);
  }
  /**
   * Stores a user data file for the current user
   * @param { string } file The name of the userdata file to save
   * @param { unknown } data The data to save to the file
   * @param { RequestInit & { stringify?: boolean, throwOnError?: boolean } } [options]
   * @returns { Promise<Response> }
   */
  async storeUserData(file, data24, options4 = {
    overwrite: true,
    stringify: true,
    throwOnError: true,
    full_info: false
  }) {
    const resp = await this.fetchApi(
      `/userdata/${encodeURIComponent(file)}?overwrite=${options4.overwrite}&full_info=${options4.full_info}`,
      {
        method: "POST",
        body: options4?.stringify ? JSON.stringify(data24) : data24,
        ...options4
      }
    );
    if (resp.status !== 200 && options4.throwOnError !== false) {
      throw new Error(
        `Error storing user data file '${file}': ${resp.status} ${(await resp).statusText}`
      );
    }
    return resp;
  }
  /**
   * Deletes a user data file for the current user
   * @param { string } file The name of the userdata file to delete
   */
  async deleteUserData(file) {
    const resp = await this.fetchApi(`/userdata/${encodeURIComponent(file)}`, {
      method: "DELETE"
    });
    return resp;
  }
  /**
   * Move a user data file for the current user
   * @param { string } source The userdata file to move
   * @param { string } dest The destination for the file
   */
  async moveUserData(source, dest, options4 = { overwrite: false }) {
    const resp = await this.fetchApi(
      `/userdata/${encodeURIComponent(source)}/move/${encodeURIComponent(dest)}?overwrite=${options4?.overwrite}`,
      {
        method: "POST"
      }
    );
    return resp;
  }
  /**
   * @deprecated Use `listUserDataFullInfo` instead.
   */
  async listUserData(dir, recurse, split2) {
    const resp = await this.fetchApi(
      `/userdata?${new URLSearchParams({
        recurse: recurse ? "true" : "false",
        dir,
        split: split2 ? "true" : "false"
      })}`
    );
    if (resp.status === 404) return [];
    if (resp.status !== 200) {
      throw new Error(
        `Error getting user data list '${dir}': ${resp.status} ${resp.statusText}`
      );
    }
    return resp.json();
  }
  async listUserDataFullInfo(dir) {
    const resp = await this.fetchApi(
      `/userdata?dir=${encodeURIComponent(dir)}&recurse=true&split=false&full_info=true`
    );
    if (resp.status === 404) return [];
    if (resp.status !== 200) {
      throw new Error(
        `Error getting user data list '${dir}': ${resp.status} ${resp.statusText}`
      );
    }
    return resp.json();
  }
  async getLogs() {
    return (await axios.get(this.internalURL("/logs"))).data;
  }
  async getRawLogs() {
    return (await axios.get(this.internalURL("/logs/raw"))).data;
  }
  async subscribeLogs(enabled) {
    return await axios.patch(this.internalURL("/logs/subscribe"), {
      enabled,
      clientId: this.clientId
    });
  }
  async getFolderPaths() {
    return (await axios.get(this.internalURL("/folder_paths"))).data;
  }
}
const api = new ComfyApi();
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.api = window.comfyAPI.api || {};
window.comfyAPI.api.ComfyApi = ComfyApi;
window.comfyAPI.api.api = api;
const useUserStore = /* @__PURE__ */ defineStore("user", () => {
  const userConfig = ref(null);
  const currentUserId = ref(null);
  const isMultiUserServer = computed(
    () => userConfig.value && "users" in userConfig.value
  );
  const needsLogin = computed(
    () => !currentUserId.value && isMultiUserServer.value
  );
  const users = computed(
    () => Object.entries(userConfig.value?.users ?? {}).map(([userId, username]) => ({
      userId,
      username
    }))
  );
  const currentUser = computed(
    () => users.value.find((user) => user.userId === currentUserId.value) ?? null
  );
  const initialized = computed(() => userConfig.value !== null);
  async function initialize2() {
    userConfig.value = await api.getUserConfig();
    currentUserId.value = localStorage["Comfy.userId"];
  }
  __name(initialize2, "initialize");
  async function createUser(username) {
    const resp = await api.createUser(username);
    const data24 = await resp.json();
    if (resp.status >= 300) {
      throw new Error(
        data24.error ?? "Error creating user: " + resp.status + " " + resp.statusText
      );
    }
    return {
      userId: data24,
      username
    };
  }
  __name(createUser, "createUser");
  async function login({
    userId,
    username
  }) {
    currentUserId.value = userId;
    localStorage["Comfy.userId"] = userId;
    localStorage["Comfy.userName"] = username;
  }
  __name(login, "login");
  watchEffect(() => {
    if (isMultiUserServer.value && currentUserId.value) {
      api.user = currentUserId.value;
    }
  });
  async function logout() {
    delete localStorage["Comfy.userId"];
    delete localStorage["Comfy.userName"];
  }
  __name(logout, "logout");
  return {
    users,
    currentUser,
    isMultiUserServer,
    needsLogin,
    initialized,
    initialize: initialize2,
    createUser,
    login,
    logout
  };
});
function isElectron() {
  return "electronAPI" in window && window["electronAPI"] !== void 0;
}
__name(isElectron, "isElectron");
function electronAPI() {
  return window["electronAPI"];
}
__name(electronAPI, "electronAPI");
function showNativeMenu(options4) {
  electronAPI()?.showContextMenu(options4);
}
__name(showNativeMenu, "showNativeMenu");
const isFileProtocol = window.location.protocol === "file:";
const basePath = isElectron() ? "/" : window.location.pathname;
const guardElectronAccess = /* @__PURE__ */ __name((to, from2, next2) => {
  if (isElectron()) {
    next2();
  } else {
    next2("/");
  }
}, "guardElectronAccess");
const router = createRouter({
  history: isFileProtocol ? createWebHashHistory() : (
    // Base path must be specified to ensure correct relative paths
    // Example: For URL 'http://localhost:7801/ComfyBackendDirect',
    // we need this base path or assets will incorrectly resolve from 'http://localhost:7801/'
    createWebHistory(basePath)
  ),
  routes: [
    {
      path: "/",
      component: LayoutDefault,
      children: [
        {
          path: "",
          name: "GraphView",
          component: /* @__PURE__ */ __name(() => __vitePreload(() => import("./GraphView-HVeNbkaW.js"), true ? __vite__mapDeps([0,1,2,3,4,5,6]) : void 0, import.meta.url), "component"),
          beforeEnter: /* @__PURE__ */ __name(async (to, from2, next2) => {
            const userStore = useUserStore();
            await userStore.initialize();
            if (userStore.needsLogin) {
              next2("/user-select");
            } else {
              next2();
            }
          }, "beforeEnter")
        },
        {
          path: "user-select",
          name: "UserSelectView",
          component: /* @__PURE__ */ __name(() => __vitePreload(() => import("./UserSelectView-B3jYchWu.js"), true ? __vite__mapDeps([7,8]) : void 0, import.meta.url), "component")
        },
        {
          path: "server-start",
          name: "ServerStartView",
          component: /* @__PURE__ */ __name(() => __vitePreload(() => import("./ServerStartView-CIDTUh4x.js"), true ? __vite__mapDeps([9,8,10]) : void 0, import.meta.url), "component"),
          beforeEnter: guardElectronAccess
        },
        {
          path: "install",
          name: "InstallView",
          component: /* @__PURE__ */ __name(() => __vitePreload(() => import("./InstallView-CAcYt0HL.js"), true ? __vite__mapDeps([11,8,12]) : void 0, import.meta.url), "component"),
          beforeEnter: guardElectronAccess
        },
        {
          path: "welcome",
          name: "WelcomeView",
          component: /* @__PURE__ */ __name(() => __vitePreload(() => import("./WelcomeView-N0ZXLjdi.js"), true ? __vite__mapDeps([13,8,14]) : void 0, import.meta.url), "component"),
          beforeEnter: guardElectronAccess
        },
        {
          path: "not-supported",
          name: "NotSupportedView",
          component: /* @__PURE__ */ __name(() => __vitePreload(() => import("./NotSupportedView-Drz3x2d-.js"), true ? __vite__mapDeps([15,8,16]) : void 0, import.meta.url), "component"),
          beforeEnter: guardElectronAccess
        },
        {
          path: "download-git",
          name: "DownloadGitView",
          component: /* @__PURE__ */ __name(() => __vitePreload(() => import("./DownloadGitView-DeC7MBzG.js"), true ? __vite__mapDeps([17,8]) : void 0, import.meta.url), "component"),
          beforeEnter: guardElectronAccess
        },
        {
          path: "manual-configuration",
          name: "ManualConfigurationView",
          component: /* @__PURE__ */ __name(() => __vitePreload(() => import("./ManualConfigurationView-Bi_qHE-n.js"), true ? __vite__mapDeps([18,1,2,8,19]) : void 0, import.meta.url), "component"),
          beforeEnter: guardElectronAccess
        }
      ]
    }
  ],
  scrollBehavior(to, from2, savedPosition) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { top: 0 };
    }
  }
});
var isVue2$1 = false;
var isVue3$1 = true;
var Vue2$1 = void 0;
function install$7() {
}
__name(install$7, "install$7");
function set$2(target, key, val) {
  if (Array.isArray(target)) {
    target.length = Math.max(target.length, key);
    target.splice(key, 1, val);
    return val;
  }
  target[key] = val;
  return val;
}
__name(set$2, "set$2");
function del$2(target, key) {
  if (Array.isArray(target)) {
    target.splice(key, 1);
    return;
  }
  delete target[key];
}
__name(del$2, "del$2");
function computedEager(fn, options4) {
  var _a2;
  const result = shallowRef();
  watchEffect(() => {
    result.value = fn();
  }, {
    ...options4,
    flush: (_a2 = options4 == null ? void 0 : options4.flush) != null ? _a2 : "sync"
  });
  return readonly(result);
}
__name(computedEager, "computedEager");
function computedWithControl(source, fn) {
  let v2 = void 0;
  let track2;
  let trigger2;
  const dirty = ref(true);
  const update = /* @__PURE__ */ __name(() => {
    dirty.value = true;
    trigger2();
  }, "update");
  watch(source, update, { flush: "sync" });
  const get22 = typeof fn === "function" ? fn : fn.get;
  const set22 = typeof fn === "function" ? void 0 : fn.set;
  const result = customRef((_track, _trigger) => {
    track2 = _track;
    trigger2 = _trigger;
    return {
      get() {
        if (dirty.value) {
          v2 = get22(v2);
          dirty.value = false;
        }
        track2();
        return v2;
      },
      set(v22) {
        set22 == null ? void 0 : set22(v22);
      }
    };
  });
  if (Object.isExtensible(result))
    result.trigger = update;
  return result;
}
__name(computedWithControl, "computedWithControl");
function tryOnScopeDispose(fn) {
  if (getCurrentScope()) {
    onScopeDispose(fn);
    return true;
  }
  return false;
}
__name(tryOnScopeDispose, "tryOnScopeDispose");
function createEventHook() {
  const fns = /* @__PURE__ */ new Set();
  const off = /* @__PURE__ */ __name((fn) => {
    fns.delete(fn);
  }, "off");
  const on = /* @__PURE__ */ __name((fn) => {
    fns.add(fn);
    const offFn = /* @__PURE__ */ __name(() => off(fn), "offFn");
    tryOnScopeDispose(offFn);
    return {
      off: offFn
    };
  }, "on");
  const trigger2 = /* @__PURE__ */ __name((...args) => {
    return Promise.all(Array.from(fns).map((fn) => fn(...args)));
  }, "trigger");
  return {
    on,
    off,
    trigger: trigger2
  };
}
__name(createEventHook, "createEventHook");
function createGlobalState(stateFactory) {
  let initialized = false;
  let state;
  const scope = effectScope(true);
  return (...args) => {
    if (!initialized) {
      state = scope.run(() => stateFactory(...args));
      initialized = true;
    }
    return state;
  };
}
__name(createGlobalState, "createGlobalState");
const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
const provideLocal = /* @__PURE__ */ __name((key, value4) => {
  var _a2;
  const instance = (_a2 = getCurrentInstance()) == null ? void 0 : _a2.proxy;
  if (instance == null)
    throw new Error("provideLocal must be called in setup");
  if (!localProvidedStateMap.has(instance))
    localProvidedStateMap.set(instance, /* @__PURE__ */ Object.create(null));
  const localProvidedState = localProvidedStateMap.get(instance);
  localProvidedState[key] = value4;
  provide(key, value4);
}, "provideLocal");
const injectLocal = /* @__PURE__ */ __name((...args) => {
  var _a2;
  const key = args[0];
  const instance = (_a2 = getCurrentInstance()) == null ? void 0 : _a2.proxy;
  if (instance == null)
    throw new Error("injectLocal must be called in setup");
  if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
    return localProvidedStateMap.get(instance)[key];
  return inject(...args);
}, "injectLocal");
function createInjectionState(composable, options4) {
  const key = (options4 == null ? void 0 : options4.injectionKey) || Symbol(composable.name || "InjectionState");
  const defaultValue = options4 == null ? void 0 : options4.defaultValue;
  const useProvidingState = /* @__PURE__ */ __name((...args) => {
    const state = composable(...args);
    provideLocal(key, state);
    return state;
  }, "useProvidingState");
  const useInjectedState = /* @__PURE__ */ __name(() => injectLocal(key, defaultValue), "useInjectedState");
  return [useProvidingState, useInjectedState];
}
__name(createInjectionState, "createInjectionState");
function createSharedComposable(composable) {
  let subscribers = 0;
  let state;
  let scope;
  const dispose = /* @__PURE__ */ __name(() => {
    subscribers -= 1;
    if (scope && subscribers <= 0) {
      scope.stop();
      state = void 0;
      scope = void 0;
    }
  }, "dispose");
  return (...args) => {
    subscribers += 1;
    if (!state) {
      scope = effectScope(true);
      state = scope.run(() => composable(...args));
    }
    tryOnScopeDispose(dispose);
    return state;
  };
}
__name(createSharedComposable, "createSharedComposable");
function extendRef(ref2, extend4, { enumerable = false, unwrap = true } = {}) {
  if (!isVue3$1 && !version.startsWith("2.7.")) {
    if (false)
      throw new Error("[VueUse] extendRef only works in Vue 2.7 or above.");
    return;
  }
  for (const [key, value4] of Object.entries(extend4)) {
    if (key === "value")
      continue;
    if (isRef(value4) && unwrap) {
      Object.defineProperty(ref2, key, {
        get() {
          return value4.value;
        },
        set(v2) {
          value4.value = v2;
        },
        enumerable
      });
    } else {
      Object.defineProperty(ref2, key, { value: value4, enumerable });
    }
  }
  return ref2;
}
__name(extendRef, "extendRef");
function get$2(obj, key) {
  if (key == null)
    return unref(obj);
  return unref(obj)[key];
}
__name(get$2, "get$2");
function isDefined$1(v2) {
  return unref(v2) != null;
}
__name(isDefined$1, "isDefined$1");
function makeDestructurable(obj, arr) {
  if (typeof Symbol !== "undefined") {
    const clone2 = { ...obj };
    Object.defineProperty(clone2, Symbol.iterator, {
      enumerable: false,
      value() {
        let index2 = 0;
        return {
          next: /* @__PURE__ */ __name(() => ({
            value: arr[index2++],
            done: index2 > arr.length
          }), "next")
        };
      }
    });
    return clone2;
  } else {
    return Object.assign([...arr], obj);
  }
}
__name(makeDestructurable, "makeDestructurable");
function toValue(r) {
  return typeof r === "function" ? r() : unref(r);
}
__name(toValue, "toValue");
const resolveUnref = toValue;
function reactify(fn, options4) {
  const unrefFn = (options4 == null ? void 0 : options4.computedGetter) === false ? unref : toValue;
  return function(...args) {
    return computed(() => fn.apply(this, args.map((i2) => unrefFn(i2))));
  };
}
__name(reactify, "reactify");
function reactifyObject(obj, optionsOrKeys = {}) {
  let keys2 = [];
  let options4;
  if (Array.isArray(optionsOrKeys)) {
    keys2 = optionsOrKeys;
  } else {
    options4 = optionsOrKeys;
    const { includeOwnProperties = true } = optionsOrKeys;
    keys2.push(...Object.keys(obj));
    if (includeOwnProperties)
      keys2.push(...Object.getOwnPropertyNames(obj));
  }
  return Object.fromEntries(
    keys2.map((key) => {
      const value4 = obj[key];
      return [
        key,
        typeof value4 === "function" ? reactify(value4.bind(obj), options4) : value4
      ];
    })
  );
}
__name(reactifyObject, "reactifyObject");
function toReactive(objectRef) {
  if (!isRef(objectRef))
    return reactive(objectRef);
  const proxy = new Proxy({}, {
    get(_2, p2, receiver) {
      return unref(Reflect.get(objectRef.value, p2, receiver));
    },
    set(_2, p2, value4) {
      if (isRef(objectRef.value[p2]) && !isRef(value4))
        objectRef.value[p2].value = value4;
      else
        objectRef.value[p2] = value4;
      return true;
    },
    deleteProperty(_2, p2) {
      return Reflect.deleteProperty(objectRef.value, p2);
    },
    has(_2, p2) {
      return Reflect.has(objectRef.value, p2);
    },
    ownKeys() {
      return Object.keys(objectRef.value);
    },
    getOwnPropertyDescriptor() {
      return {
        enumerable: true,
        configurable: true
      };
    }
  });
  return reactive(proxy);
}
__name(toReactive, "toReactive");
function reactiveComputed(fn) {
  return toReactive(computed(fn));
}
__name(reactiveComputed, "reactiveComputed");
function reactiveOmit(obj, ...keys2) {
  const flatKeys = keys2.flat();
  const predicate = flatKeys[0];
  return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v2]) => !predicate(toValue(v2), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e2) => !flatKeys.includes(e2[0]))));
}
__name(reactiveOmit, "reactiveOmit");
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
const isDef = /* @__PURE__ */ __name((val) => typeof val !== "undefined", "isDef");
const notNullish = /* @__PURE__ */ __name((val) => val != null, "notNullish");
const assert = /* @__PURE__ */ __name((condition, ...infos) => {
  if (!condition)
    console.warn(...infos);
}, "assert");
const toString$1 = Object.prototype.toString;
const isObject$4 = /* @__PURE__ */ __name((val) => toString$1.call(val) === "[object Object]", "isObject$4");
const now = /* @__PURE__ */ __name(() => Date.now(), "now");
const timestamp = /* @__PURE__ */ __name(() => +Date.now(), "timestamp");
const clamp = /* @__PURE__ */ __name((n, min, max) => Math.min(max, Math.max(min, n)), "clamp");
const noop$1 = /* @__PURE__ */ __name(() => {
}, "noop$1");
const rand = /* @__PURE__ */ __name((min, max) => {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
}, "rand");
const hasOwn$2 = /* @__PURE__ */ __name((val, key) => Object.prototype.hasOwnProperty.call(val, key), "hasOwn$2");
const isIOS = /* @__PURE__ */ getIsIOS();
function getIsIOS() {
  var _a2, _b;
  return isClient && ((_a2 = window == null ? void 0 : window.navigator) == null ? void 0 : _a2.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
}
__name(getIsIOS, "getIsIOS");
function createFilterWrapper(filter4, fn) {
  function wrapper(...args) {
    return new Promise((resolve2, reject3) => {
      Promise.resolve(filter4(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve2).catch(reject3);
    });
  }
  __name(wrapper, "wrapper");
  return wrapper;
}
__name(createFilterWrapper, "createFilterWrapper");
const bypassFilter = /* @__PURE__ */ __name((invoke2) => {
  return invoke2();
}, "bypassFilter");
function debounceFilter(ms, options4 = {}) {
  let timer;
  let maxTimer;
  let lastRejector = noop$1;
  const _clearTimeout = /* @__PURE__ */ __name((timer2) => {
    clearTimeout(timer2);
    lastRejector();
    lastRejector = noop$1;
  }, "_clearTimeout");
  const filter4 = /* @__PURE__ */ __name((invoke2) => {
    const duration = toValue(ms);
    const maxDuration = toValue(options4.maxWait);
    if (timer)
      _clearTimeout(timer);
    if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
      if (maxTimer) {
        _clearTimeout(maxTimer);
        maxTimer = null;
      }
      return Promise.resolve(invoke2());
    }
    return new Promise((resolve2, reject3) => {
      lastRejector = options4.rejectOnCancel ? reject3 : resolve2;
      if (maxDuration && !maxTimer) {
        maxTimer = setTimeout(() => {
          if (timer)
            _clearTimeout(timer);
          maxTimer = null;
          resolve2(invoke2());
        }, maxDuration);
      }
      timer = setTimeout(() => {
        if (maxTimer)
          _clearTimeout(maxTimer);
        maxTimer = null;
        resolve2(invoke2());
      }, duration);
    });
  }, "filter");
  return filter4;
}
__name(debounceFilter, "debounceFilter");
function throttleFilter(...args) {
  let lastExec = 0;
  let timer;
  let isLeading = true;
  let lastRejector = noop$1;
  let lastValue;
  let ms;
  let trailing;
  let leading;
  let rejectOnCancel;
  if (!isRef(args[0]) && typeof args[0] === "object")
    ({ delay: ms, trailing = true, leading = true, rejectOnCancel = false } = args[0]);
  else
    [ms, trailing = true, leading = true, rejectOnCancel = false] = args;
  const clear2 = /* @__PURE__ */ __name(() => {
    if (timer) {
      clearTimeout(timer);
      timer = void 0;
      lastRejector();
      lastRejector = noop$1;
    }
  }, "clear");
  const filter4 = /* @__PURE__ */ __name((_invoke) => {
    const duration = toValue(ms);
    const elapsed = Date.now() - lastExec;
    const invoke2 = /* @__PURE__ */ __name(() => {
      return lastValue = _invoke();
    }, "invoke2");
    clear2();
    if (duration <= 0) {
      lastExec = Date.now();
      return invoke2();
    }
    if (elapsed > duration && (leading || !isLeading)) {
      lastExec = Date.now();
      invoke2();
    } else if (trailing) {
      lastValue = new Promise((resolve2, reject3) => {
        lastRejector = rejectOnCancel ? reject3 : resolve2;
        timer = setTimeout(() => {
          lastExec = Date.now();
          isLeading = true;
          resolve2(invoke2());
          clear2();
        }, Math.max(0, duration - elapsed));
      });
    }
    if (!leading && !timer)
      timer = setTimeout(() => isLeading = true, duration);
    isLeading = false;
    return lastValue;
  }, "filter");
  return filter4;
}
__name(throttleFilter, "throttleFilter");
function pausableFilter(extendFilter = bypassFilter) {
  const isActive2 = ref(true);
  function pause() {
    isActive2.value = false;
  }
  __name(pause, "pause");
  function resume() {
    isActive2.value = true;
  }
  __name(resume, "resume");
  const eventFilter = /* @__PURE__ */ __name((...args) => {
    if (isActive2.value)
      extendFilter(...args);
  }, "eventFilter");
  return { isActive: readonly(isActive2), pause, resume, eventFilter };
}
__name(pausableFilter, "pausableFilter");
const directiveHooks = {
  mounted: isVue3$1 ? "mounted" : "inserted",
  updated: isVue3$1 ? "updated" : "componentUpdated",
  unmounted: isVue3$1 ? "unmounted" : "unbind"
};
function cacheStringFunction(fn) {
  const cache2 = /* @__PURE__ */ Object.create(null);
  return (str) => {
    const hit = cache2[str];
    return hit || (cache2[str] = fn(str));
  };
}
__name(cacheStringFunction, "cacheStringFunction");
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
const camelizeRE = /-(\w)/g;
const camelize = cacheStringFunction((str) => {
  return str.replace(camelizeRE, (_2, c) => c ? c.toUpperCase() : "");
});
function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
  return new Promise((resolve2, reject3) => {
    if (throwOnTimeout)
      setTimeout(() => reject3(reason), ms);
    else
      setTimeout(resolve2, ms);
  });
}
__name(promiseTimeout, "promiseTimeout");
function identity(arg) {
  return arg;
}
__name(identity, "identity");
function createSingletonPromise(fn) {
  let _promise;
  function wrapper() {
    if (!_promise)
      _promise = fn();
    return _promise;
  }
  __name(wrapper, "wrapper");
  wrapper.reset = async () => {
    const _prev = _promise;
    _promise = void 0;
    if (_prev)
      await _prev;
  };
  return wrapper;
}
__name(createSingletonPromise, "createSingletonPromise");
function invoke(fn) {
  return fn();
}
__name(invoke, "invoke");
function containsProp(obj, ...props) {
  return props.some((k) => k in obj);
}
__name(containsProp, "containsProp");
function increaseWithUnit(target, delta2) {
  var _a2;
  if (typeof target === "number")
    return target + delta2;
  const value4 = ((_a2 = target.match(/^-?\d+\.?\d*/)) == null ? void 0 : _a2[0]) || "";
  const unit = target.slice(value4.length);
  const result = Number.parseFloat(value4) + delta2;
  if (Number.isNaN(result))
    return target;
  return result + unit;
}
__name(increaseWithUnit, "increaseWithUnit");
function objectPick(obj, keys2, omitUndefined = false) {
  return keys2.reduce((n, k) => {
    if (k in obj) {
      if (!omitUndefined || obj[k] !== void 0)
        n[k] = obj[k];
    }
    return n;
  }, {});
}
__name(objectPick, "objectPick");
function objectOmit(obj, keys2, omitUndefined = false) {
  return Object.fromEntries(Object.entries(obj).filter(([key, value4]) => {
    return (!omitUndefined || value4 !== void 0) && !keys2.includes(key);
  }));
}
__name(objectOmit, "objectOmit");
function objectEntries(obj) {
  return Object.entries(obj);
}
__name(objectEntries, "objectEntries");
function getLifeCycleTarget(target) {
  return target || getCurrentInstance();
}
__name(getLifeCycleTarget, "getLifeCycleTarget");
function toRef(...args) {
  if (args.length !== 1)
    return toRef$1(...args);
  const r = args[0];
  return typeof r === "function" ? readonly(customRef(() => ({ get: r, set: noop$1 }))) : ref(r);
}
__name(toRef, "toRef");
const resolveRef = toRef;
function reactivePick(obj, ...keys2) {
  const flatKeys = keys2.flat();
  const predicate = flatKeys[0];
  return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v2]) => predicate(toValue(v2), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));
}
__name(reactivePick, "reactivePick");
function refAutoReset(defaultValue, afterMs = 1e4) {
  return customRef((track2, trigger2) => {
    let value4 = toValue(defaultValue);
    let timer;
    const resetAfter = /* @__PURE__ */ __name(() => setTimeout(() => {
      value4 = toValue(defaultValue);
      trigger2();
    }, toValue(afterMs)), "resetAfter");
    tryOnScopeDispose(() => {
      clearTimeout(timer);
    });
    return {
      get() {
        track2();
        return value4;
      },
      set(newValue2) {
        value4 = newValue2;
        trigger2();
        clearTimeout(timer);
        timer = resetAfter();
      }
    };
  });
}
__name(refAutoReset, "refAutoReset");
function useDebounceFn(fn, ms = 200, options4 = {}) {
  return createFilterWrapper(
    debounceFilter(ms, options4),
    fn
  );
}
__name(useDebounceFn, "useDebounceFn");
function refDebounced(value4, ms = 200, options4 = {}) {
  const debounced = ref(value4.value);
  const updater = useDebounceFn(() => {
    debounced.value = value4.value;
  }, ms, options4);
  watch(value4, () => updater());
  return debounced;
}
__name(refDebounced, "refDebounced");
function refDefault(source, defaultValue) {
  return computed({
    get() {
      var _a2;
      return (_a2 = source.value) != null ? _a2 : defaultValue;
    },
    set(value4) {
      source.value = value4;
    }
  });
}
__name(refDefault, "refDefault");
function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
  return createFilterWrapper(
    throttleFilter(ms, trailing, leading, rejectOnCancel),
    fn
  );
}
__name(useThrottleFn, "useThrottleFn");
function refThrottled(value4, delay = 200, trailing = true, leading = true) {
  if (delay <= 0)
    return value4;
  const throttled = ref(value4.value);
  const updater = useThrottleFn(() => {
    throttled.value = value4.value;
  }, delay, trailing, leading);
  watch(value4, () => updater());
  return throttled;
}
__name(refThrottled, "refThrottled");
function refWithControl(initial, options4 = {}) {
  let source = initial;
  let track2;
  let trigger2;
  const ref2 = customRef((_track, _trigger) => {
    track2 = _track;
    trigger2 = _trigger;
    return {
      get() {
        return get22();
      },
      set(v2) {
        set22(v2);
      }
    };
  });
  function get22(tracking = true) {
    if (tracking)
      track2();
    return source;
  }
  __name(get22, "get2");
  function set22(value4, triggering = true) {
    var _a2, _b;
    if (value4 === source)
      return;
    const old = source;
    if (((_a2 = options4.onBeforeChange) == null ? void 0 : _a2.call(options4, value4, old)) === false)
      return;
    source = value4;
    (_b = options4.onChanged) == null ? void 0 : _b.call(options4, value4, old);
    if (triggering)
      trigger2();
  }
  __name(set22, "set2");
  const untrackedGet = /* @__PURE__ */ __name(() => get22(false), "untrackedGet");
  const silentSet = /* @__PURE__ */ __name((v2) => set22(v2, false), "silentSet");
  const peek = /* @__PURE__ */ __name(() => get22(false), "peek");
  const lay = /* @__PURE__ */ __name((v2) => set22(v2, false), "lay");
  return extendRef(
    ref2,
    {
      get: get22,
      set: set22,
      untrackedGet,
      silentSet,
      peek,
      lay
    },
    { enumerable: true }
  );
}
__name(refWithControl, "refWithControl");
const controlledRef = refWithControl;
function set$1(...args) {
  if (args.length === 2) {
    const [ref2, value4] = args;
    ref2.value = value4;
  }
  if (args.length === 3) {
    if (isVue2$1) {
      set$2(...args);
    } else {
      const [target, key, value4] = args;
      target[key] = value4;
    }
  }
}
__name(set$1, "set$1");
function watchWithFilter(source, cb, options4 = {}) {
  const {
    eventFilter = bypassFilter,
    ...watchOptions
  } = options4;
  return watch(
    source,
    createFilterWrapper(
      eventFilter,
      cb
    ),
    watchOptions
  );
}
__name(watchWithFilter, "watchWithFilter");
function watchPausable(source, cb, options4 = {}) {
  const {
    eventFilter: filter4,
    ...watchOptions
  } = options4;
  const { eventFilter, pause, resume, isActive: isActive2 } = pausableFilter(filter4);
  const stop2 = watchWithFilter(
    source,
    cb,
    {
      ...watchOptions,
      eventFilter
    }
  );
  return { stop: stop2, pause, resume, isActive: isActive2 };
}
__name(watchPausable, "watchPausable");
function syncRef(left, right, ...[options4]) {
  const {
    flush = "sync",
    deep = false,
    immediate = true,
    direction = "both",
    transform: transform2 = {}
  } = options4 || {};
  const watchers = [];
  const transformLTR = "ltr" in transform2 && transform2.ltr || ((v2) => v2);
  const transformRTL = "rtl" in transform2 && transform2.rtl || ((v2) => v2);
  if (direction === "both" || direction === "ltr") {
    watchers.push(watchPausable(
      left,
      (newValue2) => {
        watchers.forEach((w) => w.pause());
        right.value = transformLTR(newValue2);
        watchers.forEach((w) => w.resume());
      },
      { flush, deep, immediate }
    ));
  }
  if (direction === "both" || direction === "rtl") {
    watchers.push(watchPausable(
      right,
      (newValue2) => {
        watchers.forEach((w) => w.pause());
        left.value = transformRTL(newValue2);
        watchers.forEach((w) => w.resume());
      },
      { flush, deep, immediate }
    ));
  }
  const stop2 = /* @__PURE__ */ __name(() => {
    watchers.forEach((w) => w.stop());
  }, "stop");
  return stop2;
}
__name(syncRef, "syncRef");
function syncRefs(source, targets, options4 = {}) {
  const {
    flush = "sync",
    deep = false,
    immediate = true
  } = options4;
  if (!Array.isArray(targets))
    targets = [targets];
  return watch(
    source,
    (newValue2) => targets.forEach((target) => target.value = newValue2),
    { flush, deep, immediate }
  );
}
__name(syncRefs, "syncRefs");
function toRefs(objectRef, options4 = {}) {
  if (!isRef(objectRef))
    return toRefs$1(objectRef);
  const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};
  for (const key in objectRef.value) {
    result[key] = customRef(() => ({
      get() {
        return objectRef.value[key];
      },
      set(v2) {
        var _a2;
        const replaceRef = (_a2 = toValue(options4.replaceRef)) != null ? _a2 : true;
        if (replaceRef) {
          if (Array.isArray(objectRef.value)) {
            const copy2 = [...objectRef.value];
            copy2[key] = v2;
            objectRef.value = copy2;
          } else {
            const newObject = { ...objectRef.value, [key]: v2 };
            Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));
            objectRef.value = newObject;
          }
        } else {
          objectRef.value[key] = v2;
        }
      }
    }));
  }
  return result;
}
__name(toRefs, "toRefs");
function tryOnBeforeMount(fn, sync = true, target) {
  const instance = getLifeCycleTarget(target);
  if (instance)
    onBeforeMount(fn, target);
  else if (sync)
    fn();
  else
    nextTick(fn);
}
__name(tryOnBeforeMount, "tryOnBeforeMount");
function tryOnBeforeUnmount(fn, target) {
  const instance = getLifeCycleTarget(target);
  if (instance)
    onBeforeUnmount(fn, target);
}
__name(tryOnBeforeUnmount, "tryOnBeforeUnmount");
function tryOnMounted(fn, sync = true, target) {
  const instance = getLifeCycleTarget();
  if (instance)
    onMounted(fn, target);
  else if (sync)
    fn();
  else
    nextTick(fn);
}
__name(tryOnMounted, "tryOnMounted");
function tryOnUnmounted(fn, target) {
  const instance = getLifeCycleTarget(target);
  if (instance)
    onUnmounted(fn, target);
}
__name(tryOnUnmounted, "tryOnUnmounted");
function createUntil(r, isNot = false) {
  function toMatch(condition, { flush = "sync", deep = false, timeout, throwOnTimeout } = {}) {
    let stop2 = null;
    const watcher = new Promise((resolve2) => {
      stop2 = watch(
        r,
        (v2) => {
          if (condition(v2) !== isNot) {
            if (stop2)
              stop2();
            else
              nextTick(() => stop2 == null ? void 0 : stop2());
            resolve2(v2);
          }
        },
        {
          flush,
          deep,
          immediate: true
        }
      );
    });
    const promises = [watcher];
    if (timeout != null) {
      promises.push(
        promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop2 == null ? void 0 : stop2())
      );
    }
    return Promise.race(promises);
  }
  __name(toMatch, "toMatch");
  function toBe(value4, options4) {
    if (!isRef(value4))
      return toMatch((v2) => v2 === value4, options4);
    const { flush = "sync", deep = false, timeout, throwOnTimeout } = options4 != null ? options4 : {};
    let stop2 = null;
    const watcher = new Promise((resolve2) => {
      stop2 = watch(
        [r, value4],
        ([v1, v2]) => {
          if (isNot !== (v1 === v2)) {
            if (stop2)
              stop2();
            else
              nextTick(() => stop2 == null ? void 0 : stop2());
            resolve2(v1);
          }
        },
        {
          flush,
          deep,
          immediate: true
        }
      );
    });
    const promises = [watcher];
    if (timeout != null) {
      promises.push(
        promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {
          stop2 == null ? void 0 : stop2();
          return toValue(r);
        })
      );
    }
    return Promise.race(promises);
  }
  __name(toBe, "toBe");
  function toBeTruthy(options4) {
    return toMatch((v2) => Boolean(v2), options4);
  }
  __name(toBeTruthy, "toBeTruthy");
  function toBeNull(options4) {
    return toBe(null, options4);
  }
  __name(toBeNull, "toBeNull");
  function toBeUndefined(options4) {
    return toBe(void 0, options4);
  }
  __name(toBeUndefined, "toBeUndefined");
  function toBeNaN(options4) {
    return toMatch(Number.isNaN, options4);
  }
  __name(toBeNaN, "toBeNaN");
  function toContains(value4, options4) {
    return toMatch((v2) => {
      const array = Array.from(v2);
      return array.includes(value4) || array.includes(toValue(value4));
    }, options4);
  }
  __name(toContains, "toContains");
  function changed(options4) {
    return changedTimes(1, options4);
  }
  __name(changed, "changed");
  function changedTimes(n = 1, options4) {
    let count = -1;
    return toMatch(() => {
      count += 1;
      return count >= n;
    }, options4);
  }
  __name(changedTimes, "changedTimes");
  if (Array.isArray(toValue(r))) {
    const instance = {
      toMatch,
      toContains,
      changed,
      changedTimes,
      get not() {
        return createUntil(r, !isNot);
      }
    };
    return instance;
  } else {
    const instance = {
      toMatch,
      toBe,
      toBeTruthy,
      toBeNull,
      toBeNaN,
      toBeUndefined,
      changed,
      changedTimes,
      get not() {
        return createUntil(r, !isNot);
      }
    };
    return instance;
  }
}
__name(createUntil, "createUntil");
function until(r) {
  return createUntil(r);
}
__name(until, "until");
function defaultComparator(value4, othVal) {
  return value4 === othVal;
}
__name(defaultComparator, "defaultComparator");
function useArrayDifference(...args) {
  var _a2;
  const list2 = args[0];
  const values = args[1];
  let compareFn = (_a2 = args[2]) != null ? _a2 : defaultComparator;
  if (typeof compareFn === "string") {
    const key = compareFn;
    compareFn = /* @__PURE__ */ __name((value4, othVal) => value4[key] === othVal[key], "compareFn");
  }
  return computed(() => toValue(list2).filter((x2) => toValue(values).findIndex((y2) => compareFn(x2, y2)) === -1));
}
__name(useArrayDifference, "useArrayDifference");
function useArrayEvery(list2, fn) {
  return computed(() => toValue(list2).every((element, index2, array) => fn(toValue(element), index2, array)));
}
__name(useArrayEvery, "useArrayEvery");
function useArrayFilter(list2, fn) {
  return computed(() => toValue(list2).map((i2) => toValue(i2)).filter(fn));
}
__name(useArrayFilter, "useArrayFilter");
function useArrayFind(list2, fn) {
  return computed(() => toValue(
    toValue(list2).find((element, index2, array) => fn(toValue(element), index2, array))
  ));
}
__name(useArrayFind, "useArrayFind");
function useArrayFindIndex(list2, fn) {
  return computed(() => toValue(list2).findIndex((element, index2, array) => fn(toValue(element), index2, array)));
}
__name(useArrayFindIndex, "useArrayFindIndex");
function findLast(arr, cb) {
  let index2 = arr.length;
  while (index2-- > 0) {
    if (cb(arr[index2], index2, arr))
      return arr[index2];
  }
  return void 0;
}
__name(findLast, "findLast");
function useArrayFindLast(list2, fn) {
  return computed(() => toValue(
    !Array.prototype.findLast ? findLast(toValue(list2), (element, index2, array) => fn(toValue(element), index2, array)) : toValue(list2).findLast((element, index2, array) => fn(toValue(element), index2, array))
  ));
}
__name(useArrayFindLast, "useArrayFindLast");
function isArrayIncludesOptions(obj) {
  return isObject$4(obj) && containsProp(obj, "formIndex", "comparator");
}
__name(isArrayIncludesOptions, "isArrayIncludesOptions");
function useArrayIncludes(...args) {
  var _a2;
  const list2 = args[0];
  const value4 = args[1];
  let comparator2 = args[2];
  let formIndex = 0;
  if (isArrayIncludesOptions(comparator2)) {
    formIndex = (_a2 = comparator2.fromIndex) != null ? _a2 : 0;
    comparator2 = comparator2.comparator;
  }
  if (typeof comparator2 === "string") {
    const key = comparator2;
    comparator2 = /* @__PURE__ */ __name((element, value22) => element[key] === toValue(value22), "comparator");
  }
  comparator2 = comparator2 != null ? comparator2 : (element, value22) => element === toValue(value22);
  return computed(() => toValue(list2).slice(formIndex).some((element, index2, array) => comparator2(
    toValue(element),
    toValue(value4),
    index2,
    toValue(array)
  )));
}
__name(useArrayIncludes, "useArrayIncludes");
function useArrayJoin(list2, separator) {
  return computed(() => toValue(list2).map((i2) => toValue(i2)).join(toValue(separator)));
}
__name(useArrayJoin, "useArrayJoin");
function useArrayMap(list2, fn) {
  return computed(() => toValue(list2).map((i2) => toValue(i2)).map(fn));
}
__name(useArrayMap, "useArrayMap");
function useArrayReduce(list2, reducer, ...args) {
  const reduceCallback = /* @__PURE__ */ __name((sum, value4, index2) => reducer(toValue(sum), toValue(value4), index2), "reduceCallback");
  return computed(() => {
    const resolved = toValue(list2);
    return args.length ? resolved.reduce(reduceCallback, toValue(args[0])) : resolved.reduce(reduceCallback);
  });
}
__name(useArrayReduce, "useArrayReduce");
function useArraySome(list2, fn) {
  return computed(() => toValue(list2).some((element, index2, array) => fn(toValue(element), index2, array)));
}
__name(useArraySome, "useArraySome");
function uniq(array) {
  return Array.from(new Set(array));
}
__name(uniq, "uniq");
function uniqueElementsBy(array, fn) {
  return array.reduce((acc, v2) => {
    if (!acc.some((x2) => fn(v2, x2, array)))
      acc.push(v2);
    return acc;
  }, []);
}
__name(uniqueElementsBy, "uniqueElementsBy");
function useArrayUnique(list2, compareFn) {
  return computed(() => {
    const resolvedList = toValue(list2).map((element) => toValue(element));
    return compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);
  });
}
__name(useArrayUnique, "useArrayUnique");
function useCounter(initialValue = 0, options4 = {}) {
  let _initialValue = unref(initialValue);
  const count = ref(initialValue);
  const {
    max = Number.POSITIVE_INFINITY,
    min = Number.NEGATIVE_INFINITY
  } = options4;
  const inc2 = /* @__PURE__ */ __name((delta2 = 1) => count.value = Math.max(Math.min(max, count.value + delta2), min), "inc");
  const dec = /* @__PURE__ */ __name((delta2 = 1) => count.value = Math.min(Math.max(min, count.value - delta2), max), "dec");
  const get22 = /* @__PURE__ */ __name(() => count.value, "get2");
  const set22 = /* @__PURE__ */ __name((val) => count.value = Math.max(min, Math.min(max, val)), "set2");
  const reset2 = /* @__PURE__ */ __name((val = _initialValue) => {
    _initialValue = val;
    return set22(val);
  }, "reset");
  return { count, inc: inc2, dec, get: get22, set: set22, reset: reset2 };
}
__name(useCounter, "useCounter");
const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[T\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/i;
const REGEX_FORMAT = /[YMDHhms]o|\[([^\]]+)\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
function defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {
  let m = hours < 12 ? "AM" : "PM";
  if (hasPeriod)
    m = m.split("").reduce((acc, curr) => acc += `${curr}.`, "");
  return isLowercase ? m.toLowerCase() : m;
}
__name(defaultMeridiem, "defaultMeridiem");
function formatOrdinal(num) {
  const suffixes = ["th", "st", "nd", "rd"];
  const v2 = num % 100;
  return num + (suffixes[(v2 - 20) % 10] || suffixes[v2] || suffixes[0]);
}
__name(formatOrdinal, "formatOrdinal");
function formatDate$1(date, formatStr, options4 = {}) {
  var _a2;
  const years = date.getFullYear();
  const month = date.getMonth();
  const days = date.getDate();
  const hours = date.getHours();
  const minutes = date.getMinutes();
  const seconds = date.getSeconds();
  const milliseconds = date.getMilliseconds();
  const day = date.getDay();
  const meridiem = (_a2 = options4.customMeridiem) != null ? _a2 : defaultMeridiem;
  const matches2 = {
    Yo: /* @__PURE__ */ __name(() => formatOrdinal(years), "Yo"),
    YY: /* @__PURE__ */ __name(() => String(years).slice(-2), "YY"),
    YYYY: /* @__PURE__ */ __name(() => years, "YYYY"),
    M: /* @__PURE__ */ __name(() => month + 1, "M"),
    Mo: /* @__PURE__ */ __name(() => formatOrdinal(month + 1), "Mo"),
    MM: /* @__PURE__ */ __name(() => `${month + 1}`.padStart(2, "0"), "MM"),
    MMM: /* @__PURE__ */ __name(() => date.toLocaleDateString(toValue(options4.locales), { month: "short" }), "MMM"),
    MMMM: /* @__PURE__ */ __name(() => date.toLocaleDateString(toValue(options4.locales), { month: "long" }), "MMMM"),
    D: /* @__PURE__ */ __name(() => String(days), "D"),
    Do: /* @__PURE__ */ __name(() => formatOrdinal(days), "Do"),
    DD: /* @__PURE__ */ __name(() => `${days}`.padStart(2, "0"), "DD"),
    H: /* @__PURE__ */ __name(() => String(hours), "H"),
    Ho: /* @__PURE__ */ __name(() => formatOrdinal(hours), "Ho"),
    HH: /* @__PURE__ */ __name(() => `${hours}`.padStart(2, "0"), "HH"),
    h: /* @__PURE__ */ __name(() => `${hours % 12 || 12}`.padStart(1, "0"), "h"),
    ho: /* @__PURE__ */ __name(() => formatOrdinal(hours % 12 || 12), "ho"),
    hh: /* @__PURE__ */ __name(() => `${hours % 12 || 12}`.padStart(2, "0"), "hh"),
    m: /* @__PURE__ */ __name(() => String(minutes), "m"),
    mo: /* @__PURE__ */ __name(() => formatOrdinal(minutes), "mo"),
    mm: /* @__PURE__ */ __name(() => `${minutes}`.padStart(2, "0"), "mm"),
    s: /* @__PURE__ */ __name(() => String(seconds), "s"),
    so: /* @__PURE__ */ __name(() => formatOrdinal(seconds), "so"),
    ss: /* @__PURE__ */ __name(() => `${seconds}`.padStart(2, "0"), "ss"),
    SSS: /* @__PURE__ */ __name(() => `${milliseconds}`.padStart(3, "0"), "SSS"),
    d: /* @__PURE__ */ __name(() => day, "d"),
    dd: /* @__PURE__ */ __name(() => date.toLocaleDateString(toValue(options4.locales), { weekday: "narrow" }), "dd"),
    ddd: /* @__PURE__ */ __name(() => date.toLocaleDateString(toValue(options4.locales), { weekday: "short" }), "ddd"),
    dddd: /* @__PURE__ */ __name(() => date.toLocaleDateString(toValue(options4.locales), { weekday: "long" }), "dddd"),
    A: /* @__PURE__ */ __name(() => meridiem(hours, minutes), "A"),
    AA: /* @__PURE__ */ __name(() => meridiem(hours, minutes, false, true), "AA"),
    a: /* @__PURE__ */ __name(() => meridiem(hours, minutes, true), "a"),
    aa: /* @__PURE__ */ __name(() => meridiem(hours, minutes, true, true), "aa")
  };
  return formatStr.replace(REGEX_FORMAT, (match2, $1) => {
    var _a22, _b;
    return (_b = $1 != null ? $1 : (_a22 = matches2[match2]) == null ? void 0 : _a22.call(matches2)) != null ? _b : match2;
  });
}
__name(formatDate$1, "formatDate$1");
function normalizeDate(date) {
  if (date === null)
    return new Date(Number.NaN);
  if (date === void 0)
    return /* @__PURE__ */ new Date();
  if (date instanceof Date)
    return new Date(date);
  if (typeof date === "string" && !/Z$/i.test(date)) {
    const d = date.match(REGEX_PARSE);
    if (d) {
      const m = d[2] - 1 || 0;
      const ms = (d[7] || "0").substring(0, 3);
      return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
    }
  }
  return new Date(date);
}
__name(normalizeDate, "normalizeDate");
function useDateFormat(date, formatStr = "HH:mm:ss", options4 = {}) {
  return computed(() => formatDate$1(normalizeDate(toValue(date)), toValue(formatStr), options4));
}
__name(useDateFormat, "useDateFormat");
function useIntervalFn(cb, interval = 1e3, options4 = {}) {
  const {
    immediate = true,
    immediateCallback = false
  } = options4;
  let timer = null;
  const isActive2 = ref(false);
  function clean() {
    if (timer) {
      clearInterval(timer);
      timer = null;
    }
  }
  __name(clean, "clean");
  function pause() {
    isActive2.value = false;
    clean();
  }
  __name(pause, "pause");
  function resume() {
    const intervalValue = toValue(interval);
    if (intervalValue <= 0)
      return;
    isActive2.value = true;
    if (immediateCallback)
      cb();
    clean();
    timer = setInterval(cb, intervalValue);
  }
  __name(resume, "resume");
  if (immediate && isClient)
    resume();
  if (isRef(interval) || typeof interval === "function") {
    const stopWatch = watch(interval, () => {
      if (isActive2.value && isClient)
        resume();
    });
    tryOnScopeDispose(stopWatch);
  }
  tryOnScopeDispose(pause);
  return {
    isActive: isActive2,
    pause,
    resume
  };
}
__name(useIntervalFn, "useIntervalFn");
function useInterval(interval = 1e3, options4 = {}) {
  const {
    controls: exposeControls = false,
    immediate = true,
    callback
  } = options4;
  const counter = ref(0);
  const update = /* @__PURE__ */ __name(() => counter.value += 1, "update");
  const reset2 = /* @__PURE__ */ __name(() => {
    counter.value = 0;
  }, "reset");
  const controls = useIntervalFn(
    callback ? () => {
      update();
      callback(counter.value);
    } : update,
    interval,
    { immediate }
  );
  if (exposeControls) {
    return {
      counter,
      reset: reset2,
      ...controls
    };
  } else {
    return counter;
  }
}
__name(useInterval, "useInterval");
function useLastChanged(source, options4 = {}) {
  var _a2;
  const ms = ref((_a2 = options4.initialValue) != null ? _a2 : null);
  watch(
    source,
    () => ms.value = timestamp(),
    options4
  );
  return ms;
}
__name(useLastChanged, "useLastChanged");
function useTimeoutFn(cb, interval, options4 = {}) {
  const {
    immediate = true
  } = options4;
  const isPending = ref(false);
  let timer = null;
  function clear2() {
    if (timer) {
      clearTimeout(timer);
      timer = null;
    }
  }
  __name(clear2, "clear");
  function stop2() {
    isPending.value = false;
    clear2();
  }
  __name(stop2, "stop");
  function start2(...args) {
    clear2();
    isPending.value = true;
    timer = setTimeout(() => {
      isPending.value = false;
      timer = null;
      cb(...args);
    }, toValue(interval));
  }
  __name(start2, "start");
  if (immediate) {
    isPending.value = true;
    if (isClient)
      start2();
  }
  tryOnScopeDispose(stop2);
  return {
    isPending: readonly(isPending),
    start: start2,
    stop: stop2
  };
}
__name(useTimeoutFn, "useTimeoutFn");
function useTimeout(interval = 1e3, options4 = {}) {
  const {
    controls: exposeControls = false,
    callback
  } = options4;
  const controls = useTimeoutFn(
    callback != null ? callback : noop$1,
    interval,
    options4
  );
  const ready = computed(() => !controls.isPending.value);
  if (exposeControls) {
    return {
      ready,
      ...controls
    };
  } else {
    return ready;
  }
}
__name(useTimeout, "useTimeout");
function useToNumber(value4, options4 = {}) {
  const {
    method = "parseFloat",
    radix,
    nanToZero
  } = options4;
  return computed(() => {
    let resolved = toValue(value4);
    if (typeof resolved === "string")
      resolved = Number[method](resolved, radix);
    if (nanToZero && Number.isNaN(resolved))
      resolved = 0;
    return resolved;
  });
}
__name(useToNumber, "useToNumber");
function useToString(value4) {
  return computed(() => `${toValue(value4)}`);
}
__name(useToString, "useToString");
function useToggle(initialValue = false, options4 = {}) {
  const {
    truthyValue = true,
    falsyValue = false
  } = options4;
  const valueIsRef = isRef(initialValue);
  const _value = ref(initialValue);
  function toggle4(value4) {
    if (arguments.length) {
      _value.value = value4;
      return _value.value;
    } else {
      const truthy = toValue(truthyValue);
      _value.value = _value.value === truthy ? toValue(falsyValue) : truthy;
      return _value.value;
    }
  }
  __name(toggle4, "toggle");
  if (valueIsRef)
    return toggle4;
  else
    return [_value, toggle4];
}
__name(useToggle, "useToggle");
function watchArray(source, cb, options4) {
  let oldList = (options4 == null ? void 0 : options4.immediate) ? [] : [...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)];
  return watch(source, (newList, _2, onCleanup) => {
    const oldListRemains = Array.from({ length: oldList.length });
    const added = [];
    for (const obj of newList) {
      let found2 = false;
      for (let i2 = 0; i2 < oldList.length; i2++) {
        if (!oldListRemains[i2] && obj === oldList[i2]) {
          oldListRemains[i2] = true;
          found2 = true;
          break;
        }
      }
      if (!found2)
        added.push(obj);
    }
    const removed = oldList.filter((_22, i2) => !oldListRemains[i2]);
    cb(newList, oldList, added, removed, onCleanup);
    oldList = [...newList];
  }, options4);
}
__name(watchArray, "watchArray");
function watchAtMost(source, cb, options4) {
  const {
    count,
    ...watchOptions
  } = options4;
  const current = ref(0);
  const stop2 = watchWithFilter(
    source,
    (...args) => {
      current.value += 1;
      if (current.value >= toValue(count))
        nextTick(() => stop2());
      cb(...args);
    },
    watchOptions
  );
  return { count: current, stop: stop2 };
}
__name(watchAtMost, "watchAtMost");
function watchDebounced(source, cb, options4 = {}) {
  const {
    debounce = 0,
    maxWait = void 0,
    ...watchOptions
  } = options4;
  return watchWithFilter(
    source,
    cb,
    {
      ...watchOptions,
      eventFilter: debounceFilter(debounce, { maxWait })
    }
  );
}
__name(watchDebounced, "watchDebounced");
function watchDeep(source, cb, options4) {
  return watch(
    source,
    cb,
    {
      ...options4,
      deep: true
    }
  );
}
__name(watchDeep, "watchDeep");
function watchIgnorable(source, cb, options4 = {}) {
  const {
    eventFilter = bypassFilter,
    ...watchOptions
  } = options4;
  const filteredCb = createFilterWrapper(
    eventFilter,
    cb
  );
  let ignoreUpdates;
  let ignorePrevAsyncUpdates;
  let stop2;
  if (watchOptions.flush === "sync") {
    const ignore = ref(false);
    ignorePrevAsyncUpdates = /* @__PURE__ */ __name(() => {
    }, "ignorePrevAsyncUpdates");
    ignoreUpdates = /* @__PURE__ */ __name((updater) => {
      ignore.value = true;
      updater();
      ignore.value = false;
    }, "ignoreUpdates");
    stop2 = watch(
      source,
      (...args) => {
        if (!ignore.value)
          filteredCb(...args);
      },
      watchOptions
    );
  } else {
    const disposables = [];
    const ignoreCounter = ref(0);
    const syncCounter = ref(0);
    ignorePrevAsyncUpdates = /* @__PURE__ */ __name(() => {
      ignoreCounter.value = syncCounter.value;
    }, "ignorePrevAsyncUpdates");
    disposables.push(
      watch(
        source,
        () => {
          syncCounter.value++;
        },
        { ...watchOptions, flush: "sync" }
      )
    );
    ignoreUpdates = /* @__PURE__ */ __name((updater) => {
      const syncCounterPrev = syncCounter.value;
      updater();
      ignoreCounter.value += syncCounter.value - syncCounterPrev;
    }, "ignoreUpdates");
    disposables.push(
      watch(
        source,
        (...args) => {
          const ignore = ignoreCounter.value > 0 && ignoreCounter.value === syncCounter.value;
          ignoreCounter.value = 0;
          syncCounter.value = 0;
          if (ignore)
            return;
          filteredCb(...args);
        },
        watchOptions
      )
    );
    stop2 = /* @__PURE__ */ __name(() => {
      disposables.forEach((fn) => fn());
    }, "stop");
  }
  return { stop: stop2, ignoreUpdates, ignorePrevAsyncUpdates };
}
__name(watchIgnorable, "watchIgnorable");
function watchImmediate(source, cb, options4) {
  return watch(
    source,
    cb,
    {
      ...options4,
      immediate: true
    }
  );
}
__name(watchImmediate, "watchImmediate");
function watchOnce(source, cb, options4) {
  const stop2 = watch(source, (...args) => {
    nextTick(() => stop2());
    return cb(...args);
  }, options4);
  return stop2;
}
__name(watchOnce, "watchOnce");
function watchThrottled(source, cb, options4 = {}) {
  const {
    throttle: throttle2 = 0,
    trailing = true,
    leading = true,
    ...watchOptions
  } = options4;
  return watchWithFilter(
    source,
    cb,
    {
      ...watchOptions,
      eventFilter: throttleFilter(throttle2, trailing, leading)
    }
  );
}
__name(watchThrottled, "watchThrottled");
function watchTriggerable(source, cb, options4 = {}) {
  let cleanupFn;
  function onEffect() {
    if (!cleanupFn)
      return;
    const fn = cleanupFn;
    cleanupFn = void 0;
    fn();
  }
  __name(onEffect, "onEffect");
  function onCleanup(callback) {
    cleanupFn = callback;
  }
  __name(onCleanup, "onCleanup");
  const _cb = /* @__PURE__ */ __name((value4, oldValue2) => {
    onEffect();
    return cb(value4, oldValue2, onCleanup);
  }, "_cb");
  const res = watchIgnorable(source, _cb, options4);
  const { ignoreUpdates } = res;
  const trigger2 = /* @__PURE__ */ __name(() => {
    let res2;
    ignoreUpdates(() => {
      res2 = _cb(getWatchSources(source), getOldValue(source));
    });
    return res2;
  }, "trigger");
  return {
    ...res,
    trigger: trigger2
  };
}
__name(watchTriggerable, "watchTriggerable");
function getWatchSources(sources) {
  if (isReactive(sources))
    return sources;
  if (Array.isArray(sources))
    return sources.map((item3) => toValue(item3));
  return toValue(sources);
}
__name(getWatchSources, "getWatchSources");
function getOldValue(source) {
  return Array.isArray(source) ? source.map(() => void 0) : void 0;
}
__name(getOldValue, "getOldValue");
function whenever(source, cb, options4) {
  const stop2 = watch(
    source,
    (v2, ov, onInvalidate) => {
      if (v2) {
        if (options4 == null ? void 0 : options4.once)
          nextTick(() => stop2());
        cb(v2, ov, onInvalidate);
      }
    },
    {
      ...options4,
      once: false
    }
  );
  return stop2;
}
__name(whenever, "whenever");
var isVue2 = false;
var isVue3 = true;
var Vue2 = void 0;
function install$6() {
}
__name(install$6, "install$6");
function set(target, key, val) {
  if (Array.isArray(target)) {
    target.length = Math.max(target.length, key);
    target.splice(key, 1, val);
    return val;
  }
  target[key] = val;
  return val;
}
__name(set, "set");
function del$1(target, key) {
  if (Array.isArray(target)) {
    target.splice(key, 1);
    return;
  }
  delete target[key];
}
__name(del$1, "del$1");
function computedAsync(evaluationCallback, initialState, optionsOrRef) {
  let options4;
  if (isRef(optionsOrRef)) {
    options4 = {
      evaluating: optionsOrRef
    };
  } else {
    options4 = optionsOrRef || {};
  }
  const {
    lazy = false,
    evaluating = void 0,
    shallow = true,
    onError = noop$1
  } = options4;
  const started = ref(!lazy);
  const current = shallow ? shallowRef(initialState) : ref(initialState);
  let counter = 0;
  watchEffect(async (onInvalidate) => {
    if (!started.value)
      return;
    counter++;
    const counterAtBeginning = counter;
    let hasFinished = false;
    if (evaluating) {
      Promise.resolve().then(() => {
        evaluating.value = true;
      });
    }
    try {
      const result = await evaluationCallback((cancelCallback) => {
        onInvalidate(() => {
          if (evaluating)
            evaluating.value = false;
          if (!hasFinished)
            cancelCallback();
        });
      });
      if (counterAtBeginning === counter)
        current.value = result;
    } catch (e2) {
      onError(e2);
    } finally {
      if (evaluating && counterAtBeginning === counter)
        evaluating.value = false;
      hasFinished = true;
    }
  });
  if (lazy) {
    return computed(() => {
      started.value = true;
      return current.value;
    });
  } else {
    return current;
  }
}
__name(computedAsync, "computedAsync");
function computedInject(key, options4, defaultSource, treatDefaultAsFactory) {
  let source = inject(key);
  if (defaultSource)
    source = inject(key, defaultSource);
  if (treatDefaultAsFactory)
    source = inject(key, defaultSource, treatDefaultAsFactory);
  if (typeof options4 === "function") {
    return computed((ctx) => options4(source, ctx));
  } else {
    return computed({
      get: /* @__PURE__ */ __name((ctx) => options4.get(source, ctx), "get"),
      set: options4.set
    });
  }
}
__name(computedInject, "computedInject");
function createReusableTemplate(options4 = {}) {
  if (!isVue3 && !version.startsWith("2.7.")) {
    if (false)
      throw new Error("[VueUse] createReusableTemplate only works in Vue 2.7 or above.");
    return;
  }
  const {
    inheritAttrs = true
  } = options4;
  const render2 = shallowRef();
  const define = /* @__PURE__ */ defineComponent({
    setup(_2, { slots }) {
      return () => {
        render2.value = slots.default;
      };
    }
  });
  const reuse = /* @__PURE__ */ defineComponent({
    inheritAttrs,
    setup(_2, { attrs: attrs4, slots }) {
      return () => {
        var _a2;
        if (!render2.value && false)
          throw new Error("[VueUse] Failed to find the definition of reusable template");
        const vnode = (_a2 = render2.value) == null ? void 0 : _a2.call(render2, { ...keysToCamelKebabCase(attrs4), $slots: slots });
        return inheritAttrs && (vnode == null ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;
      };
    }
  });
  return makeDestructurable(
    { define, reuse },
    [define, reuse]
  );
}
__name(createReusableTemplate, "createReusableTemplate");
function keysToCamelKebabCase(obj) {
  const newObj = {};
  for (const key in obj)
    newObj[camelize(key)] = obj[key];
  return newObj;
}
__name(keysToCamelKebabCase, "keysToCamelKebabCase");
function createTemplatePromise(options4 = {}) {
  if (!isVue3) {
    if (false)
      throw new Error("[VueUse] createTemplatePromise only works in Vue 3 or above.");
    return;
  }
  let index2 = 0;
  const instances = ref([]);
  function create3(...args) {
    const props = shallowReactive({
      key: index2++,
      args,
      promise: void 0,
      resolve: /* @__PURE__ */ __name(() => {
      }, "resolve"),
      reject: /* @__PURE__ */ __name(() => {
      }, "reject"),
      isResolving: false,
      options: options4
    });
    instances.value.push(props);
    props.promise = new Promise((_resolve, _reject) => {
      props.resolve = (v2) => {
        props.isResolving = true;
        return _resolve(v2);
      };
      props.reject = _reject;
    }).finally(() => {
      props.promise = void 0;
      const index22 = instances.value.indexOf(props);
      if (index22 !== -1)
        instances.value.splice(index22, 1);
    });
    return props.promise;
  }
  __name(create3, "create");
  function start2(...args) {
    if (options4.singleton && instances.value.length > 0)
      return instances.value[0].promise;
    return create3(...args);
  }
  __name(start2, "start");
  const component = /* @__PURE__ */ defineComponent((_2, { slots }) => {
    const renderList2 = /* @__PURE__ */ __name(() => instances.value.map((props) => {
      var _a2;
      return h(Fragment$1, { key: props.key }, (_a2 = slots.default) == null ? void 0 : _a2.call(slots, props));
    }), "renderList");
    if (options4.transition)
      return () => h(TransitionGroup, options4.transition, renderList2);
    return renderList2;
  });
  component.start = start2;
  return component;
}
__name(createTemplatePromise, "createTemplatePromise");
function createUnrefFn(fn) {
  return function(...args) {
    return fn.apply(this, args.map((i2) => toValue(i2)));
  };
}
__name(createUnrefFn, "createUnrefFn");
function unrefElement(elRef) {
  var _a2;
  const plain = toValue(elRef);
  return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
}
__name(unrefElement, "unrefElement");
const defaultWindow = isClient ? window : void 0;
const defaultDocument = isClient ? window.document : void 0;
const defaultNavigator = isClient ? window.navigator : void 0;
const defaultLocation = isClient ? window.location : void 0;
function useEventListener(...args) {
  let target;
  let events2;
  let listeners;
  let options4;
  if (typeof args[0] === "string" || Array.isArray(args[0])) {
    [events2, listeners, options4] = args;
    target = defaultWindow;
  } else {
    [target, events2, listeners, options4] = args;
  }
  if (!target)
    return noop$1;
  if (!Array.isArray(events2))
    events2 = [events2];
  if (!Array.isArray(listeners))
    listeners = [listeners];
  const cleanups = [];
  const cleanup = /* @__PURE__ */ __name(() => {
    cleanups.forEach((fn) => fn());
    cleanups.length = 0;
  }, "cleanup");
  const register3 = /* @__PURE__ */ __name((el, event, listener, options22) => {
    el.addEventListener(event, listener, options22);
    return () => el.removeEventListener(event, listener, options22);
  }, "register");
  const stopWatch = watch(
    () => [unrefElement(target), toValue(options4)],
    ([el, options22]) => {
      cleanup();
      if (!el)
        return;
      const optionsClone = isObject$4(options22) ? { ...options22 } : options22;
      cleanups.push(
        ...events2.flatMap((event) => {
          return listeners.map((listener) => register3(el, event, listener, optionsClone));
        })
      );
    },
    { immediate: true, flush: "post" }
  );
  const stop2 = /* @__PURE__ */ __name(() => {
    stopWatch();
    cleanup();
  }, "stop");
  tryOnScopeDispose(stop2);
  return stop2;
}
__name(useEventListener, "useEventListener");
let _iOSWorkaround = false;
function onClickOutside(target, handler6, options4 = {}) {
  const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options4;
  if (!window2)
    return noop$1;
  if (isIOS && !_iOSWorkaround) {
    _iOSWorkaround = true;
    Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop$1));
    window2.document.documentElement.addEventListener("click", noop$1);
  }
  let shouldListen = true;
  const shouldIgnore = /* @__PURE__ */ __name((event) => {
    return ignore.some((target2) => {
      if (typeof target2 === "string") {
        return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));
      } else {
        const el = unrefElement(target2);
        return el && (event.target === el || event.composedPath().includes(el));
      }
    });
  }, "shouldIgnore");
  const listener = /* @__PURE__ */ __name((event) => {
    const el = unrefElement(target);
    if (!el || el === event.target || event.composedPath().includes(el))
      return;
    if (event.detail === 0)
      shouldListen = !shouldIgnore(event);
    if (!shouldListen) {
      shouldListen = true;
      return;
    }
    handler6(event);
  }, "listener");
  const cleanup = [
    useEventListener(window2, "click", listener, { passive: true, capture }),
    useEventListener(window2, "pointerdown", (e2) => {
      const el = unrefElement(target);
      shouldListen = !shouldIgnore(e2) && !!(el && !e2.composedPath().includes(el));
    }, { passive: true }),
    detectIframe && useEventListener(window2, "blur", (event) => {
      setTimeout(() => {
        var _a2;
        const el = unrefElement(target);
        if (((_a2 = window2.document.activeElement) == null ? void 0 : _a2.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement))) {
          handler6(event);
        }
      }, 0);
    })
  ].filter(Boolean);
  const stop2 = /* @__PURE__ */ __name(() => cleanup.forEach((fn) => fn()), "stop");
  return stop2;
}
__name(onClickOutside, "onClickOutside");
function createKeyPredicate(keyFilter) {
  if (typeof keyFilter === "function")
    return keyFilter;
  else if (typeof keyFilter === "string")
    return (event) => event.key === keyFilter;
  else if (Array.isArray(keyFilter))
    return (event) => keyFilter.includes(event.key);
  return () => true;
}
__name(createKeyPredicate, "createKeyPredicate");
function onKeyStroke(...args) {
  let key;
  let handler6;
  let options4 = {};
  if (args.length === 3) {
    key = args[0];
    handler6 = args[1];
    options4 = args[2];
  } else if (args.length === 2) {
    if (typeof args[1] === "object") {
      key = true;
      handler6 = args[0];
      options4 = args[1];
    } else {
      key = args[0];
      handler6 = args[1];
    }
  } else {
    key = true;
    handler6 = args[0];
  }
  const {
    target = defaultWindow,
    eventName = "keydown",
    passive = false,
    dedupe = false
  } = options4;
  const predicate = createKeyPredicate(key);
  const listener = /* @__PURE__ */ __name((e2) => {
    if (e2.repeat && toValue(dedupe))
      return;
    if (predicate(e2))
      handler6(e2);
  }, "listener");
  return useEventListener(target, eventName, listener, passive);
}
__name(onKeyStroke, "onKeyStroke");
function onKeyDown(key, handler6, options4 = {}) {
  return onKeyStroke(key, handler6, { ...options4, eventName: "keydown" });
}
__name(onKeyDown, "onKeyDown");
function onKeyPressed(key, handler6, options4 = {}) {
  return onKeyStroke(key, handler6, { ...options4, eventName: "keypress" });
}
__name(onKeyPressed, "onKeyPressed");
function onKeyUp(key, handler6, options4 = {}) {
  return onKeyStroke(key, handler6, { ...options4, eventName: "keyup" });
}
__name(onKeyUp, "onKeyUp");
const DEFAULT_DELAY = 500;
const DEFAULT_THRESHOLD = 10;
function onLongPress(target, handler6, options4) {
  var _a2, _b;
  const elementRef2 = computed(() => unrefElement(target));
  let timeout;
  let posStart;
  let startTimestamp;
  let hasLongPressed = false;
  function clear2() {
    if (timeout) {
      clearTimeout(timeout);
      timeout = void 0;
    }
    posStart = void 0;
    startTimestamp = void 0;
    hasLongPressed = false;
  }
  __name(clear2, "clear");
  function onRelease(ev) {
    var _a22, _b2, _c;
    const [_startTimestamp, _posStart, _hasLongPressed] = [startTimestamp, posStart, hasLongPressed];
    clear2();
    if (!(options4 == null ? void 0 : options4.onMouseUp) || !_posStart || !_startTimestamp)
      return;
    if (((_a22 = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _a22.self) && ev.target !== elementRef2.value)
      return;
    if ((_b2 = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _b2.prevent)
      ev.preventDefault();
    if ((_c = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _c.stop)
      ev.stopPropagation();
    const dx = ev.x - _posStart.x;
    const dy = ev.y - _posStart.y;
    const distance2 = Math.sqrt(dx * dx + dy * dy);
    options4.onMouseUp(ev.timeStamp - _startTimestamp, distance2, _hasLongPressed);
  }
  __name(onRelease, "onRelease");
  function onDown(ev) {
    var _a22, _b2, _c, _d;
    if (((_a22 = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _a22.self) && ev.target !== elementRef2.value)
      return;
    clear2();
    if ((_b2 = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _b2.prevent)
      ev.preventDefault();
    if ((_c = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _c.stop)
      ev.stopPropagation();
    posStart = {
      x: ev.x,
      y: ev.y
    };
    startTimestamp = ev.timeStamp;
    timeout = setTimeout(
      () => {
        hasLongPressed = true;
        handler6(ev);
      },
      (_d = options4 == null ? void 0 : options4.delay) != null ? _d : DEFAULT_DELAY
    );
  }
  __name(onDown, "onDown");
  function onMove(ev) {
    var _a22, _b2, _c, _d;
    if (((_a22 = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _a22.self) && ev.target !== elementRef2.value)
      return;
    if (!posStart || (options4 == null ? void 0 : options4.distanceThreshold) === false)
      return;
    if ((_b2 = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _b2.prevent)
      ev.preventDefault();
    if ((_c = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _c.stop)
      ev.stopPropagation();
    const dx = ev.x - posStart.x;
    const dy = ev.y - posStart.y;
    const distance2 = Math.sqrt(dx * dx + dy * dy);
    if (distance2 >= ((_d = options4 == null ? void 0 : options4.distanceThreshold) != null ? _d : DEFAULT_THRESHOLD))
      clear2();
  }
  __name(onMove, "onMove");
  const listenerOptions = {
    capture: (_a2 = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _a2.capture,
    once: (_b = options4 == null ? void 0 : options4.modifiers) == null ? void 0 : _b.once
  };
  const cleanup = [
    useEventListener(elementRef2, "pointerdown", onDown, listenerOptions),
    useEventListener(elementRef2, "pointermove", onMove, listenerOptions),
    useEventListener(elementRef2, ["pointerup", "pointerleave"], onRelease, listenerOptions)
  ];
  const stop2 = /* @__PURE__ */ __name(() => cleanup.forEach((fn) => fn()), "stop");
  return stop2;
}
__name(onLongPress, "onLongPress");
function isFocusedElementEditable() {
  const { activeElement, body } = document;
  if (!activeElement)
    return false;
  if (activeElement === body)
    return false;
  switch (activeElement.tagName) {
    case "INPUT":
    case "TEXTAREA":
      return true;
  }
  return activeElement.hasAttribute("contenteditable");
}
__name(isFocusedElementEditable, "isFocusedElementEditable");
function isTypedCharValid({
  keyCode,
  metaKey,
  ctrlKey,
  altKey
}) {
  if (metaKey || ctrlKey || altKey)
    return false;
  if (keyCode >= 48 && keyCode <= 57)
    return true;
  if (keyCode >= 65 && keyCode <= 90)
    return true;
  if (keyCode >= 97 && keyCode <= 122)
    return true;
  return false;
}
__name(isTypedCharValid, "isTypedCharValid");
function onStartTyping(callback, options4 = {}) {
  const { document: document2 = defaultDocument } = options4;
  const keydown = /* @__PURE__ */ __name((event) => {
    if (!isFocusedElementEditable() && isTypedCharValid(event)) {
      callback(event);
    }
  }, "keydown");
  if (document2)
    useEventListener(document2, "keydown", keydown, { passive: true });
}
__name(onStartTyping, "onStartTyping");
function templateRef(key, initialValue = null) {
  const instance = getCurrentInstance();
  let _trigger = /* @__PURE__ */ __name(() => {
  }, "_trigger");
  const element = customRef((track2, trigger2) => {
    _trigger = trigger2;
    return {
      get() {
        var _a2, _b;
        track2();
        return (_b = (_a2 = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a2.$refs[key]) != null ? _b : initialValue;
      },
      set() {
      }
    };
  });
  tryOnMounted(_trigger);
  onUpdated(_trigger);
  return element;
}
__name(templateRef, "templateRef");
function useMounted() {
  const isMounted = ref(false);
  const instance = getCurrentInstance();
  if (instance) {
    onMounted(() => {
      isMounted.value = true;
    }, isVue2 ? void 0 : instance);
  }
  return isMounted;
}
__name(useMounted, "useMounted");
function useSupported(callback) {
  const isMounted = useMounted();
  return computed(() => {
    isMounted.value;
    return Boolean(callback());
  });
}
__name(useSupported, "useSupported");
function useMutationObserver(target, callback, options4 = {}) {
  const { window: window2 = defaultWindow, ...mutationOptions } = options4;
  let observer;
  const isSupported2 = useSupported(() => window2 && "MutationObserver" in window2);
  const cleanup = /* @__PURE__ */ __name(() => {
    if (observer) {
      observer.disconnect();
      observer = void 0;
    }
  }, "cleanup");
  const targets = computed(() => {
    const value4 = toValue(target);
    const items2 = (Array.isArray(value4) ? value4 : [value4]).map(unrefElement).filter(notNullish);
    return new Set(items2);
  });
  const stopWatch = watch(
    () => targets.value,
    (targets2) => {
      cleanup();
      if (isSupported2.value && targets2.size) {
        observer = new MutationObserver(callback);
        targets2.forEach((el) => observer.observe(el, mutationOptions));
      }
    },
    { immediate: true, flush: "post" }
  );
  const takeRecords = /* @__PURE__ */ __name(() => {
    return observer == null ? void 0 : observer.takeRecords();
  }, "takeRecords");
  const stop2 = /* @__PURE__ */ __name(() => {
    stopWatch();
    cleanup();
  }, "stop");
  tryOnScopeDispose(stop2);
  return {
    isSupported: isSupported2,
    stop: stop2,
    takeRecords
  };
}
__name(useMutationObserver, "useMutationObserver");
function useActiveElement(options4 = {}) {
  var _a2;
  const {
    window: window2 = defaultWindow,
    deep = true,
    triggerOnRemoval = false
  } = options4;
  const document2 = (_a2 = options4.document) != null ? _a2 : window2 == null ? void 0 : window2.document;
  const getDeepActiveElement = /* @__PURE__ */ __name(() => {
    var _a22;
    let element = document2 == null ? void 0 : document2.activeElement;
    if (deep) {
      while (element == null ? void 0 : element.shadowRoot)
        element = (_a22 = element == null ? void 0 : element.shadowRoot) == null ? void 0 : _a22.activeElement;
    }
    return element;
  }, "getDeepActiveElement");
  const activeElement = ref();
  const trigger2 = /* @__PURE__ */ __name(() => {
    activeElement.value = getDeepActiveElement();
  }, "trigger");
  if (window2) {
    useEventListener(window2, "blur", (event) => {
      if (event.relatedTarget !== null)
        return;
      trigger2();
    }, true);
    useEventListener(window2, "focus", trigger2, true);
  }
  if (triggerOnRemoval) {
    useMutationObserver(document2, (mutations) => {
      mutations.filter((m) => m.removedNodes.length).map((n) => Array.from(n.removedNodes)).flat().forEach((node3) => {
        if (node3 === activeElement.value)
          trigger2();
      });
    }, {
      childList: true,
      subtree: true
    });
  }
  trigger2();
  return activeElement;
}
__name(useActiveElement, "useActiveElement");
function useRafFn(fn, options4 = {}) {
  const {
    immediate = true,
    fpsLimit = void 0,
    window: window2 = defaultWindow
  } = options4;
  const isActive2 = ref(false);
  const intervalLimit = fpsLimit ? 1e3 / fpsLimit : null;
  let previousFrameTimestamp = 0;
  let rafId = null;
  function loop(timestamp2) {
    if (!isActive2.value || !window2)
      return;
    if (!previousFrameTimestamp)
      previousFrameTimestamp = timestamp2;
    const delta2 = timestamp2 - previousFrameTimestamp;
    if (intervalLimit && delta2 < intervalLimit) {
      rafId = window2.requestAnimationFrame(loop);
      return;
    }
    previousFrameTimestamp = timestamp2;
    fn({ delta: delta2, timestamp: timestamp2 });
    rafId = window2.requestAnimationFrame(loop);
  }
  __name(loop, "loop");
  function resume() {
    if (!isActive2.value && window2) {
      isActive2.value = true;
      previousFrameTimestamp = 0;
      rafId = window2.requestAnimationFrame(loop);
    }
  }
  __name(resume, "resume");
  function pause() {
    isActive2.value = false;
    if (rafId != null && window2) {
      window2.cancelAnimationFrame(rafId);
      rafId = null;
    }
  }
  __name(pause, "pause");
  if (immediate)
    resume();
  tryOnScopeDispose(pause);
  return {
    isActive: readonly(isActive2),
    pause,
    resume
  };
}
__name(useRafFn, "useRafFn");
function useAnimate(target, keyframes, options4) {
  let config2;
  let animateOptions;
  if (isObject$4(options4)) {
    config2 = options4;
    animateOptions = objectOmit(options4, ["window", "immediate", "commitStyles", "persist", "onReady", "onError"]);
  } else {
    config2 = { duration: options4 };
    animateOptions = options4;
  }
  const {
    window: window2 = defaultWindow,
    immediate = true,
    commitStyles,
    persist,
    playbackRate: _playbackRate = 1,
    onReady,
    onError = /* @__PURE__ */ __name((e2) => {
      console.error(e2);
    }, "onError")
  } = config2;
  const isSupported2 = useSupported(() => window2 && HTMLElement && "animate" in HTMLElement.prototype);
  const animate = shallowRef(void 0);
  const store = shallowReactive({
    startTime: null,
    currentTime: null,
    timeline: null,
    playbackRate: _playbackRate,
    pending: false,
    playState: immediate ? "idle" : "paused",
    replaceState: "active"
  });
  const pending = computed(() => store.pending);
  const playState = computed(() => store.playState);
  const replaceState = computed(() => store.replaceState);
  const startTime = computed({
    get() {
      return store.startTime;
    },
    set(value4) {
      store.startTime = value4;
      if (animate.value)
        animate.value.startTime = value4;
    }
  });
  const currentTime = computed({
    get() {
      return store.currentTime;
    },
    set(value4) {
      store.currentTime = value4;
      if (animate.value) {
        animate.value.currentTime = value4;
        syncResume();
      }
    }
  });
  const timeline = computed({
    get() {
      return store.timeline;
    },
    set(value4) {
      store.timeline = value4;
      if (animate.value)
        animate.value.timeline = value4;
    }
  });
  const playbackRate = computed({
    get() {
      return store.playbackRate;
    },
    set(value4) {
      store.playbackRate = value4;
      if (animate.value)
        animate.value.playbackRate = value4;
    }
  });
  const play = /* @__PURE__ */ __name(() => {
    if (animate.value) {
      try {
        animate.value.play();
        syncResume();
      } catch (e2) {
        syncPause();
        onError(e2);
      }
    } else {
      update();
    }
  }, "play");
  const pause = /* @__PURE__ */ __name(() => {
    var _a2;
    try {
      (_a2 = animate.value) == null ? void 0 : _a2.pause();
      syncPause();
    } catch (e2) {
      onError(e2);
    }
  }, "pause");
  const reverse2 = /* @__PURE__ */ __name(() => {
    var _a2;
    if (!animate.value)
      update();
    try {
      (_a2 = animate.value) == null ? void 0 : _a2.reverse();
      syncResume();
    } catch (e2) {
      syncPause();
      onError(e2);
    }
  }, "reverse");
  const finish = /* @__PURE__ */ __name(() => {
    var _a2;
    try {
      (_a2 = animate.value) == null ? void 0 : _a2.finish();
      syncPause();
    } catch (e2) {
      onError(e2);
    }
  }, "finish");
  const cancel = /* @__PURE__ */ __name(() => {
    var _a2;
    try {
      (_a2 = animate.value) == null ? void 0 : _a2.cancel();
      syncPause();
    } catch (e2) {
      onError(e2);
    }
  }, "cancel");
  watch(() => unrefElement(target), (el) => {
    if (el)
      update();
  });
  watch(() => keyframes, (value4) => {
    if (animate.value)
      update();
    if (!unrefElement(target) && animate.value) {
      animate.value.effect = new KeyframeEffect(
        unrefElement(target),
        toValue(value4),
        animateOptions
      );
    }
  }, { deep: true });
  tryOnMounted(() => update(true), false);
  tryOnScopeDispose(cancel);
  function update(init3) {
    const el = unrefElement(target);
    if (!isSupported2.value || !el)
      return;
    if (!animate.value)
      animate.value = el.animate(toValue(keyframes), animateOptions);
    if (persist)
      animate.value.persist();
    if (_playbackRate !== 1)
      animate.value.playbackRate = _playbackRate;
    if (init3 && !immediate)
      animate.value.pause();
    else
      syncResume();
    onReady == null ? void 0 : onReady(animate.value);
  }
  __name(update, "update");
  useEventListener(animate, ["cancel", "finish", "remove"], syncPause);
  useEventListener(animate, "finish", () => {
    var _a2;
    if (commitStyles)
      (_a2 = animate.value) == null ? void 0 : _a2.commitStyles();
  });
  const { resume: resumeRef, pause: pauseRef } = useRafFn(() => {
    if (!animate.value)
      return;
    store.pending = animate.value.pending;
    store.playState = animate.value.playState;
    store.replaceState = animate.value.replaceState;
    store.startTime = animate.value.startTime;
    store.currentTime = animate.value.currentTime;
    store.timeline = animate.value.timeline;
    store.playbackRate = animate.value.playbackRate;
  }, { immediate: false });
  function syncResume() {
    if (isSupported2.value)
      resumeRef();
  }
  __name(syncResume, "syncResume");
  function syncPause() {
    if (isSupported2.value && window2)
      window2.requestAnimationFrame(pauseRef);
  }
  __name(syncPause, "syncPause");
  return {
    isSupported: isSupported2,
    animate,
    // actions
    play,
    pause,
    reverse: reverse2,
    finish,
    cancel,
    // state
    pending,
    playState,
    replaceState,
    startTime,
    currentTime,
    timeline,
    playbackRate
  };
}
__name(useAnimate, "useAnimate");
function useAsyncQueue(tasks, options4) {
  const {
    interrupt = true,
    onError = noop$1,
    onFinished = noop$1,
    signal
  } = options4 || {};
  const promiseState = {
    aborted: "aborted",
    fulfilled: "fulfilled",
    pending: "pending",
    rejected: "rejected"
  };
  const initialResult = Array.from(Array.from({ length: tasks.length }), () => ({ state: promiseState.pending, data: null }));
  const result = reactive(initialResult);
  const activeIndex3 = ref(-1);
  if (!tasks || tasks.length === 0) {
    onFinished();
    return {
      activeIndex: activeIndex3,
      result
    };
  }
  function updateResult(state, res) {
    activeIndex3.value++;
    result[activeIndex3.value].data = res;
    result[activeIndex3.value].state = state;
  }
  __name(updateResult, "updateResult");
  tasks.reduce((prev2, curr) => {
    return prev2.then((prevRes) => {
      var _a2;
      if (signal == null ? void 0 : signal.aborted) {
        updateResult(promiseState.aborted, new Error("aborted"));
        return;
      }
      if (((_a2 = result[activeIndex3.value]) == null ? void 0 : _a2.state) === promiseState.rejected && interrupt) {
        onFinished();
        return;
      }
      const done = curr(prevRes).then((currentRes) => {
        updateResult(promiseState.fulfilled, currentRes);
        if (activeIndex3.value === tasks.length - 1)
          onFinished();
        return currentRes;
      });
      if (!signal)
        return done;
      return Promise.race([done, whenAborted(signal)]);
    }).catch((e2) => {
      if (signal == null ? void 0 : signal.aborted) {
        updateResult(promiseState.aborted, e2);
        return e2;
      }
      updateResult(promiseState.rejected, e2);
      onError();
      return e2;
    });
  }, Promise.resolve());
  return {
    activeIndex: activeIndex3,
    result
  };
}
__name(useAsyncQueue, "useAsyncQueue");
function whenAborted(signal) {
  return new Promise((resolve2, reject3) => {
    const error2 = new Error("aborted");
    if (signal.aborted)
      reject3(error2);
    else
      signal.addEventListener("abort", () => reject3(error2), { once: true });
  });
}
__name(whenAborted, "whenAborted");
function useAsyncState(promise, initialState, options4) {
  const {
    immediate = true,
    delay = 0,
    onError = noop$1,
    onSuccess = noop$1,
    resetOnExecute = true,
    shallow = true,
    throwError
  } = options4 != null ? options4 : {};
  const state = shallow ? shallowRef(initialState) : ref(initialState);
  const isReady = ref(false);
  const isLoading = ref(false);
  const error2 = shallowRef(void 0);
  async function execute(delay2 = 0, ...args) {
    if (resetOnExecute)
      state.value = initialState;
    error2.value = void 0;
    isReady.value = false;
    isLoading.value = true;
    if (delay2 > 0)
      await promiseTimeout(delay2);
    const _promise = typeof promise === "function" ? promise(...args) : promise;
    try {
      const data24 = await _promise;
      state.value = data24;
      isReady.value = true;
      onSuccess(data24);
    } catch (e2) {
      error2.value = e2;
      onError(e2);
      if (throwError)
        throw e2;
    } finally {
      isLoading.value = false;
    }
    return state.value;
  }
  __name(execute, "execute");
  if (immediate)
    execute(delay);
  const shell = {
    state,
    isReady,
    isLoading,
    error: error2,
    execute
  };
  function waitUntilIsLoaded() {
    return new Promise((resolve2, reject3) => {
      until(isLoading).toBe(false).then(() => resolve2(shell)).catch(reject3);
    });
  }
  __name(waitUntilIsLoaded, "waitUntilIsLoaded");
  return {
    ...shell,
    then(onFulfilled, onRejected) {
      return waitUntilIsLoaded().then(onFulfilled, onRejected);
    }
  };
}
__name(useAsyncState, "useAsyncState");
const defaults$1 = {
  array: /* @__PURE__ */ __name((v2) => JSON.stringify(v2), "array"),
  object: /* @__PURE__ */ __name((v2) => JSON.stringify(v2), "object"),
  set: /* @__PURE__ */ __name((v2) => JSON.stringify(Array.from(v2)), "set"),
  map: /* @__PURE__ */ __name((v2) => JSON.stringify(Object.fromEntries(v2)), "map"),
  null: /* @__PURE__ */ __name(() => "", "null")
};
function getDefaultSerialization(target) {
  if (!target)
    return defaults$1.null;
  if (target instanceof Map)
    return defaults$1.map;
  else if (target instanceof Set)
    return defaults$1.set;
  else if (Array.isArray(target))
    return defaults$1.array;
  else
    return defaults$1.object;
}
__name(getDefaultSerialization, "getDefaultSerialization");
function useBase64(target, options4) {
  const base64 = ref("");
  const promise = ref();
  function execute() {
    if (!isClient)
      return;
    promise.value = new Promise((resolve2, reject3) => {
      try {
        const _target = toValue(target);
        if (_target == null) {
          resolve2("");
        } else if (typeof _target === "string") {
          resolve2(blobToBase64(new Blob([_target], { type: "text/plain" })));
        } else if (_target instanceof Blob) {
          resolve2(blobToBase64(_target));
        } else if (_target instanceof ArrayBuffer) {
          resolve2(window.btoa(String.fromCharCode(...new Uint8Array(_target))));
        } else if (_target instanceof HTMLCanvasElement) {
          resolve2(_target.toDataURL(options4 == null ? void 0 : options4.type, options4 == null ? void 0 : options4.quality));
        } else if (_target instanceof HTMLImageElement) {
          const img = _target.cloneNode(false);
          img.crossOrigin = "Anonymous";
          imgLoaded(img).then(() => {
            const canvas = document.createElement("canvas");
            const ctx = canvas.getContext("2d");
            canvas.width = img.width;
            canvas.height = img.height;
            ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
            resolve2(canvas.toDataURL(options4 == null ? void 0 : options4.type, options4 == null ? void 0 : options4.quality));
          }).catch(reject3);
        } else if (typeof _target === "object") {
          const _serializeFn = (options4 == null ? void 0 : options4.serializer) || getDefaultSerialization(_target);
          const serialized = _serializeFn(_target);
          return resolve2(blobToBase64(new Blob([serialized], { type: "application/json" })));
        } else {
          reject3(new Error("target is unsupported types"));
        }
      } catch (error2) {
        reject3(error2);
      }
    });
    promise.value.then((res) => base64.value = res);
    return promise.value;
  }
  __name(execute, "execute");
  if (isRef(target) || typeof target === "function")
    watch(target, execute, { immediate: true });
  else
    execute();
  return {
    base64,
    promise,
    execute
  };
}
__name(useBase64, "useBase64");
function imgLoaded(img) {
  return new Promise((resolve2, reject3) => {
    if (!img.complete) {
      img.onload = () => {
        resolve2();
      };
      img.onerror = reject3;
    } else {
      resolve2();
    }
  });
}
__name(imgLoaded, "imgLoaded");
function blobToBase64(blob) {
  return new Promise((resolve2, reject3) => {
    const fr2 = new FileReader();
    fr2.onload = (e2) => {
      resolve2(e2.target.result);
    };
    fr2.onerror = reject3;
    fr2.readAsDataURL(blob);
  });
}
__name(blobToBase64, "blobToBase64");
function useBattery(options4 = {}) {
  const { navigator: navigator2 = defaultNavigator } = options4;
  const events2 = ["chargingchange", "chargingtimechange", "dischargingtimechange", "levelchange"];
  const isSupported2 = useSupported(() => navigator2 && "getBattery" in navigator2 && typeof navigator2.getBattery === "function");
  const charging = ref(false);
  const chargingTime = ref(0);
  const dischargingTime = ref(0);
  const level = ref(1);
  let battery;
  function updateBatteryInfo() {
    charging.value = this.charging;
    chargingTime.value = this.chargingTime || 0;
    dischargingTime.value = this.dischargingTime || 0;
    level.value = this.level;
  }
  __name(updateBatteryInfo, "updateBatteryInfo");
  if (isSupported2.value) {
    navigator2.getBattery().then((_battery) => {
      battery = _battery;
      updateBatteryInfo.call(battery);
      useEventListener(battery, events2, updateBatteryInfo, { passive: true });
    });
  }
  return {
    isSupported: isSupported2,
    charging,
    chargingTime,
    dischargingTime,
    level
  };
}
__name(useBattery, "useBattery");
function useBluetooth(options4) {
  let {
    acceptAllDevices = false
  } = options4 || {};
  const {
    filters = void 0,
    optionalServices = void 0,
    navigator: navigator2 = defaultNavigator
  } = options4 || {};
  const isSupported2 = useSupported(() => navigator2 && "bluetooth" in navigator2);
  const device = shallowRef(void 0);
  const error2 = shallowRef(null);
  watch(device, () => {
    connectToBluetoothGATTServer();
  });
  async function requestDevice() {
    if (!isSupported2.value)
      return;
    error2.value = null;
    if (filters && filters.length > 0)
      acceptAllDevices = false;
    try {
      device.value = await (navigator2 == null ? void 0 : navigator2.bluetooth.requestDevice({
        acceptAllDevices,
        filters,
        optionalServices
      }));
    } catch (err) {
      error2.value = err;
    }
  }
  __name(requestDevice, "requestDevice");
  const server = ref();
  const isConnected = computed(() => {
    var _a2;
    return ((_a2 = server.value) == null ? void 0 : _a2.connected) || false;
  });
  async function connectToBluetoothGATTServer() {
    error2.value = null;
    if (device.value && device.value.gatt) {
      device.value.addEventListener("gattserverdisconnected", () => {
      });
      try {
        server.value = await device.value.gatt.connect();
      } catch (err) {
        error2.value = err;
      }
    }
  }
  __name(connectToBluetoothGATTServer, "connectToBluetoothGATTServer");
  tryOnMounted(() => {
    var _a2;
    if (device.value)
      (_a2 = device.value.gatt) == null ? void 0 : _a2.connect();
  });
  tryOnScopeDispose(() => {
    var _a2;
    if (device.value)
      (_a2 = device.value.gatt) == null ? void 0 : _a2.disconnect();
  });
  return {
    isSupported: isSupported2,
    isConnected,
    // Device:
    device,
    requestDevice,
    // Server:
    server,
    // Errors:
    error: error2
  };
}
__name(useBluetooth, "useBluetooth");
function useMediaQuery(query, options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  const isSupported2 = useSupported(() => window2 && "matchMedia" in window2 && typeof window2.matchMedia === "function");
  let mediaQuery;
  const matches2 = ref(false);
  const handler6 = /* @__PURE__ */ __name((event) => {
    matches2.value = event.matches;
  }, "handler");
  const cleanup = /* @__PURE__ */ __name(() => {
    if (!mediaQuery)
      return;
    if ("removeEventListener" in mediaQuery)
      mediaQuery.removeEventListener("change", handler6);
    else
      mediaQuery.removeListener(handler6);
  }, "cleanup");
  const stopWatch = watchEffect(() => {
    if (!isSupported2.value)
      return;
    cleanup();
    mediaQuery = window2.matchMedia(toValue(query));
    if ("addEventListener" in mediaQuery)
      mediaQuery.addEventListener("change", handler6);
    else
      mediaQuery.addListener(handler6);
    matches2.value = mediaQuery.matches;
  });
  tryOnScopeDispose(() => {
    stopWatch();
    cleanup();
    mediaQuery = void 0;
  });
  return matches2;
}
__name(useMediaQuery, "useMediaQuery");
const breakpointsTailwind = {
  "sm": 640,
  "md": 768,
  "lg": 1024,
  "xl": 1280,
  "2xl": 1536
};
const breakpointsBootstrapV5 = {
  xs: 0,
  sm: 576,
  md: 768,
  lg: 992,
  xl: 1200,
  xxl: 1400
};
const breakpointsVuetifyV2 = {
  xs: 0,
  sm: 600,
  md: 960,
  lg: 1264,
  xl: 1904
};
const breakpointsVuetifyV3 = {
  xs: 0,
  sm: 600,
  md: 960,
  lg: 1280,
  xl: 1920,
  xxl: 2560
};
const breakpointsVuetify = breakpointsVuetifyV2;
const breakpointsAntDesign = {
  xs: 480,
  sm: 576,
  md: 768,
  lg: 992,
  xl: 1200,
  xxl: 1600
};
const breakpointsQuasar = {
  xs: 0,
  sm: 600,
  md: 1024,
  lg: 1440,
  xl: 1920
};
const breakpointsSematic = {
  mobileS: 320,
  mobileM: 375,
  mobileL: 425,
  tablet: 768,
  laptop: 1024,
  laptopL: 1440,
  desktop4K: 2560
};
const breakpointsMasterCss = {
  "3xs": 360,
  "2xs": 480,
  "xs": 600,
  "sm": 768,
  "md": 1024,
  "lg": 1280,
  "xl": 1440,
  "2xl": 1600,
  "3xl": 1920,
  "4xl": 2560
};
const breakpointsPrimeFlex = {
  sm: 576,
  md: 768,
  lg: 992,
  xl: 1200
};
function useBreakpoints(breakpoints, options4 = {}) {
  function getValue2(k, delta2) {
    let v2 = toValue(breakpoints[toValue(k)]);
    if (delta2 != null)
      v2 = increaseWithUnit(v2, delta2);
    if (typeof v2 === "number")
      v2 = `${v2}px`;
    return v2;
  }
  __name(getValue2, "getValue2");
  const { window: window2 = defaultWindow, strategy = "min-width" } = options4;
  function match2(query) {
    if (!window2)
      return false;
    return window2.matchMedia(query).matches;
  }
  __name(match2, "match");
  const greaterOrEqual = /* @__PURE__ */ __name((k) => {
    return useMediaQuery(() => `(min-width: ${getValue2(k)})`, options4);
  }, "greaterOrEqual");
  const smallerOrEqual = /* @__PURE__ */ __name((k) => {
    return useMediaQuery(() => `(max-width: ${getValue2(k)})`, options4);
  }, "smallerOrEqual");
  const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {
    Object.defineProperty(shortcuts, k, {
      get: /* @__PURE__ */ __name(() => strategy === "min-width" ? greaterOrEqual(k) : smallerOrEqual(k), "get"),
      enumerable: true,
      configurable: true
    });
    return shortcuts;
  }, {});
  function current() {
    const points = Object.keys(breakpoints).map((i2) => [i2, greaterOrEqual(i2)]);
    return computed(() => points.filter(([, v2]) => v2.value).map(([k]) => k));
  }
  __name(current, "current");
  return Object.assign(shortcutMethods, {
    greaterOrEqual,
    smallerOrEqual,
    greater(k) {
      return useMediaQuery(() => `(min-width: ${getValue2(k, 0.1)})`, options4);
    },
    smaller(k) {
      return useMediaQuery(() => `(max-width: ${getValue2(k, -0.1)})`, options4);
    },
    between(a, b) {
      return useMediaQuery(() => `(min-width: ${getValue2(a)}) and (max-width: ${getValue2(b, -0.1)})`, options4);
    },
    isGreater(k) {
      return match2(`(min-width: ${getValue2(k, 0.1)})`);
    },
    isGreaterOrEqual(k) {
      return match2(`(min-width: ${getValue2(k)})`);
    },
    isSmaller(k) {
      return match2(`(max-width: ${getValue2(k, -0.1)})`);
    },
    isSmallerOrEqual(k) {
      return match2(`(max-width: ${getValue2(k)})`);
    },
    isInBetween(a, b) {
      return match2(`(min-width: ${getValue2(a)}) and (max-width: ${getValue2(b, -0.1)})`);
    },
    current,
    active() {
      const bps = current();
      return computed(() => bps.value.length === 0 ? "" : bps.value.at(-1));
    }
  });
}
__name(useBreakpoints, "useBreakpoints");
function useBroadcastChannel(options4) {
  const {
    name: name2,
    window: window2 = defaultWindow
  } = options4;
  const isSupported2 = useSupported(() => window2 && "BroadcastChannel" in window2);
  const isClosed = ref(false);
  const channel = ref();
  const data24 = ref();
  const error2 = shallowRef(null);
  const post = /* @__PURE__ */ __name((data25) => {
    if (channel.value)
      channel.value.postMessage(data25);
  }, "post");
  const close5 = /* @__PURE__ */ __name(() => {
    if (channel.value)
      channel.value.close();
    isClosed.value = true;
  }, "close");
  if (isSupported2.value) {
    tryOnMounted(() => {
      error2.value = null;
      channel.value = new BroadcastChannel(name2);
      channel.value.addEventListener("message", (e2) => {
        data24.value = e2.data;
      }, { passive: true });
      channel.value.addEventListener("messageerror", (e2) => {
        error2.value = e2;
      }, { passive: true });
      channel.value.addEventListener("close", () => {
        isClosed.value = true;
      });
    });
  }
  tryOnScopeDispose(() => {
    close5();
  });
  return {
    isSupported: isSupported2,
    channel,
    data: data24,
    post,
    close: close5,
    error: error2,
    isClosed
  };
}
__name(useBroadcastChannel, "useBroadcastChannel");
const WRITABLE_PROPERTIES = [
  "hash",
  "host",
  "hostname",
  "href",
  "pathname",
  "port",
  "protocol",
  "search"
];
function useBrowserLocation(options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  const refs = Object.fromEntries(
    WRITABLE_PROPERTIES.map((key) => [key, ref()])
  );
  for (const [key, ref2] of objectEntries(refs)) {
    watch(ref2, (value4) => {
      if (!(window2 == null ? void 0 : window2.location) || window2.location[key] === value4)
        return;
      window2.location[key] = value4;
    });
  }
  const buildState2 = /* @__PURE__ */ __name((trigger2) => {
    var _a2;
    const { state: state2, length } = (window2 == null ? void 0 : window2.history) || {};
    const { origin: origin2 } = (window2 == null ? void 0 : window2.location) || {};
    for (const key of WRITABLE_PROPERTIES)
      refs[key].value = (_a2 = window2 == null ? void 0 : window2.location) == null ? void 0 : _a2[key];
    return reactive({
      trigger: trigger2,
      state: state2,
      length,
      origin: origin2,
      ...refs
    });
  }, "buildState");
  const state = ref(buildState2("load"));
  if (window2) {
    useEventListener(window2, "popstate", () => state.value = buildState2("popstate"), { passive: true });
    useEventListener(window2, "hashchange", () => state.value = buildState2("hashchange"), { passive: true });
  }
  return state;
}
__name(useBrowserLocation, "useBrowserLocation");
function useCached(refValue, comparator2 = (a, b) => a === b, watchOptions) {
  const cachedValue = ref(refValue.value);
  watch(() => refValue.value, (value4) => {
    if (!comparator2(value4, cachedValue.value))
      cachedValue.value = value4;
  }, watchOptions);
  return cachedValue;
}
__name(useCached, "useCached");
function usePermission(permissionDesc, options4 = {}) {
  const {
    controls = false,
    navigator: navigator2 = defaultNavigator
  } = options4;
  const isSupported2 = useSupported(() => navigator2 && "permissions" in navigator2);
  let permissionStatus;
  const desc = typeof permissionDesc === "string" ? { name: permissionDesc } : permissionDesc;
  const state = ref();
  const onChange5 = /* @__PURE__ */ __name(() => {
    if (permissionStatus)
      state.value = permissionStatus.state;
  }, "onChange");
  const query = createSingletonPromise(async () => {
    if (!isSupported2.value)
      return;
    if (!permissionStatus) {
      try {
        permissionStatus = await navigator2.permissions.query(desc);
        useEventListener(permissionStatus, "change", onChange5);
        onChange5();
      } catch (e2) {
        state.value = "prompt";
      }
    }
    return permissionStatus;
  });
  query();
  if (controls) {
    return {
      state,
      isSupported: isSupported2,
      query
    };
  } else {
    return state;
  }
}
__name(usePermission, "usePermission");
function useClipboard(options4 = {}) {
  const {
    navigator: navigator2 = defaultNavigator,
    read = false,
    source,
    copiedDuring = 1500,
    legacy = false
  } = options4;
  const isClipboardApiSupported = useSupported(() => navigator2 && "clipboard" in navigator2);
  const permissionRead = usePermission("clipboard-read");
  const permissionWrite = usePermission("clipboard-write");
  const isSupported2 = computed(() => isClipboardApiSupported.value || legacy);
  const text2 = ref("");
  const copied = ref(false);
  const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);
  function updateText() {
    if (isClipboardApiSupported.value && isAllowed(permissionRead.value)) {
      navigator2.clipboard.readText().then((value4) => {
        text2.value = value4;
      });
    } else {
      text2.value = legacyRead();
    }
  }
  __name(updateText, "updateText");
  if (isSupported2.value && read)
    useEventListener(["copy", "cut"], updateText);
  async function copy2(value4 = toValue(source)) {
    if (isSupported2.value && value4 != null) {
      if (isClipboardApiSupported.value && isAllowed(permissionWrite.value))
        await navigator2.clipboard.writeText(value4);
      else
        legacyCopy(value4);
      text2.value = value4;
      copied.value = true;
      timeout.start();
    }
  }
  __name(copy2, "copy");
  function legacyCopy(value4) {
    const ta2 = document.createElement("textarea");
    ta2.value = value4 != null ? value4 : "";
    ta2.style.position = "absolute";
    ta2.style.opacity = "0";
    document.body.appendChild(ta2);
    ta2.select();
    document.execCommand("copy");
    ta2.remove();
  }
  __name(legacyCopy, "legacyCopy");
  function legacyRead() {
    var _a2, _b, _c;
    return (_c = (_b = (_a2 = document == null ? void 0 : document.getSelection) == null ? void 0 : _a2.call(document)) == null ? void 0 : _b.toString()) != null ? _c : "";
  }
  __name(legacyRead, "legacyRead");
  function isAllowed(status) {
    return status === "granted" || status === "prompt";
  }
  __name(isAllowed, "isAllowed");
  return {
    isSupported: isSupported2,
    text: text2,
    copied,
    copy: copy2
  };
}
__name(useClipboard, "useClipboard");
function useClipboardItems(options4 = {}) {
  const {
    navigator: navigator2 = defaultNavigator,
    read = false,
    source,
    copiedDuring = 1500
  } = options4;
  const isSupported2 = useSupported(() => navigator2 && "clipboard" in navigator2);
  const content2 = ref([]);
  const copied = ref(false);
  const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);
  function updateContent() {
    if (isSupported2.value) {
      navigator2.clipboard.read().then((items2) => {
        content2.value = items2;
      });
    }
  }
  __name(updateContent, "updateContent");
  if (isSupported2.value && read)
    useEventListener(["copy", "cut"], updateContent);
  async function copy2(value4 = toValue(source)) {
    if (isSupported2.value && value4 != null) {
      await navigator2.clipboard.write(value4);
      content2.value = value4;
      copied.value = true;
      timeout.start();
    }
  }
  __name(copy2, "copy");
  return {
    isSupported: isSupported2,
    content: content2,
    copied,
    copy: copy2
  };
}
__name(useClipboardItems, "useClipboardItems");
function cloneFnJSON(source) {
  return JSON.parse(JSON.stringify(source));
}
__name(cloneFnJSON, "cloneFnJSON");
function useCloned(source, options4 = {}) {
  const cloned = ref({});
  const {
    manual,
    clone: clone2 = cloneFnJSON,
    // watch options
    deep = true,
    immediate = true
  } = options4;
  function sync() {
    cloned.value = clone2(toValue(source));
  }
  __name(sync, "sync");
  if (!manual && (isRef(source) || typeof source === "function")) {
    watch(source, sync, {
      ...options4,
      deep,
      immediate
    });
  } else {
    sync();
  }
  return { cloned, sync };
}
__name(useCloned, "useCloned");
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
const globalKey = "__vueuse_ssr_handlers__";
const handlers$1 = /* @__PURE__ */ getHandlers();
function getHandlers() {
  if (!(globalKey in _global))
    _global[globalKey] = _global[globalKey] || {};
  return _global[globalKey];
}
__name(getHandlers, "getHandlers");
function getSSRHandler(key, fallback) {
  return handlers$1[key] || fallback;
}
__name(getSSRHandler, "getSSRHandler");
function setSSRHandler(key, fn) {
  handlers$1[key] = fn;
}
__name(setSSRHandler, "setSSRHandler");
function guessSerializerType(rawInit) {
  return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
}
__name(guessSerializerType, "guessSerializerType");
const StorageSerializers = {
  boolean: {
    read: /* @__PURE__ */ __name((v2) => v2 === "true", "read"),
    write: /* @__PURE__ */ __name((v2) => String(v2), "write")
  },
  object: {
    read: /* @__PURE__ */ __name((v2) => JSON.parse(v2), "read"),
    write: /* @__PURE__ */ __name((v2) => JSON.stringify(v2), "write")
  },
  number: {
    read: /* @__PURE__ */ __name((v2) => Number.parseFloat(v2), "read"),
    write: /* @__PURE__ */ __name((v2) => String(v2), "write")
  },
  any: {
    read: /* @__PURE__ */ __name((v2) => v2, "read"),
    write: /* @__PURE__ */ __name((v2) => String(v2), "write")
  },
  string: {
    read: /* @__PURE__ */ __name((v2) => v2, "read"),
    write: /* @__PURE__ */ __name((v2) => String(v2), "write")
  },
  map: {
    read: /* @__PURE__ */ __name((v2) => new Map(JSON.parse(v2)), "read"),
    write: /* @__PURE__ */ __name((v2) => JSON.stringify(Array.from(v2.entries())), "write")
  },
  set: {
    read: /* @__PURE__ */ __name((v2) => new Set(JSON.parse(v2)), "read"),
    write: /* @__PURE__ */ __name((v2) => JSON.stringify(Array.from(v2)), "write")
  },
  date: {
    read: /* @__PURE__ */ __name((v2) => new Date(v2), "read"),
    write: /* @__PURE__ */ __name((v2) => v2.toISOString(), "write")
  }
};
const customStorageEventName = "vueuse-storage";
function useStorage(key, defaults2, storage, options4 = {}) {
  var _a2;
  const {
    flush = "pre",
    deep = true,
    listenToStorageChanges = true,
    writeDefaults = true,
    mergeDefaults: mergeDefaults2 = false,
    shallow,
    window: window2 = defaultWindow,
    eventFilter,
    onError = /* @__PURE__ */ __name((e2) => {
      console.error(e2);
    }, "onError"),
    initOnMounted
  } = options4;
  const data24 = (shallow ? shallowRef : ref)(typeof defaults2 === "function" ? defaults2() : defaults2);
  if (!storage) {
    try {
      storage = getSSRHandler("getDefaultStorage", () => {
        var _a22;
        return (_a22 = defaultWindow) == null ? void 0 : _a22.localStorage;
      })();
    } catch (e2) {
      onError(e2);
    }
  }
  if (!storage)
    return data24;
  const rawInit = toValue(defaults2);
  const type = guessSerializerType(rawInit);
  const serializer = (_a2 = options4.serializer) != null ? _a2 : StorageSerializers[type];
  const { pause: pauseWatch, resume: resumeWatch } = watchPausable(
    data24,
    () => write(data24.value),
    { flush, deep, eventFilter }
  );
  if (window2 && listenToStorageChanges) {
    tryOnMounted(() => {
      if (storage instanceof Storage)
        useEventListener(window2, "storage", update);
      else
        useEventListener(window2, customStorageEventName, updateFromCustomEvent);
      if (initOnMounted)
        update();
    });
  }
  if (!initOnMounted)
    update();
  function dispatchWriteEvent(oldValue2, newValue2) {
    if (window2 && !(storage instanceof Storage)) {
      window2.dispatchEvent(new CustomEvent(customStorageEventName, {
        detail: {
          key,
          oldValue: oldValue2,
          newValue: newValue2,
          storageArea: storage
        }
      }));
    }
  }
  __name(dispatchWriteEvent, "dispatchWriteEvent");
  function write(v2) {
    try {
      const oldValue2 = storage.getItem(key);
      if (v2 == null) {
        dispatchWriteEvent(oldValue2, null);
        storage.removeItem(key);
      } else {
        const serialized = serializer.write(v2);
        if (oldValue2 !== serialized) {
          storage.setItem(key, serialized);
          dispatchWriteEvent(oldValue2, serialized);
        }
      }
    } catch (e2) {
      onError(e2);
    }
  }
  __name(write, "write");
  function read(event) {
    const rawValue = event ? event.newValue : storage.getItem(key);
    if (rawValue == null) {
      if (writeDefaults && rawInit != null)
        storage.setItem(key, serializer.write(rawInit));
      return rawInit;
    } else if (!event && mergeDefaults2) {
      const value4 = serializer.read(rawValue);
      if (typeof mergeDefaults2 === "function")
        return mergeDefaults2(value4, rawInit);
      else if (type === "object" && !Array.isArray(value4))
        return { ...rawInit, ...value4 };
      return value4;
    } else if (typeof rawValue !== "string") {
      return rawValue;
    } else {
      return serializer.read(rawValue);
    }
  }
  __name(read, "read");
  function update(event) {
    if (event && event.storageArea !== storage)
      return;
    if (event && event.key == null) {
      data24.value = rawInit;
      return;
    }
    if (event && event.key !== key)
      return;
    pauseWatch();
    try {
      if ((event == null ? void 0 : event.newValue) !== serializer.write(data24.value))
        data24.value = read(event);
    } catch (e2) {
      onError(e2);
    } finally {
      if (event)
        nextTick(resumeWatch);
      else
        resumeWatch();
    }
  }
  __name(update, "update");
  function updateFromCustomEvent(event) {
    update(event.detail);
  }
  __name(updateFromCustomEvent, "updateFromCustomEvent");
  return data24;
}
__name(useStorage, "useStorage");
function usePreferredDark(options4) {
  return useMediaQuery("(prefers-color-scheme: dark)", options4);
}
__name(usePreferredDark, "usePreferredDark");
const CSS_DISABLE_TRANS = "*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
function useColorMode(options4 = {}) {
  const {
    selector = "html",
    attribute: attribute2 = "class",
    initialValue = "auto",
    window: window2 = defaultWindow,
    storage,
    storageKey = "vueuse-color-scheme",
    listenToStorageChanges = true,
    storageRef,
    emitAuto,
    disableTransition = true
  } = options4;
  const modes = {
    auto: "",
    light: "light",
    dark: "dark",
    ...options4.modes || {}
  };
  const preferredDark = usePreferredDark({ window: window2 });
  const system = computed(() => preferredDark.value ? "dark" : "light");
  const store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, { window: window2, listenToStorageChanges }));
  const state = computed(() => store.value === "auto" ? system.value : store.value);
  const updateHTMLAttrs = getSSRHandler(
    "updateHTMLAttrs",
    (selector2, attribute22, value4) => {
      const el = typeof selector2 === "string" ? window2 == null ? void 0 : window2.document.querySelector(selector2) : unrefElement(selector2);
      if (!el)
        return;
      const classesToAdd = /* @__PURE__ */ new Set();
      const classesToRemove = /* @__PURE__ */ new Set();
      let attributeToChange = null;
      if (attribute22 === "class") {
        const current = value4.split(/\s/g);
        Object.values(modes).flatMap((i2) => (i2 || "").split(/\s/g)).filter(Boolean).forEach((v2) => {
          if (current.includes(v2))
            classesToAdd.add(v2);
          else
            classesToRemove.add(v2);
        });
      } else {
        attributeToChange = { key: attribute22, value: value4 };
      }
      if (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null)
        return;
      let style2;
      if (disableTransition) {
        style2 = window2.document.createElement("style");
        style2.appendChild(document.createTextNode(CSS_DISABLE_TRANS));
        window2.document.head.appendChild(style2);
      }
      for (const c of classesToAdd) {
        el.classList.add(c);
      }
      for (const c of classesToRemove) {
        el.classList.remove(c);
      }
      if (attributeToChange) {
        el.setAttribute(attributeToChange.key, attributeToChange.value);
      }
      if (disableTransition) {
        window2.getComputedStyle(style2).opacity;
        document.head.removeChild(style2);
      }
    }
  );
  function defaultOnChanged(mode2) {
    var _a2;
    updateHTMLAttrs(selector, attribute2, (_a2 = modes[mode2]) != null ? _a2 : mode2);
  }
  __name(defaultOnChanged, "defaultOnChanged");
  function onChanged(mode2) {
    if (options4.onChanged)
      options4.onChanged(mode2, defaultOnChanged);
    else
      defaultOnChanged(mode2);
  }
  __name(onChanged, "onChanged");
  watch(state, onChanged, { flush: "post", immediate: true });
  tryOnMounted(() => onChanged(state.value));
  const auto = computed({
    get() {
      return emitAuto ? store.value : state.value;
    },
    set(v2) {
      store.value = v2;
    }
  });
  try {
    return Object.assign(auto, { store, system, state });
  } catch (e2) {
    return auto;
  }
}
__name(useColorMode, "useColorMode");
function useConfirmDialog(revealed = ref(false)) {
  const confirmHook = createEventHook();
  const cancelHook = createEventHook();
  const revealHook = createEventHook();
  let _resolve = noop$1;
  const reveal = /* @__PURE__ */ __name((data24) => {
    revealHook.trigger(data24);
    revealed.value = true;
    return new Promise((resolve2) => {
      _resolve = resolve2;
    });
  }, "reveal");
  const confirm2 = /* @__PURE__ */ __name((data24) => {
    revealed.value = false;
    confirmHook.trigger(data24);
    _resolve({ data: data24, isCanceled: false });
  }, "confirm");
  const cancel = /* @__PURE__ */ __name((data24) => {
    revealed.value = false;
    cancelHook.trigger(data24);
    _resolve({ data: data24, isCanceled: true });
  }, "cancel");
  return {
    isRevealed: computed(() => revealed.value),
    reveal,
    confirm: confirm2,
    cancel,
    onReveal: revealHook.on,
    onConfirm: confirmHook.on,
    onCancel: cancelHook.on
  };
}
__name(useConfirmDialog, "useConfirmDialog");
function useCssVar(prop2, target, options4 = {}) {
  const { window: window2 = defaultWindow, initialValue, observe = false } = options4;
  const variable = ref(initialValue);
  const elRef = computed(() => {
    var _a2;
    return unrefElement(target) || ((_a2 = window2 == null ? void 0 : window2.document) == null ? void 0 : _a2.documentElement);
  });
  function updateCssVar() {
    var _a2;
    const key = toValue(prop2);
    const el = toValue(elRef);
    if (el && window2 && key) {
      const value4 = (_a2 = window2.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a2.trim();
      variable.value = value4 || initialValue;
    }
  }
  __name(updateCssVar, "updateCssVar");
  if (observe) {
    useMutationObserver(elRef, updateCssVar, {
      attributeFilter: ["style", "class"],
      window: window2
    });
  }
  watch(
    [elRef, () => toValue(prop2)],
    (_2, old) => {
      if (old[0] && old[1] && window2)
        window2.getComputedStyle(old[0]).removeProperty(old[1]);
      updateCssVar();
    },
    { immediate: true }
  );
  watch(
    variable,
    (val) => {
      var _a2;
      const raw_prop = toValue(prop2);
      if (((_a2 = elRef.value) == null ? void 0 : _a2.style) && raw_prop) {
        if (val == null)
          elRef.value.style.removeProperty(raw_prop);
        else
          elRef.value.style.setProperty(raw_prop, val);
      }
    }
  );
  return variable;
}
__name(useCssVar, "useCssVar");
function useCurrentElement(rootComponent) {
  const vm = getCurrentInstance();
  const currentElement = computedWithControl(
    () => null,
    () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el
  );
  onUpdated(currentElement.trigger);
  onMounted(currentElement.trigger);
  return currentElement;
}
__name(useCurrentElement, "useCurrentElement");
function useCycleList(list2, options4) {
  const state = shallowRef(getInitialValue());
  const listRef4 = toRef(list2);
  const index2 = computed({
    get() {
      var _a2;
      const targetList = listRef4.value;
      let index22 = (options4 == null ? void 0 : options4.getIndexOf) ? options4.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);
      if (index22 < 0)
        index22 = (_a2 = options4 == null ? void 0 : options4.fallbackIndex) != null ? _a2 : 0;
      return index22;
    },
    set(v2) {
      set22(v2);
    }
  });
  function set22(i2) {
    const targetList = listRef4.value;
    const length = targetList.length;
    const index22 = (i2 % length + length) % length;
    const value4 = targetList[index22];
    state.value = value4;
    return value4;
  }
  __name(set22, "set2");
  function shift2(delta2 = 1) {
    return set22(index2.value + delta2);
  }
  __name(shift2, "shift");
  function next2(n = 1) {
    return shift2(n);
  }
  __name(next2, "next");
  function prev2(n = 1) {
    return shift2(-n);
  }
  __name(prev2, "prev");
  function getInitialValue() {
    var _a2, _b;
    return (_b = toValue((_a2 = options4 == null ? void 0 : options4.initialValue) != null ? _a2 : toValue(list2)[0])) != null ? _b : void 0;
  }
  __name(getInitialValue, "getInitialValue");
  watch(listRef4, () => set22(index2.value));
  return {
    state,
    index: index2,
    next: next2,
    prev: prev2,
    go: set22
  };
}
__name(useCycleList, "useCycleList");
function useDark(options4 = {}) {
  const {
    valueDark = "dark",
    valueLight = "",
    window: window2 = defaultWindow
  } = options4;
  const mode2 = useColorMode({
    ...options4,
    onChanged: /* @__PURE__ */ __name((mode22, defaultHandler) => {
      var _a2;
      if (options4.onChanged)
        (_a2 = options4.onChanged) == null ? void 0 : _a2.call(options4, mode22 === "dark", defaultHandler, mode22);
      else
        defaultHandler(mode22);
    }, "onChanged"),
    modes: {
      dark: valueDark,
      light: valueLight
    }
  });
  const system = computed(() => {
    if (mode2.system) {
      return mode2.system.value;
    } else {
      const preferredDark = usePreferredDark({ window: window2 });
      return preferredDark.value ? "dark" : "light";
    }
  });
  const isDark = computed({
    get() {
      return mode2.value === "dark";
    },
    set(v2) {
      const modeVal = v2 ? "dark" : "light";
      if (system.value === modeVal)
        mode2.value = "auto";
      else
        mode2.value = modeVal;
    }
  });
  return isDark;
}
__name(useDark, "useDark");
function fnBypass(v2) {
  return v2;
}
__name(fnBypass, "fnBypass");
function fnSetSource(source, value4) {
  return source.value = value4;
}
__name(fnSetSource, "fnSetSource");
function defaultDump(clone2) {
  return clone2 ? typeof clone2 === "function" ? clone2 : cloneFnJSON : fnBypass;
}
__name(defaultDump, "defaultDump");
function defaultParse(clone2) {
  return clone2 ? typeof clone2 === "function" ? clone2 : cloneFnJSON : fnBypass;
}
__name(defaultParse, "defaultParse");
function useManualRefHistory(source, options4 = {}) {
  const {
    clone: clone2 = false,
    dump = defaultDump(clone2),
    parse: parse2 = defaultParse(clone2),
    setSource = fnSetSource
  } = options4;
  function _createHistoryRecord() {
    return markRaw({
      snapshot: dump(source.value),
      timestamp: timestamp()
    });
  }
  __name(_createHistoryRecord, "_createHistoryRecord");
  const last = ref(_createHistoryRecord());
  const undoStack = ref([]);
  const redoStack = ref([]);
  const _setSource = /* @__PURE__ */ __name((record) => {
    setSource(source, parse2(record.snapshot));
    last.value = record;
  }, "_setSource");
  const commit = /* @__PURE__ */ __name(() => {
    undoStack.value.unshift(last.value);
    last.value = _createHistoryRecord();
    if (options4.capacity && undoStack.value.length > options4.capacity)
      undoStack.value.splice(options4.capacity, Number.POSITIVE_INFINITY);
    if (redoStack.value.length)
      redoStack.value.splice(0, redoStack.value.length);
  }, "commit");
  const clear2 = /* @__PURE__ */ __name(() => {
    undoStack.value.splice(0, undoStack.value.length);
    redoStack.value.splice(0, redoStack.value.length);
  }, "clear");
  const undo2 = /* @__PURE__ */ __name(() => {
    const state = undoStack.value.shift();
    if (state) {
      redoStack.value.unshift(last.value);
      _setSource(state);
    }
  }, "undo");
  const redo2 = /* @__PURE__ */ __name(() => {
    const state = redoStack.value.shift();
    if (state) {
      undoStack.value.unshift(last.value);
      _setSource(state);
    }
  }, "redo");
  const reset2 = /* @__PURE__ */ __name(() => {
    _setSource(last.value);
  }, "reset");
  const history2 = computed(() => [last.value, ...undoStack.value]);
  const canUndo = computed(() => undoStack.value.length > 0);
  const canRedo = computed(() => redoStack.value.length > 0);
  return {
    source,
    undoStack,
    redoStack,
    last,
    history: history2,
    canUndo,
    canRedo,
    clear: clear2,
    commit,
    reset: reset2,
    undo: undo2,
    redo: redo2
  };
}
__name(useManualRefHistory, "useManualRefHistory");
function useRefHistory(source, options4 = {}) {
  const {
    deep = false,
    flush = "pre",
    eventFilter
  } = options4;
  const {
    eventFilter: composedFilter,
    pause,
    resume: resumeTracking,
    isActive: isTracking
  } = pausableFilter(eventFilter);
  const {
    ignoreUpdates,
    ignorePrevAsyncUpdates,
    stop: stop2
  } = watchIgnorable(
    source,
    commit,
    { deep, flush, eventFilter: composedFilter }
  );
  function setSource(source2, value4) {
    ignorePrevAsyncUpdates();
    ignoreUpdates(() => {
      source2.value = value4;
    });
  }
  __name(setSource, "setSource");
  const manualHistory = useManualRefHistory(source, { ...options4, clone: options4.clone || deep, setSource });
  const { clear: clear2, commit: manualCommit } = manualHistory;
  function commit() {
    ignorePrevAsyncUpdates();
    manualCommit();
  }
  __name(commit, "commit");
  function resume(commitNow) {
    resumeTracking();
    if (commitNow)
      commit();
  }
  __name(resume, "resume");
  function batch(fn) {
    let canceled = false;
    const cancel = /* @__PURE__ */ __name(() => canceled = true, "cancel");
    ignoreUpdates(() => {
      fn(cancel);
    });
    if (!canceled)
      commit();
  }
  __name(batch, "batch");
  function dispose() {
    stop2();
    clear2();
  }
  __name(dispose, "dispose");
  return {
    ...manualHistory,
    isTracking,
    pause,
    resume,
    commit,
    batch,
    dispose
  };
}
__name(useRefHistory, "useRefHistory");
function useDebouncedRefHistory(source, options4 = {}) {
  const filter4 = options4.debounce ? debounceFilter(options4.debounce) : void 0;
  const history2 = useRefHistory(source, { ...options4, eventFilter: filter4 });
  return {
    ...history2
  };
}
__name(useDebouncedRefHistory, "useDebouncedRefHistory");
function useDeviceMotion(options4 = {}) {
  const {
    window: window2 = defaultWindow,
    eventFilter = bypassFilter
  } = options4;
  const acceleration = ref({ x: null, y: null, z: null });
  const rotationRate = ref({ alpha: null, beta: null, gamma: null });
  const interval = ref(0);
  const accelerationIncludingGravity = ref({
    x: null,
    y: null,
    z: null
  });
  if (window2) {
    const onDeviceMotion = createFilterWrapper(
      eventFilter,
      (event) => {
        acceleration.value = event.acceleration;
        accelerationIncludingGravity.value = event.accelerationIncludingGravity;
        rotationRate.value = event.rotationRate;
        interval.value = event.interval;
      }
    );
    useEventListener(window2, "devicemotion", onDeviceMotion);
  }
  return {
    acceleration,
    accelerationIncludingGravity,
    rotationRate,
    interval
  };
}
__name(useDeviceMotion, "useDeviceMotion");
function useDeviceOrientation(options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  const isSupported2 = useSupported(() => window2 && "DeviceOrientationEvent" in window2);
  const isAbsolute = ref(false);
  const alpha2 = ref(null);
  const beta = ref(null);
  const gamma = ref(null);
  if (window2 && isSupported2.value) {
    useEventListener(window2, "deviceorientation", (event) => {
      isAbsolute.value = event.absolute;
      alpha2.value = event.alpha;
      beta.value = event.beta;
      gamma.value = event.gamma;
    });
  }
  return {
    isSupported: isSupported2,
    isAbsolute,
    alpha: alpha2,
    beta,
    gamma
  };
}
__name(useDeviceOrientation, "useDeviceOrientation");
function useDevicePixelRatio(options4 = {}) {
  const {
    window: window2 = defaultWindow
  } = options4;
  const pixelRatio = ref(1);
  if (window2) {
    let observe2 = /* @__PURE__ */ __name(function() {
      pixelRatio.value = window2.devicePixelRatio;
      cleanup2();
      media = window2.matchMedia(`(resolution: ${pixelRatio.value}dppx)`);
      media.addEventListener("change", observe2, { once: true });
    }, "observe2"), cleanup2 = /* @__PURE__ */ __name(function() {
      media == null ? void 0 : media.removeEventListener("change", observe2);
    }, "cleanup2");
    let media;
    observe2();
    tryOnScopeDispose(cleanup2);
  }
  return { pixelRatio };
}
__name(useDevicePixelRatio, "useDevicePixelRatio");
function useDevicesList(options4 = {}) {
  const {
    navigator: navigator2 = defaultNavigator,
    requestPermissions = false,
    constraints = { audio: true, video: true },
    onUpdated: onUpdated2
  } = options4;
  const devices = ref([]);
  const videoInputs = computed(() => devices.value.filter((i2) => i2.kind === "videoinput"));
  const audioInputs = computed(() => devices.value.filter((i2) => i2.kind === "audioinput"));
  const audioOutputs = computed(() => devices.value.filter((i2) => i2.kind === "audiooutput"));
  const isSupported2 = useSupported(() => navigator2 && navigator2.mediaDevices && navigator2.mediaDevices.enumerateDevices);
  const permissionGranted = ref(false);
  let stream;
  async function update() {
    if (!isSupported2.value)
      return;
    devices.value = await navigator2.mediaDevices.enumerateDevices();
    onUpdated2 == null ? void 0 : onUpdated2(devices.value);
    if (stream) {
      stream.getTracks().forEach((t2) => t2.stop());
      stream = null;
    }
  }
  __name(update, "update");
  async function ensurePermissions() {
    if (!isSupported2.value)
      return false;
    if (permissionGranted.value)
      return true;
    const { state, query } = usePermission("camera", { controls: true });
    await query();
    if (state.value !== "granted") {
      stream = await navigator2.mediaDevices.getUserMedia(constraints);
      update();
      permissionGranted.value = true;
    } else {
      permissionGranted.value = true;
    }
    return permissionGranted.value;
  }
  __name(ensurePermissions, "ensurePermissions");
  if (isSupported2.value) {
    if (requestPermissions)
      ensurePermissions();
    useEventListener(navigator2.mediaDevices, "devicechange", update);
    update();
  }
  return {
    devices,
    ensurePermissions,
    permissionGranted,
    videoInputs,
    audioInputs,
    audioOutputs,
    isSupported: isSupported2
  };
}
__name(useDevicesList, "useDevicesList");
function useDisplayMedia(options4 = {}) {
  var _a2;
  const enabled = ref((_a2 = options4.enabled) != null ? _a2 : false);
  const video = options4.video;
  const audio = options4.audio;
  const { navigator: navigator2 = defaultNavigator } = options4;
  const isSupported2 = useSupported(() => {
    var _a22;
    return (_a22 = navigator2 == null ? void 0 : navigator2.mediaDevices) == null ? void 0 : _a22.getDisplayMedia;
  });
  const constraint = { audio, video };
  const stream = shallowRef();
  async function _start() {
    var _a22;
    if (!isSupported2.value || stream.value)
      return;
    stream.value = await navigator2.mediaDevices.getDisplayMedia(constraint);
    (_a22 = stream.value) == null ? void 0 : _a22.getTracks().forEach((t2) => t2.addEventListener("ended", stop2));
    return stream.value;
  }
  __name(_start, "_start");
  async function _stop() {
    var _a22;
    (_a22 = stream.value) == null ? void 0 : _a22.getTracks().forEach((t2) => t2.stop());
    stream.value = void 0;
  }
  __name(_stop, "_stop");
  function stop2() {
    _stop();
    enabled.value = false;
  }
  __name(stop2, "stop");
  async function start2() {
    await _start();
    if (stream.value)
      enabled.value = true;
    return stream.value;
  }
  __name(start2, "start");
  watch(
    enabled,
    (v2) => {
      if (v2)
        _start();
      else
        _stop();
    },
    { immediate: true }
  );
  return {
    isSupported: isSupported2,
    stream,
    start: start2,
    stop: stop2,
    enabled
  };
}
__name(useDisplayMedia, "useDisplayMedia");
function useDocumentVisibility(options4 = {}) {
  const { document: document2 = defaultDocument } = options4;
  if (!document2)
    return ref("visible");
  const visibility = ref(document2.visibilityState);
  useEventListener(document2, "visibilitychange", () => {
    visibility.value = document2.visibilityState;
  });
  return visibility;
}
__name(useDocumentVisibility, "useDocumentVisibility");
function useDraggable(target, options4 = {}) {
  var _a2, _b;
  const {
    pointerTypes,
    preventDefault: preventDefault2,
    stopPropagation,
    exact,
    onMove,
    onEnd,
    onStart,
    initialValue,
    axis = "both",
    draggingElement = defaultWindow,
    containerElement,
    handle: draggingHandle = target,
    buttons = [0]
  } = options4;
  const position3 = ref(
    (_a2 = toValue(initialValue)) != null ? _a2 : { x: 0, y: 0 }
  );
  const pressedDelta = ref();
  const filterEvent = /* @__PURE__ */ __name((e2) => {
    if (pointerTypes)
      return pointerTypes.includes(e2.pointerType);
    return true;
  }, "filterEvent");
  const handleEvent = /* @__PURE__ */ __name((e2) => {
    if (toValue(preventDefault2))
      e2.preventDefault();
    if (toValue(stopPropagation))
      e2.stopPropagation();
  }, "handleEvent");
  const start2 = /* @__PURE__ */ __name((e2) => {
    var _a22;
    if (!toValue(buttons).includes(e2.button))
      return;
    if (toValue(options4.disabled) || !filterEvent(e2))
      return;
    if (toValue(exact) && e2.target !== toValue(target))
      return;
    const container = toValue(containerElement);
    const containerRect = (_a22 = container == null ? void 0 : container.getBoundingClientRect) == null ? void 0 : _a22.call(container);
    const targetRect = toValue(target).getBoundingClientRect();
    const pos2 = {
      x: e2.clientX - (container ? targetRect.left - containerRect.left + container.scrollLeft : targetRect.left),
      y: e2.clientY - (container ? targetRect.top - containerRect.top + container.scrollTop : targetRect.top)
    };
    if ((onStart == null ? void 0 : onStart(pos2, e2)) === false)
      return;
    pressedDelta.value = pos2;
    handleEvent(e2);
  }, "start");
  const move = /* @__PURE__ */ __name((e2) => {
    if (toValue(options4.disabled) || !filterEvent(e2))
      return;
    if (!pressedDelta.value)
      return;
    const container = toValue(containerElement);
    const targetRect = toValue(target).getBoundingClientRect();
    let { x: x2, y: y2 } = position3.value;
    if (axis === "x" || axis === "both") {
      x2 = e2.clientX - pressedDelta.value.x;
      if (container)
        x2 = Math.min(Math.max(0, x2), container.scrollWidth - targetRect.width);
    }
    if (axis === "y" || axis === "both") {
      y2 = e2.clientY - pressedDelta.value.y;
      if (container)
        y2 = Math.min(Math.max(0, y2), container.scrollHeight - targetRect.height);
    }
    position3.value = {
      x: x2,
      y: y2
    };
    onMove == null ? void 0 : onMove(position3.value, e2);
    handleEvent(e2);
  }, "move");
  const end = /* @__PURE__ */ __name((e2) => {
    if (toValue(options4.disabled) || !filterEvent(e2))
      return;
    if (!pressedDelta.value)
      return;
    pressedDelta.value = void 0;
    onEnd == null ? void 0 : onEnd(position3.value, e2);
    handleEvent(e2);
  }, "end");
  if (isClient) {
    const config2 = { capture: (_b = options4.capture) != null ? _b : true };
    useEventListener(draggingHandle, "pointerdown", start2, config2);
    useEventListener(draggingElement, "pointermove", move, config2);
    useEventListener(draggingElement, "pointerup", end, config2);
  }
  return {
    ...toRefs(position3),
    position: position3,
    isDragging: computed(() => !!pressedDelta.value),
    style: computed(
      () => `left:${position3.value.x}px;top:${position3.value.y}px;`
    )
  };
}
__name(useDraggable, "useDraggable");
function useDropZone(target, options4 = {}) {
  const isOverDropZone = ref(false);
  const files = shallowRef(null);
  let counter = 0;
  let isDataTypeIncluded = true;
  if (isClient) {
    const _options = typeof options4 === "function" ? { onDrop: options4 } : options4;
    const getFiles = /* @__PURE__ */ __name((event) => {
      var _a2, _b;
      const list2 = Array.from((_b = (_a2 = event.dataTransfer) == null ? void 0 : _a2.files) != null ? _b : []);
      return files.value = list2.length === 0 ? null : list2;
    }, "getFiles");
    useEventListener(target, "dragenter", (event) => {
      var _a2, _b;
      const types = Array.from(((_a2 = event == null ? void 0 : event.dataTransfer) == null ? void 0 : _a2.items) || []).map((i2) => i2.kind === "file" ? i2.type : null).filter(notNullish);
      if (_options.dataTypes && event.dataTransfer) {
        const dataTypes2 = unref(_options.dataTypes);
        isDataTypeIncluded = typeof dataTypes2 === "function" ? dataTypes2(types) : dataTypes2 ? dataTypes2.some((item3) => types.includes(item3)) : true;
        if (!isDataTypeIncluded)
          return;
      }
      event.preventDefault();
      counter += 1;
      isOverDropZone.value = true;
      (_b = _options.onEnter) == null ? void 0 : _b.call(_options, getFiles(event), event);
    });
    useEventListener(target, "dragover", (event) => {
      var _a2;
      if (!isDataTypeIncluded)
        return;
      event.preventDefault();
      (_a2 = _options.onOver) == null ? void 0 : _a2.call(_options, getFiles(event), event);
    });
    useEventListener(target, "dragleave", (event) => {
      var _a2;
      if (!isDataTypeIncluded)
        return;
      event.preventDefault();
      counter -= 1;
      if (counter === 0)
        isOverDropZone.value = false;
      (_a2 = _options.onLeave) == null ? void 0 : _a2.call(_options, getFiles(event), event);
    });
    useEventListener(target, "drop", (event) => {
      var _a2;
      event.preventDefault();
      counter = 0;
      isOverDropZone.value = false;
      (_a2 = _options.onDrop) == null ? void 0 : _a2.call(_options, getFiles(event), event);
    });
  }
  return {
    files,
    isOverDropZone
  };
}
__name(useDropZone, "useDropZone");
function useResizeObserver(target, callback, options4 = {}) {
  const { window: window2 = defaultWindow, ...observerOptions } = options4;
  let observer;
  const isSupported2 = useSupported(() => window2 && "ResizeObserver" in window2);
  const cleanup = /* @__PURE__ */ __name(() => {
    if (observer) {
      observer.disconnect();
      observer = void 0;
    }
  }, "cleanup");
  const targets = computed(() => {
    const _targets = toValue(target);
    return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
  });
  const stopWatch = watch(
    targets,
    (els) => {
      cleanup();
      if (isSupported2.value && window2) {
        observer = new ResizeObserver(callback);
        for (const _el of els) {
          if (_el)
            observer.observe(_el, observerOptions);
        }
      }
    },
    { immediate: true, flush: "post" }
  );
  const stop2 = /* @__PURE__ */ __name(() => {
    cleanup();
    stopWatch();
  }, "stop");
  tryOnScopeDispose(stop2);
  return {
    isSupported: isSupported2,
    stop: stop2
  };
}
__name(useResizeObserver, "useResizeObserver");
function useElementBounding(target, options4 = {}) {
  const {
    reset: reset2 = true,
    windowResize = true,
    windowScroll = true,
    immediate = true,
    updateTiming = "sync"
  } = options4;
  const height = ref(0);
  const bottom = ref(0);
  const left = ref(0);
  const right = ref(0);
  const top = ref(0);
  const width2 = ref(0);
  const x2 = ref(0);
  const y2 = ref(0);
  function recalculate() {
    const el = unrefElement(target);
    if (!el) {
      if (reset2) {
        height.value = 0;
        bottom.value = 0;
        left.value = 0;
        right.value = 0;
        top.value = 0;
        width2.value = 0;
        x2.value = 0;
        y2.value = 0;
      }
      return;
    }
    const rect = el.getBoundingClientRect();
    height.value = rect.height;
    bottom.value = rect.bottom;
    left.value = rect.left;
    right.value = rect.right;
    top.value = rect.top;
    width2.value = rect.width;
    x2.value = rect.x;
    y2.value = rect.y;
  }
  __name(recalculate, "recalculate");
  function update() {
    if (updateTiming === "sync")
      recalculate();
    else if (updateTiming === "next-frame")
      requestAnimationFrame(() => recalculate());
  }
  __name(update, "update");
  useResizeObserver(target, update);
  watch(() => unrefElement(target), (ele) => !ele && update());
  useMutationObserver(target, update, {
    attributeFilter: ["style", "class"]
  });
  if (windowScroll)
    useEventListener("scroll", update, { capture: true, passive: true });
  if (windowResize)
    useEventListener("resize", update, { passive: true });
  tryOnMounted(() => {
    if (immediate)
      update();
  });
  return {
    height,
    bottom,
    left,
    right,
    top,
    width: width2,
    x: x2,
    y: y2,
    update
  };
}
__name(useElementBounding, "useElementBounding");
function useElementByPoint(options4) {
  const {
    x: x2,
    y: y2,
    document: document2 = defaultDocument,
    multiple,
    interval = "requestAnimationFrame",
    immediate = true
  } = options4;
  const isSupported2 = useSupported(() => {
    if (toValue(multiple))
      return document2 && "elementsFromPoint" in document2;
    return document2 && "elementFromPoint" in document2;
  });
  const element = ref(null);
  const cb = /* @__PURE__ */ __name(() => {
    var _a2, _b;
    element.value = toValue(multiple) ? (_a2 = document2 == null ? void 0 : document2.elementsFromPoint(toValue(x2), toValue(y2))) != null ? _a2 : [] : (_b = document2 == null ? void 0 : document2.elementFromPoint(toValue(x2), toValue(y2))) != null ? _b : null;
  }, "cb");
  const controls = interval === "requestAnimationFrame" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });
  return {
    isSupported: isSupported2,
    element,
    ...controls
  };
}
__name(useElementByPoint, "useElementByPoint");
function useElementHover(el, options4 = {}) {
  const {
    delayEnter = 0,
    delayLeave = 0,
    window: window2 = defaultWindow
  } = options4;
  const isHovered = ref(false);
  let timer;
  const toggle4 = /* @__PURE__ */ __name((entering) => {
    const delay = entering ? delayEnter : delayLeave;
    if (timer) {
      clearTimeout(timer);
      timer = void 0;
    }
    if (delay)
      timer = setTimeout(() => isHovered.value = entering, delay);
    else
      isHovered.value = entering;
  }, "toggle");
  if (!window2)
    return isHovered;
  useEventListener(el, "mouseenter", () => toggle4(true), { passive: true });
  useEventListener(el, "mouseleave", () => toggle4(false), { passive: true });
  return isHovered;
}
__name(useElementHover, "useElementHover");
function useElementSize(target, initialSize = { width: 0, height: 0 }, options4 = {}) {
  const { window: window2 = defaultWindow, box = "content-box" } = options4;
  const isSVG = computed(() => {
    var _a2, _b;
    return (_b = (_a2 = unrefElement(target)) == null ? void 0 : _a2.namespaceURI) == null ? void 0 : _b.includes("svg");
  });
  const width2 = ref(initialSize.width);
  const height = ref(initialSize.height);
  const { stop: stop1 } = useResizeObserver(
    target,
    ([entry]) => {
      const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
      if (window2 && isSVG.value) {
        const $elem = unrefElement(target);
        if ($elem) {
          const rect = $elem.getBoundingClientRect();
          width2.value = rect.width;
          height.value = rect.height;
        }
      } else {
        if (boxSize) {
          const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
          width2.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
          height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
        } else {
          width2.value = entry.contentRect.width;
          height.value = entry.contentRect.height;
        }
      }
    },
    options4
  );
  tryOnMounted(() => {
    const ele = unrefElement(target);
    if (ele) {
      width2.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
      height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
    }
  });
  const stop2 = watch(
    () => unrefElement(target),
    (ele) => {
      width2.value = ele ? initialSize.width : 0;
      height.value = ele ? initialSize.height : 0;
    }
  );
  function stop3() {
    stop1();
    stop2();
  }
  __name(stop3, "stop");
  return {
    width: width2,
    height,
    stop: stop3
  };
}
__name(useElementSize, "useElementSize");
function useIntersectionObserver(target, callback, options4 = {}) {
  const {
    root: root24,
    rootMargin = "0px",
    threshold = 0,
    window: window2 = defaultWindow,
    immediate = true
  } = options4;
  const isSupported2 = useSupported(() => window2 && "IntersectionObserver" in window2);
  const targets = computed(() => {
    const _target = toValue(target);
    return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(notNullish);
  });
  let cleanup = noop$1;
  const isActive2 = ref(immediate);
  const stopWatch = isSupported2.value ? watch(
    () => [targets.value, unrefElement(root24), isActive2.value],
    ([targets2, root25]) => {
      cleanup();
      if (!isActive2.value)
        return;
      if (!targets2.length)
        return;
      const observer = new IntersectionObserver(
        callback,
        {
          root: unrefElement(root25),
          rootMargin,
          threshold
        }
      );
      targets2.forEach((el) => el && observer.observe(el));
      cleanup = /* @__PURE__ */ __name(() => {
        observer.disconnect();
        cleanup = noop$1;
      }, "cleanup");
    },
    { immediate, flush: "post" }
  ) : noop$1;
  const stop2 = /* @__PURE__ */ __name(() => {
    cleanup();
    stopWatch();
    isActive2.value = false;
  }, "stop");
  tryOnScopeDispose(stop2);
  return {
    isSupported: isSupported2,
    isActive: isActive2,
    pause() {
      cleanup();
      isActive2.value = false;
    },
    resume() {
      isActive2.value = true;
    },
    stop: stop2
  };
}
__name(useIntersectionObserver, "useIntersectionObserver");
function useElementVisibility(element, options4 = {}) {
  const { window: window2 = defaultWindow, scrollTarget, threshold = 0 } = options4;
  const elementIsVisible = ref(false);
  useIntersectionObserver(
    element,
    (intersectionObserverEntries) => {
      let isIntersecting = elementIsVisible.value;
      let latestTime = 0;
      for (const entry of intersectionObserverEntries) {
        if (entry.time >= latestTime) {
          latestTime = entry.time;
          isIntersecting = entry.isIntersecting;
        }
      }
      elementIsVisible.value = isIntersecting;
    },
    {
      root: scrollTarget,
      window: window2,
      threshold
    }
  );
  return elementIsVisible;
}
__name(useElementVisibility, "useElementVisibility");
const events = /* @__PURE__ */ new Map();
function useEventBus(key) {
  const scope = getCurrentScope();
  function on(listener) {
    var _a2;
    const listeners = events.get(key) || /* @__PURE__ */ new Set();
    listeners.add(listener);
    events.set(key, listeners);
    const _off = /* @__PURE__ */ __name(() => off(listener), "_off");
    (_a2 = scope == null ? void 0 : scope.cleanups) == null ? void 0 : _a2.push(_off);
    return _off;
  }
  __name(on, "on");
  function once2(listener) {
    function _listener(...args) {
      off(_listener);
      listener(...args);
    }
    __name(_listener, "_listener");
    return on(_listener);
  }
  __name(once2, "once");
  function off(listener) {
    const listeners = events.get(key);
    if (!listeners)
      return;
    listeners.delete(listener);
    if (!listeners.size)
      reset2();
  }
  __name(off, "off");
  function reset2() {
    events.delete(key);
  }
  __name(reset2, "reset");
  function emit2(event, payload) {
    var _a2;
    (_a2 = events.get(key)) == null ? void 0 : _a2.forEach((v2) => v2(event, payload));
  }
  __name(emit2, "emit");
  return { on, once: once2, off, emit: emit2, reset: reset2 };
}
__name(useEventBus, "useEventBus");
function resolveNestedOptions$1(options4) {
  if (options4 === true)
    return {};
  return options4;
}
__name(resolveNestedOptions$1, "resolveNestedOptions$1");
function useEventSource(url, events2 = [], options4 = {}) {
  const event = ref(null);
  const data24 = ref(null);
  const status = ref("CONNECTING");
  const eventSource = ref(null);
  const error2 = shallowRef(null);
  const urlRef = toRef(url);
  const lastEventId = shallowRef(null);
  let explicitlyClosed = false;
  let retried = 0;
  const {
    withCredentials = false,
    immediate = true
  } = options4;
  const close5 = /* @__PURE__ */ __name(() => {
    if (isClient && eventSource.value) {
      eventSource.value.close();
      eventSource.value = null;
      status.value = "CLOSED";
      explicitlyClosed = true;
    }
  }, "close");
  const _init = /* @__PURE__ */ __name(() => {
    if (explicitlyClosed || typeof urlRef.value === "undefined")
      return;
    const es = new EventSource(urlRef.value, { withCredentials });
    status.value = "CONNECTING";
    eventSource.value = es;
    es.onopen = () => {
      status.value = "OPEN";
      error2.value = null;
    };
    es.onerror = (e2) => {
      status.value = "CLOSED";
      error2.value = e2;
      if (es.readyState === 2 && !explicitlyClosed && options4.autoReconnect) {
        es.close();
        const {
          retries = -1,
          delay = 1e3,
          onFailed
        } = resolveNestedOptions$1(options4.autoReconnect);
        retried += 1;
        if (typeof retries === "number" && (retries < 0 || retried < retries))
          setTimeout(_init, delay);
        else if (typeof retries === "function" && retries())
          setTimeout(_init, delay);
        else
          onFailed == null ? void 0 : onFailed();
      }
    };
    es.onmessage = (e2) => {
      event.value = null;
      data24.value = e2.data;
      lastEventId.value = e2.lastEventId;
    };
    for (const event_name of events2) {
      useEventListener(es, event_name, (e2) => {
        event.value = event_name;
        data24.value = e2.data || null;
      });
    }
  }, "_init");
  const open2 = /* @__PURE__ */ __name(() => {
    if (!isClient)
      return;
    close5();
    explicitlyClosed = false;
    retried = 0;
    _init();
  }, "open");
  if (immediate)
    watch(urlRef, open2, { immediate: true });
  tryOnScopeDispose(close5);
  return {
    eventSource,
    event,
    data: data24,
    status,
    error: error2,
    open: open2,
    close: close5,
    lastEventId
  };
}
__name(useEventSource, "useEventSource");
function useEyeDropper(options4 = {}) {
  const { initialValue = "" } = options4;
  const isSupported2 = useSupported(() => typeof window !== "undefined" && "EyeDropper" in window);
  const sRGBHex = ref(initialValue);
  async function open2(openOptions) {
    if (!isSupported2.value)
      return;
    const eyeDropper = new window.EyeDropper();
    const result = await eyeDropper.open(openOptions);
    sRGBHex.value = result.sRGBHex;
    return result;
  }
  __name(open2, "open");
  return { isSupported: isSupported2, sRGBHex, open: open2 };
}
__name(useEyeDropper, "useEyeDropper");
function useFavicon(newIcon = null, options4 = {}) {
  const {
    baseUrl = "",
    rel = "icon",
    document: document2 = defaultDocument
  } = options4;
  const favicon = toRef(newIcon);
  const applyIcon = /* @__PURE__ */ __name((icon3) => {
    const elements = document2 == null ? void 0 : document2.head.querySelectorAll(`link[rel*="${rel}"]`);
    if (!elements || elements.length === 0) {
      const link2 = document2 == null ? void 0 : document2.createElement("link");
      if (link2) {
        link2.rel = rel;
        link2.href = `${baseUrl}${icon3}`;
        link2.type = `image/${icon3.split(".").pop()}`;
        document2 == null ? void 0 : document2.head.append(link2);
      }
      return;
    }
    elements == null ? void 0 : elements.forEach((el) => el.href = `${baseUrl}${icon3}`);
  }, "applyIcon");
  watch(
    favicon,
    (i2, o) => {
      if (typeof i2 === "string" && i2 !== o)
        applyIcon(i2);
    },
    { immediate: true }
  );
  return favicon;
}
__name(useFavicon, "useFavicon");
const payloadMapping = {
  json: "application/json",
  text: "text/plain"
};
function isFetchOptions(obj) {
  return obj && containsProp(obj, "immediate", "refetch", "initialData", "timeout", "beforeFetch", "afterFetch", "onFetchError", "fetch", "updateDataOnError");
}
__name(isFetchOptions, "isFetchOptions");
const reAbsolute = /^(?:[a-z][a-z\d+\-.]*:)?\/\//i;
function isAbsoluteURL(url) {
  return reAbsolute.test(url);
}
__name(isAbsoluteURL, "isAbsoluteURL");
function headersToObject(headers) {
  if (typeof Headers !== "undefined" && headers instanceof Headers)
    return Object.fromEntries(headers.entries());
  return headers;
}
__name(headersToObject, "headersToObject");
function combineCallbacks(combination, ...callbacks) {
  if (combination === "overwrite") {
    return async (ctx) => {
      const callback = callbacks[callbacks.length - 1];
      if (callback)
        return { ...ctx, ...await callback(ctx) };
      return ctx;
    };
  } else {
    return async (ctx) => {
      for (const callback of callbacks) {
        if (callback)
          ctx = { ...ctx, ...await callback(ctx) };
      }
      return ctx;
    };
  }
}
__name(combineCallbacks, "combineCallbacks");
function createFetch(config2 = {}) {
  const _combination = config2.combination || "chain";
  const _options = config2.options || {};
  const _fetchOptions = config2.fetchOptions || {};
  function useFactoryFetch(url, ...args) {
    const computedUrl = computed(() => {
      const baseUrl = toValue(config2.baseUrl);
      const targetUrl = toValue(url);
      return baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;
    });
    let options4 = _options;
    let fetchOptions = _fetchOptions;
    if (args.length > 0) {
      if (isFetchOptions(args[0])) {
        options4 = {
          ...options4,
          ...args[0],
          beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),
          afterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),
          onFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)
        };
      } else {
        fetchOptions = {
          ...fetchOptions,
          ...args[0],
          headers: {
            ...headersToObject(fetchOptions.headers) || {},
            ...headersToObject(args[0].headers) || {}
          }
        };
      }
    }
    if (args.length > 1 && isFetchOptions(args[1])) {
      options4 = {
        ...options4,
        ...args[1],
        beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),
        afterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),
        onFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)
      };
    }
    return useFetch(computedUrl, fetchOptions, options4);
  }
  __name(useFactoryFetch, "useFactoryFetch");
  return useFactoryFetch;
}
__name(createFetch, "createFetch");
function useFetch(url, ...args) {
  var _a2;
  const supportsAbort = typeof AbortController === "function";
  let fetchOptions = {};
  let options4 = {
    immediate: true,
    refetch: false,
    timeout: 0,
    updateDataOnError: false
  };
  const config2 = {
    method: "GET",
    type: "text",
    payload: void 0
  };
  if (args.length > 0) {
    if (isFetchOptions(args[0]))
      options4 = { ...options4, ...args[0] };
    else
      fetchOptions = args[0];
  }
  if (args.length > 1) {
    if (isFetchOptions(args[1]))
      options4 = { ...options4, ...args[1] };
  }
  const {
    fetch: fetch2 = (_a2 = defaultWindow) == null ? void 0 : _a2.fetch,
    initialData,
    timeout
  } = options4;
  const responseEvent = createEventHook();
  const errorEvent = createEventHook();
  const finallyEvent = createEventHook();
  const isFinished = ref(false);
  const isFetching = ref(false);
  const aborted = ref(false);
  const statusCode = ref(null);
  const response = shallowRef(null);
  const error2 = shallowRef(null);
  const data24 = shallowRef(initialData || null);
  const canAbort = computed(() => supportsAbort && isFetching.value);
  let controller;
  let timer;
  const abort = /* @__PURE__ */ __name(() => {
    if (supportsAbort) {
      controller == null ? void 0 : controller.abort();
      controller = new AbortController();
      controller.signal.onabort = () => aborted.value = true;
      fetchOptions = {
        ...fetchOptions,
        signal: controller.signal
      };
    }
  }, "abort");
  const loading2 = /* @__PURE__ */ __name((isLoading) => {
    isFetching.value = isLoading;
    isFinished.value = !isLoading;
  }, "loading");
  if (timeout)
    timer = useTimeoutFn(abort, timeout, { immediate: false });
  let executeCounter = 0;
  const execute = /* @__PURE__ */ __name(async (throwOnFailed = false) => {
    var _a22, _b;
    abort();
    loading2(true);
    error2.value = null;
    statusCode.value = null;
    aborted.value = false;
    executeCounter += 1;
    const currentExecuteCounter = executeCounter;
    const defaultFetchOptions = {
      method: config2.method,
      headers: {}
    };
    if (config2.payload) {
      const headers = headersToObject(defaultFetchOptions.headers);
      const payload = toValue(config2.payload);
      if (!config2.payloadType && payload && Object.getPrototypeOf(payload) === Object.prototype && !(payload instanceof FormData))
        config2.payloadType = "json";
      if (config2.payloadType)
        headers["Content-Type"] = (_a22 = payloadMapping[config2.payloadType]) != null ? _a22 : config2.payloadType;
      defaultFetchOptions.body = config2.payloadType === "json" ? JSON.stringify(payload) : payload;
    }
    let isCanceled = false;
    const context = {
      url: toValue(url),
      options: {
        ...defaultFetchOptions,
        ...fetchOptions
      },
      cancel: /* @__PURE__ */ __name(() => {
        isCanceled = true;
      }, "cancel")
    };
    if (options4.beforeFetch)
      Object.assign(context, await options4.beforeFetch(context));
    if (isCanceled || !fetch2) {
      loading2(false);
      return Promise.resolve(null);
    }
    let responseData = null;
    if (timer)
      timer.start();
    return fetch2(
      context.url,
      {
        ...defaultFetchOptions,
        ...context.options,
        headers: {
          ...headersToObject(defaultFetchOptions.headers),
          ...headersToObject((_b = context.options) == null ? void 0 : _b.headers)
        }
      }
    ).then(async (fetchResponse) => {
      response.value = fetchResponse;
      statusCode.value = fetchResponse.status;
      responseData = await fetchResponse.clone()[config2.type]();
      if (!fetchResponse.ok) {
        data24.value = initialData || null;
        throw new Error(fetchResponse.statusText);
      }
      if (options4.afterFetch) {
        ({ data: responseData } = await options4.afterFetch({
          data: responseData,
          response: fetchResponse
        }));
      }
      data24.value = responseData;
      responseEvent.trigger(fetchResponse);
      return fetchResponse;
    }).catch(async (fetchError) => {
      let errorData = fetchError.message || fetchError.name;
      if (options4.onFetchError) {
        ({ error: errorData, data: responseData } = await options4.onFetchError({
          data: responseData,
          error: fetchError,
          response: response.value
        }));
      }
      error2.value = errorData;
      if (options4.updateDataOnError)
        data24.value = responseData;
      errorEvent.trigger(fetchError);
      if (throwOnFailed)
        throw fetchError;
      return null;
    }).finally(() => {
      if (currentExecuteCounter === executeCounter)
        loading2(false);
      if (timer)
        timer.stop();
      finallyEvent.trigger(null);
    });
  }, "execute");
  const refetch = toRef(options4.refetch);
  watch(
    [
      refetch,
      toRef(url)
    ],
    ([refetch2]) => refetch2 && execute(),
    { deep: true }
  );
  const shell = {
    isFinished: readonly(isFinished),
    isFetching: readonly(isFetching),
    statusCode,
    response,
    error: error2,
    data: data24,
    canAbort,
    aborted,
    abort,
    execute,
    onFetchResponse: responseEvent.on,
    onFetchError: errorEvent.on,
    onFetchFinally: finallyEvent.on,
    // method
    get: setMethod("GET"),
    put: setMethod("PUT"),
    post: setMethod("POST"),
    delete: setMethod("DELETE"),
    patch: setMethod("PATCH"),
    head: setMethod("HEAD"),
    options: setMethod("OPTIONS"),
    // type
    json: setType2("json"),
    text: setType2("text"),
    blob: setType2("blob"),
    arrayBuffer: setType2("arrayBuffer"),
    formData: setType2("formData")
  };
  function setMethod(method) {
    return (payload, payloadType) => {
      if (!isFetching.value) {
        config2.method = method;
        config2.payload = payload;
        config2.payloadType = payloadType;
        if (isRef(config2.payload)) {
          watch(
            [
              refetch,
              toRef(config2.payload)
            ],
            ([refetch2]) => refetch2 && execute(),
            { deep: true }
          );
        }
        return {
          ...shell,
          then(onFulfilled, onRejected) {
            return waitUntilFinished().then(onFulfilled, onRejected);
          }
        };
      }
      return void 0;
    };
  }
  __name(setMethod, "setMethod");
  function waitUntilFinished() {
    return new Promise((resolve2, reject3) => {
      until(isFinished).toBe(true).then(() => resolve2(shell)).catch((error22) => reject3(error22));
    });
  }
  __name(waitUntilFinished, "waitUntilFinished");
  function setType2(type) {
    return () => {
      if (!isFetching.value) {
        config2.type = type;
        return {
          ...shell,
          then(onFulfilled, onRejected) {
            return waitUntilFinished().then(onFulfilled, onRejected);
          }
        };
      }
      return void 0;
    };
  }
  __name(setType2, "setType");
  if (options4.immediate)
    Promise.resolve().then(() => execute());
  return {
    ...shell,
    then(onFulfilled, onRejected) {
      return waitUntilFinished().then(onFulfilled, onRejected);
    }
  };
}
__name(useFetch, "useFetch");
function joinPaths(start2, end) {
  if (!start2.endsWith("/") && !end.startsWith("/"))
    return `${start2}/${end}`;
  return `${start2}${end}`;
}
__name(joinPaths, "joinPaths");
const DEFAULT_OPTIONS = {
  multiple: true,
  accept: "*",
  reset: false,
  directory: false
};
function useFileDialog(options4 = {}) {
  const {
    document: document2 = defaultDocument
  } = options4;
  const files = ref(null);
  const { on: onChange5, trigger: trigger2 } = createEventHook();
  let input;
  if (document2) {
    input = document2.createElement("input");
    input.type = "file";
    input.onchange = (event) => {
      const result = event.target;
      files.value = result.files;
      trigger2(files.value);
    };
  }
  const reset2 = /* @__PURE__ */ __name(() => {
    files.value = null;
    if (input && input.value) {
      input.value = "";
      trigger2(null);
    }
  }, "reset");
  const open2 = /* @__PURE__ */ __name((localOptions) => {
    if (!input)
      return;
    const _options = {
      ...DEFAULT_OPTIONS,
      ...options4,
      ...localOptions
    };
    input.multiple = _options.multiple;
    input.accept = _options.accept;
    input.webkitdirectory = _options.directory;
    if (hasOwn$2(_options, "capture"))
      input.capture = _options.capture;
    if (_options.reset)
      reset2();
    input.click();
  }, "open");
  return {
    files: readonly(files),
    open: open2,
    reset: reset2,
    onChange: onChange5
  };
}
__name(useFileDialog, "useFileDialog");
function useFileSystemAccess(options4 = {}) {
  const {
    window: _window = defaultWindow,
    dataType = "Text"
  } = options4;
  const window2 = _window;
  const isSupported2 = useSupported(() => window2 && "showSaveFilePicker" in window2 && "showOpenFilePicker" in window2);
  const fileHandle = ref();
  const data24 = ref();
  const file = ref();
  const fileName = computed(() => {
    var _a2, _b;
    return (_b = (_a2 = file.value) == null ? void 0 : _a2.name) != null ? _b : "";
  });
  const fileMIME = computed(() => {
    var _a2, _b;
    return (_b = (_a2 = file.value) == null ? void 0 : _a2.type) != null ? _b : "";
  });
  const fileSize = computed(() => {
    var _a2, _b;
    return (_b = (_a2 = file.value) == null ? void 0 : _a2.size) != null ? _b : 0;
  });
  const fileLastModified = computed(() => {
    var _a2, _b;
    return (_b = (_a2 = file.value) == null ? void 0 : _a2.lastModified) != null ? _b : 0;
  });
  async function open2(_options = {}) {
    if (!isSupported2.value)
      return;
    const [handle] = await window2.showOpenFilePicker({ ...toValue(options4), ..._options });
    fileHandle.value = handle;
    await updateData();
  }
  __name(open2, "open");
  async function create3(_options = {}) {
    if (!isSupported2.value)
      return;
    fileHandle.value = await window2.showSaveFilePicker({ ...options4, ..._options });
    data24.value = void 0;
    await updateData();
  }
  __name(create3, "create");
  async function save(_options = {}) {
    if (!isSupported2.value)
      return;
    if (!fileHandle.value)
      return saveAs2(_options);
    if (data24.value) {
      const writableStream = await fileHandle.value.createWritable();
      await writableStream.write(data24.value);
      await writableStream.close();
    }
    await updateFile();
  }
  __name(save, "save");
  async function saveAs2(_options = {}) {
    if (!isSupported2.value)
      return;
    fileHandle.value = await window2.showSaveFilePicker({ ...options4, ..._options });
    if (data24.value) {
      const writableStream = await fileHandle.value.createWritable();
      await writableStream.write(data24.value);
      await writableStream.close();
    }
    await updateFile();
  }
  __name(saveAs2, "saveAs");
  async function updateFile() {
    var _a2;
    file.value = await ((_a2 = fileHandle.value) == null ? void 0 : _a2.getFile());
  }
  __name(updateFile, "updateFile");
  async function updateData() {
    var _a2, _b;
    await updateFile();
    const type = toValue(dataType);
    if (type === "Text")
      data24.value = await ((_a2 = file.value) == null ? void 0 : _a2.text());
    else if (type === "ArrayBuffer")
      data24.value = await ((_b = file.value) == null ? void 0 : _b.arrayBuffer());
    else if (type === "Blob")
      data24.value = file.value;
  }
  __name(updateData, "updateData");
  watch(() => toValue(dataType), updateData);
  return {
    isSupported: isSupported2,
    data: data24,
    file,
    fileName,
    fileMIME,
    fileSize,
    fileLastModified,
    open: open2,
    create: create3,
    save,
    saveAs: saveAs2,
    updateData
  };
}
__name(useFileSystemAccess, "useFileSystemAccess");
function useFocus(target, options4 = {}) {
  const { initialValue = false, focusVisible = false, preventScroll = false } = options4;
  const innerFocused = ref(false);
  const targetElement = computed(() => unrefElement(target));
  useEventListener(targetElement, "focus", (event) => {
    var _a2, _b;
    if (!focusVisible || ((_b = (_a2 = event.target).matches) == null ? void 0 : _b.call(_a2, ":focus-visible")))
      innerFocused.value = true;
  });
  useEventListener(targetElement, "blur", () => innerFocused.value = false);
  const focused = computed({
    get: /* @__PURE__ */ __name(() => innerFocused.value, "get"),
    set(value4) {
      var _a2, _b;
      if (!value4 && innerFocused.value)
        (_a2 = targetElement.value) == null ? void 0 : _a2.blur();
      else if (value4 && !innerFocused.value)
        (_b = targetElement.value) == null ? void 0 : _b.focus({ preventScroll });
    }
  });
  watch(
    targetElement,
    () => {
      focused.value = initialValue;
    },
    { immediate: true, flush: "post" }
  );
  return { focused };
}
__name(useFocus, "useFocus");
function useFocusWithin(target, options4 = {}) {
  const activeElement = useActiveElement(options4);
  const targetElement = computed(() => unrefElement(target));
  const focused = computed(() => targetElement.value && activeElement.value ? targetElement.value.contains(activeElement.value) : false);
  return { focused };
}
__name(useFocusWithin, "useFocusWithin");
function useFps(options4) {
  var _a2;
  const fps = ref(0);
  if (typeof performance === "undefined")
    return fps;
  const every = (_a2 = options4 == null ? void 0 : options4.every) != null ? _a2 : 10;
  let last = performance.now();
  let ticks = 0;
  useRafFn(() => {
    ticks += 1;
    if (ticks >= every) {
      const now2 = performance.now();
      const diff2 = now2 - last;
      fps.value = Math.round(1e3 / (diff2 / ticks));
      last = now2;
      ticks = 0;
    }
  });
  return fps;
}
__name(useFps, "useFps");
const eventHandlers = [
  "fullscreenchange",
  "webkitfullscreenchange",
  "webkitendfullscreen",
  "mozfullscreenchange",
  "MSFullscreenChange"
];
function useFullscreen(target, options4 = {}) {
  const {
    document: document2 = defaultDocument,
    autoExit = false
  } = options4;
  const targetRef = computed(() => {
    var _a2;
    return (_a2 = unrefElement(target)) != null ? _a2 : document2 == null ? void 0 : document2.querySelector("html");
  });
  const isFullscreen = ref(false);
  const requestMethod = computed(() => {
    return [
      "requestFullscreen",
      "webkitRequestFullscreen",
      "webkitEnterFullscreen",
      "webkitEnterFullScreen",
      "webkitRequestFullScreen",
      "mozRequestFullScreen",
      "msRequestFullscreen"
    ].find((m) => document2 && m in document2 || targetRef.value && m in targetRef.value);
  });
  const exitMethod = computed(() => {
    return [
      "exitFullscreen",
      "webkitExitFullscreen",
      "webkitExitFullScreen",
      "webkitCancelFullScreen",
      "mozCancelFullScreen",
      "msExitFullscreen"
    ].find((m) => document2 && m in document2 || targetRef.value && m in targetRef.value);
  });
  const fullscreenEnabled = computed(() => {
    return [
      "fullScreen",
      "webkitIsFullScreen",
      "webkitDisplayingFullscreen",
      "mozFullScreen",
      "msFullscreenElement"
    ].find((m) => document2 && m in document2 || targetRef.value && m in targetRef.value);
  });
  const fullscreenElementMethod = [
    "fullscreenElement",
    "webkitFullscreenElement",
    "mozFullScreenElement",
    "msFullscreenElement"
  ].find((m) => document2 && m in document2);
  const isSupported2 = useSupported(() => targetRef.value && document2 && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);
  const isCurrentElementFullScreen = /* @__PURE__ */ __name(() => {
    if (fullscreenElementMethod)
      return (document2 == null ? void 0 : document2[fullscreenElementMethod]) === targetRef.value;
    return false;
  }, "isCurrentElementFullScreen");
  const isElementFullScreen = /* @__PURE__ */ __name(() => {
    if (fullscreenEnabled.value) {
      if (document2 && document2[fullscreenEnabled.value] != null) {
        return document2[fullscreenEnabled.value];
      } else {
        const target2 = targetRef.value;
        if ((target2 == null ? void 0 : target2[fullscreenEnabled.value]) != null) {
          return Boolean(target2[fullscreenEnabled.value]);
        }
      }
    }
    return false;
  }, "isElementFullScreen");
  async function exit() {
    if (!isSupported2.value || !isFullscreen.value)
      return;
    if (exitMethod.value) {
      if ((document2 == null ? void 0 : document2[exitMethod.value]) != null) {
        await document2[exitMethod.value]();
      } else {
        const target2 = targetRef.value;
        if ((target2 == null ? void 0 : target2[exitMethod.value]) != null)
          await target2[exitMethod.value]();
      }
    }
    isFullscreen.value = false;
  }
  __name(exit, "exit");
  async function enter2() {
    if (!isSupported2.value || isFullscreen.value)
      return;
    if (isElementFullScreen())
      await exit();
    const target2 = targetRef.value;
    if (requestMethod.value && (target2 == null ? void 0 : target2[requestMethod.value]) != null) {
      await target2[requestMethod.value]();
      isFullscreen.value = true;
    }
  }
  __name(enter2, "enter");
  async function toggle4() {
    await (isFullscreen.value ? exit() : enter2());
  }
  __name(toggle4, "toggle");
  const handlerCallback = /* @__PURE__ */ __name(() => {
    const isElementFullScreenValue = isElementFullScreen();
    if (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen())
      isFullscreen.value = isElementFullScreenValue;
  }, "handlerCallback");
  useEventListener(document2, eventHandlers, handlerCallback, false);
  useEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, false);
  if (autoExit)
    tryOnScopeDispose(exit);
  return {
    isSupported: isSupported2,
    isFullscreen,
    enter: enter2,
    exit,
    toggle: toggle4
  };
}
__name(useFullscreen, "useFullscreen");
function mapGamepadToXbox360Controller(gamepad) {
  return computed(() => {
    if (gamepad.value) {
      return {
        buttons: {
          a: gamepad.value.buttons[0],
          b: gamepad.value.buttons[1],
          x: gamepad.value.buttons[2],
          y: gamepad.value.buttons[3]
        },
        bumper: {
          left: gamepad.value.buttons[4],
          right: gamepad.value.buttons[5]
        },
        triggers: {
          left: gamepad.value.buttons[6],
          right: gamepad.value.buttons[7]
        },
        stick: {
          left: {
            horizontal: gamepad.value.axes[0],
            vertical: gamepad.value.axes[1],
            button: gamepad.value.buttons[10]
          },
          right: {
            horizontal: gamepad.value.axes[2],
            vertical: gamepad.value.axes[3],
            button: gamepad.value.buttons[11]
          }
        },
        dpad: {
          up: gamepad.value.buttons[12],
          down: gamepad.value.buttons[13],
          left: gamepad.value.buttons[14],
          right: gamepad.value.buttons[15]
        },
        back: gamepad.value.buttons[8],
        start: gamepad.value.buttons[9]
      };
    }
    return null;
  });
}
__name(mapGamepadToXbox360Controller, "mapGamepadToXbox360Controller");
function useGamepad(options4 = {}) {
  const {
    navigator: navigator2 = defaultNavigator
  } = options4;
  const isSupported2 = useSupported(() => navigator2 && "getGamepads" in navigator2);
  const gamepads = ref([]);
  const onConnectedHook = createEventHook();
  const onDisconnectedHook = createEventHook();
  const stateFromGamepad = /* @__PURE__ */ __name((gamepad) => {
    const hapticActuators = [];
    const vibrationActuator = "vibrationActuator" in gamepad ? gamepad.vibrationActuator : null;
    if (vibrationActuator)
      hapticActuators.push(vibrationActuator);
    if (gamepad.hapticActuators)
      hapticActuators.push(...gamepad.hapticActuators);
    return {
      id: gamepad.id,
      index: gamepad.index,
      connected: gamepad.connected,
      mapping: gamepad.mapping,
      timestamp: gamepad.timestamp,
      vibrationActuator: gamepad.vibrationActuator,
      hapticActuators,
      axes: gamepad.axes.map((axes) => axes),
      buttons: gamepad.buttons.map((button) => ({ pressed: button.pressed, touched: button.touched, value: button.value }))
    };
  }, "stateFromGamepad");
  const updateGamepadState = /* @__PURE__ */ __name(() => {
    const _gamepads = (navigator2 == null ? void 0 : navigator2.getGamepads()) || [];
    for (const gamepad of _gamepads) {
      if (gamepad && gamepads.value[gamepad.index])
        gamepads.value[gamepad.index] = stateFromGamepad(gamepad);
    }
  }, "updateGamepadState");
  const { isActive: isActive2, pause, resume } = useRafFn(updateGamepadState);
  const onGamepadConnected = /* @__PURE__ */ __name((gamepad) => {
    if (!gamepads.value.some(({ index: index2 }) => index2 === gamepad.index)) {
      gamepads.value.push(stateFromGamepad(gamepad));
      onConnectedHook.trigger(gamepad.index);
    }
    resume();
  }, "onGamepadConnected");
  const onGamepadDisconnected = /* @__PURE__ */ __name((gamepad) => {
    gamepads.value = gamepads.value.filter((x2) => x2.index !== gamepad.index);
    onDisconnectedHook.trigger(gamepad.index);
  }, "onGamepadDisconnected");
  useEventListener("gamepadconnected", (e2) => onGamepadConnected(e2.gamepad));
  useEventListener("gamepaddisconnected", (e2) => onGamepadDisconnected(e2.gamepad));
  tryOnMounted(() => {
    const _gamepads = (navigator2 == null ? void 0 : navigator2.getGamepads()) || [];
    for (const gamepad of _gamepads) {
      if (gamepad && gamepads.value[gamepad.index])
        onGamepadConnected(gamepad);
    }
  });
  pause();
  return {
    isSupported: isSupported2,
    onConnected: onConnectedHook.on,
    onDisconnected: onDisconnectedHook.on,
    gamepads,
    pause,
    resume,
    isActive: isActive2
  };
}
__name(useGamepad, "useGamepad");
function useGeolocation(options4 = {}) {
  const {
    enableHighAccuracy = true,
    maximumAge = 3e4,
    timeout = 27e3,
    navigator: navigator2 = defaultNavigator,
    immediate = true
  } = options4;
  const isSupported2 = useSupported(() => navigator2 && "geolocation" in navigator2);
  const locatedAt = ref(null);
  const error2 = shallowRef(null);
  const coords = ref({
    accuracy: 0,
    latitude: Number.POSITIVE_INFINITY,
    longitude: Number.POSITIVE_INFINITY,
    altitude: null,
    altitudeAccuracy: null,
    heading: null,
    speed: null
  });
  function updatePosition(position3) {
    locatedAt.value = position3.timestamp;
    coords.value = position3.coords;
    error2.value = null;
  }
  __name(updatePosition, "updatePosition");
  let watcher;
  function resume() {
    if (isSupported2.value) {
      watcher = navigator2.geolocation.watchPosition(
        updatePosition,
        (err) => error2.value = err,
        {
          enableHighAccuracy,
          maximumAge,
          timeout
        }
      );
    }
  }
  __name(resume, "resume");
  if (immediate)
    resume();
  function pause() {
    if (watcher && navigator2)
      navigator2.geolocation.clearWatch(watcher);
  }
  __name(pause, "pause");
  tryOnScopeDispose(() => {
    pause();
  });
  return {
    isSupported: isSupported2,
    coords,
    locatedAt,
    error: error2,
    resume,
    pause
  };
}
__name(useGeolocation, "useGeolocation");
const defaultEvents$1 = ["mousemove", "mousedown", "resize", "keydown", "touchstart", "wheel"];
const oneMinute = 6e4;
function useIdle(timeout = oneMinute, options4 = {}) {
  const {
    initialState = false,
    listenForVisibilityChange = true,
    events: events2 = defaultEvents$1,
    window: window2 = defaultWindow,
    eventFilter = throttleFilter(50)
  } = options4;
  const idle = ref(initialState);
  const lastActive = ref(timestamp());
  let timer;
  const reset2 = /* @__PURE__ */ __name(() => {
    idle.value = false;
    clearTimeout(timer);
    timer = setTimeout(() => idle.value = true, timeout);
  }, "reset");
  const onEvent = createFilterWrapper(
    eventFilter,
    () => {
      lastActive.value = timestamp();
      reset2();
    }
  );
  if (window2) {
    const document2 = window2.document;
    for (const event of events2)
      useEventListener(window2, event, onEvent, { passive: true });
    if (listenForVisibilityChange) {
      useEventListener(document2, "visibilitychange", () => {
        if (!document2.hidden)
          onEvent();
      });
    }
    reset2();
  }
  return {
    idle,
    lastActive,
    reset: reset2
  };
}
__name(useIdle, "useIdle");
async function loadImage(options4) {
  return new Promise((resolve2, reject3) => {
    const img = new Image();
    const { src, srcset, sizes, class: clazz, loading: loading2, crossorigin, referrerPolicy } = options4;
    img.src = src;
    if (srcset)
      img.srcset = srcset;
    if (sizes)
      img.sizes = sizes;
    if (clazz)
      img.className = clazz;
    if (loading2)
      img.loading = loading2;
    if (crossorigin)
      img.crossOrigin = crossorigin;
    if (referrerPolicy)
      img.referrerPolicy = referrerPolicy;
    img.onload = () => resolve2(img);
    img.onerror = reject3;
  });
}
__name(loadImage, "loadImage");
function useImage(options4, asyncStateOptions = {}) {
  const state = useAsyncState(
    () => loadImage(toValue(options4)),
    void 0,
    {
      resetOnExecute: true,
      ...asyncStateOptions
    }
  );
  watch(
    () => toValue(options4),
    () => state.execute(asyncStateOptions.delay),
    { deep: true }
  );
  return state;
}
__name(useImage, "useImage");
const ARRIVED_STATE_THRESHOLD_PIXELS = 1;
function useScroll(element, options4 = {}) {
  const {
    throttle: throttle2 = 0,
    idle = 200,
    onStop = noop$1,
    onScroll: onScroll4 = noop$1,
    offset = {
      left: 0,
      right: 0,
      top: 0,
      bottom: 0
    },
    eventListenerOptions = {
      capture: false,
      passive: true
    },
    behavior = "auto",
    window: window2 = defaultWindow,
    onError = /* @__PURE__ */ __name((e2) => {
      console.error(e2);
    }, "onError")
  } = options4;
  const internalX = ref(0);
  const internalY = ref(0);
  const x2 = computed({
    get() {
      return internalX.value;
    },
    set(x22) {
      scrollTo22(x22, void 0);
    }
  });
  const y2 = computed({
    get() {
      return internalY.value;
    },
    set(y22) {
      scrollTo22(void 0, y22);
    }
  });
  function scrollTo22(_x, _y) {
    var _a2, _b, _c, _d;
    if (!window2)
      return;
    const _element = toValue(element);
    if (!_element)
      return;
    (_c = _element instanceof Document ? window2.document.body : _element) == null ? void 0 : _c.scrollTo({
      top: (_a2 = toValue(_y)) != null ? _a2 : y2.value,
      left: (_b = toValue(_x)) != null ? _b : x2.value,
      behavior: toValue(behavior)
    });
    const scrollContainer = ((_d = _element == null ? void 0 : _element.document) == null ? void 0 : _d.documentElement) || (_element == null ? void 0 : _element.documentElement) || _element;
    if (x2 != null)
      internalX.value = scrollContainer.scrollLeft;
    if (y2 != null)
      internalY.value = scrollContainer.scrollTop;
  }
  __name(scrollTo22, "scrollTo2");
  const isScrolling = ref(false);
  const arrivedState = reactive({
    left: true,
    right: false,
    top: true,
    bottom: false
  });
  const directions = reactive({
    left: false,
    right: false,
    top: false,
    bottom: false
  });
  const onScrollEnd = /* @__PURE__ */ __name((e2) => {
    if (!isScrolling.value)
      return;
    isScrolling.value = false;
    directions.left = false;
    directions.right = false;
    directions.top = false;
    directions.bottom = false;
    onStop(e2);
  }, "onScrollEnd");
  const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle2 + idle);
  const setArrivedState = /* @__PURE__ */ __name((target) => {
    var _a2;
    if (!window2)
      return;
    const el = ((_a2 = target == null ? void 0 : target.document) == null ? void 0 : _a2.documentElement) || (target == null ? void 0 : target.documentElement) || unrefElement(target);
    const { display, flexDirection } = getComputedStyle(el);
    const scrollLeft = el.scrollLeft;
    directions.left = scrollLeft < internalX.value;
    directions.right = scrollLeft > internalX.value;
    const left = Math.abs(scrollLeft) <= (offset.left || 0);
    const right = Math.abs(scrollLeft) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
    if (display === "flex" && flexDirection === "row-reverse") {
      arrivedState.left = right;
      arrivedState.right = left;
    } else {
      arrivedState.left = left;
      arrivedState.right = right;
    }
    internalX.value = scrollLeft;
    let scrollTop2 = el.scrollTop;
    if (target === window2.document && !scrollTop2)
      scrollTop2 = window2.document.body.scrollTop;
    directions.top = scrollTop2 < internalY.value;
    directions.bottom = scrollTop2 > internalY.value;
    const top = Math.abs(scrollTop2) <= (offset.top || 0);
    const bottom = Math.abs(scrollTop2) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
    if (display === "flex" && flexDirection === "column-reverse") {
      arrivedState.top = bottom;
      arrivedState.bottom = top;
    } else {
      arrivedState.top = top;
      arrivedState.bottom = bottom;
    }
    internalY.value = scrollTop2;
  }, "setArrivedState");
  const onScrollHandler = /* @__PURE__ */ __name((e2) => {
    var _a2;
    if (!window2)
      return;
    const eventTarget = (_a2 = e2.target.documentElement) != null ? _a2 : e2.target;
    setArrivedState(eventTarget);
    isScrolling.value = true;
    onScrollEndDebounced(e2);
    onScroll4(e2);
  }, "onScrollHandler");
  useEventListener(
    element,
    "scroll",
    throttle2 ? useThrottleFn(onScrollHandler, throttle2, true, false) : onScrollHandler,
    eventListenerOptions
  );
  tryOnMounted(() => {
    try {
      const _element = toValue(element);
      if (!_element)
        return;
      setArrivedState(_element);
    } catch (e2) {
      onError(e2);
    }
  });
  useEventListener(
    element,
    "scrollend",
    onScrollEnd,
    eventListenerOptions
  );
  return {
    x: x2,
    y: y2,
    isScrolling,
    arrivedState,
    directions,
    measure() {
      const _element = toValue(element);
      if (window2 && _element)
        setArrivedState(_element);
    }
  };
}
__name(useScroll, "useScroll");
function resolveElement(el) {
  if (typeof Window !== "undefined" && el instanceof Window)
    return el.document.documentElement;
  if (typeof Document !== "undefined" && el instanceof Document)
    return el.documentElement;
  return el;
}
__name(resolveElement, "resolveElement");
function useInfiniteScroll(element, onLoadMore, options4 = {}) {
  var _a2;
  const {
    direction = "bottom",
    interval = 100,
    canLoadMore = /* @__PURE__ */ __name(() => true, "canLoadMore")
  } = options4;
  const state = reactive(useScroll(
    element,
    {
      ...options4,
      offset: {
        [direction]: (_a2 = options4.distance) != null ? _a2 : 0,
        ...options4.offset
      }
    }
  ));
  const promise = ref();
  const isLoading = computed(() => !!promise.value);
  const observedElement = computed(() => {
    return resolveElement(toValue(element));
  });
  const isElementVisible = useElementVisibility(observedElement);
  function checkAndLoad() {
    state.measure();
    if (!observedElement.value || !isElementVisible.value || !canLoadMore(observedElement.value))
      return;
    const { scrollHeight: scrollHeight2, clientHeight, scrollWidth: scrollWidth2, clientWidth } = observedElement.value;
    const isNarrower = direction === "bottom" || direction === "top" ? scrollHeight2 <= clientHeight : scrollWidth2 <= clientWidth;
    if (state.arrivedState[direction] || isNarrower) {
      if (!promise.value) {
        promise.value = Promise.all([
          onLoadMore(state),
          new Promise((resolve2) => setTimeout(resolve2, interval))
        ]).finally(() => {
          promise.value = null;
          nextTick(() => checkAndLoad());
        });
      }
    }
  }
  __name(checkAndLoad, "checkAndLoad");
  watch(
    () => [state.arrivedState[direction], isElementVisible.value],
    checkAndLoad,
    { immediate: true }
  );
  return {
    isLoading,
    reset() {
      nextTick(() => checkAndLoad());
    }
  };
}
__name(useInfiniteScroll, "useInfiniteScroll");
const defaultEvents = ["mousedown", "mouseup", "keydown", "keyup"];
function useKeyModifier(modifier, options4 = {}) {
  const {
    events: events2 = defaultEvents,
    document: document2 = defaultDocument,
    initial = null
  } = options4;
  const state = ref(initial);
  if (document2) {
    events2.forEach((listenerEvent) => {
      useEventListener(document2, listenerEvent, (evt) => {
        if (typeof evt.getModifierState === "function")
          state.value = evt.getModifierState(modifier);
      });
    });
  }
  return state;
}
__name(useKeyModifier, "useKeyModifier");
function useLocalStorage(key, initialValue, options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  return useStorage(key, initialValue, window2 == null ? void 0 : window2.localStorage, options4);
}
__name(useLocalStorage, "useLocalStorage");
const DefaultMagicKeysAliasMap = {
  ctrl: "control",
  command: "meta",
  cmd: "meta",
  option: "alt",
  up: "arrowup",
  down: "arrowdown",
  left: "arrowleft",
  right: "arrowright"
};
function useMagicKeys(options4 = {}) {
  const {
    reactive: useReactive = false,
    target = defaultWindow,
    aliasMap = DefaultMagicKeysAliasMap,
    passive = true,
    onEventFired = noop$1
  } = options4;
  const current = reactive(/* @__PURE__ */ new Set());
  const obj = {
    toJSON() {
      return {};
    },
    current
  };
  const refs = useReactive ? reactive(obj) : obj;
  const metaDeps = /* @__PURE__ */ new Set();
  const usedKeys = /* @__PURE__ */ new Set();
  function setRefs(key, value4) {
    if (key in refs) {
      if (useReactive)
        refs[key] = value4;
      else
        refs[key].value = value4;
    }
  }
  __name(setRefs, "setRefs");
  function reset2() {
    current.clear();
    for (const key of usedKeys)
      setRefs(key, false);
  }
  __name(reset2, "reset");
  function updateRefs(e2, value4) {
    var _a2, _b;
    const key = (_a2 = e2.key) == null ? void 0 : _a2.toLowerCase();
    const code2 = (_b = e2.code) == null ? void 0 : _b.toLowerCase();
    const values = [code2, key].filter(Boolean);
    if (key) {
      if (value4)
        current.add(key);
      else
        current.delete(key);
    }
    for (const key2 of values) {
      usedKeys.add(key2);
      setRefs(key2, value4);
    }
    if (key === "meta" && !value4) {
      metaDeps.forEach((key2) => {
        current.delete(key2);
        setRefs(key2, false);
      });
      metaDeps.clear();
    } else if (typeof e2.getModifierState === "function" && e2.getModifierState("Meta") && value4) {
      [...current, ...values].forEach((key2) => metaDeps.add(key2));
    }
  }
  __name(updateRefs, "updateRefs");
  useEventListener(target, "keydown", (e2) => {
    updateRefs(e2, true);
    return onEventFired(e2);
  }, { passive });
  useEventListener(target, "keyup", (e2) => {
    updateRefs(e2, false);
    return onEventFired(e2);
  }, { passive });
  useEventListener("blur", reset2, { passive: true });
  useEventListener("focus", reset2, { passive: true });
  const proxy = new Proxy(
    refs,
    {
      get(target2, prop2, rec) {
        if (typeof prop2 !== "string")
          return Reflect.get(target2, prop2, rec);
        prop2 = prop2.toLowerCase();
        if (prop2 in aliasMap)
          prop2 = aliasMap[prop2];
        if (!(prop2 in refs)) {
          if (/[+_-]/.test(prop2)) {
            const keys2 = prop2.split(/[+_-]/g).map((i2) => i2.trim());
            refs[prop2] = computed(() => keys2.every((key) => toValue(proxy[key])));
          } else {
            refs[prop2] = ref(false);
          }
        }
        const r = Reflect.get(target2, prop2, rec);
        return useReactive ? toValue(r) : r;
      }
    }
  );
  return proxy;
}
__name(useMagicKeys, "useMagicKeys");
function usingElRef(source, cb) {
  if (toValue(source))
    cb(toValue(source));
}
__name(usingElRef, "usingElRef");
function timeRangeToArray(timeRanges) {
  let ranges = [];
  for (let i2 = 0; i2 < timeRanges.length; ++i2)
    ranges = [...ranges, [timeRanges.start(i2), timeRanges.end(i2)]];
  return ranges;
}
__name(timeRangeToArray, "timeRangeToArray");
function tracksToArray(tracks) {
  return Array.from(tracks).map(({ label: label5, kind, language, mode: mode2, activeCues, cues, inBandMetadataTrackDispatchType }, id3) => ({ id: id3, label: label5, kind, language, mode: mode2, activeCues, cues, inBandMetadataTrackDispatchType }));
}
__name(tracksToArray, "tracksToArray");
const defaultOptions$1 = {
  src: "",
  tracks: []
};
function useMediaControls(target, options4 = {}) {
  target = toRef(target);
  options4 = {
    ...defaultOptions$1,
    ...options4
  };
  const {
    document: document2 = defaultDocument
  } = options4;
  const currentTime = ref(0);
  const duration = ref(0);
  const seeking = ref(false);
  const volume = ref(1);
  const waiting = ref(false);
  const ended = ref(false);
  const playing = ref(false);
  const rate = ref(1);
  const stalled = ref(false);
  const buffered = ref([]);
  const tracks = ref([]);
  const selectedTrack = ref(-1);
  const isPictureInPicture = ref(false);
  const muted = ref(false);
  const supportsPictureInPicture = document2 && "pictureInPictureEnabled" in document2;
  const sourceErrorEvent = createEventHook();
  const disableTrack = /* @__PURE__ */ __name((track2) => {
    usingElRef(target, (el) => {
      if (track2) {
        const id3 = typeof track2 === "number" ? track2 : track2.id;
        el.textTracks[id3].mode = "disabled";
      } else {
        for (let i2 = 0; i2 < el.textTracks.length; ++i2)
          el.textTracks[i2].mode = "disabled";
      }
      selectedTrack.value = -1;
    });
  }, "disableTrack");
  const enableTrack = /* @__PURE__ */ __name((track2, disableTracks = true) => {
    usingElRef(target, (el) => {
      const id3 = typeof track2 === "number" ? track2 : track2.id;
      if (disableTracks)
        disableTrack();
      el.textTracks[id3].mode = "showing";
      selectedTrack.value = id3;
    });
  }, "enableTrack");
  const togglePictureInPicture = /* @__PURE__ */ __name(() => {
    return new Promise((resolve2, reject3) => {
      usingElRef(target, async (el) => {
        if (supportsPictureInPicture) {
          if (!isPictureInPicture.value) {
            el.requestPictureInPicture().then(resolve2).catch(reject3);
          } else {
            document2.exitPictureInPicture().then(resolve2).catch(reject3);
          }
        }
      });
    });
  }, "togglePictureInPicture");
  watchEffect(() => {
    if (!document2)
      return;
    const el = toValue(target);
    if (!el)
      return;
    const src = toValue(options4.src);
    let sources = [];
    if (!src)
      return;
    if (typeof src === "string")
      sources = [{ src }];
    else if (Array.isArray(src))
      sources = src;
    else if (isObject$4(src))
      sources = [src];
    el.querySelectorAll("source").forEach((e2) => {
      e2.removeEventListener("error", sourceErrorEvent.trigger);
      e2.remove();
    });
    sources.forEach(({ src: src2, type }) => {
      const source = document2.createElement("source");
      source.setAttribute("src", src2);
      source.setAttribute("type", type || "");
      source.addEventListener("error", sourceErrorEvent.trigger);
      el.appendChild(source);
    });
    el.load();
  });
  tryOnScopeDispose(() => {
    const el = toValue(target);
    if (!el)
      return;
    el.querySelectorAll("source").forEach((e2) => e2.removeEventListener("error", sourceErrorEvent.trigger));
  });
  watch([target, volume], () => {
    const el = toValue(target);
    if (!el)
      return;
    el.volume = volume.value;
  });
  watch([target, muted], () => {
    const el = toValue(target);
    if (!el)
      return;
    el.muted = muted.value;
  });
  watch([target, rate], () => {
    const el = toValue(target);
    if (!el)
      return;
    el.playbackRate = rate.value;
  });
  watchEffect(() => {
    if (!document2)
      return;
    const textTracks = toValue(options4.tracks);
    const el = toValue(target);
    if (!textTracks || !textTracks.length || !el)
      return;
    el.querySelectorAll("track").forEach((e2) => e2.remove());
    textTracks.forEach(({ default: isDefault, kind, label: label5, src, srcLang }, i2) => {
      const track2 = document2.createElement("track");
      track2.default = isDefault || false;
      track2.kind = kind;
      track2.label = label5;
      track2.src = src;
      track2.srclang = srcLang;
      if (track2.default)
        selectedTrack.value = i2;
      el.appendChild(track2);
    });
  });
  const { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {
    const el = toValue(target);
    if (!el)
      return;
    el.currentTime = time;
  });
  const { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {
    const el = toValue(target);
    if (!el)
      return;
    if (isPlaying)
      el.play();
    else
      el.pause();
  });
  useEventListener(target, "timeupdate", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime));
  useEventListener(target, "durationchange", () => duration.value = toValue(target).duration);
  useEventListener(target, "progress", () => buffered.value = timeRangeToArray(toValue(target).buffered));
  useEventListener(target, "seeking", () => seeking.value = true);
  useEventListener(target, "seeked", () => seeking.value = false);
  useEventListener(target, ["waiting", "loadstart"], () => {
    waiting.value = true;
    ignorePlayingUpdates(() => playing.value = false);
  });
  useEventListener(target, "loadeddata", () => waiting.value = false);
  useEventListener(target, "playing", () => {
    waiting.value = false;
    ended.value = false;
    ignorePlayingUpdates(() => playing.value = true);
  });
  useEventListener(target, "ratechange", () => rate.value = toValue(target).playbackRate);
  useEventListener(target, "stalled", () => stalled.value = true);
  useEventListener(target, "ended", () => ended.value = true);
  useEventListener(target, "pause", () => ignorePlayingUpdates(() => playing.value = false));
  useEventListener(target, "play", () => ignorePlayingUpdates(() => playing.value = true));
  useEventListener(target, "enterpictureinpicture", () => isPictureInPicture.value = true);
  useEventListener(target, "leavepictureinpicture", () => isPictureInPicture.value = false);
  useEventListener(target, "volumechange", () => {
    const el = toValue(target);
    if (!el)
      return;
    volume.value = el.volume;
    muted.value = el.muted;
  });
  const listeners = [];
  const stop2 = watch([target], () => {
    const el = toValue(target);
    if (!el)
      return;
    stop2();
    listeners[0] = useEventListener(el.textTracks, "addtrack", () => tracks.value = tracksToArray(el.textTracks));
    listeners[1] = useEventListener(el.textTracks, "removetrack", () => tracks.value = tracksToArray(el.textTracks));
    listeners[2] = useEventListener(el.textTracks, "change", () => tracks.value = tracksToArray(el.textTracks));
  });
  tryOnScopeDispose(() => listeners.forEach((listener) => listener()));
  return {
    currentTime,
    duration,
    waiting,
    seeking,
    ended,
    stalled,
    buffered,
    playing,
    rate,
    // Volume
    volume,
    muted,
    // Tracks
    tracks,
    selectedTrack,
    enableTrack,
    disableTrack,
    // Picture in Picture
    supportsPictureInPicture,
    togglePictureInPicture,
    isPictureInPicture,
    // Events
    onSourceError: sourceErrorEvent.on
  };
}
__name(useMediaControls, "useMediaControls");
function getMapVue2Compat() {
  const data24 = shallowReactive({});
  return {
    get: /* @__PURE__ */ __name((key) => data24[key], "get"),
    set: /* @__PURE__ */ __name((key, value4) => set(data24, key, value4), "set"),
    has: /* @__PURE__ */ __name((key) => hasOwn$2(data24, key), "has"),
    delete: /* @__PURE__ */ __name((key) => del$1(data24, key), "delete"),
    clear: /* @__PURE__ */ __name(() => {
      Object.keys(data24).forEach((key) => {
        del$1(data24, key);
      });
    }, "clear")
  };
}
__name(getMapVue2Compat, "getMapVue2Compat");
function useMemoize(resolver, options4) {
  const initCache = /* @__PURE__ */ __name(() => {
    if (options4 == null ? void 0 : options4.cache)
      return shallowReactive(options4.cache);
    if (isVue2)
      return getMapVue2Compat();
    return shallowReactive(/* @__PURE__ */ new Map());
  }, "initCache");
  const cache2 = initCache();
  const generateKey = /* @__PURE__ */ __name((...args) => (options4 == null ? void 0 : options4.getKey) ? options4.getKey(...args) : JSON.stringify(args), "generateKey");
  const _loadData = /* @__PURE__ */ __name((key, ...args) => {
    cache2.set(key, resolver(...args));
    return cache2.get(key);
  }, "_loadData");
  const loadData = /* @__PURE__ */ __name((...args) => _loadData(generateKey(...args), ...args), "loadData");
  const deleteData = /* @__PURE__ */ __name((...args) => {
    cache2.delete(generateKey(...args));
  }, "deleteData");
  const clearData = /* @__PURE__ */ __name(() => {
    cache2.clear();
  }, "clearData");
  const memoized = /* @__PURE__ */ __name((...args) => {
    const key = generateKey(...args);
    if (cache2.has(key))
      return cache2.get(key);
    return _loadData(key, ...args);
  }, "memoized");
  memoized.load = loadData;
  memoized.delete = deleteData;
  memoized.clear = clearData;
  memoized.generateKey = generateKey;
  memoized.cache = cache2;
  return memoized;
}
__name(useMemoize, "useMemoize");
function useMemory(options4 = {}) {
  const memory = ref();
  const isSupported2 = useSupported(() => typeof performance !== "undefined" && "memory" in performance);
  if (isSupported2.value) {
    const { interval = 1e3 } = options4;
    useIntervalFn(() => {
      memory.value = performance.memory;
    }, interval, { immediate: options4.immediate, immediateCallback: options4.immediateCallback });
  }
  return { isSupported: isSupported2, memory };
}
__name(useMemory, "useMemory");
const UseMouseBuiltinExtractors = {
  page: /* @__PURE__ */ __name((event) => [event.pageX, event.pageY], "page"),
  client: /* @__PURE__ */ __name((event) => [event.clientX, event.clientY], "client"),
  screen: /* @__PURE__ */ __name((event) => [event.screenX, event.screenY], "screen"),
  movement: /* @__PURE__ */ __name((event) => event instanceof Touch ? null : [event.movementX, event.movementY], "movement")
};
function useMouse(options4 = {}) {
  const {
    type = "page",
    touch = true,
    resetOnTouchEnds = false,
    initialValue = { x: 0, y: 0 },
    window: window2 = defaultWindow,
    target = window2,
    scroll = true,
    eventFilter
  } = options4;
  let _prevMouseEvent = null;
  const x2 = ref(initialValue.x);
  const y2 = ref(initialValue.y);
  const sourceType = ref(null);
  const extractor = typeof type === "function" ? type : UseMouseBuiltinExtractors[type];
  const mouseHandler = /* @__PURE__ */ __name((event) => {
    const result = extractor(event);
    _prevMouseEvent = event;
    if (result) {
      [x2.value, y2.value] = result;
      sourceType.value = "mouse";
    }
  }, "mouseHandler");
  const touchHandler = /* @__PURE__ */ __name((event) => {
    if (event.touches.length > 0) {
      const result = extractor(event.touches[0]);
      if (result) {
        [x2.value, y2.value] = result;
        sourceType.value = "touch";
      }
    }
  }, "touchHandler");
  const scrollHandler = /* @__PURE__ */ __name(() => {
    if (!_prevMouseEvent || !window2)
      return;
    const pos2 = extractor(_prevMouseEvent);
    if (_prevMouseEvent instanceof MouseEvent && pos2) {
      x2.value = pos2[0] + window2.scrollX;
      y2.value = pos2[1] + window2.scrollY;
    }
  }, "scrollHandler");
  const reset2 = /* @__PURE__ */ __name(() => {
    x2.value = initialValue.x;
    y2.value = initialValue.y;
  }, "reset");
  const mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);
  const touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);
  const scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();
  if (target) {
    const listenerOptions = { passive: true };
    useEventListener(target, ["mousemove", "dragover"], mouseHandlerWrapper, listenerOptions);
    if (touch && type !== "movement") {
      useEventListener(target, ["touchstart", "touchmove"], touchHandlerWrapper, listenerOptions);
      if (resetOnTouchEnds)
        useEventListener(target, "touchend", reset2, listenerOptions);
    }
    if (scroll && type === "page")
      useEventListener(window2, "scroll", scrollHandlerWrapper, { passive: true });
  }
  return {
    x: x2,
    y: y2,
    sourceType
  };
}
__name(useMouse, "useMouse");
function useMouseInElement(target, options4 = {}) {
  const {
    handleOutside = true,
    window: window2 = defaultWindow
  } = options4;
  const type = options4.type || "page";
  const { x: x2, y: y2, sourceType } = useMouse(options4);
  const targetRef = ref(target != null ? target : window2 == null ? void 0 : window2.document.body);
  const elementX = ref(0);
  const elementY = ref(0);
  const elementPositionX = ref(0);
  const elementPositionY = ref(0);
  const elementHeight = ref(0);
  const elementWidth = ref(0);
  const isOutside = ref(true);
  let stop2 = /* @__PURE__ */ __name(() => {
  }, "stop");
  if (window2) {
    stop2 = watch(
      [targetRef, x2, y2],
      () => {
        const el = unrefElement(targetRef);
        if (!el || !(el instanceof HTMLElement))
          return;
        const {
          left,
          top,
          width: width2,
          height
        } = el.getBoundingClientRect();
        elementPositionX.value = left + (type === "page" ? window2.pageXOffset : 0);
        elementPositionY.value = top + (type === "page" ? window2.pageYOffset : 0);
        elementHeight.value = height;
        elementWidth.value = width2;
        const elX = x2.value - elementPositionX.value;
        const elY = y2.value - elementPositionY.value;
        isOutside.value = width2 === 0 || height === 0 || elX < 0 || elY < 0 || elX > width2 || elY > height;
        if (handleOutside || !isOutside.value) {
          elementX.value = elX;
          elementY.value = elY;
        }
      },
      { immediate: true }
    );
    useEventListener(document, "mouseleave", () => {
      isOutside.value = true;
    });
  }
  return {
    x: x2,
    y: y2,
    sourceType,
    elementX,
    elementY,
    elementPositionX,
    elementPositionY,
    elementHeight,
    elementWidth,
    isOutside,
    stop: stop2
  };
}
__name(useMouseInElement, "useMouseInElement");
function useMousePressed(options4 = {}) {
  const {
    touch = true,
    drag = true,
    capture = false,
    initialValue = false,
    window: window2 = defaultWindow
  } = options4;
  const pressed = ref(initialValue);
  const sourceType = ref(null);
  if (!window2) {
    return {
      pressed,
      sourceType
    };
  }
  const onPressed = /* @__PURE__ */ __name((srcType) => () => {
    pressed.value = true;
    sourceType.value = srcType;
  }, "onPressed");
  const onReleased = /* @__PURE__ */ __name(() => {
    pressed.value = false;
    sourceType.value = null;
  }, "onReleased");
  const target = computed(() => unrefElement(options4.target) || window2);
  useEventListener(target, "mousedown", onPressed("mouse"), { passive: true, capture });
  useEventListener(window2, "mouseleave", onReleased, { passive: true, capture });
  useEventListener(window2, "mouseup", onReleased, { passive: true, capture });
  if (drag) {
    useEventListener(target, "dragstart", onPressed("mouse"), { passive: true, capture });
    useEventListener(window2, "drop", onReleased, { passive: true, capture });
    useEventListener(window2, "dragend", onReleased, { passive: true, capture });
  }
  if (touch) {
    useEventListener(target, "touchstart", onPressed("touch"), { passive: true, capture });
    useEventListener(window2, "touchend", onReleased, { passive: true, capture });
    useEventListener(window2, "touchcancel", onReleased, { passive: true, capture });
  }
  return {
    pressed,
    sourceType
  };
}
__name(useMousePressed, "useMousePressed");
function useNavigatorLanguage(options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  const navigator2 = window2 == null ? void 0 : window2.navigator;
  const isSupported2 = useSupported(() => navigator2 && "language" in navigator2);
  const language = ref(navigator2 == null ? void 0 : navigator2.language);
  useEventListener(window2, "languagechange", () => {
    if (navigator2)
      language.value = navigator2.language;
  });
  return {
    isSupported: isSupported2,
    language
  };
}
__name(useNavigatorLanguage, "useNavigatorLanguage");
function useNetwork(options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  const navigator2 = window2 == null ? void 0 : window2.navigator;
  const isSupported2 = useSupported(() => navigator2 && "connection" in navigator2);
  const isOnline = ref(true);
  const saveData = ref(false);
  const offlineAt = ref(void 0);
  const onlineAt = ref(void 0);
  const downlink = ref(void 0);
  const downlinkMax = ref(void 0);
  const rtt = ref(void 0);
  const effectiveType = ref(void 0);
  const type = ref("unknown");
  const connection = isSupported2.value && navigator2.connection;
  function updateNetworkInformation() {
    if (!navigator2)
      return;
    isOnline.value = navigator2.onLine;
    offlineAt.value = isOnline.value ? void 0 : Date.now();
    onlineAt.value = isOnline.value ? Date.now() : void 0;
    if (connection) {
      downlink.value = connection.downlink;
      downlinkMax.value = connection.downlinkMax;
      effectiveType.value = connection.effectiveType;
      rtt.value = connection.rtt;
      saveData.value = connection.saveData;
      type.value = connection.type;
    }
  }
  __name(updateNetworkInformation, "updateNetworkInformation");
  if (window2) {
    useEventListener(window2, "offline", () => {
      isOnline.value = false;
      offlineAt.value = Date.now();
    });
    useEventListener(window2, "online", () => {
      isOnline.value = true;
      onlineAt.value = Date.now();
    });
  }
  if (connection)
    useEventListener(connection, "change", updateNetworkInformation, false);
  updateNetworkInformation();
  return {
    isSupported: isSupported2,
    isOnline,
    saveData,
    offlineAt,
    onlineAt,
    downlink,
    downlinkMax,
    effectiveType,
    rtt,
    type
  };
}
__name(useNetwork, "useNetwork");
function useNow(options4 = {}) {
  const {
    controls: exposeControls = false,
    interval = "requestAnimationFrame"
  } = options4;
  const now2 = ref(/* @__PURE__ */ new Date());
  const update = /* @__PURE__ */ __name(() => now2.value = /* @__PURE__ */ new Date(), "update");
  const controls = interval === "requestAnimationFrame" ? useRafFn(update, { immediate: true }) : useIntervalFn(update, interval, { immediate: true });
  if (exposeControls) {
    return {
      now: now2,
      ...controls
    };
  } else {
    return now2;
  }
}
__name(useNow, "useNow");
function useObjectUrl(object) {
  const url = ref();
  const release = /* @__PURE__ */ __name(() => {
    if (url.value)
      URL.revokeObjectURL(url.value);
    url.value = void 0;
  }, "release");
  watch(
    () => toValue(object),
    (newObject) => {
      release();
      if (newObject)
        url.value = URL.createObjectURL(newObject);
    },
    { immediate: true }
  );
  tryOnScopeDispose(release);
  return readonly(url);
}
__name(useObjectUrl, "useObjectUrl");
function useClamp(value4, min, max) {
  if (typeof value4 === "function" || isReadonly(value4))
    return computed(() => clamp(toValue(value4), toValue(min), toValue(max)));
  const _value = ref(value4);
  return computed({
    get() {
      return _value.value = clamp(_value.value, toValue(min), toValue(max));
    },
    set(value22) {
      _value.value = clamp(value22, toValue(min), toValue(max));
    }
  });
}
__name(useClamp, "useClamp");
function useOffsetPagination(options4) {
  const {
    total = Number.POSITIVE_INFINITY,
    pageSize = 10,
    page: page2 = 1,
    onPageChange = noop$1,
    onPageSizeChange = noop$1,
    onPageCountChange = noop$1
  } = options4;
  const currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);
  const pageCount = computed(() => Math.max(
    1,
    Math.ceil(toValue(total) / toValue(currentPageSize))
  ));
  const currentPage = useClamp(page2, 1, pageCount);
  const isFirstPage = computed(() => currentPage.value === 1);
  const isLastPage = computed(() => currentPage.value === pageCount.value);
  if (isRef(page2)) {
    syncRef(page2, currentPage, {
      direction: isReadonly(page2) ? "ltr" : "both"
    });
  }
  if (isRef(pageSize)) {
    syncRef(pageSize, currentPageSize, {
      direction: isReadonly(pageSize) ? "ltr" : "both"
    });
  }
  function prev2() {
    currentPage.value--;
  }
  __name(prev2, "prev");
  function next2() {
    currentPage.value++;
  }
  __name(next2, "next");
  const returnValue = {
    currentPage,
    currentPageSize,
    pageCount,
    isFirstPage,
    isLastPage,
    prev: prev2,
    next: next2
  };
  watch(currentPage, () => {
    onPageChange(reactive(returnValue));
  });
  watch(currentPageSize, () => {
    onPageSizeChange(reactive(returnValue));
  });
  watch(pageCount, () => {
    onPageCountChange(reactive(returnValue));
  });
  return returnValue;
}
__name(useOffsetPagination, "useOffsetPagination");
function useOnline(options4 = {}) {
  const { isOnline } = useNetwork(options4);
  return isOnline;
}
__name(useOnline, "useOnline");
function usePageLeave(options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  const isLeft = ref(false);
  const handler6 = /* @__PURE__ */ __name((event) => {
    if (!window2)
      return;
    event = event || window2.event;
    const from2 = event.relatedTarget || event.toElement;
    isLeft.value = !from2;
  }, "handler");
  if (window2) {
    useEventListener(window2, "mouseout", handler6, { passive: true });
    useEventListener(window2.document, "mouseleave", handler6, { passive: true });
    useEventListener(window2.document, "mouseenter", handler6, { passive: true });
  }
  return isLeft;
}
__name(usePageLeave, "usePageLeave");
function useScreenOrientation(options4 = {}) {
  const {
    window: window2 = defaultWindow
  } = options4;
  const isSupported2 = useSupported(() => window2 && "screen" in window2 && "orientation" in window2.screen);
  const screenOrientation = isSupported2.value ? window2.screen.orientation : {};
  const orientation2 = ref(screenOrientation.type);
  const angle = ref(screenOrientation.angle || 0);
  if (isSupported2.value) {
    useEventListener(window2, "orientationchange", () => {
      orientation2.value = screenOrientation.type;
      angle.value = screenOrientation.angle;
    });
  }
  const lockOrientation = /* @__PURE__ */ __name((type) => {
    if (isSupported2.value && typeof screenOrientation.lock === "function")
      return screenOrientation.lock(type);
    return Promise.reject(new Error("Not supported"));
  }, "lockOrientation");
  const unlockOrientation = /* @__PURE__ */ __name(() => {
    if (isSupported2.value && typeof screenOrientation.unlock === "function")
      screenOrientation.unlock();
  }, "unlockOrientation");
  return {
    isSupported: isSupported2,
    orientation: orientation2,
    angle,
    lockOrientation,
    unlockOrientation
  };
}
__name(useScreenOrientation, "useScreenOrientation");
function useParallax(target, options4 = {}) {
  const {
    deviceOrientationTiltAdjust = /* @__PURE__ */ __name((i2) => i2, "deviceOrientationTiltAdjust"),
    deviceOrientationRollAdjust = /* @__PURE__ */ __name((i2) => i2, "deviceOrientationRollAdjust"),
    mouseTiltAdjust = /* @__PURE__ */ __name((i2) => i2, "mouseTiltAdjust"),
    mouseRollAdjust = /* @__PURE__ */ __name((i2) => i2, "mouseRollAdjust"),
    window: window2 = defaultWindow
  } = options4;
  const orientation2 = reactive(useDeviceOrientation({ window: window2 }));
  const screenOrientation = reactive(useScreenOrientation({ window: window2 }));
  const {
    elementX: x2,
    elementY: y2,
    elementWidth: width2,
    elementHeight: height
  } = useMouseInElement(target, { handleOutside: false, window: window2 });
  const source = computed(() => {
    if (orientation2.isSupported && (orientation2.alpha != null && orientation2.alpha !== 0 || orientation2.gamma != null && orientation2.gamma !== 0)) {
      return "deviceOrientation";
    }
    return "mouse";
  });
  const roll = computed(() => {
    if (source.value === "deviceOrientation") {
      let value4;
      switch (screenOrientation.orientation) {
        case "landscape-primary":
          value4 = orientation2.gamma / 90;
          break;
        case "landscape-secondary":
          value4 = -orientation2.gamma / 90;
          break;
        case "portrait-primary":
          value4 = -orientation2.beta / 90;
          break;
        case "portrait-secondary":
          value4 = orientation2.beta / 90;
          break;
        default:
          value4 = -orientation2.beta / 90;
      }
      return deviceOrientationRollAdjust(value4);
    } else {
      const value4 = -(y2.value - height.value / 2) / height.value;
      return mouseRollAdjust(value4);
    }
  });
  const tilt = computed(() => {
    if (source.value === "deviceOrientation") {
      let value4;
      switch (screenOrientation.orientation) {
        case "landscape-primary":
          value4 = orientation2.beta / 90;
          break;
        case "landscape-secondary":
          value4 = -orientation2.beta / 90;
          break;
        case "portrait-primary":
          value4 = orientation2.gamma / 90;
          break;
        case "portrait-secondary":
          value4 = -orientation2.gamma / 90;
          break;
        default:
          value4 = orientation2.gamma / 90;
      }
      return deviceOrientationTiltAdjust(value4);
    } else {
      const value4 = (x2.value - width2.value / 2) / width2.value;
      return mouseTiltAdjust(value4);
    }
  });
  return { roll, tilt, source };
}
__name(useParallax, "useParallax");
function useParentElement(element = useCurrentElement()) {
  const parentElement = shallowRef();
  const update = /* @__PURE__ */ __name(() => {
    const el = unrefElement(element);
    if (el)
      parentElement.value = el.parentElement;
  }, "update");
  tryOnMounted(update);
  watch(() => toValue(element), update);
  return parentElement;
}
__name(useParentElement, "useParentElement");
function usePerformanceObserver(options4, callback) {
  const {
    window: window2 = defaultWindow,
    immediate = true,
    ...performanceOptions
  } = options4;
  const isSupported2 = useSupported(() => window2 && "PerformanceObserver" in window2);
  let observer;
  const stop2 = /* @__PURE__ */ __name(() => {
    observer == null ? void 0 : observer.disconnect();
  }, "stop");
  const start2 = /* @__PURE__ */ __name(() => {
    if (isSupported2.value) {
      stop2();
      observer = new PerformanceObserver(callback);
      observer.observe(performanceOptions);
    }
  }, "start");
  tryOnScopeDispose(stop2);
  if (immediate)
    start2();
  return {
    isSupported: isSupported2,
    start: start2,
    stop: stop2
  };
}
__name(usePerformanceObserver, "usePerformanceObserver");
const defaultState = {
  x: 0,
  y: 0,
  pointerId: 0,
  pressure: 0,
  tiltX: 0,
  tiltY: 0,
  width: 0,
  height: 0,
  twist: 0,
  pointerType: null
};
const keys$1 = /* @__PURE__ */ Object.keys(defaultState);
function usePointer(options4 = {}) {
  const {
    target = defaultWindow
  } = options4;
  const isInside = ref(false);
  const state = ref(options4.initialValue || {});
  Object.assign(state.value, defaultState, state.value);
  const handler6 = /* @__PURE__ */ __name((event) => {
    isInside.value = true;
    if (options4.pointerTypes && !options4.pointerTypes.includes(event.pointerType))
      return;
    state.value = objectPick(event, keys$1, false);
  }, "handler");
  if (target) {
    const listenerOptions = { passive: true };
    useEventListener(target, ["pointerdown", "pointermove", "pointerup"], handler6, listenerOptions);
    useEventListener(target, "pointerleave", () => isInside.value = false, listenerOptions);
  }
  return {
    ...toRefs(state),
    isInside
  };
}
__name(usePointer, "usePointer");
function usePointerLock(target, options4 = {}) {
  const { document: document2 = defaultDocument } = options4;
  const isSupported2 = useSupported(() => document2 && "pointerLockElement" in document2);
  const element = ref();
  const triggerElement = ref();
  let targetElement;
  if (isSupported2.value) {
    useEventListener(document2, "pointerlockchange", () => {
      var _a2;
      const currentElement = (_a2 = document2.pointerLockElement) != null ? _a2 : element.value;
      if (targetElement && currentElement === targetElement) {
        element.value = document2.pointerLockElement;
        if (!element.value)
          targetElement = triggerElement.value = null;
      }
    });
    useEventListener(document2, "pointerlockerror", () => {
      var _a2;
      const currentElement = (_a2 = document2.pointerLockElement) != null ? _a2 : element.value;
      if (targetElement && currentElement === targetElement) {
        const action = document2.pointerLockElement ? "release" : "acquire";
        throw new Error(`Failed to ${action} pointer lock.`);
      }
    });
  }
  async function lock(e2) {
    var _a2;
    if (!isSupported2.value)
      throw new Error("Pointer Lock API is not supported by your browser.");
    triggerElement.value = e2 instanceof Event ? e2.currentTarget : null;
    targetElement = e2 instanceof Event ? (_a2 = unrefElement(target)) != null ? _a2 : triggerElement.value : unrefElement(e2);
    if (!targetElement)
      throw new Error("Target element undefined.");
    targetElement.requestPointerLock();
    return await until(element).toBe(targetElement);
  }
  __name(lock, "lock");
  async function unlock() {
    if (!element.value)
      return false;
    document2.exitPointerLock();
    await until(element).toBeNull();
    return true;
  }
  __name(unlock, "unlock");
  return {
    isSupported: isSupported2,
    element,
    triggerElement,
    lock,
    unlock
  };
}
__name(usePointerLock, "usePointerLock");
function usePointerSwipe(target, options4 = {}) {
  const targetRef = toRef(target);
  const {
    threshold = 50,
    onSwipe,
    onSwipeEnd,
    onSwipeStart,
    disableTextSelect = false
  } = options4;
  const posStart = reactive({ x: 0, y: 0 });
  const updatePosStart = /* @__PURE__ */ __name((x2, y2) => {
    posStart.x = x2;
    posStart.y = y2;
  }, "updatePosStart");
  const posEnd = reactive({ x: 0, y: 0 });
  const updatePosEnd = /* @__PURE__ */ __name((x2, y2) => {
    posEnd.x = x2;
    posEnd.y = y2;
  }, "updatePosEnd");
  const distanceX = computed(() => posStart.x - posEnd.x);
  const distanceY = computed(() => posStart.y - posEnd.y);
  const { max, abs } = Math;
  const isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);
  const isSwiping = ref(false);
  const isPointerDown = ref(false);
  const direction = computed(() => {
    if (!isThresholdExceeded.value)
      return "none";
    if (abs(distanceX.value) > abs(distanceY.value)) {
      return distanceX.value > 0 ? "left" : "right";
    } else {
      return distanceY.value > 0 ? "up" : "down";
    }
  });
  const eventIsAllowed = /* @__PURE__ */ __name((e2) => {
    var _a2, _b, _c;
    const isReleasingButton = e2.buttons === 0;
    const isPrimaryButton = e2.buttons === 1;
    return (_c = (_b = (_a2 = options4.pointerTypes) == null ? void 0 : _a2.includes(e2.pointerType)) != null ? _b : isReleasingButton || isPrimaryButton) != null ? _c : true;
  }, "eventIsAllowed");
  const stops = [
    useEventListener(target, "pointerdown", (e2) => {
      if (!eventIsAllowed(e2))
        return;
      isPointerDown.value = true;
      const eventTarget = e2.target;
      eventTarget == null ? void 0 : eventTarget.setPointerCapture(e2.pointerId);
      const { clientX: x2, clientY: y2 } = e2;
      updatePosStart(x2, y2);
      updatePosEnd(x2, y2);
      onSwipeStart == null ? void 0 : onSwipeStart(e2);
    }),
    useEventListener(target, "pointermove", (e2) => {
      if (!eventIsAllowed(e2))
        return;
      if (!isPointerDown.value)
        return;
      const { clientX: x2, clientY: y2 } = e2;
      updatePosEnd(x2, y2);
      if (!isSwiping.value && isThresholdExceeded.value)
        isSwiping.value = true;
      if (isSwiping.value)
        onSwipe == null ? void 0 : onSwipe(e2);
    }),
    useEventListener(target, "pointerup", (e2) => {
      if (!eventIsAllowed(e2))
        return;
      if (isSwiping.value)
        onSwipeEnd == null ? void 0 : onSwipeEnd(e2, direction.value);
      isPointerDown.value = false;
      isSwiping.value = false;
    })
  ];
  tryOnMounted(() => {
    var _a2, _b, _c, _d, _e, _f, _g, _h;
    (_b = (_a2 = targetRef.value) == null ? void 0 : _a2.style) == null ? void 0 : _b.setProperty("touch-action", "none");
    if (disableTextSelect) {
      (_d = (_c = targetRef.value) == null ? void 0 : _c.style) == null ? void 0 : _d.setProperty("-webkit-user-select", "none");
      (_f = (_e = targetRef.value) == null ? void 0 : _e.style) == null ? void 0 : _f.setProperty("-ms-user-select", "none");
      (_h = (_g = targetRef.value) == null ? void 0 : _g.style) == null ? void 0 : _h.setProperty("user-select", "none");
    }
  });
  const stop2 = /* @__PURE__ */ __name(() => stops.forEach((s) => s()), "stop");
  return {
    isSwiping: readonly(isSwiping),
    direction: readonly(direction),
    posStart: readonly(posStart),
    posEnd: readonly(posEnd),
    distanceX,
    distanceY,
    stop: stop2
  };
}
__name(usePointerSwipe, "usePointerSwipe");
function usePreferredColorScheme(options4) {
  const isLight = useMediaQuery("(prefers-color-scheme: light)", options4);
  const isDark = useMediaQuery("(prefers-color-scheme: dark)", options4);
  return computed(() => {
    if (isDark.value)
      return "dark";
    if (isLight.value)
      return "light";
    return "no-preference";
  });
}
__name(usePreferredColorScheme, "usePreferredColorScheme");
function usePreferredContrast(options4) {
  const isMore = useMediaQuery("(prefers-contrast: more)", options4);
  const isLess = useMediaQuery("(prefers-contrast: less)", options4);
  const isCustom = useMediaQuery("(prefers-contrast: custom)", options4);
  return computed(() => {
    if (isMore.value)
      return "more";
    if (isLess.value)
      return "less";
    if (isCustom.value)
      return "custom";
    return "no-preference";
  });
}
__name(usePreferredContrast, "usePreferredContrast");
function usePreferredLanguages(options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  if (!window2)
    return ref(["en"]);
  const navigator2 = window2.navigator;
  const value4 = ref(navigator2.languages);
  useEventListener(window2, "languagechange", () => {
    value4.value = navigator2.languages;
  });
  return value4;
}
__name(usePreferredLanguages, "usePreferredLanguages");
function usePreferredReducedMotion(options4) {
  const isReduced = useMediaQuery("(prefers-reduced-motion: reduce)", options4);
  return computed(() => {
    if (isReduced.value)
      return "reduce";
    return "no-preference";
  });
}
__name(usePreferredReducedMotion, "usePreferredReducedMotion");
function usePrevious(value4, initialValue) {
  const previous = shallowRef(initialValue);
  watch(
    toRef(value4),
    (_2, oldValue2) => {
      previous.value = oldValue2;
    },
    { flush: "sync" }
  );
  return readonly(previous);
}
__name(usePrevious, "usePrevious");
const topVarName = "--vueuse-safe-area-top";
const rightVarName = "--vueuse-safe-area-right";
const bottomVarName = "--vueuse-safe-area-bottom";
const leftVarName = "--vueuse-safe-area-left";
function useScreenSafeArea() {
  const top = ref("");
  const right = ref("");
  const bottom = ref("");
  const left = ref("");
  if (isClient) {
    const topCssVar = useCssVar(topVarName);
    const rightCssVar = useCssVar(rightVarName);
    const bottomCssVar = useCssVar(bottomVarName);
    const leftCssVar = useCssVar(leftVarName);
    topCssVar.value = "env(safe-area-inset-top, 0px)";
    rightCssVar.value = "env(safe-area-inset-right, 0px)";
    bottomCssVar.value = "env(safe-area-inset-bottom, 0px)";
    leftCssVar.value = "env(safe-area-inset-left, 0px)";
    update();
    useEventListener("resize", useDebounceFn(update));
  }
  function update() {
    top.value = getValue(topVarName);
    right.value = getValue(rightVarName);
    bottom.value = getValue(bottomVarName);
    left.value = getValue(leftVarName);
  }
  __name(update, "update");
  return {
    top,
    right,
    bottom,
    left,
    update
  };
}
__name(useScreenSafeArea, "useScreenSafeArea");
function getValue(position3) {
  return getComputedStyle(document.documentElement).getPropertyValue(position3);
}
__name(getValue, "getValue");
function useScriptTag(src, onLoaded = noop$1, options4 = {}) {
  const {
    immediate = true,
    manual = false,
    type = "text/javascript",
    async = true,
    crossOrigin,
    referrerPolicy,
    noModule,
    defer,
    document: document2 = defaultDocument,
    attrs: attrs4 = {}
  } = options4;
  const scriptTag = ref(null);
  let _promise = null;
  const loadScript = /* @__PURE__ */ __name((waitForScriptLoad) => new Promise((resolve2, reject3) => {
    const resolveWithElement = /* @__PURE__ */ __name((el2) => {
      scriptTag.value = el2;
      resolve2(el2);
      return el2;
    }, "resolveWithElement");
    if (!document2) {
      resolve2(false);
      return;
    }
    let shouldAppend = false;
    let el = document2.querySelector(`script[src="${toValue(src)}"]`);
    if (!el) {
      el = document2.createElement("script");
      el.type = type;
      el.async = async;
      el.src = toValue(src);
      if (defer)
        el.defer = defer;
      if (crossOrigin)
        el.crossOrigin = crossOrigin;
      if (noModule)
        el.noModule = noModule;
      if (referrerPolicy)
        el.referrerPolicy = referrerPolicy;
      Object.entries(attrs4).forEach(([name2, value4]) => el == null ? void 0 : el.setAttribute(name2, value4));
      shouldAppend = true;
    } else if (el.hasAttribute("data-loaded")) {
      resolveWithElement(el);
    }
    el.addEventListener("error", (event) => reject3(event));
    el.addEventListener("abort", (event) => reject3(event));
    el.addEventListener("load", () => {
      el.setAttribute("data-loaded", "true");
      onLoaded(el);
      resolveWithElement(el);
    });
    if (shouldAppend)
      el = document2.head.appendChild(el);
    if (!waitForScriptLoad)
      resolveWithElement(el);
  }), "loadScript");
  const load2 = /* @__PURE__ */ __name((waitForScriptLoad = true) => {
    if (!_promise)
      _promise = loadScript(waitForScriptLoad);
    return _promise;
  }, "load");
  const unload = /* @__PURE__ */ __name(() => {
    if (!document2)
      return;
    _promise = null;
    if (scriptTag.value)
      scriptTag.value = null;
    const el = document2.querySelector(`script[src="${toValue(src)}"]`);
    if (el)
      document2.head.removeChild(el);
  }, "unload");
  if (immediate && !manual)
    tryOnMounted(load2);
  if (!manual)
    tryOnUnmounted(unload);
  return { scriptTag, load: load2, unload };
}
__name(useScriptTag, "useScriptTag");
function checkOverflowScroll(ele) {
  const style2 = window.getComputedStyle(ele);
  if (style2.overflowX === "scroll" || style2.overflowY === "scroll" || style2.overflowX === "auto" && ele.clientWidth < ele.scrollWidth || style2.overflowY === "auto" && ele.clientHeight < ele.scrollHeight) {
    return true;
  } else {
    const parent = ele.parentNode;
    if (!parent || parent.tagName === "BODY")
      return false;
    return checkOverflowScroll(parent);
  }
}
__name(checkOverflowScroll, "checkOverflowScroll");
function preventDefault(rawEvent) {
  const e2 = rawEvent || window.event;
  const _target = e2.target;
  if (checkOverflowScroll(_target))
    return false;
  if (e2.touches.length > 1)
    return true;
  if (e2.preventDefault)
    e2.preventDefault();
  return false;
}
__name(preventDefault, "preventDefault");
const elInitialOverflow = /* @__PURE__ */ new WeakMap();
function useScrollLock(element, initialState = false) {
  const isLocked = ref(initialState);
  let stopTouchMoveListener = null;
  let initialOverflow = "";
  watch(toRef(element), (el) => {
    const target = resolveElement(toValue(el));
    if (target) {
      const ele = target;
      if (!elInitialOverflow.get(ele))
        elInitialOverflow.set(ele, ele.style.overflow);
      if (ele.style.overflow !== "hidden")
        initialOverflow = ele.style.overflow;
      if (ele.style.overflow === "hidden")
        return isLocked.value = true;
      if (isLocked.value)
        return ele.style.overflow = "hidden";
    }
  }, {
    immediate: true
  });
  const lock = /* @__PURE__ */ __name(() => {
    const el = resolveElement(toValue(element));
    if (!el || isLocked.value)
      return;
    if (isIOS) {
      stopTouchMoveListener = useEventListener(
        el,
        "touchmove",
        (e2) => {
          preventDefault(e2);
        },
        { passive: false }
      );
    }
    el.style.overflow = "hidden";
    isLocked.value = true;
  }, "lock");
  const unlock = /* @__PURE__ */ __name(() => {
    const el = resolveElement(toValue(element));
    if (!el || !isLocked.value)
      return;
    if (isIOS)
      stopTouchMoveListener == null ? void 0 : stopTouchMoveListener();
    el.style.overflow = initialOverflow;
    elInitialOverflow.delete(el);
    isLocked.value = false;
  }, "unlock");
  tryOnScopeDispose(unlock);
  return computed({
    get() {
      return isLocked.value;
    },
    set(v2) {
      if (v2)
        lock();
      else unlock();
    }
  });
}
__name(useScrollLock, "useScrollLock");
function useSessionStorage(key, initialValue, options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  return useStorage(key, initialValue, window2 == null ? void 0 : window2.sessionStorage, options4);
}
__name(useSessionStorage, "useSessionStorage");
function useShare(shareOptions = {}, options4 = {}) {
  const { navigator: navigator2 = defaultNavigator } = options4;
  const _navigator2 = navigator2;
  const isSupported2 = useSupported(() => _navigator2 && "canShare" in _navigator2);
  const share = /* @__PURE__ */ __name(async (overrideOptions = {}) => {
    if (isSupported2.value) {
      const data24 = {
        ...toValue(shareOptions),
        ...toValue(overrideOptions)
      };
      let granted = true;
      if (data24.files && _navigator2.canShare)
        granted = _navigator2.canShare({ files: data24.files });
      if (granted)
        return _navigator2.share(data24);
    }
  }, "share");
  return {
    isSupported: isSupported2,
    share
  };
}
__name(useShare, "useShare");
const defaultSortFn = /* @__PURE__ */ __name((source, compareFn) => source.sort(compareFn), "defaultSortFn");
const defaultCompare = /* @__PURE__ */ __name((a, b) => a - b, "defaultCompare");
function useSorted(...args) {
  var _a2, _b, _c, _d;
  const [source] = args;
  let compareFn = defaultCompare;
  let options4 = {};
  if (args.length === 2) {
    if (typeof args[1] === "object") {
      options4 = args[1];
      compareFn = (_a2 = options4.compareFn) != null ? _a2 : defaultCompare;
    } else {
      compareFn = (_b = args[1]) != null ? _b : defaultCompare;
    }
  } else if (args.length > 2) {
    compareFn = (_c = args[1]) != null ? _c : defaultCompare;
    options4 = (_d = args[2]) != null ? _d : {};
  }
  const {
    dirty = false,
    sortFn = defaultSortFn
  } = options4;
  if (!dirty)
    return computed(() => sortFn([...toValue(source)], compareFn));
  watchEffect(() => {
    const result = sortFn(toValue(source), compareFn);
    if (isRef(source))
      source.value = result;
    else
      source.splice(0, source.length, ...result);
  });
  return source;
}
__name(useSorted, "useSorted");
function useSpeechRecognition(options4 = {}) {
  const {
    interimResults = true,
    continuous = true,
    maxAlternatives = 1,
    window: window2 = defaultWindow
  } = options4;
  const lang = toRef(options4.lang || "en-US");
  const isListening = ref(false);
  const isFinal = ref(false);
  const result = ref("");
  const error2 = shallowRef(void 0);
  const toggle4 = /* @__PURE__ */ __name((value4 = !isListening.value) => {
    isListening.value = value4;
  }, "toggle");
  const start2 = /* @__PURE__ */ __name(() => {
    isListening.value = true;
  }, "start");
  const stop2 = /* @__PURE__ */ __name(() => {
    isListening.value = false;
  }, "stop");
  const SpeechRecognition = window2 && (window2.SpeechRecognition || window2.webkitSpeechRecognition);
  const isSupported2 = useSupported(() => SpeechRecognition);
  let recognition;
  if (isSupported2.value) {
    recognition = new SpeechRecognition();
    recognition.continuous = continuous;
    recognition.interimResults = interimResults;
    recognition.lang = toValue(lang);
    recognition.maxAlternatives = maxAlternatives;
    recognition.onstart = () => {
      isFinal.value = false;
    };
    watch(lang, (lang2) => {
      if (recognition && !isListening.value)
        recognition.lang = lang2;
    });
    recognition.onresult = (event) => {
      const currentResult = event.results[event.resultIndex];
      const { transcript } = currentResult[0];
      isFinal.value = currentResult.isFinal;
      result.value = transcript;
      error2.value = void 0;
    };
    recognition.onerror = (event) => {
      error2.value = event;
    };
    recognition.onend = () => {
      isListening.value = false;
      recognition.lang = toValue(lang);
    };
    watch(isListening, () => {
      if (isListening.value)
        recognition.start();
      else
        recognition.stop();
    });
  }
  tryOnScopeDispose(() => {
    isListening.value = false;
  });
  return {
    isSupported: isSupported2,
    isListening,
    isFinal,
    recognition,
    result,
    error: error2,
    toggle: toggle4,
    start: start2,
    stop: stop2
  };
}
__name(useSpeechRecognition, "useSpeechRecognition");
function useSpeechSynthesis(text2, options4 = {}) {
  const {
    pitch = 1,
    rate = 1,
    volume = 1,
    window: window2 = defaultWindow
  } = options4;
  const synth = window2 && window2.speechSynthesis;
  const isSupported2 = useSupported(() => synth);
  const isPlaying = ref(false);
  const status = ref("init");
  const spokenText = toRef(text2 || "");
  const lang = toRef(options4.lang || "en-US");
  const error2 = shallowRef(void 0);
  const toggle4 = /* @__PURE__ */ __name((value4 = !isPlaying.value) => {
    isPlaying.value = value4;
  }, "toggle");
  const bindEventsForUtterance = /* @__PURE__ */ __name((utterance2) => {
    utterance2.lang = toValue(lang);
    utterance2.voice = toValue(options4.voice) || null;
    utterance2.pitch = toValue(pitch);
    utterance2.rate = toValue(rate);
    utterance2.volume = volume;
    utterance2.onstart = () => {
      isPlaying.value = true;
      status.value = "play";
    };
    utterance2.onpause = () => {
      isPlaying.value = false;
      status.value = "pause";
    };
    utterance2.onresume = () => {
      isPlaying.value = true;
      status.value = "play";
    };
    utterance2.onend = () => {
      isPlaying.value = false;
      status.value = "end";
    };
    utterance2.onerror = (event) => {
      error2.value = event;
    };
  }, "bindEventsForUtterance");
  const utterance = computed(() => {
    isPlaying.value = false;
    status.value = "init";
    const newUtterance = new SpeechSynthesisUtterance(spokenText.value);
    bindEventsForUtterance(newUtterance);
    return newUtterance;
  });
  const speak = /* @__PURE__ */ __name(() => {
    synth.cancel();
    if (utterance)
      synth.speak(utterance.value);
  }, "speak");
  const stop2 = /* @__PURE__ */ __name(() => {
    synth.cancel();
    isPlaying.value = false;
  }, "stop");
  if (isSupported2.value) {
    bindEventsForUtterance(utterance.value);
    watch(lang, (lang2) => {
      if (utterance.value && !isPlaying.value)
        utterance.value.lang = lang2;
    });
    if (options4.voice) {
      watch(options4.voice, () => {
        synth.cancel();
      });
    }
    watch(isPlaying, () => {
      if (isPlaying.value)
        synth.resume();
      else
        synth.pause();
    });
  }
  tryOnScopeDispose(() => {
    isPlaying.value = false;
  });
  return {
    isSupported: isSupported2,
    isPlaying,
    status,
    utterance,
    error: error2,
    stop: stop2,
    toggle: toggle4,
    speak
  };
}
__name(useSpeechSynthesis, "useSpeechSynthesis");
function useStepper(steps, initialStep) {
  const stepsRef = ref(steps);
  const stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));
  const index2 = ref(stepNames.value.indexOf(initialStep != null ? initialStep : stepNames.value[0]));
  const current = computed(() => at(index2.value));
  const isFirst = computed(() => index2.value === 0);
  const isLast = computed(() => index2.value === stepNames.value.length - 1);
  const next2 = computed(() => stepNames.value[index2.value + 1]);
  const previous = computed(() => stepNames.value[index2.value - 1]);
  function at(index22) {
    if (Array.isArray(stepsRef.value))
      return stepsRef.value[index22];
    return stepsRef.value[stepNames.value[index22]];
  }
  __name(at, "at");
  function get3(step3) {
    if (!stepNames.value.includes(step3))
      return;
    return at(stepNames.value.indexOf(step3));
  }
  __name(get3, "get");
  function goTo(step3) {
    if (stepNames.value.includes(step3))
      index2.value = stepNames.value.indexOf(step3);
  }
  __name(goTo, "goTo");
  function goToNext() {
    if (isLast.value)
      return;
    index2.value++;
  }
  __name(goToNext, "goToNext");
  function goToPrevious() {
    if (isFirst.value)
      return;
    index2.value--;
  }
  __name(goToPrevious, "goToPrevious");
  function goBackTo(step3) {
    if (isAfter(step3))
      goTo(step3);
  }
  __name(goBackTo, "goBackTo");
  function isNext(step3) {
    return stepNames.value.indexOf(step3) === index2.value + 1;
  }
  __name(isNext, "isNext");
  function isPrevious(step3) {
    return stepNames.value.indexOf(step3) === index2.value - 1;
  }
  __name(isPrevious, "isPrevious");
  function isCurrent(step3) {
    return stepNames.value.indexOf(step3) === index2.value;
  }
  __name(isCurrent, "isCurrent");
  function isBefore(step3) {
    return index2.value < stepNames.value.indexOf(step3);
  }
  __name(isBefore, "isBefore");
  function isAfter(step3) {
    return index2.value > stepNames.value.indexOf(step3);
  }
  __name(isAfter, "isAfter");
  return {
    steps: stepsRef,
    stepNames,
    index: index2,
    current,
    next: next2,
    previous,
    isFirst,
    isLast,
    at,
    get: get3,
    goTo,
    goToNext,
    goToPrevious,
    goBackTo,
    isNext,
    isPrevious,
    isCurrent,
    isBefore,
    isAfter
  };
}
__name(useStepper, "useStepper");
function useStorageAsync(key, initialValue, storage, options4 = {}) {
  var _a2;
  const {
    flush = "pre",
    deep = true,
    listenToStorageChanges = true,
    writeDefaults = true,
    mergeDefaults: mergeDefaults2 = false,
    shallow,
    window: window2 = defaultWindow,
    eventFilter,
    onError = /* @__PURE__ */ __name((e2) => {
      console.error(e2);
    }, "onError")
  } = options4;
  const rawInit = toValue(initialValue);
  const type = guessSerializerType(rawInit);
  const data24 = (shallow ? shallowRef : ref)(initialValue);
  const serializer = (_a2 = options4.serializer) != null ? _a2 : StorageSerializers[type];
  if (!storage) {
    try {
      storage = getSSRHandler("getDefaultStorageAsync", () => {
        var _a22;
        return (_a22 = defaultWindow) == null ? void 0 : _a22.localStorage;
      })();
    } catch (e2) {
      onError(e2);
    }
  }
  async function read(event) {
    if (!storage || event && event.key !== key)
      return;
    try {
      const rawValue = event ? event.newValue : await storage.getItem(key);
      if (rawValue == null) {
        data24.value = rawInit;
        if (writeDefaults && rawInit !== null)
          await storage.setItem(key, await serializer.write(rawInit));
      } else if (mergeDefaults2) {
        const value4 = await serializer.read(rawValue);
        if (typeof mergeDefaults2 === "function")
          data24.value = mergeDefaults2(value4, rawInit);
        else if (type === "object" && !Array.isArray(value4))
          data24.value = { ...rawInit, ...value4 };
        else data24.value = value4;
      } else {
        data24.value = await serializer.read(rawValue);
      }
    } catch (e2) {
      onError(e2);
    }
  }
  __name(read, "read");
  read();
  if (window2 && listenToStorageChanges)
    useEventListener(window2, "storage", (e2) => Promise.resolve().then(() => read(e2)));
  if (storage) {
    watchWithFilter(
      data24,
      async () => {
        try {
          if (data24.value == null)
            await storage.removeItem(key);
          else
            await storage.setItem(key, await serializer.write(data24.value));
        } catch (e2) {
          onError(e2);
        }
      },
      {
        flush,
        deep,
        eventFilter
      }
    );
  }
  return data24;
}
__name(useStorageAsync, "useStorageAsync");
let _id = 0;
function useStyleTag(css3, options4 = {}) {
  const isLoaded = ref(false);
  const {
    document: document2 = defaultDocument,
    immediate = true,
    manual = false,
    id: id3 = `vueuse_styletag_${++_id}`
  } = options4;
  const cssRef = ref(css3);
  let stop2 = /* @__PURE__ */ __name(() => {
  }, "stop");
  const load2 = /* @__PURE__ */ __name(() => {
    if (!document2)
      return;
    const el = document2.getElementById(id3) || document2.createElement("style");
    if (!el.isConnected) {
      el.id = id3;
      if (options4.media)
        el.media = options4.media;
      document2.head.appendChild(el);
    }
    if (isLoaded.value)
      return;
    stop2 = watch(
      cssRef,
      (value4) => {
        el.textContent = value4;
      },
      { immediate: true }
    );
    isLoaded.value = true;
  }, "load");
  const unload = /* @__PURE__ */ __name(() => {
    if (!document2 || !isLoaded.value)
      return;
    stop2();
    document2.head.removeChild(document2.getElementById(id3));
    isLoaded.value = false;
  }, "unload");
  if (immediate && !manual)
    tryOnMounted(load2);
  if (!manual)
    tryOnScopeDispose(unload);
  return {
    id: id3,
    css: cssRef,
    unload,
    load: load2,
    isLoaded: readonly(isLoaded)
  };
}
__name(useStyleTag, "useStyleTag");
function useSwipe(target, options4 = {}) {
  const {
    threshold = 50,
    onSwipe,
    onSwipeEnd,
    onSwipeStart,
    passive = true,
    window: window2 = defaultWindow
  } = options4;
  const coordsStart = reactive({ x: 0, y: 0 });
  const coordsEnd = reactive({ x: 0, y: 0 });
  const diffX = computed(() => coordsStart.x - coordsEnd.x);
  const diffY = computed(() => coordsStart.y - coordsEnd.y);
  const { max, abs } = Math;
  const isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);
  const isSwiping = ref(false);
  const direction = computed(() => {
    if (!isThresholdExceeded.value)
      return "none";
    if (abs(diffX.value) > abs(diffY.value)) {
      return diffX.value > 0 ? "left" : "right";
    } else {
      return diffY.value > 0 ? "up" : "down";
    }
  });
  const getTouchEventCoords = /* @__PURE__ */ __name((e2) => [e2.touches[0].clientX, e2.touches[0].clientY], "getTouchEventCoords");
  const updateCoordsStart = /* @__PURE__ */ __name((x2, y2) => {
    coordsStart.x = x2;
    coordsStart.y = y2;
  }, "updateCoordsStart");
  const updateCoordsEnd = /* @__PURE__ */ __name((x2, y2) => {
    coordsEnd.x = x2;
    coordsEnd.y = y2;
  }, "updateCoordsEnd");
  let listenerOptions;
  const isPassiveEventSupported = checkPassiveEventSupport(window2 == null ? void 0 : window2.document);
  if (!passive)
    listenerOptions = isPassiveEventSupported ? { passive: false, capture: true } : { capture: true };
  else
    listenerOptions = isPassiveEventSupported ? { passive: true } : { capture: false };
  const onTouchEnd4 = /* @__PURE__ */ __name((e2) => {
    if (isSwiping.value)
      onSwipeEnd == null ? void 0 : onSwipeEnd(e2, direction.value);
    isSwiping.value = false;
  }, "onTouchEnd");
  const stops = [
    useEventListener(target, "touchstart", (e2) => {
      if (e2.touches.length !== 1)
        return;
      if (listenerOptions.capture && !listenerOptions.passive)
        e2.preventDefault();
      const [x2, y2] = getTouchEventCoords(e2);
      updateCoordsStart(x2, y2);
      updateCoordsEnd(x2, y2);
      onSwipeStart == null ? void 0 : onSwipeStart(e2);
    }, listenerOptions),
    useEventListener(target, "touchmove", (e2) => {
      if (e2.touches.length !== 1)
        return;
      const [x2, y2] = getTouchEventCoords(e2);
      updateCoordsEnd(x2, y2);
      if (!isSwiping.value && isThresholdExceeded.value)
        isSwiping.value = true;
      if (isSwiping.value)
        onSwipe == null ? void 0 : onSwipe(e2);
    }, listenerOptions),
    useEventListener(target, ["touchend", "touchcancel"], onTouchEnd4, listenerOptions)
  ];
  const stop2 = /* @__PURE__ */ __name(() => stops.forEach((s) => s()), "stop");
  return {
    isPassiveEventSupported,
    isSwiping,
    direction,
    coordsStart,
    coordsEnd,
    lengthX: diffX,
    lengthY: diffY,
    stop: stop2
  };
}
__name(useSwipe, "useSwipe");
function checkPassiveEventSupport(document2) {
  if (!document2)
    return false;
  let supportsPassive = false;
  const optionsBlock = {
    get passive() {
      supportsPassive = true;
      return false;
    }
  };
  document2.addEventListener("x", noop$1, optionsBlock);
  document2.removeEventListener("x", noop$1);
  return supportsPassive;
}
__name(checkPassiveEventSupport, "checkPassiveEventSupport");
function useTemplateRefsList() {
  const refs = ref([]);
  refs.value.set = (el) => {
    if (el)
      refs.value.push(el);
  };
  onBeforeUpdate(() => {
    refs.value.length = 0;
  });
  return refs;
}
__name(useTemplateRefsList, "useTemplateRefsList");
function useTextDirection(options4 = {}) {
  const {
    document: document2 = defaultDocument,
    selector = "html",
    observe = false,
    initialValue = "ltr"
  } = options4;
  function getValue2() {
    var _a2, _b;
    return (_b = (_a2 = document2 == null ? void 0 : document2.querySelector(selector)) == null ? void 0 : _a2.getAttribute("dir")) != null ? _b : initialValue;
  }
  __name(getValue2, "getValue2");
  const dir = ref(getValue2());
  tryOnMounted(() => dir.value = getValue2());
  if (observe && document2) {
    useMutationObserver(
      document2.querySelector(selector),
      () => dir.value = getValue2(),
      { attributes: true }
    );
  }
  return computed({
    get() {
      return dir.value;
    },
    set(v2) {
      var _a2, _b;
      dir.value = v2;
      if (!document2)
        return;
      if (dir.value)
        (_a2 = document2.querySelector(selector)) == null ? void 0 : _a2.setAttribute("dir", dir.value);
      else
        (_b = document2.querySelector(selector)) == null ? void 0 : _b.removeAttribute("dir");
    }
  });
}
__name(useTextDirection, "useTextDirection");
function getRangesFromSelection(selection) {
  var _a2;
  const rangeCount = (_a2 = selection.rangeCount) != null ? _a2 : 0;
  return Array.from({ length: rangeCount }, (_2, i2) => selection.getRangeAt(i2));
}
__name(getRangesFromSelection, "getRangesFromSelection");
function useTextSelection(options4 = {}) {
  const {
    window: window2 = defaultWindow
  } = options4;
  const selection = ref(null);
  const text2 = computed(() => {
    var _a2, _b;
    return (_b = (_a2 = selection.value) == null ? void 0 : _a2.toString()) != null ? _b : "";
  });
  const ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);
  const rects = computed(() => ranges.value.map((range2) => range2.getBoundingClientRect()));
  function onSelectionChange() {
    selection.value = null;
    if (window2)
      selection.value = window2.getSelection();
  }
  __name(onSelectionChange, "onSelectionChange");
  if (window2)
    useEventListener(window2.document, "selectionchange", onSelectionChange);
  return {
    text: text2,
    rects,
    ranges,
    selection
  };
}
__name(useTextSelection, "useTextSelection");
function useTextareaAutosize(options4) {
  var _a2;
  const textarea = ref(options4 == null ? void 0 : options4.element);
  const input = ref(options4 == null ? void 0 : options4.input);
  const styleProp = (_a2 = options4 == null ? void 0 : options4.styleProp) != null ? _a2 : "height";
  const textareaScrollHeight = ref(1);
  const textareaOldWidth = ref(0);
  function triggerResize() {
    var _a22;
    if (!textarea.value)
      return;
    let height = "";
    textarea.value.style[styleProp] = "1px";
    textareaScrollHeight.value = (_a22 = textarea.value) == null ? void 0 : _a22.scrollHeight;
    const _styleTarget = toValue(options4 == null ? void 0 : options4.styleTarget);
    if (_styleTarget)
      _styleTarget.style[styleProp] = `${textareaScrollHeight.value}px`;
    else
      height = `${textareaScrollHeight.value}px`;
    textarea.value.style[styleProp] = height;
  }
  __name(triggerResize, "triggerResize");
  watch([input, textarea], () => nextTick(triggerResize), { immediate: true });
  watch(textareaScrollHeight, () => {
    var _a22;
    return (_a22 = options4 == null ? void 0 : options4.onResize) == null ? void 0 : _a22.call(options4);
  });
  useResizeObserver(textarea, ([{ contentRect }]) => {
    if (textareaOldWidth.value === contentRect.width)
      return;
    textareaOldWidth.value = contentRect.width;
    triggerResize();
  });
  if (options4 == null ? void 0 : options4.watch)
    watch(options4.watch, triggerResize, { immediate: true, deep: true });
  return {
    textarea,
    input,
    triggerResize
  };
}
__name(useTextareaAutosize, "useTextareaAutosize");
function useThrottledRefHistory(source, options4 = {}) {
  const { throttle: throttle2 = 200, trailing = true } = options4;
  const filter4 = throttleFilter(throttle2, trailing);
  const history2 = useRefHistory(source, { ...options4, eventFilter: filter4 });
  return {
    ...history2
  };
}
__name(useThrottledRefHistory, "useThrottledRefHistory");
const DEFAULT_UNITS = [
  { max: 6e4, value: 1e3, name: "second" },
  { max: 276e4, value: 6e4, name: "minute" },
  { max: 72e6, value: 36e5, name: "hour" },
  { max: 5184e5, value: 864e5, name: "day" },
  { max: 24192e5, value: 6048e5, name: "week" },
  { max: 28512e6, value: 2592e6, name: "month" },
  { max: Number.POSITIVE_INFINITY, value: 31536e6, name: "year" }
];
const DEFAULT_MESSAGES = {
  justNow: "just now",
  past: /* @__PURE__ */ __name((n) => n.match(/\d/) ? `${n} ago` : n, "past"),
  future: /* @__PURE__ */ __name((n) => n.match(/\d/) ? `in ${n}` : n, "future"),
  month: /* @__PURE__ */ __name((n, past) => n === 1 ? past ? "last month" : "next month" : `${n} month${n > 1 ? "s" : ""}`, "month"),
  year: /* @__PURE__ */ __name((n, past) => n === 1 ? past ? "last year" : "next year" : `${n} year${n > 1 ? "s" : ""}`, "year"),
  day: /* @__PURE__ */ __name((n, past) => n === 1 ? past ? "yesterday" : "tomorrow" : `${n} day${n > 1 ? "s" : ""}`, "day"),
  week: /* @__PURE__ */ __name((n, past) => n === 1 ? past ? "last week" : "next week" : `${n} week${n > 1 ? "s" : ""}`, "week"),
  hour: /* @__PURE__ */ __name((n) => `${n} hour${n > 1 ? "s" : ""}`, "hour"),
  minute: /* @__PURE__ */ __name((n) => `${n} minute${n > 1 ? "s" : ""}`, "minute"),
  second: /* @__PURE__ */ __name((n) => `${n} second${n > 1 ? "s" : ""}`, "second"),
  invalid: ""
};
function DEFAULT_FORMATTER(date) {
  return date.toISOString().slice(0, 10);
}
__name(DEFAULT_FORMATTER, "DEFAULT_FORMATTER");
function useTimeAgo(time, options4 = {}) {
  const {
    controls: exposeControls = false,
    updateInterval = 3e4
  } = options4;
  const { now: now2, ...controls } = useNow({ interval: updateInterval, controls: true });
  const timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options4, toValue(now2)));
  if (exposeControls) {
    return {
      timeAgo,
      ...controls
    };
  } else {
    return timeAgo;
  }
}
__name(useTimeAgo, "useTimeAgo");
function formatTimeAgo(from2, options4 = {}, now2 = Date.now()) {
  var _a2;
  const {
    max,
    messages: messages2 = DEFAULT_MESSAGES,
    fullDateFormatter = DEFAULT_FORMATTER,
    units = DEFAULT_UNITS,
    showSecond = false,
    rounding = "round"
  } = options4;
  const roundFn = typeof rounding === "number" ? (n) => +n.toFixed(rounding) : Math[rounding];
  const diff2 = +now2 - +from2;
  const absDiff = Math.abs(diff2);
  function getValue2(diff22, unit) {
    return roundFn(Math.abs(diff22) / unit.value);
  }
  __name(getValue2, "getValue2");
  function format2(diff22, unit) {
    const val = getValue2(diff22, unit);
    const past = diff22 > 0;
    const str = applyFormat(unit.name, val, past);
    return applyFormat(past ? "past" : "future", str, past);
  }
  __name(format2, "format");
  function applyFormat(name2, val, isPast) {
    const formatter = messages2[name2];
    if (typeof formatter === "function")
      return formatter(val, isPast);
    return formatter.replace("{0}", val.toString());
  }
  __name(applyFormat, "applyFormat");
  if (absDiff < 6e4 && !showSecond)
    return messages2.justNow;
  if (typeof max === "number" && absDiff > max)
    return fullDateFormatter(new Date(from2));
  if (typeof max === "string") {
    const unitMax = (_a2 = units.find((i2) => i2.name === max)) == null ? void 0 : _a2.max;
    if (unitMax && absDiff > unitMax)
      return fullDateFormatter(new Date(from2));
  }
  for (const [idx, unit] of units.entries()) {
    const val = getValue2(diff2, unit);
    if (val <= 0 && units[idx - 1])
      return format2(diff2, units[idx - 1]);
    if (absDiff < unit.max)
      return format2(diff2, unit);
  }
  return messages2.invalid;
}
__name(formatTimeAgo, "formatTimeAgo");
function useTimeoutPoll(fn, interval, timeoutPollOptions) {
  const { start: start2 } = useTimeoutFn(loop, interval, { immediate: false });
  const isActive2 = ref(false);
  async function loop() {
    if (!isActive2.value)
      return;
    await fn();
    start2();
  }
  __name(loop, "loop");
  function resume() {
    if (!isActive2.value) {
      isActive2.value = true;
      loop();
    }
  }
  __name(resume, "resume");
  function pause() {
    isActive2.value = false;
  }
  __name(pause, "pause");
  if (timeoutPollOptions == null ? void 0 : timeoutPollOptions.immediate)
    resume();
  tryOnScopeDispose(pause);
  return {
    isActive: isActive2,
    pause,
    resume
  };
}
__name(useTimeoutPoll, "useTimeoutPoll");
function useTimestamp(options4 = {}) {
  const {
    controls: exposeControls = false,
    offset = 0,
    immediate = true,
    interval = "requestAnimationFrame",
    callback
  } = options4;
  const ts2 = ref(timestamp() + offset);
  const update = /* @__PURE__ */ __name(() => ts2.value = timestamp() + offset, "update");
  const cb = callback ? () => {
    update();
    callback(ts2.value);
  } : update;
  const controls = interval === "requestAnimationFrame" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });
  if (exposeControls) {
    return {
      timestamp: ts2,
      ...controls
    };
  } else {
    return ts2;
  }
}
__name(useTimestamp, "useTimestamp");
function useTitle(newTitle = null, options4 = {}) {
  var _a2, _b, _c;
  const {
    document: document2 = defaultDocument,
    restoreOnUnmount = /* @__PURE__ */ __name((t2) => t2, "restoreOnUnmount")
  } = options4;
  const originalTitle = (_a2 = document2 == null ? void 0 : document2.title) != null ? _a2 : "";
  const title = toRef((_b = newTitle != null ? newTitle : document2 == null ? void 0 : document2.title) != null ? _b : null);
  const isReadonly2 = newTitle && typeof newTitle === "function";
  function format2(t2) {
    if (!("titleTemplate" in options4))
      return t2;
    const template = options4.titleTemplate || "%s";
    return typeof template === "function" ? template(t2) : toValue(template).replace(/%s/g, t2);
  }
  __name(format2, "format");
  watch(
    title,
    (t2, o) => {
      if (t2 !== o && document2)
        document2.title = format2(typeof t2 === "string" ? t2 : "");
    },
    { immediate: true }
  );
  if (options4.observe && !options4.titleTemplate && document2 && !isReadonly2) {
    useMutationObserver(
      (_c = document2.head) == null ? void 0 : _c.querySelector("title"),
      () => {
        if (document2 && document2.title !== title.value)
          title.value = format2(document2.title);
      },
      { childList: true }
    );
  }
  tryOnBeforeUnmount(() => {
    if (restoreOnUnmount) {
      const restoredTitle = restoreOnUnmount(originalTitle, title.value || "");
      if (restoredTitle != null && document2)
        document2.title = restoredTitle;
    }
  });
  return title;
}
__name(useTitle, "useTitle");
const _TransitionPresets = {
  easeInSine: [0.12, 0, 0.39, 0],
  easeOutSine: [0.61, 1, 0.88, 1],
  easeInOutSine: [0.37, 0, 0.63, 1],
  easeInQuad: [0.11, 0, 0.5, 0],
  easeOutQuad: [0.5, 1, 0.89, 1],
  easeInOutQuad: [0.45, 0, 0.55, 1],
  easeInCubic: [0.32, 0, 0.67, 0],
  easeOutCubic: [0.33, 1, 0.68, 1],
  easeInOutCubic: [0.65, 0, 0.35, 1],
  easeInQuart: [0.5, 0, 0.75, 0],
  easeOutQuart: [0.25, 1, 0.5, 1],
  easeInOutQuart: [0.76, 0, 0.24, 1],
  easeInQuint: [0.64, 0, 0.78, 0],
  easeOutQuint: [0.22, 1, 0.36, 1],
  easeInOutQuint: [0.83, 0, 0.17, 1],
  easeInExpo: [0.7, 0, 0.84, 0],
  easeOutExpo: [0.16, 1, 0.3, 1],
  easeInOutExpo: [0.87, 0, 0.13, 1],
  easeInCirc: [0.55, 0, 1, 0.45],
  easeOutCirc: [0, 0.55, 0.45, 1],
  easeInOutCirc: [0.85, 0, 0.15, 1],
  easeInBack: [0.36, 0, 0.66, -0.56],
  easeOutBack: [0.34, 1.56, 0.64, 1],
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
const TransitionPresets = /* @__PURE__ */ Object.assign({}, { linear: identity }, _TransitionPresets);
function createEasingFunction([p0, p1, p2, p3]) {
  const a = /* @__PURE__ */ __name((a1, a2) => 1 - 3 * a2 + 3 * a1, "a");
  const b = /* @__PURE__ */ __name((a1, a2) => 3 * a2 - 6 * a1, "b");
  const c = /* @__PURE__ */ __name((a1) => 3 * a1, "c");
  const calcBezier = /* @__PURE__ */ __name((t2, a1, a2) => ((a(a1, a2) * t2 + b(a1, a2)) * t2 + c(a1)) * t2, "calcBezier");
  const getSlope = /* @__PURE__ */ __name((t2, a1, a2) => 3 * a(a1, a2) * t2 * t2 + 2 * b(a1, a2) * t2 + c(a1), "getSlope");
  const getTforX = /* @__PURE__ */ __name((x2) => {
    let aGuessT = x2;
    for (let i2 = 0; i2 < 4; ++i2) {
      const currentSlope = getSlope(aGuessT, p0, p2);
      if (currentSlope === 0)
        return aGuessT;
      const currentX = calcBezier(aGuessT, p0, p2) - x2;
      aGuessT -= currentX / currentSlope;
    }
    return aGuessT;
  }, "getTforX");
  return (x2) => p0 === p1 && p2 === p3 ? x2 : calcBezier(getTforX(x2), p1, p3);
}
__name(createEasingFunction, "createEasingFunction");
function lerp(a, b, alpha2) {
  return a + alpha2 * (b - a);
}
__name(lerp, "lerp");
function toVec(t2) {
  return (typeof t2 === "number" ? [t2] : t2) || [];
}
__name(toVec, "toVec");
function executeTransition(source, from2, to, options4 = {}) {
  var _a2, _b;
  const fromVal = toValue(from2);
  const toVal = toValue(to);
  const v1 = toVec(fromVal);
  const v2 = toVec(toVal);
  const duration = (_a2 = toValue(options4.duration)) != null ? _a2 : 1e3;
  const startedAt = Date.now();
  const endAt = Date.now() + duration;
  const trans = typeof options4.transition === "function" ? options4.transition : (_b = toValue(options4.transition)) != null ? _b : identity;
  const ease = typeof trans === "function" ? trans : createEasingFunction(trans);
  return new Promise((resolve2) => {
    source.value = fromVal;
    const tick = /* @__PURE__ */ __name(() => {
      var _a22;
      if ((_a22 = options4.abort) == null ? void 0 : _a22.call(options4)) {
        resolve2();
        return;
      }
      const now2 = Date.now();
      const alpha2 = ease((now2 - startedAt) / duration);
      const arr = toVec(source.value).map((n, i2) => lerp(v1[i2], v2[i2], alpha2));
      if (Array.isArray(source.value))
        source.value = arr.map((n, i2) => {
          var _a3, _b2;
          return lerp((_a3 = v1[i2]) != null ? _a3 : 0, (_b2 = v2[i2]) != null ? _b2 : 0, alpha2);
        });
      else if (typeof source.value === "number")
        source.value = arr[0];
      if (now2 < endAt) {
        requestAnimationFrame(tick);
      } else {
        source.value = toVal;
        resolve2();
      }
    }, "tick");
    tick();
  });
}
__name(executeTransition, "executeTransition");
function useTransition(source, options4 = {}) {
  let currentId = 0;
  const sourceVal = /* @__PURE__ */ __name(() => {
    const v2 = toValue(source);
    return typeof v2 === "number" ? v2 : v2.map(toValue);
  }, "sourceVal");
  const outputRef = ref(sourceVal());
  watch(sourceVal, async (to) => {
    var _a2, _b;
    if (toValue(options4.disabled))
      return;
    const id3 = ++currentId;
    if (options4.delay)
      await promiseTimeout(toValue(options4.delay));
    if (id3 !== currentId)
      return;
    const toVal = Array.isArray(to) ? to.map(toValue) : toValue(to);
    (_a2 = options4.onStarted) == null ? void 0 : _a2.call(options4);
    await executeTransition(outputRef, outputRef.value, toVal, {
      ...options4,
      abort: /* @__PURE__ */ __name(() => {
        var _a22;
        return id3 !== currentId || ((_a22 = options4.abort) == null ? void 0 : _a22.call(options4));
      }, "abort")
    });
    (_b = options4.onFinished) == null ? void 0 : _b.call(options4);
  }, { deep: true });
  watch(() => toValue(options4.disabled), (disabled2) => {
    if (disabled2) {
      currentId++;
      outputRef.value = sourceVal();
    }
  });
  tryOnScopeDispose(() => {
    currentId++;
  });
  return computed(() => toValue(options4.disabled) ? sourceVal() : outputRef.value);
}
__name(useTransition, "useTransition");
function useUrlSearchParams(mode2 = "history", options4 = {}) {
  const {
    initialValue = {},
    removeNullishValues = true,
    removeFalsyValues = false,
    write: enableWrite = true,
    window: window2 = defaultWindow
  } = options4;
  if (!window2)
    return reactive(initialValue);
  const state = reactive({});
  function getRawParams() {
    if (mode2 === "history") {
      return window2.location.search || "";
    } else if (mode2 === "hash") {
      const hash = window2.location.hash || "";
      const index2 = hash.indexOf("?");
      return index2 > 0 ? hash.slice(index2) : "";
    } else {
      return (window2.location.hash || "").replace(/^#/, "");
    }
  }
  __name(getRawParams, "getRawParams");
  function constructQuery(params) {
    const stringified = params.toString();
    if (mode2 === "history")
      return `${stringified ? `?${stringified}` : ""}${window2.location.hash || ""}`;
    if (mode2 === "hash-params")
      return `${window2.location.search || ""}${stringified ? `#${stringified}` : ""}`;
    const hash = window2.location.hash || "#";
    const index2 = hash.indexOf("?");
    if (index2 > 0)
      return `${hash.slice(0, index2)}${stringified ? `?${stringified}` : ""}`;
    return `${hash}${stringified ? `?${stringified}` : ""}`;
  }
  __name(constructQuery, "constructQuery");
  function read() {
    return new URLSearchParams(getRawParams());
  }
  __name(read, "read");
  function updateState(params) {
    const unusedKeys = new Set(Object.keys(state));
    for (const key of params.keys()) {
      const paramsForKey = params.getAll(key);
      state[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || "";
      unusedKeys.delete(key);
    }
    Array.from(unusedKeys).forEach((key) => delete state[key]);
  }
  __name(updateState, "updateState");
  const { pause, resume } = watchPausable(
    state,
    () => {
      const params = new URLSearchParams("");
      Object.keys(state).forEach((key) => {
        const mapEntry = state[key];
        if (Array.isArray(mapEntry))
          mapEntry.forEach((value4) => params.append(key, value4));
        else if (removeNullishValues && mapEntry == null)
          params.delete(key);
        else if (removeFalsyValues && !mapEntry)
          params.delete(key);
        else
          params.set(key, mapEntry);
      });
      write(params);
    },
    { deep: true }
  );
  function write(params, shouldUpdate) {
    pause();
    if (shouldUpdate)
      updateState(params);
    window2.history.replaceState(
      window2.history.state,
      window2.document.title,
      window2.location.pathname + constructQuery(params)
    );
    resume();
  }
  __name(write, "write");
  function onChanged() {
    if (!enableWrite)
      return;
    write(read(), true);
  }
  __name(onChanged, "onChanged");
  useEventListener(window2, "popstate", onChanged, false);
  if (mode2 !== "history")
    useEventListener(window2, "hashchange", onChanged, false);
  const initial = read();
  if (initial.keys().next().value)
    updateState(initial);
  else
    Object.assign(state, initialValue);
  return state;
}
__name(useUrlSearchParams, "useUrlSearchParams");
function useUserMedia(options4 = {}) {
  var _a2, _b;
  const enabled = ref((_a2 = options4.enabled) != null ? _a2 : false);
  const autoSwitch = ref((_b = options4.autoSwitch) != null ? _b : true);
  const constraints = ref(options4.constraints);
  const { navigator: navigator2 = defaultNavigator } = options4;
  const isSupported2 = useSupported(() => {
    var _a22;
    return (_a22 = navigator2 == null ? void 0 : navigator2.mediaDevices) == null ? void 0 : _a22.getUserMedia;
  });
  const stream = shallowRef();
  function getDeviceOptions(type) {
    switch (type) {
      case "video": {
        if (constraints.value)
          return constraints.value.video || false;
        break;
      }
      case "audio": {
        if (constraints.value)
          return constraints.value.audio || false;
        break;
      }
    }
  }
  __name(getDeviceOptions, "getDeviceOptions");
  async function _start() {
    if (!isSupported2.value || stream.value)
      return;
    stream.value = await navigator2.mediaDevices.getUserMedia({
      video: getDeviceOptions("video"),
      audio: getDeviceOptions("audio")
    });
    return stream.value;
  }
  __name(_start, "_start");
  function _stop() {
    var _a22;
    (_a22 = stream.value) == null ? void 0 : _a22.getTracks().forEach((t2) => t2.stop());
    stream.value = void 0;
  }
  __name(_stop, "_stop");
  function stop2() {
    _stop();
    enabled.value = false;
  }
  __name(stop2, "stop");
  async function start2() {
    await _start();
    if (stream.value)
      enabled.value = true;
    return stream.value;
  }
  __name(start2, "start");
  async function restart() {
    _stop();
    return await start2();
  }
  __name(restart, "restart");
  watch(
    enabled,
    (v2) => {
      if (v2)
        _start();
      else _stop();
    },
    { immediate: true }
  );
  watch(
    constraints,
    () => {
      if (autoSwitch.value && stream.value)
        restart();
    },
    { immediate: true }
  );
  tryOnScopeDispose(() => {
    stop2();
  });
  return {
    isSupported: isSupported2,
    stream,
    start: start2,
    stop: stop2,
    restart,
    constraints,
    enabled,
    autoSwitch
  };
}
__name(useUserMedia, "useUserMedia");
function useVModel(props, key, emit2, options4 = {}) {
  var _a2, _b, _c, _d, _e;
  const {
    clone: clone2 = false,
    passive = false,
    eventName,
    deep = false,
    defaultValue,
    shouldEmit
  } = options4;
  const vm = getCurrentInstance();
  const _emit = emit2 || (vm == null ? void 0 : vm.emit) || ((_a2 = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a2.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));
  let event = eventName;
  if (!key) {
    if (isVue2) {
      const modelOptions = (_e = (_d = vm == null ? void 0 : vm.proxy) == null ? void 0 : _d.$options) == null ? void 0 : _e.model;
      key = (modelOptions == null ? void 0 : modelOptions.value) || "value";
      if (!eventName)
        event = (modelOptions == null ? void 0 : modelOptions.event) || "input";
    } else {
      key = "modelValue";
    }
  }
  event = event || `update:${key.toString()}`;
  const cloneFn = /* @__PURE__ */ __name((val) => !clone2 ? val : typeof clone2 === "function" ? clone2(val) : cloneFnJSON(val), "cloneFn");
  const getValue2 = /* @__PURE__ */ __name(() => isDef(props[key]) ? cloneFn(props[key]) : defaultValue, "getValue2");
  const triggerEmit = /* @__PURE__ */ __name((value4) => {
    if (shouldEmit) {
      if (shouldEmit(value4))
        _emit(event, value4);
    } else {
      _emit(event, value4);
    }
  }, "triggerEmit");
  if (passive) {
    const initialValue = getValue2();
    const proxy = ref(initialValue);
    let isUpdating = false;
    watch(
      () => props[key],
      (v2) => {
        if (!isUpdating) {
          isUpdating = true;
          proxy.value = cloneFn(v2);
          nextTick(() => isUpdating = false);
        }
      }
    );
    watch(
      proxy,
      (v2) => {
        if (!isUpdating && (v2 !== props[key] || deep))
          triggerEmit(v2);
      },
      { deep }
    );
    return proxy;
  } else {
    return computed({
      get() {
        return getValue2();
      },
      set(value4) {
        triggerEmit(value4);
      }
    });
  }
}
__name(useVModel, "useVModel");
function useVModels(props, emit2, options4 = {}) {
  const ret = {};
  for (const key in props) {
    ret[key] = useVModel(
      props,
      key,
      emit2,
      options4
    );
  }
  return ret;
}
__name(useVModels, "useVModels");
function useVibrate(options4) {
  const {
    pattern = [],
    interval = 0,
    navigator: navigator2 = defaultNavigator
  } = options4 || {};
  const isSupported2 = useSupported(() => typeof navigator2 !== "undefined" && "vibrate" in navigator2);
  const patternRef = toRef(pattern);
  let intervalControls;
  const vibrate = /* @__PURE__ */ __name((pattern2 = patternRef.value) => {
    if (isSupported2.value)
      navigator2.vibrate(pattern2);
  }, "vibrate");
  const stop2 = /* @__PURE__ */ __name(() => {
    if (isSupported2.value)
      navigator2.vibrate(0);
    intervalControls == null ? void 0 : intervalControls.pause();
  }, "stop");
  if (interval > 0) {
    intervalControls = useIntervalFn(
      vibrate,
      interval,
      {
        immediate: false,
        immediateCallback: false
      }
    );
  }
  return {
    isSupported: isSupported2,
    pattern,
    intervalControls,
    vibrate,
    stop: stop2
  };
}
__name(useVibrate, "useVibrate");
function useVirtualList(list2, options4) {
  const { containerStyle, wrapperProps, scrollTo: scrollTo22, calculateRange, currentList, containerRef: containerRef6 } = "itemHeight" in options4 ? useVerticalVirtualList(options4, list2) : useHorizontalVirtualList(options4, list2);
  return {
    list: currentList,
    scrollTo: scrollTo22,
    containerProps: {
      ref: containerRef6,
      onScroll: /* @__PURE__ */ __name(() => {
        calculateRange();
      }, "onScroll"),
      style: containerStyle
    },
    wrapperProps
  };
}
__name(useVirtualList, "useVirtualList");
function useVirtualListResources(list2) {
  const containerRef6 = ref(null);
  const size2 = useElementSize(containerRef6);
  const currentList = ref([]);
  const source = shallowRef(list2);
  const state = ref({ start: 0, end: 10 });
  return { state, source, currentList, size: size2, containerRef: containerRef6 };
}
__name(useVirtualListResources, "useVirtualListResources");
function createGetViewCapacity(state, source, itemSize2) {
  return (containerSize) => {
    if (typeof itemSize2 === "number")
      return Math.ceil(containerSize / itemSize2);
    const { start: start2 = 0 } = state.value;
    let sum = 0;
    let capacity = 0;
    for (let i2 = start2; i2 < source.value.length; i2++) {
      const size2 = itemSize2(i2);
      sum += size2;
      capacity = i2;
      if (sum > containerSize)
        break;
    }
    return capacity - start2;
  };
}
__name(createGetViewCapacity, "createGetViewCapacity");
function createGetOffset(source, itemSize2) {
  return (scrollDirection) => {
    if (typeof itemSize2 === "number")
      return Math.floor(scrollDirection / itemSize2) + 1;
    let sum = 0;
    let offset = 0;
    for (let i2 = 0; i2 < source.value.length; i2++) {
      const size2 = itemSize2(i2);
      sum += size2;
      if (sum >= scrollDirection) {
        offset = i2;
        break;
      }
    }
    return offset + 1;
  };
}
__name(createGetOffset, "createGetOffset");
function createCalculateRange(type, overscan, getOffset2, getViewCapacity, { containerRef: containerRef6, state, currentList, source }) {
  return () => {
    const element = containerRef6.value;
    if (element) {
      const offset = getOffset2(type === "vertical" ? element.scrollTop : element.scrollLeft);
      const viewCapacity = getViewCapacity(type === "vertical" ? element.clientHeight : element.clientWidth);
      const from2 = offset - overscan;
      const to = offset + viewCapacity + overscan;
      state.value = {
        start: from2 < 0 ? 0 : from2,
        end: to > source.value.length ? source.value.length : to
      };
      currentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index2) => ({
        data: ele,
        index: index2 + state.value.start
      }));
    }
  };
}
__name(createCalculateRange, "createCalculateRange");
function createGetDistance(itemSize2, source) {
  return (index2) => {
    if (typeof itemSize2 === "number") {
      const size22 = index2 * itemSize2;
      return size22;
    }
    const size2 = source.value.slice(0, index2).reduce((sum, _2, i2) => sum + itemSize2(i2), 0);
    return size2;
  };
}
__name(createGetDistance, "createGetDistance");
function useWatchForSizes(size2, list2, containerRef6, calculateRange) {
  watch([size2.width, size2.height, list2, containerRef6], () => {
    calculateRange();
  });
}
__name(useWatchForSizes, "useWatchForSizes");
function createComputedTotalSize(itemSize2, source) {
  return computed(() => {
    if (typeof itemSize2 === "number")
      return source.value.length * itemSize2;
    return source.value.reduce((sum, _2, index2) => sum + itemSize2(index2), 0);
  });
}
__name(createComputedTotalSize, "createComputedTotalSize");
const scrollToDictionaryForElementScrollKey = {
  horizontal: "scrollLeft",
  vertical: "scrollTop"
};
function createScrollTo(type, calculateRange, getDistance, containerRef6) {
  return (index2) => {
    if (containerRef6.value) {
      containerRef6.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index2);
      calculateRange();
    }
  };
}
__name(createScrollTo, "createScrollTo");
function useHorizontalVirtualList(options4, list2) {
  const resources = useVirtualListResources(list2);
  const { state, source, currentList, size: size2, containerRef: containerRef6 } = resources;
  const containerStyle = { overflowX: "auto" };
  const { itemWidth, overscan = 5 } = options4;
  const getViewCapacity = createGetViewCapacity(state, source, itemWidth);
  const getOffset2 = createGetOffset(source, itemWidth);
  const calculateRange = createCalculateRange("horizontal", overscan, getOffset2, getViewCapacity, resources);
  const getDistanceLeft = createGetDistance(itemWidth, source);
  const offsetLeft = computed(() => getDistanceLeft(state.value.start));
  const totalWidth = createComputedTotalSize(itemWidth, source);
  useWatchForSizes(size2, list2, containerRef6, calculateRange);
  const scrollTo22 = createScrollTo("horizontal", calculateRange, getDistanceLeft, containerRef6);
  const wrapperProps = computed(() => {
    return {
      style: {
        height: "100%",
        width: `${totalWidth.value - offsetLeft.value}px`,
        marginLeft: `${offsetLeft.value}px`,
        display: "flex"
      }
    };
  });
  return {
    scrollTo: scrollTo22,
    calculateRange,
    wrapperProps,
    containerStyle,
    currentList,
    containerRef: containerRef6
  };
}
__name(useHorizontalVirtualList, "useHorizontalVirtualList");
function useVerticalVirtualList(options4, list2) {
  const resources = useVirtualListResources(list2);
  const { state, source, currentList, size: size2, containerRef: containerRef6 } = resources;
  const containerStyle = { overflowY: "auto" };
  const { itemHeight, overscan = 5 } = options4;
  const getViewCapacity = createGetViewCapacity(state, source, itemHeight);
  const getOffset2 = createGetOffset(source, itemHeight);
  const calculateRange = createCalculateRange("vertical", overscan, getOffset2, getViewCapacity, resources);
  const getDistanceTop = createGetDistance(itemHeight, source);
  const offsetTop = computed(() => getDistanceTop(state.value.start));
  const totalHeight = createComputedTotalSize(itemHeight, source);
  useWatchForSizes(size2, list2, containerRef6, calculateRange);
  const scrollTo22 = createScrollTo("vertical", calculateRange, getDistanceTop, containerRef6);
  const wrapperProps = computed(() => {
    return {
      style: {
        width: "100%",
        height: `${totalHeight.value - offsetTop.value}px`,
        marginTop: `${offsetTop.value}px`
      }
    };
  });
  return {
    calculateRange,
    scrollTo: scrollTo22,
    containerStyle,
    wrapperProps,
    currentList,
    containerRef: containerRef6
  };
}
__name(useVerticalVirtualList, "useVerticalVirtualList");
function useWakeLock(options4 = {}) {
  const {
    navigator: navigator2 = defaultNavigator,
    document: document2 = defaultDocument
  } = options4;
  const requestedType = ref(false);
  const sentinel = shallowRef(null);
  const documentVisibility = useDocumentVisibility({ document: document2 });
  const isSupported2 = useSupported(() => navigator2 && "wakeLock" in navigator2);
  const isActive2 = computed(() => !!sentinel.value && documentVisibility.value === "visible");
  if (isSupported2.value) {
    useEventListener(sentinel, "release", () => {
      var _a2, _b;
      requestedType.value = (_b = (_a2 = sentinel.value) == null ? void 0 : _a2.type) != null ? _b : false;
    });
    whenever(
      () => documentVisibility.value === "visible" && (document2 == null ? void 0 : document2.visibilityState) === "visible" && requestedType.value,
      (type) => {
        requestedType.value = false;
        forceRequest(type);
      }
    );
  }
  async function forceRequest(type) {
    var _a2;
    await ((_a2 = sentinel.value) == null ? void 0 : _a2.release());
    sentinel.value = isSupported2.value ? await navigator2.wakeLock.request(type) : null;
  }
  __name(forceRequest, "forceRequest");
  async function request(type) {
    if (documentVisibility.value === "visible")
      await forceRequest(type);
    else
      requestedType.value = type;
  }
  __name(request, "request");
  async function release() {
    requestedType.value = false;
    const s = sentinel.value;
    sentinel.value = null;
    await (s == null ? void 0 : s.release());
  }
  __name(release, "release");
  return {
    sentinel,
    isSupported: isSupported2,
    isActive: isActive2,
    request,
    forceRequest,
    release
  };
}
__name(useWakeLock, "useWakeLock");
function useWebNotification(options4 = {}) {
  const {
    window: window2 = defaultWindow,
    requestPermissions: _requestForPermissions = true
  } = options4;
  const defaultWebNotificationOptions = options4;
  const isSupported2 = useSupported(() => {
    if (!window2 || !("Notification" in window2))
      return false;
    try {
      new Notification("");
    } catch (e2) {
      return false;
    }
    return true;
  });
  const permissionGranted = ref(isSupported2.value && "permission" in Notification && Notification.permission === "granted");
  const notification = ref(null);
  const ensurePermissions = /* @__PURE__ */ __name(async () => {
    if (!isSupported2.value)
      return;
    if (!permissionGranted.value && Notification.permission !== "denied") {
      const result = await Notification.requestPermission();
      if (result === "granted")
        permissionGranted.value = true;
    }
    return permissionGranted.value;
  }, "ensurePermissions");
  const { on: onClick3, trigger: clickTrigger } = createEventHook();
  const { on: onShow, trigger: showTrigger } = createEventHook();
  const { on: onError, trigger: errorTrigger } = createEventHook();
  const { on: onClose, trigger: closeTrigger } = createEventHook();
  const show5 = /* @__PURE__ */ __name(async (overrides) => {
    if (!isSupported2.value || !permissionGranted.value)
      return;
    const options22 = Object.assign({}, defaultWebNotificationOptions, overrides);
    notification.value = new Notification(options22.title || "", options22);
    notification.value.onclick = clickTrigger;
    notification.value.onshow = showTrigger;
    notification.value.onerror = errorTrigger;
    notification.value.onclose = closeTrigger;
    return notification.value;
  }, "show");
  const close5 = /* @__PURE__ */ __name(() => {
    if (notification.value)
      notification.value.close();
    notification.value = null;
  }, "close");
  if (_requestForPermissions)
    tryOnMounted(ensurePermissions);
  tryOnScopeDispose(close5);
  if (isSupported2.value && window2) {
    const document2 = window2.document;
    useEventListener(document2, "visibilitychange", (e2) => {
      e2.preventDefault();
      if (document2.visibilityState === "visible") {
        close5();
      }
    });
  }
  return {
    isSupported: isSupported2,
    notification,
    ensurePermissions,
    permissionGranted,
    show: show5,
    close: close5,
    onClick: onClick3,
    onShow,
    onError,
    onClose
  };
}
__name(useWebNotification, "useWebNotification");
const DEFAULT_PING_MESSAGE = "ping";
function resolveNestedOptions(options4) {
  if (options4 === true)
    return {};
  return options4;
}
__name(resolveNestedOptions, "resolveNestedOptions");
function useWebSocket(url, options4 = {}) {
  const {
    onConnected,
    onDisconnected,
    onError,
    onMessage,
    immediate = true,
    autoClose = true,
    protocols = []
  } = options4;
  const data24 = ref(null);
  const status = ref("CLOSED");
  const wsRef = ref();
  const urlRef = toRef(url);
  let heartbeatPause;
  let heartbeatResume;
  let explicitlyClosed = false;
  let retried = 0;
  let bufferedData = [];
  let pongTimeoutWait;
  const _sendBuffer = /* @__PURE__ */ __name(() => {
    if (bufferedData.length && wsRef.value && status.value === "OPEN") {
      for (const buffer2 of bufferedData)
        wsRef.value.send(buffer2);
      bufferedData = [];
    }
  }, "_sendBuffer");
  const resetHeartbeat = /* @__PURE__ */ __name(() => {
    clearTimeout(pongTimeoutWait);
    pongTimeoutWait = void 0;
  }, "resetHeartbeat");
  const close5 = /* @__PURE__ */ __name((code2 = 1e3, reason) => {
    if (!isClient || !wsRef.value)
      return;
    explicitlyClosed = true;
    resetHeartbeat();
    heartbeatPause == null ? void 0 : heartbeatPause();
    wsRef.value.close(code2, reason);
    wsRef.value = void 0;
  }, "close");
  const send = /* @__PURE__ */ __name((data25, useBuffer = true) => {
    if (!wsRef.value || status.value !== "OPEN") {
      if (useBuffer)
        bufferedData.push(data25);
      return false;
    }
    _sendBuffer();
    wsRef.value.send(data25);
    return true;
  }, "send");
  const _init = /* @__PURE__ */ __name(() => {
    if (explicitlyClosed || typeof urlRef.value === "undefined")
      return;
    const ws = new WebSocket(urlRef.value, protocols);
    wsRef.value = ws;
    status.value = "CONNECTING";
    ws.onopen = () => {
      status.value = "OPEN";
      onConnected == null ? void 0 : onConnected(ws);
      heartbeatResume == null ? void 0 : heartbeatResume();
      _sendBuffer();
    };
    ws.onclose = (ev) => {
      status.value = "CLOSED";
      onDisconnected == null ? void 0 : onDisconnected(ws, ev);
      if (!explicitlyClosed && options4.autoReconnect) {
        const {
          retries = -1,
          delay = 1e3,
          onFailed
        } = resolveNestedOptions(options4.autoReconnect);
        retried += 1;
        if (typeof retries === "number" && (retries < 0 || retried < retries))
          setTimeout(_init, delay);
        else if (typeof retries === "function" && retries())
          setTimeout(_init, delay);
        else
          onFailed == null ? void 0 : onFailed();
      }
    };
    ws.onerror = (e2) => {
      onError == null ? void 0 : onError(ws, e2);
    };
    ws.onmessage = (e2) => {
      if (options4.heartbeat) {
        resetHeartbeat();
        const {
          message: message3 = DEFAULT_PING_MESSAGE,
          responseMessage = message3
        } = resolveNestedOptions(options4.heartbeat);
        if (e2.data === responseMessage)
          return;
      }
      data24.value = e2.data;
      onMessage == null ? void 0 : onMessage(ws, e2);
    };
  }, "_init");
  if (options4.heartbeat) {
    const {
      message: message3 = DEFAULT_PING_MESSAGE,
      interval = 1e3,
      pongTimeout = 1e3
    } = resolveNestedOptions(options4.heartbeat);
    const { pause, resume } = useIntervalFn(
      () => {
        send(message3, false);
        if (pongTimeoutWait != null)
          return;
        pongTimeoutWait = setTimeout(() => {
          close5();
          explicitlyClosed = false;
        }, pongTimeout);
      },
      interval,
      { immediate: false }
    );
    heartbeatPause = pause;
    heartbeatResume = resume;
  }
  if (autoClose) {
    if (isClient)
      useEventListener("beforeunload", () => close5());
    tryOnScopeDispose(close5);
  }
  const open2 = /* @__PURE__ */ __name(() => {
    if (!isClient && !isWorker)
      return;
    close5();
    explicitlyClosed = false;
    retried = 0;
    _init();
  }, "open");
  if (immediate)
    open2();
  watch(urlRef, open2);
  return {
    data: data24,
    status,
    close: close5,
    send,
    open: open2,
    ws: wsRef
  };
}
__name(useWebSocket, "useWebSocket");
function useWebWorker(arg0, workerOptions, options4) {
  const {
    window: window2 = defaultWindow
  } = options4 != null ? options4 : {};
  const data24 = ref(null);
  const worker = shallowRef();
  const post = /* @__PURE__ */ __name((...args) => {
    if (!worker.value)
      return;
    worker.value.postMessage(...args);
  }, "post");
  const terminate = /* @__PURE__ */ __name(function terminate2() {
    if (!worker.value)
      return;
    worker.value.terminate();
  }, "terminate2");
  if (window2) {
    if (typeof arg0 === "string")
      worker.value = new Worker(arg0, workerOptions);
    else if (typeof arg0 === "function")
      worker.value = arg0();
    else
      worker.value = arg0;
    worker.value.onmessage = (e2) => {
      data24.value = e2.data;
    };
    tryOnScopeDispose(() => {
      if (worker.value)
        worker.value.terminate();
    });
  }
  return {
    data: data24,
    post,
    terminate,
    worker
  };
}
__name(useWebWorker, "useWebWorker");
function jobRunner(userFunc) {
  return (e2) => {
    const userFuncArgs = e2.data[0];
    return Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {
      postMessage(["SUCCESS", result]);
    }).catch((error2) => {
      postMessage(["ERROR", error2]);
    });
  };
}
__name(jobRunner, "jobRunner");
function depsParser(deps, localDeps) {
  if (deps.length === 0 && localDeps.length === 0)
    return "";
  const depsString = deps.map((dep) => `'${dep}'`).toString();
  const depsFunctionString = localDeps.filter((dep) => typeof dep === "function").map((fn) => {
    const str = fn.toString();
    if (str.trim().startsWith("function")) {
      return str;
    } else {
      const name2 = fn.name;
      return `const ${name2} = ${str}`;
    }
  }).join(";");
  const importString = `importScripts(${depsString});`;
  return `${depsString.trim() === "" ? "" : importString} ${depsFunctionString}`;
}
__name(depsParser, "depsParser");
function createWorkerBlobUrl(fn, deps, localDeps) {
  const blobCode = `${depsParser(deps, localDeps)}; onmessage=(${jobRunner})(${fn})`;
  const blob = new Blob([blobCode], { type: "text/javascript" });
  const url = URL.createObjectURL(blob);
  return url;
}
__name(createWorkerBlobUrl, "createWorkerBlobUrl");
function useWebWorkerFn(fn, options4 = {}) {
  const {
    dependencies = [],
    localDependencies = [],
    timeout,
    window: window2 = defaultWindow
  } = options4;
  const worker = ref();
  const workerStatus = ref("PENDING");
  const promise = ref({});
  const timeoutId = ref();
  const workerTerminate = /* @__PURE__ */ __name((status = "PENDING") => {
    if (worker.value && worker.value._url && window2) {
      worker.value.terminate();
      URL.revokeObjectURL(worker.value._url);
      promise.value = {};
      worker.value = void 0;
      window2.clearTimeout(timeoutId.value);
      workerStatus.value = status;
    }
  }, "workerTerminate");
  workerTerminate();
  tryOnScopeDispose(workerTerminate);
  const generateWorker = /* @__PURE__ */ __name(() => {
    const blobUrl = createWorkerBlobUrl(fn, dependencies, localDependencies);
    const newWorker = new Worker(blobUrl);
    newWorker._url = blobUrl;
    newWorker.onmessage = (e2) => {
      const { resolve: resolve2 = /* @__PURE__ */ __name(() => {
      }, "resolve"), reject: reject3 = /* @__PURE__ */ __name(() => {
      }, "reject") } = promise.value;
      const [status, result] = e2.data;
      switch (status) {
        case "SUCCESS":
          resolve2(result);
          workerTerminate(status);
          break;
        default:
          reject3(result);
          workerTerminate("ERROR");
          break;
      }
    };
    newWorker.onerror = (e2) => {
      const { reject: reject3 = /* @__PURE__ */ __name(() => {
      }, "reject") } = promise.value;
      e2.preventDefault();
      reject3(e2);
      workerTerminate("ERROR");
    };
    if (timeout) {
      timeoutId.value = setTimeout(
        () => workerTerminate("TIMEOUT_EXPIRED"),
        timeout
      );
    }
    return newWorker;
  }, "generateWorker");
  const callWorker = /* @__PURE__ */ __name((...fnArgs) => new Promise((resolve2, reject3) => {
    var _a2;
    promise.value = {
      resolve: resolve2,
      reject: reject3
    };
    (_a2 = worker.value) == null ? void 0 : _a2.postMessage([[...fnArgs]]);
    workerStatus.value = "RUNNING";
  }), "callWorker");
  const workerFn = /* @__PURE__ */ __name((...fnArgs) => {
    if (workerStatus.value === "RUNNING") {
      console.error(
        "[useWebWorkerFn] You can only run one instance of the worker at a time."
      );
      return Promise.reject();
    }
    worker.value = generateWorker();
    return callWorker(...fnArgs);
  }, "workerFn");
  return {
    workerFn,
    workerStatus,
    workerTerminate
  };
}
__name(useWebWorkerFn, "useWebWorkerFn");
function useWindowFocus(options4 = {}) {
  const { window: window2 = defaultWindow } = options4;
  if (!window2)
    return ref(false);
  const focused = ref(window2.document.hasFocus());
  useEventListener(window2, "blur", () => {
    focused.value = false;
  });
  useEventListener(window2, "focus", () => {
    focused.value = true;
  });
  return focused;
}
__name(useWindowFocus, "useWindowFocus");
function useWindowScroll(options4 = {}) {
  const { window: window2 = defaultWindow, behavior = "auto" } = options4;
  if (!window2) {
    return {
      x: ref(0),
      y: ref(0)
    };
  }
  const internalX = ref(window2.scrollX);
  const internalY = ref(window2.scrollY);
  const x2 = computed({
    get() {
      return internalX.value;
    },
    set(x22) {
      scrollTo({ left: x22, behavior });
    }
  });
  const y2 = computed({
    get() {
      return internalY.value;
    },
    set(y22) {
      scrollTo({ top: y22, behavior });
    }
  });
  useEventListener(
    window2,
    "scroll",
    () => {
      internalX.value = window2.scrollX;
      internalY.value = window2.scrollY;
    },
    {
      capture: false,
      passive: true
    }
  );
  return { x: x2, y: y2 };
}
__name(useWindowScroll, "useWindowScroll");
function useWindowSize(options4 = {}) {
  const {
    window: window2 = defaultWindow,
    initialWidth = Number.POSITIVE_INFINITY,
    initialHeight = Number.POSITIVE_INFINITY,
    listenOrientation = true,
    includeScrollbar = true,
    type = "inner"
  } = options4;
  const width2 = ref(initialWidth);
  const height = ref(initialHeight);
  const update = /* @__PURE__ */ __name(() => {
    if (window2) {
      if (type === "outer") {
        width2.value = window2.outerWidth;
        height.value = window2.outerHeight;
      } else if (includeScrollbar) {
        width2.value = window2.innerWidth;
        height.value = window2.innerHeight;
      } else {
        width2.value = window2.document.documentElement.clientWidth;
        height.value = window2.document.documentElement.clientHeight;
      }
    }
  }, "update");
  update();
  tryOnMounted(update);
  useEventListener("resize", update, { passive: true });
  if (listenOrientation) {
    const matches2 = useMediaQuery("(orientation: portrait)");
    watch(matches2, () => update());
  }
  return { width: width2, height };
}
__name(useWindowSize, "useWindowSize");
var BaseComponentStyle$1 = BaseStyle.extend({
  name: "common"
});
function _typeof$f(o) {
  "@babel/helpers - typeof";
  return _typeof$f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$f(o);
}
__name(_typeof$f, "_typeof$f");
function _toArray(r) {
  return _arrayWithHoles$1(r) || _iterableToArray$c(r) || _unsupportedIterableToArray$e(r) || _nonIterableRest$1();
}
__name(_toArray, "_toArray");
function _iterableToArray$c(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$c, "_iterableToArray$c");
function _slicedToArray$1(r, e2) {
  return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e2) || _unsupportedIterableToArray$e(r, e2) || _nonIterableRest$1();
}
__name(_slicedToArray$1, "_slicedToArray$1");
function _nonIterableRest$1() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableRest$1, "_nonIterableRest$1");
function _unsupportedIterableToArray$e(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$e(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$e(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$e, "_unsupportedIterableToArray$e");
function _arrayLikeToArray$e(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$e, "_arrayLikeToArray$e");
function _iterableToArrayLimit$1(r, l) {
  var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (null != t2) {
    var e2, n, i2, u, a = [], f = true, o = false;
    try {
      if (i2 = (t2 = t2.call(r)).next, 0 === l) {
        if (Object(t2) !== t2) return;
        f = false;
      } else for (; !(f = (e2 = i2.call(t2)).done) && (a.push(e2.value), a.length !== l); f = true) ;
    } catch (r2) {
      o = true, n = r2;
    } finally {
      try {
        if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
      } finally {
        if (o) throw n;
      }
    }
    return a;
  }
}
__name(_iterableToArrayLimit$1, "_iterableToArrayLimit$1");
function _arrayWithHoles$1(r) {
  if (Array.isArray(r)) return r;
}
__name(_arrayWithHoles$1, "_arrayWithHoles$1");
function ownKeys$f(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$f, "ownKeys$f");
function _objectSpread$f(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$f(Object(t2), true).forEach(function(r2) {
      _defineProperty$f(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$f(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$f, "_objectSpread$f");
function _defineProperty$f(e2, r, t2) {
  return (r = _toPropertyKey$e(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$f, "_defineProperty$f");
function _toPropertyKey$e(t2) {
  var i2 = _toPrimitive$e(t2, "string");
  return "symbol" == _typeof$f(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$e, "_toPropertyKey$e");
function _toPrimitive$e(t2, r) {
  if ("object" != _typeof$f(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$f(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$e, "_toPrimitive$e");
var script$_ = {
  name: "BaseComponent",
  props: {
    pt: {
      type: Object,
      "default": void 0
    },
    ptOptions: {
      type: Object,
      "default": void 0
    },
    unstyled: {
      type: Boolean,
      "default": void 0
    },
    dt: {
      type: Object,
      "default": void 0
    }
  },
  inject: {
    $parentInstance: {
      "default": void 0
    }
  },
  watch: {
    isUnstyled: {
      immediate: true,
      handler: /* @__PURE__ */ __name(function handler2(newValue2) {
        if (!newValue2) {
          this._loadCoreStyles();
          this._themeChangeListener(this._loadCoreStyles);
        }
      }, "handler")
    },
    dt: {
      immediate: true,
      handler: /* @__PURE__ */ __name(function handler3(newValue2) {
        var _this = this;
        if (newValue2) {
          this._loadScopedThemeStyles(newValue2);
          this._themeChangeListener(function() {
            return _this._loadScopedThemeStyles(newValue2);
          });
        } else {
          this._unloadScopedThemeStyles();
        }
      }, "handler")
    }
  },
  scopedStyleEl: void 0,
  rootEl: void 0,
  beforeCreate: /* @__PURE__ */ __name(function beforeCreate() {
    var _this$pt, _this$pt2, _this$pt3, _ref, _ref$onBeforeCreate, _this$$primevueConfig, _this$$primevue, _this$$primevue2, _this$$primevue3, _ref2, _ref2$onBeforeCreate;
    var _usept = (_this$pt = this.pt) === null || _this$pt === void 0 ? void 0 : _this$pt["_usept"];
    var originalValue = _usept ? (_this$pt2 = this.pt) === null || _this$pt2 === void 0 || (_this$pt2 = _this$pt2.originalValue) === null || _this$pt2 === void 0 ? void 0 : _this$pt2[this.$.type.name] : void 0;
    var value4 = _usept ? (_this$pt3 = this.pt) === null || _this$pt3 === void 0 || (_this$pt3 = _this$pt3.value) === null || _this$pt3 === void 0 ? void 0 : _this$pt3[this.$.type.name] : this.pt;
    (_ref = value4 || originalValue) === null || _ref === void 0 || (_ref = _ref.hooks) === null || _ref === void 0 || (_ref$onBeforeCreate = _ref["onBeforeCreate"]) === null || _ref$onBeforeCreate === void 0 || _ref$onBeforeCreate.call(_ref);
    var _useptInConfig = (_this$$primevueConfig = this.$primevueConfig) === null || _this$$primevueConfig === void 0 || (_this$$primevueConfig = _this$$primevueConfig.pt) === null || _this$$primevueConfig === void 0 ? void 0 : _this$$primevueConfig["_usept"];
    var originalValueInConfig = _useptInConfig ? (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.pt) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.originalValue : void 0;
    var valueInConfig = _useptInConfig ? (_this$$primevue2 = this.$primevue) === null || _this$$primevue2 === void 0 || (_this$$primevue2 = _this$$primevue2.config) === null || _this$$primevue2 === void 0 || (_this$$primevue2 = _this$$primevue2.pt) === null || _this$$primevue2 === void 0 ? void 0 : _this$$primevue2.value : (_this$$primevue3 = this.$primevue) === null || _this$$primevue3 === void 0 || (_this$$primevue3 = _this$$primevue3.config) === null || _this$$primevue3 === void 0 ? void 0 : _this$$primevue3.pt;
    (_ref2 = valueInConfig || originalValueInConfig) === null || _ref2 === void 0 || (_ref2 = _ref2[this.$.type.name]) === null || _ref2 === void 0 || (_ref2 = _ref2.hooks) === null || _ref2 === void 0 || (_ref2$onBeforeCreate = _ref2["onBeforeCreate"]) === null || _ref2$onBeforeCreate === void 0 || _ref2$onBeforeCreate.call(_ref2);
  }, "beforeCreate"),
  created: /* @__PURE__ */ __name(function created() {
    this._hook("onCreated");
  }, "created"),
  beforeMount: /* @__PURE__ */ __name(function beforeMount2() {
    this._loadStyles();
    this._hook("onBeforeMount");
  }, "beforeMount"),
  mounted: /* @__PURE__ */ __name(function mounted() {
    this.rootEl = findSingle(this.$el, '[data-pc-name="'.concat(toFlatCase(this.$.type.name), '"]'));
    if (this.rootEl) {
      this.rootEl.setAttribute(this.$attrSelector, "");
      this.rootEl.$pc = _objectSpread$f({
        name: this.$.type.name
      }, this.$params);
    }
    this._hook("onMounted");
  }, "mounted"),
  beforeUpdate: /* @__PURE__ */ __name(function beforeUpdate() {
    this._hook("onBeforeUpdate");
  }, "beforeUpdate"),
  updated: /* @__PURE__ */ __name(function updated2() {
    this._hook("onUpdated");
  }, "updated"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() {
    this._hook("onBeforeUnmount");
  }, "beforeUnmount"),
  unmounted: /* @__PURE__ */ __name(function unmounted2() {
    this._unloadScopedThemeStyles();
    this._hook("onUnmounted");
  }, "unmounted"),
  methods: {
    _hook: /* @__PURE__ */ __name(function _hook2(hookName) {
      if (!this.$options.hostName) {
        var selfHook = this._usePT(this._getPT(this.pt, this.$.type.name), this._getOptionValue, "hooks.".concat(hookName));
        var defaultHook = this._useDefaultPT(this._getOptionValue, "hooks.".concat(hookName));
        selfHook === null || selfHook === void 0 || selfHook();
        defaultHook === null || defaultHook === void 0 || defaultHook();
      }
    }, "_hook"),
    _mergeProps: /* @__PURE__ */ __name(function _mergeProps2(fn) {
      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key2 = 1; _key2 < _len; _key2++) {
        args[_key2 - 1] = arguments[_key2];
      }
      return isFunction$5(fn) ? fn.apply(void 0, args) : mergeProps.apply(void 0, args);
    }, "_mergeProps"),
    _loadStyles: /* @__PURE__ */ __name(function _loadStyles2() {
      var _this2 = this;
      var _load = /* @__PURE__ */ __name(function _load2() {
        if (!Base.isStyleNameLoaded("base")) {
          BaseStyle.loadCSS(_this2.$styleOptions);
          _this2._loadGlobalStyles();
          Base.setLoadedStyleName("base");
        }
        _this2._loadThemeStyles();
      }, "_load");
      _load();
      this._themeChangeListener(_load);
    }, "_loadStyles"),
    _loadCoreStyles: /* @__PURE__ */ __name(function _loadCoreStyles2() {
      var _this$$style, _this$$style2;
      if (!Base.isStyleNameLoaded((_this$$style = this.$style) === null || _this$$style === void 0 ? void 0 : _this$$style.name) && (_this$$style2 = this.$style) !== null && _this$$style2 !== void 0 && _this$$style2.name) {
        BaseComponentStyle$1.loadCSS(this.$styleOptions);
        this.$options.style && this.$style.loadCSS(this.$styleOptions);
        Base.setLoadedStyleName(this.$style.name);
      }
    }, "_loadCoreStyles"),
    _loadGlobalStyles: /* @__PURE__ */ __name(function _loadGlobalStyles() {
      var globalCSS = this._useGlobalPT(this._getOptionValue, "global.css", this.$params);
      isNotEmpty(globalCSS) && BaseStyle.load(globalCSS, _objectSpread$f({
        name: "global"
      }, this.$styleOptions));
    }, "_loadGlobalStyles"),
    _loadThemeStyles: /* @__PURE__ */ __name(function _loadThemeStyles2() {
      var _this$$style4, _this$$style5;
      if (this.isUnstyled) return;
      if (!config_default.isStyleNameLoaded("common")) {
        var _this$$style3, _this$$style3$getComm;
        var _ref3 = ((_this$$style3 = this.$style) === null || _this$$style3 === void 0 || (_this$$style3$getComm = _this$$style3.getCommonTheme) === null || _this$$style3$getComm === void 0 ? void 0 : _this$$style3$getComm.call(_this$$style3)) || {}, primitive = _ref3.primitive, semantic = _ref3.semantic;
        BaseStyle.load(primitive === null || primitive === void 0 ? void 0 : primitive.css, _objectSpread$f({
          name: "primitive-variables"
        }, this.$styleOptions));
        BaseStyle.load(semantic === null || semantic === void 0 ? void 0 : semantic.css, _objectSpread$f({
          name: "semantic-variables"
        }, this.$styleOptions));
        BaseStyle.loadTheme(_objectSpread$f({
          name: "global-style"
        }, this.$styleOptions));
        config_default.setLoadedStyleName("common");
      }
      if (!config_default.isStyleNameLoaded((_this$$style4 = this.$style) === null || _this$$style4 === void 0 ? void 0 : _this$$style4.name) && (_this$$style5 = this.$style) !== null && _this$$style5 !== void 0 && _this$$style5.name) {
        var _this$$style6, _this$$style6$getComp, _this$$style7, _this$$style8;
        var _ref4 = ((_this$$style6 = this.$style) === null || _this$$style6 === void 0 || (_this$$style6$getComp = _this$$style6.getComponentTheme) === null || _this$$style6$getComp === void 0 ? void 0 : _this$$style6$getComp.call(_this$$style6)) || {}, css3 = _ref4.css;
        (_this$$style7 = this.$style) === null || _this$$style7 === void 0 || _this$$style7.load(css3, _objectSpread$f({
          name: "".concat(this.$style.name, "-variables")
        }, this.$styleOptions));
        (_this$$style8 = this.$style) === null || _this$$style8 === void 0 || _this$$style8.loadTheme(_objectSpread$f({
          name: "".concat(this.$style.name, "-style")
        }, this.$styleOptions));
        config_default.setLoadedStyleName(this.$style.name);
      }
      if (!config_default.isStyleNameLoaded("layer-order")) {
        var _this$$style9, _this$$style9$getLaye;
        var layerOrder = (_this$$style9 = this.$style) === null || _this$$style9 === void 0 || (_this$$style9$getLaye = _this$$style9.getLayerOrderThemeCSS) === null || _this$$style9$getLaye === void 0 ? void 0 : _this$$style9$getLaye.call(_this$$style9);
        BaseStyle.load(layerOrder, _objectSpread$f({
          name: "layer-order",
          first: true
        }, this.$styleOptions));
        config_default.setLoadedStyleName("layer-order");
      }
    }, "_loadThemeStyles"),
    _loadScopedThemeStyles: /* @__PURE__ */ __name(function _loadScopedThemeStyles2(preset) {
      var _this$$style10, _this$$style10$getPre, _this$$style11;
      var _ref5 = ((_this$$style10 = this.$style) === null || _this$$style10 === void 0 || (_this$$style10$getPre = _this$$style10.getPresetTheme) === null || _this$$style10$getPre === void 0 ? void 0 : _this$$style10$getPre.call(_this$$style10, preset, "[".concat(this.$attrSelector, "]"))) || {}, css3 = _ref5.css;
      var scopedStyle = (_this$$style11 = this.$style) === null || _this$$style11 === void 0 ? void 0 : _this$$style11.load(css3, _objectSpread$f({
        name: "".concat(this.$attrSelector, "-").concat(this.$style.name)
      }, this.$styleOptions));
      this.scopedStyleEl = scopedStyle.el;
    }, "_loadScopedThemeStyles"),
    _unloadScopedThemeStyles: /* @__PURE__ */ __name(function _unloadScopedThemeStyles() {
      var _this$scopedStyleEl;
      (_this$scopedStyleEl = this.scopedStyleEl) === null || _this$scopedStyleEl === void 0 || (_this$scopedStyleEl = _this$scopedStyleEl.value) === null || _this$scopedStyleEl === void 0 || _this$scopedStyleEl.remove();
    }, "_unloadScopedThemeStyles"),
    _themeChangeListener: /* @__PURE__ */ __name(function _themeChangeListener2() {
      var callback = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {
      };
      Base.clearLoadedStyleNames();
      service_default.on("theme:change", callback);
    }, "_themeChangeListener"),
    _getHostInstance: /* @__PURE__ */ __name(function _getHostInstance(instance) {
      return instance ? this.$options.hostName ? instance.$.type.name === this.$options.hostName ? instance : this._getHostInstance(instance.$parentInstance) : instance.$parentInstance : void 0;
    }, "_getHostInstance"),
    _getPropValue: /* @__PURE__ */ __name(function _getPropValue(name2) {
      var _this$_getHostInstanc;
      return this[name2] || ((_this$_getHostInstanc = this._getHostInstance(this)) === null || _this$_getHostInstanc === void 0 ? void 0 : _this$_getHostInstanc[name2]);
    }, "_getPropValue"),
    _getOptionValue: /* @__PURE__ */ __name(function _getOptionValue(options4) {
      var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
      var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      return getKeyValue(options4, key, params);
    }, "_getOptionValue"),
    _getPTValue: /* @__PURE__ */ __name(function _getPTValue2() {
      var _this$$primevueConfig2;
      var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
      var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      var searchInDefaultPT = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
      var searchOut = /./g.test(key) && !!params[key.split(".")[0]];
      var _ref6 = this._getPropValue("ptOptions") || ((_this$$primevueConfig2 = this.$primevueConfig) === null || _this$$primevueConfig2 === void 0 ? void 0 : _this$$primevueConfig2.ptOptions) || {}, _ref6$mergeSections = _ref6.mergeSections, mergeSections = _ref6$mergeSections === void 0 ? true : _ref6$mergeSections, _ref6$mergeProps = _ref6.mergeProps, useMergeProps = _ref6$mergeProps === void 0 ? false : _ref6$mergeProps;
      var global2 = searchInDefaultPT ? searchOut ? this._useGlobalPT(this._getPTClassValue, key, params) : this._useDefaultPT(this._getPTClassValue, key, params) : void 0;
      var self2 = searchOut ? void 0 : this._getPTSelf(obj, this._getPTClassValue, key, _objectSpread$f(_objectSpread$f({}, params), {}, {
        global: global2 || {}
      }));
      var datasets = this._getPTDatasets(key);
      return mergeSections || !mergeSections && self2 ? useMergeProps ? this._mergeProps(useMergeProps, global2, self2, datasets) : _objectSpread$f(_objectSpread$f(_objectSpread$f({}, global2), self2), datasets) : _objectSpread$f(_objectSpread$f({}, self2), datasets);
    }, "_getPTValue"),
    _getPTSelf: /* @__PURE__ */ __name(function _getPTSelf() {
      var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key3 = 1; _key3 < _len2; _key3++) {
        args[_key3 - 1] = arguments[_key3];
      }
      return mergeProps(
        this._usePT.apply(this, [this._getPT(obj, this.$name)].concat(args)),
        // Exp; <component :pt="{}"
        this._usePT.apply(this, [this.$_attrsPT].concat(args))
        // Exp; <component :pt:[passthrough_key]:[attribute]="{value}" or <component :pt:[passthrough_key]="() =>{value}"
      );
    }, "_getPTSelf"),
    _getPTDatasets: /* @__PURE__ */ __name(function _getPTDatasets2() {
      var _this$pt4, _this$pt5;
      var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
      var datasetPrefix = "data-pc-";
      var isExtended = key === "root" && isNotEmpty((_this$pt4 = this.pt) === null || _this$pt4 === void 0 ? void 0 : _this$pt4["data-pc-section"]);
      return key !== "transition" && _objectSpread$f(_objectSpread$f({}, key === "root" && _objectSpread$f(_defineProperty$f({}, "".concat(datasetPrefix, "name"), toFlatCase(isExtended ? (_this$pt5 = this.pt) === null || _this$pt5 === void 0 ? void 0 : _this$pt5["data-pc-section"] : this.$.type.name)), isExtended && _defineProperty$f({}, "".concat(datasetPrefix, "extend"), toFlatCase(this.$.type.name)))), {}, _defineProperty$f({}, "".concat(datasetPrefix, "section"), toFlatCase(key)));
    }, "_getPTDatasets"),
    _getPTClassValue: /* @__PURE__ */ __name(function _getPTClassValue() {
      var value4 = this._getOptionValue.apply(this, arguments);
      return isString$8(value4) || isArray$5(value4) ? {
        "class": value4
      } : value4;
    }, "_getPTClassValue"),
    _getPT: /* @__PURE__ */ __name(function _getPT2(pt) {
      var _this3 = this;
      var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
      var callback = arguments.length > 2 ? arguments[2] : void 0;
      var getValue2 = /* @__PURE__ */ __name(function getValue3(value4) {
        var _ref8;
        var checkSameKey = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        var computedValue = callback ? callback(value4) : value4;
        var _key = toFlatCase(key);
        var _cKey = toFlatCase(_this3.$name);
        return (_ref8 = checkSameKey ? _key !== _cKey ? computedValue === null || computedValue === void 0 ? void 0 : computedValue[_key] : void 0 : computedValue === null || computedValue === void 0 ? void 0 : computedValue[_key]) !== null && _ref8 !== void 0 ? _ref8 : computedValue;
      }, "getValue");
      return pt !== null && pt !== void 0 && pt.hasOwnProperty("_usept") ? {
        _usept: pt["_usept"],
        originalValue: getValue2(pt.originalValue),
        value: getValue2(pt.value)
      } : getValue2(pt, true);
    }, "_getPT"),
    _usePT: /* @__PURE__ */ __name(function _usePT2(pt, callback, key, params) {
      var fn = /* @__PURE__ */ __name(function fn2(value5) {
        return callback(value5, key, params);
      }, "fn");
      if (pt !== null && pt !== void 0 && pt.hasOwnProperty("_usept")) {
        var _this$$primevueConfig3;
        var _ref9 = pt["_usept"] || ((_this$$primevueConfig3 = this.$primevueConfig) === null || _this$$primevueConfig3 === void 0 ? void 0 : _this$$primevueConfig3.ptOptions) || {}, _ref9$mergeSections = _ref9.mergeSections, mergeSections = _ref9$mergeSections === void 0 ? true : _ref9$mergeSections, _ref9$mergeProps = _ref9.mergeProps, useMergeProps = _ref9$mergeProps === void 0 ? false : _ref9$mergeProps;
        var originalValue = fn(pt.originalValue);
        var value4 = fn(pt.value);
        if (originalValue === void 0 && value4 === void 0) return void 0;
        else if (isString$8(value4)) return value4;
        else if (isString$8(originalValue)) return originalValue;
        return mergeSections || !mergeSections && value4 ? useMergeProps ? this._mergeProps(useMergeProps, originalValue, value4) : _objectSpread$f(_objectSpread$f({}, originalValue), value4) : value4;
      }
      return fn(pt);
    }, "_usePT"),
    _useGlobalPT: /* @__PURE__ */ __name(function _useGlobalPT(callback, key, params) {
      return this._usePT(this.globalPT, callback, key, params);
    }, "_useGlobalPT"),
    _useDefaultPT: /* @__PURE__ */ __name(function _useDefaultPT2(callback, key, params) {
      return this._usePT(this.defaultPT, callback, key, params);
    }, "_useDefaultPT"),
    ptm: /* @__PURE__ */ __name(function ptm() {
      var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
      var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return this._getPTValue(this.pt, key, _objectSpread$f(_objectSpread$f({}, this.$params), params));
    }, "ptm"),
    ptmi: /* @__PURE__ */ __name(function ptmi() {
      var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
      var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return mergeProps(this.$_attrsWithoutPT, this.ptm(key, params));
    }, "ptmi"),
    ptmo: /* @__PURE__ */ __name(function ptmo() {
      var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
      var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      return this._getPTValue(obj, key, _objectSpread$f({
        instance: this
      }, params), false);
    }, "ptmo"),
    cx: /* @__PURE__ */ __name(function cx() {
      var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
      var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      return !this.isUnstyled ? this._getOptionValue(this.$style.classes, key, _objectSpread$f(_objectSpread$f({}, this.$params), params)) : void 0;
    }, "cx"),
    sx: /* @__PURE__ */ __name(function sx() {
      var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
      var when = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
      var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      if (when) {
        var self2 = this._getOptionValue(this.$style.inlineStyles, key, _objectSpread$f(_objectSpread$f({}, this.$params), params));
        var base2 = this._getOptionValue(BaseComponentStyle$1.inlineStyles, key, _objectSpread$f(_objectSpread$f({}, this.$params), params));
        return [base2, self2];
      }
      return void 0;
    }, "sx")
  },
  computed: {
    globalPT: /* @__PURE__ */ __name(function globalPT() {
      var _this$$primevueConfig4, _this4 = this;
      return this._getPT((_this$$primevueConfig4 = this.$primevueConfig) === null || _this$$primevueConfig4 === void 0 ? void 0 : _this$$primevueConfig4.pt, void 0, function(value4) {
        return resolve$1(value4, {
          instance: _this4
        });
      });
    }, "globalPT"),
    defaultPT: /* @__PURE__ */ __name(function defaultPT() {
      var _this$$primevueConfig5, _this5 = this;
      return this._getPT((_this$$primevueConfig5 = this.$primevueConfig) === null || _this$$primevueConfig5 === void 0 ? void 0 : _this$$primevueConfig5.pt, void 0, function(value4) {
        return _this5._getOptionValue(value4, _this5.$name, _objectSpread$f({}, _this5.$params)) || resolve$1(value4, _objectSpread$f({}, _this5.$params));
      });
    }, "defaultPT"),
    isUnstyled: /* @__PURE__ */ __name(function isUnstyled() {
      var _this$$primevueConfig6;
      return this.unstyled !== void 0 ? this.unstyled : (_this$$primevueConfig6 = this.$primevueConfig) === null || _this$$primevueConfig6 === void 0 ? void 0 : _this$$primevueConfig6.unstyled;
    }, "isUnstyled"),
    $theme: /* @__PURE__ */ __name(function $theme() {
      var _this$$primevueConfig7;
      return (_this$$primevueConfig7 = this.$primevueConfig) === null || _this$$primevueConfig7 === void 0 ? void 0 : _this$$primevueConfig7.theme;
    }, "$theme"),
    $style: /* @__PURE__ */ __name(function $style() {
      return _objectSpread$f(_objectSpread$f({
        classes: void 0,
        inlineStyles: void 0,
        load: /* @__PURE__ */ __name(function load2() {
        }, "load"),
        loadCSS: /* @__PURE__ */ __name(function loadCSS2() {
        }, "loadCSS"),
        loadTheme: /* @__PURE__ */ __name(function loadTheme2() {
        }, "loadTheme")
      }, (this._getHostInstance(this) || {}).$style), this.$options.style);
    }, "$style"),
    $styleOptions: /* @__PURE__ */ __name(function $styleOptions() {
      var _this$$primevueConfig8;
      return {
        nonce: (_this$$primevueConfig8 = this.$primevueConfig) === null || _this$$primevueConfig8 === void 0 || (_this$$primevueConfig8 = _this$$primevueConfig8.csp) === null || _this$$primevueConfig8 === void 0 ? void 0 : _this$$primevueConfig8.nonce
      };
    }, "$styleOptions"),
    $primevueConfig: /* @__PURE__ */ __name(function $primevueConfig() {
      var _this$$primevue4;
      return (_this$$primevue4 = this.$primevue) === null || _this$$primevue4 === void 0 ? void 0 : _this$$primevue4.config;
    }, "$primevueConfig"),
    $name: /* @__PURE__ */ __name(function $name() {
      return this.$options.hostName || this.$.type.name;
    }, "$name"),
    $params: /* @__PURE__ */ __name(function $params() {
      var parentInstance = this._getHostInstance(this) || this.$parent;
      return {
        instance: this,
        props: this.$props,
        state: this.$data,
        attrs: this.$attrs,
        parent: {
          instance: parentInstance,
          props: parentInstance === null || parentInstance === void 0 ? void 0 : parentInstance.$props,
          state: parentInstance === null || parentInstance === void 0 ? void 0 : parentInstance.$data,
          attrs: parentInstance === null || parentInstance === void 0 ? void 0 : parentInstance.$attrs
        }
      };
    }, "$params"),
    $_attrsPT: /* @__PURE__ */ __name(function $_attrsPT() {
      return Object.entries(this.$attrs || {}).filter(function(_ref10) {
        var _ref11 = _slicedToArray$1(_ref10, 1), key = _ref11[0];
        return key === null || key === void 0 ? void 0 : key.startsWith("pt:");
      }).reduce(function(result, _ref12) {
        var _ref13 = _slicedToArray$1(_ref12, 2), key = _ref13[0], value4 = _ref13[1];
        var _key$split = key.split(":"), _key$split2 = _toArray(_key$split), rest = _key$split2.slice(1);
        rest === null || rest === void 0 || rest.reduce(function(currentObj, nestedKey, index2, array) {
          !currentObj[nestedKey] && (currentObj[nestedKey] = index2 === array.length - 1 ? value4 : {});
          return currentObj[nestedKey];
        }, result);
        return result;
      }, {});
    }, "$_attrsPT"),
    $_attrsWithoutPT: /* @__PURE__ */ __name(function $_attrsWithoutPT() {
      return Object.entries(this.$attrs || {}).filter(function(_ref14) {
        var _ref15 = _slicedToArray$1(_ref14, 1), key = _ref15[0];
        return !(key !== null && key !== void 0 && key.startsWith("pt:"));
      }).reduce(function(acc, _ref16) {
        var _ref17 = _slicedToArray$1(_ref16, 2), key = _ref17[0], value4 = _ref17[1];
        acc[key] = value4;
        return acc;
      }, {});
    }, "$_attrsWithoutPT"),
    $attrSelector: /* @__PURE__ */ __name(function $attrSelector() {
      return UniqueComponentId("pc");
    }, "$attrSelector")
  }
};
var theme$z = /* @__PURE__ */ __name(function theme4(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-blockui {\n    position: relative;\n}\n\n.p-blockui-mask {\n    border-radius: ".concat(dt2("blockui.border.radius"), ";\n}\n\n.p-blockui-mask.p-overlay-mask {\n    position: absolute;\n}\n\n.p-blockui-mask-document.p-overlay-mask {\n    position: fixed;\n}\n");
}, "theme");
var classes$B = {
  root: "p-blockui"
};
var BlockUIStyle = BaseStyle.extend({
  name: "blockui",
  theme: theme$z,
  classes: classes$B
});
var script$1$B = {
  name: "BaseBlockUI",
  "extends": script$_,
  props: {
    blocked: {
      type: Boolean,
      "default": false
    },
    fullScreen: {
      type: Boolean,
      "default": false
    },
    baseZIndex: {
      type: Number,
      "default": 0
    },
    autoZIndex: {
      type: Boolean,
      "default": true
    }
  },
  style: BlockUIStyle,
  provide: /* @__PURE__ */ __name(function provide2() {
    return {
      $pcBlockUI: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$Z = {
  name: "BlockUI",
  "extends": script$1$B,
  inheritAttrs: false,
  emits: ["block", "unblock"],
  mask: null,
  data: /* @__PURE__ */ __name(function data() {
    return {
      isBlocked: false
    };
  }, "data"),
  watch: {
    blocked: /* @__PURE__ */ __name(function blocked(newValue2) {
      if (newValue2 === true) this.block();
      else this.unblock();
    }, "blocked")
  },
  mounted: /* @__PURE__ */ __name(function mounted2() {
    if (this.blocked) {
      this.block();
    }
  }, "mounted"),
  methods: {
    block: /* @__PURE__ */ __name(function block2() {
      var styleClass = "p-blockui-mask p-overlay-mask p-overlay-mask-enter";
      if (this.fullScreen) {
        styleClass += " p-blockui-mask-document";
        this.mask = createElement("div", {
          style: {
            position: "fixed",
            top: "0",
            left: "0",
            width: "100%",
            height: "100%"
          },
          "class": !this.isUnstyled && styleClass,
          "p-bind": this.ptm("mask")
        });
        document.body.appendChild(this.mask);
        blockBodyScroll();
        document.activeElement.blur();
      } else {
        this.mask = createElement("div", {
          style: {
            position: "absolute",
            top: "0",
            left: "0",
            width: "100%",
            height: "100%"
          },
          "class": !this.isUnstyled && styleClass,
          "p-bind": this.ptm("mask")
        });
        this.$refs.container.appendChild(this.mask);
      }
      if (this.autoZIndex) {
        ZIndex.set("modal", this.mask, this.baseZIndex + this.$primevue.config.zIndex.modal);
      }
      this.isBlocked = true;
      this.$emit("block");
    }, "block"),
    unblock: /* @__PURE__ */ __name(function unblock() {
      var _this = this;
      !this.isUnstyled && addClass(this.mask, "p-overlay-mask-leave");
      if (hasCSSAnimation(this.mask) > 0) {
        this.mask.addEventListener("animationend", function() {
          _this.removeMask();
        });
      } else {
        this.removeMask();
      }
    }, "unblock"),
    removeMask: /* @__PURE__ */ __name(function removeMask() {
      ZIndex.clear(this.mask);
      if (this.fullScreen) {
        document.body.removeChild(this.mask);
        unblockBodyScroll();
      } else {
        var _this$$refs$container;
        (_this$$refs$container = this.$refs.container) === null || _this$$refs$container === void 0 || _this$$refs$container.removeChild(this.mask);
      }
      this.isBlocked = false;
      this.$emit("unblock");
    }, "removeMask")
  }
};
var _hoisted_1$1q = ["aria-busy"];
function render$X(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    ref: "container",
    "class": _ctx.cx("root"),
    "aria-busy": $data.isBlocked
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1$1q);
}
__name(render$X, "render$X");
script$Z.render = render$X;
var theme$y = /* @__PURE__ */ __name(function theme5(_ref) {
  var dt2 = _ref.dt;
  return '\n.p-progressspinner {\n    position: relative;\n    margin: 0 auto;\n    width: 100px;\n    height: 100px;\n    display: inline-block;\n}\n\n.p-progressspinner::before {\n    content: "";\n    display: block;\n    padding-top: 100%;\n}\n\n.p-progressspinner-spin {\n    height: 100%;\n    transform-origin: center center;\n    width: 100%;\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    margin: auto;\n    animation: p-progressspinner-rotate 2s linear infinite;\n}\n\n.p-progressspinner-circle {\n    stroke-dasharray: 89, 200;\n    stroke-dashoffset: 0;\n    stroke: '.concat(dt2("progressspinner.color.1"), ";\n    animation: p-progressspinner-dash 1.5s ease-in-out infinite, p-progressspinner-color 6s ease-in-out infinite;\n    stroke-linecap: round;\n}\n\n@keyframes p-progressspinner-rotate {\n    100% {\n        transform: rotate(360deg);\n    }\n}\n@keyframes p-progressspinner-dash {\n    0% {\n        stroke-dasharray: 1, 200;\n        stroke-dashoffset: 0;\n    }\n    50% {\n        stroke-dasharray: 89, 200;\n        stroke-dashoffset: -35px;\n    }\n    100% {\n        stroke-dasharray: 89, 200;\n        stroke-dashoffset: -124px;\n    }\n}\n@keyframes p-progressspinner-color {\n    100%,\n    0% {\n        stroke: ").concat(dt2("progressspinner.color.1"), ";\n    }\n    40% {\n        stroke: ").concat(dt2("progressspinner.color.2"), ";\n    }\n    66% {\n        stroke: ").concat(dt2("progressspinner.color.3"), ";\n    }\n    80%,\n    90% {\n        stroke: ").concat(dt2("progressspinner.color.4"), ";\n    }\n}\n");
}, "theme");
var classes$A = {
  root: "p-progressspinner",
  spin: "p-progressspinner-spin",
  circle: "p-progressspinner-circle"
};
var ProgressSpinnerStyle = BaseStyle.extend({
  name: "progressspinner",
  theme: theme$y,
  classes: classes$A
});
var script$1$A = {
  name: "BaseProgressSpinner",
  "extends": script$_,
  props: {
    strokeWidth: {
      type: String,
      "default": "2"
    },
    fill: {
      type: String,
      "default": "none"
    },
    animationDuration: {
      type: String,
      "default": "2s"
    }
  },
  style: ProgressSpinnerStyle,
  provide: /* @__PURE__ */ __name(function provide3() {
    return {
      $pcProgressSpinner: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$Y = {
  name: "ProgressSpinner",
  "extends": script$1$A,
  inheritAttrs: false,
  computed: {
    svgStyle: /* @__PURE__ */ __name(function svgStyle() {
      return {
        "animation-duration": this.animationDuration
      };
    }, "svgStyle")
  }
};
var _hoisted_1$1p = ["fill", "stroke-width"];
function render$W(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    role: "progressbar"
  }, _ctx.ptmi("root")), [(openBlock(), createElementBlock("svg", mergeProps({
    "class": _ctx.cx("spin"),
    viewBox: "25 25 50 50",
    style: $options.svgStyle
  }, _ctx.ptm("spin")), [createBaseVNode("circle", mergeProps({
    "class": _ctx.cx("circle"),
    cx: "50",
    cy: "50",
    r: "20",
    fill: _ctx.fill,
    "stroke-width": _ctx.strokeWidth,
    strokeMiterlimit: "10"
  }, _ctx.ptm("circle")), null, 16, _hoisted_1$1p)], 16))], 16);
}
__name(render$W, "render$W");
script$Y.render = render$W;
var BaseComponentStyle = BaseStyle.extend({
  name: "common"
});
var css = "\n.p-icon {\n    display: inline-block;\n    vertical-align: baseline;\n}\n\n.p-icon-spin {\n    -webkit-animation: p-icon-spin 2s infinite linear;\n    animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n    0% {\n        -webkit-transform: rotate(0deg);\n        transform: rotate(0deg);\n    }\n    100% {\n        -webkit-transform: rotate(359deg);\n        transform: rotate(359deg);\n    }\n}\n\n@keyframes p-icon-spin {\n    0% {\n        -webkit-transform: rotate(0deg);\n        transform: rotate(0deg);\n    }\n    100% {\n        -webkit-transform: rotate(359deg);\n        transform: rotate(359deg);\n    }\n}\n";
var BaseIconStyle = BaseStyle.extend({
  name: "baseicon",
  css
});
function _typeof$e(o) {
  "@babel/helpers - typeof";
  return _typeof$e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$e(o);
}
__name(_typeof$e, "_typeof$e");
function ownKeys$e(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$e, "ownKeys$e");
function _objectSpread$e(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$e(Object(t2), true).forEach(function(r2) {
      _defineProperty$e(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$e(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$e, "_objectSpread$e");
function _defineProperty$e(e2, r, t2) {
  return (r = _toPropertyKey$d(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$e, "_defineProperty$e");
function _toPropertyKey$d(t2) {
  var i2 = _toPrimitive$d(t2, "string");
  return "symbol" == _typeof$e(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$d, "_toPropertyKey$d");
function _toPrimitive$d(t2, r) {
  if ("object" != _typeof$e(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$e(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$d, "_toPrimitive$d");
var script$X = {
  name: "BaseIcon",
  "extends": script$_,
  props: {
    label: {
      type: String,
      "default": void 0
    },
    spin: {
      type: Boolean,
      "default": false
    }
  },
  style: BaseIconStyle,
  provide: /* @__PURE__ */ __name(function provide4() {
    return {
      $pcIcon: this,
      $parentInstance: this
    };
  }, "provide"),
  methods: {
    pti: /* @__PURE__ */ __name(function pti() {
      var isLabelEmpty = isEmpty$1(this.label);
      return _objectSpread$e(_objectSpread$e({}, !this.isUnstyled && {
        "class": ["p-icon", {
          "p-icon-spin": this.spin
        }]
      }), {}, {
        role: !isLabelEmpty ? "img" : void 0,
        "aria-label": !isLabelEmpty ? this.label : void 0,
        "aria-hidden": isLabelEmpty
      });
    }, "pti")
  }
};
var script$W = {
  name: "TimesIcon",
  "extends": script$X
};
var _hoisted_1$1o = /* @__PURE__ */ createBaseVNode("path", {
  d: "M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$11 = [_hoisted_1$1o];
function render$V(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$11, 16);
}
__name(render$V, "render$V");
script$W.render = render$V;
var script$V = {
  name: "WindowMaximizeIcon",
  "extends": script$X
};
var _hoisted_1$1n = /* @__PURE__ */ createBaseVNode("path", {
  "fill-rule": "evenodd",
  "clip-rule": "evenodd",
  d: "M7 14H11.8C12.3835 14 12.9431 13.7682 13.3556 13.3556C13.7682 12.9431 14 12.3835 14 11.8V2.2C14 1.61652 13.7682 1.05694 13.3556 0.644365C12.9431 0.231785 12.3835 0 11.8 0H2.2C1.61652 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V7C0 7.15913 0.063214 7.31174 0.175736 7.42426C0.288258 7.53679 0.44087 7.6 0.6 7.6C0.75913 7.6 0.911742 7.53679 1.02426 7.42426C1.13679 7.31174 1.2 7.15913 1.2 7V2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H11.8C12.0652 1.2 12.3196 1.30536 12.5071 1.49289C12.6946 1.68043 12.8 1.93478 12.8 2.2V11.8C12.8 12.0652 12.6946 12.3196 12.5071 12.5071C12.3196 12.6946 12.0652 12.8 11.8 12.8H7C6.84087 12.8 6.68826 12.8632 6.57574 12.9757C6.46321 13.0883 6.4 13.2409 6.4 13.4C6.4 13.5591 6.46321 13.7117 6.57574 13.8243C6.68826 13.9368 6.84087 14 7 14ZM9.77805 7.42192C9.89013 7.534 10.0415 7.59788 10.2 7.59995C10.3585 7.59788 10.5099 7.534 10.622 7.42192C10.7341 7.30985 10.798 7.15844 10.8 6.99995V3.94242C10.8066 3.90505 10.8096 3.86689 10.8089 3.82843C10.8079 3.77159 10.7988 3.7157 10.7824 3.6623C10.756 3.55552 10.701 3.45698 10.622 3.37798C10.5099 3.2659 10.3585 3.20202 10.2 3.19995H7.00002C6.84089 3.19995 6.68828 3.26317 6.57576 3.37569C6.46324 3.48821 6.40002 3.64082 6.40002 3.79995C6.40002 3.95908 6.46324 4.11169 6.57576 4.22422C6.68828 4.33674 6.84089 4.39995 7.00002 4.39995H8.80006L6.19997 7.00005C6.10158 7.11005 6.04718 7.25246 6.04718 7.40005C6.04718 7.54763 6.10158 7.69004 6.19997 7.80005C6.30202 7.91645 6.44561 7.98824 6.59997 8.00005C6.75432 7.98824 6.89791 7.91645 6.99997 7.80005L9.60002 5.26841V6.99995C9.6021 7.15844 9.66598 7.30985 9.77805 7.42192ZM1.4 14H3.8C4.17066 13.9979 4.52553 13.8498 4.78763 13.5877C5.04973 13.3256 5.1979 12.9707 5.2 12.6V10.2C5.1979 9.82939 5.04973 9.47452 4.78763 9.21242C4.52553 8.95032 4.17066 8.80215 3.8 8.80005H1.4C1.02934 8.80215 0.674468 8.95032 0.412371 9.21242C0.150274 9.47452 0.00210008 9.82939 0 10.2V12.6C0.00210008 12.9707 0.150274 13.3256 0.412371 13.5877C0.674468 13.8498 1.02934 13.9979 1.4 14ZM1.25858 10.0586C1.29609 10.0211 1.34696 10 1.4 10H3.8C3.85304 10 3.90391 10.0211 3.94142 10.0586C3.97893 10.0961 4 10.147 4 10.2V12.6C4 12.6531 3.97893 12.704 3.94142 12.7415C3.90391 12.779 3.85304 12.8 3.8 12.8H1.4C1.34696 12.8 1.29609 12.779 1.25858 12.7415C1.22107 12.704 1.2 12.6531 1.2 12.6V10.2C1.2 10.147 1.22107 10.0961 1.25858 10.0586Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$10 = [_hoisted_1$1n];
function render$U(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$10, 16);
}
__name(render$U, "render$U");
script$V.render = render$U;
var script$U = {
  name: "WindowMinimizeIcon",
  "extends": script$X
};
var _hoisted_1$1m = /* @__PURE__ */ createBaseVNode("path", {
  "fill-rule": "evenodd",
  "clip-rule": "evenodd",
  d: "M11.8 0H2.2C1.61652 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V7C0 7.15913 0.063214 7.31174 0.175736 7.42426C0.288258 7.53679 0.44087 7.6 0.6 7.6C0.75913 7.6 0.911742 7.53679 1.02426 7.42426C1.13679 7.31174 1.2 7.15913 1.2 7V2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H11.8C12.0652 1.2 12.3196 1.30536 12.5071 1.49289C12.6946 1.68043 12.8 1.93478 12.8 2.2V11.8C12.8 12.0652 12.6946 12.3196 12.5071 12.5071C12.3196 12.6946 12.0652 12.8 11.8 12.8H7C6.84087 12.8 6.68826 12.8632 6.57574 12.9757C6.46321 13.0883 6.4 13.2409 6.4 13.4C6.4 13.5591 6.46321 13.7117 6.57574 13.8243C6.68826 13.9368 6.84087 14 7 14H11.8C12.3835 14 12.9431 13.7682 13.3556 13.3556C13.7682 12.9431 14 12.3835 14 11.8V2.2C14 1.61652 13.7682 1.05694 13.3556 0.644365C12.9431 0.231785 12.3835 0 11.8 0ZM6.368 7.952C6.44137 7.98326 6.52025 7.99958 6.6 8H9.8C9.95913 8 10.1117 7.93678 10.2243 7.82426C10.3368 7.71174 10.4 7.55913 10.4 7.4C10.4 7.24087 10.3368 7.08826 10.2243 6.97574C10.1117 6.86321 9.95913 6.8 9.8 6.8H8.048L10.624 4.224C10.73 4.11026 10.7877 3.95982 10.7849 3.80438C10.7822 3.64894 10.7192 3.50063 10.6093 3.3907C10.4994 3.28077 10.3511 3.2178 10.1956 3.21506C10.0402 3.21232 9.88974 3.27002 9.776 3.376L7.2 5.952V4.2C7.2 4.04087 7.13679 3.88826 7.02426 3.77574C6.91174 3.66321 6.75913 3.6 6.6 3.6C6.44087 3.6 6.28826 3.66321 6.17574 3.77574C6.06321 3.88826 6 4.04087 6 4.2V7.4C6.00042 7.47975 6.01674 7.55862 6.048 7.632C6.07656 7.70442 6.11971 7.7702 6.17475 7.82524C6.2298 7.88029 6.29558 7.92344 6.368 7.952ZM1.4 8.80005H3.8C4.17066 8.80215 4.52553 8.95032 4.78763 9.21242C5.04973 9.47452 5.1979 9.82939 5.2 10.2V12.6C5.1979 12.9707 5.04973 13.3256 4.78763 13.5877C4.52553 13.8498 4.17066 13.9979 3.8 14H1.4C1.02934 13.9979 0.674468 13.8498 0.412371 13.5877C0.150274 13.3256 0.00210008 12.9707 0 12.6V10.2C0.00210008 9.82939 0.150274 9.47452 0.412371 9.21242C0.674468 8.95032 1.02934 8.80215 1.4 8.80005ZM3.94142 12.7415C3.97893 12.704 4 12.6531 4 12.6V10.2C4 10.147 3.97893 10.0961 3.94142 10.0586C3.90391 10.0211 3.85304 10 3.8 10H1.4C1.34696 10 1.29609 10.0211 1.25858 10.0586C1.22107 10.0961 1.2 10.147 1.2 10.2V12.6C1.2 12.6531 1.22107 12.704 1.25858 12.7415C1.29609 12.779 1.34696 12.8 1.4 12.8H3.8C3.85304 12.8 3.90391 12.779 3.94142 12.7415Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$$ = [_hoisted_1$1m];
function render$T(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$$, 16);
}
__name(render$T, "render$T");
script$U.render = render$T;
var script$T = {
  name: "SpinnerIcon",
  "extends": script$X
};
var _hoisted_1$1l = /* @__PURE__ */ createBaseVNode("path", {
  d: "M6.99701 14C5.85441 13.999 4.72939 13.7186 3.72012 13.1832C2.71084 12.6478 1.84795 11.8737 1.20673 10.9284C0.565504 9.98305 0.165424 8.89526 0.041387 7.75989C-0.0826496 6.62453 0.073125 5.47607 0.495122 4.4147C0.917119 3.35333 1.59252 2.4113 2.46241 1.67077C3.33229 0.930247 4.37024 0.413729 5.4857 0.166275C6.60117 -0.0811796 7.76026 -0.0520535 8.86188 0.251112C9.9635 0.554278 10.9742 1.12227 11.8057 1.90555C11.915 2.01493 11.9764 2.16319 11.9764 2.31778C11.9764 2.47236 11.915 2.62062 11.8057 2.73C11.7521 2.78503 11.688 2.82877 11.6171 2.85864C11.5463 2.8885 11.4702 2.90389 11.3933 2.90389C11.3165 2.90389 11.2404 2.8885 11.1695 2.85864C11.0987 2.82877 11.0346 2.78503 10.9809 2.73C9.9998 1.81273 8.73246 1.26138 7.39226 1.16876C6.05206 1.07615 4.72086 1.44794 3.62279 2.22152C2.52471 2.99511 1.72683 4.12325 1.36345 5.41602C1.00008 6.70879 1.09342 8.08723 1.62775 9.31926C2.16209 10.5513 3.10478 11.5617 4.29713 12.1803C5.48947 12.7989 6.85865 12.988 8.17414 12.7157C9.48963 12.4435 10.6711 11.7264 11.5196 10.6854C12.3681 9.64432 12.8319 8.34282 12.8328 7C12.8328 6.84529 12.8943 6.69692 13.0038 6.58752C13.1132 6.47812 13.2616 6.41667 13.4164 6.41667C13.5712 6.41667 13.7196 6.47812 13.8291 6.58752C13.9385 6.69692 14 6.84529 14 7C14 8.85651 13.2622 10.637 11.9489 11.9497C10.6356 13.2625 8.85432 14 6.99701 14Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$_ = [_hoisted_1$1l];
function render$S(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$_, 16);
}
__name(render$S, "render$S");
script$T.render = render$S;
var theme$x = /* @__PURE__ */ __name(function theme6(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-badge {\n    display: inline-flex;\n    border-radius: ".concat(dt2("badge.border.radius"), ";\n    align-items: center;\n    justify-content: center;\n    padding: ").concat(dt2("badge.padding"), ";\n    background: ").concat(dt2("badge.primary.background"), ";\n    color: ").concat(dt2("badge.primary.color"), ";\n    font-size: ").concat(dt2("badge.font.size"), ";\n    font-weight: ").concat(dt2("badge.font.weight"), ";\n    min-width: ").concat(dt2("badge.min.width"), ";\n    height: ").concat(dt2("badge.height"), ";\n}\n\n.p-badge-dot {\n    width: ").concat(dt2("badge.dot.size"), ";\n    min-width: ").concat(dt2("badge.dot.size"), ";\n    height: ").concat(dt2("badge.dot.size"), ";\n    border-radius: 50%;\n    padding: 0;\n}\n\n.p-badge-circle {\n    padding: 0;\n    border-radius: 50%;\n}\n\n.p-badge-secondary {\n    background: ").concat(dt2("badge.secondary.background"), ";\n    color: ").concat(dt2("badge.secondary.color"), ";\n}\n\n.p-badge-success {\n    background: ").concat(dt2("badge.success.background"), ";\n    color: ").concat(dt2("badge.success.color"), ";\n}\n\n.p-badge-info {\n    background: ").concat(dt2("badge.info.background"), ";\n    color: ").concat(dt2("badge.info.color"), ";\n}\n\n.p-badge-warn {\n    background: ").concat(dt2("badge.warn.background"), ";\n    color: ").concat(dt2("badge.warn.color"), ";\n}\n\n.p-badge-danger {\n    background: ").concat(dt2("badge.danger.background"), ";\n    color: ").concat(dt2("badge.danger.color"), ";\n}\n\n.p-badge-contrast {\n    background: ").concat(dt2("badge.contrast.background"), ";\n    color: ").concat(dt2("badge.contrast.color"), ";\n}\n\n.p-badge-sm {\n    font-size: ").concat(dt2("badge.sm.font.size"), ";\n    min-width: ").concat(dt2("badge.sm.min.width"), ";\n    height: ").concat(dt2("badge.sm.height"), ";\n}\n\n.p-badge-lg {\n    font-size: ").concat(dt2("badge.lg.font.size"), ";\n    min-width: ").concat(dt2("badge.lg.min.width"), ";\n    height: ").concat(dt2("badge.lg.height"), ";\n}\n\n.p-badge-xl {\n    font-size: ").concat(dt2("badge.xl.font.size"), ";\n    min-width: ").concat(dt2("badge.xl.min.width"), ";\n    height: ").concat(dt2("badge.xl.height"), ";\n}\n");
}, "theme");
var classes$z = {
  root: /* @__PURE__ */ __name(function root(_ref2) {
    var props = _ref2.props, instance = _ref2.instance;
    return ["p-badge p-component", {
      "p-badge-circle": isNotEmpty(props.value) && String(props.value).length === 1,
      "p-badge-dot": isEmpty$1(props.value) && !instance.$slots["default"],
      "p-badge-sm": props.size === "small",
      "p-badge-lg": props.size === "large",
      "p-badge-xl": props.size === "xlarge",
      "p-badge-info": props.severity === "info",
      "p-badge-success": props.severity === "success",
      "p-badge-warn": props.severity === "warn",
      "p-badge-danger": props.severity === "danger",
      "p-badge-secondary": props.severity === "secondary",
      "p-badge-contrast": props.severity === "contrast"
    }];
  }, "root")
};
var BadgeStyle = BaseStyle.extend({
  name: "badge",
  theme: theme$x,
  classes: classes$z
});
var script$1$z = {
  name: "BaseBadge",
  "extends": script$_,
  props: {
    value: {
      type: [String, Number],
      "default": null
    },
    severity: {
      type: String,
      "default": null
    },
    size: {
      type: String,
      "default": null
    }
  },
  style: BadgeStyle,
  provide: /* @__PURE__ */ __name(function provide5() {
    return {
      $pcBadge: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$S = {
  name: "Badge",
  "extends": script$1$z,
  inheritAttrs: false
};
function render$R(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("span", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default", {}, function() {
    return [createTextVNode(toDisplayString$1(_ctx.value), 1)];
  })], 16);
}
__name(render$R, "render$R");
script$S.render = render$R;
var theme$w = /* @__PURE__ */ __name(function theme7(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-ink {\n    display: block;\n    position: absolute;\n    background: ".concat(dt2("ripple.background"), ";\n    border-radius: 100%;\n    transform: scale(0);\n    pointer-events: none;\n}\n\n.p-ink-active {\n    animation: ripple 0.4s linear;\n}\n\n@keyframes ripple {\n    100% {\n        opacity: 0;\n        transform: scale(2.5);\n    }\n}\n");
}, "theme");
var classes$y = {
  root: "p-ink"
};
var RippleStyle = BaseStyle.extend({
  name: "ripple-directive",
  theme: theme$w,
  classes: classes$y
});
var BaseRipple = BaseDirective.extend({
  style: RippleStyle
});
function _typeof$d(o) {
  "@babel/helpers - typeof";
  return _typeof$d = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$d(o);
}
__name(_typeof$d, "_typeof$d");
function _toConsumableArray$b(r) {
  return _arrayWithoutHoles$b(r) || _iterableToArray$b(r) || _unsupportedIterableToArray$d(r) || _nonIterableSpread$b();
}
__name(_toConsumableArray$b, "_toConsumableArray$b");
function _nonIterableSpread$b() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$b, "_nonIterableSpread$b");
function _unsupportedIterableToArray$d(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$d(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$d(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$d, "_unsupportedIterableToArray$d");
function _iterableToArray$b(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$b, "_iterableToArray$b");
function _arrayWithoutHoles$b(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$d(r);
}
__name(_arrayWithoutHoles$b, "_arrayWithoutHoles$b");
function _arrayLikeToArray$d(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$d, "_arrayLikeToArray$d");
function _defineProperty$d(e2, r, t2) {
  return (r = _toPropertyKey$c(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$d, "_defineProperty$d");
function _toPropertyKey$c(t2) {
  var i2 = _toPrimitive$c(t2, "string");
  return "symbol" == _typeof$d(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$c, "_toPropertyKey$c");
function _toPrimitive$c(t2, r) {
  if ("object" != _typeof$d(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$d(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$c, "_toPrimitive$c");
var Ripple = BaseRipple.extend("ripple", {
  watch: {
    "config.ripple": /* @__PURE__ */ __name(function configRipple(newValue2) {
      if (newValue2) {
        this.createRipple(this.$host);
        this.bindEvents(this.$host);
        this.$host.setAttribute("data-pd-ripple", true);
        this.$host.style["overflow"] = "hidden";
        this.$host.style["position"] = "relative";
      } else {
        this.remove(this.$host);
        this.$host.removeAttribute("data-pd-ripple");
      }
    }, "configRipple")
  },
  unmounted: /* @__PURE__ */ __name(function unmounted3(el) {
    this.remove(el);
  }, "unmounted"),
  timeout: void 0,
  methods: {
    bindEvents: /* @__PURE__ */ __name(function bindEvents2(el) {
      el.addEventListener("mousedown", this.onMouseDown.bind(this));
    }, "bindEvents"),
    unbindEvents: /* @__PURE__ */ __name(function unbindEvents2(el) {
      el.removeEventListener("mousedown", this.onMouseDown.bind(this));
    }, "unbindEvents"),
    createRipple: /* @__PURE__ */ __name(function createRipple(el) {
      var ink = createElement("span", _defineProperty$d(_defineProperty$d({
        role: "presentation",
        "aria-hidden": true,
        "data-p-ink": true,
        "data-p-ink-active": false,
        "class": !this.isUnstyled() && this.cx("root"),
        onAnimationEnd: this.onAnimationEnd.bind(this)
      }, this.$attrSelector, ""), "p-bind", this.ptm("root")));
      el.appendChild(ink);
      this.$el = ink;
    }, "createRipple"),
    remove: /* @__PURE__ */ __name(function remove3(el) {
      var ink = this.getInk(el);
      if (ink) {
        this.$host.style["overflow"] = "";
        this.$host.style["position"] = "";
        this.unbindEvents(el);
        ink.removeEventListener("animationend", this.onAnimationEnd);
        ink.remove();
      }
    }, "remove"),
    onMouseDown: /* @__PURE__ */ __name(function onMouseDown(event) {
      var _this = this;
      var target = event.currentTarget;
      var ink = this.getInk(target);
      if (!ink || getComputedStyle(ink, null).display === "none") {
        return;
      }
      !this.isUnstyled() && removeClass(ink, "p-ink-active");
      ink.setAttribute("data-p-ink-active", "false");
      if (!getHeight(ink) && !getWidth(ink)) {
        var d = Math.max(getOuterWidth(target), getOuterHeight(target));
        ink.style.height = d + "px";
        ink.style.width = d + "px";
      }
      var offset = getOffset(target);
      var x2 = event.pageX - offset.left + document.body.scrollTop - getWidth(ink) / 2;
      var y2 = event.pageY - offset.top + document.body.scrollLeft - getHeight(ink) / 2;
      ink.style.top = y2 + "px";
      ink.style.left = x2 + "px";
      !this.isUnstyled() && addClass(ink, "p-ink-active");
      ink.setAttribute("data-p-ink-active", "true");
      this.timeout = setTimeout(function() {
        if (ink) {
          !_this.isUnstyled() && removeClass(ink, "p-ink-active");
          ink.setAttribute("data-p-ink-active", "false");
        }
      }, 401);
    }, "onMouseDown"),
    onAnimationEnd: /* @__PURE__ */ __name(function onAnimationEnd(event) {
      if (this.timeout) {
        clearTimeout(this.timeout);
      }
      !this.isUnstyled() && removeClass(event.currentTarget, "p-ink-active");
      event.currentTarget.setAttribute("data-p-ink-active", "false");
    }, "onAnimationEnd"),
    getInk: /* @__PURE__ */ __name(function getInk(el) {
      return el && el.children ? _toConsumableArray$b(el.children).find(function(child) {
        return getAttribute(child, "data-pc-name") === "ripple";
      }) : void 0;
    }, "getInk")
  }
});
function _typeof$c(o) {
  "@babel/helpers - typeof";
  return _typeof$c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$c(o);
}
__name(_typeof$c, "_typeof$c");
function _defineProperty$c(e2, r, t2) {
  return (r = _toPropertyKey$b(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$c, "_defineProperty$c");
function _toPropertyKey$b(t2) {
  var i2 = _toPrimitive$b(t2, "string");
  return "symbol" == _typeof$c(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$b, "_toPropertyKey$b");
function _toPrimitive$b(t2, r) {
  if ("object" != _typeof$c(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$c(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$b, "_toPrimitive$b");
var theme$v = /* @__PURE__ */ __name(function theme8(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-button {\n    display: inline-flex;\n    cursor: pointer;\n    user-select: none;\n    align-items: center;\n    justify-content: center;\n    overflow: hidden;\n    position: relative;\n    color: ".concat(dt2("button.primary.color"), ";\n    background: ").concat(dt2("button.primary.background"), ";\n    border: 1px solid ").concat(dt2("button.primary.border.color"), ";\n    padding: ").concat(dt2("button.padding.y"), " ").concat(dt2("button.padding.x"), ";\n    font-size: 1rem;\n    font-family: inherit;\n    font-feature-settings: inherit;\n    transition: background ").concat(dt2("button.transition.duration"), ", color ").concat(dt2("button.transition.duration"), ", border-color ").concat(dt2("button.transition.duration"), ",\n            outline-color ").concat(dt2("button.transition.duration"), ", box-shadow ").concat(dt2("button.transition.duration"), ";\n    border-radius: ").concat(dt2("button.border.radius"), ";\n    outline-color: transparent;\n    gap: ").concat(dt2("button.gap"), ";\n}\n\n.p-button:disabled {\n    cursor: default;\n}\n\n.p-button-icon-right {\n    order: 1;\n}\n\n.p-button-icon-bottom {\n    order: 2;\n}\n\n.p-button-icon-only {\n    width: ").concat(dt2("button.icon.only.width"), ";\n    padding-left: 0;\n    padding-right: 0;\n    gap: 0;\n}\n\n.p-button-icon-only.p-button-rounded {\n    border-radius: 50%;\n    height: ").concat(dt2("button.icon.only.width"), ";\n}\n\n.p-button-icon-only .p-button-label {\n    visibility: hidden;\n    width: 0;\n}\n\n.p-button-sm {\n    font-size: ").concat(dt2("button.sm.font.size"), ";\n    padding: ").concat(dt2("button.sm.padding.y"), " ").concat(dt2("button.sm.padding.x"), ";\n}\n\n.p-button-sm .p-button-icon {\n    font-size: ").concat(dt2("button.sm.font.size"), ";\n}\n\n.p-button-lg {\n    font-size: ").concat(dt2("button.lg.font.size"), ";\n    padding: ").concat(dt2("button.lg.padding.y"), " ").concat(dt2("button.lg.padding.x"), ";\n}\n\n.p-button-lg .p-button-icon {\n    font-size: ").concat(dt2("button.lg.font.size"), ";\n}\n\n.p-button-vertical {\n    flex-direction: column;\n}\n\n.p-button-label {\n    font-weight: ").concat(dt2("button.label.font.weight"), ";\n}\n\n.p-button-fluid {\n    width: 100%;\n}\n\n.p-button-fluid.p-button-icon-only {\n    width: ").concat(dt2("button.icon.only.width"), ";\n}\n\n.p-button:not(:disabled):hover {\n    background: ").concat(dt2("button.primary.hover.background"), ";\n    border: 1px solid ").concat(dt2("button.primary.hover.border.color"), ";\n    color: ").concat(dt2("button.primary.hover.color"), ";\n}\n\n.p-button:not(:disabled):active {\n    background: ").concat(dt2("button.primary.active.background"), ";\n    border: 1px solid ").concat(dt2("button.primary.active.border.color"), ";\n    color: ").concat(dt2("button.primary.active.color"), ";\n}\n\n.p-button:focus-visible {\n    box-shadow: ").concat(dt2("button.primary.focus.ring.shadow"), ";\n    outline: ").concat(dt2("button.focus.ring.width"), " ").concat(dt2("button.focus.ring.style"), " ").concat(dt2("button.primary.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("button.focus.ring.offset"), ";\n}\n\n.p-button .p-badge {\n    min-width: ").concat(dt2("button.badge.size"), ";\n    height: ").concat(dt2("button.badge.size"), ";\n    line-height: ").concat(dt2("button.badge.size"), ";\n}\n\n.p-button-raised {\n    box-shadow: ").concat(dt2("button.raised.shadow"), ";\n}\n\n.p-button-rounded {\n    border-radius: ").concat(dt2("button.rounded.border.radius"), ";\n}\n\n.p-button-secondary {\n    background: ").concat(dt2("button.secondary.background"), ";\n    border: 1px solid ").concat(dt2("button.secondary.border.color"), ";\n    color: ").concat(dt2("button.secondary.color"), ";\n}\n\n.p-button-secondary:not(:disabled):hover {\n    background: ").concat(dt2("button.secondary.hover.background"), ";\n    border: 1px solid ").concat(dt2("button.secondary.hover.border.color"), ";\n    color: ").concat(dt2("button.secondary.hover.color"), ";\n}\n\n.p-button-secondary:not(:disabled):active {\n    background: ").concat(dt2("button.secondary.active.background"), ";\n    border: 1px solid ").concat(dt2("button.secondary.active.border.color"), ";\n    color: ").concat(dt2("button.secondary.active.color"), ";\n}\n\n.p-button-secondary:focus-visible {\n    outline-color: ").concat(dt2("button.secondary.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("button.secondary.focus.ring.shadow"), ";\n}\n\n.p-button-success {\n    background: ").concat(dt2("button.success.background"), ";\n    border: 1px solid ").concat(dt2("button.success.border.color"), ";\n    color: ").concat(dt2("button.success.color"), ";\n}\n\n.p-button-success:not(:disabled):hover {\n    background: ").concat(dt2("button.success.hover.background"), ";\n    border: 1px solid ").concat(dt2("button.success.hover.border.color"), ";\n    color: ").concat(dt2("button.success.hover.color"), ";\n}\n\n.p-button-success:not(:disabled):active {\n    background: ").concat(dt2("button.success.active.background"), ";\n    border: 1px solid ").concat(dt2("button.success.active.border.color"), ";\n    color: ").concat(dt2("button.success.active.color"), ";\n}\n\n.p-button-success:focus-visible {\n    outline-color: ").concat(dt2("button.success.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("button.success.focus.ring.shadow"), ";\n}\n\n.p-button-info {\n    background: ").concat(dt2("button.info.background"), ";\n    border: 1px solid ").concat(dt2("button.info.border.color"), ";\n    color: ").concat(dt2("button.info.color"), ";\n}\n\n.p-button-info:not(:disabled):hover {\n    background: ").concat(dt2("button.info.hover.background"), ";\n    border: 1px solid ").concat(dt2("button.info.hover.border.color"), ";\n    color: ").concat(dt2("button.info.hover.color"), ";\n}\n\n.p-button-info:not(:disabled):active {\n    background: ").concat(dt2("button.info.active.background"), ";\n    border: 1px solid ").concat(dt2("button.info.active.border.color"), ";\n    color: ").concat(dt2("button.info.active.color"), ";\n}\n\n.p-button-info:focus-visible {\n    outline-color: ").concat(dt2("button.info.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("button.info.focus.ring.shadow"), ";\n}\n\n.p-button-warn {\n    background: ").concat(dt2("button.warn.background"), ";\n    border: 1px solid ").concat(dt2("button.warn.border.color"), ";\n    color: ").concat(dt2("button.warn.color"), ";\n}\n\n.p-button-warn:not(:disabled):hover {\n    background: ").concat(dt2("button.warn.hover.background"), ";\n    border: 1px solid ").concat(dt2("button.warn.hover.border.color"), ";\n    color: ").concat(dt2("button.warn.hover.color"), ";\n}\n\n.p-button-warn:not(:disabled):active {\n    background: ").concat(dt2("button.warn.active.background"), ";\n    border: 1px solid ").concat(dt2("button.warn.active.border.color"), ";\n    color: ").concat(dt2("button.warn.active.color"), ";\n}\n\n.p-button-warn:focus-visible {\n    outline-color: ").concat(dt2("button.warn.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("button.warn.focus.ring.shadow"), ";\n}\n\n.p-button-help {\n    background: ").concat(dt2("button.help.background"), ";\n    border: 1px solid ").concat(dt2("button.help.border.color"), ";\n    color: ").concat(dt2("button.help.color"), ";\n}\n\n.p-button-help:not(:disabled):hover {\n    background: ").concat(dt2("button.help.hover.background"), ";\n    border: 1px solid ").concat(dt2("button.help.hover.border.color"), ";\n    color: ").concat(dt2("button.help.hover.color"), ";\n}\n\n.p-button-help:not(:disabled):active {\n    background: ").concat(dt2("button.help.active.background"), ";\n    border: 1px solid ").concat(dt2("button.help.active.border.color"), ";\n    color: ").concat(dt2("button.help.active.color"), ";\n}\n\n.p-button-help:focus-visible {\n    outline-color: ").concat(dt2("button.help.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("button.help.focus.ring.shadow"), ";\n}\n\n.p-button-danger {\n    background: ").concat(dt2("button.danger.background"), ";\n    border: 1px solid ").concat(dt2("button.danger.border.color"), ";\n    color: ").concat(dt2("button.danger.color"), ";\n}\n\n.p-button-danger:not(:disabled):hover {\n    background: ").concat(dt2("button.danger.hover.background"), ";\n    border: 1px solid ").concat(dt2("button.danger.hover.border.color"), ";\n    color: ").concat(dt2("button.danger.hover.color"), ";\n}\n\n.p-button-danger:not(:disabled):active {\n    background: ").concat(dt2("button.danger.active.background"), ";\n    border: 1px solid ").concat(dt2("button.danger.active.border.color"), ";\n    color: ").concat(dt2("button.danger.active.color"), ";\n}\n\n.p-button-danger:focus-visible {\n    outline-color: ").concat(dt2("button.danger.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("button.danger.focus.ring.shadow"), ";\n}\n\n.p-button-contrast {\n    background: ").concat(dt2("button.contrast.background"), ";\n    border: 1px solid ").concat(dt2("button.contrast.border.color"), ";\n    color: ").concat(dt2("button.contrast.color"), ";\n}\n\n.p-button-contrast:not(:disabled):hover {\n    background: ").concat(dt2("button.contrast.hover.background"), ";\n    border: 1px solid ").concat(dt2("button.contrast.hover.border.color"), ";\n    color: ").concat(dt2("button.contrast.hover.color"), ";\n}\n\n.p-button-contrast:not(:disabled):active {\n    background: ").concat(dt2("button.contrast.active.background"), ";\n    border: 1px solid ").concat(dt2("button.contrast.active.border.color"), ";\n    color: ").concat(dt2("button.contrast.active.color"), ";\n}\n\n.p-button-contrast:focus-visible {\n    outline-color: ").concat(dt2("button.contrast.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("button.contrast.focus.ring.shadow"), ";\n}\n\n.p-button-outlined {\n    background: transparent;\n    border-color: ").concat(dt2("button.outlined.primary.border.color"), ";\n    color: ").concat(dt2("button.outlined.primary.color"), ";\n}\n\n.p-button-outlined:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.primary.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.primary.border.color"), ";\n    color: ").concat(dt2("button.outlined.primary.color"), ";\n}\n\n.p-button-outlined:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.primary.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.primary.border.color"), ";\n    color: ").concat(dt2("button.outlined.primary.color"), ";\n}\n\n.p-button-outlined.p-button-secondary {\n    border-color: ").concat(dt2("button.outlined.secondary.border.color"), ";\n    color: ").concat(dt2("button.outlined.secondary.color"), ";\n}\n\n.p-button-outlined.p-button-secondary:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.secondary.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.secondary.border.color"), ";\n    color: ").concat(dt2("button.outlined.secondary.color"), ";\n}\n\n.p-button-outlined.p-button-secondary:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.secondary.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.secondary.border.color"), ";\n    color: ").concat(dt2("button.outlined.secondary.color"), ";\n}\n\n.p-button-outlined.p-button-success {\n    border-color: ").concat(dt2("button.outlined.success.border.color"), ";\n    color: ").concat(dt2("button.outlined.success.color"), ";\n}\n\n.p-button-outlined.p-button-success:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.success.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.success.border.color"), ";\n    color: ").concat(dt2("button.outlined.success.color"), ";\n}\n\n.p-button-outlined.p-button-success:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.success.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.success.border.color"), ";\n    color: ").concat(dt2("button.outlined.success.color"), ";\n}\n\n.p-button-outlined.p-button-info {\n    border-color: ").concat(dt2("button.outlined.info.border.color"), ";\n    color: ").concat(dt2("button.outlined.info.color"), ";\n}\n\n.p-button-outlined.p-button-info:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.info.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.info.border.color"), ";\n    color: ").concat(dt2("button.outlined.info.color"), ";\n}\n\n.p-button-outlined.p-button-info:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.info.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.info.border.color"), ";\n    color: ").concat(dt2("button.outlined.info.color"), ";\n}\n\n.p-button-outlined.p-button-warn {\n    border-color: ").concat(dt2("button.outlined.warn.border.color"), ";\n    color: ").concat(dt2("button.outlined.warn.color"), ";\n}\n\n.p-button-outlined.p-button-warn:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.warn.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.warn.border.color"), ";\n    color: ").concat(dt2("button.outlined.warn.color"), ";\n}\n\n.p-button-outlined.p-button-warn:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.warn.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.warn.border.color"), ";\n    color: ").concat(dt2("button.outlined.warn.color"), ";\n}\n\n.p-button-outlined.p-button-help {\n    border-color: ").concat(dt2("button.outlined.help.border.color"), ";\n    color: ").concat(dt2("button.outlined.help.color"), ";\n}\n\n.p-button-outlined.p-button-help:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.help.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.help.border.color"), ";\n    color: ").concat(dt2("button.outlined.help.color"), ";\n}\n\n.p-button-outlined.p-button-help:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.help.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.help.border.color"), ";\n    color: ").concat(dt2("button.outlined.help.color"), ";\n}\n\n.p-button-outlined.p-button-danger {\n    border-color: ").concat(dt2("button.outlined.danger.border.color"), ";\n    color: ").concat(dt2("button.outlined.danger.color"), ";\n}\n\n.p-button-outlined.p-button-danger:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.danger.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.danger.border.color"), ";\n    color: ").concat(dt2("button.outlined.danger.color"), ";\n}\n\n.p-button-outlined.p-button-danger:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.danger.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.danger.border.color"), ";\n    color: ").concat(dt2("button.outlined.danger.color"), ";\n}\n\n.p-button-outlined.p-button-contrast {\n    border-color: ").concat(dt2("button.outlined.contrast.border.color"), ";\n    color: ").concat(dt2("button.outlined.contrast.color"), ";\n}\n\n.p-button-outlined.p-button-contrast:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.contrast.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.contrast.border.color"), ";\n    color: ").concat(dt2("button.outlined.contrast.color"), ";\n}\n\n.p-button-outlined.p-button-contrast:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.contrast.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.contrast.border.color"), ";\n    color: ").concat(dt2("button.outlined.contrast.color"), ";\n}\n\n.p-button-outlined.p-button-plain {\n    border-color: ").concat(dt2("button.outlined.plain.border.color"), ";\n    color: ").concat(dt2("button.outlined.plain.color"), ";\n}\n\n.p-button-outlined.p-button-plain:not(:disabled):hover {\n    background: ").concat(dt2("button.outlined.plain.hover.background"), ";\n    border-color: ").concat(dt2("button.outlined.plain.border.color"), ";\n    color: ").concat(dt2("button.outlined.plain.color"), ";\n}\n\n.p-button-outlined.p-button-plain:not(:disabled):active {\n    background: ").concat(dt2("button.outlined.plain.active.background"), ";\n    border-color: ").concat(dt2("button.outlined.plain.border.color"), ";\n    color: ").concat(dt2("button.outlined.plain.color"), ";\n}\n\n.p-button-text {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.text.primary.color"), ";\n}\n\n.p-button-text:not(:disabled):hover {\n    background: ").concat(dt2("button.text.primary.hover.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.primary.color"), ";\n}\n\n.p-button-text:not(:disabled):active {\n    background: ").concat(dt2("button.text.primary.active.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.primary.color"), ";\n}\n\n.p-button-text.p-button-secondary {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.text.secondary.color"), ";\n}\n\n.p-button-text.p-button-secondary:not(:disabled):hover {\n    background: ").concat(dt2("button.text.secondary.hover.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.secondary.color"), ";\n}\n\n.p-button-text.p-button-secondary:not(:disabled):active {\n    background: ").concat(dt2("button.text.secondary.active.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.secondary.color"), ";\n}\n\n.p-button-text.p-button-success {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.text.success.color"), ";\n}\n\n.p-button-text.p-button-success:not(:disabled):hover {\n    background: ").concat(dt2("button.text.success.hover.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.success.color"), ";\n}\n\n.p-button-text.p-button-success:not(:disabled):active {\n    background: ").concat(dt2("button.text.success.active.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.success.color"), ";\n}\n\n.p-button-text.p-button-info {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.text.info.color"), ";\n}\n\n.p-button-text.p-button-info:not(:disabled):hover {\n    background: ").concat(dt2("button.text.info.hover.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.info.color"), ";\n}\n\n.p-button-text.p-button-info:not(:disabled):active {\n    background: ").concat(dt2("button.text.info.active.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.info.color"), ";\n}\n\n.p-button-text.p-button-warn {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.text.warn.color"), ";\n}\n\n.p-button-text.p-button-warn:not(:disabled):hover {\n    background: ").concat(dt2("button.text.warn.hover.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.warn.color"), ";\n}\n\n.p-button-text.p-button-warn:not(:disabled):active {\n    background: ").concat(dt2("button.text.warn.active.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.warn.color"), ";\n}\n\n.p-button-text.p-button-help {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.text.help.color"), ";\n}\n\n.p-button-text.p-button-help:not(:disabled):hover {\n    background: ").concat(dt2("button.text.help.hover.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.help.color"), ";\n}\n\n.p-button-text.p-button-help:not(:disabled):active {\n    background: ").concat(dt2("button.text.help.active.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.help.color"), ";\n}\n\n.p-button-text.p-button-danger {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.text.danger.color"), ";\n}\n\n.p-button-text.p-button-danger:not(:disabled):hover {\n    background: ").concat(dt2("button.text.danger.hover.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.danger.color"), ";\n}\n\n.p-button-text.p-button-danger:not(:disabled):active {\n    background: ").concat(dt2("button.text.danger.active.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.danger.color"), ";\n}\n\n.p-button-text.p-button-plain {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.text.plain.color"), ";\n}\n\n.p-button-text.p-button-plain:not(:disabled):hover {\n    background: ").concat(dt2("button.text.plain.hover.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.plain.color"), ";\n}\n\n.p-button-text.p-button-plain:not(:disabled):active {\n    background: ").concat(dt2("button.text.plain.active.background"), ";\n    border-color: transparent;\n    color: ").concat(dt2("button.text.plain.color"), ";\n}\n\n.p-button-link {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.link.color"), ";\n}\n\n.p-button-link:not(:disabled):hover {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.link.hover.color"), ";\n}\n\n.p-button-link:not(:disabled):hover .p-button-label {\n    text-decoration: underline;\n}\n\n.p-button-link:not(:disabled):active {\n    background: transparent;\n    border-color: transparent;\n    color: ").concat(dt2("button.link.active.color"), ";\n}\n");
}, "theme");
var classes$x = {
  root: /* @__PURE__ */ __name(function root2(_ref2) {
    var instance = _ref2.instance, props = _ref2.props;
    return ["p-button p-component", _defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c({
      "p-button-icon-only": instance.hasIcon && !props.label && !props.badge,
      "p-button-vertical": (props.iconPos === "top" || props.iconPos === "bottom") && props.label,
      "p-button-loading": props.loading,
      "p-button-link": props.link
    }, "p-button-".concat(props.severity), props.severity), "p-button-raised", props.raised), "p-button-rounded", props.rounded), "p-button-text", props.text), "p-button-outlined", props.outlined), "p-button-sm", props.size === "small"), "p-button-lg", props.size === "large"), "p-button-plain", props.plain), "p-button-fluid", instance.hasFluid)];
  }, "root"),
  loadingIcon: "p-button-loading-icon",
  icon: /* @__PURE__ */ __name(function icon2(_ref4) {
    var props = _ref4.props;
    return ["p-button-icon", _defineProperty$c({}, "p-button-icon-".concat(props.iconPos), props.label)];
  }, "icon"),
  label: "p-button-label"
};
var ButtonStyle = BaseStyle.extend({
  name: "button",
  theme: theme$v,
  classes: classes$x
});
var script$1$y = {
  name: "BaseButton",
  "extends": script$_,
  props: {
    label: {
      type: String,
      "default": null
    },
    icon: {
      type: String,
      "default": null
    },
    iconPos: {
      type: String,
      "default": "left"
    },
    iconClass: {
      type: String,
      "default": null
    },
    badge: {
      type: String,
      "default": null
    },
    badgeClass: {
      type: String,
      "default": null
    },
    badgeSeverity: {
      type: String,
      "default": "secondary"
    },
    loading: {
      type: Boolean,
      "default": false
    },
    loadingIcon: {
      type: String,
      "default": void 0
    },
    as: {
      type: [String, Object],
      "default": "BUTTON"
    },
    asChild: {
      type: Boolean,
      "default": false
    },
    link: {
      type: Boolean,
      "default": false
    },
    severity: {
      type: String,
      "default": null
    },
    raised: {
      type: Boolean,
      "default": false
    },
    rounded: {
      type: Boolean,
      "default": false
    },
    text: {
      type: Boolean,
      "default": false
    },
    outlined: {
      type: Boolean,
      "default": false
    },
    size: {
      type: String,
      "default": null
    },
    plain: {
      type: Boolean,
      "default": false
    },
    fluid: {
      type: Boolean,
      "default": null
    }
  },
  style: ButtonStyle,
  provide: /* @__PURE__ */ __name(function provide6() {
    return {
      $pcButton: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$R = {
  name: "Button",
  "extends": script$1$y,
  inheritAttrs: false,
  inject: {
    $pcFluid: {
      "default": null
    }
  },
  methods: {
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions(key) {
      var _ptm = key === "root" ? this.ptmi : this.ptm;
      return _ptm(key, {
        context: {
          disabled: this.disabled
        }
      });
    }, "getPTOptions")
  },
  computed: {
    disabled: /* @__PURE__ */ __name(function disabled() {
      return this.$attrs.disabled || this.$attrs.disabled === "" || this.loading;
    }, "disabled"),
    defaultAriaLabel: /* @__PURE__ */ __name(function defaultAriaLabel() {
      return this.label ? this.label + (this.badge ? " " + this.badge : "") : this.$attrs.ariaLabel;
    }, "defaultAriaLabel"),
    hasIcon: /* @__PURE__ */ __name(function hasIcon() {
      return this.icon || this.$slots.icon;
    }, "hasIcon"),
    attrs: /* @__PURE__ */ __name(function attrs2() {
      return mergeProps(this.asAttrs, this.a11yAttrs, this.getPTOptions("root"));
    }, "attrs"),
    asAttrs: /* @__PURE__ */ __name(function asAttrs() {
      return this.as === "BUTTON" ? {
        type: "button",
        disabled: this.disabled
      } : void 0;
    }, "asAttrs"),
    a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs() {
      return {
        "aria-label": this.defaultAriaLabel,
        "data-pc-name": "button",
        "data-p-disabled": this.disabled,
        "data-p-severity": this.severity
      };
    }, "a11yAttrs"),
    hasFluid: /* @__PURE__ */ __name(function hasFluid() {
      return isEmpty$1(this.fluid) ? !!this.$pcFluid : this.fluid;
    }, "hasFluid")
  },
  components: {
    SpinnerIcon: script$T,
    Badge: script$S
  },
  directives: {
    ripple: Ripple
  }
};
function render$Q(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
  var _component_Badge = resolveComponent("Badge");
  var _directive_ripple = resolveDirective("ripple");
  return !_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({
    key: 0,
    "class": _ctx.cx("root")
  }, $options.attrs), {
    "default": withCtx(function() {
      return [renderSlot(_ctx.$slots, "default", {}, function() {
        return [_ctx.loading ? renderSlot(_ctx.$slots, "loadingicon", {
          key: 0,
          "class": normalizeClass([_ctx.cx("loadingIcon"), _ctx.cx("icon")])
        }, function() {
          return [_ctx.loadingIcon ? (openBlock(), createElementBlock("span", mergeProps({
            key: 0,
            "class": [_ctx.cx("loadingIcon"), _ctx.cx("icon"), _ctx.loadingIcon]
          }, _ctx.ptm("loadingIcon")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
            key: 1,
            "class": [_ctx.cx("loadingIcon"), _ctx.cx("icon")],
            spin: ""
          }, _ctx.ptm("loadingIcon")), null, 16, ["class"]))];
        }) : renderSlot(_ctx.$slots, "icon", {
          key: 1,
          "class": normalizeClass([_ctx.cx("icon")])
        }, function() {
          return [_ctx.icon ? (openBlock(), createElementBlock("span", mergeProps({
            key: 0,
            "class": [_ctx.cx("icon"), _ctx.icon, _ctx.iconClass]
          }, _ctx.ptm("icon")), null, 16)) : createCommentVNode("", true)];
        }), createBaseVNode("span", mergeProps({
          "class": _ctx.cx("label")
        }, _ctx.ptm("label")), toDisplayString$1(_ctx.label || " "), 17), _ctx.badge ? (openBlock(), createBlock(_component_Badge, mergeProps({
          key: 2,
          value: _ctx.badge,
          "class": _ctx.badgeClass,
          severity: _ctx.badgeSeverity,
          unstyled: _ctx.unstyled
        }, _ctx.ptm("pcBadge")), null, 16, ["value", "class", "severity", "unstyled"])) : createCommentVNode("", true)];
      })];
    }),
    _: 3
  }, 16, ["class"])), [[_directive_ripple]]) : renderSlot(_ctx.$slots, "default", {
    key: 1,
    "class": normalizeClass(_ctx.cx("root")),
    a11yAttrs: $options.a11yAttrs
  });
}
__name(render$Q, "render$Q");
script$R.render = render$Q;
var FocusTrapStyle = BaseStyle.extend({
  name: "focustrap-directive"
});
var BaseFocusTrap = BaseDirective.extend({
  style: FocusTrapStyle
});
function _typeof$b(o) {
  "@babel/helpers - typeof";
  return _typeof$b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$b(o);
}
__name(_typeof$b, "_typeof$b");
function ownKeys$d(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$d, "ownKeys$d");
function _objectSpread$d(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$d(Object(t2), true).forEach(function(r2) {
      _defineProperty$b(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$d(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$d, "_objectSpread$d");
function _defineProperty$b(e2, r, t2) {
  return (r = _toPropertyKey$a(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$b, "_defineProperty$b");
function _toPropertyKey$a(t2) {
  var i2 = _toPrimitive$a(t2, "string");
  return "symbol" == _typeof$b(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$a, "_toPropertyKey$a");
function _toPrimitive$a(t2, r) {
  if ("object" != _typeof$b(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$b(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$a, "_toPrimitive$a");
var FocusTrap = BaseFocusTrap.extend("focustrap", {
  mounted: /* @__PURE__ */ __name(function mounted3(el, binding) {
    var _ref = binding.value || {}, disabled2 = _ref.disabled;
    if (!disabled2) {
      this.createHiddenFocusableElements(el, binding);
      this.bind(el, binding);
      this.autoElementFocus(el, binding);
    }
    el.setAttribute("data-pd-focustrap", true);
    this.$el = el;
  }, "mounted"),
  updated: /* @__PURE__ */ __name(function updated3(el, binding) {
    var _ref2 = binding.value || {}, disabled2 = _ref2.disabled;
    disabled2 && this.unbind(el);
  }, "updated"),
  unmounted: /* @__PURE__ */ __name(function unmounted4(el) {
    this.unbind(el);
  }, "unmounted"),
  methods: {
    getComputedSelector: /* @__PURE__ */ __name(function getComputedSelector(selector) {
      return ':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(selector !== null && selector !== void 0 ? selector : "");
    }, "getComputedSelector"),
    bind: /* @__PURE__ */ __name(function bind2(el, binding) {
      var _this = this;
      var _ref3 = binding.value || {}, onFocusIn = _ref3.onFocusIn, onFocusOut = _ref3.onFocusOut;
      el.$_pfocustrap_mutationobserver = new MutationObserver(function(mutationList) {
        mutationList.forEach(function(mutation) {
          if (mutation.type === "childList" && !el.contains(document.activeElement)) {
            var _findNextFocusableElement = /* @__PURE__ */ __name(function findNextFocusableElement(_el) {
              var focusableElement = isFocusableElement(_el) ? isFocusableElement(_el, _this.getComputedSelector(el.$_pfocustrap_focusableselector)) ? _el : getFirstFocusableElement(el, _this.getComputedSelector(el.$_pfocustrap_focusableselector)) : getFirstFocusableElement(_el);
              return isNotEmpty(focusableElement) ? focusableElement : _el.nextSibling && _findNextFocusableElement(_el.nextSibling);
            }, "findNextFocusableElement");
            focus$1(_findNextFocusableElement(mutation.nextSibling));
          }
        });
      });
      el.$_pfocustrap_mutationobserver.disconnect();
      el.$_pfocustrap_mutationobserver.observe(el, {
        childList: true
      });
      el.$_pfocustrap_focusinlistener = function(event) {
        return onFocusIn && onFocusIn(event);
      };
      el.$_pfocustrap_focusoutlistener = function(event) {
        return onFocusOut && onFocusOut(event);
      };
      el.addEventListener("focusin", el.$_pfocustrap_focusinlistener);
      el.addEventListener("focusout", el.$_pfocustrap_focusoutlistener);
    }, "bind"),
    unbind: /* @__PURE__ */ __name(function unbind(el) {
      el.$_pfocustrap_mutationobserver && el.$_pfocustrap_mutationobserver.disconnect();
      el.$_pfocustrap_focusinlistener && el.removeEventListener("focusin", el.$_pfocustrap_focusinlistener) && (el.$_pfocustrap_focusinlistener = null);
      el.$_pfocustrap_focusoutlistener && el.removeEventListener("focusout", el.$_pfocustrap_focusoutlistener) && (el.$_pfocustrap_focusoutlistener = null);
    }, "unbind"),
    autoFocus: /* @__PURE__ */ __name(function autoFocus(options4) {
      this.autoElementFocus(this.$el, {
        value: _objectSpread$d(_objectSpread$d({}, options4), {}, {
          autoFocus: true
        })
      });
    }, "autoFocus"),
    autoElementFocus: /* @__PURE__ */ __name(function autoElementFocus(el, binding) {
      var _ref4 = binding.value || {}, _ref4$autoFocusSelect = _ref4.autoFocusSelector, autoFocusSelector = _ref4$autoFocusSelect === void 0 ? "" : _ref4$autoFocusSelect, _ref4$firstFocusableS = _ref4.firstFocusableSelector, firstFocusableSelector = _ref4$firstFocusableS === void 0 ? "" : _ref4$firstFocusableS, _ref4$autoFocus = _ref4.autoFocus, autoFocus2 = _ref4$autoFocus === void 0 ? false : _ref4$autoFocus;
      var focusableElement = getFirstFocusableElement(el, "[autofocus]".concat(this.getComputedSelector(autoFocusSelector)));
      autoFocus2 && !focusableElement && (focusableElement = getFirstFocusableElement(el, this.getComputedSelector(firstFocusableSelector)));
      focus$1(focusableElement);
    }, "autoElementFocus"),
    onFirstHiddenElementFocus: /* @__PURE__ */ __name(function onFirstHiddenElementFocus(event) {
      var _this$$el;
      var currentTarget = event.currentTarget, relatedTarget = event.relatedTarget;
      var focusableElement = relatedTarget === currentTarget.$_pfocustrap_lasthiddenfocusableelement || !((_this$$el = this.$el) !== null && _this$$el !== void 0 && _this$$el.contains(relatedTarget)) ? getFirstFocusableElement(currentTarget.parentElement, this.getComputedSelector(currentTarget.$_pfocustrap_focusableselector)) : currentTarget.$_pfocustrap_lasthiddenfocusableelement;
      focus$1(focusableElement);
    }, "onFirstHiddenElementFocus"),
    onLastHiddenElementFocus: /* @__PURE__ */ __name(function onLastHiddenElementFocus(event) {
      var _this$$el2;
      var currentTarget = event.currentTarget, relatedTarget = event.relatedTarget;
      var focusableElement = relatedTarget === currentTarget.$_pfocustrap_firsthiddenfocusableelement || !((_this$$el2 = this.$el) !== null && _this$$el2 !== void 0 && _this$$el2.contains(relatedTarget)) ? getLastFocusableElement(currentTarget.parentElement, this.getComputedSelector(currentTarget.$_pfocustrap_focusableselector)) : currentTarget.$_pfocustrap_firsthiddenfocusableelement;
      focus$1(focusableElement);
    }, "onLastHiddenElementFocus"),
    createHiddenFocusableElements: /* @__PURE__ */ __name(function createHiddenFocusableElements(el, binding) {
      var _this2 = this;
      var _ref5 = binding.value || {}, _ref5$tabIndex = _ref5.tabIndex, tabIndex = _ref5$tabIndex === void 0 ? 0 : _ref5$tabIndex, _ref5$firstFocusableS = _ref5.firstFocusableSelector, firstFocusableSelector = _ref5$firstFocusableS === void 0 ? "" : _ref5$firstFocusableS, _ref5$lastFocusableSe = _ref5.lastFocusableSelector, lastFocusableSelector = _ref5$lastFocusableSe === void 0 ? "" : _ref5$lastFocusableSe;
      var createFocusableElement = /* @__PURE__ */ __name(function createFocusableElement2(onFocus7) {
        return createElement("span", {
          "class": "p-hidden-accessible p-hidden-focusable",
          tabIndex,
          role: "presentation",
          "aria-hidden": true,
          "data-p-hidden-accessible": true,
          "data-p-hidden-focusable": true,
          onFocus: onFocus7 === null || onFocus7 === void 0 ? void 0 : onFocus7.bind(_this2)
        });
      }, "createFocusableElement");
      var firstFocusableElement = createFocusableElement(this.onFirstHiddenElementFocus);
      var lastFocusableElement = createFocusableElement(this.onLastHiddenElementFocus);
      firstFocusableElement.$_pfocustrap_lasthiddenfocusableelement = lastFocusableElement;
      firstFocusableElement.$_pfocustrap_focusableselector = firstFocusableSelector;
      firstFocusableElement.setAttribute("data-pc-section", "firstfocusableelement");
      lastFocusableElement.$_pfocustrap_firsthiddenfocusableelement = firstFocusableElement;
      lastFocusableElement.$_pfocustrap_focusableselector = lastFocusableSelector;
      lastFocusableElement.setAttribute("data-pc-section", "lastfocusableelement");
      el.prepend(firstFocusableElement);
      el.append(lastFocusableElement);
    }, "createHiddenFocusableElements")
  }
});
var script$Q = {
  name: "Portal",
  props: {
    appendTo: {
      type: [String, Object],
      "default": "body"
    },
    disabled: {
      type: Boolean,
      "default": false
    }
  },
  data: /* @__PURE__ */ __name(function data2() {
    return {
      mounted: false
    };
  }, "data"),
  mounted: /* @__PURE__ */ __name(function mounted4() {
    this.mounted = isClient$1();
  }, "mounted"),
  computed: {
    inline: /* @__PURE__ */ __name(function inline2() {
      return this.disabled || this.appendTo === "self";
    }, "inline")
  }
};
function render$P(_ctx, _cache, $props, $setup, $data, $options) {
  return $options.inline ? renderSlot(_ctx.$slots, "default", {
    key: 0
  }) : $data.mounted ? (openBlock(), createBlock(Teleport, {
    key: 1,
    to: $props.appendTo
  }, [renderSlot(_ctx.$slots, "default")], 8, ["to"])) : createCommentVNode("", true);
}
__name(render$P, "render$P");
script$Q.render = render$P;
var theme$u = /* @__PURE__ */ __name(function theme9(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-dialog {\n    max-height: 90%;\n    transform: scale(1);\n    border-radius: ".concat(dt2("dialog.border.radius"), ";\n    box-shadow: ").concat(dt2("dialog.shadow"), ";\n    background: ").concat(dt2("dialog.background"), ";\n    border: 1px solid ").concat(dt2("dialog.border.color"), ";\n    color: ").concat(dt2("dialog.color"), ";\n}\n\n.p-dialog-content {\n    overflow-y: auto;\n    padding: ").concat(dt2("dialog.content.padding"), ";\n}\n\n.p-dialog-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    flex-shrink: 0;\n    padding: ").concat(dt2("dialog.header.padding"), ";\n}\n\n.p-dialog-title {\n    font-weight: ").concat(dt2("dialog.title.font.weight"), ";\n    font-size: ").concat(dt2("dialog.title.font.size"), ";\n}\n\n.p-dialog-footer {\n    flex-shrink: 0;\n    padding: ").concat(dt2("dialog.footer.padding"), ";\n    display: flex;\n    justify-content: flex-end;\n    gap: ").concat(dt2("dialog.footer.gap"), ";\n}\n\n.p-dialog-header-actions {\n    display: flex;\n    align-items: center;\n    gap: ").concat(dt2("dialog.header.gap"), ";\n}\n.p-dialog-enter-active {\n    transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n\n.p-dialog-leave-active {\n    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n    opacity: 0;\n    transform: scale(0.7);\n}\n\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n    margin: 0.75rem;\n    transform: translate3d(0px, 0px, 0px);\n}\n\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n    transition: all 0.3s ease-out;\n}\n\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n    transform: translate3d(0px, -100%, 0px);\n}\n\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n    transform: translate3d(0px, 100%, 0px);\n}\n\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n    transform: translate3d(-100%, 0px, 0px);\n}\n\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n    transform: translate3d(100%, 0px, 0px);\n}\n\n.p-dialog-maximized {\n    width: 100vw !important;\n    height: 100vh !important;\n    top: 0px !important;\n    left: 0px !important;\n    max-height: 100%;\n    height: 100%;\n    border-radius: 0;\n}\n\n.p-dialog-maximized .p-dialog-content {\n    flex-grow: 1;\n}\n");
}, "theme");
var inlineStyles$3 = {
  mask: /* @__PURE__ */ __name(function mask(_ref2) {
    var position3 = _ref2.position, modal = _ref2.modal;
    return {
      position: "fixed",
      height: "100%",
      width: "100%",
      left: 0,
      top: 0,
      display: "flex",
      justifyContent: position3 === "left" || position3 === "topleft" || position3 === "bottomleft" ? "flex-start" : position3 === "right" || position3 === "topright" || position3 === "bottomright" ? "flex-end" : "center",
      alignItems: position3 === "top" || position3 === "topleft" || position3 === "topright" ? "flex-start" : position3 === "bottom" || position3 === "bottomleft" || position3 === "bottomright" ? "flex-end" : "center",
      pointerEvents: modal ? "auto" : "none"
    };
  }, "mask"),
  root: {
    display: "flex",
    flexDirection: "column",
    pointerEvents: "auto"
  }
};
var classes$w = {
  mask: /* @__PURE__ */ __name(function mask2(_ref3) {
    var props = _ref3.props;
    var positions = ["left", "right", "top", "topleft", "topright", "bottom", "bottomleft", "bottomright"];
    var pos2 = positions.find(function(item3) {
      return item3 === props.position;
    });
    return ["p-dialog-mask", {
      "p-overlay-mask p-overlay-mask-enter": props.modal
    }, pos2 ? "p-dialog-".concat(pos2) : ""];
  }, "mask"),
  root: /* @__PURE__ */ __name(function root3(_ref4) {
    var props = _ref4.props, instance = _ref4.instance;
    return ["p-dialog p-component", {
      "p-dialog-maximized": props.maximizable && instance.maximized
    }];
  }, "root"),
  header: "p-dialog-header",
  title: "p-dialog-title",
  headerActions: "p-dialog-header-actions",
  pcMaximizeButton: "p-dialog-maximize-button",
  pcCloseButton: "p-dialog-close-button",
  content: "p-dialog-content",
  footer: "p-dialog-footer"
};
var DialogStyle = BaseStyle.extend({
  name: "dialog",
  theme: theme$u,
  classes: classes$w,
  inlineStyles: inlineStyles$3
});
var script$1$x = {
  name: "BaseDialog",
  "extends": script$_,
  props: {
    header: {
      type: null,
      "default": null
    },
    footer: {
      type: null,
      "default": null
    },
    visible: {
      type: Boolean,
      "default": false
    },
    modal: {
      type: Boolean,
      "default": null
    },
    contentStyle: {
      type: null,
      "default": null
    },
    contentClass: {
      type: String,
      "default": null
    },
    contentProps: {
      type: null,
      "default": null
    },
    maximizable: {
      type: Boolean,
      "default": false
    },
    dismissableMask: {
      type: Boolean,
      "default": false
    },
    closable: {
      type: Boolean,
      "default": true
    },
    closeOnEscape: {
      type: Boolean,
      "default": true
    },
    showHeader: {
      type: Boolean,
      "default": true
    },
    blockScroll: {
      type: Boolean,
      "default": false
    },
    baseZIndex: {
      type: Number,
      "default": 0
    },
    autoZIndex: {
      type: Boolean,
      "default": true
    },
    position: {
      type: String,
      "default": "center"
    },
    breakpoints: {
      type: Object,
      "default": null
    },
    draggable: {
      type: Boolean,
      "default": true
    },
    keepInViewport: {
      type: Boolean,
      "default": true
    },
    minX: {
      type: Number,
      "default": 0
    },
    minY: {
      type: Number,
      "default": 0
    },
    appendTo: {
      type: [String, Object],
      "default": "body"
    },
    closeIcon: {
      type: String,
      "default": void 0
    },
    maximizeIcon: {
      type: String,
      "default": void 0
    },
    minimizeIcon: {
      type: String,
      "default": void 0
    },
    closeButtonProps: {
      type: Object,
      "default": /* @__PURE__ */ __name(function _default2() {
        return {
          severity: "secondary",
          text: true,
          rounded: true
        };
      }, "_default")
    },
    maximizeButtonProps: {
      type: Object,
      "default": /* @__PURE__ */ __name(function _default3() {
        return {
          severity: "secondary",
          text: true,
          rounded: true
        };
      }, "_default")
    },
    _instance: null
  },
  style: DialogStyle,
  provide: /* @__PURE__ */ __name(function provide7() {
    return {
      $pcDialog: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$P = {
  name: "Dialog",
  "extends": script$1$x,
  inheritAttrs: false,
  emits: ["update:visible", "show", "hide", "after-hide", "maximize", "unmaximize", "dragend"],
  provide: /* @__PURE__ */ __name(function provide8() {
    var _this = this;
    return {
      dialogRef: computed(function() {
        return _this._instance;
      })
    };
  }, "provide"),
  data: /* @__PURE__ */ __name(function data3() {
    return {
      id: this.$attrs.id,
      containerVisible: this.visible,
      maximized: false,
      focusableMax: null,
      focusableClose: null,
      target: null
    };
  }, "data"),
  watch: {
    "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue2) {
      this.id = newValue2 || UniqueComponentId();
    }, "$attrsId")
  },
  documentKeydownListener: null,
  container: null,
  mask: null,
  content: null,
  headerContainer: null,
  footerContainer: null,
  maximizableButton: null,
  closeButton: null,
  styleElement: null,
  dragging: null,
  documentDragListener: null,
  documentDragEndListener: null,
  lastPageX: null,
  lastPageY: null,
  maskMouseDownTarget: null,
  updated: /* @__PURE__ */ __name(function updated4() {
    if (this.visible) {
      this.containerVisible = this.visible;
    }
  }, "updated"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() {
    this.unbindDocumentState();
    this.unbindGlobalListeners();
    this.destroyStyle();
    if (this.mask && this.autoZIndex) {
      ZIndex.clear(this.mask);
    }
    this.container = null;
    this.mask = null;
  }, "beforeUnmount"),
  mounted: /* @__PURE__ */ __name(function mounted5() {
    this.id = this.id || UniqueComponentId();
    if (this.breakpoints) {
      this.createStyle();
    }
  }, "mounted"),
  methods: {
    close: /* @__PURE__ */ __name(function close2() {
      this.$emit("update:visible", false);
    }, "close"),
    onBeforeEnter: /* @__PURE__ */ __name(function onBeforeEnter(el) {
      el.setAttribute(this.attributeSelector, "");
    }, "onBeforeEnter"),
    onEnter: /* @__PURE__ */ __name(function onEnter() {
      this.$emit("show");
      this.target = document.activeElement;
      this.enableDocumentSettings();
      this.bindGlobalListeners();
      if (this.autoZIndex) {
        ZIndex.set("modal", this.mask, this.baseZIndex + this.$primevue.config.zIndex.modal);
      }
    }, "onEnter"),
    onAfterEnter: /* @__PURE__ */ __name(function onAfterEnter() {
      this.focus();
    }, "onAfterEnter"),
    onBeforeLeave: /* @__PURE__ */ __name(function onBeforeLeave() {
      if (this.modal) {
        !this.isUnstyled && addClass(this.mask, "p-overlay-mask-leave");
      }
    }, "onBeforeLeave"),
    onLeave: /* @__PURE__ */ __name(function onLeave() {
      this.$emit("hide");
      focus$1(this.target);
      this.target = null;
      this.focusableClose = null;
      this.focusableMax = null;
    }, "onLeave"),
    onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave() {
      if (this.autoZIndex) {
        ZIndex.clear(this.mask);
      }
      this.containerVisible = false;
      this.unbindDocumentState();
      this.unbindGlobalListeners();
      this.$emit("after-hide");
    }, "onAfterLeave"),
    onMaskMouseDown: /* @__PURE__ */ __name(function onMaskMouseDown(event) {
      this.maskMouseDownTarget = event.target;
    }, "onMaskMouseDown"),
    onMaskMouseUp: /* @__PURE__ */ __name(function onMaskMouseUp() {
      if (this.dismissableMask && this.modal && this.mask === this.maskMouseDownTarget) {
        this.close();
      }
    }, "onMaskMouseUp"),
    focus: /* @__PURE__ */ __name(function focus$1$1() {
      var findFocusableElement = /* @__PURE__ */ __name(function findFocusableElement2(container) {
        return container && container.querySelector("[autofocus]");
      }, "findFocusableElement");
      var focusTarget = this.$slots.footer && findFocusableElement(this.footerContainer);
      if (!focusTarget) {
        focusTarget = this.$slots.header && findFocusableElement(this.headerContainer);
        if (!focusTarget) {
          focusTarget = this.$slots["default"] && findFocusableElement(this.content);
          if (!focusTarget) {
            if (this.maximizable) {
              this.focusableMax = true;
              focusTarget = this.maximizableButton;
            } else {
              this.focusableClose = true;
              focusTarget = this.closeButton;
            }
          }
        }
      }
      if (focusTarget) {
        focus$1(focusTarget, {
          focusVisible: true
        });
      }
    }, "focus$1$1"),
    maximize: /* @__PURE__ */ __name(function maximize(event) {
      if (this.maximized) {
        this.maximized = false;
        this.$emit("unmaximize", event);
      } else {
        this.maximized = true;
        this.$emit("maximize", event);
      }
      if (!this.modal) {
        this.maximized ? blockBodyScroll() : unblockBodyScroll();
      }
    }, "maximize"),
    enableDocumentSettings: /* @__PURE__ */ __name(function enableDocumentSettings() {
      if (this.modal || !this.modal && this.blockScroll || this.maximizable && this.maximized) {
        blockBodyScroll();
      }
    }, "enableDocumentSettings"),
    unbindDocumentState: /* @__PURE__ */ __name(function unbindDocumentState() {
      if (this.modal || !this.modal && this.blockScroll || this.maximizable && this.maximized) {
        unblockBodyScroll();
      }
    }, "unbindDocumentState"),
    onKeyDown: /* @__PURE__ */ __name(function onKeyDown2(event) {
      if (event.code === "Escape" && this.closeOnEscape) {
        this.close();
      }
    }, "onKeyDown"),
    bindDocumentKeyDownListener: /* @__PURE__ */ __name(function bindDocumentKeyDownListener() {
      if (!this.documentKeydownListener) {
        this.documentKeydownListener = this.onKeyDown.bind(this);
        window.document.addEventListener("keydown", this.documentKeydownListener);
      }
    }, "bindDocumentKeyDownListener"),
    unbindDocumentKeyDownListener: /* @__PURE__ */ __name(function unbindDocumentKeyDownListener() {
      if (this.documentKeydownListener) {
        window.document.removeEventListener("keydown", this.documentKeydownListener);
        this.documentKeydownListener = null;
      }
    }, "unbindDocumentKeyDownListener"),
    containerRef: /* @__PURE__ */ __name(function containerRef(el) {
      this.container = el;
    }, "containerRef"),
    maskRef: /* @__PURE__ */ __name(function maskRef(el) {
      this.mask = el;
    }, "maskRef"),
    contentRef: /* @__PURE__ */ __name(function contentRef(el) {
      this.content = el;
    }, "contentRef"),
    headerContainerRef: /* @__PURE__ */ __name(function headerContainerRef(el) {
      this.headerContainer = el;
    }, "headerContainerRef"),
    footerContainerRef: /* @__PURE__ */ __name(function footerContainerRef(el) {
      this.footerContainer = el;
    }, "footerContainerRef"),
    maximizableRef: /* @__PURE__ */ __name(function maximizableRef(el) {
      this.maximizableButton = el ? el.$el : void 0;
    }, "maximizableRef"),
    closeButtonRef: /* @__PURE__ */ __name(function closeButtonRef(el) {
      this.closeButton = el ? el.$el : void 0;
    }, "closeButtonRef"),
    createStyle: /* @__PURE__ */ __name(function createStyle() {
      if (!this.styleElement && !this.isUnstyled) {
        var _this$$primevue;
        this.styleElement = document.createElement("style");
        this.styleElement.type = "text/css";
        setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
        document.head.appendChild(this.styleElement);
        var innerHTML = "";
        for (var breakpoint in this.breakpoints) {
          innerHTML += "\n                        @media screen and (max-width: ".concat(breakpoint, ") {\n                            .p-dialog[").concat(this.attributeSelector, "] {\n                                width: ").concat(this.breakpoints[breakpoint], " !important;\n                            }\n                        }\n                    ");
        }
        this.styleElement.innerHTML = innerHTML;
      }
    }, "createStyle"),
    destroyStyle: /* @__PURE__ */ __name(function destroyStyle() {
      if (this.styleElement) {
        document.head.removeChild(this.styleElement);
        this.styleElement = null;
      }
    }, "destroyStyle"),
    initDrag: /* @__PURE__ */ __name(function initDrag(event) {
      if (event.target.closest("div").getAttribute("data-pc-section") === "headeractions") {
        return;
      }
      if (this.draggable) {
        this.dragging = true;
        this.lastPageX = event.pageX;
        this.lastPageY = event.pageY;
        this.container.style.margin = "0";
        document.body.setAttribute("data-p-unselectable-text", "true");
        !this.isUnstyled && addStyle(document.body, {
          "user-select": "none"
        });
      }
    }, "initDrag"),
    bindGlobalListeners: /* @__PURE__ */ __name(function bindGlobalListeners() {
      if (this.draggable) {
        this.bindDocumentDragListener();
        this.bindDocumentDragEndListener();
      }
      if (this.closeOnEscape && this.closable) {
        this.bindDocumentKeyDownListener();
      }
    }, "bindGlobalListeners"),
    unbindGlobalListeners: /* @__PURE__ */ __name(function unbindGlobalListeners() {
      this.unbindDocumentDragListener();
      this.unbindDocumentDragEndListener();
      this.unbindDocumentKeyDownListener();
    }, "unbindGlobalListeners"),
    bindDocumentDragListener: /* @__PURE__ */ __name(function bindDocumentDragListener() {
      var _this2 = this;
      this.documentDragListener = function(event) {
        if (_this2.dragging) {
          var width2 = getOuterWidth(_this2.container);
          var height = getOuterHeight(_this2.container);
          var deltaX = event.pageX - _this2.lastPageX;
          var deltaY = event.pageY - _this2.lastPageY;
          var offset = _this2.container.getBoundingClientRect();
          var leftPos = offset.left + deltaX;
          var topPos = offset.top + deltaY;
          var viewport = getViewport();
          var containerComputedStyle = getComputedStyle(_this2.container);
          var marginLeft = parseFloat(containerComputedStyle.marginLeft);
          var marginTop = parseFloat(containerComputedStyle.marginTop);
          _this2.container.style.position = "fixed";
          if (_this2.keepInViewport) {
            if (leftPos >= _this2.minX && leftPos + width2 < viewport.width) {
              _this2.lastPageX = event.pageX;
              _this2.container.style.left = leftPos - marginLeft + "px";
            }
            if (topPos >= _this2.minY && topPos + height < viewport.height) {
              _this2.lastPageY = event.pageY;
              _this2.container.style.top = topPos - marginTop + "px";
            }
          } else {
            _this2.lastPageX = event.pageX;
            _this2.container.style.left = leftPos - marginLeft + "px";
            _this2.lastPageY = event.pageY;
            _this2.container.style.top = topPos - marginTop + "px";
          }
        }
      };
      window.document.addEventListener("mousemove", this.documentDragListener);
    }, "bindDocumentDragListener"),
    unbindDocumentDragListener: /* @__PURE__ */ __name(function unbindDocumentDragListener() {
      if (this.documentDragListener) {
        window.document.removeEventListener("mousemove", this.documentDragListener);
        this.documentDragListener = null;
      }
    }, "unbindDocumentDragListener"),
    bindDocumentDragEndListener: /* @__PURE__ */ __name(function bindDocumentDragEndListener() {
      var _this3 = this;
      this.documentDragEndListener = function(event) {
        if (_this3.dragging) {
          _this3.dragging = false;
          document.body.removeAttribute("data-p-unselectable-text");
          !_this3.isUnstyled && (document.body.style["user-select"] = "");
          _this3.$emit("dragend", event);
        }
      };
      window.document.addEventListener("mouseup", this.documentDragEndListener);
    }, "bindDocumentDragEndListener"),
    unbindDocumentDragEndListener: /* @__PURE__ */ __name(function unbindDocumentDragEndListener() {
      if (this.documentDragEndListener) {
        window.document.removeEventListener("mouseup", this.documentDragEndListener);
        this.documentDragEndListener = null;
      }
    }, "unbindDocumentDragEndListener")
  },
  computed: {
    maximizeIconComponent: /* @__PURE__ */ __name(function maximizeIconComponent() {
      return this.maximized ? this.minimizeIcon ? "span" : "WindowMinimizeIcon" : this.maximizeIcon ? "span" : "WindowMaximizeIcon";
    }, "maximizeIconComponent"),
    ariaLabelledById: /* @__PURE__ */ __name(function ariaLabelledById() {
      return this.header != null || this.$attrs["aria-labelledby"] !== null ? this.id + "_header" : null;
    }, "ariaLabelledById"),
    closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0;
    }, "closeAriaLabel"),
    attributeSelector: /* @__PURE__ */ __name(function attributeSelector() {
      return UniqueComponentId();
    }, "attributeSelector")
  },
  directives: {
    ripple: Ripple,
    focustrap: FocusTrap
  },
  components: {
    Button: script$R,
    Portal: script$Q,
    WindowMinimizeIcon: script$U,
    WindowMaximizeIcon: script$V,
    TimesIcon: script$W
  }
};
function _typeof$a(o) {
  "@babel/helpers - typeof";
  return _typeof$a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$a(o);
}
__name(_typeof$a, "_typeof$a");
function ownKeys$c(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$c, "ownKeys$c");
function _objectSpread$c(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$c(Object(t2), true).forEach(function(r2) {
      _defineProperty$a(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$c(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$c, "_objectSpread$c");
function _defineProperty$a(e2, r, t2) {
  return (r = _toPropertyKey$9(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$a, "_defineProperty$a");
function _toPropertyKey$9(t2) {
  var i2 = _toPrimitive$9(t2, "string");
  return "symbol" == _typeof$a(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$9, "_toPropertyKey$9");
function _toPrimitive$9(t2, r) {
  if ("object" != _typeof$a(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$a(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$9, "_toPrimitive$9");
var _hoisted_1$1k = ["aria-labelledby", "aria-modal"];
var _hoisted_2$Z = ["id"];
function render$O(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_Button = resolveComponent("Button");
  var _component_Portal = resolveComponent("Portal");
  var _directive_focustrap = resolveDirective("focustrap");
  return openBlock(), createBlock(_component_Portal, {
    appendTo: _ctx.appendTo
  }, {
    "default": withCtx(function() {
      return [$data.containerVisible ? (openBlock(), createElementBlock("div", mergeProps({
        key: 0,
        ref: $options.maskRef,
        "class": _ctx.cx("mask"),
        style: _ctx.sx("mask", true, {
          position: _ctx.position,
          modal: _ctx.modal
        }),
        onMousedown: _cache[1] || (_cache[1] = function() {
          return $options.onMaskMouseDown && $options.onMaskMouseDown.apply($options, arguments);
        }),
        onMouseup: _cache[2] || (_cache[2] = function() {
          return $options.onMaskMouseUp && $options.onMaskMouseUp.apply($options, arguments);
        })
      }, _ctx.ptm("mask")), [createVNode(Transition, mergeProps({
        name: "p-dialog",
        onBeforeEnter: $options.onBeforeEnter,
        onEnter: $options.onEnter,
        onAfterEnter: $options.onAfterEnter,
        onBeforeLeave: $options.onBeforeLeave,
        onLeave: $options.onLeave,
        onAfterLeave: $options.onAfterLeave,
        appear: ""
      }, _ctx.ptm("transition")), {
        "default": withCtx(function() {
          return [_ctx.visible ? withDirectives((openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            ref: $options.containerRef,
            "class": _ctx.cx("root"),
            style: _ctx.sx("root"),
            role: "dialog",
            "aria-labelledby": $options.ariaLabelledById,
            "aria-modal": _ctx.modal
          }, _ctx.ptmi("root")), [_ctx.$slots.container ? renderSlot(_ctx.$slots, "container", {
            key: 0,
            closeCallback: $options.close,
            maximizeCallback: /* @__PURE__ */ __name(function maximizeCallback(event) {
              return $options.maximize(event);
            }, "maximizeCallback")
          }) : (openBlock(), createElementBlock(Fragment$1, {
            key: 1
          }, [_ctx.showHeader ? (openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            ref: $options.headerContainerRef,
            "class": _ctx.cx("header"),
            onMousedown: _cache[0] || (_cache[0] = function() {
              return $options.initDrag && $options.initDrag.apply($options, arguments);
            })
          }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header", {
            "class": normalizeClass(_ctx.cx("title"))
          }, function() {
            return [_ctx.header ? (openBlock(), createElementBlock("span", mergeProps({
              key: 0,
              id: $options.ariaLabelledById,
              "class": _ctx.cx("title")
            }, _ctx.ptm("title")), toDisplayString$1(_ctx.header), 17, _hoisted_2$Z)) : createCommentVNode("", true)];
          }), createBaseVNode("div", mergeProps({
            "class": _ctx.cx("headerActions")
          }, _ctx.ptm("headerActions")), [_ctx.maximizable ? (openBlock(), createBlock(_component_Button, mergeProps({
            key: 0,
            ref: $options.maximizableRef,
            autofocus: $data.focusableMax,
            "class": _ctx.cx("pcMaximizeButton"),
            onClick: $options.maximize,
            tabindex: _ctx.maximizable ? "0" : "-1",
            unstyled: _ctx.unstyled
          }, _ctx.maximizeButtonProps, {
            pt: _ctx.ptm("pcMaximizeButton"),
            "data-pc-group-section": "headericon"
          }), {
            icon: withCtx(function(slotProps) {
              return [renderSlot(_ctx.$slots, "maximizeicon", {
                maximized: $data.maximized
              }, function() {
                return [(openBlock(), createBlock(resolveDynamicComponent($options.maximizeIconComponent), mergeProps({
                  "class": [slotProps["class"], $data.maximized ? _ctx.minimizeIcon : _ctx.maximizeIcon]
                }, _ctx.ptm("pcMaximizeButton")["icon"]), null, 16, ["class"]))];
              })];
            }),
            _: 3
          }, 16, ["autofocus", "class", "onClick", "tabindex", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.closable ? (openBlock(), createBlock(_component_Button, mergeProps({
            key: 1,
            ref: $options.closeButtonRef,
            autofocus: $data.focusableClose,
            "class": _ctx.cx("pcCloseButton"),
            onClick: $options.close,
            "aria-label": $options.closeAriaLabel,
            unstyled: _ctx.unstyled
          }, _ctx.closeButtonProps, {
            pt: _ctx.ptm("pcCloseButton"),
            "data-pc-group-section": "headericon"
          }), {
            icon: withCtx(function(slotProps) {
              return [renderSlot(_ctx.$slots, "closeicon", {}, function() {
                return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon ? "span" : "TimesIcon"), mergeProps({
                  "class": [_ctx.closeIcon, slotProps["class"]]
                }, _ctx.ptm("pcCloseButton")["icon"]), null, 16, ["class"]))];
              })];
            }),
            _: 3
          }, 16, ["autofocus", "class", "onClick", "aria-label", "unstyled", "pt"])) : createCommentVNode("", true)], 16)], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
            ref: $options.contentRef,
            "class": [_ctx.cx("content"), _ctx.contentClass],
            style: _ctx.contentStyle
          }, _objectSpread$c(_objectSpread$c({}, _ctx.contentProps), _ctx.ptm("content"))), [renderSlot(_ctx.$slots, "default")], 16), _ctx.footer || _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({
            key: 1,
            ref: $options.footerContainerRef,
            "class": _ctx.cx("footer")
          }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer", {}, function() {
            return [createTextVNode(toDisplayString$1(_ctx.footer), 1)];
          })], 16)) : createCommentVNode("", true)], 64))], 16, _hoisted_1$1k)), [[_directive_focustrap, {
            disabled: !_ctx.modal
          }]]) : createCommentVNode("", true)];
        }),
        _: 3
      }, 16, ["onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])], 16)) : createCommentVNode("", true)];
    }),
    _: 3
  }, 8, ["appendTo"]);
}
__name(render$O, "render$O");
script$P.render = render$O;
const useDialogStore = /* @__PURE__ */ defineStore("dialog", () => {
  const dialogStack = ref([]);
  const genDialogKey = /* @__PURE__ */ __name(() => `dialog-${Math.random().toString(36).slice(2, 9)}`, "genDialogKey");
  function riseDialog(options4) {
    const dialogKey = options4.key;
    const index2 = dialogStack.value.findIndex((d) => d.key === dialogKey);
    if (index2 !== -1) {
      const dialogs = dialogStack.value.splice(index2, 1);
      dialogStack.value.push(...dialogs);
    }
  }
  __name(riseDialog, "riseDialog");
  function closeDialog(options4) {
    if (!options4) {
      dialogStack.value.pop();
      return;
    }
    const dialogKey = options4.key;
    const index2 = dialogStack.value.findIndex((d) => d.key === dialogKey);
    if (index2 === -1) {
      return;
    }
    dialogStack.value.splice(index2, 1);
  }
  __name(closeDialog, "closeDialog");
  function createDialog(options4) {
    if (dialogStack.value.length >= 10) {
      dialogStack.value.shift();
    }
    const dialog = {
      key: options4.key,
      visible: true,
      title: options4.title,
      headerComponent: options4.headerComponent ? markRaw(options4.headerComponent) : void 0,
      component: markRaw(options4.component),
      contentProps: { ...options4.props },
      dialogComponentProps: {
        maximizable: false,
        modal: true,
        closable: true,
        closeOnEscape: true,
        dismissableMask: true,
        ...options4.dialogComponentProps,
        maximized: false,
        onMaximize: /* @__PURE__ */ __name(() => {
          dialog.dialogComponentProps.maximized = true;
        }, "onMaximize"),
        onUnmaximize: /* @__PURE__ */ __name(() => {
          dialog.dialogComponentProps.maximized = false;
        }, "onUnmaximize"),
        onAfterHide: /* @__PURE__ */ __name(() => {
          options4.dialogComponentProps?.onClose?.();
          closeDialog(dialog);
        }, "onAfterHide"),
        pt: {
          root: {
            onMousedown: /* @__PURE__ */ __name(() => {
              riseDialog(dialog);
            }, "onMousedown")
          }
        }
      }
    };
    dialogStack.value.push(dialog);
    return dialog;
  }
  __name(createDialog, "createDialog");
  function showDialog(options4) {
    const dialogKey = options4.key || genDialogKey();
    let dialog = dialogStack.value.find((d) => d.key === dialogKey);
    if (dialog) {
      dialog.visible = true;
      riseDialog(dialog);
    } else {
      dialog = createDialog({ ...options4, key: dialogKey });
    }
    return dialog;
  }
  __name(showDialog, "showDialog");
  return {
    dialogStack,
    riseDialog,
    showDialog,
    closeDialog
  };
});
const _hoisted_1$1j = ["id"];
const _sfc_main$Z = /* @__PURE__ */ defineComponent({
  __name: "GlobalDialog",
  setup(__props) {
    const dialogStore = useDialogStore();
    const primevue = usePrimeVue();
    const baseZIndex = computed(() => {
      return primevue?.config?.zIndex?.modal ?? 1100;
    });
    onMounted(() => {
      const mask3 = document.createElement("div");
      ZIndex.set("model", mask3, baseZIndex.value);
    });
    return (_ctx, _cache) => {
      return openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(dialogStore).dialogStack, (item3, index2) => {
        return openBlock(), createBlock(unref(script$P), mergeProps({
          key: item3.key,
          visible: item3.visible,
          "onUpdate:visible": /* @__PURE__ */ __name(($event) => item3.visible = $event, "onUpdate:visible"),
          class: "global-dialog",
          ref_for: true
        }, item3.dialogComponentProps, {
          "auto-z-index": false,
          "pt:mask:style": { zIndex: baseZIndex.value + index2 + 1 },
          "aria-labelledby": item3.key
        }), {
          header: withCtx(() => [
            item3.headerComponent ? (openBlock(), createBlock(resolveDynamicComponent(item3.headerComponent), {
              key: 0,
              id: item3.key
            }, null, 8, ["id"])) : (openBlock(), createElementBlock("h3", {
              key: 1,
              id: item3.key
            }, toDisplayString$1(item3.title || " "), 9, _hoisted_1$1j))
          ]),
          default: withCtx(() => [
            (openBlock(), createBlock(resolveDynamicComponent(item3.component), mergeProps({ ref_for: true }, item3.contentProps, {
              maximized: item3.dialogComponentProps.maximized
            }), null, 16, ["maximized"]))
          ]),
          _: 2
        }, 1040, ["visible", "onUpdate:visible", "pt:mask:style", "aria-labelledby"]);
      }), 128);
    };
  }
});
const config$1 = {
  app_title: "ComfyUI",
  app_version: "1.6.18"
};
/*!
  * shared v9.13.1
  * (c) 2024 kazuya kawaguchi
  * Released under the MIT License.
  */
const inBrowser = typeof window !== "undefined";
let mark;
let measure;
if (false) {
  const perf2 = inBrowser && window.performance;
  if (perf2 && perf2.mark && perf2.measure && perf2.clearMarks && // @ts-ignore browser compat
  perf2.clearMeasures) {
    mark = /* @__PURE__ */ __name((tag) => {
      perf2.mark(tag);
    }, "mark");
    measure = /* @__PURE__ */ __name((name2, startTag, endTag) => {
      perf2.measure(name2, startTag, endTag);
      perf2.clearMarks(startTag);
      perf2.clearMarks(endTag);
    }, "measure");
  }
}
const RE_ARGS$1 = /\{([0-9a-zA-Z]+)\}/g;
function format$5(message3, ...args) {
  if (args.length === 1 && isObject$3(args[0])) {
    args = args[0];
  }
  if (!args || !args.hasOwnProperty) {
    args = {};
  }
  return message3.replace(RE_ARGS$1, (match2, identifier) => {
    return args.hasOwnProperty(identifier) ? args[identifier] : "";
  });
}
__name(format$5, "format$5");
const makeSymbol = /* @__PURE__ */ __name((name2, shareable = false) => !shareable ? Symbol(name2) : Symbol.for(name2), "makeSymbol");
const generateFormatCacheKey = /* @__PURE__ */ __name((locale2, key, source) => friendlyJSONstringify({ l: locale2, k: key, s: source }), "generateFormatCacheKey");
const friendlyJSONstringify = /* @__PURE__ */ __name((json) => JSON.stringify(json).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027"), "friendlyJSONstringify");
const isNumber$3 = /* @__PURE__ */ __name((val) => typeof val === "number" && isFinite(val), "isNumber$3");
const isDate = /* @__PURE__ */ __name((val) => toTypeString(val) === "[object Date]", "isDate");
const isRegExp$2 = /* @__PURE__ */ __name((val) => toTypeString(val) === "[object RegExp]", "isRegExp$2");
const isEmptyObject$1 = /* @__PURE__ */ __name((val) => isPlainObject$1(val) && Object.keys(val).length === 0, "isEmptyObject$1");
const assign$4 = Object.assign;
let _globalThis;
const getGlobalThis = /* @__PURE__ */ __name(() => {
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
}, "getGlobalThis");
function escapeHtml$1(rawText) {
  return rawText.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
}
__name(escapeHtml$1, "escapeHtml$1");
const hasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwn$1(obj, key) {
  return hasOwnProperty.call(obj, key);
}
__name(hasOwn$1, "hasOwn$1");
const isArray$1 = Array.isArray;
const isFunction$2 = /* @__PURE__ */ __name((val) => typeof val === "function", "isFunction$2");
const isString$5 = /* @__PURE__ */ __name((val) => typeof val === "string", "isString$5");
const isBoolean$1 = /* @__PURE__ */ __name((val) => typeof val === "boolean", "isBoolean$1");
const isSymbol = /* @__PURE__ */ __name((val) => typeof val === "symbol", "isSymbol");
const isObject$3 = /* @__PURE__ */ __name((val) => val !== null && typeof val === "object", "isObject$3");
const isPromise = /* @__PURE__ */ __name((val) => {
  return isObject$3(val) && isFunction$2(val.then) && isFunction$2(val.catch);
}, "isPromise");
const objectToString = Object.prototype.toString;
const toTypeString = /* @__PURE__ */ __name((value4) => objectToString.call(value4), "toTypeString");
const isPlainObject$1 = /* @__PURE__ */ __name((val) => {
  if (!isObject$3(val))
    return false;
  const proto = Object.getPrototypeOf(val);
  return proto === null || proto.constructor === Object;
}, "isPlainObject$1");
const toDisplayString = /* @__PURE__ */ __name((val) => {
  return val == null ? "" : isArray$1(val) || isPlainObject$1(val) && val.toString === objectToString ? JSON.stringify(val, null, 2) : String(val);
}, "toDisplayString");
function join$2(items2, separator = "") {
  return items2.reduce((str, item3, index2) => index2 === 0 ? str + item3 : str + separator + item3, "");
}
__name(join$2, "join$2");
const RANGE = 2;
function generateCodeFrame(source, start2 = 0, end = source.length) {
  const lines = source.split(/\r?\n/);
  let count = 0;
  const res = [];
  for (let i2 = 0; i2 < lines.length; i2++) {
    count += lines[i2].length + 1;
    if (count >= start2) {
      for (let j = i2 - RANGE; j <= i2 + RANGE || end > count; j++) {
        if (j < 0 || j >= lines.length)
          continue;
        const line = j + 1;
        res.push(`${line}${" ".repeat(3 - String(line).length)}|  ${lines[j]}`);
        const lineLength = lines[j].length;
        if (j === i2) {
          const pad = start2 - (count - lineLength) + 1;
          const length = Math.max(1, end > count ? lineLength - pad : end - start2);
          res.push(`   |  ` + " ".repeat(pad) + "^".repeat(length));
        } else if (j > i2) {
          if (end > count) {
            const length = Math.max(Math.min(end - count, lineLength), 1);
            res.push(`   |  ` + "^".repeat(length));
          }
          count += lineLength + 1;
        }
      }
      break;
    }
  }
  return res.join("\n");
}
__name(generateCodeFrame, "generateCodeFrame");
function incrementer(code2) {
  let current = code2;
  return () => ++current;
}
__name(incrementer, "incrementer");
function warn$1(msg, err) {
  if (typeof console !== "undefined") {
    console.warn(`[intlify] ` + msg);
    if (err) {
      console.warn(err.stack);
    }
  }
}
__name(warn$1, "warn$1");
const hasWarned = {};
function warnOnce(msg) {
  if (!hasWarned[msg]) {
    hasWarned[msg] = true;
    warn$1(msg);
  }
}
__name(warnOnce, "warnOnce");
function createEmitter() {
  const events2 = /* @__PURE__ */ new Map();
  const emitter = {
    events: events2,
    on(event, handler6) {
      const handlers2 = events2.get(event);
      const added = handlers2 && handlers2.push(handler6);
      if (!added) {
        events2.set(event, [handler6]);
      }
    },
    off(event, handler6) {
      const handlers2 = events2.get(event);
      if (handlers2) {
        handlers2.splice(handlers2.indexOf(handler6) >>> 0, 1);
      }
    },
    emit(event, payload) {
      (events2.get(event) || []).slice().map((handler6) => handler6(payload));
      (events2.get("*") || []).slice().map((handler6) => handler6(event, payload));
    }
  };
  return emitter;
}
__name(createEmitter, "createEmitter");
const isNotObjectOrIsArray = /* @__PURE__ */ __name((val) => !isObject$3(val) || isArray$1(val), "isNotObjectOrIsArray");
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 (isNotObjectOrIsArray(src2[key]) || isNotObjectOrIsArray(des2[key])) {
        des2[key] = src2[key];
      } else {
        stack2.push({ src: src2[key], des: des2[key] });
      }
    });
  }
}
__name(deepCopy, "deepCopy");
/*!
  * message-compiler v9.13.1
  * (c) 2024 kazuya kawaguchi
  * Released under the MIT License.
  */
const LOCATION_STUB = {
  start: { line: 1, column: 1, offset: 0 },
  end: { line: 1, column: 1, offset: 0 }
};
function createPosition(line, column, offset) {
  return { line, column, offset };
}
__name(createPosition, "createPosition");
function createLocation(start2, end, source) {
  const loc = { start: start2, end };
  if (source != null) {
    loc.source = source;
  }
  return loc;
}
__name(createLocation, "createLocation");
const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
function format$4(message3, ...args) {
  if (args.length === 1 && isObject$2(args[0])) {
    args = args[0];
  }
  if (!args || !args.hasOwnProperty) {
    args = {};
  }
  return message3.replace(RE_ARGS, (match2, identifier) => {
    return args.hasOwnProperty(identifier) ? args[identifier] : "";
  });
}
__name(format$4, "format$4");
const assign$3 = Object.assign;
const isString$4 = /* @__PURE__ */ __name((val) => typeof val === "string", "isString$4");
const isObject$2 = /* @__PURE__ */ __name((val) => val !== null && typeof val === "object", "isObject$2");
function join$1(items2, separator = "") {
  return items2.reduce((str, item3, index2) => index2 === 0 ? str + item3 : str + separator + item3, "");
}
__name(join$1, "join$1");
const CompileWarnCodes = {
  USE_MODULO_SYNTAX: 1,
  __EXTEND_POINT__: 2
};
const warnMessages$2 = {
  [CompileWarnCodes.USE_MODULO_SYNTAX]: `Use modulo before '{{0}}'.`
};
function createCompileWarn(code2, loc, ...args) {
  const msg = format$4(warnMessages$2[code2] || "", ...args || []);
  const message3 = { message: String(msg), code: code2 };
  if (loc) {
    message3.location = loc;
  }
  return message3;
}
__name(createCompileWarn, "createCompileWarn");
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$2 = {
  // 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, options4 = {}) {
  const { domain: domain2, messages: messages2, args } = options4;
  const msg = format$4((messages2 || errorMessages$2)[code2] || "", ...args || []);
  const error2 = new SyntaxError(String(msg));
  error2.code = code2;
  if (loc) {
    error2.location = loc;
  }
  error2.domain = domain2;
  return error2;
}
__name(createCompileError, "createCompileError");
function defaultOnError(error2) {
  throw error2;
}
__name(defaultOnError, "defaultOnError");
const RE_HTML_TAG = /<\/?[\w\s="/.':;#-\/]+>/;
const detectHtmlTag = /* @__PURE__ */ __name((source) => RE_HTML_TAG.test(source), "detectHtmlTag");
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 = /* @__PURE__ */ __name((index3) => _buf[index3] === CHAR_CR && _buf[index3 + 1] === CHAR_LF, "isCRLF");
  const isLF = /* @__PURE__ */ __name((index3) => _buf[index3] === CHAR_LF, "isLF");
  const isPS = /* @__PURE__ */ __name((index3) => _buf[index3] === CHAR_PS, "isPS");
  const isLS = /* @__PURE__ */ __name((index3) => _buf[index3] === CHAR_LS, "isLS");
  const isLineEnd = /* @__PURE__ */ __name((index3) => isCRLF(index3) || isLF(index3) || isPS(index3) || isLS(index3), "isLineEnd");
  const index2 = /* @__PURE__ */ __name(() => _index, "index");
  const line = /* @__PURE__ */ __name(() => _line, "line");
  const column = /* @__PURE__ */ __name(() => _column, "column");
  const peekOffset = /* @__PURE__ */ __name(() => _peekOffset, "peekOffset");
  const charAt = /* @__PURE__ */ __name((offset) => isCRLF(offset) || isPS(offset) || isLS(offset) ? CHAR_LF : _buf[offset], "charAt");
  const currentChar = /* @__PURE__ */ __name(() => charAt(_index), "currentChar");
  const currentPeek = /* @__PURE__ */ __name(() => charAt(_index + _peekOffset), "currentPeek");
  function next2() {
    _peekOffset = 0;
    if (isLineEnd(_index)) {
      _line++;
      _column = 0;
    }
    if (isCRLF(_index)) {
      _index++;
    }
    _index++;
    _column++;
    return _buf[_index];
  }
  __name(next2, "next");
  function peek() {
    if (isCRLF(_index + _peekOffset)) {
      _peekOffset++;
    }
    _peekOffset++;
    return _buf[_index + _peekOffset];
  }
  __name(peek, "peek");
  function reset2() {
    _index = 0;
    _line = 1;
    _column = 1;
    _peekOffset = 0;
  }
  __name(reset2, "reset");
  function resetPeek(offset = 0) {
    _peekOffset = offset;
  }
  __name(resetPeek, "resetPeek");
  function skipToPeek() {
    const target = _index + _peekOffset;
    while (target !== _index) {
      next2();
    }
    _peekOffset = 0;
  }
  __name(skipToPeek, "skipToPeek");
  return {
    index: index2,
    line,
    column,
    peekOffset,
    charAt,
    currentChar,
    currentPeek,
    next: next2,
    peek,
    reset: reset2,
    resetPeek,
    skipToPeek
  };
}
__name(createScanner, "createScanner");
const EOF = void 0;
const DOT$1 = ".";
const LITERAL_DELIMITER = "'";
const ERROR_DOMAIN$3 = "tokenizer";
function createTokenizer(source, options4 = {}) {
  const location2 = options4.location !== false;
  const _scnr = createScanner(source);
  const currentOffset = /* @__PURE__ */ __name(() => _scnr.index(), "currentOffset");
  const currentPosition = /* @__PURE__ */ __name(() => createPosition(_scnr.line(), _scnr.column(), _scnr.index()), "currentPosition");
  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 = /* @__PURE__ */ __name(() => _context, "context");
  const { onError } = options4;
  function emitError(code2, pos2, offset, ...args) {
    const ctx = context();
    pos2.column += offset;
    pos2.offset += offset;
    if (onError) {
      const loc = location2 ? createLocation(ctx.startLoc, pos2) : null;
      const err = createCompileError(code2, loc, {
        domain: ERROR_DOMAIN$3,
        args
      });
      onError(err);
    }
  }
  __name(emitError, "emitError");
  function getToken(context2, type, value4) {
    context2.endLoc = currentPosition();
    context2.currentType = type;
    const token = { type };
    if (location2) {
      token.loc = createLocation(context2.startLoc, context2.endLoc);
    }
    if (value4 != null) {
      token.value = value4;
    }
    return token;
  }
  __name(getToken, "getToken");
  const getEndToken = /* @__PURE__ */ __name((context2) => getToken(
    context2,
    14
    /* TokenTypes.EOF */
  ), "getEndToken");
  function eat(scnr, ch) {
    if (scnr.currentChar() === ch) {
      scnr.next();
      return ch;
    } else {
      emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
      return "";
    }
  }
  __name(eat, "eat");
  function peekSpaces(scnr) {
    let buf = "";
    while (scnr.currentPeek() === CHAR_SP || scnr.currentPeek() === CHAR_LF) {
      buf += scnr.currentPeek();
      scnr.peek();
    }
    return buf;
  }
  __name(peekSpaces, "peekSpaces");
  function skipSpaces2(scnr) {
    const buf = peekSpaces(scnr);
    scnr.skipToPeek();
    return buf;
  }
  __name(skipSpaces2, "skipSpaces");
  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;
  }
  __name(isIdentifierStart, "isIdentifierStart");
  function isNumberStart(ch) {
    if (ch === EOF) {
      return false;
    }
    const cc = ch.charCodeAt(0);
    return cc >= 48 && cc <= 57;
  }
  __name(isNumberStart, "isNumberStart");
  function isNamedIdentifierStart(scnr, context2) {
    const { currentType } = context2;
    if (currentType !== 2) {
      return false;
    }
    peekSpaces(scnr);
    const ret = isIdentifierStart(scnr.currentPeek());
    scnr.resetPeek();
    return ret;
  }
  __name(isNamedIdentifierStart, "isNamedIdentifierStart");
  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;
  }
  __name(isListIdentifierStart, "isListIdentifierStart");
  function isLiteralStart(scnr, context2) {
    const { currentType } = context2;
    if (currentType !== 2) {
      return false;
    }
    peekSpaces(scnr);
    const ret = scnr.currentPeek() === LITERAL_DELIMITER;
    scnr.resetPeek();
    return ret;
  }
  __name(isLiteralStart, "isLiteralStart");
  function isLinkedDotStart(scnr, context2) {
    const { currentType } = context2;
    if (currentType !== 8) {
      return false;
    }
    peekSpaces(scnr);
    const ret = scnr.currentPeek() === ".";
    scnr.resetPeek();
    return ret;
  }
  __name(isLinkedDotStart, "isLinkedDotStart");
  function isLinkedModifierStart(scnr, context2) {
    const { currentType } = context2;
    if (currentType !== 9) {
      return false;
    }
    peekSpaces(scnr);
    const ret = isIdentifierStart(scnr.currentPeek());
    scnr.resetPeek();
    return ret;
  }
  __name(isLinkedModifierStart, "isLinkedModifierStart");
  function isLinkedDelimiterStart(scnr, context2) {
    const { currentType } = context2;
    if (!(currentType === 8 || currentType === 12)) {
      return false;
    }
    peekSpaces(scnr);
    const ret = scnr.currentPeek() === ":";
    scnr.resetPeek();
    return ret;
  }
  __name(isLinkedDelimiterStart, "isLinkedDelimiterStart");
  function isLinkedReferStart(scnr, context2) {
    const { currentType } = context2;
    if (currentType !== 10) {
      return false;
    }
    const fn = /* @__PURE__ */ __name(() => {
      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);
      }
    }, "fn");
    const ret = fn();
    scnr.resetPeek();
    return ret;
  }
  __name(isLinkedReferStart, "isLinkedReferStart");
  function isPluralStart(scnr) {
    peekSpaces(scnr);
    const ret = scnr.currentPeek() === "|";
    scnr.resetPeek();
    return ret;
  }
  __name(isPluralStart, "isPluralStart");
  function detectModuloStart(scnr) {
    const spaces = peekSpaces(scnr);
    const ret = scnr.currentPeek() === "%" && scnr.peek() === "{";
    scnr.resetPeek();
    return {
      isModulo: ret,
      hasSpace: spaces.length > 0
    };
  }
  __name(detectModuloStart, "detectModuloStart");
  function isTextStart(scnr, reset2 = true) {
    const fn = /* @__PURE__ */ __name((hasSpace = false, prev2 = "", detectModulo = false) => {
      const ch = scnr.currentPeek();
      if (ch === "{") {
        return prev2 === "%" ? false : hasSpace;
      } else if (ch === "@" || !ch) {
        return prev2 === "%" ? true : hasSpace;
      } else if (ch === "%") {
        scnr.peek();
        return fn(hasSpace, "%", true);
      } else if (ch === "|") {
        return prev2 === "%" || detectModulo ? true : !(prev2 === CHAR_SP || prev2 === 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;
      }
    }, "fn");
    const ret = fn();
    reset2 && scnr.resetPeek();
    return ret;
  }
  __name(isTextStart, "isTextStart");
  function takeChar(scnr, fn) {
    const ch = scnr.currentChar();
    if (ch === EOF) {
      return EOF;
    }
    if (fn(ch)) {
      scnr.next();
      return ch;
    }
    return null;
  }
  __name(takeChar, "takeChar");
  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;
  }
  __name(isIdentifier, "isIdentifier");
  function takeIdentifierChar(scnr) {
    return takeChar(scnr, isIdentifier);
  }
  __name(takeIdentifierChar, "takeIdentifierChar");
  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;
  }
  __name(isNamedIdentifier, "isNamedIdentifier");
  function takeNamedIdentifierChar(scnr) {
    return takeChar(scnr, isNamedIdentifier);
  }
  __name(takeNamedIdentifierChar, "takeNamedIdentifierChar");
  function isDigit(ch) {
    const cc = ch.charCodeAt(0);
    return cc >= 48 && cc <= 57;
  }
  __name(isDigit, "isDigit");
  function takeDigit(scnr) {
    return takeChar(scnr, isDigit);
  }
  __name(takeDigit, "takeDigit");
  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;
  }
  __name(isHexDigit, "isHexDigit");
  function takeHexDigit(scnr) {
    return takeChar(scnr, isHexDigit);
  }
  __name(takeHexDigit, "takeHexDigit");
  function getDigits(scnr) {
    let ch = "";
    let num = "";
    while (ch = takeDigit(scnr)) {
      num += ch;
    }
    return num;
  }
  __name(getDigits, "getDigits");
  function readModulo(scnr) {
    skipSpaces2(scnr);
    const ch = scnr.currentChar();
    if (ch !== "%") {
      emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
    }
    scnr.next();
    return "%";
  }
  __name(readModulo, "readModulo");
  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;
  }
  __name(readText, "readText");
  function readNamedIdentifier(scnr) {
    skipSpaces2(scnr);
    let ch = "";
    let name2 = "";
    while (ch = takeNamedIdentifierChar(scnr)) {
      name2 += ch;
    }
    if (scnr.currentChar() === EOF) {
      emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
    }
    return name2;
  }
  __name(readNamedIdentifier, "readNamedIdentifier");
  function readListIdentifier(scnr) {
    skipSpaces2(scnr);
    let value4 = "";
    if (scnr.currentChar() === "-") {
      scnr.next();
      value4 += `-${getDigits(scnr)}`;
    } else {
      value4 += getDigits(scnr);
    }
    if (scnr.currentChar() === EOF) {
      emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
    }
    return value4;
  }
  __name(readListIdentifier, "readListIdentifier");
  function isLiteral2(ch) {
    return ch !== LITERAL_DELIMITER && ch !== CHAR_LF;
  }
  __name(isLiteral2, "isLiteral");
  function readLiteral(scnr) {
    skipSpaces2(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;
  }
  __name(readLiteral, "readLiteral");
  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 "";
    }
  }
  __name(readEscapeSequence, "readEscapeSequence");
  function readUnicodeEscapeSequence(scnr, unicode, digits) {
    eat(scnr, unicode);
    let sequence = "";
    for (let i2 = 0; i2 < digits; i2++) {
      const ch = takeHexDigit(scnr);
      if (!ch) {
        emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
        break;
      }
      sequence += ch;
    }
    return `\\${unicode}${sequence}`;
  }
  __name(readUnicodeEscapeSequence, "readUnicodeEscapeSequence");
  function isInvalidIdentifier(ch) {
    return ch !== "{" && ch !== "}" && ch !== CHAR_SP && ch !== CHAR_LF;
  }
  __name(isInvalidIdentifier, "isInvalidIdentifier");
  function readInvalidIdentifier(scnr) {
    skipSpaces2(scnr);
    let ch = "";
    let identifiers = "";
    while (ch = takeChar(scnr, isInvalidIdentifier)) {
      identifiers += ch;
    }
    return identifiers;
  }
  __name(readInvalidIdentifier, "readInvalidIdentifier");
  function readLinkedModifier(scnr) {
    let ch = "";
    let name2 = "";
    while (ch = takeIdentifierChar(scnr)) {
      name2 += ch;
    }
    return name2;
  }
  __name(readLinkedModifier, "readLinkedModifier");
  function readLinkedRefer(scnr) {
    const fn = /* @__PURE__ */ __name((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$1) {
        buf += ch;
        scnr.next();
        return fn(buf);
      } else {
        buf += ch;
        scnr.next();
        return fn(buf);
      }
    }, "fn");
    return fn("");
  }
  __name(readLinkedRefer, "readLinkedRefer");
  function readPlural(scnr) {
    skipSpaces2(scnr);
    const plural = eat(
      scnr,
      "|"
      /* TokenChars.Pipe */
    );
    skipSpaces2(scnr);
    return plural;
  }
  __name(readPlural, "readPlural");
  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 */
        );
        skipSpaces2(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 && skipSpaces2(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));
          skipSpaces2(scnr);
          return token;
        }
        if (validListIdentifier = isListIdentifierStart(scnr, context2)) {
          token = getToken(context2, 6, readListIdentifier(scnr));
          skipSpaces2(scnr);
          return token;
        }
        if (validLiteral = isLiteralStart(scnr, context2)) {
          token = getToken(context2, 7, readLiteral(scnr));
          skipSpaces2(scnr);
          return token;
        }
        if (!validNamedIdentifier && !validListIdentifier && !validLiteral) {
          token = getToken(context2, 13, readInvalidIdentifier(scnr));
          emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);
          skipSpaces2(scnr);
          return token;
        }
        break;
      }
    }
    return token;
  }
  __name(readTokenInPlaceholder, "readTokenInPlaceholder");
  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 ".":
        skipSpaces2(scnr);
        scnr.next();
        return getToken(
          context2,
          9,
          "."
          /* TokenChars.LinkedDot */
        );
      case ":":
        skipSpaces2(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)) {
          skipSpaces2(scnr);
          return readTokenInLinked(scnr, context2);
        }
        if (isLinkedModifierStart(scnr, context2)) {
          skipSpaces2(scnr);
          return getToken(context2, 12, readLinkedModifier(scnr));
        }
        if (isLinkedReferStart(scnr, context2)) {
          skipSpaces2(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);
    }
  }
  __name(readTokenInLinked, "readTokenInLinked");
  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;
  }
  __name(readToken, "readToken");
  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);
  }
  __name(nextToken, "nextToken");
  return {
    nextToken,
    currentOffset,
    currentPosition,
    context
  };
}
__name(createTokenizer, "createTokenizer");
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 "�";
    }
  }
}
__name(fromEscapeSequence, "fromEscapeSequence");
function createParser(options4 = {}) {
  const location2 = options4.location !== false;
  const { onError, onWarn } = options4;
  function emitError(tokenzer, code2, start2, offset, ...args) {
    const end = tokenzer.currentPosition();
    end.offset += offset;
    end.column += offset;
    if (onError) {
      const loc = location2 ? createLocation(start2, end) : null;
      const err = createCompileError(code2, loc, {
        domain: ERROR_DOMAIN$2,
        args
      });
      onError(err);
    }
  }
  __name(emitError, "emitError");
  function emitWarn(tokenzer, code2, start2, offset, ...args) {
    const end = tokenzer.currentPosition();
    end.offset += offset;
    end.column += offset;
    if (onWarn) {
      const loc = location2 ? createLocation(start2, end) : null;
      onWarn(createCompileWarn(code2, loc, args));
    }
  }
  __name(emitWarn, "emitWarn");
  function startNode(type, offset, loc) {
    const node3 = { type };
    if (location2) {
      node3.start = offset;
      node3.end = offset;
      node3.loc = { start: loc, end: loc };
    }
    return node3;
  }
  __name(startNode, "startNode");
  function endNode(node3, offset, pos2, type) {
    if (type) {
      node3.type = type;
    }
    if (location2) {
      node3.end = offset;
      if (node3.loc) {
        node3.loc.end = pos2;
      }
    }
  }
  __name(endNode, "endNode");
  function parseText(tokenizer, value4) {
    const context = tokenizer.context();
    const node3 = startNode(3, context.offset, context.startLoc);
    node3.value = value4;
    endNode(node3, tokenizer.currentOffset(), tokenizer.currentPosition());
    return node3;
  }
  __name(parseText, "parseText");
  function parseList(tokenizer, index2) {
    const context = tokenizer.context();
    const { lastOffset: offset, lastStartLoc: loc } = context;
    const node3 = startNode(5, offset, loc);
    node3.index = parseInt(index2, 10);
    tokenizer.nextToken();
    endNode(node3, tokenizer.currentOffset(), tokenizer.currentPosition());
    return node3;
  }
  __name(parseList, "parseList");
  function parseNamed(tokenizer, key, modulo) {
    const context = tokenizer.context();
    const { lastOffset: offset, lastStartLoc: loc } = context;
    const node3 = startNode(4, offset, loc);
    node3.key = key;
    if (modulo === true) {
      node3.modulo = true;
    }
    tokenizer.nextToken();
    endNode(node3, tokenizer.currentOffset(), tokenizer.currentPosition());
    return node3;
  }
  __name(parseNamed, "parseNamed");
  function parseLiteral(tokenizer, value4) {
    const context = tokenizer.context();
    const { lastOffset: offset, lastStartLoc: loc } = context;
    const node3 = startNode(9, offset, loc);
    node3.value = value4.replace(KNOWN_ESCAPES, fromEscapeSequence);
    tokenizer.nextToken();
    endNode(node3, tokenizer.currentOffset(), tokenizer.currentPosition());
    return node3;
  }
  __name(parseLiteral, "parseLiteral");
  function parseLinkedModifier(tokenizer) {
    const token = tokenizer.nextToken();
    const context = tokenizer.context();
    const { lastOffset: offset, lastStartLoc: loc } = context;
    const node3 = startNode(8, offset, loc);
    if (token.type !== 12) {
      emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);
      node3.value = "";
      endNode(node3, offset, loc);
      return {
        nextConsumeToken: token,
        node: node3
      };
    }
    if (token.value == null) {
      emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
    }
    node3.value = token.value || "";
    endNode(node3, tokenizer.currentOffset(), tokenizer.currentPosition());
    return {
      node: node3
    };
  }
  __name(parseLinkedModifier, "parseLinkedModifier");
  function parseLinkedKey(tokenizer, value4) {
    const context = tokenizer.context();
    const node3 = startNode(7, context.offset, context.startLoc);
    node3.value = value4;
    endNode(node3, tokenizer.currentOffset(), tokenizer.currentPosition());
    return node3;
  }
  __name(parseLinkedKey, "parseLinkedKey");
  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
    };
  }
  __name(parseLinked, "parseLinked");
  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 node3 = startNode(2, startOffset, startLoc);
    node3.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));
          }
          node3.items.push(parseText(tokenizer, token.value || ""));
          break;
        case 6:
          if (token.value == null) {
            emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
          }
          node3.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));
          }
          node3.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));
          }
          node3.items.push(parseLiteral(tokenizer, token.value || ""));
          break;
        case 8: {
          const parsed = parseLinked(tokenizer);
          node3.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(node3, endOffset, endLoc);
    return node3;
  }
  __name(parseMessage, "parseMessage");
  function parsePlural(tokenizer, offset, loc, msgNode) {
    const context = tokenizer.context();
    let hasEmptyMessage = msgNode.items.length === 0;
    const node3 = startNode(1, offset, loc);
    node3.cases = [];
    node3.cases.push(msgNode);
    do {
      const msg = parseMessage(tokenizer);
      if (!hasEmptyMessage) {
        hasEmptyMessage = msg.items.length === 0;
      }
      node3.cases.push(msg);
    } while (context.currentType !== 14);
    if (hasEmptyMessage) {
      emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);
    }
    endNode(node3, tokenizer.currentOffset(), tokenizer.currentPosition());
    return node3;
  }
  __name(parsePlural, "parsePlural");
  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);
    }
  }
  __name(parseResource, "parseResource");
  function parse2(source) {
    const tokenizer = createTokenizer(source, assign$3({}, options4));
    const context = tokenizer.context();
    const node3 = startNode(0, context.offset, context.startLoc);
    if (location2 && node3.loc) {
      node3.loc.source = source;
    }
    node3.body = parseResource(tokenizer);
    if (options4.onCacheKey) {
      node3.cacheKey = options4.onCacheKey(source);
    }
    if (context.currentType !== 14) {
      emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || "");
    }
    endNode(node3, tokenizer.currentOffset(), tokenizer.currentPosition());
    return node3;
  }
  __name(parse2, "parse");
  return { parse: parse2 };
}
__name(createParser, "createParser");
function getTokenCaption(token) {
  if (token.type === 14) {
    return "EOF";
  }
  const name2 = (token.value || "").replace(/\r?\n/gu, "\\n");
  return name2.length > 10 ? name2.slice(0, 9) + "…" : name2;
}
__name(getTokenCaption, "getTokenCaption");
function createTransformer(ast, options4 = {}) {
  const _context = {
    ast,
    helpers: /* @__PURE__ */ new Set()
  };
  const context = /* @__PURE__ */ __name(() => _context, "context");
  const helper = /* @__PURE__ */ __name((name2) => {
    _context.helpers.add(name2);
    return name2;
  }, "helper");
  return { context, helper };
}
__name(createTransformer, "createTransformer");
function traverseNodes(nodes, transformer) {
  for (let i2 = 0; i2 < nodes.length; i2++) {
    traverseNode(nodes[i2], transformer);
  }
}
__name(traverseNodes, "traverseNodes");
function traverseNode(node3, transformer) {
  switch (node3.type) {
    case 1:
      traverseNodes(node3.cases, transformer);
      transformer.helper(
        "plural"
        /* HelperNameMap.PLURAL */
      );
      break;
    case 2:
      traverseNodes(node3.items, transformer);
      break;
    case 6: {
      const linked = node3;
      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;
  }
}
__name(traverseNode, "traverseNode");
function transform(ast, options4 = {}) {
  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);
}
__name(transform, "transform");
function optimize(ast) {
  const body = ast.body;
  if (body.type === 2) {
    optimizeMessageNode(body);
  } else {
    body.cases.forEach((c) => optimizeMessageNode(c));
  }
  return ast;
}
__name(optimize, "optimize");
function optimizeMessageNode(message3) {
  if (message3.items.length === 1) {
    const item3 = message3.items[0];
    if (item3.type === 3 || item3.type === 9) {
      message3.static = item3.value;
      delete item3.value;
    }
  } else {
    const values = [];
    for (let i2 = 0; i2 < message3.items.length; i2++) {
      const item3 = message3.items[i2];
      if (!(item3.type === 3 || item3.type === 9)) {
        break;
      }
      if (item3.value == null) {
        break;
      }
      values.push(item3.value);
    }
    if (values.length === message3.items.length) {
      message3.static = join$1(values);
      for (let i2 = 0; i2 < message3.items.length; i2++) {
        const item3 = message3.items[i2];
        if (item3.type === 3 || item3.type === 9) {
          delete item3.value;
        }
      }
    }
  }
}
__name(optimizeMessageNode, "optimizeMessageNode");
const ERROR_DOMAIN$1 = "minifier";
function minify(node3) {
  node3.t = node3.type;
  switch (node3.type) {
    case 0: {
      const resource = node3;
      minify(resource.body);
      resource.b = resource.body;
      delete resource.body;
      break;
    }
    case 1: {
      const plural = node3;
      const cases = plural.cases;
      for (let i2 = 0; i2 < cases.length; i2++) {
        minify(cases[i2]);
      }
      plural.c = cases;
      delete plural.cases;
      break;
    }
    case 2: {
      const message3 = node3;
      const items2 = message3.items;
      for (let i2 = 0; i2 < items2.length; i2++) {
        minify(items2[i2]);
      }
      message3.i = items2;
      delete message3.items;
      if (message3.static) {
        message3.s = message3.static;
        delete message3.static;
      }
      break;
    }
    case 3:
    case 9:
    case 8:
    case 7: {
      const valueNode = node3;
      if (valueNode.value) {
        valueNode.v = valueNode.value;
        delete valueNode.value;
      }
      break;
    }
    case 6: {
      const linked = node3;
      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 list2 = node3;
      list2.i = list2.index;
      delete list2.index;
      break;
    }
    case 4: {
      const named = node3;
      named.k = named.key;
      delete named.key;
      break;
    }
    default: {
      throw createCompileError(CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE, null, {
        domain: ERROR_DOMAIN$1,
        args: [node3.type]
      });
    }
  }
  delete node3.type;
}
__name(minify, "minify");
const ERROR_DOMAIN = "parser";
function createCodeGenerator(ast, options4) {
  const { sourceMap, filename, breakLineCode, needIndent: _needIndent } = options4;
  const location2 = options4.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 = /* @__PURE__ */ __name(() => _context, "context");
  function push(code2, node3) {
    _context.code += code2;
  }
  __name(push, "push");
  function _newline(n, withBreakLine = true) {
    const _breakLineCode = withBreakLine ? breakLineCode : "";
    push(_needIndent ? _breakLineCode + `  `.repeat(n) : _breakLineCode);
  }
  __name(_newline, "_newline");
  function indent(withNewLine = true) {
    const level = ++_context.indentLevel;
    withNewLine && _newline(level);
  }
  __name(indent, "indent");
  function deindent(withNewLine = true) {
    const level = --_context.indentLevel;
    withNewLine && _newline(level);
  }
  __name(deindent, "deindent");
  function newline2() {
    _newline(_context.indentLevel);
  }
  __name(newline2, "newline");
  const helper = /* @__PURE__ */ __name((key) => `_${key}`, "helper");
  const needIndent = /* @__PURE__ */ __name(() => _context.needIndent, "needIndent");
  return {
    context,
    push,
    indent,
    deindent,
    newline: newline2,
    helper,
    needIndent
  };
}
__name(createCodeGenerator, "createCodeGenerator");
function generateLinkedNode(generator, node3) {
  const { helper } = generator;
  generator.push(`${helper(
    "linked"
    /* HelperNameMap.LINKED */
  )}(`);
  generateNode(generator, node3.key);
  if (node3.modifier) {
    generator.push(`, `);
    generateNode(generator, node3.modifier);
    generator.push(`, _type`);
  } else {
    generator.push(`, undefined, _type`);
  }
  generator.push(`)`);
}
__name(generateLinkedNode, "generateLinkedNode");
function generateMessageNode(generator, node3) {
  const { helper, needIndent } = generator;
  generator.push(`${helper(
    "normalize"
    /* HelperNameMap.NORMALIZE */
  )}([`);
  generator.indent(needIndent());
  const length = node3.items.length;
  for (let i2 = 0; i2 < length; i2++) {
    generateNode(generator, node3.items[i2]);
    if (i2 === length - 1) {
      break;
    }
    generator.push(", ");
  }
  generator.deindent(needIndent());
  generator.push("])");
}
__name(generateMessageNode, "generateMessageNode");
function generatePluralNode(generator, node3) {
  const { helper, needIndent } = generator;
  if (node3.cases.length > 1) {
    generator.push(`${helper(
      "plural"
      /* HelperNameMap.PLURAL */
    )}([`);
    generator.indent(needIndent());
    const length = node3.cases.length;
    for (let i2 = 0; i2 < length; i2++) {
      generateNode(generator, node3.cases[i2]);
      if (i2 === length - 1) {
        break;
      }
      generator.push(", ");
    }
    generator.deindent(needIndent());
    generator.push(`])`);
  }
}
__name(generatePluralNode, "generatePluralNode");
function generateResource(generator, node3) {
  if (node3.body) {
    generateNode(generator, node3.body);
  } else {
    generator.push("null");
  }
}
__name(generateResource, "generateResource");
function generateNode(generator, node3) {
  const { helper } = generator;
  switch (node3.type) {
    case 0:
      generateResource(generator, node3);
      break;
    case 1:
      generatePluralNode(generator, node3);
      break;
    case 2:
      generateMessageNode(generator, node3);
      break;
    case 6:
      generateLinkedNode(generator, node3);
      break;
    case 8:
      generator.push(JSON.stringify(node3.value), node3);
      break;
    case 7:
      generator.push(JSON.stringify(node3.value), node3);
      break;
    case 5:
      generator.push(`${helper(
        "interpolate"
        /* HelperNameMap.INTERPOLATE */
      )}(${helper(
        "list"
        /* HelperNameMap.LIST */
      )}(${node3.index}))`, node3);
      break;
    case 4:
      generator.push(`${helper(
        "interpolate"
        /* HelperNameMap.INTERPOLATE */
      )}(${helper(
        "named"
        /* HelperNameMap.NAMED */
      )}(${JSON.stringify(node3.key)}))`, node3);
      break;
    case 9:
      generator.push(JSON.stringify(node3.value), node3);
      break;
    case 3:
      generator.push(JSON.stringify(node3.value), node3);
      break;
    default: {
      throw createCompileError(CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE, null, {
        domain: ERROR_DOMAIN,
        args: [node3.type]
      });
    }
  }
}
__name(generateNode, "generateNode");
const generate = /* @__PURE__ */ __name((ast, options4 = {}) => {
  const mode2 = isString$4(options4.mode) ? options4.mode : "normal";
  const filename = isString$4(options4.filename) ? options4.filename : "message.intl";
  const sourceMap = !!options4.sourceMap;
  const breakLineCode = options4.breakLineCode != null ? options4.breakLineCode : mode2 === "arrow" ? ";" : "\n";
  const needIndent = options4.needIndent ? options4.needIndent : mode2 !== "arrow";
  const helpers2 = ast.helpers || [];
  const generator = createCodeGenerator(ast, {
    mode: mode2,
    filename,
    sourceMap,
    breakLineCode,
    needIndent
  });
  generator.push(mode2 === "normal" ? `function __msg__ (ctx) {` : `(ctx) => {`);
  generator.indent(needIndent);
  if (helpers2.length > 0) {
    generator.push(`const { ${join$1(helpers2.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: map3 } = generator.context();
  return {
    ast,
    code: code2,
    map: map3 ? map3.toJSON() : void 0
    // eslint-disable-line @typescript-eslint/no-explicit-any
  };
}, "generate");
function baseCompile$1(source, options4 = {}) {
  const assignedOptions = assign$3({}, options4);
  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: "" };
  }
}
__name(baseCompile$1, "baseCompile$1");
/*!
  * core-base v9.13.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;
  }
}
__name(initFeatureFlags$1, "initFeatureFlags$1");
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);
}
__name(isLiteral, "isLiteral");
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;
}
__name(stripQuotes, "stripQuotes");
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";
}
__name(getPathCharType, "getPathCharType");
function formatSubPath(path) {
  const trimmed = path.trim();
  if (path.charAt(0) === "0" && isNaN(parseInt(path))) {
    return false;
  }
  return isLiteral(trimmed) ? stripQuotes(trimmed) : "*" + trimmed;
}
__name(formatSubPath, "formatSubPath");
function parse$1(path) {
  const keys2 = [];
  let index2 = -1;
  let mode2 = 0;
  let subPathDepth = 0;
  let c;
  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--;
      mode2 = 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[index2 + 1];
    if (mode2 === 5 && nextChar === "'" || mode2 === 6 && nextChar === '"') {
      index2++;
      newChar = "\\" + nextChar;
      actions[
        0
        /* Actions.APPEND */
      ]();
      return true;
    }
  }
  __name(maybeUnescapeQuote, "maybeUnescapeQuote");
  while (mode2 !== null) {
    index2++;
    c = path[index2];
    if (c === "\\" && maybeUnescapeQuote()) {
      continue;
    }
    type = getPathCharType(c);
    typeMap = pathStateMachine[mode2];
    transition = typeMap[type] || typeMap[
      "l"
      /* PathCharTypes.ELSE */
    ] || 8;
    if (transition === 8) {
      return;
    }
    mode2 = transition[0];
    if (transition[1] !== void 0) {
      action = actions[transition[1]];
      if (action) {
        newChar = c;
        if (action() === false) {
          return;
        }
      }
    }
    if (mode2 === 7) {
      return keys2;
    }
  }
}
__name(parse$1, "parse$1");
const cache = /* @__PURE__ */ new Map();
function resolveWithKeyValue(obj, path) {
  return isObject$3(obj) ? obj[path] : null;
}
__name(resolveWithKeyValue, "resolveWithKeyValue");
function resolveValue(obj, path) {
  if (!isObject$3(obj)) {
    return null;
  }
  let hit = cache.get(path);
  if (!hit) {
    hit = parse$1(path);
    if (hit) {
      cache.set(path, hit);
    }
  }
  if (!hit) {
    return null;
  }
  const len = hit.length;
  let last = obj;
  let i2 = 0;
  while (i2 < len) {
    const val = last[hit[i2]];
    if (val === void 0) {
      return null;
    }
    if (isFunction$2(last)) {
      return null;
    }
    last = val;
    i2++;
  }
  return last;
}
__name(resolveValue, "resolveValue");
const DEFAULT_MODIFIER = /* @__PURE__ */ __name((str) => str, "DEFAULT_MODIFIER");
const DEFAULT_MESSAGE = /* @__PURE__ */ __name((ctx) => "", "DEFAULT_MESSAGE");
const DEFAULT_MESSAGE_DATA_TYPE = "text";
const DEFAULT_NORMALIZE = /* @__PURE__ */ __name((values) => values.length === 0 ? "" : join$2(values), "DEFAULT_NORMALIZE");
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;
}
__name(pluralDefault, "pluralDefault");
function getPluralIndex(options4) {
  const index2 = isNumber$3(options4.pluralIndex) ? options4.pluralIndex : -1;
  return options4.named && (isNumber$3(options4.named.count) || isNumber$3(options4.named.n)) ? isNumber$3(options4.named.count) ? options4.named.count : isNumber$3(options4.named.n) ? options4.named.n : index2 : index2;
}
__name(getPluralIndex, "getPluralIndex");
function normalizeNamed(pluralIndex, props) {
  if (!props.count) {
    props.count = pluralIndex;
  }
  if (!props.n) {
    props.n = pluralIndex;
  }
}
__name(normalizeNamed, "normalizeNamed");
function createMessageContext(options4 = {}) {
  const locale2 = options4.locale;
  const pluralIndex = getPluralIndex(options4);
  const pluralRule = isObject$3(options4.pluralRules) && isString$5(locale2) && isFunction$2(options4.pluralRules[locale2]) ? options4.pluralRules[locale2] : pluralDefault;
  const orgPluralRule = isObject$3(options4.pluralRules) && isString$5(locale2) && isFunction$2(options4.pluralRules[locale2]) ? pluralDefault : void 0;
  const plural = /* @__PURE__ */ __name((messages2) => {
    return messages2[pluralRule(pluralIndex, messages2.length, orgPluralRule)];
  }, "plural");
  const _list = options4.list || [];
  const list2 = /* @__PURE__ */ __name((index2) => _list[index2], "list");
  const _named = options4.named || {};
  isNumber$3(options4.pluralIndex) && normalizeNamed(pluralIndex, _named);
  const named = /* @__PURE__ */ __name((key) => _named[key], "named");
  function message3(key) {
    const msg = isFunction$2(options4.messages) ? options4.messages(key) : isObject$3(options4.messages) ? options4.messages[key] : false;
    return !msg ? options4.parent ? options4.parent.message(key) : DEFAULT_MESSAGE : msg;
  }
  __name(message3, "message");
  const _modifier = /* @__PURE__ */ __name((name2) => options4.modifiers ? options4.modifiers[name2] : DEFAULT_MODIFIER, "_modifier");
  const normalize3 = isPlainObject$1(options4.processor) && isFunction$2(options4.processor.normalize) ? options4.processor.normalize : DEFAULT_NORMALIZE;
  const interpolate = isPlainObject$1(options4.processor) && isFunction$2(options4.processor.interpolate) ? options4.processor.interpolate : DEFAULT_INTERPOLATE;
  const type = isPlainObject$1(options4.processor) && isString$5(options4.processor.type) ? options4.processor.type : DEFAULT_MESSAGE_DATA_TYPE;
  const linked = /* @__PURE__ */ __name((key, ...args) => {
    const [arg1, arg2] = args;
    let type2 = "text";
    let modifier = "";
    if (args.length === 1) {
      if (isObject$3(arg1)) {
        modifier = arg1.modifier || modifier;
        type2 = arg1.type || type2;
      } else if (isString$5(arg1)) {
        modifier = arg1 || modifier;
      }
    } else if (args.length === 2) {
      if (isString$5(arg1)) {
        modifier = arg1 || modifier;
      }
      if (isString$5(arg2)) {
        type2 = arg2 || type2;
      }
    }
    const ret = message3(key)(ctx);
    const msg = (
      // The message in vnode resolved with linked are returned as an array by processor.nomalize
      type2 === "vnode" && isArray$1(ret) && modifier ? ret[0] : ret
    );
    return modifier ? _modifier(modifier)(msg, type2) : msg;
  }, "linked");
  const ctx = {
    [
      "list"
      /* HelperNameMap.LIST */
    ]: list2,
    [
      "named"
      /* HelperNameMap.NAMED */
    ]: named,
    [
      "plural"
      /* HelperNameMap.PLURAL */
    ]: plural,
    [
      "linked"
      /* HelperNameMap.LINKED */
    ]: linked,
    [
      "message"
      /* HelperNameMap.MESSAGE */
    ]: message3,
    [
      "type"
      /* HelperNameMap.TYPE */
    ]: type,
    [
      "interpolate"
      /* HelperNameMap.INTERPOLATE */
    ]: interpolate,
    [
      "normalize"
      /* HelperNameMap.NORMALIZE */
    ]: normalize3,
    [
      "values"
      /* HelperNameMap.VALUES */
    ]: assign$4({}, _list, _named)
  };
  return ctx;
}
__name(createMessageContext, "createMessageContext");
let devtools = null;
function setDevToolsHook(hook) {
  devtools = hook;
}
__name(setDevToolsHook, "setDevToolsHook");
function getDevToolsHook() {
  return devtools;
}
__name(getDevToolsHook, "getDevToolsHook");
function initI18nDevTools(i18n2, version2, meta) {
  devtools && devtools.emit("i18n:init", {
    timestamp: Date.now(),
    i18n: i18n2,
    version: version2,
    meta
  });
}
__name(initI18nDevTools, "initI18nDevTools");
const translateDevTools = /* @__PURE__ */ createDevToolsHook(
  "function:translate"
  /* IntlifyDevToolsHooks.FunctionTranslate */
);
function createDevToolsHook(hook) {
  return (payloads) => devtools && devtools.emit(hook, payloads);
}
__name(createDevToolsHook, "createDevToolsHook");
const code$1$2 = CompileWarnCodes.__EXTEND_POINT__;
const inc$1$1 = incrementer(code$1$2);
const CoreWarnCodes = {
  NOT_FOUND_KEY: code$1$2,
  // 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 warnMessages$1 = {
  [CoreWarnCodes.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale messages.`,
  [CoreWarnCodes.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
  [CoreWarnCodes.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
  [CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
  [CoreWarnCodes.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
  [CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
  [CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: `This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future.`
};
function getWarnMessage$1(code2, ...args) {
  return format$5(warnMessages$1[code2], ...args);
}
__name(getWarnMessage$1, "getWarnMessage$1");
const code$3 = CompileErrorCodes.__EXTEND_POINT__;
const inc$2 = incrementer(code$3);
const CoreErrorCodes = {
  INVALID_ARGUMENT: code$3,
  // 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, false ? { messages: errorMessages$1 } : void 0);
}
__name(createCoreError, "createCoreError");
const errorMessages$1 = {
  [CoreErrorCodes.INVALID_ARGUMENT]: "Invalid arguments",
  [CoreErrorCodes.INVALID_DATE_ARGUMENT]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
  [CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT]: "The argument provided is not a valid ISO date string",
  [CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE]: "Not support non-string message",
  [CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: "cannot support promise value",
  [CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: "cannot support async function",
  [CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE]: "cannot support locale type"
};
function getLocale(context, options4) {
  return options4.locale != null ? resolveLocale(options4.locale) : resolveLocale(context.locale);
}
__name(getLocale, "getLocale");
let _resolveLocale;
function resolveLocale(locale2) {
  if (isString$5(locale2)) {
    return locale2;
  } else {
    if (isFunction$2(locale2)) {
      if (locale2.resolvedOnce && _resolveLocale != null) {
        return _resolveLocale;
      } else if (locale2.constructor.name === "Function") {
        const resolve2 = locale2();
        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);
    }
  }
}
__name(resolveLocale, "resolveLocale");
function fallbackWithSimple(ctx, fallback, start2) {
  return [.../* @__PURE__ */ new Set([
    start2,
    ...isArray$1(fallback) ? fallback : isObject$3(fallback) ? Object.keys(fallback) : isString$5(fallback) ? [fallback] : [start2]
  ])];
}
__name(fallbackWithSimple, "fallbackWithSimple");
function fallbackWithLocaleChain(ctx, fallback, start2) {
  const startLocale = isString$5(start2) ? start2 : DEFAULT_LOCALE;
  const context = ctx;
  if (!context.__localeChainCache) {
    context.__localeChainCache = /* @__PURE__ */ new Map();
  }
  let chain = context.__localeChainCache.get(startLocale);
  if (!chain) {
    chain = [];
    let block3 = [start2];
    while (isArray$1(block3)) {
      block3 = appendBlockToChain(chain, block3, fallback);
    }
    const defaults2 = isArray$1(fallback) || !isPlainObject$1(fallback) ? fallback : fallback["default"] ? fallback["default"] : null;
    block3 = isString$5(defaults2) ? [defaults2] : defaults2;
    if (isArray$1(block3)) {
      appendBlockToChain(chain, block3, false);
    }
    context.__localeChainCache.set(startLocale, chain);
  }
  return chain;
}
__name(fallbackWithLocaleChain, "fallbackWithLocaleChain");
function appendBlockToChain(chain, block3, blocks) {
  let follow = true;
  for (let i2 = 0; i2 < block3.length && isBoolean$1(follow); i2++) {
    const locale2 = block3[i2];
    if (isString$5(locale2)) {
      follow = appendLocaleToChain(chain, block3[i2], blocks);
    }
  }
  return follow;
}
__name(appendBlockToChain, "appendBlockToChain");
function appendLocaleToChain(chain, locale2, blocks) {
  let follow;
  const tokens = locale2.split("-");
  do {
    const target = tokens.join("-");
    follow = appendItemToChain(chain, target, blocks);
    tokens.splice(-1, 1);
  } while (tokens.length && follow === true);
  return follow;
}
__name(appendLocaleToChain, "appendLocaleToChain");
function appendItemToChain(chain, target, blocks) {
  let follow = false;
  if (!chain.includes(target)) {
    follow = true;
    if (target) {
      follow = target[target.length - 1] !== "!";
      const locale2 = target.replace(/!/g, "");
      chain.push(locale2);
      if ((isArray$1(blocks) || isPlainObject$1(blocks)) && blocks[locale2]) {
        follow = blocks[locale2];
      }
    }
  }
  return follow;
}
__name(appendItemToChain, "appendItemToChain");
const VERSION$1 = "9.13.1";
const NOT_REOSLVED = -1;
const DEFAULT_LOCALE = "en-US";
const MISSING_RESOLVE_VALUE = "";
const capitalize = /* @__PURE__ */ __name((str) => `${str.charAt(0).toLocaleUpperCase()}${str.substr(1)}`, "capitalize");
function getDefaultLinkedModifiers() {
  return {
    upper: /* @__PURE__ */ __name((val, type) => {
      return type === "text" && isString$5(val) ? val.toUpperCase() : type === "vnode" && isObject$3(val) && "__v_isVNode" in val ? val.children.toUpperCase() : val;
    }, "upper"),
    lower: /* @__PURE__ */ __name((val, type) => {
      return type === "text" && isString$5(val) ? val.toLowerCase() : type === "vnode" && isObject$3(val) && "__v_isVNode" in val ? val.children.toLowerCase() : val;
    }, "lower"),
    capitalize: /* @__PURE__ */ __name((val, type) => {
      return type === "text" && isString$5(val) ? capitalize(val) : type === "vnode" && isObject$3(val) && "__v_isVNode" in val ? capitalize(val.children) : val;
    }, "capitalize")
  };
}
__name(getDefaultLinkedModifiers, "getDefaultLinkedModifiers");
let _compiler;
function registerMessageCompiler(compiler) {
  _compiler = compiler;
}
__name(registerMessageCompiler, "registerMessageCompiler");
let _resolver;
function registerMessageResolver(resolver) {
  _resolver = resolver;
}
__name(registerMessageResolver, "registerMessageResolver");
let _fallbacker;
function registerLocaleFallbacker(fallbacker) {
  _fallbacker = fallbacker;
}
__name(registerLocaleFallbacker, "registerLocaleFallbacker");
let _additionalMeta = null;
const setAdditionalMeta = /* @__PURE__ */ __name(/* @__NO_SIDE_EFFECTS__ */ (meta) => {
  _additionalMeta = meta;
}, "setAdditionalMeta");
const getAdditionalMeta = /* @__PURE__ */ __name(/* @__NO_SIDE_EFFECTS__ */ () => _additionalMeta, "getAdditionalMeta");
let _fallbackContext = null;
const setFallbackContext = /* @__PURE__ */ __name((context) => {
  _fallbackContext = context;
}, "setFallbackContext");
const getFallbackContext = /* @__PURE__ */ __name(() => _fallbackContext, "getFallbackContext");
let _cid = 0;
function createCoreContext(options4 = {}) {
  const onWarn = isFunction$2(options4.onWarn) ? options4.onWarn : warn$1;
  const version2 = isString$5(options4.version) ? options4.version : VERSION$1;
  const locale2 = isString$5(options4.locale) || isFunction$2(options4.locale) ? options4.locale : DEFAULT_LOCALE;
  const _locale = isFunction$2(locale2) ? DEFAULT_LOCALE : locale2;
  const fallbackLocale = isArray$1(options4.fallbackLocale) || isPlainObject$1(options4.fallbackLocale) || isString$5(options4.fallbackLocale) || options4.fallbackLocale === false ? options4.fallbackLocale : _locale;
  const messages2 = isPlainObject$1(options4.messages) ? options4.messages : { [_locale]: {} };
  const datetimeFormats = isPlainObject$1(options4.datetimeFormats) ? options4.datetimeFormats : { [_locale]: {} };
  const numberFormats = isPlainObject$1(options4.numberFormats) ? options4.numberFormats : { [_locale]: {} };
  const modifiers2 = assign$4({}, options4.modifiers || {}, getDefaultLinkedModifiers());
  const pluralRules = options4.pluralRules || {};
  const missing = isFunction$2(options4.missing) ? options4.missing : null;
  const missingWarn = isBoolean$1(options4.missingWarn) || isRegExp$2(options4.missingWarn) ? options4.missingWarn : true;
  const fallbackWarn = isBoolean$1(options4.fallbackWarn) || isRegExp$2(options4.fallbackWarn) ? options4.fallbackWarn : true;
  const fallbackFormat = !!options4.fallbackFormat;
  const unresolving = !!options4.unresolving;
  const postTranslation = isFunction$2(options4.postTranslation) ? options4.postTranslation : null;
  const processor = isPlainObject$1(options4.processor) ? options4.processor : null;
  const warnHtmlMessage = isBoolean$1(options4.warnHtmlMessage) ? options4.warnHtmlMessage : true;
  const escapeParameter = !!options4.escapeParameter;
  const messageCompiler = isFunction$2(options4.messageCompiler) ? options4.messageCompiler : _compiler;
  if (false) {
    warnOnce(getWarnMessage$1(CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));
  }
  const messageResolver = isFunction$2(options4.messageResolver) ? options4.messageResolver : _resolver || resolveWithKeyValue;
  const localeFallbacker = isFunction$2(options4.localeFallbacker) ? options4.localeFallbacker : _fallbacker || fallbackWithSimple;
  const fallbackContext = isObject$3(options4.fallbackContext) ? options4.fallbackContext : void 0;
  const internalOptions = options4;
  const __datetimeFormatters = isObject$3(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map();
  const __numberFormatters = isObject$3(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map();
  const __meta = isObject$3(internalOptions.__meta) ? internalOptions.__meta : {};
  _cid++;
  const context = {
    version: version2,
    cid: _cid,
    locale: locale2,
    fallbackLocale,
    messages: messages2,
    modifiers: modifiers2,
    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 (false) {
    context.__v_emitter = internalOptions.__v_emitter != null ? internalOptions.__v_emitter : void 0;
  }
  if (__INTLIFY_PROD_DEVTOOLS__) {
    initI18nDevTools(context, version2, __meta);
  }
  return context;
}
__name(createCoreContext, "createCoreContext");
function isTranslateFallbackWarn(fallback, key) {
  return fallback instanceof RegExp ? fallback.test(key) : fallback;
}
__name(isTranslateFallbackWarn, "isTranslateFallbackWarn");
function isTranslateMissingWarn(missing, key) {
  return missing instanceof RegExp ? missing.test(key) : missing;
}
__name(isTranslateMissingWarn, "isTranslateMissingWarn");
function handleMissing(context, key, locale2, missingWarn, type) {
  const { missing, onWarn } = context;
  if (false) {
    const emitter = context.__v_emitter;
    if (emitter) {
      emitter.emit("missing", {
        locale: locale2,
        key,
        type,
        groupId: `${type}:${key}`
      });
    }
  }
  if (missing !== null) {
    const ret = missing(context, locale2, key, type);
    return isString$5(ret) ? ret : key;
  } else {
    if (false) {
      onWarn(getWarnMessage$1(CoreWarnCodes.NOT_FOUND_KEY, { key, locale: locale2 }));
    }
    return key;
  }
}
__name(handleMissing, "handleMissing");
function updateFallbackLocale(ctx, locale2, fallback) {
  const context = ctx;
  context.__localeChainCache = /* @__PURE__ */ new Map();
  ctx.localeFallbacker(ctx, fallback, locale2);
}
__name(updateFallbackLocale, "updateFallbackLocale");
function isAlmostSameLocale(locale2, compareLocale) {
  if (locale2 === compareLocale)
    return false;
  return locale2.split("-")[0] === compareLocale.split("-")[0];
}
__name(isAlmostSameLocale, "isAlmostSameLocale");
function isImplicitFallback(targetLocale, locales) {
  const index2 = locales.indexOf(targetLocale);
  if (index2 === -1) {
    return false;
  }
  for (let i2 = index2 + 1; i2 < locales.length; i2++) {
    if (isAlmostSameLocale(targetLocale, locales[i2])) {
      return true;
    }
  }
  return false;
}
__name(isImplicitFallback, "isImplicitFallback");
function format$3(ast) {
  const msg = /* @__PURE__ */ __name((ctx) => formatParts(ctx, ast), "msg");
  return msg;
}
__name(format$3, "format$3");
function formatParts(ctx, ast) {
  const body = ast.b || ast.body;
  if ((body.t || body.type) === 1) {
    const plural = body;
    const cases = plural.c || plural.cases;
    return ctx.plural(cases.reduce((messages2, c) => [
      ...messages2,
      formatMessageParts(ctx, c)
    ], []));
  } else {
    return formatMessageParts(ctx, body);
  }
}
__name(formatParts, "formatParts");
function formatMessageParts(ctx, node3) {
  const _static = node3.s || node3.static;
  if (_static) {
    return ctx.type === "text" ? _static : ctx.normalize([_static]);
  } else {
    const messages2 = (node3.i || node3.items).reduce((acm, c) => [...acm, formatMessagePart(ctx, c)], []);
    return ctx.normalize(messages2);
  }
}
__name(formatMessageParts, "formatMessageParts");
function formatMessagePart(ctx, node3) {
  const type = node3.t || node3.type;
  switch (type) {
    case 3: {
      const text2 = node3;
      return text2.v || text2.value;
    }
    case 9: {
      const literal = node3;
      return literal.v || literal.value;
    }
    case 4: {
      const named = node3;
      return ctx.interpolate(ctx.named(named.k || named.key));
    }
    case 5: {
      const list2 = node3;
      return ctx.interpolate(ctx.list(list2.i != null ? list2.i : list2.index));
    }
    case 6: {
      const linked = node3;
      const modifier = linked.m || linked.modifier;
      return ctx.linked(formatMessagePart(ctx, linked.k || linked.key), modifier ? formatMessagePart(ctx, modifier) : void 0, ctx.type);
    }
    case 7: {
      const linkedKey = node3;
      return linkedKey.v || linkedKey.value;
    }
    case 8: {
      const linkedModifier = node3;
      return linkedModifier.v || linkedModifier.value;
    }
    default:
      throw new Error(`unhandled node type on format message part: ${type}`);
  }
}
__name(formatMessagePart, "formatMessagePart");
const WARN_MESSAGE = `Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.`;
function checkHtmlMessage(source, warnHtmlMessage) {
  if (warnHtmlMessage && detectHtmlTag(source)) {
    warn$1(format$5(WARN_MESSAGE, { source }));
  }
}
__name(checkHtmlMessage, "checkHtmlMessage");
const defaultOnCacheKey = /* @__PURE__ */ __name((message3) => message3, "defaultOnCacheKey");
let compileCache = /* @__PURE__ */ Object.create(null);
function onCompileWarn(_warn) {
  if (_warn.code === CompileWarnCodes.USE_MODULO_SYNTAX) {
    warn$1(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10.
reference: https://vue-i18n.intlify.dev/guide/essentials/syntax#rails-i18n-format 
(message compiler warning message: ${_warn.message})`);
  }
}
__name(onCompileWarn, "onCompileWarn");
function clearCompileCache() {
  compileCache = /* @__PURE__ */ Object.create(null);
}
__name(clearCompileCache, "clearCompileCache");
const isMessageAST = /* @__PURE__ */ __name((val) => isObject$3(val) && (val.t === 0 || val.type === 0) && ("b" in val || "body" in val), "isMessageAST");
function baseCompile(message3, options4 = {}) {
  let detectError = false;
  const onError = options4.onError || defaultOnError;
  options4.onError = (err) => {
    detectError = true;
    onError(err);
  };
  return { ...baseCompile$1(message3, options4), detectError };
}
__name(baseCompile, "baseCompile");
const compileToFunction = /* @__PURE__ */ __name(/* @__NO_SIDE_EFFECTS__ */ (message3, context) => {
  if (!isString$5(message3)) {
    throw createCoreError(CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE);
  }
  if (false) {
    context.onWarn = onCompileWarn;
  }
  {
    const warnHtmlMessage = isBoolean$1(context.warnHtmlMessage) ? context.warnHtmlMessage : true;
    const onCacheKey = context.onCacheKey || defaultOnCacheKey;
    const cacheKey = onCacheKey(message3);
    const cached = compileCache[cacheKey];
    if (cached) {
      return cached;
    }
    const { code: code2, detectError } = baseCompile(message3, context);
    const msg = new Function(`return ${code2}`)();
    return !detectError ? compileCache[cacheKey] = msg : msg;
  }
}, "compileToFunction");
function compile$1(message3, context) {
  if (false) {
    context.onWarn = onCompileWarn;
  }
  if (__INTLIFY_JIT_COMPILATION__ && !__INTLIFY_DROP_MESSAGE_COMPILER__ && isString$5(message3)) {
    const warnHtmlMessage = isBoolean$1(context.warnHtmlMessage) ? context.warnHtmlMessage : true;
    const onCacheKey = context.onCacheKey || defaultOnCacheKey;
    const cacheKey = onCacheKey(message3);
    const cached = compileCache[cacheKey];
    if (cached) {
      return cached;
    }
    const { ast, detectError } = baseCompile(message3, {
      ...context,
      location: false,
      jit: true
    });
    const msg = format$3(ast);
    return !detectError ? compileCache[cacheKey] = msg : msg;
  } else {
    if (false) {
      warn$1(`the message that is resolve with key '${context.key}' is not supported for jit compilation`);
      return () => message3;
    }
    const cacheKey = message3.cacheKey;
    if (cacheKey) {
      const cached = compileCache[cacheKey];
      if (cached) {
        return cached;
      }
      return compileCache[cacheKey] = format$3(message3);
    } else {
      return format$3(message3);
    }
  }
}
__name(compile$1, "compile$1");
const NOOP_MESSAGE_FUNCTION = /* @__PURE__ */ __name(() => "", "NOOP_MESSAGE_FUNCTION");
const isMessageFunction = /* @__PURE__ */ __name((val) => isFunction$2(val), "isMessageFunction");
function translate(context, ...args) {
  const { fallbackFormat, postTranslation, unresolving, messageCompiler, fallbackLocale, messages: messages2 } = context;
  const [key, options4] = parseTranslateArgs(...args);
  const missingWarn = isBoolean$1(options4.missingWarn) ? options4.missingWarn : context.missingWarn;
  const fallbackWarn = isBoolean$1(options4.fallbackWarn) ? options4.fallbackWarn : context.fallbackWarn;
  const escapeParameter = isBoolean$1(options4.escapeParameter) ? options4.escapeParameter : context.escapeParameter;
  const resolvedMessage = !!options4.resolvedMessage;
  const defaultMsgOrKey = isString$5(options4.default) || isBoolean$1(options4.default) ? !isBoolean$1(options4.default) ? options4.default : !messageCompiler ? () => key : key : fallbackFormat ? !messageCompiler ? () => key : key : "";
  const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== "";
  const locale2 = getLocale(context, options4);
  escapeParameter && escapeParams(options4);
  let [formatScope, targetLocale, message3] = !resolvedMessage ? resolveMessageFormat(context, key, locale2, fallbackLocale, fallbackWarn, missingWarn) : [
    key,
    locale2,
    messages2[locale2] || {}
  ];
  let format2 = formatScope;
  let cacheBaseKey = key;
  if (!resolvedMessage && !(isString$5(format2) || isMessageAST(format2) || isMessageFunction(format2))) {
    if (enableDefaultMsg) {
      format2 = defaultMsgOrKey;
      cacheBaseKey = format2;
    }
  }
  if (!resolvedMessage && (!(isString$5(format2) || isMessageAST(format2) || isMessageFunction(format2)) || !isString$5(targetLocale))) {
    return unresolving ? NOT_REOSLVED : key;
  }
  if (false) {
    warn$1(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${key}'.`);
    return key;
  }
  let occurred = false;
  const onError = /* @__PURE__ */ __name(() => {
    occurred = true;
  }, "onError");
  const msg = !isMessageFunction(format2) ? compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, onError) : format2;
  if (occurred) {
    return format2;
  }
  const ctxOptions = getMessageContextOptions(context, targetLocale, message3, options4);
  const msgContext = createMessageContext(ctxOptions);
  const messaged = evaluateMessage(context, msg, msgContext);
  const ret = postTranslation ? postTranslation(messaged, key) : messaged;
  if (__INTLIFY_PROD_DEVTOOLS__) {
    const payloads = {
      timestamp: Date.now(),
      key: isString$5(key) ? key : isMessageFunction(format2) ? format2.key : "",
      locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""),
      format: isString$5(format2) ? format2 : isMessageFunction(format2) ? format2.source : "",
      message: ret
    };
    payloads.meta = assign$4({}, context.__meta, /* @__PURE__ */ getAdditionalMeta() || {});
    translateDevTools(payloads);
  }
  return ret;
}
__name(translate, "translate");
function escapeParams(options4) {
  if (isArray$1(options4.list)) {
    options4.list = options4.list.map((item3) => isString$5(item3) ? escapeHtml$1(item3) : item3);
  } else if (isObject$3(options4.named)) {
    Object.keys(options4.named).forEach((key) => {
      if (isString$5(options4.named[key])) {
        options4.named[key] = escapeHtml$1(options4.named[key]);
      }
    });
  }
}
__name(escapeParams, "escapeParams");
function resolveMessageFormat(context, key, locale2, fallbackLocale, fallbackWarn, missingWarn) {
  const { messages: messages2, onWarn, messageResolver: resolveValue2, localeFallbacker } = context;
  const locales = localeFallbacker(context, fallbackLocale, locale2);
  let message3 = {};
  let targetLocale;
  let format2 = null;
  let from2 = locale2;
  let to = null;
  const type = "translate";
  for (let i2 = 0; i2 < locales.length; i2++) {
    targetLocale = to = locales[i2];
    if (false) {
      onWarn(getWarnMessage$1(CoreWarnCodes.FALLBACK_TO_TRANSLATE, {
        key,
        target: targetLocale
      }));
    }
    if (false) {
      const emitter = context.__v_emitter;
      if (emitter) {
        emitter.emit("fallback", {
          type,
          key,
          from: from2,
          to,
          groupId: `${type}:${key}`
        });
      }
    }
    message3 = messages2[targetLocale] || {};
    let start2 = null;
    let startTag;
    let endTag;
    if (false) {
      start2 = window.performance.now();
      startTag = "intlify-message-resolve-start";
      endTag = "intlify-message-resolve-end";
      mark && mark(startTag);
    }
    if ((format2 = resolveValue2(message3, key)) === null) {
      format2 = message3[key];
    }
    if (false) {
      const end = window.performance.now();
      const emitter = context.__v_emitter;
      if (emitter && start2 && format2) {
        emitter.emit("message-resolve", {
          type: "message-resolve",
          key,
          message: format2,
          time: end - start2,
          groupId: `${type}:${key}`
        });
      }
      if (startTag && endTag && mark && measure) {
        mark(endTag);
        measure("intlify message resolve", startTag, endTag);
      }
    }
    if (isString$5(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;
      }
    }
    from2 = to;
  }
  return [format2, targetLocale, message3];
}
__name(resolveMessageFormat, "resolveMessageFormat");
function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, onError) {
  const { messageCompiler, warnHtmlMessage } = context;
  if (isMessageFunction(format2)) {
    const msg2 = format2;
    msg2.locale = msg2.locale || targetLocale;
    msg2.key = msg2.key || key;
    return msg2;
  }
  if (messageCompiler == null) {
    const msg2 = /* @__PURE__ */ __name(() => format2, "msg2");
    msg2.locale = targetLocale;
    msg2.key = key;
    return msg2;
  }
  let start2 = null;
  let startTag;
  let endTag;
  if (false) {
    start2 = window.performance.now();
    startTag = "intlify-message-compilation-start";
    endTag = "intlify-message-compilation-end";
    mark && mark(startTag);
  }
  const msg = messageCompiler(format2, getCompileContext(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, onError));
  if (false) {
    const end = window.performance.now();
    const emitter = context.__v_emitter;
    if (emitter && start2) {
      emitter.emit("message-compilation", {
        type: "message-compilation",
        message: format2,
        time: end - start2,
        groupId: `${"translate"}:${key}`
      });
    }
    if (startTag && endTag && mark && measure) {
      mark(endTag);
      measure("intlify message compilation", startTag, endTag);
    }
  }
  msg.locale = targetLocale;
  msg.key = key;
  msg.source = format2;
  return msg;
}
__name(compileMessageFormat, "compileMessageFormat");
function evaluateMessage(context, msg, msgCtx) {
  let start2 = null;
  let startTag;
  let endTag;
  if (false) {
    start2 = window.performance.now();
    startTag = "intlify-message-evaluation-start";
    endTag = "intlify-message-evaluation-end";
    mark && mark(startTag);
  }
  const messaged = msg(msgCtx);
  if (false) {
    const end = window.performance.now();
    const emitter = context.__v_emitter;
    if (emitter && start2) {
      emitter.emit("message-evaluation", {
        type: "message-evaluation",
        value: messaged,
        time: end - start2,
        groupId: `${"translate"}:${msg.key}`
      });
    }
    if (startTag && endTag && mark && measure) {
      mark(endTag);
      measure("intlify message evaluation", startTag, endTag);
    }
  }
  return messaged;
}
__name(evaluateMessage, "evaluateMessage");
function parseTranslateArgs(...args) {
  const [arg1, arg2, arg3] = args;
  const options4 = {};
  if (!isString$5(arg1) && !isNumber$3(arg1) && !isMessageFunction(arg1) && !isMessageAST(arg1)) {
    throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
  }
  const key = isNumber$3(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1;
  if (isNumber$3(arg2)) {
    options4.plural = arg2;
  } else if (isString$5(arg2)) {
    options4.default = arg2;
  } else if (isPlainObject$1(arg2) && !isEmptyObject$1(arg2)) {
    options4.named = arg2;
  } else if (isArray$1(arg2)) {
    options4.list = arg2;
  }
  if (isNumber$3(arg3)) {
    options4.plural = arg3;
  } else if (isString$5(arg3)) {
    options4.default = arg3;
  } else if (isPlainObject$1(arg3)) {
    assign$4(options4, arg3);
  }
  return [key, options4];
}
__name(parseTranslateArgs, "parseTranslateArgs");
function getCompileContext(context, locale2, key, source, warnHtmlMessage, onError) {
  return {
    locale: locale2,
    key,
    warnHtmlMessage,
    onError: /* @__PURE__ */ __name((err) => {
      onError && onError(err);
      if (false) {
        const _source = getSourceForCodeFrame(source);
        const message3 = `Message compilation error: ${err.message}`;
        const codeFrame = err.location && _source && generateCodeFrame(_source, err.location.start.offset, err.location.end.offset);
        const emitter = context.__v_emitter;
        if (emitter && _source) {
          emitter.emit("compile-error", {
            message: _source,
            error: err.message,
            start: err.location && err.location.start.offset,
            end: err.location && err.location.end.offset,
            groupId: `${"translate"}:${key}`
          });
        }
        console.error(codeFrame ? `${message3}
${codeFrame}` : message3);
      } else {
        throw err;
      }
    }, "onError"),
    onCacheKey: /* @__PURE__ */ __name((source2) => generateFormatCacheKey(locale2, key, source2), "onCacheKey")
  };
}
__name(getCompileContext, "getCompileContext");
function getSourceForCodeFrame(source) {
  if (isString$5(source)) {
    return source;
  } else {
    if (source.loc && source.loc.source) {
      return source.loc.source;
    }
  }
}
__name(getSourceForCodeFrame, "getSourceForCodeFrame");
function getMessageContextOptions(context, locale2, message3, options4) {
  const { modifiers: modifiers2, pluralRules, messageResolver: resolveValue2, fallbackLocale, fallbackWarn, missingWarn, fallbackContext } = context;
  const resolveMessage = /* @__PURE__ */ __name((key) => {
    let val = resolveValue2(message3, key);
    if (val == null && fallbackContext) {
      const [, , message22] = resolveMessageFormat(fallbackContext, key, locale2, fallbackLocale, fallbackWarn, missingWarn);
      val = resolveValue2(message22, key);
    }
    if (isString$5(val) || isMessageAST(val)) {
      let occurred = false;
      const onError = /* @__PURE__ */ __name(() => {
        occurred = true;
      }, "onError");
      const msg = compileMessageFormat(context, key, locale2, val, key, onError);
      return !occurred ? msg : NOOP_MESSAGE_FUNCTION;
    } else if (isMessageFunction(val)) {
      return val;
    } else {
      return NOOP_MESSAGE_FUNCTION;
    }
  }, "resolveMessage");
  const ctxOptions = {
    locale: locale2,
    modifiers: modifiers2,
    pluralRules,
    messages: resolveMessage
  };
  if (context.processor) {
    ctxOptions.processor = context.processor;
  }
  if (options4.list) {
    ctxOptions.list = options4.list;
  }
  if (options4.named) {
    ctxOptions.named = options4.named;
  }
  if (isNumber$3(options4.plural)) {
    ctxOptions.pluralIndex = options4.plural;
  }
  return ctxOptions;
}
__name(getMessageContextOptions, "getMessageContextOptions");
const intlDefined = typeof Intl !== "undefined";
const Availabilities = {
  dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== "undefined",
  numberFormat: intlDefined && typeof Intl.NumberFormat !== "undefined"
};
function datetime(context, ...args) {
  const { datetimeFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;
  const { __datetimeFormatters } = context;
  if (false) {
    onWarn(getWarnMessage$1(CoreWarnCodes.CANNOT_FORMAT_DATE));
    return MISSING_RESOLVE_VALUE;
  }
  const [key, value4, options4, overrides] = parseDateTimeArgs(...args);
  const missingWarn = isBoolean$1(options4.missingWarn) ? options4.missingWarn : context.missingWarn;
  const fallbackWarn = isBoolean$1(options4.fallbackWarn) ? options4.fallbackWarn : context.fallbackWarn;
  const part = !!options4.part;
  const locale2 = getLocale(context, options4);
  const locales = localeFallbacker(
    context,
    // eslint-disable-line @typescript-eslint/no-explicit-any
    fallbackLocale,
    locale2
  );
  if (!isString$5(key) || key === "") {
    return new Intl.DateTimeFormat(locale2, overrides).format(value4);
  }
  let datetimeFormat = {};
  let targetLocale;
  let format2 = null;
  let from2 = locale2;
  let to = null;
  const type = "datetime format";
  for (let i2 = 0; i2 < locales.length; i2++) {
    targetLocale = to = locales[i2];
    if (false) {
      onWarn(getWarnMessage$1(CoreWarnCodes.FALLBACK_TO_DATE_FORMAT, {
        key,
        target: targetLocale
      }));
    }
    if (false) {
      const emitter = context.__v_emitter;
      if (emitter) {
        emitter.emit("fallback", {
          type,
          key,
          from: from2,
          to,
          groupId: `${type}:${key}`
        });
      }
    }
    datetimeFormat = datetimeFormats[targetLocale] || {};
    format2 = datetimeFormat[key];
    if (isPlainObject$1(format2))
      break;
    handleMissing(context, key, targetLocale, missingWarn, type);
    from2 = to;
  }
  if (!isPlainObject$1(format2) || !isString$5(targetLocale)) {
    return unresolving ? NOT_REOSLVED : key;
  }
  let id3 = `${targetLocale}__${key}`;
  if (!isEmptyObject$1(overrides)) {
    id3 = `${id3}__${JSON.stringify(overrides)}`;
  }
  let formatter = __datetimeFormatters.get(id3);
  if (!formatter) {
    formatter = new Intl.DateTimeFormat(targetLocale, assign$4({}, format2, overrides));
    __datetimeFormatters.set(id3, formatter);
  }
  return !part ? formatter.format(value4) : formatter.formatToParts(value4);
}
__name(datetime, "datetime");
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 options4 = {};
  let overrides = {};
  let value4;
  if (isString$5(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();
    value4 = new Date(dateTime);
    try {
      value4.toISOString();
    } catch (e2) {
      throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
    }
  } else if (isDate(arg1)) {
    if (isNaN(arg1.getTime())) {
      throw createCoreError(CoreErrorCodes.INVALID_DATE_ARGUMENT);
    }
    value4 = arg1;
  } else if (isNumber$3(arg1)) {
    value4 = arg1;
  } else {
    throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
  }
  if (isString$5(arg2)) {
    options4.key = arg2;
  } else if (isPlainObject$1(arg2)) {
    Object.keys(arg2).forEach((key) => {
      if (DATETIME_FORMAT_OPTIONS_KEYS.includes(key)) {
        overrides[key] = arg2[key];
      } else {
        options4[key] = arg2[key];
      }
    });
  }
  if (isString$5(arg3)) {
    options4.locale = arg3;
  } else if (isPlainObject$1(arg3)) {
    overrides = arg3;
  }
  if (isPlainObject$1(arg4)) {
    overrides = arg4;
  }
  return [options4.key || "", value4, options4, overrides];
}
__name(parseDateTimeArgs, "parseDateTimeArgs");
function clearDateTimeFormat(ctx, locale2, format2) {
  const context = ctx;
  for (const key in format2) {
    const id3 = `${locale2}__${key}`;
    if (!context.__datetimeFormatters.has(id3)) {
      continue;
    }
    context.__datetimeFormatters.delete(id3);
  }
}
__name(clearDateTimeFormat, "clearDateTimeFormat");
function number(context, ...args) {
  const { numberFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;
  const { __numberFormatters } = context;
  if (false) {
    onWarn(getWarnMessage$1(CoreWarnCodes.CANNOT_FORMAT_NUMBER));
    return MISSING_RESOLVE_VALUE;
  }
  const [key, value4, options4, overrides] = parseNumberArgs(...args);
  const missingWarn = isBoolean$1(options4.missingWarn) ? options4.missingWarn : context.missingWarn;
  const fallbackWarn = isBoolean$1(options4.fallbackWarn) ? options4.fallbackWarn : context.fallbackWarn;
  const part = !!options4.part;
  const locale2 = getLocale(context, options4);
  const locales = localeFallbacker(
    context,
    // eslint-disable-line @typescript-eslint/no-explicit-any
    fallbackLocale,
    locale2
  );
  if (!isString$5(key) || key === "") {
    return new Intl.NumberFormat(locale2, overrides).format(value4);
  }
  let numberFormat = {};
  let targetLocale;
  let format2 = null;
  let from2 = locale2;
  let to = null;
  const type = "number format";
  for (let i2 = 0; i2 < locales.length; i2++) {
    targetLocale = to = locales[i2];
    if (false) {
      onWarn(getWarnMessage$1(CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT, {
        key,
        target: targetLocale
      }));
    }
    if (false) {
      const emitter = context.__v_emitter;
      if (emitter) {
        emitter.emit("fallback", {
          type,
          key,
          from: from2,
          to,
          groupId: `${type}:${key}`
        });
      }
    }
    numberFormat = numberFormats[targetLocale] || {};
    format2 = numberFormat[key];
    if (isPlainObject$1(format2))
      break;
    handleMissing(context, key, targetLocale, missingWarn, type);
    from2 = to;
  }
  if (!isPlainObject$1(format2) || !isString$5(targetLocale)) {
    return unresolving ? NOT_REOSLVED : key;
  }
  let id3 = `${targetLocale}__${key}`;
  if (!isEmptyObject$1(overrides)) {
    id3 = `${id3}__${JSON.stringify(overrides)}`;
  }
  let formatter = __numberFormatters.get(id3);
  if (!formatter) {
    formatter = new Intl.NumberFormat(targetLocale, assign$4({}, format2, overrides));
    __numberFormatters.set(id3, formatter);
  }
  return !part ? formatter.format(value4) : formatter.formatToParts(value4);
}
__name(number, "number");
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 options4 = {};
  let overrides = {};
  if (!isNumber$3(arg1)) {
    throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
  }
  const value4 = arg1;
  if (isString$5(arg2)) {
    options4.key = arg2;
  } else if (isPlainObject$1(arg2)) {
    Object.keys(arg2).forEach((key) => {
      if (NUMBER_FORMAT_OPTIONS_KEYS.includes(key)) {
        overrides[key] = arg2[key];
      } else {
        options4[key] = arg2[key];
      }
    });
  }
  if (isString$5(arg3)) {
    options4.locale = arg3;
  } else if (isPlainObject$1(arg3)) {
    overrides = arg3;
  }
  if (isPlainObject$1(arg4)) {
    overrides = arg4;
  }
  return [options4.key || "", value4, options4, overrides];
}
__name(parseNumberArgs, "parseNumberArgs");
function clearNumberFormat(ctx, locale2, format2) {
  const context = ctx;
  for (const key in format2) {
    const id3 = `${locale2}__${key}`;
    if (!context.__numberFormatters.has(id3)) {
      continue;
    }
    context.__numberFormatters.delete(id3);
  }
}
__name(clearNumberFormat, "clearNumberFormat");
{
  initFeatureFlags$1();
}
/*!
  * vue-i18n v9.13.1
  * (c) 2024 kazuya kawaguchi
  * Released under the MIT License.
  */
const VERSION = "9.13.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;
  }
}
__name(initFeatureFlags, "initFeatureFlags");
const code$1$1 = CoreWarnCodes.__EXTEND_POINT__;
const inc$1 = incrementer(code$1$1);
const I18nWarnCodes = {
  FALLBACK_TO_ROOT: code$1$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 warnMessages = {
  [I18nWarnCodes.FALLBACK_TO_ROOT]: `Fall back to {type} '{key}' with root locale.`,
  [I18nWarnCodes.NOT_SUPPORTED_PRESERVE]: `Not supported 'preserve'.`,
  [I18nWarnCodes.NOT_SUPPORTED_FORMATTER]: `Not supported 'formatter'.`,
  [I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE]: `Not supported 'preserveDirectiveContent'.`,
  [I18nWarnCodes.NOT_SUPPORTED_GET_CHOICE_INDEX]: `Not supported 'getChoiceIndex'.`,
  [I18nWarnCodes.COMPONENT_NAME_LEGACY_COMPATIBLE]: `Component name legacy compatible: '{name}' -> 'i18n'`,
  [I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]: `Not found parent scope. use the global scope.`,
  [I18nWarnCodes.IGNORE_OBJ_FLATTEN]: `Ignore object flatten: '{key}' key has an string value`,
  [I18nWarnCodes.NOTICE_DROP_ALLOW_COMPOSITION]: `'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze`,
  [I18nWarnCodes.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]: `'translateExistCompatible' option will be dropped in the next major version.`
};
function getWarnMessage(code2, ...args) {
  return format$5(warnMessages[code2], ...args);
}
__name(getWarnMessage, "getWarnMessage");
const code$2 = CoreErrorCodes.__EXTEND_POINT__;
const inc = incrementer(code$2);
const I18nErrorCodes = {
  // composer module errors
  UNEXPECTED_RETURN_TYPE: code$2,
  // 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, false ? { messages: errorMessages, args } : void 0);
}
__name(createI18nError, "createI18nError");
const errorMessages = {
  [I18nErrorCodes.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
  [I18nErrorCodes.INVALID_ARGUMENT]: "Invalid argument",
  [I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function",
  [I18nErrorCodes.NOT_INSTALLED]: "Need to install with `app.use` function",
  [I18nErrorCodes.UNEXPECTED_ERROR]: "Unexpected error",
  [I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE]: "Not available in legacy mode",
  [I18nErrorCodes.REQUIRED_VALUE]: `Required in value: {0}`,
  [I18nErrorCodes.INVALID_VALUE]: `Invalid value`,
  [I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: `Cannot setup vue-devtools plugin`,
  [I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
  [I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.",
  [I18nErrorCodes.BRIDGE_SUPPORT_VUE_2_ONLY]: "vue-i18n-bridge support Vue 2.x only",
  [I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]: "Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",
  [I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"
};
const TranslateVNodeSymbol = /* @__PURE__ */ makeSymbol("__translateVNode");
const DatetimePartsSymbol = /* @__PURE__ */ makeSymbol("__datetimeParts");
const NumberPartsSymbol = /* @__PURE__ */ makeSymbol("__numberParts");
const EnableEmitter = /* @__PURE__ */ makeSymbol("__enableEmitter");
const DisableEmitter = /* @__PURE__ */ makeSymbol("__disableEmitter");
const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
makeSymbol("__intlifyMeta");
const InejctWithOptionSymbol = /* @__PURE__ */ makeSymbol("__injectWithOption");
const DisposeSymbol = /* @__PURE__ */ makeSymbol("__dispose");
const __VUE_I18N_BRIDGE__ = "__VUE_I18N_BRIDGE__";
function handleFlatJson(obj) {
  if (!isObject$3(obj)) {
    return obj;
  }
  for (const key in obj) {
    if (!hasOwn$1(obj, key)) {
      continue;
    }
    if (!key.includes(".")) {
      if (isObject$3(obj[key])) {
        handleFlatJson(obj[key]);
      }
    } else {
      const subKeys = key.split(".");
      const lastIndex2 = subKeys.length - 1;
      let currentObj = obj;
      let hasStringValue = false;
      for (let i2 = 0; i2 < lastIndex2; i2++) {
        if (!(subKeys[i2] in currentObj)) {
          currentObj[subKeys[i2]] = {};
        }
        if (!isObject$3(currentObj[subKeys[i2]])) {
          hasStringValue = true;
          break;
        }
        currentObj = currentObj[subKeys[i2]];
      }
      if (!hasStringValue) {
        currentObj[subKeys[lastIndex2]] = obj[key];
        delete obj[key];
      }
      if (isObject$3(currentObj[subKeys[lastIndex2]])) {
        handleFlatJson(currentObj[subKeys[lastIndex2]]);
      }
    }
  }
  return obj;
}
__name(handleFlatJson, "handleFlatJson");
function getLocaleMessages(locale2, options4) {
  const { messages: messages2, __i18n, messageResolver, flatJson } = options4;
  const ret = isPlainObject$1(messages2) ? messages2 : isArray$1(__i18n) ? {} : { [locale2]: {} };
  if (isArray$1(__i18n)) {
    __i18n.forEach((custom2) => {
      if ("locale" in custom2 && "resource" in custom2) {
        const { locale: locale22, resource } = custom2;
        if (locale22) {
          ret[locale22] = ret[locale22] || {};
          deepCopy(resource, ret[locale22]);
        } else {
          deepCopy(resource, ret);
        }
      } else {
        isString$5(custom2) && deepCopy(JSON.parse(custom2), ret);
      }
    });
  }
  if (messageResolver == null && flatJson) {
    for (const key in ret) {
      if (hasOwn$1(ret, key)) {
        handleFlatJson(ret[key]);
      }
    }
  }
  return ret;
}
__name(getLocaleMessages, "getLocaleMessages");
function getComponentOptions(instance) {
  return instance.type;
}
__name(getComponentOptions, "getComponentOptions");
function adjustI18nResources(gl, options4, componentOptions) {
  let messages2 = isObject$3(options4.messages) ? options4.messages : {};
  if ("__i18nGlobal" in componentOptions) {
    messages2 = getLocaleMessages(gl.locale.value, {
      messages: messages2,
      __i18n: componentOptions.__i18nGlobal
    });
  }
  const locales = Object.keys(messages2);
  if (locales.length) {
    locales.forEach((locale2) => {
      gl.mergeLocaleMessage(locale2, messages2[locale2]);
    });
  }
  {
    if (isObject$3(options4.datetimeFormats)) {
      const locales2 = Object.keys(options4.datetimeFormats);
      if (locales2.length) {
        locales2.forEach((locale2) => {
          gl.mergeDateTimeFormat(locale2, options4.datetimeFormats[locale2]);
        });
      }
    }
    if (isObject$3(options4.numberFormats)) {
      const locales2 = Object.keys(options4.numberFormats);
      if (locales2.length) {
        locales2.forEach((locale2) => {
          gl.mergeNumberFormat(locale2, options4.numberFormats[locale2]);
        });
      }
    }
  }
}
__name(adjustI18nResources, "adjustI18nResources");
function createTextNode(key) {
  return createVNode(Text$4, null, key, 0);
}
__name(createTextNode, "createTextNode");
const DEVTOOLS_META = "__INTLIFY_META__";
const NOOP_RETURN_ARRAY = /* @__PURE__ */ __name(() => [], "NOOP_RETURN_ARRAY");
const NOOP_RETURN_FALSE = /* @__PURE__ */ __name(() => false, "NOOP_RETURN_FALSE");
let composerID = 0;
function defineCoreMissingHandler(missing) {
  return (ctx, locale2, key, type) => {
    return missing(locale2, key, getCurrentInstance() || void 0, type);
  };
}
__name(defineCoreMissingHandler, "defineCoreMissingHandler");
const getMetaInfo = /* @__PURE__ */ __name(/* @__NO_SIDE_EFFECTS__ */ () => {
  const instance = getCurrentInstance();
  let meta = null;
  return instance && (meta = getComponentOptions(instance)[DEVTOOLS_META]) ? { [DEVTOOLS_META]: meta } : null;
}, "getMetaInfo");
function createComposer(options4 = {}, VueI18nLegacy) {
  const { __root, __injectWithOption } = options4;
  const _isGlobal = __root === void 0;
  const flatJson = options4.flatJson;
  const _ref = inBrowser ? ref : shallowRef;
  const translateExistCompatible = !!options4.translateExistCompatible;
  if (false) {
    if (translateExistCompatible && true) {
      warnOnce(getWarnMessage(I18nWarnCodes.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));
    }
  }
  let _inheritLocale = isBoolean$1(options4.inheritLocale) ? options4.inheritLocale : true;
  const _locale = _ref(
    // prettier-ignore
    __root && _inheritLocale ? __root.locale.value : isString$5(options4.locale) ? options4.locale : DEFAULT_LOCALE
  );
  const _fallbackLocale = _ref(
    // prettier-ignore
    __root && _inheritLocale ? __root.fallbackLocale.value : isString$5(options4.fallbackLocale) || isArray$1(options4.fallbackLocale) || isPlainObject$1(options4.fallbackLocale) || options4.fallbackLocale === false ? options4.fallbackLocale : _locale.value
  );
  const _messages = _ref(getLocaleMessages(_locale.value, options4));
  const _datetimeFormats = _ref(isPlainObject$1(options4.datetimeFormats) ? options4.datetimeFormats : { [_locale.value]: {} });
  const _numberFormats = _ref(isPlainObject$1(options4.numberFormats) ? options4.numberFormats : { [_locale.value]: {} });
  let _missingWarn = __root ? __root.missingWarn : isBoolean$1(options4.missingWarn) || isRegExp$2(options4.missingWarn) ? options4.missingWarn : true;
  let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean$1(options4.fallbackWarn) || isRegExp$2(options4.fallbackWarn) ? options4.fallbackWarn : true;
  let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean$1(options4.fallbackRoot) ? options4.fallbackRoot : true;
  let _fallbackFormat = !!options4.fallbackFormat;
  let _missing = isFunction$2(options4.missing) ? options4.missing : null;
  let _runtimeMissing = isFunction$2(options4.missing) ? defineCoreMissingHandler(options4.missing) : null;
  let _postTranslation = isFunction$2(options4.postTranslation) ? options4.postTranslation : null;
  let _warnHtmlMessage = __root ? __root.warnHtmlMessage : isBoolean$1(options4.warnHtmlMessage) ? options4.warnHtmlMessage : true;
  let _escapeParameter = !!options4.escapeParameter;
  const _modifiers = __root ? __root.modifiers : isPlainObject$1(options4.modifiers) ? options4.modifiers : {};
  let _pluralRules = options4.pluralRules || __root && __root.pluralRules;
  let _context;
  const getCoreContext = /* @__PURE__ */ __name(() => {
    _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: options4.messageResolver,
      messageCompiler: options4.messageCompiler,
      __meta: { framework: "vue" }
    };
    {
      ctxOptions.datetimeFormats = _datetimeFormats.value;
      ctxOptions.numberFormats = _numberFormats.value;
      ctxOptions.__datetimeFormatters = isPlainObject$1(_context) ? _context.__datetimeFormatters : void 0;
      ctxOptions.__numberFormatters = isPlainObject$1(_context) ? _context.__numberFormatters : void 0;
    }
    if (false) {
      ctxOptions.__v_emitter = isPlainObject$1(_context) ? _context.__v_emitter : void 0;
    }
    const ctx = createCoreContext(ctxOptions);
    _isGlobal && setFallbackContext(ctx);
    return ctx;
  }, "getCoreContext");
  _context = getCoreContext();
  updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
  function trackReactivityValues() {
    return [
      _locale.value,
      _fallbackLocale.value,
      _messages.value,
      _datetimeFormats.value,
      _numberFormats.value
    ];
  }
  __name(trackReactivityValues, "trackReactivityValues");
  const locale2 = computed({
    get: /* @__PURE__ */ __name(() => _locale.value, "get"),
    set: /* @__PURE__ */ __name((val) => {
      _locale.value = val;
      _context.locale = _locale.value;
    }, "set")
  });
  const fallbackLocale = computed({
    get: /* @__PURE__ */ __name(() => _fallbackLocale.value, "get"),
    set: /* @__PURE__ */ __name((val) => {
      _fallbackLocale.value = val;
      _context.fallbackLocale = _fallbackLocale.value;
      updateFallbackLocale(_context, _locale.value, val);
    }, "set")
  });
  const messages2 = computed(() => _messages.value);
  const datetimeFormats = /* @__PURE__ */ computed(() => _datetimeFormats.value);
  const numberFormats = /* @__PURE__ */ computed(() => _numberFormats.value);
  function getPostTranslationHandler() {
    return isFunction$2(_postTranslation) ? _postTranslation : null;
  }
  __name(getPostTranslationHandler, "getPostTranslationHandler");
  function setPostTranslationHandler(handler6) {
    _postTranslation = handler6;
    _context.postTranslation = handler6;
  }
  __name(setPostTranslationHandler, "setPostTranslationHandler");
  function getMissingHandler() {
    return _missing;
  }
  __name(getMissingHandler, "getMissingHandler");
  function setMissingHandler(handler6) {
    if (handler6 !== null) {
      _runtimeMissing = defineCoreMissingHandler(handler6);
    }
    _missing = handler6;
    _context.missing = _runtimeMissing;
  }
  __name(setMissingHandler, "setMissingHandler");
  function isResolvedTranslateMessage(type, arg) {
    return type !== "translate" || !arg.resolvedMessage;
  }
  __name(isResolvedTranslateMessage, "isResolvedTranslateMessage");
  const wrapWithDeps = /* @__PURE__ */ __name((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__) {
        /* @__PURE__ */ setAdditionalMeta(null);
      }
      if (!_isGlobal) {
        _context.fallbackContext = void 0;
      }
    }
    if (warnType !== "translate exists" && // for not `te` (e.g `t`)
    isNumber$3(ret) && ret === NOT_REOSLVED || warnType === "translate exists" && !ret) {
      const [key, arg2] = argumentParser();
      if (false) {
        if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) {
          warn$1(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT, {
            key,
            type: warnType
          }));
        }
        if (false) {
          const { __v_emitter: emitter } = _context;
          if (emitter && _fallbackRoot) {
            emitter.emit("fallback", {
              type: warnType,
              key,
              to: "global",
              groupId: `${warnType}:${key}`
            });
          }
        }
      }
      return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
    } else if (successCondition(ret)) {
      return ret;
    } else {
      throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE);
    }
  }, "wrapWithDeps");
  function t2(...args) {
    return wrapWithDeps((context) => Reflect.apply(translate, null, [context, ...args]), () => parseTranslateArgs(...args), "translate", (root24) => Reflect.apply(root24.t, root24, [...args]), (key) => key, (val) => isString$5(val));
  }
  __name(t2, "t");
  function rt(...args) {
    const [arg1, arg2, arg3] = args;
    if (arg3 && !isObject$3(arg3)) {
      throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
    }
    return t2(...[arg1, arg2, assign$4({ resolvedMessage: true }, arg3 || {})]);
  }
  __name(rt, "rt");
  function d(...args) {
    return wrapWithDeps((context) => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), "datetime format", (root24) => Reflect.apply(root24.d, root24, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString$5(val));
  }
  __name(d, "d");
  function n(...args) {
    return wrapWithDeps((context) => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), "number format", (root24) => Reflect.apply(root24.n, root24, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString$5(val));
  }
  __name(n, "n");
  function normalize3(values) {
    return values.map((val) => isString$5(val) || isNumber$3(val) || isBoolean$1(val) ? createTextNode(String(val)) : val);
  }
  __name(normalize3, "normalize");
  const interpolate = /* @__PURE__ */ __name((val) => val, "interpolate");
  const processor = {
    normalize: normalize3,
    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
      (root24) => root24[TranslateVNodeSymbol](...args),
      (key) => [createTextNode(key)],
      (val) => isArray$1(val)
    );
  }
  __name(translateVNode, "translateVNode");
  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
      (root24) => root24[NumberPartsSymbol](...args),
      NOOP_RETURN_ARRAY,
      (val) => isString$5(val) || isArray$1(val)
    );
  }
  __name(numberParts, "numberParts");
  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
      (root24) => root24[DatetimePartsSymbol](...args),
      NOOP_RETURN_ARRAY,
      (val) => isString$5(val) || isArray$1(val)
    );
  }
  __name(datetimeParts, "datetimeParts");
  function setPluralRules(rules) {
    _pluralRules = rules;
    _context.pluralRules = _pluralRules;
  }
  __name(setPluralRules, "setPluralRules");
  function te2(key, locale22) {
    return wrapWithDeps(() => {
      if (!key) {
        return false;
      }
      const targetLocale = isString$5(locale22) ? locale22 : _locale.value;
      const message3 = getLocaleMessage(targetLocale);
      const resolved = _context.messageResolver(message3, key);
      return !translateExistCompatible ? isMessageAST(resolved) || isMessageFunction(resolved) || isString$5(resolved) : resolved != null;
    }, () => [key], "translate exists", (root24) => {
      return Reflect.apply(root24.te, root24, [key, locale22]);
    }, NOOP_RETURN_FALSE, (val) => isBoolean$1(val));
  }
  __name(te2, "te");
  function resolveMessages(key) {
    let messages22 = null;
    const locales = fallbackWithLocaleChain(_context, _fallbackLocale.value, _locale.value);
    for (let i2 = 0; i2 < locales.length; i2++) {
      const targetLocaleMessages = _messages.value[locales[i2]] || {};
      const messageValue = _context.messageResolver(targetLocaleMessages, key);
      if (messageValue != null) {
        messages22 = messageValue;
        break;
      }
    }
    return messages22;
  }
  __name(resolveMessages, "resolveMessages");
  function tm(key) {
    const messages22 = resolveMessages(key);
    return messages22 != null ? messages22 : __root ? __root.tm(key) || {} : {};
  }
  __name(tm, "tm");
  function getLocaleMessage(locale22) {
    return _messages.value[locale22] || {};
  }
  __name(getLocaleMessage, "getLocaleMessage");
  function setLocaleMessage(locale22, message3) {
    if (flatJson) {
      const _message = { [locale22]: message3 };
      for (const key in _message) {
        if (hasOwn$1(_message, key)) {
          handleFlatJson(_message[key]);
        }
      }
      message3 = _message[locale22];
    }
    _messages.value[locale22] = message3;
    _context.messages = _messages.value;
  }
  __name(setLocaleMessage, "setLocaleMessage");
  function mergeLocaleMessage(locale22, message3) {
    _messages.value[locale22] = _messages.value[locale22] || {};
    const _message = { [locale22]: message3 };
    if (flatJson) {
      for (const key in _message) {
        if (hasOwn$1(_message, key)) {
          handleFlatJson(_message[key]);
        }
      }
    }
    message3 = _message[locale22];
    deepCopy(message3, _messages.value[locale22]);
    _context.messages = _messages.value;
  }
  __name(mergeLocaleMessage, "mergeLocaleMessage");
  function getDateTimeFormat(locale22) {
    return _datetimeFormats.value[locale22] || {};
  }
  __name(getDateTimeFormat, "getDateTimeFormat");
  function setDateTimeFormat(locale22, format2) {
    _datetimeFormats.value[locale22] = format2;
    _context.datetimeFormats = _datetimeFormats.value;
    clearDateTimeFormat(_context, locale22, format2);
  }
  __name(setDateTimeFormat, "setDateTimeFormat");
  function mergeDateTimeFormat(locale22, format2) {
    _datetimeFormats.value[locale22] = assign$4(_datetimeFormats.value[locale22] || {}, format2);
    _context.datetimeFormats = _datetimeFormats.value;
    clearDateTimeFormat(_context, locale22, format2);
  }
  __name(mergeDateTimeFormat, "mergeDateTimeFormat");
  function getNumberFormat(locale22) {
    return _numberFormats.value[locale22] || {};
  }
  __name(getNumberFormat, "getNumberFormat");
  function setNumberFormat(locale22, format2) {
    _numberFormats.value[locale22] = format2;
    _context.numberFormats = _numberFormats.value;
    clearNumberFormat(_context, locale22, format2);
  }
  __name(setNumberFormat, "setNumberFormat");
  function mergeNumberFormat(locale22, format2) {
    _numberFormats.value[locale22] = assign$4(_numberFormats.value[locale22] || {}, format2);
    _context.numberFormats = _numberFormats.value;
    clearNumberFormat(_context, locale22, format2);
  }
  __name(mergeNumberFormat, "mergeNumberFormat");
  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: locale2,
    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: messages2,
    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: t2,
    getLocaleMessage,
    setLocaleMessage,
    mergeLocaleMessage,
    getPostTranslationHandler,
    setPostTranslationHandler,
    getMissingHandler,
    setMissingHandler,
    [SetPluralRulesSymbol]: setPluralRules
  };
  {
    composer.datetimeFormats = datetimeFormats;
    composer.numberFormats = numberFormats;
    composer.rt = rt;
    composer.te = te2;
    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;
  }
  if (false) {
    composer[EnableEmitter] = (emitter) => {
      _context.__v_emitter = emitter;
    };
    composer[DisableEmitter] = () => {
      _context.__v_emitter = void 0;
    };
  }
  return composer;
}
__name(createComposer, "createComposer");
function convertComposerOptions(options4) {
  const locale2 = isString$5(options4.locale) ? options4.locale : DEFAULT_LOCALE;
  const fallbackLocale = isString$5(options4.fallbackLocale) || isArray$1(options4.fallbackLocale) || isPlainObject$1(options4.fallbackLocale) || options4.fallbackLocale === false ? options4.fallbackLocale : locale2;
  const missing = isFunction$2(options4.missing) ? options4.missing : void 0;
  const missingWarn = isBoolean$1(options4.silentTranslationWarn) || isRegExp$2(options4.silentTranslationWarn) ? !options4.silentTranslationWarn : true;
  const fallbackWarn = isBoolean$1(options4.silentFallbackWarn) || isRegExp$2(options4.silentFallbackWarn) ? !options4.silentFallbackWarn : true;
  const fallbackRoot = isBoolean$1(options4.fallbackRoot) ? options4.fallbackRoot : true;
  const fallbackFormat = !!options4.formatFallbackMessages;
  const modifiers2 = isPlainObject$1(options4.modifiers) ? options4.modifiers : {};
  const pluralizationRules = options4.pluralizationRules;
  const postTranslation = isFunction$2(options4.postTranslation) ? options4.postTranslation : void 0;
  const warnHtmlMessage = isString$5(options4.warnHtmlInMessage) ? options4.warnHtmlInMessage !== "off" : true;
  const escapeParameter = !!options4.escapeParameterHtml;
  const inheritLocale = isBoolean$1(options4.sync) ? options4.sync : true;
  if (false) {
    warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER));
  }
  if (false) {
    warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE));
  }
  let messages2 = options4.messages;
  if (isPlainObject$1(options4.sharedMessages)) {
    const sharedMessages = options4.sharedMessages;
    const locales = Object.keys(sharedMessages);
    messages2 = locales.reduce((messages22, locale22) => {
      const message3 = messages22[locale22] || (messages22[locale22] = {});
      assign$4(message3, sharedMessages[locale22]);
      return messages22;
    }, messages2 || {});
  }
  const { __i18n, __root, __injectWithOption } = options4;
  const datetimeFormats = options4.datetimeFormats;
  const numberFormats = options4.numberFormats;
  const flatJson = options4.flatJson;
  const translateExistCompatible = options4.translateExistCompatible;
  return {
    locale: locale2,
    fallbackLocale,
    messages: messages2,
    flatJson,
    datetimeFormats,
    numberFormats,
    missing,
    missingWarn,
    fallbackWarn,
    fallbackRoot,
    fallbackFormat,
    modifiers: modifiers2,
    pluralRules: pluralizationRules,
    postTranslation,
    warnHtmlMessage,
    escapeParameter,
    messageResolver: options4.messageResolver,
    inheritLocale,
    translateExistCompatible,
    __i18n,
    __root,
    __injectWithOption
  };
}
__name(convertComposerOptions, "convertComposerOptions");
function createVueI18n(options4 = {}, VueI18nLegacy) {
  {
    const composer = createComposer(convertComposerOptions(options4));
    const { __extender } = options4;
    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(handler6) {
        composer.setMissingHandler(handler6);
      },
      // silentTranslationWarn
      get silentTranslationWarn() {
        return isBoolean$1(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
      },
      set silentTranslationWarn(val) {
        composer.missingWarn = isBoolean$1(val) ? !val : val;
      },
      // silentFallbackWarn
      get silentFallbackWarn() {
        return isBoolean$1(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
      },
      set silentFallbackWarn(val) {
        composer.fallbackWarn = isBoolean$1(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(handler6) {
        composer.setPostTranslationHandler(handler6);
      },
      // 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 options22 = {};
        let list2 = null;
        let named = null;
        if (!isString$5(arg1)) {
          throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
        }
        const key = arg1;
        if (isString$5(arg2)) {
          options22.locale = arg2;
        } else if (isArray$1(arg2)) {
          list2 = arg2;
        } else if (isPlainObject$1(arg2)) {
          named = arg2;
        }
        if (isArray$1(arg3)) {
          list2 = arg3;
        } else if (isPlainObject$1(arg3)) {
          named = arg3;
        }
        return Reflect.apply(composer.t, composer, [
          key,
          list2 || named || {},
          options22
        ]);
      },
      rt(...args) {
        return Reflect.apply(composer.rt, composer, [...args]);
      },
      // tc
      tc(...args) {
        const [arg1, arg2, arg3] = args;
        const options22 = { plural: 1 };
        let list2 = null;
        let named = null;
        if (!isString$5(arg1)) {
          throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
        }
        const key = arg1;
        if (isString$5(arg2)) {
          options22.locale = arg2;
        } else if (isNumber$3(arg2)) {
          options22.plural = arg2;
        } else if (isArray$1(arg2)) {
          list2 = arg2;
        } else if (isPlainObject$1(arg2)) {
          named = arg2;
        }
        if (isString$5(arg3)) {
          options22.locale = arg3;
        } else if (isArray$1(arg3)) {
          list2 = arg3;
        } else if (isPlainObject$1(arg3)) {
          named = arg3;
        }
        return Reflect.apply(composer.t, composer, [
          key,
          list2 || named || {},
          options22
        ]);
      },
      // te
      te(key, locale2) {
        return composer.te(key, locale2);
      },
      // tm
      tm(key) {
        return composer.tm(key);
      },
      // getLocaleMessage
      getLocaleMessage(locale2) {
        return composer.getLocaleMessage(locale2);
      },
      // setLocaleMessage
      setLocaleMessage(locale2, message3) {
        composer.setLocaleMessage(locale2, message3);
      },
      // mergeLocaleMessage
      mergeLocaleMessage(locale2, message3) {
        composer.mergeLocaleMessage(locale2, message3);
      },
      // d
      d(...args) {
        return Reflect.apply(composer.d, composer, [...args]);
      },
      // getDateTimeFormat
      getDateTimeFormat(locale2) {
        return composer.getDateTimeFormat(locale2);
      },
      // setDateTimeFormat
      setDateTimeFormat(locale2, format2) {
        composer.setDateTimeFormat(locale2, format2);
      },
      // mergeDateTimeFormat
      mergeDateTimeFormat(locale2, format2) {
        composer.mergeDateTimeFormat(locale2, format2);
      },
      // n
      n(...args) {
        return Reflect.apply(composer.n, composer, [...args]);
      },
      // getNumberFormat
      getNumberFormat(locale2) {
        return composer.getNumberFormat(locale2);
      },
      // setNumberFormat
      setNumberFormat(locale2, format2) {
        composer.setNumberFormat(locale2, format2);
      },
      // mergeNumberFormat
      mergeNumberFormat(locale2, format2) {
        composer.mergeNumberFormat(locale2, format2);
      },
      // getChoiceIndex
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      getChoiceIndex(choice, choicesLength) {
        return -1;
      }
    };
    vueI18n.__extender = __extender;
    if (false) {
      vueI18n.__enableEmitter = (emitter) => {
        const __composer = composer;
        __composer[EnableEmitter] && __composer[EnableEmitter](emitter);
      };
      vueI18n.__disableEmitter = () => {
        const __composer = composer;
        __composer[DisableEmitter] && __composer[DisableEmitter]();
      };
    }
    return vueI18n;
  }
}
__name(createVueI18n, "createVueI18n");
const baseFormatProps = {
  tag: {
    type: [String, Object]
  },
  locale: {
    type: String
  },
  scope: {
    type: String,
    // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
    validator: /* @__PURE__ */ __name((val) => val === "parent" || val === "global", "validator"),
    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$1 ? current.children : [current]
      ];
    }, []);
  } else {
    return keys2.reduce((arg, key) => {
      const slot = slots[key];
      if (slot) {
        arg[key] = slot();
      }
      return arg;
    }, {});
  }
}
__name(getInterpolateArg, "getInterpolateArg");
function getFragmentableTag(tag) {
  return Fragment$1;
}
__name(getFragmentableTag, "getFragmentableTag");
const TranslationImpl = /* @__PURE__ */ defineComponent({
  /* eslint-disable */
  name: "i18n-t",
  props: assign$4({
    keypath: {
      type: String,
      required: true
    },
    plural: {
      type: [Number, String],
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      validator: /* @__PURE__ */ __name((val) => isNumber$3(val) || !isNaN(val), "validator")
    }
  }, baseFormatProps),
  /* eslint-enable */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  setup(props, context) {
    const { slots, attrs: attrs4 } = context;
    const i18n2 = props.i18n || useI18n({
      useScope: props.scope,
      __useComponent: true
    });
    return () => {
      const keys2 = Object.keys(slots).filter((key) => key !== "_");
      const options4 = {};
      if (props.locale) {
        options4.locale = props.locale;
      }
      if (props.plural !== void 0) {
        options4.plural = isString$5(props.plural) ? +props.plural : props.plural;
      }
      const arg = getInterpolateArg(context, keys2);
      const children = i18n2[TranslateVNodeSymbol](props.keypath, arg, options4);
      const assignedAttrs = assign$4({}, attrs4);
      const tag = isString$5(props.tag) || isObject$3(props.tag) ? props.tag : getFragmentableTag();
      return h(tag, assignedAttrs, children);
    };
  }
});
const Translation = TranslationImpl;
const I18nT = Translation;
function isVNode(target) {
  return isArray$1(target) && !isString$5(target[0]);
}
__name(isVNode, "isVNode");
function renderFormatter(props, context, slotKeys, partFormatter) {
  const { slots, attrs: attrs4 } = context;
  return () => {
    const options4 = { part: true };
    let overrides = {};
    if (props.locale) {
      options4.locale = props.locale;
    }
    if (isString$5(props.format)) {
      options4.key = props.format;
    } else if (isObject$3(props.format)) {
      if (isString$5(props.format.key)) {
        options4.key = props.format.key;
      }
      overrides = Object.keys(props.format).reduce((options22, prop2) => {
        return slotKeys.includes(prop2) ? assign$4({}, options22, { [prop2]: props.format[prop2] }) : options22;
      }, {});
    }
    const parts2 = partFormatter(...[props.value, options4, overrides]);
    let children = [options4.key];
    if (isArray$1(parts2)) {
      children = parts2.map((part, index2) => {
        const slot = slots[part.type];
        const node3 = slot ? slot({ [part.type]: part.value, index: index2, parts: parts2 }) : [part.value];
        if (isVNode(node3)) {
          node3[0].key = `${part.type}-${index2}`;
        }
        return node3;
      });
    } else if (isString$5(parts2)) {
      children = [parts2];
    }
    const assignedAttrs = assign$4({}, attrs4);
    const tag = isString$5(props.tag) || isObject$3(props.tag) ? props.tag : getFragmentableTag();
    return h(tag, assignedAttrs, children);
  };
}
__name(renderFormatter, "renderFormatter");
const NumberFormatImpl = /* @__PURE__ */ defineComponent({
  /* eslint-disable */
  name: "i18n-n",
  props: assign$4({
    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 I18nN = NumberFormat;
const DatetimeFormatImpl = /* @__PURE__ */ defineComponent({
  /* eslint-disable */
  name: "i18n-d",
  props: assign$4({
    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;
const I18nD = DatetimeFormat;
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;
  }
}
__name(getComposer$2, "getComposer$2");
function vTDirective(i18n2) {
  const _process = /* @__PURE__ */ __name((binding) => {
    const { instance, modifiers: modifiers2, value: value4 } = binding;
    if (!instance || !instance.$) {
      throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
    }
    const composer = getComposer$2(i18n2, instance.$);
    if (false) {
      warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE));
    }
    const parsedValue = parseValue(value4);
    return [
      Reflect.apply(composer.t, composer, [...makeParams(parsedValue)]),
      composer
    ];
  }, "_process");
  const register3 = /* @__PURE__ */ __name((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;
  }, "register");
  const unregister = /* @__PURE__ */ __name((el) => {
    if (inBrowser && el.__i18nWatcher) {
      el.__i18nWatcher();
      el.__i18nWatcher = void 0;
      delete el.__i18nWatcher;
    }
    if (el.__composer) {
      el.__composer = void 0;
      delete el.__composer;
    }
  }, "unregister");
  const update = /* @__PURE__ */ __name((el, { value: value4 }) => {
    if (el.__composer) {
      const composer = el.__composer;
      const parsedValue = parseValue(value4);
      el.textContent = Reflect.apply(composer.t, composer, [
        ...makeParams(parsedValue)
      ]);
    }
  }, "update");
  const getSSRProps = /* @__PURE__ */ __name((binding) => {
    const [textContent] = _process(binding);
    return { textContent };
  }, "getSSRProps");
  return {
    created: register3,
    unmounted: unregister,
    beforeUpdate: update,
    getSSRProps
  };
}
__name(vTDirective, "vTDirective");
function parseValue(value4) {
  if (isString$5(value4)) {
    return { path: value4 };
  } else if (isPlainObject$1(value4)) {
    if (!("path" in value4)) {
      throw createI18nError(I18nErrorCodes.REQUIRED_VALUE, "path");
    }
    return value4;
  } else {
    throw createI18nError(I18nErrorCodes.INVALID_VALUE);
  }
}
__name(parseValue, "parseValue");
function makeParams(value4) {
  const { path, locale: locale2, args, choice, plural } = value4;
  const options4 = {};
  const named = args || {};
  if (isString$5(locale2)) {
    options4.locale = locale2;
  }
  if (isNumber$3(choice)) {
    options4.plural = choice;
  }
  if (isNumber$3(plural)) {
    options4.plural = plural;
  }
  return [path, named, options4];
}
__name(makeParams, "makeParams");
function apply$1(app2, i18n2, ...options4) {
  const pluginOptions = isPlainObject$1(options4[0]) ? options4[0] : {};
  const useI18nComponentName = !!pluginOptions.useI18nComponentName;
  const globalInstall = isBoolean$1(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
  if (false) {
    warn$1(getWarnMessage(I18nWarnCodes.COMPONENT_NAME_LEGACY_COMPATIBLE, {
      name: Translation.name
    }));
  }
  if (globalInstall) {
    [!useI18nComponentName ? Translation.name : "i18n", "I18nT"].forEach((name2) => app2.component(name2, Translation));
    [NumberFormat.name, "I18nN"].forEach((name2) => app2.component(name2, NumberFormat));
    [DatetimeFormat.name, "I18nD"].forEach((name2) => app2.component(name2, DatetimeFormat));
  }
  {
    app2.directive("t", vTDirective(i18n2));
  }
}
__name(apply$1, "apply$1");
const VueDevToolsLabels = {
  [
    "vue-devtools-plugin-vue-i18n"
    /* VueDevToolsIDs.PLUGIN */
  ]: "Vue I18n devtools",
  [
    "vue-i18n-resource-inspector"
    /* VueDevToolsIDs.CUSTOM_INSPECTOR */
  ]: "I18n Resources",
  [
    "vue-i18n-timeline"
    /* VueDevToolsIDs.TIMELINE */
  ]: "Vue I18n"
};
const VueDevToolsPlaceholders = {
  [
    "vue-i18n-resource-inspector"
    /* VueDevToolsIDs.CUSTOM_INSPECTOR */
  ]: "Search for scopes ..."
};
const VueDevToolsTimelineColors = {
  [
    "vue-i18n-timeline"
    /* VueDevToolsIDs.TIMELINE */
  ]: 16764185
};
const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties";
let devtoolsApi;
async function enableDevTools(app2, i18n2) {
  return new Promise((resolve2, reject3) => {
    try {
      setupDevtoolsPlugin({
        id: "vue-devtools-plugin-vue-i18n",
        label: VueDevToolsLabels[
          "vue-devtools-plugin-vue-i18n"
          /* VueDevToolsIDs.PLUGIN */
        ],
        packageName: "vue-i18n",
        homepage: "https://vue-i18n.intlify.dev",
        logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
        componentStateTypes: [VUE_I18N_COMPONENT_TYPES],
        app: app2
        // eslint-disable-line @typescript-eslint/no-explicit-any
      }, (api2) => {
        devtoolsApi = api2;
        api2.on.visitComponentTree(({ componentInstance, treeNode }) => {
          updateComponentTreeTags(componentInstance, treeNode, i18n2);
        });
        api2.on.inspectComponent(({ componentInstance, instanceData }) => {
          if (componentInstance.vnode.el && componentInstance.vnode.el.__VUE_I18N__ && instanceData) {
            if (i18n2.mode === "legacy") {
              if (componentInstance.vnode.el.__VUE_I18N__ !== i18n2.global.__composer) {
                inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
              }
            } else {
              inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
            }
          }
        });
        api2.addInspector({
          id: "vue-i18n-resource-inspector",
          label: VueDevToolsLabels[
            "vue-i18n-resource-inspector"
            /* VueDevToolsIDs.CUSTOM_INSPECTOR */
          ],
          icon: "language",
          treeFilterPlaceholder: VueDevToolsPlaceholders[
            "vue-i18n-resource-inspector"
            /* VueDevToolsIDs.CUSTOM_INSPECTOR */
          ]
        });
        api2.on.getInspectorTree((payload) => {
          if (payload.app === app2 && payload.inspectorId === "vue-i18n-resource-inspector") {
            registerScope(payload, i18n2);
          }
        });
        const roots = /* @__PURE__ */ new Map();
        api2.on.getInspectorState(async (payload) => {
          if (payload.app === app2 && payload.inspectorId === "vue-i18n-resource-inspector") {
            api2.unhighlightElement();
            inspectScope(payload, i18n2);
            if (payload.nodeId === "global") {
              if (!roots.has(payload.app)) {
                const [root24] = await api2.getComponentInstances(payload.app);
                roots.set(payload.app, root24);
              }
              api2.highlightElement(roots.get(payload.app));
            } else {
              const instance = getComponentInstance(payload.nodeId, i18n2);
              instance && api2.highlightElement(instance);
            }
          }
        });
        api2.on.editInspectorState((payload) => {
          if (payload.app === app2 && payload.inspectorId === "vue-i18n-resource-inspector") {
            editScope(payload, i18n2);
          }
        });
        api2.addTimelineLayer({
          id: "vue-i18n-timeline",
          label: VueDevToolsLabels[
            "vue-i18n-timeline"
            /* VueDevToolsIDs.TIMELINE */
          ],
          color: VueDevToolsTimelineColors[
            "vue-i18n-timeline"
            /* VueDevToolsIDs.TIMELINE */
          ]
        });
        resolve2(true);
      });
    } catch (e2) {
      console.error(e2);
      reject3(false);
    }
  });
}
__name(enableDevTools, "enableDevTools");
function getI18nScopeLable(instance) {
  return instance.type.name || instance.type.displayName || instance.type.__file || "Anonymous";
}
__name(getI18nScopeLable, "getI18nScopeLable");
function updateComponentTreeTags(instance, treeNode, i18n2) {
  const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
  if (instance && instance.vnode.el && instance.vnode.el.__VUE_I18N__) {
    if (instance.vnode.el.__VUE_I18N__ !== global2) {
      const tag = {
        label: `i18n (${getI18nScopeLable(instance)} Scope)`,
        textColor: 0,
        backgroundColor: 16764185
      };
      treeNode.tags.push(tag);
    }
  }
}
__name(updateComponentTreeTags, "updateComponentTreeTags");
function inspectComposer(instanceData, composer) {
  const type = VUE_I18N_COMPONENT_TYPES;
  instanceData.state.push({
    type,
    key: "locale",
    editable: true,
    value: composer.locale.value
  });
  instanceData.state.push({
    type,
    key: "availableLocales",
    editable: false,
    value: composer.availableLocales
  });
  instanceData.state.push({
    type,
    key: "fallbackLocale",
    editable: true,
    value: composer.fallbackLocale.value
  });
  instanceData.state.push({
    type,
    key: "inheritLocale",
    editable: true,
    value: composer.inheritLocale
  });
  instanceData.state.push({
    type,
    key: "messages",
    editable: false,
    value: getLocaleMessageValue(composer.messages.value)
  });
  {
    instanceData.state.push({
      type,
      key: "datetimeFormats",
      editable: false,
      value: composer.datetimeFormats.value
    });
    instanceData.state.push({
      type,
      key: "numberFormats",
      editable: false,
      value: composer.numberFormats.value
    });
  }
}
__name(inspectComposer, "inspectComposer");
function getLocaleMessageValue(messages2) {
  const value4 = {};
  Object.keys(messages2).forEach((key) => {
    const v2 = messages2[key];
    if (isFunction$2(v2) && "source" in v2) {
      value4[key] = getMessageFunctionDetails(v2);
    } else if (isMessageAST(v2) && v2.loc && v2.loc.source) {
      value4[key] = v2.loc.source;
    } else if (isObject$3(v2)) {
      value4[key] = getLocaleMessageValue(v2);
    } else {
      value4[key] = v2;
    }
  });
  return value4;
}
__name(getLocaleMessageValue, "getLocaleMessageValue");
const ESC = {
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "&": "&amp;"
};
function escape$3(s) {
  return s.replace(/[<>"&]/g, escapeChar);
}
__name(escape$3, "escape$3");
function escapeChar(a) {
  return ESC[a] || a;
}
__name(escapeChar, "escapeChar");
function getMessageFunctionDetails(func) {
  const argString = func.source ? `("${escape$3(func.source)}")` : `(?)`;
  return {
    _custom: {
      type: "function",
      display: `<span>ƒ</span> ${argString}`
    }
  };
}
__name(getMessageFunctionDetails, "getMessageFunctionDetails");
function registerScope(payload, i18n2) {
  payload.rootNodes.push({
    id: "global",
    label: "Global Scope"
  });
  const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
  for (const [keyInstance, instance] of i18n2.__instances) {
    const composer = i18n2.mode === "composition" ? instance : instance.__composer;
    if (global2 === composer) {
      continue;
    }
    payload.rootNodes.push({
      id: composer.id.toString(),
      label: `${getI18nScopeLable(keyInstance)} Scope`
    });
  }
}
__name(registerScope, "registerScope");
function getComponentInstance(nodeId, i18n2) {
  let instance = null;
  if (nodeId !== "global") {
    for (const [component, composer] of i18n2.__instances.entries()) {
      if (composer.id.toString() === nodeId) {
        instance = component;
        break;
      }
    }
  }
  return instance;
}
__name(getComponentInstance, "getComponentInstance");
function getComposer$1(nodeId, i18n2) {
  if (nodeId === "global") {
    return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
  } else {
    const instance = Array.from(i18n2.__instances.values()).find((item3) => item3.id.toString() === nodeId);
    if (instance) {
      return i18n2.mode === "composition" ? instance : instance.__composer;
    } else {
      return null;
    }
  }
}
__name(getComposer$1, "getComposer$1");
function inspectScope(payload, i18n2) {
  const composer = getComposer$1(payload.nodeId, i18n2);
  if (composer) {
    payload.state = makeScopeInspectState(composer);
  }
  return null;
}
__name(inspectScope, "inspectScope");
function makeScopeInspectState(composer) {
  const state = {};
  const localeType = "Locale related info";
  const localeStates = [
    {
      type: localeType,
      key: "locale",
      editable: true,
      value: composer.locale.value
    },
    {
      type: localeType,
      key: "fallbackLocale",
      editable: true,
      value: composer.fallbackLocale.value
    },
    {
      type: localeType,
      key: "availableLocales",
      editable: false,
      value: composer.availableLocales
    },
    {
      type: localeType,
      key: "inheritLocale",
      editable: true,
      value: composer.inheritLocale
    }
  ];
  state[localeType] = localeStates;
  const localeMessagesType = "Locale messages info";
  const localeMessagesStates = [
    {
      type: localeMessagesType,
      key: "messages",
      editable: false,
      value: getLocaleMessageValue(composer.messages.value)
    }
  ];
  state[localeMessagesType] = localeMessagesStates;
  {
    const datetimeFormatsType = "Datetime formats info";
    const datetimeFormatsStates = [
      {
        type: datetimeFormatsType,
        key: "datetimeFormats",
        editable: false,
        value: composer.datetimeFormats.value
      }
    ];
    state[datetimeFormatsType] = datetimeFormatsStates;
    const numberFormatsType = "Datetime formats info";
    const numberFormatsStates = [
      {
        type: numberFormatsType,
        key: "numberFormats",
        editable: false,
        value: composer.numberFormats.value
      }
    ];
    state[numberFormatsType] = numberFormatsStates;
  }
  return state;
}
__name(makeScopeInspectState, "makeScopeInspectState");
function addTimelineEvent(event, payload) {
  if (devtoolsApi) {
    let groupId;
    if (payload && "groupId" in payload) {
      groupId = payload.groupId;
      delete payload.groupId;
    }
    devtoolsApi.addTimelineEvent({
      layerId: "vue-i18n-timeline",
      event: {
        title: event,
        groupId,
        time: Date.now(),
        meta: {},
        data: payload || {},
        logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default"
      }
    });
  }
}
__name(addTimelineEvent, "addTimelineEvent");
function editScope(payload, i18n2) {
  const composer = getComposer$1(payload.nodeId, i18n2);
  if (composer) {
    const [field] = payload.path;
    if (field === "locale" && isString$5(payload.state.value)) {
      composer.locale.value = payload.state.value;
    } else if (field === "fallbackLocale" && (isString$5(payload.state.value) || isArray$1(payload.state.value) || isObject$3(payload.state.value))) {
      composer.fallbackLocale.value = payload.state.value;
    } else if (field === "inheritLocale" && isBoolean$1(payload.state.value)) {
      composer.inheritLocale = payload.state.value;
    }
  }
}
__name(editScope, "editScope");
function defineMixin(vuei18n, composer, i18n2) {
  return {
    beforeCreate() {
      const instance = getCurrentInstance();
      if (!instance) {
        throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
      }
      const options4 = this.$options;
      if (options4.i18n) {
        const optionsI18n = options4.i18n;
        if (options4.__i18n) {
          optionsI18n.__i18n = options4.__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 (options4.__i18n) {
        if (this === this.$root) {
          this.$i18n = mergeToGlobal(vuei18n, options4);
        } else {
          this.$i18n = createVueI18n({
            __i18n: options4.__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 (options4.__i18nGlobal) {
        adjustI18nResources(composer, options4, options4);
      }
      this.$t = (...args) => this.$i18n.t(...args);
      this.$rt = (...args) => this.$i18n.rt(...args);
      this.$tc = (...args) => this.$i18n.tc(...args);
      this.$te = (key, locale2) => this.$i18n.te(key, locale2);
      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() {
      if (false) {
        const _vueI18n = this.$i18n;
        this.$el.__VUE_I18N__ = _vueI18n.__composer;
        const emitter = this.__v_emitter = createEmitter();
        _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
        emitter.on("*", addTimelineEvent);
      }
    },
    unmounted() {
      const instance = getCurrentInstance();
      if (!instance) {
        throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
      }
      const _vueI18n = this.$i18n;
      if (false) {
        if (this.__v_emitter) {
          this.__v_emitter.off("*", addTimelineEvent);
          delete this.__v_emitter;
        }
        if (this.$i18n) {
          _vueI18n.__disableEmitter && _vueI18n.__disableEmitter();
          delete this.$el.__VUE_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;
    }
  };
}
__name(defineMixin, "defineMixin");
function mergeToGlobal(g2, options4) {
  g2.locale = options4.locale || g2.locale;
  g2.fallbackLocale = options4.fallbackLocale || g2.fallbackLocale;
  g2.missing = options4.missing || g2.missing;
  g2.silentTranslationWarn = options4.silentTranslationWarn || g2.silentFallbackWarn;
  g2.silentFallbackWarn = options4.silentFallbackWarn || g2.silentFallbackWarn;
  g2.formatFallbackMessages = options4.formatFallbackMessages || g2.formatFallbackMessages;
  g2.postTranslation = options4.postTranslation || g2.postTranslation;
  g2.warnHtmlInMessage = options4.warnHtmlInMessage || g2.warnHtmlInMessage;
  g2.escapeParameterHtml = options4.escapeParameterHtml || g2.escapeParameterHtml;
  g2.sync = options4.sync || g2.sync;
  g2.__composer[SetPluralRulesSymbol](options4.pluralizationRules || g2.pluralizationRules);
  const messages2 = getLocaleMessages(g2.locale, {
    messages: options4.messages,
    __i18n: options4.__i18n
  });
  Object.keys(messages2).forEach((locale2) => g2.mergeLocaleMessage(locale2, messages2[locale2]));
  if (options4.datetimeFormats) {
    Object.keys(options4.datetimeFormats).forEach((locale2) => g2.mergeDateTimeFormat(locale2, options4.datetimeFormats[locale2]));
  }
  if (options4.numberFormats) {
    Object.keys(options4.numberFormats).forEach((locale2) => g2.mergeNumberFormat(locale2, options4.numberFormats[locale2]));
  }
  return g2;
}
__name(mergeToGlobal, "mergeToGlobal");
const I18nInjectionKey = /* @__PURE__ */ makeSymbol("global-vue-i18n");
function createI18n(options4 = {}, VueI18nLegacy) {
  const __legacyMode = __VUE_I18N_LEGACY_API__ && isBoolean$1(options4.legacy) ? options4.legacy : __VUE_I18N_LEGACY_API__;
  const __globalInjection = isBoolean$1(options4.globalInjection) ? options4.globalInjection : true;
  const __allowComposition = __VUE_I18N_LEGACY_API__ && __legacyMode ? !!options4.allowComposition : true;
  const __instances = /* @__PURE__ */ new Map();
  const [globalScope, __global] = createGlobal(options4, __legacyMode);
  const symbol = /* @__PURE__ */ makeSymbol(false ? "vue-i18n" : "");
  if (false) {
    if (__legacyMode && __allowComposition && true) {
      warn$1(getWarnMessage(I18nWarnCodes.NOTICE_DROP_ALLOW_COMPOSITION));
    }
  }
  function __getInstance(component) {
    return __instances.get(component) || null;
  }
  __name(__getInstance, "__getInstance");
  function __setInstance(component, instance) {
    __instances.set(component, instance);
  }
  __name(__setInstance, "__setInstance");
  function __deleteInstance(component) {
    __instances.delete(component);
  }
  __name(__deleteInstance, "__deleteInstance");
  {
    const i18n2 = {
      // mode
      get mode() {
        return __VUE_I18N_LEGACY_API__ && __legacyMode ? "legacy" : "composition";
      },
      // allowComposition
      get allowComposition() {
        return __allowComposition;
      },
      // install plugin
      async install(app2, ...options22) {
        if (false) {
          app2.__VUE_I18N__ = i18n2;
        }
        app2.__VUE_I18N_SYMBOL__ = symbol;
        app2.provide(app2.__VUE_I18N_SYMBOL__, i18n2);
        if (isPlainObject$1(options22[0])) {
          const opts = options22[0];
          i18n2.__composerExtend = opts.__composerExtend;
          i18n2.__vueI18nExtend = opts.__vueI18nExtend;
        }
        let globalReleaseHandler = null;
        if (!__legacyMode && __globalInjection) {
          globalReleaseHandler = injectGlobalFields(app2, i18n2.global);
        }
        if (__VUE_I18N_FULL_INSTALL__) {
          apply$1(app2, i18n2, ...options22);
        }
        if (__VUE_I18N_LEGACY_API__ && __legacyMode) {
          app2.mixin(defineMixin(__global, __global.__composer, i18n2));
        }
        const unmountApp = app2.unmount;
        app2.unmount = () => {
          globalReleaseHandler && globalReleaseHandler();
          i18n2.dispose();
          unmountApp();
        };
        if (false) {
          const ret = await enableDevTools(app2, i18n2);
          if (!ret) {
            throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
          }
          const emitter = createEmitter();
          if (__legacyMode) {
            const _vueI18n = __global;
            _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
          } else {
            const _composer = __global;
            _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
          }
          emitter.on("*", addTimelineEvent);
        }
      },
      // global accessor
      get global() {
        return __global;
      },
      dispose() {
        globalScope.stop();
      },
      // @internal
      __instances,
      // @internal
      __getInstance,
      // @internal
      __setInstance,
      // @internal
      __deleteInstance
    };
    return i18n2;
  }
}
__name(createI18n, "createI18n");
function useI18n(options4 = {}) {
  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(options4, componentOptions);
  if (__VUE_I18N_LEGACY_API__) {
    if (i18n2.mode === "legacy" && !options4.__useComponent) {
      if (!i18n2.allowComposition) {
        throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE);
      }
      return useI18nForLegacy(instance, scope, gl, options4);
    }
  }
  if (scope === "global") {
    adjustI18nResources(gl, options4, componentOptions);
    return gl;
  }
  if (scope === "parent") {
    let composer2 = getComposer(i18n2, instance, options4.__useComponent);
    if (composer2 == null) {
      if (false) {
        warn$1(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE));
      }
      composer2 = gl;
    }
    return composer2;
  }
  const i18nInternal = i18n2;
  let composer = i18nInternal.__getInstance(instance);
  if (composer == null) {
    const composerOptions = assign$4({}, options4);
    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;
}
__name(useI18n, "useI18n");
const castToVueI18n = /* @__PURE__ */ __name(/* @__NO_SIDE_EFFECTS__ */ (i18n2) => {
  if (!(__VUE_I18N_BRIDGE__ in i18n2)) {
    throw createI18nError(I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N);
  }
  return i18n2;
}, "castToVueI18n");
function createGlobal(options4, legacyMode, VueI18nLegacy) {
  const scope = effectScope();
  {
    const obj = __VUE_I18N_LEGACY_API__ && legacyMode ? scope.run(() => createVueI18n(options4)) : scope.run(() => createComposer(options4));
    if (obj == null) {
      throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
    }
    return [scope, obj];
  }
}
__name(createGlobal, "createGlobal");
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;
  }
}
__name(getI18nInstance, "getI18nInstance");
function getScope(options4, componentOptions) {
  return isEmptyObject$1(options4) ? "__i18n" in componentOptions ? "local" : "global" : !options4.useScope ? "local" : options4.useScope;
}
__name(getScope, "getScope");
function getGlobalComposer(i18n2) {
  return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
}
__name(getGlobalComposer, "getGlobalComposer");
function getComposer(i18n2, target, useComponent = false) {
  let composer = null;
  const root24 = 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 (root24 === current) {
      break;
    }
    current = current.parent;
  }
  return composer;
}
__name(getComposer, "getComposer");
function getParentComponentInstance(target, useComponent = false) {
  if (target == null) {
    return null;
  }
  {
    return !useComponent ? target.parent : target.vnode.ctx || target.parent;
  }
}
__name(getParentComponentInstance, "getParentComponentInstance");
function setupLifeCycle(i18n2, target, composer) {
  let emitter = null;
  {
    onMounted(() => {
      if (false) {
        target.vnode.el.__VUE_I18N__ = composer;
        emitter = createEmitter();
        const _composer = composer;
        _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
        emitter.on("*", addTimelineEvent);
      }
    }, target);
    onUnmounted(() => {
      const _composer = composer;
      if (false) {
        emitter && emitter.off("*", addTimelineEvent);
        _composer[DisableEmitter] && _composer[DisableEmitter]();
        delete target.vnode.el.__VUE_I18N__;
      }
      i18n2.__deleteInstance(target);
      const dispose = _composer[DisposeSymbol];
      if (dispose) {
        dispose();
        delete _composer[DisposeSymbol];
      }
    }, target);
  }
}
__name(setupLifeCycle, "setupLifeCycle");
function useI18nForLegacy(instance, scope, root24, options4 = {}) {
  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$1(options4.inheritLocale) ? options4.inheritLocale : !isString$5(options4.locale);
  const _locale = ref(
    // prettier-ignore
    !isLocalScope || _inheritLocale ? root24.locale.value : isString$5(options4.locale) ? options4.locale : DEFAULT_LOCALE
  );
  const _fallbackLocale = ref(
    // prettier-ignore
    !isLocalScope || _inheritLocale ? root24.fallbackLocale.value : isString$5(options4.fallbackLocale) || isArray$1(options4.fallbackLocale) || isPlainObject$1(options4.fallbackLocale) || options4.fallbackLocale === false ? options4.fallbackLocale : _locale.value
  );
  const _messages = ref(getLocaleMessages(_locale.value, options4));
  const _datetimeFormats = ref(isPlainObject$1(options4.datetimeFormats) ? options4.datetimeFormats : { [_locale.value]: {} });
  const _numberFormats = ref(isPlainObject$1(options4.numberFormats) ? options4.numberFormats : { [_locale.value]: {} });
  const _missingWarn = isLocalScope ? root24.missingWarn : isBoolean$1(options4.missingWarn) || isRegExp$2(options4.missingWarn) ? options4.missingWarn : true;
  const _fallbackWarn = isLocalScope ? root24.fallbackWarn : isBoolean$1(options4.fallbackWarn) || isRegExp$2(options4.fallbackWarn) ? options4.fallbackWarn : true;
  const _fallbackRoot = isLocalScope ? root24.fallbackRoot : isBoolean$1(options4.fallbackRoot) ? options4.fallbackRoot : true;
  const _fallbackFormat = !!options4.fallbackFormat;
  const _missing = isFunction$2(options4.missing) ? options4.missing : null;
  const _postTranslation = isFunction$2(options4.postTranslation) ? options4.postTranslation : null;
  const _warnHtmlMessage = isLocalScope ? root24.warnHtmlMessage : isBoolean$1(options4.warnHtmlMessage) ? options4.warnHtmlMessage : true;
  const _escapeParameter = !!options4.escapeParameter;
  const _modifiers = isLocalScope ? root24.modifiers : isPlainObject$1(options4.modifiers) ? options4.modifiers : {};
  const _pluralRules = options4.pluralRules || isLocalScope && root24.pluralRules;
  function trackReactivityValues() {
    return [
      _locale.value,
      _fallbackLocale.value,
      _messages.value,
      _datetimeFormats.value,
      _numberFormats.value
    ];
  }
  __name(trackReactivityValues, "trackReactivityValues");
  const locale2 = computed({
    get: /* @__PURE__ */ __name(() => {
      return _composer.value ? _composer.value.locale.value : _locale.value;
    }, "get"),
    set: /* @__PURE__ */ __name((val) => {
      if (_composer.value) {
        _composer.value.locale.value = val;
      }
      _locale.value = val;
    }, "set")
  });
  const fallbackLocale = computed({
    get: /* @__PURE__ */ __name(() => {
      return _composer.value ? _composer.value.fallbackLocale.value : _fallbackLocale.value;
    }, "get"),
    set: /* @__PURE__ */ __name((val) => {
      if (_composer.value) {
        _composer.value.fallbackLocale.value = val;
      }
      _fallbackLocale.value = val;
    }, "set")
  });
  const messages2 = 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;
  }
  __name(getPostTranslationHandler, "getPostTranslationHandler");
  function setPostTranslationHandler(handler6) {
    if (_composer.value) {
      _composer.value.setPostTranslationHandler(handler6);
    }
  }
  __name(setPostTranslationHandler, "setPostTranslationHandler");
  function getMissingHandler() {
    return _composer.value ? _composer.value.getMissingHandler() : _missing;
  }
  __name(getMissingHandler, "getMissingHandler");
  function setMissingHandler(handler6) {
    if (_composer.value) {
      _composer.value.setMissingHandler(handler6);
    }
  }
  __name(setMissingHandler, "setMissingHandler");
  function warpWithDeps(fn) {
    trackReactivityValues();
    return fn();
  }
  __name(warpWithDeps, "warpWithDeps");
  function t2(...args) {
    return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.t, null, [...args])) : warpWithDeps(() => "");
  }
  __name(t2, "t");
  function rt(...args) {
    return _composer.value ? Reflect.apply(_composer.value.rt, null, [...args]) : "";
  }
  __name(rt, "rt");
  function d(...args) {
    return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.d, null, [...args])) : warpWithDeps(() => "");
  }
  __name(d, "d");
  function n(...args) {
    return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.n, null, [...args])) : warpWithDeps(() => "");
  }
  __name(n, "n");
  function tm(key) {
    return _composer.value ? _composer.value.tm(key) : {};
  }
  __name(tm, "tm");
  function te2(key, locale22) {
    return _composer.value ? _composer.value.te(key, locale22) : false;
  }
  __name(te2, "te");
  function getLocaleMessage(locale22) {
    return _composer.value ? _composer.value.getLocaleMessage(locale22) : {};
  }
  __name(getLocaleMessage, "getLocaleMessage");
  function setLocaleMessage(locale22, message3) {
    if (_composer.value) {
      _composer.value.setLocaleMessage(locale22, message3);
      _messages.value[locale22] = message3;
    }
  }
  __name(setLocaleMessage, "setLocaleMessage");
  function mergeLocaleMessage(locale22, message3) {
    if (_composer.value) {
      _composer.value.mergeLocaleMessage(locale22, message3);
    }
  }
  __name(mergeLocaleMessage, "mergeLocaleMessage");
  function getDateTimeFormat(locale22) {
    return _composer.value ? _composer.value.getDateTimeFormat(locale22) : {};
  }
  __name(getDateTimeFormat, "getDateTimeFormat");
  function setDateTimeFormat(locale22, format2) {
    if (_composer.value) {
      _composer.value.setDateTimeFormat(locale22, format2);
      _datetimeFormats.value[locale22] = format2;
    }
  }
  __name(setDateTimeFormat, "setDateTimeFormat");
  function mergeDateTimeFormat(locale22, format2) {
    if (_composer.value) {
      _composer.value.mergeDateTimeFormat(locale22, format2);
    }
  }
  __name(mergeDateTimeFormat, "mergeDateTimeFormat");
  function getNumberFormat(locale22) {
    return _composer.value ? _composer.value.getNumberFormat(locale22) : {};
  }
  __name(getNumberFormat, "getNumberFormat");
  function setNumberFormat(locale22, format2) {
    if (_composer.value) {
      _composer.value.setNumberFormat(locale22, format2);
      _numberFormats.value[locale22] = format2;
    }
  }
  __name(setNumberFormat, "setNumberFormat");
  function mergeNumberFormat(locale22, format2) {
    if (_composer.value) {
      _composer.value.mergeNumberFormat(locale22, format2);
    }
  }
  __name(mergeNumberFormat, "mergeNumberFormat");
  const wrapper = {
    get id() {
      return _composer.value ? _composer.value.id : -1;
    },
    locale: locale2,
    fallbackLocale,
    messages: messages2,
    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: t2,
    getPostTranslationHandler,
    setPostTranslationHandler,
    getMissingHandler,
    setMissingHandler,
    rt,
    d,
    n,
    tm,
    te: te2,
    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((locale22) => {
      composer.mergeLocaleMessage(locale22, _messages.value[locale22]);
    });
    Object.keys(_datetimeFormats.value).forEach((locale22) => {
      composer.mergeDateTimeFormat(locale22, _datetimeFormats.value[locale22]);
    });
    Object.keys(_numberFormats.value).forEach((locale22) => {
      composer.mergeNumberFormat(locale22, _numberFormats.value[locale22]);
    });
    composer.escapeParameter = _escapeParameter;
    composer.fallbackFormat = _fallbackFormat;
    composer.fallbackRoot = _fallbackRoot;
    composer.fallbackWarn = _fallbackWarn;
    composer.missingWarn = _missingWarn;
    composer.warnHtmlMessage = _warnHtmlMessage;
  }
  __name(sync, "sync");
  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;
}
__name(useI18nForLegacy, "useI18nForLegacy");
const globalExportProps = [
  "locale",
  "fallbackLocale",
  "availableLocales"
];
const globalExportMethods = ["t", "rt", "d", "n", "tm", "te"];
function injectGlobalFields(app2, composer) {
  const i18n2 = /* @__PURE__ */ Object.create(null);
  globalExportProps.forEach((prop2) => {
    const desc = Object.getOwnPropertyDescriptor(composer, prop2);
    if (!desc) {
      throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
    }
    const wrap2 = 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, prop2, wrap2);
  });
  app2.config.globalProperties.$i18n = i18n2;
  globalExportMethods.forEach((method) => {
    const desc = Object.getOwnPropertyDescriptor(composer, method);
    if (!desc || !desc.value) {
      throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
    }
    Object.defineProperty(app2.config.globalProperties, `$${method}`, desc);
  });
  const dispose = /* @__PURE__ */ __name(() => {
    delete app2.config.globalProperties.$i18n;
    globalExportMethods.forEach((method) => {
      delete app2.config.globalProperties[`$${method}`];
    });
  }, "dispose");
  return dispose;
}
__name(injectGlobalFields, "injectGlobalFields");
{
  initFeatureFlags();
}
if (__INTLIFY_JIT_COMPILATION__) {
  registerMessageCompiler(compile$1);
} else {
  registerMessageCompiler(compileToFunction);
}
registerMessageResolver(resolveValue);
registerLocaleFallbacker(fallbackWithLocaleChain);
if (__INTLIFY_PROD_DEVTOOLS__) {
  const target = getGlobalThis();
  target.__INTLIFY__ = true;
  setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
}
if (false) ;
const Comfy_BrowseTemplates$5 = {
  label: "Browse Templates"
};
const Comfy_Canvas_FitView$5 = {
  label: "Fit view to selected nodes"
};
const Comfy_Canvas_ResetView$5 = {
  label: "Reset View"
};
const Comfy_Canvas_ToggleLinkVisibility$5 = {
  label: "Canvas Toggle Link Visibility"
};
const Comfy_Canvas_ToggleLock$5 = {
  label: "Canvas Toggle Lock"
};
const Comfy_Canvas_ToggleSelected_Pin$5 = {
  label: "Pin/Unpin Selected Items"
};
const Comfy_Canvas_ToggleSelectedNodes_Bypass$5 = {
  label: "Bypass/Unbypass Selected Nodes"
};
const Comfy_Canvas_ToggleSelectedNodes_Collapse$5 = {
  label: "Collapse/Expand Selected Nodes"
};
const Comfy_Canvas_ToggleSelectedNodes_Mute$5 = {
  label: "Mute/Unmute Selected Nodes"
};
const Comfy_Canvas_ToggleSelectedNodes_Pin$5 = {
  label: "Pin/Unpin Selected Nodes"
};
const Comfy_Canvas_ZoomIn$5 = {
  label: "Zoom In"
};
const Comfy_Canvas_ZoomOut$5 = {
  label: "Zoom Out"
};
const Comfy_ClearPendingTasks$5 = {
  label: "Clear Pending Tasks"
};
const Comfy_ClearWorkflow$5 = {
  label: "Clear Workflow"
};
const Comfy_DuplicateWorkflow$5 = {
  label: "Duplicate Current Workflow"
};
const Comfy_ExportWorkflow$5 = {
  label: "Export Workflow"
};
const Comfy_ExportWorkflowAPI$5 = {
  label: "Export Workflow (API Format)"
};
const Comfy_Graph_FitGroupToContents$5 = {
  label: "Fit Group To Contents"
};
const Comfy_Graph_GroupSelectedNodes$5 = {
  label: "Group Selected Nodes"
};
const Comfy_GroupNode_ConvertSelectedNodesToGroupNode$5 = {
  label: "Convert selected nodes to group node"
};
const Comfy_GroupNode_ManageGroupNodes$5 = {
  label: "Manage group nodes"
};
const Comfy_GroupNode_UngroupSelectedGroupNodes$5 = {
  label: "Ungroup selected group nodes"
};
const Comfy_Help_AboutComfyUI$5 = {
  label: "Open About ComfyUI"
};
const Comfy_Help_OpenComfyOrgDiscord$5 = {
  label: "Open Comfy-Org Discord"
};
const Comfy_Help_OpenComfyUIDocs$5 = {
  label: "Open ComfyUI Docs"
};
const Comfy_Help_OpenComfyUIIssues$5 = {
  label: "Open ComfyUI Issues"
};
const Comfy_Interrupt$5 = {
  label: "Interrupt"
};
const Comfy_LoadDefaultWorkflow$5 = {
  label: "Load Default Workflow"
};
const Comfy_NewBlankWorkflow$5 = {
  label: "New Blank Workflow"
};
const Comfy_OpenClipspace$5 = {
  label: "Clipspace"
};
const Comfy_OpenWorkflow$5 = {
  label: "Open Workflow"
};
const Comfy_QueuePrompt$5 = {
  label: "Queue Prompt"
};
const Comfy_QueuePromptFront$5 = {
  label: "Queue Prompt (Front)"
};
const Comfy_Redo$5 = {
  label: "Redo"
};
const Comfy_RefreshNodeDefinitions$5 = {
  label: "Refresh Node Definitions"
};
const Comfy_SaveWorkflow$5 = {
  label: "Save Workflow"
};
const Comfy_SaveWorkflowAs$5 = {
  label: "Save Workflow As"
};
const Comfy_ShowSettingsDialog$5 = {
  label: "Show Settings Dialog"
};
const Comfy_ToggleTheme$5 = {
  label: "Toggle Theme (Dark/Light)"
};
const Comfy_Undo$5 = {
  label: "Undo"
};
const Workspace_NextOpenedWorkflow$5 = {
  label: "Next Opened Workflow"
};
const Workspace_PreviousOpenedWorkflow$5 = {
  label: "Previous Opened Workflow"
};
const Workspace_SearchBox_Toggle$5 = {
  label: "Toggle Search Box"
};
const Workspace_ToggleBottomPanel$5 = {
  label: "Toggle Bottom Panel"
};
const Workspace_ToggleFocusMode$5 = {
  label: "Toggle Focus Mode"
};
const Workspace_ToggleSidebarTab_queue$5 = {
  label: "Toggle Queue Sidebar",
  tooltip: "Queue"
};
const Workspace_ToggleSidebarTab_workflows$5 = {
  label: "Toggle Workflows Sidebar",
  tooltip: "Workflows"
};
const enCommands = {
  "Comfy-Desktop_Folders_OpenCustomNodesFolder": {
    label: "Open Custom Nodes Folder"
  },
  "Comfy-Desktop_Folders_OpenInputsFolder": {
    label: "Open Inputs Folder"
  },
  "Comfy-Desktop_Folders_OpenLogsFolder": {
    label: "Open Logs Folder"
  },
  "Comfy-Desktop_Folders_OpenModelConfig": {
    label: "Open extra_model_paths.yaml"
  },
  "Comfy-Desktop_Folders_OpenModelsFolder": {
    label: "Open Models Folder"
  },
  "Comfy-Desktop_Folders_OpenOutputsFolder": {
    label: "Open Outputs Folder"
  },
  "Comfy-Desktop_OpenDevTools": {
    label: "Open DevTools"
  },
  "Comfy-Desktop_OpenFeedbackPage": {
    label: "Feedback"
  },
  "Comfy-Desktop_OpenUserGuide": {
    label: "Desktop User Guide"
  },
  "Comfy-Desktop_Reinstall": {
    label: "Reinstall"
  },
  "Comfy-Desktop_Restart": {
    label: "Restart"
  },
  Comfy_BrowseTemplates: Comfy_BrowseTemplates$5,
  Comfy_Canvas_FitView: Comfy_Canvas_FitView$5,
  Comfy_Canvas_ResetView: Comfy_Canvas_ResetView$5,
  Comfy_Canvas_ToggleLinkVisibility: Comfy_Canvas_ToggleLinkVisibility$5,
  Comfy_Canvas_ToggleLock: Comfy_Canvas_ToggleLock$5,
  Comfy_Canvas_ToggleSelected_Pin: Comfy_Canvas_ToggleSelected_Pin$5,
  Comfy_Canvas_ToggleSelectedNodes_Bypass: Comfy_Canvas_ToggleSelectedNodes_Bypass$5,
  Comfy_Canvas_ToggleSelectedNodes_Collapse: Comfy_Canvas_ToggleSelectedNodes_Collapse$5,
  Comfy_Canvas_ToggleSelectedNodes_Mute: Comfy_Canvas_ToggleSelectedNodes_Mute$5,
  Comfy_Canvas_ToggleSelectedNodes_Pin: Comfy_Canvas_ToggleSelectedNodes_Pin$5,
  Comfy_Canvas_ZoomIn: Comfy_Canvas_ZoomIn$5,
  Comfy_Canvas_ZoomOut: Comfy_Canvas_ZoomOut$5,
  Comfy_ClearPendingTasks: Comfy_ClearPendingTasks$5,
  Comfy_ClearWorkflow: Comfy_ClearWorkflow$5,
  Comfy_DuplicateWorkflow: Comfy_DuplicateWorkflow$5,
  Comfy_ExportWorkflow: Comfy_ExportWorkflow$5,
  Comfy_ExportWorkflowAPI: Comfy_ExportWorkflowAPI$5,
  Comfy_Graph_FitGroupToContents: Comfy_Graph_FitGroupToContents$5,
  Comfy_Graph_GroupSelectedNodes: Comfy_Graph_GroupSelectedNodes$5,
  Comfy_GroupNode_ConvertSelectedNodesToGroupNode: Comfy_GroupNode_ConvertSelectedNodesToGroupNode$5,
  Comfy_GroupNode_ManageGroupNodes: Comfy_GroupNode_ManageGroupNodes$5,
  Comfy_GroupNode_UngroupSelectedGroupNodes: Comfy_GroupNode_UngroupSelectedGroupNodes$5,
  Comfy_Help_AboutComfyUI: Comfy_Help_AboutComfyUI$5,
  Comfy_Help_OpenComfyOrgDiscord: Comfy_Help_OpenComfyOrgDiscord$5,
  Comfy_Help_OpenComfyUIDocs: Comfy_Help_OpenComfyUIDocs$5,
  Comfy_Help_OpenComfyUIIssues: Comfy_Help_OpenComfyUIIssues$5,
  Comfy_Interrupt: Comfy_Interrupt$5,
  Comfy_LoadDefaultWorkflow: Comfy_LoadDefaultWorkflow$5,
  Comfy_NewBlankWorkflow: Comfy_NewBlankWorkflow$5,
  Comfy_OpenClipspace: Comfy_OpenClipspace$5,
  Comfy_OpenWorkflow: Comfy_OpenWorkflow$5,
  Comfy_QueuePrompt: Comfy_QueuePrompt$5,
  Comfy_QueuePromptFront: Comfy_QueuePromptFront$5,
  Comfy_Redo: Comfy_Redo$5,
  Comfy_RefreshNodeDefinitions: Comfy_RefreshNodeDefinitions$5,
  Comfy_SaveWorkflow: Comfy_SaveWorkflow$5,
  Comfy_SaveWorkflowAs: Comfy_SaveWorkflowAs$5,
  Comfy_ShowSettingsDialog: Comfy_ShowSettingsDialog$5,
  Comfy_ToggleTheme: Comfy_ToggleTheme$5,
  Comfy_Undo: Comfy_Undo$5,
  Workspace_NextOpenedWorkflow: Workspace_NextOpenedWorkflow$5,
  Workspace_PreviousOpenedWorkflow: Workspace_PreviousOpenedWorkflow$5,
  Workspace_SearchBox_Toggle: Workspace_SearchBox_Toggle$5,
  Workspace_ToggleBottomPanel: Workspace_ToggleBottomPanel$5,
  "Workspace_ToggleBottomPanelTab_command-terminal": {
    label: "Toggle Terminal Bottom Panel"
  },
  "Workspace_ToggleBottomPanelTab_logs-terminal": {
    label: "Toggle Logs Bottom Panel"
  },
  Workspace_ToggleFocusMode: Workspace_ToggleFocusMode$5,
  "Workspace_ToggleSidebarTab_model-library": {
    label: "Toggle Model Library Sidebar",
    tooltip: "Model Library"
  },
  "Workspace_ToggleSidebarTab_node-library": {
    label: "Toggle Node Library Sidebar",
    tooltip: "Node Library"
  },
  Workspace_ToggleSidebarTab_queue: Workspace_ToggleSidebarTab_queue$5,
  Workspace_ToggleSidebarTab_workflows: Workspace_ToggleSidebarTab_workflows$5
};
const g$5 = {
  currentUser: "Current user",
  empty: "Empty",
  noWorkflowsFound: "No workflows found.",
  comingSoon: "Coming Soon",
  firstTimeUIMessage: 'This is the first time you use the new UI. Choose "Menu > Use New Menu > Disabled" to restore the old UI.',
  download: "Download",
  "import": "Import",
  loadAllFolders: "Load All Folders",
  refresh: "Refresh",
  terminal: "Terminal",
  logs: "Logs",
  videoFailedToLoad: "Video failed to load",
  extensionName: "Extension Name",
  reloadToApplyChanges: "Reload to apply changes",
  insert: "Insert",
  systemInfo: "System Info",
  devices: "Devices",
  about: "About",
  add: "Add",
  confirm: "Confirm",
  reset: "Reset",
  resetKeybindingsTooltip: "Reset keybindings to default",
  customizeFolder: "Customize Folder",
  icon: "Icon",
  color: "Color",
  error: "Error",
  loading: "Loading",
  findIssues: "Find Issues",
  reportIssue: "Send Report",
  reportIssueTooltip: "Submit the error report to Comfy Org",
  reportSent: "Report Submitted",
  copyToClipboard: "Copy to Clipboard",
  openNewIssue: "Open New Issue",
  showReport: "Show Report",
  imageFailedToLoad: "Image failed to load",
  reconnecting: "Reconnecting",
  reconnected: "Reconnected",
  "delete": "Delete",
  rename: "Rename",
  save: "Save",
  no: "No",
  cancel: "Cancel",
  close: "Close",
  back: "Back",
  next: "Next",
  install: "Install",
  overwrite: "Overwrite",
  customize: "Customize",
  experimental: "BETA",
  deprecated: "DEPR",
  loadWorkflow: "Load Workflow",
  goToNode: "Go to Node",
  settings: "Settings",
  searchWorkflows: "Search Workflows",
  searchSettings: "Search Settings",
  searchNodes: "Search Nodes",
  searchModels: "Search Models",
  searchKeybindings: "Search Keybindings",
  searchExtensions: "Search Extensions",
  noResultsFound: "No Results Found",
  searchFailedMessage: "We couldn't find any settings matching your search. Try adjusting your search terms.",
  noTasksFound: "No Tasks Found",
  noTasksFoundMessage: "There are no tasks in the queue.",
  newFolder: "New Folder",
  enableAll: "Enable All",
  disableAll: "Disable All",
  command: "Command",
  keybinding: "Keybinding",
  upload: "Upload"
};
const color$5 = {
  "default": "Default",
  blue: "Blue",
  green: "Green",
  red: "Red",
  pink: "Pink",
  yellow: "Yellow",
  custom: "Custom"
};
const icon$5 = {
  bookmark: "Bookmark",
  folder: "Folder",
  star: "Star",
  heart: "Heart",
  file: "File",
  inbox: "Inbox",
  box: "Box",
  briefcase: "Briefcase",
  "exclamation-triangle": "Warning"
};
const welcome$5 = {
  title: "Welcome to ComfyUI",
  getStarted: "Get Started"
};
const userSelect$5 = {
  newUser: "New user",
  enterUsername: "Enter a username",
  existingUser: "Existing user",
  selectUser: "Select a user",
  next: "Next"
};
const notSupported$5 = {
  title: "Your device is not supported",
  message: "Only following devices are supported:",
  learnMore: "Learn More",
  reportIssue: "Report Issue",
  supportedDevices: {
    macos: "MacOS (M1 or later)",
    windows: "Windows (Nvidia GPU with CUDA support)"
  },
  "continue": "Continue",
  continueTooltip: "I am sure my device is supported"
};
const downloadGit$5 = {
  title: "Download git",
  message: "Unable to locate git.  A working copy of git is required for normal operation.",
  instructions: "Please download and install the latest version for your operating system.  The Download git button below opens the git-scm.com downloads page.",
  warning: "If you are sure you do not need git installed, or there has been a mistake, you may click Skip to byapss this check.  Attempting to run ComfyUI without a working copy of git is not currently supported.",
  gitWebsite: "Download git",
  skip: "Skip"
};
const install$5 = {
  installLocation: "Install Location",
  migration: "Migration",
  desktopSettings: "Desktop Settings",
  chooseInstallationLocation: "Choose Installation Location",
  systemLocations: "System Locations",
  failedToSelectDirectory: "Failed to select directory",
  pathValidationFailed: "Failed to validate path",
  pathExists: "Directory already exists - please ensure you have backed up all data",
  cannotWrite: "Unable to write to the selected path",
  insufficientFreeSpace: "Insufficient space - minimum free space",
  parentMissing: "Path does not exist - create the containing directory first",
  unhandledError: "Unknown error",
  installLocationDescription: "Select the directory for ComfyUI's user data. A python environment will be installed to the selected location. Please make sure the selected disk has enough space (~15GB) left.",
  installLocationTooltip: "ComfyUI's user data directory. Stores:\n- Python Environment\n- Models\n- Custom nodes\n",
  appDataLocationTooltip: "ComfyUI's app data directory. Stores:\n- Logs\n- Server configs",
  appPathLocationTooltip: "ComfyUI's app asset directory. Stores the ComfyUI code and assets",
  migrateFromExistingInstallation: "Migrate from Existing Installation",
  migrationSourcePathDescription: "If you have an existing ComfyUI installation, we can copy/link your existing user files and models to the new installation.",
  selectItemsToMigrate: "Select Items to Migrate",
  migrationOptional: "Migration is optional. If you don't have an existing installation, you can skip this step.",
  desktopAppSettings: "Desktop App Settings",
  desktopAppSettingsDescription: "Configure how ComfyUI behaves on your desktop. You can change these settings later.",
  gpu: "GPU",
  gpuSelection: {
    selectGpu: "Select GPU",
    selectGpuDescription: "Select the type of GPU you have",
    cpuMode: "CPU Mode",
    cpuModeDescription: "CPU mode is intended for developers and rare edge cases only.",
    cpuModeDescription2: "If you are not absolutely certain you need this, please ignore this box and select your GPU above.",
    enableCpuMode: "Enable CPU Mode",
    nvidiaDescription: "NVIDIA devices are directly supported using pytorch CUDA builds.",
    mpsDescription: "Apple Metal Performance Shaders are supported using pytorch nightly.",
    customSkipsPython: "This option skips the normal python setup.",
    customComfyNeedsPython: "ComfyUI will not work until python is setup",
    customManualVenv: "Manually configure python venv",
    customInstallRequirements: "Install all requirements and dependencies (e.g. custom torch)",
    customMayNotWork: "This is entirely unsupported, and may simply not work"
  },
  manualConfiguration: {
    title: "Manual Configuration",
    requirements: "Requirements",
    createVenv: "You will need to create a virtual environment in the following directory",
    virtualEnvironmentPath: "Virtual environment path",
    restartWhenFinished: "When you have finished configuring the virtual environment, please restart ComfyUI."
  },
  settings: {
    autoUpdate: "Automatic Updates",
    allowMetrics: "Crash Reports",
    autoUpdateDescription: "Automatically download and install updates when they become available. You'll always be notified before updates are installed.",
    allowMetricsDescription: "Help improve ComfyUI by sending anonymous crash reports. No personal information or workflow content will be collected. This can be disabled at any time in the settings menu.",
    learnMoreAboutData: "Learn more about data collection",
    dataCollectionDialog: {
      title: "About Data Collection",
      whatWeCollect: "What we collect:",
      whatWeDoNotCollect: "What we don't collect:",
      errorReports: "Error message and stack trace",
      systemInfo: "Hardware, OS type, and app version",
      personalInformation: "Personal information",
      workflowContent: "Workflow content",
      fileSystemInformation: "File system information",
      workflowContents: "Workflow contents",
      customNodeConfigurations: "Custom node configurations"
    }
  },
  customNodes: "Custom Nodes",
  customNodesDescription: "Reinstall custom nodes from existing ComfyUI installations."
};
const serverStart$5 = {
  reinstall: "Reinstall",
  reportIssue: "Report Issue",
  openLogs: "Open Logs",
  showTerminal: "Show Terminal",
  process: {
    "initial-state": "Loading...",
    "python-setup": "Setting up Python Environment...",
    "starting-server": "Starting ComfyUI server...",
    ready: "Finishing...",
    error: "Unable to start ComfyUI Desktop"
  }
};
const serverConfig$5 = {
  modifiedConfigs: "You have modified the following server configurations. Restart to apply changes.",
  revertChanges: "Revert Changes",
  restart: "Restart"
};
const sideToolbar$5 = {
  themeToggle: "Toggle Theme",
  logout: "Logout",
  queue: "Queue",
  nodeLibrary: "Node Library",
  workflows: "Workflows",
  browseTemplates: "Browse example templates",
  openWorkflow: "Open workflow in local file system",
  newBlankWorkflow: "Create a new blank workflow",
  nodeLibraryTab: {
    sortOrder: "Sort Order"
  },
  modelLibrary: "Model Library",
  downloads: "Downloads",
  queueTab: {
    showFlatList: "Show Flat List",
    backToAllTasks: "Back to All Tasks",
    containImagePreview: "Fill Image Preview",
    coverImagePreview: "Fit Image Preview",
    clearPendingTasks: "Clear Pending Tasks",
    filter: "Filter Outputs",
    filters: {
      hideCached: "Hide Cached",
      hideCanceled: "Hide Canceled"
    }
  },
  workflowTab: {
    confirmDeleteTitle: "Delete workflow?",
    confirmDelete: "Are you sure you want to delete this workflow?",
    deleted: "Workflow deleted",
    deleteFailedTitle: "Delete failed",
    deleteFailed: "Attempt to delete the workflow failed.",
    dirtyCloseTitle: "Save Changes?",
    dirtyClose: "The files below have been changed.  Would you like to save them before closing?",
    confirmOverwriteTitle: "Overwrite existing file?",
    confirmOverwrite: "The file below already exists. Would you like to overwrite it?",
    workflowTreeType: {
      browse: "Browse",
      bookmarks: "Bookmarks",
      open: "Open"
    }
  }
};
const menu$5 = {
  hideMenu: "Hide Menu",
  showMenu: "Show Menu",
  batchCount: "Batch Count",
  batchCountTooltip: "The number of times the workflow generation should be queued",
  autoQueue: "Auto Queue",
  disabled: "Disabled",
  disabledTooltip: "The workflow will not be automatically queued",
  instant: "Instant",
  instantTooltip: "The workflow will be queued instantly after a generation finishes",
  onChange: "On Change",
  onChangeTooltip: "The workflow will be queued once a change is made",
  queueWorkflow: "Queue workflow (Shift to queue at front)",
  queueWorkflowFront: "Queue workflow at front",
  queue: "Queue",
  execute: "Execute",
  interrupt: "Cancel current run",
  refresh: "Refresh node definitions",
  clipspace: "Open Clipspace",
  resetView: "Reset canvas view",
  clear: "Clear workflow",
  toggleBottomPanel: "Toggle Bottom Panel"
};
const tabMenu$5 = {
  duplicateTab: "Duplicate Tab",
  closeTab: "Close Tab",
  closeTabsToLeft: "Close Tabs to Left",
  closeTabsToRight: "Close Tabs to Right",
  closeOtherTabs: "Close Other Tabs"
};
const templateWorkflows$5 = {
  title: "Get Started with a Template",
  template: {
    "default": "Image Generation",
    image2image: "Image to Image",
    upscale: "2 Pass Upscale",
    flux_schnell: "Flux Schnell"
  }
};
const graphCanvasMenu$5 = {
  zoomIn: "Zoom In",
  zoomOut: "Zoom Out",
  resetView: "Reset View",
  fitView: "Fit View",
  selectMode: "Select Mode",
  panMode: "Pan Mode",
  toggleLinkVisibility: "Toggle Link Visibility"
};
const groupNode$5 = {
  create: "Create group node",
  enterName: "Enter name"
};
const nodeTemplates$5 = {
  saveAsTemplate: "Save as template",
  enterName: "Enter name"
};
const workflowService$5 = {
  exportWorkflow: "Export Workflow",
  enterFilename: "Enter the filename",
  saveWorkflow: "Save workflow"
};
const electronFileDownload$5 = {
  inProgress: "In Progress",
  pause: "Pause Download",
  paused: "Paused",
  resume: "Resume Download",
  cancel: "Cancel Download",
  cancelled: "Cancelled"
};
const menuLabels$5 = {
  Workflow: "Workflow",
  Edit: "Edit",
  Help: "Help",
  "Open Custom Nodes Folder": "Open Custom Nodes Folder",
  "Open Inputs Folder": "Open Inputs Folder",
  "Open Logs Folder": "Open Logs Folder",
  "Open extra_model_paths_yaml": "Open extra_model_paths.yaml",
  "Open Models Folder": "Open Models Folder",
  "Open Outputs Folder": "Open Outputs Folder",
  "Open DevTools": "Open DevTools",
  Feedback: "Feedback",
  "Desktop User Guide": "Desktop User Guide",
  Reinstall: "Reinstall",
  Restart: "Restart",
  "Browse Templates": "Browse Templates",
  "Fit view to selected nodes": "Fit view to selected nodes",
  "Reset View": "Reset View",
  "Canvas Toggle Link Visibility": "Canvas Toggle Link Visibility",
  "Canvas Toggle Lock": "Canvas Toggle Lock",
  "Pin/Unpin Selected Items": "Pin/Unpin Selected Items",
  "Bypass/Unbypass Selected Nodes": "Bypass/Unbypass Selected Nodes",
  "Collapse/Expand Selected Nodes": "Collapse/Expand Selected Nodes",
  "Mute/Unmute Selected Nodes": "Mute/Unmute Selected Nodes",
  "Pin/Unpin Selected Nodes": "Pin/Unpin Selected Nodes",
  "Zoom In": "Zoom In",
  "Zoom Out": "Zoom Out",
  "Clear Pending Tasks": "Clear Pending Tasks",
  "Clear Workflow": "Clear Workflow",
  "Duplicate Current Workflow": "Duplicate Current Workflow",
  Export: "Export",
  "Export (API)": "Export (API)",
  "Fit Group To Contents": "Fit Group To Contents",
  "Group Selected Nodes": "Group Selected Nodes",
  "Convert selected nodes to group node": "Convert selected nodes to group node",
  "Manage group nodes": "Manage group nodes",
  "Ungroup selected group nodes": "Ungroup selected group nodes",
  "About ComfyUI": "About ComfyUI",
  "Comfy-Org Discord": "Comfy-Org Discord",
  "ComfyUI Docs": "ComfyUI Docs",
  "ComfyUI Issues": "ComfyUI Issues",
  Interrupt: "Interrupt",
  "Load Default Workflow": "Load Default Workflow",
  New: "New",
  Clipspace: "Clipspace",
  Open: "Open",
  "Queue Prompt": "Queue Prompt",
  "Queue Prompt (Front)": "Queue Prompt (Front)",
  Redo: "Redo",
  "Refresh Node Definitions": "Refresh Node Definitions",
  Save: "Save",
  "Save As": "Save As",
  "Show Settings Dialog": "Show Settings Dialog",
  "Toggle Theme (Dark/Light)": "Toggle Theme (Dark/Light)",
  Undo: "Undo",
  "Next Opened Workflow": "Next Opened Workflow",
  "Previous Opened Workflow": "Previous Opened Workflow",
  "Toggle Search Box": "Toggle Search Box",
  "Toggle Bottom Panel": "Toggle Bottom Panel",
  "Toggle Terminal Bottom Panel": "Toggle Terminal Bottom Panel",
  "Toggle Logs Bottom Panel": "Toggle Logs Bottom Panel",
  "Toggle Focus Mode": "Toggle Focus Mode",
  "Toggle Model Library Sidebar": "Toggle Model Library Sidebar",
  "Toggle Node Library Sidebar": "Toggle Node Library Sidebar",
  "Toggle Queue Sidebar": "Toggle Queue Sidebar",
  "Toggle Workflows Sidebar": "Toggle Workflows Sidebar"
};
const desktopMenu$5 = {
  reinstall: "Reinstall",
  confirmReinstall: "This will clear your extra_models_config.yaml file,\nand begin installation again.\n\nAre you sure?"
};
const settingsCategories$5 = {
  "Comfy-Desktop": "Comfy-Desktop",
  General: "General",
  Appearance: "Appearance",
  ColorPalette: "Color Palette",
  Comfy: "Comfy",
  Workflow: "Workflow",
  DevMode: "Dev Mode",
  LiteGraph: "Lite Graph",
  "Node Widget": "Node Widget",
  Node: "Node",
  Extension: "Extension",
  Canvas: "Canvas",
  Link: "Link",
  Group: "Group",
  Menu: "Menu",
  Keybinding: "Keybinding",
  LinkRelease: "Link Release",
  Graph: "Graph",
  Locale: "Locale",
  "Mask Editor": "Mask Editor",
  BrushAdjustment: "Brush Adjustment",
  NewEditor: "New Editor",
  ModelLibrary: "Model Library",
  NodeInputConversionSubmenus: "Node Input Conversion Submenus",
  NodeLibrary: "Node Library",
  "Node Search Box": "Node Search Box",
  Pointer: "Pointer",
  Queue: "Queue",
  QueueButton: "Queue Button",
  RerouteBeta: "Reroute Beta",
  Server: "Server",
  Settings: "Settings",
  Sidebar: "Sidebar",
  "Tree Explorer": "Tree Explorer",
  Validation: "Validation",
  Window: "Window",
  "Server-Config": "Server-Config",
  About: "About",
  EditTokenWeight: "Edit Token Weight",
  CustomColorPalettes: "Custom Color Palettes"
};
const serverConfigItems$5 = {
  listen: {
    name: "Host: The IP address to listen on"
  },
  port: {
    name: "Port: The port to listen on"
  },
  "tls-keyfile": {
    name: "TLS Key File: Path to TLS key file for HTTPS"
  },
  "tls-certfile": {
    name: "TLS Certificate File: Path to TLS certificate file for HTTPS"
  },
  "enable-cors-header": {
    name: 'Enable CORS header: Use "*" for all origins or specify domain'
  },
  "max-upload-size": {
    name: "Maximum upload size (MB)"
  },
  "cuda-device": {
    name: "CUDA device index to use"
  },
  "cuda-malloc": {
    name: "Use CUDA malloc for memory allocation"
  },
  "global-precision": {
    name: "Global floating point precision",
    tooltip: "Global floating point precision"
  },
  "unet-precision": {
    name: "UNET precision",
    tooltip: "UNET precision"
  },
  "vae-precision": {
    name: "VAE precision",
    tooltip: "VAE precision"
  },
  "cpu-vae": {
    name: "Run VAE on CPU"
  },
  "text-encoder-precision": {
    name: "Text Encoder precision",
    tooltip: "Text Encoder precision"
  },
  "force-channels-last": {
    name: "Force channels-last memory format"
  },
  directml: {
    name: "DirectML device index"
  },
  "disable-ipex-optimize": {
    name: "Disable IPEX optimization"
  },
  "preview-method": {
    name: "Method used for latent previews"
  },
  "preview-size": {
    name: "Size of preview images"
  },
  "cache-classic": {
    name: "Use classic cache system"
  },
  "cache-lru": {
    name: "Use LRU caching with a maximum of N node results cached.",
    tooltip: "May use more RAM/VRAM."
  },
  "cross-attention-method": {
    name: "Cross attention method"
  },
  "disable-xformers": {
    name: "Disable xFormers optimization"
  },
  "force-upcast-attention": {
    name: "Force attention upcast"
  },
  "dont-upcast-attention": {
    name: "Prevent attention upcast"
  },
  "vram-management": {
    name: "VRAM management mode"
  },
  "reserve-vram": {
    name: "Reserved VRAM (GB)",
    tooltip: "Set the amount of vram in GB you want to reserve for use by your OS/other software. By default some amount is reverved depending on your OS."
  },
  "default-hashing-function": {
    name: "Default hashing function for model files"
  },
  "disable-smart-memory": {
    name: "Disable smart memory management",
    tooltip: "Force ComfyUI to aggressively offload to regular ram instead of keeping models in vram when it can."
  },
  deterministic: {
    name: "Make pytorch use slower deterministic algorithms when it can.",
    tooltip: "Note that this might not make images deterministic in all cases."
  },
  fast: {
    name: "Enable some untested and potentially quality deteriorating optimizations."
  },
  "dont-print-server": {
    name: "Don't print server output to console."
  },
  "disable-metadata": {
    name: "Disable saving prompt metadata in files."
  },
  "disable-all-custom-nodes": {
    name: "Disable loading all custom nodes."
  },
  "log-level": {
    name: "Logging verbosity level"
  },
  "input-directory": {
    name: "Input directory"
  },
  "output-directory": {
    name: "Output directory"
  }
};
const serverConfigCategories$5 = {
  Network: "Network",
  CUDA: "CUDA",
  Inference: "Inference",
  Memory: "Memory",
  Preview: "Preview",
  Cache: "Cache",
  Attention: "Attention",
  General: "General",
  Directories: "Directories"
};
const nodeCategories$5 = {
  _for_testing: "_for_testing",
  custom_sampling: "custom_sampling",
  noise: "noise",
  sampling: "sampling",
  schedulers: "schedulers",
  guiders: "guiders",
  image: "image",
  preprocessors: "preprocessors",
  advanced: "advanced",
  loaders: "loaders",
  model_merging: "model_merging",
  attention_experiments: "attention_experiments",
  conditioning: "conditioning",
  flux: "flux",
  hooks: "hooks",
  combine: "combine",
  "cond single": "cond single",
  controlnet: "controlnet",
  scheduling: "scheduling",
  create: "create",
  mask: "mask",
  DevTools: "DevTools",
  deprecated: "deprecated",
  latent: "latent",
  video: "video",
  audio: "audio",
  ltxv: "ltxv",
  sd3: "sd3",
  sigmas: "sigmas",
  model_patches: "model_patches",
  unet: "unet",
  gligen: "gligen",
  postprocessing: "postprocessing",
  transform: "transform",
  batch: "batch",
  video_models: "video_models",
  upscaling: "upscaling",
  inpaint: "inpaint",
  instructpix2pix: "instructpix2pix",
  compositing: "compositing",
  samplers: "samplers",
  operations: "operations",
  "3d": "3d",
  model_specific: "model_specific",
  model: "model",
  "cond pair": "cond pair",
  photomaker: "photomaker",
  animation: "animation",
  api: "api",
  upscale_diffusion: "upscale_diffusion",
  clip: "clip",
  guidance: "guidance",
  stable_cascade: "stable_cascade",
  "3d_models": "3d_models",
  style_model: "style_model"
};
const dataTypes$5 = {
  AUDIO: "AUDIO",
  BOOLEAN: "BOOLEAN",
  CLIP: "CLIP",
  CLIP_VISION: "CLIP_VISION",
  CLIP_VISION_OUTPUT: "CLIP_VISION_OUTPUT",
  COMBO: "COMBO",
  CONDITIONING: "CONDITIONING",
  CONTROL_NET: "CONTROL_NET",
  FLOAT: "FLOAT",
  FLOATS: "FLOATS",
  GLIGEN: "GLIGEN",
  GUIDER: "GUIDER",
  HOOK_KEYFRAMES: "HOOK_KEYFRAMES",
  HOOKS: "HOOKS",
  IMAGE: "IMAGE",
  INT: "INT",
  LATENT: "LATENT",
  LATENT_OPERATION: "LATENT_OPERATION",
  LOAD_3D: "LOAD_3D",
  LOAD_3D_ANIMATION: "LOAD_3D_ANIMATION",
  MASK: "MASK",
  MODEL: "MODEL",
  NOISE: "NOISE",
  PHOTOMAKER: "PHOTOMAKER",
  SAMPLER: "SAMPLER",
  SIGMAS: "SIGMAS",
  STRING: "STRING",
  STYLE_MODEL: "STYLE_MODEL",
  TIMESTEPS_RANGE: "TIMESTEPS_RANGE",
  UPSCALE_MODEL: "UPSCALE_MODEL",
  VAE: "VAE",
  WEBCAM: "WEBCAM"
};
const en = {
  g: g$5,
  color: color$5,
  icon: icon$5,
  welcome: welcome$5,
  userSelect: userSelect$5,
  notSupported: notSupported$5,
  downloadGit: downloadGit$5,
  install: install$5,
  serverStart: serverStart$5,
  serverConfig: serverConfig$5,
  sideToolbar: sideToolbar$5,
  menu: menu$5,
  tabMenu: tabMenu$5,
  templateWorkflows: templateWorkflows$5,
  graphCanvasMenu: graphCanvasMenu$5,
  groupNode: groupNode$5,
  nodeTemplates: nodeTemplates$5,
  workflowService: workflowService$5,
  electronFileDownload: electronFileDownload$5,
  menuLabels: menuLabels$5,
  desktopMenu: desktopMenu$5,
  settingsCategories: settingsCategories$5,
  serverConfigItems: serverConfigItems$5,
  serverConfigCategories: serverConfigCategories$5,
  nodeCategories: nodeCategories$5,
  dataTypes: dataTypes$5
};
const AddNoise$5 = {
  display_name: "AddNoise",
  inputs: {
    model: {
      name: "model"
    },
    noise: {
      name: "noise"
    },
    sigmas: {
      name: "sigmas"
    },
    latent_image: {
      name: "latent_image"
    }
  }
};
const AlignYourStepsScheduler$5 = {
  display_name: "AlignYourStepsScheduler",
  inputs: {
    model_type: {
      name: "model_type"
    },
    steps: {
      name: "steps"
    },
    denoise: {
      name: "denoise"
    }
  }
};
const BasicGuider$5 = {
  display_name: "BasicGuider",
  inputs: {
    model: {
      name: "model"
    },
    conditioning: {
      name: "conditioning"
    }
  }
};
const BasicScheduler$5 = {
  display_name: "BasicScheduler",
  inputs: {
    model: {
      name: "model"
    },
    scheduler: {
      name: "scheduler"
    },
    steps: {
      name: "steps"
    },
    denoise: {
      name: "denoise"
    }
  }
};
const BetaSamplingScheduler$5 = {
  display_name: "BetaSamplingScheduler",
  inputs: {
    model: {
      name: "model"
    },
    steps: {
      name: "steps"
    },
    alpha: {
      name: "alpha"
    },
    beta: {
      name: "beta"
    }
  }
};
const Canny$5 = {
  display_name: "Canny",
  inputs: {
    image: {
      name: "image"
    },
    low_threshold: {
      name: "low_threshold"
    },
    high_threshold: {
      name: "high_threshold"
    }
  }
};
const CFGGuider$5 = {
  display_name: "CFGGuider",
  inputs: {
    model: {
      name: "model"
    },
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    cfg: {
      name: "cfg"
    }
  }
};
const CheckpointLoader$5 = {
  display_name: "Load Checkpoint With Config (DEPRECATED)",
  inputs: {
    config_name: {
      name: "config_name"
    },
    ckpt_name: {
      name: "ckpt_name"
    }
  }
};
const CheckpointLoaderSimple$5 = {
  display_name: "Load Checkpoint",
  description: "Loads a diffusion model checkpoint, diffusion models are used to denoise latents.",
  inputs: {
    ckpt_name: {
      name: "ckpt_name",
      tooltip: "The name of the checkpoint (model) to load."
    }
  },
  outputs: {
    "0": {
      tooltip: "The model used for denoising latents."
    },
    "1": {
      tooltip: "The CLIP model used for encoding text prompts."
    },
    "2": {
      tooltip: "The VAE model used for encoding and decoding images to and from latent space."
    }
  }
};
const CheckpointSave$5 = {
  display_name: "Save Checkpoint",
  inputs: {
    model: {
      name: "model"
    },
    clip: {
      name: "clip"
    },
    vae: {
      name: "vae"
    },
    filename_prefix: {
      name: "filename_prefix"
    }
  }
};
const CLIPAttentionMultiply$5 = {
  display_name: "CLIPAttentionMultiply",
  inputs: {
    clip: {
      name: "clip"
    },
    q: {
      name: "q"
    },
    k: {
      name: "k"
    },
    v: {
      name: "v"
    },
    out: {
      name: "out"
    }
  }
};
const CLIPLoader$5 = {
  display_name: "Load CLIP",
  description: "[Recipes]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 / clip-g / clip-l\nstable_audio: t5\nmochi: t5",
  inputs: {
    clip_name: {
      name: "clip_name"
    },
    type: {
      name: "type"
    }
  }
};
const CLIPMergeAdd$5 = {
  display_name: "CLIPMergeAdd",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    }
  }
};
const CLIPMergeSimple$5 = {
  display_name: "CLIPMergeSimple",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    ratio: {
      name: "ratio"
    }
  }
};
const CLIPMergeSubtract$5 = {
  display_name: "CLIPMergeSubtract",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    multiplier: {
      name: "multiplier"
    }
  }
};
const CLIPSave$5 = {
  display_name: "CLIPSave",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "filename_prefix"
    }
  }
};
const CLIPSetLastLayer$5 = {
  display_name: "CLIP Set Last Layer",
  inputs: {
    clip: {
      name: "clip"
    },
    stop_at_clip_layer: {
      name: "stop_at_clip_layer"
    }
  }
};
const CLIPTextEncode$5 = {
  display_name: "CLIP Text Encode (Prompt)",
  description: "Encodes a text prompt using a CLIP model into an embedding that can be used to guide the diffusion model towards generating specific images.",
  inputs: {
    text: {
      name: "text",
      tooltip: "The text to be encoded."
    },
    clip: {
      name: "clip",
      tooltip: "The CLIP model used for encoding the text."
    }
  },
  outputs: {
    "0": {
      tooltip: "A conditioning containing the embedded text used to guide the diffusion model."
    }
  }
};
const CLIPTextEncodeControlnet$5 = {
  display_name: "CLIPTextEncodeControlnet",
  inputs: {
    clip: {
      name: "clip"
    },
    conditioning: {
      name: "conditioning"
    },
    text: {
      name: "text"
    }
  }
};
const CLIPTextEncodeFlux$5 = {
  display_name: "CLIPTextEncodeFlux",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_l: {
      name: "clip_l"
    },
    t5xxl: {
      name: "t5xxl"
    },
    guidance: {
      name: "guidance"
    }
  }
};
const CLIPTextEncodeHunyuanDiT$5 = {
  display_name: "CLIPTextEncodeHunyuanDiT",
  inputs: {
    clip: {
      name: "clip"
    },
    bert: {
      name: "bert"
    },
    mt5xl: {
      name: "mt5xl"
    }
  }
};
const CLIPTextEncodePixArtAlpha$5 = {
  display_name: "CLIPTextEncodePixArtAlpha",
  description: "Encodes text and sets the resolution conditioning for PixArt Alpha. Does not apply to PixArt Sigma.",
  inputs: {
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    text: {
      name: "text"
    },
    clip: {
      name: "clip"
    }
  }
};
const CLIPTextEncodeSD3$5 = {
  display_name: "CLIPTextEncodeSD3",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_l: {
      name: "clip_l"
    },
    clip_g: {
      name: "clip_g"
    },
    t5xxl: {
      name: "t5xxl"
    },
    empty_padding: {
      name: "empty_padding"
    }
  }
};
const CLIPTextEncodeSDXL$5 = {
  display_name: "CLIPTextEncodeSDXL",
  inputs: {
    clip: {
      name: "clip"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    crop_w: {
      name: "crop_w"
    },
    crop_h: {
      name: "crop_h"
    },
    target_width: {
      name: "target_width"
    },
    target_height: {
      name: "target_height"
    },
    text_g: {
      name: "text_g"
    },
    text_l: {
      name: "text_l"
    }
  }
};
const CLIPTextEncodeSDXLRefiner$5 = {
  display_name: "CLIPTextEncodeSDXLRefiner",
  inputs: {
    ascore: {
      name: "ascore"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    text: {
      name: "text"
    },
    clip: {
      name: "clip"
    }
  }
};
const CLIPVisionEncode$5 = {
  display_name: "CLIP Vision Encode",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    image: {
      name: "image"
    },
    crop: {
      name: "crop"
    }
  }
};
const CLIPVisionLoader$5 = {
  display_name: "Load CLIP Vision",
  inputs: {
    clip_name: {
      name: "clip_name"
    }
  }
};
const CombineHooks2$5 = {
  display_name: "Combine Hooks [2]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    }
  }
};
const CombineHooks4$5 = {
  display_name: "Combine Hooks [4]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    },
    hooks_C: {
      name: "hooks_C"
    },
    hooks_D: {
      name: "hooks_D"
    }
  }
};
const CombineHooks8$5 = {
  display_name: "Combine Hooks [8]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    },
    hooks_C: {
      name: "hooks_C"
    },
    hooks_D: {
      name: "hooks_D"
    },
    hooks_E: {
      name: "hooks_E"
    },
    hooks_F: {
      name: "hooks_F"
    },
    hooks_G: {
      name: "hooks_G"
    },
    hooks_H: {
      name: "hooks_H"
    }
  }
};
const ConditioningAverage$5 = {
  display_name: "ConditioningAverage",
  inputs: {
    conditioning_to: {
      name: "conditioning_to"
    },
    conditioning_from: {
      name: "conditioning_from"
    },
    conditioning_to_strength: {
      name: "conditioning_to_strength"
    }
  }
};
const ConditioningCombine$5 = {
  display_name: "Conditioning (Combine)",
  inputs: {
    conditioning_1: {
      name: "conditioning_1"
    },
    conditioning_2: {
      name: "conditioning_2"
    }
  }
};
const ConditioningConcat$5 = {
  display_name: "Conditioning (Concat)",
  inputs: {
    conditioning_to: {
      name: "conditioning_to"
    },
    conditioning_from: {
      name: "conditioning_from"
    }
  }
};
const ConditioningSetArea$5 = {
  display_name: "Conditioning (Set Area)",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    },
    strength: {
      name: "strength"
    }
  }
};
const ConditioningSetAreaPercentage$5 = {
  display_name: "Conditioning (Set Area with Percentage)",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    },
    strength: {
      name: "strength"
    }
  }
};
const ConditioningSetAreaStrength$5 = {
  display_name: "ConditioningSetAreaStrength",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    strength: {
      name: "strength"
    }
  }
};
const ConditioningSetDefaultCombine$5 = {
  display_name: "Cond Set Default Combine",
  inputs: {
    cond: {
      name: "cond"
    },
    cond_DEFAULT: {
      name: "cond_DEFAULT"
    },
    hooks: {
      name: "hooks"
    }
  }
};
const ConditioningSetMask$5 = {
  display_name: "Conditioning (Set Mask)",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    mask: {
      name: "mask"
    },
    strength: {
      name: "strength"
    },
    set_cond_area: {
      name: "set_cond_area"
    }
  }
};
const ConditioningSetProperties$5 = {
  display_name: "Cond Set Props",
  inputs: {
    cond_NEW: {
      name: "cond_NEW"
    },
    strength: {
      name: "strength"
    },
    set_cond_area: {
      name: "set_cond_area"
    },
    mask: {
      name: "mask"
    },
    hooks: {
      name: "hooks"
    },
    timesteps: {
      name: "timesteps"
    }
  }
};
const ConditioningSetPropertiesAndCombine$5 = {
  display_name: "Cond Set Props Combine",
  inputs: {
    cond: {
      name: "cond"
    },
    cond_NEW: {
      name: "cond_NEW"
    },
    strength: {
      name: "strength"
    },
    set_cond_area: {
      name: "set_cond_area"
    },
    mask: {
      name: "mask"
    },
    hooks: {
      name: "hooks"
    },
    timesteps: {
      name: "timesteps"
    }
  }
};
const ConditioningSetTimestepRange$5 = {
  display_name: "ConditioningSetTimestepRange",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    start: {
      name: "start"
    },
    end: {
      name: "end"
    }
  }
};
const ConditioningStableAudio$5 = {
  display_name: "ConditioningStableAudio",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    seconds_start: {
      name: "seconds_start"
    },
    seconds_total: {
      name: "seconds_total"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const ConditioningTimestepsRange$5 = {
  display_name: "Timesteps Range",
  inputs: {
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    }
  },
  outputs: {
    "1": {
      name: "BEFORE_RANGE"
    },
    "2": {
      name: "AFTER_RANGE"
    }
  }
};
const ConditioningZeroOut$5 = {
  display_name: "ConditioningZeroOut",
  inputs: {
    conditioning: {
      name: "conditioning"
    }
  }
};
const ControlNetApply$5 = {
  display_name: "Apply ControlNet (OLD)",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    control_net: {
      name: "control_net"
    },
    image: {
      name: "image"
    },
    strength: {
      name: "strength"
    }
  }
};
const ControlNetApplyAdvanced$5 = {
  display_name: "Apply ControlNet",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    control_net: {
      name: "control_net"
    },
    image: {
      name: "image"
    },
    strength: {
      name: "strength"
    },
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const ControlNetApplySD3$5 = {
  display_name: "Apply Controlnet with VAE",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    control_net: {
      name: "control_net"
    },
    vae: {
      name: "vae"
    },
    image: {
      name: "image"
    },
    strength: {
      name: "strength"
    },
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const ControlNetInpaintingAliMamaApply$5 = {
  display_name: "ControlNetInpaintingAliMamaApply",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    control_net: {
      name: "control_net"
    },
    vae: {
      name: "vae"
    },
    image: {
      name: "image"
    },
    mask: {
      name: "mask"
    },
    strength: {
      name: "strength"
    },
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const ControlNetLoader$5 = {
  display_name: "Load ControlNet Model",
  inputs: {
    control_net_name: {
      name: "control_net_name"
    }
  }
};
const CreateHookKeyframe$5 = {
  display_name: "Create Hook Keyframe",
  inputs: {
    strength_mult: {
      name: "strength_mult"
    },
    start_percent: {
      name: "start_percent"
    },
    prev_hook_kf: {
      name: "prev_hook_kf"
    }
  },
  outputs: {
    "0": {
      name: "HOOK_KF"
    }
  }
};
const CreateHookKeyframesFromFloats$5 = {
  display_name: "Create Hook Keyframes From Floats",
  inputs: {
    floats_strength: {
      name: "floats_strength"
    },
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    },
    print_keyframes: {
      name: "print_keyframes"
    },
    prev_hook_kf: {
      name: "prev_hook_kf"
    }
  },
  outputs: {
    "0": {
      name: "HOOK_KF"
    }
  }
};
const CreateHookKeyframesInterpolated$5 = {
  display_name: "Create Hook Keyframes Interp.",
  inputs: {
    strength_start: {
      name: "strength_start"
    },
    strength_end: {
      name: "strength_end"
    },
    interpolation: {
      name: "interpolation"
    },
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    },
    keyframes_count: {
      name: "keyframes_count"
    },
    print_keyframes: {
      name: "print_keyframes"
    },
    prev_hook_kf: {
      name: "prev_hook_kf"
    }
  },
  outputs: {
    "0": {
      name: "HOOK_KF"
    }
  }
};
const CreateHookLora$5 = {
  display_name: "Create Hook LoRA",
  inputs: {
    lora_name: {
      name: "lora_name"
    },
    strength_model: {
      name: "strength_model"
    },
    strength_clip: {
      name: "strength_clip"
    },
    prev_hooks: {
      name: "prev_hooks"
    }
  }
};
const CreateHookLoraModelOnly$5 = {
  display_name: "Create Hook LoRA (MO)",
  inputs: {
    lora_name: {
      name: "lora_name"
    },
    strength_model: {
      name: "strength_model"
    },
    prev_hooks: {
      name: "prev_hooks"
    }
  }
};
const CreateHookModelAsLora$5 = {
  display_name: "Create Hook Model as LoRA",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    },
    strength_model: {
      name: "strength_model"
    },
    strength_clip: {
      name: "strength_clip"
    },
    prev_hooks: {
      name: "prev_hooks"
    }
  }
};
const CreateHookModelAsLoraModelOnly$5 = {
  display_name: "Create Hook Model as LoRA (MO)",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    },
    strength_model: {
      name: "strength_model"
    },
    prev_hooks: {
      name: "prev_hooks"
    }
  }
};
const CropMask$5 = {
  display_name: "CropMask",
  inputs: {
    mask: {
      name: "mask"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    }
  }
};
const DevToolsDeprecatedNode$5 = {
  display_name: "Deprecated Node",
  description: "A deprecated node"
};
const DevToolsErrorRaiseNode$5 = {
  display_name: "Raise Error",
  description: "Raise an error for development purposes"
};
const DevToolsErrorRaiseNodeWithMessage$5 = {
  display_name: "Raise Error with Message",
  description: "Raise an error with message for development purposes",
  inputs: {
    message: {
      name: "message"
    }
  }
};
const DevToolsExperimentalNode$5 = {
  display_name: "Experimental Node",
  description: "A experimental node"
};
const DevToolsLongComboDropdown$5 = {
  display_name: "Long Combo Dropdown",
  description: "A long combo dropdown",
  inputs: {
    option: {
      name: "option"
    }
  }
};
const DevToolsNodeWithForceInput$5 = {
  display_name: "Node With Force Input",
  description: "A node with a forced input",
  inputs: {
    int_input: {
      name: "int_input"
    },
    int_input_widget: {
      name: "int_input_widget"
    },
    float_input: {
      name: "float_input"
    }
  }
};
const DevToolsNodeWithOnlyOptionalInput$5 = {
  display_name: "Node With Only Optional Input",
  description: "A node with only optional input",
  inputs: {
    text: {
      name: "text"
    },
    clip: {
      name: "clip"
    }
  }
};
const DevToolsNodeWithOptionalInput$5 = {
  display_name: "Node With Optional Input",
  description: "A node with an optional input",
  inputs: {
    required_input: {
      name: "required_input"
    },
    optional_input: {
      name: "optional_input"
    }
  }
};
const DevToolsNodeWithOutputList$5 = {
  display_name: "Node With Output List",
  description: "A node with an output list",
  outputs: {
    "0": {
      name: "INTEGER OUTPUT"
    },
    "1": {
      name: "INTEGER LIST OUTPUT"
    }
  }
};
const DevToolsNodeWithStringInput$5 = {
  display_name: "Node With String Input",
  description: "A node with a string input",
  inputs: {
    string_input: {
      name: "string_input"
    }
  }
};
const DevToolsNodeWithUnionInput$5 = {
  display_name: "Node With Union Input",
  description: "A node with a union input",
  inputs: {
    string_or_int_input: {
      name: "string_or_int_input"
    },
    string_input: {
      name: "string_input"
    },
    int_input: {
      name: "int_input"
    }
  }
};
const DevToolsSimpleSlider$5 = {
  display_name: "Simple Slider",
  inputs: {
    value: {
      name: "value"
    }
  }
};
const DiffControlNetLoader$5 = {
  display_name: "Load ControlNet Model (diff)",
  inputs: {
    model: {
      name: "model"
    },
    control_net_name: {
      name: "control_net_name"
    }
  }
};
const DifferentialDiffusion$5 = {
  display_name: "Differential Diffusion",
  inputs: {
    model: {
      name: "model"
    }
  }
};
const DiffusersLoader$5 = {
  display_name: "DiffusersLoader",
  inputs: {
    model_path: {
      name: "model_path"
    }
  }
};
const DisableNoise$5 = {
  display_name: "DisableNoise"
};
const DualCFGGuider$5 = {
  display_name: "DualCFGGuider",
  inputs: {
    model: {
      name: "model"
    },
    cond1: {
      name: "cond1"
    },
    cond2: {
      name: "cond2"
    },
    negative: {
      name: "negative"
    },
    cfg_conds: {
      name: "cfg_conds"
    },
    cfg_cond2_negative: {
      name: "cfg_cond2_negative"
    }
  }
};
const DualCLIPLoader$5 = {
  display_name: "DualCLIPLoader",
  description: "[Recipes]\n\nsdxl: clip-l, clip-g\nsd3: clip-l, clip-g / clip-l, t5 / clip-g, t5\nflux: clip-l, t5",
  inputs: {
    clip_name1: {
      name: "clip_name1"
    },
    clip_name2: {
      name: "clip_name2"
    },
    type: {
      name: "type"
    }
  }
};
const EmptyHunyuanLatentVideo$5 = {
  display_name: "EmptyHunyuanLatentVideo",
  inputs: {
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    length: {
      name: "length"
    },
    batch_size: {
      name: "batch_size"
    }
  }
};
const EmptyImage$5 = {
  display_name: "EmptyImage",
  inputs: {
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    batch_size: {
      name: "batch_size"
    },
    color: {
      name: "color"
    }
  }
};
const EmptyLatentAudio$5 = {
  display_name: "EmptyLatentAudio",
  inputs: {
    seconds: {
      name: "seconds"
    },
    batch_size: {
      name: "batch_size",
      tooltip: "The number of latent images in the batch."
    }
  }
};
const EmptyLatentImage$5 = {
  display_name: "Empty Latent Image",
  description: "Create a new batch of empty latent images to be denoised via sampling.",
  inputs: {
    width: {
      name: "width",
      tooltip: "The width of the latent images in pixels."
    },
    height: {
      name: "height",
      tooltip: "The height of the latent images in pixels."
    },
    batch_size: {
      name: "batch_size",
      tooltip: "The number of latent images in the batch."
    }
  },
  outputs: {
    "0": {
      tooltip: "The empty latent image batch."
    }
  }
};
const EmptyLTXVLatentVideo$5 = {
  display_name: "EmptyLTXVLatentVideo",
  inputs: {
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    length: {
      name: "length"
    },
    batch_size: {
      name: "batch_size"
    }
  }
};
const EmptyMochiLatentVideo$5 = {
  display_name: "EmptyMochiLatentVideo",
  inputs: {
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    length: {
      name: "length"
    },
    batch_size: {
      name: "batch_size"
    }
  }
};
const EmptySD3LatentImage$5 = {
  display_name: "EmptySD3LatentImage",
  inputs: {
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    batch_size: {
      name: "batch_size"
    }
  }
};
const ExponentialScheduler$5 = {
  display_name: "ExponentialScheduler",
  inputs: {
    steps: {
      name: "steps"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const FeatherMask$5 = {
  display_name: "FeatherMask",
  inputs: {
    mask: {
      name: "mask"
    },
    left: {
      name: "left"
    },
    top: {
      name: "top"
    },
    right: {
      name: "right"
    },
    bottom: {
      name: "bottom"
    }
  }
};
const FlipSigmas$5 = {
  display_name: "FlipSigmas",
  inputs: {
    sigmas: {
      name: "sigmas"
    }
  }
};
const FluxGuidance$5 = {
  display_name: "FluxGuidance",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    guidance: {
      name: "guidance"
    }
  }
};
const FreeU$5 = {
  display_name: "FreeU",
  inputs: {
    model: {
      name: "model"
    },
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const FreeU_V2$5 = {
  display_name: "FreeU_V2",
  inputs: {
    model: {
      name: "model"
    },
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const GITSScheduler$5 = {
  display_name: "GITSScheduler",
  inputs: {
    coeff: {
      name: "coeff"
    },
    steps: {
      name: "steps"
    },
    denoise: {
      name: "denoise"
    }
  }
};
const GLIGENLoader$5 = {
  display_name: "GLIGENLoader",
  inputs: {
    gligen_name: {
      name: "gligen_name"
    }
  }
};
const GLIGENTextBoxApply$5 = {
  display_name: "GLIGENTextBoxApply",
  inputs: {
    conditioning_to: {
      name: "conditioning_to"
    },
    clip: {
      name: "clip"
    },
    gligen_textbox_model: {
      name: "gligen_textbox_model"
    },
    text: {
      name: "text"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const GrowMask$5 = {
  display_name: "GrowMask",
  inputs: {
    mask: {
      name: "mask"
    },
    expand: {
      name: "expand"
    },
    tapered_corners: {
      name: "tapered_corners"
    }
  }
};
const HypernetworkLoader$5 = {
  display_name: "HypernetworkLoader",
  inputs: {
    model: {
      name: "model"
    },
    hypernetwork_name: {
      name: "hypernetwork_name"
    },
    strength: {
      name: "strength"
    }
  }
};
const HyperTile$5 = {
  display_name: "HyperTile",
  inputs: {
    model: {
      name: "model"
    },
    tile_size: {
      name: "tile_size"
    },
    swap_size: {
      name: "swap_size"
    },
    max_depth: {
      name: "max_depth"
    },
    scale_depth: {
      name: "scale_depth"
    }
  }
};
const ImageBatch$5 = {
  display_name: "Batch Images",
  inputs: {
    image1: {
      name: "image1"
    },
    image2: {
      name: "image2"
    }
  }
};
const ImageBlend$5 = {
  display_name: "Image Blend",
  inputs: {
    image1: {
      name: "image1"
    },
    image2: {
      name: "image2"
    },
    blend_factor: {
      name: "blend_factor"
    },
    blend_mode: {
      name: "blend_mode"
    }
  }
};
const ImageBlur$5 = {
  display_name: "Image Blur",
  inputs: {
    image: {
      name: "image"
    },
    blur_radius: {
      name: "blur_radius"
    },
    sigma: {
      name: "sigma"
    }
  }
};
const ImageColorToMask$5 = {
  display_name: "ImageColorToMask",
  inputs: {
    image: {
      name: "image"
    },
    color: {
      name: "color"
    }
  }
};
const ImageCompositeMasked$5 = {
  display_name: "ImageCompositeMasked",
  inputs: {
    destination: {
      name: "destination"
    },
    source: {
      name: "source"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    },
    resize_source: {
      name: "resize_source"
    },
    mask: {
      name: "mask"
    }
  }
};
const ImageCrop$5 = {
  display_name: "Image Crop",
  inputs: {
    image: {
      name: "image"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageFromBatch$5 = {
  display_name: "ImageFromBatch",
  inputs: {
    image: {
      name: "image"
    },
    batch_index: {
      name: "batch_index"
    },
    length: {
      name: "length"
    }
  }
};
const ImageInvert$5 = {
  display_name: "Invert Image",
  inputs: {
    image: {
      name: "image"
    }
  }
};
const ImageOnlyCheckpointLoader$5 = {
  display_name: "Image Only Checkpoint Loader (img2vid model)",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    }
  }
};
const ImageOnlyCheckpointSave$5 = {
  display_name: "ImageOnlyCheckpointSave",
  inputs: {
    model: {
      name: "model"
    },
    clip_vision: {
      name: "clip_vision"
    },
    vae: {
      name: "vae"
    },
    filename_prefix: {
      name: "filename_prefix"
    }
  }
};
const ImagePadForOutpaint$5 = {
  display_name: "Pad Image for Outpainting",
  inputs: {
    image: {
      name: "image"
    },
    left: {
      name: "left"
    },
    top: {
      name: "top"
    },
    right: {
      name: "right"
    },
    bottom: {
      name: "bottom"
    },
    feathering: {
      name: "feathering"
    }
  }
};
const ImageQuantize$5 = {
  display_name: "Image Quantize",
  inputs: {
    image: {
      name: "image"
    },
    colors: {
      name: "colors"
    },
    dither: {
      name: "dither"
    }
  }
};
const ImageScale$5 = {
  display_name: "Upscale Image",
  inputs: {
    image: {
      name: "image"
    },
    upscale_method: {
      name: "upscale_method"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    crop: {
      name: "crop"
    }
  }
};
const ImageScaleBy$5 = {
  display_name: "Upscale Image By",
  inputs: {
    image: {
      name: "image"
    },
    upscale_method: {
      name: "upscale_method"
    },
    scale_by: {
      name: "scale_by"
    }
  }
};
const ImageScaleToTotalPixels$5 = {
  display_name: "Scale Image to Total Pixels",
  inputs: {
    image: {
      name: "image"
    },
    upscale_method: {
      name: "upscale_method"
    },
    megapixels: {
      name: "megapixels"
    }
  }
};
const ImageSharpen$5 = {
  display_name: "Image Sharpen",
  inputs: {
    image: {
      name: "image"
    },
    sharpen_radius: {
      name: "sharpen_radius"
    },
    sigma: {
      name: "sigma"
    },
    alpha: {
      name: "alpha"
    }
  }
};
const ImageToMask$5 = {
  display_name: "Convert Image to Mask",
  inputs: {
    image: {
      name: "image"
    },
    channel: {
      name: "channel"
    }
  }
};
const ImageUpscaleWithModel$5 = {
  display_name: "Upscale Image (using Model)",
  inputs: {
    upscale_model: {
      name: "upscale_model"
    },
    image: {
      name: "image"
    }
  }
};
const InpaintModelConditioning$5 = {
  display_name: "InpaintModelConditioning",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    vae: {
      name: "vae"
    },
    pixels: {
      name: "pixels"
    },
    mask: {
      name: "mask"
    },
    noise_mask: {
      name: "noise_mask",
      tooltip: "Add a noise mask to the latent so sampling will only happen within the mask. Might improve results or completely break things depending on the model."
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const InstructPixToPixConditioning$5 = {
  display_name: "InstructPixToPixConditioning",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    vae: {
      name: "vae"
    },
    pixels: {
      name: "pixels"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const InvertMask$5 = {
  display_name: "InvertMask",
  inputs: {
    mask: {
      name: "mask"
    }
  }
};
const JoinImageWithAlpha$5 = {
  display_name: "Join Image with Alpha",
  inputs: {
    image: {
      name: "image"
    },
    alpha: {
      name: "alpha"
    }
  }
};
const KarrasScheduler$5 = {
  display_name: "KarrasScheduler",
  inputs: {
    steps: {
      name: "steps"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    rho: {
      name: "rho"
    }
  }
};
const KSampler$5 = {
  display_name: "KSampler",
  description: "Uses the provided model, positive and negative conditioning to denoise the latent image.",
  inputs: {
    model: {
      name: "model",
      tooltip: "The model used for denoising the input latent."
    },
    seed: {
      name: "seed",
      tooltip: "The random seed used for creating the noise."
    },
    steps: {
      name: "steps",
      tooltip: "The number of steps used in the denoising process."
    },
    cfg: {
      name: "cfg",
      tooltip: "The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality."
    },
    sampler_name: {
      name: "sampler_name",
      tooltip: "The algorithm used when sampling, this can affect the quality, speed, and style of the generated output."
    },
    scheduler: {
      name: "scheduler",
      tooltip: "The scheduler controls how noise is gradually removed to form the image."
    },
    positive: {
      name: "positive",
      tooltip: "The conditioning describing the attributes you want to include in the image."
    },
    negative: {
      name: "negative",
      tooltip: "The conditioning describing the attributes you want to exclude from the image."
    },
    latent_image: {
      name: "latent_image",
      tooltip: "The latent image to denoise."
    },
    denoise: {
      name: "denoise",
      tooltip: "The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling."
    }
  },
  outputs: {
    "0": {
      tooltip: "The denoised latent."
    }
  }
};
const KSamplerAdvanced$5 = {
  display_name: "KSampler (Advanced)",
  inputs: {
    model: {
      name: "model"
    },
    add_noise: {
      name: "add_noise"
    },
    noise_seed: {
      name: "noise_seed"
    },
    steps: {
      name: "steps"
    },
    cfg: {
      name: "cfg"
    },
    sampler_name: {
      name: "sampler_name"
    },
    scheduler: {
      name: "scheduler"
    },
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    latent_image: {
      name: "latent_image"
    },
    start_at_step: {
      name: "start_at_step"
    },
    end_at_step: {
      name: "end_at_step"
    },
    return_with_leftover_noise: {
      name: "return_with_leftover_noise"
    }
  }
};
const KSamplerSelect$5 = {
  display_name: "KSamplerSelect",
  inputs: {
    sampler_name: {
      name: "sampler_name"
    }
  }
};
const LaplaceScheduler$5 = {
  display_name: "LaplaceScheduler",
  inputs: {
    steps: {
      name: "steps"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    mu: {
      name: "mu"
    },
    beta: {
      name: "beta"
    }
  }
};
const LatentAdd$5 = {
  display_name: "LatentAdd",
  inputs: {
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    }
  }
};
const LatentApplyOperation$5 = {
  display_name: "LatentApplyOperation",
  inputs: {
    samples: {
      name: "samples"
    },
    operation: {
      name: "operation"
    }
  }
};
const LatentApplyOperationCFG$5 = {
  display_name: "LatentApplyOperationCFG",
  inputs: {
    model: {
      name: "model"
    },
    operation: {
      name: "operation"
    }
  }
};
const LatentBatch$5 = {
  display_name: "LatentBatch",
  inputs: {
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    }
  }
};
const LatentBatchSeedBehavior$5 = {
  display_name: "LatentBatchSeedBehavior",
  inputs: {
    samples: {
      name: "samples"
    },
    seed_behavior: {
      name: "seed_behavior"
    }
  }
};
const LatentBlend$5 = {
  display_name: "Latent Blend",
  inputs: {
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    },
    blend_factor: {
      name: "blend_factor"
    }
  }
};
const LatentComposite$5 = {
  display_name: "Latent Composite",
  inputs: {
    samples_to: {
      name: "samples_to"
    },
    samples_from: {
      name: "samples_from"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    },
    feather: {
      name: "feather"
    }
  }
};
const LatentCompositeMasked$5 = {
  display_name: "LatentCompositeMasked",
  inputs: {
    destination: {
      name: "destination"
    },
    source: {
      name: "source"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    },
    resize_source: {
      name: "resize_source"
    },
    mask: {
      name: "mask"
    }
  }
};
const LatentCrop$5 = {
  display_name: "Crop Latent",
  inputs: {
    samples: {
      name: "samples"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentFlip$5 = {
  display_name: "Flip Latent",
  inputs: {
    samples: {
      name: "samples"
    },
    flip_method: {
      name: "flip_method"
    }
  }
};
const LatentFromBatch$5 = {
  display_name: "Latent From Batch",
  inputs: {
    samples: {
      name: "samples"
    },
    batch_index: {
      name: "batch_index"
    },
    length: {
      name: "length"
    }
  }
};
const LatentInterpolate$5 = {
  display_name: "LatentInterpolate",
  inputs: {
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    },
    ratio: {
      name: "ratio"
    }
  }
};
const LatentMultiply$5 = {
  display_name: "LatentMultiply",
  inputs: {
    samples: {
      name: "samples"
    },
    multiplier: {
      name: "multiplier"
    }
  }
};
const LatentOperationSharpen$5 = {
  display_name: "LatentOperationSharpen",
  inputs: {
    sharpen_radius: {
      name: "sharpen_radius"
    },
    sigma: {
      name: "sigma"
    },
    alpha: {
      name: "alpha"
    }
  }
};
const LatentOperationTonemapReinhard$5 = {
  display_name: "LatentOperationTonemapReinhard",
  inputs: {
    multiplier: {
      name: "multiplier"
    }
  }
};
const LatentRotate$5 = {
  display_name: "Rotate Latent",
  inputs: {
    samples: {
      name: "samples"
    },
    rotation: {
      name: "rotation"
    }
  }
};
const LatentSubtract$5 = {
  display_name: "LatentSubtract",
  inputs: {
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    }
  }
};
const LatentUpscale$5 = {
  display_name: "Upscale Latent",
  inputs: {
    samples: {
      name: "samples"
    },
    upscale_method: {
      name: "upscale_method"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    crop: {
      name: "crop"
    }
  }
};
const LatentUpscaleBy$5 = {
  display_name: "Upscale Latent By",
  inputs: {
    samples: {
      name: "samples"
    },
    upscale_method: {
      name: "upscale_method"
    },
    scale_by: {
      name: "scale_by"
    }
  }
};
const Load3D$5 = {
  display_name: "Load 3D",
  inputs: {
    model_file: {
      name: "model_file"
    },
    image: {
      name: "image"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    show_grid: {
      name: "show_grid"
    },
    camera_type: {
      name: "camera_type"
    },
    view: {
      name: "view"
    },
    material: {
      name: "material"
    },
    bg_color: {
      name: "bg_color"
    },
    light_intensity: {
      name: "light_intensity"
    },
    up_direction: {
      name: "up_direction"
    }
  },
  outputs: {
    "0": {
      name: "image"
    },
    "1": {
      name: "mask"
    },
    "2": {
      name: "mesh_path"
    }
  }
};
const Load3DAnimation$5 = {
  display_name: "Load 3D - Animation",
  inputs: {
    model_file: {
      name: "model_file"
    },
    image: {
      name: "image"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    show_grid: {
      name: "show_grid"
    },
    camera_type: {
      name: "camera_type"
    },
    view: {
      name: "view"
    },
    material: {
      name: "material"
    },
    bg_color: {
      name: "bg_color"
    },
    light_intensity: {
      name: "light_intensity"
    },
    up_direction: {
      name: "up_direction"
    },
    animation_speed: {
      name: "animation_speed"
    }
  },
  outputs: {
    "0": {
      name: "image"
    },
    "1": {
      name: "mask"
    },
    "2": {
      name: "mesh_path"
    }
  }
};
const LoadAudio$5 = {
  display_name: "LoadAudio",
  inputs: {
    audio: {
      name: "audio"
    }
  }
};
const LoadImage$5 = {
  display_name: "Load Image",
  inputs: {
    image: {
      name: "image"
    }
  }
};
const LoadImageMask$5 = {
  display_name: "Load Image (as Mask)",
  inputs: {
    image: {
      name: "image"
    },
    channel: {
      name: "channel"
    }
  }
};
const LoadLatent$5 = {
  display_name: "LoadLatent",
  inputs: {
    latent: {
      name: "latent"
    }
  }
};
const LoraLoader$5 = {
  display_name: "Load LoRA",
  description: "LoRAs are used to modify diffusion and CLIP models, altering the way in which latents are denoised such as applying styles. Multiple LoRA nodes can be linked together.",
  inputs: {
    model: {
      name: "model",
      tooltip: "The diffusion model the LoRA will be applied to."
    },
    clip: {
      name: "clip",
      tooltip: "The CLIP model the LoRA will be applied to."
    },
    lora_name: {
      name: "lora_name",
      tooltip: "The name of the LoRA."
    },
    strength_model: {
      name: "strength_model",
      tooltip: "How strongly to modify the diffusion model. This value can be negative."
    },
    strength_clip: {
      name: "strength_clip",
      tooltip: "How strongly to modify the CLIP model. This value can be negative."
    }
  },
  outputs: {
    "0": {
      tooltip: "The modified diffusion model."
    },
    "1": {
      tooltip: "The modified CLIP model."
    }
  }
};
const LoraLoaderModelOnly$5 = {
  display_name: "LoraLoaderModelOnly",
  description: "LoRAs are used to modify diffusion and CLIP models, altering the way in which latents are denoised such as applying styles. Multiple LoRA nodes can be linked together.",
  inputs: {
    model: {
      name: "model"
    },
    lora_name: {
      name: "lora_name"
    },
    strength_model: {
      name: "strength_model"
    }
  },
  outputs: {
    "0": {
      tooltip: "The modified diffusion model."
    }
  }
};
const LoraSave$5 = {
  display_name: "Extract and Save Lora",
  inputs: {
    filename_prefix: {
      name: "filename_prefix"
    },
    rank: {
      name: "rank"
    },
    lora_type: {
      name: "lora_type"
    },
    bias_diff: {
      name: "bias_diff"
    },
    model_diff: {
      name: "model_diff",
      tooltip: "The ModelSubtract output to be converted to a lora."
    },
    text_encoder_diff: {
      name: "text_encoder_diff",
      tooltip: "The CLIPSubtract output to be converted to a lora."
    }
  }
};
const LTXVConditioning$5 = {
  display_name: "LTXVConditioning",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    frame_rate: {
      name: "frame_rate"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const LTXVImgToVideo$5 = {
  display_name: "LTXVImgToVideo",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    vae: {
      name: "vae"
    },
    image: {
      name: "image"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    length: {
      name: "length"
    },
    batch_size: {
      name: "batch_size"
    },
    image_noise_scale: {
      name: "image_noise_scale",
      tooltip: "Amount of noise to apply on conditioning image latent."
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const LTXVScheduler$5 = {
  display_name: "LTXVScheduler",
  inputs: {
    steps: {
      name: "steps"
    },
    max_shift: {
      name: "max_shift"
    },
    base_shift: {
      name: "base_shift"
    },
    stretch: {
      name: "stretch",
      tooltip: "Stretch the sigmas to be in the range [terminal, 1]."
    },
    terminal: {
      name: "terminal",
      tooltip: "The terminal value of the sigmas after stretching."
    },
    latent: {
      name: "latent"
    }
  }
};
const Mahiro$5 = {
  display_name: "Mahiro is so cute that she deserves a better guidance function!! (。・ω・。)",
  description: "Modify the guidance to scale more on the 'direction' of the positive prompt rather than the difference between the negative prompt.",
  inputs: {
    model: {
      name: "model"
    }
  },
  outputs: {
    "0": {
      name: "patched_model"
    }
  }
};
const MaskComposite$5 = {
  display_name: "MaskComposite",
  inputs: {
    destination: {
      name: "destination"
    },
    source: {
      name: "source"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    },
    operation: {
      name: "operation"
    }
  }
};
const MaskToImage$5 = {
  display_name: "Convert Mask to Image",
  inputs: {
    mask: {
      name: "mask"
    }
  }
};
const ModelMergeAdd$5 = {
  display_name: "ModelMergeAdd",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    }
  }
};
const ModelMergeAuraflow$5 = {
  display_name: "ModelMergeAuraflow",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    init_x_linear_: {
      name: "init_x_linear."
    },
    positional_encoding: {
      name: "positional_encoding"
    },
    cond_seq_linear_: {
      name: "cond_seq_linear."
    },
    register_tokens: {
      name: "register_tokens"
    },
    t_embedder_: {
      name: "t_embedder."
    },
    double_layers_0_: {
      name: "double_layers.0."
    },
    double_layers_1_: {
      name: "double_layers.1."
    },
    double_layers_2_: {
      name: "double_layers.2."
    },
    double_layers_3_: {
      name: "double_layers.3."
    },
    single_layers_0_: {
      name: "single_layers.0."
    },
    single_layers_1_: {
      name: "single_layers.1."
    },
    single_layers_2_: {
      name: "single_layers.2."
    },
    single_layers_3_: {
      name: "single_layers.3."
    },
    single_layers_4_: {
      name: "single_layers.4."
    },
    single_layers_5_: {
      name: "single_layers.5."
    },
    single_layers_6_: {
      name: "single_layers.6."
    },
    single_layers_7_: {
      name: "single_layers.7."
    },
    single_layers_8_: {
      name: "single_layers.8."
    },
    single_layers_9_: {
      name: "single_layers.9."
    },
    single_layers_10_: {
      name: "single_layers.10."
    },
    single_layers_11_: {
      name: "single_layers.11."
    },
    single_layers_12_: {
      name: "single_layers.12."
    },
    single_layers_13_: {
      name: "single_layers.13."
    },
    single_layers_14_: {
      name: "single_layers.14."
    },
    single_layers_15_: {
      name: "single_layers.15."
    },
    single_layers_16_: {
      name: "single_layers.16."
    },
    single_layers_17_: {
      name: "single_layers.17."
    },
    single_layers_18_: {
      name: "single_layers.18."
    },
    single_layers_19_: {
      name: "single_layers.19."
    },
    single_layers_20_: {
      name: "single_layers.20."
    },
    single_layers_21_: {
      name: "single_layers.21."
    },
    single_layers_22_: {
      name: "single_layers.22."
    },
    single_layers_23_: {
      name: "single_layers.23."
    },
    single_layers_24_: {
      name: "single_layers.24."
    },
    single_layers_25_: {
      name: "single_layers.25."
    },
    single_layers_26_: {
      name: "single_layers.26."
    },
    single_layers_27_: {
      name: "single_layers.27."
    },
    single_layers_28_: {
      name: "single_layers.28."
    },
    single_layers_29_: {
      name: "single_layers.29."
    },
    single_layers_30_: {
      name: "single_layers.30."
    },
    single_layers_31_: {
      name: "single_layers.31."
    },
    modF_: {
      name: "modF."
    },
    final_linear_: {
      name: "final_linear."
    }
  }
};
const ModelMergeBlocks$5 = {
  display_name: "ModelMergeBlocks",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    input: {
      name: "input"
    },
    middle: {
      name: "middle"
    },
    out: {
      name: "out"
    }
  }
};
const ModelMergeFlux1$5 = {
  display_name: "ModelMergeFlux1",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    img_in_: {
      name: "img_in."
    },
    time_in_: {
      name: "time_in."
    },
    guidance_in: {
      name: "guidance_in"
    },
    vector_in_: {
      name: "vector_in."
    },
    txt_in_: {
      name: "txt_in."
    },
    double_blocks_0_: {
      name: "double_blocks.0."
    },
    double_blocks_1_: {
      name: "double_blocks.1."
    },
    double_blocks_2_: {
      name: "double_blocks.2."
    },
    double_blocks_3_: {
      name: "double_blocks.3."
    },
    double_blocks_4_: {
      name: "double_blocks.4."
    },
    double_blocks_5_: {
      name: "double_blocks.5."
    },
    double_blocks_6_: {
      name: "double_blocks.6."
    },
    double_blocks_7_: {
      name: "double_blocks.7."
    },
    double_blocks_8_: {
      name: "double_blocks.8."
    },
    double_blocks_9_: {
      name: "double_blocks.9."
    },
    double_blocks_10_: {
      name: "double_blocks.10."
    },
    double_blocks_11_: {
      name: "double_blocks.11."
    },
    double_blocks_12_: {
      name: "double_blocks.12."
    },
    double_blocks_13_: {
      name: "double_blocks.13."
    },
    double_blocks_14_: {
      name: "double_blocks.14."
    },
    double_blocks_15_: {
      name: "double_blocks.15."
    },
    double_blocks_16_: {
      name: "double_blocks.16."
    },
    double_blocks_17_: {
      name: "double_blocks.17."
    },
    double_blocks_18_: {
      name: "double_blocks.18."
    },
    single_blocks_0_: {
      name: "single_blocks.0."
    },
    single_blocks_1_: {
      name: "single_blocks.1."
    },
    single_blocks_2_: {
      name: "single_blocks.2."
    },
    single_blocks_3_: {
      name: "single_blocks.3."
    },
    single_blocks_4_: {
      name: "single_blocks.4."
    },
    single_blocks_5_: {
      name: "single_blocks.5."
    },
    single_blocks_6_: {
      name: "single_blocks.6."
    },
    single_blocks_7_: {
      name: "single_blocks.7."
    },
    single_blocks_8_: {
      name: "single_blocks.8."
    },
    single_blocks_9_: {
      name: "single_blocks.9."
    },
    single_blocks_10_: {
      name: "single_blocks.10."
    },
    single_blocks_11_: {
      name: "single_blocks.11."
    },
    single_blocks_12_: {
      name: "single_blocks.12."
    },
    single_blocks_13_: {
      name: "single_blocks.13."
    },
    single_blocks_14_: {
      name: "single_blocks.14."
    },
    single_blocks_15_: {
      name: "single_blocks.15."
    },
    single_blocks_16_: {
      name: "single_blocks.16."
    },
    single_blocks_17_: {
      name: "single_blocks.17."
    },
    single_blocks_18_: {
      name: "single_blocks.18."
    },
    single_blocks_19_: {
      name: "single_blocks.19."
    },
    single_blocks_20_: {
      name: "single_blocks.20."
    },
    single_blocks_21_: {
      name: "single_blocks.21."
    },
    single_blocks_22_: {
      name: "single_blocks.22."
    },
    single_blocks_23_: {
      name: "single_blocks.23."
    },
    single_blocks_24_: {
      name: "single_blocks.24."
    },
    single_blocks_25_: {
      name: "single_blocks.25."
    },
    single_blocks_26_: {
      name: "single_blocks.26."
    },
    single_blocks_27_: {
      name: "single_blocks.27."
    },
    single_blocks_28_: {
      name: "single_blocks.28."
    },
    single_blocks_29_: {
      name: "single_blocks.29."
    },
    single_blocks_30_: {
      name: "single_blocks.30."
    },
    single_blocks_31_: {
      name: "single_blocks.31."
    },
    single_blocks_32_: {
      name: "single_blocks.32."
    },
    single_blocks_33_: {
      name: "single_blocks.33."
    },
    single_blocks_34_: {
      name: "single_blocks.34."
    },
    single_blocks_35_: {
      name: "single_blocks.35."
    },
    single_blocks_36_: {
      name: "single_blocks.36."
    },
    single_blocks_37_: {
      name: "single_blocks.37."
    },
    final_layer_: {
      name: "final_layer."
    }
  }
};
const ModelMergeLTXV$5 = {
  display_name: "ModelMergeLTXV",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    patchify_proj_: {
      name: "patchify_proj."
    },
    adaln_single_: {
      name: "adaln_single."
    },
    caption_projection_: {
      name: "caption_projection."
    },
    transformer_blocks_0_: {
      name: "transformer_blocks.0."
    },
    transformer_blocks_1_: {
      name: "transformer_blocks.1."
    },
    transformer_blocks_2_: {
      name: "transformer_blocks.2."
    },
    transformer_blocks_3_: {
      name: "transformer_blocks.3."
    },
    transformer_blocks_4_: {
      name: "transformer_blocks.4."
    },
    transformer_blocks_5_: {
      name: "transformer_blocks.5."
    },
    transformer_blocks_6_: {
      name: "transformer_blocks.6."
    },
    transformer_blocks_7_: {
      name: "transformer_blocks.7."
    },
    transformer_blocks_8_: {
      name: "transformer_blocks.8."
    },
    transformer_blocks_9_: {
      name: "transformer_blocks.9."
    },
    transformer_blocks_10_: {
      name: "transformer_blocks.10."
    },
    transformer_blocks_11_: {
      name: "transformer_blocks.11."
    },
    transformer_blocks_12_: {
      name: "transformer_blocks.12."
    },
    transformer_blocks_13_: {
      name: "transformer_blocks.13."
    },
    transformer_blocks_14_: {
      name: "transformer_blocks.14."
    },
    transformer_blocks_15_: {
      name: "transformer_blocks.15."
    },
    transformer_blocks_16_: {
      name: "transformer_blocks.16."
    },
    transformer_blocks_17_: {
      name: "transformer_blocks.17."
    },
    transformer_blocks_18_: {
      name: "transformer_blocks.18."
    },
    transformer_blocks_19_: {
      name: "transformer_blocks.19."
    },
    transformer_blocks_20_: {
      name: "transformer_blocks.20."
    },
    transformer_blocks_21_: {
      name: "transformer_blocks.21."
    },
    transformer_blocks_22_: {
      name: "transformer_blocks.22."
    },
    transformer_blocks_23_: {
      name: "transformer_blocks.23."
    },
    transformer_blocks_24_: {
      name: "transformer_blocks.24."
    },
    transformer_blocks_25_: {
      name: "transformer_blocks.25."
    },
    transformer_blocks_26_: {
      name: "transformer_blocks.26."
    },
    transformer_blocks_27_: {
      name: "transformer_blocks.27."
    },
    scale_shift_table: {
      name: "scale_shift_table"
    },
    proj_out_: {
      name: "proj_out."
    }
  }
};
const ModelMergeMochiPreview$5 = {
  display_name: "ModelMergeMochiPreview",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    pos_frequencies_: {
      name: "pos_frequencies."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    t5_y_embedder_: {
      name: "t5_y_embedder."
    },
    t5_yproj_: {
      name: "t5_yproj."
    },
    blocks_0_: {
      name: "blocks.0."
    },
    blocks_1_: {
      name: "blocks.1."
    },
    blocks_2_: {
      name: "blocks.2."
    },
    blocks_3_: {
      name: "blocks.3."
    },
    blocks_4_: {
      name: "blocks.4."
    },
    blocks_5_: {
      name: "blocks.5."
    },
    blocks_6_: {
      name: "blocks.6."
    },
    blocks_7_: {
      name: "blocks.7."
    },
    blocks_8_: {
      name: "blocks.8."
    },
    blocks_9_: {
      name: "blocks.9."
    },
    blocks_10_: {
      name: "blocks.10."
    },
    blocks_11_: {
      name: "blocks.11."
    },
    blocks_12_: {
      name: "blocks.12."
    },
    blocks_13_: {
      name: "blocks.13."
    },
    blocks_14_: {
      name: "blocks.14."
    },
    blocks_15_: {
      name: "blocks.15."
    },
    blocks_16_: {
      name: "blocks.16."
    },
    blocks_17_: {
      name: "blocks.17."
    },
    blocks_18_: {
      name: "blocks.18."
    },
    blocks_19_: {
      name: "blocks.19."
    },
    blocks_20_: {
      name: "blocks.20."
    },
    blocks_21_: {
      name: "blocks.21."
    },
    blocks_22_: {
      name: "blocks.22."
    },
    blocks_23_: {
      name: "blocks.23."
    },
    blocks_24_: {
      name: "blocks.24."
    },
    blocks_25_: {
      name: "blocks.25."
    },
    blocks_26_: {
      name: "blocks.26."
    },
    blocks_27_: {
      name: "blocks.27."
    },
    blocks_28_: {
      name: "blocks.28."
    },
    blocks_29_: {
      name: "blocks.29."
    },
    blocks_30_: {
      name: "blocks.30."
    },
    blocks_31_: {
      name: "blocks.31."
    },
    blocks_32_: {
      name: "blocks.32."
    },
    blocks_33_: {
      name: "blocks.33."
    },
    blocks_34_: {
      name: "blocks.34."
    },
    blocks_35_: {
      name: "blocks.35."
    },
    blocks_36_: {
      name: "blocks.36."
    },
    blocks_37_: {
      name: "blocks.37."
    },
    blocks_38_: {
      name: "blocks.38."
    },
    blocks_39_: {
      name: "blocks.39."
    },
    blocks_40_: {
      name: "blocks.40."
    },
    blocks_41_: {
      name: "blocks.41."
    },
    blocks_42_: {
      name: "blocks.42."
    },
    blocks_43_: {
      name: "blocks.43."
    },
    blocks_44_: {
      name: "blocks.44."
    },
    blocks_45_: {
      name: "blocks.45."
    },
    blocks_46_: {
      name: "blocks.46."
    },
    blocks_47_: {
      name: "blocks.47."
    },
    final_layer_: {
      name: "final_layer."
    }
  }
};
const ModelMergeSD1$5 = {
  display_name: "ModelMergeSD1",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    time_embed_: {
      name: "time_embed."
    },
    label_emb_: {
      name: "label_emb."
    },
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    middle_block_0_: {
      name: "middle_block.0."
    },
    middle_block_1_: {
      name: "middle_block.1."
    },
    middle_block_2_: {
      name: "middle_block.2."
    },
    output_blocks_0_: {
      name: "output_blocks.0."
    },
    output_blocks_1_: {
      name: "output_blocks.1."
    },
    output_blocks_2_: {
      name: "output_blocks.2."
    },
    output_blocks_3_: {
      name: "output_blocks.3."
    },
    output_blocks_4_: {
      name: "output_blocks.4."
    },
    output_blocks_5_: {
      name: "output_blocks.5."
    },
    output_blocks_6_: {
      name: "output_blocks.6."
    },
    output_blocks_7_: {
      name: "output_blocks.7."
    },
    output_blocks_8_: {
      name: "output_blocks.8."
    },
    output_blocks_9_: {
      name: "output_blocks.9."
    },
    output_blocks_10_: {
      name: "output_blocks.10."
    },
    output_blocks_11_: {
      name: "output_blocks.11."
    },
    out_: {
      name: "out."
    }
  }
};
const ModelMergeSD2$5 = {
  display_name: "ModelMergeSD2",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    time_embed_: {
      name: "time_embed."
    },
    label_emb_: {
      name: "label_emb."
    },
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    middle_block_0_: {
      name: "middle_block.0."
    },
    middle_block_1_: {
      name: "middle_block.1."
    },
    middle_block_2_: {
      name: "middle_block.2."
    },
    output_blocks_0_: {
      name: "output_blocks.0."
    },
    output_blocks_1_: {
      name: "output_blocks.1."
    },
    output_blocks_2_: {
      name: "output_blocks.2."
    },
    output_blocks_3_: {
      name: "output_blocks.3."
    },
    output_blocks_4_: {
      name: "output_blocks.4."
    },
    output_blocks_5_: {
      name: "output_blocks.5."
    },
    output_blocks_6_: {
      name: "output_blocks.6."
    },
    output_blocks_7_: {
      name: "output_blocks.7."
    },
    output_blocks_8_: {
      name: "output_blocks.8."
    },
    output_blocks_9_: {
      name: "output_blocks.9."
    },
    output_blocks_10_: {
      name: "output_blocks.10."
    },
    output_blocks_11_: {
      name: "output_blocks.11."
    },
    out_: {
      name: "out."
    }
  }
};
const ModelMergeSD3_2B$5 = {
  display_name: "ModelMergeSD3_2B",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    context_embedder_: {
      name: "context_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    final_layer_: {
      name: "final_layer."
    }
  }
};
const ModelMergeSD35_Large$5 = {
  display_name: "ModelMergeSD35_Large",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    context_embedder_: {
      name: "context_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_24_: {
      name: "joint_blocks.24."
    },
    joint_blocks_25_: {
      name: "joint_blocks.25."
    },
    joint_blocks_26_: {
      name: "joint_blocks.26."
    },
    joint_blocks_27_: {
      name: "joint_blocks.27."
    },
    joint_blocks_28_: {
      name: "joint_blocks.28."
    },
    joint_blocks_29_: {
      name: "joint_blocks.29."
    },
    joint_blocks_30_: {
      name: "joint_blocks.30."
    },
    joint_blocks_31_: {
      name: "joint_blocks.31."
    },
    joint_blocks_32_: {
      name: "joint_blocks.32."
    },
    joint_blocks_33_: {
      name: "joint_blocks.33."
    },
    joint_blocks_34_: {
      name: "joint_blocks.34."
    },
    joint_blocks_35_: {
      name: "joint_blocks.35."
    },
    joint_blocks_36_: {
      name: "joint_blocks.36."
    },
    joint_blocks_37_: {
      name: "joint_blocks.37."
    },
    final_layer_: {
      name: "final_layer."
    }
  }
};
const ModelMergeSDXL$5 = {
  display_name: "ModelMergeSDXL",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    time_embed_: {
      name: "time_embed."
    },
    label_emb_: {
      name: "label_emb."
    },
    input_blocks_0: {
      name: "input_blocks.0"
    },
    input_blocks_1: {
      name: "input_blocks.1"
    },
    input_blocks_2: {
      name: "input_blocks.2"
    },
    input_blocks_3: {
      name: "input_blocks.3"
    },
    input_blocks_4: {
      name: "input_blocks.4"
    },
    input_blocks_5: {
      name: "input_blocks.5"
    },
    input_blocks_6: {
      name: "input_blocks.6"
    },
    input_blocks_7: {
      name: "input_blocks.7"
    },
    input_blocks_8: {
      name: "input_blocks.8"
    },
    middle_block_0: {
      name: "middle_block.0"
    },
    middle_block_1: {
      name: "middle_block.1"
    },
    middle_block_2: {
      name: "middle_block.2"
    },
    output_blocks_0: {
      name: "output_blocks.0"
    },
    output_blocks_1: {
      name: "output_blocks.1"
    },
    output_blocks_2: {
      name: "output_blocks.2"
    },
    output_blocks_3: {
      name: "output_blocks.3"
    },
    output_blocks_4: {
      name: "output_blocks.4"
    },
    output_blocks_5: {
      name: "output_blocks.5"
    },
    output_blocks_6: {
      name: "output_blocks.6"
    },
    output_blocks_7: {
      name: "output_blocks.7"
    },
    output_blocks_8: {
      name: "output_blocks.8"
    },
    out_: {
      name: "out."
    }
  }
};
const ModelMergeSimple$5 = {
  display_name: "ModelMergeSimple",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    ratio: {
      name: "ratio"
    }
  }
};
const ModelMergeSubtract$5 = {
  display_name: "ModelMergeSubtract",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    multiplier: {
      name: "multiplier"
    }
  }
};
const ModelSamplingAuraFlow$5 = {
  display_name: "ModelSamplingAuraFlow",
  inputs: {
    model: {
      name: "model"
    },
    shift: {
      name: "shift"
    }
  }
};
const ModelSamplingContinuousEDM$5 = {
  display_name: "ModelSamplingContinuousEDM",
  inputs: {
    model: {
      name: "model"
    },
    sampling: {
      name: "sampling"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const ModelSamplingContinuousV$5 = {
  display_name: "ModelSamplingContinuousV",
  inputs: {
    model: {
      name: "model"
    },
    sampling: {
      name: "sampling"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const ModelSamplingDiscrete$5 = {
  display_name: "ModelSamplingDiscrete",
  inputs: {
    model: {
      name: "model"
    },
    sampling: {
      name: "sampling"
    },
    zsnr: {
      name: "zsnr"
    }
  }
};
const ModelSamplingFlux$5 = {
  display_name: "ModelSamplingFlux",
  inputs: {
    model: {
      name: "model"
    },
    max_shift: {
      name: "max_shift"
    },
    base_shift: {
      name: "base_shift"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    }
  }
};
const ModelSamplingLTXV$5 = {
  display_name: "ModelSamplingLTXV",
  inputs: {
    model: {
      name: "model"
    },
    max_shift: {
      name: "max_shift"
    },
    base_shift: {
      name: "base_shift"
    },
    latent: {
      name: "latent"
    }
  }
};
const ModelSamplingSD3$5 = {
  display_name: "ModelSamplingSD3",
  inputs: {
    model: {
      name: "model"
    },
    shift: {
      name: "shift"
    }
  }
};
const ModelSamplingStableCascade$5 = {
  display_name: "ModelSamplingStableCascade",
  inputs: {
    model: {
      name: "model"
    },
    shift: {
      name: "shift"
    }
  }
};
const ModelSave$5 = {
  display_name: "ModelSave",
  inputs: {
    model: {
      name: "model"
    },
    filename_prefix: {
      name: "filename_prefix"
    }
  }
};
const Morphology$5 = {
  display_name: "ImageMorphology",
  inputs: {
    image: {
      name: "image"
    },
    operation: {
      name: "operation"
    },
    kernel_size: {
      name: "kernel_size"
    }
  }
};
const PairConditioningCombine$5 = {
  display_name: "Cond Pair Combine",
  inputs: {
    positive_A: {
      name: "positive_A"
    },
    negative_A: {
      name: "negative_A"
    },
    positive_B: {
      name: "positive_B"
    },
    negative_B: {
      name: "negative_B"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const PairConditioningSetDefaultCombine$5 = {
  display_name: "Cond Pair Set Default Combine",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    positive_DEFAULT: {
      name: "positive_DEFAULT"
    },
    negative_DEFAULT: {
      name: "negative_DEFAULT"
    },
    hooks: {
      name: "hooks"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const PairConditioningSetProperties$5 = {
  display_name: "Cond Pair Set Props",
  inputs: {
    positive_NEW: {
      name: "positive_NEW"
    },
    negative_NEW: {
      name: "negative_NEW"
    },
    strength: {
      name: "strength"
    },
    set_cond_area: {
      name: "set_cond_area"
    },
    mask: {
      name: "mask"
    },
    hooks: {
      name: "hooks"
    },
    timesteps: {
      name: "timesteps"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const PairConditioningSetPropertiesAndCombine$5 = {
  display_name: "Cond Pair Set Props Combine",
  inputs: {
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    positive_NEW: {
      name: "positive_NEW"
    },
    negative_NEW: {
      name: "negative_NEW"
    },
    strength: {
      name: "strength"
    },
    set_cond_area: {
      name: "set_cond_area"
    },
    mask: {
      name: "mask"
    },
    hooks: {
      name: "hooks"
    },
    timesteps: {
      name: "timesteps"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const PatchModelAddDownscale$5 = {
  display_name: "PatchModelAddDownscale (Kohya Deep Shrink)",
  inputs: {
    model: {
      name: "model"
    },
    block_number: {
      name: "block_number"
    },
    downscale_factor: {
      name: "downscale_factor"
    },
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    },
    downscale_after_skip: {
      name: "downscale_after_skip"
    },
    downscale_method: {
      name: "downscale_method"
    },
    upscale_method: {
      name: "upscale_method"
    }
  }
};
const PerpNeg$5 = {
  display_name: "Perp-Neg (DEPRECATED by PerpNegGuider)",
  inputs: {
    model: {
      name: "model"
    },
    empty_conditioning: {
      name: "empty_conditioning"
    },
    neg_scale: {
      name: "neg_scale"
    }
  }
};
const PerpNegGuider$5 = {
  display_name: "PerpNegGuider",
  inputs: {
    model: {
      name: "model"
    },
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    empty_conditioning: {
      name: "empty_conditioning"
    },
    cfg: {
      name: "cfg"
    },
    neg_scale: {
      name: "neg_scale"
    }
  }
};
const PerturbedAttentionGuidance$5 = {
  display_name: "PerturbedAttentionGuidance",
  inputs: {
    model: {
      name: "model"
    },
    scale: {
      name: "scale"
    }
  }
};
const PhotoMakerEncode$5 = {
  display_name: "PhotoMakerEncode",
  inputs: {
    photomaker: {
      name: "photomaker"
    },
    image: {
      name: "image"
    },
    clip: {
      name: "clip"
    },
    text: {
      name: "text"
    }
  }
};
const PhotoMakerLoader$5 = {
  display_name: "PhotoMakerLoader",
  inputs: {
    photomaker_model_name: {
      name: "photomaker_model_name"
    }
  }
};
const PolyexponentialScheduler$5 = {
  display_name: "PolyexponentialScheduler",
  inputs: {
    steps: {
      name: "steps"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    rho: {
      name: "rho"
    }
  }
};
const PorterDuffImageComposite$5 = {
  display_name: "Porter-Duff Image Composite",
  inputs: {
    source: {
      name: "source"
    },
    source_alpha: {
      name: "source_alpha"
    },
    destination: {
      name: "destination"
    },
    destination_alpha: {
      name: "destination_alpha"
    },
    mode: {
      name: "mode"
    }
  }
};
const Preview3D$5 = {
  display_name: "Preview 3D",
  inputs: {
    model_file: {
      name: "model_file"
    },
    show_grid: {
      name: "show_grid"
    },
    camera_type: {
      name: "camera_type"
    },
    view: {
      name: "view"
    },
    material: {
      name: "material"
    },
    bg_color: {
      name: "bg_color"
    },
    light_intensity: {
      name: "light_intensity"
    },
    up_direction: {
      name: "up_direction"
    }
  }
};
const PreviewAudio$5 = {
  display_name: "PreviewAudio",
  inputs: {
    audio: {
      name: "audio"
    }
  }
};
const PreviewImage$5 = {
  display_name: "Preview Image",
  description: "Saves the input images to your ComfyUI output directory.",
  inputs: {
    images: {
      name: "images"
    }
  }
};
const RandomNoise$5 = {
  display_name: "RandomNoise",
  inputs: {
    noise_seed: {
      name: "noise_seed"
    }
  }
};
const RebatchImages$5 = {
  display_name: "Rebatch Images",
  inputs: {
    images: {
      name: "images"
    },
    batch_size: {
      name: "batch_size"
    }
  }
};
const RebatchLatents$5 = {
  display_name: "Rebatch Latents",
  inputs: {
    latents: {
      name: "latents"
    },
    batch_size: {
      name: "batch_size"
    }
  }
};
const RepeatImageBatch$5 = {
  display_name: "RepeatImageBatch",
  inputs: {
    image: {
      name: "image"
    },
    amount: {
      name: "amount"
    }
  }
};
const RepeatLatentBatch$5 = {
  display_name: "Repeat Latent Batch",
  inputs: {
    samples: {
      name: "samples"
    },
    amount: {
      name: "amount"
    }
  }
};
const RescaleCFG$5 = {
  display_name: "RescaleCFG",
  inputs: {
    model: {
      name: "model"
    },
    multiplier: {
      name: "multiplier"
    }
  }
};
const SamplerCustom$5 = {
  display_name: "SamplerCustom",
  inputs: {
    model: {
      name: "model"
    },
    add_noise: {
      name: "add_noise"
    },
    noise_seed: {
      name: "noise_seed"
    },
    cfg: {
      name: "cfg"
    },
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    sampler: {
      name: "sampler"
    },
    sigmas: {
      name: "sigmas"
    },
    latent_image: {
      name: "latent_image"
    }
  },
  outputs: {
    "0": {
      name: "output"
    },
    "1": {
      name: "denoised_output"
    }
  }
};
const SamplerCustomAdvanced$5 = {
  display_name: "SamplerCustomAdvanced",
  inputs: {
    noise: {
      name: "noise"
    },
    guider: {
      name: "guider"
    },
    sampler: {
      name: "sampler"
    },
    sigmas: {
      name: "sigmas"
    },
    latent_image: {
      name: "latent_image"
    }
  },
  outputs: {
    "0": {
      name: "output"
    },
    "1": {
      name: "denoised_output"
    }
  }
};
const SamplerDPMAdaptative$5 = {
  display_name: "SamplerDPMAdaptative",
  inputs: {
    order: {
      name: "order"
    },
    rtol: {
      name: "rtol"
    },
    atol: {
      name: "atol"
    },
    h_init: {
      name: "h_init"
    },
    pcoeff: {
      name: "pcoeff"
    },
    icoeff: {
      name: "icoeff"
    },
    dcoeff: {
      name: "dcoeff"
    },
    accept_safety: {
      name: "accept_safety"
    },
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_2M_SDE$5 = {
  display_name: "SamplerDPMPP_2M_SDE",
  inputs: {
    solver_type: {
      name: "solver_type"
    },
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    },
    noise_device: {
      name: "noise_device"
    }
  }
};
const SamplerDPMPP_2S_Ancestral$5 = {
  display_name: "SamplerDPMPP_2S_Ancestral",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_3M_SDE$5 = {
  display_name: "SamplerDPMPP_3M_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    },
    noise_device: {
      name: "noise_device"
    }
  }
};
const SamplerDPMPP_SDE$5 = {
  display_name: "SamplerDPMPP_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    },
    r: {
      name: "r"
    },
    noise_device: {
      name: "noise_device"
    }
  }
};
const SamplerEulerAncestral$5 = {
  display_name: "SamplerEulerAncestral",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerAncestralCFGPP$5 = {
  display_name: "SamplerEulerAncestralCFG++",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerCFGpp$5 = {
  display_name: "SamplerEulerCFG++",
  inputs: {
    version: {
      name: "version"
    }
  }
};
const SamplerLCMUpscale$5 = {
  display_name: "SamplerLCMUpscale",
  inputs: {
    scale_ratio: {
      name: "scale_ratio"
    },
    scale_steps: {
      name: "scale_steps"
    },
    upscale_method: {
      name: "upscale_method"
    }
  }
};
const SamplerLMS$5 = {
  display_name: "SamplerLMS",
  inputs: {
    order: {
      name: "order"
    }
  }
};
const SaveAnimatedPNG$5 = {
  display_name: "SaveAnimatedPNG",
  inputs: {
    images: {
      name: "images"
    },
    filename_prefix: {
      name: "filename_prefix"
    },
    fps: {
      name: "fps"
    },
    compress_level: {
      name: "compress_level"
    }
  }
};
const SaveAnimatedWEBP$5 = {
  display_name: "SaveAnimatedWEBP",
  inputs: {
    images: {
      name: "images"
    },
    filename_prefix: {
      name: "filename_prefix"
    },
    fps: {
      name: "fps"
    },
    lossless: {
      name: "lossless"
    },
    quality: {
      name: "quality"
    },
    method: {
      name: "method"
    }
  }
};
const SaveAudio$5 = {
  display_name: "SaveAudio",
  inputs: {
    audio: {
      name: "audio"
    },
    filename_prefix: {
      name: "filename_prefix"
    }
  }
};
const SaveImage$5 = {
  display_name: "Save Image",
  description: "Saves the input images to your ComfyUI output directory.",
  inputs: {
    images: {
      name: "images",
      tooltip: "The images to save."
    },
    filename_prefix: {
      name: "filename_prefix",
      tooltip: "The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes."
    }
  }
};
const SaveImageWebsocket$5 = {
  display_name: "SaveImageWebsocket",
  inputs: {
    images: {
      name: "images"
    }
  }
};
const SaveLatent$5 = {
  display_name: "SaveLatent",
  inputs: {
    samples: {
      name: "samples"
    },
    filename_prefix: {
      name: "filename_prefix"
    }
  }
};
const SD_4XUpscale_Conditioning$5 = {
  display_name: "SD_4XUpscale_Conditioning",
  inputs: {
    images: {
      name: "images"
    },
    positive: {
      name: "positive"
    },
    negative: {
      name: "negative"
    },
    scale_ratio: {
      name: "scale_ratio"
    },
    noise_augmentation: {
      name: "noise_augmentation"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const SDTurboScheduler$5 = {
  display_name: "SDTurboScheduler",
  inputs: {
    model: {
      name: "model"
    },
    steps: {
      name: "steps"
    },
    denoise: {
      name: "denoise"
    }
  }
};
const SelfAttentionGuidance$5 = {
  display_name: "Self-Attention Guidance",
  inputs: {
    model: {
      name: "model"
    },
    scale: {
      name: "scale"
    },
    blur_sigma: {
      name: "blur_sigma"
    }
  }
};
const SetClipHooks$5 = {
  display_name: "Set CLIP Hooks",
  inputs: {
    clip: {
      name: "clip"
    },
    apply_to_conds: {
      name: "apply_to_conds"
    },
    schedule_clip: {
      name: "schedule_clip"
    },
    hooks: {
      name: "hooks"
    }
  }
};
const SetHookKeyframes$5 = {
  display_name: "Set Hook Keyframes",
  inputs: {
    hooks: {
      name: "hooks"
    },
    hook_kf: {
      name: "hook_kf"
    }
  }
};
const SetLatentNoiseMask$5 = {
  display_name: "Set Latent Noise Mask",
  inputs: {
    samples: {
      name: "samples"
    },
    mask: {
      name: "mask"
    }
  }
};
const SetUnionControlNetType$5 = {
  display_name: "SetUnionControlNetType",
  inputs: {
    control_net: {
      name: "control_net"
    },
    type: {
      name: "type"
    }
  }
};
const SkipLayerGuidanceDiT$5 = {
  display_name: "SkipLayerGuidanceDiT",
  description: "Generic version of SkipLayerGuidance node that can be used on every DiT model.",
  inputs: {
    model: {
      name: "model"
    },
    double_layers: {
      name: "double_layers"
    },
    single_layers: {
      name: "single_layers"
    },
    scale: {
      name: "scale"
    },
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    },
    rescaling_scale: {
      name: "rescaling_scale"
    }
  }
};
const SkipLayerGuidanceSD3$5 = {
  display_name: "SkipLayerGuidanceSD3",
  description: "Generic version of SkipLayerGuidance node that can be used on every DiT model.",
  inputs: {
    model: {
      name: "model"
    },
    layers: {
      name: "layers"
    },
    scale: {
      name: "scale"
    },
    start_percent: {
      name: "start_percent"
    },
    end_percent: {
      name: "end_percent"
    }
  }
};
const SolidMask$5 = {
  display_name: "SolidMask",
  inputs: {
    value: {
      name: "value"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    }
  }
};
const SplitImageWithAlpha$5 = {
  display_name: "Split Image with Alpha",
  inputs: {
    image: {
      name: "image"
    }
  }
};
const SplitSigmas$5 = {
  display_name: "SplitSigmas",
  inputs: {
    sigmas: {
      name: "sigmas"
    },
    step: {
      name: "step"
    }
  },
  outputs: {
    "0": {
      name: "high_sigmas"
    },
    "1": {
      name: "low_sigmas"
    }
  }
};
const SplitSigmasDenoise$5 = {
  display_name: "SplitSigmasDenoise",
  inputs: {
    sigmas: {
      name: "sigmas"
    },
    denoise: {
      name: "denoise"
    }
  },
  outputs: {
    "0": {
      name: "high_sigmas"
    },
    "1": {
      name: "low_sigmas"
    }
  }
};
const StableCascade_EmptyLatentImage$5 = {
  display_name: "StableCascade_EmptyLatentImage",
  inputs: {
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    compression: {
      name: "compression"
    },
    batch_size: {
      name: "batch_size"
    }
  },
  outputs: {
    "0": {
      name: "stage_c"
    },
    "1": {
      name: "stage_b"
    }
  }
};
const StableCascade_StageB_Conditioning$5 = {
  display_name: "StableCascade_StageB_Conditioning",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    stage_c: {
      name: "stage_c"
    }
  }
};
const StableCascade_StageC_VAEEncode$5 = {
  display_name: "StableCascade_StageC_VAEEncode",
  inputs: {
    image: {
      name: "image"
    },
    vae: {
      name: "vae"
    },
    compression: {
      name: "compression"
    }
  },
  outputs: {
    "0": {
      name: "stage_c"
    },
    "1": {
      name: "stage_b"
    }
  }
};
const StableCascade_SuperResolutionControlnet$5 = {
  display_name: "StableCascade_SuperResolutionControlnet",
  inputs: {
    image: {
      name: "image"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "controlnet_input"
    },
    "1": {
      name: "stage_c"
    },
    "2": {
      name: "stage_b"
    }
  }
};
const StableZero123_Conditioning$5 = {
  display_name: "StableZero123_Conditioning",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    init_image: {
      name: "init_image"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    batch_size: {
      name: "batch_size"
    },
    elevation: {
      name: "elevation"
    },
    azimuth: {
      name: "azimuth"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const StableZero123_Conditioning_Batched$5 = {
  display_name: "StableZero123_Conditioning_Batched",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    init_image: {
      name: "init_image"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    batch_size: {
      name: "batch_size"
    },
    elevation: {
      name: "elevation"
    },
    azimuth: {
      name: "azimuth"
    },
    elevation_batch_increment: {
      name: "elevation_batch_increment"
    },
    azimuth_batch_increment: {
      name: "azimuth_batch_increment"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const StyleModelApply$5 = {
  display_name: "Apply Style Model",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    style_model: {
      name: "style_model"
    },
    clip_vision_output: {
      name: "clip_vision_output"
    },
    strength: {
      name: "strength"
    },
    strength_type: {
      name: "strength_type"
    }
  }
};
const StyleModelLoader$5 = {
  display_name: "Load Style Model",
  inputs: {
    style_model_name: {
      name: "style_model_name"
    }
  }
};
const SV3D_Conditioning$5 = {
  display_name: "SV3D_Conditioning",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    init_image: {
      name: "init_image"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    video_frames: {
      name: "video_frames"
    },
    elevation: {
      name: "elevation"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const SVD_img2vid_Conditioning$5 = {
  display_name: "SVD_img2vid_Conditioning",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    init_image: {
      name: "init_image"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    video_frames: {
      name: "video_frames"
    },
    motion_bucket_id: {
      name: "motion_bucket_id"
    },
    fps: {
      name: "fps"
    },
    augmentation_level: {
      name: "augmentation_level"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const ThresholdMask$5 = {
  display_name: "ThresholdMask",
  inputs: {
    mask: {
      name: "mask"
    },
    value: {
      name: "value"
    }
  }
};
const TomePatchModel$5 = {
  display_name: "TomePatchModel",
  inputs: {
    model: {
      name: "model"
    },
    ratio: {
      name: "ratio"
    }
  }
};
const TorchCompileModel$5 = {
  display_name: "TorchCompileModel",
  inputs: {
    model: {
      name: "model"
    },
    backend: {
      name: "backend"
    }
  }
};
const TripleCLIPLoader$5 = {
  display_name: "TripleCLIPLoader",
  description: "[Recipes]\n\nsd3: clip-l, clip-g, t5",
  inputs: {
    clip_name1: {
      name: "clip_name1"
    },
    clip_name2: {
      name: "clip_name2"
    },
    clip_name3: {
      name: "clip_name3"
    }
  }
};
const unCLIPCheckpointLoader$5 = {
  display_name: "unCLIPCheckpointLoader",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    }
  }
};
const unCLIPConditioning$5 = {
  display_name: "unCLIPConditioning",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    clip_vision_output: {
      name: "clip_vision_output"
    },
    strength: {
      name: "strength"
    },
    noise_augmentation: {
      name: "noise_augmentation"
    }
  }
};
const UNetCrossAttentionMultiply$5 = {
  display_name: "UNetCrossAttentionMultiply",
  inputs: {
    model: {
      name: "model"
    },
    q: {
      name: "q"
    },
    k: {
      name: "k"
    },
    v: {
      name: "v"
    },
    out: {
      name: "out"
    }
  }
};
const UNETLoader$5 = {
  display_name: "Load Diffusion Model",
  inputs: {
    unet_name: {
      name: "unet_name"
    },
    weight_dtype: {
      name: "weight_dtype"
    }
  }
};
const UNetSelfAttentionMultiply$5 = {
  display_name: "UNetSelfAttentionMultiply",
  inputs: {
    model: {
      name: "model"
    },
    q: {
      name: "q"
    },
    k: {
      name: "k"
    },
    v: {
      name: "v"
    },
    out: {
      name: "out"
    }
  }
};
const UNetTemporalAttentionMultiply$5 = {
  display_name: "UNetTemporalAttentionMultiply",
  inputs: {
    model: {
      name: "model"
    },
    self_structural: {
      name: "self_structural"
    },
    self_temporal: {
      name: "self_temporal"
    },
    cross_structural: {
      name: "cross_structural"
    },
    cross_temporal: {
      name: "cross_temporal"
    }
  }
};
const UpscaleModelLoader$5 = {
  display_name: "Load Upscale Model",
  inputs: {
    model_name: {
      name: "model_name"
    }
  }
};
const VAEDecode$5 = {
  display_name: "VAE Decode",
  description: "Decodes latent images back into pixel space images.",
  inputs: {
    samples: {
      name: "samples",
      tooltip: "The latent to be decoded."
    },
    vae: {
      name: "vae",
      tooltip: "The VAE model used for decoding the latent."
    }
  },
  outputs: {
    "0": {
      tooltip: "The decoded image."
    }
  }
};
const VAEDecodeAudio$5 = {
  display_name: "VAEDecodeAudio",
  inputs: {
    samples: {
      name: "samples"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEDecodeTiled$5 = {
  display_name: "VAE Decode (Tiled)",
  inputs: {
    samples: {
      name: "samples"
    },
    vae: {
      name: "vae"
    },
    tile_size: {
      name: "tile_size"
    },
    overlap: {
      name: "overlap"
    },
    temporal_size: {
      name: "temporal_size",
      tooltip: "Only used for video VAEs: Amount of frames to decode at a time."
    },
    temporal_overlap: {
      name: "temporal_overlap",
      tooltip: "Only used for video VAEs: Amount of frames to overlap."
    }
  }
};
const VAEEncode$5 = {
  display_name: "VAE Encode",
  inputs: {
    pixels: {
      name: "pixels"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeAudio$5 = {
  display_name: "VAEEncodeAudio",
  inputs: {
    audio: {
      name: "audio"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeForInpaint$5 = {
  display_name: "VAE Encode (for Inpainting)",
  inputs: {
    pixels: {
      name: "pixels"
    },
    vae: {
      name: "vae"
    },
    mask: {
      name: "mask"
    },
    grow_mask_by: {
      name: "grow_mask_by"
    }
  }
};
const VAEEncodeTiled$5 = {
  display_name: "VAE Encode (Tiled)",
  inputs: {
    pixels: {
      name: "pixels"
    },
    vae: {
      name: "vae"
    },
    tile_size: {
      name: "tile_size"
    },
    overlap: {
      name: "overlap"
    },
    temporal_size: {
      name: "temporal_size",
      tooltip: "Only used for video VAEs: Amount of frames to encode at a time."
    },
    temporal_overlap: {
      name: "temporal_overlap",
      tooltip: "Only used for video VAEs: Amount of frames to overlap."
    }
  }
};
const VAELoader$5 = {
  display_name: "Load VAE",
  inputs: {
    vae_name: {
      name: "vae_name"
    }
  }
};
const VAESave$5 = {
  display_name: "VAESave",
  inputs: {
    vae: {
      name: "vae"
    },
    filename_prefix: {
      name: "filename_prefix"
    }
  }
};
const VideoLinearCFGGuidance$5 = {
  display_name: "VideoLinearCFGGuidance",
  inputs: {
    model: {
      name: "model"
    },
    min_cfg: {
      name: "min_cfg"
    }
  }
};
const VideoTriangleCFGGuidance$5 = {
  display_name: "VideoTriangleCFGGuidance",
  inputs: {
    model: {
      name: "model"
    },
    min_cfg: {
      name: "min_cfg"
    }
  }
};
const VPScheduler$5 = {
  display_name: "VPScheduler",
  inputs: {
    steps: {
      name: "steps"
    },
    beta_d: {
      name: "beta_d"
    },
    beta_min: {
      name: "beta_min"
    },
    eps_s: {
      name: "eps_s"
    }
  }
};
const WebcamCapture$5 = {
  display_name: "Webcam Capture",
  inputs: {
    image: {
      name: "image"
    },
    width: {
      name: "width"
    },
    height: {
      name: "height"
    },
    capture_on_queue: {
      name: "capture_on_queue"
    }
  }
};
const enNodes = {
  AddNoise: AddNoise$5,
  AlignYourStepsScheduler: AlignYourStepsScheduler$5,
  BasicGuider: BasicGuider$5,
  BasicScheduler: BasicScheduler$5,
  BetaSamplingScheduler: BetaSamplingScheduler$5,
  Canny: Canny$5,
  CFGGuider: CFGGuider$5,
  CheckpointLoader: CheckpointLoader$5,
  CheckpointLoaderSimple: CheckpointLoaderSimple$5,
  CheckpointSave: CheckpointSave$5,
  CLIPAttentionMultiply: CLIPAttentionMultiply$5,
  CLIPLoader: CLIPLoader$5,
  CLIPMergeAdd: CLIPMergeAdd$5,
  CLIPMergeSimple: CLIPMergeSimple$5,
  CLIPMergeSubtract: CLIPMergeSubtract$5,
  CLIPSave: CLIPSave$5,
  CLIPSetLastLayer: CLIPSetLastLayer$5,
  CLIPTextEncode: CLIPTextEncode$5,
  CLIPTextEncodeControlnet: CLIPTextEncodeControlnet$5,
  CLIPTextEncodeFlux: CLIPTextEncodeFlux$5,
  CLIPTextEncodeHunyuanDiT: CLIPTextEncodeHunyuanDiT$5,
  CLIPTextEncodePixArtAlpha: CLIPTextEncodePixArtAlpha$5,
  CLIPTextEncodeSD3: CLIPTextEncodeSD3$5,
  CLIPTextEncodeSDXL: CLIPTextEncodeSDXL$5,
  CLIPTextEncodeSDXLRefiner: CLIPTextEncodeSDXLRefiner$5,
  CLIPVisionEncode: CLIPVisionEncode$5,
  CLIPVisionLoader: CLIPVisionLoader$5,
  CombineHooks2: CombineHooks2$5,
  CombineHooks4: CombineHooks4$5,
  CombineHooks8: CombineHooks8$5,
  ConditioningAverage: ConditioningAverage$5,
  ConditioningCombine: ConditioningCombine$5,
  ConditioningConcat: ConditioningConcat$5,
  ConditioningSetArea: ConditioningSetArea$5,
  ConditioningSetAreaPercentage: ConditioningSetAreaPercentage$5,
  ConditioningSetAreaStrength: ConditioningSetAreaStrength$5,
  ConditioningSetDefaultCombine: ConditioningSetDefaultCombine$5,
  ConditioningSetMask: ConditioningSetMask$5,
  ConditioningSetProperties: ConditioningSetProperties$5,
  ConditioningSetPropertiesAndCombine: ConditioningSetPropertiesAndCombine$5,
  ConditioningSetTimestepRange: ConditioningSetTimestepRange$5,
  ConditioningStableAudio: ConditioningStableAudio$5,
  ConditioningTimestepsRange: ConditioningTimestepsRange$5,
  ConditioningZeroOut: ConditioningZeroOut$5,
  ControlNetApply: ControlNetApply$5,
  ControlNetApplyAdvanced: ControlNetApplyAdvanced$5,
  ControlNetApplySD3: ControlNetApplySD3$5,
  ControlNetInpaintingAliMamaApply: ControlNetInpaintingAliMamaApply$5,
  ControlNetLoader: ControlNetLoader$5,
  CreateHookKeyframe: CreateHookKeyframe$5,
  CreateHookKeyframesFromFloats: CreateHookKeyframesFromFloats$5,
  CreateHookKeyframesInterpolated: CreateHookKeyframesInterpolated$5,
  CreateHookLora: CreateHookLora$5,
  CreateHookLoraModelOnly: CreateHookLoraModelOnly$5,
  CreateHookModelAsLora: CreateHookModelAsLora$5,
  CreateHookModelAsLoraModelOnly: CreateHookModelAsLoraModelOnly$5,
  CropMask: CropMask$5,
  DevToolsDeprecatedNode: DevToolsDeprecatedNode$5,
  DevToolsErrorRaiseNode: DevToolsErrorRaiseNode$5,
  DevToolsErrorRaiseNodeWithMessage: DevToolsErrorRaiseNodeWithMessage$5,
  DevToolsExperimentalNode: DevToolsExperimentalNode$5,
  DevToolsLongComboDropdown: DevToolsLongComboDropdown$5,
  DevToolsNodeWithForceInput: DevToolsNodeWithForceInput$5,
  DevToolsNodeWithOnlyOptionalInput: DevToolsNodeWithOnlyOptionalInput$5,
  DevToolsNodeWithOptionalInput: DevToolsNodeWithOptionalInput$5,
  DevToolsNodeWithOutputList: DevToolsNodeWithOutputList$5,
  DevToolsNodeWithStringInput: DevToolsNodeWithStringInput$5,
  DevToolsNodeWithUnionInput: DevToolsNodeWithUnionInput$5,
  DevToolsSimpleSlider: DevToolsSimpleSlider$5,
  DiffControlNetLoader: DiffControlNetLoader$5,
  DifferentialDiffusion: DifferentialDiffusion$5,
  DiffusersLoader: DiffusersLoader$5,
  DisableNoise: DisableNoise$5,
  DualCFGGuider: DualCFGGuider$5,
  DualCLIPLoader: DualCLIPLoader$5,
  EmptyHunyuanLatentVideo: EmptyHunyuanLatentVideo$5,
  EmptyImage: EmptyImage$5,
  EmptyLatentAudio: EmptyLatentAudio$5,
  EmptyLatentImage: EmptyLatentImage$5,
  EmptyLTXVLatentVideo: EmptyLTXVLatentVideo$5,
  EmptyMochiLatentVideo: EmptyMochiLatentVideo$5,
  EmptySD3LatentImage: EmptySD3LatentImage$5,
  ExponentialScheduler: ExponentialScheduler$5,
  FeatherMask: FeatherMask$5,
  FlipSigmas: FlipSigmas$5,
  FluxGuidance: FluxGuidance$5,
  FreeU: FreeU$5,
  FreeU_V2: FreeU_V2$5,
  GITSScheduler: GITSScheduler$5,
  GLIGENLoader: GLIGENLoader$5,
  GLIGENTextBoxApply: GLIGENTextBoxApply$5,
  GrowMask: GrowMask$5,
  HypernetworkLoader: HypernetworkLoader$5,
  HyperTile: HyperTile$5,
  ImageBatch: ImageBatch$5,
  ImageBlend: ImageBlend$5,
  ImageBlur: ImageBlur$5,
  ImageColorToMask: ImageColorToMask$5,
  ImageCompositeMasked: ImageCompositeMasked$5,
  ImageCrop: ImageCrop$5,
  ImageFromBatch: ImageFromBatch$5,
  ImageInvert: ImageInvert$5,
  ImageOnlyCheckpointLoader: ImageOnlyCheckpointLoader$5,
  ImageOnlyCheckpointSave: ImageOnlyCheckpointSave$5,
  ImagePadForOutpaint: ImagePadForOutpaint$5,
  ImageQuantize: ImageQuantize$5,
  ImageScale: ImageScale$5,
  ImageScaleBy: ImageScaleBy$5,
  ImageScaleToTotalPixels: ImageScaleToTotalPixels$5,
  ImageSharpen: ImageSharpen$5,
  ImageToMask: ImageToMask$5,
  ImageUpscaleWithModel: ImageUpscaleWithModel$5,
  InpaintModelConditioning: InpaintModelConditioning$5,
  InstructPixToPixConditioning: InstructPixToPixConditioning$5,
  InvertMask: InvertMask$5,
  JoinImageWithAlpha: JoinImageWithAlpha$5,
  KarrasScheduler: KarrasScheduler$5,
  KSampler: KSampler$5,
  KSamplerAdvanced: KSamplerAdvanced$5,
  KSamplerSelect: KSamplerSelect$5,
  LaplaceScheduler: LaplaceScheduler$5,
  LatentAdd: LatentAdd$5,
  LatentApplyOperation: LatentApplyOperation$5,
  LatentApplyOperationCFG: LatentApplyOperationCFG$5,
  LatentBatch: LatentBatch$5,
  LatentBatchSeedBehavior: LatentBatchSeedBehavior$5,
  LatentBlend: LatentBlend$5,
  LatentComposite: LatentComposite$5,
  LatentCompositeMasked: LatentCompositeMasked$5,
  LatentCrop: LatentCrop$5,
  LatentFlip: LatentFlip$5,
  LatentFromBatch: LatentFromBatch$5,
  LatentInterpolate: LatentInterpolate$5,
  LatentMultiply: LatentMultiply$5,
  LatentOperationSharpen: LatentOperationSharpen$5,
  LatentOperationTonemapReinhard: LatentOperationTonemapReinhard$5,
  LatentRotate: LatentRotate$5,
  LatentSubtract: LatentSubtract$5,
  LatentUpscale: LatentUpscale$5,
  LatentUpscaleBy: LatentUpscaleBy$5,
  Load3D: Load3D$5,
  Load3DAnimation: Load3DAnimation$5,
  LoadAudio: LoadAudio$5,
  LoadImage: LoadImage$5,
  LoadImageMask: LoadImageMask$5,
  LoadLatent: LoadLatent$5,
  LoraLoader: LoraLoader$5,
  LoraLoaderModelOnly: LoraLoaderModelOnly$5,
  LoraSave: LoraSave$5,
  LTXVConditioning: LTXVConditioning$5,
  LTXVImgToVideo: LTXVImgToVideo$5,
  LTXVScheduler: LTXVScheduler$5,
  Mahiro: Mahiro$5,
  MaskComposite: MaskComposite$5,
  MaskToImage: MaskToImage$5,
  ModelMergeAdd: ModelMergeAdd$5,
  ModelMergeAuraflow: ModelMergeAuraflow$5,
  ModelMergeBlocks: ModelMergeBlocks$5,
  ModelMergeFlux1: ModelMergeFlux1$5,
  ModelMergeLTXV: ModelMergeLTXV$5,
  ModelMergeMochiPreview: ModelMergeMochiPreview$5,
  ModelMergeSD1: ModelMergeSD1$5,
  ModelMergeSD2: ModelMergeSD2$5,
  ModelMergeSD3_2B: ModelMergeSD3_2B$5,
  ModelMergeSD35_Large: ModelMergeSD35_Large$5,
  ModelMergeSDXL: ModelMergeSDXL$5,
  ModelMergeSimple: ModelMergeSimple$5,
  ModelMergeSubtract: ModelMergeSubtract$5,
  ModelSamplingAuraFlow: ModelSamplingAuraFlow$5,
  ModelSamplingContinuousEDM: ModelSamplingContinuousEDM$5,
  ModelSamplingContinuousV: ModelSamplingContinuousV$5,
  ModelSamplingDiscrete: ModelSamplingDiscrete$5,
  ModelSamplingFlux: ModelSamplingFlux$5,
  ModelSamplingLTXV: ModelSamplingLTXV$5,
  ModelSamplingSD3: ModelSamplingSD3$5,
  ModelSamplingStableCascade: ModelSamplingStableCascade$5,
  ModelSave: ModelSave$5,
  Morphology: Morphology$5,
  PairConditioningCombine: PairConditioningCombine$5,
  PairConditioningSetDefaultCombine: PairConditioningSetDefaultCombine$5,
  PairConditioningSetProperties: PairConditioningSetProperties$5,
  PairConditioningSetPropertiesAndCombine: PairConditioningSetPropertiesAndCombine$5,
  PatchModelAddDownscale: PatchModelAddDownscale$5,
  PerpNeg: PerpNeg$5,
  PerpNegGuider: PerpNegGuider$5,
  PerturbedAttentionGuidance: PerturbedAttentionGuidance$5,
  PhotoMakerEncode: PhotoMakerEncode$5,
  PhotoMakerLoader: PhotoMakerLoader$5,
  PolyexponentialScheduler: PolyexponentialScheduler$5,
  PorterDuffImageComposite: PorterDuffImageComposite$5,
  Preview3D: Preview3D$5,
  PreviewAudio: PreviewAudio$5,
  PreviewImage: PreviewImage$5,
  RandomNoise: RandomNoise$5,
  RebatchImages: RebatchImages$5,
  RebatchLatents: RebatchLatents$5,
  RepeatImageBatch: RepeatImageBatch$5,
  RepeatLatentBatch: RepeatLatentBatch$5,
  RescaleCFG: RescaleCFG$5,
  SamplerCustom: SamplerCustom$5,
  SamplerCustomAdvanced: SamplerCustomAdvanced$5,
  SamplerDPMAdaptative: SamplerDPMAdaptative$5,
  SamplerDPMPP_2M_SDE: SamplerDPMPP_2M_SDE$5,
  SamplerDPMPP_2S_Ancestral: SamplerDPMPP_2S_Ancestral$5,
  SamplerDPMPP_3M_SDE: SamplerDPMPP_3M_SDE$5,
  SamplerDPMPP_SDE: SamplerDPMPP_SDE$5,
  SamplerEulerAncestral: SamplerEulerAncestral$5,
  SamplerEulerAncestralCFGPP: SamplerEulerAncestralCFGPP$5,
  SamplerEulerCFGpp: SamplerEulerCFGpp$5,
  SamplerLCMUpscale: SamplerLCMUpscale$5,
  SamplerLMS: SamplerLMS$5,
  SaveAnimatedPNG: SaveAnimatedPNG$5,
  SaveAnimatedWEBP: SaveAnimatedWEBP$5,
  SaveAudio: SaveAudio$5,
  SaveImage: SaveImage$5,
  SaveImageWebsocket: SaveImageWebsocket$5,
  SaveLatent: SaveLatent$5,
  SD_4XUpscale_Conditioning: SD_4XUpscale_Conditioning$5,
  SDTurboScheduler: SDTurboScheduler$5,
  SelfAttentionGuidance: SelfAttentionGuidance$5,
  SetClipHooks: SetClipHooks$5,
  SetHookKeyframes: SetHookKeyframes$5,
  SetLatentNoiseMask: SetLatentNoiseMask$5,
  SetUnionControlNetType: SetUnionControlNetType$5,
  SkipLayerGuidanceDiT: SkipLayerGuidanceDiT$5,
  SkipLayerGuidanceSD3: SkipLayerGuidanceSD3$5,
  SolidMask: SolidMask$5,
  SplitImageWithAlpha: SplitImageWithAlpha$5,
  SplitSigmas: SplitSigmas$5,
  SplitSigmasDenoise: SplitSigmasDenoise$5,
  StableCascade_EmptyLatentImage: StableCascade_EmptyLatentImage$5,
  StableCascade_StageB_Conditioning: StableCascade_StageB_Conditioning$5,
  StableCascade_StageC_VAEEncode: StableCascade_StageC_VAEEncode$5,
  StableCascade_SuperResolutionControlnet: StableCascade_SuperResolutionControlnet$5,
  StableZero123_Conditioning: StableZero123_Conditioning$5,
  StableZero123_Conditioning_Batched: StableZero123_Conditioning_Batched$5,
  StyleModelApply: StyleModelApply$5,
  StyleModelLoader: StyleModelLoader$5,
  SV3D_Conditioning: SV3D_Conditioning$5,
  SVD_img2vid_Conditioning: SVD_img2vid_Conditioning$5,
  ThresholdMask: ThresholdMask$5,
  TomePatchModel: TomePatchModel$5,
  TorchCompileModel: TorchCompileModel$5,
  TripleCLIPLoader: TripleCLIPLoader$5,
  unCLIPCheckpointLoader: unCLIPCheckpointLoader$5,
  unCLIPConditioning: unCLIPConditioning$5,
  UNetCrossAttentionMultiply: UNetCrossAttentionMultiply$5,
  UNETLoader: UNETLoader$5,
  UNetSelfAttentionMultiply: UNetSelfAttentionMultiply$5,
  UNetTemporalAttentionMultiply: UNetTemporalAttentionMultiply$5,
  UpscaleModelLoader: UpscaleModelLoader$5,
  VAEDecode: VAEDecode$5,
  VAEDecodeAudio: VAEDecodeAudio$5,
  VAEDecodeTiled: VAEDecodeTiled$5,
  VAEEncode: VAEEncode$5,
  VAEEncodeAudio: VAEEncodeAudio$5,
  VAEEncodeForInpaint: VAEEncodeForInpaint$5,
  VAEEncodeTiled: VAEEncodeTiled$5,
  VAELoader: VAELoader$5,
  VAESave: VAESave$5,
  VideoLinearCFGGuidance: VideoLinearCFGGuidance$5,
  VideoTriangleCFGGuidance: VideoTriangleCFGGuidance$5,
  VPScheduler: VPScheduler$5,
  WebcamCapture: WebcamCapture$5
};
const Comfy_ConfirmClear$5 = {
  name: "Require confirmation when clearing workflow"
};
const Comfy_DevMode$5 = {
  name: "Enable dev mode options (API save, etc.)"
};
const Comfy_DisableFloatRounding$5 = {
  name: "Disable default float widget rounding.",
  tooltip: "(requires page reload) Cannot disable round when round is set by the node in the backend."
};
const Comfy_DisableSliders$5 = {
  name: "Disable node widget sliders"
};
const Comfy_DOMClippingEnabled$5 = {
  name: "Enable DOM element clipping (enabling may reduce performance)"
};
const Comfy_EditAttention_Delta$5 = {
  name: "Ctrl+up/down precision"
};
const Comfy_EnableTooltips$5 = {
  name: "Enable Tooltips"
};
const Comfy_EnableWorkflowViewRestore$5 = {
  name: "Save and restore canvas position and zoom level in workflows"
};
const Comfy_FloatRoundingPrecision$5 = {
  name: "Float widget rounding decimal places [0 = auto].",
  tooltip: "(requires page reload)"
};
const Comfy_Graph_CanvasInfo$5 = {
  name: "Show canvas info on bottom left corner (fps, etc.)"
};
const Comfy_Graph_CanvasMenu$5 = {
  name: "Show graph canvas menu"
};
const Comfy_Graph_CtrlShiftZoom$5 = {
  name: "Enable fast-zoom shortcut (Ctrl + Shift + Drag)"
};
const Comfy_Graph_LinkMarkers$5 = {
  name: "Link midpoint markers",
  options: {
    None: "None",
    Circle: "Circle",
    Arrow: "Arrow"
  }
};
const Comfy_Graph_ZoomSpeed$5 = {
  name: "Canvas zoom speed"
};
const Comfy_Group_DoubleClickTitleToEdit$5 = {
  name: "Double click group title to edit"
};
const Comfy_GroupSelectedNodes_Padding$5 = {
  name: "Group selected nodes padding"
};
const Comfy_InvertMenuScrolling$5 = {
  name: "Invert Context Menu Scrolling"
};
const Comfy_LinkRelease_Action$5 = {
  name: "Action on link release (No modifier)",
  options: {
    "context menu": "context menu",
    "search box": "search box",
    "no action": "no action"
  }
};
const Comfy_LinkRelease_ActionShift$5 = {
  name: "Action on link release (Shift)",
  options: {
    "context menu": "context menu",
    "search box": "search box",
    "no action": "no action"
  }
};
const Comfy_LinkRenderMode$5 = {
  name: "Link Render Mode",
  options: {
    Straight: "Straight",
    Linear: "Linear",
    Spline: "Spline",
    Hidden: "Hidden"
  }
};
const Comfy_Locale$5 = {
  name: "Language"
};
const Comfy_MaskEditor_BrushAdjustmentSpeed$5 = {
  name: "Brush adjustment speed multiplier",
  tooltip: "Controls how quickly the brush size and hardness change when adjusting. Higher values mean faster changes."
};
const Comfy_MaskEditor_UseDominantAxis$5 = {
  name: "Lock brush adjustment to dominant axis",
  tooltip: "When enabled, brush adjustments will only affect size OR hardness based on which direction you move more"
};
const Comfy_MaskEditor_UseNewEditor$5 = {
  name: "Use new mask editor",
  tooltip: "Switch to the new mask editor interface"
};
const Comfy_ModelLibrary_AutoLoadAll$5 = {
  name: "Automatically load all model folders",
  tooltip: "If true, all folders will load as soon as you open the model library (this may cause delays while it loads). If false, root level model folders will only load once you click on them."
};
const Comfy_ModelLibrary_NameFormat$5 = {
  name: "What name to display in the model library tree view",
  tooltip: 'Select "filename" to render a simplified view of the raw filename (without directory or ".safetensors" extension) in the model list. Select "title" to display the configurable model metadata title.',
  options: {
    filename: "filename",
    title: "title"
  }
};
const Comfy_Node_AutoSnapLinkToSlot$5 = {
  name: "Auto snap link to node slot",
  tooltip: "When dragging a link over a node, the link automatically snap to a viable input slot on the node"
};
const Comfy_Node_BypassAllLinksOnDelete$5 = {
  name: "Keep all links when deleting nodes",
  tooltip: "When deleting a node, attempt to reconnect all of its input and output links (bypassing the deleted node)"
};
const Comfy_Node_DoubleClickTitleToEdit$5 = {
  name: "Double click node title to edit"
};
const Comfy_Node_MiddleClickRerouteNode$5 = {
  name: "Middle-click creates a new Reroute node"
};
const Comfy_Node_Opacity$5 = {
  name: "Node opacity"
};
const Comfy_Node_ShowDeprecated$5 = {
  name: "Show deprecated nodes in search",
  tooltip: "Deprecated nodes are hidden by default in the UI, but remain functional in existing workflows that use them."
};
const Comfy_Node_ShowExperimental$5 = {
  name: "Show experimental nodes in search",
  tooltip: "Experimental nodes are marked as such in the UI and may be subject to significant changes or removal in future versions. Use with caution in production workflows"
};
const Comfy_Node_SnapHighlightsNode$5 = {
  name: "Snap highlights node",
  tooltip: "When dragging a link over a node with viable input slot, highlight the node"
};
const Comfy_NodeBadge_NodeIdBadgeMode$5 = {
  name: "Node ID badge mode",
  options: {
    None: "None",
    "Show all": "Show all"
  }
};
const Comfy_NodeBadge_NodeLifeCycleBadgeMode$5 = {
  name: "Node life cycle badge mode",
  options: {
    None: "None",
    "Show all": "Show all"
  }
};
const Comfy_NodeBadge_NodeSourceBadgeMode$5 = {
  name: "Node source badge mode",
  options: {
    None: "None",
    "Show all": "Show all",
    "Hide built-in": "Hide built-in"
  }
};
const Comfy_NodeInputConversionSubmenus$5 = {
  name: "In the node context menu, place the entries that convert between input/widget in sub-menus."
};
const Comfy_NodeSearchBoxImpl$5 = {
  name: "Node search box implementation",
  options: {
    "default": "default",
    "litegraph (legacy)": "litegraph (legacy)"
  }
};
const Comfy_NodeSearchBoxImpl_NodePreview$5 = {
  name: "Node preview",
  tooltip: "Only applies to the default implementation"
};
const Comfy_NodeSearchBoxImpl_ShowCategory$5 = {
  name: "Show node category in search results",
  tooltip: "Only applies to the default implementation"
};
const Comfy_NodeSearchBoxImpl_ShowIdName$5 = {
  name: "Show node id name in search results",
  tooltip: "Only applies to the default implementation"
};
const Comfy_NodeSearchBoxImpl_ShowNodeFrequency$5 = {
  name: "Show node frequency in search results",
  tooltip: "Only applies to the default implementation"
};
const Comfy_NodeSuggestions_number$5 = {
  name: "Number of nodes suggestions",
  tooltip: "Only for litegraph searchbox/context menu"
};
const Comfy_Pointer_ClickBufferTime$5 = {
  name: "Pointer click drift delay",
  tooltip: "After pressing a pointer button down, this is the maximum time (in milliseconds) that pointer movement can be ignored for.\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking."
};
const Comfy_Pointer_ClickDrift$5 = {
  name: "Pointer click drift (maximum distance)",
  tooltip: "If the pointer moves more than this distance while holding a button down, it is considered dragging (rather than clicking).\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking."
};
const Comfy_Pointer_DoubleClickTime$5 = {
  name: "Double click interval (maximum)",
  tooltip: "The maximum time in milliseconds between the two clicks of a double-click.  Increasing this value may assist if double-clicks are sometimes not registered."
};
const Comfy_PreviewFormat$5 = {
  name: "Preview image format",
  tooltip: "When displaying a preview in the image widget, convert it to a lightweight image, e.g. webp, jpeg, webp;50, etc."
};
const Comfy_PromptFilename$5 = {
  name: "Prompt for filename when saving workflow"
};
const Comfy_Queue_MaxHistoryItems$5 = {
  name: "Queue history size",
  tooltip: "The maximum number of tasks that show in the queue history."
};
const Comfy_QueueButton_BatchCountLimit$5 = {
  name: "Batch count limit",
  tooltip: "The maximum number of tasks added to the queue at one button click"
};
const Comfy_RerouteBeta$5 = {
  name: "Opt-in to the reroute beta test",
  tooltip: "Enables the new native reroutes.\n\nReroutes can be added by holding alt and dragging from a link line, or on the link menu.\n\nDisabling this option is non-destructive - reroutes are hidden."
};
const Comfy_Sidebar_Location$5 = {
  name: "Sidebar location",
  options: {
    left: "left",
    right: "right"
  }
};
const Comfy_Sidebar_Size$5 = {
  name: "Sidebar size",
  options: {
    normal: "normal",
    small: "small"
  }
};
const Comfy_SnapToGrid_GridSize$5 = {
  name: "Snap to grid size",
  tooltip: "When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid."
};
const Comfy_TextareaWidget_FontSize$5 = {
  name: "Textarea widget font size"
};
const Comfy_TextareaWidget_Spellcheck$5 = {
  name: "Textarea widget spellcheck"
};
const Comfy_TreeExplorer_ItemPadding$5 = {
  name: "Tree explorer item padding"
};
const Comfy_UseNewMenu$5 = {
  name: "Use new menu",
  options: {
    Disabled: "Disabled",
    Top: "Top",
    Bottom: "Bottom"
  }
};
const Comfy_Validation_NodeDefs$5 = {
  name: "Validate node definitions (slow)",
  tooltip: "Recommended for node developers. This will validate all node definitions on startup."
};
const Comfy_Validation_Workflows$5 = {
  name: "Validate workflows"
};
const Comfy_WidgetControlMode$5 = {
  name: "Widget control mode",
  tooltip: "Controls when widget values are updated (randomize/increment/decrement), either before the prompt is queued or after.",
  options: {
    before: "before",
    after: "after"
  }
};
const Comfy_Window_UnloadConfirmation$5 = {
  name: "Show confirmation when closing window"
};
const Comfy_Workflow_ConfirmDelete$5 = {
  name: "Show confirmation when deleting workflows"
};
const Comfy_Workflow_ShowMissingModelsWarning$5 = {
  name: "Show missing models warning"
};
const Comfy_Workflow_ShowMissingNodesWarning$5 = {
  name: "Show missing nodes warning"
};
const Comfy_Workflow_SortNodeIdOnSave$5 = {
  name: "Sort node IDs when saving workflow"
};
const Comfy_Workflow_WorkflowTabsPosition$5 = {
  name: "Opened workflows position",
  options: {
    Sidebar: "Sidebar",
    Topbar: "Topbar"
  }
};
const LiteGraph_Canvas_MaximumFps$5 = {
  name: "Maxium FPS",
  tooltip: "The maximum frames per second that the canvas is allowed to render. Caps GPU usage at the cost of smoothness. If 0, the screen refresh rate is used. Default: 0"
};
const pysssss_SnapToGrid$5 = {
  name: "Always snap to grid"
};
const enSettings = {
  "Comfy-Desktop_AutoUpdate": {
    name: "Automatically check for updates"
  },
  "Comfy-Desktop_SendStatistics": {
    name: "Send anonymous crash reports"
  },
  Comfy_ConfirmClear: Comfy_ConfirmClear$5,
  Comfy_DevMode: Comfy_DevMode$5,
  Comfy_DisableFloatRounding: Comfy_DisableFloatRounding$5,
  Comfy_DisableSliders: Comfy_DisableSliders$5,
  Comfy_DOMClippingEnabled: Comfy_DOMClippingEnabled$5,
  Comfy_EditAttention_Delta: Comfy_EditAttention_Delta$5,
  Comfy_EnableTooltips: Comfy_EnableTooltips$5,
  Comfy_EnableWorkflowViewRestore: Comfy_EnableWorkflowViewRestore$5,
  Comfy_FloatRoundingPrecision: Comfy_FloatRoundingPrecision$5,
  Comfy_Graph_CanvasInfo: Comfy_Graph_CanvasInfo$5,
  Comfy_Graph_CanvasMenu: Comfy_Graph_CanvasMenu$5,
  Comfy_Graph_CtrlShiftZoom: Comfy_Graph_CtrlShiftZoom$5,
  Comfy_Graph_LinkMarkers: Comfy_Graph_LinkMarkers$5,
  Comfy_Graph_ZoomSpeed: Comfy_Graph_ZoomSpeed$5,
  Comfy_Group_DoubleClickTitleToEdit: Comfy_Group_DoubleClickTitleToEdit$5,
  Comfy_GroupSelectedNodes_Padding: Comfy_GroupSelectedNodes_Padding$5,
  Comfy_InvertMenuScrolling: Comfy_InvertMenuScrolling$5,
  Comfy_LinkRelease_Action: Comfy_LinkRelease_Action$5,
  Comfy_LinkRelease_ActionShift: Comfy_LinkRelease_ActionShift$5,
  Comfy_LinkRenderMode: Comfy_LinkRenderMode$5,
  Comfy_Locale: Comfy_Locale$5,
  Comfy_MaskEditor_BrushAdjustmentSpeed: Comfy_MaskEditor_BrushAdjustmentSpeed$5,
  Comfy_MaskEditor_UseDominantAxis: Comfy_MaskEditor_UseDominantAxis$5,
  Comfy_MaskEditor_UseNewEditor: Comfy_MaskEditor_UseNewEditor$5,
  Comfy_ModelLibrary_AutoLoadAll: Comfy_ModelLibrary_AutoLoadAll$5,
  Comfy_ModelLibrary_NameFormat: Comfy_ModelLibrary_NameFormat$5,
  Comfy_Node_AutoSnapLinkToSlot: Comfy_Node_AutoSnapLinkToSlot$5,
  Comfy_Node_BypassAllLinksOnDelete: Comfy_Node_BypassAllLinksOnDelete$5,
  Comfy_Node_DoubleClickTitleToEdit: Comfy_Node_DoubleClickTitleToEdit$5,
  Comfy_Node_MiddleClickRerouteNode: Comfy_Node_MiddleClickRerouteNode$5,
  Comfy_Node_Opacity: Comfy_Node_Opacity$5,
  Comfy_Node_ShowDeprecated: Comfy_Node_ShowDeprecated$5,
  Comfy_Node_ShowExperimental: Comfy_Node_ShowExperimental$5,
  Comfy_Node_SnapHighlightsNode: Comfy_Node_SnapHighlightsNode$5,
  Comfy_NodeBadge_NodeIdBadgeMode: Comfy_NodeBadge_NodeIdBadgeMode$5,
  Comfy_NodeBadge_NodeLifeCycleBadgeMode: Comfy_NodeBadge_NodeLifeCycleBadgeMode$5,
  Comfy_NodeBadge_NodeSourceBadgeMode: Comfy_NodeBadge_NodeSourceBadgeMode$5,
  Comfy_NodeInputConversionSubmenus: Comfy_NodeInputConversionSubmenus$5,
  Comfy_NodeSearchBoxImpl: Comfy_NodeSearchBoxImpl$5,
  Comfy_NodeSearchBoxImpl_NodePreview: Comfy_NodeSearchBoxImpl_NodePreview$5,
  Comfy_NodeSearchBoxImpl_ShowCategory: Comfy_NodeSearchBoxImpl_ShowCategory$5,
  Comfy_NodeSearchBoxImpl_ShowIdName: Comfy_NodeSearchBoxImpl_ShowIdName$5,
  Comfy_NodeSearchBoxImpl_ShowNodeFrequency: Comfy_NodeSearchBoxImpl_ShowNodeFrequency$5,
  Comfy_NodeSuggestions_number: Comfy_NodeSuggestions_number$5,
  Comfy_Pointer_ClickBufferTime: Comfy_Pointer_ClickBufferTime$5,
  Comfy_Pointer_ClickDrift: Comfy_Pointer_ClickDrift$5,
  Comfy_Pointer_DoubleClickTime: Comfy_Pointer_DoubleClickTime$5,
  Comfy_PreviewFormat: Comfy_PreviewFormat$5,
  Comfy_PromptFilename: Comfy_PromptFilename$5,
  Comfy_Queue_MaxHistoryItems: Comfy_Queue_MaxHistoryItems$5,
  Comfy_QueueButton_BatchCountLimit: Comfy_QueueButton_BatchCountLimit$5,
  Comfy_RerouteBeta: Comfy_RerouteBeta$5,
  Comfy_Sidebar_Location: Comfy_Sidebar_Location$5,
  Comfy_Sidebar_Size: Comfy_Sidebar_Size$5,
  Comfy_SnapToGrid_GridSize: Comfy_SnapToGrid_GridSize$5,
  Comfy_TextareaWidget_FontSize: Comfy_TextareaWidget_FontSize$5,
  Comfy_TextareaWidget_Spellcheck: Comfy_TextareaWidget_Spellcheck$5,
  Comfy_TreeExplorer_ItemPadding: Comfy_TreeExplorer_ItemPadding$5,
  Comfy_UseNewMenu: Comfy_UseNewMenu$5,
  Comfy_Validation_NodeDefs: Comfy_Validation_NodeDefs$5,
  Comfy_Validation_Workflows: Comfy_Validation_Workflows$5,
  Comfy_WidgetControlMode: Comfy_WidgetControlMode$5,
  Comfy_Window_UnloadConfirmation: Comfy_Window_UnloadConfirmation$5,
  Comfy_Workflow_ConfirmDelete: Comfy_Workflow_ConfirmDelete$5,
  Comfy_Workflow_ShowMissingModelsWarning: Comfy_Workflow_ShowMissingModelsWarning$5,
  Comfy_Workflow_ShowMissingNodesWarning: Comfy_Workflow_ShowMissingNodesWarning$5,
  Comfy_Workflow_SortNodeIdOnSave: Comfy_Workflow_SortNodeIdOnSave$5,
  Comfy_Workflow_WorkflowTabsPosition: Comfy_Workflow_WorkflowTabsPosition$5,
  LiteGraph_Canvas_MaximumFps: LiteGraph_Canvas_MaximumFps$5,
  pysssss_SnapToGrid: pysssss_SnapToGrid$5
};
const Comfy_BrowseTemplates$4 = {
  label: "Parcourir les modèles"
};
const Comfy_Canvas_FitView$4 = {
  label: "Ajuster la vue aux nœuds sélectionnés"
};
const Comfy_Canvas_ResetView$4 = {
  label: "Réinitialiser la vue"
};
const Comfy_Canvas_ToggleLinkVisibility$4 = {
  label: "Basculer la visibilité du lien sur le canevas"
};
const Comfy_Canvas_ToggleLock$4 = {
  label: "Basculer le verrouillage du canevas"
};
const Comfy_Canvas_ToggleSelectedNodes_Bypass$4 = {
  label: "Contourner/Ne pas contourner les nœuds sélectionnés"
};
const Comfy_Canvas_ToggleSelectedNodes_Collapse$4 = {
  label: "Réduire/Étendre les nœuds sélectionnés"
};
const Comfy_Canvas_ToggleSelectedNodes_Mute$4 = {
  label: "Mettre en sourdine/Activer le son des nœuds sélectionnés"
};
const Comfy_Canvas_ToggleSelectedNodes_Pin$4 = {
  label: "Épingler/Désépingler les nœuds sélectionnés"
};
const Comfy_Canvas_ToggleSelected_Pin$4 = {
  label: "Épingler/Désépingler les éléments sélectionnés"
};
const Comfy_Canvas_ZoomIn$4 = {
  label: "Zoom avant"
};
const Comfy_Canvas_ZoomOut$4 = {
  label: "Zoom arrière"
};
const Comfy_ClearPendingTasks$4 = {
  label: "Effacer les tâches en attente"
};
const Comfy_ClearWorkflow$4 = {
  label: "Effacer le flux de travail"
};
const Comfy_DuplicateWorkflow$4 = {
  label: "Dupliquer le flux de travail actuel"
};
const Comfy_ExportWorkflow$4 = {
  label: "Exporter le flux de travail"
};
const Comfy_ExportWorkflowAPI$4 = {
  label: "Exporter le flux de travail (format API)"
};
const Comfy_Graph_FitGroupToContents$4 = {
  label: "Ajuster le groupe au contenu"
};
const Comfy_Graph_GroupSelectedNodes$4 = {
  label: "Grouper les nœuds sélectionnés"
};
const Comfy_GroupNode_ConvertSelectedNodesToGroupNode$4 = {
  label: "Convertir les nœuds sélectionnés en nœud de groupe"
};
const Comfy_GroupNode_ManageGroupNodes$4 = {
  label: "Gérer les nœuds de groupe"
};
const Comfy_GroupNode_UngroupSelectedGroupNodes$4 = {
  label: "Dégrouper les nœuds de groupe sélectionnés"
};
const Comfy_Help_AboutComfyUI$4 = {
  label: "Ouvrir À propos de ComfyUI"
};
const Comfy_Help_OpenComfyOrgDiscord$4 = {
  label: "Ouvrir Comfy-Org Discord"
};
const Comfy_Help_OpenComfyUIDocs$4 = {
  label: "Ouvrir les documents ComfyUI"
};
const Comfy_Help_OpenComfyUIIssues$4 = {
  label: "Ouvrir les problèmes ComfyUI"
};
const Comfy_Interrupt$4 = {
  label: "Interrompre"
};
const Comfy_LoadDefaultWorkflow$4 = {
  label: "Charger le flux de travail par défaut"
};
const Comfy_NewBlankWorkflow$4 = {
  label: "Nouveau flux de travail vierge"
};
const Comfy_OpenClipspace$4 = {
  label: "Espace de clip"
};
const Comfy_OpenWorkflow$4 = {
  label: "Ouvrir le flux de travail"
};
const Comfy_QueuePrompt$4 = {
  label: "Invite de file d'attente"
};
const Comfy_QueuePromptFront$4 = {
  label: "Invite de file d'attente (avant)"
};
const Comfy_Redo$4 = {
  label: "Refaire"
};
const Comfy_RefreshNodeDefinitions$4 = {
  label: "Actualiser les définitions de nœud"
};
const Comfy_SaveWorkflow$4 = {
  label: "Enregistrer le flux de travail"
};
const Comfy_SaveWorkflowAs$4 = {
  label: "Enregistrer le flux de travail sous"
};
const Comfy_ShowSettingsDialog$4 = {
  label: "Afficher la boîte de dialogue des paramètres"
};
const Comfy_ToggleTheme$4 = {
  label: "Changer de thème (Sombre/Clair)"
};
const Comfy_Undo$4 = {
  label: "Annuler"
};
const Workspace_NextOpenedWorkflow$4 = {
  label: "Flux de travail ouvert suivant"
};
const Workspace_PreviousOpenedWorkflow$4 = {
  label: "Flux de travail ouvert précédent"
};
const Workspace_SearchBox_Toggle$4 = {
  label: "Basculer la boîte de recherche"
};
const Workspace_ToggleBottomPanel$4 = {
  label: "Basculer le panneau inférieur"
};
const Workspace_ToggleFocusMode$4 = {
  label: "Basculer le mode focus"
};
const Workspace_ToggleSidebarTab_queue$4 = {
  label: "Basculer la barre latérale de la file d'attente",
  tooltip: "File d'attente"
};
const Workspace_ToggleSidebarTab_workflows$4 = {
  label: "Basculer la barre latérale des flux de travail",
  tooltip: "Flux de travail"
};
const frCommands = {
  "Comfy-Desktop_Folders_OpenCustomNodesFolder": {
    label: "Ouvrir le dossier des nœuds personnalisés"
  },
  "Comfy-Desktop_Folders_OpenInputsFolder": {
    label: "Ouvrir le dossier des entrées"
  },
  "Comfy-Desktop_Folders_OpenLogsFolder": {
    label: "Ouvrir le dossier des journaux"
  },
  "Comfy-Desktop_Folders_OpenModelConfig": {
    label: "Ouvrir extra_model_paths.yaml"
  },
  "Comfy-Desktop_Folders_OpenModelsFolder": {
    label: "Ouvrir le dossier des modèles"
  },
  "Comfy-Desktop_Folders_OpenOutputsFolder": {
    label: "Ouvrir le dossier des sorties"
  },
  "Comfy-Desktop_OpenDevTools": {
    label: "Ouvrir les outils de développement"
  },
  "Comfy-Desktop_OpenFeedbackPage": {
    label: "Retour d'information"
  },
  "Comfy-Desktop_OpenUserGuide": {
    label: "Guide de l'utilisateur du bureau"
  },
  "Comfy-Desktop_Reinstall": {
    label: "Réinstaller"
  },
  "Comfy-Desktop_Restart": {
    label: "Redémarrer"
  },
  Comfy_BrowseTemplates: Comfy_BrowseTemplates$4,
  Comfy_Canvas_FitView: Comfy_Canvas_FitView$4,
  Comfy_Canvas_ResetView: Comfy_Canvas_ResetView$4,
  Comfy_Canvas_ToggleLinkVisibility: Comfy_Canvas_ToggleLinkVisibility$4,
  Comfy_Canvas_ToggleLock: Comfy_Canvas_ToggleLock$4,
  Comfy_Canvas_ToggleSelectedNodes_Bypass: Comfy_Canvas_ToggleSelectedNodes_Bypass$4,
  Comfy_Canvas_ToggleSelectedNodes_Collapse: Comfy_Canvas_ToggleSelectedNodes_Collapse$4,
  Comfy_Canvas_ToggleSelectedNodes_Mute: Comfy_Canvas_ToggleSelectedNodes_Mute$4,
  Comfy_Canvas_ToggleSelectedNodes_Pin: Comfy_Canvas_ToggleSelectedNodes_Pin$4,
  Comfy_Canvas_ToggleSelected_Pin: Comfy_Canvas_ToggleSelected_Pin$4,
  Comfy_Canvas_ZoomIn: Comfy_Canvas_ZoomIn$4,
  Comfy_Canvas_ZoomOut: Comfy_Canvas_ZoomOut$4,
  Comfy_ClearPendingTasks: Comfy_ClearPendingTasks$4,
  Comfy_ClearWorkflow: Comfy_ClearWorkflow$4,
  Comfy_DuplicateWorkflow: Comfy_DuplicateWorkflow$4,
  Comfy_ExportWorkflow: Comfy_ExportWorkflow$4,
  Comfy_ExportWorkflowAPI: Comfy_ExportWorkflowAPI$4,
  Comfy_Graph_FitGroupToContents: Comfy_Graph_FitGroupToContents$4,
  Comfy_Graph_GroupSelectedNodes: Comfy_Graph_GroupSelectedNodes$4,
  Comfy_GroupNode_ConvertSelectedNodesToGroupNode: Comfy_GroupNode_ConvertSelectedNodesToGroupNode$4,
  Comfy_GroupNode_ManageGroupNodes: Comfy_GroupNode_ManageGroupNodes$4,
  Comfy_GroupNode_UngroupSelectedGroupNodes: Comfy_GroupNode_UngroupSelectedGroupNodes$4,
  Comfy_Help_AboutComfyUI: Comfy_Help_AboutComfyUI$4,
  Comfy_Help_OpenComfyOrgDiscord: Comfy_Help_OpenComfyOrgDiscord$4,
  Comfy_Help_OpenComfyUIDocs: Comfy_Help_OpenComfyUIDocs$4,
  Comfy_Help_OpenComfyUIIssues: Comfy_Help_OpenComfyUIIssues$4,
  Comfy_Interrupt: Comfy_Interrupt$4,
  Comfy_LoadDefaultWorkflow: Comfy_LoadDefaultWorkflow$4,
  Comfy_NewBlankWorkflow: Comfy_NewBlankWorkflow$4,
  Comfy_OpenClipspace: Comfy_OpenClipspace$4,
  Comfy_OpenWorkflow: Comfy_OpenWorkflow$4,
  Comfy_QueuePrompt: Comfy_QueuePrompt$4,
  Comfy_QueuePromptFront: Comfy_QueuePromptFront$4,
  Comfy_Redo: Comfy_Redo$4,
  Comfy_RefreshNodeDefinitions: Comfy_RefreshNodeDefinitions$4,
  Comfy_SaveWorkflow: Comfy_SaveWorkflow$4,
  Comfy_SaveWorkflowAs: Comfy_SaveWorkflowAs$4,
  Comfy_ShowSettingsDialog: Comfy_ShowSettingsDialog$4,
  Comfy_ToggleTheme: Comfy_ToggleTheme$4,
  Comfy_Undo: Comfy_Undo$4,
  Workspace_NextOpenedWorkflow: Workspace_NextOpenedWorkflow$4,
  Workspace_PreviousOpenedWorkflow: Workspace_PreviousOpenedWorkflow$4,
  Workspace_SearchBox_Toggle: Workspace_SearchBox_Toggle$4,
  Workspace_ToggleBottomPanel: Workspace_ToggleBottomPanel$4,
  "Workspace_ToggleBottomPanelTab_command-terminal": {
    label: "Basculer le panneau inférieur du terminal"
  },
  "Workspace_ToggleBottomPanelTab_logs-terminal": {
    label: "Basculer le panneau inférieur des journaux"
  },
  Workspace_ToggleFocusMode: Workspace_ToggleFocusMode$4,
  "Workspace_ToggleSidebarTab_model-library": {
    label: "Basculer la barre latérale de la bibliothèque de modèles",
    tooltip: "Bibliothèque de modèles"
  },
  "Workspace_ToggleSidebarTab_node-library": {
    label: "Basculer la barre latérale de la bibliothèque de nœuds",
    tooltip: "Bibliothèque de nœuds"
  },
  Workspace_ToggleSidebarTab_queue: Workspace_ToggleSidebarTab_queue$4,
  Workspace_ToggleSidebarTab_workflows: Workspace_ToggleSidebarTab_workflows$4
};
const color$4 = {
  blue: "Bleu",
  custom: "Personnalisé",
  "default": "Par défaut",
  green: "Vert",
  pink: "Rose",
  red: "Rouge",
  yellow: "Jaune"
};
const dataTypes$4 = {
  AUDIO: "AUDIO",
  BOOLEAN: "BOOLEAN",
  CLIP: "CLIP",
  CLIP_VISION: "CLIP_VISION",
  CLIP_VISION_OUTPUT: "SORTIE_CLIP_VISION",
  COMBO: "COMBO",
  CONDITIONING: "CONDITIONNEMENT",
  CONTROL_NET: "RESEAU_DE_CONTROLE",
  FLOAT: "FLOTTANT",
  FLOATS: "FLOTTANTS",
  GLIGEN: "GLIGEN",
  GUIDER: "GUIDE",
  HOOKS: "CROCHETS",
  HOOK_KEYFRAMES: "CLEFS_DE_CROCHET",
  IMAGE: "IMAGE",
  INT: "ENTIER",
  LATENT: "LATENT",
  LATENT_OPERATION: "OPERATION_LATENTE",
  LOAD_3D: "CHARGER_3D",
  LOAD_3D_ANIMATION: "CHARGER_ANIMATION_3D",
  MASK: "MASQUE",
  MODEL: "MODÈLE",
  NOISE: "BRUIT",
  PHOTOMAKER: "PHOTOMAKER",
  SAMPLER: "ÉCHANTILLONNEUR",
  SIGMAS: "SIGMAS",
  STRING: "CHAÎNE",
  STYLE_MODEL: "MODÈLE_DE_STYLE",
  TIMESTEPS_RANGE: "PLAGE_DES_ÉTAPES_TEMPORELLES",
  UPSCALE_MODEL: "MODÈLE_DE_MISE_À_L'ÉCHELLE",
  VAE: "VAE",
  WEBCAM: "WEBCAM"
};
const desktopMenu$4 = {
  confirmReinstall: "Cela effacera votre fichier extra_models_config.yaml,\net commencera l'installation à nouveau.\n\nÊtes-vous sûr ?",
  reinstall: "Réinstaller"
};
const downloadGit$4 = {
  gitWebsite: "Télécharger git",
  instructions: "Veuillez télécharger et installer la dernière version pour votre système d'exploitation. Le bouton Télécharger git ci-dessous ouvre la page de téléchargement de git-scm.com.",
  message: "Impossible de localiser git. Une copie fonctionnelle de git est nécessaire pour un fonctionnement normal.",
  skip: "Passer",
  title: "Télécharger git",
  warning: "Si vous êtes sûr de ne pas avoir besoin de git installé, ou s'il y a eu une erreur, vous pouvez cliquer sur Passer pour contourner cette vérification. Essayer de faire fonctionner ComfyUI sans une copie fonctionnelle de git n'est actuellement pas pris en charge."
};
const electronFileDownload$4 = {
  cancel: "Annuler le téléchargement",
  cancelled: "Annulé",
  inProgress: "En cours",
  pause: "Pause du téléchargement",
  paused: "En pause",
  resume: "Reprendre le téléchargement"
};
const g$4 = {
  about: "À propos",
  add: "Ajouter",
  back: "Retour",
  cancel: "Annuler",
  close: "Fermer",
  color: "Couleur",
  comingSoon: "Bientôt disponible",
  command: "Commande",
  confirm: "Confirmer",
  copyToClipboard: "Copier dans le presse-papiers",
  currentUser: "Utilisateur actuel",
  customize: "Personnaliser",
  customizeFolder: "Personnaliser le dossier",
  "delete": "Supprimer",
  deprecated: "DEPR",
  devices: "Appareils",
  disableAll: "Désactiver tout",
  download: "Télécharger",
  empty: "Vide",
  enableAll: "Activer tout",
  error: "Erreur",
  experimental: "BETA",
  extensionName: "Nom de l'extension",
  findIssues: "Trouver des problèmes",
  firstTimeUIMessage: `C'est la première fois que vous utilisez la nouvelle interface utilisateur. Choisissez "Menu > Utiliser le nouveau menu > Désactivé" pour restaurer l'ancienne interface utilisateur.`,
  goToNode: "Aller au nœud",
  icon: "Icône",
  imageFailedToLoad: "Échec du chargement de l'image",
  "import": "Importer",
  insert: "Insérer",
  install: "Installer",
  keybinding: "Raccourci clavier",
  loadAllFolders: "Charger tous les dossiers",
  loadWorkflow: "Charger le flux de travail",
  loading: "Chargement",
  logs: "Journaux",
  newFolder: "Nouveau dossier",
  next: "Suivant",
  no: "Non",
  noResultsFound: "Aucun résultat trouvé",
  noTasksFound: "Aucune tâche trouvée",
  noTasksFoundMessage: "Il n'y a pas de tâches dans la file d'attente.",
  noWorkflowsFound: "Aucun flux de travail trouvé.",
  openNewIssue: "Ouvrir un nouveau problème",
  overwrite: "Écraser",
  reconnected: "Reconnecté",
  reconnecting: "Reconnexion",
  refresh: "Rafraîchir",
  reloadToApplyChanges: "Recharger pour appliquer les modifications",
  rename: "Renommer",
  reportIssue: "Envoyer le rapport",
  reportIssueTooltip: "Soumettre le rapport d'erreur à Comfy Org",
  reportSent: "Rapport soumis",
  reset: "Réinitialiser",
  resetKeybindingsTooltip: "Réinitialiser les raccourcis clavier par défaut",
  save: "Enregistrer",
  searchExtensions: "Rechercher des extensions",
  searchFailedMessage: "Nous n'avons trouvé aucun paramètre correspondant à votre recherche. Essayez d'ajuster vos termes de recherche.",
  searchKeybindings: "Rechercher des raccourcis clavier",
  searchModels: "Rechercher des modèles",
  searchNodes: "Rechercher des nœuds",
  searchSettings: "Rechercher des paramètres",
  searchWorkflows: "Rechercher des flux de travail",
  settings: "Paramètres",
  showReport: "Afficher le rapport",
  systemInfo: "Informations système",
  terminal: "Terminal",
  upload: "Téléverser",
  videoFailedToLoad: "Échec du chargement de la vidéo"
};
const graphCanvasMenu$4 = {
  fitView: "Adapter la vue",
  panMode: "Mode panoramique",
  resetView: "Réinitialiser la vue",
  selectMode: "Mode sélection",
  toggleLinkVisibility: "Basculer la visibilité des liens",
  zoomIn: "Zoom avant",
  zoomOut: "Zoom arrière"
};
const groupNode$4 = {
  create: "Créer un nœud de groupe",
  enterName: "Entrer le nom"
};
const icon$4 = {
  bookmark: "Favori",
  box: "Boîte",
  briefcase: "Porte-documents",
  "exclamation-triangle": "Avertissement",
  file: "Fichier",
  folder: "Dossier",
  heart: "Cœur",
  inbox: "Boîte de réception",
  star: "Étoile"
};
const install$4 = {
  appDataLocationTooltip: "Répertoire des données de l'application ComfyUI. Stocke :\n- Logs\n- Configurations du serveur",
  appPathLocationTooltip: "Répertoire des ressources de l'application ComfyUI. Stocke le code et les ressources de ComfyUI",
  cannotWrite: "Impossible d'écrire sur le chemin sélectionné",
  chooseInstallationLocation: "Choisissez l'emplacement d'installation",
  customNodes: "Nœuds personnalisés",
  customNodesDescription: "Réinstallez les nœuds personnalisés à partir des installations existantes de ComfyUI.",
  desktopAppSettings: "Paramètres de l'application de bureau",
  desktopAppSettingsDescription: "Configurez comment ComfyUI se comporte sur votre bureau. Vous pouvez modifier ces paramètres plus tard.",
  desktopSettings: "Paramètres de bureau",
  failedToSelectDirectory: "Échec de la sélection du répertoire",
  gpu: "GPU",
  gpuSelection: {
    cpuMode: "Mode CPU",
    cpuModeDescription: "Le mode CPU est destiné aux développeurs et aux cas limites rares uniquement.",
    cpuModeDescription2: "Si vous n'êtes pas absolument certain d'en avoir besoin, veuillez ignorer cette case et sélectionnez votre GPU ci-dessus.",
    customComfyNeedsPython: "ComfyUI ne fonctionnera pas tant que python n'est pas configuré",
    customInstallRequirements: "Installez toutes les exigences et dépendances (par exemple, torch personnalisé)",
    customManualVenv: "Configurer manuellement l'environnement virtuel python",
    customMayNotWork: "Ceci n'est pas du tout pris en charge, et peut simplement ne pas fonctionner",
    customSkipsPython: "Cette option saute la configuration python normale.",
    enableCpuMode: "Activer le mode CPU",
    mpsDescription: "Les shaders de performance métallique d'Apple sont pris en charge en utilisant la version nocturne de pytorch.",
    nvidiaDescription: "Les appareils NVIDIA sont directement pris en charge en utilisant les builds CUDA de pytorch.",
    selectGpu: "Sélectionnez le GPU",
    selectGpuDescription: "Sélectionnez le type de GPU que vous avez"
  },
  installLocation: "Emplacement d'installation",
  installLocationDescription: "Sélectionnez le répertoire pour les données utilisateur de ComfyUI. Un environnement python sera installé à l'emplacement sélectionné. Veuillez vous assurer que le disque sélectionné a suffisamment d'espace (~15GB) restant.",
  installLocationTooltip: "Répertoire des données utilisateur de ComfyUI. Stocke :\n- Environnement Python\n- Modèles\n- Nœuds personnalisés\n",
  insufficientFreeSpace: "Espace insuffisant - espace libre minimum",
  manualConfiguration: {
    createVenv: "Vous devrez créer un environnement virtuel dans le répertoire suivant",
    requirements: "Exigences",
    restartWhenFinished: "Lorsque vous avez terminé de configurer l'environnement virtuel, veuillez redémarrer ComfyUI.",
    title: "Configuration manuelle",
    virtualEnvironmentPath: "Chemin de l'environnement virtuel"
  },
  migrateFromExistingInstallation: "Migrer à partir d'une installation existante",
  migration: "Migration",
  migrationOptional: "La migration est facultative. Si vous n'avez pas d'installation existante, vous pouvez sauter cette étape.",
  migrationSourcePathDescription: "Si vous avez une installation existante de ComfyUI, nous pouvons copier/lier vos fichiers utilisateur et modèles existants à la nouvelle installation.",
  parentMissing: "Le chemin n'existe pas - créez d'abord le répertoire contenant",
  pathExists: "Le répertoire existe déjà - veuillez vous assurer que vous avez sauvegardé toutes les données",
  pathValidationFailed: "Échec de la validation du chemin",
  selectItemsToMigrate: "Sélectionnez les éléments à migrer",
  settings: {
    allowMetrics: "Rapports de plantage",
    allowMetricsDescription: "Aidez à améliorer ComfyUI en envoyant des rapports de plantage anonymes. Aucune information personnelle ou contenu de flux de travail ne sera collecté. Cela peut être désactivé à tout moment dans le menu des paramètres.",
    autoUpdate: "Mises à jour automatiques",
    autoUpdateDescription: "Téléchargez et installez automatiquement les mises à jour lorsqu'elles deviennent disponibles. Vous serez toujours informé avant l'installation des mises à jour.",
    dataCollectionDialog: {
      customNodeConfigurations: "Configurations de nœuds personnalisés",
      errorReports: "Message d'erreur et trace de la pile",
      fileSystemInformation: "Informations sur le système de fichiers",
      personalInformation: "Informations personnelles",
      systemInfo: "Matériel, type d'OS et version de l'application",
      title: "À propos de la collecte de données",
      whatWeCollect: "Ce que nous collectons :",
      whatWeDoNotCollect: "Ce que nous ne collectons pas :",
      workflowContent: "Contenu du flux de travail",
      workflowContents: "Contenus du flux de travail"
    },
    learnMoreAboutData: "En savoir plus sur la collecte de données"
  },
  systemLocations: "Emplacements système",
  unhandledError: "Erreur inconnue"
};
const menu$4 = {
  autoQueue: "File d'attente automatique",
  batchCount: "Nombre de lots",
  batchCountTooltip: "Le nombre de fois que la génération du flux de travail doit être mise en file d'attente",
  clear: "Effacer le flux de travail",
  clipspace: "Ouvrir Clipspace",
  disabled: "Désactivé",
  disabledTooltip: "Le flux de travail ne sera pas mis en file d'attente automatiquement",
  execute: "Exécuter",
  hideMenu: "Masquer le menu",
  instant: "Instantané",
  instantTooltip: "Le flux de travail sera mis en file d'attente immédiatement après la fin d'une génération",
  interrupt: "Annuler l'exécution en cours",
  onChange: "Sur modification",
  onChangeTooltip: "Le flux de travail sera mis en file d'attente une fois une modification effectuée",
  queue: "File d'attente",
  queueWorkflow: "Mettre le flux de travail en file d'attente (Maj pour mettre en tête de file)",
  queueWorkflowFront: "Mettre le flux de travail en tête de file",
  refresh: "Actualiser les définitions des nœuds",
  resetView: "Réinitialiser la vue du canevas",
  showMenu: "Afficher le menu",
  toggleBottomPanel: "Basculer le panneau inférieur"
};
const menuLabels$4 = {
  "About ComfyUI": "À propos de ComfyUI",
  "Browse Templates": "Parcourir les modèles",
  "Bypass/Unbypass Selected Nodes": "Contourner/Ne pas contourner les nœuds sélectionnés",
  "Canvas Toggle Link Visibility": "Basculer la visibilité du lien de la toile",
  "Canvas Toggle Lock": "Basculer le verrouillage de la toile",
  "Clear Pending Tasks": "Effacer les tâches en attente",
  "Clear Workflow": "Effacer le flux de travail",
  Clipspace: "Espace de clip",
  "Collapse/Expand Selected Nodes": "Réduire/Étendre les nœuds sélectionnés",
  "Comfy-Org Discord": "Discord de Comfy-Org",
  "ComfyUI Docs": "Docs de ComfyUI",
  "ComfyUI Issues": "Problèmes de ComfyUI",
  "Convert selected nodes to group node": "Convertir les nœuds sélectionnés en nœud de groupe",
  "Desktop User Guide": "Guide de l'utilisateur de bureau",
  "Duplicate Current Workflow": "Dupliquer le flux de travail actuel",
  Edit: "Éditer",
  Export: "Exporter",
  "Export (API)": "Exporter (API)",
  Feedback: "Retour d'information",
  "Fit Group To Contents": "Ajuster le groupe au contenu",
  "Fit view to selected nodes": "Ajuster la vue aux nœuds sélectionnés",
  "Group Selected Nodes": "Grouper les nœuds sélectionnés",
  Help: "Aide",
  Interrupt: "Interrompre",
  "Load Default Workflow": "Charger le flux de travail par défaut",
  "Manage group nodes": "Gérer les nœuds de groupe",
  "Mute/Unmute Selected Nodes": "Mettre en sourdine/Activer le son des nœuds sélectionnés",
  New: "Nouveau",
  "Next Opened Workflow": "Prochain flux de travail ouvert",
  Open: "Ouvrir",
  "Open Custom Nodes Folder": "Ouvrir le dossier des nœuds personnalisés",
  "Open DevTools": "Ouvrir DevTools",
  "Open Inputs Folder": "Ouvrir le dossier des entrées",
  "Open Logs Folder": "Ouvrir le dossier des journaux",
  "Open Models Folder": "Ouvrir le dossier des modèles",
  "Open Outputs Folder": "Ouvrir le dossier des sorties",
  "Open extra_model_paths_yaml": "Ouvrir extra_model_paths.yaml",
  "Pin/Unpin Selected Items": "Épingler/Désépingler les éléments sélectionnés",
  "Pin/Unpin Selected Nodes": "Épingler/Désépingler les nœuds sélectionnés",
  "Previous Opened Workflow": "Flux de travail ouvert précédent",
  "Queue Prompt": "Invite de file d'attente",
  "Queue Prompt (Front)": "Invite de file d'attente (Front)",
  Redo: "Refaire",
  "Refresh Node Definitions": "Actualiser les définitions de nœud",
  Reinstall: "Réinstaller",
  "Reset View": "Réinitialiser la vue",
  Restart: "Redémarrer",
  Save: "Enregistrer",
  "Save As": "Enregistrer sous",
  "Show Settings Dialog": "Afficher la boîte de dialogue des paramètres",
  "Toggle Bottom Panel": "Basculer le panneau inférieur",
  "Toggle Focus Mode": "Basculer le mode focus",
  "Toggle Logs Bottom Panel": "Basculer le panneau inférieur des journaux",
  "Toggle Model Library Sidebar": "Basculer la barre latérale de la bibliothèque de modèles",
  "Toggle Node Library Sidebar": "Basculer la barre latérale de la bibliothèque de nœuds",
  "Toggle Queue Sidebar": "Basculer la barre latérale de la file d'attente",
  "Toggle Search Box": "Basculer la boîte de recherche",
  "Toggle Terminal Bottom Panel": "Basculer le panneau inférieur du terminal",
  "Toggle Theme (Dark/Light)": "Basculer le thème (Sombre/Clair)",
  "Toggle Workflows Sidebar": "Basculer la barre latérale des flux de travail",
  Undo: "Annuler",
  "Ungroup selected group nodes": "Dégrouper les nœuds de groupe sélectionnés",
  Workflow: "Flux de travail",
  "Zoom In": "Zoom avant",
  "Zoom Out": "Zoom arrière"
};
const nodeCategories$4 = {
  "3d": "3d",
  "3d_models": "modèles_3d",
  DevTools: "OutilsDeDéveloppement",
  _for_testing: "_pour_test",
  advanced: "avancé",
  animation: "animation",
  api: "api",
  attention_experiments: "expériences_d'attention",
  audio: "audio",
  batch: "lot",
  clip: "clip",
  combine: "combiner",
  compositing: "composition",
  "cond pair": "cond pair",
  "cond single": "cond unique",
  conditioning: "conditionnement",
  controlnet: "controlnet",
  create: "créer",
  custom_sampling: "échantillonnage_personnalisé",
  deprecated: "déprécié",
  flux: "flux",
  gligen: "gligen",
  guidance: "guidance",
  guiders: "guides",
  hooks: "crochets",
  image: "image",
  inpaint: "inpaint",
  instructpix2pix: "instructpix2pix",
  latent: "latent",
  loaders: "chargeurs",
  ltxv: "ltxv",
  mask: "masque",
  model: "modèle",
  model_merging: "fusion_de_modèles",
  model_patches: "patches_de_modèle",
  model_specific: "spécifique_au_modèle",
  noise: "bruit",
  operations: "opérations",
  photomaker: "photomaker",
  postprocessing: "post-traitement",
  preprocessors: "préprocesseurs",
  samplers: "échantillonneurs",
  sampling: "échantillonnage",
  schedulers: "planificateurs",
  scheduling: "planification",
  sd3: "sd3",
  sigmas: "sigmas",
  stable_cascade: "stable_cascade",
  style_model: "modèle_de_style",
  transform: "transformer",
  unet: "unet",
  upscale_diffusion: "diffusion_de_mise_à_l'échelle",
  upscaling: "mise_à_l'échelle",
  video: "vidéo",
  video_models: "modèles_vidéo"
};
const nodeTemplates$4 = {
  enterName: "Entrez le nom",
  saveAsTemplate: "Enregistrer comme modèle"
};
const notSupported$4 = {
  "continue": "Continuer",
  continueTooltip: "Je suis sûr que mon appareil est pris en charge",
  learnMore: "En savoir plus",
  message: "Seuls les appareils suivants sont pris en charge :",
  reportIssue: "Signaler un problème",
  supportedDevices: {
    macos: "MacOS (M1 ou ultérieur)",
    windows: "Windows (GPU Nvidia avec support CUDA)"
  },
  title: "Votre appareil n'est pas pris en charge"
};
const serverConfig$4 = {
  modifiedConfigs: "Vous avez modifié les configurations suivantes du serveur. Redémarrez pour appliquer les modifications.",
  restart: "Redémarrer",
  revertChanges: "Annuler les modifications"
};
const serverConfigCategories$4 = {
  Attention: "Attention",
  CUDA: "CUDA",
  Cache: "Cache",
  Directories: "Répertoires",
  General: "Général",
  Inference: "Inférence",
  Memory: "Mémoire",
  Network: "Réseau",
  Preview: "Aperçu"
};
const serverConfigItems$4 = {
  "cache-classic": {
    name: "Utiliser le système de cache classique"
  },
  "cache-lru": {
    name: "Utiliser le cache LRU avec un maximum de N résultats de nœuds mis en cache.",
    tooltip: "Peut utiliser plus de RAM/VRAM."
  },
  "cpu-vae": {
    name: "Exécuter VAE sur CPU"
  },
  "cross-attention-method": {
    name: "Méthode d'attention croisée"
  },
  "cuda-device": {
    name: "Index de l'appareil CUDA à utiliser"
  },
  "cuda-malloc": {
    name: "Utiliser CUDA malloc pour l'allocation de mémoire"
  },
  "default-hashing-function": {
    name: "Fonction de hachage par défaut pour les fichiers de modèle"
  },
  deterministic: {
    name: "Faire utiliser à pytorch des algorithmes déterministes plus lents quand il le peut.",
    tooltip: "Notez que cela peut ne pas rendre les images déterministes dans tous les cas."
  },
  directml: {
    name: "Index de l'appareil DirectML"
  },
  "disable-all-custom-nodes": {
    name: "Désactiver le chargement de tous les nœuds personnalisés."
  },
  "disable-ipex-optimize": {
    name: "Désactiver l'optimisation IPEX"
  },
  "disable-metadata": {
    name: "Désactiver l'enregistrement des métadonnées d'invite dans les fichiers."
  },
  "disable-smart-memory": {
    name: "Désactiver la gestion intelligente de la mémoire",
    tooltip: "Force ComfyUI à décharger agressivement vers la ram régulière au lieu de garder les modèles dans la vram quand il le peut."
  },
  "disable-xformers": {
    name: "Désactiver l'optimisation xFormers"
  },
  "dont-print-server": {
    name: "Ne pas imprimer la sortie du serveur sur la console."
  },
  "dont-upcast-attention": {
    name: "Prévenir l'attention de conversion ascendante"
  },
  "enable-cors-header": {
    name: `Activer l'en-tête CORS: Utilisez "*" pour toutes les origines ou spécifiez le domaine`
  },
  fast: {
    name: "Activer certaines optimisations non testées et potentiellement dégradantes pour la qualité."
  },
  "force-channels-last": {
    name: "Forcer le format de mémoire des derniers canaux"
  },
  "force-upcast-attention": {
    name: "Forcer l'attention de conversion ascendante"
  },
  "global-precision": {
    name: "Précision globale des points flottants",
    tooltip: "Précision globale des points flottants"
  },
  "input-directory": {
    name: "Répertoire d'entrée"
  },
  listen: {
    name: "Hôte: L'adresse IP à écouter"
  },
  "log-level": {
    name: "Niveau de verbosité de la journalisation"
  },
  "max-upload-size": {
    name: "Taille maximale de téléchargement (MB)"
  },
  "output-directory": {
    name: "Répertoire de sortie"
  },
  port: {
    name: "Port: Le port à écouter"
  },
  "preview-method": {
    name: "Méthode utilisée pour les aperçus latents"
  },
  "preview-size": {
    name: "Taille des images d'aperçu"
  },
  "reserve-vram": {
    name: "VRAM réservée (GB)",
    tooltip: "Définissez la quantité de vram en GB que vous souhaitez réserver pour l'utilisation de votre OS/autres logiciels. Par défaut, une certaine quantité est réservée en fonction de votre OS."
  },
  "text-encoder-precision": {
    name: "Précision de l'encodeur de texte",
    tooltip: "Précision de l'encodeur de texte"
  },
  "tls-certfile": {
    name: "Fichier de certificat TLS: Chemin vers le fichier de certificat TLS pour HTTPS"
  },
  "tls-keyfile": {
    name: "Fichier de clé TLS: Chemin vers le fichier de clé TLS pour HTTPS"
  },
  "unet-precision": {
    name: "Précision UNET",
    tooltip: "Précision UNET"
  },
  "vae-precision": {
    name: "Précision VAE",
    tooltip: "Précision VAE"
  },
  "vram-management": {
    name: "Mode de gestion de la VRAM"
  }
};
const serverStart$4 = {
  openLogs: "Ouvrir les journaux",
  process: {
    error: "Impossible de démarrer ComfyUI Desktop",
    "initial-state": "Chargement...",
    "python-setup": "Configuration de l'environnement Python...",
    ready: "Finalisation...",
    "starting-server": "Démarrage du serveur ComfyUI..."
  },
  reinstall: "Réinstaller",
  reportIssue: "Signaler un problème",
  showTerminal: "Afficher le terminal"
};
const settingsCategories$4 = {
  About: "À Propos",
  Appearance: "Apparence",
  BrushAdjustment: "Ajustement de Brosse",
  Canvas: "Toile",
  ColorPalette: "Palette de Couleurs",
  Comfy: "Confort",
  "Comfy-Desktop": "Comfy-Desktop",
  CustomColorPalettes: "Palettes de Couleurs Personnalisées",
  DevMode: "Mode Développeur",
  EditTokenWeight: "Modifier le Poids du Jeton",
  Extension: "Extension",
  General: "Général",
  Graph: "Graphique",
  Group: "Groupe",
  Keybinding: "Raccourci Clavier",
  Link: "Lien",
  LinkRelease: "Libération de Lien",
  LiteGraph: "Lite Graph",
  Locale: "Locale",
  "Mask Editor": "Éditeur de Masque",
  Menu: "Menu",
  ModelLibrary: "Bibliothèque de Modèles",
  NewEditor: "Nouvel Éditeur",
  Node: "Nœud",
  "Node Search Box": "Boîte de Recherche de Nœud",
  "Node Widget": "Widget de Nœud",
  NodeInputConversionSubmenus: "Sous-menus de Conversion d'Entrée de Nœud",
  NodeLibrary: "Bibliothèque de Nœuds",
  Pointer: "Pointeur",
  Queue: "File d'Attente",
  QueueButton: "Bouton de File d'Attente",
  RerouteBeta: "Reroute Beta",
  Server: "Serveur",
  "Server-Config": "Config-Serveur",
  Settings: "Paramètres",
  Sidebar: "Barre Latérale",
  "Tree Explorer": "Explorateur d'Arbre",
  Validation: "Validation",
  Window: "Fenêtre",
  Workflow: "Flux de Travail"
};
const sideToolbar$4 = {
  browseTemplates: "Parcourir les modèles d'exemple",
  downloads: "Téléchargements",
  logout: "Déconnexion",
  modelLibrary: "Bibliothèque de modèles",
  newBlankWorkflow: "Créer un nouveau flux de travail vierge",
  nodeLibrary: "Bibliothèque de nœuds",
  nodeLibraryTab: {
    sortOrder: "Ordre de tri"
  },
  openWorkflow: "Ouvrir le flux de travail dans le système de fichiers local",
  queue: "File d'attente",
  queueTab: {
    backToAllTasks: "Retour à toutes les tâches",
    clearPendingTasks: "Effacer les tâches en attente",
    containImagePreview: "Remplir l'aperçu de l'image",
    coverImagePreview: "Adapter l'aperçu de l'image",
    filter: "Filtrer les sorties",
    filters: {
      hideCached: "Masquer le cache",
      hideCanceled: "Masquer les annulations"
    },
    showFlatList: "Afficher la liste plate"
  },
  themeToggle: "Changer de thème",
  workflowTab: {
    confirmDelete: "Êtes-vous sûr de vouloir supprimer ce flux de travail ?",
    confirmDeleteTitle: "Supprimer le flux de travail ?",
    confirmOverwrite: "Le fichier ci-dessous existe déjà. Souhaitez-vous le remplacer ?",
    confirmOverwriteTitle: "Écraser le fichier existant ?",
    deleteFailed: "La tentative de suppression du flux de travail a échoué.",
    deleteFailedTitle: "Échec de la suppression",
    deleted: "Flux de travail supprimé",
    dirtyClose: "Les fichiers ci-dessous ont été modifiés. Souhaitez-vous les enregistrer avant de fermer ?",
    dirtyCloseTitle: "Enregistrer les modifications ?",
    workflowTreeType: {
      bookmarks: "Favoris",
      browse: "Parcourir",
      open: "Ouvrir"
    }
  },
  workflows: "Flux de travail"
};
const tabMenu$4 = {
  closeOtherTabs: "Fermer les autres onglets",
  closeTab: "Fermer l'onglet",
  closeTabsToLeft: "Fermer les onglets à gauche",
  closeTabsToRight: "Fermer les onglets à droite",
  duplicateTab: "Dupliquer l'onglet"
};
const templateWorkflows$4 = {
  template: {
    "default": "Génération d'images",
    flux_schnell: "Flux Schnell",
    image2image: "Image à Image",
    upscale: "Upscale en 2 passes"
  },
  title: "Commencez avec un modèle"
};
const userSelect$4 = {
  enterUsername: "Entrez un nom d'utilisateur",
  existingUser: "Utilisateur existant",
  newUser: "Nouvel utilisateur",
  next: "Suivant",
  selectUser: "Sélectionnez un utilisateur"
};
const welcome$4 = {
  getStarted: "Commencer",
  title: "Bienvenue sur ComfyUI"
};
const workflowService$4 = {
  enterFilename: "Entrez le nom du fichier",
  exportWorkflow: "Exporter le flux de travail",
  saveWorkflow: "Enregistrer le flux de travail"
};
const fr = {
  color: color$4,
  dataTypes: dataTypes$4,
  desktopMenu: desktopMenu$4,
  downloadGit: downloadGit$4,
  electronFileDownload: electronFileDownload$4,
  g: g$4,
  graphCanvasMenu: graphCanvasMenu$4,
  groupNode: groupNode$4,
  icon: icon$4,
  install: install$4,
  menu: menu$4,
  menuLabels: menuLabels$4,
  nodeCategories: nodeCategories$4,
  nodeTemplates: nodeTemplates$4,
  notSupported: notSupported$4,
  serverConfig: serverConfig$4,
  serverConfigCategories: serverConfigCategories$4,
  serverConfigItems: serverConfigItems$4,
  serverStart: serverStart$4,
  settingsCategories: settingsCategories$4,
  sideToolbar: sideToolbar$4,
  tabMenu: tabMenu$4,
  templateWorkflows: templateWorkflows$4,
  userSelect: userSelect$4,
  welcome: welcome$4,
  workflowService: workflowService$4
};
const AddNoise$4 = {
  display_name: "AjouterBruit",
  inputs: {
    latent_image: {
      name: "image_latente"
    },
    model: {
      name: "modèle"
    },
    noise: {
      name: "bruit"
    },
    sigmas: {
      name: "sigmas"
    }
  }
};
const AlignYourStepsScheduler$4 = {
  display_name: "PlanificateurAlignezVosÉtapes",
  inputs: {
    denoise: {
      name: "débruitage"
    },
    model_type: {
      name: "type_de_modèle"
    },
    steps: {
      name: "étapes"
    }
  }
};
const BasicGuider$4 = {
  display_name: "GuideBasique",
  inputs: {
    conditioning: {
      name: "conditionnement"
    },
    model: {
      name: "modèle"
    }
  }
};
const BasicScheduler$4 = {
  display_name: "PlanificateurBasique",
  inputs: {
    denoise: {
      name: "débruitage"
    },
    model: {
      name: "modèle"
    },
    scheduler: {
      name: "planificateur"
    },
    steps: {
      name: "étapes"
    }
  }
};
const BetaSamplingScheduler$4 = {
  display_name: "PlanificateurÉchantillonnageBeta",
  inputs: {
    alpha: {
      name: "alpha"
    },
    beta: {
      name: "beta"
    },
    model: {
      name: "modèle"
    },
    steps: {
      name: "étapes"
    }
  }
};
const CFGGuider$4 = {
  display_name: "GuideCFG",
  inputs: {
    cfg: {
      name: "cfg"
    },
    model: {
      name: "modèle"
    },
    negative: {
      name: "négative"
    },
    positive: {
      name: "positive"
    }
  }
};
const CLIPAttentionMultiply$4 = {
  display_name: "MultiplierAttentionCLIP",
  inputs: {
    clip: {
      name: "clip"
    },
    k: {
      name: "k"
    },
    out: {
      name: "sortie"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const CLIPLoader$4 = {
  description: "[Recettes]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 / clip-g / clip-l\nstable_audio: t5\nmochi: t5",
  display_name: "Charger CLIP",
  inputs: {
    clip_name: {
      name: "clip_name"
    },
    type: {
      name: "type"
    }
  }
};
const CLIPMergeAdd$4 = {
  display_name: "CLIPMergeAdd",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    }
  }
};
const CLIPMergeSimple$4 = {
  display_name: "CLIPMergeSimple",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    ratio: {
      name: "ratio"
    }
  }
};
const CLIPMergeSubtract$4 = {
  display_name: "CLIPMergeSubtract",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    multiplier: {
      name: "multiplier"
    }
  }
};
const CLIPSave$4 = {
  display_name: "CLIPSave",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "filename_prefix"
    }
  }
};
const CLIPSetLastLayer$4 = {
  display_name: "CLIP Définir Dernière Couche",
  inputs: {
    clip: {
      name: "clip"
    },
    stop_at_clip_layer: {
      name: "stop_at_clip_layer"
    }
  }
};
const CLIPTextEncode$4 = {
  description: "Encode une invite de texte à l'aide d'un modèle CLIP en une intégration qui peut être utilisée pour guider le modèle de diffusion vers la génération d'images spécifiques.",
  display_name: "CLIP Text Encode (Prompt)",
  inputs: {
    clip: {
      name: "clip",
      tooltip: "Le modèle CLIP utilisé pour encoder le texte."
    },
    text: {
      name: "text",
      tooltip: "Le texte à encoder."
    }
  },
  outputs: {
    "0": {
      tooltip: "Une condition contenant le texte intégré utilisé pour guider le modèle de diffusion."
    }
  }
};
const CLIPTextEncodeControlnet$4 = {
  display_name: "CLIPTextEncodeControlnet",
  inputs: {
    clip: {
      name: "clip"
    },
    conditioning: {
      name: "conditioning"
    },
    text: {
      name: "text"
    }
  }
};
const CLIPTextEncodeFlux$4 = {
  display_name: "CLIPTextEncodeFlux",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_l: {
      name: "clip_l"
    },
    guidance: {
      name: "guidance"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeHunyuanDiT$4 = {
  display_name: "CLIPTextEncodeHunyuanDiT",
  inputs: {
    bert: {
      name: "bert"
    },
    clip: {
      name: "clip"
    },
    mt5xl: {
      name: "mt5xl"
    }
  }
};
const CLIPTextEncodePixArtAlpha$4 = {
  description: "Encode le texte et définit la condition de résolution pour PixArt Alpha. Ne s'applique pas à PixArt Sigma.",
  display_name: "CLIPTextEncodePixArtAlpha",
  inputs: {
    clip: {
      name: "clip"
    },
    height: {
      name: "height"
    },
    text: {
      name: "text"
    },
    width: {
      name: "width"
    }
  }
};
const CLIPTextEncodeSD3$4 = {
  display_name: "CLIPTextEncodeSD3",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_g: {
      name: "clip_g"
    },
    clip_l: {
      name: "clip_l"
    },
    empty_padding: {
      name: "remplissage_vide"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeSDXL$4 = {
  display_name: "CLIPTextEncodeSDXL",
  inputs: {
    clip: {
      name: "clip"
    },
    crop_h: {
      name: "crop_h"
    },
    crop_w: {
      name: "crop_w"
    },
    height: {
      name: "hauteur"
    },
    target_height: {
      name: "hauteur_cible"
    },
    target_width: {
      name: "largeur_cible"
    },
    text_g: {
      name: "text_g"
    },
    text_l: {
      name: "text_l"
    },
    width: {
      name: "largeur"
    }
  }
};
const CLIPTextEncodeSDXLRefiner$4 = {
  display_name: "CLIPTextEncodeSDXLRefiner",
  inputs: {
    ascore: {
      name: "ascore"
    },
    clip: {
      name: "clip"
    },
    height: {
      name: "hauteur"
    },
    text: {
      name: "texte"
    },
    width: {
      name: "largeur"
    }
  }
};
const CLIPVisionEncode$4 = {
  display_name: "CLIP Vision Encode",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    crop: {
      name: "crop"
    },
    image: {
      name: "image"
    }
  }
};
const CLIPVisionLoader$4 = {
  display_name: "Charger CLIP Vision",
  inputs: {
    clip_name: {
      name: "nom_clip"
    }
  }
};
const Canny$4 = {
  display_name: "Canny",
  inputs: {
    high_threshold: {
      name: "seuil_haut"
    },
    image: {
      name: "image"
    },
    low_threshold: {
      name: "seuil_bas"
    }
  }
};
const CheckpointLoader$4 = {
  display_name: "Charger Point de Contrôle Avec Config (OBSOLÈTE)",
  inputs: {
    ckpt_name: {
      name: "nom_ckpt"
    },
    config_name: {
      name: "nom_config"
    }
  }
};
const CheckpointLoaderSimple$4 = {
  description: "Charge un point de contrôle de modèle de diffusion, les modèles de diffusion sont utilisés pour débruiter les latents.",
  display_name: "Charger Point de Contrôle",
  inputs: {
    ckpt_name: {
      name: "nom_ckpt",
      tooltip: "Le nom du point de contrôle (modèle) à charger."
    }
  },
  outputs: {
    "0": {
      tooltip: "Le modèle utilisé pour débruiter les latents."
    },
    "1": {
      tooltip: "Le modèle CLIP utilisé pour encoder les invites de texte."
    },
    "2": {
      tooltip: "Le modèle VAE utilisé pour encoder et décoder les images en espace latent et vice versa."
    }
  }
};
const CheckpointSave$4 = {
  display_name: "Sauvegarder Point de Contrôle",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "préfixe_nom_fichier"
    },
    model: {
      name: "modèle"
    },
    vae: {
      name: "vae"
    }
  }
};
const CombineHooks2$4 = {
  display_name: "Combiner Hooks [2]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    }
  }
};
const CombineHooks4$4 = {
  display_name: "Combiner Hooks [4]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    },
    hooks_C: {
      name: "hooks_C"
    },
    hooks_D: {
      name: "hooks_D"
    }
  }
};
const CombineHooks8$4 = {
  display_name: "Combiner Hooks [8]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    },
    hooks_C: {
      name: "hooks_C"
    },
    hooks_D: {
      name: "hooks_D"
    },
    hooks_E: {
      name: "hooks_E"
    },
    hooks_F: {
      name: "hooks_F"
    },
    hooks_G: {
      name: "hooks_G"
    },
    hooks_H: {
      name: "hooks_H"
    }
  }
};
const ConditioningAverage$4 = {
  display_name: "Moyenne de Conditionnement",
  inputs: {
    conditioning_from: {
      name: "conditionnement_de"
    },
    conditioning_to: {
      name: "conditionnement_à"
    },
    conditioning_to_strength: {
      name: "force_conditionnement_à"
    }
  }
};
const ConditioningCombine$4 = {
  display_name: "Conditionnement (Combiner)",
  inputs: {
    conditioning_1: {
      name: "conditionnement_1"
    },
    conditioning_2: {
      name: "conditionnement_2"
    }
  }
};
const ConditioningConcat$4 = {
  display_name: "Conditionnement (Concat)",
  inputs: {
    conditioning_from: {
      name: "conditionnement_de"
    },
    conditioning_to: {
      name: "conditionnement_vers"
    }
  }
};
const ConditioningSetArea$4 = {
  display_name: "Conditionnement (Définir Zone)",
  inputs: {
    conditioning: {
      name: "conditionnement"
    },
    height: {
      name: "hauteur"
    },
    strength: {
      name: "force"
    },
    width: {
      name: "largeur"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaPercentage$4 = {
  display_name: "Conditionnement (Définir Zone avec Pourcentage)",
  inputs: {
    conditioning: {
      name: "conditionnement"
    },
    height: {
      name: "hauteur"
    },
    strength: {
      name: "force"
    },
    width: {
      name: "largeur"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaStrength$4 = {
  display_name: "ConditionnementDéfinirForceZone",
  inputs: {
    conditioning: {
      name: "conditionnement"
    },
    strength: {
      name: "force"
    }
  }
};
const ConditioningSetDefaultCombine$4 = {
  display_name: "Cond Définir Combinaison par Défaut",
  inputs: {
    cond: {
      name: "cond"
    },
    cond_DEFAULT: {
      name: "cond_DEFAULT"
    },
    hooks: {
      name: "hooks"
    }
  }
};
const ConditioningSetMask$4 = {
  display_name: "Conditionnement (Définir Masque)",
  inputs: {
    conditioning: {
      name: "conditionnement"
    },
    mask: {
      name: "masque"
    },
    set_cond_area: {
      name: "définir_zone_cond"
    },
    strength: {
      name: "force"
    }
  }
};
const ConditioningSetProperties$4 = {
  display_name: "Cond Définir Propriétés",
  inputs: {
    cond_NEW: {
      name: "cond_NOUVEAU"
    },
    hooks: {
      name: "hooks"
    },
    mask: {
      name: "masque"
    },
    set_cond_area: {
      name: "définir_zone_cond"
    },
    strength: {
      name: "force"
    },
    timesteps: {
      name: "pas_de_temps"
    }
  }
};
const ConditioningSetPropertiesAndCombine$4 = {
  display_name: "Cond Définir Propriétés Combinaison",
  inputs: {
    cond: {
      name: "cond"
    },
    cond_NEW: {
      name: "cond_NOUVEAU"
    },
    hooks: {
      name: "hooks"
    },
    mask: {
      name: "masque"
    },
    set_cond_area: {
      name: "définir_zone_cond"
    },
    strength: {
      name: "force"
    },
    timesteps: {
      name: "pas_de_temps"
    }
  }
};
const ConditioningSetTimestepRange$4 = {
  display_name: "ConditionnementDéfinirPlagePasDeTemps",
  inputs: {
    conditioning: {
      name: "conditionnement"
    },
    end: {
      name: "fin"
    },
    start: {
      name: "début"
    }
  }
};
const ConditioningStableAudio$4 = {
  display_name: "ConditionnementStableAudio",
  inputs: {
    negative: {
      name: "négative"
    },
    positive: {
      name: "positive"
    },
    seconds_start: {
      name: "secondes_début"
    },
    seconds_total: {
      name: "secondes_total"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "négative"
    }
  }
};
const ConditioningTimestepsRange$4 = {
  display_name: "Plage de pas de temps",
  inputs: {
    end_percent: {
      name: "end_percent"
    },
    start_percent: {
      name: "start_percent"
    }
  },
  outputs: {
    "1": {
      name: "AVANT_PLAGE"
    },
    "2": {
      name: "APRÈS_PLAGE"
    }
  }
};
const ConditioningZeroOut$4 = {
  display_name: "ConditioningZeroOut",
  inputs: {
    conditioning: {
      name: "conditioning"
    }
  }
};
const ControlNetApply$4 = {
  display_name: "Appliquer ControlNet (ANCIEN)",
  inputs: {
    conditioning: {
      name: "conditioning"
    },
    control_net: {
      name: "control_net"
    },
    image: {
      name: "image"
    },
    strength: {
      name: "strength"
    }
  }
};
const ControlNetApplyAdvanced$4 = {
  display_name: "Appliquer ControlNet",
  inputs: {
    control_net: {
      name: "control_net"
    },
    end_percent: {
      name: "end_percent"
    },
    image: {
      name: "image"
    },
    negative: {
      name: "negative"
    },
    positive: {
      name: "positive"
    },
    start_percent: {
      name: "start_percent"
    },
    strength: {
      name: "strength"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const ControlNetApplySD3$4 = {
  display_name: "Appliquer Controlnet avec VAE",
  inputs: {
    control_net: {
      name: "control_net"
    },
    end_percent: {
      name: "end_percent"
    },
    image: {
      name: "image"
    },
    negative: {
      name: "negative"
    },
    positive: {
      name: "positive"
    },
    start_percent: {
      name: "start_percent"
    },
    strength: {
      name: "strength"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const ControlNetInpaintingAliMamaApply$4 = {
  display_name: "ControlNetInpaintingAliMamaApply",
  inputs: {
    control_net: {
      name: "control_net"
    },
    end_percent: {
      name: "end_percent"
    },
    image: {
      name: "image"
    },
    mask: {
      name: "mask"
    },
    negative: {
      name: "negative"
    },
    positive: {
      name: "positive"
    },
    start_percent: {
      name: "start_percent"
    },
    strength: {
      name: "strength"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const ControlNetLoader$4 = {
  display_name: "Charger le modèle ControlNet",
  inputs: {
    control_net_name: {
      name: "control_net_name"
    }
  }
};
const CreateHookKeyframe$4 = {
  display_name: "Créer une image clé de crochet",
  inputs: {
    prev_hook_kf: {
      name: "prev_hook_kf"
    },
    start_percent: {
      name: "start_percent"
    },
    strength_mult: {
      name: "strength_mult"
    }
  },
  outputs: {
    "0": {
      name: "HOOK_KF"
    }
  }
};
const CreateHookKeyframesFromFloats$4 = {
  display_name: "Créer des images clés de crochet à partir de flottants",
  inputs: {
    end_percent: {
      name: "pourcentage_fin"
    },
    floats_strength: {
      name: "force_flottants"
    },
    prev_hook_kf: {
      name: "precedent_crochet_kf"
    },
    print_keyframes: {
      name: "imprimer_images_cles"
    },
    start_percent: {
      name: "pourcentage_debut"
    }
  },
  outputs: {
    "0": {
      name: "CROCHET_KF"
    }
  }
};
const CreateHookKeyframesInterpolated$4 = {
  display_name: "Créer des images clés de crochet interpolées.",
  inputs: {
    end_percent: {
      name: "pourcentage_fin"
    },
    interpolation: {
      name: "interpolation"
    },
    keyframes_count: {
      name: "compte_images_cles"
    },
    prev_hook_kf: {
      name: "precedent_crochet_kf"
    },
    print_keyframes: {
      name: "imprimer_images_cles"
    },
    start_percent: {
      name: "pourcentage_debut"
    },
    strength_end: {
      name: "force_fin"
    },
    strength_start: {
      name: "force_debut"
    }
  },
  outputs: {
    "0": {
      name: "CROCHET_KF"
    }
  }
};
const CreateHookLora$4 = {
  display_name: "Créer un crochet LoRA",
  inputs: {
    lora_name: {
      name: "nom_lora"
    },
    prev_hooks: {
      name: "crochets_precedents"
    },
    strength_clip: {
      name: "force_clip"
    },
    strength_model: {
      name: "force_modele"
    }
  }
};
const CreateHookLoraModelOnly$4 = {
  display_name: "Créer un crochet LoRA (MO)",
  inputs: {
    lora_name: {
      name: "nom_lora"
    },
    prev_hooks: {
      name: "crochets_precedents"
    },
    strength_model: {
      name: "force_modele"
    }
  }
};
const CreateHookModelAsLora$4 = {
  display_name: "Créer un modèle de crochet comme LoRA",
  inputs: {
    ckpt_name: {
      name: "nom_ckpt"
    },
    prev_hooks: {
      name: "crochets_precedents"
    },
    strength_clip: {
      name: "force_clip"
    },
    strength_model: {
      name: "force_modele"
    }
  }
};
const CreateHookModelAsLoraModelOnly$4 = {
  display_name: "Créer un modèle de crochet comme LoRA (MO)",
  inputs: {
    ckpt_name: {
      name: "nom_ckpt"
    },
    prev_hooks: {
      name: "crochets_precedents"
    },
    strength_model: {
      name: "force_modele"
    }
  }
};
const CropMask$4 = {
  display_name: "CropMask",
  inputs: {
    height: {
      name: "hauteur"
    },
    mask: {
      name: "masque"
    },
    width: {
      name: "largeur"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const DevToolsDeprecatedNode$4 = {
  description: "Un nœud obsolète",
  display_name: "Nœud obsolète"
};
const DevToolsErrorRaiseNode$4 = {
  description: "Lever une erreur à des fins de développement",
  display_name: "Lever une erreur"
};
const DevToolsErrorRaiseNodeWithMessage$4 = {
  description: "Lever une erreur avec un message à des fins de développement",
  display_name: "Lever une erreur avec un message",
  inputs: {
    message: {
      name: "message"
    }
  }
};
const DevToolsExperimentalNode$4 = {
  description: "Un nœud expérimental",
  display_name: "Nœud expérimental"
};
const DevToolsLongComboDropdown$4 = {
  description: "Un long combo déroulant",
  display_name: "Long Combo Dropdown",
  inputs: {
    option: {
      name: "option"
    }
  }
};
const DevToolsNodeWithForceInput$4 = {
  description: "Un nœud avec une entrée forcée",
  display_name: "Nœud avec entrée forcée",
  inputs: {
    float_input: {
      name: "float_input"
    },
    int_input: {
      name: "int_input"
    },
    int_input_widget: {
      name: "int_input_widget"
    }
  }
};
const DevToolsNodeWithOnlyOptionalInput$4 = {
  description: "Un nœud avec seulement une entrée optionnelle",
  display_name: "Nœud avec seulement une entrée optionnelle",
  inputs: {
    clip: {
      name: "clip"
    },
    text: {
      name: "text"
    }
  }
};
const DevToolsNodeWithOptionalInput$4 = {
  description: "Un nœud avec une entrée optionnelle",
  display_name: "Nœud avec entrée optionnelle",
  inputs: {
    optional_input: {
      name: "optional_input"
    },
    required_input: {
      name: "required_input"
    }
  }
};
const DevToolsNodeWithOutputList$4 = {
  description: "Un nœud avec une liste de sortie",
  display_name: "Nœud avec liste de sortie",
  outputs: {
    "0": {
      name: "SORTIE ENTIER"
    },
    "1": {
      name: "SORTIE LISTE ENTIER"
    }
  }
};
const DevToolsNodeWithStringInput$4 = {
  description: "Un nœud avec une entrée de chaîne",
  display_name: "Nœud avec entrée de chaîne",
  inputs: {
    string_input: {
      name: "string_input"
    }
  }
};
const DevToolsNodeWithUnionInput$4 = {
  description: "Un nœud avec une entrée d'union",
  display_name: "Nœud avec entrée d'union",
  inputs: {
    int_input: {
      name: "int_input"
    },
    string_input: {
      name: "string_input"
    },
    string_or_int_input: {
      name: "string_or_int_input"
    }
  }
};
const DevToolsSimpleSlider$4 = {
  display_name: "Curseur simple",
  inputs: {
    value: {
      name: "valeur"
    }
  }
};
const DiffControlNetLoader$4 = {
  display_name: "Charger le modèle ControlNet (diff)",
  inputs: {
    control_net_name: {
      name: "nom_control_net"
    },
    model: {
      name: "modèle"
    }
  }
};
const DifferentialDiffusion$4 = {
  display_name: "Diffusion différentielle",
  inputs: {
    model: {
      name: "modèle"
    }
  }
};
const DiffusersLoader$4 = {
  display_name: "Chargeur de diffuseurs",
  inputs: {
    model_path: {
      name: "chemin_modèle"
    }
  }
};
const DisableNoise$4 = {
  display_name: "DésactiverBruit"
};
const DualCFGGuider$4 = {
  display_name: "GuideurDualCFG",
  inputs: {
    cfg_cond2_negative: {
      name: "cfg_cond2_négatif"
    },
    cfg_conds: {
      name: "cfg_conds"
    },
    cond1: {
      name: "cond1"
    },
    cond2: {
      name: "cond2"
    },
    model: {
      name: "modèle"
    },
    negative: {
      name: "négatif"
    }
  }
};
const DualCLIPLoader$4 = {
  description: "[Recettes]\n\nsdxl: clip-l, clip-g\nsd3: clip-l, clip-g / clip-l, t5 / clip-g, t5\nflux: clip-l, t5",
  display_name: "ChargeurDualCLIP",
  inputs: {
    clip_name1: {
      name: "nom_clip1"
    },
    clip_name2: {
      name: "nom_clip2"
    },
    type: {
      name: "type"
    }
  }
};
const EmptyHunyuanLatentVideo$4 = {
  display_name: "EmptyHunyuanLatentVideo",
  inputs: {
    batch_size: {
      name: "taille_du_lot"
    },
    height: {
      name: "hauteur"
    },
    length: {
      name: "longueur"
    },
    width: {
      name: "largeur"
    }
  }
};
const EmptyImage$4 = {
  display_name: "ImageVide",
  inputs: {
    batch_size: {
      name: "taille_du_lot"
    },
    color: {
      name: "couleur"
    },
    height: {
      name: "hauteur"
    },
    width: {
      name: "largeur"
    }
  }
};
const EmptyLTXVLatentVideo$4 = {
  display_name: "EmptyLTXVLatentVideo",
  inputs: {
    batch_size: {
      name: "taille_du_lot"
    },
    height: {
      name: "hauteur"
    },
    length: {
      name: "longueur"
    },
    width: {
      name: "largeur"
    }
  }
};
const EmptyLatentAudio$4 = {
  display_name: "AudioLatentVide",
  inputs: {
    batch_size: {
      name: "taille_du_lot",
      tooltip: "Le nombre d'images latentes dans le lot."
    },
    seconds: {
      name: "secondes"
    }
  }
};
const EmptyLatentImage$4 = {
  description: "Créez un nouveau lot d'images latentes vides à débruiter via l'échantillonnage.",
  display_name: "Image Latente Vide",
  inputs: {
    batch_size: {
      name: "taille_du_lot",
      tooltip: "Le nombre d'images latentes dans le lot."
    },
    height: {
      name: "hauteur",
      tooltip: "La hauteur des images latentes en pixels."
    },
    width: {
      name: "largeur",
      tooltip: "La largeur des images latentes en pixels."
    }
  },
  outputs: {
    "0": {
      tooltip: "Le lot d'images latentes vides."
    }
  }
};
const EmptyMochiLatentVideo$4 = {
  display_name: "EmptyMochiLatentVideo",
  inputs: {
    batch_size: {
      name: "taille_du_lot"
    },
    height: {
      name: "hauteur"
    },
    length: {
      name: "longueur"
    },
    width: {
      name: "largeur"
    }
  }
};
const EmptySD3LatentImage$4 = {
  display_name: "EmptySD3LatentImage",
  inputs: {
    batch_size: {
      name: "taille_du_lot"
    },
    height: {
      name: "hauteur"
    },
    width: {
      name: "largeur"
    }
  }
};
const ExponentialScheduler$4 = {
  display_name: "PlanificateurExponentiel",
  inputs: {
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "étapes"
    }
  }
};
const FeatherMask$4 = {
  display_name: "MasquePlume",
  inputs: {
    bottom: {
      name: "bas"
    },
    left: {
      name: "gauche"
    },
    mask: {
      name: "masque"
    },
    right: {
      name: "droite"
    },
    top: {
      name: "haut"
    }
  }
};
const FlipSigmas$4 = {
  display_name: "InverserSigmas",
  inputs: {
    sigmas: {
      name: "sigmas"
    }
  }
};
const FluxGuidance$4 = {
  display_name: "GuidageFlux",
  inputs: {
    conditioning: {
      name: "conditionnement"
    },
    guidance: {
      name: "guidage"
    }
  }
};
const FreeU$4 = {
  display_name: "FreeU",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "modèle"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const FreeU_V2$4 = {
  display_name: "FreeU_V2",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "modèle"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const GITSScheduler$4 = {
  display_name: "GITSScheduler",
  inputs: {
    coeff: {
      name: "coeff"
    },
    denoise: {
      name: "débruitage"
    },
    steps: {
      name: "étapes"
    }
  }
};
const GLIGENLoader$4 = {
  display_name: "GLIGENLoader",
  inputs: {
    gligen_name: {
      name: "nom_gligen"
    }
  }
};
const GLIGENTextBoxApply$4 = {
  display_name: "GLIGENTextBoxApply",
  inputs: {
    clip: {
      name: "clip"
    },
    conditioning_to: {
      name: "conditionnement_à"
    },
    gligen_textbox_model: {
      name: "modèle_boîte_texte_gligen"
    },
    height: {
      name: "hauteur"
    },
    text: {
      name: "texte"
    },
    width: {
      name: "largeur"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const GrowMask$4 = {
  display_name: "GrowMask",
  inputs: {
    expand: {
      name: "agrandir"
    },
    mask: {
      name: "masque"
    },
    tapered_corners: {
      name: "coins_évasés"
    }
  }
};
const HyperTile$4 = {
  display_name: "HyperTile",
  inputs: {
    max_depth: {
      name: "profondeur_max"
    },
    model: {
      name: "modèle"
    },
    scale_depth: {
      name: "échelle_profondeur"
    },
    swap_size: {
      name: "taille_échange"
    },
    tile_size: {
      name: "taille_tuile"
    }
  }
};
const HypernetworkLoader$4 = {
  display_name: "HypernetworkLoader",
  inputs: {
    hypernetwork_name: {
      name: "nom_hypernetwork"
    },
    model: {
      name: "modèle"
    },
    strength: {
      name: "force"
    }
  }
};
const ImageBatch$4 = {
  display_name: "Images en lot",
  inputs: {
    image1: {
      name: "image1"
    },
    image2: {
      name: "image2"
    }
  }
};
const ImageBlend$4 = {
  display_name: "Mélange d'images",
  inputs: {
    blend_factor: {
      name: "facteur_mélange"
    },
    blend_mode: {
      name: "mode_mélange"
    },
    image1: {
      name: "image1"
    },
    image2: {
      name: "image2"
    }
  }
};
const ImageBlur$4 = {
  display_name: "Flou d'image",
  inputs: {
    blur_radius: {
      name: "rayon_flou"
    },
    image: {
      name: "image"
    },
    sigma: {
      name: "sigma"
    }
  }
};
const ImageColorToMask$4 = {
  display_name: "ImageCouleurEnMasque",
  inputs: {
    color: {
      name: "couleur"
    },
    image: {
      name: "image"
    }
  }
};
const ImageCompositeMasked$4 = {
  display_name: "ImageCompositeMasked",
  inputs: {
    destination: {
      name: "destination"
    },
    mask: {
      name: "masque"
    },
    resize_source: {
      name: "redimensionner_source"
    },
    source: {
      name: "source"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageCrop$4 = {
  display_name: "Rogner l'image",
  inputs: {
    height: {
      name: "hauteur"
    },
    image: {
      name: "image"
    },
    width: {
      name: "largeur"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageFromBatch$4 = {
  display_name: "ImageDeBatch",
  inputs: {
    batch_index: {
      name: "index_de_lot"
    },
    image: {
      name: "image"
    },
    length: {
      name: "longueur"
    }
  }
};
const ImageInvert$4 = {
  display_name: "Inverser l'image",
  inputs: {
    image: {
      name: "image"
    }
  }
};
const ImageOnlyCheckpointLoader$4 = {
  display_name: "Chargeur de points de contrôle uniquement pour image (modèle img2vid)",
  inputs: {
    ckpt_name: {
      name: "nom_ckpt"
    }
  }
};
const ImageOnlyCheckpointSave$4 = {
  display_name: "ImageOnlyCheckpointSave",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    filename_prefix: {
      name: "préfixe_de_nom_de_fichier"
    },
    model: {
      name: "modèle"
    },
    vae: {
      name: "vae"
    }
  }
};
const ImagePadForOutpaint$4 = {
  display_name: "Rembourrage d'image pour la peinture extérieure",
  inputs: {
    bottom: {
      name: "bas"
    },
    feathering: {
      name: "adoucissement"
    },
    image: {
      name: "image"
    },
    left: {
      name: "gauche"
    },
    right: {
      name: "droite"
    },
    top: {
      name: "haut"
    }
  }
};
const ImageQuantize$4 = {
  display_name: "Quantification d'image",
  inputs: {
    colors: {
      name: "couleurs"
    },
    dither: {
      name: "dither"
    },
    image: {
      name: "image"
    }
  }
};
const ImageScale$4 = {
  display_name: "Agrandir l'image",
  inputs: {
    crop: {
      name: "crop"
    },
    height: {
      name: "hauteur"
    },
    image: {
      name: "image"
    },
    upscale_method: {
      name: "méthode_d'agrandissement"
    },
    width: {
      name: "largeur"
    }
  }
};
const ImageScaleBy$4 = {
  display_name: "Agrandir l'image par",
  inputs: {
    image: {
      name: "image"
    },
    scale_by: {
      name: "agrandir_par"
    },
    upscale_method: {
      name: "méthode_d'agrandissement"
    }
  }
};
const ImageScaleToTotalPixels$4 = {
  display_name: "Redimensionner l'image en fonction du nombre total de pixels",
  inputs: {
    image: {
      name: "image"
    },
    megapixels: {
      name: "mégapixels"
    },
    upscale_method: {
      name: "méthode_d'agrandissement"
    }
  }
};
const ImageSharpen$4 = {
  display_name: "Affiner l'image",
  inputs: {
    alpha: {
      name: "alpha"
    },
    image: {
      name: "image"
    },
    sharpen_radius: {
      name: "rayon_d'affûtage"
    },
    sigma: {
      name: "sigma"
    }
  }
};
const ImageToMask$4 = {
  display_name: "Convertir Image en Masque",
  inputs: {
    channel: {
      name: "canal"
    },
    image: {
      name: "image"
    }
  }
};
const ImageUpscaleWithModel$4 = {
  display_name: "Agrandir l'Image (à l'aide du Modèle)",
  inputs: {
    image: {
      name: "image"
    },
    upscale_model: {
      name: "modèle_d'agrandissement"
    }
  }
};
const InpaintModelConditioning$4 = {
  display_name: "InpaintModelConditioning",
  inputs: {
    mask: {
      name: "masque"
    },
    negative: {
      name: "négatif"
    },
    noise_mask: {
      name: "masque_de_bruit",
      tooltip: "Ajoutez un masque de bruit au latent pour que l'échantillonnage ne se produise que dans le masque. Peut améliorer les résultats ou complètement les détruire en fonction du modèle."
    },
    pixels: {
      name: "pixels"
    },
    positive: {
      name: "positive"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "négatif"
    },
    "2": {
      name: "latent"
    }
  }
};
const InstructPixToPixConditioning$4 = {
  display_name: "InstructPixToPixConditioning",
  inputs: {
    negative: {
      name: "négatif"
    },
    pixels: {
      name: "pixels"
    },
    positive: {
      name: "positive"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "négatif"
    },
    "2": {
      name: "latent"
    }
  }
};
const InvertMask$4 = {
  display_name: "InverserMasque",
  inputs: {
    mask: {
      name: "masque"
    }
  }
};
const JoinImageWithAlpha$4 = {
  display_name: "Joindre Image avec Alpha",
  inputs: {
    alpha: {
      name: "alpha"
    },
    image: {
      name: "image"
    }
  }
};
const KSampler$4 = {
  description: "Utilise le modèle fourni, le conditionnement positif et négatif pour débruiter l'image latente.",
  display_name: "KSampler",
  inputs: {
    cfg: {
      name: "cfg",
      tooltip: "L'échelle de guidage sans classificateur équilibre la créativité et l'adhérence à l'invite. Des valeurs plus élevées donnent des images correspondant plus étroitement à l'invite, cependant des valeurs trop élevées auront un impact négatif sur la qualité."
    },
    denoise: {
      name: "denoise",
      tooltip: "La quantité de débruitage appliquée, des valeurs plus faibles maintiendront la structure de l'image initiale permettant un échantillonnage d'image à image."
    },
    latent_image: {
      name: "latent_image",
      tooltip: "L'image latente à débruiter."
    },
    model: {
      name: "model",
      tooltip: "Le modèle utilisé pour débruiter l'entrée latente."
    },
    negative: {
      name: "negative",
      tooltip: "Le conditionnement décrivant les attributs que vous voulez exclure de l'image."
    },
    positive: {
      name: "positive",
      tooltip: "Le conditionnement décrivant les attributs que vous voulez inclure dans l'image."
    },
    sampler_name: {
      name: "sampler_name",
      tooltip: "L'algorithme utilisé lors de l'échantillonnage, cela peut affecter la qualité, la vitesse et le style de la sortie générée."
    },
    scheduler: {
      name: "scheduler",
      tooltip: "Le planificateur contrôle comment le bruit est progressivement éliminé pour former l'image."
    },
    seed: {
      name: "seed",
      tooltip: "La graine aléatoire utilisée pour créer le bruit."
    },
    steps: {
      name: "steps",
      tooltip: "Le nombre d'étapes utilisées dans le processus de débruitage."
    }
  },
  outputs: {
    "0": {
      tooltip: "Le latent débruité."
    }
  }
};
const KSamplerAdvanced$4 = {
  display_name: "KSampler (Avancé)",
  inputs: {
    add_noise: {
      name: "add_noise"
    },
    cfg: {
      name: "cfg"
    },
    end_at_step: {
      name: "end_at_step"
    },
    latent_image: {
      name: "latent_image"
    },
    model: {
      name: "model"
    },
    negative: {
      name: "negative"
    },
    noise_seed: {
      name: "noise_seed"
    },
    positive: {
      name: "positive"
    },
    return_with_leftover_noise: {
      name: "return_with_leftover_noise"
    },
    sampler_name: {
      name: "sampler_name"
    },
    scheduler: {
      name: "scheduler"
    },
    start_at_step: {
      name: "start_at_step"
    },
    steps: {
      name: "steps"
    }
  }
};
const KSamplerSelect$4 = {
  display_name: "KSamplerSelect",
  inputs: {
    sampler_name: {
      name: "sampler_name"
    }
  }
};
const KarrasScheduler$4 = {
  display_name: "PlanificateurKarras",
  inputs: {
    rho: {
      name: "rho"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "étapes"
    }
  }
};
const LTXVConditioning$4 = {
  display_name: "LTXVConditioning",
  inputs: {
    frame_rate: {
      name: "frame_rate"
    },
    negative: {
      name: "negative"
    },
    positive: {
      name: "positive"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const LTXVImgToVideo$4 = {
  display_name: "LTXVImgToVideo",
  inputs: {
    batch_size: {
      name: "batch_size"
    },
    height: {
      name: "height"
    },
    image: {
      name: "image"
    },
    image_noise_scale: {
      name: "image_noise_scale",
      tooltip: "Quantité de bruit à appliquer sur le latent de l'image de conditionnement."
    },
    length: {
      name: "length"
    },
    negative: {
      name: "negative"
    },
    positive: {
      name: "positive"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "width"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    },
    "2": {
      name: "latent"
    }
  }
};
const LTXVScheduler$4 = {
  display_name: "LTXVScheduler",
  inputs: {
    base_shift: {
      name: "décalage_base"
    },
    latent: {
      name: "latent"
    },
    max_shift: {
      name: "décalage_max"
    },
    steps: {
      name: "étapes"
    },
    stretch: {
      name: "étirement",
      tooltip: "Étirez les sigmas pour être dans la plage [terminal, 1]."
    },
    terminal: {
      name: "terminal",
      tooltip: "La valeur terminale des sigmas après étirement."
    }
  }
};
const LaplaceScheduler$4 = {
  display_name: "LaplaceScheduler",
  inputs: {
    beta: {
      name: "beta"
    },
    mu: {
      name: "mu"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "steps"
    }
  }
};
const LatentAdd$4 = {
  display_name: "LatentAdd",
  inputs: {
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    }
  }
};
const LatentApplyOperation$4 = {
  display_name: "LatentApplyOperation",
  inputs: {
    operation: {
      name: "operation"
    },
    samples: {
      name: "samples"
    }
  }
};
const LatentApplyOperationCFG$4 = {
  display_name: "LatentApplyOperationCFG",
  inputs: {
    model: {
      name: "model"
    },
    operation: {
      name: "operation"
    }
  }
};
const LatentBatch$4 = {
  display_name: "LatentBatch",
  inputs: {
    samples1: {
      name: "échantillons1"
    },
    samples2: {
      name: "échantillons2"
    }
  }
};
const LatentBatchSeedBehavior$4 = {
  display_name: "Comportement de la Graine LatentBatch",
  inputs: {
    samples: {
      name: "échantillons"
    },
    seed_behavior: {
      name: "comportement_de_graine"
    }
  }
};
const LatentBlend$4 = {
  display_name: "Mélange Latent",
  inputs: {
    blend_factor: {
      name: "facteur_de_mélange"
    },
    samples1: {
      name: "échantillons1"
    },
    samples2: {
      name: "échantillons2"
    }
  }
};
const LatentComposite$4 = {
  display_name: "Composite Latent",
  inputs: {
    feather: {
      name: "plume"
    },
    samples_from: {
      name: "échantillons_de"
    },
    samples_to: {
      name: "échantillons_vers"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCompositeMasked$4 = {
  display_name: "Composite Latent Masqué",
  inputs: {
    destination: {
      name: "destination"
    },
    mask: {
      name: "masque"
    },
    resize_source: {
      name: "redimensionner_source"
    },
    source: {
      name: "source"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCrop$4 = {
  display_name: "Couper Latent",
  inputs: {
    height: {
      name: "hauteur"
    },
    samples: {
      name: "échantillons"
    },
    width: {
      name: "largeur"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentFlip$4 = {
  display_name: "Retourner Latent",
  inputs: {
    flip_method: {
      name: "méthode_de_retournement"
    },
    samples: {
      name: "échantillons"
    }
  }
};
const LatentFromBatch$4 = {
  display_name: "Latent De Batch",
  inputs: {
    batch_index: {
      name: "index_de_batch"
    },
    length: {
      name: "longueur"
    },
    samples: {
      name: "échantillons"
    }
  }
};
const LatentInterpolate$4 = {
  display_name: "Interpoler Latent",
  inputs: {
    ratio: {
      name: "ratio"
    },
    samples1: {
      name: "échantillons1"
    },
    samples2: {
      name: "échantillons2"
    }
  }
};
const LatentMultiply$4 = {
  display_name: "Multiplier Latent",
  inputs: {
    multiplier: {
      name: "multiplicateur"
    },
    samples: {
      name: "échantillons"
    }
  }
};
const LatentOperationSharpen$4 = {
  display_name: "Opération d'Affûtage Latent",
  inputs: {
    alpha: {
      name: "alpha"
    },
    sharpen_radius: {
      name: "rayon_d'affûtage"
    },
    sigma: {
      name: "sigma"
    }
  }
};
const LatentOperationTonemapReinhard$4 = {
  display_name: "Opération de Mappage de Tons Reinhard Latent",
  inputs: {
    multiplier: {
      name: "multiplicateur"
    }
  }
};
const LatentRotate$4 = {
  display_name: "Tourner Latent",
  inputs: {
    rotation: {
      name: "rotation"
    },
    samples: {
      name: "échantillons"
    }
  }
};
const LatentSubtract$4 = {
  display_name: "Soustraction Latente",
  inputs: {
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    }
  }
};
const LatentUpscale$4 = {
  display_name: "Mise à l'échelle Latente",
  inputs: {
    crop: {
      name: "recadrage"
    },
    height: {
      name: "hauteur"
    },
    samples: {
      name: "samples"
    },
    upscale_method: {
      name: "méthode_de_mise_à_l'échelle"
    },
    width: {
      name: "largeur"
    }
  }
};
const LatentUpscaleBy$4 = {
  display_name: "Mise à l'échelle Latente Par",
  inputs: {
    samples: {
      name: "samples"
    },
    scale_by: {
      name: "mise_à_l'échelle_par"
    },
    upscale_method: {
      name: "méthode_de_mise_à_l'échelle"
    }
  }
};
const Load3D$4 = {
  display_name: "Charger 3D",
  inputs: {
    bg_color: {
      name: "couleur_de_fond"
    },
    camera_type: {
      name: "type_de_caméra"
    },
    height: {
      name: "hauteur"
    },
    image: {
      name: "image"
    },
    light_intensity: {
      name: "intensité_de_lumière"
    },
    material: {
      name: "matériel"
    },
    model_file: {
      name: "fichier_modèle"
    },
    show_grid: {
      name: "afficher_grille"
    },
    up_direction: {
      name: "direction_haut"
    },
    view: {
      name: "vue"
    },
    width: {
      name: "largeur"
    }
  },
  outputs: {
    "0": {
      name: "image"
    },
    "1": {
      name: "masque"
    },
    "2": {
      name: "chemin_maillage"
    }
  }
};
const Load3DAnimation$4 = {
  display_name: "Charger 3D - Animation",
  inputs: {
    animation_speed: {
      name: "vitesse_animation"
    },
    bg_color: {
      name: "couleur_de_fond"
    },
    camera_type: {
      name: "type_de_caméra"
    },
    height: {
      name: "hauteur"
    },
    image: {
      name: "image"
    },
    light_intensity: {
      name: "intensité_de_lumière"
    },
    material: {
      name: "matériel"
    },
    model_file: {
      name: "fichier_modèle"
    },
    show_grid: {
      name: "afficher_grille"
    },
    up_direction: {
      name: "direction_haut"
    },
    view: {
      name: "vue"
    },
    width: {
      name: "largeur"
    }
  },
  outputs: {
    "0": {
      name: "image"
    },
    "1": {
      name: "masque"
    },
    "2": {
      name: "chemin_maillage"
    }
  }
};
const LoadAudio$4 = {
  display_name: "ChargerAudio",
  inputs: {
    audio: {
      name: "audio"
    }
  }
};
const LoadImage$4 = {
  display_name: "Charger Image",
  inputs: {
    image: {
      name: "image"
    }
  }
};
const LoadImageMask$4 = {
  display_name: "Charger Image (comme Masque)",
  inputs: {
    channel: {
      name: "canal"
    },
    image: {
      name: "image"
    }
  }
};
const LoadLatent$4 = {
  display_name: "ChargerLatent",
  inputs: {
    latent: {
      name: "latent"
    }
  }
};
const LoraLoader$4 = {
  description: "Les LoRAs sont utilisés pour modifier les modèles de diffusion et CLIP, modifiant la manière dont les latents sont débruités comme l'application de styles. Plusieurs nœuds LoRA peuvent être liés ensemble.",
  display_name: "Charger LoRA",
  inputs: {
    clip: {
      name: "clip",
      tooltip: "Le modèle CLIP auquel le LoRA sera appliqué."
    },
    lora_name: {
      name: "lora_name",
      tooltip: "Le nom du LoRA."
    },
    model: {
      name: "model",
      tooltip: "Le modèle de diffusion auquel le LoRA sera appliqué."
    },
    strength_clip: {
      name: "strength_clip",
      tooltip: "À quel point modifier le modèle CLIP. Cette valeur peut être négative."
    },
    strength_model: {
      name: "strength_model",
      tooltip: "À quel point modifier le modèle de diffusion. Cette valeur peut être négative."
    }
  },
  outputs: {
    "0": {
      tooltip: "Le modèle de diffusion modifié."
    },
    "1": {
      tooltip: "Le modèle CLIP modifié."
    }
  }
};
const LoraLoaderModelOnly$4 = {
  description: "Les LoRAs sont utilisés pour modifier les modèles de diffusion et CLIP, modifiant la manière dont les latents sont débruités comme l'application de styles. Plusieurs nœuds LoRA peuvent être liés ensemble.",
  display_name: "LoraLoaderModelOnly",
  inputs: {
    lora_name: {
      name: "lora_name"
    },
    model: {
      name: "model"
    },
    strength_model: {
      name: "strength_model"
    }
  },
  outputs: {
    "0": {
      tooltip: "Le modèle de diffusion modifié."
    }
  }
};
const LoraSave$4 = {
  display_name: "Extraire et Sauvegarder Lora",
  inputs: {
    bias_diff: {
      name: "bias_diff"
    },
    filename_prefix: {
      name: "filename_prefix"
    },
    lora_type: {
      name: "lora_type"
    },
    model_diff: {
      name: "model_diff",
      tooltip: "La sortie ModelSubtract à convertir en lora."
    },
    rank: {
      name: "rank"
    },
    text_encoder_diff: {
      name: "text_encoder_diff",
      tooltip: "La sortie CLIPSubtract à convertir en lora."
    }
  }
};
const Mahiro$4 = {
  description: "Modifiez le guidage pour qu'il se concentre davantage sur la 'direction' de l'invite positive plutôt que sur la différence avec l'invite négative.",
  display_name: "Mahiro est si mignonne qu'elle mérite une meilleure fonction de guidage!! (。・ω・。)",
  inputs: {
    model: {
      name: "modèle"
    }
  },
  outputs: {
    "0": {
      name: "modèle_modifié"
    }
  }
};
const MaskComposite$4 = {
  display_name: "MaskComposite",
  inputs: {
    destination: {
      name: "destination"
    },
    operation: {
      name: "opération"
    },
    source: {
      name: "source"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const MaskToImage$4 = {
  display_name: "Convertir le masque en image",
  inputs: {
    mask: {
      name: "masque"
    }
  }
};
const ModelMergeAdd$4 = {
  display_name: "ModelMergeAdd",
  inputs: {
    model1: {
      name: "modèle1"
    },
    model2: {
      name: "modèle2"
    }
  }
};
const ModelMergeAuraflow$4 = {
  display_name: "ModelMergeAuraflow",
  inputs: {
    cond_seq_linear_: {
      name: "cond_seq_linear."
    },
    double_layers_0_: {
      name: "double_layers.0."
    },
    double_layers_1_: {
      name: "double_layers.1."
    },
    double_layers_2_: {
      name: "double_layers.2."
    },
    double_layers_3_: {
      name: "double_layers.3."
    },
    final_linear_: {
      name: "final_linear."
    },
    init_x_linear_: {
      name: "init_x_linear."
    },
    modF_: {
      name: "modF."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    positional_encoding: {
      name: "codage_positionnel"
    },
    register_tokens: {
      name: "enregistrer_tokens"
    },
    single_layers_0_: {
      name: "single_layers.0."
    },
    single_layers_10_: {
      name: "single_layers.10."
    },
    single_layers_11_: {
      name: "single_layers.11."
    },
    single_layers_12_: {
      name: "single_layers.12."
    },
    single_layers_13_: {
      name: "single_layers.13."
    },
    single_layers_14_: {
      name: "single_layers.14."
    },
    single_layers_15_: {
      name: "single_layers.15."
    },
    single_layers_16_: {
      name: "single_layers.16."
    },
    single_layers_17_: {
      name: "single_layers.17."
    },
    single_layers_18_: {
      name: "single_layers.18."
    },
    single_layers_19_: {
      name: "single_layers.19."
    },
    single_layers_1_: {
      name: "single_layers.1."
    },
    single_layers_20_: {
      name: "single_layers.20."
    },
    single_layers_21_: {
      name: "single_layers.21."
    },
    single_layers_22_: {
      name: "single_layers.22."
    },
    single_layers_23_: {
      name: "single_layers.23."
    },
    single_layers_24_: {
      name: "single_layers.24."
    },
    single_layers_25_: {
      name: "single_layers.25."
    },
    single_layers_26_: {
      name: "single_layers.26."
    },
    single_layers_27_: {
      name: "single_layers.27."
    },
    single_layers_28_: {
      name: "single_layers.28."
    },
    single_layers_29_: {
      name: "single_layers.29."
    },
    single_layers_2_: {
      name: "single_layers.2."
    },
    single_layers_30_: {
      name: "single_layers.30."
    },
    single_layers_31_: {
      name: "single_layers.31."
    },
    single_layers_3_: {
      name: "single_layers.3."
    },
    single_layers_4_: {
      name: "single_layers.4."
    },
    single_layers_5_: {
      name: "single_layers.5."
    },
    single_layers_6_: {
      name: "single_layers.6."
    },
    single_layers_7_: {
      name: "single_layers.7."
    },
    single_layers_8_: {
      name: "single_layers.8."
    },
    single_layers_9_: {
      name: "single_layers.9."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeBlocks$4 = {
  display_name: "ModelMergeBlocks",
  inputs: {
    input: {
      name: "entrée"
    },
    middle: {
      name: "milieu"
    },
    model1: {
      name: "modèle1"
    },
    model2: {
      name: "modèle2"
    },
    out: {
      name: "sortie"
    }
  }
};
const ModelMergeFlux1$4 = {
  display_name: "ModelMergeFlux1",
  inputs: {
    double_blocks_0_: {
      name: "double_blocks.0."
    },
    double_blocks_10_: {
      name: "double_blocks.10."
    },
    double_blocks_11_: {
      name: "double_blocks.11."
    },
    double_blocks_12_: {
      name: "double_blocks.12."
    },
    double_blocks_13_: {
      name: "double_blocks.13."
    },
    double_blocks_14_: {
      name: "double_blocks.14."
    },
    double_blocks_15_: {
      name: "double_blocks.15."
    },
    double_blocks_16_: {
      name: "double_blocks.16."
    },
    double_blocks_17_: {
      name: "double_blocks.17."
    },
    double_blocks_18_: {
      name: "double_blocks.18."
    },
    double_blocks_1_: {
      name: "double_blocks.1."
    },
    double_blocks_2_: {
      name: "double_blocks.2."
    },
    double_blocks_3_: {
      name: "double_blocks.3."
    },
    double_blocks_4_: {
      name: "double_blocks.4."
    },
    double_blocks_5_: {
      name: "double_blocks.5."
    },
    double_blocks_6_: {
      name: "double_blocks.6."
    },
    double_blocks_7_: {
      name: "double_blocks.7."
    },
    double_blocks_8_: {
      name: "double_blocks.8."
    },
    double_blocks_9_: {
      name: "double_blocks.9."
    },
    final_layer_: {
      name: "final_layer."
    },
    guidance_in: {
      name: "guidance_in"
    },
    img_in_: {
      name: "img_in."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    single_blocks_0_: {
      name: "single_blocks.0."
    },
    single_blocks_10_: {
      name: "single_blocks.10."
    },
    single_blocks_11_: {
      name: "single_blocks.11."
    },
    single_blocks_12_: {
      name: "single_blocks.12."
    },
    single_blocks_13_: {
      name: "single_blocks.13."
    },
    single_blocks_14_: {
      name: "single_blocks.14."
    },
    single_blocks_15_: {
      name: "single_blocks.15."
    },
    single_blocks_16_: {
      name: "single_blocks.16."
    },
    single_blocks_17_: {
      name: "single_blocks.17."
    },
    single_blocks_18_: {
      name: "single_blocks.18."
    },
    single_blocks_19_: {
      name: "single_blocks.19."
    },
    single_blocks_1_: {
      name: "single_blocks.1."
    },
    single_blocks_20_: {
      name: "single_blocks.20."
    },
    single_blocks_21_: {
      name: "single_blocks.21."
    },
    single_blocks_22_: {
      name: "single_blocks.22."
    },
    single_blocks_23_: {
      name: "single_blocks.23."
    },
    single_blocks_24_: {
      name: "single_blocks.24."
    },
    single_blocks_25_: {
      name: "single_blocks.25."
    },
    single_blocks_26_: {
      name: "single_blocks.26."
    },
    single_blocks_27_: {
      name: "single_blocks.27."
    },
    single_blocks_28_: {
      name: "single_blocks.28."
    },
    single_blocks_29_: {
      name: "single_blocks.29."
    },
    single_blocks_2_: {
      name: "single_blocks.2."
    },
    single_blocks_30_: {
      name: "single_blocks.30."
    },
    single_blocks_31_: {
      name: "single_blocks.31."
    },
    single_blocks_32_: {
      name: "single_blocks.32."
    },
    single_blocks_33_: {
      name: "single_blocks.33."
    },
    single_blocks_34_: {
      name: "single_blocks.34."
    },
    single_blocks_35_: {
      name: "single_blocks.35."
    },
    single_blocks_36_: {
      name: "single_blocks.36."
    },
    single_blocks_37_: {
      name: "single_blocks.37."
    },
    single_blocks_3_: {
      name: "single_blocks.3."
    },
    single_blocks_4_: {
      name: "single_blocks.4."
    },
    single_blocks_5_: {
      name: "single_blocks.5."
    },
    single_blocks_6_: {
      name: "single_blocks.6."
    },
    single_blocks_7_: {
      name: "single_blocks.7."
    },
    single_blocks_8_: {
      name: "single_blocks.8."
    },
    single_blocks_9_: {
      name: "single_blocks.9."
    },
    time_in_: {
      name: "time_in."
    },
    txt_in_: {
      name: "txt_in."
    },
    vector_in_: {
      name: "vector_in."
    }
  }
};
const ModelMergeLTXV$4 = {
  display_name: "ModelMergeLTXV",
  inputs: {
    adaln_single_: {
      name: "adaln_single."
    },
    caption_projection_: {
      name: "projection_de_légende."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    patchify_proj_: {
      name: "patchify_proj."
    },
    proj_out_: {
      name: "proj_out."
    },
    scale_shift_table: {
      name: "table_de_décalage_d'échelle"
    },
    transformer_blocks_0_: {
      name: "blocs_transformateurs.0."
    },
    transformer_blocks_10_: {
      name: "blocs_transformateurs.10."
    },
    transformer_blocks_11_: {
      name: "blocs_transformateurs.11."
    },
    transformer_blocks_12_: {
      name: "blocs_transformateurs.12."
    },
    transformer_blocks_13_: {
      name: "blocs_transformateurs.13."
    },
    transformer_blocks_14_: {
      name: "blocs_transformateurs.14."
    },
    transformer_blocks_15_: {
      name: "blocs_transformateurs.15."
    },
    transformer_blocks_16_: {
      name: "blocs_transformateurs.16."
    },
    transformer_blocks_17_: {
      name: "blocs_transformateurs.17."
    },
    transformer_blocks_18_: {
      name: "blocs_transformateurs.18."
    },
    transformer_blocks_19_: {
      name: "blocs_transformateurs.19."
    },
    transformer_blocks_1_: {
      name: "blocs_transformateurs.1."
    },
    transformer_blocks_20_: {
      name: "blocs_transformateurs.20."
    },
    transformer_blocks_21_: {
      name: "blocs_transformateurs.21."
    },
    transformer_blocks_22_: {
      name: "blocs_transformateurs.22."
    },
    transformer_blocks_23_: {
      name: "blocs_transformateurs.23."
    },
    transformer_blocks_24_: {
      name: "blocs_transformateurs.24."
    },
    transformer_blocks_25_: {
      name: "blocs_transformateurs.25."
    },
    transformer_blocks_26_: {
      name: "blocs_transformateurs.26."
    },
    transformer_blocks_27_: {
      name: "blocs_transformateurs.27."
    },
    transformer_blocks_2_: {
      name: "blocs_transformateurs.2."
    },
    transformer_blocks_3_: {
      name: "blocs_transformateurs.3."
    },
    transformer_blocks_4_: {
      name: "blocs_transformateurs.4."
    },
    transformer_blocks_5_: {
      name: "blocs_transformateurs.5."
    },
    transformer_blocks_6_: {
      name: "blocs_transformateurs.6."
    },
    transformer_blocks_7_: {
      name: "blocs_transformateurs.7."
    },
    transformer_blocks_8_: {
      name: "blocs_transformateurs.8."
    },
    transformer_blocks_9_: {
      name: "blocs_transformateurs.9."
    }
  }
};
const ModelMergeMochiPreview$4 = {
  display_name: "Aperçu de la Fusion de Modèles Mochi",
  inputs: {
    blocks_0_: {
      name: "blocs.0."
    },
    blocks_10_: {
      name: "blocs.10."
    },
    blocks_11_: {
      name: "blocs.11."
    },
    blocks_12_: {
      name: "blocs.12."
    },
    blocks_13_: {
      name: "blocs.13."
    },
    blocks_14_: {
      name: "blocs.14."
    },
    blocks_15_: {
      name: "blocs.15."
    },
    blocks_16_: {
      name: "blocs.16."
    },
    blocks_17_: {
      name: "blocs.17."
    },
    blocks_18_: {
      name: "blocs.18."
    },
    blocks_19_: {
      name: "blocs.19."
    },
    blocks_1_: {
      name: "blocs.1."
    },
    blocks_20_: {
      name: "blocs.20."
    },
    blocks_21_: {
      name: "blocs.21."
    },
    blocks_22_: {
      name: "blocs.22."
    },
    blocks_23_: {
      name: "blocs.23."
    },
    blocks_24_: {
      name: "blocs.24."
    },
    blocks_25_: {
      name: "blocs.25."
    },
    blocks_26_: {
      name: "blocs.26."
    },
    blocks_27_: {
      name: "blocs.27."
    },
    blocks_28_: {
      name: "blocs.28."
    },
    blocks_29_: {
      name: "blocs.29."
    },
    blocks_2_: {
      name: "blocs.2."
    },
    blocks_30_: {
      name: "blocs.30."
    },
    blocks_31_: {
      name: "blocs.31."
    },
    blocks_32_: {
      name: "blocs.32."
    },
    blocks_33_: {
      name: "blocs.33."
    },
    blocks_34_: {
      name: "blocs.34."
    },
    blocks_35_: {
      name: "blocs.35."
    },
    blocks_36_: {
      name: "blocs.36."
    },
    blocks_37_: {
      name: "blocs.37."
    },
    blocks_38_: {
      name: "blocs.38."
    },
    blocks_39_: {
      name: "blocs.39."
    },
    blocks_3_: {
      name: "blocs.3."
    },
    blocks_40_: {
      name: "blocs.40."
    },
    blocks_41_: {
      name: "blocs.41."
    },
    blocks_42_: {
      name: "blocs.42."
    },
    blocks_43_: {
      name: "blocs.43."
    },
    blocks_44_: {
      name: "blocs.44."
    },
    blocks_45_: {
      name: "blocs.45."
    },
    blocks_46_: {
      name: "blocs.46."
    },
    blocks_47_: {
      name: "blocs.47."
    },
    blocks_4_: {
      name: "blocs.4."
    },
    blocks_5_: {
      name: "blocs.5."
    },
    blocks_6_: {
      name: "blocs.6."
    },
    blocks_7_: {
      name: "blocs.7."
    },
    blocks_8_: {
      name: "blocs.8."
    },
    blocks_9_: {
      name: "blocs.9."
    },
    final_layer_: {
      name: "couche_finale."
    },
    model1: {
      name: "modèle1"
    },
    model2: {
      name: "modèle2"
    },
    pos_frequencies_: {
      name: "pos_frequences."
    },
    t5_y_embedder_: {
      name: "t5_y_embedder."
    },
    t5_yproj_: {
      name: "t5_yproj."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeSD1$4 = {
  display_name: "ModelMergeSD1",
  inputs: {
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0_: {
      name: "middle_block.0."
    },
    middle_block_1_: {
      name: "middle_block.1."
    },
    middle_block_2_: {
      name: "middle_block.2."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0_: {
      name: "output_blocks.0."
    },
    output_blocks_10_: {
      name: "output_blocks.10."
    },
    output_blocks_11_: {
      name: "output_blocks.11."
    },
    output_blocks_1_: {
      name: "output_blocks.1."
    },
    output_blocks_2_: {
      name: "output_blocks.2."
    },
    output_blocks_3_: {
      name: "output_blocks.3."
    },
    output_blocks_4_: {
      name: "output_blocks.4."
    },
    output_blocks_5_: {
      name: "output_blocks.5."
    },
    output_blocks_6_: {
      name: "output_blocks.6."
    },
    output_blocks_7_: {
      name: "output_blocks.7."
    },
    output_blocks_8_: {
      name: "output_blocks.8."
    },
    output_blocks_9_: {
      name: "output_blocks.9."
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSD2$4 = {
  display_name: "ModelMergeSD2",
  inputs: {
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0_: {
      name: "middle_block.0."
    },
    middle_block_1_: {
      name: "middle_block.1."
    },
    middle_block_2_: {
      name: "middle_block.2."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0_: {
      name: "output_blocks.0."
    },
    output_blocks_10_: {
      name: "output_blocks.10."
    },
    output_blocks_11_: {
      name: "output_blocks.11."
    },
    output_blocks_1_: {
      name: "output_blocks.1."
    },
    output_blocks_2_: {
      name: "output_blocks.2."
    },
    output_blocks_3_: {
      name: "output_blocks.3."
    },
    output_blocks_4_: {
      name: "output_blocks.4."
    },
    output_blocks_5_: {
      name: "output_blocks.5."
    },
    output_blocks_6_: {
      name: "output_blocks.6."
    },
    output_blocks_7_: {
      name: "output_blocks.7."
    },
    output_blocks_8_: {
      name: "output_blocks.8."
    },
    output_blocks_9_: {
      name: "output_blocks.9."
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSD35_Large$4 = {
  display_name: "ModelMergeSD35_Large",
  inputs: {
    context_embedder_: {
      name: "context_embedder."
    },
    final_layer_: {
      name: "final_layer."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_24_: {
      name: "joint_blocks.24."
    },
    joint_blocks_25_: {
      name: "joint_blocks.25."
    },
    joint_blocks_26_: {
      name: "joint_blocks.26."
    },
    joint_blocks_27_: {
      name: "joint_blocks.27."
    },
    joint_blocks_28_: {
      name: "joint_blocks.28."
    },
    joint_blocks_29_: {
      name: "joint_blocks.29."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_30_: {
      name: "joint_blocks.30."
    },
    joint_blocks_31_: {
      name: "joint_blocks.31."
    },
    joint_blocks_32_: {
      name: "joint_blocks.32."
    },
    joint_blocks_33_: {
      name: "joint_blocks.33."
    },
    joint_blocks_34_: {
      name: "joint_blocks.34."
    },
    joint_blocks_35_: {
      name: "joint_blocks.35."
    },
    joint_blocks_36_: {
      name: "joint_blocks.36."
    },
    joint_blocks_37_: {
      name: "joint_blocks.37."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    }
  }
};
const ModelMergeSD3_2B$4 = {
  display_name: "ModelMergeSD3_2B",
  inputs: {
    context_embedder_: {
      name: "context_embedder."
    },
    final_layer_: {
      name: "couche_finale."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    model1: {
      name: "modèle1"
    },
    model2: {
      name: "modèle2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    }
  }
};
const ModelMergeSDXL$4 = {
  display_name: "ModelMergeSDXL",
  inputs: {
    input_blocks_0: {
      name: "input_blocks.0"
    },
    input_blocks_1: {
      name: "input_blocks.1"
    },
    input_blocks_2: {
      name: "input_blocks.2"
    },
    input_blocks_3: {
      name: "input_blocks.3"
    },
    input_blocks_4: {
      name: "input_blocks.4"
    },
    input_blocks_5: {
      name: "input_blocks.5"
    },
    input_blocks_6: {
      name: "input_blocks.6"
    },
    input_blocks_7: {
      name: "input_blocks.7"
    },
    input_blocks_8: {
      name: "input_blocks.8"
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0: {
      name: "middle_block.0"
    },
    middle_block_1: {
      name: "middle_block.1"
    },
    middle_block_2: {
      name: "middle_block.2"
    },
    model1: {
      name: "modèle1"
    },
    model2: {
      name: "modèle2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0: {
      name: "output_blocks.0"
    },
    output_blocks_1: {
      name: "output_blocks.1"
    },
    output_blocks_2: {
      name: "output_blocks.2"
    },
    output_blocks_3: {
      name: "output_blocks.3"
    },
    output_blocks_4: {
      name: "output_blocks.4"
    },
    output_blocks_5: {
      name: "output_blocks.5"
    },
    output_blocks_6: {
      name: "output_blocks.6"
    },
    output_blocks_7: {
      name: "output_blocks.7"
    },
    output_blocks_8: {
      name: "output_blocks.8"
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSimple$4 = {
  display_name: "ModelMergeSimple",
  inputs: {
    model1: {
      name: "modèle1"
    },
    model2: {
      name: "modèle2"
    },
    ratio: {
      name: "ratio"
    }
  }
};
const ModelMergeSubtract$4 = {
  display_name: "ModelMergeSubtract",
  inputs: {
    model1: {
      name: "modèle1"
    },
    model2: {
      name: "modèle2"
    },
    multiplier: {
      name: "multiplicateur"
    }
  }
};
const ModelSamplingAuraFlow$4 = {
  display_name: "ModelSamplingAuraFlow",
  inputs: {
    model: {
      name: "modèle"
    },
    shift: {
      name: "décalage"
    }
  }
};
const ModelSamplingContinuousEDM$4 = {
  display_name: "ModelSamplingContinuousEDM",
  inputs: {
    model: {
      name: "modèle"
    },
    sampling: {
      name: "échantillonnage"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const ModelSamplingContinuousV$4 = {
  display_name: "ModelSamplingContinuousV",
  inputs: {
    model: {
      name: "modèle"
    },
    sampling: {
      name: "échantillonnage"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const ModelSamplingDiscrete$4 = {
  display_name: "ModèleÉchantillonnageDiscret",
  inputs: {
    model: {
      name: "modèle"
    },
    sampling: {
      name: "échantillonnage"
    },
    zsnr: {
      name: "zsnr"
    }
  }
};
const ModelSamplingFlux$4 = {
  display_name: "ModèleÉchantillonnageFlux",
  inputs: {
    base_shift: {
      name: "décalage_base"
    },
    height: {
      name: "hauteur"
    },
    max_shift: {
      name: "décalage_max"
    },
    model: {
      name: "modèle"
    },
    width: {
      name: "largeur"
    }
  }
};
const ModelSamplingLTXV$4 = {
  display_name: "ModèleÉchantillonnageLTXV",
  inputs: {
    base_shift: {
      name: "décalage_base"
    },
    latent: {
      name: "latent"
    },
    max_shift: {
      name: "décalage_max"
    },
    model: {
      name: "modèle"
    }
  }
};
const ModelSamplingSD3$4 = {
  display_name: "ModèleÉchantillonnageSD3",
  inputs: {
    model: {
      name: "modèle"
    },
    shift: {
      name: "décalage"
    }
  }
};
const ModelSamplingStableCascade$4 = {
  display_name: "ModèleÉchantillonnageStableCascade",
  inputs: {
    model: {
      name: "modèle"
    },
    shift: {
      name: "décalage"
    }
  }
};
const ModelSave$4 = {
  display_name: "ModèleEnregistrer",
  inputs: {
    filename_prefix: {
      name: "préfixe_fichier"
    },
    model: {
      name: "modèle"
    }
  }
};
const Morphology$4 = {
  display_name: "ImageMorphologie",
  inputs: {
    image: {
      name: "image"
    },
    kernel_size: {
      name: "taille_noyau"
    },
    operation: {
      name: "opération"
    }
  }
};
const PairConditioningCombine$4 = {
  display_name: "Cond Pair Combiner",
  inputs: {
    negative_A: {
      name: "negative_A"
    },
    negative_B: {
      name: "negative_B"
    },
    positive_A: {
      name: "positive_A"
    },
    positive_B: {
      name: "positive_B"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const PairConditioningSetDefaultCombine$4 = {
  display_name: "Cond Pair Définir Combiner par Défaut",
  inputs: {
    hooks: {
      name: "hooks"
    },
    negative: {
      name: "negative"
    },
    negative_DEFAULT: {
      name: "negative_DEFAULT"
    },
    positive: {
      name: "positive"
    },
    positive_DEFAULT: {
      name: "positive_DEFAULT"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const PairConditioningSetProperties$4 = {
  display_name: "Cond Pair Définir Propriétés",
  inputs: {
    hooks: {
      name: "hooks"
    },
    mask: {
      name: "masque"
    },
    negative_NEW: {
      name: "negative_NEW"
    },
    positive_NEW: {
      name: "positive_NEW"
    },
    set_cond_area: {
      name: "définir_zone_cond"
    },
    strength: {
      name: "force"
    },
    timesteps: {
      name: "pas_de_temps"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const PairConditioningSetPropertiesAndCombine$4 = {
  display_name: "Cond Pair Set Props Combine",
  inputs: {
    hooks: {
      name: "crochets"
    },
    mask: {
      name: "masque"
    },
    negative: {
      name: "negative"
    },
    negative_NEW: {
      name: "negative_NEW"
    },
    positive: {
      name: "positive"
    },
    positive_NEW: {
      name: "positive_NEW"
    },
    set_cond_area: {
      name: "set_cond_area"
    },
    strength: {
      name: "force"
    },
    timesteps: {
      name: "pas de temps"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "negative"
    }
  }
};
const PatchModelAddDownscale$4 = {
  display_name: "PatchModelAddDownscale (Kohya Deep Shrink)",
  inputs: {
    block_number: {
      name: "numéro de bloc"
    },
    downscale_after_skip: {
      name: "réduction après saut"
    },
    downscale_factor: {
      name: "facteur de réduction"
    },
    downscale_method: {
      name: "méthode de réduction"
    },
    end_percent: {
      name: "pourcentage de fin"
    },
    model: {
      name: "modèle"
    },
    start_percent: {
      name: "pourcentage de départ"
    },
    upscale_method: {
      name: "méthode d'agrandissement"
    }
  }
};
const PerpNeg$4 = {
  display_name: "Perp-Neg (OBSOLÈTE par PerpNegGuider)",
  inputs: {
    empty_conditioning: {
      name: "conditionnement vide"
    },
    model: {
      name: "modèle"
    },
    neg_scale: {
      name: "échelle nég"
    }
  }
};
const PerpNegGuider$4 = {
  display_name: "PerpNegGuider",
  inputs: {
    cfg: {
      name: "cfg"
    },
    empty_conditioning: {
      name: "conditionnement vide"
    },
    model: {
      name: "modèle"
    },
    neg_scale: {
      name: "échelle nég"
    },
    negative: {
      name: "négative"
    },
    positive: {
      name: "positive"
    }
  }
};
const PerturbedAttentionGuidance$4 = {
  display_name: "PerturbedAttentionGuidance",
  inputs: {
    model: {
      name: "modèle"
    },
    scale: {
      name: "échelle"
    }
  }
};
const PhotoMakerEncode$4 = {
  display_name: "PhotoMakerEncode",
  inputs: {
    clip: {
      name: "clip"
    },
    image: {
      name: "image"
    },
    photomaker: {
      name: "photomaker"
    },
    text: {
      name: "texte"
    }
  }
};
const PhotoMakerLoader$4 = {
  display_name: "PhotoMakerLoader",
  inputs: {
    photomaker_model_name: {
      name: "nom_du_modèle_photomaker"
    }
  }
};
const PolyexponentialScheduler$4 = {
  display_name: "PolyexponentialScheduler",
  inputs: {
    rho: {
      name: "rho"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "étapes"
    }
  }
};
const PorterDuffImageComposite$4 = {
  display_name: "Composite d'image Porter-Duff",
  inputs: {
    destination: {
      name: "destination"
    },
    destination_alpha: {
      name: "alpha_destination"
    },
    mode: {
      name: "mode"
    },
    source: {
      name: "source"
    },
    source_alpha: {
      name: "alpha_source"
    }
  }
};
const Preview3D$4 = {
  display_name: "Aperçu 3D",
  inputs: {
    bg_color: {
      name: "couleur_de_fond"
    },
    camera_type: {
      name: "type_de_camera"
    },
    light_intensity: {
      name: "intensité_de_lumière"
    },
    material: {
      name: "matériel"
    },
    model_file: {
      name: "fichier_modèle"
    },
    show_grid: {
      name: "afficher_grille"
    },
    up_direction: {
      name: "direction_haut"
    },
    view: {
      name: "vue"
    }
  }
};
const PreviewAudio$4 = {
  display_name: "AperçuAudio",
  inputs: {
    audio: {
      name: "audio"
    }
  }
};
const PreviewImage$4 = {
  description: "Enregistre les images d'entrée dans votre répertoire de sortie ComfyUI.",
  display_name: "Aperçu Image",
  inputs: {
    images: {
      name: "images"
    }
  }
};
const RandomNoise$4 = {
  display_name: "BruitAléatoire",
  inputs: {
    noise_seed: {
      name: "graine_de_bruit"
    }
  }
};
const RebatchImages$4 = {
  display_name: "Rebatch Images",
  inputs: {
    batch_size: {
      name: "taille_de_lot"
    },
    images: {
      name: "images"
    }
  }
};
const RebatchLatents$4 = {
  display_name: "Rebatch Latents",
  inputs: {
    batch_size: {
      name: "taille_de_lot"
    },
    latents: {
      name: "latents"
    }
  }
};
const RepeatImageBatch$4 = {
  display_name: "RépéterLotImage",
  inputs: {
    amount: {
      name: "quantité"
    },
    image: {
      name: "image"
    }
  }
};
const RepeatLatentBatch$4 = {
  display_name: "Répéter Lot Latent",
  inputs: {
    amount: {
      name: "quantité"
    },
    samples: {
      name: "échantillons"
    }
  }
};
const RescaleCFG$4 = {
  display_name: "RescaleCFG",
  inputs: {
    model: {
      name: "modèle"
    },
    multiplier: {
      name: "multiplicateur"
    }
  }
};
const SDTurboScheduler$4 = {
  display_name: "SDTurboScheduler",
  inputs: {
    denoise: {
      name: "débruitage"
    },
    model: {
      name: "modèle"
    },
    steps: {
      name: "étapes"
    }
  }
};
const SD_4XUpscale_Conditioning$4 = {
  display_name: "SD_4XUpscale_Conditioning",
  inputs: {
    images: {
      name: "images"
    },
    negative: {
      name: "négatif"
    },
    noise_augmentation: {
      name: "augmentation_du_bruit"
    },
    positive: {
      name: "positive"
    },
    scale_ratio: {
      name: "ratio_d'échelle"
    }
  },
  outputs: {
    "0": {
      name: "positive"
    },
    "1": {
      name: "négatif"
    },
    "2": {
      name: "latent"
    }
  }
};
const SV3D_Conditioning$4 = {
  display_name: "SV3D_Conditioning",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "élévation"
    },
    height: {
      name: "hauteur"
    },
    init_image: {
      name: "init_image"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "cadres_vidéo"
    },
    width: {
      name: "largeur"
    }
  },
  outputs: {
    "0": {
      name: "positif"
    },
    "1": {
      name: "négatif"
    },
    "2": {
      name: "latent"
    }
  }
};
const SVD_img2vid_Conditioning$4 = {
  display_name: "SVD_img2vid_Conditioning",
  inputs: {
    augmentation_level: {
      name: "niveau_d'augmentation"
    },
    clip_vision: {
      name: "clip_vision"
    },
    fps: {
      name: "fps"
    },
    height: {
      name: "hauteur"
    },
    init_image: {
      name: "init_image"
    },
    motion_bucket_id: {
      name: "id_seau_de_mouvement"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "cadres_vidéo"
    },
    width: {
      name: "largeur"
    }
  },
  outputs: {
    "0": {
      name: "positif"
    },
    "1": {
      name: "négatif"
    },
    "2": {
      name: "latent"
    }
  }
};
const SamplerCustom$4 = {
  display_name: "ÉchantillonneurPersonnalisé",
  inputs: {
    add_noise: {
      name: "ajouter_bruit"
    },
    cfg: {
      name: "cfg"
    },
    latent_image: {
      name: "image_latente"
    },
    model: {
      name: "modèle"
    },
    negative: {
      name: "négative"
    },
    noise_seed: {
      name: "graine_de_bruit"
    },
    positive: {
      name: "positive"
    },
    sampler: {
      name: "échantillonneur"
    },
    sigmas: {
      name: "sigmas"
    }
  },
  outputs: {
    "0": {
      name: "sortie"
    },
    "1": {
      name: "sortie_débruitée"
    }
  }
};
const SamplerCustomAdvanced$4 = {
  display_name: "ÉchantillonneurPersonnaliséAvancé",
  inputs: {
    guider: {
      name: "guide"
    },
    latent_image: {
      name: "image_latente"
    },
    noise: {
      name: "bruit"
    },
    sampler: {
      name: "échantillonneur"
    },
    sigmas: {
      name: "sigmas"
    }
  },
  outputs: {
    "0": {
      name: "sortie"
    },
    "1": {
      name: "sortie_débruitée"
    }
  }
};
const SamplerDPMAdaptative$4 = {
  display_name: "SamplerDPMAdaptative",
  inputs: {
    accept_safety: {
      name: "accept_safety"
    },
    atol: {
      name: "atol"
    },
    dcoeff: {
      name: "dcoeff"
    },
    eta: {
      name: "eta"
    },
    h_init: {
      name: "h_init"
    },
    icoeff: {
      name: "icoeff"
    },
    order: {
      name: "ordre"
    },
    pcoeff: {
      name: "pcoeff"
    },
    rtol: {
      name: "rtol"
    },
    s_noise: {
      name: "s_bruit"
    }
  }
};
const SamplerDPMPP_2M_SDE$4 = {
  display_name: "SamplerDPMPP_2M_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "appareil_bruit"
    },
    s_noise: {
      name: "s_bruit"
    },
    solver_type: {
      name: "type_solveur"
    }
  }
};
const SamplerDPMPP_2S_Ancestral$4 = {
  display_name: "SamplerDPMPP_2S_Ancestral",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_bruit"
    }
  }
};
const SamplerDPMPP_3M_SDE$4 = {
  display_name: "SamplerDPMPP_3M_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "appareil_bruit"
    },
    s_noise: {
      name: "s_bruit"
    }
  }
};
const SamplerDPMPP_SDE$4 = {
  display_name: "SamplerDPMPP_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "appareil_bruit"
    },
    r: {
      name: "r"
    },
    s_noise: {
      name: "s_bruit"
    }
  }
};
const SamplerEulerAncestral$4 = {
  display_name: "SamplerEulerAncestral",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_bruit"
    }
  }
};
const SamplerEulerAncestralCFGPP$4 = {
  display_name: "SamplerEulerAncestralCFG++",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_bruit"
    }
  }
};
const SamplerEulerCFGpp$4 = {
  display_name: "SamplerEulerCFG++",
  inputs: {
    version: {
      name: "version"
    }
  }
};
const SamplerLCMUpscale$4 = {
  display_name: "SamplerLCMUpscale",
  inputs: {
    scale_ratio: {
      name: "ratio_échelle"
    },
    scale_steps: {
      name: "étapes_échelle"
    },
    upscale_method: {
      name: "méthode_agrandissement"
    }
  }
};
const SamplerLMS$4 = {
  display_name: "SamplerLMS",
  inputs: {
    order: {
      name: "ordre"
    }
  }
};
const SaveAnimatedPNG$4 = {
  display_name: "EnregistrerPNGAnimé",
  inputs: {
    compress_level: {
      name: "niveau_compression"
    },
    filename_prefix: {
      name: "préfixe_nom_fichier"
    },
    fps: {
      name: "fps"
    },
    images: {
      name: "images"
    }
  }
};
const SaveAnimatedWEBP$4 = {
  display_name: "EnregistrerWEBPAnimé",
  inputs: {
    filename_prefix: {
      name: "préfixe_du_nom_de_fichier"
    },
    fps: {
      name: "fps"
    },
    images: {
      name: "images"
    },
    lossless: {
      name: "sans_perte"
    },
    method: {
      name: "méthode"
    },
    quality: {
      name: "qualité"
    }
  }
};
const SaveAudio$4 = {
  display_name: "EnregistrerAudio",
  inputs: {
    audio: {
      name: "audio"
    },
    filename_prefix: {
      name: "préfixe_du_nom_de_fichier"
    }
  }
};
const SaveImage$4 = {
  description: "Enregistre les images d'entrée dans votre répertoire de sortie ComfyUI.",
  display_name: "Enregistrer Image",
  inputs: {
    filename_prefix: {
      name: "préfixe_du_nom_de_fichier",
      tooltip: "Le préfixe pour le fichier à enregistrer. Cela peut inclure des informations de formatage telles que %date:yyyy-MM-dd% ou %Empty Latent Image.width% pour inclure des valeurs à partir de nœuds."
    },
    images: {
      name: "images",
      tooltip: "Les images à enregistrer."
    }
  }
};
const SaveImageWebsocket$4 = {
  display_name: "EnregistrerImageWebsocket",
  inputs: {
    images: {
      name: "images"
    }
  }
};
const SaveLatent$4 = {
  display_name: "EnregistrerLatent",
  inputs: {
    filename_prefix: {
      name: "préfixe_du_nom_de_fichier"
    },
    samples: {
      name: "échantillons"
    }
  }
};
const SelfAttentionGuidance$4 = {
  display_name: "Guidance d'Auto-Attention",
  inputs: {
    blur_sigma: {
      name: "blur_sigma"
    },
    model: {
      name: "modèle"
    },
    scale: {
      name: "échelle"
    }
  }
};
const SetClipHooks$4 = {
  display_name: "Définir les Crochets CLIP",
  inputs: {
    apply_to_conds: {
      name: "appliquer_à_conds"
    },
    clip: {
      name: "clip"
    },
    hooks: {
      name: "crochets"
    },
    schedule_clip: {
      name: "programmer_clip"
    }
  }
};
const SetHookKeyframes$4 = {
  display_name: "Définir les Images Clés de Crochet",
  inputs: {
    hook_kf: {
      name: "crochet_kf"
    },
    hooks: {
      name: "crochets"
    }
  }
};
const SetLatentNoiseMask$4 = {
  display_name: "Définir le Masque de Bruit Latent",
  inputs: {
    mask: {
      name: "masque"
    },
    samples: {
      name: "échantillons"
    }
  }
};
const SetUnionControlNetType$4 = {
  display_name: "Définir le Type de Réseau de Contrôle d'Union",
  inputs: {
    control_net: {
      name: "réseau_de_contrôle"
    },
    type: {
      name: "type"
    }
  }
};
const SkipLayerGuidanceDiT$4 = {
  description: "Version générique du nœud SkipLayerGuidance qui peut être utilisée sur chaque modèle DiT.",
  display_name: "SkipLayerGuidanceDiT",
  inputs: {
    double_layers: {
      name: "double_couches"
    },
    end_percent: {
      name: "pourcentage_de_fin"
    },
    model: {
      name: "modèle"
    },
    rescaling_scale: {
      name: "échelle_de_redimensionnement"
    },
    scale: {
      name: "échelle"
    },
    single_layers: {
      name: "couches_simples"
    },
    start_percent: {
      name: "pourcentage_de_départ"
    }
  }
};
const SkipLayerGuidanceSD3$4 = {
  description: "Version générique du nœud SkipLayerGuidance qui peut être utilisée sur chaque modèle DiT.",
  display_name: "SkipLayerGuidanceSD3",
  inputs: {
    end_percent: {
      name: "pourcentage_de_fin"
    },
    layers: {
      name: "couches"
    },
    model: {
      name: "modèle"
    },
    scale: {
      name: "échelle"
    },
    start_percent: {
      name: "pourcentage_de_départ"
    }
  }
};
const SolidMask$4 = {
  display_name: "SolidMask",
  inputs: {
    height: {
      name: "hauteur"
    },
    value: {
      name: "valeur"
    },
    width: {
      name: "largeur"
    }
  }
};
const SplitImageWithAlpha$4 = {
  display_name: "Diviser l'image avec Alpha",
  inputs: {
    image: {
      name: "image"
    }
  }
};
const SplitSigmas$4 = {
  display_name: "SplitSigmas",
  inputs: {
    sigmas: {
      name: "sigmas"
    },
    step: {
      name: "étape"
    }
  },
  outputs: {
    "0": {
      name: "high_sigmas"
    },
    "1": {
      name: "low_sigmas"
    }
  }
};
const SplitSigmasDenoise$4 = {
  display_name: "SplitSigmasDenoise",
  inputs: {
    denoise: {
      name: "réduction_du_bruit"
    },
    sigmas: {
      name: "sigmas"
    }
  },
  outputs: {
    "0": {
      name: "high_sigmas"
    },
    "1": {
      name: "low_sigmas"
    }
  }
};
const StableCascade_EmptyLatentImage$4 = {
  display_name: "StableCascade_EmptyLatentImage",
  inputs: {
    batch_size: {
      name: "taille_du_lot"
    },
    compression: {
      name: "compression"
    },
    height: {
      name: "hauteur"
    },
    width: {
      name: "largeur"
    }
  },
  outputs: {
    "0": {
      name: "stage_c"
    },
    "1": {
      name: "stage_b"
    }
  }
};
const StableCascade_StageB_Conditioning$4 = {
  display_name: "StableCascade_StageB_Conditioning",
  inputs: {
    conditioning: {
      name: "conditionnement"
    },
    stage_c: {
      name: "stage_c"
    }
  }
};
const StableCascade_StageC_VAEEncode$4 = {
  display_name: "StableCascade_StageC_VAEEncode",
  inputs: {
    compression: {
      name: "compression"
    },
    image: {
      name: "image"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "stage_c"
    },
    "1": {
      name: "stage_b"
    }
  }
};
const StableCascade_SuperResolutionControlnet$4 = {
  display_name: "StableCascade_SuperResolutionControlnet",
  inputs: {
    image: {
      name: "image"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "entrée_controlnet"
    },
    "1": {
      name: "étape_c"
    },
    "2": {
      name: "étape_b"
    }
  }
};
const StableZero123_Conditioning$4 = {
  display_name: "StableZero123_Conditioning",
  inputs: {
    azimuth: {
      name: "azimut"
    },
    batch_size: {
      name: "taille_lot"
    },
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "élévation"
    },
    height: {
      name: "hauteur"
    },
    init_image: {
      name: "init_image"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "largeur"
    }
  },
  outputs: {
    "0": {
      name: "positif"
    },
    "1": {
      name: "négatif"
    },
    "2": {
      name: "latent"
    }
  }
};
const StableZero123_Conditioning_Batched$4 = {
  display_name: "StableZero123_Conditioning_Batched",
  inputs: {
    azimuth: {
      name: "azimut"
    },
    azimuth_batch_increment: {
      name: "incrément_lot_azimut"
    },
    batch_size: {
      name: "taille_lot"
    },
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "élévation"
    },
    elevation_batch_increment: {
      name: "incrément_lot_élévation"
    },
    height: {
      name: "hauteur"
    },
    init_image: {
      name: "init_image"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "largeur"
    }
  },
  outputs: {
    "0": {
      name: "positif"
    },
    "1": {
      name: "négatif"
    },
    "2": {
      name: "latent"
    }
  }
};
const StyleModelApply$4 = {
  display_name: "Appliquer le modèle de style",
  inputs: {
    clip_vision_output: {
      name: "sortie_clip_vision"
    },
    conditioning: {
      name: "conditionnement"
    },
    strength: {
      name: "force"
    },
    strength_type: {
      name: "type_de_force"
    },
    style_model: {
      name: "modèle_de_style"
    }
  }
};
const StyleModelLoader$4 = {
  display_name: "Charger le modèle de style",
  inputs: {
    style_model_name: {
      name: "nom_du_modèle_de_style"
    }
  }
};
const ThresholdMask$4 = {
  display_name: "SeuilMasque",
  inputs: {
    mask: {
      name: "masque"
    },
    value: {
      name: "valeur"
    }
  }
};
const TomePatchModel$4 = {
  display_name: "ModèlePatchTome",
  inputs: {
    model: {
      name: "modèle"
    },
    ratio: {
      name: "ratio"
    }
  }
};
const TorchCompileModel$4 = {
  display_name: "ModèleCompilationTorch",
  inputs: {
    backend: {
      name: "backend"
    },
    model: {
      name: "modèle"
    }
  }
};
const TripleCLIPLoader$4 = {
  description: "[Recettes]\n\nsd3: clip-l, clip-g, t5",
  display_name: "ChargeurTripleCLIP",
  inputs: {
    clip_name1: {
      name: "nom_clip1"
    },
    clip_name2: {
      name: "nom_clip2"
    },
    clip_name3: {
      name: "nom_clip3"
    }
  }
};
const UNETLoader$4 = {
  display_name: "Charger Modèle Diffusion",
  inputs: {
    unet_name: {
      name: "nom_unet"
    },
    weight_dtype: {
      name: "dtype_poids"
    }
  }
};
const UNetCrossAttentionMultiply$4 = {
  display_name: "UNetMultiplicationAttentionCroisée",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "modèle"
    },
    out: {
      name: "sortie"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetSelfAttentionMultiply$4 = {
  display_name: "UNetMultiplicationAutoAttention",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "modèle"
    },
    out: {
      name: "sortie"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetTemporalAttentionMultiply$4 = {
  display_name: "UNetTemporalAttentionMultiply",
  inputs: {
    cross_structural: {
      name: "cross_structural"
    },
    cross_temporal: {
      name: "cross_temporal"
    },
    model: {
      name: "modèle"
    },
    self_structural: {
      name: "self_structural"
    },
    self_temporal: {
      name: "self_temporal"
    }
  }
};
const UpscaleModelLoader$4 = {
  display_name: "Charger le modèle de mise à l'échelle",
  inputs: {
    model_name: {
      name: "nom_du_modèle"
    }
  }
};
const VAEDecode$4 = {
  description: "Décode les images latentes en images d'espace de pixels.",
  display_name: "VAE Decode",
  inputs: {
    samples: {
      name: "échantillons",
      tooltip: "Le latent à décoder."
    },
    vae: {
      name: "vae",
      tooltip: "Le modèle VAE utilisé pour le décodage du latent."
    }
  },
  outputs: {
    "0": {
      tooltip: "L'image décodée."
    }
  }
};
const VAEDecodeAudio$4 = {
  display_name: "VAEDecodeAudio",
  inputs: {
    samples: {
      name: "échantillons"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEDecodeTiled$4 = {
  display_name: "VAE Decode (Tiled)",
  inputs: {
    overlap: {
      name: "chevauchement"
    },
    samples: {
      name: "échantillons"
    },
    temporal_overlap: {
      name: "chevauchement_temporel",
      tooltip: "Uniquement utilisé pour les VAE vidéo : Nombre de trames à chevaucher."
    },
    temporal_size: {
      name: "taille_temporelle",
      tooltip: "Uniquement utilisé pour les VAE vidéo : Nombre de trames à décoder à la fois."
    },
    tile_size: {
      name: "taille_de_tuile"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncode$4 = {
  display_name: "VAE Encode",
  inputs: {
    pixels: {
      name: "pixels"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeAudio$4 = {
  display_name: "VAEEncodeAudio",
  inputs: {
    audio: {
      name: "audio"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeForInpaint$4 = {
  display_name: "VAE Encode (pour Inpainting)",
  inputs: {
    grow_mask_by: {
      name: "agrandir_masque_par"
    },
    mask: {
      name: "masque"
    },
    pixels: {
      name: "pixels"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeTiled$4 = {
  display_name: "VAE Encode (Tiled)",
  inputs: {
    overlap: {
      name: "chevauchement"
    },
    pixels: {
      name: "pixels"
    },
    temporal_overlap: {
      name: "chevauchement_temporel",
      tooltip: "Uniquement utilisé pour les VAE vidéo : Nombre de trames à chevaucher."
    },
    temporal_size: {
      name: "taille_temporelle",
      tooltip: "Uniquement utilisé pour les VAE vidéo : Nombre de trames à encoder à la fois."
    },
    tile_size: {
      name: "taille_de_tuile"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAELoader$4 = {
  display_name: "Charger VAE",
  inputs: {
    vae_name: {
      name: "nom_vae"
    }
  }
};
const VAESave$4 = {
  display_name: "VAESauvegarder",
  inputs: {
    filename_prefix: {
      name: "préfixe_de_fichier"
    },
    vae: {
      name: "vae"
    }
  }
};
const VPScheduler$4 = {
  display_name: "PlanificateurVP",
  inputs: {
    beta_d: {
      name: "beta_d"
    },
    beta_min: {
      name: "beta_min"
    },
    eps_s: {
      name: "eps_s"
    },
    steps: {
      name: "étapes"
    }
  }
};
const VideoLinearCFGGuidance$4 = {
  display_name: "Guidance VideoLinearCFG",
  inputs: {
    min_cfg: {
      name: "min_cfg"
    },
    model: {
      name: "modèle"
    }
  }
};
const VideoTriangleCFGGuidance$4 = {
  display_name: "Guidance VideoTriangleCFG",
  inputs: {
    min_cfg: {
      name: "min_cfg"
    },
    model: {
      name: "modèle"
    }
  }
};
const WebcamCapture$4 = {
  display_name: "Capture Webcam",
  inputs: {
    capture_on_queue: {
      name: "capture_en_file_d'attente"
    },
    height: {
      name: "hauteur"
    },
    image: {
      name: "image"
    },
    width: {
      name: "largeur"
    }
  }
};
const unCLIPCheckpointLoader$4 = {
  display_name: "ChargeurPointContrôleunCLIP",
  inputs: {
    ckpt_name: {
      name: "nom_ckpt"
    }
  }
};
const unCLIPConditioning$4 = {
  display_name: "ConditionnementunCLIP",
  inputs: {
    clip_vision_output: {
      name: "sortie_vision_clip"
    },
    conditioning: {
      name: "conditionnement"
    },
    noise_augmentation: {
      name: "augmentation_bruit"
    },
    strength: {
      name: "force"
    }
  }
};
const frNodes = {
  AddNoise: AddNoise$4,
  AlignYourStepsScheduler: AlignYourStepsScheduler$4,
  BasicGuider: BasicGuider$4,
  BasicScheduler: BasicScheduler$4,
  BetaSamplingScheduler: BetaSamplingScheduler$4,
  CFGGuider: CFGGuider$4,
  CLIPAttentionMultiply: CLIPAttentionMultiply$4,
  CLIPLoader: CLIPLoader$4,
  CLIPMergeAdd: CLIPMergeAdd$4,
  CLIPMergeSimple: CLIPMergeSimple$4,
  CLIPMergeSubtract: CLIPMergeSubtract$4,
  CLIPSave: CLIPSave$4,
  CLIPSetLastLayer: CLIPSetLastLayer$4,
  CLIPTextEncode: CLIPTextEncode$4,
  CLIPTextEncodeControlnet: CLIPTextEncodeControlnet$4,
  CLIPTextEncodeFlux: CLIPTextEncodeFlux$4,
  CLIPTextEncodeHunyuanDiT: CLIPTextEncodeHunyuanDiT$4,
  CLIPTextEncodePixArtAlpha: CLIPTextEncodePixArtAlpha$4,
  CLIPTextEncodeSD3: CLIPTextEncodeSD3$4,
  CLIPTextEncodeSDXL: CLIPTextEncodeSDXL$4,
  CLIPTextEncodeSDXLRefiner: CLIPTextEncodeSDXLRefiner$4,
  CLIPVisionEncode: CLIPVisionEncode$4,
  CLIPVisionLoader: CLIPVisionLoader$4,
  Canny: Canny$4,
  CheckpointLoader: CheckpointLoader$4,
  CheckpointLoaderSimple: CheckpointLoaderSimple$4,
  CheckpointSave: CheckpointSave$4,
  CombineHooks2: CombineHooks2$4,
  CombineHooks4: CombineHooks4$4,
  CombineHooks8: CombineHooks8$4,
  ConditioningAverage: ConditioningAverage$4,
  ConditioningCombine: ConditioningCombine$4,
  ConditioningConcat: ConditioningConcat$4,
  ConditioningSetArea: ConditioningSetArea$4,
  ConditioningSetAreaPercentage: ConditioningSetAreaPercentage$4,
  ConditioningSetAreaStrength: ConditioningSetAreaStrength$4,
  ConditioningSetDefaultCombine: ConditioningSetDefaultCombine$4,
  ConditioningSetMask: ConditioningSetMask$4,
  ConditioningSetProperties: ConditioningSetProperties$4,
  ConditioningSetPropertiesAndCombine: ConditioningSetPropertiesAndCombine$4,
  ConditioningSetTimestepRange: ConditioningSetTimestepRange$4,
  ConditioningStableAudio: ConditioningStableAudio$4,
  ConditioningTimestepsRange: ConditioningTimestepsRange$4,
  ConditioningZeroOut: ConditioningZeroOut$4,
  ControlNetApply: ControlNetApply$4,
  ControlNetApplyAdvanced: ControlNetApplyAdvanced$4,
  ControlNetApplySD3: ControlNetApplySD3$4,
  ControlNetInpaintingAliMamaApply: ControlNetInpaintingAliMamaApply$4,
  ControlNetLoader: ControlNetLoader$4,
  CreateHookKeyframe: CreateHookKeyframe$4,
  CreateHookKeyframesFromFloats: CreateHookKeyframesFromFloats$4,
  CreateHookKeyframesInterpolated: CreateHookKeyframesInterpolated$4,
  CreateHookLora: CreateHookLora$4,
  CreateHookLoraModelOnly: CreateHookLoraModelOnly$4,
  CreateHookModelAsLora: CreateHookModelAsLora$4,
  CreateHookModelAsLoraModelOnly: CreateHookModelAsLoraModelOnly$4,
  CropMask: CropMask$4,
  DevToolsDeprecatedNode: DevToolsDeprecatedNode$4,
  DevToolsErrorRaiseNode: DevToolsErrorRaiseNode$4,
  DevToolsErrorRaiseNodeWithMessage: DevToolsErrorRaiseNodeWithMessage$4,
  DevToolsExperimentalNode: DevToolsExperimentalNode$4,
  DevToolsLongComboDropdown: DevToolsLongComboDropdown$4,
  DevToolsNodeWithForceInput: DevToolsNodeWithForceInput$4,
  DevToolsNodeWithOnlyOptionalInput: DevToolsNodeWithOnlyOptionalInput$4,
  DevToolsNodeWithOptionalInput: DevToolsNodeWithOptionalInput$4,
  DevToolsNodeWithOutputList: DevToolsNodeWithOutputList$4,
  DevToolsNodeWithStringInput: DevToolsNodeWithStringInput$4,
  DevToolsNodeWithUnionInput: DevToolsNodeWithUnionInput$4,
  DevToolsSimpleSlider: DevToolsSimpleSlider$4,
  DiffControlNetLoader: DiffControlNetLoader$4,
  DifferentialDiffusion: DifferentialDiffusion$4,
  DiffusersLoader: DiffusersLoader$4,
  DisableNoise: DisableNoise$4,
  DualCFGGuider: DualCFGGuider$4,
  DualCLIPLoader: DualCLIPLoader$4,
  EmptyHunyuanLatentVideo: EmptyHunyuanLatentVideo$4,
  EmptyImage: EmptyImage$4,
  EmptyLTXVLatentVideo: EmptyLTXVLatentVideo$4,
  EmptyLatentAudio: EmptyLatentAudio$4,
  EmptyLatentImage: EmptyLatentImage$4,
  EmptyMochiLatentVideo: EmptyMochiLatentVideo$4,
  EmptySD3LatentImage: EmptySD3LatentImage$4,
  ExponentialScheduler: ExponentialScheduler$4,
  FeatherMask: FeatherMask$4,
  FlipSigmas: FlipSigmas$4,
  FluxGuidance: FluxGuidance$4,
  FreeU: FreeU$4,
  FreeU_V2: FreeU_V2$4,
  GITSScheduler: GITSScheduler$4,
  GLIGENLoader: GLIGENLoader$4,
  GLIGENTextBoxApply: GLIGENTextBoxApply$4,
  GrowMask: GrowMask$4,
  HyperTile: HyperTile$4,
  HypernetworkLoader: HypernetworkLoader$4,
  ImageBatch: ImageBatch$4,
  ImageBlend: ImageBlend$4,
  ImageBlur: ImageBlur$4,
  ImageColorToMask: ImageColorToMask$4,
  ImageCompositeMasked: ImageCompositeMasked$4,
  ImageCrop: ImageCrop$4,
  ImageFromBatch: ImageFromBatch$4,
  ImageInvert: ImageInvert$4,
  ImageOnlyCheckpointLoader: ImageOnlyCheckpointLoader$4,
  ImageOnlyCheckpointSave: ImageOnlyCheckpointSave$4,
  ImagePadForOutpaint: ImagePadForOutpaint$4,
  ImageQuantize: ImageQuantize$4,
  ImageScale: ImageScale$4,
  ImageScaleBy: ImageScaleBy$4,
  ImageScaleToTotalPixels: ImageScaleToTotalPixels$4,
  ImageSharpen: ImageSharpen$4,
  ImageToMask: ImageToMask$4,
  ImageUpscaleWithModel: ImageUpscaleWithModel$4,
  InpaintModelConditioning: InpaintModelConditioning$4,
  InstructPixToPixConditioning: InstructPixToPixConditioning$4,
  InvertMask: InvertMask$4,
  JoinImageWithAlpha: JoinImageWithAlpha$4,
  KSampler: KSampler$4,
  KSamplerAdvanced: KSamplerAdvanced$4,
  KSamplerSelect: KSamplerSelect$4,
  KarrasScheduler: KarrasScheduler$4,
  LTXVConditioning: LTXVConditioning$4,
  LTXVImgToVideo: LTXVImgToVideo$4,
  LTXVScheduler: LTXVScheduler$4,
  LaplaceScheduler: LaplaceScheduler$4,
  LatentAdd: LatentAdd$4,
  LatentApplyOperation: LatentApplyOperation$4,
  LatentApplyOperationCFG: LatentApplyOperationCFG$4,
  LatentBatch: LatentBatch$4,
  LatentBatchSeedBehavior: LatentBatchSeedBehavior$4,
  LatentBlend: LatentBlend$4,
  LatentComposite: LatentComposite$4,
  LatentCompositeMasked: LatentCompositeMasked$4,
  LatentCrop: LatentCrop$4,
  LatentFlip: LatentFlip$4,
  LatentFromBatch: LatentFromBatch$4,
  LatentInterpolate: LatentInterpolate$4,
  LatentMultiply: LatentMultiply$4,
  LatentOperationSharpen: LatentOperationSharpen$4,
  LatentOperationTonemapReinhard: LatentOperationTonemapReinhard$4,
  LatentRotate: LatentRotate$4,
  LatentSubtract: LatentSubtract$4,
  LatentUpscale: LatentUpscale$4,
  LatentUpscaleBy: LatentUpscaleBy$4,
  Load3D: Load3D$4,
  Load3DAnimation: Load3DAnimation$4,
  LoadAudio: LoadAudio$4,
  LoadImage: LoadImage$4,
  LoadImageMask: LoadImageMask$4,
  LoadLatent: LoadLatent$4,
  LoraLoader: LoraLoader$4,
  LoraLoaderModelOnly: LoraLoaderModelOnly$4,
  LoraSave: LoraSave$4,
  Mahiro: Mahiro$4,
  MaskComposite: MaskComposite$4,
  MaskToImage: MaskToImage$4,
  ModelMergeAdd: ModelMergeAdd$4,
  ModelMergeAuraflow: ModelMergeAuraflow$4,
  ModelMergeBlocks: ModelMergeBlocks$4,
  ModelMergeFlux1: ModelMergeFlux1$4,
  ModelMergeLTXV: ModelMergeLTXV$4,
  ModelMergeMochiPreview: ModelMergeMochiPreview$4,
  ModelMergeSD1: ModelMergeSD1$4,
  ModelMergeSD2: ModelMergeSD2$4,
  ModelMergeSD35_Large: ModelMergeSD35_Large$4,
  ModelMergeSD3_2B: ModelMergeSD3_2B$4,
  ModelMergeSDXL: ModelMergeSDXL$4,
  ModelMergeSimple: ModelMergeSimple$4,
  ModelMergeSubtract: ModelMergeSubtract$4,
  ModelSamplingAuraFlow: ModelSamplingAuraFlow$4,
  ModelSamplingContinuousEDM: ModelSamplingContinuousEDM$4,
  ModelSamplingContinuousV: ModelSamplingContinuousV$4,
  ModelSamplingDiscrete: ModelSamplingDiscrete$4,
  ModelSamplingFlux: ModelSamplingFlux$4,
  ModelSamplingLTXV: ModelSamplingLTXV$4,
  ModelSamplingSD3: ModelSamplingSD3$4,
  ModelSamplingStableCascade: ModelSamplingStableCascade$4,
  ModelSave: ModelSave$4,
  Morphology: Morphology$4,
  PairConditioningCombine: PairConditioningCombine$4,
  PairConditioningSetDefaultCombine: PairConditioningSetDefaultCombine$4,
  PairConditioningSetProperties: PairConditioningSetProperties$4,
  PairConditioningSetPropertiesAndCombine: PairConditioningSetPropertiesAndCombine$4,
  PatchModelAddDownscale: PatchModelAddDownscale$4,
  PerpNeg: PerpNeg$4,
  PerpNegGuider: PerpNegGuider$4,
  PerturbedAttentionGuidance: PerturbedAttentionGuidance$4,
  PhotoMakerEncode: PhotoMakerEncode$4,
  PhotoMakerLoader: PhotoMakerLoader$4,
  PolyexponentialScheduler: PolyexponentialScheduler$4,
  PorterDuffImageComposite: PorterDuffImageComposite$4,
  Preview3D: Preview3D$4,
  PreviewAudio: PreviewAudio$4,
  PreviewImage: PreviewImage$4,
  RandomNoise: RandomNoise$4,
  RebatchImages: RebatchImages$4,
  RebatchLatents: RebatchLatents$4,
  RepeatImageBatch: RepeatImageBatch$4,
  RepeatLatentBatch: RepeatLatentBatch$4,
  RescaleCFG: RescaleCFG$4,
  SDTurboScheduler: SDTurboScheduler$4,
  SD_4XUpscale_Conditioning: SD_4XUpscale_Conditioning$4,
  SV3D_Conditioning: SV3D_Conditioning$4,
  SVD_img2vid_Conditioning: SVD_img2vid_Conditioning$4,
  SamplerCustom: SamplerCustom$4,
  SamplerCustomAdvanced: SamplerCustomAdvanced$4,
  SamplerDPMAdaptative: SamplerDPMAdaptative$4,
  SamplerDPMPP_2M_SDE: SamplerDPMPP_2M_SDE$4,
  SamplerDPMPP_2S_Ancestral: SamplerDPMPP_2S_Ancestral$4,
  SamplerDPMPP_3M_SDE: SamplerDPMPP_3M_SDE$4,
  SamplerDPMPP_SDE: SamplerDPMPP_SDE$4,
  SamplerEulerAncestral: SamplerEulerAncestral$4,
  SamplerEulerAncestralCFGPP: SamplerEulerAncestralCFGPP$4,
  SamplerEulerCFGpp: SamplerEulerCFGpp$4,
  SamplerLCMUpscale: SamplerLCMUpscale$4,
  SamplerLMS: SamplerLMS$4,
  SaveAnimatedPNG: SaveAnimatedPNG$4,
  SaveAnimatedWEBP: SaveAnimatedWEBP$4,
  SaveAudio: SaveAudio$4,
  SaveImage: SaveImage$4,
  SaveImageWebsocket: SaveImageWebsocket$4,
  SaveLatent: SaveLatent$4,
  SelfAttentionGuidance: SelfAttentionGuidance$4,
  SetClipHooks: SetClipHooks$4,
  SetHookKeyframes: SetHookKeyframes$4,
  SetLatentNoiseMask: SetLatentNoiseMask$4,
  SetUnionControlNetType: SetUnionControlNetType$4,
  SkipLayerGuidanceDiT: SkipLayerGuidanceDiT$4,
  SkipLayerGuidanceSD3: SkipLayerGuidanceSD3$4,
  SolidMask: SolidMask$4,
  SplitImageWithAlpha: SplitImageWithAlpha$4,
  SplitSigmas: SplitSigmas$4,
  SplitSigmasDenoise: SplitSigmasDenoise$4,
  StableCascade_EmptyLatentImage: StableCascade_EmptyLatentImage$4,
  StableCascade_StageB_Conditioning: StableCascade_StageB_Conditioning$4,
  StableCascade_StageC_VAEEncode: StableCascade_StageC_VAEEncode$4,
  StableCascade_SuperResolutionControlnet: StableCascade_SuperResolutionControlnet$4,
  StableZero123_Conditioning: StableZero123_Conditioning$4,
  StableZero123_Conditioning_Batched: StableZero123_Conditioning_Batched$4,
  StyleModelApply: StyleModelApply$4,
  StyleModelLoader: StyleModelLoader$4,
  ThresholdMask: ThresholdMask$4,
  TomePatchModel: TomePatchModel$4,
  TorchCompileModel: TorchCompileModel$4,
  TripleCLIPLoader: TripleCLIPLoader$4,
  UNETLoader: UNETLoader$4,
  UNetCrossAttentionMultiply: UNetCrossAttentionMultiply$4,
  UNetSelfAttentionMultiply: UNetSelfAttentionMultiply$4,
  UNetTemporalAttentionMultiply: UNetTemporalAttentionMultiply$4,
  UpscaleModelLoader: UpscaleModelLoader$4,
  VAEDecode: VAEDecode$4,
  VAEDecodeAudio: VAEDecodeAudio$4,
  VAEDecodeTiled: VAEDecodeTiled$4,
  VAEEncode: VAEEncode$4,
  VAEEncodeAudio: VAEEncodeAudio$4,
  VAEEncodeForInpaint: VAEEncodeForInpaint$4,
  VAEEncodeTiled: VAEEncodeTiled$4,
  VAELoader: VAELoader$4,
  VAESave: VAESave$4,
  VPScheduler: VPScheduler$4,
  VideoLinearCFGGuidance: VideoLinearCFGGuidance$4,
  VideoTriangleCFGGuidance: VideoTriangleCFGGuidance$4,
  WebcamCapture: WebcamCapture$4,
  unCLIPCheckpointLoader: unCLIPCheckpointLoader$4,
  unCLIPConditioning: unCLIPConditioning$4
};
const Comfy_ConfirmClear$4 = {
  name: "Demander une confirmation lors de l'effacement du flux de travail"
};
const Comfy_DOMClippingEnabled$4 = {
  name: "Activer le découpage des éléments DOM (peut réduire les performances)"
};
const Comfy_DevMode$4 = {
  name: "Activer les options du mode développeur (sauvegarde API, etc.)"
};
const Comfy_DisableFloatRounding$4 = {
  name: "Désactiver l'arrondi par défaut du widget flottant.",
  tooltip: "(nécessite le rechargement de la page) Impossible de désactiver l'arrondi lorsque l'arrondi est défini par le nœud dans le backend."
};
const Comfy_DisableSliders$4 = {
  name: "Désactiver les curseurs du widget de nœud"
};
const Comfy_EditAttention_Delta$4 = {
  name: "Précision Ctrl+haut/bas"
};
const Comfy_EnableTooltips$4 = {
  name: "Activer les infobulles"
};
const Comfy_EnableWorkflowViewRestore$4 = {
  name: "Sauvegarder et restaurer la position et le niveau de zoom du canevas dans les flux de travail"
};
const Comfy_FloatRoundingPrecision$4 = {
  name: "Nombre de décimales pour l'arrondi du widget flottant [0 = auto].",
  tooltip: "(nécessite le rechargement de la page)"
};
const Comfy_Graph_CanvasInfo$4 = {
  name: "Afficher les informations du canevas en bas à gauche (fps, etc.)"
};
const Comfy_Graph_CanvasMenu$4 = {
  name: "Afficher le menu du canevas graphique"
};
const Comfy_Graph_CtrlShiftZoom$4 = {
  name: "Activer le raccourci de zoom rapide (Ctrl + Shift + Glisser)"
};
const Comfy_Graph_LinkMarkers$4 = {
  name: "Marqueurs de point médian du lien",
  options: {
    Arrow: "Flèche",
    Circle: "Cercle",
    None: "Aucun"
  }
};
const Comfy_Graph_ZoomSpeed$4 = {
  name: "Vitesse de zoom du canevas"
};
const Comfy_GroupSelectedNodes_Padding$4 = {
  name: "Marge des nœuds sélectionnés dans le groupe"
};
const Comfy_Group_DoubleClickTitleToEdit$4 = {
  name: "Double-cliquer sur le titre du groupe pour le modifier"
};
const Comfy_InvertMenuScrolling$4 = {
  name: "Inverser le défilement du menu contextuel"
};
const Comfy_LinkRelease_Action$4 = {
  name: "Action lors du relâchement du lien (sans modificateur)",
  options: {
    "context menu": "menu contextuel",
    "no action": "aucune action",
    "search box": "boîte de recherche"
  }
};
const Comfy_LinkRelease_ActionShift$4 = {
  name: "Action lors du relâchement du lien (Shift)",
  options: {
    "context menu": "menu contextuel",
    "no action": "aucune action",
    "search box": "boîte de recherche"
  }
};
const Comfy_LinkRenderMode$4 = {
  name: "Mode de rendu du lien",
  options: {
    Hidden: "Caché",
    Linear: "Linéaire",
    Spline: "Spline",
    Straight: "Droit"
  }
};
const Comfy_Locale$4 = {
  name: "Langue"
};
const Comfy_MaskEditor_BrushAdjustmentSpeed$4 = {
  name: "Multiplicateur de vitesse d'ajustement du pinceau",
  tooltip: "Contrôle la rapidité de changement de la taille et de la dureté du pinceau lors de l'ajustement. Des valeurs plus élevées signifient des changements plus rapides."
};
const Comfy_MaskEditor_UseDominantAxis$4 = {
  name: "Verrouiller l'ajustement du pinceau sur l'axe dominant",
  tooltip: "Lorsqu'il est activé, les ajustements du pinceau n'affecteront que la taille OU la dureté en fonction de la direction dans laquelle vous bougez le plus"
};
const Comfy_MaskEditor_UseNewEditor$4 = {
  name: "Utiliser le nouvel éditeur de masque",
  tooltip: "Passer à la nouvelle interface de l'éditeur de masque"
};
const Comfy_ModelLibrary_AutoLoadAll$4 = {
  name: "Charger automatiquement tous les dossiers de modèles",
  tooltip: "Si vrai, tous les dossiers seront chargés dès que vous ouvrez la bibliothèque de modèles (cela peut causer des retards pendant le chargement). Si faux, les dossiers de modèles de niveau racine ne seront chargés que lorsque vous cliquerez dessus."
};
const Comfy_ModelLibrary_NameFormat$4 = {
  name: "Quel nom afficher dans l'arborescence de la bibliothèque de modèles",
  options: {
    filename: "nom de fichier",
    title: "titre"
  },
  tooltip: 'Sélectionnez "filename" pour afficher une vue simplifiée du nom de fichier brut (sans répertoire ou extension ".safetensors") dans la liste des modèles. Sélectionnez "title" pour afficher le titre configurable des métadonnées du modèle.'
};
const Comfy_NodeBadge_NodeIdBadgeMode$4 = {
  name: "Mode de badge d'identifiant de nœud",
  options: {
    None: "Aucun",
    "Show all": "Afficher tout"
  }
};
const Comfy_NodeBadge_NodeLifeCycleBadgeMode$4 = {
  name: "Mode de badge de cycle de vie du nœud",
  options: {
    None: "Aucun",
    "Show all": "Afficher tout"
  }
};
const Comfy_NodeBadge_NodeSourceBadgeMode$4 = {
  name: "Mode de badge de source de nœud",
  options: {
    "Hide built-in": "Cacher intégré",
    None: "Aucun",
    "Show all": "Afficher tout"
  }
};
const Comfy_NodeInputConversionSubmenus$4 = {
  name: "Dans le menu contextuel du nœud, placez les entrées qui convertissent entre l'entrée/widget dans des sous-menus."
};
const Comfy_NodeSearchBoxImpl$4 = {
  name: "Implémentation de la boîte de recherche de nœud",
  options: {
    "default": "par défaut",
    "litegraph (legacy)": "litegraph (héritage)"
  }
};
const Comfy_NodeSearchBoxImpl_NodePreview$4 = {
  name: "Aperçu du nœud",
  tooltip: "S'applique uniquement à l'implémentation par défaut"
};
const Comfy_NodeSearchBoxImpl_ShowCategory$4 = {
  name: "Afficher la catégorie de nœud dans les résultats de recherche",
  tooltip: "S'applique uniquement à l'implémentation par défaut"
};
const Comfy_NodeSearchBoxImpl_ShowIdName$4 = {
  name: "Afficher le nom de l'identifiant du nœud dans les résultats de recherche",
  tooltip: "S'applique uniquement à l'implémentation par défaut"
};
const Comfy_NodeSearchBoxImpl_ShowNodeFrequency$4 = {
  name: "Afficher la fréquence du nœud dans les résultats de recherche",
  tooltip: "S'applique uniquement à l'implémentation par défaut"
};
const Comfy_NodeSuggestions_number$4 = {
  name: "Nombre de suggestions de nœuds",
  tooltip: "Uniquement pour la boîte de recherche/contexte du menu litegraph"
};
const Comfy_Node_AutoSnapLinkToSlot$4 = {
  name: "Lien d'ancrage automatique à l'emplacement du nœud",
  tooltip: "Lorsque vous faites glisser un lien sur un nœud, le lien se fixe automatiquement à une fente d'entrée viable sur le nœud"
};
const Comfy_Node_BypassAllLinksOnDelete$4 = {
  name: "Conserver tous les liens lors de la suppression de nœuds",
  tooltip: "Lors de la suppression d'un nœud, tentez de reconnecter tous ses liens d'entrée et de sortie (en contournant le nœud supprimé)"
};
const Comfy_Node_DoubleClickTitleToEdit$4 = {
  name: "Double-cliquez sur le titre du nœud pour le modifier"
};
const Comfy_Node_MiddleClickRerouteNode$4 = {
  name: "Le clic du milieu crée un nouveau nœud de réacheminement"
};
const Comfy_Node_Opacity$4 = {
  name: "Opacité du nœud"
};
const Comfy_Node_ShowDeprecated$4 = {
  name: "Afficher les nœuds obsolètes dans la recherche",
  tooltip: "Les nœuds obsolètes sont cachés par défaut dans l'interface utilisateur, mais restent fonctionnels dans les flux de travail existants qui les utilisent."
};
const Comfy_Node_ShowExperimental$4 = {
  name: "Afficher les nœuds expérimentaux dans la recherche",
  tooltip: "Les nœuds expérimentaux sont marqués comme tels dans l'interface utilisateur et peuvent être sujets à des modifications importantes ou à une suppression dans les versions futures. À utiliser avec prudence dans les flux de travail de production"
};
const Comfy_Node_SnapHighlightsNode$4 = {
  name: "Le snap met en évidence le nœud",
  tooltip: "Lorsque vous faites glisser un lien sur un nœud avec une fente d'entrée viable, mettez en évidence le nœud"
};
const Comfy_Pointer_ClickBufferTime$4 = {
  name: "Délai de dérive du clic du pointeur",
  tooltip: "Après avoir appuyé sur un bouton de pointeur, c'est le temps maximum (en millisecondes) que le mouvement du pointeur peut être ignoré.\n\nAide à prévenir que les objets soient déplacés involontairement si le pointeur est déplacé lors du clic."
};
const Comfy_Pointer_ClickDrift$4 = {
  name: "Dérive du clic du pointeur (distance maximale)",
  tooltip: "Si le pointeur se déplace plus que cette distance en maintenant un bouton enfoncé, il est considéré comme un glissement (plutôt qu'un clic).\n\nAide à prévenir que les objets soient déplacés involontairement si le pointeur est déplacé lors du clic."
};
const Comfy_Pointer_DoubleClickTime$4 = {
  name: "Intervalle de double clic (maximum)",
  tooltip: "Le temps maximum en millisecondes entre les deux clics d'un double-clic. Augmenter cette valeur peut aider si les double-clics ne sont parfois pas enregistrés."
};
const Comfy_PreviewFormat$4 = {
  name: "Format de l'image de prévisualisation",
  tooltip: "Lors de l'affichage d'une prévisualisation dans le widget d'image, convertissez-la en une image légère, par exemple webp, jpeg, webp;50, etc."
};
const Comfy_PromptFilename$4 = {
  name: "Demander le nom du fichier lors de l'enregistrement du flux de travail"
};
const Comfy_QueueButton_BatchCountLimit$4 = {
  name: "Limite du nombre de lots",
  tooltip: "Le nombre maximum de tâches ajoutées à la file d'attente en un seul clic de bouton"
};
const Comfy_Queue_MaxHistoryItems$4 = {
  name: "Taille de l'historique de la file d'attente",
  tooltip: "Le nombre maximum de tâches qui s'affichent dans l'historique de la file d'attente."
};
const Comfy_RerouteBeta$4 = {
  name: "Participer au test bêta de reroute",
  tooltip: "Active les nouveaux reroutes natifs.\n\nLes reroutes peuvent être ajoutés en maintenant alt et en glissant à partir d'une ligne de lien, ou sur le menu de lien.\n\nLa désactivation de cette option est non destructive - les reroutes sont cachés."
};
const Comfy_Sidebar_Location$4 = {
  name: "Emplacement de la barre latérale",
  options: {
    left: "gauche",
    right: "droite"
  }
};
const Comfy_Sidebar_Size$4 = {
  name: "Taille de la barre latérale",
  options: {
    normal: "normal",
    small: "petit"
  }
};
const Comfy_SnapToGrid_GridSize$4 = {
  name: "Taille de la grille d'alignement",
  tooltip: "Lors du déplacement et du redimensionnement des nœuds tout en maintenant shift, ils seront alignés sur la grille, cela contrôle la taille de cette grille."
};
const Comfy_TextareaWidget_FontSize$4 = {
  name: "Taille de la police du widget de zone de texte"
};
const Comfy_TextareaWidget_Spellcheck$4 = {
  name: "Vérification orthographique du widget de zone de texte"
};
const Comfy_TreeExplorer_ItemPadding$4 = {
  name: "Espacement des éléments de l'explorateur d'arborescence"
};
const Comfy_UseNewMenu$4 = {
  name: "Utiliser le nouveau menu",
  options: {
    Bottom: "Bas",
    Disabled: "Désactivé",
    Top: "Haut"
  }
};
const Comfy_Validation_NodeDefs$4 = {
  name: "Valider les définitions de nœuds (lent)",
  tooltip: "Recommandé pour les développeurs de nœuds. Cela validera toutes les définitions de nœuds au démarrage."
};
const Comfy_Validation_Workflows$4 = {
  name: "Valider les flux de travail"
};
const Comfy_WidgetControlMode$4 = {
  name: "Mode de contrôle du widget",
  options: {
    after: "après",
    before: "avant"
  },
  tooltip: "Contrôle quand les valeurs du widget sont mises à jour (randomize/increment/decrement), soit avant que l'invite ne soit mise en file d'attente, soit après."
};
const Comfy_Window_UnloadConfirmation$4 = {
  name: "Afficher une confirmation lors de la fermeture de la fenêtre"
};
const Comfy_Workflow_ConfirmDelete$4 = {
  name: "Afficher une confirmation lors de la suppression des flux de travail"
};
const Comfy_Workflow_ShowMissingModelsWarning$4 = {
  name: "Afficher l'avertissement des modèles manquants"
};
const Comfy_Workflow_ShowMissingNodesWarning$4 = {
  name: "Afficher l'avertissement des nœuds manquants"
};
const Comfy_Workflow_SortNodeIdOnSave$4 = {
  name: "Trier les ID de nœuds lors de l'enregistrement du flux de travail"
};
const Comfy_Workflow_WorkflowTabsPosition$4 = {
  name: "Position des flux de travail ouverts",
  options: {
    Sidebar: "Barre latérale",
    Topbar: "Barre supérieure"
  }
};
const LiteGraph_Canvas_MaximumFps$4 = {
  name: "FPS maximum",
  tooltip: "Le nombre maximum d'images par seconde que le canevas est autorisé à rendre. Limite l'utilisation du GPU au détriment de la fluidité. Si 0, le taux de rafraîchissement de l'écran est utilisé. Par défaut : 0"
};
const pysssss_SnapToGrid$4 = {
  name: "Toujours aligner sur la grille"
};
const frSettings = {
  "Comfy-Desktop_AutoUpdate": {
    name: "Vérifier automatiquement les mises à jour"
  },
  "Comfy-Desktop_SendStatistics": {
    name: "Envoyer des rapports de plantage anonymes"
  },
  Comfy_ConfirmClear: Comfy_ConfirmClear$4,
  Comfy_DOMClippingEnabled: Comfy_DOMClippingEnabled$4,
  Comfy_DevMode: Comfy_DevMode$4,
  Comfy_DisableFloatRounding: Comfy_DisableFloatRounding$4,
  Comfy_DisableSliders: Comfy_DisableSliders$4,
  Comfy_EditAttention_Delta: Comfy_EditAttention_Delta$4,
  Comfy_EnableTooltips: Comfy_EnableTooltips$4,
  Comfy_EnableWorkflowViewRestore: Comfy_EnableWorkflowViewRestore$4,
  Comfy_FloatRoundingPrecision: Comfy_FloatRoundingPrecision$4,
  Comfy_Graph_CanvasInfo: Comfy_Graph_CanvasInfo$4,
  Comfy_Graph_CanvasMenu: Comfy_Graph_CanvasMenu$4,
  Comfy_Graph_CtrlShiftZoom: Comfy_Graph_CtrlShiftZoom$4,
  Comfy_Graph_LinkMarkers: Comfy_Graph_LinkMarkers$4,
  Comfy_Graph_ZoomSpeed: Comfy_Graph_ZoomSpeed$4,
  Comfy_GroupSelectedNodes_Padding: Comfy_GroupSelectedNodes_Padding$4,
  Comfy_Group_DoubleClickTitleToEdit: Comfy_Group_DoubleClickTitleToEdit$4,
  Comfy_InvertMenuScrolling: Comfy_InvertMenuScrolling$4,
  Comfy_LinkRelease_Action: Comfy_LinkRelease_Action$4,
  Comfy_LinkRelease_ActionShift: Comfy_LinkRelease_ActionShift$4,
  Comfy_LinkRenderMode: Comfy_LinkRenderMode$4,
  Comfy_Locale: Comfy_Locale$4,
  Comfy_MaskEditor_BrushAdjustmentSpeed: Comfy_MaskEditor_BrushAdjustmentSpeed$4,
  Comfy_MaskEditor_UseDominantAxis: Comfy_MaskEditor_UseDominantAxis$4,
  Comfy_MaskEditor_UseNewEditor: Comfy_MaskEditor_UseNewEditor$4,
  Comfy_ModelLibrary_AutoLoadAll: Comfy_ModelLibrary_AutoLoadAll$4,
  Comfy_ModelLibrary_NameFormat: Comfy_ModelLibrary_NameFormat$4,
  Comfy_NodeBadge_NodeIdBadgeMode: Comfy_NodeBadge_NodeIdBadgeMode$4,
  Comfy_NodeBadge_NodeLifeCycleBadgeMode: Comfy_NodeBadge_NodeLifeCycleBadgeMode$4,
  Comfy_NodeBadge_NodeSourceBadgeMode: Comfy_NodeBadge_NodeSourceBadgeMode$4,
  Comfy_NodeInputConversionSubmenus: Comfy_NodeInputConversionSubmenus$4,
  Comfy_NodeSearchBoxImpl: Comfy_NodeSearchBoxImpl$4,
  Comfy_NodeSearchBoxImpl_NodePreview: Comfy_NodeSearchBoxImpl_NodePreview$4,
  Comfy_NodeSearchBoxImpl_ShowCategory: Comfy_NodeSearchBoxImpl_ShowCategory$4,
  Comfy_NodeSearchBoxImpl_ShowIdName: Comfy_NodeSearchBoxImpl_ShowIdName$4,
  Comfy_NodeSearchBoxImpl_ShowNodeFrequency: Comfy_NodeSearchBoxImpl_ShowNodeFrequency$4,
  Comfy_NodeSuggestions_number: Comfy_NodeSuggestions_number$4,
  Comfy_Node_AutoSnapLinkToSlot: Comfy_Node_AutoSnapLinkToSlot$4,
  Comfy_Node_BypassAllLinksOnDelete: Comfy_Node_BypassAllLinksOnDelete$4,
  Comfy_Node_DoubleClickTitleToEdit: Comfy_Node_DoubleClickTitleToEdit$4,
  Comfy_Node_MiddleClickRerouteNode: Comfy_Node_MiddleClickRerouteNode$4,
  Comfy_Node_Opacity: Comfy_Node_Opacity$4,
  Comfy_Node_ShowDeprecated: Comfy_Node_ShowDeprecated$4,
  Comfy_Node_ShowExperimental: Comfy_Node_ShowExperimental$4,
  Comfy_Node_SnapHighlightsNode: Comfy_Node_SnapHighlightsNode$4,
  Comfy_Pointer_ClickBufferTime: Comfy_Pointer_ClickBufferTime$4,
  Comfy_Pointer_ClickDrift: Comfy_Pointer_ClickDrift$4,
  Comfy_Pointer_DoubleClickTime: Comfy_Pointer_DoubleClickTime$4,
  Comfy_PreviewFormat: Comfy_PreviewFormat$4,
  Comfy_PromptFilename: Comfy_PromptFilename$4,
  Comfy_QueueButton_BatchCountLimit: Comfy_QueueButton_BatchCountLimit$4,
  Comfy_Queue_MaxHistoryItems: Comfy_Queue_MaxHistoryItems$4,
  Comfy_RerouteBeta: Comfy_RerouteBeta$4,
  Comfy_Sidebar_Location: Comfy_Sidebar_Location$4,
  Comfy_Sidebar_Size: Comfy_Sidebar_Size$4,
  Comfy_SnapToGrid_GridSize: Comfy_SnapToGrid_GridSize$4,
  Comfy_TextareaWidget_FontSize: Comfy_TextareaWidget_FontSize$4,
  Comfy_TextareaWidget_Spellcheck: Comfy_TextareaWidget_Spellcheck$4,
  Comfy_TreeExplorer_ItemPadding: Comfy_TreeExplorer_ItemPadding$4,
  Comfy_UseNewMenu: Comfy_UseNewMenu$4,
  Comfy_Validation_NodeDefs: Comfy_Validation_NodeDefs$4,
  Comfy_Validation_Workflows: Comfy_Validation_Workflows$4,
  Comfy_WidgetControlMode: Comfy_WidgetControlMode$4,
  Comfy_Window_UnloadConfirmation: Comfy_Window_UnloadConfirmation$4,
  Comfy_Workflow_ConfirmDelete: Comfy_Workflow_ConfirmDelete$4,
  Comfy_Workflow_ShowMissingModelsWarning: Comfy_Workflow_ShowMissingModelsWarning$4,
  Comfy_Workflow_ShowMissingNodesWarning: Comfy_Workflow_ShowMissingNodesWarning$4,
  Comfy_Workflow_SortNodeIdOnSave: Comfy_Workflow_SortNodeIdOnSave$4,
  Comfy_Workflow_WorkflowTabsPosition: Comfy_Workflow_WorkflowTabsPosition$4,
  LiteGraph_Canvas_MaximumFps: LiteGraph_Canvas_MaximumFps$4,
  pysssss_SnapToGrid: pysssss_SnapToGrid$4
};
const Comfy_BrowseTemplates$3 = {
  label: "テンプレートを参照"
};
const Comfy_Canvas_FitView$3 = {
  label: "選択したノードにビューを合わせる"
};
const Comfy_Canvas_ResetView$3 = {
  label: "ビューをリセット"
};
const Comfy_Canvas_ToggleLinkVisibility$3 = {
  label: "キャンバスのリンクの可視性を切り替え"
};
const Comfy_Canvas_ToggleLock$3 = {
  label: "キャンバスのロックを切り替え"
};
const Comfy_Canvas_ToggleSelectedNodes_Bypass$3 = {
  label: "選択したノードのバイパス/バイパス解除"
};
const Comfy_Canvas_ToggleSelectedNodes_Collapse$3 = {
  label: "選択したノードの折りたたみ/展開"
};
const Comfy_Canvas_ToggleSelectedNodes_Mute$3 = {
  label: "選択したノードのミュート/ミュート解除"
};
const Comfy_Canvas_ToggleSelectedNodes_Pin$3 = {
  label: "選択したノードのピン留め/ピン留め解除"
};
const Comfy_Canvas_ToggleSelected_Pin$3 = {
  label: "選択したアイテムのピン留め/ピン留め解除"
};
const Comfy_Canvas_ZoomIn$3 = {
  label: "ズームイン"
};
const Comfy_Canvas_ZoomOut$3 = {
  label: "ズームアウト"
};
const Comfy_ClearPendingTasks$3 = {
  label: "保留中のタスクをクリア"
};
const Comfy_ClearWorkflow$3 = {
  label: "ワークフローをクリア"
};
const Comfy_DuplicateWorkflow$3 = {
  label: "現在のワークフローを複製"
};
const Comfy_ExportWorkflow$3 = {
  label: "ワークフローをエクスポート"
};
const Comfy_ExportWorkflowAPI$3 = {
  label: "ワークフローをエクスポート（API形式）"
};
const Comfy_Graph_FitGroupToContents$3 = {
  label: "グループを内容に合わせて調整"
};
const Comfy_Graph_GroupSelectedNodes$3 = {
  label: "選択したノードをグループ化"
};
const Comfy_GroupNode_ConvertSelectedNodesToGroupNode$3 = {
  label: "選択したノードをグループノードに変換"
};
const Comfy_GroupNode_ManageGroupNodes$3 = {
  label: "グループノードの管理"
};
const Comfy_GroupNode_UngroupSelectedGroupNodes$3 = {
  label: "選択したグループノードのグループ解除"
};
const Comfy_Help_AboutComfyUI$3 = {
  label: "ComfyUIについてを開く"
};
const Comfy_Help_OpenComfyOrgDiscord$3 = {
  label: "Comfy-OrgのDiscordを開く"
};
const Comfy_Help_OpenComfyUIDocs$3 = {
  label: "ComfyUIのドキュメントを開く"
};
const Comfy_Help_OpenComfyUIIssues$3 = {
  label: "ComfyUIの問題を開く"
};
const Comfy_Interrupt$3 = {
  label: "中断"
};
const Comfy_LoadDefaultWorkflow$3 = {
  label: "デフォルトのワークフローを読み込む"
};
const Comfy_NewBlankWorkflow$3 = {
  label: "新しい空白のワークフロー"
};
const Comfy_OpenClipspace$3 = {
  label: "クリップスペース"
};
const Comfy_OpenWorkflow$3 = {
  label: "ワークフローを開く"
};
const Comfy_QueuePrompt$3 = {
  label: "キュープロンプト"
};
const Comfy_QueuePromptFront$3 = {
  label: "キュープロンプト（フロント）"
};
const Comfy_Redo$3 = {
  label: "やり直す"
};
const Comfy_RefreshNodeDefinitions$3 = {
  label: "ノード定義を更新"
};
const Comfy_SaveWorkflow$3 = {
  label: "ワークフローを保存する"
};
const Comfy_SaveWorkflowAs$3 = {
  label: "名前を付けてワークフローを保存"
};
const Comfy_ShowSettingsDialog$3 = {
  label: "設定ダイアログを表示"
};
const Comfy_ToggleTheme$3 = {
  label: "テーマの切り替え（ダーク/ライト）"
};
const Comfy_Undo$3 = {
  label: "元に戻す"
};
const Workspace_NextOpenedWorkflow$3 = {
  label: "次の開いたワークフロー"
};
const Workspace_PreviousOpenedWorkflow$3 = {
  label: "前の開いたワークフロー"
};
const Workspace_SearchBox_Toggle$3 = {
  label: "検索ボックスの切り替え"
};
const Workspace_ToggleBottomPanel$3 = {
  label: "ボトムパネルの切り替え"
};
const Workspace_ToggleFocusMode$3 = {
  label: "フォーカスモードの切り替え"
};
const Workspace_ToggleSidebarTab_queue$3 = {
  label: "キューサイドバーの切り替え",
  tooltip: "キュー"
};
const Workspace_ToggleSidebarTab_workflows$3 = {
  label: "ワークフローサイドバーの切り替え",
  tooltip: "ワークフロー"
};
const jaCommands = {
  "Comfy-Desktop_Folders_OpenCustomNodesFolder": {
    label: "カスタムノードフォルダを開く"
  },
  "Comfy-Desktop_Folders_OpenInputsFolder": {
    label: "入力フォルダを開く"
  },
  "Comfy-Desktop_Folders_OpenLogsFolder": {
    label: "ログフォルダを開く"
  },
  "Comfy-Desktop_Folders_OpenModelConfig": {
    label: "extra_model_paths.yamlを開く"
  },
  "Comfy-Desktop_Folders_OpenModelsFolder": {
    label: "モデルフォルダを開く"
  },
  "Comfy-Desktop_Folders_OpenOutputsFolder": {
    label: "出力フォルダを開く"
  },
  "Comfy-Desktop_OpenDevTools": {
    label: "DevToolsを開く"
  },
  "Comfy-Desktop_OpenFeedbackPage": {
    label: "フィードバック"
  },
  "Comfy-Desktop_OpenUserGuide": {
    label: "デスクトップユーザーガイド"
  },
  "Comfy-Desktop_Reinstall": {
    label: "再インストール"
  },
  "Comfy-Desktop_Restart": {
    label: "再起動"
  },
  Comfy_BrowseTemplates: Comfy_BrowseTemplates$3,
  Comfy_Canvas_FitView: Comfy_Canvas_FitView$3,
  Comfy_Canvas_ResetView: Comfy_Canvas_ResetView$3,
  Comfy_Canvas_ToggleLinkVisibility: Comfy_Canvas_ToggleLinkVisibility$3,
  Comfy_Canvas_ToggleLock: Comfy_Canvas_ToggleLock$3,
  Comfy_Canvas_ToggleSelectedNodes_Bypass: Comfy_Canvas_ToggleSelectedNodes_Bypass$3,
  Comfy_Canvas_ToggleSelectedNodes_Collapse: Comfy_Canvas_ToggleSelectedNodes_Collapse$3,
  Comfy_Canvas_ToggleSelectedNodes_Mute: Comfy_Canvas_ToggleSelectedNodes_Mute$3,
  Comfy_Canvas_ToggleSelectedNodes_Pin: Comfy_Canvas_ToggleSelectedNodes_Pin$3,
  Comfy_Canvas_ToggleSelected_Pin: Comfy_Canvas_ToggleSelected_Pin$3,
  Comfy_Canvas_ZoomIn: Comfy_Canvas_ZoomIn$3,
  Comfy_Canvas_ZoomOut: Comfy_Canvas_ZoomOut$3,
  Comfy_ClearPendingTasks: Comfy_ClearPendingTasks$3,
  Comfy_ClearWorkflow: Comfy_ClearWorkflow$3,
  Comfy_DuplicateWorkflow: Comfy_DuplicateWorkflow$3,
  Comfy_ExportWorkflow: Comfy_ExportWorkflow$3,
  Comfy_ExportWorkflowAPI: Comfy_ExportWorkflowAPI$3,
  Comfy_Graph_FitGroupToContents: Comfy_Graph_FitGroupToContents$3,
  Comfy_Graph_GroupSelectedNodes: Comfy_Graph_GroupSelectedNodes$3,
  Comfy_GroupNode_ConvertSelectedNodesToGroupNode: Comfy_GroupNode_ConvertSelectedNodesToGroupNode$3,
  Comfy_GroupNode_ManageGroupNodes: Comfy_GroupNode_ManageGroupNodes$3,
  Comfy_GroupNode_UngroupSelectedGroupNodes: Comfy_GroupNode_UngroupSelectedGroupNodes$3,
  Comfy_Help_AboutComfyUI: Comfy_Help_AboutComfyUI$3,
  Comfy_Help_OpenComfyOrgDiscord: Comfy_Help_OpenComfyOrgDiscord$3,
  Comfy_Help_OpenComfyUIDocs: Comfy_Help_OpenComfyUIDocs$3,
  Comfy_Help_OpenComfyUIIssues: Comfy_Help_OpenComfyUIIssues$3,
  Comfy_Interrupt: Comfy_Interrupt$3,
  Comfy_LoadDefaultWorkflow: Comfy_LoadDefaultWorkflow$3,
  Comfy_NewBlankWorkflow: Comfy_NewBlankWorkflow$3,
  Comfy_OpenClipspace: Comfy_OpenClipspace$3,
  Comfy_OpenWorkflow: Comfy_OpenWorkflow$3,
  Comfy_QueuePrompt: Comfy_QueuePrompt$3,
  Comfy_QueuePromptFront: Comfy_QueuePromptFront$3,
  Comfy_Redo: Comfy_Redo$3,
  Comfy_RefreshNodeDefinitions: Comfy_RefreshNodeDefinitions$3,
  Comfy_SaveWorkflow: Comfy_SaveWorkflow$3,
  Comfy_SaveWorkflowAs: Comfy_SaveWorkflowAs$3,
  Comfy_ShowSettingsDialog: Comfy_ShowSettingsDialog$3,
  Comfy_ToggleTheme: Comfy_ToggleTheme$3,
  Comfy_Undo: Comfy_Undo$3,
  Workspace_NextOpenedWorkflow: Workspace_NextOpenedWorkflow$3,
  Workspace_PreviousOpenedWorkflow: Workspace_PreviousOpenedWorkflow$3,
  Workspace_SearchBox_Toggle: Workspace_SearchBox_Toggle$3,
  Workspace_ToggleBottomPanel: Workspace_ToggleBottomPanel$3,
  "Workspace_ToggleBottomPanelTab_command-terminal": {
    label: "ターミナルボトムパネルの切り替え"
  },
  "Workspace_ToggleBottomPanelTab_logs-terminal": {
    label: "ログボトムパネルの切り替え"
  },
  Workspace_ToggleFocusMode: Workspace_ToggleFocusMode$3,
  "Workspace_ToggleSidebarTab_model-library": {
    label: "モデルライブラリサイドバーの切り替え",
    tooltip: "モデルライブラリ"
  },
  "Workspace_ToggleSidebarTab_node-library": {
    label: "ノードライブラリサイドバーの切り替え",
    tooltip: "ノードライブラリ"
  },
  Workspace_ToggleSidebarTab_queue: Workspace_ToggleSidebarTab_queue$3,
  Workspace_ToggleSidebarTab_workflows: Workspace_ToggleSidebarTab_workflows$3
};
const color$3 = {
  blue: "青",
  custom: "カスタム",
  "default": "デフォルト",
  green: "緑",
  pink: "ピンク",
  red: "赤",
  yellow: "黄色"
};
const dataTypes$3 = {
  AUDIO: "オーディオ",
  BOOLEAN: "ブール",
  CLIP: "CLIP",
  CLIP_VISION: "CLIP_VISION",
  CLIP_VISION_OUTPUT: "CLIP_VISION_OUTPUT",
  COMBO: "コンボ",
  CONDITIONING: "条件付け",
  CONTROL_NET: "コントロールネット",
  FLOAT: "浮動小数点",
  FLOATS: "浮動小数点数",
  GLIGEN: "GLIGEN",
  GUIDER: "ガイダー",
  HOOKS: "フック",
  HOOK_KEYFRAMES: "フックキーフレーム",
  IMAGE: "画像",
  INT: "整数",
  LATENT: "潜在",
  LATENT_OPERATION: "潜在操作",
  LOAD_3D: "3Dをロード",
  LOAD_3D_ANIMATION: "3Dアニメーションをロード",
  MASK: "マスク",
  MODEL: "モデル",
  NOISE: "ノイズ",
  PHOTOMAKER: "PHOTOMAKER",
  SAMPLER: "サンプラー",
  SIGMAS: "シグマ",
  STRING: "文字列",
  STYLE_MODEL: "スタイルモデル",
  TIMESTEPS_RANGE: "タイムステップ範囲",
  UPSCALE_MODEL: "アップスケールモデル",
  VAE: "VAE",
  WEBCAM: "ウェブカメラ"
};
const desktopMenu$3 = {
  confirmReinstall: "これにより、extra_models_config.yamlファイルがクリアされ、再インストールが開始されます。本当によろしいですか？",
  reinstall: "再インストール"
};
const downloadGit$3 = {
  gitWebsite: "Gitをダウンロード",
  instructions: "お使いのオペレーティングシステムに最新バージョンをダウンロードしてインストールしてください。以下の「Gitをダウンロード」ボタンをクリックすると、git-scm.comのダウンロードページが開きます。",
  message: "Gitを見つけることができません。正常に動作するためには、Gitの作業コピーが必要です。",
  skip: "スキップ",
  title: "Gitをダウンロード",
  warning: "Gitがインストールされていなくても問題ないと確信している場合、または間違いがあった場合は、「スキップ」をクリックしてこのチェックをスキップできます。作業コピーのない状態でComfyUIを実行することは現在サポートされていません。"
};
const electronFileDownload$3 = {
  cancel: "ダウンロードをキャンセル",
  cancelled: "キャンセルされました",
  inProgress: "ダウンロード中",
  pause: "ダウンロードを一時停止",
  paused: "一時停止",
  resume: "ダウンロードを再開"
};
const g$3 = {
  about: "情報",
  add: "追加",
  back: "戻る",
  cancel: "キャンセル",
  close: "閉じる",
  color: "色",
  comingSoon: "近日公開",
  command: "コマンド",
  confirm: "確認",
  copyToClipboard: "クリップボードにコピー",
  currentUser: "現在のユーザー",
  customize: "カスタマイズ",
  customizeFolder: "フォルダーをカスタマイズ",
  "delete": "削除",
  deprecated: "非推奨",
  devices: "デバイス",
  disableAll: "すべて無効にする",
  download: "ダウンロード",
  empty: "空",
  enableAll: "すべて有効にする",
  error: "エラー",
  experimental: "ベータ",
  extensionName: "拡張機能名",
  findIssues: "問題を見つける",
  firstTimeUIMessage: "新しいUIを初めて使用しています。「メニュー > 新しいメニューを使用 > 無効」を選択して古いUIに戻してください。",
  goToNode: "ノードに移動",
  icon: "アイコン",
  imageFailedToLoad: "画像の読み込みに失敗しました",
  "import": "インポート",
  insert: "挿入",
  install: "インストール",
  keybinding: "キーバインディング",
  loadAllFolders: "すべてのフォルダーを読み込む",
  loadWorkflow: "ワークフローを読み込む",
  loading: "読み込み中",
  logs: "ログ",
  newFolder: "新しいフォルダー",
  next: "次へ",
  no: "いいえ",
  noResultsFound: "結果が見つかりません",
  noTasksFound: "タスクが見つかりません",
  noTasksFoundMessage: "キューにタスクがありません。",
  noWorkflowsFound: "ワークフローが見つかりません。",
  openNewIssue: "新しい問題を開く",
  overwrite: "上書き",
  reconnected: "再接続されました",
  reconnecting: "再接続中",
  refresh: "更新",
  reloadToApplyChanges: "変更を適用するには再読み込みしてください",
  rename: "名前を変更",
  reportIssue: "報告する",
  reportIssueTooltip: "エラーレポートをComfy Orgに送信",
  reportSent: "レポートが送信されました",
  reset: "リセット",
  resetKeybindingsTooltip: "キーバインディングをデフォルトにリセット",
  save: "保存",
  searchExtensions: "拡張機能を検索",
  searchFailedMessage: "検索に一致する設定が見つかりませんでした。検索用語を調整してみてください。",
  searchKeybindings: "キーバインディングを検索",
  searchModels: "モデルを検索",
  searchNodes: "ノードを検索",
  searchSettings: "設定を検索",
  searchWorkflows: "ワークフローを検索",
  settings: "設定",
  showReport: "レポートを表示",
  systemInfo: "システム情報",
  terminal: "ターミナル",
  upload: "アップロード",
  videoFailedToLoad: "ビデオの読み込みに失敗しました"
};
const graphCanvasMenu$3 = {
  fitView: "ビューに合わせる",
  panMode: "パンモード",
  resetView: "ビューをリセット",
  selectMode: "選択モード",
  toggleLinkVisibility: "リンクの表示切り替え",
  zoomIn: "拡大",
  zoomOut: "縮小"
};
const groupNode$3 = {
  create: "グループノードを作成",
  enterName: "名前を入力"
};
const icon$3 = {
  bookmark: "ブックマーク",
  box: "ボックス",
  briefcase: "ブリーフケース",
  "exclamation-triangle": "警告",
  file: "ファイル",
  folder: "フォルダー",
  heart: "ハート",
  inbox: "受信トレイ",
  star: "星"
};
const install$3 = {
  appDataLocationTooltip: "ComfyUIのアプリデータディレクトリ。保存内容:\n- ログ\n- サーバー設定",
  appPathLocationTooltip: "ComfyUIのアプリ資産ディレクトリ。ComfyUIのコードとアセットを保存します",
  cannotWrite: "選択したパスに書き込むことができません",
  chooseInstallationLocation: "インストール先を選択",
  customNodes: "カスタムノード",
  customNodesDescription: "既存のComfyUIインストールからカスタムノードを再インストールします。",
  desktopAppSettings: "デスクトップアプリの設定",
  desktopAppSettingsDescription: "ComfyUIのデスクトップでの動作を設定します。これらの設定は後で変更可能です。",
  desktopSettings: "デスクトップ設定",
  failedToSelectDirectory: "ディレクトリの選択に失敗しました",
  gpu: "GPU",
  gpuSelection: {
    cpuMode: "CPUモード",
    cpuModeDescription: "CPUモードは開発者やまれなエッジケースのみを対象としています。",
    cpuModeDescription2: "これが絶対に必要であることが確定していない場合は、このボックスを無視して上でGPUを選択してください。",
    customComfyNeedsPython: "ComfyUIはpythonがセットアップされるまで動作しません",
    customInstallRequirements: "すべての要件と依存関係をインストールする（例：カスタムtorch）",
    customManualVenv: "python venvを手動で設定する",
    customMayNotWork: "これは完全にサポートされておらず、単純に動作しない場合があります。",
    customSkipsPython: "このオプションは通常のpythonセットアップをスキップします。",
    enableCpuMode: "CPUモードを有効にする",
    mpsDescription: "Apple Metal Performance Shadersは、pytorch nightlyを使用してサポートされています。",
    nvidiaDescription: "NVIDIAデバイスは、pytorch CUDAビルドを使用して直接サポートされています。",
    selectGpu: "GPUを選択",
    selectGpuDescription: "所有しているGPUのタイプを選択してください"
  },
  installLocation: "インストール先",
  installLocationDescription: "ComfyUIのユーザーデータを保存するディレクトリを選択してください。Python環境が選択した場所にインストールされます。選択したディスクに約15GBの空き容量が必要です。",
  installLocationTooltip: "ComfyUIのユーザーデータディレクトリ。保存内容:\n- Python環境\n- モデル\n- カスタムノード\n",
  insufficientFreeSpace: "空き容量が不足しています - 最低限の空き容量",
  manualConfiguration: {
    createVenv: "次のディレクトリに仮想環境を作成する必要があります",
    requirements: "要件",
    restartWhenFinished: "仮想環境の設定が完了したら、ComfyUIを再起動してください。",
    title: "マニュアル設定",
    virtualEnvironmentPath: "仮想環境のパス"
  },
  migrateFromExistingInstallation: "既存のインストールから移行",
  migration: "移行",
  migrationOptional: "移行は任意です。既存のインストールがない場合、このステップをスキップできます。",
  migrationSourcePathDescription: "既存のComfyUIインストールがある場合、既存のユーザーファイルやモデルを新しいインストールにコピー/リンクできます。",
  parentMissing: "パスが存在しません - 最初に含まれるディレクトリを作成してください",
  pathExists: "ディレクトリはすでに存在します - すべてのデータをバックアップしたことを確認してください",
  pathValidationFailed: "パスの検証に失敗しました",
  selectItemsToMigrate: "移行する項目を選択",
  settings: {
    allowMetrics: "クラッシュレポート",
    allowMetricsDescription: "ComfyUIの改善に協力してください。匿名のクラッシュレポートを送信します。個人情報やワークフロー内容は収集されません。この設定はいつでも無効にできます。",
    autoUpdate: "自動更新",
    autoUpdateDescription: "更新が利用可能になると、自動的にダウンロードおよびインストールを行います。インストール前に通知が表示されます。",
    dataCollectionDialog: {
      customNodeConfigurations: "カスタムノード設定",
      errorReports: "エラーメッセージとスタックトレース",
      fileSystemInformation: "ファイルシステム情報",
      personalInformation: "個人情報",
      systemInfo: "ハードウェア、OSの種類、アプリのバージョン",
      title: "データ収集について",
      whatWeCollect: "収集内容:",
      whatWeDoNotCollect: "収集しない内容:",
      workflowContent: "ワークフロー内容",
      workflowContents: "ワークフロー内容"
    },
    learnMoreAboutData: "データ収集の詳細を見る"
  },
  systemLocations: "システムの場所",
  unhandledError: "未知のエラー"
};
const menu$3 = {
  autoQueue: "自動キュー",
  batchCount: "バッチ数",
  batchCountTooltip: "ワークフロー生成回数",
  clear: "ワークフローをクリア",
  clipspace: "クリップスペースを開く",
  disabled: "無効",
  disabledTooltip: "ワークフローは自動的にキューに追加されません",
  execute: "実行",
  hideMenu: "メニューを隠す",
  instant: "即時",
  instantTooltip: "生成完了後すぐにキューに追加",
  interrupt: "現在の実行を中止",
  onChange: "変更時",
  onChangeTooltip: "変更が行われるとワークフローがキューに追加されます",
  queue: "実行",
  queueWorkflow: "キューに追加 (Shiftで先頭に)",
  queueWorkflowFront: "先頭に追加",
  refresh: "ノードを更新",
  resetView: "ビューをリセット",
  showMenu: "メニューを表示",
  toggleBottomPanel: "下部パネルを切り替え"
};
const menuLabels$3 = {
  "About ComfyUI": "ComfyUIについて",
  "Browse Templates": "テンプレートを参照",
  "Bypass/Unbypass Selected Nodes": "選択したノードのバイパス/バイパス解除",
  "Canvas Toggle Link Visibility": "キャンバスのリンク表示を切り替え",
  "Canvas Toggle Lock": "キャンバスのロックを切り替え",
  "Clear Pending Tasks": "保留中のタスクをクリア",
  "Clear Workflow": "ワークフローをクリア",
  Clipspace: "クリップスペース",
  "Collapse/Expand Selected Nodes": "選択したノードの折りたたみ/展開",
  "Comfy-Org Discord": "Comfy-Org Discord",
  "ComfyUI Docs": "ComfyUIのドキュメント",
  "ComfyUI Issues": "ComfyUIの問題",
  "Convert selected nodes to group node": "選択したノードをグループノードに変換",
  "Desktop User Guide": "デスクトップユーザーガイド",
  "Duplicate Current Workflow": "現在のワークフローを複製",
  Edit: "編集",
  Export: "エクスポート",
  "Export (API)": "エクスポート (API)",
  Feedback: "フィードバック",
  "Fit Group To Contents": "グループを内容に合わせる",
  "Fit view to selected nodes": "選択したノードにビューを合わせる",
  "Group Selected Nodes": "選択したノードをグループ化",
  Help: "ヘルプ",
  Interrupt: "中断",
  "Load Default Workflow": "デフォルトワークフローを読み込む",
  "Manage group nodes": "グループノードを管理",
  "Mute/Unmute Selected Nodes": "選択したノードのミュート/ミュート解除",
  New: "新規",
  "Next Opened Workflow": "次に開いたワークフロー",
  Open: "開く",
  "Open Custom Nodes Folder": "カスタムノードフォルダを開く",
  "Open DevTools": "DevToolsを開く",
  "Open Inputs Folder": "入力フォルダを開く",
  "Open Logs Folder": "ログフォルダを開く",
  "Open Models Folder": "モデルフォルダを開く",
  "Open Outputs Folder": "出力フォルダを開く",
  "Open extra_model_paths_yaml": "extra_model_paths.yamlを開く",
  "Pin/Unpin Selected Items": "選択したアイテムのピン留め/ピン留め解除",
  "Pin/Unpin Selected Nodes": "選択したノードのピン留め/ピン留め解除",
  "Previous Opened Workflow": "前に開いたワークフロー",
  "Queue Prompt": "キューのプロンプト",
  "Queue Prompt (Front)": "キューのプロンプト (前面)",
  Redo: "やり直す",
  "Refresh Node Definitions": "ノード定義を更新",
  Reinstall: "再インストール",
  "Reset View": "ビューをリセット",
  Restart: "再起動",
  Save: "保存",
  "Save As": "名前を付けて保存",
  "Show Settings Dialog": "設定ダイアログを表示",
  "Toggle Bottom Panel": "下部パネルの切り替え",
  "Toggle Focus Mode": "フォーカスモードの切り替え",
  "Toggle Logs Bottom Panel": "ログボトムパネルを切り替え",
  "Toggle Model Library Sidebar": "モデルライブラリサイドバーを切り替え",
  "Toggle Node Library Sidebar": "ノードライブラリサイドバーを切り替え",
  "Toggle Queue Sidebar": "キューサイドバーを切り替え",
  "Toggle Search Box": "検索ボックスの切り替え",
  "Toggle Terminal Bottom Panel": "ターミナルボトムパネルを切り替え",
  "Toggle Theme (Dark/Light)": "テーマを切り替え（ダーク/ライト）",
  "Toggle Workflows Sidebar": "ワークフローサイドバーを切り替え",
  Undo: "元に戻す",
  "Ungroup selected group nodes": "選択したグループノードのグループ解除",
  Workflow: "ワークフロー",
  "Zoom In": "ズームイン",
  "Zoom Out": "ズームアウト"
};
const nodeCategories$3 = {
  "3d": "3d",
  "3d_models": "3Dモデル",
  DevTools: "デブツール",
  _for_testing: "_テスト用",
  advanced: "高度な",
  animation: "アニメーション",
  api: "API",
  attention_experiments: "アテンション実験",
  audio: "オーディオ",
  batch: "バッチ",
  clip: "クリップ",
  combine: "結合",
  compositing: "合成",
  "cond pair": "条件ペア",
  "cond single": "条件単体",
  conditioning: "条件付け",
  controlnet: "コントロールネット",
  create: "作成",
  custom_sampling: "カスタムサンプリング",
  deprecated: "非推奨",
  flux: "flux",
  gligen: "グライジェン",
  guidance: "ガイダンス",
  guiders: "ガイダー",
  hooks: "フック",
  image: "画像",
  inpaint: "インペイント",
  instructpix2pix: "インストラクションピクス2ピクス",
  latent: "潜在",
  loaders: "ローダー",
  ltxv: "LTXV",
  mask: "マスク",
  model: "モデル",
  model_merging: "モデルマージ",
  model_patches: "モデルパッチ",
  model_specific: "モデル特有",
  noise: "ノイズ",
  operations: "操作",
  photomaker: "photomaker",
  postprocessing: "ポストプロセッシング",
  preprocessors: "前処理",
  samplers: "サンプラー",
  sampling: "サンプリング",
  schedulers: "スケジューラー",
  scheduling: "スケジューリング",
  sd3: "SD3",
  sigmas: "シグマ",
  stable_cascade: "安定したカスケード",
  style_model: "スタイルモデル",
  transform: "変換",
  unet: "U-Net",
  upscale_diffusion: "アップスケール拡散",
  upscaling: "アップスケーリング",
  video: "ビデオ",
  video_models: "ビデオモデル"
};
const nodeTemplates$3 = {
  enterName: "名前を入力",
  saveAsTemplate: "テンプレートとして保存"
};
const notSupported$3 = {
  "continue": "続ける",
  continueTooltip: "私のデバイスはサポートされていると確信しています",
  learnMore: "詳細を見る",
  message: "以下のデバイスのみサポートされています:",
  reportIssue: "問題を報告",
  supportedDevices: {
    macos: "MacOS (M1以降)",
    windows: "Windows (CUDA対応のNvidia GPU)"
  },
  title: "お使いのデバイスはサポートされていません"
};
const serverConfig$3 = {
  modifiedConfigs: "以下のサーバー設定を変更しました。変更を適用するには再起動してください。",
  restart: "再起動",
  revertChanges: "変更を元に戻す"
};
const serverConfigCategories$3 = {
  Attention: "アテンション",
  CUDA: "CUDA",
  Cache: "キャッシュ",
  Directories: "ディレクトリ",
  General: "一般",
  Inference: "推論",
  Memory: "メモリ",
  Network: "ネットワーク",
  Preview: "プレビュー"
};
const serverConfigItems$3 = {
  "cache-classic": {
    name: "クラシックキャッシュシステムを使用する"
  },
  "cache-lru": {
    name: "最大Nノード結果をキャッシュするLRUキャッシングを使用する。",
    tooltip: "RAM/VRAMを多く使用する可能性があります。"
  },
  "cpu-vae": {
    name: "CPUでVAEを実行する"
  },
  "cross-attention-method": {
    name: "クロスアテンションメソッド"
  },
  "cuda-device": {
    name: "使用するCUDAデバイスインデックス"
  },
  "cuda-malloc": {
    name: "メモリ割り当てにCUDA mallocを使用する"
  },
  "default-hashing-function": {
    name: "モデルファイルのデフォルトハッシュ関数"
  },
  deterministic: {
    name: "可能な場合、PyTorchが遅い決定論的アルゴリズムを使用する。",
    tooltip: "これにより、すべてのケースで画像が決定論的になるわけではないことに注意してください。"
  },
  directml: {
    name: "DirectMLデバイスインデックス"
  },
  "disable-all-custom-nodes": {
    name: "すべてのカスタムノードの読み込みを無効にする。"
  },
  "disable-ipex-optimize": {
    name: "IPEX最適化を無効にする"
  },
  "disable-metadata": {
    name: "ファイルにプロンプトメタデータを保存しない。"
  },
  "disable-smart-memory": {
    name: "スマートメモリ管理を無効にする",
    tooltip: "ComfyUIがモデルをVRAMに保持する代わりに、通常のRAMに積極的にオフロードするように強制します。"
  },
  "disable-xformers": {
    name: "xFormers最適化を無効にする"
  },
  "dont-print-server": {
    name: "サーバー出力をコンソールに表示しない。"
  },
  "dont-upcast-attention": {
    name: "アテンションのアップキャストを防ぐ"
  },
  "enable-cors-header": {
    name: 'CORSヘッダーを有効にする: "*"を使用してすべてのオリジンを許可するか、ドメインを指定する'
  },
  fast: {
    name: "未テストの潜在的に品質を低下させる最適化を有効にする。"
  },
  "force-channels-last": {
    name: "チャネルを最後に強制するメモリ形式"
  },
  "force-upcast-attention": {
    name: "アテンションのアップキャストを強制する"
  },
  "global-precision": {
    name: "グローバル浮動小数点精度",
    tooltip: "グローバル浮動小数点精度"
  },
  "input-directory": {
    name: "入力ディレクトリ"
  },
  listen: {
    name: "ホスト：リッスンするIPアドレス"
  },
  "log-level": {
    name: "ログの冗長性レベル"
  },
  "max-upload-size": {
    name: "最大アップロードサイズ (MB)"
  },
  "output-directory": {
    name: "出力ディレクトリ"
  },
  port: {
    name: "ポート：リッスンするポート"
  },
  "preview-method": {
    name: "潜在プレビューに使用されるメソッド"
  },
  "preview-size": {
    name: "プレビュー画像のサイズ"
  },
  "reserve-vram": {
    name: "予約済みVRAM (GB)",
    tooltip: "OS/他のソフトウェアで使用するために予約したいVRAMの量をGB単位で設定します。デフォルトでは、OSに応じていくらかの量が予約されます。"
  },
  "text-encoder-precision": {
    name: "テキストエンコーダー精度",
    tooltip: "テキストエンコーダー精度"
  },
  "tls-certfile": {
    name: "TLS証明書ファイル: HTTPS用のTLS証明書ファイルのパス"
  },
  "tls-keyfile": {
    name: "TLSキーファイル: HTTPS用のTLSキーファイルのパス"
  },
  "unet-precision": {
    name: "UNET精度",
    tooltip: "UNET精度"
  },
  "vae-precision": {
    name: "VAE精度",
    tooltip: "VAE精度"
  },
  "vram-management": {
    name: "VRAM管理モード"
  }
};
const serverStart$3 = {
  openLogs: "ログを開く",
  process: {
    error: "ComfyUIデスクトップを起動できません",
    "initial-state": "読み込み中...",
    "python-setup": "Python環境を設定中...",
    ready: "完了中...",
    "starting-server": "ComfyUIサーバーを起動中..."
  },
  reinstall: "再インストール",
  reportIssue: "問題を報告",
  showTerminal: "ターミナルを表示"
};
const settingsCategories$3 = {
  About: "情報",
  Appearance: "外観",
  BrushAdjustment: "ブラシ調整",
  Canvas: "キャンバス",
  ColorPalette: "カラーパレット",
  Comfy: "Comfy",
  "Comfy-Desktop": "Comfyデスクトップ",
  CustomColorPalettes: "カスタムカラーパレット",
  DevMode: "開発モード",
  EditTokenWeight: "トークンの重みを編集",
  Extension: "拡張",
  General: "一般",
  Graph: "グラフ",
  Group: "グループ",
  Keybinding: "キー割り当て",
  Link: "リンク",
  LinkRelease: "リンク解除",
  LiteGraph: "Lite Graph",
  Locale: "ロケール",
  "Mask Editor": "マスクエディタ",
  Menu: "メニュー",
  ModelLibrary: "モデルライブラリ",
  NewEditor: "新しいエディタ",
  Node: "ノード",
  "Node Search Box": "ノード検索ボックス",
  "Node Widget": "ノードウィジェット",
  NodeInputConversionSubmenus: "ノード入力変換サブメニュー",
  NodeLibrary: "ノードライブラリ",
  Pointer: "ポインタ",
  Queue: "キュー",
  QueueButton: "キューボタン",
  RerouteBeta: "ルート変更ベータ",
  Server: "サーバー",
  "Server-Config": "サーバー設定",
  Settings: "設定",
  Sidebar: "サイドバー",
  "Tree Explorer": "ツリーエクスプローラー",
  Validation: "検証",
  Window: "ウィンドウ",
  Workflow: "ワークフロー"
};
const sideToolbar$3 = {
  browseTemplates: "サンプルテンプレートを表示",
  downloads: "ダウンロード",
  logout: "ログアウト",
  modelLibrary: "モデルライブラリ",
  newBlankWorkflow: "新しい空のワークフローを作成",
  nodeLibrary: "ノードライブラリ",
  nodeLibraryTab: {
    sortOrder: "並び順"
  },
  openWorkflow: "ローカルでワークフローを開く",
  queue: "キュー",
  queueTab: {
    backToAllTasks: "すべてのタスクに戻る",
    clearPendingTasks: "保留中のタスクをクリア",
    containImagePreview: "画像プレビューを含める",
    coverImagePreview: "画像プレビューに合わせる",
    filter: "出力をフィルタ",
    filters: {
      hideCached: "キャッシュを非表示",
      hideCanceled: "キャンセル済みを非表示"
    },
    showFlatList: "フラットリストを表示"
  },
  themeToggle: "テーマの切り替え",
  workflowTab: {
    confirmDelete: "このワークフローを削除してもよろしいですか？",
    confirmDeleteTitle: "ワークフローを削除しますか？",
    confirmOverwrite: "以下のファイルはすでに存在します。上書きしますか？",
    confirmOverwriteTitle: "既存のファイルを上書きしますか？",
    deleteFailed: "ワークフローの削除を試みましたが、失敗しました。",
    deleteFailedTitle: "削除に失敗しました",
    deleted: "ワークフローが削除されました",
    dirtyClose: "以下のファイルが変更されました。閉じる前に保存しますか？",
    dirtyCloseTitle: "変更を保存しますか？",
    workflowTreeType: {
      bookmarks: "ブックマーク",
      browse: "ブラウズ",
      open: "開く"
    }
  },
  workflows: "ワークフロー"
};
const tabMenu$3 = {
  closeOtherTabs: "他のタブを閉じる",
  closeTab: "タブを閉じる",
  closeTabsToLeft: "左のタブを閉じる",
  closeTabsToRight: "右のタブを閉じる",
  duplicateTab: "タブを複製"
};
const templateWorkflows$3 = {
  template: {
    "default": "画像生成",
    flux_schnell: "Flux Schnell",
    image2image: "画像から画像へ",
    upscale: "2パスアップスケール"
  },
  title: "テンプレートを利用して開始"
};
const userSelect$3 = {
  enterUsername: "ユーザー名を入力してください",
  existingUser: "既存のユーザー",
  newUser: "新しいユーザー",
  next: "次へ",
  selectUser: "ユーザーを選択"
};
const welcome$3 = {
  getStarted: "はじめる",
  title: "ComfyUIへようこそ"
};
const workflowService$3 = {
  enterFilename: "ファイル名を入力",
  exportWorkflow: "ワークフローをエクスポート",
  saveWorkflow: "ワークフローを保存"
};
const ja = {
  color: color$3,
  dataTypes: dataTypes$3,
  desktopMenu: desktopMenu$3,
  downloadGit: downloadGit$3,
  electronFileDownload: electronFileDownload$3,
  g: g$3,
  graphCanvasMenu: graphCanvasMenu$3,
  groupNode: groupNode$3,
  icon: icon$3,
  install: install$3,
  menu: menu$3,
  menuLabels: menuLabels$3,
  nodeCategories: nodeCategories$3,
  nodeTemplates: nodeTemplates$3,
  notSupported: notSupported$3,
  serverConfig: serverConfig$3,
  serverConfigCategories: serverConfigCategories$3,
  serverConfigItems: serverConfigItems$3,
  serverStart: serverStart$3,
  settingsCategories: settingsCategories$3,
  sideToolbar: sideToolbar$3,
  tabMenu: tabMenu$3,
  templateWorkflows: templateWorkflows$3,
  userSelect: userSelect$3,
  welcome: welcome$3,
  workflowService: workflowService$3
};
const AddNoise$3 = {
  display_name: "ノイズを追加",
  inputs: {
    latent_image: {
      name: "潜在イメージ"
    },
    model: {
      name: "モデル"
    },
    noise: {
      name: "ノイズ"
    },
    sigmas: {
      name: "シグマ"
    }
  }
};
const AlignYourStepsScheduler$3 = {
  display_name: "ステップを整列",
  inputs: {
    denoise: {
      name: "ノイズ除去"
    },
    model_type: {
      name: "モデルタイプ"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const BasicGuider$3 = {
  display_name: "基本ガイダー",
  inputs: {
    conditioning: {
      name: "コンディショニング"
    },
    model: {
      name: "モデル"
    }
  }
};
const BasicScheduler$3 = {
  display_name: "基本スケジューラー",
  inputs: {
    denoise: {
      name: "ノイズ除去"
    },
    model: {
      name: "モデル"
    },
    scheduler: {
      name: "スケジューラ"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const BetaSamplingScheduler$3 = {
  display_name: "ベータサンプリングスケジューラー",
  inputs: {
    alpha: {
      name: "アルファ"
    },
    beta: {
      name: "ベータ"
    },
    model: {
      name: "モデル"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const CFGGuider$3 = {
  display_name: "CFGガイダー",
  inputs: {
    cfg: {
      name: "cfg"
    },
    model: {
      name: "モデル"
    },
    negative: {
      name: "ネガティブ"
    },
    positive: {
      name: "ポジティブ"
    }
  }
};
const CLIPAttentionMultiply$3 = {
  display_name: "CLIP注意の乗算",
  inputs: {
    clip: {
      name: "clip"
    },
    k: {
      name: "k"
    },
    out: {
      name: "出力"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const CLIPLoader$3 = {
  description: "[レシピ]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 / clip-g / clip-l\nstable_audio: t5\nmochi: t5",
  display_name: "CLIPを読み込む",
  inputs: {
    clip_name: {
      name: "clip名"
    },
    type: {
      name: "タイプ"
    }
  }
};
const CLIPMergeAdd$3 = {
  display_name: "CLIPマージ追加",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    }
  }
};
const CLIPMergeSimple$3 = {
  display_name: "CLIPマージシンプル",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    ratio: {
      name: "比率"
    }
  }
};
const CLIPMergeSubtract$3 = {
  display_name: "CLIPマージ減算",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    multiplier: {
      name: "乗数"
    }
  }
};
const CLIPSave$3 = {
  display_name: "CLIPを保存",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "ファイル名プレフィックス"
    }
  }
};
const CLIPSetLastLayer$3 = {
  display_name: "CLIPの最終層を設定",
  inputs: {
    clip: {
      name: "クリップ"
    },
    stop_at_clip_layer: {
      name: "クリップ_レイヤーで停止"
    }
  }
};
const CLIPTextEncode$3 = {
  description: "テキストプロンプトをCLIPモデルを使用してエンコードし、特定の画像を生成するために拡散モデルをガイドするために使用できる埋め込みに変換します。",
  display_name: "CLIPテキストエンコード（プロンプト）",
  inputs: {
    clip: {
      name: "クリップ",
      tooltip: "テキストのエンコードに使用されるCLIPモデル。"
    },
    text: {
      name: "テキスト",
      tooltip: "エンコードするテキスト。"
    }
  },
  outputs: {
    "0": {
      tooltip: "拡散モデルをガイドするために使用される埋め込まれたテキストを含む条件付け。"
    }
  }
};
const CLIPTextEncodeControlnet$3 = {
  display_name: "CLIPテキストエンコードコントロールネット",
  inputs: {
    clip: {
      name: "クリップ"
    },
    conditioning: {
      name: "コンディショニング"
    },
    text: {
      name: "テキスト"
    }
  }
};
const CLIPTextEncodeFlux$3 = {
  display_name: "CLIPテキストエンコードフラックス",
  inputs: {
    clip: {
      name: "クリップ"
    },
    clip_l: {
      name: "クリップ_l"
    },
    guidance: {
      name: "ガイダンス"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeHunyuanDiT$3 = {
  display_name: "CLIPテキストエンコードフンユアンDiT",
  inputs: {
    bert: {
      name: "bert"
    },
    clip: {
      name: "クリップ"
    },
    mt5xl: {
      name: "mt5xl"
    }
  }
};
const CLIPTextEncodePixArtAlpha$3 = {
  description: "テキストをエンコードし、PixArt Alphaの解像度条件を設定します。PixArt Sigmaには適用されません。",
  display_name: "CLIPTextEncodePixArtAlpha",
  inputs: {
    clip: {
      name: "clip"
    },
    height: {
      name: "高さ"
    },
    text: {
      name: "テキスト"
    },
    width: {
      name: "幅"
    }
  }
};
const CLIPTextEncodeSD3$3 = {
  display_name: "CLIPテキストエンコードSD3",
  inputs: {
    clip: {
      name: "クリップ"
    },
    clip_g: {
      name: "クリップ_g"
    },
    clip_l: {
      name: "クリップ_l"
    },
    empty_padding: {
      name: "空のパディング"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeSDXL$3 = {
  display_name: "CLIPテキストエンコードSDXL",
  inputs: {
    clip: {
      name: "クリップ"
    },
    crop_h: {
      name: "crop_h"
    },
    crop_w: {
      name: "crop_w"
    },
    height: {
      name: "高さ"
    },
    target_height: {
      name: "目標の高さ"
    },
    target_width: {
      name: "目標の幅"
    },
    text_g: {
      name: "テキスト_g"
    },
    text_l: {
      name: "テキスト_l"
    },
    width: {
      name: "幅"
    }
  }
};
const CLIPTextEncodeSDXLRefiner$3 = {
  display_name: "CLIPテキストエンコードSDXLリファイナー",
  inputs: {
    ascore: {
      name: "ascore"
    },
    clip: {
      name: "クリップ"
    },
    height: {
      name: "高さ"
    },
    text: {
      name: "テキスト"
    },
    width: {
      name: "幅"
    }
  }
};
const CLIPVisionEncode$3 = {
  display_name: "CLIPビジョンエンコード",
  inputs: {
    clip_vision: {
      name: "クリップビジョン"
    },
    crop: {
      name: "クロップ"
    },
    image: {
      name: "画像"
    }
  }
};
const CLIPVisionLoader$3 = {
  display_name: "CLIPビジョンを読み込む",
  inputs: {
    clip_name: {
      name: "クリップ名"
    }
  }
};
const Canny$3 = {
  display_name: "キャニー",
  inputs: {
    high_threshold: {
      name: "高い閾値"
    },
    image: {
      name: "イメージ"
    },
    low_threshold: {
      name: "低い閾値"
    }
  }
};
const CheckpointLoader$3 = {
  display_name: "設定でチェックポイントを読み込む（非推奨）",
  inputs: {
    ckpt_name: {
      name: "ckpt名"
    },
    config_name: {
      name: "設定名"
    }
  }
};
const CheckpointLoaderSimple$3 = {
  description: "拡散モデルのチェックポイントを読み込みます。拡散モデルは潜在変数のノイズを除去するために使用されます。",
  display_name: "チェックポイントを読み込む",
  inputs: {
    ckpt_name: {
      name: "ckpt名",
      tooltip: "読み込むチェックポイント（モデル）の名前。"
    }
  },
  outputs: {
    "0": {
      tooltip: "潜在変数のデノイズに使用されるモデル。"
    },
    "1": {
      tooltip: "テキストプロンプトをエンコードするために使用されるCLIPモデル。"
    },
    "2": {
      tooltip: "画像を潜在空間にエンコードおよびデコードするために使用されるVAEモデル。"
    }
  }
};
const CheckpointSave$3 = {
  display_name: "チェックポイントを保存",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "ファイル名プレフィックス"
    },
    model: {
      name: "モデル"
    },
    vae: {
      name: "vae"
    }
  }
};
const CombineHooks2$3 = {
  display_name: "フックを組み合わせる [2]",
  inputs: {
    hooks_A: {
      name: "フック_A"
    },
    hooks_B: {
      name: "フック_B"
    }
  }
};
const CombineHooks4$3 = {
  display_name: "フックを組み合わせる [4]",
  inputs: {
    hooks_A: {
      name: "フック_A"
    },
    hooks_B: {
      name: "フック_B"
    },
    hooks_C: {
      name: "フック_C"
    },
    hooks_D: {
      name: "フック_D"
    }
  }
};
const CombineHooks8$3 = {
  display_name: "フックを組み合わせる [8]",
  inputs: {
    hooks_A: {
      name: "フック_A"
    },
    hooks_B: {
      name: "フック_B"
    },
    hooks_C: {
      name: "フック_C"
    },
    hooks_D: {
      name: "フック_D"
    },
    hooks_E: {
      name: "フック_E"
    },
    hooks_F: {
      name: "フック_F"
    },
    hooks_G: {
      name: "フック_G"
    },
    hooks_H: {
      name: "フック_H"
    }
  }
};
const ConditioningAverage$3 = {
  display_name: "条件付け平均",
  inputs: {
    conditioning_from: {
      name: "条件付け元"
    },
    conditioning_to: {
      name: "条件付け先"
    },
    conditioning_to_strength: {
      name: "条件付け先の強度"
    }
  }
};
const ConditioningCombine$3 = {
  display_name: "条件付け（組み合わせ）",
  inputs: {
    conditioning_1: {
      name: "条件付け_1"
    },
    conditioning_2: {
      name: "条件付け_2"
    }
  }
};
const ConditioningConcat$3 = {
  display_name: "条件付け（連結）",
  inputs: {
    conditioning_from: {
      name: "条件付け元"
    },
    conditioning_to: {
      name: "条件付け先"
    }
  }
};
const ConditioningSetArea$3 = {
  display_name: "条件付け（エリア設定）",
  inputs: {
    conditioning: {
      name: "条件付け"
    },
    height: {
      name: "高さ"
    },
    strength: {
      name: "強度"
    },
    width: {
      name: "幅"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaPercentage$3 = {
  display_name: "条件付け（パーセンテージでエリア設定）",
  inputs: {
    conditioning: {
      name: "条件付け"
    },
    height: {
      name: "高さ"
    },
    strength: {
      name: "強度"
    },
    width: {
      name: "幅"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaStrength$3 = {
  display_name: "条件付けエリア強度",
  inputs: {
    conditioning: {
      name: "条件付け"
    },
    strength: {
      name: "強度"
    }
  }
};
const ConditioningSetDefaultCombine$3 = {
  display_name: "条件付けデフォルト組み合わせを設定",
  inputs: {
    cond: {
      name: "条件"
    },
    cond_DEFAULT: {
      name: "デフォルト条件"
    },
    hooks: {
      name: "フック"
    }
  }
};
const ConditioningSetMask$3 = {
  display_name: "条件付け（マスク設定）",
  inputs: {
    conditioning: {
      name: "条件付け"
    },
    mask: {
      name: "マスク"
    },
    set_cond_area: {
      name: "条件付けエリア設定"
    },
    strength: {
      name: "強度"
    }
  }
};
const ConditioningSetProperties$3 = {
  display_name: "条件付けプロパティ設定",
  inputs: {
    cond_NEW: {
      name: "新しい条件"
    },
    hooks: {
      name: "フック"
    },
    mask: {
      name: "マスク"
    },
    set_cond_area: {
      name: "条件付けエリア設定"
    },
    strength: {
      name: "強度"
    },
    timesteps: {
      name: "タイムステップ"
    }
  }
};
const ConditioningSetPropertiesAndCombine$3 = {
  display_name: "条件付けプロパティ設定と組み合わせ",
  inputs: {
    cond: {
      name: "条件"
    },
    cond_NEW: {
      name: "新しい条件"
    },
    hooks: {
      name: "フック"
    },
    mask: {
      name: "マスク"
    },
    set_cond_area: {
      name: "条件付けエリア設定"
    },
    strength: {
      name: "強度"
    },
    timesteps: {
      name: "タイムステップ"
    }
  }
};
const ConditioningSetTimestepRange$3 = {
  display_name: "条件付けタイムステップ範囲",
  inputs: {
    conditioning: {
      name: "コンディショニング"
    },
    end: {
      name: "終了"
    },
    start: {
      name: "開始"
    }
  }
};
const ConditioningStableAudio$3 = {
  display_name: "ConditioningStableAudio",
  inputs: {
    negative: {
      name: "ネガティブ"
    },
    positive: {
      name: "ポジティブ"
    },
    seconds_start: {
      name: "秒_開始"
    },
    seconds_total: {
      name: "秒_合計"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const ConditioningTimestepsRange$3 = {
  display_name: "タイムステップ範囲",
  inputs: {
    end_percent: {
      name: "終了パーセント"
    },
    start_percent: {
      name: "開始パーセント"
    }
  },
  outputs: {
    "1": {
      name: "範囲前"
    },
    "2": {
      name: "範囲後"
    }
  }
};
const ConditioningZeroOut$3 = {
  display_name: "条件付けゼロアウト",
  inputs: {
    conditioning: {
      name: "コンディショニング"
    }
  }
};
const ControlNetApply$3 = {
  display_name: "ControlNetを適用（旧）",
  inputs: {
    conditioning: {
      name: "コンディショニング"
    },
    control_net: {
      name: "コントロールネット"
    },
    image: {
      name: "画像"
    },
    strength: {
      name: "強度"
    }
  }
};
const ControlNetApplyAdvanced$3 = {
  display_name: "ControlNetを適用",
  inputs: {
    control_net: {
      name: "コントロールネット"
    },
    end_percent: {
      name: "終了パーセント"
    },
    image: {
      name: "画像"
    },
    negative: {
      name: "ネガティブ"
    },
    positive: {
      name: "ポジティブ"
    },
    start_percent: {
      name: "開始パーセント"
    },
    strength: {
      name: "強度"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const ControlNetApplySD3$3 = {
  display_name: "VAEでControlNetを適用",
  inputs: {
    control_net: {
      name: "コントロールネット"
    },
    end_percent: {
      name: "終了パーセント"
    },
    image: {
      name: "画像"
    },
    negative: {
      name: "ネガティブ"
    },
    positive: {
      name: "ポジティブ"
    },
    start_percent: {
      name: "開始パーセント"
    },
    strength: {
      name: "強度"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const ControlNetInpaintingAliMamaApply$3 = {
  display_name: "ControlNetインペインティングAliMamaを適用",
  inputs: {
    control_net: {
      name: "コントロールネット"
    },
    end_percent: {
      name: "終了パーセント"
    },
    image: {
      name: "画像"
    },
    mask: {
      name: "マスク"
    },
    negative: {
      name: "ネガティブ"
    },
    positive: {
      name: "ポジティブ"
    },
    start_percent: {
      name: "開始パーセント"
    },
    strength: {
      name: "強度"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const ControlNetLoader$3 = {
  display_name: "ControlNetモデルを読み込む",
  inputs: {
    control_net_name: {
      name: "コントロールネット名"
    }
  }
};
const CreateHookKeyframe$3 = {
  display_name: "フックキーフレームを作成",
  inputs: {
    prev_hook_kf: {
      name: "前のフックキーフレーム"
    },
    start_percent: {
      name: "開始パーセント"
    },
    strength_mult: {
      name: "強度倍数"
    }
  },
  outputs: {
    "0": {
      name: "フックKF"
    }
  }
};
const CreateHookKeyframesFromFloats$3 = {
  display_name: "フックキーフレームを浮動小数点から作成",
  inputs: {
    end_percent: {
      name: "終了パーセント"
    },
    floats_strength: {
      name: "浮動小数点数の強度"
    },
    prev_hook_kf: {
      name: "前のフックキーフレーム"
    },
    print_keyframes: {
      name: "キーフレームを印刷"
    },
    start_percent: {
      name: "開始パーセント"
    }
  },
  outputs: {
    "0": {
      name: "フックKF"
    }
  }
};
const CreateHookKeyframesInterpolated$3 = {
  display_name: "フックキーフレームを補間",
  inputs: {
    end_percent: {
      name: "end_percent"
    },
    interpolation: {
      name: "補間"
    },
    keyframes_count: {
      name: "キーフレーム数"
    },
    prev_hook_kf: {
      name: "prev_hook_kf"
    },
    print_keyframes: {
      name: "キーフレームを印刷"
    },
    start_percent: {
      name: "start_percent"
    },
    strength_end: {
      name: "strength_end"
    },
    strength_start: {
      name: "strength_start"
    }
  },
  outputs: {
    "0": {
      name: "フックKF"
    }
  }
};
const CreateHookLora$3 = {
  display_name: "フックLoRAを作成",
  inputs: {
    lora_name: {
      name: "lora_name"
    },
    prev_hooks: {
      name: "prev_hooks"
    },
    strength_clip: {
      name: "strength_clip"
    },
    strength_model: {
      name: "strength_model"
    }
  }
};
const CreateHookLoraModelOnly$3 = {
  display_name: "フックLoRA（モデルのみ）",
  inputs: {
    lora_name: {
      name: "lora_name"
    },
    prev_hooks: {
      name: "prev_hooks"
    },
    strength_model: {
      name: "strength_model"
    }
  }
};
const CreateHookModelAsLora$3 = {
  display_name: "フックモデルをLoRAとして作成",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    },
    prev_hooks: {
      name: "prev_hooks"
    },
    strength_clip: {
      name: "strength_clip"
    },
    strength_model: {
      name: "strength_model"
    }
  }
};
const CreateHookModelAsLoraModelOnly$3 = {
  display_name: "フックモデルをLoRAとして作成（モデルのみ）",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    },
    prev_hooks: {
      name: "prev_hooks"
    },
    strength_model: {
      name: "strength_model"
    }
  }
};
const CropMask$3 = {
  display_name: "マスクをトリミング",
  inputs: {
    height: {
      name: "高さ"
    },
    mask: {
      name: "マスク"
    },
    width: {
      name: "幅"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const DevToolsDeprecatedNode$3 = {
  description: "非推奨のノード",
  display_name: "非推奨ノード"
};
const DevToolsErrorRaiseNode$3 = {
  description: "開発目的のためにエラーを発生させる",
  display_name: "エラーを発生させる"
};
const DevToolsErrorRaiseNodeWithMessage$3 = {
  description: "開発目的のためにメッセージ付きのエラーを発生させる",
  display_name: "メッセージ付きエラーを発生させる",
  inputs: {
    message: {
      name: "メッセージ"
    }
  }
};
const DevToolsExperimentalNode$3 = {
  description: "実験的なノード",
  display_name: "実験的ノード"
};
const DevToolsLongComboDropdown$3 = {
  description: "長いコンボドロップダウン",
  display_name: "ロングコンボドロップダウン",
  inputs: {
    option: {
      name: "オプション"
    }
  }
};
const DevToolsNodeWithForceInput$3 = {
  description: "強制入力を持つノード",
  display_name: "強制入力ノード",
  inputs: {
    float_input: {
      name: "float_input"
    },
    int_input: {
      name: "int_input"
    },
    int_input_widget: {
      name: "int_input_widget"
    }
  }
};
const DevToolsNodeWithOnlyOptionalInput$3 = {
  description: "オプション入力のみを持つノード",
  display_name: "オプション入力のみのノード",
  inputs: {
    clip: {
      name: "clip"
    },
    text: {
      name: "テキスト"
    }
  }
};
const DevToolsNodeWithOptionalInput$3 = {
  description: "オプション入力を持つノード",
  display_name: "オプション入力ノード",
  inputs: {
    optional_input: {
      name: "オプション入力"
    },
    required_input: {
      name: "必須入力"
    }
  }
};
const DevToolsNodeWithOutputList$3 = {
  description: "出力リストを持つノード",
  display_name: "出力リストノード",
  outputs: {
    "0": {
      name: "整数出力"
    },
    "1": {
      name: "整数リスト出力"
    }
  }
};
const DevToolsNodeWithStringInput$3 = {
  description: "文字列入力を持つノード",
  display_name: "文字列入力ノード",
  inputs: {
    string_input: {
      name: "文字列入力"
    }
  }
};
const DevToolsNodeWithUnionInput$3 = {
  description: "ユニオン入力を持つノード",
  display_name: "ユニオン入力ノード",
  inputs: {
    int_input: {
      name: "整数入力"
    },
    string_input: {
      name: "文字列入力"
    },
    string_or_int_input: {
      name: "文字列または整数入力"
    }
  }
};
const DevToolsSimpleSlider$3 = {
  display_name: "シンプルスライダー",
  inputs: {
    value: {
      name: "値"
    }
  }
};
const DiffControlNetLoader$3 = {
  display_name: "ControlNetモデルを読み込む（diff）",
  inputs: {
    control_net_name: {
      name: "control_net_name"
    },
    model: {
      name: "モデル"
    }
  }
};
const DifferentialDiffusion$3 = {
  display_name: "差分拡散",
  inputs: {
    model: {
      name: "モデル"
    }
  }
};
const DiffusersLoader$3 = {
  display_name: "ディフューザーを読み込む",
  inputs: {
    model_path: {
      name: "モデルパス"
    }
  }
};
const DisableNoise$3 = {
  display_name: "ノイズを無効にする"
};
const DualCFGGuider$3 = {
  display_name: "デュアルCFGガイダー",
  inputs: {
    cfg_cond2_negative: {
      name: "cfg_cond2_negative"
    },
    cfg_conds: {
      name: "cfg_conds"
    },
    cond1: {
      name: "cond1"
    },
    cond2: {
      name: "cond2"
    },
    model: {
      name: "モデル"
    },
    negative: {
      name: "ネガティブ"
    }
  }
};
const DualCLIPLoader$3 = {
  description: "[レシピ]\n\nsdxl: clip-l, clip-g\nsd3: clip-l, clip-g / clip-l, t5 / clip-g, t5\nflux: clip-l, t5",
  display_name: "デュアルCLIPを読み込む",
  inputs: {
    clip_name1: {
      name: "clip_name1"
    },
    clip_name2: {
      name: "clip_name2"
    },
    type: {
      name: "タイプ"
    }
  }
};
const EmptyHunyuanLatentVideo$3 = {
  display_name: "EmptyHunyuanLatentVideo",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    height: {
      name: "高さ"
    },
    length: {
      name: "長さ"
    },
    width: {
      name: "幅"
    }
  }
};
const EmptyImage$3 = {
  display_name: "空の画像",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    color: {
      name: "色"
    },
    height: {
      name: "高さ"
    },
    width: {
      name: "幅"
    }
  }
};
const EmptyLTXVLatentVideo$3 = {
  display_name: "空のLTXV潜在ビデオ",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    height: {
      name: "高さ"
    },
    length: {
      name: "長さ"
    },
    width: {
      name: "幅"
    }
  }
};
const EmptyLatentAudio$3 = {
  display_name: "空の潜在音声",
  inputs: {
    batch_size: {
      name: "バッチサイズ",
      tooltip: "バッチ内の潜在画像の数。"
    },
    seconds: {
      name: "秒"
    }
  }
};
const EmptyLatentImage$3 = {
  description: "サンプリングを通じてノイズを除去するための空の潜在画像の新しいバッチを作成します。",
  display_name: "空の潜在画像",
  inputs: {
    batch_size: {
      name: "バッチサイズ",
      tooltip: "バッチ内の潜在画像の数。"
    },
    height: {
      name: "高さ",
      tooltip: "潜在画像の高さ（ピクセル単位）。"
    },
    width: {
      name: "幅",
      tooltip: "潜在画像の幅（ピクセル単位）。"
    }
  },
  outputs: {
    "0": {
      tooltip: "空の潜在画像バッチ。"
    }
  }
};
const EmptyMochiLatentVideo$3 = {
  display_name: "空のMochi潜在ビデオ",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    height: {
      name: "高さ"
    },
    length: {
      name: "長さ"
    },
    width: {
      name: "幅"
    }
  }
};
const EmptySD3LatentImage$3 = {
  display_name: "空のSD3潜在画像",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    height: {
      name: "高さ"
    },
    width: {
      name: "幅"
    }
  }
};
const ExponentialScheduler$3 = {
  display_name: "指数スケジューラー",
  inputs: {
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const FeatherMask$3 = {
  display_name: "フェザー マスク",
  inputs: {
    bottom: {
      name: "下"
    },
    left: {
      name: "左"
    },
    mask: {
      name: "マスク"
    },
    right: {
      name: "右"
    },
    top: {
      name: "上"
    }
  }
};
const FlipSigmas$3 = {
  display_name: "シグマを反転",
  inputs: {
    sigmas: {
      name: "sigmas"
    }
  }
};
const FluxGuidance$3 = {
  display_name: "フラックスガイダンス",
  inputs: {
    conditioning: {
      name: "コンディショニング"
    },
    guidance: {
      name: "ガイダンス"
    }
  }
};
const FreeU$3 = {
  display_name: "FreeU",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "モデル"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const FreeU_V2$3 = {
  display_name: "FreeU_V2",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "モデル"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const GITSScheduler$3 = {
  display_name: "GITSスケジューラー",
  inputs: {
    coeff: {
      name: "係数"
    },
    denoise: {
      name: "ノイズ除去"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const GLIGENLoader$3 = {
  display_name: "GLIGENを読み込む",
  inputs: {
    gligen_name: {
      name: "gligen_name"
    }
  }
};
const GLIGENTextBoxApply$3 = {
  display_name: "GLIGENテキストボックスを適用",
  inputs: {
    clip: {
      name: "クリップ"
    },
    conditioning_to: {
      name: "条件付け先"
    },
    gligen_textbox_model: {
      name: "gligen_textbox_model"
    },
    height: {
      name: "高さ"
    },
    text: {
      name: "テキスト"
    },
    width: {
      name: "幅"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const GrowMask$3 = {
  display_name: "マスクを拡大",
  inputs: {
    expand: {
      name: "拡大"
    },
    mask: {
      name: "マスク"
    },
    tapered_corners: {
      name: "テーパードコーナー"
    }
  }
};
const HyperTile$3 = {
  display_name: "ハイパータイル",
  inputs: {
    max_depth: {
      name: "最大深度"
    },
    model: {
      name: "モデル"
    },
    scale_depth: {
      name: "スケール深度"
    },
    swap_size: {
      name: "スワップサイズ"
    },
    tile_size: {
      name: "タイルサイズ"
    }
  }
};
const HypernetworkLoader$3 = {
  display_name: "ハイパーネットワークを読み込む",
  inputs: {
    hypernetwork_name: {
      name: "hypernetwork_name"
    },
    model: {
      name: "モデル"
    },
    strength: {
      name: "強度"
    }
  }
};
const ImageBatch$3 = {
  display_name: "画像バッチ",
  inputs: {
    image1: {
      name: "画像1"
    },
    image2: {
      name: "画像2"
    }
  }
};
const ImageBlend$3 = {
  display_name: "画像ブレンド",
  inputs: {
    blend_factor: {
      name: "ブレンドファクター"
    },
    blend_mode: {
      name: "ブレンドモード"
    },
    image1: {
      name: "画像1"
    },
    image2: {
      name: "画像2"
    }
  }
};
const ImageBlur$3 = {
  display_name: "画像ぼかし",
  inputs: {
    blur_radius: {
      name: "ブラーレイディウス"
    },
    image: {
      name: "画像"
    },
    sigma: {
      name: "シグマ"
    }
  }
};
const ImageColorToMask$3 = {
  display_name: "画像色をマスクに変換",
  inputs: {
    color: {
      name: "色"
    },
    image: {
      name: "画像"
    }
  }
};
const ImageCompositeMasked$3 = {
  display_name: "マスクされた画像合成",
  inputs: {
    destination: {
      name: "宛先"
    },
    mask: {
      name: "マスク"
    },
    resize_source: {
      name: "ソースのリサイズ"
    },
    source: {
      name: "ソース"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageCrop$3 = {
  display_name: "画像トリミング",
  inputs: {
    height: {
      name: "高さ"
    },
    image: {
      name: "画像"
    },
    width: {
      name: "幅"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageFromBatch$3 = {
  display_name: "バッチから画像を取得",
  inputs: {
    batch_index: {
      name: "バッチインデックス"
    },
    image: {
      name: "画像"
    },
    length: {
      name: "長さ"
    }
  }
};
const ImageInvert$3 = {
  display_name: "画像を反転",
  inputs: {
    image: {
      name: "画像"
    }
  }
};
const ImageOnlyCheckpointLoader$3 = {
  display_name: "画像のみのチェックポイントローダー（img2vidモデル）",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    }
  }
};
const ImageOnlyCheckpointSave$3 = {
  display_name: "画像のみのチェックポイント保存",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    filename_prefix: {
      name: "ファイル名プレフィックス"
    },
    model: {
      name: "モデル"
    },
    vae: {
      name: "vae"
    }
  }
};
const ImagePadForOutpaint$3 = {
  display_name: "アウトペイント用に画像をパッド",
  inputs: {
    bottom: {
      name: "下"
    },
    feathering: {
      name: "フェザリング"
    },
    image: {
      name: "画像"
    },
    left: {
      name: "左"
    },
    right: {
      name: "右"
    },
    top: {
      name: "上"
    }
  }
};
const ImageQuantize$3 = {
  display_name: "画像を量子化",
  inputs: {
    colors: {
      name: "色"
    },
    dither: {
      name: "ディザリング"
    },
    image: {
      name: "画像"
    }
  }
};
const ImageScale$3 = {
  display_name: "画像を拡大",
  inputs: {
    crop: {
      name: "クロップ"
    },
    height: {
      name: "高さ"
    },
    image: {
      name: "画像"
    },
    upscale_method: {
      name: "拡大方法"
    },
    width: {
      name: "幅"
    }
  }
};
const ImageScaleBy$3 = {
  display_name: "画像を拡大（指定サイズ）",
  inputs: {
    image: {
      name: "画像"
    },
    scale_by: {
      name: "スケールバイ"
    },
    upscale_method: {
      name: "拡大方法"
    }
  }
};
const ImageScaleToTotalPixels$3 = {
  display_name: "画像を総ピクセルにスケール",
  inputs: {
    image: {
      name: "画像"
    },
    megapixels: {
      name: "メガピクセル"
    },
    upscale_method: {
      name: "拡大方法"
    }
  }
};
const ImageSharpen$3 = {
  display_name: "画像をシャープ化",
  inputs: {
    alpha: {
      name: "アルファ"
    },
    image: {
      name: "画像"
    },
    sharpen_radius: {
      name: "シャープ化半径"
    },
    sigma: {
      name: "シグマ"
    }
  }
};
const ImageToMask$3 = {
  display_name: "画像をマスクに変換",
  inputs: {
    channel: {
      name: "チャンネル"
    },
    image: {
      name: "画像"
    }
  }
};
const ImageUpscaleWithModel$3 = {
  display_name: "モデルを使用して画像を拡大",
  inputs: {
    image: {
      name: "画像"
    },
    upscale_model: {
      name: "拡大モデル"
    }
  }
};
const InpaintModelConditioning$3 = {
  display_name: "インペイントモデル条件付け",
  inputs: {
    mask: {
      name: "マスク"
    },
    negative: {
      name: "ネガティブ"
    },
    noise_mask: {
      name: "ノイズマスク",
      tooltip: "潜在にノイズマスクを追加し、サンプリングがマスク内でのみ行われるようにします。モデルによっては結果が改善されるか、完全に壊れる可能性があります。"
    },
    pixels: {
      name: "ピクセル"
    },
    positive: {
      name: "ポジティブ"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    },
    "2": {
      name: "潜在"
    }
  }
};
const InstructPixToPixConditioning$3 = {
  display_name: "PixToPix条件付け",
  inputs: {
    negative: {
      name: "ネガティブ"
    },
    pixels: {
      name: "ピクセル"
    },
    positive: {
      name: "ポジティブ"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    },
    "2": {
      name: "潜在"
    }
  }
};
const InvertMask$3 = {
  display_name: "マスクを反転",
  inputs: {
    mask: {
      name: "マスク"
    }
  }
};
const JoinImageWithAlpha$3 = {
  display_name: "アルファで画像を結合",
  inputs: {
    alpha: {
      name: "アルファ"
    },
    image: {
      name: "画像"
    }
  }
};
const KSampler$3 = {
  description: "提供されたモデル、正の条件付けと負の条件付けを使用して潜在画像のノイズを除去します。",
  display_name: "Kサンプラー",
  inputs: {
    cfg: {
      name: "cfg",
      tooltip: "Classifier-Free Guidanceスケールは、創造性とプロンプトへの遵守のバランスを取ります。値が高いほど、生成される画像はプロンプトにより近くなりますが、値が高すぎると品質に悪影響を及ぼす可能性があります。"
    },
    denoise: {
      name: "ノイズ除去",
      tooltip: "適用されるデノイズの量。値が低いほど、初期画像の構造を維持し、画像から画像へのサンプリングが可能になります。"
    },
    latent_image: {
      name: "潜在画像",
      tooltip: "デノイズする潜在画像。"
    },
    model: {
      name: "モデル",
      tooltip: "入力潜在のデノイズに使用されるモデル。"
    },
    negative: {
      name: "ネガティブ",
      tooltip: "画像から除外したい属性を説明する条件付け。"
    },
    positive: {
      name: "ポジティブ",
      tooltip: "画像に含めたい属性を説明する条件付け。"
    },
    sampler_name: {
      name: "サンプラー名",
      tooltip: "サンプリング時に使用されるアルゴリズムで、生成される出力の品質、速度、スタイルに影響を与える可能性があります。"
    },
    scheduler: {
      name: "スケジューラ",
      tooltip: "スケジューラは、ノイズが徐々に除去されて画像が形成される方法を制御します。"
    },
    seed: {
      name: "シード",
      tooltip: "ノイズを生成するために使用されるランダムシード。"
    },
    steps: {
      name: "ステップ",
      tooltip: "デノイズプロセスで使用されるステップ数。"
    }
  },
  outputs: {
    "0": {
      tooltip: "デノイズされた潜在変数。"
    }
  }
};
const KSamplerAdvanced$3 = {
  display_name: "Kサンプラー（高度）",
  inputs: {
    add_noise: {
      name: "ノイズ追加"
    },
    cfg: {
      name: "cfg"
    },
    end_at_step: {
      name: "ステップ終了"
    },
    latent_image: {
      name: "潜在画像"
    },
    model: {
      name: "モデル"
    },
    negative: {
      name: "ネガティブ"
    },
    noise_seed: {
      name: "ノイズシード"
    },
    positive: {
      name: "ポジティブ"
    },
    return_with_leftover_noise: {
      name: "残りのノイズと一緒に返す"
    },
    sampler_name: {
      name: "サンプラー名"
    },
    scheduler: {
      name: "スケジューラ"
    },
    start_at_step: {
      name: "ステップ開始"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const KSamplerSelect$3 = {
  display_name: "Kサンプラー選択",
  inputs: {
    sampler_name: {
      name: "サンプラー名"
    }
  }
};
const KarrasScheduler$3 = {
  display_name: "カラススケジューラー",
  inputs: {
    rho: {
      name: "ロー"
    },
    sigma_max: {
      name: "シグマ_最大"
    },
    sigma_min: {
      name: "シグマ_最小"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const LTXVConditioning$3 = {
  display_name: "LTXV条件付け",
  inputs: {
    frame_rate: {
      name: "フレームレート"
    },
    negative: {
      name: "ネガティブ"
    },
    positive: {
      name: "ポジティブ"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const LTXVImgToVideo$3 = {
  display_name: "LTXV画像からビデオへ",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    height: {
      name: "高さ"
    },
    image: {
      name: "画像"
    },
    image_noise_scale: {
      name: "画像ノイズスケール",
      tooltip: "条件付け画像の潜在に適用するノイズの量。"
    },
    length: {
      name: "長さ"
    },
    negative: {
      name: "ネガティブ"
    },
    positive: {
      name: "ポジティブ"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "幅"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    },
    "2": {
      name: "潜在"
    }
  }
};
const LTXVScheduler$3 = {
  display_name: "LTXVスケジューラー",
  inputs: {
    base_shift: {
      name: "基本シフト"
    },
    latent: {
      name: "潜在"
    },
    max_shift: {
      name: "最大シフト"
    },
    steps: {
      name: "ステップ"
    },
    stretch: {
      name: "ストレッチ",
      tooltip: "シグマを[terminal, 1]の範囲に伸ばします。"
    },
    terminal: {
      name: "端末",
      tooltip: "ストレッチ後のシグマの端末値。"
    }
  }
};
const LaplaceScheduler$3 = {
  display_name: "ラプラススケジューラー",
  inputs: {
    beta: {
      name: "ベータ"
    },
    mu: {
      name: "ミュー"
    },
    sigma_max: {
      name: "シグマ_最大"
    },
    sigma_min: {
      name: "シグマ_最小"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const LatentAdd$3 = {
  display_name: "潜在追加",
  inputs: {
    samples1: {
      name: "サンプル1"
    },
    samples2: {
      name: "サンプル2"
    }
  }
};
const LatentApplyOperation$3 = {
  display_name: "潜在操作を適用",
  inputs: {
    operation: {
      name: "操作"
    },
    samples: {
      name: "サンプル"
    }
  }
};
const LatentApplyOperationCFG$3 = {
  display_name: "潜在操作CFGを適用",
  inputs: {
    model: {
      name: "モデル"
    },
    operation: {
      name: "操作"
    }
  }
};
const LatentBatch$3 = {
  display_name: "潜在バッチ",
  inputs: {
    samples1: {
      name: "サンプル1"
    },
    samples2: {
      name: "サンプル2"
    }
  }
};
const LatentBatchSeedBehavior$3 = {
  display_name: "潜在バッチシード動作",
  inputs: {
    samples: {
      name: "サンプル"
    },
    seed_behavior: {
      name: "シード行動"
    }
  }
};
const LatentBlend$3 = {
  display_name: "潜在ブレンド",
  inputs: {
    blend_factor: {
      name: "ブレンド係数"
    },
    samples1: {
      name: "サンプル1"
    },
    samples2: {
      name: "サンプル2"
    }
  }
};
const LatentComposite$3 = {
  display_name: "潜在合成",
  inputs: {
    feather: {
      name: "フェザー"
    },
    samples_from: {
      name: "samples_from"
    },
    samples_to: {
      name: "samples_to"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCompositeMasked$3 = {
  display_name: "マスクされた潜在合成",
  inputs: {
    destination: {
      name: "destination"
    },
    mask: {
      name: "マスク"
    },
    resize_source: {
      name: "resize_source"
    },
    source: {
      name: "source"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCrop$3 = {
  display_name: "潜在トリミング",
  inputs: {
    height: {
      name: "高さ"
    },
    samples: {
      name: "samples"
    },
    width: {
      name: "幅"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentFlip$3 = {
  display_name: "潜在反転",
  inputs: {
    flip_method: {
      name: "反転方法"
    },
    samples: {
      name: "samples"
    }
  }
};
const LatentFromBatch$3 = {
  display_name: "バッチから潜在を取得",
  inputs: {
    batch_index: {
      name: "バッチインデックス"
    },
    length: {
      name: "長さ"
    },
    samples: {
      name: "samples"
    }
  }
};
const LatentInterpolate$3 = {
  display_name: "潜在補間",
  inputs: {
    ratio: {
      name: "比率"
    },
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    }
  }
};
const LatentMultiply$3 = {
  display_name: "潜在乗算",
  inputs: {
    multiplier: {
      name: "乗数"
    },
    samples: {
      name: "samples"
    }
  }
};
const LatentOperationSharpen$3 = {
  display_name: "潜在操作シャープ化",
  inputs: {
    alpha: {
      name: "アルファ"
    },
    sharpen_radius: {
      name: "シャープ化半径"
    },
    sigma: {
      name: "シグマ"
    }
  }
};
const LatentOperationTonemapReinhard$3 = {
  display_name: "潜在操作トーンマップライナード",
  inputs: {
    multiplier: {
      name: "乗数"
    }
  }
};
const LatentRotate$3 = {
  display_name: "潜在回転",
  inputs: {
    rotation: {
      name: "回転"
    },
    samples: {
      name: "samples"
    }
  }
};
const LatentSubtract$3 = {
  display_name: "潜在減算",
  inputs: {
    samples1: {
      name: "samples1"
    },
    samples2: {
      name: "samples2"
    }
  }
};
const LatentUpscale$3 = {
  display_name: "潜在を拡大",
  inputs: {
    crop: {
      name: "クロップ"
    },
    height: {
      name: "高さ"
    },
    samples: {
      name: "samples"
    },
    upscale_method: {
      name: "拡大方法"
    },
    width: {
      name: "幅"
    }
  }
};
const LatentUpscaleBy$3 = {
  display_name: "潜在を拡大（指定サイズ）",
  inputs: {
    samples: {
      name: "samples"
    },
    scale_by: {
      name: "スケールバイ"
    },
    upscale_method: {
      name: "拡大方法"
    }
  }
};
const Load3D$3 = {
  display_name: "3Dを読み込む",
  inputs: {
    bg_color: {
      name: "背景色"
    },
    camera_type: {
      name: "カメラタイプ"
    },
    height: {
      name: "高さ"
    },
    image: {
      name: "画像"
    },
    light_intensity: {
      name: "光の強度"
    },
    material: {
      name: "素材"
    },
    model_file: {
      name: "モデルファイル"
    },
    show_grid: {
      name: "グリッドを表示"
    },
    up_direction: {
      name: "上方向"
    },
    view: {
      name: "ビュー"
    },
    width: {
      name: "幅"
    }
  },
  outputs: {
    "0": {
      name: "画像"
    },
    "1": {
      name: "マスク"
    },
    "2": {
      name: "メッシュパス"
    }
  }
};
const Load3DAnimation$3 = {
  display_name: "3Dを読み込む - アニメーション",
  inputs: {
    animation_speed: {
      name: "アニメーション速度"
    },
    bg_color: {
      name: "背景色"
    },
    camera_type: {
      name: "カメラタイプ"
    },
    height: {
      name: "高さ"
    },
    image: {
      name: "画像"
    },
    light_intensity: {
      name: "光の強度"
    },
    material: {
      name: "素材"
    },
    model_file: {
      name: "モデルファイル"
    },
    show_grid: {
      name: "グリッドを表示"
    },
    up_direction: {
      name: "上方向"
    },
    view: {
      name: "ビュー"
    },
    width: {
      name: "幅"
    }
  },
  outputs: {
    "0": {
      name: "画像"
    },
    "1": {
      name: "マスク"
    },
    "2": {
      name: "メッシュパス"
    }
  }
};
const LoadAudio$3 = {
  display_name: "音声を読み込む",
  inputs: {
    audio: {
      name: "オーディオ"
    }
  }
};
const LoadImage$3 = {
  display_name: "画像を読み込む",
  inputs: {
    image: {
      name: "画像"
    }
  }
};
const LoadImageMask$3 = {
  display_name: "画像を読み込む（マスクとして）",
  inputs: {
    channel: {
      name: "チャンネル"
    },
    image: {
      name: "画像"
    }
  }
};
const LoadLatent$3 = {
  display_name: "潜在を読み込む",
  inputs: {
    latent: {
      name: "latent"
    }
  }
};
const LoraLoader$3 = {
  description: "LoRAは拡散およびCLIPモデルを修正するために使用され、潜在のノイズ除去方法を変更します。複数のLoRAノードを連結できます。",
  display_name: "LoRAを読み込む",
  inputs: {
    clip: {
      name: "クリップ",
      tooltip: "LoRAが適用されるCLIPモデル。"
    },
    lora_name: {
      name: "lora_name",
      tooltip: "LoRAの名前。"
    },
    model: {
      name: "モデル",
      tooltip: "LoRAが適用される拡散モデル。"
    },
    strength_clip: {
      name: "クリップの強度",
      tooltip: "CLIPモデルをどの程度変更するか。この値は負の値になる可能性があります。"
    },
    strength_model: {
      name: "モデルの強度",
      tooltip: "拡散モデルをどの程度変更するか。この値は負の値になる可能性があります。"
    }
  },
  outputs: {
    "0": {
      tooltip: "修正された拡散モデル。"
    },
    "1": {
      tooltip: "修正されたCLIPモデル。"
    }
  }
};
const LoraLoaderModelOnly$3 = {
  description: "LoRAは拡散およびCLIPモデルを修正するために使用され、潜在のノイズ除去方法を変更します。複数のLoRAノードを連結できます。",
  display_name: "LoRAローダーモデルのみ",
  inputs: {
    lora_name: {
      name: "lora_name"
    },
    model: {
      name: "モデル"
    },
    strength_model: {
      name: "モデルの強度"
    }
  },
  outputs: {
    "0": {
      tooltip: "修正された拡散モデル。"
    }
  }
};
const LoraSave$3 = {
  display_name: "LoRAを抽出して保存",
  inputs: {
    bias_diff: {
      name: "バイアスの差"
    },
    filename_prefix: {
      name: "ファイル名のプレフィックス"
    },
    lora_type: {
      name: "lora_type"
    },
    model_diff: {
      name: "モデルの差",
      tooltip: "loraに変換されるModelSubtract出力。"
    },
    rank: {
      name: "ランク"
    },
    text_encoder_diff: {
      name: "テキストエンコーダの差",
      tooltip: "loraに変換されるCLIPSubtract出力。"
    }
  }
};
const Mahiro$3 = {
  description: "ネガティブなプロンプトとの差ではなく、ポジティブなプロンプトの「方向」によりスケールするようにガイダンスを修正します。",
  display_name: "Mahiroはとても可愛いので、より良いガイダンス機能が必要です!! (。・ω・。)",
  inputs: {
    model: {
      name: "モデル"
    }
  },
  outputs: {
    "0": {
      name: "パッチ適用モデル"
    }
  }
};
const MaskComposite$3 = {
  display_name: "マスク合成",
  inputs: {
    destination: {
      name: "目的地"
    },
    operation: {
      name: "操作"
    },
    source: {
      name: "ソース"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const MaskToImage$3 = {
  display_name: "マスクを画像に変換",
  inputs: {
    mask: {
      name: "マスク"
    }
  }
};
const ModelMergeAdd$3 = {
  display_name: "モデルマージ追加",
  inputs: {
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    }
  }
};
const ModelMergeAuraflow$3 = {
  display_name: "モデルマージオーラフロー",
  inputs: {
    cond_seq_linear_: {
      name: "cond_seq_linear."
    },
    double_layers_0_: {
      name: "double_layers.0."
    },
    double_layers_1_: {
      name: "double_layers.1."
    },
    double_layers_2_: {
      name: "double_layers.2."
    },
    double_layers_3_: {
      name: "double_layers.3."
    },
    final_linear_: {
      name: "final_linear."
    },
    init_x_linear_: {
      name: "init_x_linear."
    },
    modF_: {
      name: "modF."
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    positional_encoding: {
      name: "位置エンコーディング"
    },
    register_tokens: {
      name: "トークンを登録"
    },
    single_layers_0_: {
      name: "single_layers.0."
    },
    single_layers_10_: {
      name: "single_layers.10."
    },
    single_layers_11_: {
      name: "single_layers.11."
    },
    single_layers_12_: {
      name: "single_layers.12."
    },
    single_layers_13_: {
      name: "single_layers.13."
    },
    single_layers_14_: {
      name: "single_layers.14."
    },
    single_layers_15_: {
      name: "single_layers.15."
    },
    single_layers_16_: {
      name: "single_layers.16."
    },
    single_layers_17_: {
      name: "single_layers.17."
    },
    single_layers_18_: {
      name: "single_layers.18."
    },
    single_layers_19_: {
      name: "single_layers.19."
    },
    single_layers_1_: {
      name: "single_layers.1."
    },
    single_layers_20_: {
      name: "single_layers.20."
    },
    single_layers_21_: {
      name: "single_layers.21."
    },
    single_layers_22_: {
      name: "single_layers.22."
    },
    single_layers_23_: {
      name: "single_layers.23."
    },
    single_layers_24_: {
      name: "single_layers.24."
    },
    single_layers_25_: {
      name: "single_layers.25."
    },
    single_layers_26_: {
      name: "single_layers.26."
    },
    single_layers_27_: {
      name: "single_layers.27."
    },
    single_layers_28_: {
      name: "single_layers.28."
    },
    single_layers_29_: {
      name: "single_layers.29."
    },
    single_layers_2_: {
      name: "single_layers.2."
    },
    single_layers_30_: {
      name: "single_layers.30."
    },
    single_layers_31_: {
      name: "single_layers.31."
    },
    single_layers_3_: {
      name: "single_layers.3."
    },
    single_layers_4_: {
      name: "single_layers.4."
    },
    single_layers_5_: {
      name: "single_layers.5."
    },
    single_layers_6_: {
      name: "single_layers.6."
    },
    single_layers_7_: {
      name: "single_layers.7."
    },
    single_layers_8_: {
      name: "single_layers.8."
    },
    single_layers_9_: {
      name: "single_layers.9."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeBlocks$3 = {
  display_name: "モデルマージブロック",
  inputs: {
    input: {
      name: "入力"
    },
    middle: {
      name: "中間"
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    out: {
      name: "出力"
    }
  }
};
const ModelMergeFlux1$3 = {
  display_name: "モデルマージフラックス1",
  inputs: {
    double_blocks_0_: {
      name: "double_blocks.0."
    },
    double_blocks_10_: {
      name: "double_blocks.10."
    },
    double_blocks_11_: {
      name: "double_blocks.11."
    },
    double_blocks_12_: {
      name: "double_blocks.12."
    },
    double_blocks_13_: {
      name: "double_blocks.13."
    },
    double_blocks_14_: {
      name: "double_blocks.14."
    },
    double_blocks_15_: {
      name: "double_blocks.15."
    },
    double_blocks_16_: {
      name: "double_blocks.16."
    },
    double_blocks_17_: {
      name: "double_blocks.17."
    },
    double_blocks_18_: {
      name: "double_blocks.18."
    },
    double_blocks_1_: {
      name: "double_blocks.1."
    },
    double_blocks_2_: {
      name: "double_blocks.2."
    },
    double_blocks_3_: {
      name: "double_blocks.3."
    },
    double_blocks_4_: {
      name: "double_blocks.4."
    },
    double_blocks_5_: {
      name: "double_blocks.5."
    },
    double_blocks_6_: {
      name: "double_blocks.6."
    },
    double_blocks_7_: {
      name: "double_blocks.7."
    },
    double_blocks_8_: {
      name: "double_blocks.8."
    },
    double_blocks_9_: {
      name: "double_blocks.9."
    },
    final_layer_: {
      name: "final_layer."
    },
    guidance_in: {
      name: "guidance_in"
    },
    img_in_: {
      name: "img_in."
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    single_blocks_0_: {
      name: "single_blocks.0."
    },
    single_blocks_10_: {
      name: "single_blocks.10."
    },
    single_blocks_11_: {
      name: "single_blocks.11."
    },
    single_blocks_12_: {
      name: "single_blocks.12."
    },
    single_blocks_13_: {
      name: "single_blocks.13."
    },
    single_blocks_14_: {
      name: "single_blocks.14."
    },
    single_blocks_15_: {
      name: "single_blocks.15."
    },
    single_blocks_16_: {
      name: "single_blocks.16."
    },
    single_blocks_17_: {
      name: "single_blocks.17."
    },
    single_blocks_18_: {
      name: "single_blocks.18."
    },
    single_blocks_19_: {
      name: "single_blocks.19."
    },
    single_blocks_1_: {
      name: "single_blocks.1."
    },
    single_blocks_20_: {
      name: "single_blocks.20."
    },
    single_blocks_21_: {
      name: "single_blocks.21."
    },
    single_blocks_22_: {
      name: "single_blocks.22."
    },
    single_blocks_23_: {
      name: "single_blocks.23."
    },
    single_blocks_24_: {
      name: "single_blocks.24."
    },
    single_blocks_25_: {
      name: "single_blocks.25."
    },
    single_blocks_26_: {
      name: "single_blocks.26."
    },
    single_blocks_27_: {
      name: "single_blocks.27."
    },
    single_blocks_28_: {
      name: "single_blocks.28."
    },
    single_blocks_29_: {
      name: "single_blocks.29."
    },
    single_blocks_2_: {
      name: "single_blocks.2."
    },
    single_blocks_30_: {
      name: "single_blocks.30."
    },
    single_blocks_31_: {
      name: "single_blocks.31."
    },
    single_blocks_32_: {
      name: "single_blocks.32."
    },
    single_blocks_33_: {
      name: "single_blocks.33."
    },
    single_blocks_34_: {
      name: "single_blocks.34."
    },
    single_blocks_35_: {
      name: "single_blocks.35."
    },
    single_blocks_36_: {
      name: "single_blocks.36."
    },
    single_blocks_37_: {
      name: "single_blocks.37."
    },
    single_blocks_3_: {
      name: "single_blocks.3."
    },
    single_blocks_4_: {
      name: "single_blocks.4."
    },
    single_blocks_5_: {
      name: "single_blocks.5."
    },
    single_blocks_6_: {
      name: "single_blocks.6."
    },
    single_blocks_7_: {
      name: "single_blocks.7."
    },
    single_blocks_8_: {
      name: "single_blocks.8."
    },
    single_blocks_9_: {
      name: "single_blocks.9."
    },
    time_in_: {
      name: "time_in."
    },
    txt_in_: {
      name: "txt_in."
    },
    vector_in_: {
      name: "vector_in."
    }
  }
};
const ModelMergeLTXV$3 = {
  display_name: "モデルマージLTXV",
  inputs: {
    adaln_single_: {
      name: "adaln_single."
    },
    caption_projection_: {
      name: "キャプション投影."
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    patchify_proj_: {
      name: "patchify_proj."
    },
    proj_out_: {
      name: "proj_out."
    },
    scale_shift_table: {
      name: "スケールシフトテーブル"
    },
    transformer_blocks_0_: {
      name: "トランスフォーマーブロック.0."
    },
    transformer_blocks_10_: {
      name: "トランスフォーマーブロック.10."
    },
    transformer_blocks_11_: {
      name: "トランスフォーマーブロック.11."
    },
    transformer_blocks_12_: {
      name: "トランスフォーマーブロック.12."
    },
    transformer_blocks_13_: {
      name: "トランスフォーマーブロック.13."
    },
    transformer_blocks_14_: {
      name: "トランスフォーマーブロック.14."
    },
    transformer_blocks_15_: {
      name: "トランスフォーマーブロック.15."
    },
    transformer_blocks_16_: {
      name: "トランスフォーマーブロック.16."
    },
    transformer_blocks_17_: {
      name: "トランスフォーマーブロック.17."
    },
    transformer_blocks_18_: {
      name: "トランスフォーマーブロック.18."
    },
    transformer_blocks_19_: {
      name: "トランスフォーマーブロック.19."
    },
    transformer_blocks_1_: {
      name: "トランスフォーマーブロック.1."
    },
    transformer_blocks_20_: {
      name: "トランスフォーマーブロック.20."
    },
    transformer_blocks_21_: {
      name: "トランスフォーマーブロック.21."
    },
    transformer_blocks_22_: {
      name: "トランスフォーマーブロック.22."
    },
    transformer_blocks_23_: {
      name: "トランスフォーマーブロック.23."
    },
    transformer_blocks_24_: {
      name: "トランスフォーマーブロック.24."
    },
    transformer_blocks_25_: {
      name: "トランスフォーマーブロック.25."
    },
    transformer_blocks_26_: {
      name: "トランスフォーマーブロック.26."
    },
    transformer_blocks_27_: {
      name: "トランスフォーマーブロック.27."
    },
    transformer_blocks_2_: {
      name: "トランスフォーマーブロック.2."
    },
    transformer_blocks_3_: {
      name: "トランスフォーマーブロック.3."
    },
    transformer_blocks_4_: {
      name: "トランスフォーマーブロック.4."
    },
    transformer_blocks_5_: {
      name: "トランスフォーマーブロック.5."
    },
    transformer_blocks_6_: {
      name: "トランスフォーマーブロック.6."
    },
    transformer_blocks_7_: {
      name: "トランスフォーマーブロック.7."
    },
    transformer_blocks_8_: {
      name: "トランスフォーマーブロック.8."
    },
    transformer_blocks_9_: {
      name: "トランスフォーマーブロック.9."
    }
  }
};
const ModelMergeMochiPreview$3 = {
  display_name: "モデルマージMochiプレビュー",
  inputs: {
    blocks_0_: {
      name: "blocks.0."
    },
    blocks_10_: {
      name: "blocks.10."
    },
    blocks_11_: {
      name: "blocks.11."
    },
    blocks_12_: {
      name: "blocks.12."
    },
    blocks_13_: {
      name: "blocks.13."
    },
    blocks_14_: {
      name: "blocks.14."
    },
    blocks_15_: {
      name: "blocks.15."
    },
    blocks_16_: {
      name: "blocks.16."
    },
    blocks_17_: {
      name: "blocks.17."
    },
    blocks_18_: {
      name: "blocks.18."
    },
    blocks_19_: {
      name: "blocks.19."
    },
    blocks_1_: {
      name: "blocks.1."
    },
    blocks_20_: {
      name: "blocks.20."
    },
    blocks_21_: {
      name: "blocks.21."
    },
    blocks_22_: {
      name: "blocks.22."
    },
    blocks_23_: {
      name: "blocks.23."
    },
    blocks_24_: {
      name: "blocks.24."
    },
    blocks_25_: {
      name: "blocks.25."
    },
    blocks_26_: {
      name: "blocks.26."
    },
    blocks_27_: {
      name: "blocks.27."
    },
    blocks_28_: {
      name: "blocks.28."
    },
    blocks_29_: {
      name: "blocks.29."
    },
    blocks_2_: {
      name: "blocks.2."
    },
    blocks_30_: {
      name: "blocks.30."
    },
    blocks_31_: {
      name: "blocks.31."
    },
    blocks_32_: {
      name: "blocks.32."
    },
    blocks_33_: {
      name: "blocks.33."
    },
    blocks_34_: {
      name: "blocks.34."
    },
    blocks_35_: {
      name: "blocks.35."
    },
    blocks_36_: {
      name: "blocks.36."
    },
    blocks_37_: {
      name: "blocks.37."
    },
    blocks_38_: {
      name: "blocks.38."
    },
    blocks_39_: {
      name: "blocks.39."
    },
    blocks_3_: {
      name: "blocks.3."
    },
    blocks_40_: {
      name: "blocks.40."
    },
    blocks_41_: {
      name: "blocks.41."
    },
    blocks_42_: {
      name: "blocks.42."
    },
    blocks_43_: {
      name: "blocks.43."
    },
    blocks_44_: {
      name: "blocks.44."
    },
    blocks_45_: {
      name: "blocks.45."
    },
    blocks_46_: {
      name: "blocks.46."
    },
    blocks_47_: {
      name: "blocks.47."
    },
    blocks_4_: {
      name: "blocks.4."
    },
    blocks_5_: {
      name: "blocks.5."
    },
    blocks_6_: {
      name: "blocks.6."
    },
    blocks_7_: {
      name: "blocks.7."
    },
    blocks_8_: {
      name: "blocks.8."
    },
    blocks_9_: {
      name: "blocks.9."
    },
    final_layer_: {
      name: "final_layer."
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    pos_frequencies_: {
      name: "pos_frequencies."
    },
    t5_y_embedder_: {
      name: "t5_y_embedder."
    },
    t5_yproj_: {
      name: "t5_yproj."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeSD1$3 = {
  display_name: "モデルマージSD1",
  inputs: {
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0_: {
      name: "middle_block.0."
    },
    middle_block_1_: {
      name: "middle_block.1."
    },
    middle_block_2_: {
      name: "middle_block.2."
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0_: {
      name: "output_blocks.0."
    },
    output_blocks_10_: {
      name: "output_blocks.10."
    },
    output_blocks_11_: {
      name: "output_blocks.11."
    },
    output_blocks_1_: {
      name: "output_blocks.1."
    },
    output_blocks_2_: {
      name: "output_blocks.2."
    },
    output_blocks_3_: {
      name: "output_blocks.3."
    },
    output_blocks_4_: {
      name: "output_blocks.4."
    },
    output_blocks_5_: {
      name: "output_blocks.5."
    },
    output_blocks_6_: {
      name: "output_blocks.6."
    },
    output_blocks_7_: {
      name: "output_blocks.7."
    },
    output_blocks_8_: {
      name: "output_blocks.8."
    },
    output_blocks_9_: {
      name: "output_blocks.9."
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSD2$3 = {
  display_name: "モデルマージSD2",
  inputs: {
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0_: {
      name: "middle_block.0."
    },
    middle_block_1_: {
      name: "middle_block.1."
    },
    middle_block_2_: {
      name: "middle_block.2."
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0_: {
      name: "output_blocks.0."
    },
    output_blocks_10_: {
      name: "output_blocks.10."
    },
    output_blocks_11_: {
      name: "output_blocks.11."
    },
    output_blocks_1_: {
      name: "output_blocks.1."
    },
    output_blocks_2_: {
      name: "output_blocks.2."
    },
    output_blocks_3_: {
      name: "output_blocks.3."
    },
    output_blocks_4_: {
      name: "output_blocks.4."
    },
    output_blocks_5_: {
      name: "output_blocks.5."
    },
    output_blocks_6_: {
      name: "output_blocks.6."
    },
    output_blocks_7_: {
      name: "output_blocks.7."
    },
    output_blocks_8_: {
      name: "output_blocks.8."
    },
    output_blocks_9_: {
      name: "output_blocks.9."
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSD35_Large$3 = {
  display_name: "モデルマージSD35_Large",
  inputs: {
    context_embedder_: {
      name: "context_embedder."
    },
    final_layer_: {
      name: "final_layer."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_24_: {
      name: "joint_blocks.24."
    },
    joint_blocks_25_: {
      name: "joint_blocks.25."
    },
    joint_blocks_26_: {
      name: "joint_blocks.26."
    },
    joint_blocks_27_: {
      name: "joint_blocks.27."
    },
    joint_blocks_28_: {
      name: "joint_blocks.28."
    },
    joint_blocks_29_: {
      name: "joint_blocks.29."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_30_: {
      name: "joint_blocks.30."
    },
    joint_blocks_31_: {
      name: "joint_blocks.31."
    },
    joint_blocks_32_: {
      name: "joint_blocks.32."
    },
    joint_blocks_33_: {
      name: "joint_blocks.33."
    },
    joint_blocks_34_: {
      name: "joint_blocks.34."
    },
    joint_blocks_35_: {
      name: "joint_blocks.35."
    },
    joint_blocks_36_: {
      name: "joint_blocks.36."
    },
    joint_blocks_37_: {
      name: "joint_blocks.37."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    }
  }
};
const ModelMergeSD3_2B$3 = {
  display_name: "モデルマージSD3_2B",
  inputs: {
    context_embedder_: {
      name: "context_embedder."
    },
    final_layer_: {
      name: "final_layer."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    }
  }
};
const ModelMergeSDXL$3 = {
  display_name: "モデルマージSDXL",
  inputs: {
    input_blocks_0: {
      name: "input_blocks.0"
    },
    input_blocks_1: {
      name: "input_blocks.1"
    },
    input_blocks_2: {
      name: "input_blocks.2"
    },
    input_blocks_3: {
      name: "input_blocks.3"
    },
    input_blocks_4: {
      name: "input_blocks.4"
    },
    input_blocks_5: {
      name: "input_blocks.5"
    },
    input_blocks_6: {
      name: "input_blocks.6"
    },
    input_blocks_7: {
      name: "input_blocks.7"
    },
    input_blocks_8: {
      name: "input_blocks.8"
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0: {
      name: "middle_block.0"
    },
    middle_block_1: {
      name: "middle_block.1"
    },
    middle_block_2: {
      name: "middle_block.2"
    },
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0: {
      name: "output_blocks.0"
    },
    output_blocks_1: {
      name: "output_blocks.1"
    },
    output_blocks_2: {
      name: "output_blocks.2"
    },
    output_blocks_3: {
      name: "output_blocks.3"
    },
    output_blocks_4: {
      name: "output_blocks.4"
    },
    output_blocks_5: {
      name: "output_blocks.5"
    },
    output_blocks_6: {
      name: "output_blocks.6"
    },
    output_blocks_7: {
      name: "output_blocks.7"
    },
    output_blocks_8: {
      name: "output_blocks.8"
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSimple$3 = {
  display_name: "モデルマージシンプル",
  inputs: {
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    ratio: {
      name: "比率"
    }
  }
};
const ModelMergeSubtract$3 = {
  display_name: "モデルマージ減算",
  inputs: {
    model1: {
      name: "モデル1"
    },
    model2: {
      name: "モデル2"
    },
    multiplier: {
      name: "乗数"
    }
  }
};
const ModelSamplingAuraFlow$3 = {
  display_name: "モデルサンプリングオーラフロー",
  inputs: {
    model: {
      name: "モデル"
    },
    shift: {
      name: "シフト"
    }
  }
};
const ModelSamplingContinuousEDM$3 = {
  display_name: "モデルサンプリング連続EDM",
  inputs: {
    model: {
      name: "モデル"
    },
    sampling: {
      name: "サンプリング"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const ModelSamplingContinuousV$3 = {
  display_name: "モデルサンプリング連続V",
  inputs: {
    model: {
      name: "モデル"
    },
    sampling: {
      name: "サンプリング"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const ModelSamplingDiscrete$3 = {
  display_name: "モデルサンプリング離散",
  inputs: {
    model: {
      name: "モデル"
    },
    sampling: {
      name: "サンプリング"
    },
    zsnr: {
      name: "zsnr"
    }
  }
};
const ModelSamplingFlux$3 = {
  display_name: "モデルサンプリングフラックス",
  inputs: {
    base_shift: {
      name: "基本シフト"
    },
    height: {
      name: "高さ"
    },
    max_shift: {
      name: "最大シフト"
    },
    model: {
      name: "モデル"
    },
    width: {
      name: "幅"
    }
  }
};
const ModelSamplingLTXV$3 = {
  display_name: "モデルサンプリングLTXV",
  inputs: {
    base_shift: {
      name: "基本シフト"
    },
    latent: {
      name: "潜在"
    },
    max_shift: {
      name: "最大シフト"
    },
    model: {
      name: "モデル"
    }
  }
};
const ModelSamplingSD3$3 = {
  display_name: "モデルサンプリングSD3",
  inputs: {
    model: {
      name: "モデル"
    },
    shift: {
      name: "シフト"
    }
  }
};
const ModelSamplingStableCascade$3 = {
  display_name: "モデルサンプリング安定カスケード",
  inputs: {
    model: {
      name: "モデル"
    },
    shift: {
      name: "シフト"
    }
  }
};
const ModelSave$3 = {
  display_name: "モデルを保存",
  inputs: {
    filename_prefix: {
      name: "ファイル名プレフィックス"
    },
    model: {
      name: "モデル"
    }
  }
};
const Morphology$3 = {
  display_name: "画像形態学",
  inputs: {
    image: {
      name: "画像"
    },
    kernel_size: {
      name: "カーネルサイズ"
    },
    operation: {
      name: "操作"
    }
  }
};
const PairConditioningCombine$3 = {
  display_name: "ペア条件付け組み合わせ",
  inputs: {
    negative_A: {
      name: "ネガティブ_A"
    },
    negative_B: {
      name: "ネガティブ_B"
    },
    positive_A: {
      name: "ポジティブ_A"
    },
    positive_B: {
      name: "ポジティブ_B"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const PairConditioningSetDefaultCombine$3 = {
  display_name: "ペア条件付けデフォルト組み合わせを設定",
  inputs: {
    hooks: {
      name: "フック"
    },
    negative: {
      name: "ネガティブ"
    },
    negative_DEFAULT: {
      name: "ネガティブ_DEFAULT"
    },
    positive: {
      name: "ポジティブ"
    },
    positive_DEFAULT: {
      name: "ポジティブ_DEFAULT"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const PairConditioningSetProperties$3 = {
  display_name: "ペア条件付けプロパティ設定",
  inputs: {
    hooks: {
      name: "フック"
    },
    mask: {
      name: "マスク"
    },
    negative_NEW: {
      name: "ネガティブ_NEW"
    },
    positive_NEW: {
      name: "ポジティブ_NEW"
    },
    set_cond_area: {
      name: "set_cond_area"
    },
    strength: {
      name: "強度"
    },
    timesteps: {
      name: "タイムステップ"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const PairConditioningSetPropertiesAndCombine$3 = {
  display_name: "ペア条件付けプロパティ設定と組み合わせ",
  inputs: {
    hooks: {
      name: "フック"
    },
    mask: {
      name: "マスク"
    },
    negative: {
      name: "ネガティブ"
    },
    negative_NEW: {
      name: "ネガティブ_NEW"
    },
    positive: {
      name: "ポジティブ"
    },
    positive_NEW: {
      name: "ポジティブ_NEW"
    },
    set_cond_area: {
      name: "set_cond_area"
    },
    strength: {
      name: "強度"
    },
    timesteps: {
      name: "タイムステップ"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    }
  }
};
const PatchModelAddDownscale$3 = {
  display_name: "パッチモデル追加ダウンスケール（Kohya Deep Shrink）",
  inputs: {
    block_number: {
      name: "ブロック番号"
    },
    downscale_after_skip: {
      name: "スキップ後のダウンスケール"
    },
    downscale_factor: {
      name: "ダウンスケール係数"
    },
    downscale_method: {
      name: "ダウンスケール方法"
    },
    end_percent: {
      name: "終了パーセント"
    },
    model: {
      name: "モデル"
    },
    start_percent: {
      name: "開始パーセント"
    },
    upscale_method: {
      name: "アップスケール方法"
    }
  }
};
const PerpNeg$3 = {
  display_name: "Perp-Neg（PerpNegGuiderによって非推奨）",
  inputs: {
    empty_conditioning: {
      name: "空のコンディショニング"
    },
    model: {
      name: "モデル"
    },
    neg_scale: {
      name: "ネガティブスケール"
    }
  }
};
const PerpNegGuider$3 = {
  display_name: "PerpNegガイダー",
  inputs: {
    cfg: {
      name: "cfg"
    },
    empty_conditioning: {
      name: "空のコンディショニング"
    },
    model: {
      name: "モデル"
    },
    neg_scale: {
      name: "ネガティブスケール"
    },
    negative: {
      name: "ネガティブ"
    },
    positive: {
      name: "ポジティブ"
    }
  }
};
const PerturbedAttentionGuidance$3 = {
  display_name: "摂動注意ガイダンス",
  inputs: {
    model: {
      name: "モデル"
    },
    scale: {
      name: "スケール"
    }
  }
};
const PhotoMakerEncode$3 = {
  display_name: "フォトメーカーエンコード",
  inputs: {
    clip: {
      name: "clip"
    },
    image: {
      name: "画像"
    },
    photomaker: {
      name: "photomaker"
    },
    text: {
      name: "テキスト"
    }
  }
};
const PhotoMakerLoader$3 = {
  display_name: "フォトメーカーを読み込む",
  inputs: {
    photomaker_model_name: {
      name: "photomakerモデル名"
    }
  }
};
const PolyexponentialScheduler$3 = {
  display_name: "ポリ指数スケジューラー",
  inputs: {
    rho: {
      name: "ロー"
    },
    sigma_max: {
      name: "シグママックス"
    },
    sigma_min: {
      name: "シグマミン"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const PorterDuffImageComposite$3 = {
  display_name: "ポーターダフ画像合成",
  inputs: {
    destination: {
      name: "デスティネーション"
    },
    destination_alpha: {
      name: "デスティネーションアルファ"
    },
    mode: {
      name: "モード"
    },
    source: {
      name: "ソース"
    },
    source_alpha: {
      name: "ソースアルファ"
    }
  }
};
const Preview3D$3 = {
  display_name: "3Dプレビュー",
  inputs: {
    bg_color: {
      name: "背景色"
    },
    camera_type: {
      name: "カメラタイプ"
    },
    light_intensity: {
      name: "光の強度"
    },
    material: {
      name: "マテリアル"
    },
    model_file: {
      name: "モデルファイル"
    },
    show_grid: {
      name: "グリッドを表示"
    },
    up_direction: {
      name: "上方向"
    },
    view: {
      name: "ビュー"
    }
  }
};
const PreviewAudio$3 = {
  display_name: "オーディオプレビュー",
  inputs: {
    audio: {
      name: "オーディオ"
    }
  }
};
const PreviewImage$3 = {
  description: "入力画像をComfyUI出力ディレクトリに保存します。",
  display_name: "画像プレビュー",
  inputs: {
    images: {
      name: "画像"
    }
  }
};
const RandomNoise$3 = {
  display_name: "ランダムノイズ",
  inputs: {
    noise_seed: {
      name: "ノイズシード"
    }
  }
};
const RebatchImages$3 = {
  display_name: "画像を再バッチ",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    images: {
      name: "画像"
    }
  }
};
const RebatchLatents$3 = {
  display_name: "潜在を再バッチ",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    latents: {
      name: "潜在変数"
    }
  }
};
const RepeatImageBatch$3 = {
  display_name: "画像バッチを繰り返す",
  inputs: {
    amount: {
      name: "量"
    },
    image: {
      name: "画像"
    }
  }
};
const RepeatLatentBatch$3 = {
  display_name: "潜在バッチを繰り返す",
  inputs: {
    amount: {
      name: "量"
    },
    samples: {
      name: "サンプル"
    }
  }
};
const RescaleCFG$3 = {
  display_name: "CFGを再スケール",
  inputs: {
    model: {
      name: "モデル"
    },
    multiplier: {
      name: "乗数"
    }
  }
};
const SDTurboScheduler$3 = {
  display_name: "SDターボスケジューラー",
  inputs: {
    denoise: {
      name: "ノイズ除去"
    },
    model: {
      name: "モデル"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const SD_4XUpscale_Conditioning$3 = {
  display_name: "SD_4X拡大条件付け",
  inputs: {
    images: {
      name: "画像"
    },
    negative: {
      name: "ネガティブ"
    },
    noise_augmentation: {
      name: "ノイズ増強"
    },
    positive: {
      name: "ポジティブ"
    },
    scale_ratio: {
      name: "スケール比"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    },
    "2": {
      name: "潜在"
    }
  }
};
const SV3D_Conditioning$3 = {
  display_name: "SV3D条件付け",
  inputs: {
    clip_vision: {
      name: "クリップビジョン"
    },
    elevation: {
      name: "高度"
    },
    height: {
      name: "高さ"
    },
    init_image: {
      name: "初期画像"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "ビデオフレーム"
    },
    width: {
      name: "幅"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    },
    "2": {
      name: "潜在"
    }
  }
};
const SVD_img2vid_Conditioning$3 = {
  display_name: "SVD_img2vid条件付け",
  inputs: {
    augmentation_level: {
      name: "増強レベル"
    },
    clip_vision: {
      name: "clip_vision"
    },
    fps: {
      name: "fps"
    },
    height: {
      name: "高さ"
    },
    init_image: {
      name: "初期画像"
    },
    motion_bucket_id: {
      name: "モーションバケットID"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "ビデオフレーム"
    },
    width: {
      name: "幅"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    },
    "2": {
      name: "潜在"
    }
  }
};
const SamplerCustom$3 = {
  display_name: "カスタムサンプラー",
  inputs: {
    add_noise: {
      name: "ノイズを追加"
    },
    cfg: {
      name: "cfg"
    },
    latent_image: {
      name: "潜在画像"
    },
    model: {
      name: "モデル"
    },
    negative: {
      name: "ネガティブ"
    },
    noise_seed: {
      name: "ノイズシード"
    },
    positive: {
      name: "ポジティブ"
    },
    sampler: {
      name: "サンプラー"
    },
    sigmas: {
      name: "シグマ"
    }
  },
  outputs: {
    "0": {
      name: "出力"
    },
    "1": {
      name: "デノイズ出力"
    }
  }
};
const SamplerCustomAdvanced$3 = {
  display_name: "カスタムサンプラー（高度）",
  inputs: {
    guider: {
      name: "ガイダー"
    },
    latent_image: {
      name: "潜在イメージ"
    },
    noise: {
      name: "ノイズ"
    },
    sampler: {
      name: "サンプラー"
    },
    sigmas: {
      name: "シグマ"
    }
  },
  outputs: {
    "0": {
      name: "出力"
    },
    "1": {
      name: "デノイズ出力"
    }
  }
};
const SamplerDPMAdaptative$3 = {
  display_name: "サンプラーDPM適応",
  inputs: {
    accept_safety: {
      name: "accept_safety"
    },
    atol: {
      name: "atol"
    },
    dcoeff: {
      name: "dcoeff"
    },
    eta: {
      name: "eta"
    },
    h_init: {
      name: "h_init"
    },
    icoeff: {
      name: "icoeff"
    },
    order: {
      name: "順序"
    },
    pcoeff: {
      name: "pcoeff"
    },
    rtol: {
      name: "rtol"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_2M_SDE$3 = {
  display_name: "サンプラーDPMPP_2M_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "ノイズデバイス"
    },
    s_noise: {
      name: "s_noise"
    },
    solver_type: {
      name: "ソルバータイプ"
    }
  }
};
const SamplerDPMPP_2S_Ancestral$3 = {
  display_name: "サンプラーDPMPP_2S_祖先",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_3M_SDE$3 = {
  display_name: "サンプラーDPMPP_3M_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "ノイズデバイス"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_SDE$3 = {
  display_name: "サンプラーDPMPP_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "ノイズデバイス"
    },
    r: {
      name: "r"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerAncestral$3 = {
  display_name: "サンプラーオイラー祖先",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerAncestralCFGPP$3 = {
  display_name: "サンプラーオイラー祖先CFG++",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerCFGpp$3 = {
  display_name: "サンプラーオイラーCFG++",
  inputs: {
    version: {
      name: "バージョン"
    }
  }
};
const SamplerLCMUpscale$3 = {
  display_name: "サンプラーLCM拡大",
  inputs: {
    scale_ratio: {
      name: "スケール比"
    },
    scale_steps: {
      name: "スケールステップ"
    },
    upscale_method: {
      name: "アップスケール方法"
    }
  }
};
const SamplerLMS$3 = {
  display_name: "サンプラーLMS",
  inputs: {
    order: {
      name: "順序"
    }
  }
};
const SaveAnimatedPNG$3 = {
  display_name: "アニメーションPNGを保存",
  inputs: {
    compress_level: {
      name: "圧縮レベル"
    },
    filename_prefix: {
      name: "ファイル名プレフィックス"
    },
    fps: {
      name: "fps"
    },
    images: {
      name: "画像"
    }
  }
};
const SaveAnimatedWEBP$3 = {
  display_name: "アニメーションWEBPを保存",
  inputs: {
    filename_prefix: {
      name: "ファイル名プレフィックス"
    },
    fps: {
      name: "fps"
    },
    images: {
      name: "画像"
    },
    lossless: {
      name: "ロスレス"
    },
    method: {
      name: "方法"
    },
    quality: {
      name: "品質"
    }
  }
};
const SaveAudio$3 = {
  display_name: "オーディオを保存",
  inputs: {
    audio: {
      name: "オーディオ"
    },
    filename_prefix: {
      name: "ファイル名_プレフィックス"
    }
  }
};
const SaveImage$3 = {
  description: "入力画像をComfyUI出力ディレクトリに保存します。",
  display_name: "画像を保存",
  inputs: {
    filename_prefix: {
      name: "ファイル名_プレフィックス",
      tooltip: "保存するファイルのプレフィックス。この中には、ノードからの値を含めるために、%date:yyyy-MM-dd%や%Empty Latent Image.width%などのフォーマット情報が含まれる場合があります。"
    },
    images: {
      name: "画像",
      tooltip: "保存する画像。"
    }
  }
};
const SaveImageWebsocket$3 = {
  display_name: "画像を保存するWebSocket",
  inputs: {
    images: {
      name: "画像"
    }
  }
};
const SaveLatent$3 = {
  display_name: "潜在を保存",
  inputs: {
    filename_prefix: {
      name: "ファイル名_プレフィックス"
    },
    samples: {
      name: "サンプル"
    }
  }
};
const SelfAttentionGuidance$3 = {
  display_name: "自己注意ガイダンス",
  inputs: {
    blur_sigma: {
      name: "ブラーシグマ"
    },
    model: {
      name: "モデル"
    },
    scale: {
      name: "スケール"
    }
  }
};
const SetClipHooks$3 = {
  display_name: "CLIPフックを設定",
  inputs: {
    apply_to_conds: {
      name: "apply_to_conds"
    },
    clip: {
      name: "クリップ"
    },
    hooks: {
      name: "フック"
    },
    schedule_clip: {
      name: "schedule_clip"
    }
  }
};
const SetHookKeyframes$3 = {
  display_name: "フックキーフレームを設定",
  inputs: {
    hook_kf: {
      name: "フック_kf"
    },
    hooks: {
      name: "フック"
    }
  }
};
const SetLatentNoiseMask$3 = {
  display_name: "潜在ノイズマスクを設定",
  inputs: {
    mask: {
      name: "マスク"
    },
    samples: {
      name: "サンプル"
    }
  }
};
const SetUnionControlNetType$3 = {
  display_name: "Union ControlNetタイプを設定",
  inputs: {
    control_net: {
      name: "control_net"
    },
    type: {
      name: "タイプ"
    }
  }
};
const SkipLayerGuidanceDiT$3 = {
  description: "すべてのDiTモデルで使用できるSkipLayerGuidanceノードの一般的なバージョン。",
  display_name: "SkipLayerGuidanceDiT",
  inputs: {
    double_layers: {
      name: "ダブルレイヤー"
    },
    end_percent: {
      name: "終了パーセント"
    },
    model: {
      name: "モデル"
    },
    rescaling_scale: {
      name: "リスケーリングスケール"
    },
    scale: {
      name: "スケール"
    },
    single_layers: {
      name: "シングルレイヤー"
    },
    start_percent: {
      name: "開始パーセント"
    }
  }
};
const SkipLayerGuidanceSD3$3 = {
  description: "すべてのDiTモデルで使用できるSkipLayerGuidanceノードの一般的なバージョン。",
  display_name: "SkipLayerGuidanceSD3",
  inputs: {
    end_percent: {
      name: "終了パーセント"
    },
    layers: {
      name: "レイヤー"
    },
    model: {
      name: "モデル"
    },
    scale: {
      name: "スケール"
    },
    start_percent: {
      name: "開始パーセント"
    }
  }
};
const SolidMask$3 = {
  display_name: "ソリッドマスク",
  inputs: {
    height: {
      name: "高さ"
    },
    value: {
      name: "値"
    },
    width: {
      name: "幅"
    }
  }
};
const SplitImageWithAlpha$3 = {
  display_name: "アルファで画像を分割",
  inputs: {
    image: {
      name: "画像"
    }
  }
};
const SplitSigmas$3 = {
  display_name: "シグマを分割",
  inputs: {
    sigmas: {
      name: "シグマ"
    },
    step: {
      name: "ステップ"
    }
  },
  outputs: {
    "0": {
      name: "高シグマ"
    },
    "1": {
      name: "低シグマ"
    }
  }
};
const SplitSigmasDenoise$3 = {
  display_name: "シグマを分割してノイズ除去",
  inputs: {
    denoise: {
      name: "ノイズ除去"
    },
    sigmas: {
      name: "シグマ"
    }
  },
  outputs: {
    "0": {
      name: "高シグマ"
    },
    "1": {
      name: "低シグマ"
    }
  }
};
const StableCascade_EmptyLatentImage$3 = {
  display_name: "安定カスケード_空の潜在画像",
  inputs: {
    batch_size: {
      name: "バッチサイズ"
    },
    compression: {
      name: "圧縮"
    },
    height: {
      name: "高さ"
    },
    width: {
      name: "幅"
    }
  },
  outputs: {
    "0": {
      name: "ステージC"
    },
    "1": {
      name: "ステージB"
    }
  }
};
const StableCascade_StageB_Conditioning$3 = {
  display_name: "安定カスケード_ステージB条件付け",
  inputs: {
    conditioning: {
      name: "コンディショニング"
    },
    stage_c: {
      name: "ステージc"
    }
  }
};
const StableCascade_StageC_VAEEncode$3 = {
  display_name: "安定カスケード_ステージC_VAEエンコード",
  inputs: {
    compression: {
      name: "圧縮"
    },
    image: {
      name: "画像"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "ステージC"
    },
    "1": {
      name: "ステージB"
    }
  }
};
const StableCascade_SuperResolutionControlnet$3 = {
  display_name: "安定カスケード_超解像Controlnet",
  inputs: {
    image: {
      name: "画像"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "コントロールネット入力"
    },
    "1": {
      name: "ステージC"
    },
    "2": {
      name: "ステージB"
    }
  }
};
const StableZero123_Conditioning$3 = {
  display_name: "安定ゼロ123条件付け",
  inputs: {
    azimuth: {
      name: "方位角"
    },
    batch_size: {
      name: "バッチサイズ"
    },
    clip_vision: {
      name: "クリップビジョン"
    },
    elevation: {
      name: "高度"
    },
    height: {
      name: "高さ"
    },
    init_image: {
      name: "初期画像"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "幅"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    },
    "2": {
      name: "潜在"
    }
  }
};
const StableZero123_Conditioning_Batched$3 = {
  display_name: "安定ゼロ123条件付け（バッチ）",
  inputs: {
    azimuth: {
      name: "方位角"
    },
    azimuth_batch_increment: {
      name: "方位角バッチ増分"
    },
    batch_size: {
      name: "バッチサイズ"
    },
    clip_vision: {
      name: "クリップビジョン"
    },
    elevation: {
      name: "高度"
    },
    elevation_batch_increment: {
      name: "高度バッチ増分"
    },
    height: {
      name: "高さ"
    },
    init_image: {
      name: "初期画像"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "幅"
    }
  },
  outputs: {
    "0": {
      name: "ポジティブ"
    },
    "1": {
      name: "ネガティブ"
    },
    "2": {
      name: "潜在"
    }
  }
};
const StyleModelApply$3 = {
  display_name: "スタイルモデルを適用",
  inputs: {
    clip_vision_output: {
      name: "クリップビジョン出力"
    },
    conditioning: {
      name: "コンディショニング"
    },
    strength: {
      name: "強度"
    },
    strength_type: {
      name: "強度タイプ"
    },
    style_model: {
      name: "スタイルモデル"
    }
  }
};
const StyleModelLoader$3 = {
  display_name: "スタイルモデルを読み込む",
  inputs: {
    style_model_name: {
      name: "スタイルモデル名"
    }
  }
};
const ThresholdMask$3 = {
  display_name: "しきい値マスク",
  inputs: {
    mask: {
      name: "マスク"
    },
    value: {
      name: "値"
    }
  }
};
const TomePatchModel$3 = {
  display_name: "トメパッチモデル",
  inputs: {
    model: {
      name: "モデル"
    },
    ratio: {
      name: "比率"
    }
  }
};
const TorchCompileModel$3 = {
  display_name: "Torchコンパイルモデル",
  inputs: {
    backend: {
      name: "バックエンド"
    },
    model: {
      name: "モデル"
    }
  }
};
const TripleCLIPLoader$3 = {
  description: "[レシピ]\n\nsd3: clip-l, clip-g, t5",
  display_name: "トリプルCLIPを読み込む",
  inputs: {
    clip_name1: {
      name: "clip_name1"
    },
    clip_name2: {
      name: "clip_name2"
    },
    clip_name3: {
      name: "clip_name3"
    }
  }
};
const UNETLoader$3 = {
  display_name: "拡散モデルを読み込む",
  inputs: {
    unet_name: {
      name: "unet_name"
    },
    weight_dtype: {
      name: "重みdtype"
    }
  }
};
const UNetCrossAttentionMultiply$3 = {
  display_name: "UNetクロス注意の乗算",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "モデル"
    },
    out: {
      name: "出力"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetSelfAttentionMultiply$3 = {
  display_name: "UNet自己注意の乗算",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "モデル"
    },
    out: {
      name: "出力"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetTemporalAttentionMultiply$3 = {
  display_name: "UNet時間的注意の乗算",
  inputs: {
    cross_structural: {
      name: "クロス構造"
    },
    cross_temporal: {
      name: "クロス時間"
    },
    model: {
      name: "モデル"
    },
    self_structural: {
      name: "自己構造"
    },
    self_temporal: {
      name: "自己時間"
    }
  }
};
const UpscaleModelLoader$3 = {
  display_name: "拡大モデルを読み込む",
  inputs: {
    model_name: {
      name: "モデル名"
    }
  }
};
const VAEDecode$3 = {
  description: "潜在画像をピクセル空間画像にデコードします。",
  display_name: "VAEデコード",
  inputs: {
    samples: {
      name: "サンプル",
      tooltip: "デコードされる潜在。"
    },
    vae: {
      name: "vae",
      tooltip: "潜在のデコードに使用されるVAEモデル。"
    }
  },
  outputs: {
    "0": {
      tooltip: "デコードされた画像。"
    }
  }
};
const VAEDecodeAudio$3 = {
  display_name: "VAEデコード音声",
  inputs: {
    samples: {
      name: "サンプル"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEDecodeTiled$3 = {
  display_name: "VAEデコード（タイル）",
  inputs: {
    overlap: {
      name: "オーバーラップ"
    },
    samples: {
      name: "サンプル"
    },
    temporal_overlap: {
      name: "temporal_overlap",
      tooltip: "ビデオVAE専用：重複するフレームの数。"
    },
    temporal_size: {
      name: "temporal_size",
      tooltip: "ビデオVAE専用：一度にデコードするフレームの数。"
    },
    tile_size: {
      name: "タイルサイズ"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncode$3 = {
  display_name: "VAEエンコード",
  inputs: {
    pixels: {
      name: "ピクセル"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeAudio$3 = {
  display_name: "VAEエンコード音声",
  inputs: {
    audio: {
      name: "オーディオ"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeForInpaint$3 = {
  display_name: "VAEエンコード（インペイント用）",
  inputs: {
    grow_mask_by: {
      name: "マスクの拡大"
    },
    mask: {
      name: "マスク"
    },
    pixels: {
      name: "ピクセル"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeTiled$3 = {
  display_name: "VAEエンコード（タイル）",
  inputs: {
    overlap: {
      name: "オーバーラップ"
    },
    pixels: {
      name: "ピクセル"
    },
    temporal_overlap: {
      name: "temporal_overlap",
      tooltip: "ビデオVAE専用：重複するフレームの数。"
    },
    temporal_size: {
      name: "temporal_size",
      tooltip: "ビデオVAE専用：一度にエンコードするフレームの数。"
    },
    tile_size: {
      name: "タイルサイズ"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAELoader$3 = {
  display_name: "VAEを読み込む",
  inputs: {
    vae_name: {
      name: "vae_name"
    }
  }
};
const VAESave$3 = {
  display_name: "VAEを保存",
  inputs: {
    filename_prefix: {
      name: "ファイル名プレフィックス"
    },
    vae: {
      name: "vae"
    }
  }
};
const VPScheduler$3 = {
  display_name: "VPスケジューラー",
  inputs: {
    beta_d: {
      name: "beta_d"
    },
    beta_min: {
      name: "beta_min"
    },
    eps_s: {
      name: "eps_s"
    },
    steps: {
      name: "ステップ"
    }
  }
};
const VideoLinearCFGGuidance$3 = {
  display_name: "ビデオ線形CFGガイダンス",
  inputs: {
    min_cfg: {
      name: "最小cfg"
    },
    model: {
      name: "モデル"
    }
  }
};
const VideoTriangleCFGGuidance$3 = {
  display_name: "ビデオ三角形CFGガイダンス",
  inputs: {
    min_cfg: {
      name: "最小cfg"
    },
    model: {
      name: "モデル"
    }
  }
};
const WebcamCapture$3 = {
  display_name: "ウェブカメラキャプチャ",
  inputs: {
    capture_on_queue: {
      name: "キューでキャプチャ"
    },
    height: {
      name: "高さ"
    },
    image: {
      name: "画像"
    },
    width: {
      name: "幅"
    }
  }
};
const unCLIPCheckpointLoader$3 = {
  display_name: "unCLIPチェックポイントローダー",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    }
  }
};
const unCLIPConditioning$3 = {
  display_name: "unCLIP条件付け",
  inputs: {
    clip_vision_output: {
      name: "clip_vision_output"
    },
    conditioning: {
      name: "コンディショニング"
    },
    noise_augmentation: {
      name: "ノイズ増強"
    },
    strength: {
      name: "強度"
    }
  }
};
const jaNodes = {
  AddNoise: AddNoise$3,
  AlignYourStepsScheduler: AlignYourStepsScheduler$3,
  BasicGuider: BasicGuider$3,
  BasicScheduler: BasicScheduler$3,
  BetaSamplingScheduler: BetaSamplingScheduler$3,
  CFGGuider: CFGGuider$3,
  CLIPAttentionMultiply: CLIPAttentionMultiply$3,
  CLIPLoader: CLIPLoader$3,
  CLIPMergeAdd: CLIPMergeAdd$3,
  CLIPMergeSimple: CLIPMergeSimple$3,
  CLIPMergeSubtract: CLIPMergeSubtract$3,
  CLIPSave: CLIPSave$3,
  CLIPSetLastLayer: CLIPSetLastLayer$3,
  CLIPTextEncode: CLIPTextEncode$3,
  CLIPTextEncodeControlnet: CLIPTextEncodeControlnet$3,
  CLIPTextEncodeFlux: CLIPTextEncodeFlux$3,
  CLIPTextEncodeHunyuanDiT: CLIPTextEncodeHunyuanDiT$3,
  CLIPTextEncodePixArtAlpha: CLIPTextEncodePixArtAlpha$3,
  CLIPTextEncodeSD3: CLIPTextEncodeSD3$3,
  CLIPTextEncodeSDXL: CLIPTextEncodeSDXL$3,
  CLIPTextEncodeSDXLRefiner: CLIPTextEncodeSDXLRefiner$3,
  CLIPVisionEncode: CLIPVisionEncode$3,
  CLIPVisionLoader: CLIPVisionLoader$3,
  Canny: Canny$3,
  CheckpointLoader: CheckpointLoader$3,
  CheckpointLoaderSimple: CheckpointLoaderSimple$3,
  CheckpointSave: CheckpointSave$3,
  CombineHooks2: CombineHooks2$3,
  CombineHooks4: CombineHooks4$3,
  CombineHooks8: CombineHooks8$3,
  ConditioningAverage: ConditioningAverage$3,
  ConditioningCombine: ConditioningCombine$3,
  ConditioningConcat: ConditioningConcat$3,
  ConditioningSetArea: ConditioningSetArea$3,
  ConditioningSetAreaPercentage: ConditioningSetAreaPercentage$3,
  ConditioningSetAreaStrength: ConditioningSetAreaStrength$3,
  ConditioningSetDefaultCombine: ConditioningSetDefaultCombine$3,
  ConditioningSetMask: ConditioningSetMask$3,
  ConditioningSetProperties: ConditioningSetProperties$3,
  ConditioningSetPropertiesAndCombine: ConditioningSetPropertiesAndCombine$3,
  ConditioningSetTimestepRange: ConditioningSetTimestepRange$3,
  ConditioningStableAudio: ConditioningStableAudio$3,
  ConditioningTimestepsRange: ConditioningTimestepsRange$3,
  ConditioningZeroOut: ConditioningZeroOut$3,
  ControlNetApply: ControlNetApply$3,
  ControlNetApplyAdvanced: ControlNetApplyAdvanced$3,
  ControlNetApplySD3: ControlNetApplySD3$3,
  ControlNetInpaintingAliMamaApply: ControlNetInpaintingAliMamaApply$3,
  ControlNetLoader: ControlNetLoader$3,
  CreateHookKeyframe: CreateHookKeyframe$3,
  CreateHookKeyframesFromFloats: CreateHookKeyframesFromFloats$3,
  CreateHookKeyframesInterpolated: CreateHookKeyframesInterpolated$3,
  CreateHookLora: CreateHookLora$3,
  CreateHookLoraModelOnly: CreateHookLoraModelOnly$3,
  CreateHookModelAsLora: CreateHookModelAsLora$3,
  CreateHookModelAsLoraModelOnly: CreateHookModelAsLoraModelOnly$3,
  CropMask: CropMask$3,
  DevToolsDeprecatedNode: DevToolsDeprecatedNode$3,
  DevToolsErrorRaiseNode: DevToolsErrorRaiseNode$3,
  DevToolsErrorRaiseNodeWithMessage: DevToolsErrorRaiseNodeWithMessage$3,
  DevToolsExperimentalNode: DevToolsExperimentalNode$3,
  DevToolsLongComboDropdown: DevToolsLongComboDropdown$3,
  DevToolsNodeWithForceInput: DevToolsNodeWithForceInput$3,
  DevToolsNodeWithOnlyOptionalInput: DevToolsNodeWithOnlyOptionalInput$3,
  DevToolsNodeWithOptionalInput: DevToolsNodeWithOptionalInput$3,
  DevToolsNodeWithOutputList: DevToolsNodeWithOutputList$3,
  DevToolsNodeWithStringInput: DevToolsNodeWithStringInput$3,
  DevToolsNodeWithUnionInput: DevToolsNodeWithUnionInput$3,
  DevToolsSimpleSlider: DevToolsSimpleSlider$3,
  DiffControlNetLoader: DiffControlNetLoader$3,
  DifferentialDiffusion: DifferentialDiffusion$3,
  DiffusersLoader: DiffusersLoader$3,
  DisableNoise: DisableNoise$3,
  DualCFGGuider: DualCFGGuider$3,
  DualCLIPLoader: DualCLIPLoader$3,
  EmptyHunyuanLatentVideo: EmptyHunyuanLatentVideo$3,
  EmptyImage: EmptyImage$3,
  EmptyLTXVLatentVideo: EmptyLTXVLatentVideo$3,
  EmptyLatentAudio: EmptyLatentAudio$3,
  EmptyLatentImage: EmptyLatentImage$3,
  EmptyMochiLatentVideo: EmptyMochiLatentVideo$3,
  EmptySD3LatentImage: EmptySD3LatentImage$3,
  ExponentialScheduler: ExponentialScheduler$3,
  FeatherMask: FeatherMask$3,
  FlipSigmas: FlipSigmas$3,
  FluxGuidance: FluxGuidance$3,
  FreeU: FreeU$3,
  FreeU_V2: FreeU_V2$3,
  GITSScheduler: GITSScheduler$3,
  GLIGENLoader: GLIGENLoader$3,
  GLIGENTextBoxApply: GLIGENTextBoxApply$3,
  GrowMask: GrowMask$3,
  HyperTile: HyperTile$3,
  HypernetworkLoader: HypernetworkLoader$3,
  ImageBatch: ImageBatch$3,
  ImageBlend: ImageBlend$3,
  ImageBlur: ImageBlur$3,
  ImageColorToMask: ImageColorToMask$3,
  ImageCompositeMasked: ImageCompositeMasked$3,
  ImageCrop: ImageCrop$3,
  ImageFromBatch: ImageFromBatch$3,
  ImageInvert: ImageInvert$3,
  ImageOnlyCheckpointLoader: ImageOnlyCheckpointLoader$3,
  ImageOnlyCheckpointSave: ImageOnlyCheckpointSave$3,
  ImagePadForOutpaint: ImagePadForOutpaint$3,
  ImageQuantize: ImageQuantize$3,
  ImageScale: ImageScale$3,
  ImageScaleBy: ImageScaleBy$3,
  ImageScaleToTotalPixels: ImageScaleToTotalPixels$3,
  ImageSharpen: ImageSharpen$3,
  ImageToMask: ImageToMask$3,
  ImageUpscaleWithModel: ImageUpscaleWithModel$3,
  InpaintModelConditioning: InpaintModelConditioning$3,
  InstructPixToPixConditioning: InstructPixToPixConditioning$3,
  InvertMask: InvertMask$3,
  JoinImageWithAlpha: JoinImageWithAlpha$3,
  KSampler: KSampler$3,
  KSamplerAdvanced: KSamplerAdvanced$3,
  KSamplerSelect: KSamplerSelect$3,
  KarrasScheduler: KarrasScheduler$3,
  LTXVConditioning: LTXVConditioning$3,
  LTXVImgToVideo: LTXVImgToVideo$3,
  LTXVScheduler: LTXVScheduler$3,
  LaplaceScheduler: LaplaceScheduler$3,
  LatentAdd: LatentAdd$3,
  LatentApplyOperation: LatentApplyOperation$3,
  LatentApplyOperationCFG: LatentApplyOperationCFG$3,
  LatentBatch: LatentBatch$3,
  LatentBatchSeedBehavior: LatentBatchSeedBehavior$3,
  LatentBlend: LatentBlend$3,
  LatentComposite: LatentComposite$3,
  LatentCompositeMasked: LatentCompositeMasked$3,
  LatentCrop: LatentCrop$3,
  LatentFlip: LatentFlip$3,
  LatentFromBatch: LatentFromBatch$3,
  LatentInterpolate: LatentInterpolate$3,
  LatentMultiply: LatentMultiply$3,
  LatentOperationSharpen: LatentOperationSharpen$3,
  LatentOperationTonemapReinhard: LatentOperationTonemapReinhard$3,
  LatentRotate: LatentRotate$3,
  LatentSubtract: LatentSubtract$3,
  LatentUpscale: LatentUpscale$3,
  LatentUpscaleBy: LatentUpscaleBy$3,
  Load3D: Load3D$3,
  Load3DAnimation: Load3DAnimation$3,
  LoadAudio: LoadAudio$3,
  LoadImage: LoadImage$3,
  LoadImageMask: LoadImageMask$3,
  LoadLatent: LoadLatent$3,
  LoraLoader: LoraLoader$3,
  LoraLoaderModelOnly: LoraLoaderModelOnly$3,
  LoraSave: LoraSave$3,
  Mahiro: Mahiro$3,
  MaskComposite: MaskComposite$3,
  MaskToImage: MaskToImage$3,
  ModelMergeAdd: ModelMergeAdd$3,
  ModelMergeAuraflow: ModelMergeAuraflow$3,
  ModelMergeBlocks: ModelMergeBlocks$3,
  ModelMergeFlux1: ModelMergeFlux1$3,
  ModelMergeLTXV: ModelMergeLTXV$3,
  ModelMergeMochiPreview: ModelMergeMochiPreview$3,
  ModelMergeSD1: ModelMergeSD1$3,
  ModelMergeSD2: ModelMergeSD2$3,
  ModelMergeSD35_Large: ModelMergeSD35_Large$3,
  ModelMergeSD3_2B: ModelMergeSD3_2B$3,
  ModelMergeSDXL: ModelMergeSDXL$3,
  ModelMergeSimple: ModelMergeSimple$3,
  ModelMergeSubtract: ModelMergeSubtract$3,
  ModelSamplingAuraFlow: ModelSamplingAuraFlow$3,
  ModelSamplingContinuousEDM: ModelSamplingContinuousEDM$3,
  ModelSamplingContinuousV: ModelSamplingContinuousV$3,
  ModelSamplingDiscrete: ModelSamplingDiscrete$3,
  ModelSamplingFlux: ModelSamplingFlux$3,
  ModelSamplingLTXV: ModelSamplingLTXV$3,
  ModelSamplingSD3: ModelSamplingSD3$3,
  ModelSamplingStableCascade: ModelSamplingStableCascade$3,
  ModelSave: ModelSave$3,
  Morphology: Morphology$3,
  PairConditioningCombine: PairConditioningCombine$3,
  PairConditioningSetDefaultCombine: PairConditioningSetDefaultCombine$3,
  PairConditioningSetProperties: PairConditioningSetProperties$3,
  PairConditioningSetPropertiesAndCombine: PairConditioningSetPropertiesAndCombine$3,
  PatchModelAddDownscale: PatchModelAddDownscale$3,
  PerpNeg: PerpNeg$3,
  PerpNegGuider: PerpNegGuider$3,
  PerturbedAttentionGuidance: PerturbedAttentionGuidance$3,
  PhotoMakerEncode: PhotoMakerEncode$3,
  PhotoMakerLoader: PhotoMakerLoader$3,
  PolyexponentialScheduler: PolyexponentialScheduler$3,
  PorterDuffImageComposite: PorterDuffImageComposite$3,
  Preview3D: Preview3D$3,
  PreviewAudio: PreviewAudio$3,
  PreviewImage: PreviewImage$3,
  RandomNoise: RandomNoise$3,
  RebatchImages: RebatchImages$3,
  RebatchLatents: RebatchLatents$3,
  RepeatImageBatch: RepeatImageBatch$3,
  RepeatLatentBatch: RepeatLatentBatch$3,
  RescaleCFG: RescaleCFG$3,
  SDTurboScheduler: SDTurboScheduler$3,
  SD_4XUpscale_Conditioning: SD_4XUpscale_Conditioning$3,
  SV3D_Conditioning: SV3D_Conditioning$3,
  SVD_img2vid_Conditioning: SVD_img2vid_Conditioning$3,
  SamplerCustom: SamplerCustom$3,
  SamplerCustomAdvanced: SamplerCustomAdvanced$3,
  SamplerDPMAdaptative: SamplerDPMAdaptative$3,
  SamplerDPMPP_2M_SDE: SamplerDPMPP_2M_SDE$3,
  SamplerDPMPP_2S_Ancestral: SamplerDPMPP_2S_Ancestral$3,
  SamplerDPMPP_3M_SDE: SamplerDPMPP_3M_SDE$3,
  SamplerDPMPP_SDE: SamplerDPMPP_SDE$3,
  SamplerEulerAncestral: SamplerEulerAncestral$3,
  SamplerEulerAncestralCFGPP: SamplerEulerAncestralCFGPP$3,
  SamplerEulerCFGpp: SamplerEulerCFGpp$3,
  SamplerLCMUpscale: SamplerLCMUpscale$3,
  SamplerLMS: SamplerLMS$3,
  SaveAnimatedPNG: SaveAnimatedPNG$3,
  SaveAnimatedWEBP: SaveAnimatedWEBP$3,
  SaveAudio: SaveAudio$3,
  SaveImage: SaveImage$3,
  SaveImageWebsocket: SaveImageWebsocket$3,
  SaveLatent: SaveLatent$3,
  SelfAttentionGuidance: SelfAttentionGuidance$3,
  SetClipHooks: SetClipHooks$3,
  SetHookKeyframes: SetHookKeyframes$3,
  SetLatentNoiseMask: SetLatentNoiseMask$3,
  SetUnionControlNetType: SetUnionControlNetType$3,
  SkipLayerGuidanceDiT: SkipLayerGuidanceDiT$3,
  SkipLayerGuidanceSD3: SkipLayerGuidanceSD3$3,
  SolidMask: SolidMask$3,
  SplitImageWithAlpha: SplitImageWithAlpha$3,
  SplitSigmas: SplitSigmas$3,
  SplitSigmasDenoise: SplitSigmasDenoise$3,
  StableCascade_EmptyLatentImage: StableCascade_EmptyLatentImage$3,
  StableCascade_StageB_Conditioning: StableCascade_StageB_Conditioning$3,
  StableCascade_StageC_VAEEncode: StableCascade_StageC_VAEEncode$3,
  StableCascade_SuperResolutionControlnet: StableCascade_SuperResolutionControlnet$3,
  StableZero123_Conditioning: StableZero123_Conditioning$3,
  StableZero123_Conditioning_Batched: StableZero123_Conditioning_Batched$3,
  StyleModelApply: StyleModelApply$3,
  StyleModelLoader: StyleModelLoader$3,
  ThresholdMask: ThresholdMask$3,
  TomePatchModel: TomePatchModel$3,
  TorchCompileModel: TorchCompileModel$3,
  TripleCLIPLoader: TripleCLIPLoader$3,
  UNETLoader: UNETLoader$3,
  UNetCrossAttentionMultiply: UNetCrossAttentionMultiply$3,
  UNetSelfAttentionMultiply: UNetSelfAttentionMultiply$3,
  UNetTemporalAttentionMultiply: UNetTemporalAttentionMultiply$3,
  UpscaleModelLoader: UpscaleModelLoader$3,
  VAEDecode: VAEDecode$3,
  VAEDecodeAudio: VAEDecodeAudio$3,
  VAEDecodeTiled: VAEDecodeTiled$3,
  VAEEncode: VAEEncode$3,
  VAEEncodeAudio: VAEEncodeAudio$3,
  VAEEncodeForInpaint: VAEEncodeForInpaint$3,
  VAEEncodeTiled: VAEEncodeTiled$3,
  VAELoader: VAELoader$3,
  VAESave: VAESave$3,
  VPScheduler: VPScheduler$3,
  VideoLinearCFGGuidance: VideoLinearCFGGuidance$3,
  VideoTriangleCFGGuidance: VideoTriangleCFGGuidance$3,
  WebcamCapture: WebcamCapture$3,
  unCLIPCheckpointLoader: unCLIPCheckpointLoader$3,
  unCLIPConditioning: unCLIPConditioning$3
};
const Comfy_ConfirmClear$3 = {
  name: "ワークフローをクリアする際に確認を要求する"
};
const Comfy_DOMClippingEnabled$3 = {
  name: "DOM要素のクリッピングを有効にする（有効にするとパフォーマンスが低下する可能性があります）"
};
const Comfy_DevMode$3 = {
  name: "開発モードオプションを有効にする（API保存など）"
};
const Comfy_DisableFloatRounding$3 = {
  name: "デフォルトの浮動小数点ウィジェットの丸めを無効にする。",
  tooltip: "(ページの再読み込みが必要) バックエンドのノードで丸めが設定されている場合、丸めを無効にすることはできません。"
};
const Comfy_DisableSliders$3 = {
  name: "ノードウィジェットスライダーを無効にする"
};
const Comfy_EditAttention_Delta$3 = {
  name: "Ctrl+上/下の精度"
};
const Comfy_EnableTooltips$3 = {
  name: "ツールチップを有効にする"
};
const Comfy_EnableWorkflowViewRestore$3 = {
  name: "ワークフロー内のキャンバスの位置とズームレベルを保存および復元する"
};
const Comfy_FloatRoundingPrecision$3 = {
  name: "浮動小数点ウィジェットの丸め小数点数 [0 = 自動]。",
  tooltip: "(ページの再読み込みが必要)"
};
const Comfy_Graph_CanvasInfo$3 = {
  name: "左下隅にキャンバス情報を表示する（fpsなど）"
};
const Comfy_Graph_CanvasMenu$3 = {
  name: "グラフキャンバスメニューを表示する"
};
const Comfy_Graph_CtrlShiftZoom$3 = {
  name: "ファストズームショートカットを有効にする（Ctrl + Shift + ドラッグ）"
};
const Comfy_Graph_LinkMarkers$3 = {
  name: "リンク中点マーカー",
  options: {
    Arrow: "矢印",
    Circle: "円",
    None: "なし"
  }
};
const Comfy_Graph_ZoomSpeed$3 = {
  name: "キャンバスズーム速度"
};
const Comfy_GroupSelectedNodes_Padding$3 = {
  name: "選択したノードのパディング"
};
const Comfy_Group_DoubleClickTitleToEdit$3 = {
  name: "グループタイトルをダブルクリックして編集"
};
const Comfy_InvertMenuScrolling$3 = {
  name: "コンテキストメニューのスクロールを反転する"
};
const Comfy_LinkRelease_Action$3 = {
  name: "リンクリリース時のアクション（修飾子なし）",
  options: {
    "context menu": "コンテキストメニュー",
    "no action": "アクションなし",
    "search box": "検索ボックス"
  }
};
const Comfy_LinkRelease_ActionShift$3 = {
  name: "リンクリリース時のアクション（Shift）",
  options: {
    "context menu": "コンテキストメニュー",
    "no action": "アクションなし",
    "search box": "検索ボックス"
  }
};
const Comfy_LinkRenderMode$3 = {
  name: "リンクレンダーモード",
  options: {
    Hidden: "隠す",
    Linear: "リニア",
    Spline: "スプライン",
    Straight: "ストレート"
  }
};
const Comfy_Locale$3 = {
  name: "言語"
};
const Comfy_MaskEditor_BrushAdjustmentSpeed$3 = {
  name: "ブラシ調整速度の倍率",
  tooltip: "調整時にブラシのサイズと硬さがどれだけ速く変化するかを制御します。値が高いほど、変化が速くなります。"
};
const Comfy_MaskEditor_UseDominantAxis$3 = {
  name: "ブラシ調整を優先軸に固定する",
  tooltip: "有効にすると、ブラシの調整は、どの方向に多く動かすかに基づいて、サイズまたは硬さのいずれかにのみ影響します。"
};
const Comfy_MaskEditor_UseNewEditor$3 = {
  name: "新しいマスクエディタを使用する",
  tooltip: "新しいマスクエディタインターフェースに切り替えます。"
};
const Comfy_ModelLibrary_AutoLoadAll$3 = {
  name: "すべてのモデルフォルダーを自動的に読み込む",
  tooltip: "trueの場合、モデルライブラリを開くとすぐにすべてのフォルダーが読み込まれます（これにより読み込み中に遅延が発生する可能性があります）。falseの場合、ルートレベルのモデルフォルダーはクリックするまで読み込まれません。"
};
const Comfy_ModelLibrary_NameFormat$3 = {
  name: "モデルライブラリツリービューに表示する名前",
  options: {
    filename: "ファイル名",
    title: "タイトル"
  },
  tooltip: '"ファイル名"を選択すると、モデルリストにディレクトリや".safetensors"拡張子なしの生のファイル名の簡略化されたビューが表示されます。"タイトル"を選択すると、設定可能なモデルメタデータタイトルが表示されます。'
};
const Comfy_NodeBadge_NodeIdBadgeMode$3 = {
  name: "ノードIDバッジモード",
  options: {
    None: "なし",
    "Show all": "すべて表示"
  }
};
const Comfy_NodeBadge_NodeLifeCycleBadgeMode$3 = {
  name: "ノードライフサイクルバッジモード",
  options: {
    None: "なし",
    "Show all": "すべて表示"
  }
};
const Comfy_NodeBadge_NodeSourceBadgeMode$3 = {
  name: "ノードソースバッジモード",
  options: {
    "Hide built-in": "組み込みを隠す",
    None: "なし",
    "Show all": "すべて表示"
  }
};
const Comfy_NodeInputConversionSubmenus$3 = {
  name: "ノードのコンテキストメニューに、入力/ウィジェット間の変換を行うエントリをサブメニューに配置します。"
};
const Comfy_NodeSearchBoxImpl$3 = {
  name: "ノード検索ボックスの実装",
  options: {
    "default": "デフォルト",
    "litegraph (legacy)": "litegraph (レガシー)"
  }
};
const Comfy_NodeSearchBoxImpl_NodePreview$3 = {
  name: "ノードプレビュー",
  tooltip: "デフォルトの実装にのみ適用されます"
};
const Comfy_NodeSearchBoxImpl_ShowCategory$3 = {
  name: "検索結果にノードカテゴリを表示",
  tooltip: "デフォルトの実装にのみ適用されます"
};
const Comfy_NodeSearchBoxImpl_ShowIdName$3 = {
  name: "検索結果にノードID名を表示",
  tooltip: "デフォルトの実装にのみ適用されます"
};
const Comfy_NodeSearchBoxImpl_ShowNodeFrequency$3 = {
  name: "検索結果にノード頻度を表示",
  tooltip: "デフォルトの実装にのみ適用されます"
};
const Comfy_NodeSuggestions_number$3 = {
  name: "ノード提案の数",
  tooltip: "ライトグラフの検索ボックス/コンテキストメニュー専用"
};
const Comfy_Node_AutoSnapLinkToSlot$3 = {
  name: "ノードスロットにリンクを自動スナップ",
  tooltip: "ノードの上にリンクをドラッグすると、リンクがノードの有効な入力スロットに自動的にスナップします"
};
const Comfy_Node_BypassAllLinksOnDelete$3 = {
  name: "ノード削除時にすべてのリンクを保持",
  tooltip: "ノードを削除する際、削除されたノードをバイパスしてすべての入力および出力リンクを再接続しようとします"
};
const Comfy_Node_DoubleClickTitleToEdit$3 = {
  name: "ノードタイトルをダブルクリックして編集"
};
const Comfy_Node_MiddleClickRerouteNode$3 = {
  name: "ミドルクリックで新しいリルートノードを作成"
};
const Comfy_Node_Opacity$3 = {
  name: "ノードの不透明度"
};
const Comfy_Node_ShowDeprecated$3 = {
  name: "検索で非推奨ノードを表示",
  tooltip: "非推奨ノードはデフォルトでUIに隠されていますが、それを使用する既存のワークフローでは機能し続けます。"
};
const Comfy_Node_ShowExperimental$3 = {
  name: "検索で実験的ノードを表示",
  tooltip: "実験的ノードはUIでそのようにマークされており、将来のバージョンで大幅な変更や削除の対象となる可能性があります。生産ワークフローでの使用には注意が必要です"
};
const Comfy_Node_SnapHighlightsNode$3 = {
  name: "スナップハイライトノード",
  tooltip: "有効な入力スロットを持つノードの上にリンクをドラッグすると、ノードがハイライトされます"
};
const Comfy_Pointer_ClickBufferTime$3 = {
  name: "ポインタークリックドリフト遅延",
  tooltip: "ポインターボタンを押した後、ポインタの動きが無視される最大時間（ミリ秒単位）です。\n\nクリック中にポインタが移動した場合、オブジェクトが意図せず動かされるのを防ぎます。"
};
const Comfy_Pointer_ClickDrift$3 = {
  name: "ポインタークリックドリフト（最大距離）",
  tooltip: "ボタンを押し続けている間にポインタがこの距離以上移動した場合、クリックではなくドラッグと見なされます。\n\nクリック中にポインタが移動した場合、オブジェクトが意図せず動かされるのを防ぎます。"
};
const Comfy_Pointer_DoubleClickTime$3 = {
  name: "ダブルクリック間隔（最大）",
  tooltip: "ダブルクリックの2回のクリック間の最大時間（ミリ秒単位）。この値を増やすことで、ダブルクリックが時々登録されない場合に助けになるかもしれません。"
};
const Comfy_PreviewFormat$3 = {
  name: "プレビュー画像フォーマット",
  tooltip: "画像ウィジェットでプレビューを表示する際、軽量画像に変換します（例：webp、jpeg、webp;50など）。"
};
const Comfy_PromptFilename$3 = {
  name: "ワークフローを保存する際にファイル名を入力するよう促す"
};
const Comfy_QueueButton_BatchCountLimit$3 = {
  name: "バッチ数制限",
  tooltip: "1回のボタンクリックでキューに追加できるタスクの最大数"
};
const Comfy_Queue_MaxHistoryItems$3 = {
  name: "キュー履歴サイズ",
  tooltip: "キュー履歴に表示されるタスクの最大数。"
};
const Comfy_RerouteBeta$3 = {
  name: "リルートベータテストに参加する",
  tooltip: "新しいネイティブリルートを有効にします。\n\nリルートは、リンクラインからドラッグしながらaltを押すか、リンクメニューで追加できます。\n\nこのオプションを無効にしても破壊的ではなく、リルートは隠されます。"
};
const Comfy_Sidebar_Location$3 = {
  name: "サイドバーの位置",
  options: {
    left: "左",
    right: "右"
  }
};
const Comfy_Sidebar_Size$3 = {
  name: "サイドバーのサイズ",
  options: {
    normal: "通常",
    small: "小"
  }
};
const Comfy_SnapToGrid_GridSize$3 = {
  name: "グリッドサイズにスナップ",
  tooltip: "シフトを押しながらノードをドラッグおよびサイズ変更すると、グリッドに整列されます。これにより、そのグリッドのサイズが制御されます。"
};
const Comfy_TextareaWidget_FontSize$3 = {
  name: "テキストエリアウィジェットのフォントサイズ"
};
const Comfy_TextareaWidget_Spellcheck$3 = {
  name: "テキストエリアウィジェットのスペルチェック"
};
const Comfy_TreeExplorer_ItemPadding$3 = {
  name: "ツリーエクスプローラーアイテムのパディング"
};
const Comfy_UseNewMenu$3 = {
  name: "新しいメニューを使用",
  options: {
    Bottom: "下",
    Disabled: "無効",
    Top: "上"
  }
};
const Comfy_Validation_NodeDefs$3 = {
  name: "ノード定義を検証（遅い）",
  tooltip: "ノード開発者に推奨されます。これにより、起動時にすべてのノード定義が検証されます。"
};
const Comfy_Validation_Workflows$3 = {
  name: "ワークフローを検証"
};
const Comfy_WidgetControlMode$3 = {
  name: "ウィジェット制御モード",
  options: {
    after: "後",
    before: "前"
  },
  tooltip: "ウィジェットの値が更新されるタイミングを制御します（ランダム化/インクリメント/デクリメント）、プロンプトがキューに入れられる前または後のいずれかです。"
};
const Comfy_Window_UnloadConfirmation$3 = {
  name: "ウィンドウを閉じるときに確認を表示"
};
const Comfy_Workflow_ConfirmDelete$3 = {
  name: "ワークフローを削除する際に確認を表示"
};
const Comfy_Workflow_ShowMissingModelsWarning$3 = {
  name: "欠落しているモデルの警告を表示"
};
const Comfy_Workflow_ShowMissingNodesWarning$3 = {
  name: "欠落しているノードの警告を表示"
};
const Comfy_Workflow_SortNodeIdOnSave$3 = {
  name: "ワークフローを保存する際にノードIDをソート"
};
const Comfy_Workflow_WorkflowTabsPosition$3 = {
  name: "開いているワークフローの位置",
  options: {
    Sidebar: "サイドバー",
    Topbar: "トップバー"
  }
};
const LiteGraph_Canvas_MaximumFps$3 = {
  name: "最大FPS",
  tooltip: "キャンバスがレンダリングできる最大フレーム数です。スムーズさの代わりにGPU使用量を制限します。0の場合、画面のリフレッシュレートが使用されます。デフォルト：0"
};
const pysssss_SnapToGrid$3 = {
  name: "常にグリッドにスナップ"
};
const jaSettings = {
  "Comfy-Desktop_AutoUpdate": {
    name: "自動的に更新を確認する"
  },
  "Comfy-Desktop_SendStatistics": {
    name: "匿名のクラッシュレポートを送信する"
  },
  Comfy_ConfirmClear: Comfy_ConfirmClear$3,
  Comfy_DOMClippingEnabled: Comfy_DOMClippingEnabled$3,
  Comfy_DevMode: Comfy_DevMode$3,
  Comfy_DisableFloatRounding: Comfy_DisableFloatRounding$3,
  Comfy_DisableSliders: Comfy_DisableSliders$3,
  Comfy_EditAttention_Delta: Comfy_EditAttention_Delta$3,
  Comfy_EnableTooltips: Comfy_EnableTooltips$3,
  Comfy_EnableWorkflowViewRestore: Comfy_EnableWorkflowViewRestore$3,
  Comfy_FloatRoundingPrecision: Comfy_FloatRoundingPrecision$3,
  Comfy_Graph_CanvasInfo: Comfy_Graph_CanvasInfo$3,
  Comfy_Graph_CanvasMenu: Comfy_Graph_CanvasMenu$3,
  Comfy_Graph_CtrlShiftZoom: Comfy_Graph_CtrlShiftZoom$3,
  Comfy_Graph_LinkMarkers: Comfy_Graph_LinkMarkers$3,
  Comfy_Graph_ZoomSpeed: Comfy_Graph_ZoomSpeed$3,
  Comfy_GroupSelectedNodes_Padding: Comfy_GroupSelectedNodes_Padding$3,
  Comfy_Group_DoubleClickTitleToEdit: Comfy_Group_DoubleClickTitleToEdit$3,
  Comfy_InvertMenuScrolling: Comfy_InvertMenuScrolling$3,
  Comfy_LinkRelease_Action: Comfy_LinkRelease_Action$3,
  Comfy_LinkRelease_ActionShift: Comfy_LinkRelease_ActionShift$3,
  Comfy_LinkRenderMode: Comfy_LinkRenderMode$3,
  Comfy_Locale: Comfy_Locale$3,
  Comfy_MaskEditor_BrushAdjustmentSpeed: Comfy_MaskEditor_BrushAdjustmentSpeed$3,
  Comfy_MaskEditor_UseDominantAxis: Comfy_MaskEditor_UseDominantAxis$3,
  Comfy_MaskEditor_UseNewEditor: Comfy_MaskEditor_UseNewEditor$3,
  Comfy_ModelLibrary_AutoLoadAll: Comfy_ModelLibrary_AutoLoadAll$3,
  Comfy_ModelLibrary_NameFormat: Comfy_ModelLibrary_NameFormat$3,
  Comfy_NodeBadge_NodeIdBadgeMode: Comfy_NodeBadge_NodeIdBadgeMode$3,
  Comfy_NodeBadge_NodeLifeCycleBadgeMode: Comfy_NodeBadge_NodeLifeCycleBadgeMode$3,
  Comfy_NodeBadge_NodeSourceBadgeMode: Comfy_NodeBadge_NodeSourceBadgeMode$3,
  Comfy_NodeInputConversionSubmenus: Comfy_NodeInputConversionSubmenus$3,
  Comfy_NodeSearchBoxImpl: Comfy_NodeSearchBoxImpl$3,
  Comfy_NodeSearchBoxImpl_NodePreview: Comfy_NodeSearchBoxImpl_NodePreview$3,
  Comfy_NodeSearchBoxImpl_ShowCategory: Comfy_NodeSearchBoxImpl_ShowCategory$3,
  Comfy_NodeSearchBoxImpl_ShowIdName: Comfy_NodeSearchBoxImpl_ShowIdName$3,
  Comfy_NodeSearchBoxImpl_ShowNodeFrequency: Comfy_NodeSearchBoxImpl_ShowNodeFrequency$3,
  Comfy_NodeSuggestions_number: Comfy_NodeSuggestions_number$3,
  Comfy_Node_AutoSnapLinkToSlot: Comfy_Node_AutoSnapLinkToSlot$3,
  Comfy_Node_BypassAllLinksOnDelete: Comfy_Node_BypassAllLinksOnDelete$3,
  Comfy_Node_DoubleClickTitleToEdit: Comfy_Node_DoubleClickTitleToEdit$3,
  Comfy_Node_MiddleClickRerouteNode: Comfy_Node_MiddleClickRerouteNode$3,
  Comfy_Node_Opacity: Comfy_Node_Opacity$3,
  Comfy_Node_ShowDeprecated: Comfy_Node_ShowDeprecated$3,
  Comfy_Node_ShowExperimental: Comfy_Node_ShowExperimental$3,
  Comfy_Node_SnapHighlightsNode: Comfy_Node_SnapHighlightsNode$3,
  Comfy_Pointer_ClickBufferTime: Comfy_Pointer_ClickBufferTime$3,
  Comfy_Pointer_ClickDrift: Comfy_Pointer_ClickDrift$3,
  Comfy_Pointer_DoubleClickTime: Comfy_Pointer_DoubleClickTime$3,
  Comfy_PreviewFormat: Comfy_PreviewFormat$3,
  Comfy_PromptFilename: Comfy_PromptFilename$3,
  Comfy_QueueButton_BatchCountLimit: Comfy_QueueButton_BatchCountLimit$3,
  Comfy_Queue_MaxHistoryItems: Comfy_Queue_MaxHistoryItems$3,
  Comfy_RerouteBeta: Comfy_RerouteBeta$3,
  Comfy_Sidebar_Location: Comfy_Sidebar_Location$3,
  Comfy_Sidebar_Size: Comfy_Sidebar_Size$3,
  Comfy_SnapToGrid_GridSize: Comfy_SnapToGrid_GridSize$3,
  Comfy_TextareaWidget_FontSize: Comfy_TextareaWidget_FontSize$3,
  Comfy_TextareaWidget_Spellcheck: Comfy_TextareaWidget_Spellcheck$3,
  Comfy_TreeExplorer_ItemPadding: Comfy_TreeExplorer_ItemPadding$3,
  Comfy_UseNewMenu: Comfy_UseNewMenu$3,
  Comfy_Validation_NodeDefs: Comfy_Validation_NodeDefs$3,
  Comfy_Validation_Workflows: Comfy_Validation_Workflows$3,
  Comfy_WidgetControlMode: Comfy_WidgetControlMode$3,
  Comfy_Window_UnloadConfirmation: Comfy_Window_UnloadConfirmation$3,
  Comfy_Workflow_ConfirmDelete: Comfy_Workflow_ConfirmDelete$3,
  Comfy_Workflow_ShowMissingModelsWarning: Comfy_Workflow_ShowMissingModelsWarning$3,
  Comfy_Workflow_ShowMissingNodesWarning: Comfy_Workflow_ShowMissingNodesWarning$3,
  Comfy_Workflow_SortNodeIdOnSave: Comfy_Workflow_SortNodeIdOnSave$3,
  Comfy_Workflow_WorkflowTabsPosition: Comfy_Workflow_WorkflowTabsPosition$3,
  LiteGraph_Canvas_MaximumFps: LiteGraph_Canvas_MaximumFps$3,
  pysssss_SnapToGrid: pysssss_SnapToGrid$3
};
const Comfy_BrowseTemplates$2 = {
  label: "템플릿 탐색"
};
const Comfy_Canvas_FitView$2 = {
  label: "선택한 노드에 뷰 맞추기"
};
const Comfy_Canvas_ResetView$2 = {
  label: "뷰 재설정"
};
const Comfy_Canvas_ToggleLinkVisibility$2 = {
  label: "캔버스 링크 가시성 토글"
};
const Comfy_Canvas_ToggleLock$2 = {
  label: "캔버스 잠금 토글"
};
const Comfy_Canvas_ToggleSelectedNodes_Bypass$2 = {
  label: "선택한 노드 우회/우회 해제"
};
const Comfy_Canvas_ToggleSelectedNodes_Collapse$2 = {
  label: "선택한 노드 축소/확장"
};
const Comfy_Canvas_ToggleSelectedNodes_Mute$2 = {
  label: "선택한 노드 음소거/음소거 해제"
};
const Comfy_Canvas_ToggleSelectedNodes_Pin$2 = {
  label: "선택한 노드 고정/고정 해제"
};
const Comfy_Canvas_ToggleSelected_Pin$2 = {
  label: "선택한 항목 고정/고정 해제"
};
const Comfy_Canvas_ZoomIn$2 = {
  label: "확대"
};
const Comfy_Canvas_ZoomOut$2 = {
  label: "축소"
};
const Comfy_ClearPendingTasks$2 = {
  label: "보류 중인 작업 지우기"
};
const Comfy_ClearWorkflow$2 = {
  label: "워크플로 지우기"
};
const Comfy_DuplicateWorkflow$2 = {
  label: "현재 워크플로우 복제"
};
const Comfy_ExportWorkflow$2 = {
  label: "워크플로 내보내기"
};
const Comfy_ExportWorkflowAPI$2 = {
  label: "워크플로 내보내기 (API 형식)"
};
const Comfy_Graph_FitGroupToContents$2 = {
  label: "그룹을 내용에 맞게 맞추기"
};
const Comfy_Graph_GroupSelectedNodes$2 = {
  label: "선택한 노드 그룹화"
};
const Comfy_GroupNode_ConvertSelectedNodesToGroupNode$2 = {
  label: "선택한 노드를 그룹 노드로 변환"
};
const Comfy_GroupNode_ManageGroupNodes$2 = {
  label: "그룹 노드 관리"
};
const Comfy_GroupNode_UngroupSelectedGroupNodes$2 = {
  label: "선택한 그룹 노드 분리"
};
const Comfy_Help_AboutComfyUI$2 = {
  label: "ComfyUI 정보 열기"
};
const Comfy_Help_OpenComfyOrgDiscord$2 = {
  label: "Comfy-Org 디스코드 열기"
};
const Comfy_Help_OpenComfyUIDocs$2 = {
  label: "ComfyUI 문서 열기"
};
const Comfy_Help_OpenComfyUIIssues$2 = {
  label: "ComfyUI 문제 열기"
};
const Comfy_Interrupt$2 = {
  label: "중단"
};
const Comfy_LoadDefaultWorkflow$2 = {
  label: "기본 워크플로 로드"
};
const Comfy_NewBlankWorkflow$2 = {
  label: "새로운 빈 워크플로"
};
const Comfy_OpenClipspace$2 = {
  label: "클립스페이스"
};
const Comfy_OpenWorkflow$2 = {
  label: "워크플로 열기"
};
const Comfy_QueuePrompt$2 = {
  label: "실행 큐에 프롬프트 추가"
};
const Comfy_QueuePromptFront$2 = {
  label: "실행 큐 맨 앞에 프롬프트 추가"
};
const Comfy_Redo$2 = {
  label: "다시 실행"
};
const Comfy_RefreshNodeDefinitions$2 = {
  label: "노드 정의 새로 고침"
};
const Comfy_SaveWorkflow$2 = {
  label: "워크플로 저장"
};
const Comfy_SaveWorkflowAs$2 = {
  label: "다른 이름으로 워크플로 저장"
};
const Comfy_ShowSettingsDialog$2 = {
  label: "설정 대화상자 보기"
};
const Comfy_ToggleTheme$2 = {
  label: "밝기 테마 전환 (어두운/밝은)"
};
const Comfy_Undo$2 = {
  label: "실행 취소"
};
const Workspace_NextOpenedWorkflow$2 = {
  label: "다음 열린 워크플로"
};
const Workspace_PreviousOpenedWorkflow$2 = {
  label: "이전 열린 워크플로"
};
const Workspace_SearchBox_Toggle$2 = {
  label: "검색 상자 토글"
};
const Workspace_ToggleBottomPanel$2 = {
  label: "하단 패널 토글"
};
const Workspace_ToggleFocusMode$2 = {
  label: "포커스 모드 토글"
};
const Workspace_ToggleSidebarTab_queue$2 = {
  label: "실행 큐 사이드바 토글",
  tooltip: "실행 큐"
};
const Workspace_ToggleSidebarTab_workflows$2 = {
  label: "워크플로 사이드바 토글",
  tooltip: "워크플로"
};
const koCommands = {
  "Comfy-Desktop_Folders_OpenCustomNodesFolder": {
    label: "사용자 정의 노드 폴더 열기"
  },
  "Comfy-Desktop_Folders_OpenInputsFolder": {
    label: "입력 폴더 열기"
  },
  "Comfy-Desktop_Folders_OpenLogsFolder": {
    label: "로그 폴더 열기"
  },
  "Comfy-Desktop_Folders_OpenModelConfig": {
    label: "extra_model_paths.yaml 열기"
  },
  "Comfy-Desktop_Folders_OpenModelsFolder": {
    label: "모델 폴더 열기"
  },
  "Comfy-Desktop_Folders_OpenOutputsFolder": {
    label: "출력 폴더 열기"
  },
  "Comfy-Desktop_OpenDevTools": {
    label: "DevTools 열기"
  },
  "Comfy-Desktop_OpenFeedbackPage": {
    label: "피드백"
  },
  "Comfy-Desktop_OpenUserGuide": {
    label: "데스크톱 사용자 가이드"
  },
  "Comfy-Desktop_Reinstall": {
    label: "재설치"
  },
  "Comfy-Desktop_Restart": {
    label: "재시작"
  },
  Comfy_BrowseTemplates: Comfy_BrowseTemplates$2,
  Comfy_Canvas_FitView: Comfy_Canvas_FitView$2,
  Comfy_Canvas_ResetView: Comfy_Canvas_ResetView$2,
  Comfy_Canvas_ToggleLinkVisibility: Comfy_Canvas_ToggleLinkVisibility$2,
  Comfy_Canvas_ToggleLock: Comfy_Canvas_ToggleLock$2,
  Comfy_Canvas_ToggleSelectedNodes_Bypass: Comfy_Canvas_ToggleSelectedNodes_Bypass$2,
  Comfy_Canvas_ToggleSelectedNodes_Collapse: Comfy_Canvas_ToggleSelectedNodes_Collapse$2,
  Comfy_Canvas_ToggleSelectedNodes_Mute: Comfy_Canvas_ToggleSelectedNodes_Mute$2,
  Comfy_Canvas_ToggleSelectedNodes_Pin: Comfy_Canvas_ToggleSelectedNodes_Pin$2,
  Comfy_Canvas_ToggleSelected_Pin: Comfy_Canvas_ToggleSelected_Pin$2,
  Comfy_Canvas_ZoomIn: Comfy_Canvas_ZoomIn$2,
  Comfy_Canvas_ZoomOut: Comfy_Canvas_ZoomOut$2,
  Comfy_ClearPendingTasks: Comfy_ClearPendingTasks$2,
  Comfy_ClearWorkflow: Comfy_ClearWorkflow$2,
  Comfy_DuplicateWorkflow: Comfy_DuplicateWorkflow$2,
  Comfy_ExportWorkflow: Comfy_ExportWorkflow$2,
  Comfy_ExportWorkflowAPI: Comfy_ExportWorkflowAPI$2,
  Comfy_Graph_FitGroupToContents: Comfy_Graph_FitGroupToContents$2,
  Comfy_Graph_GroupSelectedNodes: Comfy_Graph_GroupSelectedNodes$2,
  Comfy_GroupNode_ConvertSelectedNodesToGroupNode: Comfy_GroupNode_ConvertSelectedNodesToGroupNode$2,
  Comfy_GroupNode_ManageGroupNodes: Comfy_GroupNode_ManageGroupNodes$2,
  Comfy_GroupNode_UngroupSelectedGroupNodes: Comfy_GroupNode_UngroupSelectedGroupNodes$2,
  Comfy_Help_AboutComfyUI: Comfy_Help_AboutComfyUI$2,
  Comfy_Help_OpenComfyOrgDiscord: Comfy_Help_OpenComfyOrgDiscord$2,
  Comfy_Help_OpenComfyUIDocs: Comfy_Help_OpenComfyUIDocs$2,
  Comfy_Help_OpenComfyUIIssues: Comfy_Help_OpenComfyUIIssues$2,
  Comfy_Interrupt: Comfy_Interrupt$2,
  Comfy_LoadDefaultWorkflow: Comfy_LoadDefaultWorkflow$2,
  Comfy_NewBlankWorkflow: Comfy_NewBlankWorkflow$2,
  Comfy_OpenClipspace: Comfy_OpenClipspace$2,
  Comfy_OpenWorkflow: Comfy_OpenWorkflow$2,
  Comfy_QueuePrompt: Comfy_QueuePrompt$2,
  Comfy_QueuePromptFront: Comfy_QueuePromptFront$2,
  Comfy_Redo: Comfy_Redo$2,
  Comfy_RefreshNodeDefinitions: Comfy_RefreshNodeDefinitions$2,
  Comfy_SaveWorkflow: Comfy_SaveWorkflow$2,
  Comfy_SaveWorkflowAs: Comfy_SaveWorkflowAs$2,
  Comfy_ShowSettingsDialog: Comfy_ShowSettingsDialog$2,
  Comfy_ToggleTheme: Comfy_ToggleTheme$2,
  Comfy_Undo: Comfy_Undo$2,
  Workspace_NextOpenedWorkflow: Workspace_NextOpenedWorkflow$2,
  Workspace_PreviousOpenedWorkflow: Workspace_PreviousOpenedWorkflow$2,
  Workspace_SearchBox_Toggle: Workspace_SearchBox_Toggle$2,
  Workspace_ToggleBottomPanel: Workspace_ToggleBottomPanel$2,
  "Workspace_ToggleBottomPanelTab_command-terminal": {
    label: "터미널 하단 패널 토글"
  },
  "Workspace_ToggleBottomPanelTab_logs-terminal": {
    label: "로그 하단 패널 토글"
  },
  Workspace_ToggleFocusMode: Workspace_ToggleFocusMode$2,
  "Workspace_ToggleSidebarTab_model-library": {
    label: "모델 라이브러리 사이드바 토글",
    tooltip: "모델 라이브러리"
  },
  "Workspace_ToggleSidebarTab_node-library": {
    label: "노드 라이브러리 사이드바 토글",
    tooltip: "노드 라이브러리"
  },
  Workspace_ToggleSidebarTab_queue: Workspace_ToggleSidebarTab_queue$2,
  Workspace_ToggleSidebarTab_workflows: Workspace_ToggleSidebarTab_workflows$2
};
const color$2 = {
  blue: "파란색",
  custom: "사용자 정의",
  "default": "기본값",
  green: "초록색",
  pink: "분홍색",
  red: "빨간색",
  yellow: "노란색"
};
const dataTypes$2 = {
  AUDIO: "오디오",
  BOOLEAN: "논리값",
  CLIP: "CLIP",
  CLIP_VISION: "CLIP_VISION",
  CLIP_VISION_OUTPUT: "CLIP_VISION 출력",
  COMBO: "콤보",
  CONDITIONING: "조건",
  CONTROL_NET: "컨트롤넷",
  FLOAT: "실수",
  FLOATS: "실수 배열",
  GLIGEN: "GLIGEN",
  GUIDER: "가이드",
  HOOKS: "후크",
  HOOK_KEYFRAMES: "후크 키프레임",
  IMAGE: "이미지",
  INT: "정수",
  LATENT: "잠재 데이터",
  LATENT_OPERATION: "잠재 연산",
  LOAD_3D: "3D 로드",
  LOAD_3D_ANIMATION: "3D 애니메이션 로드",
  MASK: "마스크",
  MODEL: "모델",
  NOISE: "노이즈",
  PHOTOMAKER: "PHOTOMAKER",
  SAMPLER: "샘플러",
  SIGMAS: "시그마",
  STRING: "문자열",
  STYLE_MODEL: "스타일 모델",
  TIMESTEPS_RANGE: "타임스텝 범위",
  UPSCALE_MODEL: "업스케일 모델",
  VAE: "VAE",
  WEBCAM: "웹캠"
};
const desktopMenu$2 = {
  confirmReinstall: "이 작업은 extra_models_config.yaml 파일을 지우고 설치를 다시 시작합니다. 정말로 진행하시겠습니까?",
  reinstall: "재설치"
};
const downloadGit$2 = {
  gitWebsite: "git 프로그램 다운로드",
  instructions: "운영 체제에 맞는 최신 버전을 다운로드하여 설치하십시오. 아래의 'git 프로그램 다운로드' 버튼을 클릭하면 git-scm.com 다운로드 페이지가 열립니다.",
  message: "git 프로그램을 찾을 수 없습니다. 정상적인 작업을 위해서는 git 프로그램이 필요합니다.",
  skip: "건너뛰기",
  title: "git 프로그램 다운로드",
  warning: "git 프로그램이 이미 설치된 것이 확실하다면, 이 검사 단계를 스킵할 수 있습니다. 현재는 정상적으로 실행 가능한 git 프로그램이 없는 경우, ComfyUI를 실행할 수 없습니다."
};
const electronFileDownload$2 = {
  cancel: "다운로드 취소",
  cancelled: "취소됨",
  inProgress: "진행 중",
  pause: "다운로드 일시 중지",
  paused: "일시 중지됨",
  resume: "다운로드 재개"
};
const g$2 = {
  about: "정보",
  add: "추가",
  back: "뒤로",
  cancel: "취소",
  close: "닫기",
  color: "색상",
  comingSoon: "곧 출시 예정",
  command: "명령",
  confirm: "확인",
  copyToClipboard: "클립보드에 복사",
  currentUser: "현재 사용자",
  customize: "사용자 정의",
  customizeFolder: "폴더 사용자 정의",
  "delete": "삭제",
  deprecated: "사용 중단",
  devices: "장치",
  disableAll: "모두 비활성화",
  download: "다운로드",
  empty: "비어 있음",
  enableAll: "모두 활성화",
  error: "오류",
  experimental: "베타",
  extensionName: "확장 이름",
  findIssues: "문제 찾기",
  firstTimeUIMessage: '새 UI를 처음 사용합니다. "메뉴 > 새 메뉴 사용 > 비활성화"를 선택하여 이전 UI로 복원하세요.',
  goToNode: "노드로 이동",
  icon: "아이콘",
  imageFailedToLoad: "이미지를 로드하지 못했습니다.",
  "import": "가져오기",
  insert: "삽입",
  install: "설치",
  keybinding: "키 바인딩",
  loadAllFolders: "모든 폴더 로드",
  loadWorkflow: "워크플로 로드",
  loading: "로딩 중",
  logs: "로그",
  newFolder: "새 폴더",
  next: "다음",
  no: "아니오",
  noResultsFound: "결과를 찾을 수 없습니다.",
  noTasksFound: "작업을 찾을 수 없습니다.",
  noTasksFoundMessage: "대기열에 작업이 없습니다.",
  noWorkflowsFound: "워크플로를 찾을 수 없습니다.",
  openNewIssue: "새 문제 열기",
  overwrite: "덮어쓰기",
  reconnected: "재연결됨",
  reconnecting: "재연결 중",
  refresh: "새로 고침",
  reloadToApplyChanges: "변경 사항을 적용하려면 새로 고침하세요.",
  rename: "이름 바꾸기",
  reportIssue: "보고서 보내기",
  reportIssueTooltip: "Comfy Org에 오류 보고서를 제출합니다.",
  reportSent: "보고서 제출됨",
  reset: "재설정",
  resetKeybindingsTooltip: "키 바인딩을 기본값으로 재설정",
  save: "저장",
  searchExtensions: "확장 검색",
  searchFailedMessage: "검색어와 일치하는 설정을 찾을 수 없습니다. 검색어를 조정해 보세요.",
  searchKeybindings: "키 바인딩 검색",
  searchModels: "모델 검색",
  searchNodes: "노드 검색",
  searchSettings: "설정 검색",
  searchWorkflows: "워크플로 검색",
  settings: "설정",
  showReport: "보고서 보기",
  systemInfo: "시스템 정보",
  terminal: "터미널",
  upload: "업로드",
  videoFailedToLoad: "비디오를 로드하지 못했습니다."
};
const graphCanvasMenu$2 = {
  fitView: "보기 맞춤",
  panMode: "팬 모드",
  resetView: "보기 재설정",
  selectMode: "선택 모드",
  toggleLinkVisibility: "링크 가시성 전환",
  zoomIn: "확대",
  zoomOut: "축소"
};
const groupNode$2 = {
  create: "그룹 노드 만들기",
  enterName: "이름 입력"
};
const icon$2 = {
  bookmark: "북마크",
  box: "상자",
  briefcase: "서류가방",
  "exclamation-triangle": "경고",
  file: "파일",
  folder: "폴더",
  heart: "하트",
  inbox: "받은 편지함",
  star: "별"
};
const install$2 = {
  appDataLocationTooltip: "ComfyUI의 앱 데이터 디렉토리. 저장소:\n- 로그\n- 서버 구성",
  appPathLocationTooltip: "ComfyUI의 앱 에셋 디렉토리. ComfyUI 코드 및 에셋을 저장합니다.",
  cannotWrite: "선택한 경로에 쓸 수 없습니다",
  chooseInstallationLocation: "설치 위치 선택",
  customNodes: "사용자 정의 노드",
  customNodesDescription: "기존 ComfyUI 설치에서 사용자 정의 노드를 다시 설치합니다.",
  desktopAppSettings: "데스크탑 앱 설정",
  desktopAppSettingsDescription: "ComfyUI가 데스크탑에서 어떻게 작동하는지 구성하세요. 이 설정은 나중에 변경할 수 있습니다.",
  desktopSettings: "데스크탑 설정",
  failedToSelectDirectory: "디렉토리 선택 실패",
  gpu: "GPU",
  gpuSelection: {
    cpuMode: "CPU 모드",
    cpuModeDescription: "CPU 모드는 개발자와 드문 경우에만 사용됩니다.",
    cpuModeDescription2: "이것이 필요한지 확실하지 않다면, 이 상자를 무시하고 위에서 GPU를 선택하세요.",
    customComfyNeedsPython: "파이썬이 설정되지 않으면 ComfyUI가 작동하지 않습니다",
    customInstallRequirements: "모든 요구 사항과 종속성 설치 (예: 사용자 정의 torch)",
    customManualVenv: "파이썬 venv를 수동으로 구성",
    customMayNotWork: "이것은 전혀 지원되지 않으며, 작동하지 않을 수 있습니다",
    customSkipsPython: "이 옵션은 일반 파이썬 설정을 건너뜁니다.",
    enableCpuMode: "CPU 모드 활성화",
    mpsDescription: "Apple Metal Performance Shaders는 pytorch nightly를 사용하여 지원됩니다.",
    nvidiaDescription: "NVIDIA 장치는 pytorch CUDA 빌드를 사용하여 직접 지원됩니다.",
    selectGpu: "GPU 선택",
    selectGpuDescription: "소유한 GPU 유형을 선택하세요"
  },
  installLocation: "설치 위치",
  installLocationDescription: "ComfyUI의 사용자 데이터 디렉토리를 선택하십시오. 선택한 위치에 Python 환경이 설치됩니다. 선택한 디스크에 충분한 공간(~15GB)이 남아 있는지 확인하십시오.",
  installLocationTooltip: "ComfyUI의 사용자 데이터 디렉토리. 저장소:\n- Python 환경\n- 모델\n- 사용자 정의 노드\n",
  insufficientFreeSpace: "공간이 부족합니다 - 최소한의 여유 공간",
  manualConfiguration: {
    createVenv: "다음 디렉토리에 가상 환경을 생성해야 합니다",
    requirements: "요구 사항",
    restartWhenFinished: "가상 환경 구성을 완료하면 ComfyUI를 다시 시작해주세요.",
    title: "수동 구성",
    virtualEnvironmentPath: "가상 환경 경로"
  },
  migrateFromExistingInstallation: "기존 설치에서 마이그레이션",
  migration: "마이그레이션",
  migrationOptional: "마이그레이션은 선택 사항입니다. 기존에 설치된 것이 없다면, 이 단계를 건너뛸 수 있습니다.",
  migrationSourcePathDescription: "기존에 설치된 ComfyUI가 있는 경우, 기존 사용자 파일과 모델을 새 설치에 복사하거나 링크할 수 있습니다",
  parentMissing: "경로가 존재하지 않습니다 - 먼저 포함하는 디렉토리를 생성하세요",
  pathExists: "디렉토리가 이미 존재합니다 - 모든 데이터를 백업했는지 확인해 주세요",
  pathValidationFailed: "경로 유효성 검사 실패",
  selectItemsToMigrate: "마이그레이션 항목 선택",
  settings: {
    allowMetrics: "충돌 보고서",
    allowMetricsDescription: "익명의 충돌 보고서를 보내 ComfyUI 개선에 도움을 줍니다. 개인 정보나 워크플로 내용은 수집되지 않습니다. 이는 설정 메뉴에서 언제든지 비활성화할 수 있습니다.",
    autoUpdate: "자동 업데이트",
    autoUpdateDescription: "업데이트가 가능해지면 자동으로 다운로드하고 설치합니다. 업데이트가 설치되기 전에 항상 알림을 받습니다.",
    dataCollectionDialog: {
      customNodeConfigurations: "사용자 정의 노드 설정",
      errorReports: "오류 메시지 및 스택 추적",
      fileSystemInformation: "파일 시스템 정보",
      personalInformation: "개인 정보",
      systemInfo: "하드웨어, OS 유형 및 앱 버전",
      title: "데이터 수집 안내",
      whatWeCollect: "수집하는 정보:",
      whatWeDoNotCollect: "수집하지 않는 정보:",
      workflowContent: "워크플로 내용",
      workflowContents: "워크플로 내용"
    },
    learnMoreAboutData: "데이터 수집에 대해 더 알아보기"
  },
  systemLocations: "시스템 위치",
  unhandledError: "알 수 없는 오류"
};
const menu$2 = {
  autoQueue: "자동 실행 큐",
  batchCount: "배치 수",
  batchCountTooltip: "워크플로 작업을 실행 큐에 반복 추가할 횟수",
  clear: "워크플로 비우기",
  clipspace: "클립스페이스 열기",
  disabled: "비활성화됨",
  disabledTooltip: "워크플로 작업을 자동으로 실행 큐에 추가하지 않습니다.",
  execute: "실행",
  hideMenu: "메뉴 숨기기",
  instant: "즉시",
  instantTooltip: "워크플로 실행이 완료되면 즉시 실행 큐에 추가합니다.",
  interrupt: "현재 실행 취소",
  onChange: "변경 시",
  onChangeTooltip: "변경이 있는 경우에만 워크플로를 실행 큐에 추가합니다.",
  queue: "실행 큐",
  queueWorkflow: "워크플로 실행 큐에 추가 (Shift: 실행 큐 맨 앞에 추가)",
  queueWorkflowFront: "워크플로를 실행 큐 맨 앞에 추가",
  refresh: "노드 정의 새로 고침",
  resetView: "캔버스 보기 재설정",
  showMenu: "메뉴 표시",
  toggleBottomPanel: "하단 패널 전환"
};
const menuLabels$2 = {
  "About ComfyUI": "ComfyUI에 대하여",
  "Browse Templates": "템플릿 탐색",
  "Bypass/Unbypass Selected Nodes": "선택한 노드 우회/우회 해제",
  "Canvas Toggle Link Visibility": "캔버스 토글 링크 가시성",
  "Canvas Toggle Lock": "캔버스 토글 잠금",
  "Clear Pending Tasks": "보류 중인 작업 제거하기",
  "Clear Workflow": "워크플로 지우기",
  Clipspace: "클립스페이스",
  "Collapse/Expand Selected Nodes": "선택한 노드 축소/확장",
  "Comfy-Org Discord": "Comfy-Org 디스코드",
  "ComfyUI Docs": "ComfyUI 문서",
  "ComfyUI Issues": "ComfyUI 이슈 페이지",
  "Convert selected nodes to group node": "선택한 노드를 그룹 노드로 변환",
  "Desktop User Guide": "데스크톱 사용자 가이드",
  "Duplicate Current Workflow": "현재 워크플로우 복제",
  Edit: "편집",
  Export: "내보내기",
  "Export (API)": "내보내기 (API)",
  Feedback: "피드백",
  "Fit Group To Contents": "그룹을 내용에 맞게 조정",
  "Fit view to selected nodes": "선택한 노드에 맞게 보기 조정",
  "Group Selected Nodes": "선택한 노드 그룹화",
  Help: "도움말",
  Interrupt: "중단",
  "Load Default Workflow": "기본 워크플로 불러오기",
  "Manage group nodes": "그룹 노드 관리",
  "Mute/Unmute Selected Nodes": "선택한 노드 활성화/비활성화",
  New: "새로 만들기",
  "Next Opened Workflow": "다음 열린 워크플로",
  Open: "열기",
  "Open Custom Nodes Folder": "사용자 정의 노드 폴더 열기",
  "Open DevTools": "개발자 도구 열기",
  "Open Inputs Folder": "입력 폴더 열기",
  "Open Logs Folder": "로그 폴더 열기",
  "Open Models Folder": "모델 폴더 열기",
  "Open Outputs Folder": "출력 폴더 열기",
  "Open extra_model_paths_yaml": "extra_model_paths.yaml 열기",
  "Pin/Unpin Selected Items": "선택한 항목 고정/고정 해제",
  "Pin/Unpin Selected Nodes": "선택한 노드 고정/고정 해제",
  "Previous Opened Workflow": "이전 열린 워크플로",
  "Queue Prompt": "실행 큐에 프롬프트 추가",
  "Queue Prompt (Front)": "실행 큐 맨 앞에 프롬프트 추가",
  Redo: "다시 실행",
  "Refresh Node Definitions": "노드 정의 새로 고침",
  Reinstall: "재설치",
  "Reset View": "보기 초기화",
  Restart: "재시작",
  Save: "저장",
  "Save As": "다른 이름으로 저장",
  "Show Settings Dialog": "설정 대화상자 표시",
  "Toggle Bottom Panel": "하단 패널 전환",
  "Toggle Focus Mode": "포커스 모드 전환",
  "Toggle Logs Bottom Panel": "로그 하단 패널 전환",
  "Toggle Model Library Sidebar": "모델 라이브러리 사이드바 전환",
  "Toggle Node Library Sidebar": "노드 라이브러리 사이드바 전환",
  "Toggle Queue Sidebar": "실행 큐 사이드바 전환",
  "Toggle Search Box": "검색 상자 전환",
  "Toggle Terminal Bottom Panel": "터미널 하단 패널 전환",
  "Toggle Theme (Dark/Light)": "테마 전환 (어두운/밝은)",
  "Toggle Workflows Sidebar": "워크플로 사이드바 전환",
  Undo: "실행 취소",
  "Ungroup selected group nodes": "선택한 그룹 노드 그룹 해제",
  Workflow: "워크플로",
  "Zoom In": "확대",
  "Zoom Out": "축소"
};
const nodeCategories$2 = {
  "3d": "3d",
  "3d_models": "3D 모델",
  DevTools: "개발자 도구",
  _for_testing: "_테스트용",
  advanced: "고급",
  animation: "애니메이션",
  api: "API",
  attention_experiments: "어텐션 실험",
  audio: "오디오",
  batch: "배치",
  clip: "클립",
  combine: "결합",
  compositing: "합성",
  "cond pair": "조건 쌍",
  "cond single": "단일 조건",
  conditioning: "조건화",
  controlnet: "컨트롤넷",
  create: "생성",
  custom_sampling: "사용자 정의 샘플링",
  deprecated: "지원 중단",
  flux: "flux",
  gligen: "글리젠",
  guidance: "가이드",
  guiders: "가이드",
  hooks: "후크",
  image: "이미지",
  inpaint: "인페인팅",
  instructpix2pix: "InstructPix2Pix",
  latent: "잠재 데이터",
  loaders: "로더",
  ltxv: "ltxv",
  mask: "마스크",
  model: "모델",
  model_merging: "모델 병합",
  model_patches: "모델 패치",
  model_specific: "모델 특정",
  noise: "노이즈",
  operations: "연산",
  photomaker: "포토메이커",
  postprocessing: "후처리",
  preprocessors: "전처리기",
  samplers: "샘플러",
  sampling: "샘플링",
  schedulers: "스케줄러",
  scheduling: "스케줄링",
  sd3: "sd3",
  sigmas: "시그마",
  stable_cascade: "Stable Cascade",
  style_model: "스타일 모델",
  transform: "변환",
  unet: "UNet",
  upscale_diffusion: "업스케일 확산",
  upscaling: "업스케일링",
  video: "비디오",
  video_models: "비디오 모델"
};
const nodeTemplates$2 = {
  enterName: "이름 입력",
  saveAsTemplate: "템플릿으로 저장"
};
const notSupported$2 = {
  "continue": "계속",
  continueTooltip: "내 장치가 지원되는 장치가 확실합니다.",
  learnMore: "자세히 알아보기",
  message: "다음 장치만 지원됩니다:",
  reportIssue: "이슈 보고",
  supportedDevices: {
    macos: "MacOS (M1 이상)",
    windows: "Windows (CUDA 지원 Nvidia GPU)"
  },
  title: "이 장치는 지원되지 않습니다."
};
const serverConfig$2 = {
  modifiedConfigs: "다음 서버 구성을 수정했습니다. 변경 사항을 적용하려면 다시 시작하세오.",
  restart: "다시 시작",
  revertChanges: "변경 사항 되돌리기"
};
const serverConfigCategories$2 = {
  Attention: "어텐션",
  CUDA: "CUDA",
  Cache: "캐시",
  Directories: "디렉토리",
  General: "일반",
  Inference: "추론",
  Memory: "메모리",
  Network: "네트워크",
  Preview: "미리보기"
};
const serverConfigItems$2 = {
  "cache-classic": {
    name: "예전 방식의 공격적 캐시 시스템 사용"
  },
  "cache-lru": {
    name: "최대 N개 노드 결과를 캐시하는 LRU(Least Recently Used) 캐싱 사용.",
    tooltip: "RAM/VRAM 사용량이 증가합니다"
  },
  "cpu-vae": {
    name: "CPU에서 VAE 실행"
  },
  "cross-attention-method": {
    name: "교차 어텐션 방법"
  },
  "cuda-device": {
    name: "사용할 CUDA 장치 번호"
  },
  "cuda-malloc": {
    name: "메모리 할당에 CUDA malloc 사용"
  },
  "default-hashing-function": {
    name: "모델 파일의 기본 해싱 함수"
  },
  deterministic: {
    name: "사용 가능한 경우 pytorch가 느리지만 결정론적인 알고리즘을 사용하도록 설정합니다.",
    tooltip: "주의: 이 옵션이 항상 결정론적 이미지를 보장하지는 않습니다."
  },
  directml: {
    name: "DirectML 장치 번호"
  },
  "disable-all-custom-nodes": {
    name: "모든 사용자 정의 노드 로드 비활성화."
  },
  "disable-ipex-optimize": {
    name: "IPEX 최적화 비활성화"
  },
  "disable-metadata": {
    name: "파일에 프롬프트(워크플로) 메타데이터 저장 비활성화."
  },
  "disable-smart-memory": {
    name: "스마트 메모리 관리 비활성화",
    tooltip: "ComfyUI가 모델을 VRAM에 유지하는 대신 시스템 메모리로 공격적으로 오프로드하도록 강제합니다."
  },
  "disable-xformers": {
    name: "xFormers 최적화 비활성화"
  },
  "dont-print-server": {
    name: "서버 출력을 콘솔에 출력하지 않음."
  },
  "dont-upcast-attention": {
    name: "어텐션 업캐스트 방지"
  },
  "enable-cors-header": {
    name: 'CORS 헤더 활성화: 모든 출처에 대해 "*" 사용 또는 도메인 지정'
  },
  fast: {
    name: "테스트되지 않고 품질 저하 가능성이 있는 실험적 최적화 기능을 활성화 합니다."
  },
  "force-channels-last": {
    name: "channels-last 메모리 형식 강제 적용"
  },
  "force-upcast-attention": {
    name: "어텐션 업캐스트 강제 적용"
  },
  "global-precision": {
    name: "전역 부동 소수점 정밀도",
    tooltip: "전역 부동 소수점 정밀도"
  },
  "input-directory": {
    name: "입력 디렉토리"
  },
  listen: {
    name: "호스트: 접속될 IP 주소"
  },
  "log-level": {
    name: "로그 출력 수준"
  },
  "max-upload-size": {
    name: "최대 업로드 크기 (MB)"
  },
  "output-directory": {
    name: "출력 디렉토리"
  },
  port: {
    name: "포트: 접속될 포트"
  },
  "preview-method": {
    name: "잠재 데이터 미리보기 방법"
  },
  "preview-size": {
    name: "미리보기 최대 이미지 크기"
  },
  "reserve-vram": {
    name: "예약된 VRAM (GB)",
    tooltip: "OS/기타 소프트웨어에서 사용하기 위해 예약할 VRAM의 양을 GB 단위로 설정합니다. 기본적으로 OS에 따라 일부 양이 예약됩니다."
  },
  "text-encoder-precision": {
    name: "텍스트 인코더 정밀도",
    tooltip: "텍스트 인코더 정밀도"
  },
  "tls-certfile": {
    name: "TLS 인증서 파일: HTTPS용 TLS 인증서 파일 경로"
  },
  "tls-keyfile": {
    name: "TLS 키 파일: HTTPS용 TLS 키 파일 경로"
  },
  "unet-precision": {
    name: "UNET 정밀도",
    tooltip: "UNET 정밀도"
  },
  "vae-precision": {
    name: "VAE 정밀도",
    tooltip: "VAE 정밀도"
  },
  "vram-management": {
    name: "VRAM 관리 모드"
  }
};
const serverStart$2 = {
  openLogs: "로그 열기",
  process: {
    error: "ComfyUI Desktop을 시작할 수 없습니다",
    "initial-state": "로딩 중...",
    "python-setup": "파이썬 환경 설정 중...",
    ready: "마무리 중...",
    "starting-server": "ComfyUI 서버 시작 중..."
  },
  reinstall: "재설치",
  reportIssue: "문제 보고",
  showTerminal: "터미널 보기"
};
const settingsCategories$2 = {
  About: "정보",
  Appearance: "모양",
  BrushAdjustment: "브러시 조정",
  Canvas: "캔버스",
  ColorPalette: "색상 팔레트",
  Comfy: "Comfy",
  "Comfy-Desktop": "Comfy-Desktop",
  CustomColorPalettes: "사용자 정의 색상 팔레트",
  DevMode: "개발자 모드",
  EditTokenWeight: "토큰 가중치 편집",
  Extension: "확장",
  General: "일반",
  Graph: "그래프",
  Group: "그룹",
  Keybinding: "키 바인딩",
  Link: "링크",
  LinkRelease: "링크 해제",
  LiteGraph: "LiteGraph",
  Locale: "언어 설정",
  "Mask Editor": "마스크 편집기",
  Menu: "메뉴",
  ModelLibrary: "모델 라이브러리",
  NewEditor: "새 편집기",
  Node: "노드",
  "Node Search Box": "노드 검색 상자",
  "Node Widget": "노드 위젯",
  NodeInputConversionSubmenus: "노드 입력 변환 하위 메뉴",
  NodeLibrary: "노드 라이브러리",
  Pointer: "포인터",
  Queue: "실행 큐",
  QueueButton: "실행 큐 버튼",
  RerouteBeta: "경로재설정 베타",
  Server: "서버",
  "Server-Config": "서버 구성",
  Settings: "설정",
  Sidebar: "사이드바",
  "Tree Explorer": "트리 탐색기",
  Validation: "검증",
  Window: "창",
  Workflow: "워크플로"
};
const sideToolbar$2 = {
  browseTemplates: "예제 템플릿 탐색",
  downloads: "다운로드",
  logout: "로그아웃",
  modelLibrary: "모델 라이브러리",
  newBlankWorkflow: "새 빈 워크플로 만들기",
  nodeLibrary: "노드 라이브러리",
  nodeLibraryTab: {
    sortOrder: "정렬 순서"
  },
  openWorkflow: "로컬 파일 시스템에서 워크플로 열기",
  queue: "실행 큐",
  queueTab: {
    backToAllTasks: "모든 작업으로 돌아가기",
    clearPendingTasks: "보류 중인 작업 지우기",
    containImagePreview: "이미지 미리보기 채우기",
    coverImagePreview: "이미지 미리보기 맞추기",
    filter: "출력 필터",
    filters: {
      hideCached: "캐시 숨기기",
      hideCanceled: "취소된 작업 숨기기"
    },
    showFlatList: "평면 목록 표시"
  },
  themeToggle: "테마 전환",
  workflowTab: {
    confirmDelete: "정말로 이 워크플로를 삭제하시겠습니까?",
    confirmDeleteTitle: "워크플로 삭제",
    confirmOverwrite: "아래 파일이 이미 존재합니다. 덮어쓰시겠습니까?",
    confirmOverwriteTitle: "기존 파일 덮어쓰기?",
    deleteFailed: "워크플로 삭제를 시도했으나 실패했습니다.",
    deleteFailedTitle: "삭제 실패",
    deleted: "워크플로가 삭제되었습니다.",
    dirtyClose: "아래 파일들이 변경되었습니다. 닫기 전에 저장하시겠습니까?",
    dirtyCloseTitle: "변경 사항 저장",
    workflowTreeType: {
      bookmarks: "북마크",
      browse: "찾아보기",
      open: "열기"
    }
  },
  workflows: "워크플로"
};
const tabMenu$2 = {
  closeOtherTabs: "다른 탭 닫기",
  closeTab: "탭 닫기",
  closeTabsToLeft: "왼쪽 탭 닫기",
  closeTabsToRight: "오른쪽 탭 닫기",
  duplicateTab: "탭 복제"
};
const templateWorkflows$2 = {
  template: {
    "default": "이미지 생성",
    flux_schnell: "FLUX Schenll",
    image2image: "이미지에서 이미지로",
    upscale: "2단계 업스케일"
  },
  title: "템플릿으로 시작하기"
};
const userSelect$2 = {
  enterUsername: "사용자 이름 입력",
  existingUser: "기존 사용자",
  newUser: "새 사용자",
  next: "다음",
  selectUser: "사용자 선택"
};
const welcome$2 = {
  getStarted: "시작하기",
  title: "ComfyUI에 오신 것을 환영합니다"
};
const workflowService$2 = {
  enterFilename: "파일 이름 입력",
  exportWorkflow: "워크플로 내보내기",
  saveWorkflow: "워크플로 저장"
};
const ko = {
  color: color$2,
  dataTypes: dataTypes$2,
  desktopMenu: desktopMenu$2,
  downloadGit: downloadGit$2,
  electronFileDownload: electronFileDownload$2,
  g: g$2,
  graphCanvasMenu: graphCanvasMenu$2,
  groupNode: groupNode$2,
  icon: icon$2,
  install: install$2,
  menu: menu$2,
  menuLabels: menuLabels$2,
  nodeCategories: nodeCategories$2,
  nodeTemplates: nodeTemplates$2,
  notSupported: notSupported$2,
  serverConfig: serverConfig$2,
  serverConfigCategories: serverConfigCategories$2,
  serverConfigItems: serverConfigItems$2,
  serverStart: serverStart$2,
  settingsCategories: settingsCategories$2,
  sideToolbar: sideToolbar$2,
  tabMenu: tabMenu$2,
  templateWorkflows: templateWorkflows$2,
  userSelect: userSelect$2,
  welcome: welcome$2,
  workflowService: workflowService$2
};
const AddNoise$2 = {
  display_name: "노이즈 추가",
  inputs: {
    latent_image: {
      name: "잠재 이미지"
    },
    model: {
      name: "모델"
    },
    noise: {
      name: "노이즈"
    },
    sigmas: {
      name: "시그마"
    }
  }
};
const AlignYourStepsScheduler$2 = {
  display_name: "AlignYourSteps 스케쥴러",
  inputs: {
    denoise: {
      name: "노이즈 제거양"
    },
    model_type: {
      name: "모델 유형"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const BasicGuider$2 = {
  display_name: "기본 가이드",
  inputs: {
    conditioning: {
      name: "조건"
    },
    model: {
      name: "모델"
    }
  }
};
const BasicScheduler$2 = {
  display_name: "기본 스케줄러",
  inputs: {
    denoise: {
      name: "노이즈 제거양"
    },
    model: {
      name: "모델"
    },
    scheduler: {
      name: "스케줄러"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const BetaSamplingScheduler$2 = {
  display_name: "베타 샘플링 스케줄러",
  inputs: {
    alpha: {
      name: "알파"
    },
    beta: {
      name: "베타"
    },
    model: {
      name: "모델"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const CFGGuider$2 = {
  display_name: "CFG 가이드",
  inputs: {
    cfg: {
      name: "cfg"
    },
    model: {
      name: "모델"
    },
    negative: {
      name: "부정 조건"
    },
    positive: {
      name: "긍정 조건"
    }
  }
};
const CLIPAttentionMultiply$2 = {
  display_name: "CLIP 어텐션 곱하기",
  inputs: {
    clip: {
      name: "clip"
    },
    k: {
      name: "k"
    },
    out: {
      name: "out"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const CLIPLoader$2 = {
  description: "[조합법]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 / clip-g / clip-l\nstable_audio: t5\nmochi: t5",
  display_name: "CLIP 로드",
  inputs: {
    clip_name: {
      name: "CLIP 파일명"
    },
    type: {
      name: "유형"
    }
  }
};
const CLIPMergeAdd$2 = {
  display_name: "CLIP 병합 (더하기)",
  inputs: {
    clip1: {
      name: "CLIP1"
    },
    clip2: {
      name: "CLIP2"
    }
  }
};
const CLIPMergeSimple$2 = {
  display_name: "CLIP 병합 (단순)",
  inputs: {
    clip1: {
      name: "CLIP1"
    },
    clip2: {
      name: "CLIP2"
    },
    ratio: {
      name: "비율"
    }
  }
};
const CLIPMergeSubtract$2 = {
  display_name: "CLIP 병합 (빼기)",
  inputs: {
    clip1: {
      name: "CLIP1"
    },
    clip2: {
      name: "CLIP2"
    },
    multiplier: {
      name: "배율"
    }
  }
};
const CLIPSave$2 = {
  display_name: "CLIP 저장",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "파일명 접두사"
    }
  }
};
const CLIPSetLastLayer$2 = {
  display_name: "CLIP 마지막 레이어 설정",
  inputs: {
    clip: {
      name: "clip"
    },
    stop_at_clip_layer: {
      name: "CLIP 레이어 중단점"
    }
  }
};
const CLIPTextEncode$2 = {
  description: "CLIP 모델을 사용하여 텍스트 프롬프트를 인코딩하여 확산 모델이 특정 이미지를 생성하도록 안내하는 임베딩으로 변환합니다.",
  display_name: "CLIP 텍스트 인코딩 (프롬프트)",
  inputs: {
    clip: {
      name: "clip",
      tooltip: "텍스트 인코딩에 사용되는 CLIP 모델입니다."
    },
    text: {
      name: "프롬프트 텍스트",
      tooltip: "인코딩할 텍스트입니다."
    }
  },
  outputs: {
    "0": {
      tooltip: "확산 모델을 안내하는 데 사용되는 임베디드 텍스트를 포함하는 조건부입니다."
    }
  }
};
const CLIPTextEncodeControlnet$2 = {
  display_name: "CLIP 텍스트 인코딩 (컨트롤넷)",
  inputs: {
    clip: {
      name: "clip"
    },
    conditioning: {
      name: "조건"
    },
    text: {
      name: "프롬프트 텍스트"
    }
  }
};
const CLIPTextEncodeFlux$2 = {
  display_name: "CLIP 텍스트 인코딩 (FLUX)",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_l: {
      name: "clip-l 프롬프트"
    },
    guidance: {
      name: "가이던스"
    },
    t5xxl: {
      name: "t5xxl 프롬프트"
    }
  }
};
const CLIPTextEncodeHunyuanDiT$2 = {
  display_name: "CLIP 텍스트 인코딩 (HunyuanDiT)",
  inputs: {
    bert: {
      name: "bert 프롬프트"
    },
    clip: {
      name: "clip"
    },
    mt5xl: {
      name: "mt5xl 프롬프트"
    }
  }
};
const CLIPTextEncodePixArtAlpha$2 = {
  description: "텍스트를 인코딩하고 PixArt Alpha의 해상도 조건을 설정합니다. PixArt Sigma에는 적용되지 않습니다.",
  display_name: "CLIPTextEncodePixArtAlpha",
  inputs: {
    clip: {
      name: "clip"
    },
    height: {
      name: "높이"
    },
    text: {
      name: "프롬프트 텍스트"
    },
    width: {
      name: "너비"
    }
  }
};
const CLIPTextEncodeSD3$2 = {
  display_name: "CLIP 텍스트 인코딩 (SD3)",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_g: {
      name: "clip-g 프롬프트"
    },
    clip_l: {
      name: "clip-l 프롬프트"
    },
    empty_padding: {
      name: "빈_패딩"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeSDXL$2 = {
  display_name: "CLIP 텍스트 인코딩 (SDXL)",
  inputs: {
    clip: {
      name: "clip"
    },
    crop_h: {
      name: "크롭 높이"
    },
    crop_w: {
      name: "크롭 너비"
    },
    height: {
      name: "높이"
    },
    target_height: {
      name: "목표 높이"
    },
    target_width: {
      name: "목표 너비"
    },
    text_g: {
      name: "clip-g 프롬프트"
    },
    text_l: {
      name: "clip-l 프롬프트"
    },
    width: {
      name: "너비"
    }
  }
};
const CLIPTextEncodeSDXLRefiner$2 = {
  display_name: "CLIP 텍스트 인코딩 (SDXL Refiner)",
  inputs: {
    ascore: {
      name: "ascore"
    },
    clip: {
      name: "clip"
    },
    height: {
      name: "높이"
    },
    text: {
      name: "텍스트"
    },
    width: {
      name: "너비"
    }
  }
};
const CLIPVisionEncode$2 = {
  display_name: "CLIP_VISION 인코딩",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    crop: {
      name: "자르기 방법"
    },
    image: {
      name: "이미지"
    }
  }
};
const CLIPVisionLoader$2 = {
  display_name: "CLIP_VISION 로드",
  inputs: {
    clip_name: {
      name: "CLIP 파일명"
    }
  }
};
const Canny$2 = {
  display_name: "Canny 경계 필터",
  inputs: {
    high_threshold: {
      name: "높은 임계값"
    },
    image: {
      name: "이미지"
    },
    low_threshold: {
      name: "낮은 임계값"
    }
  }
};
const CheckpointLoader$2 = {
  display_name: "구성으로 체크포인트 로드 (지원 중단)",
  inputs: {
    ckpt_name: {
      name: "체크포인트 파일명"
    },
    config_name: {
      name: "설정 이름"
    }
  }
};
const CheckpointLoaderSimple$2 = {
  description: "확산 모델 체크포인트를 로드합니다. 확산 모델은 잠재 데이터의 노이즈를 제거하는 데 사용됩니다.",
  display_name: "체크포인트 로드",
  inputs: {
    ckpt_name: {
      name: "체크포인트 파일명",
      tooltip: "로드할 체크포인트(모델)의 이름입니다."
    }
  },
  outputs: {
    "0": {
      tooltip: "노이즈 제거를 위한 잠재 모델입니다."
    },
    "1": {
      tooltip: "텍스트 프롬프트를 인코딩하는 데 사용되는 CLIP 모델입니다."
    },
    "2": {
      tooltip: "이미지를 잠재 공간으로 인코딩하고 디코딩하는 데 사용되는 VAE 모델입니다."
    }
  }
};
const CheckpointSave$2 = {
  display_name: "체크포인트 저장",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "파일명 접두사"
    },
    model: {
      name: "모델"
    },
    vae: {
      name: "vae"
    }
  }
};
const CombineHooks2$2 = {
  display_name: "후크 결합 [2]",
  inputs: {
    hooks_A: {
      name: "후크 A"
    },
    hooks_B: {
      name: "후크 B"
    }
  }
};
const CombineHooks4$2 = {
  display_name: "후크 결합 [4]",
  inputs: {
    hooks_A: {
      name: "후크 A"
    },
    hooks_B: {
      name: "후크 B"
    },
    hooks_C: {
      name: "후크 C"
    },
    hooks_D: {
      name: "후크 D"
    }
  }
};
const CombineHooks8$2 = {
  display_name: "후크 결합 [8]",
  inputs: {
    hooks_A: {
      name: "후크 A"
    },
    hooks_B: {
      name: "후크 B"
    },
    hooks_C: {
      name: "후크 C"
    },
    hooks_D: {
      name: "후크 D"
    },
    hooks_E: {
      name: "후크 E"
    },
    hooks_F: {
      name: "후크 F"
    },
    hooks_G: {
      name: "후크 G"
    },
    hooks_H: {
      name: "후크 H"
    }
  }
};
const ConditioningAverage$2 = {
  display_name: "조건 (평균)",
  inputs: {
    conditioning_from: {
      name: "추가 조건"
    },
    conditioning_to: {
      name: "대상 조건"
    },
    conditioning_to_strength: {
      name: "대상 조건 강도"
    }
  }
};
const ConditioningCombine$2 = {
  display_name: "조건 (결합)",
  inputs: {
    conditioning_1: {
      name: "조건 1"
    },
    conditioning_2: {
      name: "조건 2"
    }
  }
};
const ConditioningConcat$2 = {
  display_name: "조건 (연결)",
  inputs: {
    conditioning_from: {
      name: "추가 조건"
    },
    conditioning_to: {
      name: "대상 조건"
    }
  }
};
const ConditioningSetArea$2 = {
  display_name: "조건 (영역 설정)",
  inputs: {
    conditioning: {
      name: "조건"
    },
    height: {
      name: "높이"
    },
    strength: {
      name: "강도"
    },
    width: {
      name: "너비"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaPercentage$2 = {
  display_name: "조건 (비율로 영역 설정)",
  inputs: {
    conditioning: {
      name: "조건"
    },
    height: {
      name: "높이"
    },
    strength: {
      name: "강도"
    },
    width: {
      name: "너비"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaStrength$2 = {
  display_name: "조건 (영역 강도 설정)",
  inputs: {
    conditioning: {
      name: "조건"
    },
    strength: {
      name: "강도"
    }
  }
};
const ConditioningSetDefaultCombine$2 = {
  display_name: "조건 (기본 결합 설정)",
  inputs: {
    cond: {
      name: "조건"
    },
    cond_DEFAULT: {
      name: "기본 조건"
    },
    hooks: {
      name: "후크"
    }
  }
};
const ConditioningSetMask$2 = {
  display_name: "조건 (마스크 설정)",
  inputs: {
    conditioning: {
      name: "조건"
    },
    mask: {
      name: "마스크"
    },
    set_cond_area: {
      name: "조건 영역 설정"
    },
    strength: {
      name: "강도"
    }
  }
};
const ConditioningSetProperties$2 = {
  display_name: "조건 (속성 설정)",
  inputs: {
    cond_NEW: {
      name: "새 조건"
    },
    hooks: {
      name: "후크"
    },
    mask: {
      name: "마스크"
    },
    set_cond_area: {
      name: "조건 영역 설정"
    },
    strength: {
      name: "강도"
    },
    timesteps: {
      name: "타임스텝 범위"
    }
  }
};
const ConditioningSetPropertiesAndCombine$2 = {
  display_name: "조건 (속성 설정 및 결합)",
  inputs: {
    cond: {
      name: "조건"
    },
    cond_NEW: {
      name: "새 조건"
    },
    hooks: {
      name: "후크"
    },
    mask: {
      name: "마스크"
    },
    set_cond_area: {
      name: "조건 영역 설정"
    },
    strength: {
      name: "강도"
    },
    timesteps: {
      name: "타임스텝 범위"
    }
  }
};
const ConditioningSetTimestepRange$2 = {
  display_name: "조건 (타임스텝 범위 설정)",
  inputs: {
    conditioning: {
      name: "조건"
    },
    end: {
      name: "끝"
    },
    start: {
      name: "시작"
    }
  }
};
const ConditioningStableAudio$2 = {
  display_name: "ConditioningStableAudio",
  inputs: {
    negative: {
      name: "부정 조건"
    },
    positive: {
      name: "긍정 조건"
    },
    seconds_start: {
      name: "시작(초)"
    },
    seconds_total: {
      name: "전체(초)"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const ConditioningTimestepsRange$2 = {
  display_name: "조건 (타임스텝 범위)",
  inputs: {
    end_percent: {
      name: "종료 퍼센트"
    },
    start_percent: {
      name: "시작 퍼센트"
    }
  },
  outputs: {
    "1": {
      name: "이전 범위"
    },
    "2": {
      name: "이후 범위"
    }
  }
};
const ConditioningZeroOut$2 = {
  display_name: "조건 (제로 아웃)",
  inputs: {
    conditioning: {
      name: "조건"
    }
  }
};
const ControlNetApply$2 = {
  display_name: "컨트롤넷 적용 (구형)",
  inputs: {
    conditioning: {
      name: "조건"
    },
    control_net: {
      name: "컨트롤넷"
    },
    image: {
      name: "이미지"
    },
    strength: {
      name: "강도"
    }
  }
};
const ControlNetApplyAdvanced$2 = {
  display_name: "컨트롤넷 적용",
  inputs: {
    control_net: {
      name: "컨트롤넷"
    },
    end_percent: {
      name: "종료 퍼센트"
    },
    image: {
      name: "이미지"
    },
    negative: {
      name: "부정 조건"
    },
    positive: {
      name: "긍정 조건"
    },
    start_percent: {
      name: "시작 퍼센트"
    },
    strength: {
      name: "강도"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const ControlNetApplySD3$2 = {
  display_name: "컨트롤넷을 VAE와 함께 적용",
  inputs: {
    control_net: {
      name: "컨트롤넷"
    },
    end_percent: {
      name: "종료 퍼센트"
    },
    image: {
      name: "이미지"
    },
    negative: {
      name: "부정 조건"
    },
    positive: {
      name: "긍정 조건"
    },
    start_percent: {
      name: "시작 퍼센트"
    },
    strength: {
      name: "강도"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const ControlNetInpaintingAliMamaApply$2 = {
  display_name: "컨트롤넷 인페인팅 AliMama 적용",
  inputs: {
    control_net: {
      name: "컨트롤넷"
    },
    end_percent: {
      name: "종료 퍼센트"
    },
    image: {
      name: "이미지"
    },
    mask: {
      name: "마스크"
    },
    negative: {
      name: "부정 조건"
    },
    positive: {
      name: "긍정 조건"
    },
    start_percent: {
      name: "시작 퍼센트"
    },
    strength: {
      name: "강도"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const ControlNetLoader$2 = {
  display_name: "컨트롤넷 모델 로드",
  inputs: {
    control_net_name: {
      name: "컨트롤넷 파일명"
    }
  }
};
const CreateHookKeyframe$2 = {
  display_name: "후크 키프레임 생성",
  inputs: {
    prev_hook_kf: {
      name: "이전 KF 후크"
    },
    start_percent: {
      name: "시작 퍼센트"
    },
    strength_mult: {
      name: "강도 곱"
    }
  },
  outputs: {
    "0": {
      name: "KF 후크"
    }
  }
};
const CreateHookKeyframesFromFloats$2 = {
  display_name: "부동 소수점으로 후크 키프레임 생성",
  inputs: {
    end_percent: {
      name: "종료 퍼센트"
    },
    floats_strength: {
      name: "실수 강도"
    },
    prev_hook_kf: {
      name: "이전 KF 후크"
    },
    print_keyframes: {
      name: "키프레임 출력"
    },
    start_percent: {
      name: "시작 퍼센트"
    }
  },
  outputs: {
    "0": {
      name: "KF 후크"
    }
  }
};
const CreateHookKeyframesInterpolated$2 = {
  display_name: "보간된 후크 키프레임 생성",
  inputs: {
    end_percent: {
      name: "종료 퍼센트"
    },
    interpolation: {
      name: "보간"
    },
    keyframes_count: {
      name: "키프레임 카운트"
    },
    prev_hook_kf: {
      name: "이전 KF 후크"
    },
    print_keyframes: {
      name: "키프레임 출력"
    },
    start_percent: {
      name: "시작 퍼센트"
    },
    strength_end: {
      name: "종료 강도"
    },
    strength_start: {
      name: "시작 강도"
    }
  },
  outputs: {
    "0": {
      name: "KF 후크"
    }
  }
};
const CreateHookLora$2 = {
  display_name: "후크 LoRA 생성",
  inputs: {
    lora_name: {
      name: "LoRA 파일명"
    },
    prev_hooks: {
      name: "이전 후크"
    },
    strength_clip: {
      name: "CLIP 강도"
    },
    strength_model: {
      name: "모델 강도"
    }
  }
};
const CreateHookLoraModelOnly$2 = {
  display_name: "후크 LoRA 생성 (모델 전용)",
  inputs: {
    lora_name: {
      name: "LoRA 파일명"
    },
    prev_hooks: {
      name: "이전 후크"
    },
    strength_model: {
      name: "모델 강도"
    }
  }
};
const CreateHookModelAsLora$2 = {
  display_name: "후크 모델을 LoRA로 생성",
  inputs: {
    ckpt_name: {
      name: "체크포인트 파일명"
    },
    prev_hooks: {
      name: "이전 후크"
    },
    strength_clip: {
      name: "CLIP 강도"
    },
    strength_model: {
      name: "모델 강도"
    }
  }
};
const CreateHookModelAsLoraModelOnly$2 = {
  display_name: "후크 모델을 LoRA로 생성 (모델 전용)",
  inputs: {
    ckpt_name: {
      name: "체크포인트 파일명"
    },
    prev_hooks: {
      name: "이전 후크"
    },
    strength_model: {
      name: "모델 강도"
    }
  }
};
const CropMask$2 = {
  display_name: "마스크 자르기",
  inputs: {
    height: {
      name: "높이"
    },
    mask: {
      name: "마스크"
    },
    width: {
      name: "너비"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const DevToolsDeprecatedNode$2 = {
  description: "지원 중단된 노드",
  display_name: "지원 중단된 노드"
};
const DevToolsErrorRaiseNode$2 = {
  description: "개발 목적으로 오류를 발생시킵니다",
  display_name: "오류 발생"
};
const DevToolsErrorRaiseNodeWithMessage$2 = {
  description: "개발 목적으로 메시지와 함께 오류를 발생시킵니다",
  display_name: "메시지와 함께 오류 발생",
  inputs: {
    message: {
      name: "메시지"
    }
  }
};
const DevToolsExperimentalNode$2 = {
  description: "실험적 노드",
  display_name: "실험적 노드"
};
const DevToolsLongComboDropdown$2 = {
  description: "긴 콤보 드롭다운",
  display_name: "긴 콤보 드롭다운",
  inputs: {
    option: {
      name: "옵션"
    }
  }
};
const DevToolsNodeWithForceInput$2 = {
  description: "강제 입력이 있는 노드",
  display_name: "강제 입력이 있는 노드",
  inputs: {
    float_input: {
      name: "실수 입력"
    },
    int_input: {
      name: "정수 입력"
    },
    int_input_widget: {
      name: "정수 입력 위젯"
    }
  }
};
const DevToolsNodeWithOnlyOptionalInput$2 = {
  description: "선택적 입력만 있는 노드",
  display_name: "선택적 입력만 있는 노드",
  inputs: {
    clip: {
      name: "clip"
    },
    text: {
      name: "텍스트"
    }
  }
};
const DevToolsNodeWithOptionalInput$2 = {
  description: "선택적 입력이 있는 노드",
  display_name: "선택적 입력이 있는 노드",
  inputs: {
    optional_input: {
      name: "선택적 입력"
    },
    required_input: {
      name: "필수 입력"
    }
  }
};
const DevToolsNodeWithOutputList$2 = {
  description: "출력 목록이 있는 노드",
  display_name: "출력 목록이 있는 노드",
  outputs: {
    "0": {
      name: "정수 출력"
    },
    "1": {
      name: "정수 목록 출력"
    }
  }
};
const DevToolsNodeWithStringInput$2 = {
  description: "문자열 입력이 있는 노드",
  display_name: "문자열 입력이 있는 노드",
  inputs: {
    string_input: {
      name: "문자열 입력"
    }
  }
};
const DevToolsNodeWithUnionInput$2 = {
  description: "유니온 입력이 있는 노드",
  display_name: "유니온 입력이 있는 노드",
  inputs: {
    int_input: {
      name: "정수 입력"
    },
    string_input: {
      name: "문자열 입력"
    },
    string_or_int_input: {
      name: "문자열 또는 정수 입력"
    }
  }
};
const DevToolsSimpleSlider$2 = {
  display_name: "간단한 슬라이더",
  inputs: {
    value: {
      name: "값"
    }
  }
};
const DiffControlNetLoader$2 = {
  display_name: "컨트롤넷 모델 로드 (차이)",
  inputs: {
    control_net_name: {
      name: "컨트롤넷 파일명"
    },
    model: {
      name: "모델"
    }
  }
};
const DifferentialDiffusion$2 = {
  display_name: "차등 확산",
  inputs: {
    model: {
      name: "모델"
    }
  }
};
const DiffusersLoader$2 = {
  display_name: "Diffusers 로드",
  inputs: {
    model_path: {
      name: "모델 경로"
    }
  }
};
const DisableNoise$2 = {
  display_name: "노이즈 비활성화"
};
const DualCFGGuider$2 = {
  display_name: "이중 CFG 가이드",
  inputs: {
    cfg_cond2_negative: {
      name: "(조건2 - 부정 조건) cfg"
    },
    cfg_conds: {
      name: "전체 조건 cfg"
    },
    cond1: {
      name: "조건1"
    },
    cond2: {
      name: "조건2"
    },
    model: {
      name: "모델"
    },
    negative: {
      name: "부정 조건"
    }
  }
};
const DualCLIPLoader$2 = {
  description: "[조합법]\n\nsdxl: clip-l, clip-g\nsd3: clip-l, clip-g / clip-l, t5 / clip-g, t5\nflux: clip-l, t5",
  display_name: "이중 CLIP 로드",
  inputs: {
    clip_name1: {
      name: "CLIP 파일명1"
    },
    clip_name2: {
      name: "CLIP 파일명2"
    },
    type: {
      name: "유형"
    }
  }
};
const EmptyHunyuanLatentVideo$2 = {
  display_name: "빈 잠재 비디오 (Hunyuan)",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    height: {
      name: "높이"
    },
    length: {
      name: "길이"
    },
    width: {
      name: "너비"
    }
  }
};
const EmptyImage$2 = {
  display_name: "빈 이미지",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    color: {
      name: "색"
    },
    height: {
      name: "높이"
    },
    width: {
      name: "너비"
    }
  }
};
const EmptyLTXVLatentVideo$2 = {
  display_name: "빈 잠재 비디오 (LTXV)",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    height: {
      name: "높이"
    },
    length: {
      name: "길이"
    },
    width: {
      name: "너비"
    }
  }
};
const EmptyLatentAudio$2 = {
  display_name: "빈 잠재 오디오",
  inputs: {
    batch_size: {
      name: "배치 크기",
      tooltip: "배치의 잠재 이미지 수입니다."
    },
    seconds: {
      name: "초"
    }
  }
};
const EmptyLatentImage$2 = {
  description: "샘플링을 통해 디노이즈할 빈 잠재 이미지의 새 배치를 생성합니다.",
  display_name: "빈 잠재 이미지",
  inputs: {
    batch_size: {
      name: "배치 크기",
      tooltip: "배치의 잠재 이미지 수입니다."
    },
    height: {
      name: "높이",
      tooltip: "잠재 이미지의 높이(픽셀)입니다."
    },
    width: {
      name: "너비",
      tooltip: "잠재 이미지의 너비(픽셀)입니다."
    }
  },
  outputs: {
    "0": {
      tooltip: "빈 잠재 이미지 배치입니다."
    }
  }
};
const EmptyMochiLatentVideo$2 = {
  display_name: "빈 잠재 비디오 (Mochi)",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    height: {
      name: "높이"
    },
    length: {
      name: "길이"
    },
    width: {
      name: "너비"
    }
  }
};
const EmptySD3LatentImage$2 = {
  display_name: "빈 잠재 이미지 (SD3)",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    height: {
      name: "높이"
    },
    width: {
      name: "너비"
    }
  }
};
const ExponentialScheduler$2 = {
  display_name: "지수 스케줄러",
  inputs: {
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const FeatherMask$2 = {
  display_name: "마스크 가장자리 흐리게",
  inputs: {
    bottom: {
      name: "아래쪽"
    },
    left: {
      name: "왼쪽"
    },
    mask: {
      name: "마스크"
    },
    right: {
      name: "오른쪽"
    },
    top: {
      name: "위쪽"
    }
  }
};
const FlipSigmas$2 = {
  display_name: "시그마 뒤집기",
  inputs: {
    sigmas: {
      name: "시그마"
    }
  }
};
const FluxGuidance$2 = {
  display_name: "FLUX 가이드",
  inputs: {
    conditioning: {
      name: "조건"
    },
    guidance: {
      name: "지침"
    }
  }
};
const FreeU$2 = {
  display_name: "FreeU",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "모델"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const FreeU_V2$2 = {
  display_name: "FreeU V2",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "모델"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const GITSScheduler$2 = {
  display_name: "GITS 스케줄러",
  inputs: {
    coeff: {
      name: "계수"
    },
    denoise: {
      name: "노이즈 제거양"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const GLIGENLoader$2 = {
  display_name: "GLIGEN 로드",
  inputs: {
    gligen_name: {
      name: "gligen 파일명"
    }
  }
};
const GLIGENTextBoxApply$2 = {
  display_name: "GLIGEN 텍스트 박스 적용",
  inputs: {
    clip: {
      name: "clip"
    },
    conditioning_to: {
      name: "조건 대상"
    },
    gligen_textbox_model: {
      name: "gligen 텍스트상자 모델"
    },
    height: {
      name: "높이"
    },
    text: {
      name: "텍스트"
    },
    width: {
      name: "너비"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const GrowMask$2 = {
  display_name: "마스크 확장",
  inputs: {
    expand: {
      name: "확장"
    },
    mask: {
      name: "마스크"
    },
    tapered_corners: {
      name: "마름모 모서리"
    }
  }
};
const HyperTile$2 = {
  display_name: "하이퍼 타일",
  inputs: {
    max_depth: {
      name: "최대 깊이"
    },
    model: {
      name: "모델"
    },
    scale_depth: {
      name: "스케일 깊이"
    },
    swap_size: {
      name: "스왑 크기"
    },
    tile_size: {
      name: "타일 크기"
    }
  }
};
const HypernetworkLoader$2 = {
  display_name: "하이퍼네트워크 로드",
  inputs: {
    hypernetwork_name: {
      name: "하이퍼네트워크 이름"
    },
    model: {
      name: "모델"
    },
    strength: {
      name: "강도"
    }
  }
};
const ImageBatch$2 = {
  display_name: "이미지 배치",
  inputs: {
    image1: {
      name: "이미지1"
    },
    image2: {
      name: "이미지2"
    }
  }
};
const ImageBlend$2 = {
  display_name: "이미지 혼합",
  inputs: {
    blend_factor: {
      name: "혼합 계수"
    },
    blend_mode: {
      name: "혼합 모드"
    },
    image1: {
      name: "이미지1"
    },
    image2: {
      name: "이미지2"
    }
  }
};
const ImageBlur$2 = {
  display_name: "이미지 흐림",
  inputs: {
    blur_radius: {
      name: "블러 반경"
    },
    image: {
      name: "이미지"
    },
    sigma: {
      name: "시그마"
    }
  }
};
const ImageColorToMask$2 = {
  display_name: "이미지 색상을 마스크로 변환",
  inputs: {
    color: {
      name: "색상"
    },
    image: {
      name: "이미지"
    }
  }
};
const ImageCompositeMasked$2 = {
  display_name: "마스크된 이미지 합성",
  inputs: {
    destination: {
      name: "대상"
    },
    mask: {
      name: "마스크"
    },
    resize_source: {
      name: "원본 크기 조정"
    },
    source: {
      name: "원본"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageCrop$2 = {
  display_name: "이미지 자르기",
  inputs: {
    height: {
      name: "높이"
    },
    image: {
      name: "이미지"
    },
    width: {
      name: "너비"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageFromBatch$2 = {
  display_name: "배치에서 이미지 가져오기",
  inputs: {
    batch_index: {
      name: "배치 번호"
    },
    image: {
      name: "이미지"
    },
    length: {
      name: "길이"
    }
  }
};
const ImageInvert$2 = {
  display_name: "이미지 반전",
  inputs: {
    image: {
      name: "이미지"
    }
  }
};
const ImageOnlyCheckpointLoader$2 = {
  display_name: "이미지 전용 체크포인트 로드 (img2vid 모델)",
  inputs: {
    ckpt_name: {
      name: "체크포인트 파일명"
    }
  }
};
const ImageOnlyCheckpointSave$2 = {
  display_name: "이미지 전용 체크포인트 저장",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    filename_prefix: {
      name: "파일명 접두사"
    },
    model: {
      name: "모델"
    },
    vae: {
      name: "vae"
    }
  }
};
const ImagePadForOutpaint$2 = {
  display_name: "아웃페인팅을 위한 이미지 패딩",
  inputs: {
    bottom: {
      name: "아래"
    },
    feathering: {
      name: "가장자리 흐림"
    },
    image: {
      name: "이미지"
    },
    left: {
      name: "왼쪽"
    },
    right: {
      name: "오른쪽"
    },
    top: {
      name: "위"
    }
  }
};
const ImageQuantize$2 = {
  display_name: "이미지 양자화",
  inputs: {
    colors: {
      name: "색상"
    },
    dither: {
      name: "디더링"
    },
    image: {
      name: "이미지"
    }
  }
};
const ImageScale$2 = {
  display_name: "이미지 확대",
  inputs: {
    crop: {
      name: "자르기"
    },
    height: {
      name: "높이"
    },
    image: {
      name: "이미지"
    },
    upscale_method: {
      name: "확대 방법"
    },
    width: {
      name: "너비"
    }
  }
};
const ImageScaleBy$2 = {
  display_name: "이미지 확대 비율",
  inputs: {
    image: {
      name: "이미지"
    },
    scale_by: {
      name: "배율"
    },
    upscale_method: {
      name: "확대 방법"
    }
  }
};
const ImageScaleToTotalPixels$2 = {
  display_name: "총 픽셀 수에 맞춰 이미지 크기 조정",
  inputs: {
    image: {
      name: "이미지"
    },
    megapixels: {
      name: "메가픽셀수"
    },
    upscale_method: {
      name: "확대 방법"
    }
  }
};
const ImageSharpen$2 = {
  display_name: "이미지 선명화",
  inputs: {
    alpha: {
      name: "알파"
    },
    image: {
      name: "이미지"
    },
    sharpen_radius: {
      name: "선명화 반경"
    },
    sigma: {
      name: "시그마"
    }
  }
};
const ImageToMask$2 = {
  display_name: "이미지를 마스크로 변환",
  inputs: {
    channel: {
      name: "채널"
    },
    image: {
      name: "이미지"
    }
  }
};
const ImageUpscaleWithModel$2 = {
  display_name: "모델을 사용한 이미지 확대",
  inputs: {
    image: {
      name: "이미지"
    },
    upscale_model: {
      name: "확대 모델"
    }
  }
};
const InpaintModelConditioning$2 = {
  display_name: "인페인팅 모델 조건 설정",
  inputs: {
    mask: {
      name: "마스크"
    },
    negative: {
      name: "부정 조건"
    },
    noise_mask: {
      name: "노이즈 마스크",
      tooltip: "잠재 데이터에 노이즈 마스크를 추가하여 샘플링이 마스크 내에서만 발생하도록 합니다. 모델에 따라 결과가 개선되거나 완전히 망가질 수 있습니다."
    },
    pixels: {
      name: "픽셀 이미지"
    },
    positive: {
      name: "긍정 조건"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    },
    "2": {
      name: "잠재 데이터"
    }
  }
};
const InstructPixToPixConditioning$2 = {
  display_name: "InstructPixToPix 조건 설정",
  inputs: {
    negative: {
      name: "부정 조건"
    },
    pixels: {
      name: "픽셀"
    },
    positive: {
      name: "긍정 조건"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    },
    "2": {
      name: "잠재 이미지"
    }
  }
};
const InvertMask$2 = {
  display_name: "마스크 반전",
  inputs: {
    mask: {
      name: "마스크"
    }
  }
};
const JoinImageWithAlpha$2 = {
  display_name: "알파와 함께 이미지 결합",
  inputs: {
    alpha: {
      name: "알파"
    },
    image: {
      name: "이미지"
    }
  }
};
const KSampler$2 = {
  description: "제공된 모델, 긍정 및 부정 조건을 사용하여 잠재 데이터를 디노이즈합니다.",
  display_name: "KSampler",
  inputs: {
    cfg: {
      name: "cfg",
      tooltip: "Classifier-Free Guidance 스케일은 창의성과 프롬프트 준수를 균형 있게 조절합니다. 값이 높을수록 프롬프트와 더 밀접하게 일치하는 이미지가 생성되지만, 너무 높은 값은 품질에 부정적인 영향을 미칠 수 있습니다."
    },
    denoise: {
      name: "노이즈_제거",
      tooltip: "적용되는 노이즈 제거의 양으로, 낮은 값은 초기 이미지의 구조를 유지하여 이미지 간 샘플링을 가능하게 합니다."
    },
    latent_image: {
      name: "잠재 데이터",
      tooltip: "노이즈 제거할 잠재 데이터입니다."
    },
    model: {
      name: "모델",
      tooltip: "입력 잠재 데이터의 노이즈 제거에 사용되는 모델입니다."
    },
    negative: {
      name: "부정 조건",
      tooltip: "이미지에서 제외하고 싶은 속성을 설명하는 조건입니다."
    },
    positive: {
      name: "긍정 조건",
      tooltip: "이미지에 포함하고 싶은 속성을 설명하는 조건입니다."
    },
    sampler_name: {
      name: "샘플러 이름",
      tooltip: "샘플링 시 사용되는 알고리즘으로, 생성된 출력의 품질, 속도 및 스타일에 영향을 미칠 수 있습니다."
    },
    scheduler: {
      name: "스케줄러",
      tooltip: "스케줄러는 노이즈가 점진적으로 제거되어 이미지를 형성하는 방식을 제어합니다."
    },
    seed: {
      name: "시드",
      tooltip: "노이즈 생성을 위한 랜덤 시드입니다."
    },
    steps: {
      name: "스텝수",
      tooltip: "노이즈 제거 과정에서 사용되는 단계 수입니다."
    }
  },
  outputs: {
    "0": {
      tooltip: "노이즈가 제거된 잠재 데이터입니다."
    }
  }
};
const KSamplerAdvanced$2 = {
  display_name: "고급 KSampler",
  inputs: {
    add_noise: {
      name: "노이즈 추가"
    },
    cfg: {
      name: "cfg"
    },
    end_at_step: {
      name: "종료 스텝"
    },
    latent_image: {
      name: "잠재 데이터"
    },
    model: {
      name: "모델"
    },
    negative: {
      name: "부정 조건"
    },
    noise_seed: {
      name: "노이즈 시드"
    },
    positive: {
      name: "긍정 조건"
    },
    return_with_leftover_noise: {
      name: "잔여 노이즈 반환"
    },
    sampler_name: {
      name: "샘플러 이름"
    },
    scheduler: {
      name: "스케줄러"
    },
    start_at_step: {
      name: "시작 스텝"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const KSamplerSelect$2 = {
  display_name: "KSampler (선택)",
  inputs: {
    sampler_name: {
      name: "샘플러 이름"
    }
  }
};
const KarrasScheduler$2 = {
  display_name: "Karras 스케줄러",
  inputs: {
    rho: {
      name: "rho"
    },
    sigma_max: {
      name: "최대 시그마"
    },
    sigma_min: {
      name: "최소 시그마"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const LTXVConditioning$2 = {
  display_name: "LTXV 조건 설정",
  inputs: {
    frame_rate: {
      name: "프레임율"
    },
    negative: {
      name: "부정 조건"
    },
    positive: {
      name: "긍정 조건"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const LTXVImgToVideo$2 = {
  display_name: "이미지를 비디오로 (LTXV)",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    height: {
      name: "높이"
    },
    image: {
      name: "이미지"
    },
    image_noise_scale: {
      name: "이미지 노이즈 규모",
      tooltip: "조건 이미지 잠재 비디오에 적용할 노이즈의 양입니다."
    },
    length: {
      name: "길이"
    },
    negative: {
      name: "부정 조건"
    },
    positive: {
      name: "긍정 조건"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "너비"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    },
    "2": {
      name: "잠재 데이터"
    }
  }
};
const LTXVScheduler$2 = {
  display_name: "LTXV 스케줄러",
  inputs: {
    base_shift: {
      name: "기반 시프트"
    },
    latent: {
      name: "잠재 비디오"
    },
    max_shift: {
      name: "최대 시프트"
    },
    steps: {
      name: "스텝수"
    },
    stretch: {
      name: "늘이기",
      tooltip: "시그마를 [종료값, 1] 범위로 늘립니다."
    },
    terminal: {
      name: "종료값",
      tooltip: "늘린 후 시그마의 종료값입니다."
    }
  }
};
const LaplaceScheduler$2 = {
  display_name: "라플라스 스케줄러",
  inputs: {
    beta: {
      name: "beta"
    },
    mu: {
      name: "mu"
    },
    sigma_max: {
      name: "최대 시그마"
    },
    sigma_min: {
      name: "최소 시그마"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const LatentAdd$2 = {
  display_name: "잠재 데이터 연산 (더하기)",
  inputs: {
    samples1: {
      name: "잠재 데이터1"
    },
    samples2: {
      name: "잠재 데이터2"
    }
  }
};
const LatentApplyOperation$2 = {
  display_name: "잠재 데이터 연산 (연산 적용)",
  inputs: {
    operation: {
      name: "연산"
    },
    samples: {
      name: "잠재 데이터"
    }
  }
};
const LatentApplyOperationCFG$2 = {
  display_name: "잠재 데이터 CFG 연산 (연산 적용)",
  inputs: {
    model: {
      name: "모델"
    },
    operation: {
      name: "연산"
    }
  }
};
const LatentBatch$2 = {
  display_name: "잠재 데이터 배치 연결",
  inputs: {
    samples1: {
      name: "잠재 데이터1"
    },
    samples2: {
      name: "잠재 데이터2"
    }
  }
};
const LatentBatchSeedBehavior$2 = {
  display_name: "잠재 데이터 배치 시드 동작",
  inputs: {
    samples: {
      name: "잠재 데이터"
    },
    seed_behavior: {
      name: "시드 동작"
    }
  }
};
const LatentBlend$2 = {
  display_name: "잠재 데이터 연산 (혼합)",
  inputs: {
    blend_factor: {
      name: "혼합 계수"
    },
    samples1: {
      name: "잠재 데이터1"
    },
    samples2: {
      name: "잠재 데이터2"
    }
  }
};
const LatentComposite$2 = {
  display_name: "잠재 데이터 합성 (위치 기반)",
  inputs: {
    feather: {
      name: "가장자리 흐림"
    },
    samples_from: {
      name: "추가 잠재 데이터"
    },
    samples_to: {
      name: "대상 잠재 데이터"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCompositeMasked$2 = {
  display_name: "잠재 데이터 합성 (마스크 기반)",
  inputs: {
    destination: {
      name: "대상"
    },
    mask: {
      name: "마스크"
    },
    resize_source: {
      name: "원본 크기 조정"
    },
    source: {
      name: "원본"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCrop$2 = {
  display_name: "잠재 데이터 자르기",
  inputs: {
    height: {
      name: "높이"
    },
    samples: {
      name: "잠재 데이터"
    },
    width: {
      name: "너비"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentFlip$2 = {
  display_name: "잠재 데이터 연산 (뒤집기)",
  inputs: {
    flip_method: {
      name: "뒤집기 방법"
    },
    samples: {
      name: "잠재 데이터"
    }
  }
};
const LatentFromBatch$2 = {
  display_name: "배치에서 잠재 데이터 가져오기",
  inputs: {
    batch_index: {
      name: "배치_인덱스"
    },
    length: {
      name: "길이"
    },
    samples: {
      name: "샘플"
    }
  }
};
const LatentInterpolate$2 = {
  display_name: "잠재 데이터 연산 (보간)",
  inputs: {
    ratio: {
      name: "비율"
    },
    samples1: {
      name: "잠재 데이터1"
    },
    samples2: {
      name: "잠재 데이터2"
    }
  }
};
const LatentMultiply$2 = {
  display_name: "잠재 데이터 연산 (곱하기)",
  inputs: {
    multiplier: {
      name: "배율"
    },
    samples: {
      name: "잠재 데이터"
    }
  }
};
const LatentOperationSharpen$2 = {
  display_name: "잠재 데이터 연산 (선명화)",
  inputs: {
    alpha: {
      name: "알파"
    },
    sharpen_radius: {
      name: "선명화 반경"
    },
    sigma: {
      name: "시그마"
    }
  }
};
const LatentOperationTonemapReinhard$2 = {
  display_name: "잠재 데이터 연산 (톤맵 레인하르트)",
  inputs: {
    multiplier: {
      name: "배율"
    }
  }
};
const LatentRotate$2 = {
  display_name: "잠재 데이터 연산 (회전)",
  inputs: {
    rotation: {
      name: "회전"
    },
    samples: {
      name: "잠재 데이터"
    }
  }
};
const LatentSubtract$2 = {
  display_name: "잠재 데이터 연산 (빼기)",
  inputs: {
    samples1: {
      name: "잠재 데이터1"
    },
    samples2: {
      name: "잠재 데이터2"
    }
  }
};
const LatentUpscale$2 = {
  display_name: "잠재 데이터 크기 조정",
  inputs: {
    crop: {
      name: "자르기"
    },
    height: {
      name: "높이"
    },
    samples: {
      name: "잠재 데이터"
    },
    upscale_method: {
      name: "업스케일 방법"
    },
    width: {
      name: "너비"
    }
  }
};
const LatentUpscaleBy$2 = {
  display_name: "잠재 데이터 크기 배율 조정",
  inputs: {
    samples: {
      name: "잠재 데이터"
    },
    scale_by: {
      name: "확대율"
    },
    upscale_method: {
      name: "확대 방법"
    }
  }
};
const Load3D$2 = {
  display_name: "3D 로드",
  inputs: {
    bg_color: {
      name: "배경색"
    },
    camera_type: {
      name: "카메라 유형"
    },
    height: {
      name: "높이"
    },
    image: {
      name: "이미지"
    },
    light_intensity: {
      name: "조명 강도"
    },
    material: {
      name: "재질"
    },
    model_file: {
      name: "모델 파일"
    },
    show_grid: {
      name: "그리드 보기"
    },
    up_direction: {
      name: "위 방향"
    },
    view: {
      name: "보기"
    },
    width: {
      name: "너비"
    }
  },
  outputs: {
    "0": {
      name: "이미지"
    },
    "1": {
      name: "마스크"
    },
    "2": {
      name: "메시 경로"
    }
  }
};
const Load3DAnimation$2 = {
  display_name: "3D 로드 - 애니메이션",
  inputs: {
    animation_speed: {
      name: "애니메이션 속도"
    },
    bg_color: {
      name: "배경색"
    },
    camera_type: {
      name: "카메라 유형"
    },
    height: {
      name: "높이"
    },
    image: {
      name: "이미지"
    },
    light_intensity: {
      name: "조명 강도"
    },
    material: {
      name: "재질"
    },
    model_file: {
      name: "모델 파일"
    },
    show_grid: {
      name: "그리드 보기"
    },
    up_direction: {
      name: "위 방향"
    },
    view: {
      name: "보기"
    },
    width: {
      name: "너비"
    }
  },
  outputs: {
    "0": {
      name: "이미지"
    },
    "1": {
      name: "마스크"
    },
    "2": {
      name: "메시 경로"
    }
  }
};
const LoadAudio$2 = {
  display_name: "오디오 로드",
  inputs: {
    audio: {
      name: "오디오"
    }
  }
};
const LoadImage$2 = {
  display_name: "이미지 로드",
  inputs: {
    image: {
      name: "이미지"
    }
  }
};
const LoadImageMask$2 = {
  display_name: "마스크 이미지 로드",
  inputs: {
    channel: {
      name: "채널"
    },
    image: {
      name: "이미지"
    }
  }
};
const LoadLatent$2 = {
  display_name: "잠재 데이터 로드",
  inputs: {
    latent: {
      name: "잠재 데이터"
    }
  }
};
const LoraLoader$2 = {
  description: "LoRA는 확산 모델과 CLIP 모델을 부분적으로 변경해서, 잠재 데이터의 노이즈 제거 방향을 바꿉니다. 여러 LoRA 노드를 연결할 수 있습니다.",
  display_name: "LoRA 로드",
  inputs: {
    clip: {
      name: "clip",
      tooltip: "LoRA가 적용될 CLIP 모델입니다."
    },
    lora_name: {
      name: "LoRA 이름",
      tooltip: "LoRA의 이름입니다."
    },
    model: {
      name: "모델",
      tooltip: "LoRA가 적용될 확산 모델입니다."
    },
    strength_clip: {
      name: "클립 강도",
      tooltip: "CLIP 모델을 적용하는 강도입니다. 이 값은 음수가 될 수 있습니다."
    },
    strength_model: {
      name: "모델 강도",
      tooltip: "확산 모델을 적용하는 강도입니다. 이 값은 음수가 될 수 있습니다."
    }
  },
  outputs: {
    "0": {
      tooltip: "수정된 확산 모델입니다."
    },
    "1": {
      tooltip: "수정된 CLIP 모델입니다."
    }
  }
};
const LoraLoaderModelOnly$2 = {
  description: "LoRA는 확산 모델과 CLIP 모델을 부분적으로 변경해서, 잠재 데이터의 노이즈 제거 방향을 바꿉니다. 여러 LoRA 노드를 연결할 수 있습니다. (이 노드는 CLIP 모델은 로드하지 않습니다.)",
  display_name: "LoRA 로드 (모델 전용)",
  inputs: {
    lora_name: {
      name: "LoRA 이름"
    },
    model: {
      name: "모델"
    },
    strength_model: {
      name: "모델 강도"
    }
  },
  outputs: {
    "0": {
      tooltip: "수정된 확산 모델입니다."
    }
  }
};
const LoraSave$2 = {
  display_name: "LoRA 추출 및 저장",
  inputs: {
    bias_diff: {
      name: "차이 편향"
    },
    filename_prefix: {
      name: "파일명 접두사"
    },
    lora_type: {
      name: "LoRA 유형"
    },
    model_diff: {
      name: "모델 차이",
      tooltip: "LoRA로 변환 될 ModelSubtract 출력입니다."
    },
    rank: {
      name: "순위"
    },
    text_encoder_diff: {
      name: "텍스트 인코더 차이",
      tooltip: "LoRA로 변환 될 CLIPSubtract 출력입니다."
    }
  }
};
const Mahiro$2 = {
  description: "노이즈 제거의 '방향'을 긍정 조건과 부정 조건 차에 의한 것 보다는 긍정 조건 방향으로 더 크게 작동하도록 가이더 동작을 변경합니다.",
  display_name: "마히로",
  inputs: {
    model: {
      name: "모델"
    }
  },
  outputs: {
    "0": {
      name: "변경된 모델"
    }
  }
};
const MaskComposite$2 = {
  display_name: "마스크 합성",
  inputs: {
    destination: {
      name: "대상"
    },
    operation: {
      name: "연산"
    },
    source: {
      name: "원본"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const MaskToImage$2 = {
  display_name: "마스크를 이미지로 변환",
  inputs: {
    mask: {
      name: "마스크"
    }
  }
};
const ModelMergeAdd$2 = {
  display_name: "모델 병합 (더하기)",
  inputs: {
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    }
  }
};
const ModelMergeAuraflow$2 = {
  display_name: "모델 병합 (AuraFlow)",
  inputs: {
    cond_seq_linear_: {
      name: "cond_seq_linear."
    },
    double_layers_0_: {
      name: "double_layers.0."
    },
    double_layers_1_: {
      name: "double_layers.1."
    },
    double_layers_2_: {
      name: "double_layers.2."
    },
    double_layers_3_: {
      name: "double_layers.3."
    },
    final_linear_: {
      name: "final_linear."
    },
    init_x_linear_: {
      name: "init_x_linear."
    },
    modF_: {
      name: "modF."
    },
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    positional_encoding: {
      name: "positional_encoding"
    },
    register_tokens: {
      name: "register_tokens"
    },
    single_layers_0_: {
      name: "single_layers.0."
    },
    single_layers_10_: {
      name: "single_layers.10."
    },
    single_layers_11_: {
      name: "single_layers.11."
    },
    single_layers_12_: {
      name: "single_layers.12."
    },
    single_layers_13_: {
      name: "single_layers.13."
    },
    single_layers_14_: {
      name: "single_layers.14."
    },
    single_layers_15_: {
      name: "single_layers.15."
    },
    single_layers_16_: {
      name: "single_layers.16."
    },
    single_layers_17_: {
      name: "single_layers.17."
    },
    single_layers_18_: {
      name: "single_layers.18."
    },
    single_layers_19_: {
      name: "single_layers.19."
    },
    single_layers_1_: {
      name: "single_layers.1."
    },
    single_layers_20_: {
      name: "single_layers.20."
    },
    single_layers_21_: {
      name: "single_layers.21."
    },
    single_layers_22_: {
      name: "single_layers.22."
    },
    single_layers_23_: {
      name: "single_layers.23."
    },
    single_layers_24_: {
      name: "single_layers.24."
    },
    single_layers_25_: {
      name: "single_layers.25."
    },
    single_layers_26_: {
      name: "single_layers.26."
    },
    single_layers_27_: {
      name: "single_layers.27."
    },
    single_layers_28_: {
      name: "single_layers.28."
    },
    single_layers_29_: {
      name: "single_layers.29."
    },
    single_layers_2_: {
      name: "single_layers.2."
    },
    single_layers_30_: {
      name: "single_layers.30."
    },
    single_layers_31_: {
      name: "single_layers.31."
    },
    single_layers_3_: {
      name: "single_layers.3."
    },
    single_layers_4_: {
      name: "single_layers.4."
    },
    single_layers_5_: {
      name: "single_layers.5."
    },
    single_layers_6_: {
      name: "single_layers.6."
    },
    single_layers_7_: {
      name: "single_layers.7."
    },
    single_layers_8_: {
      name: "single_layers.8."
    },
    single_layers_9_: {
      name: "single_layers.9."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeBlocks$2 = {
  display_name: "모델 병합 (블록)",
  inputs: {
    input: {
      name: "input"
    },
    middle: {
      name: "middle"
    },
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    out: {
      name: "out"
    }
  }
};
const ModelMergeFlux1$2 = {
  display_name: "모델 병합 (FLUX.1)",
  inputs: {
    double_blocks_0_: {
      name: "double_blocks.0."
    },
    double_blocks_10_: {
      name: "double_blocks.10."
    },
    double_blocks_11_: {
      name: "double_blocks.11."
    },
    double_blocks_12_: {
      name: "double_blocks.12."
    },
    double_blocks_13_: {
      name: "double_blocks.13."
    },
    double_blocks_14_: {
      name: "double_blocks.14."
    },
    double_blocks_15_: {
      name: "double_blocks.15."
    },
    double_blocks_16_: {
      name: "double_blocks.16."
    },
    double_blocks_17_: {
      name: "double_blocks.17."
    },
    double_blocks_18_: {
      name: "double_blocks.18."
    },
    double_blocks_1_: {
      name: "double_blocks.1."
    },
    double_blocks_2_: {
      name: "double_blocks.2."
    },
    double_blocks_3_: {
      name: "double_blocks.3."
    },
    double_blocks_4_: {
      name: "double_blocks.4."
    },
    double_blocks_5_: {
      name: "double_blocks.5."
    },
    double_blocks_6_: {
      name: "double_blocks.6."
    },
    double_blocks_7_: {
      name: "double_blocks.7."
    },
    double_blocks_8_: {
      name: "double_blocks.8."
    },
    double_blocks_9_: {
      name: "double_blocks.9."
    },
    final_layer_: {
      name: "final_layer."
    },
    guidance_in: {
      name: "guidance_in"
    },
    img_in_: {
      name: "img_in."
    },
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    single_blocks_0_: {
      name: "single_blocks.0."
    },
    single_blocks_10_: {
      name: "single_blocks.10."
    },
    single_blocks_11_: {
      name: "single_blocks.11."
    },
    single_blocks_12_: {
      name: "single_blocks.12."
    },
    single_blocks_13_: {
      name: "single_blocks.13."
    },
    single_blocks_14_: {
      name: "single_blocks.14."
    },
    single_blocks_15_: {
      name: "single_blocks.15."
    },
    single_blocks_16_: {
      name: "single_blocks.16."
    },
    single_blocks_17_: {
      name: "single_blocks.17."
    },
    single_blocks_18_: {
      name: "single_blocks.18."
    },
    single_blocks_19_: {
      name: "single_blocks.19."
    },
    single_blocks_1_: {
      name: "single_blocks.1."
    },
    single_blocks_20_: {
      name: "single_blocks.20."
    },
    single_blocks_21_: {
      name: "single_blocks.21."
    },
    single_blocks_22_: {
      name: "single_blocks.22."
    },
    single_blocks_23_: {
      name: "single_blocks.23."
    },
    single_blocks_24_: {
      name: "single_blocks.24."
    },
    single_blocks_25_: {
      name: "single_blocks.25."
    },
    single_blocks_26_: {
      name: "single_blocks.26."
    },
    single_blocks_27_: {
      name: "single_blocks.27."
    },
    single_blocks_28_: {
      name: "single_blocks.28."
    },
    single_blocks_29_: {
      name: "single_blocks.29."
    },
    single_blocks_2_: {
      name: "single_blocks.2."
    },
    single_blocks_30_: {
      name: "single_blocks.30."
    },
    single_blocks_31_: {
      name: "single_blocks.31."
    },
    single_blocks_32_: {
      name: "single_blocks.32."
    },
    single_blocks_33_: {
      name: "single_blocks.33."
    },
    single_blocks_34_: {
      name: "single_blocks.34."
    },
    single_blocks_35_: {
      name: "single_blocks.35."
    },
    single_blocks_36_: {
      name: "single_blocks.36."
    },
    single_blocks_37_: {
      name: "single_blocks.37."
    },
    single_blocks_3_: {
      name: "single_blocks.3."
    },
    single_blocks_4_: {
      name: "single_blocks.4."
    },
    single_blocks_5_: {
      name: "single_blocks.5."
    },
    single_blocks_6_: {
      name: "single_blocks.6."
    },
    single_blocks_7_: {
      name: "single_blocks.7."
    },
    single_blocks_8_: {
      name: "single_blocks.8."
    },
    single_blocks_9_: {
      name: "single_blocks.9."
    },
    time_in_: {
      name: "time_in."
    },
    txt_in_: {
      name: "txt_in."
    },
    vector_in_: {
      name: "vector_in."
    }
  }
};
const ModelMergeLTXV$2 = {
  display_name: "모델 병합 (LTXV)",
  inputs: {
    adaln_single_: {
      name: "adaln_single."
    },
    caption_projection_: {
      name: "caption_projection."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    patchify_proj_: {
      name: "patchify_proj."
    },
    proj_out_: {
      name: "proj_out."
    },
    scale_shift_table: {
      name: "scale_shift_table"
    },
    transformer_blocks_0_: {
      name: "transformer_blocks.0."
    },
    transformer_blocks_10_: {
      name: "transformer_blocks.10."
    },
    transformer_blocks_11_: {
      name: "transformer_blocks.11."
    },
    transformer_blocks_12_: {
      name: "transformer_blocks.12."
    },
    transformer_blocks_13_: {
      name: "transformer_blocks.13."
    },
    transformer_blocks_14_: {
      name: "transformer_blocks.14."
    },
    transformer_blocks_15_: {
      name: "transformer_blocks.15."
    },
    transformer_blocks_16_: {
      name: "transformer_blocks.16."
    },
    transformer_blocks_17_: {
      name: "transformer_blocks.17."
    },
    transformer_blocks_18_: {
      name: "transformer_blocks.18."
    },
    transformer_blocks_19_: {
      name: "transformer_blocks.19."
    },
    transformer_blocks_1_: {
      name: "transformer_blocks.1."
    },
    transformer_blocks_20_: {
      name: "transformer_blocks.20."
    },
    transformer_blocks_21_: {
      name: "transformer_blocks.21."
    },
    transformer_blocks_22_: {
      name: "transformer_blocks.22."
    },
    transformer_blocks_23_: {
      name: "transformer_blocks.23."
    },
    transformer_blocks_24_: {
      name: "transformer_blocks.24."
    },
    transformer_blocks_25_: {
      name: "transformer_blocks.25."
    },
    transformer_blocks_26_: {
      name: "transformer_blocks.26."
    },
    transformer_blocks_27_: {
      name: "transformer_blocks.27."
    },
    transformer_blocks_2_: {
      name: "transformer_blocks.2."
    },
    transformer_blocks_3_: {
      name: "transformer_blocks.3."
    },
    transformer_blocks_4_: {
      name: "transformer_blocks.4."
    },
    transformer_blocks_5_: {
      name: "transformer_blocks.5."
    },
    transformer_blocks_6_: {
      name: "transformer_blocks.6."
    },
    transformer_blocks_7_: {
      name: "transformer_blocks.7."
    },
    transformer_blocks_8_: {
      name: "transformer_blocks.8."
    },
    transformer_blocks_9_: {
      name: "transformer_blocks.9."
    }
  }
};
const ModelMergeMochiPreview$2 = {
  display_name: "모델 병합 (Mochi Preview)",
  inputs: {
    blocks_0_: {
      name: "blocks.0."
    },
    blocks_10_: {
      name: "blocks.10."
    },
    blocks_11_: {
      name: "blocks.11."
    },
    blocks_12_: {
      name: "blocks.12."
    },
    blocks_13_: {
      name: "blocks.13."
    },
    blocks_14_: {
      name: "blocks.14."
    },
    blocks_15_: {
      name: "blocks.15."
    },
    blocks_16_: {
      name: "blocks.16."
    },
    blocks_17_: {
      name: "blocks.17."
    },
    blocks_18_: {
      name: "blocks.18."
    },
    blocks_19_: {
      name: "blocks.19."
    },
    blocks_1_: {
      name: "blocks.1."
    },
    blocks_20_: {
      name: "blocks.20."
    },
    blocks_21_: {
      name: "blocks.21."
    },
    blocks_22_: {
      name: "blocks.22."
    },
    blocks_23_: {
      name: "blocks.23."
    },
    blocks_24_: {
      name: "blocks.24."
    },
    blocks_25_: {
      name: "blocks.25."
    },
    blocks_26_: {
      name: "blocks.26."
    },
    blocks_27_: {
      name: "blocks.27."
    },
    blocks_28_: {
      name: "blocks.28."
    },
    blocks_29_: {
      name: "blocks.29."
    },
    blocks_2_: {
      name: "blocks.2."
    },
    blocks_30_: {
      name: "blocks.30."
    },
    blocks_31_: {
      name: "blocks.31."
    },
    blocks_32_: {
      name: "blocks.32."
    },
    blocks_33_: {
      name: "blocks.33."
    },
    blocks_34_: {
      name: "blocks.34."
    },
    blocks_35_: {
      name: "blocks.35."
    },
    blocks_36_: {
      name: "blocks.36."
    },
    blocks_37_: {
      name: "blocks.37."
    },
    blocks_38_: {
      name: "blocks.38."
    },
    blocks_39_: {
      name: "blocks.39."
    },
    blocks_3_: {
      name: "blocks.3."
    },
    blocks_40_: {
      name: "blocks.40."
    },
    blocks_41_: {
      name: "blocks.41."
    },
    blocks_42_: {
      name: "blocks.42."
    },
    blocks_43_: {
      name: "blocks.43."
    },
    blocks_44_: {
      name: "blocks.44."
    },
    blocks_45_: {
      name: "blocks.45."
    },
    blocks_46_: {
      name: "blocks.46."
    },
    blocks_47_: {
      name: "blocks.47."
    },
    blocks_4_: {
      name: "blocks.4."
    },
    blocks_5_: {
      name: "blocks.5."
    },
    blocks_6_: {
      name: "blocks.6."
    },
    blocks_7_: {
      name: "blocks.7."
    },
    blocks_8_: {
      name: "blocks.8."
    },
    blocks_9_: {
      name: "blocks.9."
    },
    final_layer_: {
      name: "final_layer."
    },
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    pos_frequencies_: {
      name: "pos_frequencies."
    },
    t5_y_embedder_: {
      name: "t5_y_embedder."
    },
    t5_yproj_: {
      name: "t5_yproj."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeSD1$2 = {
  display_name: "모델 병합 (SD1)",
  inputs: {
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0_: {
      name: "middle_blocks.0."
    },
    middle_block_1_: {
      name: "middle_blocks.1."
    },
    middle_block_2_: {
      name: "middle_blocks.2."
    },
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0_: {
      name: "out_blocks.0."
    },
    output_blocks_10_: {
      name: "out_blocks.10."
    },
    output_blocks_11_: {
      name: "out_blocks.11."
    },
    output_blocks_1_: {
      name: "out_blocks.1."
    },
    output_blocks_2_: {
      name: "out_blocks.2."
    },
    output_blocks_3_: {
      name: "out_blocks.3."
    },
    output_blocks_4_: {
      name: "out_blocks.4."
    },
    output_blocks_5_: {
      name: "out_blocks.5."
    },
    output_blocks_6_: {
      name: "out_blocks.6."
    },
    output_blocks_7_: {
      name: "out_blocks.7."
    },
    output_blocks_8_: {
      name: "out_blocks.8."
    },
    output_blocks_9_: {
      name: "out_blocks.9."
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSD2$2 = {
  display_name: "모델 병합 (SD2)",
  inputs: {
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0_: {
      name: "middle_blocks.0."
    },
    middle_block_1_: {
      name: "middle_blocks.1."
    },
    middle_block_2_: {
      name: "middle_blocks.2."
    },
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0_: {
      name: "out_blocks.0."
    },
    output_blocks_10_: {
      name: "out_blocks.10."
    },
    output_blocks_11_: {
      name: "out_blocks.11."
    },
    output_blocks_1_: {
      name: "out_blocks.1."
    },
    output_blocks_2_: {
      name: "out_blocks.2."
    },
    output_blocks_3_: {
      name: "out_blocks.3."
    },
    output_blocks_4_: {
      name: "out_blocks.4."
    },
    output_blocks_5_: {
      name: "out_blocks.5."
    },
    output_blocks_6_: {
      name: "out_blocks.6."
    },
    output_blocks_7_: {
      name: "out_blocks.7."
    },
    output_blocks_8_: {
      name: "out_blocks.8."
    },
    output_blocks_9_: {
      name: "out_blocks.9."
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSD35_Large$2 = {
  display_name: "모델 병합 (SD35 Large)",
  inputs: {
    context_embedder_: {
      name: "context_embedder."
    },
    final_layer_: {
      name: "final_layer."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_24_: {
      name: "joint_blocks.24."
    },
    joint_blocks_25_: {
      name: "joint_blocks.25."
    },
    joint_blocks_26_: {
      name: "joint_blocks.26."
    },
    joint_blocks_27_: {
      name: "joint_blocks.27."
    },
    joint_blocks_28_: {
      name: "joint_blocks.28."
    },
    joint_blocks_29_: {
      name: "joint_blocks.29."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_30_: {
      name: "joint_blocks.30."
    },
    joint_blocks_31_: {
      name: "joint_blocks.31."
    },
    joint_blocks_32_: {
      name: "joint_blocks.32."
    },
    joint_blocks_33_: {
      name: "joint_blocks.33."
    },
    joint_blocks_34_: {
      name: "joint_blocks.34."
    },
    joint_blocks_35_: {
      name: "joint_blocks.35."
    },
    joint_blocks_36_: {
      name: "joint_blocks.36."
    },
    joint_blocks_37_: {
      name: "joint_blocks.37."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    }
  }
};
const ModelMergeSD3_2B$2 = {
  display_name: "모델 병합 (SD3 2B)",
  inputs: {
    context_embedder_: {
      name: "context_embedder."
    },
    final_layer_: {
      name: "final_layer."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    }
  }
};
const ModelMergeSDXL$2 = {
  display_name: "모델 병합 (SDXL)",
  inputs: {
    input_blocks_0: {
      name: "input_blocks.0"
    },
    input_blocks_1: {
      name: "input_blocks.1"
    },
    input_blocks_2: {
      name: "input_blocks.2"
    },
    input_blocks_3: {
      name: "input_blocks.3"
    },
    input_blocks_4: {
      name: "input_blocks.4"
    },
    input_blocks_5: {
      name: "input_blocks.5"
    },
    input_blocks_6: {
      name: "input_blocks.6"
    },
    input_blocks_7: {
      name: "input_blocks.7"
    },
    input_blocks_8: {
      name: "input_blocks.8"
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0: {
      name: "middle_block.0"
    },
    middle_block_1: {
      name: "middle_block.1"
    },
    middle_block_2: {
      name: "middle_block.2"
    },
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0: {
      name: "output_blocks.0"
    },
    output_blocks_1: {
      name: "output_blocks.1"
    },
    output_blocks_2: {
      name: "output_blocks.2"
    },
    output_blocks_3: {
      name: "output_blocks.3"
    },
    output_blocks_4: {
      name: "output_blocks.4"
    },
    output_blocks_5: {
      name: "output_blocks.5"
    },
    output_blocks_6: {
      name: "output_blocks.6"
    },
    output_blocks_7: {
      name: "output_blocks.7"
    },
    output_blocks_8: {
      name: "output_blocks.8"
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSimple$2 = {
  display_name: "모델 병합 (단순)",
  inputs: {
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    ratio: {
      name: "비율"
    }
  }
};
const ModelMergeSubtract$2 = {
  display_name: "모델 병합 (빼기)",
  inputs: {
    model1: {
      name: "모델1"
    },
    model2: {
      name: "모델2"
    },
    multiplier: {
      name: "배율"
    }
  }
};
const ModelSamplingAuraFlow$2 = {
  display_name: "모델 샘플링 (AuraFlow)",
  inputs: {
    model: {
      name: "모델"
    },
    shift: {
      name: "시프트"
    }
  }
};
const ModelSamplingContinuousEDM$2 = {
  display_name: "모델 샘플링 (연속 EDM)",
  inputs: {
    model: {
      name: "모델"
    },
    sampling: {
      name: "샘플링"
    },
    sigma_max: {
      name: "최대 시그마"
    },
    sigma_min: {
      name: "최소 시그마"
    }
  }
};
const ModelSamplingContinuousV$2 = {
  display_name: "모델 샘플링 (연속 V)",
  inputs: {
    model: {
      name: "모델"
    },
    sampling: {
      name: "샘플링"
    },
    sigma_max: {
      name: "최대 시그마"
    },
    sigma_min: {
      name: "최소 시그마"
    }
  }
};
const ModelSamplingDiscrete$2 = {
  display_name: "모델 샘플링 (이산)",
  inputs: {
    model: {
      name: "모델"
    },
    sampling: {
      name: "샘플링"
    },
    zsnr: {
      name: "zsnr"
    }
  }
};
const ModelSamplingFlux$2 = {
  display_name: "모델 샘플링 (FLUX)",
  inputs: {
    base_shift: {
      name: "기본_시프트"
    },
    height: {
      name: "높이"
    },
    max_shift: {
      name: "최대 시프트"
    },
    model: {
      name: "모델"
    },
    width: {
      name: "너비"
    }
  }
};
const ModelSamplingLTXV$2 = {
  display_name: "모델 샘플링 (LTXV)",
  inputs: {
    base_shift: {
      name: "기반 시프트"
    },
    latent: {
      name: "잠재 비디오"
    },
    max_shift: {
      name: "최대 시프트"
    },
    model: {
      name: "모델"
    }
  }
};
const ModelSamplingSD3$2 = {
  display_name: "모델 샘플링 (SD3)",
  inputs: {
    model: {
      name: "모델"
    },
    shift: {
      name: "시프트"
    }
  }
};
const ModelSamplingStableCascade$2 = {
  display_name: "모델 샘플링 (StableCascade)",
  inputs: {
    model: {
      name: "모델"
    },
    shift: {
      name: "시프트"
    }
  }
};
const ModelSave$2 = {
  display_name: "모델 저장",
  inputs: {
    filename_prefix: {
      name: "파일명 접두사"
    },
    model: {
      name: "모델"
    }
  }
};
const Morphology$2 = {
  display_name: "이미지 형태 변환",
  inputs: {
    image: {
      name: "이미지"
    },
    kernel_size: {
      name: "커널 크기"
    },
    operation: {
      name: "연산"
    }
  }
};
const PairConditioningCombine$2 = {
  display_name: "조건 쌍 (결합)",
  inputs: {
    negative_A: {
      name: "부정 조건 A"
    },
    negative_B: {
      name: "부정 조건 B"
    },
    positive_A: {
      name: "긍정 조건 A"
    },
    positive_B: {
      name: "긍정 조건 B"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const PairConditioningSetDefaultCombine$2 = {
  display_name: "조건 쌍 (기본 결합 설정)",
  inputs: {
    hooks: {
      name: "후크"
    },
    negative: {
      name: "부정 조건"
    },
    negative_DEFAULT: {
      name: "기본 부정 조건"
    },
    positive: {
      name: "긍정 조건"
    },
    positive_DEFAULT: {
      name: "기본 긍정 조건"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const PairConditioningSetProperties$2 = {
  display_name: "조건 쌍 (속성 설정)",
  inputs: {
    hooks: {
      name: "후크"
    },
    mask: {
      name: "마스크"
    },
    negative_NEW: {
      name: "새 부정 조건"
    },
    positive_NEW: {
      name: "새 긍정 조건"
    },
    set_cond_area: {
      name: "조건 영역 설정"
    },
    strength: {
      name: "강도"
    },
    timesteps: {
      name: "타임스텝 범위"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const PairConditioningSetPropertiesAndCombine$2 = {
  display_name: "조건 쌍 (속성 설정 및 결합)",
  inputs: {
    hooks: {
      name: "후크"
    },
    mask: {
      name: "마스크"
    },
    negative: {
      name: "부정 조건"
    },
    negative_NEW: {
      name: "새 부정 조건"
    },
    positive: {
      name: "긍정 조건"
    },
    positive_NEW: {
      name: "새 긍정 조건"
    },
    set_cond_area: {
      name: "조건 영역 설정"
    },
    strength: {
      name: "강도"
    },
    timesteps: {
      name: "타임스텝 범위"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    }
  }
};
const PatchModelAddDownscale$2 = {
  display_name: "다운스케일 추가 모델 패치 (Kohya Deep Shrink)",
  inputs: {
    block_number: {
      name: "블록 번호"
    },
    downscale_after_skip: {
      name: "스킵 후 다운스케일"
    },
    downscale_factor: {
      name: "다운스케일 배율"
    },
    downscale_method: {
      name: "다운스케일 방법"
    },
    end_percent: {
      name: "종료 퍼센트"
    },
    model: {
      name: "모델"
    },
    start_percent: {
      name: "시작 퍼센트"
    },
    upscale_method: {
      name: "업스케일 방법"
    }
  }
};
const PerpNeg$2 = {
  display_name: "Perp-Neg (PerpNegGuider에 의해 지원 중단됨)",
  inputs: {
    empty_conditioning: {
      name: "빈 조건"
    },
    model: {
      name: "모델"
    },
    neg_scale: {
      name: "부정 스케일"
    }
  }
};
const PerpNegGuider$2 = {
  display_name: "PerpNeg 가이드",
  inputs: {
    cfg: {
      name: "cfg"
    },
    empty_conditioning: {
      name: "빈 조건"
    },
    model: {
      name: "모델"
    },
    neg_scale: {
      name: "부정 스케일"
    },
    negative: {
      name: "부정 조건"
    },
    positive: {
      name: "긍정 조건"
    }
  }
};
const PerturbedAttentionGuidance$2 = {
  display_name: "교란 어텐션 유도 (PAG)",
  inputs: {
    model: {
      name: "모델"
    },
    scale: {
      name: "스케일"
    }
  }
};
const PhotoMakerEncode$2 = {
  display_name: "포토메이커 인코딩",
  inputs: {
    clip: {
      name: "clip"
    },
    image: {
      name: "이미지"
    },
    photomaker: {
      name: "포토메이커 모델"
    },
    text: {
      name: "텍스트"
    }
  }
};
const PhotoMakerLoader$2 = {
  display_name: "포토메이커 로드",
  inputs: {
    photomaker_model_name: {
      name: "포토메이커 파일명"
    }
  }
};
const PolyexponentialScheduler$2 = {
  display_name: "다항 지수 스케줄러",
  inputs: {
    rho: {
      name: "rho"
    },
    sigma_max: {
      name: "최대 시그마"
    },
    sigma_min: {
      name: "최소 시그마"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const PorterDuffImageComposite$2 = {
  display_name: "포터-더프 이미지 합성",
  inputs: {
    destination: {
      name: "대상"
    },
    destination_alpha: {
      name: "대상 알파"
    },
    mode: {
      name: "모드"
    },
    source: {
      name: "원본"
    },
    source_alpha: {
      name: "원본 알파"
    }
  }
};
const Preview3D$2 = {
  display_name: "3D 미리보기",
  inputs: {
    bg_color: {
      name: "배경색"
    },
    camera_type: {
      name: "카메라 유형"
    },
    light_intensity: {
      name: "조명 강도"
    },
    material: {
      name: "재질"
    },
    model_file: {
      name: "모델 파일"
    },
    show_grid: {
      name: "그리드 표시"
    },
    up_direction: {
      name: "위 방향"
    },
    view: {
      name: "뷰"
    }
  }
};
const PreviewAudio$2 = {
  display_name: "오디오 미리듣기",
  inputs: {
    audio: {
      name: "오디오"
    }
  }
};
const PreviewImage$2 = {
  description: "입력 이미지를 ComfyUI 의 임시(temp) 폴더에 저장합니다.",
  display_name: "이미지 미리보기",
  inputs: {
    images: {
      name: "이미지"
    }
  }
};
const RandomNoise$2 = {
  display_name: "무작위 노이즈",
  inputs: {
    noise_seed: {
      name: "노이즈 시드"
    }
  }
};
const RebatchImages$2 = {
  display_name: "이미지 배치 재배치",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    images: {
      name: "이미지"
    }
  }
};
const RebatchLatents$2 = {
  display_name: "잠재 데이터 배치 재배치",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    latents: {
      name: "잠재 데이터"
    }
  }
};
const RepeatImageBatch$2 = {
  display_name: "이미지 반복 배치 생성",
  inputs: {
    amount: {
      name: "개수"
    },
    image: {
      name: "이미지"
    }
  }
};
const RepeatLatentBatch$2 = {
  display_name: "잠재 데이터 반복 배치 생성",
  inputs: {
    amount: {
      name: "개수"
    },
    samples: {
      name: "잠재 데이터"
    }
  }
};
const RescaleCFG$2 = {
  display_name: "CFG 크기 재조정",
  inputs: {
    model: {
      name: "모델"
    },
    multiplier: {
      name: "배율"
    }
  }
};
const SDTurboScheduler$2 = {
  display_name: "SD-Turbo 스케줄러",
  inputs: {
    denoise: {
      name: "노이즈 제거양"
    },
    model: {
      name: "모델"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const SD_4XUpscale_Conditioning$2 = {
  display_name: "SD_4X 확대 조건 설정",
  inputs: {
    images: {
      name: "이미지"
    },
    negative: {
      name: "부정 조건"
    },
    noise_augmentation: {
      name: "노이즈 증강"
    },
    positive: {
      name: "긍정 조건"
    },
    scale_ratio: {
      name: "확대율"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    },
    "2": {
      name: "잠재 이미지"
    }
  }
};
const SV3D_Conditioning$2 = {
  display_name: "SV3D 조건 설정",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "고도"
    },
    height: {
      name: "높이"
    },
    init_image: {
      name: "초기 이미지"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "비디오 프레임"
    },
    width: {
      name: "너비"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    },
    "2": {
      name: "잠재 데이터"
    }
  }
};
const SVD_img2vid_Conditioning$2 = {
  display_name: "이미지를 비디오로 조건 설정 (SVD)",
  inputs: {
    augmentation_level: {
      name: "증강 레벨"
    },
    clip_vision: {
      name: "clip_vision"
    },
    fps: {
      name: "fps"
    },
    height: {
      name: "높이"
    },
    init_image: {
      name: "초기 이미지"
    },
    motion_bucket_id: {
      name: "모션 버킷 ID"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "비디오 프레임"
    },
    width: {
      name: "너비"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    },
    "2": {
      name: "잠재 비디오"
    }
  }
};
const SamplerCustom$2 = {
  display_name: "사용자 정의 샘플러",
  inputs: {
    add_noise: {
      name: "노이즈 추가"
    },
    cfg: {
      name: "cfg"
    },
    latent_image: {
      name: "잠재 데이터"
    },
    model: {
      name: "모델"
    },
    negative: {
      name: "부정 조건"
    },
    noise_seed: {
      name: "노이즈 시드"
    },
    positive: {
      name: "긍정 조건"
    },
    sampler: {
      name: "샘플러"
    },
    sigmas: {
      name: "시그마"
    }
  },
  outputs: {
    "0": {
      name: "출력"
    },
    "1": {
      name: "노이즈 제거된 출력"
    }
  }
};
const SamplerCustomAdvanced$2 = {
  display_name: "고급 사용자 정의 샘플러",
  inputs: {
    guider: {
      name: "가이더"
    },
    latent_image: {
      name: "잠재 데이터"
    },
    noise: {
      name: "노이즈"
    },
    sampler: {
      name: "샘플러"
    },
    sigmas: {
      name: "시그마"
    }
  },
  outputs: {
    "0": {
      name: "출력"
    },
    "1": {
      name: "노이즈 제거된 출력"
    }
  }
};
const SamplerDPMAdaptative$2 = {
  display_name: "DPMAdaptive 샘플러",
  inputs: {
    accept_safety: {
      name: "accept_safety"
    },
    atol: {
      name: "atol"
    },
    dcoeff: {
      name: "dcoeff"
    },
    eta: {
      name: "eta"
    },
    h_init: {
      name: "초기 h"
    },
    icoeff: {
      name: "icoeff"
    },
    order: {
      name: "order"
    },
    pcoeff: {
      name: "pcoeff"
    },
    rtol: {
      name: "rtol"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_2M_SDE$2 = {
  display_name: "DPMPP_2M_SDE 샘플러러",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "노이즈 생성 장치"
    },
    s_noise: {
      name: "s_noise"
    },
    solver_type: {
      name: "Solver 유형"
    }
  }
};
const SamplerDPMPP_2S_Ancestral$2 = {
  display_name: "DPMPP_2S_Ancestral 샘플러",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_3M_SDE$2 = {
  display_name: "DPMPP_3M_SDE 샘플러",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "노이즈 생성 장치"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_SDE$2 = {
  display_name: "DPMPP_SDE 샘플러",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "노이즈 생성 장치"
    },
    r: {
      name: "r"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerAncestral$2 = {
  display_name: "Eluer Ancestral 샘플러",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerAncestralCFGPP$2 = {
  display_name: "Eluer Acnestral CFG++ 샘플러",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerCFGpp$2 = {
  display_name: "Eluer CFG++ 샘플러",
  inputs: {
    version: {
      name: "버전"
    }
  }
};
const SamplerLCMUpscale$2 = {
  display_name: "LCM 확대 샘플러",
  inputs: {
    scale_ratio: {
      name: "확대율"
    },
    scale_steps: {
      name: "스텝수"
    },
    upscale_method: {
      name: "업스케일 방법"
    }
  }
};
const SamplerLMS$2 = {
  display_name: "LMS 샘플러",
  inputs: {
    order: {
      name: "순서"
    }
  }
};
const SaveAnimatedPNG$2 = {
  display_name: "애니메이션 PNG 저장",
  inputs: {
    compress_level: {
      name: "압축 레벨"
    },
    filename_prefix: {
      name: "파일명 접두사"
    },
    fps: {
      name: "fps"
    },
    images: {
      name: "이미지"
    }
  }
};
const SaveAnimatedWEBP$2 = {
  display_name: "애니메이션 WEBP 저장",
  inputs: {
    filename_prefix: {
      name: "파일명 접두사"
    },
    fps: {
      name: "fps"
    },
    images: {
      name: "이미지"
    },
    lossless: {
      name: "무손실"
    },
    method: {
      name: "방법"
    },
    quality: {
      name: "품질"
    }
  }
};
const SaveAudio$2 = {
  display_name: "오디오 저장",
  inputs: {
    audio: {
      name: "오디오"
    },
    filename_prefix: {
      name: "파일명 접두사"
    }
  }
};
const SaveImage$2 = {
  description: "입력 이미지를 ComfyUI 출력 디렉토리에 저장합니다.",
  display_name: "이미지 저장",
  inputs: {
    filename_prefix: {
      name: "파일명 접두사",
      tooltip: "저장할 파일의 접두사입니다. 여기에는 %date:yyyy-MM-dd% 또는 %Empty Latent Image.width%와 같은 형식 정보가 포함되어 노드의 값을 포함할 수 있습니다."
    },
    images: {
      name: "이미지",
      tooltip: "저장할 이미지입니다."
    }
  }
};
const SaveImageWebsocket$2 = {
  display_name: "이미지 웹소켓 전송",
  inputs: {
    images: {
      name: "이미지"
    }
  }
};
const SaveLatent$2 = {
  display_name: "잠재 데이터 저장",
  inputs: {
    filename_prefix: {
      name: "파일명 접두사"
    },
    samples: {
      name: "잠재 데이터"
    }
  }
};
const SelfAttentionGuidance$2 = {
  display_name: "셀프 어텐션 가이드",
  inputs: {
    blur_sigma: {
      name: "블러 시그마"
    },
    model: {
      name: "모델"
    },
    scale: {
      name: "스케일"
    }
  }
};
const SetClipHooks$2 = {
  display_name: "CLIP 후크 설정",
  inputs: {
    apply_to_conds: {
      name: "조건에_적용"
    },
    clip: {
      name: "clip"
    },
    hooks: {
      name: "후크"
    },
    schedule_clip: {
      name: "스케줄_클립"
    }
  }
};
const SetHookKeyframes$2 = {
  display_name: "후크 키프레임 설정",
  inputs: {
    hook_kf: {
      name: "KF 후크"
    },
    hooks: {
      name: "후크"
    }
  }
};
const SetLatentNoiseMask$2 = {
  display_name: "잠재 데이터에 노이즈 마스크 설정",
  inputs: {
    mask: {
      name: "마스크"
    },
    samples: {
      name: "잠재 데이터"
    }
  }
};
const SetUnionControlNetType$2 = {
  display_name: "통합 컨트롤넷 유형 설정",
  inputs: {
    control_net: {
      name: "컨트롤넷"
    },
    type: {
      name: "유형"
    }
  }
};
const SkipLayerGuidanceDiT$2 = {
  description: "모든 DiT 모델에서 사용할 수 있는 SkipLayerGuidance 노드의 범용 버전입니다.",
  display_name: "SkipLayerGuidanceDiT",
  inputs: {
    double_layers: {
      name: "double_layers"
    },
    end_percent: {
      name: "종료 퍼센트"
    },
    model: {
      name: "모델"
    },
    rescaling_scale: {
      name: "크기 재조정 크기"
    },
    scale: {
      name: "크기"
    },
    single_layers: {
      name: "단일_레이어"
    },
    start_percent: {
      name: "시작 퍼센트"
    }
  }
};
const SkipLayerGuidanceSD3$2 = {
  description: "모든 DiT 모델에서 사용할 수 있는 SkipLayerGuidance 노드의 범용 버전입니다.",
  display_name: "SkipLayerGuidanceSD3",
  inputs: {
    end_percent: {
      name: "종료 퍼센트"
    },
    layers: {
      name: "레이어"
    },
    model: {
      name: "모델"
    },
    scale: {
      name: "크기"
    },
    start_percent: {
      name: "시작 퍼센트"
    }
  }
};
const SolidMask$2 = {
  display_name: "단색 마스크",
  inputs: {
    height: {
      name: "높이"
    },
    value: {
      name: "값"
    },
    width: {
      name: "너비"
    }
  }
};
const SplitImageWithAlpha$2 = {
  display_name: "이미지와 알파채널 분리",
  inputs: {
    image: {
      name: "이미지"
    }
  }
};
const SplitSigmas$2 = {
  display_name: "시그마 분할 (스텝)",
  inputs: {
    sigmas: {
      name: "시그마"
    },
    step: {
      name: "분할 스텝"
    }
  },
  outputs: {
    "0": {
      name: "높은 시그마"
    },
    "1": {
      name: "낮은 시그마"
    }
  }
};
const SplitSigmasDenoise$2 = {
  display_name: "시그마 분할 (노이즈 제거양)",
  inputs: {
    denoise: {
      name: "노이즈 제거양"
    },
    sigmas: {
      name: "시그마"
    }
  },
  outputs: {
    "0": {
      name: "높은 시그마"
    },
    "1": {
      name: "낮은 시그마"
    }
  }
};
const StableCascade_EmptyLatentImage$2 = {
  display_name: "StableCascade 빈 잠재 이미지",
  inputs: {
    batch_size: {
      name: "배치 크기"
    },
    compression: {
      name: "압축"
    },
    height: {
      name: "높이"
    },
    width: {
      name: "너비"
    }
  },
  outputs: {
    "0": {
      name: "StageC 잠재 이미지"
    },
    "1": {
      name: "StageB 잠재 이미지"
    }
  }
};
const StableCascade_StageB_Conditioning$2 = {
  display_name: "StableCascasde_StageB 조건 설정",
  inputs: {
    conditioning: {
      name: "조건"
    },
    stage_c: {
      name: "StageC 잠재 이미지"
    }
  }
};
const StableCascade_StageC_VAEEncode$2 = {
  display_name: "StableCascade_StageC VAE 인코딩",
  inputs: {
    compression: {
      name: "압축"
    },
    image: {
      name: "이미지"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "StageC 잠재 이미지"
    },
    "1": {
      name: "StageB 잠재 이미지"
    }
  }
};
const StableCascade_SuperResolutionControlnet$2 = {
  display_name: "StableCascade 초고해상도 컨트롤넷",
  inputs: {
    image: {
      name: "이미지"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "controlnet_input"
    },
    "1": {
      name: "StageC 잠재 이미지"
    },
    "2": {
      name: "StageB 잠재 이미지"
    }
  }
};
const StableZero123_Conditioning$2 = {
  display_name: "StableZero123 조건 설정",
  inputs: {
    azimuth: {
      name: "방위각"
    },
    batch_size: {
      name: "배치 크기"
    },
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "고도"
    },
    height: {
      name: "높이"
    },
    init_image: {
      name: "초기 이미지"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "너비"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    },
    "2": {
      name: "잠재 데이터"
    }
  }
};
const StableZero123_Conditioning_Batched$2 = {
  display_name: "StableZero123 조건 설정_배치",
  inputs: {
    azimuth: {
      name: "방위각"
    },
    azimuth_batch_increment: {
      name: "방위각 배치 증가"
    },
    batch_size: {
      name: "배치 크기"
    },
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "고도"
    },
    elevation_batch_increment: {
      name: "고도 배치 증가"
    },
    height: {
      name: "높이"
    },
    init_image: {
      name: "초기 이미지"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "너비"
    }
  },
  outputs: {
    "0": {
      name: "긍정 조건"
    },
    "1": {
      name: "부정 조건"
    },
    "2": {
      name: "잠재 데이터"
    }
  }
};
const StyleModelApply$2 = {
  display_name: "스타일 모델 적용",
  inputs: {
    clip_vision_output: {
      name: "clip_vision 출력"
    },
    conditioning: {
      name: "조건"
    },
    strength: {
      name: "강도"
    },
    strength_type: {
      name: "강도 유형"
    },
    style_model: {
      name: "스타일 모델"
    }
  }
};
const StyleModelLoader$2 = {
  display_name: "스타일 모델 로드",
  inputs: {
    style_model_name: {
      name: "스타일 모델 이름"
    }
  }
};
const ThresholdMask$2 = {
  display_name: "임계값 마스크",
  inputs: {
    mask: {
      name: "마스크"
    },
    value: {
      name: "값"
    }
  }
};
const TomePatchModel$2 = {
  display_name: "토큰 병합(ToMe) 모델 패치",
  inputs: {
    model: {
      name: "모델"
    },
    ratio: {
      name: "비율"
    }
  }
};
const TorchCompileModel$2 = {
  display_name: "모델 토치 컴파일",
  inputs: {
    backend: {
      name: "백엔드"
    },
    model: {
      name: "모델"
    }
  }
};
const TripleCLIPLoader$2 = {
  description: "[조합법]\n\nsd3: clip-l, clip-g, t5",
  display_name: "삼중 CLIP 로드",
  inputs: {
    clip_name1: {
      name: "CLIP 파일명1"
    },
    clip_name2: {
      name: "CLIP 파일명2"
    },
    clip_name3: {
      name: "CLIP 파일명3"
    }
  }
};
const UNETLoader$2 = {
  display_name: "확산 모델 로드",
  inputs: {
    unet_name: {
      name: "UNet 모델 파일명"
    },
    weight_dtype: {
      name: "가중치 데이터 유형"
    }
  }
};
const UNetCrossAttentionMultiply$2 = {
  display_name: "UNet 교차 어텐션 곱하기",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "모델"
    },
    out: {
      name: "out"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetSelfAttentionMultiply$2 = {
  display_name: "UNet 셀프 어텐션 곱하기",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "모델"
    },
    out: {
      name: "out"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetTemporalAttentionMultiply$2 = {
  display_name: "UNet 템포럴 어텐션 곱하기",
  inputs: {
    cross_structural: {
      name: "구조적 크로스"
    },
    cross_temporal: {
      name: "시간적 크로스"
    },
    model: {
      name: "모델"
    },
    self_structural: {
      name: "구조적 셀프"
    },
    self_temporal: {
      name: "시간적 셀프"
    }
  }
};
const UpscaleModelLoader$2 = {
  display_name: "업스케일 모델 로드",
  inputs: {
    model_name: {
      name: "모델 파일명"
    }
  }
};
const VAEDecode$2 = {
  description: "잠재 데이터를 픽셀 공간 이미지로 디코딩합니다.",
  display_name: "VAE 디코드",
  inputs: {
    samples: {
      name: "샘플",
      tooltip: "디코딩할 잠재입니다."
    },
    vae: {
      name: "vae",
      tooltip: "잠재 디코딩에 사용되는 VAE 모델입니다."
    }
  },
  outputs: {
    "0": {
      tooltip: "디코딩된 이미지입니다."
    }
  }
};
const VAEDecodeAudio$2 = {
  display_name: "오디오 VAE 디코드",
  inputs: {
    samples: {
      name: "잠재 오디오"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEDecodeTiled$2 = {
  display_name: "VAE 디코드 (타일)",
  inputs: {
    overlap: {
      name: "겹침"
    },
    samples: {
      name: "잠재 데이터"
    },
    temporal_overlap: {
      name: "시간 겹침",
      tooltip: "비디오 VAE에만 사용됩니다: 겹치는 프레임의 양."
    },
    temporal_size: {
      name: "시간 크기",
      tooltip: "비디오 VAE에만 사용됩니다: 한 번에 디코딩할 프레임의 양."
    },
    tile_size: {
      name: "타일 크기"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncode$2 = {
  display_name: "VAE 인코드",
  inputs: {
    pixels: {
      name: "픽셀 이미지"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeAudio$2 = {
  display_name: "오디오 VAE 인코드",
  inputs: {
    audio: {
      name: "오디오"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeForInpaint$2 = {
  display_name: "VAE 인코드 (인페인팅용)",
  inputs: {
    grow_mask_by: {
      name: "마스크 확장"
    },
    mask: {
      name: "마스크"
    },
    pixels: {
      name: "픽셀"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeTiled$2 = {
  display_name: "VAE 인코드 (타일)",
  inputs: {
    overlap: {
      name: "겹침"
    },
    pixels: {
      name: "픽셀"
    },
    temporal_overlap: {
      name: "시간적 겹침",
      tooltip: "비디오 VAE에만 사용됩니다: 겹치는 프레임의 양."
    },
    temporal_size: {
      name: "시간적 크기",
      tooltip: "비디오 VAE에만 사용됩니다: 한 번에 인코딩할 프레임의 양."
    },
    tile_size: {
      name: "타일 크기"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAELoader$2 = {
  display_name: "VAE 로드",
  inputs: {
    vae_name: {
      name: "vae 파일명"
    }
  }
};
const VAESave$2 = {
  display_name: "VAE 저장",
  inputs: {
    filename_prefix: {
      name: "파일명 접두사"
    },
    vae: {
      name: "vae"
    }
  }
};
const VPScheduler$2 = {
  display_name: "VP 스케줄러",
  inputs: {
    beta_d: {
      name: "beta_d"
    },
    beta_min: {
      name: "beta_min"
    },
    eps_s: {
      name: "eps_s"
    },
    steps: {
      name: "스텝수"
    }
  }
};
const VideoLinearCFGGuidance$2 = {
  display_name: "비디오 선형 CFG 가이드",
  inputs: {
    min_cfg: {
      name: "최소 cfg"
    },
    model: {
      name: "모델"
    }
  }
};
const VideoTriangleCFGGuidance$2 = {
  display_name: "비디오 삼각형 CFG 가이드",
  inputs: {
    min_cfg: {
      name: "최소 cfg"
    },
    model: {
      name: "모델"
    }
  }
};
const WebcamCapture$2 = {
  display_name: "웹캠 캡처",
  inputs: {
    capture_on_queue: {
      name: "큐에서 캡처"
    },
    height: {
      name: "높이"
    },
    image: {
      name: "이미지"
    },
    width: {
      name: "너비"
    }
  }
};
const unCLIPCheckpointLoader$2 = {
  display_name: "unCLIP 체크포인트 로드",
  inputs: {
    ckpt_name: {
      name: "체크포인트 파일명"
    }
  }
};
const unCLIPConditioning$2 = {
  display_name: "unCLIP 조건 설정",
  inputs: {
    clip_vision_output: {
      name: "clip_vision 출력"
    },
    conditioning: {
      name: "조건"
    },
    noise_augmentation: {
      name: "노이즈 증강"
    },
    strength: {
      name: "강도"
    }
  }
};
const koNodes = {
  AddNoise: AddNoise$2,
  AlignYourStepsScheduler: AlignYourStepsScheduler$2,
  BasicGuider: BasicGuider$2,
  BasicScheduler: BasicScheduler$2,
  BetaSamplingScheduler: BetaSamplingScheduler$2,
  CFGGuider: CFGGuider$2,
  CLIPAttentionMultiply: CLIPAttentionMultiply$2,
  CLIPLoader: CLIPLoader$2,
  CLIPMergeAdd: CLIPMergeAdd$2,
  CLIPMergeSimple: CLIPMergeSimple$2,
  CLIPMergeSubtract: CLIPMergeSubtract$2,
  CLIPSave: CLIPSave$2,
  CLIPSetLastLayer: CLIPSetLastLayer$2,
  CLIPTextEncode: CLIPTextEncode$2,
  CLIPTextEncodeControlnet: CLIPTextEncodeControlnet$2,
  CLIPTextEncodeFlux: CLIPTextEncodeFlux$2,
  CLIPTextEncodeHunyuanDiT: CLIPTextEncodeHunyuanDiT$2,
  CLIPTextEncodePixArtAlpha: CLIPTextEncodePixArtAlpha$2,
  CLIPTextEncodeSD3: CLIPTextEncodeSD3$2,
  CLIPTextEncodeSDXL: CLIPTextEncodeSDXL$2,
  CLIPTextEncodeSDXLRefiner: CLIPTextEncodeSDXLRefiner$2,
  CLIPVisionEncode: CLIPVisionEncode$2,
  CLIPVisionLoader: CLIPVisionLoader$2,
  Canny: Canny$2,
  CheckpointLoader: CheckpointLoader$2,
  CheckpointLoaderSimple: CheckpointLoaderSimple$2,
  CheckpointSave: CheckpointSave$2,
  CombineHooks2: CombineHooks2$2,
  CombineHooks4: CombineHooks4$2,
  CombineHooks8: CombineHooks8$2,
  ConditioningAverage: ConditioningAverage$2,
  ConditioningCombine: ConditioningCombine$2,
  ConditioningConcat: ConditioningConcat$2,
  ConditioningSetArea: ConditioningSetArea$2,
  ConditioningSetAreaPercentage: ConditioningSetAreaPercentage$2,
  ConditioningSetAreaStrength: ConditioningSetAreaStrength$2,
  ConditioningSetDefaultCombine: ConditioningSetDefaultCombine$2,
  ConditioningSetMask: ConditioningSetMask$2,
  ConditioningSetProperties: ConditioningSetProperties$2,
  ConditioningSetPropertiesAndCombine: ConditioningSetPropertiesAndCombine$2,
  ConditioningSetTimestepRange: ConditioningSetTimestepRange$2,
  ConditioningStableAudio: ConditioningStableAudio$2,
  ConditioningTimestepsRange: ConditioningTimestepsRange$2,
  ConditioningZeroOut: ConditioningZeroOut$2,
  ControlNetApply: ControlNetApply$2,
  ControlNetApplyAdvanced: ControlNetApplyAdvanced$2,
  ControlNetApplySD3: ControlNetApplySD3$2,
  ControlNetInpaintingAliMamaApply: ControlNetInpaintingAliMamaApply$2,
  ControlNetLoader: ControlNetLoader$2,
  CreateHookKeyframe: CreateHookKeyframe$2,
  CreateHookKeyframesFromFloats: CreateHookKeyframesFromFloats$2,
  CreateHookKeyframesInterpolated: CreateHookKeyframesInterpolated$2,
  CreateHookLora: CreateHookLora$2,
  CreateHookLoraModelOnly: CreateHookLoraModelOnly$2,
  CreateHookModelAsLora: CreateHookModelAsLora$2,
  CreateHookModelAsLoraModelOnly: CreateHookModelAsLoraModelOnly$2,
  CropMask: CropMask$2,
  DevToolsDeprecatedNode: DevToolsDeprecatedNode$2,
  DevToolsErrorRaiseNode: DevToolsErrorRaiseNode$2,
  DevToolsErrorRaiseNodeWithMessage: DevToolsErrorRaiseNodeWithMessage$2,
  DevToolsExperimentalNode: DevToolsExperimentalNode$2,
  DevToolsLongComboDropdown: DevToolsLongComboDropdown$2,
  DevToolsNodeWithForceInput: DevToolsNodeWithForceInput$2,
  DevToolsNodeWithOnlyOptionalInput: DevToolsNodeWithOnlyOptionalInput$2,
  DevToolsNodeWithOptionalInput: DevToolsNodeWithOptionalInput$2,
  DevToolsNodeWithOutputList: DevToolsNodeWithOutputList$2,
  DevToolsNodeWithStringInput: DevToolsNodeWithStringInput$2,
  DevToolsNodeWithUnionInput: DevToolsNodeWithUnionInput$2,
  DevToolsSimpleSlider: DevToolsSimpleSlider$2,
  DiffControlNetLoader: DiffControlNetLoader$2,
  DifferentialDiffusion: DifferentialDiffusion$2,
  DiffusersLoader: DiffusersLoader$2,
  DisableNoise: DisableNoise$2,
  DualCFGGuider: DualCFGGuider$2,
  DualCLIPLoader: DualCLIPLoader$2,
  EmptyHunyuanLatentVideo: EmptyHunyuanLatentVideo$2,
  EmptyImage: EmptyImage$2,
  EmptyLTXVLatentVideo: EmptyLTXVLatentVideo$2,
  EmptyLatentAudio: EmptyLatentAudio$2,
  EmptyLatentImage: EmptyLatentImage$2,
  EmptyMochiLatentVideo: EmptyMochiLatentVideo$2,
  EmptySD3LatentImage: EmptySD3LatentImage$2,
  ExponentialScheduler: ExponentialScheduler$2,
  FeatherMask: FeatherMask$2,
  FlipSigmas: FlipSigmas$2,
  FluxGuidance: FluxGuidance$2,
  FreeU: FreeU$2,
  FreeU_V2: FreeU_V2$2,
  GITSScheduler: GITSScheduler$2,
  GLIGENLoader: GLIGENLoader$2,
  GLIGENTextBoxApply: GLIGENTextBoxApply$2,
  GrowMask: GrowMask$2,
  HyperTile: HyperTile$2,
  HypernetworkLoader: HypernetworkLoader$2,
  ImageBatch: ImageBatch$2,
  ImageBlend: ImageBlend$2,
  ImageBlur: ImageBlur$2,
  ImageColorToMask: ImageColorToMask$2,
  ImageCompositeMasked: ImageCompositeMasked$2,
  ImageCrop: ImageCrop$2,
  ImageFromBatch: ImageFromBatch$2,
  ImageInvert: ImageInvert$2,
  ImageOnlyCheckpointLoader: ImageOnlyCheckpointLoader$2,
  ImageOnlyCheckpointSave: ImageOnlyCheckpointSave$2,
  ImagePadForOutpaint: ImagePadForOutpaint$2,
  ImageQuantize: ImageQuantize$2,
  ImageScale: ImageScale$2,
  ImageScaleBy: ImageScaleBy$2,
  ImageScaleToTotalPixels: ImageScaleToTotalPixels$2,
  ImageSharpen: ImageSharpen$2,
  ImageToMask: ImageToMask$2,
  ImageUpscaleWithModel: ImageUpscaleWithModel$2,
  InpaintModelConditioning: InpaintModelConditioning$2,
  InstructPixToPixConditioning: InstructPixToPixConditioning$2,
  InvertMask: InvertMask$2,
  JoinImageWithAlpha: JoinImageWithAlpha$2,
  KSampler: KSampler$2,
  KSamplerAdvanced: KSamplerAdvanced$2,
  KSamplerSelect: KSamplerSelect$2,
  KarrasScheduler: KarrasScheduler$2,
  LTXVConditioning: LTXVConditioning$2,
  LTXVImgToVideo: LTXVImgToVideo$2,
  LTXVScheduler: LTXVScheduler$2,
  LaplaceScheduler: LaplaceScheduler$2,
  LatentAdd: LatentAdd$2,
  LatentApplyOperation: LatentApplyOperation$2,
  LatentApplyOperationCFG: LatentApplyOperationCFG$2,
  LatentBatch: LatentBatch$2,
  LatentBatchSeedBehavior: LatentBatchSeedBehavior$2,
  LatentBlend: LatentBlend$2,
  LatentComposite: LatentComposite$2,
  LatentCompositeMasked: LatentCompositeMasked$2,
  LatentCrop: LatentCrop$2,
  LatentFlip: LatentFlip$2,
  LatentFromBatch: LatentFromBatch$2,
  LatentInterpolate: LatentInterpolate$2,
  LatentMultiply: LatentMultiply$2,
  LatentOperationSharpen: LatentOperationSharpen$2,
  LatentOperationTonemapReinhard: LatentOperationTonemapReinhard$2,
  LatentRotate: LatentRotate$2,
  LatentSubtract: LatentSubtract$2,
  LatentUpscale: LatentUpscale$2,
  LatentUpscaleBy: LatentUpscaleBy$2,
  Load3D: Load3D$2,
  Load3DAnimation: Load3DAnimation$2,
  LoadAudio: LoadAudio$2,
  LoadImage: LoadImage$2,
  LoadImageMask: LoadImageMask$2,
  LoadLatent: LoadLatent$2,
  LoraLoader: LoraLoader$2,
  LoraLoaderModelOnly: LoraLoaderModelOnly$2,
  LoraSave: LoraSave$2,
  Mahiro: Mahiro$2,
  MaskComposite: MaskComposite$2,
  MaskToImage: MaskToImage$2,
  ModelMergeAdd: ModelMergeAdd$2,
  ModelMergeAuraflow: ModelMergeAuraflow$2,
  ModelMergeBlocks: ModelMergeBlocks$2,
  ModelMergeFlux1: ModelMergeFlux1$2,
  ModelMergeLTXV: ModelMergeLTXV$2,
  ModelMergeMochiPreview: ModelMergeMochiPreview$2,
  ModelMergeSD1: ModelMergeSD1$2,
  ModelMergeSD2: ModelMergeSD2$2,
  ModelMergeSD35_Large: ModelMergeSD35_Large$2,
  ModelMergeSD3_2B: ModelMergeSD3_2B$2,
  ModelMergeSDXL: ModelMergeSDXL$2,
  ModelMergeSimple: ModelMergeSimple$2,
  ModelMergeSubtract: ModelMergeSubtract$2,
  ModelSamplingAuraFlow: ModelSamplingAuraFlow$2,
  ModelSamplingContinuousEDM: ModelSamplingContinuousEDM$2,
  ModelSamplingContinuousV: ModelSamplingContinuousV$2,
  ModelSamplingDiscrete: ModelSamplingDiscrete$2,
  ModelSamplingFlux: ModelSamplingFlux$2,
  ModelSamplingLTXV: ModelSamplingLTXV$2,
  ModelSamplingSD3: ModelSamplingSD3$2,
  ModelSamplingStableCascade: ModelSamplingStableCascade$2,
  ModelSave: ModelSave$2,
  Morphology: Morphology$2,
  PairConditioningCombine: PairConditioningCombine$2,
  PairConditioningSetDefaultCombine: PairConditioningSetDefaultCombine$2,
  PairConditioningSetProperties: PairConditioningSetProperties$2,
  PairConditioningSetPropertiesAndCombine: PairConditioningSetPropertiesAndCombine$2,
  PatchModelAddDownscale: PatchModelAddDownscale$2,
  PerpNeg: PerpNeg$2,
  PerpNegGuider: PerpNegGuider$2,
  PerturbedAttentionGuidance: PerturbedAttentionGuidance$2,
  PhotoMakerEncode: PhotoMakerEncode$2,
  PhotoMakerLoader: PhotoMakerLoader$2,
  PolyexponentialScheduler: PolyexponentialScheduler$2,
  PorterDuffImageComposite: PorterDuffImageComposite$2,
  Preview3D: Preview3D$2,
  PreviewAudio: PreviewAudio$2,
  PreviewImage: PreviewImage$2,
  RandomNoise: RandomNoise$2,
  RebatchImages: RebatchImages$2,
  RebatchLatents: RebatchLatents$2,
  RepeatImageBatch: RepeatImageBatch$2,
  RepeatLatentBatch: RepeatLatentBatch$2,
  RescaleCFG: RescaleCFG$2,
  SDTurboScheduler: SDTurboScheduler$2,
  SD_4XUpscale_Conditioning: SD_4XUpscale_Conditioning$2,
  SV3D_Conditioning: SV3D_Conditioning$2,
  SVD_img2vid_Conditioning: SVD_img2vid_Conditioning$2,
  SamplerCustom: SamplerCustom$2,
  SamplerCustomAdvanced: SamplerCustomAdvanced$2,
  SamplerDPMAdaptative: SamplerDPMAdaptative$2,
  SamplerDPMPP_2M_SDE: SamplerDPMPP_2M_SDE$2,
  SamplerDPMPP_2S_Ancestral: SamplerDPMPP_2S_Ancestral$2,
  SamplerDPMPP_3M_SDE: SamplerDPMPP_3M_SDE$2,
  SamplerDPMPP_SDE: SamplerDPMPP_SDE$2,
  SamplerEulerAncestral: SamplerEulerAncestral$2,
  SamplerEulerAncestralCFGPP: SamplerEulerAncestralCFGPP$2,
  SamplerEulerCFGpp: SamplerEulerCFGpp$2,
  SamplerLCMUpscale: SamplerLCMUpscale$2,
  SamplerLMS: SamplerLMS$2,
  SaveAnimatedPNG: SaveAnimatedPNG$2,
  SaveAnimatedWEBP: SaveAnimatedWEBP$2,
  SaveAudio: SaveAudio$2,
  SaveImage: SaveImage$2,
  SaveImageWebsocket: SaveImageWebsocket$2,
  SaveLatent: SaveLatent$2,
  SelfAttentionGuidance: SelfAttentionGuidance$2,
  SetClipHooks: SetClipHooks$2,
  SetHookKeyframes: SetHookKeyframes$2,
  SetLatentNoiseMask: SetLatentNoiseMask$2,
  SetUnionControlNetType: SetUnionControlNetType$2,
  SkipLayerGuidanceDiT: SkipLayerGuidanceDiT$2,
  SkipLayerGuidanceSD3: SkipLayerGuidanceSD3$2,
  SolidMask: SolidMask$2,
  SplitImageWithAlpha: SplitImageWithAlpha$2,
  SplitSigmas: SplitSigmas$2,
  SplitSigmasDenoise: SplitSigmasDenoise$2,
  StableCascade_EmptyLatentImage: StableCascade_EmptyLatentImage$2,
  StableCascade_StageB_Conditioning: StableCascade_StageB_Conditioning$2,
  StableCascade_StageC_VAEEncode: StableCascade_StageC_VAEEncode$2,
  StableCascade_SuperResolutionControlnet: StableCascade_SuperResolutionControlnet$2,
  StableZero123_Conditioning: StableZero123_Conditioning$2,
  StableZero123_Conditioning_Batched: StableZero123_Conditioning_Batched$2,
  StyleModelApply: StyleModelApply$2,
  StyleModelLoader: StyleModelLoader$2,
  ThresholdMask: ThresholdMask$2,
  TomePatchModel: TomePatchModel$2,
  TorchCompileModel: TorchCompileModel$2,
  TripleCLIPLoader: TripleCLIPLoader$2,
  UNETLoader: UNETLoader$2,
  UNetCrossAttentionMultiply: UNetCrossAttentionMultiply$2,
  UNetSelfAttentionMultiply: UNetSelfAttentionMultiply$2,
  UNetTemporalAttentionMultiply: UNetTemporalAttentionMultiply$2,
  UpscaleModelLoader: UpscaleModelLoader$2,
  VAEDecode: VAEDecode$2,
  VAEDecodeAudio: VAEDecodeAudio$2,
  VAEDecodeTiled: VAEDecodeTiled$2,
  VAEEncode: VAEEncode$2,
  VAEEncodeAudio: VAEEncodeAudio$2,
  VAEEncodeForInpaint: VAEEncodeForInpaint$2,
  VAEEncodeTiled: VAEEncodeTiled$2,
  VAELoader: VAELoader$2,
  VAESave: VAESave$2,
  VPScheduler: VPScheduler$2,
  VideoLinearCFGGuidance: VideoLinearCFGGuidance$2,
  VideoTriangleCFGGuidance: VideoTriangleCFGGuidance$2,
  WebcamCapture: WebcamCapture$2,
  unCLIPCheckpointLoader: unCLIPCheckpointLoader$2,
  unCLIPConditioning: unCLIPConditioning$2
};
const Comfy_ConfirmClear$2 = {
  name: "워크플로 비우기 시 확인 요구"
};
const Comfy_DOMClippingEnabled$2 = {
  name: "DOM 요소 클리핑 활성화 (활성화 시 성능 저하 가능)"
};
const Comfy_DevMode$2 = {
  name: "개발자 모드 옵션 활성화 (API 저장 등)"
};
const Comfy_DisableFloatRounding$2 = {
  name: "기본 부동 소수점 위젯 반올림 비활성화",
  tooltip: "(페이지 새로 고침 필요) 백엔드에서 노드에 의해 설정된 반올림이 있을 때 반올림을 비활성화할 수 없습니다."
};
const Comfy_DisableSliders$2 = {
  name: "노드 위젯 슬라이더 비활성화"
};
const Comfy_EditAttention_Delta$2 = {
  name: "Ctrl+위/아래 정밀도"
};
const Comfy_EnableTooltips$2 = {
  name: "툴팁 활성화"
};
const Comfy_EnableWorkflowViewRestore$2 = {
  name: "워크플로에서 캔버스 위치 및 확대/축소 수준 저장 및 복원"
};
const Comfy_FloatRoundingPrecision$2 = {
  name: "부동 소수점 위젯 반올림 소수 자리 수 [0 = 자동]",
  tooltip: "(페이지 새로 고침 필요)"
};
const Comfy_Graph_CanvasInfo$2 = {
  name: "왼쪽 하단 모서리에 캔버스 정보 표시 (fps 등)"
};
const Comfy_Graph_CanvasMenu$2 = {
  name: "그래프 캔버스 메뉴 표시"
};
const Comfy_Graph_CtrlShiftZoom$2 = {
  name: "빠른 확대/축소 단축키 활성화 (Ctrl + Shift + 드래그)"
};
const Comfy_Graph_LinkMarkers$2 = {
  name: "링크 중간점 마커",
  options: {
    Arrow: "화살표",
    Circle: "원",
    None: "없음"
  }
};
const Comfy_Graph_ZoomSpeed$2 = {
  name: "캔버스 확대/축소 속도"
};
const Comfy_GroupSelectedNodes_Padding$2 = {
  name: "선택된 노드 패딩"
};
const Comfy_Group_DoubleClickTitleToEdit$2 = {
  name: "그룹 제목을 두 번 클릭하여 편집"
};
const Comfy_InvertMenuScrolling$2 = {
  name: "컨텍스트 메뉴 스크롤 반전"
};
const Comfy_LinkRelease_Action$2 = {
  name: "링크 해제 시 동작 (수정자 없음)",
  options: {
    "context menu": "컨텍스트 메뉴",
    "no action": "작업 없음",
    "search box": "검색 상자"
  }
};
const Comfy_LinkRelease_ActionShift$2 = {
  name: "링크 해제 시 동작 (Shift)",
  options: {
    "context menu": "컨텍스트 메뉴",
    "no action": "작업 없음",
    "search box": "검색 상자"
  }
};
const Comfy_LinkRenderMode$2 = {
  name: "링크 렌더 모드",
  options: {
    Hidden: "숨김",
    Linear: "선형",
    Spline: "스플라인",
    Straight: "직선"
  }
};
const Comfy_Locale$2 = {
  name: "언어"
};
const Comfy_MaskEditor_BrushAdjustmentSpeed$2 = {
  name: "브러시 조정 속도 배수",
  tooltip: "조정할 때 브러시 크기와 경도가 얼마나 빨리 변하는지를 제어합니다. 값이 높을수록 변화가 더 빠릅니다."
};
const Comfy_MaskEditor_UseDominantAxis$2 = {
  name: "브러시 조정을 지배 축에 고정",
  tooltip: "활성화하면 브러시 조정이 이동하는 방향에 따라 크기 또는 경도에만 영향을 미칩니다."
};
const Comfy_MaskEditor_UseNewEditor$2 = {
  name: "새 마스크 편집기 사용",
  tooltip: "새 마스크 편집기 인터페이스로 전환"
};
const Comfy_ModelLibrary_AutoLoadAll$2 = {
  name: "모든 모델 폴더 자동 로드",
  tooltip: "참이면 모든 폴더가 모델 라이브러리를 열 때 즉시 로드됩니다 (로드하는 동안 지연이 발생할 수 있습니다). 거짓이면 루트 수준 모델 폴더는 클릭할 때만 로드됩니다."
};
const Comfy_ModelLibrary_NameFormat$2 = {
  name: "모델 라이브러리 트리 뷰에 표시할 이름",
  options: {
    filename: "파일 이름",
    title: "제목"
  },
  tooltip: '"파일 이름"을 선택하면 모델 목록에서 원시 파일 이름(디렉토리 또는 ".safetensors" 확장자 없이)의 단순화된 뷰가 렌더링됩니다. "제목"을 선택하면 구성 가능한 모델 메타데이터 제목이 표시됩니다.'
};
const Comfy_NodeBadge_NodeIdBadgeMode$2 = {
  name: "노드 ID 배지 모드",
  options: {
    None: "없음",
    "Show all": "모두 표시"
  }
};
const Comfy_NodeBadge_NodeLifeCycleBadgeMode$2 = {
  name: "노드 생명 주기 배지 모드",
  options: {
    None: "없음",
    "Show all": "모두 표시"
  }
};
const Comfy_NodeBadge_NodeSourceBadgeMode$2 = {
  name: "노드 출처 배지 모드",
  options: {
    "Hide built-in": "내장 숨기기",
    None: "없음",
    "Show all": "모두 표시"
  }
};
const Comfy_NodeInputConversionSubmenus$2 = {
  name: "노드 컨텍스트 메뉴에서 입력/위젯 간 변환 항목을 하위 메뉴에 배치합니다."
};
const Comfy_NodeSearchBoxImpl$2 = {
  name: "노드 검색 상자 구현",
  options: {
    "default": "기본",
    "litegraph (legacy)": "litegraph (구버전)"
  }
};
const Comfy_NodeSearchBoxImpl_NodePreview$2 = {
  name: "노드 미리보기",
  tooltip: "기본 구현에만 적용됩니다."
};
const Comfy_NodeSearchBoxImpl_ShowCategory$2 = {
  name: "검색 결과에 노드 카테고리 표시",
  tooltip: "기본 구현에만 적용됩니다."
};
const Comfy_NodeSearchBoxImpl_ShowIdName$2 = {
  name: "검색 결과에 노드 ID 이름 표시",
  tooltip: "기본 구현에만 적용됩니다."
};
const Comfy_NodeSearchBoxImpl_ShowNodeFrequency$2 = {
  name: "검색 결과에 노드 빈도 표시",
  tooltip: "기본 구현에만 적용됩니다."
};
const Comfy_NodeSuggestions_number$2 = {
  name: "노드 제안 수",
  tooltip: "라이트그래프 검색 상자/컨텍스트 메뉴 전용"
};
const Comfy_Node_AutoSnapLinkToSlot$2 = {
  name: "링크를 노드 슬롯에 자동 스냅",
  tooltip: "링크를 노드 위로 드래그할 때 링크가 노드의 유효한 입력 슬롯에 자동으로 스냅됩니다."
};
const Comfy_Node_BypassAllLinksOnDelete$2 = {
  name: "노드 삭제 시 모든 링크 유지",
  tooltip: "노드를 삭제할 때 모든 입력 및 출력 링크를 재연결하려고 시도합니다 (삭제된 노드를 우회)."
};
const Comfy_Node_DoubleClickTitleToEdit$2 = {
  name: "노드 제목을 두 번 클릭하여 편집"
};
const Comfy_Node_MiddleClickRerouteNode$2 = {
  name: "중간 클릭으로 새 경로재설정 노드 생성"
};
const Comfy_Node_Opacity$2 = {
  name: "노드 불투명도"
};
const Comfy_Node_ShowDeprecated$2 = {
  name: "검색에서 지원 중단된 노드 표시",
  tooltip: "지원 중단된 노드는 기본적으로 UI에서 숨겨지지만, 이를 사용하는 기존 워크플로에서는 여전히 기능합니다."
};
const Comfy_Node_ShowExperimental$2 = {
  name: "검색에서 실험적 노드 표시",
  tooltip: "실험적 노드는 UI에서 그렇게 표시되며, 향후 버전에서 상당한 변경이나 제거의 대상이 될 수 있습니다. 프로덕션 워크플로에서 주의하여 사용하십시오."
};
const Comfy_Node_SnapHighlightsNode$2 = {
  name: "스냅 하이라이트 노드",
  tooltip: "링크를 유효한 입력 슬롯이 있는 노드 위로 드래그할 때 노드를 강조 표시합니다."
};
const Comfy_Pointer_ClickBufferTime$2 = {
  name: "포인터 클릭 드리프트 지연",
  tooltip: "포인터 버튼을 누른 후, 포인터 움직임을 무시할 수 있는 최대 시간(밀리초)입니다.\n\n클릭하는 동안 포인터가 움직여 의도치 않게 객체가 밀리는 것을 방지합니다."
};
const Comfy_Pointer_ClickDrift$2 = {
  name: "포인터 클릭 드리프트 (최대 거리)",
  tooltip: "버튼을 누른 상태에서 포인터가 이 거리보다 더 많이 움직이면, 클릭이 아닌 드래그로 간주됩니다.\n\n클릭하는 동안 포인터가 움직여 의도치 않게 객체가 밀리는 것을 방지합니다."
};
const Comfy_Pointer_DoubleClickTime$2 = {
  name: "더블 클릭 간격 (최대)",
  tooltip: "더블 클릭의 두 클릭 사이의 최대 시간(밀리초)입니다. 이 값을 늘리면 가끔 더블 클릭이 인식되지 않는 문제를 해결할 수 있습니다."
};
const Comfy_PreviewFormat$2 = {
  name: "미리보기 이미지 형식",
  tooltip: "이미지 위젯에서 미리보기를 표시할 때 경량 이미지로 변환합니다. '이미지 포맷;품질' 예: webp, jpeg, webp;50 등."
};
const Comfy_PromptFilename$2 = {
  name: "워크플로 저장 시 파일 이름 프롬프트"
};
const Comfy_QueueButton_BatchCountLimit$2 = {
  name: "배치 수 제한",
  tooltip: "한 번의 버튼 클릭으로 실행 큐에 추가되는 최대 작업 수입니다."
};
const Comfy_Queue_MaxHistoryItems$2 = {
  name: "실행 큐 기록 갯수",
  tooltip: "실행 큐 기록에 표시되는 최대 작업 수입니다."
};
const Comfy_RerouteBeta$2 = {
  name: "경로재설정 베타 테스트 참여",
  tooltip: "새로운 기본 경로재설정을 활성화합니다.\n\n링크 라인에서 Alt를 누른 채 드래그하거나 링크 메뉴에서 경로재설정을 추가할 수 있습니다.\n\n이 옵션을 비활성화해도 경로재설정은 삭제되지 않고 숨겨집니다."
};
const Comfy_Sidebar_Location$2 = {
  name: "사이드바 위치",
  options: {
    left: "왼쪽",
    right: "오른쪽"
  }
};
const Comfy_Sidebar_Size$2 = {
  name: "사이드바 크기",
  options: {
    normal: "보통",
    small: "작음"
  }
};
const Comfy_SnapToGrid_GridSize$2 = {
  name: "그리드 크기에 스냅",
  tooltip: "Shift 키를 누른 상태에서 노드를 드래그하거나 크기를 조절하면 그리드에 맞춰 정렬됩니다. 이 설정은 그리드의 크기를 제어합니다."
};
const Comfy_TextareaWidget_FontSize$2 = {
  name: "텍스트 영역 위젯 글꼴 크기"
};
const Comfy_TextareaWidget_Spellcheck$2 = {
  name: "텍스트 영역 위젯 맞춤법 검사"
};
const Comfy_TreeExplorer_ItemPadding$2 = {
  name: "트리 탐색기 항목 패딩"
};
const Comfy_UseNewMenu$2 = {
  name: "새 메뉴 사용",
  options: {
    Bottom: "하단",
    Disabled: "비활성화",
    Top: "상단"
  }
};
const Comfy_Validation_NodeDefs$2 = {
  name: "노드 정의 유효성 검사 (느림)",
  tooltip: "노드 개발자에게 권장됩니다. 시작 시 모든 노드 정의를 유효성 검사합니다."
};
const Comfy_Validation_Workflows$2 = {
  name: "워크플로 유효성 검사"
};
const Comfy_WidgetControlMode$2 = {
  name: "위젯 제어 모드",
  options: {
    after: "다음",
    before: "이전"
  },
  tooltip: "위젯 값이 업데이트되는 시점을 제어합니다 (무작위화/증가/감소), 프롬프트가 큐에 추가되기 전 또는 후입니다."
};
const Comfy_Window_UnloadConfirmation$2 = {
  name: "창 닫을 때 확인 표시"
};
const Comfy_Workflow_ConfirmDelete$2 = {
  name: "워크플로 삭제 시 확인 표시"
};
const Comfy_Workflow_ShowMissingModelsWarning$2 = {
  name: "누락된 모델 경고 표시"
};
const Comfy_Workflow_ShowMissingNodesWarning$2 = {
  name: "누락된 노드 경고 표시"
};
const Comfy_Workflow_SortNodeIdOnSave$2 = {
  name: "워크플로 저장 시 노드 ID 정렬"
};
const Comfy_Workflow_WorkflowTabsPosition$2 = {
  name: "열린 워크플로 위치",
  options: {
    Sidebar: "사이드바",
    Topbar: "상단바"
  }
};
const LiteGraph_Canvas_MaximumFps$2 = {
  name: "최대 FPS",
  tooltip: "캔버스가 렌더링할 수 있는 최대 프레임 수입니다. 부드럽게 동작하도록 GPU 사용률을 제한 합니다. 0이면 화면 주사율로 작동 합니다. 기본값: 0"
};
const pysssss_SnapToGrid$2 = {
  name: "항상 그리드에 스냅"
};
const koSettings = {
  "Comfy-Desktop_AutoUpdate": {
    name: "자동 업데이트 확인"
  },
  "Comfy-Desktop_SendStatistics": {
    name: "익명으로 충돌 보고서 전송"
  },
  Comfy_ConfirmClear: Comfy_ConfirmClear$2,
  Comfy_DOMClippingEnabled: Comfy_DOMClippingEnabled$2,
  Comfy_DevMode: Comfy_DevMode$2,
  Comfy_DisableFloatRounding: Comfy_DisableFloatRounding$2,
  Comfy_DisableSliders: Comfy_DisableSliders$2,
  Comfy_EditAttention_Delta: Comfy_EditAttention_Delta$2,
  Comfy_EnableTooltips: Comfy_EnableTooltips$2,
  Comfy_EnableWorkflowViewRestore: Comfy_EnableWorkflowViewRestore$2,
  Comfy_FloatRoundingPrecision: Comfy_FloatRoundingPrecision$2,
  Comfy_Graph_CanvasInfo: Comfy_Graph_CanvasInfo$2,
  Comfy_Graph_CanvasMenu: Comfy_Graph_CanvasMenu$2,
  Comfy_Graph_CtrlShiftZoom: Comfy_Graph_CtrlShiftZoom$2,
  Comfy_Graph_LinkMarkers: Comfy_Graph_LinkMarkers$2,
  Comfy_Graph_ZoomSpeed: Comfy_Graph_ZoomSpeed$2,
  Comfy_GroupSelectedNodes_Padding: Comfy_GroupSelectedNodes_Padding$2,
  Comfy_Group_DoubleClickTitleToEdit: Comfy_Group_DoubleClickTitleToEdit$2,
  Comfy_InvertMenuScrolling: Comfy_InvertMenuScrolling$2,
  Comfy_LinkRelease_Action: Comfy_LinkRelease_Action$2,
  Comfy_LinkRelease_ActionShift: Comfy_LinkRelease_ActionShift$2,
  Comfy_LinkRenderMode: Comfy_LinkRenderMode$2,
  Comfy_Locale: Comfy_Locale$2,
  Comfy_MaskEditor_BrushAdjustmentSpeed: Comfy_MaskEditor_BrushAdjustmentSpeed$2,
  Comfy_MaskEditor_UseDominantAxis: Comfy_MaskEditor_UseDominantAxis$2,
  Comfy_MaskEditor_UseNewEditor: Comfy_MaskEditor_UseNewEditor$2,
  Comfy_ModelLibrary_AutoLoadAll: Comfy_ModelLibrary_AutoLoadAll$2,
  Comfy_ModelLibrary_NameFormat: Comfy_ModelLibrary_NameFormat$2,
  Comfy_NodeBadge_NodeIdBadgeMode: Comfy_NodeBadge_NodeIdBadgeMode$2,
  Comfy_NodeBadge_NodeLifeCycleBadgeMode: Comfy_NodeBadge_NodeLifeCycleBadgeMode$2,
  Comfy_NodeBadge_NodeSourceBadgeMode: Comfy_NodeBadge_NodeSourceBadgeMode$2,
  Comfy_NodeInputConversionSubmenus: Comfy_NodeInputConversionSubmenus$2,
  Comfy_NodeSearchBoxImpl: Comfy_NodeSearchBoxImpl$2,
  Comfy_NodeSearchBoxImpl_NodePreview: Comfy_NodeSearchBoxImpl_NodePreview$2,
  Comfy_NodeSearchBoxImpl_ShowCategory: Comfy_NodeSearchBoxImpl_ShowCategory$2,
  Comfy_NodeSearchBoxImpl_ShowIdName: Comfy_NodeSearchBoxImpl_ShowIdName$2,
  Comfy_NodeSearchBoxImpl_ShowNodeFrequency: Comfy_NodeSearchBoxImpl_ShowNodeFrequency$2,
  Comfy_NodeSuggestions_number: Comfy_NodeSuggestions_number$2,
  Comfy_Node_AutoSnapLinkToSlot: Comfy_Node_AutoSnapLinkToSlot$2,
  Comfy_Node_BypassAllLinksOnDelete: Comfy_Node_BypassAllLinksOnDelete$2,
  Comfy_Node_DoubleClickTitleToEdit: Comfy_Node_DoubleClickTitleToEdit$2,
  Comfy_Node_MiddleClickRerouteNode: Comfy_Node_MiddleClickRerouteNode$2,
  Comfy_Node_Opacity: Comfy_Node_Opacity$2,
  Comfy_Node_ShowDeprecated: Comfy_Node_ShowDeprecated$2,
  Comfy_Node_ShowExperimental: Comfy_Node_ShowExperimental$2,
  Comfy_Node_SnapHighlightsNode: Comfy_Node_SnapHighlightsNode$2,
  Comfy_Pointer_ClickBufferTime: Comfy_Pointer_ClickBufferTime$2,
  Comfy_Pointer_ClickDrift: Comfy_Pointer_ClickDrift$2,
  Comfy_Pointer_DoubleClickTime: Comfy_Pointer_DoubleClickTime$2,
  Comfy_PreviewFormat: Comfy_PreviewFormat$2,
  Comfy_PromptFilename: Comfy_PromptFilename$2,
  Comfy_QueueButton_BatchCountLimit: Comfy_QueueButton_BatchCountLimit$2,
  Comfy_Queue_MaxHistoryItems: Comfy_Queue_MaxHistoryItems$2,
  Comfy_RerouteBeta: Comfy_RerouteBeta$2,
  Comfy_Sidebar_Location: Comfy_Sidebar_Location$2,
  Comfy_Sidebar_Size: Comfy_Sidebar_Size$2,
  Comfy_SnapToGrid_GridSize: Comfy_SnapToGrid_GridSize$2,
  Comfy_TextareaWidget_FontSize: Comfy_TextareaWidget_FontSize$2,
  Comfy_TextareaWidget_Spellcheck: Comfy_TextareaWidget_Spellcheck$2,
  Comfy_TreeExplorer_ItemPadding: Comfy_TreeExplorer_ItemPadding$2,
  Comfy_UseNewMenu: Comfy_UseNewMenu$2,
  Comfy_Validation_NodeDefs: Comfy_Validation_NodeDefs$2,
  Comfy_Validation_Workflows: Comfy_Validation_Workflows$2,
  Comfy_WidgetControlMode: Comfy_WidgetControlMode$2,
  Comfy_Window_UnloadConfirmation: Comfy_Window_UnloadConfirmation$2,
  Comfy_Workflow_ConfirmDelete: Comfy_Workflow_ConfirmDelete$2,
  Comfy_Workflow_ShowMissingModelsWarning: Comfy_Workflow_ShowMissingModelsWarning$2,
  Comfy_Workflow_ShowMissingNodesWarning: Comfy_Workflow_ShowMissingNodesWarning$2,
  Comfy_Workflow_SortNodeIdOnSave: Comfy_Workflow_SortNodeIdOnSave$2,
  Comfy_Workflow_WorkflowTabsPosition: Comfy_Workflow_WorkflowTabsPosition$2,
  LiteGraph_Canvas_MaximumFps: LiteGraph_Canvas_MaximumFps$2,
  pysssss_SnapToGrid: pysssss_SnapToGrid$2
};
const Comfy_BrowseTemplates$1 = {
  label: "Просмотр шаблонов"
};
const Comfy_Canvas_FitView$1 = {
  label: "Подогнать вид к выбранным узлам"
};
const Comfy_Canvas_ResetView$1 = {
  label: "Сбросить вид"
};
const Comfy_Canvas_ToggleLinkVisibility$1 = {
  label: "Переключить видимость ссылки"
};
const Comfy_Canvas_ToggleLock$1 = {
  label: "Переключить блокировку холста"
};
const Comfy_Canvas_ToggleSelectedNodes_Bypass$1 = {
  label: "Обход/Необход выбранных узлов"
};
const Comfy_Canvas_ToggleSelectedNodes_Collapse$1 = {
  label: "Свернуть/Развернуть выбранные узлы"
};
const Comfy_Canvas_ToggleSelectedNodes_Mute$1 = {
  label: "Отключить/Включить звук выбранных узлов"
};
const Comfy_Canvas_ToggleSelectedNodes_Pin$1 = {
  label: "Закрепить/Открепить выбранные узлы"
};
const Comfy_Canvas_ToggleSelected_Pin$1 = {
  label: "Закрепить/Открепить выбранные элементы"
};
const Comfy_Canvas_ZoomIn$1 = {
  label: "Увеличить"
};
const Comfy_Canvas_ZoomOut$1 = {
  label: "Уменьшить"
};
const Comfy_ClearPendingTasks$1 = {
  label: "Очистить ожидающие задачи"
};
const Comfy_ClearWorkflow$1 = {
  label: "Очистить рабочий процесс"
};
const Comfy_DuplicateWorkflow$1 = {
  label: "Дублировать текущий рабочий процесс"
};
const Comfy_ExportWorkflow$1 = {
  label: "Экспорт рабочего процесса"
};
const Comfy_ExportWorkflowAPI$1 = {
  label: "Экспорт рабочего процесса (формат API)"
};
const Comfy_Graph_FitGroupToContents$1 = {
  label: "Подогнать группу к содержимому"
};
const Comfy_Graph_GroupSelectedNodes$1 = {
  label: "Группировать выбранные узлы"
};
const Comfy_GroupNode_ConvertSelectedNodesToGroupNode$1 = {
  label: "Преобразовать выбранные узлы в групповой узел"
};
const Comfy_GroupNode_ManageGroupNodes$1 = {
  label: "Управление групповыми узлами"
};
const Comfy_GroupNode_UngroupSelectedGroupNodes$1 = {
  label: "Разгруппировать выбранные групповые узлы"
};
const Comfy_Help_AboutComfyUI$1 = {
  label: "Открыть о ComfyUI"
};
const Comfy_Help_OpenComfyOrgDiscord$1 = {
  label: "Открыть Comfy-Org Discord"
};
const Comfy_Help_OpenComfyUIDocs$1 = {
  label: "Открыть документы ComfyUI"
};
const Comfy_Help_OpenComfyUIIssues$1 = {
  label: "Открыть проблемы ComfyUI"
};
const Comfy_Interrupt$1 = {
  label: "Прервать"
};
const Comfy_LoadDefaultWorkflow$1 = {
  label: "Загрузить стандартный рабочий процесс"
};
const Comfy_NewBlankWorkflow$1 = {
  label: "Новый пустой рабочий процесс"
};
const Comfy_OpenClipspace$1 = {
  label: "Клипспейс"
};
const Comfy_OpenWorkflow$1 = {
  label: "Открыть рабочий процесс"
};
const Comfy_QueuePrompt$1 = {
  label: "Очередь запросов"
};
const Comfy_QueuePromptFront$1 = {
  label: "Очередь запросов (передняя)"
};
const Comfy_Redo$1 = {
  label: "Повторить"
};
const Comfy_RefreshNodeDefinitions$1 = {
  label: "Обновить определения узлов"
};
const Comfy_SaveWorkflow$1 = {
  label: "Сохранить рабочий процесс"
};
const Comfy_SaveWorkflowAs$1 = {
  label: "Сохранить рабочий процесс как"
};
const Comfy_ShowSettingsDialog$1 = {
  label: "Показать диалог настроек"
};
const Comfy_ToggleTheme$1 = {
  label: "Переключить тему (Темная/Светлая)"
};
const Comfy_Undo$1 = {
  label: "Отменить"
};
const Workspace_NextOpenedWorkflow$1 = {
  label: "Следующий открытый рабочий процесс"
};
const Workspace_PreviousOpenedWorkflow$1 = {
  label: "Предыдущий открытый рабочий процесс"
};
const Workspace_SearchBox_Toggle$1 = {
  label: "Переключить поисковое окно"
};
const Workspace_ToggleBottomPanel$1 = {
  label: "Переключить нижнюю панель"
};
const Workspace_ToggleFocusMode$1 = {
  label: "Переключить режим фокуса"
};
const Workspace_ToggleSidebarTab_queue$1 = {
  label: "Переключить боковую панель очереди",
  tooltip: "Очередь"
};
const Workspace_ToggleSidebarTab_workflows$1 = {
  label: "Переключить боковую панель рабочих процессов",
  tooltip: "Рабочие процессы"
};
const ruCommands = {
  "Comfy-Desktop_Folders_OpenCustomNodesFolder": {
    label: "Открыть папку с пользовательскими узлами"
  },
  "Comfy-Desktop_Folders_OpenInputsFolder": {
    label: "Открыть папку с входными данными"
  },
  "Comfy-Desktop_Folders_OpenLogsFolder": {
    label: "Открыть папку с логами"
  },
  "Comfy-Desktop_Folders_OpenModelConfig": {
    label: "Открыть extra_model_paths.yaml"
  },
  "Comfy-Desktop_Folders_OpenModelsFolder": {
    label: "Открыть папку с моделями"
  },
  "Comfy-Desktop_Folders_OpenOutputsFolder": {
    label: "Открыть папку с результатами"
  },
  "Comfy-Desktop_OpenDevTools": {
    label: "Открыть инструменты разработчика"
  },
  "Comfy-Desktop_OpenFeedbackPage": {
    label: "Обратная связь"
  },
  "Comfy-Desktop_OpenUserGuide": {
    label: "Руководство пользователя для рабочего стола"
  },
  "Comfy-Desktop_Reinstall": {
    label: "Переустановить"
  },
  "Comfy-Desktop_Restart": {
    label: "Перезагрузить"
  },
  Comfy_BrowseTemplates: Comfy_BrowseTemplates$1,
  Comfy_Canvas_FitView: Comfy_Canvas_FitView$1,
  Comfy_Canvas_ResetView: Comfy_Canvas_ResetView$1,
  Comfy_Canvas_ToggleLinkVisibility: Comfy_Canvas_ToggleLinkVisibility$1,
  Comfy_Canvas_ToggleLock: Comfy_Canvas_ToggleLock$1,
  Comfy_Canvas_ToggleSelectedNodes_Bypass: Comfy_Canvas_ToggleSelectedNodes_Bypass$1,
  Comfy_Canvas_ToggleSelectedNodes_Collapse: Comfy_Canvas_ToggleSelectedNodes_Collapse$1,
  Comfy_Canvas_ToggleSelectedNodes_Mute: Comfy_Canvas_ToggleSelectedNodes_Mute$1,
  Comfy_Canvas_ToggleSelectedNodes_Pin: Comfy_Canvas_ToggleSelectedNodes_Pin$1,
  Comfy_Canvas_ToggleSelected_Pin: Comfy_Canvas_ToggleSelected_Pin$1,
  Comfy_Canvas_ZoomIn: Comfy_Canvas_ZoomIn$1,
  Comfy_Canvas_ZoomOut: Comfy_Canvas_ZoomOut$1,
  Comfy_ClearPendingTasks: Comfy_ClearPendingTasks$1,
  Comfy_ClearWorkflow: Comfy_ClearWorkflow$1,
  Comfy_DuplicateWorkflow: Comfy_DuplicateWorkflow$1,
  Comfy_ExportWorkflow: Comfy_ExportWorkflow$1,
  Comfy_ExportWorkflowAPI: Comfy_ExportWorkflowAPI$1,
  Comfy_Graph_FitGroupToContents: Comfy_Graph_FitGroupToContents$1,
  Comfy_Graph_GroupSelectedNodes: Comfy_Graph_GroupSelectedNodes$1,
  Comfy_GroupNode_ConvertSelectedNodesToGroupNode: Comfy_GroupNode_ConvertSelectedNodesToGroupNode$1,
  Comfy_GroupNode_ManageGroupNodes: Comfy_GroupNode_ManageGroupNodes$1,
  Comfy_GroupNode_UngroupSelectedGroupNodes: Comfy_GroupNode_UngroupSelectedGroupNodes$1,
  Comfy_Help_AboutComfyUI: Comfy_Help_AboutComfyUI$1,
  Comfy_Help_OpenComfyOrgDiscord: Comfy_Help_OpenComfyOrgDiscord$1,
  Comfy_Help_OpenComfyUIDocs: Comfy_Help_OpenComfyUIDocs$1,
  Comfy_Help_OpenComfyUIIssues: Comfy_Help_OpenComfyUIIssues$1,
  Comfy_Interrupt: Comfy_Interrupt$1,
  Comfy_LoadDefaultWorkflow: Comfy_LoadDefaultWorkflow$1,
  Comfy_NewBlankWorkflow: Comfy_NewBlankWorkflow$1,
  Comfy_OpenClipspace: Comfy_OpenClipspace$1,
  Comfy_OpenWorkflow: Comfy_OpenWorkflow$1,
  Comfy_QueuePrompt: Comfy_QueuePrompt$1,
  Comfy_QueuePromptFront: Comfy_QueuePromptFront$1,
  Comfy_Redo: Comfy_Redo$1,
  Comfy_RefreshNodeDefinitions: Comfy_RefreshNodeDefinitions$1,
  Comfy_SaveWorkflow: Comfy_SaveWorkflow$1,
  Comfy_SaveWorkflowAs: Comfy_SaveWorkflowAs$1,
  Comfy_ShowSettingsDialog: Comfy_ShowSettingsDialog$1,
  Comfy_ToggleTheme: Comfy_ToggleTheme$1,
  Comfy_Undo: Comfy_Undo$1,
  Workspace_NextOpenedWorkflow: Workspace_NextOpenedWorkflow$1,
  Workspace_PreviousOpenedWorkflow: Workspace_PreviousOpenedWorkflow$1,
  Workspace_SearchBox_Toggle: Workspace_SearchBox_Toggle$1,
  Workspace_ToggleBottomPanel: Workspace_ToggleBottomPanel$1,
  "Workspace_ToggleBottomPanelTab_command-terminal": {
    label: "Переключить нижнюю панель терминала"
  },
  "Workspace_ToggleBottomPanelTab_logs-terminal": {
    label: "Переключить нижнюю панель журналов"
  },
  Workspace_ToggleFocusMode: Workspace_ToggleFocusMode$1,
  "Workspace_ToggleSidebarTab_model-library": {
    label: "Переключить боковую панель библиотеки моделей",
    tooltip: "Библиотека моделей"
  },
  "Workspace_ToggleSidebarTab_node-library": {
    label: "Переключить боковую панель библиотеки узлов",
    tooltip: "Библиотека узлов"
  },
  Workspace_ToggleSidebarTab_queue: Workspace_ToggleSidebarTab_queue$1,
  Workspace_ToggleSidebarTab_workflows: Workspace_ToggleSidebarTab_workflows$1
};
const color$1 = {
  blue: "Синий",
  custom: "Пользовательский",
  "default": "По умолчанию",
  green: "Зеленый",
  pink: "Розовый",
  red: "Красный",
  yellow: "Желтый"
};
const dataTypes$1 = {
  AUDIO: "АУДИО",
  BOOLEAN: "БУЛЕВО",
  CLIP: "CLIP",
  CLIP_VISION: "CLIP_VISION",
  CLIP_VISION_OUTPUT: "CLIP_VISION_OUTPUT",
  COMBO: "КОМБО",
  CONDITIONING: "КОНДИЦИОНИРОВАНИЕ",
  CONTROL_NET: "СЕТЬ УПРАВЛЕНИЯ",
  FLOAT: "ПЛАВАЮЩИЙ",
  FLOATS: "ПЛАВАЮЩИЕ",
  GLIGEN: "GLIGEN",
  GUIDER: "РУКОВОДИТЕЛЬ",
  HOOKS: "КРЮКИ",
  HOOK_KEYFRAMES: "КЛЮЧЕВЫЕ КАДРЫ КРЮКА",
  IMAGE: "ИЗОБРАЖЕНИЕ",
  INT: "ЦЕЛОЕ",
  LATENT: "ЛАТЕНТНЫЙ",
  LATENT_OPERATION: "ЛАТЕНТНАЯ ОПЕРАЦИЯ",
  LOAD_3D: "ЗАГРУЗИТЬ_3D",
  LOAD_3D_ANIMATION: "ЗАГРУЗИТЬ_3D_АНИМАЦИЮ",
  MASK: "МАСКА",
  MODEL: "МОДЕЛЬ",
  NOISE: "ШУМ",
  PHOTOMAKER: "PHOTOMAKER",
  SAMPLER: "СЭМПЛЕР",
  SIGMAS: "СИГМЫ",
  STRING: "СТРОКА",
  STYLE_MODEL: "МОДЕЛЬ СТИЛЯ",
  TIMESTEPS_RANGE: "ДИАПАЗОН ВРЕМЕННЫХ ШАГОВ",
  UPSCALE_MODEL: "МОДЕЛЬ УВЕЛИЧЕНИЯ",
  VAE: "VAE",
  WEBCAM: "ВЕБ-КАМЕРА"
};
const desktopMenu$1 = {
  confirmReinstall: "Это очистит ваш файл extra_models_config.yaml и начнет установку заново. Вы уверены?",
  reinstall: "Переустановить"
};
const downloadGit$1 = {
  gitWebsite: "Скачать git",
  instructions: "Пожалуйста, скачайте и установите последнюю версию для вашей операционной системы. Кнопка 'Скачать git' ниже открывает страницу загрузок git-scm.com.",
  message: "Не удалось найти git. Рабочая копия git необходима для нормальной работы.",
  skip: "Пропустить",
  title: "Скачать git",
  warning: "Если вы уверены, что вам не нужно устанавливать git, или произошла ошибка, вы можете нажать 'Пропустить', чтобы обойти эту проверку. Попытка запустить ComfyUI без рабочей копии git в настоящее время не поддерживается."
};
const electronFileDownload$1 = {
  cancel: "Отменить загрузку",
  cancelled: "Отменено",
  inProgress: "В процессе",
  pause: "Приостановить загрузку",
  paused: "Приостановлено",
  resume: "Возобновить загрузку"
};
const g$1 = {
  about: "О программе",
  add: "Добавить",
  back: "Назад",
  cancel: "Отмена",
  close: "Закрыть",
  color: "Цвет",
  comingSoon: "Скоро будет",
  command: "Команда",
  confirm: "Подтвердить",
  copyToClipboard: "Скопировать в буфер обмена",
  currentUser: "Текущий пользователь",
  customize: "Настроить",
  customizeFolder: "Настроить папку",
  "delete": "Удалить",
  deprecated: "УСТАРЕЛО",
  devices: "Устройства",
  disableAll: "Отключить все",
  download: "Скачать",
  empty: "Пусто",
  enableAll: "Включить все",
  error: "Ошибка",
  experimental: "БЕТА",
  extensionName: "Имя расширения",
  findIssues: "Найти проблемы",
  firstTimeUIMessage: 'Вы впервые используете новый интерфейс. Выберите "Меню > Использовать новое меню > Отключено", чтобы восстановить старый интерфейс.',
  goToNode: "Перейти к узлу",
  icon: "Иконка",
  imageFailedToLoad: "Не удалось загрузить изображение",
  "import": "Импорт",
  insert: "Вставить",
  install: "Установить",
  keybinding: "Привязка клавиш",
  loadAllFolders: "Загрузить все папки",
  loadWorkflow: "Загрузить рабочий процесс",
  loading: "Загрузка",
  logs: "Журналы",
  newFolder: "Новая папка",
  next: "Далее",
  no: "Нет",
  noResultsFound: "Результатов не найдено",
  noTasksFound: "Задачи не найдены",
  noTasksFoundMessage: "В очереди нет задач.",
  noWorkflowsFound: "Рабочие процессы не найдены.",
  openNewIssue: "Открыть новую проблему",
  overwrite: "Перезаписать",
  reconnected: "Переподключено",
  reconnecting: "Переподключение",
  refresh: "Обновить",
  reloadToApplyChanges: "Перезагрузите, чтобы применить изменения",
  rename: "Переименовать",
  reportIssue: "Отправить отчет",
  reportIssueTooltip: "Отправить отчет об ошибке в Comfy Org",
  reportSent: "Отчет отправлен",
  reset: "Сбросить",
  resetKeybindingsTooltip: "Сбросить сочетания клавиш к умолчанию",
  save: "Сохранить",
  searchExtensions: "Поиск расширений",
  searchFailedMessage: "Мы не смогли найти настройки, соответствующие вашему запросу. Попробуйте изменить поисковые термины.",
  searchKeybindings: "Поиск сочетаний клавиш",
  searchModels: "Поиск моделей",
  searchNodes: "Поиск узлов",
  searchSettings: "Поиск настроек",
  searchWorkflows: "Поиск рабочих процессов",
  settings: "Настройки",
  showReport: "Показать отчет",
  systemInfo: "Информация о системе",
  terminal: "Терминал",
  upload: "Загрузить",
  videoFailedToLoad: "Не удалось загрузить видео"
};
const graphCanvasMenu$1 = {
  fitView: "Подгонять под выделенные",
  panMode: "Режим панорамирования",
  resetView: "Сбросить вид",
  selectMode: "Выбрать режим",
  toggleLinkVisibility: "Переключить видимость ссылок",
  zoomIn: "Увеличить",
  zoomOut: "Уменьшить"
};
const groupNode$1 = {
  create: "Создать узел группы",
  enterName: "Введите имя"
};
const icon$1 = {
  bookmark: "Закладка",
  box: "Коробка",
  briefcase: "Портфель",
  "exclamation-triangle": "Предупреждение",
  file: "Файл",
  folder: "Папка",
  heart: "Сердце",
  inbox: "Входящие",
  star: "Звезда"
};
const install$1 = {
  appDataLocationTooltip: "Директория данных приложения ComfyUI. Хранит:\n- Логи\n- Конфигурации сервера",
  appPathLocationTooltip: "Директория активов приложения ComfyUI. Хранит код и активы ComfyUI",
  cannotWrite: "Невозможно записать в выбранный путь",
  chooseInstallationLocation: "Выберите место установки",
  customNodes: "Пользовательские узлы",
  customNodesDescription: "Переустановите пользовательские узлы из существующих установок ComfyUI.",
  desktopAppSettings: "Настройки настольного приложения",
  desktopAppSettingsDescription: "Настройте, как ComfyUI ведет себя на вашем рабочем столе. Вы можете изменить эти настройки позже.",
  desktopSettings: "Настройки рабочего стола",
  failedToSelectDirectory: "Не удалось выбрать директорию",
  gpu: "GPU",
  gpuSelection: {
    cpuMode: "Режим CPU",
    cpuModeDescription: "Режим CPU предназначен только для разработчиков и редких крайних случаев.",
    cpuModeDescription2: "Если вы не абсолютно уверены, что вам это нужно, пожалуйста, проигнорируйте эту галочку и выберите ваш GPU выше.",
    customComfyNeedsPython: "ComfyUI не будет работать, пока python не будет настроен",
    customInstallRequirements: "Установите все требования и зависимости (например, custom torch)",
    customManualVenv: "Вручную настроить python venv",
    customMayNotWork: "Это полностью не поддерживается и может просто не работать",
    customSkipsPython: "Этот вариант пропускает обычную настройку python.",
    enableCpuMode: "Включить режим CPU",
    mpsDescription: "Поддерживаются Apple Metal Performance Shaders с использованием pytorch nightly.",
    nvidiaDescription: "Устройства NVIDIA напрямую поддерживаются с использованием сборок pytorch CUDA.",
    selectGpu: "Выберите GPU",
    selectGpuDescription: "Выберите тип GPU, который у вас есть"
  },
  installLocation: "Место установки",
  installLocationDescription: "Выберите директорию для пользовательских данных ComfyUI. В выбранном месте будет установлена среда Python. Пожалуйста, убедитесь, что на выбранном диске достаточно места (~15 ГБ).",
  installLocationTooltip: "Директория пользовательских данных ComfyUI. Хранит:\n- Среда Python\n- Модели\n- Пользовательские узлы\n",
  insufficientFreeSpace: "Недостаточно места - минимально необходимое свободное место",
  manualConfiguration: {
    createVenv: "Вам потребуется создать виртуальное окружение в следующем каталоге",
    requirements: "Требования",
    restartWhenFinished: "После завершения настройки виртуального окружения, пожалуйста, перезапустите ComfyUI.",
    title: "Ручная Конфигурация",
    virtualEnvironmentPath: "Путь виртуального окружения"
  },
  migrateFromExistingInstallation: "Миграция из существующей установки",
  migration: "Миграция",
  migrationOptional: "Миграция является необязательной. Если у вас нет существующей установки, вы можете пропустить этот шаг.",
  migrationSourcePathDescription: "Если у вас есть существующая установка ComfyUI, мы можем скопировать/связать ваши существующие пользовательские файлы и модели в новую установку.",
  parentMissing: "Путь не существует - сначала создайте родительский каталог",
  pathExists: "Директория уже существует - пожалуйста, убедитесь, что вы сделали резервное копирование всех данных",
  pathValidationFailed: "Не удалось проверить путь",
  selectItemsToMigrate: "Выберите элементы для миграции",
  settings: {
    allowMetrics: "Отчеты о сбоях",
    allowMetricsDescription: "Помогите улучшить ComfyUI, отправляя анонимные отчеты о сбоях. Личная информация или содержимое рабочего процесса не будут собираться. Это можно отключить в любое время в меню настроек.",
    autoUpdate: "Автоматические обновления",
    autoUpdateDescription: "Автоматически загружать и устанавливать обновления, когда они становятся доступными. Вы всегда будете уведомлены перед установкой обновлений.",
    dataCollectionDialog: {
      customNodeConfigurations: "Конфигурации пользовательских узлов",
      errorReports: "Сообщения об ошибках и трассировка стека",
      fileSystemInformation: "Информация о файловой системе",
      personalInformation: "Личная информация",
      systemInfo: "Аппаратное обеспечение, тип ОС и версия приложения",
      title: "О сборе данных",
      whatWeCollect: "Что мы собираем:",
      whatWeDoNotCollect: "Что мы не собираем:",
      workflowContent: "Содержимое рабочего процесса",
      workflowContents: "Содержимое рабочего процесса"
    },
    learnMoreAboutData: "Узнать больше о сборе данных"
  },
  systemLocations: "Системные места",
  unhandledError: "Неизвестная ошибка"
};
const menu$1 = {
  autoQueue: "Автоочередь",
  batchCount: "Количество пакетов",
  batchCountTooltip: "Количество раз, когда генерация рабочего процесса должна быть помещена в очередь",
  clear: "Очистить рабочий процесс",
  clipspace: "Открыть Clipspace",
  disabled: "Отключено",
  disabledTooltip: "Рабочий процесс не будет автоматически помещён в очередь",
  execute: "Выполнить",
  hideMenu: "Скрыть меню",
  instant: "Мгновенно",
  instantTooltip: "Рабочий процесс будет помещён в очередь сразу же после завершения генерации",
  interrupt: "Отменить текущее выполнение",
  onChange: "При изменении",
  onChangeTooltip: "Рабочий процесс будет поставлен в очередь после внесения изменений",
  queue: "Выполнить",
  queueWorkflow: "Очередь рабочего процесса (Shift для вставки спереди)",
  queueWorkflowFront: "Очередь рабочего процесса (Вставка спереди)",
  refresh: "Обновить определения узлов",
  resetView: "Сбросить вид холста",
  showMenu: "Показать меню",
  toggleBottomPanel: "Переключить нижнюю панель"
};
const menuLabels$1 = {
  "About ComfyUI": "О ComfyUI",
  "Browse Templates": "Просмотреть шаблоны",
  "Bypass/Unbypass Selected Nodes": "Обойти/восстановить выбранные узлы",
  "Canvas Toggle Link Visibility": "Переключение видимости ссылки на холст",
  "Canvas Toggle Lock": "Переключение блокировки холста",
  "Clear Pending Tasks": "Очистить ожидающие задачи",
  "Clear Workflow": "Очистить рабочий процесс",
  Clipspace: "Клиппространство",
  "Collapse/Expand Selected Nodes": "Свернуть/развернуть выбранные узлы",
  "Comfy-Org Discord": "Discord Comfy-Org",
  "ComfyUI Docs": "Документация ComfyUI",
  "ComfyUI Issues": "Проблемы ComfyUI",
  "Convert selected nodes to group node": "Преобразовать выбранные узлы в групповой узел",
  "Desktop User Guide": "Руководство пользователя для настольных ПК",
  "Duplicate Current Workflow": "Дублировать текущий рабочий процесс",
  Edit: "Редактировать",
  Export: "Экспортировать",
  "Export (API)": "Экспорт (API)",
  Feedback: "Обратная связь",
  "Fit Group To Contents": "Подогнать группу под содержимое",
  "Fit view to selected nodes": "Подогнать вид под выбранные узлы",
  "Group Selected Nodes": "Сгруппировать выбранные узлы",
  Help: "Помощь",
  Interrupt: "Прервать",
  "Load Default Workflow": "Загрузить стандартный рабочий процесс",
  "Manage group nodes": "Управление групповыми узлами",
  "Mute/Unmute Selected Nodes": "Отключить/включить звук для выбранных узлов",
  New: "Новый",
  "Next Opened Workflow": "Следующий открытый рабочий процесс",
  Open: "Открыть",
  "Open Custom Nodes Folder": "Открыть папку пользовательских узлов",
  "Open DevTools": "Открыть инструменты разработчика",
  "Open Inputs Folder": "Открыть папку входных данных",
  "Open Logs Folder": "Открыть папку журналов",
  "Open Models Folder": "Открыть папку моделей",
  "Open Outputs Folder": "Открыть папку выходных данных",
  "Open extra_model_paths_yaml": "Открыть extra_model_paths.yaml",
  "Pin/Unpin Selected Items": "Закрепить/открепить выбранные элементы",
  "Pin/Unpin Selected Nodes": "Закрепить/открепить выбранные узлы",
  "Previous Opened Workflow": "Предыдущий открытый рабочий процесс",
  "Queue Prompt": "Запрос в очереди",
  "Queue Prompt (Front)": "Запрос в очереди (спереди)",
  Redo: "Повторить",
  "Refresh Node Definitions": "Обновить определения узлов",
  Reinstall: "Переустановить",
  "Reset View": "Сбросить вид",
  Restart: "Перезапустить",
  Save: "Сохранить",
  "Save As": "Сохранить как",
  "Show Settings Dialog": "Показать диалог настроек",
  "Toggle Bottom Panel": "Переключить нижнюю панель",
  "Toggle Focus Mode": "Переключить режим фокуса",
  "Toggle Logs Bottom Panel": "Переключение нижней панели журналов",
  "Toggle Model Library Sidebar": "Переключение боковой панели библиотеки моделей",
  "Toggle Node Library Sidebar": "Переключение боковой панели библиотеки узлов",
  "Toggle Queue Sidebar": "Переключение боковой панели очереди",
  "Toggle Search Box": "Переключить поисковую панель",
  "Toggle Terminal Bottom Panel": "Переключение нижней панели терминала",
  "Toggle Theme (Dark/Light)": "Переключение темы (Темная/Светлая)",
  "Toggle Workflows Sidebar": "Переключение боковой панели рабочих процессов",
  Undo: "Отменить",
  "Ungroup selected group nodes": "Разгруппировать выбранные групповые узлы",
  Workflow: "Рабочий процесс",
  "Zoom In": "Увеличить",
  "Zoom Out": "Уменьшить"
};
const nodeCategories$1 = {
  "3d": "3d",
  "3d_models": "3d_модели",
  DevTools: "Инструменты_разработчика",
  _for_testing: "_для_тестирования",
  advanced: "расширенный",
  animation: "анимация",
  api: "api",
  attention_experiments: "эксперименты_внимания",
  audio: "аудио",
  batch: "пакет",
  clip: "клип",
  combine: "объединить",
  compositing: "композитинг",
  "cond pair": "условие_пара",
  "cond single": "условие_одиночное",
  conditioning: "условие",
  controlnet: "контрольная_сеть",
  create: "создать",
  custom_sampling: "пользовательская_выборка",
  deprecated: "устаревший",
  flux: "flux",
  gligen: "глиген",
  guidance: "направление",
  guiders: "направляющие",
  hooks: "хуки",
  image: "изображение",
  inpaint: "восстановление",
  instructpix2pix: "инструктпикс2пикс",
  latent: "латентный",
  loaders: "загрузчики",
  ltxv: "ltxv",
  mask: "маска",
  model: "модель",
  model_merging: "слияние_моделей",
  model_patches: "патчи_моделей",
  model_specific: "специфичная_модель",
  noise: "шум",
  operations: "операции",
  photomaker: "photomaker",
  postprocessing: "постобработка",
  preprocessors: "предобработчики",
  samplers: "семплеры",
  sampling: "выборка",
  schedulers: "планировщики",
  scheduling: "планирование",
  sd3: "sd3",
  sigmas: "сигмы",
  stable_cascade: "стабильная_каскадная",
  style_model: "модель_стиля",
  transform: "преобразование",
  unet: "унет",
  upscale_diffusion: "увеличение_диффузии",
  upscaling: "увеличение",
  video: "видео",
  video_models: "видеомодели"
};
const nodeTemplates$1 = {
  enterName: "Введите имя",
  saveAsTemplate: "Сохранить как шаблон"
};
const notSupported$1 = {
  "continue": "Продолжить",
  continueTooltip: "Я уверен, что мое устройство поддерживается",
  learnMore: "Узнать больше",
  message: "Поддерживаются только следующие устройства:",
  reportIssue: "Сообщить о проблеме",
  supportedDevices: {
    macos: "MacOS (M1 или новее)",
    windows: "Windows (Nvidia GPU с поддержкой CUDA)"
  },
  title: "Ваше устройство не поддерживается"
};
const serverConfig$1 = {
  modifiedConfigs: "Вы изменили следующие конфигурации сервера. Перезапустите, чтобы применить изменения.",
  restart: "Перезапустить",
  revertChanges: "Отменить изменения"
};
const serverConfigCategories$1 = {
  Attention: "Внимание",
  CUDA: "CUDA",
  Cache: "Кэш",
  Directories: "Каталоги",
  General: "Общее",
  Inference: "Вывод",
  Memory: "Память",
  Network: "Сеть",
  Preview: "Предпросмотр"
};
const serverConfigItems$1 = {
  "cache-classic": {
    name: "Использовать классическую систему кэширования"
  },
  "cache-lru": {
    name: "Использовать LRU кэширование с максимальным количеством N кэшированных результатов узлов.",
    tooltip: "Может использовать больше ОЗУ/ВРП."
  },
  "cpu-vae": {
    name: "Запуск VAE на CPU"
  },
  "cross-attention-method": {
    name: "Метод перекрестного внимания"
  },
  "cuda-device": {
    name: "Индекс устройства CUDA для использования"
  },
  "cuda-malloc": {
    name: "Использовать CUDA malloc для выделения памяти"
  },
  "default-hashing-function": {
    name: "Функция хеширования по умолчанию для файлов моделей"
  },
  deterministic: {
    name: "Заставить pytorch использовать более медленные детерминированные алгоритмы, когда это возможно.",
    tooltip: "Обратите внимание, что это может не сделать изображения детерминированными во всех случаях."
  },
  directml: {
    name: "Индекс устройства DirectML"
  },
  "disable-all-custom-nodes": {
    name: "Отключить загрузку всех пользовательских узлов."
  },
  "disable-ipex-optimize": {
    name: "Отключить оптимизацию IPEX"
  },
  "disable-metadata": {
    name: "Отключить сохранение метаданных подсказок в файлах."
  },
  "disable-smart-memory": {
    name: "Отключить управление умной памятью",
    tooltip: "Принудить ComfyUI агрессивно выгружать в обычную оперативную память вместо того, чтобы держать модели в VRAM, когда это возможно."
  },
  "disable-xformers": {
    name: "Отключить оптимизацию xFormers"
  },
  "dont-print-server": {
    name: "Не выводить вывод сервера в консоль."
  },
  "dont-upcast-attention": {
    name: "Предотвратить повышение внимания"
  },
  "enable-cors-header": {
    name: 'Включить CORS заголовок: Используйте "*" для всех источников или укажите домен'
  },
  fast: {
    name: "Включить некоторые непроверенные и потенциально ухудшающие качество оптимизации."
  },
  "force-channels-last": {
    name: "Принудительное использование формата памяти с последними каналами"
  },
  "force-upcast-attention": {
    name: "Принудительное повышение внимания"
  },
  "global-precision": {
    name: "Глобальная точность с плавающей запятой",
    tooltip: "Глобальная точность с плавающей запятой"
  },
  "input-directory": {
    name: "Входной каталог"
  },
  listen: {
    name: "Хост: IP-адрес для прослушивания"
  },
  "log-level": {
    name: "Уровень подробности логирования"
  },
  "max-upload-size": {
    name: "Максимальный размер загрузки (МБ)"
  },
  "output-directory": {
    name: "Выходной каталог"
  },
  port: {
    name: "Порт: Порт для прослушивания"
  },
  "preview-method": {
    name: "Метод, используемый для латентных превью"
  },
  "preview-size": {
    name: "Размер превью изображений"
  },
  "reserve-vram": {
    name: "Резервируемая VRAM (ГБ)",
    tooltip: "Установите количество VRAM в ГБ, которое вы хотите зарезервировать для использования вашей ОС/другими программами. По умолчанию резервируется определенное количество в зависимости от вашей ОС."
  },
  "text-encoder-precision": {
    name: "Точность текстового кодировщика",
    tooltip: "Точность текстового кодировщика"
  },
  "tls-certfile": {
    name: "TLS сертификат: Путь к TLS сертификату для HTTPS"
  },
  "tls-keyfile": {
    name: "TLS ключевой файл: Путь к TLS ключевому файлу для HTTPS"
  },
  "unet-precision": {
    name: "Точность UNET",
    tooltip: "Точность UNET"
  },
  "vae-precision": {
    name: "Точность VAE",
    tooltip: "Точность VAE"
  },
  "vram-management": {
    name: "Режим управления VRAM"
  }
};
const serverStart$1 = {
  openLogs: "Открыть логи",
  process: {
    error: "Не удалось запустить ComfyUI Desktop",
    "initial-state": "Загрузка...",
    "python-setup": "Настройка окружения Python...",
    ready: "Завершение...",
    "starting-server": "Запуск сервера ComfyUI..."
  },
  reinstall: "Переустановить",
  reportIssue: "Сообщить о проблеме",
  showTerminal: "Показать терминал"
};
const settingsCategories$1 = {
  About: "О программе",
  Appearance: "Внешний вид",
  BrushAdjustment: "Настройка кисти",
  Canvas: "Холст",
  ColorPalette: "Цветовая палитра",
  Comfy: "Comfy",
  "Comfy-Desktop": "Comfy рабочий стол",
  CustomColorPalettes: "Пользовательские цветовые палитры",
  DevMode: "Режим разработчика",
  EditTokenWeight: "Редактировать вес токена",
  Extension: "Расширение",
  General: "Общие",
  Graph: "Граф",
  Group: "Группа",
  Keybinding: "Сочетание клавиш",
  Link: "Ссылка",
  LinkRelease: "Освобождение ссылки",
  LiteGraph: "Lite Graph",
  Locale: "Локализация",
  "Mask Editor": "Редактор масок",
  Menu: "Меню",
  ModelLibrary: "Библиотека моделей",
  NewEditor: "Новый редактор",
  Node: "Узел",
  "Node Search Box": "Поисковая строка узлов",
  "Node Widget": "Виджет узла",
  NodeInputConversionSubmenus: "Подменю преобразования ввода узла",
  NodeLibrary: "Библиотека узлов",
  Pointer: "Указатель",
  Queue: "Очередь",
  QueueButton: "Кнопка очереди",
  RerouteBeta: "Бета-версия перенаправления",
  Server: "Сервер",
  "Server-Config": "Настройки сервера",
  Settings: "Настройки",
  Sidebar: "Боковая панель",
  "Tree Explorer": "Дерево проводника",
  Validation: "Валидация",
  Window: "Окно",
  Workflow: "Рабочий процесс"
};
const sideToolbar$1 = {
  browseTemplates: "Просмотреть примеры шаблонов",
  downloads: "Загрузки",
  logout: "Выйти",
  modelLibrary: "Библиотека моделей",
  newBlankWorkflow: "Создайте новый пустой рабочий процесс",
  nodeLibrary: "Библиотека узлов",
  nodeLibraryTab: {
    sortOrder: "Порядок сортировки"
  },
  openWorkflow: "Открыть рабочий процесс в локальной файловой системе",
  queue: "Очередь",
  queueTab: {
    backToAllTasks: "Вернуться ко всем задачам",
    clearPendingTasks: "Очистить отложенные задачи",
    containImagePreview: "Предпросмотр заливающего изображения",
    coverImagePreview: "Предпросмотр подходящего изображения",
    filter: "Фильтровать выводы",
    filters: {
      hideCached: "Скрыть кэшированные",
      hideCanceled: "Скрыть отмененные"
    },
    showFlatList: "Показать плоский список"
  },
  themeToggle: "Переключить тему",
  workflowTab: {
    confirmDelete: "Вы уверены, что хотите удалить этот рабочий процесс?",
    confirmDeleteTitle: "Удалить рабочий процесс?",
    confirmOverwrite: "Файл ниже уже существует. Вы хотите его перезаписать?",
    confirmOverwriteTitle: "Перезаписать существующий файл?",
    deleteFailed: "Попытка удалить рабочий процесс не удалась.",
    deleteFailedTitle: "Не удалось удалить",
    deleted: "Рабочий процесс удален",
    dirtyClose: "Файлы ниже были изменены. Вы хотите сохранить их перед закрытием?",
    dirtyCloseTitle: "Сохранить изменения?",
    workflowTreeType: {
      bookmarks: "Закладки",
      browse: "Просмотреть",
      open: "Открыть"
    }
  },
  workflows: "Рабочие процессы"
};
const tabMenu$1 = {
  closeOtherTabs: "Закрыть другие вкладки",
  closeTab: "Закрыть вкладку",
  closeTabsToLeft: "Закрыть вкладки слева",
  closeTabsToRight: "Закрыть вкладки справа",
  duplicateTab: "Дублировать вкладку"
};
const templateWorkflows$1 = {
  template: {
    "default": "Image Generation",
    flux_schnell: "Flux Schnell",
    image2image: "Image to Image",
    upscale: "2 Pass Upscale"
  },
  title: "Начните работу с шаблона"
};
const userSelect$1 = {
  enterUsername: "Введите имя пользователя",
  existingUser: "Существующий пользователь",
  newUser: "Новый пользователь",
  next: "Далее",
  selectUser: "Выберите пользователя"
};
const welcome$1 = {
  getStarted: "Начать",
  title: "Добро пожаловать в ComfyUI"
};
const workflowService$1 = {
  enterFilename: "Введите имя файла",
  exportWorkflow: "Экспорт рабочего процесса",
  saveWorkflow: "Сохранить рабочий процесс"
};
const ru = {
  color: color$1,
  dataTypes: dataTypes$1,
  desktopMenu: desktopMenu$1,
  downloadGit: downloadGit$1,
  electronFileDownload: electronFileDownload$1,
  g: g$1,
  graphCanvasMenu: graphCanvasMenu$1,
  groupNode: groupNode$1,
  icon: icon$1,
  install: install$1,
  menu: menu$1,
  menuLabels: menuLabels$1,
  nodeCategories: nodeCategories$1,
  nodeTemplates: nodeTemplates$1,
  notSupported: notSupported$1,
  serverConfig: serverConfig$1,
  serverConfigCategories: serverConfigCategories$1,
  serverConfigItems: serverConfigItems$1,
  serverStart: serverStart$1,
  settingsCategories: settingsCategories$1,
  sideToolbar: sideToolbar$1,
  tabMenu: tabMenu$1,
  templateWorkflows: templateWorkflows$1,
  userSelect: userSelect$1,
  welcome: welcome$1,
  workflowService: workflowService$1
};
const AddNoise$1 = {
  display_name: "Добавить шум",
  inputs: {
    latent_image: {
      name: "латентное_изображение"
    },
    model: {
      name: "модель"
    },
    noise: {
      name: "шум"
    },
    sigmas: {
      name: "сигмы"
    }
  }
};
const AlignYourStepsScheduler$1 = {
  display_name: "Планировщик выравнивания шагов",
  inputs: {
    denoise: {
      name: "денойз"
    },
    model_type: {
      name: "тип_модели"
    },
    steps: {
      name: "шаги"
    }
  }
};
const BasicGuider$1 = {
  display_name: "Основной гид",
  inputs: {
    conditioning: {
      name: "кондиционирование"
    },
    model: {
      name: "модель"
    }
  }
};
const BasicScheduler$1 = {
  display_name: "Основной планировщик",
  inputs: {
    denoise: {
      name: "денойз"
    },
    model: {
      name: "модель"
    },
    scheduler: {
      name: "планировщик"
    },
    steps: {
      name: "шаги"
    }
  }
};
const BetaSamplingScheduler$1 = {
  display_name: "Планировщик выборки Бета",
  inputs: {
    alpha: {
      name: "альфа"
    },
    beta: {
      name: "бета"
    },
    model: {
      name: "модель"
    },
    steps: {
      name: "шаги"
    }
  }
};
const CFGGuider$1 = {
  display_name: "CFG Гид",
  inputs: {
    cfg: {
      name: "cfg"
    },
    model: {
      name: "модель"
    },
    negative: {
      name: "отрицательный"
    },
    positive: {
      name: "положительный"
    }
  }
};
const CLIPAttentionMultiply$1 = {
  display_name: "Умножение внимания CLIP",
  inputs: {
    clip: {
      name: "clip"
    },
    k: {
      name: "k"
    },
    out: {
      name: "выход"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const CLIPLoader$1 = {
  description: "[Рецепты]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 / clip-g / clip-l\nstable_audio: t5\nmochi: t5",
  display_name: "Загрузить CLIP",
  inputs: {
    clip_name: {
      name: "имя_clip"
    },
    type: {
      name: "тип"
    }
  }
};
const CLIPMergeAdd$1 = {
  display_name: "Сложение CLIP",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    }
  }
};
const CLIPMergeSimple$1 = {
  display_name: "Простое слияние CLIP",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    ratio: {
      name: "соотношение"
    }
  }
};
const CLIPMergeSubtract$1 = {
  display_name: "Вычитание CLIP",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    multiplier: {
      name: "множитель"
    }
  }
};
const CLIPSave$1 = {
  display_name: "Сохранить CLIP",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "префикс_имени_файла"
    }
  }
};
const CLIPSetLastLayer$1 = {
  display_name: "Установить последний слой CLIP",
  inputs: {
    clip: {
      name: "clip"
    },
    stop_at_clip_layer: {
      name: "остановиться_на_clip_слое"
    }
  }
};
const CLIPTextEncode$1 = {
  description: "Кодирует текстовый запрос с помощью модели CLIP в вектор, который можно использовать для управления моделью диффузии для генерации конкретных изображений.",
  display_name: "Кодирование текста CLIP (Запрос)",
  inputs: {
    clip: {
      name: "clip",
      tooltip: "Модель CLIP, используемая для кодирования текста."
    },
    text: {
      name: "текст",
      tooltip: "Текст для кодирования."
    }
  },
  outputs: {
    "0": {
      tooltip: "Условие, содержащее встроенный текст, используемое для управления моделью диффузии."
    }
  }
};
const CLIPTextEncodeControlnet$1 = {
  display_name: "Кодирование текста CLIP для Controlnet",
  inputs: {
    clip: {
      name: "clip"
    },
    conditioning: {
      name: "кондиционирование"
    },
    text: {
      name: "текст"
    }
  }
};
const CLIPTextEncodeFlux$1 = {
  display_name: "Кодирование текста CLIP Flux",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_l: {
      name: "clip_l"
    },
    guidance: {
      name: "руководство"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeHunyuanDiT$1 = {
  display_name: "Кодирование текста CLIP HunyuanDiT",
  inputs: {
    bert: {
      name: "bert"
    },
    clip: {
      name: "clip"
    },
    mt5xl: {
      name: "mt5xl"
    }
  }
};
const CLIPTextEncodePixArtAlpha$1 = {
  description: "Кодирует текст и устанавливает условие разрешения для PixArt Alpha. Не применяется к PixArt Sigma.",
  display_name: "CLIPTextEncodePixArtAlpha",
  inputs: {
    clip: {
      name: "clip"
    },
    height: {
      name: "высота"
    },
    text: {
      name: "текст"
    },
    width: {
      name: "ширина"
    }
  }
};
const CLIPTextEncodeSD3$1 = {
  display_name: "Кодирование текста CLIP SD3",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_g: {
      name: "clip_g"
    },
    clip_l: {
      name: "clip_l"
    },
    empty_padding: {
      name: "пустое_заполнение"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeSDXL$1 = {
  display_name: "Кодирование текста CLIP SDXL",
  inputs: {
    clip: {
      name: "clip"
    },
    crop_h: {
      name: "обрезка_высоты"
    },
    crop_w: {
      name: "обрезка_ширины"
    },
    height: {
      name: "высота"
    },
    target_height: {
      name: "целевая_высота"
    },
    target_width: {
      name: "целевая_ширина"
    },
    text_g: {
      name: "текст_g"
    },
    text_l: {
      name: "текст_l"
    },
    width: {
      name: "ширина"
    }
  }
};
const CLIPTextEncodeSDXLRefiner$1 = {
  display_name: "Кодирование текста CLIP SDXL Refinement",
  inputs: {
    ascore: {
      name: "ascore"
    },
    clip: {
      name: "clip"
    },
    height: {
      name: "высота"
    },
    text: {
      name: "текст"
    },
    width: {
      name: "ширина"
    }
  }
};
const CLIPVisionEncode$1 = {
  display_name: "Кодирование видения CLIP",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    crop: {
      name: "обрезка"
    },
    image: {
      name: "изображение"
    }
  }
};
const CLIPVisionLoader$1 = {
  display_name: "Загрузить видение CLIP",
  inputs: {
    clip_name: {
      name: "имя_clip"
    }
  }
};
const Canny$1 = {
  display_name: "Канни",
  inputs: {
    high_threshold: {
      name: "верхний_порог"
    },
    image: {
      name: "изображение"
    },
    low_threshold: {
      name: "нижний_порог"
    }
  }
};
const CheckpointLoader$1 = {
  display_name: "Загрузить контрольную точку с конфигурацией (УСТАРЕЛО)",
  inputs: {
    ckpt_name: {
      name: "имя_точки_проверки"
    },
    config_name: {
      name: "имя_конфигурации"
    }
  }
};
const CheckpointLoaderSimple$1 = {
  description: "Загружает контрольную точку модели диффузии, модели диффузии используются для удаления шума из латентов.",
  display_name: "Загрузить контрольную точку",
  inputs: {
    ckpt_name: {
      name: "имя_точки_проверки",
      tooltip: "Имя контрольной точки (модели) для загрузки."
    }
  },
  outputs: {
    "0": {
      tooltip: "Модель, используемая для денойзинга латентов."
    },
    "1": {
      tooltip: "Модель CLIP, используемая для кодирования текстовых подсказок."
    },
    "2": {
      tooltip: "Модель VAE, используемая для кодирования и декодирования изображений из и в латентное пространство."
    }
  }
};
const CheckpointSave$1 = {
  display_name: "Сохранить контрольную точку",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "префикс_имени_файла"
    },
    model: {
      name: "модель"
    },
    vae: {
      name: "vae"
    }
  }
};
const CombineHooks2$1 = {
  display_name: "Объединить хуки [2]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    }
  }
};
const CombineHooks4$1 = {
  display_name: "Объединить хуки [4]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    },
    hooks_C: {
      name: "hooks_C"
    },
    hooks_D: {
      name: "hooks_D"
    }
  }
};
const CombineHooks8$1 = {
  display_name: "Объединить хуки [8]",
  inputs: {
    hooks_A: {
      name: "hooks_A"
    },
    hooks_B: {
      name: "hooks_B"
    },
    hooks_C: {
      name: "hooks_C"
    },
    hooks_D: {
      name: "hooks_D"
    },
    hooks_E: {
      name: "hooks_E"
    },
    hooks_F: {
      name: "hooks_F"
    },
    hooks_G: {
      name: "hooks_G"
    },
    hooks_H: {
      name: "hooks_H"
    }
  }
};
const ConditioningAverage$1 = {
  display_name: "Среднее кондиционирование",
  inputs: {
    conditioning_from: {
      name: "условие_от"
    },
    conditioning_to: {
      name: "условие_к"
    },
    conditioning_to_strength: {
      name: "сила_условия_к"
    }
  }
};
const ConditioningCombine$1 = {
  display_name: "Кондиционирование (Объединение)",
  inputs: {
    conditioning_1: {
      name: "условие_1"
    },
    conditioning_2: {
      name: "условие_2"
    }
  }
};
const ConditioningConcat$1 = {
  display_name: "Кондиционирование (Конкатенация)",
  inputs: {
    conditioning_from: {
      name: "условие_от"
    },
    conditioning_to: {
      name: "условие_к"
    }
  }
};
const ConditioningSetArea$1 = {
  display_name: "Кондиционирование (Установить область)",
  inputs: {
    conditioning: {
      name: "условие"
    },
    height: {
      name: "высота"
    },
    strength: {
      name: "сила"
    },
    width: {
      name: "ширина"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaPercentage$1 = {
  display_name: "Кондиционирование (Установить область с процентом)",
  inputs: {
    conditioning: {
      name: "условие"
    },
    height: {
      name: "высота"
    },
    strength: {
      name: "сила"
    },
    width: {
      name: "ширина"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaStrength$1 = {
  display_name: "Сила установки области кондиционирования",
  inputs: {
    conditioning: {
      name: "условие"
    },
    strength: {
      name: "сила"
    }
  }
};
const ConditioningSetDefaultCombine$1 = {
  display_name: "Установить значение по умолчанию для объединения кондиционирования",
  inputs: {
    cond: {
      name: "условие"
    },
    cond_DEFAULT: {
      name: "условие_ПО_УМОЛЧАНИЮ"
    },
    hooks: {
      name: "hooks"
    }
  }
};
const ConditioningSetMask$1 = {
  display_name: "Кондиционирование (Установить маску)",
  inputs: {
    conditioning: {
      name: "условие"
    },
    mask: {
      name: "маска"
    },
    set_cond_area: {
      name: "установить_область_условия"
    },
    strength: {
      name: "сила"
    }
  }
};
const ConditioningSetProperties$1 = {
  display_name: "Установить свойства кондиционирования",
  inputs: {
    cond_NEW: {
      name: "новое_условие"
    },
    hooks: {
      name: "hooks"
    },
    mask: {
      name: "маска"
    },
    set_cond_area: {
      name: "установить_область_условия"
    },
    strength: {
      name: "сила"
    },
    timesteps: {
      name: "временные_шаги"
    }
  }
};
const ConditioningSetPropertiesAndCombine$1 = {
  display_name: "Установить свойства кондиционирования и объединить",
  inputs: {
    cond: {
      name: "условие"
    },
    cond_NEW: {
      name: "новое_условие"
    },
    hooks: {
      name: "hooks"
    },
    mask: {
      name: "маска"
    },
    set_cond_area: {
      name: "установить_область_условия"
    },
    strength: {
      name: "сила"
    },
    timesteps: {
      name: "временные_шаги"
    }
  }
};
const ConditioningSetTimestepRange$1 = {
  display_name: "Установить диапазон временных шагов кондиционирования",
  inputs: {
    conditioning: {
      name: "условие"
    },
    end: {
      name: "конец"
    },
    start: {
      name: "начало"
    }
  }
};
const ConditioningStableAudio$1 = {
  display_name: "ConditioningStableAudio",
  inputs: {
    negative: {
      name: "отрицательный"
    },
    positive: {
      name: "положительный"
    },
    seconds_start: {
      name: "секунды_начала"
    },
    seconds_total: {
      name: "всего_секунд"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const ConditioningTimestepsRange$1 = {
  display_name: "Диапазон временных шагов",
  inputs: {
    end_percent: {
      name: "процент_конца"
    },
    start_percent: {
      name: "процент_начала"
    }
  },
  outputs: {
    "1": {
      name: "ДО_ДИАПАЗОНА"
    },
    "2": {
      name: "ПОСЛЕ_ДИАПАЗОНА"
    }
  }
};
const ConditioningZeroOut$1 = {
  display_name: "Обнуление кондиционирования",
  inputs: {
    conditioning: {
      name: "условие"
    }
  }
};
const ControlNetApply$1 = {
  display_name: "Применить ControlNet (СТАРОЕ)",
  inputs: {
    conditioning: {
      name: "условие"
    },
    control_net: {
      name: "control_net"
    },
    image: {
      name: "изображение"
    },
    strength: {
      name: "сила"
    }
  }
};
const ControlNetApplyAdvanced$1 = {
  display_name: "Применить ControlNet",
  inputs: {
    control_net: {
      name: "control_net"
    },
    end_percent: {
      name: "процент_конца"
    },
    image: {
      name: "изображение"
    },
    negative: {
      name: "отрицательный"
    },
    positive: {
      name: "положительный"
    },
    start_percent: {
      name: "процент_начала"
    },
    strength: {
      name: "сила"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const ControlNetApplySD3$1 = {
  display_name: "Применить ControlNet с VAE",
  inputs: {
    control_net: {
      name: "control_net"
    },
    end_percent: {
      name: "процент_конца"
    },
    image: {
      name: "изображение"
    },
    negative: {
      name: "отрицательный"
    },
    positive: {
      name: "положительный"
    },
    start_percent: {
      name: "процент_начала"
    },
    strength: {
      name: "сила"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const ControlNetInpaintingAliMamaApply$1 = {
  display_name: "Применить ControlNet для инпейнтинга AliMama",
  inputs: {
    control_net: {
      name: "control_net"
    },
    end_percent: {
      name: "процент_конца"
    },
    image: {
      name: "изображение"
    },
    mask: {
      name: "маска"
    },
    negative: {
      name: "отрицательный"
    },
    positive: {
      name: "положительный"
    },
    start_percent: {
      name: "процент_начала"
    },
    strength: {
      name: "сила"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const ControlNetLoader$1 = {
  display_name: "Загрузить модель ControlNet",
  inputs: {
    control_net_name: {
      name: "имя_control_net"
    }
  }
};
const CreateHookKeyframe$1 = {
  display_name: "Создать ключевой кадр хука",
  inputs: {
    prev_hook_kf: {
      name: "предыдущий_hook_kf"
    },
    start_percent: {
      name: "процент_начала"
    },
    strength_mult: {
      name: "множитель_силы"
    }
  },
  outputs: {
    "0": {
      name: "КЛЮЧЕВОЙ_КАДР"
    }
  }
};
const CreateHookKeyframesFromFloats$1 = {
  display_name: "Создать ключевые кадры хука из чисел с плавающей запятой",
  inputs: {
    end_percent: {
      name: "процент_конца"
    },
    floats_strength: {
      name: "сила_в_виде_чисел"
    },
    prev_hook_kf: {
      name: "предыдущий_hook_kf"
    },
    print_keyframes: {
      name: "печать_ключевых_кадров"
    },
    start_percent: {
      name: "процент_начала"
    }
  },
  outputs: {
    "0": {
      name: "КЛЮЧЕВОЙ_КАДР"
    }
  }
};
const CreateHookKeyframesInterpolated$1 = {
  display_name: "Создать интерполированные ключевые кадры хука",
  inputs: {
    end_percent: {
      name: "конечный_процент"
    },
    interpolation: {
      name: "интерполяция"
    },
    keyframes_count: {
      name: "количество_ключевых_кадров"
    },
    prev_hook_kf: {
      name: "предыдущий_хук_kf"
    },
    print_keyframes: {
      name: "печать_ключевых_кадров"
    },
    start_percent: {
      name: "начальный_процент"
    },
    strength_end: {
      name: "конечная_сила"
    },
    strength_start: {
      name: "начальная_сила"
    }
  },
  outputs: {
    "0": {
      name: "КЛЮЧЕВОЙ_КАДР"
    }
  }
};
const CreateHookLora$1 = {
  display_name: "Создать хук LoRA",
  inputs: {
    lora_name: {
      name: "имя_lora"
    },
    prev_hooks: {
      name: "предыдущие_хуки"
    },
    strength_clip: {
      name: "сила_клипа"
    },
    strength_model: {
      name: "сила_модели"
    }
  }
};
const CreateHookLoraModelOnly$1 = {
  display_name: "Создать хук LoRA (Только модель)",
  inputs: {
    lora_name: {
      name: "имя_lora"
    },
    prev_hooks: {
      name: "предыдущие_хуки"
    },
    strength_model: {
      name: "сила_модели"
    }
  }
};
const CreateHookModelAsLora$1 = {
  display_name: "Создать хук модели как LoRA",
  inputs: {
    ckpt_name: {
      name: "имя_ckpt"
    },
    prev_hooks: {
      name: "предыдущие_хуки"
    },
    strength_clip: {
      name: "сила_клипа"
    },
    strength_model: {
      name: "сила_модели"
    }
  }
};
const CreateHookModelAsLoraModelOnly$1 = {
  display_name: "Создать хук модели как LoRA (Только модель)",
  inputs: {
    ckpt_name: {
      name: "имя_ckpt"
    },
    prev_hooks: {
      name: "предыдущие_хуки"
    },
    strength_model: {
      name: "сила_модели"
    }
  }
};
const CropMask$1 = {
  display_name: "Обрезать маску",
  inputs: {
    height: {
      name: "высота"
    },
    mask: {
      name: "маска"
    },
    width: {
      name: "ширина"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const DevToolsDeprecatedNode$1 = {
  description: "Устаревший узел",
  display_name: "Устаревший узел"
};
const DevToolsErrorRaiseNode$1 = {
  description: "Выбросить ошибку для целей разработки",
  display_name: "Выбросить ошибку"
};
const DevToolsErrorRaiseNodeWithMessage$1 = {
  description: "Выбросить ошибку с сообщением для целей разработки",
  display_name: "Выбросить ошибку с сообщением",
  inputs: {
    message: {
      name: "сообщение"
    }
  }
};
const DevToolsExperimentalNode$1 = {
  description: "Экспериментальный узел",
  display_name: "Экспериментальный узел"
};
const DevToolsLongComboDropdown$1 = {
  description: "Длинный комбинированный выпадающий список",
  display_name: "Длинный комбинированный выпадающий список",
  inputs: {
    option: {
      name: "опция"
    }
  }
};
const DevToolsNodeWithForceInput$1 = {
  description: "Узел с принудительным вводом",
  display_name: "Узел с принудительным вводом",
  inputs: {
    float_input: {
      name: "ввод_float"
    },
    int_input: {
      name: "ввод_int"
    },
    int_input_widget: {
      name: "виджет_ввода_int"
    }
  }
};
const DevToolsNodeWithOnlyOptionalInput$1 = {
  description: "Узел только с необязательным вводом",
  display_name: "Узел только с необязательным вводом",
  inputs: {
    clip: {
      name: "клип"
    },
    text: {
      name: "текст"
    }
  }
};
const DevToolsNodeWithOptionalInput$1 = {
  description: "Узел с необязательным вводом",
  display_name: "Узел с необязательным вводом",
  inputs: {
    optional_input: {
      name: "необязательный_ввод"
    },
    required_input: {
      name: "необходимый_ввод"
    }
  }
};
const DevToolsNodeWithOutputList$1 = {
  description: "Узел с выходным списком",
  display_name: "Узел с выходным списком",
  outputs: {
    "0": {
      name: "ЦЕЛОЧИСЛЬНЫЙ_ВЫХОД"
    },
    "1": {
      name: "СПИСОК_ЦЕЛЫХ_ЧИСЕЛ"
    }
  }
};
const DevToolsNodeWithStringInput$1 = {
  description: "Узел со строковым вводом",
  display_name: "Узел со строковым вводом",
  inputs: {
    string_input: {
      name: "ввод_строки"
    }
  }
};
const DevToolsNodeWithUnionInput$1 = {
  description: "Узел с объединённым вводом",
  display_name: "Узел с объединённым вводом",
  inputs: {
    int_input: {
      name: "ввод_int"
    },
    string_input: {
      name: "ввод_строки"
    },
    string_or_int_input: {
      name: "ввод_строки_или_int"
    }
  }
};
const DevToolsSimpleSlider$1 = {
  display_name: "Простой Слайдер",
  inputs: {
    value: {
      name: "значение"
    }
  }
};
const DiffControlNetLoader$1 = {
  display_name: "Загрузить модель ControlNet (дифф)",
  inputs: {
    control_net_name: {
      name: "имя_сети_управления"
    },
    model: {
      name: "модель"
    }
  }
};
const DifferentialDiffusion$1 = {
  display_name: "Дифференциальная диффузия",
  inputs: {
    model: {
      name: "модель"
    }
  }
};
const DiffusersLoader$1 = {
  display_name: "Загрузчик диффузоров",
  inputs: {
    model_path: {
      name: "путь_модели"
    }
  }
};
const DisableNoise$1 = {
  display_name: "Отключить шум"
};
const DualCFGGuider$1 = {
  display_name: "Двойной CFG Гид",
  inputs: {
    cfg_cond2_negative: {
      name: "cfg_cond2_negative"
    },
    cfg_conds: {
      name: "cfg_conds"
    },
    cond1: {
      name: "cond1"
    },
    cond2: {
      name: "cond2"
    },
    model: {
      name: "модель"
    },
    negative: {
      name: "отрицательный"
    }
  }
};
const DualCLIPLoader$1 = {
  description: "[Рецепты]\n\nsdxl: clip-l, clip-g\nsd3: clip-l, clip-g / clip-l, t5 / clip-g, t5\nflux: clip-l, t5",
  display_name: "Двойной загрузчик CLIP",
  inputs: {
    clip_name1: {
      name: "clip_name1"
    },
    clip_name2: {
      name: "clip_name2"
    },
    type: {
      name: "тип"
    }
  }
};
const EmptyHunyuanLatentVideo$1 = {
  display_name: "ПустойHunyuanLatentVideo",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    height: {
      name: "высота"
    },
    length: {
      name: "длина"
    },
    width: {
      name: "ширина"
    }
  }
};
const EmptyImage$1 = {
  display_name: "Пустое изображение",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    color: {
      name: "цвет"
    },
    height: {
      name: "высота"
    },
    width: {
      name: "ширина"
    }
  }
};
const EmptyLTXVLatentVideo$1 = {
  display_name: "Пустое латентное видео LTXV",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    height: {
      name: "высота"
    },
    length: {
      name: "длина"
    },
    width: {
      name: "ширина"
    }
  }
};
const EmptyLatentAudio$1 = {
  display_name: "Пустой латентный аудио",
  inputs: {
    batch_size: {
      name: "размер_пакета",
      tooltip: "Количество латентных изображений в партии."
    },
    seconds: {
      name: "секунды"
    }
  }
};
const EmptyLatentImage$1 = {
  description: "Создает новую партию пустых латентных изображений для удаления шума через выборку.",
  display_name: "Пустое латентное изображение",
  inputs: {
    batch_size: {
      name: "размер_пакета",
      tooltip: "Количество латентных изображений в партии."
    },
    height: {
      name: "высота",
      tooltip: "Высота латентных изображений в пикселях."
    },
    width: {
      name: "ширина",
      tooltip: "Ширина латентных изображений в пикселях."
    }
  },
  outputs: {
    "0": {
      tooltip: "Пустая партия латентных изображений."
    }
  }
};
const EmptyMochiLatentVideo$1 = {
  display_name: "Пустое латентное видео Mochi",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    height: {
      name: "высота"
    },
    length: {
      name: "длина"
    },
    width: {
      name: "ширина"
    }
  }
};
const EmptySD3LatentImage$1 = {
  display_name: "Пустое латентное изображение SD3",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    height: {
      name: "высота"
    },
    width: {
      name: "ширина"
    }
  }
};
const ExponentialScheduler$1 = {
  display_name: "Экспоненциальный планировщик",
  inputs: {
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "шаги"
    }
  }
};
const FeatherMask$1 = {
  display_name: "Пернатая маска",
  inputs: {
    bottom: {
      name: "снизу"
    },
    left: {
      name: "слева"
    },
    mask: {
      name: "маска"
    },
    right: {
      name: "справа"
    },
    top: {
      name: "сверху"
    }
  }
};
const FlipSigmas$1 = {
  display_name: "Перевернуть сигмы",
  inputs: {
    sigmas: {
      name: "sigmas"
    }
  }
};
const FluxGuidance$1 = {
  display_name: "Направление Flux",
  inputs: {
    conditioning: {
      name: "условие"
    },
    guidance: {
      name: "руководство"
    }
  }
};
const FreeU$1 = {
  display_name: "FreeU",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "модель"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const FreeU_V2$1 = {
  display_name: "FreeU_V2",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "модель"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const GITSScheduler$1 = {
  display_name: "GITSScheduler",
  inputs: {
    coeff: {
      name: "коэфф"
    },
    denoise: {
      name: "шумоподавление"
    },
    steps: {
      name: "шаги"
    }
  }
};
const GLIGENLoader$1 = {
  display_name: "Загрузчик GLIGEN",
  inputs: {
    gligen_name: {
      name: "имя_gligen"
    }
  }
};
const GLIGENTextBoxApply$1 = {
  display_name: "Применить текстовое поле GLIGEN",
  inputs: {
    clip: {
      name: "клип"
    },
    conditioning_to: {
      name: "условие_для"
    },
    gligen_textbox_model: {
      name: "модель_текстового_поля_gligen"
    },
    height: {
      name: "высота"
    },
    text: {
      name: "текст"
    },
    width: {
      name: "ширина"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const GrowMask$1 = {
  display_name: "Увеличить маску",
  inputs: {
    expand: {
      name: "расширить"
    },
    mask: {
      name: "маска"
    },
    tapered_corners: {
      name: "заостренные_углы"
    }
  }
};
const HyperTile$1 = {
  display_name: "Гиперплитка",
  inputs: {
    max_depth: {
      name: "максимальная_глубина"
    },
    model: {
      name: "модель"
    },
    scale_depth: {
      name: "масштаб_глубины"
    },
    swap_size: {
      name: "размер_замены"
    },
    tile_size: {
      name: "размер_плитки"
    }
  }
};
const HypernetworkLoader$1 = {
  display_name: "Загрузчик гиперсети",
  inputs: {
    hypernetwork_name: {
      name: "имя_гиперсети"
    },
    model: {
      name: "модель"
    },
    strength: {
      name: "сила"
    }
  }
};
const ImageBatch$1 = {
  display_name: "Партия изображений",
  inputs: {
    image1: {
      name: "изображение1"
    },
    image2: {
      name: "изображение2"
    }
  }
};
const ImageBlend$1 = {
  display_name: "Смешивание изображений",
  inputs: {
    blend_factor: {
      name: "фактор_смешивания"
    },
    blend_mode: {
      name: "режим_смешивания"
    },
    image1: {
      name: "изображение1"
    },
    image2: {
      name: "изображение2"
    }
  }
};
const ImageBlur$1 = {
  display_name: "Размытие изображения",
  inputs: {
    blur_radius: {
      name: "радиус_размытия"
    },
    image: {
      name: "изображение"
    },
    sigma: {
      name: "сигма"
    }
  }
};
const ImageColorToMask$1 = {
  display_name: "Цвет изображения в маску",
  inputs: {
    color: {
      name: "цвет"
    },
    image: {
      name: "изображение"
    }
  }
};
const ImageCompositeMasked$1 = {
  display_name: "Составное изображение с маской",
  inputs: {
    destination: {
      name: "назначение"
    },
    mask: {
      name: "маска"
    },
    resize_source: {
      name: "изменить_размер_источника"
    },
    source: {
      name: "источник"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageCrop$1 = {
  display_name: "Обрезка изображения",
  inputs: {
    height: {
      name: "высота"
    },
    image: {
      name: "изображение"
    },
    width: {
      name: "ширина"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageFromBatch$1 = {
  display_name: "Изображение из партии",
  inputs: {
    batch_index: {
      name: "индекс_пакета"
    },
    image: {
      name: "изображение"
    },
    length: {
      name: "длина"
    }
  }
};
const ImageInvert$1 = {
  display_name: "Инвертировать изображение",
  inputs: {
    image: {
      name: "изображение"
    }
  }
};
const ImageOnlyCheckpointLoader$1 = {
  display_name: "Загрузчик контрольной точки только для изображения (модель img2vid)",
  inputs: {
    ckpt_name: {
      name: "имя_ckpt"
    }
  }
};
const ImageOnlyCheckpointSave$1 = {
  display_name: "Сохранить только контрольную точку изображения",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    filename_prefix: {
      name: "префикс_имени_файла"
    },
    model: {
      name: "модель"
    },
    vae: {
      name: "vae"
    }
  }
};
const ImagePadForOutpaint$1 = {
  display_name: "Добавить поля к изображению для выкрашивания",
  inputs: {
    bottom: {
      name: "снизу"
    },
    feathering: {
      name: "смягчение"
    },
    image: {
      name: "изображение"
    },
    left: {
      name: "слева"
    },
    right: {
      name: "справа"
    },
    top: {
      name: "сверху"
    }
  }
};
const ImageQuantize$1 = {
  display_name: "Квантизация изображения",
  inputs: {
    colors: {
      name: "цвета"
    },
    dither: {
      name: "дизеринг"
    },
    image: {
      name: "изображение"
    }
  }
};
const ImageScale$1 = {
  display_name: "Масштабировать изображение",
  inputs: {
    crop: {
      name: "обрезка"
    },
    height: {
      name: "высота"
    },
    image: {
      name: "изображение"
    },
    upscale_method: {
      name: "метод_увеличения"
    },
    width: {
      name: "ширина"
    }
  }
};
const ImageScaleBy$1 = {
  display_name: "Масштабировать изображение на",
  inputs: {
    image: {
      name: "изображение"
    },
    scale_by: {
      name: "увеличить_на"
    },
    upscale_method: {
      name: "метод_увеличения"
    }
  }
};
const ImageScaleToTotalPixels$1 = {
  display_name: "Масштабировать изображение до общего количества пикселей",
  inputs: {
    image: {
      name: "изображение"
    },
    megapixels: {
      name: "мегапиксели"
    },
    upscale_method: {
      name: "метод_увеличения"
    }
  }
};
const ImageSharpen$1 = {
  display_name: "Резкость изображения",
  inputs: {
    alpha: {
      name: "альфа"
    },
    image: {
      name: "изображение"
    },
    sharpen_radius: {
      name: "радиус_резкости"
    },
    sigma: {
      name: "сигма"
    }
  }
};
const ImageToMask$1 = {
  display_name: "Преобразовать изображение в маску",
  inputs: {
    channel: {
      name: "канал"
    },
    image: {
      name: "изображение"
    }
  }
};
const ImageUpscaleWithModel$1 = {
  display_name: "Увеличить изображение (с использованием модели)",
  inputs: {
    image: {
      name: "изображение"
    },
    upscale_model: {
      name: "модель_увеличения"
    }
  }
};
const InpaintModelConditioning$1 = {
  display_name: "Кондиционирование модели инпейнтинга",
  inputs: {
    mask: {
      name: "маска"
    },
    negative: {
      name: "отрицательный"
    },
    noise_mask: {
      name: "шумовая_маска",
      tooltip: "Добавьте маску шума к латентному изображению, чтобы выборка происходила только в пределах маски. Это может улучшить результаты или полностью испортить их в зависимости от модели."
    },
    pixels: {
      name: "пиксели"
    },
    positive: {
      name: "положительный"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    },
    "2": {
      name: "латентный"
    }
  }
};
const InstructPixToPixConditioning$1 = {
  display_name: "Кондиционирование PixToPix",
  inputs: {
    negative: {
      name: "отрицательный"
    },
    pixels: {
      name: "пиксели"
    },
    positive: {
      name: "положительный"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    },
    "2": {
      name: "латентный"
    }
  }
};
const InvertMask$1 = {
  display_name: "Инвертировать маску",
  inputs: {
    mask: {
      name: "маска"
    }
  }
};
const JoinImageWithAlpha$1 = {
  display_name: "Объединить изображение с альфа-каналом",
  inputs: {
    alpha: {
      name: "альфа"
    },
    image: {
      name: "изображение"
    }
  }
};
const KSampler$1 = {
  description: "Использует предоставленную модель, положительное и отрицательное кондиционирование для удаления шума из латентного изображения.",
  display_name: "KSampler",
  inputs: {
    cfg: {
      name: "cfg",
      tooltip: "Масштаб без классификатора балансирует креативность и соблюдение запроса. Более высокие значения приводят к изображениям, более точно соответствующим запросу, однако слишком высокие значения негативно скажутся на качестве."
    },
    denoise: {
      name: "денойз",
      tooltip: "Количество уменьшения шума, более низкие значения сохранят структуру начального изображения, позволяя выборку изображений."
    },
    latent_image: {
      name: "латентное_изображение",
      tooltip: "Латентное изображение для уменьшения шума."
    },
    model: {
      name: "модель",
      tooltip: "Модель, используемая для уменьшения шума входного латентного изображения."
    },
    negative: {
      name: "отрицательный",
      tooltip: "Условие, описывающее атрибуты, которые вы хотите исключить из изображения."
    },
    positive: {
      name: "положительный",
      tooltip: "Условие, описывающее атрибуты, которые вы хотите включить в изображение."
    },
    sampler_name: {
      name: "имя_сэмплера",
      tooltip: "Алгоритм, используемый при выборке, это может повлиять на качество, скорость и стиль сгенерированного вывода."
    },
    scheduler: {
      name: "планировщик",
      tooltip: "Планировщик контролирует, как шум постепенно удаляется для формирования изображения."
    },
    seed: {
      name: "семя",
      tooltip: "Случайное семя, используемое для создания шума."
    },
    steps: {
      name: "шаги",
      tooltip: "Количество шагов, используемых в процессе уменьшения шума."
    }
  },
  outputs: {
    "0": {
      tooltip: "Денойзенный латент."
    }
  }
};
const KSamplerAdvanced$1 = {
  display_name: "KSampler (Расширенный)",
  inputs: {
    add_noise: {
      name: "добавить_шум"
    },
    cfg: {
      name: "cfg"
    },
    end_at_step: {
      name: "закончить_на_шаге"
    },
    latent_image: {
      name: "латентное_изображение"
    },
    model: {
      name: "модель"
    },
    negative: {
      name: "отрицательный"
    },
    noise_seed: {
      name: "семя_шума"
    },
    positive: {
      name: "положительный"
    },
    return_with_leftover_noise: {
      name: "вернуться_с_оставшимся_шумом"
    },
    sampler_name: {
      name: "имя_сэмплера"
    },
    scheduler: {
      name: "планировщик"
    },
    start_at_step: {
      name: "начать_с_шага"
    },
    steps: {
      name: "шаги"
    }
  }
};
const KSamplerSelect$1 = {
  display_name: "Выбор KSampler",
  inputs: {
    sampler_name: {
      name: "имя_сэмплера"
    }
  }
};
const KarrasScheduler$1 = {
  display_name: "Планировщик Карраса",
  inputs: {
    rho: {
      name: "ро"
    },
    sigma_max: {
      name: "максимальное_сигма"
    },
    sigma_min: {
      name: "минимальное_сигма"
    },
    steps: {
      name: "шаги"
    }
  }
};
const LTXVConditioning$1 = {
  display_name: "Кондиционирование LTXV",
  inputs: {
    frame_rate: {
      name: "частота_кадров"
    },
    negative: {
      name: "отрицательный"
    },
    positive: {
      name: "положительный"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const LTXVImgToVideo$1 = {
  display_name: "LTXVImgToVideo",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    height: {
      name: "высота"
    },
    image: {
      name: "изображение"
    },
    image_noise_scale: {
      name: "масштаб_шума_изображения",
      tooltip: "Количество шума, применяемого к латентному изображению."
    },
    length: {
      name: "длина"
    },
    negative: {
      name: "отрицательный"
    },
    positive: {
      name: "положительный"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "ширина"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    },
    "2": {
      name: "латентный"
    }
  }
};
const LTXVScheduler$1 = {
  display_name: "Планировщик LTXV",
  inputs: {
    base_shift: {
      name: "базовое_смещение"
    },
    latent: {
      name: "скрытый"
    },
    max_shift: {
      name: "максимальное_смещение"
    },
    steps: {
      name: "шаги"
    },
    stretch: {
      name: "растяжение",
      tooltip: "Растянуть сигмы, чтобы они находились в диапазоне [terminal, 1]."
    },
    terminal: {
      name: "терминал",
      tooltip: "Конечное значение сигм после растяжения."
    }
  }
};
const LaplaceScheduler$1 = {
  display_name: "Планировщик Лапласа",
  inputs: {
    beta: {
      name: "бета"
    },
    mu: {
      name: "мю"
    },
    sigma_max: {
      name: "максимальное_сигма"
    },
    sigma_min: {
      name: "минимальное_сигма"
    },
    steps: {
      name: "шаги"
    }
  }
};
const LatentAdd$1 = {
  display_name: "Добавить латент",
  inputs: {
    samples1: {
      name: "образцы1"
    },
    samples2: {
      name: "образцы2"
    }
  }
};
const LatentApplyOperation$1 = {
  display_name: "Применить операцию к латенту",
  inputs: {
    operation: {
      name: "операция"
    },
    samples: {
      name: "образцы"
    }
  }
};
const LatentApplyOperationCFG$1 = {
  display_name: "Применить операцию к латенту CFG",
  inputs: {
    model: {
      name: "модель"
    },
    operation: {
      name: "операция"
    }
  }
};
const LatentBatch$1 = {
  display_name: "Партия латентов",
  inputs: {
    samples1: {
      name: "образцы1"
    },
    samples2: {
      name: "образцы2"
    }
  }
};
const LatentBatchSeedBehavior$1 = {
  display_name: "Поведение семени партии латентов",
  inputs: {
    samples: {
      name: "образцы"
    },
    seed_behavior: {
      name: "поведение_семени"
    }
  }
};
const LatentBlend$1 = {
  display_name: "Смешивание латентов",
  inputs: {
    blend_factor: {
      name: "фактор_смешивания"
    },
    samples1: {
      name: "образцы1"
    },
    samples2: {
      name: "образцы2"
    }
  }
};
const LatentComposite$1 = {
  display_name: "Составной латент",
  inputs: {
    feather: {
      name: "перо"
    },
    samples_from: {
      name: "образцы_из"
    },
    samples_to: {
      name: "образцы_для"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCompositeMasked$1 = {
  display_name: "Составной латент с маской",
  inputs: {
    destination: {
      name: "назначение"
    },
    mask: {
      name: "маска"
    },
    resize_source: {
      name: "изменить_размер_источника"
    },
    source: {
      name: "источник"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCrop$1 = {
  display_name: "Обрезка латента",
  inputs: {
    height: {
      name: "высота"
    },
    samples: {
      name: "образцы"
    },
    width: {
      name: "ширина"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentFlip$1 = {
  display_name: "Перевернуть латент",
  inputs: {
    flip_method: {
      name: "метод_отражения"
    },
    samples: {
      name: "образцы"
    }
  }
};
const LatentFromBatch$1 = {
  display_name: "Латент из партии",
  inputs: {
    batch_index: {
      name: "индекс_пакета"
    },
    length: {
      name: "длина"
    },
    samples: {
      name: "образцы"
    }
  }
};
const LatentInterpolate$1 = {
  display_name: "Интерполяция латента",
  inputs: {
    ratio: {
      name: "соотношение"
    },
    samples1: {
      name: "образцы1"
    },
    samples2: {
      name: "образцы2"
    }
  }
};
const LatentMultiply$1 = {
  display_name: "Умножить латент",
  inputs: {
    multiplier: {
      name: "множитель"
    },
    samples: {
      name: "образцы"
    }
  }
};
const LatentOperationSharpen$1 = {
  display_name: "Операция латента: резкость",
  inputs: {
    alpha: {
      name: "альфа"
    },
    sharpen_radius: {
      name: "радиус_резкости"
    },
    sigma: {
      name: "сигма"
    }
  }
};
const LatentOperationTonemapReinhard$1 = {
  display_name: "Операция латента: тональная карта Рейнхарда",
  inputs: {
    multiplier: {
      name: "множитель"
    }
  }
};
const LatentRotate$1 = {
  display_name: "Повернуть латент",
  inputs: {
    rotation: {
      name: "вращение"
    },
    samples: {
      name: "образцы"
    }
  }
};
const LatentSubtract$1 = {
  display_name: "Вычесть латент",
  inputs: {
    samples1: {
      name: "образцы1"
    },
    samples2: {
      name: "образцы2"
    }
  }
};
const LatentUpscale$1 = {
  display_name: "Увеличить латент",
  inputs: {
    crop: {
      name: "обрезка"
    },
    height: {
      name: "высота"
    },
    samples: {
      name: "образцы"
    },
    upscale_method: {
      name: "метод_масштабирования"
    },
    width: {
      name: "ширина"
    }
  }
};
const LatentUpscaleBy$1 = {
  display_name: "Увеличить латент на",
  inputs: {
    samples: {
      name: "образцы"
    },
    scale_by: {
      name: "масштабировать_по"
    },
    upscale_method: {
      name: "метод_масштабирования"
    }
  }
};
const Load3D$1 = {
  display_name: "Загрузить 3D",
  inputs: {
    bg_color: {
      name: "цвет_фона"
    },
    camera_type: {
      name: "тип_камеры"
    },
    height: {
      name: "высота"
    },
    image: {
      name: "изображение"
    },
    light_intensity: {
      name: "интенсивность_света"
    },
    material: {
      name: "материал"
    },
    model_file: {
      name: "файл_модели"
    },
    show_grid: {
      name: "показать_сетку"
    },
    up_direction: {
      name: "направление_вверх"
    },
    view: {
      name: "вид"
    },
    width: {
      name: "ширина"
    }
  },
  outputs: {
    "0": {
      name: "изображение"
    },
    "1": {
      name: "маска"
    },
    "2": {
      name: "путь_сетки"
    }
  }
};
const Load3DAnimation$1 = {
  display_name: "Загрузить 3D - Анимация",
  inputs: {
    animation_speed: {
      name: "скорость_анимации"
    },
    bg_color: {
      name: "цвет_фона"
    },
    camera_type: {
      name: "тип_камеры"
    },
    height: {
      name: "высота"
    },
    image: {
      name: "изображение"
    },
    light_intensity: {
      name: "интенсивность_света"
    },
    material: {
      name: "материал"
    },
    model_file: {
      name: "файл_модели"
    },
    show_grid: {
      name: "показать_сетку"
    },
    up_direction: {
      name: "направление_вверх"
    },
    view: {
      name: "вид"
    },
    width: {
      name: "ширина"
    }
  },
  outputs: {
    "0": {
      name: "изображение"
    },
    "1": {
      name: "маска"
    },
    "2": {
      name: "путь_сетки"
    }
  }
};
const LoadAudio$1 = {
  display_name: "Загрузить аудио",
  inputs: {
    audio: {
      name: "аудио"
    }
  }
};
const LoadImage$1 = {
  display_name: "Загрузить изображение",
  inputs: {
    image: {
      name: "изображение"
    }
  }
};
const LoadImageMask$1 = {
  display_name: "Загрузить изображение (как маску)",
  inputs: {
    channel: {
      name: "канал"
    },
    image: {
      name: "изображение"
    }
  }
};
const LoadLatent$1 = {
  display_name: "Загрузить латент",
  inputs: {
    latent: {
      name: "скрытый"
    }
  }
};
const LoraLoader$1 = {
  description: "LoRA используются для изменения моделей диффузии и CLIP, изменяя способ, которым латенты удаляются от шума, например, применяя стили. Несколько узлов LoRA могут быть связаны вместе.",
  display_name: "Загрузить LoRA",
  inputs: {
    clip: {
      name: "клип",
      tooltip: "Модель CLIP, к которой будет применена LoRA."
    },
    lora_name: {
      name: "имя_lora",
      tooltip: "Имя LoRA."
    },
    model: {
      name: "модель",
      tooltip: "Диффузионная модель, к которой будет применена LoRA."
    },
    strength_clip: {
      name: "сила_клипа",
      tooltip: "Насколько сильно модифицировать модель CLIP. Это значение может быть отрицательным."
    },
    strength_model: {
      name: "сила_модели",
      tooltip: "Насколько сильно модифицировать диффузионную модель. Это значение может быть отрицательным."
    }
  },
  outputs: {
    "0": {
      tooltip: "Модифицированная модель диффузии."
    },
    "1": {
      tooltip: "Модифицированная модель CLIP."
    }
  }
};
const LoraLoaderModelOnly$1 = {
  description: "LoRA используются для изменения моделей диффузии и CLIP, изменяя способ, которым латенты удаляются от шума, например, применяя стили. Несколько узлов LoRA могут быть связаны вместе.",
  display_name: "Загрузчик LoRA (Только модель)",
  inputs: {
    lora_name: {
      name: "имя_lora"
    },
    model: {
      name: "модель"
    },
    strength_model: {
      name: "сила_модели"
    }
  },
  outputs: {
    "0": {
      tooltip: "Модифицированная модель диффузии."
    }
  }
};
const LoraSave$1 = {
  display_name: "Извлечь и сохранить LoRA",
  inputs: {
    bias_diff: {
      name: "разница_смещения"
    },
    filename_prefix: {
      name: "префикс_имени_файла"
    },
    lora_type: {
      name: "тип_lora"
    },
    model_diff: {
      name: "разница_модели",
      tooltip: "Вывод ModelSubtract, который будет преобразован в lora."
    },
    rank: {
      name: "ранг"
    },
    text_encoder_diff: {
      name: "разница_текстового_кодировщика",
      tooltip: "Вывод CLIPSubtract, который будет преобразован в lora."
    }
  }
};
const Mahiro$1 = {
  description: "Измените руководство, чтобы оно больше масштабировалось в 'направлении' положительного подсказки, а не разницы между отрицательной подсказкой.",
  display_name: "Mahiro настолько мила, что заслуживает лучшей функции руководства!! (。・ω・。)",
  inputs: {
    model: {
      name: "модель"
    }
  },
  outputs: {
    "0": {
      name: "исправленная_модель"
    }
  }
};
const MaskComposite$1 = {
  display_name: "Составная маска",
  inputs: {
    destination: {
      name: "назначение"
    },
    operation: {
      name: "операция"
    },
    source: {
      name: "источник"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const MaskToImage$1 = {
  display_name: "Преобразовать маску в изображение",
  inputs: {
    mask: {
      name: "маска"
    }
  }
};
const ModelMergeAdd$1 = {
  display_name: "Сложение моделей",
  inputs: {
    model1: {
      name: "модель1"
    },
    model2: {
      name: "модель2"
    }
  }
};
const ModelMergeAuraflow$1 = {
  display_name: "Слияние моделей Auraflow",
  inputs: {
    cond_seq_linear_: {
      name: "cond_seq_linear."
    },
    double_layers_0_: {
      name: "double_layers.0."
    },
    double_layers_1_: {
      name: "double_layers.1."
    },
    double_layers_2_: {
      name: "double_layers.2."
    },
    double_layers_3_: {
      name: "double_layers.3."
    },
    final_linear_: {
      name: "final_linear."
    },
    init_x_linear_: {
      name: "init_x_linear."
    },
    modF_: {
      name: "modF."
    },
    model1: {
      name: "модель1"
    },
    model2: {
      name: "модель2"
    },
    positional_encoding: {
      name: "позиционное кодирование"
    },
    register_tokens: {
      name: "регистрация токенов"
    },
    single_layers_0_: {
      name: "single_layers.0."
    },
    single_layers_10_: {
      name: "single_layers.10."
    },
    single_layers_11_: {
      name: "single_layers.11."
    },
    single_layers_12_: {
      name: "single_layers.12."
    },
    single_layers_13_: {
      name: "single_layers.13."
    },
    single_layers_14_: {
      name: "single_layers.14."
    },
    single_layers_15_: {
      name: "single_layers.15."
    },
    single_layers_16_: {
      name: "single_layers.16."
    },
    single_layers_17_: {
      name: "single_layers.17."
    },
    single_layers_18_: {
      name: "single_layers.18."
    },
    single_layers_19_: {
      name: "single_layers.19."
    },
    single_layers_1_: {
      name: "single_layers.1."
    },
    single_layers_20_: {
      name: "single_layers.20."
    },
    single_layers_21_: {
      name: "single_layers.21."
    },
    single_layers_22_: {
      name: "single_layers.22."
    },
    single_layers_23_: {
      name: "single_layers.23."
    },
    single_layers_24_: {
      name: "single_layers.24."
    },
    single_layers_25_: {
      name: "single_layers.25."
    },
    single_layers_26_: {
      name: "single_layers.26."
    },
    single_layers_27_: {
      name: "single_layers.27."
    },
    single_layers_28_: {
      name: "single_layers.28."
    },
    single_layers_29_: {
      name: "single_layers.29."
    },
    single_layers_2_: {
      name: "single_layers.2."
    },
    single_layers_30_: {
      name: "single_layers.30."
    },
    single_layers_31_: {
      name: "single_layers.31."
    },
    single_layers_3_: {
      name: "single_layers.3."
    },
    single_layers_4_: {
      name: "single_layers.4."
    },
    single_layers_5_: {
      name: "single_layers.5."
    },
    single_layers_6_: {
      name: "single_layers.6."
    },
    single_layers_7_: {
      name: "single_layers.7."
    },
    single_layers_8_: {
      name: "single_layers.8."
    },
    single_layers_9_: {
      name: "single_layers.9."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeBlocks$1 = {
  display_name: "Слияние блоков моделей",
  inputs: {
    input: {
      name: "вход"
    },
    middle: {
      name: "середина"
    },
    model1: {
      name: "модель1"
    },
    model2: {
      name: "модель2"
    },
    out: {
      name: "выход"
    }
  }
};
const ModelMergeFlux1$1 = {
  display_name: "Слияние моделей Flux1",
  inputs: {
    double_blocks_0_: {
      name: "double_blocks.0."
    },
    double_blocks_10_: {
      name: "double_blocks.10."
    },
    double_blocks_11_: {
      name: "double_blocks.11."
    },
    double_blocks_12_: {
      name: "double_blocks.12."
    },
    double_blocks_13_: {
      name: "double_blocks.13."
    },
    double_blocks_14_: {
      name: "double_blocks.14."
    },
    double_blocks_15_: {
      name: "double_blocks.15."
    },
    double_blocks_16_: {
      name: "double_blocks.16."
    },
    double_blocks_17_: {
      name: "double_blocks.17."
    },
    double_blocks_18_: {
      name: "double_blocks.18."
    },
    double_blocks_1_: {
      name: "double_blocks.1."
    },
    double_blocks_2_: {
      name: "double_blocks.2."
    },
    double_blocks_3_: {
      name: "double_blocks.3."
    },
    double_blocks_4_: {
      name: "double_blocks.4."
    },
    double_blocks_5_: {
      name: "double_blocks.5."
    },
    double_blocks_6_: {
      name: "double_blocks.6."
    },
    double_blocks_7_: {
      name: "double_blocks.7."
    },
    double_blocks_8_: {
      name: "double_blocks.8."
    },
    double_blocks_9_: {
      name: "double_blocks.9."
    },
    final_layer_: {
      name: "final_layer."
    },
    guidance_in: {
      name: "guidance_in"
    },
    img_in_: {
      name: "img_in."
    },
    model1: {
      name: "модель1"
    },
    model2: {
      name: "модель2"
    },
    single_blocks_0_: {
      name: "single_blocks.0."
    },
    single_blocks_10_: {
      name: "single_blocks.10."
    },
    single_blocks_11_: {
      name: "single_blocks.11."
    },
    single_blocks_12_: {
      name: "single_blocks.12."
    },
    single_blocks_13_: {
      name: "single_blocks.13."
    },
    single_blocks_14_: {
      name: "single_blocks.14."
    },
    single_blocks_15_: {
      name: "single_blocks.15."
    },
    single_blocks_16_: {
      name: "single_blocks.16."
    },
    single_blocks_17_: {
      name: "single_blocks.17."
    },
    single_blocks_18_: {
      name: "single_blocks.18."
    },
    single_blocks_19_: {
      name: "single_blocks.19."
    },
    single_blocks_1_: {
      name: "single_blocks.1."
    },
    single_blocks_20_: {
      name: "single_blocks.20."
    },
    single_blocks_21_: {
      name: "single_blocks.21."
    },
    single_blocks_22_: {
      name: "single_blocks.22."
    },
    single_blocks_23_: {
      name: "single_blocks.23."
    },
    single_blocks_24_: {
      name: "single_blocks.24."
    },
    single_blocks_25_: {
      name: "single_blocks.25."
    },
    single_blocks_26_: {
      name: "single_blocks.26."
    },
    single_blocks_27_: {
      name: "single_blocks.27."
    },
    single_blocks_28_: {
      name: "single_blocks.28."
    },
    single_blocks_29_: {
      name: "single_blocks.29."
    },
    single_blocks_2_: {
      name: "single_blocks.2."
    },
    single_blocks_30_: {
      name: "single_blocks.30."
    },
    single_blocks_31_: {
      name: "single_blocks.31."
    },
    single_blocks_32_: {
      name: "single_blocks.32."
    },
    single_blocks_33_: {
      name: "single_blocks.33."
    },
    single_blocks_34_: {
      name: "single_blocks.34."
    },
    single_blocks_35_: {
      name: "single_blocks.35."
    },
    single_blocks_36_: {
      name: "single_blocks.36."
    },
    single_blocks_37_: {
      name: "single_blocks.37."
    },
    single_blocks_3_: {
      name: "single_blocks.3."
    },
    single_blocks_4_: {
      name: "single_blocks.4."
    },
    single_blocks_5_: {
      name: "single_blocks.5."
    },
    single_blocks_6_: {
      name: "single_blocks.6."
    },
    single_blocks_7_: {
      name: "single_blocks.7."
    },
    single_blocks_8_: {
      name: "single_blocks.8."
    },
    single_blocks_9_: {
      name: "single_blocks.9."
    },
    time_in_: {
      name: "time_in."
    },
    txt_in_: {
      name: "txt_in."
    },
    vector_in_: {
      name: "vector_in."
    }
  }
};
const ModelMergeLTXV$1 = {
  display_name: "Слияние моделей LTXV",
  inputs: {
    adaln_single_: {
      name: "adaln_single."
    },
    caption_projection_: {
      name: "caption_projection."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    patchify_proj_: {
      name: "patchify_proj."
    },
    proj_out_: {
      name: "proj_out."
    },
    scale_shift_table: {
      name: "scale_shift_table"
    },
    transformer_blocks_0_: {
      name: "transformer_blocks.0."
    },
    transformer_blocks_10_: {
      name: "transformer_blocks.10."
    },
    transformer_blocks_11_: {
      name: "transformer_blocks.11."
    },
    transformer_blocks_12_: {
      name: "transformer_blocks.12."
    },
    transformer_blocks_13_: {
      name: "transformer_blocks.13."
    },
    transformer_blocks_14_: {
      name: "transformer_blocks.14."
    },
    transformer_blocks_15_: {
      name: "transformer_blocks.15."
    },
    transformer_blocks_16_: {
      name: "transformer_blocks.16."
    },
    transformer_blocks_17_: {
      name: "transformer_blocks.17."
    },
    transformer_blocks_18_: {
      name: "transformer_blocks.18."
    },
    transformer_blocks_19_: {
      name: "transformer_blocks.19."
    },
    transformer_blocks_1_: {
      name: "transformer_blocks.1."
    },
    transformer_blocks_20_: {
      name: "transformer_blocks.20."
    },
    transformer_blocks_21_: {
      name: "transformer_blocks.21."
    },
    transformer_blocks_22_: {
      name: "transformer_blocks.22."
    },
    transformer_blocks_23_: {
      name: "transformer_blocks.23."
    },
    transformer_blocks_24_: {
      name: "transformer_blocks.24."
    },
    transformer_blocks_25_: {
      name: "transformer_blocks.25."
    },
    transformer_blocks_26_: {
      name: "transformer_blocks.26."
    },
    transformer_blocks_27_: {
      name: "transformer_blocks.27."
    },
    transformer_blocks_2_: {
      name: "transformer_blocks.2."
    },
    transformer_blocks_3_: {
      name: "transformer_blocks.3."
    },
    transformer_blocks_4_: {
      name: "transformer_blocks.4."
    },
    transformer_blocks_5_: {
      name: "transformer_blocks.5."
    },
    transformer_blocks_6_: {
      name: "transformer_blocks.6."
    },
    transformer_blocks_7_: {
      name: "transformer_blocks.7."
    },
    transformer_blocks_8_: {
      name: "transformer_blocks.8."
    },
    transformer_blocks_9_: {
      name: "transformer_blocks.9."
    }
  }
};
const ModelMergeMochiPreview$1 = {
  display_name: "Предварительный просмотр слияния моделей Mochi",
  inputs: {
    blocks_0_: {
      name: "blocks.0."
    },
    blocks_10_: {
      name: "blocks.10."
    },
    blocks_11_: {
      name: "blocks.11."
    },
    blocks_12_: {
      name: "blocks.12."
    },
    blocks_13_: {
      name: "blocks.13."
    },
    blocks_14_: {
      name: "blocks.14."
    },
    blocks_15_: {
      name: "blocks.15."
    },
    blocks_16_: {
      name: "blocks.16."
    },
    blocks_17_: {
      name: "blocks.17."
    },
    blocks_18_: {
      name: "blocks.18."
    },
    blocks_19_: {
      name: "blocks.19."
    },
    blocks_1_: {
      name: "blocks.1."
    },
    blocks_20_: {
      name: "blocks.20."
    },
    blocks_21_: {
      name: "blocks.21."
    },
    blocks_22_: {
      name: "blocks.22."
    },
    blocks_23_: {
      name: "blocks.23."
    },
    blocks_24_: {
      name: "blocks.24."
    },
    blocks_25_: {
      name: "blocks.25."
    },
    blocks_26_: {
      name: "blocks.26."
    },
    blocks_27_: {
      name: "blocks.27."
    },
    blocks_28_: {
      name: "blocks.28."
    },
    blocks_29_: {
      name: "blocks.29."
    },
    blocks_2_: {
      name: "blocks.2."
    },
    blocks_30_: {
      name: "blocks.30."
    },
    blocks_31_: {
      name: "blocks.31."
    },
    blocks_32_: {
      name: "blocks.32."
    },
    blocks_33_: {
      name: "blocks.33."
    },
    blocks_34_: {
      name: "blocks.34."
    },
    blocks_35_: {
      name: "blocks.35."
    },
    blocks_36_: {
      name: "blocks.36."
    },
    blocks_37_: {
      name: "blocks.37."
    },
    blocks_38_: {
      name: "blocks.38."
    },
    blocks_39_: {
      name: "blocks.39."
    },
    blocks_3_: {
      name: "blocks.3."
    },
    blocks_40_: {
      name: "blocks.40."
    },
    blocks_41_: {
      name: "blocks.41."
    },
    blocks_42_: {
      name: "blocks.42."
    },
    blocks_43_: {
      name: "blocks.43."
    },
    blocks_44_: {
      name: "blocks.44."
    },
    blocks_45_: {
      name: "blocks.45."
    },
    blocks_46_: {
      name: "blocks.46."
    },
    blocks_47_: {
      name: "blocks.47."
    },
    blocks_4_: {
      name: "blocks.4."
    },
    blocks_5_: {
      name: "blocks.5."
    },
    blocks_6_: {
      name: "blocks.6."
    },
    blocks_7_: {
      name: "blocks.7."
    },
    blocks_8_: {
      name: "blocks.8."
    },
    blocks_9_: {
      name: "blocks.9."
    },
    final_layer_: {
      name: "final_layer."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    pos_frequencies_: {
      name: "pos_frequencies."
    },
    t5_y_embedder_: {
      name: "t5_y_embedder."
    },
    t5_yproj_: {
      name: "t5_yproj."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeSD1$1 = {
  display_name: "Слияние моделей SD1",
  inputs: {
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0_: {
      name: "middle_block.0."
    },
    middle_block_1_: {
      name: "middle_block.1."
    },
    middle_block_2_: {
      name: "middle_block.2."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0_: {
      name: "output_blocks.0."
    },
    output_blocks_10_: {
      name: "output_blocks.10."
    },
    output_blocks_11_: {
      name: "output_blocks.11."
    },
    output_blocks_1_: {
      name: "output_blocks.1."
    },
    output_blocks_2_: {
      name: "output_blocks.2."
    },
    output_blocks_3_: {
      name: "output_blocks.3."
    },
    output_blocks_4_: {
      name: "output_blocks.4."
    },
    output_blocks_5_: {
      name: "output_blocks.5."
    },
    output_blocks_6_: {
      name: "output_blocks.6."
    },
    output_blocks_7_: {
      name: "output_blocks.7."
    },
    output_blocks_8_: {
      name: "output_blocks.8."
    },
    output_blocks_9_: {
      name: "output_blocks.9."
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSD2$1 = {
  display_name: "Слияние моделей SD2",
  inputs: {
    input_blocks_0_: {
      name: "input_blocks.0."
    },
    input_blocks_10_: {
      name: "input_blocks.10."
    },
    input_blocks_11_: {
      name: "input_blocks.11."
    },
    input_blocks_1_: {
      name: "input_blocks.1."
    },
    input_blocks_2_: {
      name: "input_blocks.2."
    },
    input_blocks_3_: {
      name: "input_blocks.3."
    },
    input_blocks_4_: {
      name: "input_blocks.4."
    },
    input_blocks_5_: {
      name: "input_blocks.5."
    },
    input_blocks_6_: {
      name: "input_blocks.6."
    },
    input_blocks_7_: {
      name: "input_blocks.7."
    },
    input_blocks_8_: {
      name: "input_blocks.8."
    },
    input_blocks_9_: {
      name: "input_blocks.9."
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0_: {
      name: "middle_block.0."
    },
    middle_block_1_: {
      name: "middle_block.1."
    },
    middle_block_2_: {
      name: "middle_block.2."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0_: {
      name: "output_blocks.0."
    },
    output_blocks_10_: {
      name: "output_blocks.10."
    },
    output_blocks_11_: {
      name: "output_blocks.11."
    },
    output_blocks_1_: {
      name: "output_blocks.1."
    },
    output_blocks_2_: {
      name: "output_blocks.2."
    },
    output_blocks_3_: {
      name: "output_blocks.3."
    },
    output_blocks_4_: {
      name: "output_blocks.4."
    },
    output_blocks_5_: {
      name: "output_blocks.5."
    },
    output_blocks_6_: {
      name: "output_blocks.6."
    },
    output_blocks_7_: {
      name: "output_blocks.7."
    },
    output_blocks_8_: {
      name: "output_blocks.8."
    },
    output_blocks_9_: {
      name: "output_blocks.9."
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSD35_Large$1 = {
  display_name: "Слияние моделей SD35_Large",
  inputs: {
    context_embedder_: {
      name: "context_embedder."
    },
    final_layer_: {
      name: "final_layer."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_24_: {
      name: "joint_blocks.24."
    },
    joint_blocks_25_: {
      name: "joint_blocks.25."
    },
    joint_blocks_26_: {
      name: "joint_blocks.26."
    },
    joint_blocks_27_: {
      name: "joint_blocks.27."
    },
    joint_blocks_28_: {
      name: "joint_blocks.28."
    },
    joint_blocks_29_: {
      name: "joint_blocks.29."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_30_: {
      name: "joint_blocks.30."
    },
    joint_blocks_31_: {
      name: "joint_blocks.31."
    },
    joint_blocks_32_: {
      name: "joint_blocks.32."
    },
    joint_blocks_33_: {
      name: "joint_blocks.33."
    },
    joint_blocks_34_: {
      name: "joint_blocks.34."
    },
    joint_blocks_35_: {
      name: "joint_blocks.35."
    },
    joint_blocks_36_: {
      name: "joint_blocks.36."
    },
    joint_blocks_37_: {
      name: "joint_blocks.37."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    }
  }
};
const ModelMergeSD3_2B$1 = {
  display_name: "Слияние моделей SD3_2B",
  inputs: {
    context_embedder_: {
      name: "context_embedder."
    },
    final_layer_: {
      name: "final_layer."
    },
    joint_blocks_0_: {
      name: "joint_blocks.0."
    },
    joint_blocks_10_: {
      name: "joint_blocks.10."
    },
    joint_blocks_11_: {
      name: "joint_blocks.11."
    },
    joint_blocks_12_: {
      name: "joint_blocks.12."
    },
    joint_blocks_13_: {
      name: "joint_blocks.13."
    },
    joint_blocks_14_: {
      name: "joint_blocks.14."
    },
    joint_blocks_15_: {
      name: "joint_blocks.15."
    },
    joint_blocks_16_: {
      name: "joint_blocks.16."
    },
    joint_blocks_17_: {
      name: "joint_blocks.17."
    },
    joint_blocks_18_: {
      name: "joint_blocks.18."
    },
    joint_blocks_19_: {
      name: "joint_blocks.19."
    },
    joint_blocks_1_: {
      name: "joint_blocks.1."
    },
    joint_blocks_20_: {
      name: "joint_blocks.20."
    },
    joint_blocks_21_: {
      name: "joint_blocks.21."
    },
    joint_blocks_22_: {
      name: "joint_blocks.22."
    },
    joint_blocks_23_: {
      name: "joint_blocks.23."
    },
    joint_blocks_2_: {
      name: "joint_blocks.2."
    },
    joint_blocks_3_: {
      name: "joint_blocks.3."
    },
    joint_blocks_4_: {
      name: "joint_blocks.4."
    },
    joint_blocks_5_: {
      name: "joint_blocks.5."
    },
    joint_blocks_6_: {
      name: "joint_blocks.6."
    },
    joint_blocks_7_: {
      name: "joint_blocks.7."
    },
    joint_blocks_8_: {
      name: "joint_blocks.8."
    },
    joint_blocks_9_: {
      name: "joint_blocks.9."
    },
    model1: {
      name: "модель1"
    },
    model2: {
      name: "модель2"
    },
    pos_embed_: {
      name: "pos_embed."
    },
    t_embedder_: {
      name: "t_embedder."
    },
    x_embedder_: {
      name: "x_embedder."
    },
    y_embedder_: {
      name: "y_embedder."
    }
  }
};
const ModelMergeSDXL$1 = {
  display_name: "Слияние моделей SDXL",
  inputs: {
    input_blocks_0: {
      name: "input_blocks.0"
    },
    input_blocks_1: {
      name: "input_blocks.1"
    },
    input_blocks_2: {
      name: "input_blocks.2"
    },
    input_blocks_3: {
      name: "input_blocks.3"
    },
    input_blocks_4: {
      name: "input_blocks.4"
    },
    input_blocks_5: {
      name: "input_blocks.5"
    },
    input_blocks_6: {
      name: "input_blocks.6"
    },
    input_blocks_7: {
      name: "input_blocks.7"
    },
    input_blocks_8: {
      name: "input_blocks.8"
    },
    label_emb_: {
      name: "label_emb."
    },
    middle_block_0: {
      name: "middle_block.0"
    },
    middle_block_1: {
      name: "middle_block.1"
    },
    middle_block_2: {
      name: "middle_block.2"
    },
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    out_: {
      name: "out."
    },
    output_blocks_0: {
      name: "output_blocks.0"
    },
    output_blocks_1: {
      name: "output_blocks.1"
    },
    output_blocks_2: {
      name: "output_blocks.2"
    },
    output_blocks_3: {
      name: "output_blocks.3"
    },
    output_blocks_4: {
      name: "output_blocks.4"
    },
    output_blocks_5: {
      name: "output_blocks.5"
    },
    output_blocks_6: {
      name: "output_blocks.6"
    },
    output_blocks_7: {
      name: "output_blocks.7"
    },
    output_blocks_8: {
      name: "output_blocks.8"
    },
    time_embed_: {
      name: "time_embed."
    }
  }
};
const ModelMergeSimple$1 = {
  display_name: "Простое слияние моделей",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    ratio: {
      name: "соотношение"
    }
  }
};
const ModelMergeSubtract$1 = {
  display_name: "Вычитание моделей",
  inputs: {
    model1: {
      name: "model1"
    },
    model2: {
      name: "model2"
    },
    multiplier: {
      name: "множитель"
    }
  }
};
const ModelSamplingAuraFlow$1 = {
  display_name: "Выборка модели AuraFlow",
  inputs: {
    model: {
      name: "model"
    },
    shift: {
      name: "сдвиг"
    }
  }
};
const ModelSamplingContinuousEDM$1 = {
  display_name: "Выборка модели Continuous EDM",
  inputs: {
    model: {
      name: "model"
    },
    sampling: {
      name: "выборка"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const ModelSamplingContinuousV$1 = {
  display_name: "Выборка модели Continuous V",
  inputs: {
    model: {
      name: "model"
    },
    sampling: {
      name: "выборка"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    }
  }
};
const ModelSamplingDiscrete$1 = {
  display_name: "Дискретная выборка модели",
  inputs: {
    model: {
      name: "model"
    },
    sampling: {
      name: "выборка"
    },
    zsnr: {
      name: "zsnr"
    }
  }
};
const ModelSamplingFlux$1 = {
  display_name: "Выборка модели Flux",
  inputs: {
    base_shift: {
      name: "базовый_сдвиг"
    },
    height: {
      name: "высота"
    },
    max_shift: {
      name: "макс_сдвиг"
    },
    model: {
      name: "модель"
    },
    width: {
      name: "ширина"
    }
  }
};
const ModelSamplingLTXV$1 = {
  display_name: "Выборка модели LTXV",
  inputs: {
    base_shift: {
      name: "базовый_сдвиг"
    },
    latent: {
      name: "скрытый"
    },
    max_shift: {
      name: "макс_сдвиг"
    },
    model: {
      name: "модель"
    }
  }
};
const ModelSamplingSD3$1 = {
  display_name: "Выборка модели SD3",
  inputs: {
    model: {
      name: "модель"
    },
    shift: {
      name: "сдвиг"
    }
  }
};
const ModelSamplingStableCascade$1 = {
  display_name: "Выборка модели Stable Cascade",
  inputs: {
    model: {
      name: "модель"
    },
    shift: {
      name: "сдвиг"
    }
  }
};
const ModelSave$1 = {
  display_name: "Сохранить модель",
  inputs: {
    filename_prefix: {
      name: "префикс_имени_файла"
    },
    model: {
      name: "модель"
    }
  }
};
const Morphology$1 = {
  display_name: "Морфология изображения",
  inputs: {
    image: {
      name: "изображение"
    },
    kernel_size: {
      name: "размер_ядра"
    },
    operation: {
      name: "операция"
    }
  }
};
const PairConditioningCombine$1 = {
  display_name: "Объединение пар кондиционирования",
  inputs: {
    negative_A: {
      name: "отрицательный_A"
    },
    negative_B: {
      name: "отрицательный_B"
    },
    positive_A: {
      name: "положительный_A"
    },
    positive_B: {
      name: "положительный_B"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const PairConditioningSetDefaultCombine$1 = {
  display_name: "Установить значение по умолчанию для объединения пар кондиционирования",
  inputs: {
    hooks: {
      name: "хуки"
    },
    negative: {
      name: "отрицательный"
    },
    negative_DEFAULT: {
      name: "отрицательный_ПО_УМОЛЧАНИЮ"
    },
    positive: {
      name: "положительный"
    },
    positive_DEFAULT: {
      name: "положительный_ПО_УМОЛЧАНИЮ"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const PairConditioningSetProperties$1 = {
  display_name: "Установить свойства пар кондиционирования",
  inputs: {
    hooks: {
      name: "хуки"
    },
    mask: {
      name: "маска"
    },
    negative_NEW: {
      name: "отрицательный_НОВЫЙ"
    },
    positive_NEW: {
      name: "положительный_НОВЫЙ"
    },
    set_cond_area: {
      name: "установить_область_условия"
    },
    strength: {
      name: "сила"
    },
    timesteps: {
      name: "временные_шаги"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const PairConditioningSetPropertiesAndCombine$1 = {
  display_name: "Установить свойства пар кондиционирования и объединить",
  inputs: {
    hooks: {
      name: "хуки"
    },
    mask: {
      name: "маска"
    },
    negative: {
      name: "отрицательный"
    },
    negative_NEW: {
      name: "отрицательный_НОВЫЙ"
    },
    positive: {
      name: "положительный"
    },
    positive_NEW: {
      name: "положительный_НОВЫЙ"
    },
    set_cond_area: {
      name: "установить_область_условия"
    },
    strength: {
      name: "сила"
    },
    timesteps: {
      name: "временные_шаги"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    }
  }
};
const PatchModelAddDownscale$1 = {
  display_name: "Добавить уменьшение модели патча (Kohya Deep Shrink)",
  inputs: {
    block_number: {
      name: "номер_блока"
    },
    downscale_after_skip: {
      name: "уменьшение_после_пропуска"
    },
    downscale_factor: {
      name: "коэффициент_уменьшения"
    },
    downscale_method: {
      name: "метод_уменьшения"
    },
    end_percent: {
      name: "конечный_процент"
    },
    model: {
      name: "модель"
    },
    start_percent: {
      name: "начальный_процент"
    },
    upscale_method: {
      name: "метод_увеличения"
    }
  }
};
const PerpNeg$1 = {
  display_name: "Перп-Нег (УСТАРЕЛО из-за PerpNegGuider)",
  inputs: {
    empty_conditioning: {
      name: "пустое_условие"
    },
    model: {
      name: "модель"
    },
    neg_scale: {
      name: "масштаб_отриц"
    }
  }
};
const PerpNegGuider$1 = {
  display_name: "PerpNegGuider",
  inputs: {
    cfg: {
      name: "cfg"
    },
    empty_conditioning: {
      name: "пустое_условие"
    },
    model: {
      name: "модель"
    },
    neg_scale: {
      name: "масштаб_отриц"
    },
    negative: {
      name: "отрицательный"
    },
    positive: {
      name: "положительный"
    }
  }
};
const PerturbedAttentionGuidance$1 = {
  display_name: "Направление с учетом возмущений",
  inputs: {
    model: {
      name: "модель"
    },
    scale: {
      name: "масштаб"
    }
  }
};
const PhotoMakerEncode$1 = {
  display_name: "Кодирование PhotoMaker",
  inputs: {
    clip: {
      name: "clip"
    },
    image: {
      name: "изображение"
    },
    photomaker: {
      name: "photomaker"
    },
    text: {
      name: "текст"
    }
  }
};
const PhotoMakerLoader$1 = {
  display_name: "Загрузчик PhotoMaker",
  inputs: {
    photomaker_model_name: {
      name: "имя_модели_photomaker"
    }
  }
};
const PolyexponentialScheduler$1 = {
  display_name: "Полиэкспоненциальный планировщик",
  inputs: {
    rho: {
      name: "ро"
    },
    sigma_max: {
      name: "макс_сигма"
    },
    sigma_min: {
      name: "мин_сигма"
    },
    steps: {
      name: "шаги"
    }
  }
};
const PorterDuffImageComposite$1 = {
  display_name: "Составное изображение Портера-Даффа",
  inputs: {
    destination: {
      name: "назначение"
    },
    destination_alpha: {
      name: "альфа_назначения"
    },
    mode: {
      name: "режим"
    },
    source: {
      name: "источник"
    },
    source_alpha: {
      name: "альфа_источника"
    }
  }
};
const Preview3D$1 = {
  display_name: "Предварительный просмотр 3D",
  inputs: {
    bg_color: {
      name: "цвет_фона"
    },
    camera_type: {
      name: "тип_камеры"
    },
    light_intensity: {
      name: "интенсивность_света"
    },
    material: {
      name: "материал"
    },
    model_file: {
      name: "файл_модели"
    },
    show_grid: {
      name: "показать_сетку"
    },
    up_direction: {
      name: "направление_вверх"
    },
    view: {
      name: "вид"
    }
  }
};
const PreviewAudio$1 = {
  display_name: "Предварительный просмотр аудио",
  inputs: {
    audio: {
      name: "аудио"
    }
  }
};
const PreviewImage$1 = {
  description: "Сохраняет входные изображения в вашу директорию вывода ComfyUI.",
  display_name: "Предварительный просмотр изображения",
  inputs: {
    images: {
      name: "изображения"
    }
  }
};
const RandomNoise$1 = {
  display_name: "Случайный шум",
  inputs: {
    noise_seed: {
      name: "семя_шума"
    }
  }
};
const RebatchImages$1 = {
  display_name: "Перепаковать изображения",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    images: {
      name: "изображения"
    }
  }
};
const RebatchLatents$1 = {
  display_name: "Перепаковать латенты",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    latents: {
      name: "латенты"
    }
  }
};
const RepeatImageBatch$1 = {
  display_name: "Повторить партию изображений",
  inputs: {
    amount: {
      name: "количество"
    },
    image: {
      name: "изображение"
    }
  }
};
const RepeatLatentBatch$1 = {
  display_name: "Повторить партию латентов",
  inputs: {
    amount: {
      name: "количество"
    },
    samples: {
      name: "образцы"
    }
  }
};
const RescaleCFG$1 = {
  display_name: "Масштабировать CFG",
  inputs: {
    model: {
      name: "модель"
    },
    multiplier: {
      name: "множитель"
    }
  }
};
const SDTurboScheduler$1 = {
  display_name: "Планировщик SDTurbo",
  inputs: {
    denoise: {
      name: "шумоподавление"
    },
    model: {
      name: "модель"
    },
    steps: {
      name: "шаги"
    }
  }
};
const SD_4XUpscale_Conditioning$1 = {
  display_name: "SD_4XUpscale_Conditioning",
  inputs: {
    images: {
      name: "изображения"
    },
    negative: {
      name: "отрицательный"
    },
    noise_augmentation: {
      name: "шумовое_увеличение"
    },
    positive: {
      name: "положительный"
    },
    scale_ratio: {
      name: "коэффициент_масштабирования"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    },
    "2": {
      name: "латентный"
    }
  }
};
const SV3D_Conditioning$1 = {
  display_name: "SV3D_Кондиционирование",
  inputs: {
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "высота"
    },
    height: {
      name: "высота"
    },
    init_image: {
      name: "начальное_изображение"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "кадры_видео"
    },
    width: {
      name: "ширина"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    },
    "2": {
      name: "латентный"
    }
  }
};
const SVD_img2vid_Conditioning$1 = {
  display_name: "SVD_img2vid_Кондиционирование",
  inputs: {
    augmentation_level: {
      name: "уровень_аугментации"
    },
    clip_vision: {
      name: "clip_vision"
    },
    fps: {
      name: "fps"
    },
    height: {
      name: "высота"
    },
    init_image: {
      name: "init_image"
    },
    motion_bucket_id: {
      name: "id_корзины_движения"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "кадры_видео"
    },
    width: {
      name: "ширина"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    },
    "2": {
      name: "латентный"
    }
  }
};
const SamplerCustom$1 = {
  display_name: "Пользовательский выборщик",
  inputs: {
    add_noise: {
      name: "добавить_шум"
    },
    cfg: {
      name: "cfg"
    },
    latent_image: {
      name: "латентное_изображение"
    },
    model: {
      name: "модель"
    },
    negative: {
      name: "отрицательный"
    },
    noise_seed: {
      name: "семя_шума"
    },
    positive: {
      name: "положительный"
    },
    sampler: {
      name: "сэмплер"
    },
    sigmas: {
      name: "сигмы"
    }
  },
  outputs: {
    "0": {
      name: "выход"
    },
    "1": {
      name: "очищенный_выход"
    }
  }
};
const SamplerCustomAdvanced$1 = {
  display_name: "Пользовательский выборщик (Расширенный)",
  inputs: {
    guider: {
      name: "гид"
    },
    latent_image: {
      name: "латентное изображение"
    },
    noise: {
      name: "шум"
    },
    sampler: {
      name: "сэмплер"
    },
    sigmas: {
      name: "сигмы"
    }
  },
  outputs: {
    "0": {
      name: "выход"
    },
    "1": {
      name: "очищенный_выход"
    }
  }
};
const SamplerDPMAdaptative$1 = {
  display_name: "Адаптивный выборщик DPM",
  inputs: {
    accept_safety: {
      name: "accept_safety"
    },
    atol: {
      name: "atol"
    },
    dcoeff: {
      name: "dcoeff"
    },
    eta: {
      name: "eta"
    },
    h_init: {
      name: "h_init"
    },
    icoeff: {
      name: "icoeff"
    },
    order: {
      name: "порядок"
    },
    pcoeff: {
      name: "pcoeff"
    },
    rtol: {
      name: "rtol"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_2M_SDE$1 = {
  display_name: "Выборщик DPMPP_2M_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "устройство шума"
    },
    s_noise: {
      name: "s_noise"
    },
    solver_type: {
      name: "тип решателя"
    }
  }
};
const SamplerDPMPP_2S_Ancestral$1 = {
  display_name: "Выборщик DPMPP_2S_Ancestral",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_3M_SDE$1 = {
  display_name: "Выборщик DPMPP_3M_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "устройство шума"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_SDE$1 = {
  display_name: "Выборщик DPMPP_SDE",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "устройство шума"
    },
    r: {
      name: "r"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerAncestral$1 = {
  display_name: "Выборщик Эйлера (Анастр.)",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerAncestralCFGPP$1 = {
  display_name: "Выборщик Эйлера (Анастр.) CFG++",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerCFGpp$1 = {
  display_name: "Выборщик Эйлера CFG++",
  inputs: {
    version: {
      name: "версия"
    }
  }
};
const SamplerLCMUpscale$1 = {
  display_name: "Выборщик LCM Upscale",
  inputs: {
    scale_ratio: {
      name: "коэффициент масштабирования"
    },
    scale_steps: {
      name: "шаги масштабирования"
    },
    upscale_method: {
      name: "метод масштабирования"
    }
  }
};
const SamplerLMS$1 = {
  display_name: "Выборщик LMS",
  inputs: {
    order: {
      name: "порядок"
    }
  }
};
const SaveAnimatedPNG$1 = {
  display_name: "Сохранить анимированный PNG",
  inputs: {
    compress_level: {
      name: "уровень сжатия"
    },
    filename_prefix: {
      name: "префикс имени файла"
    },
    fps: {
      name: "fps"
    },
    images: {
      name: "изображения"
    }
  }
};
const SaveAnimatedWEBP$1 = {
  display_name: "Сохранить анимированный WEBP",
  inputs: {
    filename_prefix: {
      name: "префикс имени файла"
    },
    fps: {
      name: "fps"
    },
    images: {
      name: "изображения"
    },
    lossless: {
      name: "без потерь"
    },
    method: {
      name: "метод"
    },
    quality: {
      name: "качество"
    }
  }
};
const SaveAudio$1 = {
  display_name: "Сохранить аудио",
  inputs: {
    audio: {
      name: "аудио"
    },
    filename_prefix: {
      name: "префикс_имени_файла"
    }
  }
};
const SaveImage$1 = {
  description: "Сохраняет входные изображения в вашу директорию вывода ComfyUI.",
  display_name: "Сохранить изображение",
  inputs: {
    filename_prefix: {
      name: "префикс_имени_файла",
      tooltip: "Префикс для файла, который нужно сохранить. Это может включать информацию о форматировании, такую как %date:yyyy-MM-dd% или %Empty Latent Image.width%, чтобы включить значения из узлов."
    },
    images: {
      name: "изображения",
      tooltip: "Изображения для сохранения."
    }
  }
};
const SaveImageWebsocket$1 = {
  display_name: "Сохранить изображение через веб-сокет",
  inputs: {
    images: {
      name: "изображения"
    }
  }
};
const SaveLatent$1 = {
  display_name: "Сохранить латент",
  inputs: {
    filename_prefix: {
      name: "префикс_имени_файла"
    },
    samples: {
      name: "образцы"
    }
  }
};
const SelfAttentionGuidance$1 = {
  display_name: "Направление самовнимания",
  inputs: {
    blur_sigma: {
      name: "сигма_размытия"
    },
    model: {
      name: "модель"
    },
    scale: {
      name: "масштаб"
    }
  }
};
const SetClipHooks$1 = {
  display_name: "Установить хуки CLIP",
  inputs: {
    apply_to_conds: {
      name: "применить_к_условиям"
    },
    clip: {
      name: "клип"
    },
    hooks: {
      name: "хуки"
    },
    schedule_clip: {
      name: "расписание_клипа"
    }
  }
};
const SetHookKeyframes$1 = {
  display_name: "Установить ключевые кадры хука",
  inputs: {
    hook_kf: {
      name: "ключевые_кадры_хука"
    },
    hooks: {
      name: "хуки"
    }
  }
};
const SetLatentNoiseMask$1 = {
  display_name: "Установить маску шума латента",
  inputs: {
    mask: {
      name: "маска"
    },
    samples: {
      name: "образцы"
    }
  }
};
const SetUnionControlNetType$1 = {
  display_name: "Установить тип объединенного ControlNet",
  inputs: {
    control_net: {
      name: "сеть_управления"
    },
    type: {
      name: "тип"
    }
  }
};
const SkipLayerGuidanceDiT$1 = {
  description: "Универсальная версия узла SkipLayerGuidance, которую можно использовать на любой модели DiT.",
  display_name: "Пропустить руководство по слоям DiT",
  inputs: {
    double_layers: {
      name: "двойные_слои"
    },
    end_percent: {
      name: "конечный_процент"
    },
    model: {
      name: "модель"
    },
    rescaling_scale: {
      name: "масштаб_перемасштабирования"
    },
    scale: {
      name: "масштаб"
    },
    single_layers: {
      name: "одиночные_слои"
    },
    start_percent: {
      name: "начальный_процент"
    }
  }
};
const SkipLayerGuidanceSD3$1 = {
  description: "Универсальная версия узла SkipLayerGuidance, которую можно использовать на любой модели DiT.",
  display_name: "Пропустить руководство по слоям SD3",
  inputs: {
    end_percent: {
      name: "конечный_процент"
    },
    layers: {
      name: "слои"
    },
    model: {
      name: "модель"
    },
    scale: {
      name: "масштаб"
    },
    start_percent: {
      name: "начальный_процент"
    }
  }
};
const SolidMask$1 = {
  display_name: "Сплошная маска",
  inputs: {
    height: {
      name: "высота"
    },
    value: {
      name: "значение"
    },
    width: {
      name: "ширина"
    }
  }
};
const SplitImageWithAlpha$1 = {
  display_name: "Разделить изображение с альфа-каналом",
  inputs: {
    image: {
      name: "изображение"
    }
  }
};
const SplitSigmas$1 = {
  display_name: "Разделить сигмы",
  inputs: {
    sigmas: {
      name: "сигмы"
    },
    step: {
      name: "шаг"
    }
  },
  outputs: {
    "0": {
      name: "высокие_сигмы"
    },
    "1": {
      name: "низкие_сигмы"
    }
  }
};
const SplitSigmasDenoise$1 = {
  display_name: "Разделить сигмы для удаления шума",
  inputs: {
    denoise: {
      name: "денойз"
    },
    sigmas: {
      name: "сигмы"
    }
  },
  outputs: {
    "0": {
      name: "высокие_сигмы"
    },
    "1": {
      name: "низкие_сигмы"
    }
  }
};
const StableCascade_EmptyLatentImage$1 = {
  display_name: "StableCascade_Пустое латентное изображение",
  inputs: {
    batch_size: {
      name: "размер_пакета"
    },
    compression: {
      name: "сжатие"
    },
    height: {
      name: "высота"
    },
    width: {
      name: "ширина"
    }
  },
  outputs: {
    "0": {
      name: "этап_c"
    },
    "1": {
      name: "этап_b"
    }
  }
};
const StableCascade_StageB_Conditioning$1 = {
  display_name: "StableCascade_Этап B_Кондиционирование",
  inputs: {
    conditioning: {
      name: "кондиционирование"
    },
    stage_c: {
      name: "стадия_c"
    }
  }
};
const StableCascade_StageC_VAEEncode$1 = {
  display_name: "StableCascade_Этап C_VAE Кодирование",
  inputs: {
    compression: {
      name: "сжатие"
    },
    image: {
      name: "изображение"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "этап_c"
    },
    "1": {
      name: "этап_b"
    }
  }
};
const StableCascade_SuperResolutionControlnet$1 = {
  display_name: "StableCascade_Суперразрешение Controlnet",
  inputs: {
    image: {
      name: "изображение"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "вход_controlnet"
    },
    "1": {
      name: "этап_c"
    },
    "2": {
      name: "этап_b"
    }
  }
};
const StableZero123_Conditioning$1 = {
  display_name: "StableZero123_Кондиционирование",
  inputs: {
    azimuth: {
      name: "азимут"
    },
    batch_size: {
      name: "размер_пакета"
    },
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "высота"
    },
    height: {
      name: "высота"
    },
    init_image: {
      name: "начальное_изображение"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "ширина"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    },
    "2": {
      name: "латентный"
    }
  }
};
const StableZero123_Conditioning_Batched$1 = {
  display_name: "StableZero123_Кондиционирование_Пакетное",
  inputs: {
    azimuth: {
      name: "азимут"
    },
    azimuth_batch_increment: {
      name: "инкремент_азимута_пакета"
    },
    batch_size: {
      name: "размер_пакета"
    },
    clip_vision: {
      name: "clip_vision"
    },
    elevation: {
      name: "высота"
    },
    elevation_batch_increment: {
      name: "инкремент_высоты_пакета"
    },
    height: {
      name: "высота"
    },
    init_image: {
      name: "начальное_изображение"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "ширина"
    }
  },
  outputs: {
    "0": {
      name: "положительный"
    },
    "1": {
      name: "отрицательный"
    },
    "2": {
      name: "латентный"
    }
  }
};
const StyleModelApply$1 = {
  display_name: "Применить модель стиля",
  inputs: {
    clip_vision_output: {
      name: "выход_clip_vision"
    },
    conditioning: {
      name: "кондиционирование"
    },
    strength: {
      name: "сила"
    },
    strength_type: {
      name: "тип_силы"
    },
    style_model: {
      name: "модель_стиля"
    }
  }
};
const StyleModelLoader$1 = {
  display_name: "Загрузить модель стиля",
  inputs: {
    style_model_name: {
      name: "имя_модели_стиля"
    }
  }
};
const ThresholdMask$1 = {
  display_name: "Пороговая маска",
  inputs: {
    mask: {
      name: "маска"
    },
    value: {
      name: "значение"
    }
  }
};
const TomePatchModel$1 = {
  display_name: "Модель патча Tome",
  inputs: {
    model: {
      name: "модель"
    },
    ratio: {
      name: "соотношение"
    }
  }
};
const TorchCompileModel$1 = {
  display_name: "Скомпилировать модель Torch",
  inputs: {
    backend: {
      name: "бэкенд"
    },
    model: {
      name: "модель"
    }
  }
};
const TripleCLIPLoader$1 = {
  description: "[Рецепты]\n\nsd3: clip-l, clip-g, t5",
  display_name: "Тройной загрузчик CLIP",
  inputs: {
    clip_name1: {
      name: "clip_name1"
    },
    clip_name2: {
      name: "clip_name2"
    },
    clip_name3: {
      name: "clip_name3"
    }
  }
};
const UNETLoader$1 = {
  display_name: "Загрузить модель диффузии",
  inputs: {
    unet_name: {
      name: "unet_name"
    },
    weight_dtype: {
      name: "тип_данных_веса"
    }
  }
};
const UNetCrossAttentionMultiply$1 = {
  display_name: "Умножение перекрестного внимания UNet",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "модель"
    },
    out: {
      name: "выход"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetSelfAttentionMultiply$1 = {
  display_name: "Умножение самовнимания UNet",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "модель"
    },
    out: {
      name: "выход"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetTemporalAttentionMultiply$1 = {
  display_name: "Умножение временного внимания UNet",
  inputs: {
    cross_structural: {
      name: "кросс-структурный"
    },
    cross_temporal: {
      name: "кросс-временной"
    },
    model: {
      name: "модель"
    },
    self_structural: {
      name: "самоструктурный"
    },
    self_temporal: {
      name: "самовременный"
    }
  }
};
const UpscaleModelLoader$1 = {
  display_name: "Загрузить модель увеличения",
  inputs: {
    model_name: {
      name: "имя_модели"
    }
  }
};
const VAEDecode$1 = {
  description: "Декодирует латентные изображения обратно в изображения в пиксельном пространстве.",
  display_name: "Декодировать VAE",
  inputs: {
    samples: {
      name: "образцы",
      tooltip: "Латентное изображение для декодирования."
    },
    vae: {
      name: "vae",
      tooltip: "Модель VAE, используемая для декодирования латентного изображения."
    }
  },
  outputs: {
    "0": {
      tooltip: "Декодированное изображение."
    }
  }
};
const VAEDecodeAudio$1 = {
  display_name: "Декодировать аудио VAE",
  inputs: {
    samples: {
      name: "образцы"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEDecodeTiled$1 = {
  display_name: "Декодировать VAE (плитками)",
  inputs: {
    overlap: {
      name: "перекрытие"
    },
    samples: {
      name: "образцы"
    },
    temporal_overlap: {
      name: "temporal_overlap",
      tooltip: "Используется только для видео VAE: количество кадров для перекрытия."
    },
    temporal_size: {
      name: "temporal_size",
      tooltip: "Используется только для видео VAE: количество кадров для декодирования за раз."
    },
    tile_size: {
      name: "размер_плитки"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncode$1 = {
  display_name: "Кодировать VAE",
  inputs: {
    pixels: {
      name: "пиксели"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeAudio$1 = {
  display_name: "Кодировать аудио VAE",
  inputs: {
    audio: {
      name: "аудио"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeForInpaint$1 = {
  display_name: "Кодировать VAE (для инпейнтинга)",
  inputs: {
    grow_mask_by: {
      name: "увеличить_маску_на"
    },
    mask: {
      name: "маска"
    },
    pixels: {
      name: "пиксели"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeTiled$1 = {
  display_name: "Кодировать VAE (плитками)",
  inputs: {
    overlap: {
      name: "перекрытие"
    },
    pixels: {
      name: "пиксели"
    },
    temporal_overlap: {
      name: "temporal_overlap",
      tooltip: "Используется только для видео VAEs: количество кадров для перекрытия."
    },
    temporal_size: {
      name: "temporal_size",
      tooltip: "Используется только для видео VAEs: количество кадров для кодирования за один раз."
    },
    tile_size: {
      name: "размер_плитки"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAELoader$1 = {
  display_name: "Загрузить VAE",
  inputs: {
    vae_name: {
      name: "имя_vae"
    }
  }
};
const VAESave$1 = {
  display_name: "Сохранить VAE",
  inputs: {
    filename_prefix: {
      name: "префикс_имени_файла"
    },
    vae: {
      name: "vae"
    }
  }
};
const VPScheduler$1 = {
  display_name: "Планировщик VP",
  inputs: {
    beta_d: {
      name: "beta_d"
    },
    beta_min: {
      name: "beta_min"
    },
    eps_s: {
      name: "eps_s"
    },
    steps: {
      name: "шаги"
    }
  }
};
const VideoLinearCFGGuidance$1 = {
  display_name: "Направление Video Linear CFG",
  inputs: {
    min_cfg: {
      name: "мин_cfg"
    },
    model: {
      name: "модель"
    }
  }
};
const VideoTriangleCFGGuidance$1 = {
  display_name: "Направление Video Triangle CFG",
  inputs: {
    min_cfg: {
      name: "мин_cfg"
    },
    model: {
      name: "модель"
    }
  }
};
const WebcamCapture$1 = {
  display_name: "Захват с веб-камеры",
  inputs: {
    capture_on_queue: {
      name: "захват_в_очереди"
    },
    height: {
      name: "высота"
    },
    image: {
      name: "изображение"
    },
    width: {
      name: "ширина"
    }
  }
};
const unCLIPCheckpointLoader$1 = {
  display_name: "Загрузчик контрольной точки unCLIP",
  inputs: {
    ckpt_name: {
      name: "ckpt_name"
    }
  }
};
const unCLIPConditioning$1 = {
  display_name: "unCLIP кондиционирование",
  inputs: {
    clip_vision_output: {
      name: "выход_clip_vision"
    },
    conditioning: {
      name: "условие"
    },
    noise_augmentation: {
      name: "аугментация_шума"
    },
    strength: {
      name: "сила"
    }
  }
};
const ruNodes = {
  AddNoise: AddNoise$1,
  AlignYourStepsScheduler: AlignYourStepsScheduler$1,
  BasicGuider: BasicGuider$1,
  BasicScheduler: BasicScheduler$1,
  BetaSamplingScheduler: BetaSamplingScheduler$1,
  CFGGuider: CFGGuider$1,
  CLIPAttentionMultiply: CLIPAttentionMultiply$1,
  CLIPLoader: CLIPLoader$1,
  CLIPMergeAdd: CLIPMergeAdd$1,
  CLIPMergeSimple: CLIPMergeSimple$1,
  CLIPMergeSubtract: CLIPMergeSubtract$1,
  CLIPSave: CLIPSave$1,
  CLIPSetLastLayer: CLIPSetLastLayer$1,
  CLIPTextEncode: CLIPTextEncode$1,
  CLIPTextEncodeControlnet: CLIPTextEncodeControlnet$1,
  CLIPTextEncodeFlux: CLIPTextEncodeFlux$1,
  CLIPTextEncodeHunyuanDiT: CLIPTextEncodeHunyuanDiT$1,
  CLIPTextEncodePixArtAlpha: CLIPTextEncodePixArtAlpha$1,
  CLIPTextEncodeSD3: CLIPTextEncodeSD3$1,
  CLIPTextEncodeSDXL: CLIPTextEncodeSDXL$1,
  CLIPTextEncodeSDXLRefiner: CLIPTextEncodeSDXLRefiner$1,
  CLIPVisionEncode: CLIPVisionEncode$1,
  CLIPVisionLoader: CLIPVisionLoader$1,
  Canny: Canny$1,
  CheckpointLoader: CheckpointLoader$1,
  CheckpointLoaderSimple: CheckpointLoaderSimple$1,
  CheckpointSave: CheckpointSave$1,
  CombineHooks2: CombineHooks2$1,
  CombineHooks4: CombineHooks4$1,
  CombineHooks8: CombineHooks8$1,
  ConditioningAverage: ConditioningAverage$1,
  ConditioningCombine: ConditioningCombine$1,
  ConditioningConcat: ConditioningConcat$1,
  ConditioningSetArea: ConditioningSetArea$1,
  ConditioningSetAreaPercentage: ConditioningSetAreaPercentage$1,
  ConditioningSetAreaStrength: ConditioningSetAreaStrength$1,
  ConditioningSetDefaultCombine: ConditioningSetDefaultCombine$1,
  ConditioningSetMask: ConditioningSetMask$1,
  ConditioningSetProperties: ConditioningSetProperties$1,
  ConditioningSetPropertiesAndCombine: ConditioningSetPropertiesAndCombine$1,
  ConditioningSetTimestepRange: ConditioningSetTimestepRange$1,
  ConditioningStableAudio: ConditioningStableAudio$1,
  ConditioningTimestepsRange: ConditioningTimestepsRange$1,
  ConditioningZeroOut: ConditioningZeroOut$1,
  ControlNetApply: ControlNetApply$1,
  ControlNetApplyAdvanced: ControlNetApplyAdvanced$1,
  ControlNetApplySD3: ControlNetApplySD3$1,
  ControlNetInpaintingAliMamaApply: ControlNetInpaintingAliMamaApply$1,
  ControlNetLoader: ControlNetLoader$1,
  CreateHookKeyframe: CreateHookKeyframe$1,
  CreateHookKeyframesFromFloats: CreateHookKeyframesFromFloats$1,
  CreateHookKeyframesInterpolated: CreateHookKeyframesInterpolated$1,
  CreateHookLora: CreateHookLora$1,
  CreateHookLoraModelOnly: CreateHookLoraModelOnly$1,
  CreateHookModelAsLora: CreateHookModelAsLora$1,
  CreateHookModelAsLoraModelOnly: CreateHookModelAsLoraModelOnly$1,
  CropMask: CropMask$1,
  DevToolsDeprecatedNode: DevToolsDeprecatedNode$1,
  DevToolsErrorRaiseNode: DevToolsErrorRaiseNode$1,
  DevToolsErrorRaiseNodeWithMessage: DevToolsErrorRaiseNodeWithMessage$1,
  DevToolsExperimentalNode: DevToolsExperimentalNode$1,
  DevToolsLongComboDropdown: DevToolsLongComboDropdown$1,
  DevToolsNodeWithForceInput: DevToolsNodeWithForceInput$1,
  DevToolsNodeWithOnlyOptionalInput: DevToolsNodeWithOnlyOptionalInput$1,
  DevToolsNodeWithOptionalInput: DevToolsNodeWithOptionalInput$1,
  DevToolsNodeWithOutputList: DevToolsNodeWithOutputList$1,
  DevToolsNodeWithStringInput: DevToolsNodeWithStringInput$1,
  DevToolsNodeWithUnionInput: DevToolsNodeWithUnionInput$1,
  DevToolsSimpleSlider: DevToolsSimpleSlider$1,
  DiffControlNetLoader: DiffControlNetLoader$1,
  DifferentialDiffusion: DifferentialDiffusion$1,
  DiffusersLoader: DiffusersLoader$1,
  DisableNoise: DisableNoise$1,
  DualCFGGuider: DualCFGGuider$1,
  DualCLIPLoader: DualCLIPLoader$1,
  EmptyHunyuanLatentVideo: EmptyHunyuanLatentVideo$1,
  EmptyImage: EmptyImage$1,
  EmptyLTXVLatentVideo: EmptyLTXVLatentVideo$1,
  EmptyLatentAudio: EmptyLatentAudio$1,
  EmptyLatentImage: EmptyLatentImage$1,
  EmptyMochiLatentVideo: EmptyMochiLatentVideo$1,
  EmptySD3LatentImage: EmptySD3LatentImage$1,
  ExponentialScheduler: ExponentialScheduler$1,
  FeatherMask: FeatherMask$1,
  FlipSigmas: FlipSigmas$1,
  FluxGuidance: FluxGuidance$1,
  FreeU: FreeU$1,
  FreeU_V2: FreeU_V2$1,
  GITSScheduler: GITSScheduler$1,
  GLIGENLoader: GLIGENLoader$1,
  GLIGENTextBoxApply: GLIGENTextBoxApply$1,
  GrowMask: GrowMask$1,
  HyperTile: HyperTile$1,
  HypernetworkLoader: HypernetworkLoader$1,
  ImageBatch: ImageBatch$1,
  ImageBlend: ImageBlend$1,
  ImageBlur: ImageBlur$1,
  ImageColorToMask: ImageColorToMask$1,
  ImageCompositeMasked: ImageCompositeMasked$1,
  ImageCrop: ImageCrop$1,
  ImageFromBatch: ImageFromBatch$1,
  ImageInvert: ImageInvert$1,
  ImageOnlyCheckpointLoader: ImageOnlyCheckpointLoader$1,
  ImageOnlyCheckpointSave: ImageOnlyCheckpointSave$1,
  ImagePadForOutpaint: ImagePadForOutpaint$1,
  ImageQuantize: ImageQuantize$1,
  ImageScale: ImageScale$1,
  ImageScaleBy: ImageScaleBy$1,
  ImageScaleToTotalPixels: ImageScaleToTotalPixels$1,
  ImageSharpen: ImageSharpen$1,
  ImageToMask: ImageToMask$1,
  ImageUpscaleWithModel: ImageUpscaleWithModel$1,
  InpaintModelConditioning: InpaintModelConditioning$1,
  InstructPixToPixConditioning: InstructPixToPixConditioning$1,
  InvertMask: InvertMask$1,
  JoinImageWithAlpha: JoinImageWithAlpha$1,
  KSampler: KSampler$1,
  KSamplerAdvanced: KSamplerAdvanced$1,
  KSamplerSelect: KSamplerSelect$1,
  KarrasScheduler: KarrasScheduler$1,
  LTXVConditioning: LTXVConditioning$1,
  LTXVImgToVideo: LTXVImgToVideo$1,
  LTXVScheduler: LTXVScheduler$1,
  LaplaceScheduler: LaplaceScheduler$1,
  LatentAdd: LatentAdd$1,
  LatentApplyOperation: LatentApplyOperation$1,
  LatentApplyOperationCFG: LatentApplyOperationCFG$1,
  LatentBatch: LatentBatch$1,
  LatentBatchSeedBehavior: LatentBatchSeedBehavior$1,
  LatentBlend: LatentBlend$1,
  LatentComposite: LatentComposite$1,
  LatentCompositeMasked: LatentCompositeMasked$1,
  LatentCrop: LatentCrop$1,
  LatentFlip: LatentFlip$1,
  LatentFromBatch: LatentFromBatch$1,
  LatentInterpolate: LatentInterpolate$1,
  LatentMultiply: LatentMultiply$1,
  LatentOperationSharpen: LatentOperationSharpen$1,
  LatentOperationTonemapReinhard: LatentOperationTonemapReinhard$1,
  LatentRotate: LatentRotate$1,
  LatentSubtract: LatentSubtract$1,
  LatentUpscale: LatentUpscale$1,
  LatentUpscaleBy: LatentUpscaleBy$1,
  Load3D: Load3D$1,
  Load3DAnimation: Load3DAnimation$1,
  LoadAudio: LoadAudio$1,
  LoadImage: LoadImage$1,
  LoadImageMask: LoadImageMask$1,
  LoadLatent: LoadLatent$1,
  LoraLoader: LoraLoader$1,
  LoraLoaderModelOnly: LoraLoaderModelOnly$1,
  LoraSave: LoraSave$1,
  Mahiro: Mahiro$1,
  MaskComposite: MaskComposite$1,
  MaskToImage: MaskToImage$1,
  ModelMergeAdd: ModelMergeAdd$1,
  ModelMergeAuraflow: ModelMergeAuraflow$1,
  ModelMergeBlocks: ModelMergeBlocks$1,
  ModelMergeFlux1: ModelMergeFlux1$1,
  ModelMergeLTXV: ModelMergeLTXV$1,
  ModelMergeMochiPreview: ModelMergeMochiPreview$1,
  ModelMergeSD1: ModelMergeSD1$1,
  ModelMergeSD2: ModelMergeSD2$1,
  ModelMergeSD35_Large: ModelMergeSD35_Large$1,
  ModelMergeSD3_2B: ModelMergeSD3_2B$1,
  ModelMergeSDXL: ModelMergeSDXL$1,
  ModelMergeSimple: ModelMergeSimple$1,
  ModelMergeSubtract: ModelMergeSubtract$1,
  ModelSamplingAuraFlow: ModelSamplingAuraFlow$1,
  ModelSamplingContinuousEDM: ModelSamplingContinuousEDM$1,
  ModelSamplingContinuousV: ModelSamplingContinuousV$1,
  ModelSamplingDiscrete: ModelSamplingDiscrete$1,
  ModelSamplingFlux: ModelSamplingFlux$1,
  ModelSamplingLTXV: ModelSamplingLTXV$1,
  ModelSamplingSD3: ModelSamplingSD3$1,
  ModelSamplingStableCascade: ModelSamplingStableCascade$1,
  ModelSave: ModelSave$1,
  Morphology: Morphology$1,
  PairConditioningCombine: PairConditioningCombine$1,
  PairConditioningSetDefaultCombine: PairConditioningSetDefaultCombine$1,
  PairConditioningSetProperties: PairConditioningSetProperties$1,
  PairConditioningSetPropertiesAndCombine: PairConditioningSetPropertiesAndCombine$1,
  PatchModelAddDownscale: PatchModelAddDownscale$1,
  PerpNeg: PerpNeg$1,
  PerpNegGuider: PerpNegGuider$1,
  PerturbedAttentionGuidance: PerturbedAttentionGuidance$1,
  PhotoMakerEncode: PhotoMakerEncode$1,
  PhotoMakerLoader: PhotoMakerLoader$1,
  PolyexponentialScheduler: PolyexponentialScheduler$1,
  PorterDuffImageComposite: PorterDuffImageComposite$1,
  Preview3D: Preview3D$1,
  PreviewAudio: PreviewAudio$1,
  PreviewImage: PreviewImage$1,
  RandomNoise: RandomNoise$1,
  RebatchImages: RebatchImages$1,
  RebatchLatents: RebatchLatents$1,
  RepeatImageBatch: RepeatImageBatch$1,
  RepeatLatentBatch: RepeatLatentBatch$1,
  RescaleCFG: RescaleCFG$1,
  SDTurboScheduler: SDTurboScheduler$1,
  SD_4XUpscale_Conditioning: SD_4XUpscale_Conditioning$1,
  SV3D_Conditioning: SV3D_Conditioning$1,
  SVD_img2vid_Conditioning: SVD_img2vid_Conditioning$1,
  SamplerCustom: SamplerCustom$1,
  SamplerCustomAdvanced: SamplerCustomAdvanced$1,
  SamplerDPMAdaptative: SamplerDPMAdaptative$1,
  SamplerDPMPP_2M_SDE: SamplerDPMPP_2M_SDE$1,
  SamplerDPMPP_2S_Ancestral: SamplerDPMPP_2S_Ancestral$1,
  SamplerDPMPP_3M_SDE: SamplerDPMPP_3M_SDE$1,
  SamplerDPMPP_SDE: SamplerDPMPP_SDE$1,
  SamplerEulerAncestral: SamplerEulerAncestral$1,
  SamplerEulerAncestralCFGPP: SamplerEulerAncestralCFGPP$1,
  SamplerEulerCFGpp: SamplerEulerCFGpp$1,
  SamplerLCMUpscale: SamplerLCMUpscale$1,
  SamplerLMS: SamplerLMS$1,
  SaveAnimatedPNG: SaveAnimatedPNG$1,
  SaveAnimatedWEBP: SaveAnimatedWEBP$1,
  SaveAudio: SaveAudio$1,
  SaveImage: SaveImage$1,
  SaveImageWebsocket: SaveImageWebsocket$1,
  SaveLatent: SaveLatent$1,
  SelfAttentionGuidance: SelfAttentionGuidance$1,
  SetClipHooks: SetClipHooks$1,
  SetHookKeyframes: SetHookKeyframes$1,
  SetLatentNoiseMask: SetLatentNoiseMask$1,
  SetUnionControlNetType: SetUnionControlNetType$1,
  SkipLayerGuidanceDiT: SkipLayerGuidanceDiT$1,
  SkipLayerGuidanceSD3: SkipLayerGuidanceSD3$1,
  SolidMask: SolidMask$1,
  SplitImageWithAlpha: SplitImageWithAlpha$1,
  SplitSigmas: SplitSigmas$1,
  SplitSigmasDenoise: SplitSigmasDenoise$1,
  StableCascade_EmptyLatentImage: StableCascade_EmptyLatentImage$1,
  StableCascade_StageB_Conditioning: StableCascade_StageB_Conditioning$1,
  StableCascade_StageC_VAEEncode: StableCascade_StageC_VAEEncode$1,
  StableCascade_SuperResolutionControlnet: StableCascade_SuperResolutionControlnet$1,
  StableZero123_Conditioning: StableZero123_Conditioning$1,
  StableZero123_Conditioning_Batched: StableZero123_Conditioning_Batched$1,
  StyleModelApply: StyleModelApply$1,
  StyleModelLoader: StyleModelLoader$1,
  ThresholdMask: ThresholdMask$1,
  TomePatchModel: TomePatchModel$1,
  TorchCompileModel: TorchCompileModel$1,
  TripleCLIPLoader: TripleCLIPLoader$1,
  UNETLoader: UNETLoader$1,
  UNetCrossAttentionMultiply: UNetCrossAttentionMultiply$1,
  UNetSelfAttentionMultiply: UNetSelfAttentionMultiply$1,
  UNetTemporalAttentionMultiply: UNetTemporalAttentionMultiply$1,
  UpscaleModelLoader: UpscaleModelLoader$1,
  VAEDecode: VAEDecode$1,
  VAEDecodeAudio: VAEDecodeAudio$1,
  VAEDecodeTiled: VAEDecodeTiled$1,
  VAEEncode: VAEEncode$1,
  VAEEncodeAudio: VAEEncodeAudio$1,
  VAEEncodeForInpaint: VAEEncodeForInpaint$1,
  VAEEncodeTiled: VAEEncodeTiled$1,
  VAELoader: VAELoader$1,
  VAESave: VAESave$1,
  VPScheduler: VPScheduler$1,
  VideoLinearCFGGuidance: VideoLinearCFGGuidance$1,
  VideoTriangleCFGGuidance: VideoTriangleCFGGuidance$1,
  WebcamCapture: WebcamCapture$1,
  unCLIPCheckpointLoader: unCLIPCheckpointLoader$1,
  unCLIPConditioning: unCLIPConditioning$1
};
const Comfy_ConfirmClear$1 = {
  name: "Требовать подтверждение при очистке рабочего процесса"
};
const Comfy_DOMClippingEnabled$1 = {
  name: "Включить обрезку элементов DOM (включение может снизить производительность)"
};
const Comfy_DevMode$1 = {
  name: "Включить параметры режима разработчика (сохранение API и т.д.)"
};
const Comfy_DisableFloatRounding$1 = {
  name: "Отключить округление по умолчанию для плавающих виджетов.",
  tooltip: "(требуется перезагрузка страницы) Невозможно отключить округление, если оно установлено узлом на сервере."
};
const Comfy_DisableSliders$1 = {
  name: "Отключить ползунки виджетов узлов"
};
const Comfy_EditAttention_Delta$1 = {
  name: "Точность Ctrl+вверх/вниз"
};
const Comfy_EnableTooltips$1 = {
  name: "Включить подсказки"
};
const Comfy_EnableWorkflowViewRestore$1 = {
  name: "Сохранять и восстанавливать положение и уровень масштабирования холста в рабочих процессах"
};
const Comfy_FloatRoundingPrecision$1 = {
  name: "Количество знаков после запятой для округления плавающего виджета [0 = авто].",
  tooltip: "(требуется перезагрузка страницы)"
};
const Comfy_Graph_CanvasInfo$1 = {
  name: "Показать информацию о холсте в нижнем левом углу (fps и т.д.)"
};
const Comfy_Graph_CanvasMenu$1 = {
  name: "Показать меню холста графа"
};
const Comfy_Graph_CtrlShiftZoom$1 = {
  name: "Включить быстрый зум с помощью сочетания клавиш (Ctrl + Shift + Перетаскивание)"
};
const Comfy_Graph_LinkMarkers$1 = {
  name: "Маркер середины ссылки",
  options: {
    Arrow: "Стрелка",
    Circle: "Круг",
    None: "Нет"
  }
};
const Comfy_Graph_ZoomSpeed$1 = {
  name: "Скорость зума холста"
};
const Comfy_GroupSelectedNodes_Padding$1 = {
  name: "Отступ для выбранных узлов группы"
};
const Comfy_Group_DoubleClickTitleToEdit$1 = {
  name: "Дважды щелкните по заголовку группы, чтобы редактировать"
};
const Comfy_InvertMenuScrolling$1 = {
  name: "Инвертировать прокрутку контекстного меню"
};
const Comfy_LinkRelease_Action$1 = {
  name: "Действие при отпускании ссылки (без модификатора)",
  options: {
    "context menu": "контекстное меню",
    "no action": "без действия",
    "search box": "поисковая строка"
  }
};
const Comfy_LinkRelease_ActionShift$1 = {
  name: "Действие при отпускании ссылки (Shift)",
  options: {
    "context menu": "контекстное меню",
    "no action": "без действия",
    "search box": "поисковая строка"
  }
};
const Comfy_LinkRenderMode$1 = {
  name: "Режим рендеринга ссылки",
  options: {
    Hidden: "Скрытый",
    Linear: "Линейный",
    Spline: "Сплайн",
    Straight: "Прямой"
  }
};
const Comfy_Locale$1 = {
  name: "Язык"
};
const Comfy_MaskEditor_BrushAdjustmentSpeed$1 = {
  name: "Множитель скорости регулировки кисти",
  tooltip: "Управляет тем, как быстро изменяются размер и жесткость кисти при регулировке. Более высокие значения означают более быстрые изменения."
};
const Comfy_MaskEditor_UseDominantAxis$1 = {
  name: "Закрепить регулировку кисти по доминирующей оси",
  tooltip: "При включении регулировки кисти будет влиять только на размер ИЛИ жесткость в зависимости от того, в каком направлении вы двигаетесь больше"
};
const Comfy_MaskEditor_UseNewEditor$1 = {
  name: "Использовать новый редактор масок",
  tooltip: "Переключиться на новый интерфейс редактора масок"
};
const Comfy_ModelLibrary_AutoLoadAll$1 = {
  name: "Автоматически загружать все папки моделей",
  tooltip: "Если true, все папки будут загружены, как только вы откроете библиотеку моделей (это может вызвать задержки при загрузке). Если false, корневые папки моделей будут загружены только после нажатия на них."
};
const Comfy_ModelLibrary_NameFormat$1 = {
  name: "Какое имя отображать в древовидном представлении библиотеки моделей",
  options: {
    filename: "имя файла",
    title: "название"
  },
  tooltip: 'Выберите "имя файла", чтобы отобразить упрощенный вид сырого имени файла (без директории или расширения ".safetensors") в списке моделей. Выберите "название", чтобы отобразить настраиваемое название метаданных модели.'
};
const Comfy_NodeBadge_NodeIdBadgeMode$1 = {
  name: "Режим значка ID узла",
  options: {
    None: "Нет",
    "Show all": "Показать все"
  }
};
const Comfy_NodeBadge_NodeLifeCycleBadgeMode$1 = {
  name: "Режим значка жизненного цикла узла",
  options: {
    None: "Нет",
    "Show all": "Показать все"
  }
};
const Comfy_NodeBadge_NodeSourceBadgeMode$1 = {
  name: "Режим значка источника узла",
  options: {
    "Hide built-in": "Скрыть встроенные",
    None: "Нет",
    "Show all": "Показать все"
  }
};
const Comfy_NodeInputConversionSubmenus$1 = {
  name: "В контекстном меню узла разместите элементы, которые конвертируют между вводом/виджетом в подменю."
};
const Comfy_NodeSearchBoxImpl$1 = {
  name: "Реализация поискового поля узлов",
  options: {
    "default": "по умолчанию",
    "litegraph (legacy)": "litegraph (устаревший)"
  }
};
const Comfy_NodeSearchBoxImpl_NodePreview$1 = {
  name: "Предварительный просмотр узла",
  tooltip: "Применяется только к стандартной реализации"
};
const Comfy_NodeSearchBoxImpl_ShowCategory$1 = {
  name: "Показать категорию узла в результатах поиска",
  tooltip: "Применяется только к стандартной реализации"
};
const Comfy_NodeSearchBoxImpl_ShowIdName$1 = {
  name: "Показать имя ID узла в результатах поиска",
  tooltip: "Применяется только к стандартной реализации"
};
const Comfy_NodeSearchBoxImpl_ShowNodeFrequency$1 = {
  name: "Показать частоту узла в результатах поиска",
  tooltip: "Применяется только к стандартной реализации"
};
const Comfy_NodeSuggestions_number$1 = {
  name: "Количество предложений узлов",
  tooltip: "Только для поля поиска litegraph/контекстного меню"
};
const Comfy_Node_AutoSnapLinkToSlot$1 = {
  name: "Автоматически привязывать ссылку к слоту узла",
  tooltip: "При перетаскивании ссылки над узлом ссылка автоматически привязывается к подходящему входному слоту узла"
};
const Comfy_Node_BypassAllLinksOnDelete$1 = {
  name: "Сохранить все ссылки при удалении узлов",
  tooltip: "При удалении узла попытаться переподключить все его входные и выходные ссылки (обходя удаленный узел)"
};
const Comfy_Node_DoubleClickTitleToEdit$1 = {
  name: "Дважды щелкните по заголовку узла, чтобы редактировать"
};
const Comfy_Node_MiddleClickRerouteNode$1 = {
  name: "Средний щелчок создает новый узел перенаправления"
};
const Comfy_Node_Opacity$1 = {
  name: "Непрозрачность узла"
};
const Comfy_Node_ShowDeprecated$1 = {
  name: "Показать устаревшие узлы в поиске",
  tooltip: "Устаревшие узлы по умолчанию скрыты в интерфейсе, но остаются функциональными в существующих рабочих процессах, которые их используют."
};
const Comfy_Node_ShowExperimental$1 = {
  name: "Показать экспериментальные узлы в поиске",
  tooltip: "Экспериментальные узлы помечены как таковые в интерфейсе и могут подвергаться значительным изменениям или удалению в будущих версиях. Используйте с осторожностью в производственных рабочих процессах"
};
const Comfy_Node_SnapHighlightsNode$1 = {
  name: "Подсветка узла при привязке",
  tooltip: "При перетаскивании ссылки над узлом с подходящим входным слотом, узел подсвечивается"
};
const Comfy_Pointer_ClickBufferTime$1 = {
  name: "Задержка дрейфа щелчка указателя",
  tooltip: "После нажатия кнопки указателя, это максимальное время (в миллисекундах), в течение которого движение указателя может быть проигнорировано.\n\nПомогает предотвратить непреднамеренное смещение объектов, если указатель перемещается во время щелчка."
};
const Comfy_Pointer_ClickDrift$1 = {
  name: "Дрейф щелчка указателя (максимальное расстояние)",
  tooltip: "Если указатель перемещается более чем на это расстояние, удерживая кнопку, это считается перетаскиванием (а не щелчком).\n\nПомогает предотвратить непреднамеренное смещение объектов, если указатель перемещается во время щелчка."
};
const Comfy_Pointer_DoubleClickTime$1 = {
  name: "Интервал двойного щелчка (максимум)",
  tooltip: "Максимальное время в миллисекундах между двумя щелчками двойного щелчка. Увеличение этого значения может помочь, если двойные щелчки иногда не регистрируются."
};
const Comfy_PreviewFormat$1 = {
  name: "Формат изображения предварительного просмотра",
  tooltip: "При отображении предварительного просмотра в виджете изображения, преобразуйте его в легковесное изображение, например, webp, jpeg, webp;50 и т.д."
};
const Comfy_PromptFilename$1 = {
  name: "Запрос имени файла при сохранении рабочего процесса"
};
const Comfy_QueueButton_BatchCountLimit$1 = {
  name: "Ограничение количества партий",
  tooltip: "Максимальное количество задач, добавляемых в очередь за одно нажатие кнопки"
};
const Comfy_Queue_MaxHistoryItems$1 = {
  name: "Размер истории очереди",
  tooltip: "Максимальное количество задач, отображаемых в истории очереди."
};
const Comfy_RerouteBeta$1 = {
  name: "Участвовать в бета-тестировании перенаправления",
  tooltip: "Включает новые нативные перенаправления.\n\nПеренаправления можно добавлять, удерживая alt и перетаскивая от линии ссылки или в меню ссылки.\n\nОтключение этой опции не разрушительно - перенаправления скрыты."
};
const Comfy_Sidebar_Location$1 = {
  name: "Расположение боковой панели",
  options: {
    left: "слева",
    right: "справа"
  }
};
const Comfy_Sidebar_Size$1 = {
  name: "Размер боковой панели",
  options: {
    normal: "нормальный",
    small: "маленький"
  }
};
const Comfy_SnapToGrid_GridSize$1 = {
  name: "Размер сетки привязки",
  tooltip: "При перетаскивании и изменении размера узлов, удерживая shift, они будут выровнены по сетке, это контролирует размер этой сетки."
};
const Comfy_TextareaWidget_FontSize$1 = {
  name: "Размер шрифта виджета текстовой области"
};
const Comfy_TextareaWidget_Spellcheck$1 = {
  name: "Проверка орфографии виджета текстовой области"
};
const Comfy_TreeExplorer_ItemPadding$1 = {
  name: "Отступ элемента в проводнике дерева"
};
const Comfy_UseNewMenu$1 = {
  name: "Использовать новое меню",
  options: {
    Bottom: "Внизу",
    Disabled: "Отключено",
    Top: "Вверху"
  }
};
const Comfy_Validation_NodeDefs$1 = {
  name: "Проверка определений узлов (медленно)",
  tooltip: "Рекомендуется для разработчиков узлов. Это проверит все определения узлов при запуске."
};
const Comfy_Validation_Workflows$1 = {
  name: "Проверка рабочих процессов"
};
const Comfy_WidgetControlMode$1 = {
  name: "Режим управления виджетом",
  options: {
    after: "после",
    before: "до"
  },
  tooltip: "Управляет тем, когда обновляются значения виджета (случайные/увеличение/уменьшение), либо до того, как запрос будет поставлен в очередь, либо после."
};
const Comfy_Window_UnloadConfirmation$1 = {
  name: "Показать подтверждение при закрытии окна"
};
const Comfy_Workflow_ConfirmDelete$1 = {
  name: "Показать подтверждение при удалении рабочих процессов"
};
const Comfy_Workflow_ShowMissingModelsWarning$1 = {
  name: "Показать предупреждение об отсутствующих моделях"
};
const Comfy_Workflow_ShowMissingNodesWarning$1 = {
  name: "Показать предупреждение об отсутствующих узлах"
};
const Comfy_Workflow_SortNodeIdOnSave$1 = {
  name: "Сортировать ID узлов при сохранении рабочего процесса"
};
const Comfy_Workflow_WorkflowTabsPosition$1 = {
  name: "Положение открытых рабочих процессов",
  options: {
    Sidebar: "Боковая панель",
    Topbar: "Верхняя панель"
  }
};
const LiteGraph_Canvas_MaximumFps$1 = {
  name: "Максимум FPS",
  tooltip: "Максимальное количество кадров в секунду, которое холст может рендерить. Ограничивает использование GPU за счет плавности. Если 0, используется частота обновления экрана. По умолчанию: 0"
};
const pysssss_SnapToGrid$1 = {
  name: "Всегда привязываться к сетке"
};
const ruSettings = {
  "Comfy-Desktop_AutoUpdate": {
    name: "Автоматически проверять обновления"
  },
  "Comfy-Desktop_SendStatistics": {
    name: "Отправлять анонимные отчеты о сбоях"
  },
  Comfy_ConfirmClear: Comfy_ConfirmClear$1,
  Comfy_DOMClippingEnabled: Comfy_DOMClippingEnabled$1,
  Comfy_DevMode: Comfy_DevMode$1,
  Comfy_DisableFloatRounding: Comfy_DisableFloatRounding$1,
  Comfy_DisableSliders: Comfy_DisableSliders$1,
  Comfy_EditAttention_Delta: Comfy_EditAttention_Delta$1,
  Comfy_EnableTooltips: Comfy_EnableTooltips$1,
  Comfy_EnableWorkflowViewRestore: Comfy_EnableWorkflowViewRestore$1,
  Comfy_FloatRoundingPrecision: Comfy_FloatRoundingPrecision$1,
  Comfy_Graph_CanvasInfo: Comfy_Graph_CanvasInfo$1,
  Comfy_Graph_CanvasMenu: Comfy_Graph_CanvasMenu$1,
  Comfy_Graph_CtrlShiftZoom: Comfy_Graph_CtrlShiftZoom$1,
  Comfy_Graph_LinkMarkers: Comfy_Graph_LinkMarkers$1,
  Comfy_Graph_ZoomSpeed: Comfy_Graph_ZoomSpeed$1,
  Comfy_GroupSelectedNodes_Padding: Comfy_GroupSelectedNodes_Padding$1,
  Comfy_Group_DoubleClickTitleToEdit: Comfy_Group_DoubleClickTitleToEdit$1,
  Comfy_InvertMenuScrolling: Comfy_InvertMenuScrolling$1,
  Comfy_LinkRelease_Action: Comfy_LinkRelease_Action$1,
  Comfy_LinkRelease_ActionShift: Comfy_LinkRelease_ActionShift$1,
  Comfy_LinkRenderMode: Comfy_LinkRenderMode$1,
  Comfy_Locale: Comfy_Locale$1,
  Comfy_MaskEditor_BrushAdjustmentSpeed: Comfy_MaskEditor_BrushAdjustmentSpeed$1,
  Comfy_MaskEditor_UseDominantAxis: Comfy_MaskEditor_UseDominantAxis$1,
  Comfy_MaskEditor_UseNewEditor: Comfy_MaskEditor_UseNewEditor$1,
  Comfy_ModelLibrary_AutoLoadAll: Comfy_ModelLibrary_AutoLoadAll$1,
  Comfy_ModelLibrary_NameFormat: Comfy_ModelLibrary_NameFormat$1,
  Comfy_NodeBadge_NodeIdBadgeMode: Comfy_NodeBadge_NodeIdBadgeMode$1,
  Comfy_NodeBadge_NodeLifeCycleBadgeMode: Comfy_NodeBadge_NodeLifeCycleBadgeMode$1,
  Comfy_NodeBadge_NodeSourceBadgeMode: Comfy_NodeBadge_NodeSourceBadgeMode$1,
  Comfy_NodeInputConversionSubmenus: Comfy_NodeInputConversionSubmenus$1,
  Comfy_NodeSearchBoxImpl: Comfy_NodeSearchBoxImpl$1,
  Comfy_NodeSearchBoxImpl_NodePreview: Comfy_NodeSearchBoxImpl_NodePreview$1,
  Comfy_NodeSearchBoxImpl_ShowCategory: Comfy_NodeSearchBoxImpl_ShowCategory$1,
  Comfy_NodeSearchBoxImpl_ShowIdName: Comfy_NodeSearchBoxImpl_ShowIdName$1,
  Comfy_NodeSearchBoxImpl_ShowNodeFrequency: Comfy_NodeSearchBoxImpl_ShowNodeFrequency$1,
  Comfy_NodeSuggestions_number: Comfy_NodeSuggestions_number$1,
  Comfy_Node_AutoSnapLinkToSlot: Comfy_Node_AutoSnapLinkToSlot$1,
  Comfy_Node_BypassAllLinksOnDelete: Comfy_Node_BypassAllLinksOnDelete$1,
  Comfy_Node_DoubleClickTitleToEdit: Comfy_Node_DoubleClickTitleToEdit$1,
  Comfy_Node_MiddleClickRerouteNode: Comfy_Node_MiddleClickRerouteNode$1,
  Comfy_Node_Opacity: Comfy_Node_Opacity$1,
  Comfy_Node_ShowDeprecated: Comfy_Node_ShowDeprecated$1,
  Comfy_Node_ShowExperimental: Comfy_Node_ShowExperimental$1,
  Comfy_Node_SnapHighlightsNode: Comfy_Node_SnapHighlightsNode$1,
  Comfy_Pointer_ClickBufferTime: Comfy_Pointer_ClickBufferTime$1,
  Comfy_Pointer_ClickDrift: Comfy_Pointer_ClickDrift$1,
  Comfy_Pointer_DoubleClickTime: Comfy_Pointer_DoubleClickTime$1,
  Comfy_PreviewFormat: Comfy_PreviewFormat$1,
  Comfy_PromptFilename: Comfy_PromptFilename$1,
  Comfy_QueueButton_BatchCountLimit: Comfy_QueueButton_BatchCountLimit$1,
  Comfy_Queue_MaxHistoryItems: Comfy_Queue_MaxHistoryItems$1,
  Comfy_RerouteBeta: Comfy_RerouteBeta$1,
  Comfy_Sidebar_Location: Comfy_Sidebar_Location$1,
  Comfy_Sidebar_Size: Comfy_Sidebar_Size$1,
  Comfy_SnapToGrid_GridSize: Comfy_SnapToGrid_GridSize$1,
  Comfy_TextareaWidget_FontSize: Comfy_TextareaWidget_FontSize$1,
  Comfy_TextareaWidget_Spellcheck: Comfy_TextareaWidget_Spellcheck$1,
  Comfy_TreeExplorer_ItemPadding: Comfy_TreeExplorer_ItemPadding$1,
  Comfy_UseNewMenu: Comfy_UseNewMenu$1,
  Comfy_Validation_NodeDefs: Comfy_Validation_NodeDefs$1,
  Comfy_Validation_Workflows: Comfy_Validation_Workflows$1,
  Comfy_WidgetControlMode: Comfy_WidgetControlMode$1,
  Comfy_Window_UnloadConfirmation: Comfy_Window_UnloadConfirmation$1,
  Comfy_Workflow_ConfirmDelete: Comfy_Workflow_ConfirmDelete$1,
  Comfy_Workflow_ShowMissingModelsWarning: Comfy_Workflow_ShowMissingModelsWarning$1,
  Comfy_Workflow_ShowMissingNodesWarning: Comfy_Workflow_ShowMissingNodesWarning$1,
  Comfy_Workflow_SortNodeIdOnSave: Comfy_Workflow_SortNodeIdOnSave$1,
  Comfy_Workflow_WorkflowTabsPosition: Comfy_Workflow_WorkflowTabsPosition$1,
  LiteGraph_Canvas_MaximumFps: LiteGraph_Canvas_MaximumFps$1,
  pysssss_SnapToGrid: pysssss_SnapToGrid$1
};
const Comfy_BrowseTemplates = {
  label: "浏览模板"
};
const Comfy_Canvas_FitView = {
  label: "适应视图到选中节点"
};
const Comfy_Canvas_ResetView = {
  label: "重置视图"
};
const Comfy_Canvas_ToggleLinkVisibility = {
  label: "切换链接可见性"
};
const Comfy_Canvas_ToggleLock = {
  label: "锁定视图"
};
const Comfy_Canvas_ToggleSelectedNodes_Bypass = {
  label: "忽略/取消忽略选中节点"
};
const Comfy_Canvas_ToggleSelectedNodes_Collapse = {
  label: "折叠/展开选中节点"
};
const Comfy_Canvas_ToggleSelectedNodes_Mute = {
  label: "静音/取消静音选中节点"
};
const Comfy_Canvas_ToggleSelectedNodes_Pin = {
  label: "固定/取消固定选中节点"
};
const Comfy_Canvas_ToggleSelected_Pin = {
  label: "固定/取消固定选中项"
};
const Comfy_Canvas_ZoomIn = {
  label: "放大"
};
const Comfy_Canvas_ZoomOut = {
  label: "缩小"
};
const Comfy_ClearPendingTasks = {
  label: "清除待处理任务"
};
const Comfy_ClearWorkflow = {
  label: "清除工作流"
};
const Comfy_DuplicateWorkflow = {
  label: "复制当前工作流"
};
const Comfy_ExportWorkflow = {
  label: "导出工作流"
};
const Comfy_ExportWorkflowAPI = {
  label: "导出工作流（API格式）"
};
const Comfy_Graph_FitGroupToContents = {
  label: "适应节点框到内容"
};
const Comfy_Graph_GroupSelectedNodes = {
  label: "添加框到选中节点"
};
const Comfy_GroupNode_ConvertSelectedNodesToGroupNode = {
  label: "将选中节点转换为组节点"
};
const Comfy_GroupNode_ManageGroupNodes = {
  label: "管理组节点"
};
const Comfy_GroupNode_UngroupSelectedGroupNodes = {
  label: "解散选中组节点"
};
const Comfy_Help_AboutComfyUI = {
  label: "打开关于ComfyUI"
};
const Comfy_Help_OpenComfyOrgDiscord = {
  label: "打开Comfy-Org Discord"
};
const Comfy_Help_OpenComfyUIDocs = {
  label: "打开ComfyUI文档"
};
const Comfy_Help_OpenComfyUIIssues = {
  label: "打开ComfyUI问题"
};
const Comfy_Interrupt = {
  label: "中断"
};
const Comfy_LoadDefaultWorkflow = {
  label: "加载默认工作流"
};
const Comfy_NewBlankWorkflow = {
  label: "新建空白工作流"
};
const Comfy_OpenClipspace = {
  label: "打开剪贴板"
};
const Comfy_OpenWorkflow = {
  label: "打开工作流"
};
const Comfy_QueuePrompt = {
  label: "执行提示词"
};
const Comfy_QueuePromptFront = {
  label: "执行提示词（前端）"
};
const Comfy_Redo = {
  label: "重做"
};
const Comfy_RefreshNodeDefinitions = {
  label: "刷新节点定义"
};
const Comfy_SaveWorkflow = {
  label: "保存工作流"
};
const Comfy_SaveWorkflowAs = {
  label: "另存工作流"
};
const Comfy_ShowSettingsDialog = {
  label: "显示设置对话框"
};
const Comfy_ToggleTheme = {
  label: "切换主题"
};
const Comfy_Undo = {
  label: "撤销"
};
const Workspace_NextOpenedWorkflow = {
  label: "下一个打开的工作流"
};
const Workspace_PreviousOpenedWorkflow = {
  label: "上一个打开的工作流"
};
const Workspace_SearchBox_Toggle = {
  label: "切换搜索框"
};
const Workspace_ToggleBottomPanel = {
  label: "切换底部面板"
};
const Workspace_ToggleFocusMode = {
  label: "切换焦点模式"
};
const Workspace_ToggleSidebarTab_queue = {
  label: "切换执行队列侧边栏",
  tooltip: "执行队列"
};
const Workspace_ToggleSidebarTab_workflows = {
  label: "切换工作流侧边栏",
  tooltip: "工作流"
};
const zhCommands = {
  "Comfy-Desktop_Folders_OpenCustomNodesFolder": {
    label: "打开自定义节点文件夹"
  },
  "Comfy-Desktop_Folders_OpenInputsFolder": {
    label: "打开输入文件夹"
  },
  "Comfy-Desktop_Folders_OpenLogsFolder": {
    label: "打开日志文件夹"
  },
  "Comfy-Desktop_Folders_OpenModelConfig": {
    label: "打开 extra_model_paths.yaml"
  },
  "Comfy-Desktop_Folders_OpenModelsFolder": {
    label: "打开模型文件夹"
  },
  "Comfy-Desktop_Folders_OpenOutputsFolder": {
    label: "打开输出文件夹"
  },
  "Comfy-Desktop_OpenDevTools": {
    label: "打开开发者工具"
  },
  "Comfy-Desktop_OpenFeedbackPage": {
    label: "反馈"
  },
  "Comfy-Desktop_OpenUserGuide": {
    label: "桌面用户指南"
  },
  "Comfy-Desktop_Reinstall": {
    label: "重新安装"
  },
  "Comfy-Desktop_Restart": {
    label: "重启"
  },
  Comfy_BrowseTemplates,
  Comfy_Canvas_FitView,
  Comfy_Canvas_ResetView,
  Comfy_Canvas_ToggleLinkVisibility,
  Comfy_Canvas_ToggleLock,
  Comfy_Canvas_ToggleSelectedNodes_Bypass,
  Comfy_Canvas_ToggleSelectedNodes_Collapse,
  Comfy_Canvas_ToggleSelectedNodes_Mute,
  Comfy_Canvas_ToggleSelectedNodes_Pin,
  Comfy_Canvas_ToggleSelected_Pin,
  Comfy_Canvas_ZoomIn,
  Comfy_Canvas_ZoomOut,
  Comfy_ClearPendingTasks,
  Comfy_ClearWorkflow,
  Comfy_DuplicateWorkflow,
  Comfy_ExportWorkflow,
  Comfy_ExportWorkflowAPI,
  Comfy_Graph_FitGroupToContents,
  Comfy_Graph_GroupSelectedNodes,
  Comfy_GroupNode_ConvertSelectedNodesToGroupNode,
  Comfy_GroupNode_ManageGroupNodes,
  Comfy_GroupNode_UngroupSelectedGroupNodes,
  Comfy_Help_AboutComfyUI,
  Comfy_Help_OpenComfyOrgDiscord,
  Comfy_Help_OpenComfyUIDocs,
  Comfy_Help_OpenComfyUIIssues,
  Comfy_Interrupt,
  Comfy_LoadDefaultWorkflow,
  Comfy_NewBlankWorkflow,
  Comfy_OpenClipspace,
  Comfy_OpenWorkflow,
  Comfy_QueuePrompt,
  Comfy_QueuePromptFront,
  Comfy_Redo,
  Comfy_RefreshNodeDefinitions,
  Comfy_SaveWorkflow,
  Comfy_SaveWorkflowAs,
  Comfy_ShowSettingsDialog,
  Comfy_ToggleTheme,
  Comfy_Undo,
  Workspace_NextOpenedWorkflow,
  Workspace_PreviousOpenedWorkflow,
  Workspace_SearchBox_Toggle,
  Workspace_ToggleBottomPanel,
  "Workspace_ToggleBottomPanelTab_command-terminal": {
    label: "切换终端底部面板"
  },
  "Workspace_ToggleBottomPanelTab_logs-terminal": {
    label: "切换日志底部面板"
  },
  Workspace_ToggleFocusMode,
  "Workspace_ToggleSidebarTab_model-library": {
    label: "切换模型库侧边栏",
    tooltip: "模型库"
  },
  "Workspace_ToggleSidebarTab_node-library": {
    label: "切换节点库侧边栏",
    tooltip: "节点库"
  },
  Workspace_ToggleSidebarTab_queue,
  Workspace_ToggleSidebarTab_workflows
};
const color = {
  blue: "蓝色",
  custom: "自定义",
  "default": "默认",
  green: "绿色",
  pink: "粉色",
  red: "红色",
  yellow: "黄色"
};
const dataTypes = {
  AUDIO: "音频",
  BOOLEAN: "布尔",
  CLIP: "CLIP",
  CLIP_VISION: "CLIP视觉",
  CLIP_VISION_OUTPUT: "CLIP视觉输出",
  COMBO: "组合",
  CONDITIONING: "条件",
  CONTROL_NET: "ControlNet",
  FLOAT: "浮点",
  FLOATS: "浮点组",
  GLIGEN: "GLIGEN",
  GUIDER: "引导器",
  HOOKS: "约束",
  HOOK_KEYFRAMES: "约束关键帧",
  IMAGE: "图像",
  INT: "整数",
  LATENT: "Latent",
  LATENT_OPERATION: "Latent操作",
  LOAD_3D: "加载3D",
  LOAD_3D_ANIMATION: "加载3D动画",
  MASK: "遮罩",
  MODEL: "模型",
  NOISE: "噪波",
  PHOTOMAKER: "PhotoMaker",
  SAMPLER: "采样器",
  SIGMAS: "Sigmas",
  STRING: "字符串",
  STYLE_MODEL: "风格模型",
  TIMESTEPS_RANGE: "时间间隔范围",
  UPSCALE_MODEL: "放大模型",
  VAE: "VAE",
  WEBCAM: "摄像头"
};
const desktopMenu = {
  confirmReinstall: "这将清除您的 extra_models_config.yaml 文件，并重新开始安装。您确定吗？",
  reinstall: "重新安装"
};
const downloadGit = {
  gitWebsite: "下载 git",
  instructions: "请下载并安装适合您操作系统的最新版本。下面的下载 git 按钮将打开 git-scm.com 下载页面。",
  message: "无法找到 git。正常操作需要一个可用的 git 副本。",
  skip: "跳过",
  title: "下载 git",
  warning: "如果您确定不需要安装 git，或者已经安装了 git，您可以点击跳过以绕过此检查。当前不支持在没有可用 git 副本的情况下运行 ComfyUI。"
};
const electronFileDownload = {
  cancel: "取消下载",
  cancelled: "已取消",
  inProgress: "进行中",
  pause: "暂停下载",
  paused: "已暂停",
  resume: "恢复下载"
};
const g = {
  about: "关于",
  add: "添加",
  back: "返回",
  cancel: "取消",
  close: "关闭",
  color: "颜色",
  comingSoon: "即将推出",
  command: "指令",
  confirm: "确认",
  copyToClipboard: "复制到剪贴板",
  currentUser: "当前用户",
  customize: "自定义",
  customizeFolder: "自定义文件夹",
  "delete": "删除",
  deprecated: "已弃用",
  devices: "设备",
  disableAll: "禁用全部",
  download: "下载",
  empty: "空",
  enableAll: "启用全部",
  error: "错误",
  experimental: "测试版",
  extensionName: "扩展名称",
  findIssues: "查找问题",
  firstTimeUIMessage: '这是您第一次使用新界面。选择 "菜单 > 使用新菜单 > 禁用" 来恢复旧界面。',
  goToNode: "转到节点",
  icon: "图标",
  imageFailedToLoad: "图像加载失败",
  "import": "导入",
  insert: "插入",
  install: "安装",
  keybinding: "按键绑定",
  loadAllFolders: "加载所有文件夹",
  loadWorkflow: "加载工作流",
  loading: "加载中",
  logs: "日志",
  newFolder: "新文件夹",
  next: "下一个",
  no: "否",
  noResultsFound: "未找到结果",
  noTasksFound: "未找到任务",
  noTasksFoundMessage: "队列中没有任务。",
  noWorkflowsFound: "未找到工作流。",
  openNewIssue: "打开新问题",
  overwrite: "覆盖",
  reconnected: "已重新连接",
  reconnecting: "重新连接中",
  refresh: "刷新",
  reloadToApplyChanges: "重新加载以应用更改",
  rename: "重命名",
  reportIssue: "发送报告",
  reportIssueTooltip: "向 Comfy Org 提交错误报告",
  reportSent: "报告已提交",
  reset: "重置",
  resetKeybindingsTooltip: "将快捷键重置为默认",
  save: "保存",
  searchExtensions: "搜索扩展",
  searchFailedMessage: "我们找不到任何与您的搜索匹配的设置。请尝试调整您的搜索词。",
  searchKeybindings: "搜索快捷键",
  searchModels: "搜索模型",
  searchNodes: "搜索节点",
  searchSettings: "搜索设置",
  searchWorkflows: "搜索工作流",
  settings: "设置",
  showReport: "显示报告",
  systemInfo: "系统信息",
  terminal: "终端",
  upload: "上传",
  videoFailedToLoad: "视频加载失败"
};
const graphCanvasMenu = {
  fitView: "适应视图",
  panMode: "平移模式",
  resetView: "重置视图",
  selectMode: "选择模式",
  toggleLinkVisibility: "切换连线可见性",
  zoomIn: "放大",
  zoomOut: "缩小"
};
const groupNode = {
  create: "创建组节点",
  enterName: "输入名称"
};
const icon = {
  bookmark: "书签",
  box: "盒子",
  briefcase: "公文包",
  "exclamation-triangle": "警告",
  file: "文件",
  folder: "文件夹",
  heart: "心",
  inbox: "收件箱",
  star: "星星"
};
const install = {
  appDataLocationTooltip: "ComfyUI 的应用数据目录。存储：\n- 日志\n- 服务器配置",
  appPathLocationTooltip: "ComfyUI 的应用资产目录。存储 ComfyUI 代码和资产",
  cannotWrite: "无法写入所选路径。",
  chooseInstallationLocation: "选择安装位置",
  customNodes: "自定义节点",
  customNodesDescription: "引用现有 ComfyUI 安装的自定义节点文件并安装其依赖项。",
  desktopAppSettings: "桌面应用设置",
  desktopAppSettingsDescription: "配置 ComfyUI 在桌面上的行为。您可以稍后更改这些设置。",
  desktopSettings: "桌面设置",
  failedToSelectDirectory: "选择目录失败",
  gpu: "GPU",
  gpuSelection: {
    cpuMode: "CPU 模式",
    cpuModeDescription: "CPU 模式仅适用于开发者和极少数特殊情况。",
    cpuModeDescription2: "如果你不完全确定你需要这个，忽略该选项并在上面选择你的 GPU。",
    customComfyNeedsPython: "在 python 完成设置前，ComfyUI 将无法工作",
    customInstallRequirements: "安装所有需求和依赖项（例如：自定义 torch）",
    customManualVenv: "手动配置 python 虚拟环境",
    customMayNotWork: "完全不支持，可能无法工作",
    customSkipsPython: "此选项跳过正常的 python 设置。",
    enableCpuMode: "启用 CPU 模式",
    mpsDescription: "Apple Metal Performance Shaders 使用 pytorch nightly 支持。",
    nvidiaDescription: "NVIDIA 设备直接支持使用 pytorch CUDA 构建。",
    selectGpu: "选择 GPU",
    selectGpuDescription: "选择你拥有的 GPU 类型"
  },
  installLocation: "安装位置",
  installLocationDescription: "选择 ComfyUI 用户数据的存放目录。将安装一个 Python 环境到所选位置。请确保所选磁盘有足够的空间（约 15GB）。",
  installLocationTooltip: "ComfyUI 的用户数据目录。存储：\n- Python 环境\n- 模型\n- 自定义节点\n",
  insufficientFreeSpace: "空间不足 - 最小可用空间",
  manualConfiguration: {
    createVenv: "您需要在以下目录中创建虚拟环境",
    requirements: "依赖项",
    restartWhenFinished: "配置虚拟环境完成后，请重新启动ComfyUI。",
    title: "手动配置",
    virtualEnvironmentPath: "虚拟环境路径"
  },
  migrateFromExistingInstallation: "从现有安装迁移",
  migration: "迁移",
  migrationOptional: "迁移是可选的。如果您之前没有安装过 ComfyUI，可以跳过此步骤。",
  migrationSourcePathDescription: "如果您有可用的 ComfyUI，我们可以将您的现有用户文件和模型复制/链接到新安装。",
  parentMissing: "路径不存在 - 请先创建包含该路径的目录",
  pathExists: "目录已存在 - 请确保您已备份全部数据",
  pathValidationFailed: "路径验证失败",
  selectItemsToMigrate: "选择要迁移的项目",
  settings: {
    allowMetrics: "崩溃报告",
    allowMetricsDescription: "发送匿名崩溃报告帮助改善 ComfyUI。报告不会收集任何个人信息或工作流内容。您可以随时在设置菜单中禁用此功能。",
    autoUpdate: "自动更新",
    autoUpdateDescription: "更新可用时自动更新。您将在安装更新之前收到通知。",
    dataCollectionDialog: {
      customNodeConfigurations: "自定义节点配置",
      errorReports: "错误信息和堆栈跟踪",
      fileSystemInformation: "文件系统信息",
      personalInformation: "个人信息",
      systemInfo: "硬件、操作系统类型和应用版本",
      title: "关于数据收集",
      whatWeCollect: "我们收集的内容：",
      whatWeDoNotCollect: "我们不收集的内容：",
      workflowContent: "工作流内容",
      workflowContents: "工作流内容"
    },
    learnMoreAboutData: "了解更多关于数据收集的信息"
  },
  systemLocations: "系统位置",
  unhandledError: "未知错误"
};
const menu = {
  autoQueue: "自动执行",
  batchCount: "批次数量",
  batchCountTooltip: "工作流生成次数",
  clear: "清空工作流",
  clipspace: "打开剪贴板",
  disabled: "禁用",
  disabledTooltip: "工作流将不会自动执行",
  execute: "执行",
  hideMenu: "隐藏菜单",
  instant: "实时",
  instantTooltip: "工作流将会在生成完成后立即执行",
  interrupt: "取消当前任务",
  onChange: "更改时",
  onChangeTooltip: "一旦进行更改，工作流将添加到执行队列",
  queue: "执行",
  queueWorkflow: "执行 (Shift 添加到队列首)",
  queueWorkflowFront: "执行到队列首",
  refresh: "刷新节点",
  resetView: "重置视图",
  showMenu: "显示菜单",
  toggleBottomPanel: "底部面板"
};
const menuLabels = {
  "About ComfyUI": "关于ComfyUI",
  "Browse Templates": "浏览模板",
  "Bypass/Unbypass Selected Nodes": "忽略/取消忽略选定节点",
  "Canvas Toggle Link Visibility": "切换连线可见性",
  "Canvas Toggle Lock": "切换视图锁定",
  "Clear Pending Tasks": "清除待处理任务",
  "Clear Workflow": "清除工作流",
  Clipspace: "剪贴空间",
  "Collapse/Expand Selected Nodes": "折叠/展开选定节点",
  "Comfy-Org Discord": "Comfy-Org Discord",
  "ComfyUI Docs": "ComfyUI 文档",
  "ComfyUI Issues": "ComfyUI 问题",
  "Convert selected nodes to group node": "将选中节点转换为组节点",
  "Desktop User Guide": "桌面端用户指南",
  "Duplicate Current Workflow": "复制当前工作流",
  Edit: "编辑",
  Export: "导出",
  "Export (API)": "导出 (API)",
  Feedback: "反馈",
  "Fit Group To Contents": "适应组内容",
  "Fit view to selected nodes": "适应视图到选中节点",
  "Group Selected Nodes": "将选中节点转换为组节点",
  Help: "帮助",
  Interrupt: "中断",
  "Load Default Workflow": "加载默认工作流",
  "Manage group nodes": "管理组节点",
  "Mute/Unmute Selected Nodes": "静音/取消静音选定节点",
  New: "新建",
  "Next Opened Workflow": "下一个打开的工作流",
  Open: "打开",
  "Open Custom Nodes Folder": "打开自定义节点文件夹",
  "Open DevTools": "打开开发者工具",
  "Open Inputs Folder": "打开输入文件夹",
  "Open Logs Folder": "打开日志文件夹",
  "Open Models Folder": "打开模型文件夹",
  "Open Outputs Folder": "打开输出文件夹",
  "Open extra_model_paths_yaml": "打开 extra_model_paths.yaml",
  "Pin/Unpin Selected Items": "固定/取消固定选定项目",
  "Pin/Unpin Selected Nodes": "固定/取消固定选定节点",
  "Previous Opened Workflow": "上一个打开的工作流",
  "Queue Prompt": "执行提示词",
  "Queue Prompt (Front)": "执行提示词 (优先执行)",
  Redo: "重做",
  "Refresh Node Definitions": "刷新节点定义",
  Reinstall: "重新安装",
  "Reset View": "重置视图",
  Restart: "重启",
  Save: "保存",
  "Save As": "另存为",
  "Show Settings Dialog": "显示设置对话框",
  "Toggle Bottom Panel": "切换底部面板",
  "Toggle Focus Mode": "切换专注模式",
  "Toggle Logs Bottom Panel": "切换日志底部面板",
  "Toggle Model Library Sidebar": "切换模型库侧边栏",
  "Toggle Node Library Sidebar": "切换节点库侧边栏",
  "Toggle Queue Sidebar": "切换队列侧边栏",
  "Toggle Search Box": "切换搜索框",
  "Toggle Terminal Bottom Panel": "切换终端底部面板",
  "Toggle Theme (Dark/Light)": "切换主题（暗/亮）",
  "Toggle Workflows Sidebar": "切换工作流侧边栏",
  Undo: "撤销",
  "Ungroup selected group nodes": "解散选中组节点",
  Workflow: "工作流",
  "Zoom In": "放大画面",
  "Zoom Out": "缩小画面"
};
const nodeCategories = {
  "3d": "3d",
  "3d_models": "3D模型",
  DevTools: "开发工具",
  _for_testing: "_用于测试",
  advanced: "高级",
  animation: "动画",
  api: "API",
  attention_experiments: "注意力实验",
  audio: "音频",
  batch: "批处理",
  clip: "CLIP",
  combine: "组合",
  compositing: "合成",
  "cond pair": "条件对",
  "cond single": "条件单",
  conditioning: "条件",
  controlnet: "ControlNet",
  create: "创建",
  custom_sampling: "自定义采样",
  deprecated: "已弃用",
  flux: "Flux",
  gligen: "GLIGEN",
  guidance: "引导",
  guiders: "引导器",
  hooks: "约束",
  image: "图像",
  inpaint: "局部重绘",
  instructpix2pix: "InstructPix2Pix",
  latent: "Latent",
  loaders: "加载器",
  ltxv: "LTXV",
  mask: "遮罩",
  model: "模型",
  model_merging: "模型合并",
  model_patches: "模型微调",
  model_specific: "模型特定",
  noise: "噪波",
  operations: "操作",
  photomaker: "PhotoMaker",
  postprocessing: "后处理",
  preprocessors: "预处理器",
  samplers: "采样器",
  sampling: "采样",
  schedulers: "调度器",
  scheduling: "调度",
  sd3: "SD3",
  sigmas: "Sigmas",
  stable_cascade: "StableCascade",
  style_model: "风格模型",
  transform: "变换",
  unet: "U-Net",
  upscale_diffusion: "放大扩散",
  upscaling: "放大",
  video: "视频",
  video_models: "视频模型"
};
const nodeTemplates = {
  enterName: "输入名称",
  saveAsTemplate: "另存为模板"
};
const notSupported = {
  "continue": "继续",
  continueTooltip: "我确定我的设备是受支持的",
  learnMore: "了解更多",
  message: "仅支持以下设备：",
  reportIssue: "报告问题",
  supportedDevices: {
    macos: "MacOS (M1 或更高版本)",
    windows: "Windows (支持 CUDA 的 Nvidia GPU)"
  },
  title: "您的设备不受支持"
};
const serverConfig = {
  modifiedConfigs: "您已修改以下服务器配置。重启以应用更改。",
  restart: "重启",
  revertChanges: "撤销更改"
};
const serverConfigCategories = {
  Attention: "注意力",
  CUDA: "CUDA",
  Cache: "缓存",
  Directories: "目录",
  General: "常规",
  Inference: "推理",
  Memory: "内存",
  Network: "网络",
  Preview: "预览"
};
const serverConfigItems = {
  "cache-classic": {
    name: "使用经典缓存系统"
  },
  "cache-lru": {
    name: "使用 LRU 缓存，最多缓存 N 个节点结果。",
    tooltip: "可能会使用更多的 RAM/VRAM。"
  },
  "cpu-vae": {
    name: "在 CPU 上运行 VAE"
  },
  "cross-attention-method": {
    name: "交叉注意力方法"
  },
  "cuda-device": {
    name: "要使用的 CUDA 设备索引"
  },
  "cuda-malloc": {
    name: "使用 CUDA malloc 进行内存分配"
  },
  "default-hashing-function": {
    name: "模型文件的默认哈希函数"
  },
  deterministic: {
    name: "使 pytorch 在可以时使用较慢的确定性算法。",
    tooltip: "请注意，这可能不会在所有情况下使图像具有确定性。"
  },
  directml: {
    name: "DirectML 设备索引"
  },
  "disable-all-custom-nodes": {
    name: "禁用加载所有自定义节点。"
  },
  "disable-ipex-optimize": {
    name: "禁用 IPEX 优化"
  },
  "disable-metadata": {
    name: "禁用在文件中保存提示元数据。"
  },
  "disable-smart-memory": {
    name: "禁用智能内存管理",
    tooltip: "强制 ComfyUI 在可以时将模型从 VRAM 移出到常规 RAM。"
  },
  "disable-xformers": {
    name: "禁用 xFormers 优化"
  },
  "dont-print-server": {
    name: "不将服务器输出打印到控制台。"
  },
  "dont-upcast-attention": {
    name: "不使用 upcast-attention"
  },
  "enable-cors-header": {
    name: '启用 CORS header：使用 "*" 代表所有来源或指定域名'
  },
  fast: {
    name: "启用一些未经测试且可能降低质量的优化。"
  },
  "force-channels-last": {
    name: "强制使用 channels-last 内存格式"
  },
  "force-upcast-attention": {
    name: "强制 upcast-attention"
  },
  "global-precision": {
    name: "全局浮点精度",
    tooltip: "全局浮点精度"
  },
  "input-directory": {
    name: "输入目录"
  },
  listen: {
    name: "主机：要监听的IP地址"
  },
  "log-level": {
    name: "日志详细级别"
  },
  "max-upload-size": {
    name: "最大上传大小 (MB)"
  },
  "output-directory": {
    name: "输出目录"
  },
  port: {
    name: "端口：要监听的端口"
  },
  "preview-method": {
    name: "用于潜空间预览的方法"
  },
  "preview-size": {
    name: "预览图像的大小"
  },
  "reserve-vram": {
    name: "保留 VRAM (GB)",
    tooltip: "设置您希望为操作系统/其他软件保留的 VRAM （GB）。默认会根据系统类型保留一定数量。"
  },
  "text-encoder-precision": {
    name: "文本编码器精度",
    tooltip: "文本编码器精度"
  },
  "tls-certfile": {
    name: "TLS 证书文件：HTTPS 的 TLS 证书文件路径"
  },
  "tls-keyfile": {
    name: "TLS 密钥文件：HTTPS 的 TLS 密钥文件路径"
  },
  "unet-precision": {
    name: "UNET 精度",
    tooltip: "UNET 精度"
  },
  "vae-precision": {
    name: "VAE 精度",
    tooltip: "VAE 精度"
  },
  "vram-management": {
    name: "VRAM 管理模式"
  }
};
const serverStart = {
  openLogs: "打开日志",
  process: {
    error: "无法启动 ComfyUI 桌面版",
    "initial-state": "加载中...",
    "python-setup": "正在设置 Python 环境...",
    ready: "完成中...",
    "starting-server": "正在启动 ComfyUI 服务器..."
  },
  reinstall: "重新安装",
  reportIssue: "报告问题",
  showTerminal: "显示终端"
};
const settingsCategories = {
  About: "关于",
  Appearance: "外观",
  BrushAdjustment: "画笔调整",
  Canvas: "画布",
  ColorPalette: "色彩主题",
  Comfy: "Comfy",
  "Comfy-Desktop": "Comfy桌面版",
  CustomColorPalettes: "自定义色彩主题",
  DevMode: "开发模式",
  EditTokenWeight: "编辑令牌权重",
  Extension: "扩展",
  General: "常规",
  Graph: "画面",
  Group: "组节点",
  Keybinding: "快捷键",
  Link: "连线",
  LinkRelease: "释放链接",
  LiteGraph: "画面",
  Locale: "区域设置",
  "Mask Editor": "遮罩编辑器",
  Menu: "菜单",
  ModelLibrary: "模型库",
  NewEditor: "新编辑器",
  Node: "节点",
  "Node Search Box": "节点搜索框",
  "Node Widget": "节点组件",
  NodeInputConversionSubmenus: "节点输入转换子菜单",
  NodeLibrary: "节点库",
  Pointer: "指针",
  Queue: "队列",
  QueueButton: "执行按钮",
  RerouteBeta: "转接点 Beta",
  Server: "服务器",
  "Server-Config": "服务器配置",
  Settings: "设置",
  Sidebar: "侧边栏",
  "Tree Explorer": "树形浏览器",
  Validation: "验证",
  Window: "窗口",
  Workflow: "工作流"
};
const sideToolbar = {
  browseTemplates: "浏览示例模板",
  downloads: "下载",
  logout: "登出",
  modelLibrary: "模型库",
  newBlankWorkflow: "创建空白工作流",
  nodeLibrary: "节点库",
  nodeLibraryTab: {
    sortOrder: "排序顺序"
  },
  openWorkflow: "在本地文件系统中打开工作流",
  queue: "队列",
  queueTab: {
    backToAllTasks: "返回",
    clearPendingTasks: "清除待处理任务",
    containImagePreview: "填充图像预览",
    coverImagePreview: "适应图像预览",
    filter: "过滤输出",
    filters: {
      hideCached: "隐藏缓存",
      hideCanceled: "隐藏已取消"
    },
    showFlatList: "平铺结果"
  },
  themeToggle: "主题切换",
  workflowTab: {
    confirmDelete: "您确定要删除此工作流吗？",
    confirmDeleteTitle: "删除工作流？",
    confirmOverwrite: "下面的文件已经存在。您想要覆盖它吗？",
    confirmOverwriteTitle: "覆盖现有文件？",
    deleteFailed: "尝试删除工作流失败。",
    deleteFailedTitle: "删除失败",
    deleted: "工作流已删除",
    dirtyClose: "以下文件已被更改。您想在关闭之前保存它们吗？",
    dirtyCloseTitle: "保存更改？",
    workflowTreeType: {
      bookmarks: "书签",
      browse: "浏览",
      open: "打开"
    }
  },
  workflows: "工作流"
};
const tabMenu = {
  closeOtherTabs: "关闭其他标签",
  closeTab: "关闭标签",
  closeTabsToLeft: "关闭左侧标签",
  closeTabsToRight: "关闭右侧标签",
  duplicateTab: "复制标签"
};
const templateWorkflows = {
  template: {
    "default": "默认",
    flux_schnell: "Flux Schnell",
    image2image: "图像到图像",
    upscale: "2步放大"
  },
  title: "从模板开始"
};
const userSelect = {
  enterUsername: "输入用户名",
  existingUser: "用户已存在",
  newUser: "新用户",
  next: "下一步",
  selectUser: "选择用户"
};
const welcome = {
  getStarted: "开始使用",
  title: "欢迎使用 ComfyUI"
};
const workflowService = {
  enterFilename: "输入文件名",
  exportWorkflow: "导出工作流",
  saveWorkflow: "保存工作流"
};
const zh = {
  color,
  dataTypes,
  desktopMenu,
  downloadGit,
  electronFileDownload,
  g,
  graphCanvasMenu,
  groupNode,
  icon,
  install,
  menu,
  menuLabels,
  nodeCategories,
  nodeTemplates,
  notSupported,
  serverConfig,
  serverConfigCategories,
  serverConfigItems,
  serverStart,
  settingsCategories,
  sideToolbar,
  tabMenu,
  templateWorkflows,
  userSelect,
  welcome,
  workflowService
};
const AddNoise = {
  display_name: "添加噪波",
  inputs: {
    latent_image: {
      name: "Latent"
    },
    model: {
      name: "模型"
    },
    noise: {
      name: "噪波"
    },
    sigmas: {
      name: "Sigmas"
    }
  }
};
const AlignYourStepsScheduler = {
  display_name: "AlignYourSteps调度器",
  inputs: {
    denoise: {
      name: "降噪"
    },
    model_type: {
      name: "模型类型"
    },
    steps: {
      name: "步数"
    }
  }
};
const BasicGuider = {
  display_name: "基本引导器",
  inputs: {
    conditioning: {
      name: "条件"
    },
    model: {
      name: "模型"
    }
  }
};
const BasicScheduler = {
  display_name: "基本调度器",
  inputs: {
    denoise: {
      name: "降噪"
    },
    model: {
      name: "模型"
    },
    scheduler: {
      name: "调度器"
    },
    steps: {
      name: "步数"
    }
  }
};
const BetaSamplingScheduler = {
  display_name: "Beta采样调度器",
  inputs: {
    alpha: {
      name: "阿尔法"
    },
    beta: {
      name: "贝塔"
    },
    model: {
      name: "模型"
    },
    steps: {
      name: "步数"
    }
  }
};
const CFGGuider = {
  display_name: "CFG引导器",
  inputs: {
    cfg: {
      name: "CFG"
    },
    model: {
      name: "模型"
    },
    negative: {
      name: "负面条件"
    },
    positive: {
      name: "正面条件"
    }
  }
};
const CLIPAttentionMultiply = {
  display_name: "CLIP注意力相乘",
  inputs: {
    clip: {
      name: "clip"
    },
    k: {
      name: "k"
    },
    out: {
      name: "输出"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const CLIPLoader = {
  description: "[配方]\n\nStable Diffusion：clip-l\nStable Cascade：clip-g\nSD3：t5 / clip-g / clip-l\nStable Audio：t5\nMochi：t5",
  display_name: "加载CLIP",
  inputs: {
    clip_name: {
      name: "CLIP名称"
    },
    type: {
      name: "类型"
    }
  }
};
const CLIPMergeAdd = {
  display_name: "CLIP相加",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    }
  }
};
const CLIPMergeSimple = {
  display_name: "CLIP融合简易",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    ratio: {
      name: "比例"
    }
  }
};
const CLIPMergeSubtract = {
  display_name: "CLIP相减",
  inputs: {
    clip1: {
      name: "clip1"
    },
    clip2: {
      name: "clip2"
    },
    multiplier: {
      name: "乘数"
    }
  }
};
const CLIPSave = {
  display_name: "CLIP保存",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "文件名前缀"
    }
  }
};
const CLIPSetLastLayer = {
  display_name: "设置CLIP最后一层",
  inputs: {
    clip: {
      name: "clip"
    },
    stop_at_clip_layer: {
      name: "停止在CLIP层"
    }
  }
};
const CLIPTextEncode = {
  description: "使用 CLIP 模型将文本编码成嵌入组（embedding），用于引导扩散模型生成图像。",
  display_name: "CLIP文本编码",
  inputs: {
    clip: {
      name: "clip",
      tooltip: "用于编码文本的 CLIP 模型。"
    },
    text: {
      name: "文本",
      tooltip: "要编码的文本。"
    }
  },
  outputs: {
    "0": {
      tooltip: "包含嵌入文本的条件，用于引导扩散模型。"
    }
  }
};
const CLIPTextEncodeControlnet = {
  display_name: "CLIP文本编码ControlNet",
  inputs: {
    clip: {
      name: "clip"
    },
    conditioning: {
      name: "条件"
    },
    text: {
      name: "文本"
    }
  }
};
const CLIPTextEncodeFlux = {
  display_name: "CLIP文本编码Flux",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_l: {
      name: "clip_l"
    },
    guidance: {
      name: "引导"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeHunyuanDiT = {
  display_name: "CLIP文本编码混元DiT",
  inputs: {
    bert: {
      name: "bert"
    },
    clip: {
      name: "clip"
    },
    mt5xl: {
      name: "mt5xl"
    }
  }
};
const CLIPTextEncodePixArtAlpha = {
  description: "编码文本并设置PixArt Alpha的分辨率条件。不适用于PixArt Sigma。",
  display_name: "CLIPTextEncodePixArtAlpha",
  inputs: {
    clip: {
      name: "剪辑"
    },
    height: {
      name: "高度"
    },
    text: {
      name: "文本"
    },
    width: {
      name: "宽度"
    }
  }
};
const CLIPTextEncodeSD3 = {
  display_name: "CLIP文本编码SD3",
  inputs: {
    clip: {
      name: "clip"
    },
    clip_g: {
      name: "clip_g"
    },
    clip_l: {
      name: "clip_l"
    },
    empty_padding: {
      name: "空白填充"
    },
    t5xxl: {
      name: "t5xxl"
    }
  }
};
const CLIPTextEncodeSDXL = {
  display_name: "CLIP文本编码SDXL",
  inputs: {
    clip: {
      name: "clip"
    },
    crop_h: {
      name: "裁剪高"
    },
    crop_w: {
      name: "裁剪宽"
    },
    height: {
      name: "高度"
    },
    target_height: {
      name: "目标高度"
    },
    target_width: {
      name: "目标宽度"
    },
    text_g: {
      name: "文本_g"
    },
    text_l: {
      name: "文本_l"
    },
    width: {
      name: "宽度"
    }
  }
};
const CLIPTextEncodeSDXLRefiner = {
  display_name: "CLIP文本编码SDXL精炼器",
  inputs: {
    ascore: {
      name: "美学分数"
    },
    clip: {
      name: "clip"
    },
    height: {
      name: "高度"
    },
    text: {
      name: "文本"
    },
    width: {
      name: "宽度"
    }
  }
};
const CLIPVisionEncode = {
  display_name: "CLIP视觉编码",
  inputs: {
    clip_vision: {
      name: "clip视觉"
    },
    crop: {
      name: "裁剪"
    },
    image: {
      name: "图像"
    }
  }
};
const CLIPVisionLoader = {
  display_name: "加载CLIP视觉",
  inputs: {
    clip_name: {
      name: "clip名称"
    }
  }
};
const Canny = {
  display_name: "Canny边缘检测",
  inputs: {
    high_threshold: {
      name: "高阈值"
    },
    image: {
      name: "图像"
    },
    low_threshold: {
      name: "低阈值"
    }
  }
};
const CheckpointLoader = {
  display_name: "Ckeckpoint加载器（已弃用）",
  inputs: {
    ckpt_name: {
      name: "Checkpoint名称"
    },
    config_name: {
      name: "配置名称"
    }
  }
};
const CheckpointLoaderSimple = {
  description: "加载扩散模型 Checkpoint，用于去除 Latent 噪波。",
  display_name: "Checkpoint加载器（简易）",
  inputs: {
    ckpt_name: {
      name: "Checkpoint名称",
      tooltip: "要加载的Checkpoint模型的名称。"
    }
  },
  outputs: {
    "0": {
      tooltip: "用于去除 Latent 噪波的模型。"
    },
    "1": {
      tooltip: "用于编码文本提示的 CLIP 模型。"
    },
    "2": {
      tooltip: "用于将图像编码和解码到 Latent 的 VAE 模型。"
    }
  }
};
const CheckpointSave = {
  display_name: "保存Checkpoint",
  inputs: {
    clip: {
      name: "clip"
    },
    filename_prefix: {
      name: "文件名前缀"
    },
    model: {
      name: "模型"
    },
    vae: {
      name: "vae"
    }
  }
};
const CombineHooks2 = {
  display_name: "组合约束 [2]",
  inputs: {
    hooks_A: {
      name: "约束_A"
    },
    hooks_B: {
      name: "约束_B"
    }
  }
};
const CombineHooks4 = {
  display_name: "组合约束 [4]",
  inputs: {
    hooks_A: {
      name: "约束_A"
    },
    hooks_B: {
      name: "约束_B"
    },
    hooks_C: {
      name: "约束_C"
    },
    hooks_D: {
      name: "约束_D"
    }
  }
};
const CombineHooks8 = {
  display_name: "组合约束 [8]",
  inputs: {
    hooks_A: {
      name: "约束_A"
    },
    hooks_B: {
      name: "约束_B"
    },
    hooks_C: {
      name: "约束_C"
    },
    hooks_D: {
      name: "约束_D"
    },
    hooks_E: {
      name: "约束_E"
    },
    hooks_F: {
      name: "约束_F"
    },
    hooks_G: {
      name: "约束_G"
    },
    hooks_H: {
      name: "约束_H"
    }
  }
};
const ConditioningAverage = {
  display_name: "条件平均",
  inputs: {
    conditioning_from: {
      name: "条件从"
    },
    conditioning_to: {
      name: "条件到"
    },
    conditioning_to_strength: {
      name: "条件到强度"
    }
  }
};
const ConditioningCombine = {
  display_name: "条件合并",
  inputs: {
    conditioning_1: {
      name: "条件_1"
    },
    conditioning_2: {
      name: "条件_2"
    }
  }
};
const ConditioningConcat = {
  display_name: "条件连接",
  inputs: {
    conditioning_from: {
      name: "条件从"
    },
    conditioning_to: {
      name: "条件到"
    }
  }
};
const ConditioningSetArea = {
  display_name: "条件采样区域",
  inputs: {
    conditioning: {
      name: "条件"
    },
    height: {
      name: "高度"
    },
    strength: {
      name: "强度"
    },
    width: {
      name: "宽度"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaPercentage = {
  display_name: "条件采样区域（系数）",
  inputs: {
    conditioning: {
      name: "条件化"
    },
    height: {
      name: "高度"
    },
    strength: {
      name: "强度"
    },
    width: {
      name: "宽度"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ConditioningSetAreaStrength = {
  display_name: "条件采样区域强度",
  inputs: {
    conditioning: {
      name: "条件化"
    },
    strength: {
      name: "强度"
    }
  }
};
const ConditioningSetDefaultCombine = {
  display_name: "条件设置默认合并",
  inputs: {
    cond: {
      name: "条件"
    },
    cond_DEFAULT: {
      name: "默认条件"
    },
    hooks: {
      name: "约束"
    }
  }
};
const ConditioningSetMask = {
  display_name: "条件遮罩",
  inputs: {
    conditioning: {
      name: "条件化"
    },
    mask: {
      name: "遮罩"
    },
    set_cond_area: {
      name: "设置条件区域"
    },
    strength: {
      name: "强度"
    }
  }
};
const ConditioningSetProperties = {
  display_name: "条件设置属性",
  inputs: {
    cond_NEW: {
      name: "新条件"
    },
    hooks: {
      name: "约束"
    },
    mask: {
      name: "遮罩"
    },
    set_cond_area: {
      name: "设置条件区域"
    },
    strength: {
      name: "强度"
    },
    timesteps: {
      name: "间隔"
    }
  }
};
const ConditioningSetPropertiesAndCombine = {
  display_name: "条件设置属性合并",
  inputs: {
    cond: {
      name: "条件"
    },
    cond_NEW: {
      name: "新条件"
    },
    hooks: {
      name: "约束"
    },
    mask: {
      name: "遮罩"
    },
    set_cond_area: {
      name: "设置条件区域"
    },
    strength: {
      name: "强度"
    },
    timesteps: {
      name: "间隔"
    }
  }
};
const ConditioningSetTimestepRange = {
  display_name: "设置条件时间",
  inputs: {
    conditioning: {
      name: "条件"
    },
    end: {
      name: "结束"
    },
    start: {
      name: "开始"
    }
  }
};
const ConditioningStableAudio = {
  display_name: "StableAudio条件",
  inputs: {
    negative: {
      name: "负面条件"
    },
    positive: {
      name: "正面条件"
    },
    seconds_start: {
      name: "开始秒数"
    },
    seconds_total: {
      name: "总秒数"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const ConditioningTimestepsRange = {
  display_name: "条件间隔范围",
  inputs: {
    end_percent: {
      name: "结束百分比"
    },
    start_percent: {
      name: "开始百分比"
    }
  },
  outputs: {
    "1": {
      name: "范围前"
    },
    "2": {
      name: "范围后"
    }
  }
};
const ConditioningZeroOut = {
  display_name: "条件零化",
  inputs: {
    conditioning: {
      name: "条件"
    }
  }
};
const ControlNetApply = {
  display_name: "应用ControlNet（旧版）",
  inputs: {
    conditioning: {
      name: "条件"
    },
    control_net: {
      name: "ControlNet"
    },
    image: {
      name: "图像"
    },
    strength: {
      name: "强度"
    }
  }
};
const ControlNetApplyAdvanced = {
  display_name: "应用ControlNet（旧版高级）",
  inputs: {
    control_net: {
      name: "ControlNet"
    },
    end_percent: {
      name: "结束百分比"
    },
    image: {
      name: "图像"
    },
    negative: {
      name: "负面条件"
    },
    positive: {
      name: "正面条件"
    },
    start_percent: {
      name: "开始百分比"
    },
    strength: {
      name: "强度"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const ControlNetApplySD3 = {
  display_name: "应用ControlNet",
  inputs: {
    control_net: {
      name: "ControlNet"
    },
    end_percent: {
      name: "结束百分比"
    },
    image: {
      name: "图像"
    },
    negative: {
      name: "负面条件"
    },
    positive: {
      name: "正面条件"
    },
    start_percent: {
      name: "开始百分比"
    },
    strength: {
      name: "强度"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const ControlNetInpaintingAliMamaApply = {
  display_name: "应用ControlNet（阿里妈妈局部重绘）",
  inputs: {
    control_net: {
      name: "ControlNet"
    },
    end_percent: {
      name: "结束百分比"
    },
    image: {
      name: "图像"
    },
    mask: {
      name: "遮罩"
    },
    negative: {
      name: "负面条件"
    },
    positive: {
      name: "正面条件"
    },
    start_percent: {
      name: "开始百分比"
    },
    strength: {
      name: "强度"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const ControlNetLoader = {
  display_name: "加载ControlNet模型",
  inputs: {
    control_net_name: {
      name: "ControlNet名称"
    }
  }
};
const CreateHookKeyframe = {
  display_name: "创建约束关键帧",
  inputs: {
    prev_hook_kf: {
      name: "前一个约束关键帧"
    },
    start_percent: {
      name: "开始百分比"
    },
    strength_mult: {
      name: "强度倍数"
    }
  },
  outputs: {
    "0": {
      name: "约束关键帧"
    }
  }
};
const CreateHookKeyframesFromFloats = {
  display_name: "从浮点数创建约束关键帧",
  inputs: {
    end_percent: {
      name: "结束百分比"
    },
    floats_strength: {
      name: "浮点强度"
    },
    prev_hook_kf: {
      name: "前一个约束关键帧"
    },
    print_keyframes: {
      name: "打印关键帧"
    },
    start_percent: {
      name: "开始百分比"
    }
  },
  outputs: {
    "0": {
      name: "约束关键帧"
    }
  }
};
const CreateHookKeyframesInterpolated = {
  display_name: "创建约束关键帧插值",
  inputs: {
    end_percent: {
      name: "结束百分比"
    },
    interpolation: {
      name: "插值"
    },
    keyframes_count: {
      name: "关键帧数量"
    },
    prev_hook_kf: {
      name: "前一个约束关键帧"
    },
    print_keyframes: {
      name: "打印关键帧"
    },
    start_percent: {
      name: "开始百分比"
    },
    strength_end: {
      name: "结束强度"
    },
    strength_start: {
      name: "开始强度"
    }
  },
  outputs: {
    "0": {
      name: "约束关键帧"
    }
  }
};
const CreateHookLora = {
  display_name: "创建约束LoRA",
  inputs: {
    lora_name: {
      name: "LoRA名称"
    },
    prev_hooks: {
      name: "前一个约束"
    },
    strength_clip: {
      name: "CLIP强度"
    },
    strength_model: {
      name: "模型强度"
    }
  }
};
const CreateHookLoraModelOnly = {
  display_name: "创建约束LoRA（仅模型）",
  inputs: {
    lora_name: {
      name: "LoRA名称"
    },
    prev_hooks: {
      name: "前一个约束"
    },
    strength_model: {
      name: "模型强度"
    }
  }
};
const CreateHookModelAsLora = {
  display_name: "创建约束模型为LoRA",
  inputs: {
    ckpt_name: {
      name: "Checkpoint名称"
    },
    prev_hooks: {
      name: "前一个约束"
    },
    strength_clip: {
      name: "CLIP强度"
    },
    strength_model: {
      name: "模型强度"
    }
  }
};
const CreateHookModelAsLoraModelOnly = {
  display_name: "创建约束模型为LoRA（仅模型）",
  inputs: {
    ckpt_name: {
      name: "Checkpoint名称"
    },
    prev_hooks: {
      name: "前一个约束"
    },
    strength_model: {
      name: "模型强度"
    }
  }
};
const CropMask = {
  display_name: "裁剪遮罩",
  inputs: {
    height: {
      name: "高度"
    },
    mask: {
      name: "遮罩"
    },
    width: {
      name: "宽度"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const DevToolsDeprecatedNode = {
  description: "一个已弃用的节点",
  display_name: "已弃用节点"
};
const DevToolsErrorRaiseNode = {
  description: "出于开发目的引发错误",
  display_name: "引发错误"
};
const DevToolsErrorRaiseNodeWithMessage = {
  description: "出于开发目的引发带消息的错误",
  display_name: "带消息的引发错误",
  inputs: {
    message: {
      name: "消息"
    }
  }
};
const DevToolsExperimentalNode = {
  description: "一个实验性的节点",
  display_name: "实验性节点"
};
const DevToolsLongComboDropdown = {
  description: "一个长组合下拉菜单",
  display_name: "长组合下拉菜单",
  inputs: {
    option: {
      name: "选项"
    }
  }
};
const DevToolsNodeWithForceInput = {
  description: "一个具有强制输入的节点",
  display_name: "强制输入节点",
  inputs: {
    float_input: {
      name: "浮点数输入"
    },
    int_input: {
      name: "整数输入"
    },
    int_input_widget: {
      name: "整数输入小部件"
    }
  }
};
const DevToolsNodeWithOnlyOptionalInput = {
  description: "一个仅有可选输入的节点",
  display_name: "仅有可选输入的节点",
  inputs: {
    clip: {
      name: "剪辑"
    },
    text: {
      name: "文本"
    }
  }
};
const DevToolsNodeWithOptionalInput = {
  description: "一个具有可选输入的节点",
  display_name: "具有可选输入的节点",
  inputs: {
    optional_input: {
      name: "可选输入"
    },
    required_input: {
      name: "必需输入"
    }
  }
};
const DevToolsNodeWithOutputList = {
  description: "一个具有输出列表的节点",
  display_name: "具有输出列表的节点",
  outputs: {
    "0": {
      name: "整数输出"
    },
    "1": {
      name: "整数列表输出"
    }
  }
};
const DevToolsNodeWithStringInput = {
  description: "一个具有字符串输入的节点",
  display_name: "具有字符串输入的节点",
  inputs: {
    string_input: {
      name: "字符串输入"
    }
  }
};
const DevToolsNodeWithUnionInput = {
  description: "一个具有联合输入的节点",
  display_name: "具有联合输入的节点",
  inputs: {
    int_input: {
      name: "整数输入"
    },
    string_input: {
      name: "字符串输入"
    },
    string_or_int_input: {
      name: "字符串或整数输入"
    }
  }
};
const DevToolsSimpleSlider = {
  display_name: "简单滑块",
  inputs: {
    value: {
      name: "值"
    }
  }
};
const DiffControlNetLoader = {
  display_name: "加载ControlNet模型（diff）",
  inputs: {
    control_net_name: {
      name: "ControlNet名称"
    },
    model: {
      name: "模型"
    }
  }
};
const DifferentialDiffusion = {
  display_name: "差异扩散DifferentialDiffusion",
  inputs: {
    model: {
      name: "模型"
    }
  }
};
const DiffusersLoader = {
  display_name: "Diffusers加载器",
  inputs: {
    model_path: {
      name: "模型路径"
    }
  }
};
const DisableNoise = {
  display_name: "禁用噪波"
};
const DualCFGGuider = {
  display_name: "双CFG引导器",
  inputs: {
    cfg_cond2_negative: {
      name: "cfg_条件2_负面"
    },
    cfg_conds: {
      name: "cfg_条件1"
    },
    cond1: {
      name: "条件1"
    },
    cond2: {
      name: "条件2"
    },
    model: {
      name: "模型"
    },
    negative: {
      name: "负面条件"
    }
  }
};
const DualCLIPLoader = {
  description: "[配方]\n\nSDXL：clip-l，clip-g\nSD3：clip-l，clip-g / clip-l，t5 / clip-g，t5\nFlux：clip-l，t5",
  display_name: "双CLIP加载器",
  inputs: {
    clip_name1: {
      name: "CLIP名称1"
    },
    clip_name2: {
      name: "CLIP名称2"
    },
    type: {
      name: "类型"
    }
  }
};
const EmptyHunyuanLatentVideo = {
  display_name: "空Latent视频（混元）",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    height: {
      name: "高度"
    },
    length: {
      name: "长度"
    },
    width: {
      name: "宽度"
    }
  }
};
const EmptyImage = {
  display_name: "空图像",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    color: {
      name: "颜色"
    },
    height: {
      name: "高度"
    },
    width: {
      name: "宽度"
    }
  }
};
const EmptyLTXVLatentVideo = {
  display_name: "空Latent视频（LTXV）",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    height: {
      name: "高度"
    },
    length: {
      name: "长度"
    },
    width: {
      name: "宽度"
    }
  }
};
const EmptyLatentAudio = {
  display_name: "空Latent音频",
  inputs: {
    batch_size: {
      name: "批量大小",
      tooltip: "批次中的Latent数量。"
    },
    seconds: {
      name: "秒"
    }
  }
};
const EmptyLatentImage = {
  description: "创建一批新的空Latent图像，以通过采样进行降噪。",
  display_name: "空Latent图像",
  inputs: {
    batch_size: {
      name: "批量大小",
      tooltip: "批次中的Latent数量。"
    },
    height: {
      name: "高度",
      tooltip: "Latent图像的高度（像素）。"
    },
    width: {
      name: "宽度",
      tooltip: "Latent图像的宽度（像素）。"
    }
  },
  outputs: {
    "0": {
      tooltip: "空Latent图像批次。"
    }
  }
};
const EmptyMochiLatentVideo = {
  display_name: "空Latent视频（Mochi）",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    height: {
      name: "高度"
    },
    length: {
      name: "长度"
    },
    width: {
      name: "宽度"
    }
  }
};
const EmptySD3LatentImage = {
  display_name: "空Latent图像（SD3）",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    height: {
      name: "高度"
    },
    width: {
      name: "宽度"
    }
  }
};
const ExponentialScheduler = {
  display_name: "Exponential调度器",
  inputs: {
    sigma_max: {
      name: "最大Sigma"
    },
    sigma_min: {
      name: "最新Sigma"
    },
    steps: {
      name: "步数"
    }
  }
};
const FeatherMask = {
  display_name: "羽化遮罩",
  inputs: {
    bottom: {
      name: "底"
    },
    left: {
      name: "左"
    },
    mask: {
      name: "遮罩"
    },
    right: {
      name: "右"
    },
    top: {
      name: "顶"
    }
  }
};
const FlipSigmas = {
  display_name: "翻转Sigma",
  inputs: {
    sigmas: {
      name: "sigmas"
    }
  }
};
const FluxGuidance = {
  display_name: "Flux引导",
  inputs: {
    conditioning: {
      name: "条件"
    },
    guidance: {
      name: "引导"
    }
  }
};
const FreeU = {
  display_name: "FreeU",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "模型"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const FreeU_V2 = {
  display_name: "FreeU_V2",
  inputs: {
    b1: {
      name: "b1"
    },
    b2: {
      name: "b2"
    },
    model: {
      name: "模型"
    },
    s1: {
      name: "s1"
    },
    s2: {
      name: "s2"
    }
  }
};
const GITSScheduler = {
  display_name: "GITS调度器",
  inputs: {
    coeff: {
      name: "系数"
    },
    denoise: {
      name: "降噪"
    },
    steps: {
      name: "步数"
    }
  }
};
const GLIGENLoader = {
  display_name: "GLIGEN加载器",
  inputs: {
    gligen_name: {
      name: "gligen名称"
    }
  }
};
const GLIGENTextBoxApply = {
  display_name: "GLIGEN文本框应用",
  inputs: {
    clip: {
      name: "CLIPCLIP"
    },
    conditioning_to: {
      name: "条件到"
    },
    gligen_textbox_model: {
      name: "GLIGEN文本框模型"
    },
    height: {
      name: "高度"
    },
    text: {
      name: "文本"
    },
    width: {
      name: "宽度"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const GrowMask = {
  display_name: "扩展遮罩",
  inputs: {
    expand: {
      name: "扩展"
    },
    mask: {
      name: "遮罩"
    },
    tapered_corners: {
      name: "倒角"
    }
  }
};
const HyperTile = {
  display_name: "超分块HyperTile",
  inputs: {
    max_depth: {
      name: "最大深度"
    },
    model: {
      name: "模型"
    },
    scale_depth: {
      name: "规模深度"
    },
    swap_size: {
      name: "分割尺寸"
    },
    tile_size: {
      name: "分块尺寸"
    }
  }
};
const HypernetworkLoader = {
  display_name: "超网络加载器",
  inputs: {
    hypernetwork_name: {
      name: "HyperNetwork名称"
    },
    model: {
      name: "模型"
    },
    strength: {
      name: "强度"
    }
  }
};
const ImageBatch = {
  display_name: "组合图像批次",
  inputs: {
    image1: {
      name: "图像1"
    },
    image2: {
      name: "图像2"
    }
  }
};
const ImageBlend = {
  display_name: "混合图像",
  inputs: {
    blend_factor: {
      name: "系数"
    },
    blend_mode: {
      name: "混合模式"
    },
    image1: {
      name: "图像1"
    },
    image2: {
      name: "图像2"
    }
  }
};
const ImageBlur = {
  display_name: "模糊图像",
  inputs: {
    blur_radius: {
      name: "模糊半径"
    },
    image: {
      name: "图像"
    },
    sigma: {
      name: "西格玛"
    }
  }
};
const ImageColorToMask = {
  display_name: "图像颜色到遮罩",
  inputs: {
    color: {
      name: "颜色"
    },
    image: {
      name: "图像"
    }
  }
};
const ImageCompositeMasked = {
  display_name: "合成图像（遮罩）",
  inputs: {
    destination: {
      name: "目标图像"
    },
    mask: {
      name: "遮罩"
    },
    resize_source: {
      name: "缩放来源图像"
    },
    source: {
      name: "来源图像"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageCrop = {
  display_name: "裁剪图像",
  inputs: {
    height: {
      name: "高度"
    },
    image: {
      name: "图像"
    },
    width: {
      name: "宽度"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const ImageFromBatch = {
  display_name: "从批次获取图像",
  inputs: {
    batch_index: {
      name: "批次索引"
    },
    image: {
      name: "图像"
    },
    length: {
      name: "长度"
    }
  }
};
const ImageInvert = {
  display_name: "反转图像",
  inputs: {
    image: {
      name: "图像"
    }
  }
};
const ImageOnlyCheckpointLoader = {
  display_name: "Checkpoint加载器（仅图像）",
  inputs: {
    ckpt_name: {
      name: "Checkpoint名称"
    }
  }
};
const ImageOnlyCheckpointSave = {
  display_name: "保存Checkpoint（仅图像）",
  inputs: {
    clip_vision: {
      name: "clip视觉"
    },
    filename_prefix: {
      name: "文件名前缀"
    },
    model: {
      name: "模型"
    },
    vae: {
      name: "vae"
    }
  }
};
const ImagePadForOutpaint = {
  display_name: "外补画板",
  inputs: {
    bottom: {
      name: "下"
    },
    feathering: {
      name: "羽化"
    },
    image: {
      name: "图像"
    },
    left: {
      name: "左"
    },
    right: {
      name: "右"
    },
    top: {
      name: "上"
    }
  }
};
const ImageQuantize = {
  display_name: "量化图像",
  inputs: {
    colors: {
      name: "颜色"
    },
    dither: {
      name: "抖动"
    },
    image: {
      name: "图像"
    }
  }
};
const ImageScale = {
  display_name: "缩放图像",
  inputs: {
    crop: {
      name: "裁剪"
    },
    height: {
      name: "高度"
    },
    image: {
      name: "图像"
    },
    upscale_method: {
      name: "缩放算法"
    },
    width: {
      name: "宽度"
    }
  }
};
const ImageScaleBy = {
  display_name: "缩放图像（比例）",
  inputs: {
    image: {
      name: "图像"
    },
    scale_by: {
      name: "缩放系数"
    },
    upscale_method: {
      name: "缩放算法"
    }
  }
};
const ImageScaleToTotalPixels = {
  display_name: "缩放图像（像素）",
  inputs: {
    image: {
      name: "图像"
    },
    megapixels: {
      name: "像素数量"
    },
    upscale_method: {
      name: "缩放算法"
    }
  }
};
const ImageSharpen = {
  display_name: "锐化图像",
  inputs: {
    alpha: {
      name: "alpha"
    },
    image: {
      name: "图像"
    },
    sharpen_radius: {
      name: "锐化半径"
    },
    sigma: {
      name: "Sigma"
    }
  }
};
const ImageToMask = {
  display_name: "图像转换为遮罩",
  inputs: {
    channel: {
      name: "通道"
    },
    image: {
      name: "图像"
    }
  }
};
const ImageUpscaleWithModel = {
  display_name: "使用模型放大图像",
  inputs: {
    image: {
      name: "图像"
    },
    upscale_model: {
      name: "放大模型"
    }
  }
};
const InpaintModelConditioning = {
  display_name: "内补模型条件",
  inputs: {
    mask: {
      name: "遮罩"
    },
    negative: {
      name: "负面条件"
    },
    noise_mask: {
      name: "噪波遮罩",
      tooltip: "向Latent图像添加遮罩，采样仅在遮罩内进行。根据模型的不同，可能会改善结果或完全破坏效果。"
    },
    pixels: {
      name: "像素"
    },
    positive: {
      name: "正面条件"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    },
    "2": {
      name: "Latent"
    }
  }
};
const InstructPixToPixConditioning = {
  display_name: "InstructPixToPix条件",
  inputs: {
    negative: {
      name: "负面条件"
    },
    pixels: {
      name: "像素"
    },
    positive: {
      name: "正面条件"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    },
    "2": {
      name: "Latent"
    }
  }
};
const InvertMask = {
  display_name: "反转遮罩",
  inputs: {
    mask: {
      name: "遮罩"
    }
  }
};
const JoinImageWithAlpha = {
  display_name: "合并图像Alpha",
  inputs: {
    alpha: {
      name: "阿尔法"
    },
    image: {
      name: "图像"
    }
  }
};
const KSampler = {
  description: "使用提供的模型、正面条件和负面条件条件降噪Latent图像。",
  display_name: "K采样器",
  inputs: {
    cfg: {
      name: "cfg",
      tooltip: "用于平衡随机性和提示词服从性。提高该值会使结果更加符合提示词，但过高会导致图像质量下降。"
    },
    denoise: {
      name: "降噪",
      tooltip: "降噪的强度，降低该值会保留原图的大部分内容从而实现图生图。"
    },
    latent_image: {
      name: "Latent图像",
      tooltip: "要降噪的 Latent 图像。"
    },
    model: {
      name: "模型",
      tooltip: "用于降噪输入 Latent 图像的模型。"
    },
    negative: {
      name: "负面条件",
      tooltip: "描述不包含在图像中的内容的条件。"
    },
    positive: {
      name: "正面条件",
      tooltip: "描述包含在图像中的内容的条件。"
    },
    sampler_name: {
      name: "采样器名称",
      tooltip: "采样算法，会影响结果质量、生成速度、风格样式。"
    },
    scheduler: {
      name: "调度器",
      tooltip: "控制逐渐移除噪波的方法。"
    },
    seed: {
      name: "种子",
      tooltip: "生成噪波的随机种。"
    },
    steps: {
      name: "步数",
      tooltip: "降噪的步数。"
    }
  },
  outputs: {
    "0": {
      tooltip: "降噪后的 Latent。"
    }
  }
};
const KSamplerAdvanced = {
  display_name: "K采样器（高级）",
  inputs: {
    add_noise: {
      name: "添加噪波"
    },
    cfg: {
      name: "cfg"
    },
    end_at_step: {
      name: "结束步数"
    },
    latent_image: {
      name: "Latent图像"
    },
    model: {
      name: "模型"
    },
    negative: {
      name: "负面条件"
    },
    noise_seed: {
      name: "随机种"
    },
    positive: {
      name: "正面条件"
    },
    return_with_leftover_noise: {
      name: "返回剩余噪波"
    },
    sampler_name: {
      name: "采样器名称"
    },
    scheduler: {
      name: "调度器"
    },
    start_at_step: {
      name: "开始步数"
    },
    steps: {
      name: "步数"
    }
  }
};
const KSamplerSelect = {
  display_name: "K采样器选择",
  inputs: {
    sampler_name: {
      name: "采样器名称"
    }
  }
};
const KarrasScheduler = {
  display_name: "Karras调度器",
  inputs: {
    rho: {
      name: "rho"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "步数"
    }
  }
};
const LTXVConditioning = {
  display_name: "LTXV条件",
  inputs: {
    frame_rate: {
      name: "帧率"
    },
    negative: {
      name: "负面条件"
    },
    positive: {
      name: "正面条件"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const LTXVImgToVideo = {
  display_name: "LTXV图像到视频",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    height: {
      name: "高度"
    },
    image: {
      name: "图像"
    },
    image_noise_scale: {
      name: "图像噪波比例",
      tooltip: "在条件图像Latent图像上应用的噪波量。"
    },
    length: {
      name: "长度"
    },
    negative: {
      name: "负面条件"
    },
    positive: {
      name: "正面条件"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "宽度"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    },
    "2": {
      name: "Latent"
    }
  }
};
const LTXVScheduler = {
  display_name: "LTXV调度器",
  inputs: {
    base_shift: {
      name: "基础移位"
    },
    latent: {
      name: "Latent"
    },
    max_shift: {
      name: "最大移位"
    },
    steps: {
      name: "步数"
    },
    stretch: {
      name: "拉伸",
      tooltip: "将 sigma 拉伸到范围 [终值, 1]。"
    },
    terminal: {
      name: "终值",
      tooltip: "拉伸后 sigma 的终值。"
    }
  }
};
const LaplaceScheduler = {
  display_name: "Laplace调度器",
  inputs: {
    beta: {
      name: "beta"
    },
    mu: {
      name: "mu"
    },
    sigma_max: {
      name: "sigma_max"
    },
    sigma_min: {
      name: "sigma_min"
    },
    steps: {
      name: "步数"
    }
  }
};
const LatentAdd = {
  display_name: "Latent相加",
  inputs: {
    samples1: {
      name: "Latent1"
    },
    samples2: {
      name: "Latent2"
    }
  }
};
const LatentApplyOperation = {
  display_name: "Latent应用操作",
  inputs: {
    operation: {
      name: "操作"
    },
    samples: {
      name: "Latent"
    }
  }
};
const LatentApplyOperationCFG = {
  display_name: "Latent应用操作CFG",
  inputs: {
    model: {
      name: "模型"
    },
    operation: {
      name: "操作"
    }
  }
};
const LatentBatch = {
  display_name: "组合Latent批次",
  inputs: {
    samples1: {
      name: "Latent1"
    },
    samples2: {
      name: "Latent2"
    }
  }
};
const LatentBatchSeedBehavior = {
  display_name: "Latent批处理随机种行为",
  inputs: {
    samples: {
      name: "Latent"
    },
    seed_behavior: {
      name: "随机种行为"
    }
  }
};
const LatentBlend = {
  display_name: "混合Latent",
  inputs: {
    blend_factor: {
      name: "系数"
    },
    samples1: {
      name: "Latent1"
    },
    samples2: {
      name: "Latent2"
    }
  }
};
const LatentComposite = {
  display_name: "合成Latent",
  inputs: {
    feather: {
      name: "羽化"
    },
    samples_from: {
      name: "Latent从"
    },
    samples_to: {
      name: "Latent到"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCompositeMasked = {
  display_name: "合成Latent遮罩",
  inputs: {
    destination: {
      name: "目标Latent"
    },
    mask: {
      name: "遮罩"
    },
    resize_source: {
      name: "调整来源大小"
    },
    source: {
      name: "来源Latent"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentCrop = {
  display_name: "裁剪Latent",
  inputs: {
    height: {
      name: "高度"
    },
    samples: {
      name: "Latent"
    },
    width: {
      name: "宽度"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const LatentFlip = {
  display_name: "翻转Latent",
  inputs: {
    flip_method: {
      name: "翻转方法"
    },
    samples: {
      name: "Latent"
    }
  }
};
const LatentFromBatch = {
  display_name: "从批次获取Latent",
  inputs: {
    batch_index: {
      name: "批次索引"
    },
    length: {
      name: "长度"
    },
    samples: {
      name: "Latent"
    }
  }
};
const LatentInterpolate = {
  display_name: "Latent插值",
  inputs: {
    ratio: {
      name: "比率"
    },
    samples1: {
      name: "Latent1"
    },
    samples2: {
      name: "Latent2"
    }
  }
};
const LatentMultiply = {
  display_name: "Latent相乘",
  inputs: {
    multiplier: {
      name: "乘数"
    },
    samples: {
      name: "Latent"
    }
  }
};
const LatentOperationSharpen = {
  display_name: "Latent操作锐化",
  inputs: {
    alpha: {
      name: "阿尔法"
    },
    sharpen_radius: {
      name: "锐化半径"
    },
    sigma: {
      name: "西格玛"
    }
  }
};
const LatentOperationTonemapReinhard = {
  display_name: "Latent操作色调映射Reinhard",
  inputs: {
    multiplier: {
      name: "乘数"
    }
  }
};
const LatentRotate = {
  display_name: "旋转Latent",
  inputs: {
    rotation: {
      name: "旋转"
    },
    samples: {
      name: "Latent"
    }
  }
};
const LatentSubtract = {
  display_name: "Latent相减",
  inputs: {
    samples1: {
      name: "Latent1"
    },
    samples2: {
      name: "Latent2"
    }
  }
};
const LatentUpscale = {
  display_name: "缩放Latent",
  inputs: {
    crop: {
      name: "裁剪"
    },
    height: {
      name: "高度"
    },
    samples: {
      name: "Latent"
    },
    upscale_method: {
      name: "缩放算法"
    },
    width: {
      name: "宽度"
    }
  }
};
const LatentUpscaleBy = {
  display_name: "缩放Latent（比例）",
  inputs: {
    samples: {
      name: "Latent"
    },
    scale_by: {
      name: "缩放比例"
    },
    upscale_method: {
      name: "缩放算法"
    }
  }
};
const Load3D = {
  display_name: "加载3D",
  inputs: {
    bg_color: {
      name: "背景颜色"
    },
    camera_type: {
      name: "相机类型"
    },
    height: {
      name: "高度"
    },
    image: {
      name: "图像"
    },
    light_intensity: {
      name: "光照强度"
    },
    material: {
      name: "材质"
    },
    model_file: {
      name: "模型文件"
    },
    show_grid: {
      name: "显示网格"
    },
    up_direction: {
      name: "上方向"
    },
    view: {
      name: "视图"
    },
    width: {
      name: "宽度"
    }
  },
  outputs: {
    "0": {
      name: "图像"
    },
    "1": {
      name: "遮罩"
    },
    "2": {
      name: "网格路径"
    }
  }
};
const Load3DAnimation = {
  display_name: "加载3D动画",
  inputs: {
    animation_speed: {
      name: "动画速度"
    },
    bg_color: {
      name: "背景颜色"
    },
    camera_type: {
      name: "相机类型"
    },
    height: {
      name: "高度"
    },
    image: {
      name: "图像"
    },
    light_intensity: {
      name: "光照强度"
    },
    material: {
      name: "材质"
    },
    model_file: {
      name: "模型文件"
    },
    show_grid: {
      name: "显示网格"
    },
    up_direction: {
      name: "上方向"
    },
    view: {
      name: "视图"
    },
    width: {
      name: "宽度"
    }
  },
  outputs: {
    "0": {
      name: "图像"
    },
    "1": {
      name: "遮罩"
    },
    "2": {
      name: "网格路径"
    }
  }
};
const LoadAudio = {
  display_name: "加载音频",
  inputs: {
    audio: {
      name: "音频"
    }
  }
};
const LoadImage = {
  display_name: "加载图像",
  inputs: {
    image: {
      name: "图像"
    }
  }
};
const LoadImageMask = {
  display_name: "加载图像（作为遮罩）",
  inputs: {
    channel: {
      name: "通道"
    },
    image: {
      name: "图像"
    }
  }
};
const LoadLatent = {
  display_name: "加载Latent",
  inputs: {
    latent: {
      name: "Latent"
    }
  }
};
const LoraLoader = {
  description: "LoRA用于修改扩散和CLIP模型，改变Latent图像的降噪方式，例如应用风格。多个LoRA节点可以链接在一起。",
  display_name: "加载LoRA",
  inputs: {
    clip: {
      name: "CLIPCLIP",
      tooltip: "LoRA 将应用于的 CLIP 模型。"
    },
    lora_name: {
      name: "LoRA名称",
      tooltip: "LoRA 的名称。"
    },
    model: {
      name: "模型",
      tooltip: "LoRA 将应用于的扩散模型。"
    },
    strength_clip: {
      name: "CLIP强度",
      tooltip: "修改 CLIP 模型的强度。此值可以为负。"
    },
    strength_model: {
      name: "模型强度",
      tooltip: "修改扩散模型的强度。此值可以为负。"
    }
  },
  outputs: {
    "0": {
      tooltip: "修改后的扩散模型。"
    },
    "1": {
      tooltip: "修改后的CLIP模型。"
    }
  }
};
const LoraLoaderModelOnly = {
  description: "LoRA用于修改扩散和CLIP模型，改变Latent图像的降噪方式，例如应用风格。多个LoRA节点可以链接在一起。",
  display_name: "LoRA加载器（仅模型）",
  inputs: {
    lora_name: {
      name: "LoRA名称"
    },
    model: {
      name: "模型"
    },
    strength_model: {
      name: "模型强度"
    }
  },
  outputs: {
    "0": {
      tooltip: "修改后的扩散模型。"
    }
  }
};
const LoraSave = {
  display_name: "保存LoRA",
  inputs: {
    bias_diff: {
      name: "偏差差异"
    },
    filename_prefix: {
      name: "文件名前缀"
    },
    lora_type: {
      name: "lora类型"
    },
    model_diff: {
      name: "模型差异",
      tooltip: "要转换为 LoRA 的模型差异输出。"
    },
    rank: {
      name: "排名"
    },
    text_encoder_diff: {
      name: "文本编码器差异",
      tooltip: "要转换为 LoRA 的CLIP差异输出。"
    }
  }
};
const Mahiro = {
  description: "修改引导以更多地侧重于正面条件提示的'方向'，而不是负面条件提示之间的差异。",
  display_name: "真寻太可爱了，她应该有个更好的引导功能！！(。・ω・。)",
  inputs: {
    model: {
      name: "模型"
    }
  },
  outputs: {
    "0": {
      name: "修补后的模型"
    }
  }
};
const MaskComposite = {
  display_name: "合成遮罩",
  inputs: {
    destination: {
      name: "目标"
    },
    operation: {
      name: "操作"
    },
    source: {
      name: "源"
    },
    x: {
      name: "x"
    },
    y: {
      name: "y"
    }
  }
};
const MaskToImage = {
  display_name: "遮罩转换为图像",
  inputs: {
    mask: {
      name: "遮罩"
    }
  }
};
const ModelMergeAdd = {
  display_name: "模型相加",
  inputs: {
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    }
  }
};
const ModelMergeAuraflow = {
  display_name: "模型融合（Auraflow ）",
  inputs: {
    cond_seq_linear_: {
      name: "条件序列线性."
    },
    double_layers_0_: {
      name: "双层.0."
    },
    double_layers_1_: {
      name: "双层.1."
    },
    double_layers_2_: {
      name: "双层.2."
    },
    double_layers_3_: {
      name: "双层.3."
    },
    final_linear_: {
      name: "最终线性."
    },
    init_x_linear_: {
      name: "初始x线性."
    },
    modF_: {
      name: "modF."
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    positional_encoding: {
      name: "位置编码"
    },
    register_tokens: {
      name: "注册令牌"
    },
    single_layers_0_: {
      name: "单层.0."
    },
    single_layers_10_: {
      name: "单层.10."
    },
    single_layers_11_: {
      name: "单层.11."
    },
    single_layers_12_: {
      name: "单层.12."
    },
    single_layers_13_: {
      name: "单层.13."
    },
    single_layers_14_: {
      name: "单层.14."
    },
    single_layers_15_: {
      name: "单层.15."
    },
    single_layers_16_: {
      name: "单层.16."
    },
    single_layers_17_: {
      name: "单层.17."
    },
    single_layers_18_: {
      name: "单层.18."
    },
    single_layers_19_: {
      name: "单层.19."
    },
    single_layers_1_: {
      name: "单层.1."
    },
    single_layers_20_: {
      name: "单层.20."
    },
    single_layers_21_: {
      name: "单层.21."
    },
    single_layers_22_: {
      name: "单层.22."
    },
    single_layers_23_: {
      name: "单层.23."
    },
    single_layers_24_: {
      name: "单层.24."
    },
    single_layers_25_: {
      name: "单层.25."
    },
    single_layers_26_: {
      name: "单层.26."
    },
    single_layers_27_: {
      name: "单层.27."
    },
    single_layers_28_: {
      name: "单层.28."
    },
    single_layers_29_: {
      name: "单层.29."
    },
    single_layers_2_: {
      name: "单层.2."
    },
    single_layers_30_: {
      name: "单层.30."
    },
    single_layers_31_: {
      name: "单层.31."
    },
    single_layers_3_: {
      name: "单层.3."
    },
    single_layers_4_: {
      name: "单层.4."
    },
    single_layers_5_: {
      name: "单层.5."
    },
    single_layers_6_: {
      name: "单层.6."
    },
    single_layers_7_: {
      name: "单层.7."
    },
    single_layers_8_: {
      name: "单层.8."
    },
    single_layers_9_: {
      name: "单层.9."
    },
    t_embedder_: {
      name: "t嵌入器."
    }
  }
};
const ModelMergeBlocks = {
  display_name: "模型融合（分块）",
  inputs: {
    input: {
      name: "输入"
    },
    middle: {
      name: "中间"
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    out: {
      name: "输出"
    }
  }
};
const ModelMergeFlux1 = {
  display_name: "模型融合（Flux1）",
  inputs: {
    double_blocks_0_: {
      name: "双块.0."
    },
    double_blocks_10_: {
      name: "双块.10."
    },
    double_blocks_11_: {
      name: "双块.11."
    },
    double_blocks_12_: {
      name: "双块.12."
    },
    double_blocks_13_: {
      name: "双块.13."
    },
    double_blocks_14_: {
      name: "双块.14."
    },
    double_blocks_15_: {
      name: "双块.15."
    },
    double_blocks_16_: {
      name: "双块.16."
    },
    double_blocks_17_: {
      name: "双块.17."
    },
    double_blocks_18_: {
      name: "双块.18."
    },
    double_blocks_1_: {
      name: "双块.1."
    },
    double_blocks_2_: {
      name: "双块.2."
    },
    double_blocks_3_: {
      name: "双块.3."
    },
    double_blocks_4_: {
      name: "双块.4."
    },
    double_blocks_5_: {
      name: "双块.5."
    },
    double_blocks_6_: {
      name: "双块.6."
    },
    double_blocks_7_: {
      name: "双块.7."
    },
    double_blocks_8_: {
      name: "双块.8."
    },
    double_blocks_9_: {
      name: "双块.9."
    },
    final_layer_: {
      name: "最终层."
    },
    guidance_in: {
      name: "输入引导"
    },
    img_in_: {
      name: "输入图像."
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    single_blocks_0_: {
      name: "单块.0."
    },
    single_blocks_10_: {
      name: "单块.10."
    },
    single_blocks_11_: {
      name: "单块.11."
    },
    single_blocks_12_: {
      name: "单块.12."
    },
    single_blocks_13_: {
      name: "单块.13."
    },
    single_blocks_14_: {
      name: "单块.14."
    },
    single_blocks_15_: {
      name: "单块.15."
    },
    single_blocks_16_: {
      name: "单块.16."
    },
    single_blocks_17_: {
      name: "单块.17."
    },
    single_blocks_18_: {
      name: "单块.18."
    },
    single_blocks_19_: {
      name: "单块.19."
    },
    single_blocks_1_: {
      name: "单块.1."
    },
    single_blocks_20_: {
      name: "单块.20."
    },
    single_blocks_21_: {
      name: "单块.21."
    },
    single_blocks_22_: {
      name: "单块.22."
    },
    single_blocks_23_: {
      name: "单块.23."
    },
    single_blocks_24_: {
      name: "单块.24."
    },
    single_blocks_25_: {
      name: "单块.25."
    },
    single_blocks_26_: {
      name: "单块.26."
    },
    single_blocks_27_: {
      name: "单块.27."
    },
    single_blocks_28_: {
      name: "单块.28."
    },
    single_blocks_29_: {
      name: "单块.29."
    },
    single_blocks_2_: {
      name: "单块.2."
    },
    single_blocks_30_: {
      name: "单块.30."
    },
    single_blocks_31_: {
      name: "单块.31."
    },
    single_blocks_32_: {
      name: "单块.32."
    },
    single_blocks_33_: {
      name: "单块.33."
    },
    single_blocks_34_: {
      name: "单块.34."
    },
    single_blocks_35_: {
      name: "单块.35."
    },
    single_blocks_36_: {
      name: "单块.36."
    },
    single_blocks_37_: {
      name: "单块.37."
    },
    single_blocks_3_: {
      name: "单块.3."
    },
    single_blocks_4_: {
      name: "单块.4."
    },
    single_blocks_5_: {
      name: "单块.5."
    },
    single_blocks_6_: {
      name: "单块.6."
    },
    single_blocks_7_: {
      name: "单块.7."
    },
    single_blocks_8_: {
      name: "单块.8."
    },
    single_blocks_9_: {
      name: "单块.9."
    },
    time_in_: {
      name: "输入时间."
    },
    txt_in_: {
      name: "输入文本."
    },
    vector_in_: {
      name: "输入向量."
    }
  }
};
const ModelMergeLTXV = {
  display_name: "模型融合（LTXV）",
  inputs: {
    adaln_single_: {
      name: "adaln_single."
    },
    caption_projection_: {
      name: "caption_projection."
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    patchify_proj_: {
      name: "patchify_proj."
    },
    proj_out_: {
      name: "proj_out."
    },
    scale_shift_table: {
      name: "scale_shift_table"
    },
    transformer_blocks_0_: {
      name: "transformer_blocks.0."
    },
    transformer_blocks_10_: {
      name: "transformer_blocks.10."
    },
    transformer_blocks_11_: {
      name: "transformer_blocks.11."
    },
    transformer_blocks_12_: {
      name: "transformer_blocks.12."
    },
    transformer_blocks_13_: {
      name: "transformer_blocks.13."
    },
    transformer_blocks_14_: {
      name: "transformer_blocks.14."
    },
    transformer_blocks_15_: {
      name: "transformer_blocks.15."
    },
    transformer_blocks_16_: {
      name: "transformer_blocks.16."
    },
    transformer_blocks_17_: {
      name: "transformer_blocks.17."
    },
    transformer_blocks_18_: {
      name: "transformer_blocks.18."
    },
    transformer_blocks_19_: {
      name: "transformer_blocks.19."
    },
    transformer_blocks_1_: {
      name: "transformer_blocks.1."
    },
    transformer_blocks_20_: {
      name: "transformer_blocks.20."
    },
    transformer_blocks_21_: {
      name: "transformer_blocks.21."
    },
    transformer_blocks_22_: {
      name: "transformer_blocks.22."
    },
    transformer_blocks_23_: {
      name: "transformer_blocks.23."
    },
    transformer_blocks_24_: {
      name: "transformer_blocks.24."
    },
    transformer_blocks_25_: {
      name: "transformer_blocks.25."
    },
    transformer_blocks_26_: {
      name: "transformer_blocks.26."
    },
    transformer_blocks_27_: {
      name: "transformer_blocks.27."
    },
    transformer_blocks_2_: {
      name: "transformer_blocks.2."
    },
    transformer_blocks_3_: {
      name: "transformer_blocks.3."
    },
    transformer_blocks_4_: {
      name: "transformer_blocks.4."
    },
    transformer_blocks_5_: {
      name: "transformer_blocks.5."
    },
    transformer_blocks_6_: {
      name: "transformer_blocks.6."
    },
    transformer_blocks_7_: {
      name: "transformer_blocks.7."
    },
    transformer_blocks_8_: {
      name: "transformer_blocks.8."
    },
    transformer_blocks_9_: {
      name: "transformer_blocks.9."
    }
  }
};
const ModelMergeMochiPreview = {
  display_name: "模型融合（Mochi预览）",
  inputs: {
    blocks_0_: {
      name: "blocks.0."
    },
    blocks_10_: {
      name: "blocks.10."
    },
    blocks_11_: {
      name: "blocks.11."
    },
    blocks_12_: {
      name: "blocks.12."
    },
    blocks_13_: {
      name: "blocks.13."
    },
    blocks_14_: {
      name: "blocks.14."
    },
    blocks_15_: {
      name: "blocks.15."
    },
    blocks_16_: {
      name: "blocks.16."
    },
    blocks_17_: {
      name: "blocks.17."
    },
    blocks_18_: {
      name: "blocks.18."
    },
    blocks_19_: {
      name: "blocks.19."
    },
    blocks_1_: {
      name: "blocks.1."
    },
    blocks_20_: {
      name: "blocks.20."
    },
    blocks_21_: {
      name: "blocks.21."
    },
    blocks_22_: {
      name: "blocks.22."
    },
    blocks_23_: {
      name: "blocks.23."
    },
    blocks_24_: {
      name: "blocks.24."
    },
    blocks_25_: {
      name: "blocks.25."
    },
    blocks_26_: {
      name: "blocks.26."
    },
    blocks_27_: {
      name: "blocks.27."
    },
    blocks_28_: {
      name: "blocks.28."
    },
    blocks_29_: {
      name: "blocks.29."
    },
    blocks_2_: {
      name: "blocks.2."
    },
    blocks_30_: {
      name: "blocks.30."
    },
    blocks_31_: {
      name: "blocks.31."
    },
    blocks_32_: {
      name: "blocks.32."
    },
    blocks_33_: {
      name: "blocks.33."
    },
    blocks_34_: {
      name: "blocks.34."
    },
    blocks_35_: {
      name: "blocks.35."
    },
    blocks_36_: {
      name: "blocks.36."
    },
    blocks_37_: {
      name: "blocks.37."
    },
    blocks_38_: {
      name: "blocks.38."
    },
    blocks_39_: {
      name: "blocks.39."
    },
    blocks_3_: {
      name: "blocks.3."
    },
    blocks_40_: {
      name: "blocks.40."
    },
    blocks_41_: {
      name: "blocks.41."
    },
    blocks_42_: {
      name: "blocks.42."
    },
    blocks_43_: {
      name: "blocks.43."
    },
    blocks_44_: {
      name: "blocks.44."
    },
    blocks_45_: {
      name: "blocks.45."
    },
    blocks_46_: {
      name: "blocks.46."
    },
    blocks_47_: {
      name: "blocks.47."
    },
    blocks_4_: {
      name: "blocks.4."
    },
    blocks_5_: {
      name: "blocks.5."
    },
    blocks_6_: {
      name: "blocks.6."
    },
    blocks_7_: {
      name: "blocks.7."
    },
    blocks_8_: {
      name: "blocks.8."
    },
    blocks_9_: {
      name: "blocks.9."
    },
    final_layer_: {
      name: "final_layer."
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    pos_frequencies_: {
      name: "pos_frequencies."
    },
    t5_y_embedder_: {
      name: "t5_y_embedder."
    },
    t5_yproj_: {
      name: "t5_yproj."
    },
    t_embedder_: {
      name: "t_embedder."
    }
  }
};
const ModelMergeSD1 = {
  display_name: "模型融合（SD1）",
  inputs: {
    input_blocks_0_: {
      name: "输入块.0."
    },
    input_blocks_10_: {
      name: "输入块.10."
    },
    input_blocks_11_: {
      name: "输入块.11."
    },
    input_blocks_1_: {
      name: "输入块.1."
    },
    input_blocks_2_: {
      name: "输入块.2."
    },
    input_blocks_3_: {
      name: "输入块.3."
    },
    input_blocks_4_: {
      name: "输入块.4."
    },
    input_blocks_5_: {
      name: "输入块.5."
    },
    input_blocks_6_: {
      name: "输入块.6."
    },
    input_blocks_7_: {
      name: "输入块.7."
    },
    input_blocks_8_: {
      name: "输入块.8."
    },
    input_blocks_9_: {
      name: "输入块.9."
    },
    label_emb_: {
      name: "标签嵌入."
    },
    middle_block_0_: {
      name: "中间块.0."
    },
    middle_block_1_: {
      name: "中间块.1."
    },
    middle_block_2_: {
      name: "中间块.2."
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    out_: {
      name: "出."
    },
    output_blocks_0_: {
      name: "输出块.0."
    },
    output_blocks_10_: {
      name: "输出块.10."
    },
    output_blocks_11_: {
      name: "输出块.11."
    },
    output_blocks_1_: {
      name: "输出块.1."
    },
    output_blocks_2_: {
      name: "输出块.2."
    },
    output_blocks_3_: {
      name: "输出块.3."
    },
    output_blocks_4_: {
      name: "输出块.4."
    },
    output_blocks_5_: {
      name: "输出块.5."
    },
    output_blocks_6_: {
      name: "输出块.6."
    },
    output_blocks_7_: {
      name: "输出块.7."
    },
    output_blocks_8_: {
      name: "输出块.8."
    },
    output_blocks_9_: {
      name: "输出块.9."
    },
    time_embed_: {
      name: "时间嵌入."
    }
  }
};
const ModelMergeSD2 = {
  display_name: "模型融合（SD2）",
  inputs: {
    input_blocks_0_: {
      name: "输入块.0."
    },
    input_blocks_10_: {
      name: "输入块.10."
    },
    input_blocks_11_: {
      name: "输入块.11."
    },
    input_blocks_1_: {
      name: "输入块.1."
    },
    input_blocks_2_: {
      name: "输入块.2."
    },
    input_blocks_3_: {
      name: "输入块.3."
    },
    input_blocks_4_: {
      name: "输入块.4."
    },
    input_blocks_5_: {
      name: "输入块.5."
    },
    input_blocks_6_: {
      name: "输入块.6."
    },
    input_blocks_7_: {
      name: "输入块.7."
    },
    input_blocks_8_: {
      name: "输入块.8."
    },
    input_blocks_9_: {
      name: "输入块.9."
    },
    label_emb_: {
      name: "标签嵌入."
    },
    middle_block_0_: {
      name: "中间块.0."
    },
    middle_block_1_: {
      name: "中间块.1."
    },
    middle_block_2_: {
      name: "中间块.2."
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    out_: {
      name: "出."
    },
    output_blocks_0_: {
      name: "输出块.0."
    },
    output_blocks_10_: {
      name: "输出块.10."
    },
    output_blocks_11_: {
      name: "输出块.11."
    },
    output_blocks_1_: {
      name: "输出块.1."
    },
    output_blocks_2_: {
      name: "输出块.2."
    },
    output_blocks_3_: {
      name: "输出块.3."
    },
    output_blocks_4_: {
      name: "输出块.4."
    },
    output_blocks_5_: {
      name: "输出块.5."
    },
    output_blocks_6_: {
      name: "输出块.6."
    },
    output_blocks_7_: {
      name: "输出块.7."
    },
    output_blocks_8_: {
      name: "输出块.8."
    },
    output_blocks_9_: {
      name: "输出块.9."
    },
    time_embed_: {
      name: "时间嵌入."
    }
  }
};
const ModelMergeSD35_Large = {
  display_name: "模型融合（SD35_大）",
  inputs: {
    context_embedder_: {
      name: "上下文嵌入器."
    },
    final_layer_: {
      name: "最终层."
    },
    joint_blocks_0_: {
      name: "联合块.0."
    },
    joint_blocks_10_: {
      name: "联合块.10."
    },
    joint_blocks_11_: {
      name: "联合块.11."
    },
    joint_blocks_12_: {
      name: "联合块.12."
    },
    joint_blocks_13_: {
      name: "联合块.13."
    },
    joint_blocks_14_: {
      name: "联合块.14."
    },
    joint_blocks_15_: {
      name: "联合块.15."
    },
    joint_blocks_16_: {
      name: "联合块.16."
    },
    joint_blocks_17_: {
      name: "联合块.17."
    },
    joint_blocks_18_: {
      name: "联合块.18."
    },
    joint_blocks_19_: {
      name: "联合块.19."
    },
    joint_blocks_1_: {
      name: "联合块.1."
    },
    joint_blocks_20_: {
      name: "联合块.20."
    },
    joint_blocks_21_: {
      name: "联合块.21."
    },
    joint_blocks_22_: {
      name: "联合块.22."
    },
    joint_blocks_23_: {
      name: "联合块.23."
    },
    joint_blocks_24_: {
      name: "联合块.24."
    },
    joint_blocks_25_: {
      name: "联合块.25."
    },
    joint_blocks_26_: {
      name: "联合块.26."
    },
    joint_blocks_27_: {
      name: "联合块.27."
    },
    joint_blocks_28_: {
      name: "联合块.28."
    },
    joint_blocks_29_: {
      name: "联合块.29."
    },
    joint_blocks_2_: {
      name: "联合块.2."
    },
    joint_blocks_30_: {
      name: "联合块.30."
    },
    joint_blocks_31_: {
      name: "联合块.31."
    },
    joint_blocks_32_: {
      name: "联合块.32."
    },
    joint_blocks_33_: {
      name: "联合块.33."
    },
    joint_blocks_34_: {
      name: "联合块.34."
    },
    joint_blocks_35_: {
      name: "联合块.35."
    },
    joint_blocks_36_: {
      name: "联合块.36."
    },
    joint_blocks_37_: {
      name: "联合块.37."
    },
    joint_blocks_3_: {
      name: "联合块.3."
    },
    joint_blocks_4_: {
      name: "联合块.4."
    },
    joint_blocks_5_: {
      name: "联合块.5."
    },
    joint_blocks_6_: {
      name: "联合块.6."
    },
    joint_blocks_7_: {
      name: "联合块.7."
    },
    joint_blocks_8_: {
      name: "联合块.8."
    },
    joint_blocks_9_: {
      name: "联合块.9."
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    pos_embed_: {
      name: "位置嵌入."
    },
    t_embedder_: {
      name: "t嵌入器."
    },
    x_embedder_: {
      name: "x嵌入器."
    },
    y_embedder_: {
      name: "y嵌入器."
    }
  }
};
const ModelMergeSD3_2B = {
  display_name: "模型融合（SD3_2B）",
  inputs: {
    context_embedder_: {
      name: "上下文嵌入器."
    },
    final_layer_: {
      name: "最终层."
    },
    joint_blocks_0_: {
      name: "联合块.0."
    },
    joint_blocks_10_: {
      name: "联合块.10."
    },
    joint_blocks_11_: {
      name: "联合块.11."
    },
    joint_blocks_12_: {
      name: "联合块.12."
    },
    joint_blocks_13_: {
      name: "联合块.13."
    },
    joint_blocks_14_: {
      name: "联合块.14."
    },
    joint_blocks_15_: {
      name: "联合块.15."
    },
    joint_blocks_16_: {
      name: "联合块.16."
    },
    joint_blocks_17_: {
      name: "联合块.17."
    },
    joint_blocks_18_: {
      name: "联合块.18."
    },
    joint_blocks_19_: {
      name: "联合块.19."
    },
    joint_blocks_1_: {
      name: "联合块.1."
    },
    joint_blocks_20_: {
      name: "联合块.20."
    },
    joint_blocks_21_: {
      name: "联合块.21."
    },
    joint_blocks_22_: {
      name: "联合块.22."
    },
    joint_blocks_23_: {
      name: "联合块.23."
    },
    joint_blocks_2_: {
      name: "联合块.2."
    },
    joint_blocks_3_: {
      name: "联合块.3."
    },
    joint_blocks_4_: {
      name: "联合块.4."
    },
    joint_blocks_5_: {
      name: "联合块.5."
    },
    joint_blocks_6_: {
      name: "联合块.6."
    },
    joint_blocks_7_: {
      name: "联合块.7."
    },
    joint_blocks_8_: {
      name: "联合块.8."
    },
    joint_blocks_9_: {
      name: "联合块.9."
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    pos_embed_: {
      name: "位置嵌入."
    },
    t_embedder_: {
      name: "t嵌入器."
    },
    x_embedder_: {
      name: "x嵌入器."
    },
    y_embedder_: {
      name: "y嵌入器."
    }
  }
};
const ModelMergeSDXL = {
  display_name: "模型融合（SDXL）",
  inputs: {
    input_blocks_0: {
      name: "输入块.0"
    },
    input_blocks_1: {
      name: "输入块.1"
    },
    input_blocks_2: {
      name: "输入块.2"
    },
    input_blocks_3: {
      name: "输入块.3"
    },
    input_blocks_4: {
      name: "输入块.4"
    },
    input_blocks_5: {
      name: "输入块.5"
    },
    input_blocks_6: {
      name: "输入块.6"
    },
    input_blocks_7: {
      name: "输入块.7"
    },
    input_blocks_8: {
      name: "输入块.8"
    },
    label_emb_: {
      name: "标签嵌入."
    },
    middle_block_0: {
      name: "中间块.0"
    },
    middle_block_1: {
      name: "中间块.1"
    },
    middle_block_2: {
      name: "中间块.2"
    },
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    out_: {
      name: "输出."
    },
    output_blocks_0: {
      name: "输出块.0"
    },
    output_blocks_1: {
      name: "输出块.1"
    },
    output_blocks_2: {
      name: "输出块.2"
    },
    output_blocks_3: {
      name: "输出块.3"
    },
    output_blocks_4: {
      name: "输出块.4"
    },
    output_blocks_5: {
      name: "输出块.5"
    },
    output_blocks_6: {
      name: "输出块.6"
    },
    output_blocks_7: {
      name: "输出块.7"
    },
    output_blocks_8: {
      name: "输出块.8"
    },
    time_embed_: {
      name: "时间嵌入."
    }
  }
};
const ModelMergeSimple = {
  display_name: "模型融合（简易）",
  inputs: {
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    ratio: {
      name: "比例"
    }
  }
};
const ModelMergeSubtract = {
  display_name: "模型相减",
  inputs: {
    model1: {
      name: "模型1"
    },
    model2: {
      name: "模型2"
    },
    multiplier: {
      name: "乘数"
    }
  }
};
const ModelSamplingAuraFlow = {
  display_name: "采样算法（AuraFlow）",
  inputs: {
    model: {
      name: "模型"
    },
    shift: {
      name: "移位"
    }
  }
};
const ModelSamplingContinuousEDM = {
  display_name: "采样算法（连续EDM）",
  inputs: {
    model: {
      name: "模型"
    },
    sampling: {
      name: "采样"
    },
    sigma_max: {
      name: "最大西格玛"
    },
    sigma_min: {
      name: "最小西格玛"
    }
  }
};
const ModelSamplingContinuousV = {
  display_name: "采样算法（连续V）",
  inputs: {
    model: {
      name: "模型"
    },
    sampling: {
      name: "采样"
    },
    sigma_max: {
      name: "最大西格玛"
    },
    sigma_min: {
      name: "最小西格玛"
    }
  }
};
const ModelSamplingDiscrete = {
  display_name: "采样算法（离散）",
  inputs: {
    model: {
      name: "模型"
    },
    sampling: {
      name: "采样"
    },
    zsnr: {
      name: "zsnr"
    }
  }
};
const ModelSamplingFlux = {
  display_name: "采样算法（Flux）",
  inputs: {
    base_shift: {
      name: "基础移位"
    },
    height: {
      name: "高度"
    },
    max_shift: {
      name: "最大移位"
    },
    model: {
      name: "模型"
    },
    width: {
      name: "宽度"
    }
  }
};
const ModelSamplingLTXV = {
  display_name: "采样算法（LTXV）",
  inputs: {
    base_shift: {
      name: "基础移位"
    },
    latent: {
      name: "Latent"
    },
    max_shift: {
      name: "最大移位"
    },
    model: {
      name: "模型"
    }
  }
};
const ModelSamplingSD3 = {
  display_name: "采样算法（SD3）",
  inputs: {
    model: {
      name: "模型"
    },
    shift: {
      name: "移位"
    }
  }
};
const ModelSamplingStableCascade = {
  display_name: "采样算法（Stable Cascade）",
  inputs: {
    model: {
      name: "模型"
    },
    shift: {
      name: "移位"
    }
  }
};
const ModelSave = {
  display_name: "保存模型",
  inputs: {
    filename_prefix: {
      name: "文件名前缀"
    },
    model: {
      name: "模型"
    }
  }
};
const Morphology = {
  display_name: "图像形态学",
  inputs: {
    image: {
      name: "图像"
    },
    kernel_size: {
      name: "核心大小"
    },
    operation: {
      name: "操作"
    }
  }
};
const PairConditioningCombine = {
  display_name: "条件对合并",
  inputs: {
    negative_A: {
      name: "负面条件_A"
    },
    negative_B: {
      name: "负面条件_B"
    },
    positive_A: {
      name: "正面条件_A"
    },
    positive_B: {
      name: "正面条件_B"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const PairConditioningSetDefaultCombine = {
  display_name: "条件对设置默认合并",
  inputs: {
    hooks: {
      name: "约束"
    },
    negative: {
      name: "负面条件"
    },
    negative_DEFAULT: {
      name: "默认负面条件"
    },
    positive: {
      name: "正面条件"
    },
    positive_DEFAULT: {
      name: "默认正面条件"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const PairConditioningSetProperties = {
  display_name: "条件对设置属性",
  inputs: {
    hooks: {
      name: "约束"
    },
    mask: {
      name: "遮罩"
    },
    negative_NEW: {
      name: "新负面条件"
    },
    positive_NEW: {
      name: "新正面条件"
    },
    set_cond_area: {
      name: "设置条件区域"
    },
    strength: {
      name: "强度"
    },
    timesteps: {
      name: "间隔"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const PairConditioningSetPropertiesAndCombine = {
  display_name: "条件对设置属性合并",
  inputs: {
    hooks: {
      name: "约束"
    },
    mask: {
      name: "遮罩"
    },
    negative: {
      name: "负面条件"
    },
    negative_NEW: {
      name: "新负面条件"
    },
    positive: {
      name: "正面条件"
    },
    positive_NEW: {
      name: "新正面条件"
    },
    set_cond_area: {
      name: "设置条件区域"
    },
    strength: {
      name: "强度"
    },
    timesteps: {
      name: "间隔"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    }
  }
};
const PatchModelAddDownscale = {
  display_name: "收缩模型UNET（Kohya Deep Shrink）",
  inputs: {
    block_number: {
      name: "层编号"
    },
    downscale_after_skip: {
      name: "跳过后收缩"
    },
    downscale_factor: {
      name: "收缩系数"
    },
    downscale_method: {
      name: "收缩算法"
    },
    end_percent: {
      name: "结束百分比"
    },
    model: {
      name: "模型"
    },
    start_percent: {
      name: "开始百分比"
    },
    upscale_method: {
      name: "放大方法"
    }
  }
};
const PerpNeg = {
  display_name: "Perp-Neg（已弃用，使用PerpNegGuider）",
  inputs: {
    empty_conditioning: {
      name: "空条件"
    },
    model: {
      name: "模型"
    },
    neg_scale: {
      name: "负面缩放"
    }
  }
};
const PerpNegGuider = {
  display_name: "PerpNeg引导器",
  inputs: {
    cfg: {
      name: "cfg"
    },
    empty_conditioning: {
      name: "空条件"
    },
    model: {
      name: "模型"
    },
    neg_scale: {
      name: "负面缩放"
    },
    negative: {
      name: "负面条件"
    },
    positive: {
      name: "正面条件"
    }
  }
};
const PerturbedAttentionGuidance = {
  display_name: "PAG注意力引导",
  inputs: {
    model: {
      name: "模型"
    },
    scale: {
      name: "规模"
    }
  }
};
const PhotoMakerEncode = {
  display_name: "PhotoMaker编码",
  inputs: {
    clip: {
      name: "clip"
    },
    image: {
      name: "图像"
    },
    photomaker: {
      name: "photomaker"
    },
    text: {
      name: "文本"
    }
  }
};
const PhotoMakerLoader = {
  display_name: "PhotoMaker加载器",
  inputs: {
    photomaker_model_name: {
      name: "photomaker模型名称"
    }
  }
};
const PolyexponentialScheduler = {
  display_name: "Polyexponential调度器",
  inputs: {
    rho: {
      name: "rho"
    },
    sigma_max: {
      name: "sigma最大值"
    },
    sigma_min: {
      name: "sigma最小值"
    },
    steps: {
      name: "步数"
    }
  }
};
const PorterDuffImageComposite = {
  display_name: "Porter-Duff图像合成",
  inputs: {
    destination: {
      name: "目标图像"
    },
    destination_alpha: {
      name: "目标图像alpha"
    },
    mode: {
      name: "模式"
    },
    source: {
      name: "来源图像"
    },
    source_alpha: {
      name: "来源图像alpha"
    }
  }
};
const Preview3D = {
  display_name: "预览3D",
  inputs: {
    bg_color: {
      name: "背景颜色"
    },
    camera_type: {
      name: "相机类型"
    },
    light_intensity: {
      name: "光照强度"
    },
    material: {
      name: "材质"
    },
    model_file: {
      name: "模型文件"
    },
    show_grid: {
      name: "显示网格"
    },
    up_direction: {
      name: "上方向"
    },
    view: {
      name: "视图"
    }
  }
};
const PreviewAudio = {
  display_name: "预览音频",
  inputs: {
    audio: {
      name: "音频"
    }
  }
};
const PreviewImage = {
  description: "将输入图像保存到您的ComfyUI临时目录。",
  display_name: "预览图像",
  inputs: {
    images: {
      name: "图像"
    }
  }
};
const RandomNoise = {
  display_name: "随机噪波",
  inputs: {
    noise_seed: {
      name: "噪波随机种"
    }
  }
};
const RebatchImages = {
  display_name: "重设图像批次",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    images: {
      name: "图像"
    }
  }
};
const RebatchLatents = {
  display_name: "重设Latent批次",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    latents: {
      name: "Latent因素"
    }
  }
};
const RepeatImageBatch = {
  display_name: "复制图像批次",
  inputs: {
    amount: {
      name: "数量"
    },
    image: {
      name: "图像"
    }
  }
};
const RepeatLatentBatch = {
  display_name: "复制Latent批次",
  inputs: {
    amount: {
      name: "数量"
    },
    samples: {
      name: "Latent"
    }
  }
};
const RescaleCFG = {
  display_name: "缩放CFG",
  inputs: {
    model: {
      name: "模型"
    },
    multiplier: {
      name: "乘数"
    }
  }
};
const SDTurboScheduler = {
  display_name: "SDTurbo调度器",
  inputs: {
    denoise: {
      name: "降噪"
    },
    model: {
      name: "模型"
    },
    steps: {
      name: "步数"
    }
  }
};
const SD_4XUpscale_Conditioning = {
  display_name: "SD_4X放大条件",
  inputs: {
    images: {
      name: "图片"
    },
    negative: {
      name: "负面条件"
    },
    noise_augmentation: {
      name: "噪波增强"
    },
    positive: {
      name: "正面条件"
    },
    scale_ratio: {
      name: "缩放比例"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    },
    "2": {
      name: "Latent"
    }
  }
};
const SV3D_Conditioning = {
  display_name: "SV3D条件",
  inputs: {
    clip_vision: {
      name: "clip视觉"
    },
    elevation: {
      name: "俯仰角"
    },
    height: {
      name: "高度"
    },
    init_image: {
      name: "初始图像"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "帧数"
    },
    width: {
      name: "宽度"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    },
    "2": {
      name: "Latent"
    }
  }
};
const SVD_img2vid_Conditioning = {
  display_name: "SVD_img2vid条件",
  inputs: {
    augmentation_level: {
      name: "增强"
    },
    clip_vision: {
      name: "clip视觉"
    },
    fps: {
      name: "帧率"
    },
    height: {
      name: "高度"
    },
    init_image: {
      name: "初始图像"
    },
    motion_bucket_id: {
      name: "动态bucketID"
    },
    vae: {
      name: "vae"
    },
    video_frames: {
      name: "帧数"
    },
    width: {
      name: "宽度"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    },
    "2": {
      name: "Latent"
    }
  }
};
const SamplerCustom = {
  display_name: "自定义采样器",
  inputs: {
    add_noise: {
      name: "添加噪波"
    },
    cfg: {
      name: "cfg"
    },
    latent_image: {
      name: "Latent"
    },
    model: {
      name: "模型"
    },
    negative: {
      name: "负面条件"
    },
    noise_seed: {
      name: "噪波种子"
    },
    positive: {
      name: "正面条件"
    },
    sampler: {
      name: "采样器"
    },
    sigmas: {
      name: "Sigmas"
    }
  },
  outputs: {
    "0": {
      name: "Latent"
    },
    "1": {
      name: "降噪Latent"
    }
  }
};
const SamplerCustomAdvanced = {
  display_name: "自定义采样器（高级）",
  inputs: {
    guider: {
      name: "引导器"
    },
    latent_image: {
      name: "Latent图像"
    },
    noise: {
      name: "噪波"
    },
    sampler: {
      name: "采样器"
    },
    sigmas: {
      name: "西格玛"
    }
  },
  outputs: {
    "0": {
      name: "Latent"
    },
    "1": {
      name: "降噪Latent"
    }
  }
};
const SamplerDPMAdaptative = {
  display_name: "DPMAdaptative采样器",
  inputs: {
    accept_safety: {
      name: "accept_safety"
    },
    atol: {
      name: "atol"
    },
    dcoeff: {
      name: "dcoeff"
    },
    eta: {
      name: "eta"
    },
    h_init: {
      name: "h_init"
    },
    icoeff: {
      name: "icoeff"
    },
    order: {
      name: "order"
    },
    pcoeff: {
      name: "pcoeff"
    },
    rtol: {
      name: "rtol"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_2M_SDE = {
  display_name: "DPMPP_2M_SDE采样器",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "噪波设备"
    },
    s_noise: {
      name: "s_noise"
    },
    solver_type: {
      name: "求解器类型"
    }
  }
};
const SamplerDPMPP_2S_Ancestral = {
  display_name: "DPMPP_2S_Ancestral采样器",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_3M_SDE = {
  display_name: "DPMPP_3M_SDE采样器",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "噪波设备"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerDPMPP_SDE = {
  display_name: "DPMPP_SDE采样器",
  inputs: {
    eta: {
      name: "eta"
    },
    noise_device: {
      name: "噪波设备"
    },
    r: {
      name: "r"
    },
    s_noise: {
      name: "s_noise"
    }
  }
};
const SamplerEulerAncestral = {
  display_name: "EulerAncestral采样器",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s噪波"
    }
  }
};
const SamplerEulerAncestralCFGPP = {
  display_name: "EulerAncestralCFG++采样器",
  inputs: {
    eta: {
      name: "eta"
    },
    s_noise: {
      name: "s噪波"
    }
  }
};
const SamplerEulerCFGpp = {
  display_name: "EuleCFG++采样器",
  inputs: {
    version: {
      name: "版本"
    }
  }
};
const SamplerLCMUpscale = {
  display_name: "LCM缩放采样器",
  inputs: {
    scale_ratio: {
      name: "缩放比例"
    },
    scale_steps: {
      name: "缩放步数"
    },
    upscale_method: {
      name: "缩放方法"
    }
  }
};
const SamplerLMS = {
  display_name: "LMS采样器",
  inputs: {
    order: {
      name: "顺序"
    }
  }
};
const SaveAnimatedPNG = {
  display_name: "保存动画（APNG）",
  inputs: {
    compress_level: {
      name: "压缩级别"
    },
    filename_prefix: {
      name: "文件名前缀"
    },
    fps: {
      name: "帧率"
    },
    images: {
      name: "图片"
    }
  }
};
const SaveAnimatedWEBP = {
  display_name: "保存动画（WEBP）",
  inputs: {
    filename_prefix: {
      name: "文件名前缀"
    },
    fps: {
      name: "帧率"
    },
    images: {
      name: "图片"
    },
    lossless: {
      name: "无损"
    },
    method: {
      name: "方法"
    },
    quality: {
      name: "质量"
    }
  }
};
const SaveAudio = {
  display_name: "保存音频",
  inputs: {
    audio: {
      name: "音频"
    },
    filename_prefix: {
      name: "文件名前缀"
    }
  }
};
const SaveImage = {
  description: "将输入图像保存到您的ComfyUI输出目录。",
  display_name: "保存图像",
  inputs: {
    filename_prefix: {
      name: "文件名前缀",
      tooltip: "保存文件的文件名的前缀。可使用格式信息如 %date:yyyy-MM-dd% 或 %空Latent.width%，以包含来自工作流内的信息。"
    },
    images: {
      name: "图片",
      tooltip: "要保存的图像。"
    }
  }
};
const SaveImageWebsocket = {
  display_name: "保存图像（网络接口）",
  inputs: {
    images: {
      name: "图片"
    }
  }
};
const SaveLatent = {
  display_name: "保存Latent",
  inputs: {
    filename_prefix: {
      name: "文件名前缀"
    },
    samples: {
      name: "Latent"
    }
  }
};
const SelfAttentionGuidance = {
  display_name: "SAG自注意力引导",
  inputs: {
    blur_sigma: {
      name: "模糊Sigma"
    },
    model: {
      name: "模型"
    },
    scale: {
      name: "缩放"
    }
  }
};
const SetClipHooks = {
  display_name: "设置CLIP约束",
  inputs: {
    apply_to_conds: {
      name: "应用于条件"
    },
    clip: {
      name: "clip"
    },
    hooks: {
      name: "约束"
    },
    schedule_clip: {
      name: "安排clip"
    }
  }
};
const SetHookKeyframes = {
  display_name: "设置约束关键帧",
  inputs: {
    hook_kf: {
      name: "约束关键帧"
    },
    hooks: {
      name: "约束"
    }
  }
};
const SetLatentNoiseMask = {
  display_name: "设置Latent噪波遮罩",
  inputs: {
    mask: {
      name: "遮罩"
    },
    samples: {
      name: "Latent"
    }
  }
};
const SetUnionControlNetType = {
  display_name: "设置UnionControlNet类型",
  inputs: {
    control_net: {
      name: "ControlNet"
    },
    type: {
      name: "类型"
    }
  }
};
const SkipLayerGuidanceDiT = {
  description: "通用的跳过层引导节点，可用于每个DiT模型。",
  display_name: "跳过层引导（DiT）",
  inputs: {
    double_layers: {
      name: "双层"
    },
    end_percent: {
      name: "结束百分比"
    },
    model: {
      name: "模型"
    },
    rescaling_scale: {
      name: "重新缩放比例"
    },
    scale: {
      name: "缩放"
    },
    single_layers: {
      name: "单层"
    },
    start_percent: {
      name: "开始百分比"
    }
  }
};
const SkipLayerGuidanceSD3 = {
  description: "通用版本的跳过层引导节点，可用于每个DiT模型。",
  display_name: "跳过层引导（SD3）",
  inputs: {
    end_percent: {
      name: "结束百分比"
    },
    layers: {
      name: "层"
    },
    model: {
      name: "模型"
    },
    scale: {
      name: "缩放"
    },
    start_percent: {
      name: "开始百分比"
    }
  }
};
const SolidMask = {
  display_name: "纯块遮罩",
  inputs: {
    height: {
      name: "高度"
    },
    value: {
      name: "明度"
    },
    width: {
      name: "宽度"
    }
  }
};
const SplitImageWithAlpha = {
  display_name: "分离图像Alpha",
  inputs: {
    image: {
      name: "图片"
    }
  }
};
const SplitSigmas = {
  display_name: "分离Sigma",
  inputs: {
    sigmas: {
      name: "Sigmas"
    },
    step: {
      name: "步数"
    }
  },
  outputs: {
    "0": {
      name: "高方差"
    },
    "1": {
      name: "低方差"
    }
  }
};
const SplitSigmasDenoise = {
  display_name: "分离Sigma降噪",
  inputs: {
    denoise: {
      name: "降噪"
    },
    sigmas: {
      name: "Sigmas"
    }
  },
  outputs: {
    "0": {
      name: "高方差"
    },
    "1": {
      name: "低方差"
    }
  }
};
const StableCascade_EmptyLatentImage = {
  display_name: "空Latent图像（Stable Cascade）",
  inputs: {
    batch_size: {
      name: "批量大小"
    },
    compression: {
      name: "压缩"
    },
    height: {
      name: "高度"
    },
    width: {
      name: "宽度"
    }
  },
  outputs: {
    "0": {
      name: "阶段C"
    },
    "1": {
      name: "阶段B"
    }
  }
};
const StableCascade_StageB_Conditioning = {
  display_name: "Stable Cascade_B阶段_条件",
  inputs: {
    conditioning: {
      name: "条件"
    },
    stage_c: {
      name: "阶段c"
    }
  }
};
const StableCascade_StageC_VAEEncode = {
  display_name: "Stable Cascade_C阶段_VAE编码",
  inputs: {
    compression: {
      name: "压缩"
    },
    image: {
      name: "图像"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "阶段C"
    },
    "1": {
      name: "阶段B"
    }
  }
};
const StableCascade_SuperResolutionControlnet = {
  display_name: "Stable Cascade_超分辨率ControlNet",
  inputs: {
    image: {
      name: "图像"
    },
    vae: {
      name: "vae"
    }
  },
  outputs: {
    "0": {
      name: "ControlNet"
    },
    "1": {
      name: "阶段C"
    },
    "2": {
      name: "阶段B"
    }
  }
};
const StableZero123_Conditioning = {
  display_name: "StableZero123条件",
  inputs: {
    azimuth: {
      name: "方位角"
    },
    batch_size: {
      name: "批量大小"
    },
    clip_vision: {
      name: "clip视觉"
    },
    elevation: {
      name: "俯仰角"
    },
    height: {
      name: "高度"
    },
    init_image: {
      name: "初始图像"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "宽度"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    },
    "2": {
      name: "Latent"
    }
  }
};
const StableZero123_Conditioning_Batched = {
  display_name: "StableZero123条件_批处理",
  inputs: {
    azimuth: {
      name: "方位角"
    },
    azimuth_batch_increment: {
      name: "方位角增量"
    },
    batch_size: {
      name: "批量大小"
    },
    clip_vision: {
      name: "clip视觉"
    },
    elevation: {
      name: "俯仰角"
    },
    elevation_batch_increment: {
      name: "俯仰角增量"
    },
    height: {
      name: "高度"
    },
    init_image: {
      name: "初始图像"
    },
    vae: {
      name: "vae"
    },
    width: {
      name: "宽度"
    }
  },
  outputs: {
    "0": {
      name: "正面条件"
    },
    "1": {
      name: "负面条件"
    },
    "2": {
      name: "Latent"
    }
  }
};
const StyleModelApply = {
  display_name: "应用风格模型",
  inputs: {
    clip_vision_output: {
      name: "clip视觉输出"
    },
    conditioning: {
      name: "条件"
    },
    strength: {
      name: "强度"
    },
    strength_type: {
      name: "强度类型"
    },
    style_model: {
      name: "风格模型"
    }
  }
};
const StyleModelLoader = {
  display_name: "加载风格模型",
  inputs: {
    style_model_name: {
      name: "风格模型名称"
    }
  }
};
const ThresholdMask = {
  display_name: "遮罩阈值",
  inputs: {
    mask: {
      name: "遮罩"
    },
    value: {
      name: "值"
    }
  }
};
const TomePatchModel = {
  display_name: "Tome合并模型Token",
  inputs: {
    model: {
      name: "模型"
    },
    ratio: {
      name: "比率"
    }
  }
};
const TorchCompileModel = {
  display_name: "Torch编译模型",
  inputs: {
    backend: {
      name: "后端"
    },
    model: {
      name: "模型"
    }
  }
};
const TripleCLIPLoader = {
  description: "[配方]\n\nSD3：clip-l，clip-g，t5",
  display_name: "三重CLIP加载器",
  inputs: {
    clip_name1: {
      name: "CLIP名称1"
    },
    clip_name2: {
      name: "CLIP名称2"
    },
    clip_name3: {
      name: "CLIP名称3"
    }
  }
};
const UNETLoader = {
  display_name: "UNet加载器",
  inputs: {
    unet_name: {
      name: "UNet名称"
    },
    weight_dtype: {
      name: "数据类型"
    }
  }
};
const UNetCrossAttentionMultiply = {
  display_name: "UNet交叉注意力乘数",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "模型"
    },
    out: {
      name: "输出"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetSelfAttentionMultiply = {
  display_name: "UNet自注意力乘数",
  inputs: {
    k: {
      name: "k"
    },
    model: {
      name: "模型"
    },
    out: {
      name: "输出"
    },
    q: {
      name: "q"
    },
    v: {
      name: "v"
    }
  }
};
const UNetTemporalAttentionMultiply = {
  display_name: "UNet时间注意力乘数",
  inputs: {
    cross_structural: {
      name: "交叉结构"
    },
    cross_temporal: {
      name: "交叉时间"
    },
    model: {
      name: "模型"
    },
    self_structural: {
      name: "自我结构"
    },
    self_temporal: {
      name: "自我时间"
    }
  }
};
const UpscaleModelLoader = {
  display_name: "加载放大模型",
  inputs: {
    model_name: {
      name: "模型名称"
    }
  }
};
const VAEDecode = {
  description: "将 Latent 图像解码为像素空间的图像。",
  display_name: "VAE解码",
  inputs: {
    samples: {
      name: "Latent",
      tooltip: "要解码的 Latent 图像。"
    },
    vae: {
      name: "vae",
      tooltip: "用于解码 Latent 图像的 VAE 模型。"
    }
  },
  outputs: {
    "0": {
      tooltip: "解码后的图像。"
    }
  }
};
const VAEDecodeAudio = {
  display_name: "VAE解码（音频）",
  inputs: {
    samples: {
      name: "Latent"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEDecodeTiled = {
  display_name: "VAE解码（分块）",
  inputs: {
    overlap: {
      name: "重叠"
    },
    samples: {
      name: "Latent"
    },
    temporal_overlap: {
      name: "时间重叠",
      tooltip: "仅用于视频VAE：重叠的帧数。"
    },
    temporal_size: {
      name: "时间尺寸",
      tooltip: "仅用于视频VAE：一次解码的帧数。"
    },
    tile_size: {
      name: "分块尺寸"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncode = {
  display_name: "VAE编码",
  inputs: {
    pixels: {
      name: "像素"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeAudio = {
  display_name: "VAE编码（音频）",
  inputs: {
    audio: {
      name: "音频"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeForInpaint = {
  display_name: "VAE编码（局部重绘）",
  inputs: {
    grow_mask_by: {
      name: "扩展遮罩"
    },
    mask: {
      name: "遮罩"
    },
    pixels: {
      name: "像素"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAEEncodeTiled = {
  display_name: "VAE编码分块）",
  inputs: {
    overlap: {
      name: "重叠"
    },
    pixels: {
      name: "像素"
    },
    temporal_overlap: {
      name: "时间重叠",
      tooltip: "仅用于视频VAE：重叠的帧数。"
    },
    temporal_size: {
      name: "时间尺寸",
      tooltip: "仅用于视频VAE：一次编码的帧数。"
    },
    tile_size: {
      name: "分块尺寸"
    },
    vae: {
      name: "vae"
    }
  }
};
const VAELoader = {
  display_name: "加载VAE",
  inputs: {
    vae_name: {
      name: "vae名称"
    }
  }
};
const VAESave = {
  display_name: "保存VAE",
  inputs: {
    filename_prefix: {
      name: "文件名前缀"
    },
    vae: {
      name: "vae"
    }
  }
};
const VPScheduler = {
  display_name: "VPS调度器",
  inputs: {
    beta_d: {
      name: "beta_d"
    },
    beta_min: {
      name: "beta_min"
    },
    eps_s: {
      name: "eps_s"
    },
    steps: {
      name: "步数"
    }
  }
};
const VideoLinearCFGGuidance = {
  display_name: "视频线性CFG引导",
  inputs: {
    min_cfg: {
      name: "最小配置"
    },
    model: {
      name: "模型"
    }
  }
};
const VideoTriangleCFGGuidance = {
  display_name: "视频三角形CFG引导",
  inputs: {
    min_cfg: {
      name: "最小配置"
    },
    model: {
      name: "模型"
    }
  }
};
const WebcamCapture = {
  display_name: "网络摄像头捕获",
  inputs: {
    capture_on_queue: {
      name: "执行时捕获"
    },
    height: {
      name: "高度"
    },
    image: {
      name: "图像"
    },
    width: {
      name: "宽度"
    }
  }
};
const unCLIPCheckpointLoader = {
  display_name: "unCLIPCheckpoint加载器",
  inputs: {
    ckpt_name: {
      name: "Checkpoint名称"
    }
  }
};
const unCLIPConditioning = {
  display_name: "unCLIP条件",
  inputs: {
    clip_vision_output: {
      name: "CLIP视觉输出"
    },
    conditioning: {
      name: "条件"
    },
    noise_augmentation: {
      name: "噪波增强"
    },
    strength: {
      name: "强度"
    }
  }
};
const zhNodes = {
  AddNoise,
  AlignYourStepsScheduler,
  BasicGuider,
  BasicScheduler,
  BetaSamplingScheduler,
  CFGGuider,
  CLIPAttentionMultiply,
  CLIPLoader,
  CLIPMergeAdd,
  CLIPMergeSimple,
  CLIPMergeSubtract,
  CLIPSave,
  CLIPSetLastLayer,
  CLIPTextEncode,
  CLIPTextEncodeControlnet,
  CLIPTextEncodeFlux,
  CLIPTextEncodeHunyuanDiT,
  CLIPTextEncodePixArtAlpha,
  CLIPTextEncodeSD3,
  CLIPTextEncodeSDXL,
  CLIPTextEncodeSDXLRefiner,
  CLIPVisionEncode,
  CLIPVisionLoader,
  Canny,
  CheckpointLoader,
  CheckpointLoaderSimple,
  CheckpointSave,
  CombineHooks2,
  CombineHooks4,
  CombineHooks8,
  ConditioningAverage,
  ConditioningCombine,
  ConditioningConcat,
  ConditioningSetArea,
  ConditioningSetAreaPercentage,
  ConditioningSetAreaStrength,
  ConditioningSetDefaultCombine,
  ConditioningSetMask,
  ConditioningSetProperties,
  ConditioningSetPropertiesAndCombine,
  ConditioningSetTimestepRange,
  ConditioningStableAudio,
  ConditioningTimestepsRange,
  ConditioningZeroOut,
  ControlNetApply,
  ControlNetApplyAdvanced,
  ControlNetApplySD3,
  ControlNetInpaintingAliMamaApply,
  ControlNetLoader,
  CreateHookKeyframe,
  CreateHookKeyframesFromFloats,
  CreateHookKeyframesInterpolated,
  CreateHookLora,
  CreateHookLoraModelOnly,
  CreateHookModelAsLora,
  CreateHookModelAsLoraModelOnly,
  CropMask,
  DevToolsDeprecatedNode,
  DevToolsErrorRaiseNode,
  DevToolsErrorRaiseNodeWithMessage,
  DevToolsExperimentalNode,
  DevToolsLongComboDropdown,
  DevToolsNodeWithForceInput,
  DevToolsNodeWithOnlyOptionalInput,
  DevToolsNodeWithOptionalInput,
  DevToolsNodeWithOutputList,
  DevToolsNodeWithStringInput,
  DevToolsNodeWithUnionInput,
  DevToolsSimpleSlider,
  DiffControlNetLoader,
  DifferentialDiffusion,
  DiffusersLoader,
  DisableNoise,
  DualCFGGuider,
  DualCLIPLoader,
  EmptyHunyuanLatentVideo,
  EmptyImage,
  EmptyLTXVLatentVideo,
  EmptyLatentAudio,
  EmptyLatentImage,
  EmptyMochiLatentVideo,
  EmptySD3LatentImage,
  ExponentialScheduler,
  FeatherMask,
  FlipSigmas,
  FluxGuidance,
  FreeU,
  FreeU_V2,
  GITSScheduler,
  GLIGENLoader,
  GLIGENTextBoxApply,
  GrowMask,
  HyperTile,
  HypernetworkLoader,
  ImageBatch,
  ImageBlend,
  ImageBlur,
  ImageColorToMask,
  ImageCompositeMasked,
  ImageCrop,
  ImageFromBatch,
  ImageInvert,
  ImageOnlyCheckpointLoader,
  ImageOnlyCheckpointSave,
  ImagePadForOutpaint,
  ImageQuantize,
  ImageScale,
  ImageScaleBy,
  ImageScaleToTotalPixels,
  ImageSharpen,
  ImageToMask,
  ImageUpscaleWithModel,
  InpaintModelConditioning,
  InstructPixToPixConditioning,
  InvertMask,
  JoinImageWithAlpha,
  KSampler,
  KSamplerAdvanced,
  KSamplerSelect,
  KarrasScheduler,
  LTXVConditioning,
  LTXVImgToVideo,
  LTXVScheduler,
  LaplaceScheduler,
  LatentAdd,
  LatentApplyOperation,
  LatentApplyOperationCFG,
  LatentBatch,
  LatentBatchSeedBehavior,
  LatentBlend,
  LatentComposite,
  LatentCompositeMasked,
  LatentCrop,
  LatentFlip,
  LatentFromBatch,
  LatentInterpolate,
  LatentMultiply,
  LatentOperationSharpen,
  LatentOperationTonemapReinhard,
  LatentRotate,
  LatentSubtract,
  LatentUpscale,
  LatentUpscaleBy,
  Load3D,
  Load3DAnimation,
  LoadAudio,
  LoadImage,
  LoadImageMask,
  LoadLatent,
  LoraLoader,
  LoraLoaderModelOnly,
  LoraSave,
  Mahiro,
  MaskComposite,
  MaskToImage,
  ModelMergeAdd,
  ModelMergeAuraflow,
  ModelMergeBlocks,
  ModelMergeFlux1,
  ModelMergeLTXV,
  ModelMergeMochiPreview,
  ModelMergeSD1,
  ModelMergeSD2,
  ModelMergeSD35_Large,
  ModelMergeSD3_2B,
  ModelMergeSDXL,
  ModelMergeSimple,
  ModelMergeSubtract,
  ModelSamplingAuraFlow,
  ModelSamplingContinuousEDM,
  ModelSamplingContinuousV,
  ModelSamplingDiscrete,
  ModelSamplingFlux,
  ModelSamplingLTXV,
  ModelSamplingSD3,
  ModelSamplingStableCascade,
  ModelSave,
  Morphology,
  PairConditioningCombine,
  PairConditioningSetDefaultCombine,
  PairConditioningSetProperties,
  PairConditioningSetPropertiesAndCombine,
  PatchModelAddDownscale,
  PerpNeg,
  PerpNegGuider,
  PerturbedAttentionGuidance,
  PhotoMakerEncode,
  PhotoMakerLoader,
  PolyexponentialScheduler,
  PorterDuffImageComposite,
  Preview3D,
  PreviewAudio,
  PreviewImage,
  RandomNoise,
  RebatchImages,
  RebatchLatents,
  RepeatImageBatch,
  RepeatLatentBatch,
  RescaleCFG,
  SDTurboScheduler,
  SD_4XUpscale_Conditioning,
  SV3D_Conditioning,
  SVD_img2vid_Conditioning,
  SamplerCustom,
  SamplerCustomAdvanced,
  SamplerDPMAdaptative,
  SamplerDPMPP_2M_SDE,
  SamplerDPMPP_2S_Ancestral,
  SamplerDPMPP_3M_SDE,
  SamplerDPMPP_SDE,
  SamplerEulerAncestral,
  SamplerEulerAncestralCFGPP,
  SamplerEulerCFGpp,
  SamplerLCMUpscale,
  SamplerLMS,
  SaveAnimatedPNG,
  SaveAnimatedWEBP,
  SaveAudio,
  SaveImage,
  SaveImageWebsocket,
  SaveLatent,
  SelfAttentionGuidance,
  SetClipHooks,
  SetHookKeyframes,
  SetLatentNoiseMask,
  SetUnionControlNetType,
  SkipLayerGuidanceDiT,
  SkipLayerGuidanceSD3,
  SolidMask,
  SplitImageWithAlpha,
  SplitSigmas,
  SplitSigmasDenoise,
  StableCascade_EmptyLatentImage,
  StableCascade_StageB_Conditioning,
  StableCascade_StageC_VAEEncode,
  StableCascade_SuperResolutionControlnet,
  StableZero123_Conditioning,
  StableZero123_Conditioning_Batched,
  StyleModelApply,
  StyleModelLoader,
  ThresholdMask,
  TomePatchModel,
  TorchCompileModel,
  TripleCLIPLoader,
  UNETLoader,
  UNetCrossAttentionMultiply,
  UNetSelfAttentionMultiply,
  UNetTemporalAttentionMultiply,
  UpscaleModelLoader,
  VAEDecode,
  VAEDecodeAudio,
  VAEDecodeTiled,
  VAEEncode,
  VAEEncodeAudio,
  VAEEncodeForInpaint,
  VAEEncodeTiled,
  VAELoader,
  VAESave,
  VPScheduler,
  VideoLinearCFGGuidance,
  VideoTriangleCFGGuidance,
  WebcamCapture,
  unCLIPCheckpointLoader,
  unCLIPConditioning
};
const Comfy_ConfirmClear = {
  name: "清除工作流时需要确认"
};
const Comfy_DOMClippingEnabled = {
  name: "启用DOM元素裁剪（启用可能会降低性能）"
};
const Comfy_DevMode = {
  name: "启用开发模式选项（API保存等）"
};
const Comfy_DisableFloatRounding = {
  name: "禁用默认浮点组件四舍五入。",
  tooltip: "(需要重新加载页面) 当节点自身设置了四舍五入时，无法禁用该功能。"
};
const Comfy_DisableSliders = {
  name: "禁用节点组件滑块"
};
const Comfy_EditAttention_Delta = {
  name: "Ctrl+上/下 精度"
};
const Comfy_EnableTooltips = {
  name: "启用工具提示"
};
const Comfy_EnableWorkflowViewRestore = {
  name: "在工作流中保存和恢复视图位置及缩放"
};
const Comfy_FloatRoundingPrecision = {
  name: "浮点组件四舍五入的小数位数 [0 = 自动]。",
  tooltip: "(需要重新加载页面)"
};
const Comfy_Graph_CanvasInfo = {
  name: "在左下角显示画布信息（fps等）"
};
const Comfy_Graph_CanvasMenu = {
  name: "显示图形画布菜单"
};
const Comfy_Graph_CtrlShiftZoom = {
  name: "启用快速缩放快捷键（Ctrl + Shift + 拖动）"
};
const Comfy_Graph_LinkMarkers = {
  name: "连线中点标记",
  options: {
    Arrow: "箭头",
    Circle: "圆",
    None: "无"
  }
};
const Comfy_Graph_ZoomSpeed = {
  name: "画布缩放速度"
};
const Comfy_GroupSelectedNodes_Padding = {
  name: "选定节点的组内边距"
};
const Comfy_Group_DoubleClickTitleToEdit = {
  name: "双击组标题以编辑"
};
const Comfy_InvertMenuScrolling = {
  name: "反转上下文菜单滚动"
};
const Comfy_LinkRelease_Action = {
  name: "释放连线时的操作",
  options: {
    "context menu": "上下文菜单",
    "no action": "无操作",
    "search box": "搜索框"
  }
};
const Comfy_LinkRelease_ActionShift = {
  name: "释放连线时的操作（Shift）",
  options: {
    "context menu": "上下文菜单",
    "no action": "无操作",
    "search box": "搜索框"
  }
};
const Comfy_LinkRenderMode = {
  name: "连线渲染样式",
  options: {
    Hidden: "隐藏",
    Linear: "直线",
    Spline: "曲线",
    Straight: "直角线"
  }
};
const Comfy_Locale = {
  name: "语言"
};
const Comfy_MaskEditor_BrushAdjustmentSpeed = {
  name: "画笔调整速度倍增器",
  tooltip: "控制调整时画笔大小和硬度变化的速度。更高的值意味着更快的变化。"
};
const Comfy_MaskEditor_UseDominantAxis = {
  name: "将画笔调整锁定到主轴",
  tooltip: "启用后，画笔调整将仅根据您移动的方向影响大小或硬度。"
};
const Comfy_MaskEditor_UseNewEditor = {
  name: "使用新画笔编辑器",
  tooltip: "切换到新的画笔编辑器界面"
};
const Comfy_ModelLibrary_AutoLoadAll = {
  name: "自动加载所有模型文件夹",
  tooltip: "开启后，打开模型库会加载所有文件夹内的模型（可能导致卡顿）。关闭后，仅加载当前文件夹内的模型。"
};
const Comfy_ModelLibrary_NameFormat = {
  name: "在模型库树视图中显示的名称",
  options: {
    filename: "文件名",
    title: "标题"
  },
  tooltip: "选择“文件名”以在模型列表中显示原始文件名的简化视图（不带目录和“.safetensors”后缀名）。选择“标题”以显示可配置的模型元数据标题。"
};
const Comfy_NodeBadge_NodeIdBadgeMode = {
  name: "节点ID标签",
  options: {
    None: "无",
    "Show all": "显示全部"
  }
};
const Comfy_NodeBadge_NodeLifeCycleBadgeMode = {
  name: "节点制作周期标签",
  options: {
    None: "无",
    "Show all": "显示全部"
  }
};
const Comfy_NodeBadge_NodeSourceBadgeMode = {
  name: "节点源标签",
  options: {
    "Hide built-in": "仅第三方",
    None: "无",
    "Show all": "显示全部"
  }
};
const Comfy_NodeInputConversionSubmenus = {
  name: "在节点上下文菜单中，将输入/组件之间转换的条目放置在子菜单中。"
};
const Comfy_NodeSearchBoxImpl = {
  name: "节点搜索框",
  options: {
    "default": "默认",
    "litegraph (legacy)": "litegraph（旧版）"
  }
};
const Comfy_NodeSearchBoxImpl_NodePreview = {
  name: "显示节点预览",
  tooltip: "仅适用于默认框架"
};
const Comfy_NodeSearchBoxImpl_ShowCategory = {
  name: "显示节点类别",
  tooltip: "仅适用于默认框架"
};
const Comfy_NodeSearchBoxImpl_ShowIdName = {
  name: "显示节点ID名称",
  tooltip: "仅适用于默认框架"
};
const Comfy_NodeSearchBoxImpl_ShowNodeFrequency = {
  name: "显示节点频率",
  tooltip: "仅适用于默认框架"
};
const Comfy_NodeSuggestions_number = {
  name: "节点建议数量",
  tooltip: "仅适用于 litegraph"
};
const Comfy_Node_AutoSnapLinkToSlot = {
  name: "连线自动吸附到节点接口",
  tooltip: "在节点上拖动连线时，连线会自动吸附到节点的可用输入接口。"
};
const Comfy_Node_BypassAllLinksOnDelete = {
  name: "删除节点时保留连线",
  tooltip: "删除节点时，尝试重新连接其所有输入和输出连线（类似于忽略节点）。"
};
const Comfy_Node_DoubleClickTitleToEdit = {
  name: "双击节点标题以编辑"
};
const Comfy_Node_MiddleClickRerouteNode = {
  name: "中键单击创建新的转接点"
};
const Comfy_Node_Opacity = {
  name: "节点不透明度"
};
const Comfy_Node_ShowDeprecated = {
  name: "在搜索中显示已弃用的节点",
  tooltip: "弃用节点在UI中默认隐藏，但在工作流中仍然有效。"
};
const Comfy_Node_ShowExperimental = {
  name: "在搜索中显示实验性节点",
  tooltip: "实验节点在UI中标记为实验性，可能在未来版本中发生重大变化或被移除。在生产工作流中谨慎使用。"
};
const Comfy_Node_SnapHighlightsNode = {
  name: "吸附高亮节点",
  tooltip: "在拖动连线经过具有可用输入接口的节点时，高亮显示该节点。"
};
const Comfy_Pointer_ClickBufferTime = {
  name: "指针点击漂移延迟",
  tooltip: "按下指针按钮后，忽略指针移动的最大时间（毫秒）。\n\n有助于防止在点击时意外移动鼠标。"
};
const Comfy_Pointer_ClickDrift = {
  name: "指针点击漂移（距离）",
  tooltip: "如果指针在按住按钮时移动超过此距离，则视为拖动（而不是点击）。\n\n有助于防止在点击时意外移动鼠标"
};
const Comfy_Pointer_DoubleClickTime = {
  name: "双击间隔（最大）",
  tooltip: "双击的两次点击之间的最大时间（毫秒）。增加此值有助于解决双击有时未被识别的问题。"
};
const Comfy_PreviewFormat = {
  name: "预览图像格式",
  tooltip: "在图像组件中显示预览时，将其转换为轻量级图像，例如webp、jpeg、webp;50等。"
};
const Comfy_PromptFilename = {
  name: "保存工作流时提示文件名"
};
const Comfy_QueueButton_BatchCountLimit = {
  name: "批处理计数限制",
  tooltip: "单次添加到队列的最大任务数量"
};
const Comfy_Queue_MaxHistoryItems = {
  name: "队列历史大小",
  tooltip: "队列历史中显示的最大任务数量。"
};
const Comfy_RerouteBeta = {
  name: "选择加入转接点Beta",
  tooltip: "启用新的转接点。\n\n通过按住alt并划过连线来添加转接点，或在连线中点菜单中添加。\n\n禁用此选项不会造成破坏 - 转接点将被隐藏。"
};
const Comfy_Sidebar_Location = {
  name: "侧边栏位置",
  options: {
    left: "左侧",
    right: "右侧"
  }
};
const Comfy_Sidebar_Size = {
  name: "侧边栏大小",
  options: {
    normal: "正常",
    small: "小"
  }
};
const Comfy_SnapToGrid_GridSize = {
  name: "吸附网格大小",
  tooltip: "在按住shift拖动和调整节点大小时，节点将对齐到网格，该选项控制网格。"
};
const Comfy_TextareaWidget_FontSize = {
  name: "文本框组件字体大小"
};
const Comfy_TextareaWidget_Spellcheck = {
  name: "文本框组件拼写检查"
};
const Comfy_TreeExplorer_ItemPadding = {
  name: "树形浏览器项目内边距"
};
const Comfy_UseNewMenu = {
  name: "使用新菜单",
  options: {
    Bottom: "底部",
    Disabled: "禁用",
    Top: "顶部"
  }
};
const Comfy_Validation_NodeDefs = {
  name: "校验节点定义（慢）",
  tooltip: "推荐给节点开发者。开启后会在 ComfyUI 启动时校验全部节点定义。"
};
const Comfy_Validation_Workflows = {
  name: "校验工作流"
};
const Comfy_WidgetControlMode = {
  name: "组件控制模式",
  options: {
    after: "之后",
    before: "之前"
  },
  tooltip: "控制组件值的更新时机（随机/增加/减少），可以在执行工作流之前或之后。"
};
const Comfy_Window_UnloadConfirmation = {
  name: "关闭窗口时显示确认"
};
const Comfy_Workflow_ConfirmDelete = {
  name: "删除工作流时显示确认"
};
const Comfy_Workflow_ShowMissingModelsWarning = {
  name: "显示缺失模型警告"
};
const Comfy_Workflow_ShowMissingNodesWarning = {
  name: "显示缺失节点警告"
};
const Comfy_Workflow_SortNodeIdOnSave = {
  name: "保存节点ID到工作流"
};
const Comfy_Workflow_WorkflowTabsPosition = {
  name: "已打开工作流的位置",
  options: {
    Sidebar: "侧边栏",
    Topbar: "顶部栏"
  }
};
const LiteGraph_Canvas_MaximumFps = {
  name: "最大FPS",
  tooltip: "画布允许渲染的最大帧数。限制GPU使用以换取流畅度。如果为0，则使用屏幕刷新率。默认值：0"
};
const pysssss_SnapToGrid = {
  name: "始终吸附到网格"
};
const zhSettings = {
  "Comfy-Desktop_AutoUpdate": {
    name: "自动检查更新"
  },
  "Comfy-Desktop_SendStatistics": {
    name: "发送匿名崩溃报告"
  },
  Comfy_ConfirmClear,
  Comfy_DOMClippingEnabled,
  Comfy_DevMode,
  Comfy_DisableFloatRounding,
  Comfy_DisableSliders,
  Comfy_EditAttention_Delta,
  Comfy_EnableTooltips,
  Comfy_EnableWorkflowViewRestore,
  Comfy_FloatRoundingPrecision,
  Comfy_Graph_CanvasInfo,
  Comfy_Graph_CanvasMenu,
  Comfy_Graph_CtrlShiftZoom,
  Comfy_Graph_LinkMarkers,
  Comfy_Graph_ZoomSpeed,
  Comfy_GroupSelectedNodes_Padding,
  Comfy_Group_DoubleClickTitleToEdit,
  Comfy_InvertMenuScrolling,
  Comfy_LinkRelease_Action,
  Comfy_LinkRelease_ActionShift,
  Comfy_LinkRenderMode,
  Comfy_Locale,
  Comfy_MaskEditor_BrushAdjustmentSpeed,
  Comfy_MaskEditor_UseDominantAxis,
  Comfy_MaskEditor_UseNewEditor,
  Comfy_ModelLibrary_AutoLoadAll,
  Comfy_ModelLibrary_NameFormat,
  Comfy_NodeBadge_NodeIdBadgeMode,
  Comfy_NodeBadge_NodeLifeCycleBadgeMode,
  Comfy_NodeBadge_NodeSourceBadgeMode,
  Comfy_NodeInputConversionSubmenus,
  Comfy_NodeSearchBoxImpl,
  Comfy_NodeSearchBoxImpl_NodePreview,
  Comfy_NodeSearchBoxImpl_ShowCategory,
  Comfy_NodeSearchBoxImpl_ShowIdName,
  Comfy_NodeSearchBoxImpl_ShowNodeFrequency,
  Comfy_NodeSuggestions_number,
  Comfy_Node_AutoSnapLinkToSlot,
  Comfy_Node_BypassAllLinksOnDelete,
  Comfy_Node_DoubleClickTitleToEdit,
  Comfy_Node_MiddleClickRerouteNode,
  Comfy_Node_Opacity,
  Comfy_Node_ShowDeprecated,
  Comfy_Node_ShowExperimental,
  Comfy_Node_SnapHighlightsNode,
  Comfy_Pointer_ClickBufferTime,
  Comfy_Pointer_ClickDrift,
  Comfy_Pointer_DoubleClickTime,
  Comfy_PreviewFormat,
  Comfy_PromptFilename,
  Comfy_QueueButton_BatchCountLimit,
  Comfy_Queue_MaxHistoryItems,
  Comfy_RerouteBeta,
  Comfy_Sidebar_Location,
  Comfy_Sidebar_Size,
  Comfy_SnapToGrid_GridSize,
  Comfy_TextareaWidget_FontSize,
  Comfy_TextareaWidget_Spellcheck,
  Comfy_TreeExplorer_ItemPadding,
  Comfy_UseNewMenu,
  Comfy_Validation_NodeDefs,
  Comfy_Validation_Workflows,
  Comfy_WidgetControlMode,
  Comfy_Window_UnloadConfirmation,
  Comfy_Workflow_ConfirmDelete,
  Comfy_Workflow_ShowMissingModelsWarning,
  Comfy_Workflow_ShowMissingNodesWarning,
  Comfy_Workflow_SortNodeIdOnSave,
  Comfy_Workflow_WorkflowTabsPosition,
  LiteGraph_Canvas_MaximumFps,
  pysssss_SnapToGrid
};
function buildLocale(main, nodes, commands2, settings) {
  return {
    ...main,
    nodeDefs: nodes,
    commands: commands2,
    settings
  };
}
__name(buildLocale, "buildLocale");
const messages = {
  en: buildLocale(en, enNodes, enCommands, enSettings),
  zh: buildLocale(zh, zhNodes, zhCommands, zhSettings),
  ru: buildLocale(ru, ruNodes, ruCommands, ruSettings),
  ja: buildLocale(ja, jaNodes, jaCommands, jaSettings),
  ko: buildLocale(ko, koNodes, koCommands, koSettings),
  fr: buildLocale(fr, frNodes, frCommands, frSettings)
};
const i18n = createI18n({
  // Must set `false`, as Vue I18n Legacy API is for Vue 2
  legacy: false,
  locale: navigator.language.split("-")[0] || "en",
  fallbackLocale: "en",
  messages,
  // Ignore warnings for locale options as each option is in its own language.
  // e.g. "English", "中文", "Русский", "日本語", "한국어", "Français"
  missingWarn: /^(?!settings\.Comfy_Locale\.options\.).+/,
  fallbackWarn: /^(?!settings\.Comfy_Locale\.options\.).+/
});
const { t, te } = i18n.global;
function st(key, fallbackMessage) {
  return te(key) ? t(key) : fallbackMessage;
}
__name(st, "st");
const useToastStore = /* @__PURE__ */ defineStore("toast", () => {
  const messagesToAdd = ref([]);
  const messagesToRemove = ref([]);
  const removeAllRequested = ref(false);
  function add3(message3) {
    messagesToAdd.value = [...messagesToAdd.value, message3];
  }
  __name(add3, "add");
  function remove4(message3) {
    messagesToRemove.value = [...messagesToRemove.value, message3];
  }
  __name(remove4, "remove");
  function removeAll() {
    removeAllRequested.value = true;
  }
  __name(removeAll, "removeAll");
  function addAlert(message3) {
    add3({ severity: "warn", summary: "Alert", detail: message3 });
  }
  __name(addAlert, "addAlert");
  return {
    messagesToAdd,
    messagesToRemove,
    removeAllRequested,
    add: add3,
    remove: remove4,
    removeAll,
    addAlert
  };
});
function useErrorHandling() {
  const toast = useToastStore();
  const toastErrorHandler = /* @__PURE__ */ __name((error2) => {
    toast.add({
      severity: "error",
      summary: t("g.error"),
      detail: error2.message
    });
  }, "toastErrorHandler");
  const wrapWithErrorHandling = /* @__PURE__ */ __name((action, errorHandler, finallyHandler) => (...args) => {
    try {
      return action(...args);
    } catch (e2) {
      ;
      (errorHandler ?? toastErrorHandler)(e2);
    } finally {
      finallyHandler?.();
    }
  }, "wrapWithErrorHandling");
  const wrapWithErrorHandlingAsync = /* @__PURE__ */ __name((action, errorHandler, finallyHandler) => async (...args) => {
    try {
      return await action(...args);
    } catch (e2) {
      ;
      (errorHandler ?? toastErrorHandler)(e2);
    } finally {
      finallyHandler?.();
    }
  }, "wrapWithErrorHandlingAsync");
  return { wrapWithErrorHandling, wrapWithErrorHandlingAsync };
}
__name(useErrorHandling, "useErrorHandling");
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x2) {
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
}
__name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
function getDefaultExportFromNamespaceIfPresent(n) {
  return n && Object.prototype.hasOwnProperty.call(n, "default") ? n["default"] : n;
}
__name(getDefaultExportFromNamespaceIfPresent, "getDefaultExportFromNamespaceIfPresent");
function getDefaultExportFromNamespaceIfNotNamed(n) {
  return n && Object.prototype.hasOwnProperty.call(n, "default") && Object.keys(n).length === 1 ? n["default"] : n;
}
__name(getDefaultExportFromNamespaceIfNotNamed, "getDefaultExportFromNamespaceIfNotNamed");
function getAugmentedNamespace(n) {
  if (n.__esModule) return n;
  var f = n.default;
  if (typeof f == "function") {
    var a = /* @__PURE__ */ __name(function a2() {
      if (this instanceof a2) {
        return Reflect.construct(f, arguments, this.constructor);
      }
      return f.apply(this, arguments);
    }, "a");
    a.prototype = f.prototype;
  } else a = {};
  Object.defineProperty(a, "__esModule", { value: true });
  Object.keys(n).forEach(function(k) {
    var d = Object.getOwnPropertyDescriptor(n, k);
    Object.defineProperty(a, k, d.get ? d : {
      enumerable: true,
      get: /* @__PURE__ */ __name(function() {
        return n[k];
      }, "get")
    });
  });
  return a;
}
__name(getAugmentedNamespace, "getAugmentedNamespace");
var lodash$1 = { exports: {} };
/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */
var lodash = lodash$1.exports;
(function(module, exports) {
  ;
  (function() {
    var undefined$1;
    var VERSION2 = "4.17.21";
    var LARGE_ARRAY_SIZE = 200;
    var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    var MAX_MEMOIZE_SIZE = 500;
    var PLACEHOLDER = "__lodash_placeholder__";
    var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
    var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
    var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
    var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
    var HOT_COUNT = 800, HOT_SPAN = 16;
    var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
    var INFINITY2 = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
    var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
    var wrapFlags = [
      ["ary", WRAP_ARY_FLAG],
      ["bind", WRAP_BIND_FLAG],
      ["bindKey", WRAP_BIND_KEY_FLAG],
      ["curry", WRAP_CURRY_FLAG],
      ["curryRight", WRAP_CURRY_RIGHT_FLAG],
      ["flip", WRAP_FLIP_FLAG],
      ["partial", WRAP_PARTIAL_FLAG],
      ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
      ["rearg", WRAP_REARG_FLAG]
    ];
    var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
    var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[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 reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
    var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
    var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
    var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
    var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
    var reTrimStart = /^\s+/;
    var reWhitespace = /\s/;
    var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
    var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
    var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
    var reEscapeChar = /\\(\\)?/g;
    var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
    var reFlags = /\w*$/;
    var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
    var reIsBinary = /^0b[01]+$/i;
    var reIsHostCtor = /^\[object .+?Constructor\]$/;
    var reIsOctal = /^0o[0-7]+$/i;
    var reIsUint = /^(?:0|[1-9]\d*)$/;
    var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
    var reNoMatch = /($^)/;
    var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
    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 = "['’]", rsAstral = "[" + rsAstralRange + "]", 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 + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?: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, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
    var reApos = RegExp(rsApos, "g");
    var reComboMark = RegExp(rsCombo, "g");
    var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
    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");
    var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
    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 ]/;
    var contextProps = [
      "Array",
      "Buffer",
      "DataView",
      "Date",
      "Error",
      "Float32Array",
      "Float64Array",
      "Function",
      "Int8Array",
      "Int16Array",
      "Int32Array",
      "Map",
      "Math",
      "Object",
      "Promise",
      "RegExp",
      "Set",
      "String",
      "Symbol",
      "TypeError",
      "Uint8Array",
      "Uint8ClampedArray",
      "Uint16Array",
      "Uint32Array",
      "WeakMap",
      "_",
      "clearTimeout",
      "isFinite",
      "parseInt",
      "setTimeout"
    ];
    var templateCounter = -1;
    var typedArrayTags = {};
    typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
    typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
    var cloneableTags = {};
    cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
    cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
    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 htmlEscapes = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;",
      "'": "&#39;"
    };
    var htmlUnescapes = {
      "&amp;": "&",
      "&lt;": "<",
      "&gt;": ">",
      "&quot;": '"',
      "&#39;": "'"
    };
    var stringEscapes = {
      "\\": "\\",
      "'": "'",
      "\n": "n",
      "\r": "r",
      "\u2028": "u2028",
      "\u2029": "u2029"
    };
    var freeParseFloat = parseFloat, freeParseInt = parseInt;
    var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
    var freeSelf = typeof self == "object" && self && self.Object === Object && self;
    var root24 = freeGlobal || freeSelf || Function("return this")();
    var freeExports = exports && !exports.nodeType && exports;
    var freeModule = freeExports && true && module && !module.nodeType && module;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var freeProcess = moduleExports && freeGlobal.process;
    var nodeUtil = function() {
      try {
        var types = freeModule && freeModule.require && freeModule.require("util").types;
        if (types) {
          return types;
        }
        return freeProcess && freeProcess.binding && freeProcess.binding("util");
      } catch (e2) {
      }
    }();
    var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
    function apply2(func, thisArg, args) {
      switch (args.length) {
        case 0:
          return func.call(thisArg);
        case 1:
          return func.call(thisArg, args[0]);
        case 2:
          return func.call(thisArg, args[0], args[1]);
        case 3:
          return func.call(thisArg, args[0], args[1], args[2]);
      }
      return func.apply(thisArg, args);
    }
    __name(apply2, "apply");
    function arrayAggregator(array, setter, iteratee, accumulator) {
      var index2 = -1, length = array == null ? 0 : array.length;
      while (++index2 < length) {
        var value4 = array[index2];
        setter(accumulator, value4, iteratee(value4), array);
      }
      return accumulator;
    }
    __name(arrayAggregator, "arrayAggregator");
    function arrayEach(array, iteratee) {
      var index2 = -1, length = array == null ? 0 : array.length;
      while (++index2 < length) {
        if (iteratee(array[index2], index2, array) === false) {
          break;
        }
      }
      return array;
    }
    __name(arrayEach, "arrayEach");
    function arrayEachRight(array, iteratee) {
      var length = array == null ? 0 : array.length;
      while (length--) {
        if (iteratee(array[length], length, array) === false) {
          break;
        }
      }
      return array;
    }
    __name(arrayEachRight, "arrayEachRight");
    function arrayEvery(array, predicate) {
      var index2 = -1, length = array == null ? 0 : array.length;
      while (++index2 < length) {
        if (!predicate(array[index2], index2, array)) {
          return false;
        }
      }
      return true;
    }
    __name(arrayEvery, "arrayEvery");
    function arrayFilter(array, predicate) {
      var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
      while (++index2 < length) {
        var value4 = array[index2];
        if (predicate(value4, index2, array)) {
          result[resIndex++] = value4;
        }
      }
      return result;
    }
    __name(arrayFilter, "arrayFilter");
    function arrayIncludes(array, value4) {
      var length = array == null ? 0 : array.length;
      return !!length && baseIndexOf(array, value4, 0) > -1;
    }
    __name(arrayIncludes, "arrayIncludes");
    function arrayIncludesWith(array, value4, comparator2) {
      var index2 = -1, length = array == null ? 0 : array.length;
      while (++index2 < length) {
        if (comparator2(value4, array[index2])) {
          return true;
        }
      }
      return false;
    }
    __name(arrayIncludesWith, "arrayIncludesWith");
    function arrayMap(array, iteratee) {
      var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
      while (++index2 < length) {
        result[index2] = iteratee(array[index2], index2, array);
      }
      return result;
    }
    __name(arrayMap, "arrayMap");
    function arrayPush(array, values) {
      var index2 = -1, length = values.length, offset = array.length;
      while (++index2 < length) {
        array[offset + index2] = values[index2];
      }
      return array;
    }
    __name(arrayPush, "arrayPush");
    function arrayReduce(array, iteratee, accumulator, initAccum) {
      var index2 = -1, length = array == null ? 0 : array.length;
      if (initAccum && length) {
        accumulator = array[++index2];
      }
      while (++index2 < length) {
        accumulator = iteratee(accumulator, array[index2], index2, array);
      }
      return accumulator;
    }
    __name(arrayReduce, "arrayReduce");
    function arrayReduceRight(array, iteratee, accumulator, initAccum) {
      var length = array == null ? 0 : array.length;
      if (initAccum && length) {
        accumulator = array[--length];
      }
      while (length--) {
        accumulator = iteratee(accumulator, array[length], length, array);
      }
      return accumulator;
    }
    __name(arrayReduceRight, "arrayReduceRight");
    function arraySome(array, predicate) {
      var index2 = -1, length = array == null ? 0 : array.length;
      while (++index2 < length) {
        if (predicate(array[index2], index2, array)) {
          return true;
        }
      }
      return false;
    }
    __name(arraySome, "arraySome");
    var asciiSize = baseProperty("length");
    function asciiToArray(string) {
      return string.split("");
    }
    __name(asciiToArray, "asciiToArray");
    function asciiWords(string) {
      return string.match(reAsciiWord) || [];
    }
    __name(asciiWords, "asciiWords");
    function baseFindKey(collection, predicate, eachFunc) {
      var result;
      eachFunc(collection, function(value4, key, collection2) {
        if (predicate(value4, key, collection2)) {
          result = key;
          return false;
        }
      });
      return result;
    }
    __name(baseFindKey, "baseFindKey");
    function baseFindIndex(array, predicate, fromIndex, fromRight) {
      var length = array.length, index2 = fromIndex + (fromRight ? 1 : -1);
      while (fromRight ? index2-- : ++index2 < length) {
        if (predicate(array[index2], index2, array)) {
          return index2;
        }
      }
      return -1;
    }
    __name(baseFindIndex, "baseFindIndex");
    function baseIndexOf(array, value4, fromIndex) {
      return value4 === value4 ? strictIndexOf(array, value4, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
    }
    __name(baseIndexOf, "baseIndexOf");
    function baseIndexOfWith(array, value4, fromIndex, comparator2) {
      var index2 = fromIndex - 1, length = array.length;
      while (++index2 < length) {
        if (comparator2(array[index2], value4)) {
          return index2;
        }
      }
      return -1;
    }
    __name(baseIndexOfWith, "baseIndexOfWith");
    function baseIsNaN(value4) {
      return value4 !== value4;
    }
    __name(baseIsNaN, "baseIsNaN");
    function baseMean(array, iteratee) {
      var length = array == null ? 0 : array.length;
      return length ? baseSum(array, iteratee) / length : NAN;
    }
    __name(baseMean, "baseMean");
    function baseProperty(key) {
      return function(object) {
        return object == null ? undefined$1 : object[key];
      };
    }
    __name(baseProperty, "baseProperty");
    function basePropertyOf(object) {
      return function(key) {
        return object == null ? undefined$1 : object[key];
      };
    }
    __name(basePropertyOf, "basePropertyOf");
    function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
      eachFunc(collection, function(value4, index2, collection2) {
        accumulator = initAccum ? (initAccum = false, value4) : iteratee(accumulator, value4, index2, collection2);
      });
      return accumulator;
    }
    __name(baseReduce, "baseReduce");
    function baseSortBy(array, comparer) {
      var length = array.length;
      array.sort(comparer);
      while (length--) {
        array[length] = array[length].value;
      }
      return array;
    }
    __name(baseSortBy, "baseSortBy");
    function baseSum(array, iteratee) {
      var result, index2 = -1, length = array.length;
      while (++index2 < length) {
        var current = iteratee(array[index2]);
        if (current !== undefined$1) {
          result = result === undefined$1 ? current : result + current;
        }
      }
      return result;
    }
    __name(baseSum, "baseSum");
    function baseTimes(n, iteratee) {
      var index2 = -1, result = Array(n);
      while (++index2 < n) {
        result[index2] = iteratee(index2);
      }
      return result;
    }
    __name(baseTimes, "baseTimes");
    function baseToPairs(object, props) {
      return arrayMap(props, function(key) {
        return [key, object[key]];
      });
    }
    __name(baseToPairs, "baseToPairs");
    function baseTrim(string) {
      return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
    }
    __name(baseTrim, "baseTrim");
    function baseUnary(func) {
      return function(value4) {
        return func(value4);
      };
    }
    __name(baseUnary, "baseUnary");
    function baseValues(object, props) {
      return arrayMap(props, function(key) {
        return object[key];
      });
    }
    __name(baseValues, "baseValues");
    function cacheHas(cache2, key) {
      return cache2.has(key);
    }
    __name(cacheHas, "cacheHas");
    function charsStartIndex(strSymbols, chrSymbols) {
      var index2 = -1, length = strSymbols.length;
      while (++index2 < length && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
      }
      return index2;
    }
    __name(charsStartIndex, "charsStartIndex");
    function charsEndIndex(strSymbols, chrSymbols) {
      var index2 = strSymbols.length;
      while (index2-- && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
      }
      return index2;
    }
    __name(charsEndIndex, "charsEndIndex");
    function countHolders(array, placeholder) {
      var length = array.length, result = 0;
      while (length--) {
        if (array[length] === placeholder) {
          ++result;
        }
      }
      return result;
    }
    __name(countHolders, "countHolders");
    var deburrLetter = basePropertyOf(deburredLetters);
    var escapeHtmlChar = basePropertyOf(htmlEscapes);
    function escapeStringChar(chr) {
      return "\\" + stringEscapes[chr];
    }
    __name(escapeStringChar, "escapeStringChar");
    function getValue2(object, key) {
      return object == null ? undefined$1 : object[key];
    }
    __name(getValue2, "getValue");
    function hasUnicode(string) {
      return reHasUnicode.test(string);
    }
    __name(hasUnicode, "hasUnicode");
    function hasUnicodeWord(string) {
      return reHasUnicodeWord.test(string);
    }
    __name(hasUnicodeWord, "hasUnicodeWord");
    function iteratorToArray(iterator) {
      var data24, result = [];
      while (!(data24 = iterator.next()).done) {
        result.push(data24.value);
      }
      return result;
    }
    __name(iteratorToArray, "iteratorToArray");
    function mapToArray(map3) {
      var index2 = -1, result = Array(map3.size);
      map3.forEach(function(value4, key) {
        result[++index2] = [key, value4];
      });
      return result;
    }
    __name(mapToArray, "mapToArray");
    function overArg(func, transform2) {
      return function(arg) {
        return func(transform2(arg));
      };
    }
    __name(overArg, "overArg");
    function replaceHolders(array, placeholder) {
      var index2 = -1, length = array.length, resIndex = 0, result = [];
      while (++index2 < length) {
        var value4 = array[index2];
        if (value4 === placeholder || value4 === PLACEHOLDER) {
          array[index2] = PLACEHOLDER;
          result[resIndex++] = index2;
        }
      }
      return result;
    }
    __name(replaceHolders, "replaceHolders");
    function setToArray(set3) {
      var index2 = -1, result = Array(set3.size);
      set3.forEach(function(value4) {
        result[++index2] = value4;
      });
      return result;
    }
    __name(setToArray, "setToArray");
    function setToPairs(set3) {
      var index2 = -1, result = Array(set3.size);
      set3.forEach(function(value4) {
        result[++index2] = [value4, value4];
      });
      return result;
    }
    __name(setToPairs, "setToPairs");
    function strictIndexOf(array, value4, fromIndex) {
      var index2 = fromIndex - 1, length = array.length;
      while (++index2 < length) {
        if (array[index2] === value4) {
          return index2;
        }
      }
      return -1;
    }
    __name(strictIndexOf, "strictIndexOf");
    function strictLastIndexOf(array, value4, fromIndex) {
      var index2 = fromIndex + 1;
      while (index2--) {
        if (array[index2] === value4) {
          return index2;
        }
      }
      return index2;
    }
    __name(strictLastIndexOf, "strictLastIndexOf");
    function stringSize(string) {
      return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
    }
    __name(stringSize, "stringSize");
    function stringToArray2(string) {
      return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
    }
    __name(stringToArray2, "stringToArray");
    function trimmedEndIndex(string) {
      var index2 = string.length;
      while (index2-- && reWhitespace.test(string.charAt(index2))) {
      }
      return index2;
    }
    __name(trimmedEndIndex, "trimmedEndIndex");
    var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
    function unicodeSize(string) {
      var result = reUnicode.lastIndex = 0;
      while (reUnicode.test(string)) {
        ++result;
      }
      return result;
    }
    __name(unicodeSize, "unicodeSize");
    function unicodeToArray(string) {
      return string.match(reUnicode) || [];
    }
    __name(unicodeToArray, "unicodeToArray");
    function unicodeWords(string) {
      return string.match(reUnicodeWord) || [];
    }
    __name(unicodeWords, "unicodeWords");
    var runInContext = /* @__PURE__ */ __name(function runInContext2(context) {
      context = context == null ? root24 : _2.defaults(root24.Object(), context, _2.pick(root24, contextProps));
      var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
      var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
      var coreJsData = context["__core-js_shared__"];
      var funcToString = funcProto.toString;
      var hasOwnProperty2 = objectProto.hasOwnProperty;
      var idCounter = 0;
      var maskSrcKey = function() {
        var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
        return uid2 ? "Symbol(src)_1." + uid2 : "";
      }();
      var nativeObjectToString = objectProto.toString;
      var objectCtorString = funcToString.call(Object2);
      var oldDash = root24._;
      var reIsNative = RegExp2(
        "^" + funcToString.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
      );
      var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
      var defineProperty = function() {
        try {
          var func = getNative(Object2, "defineProperty");
          func({}, "", {});
          return func;
        } catch (e2) {
        }
      }();
      var ctxClearTimeout = context.clearTimeout !== root24.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root24.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root24.setTimeout && context.setTimeout;
      var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
      var DataView2 = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
      var metaMap = WeakMap2 && new WeakMap2();
      var realNames = {};
      var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
      var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
      function lodash2(value4) {
        if (isObjectLike2(value4) && !isArray2(value4) && !(value4 instanceof LazyWrapper)) {
          if (value4 instanceof LodashWrapper) {
            return value4;
          }
          if (hasOwnProperty2.call(value4, "__wrapped__")) {
            return wrapperClone(value4);
          }
        }
        return new LodashWrapper(value4);
      }
      __name(lodash2, "lodash");
      var baseCreate = /* @__PURE__ */ function() {
        function object() {
        }
        __name(object, "object");
        return function(proto) {
          if (!isObject2(proto)) {
            return {};
          }
          if (objectCreate) {
            return objectCreate(proto);
          }
          object.prototype = proto;
          var result2 = new object();
          object.prototype = undefined$1;
          return result2;
        };
      }();
      function baseLodash() {
      }
      __name(baseLodash, "baseLodash");
      function LodashWrapper(value4, chainAll) {
        this.__wrapped__ = value4;
        this.__actions__ = [];
        this.__chain__ = !!chainAll;
        this.__index__ = 0;
        this.__values__ = undefined$1;
      }
      __name(LodashWrapper, "LodashWrapper");
      lodash2.templateSettings = {
        /**
         * Used to detect `data` property values to be HTML-escaped.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        "escape": reEscape,
        /**
         * Used to detect code to be evaluated.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        "evaluate": reEvaluate,
        /**
         * Used to detect `data` property values to inject.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        "interpolate": reInterpolate,
        /**
         * Used to reference the data object in the template text.
         *
         * @memberOf _.templateSettings
         * @type {string}
         */
        "variable": "",
        /**
         * Used to import variables into the compiled template.
         *
         * @memberOf _.templateSettings
         * @type {Object}
         */
        "imports": {
          /**
           * A reference to the `lodash` function.
           *
           * @memberOf _.templateSettings.imports
           * @type {Function}
           */
          "_": lodash2
        }
      };
      lodash2.prototype = baseLodash.prototype;
      lodash2.prototype.constructor = lodash2;
      LodashWrapper.prototype = baseCreate(baseLodash.prototype);
      LodashWrapper.prototype.constructor = LodashWrapper;
      function LazyWrapper(value4) {
        this.__wrapped__ = value4;
        this.__actions__ = [];
        this.__dir__ = 1;
        this.__filtered__ = false;
        this.__iteratees__ = [];
        this.__takeCount__ = MAX_ARRAY_LENGTH;
        this.__views__ = [];
      }
      __name(LazyWrapper, "LazyWrapper");
      function lazyClone() {
        var result2 = new LazyWrapper(this.__wrapped__);
        result2.__actions__ = copyArray(this.__actions__);
        result2.__dir__ = this.__dir__;
        result2.__filtered__ = this.__filtered__;
        result2.__iteratees__ = copyArray(this.__iteratees__);
        result2.__takeCount__ = this.__takeCount__;
        result2.__views__ = copyArray(this.__views__);
        return result2;
      }
      __name(lazyClone, "lazyClone");
      function lazyReverse() {
        if (this.__filtered__) {
          var result2 = new LazyWrapper(this);
          result2.__dir__ = -1;
          result2.__filtered__ = true;
        } else {
          result2 = this.clone();
          result2.__dir__ *= -1;
        }
        return result2;
      }
      __name(lazyReverse, "lazyReverse");
      function lazyValue() {
        var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray2(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start2 = view.start, end = view.end, length = end - start2, index2 = isRight ? end : start2 - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
        if (!isArr || !isRight && arrLength == length && takeCount == length) {
          return baseWrapperValue(array, this.__actions__);
        }
        var result2 = [];
        outer:
          while (length-- && resIndex < takeCount) {
            index2 += dir;
            var iterIndex = -1, value4 = array[index2];
            while (++iterIndex < iterLength) {
              var data24 = iteratees[iterIndex], iteratee2 = data24.iteratee, type = data24.type, computed2 = iteratee2(value4);
              if (type == LAZY_MAP_FLAG) {
                value4 = computed2;
              } else if (!computed2) {
                if (type == LAZY_FILTER_FLAG) {
                  continue outer;
                } else {
                  break outer;
                }
              }
            }
            result2[resIndex++] = value4;
          }
        return result2;
      }
      __name(lazyValue, "lazyValue");
      LazyWrapper.prototype = baseCreate(baseLodash.prototype);
      LazyWrapper.prototype.constructor = LazyWrapper;
      function Hash(entries) {
        var index2 = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index2 < length) {
          var entry = entries[index2];
          this.set(entry[0], entry[1]);
        }
      }
      __name(Hash, "Hash");
      function hashClear() {
        this.__data__ = nativeCreate ? nativeCreate(null) : {};
        this.size = 0;
      }
      __name(hashClear, "hashClear");
      function hashDelete(key) {
        var result2 = this.has(key) && delete this.__data__[key];
        this.size -= result2 ? 1 : 0;
        return result2;
      }
      __name(hashDelete, "hashDelete");
      function hashGet(key) {
        var data24 = this.__data__;
        if (nativeCreate) {
          var result2 = data24[key];
          return result2 === HASH_UNDEFINED ? undefined$1 : result2;
        }
        return hasOwnProperty2.call(data24, key) ? data24[key] : undefined$1;
      }
      __name(hashGet, "hashGet");
      function hashHas(key) {
        var data24 = this.__data__;
        return nativeCreate ? data24[key] !== undefined$1 : hasOwnProperty2.call(data24, key);
      }
      __name(hashHas, "hashHas");
      function hashSet(key, value4) {
        var data24 = this.__data__;
        this.size += this.has(key) ? 0 : 1;
        data24[key] = nativeCreate && value4 === undefined$1 ? HASH_UNDEFINED : value4;
        return this;
      }
      __name(hashSet, "hashSet");
      Hash.prototype.clear = hashClear;
      Hash.prototype["delete"] = hashDelete;
      Hash.prototype.get = hashGet;
      Hash.prototype.has = hashHas;
      Hash.prototype.set = hashSet;
      function ListCache(entries) {
        var index2 = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index2 < length) {
          var entry = entries[index2];
          this.set(entry[0], entry[1]);
        }
      }
      __name(ListCache, "ListCache");
      function listCacheClear() {
        this.__data__ = [];
        this.size = 0;
      }
      __name(listCacheClear, "listCacheClear");
      function listCacheDelete(key) {
        var data24 = this.__data__, index2 = assocIndexOf(data24, key);
        if (index2 < 0) {
          return false;
        }
        var lastIndex2 = data24.length - 1;
        if (index2 == lastIndex2) {
          data24.pop();
        } else {
          splice.call(data24, index2, 1);
        }
        --this.size;
        return true;
      }
      __name(listCacheDelete, "listCacheDelete");
      function listCacheGet(key) {
        var data24 = this.__data__, index2 = assocIndexOf(data24, key);
        return index2 < 0 ? undefined$1 : data24[index2][1];
      }
      __name(listCacheGet, "listCacheGet");
      function listCacheHas(key) {
        return assocIndexOf(this.__data__, key) > -1;
      }
      __name(listCacheHas, "listCacheHas");
      function listCacheSet(key, value4) {
        var data24 = this.__data__, index2 = assocIndexOf(data24, key);
        if (index2 < 0) {
          ++this.size;
          data24.push([key, value4]);
        } else {
          data24[index2][1] = value4;
        }
        return this;
      }
      __name(listCacheSet, "listCacheSet");
      ListCache.prototype.clear = listCacheClear;
      ListCache.prototype["delete"] = listCacheDelete;
      ListCache.prototype.get = listCacheGet;
      ListCache.prototype.has = listCacheHas;
      ListCache.prototype.set = listCacheSet;
      function MapCache(entries) {
        var index2 = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index2 < length) {
          var entry = entries[index2];
          this.set(entry[0], entry[1]);
        }
      }
      __name(MapCache, "MapCache");
      function mapCacheClear() {
        this.size = 0;
        this.__data__ = {
          "hash": new Hash(),
          "map": new (Map2 || ListCache)(),
          "string": new Hash()
        };
      }
      __name(mapCacheClear, "mapCacheClear");
      function mapCacheDelete(key) {
        var result2 = getMapData(this, key)["delete"](key);
        this.size -= result2 ? 1 : 0;
        return result2;
      }
      __name(mapCacheDelete, "mapCacheDelete");
      function mapCacheGet(key) {
        return getMapData(this, key).get(key);
      }
      __name(mapCacheGet, "mapCacheGet");
      function mapCacheHas(key) {
        return getMapData(this, key).has(key);
      }
      __name(mapCacheHas, "mapCacheHas");
      function mapCacheSet(key, value4) {
        var data24 = getMapData(this, key), size3 = data24.size;
        data24.set(key, value4);
        this.size += data24.size == size3 ? 0 : 1;
        return this;
      }
      __name(mapCacheSet, "mapCacheSet");
      MapCache.prototype.clear = mapCacheClear;
      MapCache.prototype["delete"] = mapCacheDelete;
      MapCache.prototype.get = mapCacheGet;
      MapCache.prototype.has = mapCacheHas;
      MapCache.prototype.set = mapCacheSet;
      function SetCache(values2) {
        var index2 = -1, length = values2 == null ? 0 : values2.length;
        this.__data__ = new MapCache();
        while (++index2 < length) {
          this.add(values2[index2]);
        }
      }
      __name(SetCache, "SetCache");
      function setCacheAdd(value4) {
        this.__data__.set(value4, HASH_UNDEFINED);
        return this;
      }
      __name(setCacheAdd, "setCacheAdd");
      function setCacheHas(value4) {
        return this.__data__.has(value4);
      }
      __name(setCacheHas, "setCacheHas");
      SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
      SetCache.prototype.has = setCacheHas;
      function Stack(entries) {
        var data24 = this.__data__ = new ListCache(entries);
        this.size = data24.size;
      }
      __name(Stack, "Stack");
      function stackClear() {
        this.__data__ = new ListCache();
        this.size = 0;
      }
      __name(stackClear, "stackClear");
      function stackDelete(key) {
        var data24 = this.__data__, result2 = data24["delete"](key);
        this.size = data24.size;
        return result2;
      }
      __name(stackDelete, "stackDelete");
      function stackGet(key) {
        return this.__data__.get(key);
      }
      __name(stackGet, "stackGet");
      function stackHas(key) {
        return this.__data__.has(key);
      }
      __name(stackHas, "stackHas");
      function stackSet(key, value4) {
        var data24 = this.__data__;
        if (data24 instanceof ListCache) {
          var pairs = data24.__data__;
          if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
            pairs.push([key, value4]);
            this.size = ++data24.size;
            return this;
          }
          data24 = this.__data__ = new MapCache(pairs);
        }
        data24.set(key, value4);
        this.size = data24.size;
        return this;
      }
      __name(stackSet, "stackSet");
      Stack.prototype.clear = stackClear;
      Stack.prototype["delete"] = stackDelete;
      Stack.prototype.get = stackGet;
      Stack.prototype.has = stackHas;
      Stack.prototype.set = stackSet;
      function arrayLikeKeys(value4, inherited) {
        var isArr = isArray2(value4), isArg = !isArr && isArguments(value4), isBuff = !isArr && !isArg && isBuffer2(value4), isType = !isArr && !isArg && !isBuff && isTypedArray2(value4), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value4.length, String2) : [], length = result2.length;
        for (var key in value4) {
          if ((inherited || hasOwnProperty2.call(value4, 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)))) {
            result2.push(key);
          }
        }
        return result2;
      }
      __name(arrayLikeKeys, "arrayLikeKeys");
      function arraySample(array) {
        var length = array.length;
        return length ? array[baseRandom(0, length - 1)] : undefined$1;
      }
      __name(arraySample, "arraySample");
      function arraySampleSize(array, n) {
        return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
      }
      __name(arraySampleSize, "arraySampleSize");
      function arrayShuffle(array) {
        return shuffleSelf(copyArray(array));
      }
      __name(arrayShuffle, "arrayShuffle");
      function assignMergeValue(object, key, value4) {
        if (value4 !== undefined$1 && !eq(object[key], value4) || value4 === undefined$1 && !(key in object)) {
          baseAssignValue(object, key, value4);
        }
      }
      __name(assignMergeValue, "assignMergeValue");
      function assignValue(object, key, value4) {
        var objValue = object[key];
        if (!(hasOwnProperty2.call(object, key) && eq(objValue, value4)) || value4 === undefined$1 && !(key in object)) {
          baseAssignValue(object, key, value4);
        }
      }
      __name(assignValue, "assignValue");
      function assocIndexOf(array, key) {
        var length = array.length;
        while (length--) {
          if (eq(array[length][0], key)) {
            return length;
          }
        }
        return -1;
      }
      __name(assocIndexOf, "assocIndexOf");
      function baseAggregator(collection, setter, iteratee2, accumulator) {
        baseEach(collection, function(value4, key, collection2) {
          setter(accumulator, value4, iteratee2(value4), collection2);
        });
        return accumulator;
      }
      __name(baseAggregator, "baseAggregator");
      function baseAssign(object, source) {
        return object && copyObject(source, keys2(source), object);
      }
      __name(baseAssign, "baseAssign");
      function baseAssignIn(object, source) {
        return object && copyObject(source, keysIn(source), object);
      }
      __name(baseAssignIn, "baseAssignIn");
      function baseAssignValue(object, key, value4) {
        if (key == "__proto__" && defineProperty) {
          defineProperty(object, key, {
            "configurable": true,
            "enumerable": true,
            "value": value4,
            "writable": true
          });
        } else {
          object[key] = value4;
        }
      }
      __name(baseAssignValue, "baseAssignValue");
      function baseAt(object, paths) {
        var index2 = -1, length = paths.length, result2 = Array2(length), skip = object == null;
        while (++index2 < length) {
          result2[index2] = skip ? undefined$1 : get3(object, paths[index2]);
        }
        return result2;
      }
      __name(baseAt, "baseAt");
      function baseClamp(number2, lower, upper) {
        if (number2 === number2) {
          if (upper !== undefined$1) {
            number2 = number2 <= upper ? number2 : upper;
          }
          if (lower !== undefined$1) {
            number2 = number2 >= lower ? number2 : lower;
          }
        }
        return number2;
      }
      __name(baseClamp, "baseClamp");
      function baseClone(value4, bitmask, customizer, key, object, stack2) {
        var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
        if (customizer) {
          result2 = object ? customizer(value4, key, object, stack2) : customizer(value4);
        }
        if (result2 !== undefined$1) {
          return result2;
        }
        if (!isObject2(value4)) {
          return value4;
        }
        var isArr = isArray2(value4);
        if (isArr) {
          result2 = initCloneArray(value4);
          if (!isDeep) {
            return copyArray(value4, result2);
          }
        } else {
          var tag = getTag2(value4), isFunc = tag == funcTag || tag == genTag;
          if (isBuffer2(value4)) {
            return cloneBuffer(value4, isDeep);
          }
          if (tag == objectTag || tag == argsTag || isFunc && !object) {
            result2 = isFlat || isFunc ? {} : initCloneObject(value4);
            if (!isDeep) {
              return isFlat ? copySymbolsIn(value4, baseAssignIn(result2, value4)) : copySymbols(value4, baseAssign(result2, value4));
            }
          } else {
            if (!cloneableTags[tag]) {
              return object ? value4 : {};
            }
            result2 = initCloneByTag(value4, tag, isDeep);
          }
        }
        stack2 || (stack2 = new Stack());
        var stacked = stack2.get(value4);
        if (stacked) {
          return stacked;
        }
        stack2.set(value4, result2);
        if (isSet2(value4)) {
          value4.forEach(function(subValue) {
            result2.add(baseClone(subValue, bitmask, customizer, subValue, value4, stack2));
          });
        } else if (isMap2(value4)) {
          value4.forEach(function(subValue, key2) {
            result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value4, stack2));
          });
        }
        var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys2;
        var props = isArr ? undefined$1 : keysFunc(value4);
        arrayEach(props || value4, function(subValue, key2) {
          if (props) {
            key2 = subValue;
            subValue = value4[key2];
          }
          assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value4, stack2));
        });
        return result2;
      }
      __name(baseClone, "baseClone");
      function baseConforms(source) {
        var props = keys2(source);
        return function(object) {
          return baseConformsTo(object, source, props);
        };
      }
      __name(baseConforms, "baseConforms");
      function baseConformsTo(object, source, props) {
        var length = props.length;
        if (object == null) {
          return !length;
        }
        object = Object2(object);
        while (length--) {
          var key = props[length], predicate = source[key], value4 = object[key];
          if (value4 === undefined$1 && !(key in object) || !predicate(value4)) {
            return false;
          }
        }
        return true;
      }
      __name(baseConformsTo, "baseConformsTo");
      function baseDelay(func, wait, args) {
        if (typeof func != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        return setTimeout2(function() {
          func.apply(undefined$1, args);
        }, wait);
      }
      __name(baseDelay, "baseDelay");
      function baseDifference(array, values2, iteratee2, comparator2) {
        var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length;
        if (!length) {
          return result2;
        }
        if (iteratee2) {
          values2 = arrayMap(values2, baseUnary(iteratee2));
        }
        if (comparator2) {
          includes2 = arrayIncludesWith;
          isCommon = false;
        } else if (values2.length >= LARGE_ARRAY_SIZE) {
          includes2 = cacheHas;
          isCommon = false;
          values2 = new SetCache(values2);
        }
        outer:
          while (++index2 < length) {
            var value4 = array[index2], computed2 = iteratee2 == null ? value4 : iteratee2(value4);
            value4 = comparator2 || value4 !== 0 ? value4 : 0;
            if (isCommon && computed2 === computed2) {
              var valuesIndex = valuesLength;
              while (valuesIndex--) {
                if (values2[valuesIndex] === computed2) {
                  continue outer;
                }
              }
              result2.push(value4);
            } else if (!includes2(values2, computed2, comparator2)) {
              result2.push(value4);
            }
          }
        return result2;
      }
      __name(baseDifference, "baseDifference");
      var baseEach = createBaseEach(baseForOwn);
      var baseEachRight = createBaseEach(baseForOwnRight, true);
      function baseEvery(collection, predicate) {
        var result2 = true;
        baseEach(collection, function(value4, index2, collection2) {
          result2 = !!predicate(value4, index2, collection2);
          return result2;
        });
        return result2;
      }
      __name(baseEvery, "baseEvery");
      function baseExtremum(array, iteratee2, comparator2) {
        var index2 = -1, length = array.length;
        while (++index2 < length) {
          var value4 = array[index2], current = iteratee2(value4);
          if (current != null && (computed2 === undefined$1 ? current === current && !isSymbol2(current) : comparator2(current, computed2))) {
            var computed2 = current, result2 = value4;
          }
        }
        return result2;
      }
      __name(baseExtremum, "baseExtremum");
      function baseFill(array, value4, start2, end) {
        var length = array.length;
        start2 = toInteger(start2);
        if (start2 < 0) {
          start2 = -start2 > length ? 0 : length + start2;
        }
        end = end === undefined$1 || end > length ? length : toInteger(end);
        if (end < 0) {
          end += length;
        }
        end = start2 > end ? 0 : toLength(end);
        while (start2 < end) {
          array[start2++] = value4;
        }
        return array;
      }
      __name(baseFill, "baseFill");
      function baseFilter(collection, predicate) {
        var result2 = [];
        baseEach(collection, function(value4, index2, collection2) {
          if (predicate(value4, index2, collection2)) {
            result2.push(value4);
          }
        });
        return result2;
      }
      __name(baseFilter, "baseFilter");
      function baseFlatten(array, depth, predicate, isStrict, result2) {
        var index2 = -1, length = array.length;
        predicate || (predicate = isFlattenable);
        result2 || (result2 = []);
        while (++index2 < length) {
          var value4 = array[index2];
          if (depth > 0 && predicate(value4)) {
            if (depth > 1) {
              baseFlatten(value4, depth - 1, predicate, isStrict, result2);
            } else {
              arrayPush(result2, value4);
            }
          } else if (!isStrict) {
            result2[result2.length] = value4;
          }
        }
        return result2;
      }
      __name(baseFlatten, "baseFlatten");
      var baseFor = createBaseFor();
      var baseForRight = createBaseFor(true);
      function baseForOwn(object, iteratee2) {
        return object && baseFor(object, iteratee2, keys2);
      }
      __name(baseForOwn, "baseForOwn");
      function baseForOwnRight(object, iteratee2) {
        return object && baseForRight(object, iteratee2, keys2);
      }
      __name(baseForOwnRight, "baseForOwnRight");
      function baseFunctions(object, props) {
        return arrayFilter(props, function(key) {
          return isFunction2(object[key]);
        });
      }
      __name(baseFunctions, "baseFunctions");
      function baseGet(object, path) {
        path = castPath(path, object);
        var index2 = 0, length = path.length;
        while (object != null && index2 < length) {
          object = object[toKey(path[index2++])];
        }
        return index2 && index2 == length ? object : undefined$1;
      }
      __name(baseGet, "baseGet");
      function baseGetAllKeys(object, keysFunc, symbolsFunc) {
        var result2 = keysFunc(object);
        return isArray2(object) ? result2 : arrayPush(result2, symbolsFunc(object));
      }
      __name(baseGetAllKeys, "baseGetAllKeys");
      function baseGetTag(value4) {
        if (value4 == null) {
          return value4 === undefined$1 ? undefinedTag : nullTag;
        }
        return symToStringTag && symToStringTag in Object2(value4) ? getRawTag(value4) : objectToString2(value4);
      }
      __name(baseGetTag, "baseGetTag");
      function baseGt(value4, other) {
        return value4 > other;
      }
      __name(baseGt, "baseGt");
      function baseHas(object, key) {
        return object != null && hasOwnProperty2.call(object, key);
      }
      __name(baseHas, "baseHas");
      function baseHasIn(object, key) {
        return object != null && key in Object2(object);
      }
      __name(baseHasIn, "baseHasIn");
      function baseInRange(number2, start2, end) {
        return number2 >= nativeMin(start2, end) && number2 < nativeMax(start2, end);
      }
      __name(baseInRange, "baseInRange");
      function baseIntersection(arrays, iteratee2, comparator2) {
        var includes2 = comparator2 ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
        while (othIndex--) {
          var array = arrays[othIndex];
          if (othIndex && iteratee2) {
            array = arrayMap(array, baseUnary(iteratee2));
          }
          maxLength = nativeMin(array.length, maxLength);
          caches[othIndex] = !comparator2 && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined$1;
        }
        array = arrays[0];
        var index2 = -1, seen2 = caches[0];
        outer:
          while (++index2 < length && result2.length < maxLength) {
            var value4 = array[index2], computed2 = iteratee2 ? iteratee2(value4) : value4;
            value4 = comparator2 || value4 !== 0 ? value4 : 0;
            if (!(seen2 ? cacheHas(seen2, computed2) : includes2(result2, computed2, comparator2))) {
              othIndex = othLength;
              while (--othIndex) {
                var cache2 = caches[othIndex];
                if (!(cache2 ? cacheHas(cache2, computed2) : includes2(arrays[othIndex], computed2, comparator2))) {
                  continue outer;
                }
              }
              if (seen2) {
                seen2.push(computed2);
              }
              result2.push(value4);
            }
          }
        return result2;
      }
      __name(baseIntersection, "baseIntersection");
      function baseInverter(object, setter, iteratee2, accumulator) {
        baseForOwn(object, function(value4, key, object2) {
          setter(accumulator, iteratee2(value4), key, object2);
        });
        return accumulator;
      }
      __name(baseInverter, "baseInverter");
      function baseInvoke(object, path, args) {
        path = castPath(path, object);
        object = parent(object, path);
        var func = object == null ? object : object[toKey(last(path))];
        return func == null ? undefined$1 : apply2(func, object, args);
      }
      __name(baseInvoke, "baseInvoke");
      function baseIsArguments(value4) {
        return isObjectLike2(value4) && baseGetTag(value4) == argsTag;
      }
      __name(baseIsArguments, "baseIsArguments");
      function baseIsArrayBuffer(value4) {
        return isObjectLike2(value4) && baseGetTag(value4) == arrayBufferTag;
      }
      __name(baseIsArrayBuffer, "baseIsArrayBuffer");
      function baseIsDate(value4) {
        return isObjectLike2(value4) && baseGetTag(value4) == dateTag;
      }
      __name(baseIsDate, "baseIsDate");
      function baseIsEqual(value4, other, bitmask, customizer, stack2) {
        if (value4 === other) {
          return true;
        }
        if (value4 == null || other == null || !isObjectLike2(value4) && !isObjectLike2(other)) {
          return value4 !== value4 && other !== other;
        }
        return baseIsEqualDeep(value4, other, bitmask, customizer, baseIsEqual, stack2);
      }
      __name(baseIsEqual, "baseIsEqual");
      function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack2) {
        var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag2(object), othTag = othIsArr ? arrayTag : getTag2(other);
        objTag = objTag == argsTag ? objectTag : objTag;
        othTag = othTag == argsTag ? objectTag : othTag;
        var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
        if (isSameTag && isBuffer2(object)) {
          if (!isBuffer2(other)) {
            return false;
          }
          objIsArr = true;
          objIsObj = false;
        }
        if (isSameTag && !objIsObj) {
          stack2 || (stack2 = new Stack());
          return objIsArr || isTypedArray2(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack2);
        }
        if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
          var objIsWrapped = objIsObj && hasOwnProperty2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.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);
      }
      __name(baseIsEqualDeep, "baseIsEqualDeep");
      function baseIsMap(value4) {
        return isObjectLike2(value4) && getTag2(value4) == mapTag;
      }
      __name(baseIsMap, "baseIsMap");
      function baseIsMatch(object, source, matchData, customizer) {
        var index2 = matchData.length, length = index2, noCustomizer = !customizer;
        if (object == null) {
          return !length;
        }
        object = Object2(object);
        while (index2--) {
          var data24 = matchData[index2];
          if (noCustomizer && data24[2] ? data24[1] !== object[data24[0]] : !(data24[0] in object)) {
            return false;
          }
        }
        while (++index2 < length) {
          data24 = matchData[index2];
          var key = data24[0], objValue = object[key], srcValue = data24[1];
          if (noCustomizer && data24[2]) {
            if (objValue === undefined$1 && !(key in object)) {
              return false;
            }
          } else {
            var stack2 = new Stack();
            if (customizer) {
              var result2 = customizer(objValue, srcValue, key, object, source, stack2);
            }
            if (!(result2 === undefined$1 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack2) : result2)) {
              return false;
            }
          }
        }
        return true;
      }
      __name(baseIsMatch, "baseIsMatch");
      function baseIsNative(value4) {
        if (!isObject2(value4) || isMasked(value4)) {
          return false;
        }
        var pattern = isFunction2(value4) ? reIsNative : reIsHostCtor;
        return pattern.test(toSource(value4));
      }
      __name(baseIsNative, "baseIsNative");
      function baseIsRegExp(value4) {
        return isObjectLike2(value4) && baseGetTag(value4) == regexpTag;
      }
      __name(baseIsRegExp, "baseIsRegExp");
      function baseIsSet(value4) {
        return isObjectLike2(value4) && getTag2(value4) == setTag;
      }
      __name(baseIsSet, "baseIsSet");
      function baseIsTypedArray(value4) {
        return isObjectLike2(value4) && isLength(value4.length) && !!typedArrayTags[baseGetTag(value4)];
      }
      __name(baseIsTypedArray, "baseIsTypedArray");
      function baseIteratee(value4) {
        if (typeof value4 == "function") {
          return value4;
        }
        if (value4 == null) {
          return identity2;
        }
        if (typeof value4 == "object") {
          return isArray2(value4) ? baseMatchesProperty(value4[0], value4[1]) : baseMatches(value4);
        }
        return property(value4);
      }
      __name(baseIteratee, "baseIteratee");
      function baseKeys(object) {
        if (!isPrototype(object)) {
          return nativeKeys(object);
        }
        var result2 = [];
        for (var key in Object2(object)) {
          if (hasOwnProperty2.call(object, key) && key != "constructor") {
            result2.push(key);
          }
        }
        return result2;
      }
      __name(baseKeys, "baseKeys");
      function baseKeysIn(object) {
        if (!isObject2(object)) {
          return nativeKeysIn(object);
        }
        var isProto = isPrototype(object), result2 = [];
        for (var key in object) {
          if (!(key == "constructor" && (isProto || !hasOwnProperty2.call(object, key)))) {
            result2.push(key);
          }
        }
        return result2;
      }
      __name(baseKeysIn, "baseKeysIn");
      function baseLt(value4, other) {
        return value4 < other;
      }
      __name(baseLt, "baseLt");
      function baseMap(collection, iteratee2) {
        var index2 = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : [];
        baseEach(collection, function(value4, key, collection2) {
          result2[++index2] = iteratee2(value4, key, collection2);
        });
        return result2;
      }
      __name(baseMap, "baseMap");
      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);
        };
      }
      __name(baseMatches, "baseMatches");
      function baseMatchesProperty(path, srcValue) {
        if (isKey(path) && isStrictComparable(srcValue)) {
          return matchesStrictComparable(toKey(path), srcValue);
        }
        return function(object) {
          var objValue = get3(object, path);
          return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
        };
      }
      __name(baseMatchesProperty, "baseMatchesProperty");
      function baseMerge(object, source, srcIndex, customizer, stack2) {
        if (object === source) {
          return;
        }
        baseFor(source, function(srcValue, key) {
          stack2 || (stack2 = new Stack());
          if (isObject2(srcValue)) {
            baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack2);
          } else {
            var newValue2 = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack2) : undefined$1;
            if (newValue2 === undefined$1) {
              newValue2 = srcValue;
            }
            assignMergeValue(object, key, newValue2);
          }
        }, keysIn);
      }
      __name(baseMerge, "baseMerge");
      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 newValue2 = customizer ? customizer(objValue, srcValue, key + "", object, source, stack2) : undefined$1;
        var isCommon = newValue2 === undefined$1;
        if (isCommon) {
          var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer2(srcValue), isTyped = !isArr && !isBuff && isTypedArray2(srcValue);
          newValue2 = srcValue;
          if (isArr || isBuff || isTyped) {
            if (isArray2(objValue)) {
              newValue2 = objValue;
            } else if (isArrayLikeObject(objValue)) {
              newValue2 = copyArray(objValue);
            } else if (isBuff) {
              isCommon = false;
              newValue2 = cloneBuffer(srcValue, true);
            } else if (isTyped) {
              isCommon = false;
              newValue2 = cloneTypedArray(srcValue, true);
            } else {
              newValue2 = [];
            }
          } else if (isPlainObject2(srcValue) || isArguments(srcValue)) {
            newValue2 = objValue;
            if (isArguments(objValue)) {
              newValue2 = toPlainObject(objValue);
            } else if (!isObject2(objValue) || isFunction2(objValue)) {
              newValue2 = initCloneObject(srcValue);
            }
          } else {
            isCommon = false;
          }
        }
        if (isCommon) {
          stack2.set(srcValue, newValue2);
          mergeFunc(newValue2, srcValue, srcIndex, customizer, stack2);
          stack2["delete"](srcValue);
        }
        assignMergeValue(object, key, newValue2);
      }
      __name(baseMergeDeep, "baseMergeDeep");
      function baseNth(array, n) {
        var length = array.length;
        if (!length) {
          return;
        }
        n += n < 0 ? length : 0;
        return isIndex(n, length) ? array[n] : undefined$1;
      }
      __name(baseNth, "baseNth");
      function baseOrderBy(collection, iteratees, orders) {
        if (iteratees.length) {
          iteratees = arrayMap(iteratees, function(iteratee2) {
            if (isArray2(iteratee2)) {
              return function(value4) {
                return baseGet(value4, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
              };
            }
            return iteratee2;
          });
        } else {
          iteratees = [identity2];
        }
        var index2 = -1;
        iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
        var result2 = baseMap(collection, function(value4, key, collection2) {
          var criteria = arrayMap(iteratees, function(iteratee2) {
            return iteratee2(value4);
          });
          return { "criteria": criteria, "index": ++index2, "value": value4 };
        });
        return baseSortBy(result2, function(object, other) {
          return compareMultiple(object, other, orders);
        });
      }
      __name(baseOrderBy, "baseOrderBy");
      function basePick(object, paths) {
        return basePickBy(object, paths, function(value4, path) {
          return hasIn(object, path);
        });
      }
      __name(basePick, "basePick");
      function basePickBy(object, paths, predicate) {
        var index2 = -1, length = paths.length, result2 = {};
        while (++index2 < length) {
          var path = paths[index2], value4 = baseGet(object, path);
          if (predicate(value4, path)) {
            baseSet(result2, castPath(path, object), value4);
          }
        }
        return result2;
      }
      __name(basePickBy, "basePickBy");
      function basePropertyDeep(path) {
        return function(object) {
          return baseGet(object, path);
        };
      }
      __name(basePropertyDeep, "basePropertyDeep");
      function basePullAll(array, values2, iteratee2, comparator2) {
        var indexOf2 = comparator2 ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values2.length, seen2 = array;
        if (array === values2) {
          values2 = copyArray(values2);
        }
        if (iteratee2) {
          seen2 = arrayMap(array, baseUnary(iteratee2));
        }
        while (++index2 < length) {
          var fromIndex = 0, value4 = values2[index2], computed2 = iteratee2 ? iteratee2(value4) : value4;
          while ((fromIndex = indexOf2(seen2, computed2, fromIndex, comparator2)) > -1) {
            if (seen2 !== array) {
              splice.call(seen2, fromIndex, 1);
            }
            splice.call(array, fromIndex, 1);
          }
        }
        return array;
      }
      __name(basePullAll, "basePullAll");
      function basePullAt(array, indexes) {
        var length = array ? indexes.length : 0, lastIndex2 = length - 1;
        while (length--) {
          var index2 = indexes[length];
          if (length == lastIndex2 || index2 !== previous) {
            var previous = index2;
            if (isIndex(index2)) {
              splice.call(array, index2, 1);
            } else {
              baseUnset(array, index2);
            }
          }
        }
        return array;
      }
      __name(basePullAt, "basePullAt");
      function baseRandom(lower, upper) {
        return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
      }
      __name(baseRandom, "baseRandom");
      function baseRange(start2, end, step3, fromRight) {
        var index2 = -1, length = nativeMax(nativeCeil((end - start2) / (step3 || 1)), 0), result2 = Array2(length);
        while (length--) {
          result2[fromRight ? length : ++index2] = start2;
          start2 += step3;
        }
        return result2;
      }
      __name(baseRange, "baseRange");
      function baseRepeat(string, n) {
        var result2 = "";
        if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
          return result2;
        }
        do {
          if (n % 2) {
            result2 += string;
          }
          n = nativeFloor(n / 2);
          if (n) {
            string += string;
          }
        } while (n);
        return result2;
      }
      __name(baseRepeat, "baseRepeat");
      function baseRest(func, start2) {
        return setToString(overRest(func, start2, identity2), func + "");
      }
      __name(baseRest, "baseRest");
      function baseSample(collection) {
        return arraySample(values(collection));
      }
      __name(baseSample, "baseSample");
      function baseSampleSize(collection, n) {
        var array = values(collection);
        return shuffleSelf(array, baseClamp(n, 0, array.length));
      }
      __name(baseSampleSize, "baseSampleSize");
      function baseSet(object, path, value4, customizer) {
        if (!isObject2(object)) {
          return object;
        }
        path = castPath(path, object);
        var index2 = -1, length = path.length, lastIndex2 = length - 1, nested = object;
        while (nested != null && ++index2 < length) {
          var key = toKey(path[index2]), newValue2 = value4;
          if (key === "__proto__" || key === "constructor" || key === "prototype") {
            return object;
          }
          if (index2 != lastIndex2) {
            var objValue = nested[key];
            newValue2 = customizer ? customizer(objValue, key, nested) : undefined$1;
            if (newValue2 === undefined$1) {
              newValue2 = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
            }
          }
          assignValue(nested, key, newValue2);
          nested = nested[key];
        }
        return object;
      }
      __name(baseSet, "baseSet");
      var baseSetData = !metaMap ? identity2 : function(func, data24) {
        metaMap.set(func, data24);
        return func;
      };
      var baseSetToString = !defineProperty ? identity2 : function(func, string) {
        return defineProperty(func, "toString", {
          "configurable": true,
          "enumerable": false,
          "value": constant(string),
          "writable": true
        });
      };
      function baseShuffle(collection) {
        return shuffleSelf(values(collection));
      }
      __name(baseShuffle, "baseShuffle");
      function baseSlice(array, start2, end) {
        var index2 = -1, length = array.length;
        if (start2 < 0) {
          start2 = -start2 > length ? 0 : length + start2;
        }
        end = end > length ? length : end;
        if (end < 0) {
          end += length;
        }
        length = start2 > end ? 0 : end - start2 >>> 0;
        start2 >>>= 0;
        var result2 = Array2(length);
        while (++index2 < length) {
          result2[index2] = array[index2 + start2];
        }
        return result2;
      }
      __name(baseSlice, "baseSlice");
      function baseSome(collection, predicate) {
        var result2;
        baseEach(collection, function(value4, index2, collection2) {
          result2 = predicate(value4, index2, collection2);
          return !result2;
        });
        return !!result2;
      }
      __name(baseSome, "baseSome");
      function baseSortedIndex(array, value4, retHighest) {
        var low = 0, high = array == null ? low : array.length;
        if (typeof value4 == "number" && value4 === value4 && high <= HALF_MAX_ARRAY_LENGTH) {
          while (low < high) {
            var mid = low + high >>> 1, computed2 = array[mid];
            if (computed2 !== null && !isSymbol2(computed2) && (retHighest ? computed2 <= value4 : computed2 < value4)) {
              low = mid + 1;
            } else {
              high = mid;
            }
          }
          return high;
        }
        return baseSortedIndexBy(array, value4, identity2, retHighest);
      }
      __name(baseSortedIndex, "baseSortedIndex");
      function baseSortedIndexBy(array, value4, iteratee2, retHighest) {
        var low = 0, high = array == null ? 0 : array.length;
        if (high === 0) {
          return 0;
        }
        value4 = iteratee2(value4);
        var valIsNaN = value4 !== value4, valIsNull = value4 === null, valIsSymbol = isSymbol2(value4), valIsUndefined = value4 === undefined$1;
        while (low < high) {
          var mid = nativeFloor((low + high) / 2), computed2 = iteratee2(array[mid]), othIsDefined = computed2 !== undefined$1, othIsNull = computed2 === null, othIsReflexive = computed2 === computed2, othIsSymbol = isSymbol2(computed2);
          if (valIsNaN) {
            var setLow = retHighest || othIsReflexive;
          } else if (valIsUndefined) {
            setLow = othIsReflexive && (retHighest || othIsDefined);
          } else if (valIsNull) {
            setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
          } else if (valIsSymbol) {
            setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
          } else if (othIsNull || othIsSymbol) {
            setLow = false;
          } else {
            setLow = retHighest ? computed2 <= value4 : computed2 < value4;
          }
          if (setLow) {
            low = mid + 1;
          } else {
            high = mid;
          }
        }
        return nativeMin(high, MAX_ARRAY_INDEX);
      }
      __name(baseSortedIndexBy, "baseSortedIndexBy");
      function baseSortedUniq(array, iteratee2) {
        var index2 = -1, length = array.length, resIndex = 0, result2 = [];
        while (++index2 < length) {
          var value4 = array[index2], computed2 = iteratee2 ? iteratee2(value4) : value4;
          if (!index2 || !eq(computed2, seen2)) {
            var seen2 = computed2;
            result2[resIndex++] = value4 === 0 ? 0 : value4;
          }
        }
        return result2;
      }
      __name(baseSortedUniq, "baseSortedUniq");
      function baseToNumber(value4) {
        if (typeof value4 == "number") {
          return value4;
        }
        if (isSymbol2(value4)) {
          return NAN;
        }
        return +value4;
      }
      __name(baseToNumber, "baseToNumber");
      function baseToString2(value4) {
        if (typeof value4 == "string") {
          return value4;
        }
        if (isArray2(value4)) {
          return arrayMap(value4, baseToString2) + "";
        }
        if (isSymbol2(value4)) {
          return symbolToString ? symbolToString.call(value4) : "";
        }
        var result2 = value4 + "";
        return result2 == "0" && 1 / value4 == -INFINITY2 ? "-0" : result2;
      }
      __name(baseToString2, "baseToString");
      function baseUniq(array, iteratee2, comparator2) {
        var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen2 = result2;
        if (comparator2) {
          isCommon = false;
          includes2 = arrayIncludesWith;
        } else if (length >= LARGE_ARRAY_SIZE) {
          var set4 = iteratee2 ? null : createSet(array);
          if (set4) {
            return setToArray(set4);
          }
          isCommon = false;
          includes2 = cacheHas;
          seen2 = new SetCache();
        } else {
          seen2 = iteratee2 ? [] : result2;
        }
        outer:
          while (++index2 < length) {
            var value4 = array[index2], computed2 = iteratee2 ? iteratee2(value4) : value4;
            value4 = comparator2 || value4 !== 0 ? value4 : 0;
            if (isCommon && computed2 === computed2) {
              var seenIndex = seen2.length;
              while (seenIndex--) {
                if (seen2[seenIndex] === computed2) {
                  continue outer;
                }
              }
              if (iteratee2) {
                seen2.push(computed2);
              }
              result2.push(value4);
            } else if (!includes2(seen2, computed2, comparator2)) {
              if (seen2 !== result2) {
                seen2.push(computed2);
              }
              result2.push(value4);
            }
          }
        return result2;
      }
      __name(baseUniq, "baseUniq");
      function baseUnset(object, path) {
        path = castPath(path, object);
        object = parent(object, path);
        return object == null || delete object[toKey(last(path))];
      }
      __name(baseUnset, "baseUnset");
      function baseUpdate(object, path, updater, customizer) {
        return baseSet(object, path, updater(baseGet(object, path)), customizer);
      }
      __name(baseUpdate, "baseUpdate");
      function baseWhile(array, predicate, isDrop, fromRight) {
        var length = array.length, index2 = fromRight ? length : -1;
        while ((fromRight ? index2-- : ++index2 < length) && predicate(array[index2], index2, array)) {
        }
        return isDrop ? baseSlice(array, fromRight ? 0 : index2, fromRight ? index2 + 1 : length) : baseSlice(array, fromRight ? index2 + 1 : 0, fromRight ? length : index2);
      }
      __name(baseWhile, "baseWhile");
      function baseWrapperValue(value4, actions) {
        var result2 = value4;
        if (result2 instanceof LazyWrapper) {
          result2 = result2.value();
        }
        return arrayReduce(actions, function(result3, action) {
          return action.func.apply(action.thisArg, arrayPush([result3], action.args));
        }, result2);
      }
      __name(baseWrapperValue, "baseWrapperValue");
      function baseXor(arrays, iteratee2, comparator2) {
        var length = arrays.length;
        if (length < 2) {
          return length ? baseUniq(arrays[0]) : [];
        }
        var index2 = -1, result2 = Array2(length);
        while (++index2 < length) {
          var array = arrays[index2], othIndex = -1;
          while (++othIndex < length) {
            if (othIndex != index2) {
              result2[index2] = baseDifference(result2[index2] || array, arrays[othIndex], iteratee2, comparator2);
            }
          }
        }
        return baseUniq(baseFlatten(result2, 1), iteratee2, comparator2);
      }
      __name(baseXor, "baseXor");
      function baseZipObject(props, values2, assignFunc) {
        var index2 = -1, length = props.length, valsLength = values2.length, result2 = {};
        while (++index2 < length) {
          var value4 = index2 < valsLength ? values2[index2] : undefined$1;
          assignFunc(result2, props[index2], value4);
        }
        return result2;
      }
      __name(baseZipObject, "baseZipObject");
      function castArrayLikeObject(value4) {
        return isArrayLikeObject(value4) ? value4 : [];
      }
      __name(castArrayLikeObject, "castArrayLikeObject");
      function castFunction(value4) {
        return typeof value4 == "function" ? value4 : identity2;
      }
      __name(castFunction, "castFunction");
      function castPath(value4, object) {
        if (isArray2(value4)) {
          return value4;
        }
        return isKey(value4, object) ? [value4] : stringToPath(toString3(value4));
      }
      __name(castPath, "castPath");
      var castRest = baseRest;
      function castSlice(array, start2, end) {
        var length = array.length;
        end = end === undefined$1 ? length : end;
        return !start2 && end >= length ? array : baseSlice(array, start2, end);
      }
      __name(castSlice, "castSlice");
      var clearTimeout2 = ctxClearTimeout || function(id3) {
        return root24.clearTimeout(id3);
      };
      function cloneBuffer(buffer2, isDeep) {
        if (isDeep) {
          return buffer2.slice();
        }
        var length = buffer2.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer2.constructor(length);
        buffer2.copy(result2);
        return result2;
      }
      __name(cloneBuffer, "cloneBuffer");
      function cloneArrayBuffer(arrayBuffer) {
        var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
        new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
        return result2;
      }
      __name(cloneArrayBuffer, "cloneArrayBuffer");
      function cloneDataView(dataView, isDeep) {
        var buffer2 = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
        return new dataView.constructor(buffer2, dataView.byteOffset, dataView.byteLength);
      }
      __name(cloneDataView, "cloneDataView");
      function cloneRegExp2(regexp2) {
        var result2 = new regexp2.constructor(regexp2.source, reFlags.exec(regexp2));
        result2.lastIndex = regexp2.lastIndex;
        return result2;
      }
      __name(cloneRegExp2, "cloneRegExp");
      function cloneSymbol(symbol) {
        return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
      }
      __name(cloneSymbol, "cloneSymbol");
      function cloneTypedArray(typedArray, isDeep) {
        var buffer2 = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
        return new typedArray.constructor(buffer2, typedArray.byteOffset, typedArray.length);
      }
      __name(cloneTypedArray, "cloneTypedArray");
      function compareAscending(value4, other) {
        if (value4 !== other) {
          var valIsDefined = value4 !== undefined$1, valIsNull = value4 === null, valIsReflexive = value4 === value4, valIsSymbol = isSymbol2(value4);
          var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol2(other);
          if (!othIsNull && !othIsSymbol && !valIsSymbol && value4 > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
            return 1;
          }
          if (!valIsNull && !valIsSymbol && !othIsSymbol && value4 < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
            return -1;
          }
        }
        return 0;
      }
      __name(compareAscending, "compareAscending");
      function compareMultiple(object, other, orders) {
        var index2 = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
        while (++index2 < length) {
          var result2 = compareAscending(objCriteria[index2], othCriteria[index2]);
          if (result2) {
            if (index2 >= ordersLength) {
              return result2;
            }
            var order = orders[index2];
            return result2 * (order == "desc" ? -1 : 1);
          }
        }
        return object.index - other.index;
      }
      __name(compareMultiple, "compareMultiple");
      function composeArgs(args, partials, holders, isCurried) {
        var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
        while (++leftIndex < leftLength) {
          result2[leftIndex] = partials[leftIndex];
        }
        while (++argsIndex < holdersLength) {
          if (isUncurried || argsIndex < argsLength) {
            result2[holders[argsIndex]] = args[argsIndex];
          }
        }
        while (rangeLength--) {
          result2[leftIndex++] = args[argsIndex++];
        }
        return result2;
      }
      __name(composeArgs, "composeArgs");
      function composeArgsRight(args, partials, holders, isCurried) {
        var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
        while (++argsIndex < rangeLength) {
          result2[argsIndex] = args[argsIndex];
        }
        var offset = argsIndex;
        while (++rightIndex < rightLength) {
          result2[offset + rightIndex] = partials[rightIndex];
        }
        while (++holdersIndex < holdersLength) {
          if (isUncurried || argsIndex < argsLength) {
            result2[offset + holders[holdersIndex]] = args[argsIndex++];
          }
        }
        return result2;
      }
      __name(composeArgsRight, "composeArgsRight");
      function copyArray(source, array) {
        var index2 = -1, length = source.length;
        array || (array = Array2(length));
        while (++index2 < length) {
          array[index2] = source[index2];
        }
        return array;
      }
      __name(copyArray, "copyArray");
      function copyObject(source, props, object, customizer) {
        var isNew = !object;
        object || (object = {});
        var index2 = -1, length = props.length;
        while (++index2 < length) {
          var key = props[index2];
          var newValue2 = customizer ? customizer(object[key], source[key], key, object, source) : undefined$1;
          if (newValue2 === undefined$1) {
            newValue2 = source[key];
          }
          if (isNew) {
            baseAssignValue(object, key, newValue2);
          } else {
            assignValue(object, key, newValue2);
          }
        }
        return object;
      }
      __name(copyObject, "copyObject");
      function copySymbols(source, object) {
        return copyObject(source, getSymbols(source), object);
      }
      __name(copySymbols, "copySymbols");
      function copySymbolsIn(source, object) {
        return copyObject(source, getSymbolsIn(source), object);
      }
      __name(copySymbolsIn, "copySymbolsIn");
      function createAggregator(setter, initializer) {
        return function(collection, iteratee2) {
          var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
          return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
        };
      }
      __name(createAggregator, "createAggregator");
      function createAssigner(assigner) {
        return baseRest(function(object, sources) {
          var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, guard = length > 2 ? sources[2] : undefined$1;
          customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined$1;
          if (guard && isIterateeCall(sources[0], sources[1], guard)) {
            customizer = length < 3 ? undefined$1 : customizer;
            length = 1;
          }
          object = Object2(object);
          while (++index2 < length) {
            var source = sources[index2];
            if (source) {
              assigner(object, source, index2, customizer);
            }
          }
          return object;
        });
      }
      __name(createAssigner, "createAssigner");
      function createBaseEach(eachFunc, fromRight) {
        return function(collection, iteratee2) {
          if (collection == null) {
            return collection;
          }
          if (!isArrayLike(collection)) {
            return eachFunc(collection, iteratee2);
          }
          var length = collection.length, index2 = fromRight ? length : -1, iterable = Object2(collection);
          while (fromRight ? index2-- : ++index2 < length) {
            if (iteratee2(iterable[index2], index2, iterable) === false) {
              break;
            }
          }
          return collection;
        };
      }
      __name(createBaseEach, "createBaseEach");
      function createBaseFor(fromRight) {
        return function(object, iteratee2, keysFunc) {
          var index2 = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
          while (length--) {
            var key = props[fromRight ? length : ++index2];
            if (iteratee2(iterable[key], key, iterable) === false) {
              break;
            }
          }
          return object;
        };
      }
      __name(createBaseFor, "createBaseFor");
      function createBind(func, bitmask, thisArg) {
        var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
        function wrapper() {
          var fn = this && this !== root24 && this instanceof wrapper ? Ctor : func;
          return fn.apply(isBind ? thisArg : this, arguments);
        }
        __name(wrapper, "wrapper");
        return wrapper;
      }
      __name(createBind, "createBind");
      function createCaseFirst(methodName) {
        return function(string) {
          string = toString3(string);
          var strSymbols = hasUnicode(string) ? stringToArray2(string) : undefined$1;
          var chr = strSymbols ? strSymbols[0] : string.charAt(0);
          var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
          return chr[methodName]() + trailing;
        };
      }
      __name(createCaseFirst, "createCaseFirst");
      function createCompounder(callback) {
        return function(string) {
          return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
        };
      }
      __name(createCompounder, "createCompounder");
      function createCtor(Ctor) {
        return function() {
          var args = arguments;
          switch (args.length) {
            case 0:
              return new Ctor();
            case 1:
              return new Ctor(args[0]);
            case 2:
              return new Ctor(args[0], args[1]);
            case 3:
              return new Ctor(args[0], args[1], args[2]);
            case 4:
              return new Ctor(args[0], args[1], args[2], args[3]);
            case 5:
              return new Ctor(args[0], args[1], args[2], args[3], args[4]);
            case 6:
              return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
            case 7:
              return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
          }
          var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
          return isObject2(result2) ? result2 : thisBinding;
        };
      }
      __name(createCtor, "createCtor");
      function createCurry(func, bitmask, arity) {
        var Ctor = createCtor(func);
        function wrapper() {
          var length = arguments.length, args = Array2(length), index2 = length, placeholder = getHolder(wrapper);
          while (index2--) {
            args[index2] = arguments[index2];
          }
          var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
          length -= holders.length;
          if (length < arity) {
            return createRecurry(
              func,
              bitmask,
              createHybrid,
              wrapper.placeholder,
              undefined$1,
              args,
              holders,
              undefined$1,
              undefined$1,
              arity - length
            );
          }
          var fn = this && this !== root24 && this instanceof wrapper ? Ctor : func;
          return apply2(fn, this, args);
        }
        __name(wrapper, "wrapper");
        return wrapper;
      }
      __name(createCurry, "createCurry");
      function createFind(findIndexFunc) {
        return function(collection, predicate, fromIndex) {
          var iterable = Object2(collection);
          if (!isArrayLike(collection)) {
            var iteratee2 = getIteratee(predicate, 3);
            collection = keys2(collection);
            predicate = /* @__PURE__ */ __name(function(key) {
              return iteratee2(iterable[key], key, iterable);
            }, "predicate");
          }
          var index2 = findIndexFunc(collection, predicate, fromIndex);
          return index2 > -1 ? iterable[iteratee2 ? collection[index2] : index2] : undefined$1;
        };
      }
      __name(createFind, "createFind");
      function createFlow(fromRight) {
        return flatRest(function(funcs) {
          var length = funcs.length, index2 = length, prereq = LodashWrapper.prototype.thru;
          if (fromRight) {
            funcs.reverse();
          }
          while (index2--) {
            var func = funcs[index2];
            if (typeof func != "function") {
              throw new TypeError2(FUNC_ERROR_TEXT);
            }
            if (prereq && !wrapper && getFuncName(func) == "wrapper") {
              var wrapper = new LodashWrapper([], true);
            }
          }
          index2 = wrapper ? index2 : length;
          while (++index2 < length) {
            func = funcs[index2];
            var funcName = getFuncName(func), data24 = funcName == "wrapper" ? getData(func) : undefined$1;
            if (data24 && isLaziable(data24[0]) && data24[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data24[4].length && data24[9] == 1) {
              wrapper = wrapper[getFuncName(data24[0])].apply(wrapper, data24[3]);
            } else {
              wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
            }
          }
          return function() {
            var args = arguments, value4 = args[0];
            if (wrapper && args.length == 1 && isArray2(value4)) {
              return wrapper.plant(value4).value();
            }
            var index3 = 0, result2 = length ? funcs[index3].apply(this, args) : value4;
            while (++index3 < length) {
              result2 = funcs[index3].call(this, result2);
            }
            return result2;
          };
        });
      }
      __name(createFlow, "createFlow");
      function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
        var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined$1 : createCtor(func);
        function wrapper() {
          var length = arguments.length, args = Array2(length), index2 = length;
          while (index2--) {
            args[index2] = arguments[index2];
          }
          if (isCurried) {
            var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
          }
          if (partials) {
            args = composeArgs(args, partials, holders, isCurried);
          }
          if (partialsRight) {
            args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
          }
          length -= holdersCount;
          if (isCurried && length < arity) {
            var newHolders = replaceHolders(args, placeholder);
            return createRecurry(
              func,
              bitmask,
              createHybrid,
              wrapper.placeholder,
              thisArg,
              args,
              newHolders,
              argPos,
              ary2,
              arity - length
            );
          }
          var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
          length = args.length;
          if (argPos) {
            args = reorder(args, argPos);
          } else if (isFlip && length > 1) {
            args.reverse();
          }
          if (isAry && ary2 < length) {
            args.length = ary2;
          }
          if (this && this !== root24 && this instanceof wrapper) {
            fn = Ctor || createCtor(fn);
          }
          return fn.apply(thisBinding, args);
        }
        __name(wrapper, "wrapper");
        return wrapper;
      }
      __name(createHybrid, "createHybrid");
      function createInverter(setter, toIteratee) {
        return function(object, iteratee2) {
          return baseInverter(object, setter, toIteratee(iteratee2), {});
        };
      }
      __name(createInverter, "createInverter");
      function createMathOperation(operator, defaultValue) {
        return function(value4, other) {
          var result2;
          if (value4 === undefined$1 && other === undefined$1) {
            return defaultValue;
          }
          if (value4 !== undefined$1) {
            result2 = value4;
          }
          if (other !== undefined$1) {
            if (result2 === undefined$1) {
              return other;
            }
            if (typeof value4 == "string" || typeof other == "string") {
              value4 = baseToString2(value4);
              other = baseToString2(other);
            } else {
              value4 = baseToNumber(value4);
              other = baseToNumber(other);
            }
            result2 = operator(value4, other);
          }
          return result2;
        };
      }
      __name(createMathOperation, "createMathOperation");
      function createOver(arrayFunc) {
        return flatRest(function(iteratees) {
          iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
          return baseRest(function(args) {
            var thisArg = this;
            return arrayFunc(iteratees, function(iteratee2) {
              return apply2(iteratee2, thisArg, args);
            });
          });
        });
      }
      __name(createOver, "createOver");
      function createPadding(length, chars) {
        chars = chars === undefined$1 ? " " : baseToString2(chars);
        var charsLength = chars.length;
        if (charsLength < 2) {
          return charsLength ? baseRepeat(chars, length) : chars;
        }
        var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
        return hasUnicode(chars) ? castSlice(stringToArray2(result2), 0, length).join("") : result2.slice(0, length);
      }
      __name(createPadding, "createPadding");
      function createPartial(func, bitmask, thisArg, partials) {
        var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
        function wrapper() {
          var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root24 && this instanceof wrapper ? Ctor : func;
          while (++leftIndex < leftLength) {
            args[leftIndex] = partials[leftIndex];
          }
          while (argsLength--) {
            args[leftIndex++] = arguments[++argsIndex];
          }
          return apply2(fn, isBind ? thisArg : this, args);
        }
        __name(wrapper, "wrapper");
        return wrapper;
      }
      __name(createPartial, "createPartial");
      function createRange(fromRight) {
        return function(start2, end, step3) {
          if (step3 && typeof step3 != "number" && isIterateeCall(start2, end, step3)) {
            end = step3 = undefined$1;
          }
          start2 = toFinite(start2);
          if (end === undefined$1) {
            end = start2;
            start2 = 0;
          } else {
            end = toFinite(end);
          }
          step3 = step3 === undefined$1 ? start2 < end ? 1 : -1 : toFinite(step3);
          return baseRange(start2, end, step3, fromRight);
        };
      }
      __name(createRange, "createRange");
      function createRelationalOperation(operator) {
        return function(value4, other) {
          if (!(typeof value4 == "string" && typeof other == "string")) {
            value4 = toNumber2(value4);
            other = toNumber2(other);
          }
          return operator(value4, other);
        };
      }
      __name(createRelationalOperation, "createRelationalOperation");
      function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
        var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined$1, newHoldersRight = isCurry ? undefined$1 : holders, newPartials = isCurry ? partials : undefined$1, newPartialsRight = isCurry ? undefined$1 : partials;
        bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
        bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
        if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
          bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
        }
        var newData = [
          func,
          bitmask,
          thisArg,
          newPartials,
          newHolders,
          newPartialsRight,
          newHoldersRight,
          argPos,
          ary2,
          arity
        ];
        var result2 = wrapFunc.apply(undefined$1, newData);
        if (isLaziable(func)) {
          setData(result2, newData);
        }
        result2.placeholder = placeholder;
        return setWrapToString(result2, func, bitmask);
      }
      __name(createRecurry, "createRecurry");
      function createRound(methodName) {
        var func = Math2[methodName];
        return function(number2, precision) {
          number2 = toNumber2(number2);
          precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
          if (precision && nativeIsFinite(number2)) {
            var pair = (toString3(number2) + "e").split("e"), value4 = func(pair[0] + "e" + (+pair[1] + precision));
            pair = (toString3(value4) + "e").split("e");
            return +(pair[0] + "e" + (+pair[1] - precision));
          }
          return func(number2);
        };
      }
      __name(createRound, "createRound");
      var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY2) ? noop2 : function(values2) {
        return new Set2(values2);
      };
      function createToPairs(keysFunc) {
        return function(object) {
          var tag = getTag2(object);
          if (tag == mapTag) {
            return mapToArray(object);
          }
          if (tag == setTag) {
            return setToPairs(object);
          }
          return baseToPairs(object, keysFunc(object));
        };
      }
      __name(createToPairs, "createToPairs");
      function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
        var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
        if (!isBindKey && typeof func != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        var length = partials ? partials.length : 0;
        if (!length) {
          bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
          partials = holders = undefined$1;
        }
        ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
        arity = arity === undefined$1 ? arity : toInteger(arity);
        length -= holders ? holders.length : 0;
        if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
          var partialsRight = partials, holdersRight = holders;
          partials = holders = undefined$1;
        }
        var data24 = isBindKey ? undefined$1 : getData(func);
        var newData = [
          func,
          bitmask,
          thisArg,
          partials,
          holders,
          partialsRight,
          holdersRight,
          argPos,
          ary2,
          arity
        ];
        if (data24) {
          mergeData(newData, data24);
        }
        func = newData[0];
        bitmask = newData[1];
        thisArg = newData[2];
        partials = newData[3];
        holders = newData[4];
        arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
        if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
          bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
        }
        if (!bitmask || bitmask == WRAP_BIND_FLAG) {
          var result2 = createBind(func, bitmask, thisArg);
        } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
          result2 = createCurry(func, bitmask, arity);
        } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
          result2 = createPartial(func, bitmask, thisArg, partials);
        } else {
          result2 = createHybrid.apply(undefined$1, newData);
        }
        var setter = data24 ? baseSetData : setData;
        return setWrapToString(setter(result2, newData), func, bitmask);
      }
      __name(createWrap, "createWrap");
      function customDefaultsAssignIn(objValue, srcValue, key, object) {
        if (objValue === undefined$1 || eq(objValue, objectProto[key]) && !hasOwnProperty2.call(object, key)) {
          return srcValue;
        }
        return objValue;
      }
      __name(customDefaultsAssignIn, "customDefaultsAssignIn");
      function customDefaultsMerge(objValue, srcValue, key, object, source, stack2) {
        if (isObject2(objValue) && isObject2(srcValue)) {
          stack2.set(srcValue, objValue);
          baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack2);
          stack2["delete"](srcValue);
        }
        return objValue;
      }
      __name(customDefaultsMerge, "customDefaultsMerge");
      function customOmitClone(value4) {
        return isPlainObject2(value4) ? undefined$1 : value4;
      }
      __name(customOmitClone, "customOmitClone");
      function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 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 index2 = -1, result2 = true, seen2 = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
        stack2.set(array, other);
        stack2.set(other, array);
        while (++index2 < arrLength) {
          var arrValue = array[index2], othValue = other[index2];
          if (customizer) {
            var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack2) : customizer(arrValue, othValue, index2, array, other, stack2);
          }
          if (compared !== undefined$1) {
            if (compared) {
              continue;
            }
            result2 = false;
            break;
          }
          if (seen2) {
            if (!arraySome(other, function(othValue2, othIndex) {
              if (!cacheHas(seen2, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) {
                return seen2.push(othIndex);
              }
            })) {
              result2 = false;
              break;
            }
          } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) {
            result2 = false;
            break;
          }
        }
        stack2["delete"](array);
        stack2["delete"](other);
        return result2;
      }
      __name(equalArrays, "equalArrays");
      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;
            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;
            stack2.set(object, other);
            var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack2);
            stack2["delete"](object);
            return result2;
          case symbolTag:
            if (symbolValueOf) {
              return symbolValueOf.call(object) == symbolValueOf.call(other);
            }
        }
        return false;
      }
      __name(equalByTag, "equalByTag");
      function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
        if (objLength != othLength && !isPartial) {
          return false;
        }
        var index2 = objLength;
        while (index2--) {
          var key = objProps[index2];
          if (!(isPartial ? key in other : hasOwnProperty2.call(other, key))) {
            return false;
          }
        }
        var objStacked = stack2.get(object);
        var othStacked = stack2.get(other);
        if (objStacked && othStacked) {
          return objStacked == other && othStacked == object;
        }
        var result2 = true;
        stack2.set(object, other);
        stack2.set(other, object);
        var skipCtor = isPartial;
        while (++index2 < objLength) {
          key = objProps[index2];
          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 === undefined$1 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) {
            result2 = false;
            break;
          }
          skipCtor || (skipCtor = key == "constructor");
        }
        if (result2 && !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)) {
            result2 = false;
          }
        }
        stack2["delete"](object);
        stack2["delete"](other);
        return result2;
      }
      __name(equalObjects, "equalObjects");
      function flatRest(func) {
        return setToString(overRest(func, undefined$1, flatten), func + "");
      }
      __name(flatRest, "flatRest");
      function getAllKeys(object) {
        return baseGetAllKeys(object, keys2, getSymbols);
      }
      __name(getAllKeys, "getAllKeys");
      function getAllKeysIn(object) {
        return baseGetAllKeys(object, keysIn, getSymbolsIn);
      }
      __name(getAllKeysIn, "getAllKeysIn");
      var getData = !metaMap ? noop2 : function(func) {
        return metaMap.get(func);
      };
      function getFuncName(func) {
        var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty2.call(realNames, result2) ? array.length : 0;
        while (length--) {
          var data24 = array[length], otherFunc = data24.func;
          if (otherFunc == null || otherFunc == func) {
            return data24.name;
          }
        }
        return result2;
      }
      __name(getFuncName, "getFuncName");
      function getHolder(func) {
        var object = hasOwnProperty2.call(lodash2, "placeholder") ? lodash2 : func;
        return object.placeholder;
      }
      __name(getHolder, "getHolder");
      function getIteratee() {
        var result2 = lodash2.iteratee || iteratee;
        result2 = result2 === iteratee ? baseIteratee : result2;
        return arguments.length ? result2(arguments[0], arguments[1]) : result2;
      }
      __name(getIteratee, "getIteratee");
      function getMapData(map4, key) {
        var data24 = map4.__data__;
        return isKeyable(key) ? data24[typeof key == "string" ? "string" : "hash"] : data24.map;
      }
      __name(getMapData, "getMapData");
      function getMatchData(object) {
        var result2 = keys2(object), length = result2.length;
        while (length--) {
          var key = result2[length], value4 = object[key];
          result2[length] = [key, value4, isStrictComparable(value4)];
        }
        return result2;
      }
      __name(getMatchData, "getMatchData");
      function getNative(object, key) {
        var value4 = getValue2(object, key);
        return baseIsNative(value4) ? value4 : undefined$1;
      }
      __name(getNative, "getNative");
      function getRawTag(value4) {
        var isOwn = hasOwnProperty2.call(value4, symToStringTag), tag = value4[symToStringTag];
        try {
          value4[symToStringTag] = undefined$1;
          var unmasked = true;
        } catch (e2) {
        }
        var result2 = nativeObjectToString.call(value4);
        if (unmasked) {
          if (isOwn) {
            value4[symToStringTag] = tag;
          } else {
            delete value4[symToStringTag];
          }
        }
        return result2;
      }
      __name(getRawTag, "getRawTag");
      var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
        if (object == null) {
          return [];
        }
        object = Object2(object);
        return arrayFilter(nativeGetSymbols(object), function(symbol) {
          return propertyIsEnumerable.call(object, symbol);
        });
      };
      var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
        var result2 = [];
        while (object) {
          arrayPush(result2, getSymbols(object));
          object = getPrototype(object);
        }
        return result2;
      };
      var getTag2 = baseGetTag;
      if (DataView2 && getTag2(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag2(new Map2()) != mapTag || Promise2 && getTag2(Promise2.resolve()) != promiseTag || Set2 && getTag2(new Set2()) != setTag || WeakMap2 && getTag2(new WeakMap2()) != weakMapTag) {
        getTag2 = /* @__PURE__ */ __name(function(value4) {
          var result2 = baseGetTag(value4), Ctor = result2 == objectTag ? value4.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
          if (ctorString) {
            switch (ctorString) {
              case dataViewCtorString:
                return dataViewTag;
              case mapCtorString:
                return mapTag;
              case promiseCtorString:
                return promiseTag;
              case setCtorString:
                return setTag;
              case weakMapCtorString:
                return weakMapTag;
            }
          }
          return result2;
        }, "getTag");
      }
      function getView(start2, end, transforms) {
        var index2 = -1, length = transforms.length;
        while (++index2 < length) {
          var data24 = transforms[index2], size3 = data24.size;
          switch (data24.type) {
            case "drop":
              start2 += size3;
              break;
            case "dropRight":
              end -= size3;
              break;
            case "take":
              end = nativeMin(end, start2 + size3);
              break;
            case "takeRight":
              start2 = nativeMax(start2, end - size3);
              break;
          }
        }
        return { "start": start2, "end": end };
      }
      __name(getView, "getView");
      function getWrapDetails(source) {
        var match2 = source.match(reWrapDetails);
        return match2 ? match2[1].split(reSplitDetails) : [];
      }
      __name(getWrapDetails, "getWrapDetails");
      function hasPath(object, path, hasFunc) {
        path = castPath(path, object);
        var index2 = -1, length = path.length, result2 = false;
        while (++index2 < length) {
          var key = toKey(path[index2]);
          if (!(result2 = object != null && hasFunc(object, key))) {
            break;
          }
          object = object[key];
        }
        if (result2 || ++index2 != length) {
          return result2;
        }
        length = object == null ? 0 : object.length;
        return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object));
      }
      __name(hasPath, "hasPath");
      function initCloneArray(array) {
        var length = array.length, result2 = new array.constructor(length);
        if (length && typeof array[0] == "string" && hasOwnProperty2.call(array, "index")) {
          result2.index = array.index;
          result2.input = array.input;
        }
        return result2;
      }
      __name(initCloneArray, "initCloneArray");
      function initCloneObject(object) {
        return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
      }
      __name(initCloneObject, "initCloneObject");
      function initCloneByTag(object, tag, isDeep) {
        var Ctor = object.constructor;
        switch (tag) {
          case arrayBufferTag:
            return cloneArrayBuffer(object);
          case boolTag:
          case dateTag:
            return new Ctor(+object);
          case dataViewTag:
            return cloneDataView(object, isDeep);
          case float32Tag:
          case float64Tag:
          case int8Tag:
          case int16Tag:
          case int32Tag:
          case uint8Tag:
          case uint8ClampedTag:
          case uint16Tag:
          case uint32Tag:
            return cloneTypedArray(object, isDeep);
          case mapTag:
            return new Ctor();
          case numberTag:
          case stringTag:
            return new Ctor(object);
          case regexpTag:
            return cloneRegExp2(object);
          case setTag:
            return new Ctor();
          case symbolTag:
            return cloneSymbol(object);
        }
      }
      __name(initCloneByTag, "initCloneByTag");
      function insertWrapDetails(source, details) {
        var length = details.length;
        if (!length) {
          return source;
        }
        var lastIndex2 = length - 1;
        details[lastIndex2] = (length > 1 ? "& " : "") + details[lastIndex2];
        details = details.join(length > 2 ? ", " : " ");
        return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
      }
      __name(insertWrapDetails, "insertWrapDetails");
      function isFlattenable(value4) {
        return isArray2(value4) || isArguments(value4) || !!(spreadableSymbol && value4 && value4[spreadableSymbol]);
      }
      __name(isFlattenable, "isFlattenable");
      function isIndex(value4, length) {
        var type = typeof value4;
        length = length == null ? MAX_SAFE_INTEGER : length;
        return !!length && (type == "number" || type != "symbol" && reIsUint.test(value4)) && (value4 > -1 && value4 % 1 == 0 && value4 < length);
      }
      __name(isIndex, "isIndex");
      function isIterateeCall(value4, index2, object) {
        if (!isObject2(object)) {
          return false;
        }
        var type = typeof index2;
        if (type == "number" ? isArrayLike(object) && isIndex(index2, object.length) : type == "string" && index2 in object) {
          return eq(object[index2], value4);
        }
        return false;
      }
      __name(isIterateeCall, "isIterateeCall");
      function isKey(value4, object) {
        if (isArray2(value4)) {
          return false;
        }
        var type = typeof value4;
        if (type == "number" || type == "symbol" || type == "boolean" || value4 == null || isSymbol2(value4)) {
          return true;
        }
        return reIsPlainProp.test(value4) || !reIsDeepProp.test(value4) || object != null && value4 in Object2(object);
      }
      __name(isKey, "isKey");
      function isKeyable(value4) {
        var type = typeof value4;
        return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value4 !== "__proto__" : value4 === null;
      }
      __name(isKeyable, "isKeyable");
      function isLaziable(func) {
        var funcName = getFuncName(func), other = lodash2[funcName];
        if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
          return false;
        }
        if (func === other) {
          return true;
        }
        var data24 = getData(other);
        return !!data24 && func === data24[0];
      }
      __name(isLaziable, "isLaziable");
      function isMasked(func) {
        return !!maskSrcKey && maskSrcKey in func;
      }
      __name(isMasked, "isMasked");
      var isMaskable = coreJsData ? isFunction2 : stubFalse;
      function isPrototype(value4) {
        var Ctor = value4 && value4.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
        return value4 === proto;
      }
      __name(isPrototype, "isPrototype");
      function isStrictComparable(value4) {
        return value4 === value4 && !isObject2(value4);
      }
      __name(isStrictComparable, "isStrictComparable");
      function matchesStrictComparable(key, srcValue) {
        return function(object) {
          if (object == null) {
            return false;
          }
          return object[key] === srcValue && (srcValue !== undefined$1 || key in Object2(object));
        };
      }
      __name(matchesStrictComparable, "matchesStrictComparable");
      function memoizeCapped(func) {
        var result2 = memoize(func, function(key) {
          if (cache2.size === MAX_MEMOIZE_SIZE) {
            cache2.clear();
          }
          return key;
        });
        var cache2 = result2.cache;
        return result2;
      }
      __name(memoizeCapped, "memoizeCapped");
      function mergeData(data24, source) {
        var bitmask = data24[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
        var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data24[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
        if (!(isCommon || isCombo)) {
          return data24;
        }
        if (srcBitmask & WRAP_BIND_FLAG) {
          data24[2] = source[2];
          newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
        }
        var value4 = source[3];
        if (value4) {
          var partials = data24[3];
          data24[3] = partials ? composeArgs(partials, value4, source[4]) : value4;
          data24[4] = partials ? replaceHolders(data24[3], PLACEHOLDER) : source[4];
        }
        value4 = source[5];
        if (value4) {
          partials = data24[5];
          data24[5] = partials ? composeArgsRight(partials, value4, source[6]) : value4;
          data24[6] = partials ? replaceHolders(data24[5], PLACEHOLDER) : source[6];
        }
        value4 = source[7];
        if (value4) {
          data24[7] = value4;
        }
        if (srcBitmask & WRAP_ARY_FLAG) {
          data24[8] = data24[8] == null ? source[8] : nativeMin(data24[8], source[8]);
        }
        if (data24[9] == null) {
          data24[9] = source[9];
        }
        data24[0] = source[0];
        data24[1] = newBitmask;
        return data24;
      }
      __name(mergeData, "mergeData");
      function nativeKeysIn(object) {
        var result2 = [];
        if (object != null) {
          for (var key in Object2(object)) {
            result2.push(key);
          }
        }
        return result2;
      }
      __name(nativeKeysIn, "nativeKeysIn");
      function objectToString2(value4) {
        return nativeObjectToString.call(value4);
      }
      __name(objectToString2, "objectToString");
      function overRest(func, start2, transform3) {
        start2 = nativeMax(start2 === undefined$1 ? func.length - 1 : start2, 0);
        return function() {
          var args = arguments, index2 = -1, length = nativeMax(args.length - start2, 0), array = Array2(length);
          while (++index2 < length) {
            array[index2] = args[start2 + index2];
          }
          index2 = -1;
          var otherArgs = Array2(start2 + 1);
          while (++index2 < start2) {
            otherArgs[index2] = args[index2];
          }
          otherArgs[start2] = transform3(array);
          return apply2(func, this, otherArgs);
        };
      }
      __name(overRest, "overRest");
      function parent(object, path) {
        return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
      }
      __name(parent, "parent");
      function reorder(array, indexes) {
        var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
        while (length--) {
          var index2 = indexes[length];
          array[length] = isIndex(index2, arrLength) ? oldArray[index2] : undefined$1;
        }
        return array;
      }
      __name(reorder, "reorder");
      function safeGet(object, key) {
        if (key === "constructor" && typeof object[key] === "function") {
          return;
        }
        if (key == "__proto__") {
          return;
        }
        return object[key];
      }
      __name(safeGet, "safeGet");
      var setData = shortOut(baseSetData);
      var setTimeout2 = ctxSetTimeout || function(func, wait) {
        return root24.setTimeout(func, wait);
      };
      var setToString = shortOut(baseSetToString);
      function setWrapToString(wrapper, reference2, bitmask) {
        var source = reference2 + "";
        return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
      }
      __name(setWrapToString, "setWrapToString");
      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(undefined$1, arguments);
        };
      }
      __name(shortOut, "shortOut");
      function shuffleSelf(array, size3) {
        var index2 = -1, length = array.length, lastIndex2 = length - 1;
        size3 = size3 === undefined$1 ? length : size3;
        while (++index2 < size3) {
          var rand2 = baseRandom(index2, lastIndex2), value4 = array[rand2];
          array[rand2] = array[index2];
          array[index2] = value4;
        }
        array.length = size3;
        return array;
      }
      __name(shuffleSelf, "shuffleSelf");
      var stringToPath = memoizeCapped(function(string) {
        var result2 = [];
        if (string.charCodeAt(0) === 46) {
          result2.push("");
        }
        string.replace(rePropName, function(match2, number2, quote, subString) {
          result2.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match2);
        });
        return result2;
      });
      function toKey(value4) {
        if (typeof value4 == "string" || isSymbol2(value4)) {
          return value4;
        }
        var result2 = value4 + "";
        return result2 == "0" && 1 / value4 == -INFINITY2 ? "-0" : result2;
      }
      __name(toKey, "toKey");
      function toSource(func) {
        if (func != null) {
          try {
            return funcToString.call(func);
          } catch (e2) {
          }
          try {
            return func + "";
          } catch (e2) {
          }
        }
        return "";
      }
      __name(toSource, "toSource");
      function updateWrapDetails(details, bitmask) {
        arrayEach(wrapFlags, function(pair) {
          var value4 = "_." + pair[0];
          if (bitmask & pair[1] && !arrayIncludes(details, value4)) {
            details.push(value4);
          }
        });
        return details.sort();
      }
      __name(updateWrapDetails, "updateWrapDetails");
      function wrapperClone(wrapper) {
        if (wrapper instanceof LazyWrapper) {
          return wrapper.clone();
        }
        var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
        result2.__actions__ = copyArray(wrapper.__actions__);
        result2.__index__ = wrapper.__index__;
        result2.__values__ = wrapper.__values__;
        return result2;
      }
      __name(wrapperClone, "wrapperClone");
      function chunk(array, size3, guard) {
        if (guard ? isIterateeCall(array, size3, guard) : size3 === undefined$1) {
          size3 = 1;
        } else {
          size3 = nativeMax(toInteger(size3), 0);
        }
        var length = array == null ? 0 : array.length;
        if (!length || size3 < 1) {
          return [];
        }
        var index2 = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size3));
        while (index2 < length) {
          result2[resIndex++] = baseSlice(array, index2, index2 += size3);
        }
        return result2;
      }
      __name(chunk, "chunk");
      function compact(array) {
        var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
        while (++index2 < length) {
          var value4 = array[index2];
          if (value4) {
            result2[resIndex++] = value4;
          }
        }
        return result2;
      }
      __name(compact, "compact");
      function concat() {
        var length = arguments.length;
        if (!length) {
          return [];
        }
        var args = Array2(length - 1), array = arguments[0], index2 = length;
        while (index2--) {
          args[index2 - 1] = arguments[index2];
        }
        return arrayPush(isArray2(array) ? copyArray(array) : [array], baseFlatten(args, 1));
      }
      __name(concat, "concat");
      var difference = baseRest(function(array, values2) {
        return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
      });
      var differenceBy = baseRest(function(array, values2) {
        var iteratee2 = last(values2);
        if (isArrayLikeObject(iteratee2)) {
          iteratee2 = undefined$1;
        }
        return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
      });
      var differenceWith = baseRest(function(array, values2) {
        var comparator2 = last(values2);
        if (isArrayLikeObject(comparator2)) {
          comparator2 = undefined$1;
        }
        return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined$1, comparator2) : [];
      });
      function drop(array, n, guard) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return [];
        }
        n = guard || n === undefined$1 ? 1 : toInteger(n);
        return baseSlice(array, n < 0 ? 0 : n, length);
      }
      __name(drop, "drop");
      function dropRight(array, n, guard) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return [];
        }
        n = guard || n === undefined$1 ? 1 : toInteger(n);
        n = length - n;
        return baseSlice(array, 0, n < 0 ? 0 : n);
      }
      __name(dropRight, "dropRight");
      function dropRightWhile(array, predicate) {
        return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
      }
      __name(dropRightWhile, "dropRightWhile");
      function dropWhile(array, predicate) {
        return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
      }
      __name(dropWhile, "dropWhile");
      function fill(array, value4, start2, end) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return [];
        }
        if (start2 && typeof start2 != "number" && isIterateeCall(array, value4, start2)) {
          start2 = 0;
          end = length;
        }
        return baseFill(array, value4, start2, end);
      }
      __name(fill, "fill");
      function findIndex(array, predicate, fromIndex) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return -1;
        }
        var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
        if (index2 < 0) {
          index2 = nativeMax(length + index2, 0);
        }
        return baseFindIndex(array, getIteratee(predicate, 3), index2);
      }
      __name(findIndex, "findIndex");
      function findLastIndex2(array, predicate, fromIndex) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return -1;
        }
        var index2 = length - 1;
        if (fromIndex !== undefined$1) {
          index2 = toInteger(fromIndex);
          index2 = fromIndex < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
        }
        return baseFindIndex(array, getIteratee(predicate, 3), index2, true);
      }
      __name(findLastIndex2, "findLastIndex");
      function flatten(array) {
        var length = array == null ? 0 : array.length;
        return length ? baseFlatten(array, 1) : [];
      }
      __name(flatten, "flatten");
      function flattenDeep(array) {
        var length = array == null ? 0 : array.length;
        return length ? baseFlatten(array, INFINITY2) : [];
      }
      __name(flattenDeep, "flattenDeep");
      function flattenDepth(array, depth) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return [];
        }
        depth = depth === undefined$1 ? 1 : toInteger(depth);
        return baseFlatten(array, depth);
      }
      __name(flattenDepth, "flattenDepth");
      function fromPairs(pairs) {
        var index2 = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
        while (++index2 < length) {
          var pair = pairs[index2];
          result2[pair[0]] = pair[1];
        }
        return result2;
      }
      __name(fromPairs, "fromPairs");
      function head(array) {
        return array && array.length ? array[0] : undefined$1;
      }
      __name(head, "head");
      function indexOf(array, value4, fromIndex) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return -1;
        }
        var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
        if (index2 < 0) {
          index2 = nativeMax(length + index2, 0);
        }
        return baseIndexOf(array, value4, index2);
      }
      __name(indexOf, "indexOf");
      function initial(array) {
        var length = array == null ? 0 : array.length;
        return length ? baseSlice(array, 0, -1) : [];
      }
      __name(initial, "initial");
      var intersection = baseRest(function(arrays) {
        var mapped = arrayMap(arrays, castArrayLikeObject);
        return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
      });
      var intersectionBy = baseRest(function(arrays) {
        var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
        if (iteratee2 === last(mapped)) {
          iteratee2 = undefined$1;
        } else {
          mapped.pop();
        }
        return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
      });
      var intersectionWith = baseRest(function(arrays) {
        var comparator2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
        comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
        if (comparator2) {
          mapped.pop();
        }
        return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined$1, comparator2) : [];
      });
      function join2(array, separator) {
        return array == null ? "" : nativeJoin.call(array, separator);
      }
      __name(join2, "join");
      function last(array) {
        var length = array == null ? 0 : array.length;
        return length ? array[length - 1] : undefined$1;
      }
      __name(last, "last");
      function lastIndexOf(array, value4, fromIndex) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return -1;
        }
        var index2 = length;
        if (fromIndex !== undefined$1) {
          index2 = toInteger(fromIndex);
          index2 = index2 < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
        }
        return value4 === value4 ? strictLastIndexOf(array, value4, index2) : baseFindIndex(array, baseIsNaN, index2, true);
      }
      __name(lastIndexOf, "lastIndexOf");
      function nth(array, n) {
        return array && array.length ? baseNth(array, toInteger(n)) : undefined$1;
      }
      __name(nth, "nth");
      var pull = baseRest(pullAll);
      function pullAll(array, values2) {
        return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
      }
      __name(pullAll, "pullAll");
      function pullAllBy(array, values2, iteratee2) {
        return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
      }
      __name(pullAllBy, "pullAllBy");
      function pullAllWith(array, values2, comparator2) {
        return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined$1, comparator2) : array;
      }
      __name(pullAllWith, "pullAllWith");
      var pullAt = flatRest(function(array, indexes) {
        var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes);
        basePullAt(array, arrayMap(indexes, function(index2) {
          return isIndex(index2, length) ? +index2 : index2;
        }).sort(compareAscending));
        return result2;
      });
      function remove4(array, predicate) {
        var result2 = [];
        if (!(array && array.length)) {
          return result2;
        }
        var index2 = -1, indexes = [], length = array.length;
        predicate = getIteratee(predicate, 3);
        while (++index2 < length) {
          var value4 = array[index2];
          if (predicate(value4, index2, array)) {
            result2.push(value4);
            indexes.push(index2);
          }
        }
        basePullAt(array, indexes);
        return result2;
      }
      __name(remove4, "remove");
      function reverse2(array) {
        return array == null ? array : nativeReverse.call(array);
      }
      __name(reverse2, "reverse");
      function slice2(array, start2, end) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return [];
        }
        if (end && typeof end != "number" && isIterateeCall(array, start2, end)) {
          start2 = 0;
          end = length;
        } else {
          start2 = start2 == null ? 0 : toInteger(start2);
          end = end === undefined$1 ? length : toInteger(end);
        }
        return baseSlice(array, start2, end);
      }
      __name(slice2, "slice");
      function sortedIndex(array, value4) {
        return baseSortedIndex(array, value4);
      }
      __name(sortedIndex, "sortedIndex");
      function sortedIndexBy(array, value4, iteratee2) {
        return baseSortedIndexBy(array, value4, getIteratee(iteratee2, 2));
      }
      __name(sortedIndexBy, "sortedIndexBy");
      function sortedIndexOf(array, value4) {
        var length = array == null ? 0 : array.length;
        if (length) {
          var index2 = baseSortedIndex(array, value4);
          if (index2 < length && eq(array[index2], value4)) {
            return index2;
          }
        }
        return -1;
      }
      __name(sortedIndexOf, "sortedIndexOf");
      function sortedLastIndex(array, value4) {
        return baseSortedIndex(array, value4, true);
      }
      __name(sortedLastIndex, "sortedLastIndex");
      function sortedLastIndexBy(array, value4, iteratee2) {
        return baseSortedIndexBy(array, value4, getIteratee(iteratee2, 2), true);
      }
      __name(sortedLastIndexBy, "sortedLastIndexBy");
      function sortedLastIndexOf(array, value4) {
        var length = array == null ? 0 : array.length;
        if (length) {
          var index2 = baseSortedIndex(array, value4, true) - 1;
          if (eq(array[index2], value4)) {
            return index2;
          }
        }
        return -1;
      }
      __name(sortedLastIndexOf, "sortedLastIndexOf");
      function sortedUniq(array) {
        return array && array.length ? baseSortedUniq(array) : [];
      }
      __name(sortedUniq, "sortedUniq");
      function sortedUniqBy(array, iteratee2) {
        return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
      }
      __name(sortedUniqBy, "sortedUniqBy");
      function tail(array) {
        var length = array == null ? 0 : array.length;
        return length ? baseSlice(array, 1, length) : [];
      }
      __name(tail, "tail");
      function take(array, n, guard) {
        if (!(array && array.length)) {
          return [];
        }
        n = guard || n === undefined$1 ? 1 : toInteger(n);
        return baseSlice(array, 0, n < 0 ? 0 : n);
      }
      __name(take, "take");
      function takeRight(array, n, guard) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return [];
        }
        n = guard || n === undefined$1 ? 1 : toInteger(n);
        n = length - n;
        return baseSlice(array, n < 0 ? 0 : n, length);
      }
      __name(takeRight, "takeRight");
      function takeRightWhile(array, predicate) {
        return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
      }
      __name(takeRightWhile, "takeRightWhile");
      function takeWhile(array, predicate) {
        return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
      }
      __name(takeWhile, "takeWhile");
      var union = baseRest(function(arrays) {
        return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
      });
      var unionBy = baseRest(function(arrays) {
        var iteratee2 = last(arrays);
        if (isArrayLikeObject(iteratee2)) {
          iteratee2 = undefined$1;
        }
        return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
      });
      var unionWith = baseRest(function(arrays) {
        var comparator2 = last(arrays);
        comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
        return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator2);
      });
      function uniq2(array) {
        return array && array.length ? baseUniq(array) : [];
      }
      __name(uniq2, "uniq");
      function uniqBy(array, iteratee2) {
        return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
      }
      __name(uniqBy, "uniqBy");
      function uniqWith(array, comparator2) {
        comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
        return array && array.length ? baseUniq(array, undefined$1, comparator2) : [];
      }
      __name(uniqWith, "uniqWith");
      function unzip(array) {
        if (!(array && array.length)) {
          return [];
        }
        var length = 0;
        array = arrayFilter(array, function(group) {
          if (isArrayLikeObject(group)) {
            length = nativeMax(group.length, length);
            return true;
          }
        });
        return baseTimes(length, function(index2) {
          return arrayMap(array, baseProperty(index2));
        });
      }
      __name(unzip, "unzip");
      function unzipWith(array, iteratee2) {
        if (!(array && array.length)) {
          return [];
        }
        var result2 = unzip(array);
        if (iteratee2 == null) {
          return result2;
        }
        return arrayMap(result2, function(group) {
          return apply2(iteratee2, undefined$1, group);
        });
      }
      __name(unzipWith, "unzipWith");
      var without = baseRest(function(array, values2) {
        return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
      });
      var xor = baseRest(function(arrays) {
        return baseXor(arrayFilter(arrays, isArrayLikeObject));
      });
      var xorBy = baseRest(function(arrays) {
        var iteratee2 = last(arrays);
        if (isArrayLikeObject(iteratee2)) {
          iteratee2 = undefined$1;
        }
        return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
      });
      var xorWith = baseRest(function(arrays) {
        var comparator2 = last(arrays);
        comparator2 = typeof comparator2 == "function" ? comparator2 : undefined$1;
        return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator2);
      });
      var zip = baseRest(unzip);
      function zipObject(props, values2) {
        return baseZipObject(props || [], values2 || [], assignValue);
      }
      __name(zipObject, "zipObject");
      function zipObjectDeep(props, values2) {
        return baseZipObject(props || [], values2 || [], baseSet);
      }
      __name(zipObjectDeep, "zipObjectDeep");
      var zipWith = baseRest(function(arrays) {
        var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined$1;
        iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined$1;
        return unzipWith(arrays, iteratee2);
      });
      function chain(value4) {
        var result2 = lodash2(value4);
        result2.__chain__ = true;
        return result2;
      }
      __name(chain, "chain");
      function tap(value4, interceptor) {
        interceptor(value4);
        return value4;
      }
      __name(tap, "tap");
      function thru(value4, interceptor) {
        return interceptor(value4);
      }
      __name(thru, "thru");
      var wrapperAt = flatRest(function(paths) {
        var length = paths.length, start2 = length ? paths[0] : 0, value4 = this.__wrapped__, interceptor = /* @__PURE__ */ __name(function(object) {
          return baseAt(object, paths);
        }, "interceptor");
        if (length > 1 || this.__actions__.length || !(value4 instanceof LazyWrapper) || !isIndex(start2)) {
          return this.thru(interceptor);
        }
        value4 = value4.slice(start2, +start2 + (length ? 1 : 0));
        value4.__actions__.push({
          "func": thru,
          "args": [interceptor],
          "thisArg": undefined$1
        });
        return new LodashWrapper(value4, this.__chain__).thru(function(array) {
          if (length && !array.length) {
            array.push(undefined$1);
          }
          return array;
        });
      });
      function wrapperChain() {
        return chain(this);
      }
      __name(wrapperChain, "wrapperChain");
      function wrapperCommit() {
        return new LodashWrapper(this.value(), this.__chain__);
      }
      __name(wrapperCommit, "wrapperCommit");
      function wrapperNext() {
        if (this.__values__ === undefined$1) {
          this.__values__ = toArray2(this.value());
        }
        var done = this.__index__ >= this.__values__.length, value4 = done ? undefined$1 : this.__values__[this.__index__++];
        return { "done": done, "value": value4 };
      }
      __name(wrapperNext, "wrapperNext");
      function wrapperToIterator() {
        return this;
      }
      __name(wrapperToIterator, "wrapperToIterator");
      function wrapperPlant(value4) {
        var result2, parent2 = this;
        while (parent2 instanceof baseLodash) {
          var clone3 = wrapperClone(parent2);
          clone3.__index__ = 0;
          clone3.__values__ = undefined$1;
          if (result2) {
            previous.__wrapped__ = clone3;
          } else {
            result2 = clone3;
          }
          var previous = clone3;
          parent2 = parent2.__wrapped__;
        }
        previous.__wrapped__ = value4;
        return result2;
      }
      __name(wrapperPlant, "wrapperPlant");
      function wrapperReverse() {
        var value4 = this.__wrapped__;
        if (value4 instanceof LazyWrapper) {
          var wrapped = value4;
          if (this.__actions__.length) {
            wrapped = new LazyWrapper(this);
          }
          wrapped = wrapped.reverse();
          wrapped.__actions__.push({
            "func": thru,
            "args": [reverse2],
            "thisArg": undefined$1
          });
          return new LodashWrapper(wrapped, this.__chain__);
        }
        return this.thru(reverse2);
      }
      __name(wrapperReverse, "wrapperReverse");
      function wrapperValue() {
        return baseWrapperValue(this.__wrapped__, this.__actions__);
      }
      __name(wrapperValue, "wrapperValue");
      var countBy = createAggregator(function(result2, value4, key) {
        if (hasOwnProperty2.call(result2, key)) {
          ++result2[key];
        } else {
          baseAssignValue(result2, key, 1);
        }
      });
      function every(collection, predicate, guard) {
        var func = isArray2(collection) ? arrayEvery : baseEvery;
        if (guard && isIterateeCall(collection, predicate, guard)) {
          predicate = undefined$1;
        }
        return func(collection, getIteratee(predicate, 3));
      }
      __name(every, "every");
      function filter4(collection, predicate) {
        var func = isArray2(collection) ? arrayFilter : baseFilter;
        return func(collection, getIteratee(predicate, 3));
      }
      __name(filter4, "filter");
      var find2 = createFind(findIndex);
      var findLast2 = createFind(findLastIndex2);
      function flatMap(collection, iteratee2) {
        return baseFlatten(map3(collection, iteratee2), 1);
      }
      __name(flatMap, "flatMap");
      function flatMapDeep(collection, iteratee2) {
        return baseFlatten(map3(collection, iteratee2), INFINITY2);
      }
      __name(flatMapDeep, "flatMapDeep");
      function flatMapDepth(collection, iteratee2, depth) {
        depth = depth === undefined$1 ? 1 : toInteger(depth);
        return baseFlatten(map3(collection, iteratee2), depth);
      }
      __name(flatMapDepth, "flatMapDepth");
      function forEach3(collection, iteratee2) {
        var func = isArray2(collection) ? arrayEach : baseEach;
        return func(collection, getIteratee(iteratee2, 3));
      }
      __name(forEach3, "forEach");
      function forEachRight(collection, iteratee2) {
        var func = isArray2(collection) ? arrayEachRight : baseEachRight;
        return func(collection, getIteratee(iteratee2, 3));
      }
      __name(forEachRight, "forEachRight");
      var groupBy = createAggregator(function(result2, value4, key) {
        if (hasOwnProperty2.call(result2, key)) {
          result2[key].push(value4);
        } else {
          baseAssignValue(result2, key, [value4]);
        }
      });
      function includes(collection, value4, fromIndex, guard) {
        collection = isArrayLike(collection) ? collection : values(collection);
        fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
        var length = collection.length;
        if (fromIndex < 0) {
          fromIndex = nativeMax(length + fromIndex, 0);
        }
        return isString2(collection) ? fromIndex <= length && collection.indexOf(value4, fromIndex) > -1 : !!length && baseIndexOf(collection, value4, fromIndex) > -1;
      }
      __name(includes, "includes");
      var invokeMap = baseRest(function(collection, path, args) {
        var index2 = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
        baseEach(collection, function(value4) {
          result2[++index2] = isFunc ? apply2(path, value4, args) : baseInvoke(value4, path, args);
        });
        return result2;
      });
      var keyBy = createAggregator(function(result2, value4, key) {
        baseAssignValue(result2, key, value4);
      });
      function map3(collection, iteratee2) {
        var func = isArray2(collection) ? arrayMap : baseMap;
        return func(collection, getIteratee(iteratee2, 3));
      }
      __name(map3, "map");
      function orderBy(collection, iteratees, orders, guard) {
        if (collection == null) {
          return [];
        }
        if (!isArray2(iteratees)) {
          iteratees = iteratees == null ? [] : [iteratees];
        }
        orders = guard ? undefined$1 : orders;
        if (!isArray2(orders)) {
          orders = orders == null ? [] : [orders];
        }
        return baseOrderBy(collection, iteratees, orders);
      }
      __name(orderBy, "orderBy");
      var partition = createAggregator(function(result2, value4, key) {
        result2[key ? 0 : 1].push(value4);
      }, function() {
        return [[], []];
      });
      function reduce(collection, iteratee2, accumulator) {
        var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
        return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
      }
      __name(reduce, "reduce");
      function reduceRight(collection, iteratee2, accumulator) {
        var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
        return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
      }
      __name(reduceRight, "reduceRight");
      function reject3(collection, predicate) {
        var func = isArray2(collection) ? arrayFilter : baseFilter;
        return func(collection, negate(getIteratee(predicate, 3)));
      }
      __name(reject3, "reject");
      function sample(collection) {
        var func = isArray2(collection) ? arraySample : baseSample;
        return func(collection);
      }
      __name(sample, "sample");
      function sampleSize(collection, n, guard) {
        if (guard ? isIterateeCall(collection, n, guard) : n === undefined$1) {
          n = 1;
        } else {
          n = toInteger(n);
        }
        var func = isArray2(collection) ? arraySampleSize : baseSampleSize;
        return func(collection, n);
      }
      __name(sampleSize, "sampleSize");
      function shuffle(collection) {
        var func = isArray2(collection) ? arrayShuffle : baseShuffle;
        return func(collection);
      }
      __name(shuffle, "shuffle");
      function size2(collection) {
        if (collection == null) {
          return 0;
        }
        if (isArrayLike(collection)) {
          return isString2(collection) ? stringSize(collection) : collection.length;
        }
        var tag = getTag2(collection);
        if (tag == mapTag || tag == setTag) {
          return collection.size;
        }
        return baseKeys(collection).length;
      }
      __name(size2, "size");
      function some(collection, predicate, guard) {
        var func = isArray2(collection) ? arraySome : baseSome;
        if (guard && isIterateeCall(collection, predicate, guard)) {
          predicate = undefined$1;
        }
        return func(collection, getIteratee(predicate, 3));
      }
      __name(some, "some");
      var sortBy = baseRest(function(collection, iteratees) {
        if (collection == null) {
          return [];
        }
        var length = iteratees.length;
        if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
          iteratees = [];
        } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
          iteratees = [iteratees[0]];
        }
        return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
      });
      var now2 = ctxNow || function() {
        return root24.Date.now();
      };
      function after(n, func) {
        if (typeof func != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        n = toInteger(n);
        return function() {
          if (--n < 1) {
            return func.apply(this, arguments);
          }
        };
      }
      __name(after, "after");
      function ary(func, n, guard) {
        n = guard ? undefined$1 : n;
        n = func && n == null ? func.length : n;
        return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n);
      }
      __name(ary, "ary");
      function before(n, func) {
        var result2;
        if (typeof func != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        n = toInteger(n);
        return function() {
          if (--n > 0) {
            result2 = func.apply(this, arguments);
          }
          if (n <= 1) {
            func = undefined$1;
          }
          return result2;
        };
      }
      __name(before, "before");
      var bind3 = baseRest(function(func, thisArg, partials) {
        var bitmask = WRAP_BIND_FLAG;
        if (partials.length) {
          var holders = replaceHolders(partials, getHolder(bind3));
          bitmask |= WRAP_PARTIAL_FLAG;
        }
        return createWrap(func, bitmask, thisArg, partials, holders);
      });
      var bindKey = baseRest(function(object, key, partials) {
        var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
        if (partials.length) {
          var holders = replaceHolders(partials, getHolder(bindKey));
          bitmask |= WRAP_PARTIAL_FLAG;
        }
        return createWrap(key, bitmask, object, partials, holders);
      });
      function curry(func, arity, guard) {
        arity = guard ? undefined$1 : arity;
        var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
        result2.placeholder = curry.placeholder;
        return result2;
      }
      __name(curry, "curry");
      function curryRight(func, arity, guard) {
        arity = guard ? undefined$1 : arity;
        var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
        result2.placeholder = curryRight.placeholder;
        return result2;
      }
      __name(curryRight, "curryRight");
      function debounce(func, wait, options4) {
        var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
        if (typeof func != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        wait = toNumber2(wait) || 0;
        if (isObject2(options4)) {
          leading = !!options4.leading;
          maxing = "maxWait" in options4;
          maxWait = maxing ? nativeMax(toNumber2(options4.maxWait) || 0, wait) : maxWait;
          trailing = "trailing" in options4 ? !!options4.trailing : trailing;
        }
        function invokeFunc(time) {
          var args = lastArgs, thisArg = lastThis;
          lastArgs = lastThis = undefined$1;
          lastInvokeTime = time;
          result2 = func.apply(thisArg, args);
          return result2;
        }
        __name(invokeFunc, "invokeFunc");
        function leadingEdge(time) {
          lastInvokeTime = time;
          timerId = setTimeout2(timerExpired, wait);
          return leading ? invokeFunc(time) : result2;
        }
        __name(leadingEdge, "leadingEdge");
        function remainingWait(time) {
          var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
          return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
        }
        __name(remainingWait, "remainingWait");
        function shouldInvoke(time) {
          var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
          return lastCallTime === undefined$1 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
        }
        __name(shouldInvoke, "shouldInvoke");
        function timerExpired() {
          var time = now2();
          if (shouldInvoke(time)) {
            return trailingEdge(time);
          }
          timerId = setTimeout2(timerExpired, remainingWait(time));
        }
        __name(timerExpired, "timerExpired");
        function trailingEdge(time) {
          timerId = undefined$1;
          if (trailing && lastArgs) {
            return invokeFunc(time);
          }
          lastArgs = lastThis = undefined$1;
          return result2;
        }
        __name(trailingEdge, "trailingEdge");
        function cancel() {
          if (timerId !== undefined$1) {
            clearTimeout2(timerId);
          }
          lastInvokeTime = 0;
          lastArgs = lastCallTime = lastThis = timerId = undefined$1;
        }
        __name(cancel, "cancel");
        function flush() {
          return timerId === undefined$1 ? result2 : trailingEdge(now2());
        }
        __name(flush, "flush");
        function debounced() {
          var time = now2(), isInvoking = shouldInvoke(time);
          lastArgs = arguments;
          lastThis = this;
          lastCallTime = time;
          if (isInvoking) {
            if (timerId === undefined$1) {
              return leadingEdge(lastCallTime);
            }
            if (maxing) {
              clearTimeout2(timerId);
              timerId = setTimeout2(timerExpired, wait);
              return invokeFunc(lastCallTime);
            }
          }
          if (timerId === undefined$1) {
            timerId = setTimeout2(timerExpired, wait);
          }
          return result2;
        }
        __name(debounced, "debounced");
        debounced.cancel = cancel;
        debounced.flush = flush;
        return debounced;
      }
      __name(debounce, "debounce");
      var defer = baseRest(function(func, args) {
        return baseDelay(func, 1, args);
      });
      var delay = baseRest(function(func, wait, args) {
        return baseDelay(func, toNumber2(wait) || 0, args);
      });
      function flip(func) {
        return createWrap(func, WRAP_FLIP_FLAG);
      }
      __name(flip, "flip");
      function memoize(func, resolver) {
        if (typeof func != "function" || resolver != null && typeof resolver != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        var memoized = /* @__PURE__ */ __name(function() {
          var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
          if (cache2.has(key)) {
            return cache2.get(key);
          }
          var result2 = func.apply(this, args);
          memoized.cache = cache2.set(key, result2) || cache2;
          return result2;
        }, "memoized");
        memoized.cache = new (memoize.Cache || MapCache)();
        return memoized;
      }
      __name(memoize, "memoize");
      memoize.Cache = MapCache;
      function negate(predicate) {
        if (typeof predicate != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        return function() {
          var args = arguments;
          switch (args.length) {
            case 0:
              return !predicate.call(this);
            case 1:
              return !predicate.call(this, args[0]);
            case 2:
              return !predicate.call(this, args[0], args[1]);
            case 3:
              return !predicate.call(this, args[0], args[1], args[2]);
          }
          return !predicate.apply(this, args);
        };
      }
      __name(negate, "negate");
      function once2(func) {
        return before(2, func);
      }
      __name(once2, "once");
      var overArgs = castRest(function(func, transforms) {
        transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
        var funcsLength = transforms.length;
        return baseRest(function(args) {
          var index2 = -1, length = nativeMin(args.length, funcsLength);
          while (++index2 < length) {
            args[index2] = transforms[index2].call(this, args[index2]);
          }
          return apply2(func, this, args);
        });
      });
      var partial = baseRest(function(func, partials) {
        var holders = replaceHolders(partials, getHolder(partial));
        return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders);
      });
      var partialRight = baseRest(function(func, partials) {
        var holders = replaceHolders(partials, getHolder(partialRight));
        return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders);
      });
      var rearg = flatRest(function(func, indexes) {
        return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes);
      });
      function rest(func, start2) {
        if (typeof func != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        start2 = start2 === undefined$1 ? start2 : toInteger(start2);
        return baseRest(func, start2);
      }
      __name(rest, "rest");
      function spread2(func, start2) {
        if (typeof func != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        start2 = start2 == null ? 0 : nativeMax(toInteger(start2), 0);
        return baseRest(function(args) {
          var array = args[start2], otherArgs = castSlice(args, 0, start2);
          if (array) {
            arrayPush(otherArgs, array);
          }
          return apply2(func, this, otherArgs);
        });
      }
      __name(spread2, "spread");
      function throttle2(func, wait, options4) {
        var leading = true, trailing = true;
        if (typeof func != "function") {
          throw new TypeError2(FUNC_ERROR_TEXT);
        }
        if (isObject2(options4)) {
          leading = "leading" in options4 ? !!options4.leading : leading;
          trailing = "trailing" in options4 ? !!options4.trailing : trailing;
        }
        return debounce(func, wait, {
          "leading": leading,
          "maxWait": wait,
          "trailing": trailing
        });
      }
      __name(throttle2, "throttle");
      function unary(func) {
        return ary(func, 1);
      }
      __name(unary, "unary");
      function wrap2(value4, wrapper) {
        return partial(castFunction(wrapper), value4);
      }
      __name(wrap2, "wrap");
      function castArray() {
        if (!arguments.length) {
          return [];
        }
        var value4 = arguments[0];
        return isArray2(value4) ? value4 : [value4];
      }
      __name(castArray, "castArray");
      function clone2(value4) {
        return baseClone(value4, CLONE_SYMBOLS_FLAG);
      }
      __name(clone2, "clone");
      function cloneWith(value4, customizer) {
        customizer = typeof customizer == "function" ? customizer : undefined$1;
        return baseClone(value4, CLONE_SYMBOLS_FLAG, customizer);
      }
      __name(cloneWith, "cloneWith");
      function cloneDeep(value4) {
        return baseClone(value4, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
      }
      __name(cloneDeep, "cloneDeep");
      function cloneDeepWith(value4, customizer) {
        customizer = typeof customizer == "function" ? customizer : undefined$1;
        return baseClone(value4, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
      }
      __name(cloneDeepWith, "cloneDeepWith");
      function conformsTo(object, source) {
        return source == null || baseConformsTo(object, source, keys2(source));
      }
      __name(conformsTo, "conformsTo");
      function eq(value4, other) {
        return value4 === other || value4 !== value4 && other !== other;
      }
      __name(eq, "eq");
      var gt2 = createRelationalOperation(baseGt);
      var gte2 = createRelationalOperation(function(value4, other) {
        return value4 >= other;
      });
      var isArguments = baseIsArguments(/* @__PURE__ */ function() {
        return arguments;
      }()) ? baseIsArguments : function(value4) {
        return isObjectLike2(value4) && hasOwnProperty2.call(value4, "callee") && !propertyIsEnumerable.call(value4, "callee");
      };
      var isArray2 = Array2.isArray;
      var isArrayBuffer2 = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
      function isArrayLike(value4) {
        return value4 != null && isLength(value4.length) && !isFunction2(value4);
      }
      __name(isArrayLike, "isArrayLike");
      function isArrayLikeObject(value4) {
        return isObjectLike2(value4) && isArrayLike(value4);
      }
      __name(isArrayLikeObject, "isArrayLikeObject");
      function isBoolean2(value4) {
        return value4 === true || value4 === false || isObjectLike2(value4) && baseGetTag(value4) == boolTag;
      }
      __name(isBoolean2, "isBoolean");
      var isBuffer2 = nativeIsBuffer || stubFalse;
      var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
      function isElement2(value4) {
        return isObjectLike2(value4) && value4.nodeType === 1 && !isPlainObject2(value4);
      }
      __name(isElement2, "isElement");
      function isEmpty3(value4) {
        if (value4 == null) {
          return true;
        }
        if (isArrayLike(value4) && (isArray2(value4) || typeof value4 == "string" || typeof value4.splice == "function" || isBuffer2(value4) || isTypedArray2(value4) || isArguments(value4))) {
          return !value4.length;
        }
        var tag = getTag2(value4);
        if (tag == mapTag || tag == setTag) {
          return !value4.size;
        }
        if (isPrototype(value4)) {
          return !baseKeys(value4).length;
        }
        for (var key in value4) {
          if (hasOwnProperty2.call(value4, key)) {
            return false;
          }
        }
        return true;
      }
      __name(isEmpty3, "isEmpty");
      function isEqual(value4, other) {
        return baseIsEqual(value4, other);
      }
      __name(isEqual, "isEqual");
      function isEqualWith(value4, other, customizer) {
        customizer = typeof customizer == "function" ? customizer : undefined$1;
        var result2 = customizer ? customizer(value4, other) : undefined$1;
        return result2 === undefined$1 ? baseIsEqual(value4, other, undefined$1, customizer) : !!result2;
      }
      __name(isEqualWith, "isEqualWith");
      function isError(value4) {
        if (!isObjectLike2(value4)) {
          return false;
        }
        var tag = baseGetTag(value4);
        return tag == errorTag || tag == domExcTag || typeof value4.message == "string" && typeof value4.name == "string" && !isPlainObject2(value4);
      }
      __name(isError, "isError");
      function isFinite2(value4) {
        return typeof value4 == "number" && nativeIsFinite(value4);
      }
      __name(isFinite2, "isFinite");
      function isFunction2(value4) {
        if (!isObject2(value4)) {
          return false;
        }
        var tag = baseGetTag(value4);
        return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
      }
      __name(isFunction2, "isFunction");
      function isInteger(value4) {
        return typeof value4 == "number" && value4 == toInteger(value4);
      }
      __name(isInteger, "isInteger");
      function isLength(value4) {
        return typeof value4 == "number" && value4 > -1 && value4 % 1 == 0 && value4 <= MAX_SAFE_INTEGER;
      }
      __name(isLength, "isLength");
      function isObject2(value4) {
        var type = typeof value4;
        return value4 != null && (type == "object" || type == "function");
      }
      __name(isObject2, "isObject");
      function isObjectLike2(value4) {
        return value4 != null && typeof value4 == "object";
      }
      __name(isObjectLike2, "isObjectLike");
      var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
      function isMatch(object, source) {
        return object === source || baseIsMatch(object, source, getMatchData(source));
      }
      __name(isMatch, "isMatch");
      function isMatchWith(object, source, customizer) {
        customizer = typeof customizer == "function" ? customizer : undefined$1;
        return baseIsMatch(object, source, getMatchData(source), customizer);
      }
      __name(isMatchWith, "isMatchWith");
      function isNaN2(value4) {
        return isNumber2(value4) && value4 != +value4;
      }
      __name(isNaN2, "isNaN");
      function isNative(value4) {
        if (isMaskable(value4)) {
          throw new Error2(CORE_ERROR_TEXT);
        }
        return baseIsNative(value4);
      }
      __name(isNative, "isNative");
      function isNull(value4) {
        return value4 === null;
      }
      __name(isNull, "isNull");
      function isNil(value4) {
        return value4 == null;
      }
      __name(isNil, "isNil");
      function isNumber2(value4) {
        return typeof value4 == "number" || isObjectLike2(value4) && baseGetTag(value4) == numberTag;
      }
      __name(isNumber2, "isNumber");
      function isPlainObject2(value4) {
        if (!isObjectLike2(value4) || baseGetTag(value4) != objectTag) {
          return false;
        }
        var proto = getPrototype(value4);
        if (proto === null) {
          return true;
        }
        var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor;
        return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
      }
      __name(isPlainObject2, "isPlainObject");
      var isRegExp2 = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
      function isSafeInteger(value4) {
        return isInteger(value4) && value4 >= -MAX_SAFE_INTEGER && value4 <= MAX_SAFE_INTEGER;
      }
      __name(isSafeInteger, "isSafeInteger");
      var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
      function isString2(value4) {
        return typeof value4 == "string" || !isArray2(value4) && isObjectLike2(value4) && baseGetTag(value4) == stringTag;
      }
      __name(isString2, "isString");
      function isSymbol2(value4) {
        return typeof value4 == "symbol" || isObjectLike2(value4) && baseGetTag(value4) == symbolTag;
      }
      __name(isSymbol2, "isSymbol");
      var isTypedArray2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
      function isUndefined2(value4) {
        return value4 === undefined$1;
      }
      __name(isUndefined2, "isUndefined");
      function isWeakMap(value4) {
        return isObjectLike2(value4) && getTag2(value4) == weakMapTag;
      }
      __name(isWeakMap, "isWeakMap");
      function isWeakSet(value4) {
        return isObjectLike2(value4) && baseGetTag(value4) == weakSetTag;
      }
      __name(isWeakSet, "isWeakSet");
      var lt2 = createRelationalOperation(baseLt);
      var lte2 = createRelationalOperation(function(value4, other) {
        return value4 <= other;
      });
      function toArray2(value4) {
        if (!value4) {
          return [];
        }
        if (isArrayLike(value4)) {
          return isString2(value4) ? stringToArray2(value4) : copyArray(value4);
        }
        if (symIterator && value4[symIterator]) {
          return iteratorToArray(value4[symIterator]());
        }
        var tag = getTag2(value4), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
        return func(value4);
      }
      __name(toArray2, "toArray");
      function toFinite(value4) {
        if (!value4) {
          return value4 === 0 ? value4 : 0;
        }
        value4 = toNumber2(value4);
        if (value4 === INFINITY2 || value4 === -INFINITY2) {
          var sign = value4 < 0 ? -1 : 1;
          return sign * MAX_INTEGER;
        }
        return value4 === value4 ? value4 : 0;
      }
      __name(toFinite, "toFinite");
      function toInteger(value4) {
        var result2 = toFinite(value4), remainder = result2 % 1;
        return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
      }
      __name(toInteger, "toInteger");
      function toLength(value4) {
        return value4 ? baseClamp(toInteger(value4), 0, MAX_ARRAY_LENGTH) : 0;
      }
      __name(toLength, "toLength");
      function toNumber2(value4) {
        if (typeof value4 == "number") {
          return value4;
        }
        if (isSymbol2(value4)) {
          return NAN;
        }
        if (isObject2(value4)) {
          var other = typeof value4.valueOf == "function" ? value4.valueOf() : value4;
          value4 = isObject2(other) ? other + "" : other;
        }
        if (typeof value4 != "string") {
          return value4 === 0 ? value4 : +value4;
        }
        value4 = baseTrim(value4);
        var isBinary = reIsBinary.test(value4);
        return isBinary || reIsOctal.test(value4) ? freeParseInt(value4.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value4) ? NAN : +value4;
      }
      __name(toNumber2, "toNumber");
      function toPlainObject(value4) {
        return copyObject(value4, keysIn(value4));
      }
      __name(toPlainObject, "toPlainObject");
      function toSafeInteger(value4) {
        return value4 ? baseClamp(toInteger(value4), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value4 === 0 ? value4 : 0;
      }
      __name(toSafeInteger, "toSafeInteger");
      function toString3(value4) {
        return value4 == null ? "" : baseToString2(value4);
      }
      __name(toString3, "toString");
      var assign2 = createAssigner(function(object, source) {
        if (isPrototype(source) || isArrayLike(source)) {
          copyObject(source, keys2(source), object);
          return;
        }
        for (var key in source) {
          if (hasOwnProperty2.call(source, key)) {
            assignValue(object, key, source[key]);
          }
        }
      });
      var assignIn = createAssigner(function(object, source) {
        copyObject(source, keysIn(source), object);
      });
      var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
        copyObject(source, keysIn(source), object, customizer);
      });
      var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
        copyObject(source, keys2(source), object, customizer);
      });
      var at = flatRest(baseAt);
      function create3(prototype2, properties) {
        var result2 = baseCreate(prototype2);
        return properties == null ? result2 : baseAssign(result2, properties);
      }
      __name(create3, "create");
      var defaults2 = baseRest(function(object, sources) {
        object = Object2(object);
        var index2 = -1;
        var length = sources.length;
        var guard = length > 2 ? sources[2] : undefined$1;
        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          length = 1;
        }
        while (++index2 < length) {
          var source = sources[index2];
          var props = keysIn(source);
          var propsIndex = -1;
          var propsLength = props.length;
          while (++propsIndex < propsLength) {
            var key = props[propsIndex];
            var value4 = object[key];
            if (value4 === undefined$1 || eq(value4, objectProto[key]) && !hasOwnProperty2.call(object, key)) {
              object[key] = source[key];
            }
          }
        }
        return object;
      });
      var defaultsDeep = baseRest(function(args) {
        args.push(undefined$1, customDefaultsMerge);
        return apply2(mergeWith, undefined$1, args);
      });
      function findKey2(object, predicate) {
        return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
      }
      __name(findKey2, "findKey");
      function findLastKey(object, predicate) {
        return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
      }
      __name(findLastKey, "findLastKey");
      function forIn(object, iteratee2) {
        return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
      }
      __name(forIn, "forIn");
      function forInRight(object, iteratee2) {
        return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
      }
      __name(forInRight, "forInRight");
      function forOwn(object, iteratee2) {
        return object && baseForOwn(object, getIteratee(iteratee2, 3));
      }
      __name(forOwn, "forOwn");
      function forOwnRight(object, iteratee2) {
        return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
      }
      __name(forOwnRight, "forOwnRight");
      function functions(object) {
        return object == null ? [] : baseFunctions(object, keys2(object));
      }
      __name(functions, "functions");
      function functionsIn(object) {
        return object == null ? [] : baseFunctions(object, keysIn(object));
      }
      __name(functionsIn, "functionsIn");
      function get3(object, path, defaultValue) {
        var result2 = object == null ? undefined$1 : baseGet(object, path);
        return result2 === undefined$1 ? defaultValue : result2;
      }
      __name(get3, "get");
      function has2(object, path) {
        return object != null && hasPath(object, path, baseHas);
      }
      __name(has2, "has");
      function hasIn(object, path) {
        return object != null && hasPath(object, path, baseHasIn);
      }
      __name(hasIn, "hasIn");
      var invert = createInverter(function(result2, value4, key) {
        if (value4 != null && typeof value4.toString != "function") {
          value4 = nativeObjectToString.call(value4);
        }
        result2[value4] = key;
      }, constant(identity2));
      var invertBy = createInverter(function(result2, value4, key) {
        if (value4 != null && typeof value4.toString != "function") {
          value4 = nativeObjectToString.call(value4);
        }
        if (hasOwnProperty2.call(result2, value4)) {
          result2[value4].push(key);
        } else {
          result2[value4] = [key];
        }
      }, getIteratee);
      var invoke2 = baseRest(baseInvoke);
      function keys2(object) {
        return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
      }
      __name(keys2, "keys");
      function keysIn(object) {
        return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
      }
      __name(keysIn, "keysIn");
      function mapKeys(object, iteratee2) {
        var result2 = {};
        iteratee2 = getIteratee(iteratee2, 3);
        baseForOwn(object, function(value4, key, object2) {
          baseAssignValue(result2, iteratee2(value4, key, object2), value4);
        });
        return result2;
      }
      __name(mapKeys, "mapKeys");
      function mapValues(object, iteratee2) {
        var result2 = {};
        iteratee2 = getIteratee(iteratee2, 3);
        baseForOwn(object, function(value4, key, object2) {
          baseAssignValue(result2, key, iteratee2(value4, key, object2));
        });
        return result2;
      }
      __name(mapValues, "mapValues");
      var merge2 = createAssigner(function(object, source, srcIndex) {
        baseMerge(object, source, srcIndex);
      });
      var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
        baseMerge(object, source, srcIndex, customizer);
      });
      var omit2 = flatRest(function(object, paths) {
        var result2 = {};
        if (object == null) {
          return result2;
        }
        var isDeep = false;
        paths = arrayMap(paths, function(path) {
          path = castPath(path, object);
          isDeep || (isDeep = path.length > 1);
          return path;
        });
        copyObject(object, getAllKeysIn(object), result2);
        if (isDeep) {
          result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
        }
        var length = paths.length;
        while (length--) {
          baseUnset(result2, paths[length]);
        }
        return result2;
      });
      function omitBy(object, predicate) {
        return pickBy(object, negate(getIteratee(predicate)));
      }
      __name(omitBy, "omitBy");
      var pick = flatRest(function(object, paths) {
        return object == null ? {} : basePick(object, paths);
      });
      function pickBy(object, predicate) {
        if (object == null) {
          return {};
        }
        var props = arrayMap(getAllKeysIn(object), function(prop2) {
          return [prop2];
        });
        predicate = getIteratee(predicate);
        return basePickBy(object, props, function(value4, path) {
          return predicate(value4, path[0]);
        });
      }
      __name(pickBy, "pickBy");
      function result(object, path, defaultValue) {
        path = castPath(path, object);
        var index2 = -1, length = path.length;
        if (!length) {
          length = 1;
          object = undefined$1;
        }
        while (++index2 < length) {
          var value4 = object == null ? undefined$1 : object[toKey(path[index2])];
          if (value4 === undefined$1) {
            index2 = length;
            value4 = defaultValue;
          }
          object = isFunction2(value4) ? value4.call(object) : value4;
        }
        return object;
      }
      __name(result, "result");
      function set3(object, path, value4) {
        return object == null ? object : baseSet(object, path, value4);
      }
      __name(set3, "set");
      function setWith(object, path, value4, customizer) {
        customizer = typeof customizer == "function" ? customizer : undefined$1;
        return object == null ? object : baseSet(object, path, value4, customizer);
      }
      __name(setWith, "setWith");
      var toPairs = createToPairs(keys2);
      var toPairsIn = createToPairs(keysIn);
      function transform2(object, iteratee2, accumulator) {
        var isArr = isArray2(object), isArrLike = isArr || isBuffer2(object) || isTypedArray2(object);
        iteratee2 = getIteratee(iteratee2, 4);
        if (accumulator == null) {
          var Ctor = object && object.constructor;
          if (isArrLike) {
            accumulator = isArr ? new Ctor() : [];
          } else if (isObject2(object)) {
            accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {};
          } else {
            accumulator = {};
          }
        }
        (isArrLike ? arrayEach : baseForOwn)(object, function(value4, index2, object2) {
          return iteratee2(accumulator, value4, index2, object2);
        });
        return accumulator;
      }
      __name(transform2, "transform");
      function unset(object, path) {
        return object == null ? true : baseUnset(object, path);
      }
      __name(unset, "unset");
      function update(object, path, updater) {
        return object == null ? object : baseUpdate(object, path, castFunction(updater));
      }
      __name(update, "update");
      function updateWith(object, path, updater, customizer) {
        customizer = typeof customizer == "function" ? customizer : undefined$1;
        return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
      }
      __name(updateWith, "updateWith");
      function values(object) {
        return object == null ? [] : baseValues(object, keys2(object));
      }
      __name(values, "values");
      function valuesIn(object) {
        return object == null ? [] : baseValues(object, keysIn(object));
      }
      __name(valuesIn, "valuesIn");
      function clamp2(number2, lower, upper) {
        if (upper === undefined$1) {
          upper = lower;
          lower = undefined$1;
        }
        if (upper !== undefined$1) {
          upper = toNumber2(upper);
          upper = upper === upper ? upper : 0;
        }
        if (lower !== undefined$1) {
          lower = toNumber2(lower);
          lower = lower === lower ? lower : 0;
        }
        return baseClamp(toNumber2(number2), lower, upper);
      }
      __name(clamp2, "clamp");
      function inRange(number2, start2, end) {
        start2 = toFinite(start2);
        if (end === undefined$1) {
          end = start2;
          start2 = 0;
        } else {
          end = toFinite(end);
        }
        number2 = toNumber2(number2);
        return baseInRange(number2, start2, end);
      }
      __name(inRange, "inRange");
      function random(lower, upper, floating) {
        if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
          upper = floating = undefined$1;
        }
        if (floating === undefined$1) {
          if (typeof upper == "boolean") {
            floating = upper;
            upper = undefined$1;
          } else if (typeof lower == "boolean") {
            floating = lower;
            lower = undefined$1;
          }
        }
        if (lower === undefined$1 && upper === undefined$1) {
          lower = 0;
          upper = 1;
        } else {
          lower = toFinite(lower);
          if (upper === undefined$1) {
            upper = lower;
            lower = 0;
          } else {
            upper = toFinite(upper);
          }
        }
        if (lower > upper) {
          var temp = lower;
          lower = upper;
          upper = temp;
        }
        if (floating || lower % 1 || upper % 1) {
          var rand2 = nativeRandom();
          return nativeMin(lower + rand2 * (upper - lower + freeParseFloat("1e-" + ((rand2 + "").length - 1))), upper);
        }
        return baseRandom(lower, upper);
      }
      __name(random, "random");
      var camelCase = createCompounder(function(result2, word, index2) {
        word = word.toLowerCase();
        return result2 + (index2 ? capitalize2(word) : word);
      });
      function capitalize2(string) {
        return upperFirst(toString3(string).toLowerCase());
      }
      __name(capitalize2, "capitalize");
      function deburr(string) {
        string = toString3(string);
        return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
      }
      __name(deburr, "deburr");
      function endsWith3(string, target, position3) {
        string = toString3(string);
        target = baseToString2(target);
        var length = string.length;
        position3 = position3 === undefined$1 ? length : baseClamp(toInteger(position3), 0, length);
        var end = position3;
        position3 -= target.length;
        return position3 >= 0 && string.slice(position3, end) == target;
      }
      __name(endsWith3, "endsWith");
      function escape2(string) {
        string = toString3(string);
        return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
      }
      __name(escape2, "escape");
      function escapeRegExp2(string) {
        string = toString3(string);
        return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
      }
      __name(escapeRegExp2, "escapeRegExp");
      var kebabCase = createCompounder(function(result2, word, index2) {
        return result2 + (index2 ? "-" : "") + word.toLowerCase();
      });
      var lowerCase = createCompounder(function(result2, word, index2) {
        return result2 + (index2 ? " " : "") + word.toLowerCase();
      });
      var lowerFirst = createCaseFirst("toLowerCase");
      function pad(string, length, chars) {
        string = toString3(string);
        length = toInteger(length);
        var strLength = length ? stringSize(string) : 0;
        if (!length || strLength >= length) {
          return string;
        }
        var mid = (length - strLength) / 2;
        return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
      }
      __name(pad, "pad");
      function padEnd(string, length, chars) {
        string = toString3(string);
        length = toInteger(length);
        var strLength = length ? stringSize(string) : 0;
        return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
      }
      __name(padEnd, "padEnd");
      function padStart(string, length, chars) {
        string = toString3(string);
        length = toInteger(length);
        var strLength = length ? stringSize(string) : 0;
        return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
      }
      __name(padStart, "padStart");
      function parseInt2(string, radix, guard) {
        if (guard || radix == null) {
          radix = 0;
        } else if (radix) {
          radix = +radix;
        }
        return nativeParseInt(toString3(string).replace(reTrimStart, ""), radix || 0);
      }
      __name(parseInt2, "parseInt");
      function repeat3(string, n, guard) {
        if (guard ? isIterateeCall(string, n, guard) : n === undefined$1) {
          n = 1;
        } else {
          n = toInteger(n);
        }
        return baseRepeat(toString3(string), n);
      }
      __name(repeat3, "repeat");
      function replace2() {
        var args = arguments, string = toString3(args[0]);
        return args.length < 3 ? string : string.replace(args[1], args[2]);
      }
      __name(replace2, "replace");
      var snakeCase = createCompounder(function(result2, word, index2) {
        return result2 + (index2 ? "_" : "") + word.toLowerCase();
      });
      function split2(string, separator, limit) {
        if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
          separator = limit = undefined$1;
        }
        limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0;
        if (!limit) {
          return [];
        }
        string = toString3(string);
        if (string && (typeof separator == "string" || separator != null && !isRegExp2(separator))) {
          separator = baseToString2(separator);
          if (!separator && hasUnicode(string)) {
            return castSlice(stringToArray2(string), 0, limit);
          }
        }
        return string.split(separator, limit);
      }
      __name(split2, "split");
      var startCase = createCompounder(function(result2, word, index2) {
        return result2 + (index2 ? " " : "") + upperFirst(word);
      });
      function startsWith2(string, target, position3) {
        string = toString3(string);
        position3 = position3 == null ? 0 : baseClamp(toInteger(position3), 0, string.length);
        target = baseToString2(target);
        return string.slice(position3, position3 + target.length) == target;
      }
      __name(startsWith2, "startsWith");
      function template(string, options4, guard) {
        var settings = lodash2.templateSettings;
        if (guard && isIterateeCall(string, options4, guard)) {
          options4 = undefined$1;
        }
        string = toString3(string);
        options4 = assignInWith({}, options4, settings, customDefaultsAssignIn);
        var imports = assignInWith({}, options4.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys2(imports), importsValues = baseValues(imports, importsKeys);
        var isEscaping, isEvaluating, index2 = 0, interpolate = options4.interpolate || reNoMatch, source = "__p += '";
        var reDelimiters = RegExp2(
          (options4.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options4.evaluate || reNoMatch).source + "|$",
          "g"
        );
        var sourceURL = "//# sourceURL=" + (hasOwnProperty2.call(options4, "sourceURL") ? (options4.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
        string.replace(reDelimiters, function(match2, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
          interpolateValue || (interpolateValue = esTemplateValue);
          source += string.slice(index2, offset).replace(reUnescapedString, escapeStringChar);
          if (escapeValue) {
            isEscaping = true;
            source += "' +\n__e(" + escapeValue + ") +\n'";
          }
          if (evaluateValue) {
            isEvaluating = true;
            source += "';\n" + evaluateValue + ";\n__p += '";
          }
          if (interpolateValue) {
            source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
          }
          index2 = offset + match2.length;
          return match2;
        });
        source += "';\n";
        var variable = hasOwnProperty2.call(options4, "variable") && options4.variable;
        if (!variable) {
          source = "with (obj) {\n" + source + "\n}\n";
        } else if (reForbiddenIdentifierChars.test(variable)) {
          throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
        }
        source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
        source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
        var result2 = attempt(function() {
          return Function2(importsKeys, sourceURL + "return " + source).apply(undefined$1, importsValues);
        });
        result2.source = source;
        if (isError(result2)) {
          throw result2;
        }
        return result2;
      }
      __name(template, "template");
      function toLower(value4) {
        return toString3(value4).toLowerCase();
      }
      __name(toLower, "toLower");
      function toUpper(value4) {
        return toString3(value4).toUpperCase();
      }
      __name(toUpper, "toUpper");
      function trim2(string, chars, guard) {
        string = toString3(string);
        if (string && (guard || chars === undefined$1)) {
          return baseTrim(string);
        }
        if (!string || !(chars = baseToString2(chars))) {
          return string;
        }
        var strSymbols = stringToArray2(string), chrSymbols = stringToArray2(chars), start2 = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
        return castSlice(strSymbols, start2, end).join("");
      }
      __name(trim2, "trim");
      function trimEnd2(string, chars, guard) {
        string = toString3(string);
        if (string && (guard || chars === undefined$1)) {
          return string.slice(0, trimmedEndIndex(string) + 1);
        }
        if (!string || !(chars = baseToString2(chars))) {
          return string;
        }
        var strSymbols = stringToArray2(string), end = charsEndIndex(strSymbols, stringToArray2(chars)) + 1;
        return castSlice(strSymbols, 0, end).join("");
      }
      __name(trimEnd2, "trimEnd");
      function trimStart2(string, chars, guard) {
        string = toString3(string);
        if (string && (guard || chars === undefined$1)) {
          return string.replace(reTrimStart, "");
        }
        if (!string || !(chars = baseToString2(chars))) {
          return string;
        }
        var strSymbols = stringToArray2(string), start2 = charsStartIndex(strSymbols, stringToArray2(chars));
        return castSlice(strSymbols, start2).join("");
      }
      __name(trimStart2, "trimStart");
      function truncate(string, options4) {
        var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
        if (isObject2(options4)) {
          var separator = "separator" in options4 ? options4.separator : separator;
          length = "length" in options4 ? toInteger(options4.length) : length;
          omission = "omission" in options4 ? baseToString2(options4.omission) : omission;
        }
        string = toString3(string);
        var strLength = string.length;
        if (hasUnicode(string)) {
          var strSymbols = stringToArray2(string);
          strLength = strSymbols.length;
        }
        if (length >= strLength) {
          return string;
        }
        var end = length - stringSize(omission);
        if (end < 1) {
          return omission;
        }
        var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
        if (separator === undefined$1) {
          return result2 + omission;
        }
        if (strSymbols) {
          end += result2.length - end;
        }
        if (isRegExp2(separator)) {
          if (string.slice(end).search(separator)) {
            var match2, substring = result2;
            if (!separator.global) {
              separator = RegExp2(separator.source, toString3(reFlags.exec(separator)) + "g");
            }
            separator.lastIndex = 0;
            while (match2 = separator.exec(substring)) {
              var newEnd = match2.index;
            }
            result2 = result2.slice(0, newEnd === undefined$1 ? end : newEnd);
          }
        } else if (string.indexOf(baseToString2(separator), end) != end) {
          var index2 = result2.lastIndexOf(separator);
          if (index2 > -1) {
            result2 = result2.slice(0, index2);
          }
        }
        return result2 + omission;
      }
      __name(truncate, "truncate");
      function unescape2(string) {
        string = toString3(string);
        return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
      }
      __name(unescape2, "unescape");
      var upperCase = createCompounder(function(result2, word, index2) {
        return result2 + (index2 ? " " : "") + word.toUpperCase();
      });
      var upperFirst = createCaseFirst("toUpperCase");
      function words(string, pattern, guard) {
        string = toString3(string);
        pattern = guard ? undefined$1 : pattern;
        if (pattern === undefined$1) {
          return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
        }
        return string.match(pattern) || [];
      }
      __name(words, "words");
      var attempt = baseRest(function(func, args) {
        try {
          return apply2(func, undefined$1, args);
        } catch (e2) {
          return isError(e2) ? e2 : new Error2(e2);
        }
      });
      var bindAll2 = flatRest(function(object, methodNames) {
        arrayEach(methodNames, function(key) {
          key = toKey(key);
          baseAssignValue(object, key, bind3(object[key], object));
        });
        return object;
      });
      function cond(pairs) {
        var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
        pairs = !length ? [] : arrayMap(pairs, function(pair) {
          if (typeof pair[1] != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          return [toIteratee(pair[0]), pair[1]];
        });
        return baseRest(function(args) {
          var index2 = -1;
          while (++index2 < length) {
            var pair = pairs[index2];
            if (apply2(pair[0], this, args)) {
              return apply2(pair[1], this, args);
            }
          }
        });
      }
      __name(cond, "cond");
      function conforms(source) {
        return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
      }
      __name(conforms, "conforms");
      function constant(value4) {
        return function() {
          return value4;
        };
      }
      __name(constant, "constant");
      function defaultTo(value4, defaultValue) {
        return value4 == null || value4 !== value4 ? defaultValue : value4;
      }
      __name(defaultTo, "defaultTo");
      var flow = createFlow();
      var flowRight = createFlow(true);
      function identity2(value4) {
        return value4;
      }
      __name(identity2, "identity");
      function iteratee(func) {
        return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
      }
      __name(iteratee, "iteratee");
      function matches2(source) {
        return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
      }
      __name(matches2, "matches");
      function matchesProperty(path, srcValue) {
        return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
      }
      __name(matchesProperty, "matchesProperty");
      var method = baseRest(function(path, args) {
        return function(object) {
          return baseInvoke(object, path, args);
        };
      });
      var methodOf = baseRest(function(object, args) {
        return function(path) {
          return baseInvoke(object, path, args);
        };
      });
      function mixin(object, source, options4) {
        var props = keys2(source), methodNames = baseFunctions(source, props);
        if (options4 == null && !(isObject2(source) && (methodNames.length || !props.length))) {
          options4 = source;
          source = object;
          object = this;
          methodNames = baseFunctions(source, keys2(source));
        }
        var chain2 = !(isObject2(options4) && "chain" in options4) || !!options4.chain, isFunc = isFunction2(object);
        arrayEach(methodNames, function(methodName) {
          var func = source[methodName];
          object[methodName] = func;
          if (isFunc) {
            object.prototype[methodName] = function() {
              var chainAll = this.__chain__;
              if (chain2 || chainAll) {
                var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
                actions.push({ "func": func, "args": arguments, "thisArg": object });
                result2.__chain__ = chainAll;
                return result2;
              }
              return func.apply(object, arrayPush([this.value()], arguments));
            };
          }
        });
        return object;
      }
      __name(mixin, "mixin");
      function noConflict() {
        if (root24._ === this) {
          root24._ = oldDash;
        }
        return this;
      }
      __name(noConflict, "noConflict");
      function noop2() {
      }
      __name(noop2, "noop");
      function nthArg(n) {
        n = toInteger(n);
        return baseRest(function(args) {
          return baseNth(args, n);
        });
      }
      __name(nthArg, "nthArg");
      var over = createOver(arrayMap);
      var overEvery = createOver(arrayEvery);
      var overSome = createOver(arraySome);
      function property(path) {
        return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
      }
      __name(property, "property");
      function propertyOf(object) {
        return function(path) {
          return object == null ? undefined$1 : baseGet(object, path);
        };
      }
      __name(propertyOf, "propertyOf");
      var range2 = createRange();
      var rangeRight = createRange(true);
      function stubArray() {
        return [];
      }
      __name(stubArray, "stubArray");
      function stubFalse() {
        return false;
      }
      __name(stubFalse, "stubFalse");
      function stubObject() {
        return {};
      }
      __name(stubObject, "stubObject");
      function stubString() {
        return "";
      }
      __name(stubString, "stubString");
      function stubTrue() {
        return true;
      }
      __name(stubTrue, "stubTrue");
      function times(n, iteratee2) {
        n = toInteger(n);
        if (n < 1 || n > MAX_SAFE_INTEGER) {
          return [];
        }
        var index2 = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
        iteratee2 = getIteratee(iteratee2);
        n -= MAX_ARRAY_LENGTH;
        var result2 = baseTimes(length, iteratee2);
        while (++index2 < n) {
          iteratee2(index2);
        }
        return result2;
      }
      __name(times, "times");
      function toPath(value4) {
        if (isArray2(value4)) {
          return arrayMap(value4, toKey);
        }
        return isSymbol2(value4) ? [value4] : copyArray(stringToPath(toString3(value4)));
      }
      __name(toPath, "toPath");
      function uniqueId(prefix2) {
        var id3 = ++idCounter;
        return toString3(prefix2) + id3;
      }
      __name(uniqueId, "uniqueId");
      var add3 = createMathOperation(function(augend, addend) {
        return augend + addend;
      }, 0);
      var ceil = createRound("ceil");
      var divide = createMathOperation(function(dividend, divisor) {
        return dividend / divisor;
      }, 1);
      var floor2 = createRound("floor");
      function max(array) {
        return array && array.length ? baseExtremum(array, identity2, baseGt) : undefined$1;
      }
      __name(max, "max");
      function maxBy(array, iteratee2) {
        return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined$1;
      }
      __name(maxBy, "maxBy");
      function mean(array) {
        return baseMean(array, identity2);
      }
      __name(mean, "mean");
      function meanBy(array, iteratee2) {
        return baseMean(array, getIteratee(iteratee2, 2));
      }
      __name(meanBy, "meanBy");
      function min(array) {
        return array && array.length ? baseExtremum(array, identity2, baseLt) : undefined$1;
      }
      __name(min, "min");
      function minBy(array, iteratee2) {
        return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined$1;
      }
      __name(minBy, "minBy");
      var multiply = createMathOperation(function(multiplier, multiplicand) {
        return multiplier * multiplicand;
      }, 1);
      var round = createRound("round");
      var subtract = createMathOperation(function(minuend, subtrahend) {
        return minuend - subtrahend;
      }, 0);
      function sum(array) {
        return array && array.length ? baseSum(array, identity2) : 0;
      }
      __name(sum, "sum");
      function sumBy(array, iteratee2) {
        return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
      }
      __name(sumBy, "sumBy");
      lodash2.after = after;
      lodash2.ary = ary;
      lodash2.assign = assign2;
      lodash2.assignIn = assignIn;
      lodash2.assignInWith = assignInWith;
      lodash2.assignWith = assignWith;
      lodash2.at = at;
      lodash2.before = before;
      lodash2.bind = bind3;
      lodash2.bindAll = bindAll2;
      lodash2.bindKey = bindKey;
      lodash2.castArray = castArray;
      lodash2.chain = chain;
      lodash2.chunk = chunk;
      lodash2.compact = compact;
      lodash2.concat = concat;
      lodash2.cond = cond;
      lodash2.conforms = conforms;
      lodash2.constant = constant;
      lodash2.countBy = countBy;
      lodash2.create = create3;
      lodash2.curry = curry;
      lodash2.curryRight = curryRight;
      lodash2.debounce = debounce;
      lodash2.defaults = defaults2;
      lodash2.defaultsDeep = defaultsDeep;
      lodash2.defer = defer;
      lodash2.delay = delay;
      lodash2.difference = difference;
      lodash2.differenceBy = differenceBy;
      lodash2.differenceWith = differenceWith;
      lodash2.drop = drop;
      lodash2.dropRight = dropRight;
      lodash2.dropRightWhile = dropRightWhile;
      lodash2.dropWhile = dropWhile;
      lodash2.fill = fill;
      lodash2.filter = filter4;
      lodash2.flatMap = flatMap;
      lodash2.flatMapDeep = flatMapDeep;
      lodash2.flatMapDepth = flatMapDepth;
      lodash2.flatten = flatten;
      lodash2.flattenDeep = flattenDeep;
      lodash2.flattenDepth = flattenDepth;
      lodash2.flip = flip;
      lodash2.flow = flow;
      lodash2.flowRight = flowRight;
      lodash2.fromPairs = fromPairs;
      lodash2.functions = functions;
      lodash2.functionsIn = functionsIn;
      lodash2.groupBy = groupBy;
      lodash2.initial = initial;
      lodash2.intersection = intersection;
      lodash2.intersectionBy = intersectionBy;
      lodash2.intersectionWith = intersectionWith;
      lodash2.invert = invert;
      lodash2.invertBy = invertBy;
      lodash2.invokeMap = invokeMap;
      lodash2.iteratee = iteratee;
      lodash2.keyBy = keyBy;
      lodash2.keys = keys2;
      lodash2.keysIn = keysIn;
      lodash2.map = map3;
      lodash2.mapKeys = mapKeys;
      lodash2.mapValues = mapValues;
      lodash2.matches = matches2;
      lodash2.matchesProperty = matchesProperty;
      lodash2.memoize = memoize;
      lodash2.merge = merge2;
      lodash2.mergeWith = mergeWith;
      lodash2.method = method;
      lodash2.methodOf = methodOf;
      lodash2.mixin = mixin;
      lodash2.negate = negate;
      lodash2.nthArg = nthArg;
      lodash2.omit = omit2;
      lodash2.omitBy = omitBy;
      lodash2.once = once2;
      lodash2.orderBy = orderBy;
      lodash2.over = over;
      lodash2.overArgs = overArgs;
      lodash2.overEvery = overEvery;
      lodash2.overSome = overSome;
      lodash2.partial = partial;
      lodash2.partialRight = partialRight;
      lodash2.partition = partition;
      lodash2.pick = pick;
      lodash2.pickBy = pickBy;
      lodash2.property = property;
      lodash2.propertyOf = propertyOf;
      lodash2.pull = pull;
      lodash2.pullAll = pullAll;
      lodash2.pullAllBy = pullAllBy;
      lodash2.pullAllWith = pullAllWith;
      lodash2.pullAt = pullAt;
      lodash2.range = range2;
      lodash2.rangeRight = rangeRight;
      lodash2.rearg = rearg;
      lodash2.reject = reject3;
      lodash2.remove = remove4;
      lodash2.rest = rest;
      lodash2.reverse = reverse2;
      lodash2.sampleSize = sampleSize;
      lodash2.set = set3;
      lodash2.setWith = setWith;
      lodash2.shuffle = shuffle;
      lodash2.slice = slice2;
      lodash2.sortBy = sortBy;
      lodash2.sortedUniq = sortedUniq;
      lodash2.sortedUniqBy = sortedUniqBy;
      lodash2.split = split2;
      lodash2.spread = spread2;
      lodash2.tail = tail;
      lodash2.take = take;
      lodash2.takeRight = takeRight;
      lodash2.takeRightWhile = takeRightWhile;
      lodash2.takeWhile = takeWhile;
      lodash2.tap = tap;
      lodash2.throttle = throttle2;
      lodash2.thru = thru;
      lodash2.toArray = toArray2;
      lodash2.toPairs = toPairs;
      lodash2.toPairsIn = toPairsIn;
      lodash2.toPath = toPath;
      lodash2.toPlainObject = toPlainObject;
      lodash2.transform = transform2;
      lodash2.unary = unary;
      lodash2.union = union;
      lodash2.unionBy = unionBy;
      lodash2.unionWith = unionWith;
      lodash2.uniq = uniq2;
      lodash2.uniqBy = uniqBy;
      lodash2.uniqWith = uniqWith;
      lodash2.unset = unset;
      lodash2.unzip = unzip;
      lodash2.unzipWith = unzipWith;
      lodash2.update = update;
      lodash2.updateWith = updateWith;
      lodash2.values = values;
      lodash2.valuesIn = valuesIn;
      lodash2.without = without;
      lodash2.words = words;
      lodash2.wrap = wrap2;
      lodash2.xor = xor;
      lodash2.xorBy = xorBy;
      lodash2.xorWith = xorWith;
      lodash2.zip = zip;
      lodash2.zipObject = zipObject;
      lodash2.zipObjectDeep = zipObjectDeep;
      lodash2.zipWith = zipWith;
      lodash2.entries = toPairs;
      lodash2.entriesIn = toPairsIn;
      lodash2.extend = assignIn;
      lodash2.extendWith = assignInWith;
      mixin(lodash2, lodash2);
      lodash2.add = add3;
      lodash2.attempt = attempt;
      lodash2.camelCase = camelCase;
      lodash2.capitalize = capitalize2;
      lodash2.ceil = ceil;
      lodash2.clamp = clamp2;
      lodash2.clone = clone2;
      lodash2.cloneDeep = cloneDeep;
      lodash2.cloneDeepWith = cloneDeepWith;
      lodash2.cloneWith = cloneWith;
      lodash2.conformsTo = conformsTo;
      lodash2.deburr = deburr;
      lodash2.defaultTo = defaultTo;
      lodash2.divide = divide;
      lodash2.endsWith = endsWith3;
      lodash2.eq = eq;
      lodash2.escape = escape2;
      lodash2.escapeRegExp = escapeRegExp2;
      lodash2.every = every;
      lodash2.find = find2;
      lodash2.findIndex = findIndex;
      lodash2.findKey = findKey2;
      lodash2.findLast = findLast2;
      lodash2.findLastIndex = findLastIndex2;
      lodash2.findLastKey = findLastKey;
      lodash2.floor = floor2;
      lodash2.forEach = forEach3;
      lodash2.forEachRight = forEachRight;
      lodash2.forIn = forIn;
      lodash2.forInRight = forInRight;
      lodash2.forOwn = forOwn;
      lodash2.forOwnRight = forOwnRight;
      lodash2.get = get3;
      lodash2.gt = gt2;
      lodash2.gte = gte2;
      lodash2.has = has2;
      lodash2.hasIn = hasIn;
      lodash2.head = head;
      lodash2.identity = identity2;
      lodash2.includes = includes;
      lodash2.indexOf = indexOf;
      lodash2.inRange = inRange;
      lodash2.invoke = invoke2;
      lodash2.isArguments = isArguments;
      lodash2.isArray = isArray2;
      lodash2.isArrayBuffer = isArrayBuffer2;
      lodash2.isArrayLike = isArrayLike;
      lodash2.isArrayLikeObject = isArrayLikeObject;
      lodash2.isBoolean = isBoolean2;
      lodash2.isBuffer = isBuffer2;
      lodash2.isDate = isDate2;
      lodash2.isElement = isElement2;
      lodash2.isEmpty = isEmpty3;
      lodash2.isEqual = isEqual;
      lodash2.isEqualWith = isEqualWith;
      lodash2.isError = isError;
      lodash2.isFinite = isFinite2;
      lodash2.isFunction = isFunction2;
      lodash2.isInteger = isInteger;
      lodash2.isLength = isLength;
      lodash2.isMap = isMap2;
      lodash2.isMatch = isMatch;
      lodash2.isMatchWith = isMatchWith;
      lodash2.isNaN = isNaN2;
      lodash2.isNative = isNative;
      lodash2.isNil = isNil;
      lodash2.isNull = isNull;
      lodash2.isNumber = isNumber2;
      lodash2.isObject = isObject2;
      lodash2.isObjectLike = isObjectLike2;
      lodash2.isPlainObject = isPlainObject2;
      lodash2.isRegExp = isRegExp2;
      lodash2.isSafeInteger = isSafeInteger;
      lodash2.isSet = isSet2;
      lodash2.isString = isString2;
      lodash2.isSymbol = isSymbol2;
      lodash2.isTypedArray = isTypedArray2;
      lodash2.isUndefined = isUndefined2;
      lodash2.isWeakMap = isWeakMap;
      lodash2.isWeakSet = isWeakSet;
      lodash2.join = join2;
      lodash2.kebabCase = kebabCase;
      lodash2.last = last;
      lodash2.lastIndexOf = lastIndexOf;
      lodash2.lowerCase = lowerCase;
      lodash2.lowerFirst = lowerFirst;
      lodash2.lt = lt2;
      lodash2.lte = lte2;
      lodash2.max = max;
      lodash2.maxBy = maxBy;
      lodash2.mean = mean;
      lodash2.meanBy = meanBy;
      lodash2.min = min;
      lodash2.minBy = minBy;
      lodash2.stubArray = stubArray;
      lodash2.stubFalse = stubFalse;
      lodash2.stubObject = stubObject;
      lodash2.stubString = stubString;
      lodash2.stubTrue = stubTrue;
      lodash2.multiply = multiply;
      lodash2.nth = nth;
      lodash2.noConflict = noConflict;
      lodash2.noop = noop2;
      lodash2.now = now2;
      lodash2.pad = pad;
      lodash2.padEnd = padEnd;
      lodash2.padStart = padStart;
      lodash2.parseInt = parseInt2;
      lodash2.random = random;
      lodash2.reduce = reduce;
      lodash2.reduceRight = reduceRight;
      lodash2.repeat = repeat3;
      lodash2.replace = replace2;
      lodash2.result = result;
      lodash2.round = round;
      lodash2.runInContext = runInContext2;
      lodash2.sample = sample;
      lodash2.size = size2;
      lodash2.snakeCase = snakeCase;
      lodash2.some = some;
      lodash2.sortedIndex = sortedIndex;
      lodash2.sortedIndexBy = sortedIndexBy;
      lodash2.sortedIndexOf = sortedIndexOf;
      lodash2.sortedLastIndex = sortedLastIndex;
      lodash2.sortedLastIndexBy = sortedLastIndexBy;
      lodash2.sortedLastIndexOf = sortedLastIndexOf;
      lodash2.startCase = startCase;
      lodash2.startsWith = startsWith2;
      lodash2.subtract = subtract;
      lodash2.sum = sum;
      lodash2.sumBy = sumBy;
      lodash2.template = template;
      lodash2.times = times;
      lodash2.toFinite = toFinite;
      lodash2.toInteger = toInteger;
      lodash2.toLength = toLength;
      lodash2.toLower = toLower;
      lodash2.toNumber = toNumber2;
      lodash2.toSafeInteger = toSafeInteger;
      lodash2.toString = toString3;
      lodash2.toUpper = toUpper;
      lodash2.trim = trim2;
      lodash2.trimEnd = trimEnd2;
      lodash2.trimStart = trimStart2;
      lodash2.truncate = truncate;
      lodash2.unescape = unescape2;
      lodash2.uniqueId = uniqueId;
      lodash2.upperCase = upperCase;
      lodash2.upperFirst = upperFirst;
      lodash2.each = forEach3;
      lodash2.eachRight = forEachRight;
      lodash2.first = head;
      mixin(lodash2, function() {
        var source = {};
        baseForOwn(lodash2, function(func, methodName) {
          if (!hasOwnProperty2.call(lodash2.prototype, methodName)) {
            source[methodName] = func;
          }
        });
        return source;
      }(), { "chain": false });
      lodash2.VERSION = VERSION2;
      arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
        lodash2[methodName].placeholder = lodash2;
      });
      arrayEach(["drop", "take"], function(methodName, index2) {
        LazyWrapper.prototype[methodName] = function(n) {
          n = n === undefined$1 ? 1 : nativeMax(toInteger(n), 0);
          var result2 = this.__filtered__ && !index2 ? new LazyWrapper(this) : this.clone();
          if (result2.__filtered__) {
            result2.__takeCount__ = nativeMin(n, result2.__takeCount__);
          } else {
            result2.__views__.push({
              "size": nativeMin(n, MAX_ARRAY_LENGTH),
              "type": methodName + (result2.__dir__ < 0 ? "Right" : "")
            });
          }
          return result2;
        };
        LazyWrapper.prototype[methodName + "Right"] = function(n) {
          return this.reverse()[methodName](n).reverse();
        };
      });
      arrayEach(["filter", "map", "takeWhile"], function(methodName, index2) {
        var type = index2 + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
        LazyWrapper.prototype[methodName] = function(iteratee2) {
          var result2 = this.clone();
          result2.__iteratees__.push({
            "iteratee": getIteratee(iteratee2, 3),
            "type": type
          });
          result2.__filtered__ = result2.__filtered__ || isFilter;
          return result2;
        };
      });
      arrayEach(["head", "last"], function(methodName, index2) {
        var takeName = "take" + (index2 ? "Right" : "");
        LazyWrapper.prototype[methodName] = function() {
          return this[takeName](1).value()[0];
        };
      });
      arrayEach(["initial", "tail"], function(methodName, index2) {
        var dropName = "drop" + (index2 ? "" : "Right");
        LazyWrapper.prototype[methodName] = function() {
          return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
        };
      });
      LazyWrapper.prototype.compact = function() {
        return this.filter(identity2);
      };
      LazyWrapper.prototype.find = function(predicate) {
        return this.filter(predicate).head();
      };
      LazyWrapper.prototype.findLast = function(predicate) {
        return this.reverse().find(predicate);
      };
      LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
        if (typeof path == "function") {
          return new LazyWrapper(this);
        }
        return this.map(function(value4) {
          return baseInvoke(value4, path, args);
        });
      });
      LazyWrapper.prototype.reject = function(predicate) {
        return this.filter(negate(getIteratee(predicate)));
      };
      LazyWrapper.prototype.slice = function(start2, end) {
        start2 = toInteger(start2);
        var result2 = this;
        if (result2.__filtered__ && (start2 > 0 || end < 0)) {
          return new LazyWrapper(result2);
        }
        if (start2 < 0) {
          result2 = result2.takeRight(-start2);
        } else if (start2) {
          result2 = result2.drop(start2);
        }
        if (end !== undefined$1) {
          end = toInteger(end);
          result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start2);
        }
        return result2;
      };
      LazyWrapper.prototype.takeRightWhile = function(predicate) {
        return this.reverse().takeWhile(predicate).reverse();
      };
      LazyWrapper.prototype.toArray = function() {
        return this.take(MAX_ARRAY_LENGTH);
      };
      baseForOwn(LazyWrapper.prototype, function(func, methodName) {
        var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
        if (!lodashFunc) {
          return;
        }
        lodash2.prototype[methodName] = function() {
          var value4 = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value4 instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray2(value4);
          var interceptor = /* @__PURE__ */ __name(function(value5) {
            var result3 = lodashFunc.apply(lodash2, arrayPush([value5], args));
            return isTaker && chainAll ? result3[0] : result3;
          }, "interceptor");
          if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
            isLazy = useLazy = false;
          }
          var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
          if (!retUnwrapped && useLazy) {
            value4 = onlyLazy ? value4 : new LazyWrapper(this);
            var result2 = func.apply(value4, args);
            result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
            return new LodashWrapper(result2, chainAll);
          }
          if (isUnwrapped && onlyLazy) {
            return func.apply(this, args);
          }
          result2 = this.thru(interceptor);
          return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
        };
      });
      arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
        var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
        lodash2.prototype[methodName] = function() {
          var args = arguments;
          if (retUnwrapped && !this.__chain__) {
            var value4 = this.value();
            return func.apply(isArray2(value4) ? value4 : [], args);
          }
          return this[chainName](function(value5) {
            return func.apply(isArray2(value5) ? value5 : [], args);
          });
        };
      });
      baseForOwn(LazyWrapper.prototype, function(func, methodName) {
        var lodashFunc = lodash2[methodName];
        if (lodashFunc) {
          var key = lodashFunc.name + "";
          if (!hasOwnProperty2.call(realNames, key)) {
            realNames[key] = [];
          }
          realNames[key].push({ "name": methodName, "func": lodashFunc });
        }
      });
      realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
        "name": "wrapper",
        "func": undefined$1
      }];
      LazyWrapper.prototype.clone = lazyClone;
      LazyWrapper.prototype.reverse = lazyReverse;
      LazyWrapper.prototype.value = lazyValue;
      lodash2.prototype.at = wrapperAt;
      lodash2.prototype.chain = wrapperChain;
      lodash2.prototype.commit = wrapperCommit;
      lodash2.prototype.next = wrapperNext;
      lodash2.prototype.plant = wrapperPlant;
      lodash2.prototype.reverse = wrapperReverse;
      lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
      lodash2.prototype.first = lodash2.prototype.head;
      if (symIterator) {
        lodash2.prototype[symIterator] = wrapperToIterator;
      }
      return lodash2;
    }, "runInContext");
    var _2 = runInContext();
    if (typeof undefined$1 == "function" && typeof undefined$1.amd == "object" && undefined$1.amd) {
      root24._ = _2;
      undefined$1(function() {
        return _2;
      });
    } else if (freeModule) {
      (freeModule.exports = _2)._ = _2;
      freeExports._ = _2;
    } else {
      root24._ = _2;
    }
  }).call(commonjsGlobal);
})(lodash$1, lodash$1.exports);
var lodashExports = lodash$1.exports;
const _ = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
const _withScopeId$n = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-3df70997"), n = n(), popScopeId(), n), "_withScopeId$n");
const _hoisted_1$1i = { class: "prompt-dialog-content flex flex-col gap-6 m-2 mt-4" };
const _hoisted_2$Y = {
  key: 0,
  class: "pl-4 m-0 flex flex-col gap-2"
};
const _hoisted_3$u = { class: "flex gap-4 justify-end" };
const _sfc_main$Y = /* @__PURE__ */ defineComponent({
  __name: "ConfirmationDialogContent",
  props: {
    message: {},
    type: {},
    onConfirm: { type: Function },
    itemList: {}
  },
  setup(__props) {
    const props = __props;
    const onCancel = /* @__PURE__ */ __name(() => useDialogStore().closeDialog(), "onCancel");
    const onDeny = /* @__PURE__ */ __name(() => {
      props.onConfirm(false);
      useDialogStore().closeDialog();
    }, "onDeny");
    const onConfirm = /* @__PURE__ */ __name(() => {
      props.onConfirm(true);
      useDialogStore().closeDialog();
    }, "onConfirm");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("section", _hoisted_1$1i, [
        createBaseVNode("span", null, toDisplayString$1(_ctx.message), 1),
        _ctx.itemList?.length ? (openBlock(), createElementBlock("ul", _hoisted_2$Y, [
          (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.itemList, (item3) => {
            return openBlock(), createElementBlock("li", { key: item3 }, toDisplayString$1(item3), 1);
          }), 128))
        ])) : createCommentVNode("", true),
        createBaseVNode("div", _hoisted_3$u, [
          createVNode(unref(script$R), {
            label: _ctx.$t("g.cancel"),
            icon: "pi pi-undo",
            severity: "secondary",
            onClick: onCancel,
            autofocus: ""
          }, null, 8, ["label"]),
          _ctx.type === "default" ? (openBlock(), createBlock(unref(script$R), {
            key: 0,
            label: _ctx.$t("g.confirm"),
            severity: "primary",
            onClick: onConfirm,
            icon: "pi pi-check"
          }, null, 8, ["label"])) : _ctx.type === "delete" ? (openBlock(), createBlock(unref(script$R), {
            key: 1,
            label: _ctx.$t("g.delete"),
            severity: "danger",
            onClick: onConfirm,
            icon: "pi pi-trash"
          }, null, 8, ["label"])) : _ctx.type === "overwrite" ? (openBlock(), createBlock(unref(script$R), {
            key: 2,
            label: _ctx.$t("g.overwrite"),
            severity: "warn",
            onClick: onConfirm,
            icon: "pi pi-save"
          }, null, 8, ["label"])) : _ctx.type === "dirtyClose" ? (openBlock(), createElementBlock(Fragment$1, { key: 3 }, [
            createVNode(unref(script$R), {
              label: _ctx.$t("g.no"),
              severity: "secondary",
              onClick: onDeny,
              icon: "pi pi-times"
            }, null, 8, ["label"]),
            createVNode(unref(script$R), {
              label: _ctx.$t("g.save"),
              onClick: onConfirm,
              icon: "pi pi-save"
            }, null, 8, ["label"])
          ], 64)) : _ctx.type === "reinstall" ? (openBlock(), createBlock(unref(script$R), {
            key: 4,
            label: _ctx.$t("desktopMenu.reinstall"),
            severity: "warn",
            onClick: onConfirm,
            icon: "pi pi-eraser"
          }, null, 8, ["label"])) : (openBlock(), createBlock(unref(script$R), {
            key: 5,
            label: _ctx.$t("g.close"),
            severity: "primary",
            onClick: onCancel,
            icon: "pi pi-times"
          }, null, 8, ["label"]))
        ])
      ]);
    };
  }
});
const ConfirmationDialogContent = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-3df70997"]]);
var theme$t = /* @__PURE__ */ __name(function theme10(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-divider-horizontal {\n    display: flex;\n    width: 100%;\n    position: relative;\n    align-items: center;\n    margin: ".concat(dt2("divider.horizontal.margin"), ";\n    padding: ").concat(dt2("divider.horizontal.padding"), ';\n}\n\n.p-divider-horizontal:before {\n    position: absolute;\n    display: block;\n    top: 50%;\n    left: 0;\n    width: 100%;\n    content: "";\n    border-top: 1px solid ').concat(dt2("divider.border.color"), ";\n}\n\n.p-divider-horizontal .p-divider-content {\n    padding: ").concat(dt2("divider.horizontal.content.padding"), ";\n}\n\n.p-divider-vertical {\n    min-height: 100%;\n    margin: 0 1rem;\n    display: flex;\n    position: relative;\n    justify-content: center;\n    margin: ").concat(dt2("divider.vertical.margin"), ";\n    padding: ").concat(dt2("divider.vertical.padding"), ';\n}\n\n.p-divider-vertical:before {\n    position: absolute;\n    display: block;\n    top: 0;\n    left: 50%;\n    height: 100%;\n    content: "";\n    border-left: 1px solid ').concat(dt2("divider.border.color"), ";\n}\n\n.p-divider.p-divider-vertical .p-divider-content {\n    padding: ").concat(dt2("divider.vertical.content.padding"), ";\n}\n\n.p-divider-content {\n    z-index: 1;\n    background: ").concat(dt2("divider.content.background"), ";\n    color: ").concat(dt2("divider.content.color"), ";\n}\n\n.p-divider-solid.p-divider-horizontal:before {\n    border-top-style: solid;\n}\n\n.p-divider-solid.p-divider-vertical:before {\n    border-left-style: solid;\n}\n\n.p-divider-dashed.p-divider-horizontal:before {\n    border-top-style: dashed;\n}\n\n.p-divider-dashed.p-divider-vertical:before {\n    border-left-style: dashed;\n}\n\n.p-divider-dotted.p-divider-horizontal:before {\n    border-top-style: dotted;\n}\n\n.p-divider-dotted.p-divider-vertical:before {\n    border-left-style: dotted;\n}\n");
}, "theme");
var inlineStyles$2 = {
  root: /* @__PURE__ */ __name(function root4(_ref2) {
    var props = _ref2.props;
    return {
      justifyContent: props.layout === "horizontal" ? props.align === "center" || props.align === null ? "center" : props.align === "left" ? "flex-start" : props.align === "right" ? "flex-end" : null : null,
      alignItems: props.layout === "vertical" ? props.align === "center" || props.align === null ? "center" : props.align === "top" ? "flex-start" : props.align === "bottom" ? "flex-end" : null : null
    };
  }, "root")
};
var classes$v = {
  root: /* @__PURE__ */ __name(function root5(_ref3) {
    var props = _ref3.props;
    return ["p-divider p-component", "p-divider-" + props.layout, "p-divider-" + props.type, {
      "p-divider-left": props.layout === "horizontal" && (!props.align || props.align === "left")
    }, {
      "p-divider-center": props.layout === "horizontal" && props.align === "center"
    }, {
      "p-divider-right": props.layout === "horizontal" && props.align === "right"
    }, {
      "p-divider-top": props.layout === "vertical" && props.align === "top"
    }, {
      "p-divider-center": props.layout === "vertical" && (!props.align || props.align === "center")
    }, {
      "p-divider-bottom": props.layout === "vertical" && props.align === "bottom"
    }];
  }, "root"),
  content: "p-divider-content"
};
var DividerStyle = BaseStyle.extend({
  name: "divider",
  theme: theme$t,
  classes: classes$v,
  inlineStyles: inlineStyles$2
});
var script$1$w = {
  name: "BaseDivider",
  "extends": script$_,
  props: {
    align: {
      type: String,
      "default": null
    },
    layout: {
      type: String,
      "default": "horizontal"
    },
    type: {
      type: String,
      "default": "solid"
    }
  },
  style: DividerStyle,
  provide: /* @__PURE__ */ __name(function provide9() {
    return {
      $pcDivider: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$O = {
  name: "Divider",
  "extends": script$1$w,
  inheritAttrs: false
};
var _hoisted_1$1h = ["aria-orientation"];
function render$N(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    style: _ctx.sx("root"),
    role: "separator",
    "aria-orientation": _ctx.layout
  }, _ctx.ptmi("root")), [_ctx.$slots["default"] ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("content")
  }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "default")], 16)) : createCommentVNode("", true)], 16, _hoisted_1$1h);
}
__name(render$N, "render$N");
script$O.render = render$N;
var theme$s = /* @__PURE__ */ __name(function theme11(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-scrollpanel-content-container {\n    overflow: hidden;\n    width: 100%;\n    height: 100%;\n    position: relative;\n    z-index: 1;\n    float: left;\n}\n\n.p-scrollpanel-content {\n    height: calc(100% + calc(2 * ".concat(dt2("scrollpanel.bar.size"), "));\n    width: calc(100% + calc(2 * ").concat(dt2("scrollpanel.bar.size"), "));\n    padding: 0 calc(2 * ").concat(dt2("scrollpanel.bar.size"), ") calc(2 * ").concat(dt2("scrollpanel.bar.size"), ") 0;\n    position: relative;\n    overflow: auto;\n    box-sizing: border-box;\n    scrollbar-width: none;\n}\n\n.p-scrollpanel-content::-webkit-scrollbar {\n    display: none;\n}\n\n.p-scrollpanel-bar {\n    position: relative;\n    border-radius: ").concat(dt2("scrollpanel.bar.border.radius"), ";\n    z-index: 2;\n    cursor: pointer;\n    opacity: 0;\n    outline-color: transparent;\n    transition: outline-color ").concat(dt2("scrollpanel.transition.duration"), ";\n    background: ").concat(dt2("scrollpanel.bar.background"), ";\n    border: 0 none;\n    transition: outline-color ").concat(dt2("scrollpanel.transition.duration"), ", opacity ").concat(dt2("scrollpanel.transition.duration"), ";\n}\n\n.p-scrollpanel-bar:focus-visible {\n    box-shadow: ").concat(dt2("scrollpanel.bar.focus.ring.shadow"), ";\n    outline: ").concat(dt2("scrollpanel.barfocus.ring.width"), " ").concat(dt2("scrollpanel.bar.focus.ring.style"), " ").concat(dt2("scrollpanel.bar.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("scrollpanel.barfocus.ring.offset"), ";\n}\n\n.p-scrollpanel-bar-y {\n    width: ").concat(dt2("scrollpanel.bar.size"), ";\n    top: 0;\n}\n\n.p-scrollpanel-bar-x {\n    height: ").concat(dt2("scrollpanel.bar.size"), ";\n    bottom: 0;\n}\n\n.p-scrollpanel-hidden {\n    visibility: hidden;\n}\n\n.p-scrollpanel:hover .p-scrollpanel-bar,\n.p-scrollpanel:active .p-scrollpanel-bar {\n    opacity: 1;\n}\n\n.p-scrollpanel-grabbed {\n    user-select: none;\n}\n");
}, "theme");
var classes$u = {
  root: "p-scrollpanel p-component",
  contentContainer: "p-scrollpanel-content-container",
  content: "p-scrollpanel-content",
  barX: "p-scrollpanel-bar p-scrollpanel-bar-x",
  barY: "p-scrollpanel-bar p-scrollpanel-bar-y"
};
var ScrollPanelStyle = BaseStyle.extend({
  name: "scrollpanel",
  theme: theme$s,
  classes: classes$u
});
var script$1$v = {
  name: "BaseScrollPanel",
  "extends": script$_,
  props: {
    step: {
      type: Number,
      "default": 5
    }
  },
  style: ScrollPanelStyle,
  provide: /* @__PURE__ */ __name(function provide10() {
    return {
      $pcScrollPanel: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$N = {
  name: "ScrollPanel",
  "extends": script$1$v,
  inheritAttrs: false,
  initialized: false,
  documentResizeListener: null,
  documentMouseMoveListener: null,
  documentMouseUpListener: null,
  frame: null,
  scrollXRatio: null,
  scrollYRatio: null,
  isXBarClicked: false,
  isYBarClicked: false,
  lastPageX: null,
  lastPageY: null,
  timer: null,
  outsideClickListener: null,
  data: /* @__PURE__ */ __name(function data4() {
    return {
      id: this.$attrs.id,
      orientation: "vertical",
      lastScrollTop: 0,
      lastScrollLeft: 0
    };
  }, "data"),
  watch: {
    "$attrs.id": /* @__PURE__ */ __name(function $attrsId2(newValue2) {
      this.id = newValue2 || UniqueComponentId();
    }, "$attrsId")
  },
  mounted: /* @__PURE__ */ __name(function mounted6() {
    this.id = this.id || UniqueComponentId();
    if (this.$el.offsetParent) {
      this.initialize();
    }
  }, "mounted"),
  updated: /* @__PURE__ */ __name(function updated5() {
    if (!this.initialized && this.$el.offsetParent) {
      this.initialize();
    }
  }, "updated"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount3() {
    this.unbindDocumentResizeListener();
    if (this.frame) {
      window.cancelAnimationFrame(this.frame);
    }
  }, "beforeUnmount"),
  methods: {
    initialize: /* @__PURE__ */ __name(function initialize() {
      this.moveBar();
      this.bindDocumentResizeListener();
      this.calculateContainerHeight();
    }, "initialize"),
    calculateContainerHeight: /* @__PURE__ */ __name(function calculateContainerHeight() {
      var containerStyles = getComputedStyle(this.$el), xBarStyles = getComputedStyle(this.$refs.xBar), pureContainerHeight = getHeight(this.$el) - parseInt(xBarStyles["height"], 10);
      if (containerStyles["max-height"] !== "none" && pureContainerHeight === 0) {
        if (this.$refs.content.offsetHeight + parseInt(xBarStyles["height"], 10) > parseInt(containerStyles["max-height"], 10)) {
          this.$el.style.height = containerStyles["max-height"];
        } else {
          this.$el.style.height = this.$refs.content.offsetHeight + parseFloat(containerStyles.paddingTop) + parseFloat(containerStyles.paddingBottom) + parseFloat(containerStyles.borderTopWidth) + parseFloat(containerStyles.borderBottomWidth) + "px";
        }
      }
    }, "calculateContainerHeight"),
    moveBar: /* @__PURE__ */ __name(function moveBar() {
      var _this = this;
      if (this.$refs.content) {
        var totalWidth = this.$refs.content.scrollWidth;
        var ownWidth = this.$refs.content.clientWidth;
        var bottom = (this.$el.clientHeight - this.$refs.xBar.clientHeight) * -1;
        this.scrollXRatio = ownWidth / totalWidth;
        var totalHeight = this.$refs.content.scrollHeight;
        var ownHeight = this.$refs.content.clientHeight;
        var right = (this.$el.clientWidth - this.$refs.yBar.clientWidth) * -1;
        this.scrollYRatio = ownHeight / totalHeight;
        this.frame = this.requestAnimationFrame(function() {
          if (_this.$refs.xBar) {
            if (_this.scrollXRatio >= 1) {
              _this.$refs.xBar.setAttribute("data-p-scrollpanel-hidden", "true");
              !_this.isUnstyled && addClass(_this.$refs.xBar, "p-scrollpanel-hidden");
            } else {
              _this.$refs.xBar.setAttribute("data-p-scrollpanel-hidden", "false");
              !_this.isUnstyled && removeClass(_this.$refs.xBar, "p-scrollpanel-hidden");
              _this.$refs.xBar.style.cssText = "width:" + Math.max(_this.scrollXRatio * 100, 10) + "%; left:" + _this.$refs.content.scrollLeft / totalWidth * 100 + "%;bottom:" + bottom + "px;";
            }
          }
          if (_this.$refs.yBar) {
            if (_this.scrollYRatio >= 1) {
              _this.$refs.yBar.setAttribute("data-p-scrollpanel-hidden", "true");
              !_this.isUnstyled && addClass(_this.$refs.yBar, "p-scrollpanel-hidden");
            } else {
              _this.$refs.yBar.setAttribute("data-p-scrollpanel-hidden", "false");
              !_this.isUnstyled && removeClass(_this.$refs.yBar, "p-scrollpanel-hidden");
              _this.$refs.yBar.style.cssText = "height:" + Math.max(_this.scrollYRatio * 100, 10) + "%; top: calc(" + _this.$refs.content.scrollTop / totalHeight * 100 + "% - " + _this.$refs.xBar.clientHeight + "px);right:" + right + "px;";
            }
          }
        });
      }
    }, "moveBar"),
    onYBarMouseDown: /* @__PURE__ */ __name(function onYBarMouseDown(e2) {
      this.isYBarClicked = true;
      this.$refs.yBar.focus();
      this.lastPageY = e2.pageY;
      this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed", "true");
      !this.isUnstyled && addClass(this.$refs.yBar, "p-scrollpanel-grabbed");
      document.body.setAttribute("data-p-scrollpanel-grabbed", "true");
      !this.isUnstyled && addClass(document.body, "p-scrollpanel-grabbed");
      this.bindDocumentMouseListeners();
      e2.preventDefault();
    }, "onYBarMouseDown"),
    onXBarMouseDown: /* @__PURE__ */ __name(function onXBarMouseDown(e2) {
      this.isXBarClicked = true;
      this.$refs.xBar.focus();
      this.lastPageX = e2.pageX;
      this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed", "false");
      !this.isUnstyled && addClass(this.$refs.xBar, "p-scrollpanel-grabbed");
      document.body.setAttribute("data-p-scrollpanel-grabbed", "false");
      !this.isUnstyled && addClass(document.body, "p-scrollpanel-grabbed");
      this.bindDocumentMouseListeners();
      e2.preventDefault();
    }, "onXBarMouseDown"),
    onScroll: /* @__PURE__ */ __name(function onScroll(event) {
      if (this.lastScrollLeft !== event.target.scrollLeft) {
        this.lastScrollLeft = event.target.scrollLeft;
        this.orientation = "horizontal";
      } else if (this.lastScrollTop !== event.target.scrollTop) {
        this.lastScrollTop = event.target.scrollTop;
        this.orientation = "vertical";
      }
      this.moveBar();
    }, "onScroll"),
    onKeyDown: /* @__PURE__ */ __name(function onKeyDown3(event) {
      if (this.orientation === "vertical") {
        switch (event.code) {
          case "ArrowDown": {
            this.setTimer("scrollTop", this.step);
            event.preventDefault();
            break;
          }
          case "ArrowUp": {
            this.setTimer("scrollTop", this.step * -1);
            event.preventDefault();
            break;
          }
          case "ArrowLeft":
          case "ArrowRight": {
            event.preventDefault();
            break;
          }
        }
      } else if (this.orientation === "horizontal") {
        switch (event.code) {
          case "ArrowRight": {
            this.setTimer("scrollLeft", this.step);
            event.preventDefault();
            break;
          }
          case "ArrowLeft": {
            this.setTimer("scrollLeft", this.step * -1);
            event.preventDefault();
            break;
          }
          case "ArrowDown":
          case "ArrowUp": {
            event.preventDefault();
            break;
          }
        }
      }
    }, "onKeyDown"),
    onKeyUp: /* @__PURE__ */ __name(function onKeyUp2() {
      this.clearTimer();
    }, "onKeyUp"),
    repeat: /* @__PURE__ */ __name(function repeat(bar, step3) {
      this.$refs.content[bar] += step3;
      this.moveBar();
    }, "repeat"),
    setTimer: /* @__PURE__ */ __name(function setTimer(bar, step3) {
      var _this2 = this;
      this.clearTimer();
      this.timer = setTimeout(function() {
        _this2.repeat(bar, step3);
      }, 40);
    }, "setTimer"),
    clearTimer: /* @__PURE__ */ __name(function clearTimer() {
      if (this.timer) {
        clearTimeout(this.timer);
      }
    }, "clearTimer"),
    onDocumentMouseMove: /* @__PURE__ */ __name(function onDocumentMouseMove(e2) {
      if (this.isXBarClicked) {
        this.onMouseMoveForXBar(e2);
      } else if (this.isYBarClicked) {
        this.onMouseMoveForYBar(e2);
      } else {
        this.onMouseMoveForXBar(e2);
        this.onMouseMoveForYBar(e2);
      }
    }, "onDocumentMouseMove"),
    onMouseMoveForXBar: /* @__PURE__ */ __name(function onMouseMoveForXBar(e2) {
      var _this3 = this;
      var deltaX = e2.pageX - this.lastPageX;
      this.lastPageX = e2.pageX;
      this.frame = this.requestAnimationFrame(function() {
        _this3.$refs.content.scrollLeft += deltaX / _this3.scrollXRatio;
      });
    }, "onMouseMoveForXBar"),
    onMouseMoveForYBar: /* @__PURE__ */ __name(function onMouseMoveForYBar(e2) {
      var _this4 = this;
      var deltaY = e2.pageY - this.lastPageY;
      this.lastPageY = e2.pageY;
      this.frame = this.requestAnimationFrame(function() {
        _this4.$refs.content.scrollTop += deltaY / _this4.scrollYRatio;
      });
    }, "onMouseMoveForYBar"),
    onFocus: /* @__PURE__ */ __name(function onFocus2(event) {
      if (this.$refs.xBar.isSameNode(event.target)) {
        this.orientation = "horizontal";
      } else if (this.$refs.yBar.isSameNode(event.target)) {
        this.orientation = "vertical";
      }
    }, "onFocus"),
    onBlur: /* @__PURE__ */ __name(function onBlur2() {
      if (this.orientation === "horizontal") {
        this.orientation = "vertical";
      }
    }, "onBlur"),
    onDocumentMouseUp: /* @__PURE__ */ __name(function onDocumentMouseUp() {
      this.$refs.yBar.setAttribute("data-p-scrollpanel-grabbed", "false");
      !this.isUnstyled && removeClass(this.$refs.yBar, "p-scrollpanel-grabbed");
      this.$refs.xBar.setAttribute("data-p-scrollpanel-grabbed", "false");
      !this.isUnstyled && removeClass(this.$refs.xBar, "p-scrollpanel-grabbed");
      document.body.setAttribute("data-p-scrollpanel-grabbed", "false");
      !this.isUnstyled && removeClass(document.body, "p-scrollpanel-grabbed");
      this.unbindDocumentMouseListeners();
      this.isXBarClicked = false;
      this.isYBarClicked = false;
    }, "onDocumentMouseUp"),
    requestAnimationFrame: /* @__PURE__ */ __name(function requestAnimationFrame2(f) {
      var frame = window.requestAnimationFrame || this.timeoutFrame;
      return frame(f);
    }, "requestAnimationFrame"),
    refresh: /* @__PURE__ */ __name(function refresh() {
      this.moveBar();
    }, "refresh"),
    scrollTop: /* @__PURE__ */ __name(function scrollTop(_scrollTop) {
      var scrollableHeight = this.$refs.content.scrollHeight - this.$refs.content.clientHeight;
      _scrollTop = _scrollTop > scrollableHeight ? scrollableHeight : _scrollTop > 0 ? _scrollTop : 0;
      this.$refs.content.scrollTop = _scrollTop;
    }, "scrollTop"),
    timeoutFrame: /* @__PURE__ */ __name(function timeoutFrame(fn) {
      setTimeout(fn, 0);
    }, "timeoutFrame"),
    bindDocumentMouseListeners: /* @__PURE__ */ __name(function bindDocumentMouseListeners() {
      var _this5 = this;
      if (!this.documentMouseMoveListener) {
        this.documentMouseMoveListener = function(e2) {
          _this5.onDocumentMouseMove(e2);
        };
        document.addEventListener("mousemove", this.documentMouseMoveListener);
      }
      if (!this.documentMouseUpListener) {
        this.documentMouseUpListener = function(e2) {
          _this5.onDocumentMouseUp(e2);
        };
        document.addEventListener("mouseup", this.documentMouseUpListener);
      }
    }, "bindDocumentMouseListeners"),
    unbindDocumentMouseListeners: /* @__PURE__ */ __name(function unbindDocumentMouseListeners() {
      if (this.documentMouseMoveListener) {
        document.removeEventListener("mousemove", this.documentMouseMoveListener);
        this.documentMouseMoveListener = null;
      }
      if (this.documentMouseUpListener) {
        document.removeEventListener("mouseup", this.documentMouseUpListener);
        this.documentMouseUpListener = null;
      }
    }, "unbindDocumentMouseListeners"),
    bindDocumentResizeListener: /* @__PURE__ */ __name(function bindDocumentResizeListener() {
      var _this6 = this;
      if (!this.documentResizeListener) {
        this.documentResizeListener = function() {
          _this6.moveBar();
        };
        window.addEventListener("resize", this.documentResizeListener);
      }
    }, "bindDocumentResizeListener"),
    unbindDocumentResizeListener: /* @__PURE__ */ __name(function unbindDocumentResizeListener() {
      if (this.documentResizeListener) {
        window.removeEventListener("resize", this.documentResizeListener);
        this.documentResizeListener = null;
      }
    }, "unbindDocumentResizeListener")
  },
  computed: {
    contentId: /* @__PURE__ */ __name(function contentId() {
      return this.id + "_content";
    }, "contentId")
  }
};
var _hoisted_1$1g = ["id"];
var _hoisted_2$X = ["aria-controls", "aria-valuenow"];
var _hoisted_3$t = ["aria-controls", "aria-valuenow"];
function render$M(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({
    "class": _ctx.cx("contentContainer")
  }, _ctx.ptm("contentContainer")), [createBaseVNode("div", mergeProps({
    ref: "content",
    id: $options.contentId,
    "class": _ctx.cx("content"),
    onScroll: _cache[0] || (_cache[0] = function() {
      return $options.onScroll && $options.onScroll.apply($options, arguments);
    }),
    onMouseenter: _cache[1] || (_cache[1] = function() {
      return $options.moveBar && $options.moveBar.apply($options, arguments);
    })
  }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1$1g)], 16), createBaseVNode("div", mergeProps({
    ref: "xBar",
    "class": _ctx.cx("barx"),
    tabindex: "0",
    role: "scrollbar",
    "aria-orientation": "horizontal",
    "aria-controls": $options.contentId,
    "aria-valuenow": $data.lastScrollLeft,
    onMousedown: _cache[2] || (_cache[2] = function() {
      return $options.onXBarMouseDown && $options.onXBarMouseDown.apply($options, arguments);
    }),
    onKeydown: _cache[3] || (_cache[3] = function($event) {
      return $options.onKeyDown($event);
    }),
    onKeyup: _cache[4] || (_cache[4] = function() {
      return $options.onKeyUp && $options.onKeyUp.apply($options, arguments);
    }),
    onFocus: _cache[5] || (_cache[5] = function() {
      return $options.onFocus && $options.onFocus.apply($options, arguments);
    }),
    onBlur: _cache[6] || (_cache[6] = function() {
      return $options.onBlur && $options.onBlur.apply($options, arguments);
    })
  }, _ctx.ptm("barx"), {
    "data-pc-group-section": "bar"
  }), null, 16, _hoisted_2$X), createBaseVNode("div", mergeProps({
    ref: "yBar",
    "class": _ctx.cx("bary"),
    tabindex: "0",
    role: "scrollbar",
    "aria-orientation": "vertical",
    "aria-controls": $options.contentId,
    "aria-valuenow": $data.lastScrollTop,
    onMousedown: _cache[7] || (_cache[7] = function() {
      return $options.onYBarMouseDown && $options.onYBarMouseDown.apply($options, arguments);
    }),
    onKeydown: _cache[8] || (_cache[8] = function($event) {
      return $options.onKeyDown($event);
    }),
    onKeyup: _cache[9] || (_cache[9] = function() {
      return $options.onKeyUp && $options.onKeyUp.apply($options, arguments);
    }),
    onFocus: _cache[10] || (_cache[10] = function() {
      return $options.onFocus && $options.onFocus.apply($options, arguments);
    })
  }, _ctx.ptm("bary"), {
    "data-pc-group-section": "bar"
  }), null, 16, _hoisted_3$t)], 16);
}
__name(render$M, "render$M");
script$N.render = render$M;
var theme$r = /* @__PURE__ */ __name(function theme12(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-card {\n    background: ".concat(dt2("card.background"), ";\n    color: ").concat(dt2("card.color"), ";\n    box-shadow: ").concat(dt2("card.shadow"), ";\n    border-radius: ").concat(dt2("card.border.radius"), ";\n    display: flex;\n    flex-direction: column;\n}\n\n.p-card-caption {\n    display: flex;\n    flex-direction: column;\n    gap: ").concat(dt2("card.caption.gap"), ";\n}\n\n.p-card-body {\n    padding: ").concat(dt2("card.body.padding"), ";\n    display: flex;\n    flex-direction: column;\n    gap: ").concat(dt2("card.body.gap"), ";\n}\n\n.p-card-title {\n    font-size: ").concat(dt2("card.title.font.size"), ";\n    font-weight: ").concat(dt2("card.title.font.weight"), ";\n}\n\n.p-card-subtitle {\n    color: ").concat(dt2("card.subtitle.color"), ";\n}\n");
}, "theme");
var classes$t = {
  root: "p-card p-component",
  header: "p-card-header",
  body: "p-card-body",
  caption: "p-card-caption",
  title: "p-card-title",
  subtitle: "p-card-subtitle",
  content: "p-card-content",
  footer: "p-card-footer"
};
var CardStyle = BaseStyle.extend({
  name: "card",
  theme: theme$r,
  classes: classes$t
});
var script$1$u = {
  name: "BaseCard",
  "extends": script$_,
  style: CardStyle,
  provide: /* @__PURE__ */ __name(function provide11() {
    return {
      $pcCard: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$M = {
  name: "Card",
  "extends": script$1$u,
  inheritAttrs: false
};
function render$L(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [_ctx.$slots.header ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("header")
  }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header")], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("body")
  }, _ctx.ptm("body")), [_ctx.$slots.title || _ctx.$slots.subtitle ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("caption")
  }, _ctx.ptm("caption")), [_ctx.$slots.title ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("title")
  }, _ctx.ptm("title")), [renderSlot(_ctx.$slots, "title")], 16)) : createCommentVNode("", true), _ctx.$slots.subtitle ? (openBlock(), createElementBlock("div", mergeProps({
    key: 1,
    "class": _ctx.cx("subtitle")
  }, _ctx.ptm("subtitle")), [renderSlot(_ctx.$slots, "subtitle")], 16)) : createCommentVNode("", true)], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("content")
  }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "content")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({
    key: 1,
    "class": _ctx.cx("footer")
  }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true)], 16)], 16);
}
__name(render$L, "render$L");
script$M.render = render$L;
const _withScopeId$m = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-f2b77816"), n = n(), popScopeId(), n), "_withScopeId$m");
const _hoisted_1$1f = { class: "flex flex-col items-center" };
const _hoisted_2$W = { class: "whitespace-pre-line text-center" };
const _sfc_main$X = /* @__PURE__ */ defineComponent({
  __name: "NoResultsPlaceholder",
  props: {
    class: {},
    icon: {},
    title: {},
    message: {},
    buttonLabel: {}
  },
  emits: ["action"],
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["no-results-placeholder p-8 h-full", props.class])
      }, [
        createVNode(unref(script$M), null, {
          content: withCtx(() => [
            createBaseVNode("div", _hoisted_1$1f, [
              createBaseVNode("i", {
                class: normalizeClass(_ctx.icon),
                style: { "font-size": "3rem", "margin-bottom": "1rem" }
              }, null, 2),
              createBaseVNode("h3", null, toDisplayString$1(_ctx.title), 1),
              createBaseVNode("p", _hoisted_2$W, toDisplayString$1(_ctx.message), 1),
              _ctx.buttonLabel ? (openBlock(), createBlock(unref(script$R), {
                key: 0,
                label: _ctx.buttonLabel,
                onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("action")),
                class: "p-button-text"
              }, null, 8, ["label"])) : createCommentVNode("", true)
            ])
          ]),
          _: 1
        })
      ], 2);
    };
  }
});
const NoResultsPlaceholder = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-f2b77816"]]);
const _sfc_main$W = /* @__PURE__ */ defineComponent({
  __name: "FindIssueButton",
  props: {
    errorMessage: {},
    repoOwner: {},
    repoName: {}
  },
  setup(__props) {
    const props = __props;
    const queryString = computed(() => props.errorMessage + " is:issue");
    const openGitHubIssues = /* @__PURE__ */ __name(() => {
      const query = encodeURIComponent(queryString.value);
      const url = `https://github.com/${props.repoOwner}/${props.repoName}/issues?q=${query}`;
      window.open(url, "_blank");
    }, "openGitHubIssues");
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(script$R), {
        onClick: openGitHubIssues,
        label: _ctx.$t("g.findIssues"),
        severity: "secondary",
        icon: "pi pi-github"
      }, null, 8, ["label"]);
    };
  }
});
const _sfc_main$V = /* @__PURE__ */ defineComponent({
  __name: "ReportIssueButton",
  props: {
    error: {}
  },
  setup(__props) {
    const { error: error2 } = __props;
    const { t: t2 } = useI18n();
    const toast = useToast();
    const submitting = ref(false);
    const submitted = ref(false);
    const icon3 = computed(
      () => `pi ${submitting.value ? "pi-spin pi-spinner" : "pi-send"}`
    );
    const reportIssue = /* @__PURE__ */ __name(async () => {
      if (submitting.value) return;
      submitting.value = true;
      try {
        await electronAPI().sendErrorToSentry(error2.exception_message, {
          stackTrace: error2.traceback?.join("\n"),
          nodeType: error2.node_type
        });
        submitted.value = true;
        toast.add({
          severity: "success",
          summary: t2("g.reportSent"),
          life: 3e3
        });
      } finally {
        submitting.value = false;
      }
    }, "reportIssue");
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return withDirectives((openBlock(), createBlock(unref(script$R), {
        onClick: reportIssue,
        label: _ctx.$t("g.reportIssue"),
        severity: submitted.value ? "success" : "secondary",
        icon: icon3.value,
        disabled: submitted.value
      }, null, 8, ["label", "severity", "icon", "disabled"])), [
        [_directive_tooltip, _ctx.$t("g.reportIssueTooltip")]
      ]);
    };
  }
});
function useCopyToClipboard() {
  const { copy: copy2, isSupported: isSupported2 } = useClipboard();
  const toast = useToast();
  const copyToClipboard = /* @__PURE__ */ __name(async (text2) => {
    if (isSupported2) {
      try {
        await copy2(text2);
        toast.add({
          severity: "success",
          summary: "Success",
          detail: "Copied to clipboard",
          life: 3e3
        });
      } catch (err) {
        toast.add({
          severity: "error",
          summary: "Error",
          detail: "Failed to copy report"
        });
      }
    } else {
      toast.add({
        severity: "error",
        summary: "Error",
        detail: "Clipboard API not supported in your browser"
      });
    }
  }, "copyToClipboard");
  return {
    copyToClipboard
  };
}
__name(useCopyToClipboard, "useCopyToClipboard");
const _withScopeId$l = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-ddf3e2da"), n = n(), popScopeId(), n), "_withScopeId$l");
const _hoisted_1$1e = { class: "comfy-error-report" };
const _hoisted_2$V = { class: "wrapper-pre" };
const _hoisted_3$s = { class: "action-container" };
const repoOwner = "comfyanonymous";
const repoName = "ComfyUI";
const _sfc_main$U = /* @__PURE__ */ defineComponent({
  __name: "ExecutionErrorDialogContent",
  props: {
    error: {}
  },
  setup(__props) {
    const props = __props;
    const reportContent = ref("");
    const reportOpen = ref(false);
    const showReport = /* @__PURE__ */ __name(() => {
      reportOpen.value = true;
    }, "showReport");
    const showSendError = isElectron();
    const toast = useToast();
    onMounted(async () => {
      try {
        const [systemStats, logs] = await Promise.all([
          api.getSystemStats(),
          api.getLogs()
        ]);
        generateReport(systemStats, logs);
      } catch (error2) {
        console.error("Error fetching system stats or logs:", error2);
        toast.add({
          severity: "error",
          summary: "Error",
          detail: "Failed to fetch system information",
          life: 5e3
        });
      }
    });
    const generateReport = /* @__PURE__ */ __name((systemStats, logs) => {
      const MAX_JSON_LENGTH = 2e4;
      const workflowJSONString = JSON.stringify(app$1.graph.serialize());
      const workflowText = workflowJSONString.length > MAX_JSON_LENGTH ? "Workflow too large. Please manually upload the workflow from local file system." : workflowJSONString;
      reportContent.value = `
# ComfyUI Error Report
## Error Details
- **Node ID:** ${props.error.node_id}
- **Node Type:** ${props.error.node_type}
- **Exception Type:** ${props.error.exception_type}
- **Exception Message:** ${props.error.exception_message}
## Stack Trace
\`\`\`
${props.error.traceback.join("\n")}
\`\`\`
## System Information
- **ComfyUI Version:** ${systemStats.system.comfyui_version}
- **Arguments:** ${systemStats.system.argv.join(" ")}
- **OS:** ${systemStats.system.os}
- **Python Version:** ${systemStats.system.python_version}
- **Embedded Python:** ${systemStats.system.embedded_python}
- **PyTorch Version:** ${systemStats.system.pytorch_version}
## Devices
${systemStats.devices.map(
        (device) => `
- **Name:** ${device.name}
  - **Type:** ${device.type}
  - **VRAM Total:** ${device.vram_total}
  - **VRAM Free:** ${device.vram_free}
  - **Torch VRAM Total:** ${device.torch_vram_total}
  - **Torch VRAM Free:** ${device.torch_vram_free}
`
      ).join("\n")}
## Logs
\`\`\`
${logs}
\`\`\`
## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.
\`\`\`
${workflowText}
\`\`\`

## Additional Context
(Please add any additional context or steps to reproduce the error here)
`;
    }, "generateReport");
    const { copyToClipboard } = useCopyToClipboard();
    const copyReportToClipboard = /* @__PURE__ */ __name(async () => {
      await copyToClipboard(reportContent.value);
    }, "copyReportToClipboard");
    const openNewGithubIssue = /* @__PURE__ */ __name(async () => {
      await copyReportToClipboard();
      const issueTitle = encodeURIComponent(
        `[Bug]: ${props.error.exception_type} in ${props.error.node_type}`
      );
      const issueBody = encodeURIComponent(
        "The report has been copied to the clipboard. Please paste it here."
      );
      const url = `https://github.com/${repoOwner}/${repoName}/issues/new?title=${issueTitle}&body=${issueBody}`;
      window.open(url, "_blank");
    }, "openNewGithubIssue");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(NoResultsPlaceholder, {
          icon: "pi pi-exclamation-circle",
          title: props.error.node_type,
          message: props.error.exception_message
        }, null, 8, ["title", "message"]),
        createBaseVNode("div", _hoisted_1$1e, [
          withDirectives(createVNode(unref(script$R), {
            label: _ctx.$t("g.showReport"),
            onClick: showReport,
            text: ""
          }, null, 8, ["label"]), [
            [vShow, !reportOpen.value]
          ]),
          reportOpen.value ? (openBlock(), createElementBlock(Fragment$1, { key: 0 }, [
            createVNode(unref(script$O)),
            createVNode(unref(script$N), { style: { "width": "100%", "height": "400px", "max-width": "80vw" } }, {
              default: withCtx(() => [
                createBaseVNode("pre", _hoisted_2$V, toDisplayString$1(reportContent.value), 1)
              ]),
              _: 1
            }),
            createVNode(unref(script$O))
          ], 64)) : createCommentVNode("", true),
          createBaseVNode("div", _hoisted_3$s, [
            unref(showSendError) ? (openBlock(), createBlock(_sfc_main$V, {
              key: 0,
              error: props.error
            }, null, 8, ["error"])) : createCommentVNode("", true),
            createVNode(_sfc_main$W, {
              errorMessage: props.error.exception_message,
              repoOwner,
              repoName
            }, null, 8, ["errorMessage"]),
            reportOpen.value ? (openBlock(), createBlock(unref(script$R), {
              key: 1,
              label: _ctx.$t("g.copyToClipboard"),
              icon: "pi pi-copy",
              onClick: copyReportToClipboard
            }, null, 8, ["label"])) : createCommentVNode("", true)
          ])
        ])
      ], 64);
    };
  }
});
const ExecutionErrorDialogContent = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-ddf3e2da"]]);
var script$L = {
  name: "BlankIcon",
  "extends": script$X
};
var _hoisted_1$1d = /* @__PURE__ */ createBaseVNode("rect", {
  width: "1",
  height: "1",
  fill: "currentColor",
  "fill-opacity": "0"
}, null, -1);
var _hoisted_2$U = [_hoisted_1$1d];
function render$K(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$U, 16);
}
__name(render$K, "render$K");
script$L.render = render$K;
var script$K = {
  name: "CheckIcon",
  "extends": script$X
};
var _hoisted_1$1c = /* @__PURE__ */ createBaseVNode("path", {
  d: "M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$T = [_hoisted_1$1c];
function render$J(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$T, 16);
}
__name(render$J, "render$J");
script$K.render = render$J;
var script$J = {
  name: "SearchIcon",
  "extends": script$X
};
var _hoisted_1$1b = /* @__PURE__ */ createBaseVNode("path", {
  "fill-rule": "evenodd",
  "clip-rule": "evenodd",
  d: "M2.67602 11.0265C3.6661 11.688 4.83011 12.0411 6.02086 12.0411C6.81149 12.0411 7.59438 11.8854 8.32483 11.5828C8.87005 11.357 9.37808 11.0526 9.83317 10.6803L12.9769 13.8241C13.0323 13.8801 13.0983 13.9245 13.171 13.9548C13.2438 13.985 13.3219 14.0003 13.4007 14C13.4795 14.0003 13.5575 13.985 13.6303 13.9548C13.7031 13.9245 13.7691 13.8801 13.8244 13.8241C13.9367 13.7116 13.9998 13.5592 13.9998 13.4003C13.9998 13.2414 13.9367 13.089 13.8244 12.9765L10.6807 9.8328C11.053 9.37773 11.3573 8.86972 11.5831 8.32452C11.8857 7.59408 12.0414 6.81119 12.0414 6.02056C12.0414 4.8298 11.6883 3.66579 11.0268 2.67572C10.3652 1.68564 9.42494 0.913972 8.32483 0.45829C7.22472 0.00260857 6.01418 -0.116618 4.84631 0.115686C3.67844 0.34799 2.60568 0.921393 1.76369 1.76338C0.921698 2.60537 0.348296 3.67813 0.115991 4.84601C-0.116313 6.01388 0.00291375 7.22441 0.458595 8.32452C0.914277 9.42464 1.68595 10.3649 2.67602 11.0265ZM3.35565 2.0158C4.14456 1.48867 5.07206 1.20731 6.02086 1.20731C7.29317 1.20731 8.51338 1.71274 9.41304 2.6124C10.3127 3.51206 10.8181 4.73226 10.8181 6.00457C10.8181 6.95337 10.5368 7.88088 10.0096 8.66978C9.48251 9.45868 8.73328 10.0736 7.85669 10.4367C6.98011 10.7997 6.01554 10.8947 5.08496 10.7096C4.15439 10.5245 3.2996 10.0676 2.62869 9.39674C1.95778 8.72583 1.50089 7.87104 1.31579 6.94046C1.13068 6.00989 1.22568 5.04532 1.58878 4.16874C1.95187 3.29215 2.56675 2.54292 3.35565 2.0158Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$S = [_hoisted_1$1b];
function render$I(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$S, 16);
}
__name(render$I, "render$I");
script$J.render = render$I;
var theme$q = /* @__PURE__ */ __name(function theme13(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-iconfield {\n    position: relative;\n}\n\n.p-inputicon {\n    position: absolute;\n    top: 50%;\n    margin-top: calc(-1 * (".concat(dt2("icon.size"), " / 2));\n    color: ").concat(dt2("iconfield.icon.color"), ";\n    line-height: 1;\n}\n\n.p-iconfield .p-inputicon:first-child {\n    left: ").concat(dt2("form.field.padding.x"), ";\n}\n\n.p-iconfield .p-inputicon:last-child {\n    right: ").concat(dt2("form.field.padding.x"), ";\n}\n\n.p-iconfield .p-inputtext:not(:first-child) {\n    padding-left: calc((").concat(dt2("form.field.padding.x"), " * 2) + ").concat(dt2("icon.size"), ");\n}\n\n.p-iconfield .p-inputtext:not(:last-child) {\n    padding-right: calc((").concat(dt2("form.field.padding.x"), " * 2) + ").concat(dt2("icon.size"), ");\n}\n");
}, "theme");
var classes$s = {
  root: "p-iconfield"
};
var IconFieldStyle = BaseStyle.extend({
  name: "iconfield",
  theme: theme$q,
  classes: classes$s
});
var script$1$t = {
  name: "BaseIconField",
  "extends": script$_,
  style: IconFieldStyle,
  provide: /* @__PURE__ */ __name(function provide12() {
    return {
      $pcIconField: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$I = {
  name: "IconField",
  "extends": script$1$t,
  inheritAttrs: false
};
function render$H(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
}
__name(render$H, "render$H");
script$I.render = render$H;
var classes$r = {
  root: "p-inputicon"
};
var InputIconStyle = BaseStyle.extend({
  name: "inputicon",
  classes: classes$r
});
var script$1$s = {
  name: "BaseInputIcon",
  "extends": script$_,
  style: InputIconStyle,
  props: {
    "class": null
  },
  provide: /* @__PURE__ */ __name(function provide13() {
    return {
      $pcInputIcon: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$H = {
  name: "InputIcon",
  "extends": script$1$s,
  inheritAttrs: false,
  computed: {
    containerClass: /* @__PURE__ */ __name(function containerClass() {
      return [this.cx("root"), this["class"]];
    }, "containerClass")
  }
};
function render$G(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("span", mergeProps({
    "class": $options.containerClass
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
}
__name(render$G, "render$G");
script$H.render = render$G;
var theme$p = /* @__PURE__ */ __name(function theme14(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-inputtext {\n    font-family: inherit;\n    font-feature-settings: inherit;\n    font-size: 1rem;\n    color: ".concat(dt2("inputtext.color"), ";\n    background: ").concat(dt2("inputtext.background"), ";\n    padding: ").concat(dt2("inputtext.padding.y"), " ").concat(dt2("inputtext.padding.x"), ";\n    border: 1px solid ").concat(dt2("inputtext.border.color"), ";\n    transition: background ").concat(dt2("inputtext.transition.duration"), ", color ").concat(dt2("inputtext.transition.duration"), ", border-color ").concat(dt2("inputtext.transition.duration"), ", outline-color ").concat(dt2("inputtext.transition.duration"), ", box-shadow ").concat(dt2("inputtext.transition.duration"), ";\n    appearance: none;\n    border-radius: ").concat(dt2("inputtext.border.radius"), ";\n    outline-color: transparent;\n    box-shadow: ").concat(dt2("inputtext.shadow"), ";\n}\n\n.p-inputtext:enabled:hover {\n    border-color: ").concat(dt2("inputtext.hover.border.color"), ";\n}\n\n.p-inputtext:enabled:focus {\n    border-color: ").concat(dt2("inputtext.focus.border.color"), ";\n    box-shadow: ").concat(dt2("inputtext.focus.ring.shadow"), ";\n    outline: ").concat(dt2("inputtext.focus.ring.width"), " ").concat(dt2("inputtext.focus.ring.style"), " ").concat(dt2("inputtext.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("inputtext.focus.ring.offset"), ";\n}\n\n.p-inputtext.p-invalid {\n    border-color: ").concat(dt2("inputtext.invalid.border.color"), ";\n}\n\n.p-inputtext.p-variant-filled {\n    background: ").concat(dt2("inputtext.filled.background"), ";\n}\n\n.p-inputtext.p-variant-filled:enabled:focus {\n    background: ").concat(dt2("inputtext.filled.focus.background"), ";\n}\n\n.p-inputtext:disabled {\n    opacity: 1;\n    background: ").concat(dt2("inputtext.disabled.background"), ";\n    color: ").concat(dt2("inputtext.disabled.color"), ";\n}\n\n.p-inputtext::placeholder {\n    color: ").concat(dt2("inputtext.placeholder.color"), ";\n}\n\n.p-inputtext-sm {\n    font-size: ").concat(dt2("inputtext.sm.font.size"), ";\n    padding: ").concat(dt2("inputtext.sm.padding.y"), " ").concat(dt2("inputtext.sm.padding.x"), ";\n}\n\n.p-inputtext-lg {\n    font-size: ").concat(dt2("inputtext.lg.font.size"), ";\n    padding: ").concat(dt2("inputtext.lg.padding.y"), " ").concat(dt2("inputtext.lg.padding.x"), ";\n}\n\n.p-inputtext-fluid {\n    width: 100%;\n}\n");
}, "theme");
var classes$q = {
  root: /* @__PURE__ */ __name(function root6(_ref2) {
    var instance = _ref2.instance, props = _ref2.props;
    return ["p-inputtext p-component", {
      "p-filled": instance.filled,
      "p-inputtext-sm": props.size === "small",
      "p-inputtext-lg": props.size === "large",
      "p-invalid": props.invalid,
      "p-variant-filled": props.variant ? props.variant === "filled" : instance.$primevue.config.inputStyle === "filled" || instance.$primevue.config.inputVariant === "filled",
      "p-inputtext-fluid": instance.hasFluid
    }];
  }, "root")
};
var InputTextStyle = BaseStyle.extend({
  name: "inputtext",
  theme: theme$p,
  classes: classes$q
});
var script$1$r = {
  name: "BaseInputText",
  "extends": script$_,
  props: {
    modelValue: null,
    size: {
      type: String,
      "default": null
    },
    invalid: {
      type: Boolean,
      "default": false
    },
    variant: {
      type: String,
      "default": null
    },
    fluid: {
      type: Boolean,
      "default": null
    }
  },
  style: InputTextStyle,
  provide: /* @__PURE__ */ __name(function provide14() {
    return {
      $pcInputText: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$G = {
  name: "InputText",
  "extends": script$1$r,
  inheritAttrs: false,
  emits: ["update:modelValue"],
  inject: {
    $pcFluid: {
      "default": null
    }
  },
  methods: {
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions2(key) {
      var _ptm = key === "root" ? this.ptmi : this.ptm;
      return _ptm(key, {
        context: {
          filled: this.filled,
          disabled: this.$attrs.disabled || this.$attrs.disabled === ""
        }
      });
    }, "getPTOptions"),
    onInput: /* @__PURE__ */ __name(function onInput(event) {
      this.$emit("update:modelValue", event.target.value);
    }, "onInput")
  },
  computed: {
    filled: /* @__PURE__ */ __name(function filled() {
      return this.modelValue != null && this.modelValue.toString().length > 0;
    }, "filled"),
    hasFluid: /* @__PURE__ */ __name(function hasFluid2() {
      return isEmpty$1(this.fluid) ? !!this.$pcFluid : this.fluid;
    }, "hasFluid")
  }
};
var _hoisted_1$1a = ["value", "aria-invalid"];
function render$F(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("input", mergeProps({
    type: "text",
    "class": _ctx.cx("root"),
    value: _ctx.modelValue,
    "aria-invalid": _ctx.invalid || void 0,
    onInput: _cache[0] || (_cache[0] = function() {
      return $options.onInput && $options.onInput.apply($options, arguments);
    })
  }, $options.getPTOptions("root")), null, 16, _hoisted_1$1a);
}
__name(render$F, "render$F");
script$G.render = render$F;
var theme$o = /* @__PURE__ */ __name(function theme15(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-virtualscroller {\n    position: relative;\n    overflow: auto;\n    contain: strict;\n    transform: translateZ(0);\n    will-change: scroll-position;\n    outline: 0 none;\n}\n\n.p-virtualscroller-content {\n    position: absolute;\n    top: 0;\n    left: 0;\n    min-height: 100%;\n    min-width: 100%;\n    will-change: transform;\n}\n\n.p-virtualscroller-spacer {\n    position: absolute;\n    top: 0;\n    left: 0;\n    height: 1px;\n    width: 1px;\n    transform-origin: 0 0;\n    pointer-events: none;\n}\n\n.p-virtualscroller-loader {\n    position: sticky;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    background: ".concat(dt2("virtualscroller.loader.mask.background"), ";\n    color: ").concat(dt2("virtualscroller.loader.mask.color"), ";\n}\n\n.p-virtualscroller-loader-mask {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.p-virtualscroller-loading-icon {\n    font-size: ").concat(dt2("virtualscroller.loader.icon.size"), ";\n    width: ").concat(dt2("virtualscroller.loader.icon.size"), ";\n    height: ").concat(dt2("virtualscroller.loader.icon.size"), ";\n}\n\n.p-virtualscroller-horizontal > .p-virtualscroller-content {\n    display: flex;\n}\n\n.p-virtualscroller-inline .p-virtualscroller-content {\n    position: static;\n}\n");
}, "theme");
var VirtualScrollerStyle = BaseStyle.extend({
  name: "virtualscroller",
  theme: theme$o
});
var script$1$q = {
  name: "BaseVirtualScroller",
  "extends": script$_,
  props: {
    id: {
      type: String,
      "default": null
    },
    style: null,
    "class": null,
    items: {
      type: Array,
      "default": null
    },
    itemSize: {
      type: [Number, Array],
      "default": 0
    },
    scrollHeight: null,
    scrollWidth: null,
    orientation: {
      type: String,
      "default": "vertical"
    },
    numToleratedItems: {
      type: Number,
      "default": null
    },
    delay: {
      type: Number,
      "default": 0
    },
    resizeDelay: {
      type: Number,
      "default": 10
    },
    lazy: {
      type: Boolean,
      "default": false
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    loaderDisabled: {
      type: Boolean,
      "default": false
    },
    columns: {
      type: Array,
      "default": null
    },
    loading: {
      type: Boolean,
      "default": false
    },
    showSpacer: {
      type: Boolean,
      "default": true
    },
    showLoader: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: Number,
      "default": 0
    },
    inline: {
      type: Boolean,
      "default": false
    },
    step: {
      type: Number,
      "default": 0
    },
    appendOnly: {
      type: Boolean,
      "default": false
    },
    autoSize: {
      type: Boolean,
      "default": false
    }
  },
  style: VirtualScrollerStyle,
  provide: /* @__PURE__ */ __name(function provide15() {
    return {
      $pcVirtualScroller: this,
      $parentInstance: this
    };
  }, "provide"),
  beforeMount: /* @__PURE__ */ __name(function beforeMount3() {
    var _this$$primevueConfig;
    VirtualScrollerStyle.loadCSS({
      nonce: (_this$$primevueConfig = this.$primevueConfig) === null || _this$$primevueConfig === void 0 || (_this$$primevueConfig = _this$$primevueConfig.csp) === null || _this$$primevueConfig === void 0 ? void 0 : _this$$primevueConfig.nonce
    });
  }, "beforeMount")
};
function _typeof$9(o) {
  "@babel/helpers - typeof";
  return _typeof$9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$9(o);
}
__name(_typeof$9, "_typeof$9");
function ownKeys$b(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$b, "ownKeys$b");
function _objectSpread$b(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$b(Object(t2), true).forEach(function(r2) {
      _defineProperty$9(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$b(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$b, "_objectSpread$b");
function _defineProperty$9(e2, r, t2) {
  return (r = _toPropertyKey$8(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$9, "_defineProperty$9");
function _toPropertyKey$8(t2) {
  var i2 = _toPrimitive$8(t2, "string");
  return "symbol" == _typeof$9(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$8, "_toPropertyKey$8");
function _toPrimitive$8(t2, r) {
  if ("object" != _typeof$9(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$9(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$8, "_toPrimitive$8");
var script$F = {
  name: "VirtualScroller",
  "extends": script$1$q,
  inheritAttrs: false,
  emits: ["update:numToleratedItems", "scroll", "scroll-index-change", "lazy-load"],
  data: /* @__PURE__ */ __name(function data5() {
    var both = this.isBoth();
    return {
      first: both ? {
        rows: 0,
        cols: 0
      } : 0,
      last: both ? {
        rows: 0,
        cols: 0
      } : 0,
      page: both ? {
        rows: 0,
        cols: 0
      } : 0,
      numItemsInViewport: both ? {
        rows: 0,
        cols: 0
      } : 0,
      lastScrollPos: both ? {
        top: 0,
        left: 0
      } : 0,
      d_numToleratedItems: this.numToleratedItems,
      d_loading: this.loading,
      loaderArr: [],
      spacerStyle: {},
      contentStyle: {}
    };
  }, "data"),
  element: null,
  content: null,
  lastScrollPos: null,
  scrollTimeout: null,
  resizeTimeout: null,
  defaultWidth: 0,
  defaultHeight: 0,
  defaultContentWidth: 0,
  defaultContentHeight: 0,
  isRangeChanged: false,
  lazyLoadState: {},
  resizeListener: null,
  initialized: false,
  watch: {
    numToleratedItems: /* @__PURE__ */ __name(function numToleratedItems(newValue2) {
      this.d_numToleratedItems = newValue2;
    }, "numToleratedItems"),
    loading: /* @__PURE__ */ __name(function loading(newValue2, oldValue2) {
      if (this.lazy && newValue2 !== oldValue2 && newValue2 !== this.d_loading) {
        this.d_loading = newValue2;
      }
    }, "loading"),
    items: /* @__PURE__ */ __name(function items(newValue2, oldValue2) {
      if (!oldValue2 || oldValue2.length !== (newValue2 || []).length) {
        this.init();
        this.calculateAutoSize();
      }
    }, "items"),
    itemSize: /* @__PURE__ */ __name(function itemSize() {
      this.init();
      this.calculateAutoSize();
    }, "itemSize"),
    orientation: /* @__PURE__ */ __name(function orientation() {
      this.lastScrollPos = this.isBoth() ? {
        top: 0,
        left: 0
      } : 0;
    }, "orientation"),
    scrollHeight: /* @__PURE__ */ __name(function scrollHeight() {
      this.init();
      this.calculateAutoSize();
    }, "scrollHeight"),
    scrollWidth: /* @__PURE__ */ __name(function scrollWidth() {
      this.init();
      this.calculateAutoSize();
    }, "scrollWidth")
  },
  mounted: /* @__PURE__ */ __name(function mounted7() {
    this.viewInit();
    this.lastScrollPos = this.isBoth() ? {
      top: 0,
      left: 0
    } : 0;
    this.lazyLoadState = this.lazyLoadState || {};
  }, "mounted"),
  updated: /* @__PURE__ */ __name(function updated6() {
    !this.initialized && this.viewInit();
  }, "updated"),
  unmounted: /* @__PURE__ */ __name(function unmounted5() {
    this.unbindResizeListener();
    this.initialized = false;
  }, "unmounted"),
  methods: {
    viewInit: /* @__PURE__ */ __name(function viewInit() {
      if (isVisible(this.element)) {
        this.setContentEl(this.content);
        this.init();
        this.calculateAutoSize();
        this.bindResizeListener();
        this.defaultWidth = getWidth(this.element);
        this.defaultHeight = getHeight(this.element);
        this.defaultContentWidth = getWidth(this.content);
        this.defaultContentHeight = getHeight(this.content);
        this.initialized = true;
      }
    }, "viewInit"),
    init: /* @__PURE__ */ __name(function init2() {
      if (!this.disabled) {
        this.setSize();
        this.calculateOptions();
        this.setSpacerSize();
      }
    }, "init"),
    isVertical: /* @__PURE__ */ __name(function isVertical() {
      return this.orientation === "vertical";
    }, "isVertical"),
    isHorizontal: /* @__PURE__ */ __name(function isHorizontal() {
      return this.orientation === "horizontal";
    }, "isHorizontal"),
    isBoth: /* @__PURE__ */ __name(function isBoth() {
      return this.orientation === "both";
    }, "isBoth"),
    scrollTo: /* @__PURE__ */ __name(function scrollTo2(options4) {
      this.element && this.element.scrollTo(options4);
    }, "scrollTo"),
    scrollToIndex: /* @__PURE__ */ __name(function scrollToIndex(index2) {
      var _this = this;
      var behavior = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "auto";
      var both = this.isBoth();
      var horizontal2 = this.isHorizontal();
      var valid = both ? index2.every(function(i2) {
        return i2 > -1;
      }) : index2 > -1;
      if (valid) {
        var first2 = this.first;
        var _this$element = this.element, _this$element$scrollT = _this$element.scrollTop, scrollTop2 = _this$element$scrollT === void 0 ? 0 : _this$element$scrollT, _this$element$scrollL = _this$element.scrollLeft, scrollLeft = _this$element$scrollL === void 0 ? 0 : _this$element$scrollL;
        var _this$calculateNumIte = this.calculateNumItems(), numToleratedItems2 = _this$calculateNumIte.numToleratedItems;
        var contentPos = this.getContentPosition();
        var itemSize2 = this.itemSize;
        var calculateFirst = /* @__PURE__ */ __name(function calculateFirst2() {
          var _index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
          var _numT = arguments.length > 1 ? arguments[1] : void 0;
          return _index <= _numT ? 0 : _index;
        }, "calculateFirst");
        var calculateCoord = /* @__PURE__ */ __name(function calculateCoord2(_first, _size, _cpos) {
          return _first * _size + _cpos;
        }, "calculateCoord");
        var scrollTo3 = /* @__PURE__ */ __name(function scrollTo4() {
          var left = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
          var top = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
          return _this.scrollTo({
            left,
            top,
            behavior
          });
        }, "scrollTo");
        var newFirst = both ? {
          rows: 0,
          cols: 0
        } : 0;
        var isRangeChanged = false, isScrollChanged = false;
        if (both) {
          newFirst = {
            rows: calculateFirst(index2[0], numToleratedItems2[0]),
            cols: calculateFirst(index2[1], numToleratedItems2[1])
          };
          scrollTo3(calculateCoord(newFirst.cols, itemSize2[1], contentPos.left), calculateCoord(newFirst.rows, itemSize2[0], contentPos.top));
          isScrollChanged = this.lastScrollPos.top !== scrollTop2 || this.lastScrollPos.left !== scrollLeft;
          isRangeChanged = newFirst.rows !== first2.rows || newFirst.cols !== first2.cols;
        } else {
          newFirst = calculateFirst(index2, numToleratedItems2);
          horizontal2 ? scrollTo3(calculateCoord(newFirst, itemSize2, contentPos.left), scrollTop2) : scrollTo3(scrollLeft, calculateCoord(newFirst, itemSize2, contentPos.top));
          isScrollChanged = this.lastScrollPos !== (horizontal2 ? scrollLeft : scrollTop2);
          isRangeChanged = newFirst !== first2;
        }
        this.isRangeChanged = isRangeChanged;
        isScrollChanged && (this.first = newFirst);
      }
    }, "scrollToIndex"),
    scrollInView: /* @__PURE__ */ __name(function scrollInView2(index2, to) {
      var _this2 = this;
      var behavior = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "auto";
      if (to) {
        var both = this.isBoth();
        var horizontal2 = this.isHorizontal();
        var valid = both ? index2.every(function(i2) {
          return i2 > -1;
        }) : index2 > -1;
        if (valid) {
          var _this$getRenderedRang = this.getRenderedRange(), first2 = _this$getRenderedRang.first, viewport = _this$getRenderedRang.viewport;
          var scrollTo3 = /* @__PURE__ */ __name(function scrollTo4() {
            var left = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
            var top = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
            return _this2.scrollTo({
              left,
              top,
              behavior
            });
          }, "scrollTo");
          var isToStart = to === "to-start";
          var isToEnd = to === "to-end";
          if (isToStart) {
            if (both) {
              if (viewport.first.rows - first2.rows > index2[0]) {
                scrollTo3(viewport.first.cols * this.itemSize[1], (viewport.first.rows - 1) * this.itemSize[0]);
              } else if (viewport.first.cols - first2.cols > index2[1]) {
                scrollTo3((viewport.first.cols - 1) * this.itemSize[1], viewport.first.rows * this.itemSize[0]);
              }
            } else {
              if (viewport.first - first2 > index2) {
                var pos2 = (viewport.first - 1) * this.itemSize;
                horizontal2 ? scrollTo3(pos2, 0) : scrollTo3(0, pos2);
              }
            }
          } else if (isToEnd) {
            if (both) {
              if (viewport.last.rows - first2.rows <= index2[0] + 1) {
                scrollTo3(viewport.first.cols * this.itemSize[1], (viewport.first.rows + 1) * this.itemSize[0]);
              } else if (viewport.last.cols - first2.cols <= index2[1] + 1) {
                scrollTo3((viewport.first.cols + 1) * this.itemSize[1], viewport.first.rows * this.itemSize[0]);
              }
            } else {
              if (viewport.last - first2 <= index2 + 1) {
                var _pos2 = (viewport.first + 1) * this.itemSize;
                horizontal2 ? scrollTo3(_pos2, 0) : scrollTo3(0, _pos2);
              }
            }
          }
        }
      } else {
        this.scrollToIndex(index2, behavior);
      }
    }, "scrollInView"),
    getRenderedRange: /* @__PURE__ */ __name(function getRenderedRange() {
      var calculateFirstInViewport = /* @__PURE__ */ __name(function calculateFirstInViewport2(_pos, _size) {
        return Math.floor(_pos / (_size || _pos));
      }, "calculateFirstInViewport");
      var firstInViewport = this.first;
      var lastInViewport = 0;
      if (this.element) {
        var both = this.isBoth();
        var horizontal2 = this.isHorizontal();
        var _this$element2 = this.element, scrollTop2 = _this$element2.scrollTop, scrollLeft = _this$element2.scrollLeft;
        if (both) {
          firstInViewport = {
            rows: calculateFirstInViewport(scrollTop2, this.itemSize[0]),
            cols: calculateFirstInViewport(scrollLeft, this.itemSize[1])
          };
          lastInViewport = {
            rows: firstInViewport.rows + this.numItemsInViewport.rows,
            cols: firstInViewport.cols + this.numItemsInViewport.cols
          };
        } else {
          var scrollPos = horizontal2 ? scrollLeft : scrollTop2;
          firstInViewport = calculateFirstInViewport(scrollPos, this.itemSize);
          lastInViewport = firstInViewport + this.numItemsInViewport;
        }
      }
      return {
        first: this.first,
        last: this.last,
        viewport: {
          first: firstInViewport,
          last: lastInViewport
        }
      };
    }, "getRenderedRange"),
    calculateNumItems: /* @__PURE__ */ __name(function calculateNumItems() {
      var both = this.isBoth();
      var horizontal2 = this.isHorizontal();
      var itemSize2 = this.itemSize;
      var contentPos = this.getContentPosition();
      var contentWidth = this.element ? this.element.offsetWidth - contentPos.left : 0;
      var contentHeight = this.element ? this.element.offsetHeight - contentPos.top : 0;
      var calculateNumItemsInViewport = /* @__PURE__ */ __name(function calculateNumItemsInViewport2(_contentSize, _itemSize) {
        return Math.ceil(_contentSize / (_itemSize || _contentSize));
      }, "calculateNumItemsInViewport");
      var calculateNumToleratedItems = /* @__PURE__ */ __name(function calculateNumToleratedItems2(_numItems) {
        return Math.ceil(_numItems / 2);
      }, "calculateNumToleratedItems");
      var numItemsInViewport = both ? {
        rows: calculateNumItemsInViewport(contentHeight, itemSize2[0]),
        cols: calculateNumItemsInViewport(contentWidth, itemSize2[1])
      } : calculateNumItemsInViewport(horizontal2 ? contentWidth : contentHeight, itemSize2);
      var numToleratedItems2 = this.d_numToleratedItems || (both ? [calculateNumToleratedItems(numItemsInViewport.rows), calculateNumToleratedItems(numItemsInViewport.cols)] : calculateNumToleratedItems(numItemsInViewport));
      return {
        numItemsInViewport,
        numToleratedItems: numToleratedItems2
      };
    }, "calculateNumItems"),
    calculateOptions: /* @__PURE__ */ __name(function calculateOptions() {
      var _this3 = this;
      var both = this.isBoth();
      var first2 = this.first;
      var _this$calculateNumIte2 = this.calculateNumItems(), numItemsInViewport = _this$calculateNumIte2.numItemsInViewport, numToleratedItems2 = _this$calculateNumIte2.numToleratedItems;
      var calculateLast = /* @__PURE__ */ __name(function calculateLast2(_first, _num, _numT) {
        var _isCols = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
        return _this3.getLast(_first + _num + (_first < _numT ? 2 : 3) * _numT, _isCols);
      }, "calculateLast");
      var last = both ? {
        rows: calculateLast(first2.rows, numItemsInViewport.rows, numToleratedItems2[0]),
        cols: calculateLast(first2.cols, numItemsInViewport.cols, numToleratedItems2[1], true)
      } : calculateLast(first2, numItemsInViewport, numToleratedItems2);
      this.last = last;
      this.numItemsInViewport = numItemsInViewport;
      this.d_numToleratedItems = numToleratedItems2;
      this.$emit("update:numToleratedItems", this.d_numToleratedItems);
      if (this.showLoader) {
        this.loaderArr = both ? Array.from({
          length: numItemsInViewport.rows
        }).map(function() {
          return Array.from({
            length: numItemsInViewport.cols
          });
        }) : Array.from({
          length: numItemsInViewport
        });
      }
      if (this.lazy) {
        Promise.resolve().then(function() {
          var _this3$items;
          _this3.lazyLoadState = {
            first: _this3.step ? both ? {
              rows: 0,
              cols: first2.cols
            } : 0 : first2,
            last: Math.min(_this3.step ? _this3.step : last, ((_this3$items = _this3.items) === null || _this3$items === void 0 ? void 0 : _this3$items.length) || 0)
          };
          _this3.$emit("lazy-load", _this3.lazyLoadState);
        });
      }
    }, "calculateOptions"),
    calculateAutoSize: /* @__PURE__ */ __name(function calculateAutoSize() {
      var _this4 = this;
      if (this.autoSize && !this.d_loading) {
        Promise.resolve().then(function() {
          if (_this4.content) {
            var both = _this4.isBoth();
            var horizontal2 = _this4.isHorizontal();
            var vertical2 = _this4.isVertical();
            _this4.content.style.minHeight = _this4.content.style.minWidth = "auto";
            _this4.content.style.position = "relative";
            _this4.element.style.contain = "none";
            var _ref = [getWidth(_this4.element), getHeight(_this4.element)], width2 = _ref[0], height = _ref[1];
            (both || horizontal2) && (_this4.element.style.width = width2 < _this4.defaultWidth ? width2 + "px" : _this4.scrollWidth || _this4.defaultWidth + "px");
            (both || vertical2) && (_this4.element.style.height = height < _this4.defaultHeight ? height + "px" : _this4.scrollHeight || _this4.defaultHeight + "px");
            _this4.content.style.minHeight = _this4.content.style.minWidth = "";
            _this4.content.style.position = "";
            _this4.element.style.contain = "";
          }
        });
      }
    }, "calculateAutoSize"),
    getLast: /* @__PURE__ */ __name(function getLast() {
      var _ref2, _this$items;
      var last = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
      var isCols = arguments.length > 1 ? arguments[1] : void 0;
      return this.items ? Math.min(isCols ? ((_ref2 = this.columns || this.items[0]) === null || _ref2 === void 0 ? void 0 : _ref2.length) || 0 : ((_this$items = this.items) === null || _this$items === void 0 ? void 0 : _this$items.length) || 0, last) : 0;
    }, "getLast"),
    getContentPosition: /* @__PURE__ */ __name(function getContentPosition() {
      if (this.content) {
        var style2 = getComputedStyle(this.content);
        var left = parseFloat(style2.paddingLeft) + Math.max(parseFloat(style2.left) || 0, 0);
        var right = parseFloat(style2.paddingRight) + Math.max(parseFloat(style2.right) || 0, 0);
        var top = parseFloat(style2.paddingTop) + Math.max(parseFloat(style2.top) || 0, 0);
        var bottom = parseFloat(style2.paddingBottom) + Math.max(parseFloat(style2.bottom) || 0, 0);
        return {
          left,
          right,
          top,
          bottom,
          x: left + right,
          y: top + bottom
        };
      }
      return {
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
        x: 0,
        y: 0
      };
    }, "getContentPosition"),
    setSize: /* @__PURE__ */ __name(function setSize() {
      var _this5 = this;
      if (this.element) {
        var both = this.isBoth();
        var horizontal2 = this.isHorizontal();
        var parentElement = this.element.parentElement;
        var width2 = this.scrollWidth || "".concat(this.element.offsetWidth || parentElement.offsetWidth, "px");
        var height = this.scrollHeight || "".concat(this.element.offsetHeight || parentElement.offsetHeight, "px");
        var setProp = /* @__PURE__ */ __name(function setProp2(_name, _value) {
          return _this5.element.style[_name] = _value;
        }, "setProp");
        if (both || horizontal2) {
          setProp("height", height);
          setProp("width", width2);
        } else {
          setProp("height", height);
        }
      }
    }, "setSize"),
    setSpacerSize: /* @__PURE__ */ __name(function setSpacerSize() {
      var _this6 = this;
      var items2 = this.items;
      if (items2) {
        var both = this.isBoth();
        var horizontal2 = this.isHorizontal();
        var contentPos = this.getContentPosition();
        var setProp = /* @__PURE__ */ __name(function setProp2(_name, _value, _size) {
          var _cpos = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
          return _this6.spacerStyle = _objectSpread$b(_objectSpread$b({}, _this6.spacerStyle), _defineProperty$9({}, "".concat(_name), (_value || []).length * _size + _cpos + "px"));
        }, "setProp");
        if (both) {
          setProp("height", items2, this.itemSize[0], contentPos.y);
          setProp("width", this.columns || items2[1], this.itemSize[1], contentPos.x);
        } else {
          horizontal2 ? setProp("width", this.columns || items2, this.itemSize, contentPos.x) : setProp("height", items2, this.itemSize, contentPos.y);
        }
      }
    }, "setSpacerSize"),
    setContentPosition: /* @__PURE__ */ __name(function setContentPosition(pos2) {
      var _this7 = this;
      if (this.content && !this.appendOnly) {
        var both = this.isBoth();
        var horizontal2 = this.isHorizontal();
        var first2 = pos2 ? pos2.first : this.first;
        var calculateTranslateVal = /* @__PURE__ */ __name(function calculateTranslateVal2(_first, _size) {
          return _first * _size;
        }, "calculateTranslateVal");
        var setTransform = /* @__PURE__ */ __name(function setTransform2() {
          var _x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
          var _y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
          return _this7.contentStyle = _objectSpread$b(_objectSpread$b({}, _this7.contentStyle), {
            transform: "translate3d(".concat(_x, "px, ").concat(_y, "px, 0)")
          });
        }, "setTransform");
        if (both) {
          setTransform(calculateTranslateVal(first2.cols, this.itemSize[1]), calculateTranslateVal(first2.rows, this.itemSize[0]));
        } else {
          var translateVal = calculateTranslateVal(first2, this.itemSize);
          horizontal2 ? setTransform(translateVal, 0) : setTransform(0, translateVal);
        }
      }
    }, "setContentPosition"),
    onScrollPositionChange: /* @__PURE__ */ __name(function onScrollPositionChange(event) {
      var _this8 = this;
      var target = event.target;
      var both = this.isBoth();
      var horizontal2 = this.isHorizontal();
      var contentPos = this.getContentPosition();
      var calculateScrollPos = /* @__PURE__ */ __name(function calculateScrollPos2(_pos, _cpos) {
        return _pos ? _pos > _cpos ? _pos - _cpos : _pos : 0;
      }, "calculateScrollPos");
      var calculateCurrentIndex = /* @__PURE__ */ __name(function calculateCurrentIndex2(_pos, _size) {
        return Math.floor(_pos / (_size || _pos));
      }, "calculateCurrentIndex");
      var calculateTriggerIndex = /* @__PURE__ */ __name(function calculateTriggerIndex2(_currentIndex, _first, _last, _num, _numT, _isScrollDownOrRight) {
        return _currentIndex <= _numT ? _numT : _isScrollDownOrRight ? _last - _num - _numT : _first + _numT - 1;
      }, "calculateTriggerIndex");
      var calculateFirst = /* @__PURE__ */ __name(function calculateFirst2(_currentIndex, _triggerIndex, _first, _last, _num, _numT, _isScrollDownOrRight) {
        if (_currentIndex <= _numT) return 0;
        else return Math.max(0, _isScrollDownOrRight ? _currentIndex < _triggerIndex ? _first : _currentIndex - _numT : _currentIndex > _triggerIndex ? _first : _currentIndex - 2 * _numT);
      }, "calculateFirst");
      var calculateLast = /* @__PURE__ */ __name(function calculateLast2(_currentIndex, _first, _last, _num, _numT, _isCols) {
        var lastValue = _first + _num + 2 * _numT;
        if (_currentIndex >= _numT) {
          lastValue += _numT + 1;
        }
        return _this8.getLast(lastValue, _isCols);
      }, "calculateLast");
      var scrollTop2 = calculateScrollPos(target.scrollTop, contentPos.top);
      var scrollLeft = calculateScrollPos(target.scrollLeft, contentPos.left);
      var newFirst = both ? {
        rows: 0,
        cols: 0
      } : 0;
      var newLast = this.last;
      var isRangeChanged = false;
      var newScrollPos = this.lastScrollPos;
      if (both) {
        var isScrollDown = this.lastScrollPos.top <= scrollTop2;
        var isScrollRight = this.lastScrollPos.left <= scrollLeft;
        if (!this.appendOnly || this.appendOnly && (isScrollDown || isScrollRight)) {
          var currentIndex = {
            rows: calculateCurrentIndex(scrollTop2, this.itemSize[0]),
            cols: calculateCurrentIndex(scrollLeft, this.itemSize[1])
          };
          var triggerIndex = {
            rows: calculateTriggerIndex(currentIndex.rows, this.first.rows, this.last.rows, this.numItemsInViewport.rows, this.d_numToleratedItems[0], isScrollDown),
            cols: calculateTriggerIndex(currentIndex.cols, this.first.cols, this.last.cols, this.numItemsInViewport.cols, this.d_numToleratedItems[1], isScrollRight)
          };
          newFirst = {
            rows: calculateFirst(currentIndex.rows, triggerIndex.rows, this.first.rows, this.last.rows, this.numItemsInViewport.rows, this.d_numToleratedItems[0], isScrollDown),
            cols: calculateFirst(currentIndex.cols, triggerIndex.cols, this.first.cols, this.last.cols, this.numItemsInViewport.cols, this.d_numToleratedItems[1], isScrollRight)
          };
          newLast = {
            rows: calculateLast(currentIndex.rows, newFirst.rows, this.last.rows, this.numItemsInViewport.rows, this.d_numToleratedItems[0]),
            cols: calculateLast(currentIndex.cols, newFirst.cols, this.last.cols, this.numItemsInViewport.cols, this.d_numToleratedItems[1], true)
          };
          isRangeChanged = newFirst.rows !== this.first.rows || newLast.rows !== this.last.rows || newFirst.cols !== this.first.cols || newLast.cols !== this.last.cols || this.isRangeChanged;
          newScrollPos = {
            top: scrollTop2,
            left: scrollLeft
          };
        }
      } else {
        var scrollPos = horizontal2 ? scrollLeft : scrollTop2;
        var isScrollDownOrRight = this.lastScrollPos <= scrollPos;
        if (!this.appendOnly || this.appendOnly && isScrollDownOrRight) {
          var _currentIndex2 = calculateCurrentIndex(scrollPos, this.itemSize);
          var _triggerIndex2 = calculateTriggerIndex(_currentIndex2, this.first, this.last, this.numItemsInViewport, this.d_numToleratedItems, isScrollDownOrRight);
          newFirst = calculateFirst(_currentIndex2, _triggerIndex2, this.first, this.last, this.numItemsInViewport, this.d_numToleratedItems, isScrollDownOrRight);
          newLast = calculateLast(_currentIndex2, newFirst, this.last, this.numItemsInViewport, this.d_numToleratedItems);
          isRangeChanged = newFirst !== this.first || newLast !== this.last || this.isRangeChanged;
          newScrollPos = scrollPos;
        }
      }
      return {
        first: newFirst,
        last: newLast,
        isRangeChanged,
        scrollPos: newScrollPos
      };
    }, "onScrollPositionChange"),
    onScrollChange: /* @__PURE__ */ __name(function onScrollChange(event) {
      var _this$onScrollPositio = this.onScrollPositionChange(event), first2 = _this$onScrollPositio.first, last = _this$onScrollPositio.last, isRangeChanged = _this$onScrollPositio.isRangeChanged, scrollPos = _this$onScrollPositio.scrollPos;
      if (isRangeChanged) {
        var newState = {
          first: first2,
          last
        };
        this.setContentPosition(newState);
        this.first = first2;
        this.last = last;
        this.lastScrollPos = scrollPos;
        this.$emit("scroll-index-change", newState);
        if (this.lazy && this.isPageChanged(first2)) {
          var _this$items2, _this$items3;
          var lazyLoadState = {
            first: this.step ? Math.min(this.getPageByFirst(first2) * this.step, (((_this$items2 = this.items) === null || _this$items2 === void 0 ? void 0 : _this$items2.length) || 0) - this.step) : first2,
            last: Math.min(this.step ? (this.getPageByFirst(first2) + 1) * this.step : last, ((_this$items3 = this.items) === null || _this$items3 === void 0 ? void 0 : _this$items3.length) || 0)
          };
          var isLazyStateChanged = this.lazyLoadState.first !== lazyLoadState.first || this.lazyLoadState.last !== lazyLoadState.last;
          isLazyStateChanged && this.$emit("lazy-load", lazyLoadState);
          this.lazyLoadState = lazyLoadState;
        }
      }
    }, "onScrollChange"),
    onScroll: /* @__PURE__ */ __name(function onScroll2(event) {
      var _this9 = this;
      this.$emit("scroll", event);
      if (this.delay) {
        if (this.scrollTimeout) {
          clearTimeout(this.scrollTimeout);
        }
        if (this.isPageChanged()) {
          if (!this.d_loading && this.showLoader) {
            var _this$onScrollPositio2 = this.onScrollPositionChange(event), isRangeChanged = _this$onScrollPositio2.isRangeChanged;
            var changed = isRangeChanged || (this.step ? this.isPageChanged() : false);
            changed && (this.d_loading = true);
          }
          this.scrollTimeout = setTimeout(function() {
            _this9.onScrollChange(event);
            if (_this9.d_loading && _this9.showLoader && (!_this9.lazy || _this9.loading === void 0)) {
              _this9.d_loading = false;
              _this9.page = _this9.getPageByFirst();
            }
          }, this.delay);
        }
      } else {
        this.onScrollChange(event);
      }
    }, "onScroll"),
    onResize: /* @__PURE__ */ __name(function onResize() {
      var _this10 = this;
      if (this.resizeTimeout) {
        clearTimeout(this.resizeTimeout);
      }
      this.resizeTimeout = setTimeout(function() {
        if (isVisible(_this10.element)) {
          var both = _this10.isBoth();
          var vertical2 = _this10.isVertical();
          var horizontal2 = _this10.isHorizontal();
          var _ref3 = [getWidth(_this10.element), getHeight(_this10.element)], width2 = _ref3[0], height = _ref3[1];
          var isDiffWidth = width2 !== _this10.defaultWidth, isDiffHeight = height !== _this10.defaultHeight;
          var reinit = both ? isDiffWidth || isDiffHeight : horizontal2 ? isDiffWidth : vertical2 ? isDiffHeight : false;
          if (reinit) {
            _this10.d_numToleratedItems = _this10.numToleratedItems;
            _this10.defaultWidth = width2;
            _this10.defaultHeight = height;
            _this10.defaultContentWidth = getWidth(_this10.content);
            _this10.defaultContentHeight = getHeight(_this10.content);
            _this10.init();
          }
        }
      }, this.resizeDelay);
    }, "onResize"),
    bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener() {
      if (!this.resizeListener) {
        this.resizeListener = this.onResize.bind(this);
        window.addEventListener("resize", this.resizeListener);
        window.addEventListener("orientationchange", this.resizeListener);
      }
    }, "bindResizeListener"),
    unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener() {
      if (this.resizeListener) {
        window.removeEventListener("resize", this.resizeListener);
        window.removeEventListener("orientationchange", this.resizeListener);
        this.resizeListener = null;
      }
    }, "unbindResizeListener"),
    getOptions: /* @__PURE__ */ __name(function getOptions(renderedIndex) {
      var count = (this.items || []).length;
      var index2 = this.isBoth() ? this.first.rows + renderedIndex : this.first + renderedIndex;
      return {
        index: index2,
        count,
        first: index2 === 0,
        last: index2 === count - 1,
        even: index2 % 2 === 0,
        odd: index2 % 2 !== 0
      };
    }, "getOptions"),
    getLoaderOptions: /* @__PURE__ */ __name(function getLoaderOptions(index2, extOptions) {
      var count = this.loaderArr.length;
      return _objectSpread$b({
        index: index2,
        count,
        first: index2 === 0,
        last: index2 === count - 1,
        even: index2 % 2 === 0,
        odd: index2 % 2 !== 0
      }, extOptions);
    }, "getLoaderOptions"),
    getPageByFirst: /* @__PURE__ */ __name(function getPageByFirst(first2) {
      return Math.floor(((first2 !== null && first2 !== void 0 ? first2 : this.first) + this.d_numToleratedItems * 4) / (this.step || 1));
    }, "getPageByFirst"),
    isPageChanged: /* @__PURE__ */ __name(function isPageChanged(first2) {
      return this.step ? this.page !== this.getPageByFirst(first2 !== null && first2 !== void 0 ? first2 : this.first) : true;
    }, "isPageChanged"),
    setContentEl: /* @__PURE__ */ __name(function setContentEl(el) {
      this.content = el || this.content || findSingle(this.element, '[data-pc-section="content"]');
    }, "setContentEl"),
    elementRef: /* @__PURE__ */ __name(function elementRef(el) {
      this.element = el;
    }, "elementRef"),
    contentRef: /* @__PURE__ */ __name(function contentRef2(el) {
      this.content = el;
    }, "contentRef")
  },
  computed: {
    containerClass: /* @__PURE__ */ __name(function containerClass2() {
      return ["p-virtualscroller", this["class"], {
        "p-virtualscroller-inline": this.inline,
        "p-virtualscroller-both p-both-scroll": this.isBoth(),
        "p-virtualscroller-horizontal p-horizontal-scroll": this.isHorizontal()
      }];
    }, "containerClass"),
    contentClass: /* @__PURE__ */ __name(function contentClass() {
      return ["p-virtualscroller-content", {
        "p-virtualscroller-loading": this.d_loading
      }];
    }, "contentClass"),
    loaderClass: /* @__PURE__ */ __name(function loaderClass() {
      return ["p-virtualscroller-loader", {
        "p-virtualscroller-loader-mask": !this.$slots.loader
      }];
    }, "loaderClass"),
    loadedItems: /* @__PURE__ */ __name(function loadedItems() {
      var _this11 = this;
      if (this.items && !this.d_loading) {
        if (this.isBoth()) return this.items.slice(this.appendOnly ? 0 : this.first.rows, this.last.rows).map(function(item3) {
          return _this11.columns ? item3 : item3.slice(_this11.appendOnly ? 0 : _this11.first.cols, _this11.last.cols);
        });
        else if (this.isHorizontal() && this.columns) return this.items;
        else return this.items.slice(this.appendOnly ? 0 : this.first, this.last);
      }
      return [];
    }, "loadedItems"),
    loadedRows: /* @__PURE__ */ __name(function loadedRows() {
      return this.d_loading ? this.loaderDisabled ? this.loaderArr : [] : this.loadedItems;
    }, "loadedRows"),
    loadedColumns: /* @__PURE__ */ __name(function loadedColumns() {
      if (this.columns) {
        var both = this.isBoth();
        var horizontal2 = this.isHorizontal();
        if (both || horizontal2) {
          return this.d_loading && this.loaderDisabled ? both ? this.loaderArr[0] : this.loaderArr : this.columns.slice(both ? this.first.cols : this.first, both ? this.last.cols : this.last);
        }
      }
      return this.columns;
    }, "loadedColumns")
  },
  components: {
    SpinnerIcon: script$T
  }
};
var _hoisted_1$19 = ["tabindex"];
function render$E(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
  return !_ctx.disabled ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    ref: $options.elementRef,
    "class": $options.containerClass,
    tabindex: _ctx.tabindex,
    style: _ctx.style,
    onScroll: _cache[0] || (_cache[0] = function() {
      return $options.onScroll && $options.onScroll.apply($options, arguments);
    })
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "content", {
    styleClass: $options.contentClass,
    items: $options.loadedItems,
    getItemOptions: $options.getOptions,
    loading: $data.d_loading,
    getLoaderOptions: $options.getLoaderOptions,
    itemSize: _ctx.itemSize,
    rows: $options.loadedRows,
    columns: $options.loadedColumns,
    contentRef: $options.contentRef,
    spacerStyle: $data.spacerStyle,
    contentStyle: $data.contentStyle,
    vertical: $options.isVertical(),
    horizontal: $options.isHorizontal(),
    both: $options.isBoth()
  }, function() {
    return [createBaseVNode("div", mergeProps({
      ref: $options.contentRef,
      "class": $options.contentClass,
      style: $data.contentStyle
    }, _ctx.ptm("content")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($options.loadedItems, function(item3, index2) {
      return renderSlot(_ctx.$slots, "item", {
        key: index2,
        item: item3,
        options: $options.getOptions(index2)
      });
    }), 128))], 16)];
  }), _ctx.showSpacer ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": "p-virtualscroller-spacer",
    style: $data.spacerStyle
  }, _ctx.ptm("spacer")), null, 16)) : createCommentVNode("", true), !_ctx.loaderDisabled && _ctx.showLoader && $data.d_loading ? (openBlock(), createElementBlock("div", mergeProps({
    key: 1,
    "class": $options.loaderClass
  }, _ctx.ptm("loader")), [_ctx.$slots && _ctx.$slots.loader ? (openBlock(true), createElementBlock(Fragment$1, {
    key: 0
  }, renderList($data.loaderArr, function(_2, index2) {
    return renderSlot(_ctx.$slots, "loader", {
      key: index2,
      options: $options.getLoaderOptions(index2, $options.isBoth() && {
        numCols: _ctx.d_numItemsInViewport.cols
      })
    });
  }), 128)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "loadingicon", {}, function() {
    return [createVNode(_component_SpinnerIcon, mergeProps({
      spin: "",
      "class": "p-virtualscroller-loading-icon"
    }, _ctx.ptm("loadingIcon")), null, 16)];
  })], 16)) : createCommentVNode("", true)], 16, _hoisted_1$19)) : (openBlock(), createElementBlock(Fragment$1, {
    key: 1
  }, [renderSlot(_ctx.$slots, "default"), renderSlot(_ctx.$slots, "content", {
    items: _ctx.items,
    rows: _ctx.items,
    columns: $options.loadedColumns
  })], 64));
}
__name(render$E, "render$E");
script$F.render = render$E;
var theme$n = /* @__PURE__ */ __name(function theme16(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-listbox {\n    background: ".concat(dt2("listbox.background"), ";\n    color: ").concat(dt2("listbox.color"), ";\n    border: 1px solid ").concat(dt2("listbox.border.color"), ";\n    border-radius: ").concat(dt2("listbox.border.radius"), ";\n    transition: background ").concat(dt2("listbox.transition.duration"), ", color ").concat(dt2("listbox.transition.duration"), ", border-color ").concat(dt2("listbox.transition.duration"), ",\n            box-shadow ").concat(dt2("listbox.transition.duration"), ", outline-color ").concat(dt2("listbox.transition.duration"), ";\n    outline-color: transparent;\n    box-shadow: ").concat(dt2("listbox.shadow"), ";\n}\n\n.p-listbox.p-focus {\n    border-color: ").concat(dt2("listbox.focus.border.color"), ";\n    box-shadow: ").concat(dt2("listbox.focus.ring.shadow"), ";\n    outline: ").concat(dt2("listbox.focus.ring.width"), " ").concat(dt2("listbox.focus.ring.style"), " ").concat(dt2("listbox.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("listbox.focus.ring.offset"), ";\n}\n\n.p-listbox.p-disabled {\n    opacity: 1;\n    background: ").concat(dt2("listbox.disabled.background"), ";\n    color: ").concat(dt2("listbox.disabled.color"), ";\n}\n\n.p-listbox.p-disabled .p-listbox-option {\n    color: ").concat(dt2("listbox.disabled.color"), ";\n}\n\n.p-listbox.p-invalid {\n    border-color: ").concat(dt2("listbox.invalid.border.color"), ";\n}\n\n.p-listbox-header {\n    padding: ").concat(dt2("listbox.list.header.padding"), ";\n}\n\n.p-listbox-filter {\n    width: 100%;\n}\n\n.p-listbox-list-container {\n    overflow: auto;\n}\n\n.p-listbox-list {\n    list-style-type: none;\n    margin: 0;\n    padding: ").concat(dt2("listbox.list.padding"), ";\n    outline: 0 none;\n    display: flex;\n    flex-direction: column;\n    gap: ").concat(dt2("listbox.list.gap"), ";\n}\n\n.p-listbox-option {\n    display: flex;\n    align-items: center;\n    cursor: pointer;\n    position: relative;\n    overflow: hidden;\n    padding: ").concat(dt2("listbox.option.padding"), ";\n    border: 0 none;\n    border-radius: ").concat(dt2("listbox.option.border.radius"), ";\n    color: ").concat(dt2("listbox.option.color"), ";\n    transition: background ").concat(dt2("listbox.transition.duration"), ", color ").concat(dt2("listbox.transition.duration"), ", border-color ").concat(dt2("listbox.transition.duration"), ",\n            box-shadow ").concat(dt2("listbox.transition.duration"), ", outline-color ").concat(dt2("listbox.transition.duration"), ";\n}\n\n.p-listbox-striped li:nth-child(even of .p-listbox-option) {\n    background: ").concat(dt2("listbox.option.striped.background"), ";\n}\n\n.p-listbox .p-listbox-list .p-listbox-option.p-listbox-option-selected {\n    background: ").concat(dt2("listbox.option.selected.background"), ";\n    color: ").concat(dt2("listbox.option.selected.color"), ";\n}\n\n.p-listbox:not(.p-disabled) .p-listbox-option.p-listbox-option-selected.p-focus {\n    background: ").concat(dt2("listbox.option.selected.focus.background"), ";\n    color: ").concat(dt2("listbox.option.selected.focus.color"), ";\n}\n\n.p-listbox:not(.p-disabled) .p-listbox-option:not(.p-listbox-option-selected):not(.p-disabled).p-focus {\n    background: ").concat(dt2("listbox.option.focus.background"), ";\n    color: ").concat(dt2("listbox.option.focus.color"), ";\n}\n\n.p-listbox:not(.p-disabled) .p-listbox-option:not(.p-listbox-option-selected):not(.p-disabled):hover {\n    background: ").concat(dt2("listbox.option.focus.background"), ";\n    color: ").concat(dt2("listbox.option.focus.color"), ";\n}\n\n.p-listbox-option-check-icon {\n    position: relative;\n    margin-inline-start: ").concat(dt2("listbox.checkmark.gutter.start"), ";\n    margin-inline-end: ").concat(dt2("listbox.checkmark.gutter.end"), ";\n    color: ").concat(dt2("listbox.checkmark.color"), ";\n}\n\n.p-listbox-option-group {\n    margin: 0;\n    padding: ").concat(dt2("listbox.option.group.padding"), ";\n    color: ").concat(dt2("listbox.option.group.color"), ";\n    background: ").concat(dt2("listbox.option.group.background"), ";\n    font-weight: ").concat(dt2("listbox.option.group.font.weight"), ";\n}\n\n.p-listbox-empty-message {\n    padding: ").concat(dt2("listbox.empty.message.padding"), ";\n}\n");
}, "theme");
var classes$p = {
  root: /* @__PURE__ */ __name(function root7(_ref2) {
    var props = _ref2.props;
    return ["p-listbox p-component", {
      "p-listbox-striped": props.striped,
      "p-disabled": props.disabled,
      "p-invalid": props.invalid
    }];
  }, "root"),
  header: "p-listbox-header",
  pcFilter: "p-listbox-filter",
  listContainer: "p-listbox-list-container",
  list: "p-listbox-list",
  optionGroup: "p-listbox-option-group",
  option: /* @__PURE__ */ __name(function option(_ref3) {
    var instance = _ref3.instance, props = _ref3.props, _option = _ref3.option, index2 = _ref3.index, getItemOptions = _ref3.getItemOptions;
    return ["p-listbox-option", {
      "p-listbox-option-selected": instance.isSelected(_option) && props.highlightOnSelect,
      "p-focus": instance.focusedOptionIndex === instance.getOptionIndex(index2, getItemOptions),
      "p-disabled": instance.isOptionDisabled(_option)
    }];
  }, "option"),
  optionCheckIcon: "p-listbox-option-check-icon",
  optionBlankIcon: "p-listbox-option-blank-icon",
  emptyMessage: "p-listbox-empty-message"
};
var ListboxStyle = BaseStyle.extend({
  name: "listbox",
  theme: theme$n,
  classes: classes$p
});
var script$1$p = {
  name: "BaseListbox",
  "extends": script$_,
  props: {
    modelValue: null,
    options: Array,
    optionLabel: null,
    optionValue: null,
    optionDisabled: null,
    optionGroupLabel: null,
    optionGroupChildren: null,
    listStyle: null,
    scrollHeight: {
      type: String,
      "default": "14rem"
    },
    invalid: {
      type: Boolean,
      "default": false
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    dataKey: null,
    multiple: {
      type: Boolean,
      "default": false
    },
    metaKeySelection: {
      type: Boolean,
      "default": false
    },
    filter: Boolean,
    filterPlaceholder: String,
    filterLocale: String,
    filterMatchMode: {
      type: String,
      "default": "contains"
    },
    filterFields: {
      type: Array,
      "default": null
    },
    virtualScrollerOptions: {
      type: Object,
      "default": null
    },
    autoOptionFocus: {
      type: Boolean,
      "default": true
    },
    selectOnFocus: {
      type: Boolean,
      "default": false
    },
    focusOnHover: {
      type: Boolean,
      "default": true
    },
    highlightOnSelect: {
      type: Boolean,
      "default": true
    },
    checkmark: {
      type: Boolean,
      "default": false
    },
    filterMessage: {
      type: String,
      "default": null
    },
    selectionMessage: {
      type: String,
      "default": null
    },
    emptySelectionMessage: {
      type: String,
      "default": null
    },
    emptyFilterMessage: {
      type: String,
      "default": null
    },
    emptyMessage: {
      type: String,
      "default": null
    },
    filterIcon: {
      type: String,
      "default": void 0
    },
    striped: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: Number,
      "default": 0
    },
    ariaLabel: {
      type: String,
      "default": null
    },
    ariaLabelledby: {
      type: String,
      "default": null
    }
  },
  style: ListboxStyle,
  provide: /* @__PURE__ */ __name(function provide16() {
    return {
      $pcListbox: this,
      $parentInstance: this
    };
  }, "provide")
};
function _toConsumableArray$a(r) {
  return _arrayWithoutHoles$a(r) || _iterableToArray$a(r) || _unsupportedIterableToArray$c(r) || _nonIterableSpread$a();
}
__name(_toConsumableArray$a, "_toConsumableArray$a");
function _nonIterableSpread$a() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$a, "_nonIterableSpread$a");
function _unsupportedIterableToArray$c(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$c(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$c(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$c, "_unsupportedIterableToArray$c");
function _iterableToArray$a(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$a, "_iterableToArray$a");
function _arrayWithoutHoles$a(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$c(r);
}
__name(_arrayWithoutHoles$a, "_arrayWithoutHoles$a");
function _arrayLikeToArray$c(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$c, "_arrayLikeToArray$c");
var script$E = {
  name: "Listbox",
  "extends": script$1$p,
  inheritAttrs: false,
  emits: ["update:modelValue", "change", "focus", "blur", "filter", "item-dblclick", "option-dblclick"],
  list: null,
  virtualScroller: null,
  optionTouched: false,
  startRangeIndex: -1,
  searchTimeout: null,
  searchValue: "",
  data: /* @__PURE__ */ __name(function data6() {
    return {
      id: this.$attrs.id,
      filterValue: null,
      focused: false,
      focusedOptionIndex: -1
    };
  }, "data"),
  watch: {
    "$attrs.id": /* @__PURE__ */ __name(function $attrsId3(newValue2) {
      this.id = newValue2 || UniqueComponentId();
    }, "$attrsId"),
    options: /* @__PURE__ */ __name(function options2() {
      this.autoUpdateModel();
    }, "options")
  },
  mounted: /* @__PURE__ */ __name(function mounted8() {
    this.id = this.id || UniqueComponentId();
    this.autoUpdateModel();
  }, "mounted"),
  methods: {
    getOptionIndex: /* @__PURE__ */ __name(function getOptionIndex(index2, fn) {
      return this.virtualScrollerDisabled ? index2 : fn && fn(index2)["index"];
    }, "getOptionIndex"),
    getOptionLabel: /* @__PURE__ */ __name(function getOptionLabel(option3) {
      return this.optionLabel ? resolveFieldData(option3, this.optionLabel) : typeof option3 === "string" ? option3 : null;
    }, "getOptionLabel"),
    getOptionValue: /* @__PURE__ */ __name(function getOptionValue(option3) {
      return this.optionValue ? resolveFieldData(option3, this.optionValue) : option3;
    }, "getOptionValue"),
    getOptionRenderKey: /* @__PURE__ */ __name(function getOptionRenderKey(option3, index2) {
      return (this.dataKey ? resolveFieldData(option3, this.dataKey) : this.getOptionLabel(option3)) + "_" + index2;
    }, "getOptionRenderKey"),
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions3(option3, itemOptions, index2, key) {
      return this.ptm(key, {
        context: {
          selected: this.isSelected(option3),
          focused: this.focusedOptionIndex === this.getOptionIndex(index2, itemOptions),
          disabled: this.isOptionDisabled(option3)
        }
      });
    }, "getPTOptions"),
    isOptionDisabled: /* @__PURE__ */ __name(function isOptionDisabled(option3) {
      return this.optionDisabled ? resolveFieldData(option3, this.optionDisabled) : false;
    }, "isOptionDisabled"),
    isOptionGroup: /* @__PURE__ */ __name(function isOptionGroup(option3) {
      return this.optionGroupLabel && option3.optionGroup && option3.group;
    }, "isOptionGroup"),
    getOptionGroupLabel: /* @__PURE__ */ __name(function getOptionGroupLabel(optionGroup) {
      return resolveFieldData(optionGroup, this.optionGroupLabel);
    }, "getOptionGroupLabel"),
    getOptionGroupChildren: /* @__PURE__ */ __name(function getOptionGroupChildren(optionGroup) {
      return resolveFieldData(optionGroup, this.optionGroupChildren);
    }, "getOptionGroupChildren"),
    getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset(index2) {
      var _this = this;
      return (this.optionGroupLabel ? index2 - this.visibleOptions.slice(0, index2).filter(function(option3) {
        return _this.isOptionGroup(option3);
      }).length : index2) + 1;
    }, "getAriaPosInset"),
    onFirstHiddenFocus: /* @__PURE__ */ __name(function onFirstHiddenFocus() {
      focus$1(this.list);
      var firstFocusableEl = getFirstFocusableElement(this.$el, ':not([data-p-hidden-focusable="true"])');
      this.$refs.lastHiddenFocusableElement.tabIndex = isElement(firstFocusableEl) ? void 0 : -1;
      this.$refs.firstHiddenFocusableElement.tabIndex = -1;
    }, "onFirstHiddenFocus"),
    onLastHiddenFocus: /* @__PURE__ */ __name(function onLastHiddenFocus(event) {
      var relatedTarget = event.relatedTarget;
      if (relatedTarget === this.list) {
        var firstFocusableEl = getFirstFocusableElement(this.$el, ':not([data-p-hidden-focusable="true"])');
        focus$1(firstFocusableEl);
        this.$refs.firstHiddenFocusableElement.tabIndex = void 0;
      } else {
        focus$1(this.$refs.firstHiddenFocusableElement);
      }
      this.$refs.lastHiddenFocusableElement.tabIndex = -1;
    }, "onLastHiddenFocus"),
    onFocusout: /* @__PURE__ */ __name(function onFocusout(event) {
      if (!this.$el.contains(event.relatedTarget) && this.$refs.lastHiddenFocusableElement && this.$refs.firstHiddenFocusableElement) {
        this.$refs.lastHiddenFocusableElement.tabIndex = this.$refs.firstHiddenFocusableElement.tabIndex = void 0;
      }
    }, "onFocusout"),
    onListFocus: /* @__PURE__ */ __name(function onListFocus(event) {
      this.focused = true;
      this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.findSelectedOptionIndex();
      this.autoUpdateModel();
      this.$emit("focus", event);
    }, "onListFocus"),
    onListBlur: /* @__PURE__ */ __name(function onListBlur(event) {
      this.focused = false;
      this.focusedOptionIndex = this.startRangeIndex = -1;
      this.searchValue = "";
      this.$emit("blur", event);
    }, "onListBlur"),
    onListKeyDown: /* @__PURE__ */ __name(function onListKeyDown(event) {
      var _this2 = this;
      var metaKey = event.metaKey || event.ctrlKey;
      switch (event.code) {
        case "ArrowDown":
          this.onArrowDownKey(event);
          break;
        case "ArrowUp":
          this.onArrowUpKey(event);
          break;
        case "Home":
          this.onHomeKey(event);
          break;
        case "End":
          this.onEndKey(event);
          break;
        case "PageDown":
          this.onPageDownKey(event);
          break;
        case "PageUp":
          this.onPageUpKey(event);
          break;
        case "Enter":
        case "NumpadEnter":
        case "Space":
          this.onSpaceKey(event);
          break;
        case "Tab":
          break;
        case "ShiftLeft":
        case "ShiftRight":
          this.onShiftKey(event);
          break;
        default:
          if (this.multiple && event.code === "KeyA" && metaKey) {
            var value4 = this.visibleOptions.filter(function(option3) {
              return _this2.isValidOption(option3);
            }).map(function(option3) {
              return _this2.getOptionValue(option3);
            });
            this.updateModel(event, value4);
            event.preventDefault();
            break;
          }
          if (!metaKey && isPrintableCharacter(event.key)) {
            this.searchOptions(event, event.key);
            event.preventDefault();
          }
          break;
      }
    }, "onListKeyDown"),
    onOptionSelect: /* @__PURE__ */ __name(function onOptionSelect(event, option3) {
      var index2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
      if (this.disabled || this.isOptionDisabled(option3)) {
        return;
      }
      this.multiple ? this.onOptionSelectMultiple(event, option3) : this.onOptionSelectSingle(event, option3);
      this.optionTouched = false;
      index2 !== -1 && (this.focusedOptionIndex = index2);
    }, "onOptionSelect"),
    onOptionMouseDown: /* @__PURE__ */ __name(function onOptionMouseDown(event, index2) {
      this.changeFocusedOptionIndex(event, index2);
    }, "onOptionMouseDown"),
    onOptionMouseMove: /* @__PURE__ */ __name(function onOptionMouseMove(event, index2) {
      if (this.focusOnHover && this.focused) {
        this.changeFocusedOptionIndex(event, index2);
      }
    }, "onOptionMouseMove"),
    onOptionTouchEnd: /* @__PURE__ */ __name(function onOptionTouchEnd() {
      if (this.disabled) {
        return;
      }
      this.optionTouched = true;
    }, "onOptionTouchEnd"),
    onOptionDblClick: /* @__PURE__ */ __name(function onOptionDblClick(event, item3) {
      this.$emit("item-dblclick", {
        originalEvent: event,
        value: item3
      });
      this.$emit("option-dblclick", {
        originalEvent: event,
        value: item3
      });
    }, "onOptionDblClick"),
    onOptionSelectSingle: /* @__PURE__ */ __name(function onOptionSelectSingle(event, option3) {
      var selected2 = this.isSelected(option3);
      var valueChanged = false;
      var value4 = null;
      var metaSelection = this.optionTouched ? false : this.metaKeySelection;
      if (metaSelection) {
        var metaKey = event && (event.metaKey || event.ctrlKey);
        if (selected2) {
          if (metaKey) {
            value4 = null;
            valueChanged = true;
          }
        } else {
          value4 = this.getOptionValue(option3);
          valueChanged = true;
        }
      } else {
        value4 = selected2 ? null : this.getOptionValue(option3);
        valueChanged = true;
      }
      if (valueChanged) {
        this.updateModel(event, value4);
      }
    }, "onOptionSelectSingle"),
    onOptionSelectMultiple: /* @__PURE__ */ __name(function onOptionSelectMultiple(event, option3) {
      var selected2 = this.isSelected(option3);
      var value4 = null;
      var metaSelection = this.optionTouched ? false : this.metaKeySelection;
      if (metaSelection) {
        var metaKey = event.metaKey || event.ctrlKey;
        if (selected2) {
          value4 = metaKey ? this.removeOption(option3) : [this.getOptionValue(option3)];
        } else {
          value4 = metaKey ? this.modelValue || [] : [];
          value4 = [].concat(_toConsumableArray$a(value4), [this.getOptionValue(option3)]);
        }
      } else {
        value4 = selected2 ? this.removeOption(option3) : [].concat(_toConsumableArray$a(this.modelValue || []), [this.getOptionValue(option3)]);
      }
      this.updateModel(event, value4);
    }, "onOptionSelectMultiple"),
    onOptionSelectRange: /* @__PURE__ */ __name(function onOptionSelectRange(event) {
      var _this3 = this;
      var start2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -1;
      var end = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
      start2 === -1 && (start2 = this.findNearestSelectedOptionIndex(end, true));
      end === -1 && (end = this.findNearestSelectedOptionIndex(start2));
      if (start2 !== -1 && end !== -1) {
        var rangeStart = Math.min(start2, end);
        var rangeEnd = Math.max(start2, end);
        var value4 = this.visibleOptions.slice(rangeStart, rangeEnd + 1).filter(function(option3) {
          return _this3.isValidOption(option3);
        }).map(function(option3) {
          return _this3.getOptionValue(option3);
        });
        this.updateModel(event, value4);
      }
    }, "onOptionSelectRange"),
    onFilterChange: /* @__PURE__ */ __name(function onFilterChange(event) {
      this.$emit("filter", {
        originalEvent: event,
        value: event.target.value
      });
      this.focusedOptionIndex = this.startRangeIndex = -1;
    }, "onFilterChange"),
    onFilterBlur: /* @__PURE__ */ __name(function onFilterBlur() {
      this.focusedOptionIndex = this.startRangeIndex = -1;
    }, "onFilterBlur"),
    onFilterKeyDown: /* @__PURE__ */ __name(function onFilterKeyDown(event) {
      switch (event.code) {
        case "ArrowDown":
          this.onArrowDownKey(event);
          break;
        case "ArrowUp":
          this.onArrowUpKey(event);
          break;
        case "ArrowLeft":
        case "ArrowRight":
          this.onArrowLeftKey(event, true);
          break;
        case "Home":
          this.onHomeKey(event, true);
          break;
        case "End":
          this.onEndKey(event, true);
          break;
        case "Enter":
        case "NumpadEnter":
          this.onEnterKey(event);
          break;
        case "ShiftLeft":
        case "ShiftRight":
          this.onShiftKey(event);
          break;
      }
    }, "onFilterKeyDown"),
    onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey(event) {
      var optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();
      if (this.multiple && event.shiftKey) {
        this.onOptionSelectRange(event, this.startRangeIndex, optionIndex);
      }
      this.changeFocusedOptionIndex(event, optionIndex);
      event.preventDefault();
    }, "onArrowDownKey"),
    onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey(event) {
      var optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.findLastFocusedOptionIndex();
      if (this.multiple && event.shiftKey) {
        this.onOptionSelectRange(event, optionIndex, this.startRangeIndex);
      }
      this.changeFocusedOptionIndex(event, optionIndex);
      event.preventDefault();
    }, "onArrowUpKey"),
    onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      pressedInInputText && (this.focusedOptionIndex = -1);
    }, "onArrowLeftKey"),
    onHomeKey: /* @__PURE__ */ __name(function onHomeKey(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (pressedInInputText) {
        var target = event.currentTarget;
        if (event.shiftKey) {
          target.setSelectionRange(0, event.target.selectionStart);
        } else {
          target.setSelectionRange(0, 0);
          this.focusedOptionIndex = -1;
        }
      } else {
        var metaKey = event.metaKey || event.ctrlKey;
        var optionIndex = this.findFirstOptionIndex();
        if (this.multiple && event.shiftKey && metaKey) {
          this.onOptionSelectRange(event, optionIndex, this.startRangeIndex);
        }
        this.changeFocusedOptionIndex(event, optionIndex);
      }
      event.preventDefault();
    }, "onHomeKey"),
    onEndKey: /* @__PURE__ */ __name(function onEndKey(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (pressedInInputText) {
        var target = event.currentTarget;
        if (event.shiftKey) {
          target.setSelectionRange(event.target.selectionStart, target.value.length);
        } else {
          var len = target.value.length;
          target.setSelectionRange(len, len);
          this.focusedOptionIndex = -1;
        }
      } else {
        var metaKey = event.metaKey || event.ctrlKey;
        var optionIndex = this.findLastOptionIndex();
        if (this.multiple && event.shiftKey && metaKey) {
          this.onOptionSelectRange(event, this.startRangeIndex, optionIndex);
        }
        this.changeFocusedOptionIndex(event, optionIndex);
      }
      event.preventDefault();
    }, "onEndKey"),
    onPageUpKey: /* @__PURE__ */ __name(function onPageUpKey(event) {
      this.scrollInView(0);
      event.preventDefault();
    }, "onPageUpKey"),
    onPageDownKey: /* @__PURE__ */ __name(function onPageDownKey(event) {
      this.scrollInView(this.visibleOptions.length - 1);
      event.preventDefault();
    }, "onPageDownKey"),
    onEnterKey: /* @__PURE__ */ __name(function onEnterKey(event) {
      if (this.focusedOptionIndex !== -1) {
        if (this.multiple && event.shiftKey) this.onOptionSelectRange(event, this.focusedOptionIndex);
        else this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
      }
    }, "onEnterKey"),
    onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey(event) {
      event.preventDefault();
      this.onEnterKey(event);
    }, "onSpaceKey"),
    onShiftKey: /* @__PURE__ */ __name(function onShiftKey() {
      this.startRangeIndex = this.focusedOptionIndex;
    }, "onShiftKey"),
    isOptionMatched: /* @__PURE__ */ __name(function isOptionMatched(option3) {
      var _this$getOptionLabel;
      return this.isValidOption(option3) && typeof this.getOptionLabel(option3) === "string" && ((_this$getOptionLabel = this.getOptionLabel(option3)) === null || _this$getOptionLabel === void 0 ? void 0 : _this$getOptionLabel.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)));
    }, "isOptionMatched"),
    isValidOption: /* @__PURE__ */ __name(function isValidOption(option3) {
      return isNotEmpty(option3) && !(this.isOptionDisabled(option3) || this.isOptionGroup(option3));
    }, "isValidOption"),
    isValidSelectedOption: /* @__PURE__ */ __name(function isValidSelectedOption(option3) {
      return this.isValidOption(option3) && this.isSelected(option3);
    }, "isValidSelectedOption"),
    isEquals: /* @__PURE__ */ __name(function isEquals(value1, value22) {
      return equals(value1, value22, this.equalityKey);
    }, "isEquals"),
    isSelected: /* @__PURE__ */ __name(function isSelected(option3) {
      var _this4 = this;
      var optionValue = this.getOptionValue(option3);
      if (this.multiple) return (this.modelValue || []).some(function(value4) {
        return _this4.isEquals(value4, optionValue);
      });
      else return this.isEquals(this.modelValue, optionValue);
    }, "isSelected"),
    findFirstOptionIndex: /* @__PURE__ */ __name(function findFirstOptionIndex() {
      var _this5 = this;
      return this.visibleOptions.findIndex(function(option3) {
        return _this5.isValidOption(option3);
      });
    }, "findFirstOptionIndex"),
    findLastOptionIndex: /* @__PURE__ */ __name(function findLastOptionIndex() {
      var _this6 = this;
      return findLastIndex(this.visibleOptions, function(option3) {
        return _this6.isValidOption(option3);
      });
    }, "findLastOptionIndex"),
    findNextOptionIndex: /* @__PURE__ */ __name(function findNextOptionIndex(index2) {
      var _this7 = this;
      var matchedOptionIndex = index2 < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index2 + 1).findIndex(function(option3) {
        return _this7.isValidOption(option3);
      }) : -1;
      return matchedOptionIndex > -1 ? matchedOptionIndex + index2 + 1 : index2;
    }, "findNextOptionIndex"),
    findPrevOptionIndex: /* @__PURE__ */ __name(function findPrevOptionIndex(index2) {
      var _this8 = this;
      var matchedOptionIndex = index2 > 0 ? findLastIndex(this.visibleOptions.slice(0, index2), function(option3) {
        return _this8.isValidOption(option3);
      }) : -1;
      return matchedOptionIndex > -1 ? matchedOptionIndex : index2;
    }, "findPrevOptionIndex"),
    findSelectedOptionIndex: /* @__PURE__ */ __name(function findSelectedOptionIndex() {
      var _this9 = this;
      if (this.hasSelectedOption) {
        if (this.multiple) {
          var _loop = /* @__PURE__ */ __name(function _loop2() {
            var value4 = _this9.modelValue[index2];
            var matchedOptionIndex = _this9.visibleOptions.findIndex(function(option3) {
              return _this9.isValidSelectedOption(option3) && _this9.isEquals(value4, _this9.getOptionValue(option3));
            });
            if (matchedOptionIndex > -1) return {
              v: matchedOptionIndex
            };
          }, "_loop"), _ret;
          for (var index2 = this.modelValue.length - 1; index2 >= 0; index2--) {
            _ret = _loop();
            if (_ret) return _ret.v;
          }
        } else {
          return this.visibleOptions.findIndex(function(option3) {
            return _this9.isValidSelectedOption(option3);
          });
        }
      }
      return -1;
    }, "findSelectedOptionIndex"),
    findFirstSelectedOptionIndex: /* @__PURE__ */ __name(function findFirstSelectedOptionIndex() {
      var _this10 = this;
      return this.hasSelectedOption ? this.visibleOptions.findIndex(function(option3) {
        return _this10.isValidSelectedOption(option3);
      }) : -1;
    }, "findFirstSelectedOptionIndex"),
    findLastSelectedOptionIndex: /* @__PURE__ */ __name(function findLastSelectedOptionIndex() {
      var _this11 = this;
      return this.hasSelectedOption ? findLastIndex(this.visibleOptions, function(option3) {
        return _this11.isValidSelectedOption(option3);
      }) : -1;
    }, "findLastSelectedOptionIndex"),
    findNextSelectedOptionIndex: /* @__PURE__ */ __name(function findNextSelectedOptionIndex(index2) {
      var _this12 = this;
      var matchedOptionIndex = this.hasSelectedOption && index2 < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index2 + 1).findIndex(function(option3) {
        return _this12.isValidSelectedOption(option3);
      }) : -1;
      return matchedOptionIndex > -1 ? matchedOptionIndex + index2 + 1 : -1;
    }, "findNextSelectedOptionIndex"),
    findPrevSelectedOptionIndex: /* @__PURE__ */ __name(function findPrevSelectedOptionIndex(index2) {
      var _this13 = this;
      var matchedOptionIndex = this.hasSelectedOption && index2 > 0 ? findLastIndex(this.visibleOptions.slice(0, index2), function(option3) {
        return _this13.isValidSelectedOption(option3);
      }) : -1;
      return matchedOptionIndex > -1 ? matchedOptionIndex : -1;
    }, "findPrevSelectedOptionIndex"),
    findNearestSelectedOptionIndex: /* @__PURE__ */ __name(function findNearestSelectedOptionIndex(index2) {
      var firstCheckUp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      var matchedOptionIndex = -1;
      if (this.hasSelectedOption) {
        if (firstCheckUp) {
          matchedOptionIndex = this.findPrevSelectedOptionIndex(index2);
          matchedOptionIndex = matchedOptionIndex === -1 ? this.findNextSelectedOptionIndex(index2) : matchedOptionIndex;
        } else {
          matchedOptionIndex = this.findNextSelectedOptionIndex(index2);
          matchedOptionIndex = matchedOptionIndex === -1 ? this.findPrevSelectedOptionIndex(index2) : matchedOptionIndex;
        }
      }
      return matchedOptionIndex > -1 ? matchedOptionIndex : index2;
    }, "findNearestSelectedOptionIndex"),
    findFirstFocusedOptionIndex: /* @__PURE__ */ __name(function findFirstFocusedOptionIndex() {
      var selectedIndex = this.findFirstSelectedOptionIndex();
      return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;
    }, "findFirstFocusedOptionIndex"),
    findLastFocusedOptionIndex: /* @__PURE__ */ __name(function findLastFocusedOptionIndex() {
      var selectedIndex = this.findLastSelectedOptionIndex();
      return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
    }, "findLastFocusedOptionIndex"),
    searchOptions: /* @__PURE__ */ __name(function searchOptions(event, _char) {
      var _this14 = this;
      this.searchValue = (this.searchValue || "") + _char;
      var optionIndex = -1;
      if (isNotEmpty(this.searchValue)) {
        if (this.focusedOptionIndex !== -1) {
          optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function(option3) {
            return _this14.isOptionMatched(option3);
          });
          optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(function(option3) {
            return _this14.isOptionMatched(option3);
          }) : optionIndex + this.focusedOptionIndex;
        } else {
          optionIndex = this.visibleOptions.findIndex(function(option3) {
            return _this14.isOptionMatched(option3);
          });
        }
        if (optionIndex === -1 && this.focusedOptionIndex === -1) {
          optionIndex = this.findFirstFocusedOptionIndex();
        }
        if (optionIndex !== -1) {
          this.changeFocusedOptionIndex(event, optionIndex);
        }
      }
      if (this.searchTimeout) {
        clearTimeout(this.searchTimeout);
      }
      this.searchTimeout = setTimeout(function() {
        _this14.searchValue = "";
        _this14.searchTimeout = null;
      }, 500);
    }, "searchOptions"),
    removeOption: /* @__PURE__ */ __name(function removeOption(option3) {
      var _this15 = this;
      return this.modelValue.filter(function(val) {
        return !equals(val, _this15.getOptionValue(option3), _this15.equalityKey);
      });
    }, "removeOption"),
    changeFocusedOptionIndex: /* @__PURE__ */ __name(function changeFocusedOptionIndex(event, index2) {
      if (this.focusedOptionIndex !== index2) {
        this.focusedOptionIndex = index2;
        this.scrollInView();
        if (this.selectOnFocus && !this.multiple) {
          this.onOptionSelect(event, this.visibleOptions[index2]);
        }
      }
    }, "changeFocusedOptionIndex"),
    scrollInView: /* @__PURE__ */ __name(function scrollInView3() {
      var _this16 = this;
      var index2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
      this.$nextTick(function() {
        var id3 = index2 !== -1 ? "".concat(_this16.id, "_").concat(index2) : _this16.focusedOptionId;
        var element = findSingle(_this16.list, 'li[id="'.concat(id3, '"]'));
        if (element) {
          element.scrollIntoView && element.scrollIntoView({
            block: "nearest",
            inline: "nearest",
            behavior: "smooth"
          });
        } else if (!_this16.virtualScrollerDisabled) {
          _this16.virtualScroller && _this16.virtualScroller.scrollToIndex(index2 !== -1 ? index2 : _this16.focusedOptionIndex);
        }
      });
    }, "scrollInView"),
    autoUpdateModel: /* @__PURE__ */ __name(function autoUpdateModel() {
      if (this.selectOnFocus && this.autoOptionFocus && !this.hasSelectedOption && !this.multiple && this.focused) {
        this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
        this.onOptionSelect(null, this.visibleOptions[this.focusedOptionIndex]);
      }
    }, "autoUpdateModel"),
    updateModel: /* @__PURE__ */ __name(function updateModel(event, value4) {
      this.$emit("update:modelValue", value4);
      this.$emit("change", {
        originalEvent: event,
        value: value4
      });
    }, "updateModel"),
    flatOptions: /* @__PURE__ */ __name(function flatOptions(options4) {
      var _this17 = this;
      return (options4 || []).reduce(function(result, option3, index2) {
        result.push({
          optionGroup: option3,
          group: true,
          index: index2
        });
        var optionGroupChildren = _this17.getOptionGroupChildren(option3);
        optionGroupChildren && optionGroupChildren.forEach(function(o) {
          return result.push(o);
        });
        return result;
      }, []);
    }, "flatOptions"),
    listRef: /* @__PURE__ */ __name(function listRef(el, contentRef3) {
      this.list = el;
      contentRef3 && contentRef3(el);
    }, "listRef"),
    virtualScrollerRef: /* @__PURE__ */ __name(function virtualScrollerRef(el) {
      this.virtualScroller = el;
    }, "virtualScrollerRef")
  },
  computed: {
    visibleOptions: /* @__PURE__ */ __name(function visibleOptions() {
      var options4 = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
      return this.filterValue ? FilterService.filter(options4, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale) : options4;
    }, "visibleOptions"),
    hasSelectedOption: /* @__PURE__ */ __name(function hasSelectedOption() {
      return isNotEmpty(this.modelValue);
    }, "hasSelectedOption"),
    equalityKey: /* @__PURE__ */ __name(function equalityKey() {
      return this.optionValue ? null : this.dataKey;
    }, "equalityKey"),
    searchFields: /* @__PURE__ */ __name(function searchFields() {
      return this.filterFields || [this.optionLabel];
    }, "searchFields"),
    filterResultMessageText: /* @__PURE__ */ __name(function filterResultMessageText() {
      return isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll("{0}", this.visibleOptions.length) : this.emptyFilterMessageText;
    }, "filterResultMessageText"),
    filterMessageText: /* @__PURE__ */ __name(function filterMessageText() {
      return this.filterMessage || this.$primevue.config.locale.searchMessage || "";
    }, "filterMessageText"),
    emptyFilterMessageText: /* @__PURE__ */ __name(function emptyFilterMessageText() {
      return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || "";
    }, "emptyFilterMessageText"),
    emptyMessageText: /* @__PURE__ */ __name(function emptyMessageText() {
      return this.emptyMessage || this.$primevue.config.locale.emptyMessage || "";
    }, "emptyMessageText"),
    selectionMessageText: /* @__PURE__ */ __name(function selectionMessageText() {
      return this.selectionMessage || this.$primevue.config.locale.selectionMessage || "";
    }, "selectionMessageText"),
    emptySelectionMessageText: /* @__PURE__ */ __name(function emptySelectionMessageText() {
      return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || "";
    }, "emptySelectionMessageText"),
    selectedMessageText: /* @__PURE__ */ __name(function selectedMessageText() {
      return this.hasSelectedOption ? this.selectionMessageText.replaceAll("{0}", this.multiple ? this.modelValue.length : "1") : this.emptySelectionMessageText;
    }, "selectedMessageText"),
    focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId() {
      return this.focusedOptionIndex !== -1 ? "".concat(this.id, "_").concat(this.focusedOptionIndex) : null;
    }, "focusedOptionId"),
    ariaSetSize: /* @__PURE__ */ __name(function ariaSetSize() {
      var _this18 = this;
      return this.visibleOptions.filter(function(option3) {
        return !_this18.isOptionGroup(option3);
      }).length;
    }, "ariaSetSize"),
    virtualScrollerDisabled: /* @__PURE__ */ __name(function virtualScrollerDisabled() {
      return !this.virtualScrollerOptions;
    }, "virtualScrollerDisabled")
  },
  directives: {
    ripple: Ripple
  },
  components: {
    InputText: script$G,
    VirtualScroller: script$F,
    InputIcon: script$H,
    IconField: script$I,
    SearchIcon: script$J,
    CheckIcon: script$K,
    BlankIcon: script$L
  }
};
var _hoisted_1$18 = ["id"];
var _hoisted_2$R = ["tabindex"];
var _hoisted_3$r = ["id", "aria-multiselectable", "aria-label", "aria-labelledby", "aria-activedescendant", "aria-disabled"];
var _hoisted_4$k = ["id"];
var _hoisted_5$f = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousedown", "onMousemove", "onDblclick", "data-p-selected", "data-p-focused", "data-p-disabled"];
var _hoisted_6$b = ["tabindex"];
function render$D(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_InputText = resolveComponent("InputText");
  var _component_SearchIcon = resolveComponent("SearchIcon");
  var _component_InputIcon = resolveComponent("InputIcon");
  var _component_IconField = resolveComponent("IconField");
  var _component_CheckIcon = resolveComponent("CheckIcon");
  var _component_BlankIcon = resolveComponent("BlankIcon");
  var _component_VirtualScroller = resolveComponent("VirtualScroller");
  var _directive_ripple = resolveDirective("ripple");
  return openBlock(), createElementBlock("div", mergeProps({
    id: $data.id,
    "class": _ctx.cx("root"),
    onFocusout: _cache[7] || (_cache[7] = function() {
      return $options.onFocusout && $options.onFocusout.apply($options, arguments);
    })
  }, _ctx.ptmi("root")), [createBaseVNode("span", mergeProps({
    ref: "firstHiddenFocusableElement",
    role: "presentation",
    "aria-hidden": "true",
    "class": "p-hidden-accessible p-hidden-focusable",
    tabindex: !_ctx.disabled ? _ctx.tabindex : -1,
    onFocus: _cache[0] || (_cache[0] = function() {
      return $options.onFirstHiddenFocus && $options.onFirstHiddenFocus.apply($options, arguments);
    })
  }, _ctx.ptm("hiddenFirstFocusableEl"), {
    "data-p-hidden-accessible": true,
    "data-p-hidden-focusable": true
  }), null, 16, _hoisted_2$R), _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
    key: 0,
    "class": normalizeClass(_ctx.cx("header"))
  }, [renderSlot(_ctx.$slots, "header", {
    value: _ctx.modelValue,
    options: $options.visibleOptions
  })], 2)) : createCommentVNode("", true), _ctx.filter ? (openBlock(), createElementBlock("div", mergeProps({
    key: 1,
    "class": _ctx.cx("header")
  }, _ctx.ptm("header")), [createVNode(_component_IconField, {
    unstyled: _ctx.unstyled,
    pt: _ctx.ptm("pcFilterContainer")
  }, {
    "default": withCtx(function() {
      return [createVNode(_component_InputText, {
        modelValue: $data.filterValue,
        "onUpdate:modelValue": _cache[1] || (_cache[1] = function($event) {
          return $data.filterValue = $event;
        }),
        type: "text",
        "class": normalizeClass(_ctx.cx("pcFilter")),
        placeholder: _ctx.filterPlaceholder,
        role: "searchbox",
        autocomplete: "off",
        disabled: _ctx.disabled,
        unstyled: _ctx.unstyled,
        "aria-owns": $data.id + "_list",
        "aria-activedescendant": $options.focusedOptionId,
        tabindex: !_ctx.disabled && !$data.focused ? _ctx.tabindex : -1,
        onInput: $options.onFilterChange,
        onBlur: $options.onFilterBlur,
        onKeydown: $options.onFilterKeyDown,
        pt: _ctx.ptm("pcFilter")
      }, null, 8, ["modelValue", "class", "placeholder", "disabled", "unstyled", "aria-owns", "aria-activedescendant", "tabindex", "onInput", "onBlur", "onKeydown", "pt"]), createVNode(_component_InputIcon, mergeProps({
        unstyled: _ctx.unstyled
      }, _ctx.ptm("pcFilterIconContainer")), {
        "default": withCtx(function() {
          return [renderSlot(_ctx.$slots, "filtericon", {}, function() {
            return [_ctx.filterIcon ? (openBlock(), createElementBlock("span", mergeProps({
              key: 0,
              "class": _ctx.filterIcon
            }, _ctx.ptm("filterIcon")), null, 16)) : (openBlock(), createBlock(_component_SearchIcon, normalizeProps(mergeProps({
              key: 1
            }, _ctx.ptm("filterIcon"))), null, 16))];
          })];
        }),
        _: 3
      }, 16, ["unstyled"])];
    }),
    _: 3
  }, 8, ["unstyled", "pt"]), createBaseVNode("span", mergeProps({
    role: "status",
    "aria-live": "polite",
    "class": "p-hidden-accessible"
  }, _ctx.ptm("hiddenFilterResult"), {
    "data-p-hidden-accessible": true
  }), toDisplayString$1($options.filterResultMessageText), 17)], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("listContainer"),
    style: [{
      "max-height": $options.virtualScrollerDisabled ? _ctx.scrollHeight : ""
    }, _ctx.listStyle]
  }, _ctx.ptm("listContainer")), [createVNode(_component_VirtualScroller, mergeProps({
    ref: $options.virtualScrollerRef
  }, _ctx.virtualScrollerOptions, {
    items: $options.visibleOptions,
    style: [{
      height: _ctx.scrollHeight
    }, _ctx.listStyle],
    tabindex: -1,
    disabled: $options.virtualScrollerDisabled,
    pt: _ctx.ptm("virtualScroller")
  }), createSlots({
    content: withCtx(function(_ref) {
      var styleClass = _ref.styleClass, contentRef3 = _ref.contentRef, items2 = _ref.items, getItemOptions = _ref.getItemOptions, contentStyle = _ref.contentStyle, itemSize2 = _ref.itemSize;
      return [createBaseVNode("ul", mergeProps({
        ref: /* @__PURE__ */ __name(function ref2(el) {
          return $options.listRef(el, contentRef3);
        }, "ref"),
        id: $data.id + "_list",
        "class": [_ctx.cx("list"), styleClass],
        style: contentStyle,
        tabindex: -1,
        role: "listbox",
        "aria-multiselectable": _ctx.multiple,
        "aria-label": _ctx.ariaLabel,
        "aria-labelledby": _ctx.ariaLabelledby,
        "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0,
        "aria-disabled": _ctx.disabled,
        onFocus: _cache[3] || (_cache[3] = function() {
          return $options.onListFocus && $options.onListFocus.apply($options, arguments);
        }),
        onBlur: _cache[4] || (_cache[4] = function() {
          return $options.onListBlur && $options.onListBlur.apply($options, arguments);
        }),
        onKeydown: _cache[5] || (_cache[5] = function() {
          return $options.onListKeyDown && $options.onListKeyDown.apply($options, arguments);
        })
      }, _ctx.ptm("list")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList(items2, function(option3, i2) {
        return openBlock(), createElementBlock(Fragment$1, {
          key: $options.getOptionRenderKey(option3, $options.getOptionIndex(i2, getItemOptions))
        }, [$options.isOptionGroup(option3) ? (openBlock(), createElementBlock("li", mergeProps({
          key: 0,
          id: $data.id + "_" + $options.getOptionIndex(i2, getItemOptions),
          style: {
            height: itemSize2 ? itemSize2 + "px" : void 0
          },
          "class": _ctx.cx("optionGroup"),
          role: "option",
          ref_for: true
        }, _ctx.ptm("optionGroup")), [renderSlot(_ctx.$slots, "optiongroup", {
          option: option3.optionGroup,
          index: $options.getOptionIndex(i2, getItemOptions)
        }, function() {
          return [createTextVNode(toDisplayString$1($options.getOptionGroupLabel(option3.optionGroup)), 1)];
        })], 16, _hoisted_4$k)) : withDirectives((openBlock(), createElementBlock("li", mergeProps({
          key: 1,
          id: $data.id + "_" + $options.getOptionIndex(i2, getItemOptions),
          style: {
            height: itemSize2 ? itemSize2 + "px" : void 0
          },
          "class": _ctx.cx("option", {
            option: option3,
            index: i2,
            getItemOptions
          }),
          role: "option",
          "aria-label": $options.getOptionLabel(option3),
          "aria-selected": $options.isSelected(option3),
          "aria-disabled": $options.isOptionDisabled(option3),
          "aria-setsize": $options.ariaSetSize,
          "aria-posinset": $options.getAriaPosInset($options.getOptionIndex(i2, getItemOptions)),
          onClick: /* @__PURE__ */ __name(function onClick3($event) {
            return $options.onOptionSelect($event, option3, $options.getOptionIndex(i2, getItemOptions));
          }, "onClick"),
          onMousedown: /* @__PURE__ */ __name(function onMousedown($event) {
            return $options.onOptionMouseDown($event, $options.getOptionIndex(i2, getItemOptions));
          }, "onMousedown"),
          onMousemove: /* @__PURE__ */ __name(function onMousemove($event) {
            return $options.onOptionMouseMove($event, $options.getOptionIndex(i2, getItemOptions));
          }, "onMousemove"),
          onTouchend: _cache[2] || (_cache[2] = function($event) {
            return $options.onOptionTouchEnd();
          }),
          onDblclick: /* @__PURE__ */ __name(function onDblclick($event) {
            return $options.onOptionDblClick($event, option3);
          }, "onDblclick"),
          ref_for: true
        }, $options.getPTOptions(option3, getItemOptions, i2, "option"), {
          "data-p-selected": $options.isSelected(option3),
          "data-p-focused": $data.focusedOptionIndex === $options.getOptionIndex(i2, getItemOptions),
          "data-p-disabled": $options.isOptionDisabled(option3)
        }), [_ctx.checkmark ? (openBlock(), createElementBlock(Fragment$1, {
          key: 0
        }, [$options.isSelected(option3) ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({
          key: 0,
          "class": _ctx.cx("optionCheckIcon"),
          ref_for: true
        }, _ctx.ptm("optionCheckIcon")), null, 16, ["class"])) : (openBlock(), createBlock(_component_BlankIcon, mergeProps({
          key: 1,
          "class": _ctx.cx("optionBlankIcon"),
          ref_for: true
        }, _ctx.ptm("optionBlankIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "option", {
          option: option3,
          selected: $options.isSelected(option3),
          index: $options.getOptionIndex(i2, getItemOptions)
        }, function() {
          return [createTextVNode(toDisplayString$1($options.getOptionLabel(option3)), 1)];
        })], 16, _hoisted_5$f)), [[_directive_ripple]])], 64);
      }), 128)), $data.filterValue && (!items2 || items2 && items2.length === 0) ? (openBlock(), createElementBlock("li", mergeProps({
        key: 0,
        "class": _ctx.cx("emptyMessage"),
        role: "option"
      }, _ctx.ptm("emptyMessage")), [renderSlot(_ctx.$slots, "emptyfilter", {}, function() {
        return [createTextVNode(toDisplayString$1($options.emptyFilterMessageText), 1)];
      })], 16)) : !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock("li", mergeProps({
        key: 1,
        "class": _ctx.cx("emptyMessage"),
        role: "option"
      }, _ctx.ptm("emptyMessage")), [renderSlot(_ctx.$slots, "empty", {}, function() {
        return [createTextVNode(toDisplayString$1($options.emptyMessageText), 1)];
      })], 16)) : createCommentVNode("", true)], 16, _hoisted_3$r)];
    }),
    _: 2
  }, [_ctx.$slots.loader ? {
    name: "loader",
    fn: withCtx(function(_ref2) {
      var options4 = _ref2.options;
      return [renderSlot(_ctx.$slots, "loader", {
        options: options4
      })];
    }),
    key: "0"
  } : void 0]), 1040, ["items", "style", "disabled", "pt"])], 16), renderSlot(_ctx.$slots, "footer", {
    value: _ctx.modelValue,
    options: $options.visibleOptions
  }), !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock("span", mergeProps({
    key: 2,
    role: "status",
    "aria-live": "polite",
    "class": "p-hidden-accessible"
  }, _ctx.ptm("hiddenEmptyMessage"), {
    "data-p-hidden-accessible": true
  }), toDisplayString$1($options.emptyMessageText), 17)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
    role: "status",
    "aria-live": "polite",
    "class": "p-hidden-accessible"
  }, _ctx.ptm("hiddenSelectedMessage"), {
    "data-p-hidden-accessible": true
  }), toDisplayString$1($options.selectedMessageText), 17), createBaseVNode("span", mergeProps({
    ref: "lastHiddenFocusableElement",
    role: "presentation",
    "aria-hidden": "true",
    "class": "p-hidden-accessible p-hidden-focusable",
    tabindex: !_ctx.disabled ? _ctx.tabindex : -1,
    onFocus: _cache[6] || (_cache[6] = function() {
      return $options.onLastHiddenFocus && $options.onLastHiddenFocus.apply($options, arguments);
    })
  }, _ctx.ptm("hiddenLastFocusableEl"), {
    "data-p-hidden-accessible": true,
    "data-p-hidden-focusable": true
  }), null, 16, _hoisted_6$b)], 16, _hoisted_1$18);
}
__name(render$D, "render$D");
script$E.render = render$D;
const _withScopeId$k = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-425cc3ac"), n = n(), popScopeId(), n), "_withScopeId$k");
const _hoisted_1$17 = { class: "flex align-items-center" };
const _hoisted_2$Q = { class: "node-type" };
const _hoisted_3$q = {
  key: 0,
  class: "node-hint"
};
const _sfc_main$T = /* @__PURE__ */ defineComponent({
  __name: "LoadWorkflowWarning",
  props: {
    missingNodeTypes: {}
  },
  setup(__props) {
    const props = __props;
    const uniqueNodes = computed(() => {
      const seenTypes = /* @__PURE__ */ new Set();
      return props.missingNodeTypes.filter((node3) => {
        const type = typeof node3 === "object" ? node3.type : node3;
        if (seenTypes.has(type)) return false;
        seenTypes.add(type);
        return true;
      }).map((node3) => {
        if (typeof node3 === "object") {
          return {
            label: node3.type,
            hint: node3.hint,
            action: node3.action
          };
        }
        return { label: node3 };
      });
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(NoResultsPlaceholder, {
          class: "pb-0",
          icon: "pi pi-exclamation-circle",
          title: "Missing Node Types",
          message: "When loading the graph, the following node types were not found"
        }),
        createVNode(unref(script$E), {
          options: uniqueNodes.value,
          optionLabel: "label",
          scrollHeight: "100%",
          class: "comfy-missing-nodes",
          pt: {
            list: { class: "border-none" }
          }
        }, {
          option: withCtx((slotProps) => [
            createBaseVNode("div", _hoisted_1$17, [
              createBaseVNode("span", _hoisted_2$Q, toDisplayString$1(slotProps.option.label), 1),
              slotProps.option.hint ? (openBlock(), createElementBlock("span", _hoisted_3$q, toDisplayString$1(slotProps.option.hint), 1)) : createCommentVNode("", true),
              slotProps.option.action ? (openBlock(), createBlock(unref(script$R), {
                key: 1,
                onClick: slotProps.option.action.callback,
                label: slotProps.option.action.text,
                size: "small",
                outlined: ""
              }, null, 8, ["onClick", "label"])) : createCommentVNode("", true)
            ])
          ]),
          _: 1
        }, 8, ["options"])
      ], 64);
    };
  }
});
const LoadWorkflowWarning = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-425cc3ac"]]);
var theme$m = /* @__PURE__ */ __name(function theme17(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-progressbar {\n    position: relative;\n    overflow: hidden;\n    height: ".concat(dt2("progressbar.height"), ";\n    background: ").concat(dt2("progressbar.background"), ";\n    border-radius: ").concat(dt2("progressbar.border.radius"), ";\n}\n\n.p-progressbar-value {\n    margin: 0;\n    background: ").concat(dt2("progressbar.value.background"), ";\n}\n\n.p-progressbar-label {\n    color: ").concat(dt2("progressbar.label.color"), ";\n    font-size: ").concat(dt2("progressbar.label.font.size"), ";\n    font-weight: ").concat(dt2("progressbar.label.font.weight"), ';\n}\n\n.p-progressbar-determinate .p-progressbar-value {\n    height: 100%;\n    width: 0%;\n    position: absolute;\n    display: none;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    overflow: hidden;\n    transition: width 1s ease-in-out;\n}\n\n.p-progressbar-determinate .p-progressbar-label {\n    display: inline-flex;\n}\n\n.p-progressbar-indeterminate .p-progressbar-value::before {\n    content: "";\n    position: absolute;\n    background: inherit;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    will-change: left, right;\n    animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n}\n\n.p-progressbar-indeterminate .p-progressbar-value::after {\n    content: "";\n    position: absolute;\n    background: inherit;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    will-change: left, right;\n    animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n    animation-delay: 1.15s;\n}\n\n@-webkit-keyframes p-progressbar-indeterminate-anim {\n    0% {\n        left: -35%;\n        right: 100%;\n    }\n    60% {\n        left: 100%;\n        right: -90%;\n    }\n    100% {\n        left: 100%;\n        right: -90%;\n    }\n}\n@keyframes p-progressbar-indeterminate-anim {\n    0% {\n        left: -35%;\n        right: 100%;\n    }\n    60% {\n        left: 100%;\n        right: -90%;\n    }\n    100% {\n        left: 100%;\n        right: -90%;\n    }\n}\n@-webkit-keyframes p-progressbar-indeterminate-anim-short {\n    0% {\n        left: -200%;\n        right: 100%;\n    }\n    60% {\n        left: 107%;\n        right: -8%;\n    }\n    100% {\n        left: 107%;\n        right: -8%;\n    }\n}\n@keyframes p-progressbar-indeterminate-anim-short {\n    0% {\n        left: -200%;\n        right: 100%;\n    }\n    60% {\n        left: 107%;\n        right: -8%;\n    }\n    100% {\n        left: 107%;\n        right: -8%;\n    }\n}\n');
}, "theme");
var classes$o = {
  root: /* @__PURE__ */ __name(function root8(_ref2) {
    var instance = _ref2.instance;
    return ["p-progressbar p-component", {
      "p-progressbar-determinate": instance.determinate,
      "p-progressbar-indeterminate": instance.indeterminate
    }];
  }, "root"),
  value: "p-progressbar-value",
  label: "p-progressbar-label"
};
var ProgressBarStyle = BaseStyle.extend({
  name: "progressbar",
  theme: theme$m,
  classes: classes$o
});
var script$1$o = {
  name: "BaseProgressBar",
  "extends": script$_,
  props: {
    value: {
      type: Number,
      "default": null
    },
    mode: {
      type: String,
      "default": "determinate"
    },
    showValue: {
      type: Boolean,
      "default": true
    }
  },
  style: ProgressBarStyle,
  provide: /* @__PURE__ */ __name(function provide17() {
    return {
      $pcProgressBar: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$D = {
  name: "ProgressBar",
  "extends": script$1$o,
  inheritAttrs: false,
  computed: {
    progressStyle: /* @__PURE__ */ __name(function progressStyle() {
      return {
        width: this.value + "%",
        display: "flex"
      };
    }, "progressStyle"),
    indeterminate: /* @__PURE__ */ __name(function indeterminate() {
      return this.mode === "indeterminate";
    }, "indeterminate"),
    determinate: /* @__PURE__ */ __name(function determinate() {
      return this.mode === "determinate";
    }, "determinate")
  }
};
var _hoisted_1$16 = ["aria-valuenow"];
function render$C(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    role: "progressbar",
    "class": _ctx.cx("root"),
    "aria-valuemin": "0",
    "aria-valuenow": _ctx.value,
    "aria-valuemax": "100"
  }, _ctx.ptmi("root")), [$options.determinate ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("value"),
    style: $options.progressStyle
  }, _ctx.ptm("value")), [_ctx.value != null && _ctx.value !== 0 && _ctx.showValue ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("label")
  }, _ctx.ptm("label")), [renderSlot(_ctx.$slots, "default", {}, function() {
    return [createTextVNode(toDisplayString$1(_ctx.value + "%"), 1)];
  })], 16)) : createCommentVNode("", true)], 16)) : $options.indeterminate ? (openBlock(), createElementBlock("div", mergeProps({
    key: 1,
    "class": _ctx.cx("value")
  }, _ctx.ptm("value")), null, 16)) : createCommentVNode("", true)], 16, _hoisted_1$16);
}
__name(render$C, "render$C");
script$D.render = render$C;
function useDownload(url, fileName) {
  const fileSize = ref(null);
  const fetchFileSize = /* @__PURE__ */ __name(async () => {
    try {
      const response = await fetch(url, { method: "HEAD" });
      if (!response.ok) throw new Error("Failed to fetch file size");
      const size2 = response.headers.get("content-length");
      if (size2) {
        return parseInt(size2);
      } else {
        console.error('"content-length" header not found');
        return null;
      }
    } catch (e2) {
      console.error("Error fetching file size:", e2);
      return null;
    }
  }, "fetchFileSize");
  const triggerBrowserDownload = /* @__PURE__ */ __name(() => {
    const link2 = document.createElement("a");
    link2.href = url;
    link2.download = fileName || url.split("/").pop() || "download";
    link2.target = "_blank";
    link2.rel = "noopener noreferrer";
    link2.click();
  }, "triggerBrowserDownload");
  onMounted(async () => {
    fileSize.value = await fetchFileSize();
  });
  return {
    triggerBrowserDownload,
    fileSize
  };
}
__name(useDownload, "useDownload");
const IPC_CHANNELS = {
  LOADING_PROGRESS: "loading-progress",
  IS_PACKAGED: "is-packaged",
  RENDERER_READY: "renderer-ready",
  RESTART_APP: "restart-app",
  REINSTALL: "reinstall",
  LOG_MESSAGE: "log-message",
  OPEN_DIALOG: "open-dialog",
  DOWNLOAD_PROGRESS: "download-progress",
  START_DOWNLOAD: "start-download",
  PAUSE_DOWNLOAD: "pause-download",
  RESUME_DOWNLOAD: "resume-download",
  CANCEL_DOWNLOAD: "cancel-download",
  DELETE_MODEL: "delete-model",
  GET_ALL_DOWNLOADS: "get-all-downloads",
  GET_ELECTRON_VERSION: "get-electron-version",
  SEND_ERROR_TO_SENTRY: "send-error-to-sentry",
  GET_BASE_PATH: "get-base-path",
  GET_MODEL_CONFIG_PATH: "get-model-config-path",
  OPEN_PATH: "open-path",
  OPEN_LOGS_PATH: "open-logs-path",
  OPEN_DEV_TOOLS: "open-dev-tools",
  TERMINAL_WRITE: "execute-terminal-command",
  TERMINAL_RESIZE: "resize-terminal",
  TERMINAL_RESTORE: "restore-terminal",
  TERMINAL_ON_OUTPUT: "terminal-output",
  IS_FIRST_TIME_SETUP: "is-first-time-setup",
  GET_SYSTEM_PATHS: "get-system-paths",
  VALIDATE_INSTALL_PATH: "validate-install-path",
  VALIDATE_COMFYUI_SOURCE: "validate-comfyui-source",
  SHOW_DIRECTORY_PICKER: "show-directory-picker",
  INSTALL_COMFYUI: "install-comfyui",
  SHOW_CONTEXT_MENU: "show-context-menu",
  RESTART_CORE: "restart-core",
  GET_GPU: "get-gpu"
};
var ProgressStatus = /* @__PURE__ */ ((ProgressStatus2) => {
  ProgressStatus2["INITIAL_STATE"] = "initial-state";
  ProgressStatus2["PYTHON_SETUP"] = "python-setup";
  ProgressStatus2["STARTING_SERVER"] = "starting-server";
  ProgressStatus2["READY"] = "ready";
  ProgressStatus2["ERROR"] = "error";
  return ProgressStatus2;
})(ProgressStatus || {});
const ProgressMessages = {
  [
    "initial-state"
    /* INITIAL_STATE */
  ]: "Loading...",
  [
    "python-setup"
    /* PYTHON_SETUP */
  ]: "Setting up Python Environment...",
  [
    "starting-server"
    /* STARTING_SERVER */
  ]: "Starting ComfyUI server...",
  [
    "ready"
    /* READY */
  ]: "Finishing...",
  [
    "error"
    /* ERROR */
  ]: "Was not able to start ComfyUI. Please check the logs for more details. You can open it from the Help menu. Please report issues to: https://forum.comfy.org"
};
const ELECTRON_BRIDGE_API = "electronAPI";
const SENTRY_URL_ENDPOINT = "https://942cadba58d247c9cab96f45221aa813@o4507954455314432.ingest.us.sentry.io/4508007940685824";
const MigrationItems = [
  {
    id: "user_files",
    label: "User Files",
    description: "Settings and user-created workflows"
  },
  {
    id: "models",
    label: "Models",
    description: "Reference model files from existing ComfyUI installations. (No copy)"
  },
  {
    id: "custom_nodes",
    label: "Custom Nodes",
    description: "Reinstall custom nodes from existing ComfyUI installations."
  }
];
const DEFAULT_SERVER_ARGS = {
  /** The host to use for the ComfyUI server. */
  host: "127.0.0.1",
  /** The port to use for the ComfyUI server. */
  port: 8e3,
  // Extra arguments to pass to the ComfyUI server.
  extraServerArgs: {}
};
var DownloadStatus = /* @__PURE__ */ ((DownloadStatus2) => {
  DownloadStatus2["PENDING"] = "pending";
  DownloadStatus2["IN_PROGRESS"] = "in_progress";
  DownloadStatus2["COMPLETED"] = "completed";
  DownloadStatus2["PAUSED"] = "paused";
  DownloadStatus2["ERROR"] = "error";
  DownloadStatus2["CANCELLED"] = "cancelled";
  return DownloadStatus2;
})(DownloadStatus || {});
const useElectronDownloadStore = /* @__PURE__ */ defineStore("downloads", () => {
  const downloads = ref([]);
  const { DownloadManager } = electronAPI();
  const findByUrl = /* @__PURE__ */ __name((url) => downloads.value.find((download2) => url === download2.url), "findByUrl");
  const initialize2 = /* @__PURE__ */ __name(async () => {
    if (isElectron()) {
      const allDownloads = await DownloadManager.getAllDownloads();
      for (const download2 of allDownloads) {
        downloads.value.push(download2);
      }
      DownloadManager.onDownloadProgress((data24) => {
        if (!findByUrl(data24.url)) {
          downloads.value.push(data24);
        }
        const download2 = findByUrl(data24.url);
        if (download2) {
          download2.progress = data24.progress;
          download2.status = data24.status;
          download2.filename = data24.filename;
          download2.savePath = data24.savePath;
        }
      });
    }
  }, "initialize");
  void initialize2();
  const start2 = /* @__PURE__ */ __name(({
    url,
    savePath,
    filename
  }) => DownloadManager.startDownload(url, savePath, filename), "start");
  const pause = /* @__PURE__ */ __name((url) => DownloadManager.pauseDownload(url), "pause");
  const resume = /* @__PURE__ */ __name((url) => DownloadManager.resumeDownload(url), "resume");
  const cancel = /* @__PURE__ */ __name((url) => DownloadManager.cancelDownload(url), "cancel");
  return {
    downloads,
    start: start2,
    pause,
    resume,
    cancel,
    findByUrl,
    initialize: initialize2,
    inProgressDownloads: computed(
      () => downloads.value.filter(
        ({ status }) => status !== DownloadStatus.COMPLETED
      )
    )
  };
});
function formatCamelCase(str) {
  const isCamelCase = /^([A-Z][a-z]*)+$/.test(str);
  if (!isCamelCase) {
    return str;
  }
  const words = str.split(/(?=[A-Z][a-z])|\d+/);
  const processedWords = words.map((word) => {
    if (word.length > 1 && word === word.toUpperCase()) {
      return word;
    }
    return word.charAt(0).toUpperCase() + word.slice(1);
  });
  return processedWords.join(" ");
}
__name(formatCamelCase, "formatCamelCase");
function appendJsonExt(path) {
  if (!path.toLowerCase().endsWith(".json")) {
    path += ".json";
  }
  return path;
}
__name(appendJsonExt, "appendJsonExt");
function trimJsonExt(path) {
  return path?.replace(/\.json$/, "");
}
__name(trimJsonExt, "trimJsonExt");
function highlightQuery(text2, query) {
  if (!query) return text2;
  const regex2 = new RegExp(`(${query})`, "gi");
  return text2.replace(regex2, '<span class="highlight">$1</span>');
}
__name(highlightQuery, "highlightQuery");
function formatNumberWithSuffix(num, {
  precision = 1,
  roundToInt = false
} = {}) {
  const suffixes = ["", "k", "m", "b", "t"];
  const absNum = Math.abs(num);
  if (absNum < 1e3) {
    return roundToInt ? Math.round(num).toString() : num.toFixed(precision);
  }
  const exp = Math.min(Math.floor(Math.log10(absNum) / 3), suffixes.length - 1);
  const formattedNum = (num / Math.pow(1e3, exp)).toFixed(precision);
  return `${formattedNum}${suffixes[exp]}`;
}
__name(formatNumberWithSuffix, "formatNumberWithSuffix");
function formatSize(value4) {
  if (value4 === null || value4 === void 0) {
    return "-";
  }
  const bytes = value4;
  if (bytes === 0) return "0 B";
  const k = 1024;
  const sizes = ["B", "KB", "MB", "GB"];
  const i2 = Math.floor(Math.log(bytes) / Math.log(k));
  return `${parseFloat((bytes / Math.pow(k, i2)).toFixed(2))} ${sizes[i2]}`;
}
__name(formatSize, "formatSize");
function findCommonPrefix(path1, path2) {
  const parts1 = path1.split("/");
  const parts2 = path2.split("/");
  const commonParts = [];
  for (let i2 = 0; i2 < Math.min(parts1.length, parts2.length); i2++) {
    if (parts1[i2] === parts2[i2]) {
      commonParts.push(parts1[i2]);
    } else {
      break;
    }
  }
  return commonParts.join("/");
}
__name(findCommonPrefix, "findCommonPrefix");
function getFilenameDetails(fullFilename) {
  if (fullFilename.includes(".")) {
    return {
      filename: fullFilename.split(".").slice(0, -1).join("."),
      suffix: fullFilename.split(".").pop() ?? null
    };
  } else {
    return { filename: fullFilename, suffix: null };
  }
}
__name(getFilenameDetails, "getFilenameDetails");
function getPathDetails(path) {
  const directory = path.split("/").slice(0, -1).join("/");
  const fullFilename = path.split("/").pop() ?? path;
  return { directory, fullFilename, ...getFilenameDetails(fullFilename) };
}
__name(getPathDetails, "getPathDetails");
function normalizeI18nKey(key) {
  return key.replace(/\./g, "_");
}
__name(normalizeI18nKey, "normalizeI18nKey");
function processDynamicPrompt(input) {
  function stripComments(str) {
    return str.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, "");
  }
  __name(stripComments, "stripComments");
  let i2 = 0;
  let result = "";
  input = stripComments(input);
  const handleEscape = /* @__PURE__ */ __name(() => {
    const nextChar = input[i2++];
    return "\\" + nextChar;
  }, "handleEscape");
  function parseChoiceBlock() {
    const options4 = [];
    let choice = "";
    let depth = 0;
    while (i2 < input.length) {
      const char = input[i2++];
      if (char === "\\") {
        choice += handleEscape();
        continue;
      } else if (char === "{") {
        depth++;
      } else if (char === "}") {
        if (!depth) break;
        depth--;
      } else if (char === "|") {
        if (!depth) {
          options4.push(choice);
          choice = "";
          continue;
        }
      }
      choice += char;
    }
    options4.push(choice);
    const chosenOption = options4[Math.floor(Math.random() * options4.length)];
    return processDynamicPrompt(chosenOption);
  }
  __name(parseChoiceBlock, "parseChoiceBlock");
  while (i2 < input.length) {
    const char = input[i2++];
    if (char === "\\") {
      result += handleEscape();
    } else if (char === "{") {
      result += parseChoiceBlock();
    } else {
      result += char;
    }
  }
  return result.replace(/\\([{}|])/g, "$1");
}
__name(processDynamicPrompt, "processDynamicPrompt");
const _hoisted_1$15 = { class: "flex flex-col" };
const _hoisted_2$P = { class: "flex flex-row items-center gap-2" };
const _hoisted_3$p = {
  key: 0,
  class: "pi pi-check text-green-500"
};
const _hoisted_4$j = { class: "file-info" };
const _hoisted_5$e = { class: "file-details" };
const _hoisted_6$a = ["title"];
const _hoisted_7$5 = {
  key: 0,
  class: "file-error"
};
const _hoisted_8$3 = { class: "file-action" };
const _hoisted_9$3 = {
  key: 0,
  class: "flex flex-row items-center gap-2"
};
const _sfc_main$S = /* @__PURE__ */ defineComponent({
  __name: "ElectronFileDownload",
  props: {
    url: {},
    hint: {},
    label: {},
    error: {}
  },
  setup(__props) {
    const props = __props;
    const { t: t2 } = useI18n();
    const label5 = computed(() => props.label || props.url.split("/").pop());
    const hint = computed(() => props.hint || props.url);
    const download2 = useDownload(props.url);
    const downloadProgress = ref(0);
    const status = ref(null);
    const fileSize = computed(
      () => download2.fileSize.value ? formatSize(download2.fileSize.value) : "?"
    );
    const electronDownloadStore = useElectronDownloadStore();
    const [savePath, filename] = props.label.split("/");
    electronDownloadStore.$subscribe((mutation, { downloads }) => {
      const download22 = downloads.find((download3) => props.url === download3.url);
      if (download22) {
        downloadProgress.value = Number((download22.progress * 100).toFixed(1));
        status.value = download22.status;
      }
    });
    const triggerDownload = /* @__PURE__ */ __name(async () => {
      await electronDownloadStore.start({
        url: props.url,
        savePath: savePath.trim(),
        filename: filename.trim()
      });
    }, "triggerDownload");
    const triggerCancelDownload = /* @__PURE__ */ __name(() => electronDownloadStore.cancel(props.url), "triggerCancelDownload");
    const triggerPauseDownload = /* @__PURE__ */ __name(() => electronDownloadStore.pause(props.url), "triggerPauseDownload");
    const triggerResumeDownload = /* @__PURE__ */ __name(() => electronDownloadStore.resume(props.url), "triggerResumeDownload");
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return openBlock(), createElementBlock("div", _hoisted_1$15, [
        createBaseVNode("div", _hoisted_2$P, [
          status.value === "completed" ? (openBlock(), createElementBlock("i", _hoisted_3$p)) : createCommentVNode("", true),
          createBaseVNode("div", _hoisted_4$j, [
            createBaseVNode("div", _hoisted_5$e, [
              createBaseVNode("span", {
                class: "file-type",
                title: hint.value
              }, toDisplayString$1(label5.value), 9, _hoisted_6$a)
            ]),
            props.error ? (openBlock(), createElementBlock("div", _hoisted_7$5, toDisplayString$1(props.error), 1)) : createCommentVNode("", true)
          ]),
          createBaseVNode("div", _hoisted_8$3, [
            status.value === null || status.value === "error" ? (openBlock(), createBlock(unref(script$R), {
              key: 0,
              class: "file-action-button",
              label: _ctx.$t("g.download") + " (" + fileSize.value + ")",
              size: "small",
              outlined: "",
              disabled: props.error,
              onClick: triggerDownload,
              icon: "pi pi-download"
            }, null, 8, ["label", "disabled"])) : createCommentVNode("", true)
          ])
        ]),
        status.value === "in_progress" || status.value === "paused" ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
          createVNode(unref(script$D), {
            class: "flex-1",
            value: downloadProgress.value,
            "show-value": downloadProgress.value > 10
          }, null, 8, ["value", "show-value"]),
          status.value === "in_progress" ? withDirectives((openBlock(), createBlock(unref(script$R), {
            key: 0,
            class: "file-action-button",
            size: "small",
            outlined: "",
            disabled: props.error,
            onClick: triggerPauseDownload,
            icon: "pi pi-pause-circle"
          }, null, 8, ["disabled"])), [
            [
              _directive_tooltip,
              unref(t2)("electronFileDownload.pause"),
              void 0,
              { top: true }
            ]
          ]) : createCommentVNode("", true),
          status.value === "paused" ? withDirectives((openBlock(), createBlock(unref(script$R), {
            key: 1,
            class: "file-action-button",
            size: "small",
            outlined: "",
            disabled: props.error,
            onClick: triggerResumeDownload,
            icon: "pi pi-play-circle"
          }, null, 8, ["disabled"])), [
            [
              _directive_tooltip,
              unref(t2)("electronFileDownload.resume"),
              void 0,
              { top: true }
            ]
          ]) : createCommentVNode("", true),
          withDirectives(createVNode(unref(script$R), {
            class: "file-action-button",
            size: "small",
            outlined: "",
            disabled: props.error,
            onClick: triggerCancelDownload,
            icon: "pi pi-times-circle",
            severity: "danger"
          }, null, 8, ["disabled"]), [
            [
              _directive_tooltip,
              unref(t2)("electronFileDownload.cancel"),
              void 0,
              { top: true }
            ]
          ])
        ])) : createCommentVNode("", true)
      ]);
    };
  }
});
const _hoisted_1$14 = { class: "flex flex-row items-center gap-2" };
const _hoisted_2$O = { class: "file-info" };
const _hoisted_3$o = { class: "file-details" };
const _hoisted_4$i = ["title"];
const _hoisted_5$d = {
  key: 0,
  class: "file-error"
};
const _hoisted_6$9 = { class: "file-action" };
const _sfc_main$R = /* @__PURE__ */ defineComponent({
  __name: "FileDownload",
  props: {
    url: {},
    hint: {},
    label: {},
    error: {}
  },
  setup(__props) {
    const props = __props;
    const label5 = computed(() => props.label || props.url.split("/").pop());
    const hint = computed(() => props.hint || props.url);
    const download2 = useDownload(props.url);
    const fileSize = computed(
      () => download2.fileSize.value ? formatSize(download2.fileSize.value) : "?"
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$14, [
        createBaseVNode("div", _hoisted_2$O, [
          createBaseVNode("div", _hoisted_3$o, [
            createBaseVNode("span", {
              class: "file-type",
              title: hint.value
            }, toDisplayString$1(label5.value), 9, _hoisted_4$i)
          ]),
          props.error ? (openBlock(), createElementBlock("div", _hoisted_5$d, toDisplayString$1(props.error), 1)) : createCommentVNode("", true)
        ]),
        createBaseVNode("div", _hoisted_6$9, [
          createVNode(unref(script$R), {
            class: "file-action-button",
            label: _ctx.$t("g.download") + " (" + fileSize.value + ")",
            size: "small",
            outlined: "",
            disabled: props.error,
            title: props.url,
            onClick: unref(download2).triggerBrowserDownload
          }, null, 8, ["label", "disabled", "title", "onClick"])
        ])
      ]);
    };
  }
});
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
  __name: "MissingModelsWarning",
  props: {
    missingModels: {},
    paths: {}
  },
  setup(__props) {
    const allowedSources = [
      "https://civitai.com/",
      "https://huggingface.co/",
      "http://localhost:"
      // Included for testing usage only
    ];
    const allowedSuffixes = [".safetensors", ".sft"];
    const props = __props;
    const modelDownloads = ref({});
    const missingModels = computed(() => {
      return props.missingModels.map((model) => {
        const paths = props.paths[model.directory];
        if (model.directory_invalid || !paths) {
          return {
            label: `${model.directory} / ${model.name}`,
            url: model.url,
            error: "Invalid directory specified (does this require custom nodes?)"
          };
        }
        const downloadInfo = modelDownloads.value[model.name] ?? {
          downloading: false,
          completed: false,
          progress: 0,
          error: null,
          name: model.name,
          directory: model.directory,
          url: model.url,
          folder_path: paths[0]
        };
        modelDownloads.value[model.name] = downloadInfo;
        if (!allowedSources.some((source) => model.url.startsWith(source))) {
          return {
            label: `${model.directory} / ${model.name}`,
            url: model.url,
            error: `Download not allowed from source '${model.url}', only allowed from '${allowedSources.join("', '")}'`
          };
        }
        if (!allowedSuffixes.some((suffix2) => model.name.endsWith(suffix2))) {
          return {
            label: `${model.directory} / ${model.name}`,
            url: model.url,
            error: `Only allowed suffixes are: '${allowedSuffixes.join("', '")}'`
          };
        }
        return {
          url: model.url,
          label: `${model.directory} / ${model.name}`,
          downloading: downloadInfo.downloading,
          completed: downloadInfo.completed,
          progress: downloadInfo.progress,
          error: downloadInfo.error,
          name: model.name,
          paths,
          folderPath: downloadInfo.folder_path
        };
      });
    });
    return (_ctx, _cache) => {
      const _component_ElectronFileDownload = _sfc_main$S;
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(NoResultsPlaceholder, {
          class: "pb-0",
          icon: "pi pi-exclamation-circle",
          title: "Missing Models",
          message: "When loading the graph, the following models were not found"
        }),
        createVNode(unref(script$E), {
          options: missingModels.value,
          class: "comfy-missing-models"
        }, {
          option: withCtx(({ option: option3 }) => [
            unref(isElectron)() ? (openBlock(), createBlock(Suspense, { key: 0 }, {
              default: withCtx(() => [
                createVNode(_component_ElectronFileDownload, {
                  url: option3.url,
                  label: option3.label,
                  error: option3.error
                }, null, 8, ["url", "label", "error"])
              ]),
              _: 2
            }, 1024)) : (openBlock(), createBlock(_sfc_main$R, {
              key: 1,
              url: option3.url,
              label: option3.label,
              error: option3.error
            }, null, 8, ["url", "label", "error"]))
          ]),
          _: 1
        }, 8, ["options"])
      ], 64);
    };
  }
});
const MissingModelsWarning = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-ebf9fccc"]]);
var theme$l = /* @__PURE__ */ __name(function theme18(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-floatlabel {\n    display: block;\n    position: relative;\n}\n\n.p-floatlabel label {\n    position: absolute;\n    pointer-events: none;\n    top: 50%;\n    margin-top: -.5rem;\n    transition-property: all;\n    transition-timing-function: ease;\n    line-height: 1;\n    left: 0.75rem;\n    color: ".concat(dt2("floatlabel.color"), ";\n    transition-duration: ").concat(dt2("floatlabel.transition.duration"), ";\n}\n\n.p-floatlabel:has(textarea) label {\n    top: 1rem;\n}\n\n.p-floatlabel:has(input:focus) label,\n.p-floatlabel:has(input.p-filled) label,\n.p-floatlabel:has(input:-webkit-autofill) label,\n.p-floatlabel:has(textarea:focus) label,\n.p-floatlabel:has(textarea.p-filled) label,\n.p-floatlabel:has(.p-inputwrapper-focus) label,\n.p-floatlabel:has(.p-inputwrapper-filled) label {\n    top: -.75rem;\n    font-size: 12px;\n    color: ").concat(dt2("floatlabel.focus.color"), ";\n}\n\n.p-floatlabel .p-placeholder,\n.p-floatlabel input::placeholder,\n.p-floatlabel .p-inputtext::placeholder {\n    opacity: 0;\n    transition-property: all;\n    transition-timing-function: ease;\n}\n\n.p-floatlabel .p-focus .p-placeholder,\n.p-floatlabel input:focus::placeholder,\n.p-floatlabel .p-inputtext:focus::placeholder {\n    opacity: 1;\n    transition-property: all;\n    transition-timing-function: ease;\n}\n\n.p-floatlabel > .p-invalid + label {\n    color: ").concat(dt2("floatlabel.invalid.color"), ";\n}\n");
}, "theme");
var classes$n = {
  root: "p-floatlabel"
};
var FloatLabelStyle = BaseStyle.extend({
  name: "floatlabel",
  theme: theme$l,
  classes: classes$n
});
var script$1$n = {
  name: "BaseFloatLabel",
  "extends": script$_,
  props: {},
  style: FloatLabelStyle,
  provide: /* @__PURE__ */ __name(function provide18() {
    return {
      $pcFloatLabel: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$C = {
  name: "FloatLabel",
  "extends": script$1$n,
  inheritAttrs: false
};
function render$B(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("span", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
}
__name(render$B, "render$B");
script$C.render = render$B;
const _hoisted_1$13 = { class: "prompt-dialog-content flex flex-col gap-2 pt-8" };
const _sfc_main$P = /* @__PURE__ */ defineComponent({
  __name: "PromptDialogContent",
  props: {
    message: {},
    defaultValue: {},
    onConfirm: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const inputValue = ref(props.defaultValue);
    const onConfirm = /* @__PURE__ */ __name(() => {
      props.onConfirm(inputValue.value);
      useDialogStore().closeDialog();
    }, "onConfirm");
    const inputRef = ref(null);
    const selectAllText = /* @__PURE__ */ __name(() => {
      if (!inputRef.value) return;
      const inputElement = inputRef.value.$el;
      inputElement.setSelectionRange(0, inputElement.value.length);
    }, "selectAllText");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$13, [
        createVNode(unref(script$C), null, {
          default: withCtx(() => [
            createVNode(unref(script$G), {
              ref_key: "inputRef",
              ref: inputRef,
              modelValue: inputValue.value,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
              onKeyup: withKeys(onConfirm, ["enter"]),
              onFocus: selectAllText,
              autofocus: ""
            }, null, 8, ["modelValue"]),
            createBaseVNode("label", null, toDisplayString$1(_ctx.message), 1)
          ]),
          _: 1
        }),
        createVNode(unref(script$R), { onClick: onConfirm }, {
          default: withCtx(() => [
            createTextVNode(toDisplayString$1(_ctx.$t("g.confirm")), 1)
          ]),
          _: 1
        })
      ]);
    };
  }
});
var classes$m = {
  root: "p-tabpanels"
};
var TabPanelsStyle = BaseStyle.extend({
  name: "tabpanels",
  classes: classes$m
});
var script$1$m = {
  name: "BaseTabPanels",
  "extends": script$_,
  props: {},
  style: TabPanelsStyle,
  provide: /* @__PURE__ */ __name(function provide19() {
    return {
      $pcTabPanels: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$B = {
  name: "TabPanels",
  "extends": script$1$m,
  inheritAttrs: false
};
function render$A(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    role: "presentation"
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
}
__name(render$A, "render$A");
script$B.render = render$A;
var theme$k = /* @__PURE__ */ __name(function theme19(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-tabs {\n    display: flex;\n    flex-direction: column;\n}\n\n.p-tablist {\n    display: flex;\n    position: relative;\n}\n\n.p-tabs-scrollable > .p-tablist {\n    overflow: hidden;\n}\n\n.p-tablist-viewport {\n    overflow-x: auto;\n    overflow-y: hidden;\n    scroll-behavior: smooth;\n    scrollbar-width: none;\n    overscroll-behavior: contain auto;\n}\n\n.p-tablist-viewport::-webkit-scrollbar {\n    display: none;\n}\n\n.p-tablist-tab-list {\n    position: relative;\n    display: flex;\n    background: ".concat(dt2("tabs.tablist.background"), ";\n    border-style: solid;\n    border-color: ").concat(dt2("tabs.tablist.border.color"), ";\n    border-width: ").concat(dt2("tabs.tablist.border.width"), ";\n}\n\n.p-tablist-content {\n    flex-grow: 1;\n}\n\n.p-tablist-nav-button {\n    all: unset;\n    position: absolute !important;\n    flex-shrink: 0;\n    top: 0;\n    z-index: 2;\n    height: 100%;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    background: ").concat(dt2("tabs.nav.button.background"), ";\n    color: ").concat(dt2("tabs.nav.button.color"), ";\n    width: ").concat(dt2("tabs.nav.button.width"), ";\n    transition: color ").concat(dt2("tabs.transition.duration"), ", outline-color ").concat(dt2("tabs.transition.duration"), ", box-shadow ").concat(dt2("tabs.transition.duration"), ";\n    box-shadow: ").concat(dt2("tabs.nav.button.shadow"), ";\n    outline-color: transparent;\n    cursor: pointer;\n}\n\n.p-tablist-nav-button:focus-visible {\n    z-index: 1;\n    box-shadow: ").concat(dt2("tabs.nav.button.focus.ring.shadow"), ";\n    outline: ").concat(dt2("tabs.nav.button.focus.ring.width"), " ").concat(dt2("tabs.nav.button.focus.ring.style"), " ").concat(dt2("tabs.nav.button.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("tabs.nav.button.focus.ring.offset"), ";\n}\n\n.p-tablist-nav-button:hover {\n    color: ").concat(dt2("tabs.nav.button.hover.color"), ";\n}\n\n.p-tablist-prev-button {\n    left: 0;\n}\n\n.p-tablist-next-button {\n    right: 0;\n}\n\n.p-tab {\n    flex-shrink: 0;\n    cursor: pointer;\n    user-select: none;\n    position: relative;\n    border-style: solid;\n    white-space: nowrap;\n    background: ").concat(dt2("tabs.tab.background"), ";\n    border-width: ").concat(dt2("tabs.tab.border.width"), ";\n    border-color: ").concat(dt2("tabs.tab.border.color"), ";\n    color: ").concat(dt2("tabs.tab.color"), ";\n    padding: ").concat(dt2("tabs.tab.padding"), ";\n    font-weight: ").concat(dt2("tabs.tab.font.weight"), ";\n    transition: background ").concat(dt2("tabs.transition.duration"), ", border-color ").concat(dt2("tabs.transition.duration"), ", color ").concat(dt2("tabs.transition.duration"), ", outline-color ").concat(dt2("tabs.transition.duration"), ", box-shadow ").concat(dt2("tabs.transition.duration"), ";\n    margin: ").concat(dt2("tabs.tab.margin"), ";\n    outline-color: transparent;\n}\n\n.p-tab:not(.p-disabled):focus-visible {\n    z-index: 1;\n    box-shadow: ").concat(dt2("tabs.tab.focus.ring.shadow"), ";\n    outline: ").concat(dt2("tabs.tab.focus.ring.width"), " ").concat(dt2("tabs.tab.focus.ring.style"), " ").concat(dt2("tabs.tab.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("tabs.tab.focus.ring.offset"), ";\n}\n\n.p-tab:not(.p-tab-active):not(.p-disabled):hover {\n    background: ").concat(dt2("tabs.tab.hover.background"), ";\n    border-color: ").concat(dt2("tabs.tab.hover.border.color"), ";\n    color: ").concat(dt2("tabs.tab.hover.color"), ";\n}\n\n.p-tab-active {\n    background: ").concat(dt2("tabs.tab.active.background"), ";\n    border-color: ").concat(dt2("tabs.tab.active.border.color"), ";\n    color: ").concat(dt2("tabs.tab.active.color"), ";\n}\n\n.p-tabpanels {\n    background: ").concat(dt2("tabs.tabpanel.background"), ";\n    color: ").concat(dt2("tabs.tabpanel.color"), ";\n    padding: ").concat(dt2("tabs.tabpanel.padding"), ";\n    outline: 0 none;\n}\n\n.p-tabpanel:focus-visible {\n    box-shadow: ").concat(dt2("tabs.tabpanel.focus.ring.shadow"), ";\n    outline: ").concat(dt2("tabs.tabpanel.focus.ring.width"), " ").concat(dt2("tabs.tabpanel.focus.ring.style"), " ").concat(dt2("tabs.tabpanel.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("tabs.tabpanel.focus.ring.offset"), ";\n}\n\n.p-tablist-active-bar {\n    z-index: 1;\n    display: block;\n    position: absolute;\n    bottom: ").concat(dt2("tabs.active.bar.bottom"), ";\n    height: ").concat(dt2("tabs.active.bar.height"), ";\n    background: ").concat(dt2("tabs.active.bar.background"), ";\n    transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);\n}\n");
}, "theme");
var classes$l = {
  root: /* @__PURE__ */ __name(function root9(_ref2) {
    var props = _ref2.props;
    return ["p-tabs p-component", {
      "p-tabs-scrollable": props.scrollable
    }];
  }, "root")
};
var TabsStyle = BaseStyle.extend({
  name: "tabs",
  theme: theme$k,
  classes: classes$l
});
var script$1$l = {
  name: "BaseTabs",
  "extends": script$_,
  props: {
    value: {
      type: [String, Number],
      "default": void 0
    },
    lazy: {
      type: Boolean,
      "default": false
    },
    scrollable: {
      type: Boolean,
      "default": false
    },
    showNavigators: {
      type: Boolean,
      "default": true
    },
    tabindex: {
      type: Number,
      "default": 0
    },
    selectOnFocus: {
      type: Boolean,
      "default": false
    }
  },
  style: TabsStyle,
  provide: /* @__PURE__ */ __name(function provide20() {
    return {
      $pcTabs: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$A = {
  name: "Tabs",
  "extends": script$1$l,
  inheritAttrs: false,
  emits: ["update:value"],
  data: /* @__PURE__ */ __name(function data7() {
    return {
      id: this.$attrs.id,
      d_value: this.value
    };
  }, "data"),
  watch: {
    "$attrs.id": /* @__PURE__ */ __name(function $attrsId4(newValue2) {
      this.id = newValue2 || UniqueComponentId();
    }, "$attrsId"),
    value: /* @__PURE__ */ __name(function value(newValue2) {
      this.d_value = newValue2;
    }, "value")
  },
  mounted: /* @__PURE__ */ __name(function mounted9() {
    this.id = this.id || UniqueComponentId();
  }, "mounted"),
  methods: {
    updateValue: /* @__PURE__ */ __name(function updateValue(newValue2) {
      if (this.d_value !== newValue2) {
        this.d_value = newValue2;
        this.$emit("update:value", newValue2);
      }
    }, "updateValue"),
    isVertical: /* @__PURE__ */ __name(function isVertical2() {
      return this.orientation === "vertical";
    }, "isVertical")
  }
};
function render$z(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
}
__name(render$z, "render$z");
script$A.render = render$z;
var script$z = {
  name: "TimesCircleIcon",
  "extends": script$X
};
var _hoisted_1$12 = /* @__PURE__ */ createBaseVNode("path", {
  "fill-rule": "evenodd",
  "clip-rule": "evenodd",
  d: "M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$N = [_hoisted_1$12];
function render$y(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$N, 16);
}
__name(render$y, "render$y");
script$z.render = render$y;
var theme$j = /* @__PURE__ */ __name(function theme20(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-chip {\n    display: inline-flex;\n    align-items: center;\n    background: ".concat(dt2("chip.background"), ";\n    color: ").concat(dt2("chip.color"), ";\n    border-radius: ").concat(dt2("chip.border.radius"), ";\n    padding: ").concat(dt2("chip.padding.y"), " ").concat(dt2("chip.padding.x"), ";\n    gap: ").concat(dt2("chip.gap"), ";\n}\n\n.p-chip-icon {\n    color: ").concat(dt2("chip.icon.color"), ";\n    font-size: ").concat(dt2("chip.icon.font.size"), ";\n    width: ").concat(dt2("chip.icon.size"), ";\n    height: ").concat(dt2("chip.icon.size"), ";\n}\n\n.p-chip-image {\n    border-radius: 50%;\n    width: ").concat(dt2("chip.image.width"), ";\n    height: ").concat(dt2("chip.image.height"), ";\n    margin-left: calc(-1 * ").concat(dt2("chip.padding.y"), ");\n}\n\n.p-chip:has(.p-chip-remove-icon) {\n    padding-right: ").concat(dt2("chip.padding.y"), ";\n}\n\n.p-chip:has(.p-chip-image) {\n    padding-top: calc(").concat(dt2("chip.padding.y"), " / 2);\n    padding-bottom: calc(").concat(dt2("chip.padding.y"), " / 2);\n}\n\n.p-chip-remove-icon {\n    cursor: pointer;\n    font-size: ").concat(dt2("chip.remove.icon.size"), ";\n    width: ").concat(dt2("chip.remove.icon.size"), ";\n    height: ").concat(dt2("chip.remove.icon.size"), ";\n    color: ").concat(dt2("chip.remove.icon.color"), ";\n    border-radius: 50%;\n    transition: outline-color ").concat(dt2("chip.transition.duration"), ", box-shadow ").concat(dt2("chip.transition.duration"), ";\n    outline-color: transparent;\n}\n\n.p-chip-remove-icon:focus-visible {\n    box-shadow: ").concat(dt2("chip.remove.icon.focus.ring.shadow"), ";\n    outline: ").concat(dt2("chip.remove.icon.focus.ring.width"), " ").concat(dt2("chip.remove.icon.focus.ring.style"), " ").concat(dt2("chip.remove.icon.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("chip.remove.icon.focus.ring.offset"), ";\n}\n");
}, "theme");
var classes$k = {
  root: "p-chip p-component",
  image: "p-chip-image",
  icon: "p-chip-icon",
  label: "p-chip-label",
  removeIcon: "p-chip-remove-icon"
};
var ChipStyle = BaseStyle.extend({
  name: "chip",
  theme: theme$j,
  classes: classes$k
});
var script$1$k = {
  name: "BaseChip",
  "extends": script$_,
  props: {
    label: {
      type: String,
      "default": null
    },
    icon: {
      type: String,
      "default": null
    },
    image: {
      type: String,
      "default": null
    },
    removable: {
      type: Boolean,
      "default": false
    },
    removeIcon: {
      type: String,
      "default": void 0
    }
  },
  style: ChipStyle,
  provide: /* @__PURE__ */ __name(function provide21() {
    return {
      $pcChip: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$y = {
  name: "Chip",
  "extends": script$1$k,
  inheritAttrs: false,
  emits: ["remove"],
  data: /* @__PURE__ */ __name(function data8() {
    return {
      visible: true
    };
  }, "data"),
  methods: {
    onKeydown: /* @__PURE__ */ __name(function onKeydown2(event) {
      if (event.key === "Enter" || event.key === "Backspace") {
        this.close(event);
      }
    }, "onKeydown"),
    close: /* @__PURE__ */ __name(function close3(event) {
      this.visible = false;
      this.$emit("remove", event);
    }, "close")
  },
  components: {
    TimesCircleIcon: script$z
  }
};
var _hoisted_1$11 = ["aria-label"];
var _hoisted_2$M = ["src"];
function render$x(_ctx, _cache, $props, $setup, $data, $options) {
  return $data.visible ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("root"),
    "aria-label": _ctx.label
  }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default", {}, function() {
    return [_ctx.image ? (openBlock(), createElementBlock("img", mergeProps({
      key: 0,
      src: _ctx.image
    }, _ctx.ptm("image"), {
      "class": _ctx.cx("image")
    }), null, 16, _hoisted_2$M)) : _ctx.$slots.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.icon), mergeProps({
      key: 1,
      "class": _ctx.cx("icon")
    }, _ctx.ptm("icon")), null, 16, ["class"])) : _ctx.icon ? (openBlock(), createElementBlock("span", mergeProps({
      key: 2,
      "class": [_ctx.cx("icon"), _ctx.icon]
    }, _ctx.ptm("icon")), null, 16)) : createCommentVNode("", true), _ctx.label ? (openBlock(), createElementBlock("div", mergeProps({
      key: 3,
      "class": _ctx.cx("label")
    }, _ctx.ptm("label")), toDisplayString$1(_ctx.label), 17)) : createCommentVNode("", true)];
  }), _ctx.removable ? renderSlot(_ctx.$slots, "removeicon", {
    key: 0,
    removeCallback: $options.close,
    keydownCallback: $options.onKeydown
  }, function() {
    return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.removeIcon ? "span" : "TimesCircleIcon"), mergeProps({
      tabindex: "0",
      "class": [_ctx.cx("removeIcon"), _ctx.removeIcon],
      onClick: $options.close,
      onKeydown: $options.onKeydown
    }, _ctx.ptm("removeIcon")), null, 16, ["class", "onClick", "onKeydown"]))];
  }) : createCommentVNode("", true)], 16, _hoisted_1$11)) : createCommentVNode("", true);
}
__name(render$x, "render$x");
script$y.render = render$x;
const _sfc_main$O = /* @__PURE__ */ defineComponent({
  __name: "SearchFilterChip",
  props: {
    text: {},
    badge: {},
    badgeClass: {}
  },
  emits: ["remove"],
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(script$y), {
        removable: "",
        onRemove: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("remove", $event))
      }, {
        default: withCtx(() => [
          createVNode(unref(script$S), {
            size: "small",
            class: normalizeClass(_ctx.badgeClass)
          }, {
            default: withCtx(() => [
              createTextVNode(toDisplayString$1(_ctx.badge), 1)
            ]),
            _: 1
          }, 8, ["class"]),
          createTextVNode(" " + toDisplayString$1(_ctx.text), 1)
        ]),
        _: 1
      });
    };
  }
});
const SearchFilterChip = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-53692f7e"]]);
const _withScopeId$j = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-ba13476b"), n = n(), popScopeId(), n), "_withScopeId$j");
const _hoisted_1$10 = {
  key: 0,
  class: "search-filters pt-2 flex flex-wrap gap-2"
};
const _sfc_main$N = /* @__PURE__ */ defineComponent({
  __name: "SearchBox",
  props: {
    class: {},
    modelValue: {},
    placeholder: { default: "Search..." },
    icon: { default: "pi pi-search" },
    debounceTime: { default: 300 },
    filterIcon: {},
    filters: {}
  },
  emits: [
    "update:modelValue",
    "search",
    "showFilter",
    "removeFilter"
  ],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const { filters } = toRefs$1(props);
    const emit2 = __emit;
    const emitSearch = lodashExports.debounce((value4) => {
      emit2("search", value4, props.filters);
    }, props.debounceTime);
    const handleInput = /* @__PURE__ */ __name((event) => {
      const target = event.target;
      emit2("update:modelValue", target.value);
      emitSearch(target.value);
    }, "handleInput");
    const clearSearch = /* @__PURE__ */ __name(() => {
      emit2("update:modelValue", "");
      emitSearch("");
    }, "clearSearch");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(props.class)
      }, [
        createVNode(unref(script$I), null, {
          default: withCtx(() => [
            props.filterIcon ? (openBlock(), createBlock(unref(script$R), {
              key: 0,
              class: "p-inputicon filter-button",
              icon: props.filterIcon,
              text: "",
              severity: "contrast",
              onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("showFilter", $event))
            }, null, 8, ["icon"])) : createCommentVNode("", true),
            createVNode(unref(script$G), {
              class: "search-box-input w-full",
              onInput: handleInput,
              modelValue: props.modelValue,
              placeholder: props.placeholder
            }, null, 8, ["modelValue", "placeholder"]),
            !props.modelValue ? (openBlock(), createBlock(unref(script$H), {
              key: 1,
              class: normalizeClass(props.icon)
            }, null, 8, ["class"])) : createCommentVNode("", true),
            props.modelValue ? (openBlock(), createBlock(unref(script$R), {
              key: 2,
              class: "p-inputicon clear-button",
              icon: "pi pi-times",
              text: "",
              severity: "contrast",
              onClick: clearSearch
            })) : createCommentVNode("", true)
          ]),
          _: 1
        }),
        unref(filters)?.length ? (openBlock(), createElementBlock("div", _hoisted_1$10, [
          (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(filters), (filter4) => {
            return openBlock(), createBlock(SearchFilterChip, {
              key: filter4.id,
              text: filter4.text,
              badge: filter4.badge,
              "badge-class": filter4.badgeClass,
              onRemove: /* @__PURE__ */ __name(($event) => _ctx.$emit("removeFilter", filter4), "onRemove")
            }, null, 8, ["text", "badge", "badge-class", "onRemove"]);
          }), 128))
        ])) : createCommentVNode("", true)
      ], 2);
    };
  }
});
const SearchBox = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-ba13476b"]]);
function buildTree$1(items2, key) {
  const root24 = {
    key: "root",
    label: "root",
    children: []
  };
  const map3 = {
    root: root24
  };
  for (const item3 of items2) {
    const keys2 = key(item3);
    let parent = root24;
    for (let i2 = 0; i2 < keys2.length; i2++) {
      const k = keys2[i2];
      if (k === "" && i2 === keys2.length - 1) break;
      const id3 = parent.key + "/" + k;
      if (!map3[id3]) {
        const node3 = {
          key: id3,
          label: k,
          leaf: false,
          children: []
        };
        map3[id3] = node3;
        parent.children?.push(node3);
      }
      parent = map3[id3];
    }
    parent.leaf = keys2[keys2.length - 1] !== "";
    parent.data = item3;
  }
  return root24;
}
__name(buildTree$1, "buildTree$1");
function flattenTree(tree) {
  const result = [];
  const stack2 = [tree];
  while (stack2.length) {
    const node3 = stack2.pop();
    if (node3.leaf && node3.data) result.push(node3.data);
    stack2.push(...node3.children || []);
  }
  return result;
}
__name(flattenTree, "flattenTree");
function sortedTree(node3, {
  groupLeaf = false
} = {}) {
  const newNode = {
    ...node3
  };
  if (node3.children) {
    if (groupLeaf) {
      const folders = node3.children.filter((child) => !child.leaf);
      const files = node3.children.filter((child) => child.leaf);
      const sortedFolders = folders.sort(
        (a, b) => (a.label ?? "").localeCompare(b.label ?? "")
      );
      const sortedFiles = files.sort(
        (a, b) => (a.label ?? "").localeCompare(b.label ?? "")
      );
      newNode.children = [
        ...sortedFolders.map(
          (folder) => sortedTree(folder, { groupLeaf: true })
        ),
        ...sortedFiles
      ];
    } else {
      const sortedChildren = [...node3.children].sort(
        (a, b) => (a.label ?? "").localeCompare(b.label ?? "")
      );
      newNode.children = [
        ...sortedChildren.map(
          (child) => sortedTree(child, { groupLeaf: false })
        )
      ];
    }
  }
  return newNode;
}
__name(sortedTree, "sortedTree");
const findNodeByKey = /* @__PURE__ */ __name((root24, key) => {
  if (root24.key === key) {
    return root24;
  }
  if (!root24.children) {
    return null;
  }
  for (const child of root24.children) {
    const result = findNodeByKey(child, key);
    if (result) {
      return result;
    }
  }
  return null;
}, "findNodeByKey");
const getSettingInfo = /* @__PURE__ */ __name((setting) => {
  const parts2 = setting.category || setting.id.split(".");
  return {
    category: parts2[0] ?? "Other",
    subCategory: parts2[1] ?? "Other"
  };
}, "getSettingInfo");
function tryMigrateDeprecatedValue(setting, value4) {
  return setting?.migrateDeprecatedValue?.(value4) ?? value4;
}
__name(tryMigrateDeprecatedValue, "tryMigrateDeprecatedValue");
function onChange(setting, newValue2, oldValue2) {
  if (setting?.onChange) {
    setting.onChange(newValue2, oldValue2);
  }
  app$1.ui.settings.dispatchChange(setting.id, newValue2, oldValue2);
}
__name(onChange, "onChange");
const useSettingStore = /* @__PURE__ */ defineStore("setting", () => {
  const settingValues = ref({});
  const settingsById = ref({});
  const settingTree = computed(() => {
    const root24 = buildTree$1(
      Object.values(settingsById.value).filter(
        (setting) => setting.type !== "hidden"
      ),
      (setting) => setting.category || setting.id.split(".")
    );
    const floatingSettings = (root24.children ?? []).filter((node3) => node3.leaf);
    if (floatingSettings.length) {
      root24.children = (root24.children ?? []).filter((node3) => !node3.leaf);
      root24.children.push({
        key: "Other",
        label: "Other",
        leaf: false,
        children: floatingSettings
      });
    }
    return root24;
  });
  function exists(key) {
    return settingValues.value[key] !== void 0;
  }
  __name(exists, "exists");
  async function set3(key, value4) {
    const clonedValue = _.cloneDeep(value4);
    const newValue2 = tryMigrateDeprecatedValue(
      settingsById.value[key],
      clonedValue
    );
    const oldValue2 = get3(key);
    if (newValue2 === oldValue2) return;
    onChange(settingsById.value[key], newValue2, oldValue2);
    settingValues.value[key] = newValue2;
    await api.storeSetting(key, newValue2);
  }
  __name(set3, "set");
  function get3(key) {
    return _.cloneDeep(settingValues.value[key] ?? getDefaultValue(key));
  }
  __name(get3, "get");
  function getDefaultValue(key) {
    const param = settingsById.value[key];
    return typeof param?.defaultValue === "function" ? param.defaultValue() : param?.defaultValue;
  }
  __name(getDefaultValue, "getDefaultValue");
  function addSetting(setting) {
    if (!setting.id) {
      throw new Error("Settings must have an ID");
    }
    if (setting.id in settingsById.value) {
      throw new Error(`Setting ${setting.id} must have a unique ID.`);
    }
    settingsById.value[setting.id] = setting;
    if (settingValues.value[setting.id] !== void 0) {
      settingValues.value[setting.id] = tryMigrateDeprecatedValue(
        setting,
        settingValues.value[setting.id]
      );
    }
    onChange(setting, get3(setting.id), void 0);
  }
  __name(addSetting, "addSetting");
  async function loadSettingValues() {
    if (Object.keys(settingsById.value).length) {
      throw new Error(
        "Setting values must be loaded before any setting is registered."
      );
    }
    settingValues.value = await api.getSettings();
  }
  __name(loadSettingValues, "loadSettingValues");
  return {
    settingValues,
    settingsById,
    settingTree,
    addSetting,
    loadSettingValues,
    set: set3,
    get: get3,
    exists,
    getDefaultValue
  };
});
var theme$i = /* @__PURE__ */ __name(function theme21(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-tag {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    background: ".concat(dt2("tag.primary.background"), ";\n    color: ").concat(dt2("tag.primary.color"), ";\n    font-size: ").concat(dt2("tag.font.size"), ";\n    font-weight: ").concat(dt2("tag.font.weight"), ";\n    padding: ").concat(dt2("tag.padding"), ";\n    border-radius: ").concat(dt2("tag.border.radius"), ";\n    gap: ").concat(dt2("tag.gap"), ";\n}\n\n.p-tag-icon {\n    font-size: ").concat(dt2("tag.icon.size"), ";\n    width: ").concat(dt2("tag.icon.size"), ";\n    height:").concat(dt2("tag.icon.size"), ";\n}\n\n.p-tag-rounded {\n    border-radius: ").concat(dt2("tag.rounded.border.radius"), ";\n}\n\n.p-tag-success {\n    background: ").concat(dt2("tag.success.background"), ";\n    color: ").concat(dt2("tag.success.color"), ";\n}\n\n.p-tag-info {\n    background: ").concat(dt2("tag.info.background"), ";\n    color: ").concat(dt2("tag.info.color"), ";\n}\n\n.p-tag-warn {\n    background: ").concat(dt2("tag.warn.background"), ";\n    color: ").concat(dt2("tag.warn.color"), ";\n}\n\n.p-tag-danger {\n    background: ").concat(dt2("tag.danger.background"), ";\n    color: ").concat(dt2("tag.danger.color"), ";\n}\n\n.p-tag-secondary {\n    background: ").concat(dt2("tag.secondary.background"), ";\n    color: ").concat(dt2("tag.secondary.color"), ";\n}\n\n.p-tag-contrast {\n    background: ").concat(dt2("tag.contrast.background"), ";\n    color: ").concat(dt2("tag.contrast.color"), ";\n}\n");
}, "theme");
var classes$j = {
  root: /* @__PURE__ */ __name(function root10(_ref2) {
    var props = _ref2.props;
    return ["p-tag p-component", {
      "p-tag-info": props.severity === "info",
      "p-tag-success": props.severity === "success",
      "p-tag-warn": props.severity === "warn",
      "p-tag-danger": props.severity === "danger",
      "p-tag-secondary": props.severity === "secondary",
      "p-tag-contrast": props.severity === "contrast",
      "p-tag-rounded": props.rounded
    }];
  }, "root"),
  icon: "p-tag-icon",
  label: "p-tag-label"
};
var TagStyle = BaseStyle.extend({
  name: "tag",
  theme: theme$i,
  classes: classes$j
});
var script$1$j = {
  name: "BaseTag",
  "extends": script$_,
  props: {
    value: null,
    severity: null,
    rounded: Boolean,
    icon: String
  },
  style: TagStyle,
  provide: /* @__PURE__ */ __name(function provide22() {
    return {
      $pcTag: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$x = {
  name: "Tag",
  "extends": script$1$j,
  inheritAttrs: false
};
function render$w(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("span", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [_ctx.$slots.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.icon), mergeProps({
    key: 0,
    "class": _ctx.cx("icon")
  }, _ctx.ptm("icon")), null, 16, ["class"])) : _ctx.icon ? (openBlock(), createElementBlock("span", mergeProps({
    key: 1,
    "class": [_ctx.cx("icon"), _ctx.icon]
  }, _ctx.ptm("icon")), null, 16)) : createCommentVNode("", true), _ctx.value != null || _ctx.$slots["default"] ? renderSlot(_ctx.$slots, "default", {
    key: 2
  }, function() {
    return [createBaseVNode("span", mergeProps({
      "class": _ctx.cx("label")
    }, _ctx.ptm("label")), toDisplayString$1(_ctx.value), 17)];
  }) : createCommentVNode("", true)], 16);
}
__name(render$w, "render$w");
script$x.render = render$w;
var classes$i = {
  root: /* @__PURE__ */ __name(function root11(_ref) {
    var instance = _ref.instance;
    return ["p-tabpanel", {
      "p-tabpanel-active": instance.active
    }];
  }, "root")
};
var TabPanelStyle = BaseStyle.extend({
  name: "tabpanel",
  classes: classes$i
});
var script$1$i = {
  name: "BaseTabPanel",
  "extends": script$_,
  props: {
    // in Tabs
    value: {
      type: [String, Number],
      "default": void 0
    },
    as: {
      type: [String, Object],
      "default": "DIV"
    },
    asChild: {
      type: Boolean,
      "default": false
    },
    // in TabView
    header: null,
    headerStyle: null,
    headerClass: null,
    headerProps: null,
    headerActionProps: null,
    contentStyle: null,
    contentClass: null,
    contentProps: null,
    disabled: Boolean
  },
  style: TabPanelStyle,
  provide: /* @__PURE__ */ __name(function provide23() {
    return {
      $pcTabPanel: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$w = {
  name: "TabPanel",
  "extends": script$1$i,
  inheritAttrs: false,
  inject: ["$pcTabs"],
  computed: {
    active: /* @__PURE__ */ __name(function active() {
      var _this$$pcTabs;
      return equals((_this$$pcTabs = this.$pcTabs) === null || _this$$pcTabs === void 0 ? void 0 : _this$$pcTabs.d_value, this.value);
    }, "active"),
    id: /* @__PURE__ */ __name(function id2() {
      var _this$$pcTabs2;
      return "".concat((_this$$pcTabs2 = this.$pcTabs) === null || _this$$pcTabs2 === void 0 ? void 0 : _this$$pcTabs2.id, "_tabpanel_").concat(this.value);
    }, "id"),
    ariaLabelledby: /* @__PURE__ */ __name(function ariaLabelledby() {
      var _this$$pcTabs3;
      return "".concat((_this$$pcTabs3 = this.$pcTabs) === null || _this$$pcTabs3 === void 0 ? void 0 : _this$$pcTabs3.id, "_tab_").concat(this.value);
    }, "ariaLabelledby"),
    attrs: /* @__PURE__ */ __name(function attrs3() {
      return mergeProps(this.a11yAttrs, this.ptmi("root", this.ptParams));
    }, "attrs"),
    a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs2() {
      var _this$$pcTabs4;
      return {
        id: this.id,
        tabindex: (_this$$pcTabs4 = this.$pcTabs) === null || _this$$pcTabs4 === void 0 ? void 0 : _this$$pcTabs4.tabindex,
        role: "tabpanel",
        "aria-labelledby": this.ariaLabelledby,
        "data-pc-name": "tabpanel",
        "data-p-active": this.active
      };
    }, "a11yAttrs"),
    ptParams: /* @__PURE__ */ __name(function ptParams() {
      return {
        context: {
          active: this.active
        }
      };
    }, "ptParams")
  }
};
function render$v(_ctx, _cache, $props, $setup, $data, $options) {
  var _$options$$pcTabs, _$options$$pcTabs2;
  return !$options.$pcTabs ? renderSlot(_ctx.$slots, "default", {
    key: 0
  }) : (openBlock(), createElementBlock(Fragment$1, {
    key: 1
  }, [!_ctx.asChild ? (openBlock(), createElementBlock(Fragment$1, {
    key: 0
  }, [((_$options$$pcTabs = $options.$pcTabs) !== null && _$options$$pcTabs !== void 0 && _$options$$pcTabs.lazy ? $options.active : true) ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({
    key: 0,
    "class": _ctx.cx("root")
  }, $options.attrs), {
    "default": withCtx(function() {
      return [renderSlot(_ctx.$slots, "default")];
    }),
    _: 3
  }, 16, ["class"])), [[vShow, (_$options$$pcTabs2 = $options.$pcTabs) !== null && _$options$$pcTabs2 !== void 0 && _$options$$pcTabs2.lazy ? true : $options.active]]) : createCommentVNode("", true)], 64)) : renderSlot(_ctx.$slots, "default", {
    key: 1,
    "class": normalizeClass(_ctx.cx("root")),
    active: $options.active,
    a11yAttrs: $options.a11yAttrs
  })], 64));
}
__name(render$v, "render$v");
script$w.render = render$v;
var script$v = {
  name: "ChevronLeftIcon",
  "extends": script$X
};
var _hoisted_1$$ = /* @__PURE__ */ createBaseVNode("path", {
  d: "M9.61296 13C9.50997 13.0005 9.40792 12.9804 9.3128 12.9409C9.21767 12.9014 9.13139 12.8433 9.05902 12.7701L3.83313 7.54416C3.68634 7.39718 3.60388 7.19795 3.60388 6.99022C3.60388 6.78249 3.68634 6.58325 3.83313 6.43628L9.05902 1.21039C9.20762 1.07192 9.40416 0.996539 9.60724 1.00012C9.81032 1.00371 10.0041 1.08597 10.1477 1.22959C10.2913 1.37322 10.3736 1.56698 10.3772 1.77005C10.3808 1.97313 10.3054 2.16968 10.1669 2.31827L5.49496 6.99022L10.1669 11.6622C10.3137 11.8091 10.3962 12.0084 10.3962 12.2161C10.3962 12.4238 10.3137 12.6231 10.1669 12.7701C10.0945 12.8433 10.0083 12.9014 9.91313 12.9409C9.81801 12.9804 9.71596 13.0005 9.61296 13Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$L = [_hoisted_1$$];
function render$u(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$L, 16);
}
__name(render$u, "render$u");
script$v.render = render$u;
var script$u = {
  name: "ChevronRightIcon",
  "extends": script$X
};
var _hoisted_1$_ = /* @__PURE__ */ createBaseVNode("path", {
  d: "M4.38708 13C4.28408 13.0005 4.18203 12.9804 4.08691 12.9409C3.99178 12.9014 3.9055 12.8433 3.83313 12.7701C3.68634 12.6231 3.60388 12.4238 3.60388 12.2161C3.60388 12.0084 3.68634 11.8091 3.83313 11.6622L8.50507 6.99022L3.83313 2.31827C3.69467 2.16968 3.61928 1.97313 3.62287 1.77005C3.62645 1.56698 3.70872 1.37322 3.85234 1.22959C3.99596 1.08597 4.18972 1.00371 4.3928 1.00012C4.59588 0.996539 4.79242 1.07192 4.94102 1.21039L10.1669 6.43628C10.3137 6.58325 10.3962 6.78249 10.3962 6.99022C10.3962 7.19795 10.3137 7.39718 10.1669 7.54416L4.94102 12.7701C4.86865 12.8433 4.78237 12.9014 4.68724 12.9409C4.59212 12.9804 4.49007 13.0005 4.38708 13Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$K = [_hoisted_1$_];
function render$t(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$K, 16);
}
__name(render$t, "render$t");
script$u.render = render$t;
var theme$h = /* @__PURE__ */ __name(function theme22(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-tabview-tablist-container {\n    position: relative;\n}\n\n.p-tabview-scrollable > .p-tabview-tablist-container {\n    overflow: hidden;\n}\n\n.p-tabview-tablist-scroll-container {\n    overflow-x: auto;\n    overflow-y: hidden;\n    scroll-behavior: smooth;\n    scrollbar-width: none;\n    overscroll-behavior: contain auto;\n}\n\n.p-tabview-tablist-scroll-container::-webkit-scrollbar {\n    display: none;\n}\n\n.p-tabview-tablist {\n    display: flex;\n    margin: 0;\n    padding: 0;\n    list-style-type: none;\n    flex: 1 1 auto;\n    background: ".concat(dt2("tabview.tab.list.background"), ";\n    border: 1px solid ").concat(dt2("tabview.tab.list.border.color"), ";\n    border-width: 0 0 1px 0;\n    position: relative;\n}\n\n.p-tabview-tab-header {\n    cursor: pointer;\n    user-select: none;\n    display: flex;\n    align-items: center;\n    text-decoration: none;\n    position: relative;\n    overflow: hidden;\n    border-style: solid;\n    border-width: 0 0 1px 0;\n    border-color: transparent transparent ").concat(dt2("tabview.tab.border.color"), " transparent;\n    color: ").concat(dt2("tabview.tab.color"), ";\n    padding: 1rem 1.125rem;\n    font-weight: 600;\n    border-top-right-radius: ").concat(dt2("border.radius.md"), ";\n    border-top-left-radius: ").concat(dt2("border.radius.md"), ";\n    transition: color ").concat(dt2("tabview.transition.duration"), ", outline-color ").concat(dt2("tabview.transition.duration"), ";\n    margin: 0 0 -1px 0;\n    outline-color: transparent;\n}\n\n.p-tabview-tablist-item:not(.p-disabled) .p-tabview-tab-header:focus-visible {\n    outline: ").concat(dt2("focus.ring.width"), " ").concat(dt2("focus.ring.style"), " ").concat(dt2("focus.ring.color"), ";\n    outline-offset: -1px;\n}\n\n.p-tabview-tablist-item:not(.p-highlight):not(.p-disabled):hover > .p-tabview-tab-header {\n    color: ").concat(dt2("tabview.tab.hover.color"), ";\n}\n\n.p-tabview-tablist-item.p-highlight > .p-tabview-tab-header {\n    color: ").concat(dt2("tabview.tab.active.color"), ";\n}\n\n.p-tabview-tab-title {\n    line-height: 1;\n    white-space: nowrap;\n}\n\n.p-tabview-next-button,\n.p-tabview-prev-button {\n    position: absolute;\n    top: 0;\n    margin: 0;\n    padding: 0;\n    z-index: 2;\n    height: 100%;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    background: ").concat(dt2("tabview.nav.button.background"), ";\n    color: ").concat(dt2("tabview.nav.button.color"), ";\n    width: 2.5rem;\n    border-radius: 0;\n    outline-color: transparent;\n    transition: color ").concat(dt2("tabview.transition.duration"), ", outline-color ").concat(dt2("tabview.transition.duration"), ";\n    box-shadow: ").concat(dt2("tabview.nav.button.shadow"), ";\n    border: none;\n    cursor: pointer;\n    user-select: none;\n}\n\n.p-tabview-next-button:focus-visible,\n.p-tabview-prev-button:focus-visible {\n    outline: ").concat(dt2("focus.ring.width"), " ").concat(dt2("focus.ring.style"), " ").concat(dt2("focus.ring.color"), ";\n    outline-offset: ").concat(dt2("focus.ring.offset"), ";\n}\n\n.p-tabview-next-button:hover,\n.p-tabview-prev-button:hover {\n    color: ").concat(dt2("tabview.nav.button.hover.color"), ";\n}\n\n.p-tabview-prev-button {\n    left: 0;\n}\n\n.p-tabview-next-button {\n    right: 0;\n}\n\n.p-tabview-panels {\n    background: ").concat(dt2("tabview.tab.panel.background"), ";\n    color: ").concat(dt2("tabview.tab.panel.color"), ";\n    padding: 0.875rem 1.125rem 1.125rem 1.125rem;\n}\n\n.p-tabview-ink-bar {\n    z-index: 1;\n    display: block;\n    position: absolute;\n    bottom: -1px;\n    height: 1px;\n    background: ").concat(dt2("tabview.tab.active.border.color"), ";\n    transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);\n}\n");
}, "theme");
var classes$h = {
  root: /* @__PURE__ */ __name(function root12(_ref2) {
    var props = _ref2.props;
    return ["p-tabview p-component", {
      "p-tabview-scrollable": props.scrollable
    }];
  }, "root"),
  navContainer: "p-tabview-tablist-container",
  prevButton: "p-tabview-prev-button",
  navContent: "p-tabview-tablist-scroll-container",
  nav: "p-tabview-tablist",
  tab: {
    header: /* @__PURE__ */ __name(function header(_ref3) {
      var instance = _ref3.instance, tab = _ref3.tab, index2 = _ref3.index;
      return ["p-tabview-tablist-item", instance.getTabProp(tab, "headerClass"), {
        "p-tabview-tablist-item-active": instance.d_activeIndex === index2,
        "p-disabled": instance.getTabProp(tab, "disabled")
      }];
    }, "header"),
    headerAction: "p-tabview-tab-header",
    headerTitle: "p-tabview-tab-title",
    content: /* @__PURE__ */ __name(function content(_ref4) {
      var instance = _ref4.instance, tab = _ref4.tab;
      return ["p-tabview-panel", instance.getTabProp(tab, "contentClass")];
    }, "content")
  },
  inkbar: "p-tabview-ink-bar",
  nextButton: "p-tabview-next-button",
  panelContainer: "p-tabview-panels"
};
var TabViewStyle = BaseStyle.extend({
  name: "tabview",
  theme: theme$h,
  classes: classes$h
});
var script$1$h = {
  name: "BaseTabView",
  "extends": script$_,
  props: {
    activeIndex: {
      type: Number,
      "default": 0
    },
    lazy: {
      type: Boolean,
      "default": false
    },
    scrollable: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: Number,
      "default": 0
    },
    selectOnFocus: {
      type: Boolean,
      "default": false
    },
    prevButtonProps: {
      type: null,
      "default": null
    },
    nextButtonProps: {
      type: null,
      "default": null
    },
    prevIcon: {
      type: String,
      "default": void 0
    },
    nextIcon: {
      type: String,
      "default": void 0
    }
  },
  style: TabViewStyle,
  provide: /* @__PURE__ */ __name(function provide24() {
    return {
      $pcTabs: void 0,
      // Backwards compatible to prevent <TabPanel> component from breaking
      $pcTabView: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$t = {
  name: "TabView",
  "extends": script$1$h,
  inheritAttrs: false,
  emits: ["update:activeIndex", "tab-change", "tab-click"],
  data: /* @__PURE__ */ __name(function data9() {
    return {
      id: this.$attrs.id,
      d_activeIndex: this.activeIndex,
      isPrevButtonDisabled: true,
      isNextButtonDisabled: false
    };
  }, "data"),
  watch: {
    "$attrs.id": /* @__PURE__ */ __name(function $attrsId5(newValue2) {
      this.id = newValue2 || UniqueComponentId();
    }, "$attrsId"),
    activeIndex: /* @__PURE__ */ __name(function activeIndex(newValue2) {
      this.d_activeIndex = newValue2;
      this.scrollInView({
        index: newValue2
      });
    }, "activeIndex")
  },
  mounted: /* @__PURE__ */ __name(function mounted10() {
    console.warn("Deprecated since v4. Use Tabs component instead.");
    this.id = this.id || UniqueComponentId();
    this.updateInkBar();
    this.scrollable && this.updateButtonState();
  }, "mounted"),
  updated: /* @__PURE__ */ __name(function updated7() {
    this.updateInkBar();
    this.scrollable && this.updateButtonState();
  }, "updated"),
  methods: {
    isTabPanel: /* @__PURE__ */ __name(function isTabPanel(child) {
      return child.type.name === "TabPanel";
    }, "isTabPanel"),
    isTabActive: /* @__PURE__ */ __name(function isTabActive(index2) {
      return this.d_activeIndex === index2;
    }, "isTabActive"),
    getTabProp: /* @__PURE__ */ __name(function getTabProp(tab, name2) {
      return tab.props ? tab.props[name2] : void 0;
    }, "getTabProp"),
    getKey: /* @__PURE__ */ __name(function getKey(tab, index2) {
      return this.getTabProp(tab, "header") || index2;
    }, "getKey"),
    getTabHeaderActionId: /* @__PURE__ */ __name(function getTabHeaderActionId(index2) {
      return "".concat(this.id, "_").concat(index2, "_header_action");
    }, "getTabHeaderActionId"),
    getTabContentId: /* @__PURE__ */ __name(function getTabContentId(index2) {
      return "".concat(this.id, "_").concat(index2, "_content");
    }, "getTabContentId"),
    getTabPT: /* @__PURE__ */ __name(function getTabPT(tab, key, index2) {
      var count = this.tabs.length;
      var tabMetaData = {
        props: tab.props,
        parent: {
          instance: this,
          props: this.$props,
          state: this.$data
        },
        context: {
          index: index2,
          count,
          first: index2 === 0,
          last: index2 === count - 1,
          active: this.isTabActive(index2)
        }
      };
      return mergeProps(this.ptm("tabpanel.".concat(key), {
        tabpanel: tabMetaData
      }), this.ptm("tabpanel.".concat(key), tabMetaData), this.ptmo(this.getTabProp(tab, "pt"), key, tabMetaData));
    }, "getTabPT"),
    onScroll: /* @__PURE__ */ __name(function onScroll3(event) {
      this.scrollable && this.updateButtonState();
      event.preventDefault();
    }, "onScroll"),
    onPrevButtonClick: /* @__PURE__ */ __name(function onPrevButtonClick() {
      var content2 = this.$refs.content;
      var width2 = getWidth(content2);
      var pos2 = content2.scrollLeft - width2;
      content2.scrollLeft = pos2 <= 0 ? 0 : pos2;
    }, "onPrevButtonClick"),
    onNextButtonClick: /* @__PURE__ */ __name(function onNextButtonClick() {
      var content2 = this.$refs.content;
      var width2 = getWidth(content2) - this.getVisibleButtonWidths();
      var pos2 = content2.scrollLeft + width2;
      var lastPos = content2.scrollWidth - width2;
      content2.scrollLeft = pos2 >= lastPos ? lastPos : pos2;
    }, "onNextButtonClick"),
    onTabClick: /* @__PURE__ */ __name(function onTabClick(event, tab, index2) {
      this.changeActiveIndex(event, tab, index2);
      this.$emit("tab-click", {
        originalEvent: event,
        index: index2
      });
    }, "onTabClick"),
    onTabKeyDown: /* @__PURE__ */ __name(function onTabKeyDown(event, tab, index2) {
      switch (event.code) {
        case "ArrowLeft":
          this.onTabArrowLeftKey(event);
          break;
        case "ArrowRight":
          this.onTabArrowRightKey(event);
          break;
        case "Home":
          this.onTabHomeKey(event);
          break;
        case "End":
          this.onTabEndKey(event);
          break;
        case "PageDown":
          this.onPageDownKey(event);
          break;
        case "PageUp":
          this.onPageUpKey(event);
          break;
        case "Enter":
        case "NumpadEnter":
        case "Space":
          this.onTabEnterKey(event, tab, index2);
          break;
      }
    }, "onTabKeyDown"),
    onTabArrowRightKey: /* @__PURE__ */ __name(function onTabArrowRightKey(event) {
      var nextHeaderAction = this.findNextHeaderAction(event.target.parentElement);
      nextHeaderAction ? this.changeFocusedTab(event, nextHeaderAction) : this.onTabHomeKey(event);
      event.preventDefault();
    }, "onTabArrowRightKey"),
    onTabArrowLeftKey: /* @__PURE__ */ __name(function onTabArrowLeftKey(event) {
      var prevHeaderAction = this.findPrevHeaderAction(event.target.parentElement);
      prevHeaderAction ? this.changeFocusedTab(event, prevHeaderAction) : this.onTabEndKey(event);
      event.preventDefault();
    }, "onTabArrowLeftKey"),
    onTabHomeKey: /* @__PURE__ */ __name(function onTabHomeKey(event) {
      var firstHeaderAction = this.findFirstHeaderAction();
      this.changeFocusedTab(event, firstHeaderAction);
      event.preventDefault();
    }, "onTabHomeKey"),
    onTabEndKey: /* @__PURE__ */ __name(function onTabEndKey(event) {
      var lastHeaderAction = this.findLastHeaderAction();
      this.changeFocusedTab(event, lastHeaderAction);
      event.preventDefault();
    }, "onTabEndKey"),
    onPageDownKey: /* @__PURE__ */ __name(function onPageDownKey2(event) {
      this.scrollInView({
        index: this.$refs.nav.children.length - 2
      });
      event.preventDefault();
    }, "onPageDownKey"),
    onPageUpKey: /* @__PURE__ */ __name(function onPageUpKey2(event) {
      this.scrollInView({
        index: 0
      });
      event.preventDefault();
    }, "onPageUpKey"),
    onTabEnterKey: /* @__PURE__ */ __name(function onTabEnterKey(event, tab, index2) {
      this.changeActiveIndex(event, tab, index2);
      event.preventDefault();
    }, "onTabEnterKey"),
    findNextHeaderAction: /* @__PURE__ */ __name(function findNextHeaderAction(tabElement) {
      var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      var headerElement = selfCheck ? tabElement : tabElement.nextElementSibling;
      return headerElement ? getAttribute(headerElement, "data-p-disabled") || getAttribute(headerElement, "data-pc-section") === "inkbar" ? this.findNextHeaderAction(headerElement) : findSingle(headerElement, '[data-pc-section="headeraction"]') : null;
    }, "findNextHeaderAction"),
    findPrevHeaderAction: /* @__PURE__ */ __name(function findPrevHeaderAction(tabElement) {
      var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      var headerElement = selfCheck ? tabElement : tabElement.previousElementSibling;
      return headerElement ? getAttribute(headerElement, "data-p-disabled") || getAttribute(headerElement, "data-pc-section") === "inkbar" ? this.findPrevHeaderAction(headerElement) : findSingle(headerElement, '[data-pc-section="headeraction"]') : null;
    }, "findPrevHeaderAction"),
    findFirstHeaderAction: /* @__PURE__ */ __name(function findFirstHeaderAction() {
      return this.findNextHeaderAction(this.$refs.nav.firstElementChild, true);
    }, "findFirstHeaderAction"),
    findLastHeaderAction: /* @__PURE__ */ __name(function findLastHeaderAction() {
      return this.findPrevHeaderAction(this.$refs.nav.lastElementChild, true);
    }, "findLastHeaderAction"),
    changeActiveIndex: /* @__PURE__ */ __name(function changeActiveIndex(event, tab, index2) {
      if (!this.getTabProp(tab, "disabled") && this.d_activeIndex !== index2) {
        this.d_activeIndex = index2;
        this.$emit("update:activeIndex", index2);
        this.$emit("tab-change", {
          originalEvent: event,
          index: index2
        });
        this.scrollInView({
          index: index2
        });
      }
    }, "changeActiveIndex"),
    changeFocusedTab: /* @__PURE__ */ __name(function changeFocusedTab(event, element) {
      if (element) {
        focus$1(element);
        this.scrollInView({
          element
        });
        if (this.selectOnFocus) {
          var index2 = parseInt(element.parentElement.dataset.pcIndex, 10);
          var tab = this.tabs[index2];
          this.changeActiveIndex(event, tab, index2);
        }
      }
    }, "changeFocusedTab"),
    scrollInView: /* @__PURE__ */ __name(function scrollInView4(_ref) {
      var element = _ref.element, _ref$index = _ref.index, index2 = _ref$index === void 0 ? -1 : _ref$index;
      var currentElement = element || this.$refs.nav.children[index2];
      if (currentElement) {
        currentElement.scrollIntoView && currentElement.scrollIntoView({
          block: "nearest"
        });
      }
    }, "scrollInView"),
    updateInkBar: /* @__PURE__ */ __name(function updateInkBar() {
      var tabHeader = this.$refs.nav.children[this.d_activeIndex];
      this.$refs.inkbar.style.width = getWidth(tabHeader) + "px";
      this.$refs.inkbar.style.left = getOffset(tabHeader).left - getOffset(this.$refs.nav).left + "px";
    }, "updateInkBar"),
    updateButtonState: /* @__PURE__ */ __name(function updateButtonState() {
      var content2 = this.$refs.content;
      var scrollLeft = content2.scrollLeft, scrollWidth2 = content2.scrollWidth;
      var width2 = getWidth(content2);
      this.isPrevButtonDisabled = scrollLeft === 0;
      this.isNextButtonDisabled = parseInt(scrollLeft) === scrollWidth2 - width2;
    }, "updateButtonState"),
    getVisibleButtonWidths: /* @__PURE__ */ __name(function getVisibleButtonWidths() {
      var _this$$refs = this.$refs, prevBtn = _this$$refs.prevBtn, nextBtn = _this$$refs.nextBtn;
      return [prevBtn, nextBtn].reduce(function(acc, el) {
        return el ? acc + getWidth(el) : acc;
      }, 0);
    }, "getVisibleButtonWidths")
  },
  computed: {
    tabs: /* @__PURE__ */ __name(function tabs() {
      var _this = this;
      return this.$slots["default"]().reduce(function(tabs2, child) {
        if (_this.isTabPanel(child)) {
          tabs2.push(child);
        } else if (child.children && child.children instanceof Array) {
          child.children.forEach(function(nestedChild) {
            if (_this.isTabPanel(nestedChild)) {
              tabs2.push(nestedChild);
            }
          });
        }
        return tabs2;
      }, []);
    }, "tabs"),
    prevButtonAriaLabel: /* @__PURE__ */ __name(function prevButtonAriaLabel() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.previous : void 0;
    }, "prevButtonAriaLabel"),
    nextButtonAriaLabel: /* @__PURE__ */ __name(function nextButtonAriaLabel() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.next : void 0;
    }, "nextButtonAriaLabel")
  },
  directives: {
    ripple: Ripple
  },
  components: {
    ChevronLeftIcon: script$v,
    ChevronRightIcon: script$u
  }
};
function _typeof$8(o) {
  "@babel/helpers - typeof";
  return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$8(o);
}
__name(_typeof$8, "_typeof$8");
function ownKeys$a(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$a, "ownKeys$a");
function _objectSpread$a(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$a(Object(t2), true).forEach(function(r2) {
      _defineProperty$8(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$a(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$a, "_objectSpread$a");
function _defineProperty$8(e2, r, t2) {
  return (r = _toPropertyKey$7(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$8, "_defineProperty$8");
function _toPropertyKey$7(t2) {
  var i2 = _toPrimitive$7(t2, "string");
  return "symbol" == _typeof$8(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$7, "_toPropertyKey$7");
function _toPrimitive$7(t2, r) {
  if ("object" != _typeof$8(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$8(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$7, "_toPrimitive$7");
var _hoisted_1$Z = ["tabindex", "aria-label"];
var _hoisted_2$J = ["data-p-active", "data-p-disabled", "data-pc-index"];
var _hoisted_3$n = ["id", "tabindex", "aria-disabled", "aria-selected", "aria-controls", "onClick", "onKeydown"];
var _hoisted_4$h = ["tabindex", "aria-label"];
var _hoisted_5$c = ["id", "aria-labelledby", "data-pc-index", "data-p-active"];
function render$s(_ctx, _cache, $props, $setup, $data, $options) {
  var _directive_ripple = resolveDirective("ripple");
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    role: "tablist"
  }, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({
    "class": _ctx.cx("navContainer")
  }, _ctx.ptm("navContainer")), [_ctx.scrollable && !$data.isPrevButtonDisabled ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
    key: 0,
    ref: "prevBtn",
    type: "button",
    "class": _ctx.cx("prevButton"),
    tabindex: _ctx.tabindex,
    "aria-label": $options.prevButtonAriaLabel,
    onClick: _cache[0] || (_cache[0] = function() {
      return $options.onPrevButtonClick && $options.onPrevButtonClick.apply($options, arguments);
    })
  }, _objectSpread$a(_objectSpread$a({}, _ctx.prevButtonProps), _ctx.ptm("prevButton")), {
    "data-pc-group-section": "navbutton"
  }), [renderSlot(_ctx.$slots, "previcon", {}, function() {
    return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon ? "span" : "ChevronLeftIcon"), mergeProps({
      "aria-hidden": "true",
      "class": _ctx.prevIcon
    }, _ctx.ptm("prevIcon")), null, 16, ["class"]))];
  })], 16, _hoisted_1$Z)), [[_directive_ripple]]) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    ref: "content",
    "class": _ctx.cx("navContent"),
    onScroll: _cache[1] || (_cache[1] = function() {
      return $options.onScroll && $options.onScroll.apply($options, arguments);
    })
  }, _ctx.ptm("navContent")), [createBaseVNode("ul", mergeProps({
    ref: "nav",
    "class": _ctx.cx("nav")
  }, _ctx.ptm("nav")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($options.tabs, function(tab, index2) {
    return openBlock(), createElementBlock("li", mergeProps({
      key: $options.getKey(tab, index2),
      style: $options.getTabProp(tab, "headerStyle"),
      "class": _ctx.cx("tab.header", {
        tab,
        index: index2
      }),
      role: "presentation",
      ref_for: true
    }, _objectSpread$a(_objectSpread$a(_objectSpread$a({}, $options.getTabProp(tab, "headerProps")), $options.getTabPT(tab, "root", index2)), $options.getTabPT(tab, "header", index2)), {
      "data-pc-name": "tabpanel",
      "data-p-active": $data.d_activeIndex === index2,
      "data-p-disabled": $options.getTabProp(tab, "disabled"),
      "data-pc-index": index2
    }), [withDirectives((openBlock(), createElementBlock("a", mergeProps({
      id: $options.getTabHeaderActionId(index2),
      "class": _ctx.cx("tab.headerAction"),
      tabindex: $options.getTabProp(tab, "disabled") || !$options.isTabActive(index2) ? -1 : _ctx.tabindex,
      role: "tab",
      "aria-disabled": $options.getTabProp(tab, "disabled"),
      "aria-selected": $options.isTabActive(index2),
      "aria-controls": $options.getTabContentId(index2),
      onClick: /* @__PURE__ */ __name(function onClick3($event) {
        return $options.onTabClick($event, tab, index2);
      }, "onClick"),
      onKeydown: /* @__PURE__ */ __name(function onKeydown3($event) {
        return $options.onTabKeyDown($event, tab, index2);
      }, "onKeydown"),
      ref_for: true
    }, _objectSpread$a(_objectSpread$a({}, $options.getTabProp(tab, "headerActionProps")), $options.getTabPT(tab, "headerAction", index2))), [tab.props && tab.props.header ? (openBlock(), createElementBlock("span", mergeProps({
      key: 0,
      "class": _ctx.cx("tab.headerTitle"),
      ref_for: true
    }, $options.getTabPT(tab, "headerTitle", index2)), toDisplayString$1(tab.props.header), 17)) : createCommentVNode("", true), tab.children && tab.children.header ? (openBlock(), createBlock(resolveDynamicComponent(tab.children.header), {
      key: 1
    })) : createCommentVNode("", true)], 16, _hoisted_3$n)), [[_directive_ripple]])], 16, _hoisted_2$J);
  }), 128)), createBaseVNode("li", mergeProps({
    ref: "inkbar",
    "class": _ctx.cx("inkbar"),
    role: "presentation",
    "aria-hidden": "true"
  }, _ctx.ptm("inkbar")), null, 16)], 16)], 16), _ctx.scrollable && !$data.isNextButtonDisabled ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
    key: 1,
    ref: "nextBtn",
    type: "button",
    "class": _ctx.cx("nextButton"),
    tabindex: _ctx.tabindex,
    "aria-label": $options.nextButtonAriaLabel,
    onClick: _cache[2] || (_cache[2] = function() {
      return $options.onNextButtonClick && $options.onNextButtonClick.apply($options, arguments);
    })
  }, _objectSpread$a(_objectSpread$a({}, _ctx.nextButtonProps), _ctx.ptm("nextButton")), {
    "data-pc-group-section": "navbutton"
  }), [renderSlot(_ctx.$slots, "nexticon", {}, function() {
    return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon ? "span" : "ChevronRightIcon"), mergeProps({
      "aria-hidden": "true",
      "class": _ctx.nextIcon
    }, _ctx.ptm("nextIcon")), null, 16, ["class"]))];
  })], 16, _hoisted_4$h)), [[_directive_ripple]]) : createCommentVNode("", true)], 16), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("panelContainer")
  }, _ctx.ptm("panelContainer")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($options.tabs, function(tab, index2) {
    return openBlock(), createElementBlock(Fragment$1, {
      key: $options.getKey(tab, index2)
    }, [(_ctx.lazy ? $options.isTabActive(index2) : true) ? withDirectives((openBlock(), createElementBlock("div", mergeProps({
      key: 0,
      id: $options.getTabContentId(index2),
      style: $options.getTabProp(tab, "contentStyle"),
      "class": _ctx.cx("tab.content", {
        tab
      }),
      role: "tabpanel",
      "aria-labelledby": $options.getTabHeaderActionId(index2),
      ref_for: true
    }, _objectSpread$a(_objectSpread$a(_objectSpread$a({}, $options.getTabProp(tab, "contentProps")), $options.getTabPT(tab, "root", index2)), $options.getTabPT(tab, "content", index2)), {
      "data-pc-name": "tabpanel",
      "data-pc-index": index2,
      "data-p-active": $data.d_activeIndex === index2
    }), [(openBlock(), createBlock(resolveDynamicComponent(tab)))], 16, _hoisted_5$c)), [[vShow, _ctx.lazy ? true : $options.isTabActive(index2)]]) : createCommentVNode("", true)], 64);
  }), 128))], 16)], 16);
}
__name(render$s, "render$s");
script$t.render = render$s;
const _hoisted_1$Y = { class: "grid grid-cols-2 gap-2" };
const _hoisted_2$I = { class: "font-medium" };
const _sfc_main$M = /* @__PURE__ */ defineComponent({
  __name: "DeviceInfo",
  props: {
    device: {}
  },
  setup(__props) {
    const props = __props;
    const deviceColumns = [
      { field: "name", header: "Name" },
      { field: "type", header: "Type" },
      { field: "vram_total", header: "VRAM Total" },
      { field: "vram_free", header: "VRAM Free" },
      { field: "torch_vram_total", header: "Torch VRAM Total" },
      { field: "torch_vram_free", header: "Torch VRAM Free" }
    ];
    const formatValue2 = /* @__PURE__ */ __name((value4, field) => {
      if (["vram_total", "vram_free", "torch_vram_total", "torch_vram_free"].includes(
        field
      )) {
        return formatSize(value4);
      }
      return value4;
    }, "formatValue");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$Y, [
        (openBlock(), createElementBlock(Fragment$1, null, renderList(deviceColumns, (col) => {
          return openBlock(), createElementBlock(Fragment$1, {
            key: col.field
          }, [
            createBaseVNode("div", _hoisted_2$I, toDisplayString$1(col.header), 1),
            createBaseVNode("div", null, toDisplayString$1(formatValue2(props.device[col.field], col.field)), 1)
          ], 64);
        }), 64))
      ]);
    };
  }
});
const _hoisted_1$X = { class: "system-stats" };
const _hoisted_2$H = { class: "mb-6" };
const _hoisted_3$m = { class: "text-2xl font-semibold mb-4" };
const _hoisted_4$g = { class: "grid grid-cols-2 gap-2" };
const _hoisted_5$b = { class: "font-medium" };
const _hoisted_6$8 = { class: "text-2xl font-semibold mb-4" };
const _sfc_main$L = /* @__PURE__ */ defineComponent({
  __name: "SystemStatsPanel",
  props: {
    stats: {}
  },
  setup(__props) {
    const props = __props;
    const systemInfo = computed(() => ({
      ...props.stats.system,
      argv: props.stats.system.argv.join(" ")
    }));
    const systemColumns = [
      { field: "os", header: "OS" },
      { field: "python_version", header: "Python Version" },
      { field: "embedded_python", header: "Embedded Python" },
      { field: "pytorch_version", header: "Pytorch Version" },
      { field: "argv", header: "Arguments" },
      { field: "ram_total", header: "RAM Total" },
      { field: "ram_free", header: "RAM Free" }
    ];
    const formatValue2 = /* @__PURE__ */ __name((value4, field) => {
      if (["ram_total", "ram_free"].includes(field)) {
        return formatSize(value4);
      }
      return value4;
    }, "formatValue");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$X, [
        createBaseVNode("div", _hoisted_2$H, [
          createBaseVNode("h2", _hoisted_3$m, toDisplayString$1(_ctx.$t("g.systemInfo")), 1),
          createBaseVNode("div", _hoisted_4$g, [
            (openBlock(), createElementBlock(Fragment$1, null, renderList(systemColumns, (col) => {
              return openBlock(), createElementBlock(Fragment$1, {
                key: col.field
              }, [
                createBaseVNode("div", _hoisted_5$b, toDisplayString$1(col.header), 1),
                createBaseVNode("div", null, toDisplayString$1(formatValue2(systemInfo.value[col.field], col.field)), 1)
              ], 64);
            }), 64))
          ])
        ]),
        createVNode(unref(script$O)),
        createBaseVNode("div", null, [
          createBaseVNode("h2", _hoisted_6$8, toDisplayString$1(_ctx.$t("g.devices")), 1),
          props.stats.devices.length > 1 ? (openBlock(), createBlock(unref(script$t), { key: 0 }, {
            default: withCtx(() => [
              (openBlock(true), createElementBlock(Fragment$1, null, renderList(props.stats.devices, (device) => {
                return openBlock(), createBlock(unref(script$w), {
                  key: device.index,
                  header: device.name
                }, {
                  default: withCtx(() => [
                    createVNode(_sfc_main$M, { device }, null, 8, ["device"])
                  ]),
                  _: 2
                }, 1032, ["header"]);
              }), 128))
            ]),
            _: 1
          })) : (openBlock(), createBlock(_sfc_main$M, {
            key: 1,
            device: props.stats.devices[0]
          }, null, 8, ["device"]))
        ])
      ]);
    };
  }
});
const ALWAYS_ENABLED_EXTENSIONS = [];
const ALWAYS_DISABLED_EXTENSIONS = [
  // pysssss.Locking is replaced by pin/unpin in ComfyUI core.
  // https://github.com/Comfy-Org/litegraph.js/pull/117
  "pysssss.Locking",
  // pysssss.SnapToGrid is replaced by Comfy.Graph.AlwaysSnapToGrid in ComfyUI core.
  // pysssss.SnapToGrid tries to write global app.shiftDown state, which is no longer
  // allowed since v1.3.12.
  // https://github.com/Comfy-Org/ComfyUI_frontend/issues/1176
  "pysssss.SnapToGrid"
];
const useExtensionStore = /* @__PURE__ */ defineStore("extension", () => {
  const extensionByName = ref({});
  const extensions = computed(() => Object.values(extensionByName.value));
  const disabledExtensionNames = ref(/* @__PURE__ */ new Set());
  const inactiveDisabledExtensionNames = computed(() => {
    return Array.from(disabledExtensionNames.value).filter(
      (name2) => !(name2 in extensionByName.value)
    );
  });
  const isExtensionEnabled = /* @__PURE__ */ __name((name2) => !disabledExtensionNames.value.has(name2), "isExtensionEnabled");
  const enabledExtensions = computed(() => {
    return extensions.value.filter((ext) => isExtensionEnabled(ext.name));
  });
  function isExtensionReadOnly(name2) {
    return ALWAYS_DISABLED_EXTENSIONS.includes(name2) || ALWAYS_ENABLED_EXTENSIONS.includes(name2);
  }
  __name(isExtensionReadOnly, "isExtensionReadOnly");
  function registerExtension(extension) {
    if (!extension.name) {
      throw new Error("Extensions must have a 'name' property.");
    }
    if (extensionByName.value[extension.name]) {
      throw new Error(`Extension named '${extension.name}' already registered.`);
    }
    if (disabledExtensionNames.value.has(extension.name)) {
      console.log(`Extension ${extension.name} is disabled.`);
    }
    extensionByName.value[extension.name] = markRaw(extension);
  }
  __name(registerExtension, "registerExtension");
  function loadDisabledExtensionNames(names) {
    disabledExtensionNames.value = new Set(names);
    for (const name2 of ALWAYS_DISABLED_EXTENSIONS) {
      disabledExtensionNames.value.add(name2);
    }
    for (const name2 of ALWAYS_ENABLED_EXTENSIONS) {
      disabledExtensionNames.value.delete(name2);
    }
  }
  __name(loadDisabledExtensionNames, "loadDisabledExtensionNames");
  const coreExtensionNames = ref([]);
  function captureCoreExtensions() {
    coreExtensionNames.value = extensions.value.map((ext) => ext.name);
  }
  __name(captureCoreExtensions, "captureCoreExtensions");
  function isCoreExtension(name2) {
    return coreExtensionNames.value.includes(name2);
  }
  __name(isCoreExtension, "isCoreExtension");
  const hasThirdPartyExtensions = computed(() => {
    return extensions.value.some((ext) => !isCoreExtension(ext.name));
  });
  return {
    extensions,
    enabledExtensions,
    inactiveDisabledExtensionNames,
    isExtensionEnabled,
    isExtensionReadOnly,
    registerExtension,
    loadDisabledExtensionNames,
    captureCoreExtensions,
    isCoreExtension,
    hasThirdPartyExtensions
  };
});
const useSystemStatsStore = /* @__PURE__ */ defineStore("systemStats", () => {
  const systemStats = ref(null);
  const isLoading = ref(false);
  const error2 = ref(null);
  async function fetchSystemStats() {
    isLoading.value = true;
    error2.value = null;
    try {
      systemStats.value = await api.getSystemStats();
    } catch (err) {
      error2.value = err instanceof Error ? err.message : "An error occurred while fetching system stats";
      console.error("Error fetching system stats:", err);
    } finally {
      isLoading.value = false;
    }
  }
  __name(fetchSystemStats, "fetchSystemStats");
  return {
    systemStats,
    isLoading,
    error: error2,
    fetchSystemStats
  };
});
const useAboutPanelStore = /* @__PURE__ */ defineStore("aboutPanel", () => {
  const frontendVersion = "1.6.18";
  const extensionStore = useExtensionStore();
  const systemStatsStore = useSystemStatsStore();
  const coreVersion = computed(
    () => systemStatsStore?.systemStats?.system?.comfyui_version ?? ""
  );
  const coreBadges = computed(() => [
    // In electron, the ComfyUI is packaged without the git repo,
    // so the python server's API doesn't have the version info.
    {
      label: `ComfyUI ${isElectron() ? "v" + electronAPI().getComfyUIVersion() : coreVersion.value}`,
      url: "https://github.com/comfyanonymous/ComfyUI",
      icon: "pi pi-github"
    },
    {
      label: `ComfyUI_frontend v${frontendVersion}`,
      url: "https://github.com/Comfy-Org/ComfyUI_frontend",
      icon: "pi pi-github"
    },
    {
      label: "Discord",
      url: "https://www.comfy.org/discord",
      icon: "pi pi-discord"
    },
    { label: "ComfyOrg", url: "https://www.comfy.org/", icon: "pi pi-globe" }
  ]);
  const allBadges = computed(() => [
    ...coreBadges.value,
    ...extensionStore.extensions.flatMap((e2) => e2.aboutPageBadges ?? [])
  ]);
  return {
    badges: allBadges
  };
});
const _hoisted_1$W = { class: "flex flex-col h-full w-full gap-2" };
const _sfc_main$K = /* @__PURE__ */ defineComponent({
  __name: "PanelTemplate",
  props: {
    value: {},
    class: {}
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(script$w), {
        value: props.value,
        class: normalizeClass(["h-full w-full", props.class])
      }, {
        default: withCtx(() => [
          createBaseVNode("div", _hoisted_1$W, [
            renderSlot(_ctx.$slots, "header"),
            createVNode(unref(script$N), { class: "flex-grow h-0 pr-2" }, {
              default: withCtx(() => [
                renderSlot(_ctx.$slots, "default")
              ]),
              _: 3
            }),
            renderSlot(_ctx.$slots, "footer")
          ])
        ]),
        _: 3
      }, 8, ["value", "class"]);
    };
  }
});
const _hoisted_1$V = { class: "text-2xl font-bold mb-2" };
const _hoisted_2$G = { class: "space-y-2" };
const _hoisted_3$l = ["href", "title"];
const _sfc_main$J = /* @__PURE__ */ defineComponent({
  __name: "AboutPanel",
  setup(__props) {
    const systemStatsStore = useSystemStatsStore();
    const aboutPanelStore = useAboutPanelStore();
    onMounted(async () => {
      if (!systemStatsStore.systemStats) {
        await systemStatsStore.fetchSystemStats();
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$K, {
        value: "About",
        class: "about-container"
      }, {
        default: withCtx(() => [
          createBaseVNode("h2", _hoisted_1$V, toDisplayString$1(_ctx.$t("g.about")), 1),
          createBaseVNode("div", _hoisted_2$G, [
            (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(aboutPanelStore).badges, (badge) => {
              return openBlock(), createElementBlock("a", {
                key: badge.url,
                href: badge.url,
                target: "_blank",
                rel: "noopener noreferrer",
                class: "about-badge inline-flex items-center no-underline",
                title: badge.url
              }, [
                createVNode(unref(script$x), { class: "mr-2" }, {
                  icon: withCtx(() => [
                    createBaseVNode("i", {
                      class: normalizeClass([badge.icon, "mr-2 text-xl"])
                    }, null, 2)
                  ]),
                  default: withCtx(() => [
                    createTextVNode(" " + toDisplayString$1(badge.label), 1)
                  ]),
                  _: 2
                }, 1024)
              ], 8, _hoisted_3$l);
            }), 128))
          ]),
          createVNode(unref(script$O)),
          unref(systemStatsStore).systemStats ? (openBlock(), createBlock(_sfc_main$L, {
            key: 0,
            stats: unref(systemStatsStore).systemStats
          }, null, 8, ["stats"])) : createCommentVNode("", true)
        ]),
        _: 1
      });
    };
  }
});
var script$s = {
  name: "ExclamationTriangleIcon",
  "extends": script$X
};
var _hoisted_1$U = /* @__PURE__ */ createBaseVNode("path", {
  d: "M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$F = /* @__PURE__ */ createBaseVNode("path", {
  d: "M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_3$k = /* @__PURE__ */ createBaseVNode("path", {
  d: "M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_4$f = [_hoisted_1$U, _hoisted_2$F, _hoisted_3$k];
function render$r(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_4$f, 16);
}
__name(render$r, "render$r");
script$s.render = render$r;
var script$r = {
  name: "InfoCircleIcon",
  "extends": script$X
};
var _hoisted_1$T = /* @__PURE__ */ createBaseVNode("path", {
  "fill-rule": "evenodd",
  "clip-rule": "evenodd",
  d: "M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$E = [_hoisted_1$T];
function render$q(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$E, 16);
}
__name(render$q, "render$q");
script$r.render = render$q;
var theme$g = /* @__PURE__ */ __name(function theme23(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-message {\n    border-radius: ".concat(dt2("message.border.radius"), ";\n    outline-width: ").concat(dt2("message.border.width"), ";\n    outline-style: solid;\n}\n\n.p-message-content {\n    display: flex;\n    align-items: center;\n    padding: ").concat(dt2("message.content.padding"), ";\n    gap: ").concat(dt2("message.content.gap"), ";\n    height: 100%;\n}\n\n.p-message-icon {\n    flex-shrink: 0;\n}\n\n.p-message-close-button {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n    margin: 0 0 0 auto;\n    overflow: hidden;\n    position: relative;\n    width: ").concat(dt2("message.close.button.width"), ";\n    height: ").concat(dt2("message.close.button.height"), ";\n    border-radius: ").concat(dt2("message.close.button.border.radius"), ";\n    background: transparent;\n    transition: background ").concat(dt2("message.transition.duration"), ", color ").concat(dt2("message.transition.duration"), ", outline-color ").concat(dt2("message.transition.duration"), ", box-shadow ").concat(dt2("message.transition.duration"), ", opacity 0.3s;\n    outline-color: transparent;\n    color: inherit;\n    padding: 0;\n    border: none;\n    cursor: pointer;\n    user-select: none;\n}\n\n.p-message-close-icon {\n    font-size: ").concat(dt2("message.close.icon.size"), ";\n    width: ").concat(dt2("message.close.icon.size"), ";\n    height: ").concat(dt2("message.close.icon.size"), ";\n}\n\n.p-message-close-button:focus-visible {\n    outline-width: ").concat(dt2("message.close.button.focus.ring.width"), ";\n    outline-style: ").concat(dt2("message.close.button.focus.ring.style"), ";\n    outline-offset: ").concat(dt2("message.close.button.focus.ring.offset"), ";\n}\n\n.p-message-info {\n    background: ").concat(dt2("message.info.background"), ";\n    outline-color: ").concat(dt2("message.info.border.color"), ";\n    color: ").concat(dt2("message.info.color"), ";\n    box-shadow: ").concat(dt2("message.info.shadow"), ";\n}\n\n.p-message-info .p-message-close-button:focus-visible {\n    outline-color: ").concat(dt2("message.info.close.button.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("message.info.close.button.focus.ring.shadow"), ";\n}\n\n.p-message-info .p-message-close-button:hover {\n    background: ").concat(dt2("message.info.close.button.hover.background"), ";\n}\n\n.p-message-success {\n    background: ").concat(dt2("message.success.background"), ";\n    outline-color: ").concat(dt2("message.success.border.color"), ";\n    color: ").concat(dt2("message.success.color"), ";\n    box-shadow: ").concat(dt2("message.success.shadow"), ";\n}\n\n.p-message-success .p-message-close-button:focus-visible {\n    outline-color: ").concat(dt2("message.success.close.button.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("message.success.close.button.focus.ring.shadow"), ";\n}\n\n.p-message-success .p-message-close-button:hover {\n    background: ").concat(dt2("message.success.close.button.hover.background"), ";\n}\n\n.p-message-warn {\n    background: ").concat(dt2("message.warn.background"), ";\n    outline-color: ").concat(dt2("message.warn.border.color"), ";\n    color: ").concat(dt2("message.warn.color"), ";\n    box-shadow: ").concat(dt2("message.warn.shadow"), ";\n}\n\n.p-message-warn .p-message-close-button:focus-visible {\n    outline-color: ").concat(dt2("message.warn.close.button.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("message.warn.close.button.focus.ring.shadow"), ";\n}\n\n.p-message-warn .p-message-close-button:hover {\n    background: ").concat(dt2("message.warn.close.button.hover.background"), ";\n}\n\n.p-message-error {\n    background: ").concat(dt2("message.error.background"), ";\n    outline-color: ").concat(dt2("message.error.border.color"), ";\n    color: ").concat(dt2("message.error.color"), ";\n    box-shadow: ").concat(dt2("message.error.shadow"), ";\n}\n\n.p-message-error .p-message-close-button:focus-visible {\n    outline-color: ").concat(dt2("message.error.close.button.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("message.error.close.button.focus.ring.shadow"), ";\n}\n\n.p-message-error .p-message-close-button:hover {\n    background: ").concat(dt2("message.error.close.button.hover.background"), ";\n}\n\n.p-message-secondary {\n    background: ").concat(dt2("message.secondary.background"), ";\n    outline-color: ").concat(dt2("message.secondary.border.color"), ";\n    color: ").concat(dt2("message.secondary.color"), ";\n    box-shadow: ").concat(dt2("message.secondary.shadow"), ";\n}\n\n.p-message-secondary .p-message-close-button:focus-visible {\n    outline-color: ").concat(dt2("message.secondary.close.button.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("message.secondary.close.button.focus.ring.shadow"), ";\n}\n\n.p-message-secondary .p-message-close-button:hover {\n    background: ").concat(dt2("message.secondary.close.button.hover.background"), ";\n}\n\n.p-message-contrast {\n    background: ").concat(dt2("message.contrast.background"), ";\n    outline-color: ").concat(dt2("message.contrast.border.color"), ";\n    color: ").concat(dt2("message.contrast.color"), ";\n    box-shadow: ").concat(dt2("message.contrast.shadow"), ";\n}\n\n.p-message-contrast .p-message-close-button:focus-visible {\n    outline-color: ").concat(dt2("message.contrast.close.button.focus.ring.color"), ";\n    box-shadow: ").concat(dt2("message.contrast.close.button.focus.ring.shadow"), ";\n}\n\n.p-message-contrast .p-message-close-button:hover {\n    background: ").concat(dt2("message.contrast.close.button.hover.background"), ";\n}\n\n.p-message-text {\n    font-size: ").concat(dt2("message.text.font.size"), ";\n    font-weight: ").concat(dt2("message.text.font.weight"), ";\n}\n\n.p-message-icon {\n    font-size: ").concat(dt2("message.icon.size"), ";\n    width: ").concat(dt2("message.icon.size"), ";\n    height: ").concat(dt2("message.icon.size"), ";\n}\n\n.p-message-enter-from {\n    opacity: 0;\n}\n\n.p-message-enter-active {\n    transition: opacity 0.3s;\n}\n\n.p-message.p-message-leave-from {\n    max-height: 1000px;\n}\n\n.p-message.p-message-leave-to {\n    max-height: 0;\n    opacity: 0;\n    margin: 0;\n}\n\n.p-message-leave-active {\n    overflow: hidden;\n    transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin 0.3s;\n}\n\n.p-message-leave-active .p-message-close-button {\n    opacity: 0;\n}\n");
}, "theme");
var classes$g = {
  root: /* @__PURE__ */ __name(function root13(_ref2) {
    var props = _ref2.props;
    return "p-message p-component p-message-" + props.severity;
  }, "root"),
  content: "p-message-content",
  icon: "p-message-icon",
  text: "p-message-text",
  closeButton: "p-message-close-button",
  closeIcon: "p-message-close-icon"
};
var MessageStyle = BaseStyle.extend({
  name: "message",
  theme: theme$g,
  classes: classes$g
});
var script$1$g = {
  name: "BaseMessage",
  "extends": script$_,
  props: {
    severity: {
      type: String,
      "default": "info"
    },
    closable: {
      type: Boolean,
      "default": false
    },
    life: {
      type: Number,
      "default": null
    },
    icon: {
      type: String,
      "default": void 0
    },
    closeIcon: {
      type: String,
      "default": void 0
    },
    closeButtonProps: {
      type: null,
      "default": null
    }
  },
  style: MessageStyle,
  provide: /* @__PURE__ */ __name(function provide25() {
    return {
      $pcMessage: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$q = {
  name: "Message",
  "extends": script$1$g,
  inheritAttrs: false,
  emits: ["close", "life-end"],
  timeout: null,
  data: /* @__PURE__ */ __name(function data10() {
    return {
      visible: true
    };
  }, "data"),
  mounted: /* @__PURE__ */ __name(function mounted11() {
    var _this = this;
    if (this.life) {
      setTimeout(function() {
        _this.visible = false;
        _this.$emit("life-end");
      }, this.life);
    }
  }, "mounted"),
  methods: {
    close: /* @__PURE__ */ __name(function close4(event) {
      this.visible = false;
      this.$emit("close", event);
    }, "close")
  },
  computed: {
    iconComponent: /* @__PURE__ */ __name(function iconComponent() {
      return {
        info: script$r,
        success: script$K,
        warn: script$s,
        error: script$z
      }[this.severity];
    }, "iconComponent"),
    closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel2() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0;
    }, "closeAriaLabel")
  },
  directives: {
    ripple: Ripple
  },
  components: {
    TimesIcon: script$W,
    InfoCircleIcon: script$r,
    CheckIcon: script$K,
    ExclamationTriangleIcon: script$s,
    TimesCircleIcon: script$z
  }
};
function _typeof$7(o) {
  "@babel/helpers - typeof";
  return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$7(o);
}
__name(_typeof$7, "_typeof$7");
function ownKeys$9(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$9, "ownKeys$9");
function _objectSpread$9(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$9(Object(t2), true).forEach(function(r2) {
      _defineProperty$7(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$9(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$9, "_objectSpread$9");
function _defineProperty$7(e2, r, t2) {
  return (r = _toPropertyKey$6(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$7, "_defineProperty$7");
function _toPropertyKey$6(t2) {
  var i2 = _toPrimitive$6(t2, "string");
  return "symbol" == _typeof$7(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$6, "_toPropertyKey$6");
function _toPrimitive$6(t2, r) {
  if ("object" != _typeof$7(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$7(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$6, "_toPrimitive$6");
var _hoisted_1$S = ["aria-label"];
function render$p(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_TimesIcon = resolveComponent("TimesIcon");
  var _directive_ripple = resolveDirective("ripple");
  return openBlock(), createBlock(Transition, mergeProps({
    name: "p-message",
    appear: ""
  }, _ctx.ptmi("transition")), {
    "default": withCtx(function() {
      return [withDirectives(createBaseVNode("div", mergeProps({
        "class": _ctx.cx("root"),
        role: "alert",
        "aria-live": "assertive",
        "aria-atomic": "true"
      }, _ctx.ptm("root")), [_ctx.$slots.container ? renderSlot(_ctx.$slots, "container", {
        key: 0,
        closeCallback: $options.close
      }) : (openBlock(), createElementBlock("div", mergeProps({
        key: 1,
        "class": _ctx.cx("content")
      }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "icon", {
        "class": "p-message-icon"
      }, function() {
        return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon ? "span" : null), mergeProps({
          "class": [_ctx.cx("icon"), _ctx.icon]
        }, _ctx.ptm("icon")), null, 16, ["class"]))];
      }), _ctx.$slots["default"] ? (openBlock(), createElementBlock("div", mergeProps({
        key: 0,
        "class": ["p-message-text", _ctx.cx("text")]
      }, _ctx.ptm("text")), [renderSlot(_ctx.$slots, "default")], 16)) : createCommentVNode("", true), _ctx.closable ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
        key: 1,
        "class": _ctx.cx("closeButton"),
        "aria-label": $options.closeAriaLabel,
        type: "button",
        onClick: _cache[0] || (_cache[0] = function($event) {
          return $options.close($event);
        })
      }, _objectSpread$9(_objectSpread$9({}, _ctx.closeButtonProps), _ctx.ptm("closeButton"))), [renderSlot(_ctx.$slots, "closeicon", {}, function() {
        return [_ctx.closeIcon ? (openBlock(), createElementBlock("i", mergeProps({
          key: 0,
          "class": [_ctx.cx("closeIcon"), _ctx.closeIcon]
        }, _ctx.ptm("closeIcon")), null, 16)) : (openBlock(), createBlock(_component_TimesIcon, mergeProps({
          key: 1,
          "class": [_ctx.cx("closeIcon"), _ctx.closeIcon]
        }, _ctx.ptm("closeIcon")), null, 16, ["class"]))];
      })], 16, _hoisted_1$S)), [[_directive_ripple]]) : createCommentVNode("", true)], 16))], 16), [[vShow, $data.visible]])];
    }),
    _: 3
  }, 16);
}
__name(render$p, "render$p");
script$q.render = render$p;
var script$p = {
  name: "ChevronDownIcon",
  "extends": script$X
};
var _hoisted_1$R = /* @__PURE__ */ createBaseVNode("path", {
  d: "M7.01744 10.398C6.91269 10.3985 6.8089 10.378 6.71215 10.3379C6.61541 10.2977 6.52766 10.2386 6.45405 10.1641L1.13907 4.84913C1.03306 4.69404 0.985221 4.5065 1.00399 4.31958C1.02276 4.13266 1.10693 3.95838 1.24166 3.82747C1.37639 3.69655 1.55301 3.61742 1.74039 3.60402C1.92777 3.59062 2.11386 3.64382 2.26584 3.75424L7.01744 8.47394L11.769 3.75424C11.9189 3.65709 12.097 3.61306 12.2748 3.62921C12.4527 3.64535 12.6199 3.72073 12.7498 3.84328C12.8797 3.96582 12.9647 4.12842 12.9912 4.30502C13.0177 4.48162 12.9841 4.662 12.8958 4.81724L7.58083 10.1322C7.50996 10.2125 7.42344 10.2775 7.32656 10.3232C7.22968 10.3689 7.12449 10.3944 7.01744 10.398Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$D = [_hoisted_1$R];
function render$o(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$D, 16);
}
__name(render$o, "render$o");
script$p.render = render$o;
var OverlayEventBus = EventBus();
var theme$f = /* @__PURE__ */ __name(function theme24(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-select {\n    display: inline-flex;\n    cursor: pointer;\n    position: relative;\n    user-select: none;\n    background: ".concat(dt2("select.background"), ";\n    border: 1px solid ").concat(dt2("select.border.color"), ";\n    transition: background ").concat(dt2("select.transition.duration"), ", color ").concat(dt2("select.transition.duration"), ", border-color ").concat(dt2("select.transition.duration"), ",\n        outline-color ").concat(dt2("select.transition.duration"), ", box-shadow ").concat(dt2("select.transition.duration"), ";\n    border-radius: ").concat(dt2("select.border.radius"), ";\n    outline-color: transparent;\n    box-shadow: ").concat(dt2("select.shadow"), ";\n}\n\n.p-select:not(.p-disabled):hover {\n    border-color: ").concat(dt2("select.hover.border.color"), ";\n}\n\n.p-select:not(.p-disabled).p-focus {\n    border-color: ").concat(dt2("select.focus.border.color"), ";\n    box-shadow: ").concat(dt2("select.focus.ring.shadow"), ";\n    outline: ").concat(dt2("select.focus.ring.width"), " ").concat(dt2("select.focus.ring.style"), " ").concat(dt2("select.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("select.focus.ring.offset"), ";\n}\n\n.p-select.p-variant-filled {\n    background: ").concat(dt2("select.filled.background"), ";\n}\n\n.p-select.p-variant-filled.p-focus {\n    background: ").concat(dt2("select.filled.focus.background"), ";\n}\n\n.p-select.p-invalid {\n    border-color: ").concat(dt2("select.invalid.border.color"), ";\n}\n\n.p-select.p-disabled {\n    opacity: 1;\n    background: ").concat(dt2("select.disabled.background"), ";\n}\n\n.p-select-clear-icon {\n    position: absolute;\n    top: 50%;\n    margin-top: -0.5rem;\n    color: ").concat(dt2("select.clear.icon.color"), ";\n    right: ").concat(dt2("select.dropdown.width"), ";\n}\n\n.p-select-dropdown {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n    background: transparent;\n    color: ").concat(dt2("select.dropdown.color"), ";\n    width: ").concat(dt2("select.dropdown.width"), ";\n    border-top-right-radius: ").concat(dt2("select.border.radius"), ";\n    border-bottom-right-radius: ").concat(dt2("select.border.radius"), ";\n}\n\n.p-select-label {\n    display: block;\n    white-space: nowrap;\n    overflow: hidden;\n    flex: 1 1 auto;\n    width: 1%;\n    padding: ").concat(dt2("select.padding.y"), " ").concat(dt2("select.padding.x"), ";\n    text-overflow: ellipsis;\n    cursor: pointer;\n    color: ").concat(dt2("select.color"), ";\n    background: transparent;\n    border: 0 none;\n    outline: 0 none;\n}\n\n.p-select-label.p-placeholder {\n    color: ").concat(dt2("select.placeholder.color"), ";\n}\n\n.p-select:has(.p-select-clear-icon) .p-select-label {\n    padding-right: calc(1rem + ").concat(dt2("select.padding.x"), ");\n}\n\n.p-select.p-disabled .p-select-label {\n    color: ").concat(dt2("select.disabled.color"), ";\n}\n\n.p-select-label-empty {\n    overflow: hidden;\n    opacity: 0;\n}\n\ninput.p-select-label {\n    cursor: default;\n}\n\n.p-select .p-select-overlay {\n    min-width: 100%;\n}\n\n.p-select-overlay {\n    position: absolute;\n    top: 0;\n    left: 0;\n    background: ").concat(dt2("select.overlay.background"), ";\n    color: ").concat(dt2("select.overlay.color"), ";\n    border: 1px solid ").concat(dt2("select.overlay.border.color"), ";\n    border-radius: ").concat(dt2("select.overlay.border.radius"), ";\n    box-shadow: ").concat(dt2("select.overlay.shadow"), ";\n}\n\n.p-select-header {\n    padding: ").concat(dt2("select.list.header.padding"), ";\n}\n\n.p-select-filter {\n    width: 100%;\n}\n\n.p-select-list-container {\n    overflow: auto;\n}\n\n.p-select-option-group {\n    cursor: auto;\n    margin: 0;\n    padding: ").concat(dt2("select.option.group.padding"), ";\n    background: ").concat(dt2("select.option.group.background"), ";\n    color: ").concat(dt2("select.option.group.color"), ";\n    font-weight: ").concat(dt2("select.option.group.font.weight"), ";\n}\n\n.p-select-list {\n    margin: 0;\n    padding: 0;\n    list-style-type: none;\n    padding: ").concat(dt2("select.list.padding"), ";\n    gap: ").concat(dt2("select.list.gap"), ";\n    display: flex;\n    flex-direction: column;\n}\n\n.p-select-option {\n    cursor: pointer;\n    font-weight: normal;\n    white-space: nowrap;\n    position: relative;\n    overflow: hidden;\n    display: flex;\n    align-items: center;\n    padding: ").concat(dt2("select.option.padding"), ";\n    border: 0 none;\n    color: ").concat(dt2("select.option.color"), ";\n    background: transparent;\n    transition: background ").concat(dt2("select.transition.duration"), ", color ").concat(dt2("select.transition.duration"), ", border-color ").concat(dt2("select.transition.duration"), ",\n            box-shadow ").concat(dt2("select.transition.duration"), ", outline-color ").concat(dt2("select.transition.duration"), ";\n    border-radius: ").concat(dt2("select.option.border.radius"), ";\n}\n\n.p-select-option:not(.p-select-option-selected):not(.p-disabled).p-focus {\n    background: ").concat(dt2("select.option.focus.background"), ";\n    color: ").concat(dt2("select.option.focus.color"), ";\n}\n\n.p-select-option.p-select-option-selected {\n    background: ").concat(dt2("select.option.selected.background"), ";\n    color: ").concat(dt2("select.option.selected.color"), ";\n}\n\n.p-select-option.p-select-option-selected.p-focus {\n    background: ").concat(dt2("select.option.selected.focus.background"), ";\n    color: ").concat(dt2("select.option.selected.focus.color"), ";\n}\n\n.p-select-option-check-icon {\n    position: relative;\n    margin-inline-start: ").concat(dt2("select.checkmark.gutter.start"), ";\n    margin-inline-end: ").concat(dt2("select.checkmark.gutter.end"), ";\n    color: ").concat(dt2("select.checkmark.color"), ";\n}\n\n.p-select-empty-message {\n    padding: ").concat(dt2("select.empty.message.padding"), ";\n}\n\n.p-select-fluid {\n    display: flex;\n}\n");
}, "theme");
var classes$f = {
  root: /* @__PURE__ */ __name(function root14(_ref2) {
    var instance = _ref2.instance, props = _ref2.props, state = _ref2.state;
    return ["p-select p-component p-inputwrapper", {
      "p-disabled": props.disabled,
      "p-invalid": props.invalid,
      "p-variant-filled": props.variant ? props.variant === "filled" : instance.$primevue.config.inputStyle === "filled" || instance.$primevue.config.inputVariant === "filled",
      "p-focus": state.focused,
      "p-inputwrapper-filled": instance.hasSelectedOption,
      "p-inputwrapper-focus": state.focused || state.overlayVisible,
      "p-select-open": state.overlayVisible,
      "p-select-fluid": instance.hasFluid
    }];
  }, "root"),
  label: /* @__PURE__ */ __name(function label(_ref3) {
    var instance = _ref3.instance, props = _ref3.props;
    return ["p-select-label", {
      "p-placeholder": !props.editable && instance.label === props.placeholder,
      "p-select-label-empty": !props.editable && !instance.$slots["value"] && (instance.label === "p-emptylabel" || instance.label.length === 0)
    }];
  }, "label"),
  clearIcon: "p-select-clear-icon",
  dropdown: "p-select-dropdown",
  loadingicon: "p-select-loading-icon",
  dropdownIcon: "p-select-dropdown-icon",
  overlay: "p-select-overlay p-component",
  header: "p-select-header",
  pcFilter: "p-select-filter",
  listContainer: "p-select-list-container",
  list: "p-select-list",
  optionGroup: "p-select-option-group",
  optionGroupLabel: "p-select-option-group-label",
  option: /* @__PURE__ */ __name(function option2(_ref4) {
    var instance = _ref4.instance, props = _ref4.props, state = _ref4.state, _option = _ref4.option, focusedOption = _ref4.focusedOption;
    return ["p-select-option", {
      "p-select-option-selected": instance.isSelected(_option) && props.highlightOnSelect,
      "p-focus": state.focusedOptionIndex === focusedOption,
      "p-disabled": instance.isOptionDisabled(_option)
    }];
  }, "option"),
  optionLabel: "p-select-option-label",
  optionCheckIcon: "p-select-option-check-icon",
  optionBlankIcon: "p-select-option-blank-icon",
  emptyMessage: "p-select-empty-message"
};
var SelectStyle = BaseStyle.extend({
  name: "select",
  theme: theme$f,
  classes: classes$f
});
var script$1$f = {
  name: "BaseSelect",
  "extends": script$_,
  props: {
    modelValue: null,
    options: Array,
    optionLabel: [String, Function],
    optionValue: [String, Function],
    optionDisabled: [String, Function],
    optionGroupLabel: [String, Function],
    optionGroupChildren: [String, Function],
    scrollHeight: {
      type: String,
      "default": "14rem"
    },
    filter: Boolean,
    filterPlaceholder: String,
    filterLocale: String,
    filterMatchMode: {
      type: String,
      "default": "contains"
    },
    filterFields: {
      type: Array,
      "default": null
    },
    editable: Boolean,
    placeholder: {
      type: String,
      "default": null
    },
    variant: {
      type: String,
      "default": null
    },
    invalid: {
      type: Boolean,
      "default": false
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    dataKey: null,
    showClear: {
      type: Boolean,
      "default": false
    },
    fluid: {
      type: Boolean,
      "default": null
    },
    inputId: {
      type: String,
      "default": null
    },
    inputClass: {
      type: [String, Object],
      "default": null
    },
    inputStyle: {
      type: Object,
      "default": null
    },
    labelId: {
      type: String,
      "default": null
    },
    labelClass: {
      type: [String, Object],
      "default": null
    },
    labelStyle: {
      type: Object,
      "default": null
    },
    panelClass: {
      type: [String, Object],
      "default": null
    },
    overlayStyle: {
      type: Object,
      "default": null
    },
    overlayClass: {
      type: [String, Object],
      "default": null
    },
    panelStyle: {
      type: Object,
      "default": null
    },
    appendTo: {
      type: [String, Object],
      "default": "body"
    },
    loading: {
      type: Boolean,
      "default": false
    },
    clearIcon: {
      type: String,
      "default": void 0
    },
    dropdownIcon: {
      type: String,
      "default": void 0
    },
    filterIcon: {
      type: String,
      "default": void 0
    },
    loadingIcon: {
      type: String,
      "default": void 0
    },
    resetFilterOnHide: {
      type: Boolean,
      "default": false
    },
    resetFilterOnClear: {
      type: Boolean,
      "default": false
    },
    virtualScrollerOptions: {
      type: Object,
      "default": null
    },
    autoOptionFocus: {
      type: Boolean,
      "default": false
    },
    autoFilterFocus: {
      type: Boolean,
      "default": false
    },
    selectOnFocus: {
      type: Boolean,
      "default": false
    },
    focusOnHover: {
      type: Boolean,
      "default": true
    },
    highlightOnSelect: {
      type: Boolean,
      "default": true
    },
    checkmark: {
      type: Boolean,
      "default": false
    },
    filterMessage: {
      type: String,
      "default": null
    },
    selectionMessage: {
      type: String,
      "default": null
    },
    emptySelectionMessage: {
      type: String,
      "default": null
    },
    emptyFilterMessage: {
      type: String,
      "default": null
    },
    emptyMessage: {
      type: String,
      "default": null
    },
    tabindex: {
      type: Number,
      "default": 0
    },
    ariaLabel: {
      type: String,
      "default": null
    },
    ariaLabelledby: {
      type: String,
      "default": null
    }
  },
  style: SelectStyle,
  provide: /* @__PURE__ */ __name(function provide26() {
    return {
      $pcSelect: this,
      $parentInstance: this
    };
  }, "provide")
};
function _typeof$6(o) {
  "@babel/helpers - typeof";
  return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$6(o);
}
__name(_typeof$6, "_typeof$6");
function _toConsumableArray$9(r) {
  return _arrayWithoutHoles$9(r) || _iterableToArray$9(r) || _unsupportedIterableToArray$b(r) || _nonIterableSpread$9();
}
__name(_toConsumableArray$9, "_toConsumableArray$9");
function _nonIterableSpread$9() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$9, "_nonIterableSpread$9");
function _unsupportedIterableToArray$b(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$b(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$b(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$b, "_unsupportedIterableToArray$b");
function _iterableToArray$9(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$9, "_iterableToArray$9");
function _arrayWithoutHoles$9(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$b(r);
}
__name(_arrayWithoutHoles$9, "_arrayWithoutHoles$9");
function _arrayLikeToArray$b(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$b, "_arrayLikeToArray$b");
function ownKeys$8(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$8, "ownKeys$8");
function _objectSpread$8(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$8(Object(t2), true).forEach(function(r2) {
      _defineProperty$6(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$8(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$8, "_objectSpread$8");
function _defineProperty$6(e2, r, t2) {
  return (r = _toPropertyKey$5(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$6, "_defineProperty$6");
function _toPropertyKey$5(t2) {
  var i2 = _toPrimitive$5(t2, "string");
  return "symbol" == _typeof$6(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$5, "_toPropertyKey$5");
function _toPrimitive$5(t2, r) {
  if ("object" != _typeof$6(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$6(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$5, "_toPrimitive$5");
var script$o = {
  name: "Select",
  "extends": script$1$f,
  inheritAttrs: false,
  emits: ["update:modelValue", "change", "focus", "blur", "before-show", "before-hide", "show", "hide", "filter"],
  inject: {
    $pcFluid: {
      "default": null
    }
  },
  outsideClickListener: null,
  scrollHandler: null,
  resizeListener: null,
  labelClickListener: null,
  overlay: null,
  list: null,
  virtualScroller: null,
  searchTimeout: null,
  searchValue: null,
  isModelValueChanged: false,
  data: /* @__PURE__ */ __name(function data11() {
    return {
      id: this.$attrs.id,
      clicked: false,
      focused: false,
      focusedOptionIndex: -1,
      filterValue: null,
      overlayVisible: false
    };
  }, "data"),
  watch: {
    "$attrs.id": /* @__PURE__ */ __name(function $attrsId6(newValue2) {
      this.id = newValue2 || UniqueComponentId();
    }, "$attrsId"),
    modelValue: /* @__PURE__ */ __name(function modelValue() {
      this.isModelValueChanged = true;
    }, "modelValue"),
    options: /* @__PURE__ */ __name(function options3() {
      this.autoUpdateModel();
    }, "options")
  },
  mounted: /* @__PURE__ */ __name(function mounted12() {
    this.id = this.id || UniqueComponentId();
    this.autoUpdateModel();
    this.bindLabelClickListener();
  }, "mounted"),
  updated: /* @__PURE__ */ __name(function updated8() {
    if (this.overlayVisible && this.isModelValueChanged) {
      this.scrollInView(this.findSelectedOptionIndex());
    }
    this.isModelValueChanged = false;
  }, "updated"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount4() {
    this.unbindOutsideClickListener();
    this.unbindResizeListener();
    this.unbindLabelClickListener();
    if (this.scrollHandler) {
      this.scrollHandler.destroy();
      this.scrollHandler = null;
    }
    if (this.overlay) {
      ZIndex.clear(this.overlay);
      this.overlay = null;
    }
  }, "beforeUnmount"),
  methods: {
    getOptionIndex: /* @__PURE__ */ __name(function getOptionIndex2(index2, fn) {
      return this.virtualScrollerDisabled ? index2 : fn && fn(index2)["index"];
    }, "getOptionIndex"),
    getOptionLabel: /* @__PURE__ */ __name(function getOptionLabel2(option3) {
      return this.optionLabel ? resolveFieldData(option3, this.optionLabel) : option3;
    }, "getOptionLabel"),
    getOptionValue: /* @__PURE__ */ __name(function getOptionValue2(option3) {
      return this.optionValue ? resolveFieldData(option3, this.optionValue) : option3;
    }, "getOptionValue"),
    getOptionRenderKey: /* @__PURE__ */ __name(function getOptionRenderKey2(option3, index2) {
      return (this.dataKey ? resolveFieldData(option3, this.dataKey) : this.getOptionLabel(option3)) + "_" + index2;
    }, "getOptionRenderKey"),
    getPTItemOptions: /* @__PURE__ */ __name(function getPTItemOptions(option3, itemOptions, index2, key) {
      return this.ptm(key, {
        context: {
          option: option3,
          index: index2,
          selected: this.isSelected(option3),
          focused: this.focusedOptionIndex === this.getOptionIndex(index2, itemOptions),
          disabled: this.isOptionDisabled(option3)
        }
      });
    }, "getPTItemOptions"),
    isOptionDisabled: /* @__PURE__ */ __name(function isOptionDisabled2(option3) {
      return this.optionDisabled ? resolveFieldData(option3, this.optionDisabled) : false;
    }, "isOptionDisabled"),
    isOptionGroup: /* @__PURE__ */ __name(function isOptionGroup2(option3) {
      return this.optionGroupLabel && option3.optionGroup && option3.group;
    }, "isOptionGroup"),
    getOptionGroupLabel: /* @__PURE__ */ __name(function getOptionGroupLabel2(optionGroup) {
      return resolveFieldData(optionGroup, this.optionGroupLabel);
    }, "getOptionGroupLabel"),
    getOptionGroupChildren: /* @__PURE__ */ __name(function getOptionGroupChildren2(optionGroup) {
      return resolveFieldData(optionGroup, this.optionGroupChildren);
    }, "getOptionGroupChildren"),
    getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset2(index2) {
      var _this = this;
      return (this.optionGroupLabel ? index2 - this.visibleOptions.slice(0, index2).filter(function(option3) {
        return _this.isOptionGroup(option3);
      }).length : index2) + 1;
    }, "getAriaPosInset"),
    show: /* @__PURE__ */ __name(function show2(isFocus) {
      this.$emit("before-show");
      this.overlayVisible = true;
      this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.editable ? -1 : this.findSelectedOptionIndex();
      isFocus && focus$1(this.$refs.focusInput);
    }, "show"),
    hide: /* @__PURE__ */ __name(function hide2(isFocus) {
      var _this2 = this;
      var _hide = /* @__PURE__ */ __name(function _hide2() {
        _this2.$emit("before-hide");
        _this2.overlayVisible = false;
        _this2.clicked = false;
        _this2.focusedOptionIndex = -1;
        _this2.searchValue = "";
        _this2.resetFilterOnHide && (_this2.filterValue = null);
        isFocus && focus$1(_this2.$refs.focusInput);
      }, "_hide");
      setTimeout(function() {
        _hide();
      }, 0);
    }, "hide"),
    onFocus: /* @__PURE__ */ __name(function onFocus3(event) {
      if (this.disabled) {
        return;
      }
      this.focused = true;
      if (this.overlayVisible) {
        this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.editable ? -1 : this.findSelectedOptionIndex();
        this.scrollInView(this.focusedOptionIndex);
      }
      this.$emit("focus", event);
    }, "onFocus"),
    onBlur: /* @__PURE__ */ __name(function onBlur3(event) {
      this.focused = false;
      this.focusedOptionIndex = -1;
      this.searchValue = "";
      this.$emit("blur", event);
    }, "onBlur"),
    onKeyDown: /* @__PURE__ */ __name(function onKeyDown4(event) {
      if (this.disabled || isAndroid$2()) {
        event.preventDefault();
        return;
      }
      var metaKey = event.metaKey || event.ctrlKey;
      switch (event.code) {
        case "ArrowDown":
          this.onArrowDownKey(event);
          break;
        case "ArrowUp":
          this.onArrowUpKey(event, this.editable);
          break;
        case "ArrowLeft":
        case "ArrowRight":
          this.onArrowLeftKey(event, this.editable);
          break;
        case "Home":
          this.onHomeKey(event, this.editable);
          break;
        case "End":
          this.onEndKey(event, this.editable);
          break;
        case "PageDown":
          this.onPageDownKey(event);
          break;
        case "PageUp":
          this.onPageUpKey(event);
          break;
        case "Space":
          this.onSpaceKey(event, this.editable);
          break;
        case "Enter":
        case "NumpadEnter":
          this.onEnterKey(event);
          break;
        case "Escape":
          this.onEscapeKey(event);
          break;
        case "Tab":
          this.onTabKey(event);
          break;
        case "Backspace":
          this.onBackspaceKey(event, this.editable);
          break;
        case "ShiftLeft":
        case "ShiftRight":
          break;
        default:
          if (!metaKey && isPrintableCharacter(event.key)) {
            !this.overlayVisible && this.show();
            !this.editable && this.searchOptions(event, event.key);
          }
          break;
      }
      this.clicked = false;
    }, "onKeyDown"),
    onEditableInput: /* @__PURE__ */ __name(function onEditableInput(event) {
      var value4 = event.target.value;
      this.searchValue = "";
      var matched = this.searchOptions(event, value4);
      !matched && (this.focusedOptionIndex = -1);
      this.updateModel(event, value4);
      !this.overlayVisible && isNotEmpty(value4) && this.show();
    }, "onEditableInput"),
    onContainerClick: /* @__PURE__ */ __name(function onContainerClick(event) {
      if (this.disabled || this.loading) {
        return;
      }
      if (event.target.tagName === "INPUT" || event.target.getAttribute("data-pc-section") === "clearicon" || event.target.closest('[data-pc-section="clearicon"]')) {
        return;
      } else if (!this.overlay || !this.overlay.contains(event.target)) {
        this.overlayVisible ? this.hide(true) : this.show(true);
      }
      this.clicked = true;
    }, "onContainerClick"),
    onClearClick: /* @__PURE__ */ __name(function onClearClick(event) {
      this.updateModel(event, null);
      this.resetFilterOnClear && (this.filterValue = null);
    }, "onClearClick"),
    onFirstHiddenFocus: /* @__PURE__ */ __name(function onFirstHiddenFocus2(event) {
      var focusableEl = event.relatedTarget === this.$refs.focusInput ? getFirstFocusableElement(this.overlay, ':not([data-p-hidden-focusable="true"])') : this.$refs.focusInput;
      focus$1(focusableEl);
    }, "onFirstHiddenFocus"),
    onLastHiddenFocus: /* @__PURE__ */ __name(function onLastHiddenFocus2(event) {
      var focusableEl = event.relatedTarget === this.$refs.focusInput ? getLastFocusableElement(this.overlay, ':not([data-p-hidden-focusable="true"])') : this.$refs.focusInput;
      focus$1(focusableEl);
    }, "onLastHiddenFocus"),
    onOptionSelect: /* @__PURE__ */ __name(function onOptionSelect2(event, option3) {
      var isHide = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
      var value4 = this.getOptionValue(option3);
      this.updateModel(event, value4);
      isHide && this.hide(true);
    }, "onOptionSelect"),
    onOptionMouseMove: /* @__PURE__ */ __name(function onOptionMouseMove2(event, index2) {
      if (this.focusOnHover) {
        this.changeFocusedOptionIndex(event, index2);
      }
    }, "onOptionMouseMove"),
    onFilterChange: /* @__PURE__ */ __name(function onFilterChange2(event) {
      var value4 = event.target.value;
      this.filterValue = value4;
      this.focusedOptionIndex = -1;
      this.$emit("filter", {
        originalEvent: event,
        value: value4
      });
      !this.virtualScrollerDisabled && this.virtualScroller.scrollToIndex(0);
    }, "onFilterChange"),
    onFilterKeyDown: /* @__PURE__ */ __name(function onFilterKeyDown2(event) {
      switch (event.code) {
        case "ArrowDown":
          this.onArrowDownKey(event);
          break;
        case "ArrowUp":
          this.onArrowUpKey(event, true);
          break;
        case "ArrowLeft":
        case "ArrowRight":
          this.onArrowLeftKey(event, true);
          break;
        case "Home":
          this.onHomeKey(event, true);
          break;
        case "End":
          this.onEndKey(event, true);
          break;
        case "Enter":
        case "NumpadEnter":
          this.onEnterKey(event);
          break;
        case "Escape":
          this.onEscapeKey(event);
          break;
        case "Tab":
          this.onTabKey(event, true);
          break;
      }
    }, "onFilterKeyDown"),
    onFilterBlur: /* @__PURE__ */ __name(function onFilterBlur2() {
      this.focusedOptionIndex = -1;
    }, "onFilterBlur"),
    onFilterUpdated: /* @__PURE__ */ __name(function onFilterUpdated() {
      if (this.overlayVisible) {
        this.alignOverlay();
      }
    }, "onFilterUpdated"),
    onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick(event) {
      OverlayEventBus.emit("overlay-click", {
        originalEvent: event,
        target: this.$el
      });
    }, "onOverlayClick"),
    onOverlayKeyDown: /* @__PURE__ */ __name(function onOverlayKeyDown(event) {
      switch (event.code) {
        case "Escape":
          this.onEscapeKey(event);
          break;
      }
    }, "onOverlayKeyDown"),
    onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey2(event) {
      if (!this.overlayVisible) {
        this.show();
        this.editable && this.changeFocusedOptionIndex(event, this.findSelectedOptionIndex());
      } else {
        var optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.clicked ? this.findFirstOptionIndex() : this.findFirstFocusedOptionIndex();
        this.changeFocusedOptionIndex(event, optionIndex);
      }
      event.preventDefault();
    }, "onArrowDownKey"),
    onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey2(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (event.altKey && !pressedInInputText) {
        if (this.focusedOptionIndex !== -1) {
          this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
        }
        this.overlayVisible && this.hide();
        event.preventDefault();
      } else {
        var optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.clicked ? this.findLastOptionIndex() : this.findLastFocusedOptionIndex();
        this.changeFocusedOptionIndex(event, optionIndex);
        !this.overlayVisible && this.show();
        event.preventDefault();
      }
    }, "onArrowUpKey"),
    onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey2(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      pressedInInputText && (this.focusedOptionIndex = -1);
    }, "onArrowLeftKey"),
    onHomeKey: /* @__PURE__ */ __name(function onHomeKey2(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (pressedInInputText) {
        var target = event.currentTarget;
        if (event.shiftKey) {
          target.setSelectionRange(0, event.target.selectionStart);
        } else {
          target.setSelectionRange(0, 0);
          this.focusedOptionIndex = -1;
        }
      } else {
        this.changeFocusedOptionIndex(event, this.findFirstOptionIndex());
        !this.overlayVisible && this.show();
      }
      event.preventDefault();
    }, "onHomeKey"),
    onEndKey: /* @__PURE__ */ __name(function onEndKey2(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (pressedInInputText) {
        var target = event.currentTarget;
        if (event.shiftKey) {
          target.setSelectionRange(event.target.selectionStart, target.value.length);
        } else {
          var len = target.value.length;
          target.setSelectionRange(len, len);
          this.focusedOptionIndex = -1;
        }
      } else {
        this.changeFocusedOptionIndex(event, this.findLastOptionIndex());
        !this.overlayVisible && this.show();
      }
      event.preventDefault();
    }, "onEndKey"),
    onPageUpKey: /* @__PURE__ */ __name(function onPageUpKey3(event) {
      this.scrollInView(0);
      event.preventDefault();
    }, "onPageUpKey"),
    onPageDownKey: /* @__PURE__ */ __name(function onPageDownKey3(event) {
      this.scrollInView(this.visibleOptions.length - 1);
      event.preventDefault();
    }, "onPageDownKey"),
    onEnterKey: /* @__PURE__ */ __name(function onEnterKey2(event) {
      if (!this.overlayVisible) {
        this.focusedOptionIndex = -1;
        this.onArrowDownKey(event);
      } else {
        if (this.focusedOptionIndex !== -1) {
          this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
        }
        this.hide();
      }
      event.preventDefault();
    }, "onEnterKey"),
    onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey2(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      !pressedInInputText && this.onEnterKey(event);
    }, "onSpaceKey"),
    onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey(event) {
      this.overlayVisible && this.hide(true);
      event.preventDefault();
      event.stopPropagation();
    }, "onEscapeKey"),
    onTabKey: /* @__PURE__ */ __name(function onTabKey(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (!pressedInInputText) {
        if (this.overlayVisible && this.hasFocusableElements()) {
          focus$1(this.$refs.firstHiddenFocusableElementOnOverlay);
          event.preventDefault();
        } else {
          if (this.focusedOptionIndex !== -1) {
            this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
          }
          this.overlayVisible && this.hide(this.filter);
        }
      }
    }, "onTabKey"),
    onBackspaceKey: /* @__PURE__ */ __name(function onBackspaceKey(event) {
      var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (pressedInInputText) {
        !this.overlayVisible && this.show();
      }
    }, "onBackspaceKey"),
    onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter(el) {
      ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay);
      addStyle(el, {
        position: "absolute",
        top: "0",
        left: "0"
      });
      this.alignOverlay();
      this.scrollInView();
      this.autoFilterFocus && focus$1(this.$refs.filterInput.$el);
    }, "onOverlayEnter"),
    onOverlayAfterEnter: /* @__PURE__ */ __name(function onOverlayAfterEnter() {
      this.bindOutsideClickListener();
      this.bindScrollListener();
      this.bindResizeListener();
      this.$emit("show");
    }, "onOverlayAfterEnter"),
    onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave() {
      this.unbindOutsideClickListener();
      this.unbindScrollListener();
      this.unbindResizeListener();
      this.autoFilterFocus && focus$1(this.$refs.focusInput);
      this.$emit("hide");
      this.overlay = null;
    }, "onOverlayLeave"),
    onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave(el) {
      ZIndex.clear(el);
    }, "onOverlayAfterLeave"),
    alignOverlay: /* @__PURE__ */ __name(function alignOverlay2() {
      if (this.appendTo === "self") {
        relativePosition(this.overlay, this.$el);
      } else {
        this.overlay.style.minWidth = getOuterWidth(this.$el) + "px";
        absolutePosition(this.overlay, this.$el);
      }
    }, "alignOverlay"),
    bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener() {
      var _this3 = this;
      if (!this.outsideClickListener) {
        this.outsideClickListener = function(event) {
          if (_this3.overlayVisible && _this3.overlay && !_this3.$el.contains(event.target) && !_this3.overlay.contains(event.target)) {
            _this3.hide();
          }
        };
        document.addEventListener("click", this.outsideClickListener);
      }
    }, "bindOutsideClickListener"),
    unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener() {
      if (this.outsideClickListener) {
        document.removeEventListener("click", this.outsideClickListener);
        this.outsideClickListener = null;
      }
    }, "unbindOutsideClickListener"),
    bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener2() {
      var _this4 = this;
      if (!this.scrollHandler) {
        this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function() {
          if (_this4.overlayVisible) {
            _this4.hide();
          }
        });
      }
      this.scrollHandler.bindScrollListener();
    }, "bindScrollListener"),
    unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener2() {
      if (this.scrollHandler) {
        this.scrollHandler.unbindScrollListener();
      }
    }, "unbindScrollListener"),
    bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener2() {
      var _this5 = this;
      if (!this.resizeListener) {
        this.resizeListener = function() {
          if (_this5.overlayVisible && !isTouchDevice()) {
            _this5.hide();
          }
        };
        window.addEventListener("resize", this.resizeListener);
      }
    }, "bindResizeListener"),
    unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener2() {
      if (this.resizeListener) {
        window.removeEventListener("resize", this.resizeListener);
        this.resizeListener = null;
      }
    }, "unbindResizeListener"),
    bindLabelClickListener: /* @__PURE__ */ __name(function bindLabelClickListener() {
      var _this6 = this;
      if (!this.editable && !this.labelClickListener) {
        var label5 = document.querySelector('label[for="'.concat(this.inputId, '"]'));
        if (label5 && isVisible(label5)) {
          this.labelClickListener = function() {
            focus$1(_this6.$refs.focusInput);
          };
          label5.addEventListener("click", this.labelClickListener);
        }
      }
    }, "bindLabelClickListener"),
    unbindLabelClickListener: /* @__PURE__ */ __name(function unbindLabelClickListener() {
      if (this.labelClickListener) {
        var label5 = document.querySelector('label[for="'.concat(this.inputId, '"]'));
        if (label5 && isVisible(label5)) {
          label5.removeEventListener("click", this.labelClickListener);
        }
      }
    }, "unbindLabelClickListener"),
    hasFocusableElements: /* @__PURE__ */ __name(function hasFocusableElements() {
      return getFocusableElements(this.overlay, ':not([data-p-hidden-focusable="true"])').length > 0;
    }, "hasFocusableElements"),
    isOptionMatched: /* @__PURE__ */ __name(function isOptionMatched2(option3) {
      var _this$getOptionLabel;
      return this.isValidOption(option3) && typeof this.getOptionLabel(option3) === "string" && ((_this$getOptionLabel = this.getOptionLabel(option3)) === null || _this$getOptionLabel === void 0 ? void 0 : _this$getOptionLabel.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)));
    }, "isOptionMatched"),
    isValidOption: /* @__PURE__ */ __name(function isValidOption2(option3) {
      return isNotEmpty(option3) && !(this.isOptionDisabled(option3) || this.isOptionGroup(option3));
    }, "isValidOption"),
    isValidSelectedOption: /* @__PURE__ */ __name(function isValidSelectedOption2(option3) {
      return this.isValidOption(option3) && this.isSelected(option3);
    }, "isValidSelectedOption"),
    isSelected: /* @__PURE__ */ __name(function isSelected2(option3) {
      return this.isValidOption(option3) && equals(this.modelValue, this.getOptionValue(option3), this.equalityKey);
    }, "isSelected"),
    findFirstOptionIndex: /* @__PURE__ */ __name(function findFirstOptionIndex2() {
      var _this7 = this;
      return this.visibleOptions.findIndex(function(option3) {
        return _this7.isValidOption(option3);
      });
    }, "findFirstOptionIndex"),
    findLastOptionIndex: /* @__PURE__ */ __name(function findLastOptionIndex2() {
      var _this8 = this;
      return findLastIndex(this.visibleOptions, function(option3) {
        return _this8.isValidOption(option3);
      });
    }, "findLastOptionIndex"),
    findNextOptionIndex: /* @__PURE__ */ __name(function findNextOptionIndex2(index2) {
      var _this9 = this;
      var matchedOptionIndex = index2 < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index2 + 1).findIndex(function(option3) {
        return _this9.isValidOption(option3);
      }) : -1;
      return matchedOptionIndex > -1 ? matchedOptionIndex + index2 + 1 : index2;
    }, "findNextOptionIndex"),
    findPrevOptionIndex: /* @__PURE__ */ __name(function findPrevOptionIndex2(index2) {
      var _this10 = this;
      var matchedOptionIndex = index2 > 0 ? findLastIndex(this.visibleOptions.slice(0, index2), function(option3) {
        return _this10.isValidOption(option3);
      }) : -1;
      return matchedOptionIndex > -1 ? matchedOptionIndex : index2;
    }, "findPrevOptionIndex"),
    findSelectedOptionIndex: /* @__PURE__ */ __name(function findSelectedOptionIndex2() {
      var _this11 = this;
      return this.hasSelectedOption ? this.visibleOptions.findIndex(function(option3) {
        return _this11.isValidSelectedOption(option3);
      }) : -1;
    }, "findSelectedOptionIndex"),
    findFirstFocusedOptionIndex: /* @__PURE__ */ __name(function findFirstFocusedOptionIndex2() {
      var selectedIndex = this.findSelectedOptionIndex();
      return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;
    }, "findFirstFocusedOptionIndex"),
    findLastFocusedOptionIndex: /* @__PURE__ */ __name(function findLastFocusedOptionIndex2() {
      var selectedIndex = this.findSelectedOptionIndex();
      return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
    }, "findLastFocusedOptionIndex"),
    searchOptions: /* @__PURE__ */ __name(function searchOptions2(event, _char) {
      var _this12 = this;
      this.searchValue = (this.searchValue || "") + _char;
      var optionIndex = -1;
      var matched = false;
      if (isNotEmpty(this.searchValue)) {
        if (this.focusedOptionIndex !== -1) {
          optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function(option3) {
            return _this12.isOptionMatched(option3);
          });
          optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(function(option3) {
            return _this12.isOptionMatched(option3);
          }) : optionIndex + this.focusedOptionIndex;
        } else {
          optionIndex = this.visibleOptions.findIndex(function(option3) {
            return _this12.isOptionMatched(option3);
          });
        }
        if (optionIndex !== -1) {
          matched = true;
        }
        if (optionIndex === -1 && this.focusedOptionIndex === -1) {
          optionIndex = this.findFirstFocusedOptionIndex();
        }
        if (optionIndex !== -1) {
          this.changeFocusedOptionIndex(event, optionIndex);
        }
      }
      if (this.searchTimeout) {
        clearTimeout(this.searchTimeout);
      }
      this.searchTimeout = setTimeout(function() {
        _this12.searchValue = "";
        _this12.searchTimeout = null;
      }, 500);
      return matched;
    }, "searchOptions"),
    changeFocusedOptionIndex: /* @__PURE__ */ __name(function changeFocusedOptionIndex2(event, index2) {
      if (this.focusedOptionIndex !== index2) {
        this.focusedOptionIndex = index2;
        this.scrollInView();
        if (this.selectOnFocus) {
          this.onOptionSelect(event, this.visibleOptions[index2], false);
        }
      }
    }, "changeFocusedOptionIndex"),
    scrollInView: /* @__PURE__ */ __name(function scrollInView5() {
      var _this13 = this;
      var index2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
      this.$nextTick(function() {
        var id3 = index2 !== -1 ? "".concat(_this13.id, "_").concat(index2) : _this13.focusedOptionId;
        var element = findSingle(_this13.list, 'li[id="'.concat(id3, '"]'));
        if (element) {
          element.scrollIntoView && element.scrollIntoView({
            block: "nearest",
            inline: "start"
          });
        } else if (!_this13.virtualScrollerDisabled) {
          _this13.virtualScroller && _this13.virtualScroller.scrollToIndex(index2 !== -1 ? index2 : _this13.focusedOptionIndex);
        }
      });
    }, "scrollInView"),
    autoUpdateModel: /* @__PURE__ */ __name(function autoUpdateModel2() {
      if (this.selectOnFocus && this.autoOptionFocus && !this.hasSelectedOption) {
        this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
        this.onOptionSelect(null, this.visibleOptions[this.focusedOptionIndex], false);
      }
    }, "autoUpdateModel"),
    updateModel: /* @__PURE__ */ __name(function updateModel2(event, value4) {
      this.$emit("update:modelValue", value4);
      this.$emit("change", {
        originalEvent: event,
        value: value4
      });
    }, "updateModel"),
    flatOptions: /* @__PURE__ */ __name(function flatOptions2(options4) {
      var _this14 = this;
      return (options4 || []).reduce(function(result, option3, index2) {
        result.push({
          optionGroup: option3,
          group: true,
          index: index2
        });
        var optionGroupChildren = _this14.getOptionGroupChildren(option3);
        optionGroupChildren && optionGroupChildren.forEach(function(o) {
          return result.push(o);
        });
        return result;
      }, []);
    }, "flatOptions"),
    overlayRef: /* @__PURE__ */ __name(function overlayRef(el) {
      this.overlay = el;
    }, "overlayRef"),
    listRef: /* @__PURE__ */ __name(function listRef2(el, contentRef3) {
      this.list = el;
      contentRef3 && contentRef3(el);
    }, "listRef"),
    virtualScrollerRef: /* @__PURE__ */ __name(function virtualScrollerRef2(el) {
      this.virtualScroller = el;
    }, "virtualScrollerRef")
  },
  computed: {
    visibleOptions: /* @__PURE__ */ __name(function visibleOptions2() {
      var _this15 = this;
      var options4 = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
      if (this.filterValue) {
        var filteredOptions = FilterService.filter(options4, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
        if (this.optionGroupLabel) {
          var optionGroups = this.options || [];
          var filtered = [];
          optionGroups.forEach(function(group) {
            var groupChildren = _this15.getOptionGroupChildren(group);
            var filteredItems = groupChildren.filter(function(item3) {
              return filteredOptions.includes(item3);
            });
            if (filteredItems.length > 0) filtered.push(_objectSpread$8(_objectSpread$8({}, group), {}, _defineProperty$6({}, typeof _this15.optionGroupChildren === "string" ? _this15.optionGroupChildren : "items", _toConsumableArray$9(filteredItems))));
          });
          return this.flatOptions(filtered);
        }
        return filteredOptions;
      }
      return options4;
    }, "visibleOptions"),
    hasSelectedOption: /* @__PURE__ */ __name(function hasSelectedOption2() {
      return isNotEmpty(this.modelValue);
    }, "hasSelectedOption"),
    label: /* @__PURE__ */ __name(function label2() {
      var selectedOptionIndex = this.findSelectedOptionIndex();
      return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions[selectedOptionIndex]) : this.placeholder || "p-emptylabel";
    }, "label"),
    editableInputValue: /* @__PURE__ */ __name(function editableInputValue() {
      var selectedOptionIndex = this.findSelectedOptionIndex();
      return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions[selectedOptionIndex]) : this.modelValue || "";
    }, "editableInputValue"),
    equalityKey: /* @__PURE__ */ __name(function equalityKey2() {
      return this.optionValue ? null : this.dataKey;
    }, "equalityKey"),
    searchFields: /* @__PURE__ */ __name(function searchFields2() {
      return this.filterFields || [this.optionLabel];
    }, "searchFields"),
    filterResultMessageText: /* @__PURE__ */ __name(function filterResultMessageText2() {
      return isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll("{0}", this.visibleOptions.length) : this.emptyFilterMessageText;
    }, "filterResultMessageText"),
    filterMessageText: /* @__PURE__ */ __name(function filterMessageText2() {
      return this.filterMessage || this.$primevue.config.locale.searchMessage || "";
    }, "filterMessageText"),
    emptyFilterMessageText: /* @__PURE__ */ __name(function emptyFilterMessageText2() {
      return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || "";
    }, "emptyFilterMessageText"),
    emptyMessageText: /* @__PURE__ */ __name(function emptyMessageText2() {
      return this.emptyMessage || this.$primevue.config.locale.emptyMessage || "";
    }, "emptyMessageText"),
    selectionMessageText: /* @__PURE__ */ __name(function selectionMessageText2() {
      return this.selectionMessage || this.$primevue.config.locale.selectionMessage || "";
    }, "selectionMessageText"),
    emptySelectionMessageText: /* @__PURE__ */ __name(function emptySelectionMessageText2() {
      return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || "";
    }, "emptySelectionMessageText"),
    selectedMessageText: /* @__PURE__ */ __name(function selectedMessageText2() {
      return this.hasSelectedOption ? this.selectionMessageText.replaceAll("{0}", "1") : this.emptySelectionMessageText;
    }, "selectedMessageText"),
    focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId2() {
      return this.focusedOptionIndex !== -1 ? "".concat(this.id, "_").concat(this.focusedOptionIndex) : null;
    }, "focusedOptionId"),
    ariaSetSize: /* @__PURE__ */ __name(function ariaSetSize2() {
      var _this16 = this;
      return this.visibleOptions.filter(function(option3) {
        return !_this16.isOptionGroup(option3);
      }).length;
    }, "ariaSetSize"),
    isClearIconVisible: /* @__PURE__ */ __name(function isClearIconVisible() {
      return this.showClear && this.modelValue != null && isNotEmpty(this.options);
    }, "isClearIconVisible"),
    virtualScrollerDisabled: /* @__PURE__ */ __name(function virtualScrollerDisabled2() {
      return !this.virtualScrollerOptions;
    }, "virtualScrollerDisabled"),
    hasFluid: /* @__PURE__ */ __name(function hasFluid3() {
      return isEmpty$1(this.fluid) ? !!this.$pcFluid : this.fluid;
    }, "hasFluid")
  },
  directives: {
    ripple: Ripple
  },
  components: {
    InputText: script$G,
    VirtualScroller: script$F,
    Portal: script$Q,
    InputIcon: script$H,
    IconField: script$I,
    TimesIcon: script$W,
    ChevronDownIcon: script$p,
    SpinnerIcon: script$T,
    SearchIcon: script$J,
    CheckIcon: script$K,
    BlankIcon: script$L
  }
};
var _hoisted_1$Q = ["id"];
var _hoisted_2$C = ["id", "value", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"];
var _hoisted_3$j = ["id", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-disabled"];
var _hoisted_4$e = ["id"];
var _hoisted_5$a = ["id"];
var _hoisted_6$7 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove", "data-p-selected", "data-p-focused", "data-p-disabled"];
function render$n(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
  var _component_InputText = resolveComponent("InputText");
  var _component_SearchIcon = resolveComponent("SearchIcon");
  var _component_InputIcon = resolveComponent("InputIcon");
  var _component_IconField = resolveComponent("IconField");
  var _component_CheckIcon = resolveComponent("CheckIcon");
  var _component_BlankIcon = resolveComponent("BlankIcon");
  var _component_VirtualScroller = resolveComponent("VirtualScroller");
  var _component_Portal = resolveComponent("Portal");
  var _directive_ripple = resolveDirective("ripple");
  return openBlock(), createElementBlock("div", mergeProps({
    ref: "container",
    id: $data.id,
    "class": _ctx.cx("root"),
    onClick: _cache[11] || (_cache[11] = function() {
      return $options.onContainerClick && $options.onContainerClick.apply($options, arguments);
    })
  }, _ctx.ptmi("root")), [_ctx.editable ? (openBlock(), createElementBlock("input", mergeProps({
    key: 0,
    ref: "focusInput",
    id: _ctx.labelId || _ctx.inputId,
    type: "text",
    "class": [_ctx.cx("label"), _ctx.inputClass, _ctx.labelClass],
    style: [_ctx.inputStyle, _ctx.labelStyle],
    value: $options.editableInputValue,
    placeholder: _ctx.placeholder,
    tabindex: !_ctx.disabled ? _ctx.tabindex : -1,
    disabled: _ctx.disabled,
    autocomplete: "off",
    role: "combobox",
    "aria-label": _ctx.ariaLabel,
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-haspopup": "listbox",
    "aria-expanded": $data.overlayVisible,
    "aria-controls": $data.id + "_list",
    "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0,
    "aria-invalid": _ctx.invalid || void 0,
    onFocus: _cache[0] || (_cache[0] = function() {
      return $options.onFocus && $options.onFocus.apply($options, arguments);
    }),
    onBlur: _cache[1] || (_cache[1] = function() {
      return $options.onBlur && $options.onBlur.apply($options, arguments);
    }),
    onKeydown: _cache[2] || (_cache[2] = function() {
      return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
    }),
    onInput: _cache[3] || (_cache[3] = function() {
      return $options.onEditableInput && $options.onEditableInput.apply($options, arguments);
    })
  }, _ctx.ptm("label")), null, 16, _hoisted_2$C)) : (openBlock(), createElementBlock("span", mergeProps({
    key: 1,
    ref: "focusInput",
    id: _ctx.labelId || _ctx.inputId,
    "class": [_ctx.cx("label"), _ctx.inputClass, _ctx.labelClass],
    style: [_ctx.inputStyle, _ctx.labelStyle],
    tabindex: !_ctx.disabled ? _ctx.tabindex : -1,
    role: "combobox",
    "aria-label": _ctx.ariaLabel || ($options.label === "p-emptylabel" ? void 0 : $options.label),
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-haspopup": "listbox",
    "aria-expanded": $data.overlayVisible,
    "aria-controls": $data.id + "_list",
    "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0,
    "aria-disabled": _ctx.disabled,
    onFocus: _cache[4] || (_cache[4] = function() {
      return $options.onFocus && $options.onFocus.apply($options, arguments);
    }),
    onBlur: _cache[5] || (_cache[5] = function() {
      return $options.onBlur && $options.onBlur.apply($options, arguments);
    }),
    onKeydown: _cache[6] || (_cache[6] = function() {
      return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
    })
  }, _ctx.ptm("label")), [renderSlot(_ctx.$slots, "value", {
    value: _ctx.modelValue,
    placeholder: _ctx.placeholder
  }, function() {
    return [createTextVNode(toDisplayString$1($options.label === "p-emptylabel" ? " " : $options.label || "empty"), 1)];
  })], 16, _hoisted_3$j)), $options.isClearIconVisible ? renderSlot(_ctx.$slots, "clearicon", {
    key: 2,
    "class": normalizeClass(_ctx.cx("clearIcon")),
    clearCallback: $options.onClearClick
  }, function() {
    return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon ? "i" : "TimesIcon"), mergeProps({
      ref: "clearIcon",
      "class": [_ctx.cx("clearIcon"), _ctx.clearIcon],
      onClick: $options.onClearClick
    }, _ctx.ptm("clearIcon"), {
      "data-pc-section": "clearicon"
    }), null, 16, ["class", "onClick"]))];
  }) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("dropdown")
  }, _ctx.ptm("dropdown")), [_ctx.loading ? renderSlot(_ctx.$slots, "loadingicon", {
    key: 0,
    "class": normalizeClass(_ctx.cx("loadingIcon"))
  }, function() {
    return [_ctx.loadingIcon ? (openBlock(), createElementBlock("span", mergeProps({
      key: 0,
      "class": [_ctx.cx("loadingIcon"), "pi-spin", _ctx.loadingIcon],
      "aria-hidden": "true"
    }, _ctx.ptm("loadingIcon")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
      key: 1,
      "class": _ctx.cx("loadingIcon"),
      spin: "",
      "aria-hidden": "true"
    }, _ctx.ptm("loadingIcon")), null, 16, ["class"]))];
  }) : renderSlot(_ctx.$slots, "dropdownicon", {
    key: 1,
    "class": normalizeClass(_ctx.cx("dropdownIcon"))
  }, function() {
    return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.dropdownIcon ? "span" : "ChevronDownIcon"), mergeProps({
      "class": [_ctx.cx("dropdownIcon"), _ctx.dropdownIcon],
      "aria-hidden": "true"
    }, _ctx.ptm("dropdownIcon")), null, 16, ["class"]))];
  })], 16), createVNode(_component_Portal, {
    appendTo: _ctx.appendTo
  }, {
    "default": withCtx(function() {
      return [createVNode(Transition, mergeProps({
        name: "p-connected-overlay",
        onEnter: $options.onOverlayEnter,
        onAfterEnter: $options.onOverlayAfterEnter,
        onLeave: $options.onOverlayLeave,
        onAfterLeave: $options.onOverlayAfterLeave
      }, _ctx.ptm("transition")), {
        "default": withCtx(function() {
          return [$data.overlayVisible ? (openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            ref: $options.overlayRef,
            "class": [_ctx.cx("overlay"), _ctx.panelClass, _ctx.overlayClass],
            style: [_ctx.panelStyle, _ctx.overlayStyle],
            onClick: _cache[9] || (_cache[9] = function() {
              return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
            }),
            onKeydown: _cache[10] || (_cache[10] = function() {
              return $options.onOverlayKeyDown && $options.onOverlayKeyDown.apply($options, arguments);
            })
          }, _ctx.ptm("overlay")), [createBaseVNode("span", mergeProps({
            ref: "firstHiddenFocusableElementOnOverlay",
            role: "presentation",
            "aria-hidden": "true",
            "class": "p-hidden-accessible p-hidden-focusable",
            tabindex: 0,
            onFocus: _cache[7] || (_cache[7] = function() {
              return $options.onFirstHiddenFocus && $options.onFirstHiddenFocus.apply($options, arguments);
            })
          }, _ctx.ptm("hiddenFirstFocusableEl"), {
            "data-p-hidden-accessible": true,
            "data-p-hidden-focusable": true
          }), null, 16), renderSlot(_ctx.$slots, "header", {
            value: _ctx.modelValue,
            options: $options.visibleOptions
          }), _ctx.filter ? (openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            "class": _ctx.cx("header")
          }, _ctx.ptm("header")), [createVNode(_component_IconField, {
            unstyled: _ctx.unstyled,
            pt: _ctx.ptm("pcFilterContainer")
          }, {
            "default": withCtx(function() {
              return [createVNode(_component_InputText, {
                ref: "filterInput",
                type: "text",
                value: $data.filterValue,
                onVnodeMounted: $options.onFilterUpdated,
                onVnodeUpdated: $options.onFilterUpdated,
                "class": normalizeClass(_ctx.cx("pcFilter")),
                placeholder: _ctx.filterPlaceholder,
                variant: _ctx.variant,
                unstyled: _ctx.unstyled,
                role: "searchbox",
                autocomplete: "off",
                "aria-owns": $data.id + "_list",
                "aria-activedescendant": $options.focusedOptionId,
                onKeydown: $options.onFilterKeyDown,
                onBlur: $options.onFilterBlur,
                onInput: $options.onFilterChange,
                pt: _ctx.ptm("pcFilter")
              }, null, 8, ["value", "onVnodeMounted", "onVnodeUpdated", "class", "placeholder", "variant", "unstyled", "aria-owns", "aria-activedescendant", "onKeydown", "onBlur", "onInput", "pt"]), createVNode(_component_InputIcon, mergeProps({
                unstyled: _ctx.unstyled
              }, _ctx.ptm("pcFilterIconContainer")), {
                "default": withCtx(function() {
                  return [renderSlot(_ctx.$slots, "filtericon", {}, function() {
                    return [_ctx.filterIcon ? (openBlock(), createElementBlock("span", mergeProps({
                      key: 0,
                      "class": _ctx.filterIcon
                    }, _ctx.ptm("filterIcon")), null, 16)) : (openBlock(), createBlock(_component_SearchIcon, normalizeProps(mergeProps({
                      key: 1
                    }, _ctx.ptm("filterIcon"))), null, 16))];
                  })];
                }),
                _: 3
              }, 16, ["unstyled"])];
            }),
            _: 3
          }, 8, ["unstyled", "pt"]), createBaseVNode("span", mergeProps({
            role: "status",
            "aria-live": "polite",
            "class": "p-hidden-accessible"
          }, _ctx.ptm("hiddenFilterResult"), {
            "data-p-hidden-accessible": true
          }), toDisplayString$1($options.filterResultMessageText), 17)], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
            "class": _ctx.cx("listContainer"),
            style: {
              "max-height": $options.virtualScrollerDisabled ? _ctx.scrollHeight : ""
            }
          }, _ctx.ptm("listContainer")), [createVNode(_component_VirtualScroller, mergeProps({
            ref: $options.virtualScrollerRef
          }, _ctx.virtualScrollerOptions, {
            items: $options.visibleOptions,
            style: {
              height: _ctx.scrollHeight
            },
            tabindex: -1,
            disabled: $options.virtualScrollerDisabled,
            pt: _ctx.ptm("virtualScroller")
          }), createSlots({
            content: withCtx(function(_ref) {
              var styleClass = _ref.styleClass, contentRef3 = _ref.contentRef, items2 = _ref.items, getItemOptions = _ref.getItemOptions, contentStyle = _ref.contentStyle, itemSize2 = _ref.itemSize;
              return [createBaseVNode("ul", mergeProps({
                ref: /* @__PURE__ */ __name(function ref2(el) {
                  return $options.listRef(el, contentRef3);
                }, "ref"),
                id: $data.id + "_list",
                "class": [_ctx.cx("list"), styleClass],
                style: contentStyle,
                role: "listbox"
              }, _ctx.ptm("list")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList(items2, function(option3, i2) {
                return openBlock(), createElementBlock(Fragment$1, {
                  key: $options.getOptionRenderKey(option3, $options.getOptionIndex(i2, getItemOptions))
                }, [$options.isOptionGroup(option3) ? (openBlock(), createElementBlock("li", mergeProps({
                  key: 0,
                  id: $data.id + "_" + $options.getOptionIndex(i2, getItemOptions),
                  style: {
                    height: itemSize2 ? itemSize2 + "px" : void 0
                  },
                  "class": _ctx.cx("optionGroup"),
                  role: "option",
                  ref_for: true
                }, _ctx.ptm("optionGroup")), [renderSlot(_ctx.$slots, "optiongroup", {
                  option: option3.optionGroup,
                  index: $options.getOptionIndex(i2, getItemOptions)
                }, function() {
                  return [createBaseVNode("span", mergeProps({
                    "class": _ctx.cx("optionGroupLabel"),
                    ref_for: true
                  }, _ctx.ptm("optionGroupLabel")), toDisplayString$1($options.getOptionGroupLabel(option3.optionGroup)), 17)];
                })], 16, _hoisted_5$a)) : withDirectives((openBlock(), createElementBlock("li", mergeProps({
                  key: 1,
                  id: $data.id + "_" + $options.getOptionIndex(i2, getItemOptions),
                  "class": _ctx.cx("option", {
                    option: option3,
                    focusedOption: $options.getOptionIndex(i2, getItemOptions)
                  }),
                  style: {
                    height: itemSize2 ? itemSize2 + "px" : void 0
                  },
                  role: "option",
                  "aria-label": $options.getOptionLabel(option3),
                  "aria-selected": $options.isSelected(option3),
                  "aria-disabled": $options.isOptionDisabled(option3),
                  "aria-setsize": $options.ariaSetSize,
                  "aria-posinset": $options.getAriaPosInset($options.getOptionIndex(i2, getItemOptions)),
                  onClick: /* @__PURE__ */ __name(function onClick3($event) {
                    return $options.onOptionSelect($event, option3);
                  }, "onClick"),
                  onMousemove: /* @__PURE__ */ __name(function onMousemove($event) {
                    return $options.onOptionMouseMove($event, $options.getOptionIndex(i2, getItemOptions));
                  }, "onMousemove"),
                  "data-p-selected": $options.isSelected(option3),
                  "data-p-focused": $data.focusedOptionIndex === $options.getOptionIndex(i2, getItemOptions),
                  "data-p-disabled": $options.isOptionDisabled(option3),
                  ref_for: true
                }, $options.getPTItemOptions(option3, getItemOptions, i2, "option")), [_ctx.checkmark ? (openBlock(), createElementBlock(Fragment$1, {
                  key: 0
                }, [$options.isSelected(option3) ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({
                  key: 0,
                  "class": _ctx.cx("optionCheckIcon"),
                  ref_for: true
                }, _ctx.ptm("optionCheckIcon")), null, 16, ["class"])) : (openBlock(), createBlock(_component_BlankIcon, mergeProps({
                  key: 1,
                  "class": _ctx.cx("optionBlankIcon"),
                  ref_for: true
                }, _ctx.ptm("optionBlankIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "option", {
                  option: option3,
                  selected: $options.isSelected(option3),
                  index: $options.getOptionIndex(i2, getItemOptions)
                }, function() {
                  return [createBaseVNode("span", mergeProps({
                    "class": _ctx.cx("optionLabel"),
                    ref_for: true
                  }, _ctx.ptm("optionLabel")), toDisplayString$1($options.getOptionLabel(option3)), 17)];
                })], 16, _hoisted_6$7)), [[_directive_ripple]])], 64);
              }), 128)), $data.filterValue && (!items2 || items2 && items2.length === 0) ? (openBlock(), createElementBlock("li", mergeProps({
                key: 0,
                "class": _ctx.cx("emptyMessage"),
                role: "option"
              }, _ctx.ptm("emptyMessage"), {
                "data-p-hidden-accessible": true
              }), [renderSlot(_ctx.$slots, "emptyfilter", {}, function() {
                return [createTextVNode(toDisplayString$1($options.emptyFilterMessageText), 1)];
              })], 16)) : !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock("li", mergeProps({
                key: 1,
                "class": _ctx.cx("emptyMessage"),
                role: "option"
              }, _ctx.ptm("emptyMessage"), {
                "data-p-hidden-accessible": true
              }), [renderSlot(_ctx.$slots, "empty", {}, function() {
                return [createTextVNode(toDisplayString$1($options.emptyMessageText), 1)];
              })], 16)) : createCommentVNode("", true)], 16, _hoisted_4$e)];
            }),
            _: 2
          }, [_ctx.$slots.loader ? {
            name: "loader",
            fn: withCtx(function(_ref2) {
              var options4 = _ref2.options;
              return [renderSlot(_ctx.$slots, "loader", {
                options: options4
              })];
            }),
            key: "0"
          } : void 0]), 1040, ["items", "style", "disabled", "pt"])], 16), renderSlot(_ctx.$slots, "footer", {
            value: _ctx.modelValue,
            options: $options.visibleOptions
          }), !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock("span", mergeProps({
            key: 1,
            role: "status",
            "aria-live": "polite",
            "class": "p-hidden-accessible"
          }, _ctx.ptm("hiddenEmptyMessage"), {
            "data-p-hidden-accessible": true
          }), toDisplayString$1($options.emptyMessageText), 17)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
            role: "status",
            "aria-live": "polite",
            "class": "p-hidden-accessible"
          }, _ctx.ptm("hiddenSelectedMessage"), {
            "data-p-hidden-accessible": true
          }), toDisplayString$1($options.selectedMessageText), 17), createBaseVNode("span", mergeProps({
            ref: "lastHiddenFocusableElementOnOverlay",
            role: "presentation",
            "aria-hidden": "true",
            "class": "p-hidden-accessible p-hidden-focusable",
            tabindex: 0,
            onFocus: _cache[8] || (_cache[8] = function() {
              return $options.onLastHiddenFocus && $options.onLastHiddenFocus.apply($options, arguments);
            })
          }, _ctx.ptm("hiddenLastFocusableEl"), {
            "data-p-hidden-accessible": true,
            "data-p-hidden-focusable": true
          }), null, 16)], 16)) : createCommentVNode("", true)];
        }),
        _: 3
      }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])];
    }),
    _: 3
  }, 8, ["appendTo"])], 16, _hoisted_1$Q);
}
__name(render$n, "render$n");
script$o.render = render$n;
const id$5 = "arc";
const name$5 = "Arc";
const colors$5 = {
  node_slot: {
    BOOLEAN: "",
    CLIP: "#eacb8b",
    CLIP_VISION: "#A8DADC",
    CLIP_VISION_OUTPUT: "#ad7452",
    CONDITIONING: "#cf876f",
    CONTROL_NET: "#00d78d",
    CONTROL_NET_WEIGHTS: "",
    FLOAT: "",
    GLIGEN: "",
    IMAGE: "#80a1c0",
    IMAGEUPLOAD: "",
    INT: "",
    LATENT: "#b38ead",
    LATENT_KEYFRAME: "",
    MASK: "#a3bd8d",
    MODEL: "#8978a7",
    SAMPLER: "",
    SIGMAS: "",
    STRING: "",
    STYLE_MODEL: "#C2FFAE",
    T2I_ADAPTER_WEIGHTS: "",
    TAESD: "#DCC274",
    TIMESTEP_KEYFRAME: "",
    UPSCALE_MODEL: "",
    VAE: "#be616b"
  },
  litegraph_base: {
    BACKGROUND_IMAGE: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAABcklEQVR4nO3YMUoDARgF4RfxBqZI6/0vZqFn0MYtrLIQMFN8U6V4LAtD+Jm9XG/v30OGl2e/AP7yevz4+vx45nvgF/+QGITEICQGITEIiUFIjNNC3q43u3/YnRJyPOzeQ+0e220nhRzReC8e7R7bbdvl+Jal1Bs46jEIiUFIDEJiEBKDkBhKPbZT6qHdptRTu02p53DUYxASg5AYhMQgJAYhMZR6bKfUQ7tNqad2m1LP4ajHICQGITEIiUFIDEJiKPXYTqmHdptST+02pZ7DUY9BSAxCYhASg5AYhMRQ6rGdUg/tNqWe2m1KPYejHoOQGITEICQGITEIiaHUYzulHtptSj2125R6Dkc9BiExCIlBSAxCYhASQ6nHdko9tNuUemq3KfUcjnoMQmIQEoOQGITEICSGUo/tlHpotyn11G5T6jkc9RiExCAkBiExCIlBSAylHtsp9dBuU+qp3abUczjqMQiJQUgMQmIQEoOQGITE+AHFISNQrFTGuwAAAABJRU5ErkJggg==",
    CLEAR_BACKGROUND_COLOR: "#2b2f38",
    NODE_TITLE_COLOR: "#b2b7bd",
    NODE_SELECTED_TITLE_COLOR: "#FFF",
    NODE_TEXT_SIZE: 14,
    NODE_TEXT_COLOR: "#AAA",
    NODE_SUBTEXT_SIZE: 12,
    NODE_DEFAULT_COLOR: "#2b2f38",
    NODE_DEFAULT_BGCOLOR: "#242730",
    NODE_DEFAULT_BOXCOLOR: "#6e7581",
    NODE_DEFAULT_SHAPE: 2,
    NODE_BOX_OUTLINE_COLOR: "#FFF",
    NODE_BYPASS_BGCOLOR: "#FF00FF",
    NODE_ERROR_COLOUR: "#E00",
    DEFAULT_SHADOW_COLOR: "rgba(0,0,0,0.5)",
    DEFAULT_GROUP_FONT: 22,
    WIDGET_BGCOLOR: "#2b2f38",
    WIDGET_OUTLINE_COLOR: "#6e7581",
    WIDGET_TEXT_COLOR: "#DDD",
    WIDGET_SECONDARY_TEXT_COLOR: "#b2b7bd",
    LINK_COLOR: "#9A9",
    EVENT_LINK_COLOR: "#A86",
    CONNECTING_LINK_COLOR: "#AFA"
  },
  comfy_base: {
    "fg-color": "#fff",
    "bg-color": "#2b2f38",
    "comfy-menu-bg": "#242730",
    "comfy-menu-secondary-bg": "#22252E",
    "comfy-input-bg": "#2b2f38",
    "input-text": "#ddd",
    "descrip-text": "#b2b7bd",
    "drag-text": "#ccc",
    "error-text": "#ff4444",
    "border-color": "#6e7581",
    "tr-even-bg-color": "#2b2f38",
    "tr-odd-bg-color": "#242730",
    "content-bg": "#6e7581",
    "content-fg": "#fff",
    "content-hover-bg": "#2b2f38",
    "content-hover-fg": "#fff",
    "bar-shadow": "rgba(8, 8, 8, 0.75) 0 0 0.5rem"
  }
};
const arc = {
  id: id$5,
  name: name$5,
  colors: colors$5
};
const id$4 = "dark";
const name$4 = "Dark (Default)";
const colors$4 = {
  node_slot: {
    CLIP: "#FFD500",
    CLIP_VISION: "#A8DADC",
    CLIP_VISION_OUTPUT: "#ad7452",
    CONDITIONING: "#FFA931",
    CONTROL_NET: "#6EE7B7",
    IMAGE: "#64B5F6",
    LATENT: "#FF9CF9",
    MASK: "#81C784",
    MODEL: "#B39DDB",
    STYLE_MODEL: "#C2FFAE",
    VAE: "#FF6E6E",
    NOISE: "#B0B0B0",
    GUIDER: "#66FFFF",
    SAMPLER: "#ECB4B4",
    SIGMAS: "#CDFFCD",
    TAESD: "#DCC274"
  },
  litegraph_base: {
    BACKGROUND_IMAGE: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQBJREFUeNrs1rEKwjAUhlETUkj3vP9rdmr1Ysammk2w5wdxuLgcMHyptfawuZX4pJSWZTnfnu/lnIe/jNNxHHGNn//HNbbv+4dr6V+11uF527arU7+u63qfa/bnmh8sWLBgwYJlqRf8MEptXPBXJXa37BSl3ixYsGDBMliwFLyCV/DeLIMFCxYsWLBMwSt4Be/NggXLYMGCBUvBK3iNruC9WbBgwYJlsGApeAWv4L1ZBgsWLFiwYJmCV/AK3psFC5bBggULloJX8BpdwXuzYMGCBctgwVLwCl7Be7MMFixYsGDBsu8FH1FaSmExVfAxBa/gvVmwYMGCZbBg/W4vAQYA5tRF9QYlv/QAAAAASUVORK5CYII=",
    CLEAR_BACKGROUND_COLOR: "#222",
    NODE_TITLE_COLOR: "#999",
    NODE_SELECTED_TITLE_COLOR: "#FFF",
    NODE_TEXT_SIZE: 14,
    NODE_TEXT_COLOR: "#AAA",
    NODE_SUBTEXT_SIZE: 12,
    NODE_DEFAULT_COLOR: "#333",
    NODE_DEFAULT_BGCOLOR: "#353535",
    NODE_DEFAULT_BOXCOLOR: "#666",
    NODE_DEFAULT_SHAPE: 2,
    NODE_BOX_OUTLINE_COLOR: "#FFF",
    NODE_BYPASS_BGCOLOR: "#FF00FF",
    NODE_ERROR_COLOUR: "#E00",
    DEFAULT_SHADOW_COLOR: "rgba(0,0,0,0.5)",
    DEFAULT_GROUP_FONT: 24,
    WIDGET_BGCOLOR: "#222",
    WIDGET_OUTLINE_COLOR: "#666",
    WIDGET_TEXT_COLOR: "#DDD",
    WIDGET_SECONDARY_TEXT_COLOR: "#999",
    LINK_COLOR: "#9A9",
    EVENT_LINK_COLOR: "#A86",
    CONNECTING_LINK_COLOR: "#AFA",
    BADGE_FG_COLOR: "#FFF",
    BADGE_BG_COLOR: "#0F1F0F"
  },
  comfy_base: {
    "fg-color": "#fff",
    "bg-color": "#202020",
    "comfy-menu-bg": "#353535",
    "comfy-menu-secondary-bg": "#303030",
    "comfy-input-bg": "#222",
    "input-text": "#ddd",
    "descrip-text": "#999",
    "drag-text": "#ccc",
    "error-text": "#ff4444",
    "border-color": "#4e4e4e",
    "tr-even-bg-color": "#222",
    "tr-odd-bg-color": "#353535",
    "content-bg": "#4e4e4e",
    "content-fg": "#fff",
    "content-hover-bg": "#222",
    "content-hover-fg": "#fff",
    "bar-shadow": "rgba(16, 16, 16, 0.5) 0 0 0.5rem"
  }
};
const dark = {
  id: id$4,
  name: name$4,
  colors: colors$4
};
const id$3 = "github";
const name$3 = "Github";
const colors$3 = {
  node_slot: {
    BOOLEAN: "",
    CLIP: "#eacb8b",
    CLIP_VISION: "#A8DADC",
    CLIP_VISION_OUTPUT: "#ad7452",
    CONDITIONING: "#cf876f",
    CONTROL_NET: "#00d78d",
    CONTROL_NET_WEIGHTS: "",
    FLOAT: "",
    GLIGEN: "",
    IMAGE: "#80a1c0",
    IMAGEUPLOAD: "",
    INT: "",
    LATENT: "#b38ead",
    LATENT_KEYFRAME: "",
    MASK: "#a3bd8d",
    MODEL: "#8978a7",
    SAMPLER: "",
    SIGMAS: "",
    STRING: "",
    STYLE_MODEL: "#C2FFAE",
    T2I_ADAPTER_WEIGHTS: "",
    TAESD: "#DCC274",
    TIMESTEP_KEYFRAME: "",
    UPSCALE_MODEL: "",
    VAE: "#be616b"
  },
  litegraph_base: {
    BACKGROUND_IMAGE: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDowMTo1NSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMy0xMS0xM1QwMDoxODowMiswMTowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmIyYzRhNjA5LWJmYTctYTg0MC1iOGFlLTk3MzE2ZjM1ZGIyNyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjk0ZmNlZGU4LTE1MTctZmQ0MC04ZGU3LWYzOTgxM2E3ODk5ZiIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjIzMWIxMGIwLWI0ZmItMDI0ZS1iMTJlLTMwNTMwM2NkMDdjOCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MjMxYjEwYjAtYjRmYi0wMjRlLWIxMmUtMzA1MzAzY2QwN2M4IiBzdEV2dDp3aGVuPSIyMDIzLTExLTEzVDAwOjE4OjAyKzAxOjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjQ4OWY1NzlmLTJkNjUtZWQ0Zi04OTg0LTA4NGE2MGE1ZTMzNSIgc3RFdnQ6d2hlbj0iMjAyMy0xMS0xNVQwMjowNDo1OSswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpiMmM0YTYwOS1iZmE3LWE4NDAtYjhhZS05NzMxNmYzNWRiMjciIHN0RXZ0OndoZW49IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNS4xIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4OTe6GAAAAx0lEQVR42u3WMQoAIQxFwRzJys77X8vSLiRgITif7bYbgrwYc/mKXyBoY4VVBgsWLFiwYFmOlTv+9jfDOjHmr8u6eVkGCxYsWLBgmc5S8ApewXvgYRksWLBgKXidpeBdloL3wMOCBctgwVLwCl7BuyyDBQsWLFiwTGcpeAWv4D3wsAwWLFiwFLzOUvAuS8F74GHBgmWwYCl4Ba/gXZbBggULFixYprMUvIJX8B54WAYLFixYCl5nKXiXpeA98LBgwTJYsGC9tg1o8f4TTtqzNQAAAABJRU5ErkJggg==",
    CLEAR_BACKGROUND_COLOR: "#040506",
    NODE_TITLE_COLOR: "#999",
    NODE_SELECTED_TITLE_COLOR: "#e5eaf0",
    NODE_TEXT_SIZE: 14,
    NODE_TEXT_COLOR: "#bcc2c8",
    NODE_SUBTEXT_SIZE: 12,
    NODE_DEFAULT_COLOR: "#161b22",
    NODE_DEFAULT_BGCOLOR: "#13171d",
    NODE_DEFAULT_BOXCOLOR: "#30363d",
    NODE_DEFAULT_SHAPE: 2,
    NODE_BOX_OUTLINE_COLOR: "#e5eaf0",
    NODE_BYPASS_BGCOLOR: "#FF00FF",
    NODE_ERROR_COLOUR: "#E00",
    DEFAULT_SHADOW_COLOR: "rgba(0,0,0,0.5)",
    DEFAULT_GROUP_FONT: 24,
    WIDGET_BGCOLOR: "#161b22",
    WIDGET_OUTLINE_COLOR: "#30363d",
    WIDGET_TEXT_COLOR: "#bcc2c8",
    WIDGET_SECONDARY_TEXT_COLOR: "#999",
    LINK_COLOR: "#9A9",
    EVENT_LINK_COLOR: "#A86",
    CONNECTING_LINK_COLOR: "#AFA"
  },
  comfy_base: {
    "fg-color": "#e5eaf0",
    "bg-color": "#161b22",
    "comfy-menu-bg": "#13171d",
    "comfy-menu-secondary-bg": "#11141A",
    "comfy-input-bg": "#161b22",
    "input-text": "#bcc2c8",
    "descrip-text": "#999",
    "drag-text": "#ccc",
    "error-text": "#ff4444",
    "border-color": "#30363d",
    "tr-even-bg-color": "#161b22",
    "tr-odd-bg-color": "#13171d",
    "content-bg": "#30363d",
    "content-fg": "#e5eaf0",
    "content-hover-bg": "#161b22",
    "content-hover-fg": "#e5eaf0",
    "bar-shadow": "rgba(0, 0, 0, 1) 0 0 0.5rem"
  }
};
const github = {
  id: id$3,
  name: name$3,
  colors: colors$3
};
const id$2 = "light";
const name$2 = "Light";
const colors$2 = {
  node_slot: {
    CLIP: "#FFA726",
    CLIP_VISION: "#5C6BC0",
    CLIP_VISION_OUTPUT: "#8D6E63",
    CONDITIONING: "#EF5350",
    CONTROL_NET: "#66BB6A",
    IMAGE: "#42A5F5",
    LATENT: "#AB47BC",
    MASK: "#9CCC65",
    MODEL: "#7E57C2",
    STYLE_MODEL: "#D4E157",
    VAE: "#FF7043"
  },
  litegraph_base: {
    BACKGROUND_IMAGE: "data:image/gif;base64,R0lGODlhZABkALMAAAAAAP///+vr6+rq6ujo6Ofn5+bm5uXl5d3d3f///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAABkAGQAAAT/UMhJq7046827HkcoHkYxjgZhnGG6si5LqnIM0/fL4qwwIMAg0CAsEovBIxKhRDaNy2GUOX0KfVFrssrNdpdaqTeKBX+dZ+jYvEaTf+y4W66mC8PUdrE879f9d2mBeoNLfH+IhYBbhIx2jkiHiomQlGKPl4uZe3CaeZifnnijgkESBqipqqusra6vsLGys62SlZO4t7qbuby7CLa+wqGWxL3Gv3jByMOkjc2lw8vOoNSi0czAncXW3Njdx9Pf48/Z4Kbbx+fQ5evZ4u3k1fKR6cn03vHlp7T9/v8A/8Gbp4+gwXoFryXMB2qgwoMMHyKEqA5fxX322FG8tzBcRnMW/zlulPbRncmQGidKjMjyYsOSKEF2FBlJQMCbOHP6c9iSZs+UnGYCdbnSo1CZI5F64kn0p1KnTH02nSoV3dGTV7FFHVqVq1dtWcMmVQZTbNGu72zqXMuW7danVL+6e4t1bEy6MeueBYLXrNO5Ze36jQtWsOG97wIj1vt3St/DjTEORss4nNq2mDP3e7w4r1bFkSET5hy6s2TRlD2/mSxXtSHQhCunXo26NevCpmvD/UU6tuullzULH76q92zdZG/Ltv1a+W+osI/nRmyc+fRi1Xdbh+68+0vv10dH3+77KD/i6IdnX669/frn5Zsjh4/2PXju8+8bzc9/6fj27LFnX11/+IUnXWl7BJfegm79FyB9JOl3oHgSklefgxAC+FmFGpqHIYcCfkhgfCohSKKJVo044YUMttggiBkmp6KFXw1oII24oYhjiDByaKOOHcp3Y5BD/njikSkO+eBREQAAOw==",
    CLEAR_BACKGROUND_COLOR: "lightgray",
    NODE_TITLE_COLOR: "#222",
    NODE_SELECTED_TITLE_COLOR: "#000",
    NODE_TEXT_SIZE: 14,
    NODE_TEXT_COLOR: "#444",
    NODE_SUBTEXT_SIZE: 12,
    NODE_DEFAULT_COLOR: "#F7F7F7",
    NODE_DEFAULT_BGCOLOR: "#F5F5F5",
    NODE_DEFAULT_BOXCOLOR: "#CCC",
    NODE_DEFAULT_SHAPE: 2,
    NODE_BOX_OUTLINE_COLOR: "#000",
    NODE_BYPASS_BGCOLOR: "#FF00FF",
    NODE_ERROR_COLOUR: "#E00",
    DEFAULT_SHADOW_COLOR: "rgba(0,0,0,0.1)",
    DEFAULT_GROUP_FONT: 24,
    WIDGET_BGCOLOR: "#D4D4D4",
    WIDGET_OUTLINE_COLOR: "#999",
    WIDGET_TEXT_COLOR: "#222",
    WIDGET_SECONDARY_TEXT_COLOR: "#555",
    LINK_COLOR: "#4CAF50",
    EVENT_LINK_COLOR: "#FF9800",
    CONNECTING_LINK_COLOR: "#2196F3",
    BADGE_FG_COLOR: "#000",
    BADGE_BG_COLOR: "#FFF"
  },
  comfy_base: {
    "fg-color": "#222",
    "bg-color": "#DDD",
    "comfy-menu-bg": "#F5F5F5",
    "comfy-menu-hover-bg": "#ccc",
    "comfy-menu-secondary-bg": "#EEE",
    "comfy-input-bg": "#C9C9C9",
    "input-text": "#222",
    "descrip-text": "#444",
    "drag-text": "#555",
    "error-text": "#F44336",
    "border-color": "#888",
    "tr-even-bg-color": "#f9f9f9",
    "tr-odd-bg-color": "#fff",
    "content-bg": "#e0e0e0",
    "content-fg": "#222",
    "content-hover-bg": "#adadad",
    "content-hover-fg": "#222",
    "bar-shadow": "rgba(16, 16, 16, 0.25) 0 0 0.5rem"
  }
};
const light = {
  id: id$2,
  name: name$2,
  colors: colors$2
};
const id$1 = "nord";
const name$1 = "Nord";
const colors$1 = {
  node_slot: {
    BOOLEAN: "",
    CLIP: "#eacb8b",
    CLIP_VISION: "#A8DADC",
    CLIP_VISION_OUTPUT: "#ad7452",
    CONDITIONING: "#cf876f",
    CONTROL_NET: "#00d78d",
    CONTROL_NET_WEIGHTS: "",
    FLOAT: "",
    GLIGEN: "",
    IMAGE: "#80a1c0",
    IMAGEUPLOAD: "",
    INT: "",
    LATENT: "#b38ead",
    LATENT_KEYFRAME: "",
    MASK: "#a3bd8d",
    MODEL: "#8978a7",
    SAMPLER: "",
    SIGMAS: "",
    STRING: "",
    STYLE_MODEL: "#C2FFAE",
    T2I_ADAPTER_WEIGHTS: "",
    TAESD: "#DCC274",
    TIMESTEP_KEYFRAME: "",
    UPSCALE_MODEL: "",
    VAE: "#be616b"
  },
  litegraph_base: {
    BACKGROUND_IMAGE: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFu2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDowMTo1NSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMy0xMS0xM1QwMDoxODowMiswMTowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjMtMTEtMTVUMDE6MjA6NDUrMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjMtMTEtMTVUMDE6MjA6NDUrMDE6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjUwNDFhMmZjLTEzNzQtMTk0ZC1hZWY4LTYxMzM1MTVmNjUwMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMzFiMTBiMC1iNGZiLTAyNGUtYjEyZS0zMDUzMDNjZDA3YzgiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyMzFiMTBiMC1iNGZiLTAyNGUtYjEyZS0zMDUzMDNjZDA3YzgiPiA8eG1wTU06SGlzdG9yeT4gPHJkZjpTZXE+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJjcmVhdGVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjIzMWIxMGIwLWI0ZmItMDI0ZS1iMTJlLTMwNTMwM2NkMDdjOCIgc3RFdnQ6d2hlbj0iMjAyMy0xMS0xM1QwMDoxODowMiswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDo1MDQxYTJmYy0xMzc0LTE5NGQtYWVmOC02MTMzNTE1ZjY1MDAiIHN0RXZ0OndoZW49IjIwMjMtMTEtMTVUMDE6MjA6NDUrMDE6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNS4xIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz73jWg/AAAAyUlEQVR42u3WKwoAIBRFQRdiMb1idv9Lsxn9gEFw4Dbb8JCTojbbXEJwjJVL2HKwYMGCBQuWLbDmjr+9zrBGjHl1WVcvy2DBggULFizTWQpewSt4HzwsgwULFiwFr7MUvMtS8D54WLBgGSxYCl7BK3iXZbBgwYIFC5bpLAWv4BW8Dx6WwYIFC5aC11kK3mUpeB88LFiwDBYsBa/gFbzLMliwYMGCBct0loJX8AreBw/LYMGCBUvB6ywF77IUvA8eFixYBgsWrNfWAZPltufdad+1AAAAAElFTkSuQmCC",
    CLEAR_BACKGROUND_COLOR: "#212732",
    NODE_TITLE_COLOR: "#999",
    NODE_SELECTED_TITLE_COLOR: "#e5eaf0",
    NODE_TEXT_SIZE: 14,
    NODE_TEXT_COLOR: "#bcc2c8",
    NODE_SUBTEXT_SIZE: 12,
    NODE_DEFAULT_COLOR: "#2e3440",
    NODE_DEFAULT_BGCOLOR: "#161b22",
    NODE_DEFAULT_BOXCOLOR: "#545d70",
    NODE_DEFAULT_SHAPE: 2,
    NODE_BOX_OUTLINE_COLOR: "#e5eaf0",
    NODE_BYPASS_BGCOLOR: "#FF00FF",
    NODE_ERROR_COLOUR: "#E00",
    DEFAULT_SHADOW_COLOR: "rgba(0,0,0,0.5)",
    DEFAULT_GROUP_FONT: 24,
    WIDGET_BGCOLOR: "#2e3440",
    WIDGET_OUTLINE_COLOR: "#545d70",
    WIDGET_TEXT_COLOR: "#bcc2c8",
    WIDGET_SECONDARY_TEXT_COLOR: "#999",
    LINK_COLOR: "#9A9",
    EVENT_LINK_COLOR: "#A86",
    CONNECTING_LINK_COLOR: "#AFA"
  },
  comfy_base: {
    "fg-color": "#e5eaf0",
    "bg-color": "#2e3440",
    "comfy-menu-bg": "#161b22",
    "comfy-menu-secondary-bg": "#14181F",
    "comfy-input-bg": "#2e3440",
    "input-text": "#bcc2c8",
    "descrip-text": "#999",
    "drag-text": "#ccc",
    "error-text": "#ff4444",
    "border-color": "#545d70",
    "tr-even-bg-color": "#2e3440",
    "tr-odd-bg-color": "#161b22",
    "content-bg": "#545d70",
    "content-fg": "#e5eaf0",
    "content-hover-bg": "#2e3440",
    "content-hover-fg": "#e5eaf0",
    "bar-shadow": "rgba(0, 0, 0, 0.75) 0 0 0.5rem"
  }
};
const nord = {
  id: id$1,
  name: name$1,
  colors: colors$1
};
const id = "solarized";
const name = "Solarized";
const colors = {
  node_slot: {
    CLIP: "#2AB7CA",
    CLIP_VISION: "#6c71c4",
    CLIP_VISION_OUTPUT: "#859900",
    CONDITIONING: "#d33682",
    CONTROL_NET: "#d1ffd7",
    IMAGE: "#5940bb",
    LATENT: "#268bd2",
    MASK: "#CCC9E7",
    MODEL: "#dc322f",
    STYLE_MODEL: "#1a998a",
    UPSCALE_MODEL: "#054A29",
    VAE: "#facfad"
  },
  litegraph_base: {
    NODE_TITLE_COLOR: "#fdf6e3",
    NODE_SELECTED_TITLE_COLOR: "#A9D400",
    NODE_TEXT_SIZE: 14,
    NODE_TEXT_COLOR: "#657b83",
    NODE_SUBTEXT_SIZE: 12,
    NODE_DEFAULT_COLOR: "#094656",
    NODE_DEFAULT_BGCOLOR: "#073642",
    NODE_DEFAULT_BOXCOLOR: "#839496",
    NODE_DEFAULT_SHAPE: 2,
    NODE_BOX_OUTLINE_COLOR: "#fdf6e3",
    NODE_BYPASS_BGCOLOR: "#FF00FF",
    NODE_ERROR_COLOUR: "#E00",
    DEFAULT_SHADOW_COLOR: "rgba(0,0,0,0.5)",
    DEFAULT_GROUP_FONT: 24,
    WIDGET_BGCOLOR: "#002b36",
    WIDGET_OUTLINE_COLOR: "#839496",
    WIDGET_TEXT_COLOR: "#fdf6e3",
    WIDGET_SECONDARY_TEXT_COLOR: "#93a1a1",
    LINK_COLOR: "#2aa198",
    EVENT_LINK_COLOR: "#268bd2",
    CONNECTING_LINK_COLOR: "#859900"
  },
  comfy_base: {
    "fg-color": "#fdf6e3",
    "bg-color": "#002b36",
    "comfy-menu-bg": "#073642",
    "comfy-menu-secondary-bg": "#06323D",
    "comfy-input-bg": "#002b36",
    "input-text": "#93a1a1",
    "descrip-text": "#586e75",
    "drag-text": "#839496",
    "error-text": "#dc322f",
    "border-color": "#657b83",
    "tr-even-bg-color": "#002b36",
    "tr-odd-bg-color": "#073642",
    "content-bg": "#657b83",
    "content-fg": "#fdf6e3",
    "content-hover-bg": "#002b36",
    "content-hover-fg": "#fdf6e3",
    "bar-shadow": "rgba(16, 16, 16, 0.5) 0 0 0.5rem"
  }
};
const solarized = {
  id,
  name,
  colors
};
const CORE_COLOR_PALETTES = {
  dark,
  light,
  solarized,
  arc,
  nord,
  github
};
const DEFAULT_COLOR_PALETTE = dark;
const useColorPaletteStore = /* @__PURE__ */ defineStore("colorPalette", () => {
  const customPalettes = ref({});
  const activePaletteId = ref(DEFAULT_COLOR_PALETTE.id);
  const palettesLookup = computed(() => ({
    ...CORE_COLOR_PALETTES,
    ...customPalettes.value
  }));
  const palettes = computed(() => Object.values(palettesLookup.value));
  const completedActivePalette = computed(
    () => completePalette(palettesLookup.value[activePaletteId.value])
  );
  const addCustomPalette = /* @__PURE__ */ __name((palette) => {
    if (palette.id in palettesLookup.value) {
      throw new Error(`Palette with id ${palette.id} already exists`);
    }
    customPalettes.value[palette.id] = palette;
    activePaletteId.value = palette.id;
  }, "addCustomPalette");
  const deleteCustomPalette = /* @__PURE__ */ __name((id3) => {
    if (!(id3 in customPalettes.value)) {
      throw new Error(`Palette with id ${id3} does not exist`);
    }
    delete customPalettes.value[id3];
    activePaletteId.value = CORE_COLOR_PALETTES.dark.id;
  }, "deleteCustomPalette");
  const isCustomPalette = /* @__PURE__ */ __name((id3) => {
    return id3 in customPalettes.value;
  }, "isCustomPalette");
  const completePalette = /* @__PURE__ */ __name((palette) => {
    if (palette.colors.comfy_base["comfy-menu-bg"] && !palette.colors.comfy_base["comfy-menu-secondary-bg"]) {
      palette.colors.comfy_base["comfy-menu-secondary-bg"] = palette.colors.comfy_base["comfy-menu-bg"];
    }
    return {
      ...palette,
      colors: {
        ...palette.colors,
        node_slot: {
          ...DEFAULT_COLOR_PALETTE.colors.node_slot,
          ...palette.colors.node_slot
        },
        litegraph_base: {
          ...DEFAULT_COLOR_PALETTE.colors.litegraph_base,
          ...palette.colors.litegraph_base
        },
        comfy_base: {
          ...DEFAULT_COLOR_PALETTE.colors.comfy_base,
          ...palette.colors.comfy_base
        }
      }
    };
  }, "completePalette");
  return {
    // State
    customPalettes,
    activePaletteId,
    // Getters
    palettesLookup,
    palettes,
    completedActivePalette,
    // Actions
    isCustomPalette,
    addCustomPalette,
    deleteCustomPalette,
    completePalette
  };
});
const _hoisted_1$P = { class: "flex items-center justify-between" };
const _hoisted_2$B = { class: "actions" };
const _sfc_main$I = /* @__PURE__ */ defineComponent({
  __name: "ColorPaletteMessage",
  setup(__props) {
    const settingStore = useSettingStore();
    const colorPaletteStore = useColorPaletteStore();
    const colorPaletteService = useColorPaletteService();
    const { palettes, activePaletteId } = storeToRefs(colorPaletteStore);
    const importCustomPalette = /* @__PURE__ */ __name(async () => {
      const palette = await colorPaletteService.importColorPalette();
      if (palette) {
        settingStore.set("Comfy.ColorPalette", palette.id);
      }
    }, "importCustomPalette");
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(script$q), {
        severity: "info",
        icon: "pi pi-palette",
        "pt:text": "w-full"
      }, {
        default: withCtx(() => [
          createBaseVNode("div", _hoisted_1$P, [
            createBaseVNode("div", null, toDisplayString$1(_ctx.$t("settingsCategories.ColorPalette")), 1),
            createBaseVNode("div", _hoisted_2$B, [
              createVNode(unref(script$o), {
                class: "w-44",
                modelValue: unref(activePaletteId),
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(activePaletteId) ? activePaletteId.value = $event : null),
                options: unref(palettes),
                optionLabel: "name",
                optionValue: "id"
              }, null, 8, ["modelValue", "options"]),
              createVNode(unref(script$R), {
                icon: "pi pi-download",
                text: "",
                title: _ctx.$t("g.download"),
                onClick: _cache[1] || (_cache[1] = ($event) => unref(colorPaletteService).exportColorPalette(unref(activePaletteId)))
              }, null, 8, ["title"]),
              createVNode(unref(script$R), {
                icon: "pi pi-upload",
                text: "",
                title: _ctx.$t("g.import"),
                onClick: importCustomPalette
              }, null, 8, ["title"]),
              createVNode(unref(script$R), {
                icon: "pi pi-trash",
                severity: "danger",
                text: "",
                title: _ctx.$t("g.delete"),
                onClick: _cache[2] || (_cache[2] = ($event) => unref(colorPaletteService).deleteCustomColorPalette(unref(activePaletteId))),
                disabled: !unref(colorPaletteStore).isCustomPalette(unref(activePaletteId))
              }, null, 8, ["title", "disabled"])
            ])
          ])
        ]),
        _: 1
      });
    };
  }
});
const _hoisted_1$O = { class: "flex items-center justify-between" };
const _sfc_main$H = /* @__PURE__ */ defineComponent({
  __name: "CurrentUserMessage",
  setup(__props) {
    const userStore = useUserStore();
    const logout = /* @__PURE__ */ __name(() => {
      userStore.logout();
      window.location.reload();
    }, "logout");
    return (_ctx, _cache) => {
      return unref(userStore).isMultiUserServer ? (openBlock(), createBlock(unref(script$q), {
        key: 0,
        severity: "info",
        icon: "pi pi-user",
        "pt:text": "w-full"
      }, {
        default: withCtx(() => [
          createBaseVNode("div", _hoisted_1$O, [
            createBaseVNode("div", null, toDisplayString$1(_ctx.$t("g.currentUser")) + ": " + toDisplayString$1(unref(userStore).currentUser?.username), 1),
            createVNode(unref(script$R), {
              icon: "pi pi-sign-out",
              onClick: logout,
              text: ""
            })
          ])
        ]),
        _: 1
      })) : createCommentVNode("", true);
    };
  }
});
const _sfc_main$G = /* @__PURE__ */ defineComponent({
  __name: "FirstTimeUIMessage",
  setup(__props) {
    const settingStore = useSettingStore();
    const show5 = computed(() => !settingStore.exists("Comfy.UseNewMenu"));
    const handleClose = /* @__PURE__ */ __name(() => {
      const currentValue = settingStore.get("Comfy.UseNewMenu");
      settingStore.set("Comfy.UseNewMenu", currentValue);
    }, "handleClose");
    return (_ctx, _cache) => {
      return show5.value ? (openBlock(), createBlock(unref(script$q), {
        key: 0,
        class: "first-time-ui-message",
        severity: "info",
        closable: true,
        onClose: handleClose
      }, {
        default: withCtx(() => [
          createTextVNode(toDisplayString$1(_ctx.$t("g.firstTimeUIMessage")), 1)
        ]),
        _: 1
      })) : createCommentVNode("", true);
    };
  }
});
var script$n = {
  name: "AngleDownIcon",
  "extends": script$X
};
var _hoisted_1$N = /* @__PURE__ */ createBaseVNode("path", {
  d: "M3.58659 4.5007C3.68513 4.50023 3.78277 4.51945 3.87379 4.55723C3.9648 4.59501 4.04735 4.65058 4.11659 4.7207L7.11659 7.7207L10.1166 4.7207C10.2619 4.65055 10.4259 4.62911 10.5843 4.65956C10.7427 4.69002 10.8871 4.77074 10.996 4.88976C11.1049 5.00877 11.1726 5.15973 11.1889 5.32022C11.2052 5.48072 11.1693 5.6422 11.0866 5.7807L7.58659 9.2807C7.44597 9.42115 7.25534 9.50004 7.05659 9.50004C6.85784 9.50004 6.66722 9.42115 6.52659 9.2807L3.02659 5.7807C2.88614 5.64007 2.80725 5.44945 2.80725 5.2507C2.80725 5.05195 2.88614 4.86132 3.02659 4.7207C3.09932 4.64685 3.18675 4.58911 3.28322 4.55121C3.37969 4.51331 3.48305 4.4961 3.58659 4.5007Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$A = [_hoisted_1$N];
function render$m(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$A, 16);
}
__name(render$m, "render$m");
script$n.render = render$m;
var script$m = {
  name: "AngleUpIcon",
  "extends": script$X
};
var _hoisted_1$M = /* @__PURE__ */ createBaseVNode("path", {
  d: "M10.4134 9.49931C10.3148 9.49977 10.2172 9.48055 10.1262 9.44278C10.0352 9.405 9.95263 9.34942 9.88338 9.27931L6.88338 6.27931L3.88338 9.27931C3.73811 9.34946 3.57409 9.3709 3.41567 9.34044C3.25724 9.30999 3.11286 9.22926 3.00395 9.11025C2.89504 8.99124 2.82741 8.84028 2.8111 8.67978C2.79478 8.51928 2.83065 8.35781 2.91338 8.21931L6.41338 4.71931C6.55401 4.57886 6.74463 4.49997 6.94338 4.49997C7.14213 4.49997 7.33276 4.57886 7.47338 4.71931L10.9734 8.21931C11.1138 8.35994 11.1927 8.55056 11.1927 8.74931C11.1927 8.94806 11.1138 9.13868 10.9734 9.27931C10.9007 9.35315 10.8132 9.41089 10.7168 9.44879C10.6203 9.48669 10.5169 9.5039 10.4134 9.49931Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$z = [_hoisted_1$M];
function render$l(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$z, 16);
}
__name(render$l, "render$l");
script$m.render = render$l;
var theme$e = /* @__PURE__ */ __name(function theme25(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-inputnumber {\n    display: inline-flex;\n    position: relative;\n}\n\n.p-inputnumber-button {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex: 0 0 auto;\n    cursor: pointer;\n    background: ".concat(dt2("inputnumber.button.background"), ";\n    color: ").concat(dt2("inputnumber.button.color"), ";\n    width: ").concat(dt2("inputnumber.button.width"), ";\n    transition: background ").concat(dt2("inputnumber.transition.duration"), ", color ").concat(dt2("inputnumber.transition.duration"), ", border-color ").concat(dt2("inputnumber.transition.duration"), ", outline-color ").concat(dt2("inputnumber.transition.duration"), ";\n}\n\n.p-inputnumber-button:hover {\n    background: ").concat(dt2("inputnumber.button.hover.background"), ";\n    color: ").concat(dt2("inputnumber.button.hover.color"), ";\n}\n\n.p-inputnumber-button:active {\n    background: ").concat(dt2("inputnumber.button.active.background"), ";\n    color: ").concat(dt2("inputnumber.button.active.color"), ";\n}\n\n.p-inputnumber-stacked .p-inputnumber-button {\n    position: relative;\n    border: 0 none;\n}\n\n.p-inputnumber-stacked .p-inputnumber-button-group {\n    display: flex;\n    flex-direction: column;\n    position: absolute;\n    top: 1px;\n    right: 1px;\n    height: calc(100% - 2px);\n    z-index: 1;\n}\n\n.p-inputnumber-stacked .p-inputnumber-increment-button {\n    padding: 0;\n    border-top-right-radius: calc(").concat(dt2("inputnumber.button.border.radius"), " - 1px);\n}\n\n.p-inputnumber-stacked .p-inputnumber-decrement-button {\n    padding: 0;\n    border-bottom-right-radius: calc(").concat(dt2("inputnumber.button.border.radius"), " - 1px);\n}\n\n.p-inputnumber-stacked .p-inputnumber-button {\n    flex: 1 1 auto;\n    border: 0 none;\n}\n\n.p-inputnumber-horizontal .p-inputnumber-button {\n    border: 1px solid ").concat(dt2("inputnumber.button.border.color"), ";\n}\n\n.p-inputnumber-horizontal .p-inputnumber-button:hover {\n    border-color: ").concat(dt2("inputnumber.button.hover.border.color"), ";\n}\n\n.p-inputnumber-horizontal .p-inputnumber-button:active {\n    border-color: ").concat(dt2("inputnumber.button.active.border.color"), ";\n}\n\n.p-inputnumber-horizontal .p-inputnumber-increment-button {\n    order: 3;\n    border-top-right-radius: ").concat(dt2("inputnumber.button.border.radius"), ";\n    border-bottom-right-radius: ").concat(dt2("inputnumber.button.border.radius"), ";\n    border-left: 0 none;\n}\n\n.p-inputnumber-horizontal .p-inputnumber-input {\n    order: 2;\n    border-radius: 0;\n}\n\n.p-inputnumber-horizontal .p-inputnumber-decrement-button {\n    order: 1;\n    border-top-left-radius: ").concat(dt2("inputnumber.button.border.radius"), ";\n    border-bottom-left-radius: ").concat(dt2("inputnumber.button.border.radius"), ";\n    border-right: 0 none;\n}\n\n.p-inputnumber-vertical {\n    flex-direction: column;\n}\n\n.p-inputnumber-vertical .p-inputnumber-button {\n    border: 1px solid ").concat(dt2("inputnumber.button.border.color"), ";\n    padding: ").concat(dt2("inputnumber.button.vertical.padding"), "; 0;\n}\n\n.p-inputnumber-vertical .p-inputnumber-button:hover {\n    border-color: ").concat(dt2("inputnumber.button.hover.border.color"), ";\n}\n\n.p-inputnumber-vertical .p-inputnumber-button:active {\n    border-color: ").concat(dt2("inputnumber.button.active.border.color"), ";\n}\n\n.p-inputnumber-vertical .p-inputnumber-increment-button {\n    order: 1;\n    border-top-left-radius: ").concat(dt2("inputnumber.button.border.radius"), ";\n    border-top-right-radius: ").concat(dt2("inputnumber.button.border.radius"), ";\n    width: 100%;\n    border-bottom: 0 none;\n}\n\n.p-inputnumber-vertical .p-inputnumber-input {\n    order: 2;\n    border-radius: 0;\n    text-align: center;\n}\n\n.p-inputnumber-vertical .p-inputnumber-decrement-button {\n    order: 3;\n    border-bottom-left-radius: ").concat(dt2("inputnumber.button.border.radius"), ";\n    border-bottom-right-radius: ").concat(dt2("inputnumber.button.border.radius"), ";\n    width: 100%;\n    border-top: 0 none;\n}\n\n.p-inputnumber-input {\n    flex: 1 1 auto;\n}\n\n.p-inputnumber-fluid {\n    width: 100%;\n}\n\n.p-inputnumber-fluid .p-inputnumber-input {\n    width: 1%;\n}\n\n.p-inputnumber-fluid.p-inputnumber-vertical .p-inputnumber-input {\n    width: 100%;\n}\n");
}, "theme");
var classes$e = {
  root: /* @__PURE__ */ __name(function root15(_ref2) {
    var instance = _ref2.instance, props = _ref2.props;
    return ["p-inputnumber p-component p-inputwrapper", {
      "p-inputwrapper-filled": instance.filled || props.allowEmpty === false,
      "p-inputwrapper-focus": instance.focused,
      "p-inputnumber-stacked": props.showButtons && props.buttonLayout === "stacked",
      "p-inputnumber-horizontal": props.showButtons && props.buttonLayout === "horizontal",
      "p-inputnumber-vertical": props.showButtons && props.buttonLayout === "vertical",
      "p-inputnumber-fluid": instance.hasFluid
    }];
  }, "root"),
  pcInput: "p-inputnumber-input",
  buttonGroup: "p-inputnumber-button-group",
  incrementButton: /* @__PURE__ */ __name(function incrementButton(_ref3) {
    var instance = _ref3.instance, props = _ref3.props;
    return ["p-inputnumber-button p-inputnumber-increment-button", {
      "p-disabled": props.showButtons && props.max !== null && instance.maxBoundry()
    }];
  }, "incrementButton"),
  decrementButton: /* @__PURE__ */ __name(function decrementButton(_ref4) {
    var instance = _ref4.instance, props = _ref4.props;
    return ["p-inputnumber-button p-inputnumber-decrement-button", {
      "p-disabled": props.showButtons && props.min !== null && instance.minBoundry()
    }];
  }, "decrementButton")
};
var InputNumberStyle = BaseStyle.extend({
  name: "inputnumber",
  theme: theme$e,
  classes: classes$e
});
var script$1$e = {
  name: "BaseInputNumber",
  "extends": script$_,
  props: {
    modelValue: {
      type: Number,
      "default": null
    },
    format: {
      type: Boolean,
      "default": true
    },
    showButtons: {
      type: Boolean,
      "default": false
    },
    buttonLayout: {
      type: String,
      "default": "stacked"
    },
    incrementButtonClass: {
      type: String,
      "default": null
    },
    decrementButtonClass: {
      type: String,
      "default": null
    },
    incrementButtonIcon: {
      type: String,
      "default": void 0
    },
    incrementIcon: {
      type: String,
      "default": void 0
    },
    decrementButtonIcon: {
      type: String,
      "default": void 0
    },
    decrementIcon: {
      type: String,
      "default": void 0
    },
    locale: {
      type: String,
      "default": void 0
    },
    localeMatcher: {
      type: String,
      "default": void 0
    },
    mode: {
      type: String,
      "default": "decimal"
    },
    prefix: {
      type: String,
      "default": null
    },
    suffix: {
      type: String,
      "default": null
    },
    currency: {
      type: String,
      "default": void 0
    },
    currencyDisplay: {
      type: String,
      "default": void 0
    },
    useGrouping: {
      type: Boolean,
      "default": true
    },
    minFractionDigits: {
      type: Number,
      "default": void 0
    },
    maxFractionDigits: {
      type: Number,
      "default": void 0
    },
    roundingMode: {
      type: String,
      "default": "halfExpand",
      validator: /* @__PURE__ */ __name(function validator2(value4) {
        return ["ceil", "floor", "expand", "trunc", "halfCeil", "halfFloor", "halfExpand", "halfTrunc", "halfEven"].includes(value4);
      }, "validator")
    },
    min: {
      type: Number,
      "default": null
    },
    max: {
      type: Number,
      "default": null
    },
    step: {
      type: Number,
      "default": 1
    },
    allowEmpty: {
      type: Boolean,
      "default": true
    },
    highlightOnFocus: {
      type: Boolean,
      "default": false
    },
    readonly: {
      type: Boolean,
      "default": false
    },
    variant: {
      type: String,
      "default": null
    },
    invalid: {
      type: Boolean,
      "default": false
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    placeholder: {
      type: String,
      "default": null
    },
    fluid: {
      type: Boolean,
      "default": null
    },
    inputId: {
      type: String,
      "default": null
    },
    inputClass: {
      type: [String, Object],
      "default": null
    },
    inputStyle: {
      type: Object,
      "default": null
    },
    ariaLabelledby: {
      type: String,
      "default": null
    },
    ariaLabel: {
      type: String,
      "default": null
    }
  },
  style: InputNumberStyle,
  provide: /* @__PURE__ */ __name(function provide27() {
    return {
      $pcInputNumber: this,
      $parentInstance: this
    };
  }, "provide")
};
function _typeof$5(o) {
  "@babel/helpers - typeof";
  return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$5(o);
}
__name(_typeof$5, "_typeof$5");
function ownKeys$7(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$7, "ownKeys$7");
function _objectSpread$7(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$7(Object(t2), true).forEach(function(r2) {
      _defineProperty$5(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$7(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$7, "_objectSpread$7");
function _defineProperty$5(e2, r, t2) {
  return (r = _toPropertyKey$4(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$5, "_defineProperty$5");
function _toPropertyKey$4(t2) {
  var i2 = _toPrimitive$4(t2, "string");
  return "symbol" == _typeof$5(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$4, "_toPropertyKey$4");
function _toPrimitive$4(t2, r) {
  if ("object" != _typeof$5(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$5(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$4, "_toPrimitive$4");
function _toConsumableArray$8(r) {
  return _arrayWithoutHoles$8(r) || _iterableToArray$8(r) || _unsupportedIterableToArray$a(r) || _nonIterableSpread$8();
}
__name(_toConsumableArray$8, "_toConsumableArray$8");
function _nonIterableSpread$8() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$8, "_nonIterableSpread$8");
function _unsupportedIterableToArray$a(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$a(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$a(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$a, "_unsupportedIterableToArray$a");
function _iterableToArray$8(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$8, "_iterableToArray$8");
function _arrayWithoutHoles$8(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$a(r);
}
__name(_arrayWithoutHoles$8, "_arrayWithoutHoles$8");
function _arrayLikeToArray$a(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$a, "_arrayLikeToArray$a");
var script$l = {
  name: "InputNumber",
  "extends": script$1$e,
  inheritAttrs: false,
  emits: ["update:modelValue", "input", "focus", "blur"],
  inject: {
    $pcFluid: {
      "default": null
    }
  },
  numberFormat: null,
  _numeral: null,
  _decimal: null,
  _group: null,
  _minusSign: null,
  _currency: null,
  _suffix: null,
  _prefix: null,
  _index: null,
  groupChar: "",
  isSpecialChar: null,
  prefixChar: null,
  suffixChar: null,
  timer: null,
  data: /* @__PURE__ */ __name(function data12() {
    return {
      d_modelValue: this.modelValue,
      focused: false
    };
  }, "data"),
  watch: {
    modelValue: /* @__PURE__ */ __name(function modelValue2(newValue2) {
      this.d_modelValue = newValue2;
    }, "modelValue"),
    locale: /* @__PURE__ */ __name(function locale(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "locale"),
    localeMatcher: /* @__PURE__ */ __name(function localeMatcher(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "localeMatcher"),
    mode: /* @__PURE__ */ __name(function mode(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "mode"),
    currency: /* @__PURE__ */ __name(function currency(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "currency"),
    currencyDisplay: /* @__PURE__ */ __name(function currencyDisplay(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "currencyDisplay"),
    useGrouping: /* @__PURE__ */ __name(function useGrouping(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "useGrouping"),
    minFractionDigits: /* @__PURE__ */ __name(function minFractionDigits(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "minFractionDigits"),
    maxFractionDigits: /* @__PURE__ */ __name(function maxFractionDigits(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "maxFractionDigits"),
    suffix: /* @__PURE__ */ __name(function suffix(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "suffix"),
    prefix: /* @__PURE__ */ __name(function prefix(newValue2, oldValue2) {
      this.updateConstructParser(newValue2, oldValue2);
    }, "prefix")
  },
  created: /* @__PURE__ */ __name(function created2() {
    this.constructParser();
  }, "created"),
  methods: {
    getOptions: /* @__PURE__ */ __name(function getOptions2() {
      return {
        localeMatcher: this.localeMatcher,
        style: this.mode,
        currency: this.currency,
        currencyDisplay: this.currencyDisplay,
        useGrouping: this.useGrouping,
        minimumFractionDigits: this.minFractionDigits,
        maximumFractionDigits: this.maxFractionDigits,
        roundingMode: this.roundingMode
      };
    }, "getOptions"),
    constructParser: /* @__PURE__ */ __name(function constructParser() {
      this.numberFormat = new Intl.NumberFormat(this.locale, this.getOptions());
      var numerals = _toConsumableArray$8(new Intl.NumberFormat(this.locale, {
        useGrouping: false
      }).format(9876543210)).reverse();
      var index2 = new Map(numerals.map(function(d, i2) {
        return [d, i2];
      }));
      this._numeral = new RegExp("[".concat(numerals.join(""), "]"), "g");
      this._group = this.getGroupingExpression();
      this._minusSign = this.getMinusSignExpression();
      this._currency = this.getCurrencyExpression();
      this._decimal = this.getDecimalExpression();
      this._suffix = this.getSuffixExpression();
      this._prefix = this.getPrefixExpression();
      this._index = function(d) {
        return index2.get(d);
      };
    }, "constructParser"),
    updateConstructParser: /* @__PURE__ */ __name(function updateConstructParser(newValue2, oldValue2) {
      if (newValue2 !== oldValue2) {
        this.constructParser();
      }
    }, "updateConstructParser"),
    escapeRegExp: /* @__PURE__ */ __name(function escapeRegExp(text2) {
      return text2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
    }, "escapeRegExp"),
    getDecimalExpression: /* @__PURE__ */ __name(function getDecimalExpression() {
      var formatter = new Intl.NumberFormat(this.locale, _objectSpread$7(_objectSpread$7({}, this.getOptions()), {}, {
        useGrouping: false
      }));
      return new RegExp("[".concat(formatter.format(1.1).replace(this._currency, "").trim().replace(this._numeral, ""), "]"), "g");
    }, "getDecimalExpression"),
    getGroupingExpression: /* @__PURE__ */ __name(function getGroupingExpression() {
      var formatter = new Intl.NumberFormat(this.locale, {
        useGrouping: true
      });
      this.groupChar = formatter.format(1e6).trim().replace(this._numeral, "").charAt(0);
      return new RegExp("[".concat(this.groupChar, "]"), "g");
    }, "getGroupingExpression"),
    getMinusSignExpression: /* @__PURE__ */ __name(function getMinusSignExpression() {
      var formatter = new Intl.NumberFormat(this.locale, {
        useGrouping: false
      });
      return new RegExp("[".concat(formatter.format(-1).trim().replace(this._numeral, ""), "]"), "g");
    }, "getMinusSignExpression"),
    getCurrencyExpression: /* @__PURE__ */ __name(function getCurrencyExpression() {
      if (this.currency) {
        var formatter = new Intl.NumberFormat(this.locale, {
          style: "currency",
          currency: this.currency,
          currencyDisplay: this.currencyDisplay,
          minimumFractionDigits: 0,
          maximumFractionDigits: 0,
          roundingMode: this.roundingMode
        });
        return new RegExp("[".concat(formatter.format(1).replace(/\s/g, "").replace(this._numeral, "").replace(this._group, ""), "]"), "g");
      }
      return new RegExp("[]", "g");
    }, "getCurrencyExpression"),
    getPrefixExpression: /* @__PURE__ */ __name(function getPrefixExpression() {
      if (this.prefix) {
        this.prefixChar = this.prefix;
      } else {
        var formatter = new Intl.NumberFormat(this.locale, {
          style: this.mode,
          currency: this.currency,
          currencyDisplay: this.currencyDisplay
        });
        this.prefixChar = formatter.format(1).split("1")[0];
      }
      return new RegExp("".concat(this.escapeRegExp(this.prefixChar || "")), "g");
    }, "getPrefixExpression"),
    getSuffixExpression: /* @__PURE__ */ __name(function getSuffixExpression() {
      if (this.suffix) {
        this.suffixChar = this.suffix;
      } else {
        var formatter = new Intl.NumberFormat(this.locale, {
          style: this.mode,
          currency: this.currency,
          currencyDisplay: this.currencyDisplay,
          minimumFractionDigits: 0,
          maximumFractionDigits: 0,
          roundingMode: this.roundingMode
        });
        this.suffixChar = formatter.format(1).split("1")[1];
      }
      return new RegExp("".concat(this.escapeRegExp(this.suffixChar || "")), "g");
    }, "getSuffixExpression"),
    formatValue: /* @__PURE__ */ __name(function formatValue(value4) {
      if (value4 != null) {
        if (value4 === "-") {
          return value4;
        }
        if (this.format) {
          var formatter = new Intl.NumberFormat(this.locale, this.getOptions());
          var formattedValue2 = formatter.format(value4);
          if (this.prefix) {
            formattedValue2 = this.prefix + formattedValue2;
          }
          if (this.suffix) {
            formattedValue2 = formattedValue2 + this.suffix;
          }
          return formattedValue2;
        }
        return value4.toString();
      }
      return "";
    }, "formatValue"),
    parseValue: /* @__PURE__ */ __name(function parseValue2(text2) {
      var filteredText = text2.replace(this._suffix, "").replace(this._prefix, "").trim().replace(/\s/g, "").replace(this._currency, "").replace(this._group, "").replace(this._minusSign, "-").replace(this._decimal, ".").replace(this._numeral, this._index);
      if (filteredText) {
        if (filteredText === "-")
          return filteredText;
        var parsedValue = +filteredText;
        return isNaN(parsedValue) ? null : parsedValue;
      }
      return null;
    }, "parseValue"),
    repeat: /* @__PURE__ */ __name(function repeat2(event, interval, dir) {
      var _this = this;
      if (this.readonly) {
        return;
      }
      var i2 = interval || 500;
      this.clearTimer();
      this.timer = setTimeout(function() {
        _this.repeat(event, 40, dir);
      }, i2);
      this.spin(event, dir);
    }, "repeat"),
    spin: /* @__PURE__ */ __name(function spin(event, dir) {
      if (this.$refs.input) {
        var step3 = this.step * dir;
        var currentValue = this.parseValue(this.$refs.input.$el.value) || 0;
        var newValue2 = this.validateValue(currentValue + step3);
        this.updateInput(newValue2, null, "spin");
        this.updateModel(event, newValue2);
        this.handleOnInput(event, currentValue, newValue2);
      }
    }, "spin"),
    onUpButtonMouseDown: /* @__PURE__ */ __name(function onUpButtonMouseDown(event) {
      if (!this.disabled) {
        this.$refs.input.$el.focus();
        this.repeat(event, null, 1);
        event.preventDefault();
      }
    }, "onUpButtonMouseDown"),
    onUpButtonMouseUp: /* @__PURE__ */ __name(function onUpButtonMouseUp() {
      if (!this.disabled) {
        this.clearTimer();
      }
    }, "onUpButtonMouseUp"),
    onUpButtonMouseLeave: /* @__PURE__ */ __name(function onUpButtonMouseLeave() {
      if (!this.disabled) {
        this.clearTimer();
      }
    }, "onUpButtonMouseLeave"),
    onUpButtonKeyUp: /* @__PURE__ */ __name(function onUpButtonKeyUp() {
      if (!this.disabled) {
        this.clearTimer();
      }
    }, "onUpButtonKeyUp"),
    onUpButtonKeyDown: /* @__PURE__ */ __name(function onUpButtonKeyDown(event) {
      if (event.code === "Space" || event.code === "Enter" || event.code === "NumpadEnter") {
        this.repeat(event, null, 1);
      }
    }, "onUpButtonKeyDown"),
    onDownButtonMouseDown: /* @__PURE__ */ __name(function onDownButtonMouseDown(event) {
      if (!this.disabled) {
        this.$refs.input.$el.focus();
        this.repeat(event, null, -1);
        event.preventDefault();
      }
    }, "onDownButtonMouseDown"),
    onDownButtonMouseUp: /* @__PURE__ */ __name(function onDownButtonMouseUp() {
      if (!this.disabled) {
        this.clearTimer();
      }
    }, "onDownButtonMouseUp"),
    onDownButtonMouseLeave: /* @__PURE__ */ __name(function onDownButtonMouseLeave() {
      if (!this.disabled) {
        this.clearTimer();
      }
    }, "onDownButtonMouseLeave"),
    onDownButtonKeyUp: /* @__PURE__ */ __name(function onDownButtonKeyUp() {
      if (!this.disabled) {
        this.clearTimer();
      }
    }, "onDownButtonKeyUp"),
    onDownButtonKeyDown: /* @__PURE__ */ __name(function onDownButtonKeyDown(event) {
      if (event.code === "Space" || event.code === "Enter" || event.code === "NumpadEnter") {
        this.repeat(event, null, -1);
      }
    }, "onDownButtonKeyDown"),
    onUserInput: /* @__PURE__ */ __name(function onUserInput() {
      if (this.isSpecialChar) {
        this.$refs.input.$el.value = this.lastValue;
      }
      this.isSpecialChar = false;
    }, "onUserInput"),
    onInputKeyDown: /* @__PURE__ */ __name(function onInputKeyDown(event) {
      if (this.readonly) {
        return;
      }
      if (event.altKey || event.ctrlKey || event.metaKey) {
        this.isSpecialChar = true;
        this.lastValue = this.$refs.input.$el.value;
        return;
      }
      this.lastValue = event.target.value;
      var selectionStart = event.target.selectionStart;
      var selectionEnd = event.target.selectionEnd;
      var inputValue = event.target.value;
      var newValueStr = null;
      switch (event.code) {
        case "ArrowUp":
          this.spin(event, 1);
          event.preventDefault();
          break;
        case "ArrowDown":
          this.spin(event, -1);
          event.preventDefault();
          break;
        case "ArrowLeft":
          if (!this.isNumeralChar(inputValue.charAt(selectionStart - 1))) {
            event.preventDefault();
          }
          break;
        case "ArrowRight":
          if (!this.isNumeralChar(inputValue.charAt(selectionStart))) {
            event.preventDefault();
          }
          break;
        case "Tab":
        case "Enter":
        case "NumpadEnter":
          newValueStr = this.validateValue(this.parseValue(inputValue));
          this.$refs.input.$el.value = this.formatValue(newValueStr);
          this.$refs.input.$el.setAttribute("aria-valuenow", newValueStr);
          this.updateModel(event, newValueStr);
          break;
        case "Backspace": {
          event.preventDefault();
          if (selectionStart === selectionEnd) {
            var deleteChar = inputValue.charAt(selectionStart - 1);
            var _this$getDecimalCharI = this.getDecimalCharIndexes(inputValue), decimalCharIndex = _this$getDecimalCharI.decimalCharIndex, decimalCharIndexWithoutPrefix = _this$getDecimalCharI.decimalCharIndexWithoutPrefix;
            if (this.isNumeralChar(deleteChar)) {
              var decimalLength = this.getDecimalLength(inputValue);
              if (this._group.test(deleteChar)) {
                this._group.lastIndex = 0;
                newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);
              } else if (this._decimal.test(deleteChar)) {
                this._decimal.lastIndex = 0;
                if (decimalLength) {
                  this.$refs.input.$el.setSelectionRange(selectionStart - 1, selectionStart - 1);
                } else {
                  newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
                }
              } else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
                var insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < decimalLength ? "" : "0";
                newValueStr = inputValue.slice(0, selectionStart - 1) + insertedText + inputValue.slice(selectionStart);
              } else if (decimalCharIndexWithoutPrefix === 1) {
                newValueStr = inputValue.slice(0, selectionStart - 1) + "0" + inputValue.slice(selectionStart);
                newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : "";
              } else {
                newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
              }
            }
            this.updateValue(event, newValueStr, null, "delete-single");
          } else {
            newValueStr = this.deleteRange(inputValue, selectionStart, selectionEnd);
            this.updateValue(event, newValueStr, null, "delete-range");
          }
          break;
        }
        case "Delete":
          event.preventDefault();
          if (selectionStart === selectionEnd) {
            var _deleteChar = inputValue.charAt(selectionStart);
            var _this$getDecimalCharI2 = this.getDecimalCharIndexes(inputValue), _decimalCharIndex = _this$getDecimalCharI2.decimalCharIndex, _decimalCharIndexWithoutPrefix = _this$getDecimalCharI2.decimalCharIndexWithoutPrefix;
            if (this.isNumeralChar(_deleteChar)) {
              var _decimalLength = this.getDecimalLength(inputValue);
              if (this._group.test(_deleteChar)) {
                this._group.lastIndex = 0;
                newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);
              } else if (this._decimal.test(_deleteChar)) {
                this._decimal.lastIndex = 0;
                if (_decimalLength) {
                  this.$refs.input.$el.setSelectionRange(selectionStart + 1, selectionStart + 1);
                } else {
                  newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
                }
              } else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {
                var _insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < _decimalLength ? "" : "0";
                newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);
              } else if (_decimalCharIndexWithoutPrefix === 1) {
                newValueStr = inputValue.slice(0, selectionStart) + "0" + inputValue.slice(selectionStart + 1);
                newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : "";
              } else {
                newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
              }
            }
            this.updateValue(event, newValueStr, null, "delete-back-single");
          } else {
            newValueStr = this.deleteRange(inputValue, selectionStart, selectionEnd);
            this.updateValue(event, newValueStr, null, "delete-range");
          }
          break;
        case "Home":
          event.preventDefault();
          if (isNotEmpty(this.min)) {
            this.updateModel(event, this.min);
          }
          break;
        case "End":
          event.preventDefault();
          if (isNotEmpty(this.max)) {
            this.updateModel(event, this.max);
          }
          break;
      }
    }, "onInputKeyDown"),
    onInputKeyPress: /* @__PURE__ */ __name(function onInputKeyPress(event) {
      if (this.readonly) {
        return;
      }
      var _char = event.key;
      var isDecimalSign2 = this.isDecimalSign(_char);
      var isMinusSign2 = this.isMinusSign(_char);
      if (event.code !== "Enter") {
        event.preventDefault();
      }
      if (Number(_char) >= 0 && Number(_char) <= 9 || isMinusSign2 || isDecimalSign2) {
        this.insert(event, _char, {
          isDecimalSign: isDecimalSign2,
          isMinusSign: isMinusSign2
        });
      }
    }, "onInputKeyPress"),
    onPaste: /* @__PURE__ */ __name(function onPaste(event) {
      event.preventDefault();
      var data24 = (event.clipboardData || window["clipboardData"]).getData("Text");
      if (data24) {
        var filteredData = this.parseValue(data24);
        if (filteredData != null) {
          this.insert(event, filteredData.toString());
        }
      }
    }, "onPaste"),
    allowMinusSign: /* @__PURE__ */ __name(function allowMinusSign() {
      return this.min === null || this.min < 0;
    }, "allowMinusSign"),
    isMinusSign: /* @__PURE__ */ __name(function isMinusSign(_char2) {
      if (this._minusSign.test(_char2) || _char2 === "-") {
        this._minusSign.lastIndex = 0;
        return true;
      }
      return false;
    }, "isMinusSign"),
    isDecimalSign: /* @__PURE__ */ __name(function isDecimalSign(_char3) {
      if (this._decimal.test(_char3)) {
        this._decimal.lastIndex = 0;
        return true;
      }
      return false;
    }, "isDecimalSign"),
    isDecimalMode: /* @__PURE__ */ __name(function isDecimalMode() {
      return this.mode === "decimal";
    }, "isDecimalMode"),
    getDecimalCharIndexes: /* @__PURE__ */ __name(function getDecimalCharIndexes(val) {
      var decimalCharIndex = val.search(this._decimal);
      this._decimal.lastIndex = 0;
      var filteredVal = val.replace(this._prefix, "").trim().replace(/\s/g, "").replace(this._currency, "");
      var decimalCharIndexWithoutPrefix = filteredVal.search(this._decimal);
      this._decimal.lastIndex = 0;
      return {
        decimalCharIndex,
        decimalCharIndexWithoutPrefix
      };
    }, "getDecimalCharIndexes"),
    getCharIndexes: /* @__PURE__ */ __name(function getCharIndexes(val) {
      var decimalCharIndex = val.search(this._decimal);
      this._decimal.lastIndex = 0;
      var minusCharIndex = val.search(this._minusSign);
      this._minusSign.lastIndex = 0;
      var suffixCharIndex = val.search(this._suffix);
      this._suffix.lastIndex = 0;
      var currencyCharIndex = val.search(this._currency);
      this._currency.lastIndex = 0;
      return {
        decimalCharIndex,
        minusCharIndex,
        suffixCharIndex,
        currencyCharIndex
      };
    }, "getCharIndexes"),
    insert: /* @__PURE__ */ __name(function insert(event, text2) {
      var sign = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
        isDecimalSign: false,
        isMinusSign: false
      };
      var minusCharIndexOnText = text2.search(this._minusSign);
      this._minusSign.lastIndex = 0;
      if (!this.allowMinusSign() && minusCharIndexOnText !== -1) {
        return;
      }
      var selectionStart = this.$refs.input.$el.selectionStart;
      var selectionEnd = this.$refs.input.$el.selectionEnd;
      var inputValue = this.$refs.input.$el.value.trim();
      var _this$getCharIndexes = this.getCharIndexes(inputValue), decimalCharIndex = _this$getCharIndexes.decimalCharIndex, minusCharIndex = _this$getCharIndexes.minusCharIndex, suffixCharIndex = _this$getCharIndexes.suffixCharIndex, currencyCharIndex = _this$getCharIndexes.currencyCharIndex;
      var newValueStr;
      if (sign.isMinusSign) {
        if (selectionStart === 0) {
          newValueStr = inputValue;
          if (minusCharIndex === -1 || selectionEnd !== 0) {
            newValueStr = this.insertText(inputValue, text2, 0, selectionEnd);
          }
          this.updateValue(event, newValueStr, text2, "insert");
        }
      } else if (sign.isDecimalSign) {
        if (decimalCharIndex > 0 && selectionStart === decimalCharIndex) {
          this.updateValue(event, inputValue, text2, "insert");
        } else if (decimalCharIndex > selectionStart && decimalCharIndex < selectionEnd) {
          newValueStr = this.insertText(inputValue, text2, selectionStart, selectionEnd);
          this.updateValue(event, newValueStr, text2, "insert");
        } else if (decimalCharIndex === -1 && this.maxFractionDigits) {
          newValueStr = this.insertText(inputValue, text2, selectionStart, selectionEnd);
          this.updateValue(event, newValueStr, text2, "insert");
        }
      } else {
        var maxFractionDigits2 = this.numberFormat.resolvedOptions().maximumFractionDigits;
        var operation = selectionStart !== selectionEnd ? "range-insert" : "insert";
        if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
          if (selectionStart + text2.length - (decimalCharIndex + 1) <= maxFractionDigits2) {
            var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;
            newValueStr = inputValue.slice(0, selectionStart) + text2 + inputValue.slice(selectionStart + text2.length, charIndex) + inputValue.slice(charIndex);
            this.updateValue(event, newValueStr, text2, operation);
          }
        } else {
          newValueStr = this.insertText(inputValue, text2, selectionStart, selectionEnd);
          this.updateValue(event, newValueStr, text2, operation);
        }
      }
    }, "insert"),
    insertText: /* @__PURE__ */ __name(function insertText(value4, text2, start2, end) {
      var textSplit = text2 === "." ? text2 : text2.split(".");
      if (textSplit.length === 2) {
        var decimalCharIndex = value4.slice(start2, end).search(this._decimal);
        this._decimal.lastIndex = 0;
        return decimalCharIndex > 0 ? value4.slice(0, start2) + this.formatValue(text2) + value4.slice(end) : this.formatValue(text2) || value4;
      } else if (end - start2 === value4.length) {
        return this.formatValue(text2);
      } else if (start2 === 0) {
        return text2 + value4.slice(end);
      } else if (end === value4.length) {
        return value4.slice(0, start2) + text2;
      } else {
        return value4.slice(0, start2) + text2 + value4.slice(end);
      }
    }, "insertText"),
    deleteRange: /* @__PURE__ */ __name(function deleteRange2(value4, start2, end) {
      var newValueStr;
      if (end - start2 === value4.length) newValueStr = "";
      else if (start2 === 0) newValueStr = value4.slice(end);
      else if (end === value4.length) newValueStr = value4.slice(0, start2);
      else newValueStr = value4.slice(0, start2) + value4.slice(end);
      return newValueStr;
    }, "deleteRange"),
    initCursor: /* @__PURE__ */ __name(function initCursor() {
      var selectionStart = this.$refs.input.$el.selectionStart;
      var inputValue = this.$refs.input.$el.value;
      var valueLength = inputValue.length;
      var index2 = null;
      var prefixLength = (this.prefixChar || "").length;
      inputValue = inputValue.replace(this._prefix, "");
      selectionStart = selectionStart - prefixLength;
      var _char4 = inputValue.charAt(selectionStart);
      if (this.isNumeralChar(_char4)) {
        return selectionStart + prefixLength;
      }
      var i2 = selectionStart - 1;
      while (i2 >= 0) {
        _char4 = inputValue.charAt(i2);
        if (this.isNumeralChar(_char4)) {
          index2 = i2 + prefixLength;
          break;
        } else {
          i2--;
        }
      }
      if (index2 !== null) {
        this.$refs.input.$el.setSelectionRange(index2 + 1, index2 + 1);
      } else {
        i2 = selectionStart;
        while (i2 < valueLength) {
          _char4 = inputValue.charAt(i2);
          if (this.isNumeralChar(_char4)) {
            index2 = i2 + prefixLength;
            break;
          } else {
            i2++;
          }
        }
        if (index2 !== null) {
          this.$refs.input.$el.setSelectionRange(index2, index2);
        }
      }
      return index2 || 0;
    }, "initCursor"),
    onInputClick: /* @__PURE__ */ __name(function onInputClick() {
      var currentValue = this.$refs.input.$el.value;
      if (!this.readonly && currentValue !== getSelection$1()) {
        this.initCursor();
      }
    }, "onInputClick"),
    isNumeralChar: /* @__PURE__ */ __name(function isNumeralChar(_char5) {
      if (_char5.length === 1 && (this._numeral.test(_char5) || this._decimal.test(_char5) || this._group.test(_char5) || this._minusSign.test(_char5))) {
        this.resetRegex();
        return true;
      }
      return false;
    }, "isNumeralChar"),
    resetRegex: /* @__PURE__ */ __name(function resetRegex() {
      this._numeral.lastIndex = 0;
      this._decimal.lastIndex = 0;
      this._group.lastIndex = 0;
      this._minusSign.lastIndex = 0;
    }, "resetRegex"),
    updateValue: /* @__PURE__ */ __name(function updateValue2(event, valueStr, insertedValueStr, operation) {
      var currentValue = this.$refs.input.$el.value;
      var newValue2 = null;
      if (valueStr != null) {
        newValue2 = this.parseValue(valueStr);
        newValue2 = !newValue2 && !this.allowEmpty ? 0 : newValue2;
        this.updateInput(newValue2, insertedValueStr, operation, valueStr);
        this.handleOnInput(event, currentValue, newValue2);
      }
    }, "updateValue"),
    handleOnInput: /* @__PURE__ */ __name(function handleOnInput(event, currentValue, newValue2) {
      if (this.isValueChanged(currentValue, newValue2)) {
        this.$emit("input", {
          originalEvent: event,
          value: newValue2,
          formattedValue: currentValue
        });
      }
    }, "handleOnInput"),
    isValueChanged: /* @__PURE__ */ __name(function isValueChanged(currentValue, newValue2) {
      if (newValue2 === null && currentValue !== null) {
        return true;
      }
      if (newValue2 != null) {
        var parsedCurrentValue = typeof currentValue === "string" ? this.parseValue(currentValue) : currentValue;
        return newValue2 !== parsedCurrentValue;
      }
      return false;
    }, "isValueChanged"),
    validateValue: /* @__PURE__ */ __name(function validateValue(value4) {
      if (value4 === "-" || value4 == null) {
        return null;
      }
      if (this.min != null && value4 < this.min) {
        return this.min;
      }
      if (this.max != null && value4 > this.max) {
        return this.max;
      }
      return value4;
    }, "validateValue"),
    updateInput: /* @__PURE__ */ __name(function updateInput(value4, insertedValueStr, operation, valueStr) {
      insertedValueStr = insertedValueStr || "";
      var inputValue = this.$refs.input.$el.value;
      var newValue2 = this.formatValue(value4);
      var currentLength = inputValue.length;
      if (newValue2 !== valueStr) {
        newValue2 = this.concatValues(newValue2, valueStr);
      }
      if (currentLength === 0) {
        this.$refs.input.$el.value = newValue2;
        this.$refs.input.$el.setSelectionRange(0, 0);
        var index2 = this.initCursor();
        var selectionEnd = index2 + insertedValueStr.length;
        this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);
      } else {
        var selectionStart = this.$refs.input.$el.selectionStart;
        var _selectionEnd = this.$refs.input.$el.selectionEnd;
        this.$refs.input.$el.value = newValue2;
        var newLength = newValue2.length;
        if (operation === "range-insert") {
          var startValue = this.parseValue((inputValue || "").slice(0, selectionStart));
          var startValueStr = startValue !== null ? startValue.toString() : "";
          var startExpr = startValueStr.split("").join("(".concat(this.groupChar, ")?"));
          var sRegex = new RegExp(startExpr, "g");
          sRegex.test(newValue2);
          var tExpr = insertedValueStr.split("").join("(".concat(this.groupChar, ")?"));
          var tRegex = new RegExp(tExpr, "g");
          tRegex.test(newValue2.slice(sRegex.lastIndex));
          _selectionEnd = sRegex.lastIndex + tRegex.lastIndex;
          this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);
        } else if (newLength === currentLength) {
          if (operation === "insert" || operation === "delete-back-single") {
            this.$refs.input.$el.setSelectionRange(_selectionEnd + 1, _selectionEnd + 1);
          } else if (operation === "delete-single") {
            this.$refs.input.$el.setSelectionRange(_selectionEnd - 1, _selectionEnd - 1);
          } else if (operation === "delete-range" || operation === "spin") {
            this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);
          }
        } else if (operation === "delete-back-single") {
          var prevChar = inputValue.charAt(_selectionEnd - 1);
          var nextChar = inputValue.charAt(_selectionEnd);
          var diff2 = currentLength - newLength;
          var isGroupChar = this._group.test(nextChar);
          if (isGroupChar && diff2 === 1) {
            _selectionEnd += 1;
          } else if (!isGroupChar && this.isNumeralChar(prevChar)) {
            _selectionEnd += -1 * diff2 + 1;
          }
          this._group.lastIndex = 0;
          this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);
        } else if (inputValue === "-" && operation === "insert") {
          this.$refs.input.$el.setSelectionRange(0, 0);
          var _index = this.initCursor();
          var _selectionEnd2 = _index + insertedValueStr.length + 1;
          this.$refs.input.$el.setSelectionRange(_selectionEnd2, _selectionEnd2);
        } else {
          _selectionEnd = _selectionEnd + (newLength - currentLength);
          this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);
        }
      }
      this.$refs.input.$el.setAttribute("aria-valuenow", value4);
    }, "updateInput"),
    concatValues: /* @__PURE__ */ __name(function concatValues(val1, val2) {
      if (val1 && val2) {
        var decimalCharIndex = val2.search(this._decimal);
        this._decimal.lastIndex = 0;
        if (this.suffixChar) {
          return decimalCharIndex !== -1 ? val1.replace(this.suffixChar, "").split(this._decimal)[0] + val2.replace(this.suffixChar, "").slice(decimalCharIndex) + this.suffixChar : val1;
        } else {
          return decimalCharIndex !== -1 ? val1.split(this._decimal)[0] + val2.slice(decimalCharIndex) : val1;
        }
      }
      return val1;
    }, "concatValues"),
    getDecimalLength: /* @__PURE__ */ __name(function getDecimalLength(value4) {
      if (value4) {
        var valueSplit = value4.split(this._decimal);
        if (valueSplit.length === 2) {
          return valueSplit[1].replace(this._suffix, "").trim().replace(/\s/g, "").replace(this._currency, "").length;
        }
      }
      return 0;
    }, "getDecimalLength"),
    updateModel: /* @__PURE__ */ __name(function updateModel3(event, value4) {
      this.d_modelValue = value4;
      this.$emit("update:modelValue", value4);
    }, "updateModel"),
    onInputFocus: /* @__PURE__ */ __name(function onInputFocus(event) {
      this.focused = true;
      if (!this.disabled && !this.readonly && this.$refs.input.$el.value !== getSelection$1() && this.highlightOnFocus) {
        event.target.select();
      }
      this.$emit("focus", event);
    }, "onInputFocus"),
    onInputBlur: /* @__PURE__ */ __name(function onInputBlur(event) {
      this.focused = false;
      var input = event.target;
      var newValue2 = this.validateValue(this.parseValue(input.value));
      this.$emit("blur", {
        originalEvent: event,
        value: input.value
      });
      input.value = this.formatValue(newValue2);
      input.setAttribute("aria-valuenow", newValue2);
      this.updateModel(event, newValue2);
      if (!this.disabled && !this.readonly && this.highlightOnFocus) {
        clearSelection();
      }
    }, "onInputBlur"),
    clearTimer: /* @__PURE__ */ __name(function clearTimer2() {
      if (this.timer) {
        clearInterval(this.timer);
      }
    }, "clearTimer"),
    maxBoundry: /* @__PURE__ */ __name(function maxBoundry() {
      return this.d_modelValue >= this.max;
    }, "maxBoundry"),
    minBoundry: /* @__PURE__ */ __name(function minBoundry() {
      return this.d_modelValue <= this.min;
    }, "minBoundry")
  },
  computed: {
    filled: /* @__PURE__ */ __name(function filled2() {
      return this.modelValue != null && this.modelValue.toString().length > 0;
    }, "filled"),
    upButtonListeners: /* @__PURE__ */ __name(function upButtonListeners() {
      var _this2 = this;
      return {
        mousedown: /* @__PURE__ */ __name(function mousedown(event) {
          return _this2.onUpButtonMouseDown(event);
        }, "mousedown"),
        mouseup: /* @__PURE__ */ __name(function mouseup(event) {
          return _this2.onUpButtonMouseUp(event);
        }, "mouseup"),
        mouseleave: /* @__PURE__ */ __name(function mouseleave(event) {
          return _this2.onUpButtonMouseLeave(event);
        }, "mouseleave"),
        keydown: /* @__PURE__ */ __name(function keydown(event) {
          return _this2.onUpButtonKeyDown(event);
        }, "keydown"),
        keyup: /* @__PURE__ */ __name(function keyup(event) {
          return _this2.onUpButtonKeyUp(event);
        }, "keyup")
      };
    }, "upButtonListeners"),
    downButtonListeners: /* @__PURE__ */ __name(function downButtonListeners() {
      var _this3 = this;
      return {
        mousedown: /* @__PURE__ */ __name(function mousedown(event) {
          return _this3.onDownButtonMouseDown(event);
        }, "mousedown"),
        mouseup: /* @__PURE__ */ __name(function mouseup(event) {
          return _this3.onDownButtonMouseUp(event);
        }, "mouseup"),
        mouseleave: /* @__PURE__ */ __name(function mouseleave(event) {
          return _this3.onDownButtonMouseLeave(event);
        }, "mouseleave"),
        keydown: /* @__PURE__ */ __name(function keydown(event) {
          return _this3.onDownButtonKeyDown(event);
        }, "keydown"),
        keyup: /* @__PURE__ */ __name(function keyup(event) {
          return _this3.onDownButtonKeyUp(event);
        }, "keyup")
      };
    }, "downButtonListeners"),
    formattedValue: /* @__PURE__ */ __name(function formattedValue() {
      var val = !this.modelValue && !this.allowEmpty ? 0 : this.modelValue;
      return this.formatValue(val);
    }, "formattedValue"),
    getFormatter: /* @__PURE__ */ __name(function getFormatter() {
      return this.numberFormat;
    }, "getFormatter"),
    hasFluid: /* @__PURE__ */ __name(function hasFluid4() {
      return isEmpty$1(this.fluid) ? !!this.$pcFluid : this.fluid;
    }, "hasFluid")
  },
  components: {
    InputText: script$G,
    AngleUpIcon: script$m,
    AngleDownIcon: script$n
  }
};
var _hoisted_1$L = ["disabled"];
var _hoisted_2$y = ["disabled"];
var _hoisted_3$i = ["disabled"];
var _hoisted_4$d = ["disabled"];
function render$k(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_InputText = resolveComponent("InputText");
  return openBlock(), createElementBlock("span", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [createVNode(_component_InputText, {
    ref: "input",
    id: _ctx.inputId,
    role: "spinbutton",
    "class": normalizeClass([_ctx.cx("pcInput"), _ctx.inputClass]),
    style: normalizeStyle(_ctx.inputStyle),
    value: $options.formattedValue,
    "aria-valuemin": _ctx.min,
    "aria-valuemax": _ctx.max,
    "aria-valuenow": _ctx.modelValue,
    inputmode: _ctx.mode === "decimal" && !_ctx.minFractionDigits ? "numeric" : "decimal",
    disabled: _ctx.disabled,
    readonly: _ctx.readonly,
    placeholder: _ctx.placeholder,
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-label": _ctx.ariaLabel,
    invalid: _ctx.invalid,
    variant: _ctx.variant,
    onInput: $options.onUserInput,
    onKeydown: $options.onInputKeyDown,
    onKeypress: $options.onInputKeyPress,
    onPaste: $options.onPaste,
    onClick: $options.onInputClick,
    onFocus: $options.onInputFocus,
    onBlur: $options.onInputBlur,
    pt: _ctx.ptm("pcInput"),
    unstyled: _ctx.unstyled
  }, null, 8, ["id", "class", "style", "value", "aria-valuemin", "aria-valuemax", "aria-valuenow", "inputmode", "disabled", "readonly", "placeholder", "aria-labelledby", "aria-label", "invalid", "variant", "onInput", "onKeydown", "onKeypress", "onPaste", "onClick", "onFocus", "onBlur", "pt", "unstyled"]), _ctx.showButtons && _ctx.buttonLayout === "stacked" ? (openBlock(), createElementBlock("span", mergeProps({
    key: 0,
    "class": _ctx.cx("buttonGroup")
  }, _ctx.ptm("buttonGroup")), [renderSlot(_ctx.$slots, "incrementbutton", {
    listeners: $options.upButtonListeners
  }, function() {
    return [createBaseVNode("button", mergeProps({
      "class": [_ctx.cx("incrementButton"), _ctx.incrementButtonClass]
    }, toHandlers($options.upButtonListeners, true), {
      disabled: _ctx.disabled,
      tabindex: -1,
      "aria-hidden": "true",
      type: "button"
    }, _ctx.ptm("incrementButton")), [renderSlot(_ctx.$slots, _ctx.$slots.incrementicon ? "incrementicon" : "incrementbuttonicon", {}, function() {
      return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon || _ctx.incrementButtonIcon ? "span" : "AngleUpIcon"), mergeProps({
        "class": [_ctx.incrementIcon, _ctx.incrementButtonIcon]
      }, _ctx.ptm("incrementIcon"), {
        "data-pc-section": "incrementicon"
      }), null, 16, ["class"]))];
    })], 16, _hoisted_1$L)];
  }), renderSlot(_ctx.$slots, "decrementbutton", {
    listeners: $options.downButtonListeners
  }, function() {
    return [createBaseVNode("button", mergeProps({
      "class": [_ctx.cx("decrementButton"), _ctx.decrementButtonClass]
    }, toHandlers($options.downButtonListeners, true), {
      disabled: _ctx.disabled,
      tabindex: -1,
      "aria-hidden": "true",
      type: "button"
    }, _ctx.ptm("decrementButton")), [renderSlot(_ctx.$slots, _ctx.$slots.decrementicon ? "decrementicon" : "decrementbuttonicon", {}, function() {
      return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon || _ctx.decrementButtonIcon ? "span" : "AngleDownIcon"), mergeProps({
        "class": [_ctx.decrementIcon, _ctx.decrementButtonIcon]
      }, _ctx.ptm("decrementIcon"), {
        "data-pc-section": "decrementicon"
      }), null, 16, ["class"]))];
    })], 16, _hoisted_2$y)];
  })], 16)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "incrementbutton", {
    listeners: $options.upButtonListeners
  }, function() {
    return [_ctx.showButtons && _ctx.buttonLayout !== "stacked" ? (openBlock(), createElementBlock("button", mergeProps({
      key: 0,
      "class": [_ctx.cx("incrementButton"), _ctx.incrementButtonClass]
    }, toHandlers($options.upButtonListeners, true), {
      disabled: _ctx.disabled,
      tabindex: -1,
      "aria-hidden": "true",
      type: "button"
    }, _ctx.ptm("incrementButton")), [renderSlot(_ctx.$slots, _ctx.$slots.incrementicon ? "incrementicon" : "incrementbuttonicon", {}, function() {
      return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon || _ctx.incrementButtonIcon ? "span" : "AngleUpIcon"), mergeProps({
        "class": [_ctx.incrementIcon, _ctx.incrementButtonIcon]
      }, _ctx.ptm("incrementIcon"), {
        "data-pc-section": "incrementicon"
      }), null, 16, ["class"]))];
    })], 16, _hoisted_3$i)) : createCommentVNode("", true)];
  }), renderSlot(_ctx.$slots, "decrementbutton", {
    listeners: $options.downButtonListeners
  }, function() {
    return [_ctx.showButtons && _ctx.buttonLayout !== "stacked" ? (openBlock(), createElementBlock("button", mergeProps({
      key: 0,
      "class": [_ctx.cx("decrementButton"), _ctx.decrementButtonClass]
    }, toHandlers($options.downButtonListeners, true), {
      disabled: _ctx.disabled,
      tabindex: -1,
      "aria-hidden": "true",
      type: "button"
    }, _ctx.ptm("decrementButton")), [renderSlot(_ctx.$slots, _ctx.$slots.decrementicon ? "decrementicon" : "decrementbuttonicon", {}, function() {
      return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon || _ctx.decrementButtonIcon ? "span" : "AngleDownIcon"), mergeProps({
        "class": [_ctx.decrementIcon, _ctx.decrementButtonIcon]
      }, _ctx.ptm("decrementIcon"), {
        "data-pc-section": "decrementicon"
      }), null, 16, ["class"]))];
    })], 16, _hoisted_4$d)) : createCommentVNode("", true)];
  })], 16);
}
__name(render$k, "render$k");
script$l.render = render$k;
var theme$d = /* @__PURE__ */ __name(function theme26(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-toggleswitch {\n    display: inline-block;\n    width: ".concat(dt2("toggleswitch.width"), ";\n    height: ").concat(dt2("toggleswitch.height"), ";\n}\n\n.p-toggleswitch-input {\n    cursor: pointer;\n    appearance: none;\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    padding: 0;\n    margin: 0;\n    opacity: 0;\n    z-index: 1;\n    outline: 0 none;\n    border-radius: ").concat(dt2("toggleswitch.border.radius"), ";\n}\n\n.p-toggleswitch-slider {\n    display: inline-block;\n    cursor: pointer;\n    width: 100%;\n    height: 100%;\n    border-width: ").concat(dt2("toggleswitch.border.width"), ";\n    border-style: solid;\n    border-color: ").concat(dt2("toggleswitch.border.color"), ";\n    background: ").concat(dt2("toggleswitch.background"), ";\n    transition: background ").concat(dt2("toggleswitch.transition.duration"), ", color ").concat(dt2("toggleswitch.transition.duration"), ", border-color ").concat(dt2("toggleswitch.transition.duration"), ", outline-color ").concat(dt2("toggleswitch.transition.duration"), ", box-shadow ").concat(dt2("toggleswitch.transition.duration"), ";\n    border-radius: ").concat(dt2("toggleswitch.border.radius"), ";\n    outline-color: transparent;\n    box-shadow: ").concat(dt2("toggleswitch.shadow"), ';\n}\n\n.p-toggleswitch-slider:before {\n    position: absolute;\n    content: "";\n    top: 50%;\n    background: ').concat(dt2("toggleswitch.handle.background"), ";\n    width: ").concat(dt2("toggleswitch.handle.size"), ";\n    height: ").concat(dt2("toggleswitch.handle.size"), ";\n    left: ").concat(dt2("toggleswitch.gap"), ";\n    margin-top: calc(-1 * calc(").concat(dt2("toggleswitch.handle.size"), " / 2));\n    border-radius: ").concat(dt2("toggleswitch.handle.border.radius"), ";\n    transition: background ").concat(dt2("toggleswitch.transition.duration"), ", left ").concat(dt2("toggleswitch.slide.duration"), ";\n}\n\n.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider {\n    background: ").concat(dt2("toggleswitch.checked.background"), ";\n    border-color: ").concat(dt2("toggleswitch.checked.border.color"), ";\n}\n\n.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider:before {\n    background: ").concat(dt2("toggleswitch.handle.checked.background"), ";\n    left: calc(").concat(dt2("toggleswitch.width"), " - calc(").concat(dt2("toggleswitch.handle.size"), " + ").concat(dt2("toggleswitch.gap"), "));\n}\n\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider {\n    background: ").concat(dt2("toggleswitch.hover.background"), ";\n    border-color: ").concat(dt2("toggleswitch.hover.border.color"), ";\n}\n\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider:before {\n    background: ").concat(dt2("toggleswitch.handle.hover.background"), ";\n}\n\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider {\n    background: ").concat(dt2("toggleswitch.checked.hover.background"), ";\n    border-color: ").concat(dt2("toggleswitch.checked.hover.border.color"), ";\n}\n\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider:before {\n    background: ").concat(dt2("toggleswitch.handle.checked.hover.background"), ";\n}\n\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:focus-visible) .p-toggleswitch-slider {\n    box-shadow: ").concat(dt2("toggleswitch.focus.ring.shadow"), ";\n    outline: ").concat(dt2("toggleswitch.focus.ring.width"), " ").concat(dt2("toggleswitch.focus.ring.style"), " ").concat(dt2("toggleswitch.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("toggleswitch.focus.ring.offset"), ";\n}\n\n.p-toggleswitch.p-invalid > .p-toggleswitch-slider {\n    border-color: ").concat(dt2("toggleswitch.invalid.border.color"), ";\n}\n\n.p-toggleswitch.p-disabled {\n    opacity: 1;\n}\n\n.p-toggleswitch.p-disabled .p-toggleswitch-slider {\n    background: ").concat(dt2("toggleswitch.disabled.background"), ";\n}\n\n.p-toggleswitch.p-disabled .p-toggleswitch-slider:before {\n    background: ").concat(dt2("toggleswitch.handle.disabled.background"), ";\n}\n");
}, "theme");
var inlineStyles$1 = {
  root: {
    position: "relative"
  }
};
var classes$d = {
  root: /* @__PURE__ */ __name(function root16(_ref2) {
    var instance = _ref2.instance, props = _ref2.props;
    return ["p-toggleswitch p-component", {
      "p-toggleswitch-checked": instance.checked,
      "p-disabled": props.disabled,
      "p-invalid": props.invalid
    }];
  }, "root"),
  input: "p-toggleswitch-input",
  slider: "p-toggleswitch-slider"
};
var ToggleSwitchStyle = BaseStyle.extend({
  name: "toggleswitch",
  theme: theme$d,
  classes: classes$d,
  inlineStyles: inlineStyles$1
});
var script$1$d = {
  name: "BaseToggleSwitch",
  "extends": script$_,
  props: {
    modelValue: {
      type: null,
      "default": false
    },
    trueValue: {
      type: null,
      "default": true
    },
    falseValue: {
      type: null,
      "default": false
    },
    invalid: {
      type: Boolean,
      "default": false
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    readonly: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: Number,
      "default": null
    },
    inputId: {
      type: String,
      "default": null
    },
    inputClass: {
      type: [String, Object],
      "default": null
    },
    inputStyle: {
      type: Object,
      "default": null
    },
    ariaLabelledby: {
      type: String,
      "default": null
    },
    ariaLabel: {
      type: String,
      "default": null
    }
  },
  style: ToggleSwitchStyle,
  provide: /* @__PURE__ */ __name(function provide28() {
    return {
      $pcToggleSwitch: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$k = {
  name: "ToggleSwitch",
  "extends": script$1$d,
  inheritAttrs: false,
  emits: ["update:modelValue", "change", "focus", "blur"],
  methods: {
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions4(key) {
      var _ptm = key === "root" ? this.ptmi : this.ptm;
      return _ptm(key, {
        context: {
          checked: this.checked,
          disabled: this.disabled
        }
      });
    }, "getPTOptions"),
    onChange: /* @__PURE__ */ __name(function onChange2(event) {
      if (!this.disabled && !this.readonly) {
        var newValue2 = this.checked ? this.falseValue : this.trueValue;
        this.$emit("update:modelValue", newValue2);
        this.$emit("change", event);
      }
    }, "onChange"),
    onFocus: /* @__PURE__ */ __name(function onFocus4(event) {
      this.$emit("focus", event);
    }, "onFocus"),
    onBlur: /* @__PURE__ */ __name(function onBlur4(event) {
      this.$emit("blur", event);
    }, "onBlur")
  },
  computed: {
    checked: /* @__PURE__ */ __name(function checked() {
      return this.modelValue === this.trueValue;
    }, "checked")
  }
};
var _hoisted_1$K = ["data-p-checked", "data-p-disabled"];
var _hoisted_2$x = ["id", "checked", "tabindex", "disabled", "readonly", "aria-checked", "aria-labelledby", "aria-label", "aria-invalid"];
function render$j(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    style: _ctx.sx("root")
  }, $options.getPTOptions("root"), {
    "data-p-checked": $options.checked,
    "data-p-disabled": _ctx.disabled
  }), [createBaseVNode("input", mergeProps({
    id: _ctx.inputId,
    type: "checkbox",
    role: "switch",
    "class": [_ctx.cx("input"), _ctx.inputClass],
    style: _ctx.inputStyle,
    checked: $options.checked,
    tabindex: _ctx.tabindex,
    disabled: _ctx.disabled,
    readonly: _ctx.readonly,
    "aria-checked": $options.checked,
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-label": _ctx.ariaLabel,
    "aria-invalid": _ctx.invalid || void 0,
    onFocus: _cache[0] || (_cache[0] = function() {
      return $options.onFocus && $options.onFocus.apply($options, arguments);
    }),
    onBlur: _cache[1] || (_cache[1] = function() {
      return $options.onBlur && $options.onBlur.apply($options, arguments);
    }),
    onChange: _cache[2] || (_cache[2] = function() {
      return $options.onChange && $options.onChange.apply($options, arguments);
    })
  }, $options.getPTOptions("input")), null, 16, _hoisted_2$x), createBaseVNode("span", mergeProps({
    "class": _ctx.cx("slider")
  }, $options.getPTOptions("slider")), null, 16)], 16, _hoisted_1$K);
}
__name(render$j, "render$j");
script$k.render = render$j;
const _sfc_main$F = /* @__PURE__ */ defineComponent({
  __name: "CustomFormValue",
  props: {
    renderFunction: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const container = ref(null);
    function renderContent() {
      if (container.value) {
        container.value.innerHTML = "";
        const element = props.renderFunction();
        container.value.appendChild(element);
      }
    }
    __name(renderContent, "renderContent");
    onMounted(renderContent);
    watch(() => props.renderFunction, renderContent);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "container",
        ref: container
      }, null, 512);
    };
  }
});
var theme$c = /* @__PURE__ */ __name(function theme27(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-colorpicker {\n    display: inline-block;\n    position: relative;\n}\n\n.p-colorpicker-dragging {\n    cursor: pointer;\n}\n\n.p-colorpicker-preview {\n    width: ".concat(dt2("colorpicker.preview.width"), ";\n    height: ").concat(dt2("colorpicker.preview.height"), ";\n    padding: 0;\n    border: 0 none;\n    border-radius: ").concat(dt2("colorpicker.preview.border.radius"), ";\n    transition: background ").concat(dt2("colorpicker.transition.duration"), ", color ").concat(dt2("colorpicker.transition.duration"), ", border-color ").concat(dt2("colorpicker.transition.duration"), ", outline-color ").concat(dt2("colorpicker.transition.duration"), ", box-shadow ").concat(dt2("colorpicker.transition.duration"), ";\n    outline-color: transparent;\n    cursor: pointer;\n}\n\n.p-colorpicker-preview:enabled:focus-visible {\n    border-color: ").concat(dt2("colorpicker.preview.focus.border.color"), ";\n    box-shadow: ").concat(dt2("colorpicker.preview.focus.ring.shadow"), ";\n    outline: ").concat(dt2("colorpicker.preview.focus.ring.width"), " ").concat(dt2("colorpicker.preview.focus.ring.style"), " ").concat(dt2("colorpicker.preview.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("colorpicker.preview.focus.ring.offset"), ";\n}\n\n.p-colorpicker-panel {\n    background: ").concat(dt2("colorpicker.panel.background"), ";\n    border: 1px solid ").concat(dt2("colorpicker.panel.border.color"), ";\n    border-radius: ").concat(dt2("colorpicker.panel.border.radius"), ";\n    box-shadow: ").concat(dt2("colorpicker.panel.shadow"), ";\n    width: 193px;\n    height: 166px;\n    position: absolute;\n    top: 0;\n    left: 0;\n}\n\n.p-colorpicker-panel-inline {\n    box-shadow: none;\n    position: static;\n}\n\n.p-colorpicker-content {\n    position: relative;\n}\n\n.p-colorpicker-color-selector {\n    width: 150px;\n    height: 150px;\n    top: 8px;\n    left: 8px;\n    position: absolute;\n}\n\n.p-colorpicker-color-background {\n    width: 100%;\n    height: 100%;\n    background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%), linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);\n}\n\n.p-colorpicker-color-handle {\n    position: absolute;\n    top: 0px;\n    left: 150px;\n    border-radius: 100%;\n    width: 10px;\n    height: 10px;\n    border-width: 1px;\n    border-style: solid;\n    margin: -5px 0 0 -5px;\n    cursor: pointer;\n    opacity: 0.85;\n    border-color: ").concat(dt2("colorpicker.handle.color"), ";\n}\n\n.p-colorpicker-hue {\n    width: 17px;\n    height: 150px;\n    top: 8px;\n    left: 167px;\n    position: absolute;\n    opacity: 0.85;\n    background: linear-gradient(0deg,\n        red 0,\n        #ff0 17%,\n        #0f0 33%,\n        #0ff 50%,\n        #00f 67%,\n        #f0f 83%,\n        red);\n}\n\n.p-colorpicker-hue-handle {\n    position: absolute;\n    top: 150px;\n    left: 0px;\n    width: 21px;\n    margin-left: -2px;\n    margin-top: -5px;\n    height: 10px;\n    border-width: 2px;\n    border-style: solid;\n    opacity: 0.85;\n    cursor: pointer;\n    border-color: ").concat(dt2("colorpicker.handle.color"), ";\n}\n");
}, "theme");
var classes$c = {
  root: "p-colorpicker p-component",
  preview: /* @__PURE__ */ __name(function preview(_ref2) {
    var props = _ref2.props;
    return ["p-colorpicker-preview", {
      "p-disabled": props.disabled
    }];
  }, "preview"),
  panel: /* @__PURE__ */ __name(function panel(_ref3) {
    var props = _ref3.props;
    return ["p-colorpicker-panel", {
      "p-colorpicker-panel-inline": props.inline,
      "p-disabled": props.disabled
    }];
  }, "panel"),
  colorSelector: "p-colorpicker-color-selector",
  colorBackground: "p-colorpicker-color-background",
  colorHandle: "p-colorpicker-color-handle",
  hue: "p-colorpicker-hue",
  hueHandle: "p-colorpicker-hue-handle"
};
var ColorPickerStyle = BaseStyle.extend({
  name: "colorpicker",
  theme: theme$c,
  classes: classes$c
});
var script$1$c = {
  name: "BaseColorPicker",
  "extends": script$_,
  props: {
    modelValue: {
      type: null,
      "default": null
    },
    defaultColor: {
      type: null,
      "default": "ff0000"
    },
    inline: {
      type: Boolean,
      "default": false
    },
    format: {
      type: String,
      "default": "hex"
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: String,
      "default": null
    },
    autoZIndex: {
      type: Boolean,
      "default": true
    },
    baseZIndex: {
      type: Number,
      "default": 0
    },
    appendTo: {
      type: [String, Object],
      "default": "body"
    },
    inputId: {
      type: String,
      "default": null
    },
    panelClass: null
  },
  style: ColorPickerStyle,
  provide: /* @__PURE__ */ __name(function provide29() {
    return {
      $pcColorPicker: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$j = {
  name: "ColorPicker",
  "extends": script$1$c,
  inheritAttrs: false,
  emits: ["update:modelValue", "change", "show", "hide"],
  data: /* @__PURE__ */ __name(function data13() {
    return {
      overlayVisible: false
    };
  }, "data"),
  hsbValue: null,
  outsideClickListener: null,
  documentMouseMoveListener: null,
  documentMouseUpListener: null,
  scrollHandler: null,
  resizeListener: null,
  hueDragging: null,
  colorDragging: null,
  selfUpdate: null,
  picker: null,
  colorSelector: null,
  colorHandle: null,
  hueView: null,
  hueHandle: null,
  watch: {
    modelValue: {
      immediate: true,
      handler: /* @__PURE__ */ __name(function handler4(newValue2) {
        this.hsbValue = this.toHSB(newValue2);
        if (this.selfUpdate) this.selfUpdate = false;
        else this.updateUI();
      }, "handler")
    }
  },
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount5() {
    this.unbindOutsideClickListener();
    this.unbindDragListeners();
    this.unbindResizeListener();
    if (this.scrollHandler) {
      this.scrollHandler.destroy();
      this.scrollHandler = null;
    }
    if (this.picker && this.autoZIndex) {
      ZIndex.clear(this.picker);
    }
    this.clearRefs();
  }, "beforeUnmount"),
  mounted: /* @__PURE__ */ __name(function mounted13() {
    this.updateUI();
  }, "mounted"),
  methods: {
    pickColor: /* @__PURE__ */ __name(function pickColor(event) {
      var rect = this.colorSelector.getBoundingClientRect();
      var top = rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);
      var left = rect.left + document.body.scrollLeft;
      var saturation = Math.floor(100 * Math.max(0, Math.min(150, (event.pageX || event.changedTouches[0].pageX) - left)) / 150);
      var brightness = Math.floor(100 * (150 - Math.max(0, Math.min(150, (event.pageY || event.changedTouches[0].pageY) - top))) / 150);
      this.hsbValue = this.validateHSB({
        h: this.hsbValue.h,
        s: saturation,
        b: brightness
      });
      this.selfUpdate = true;
      this.updateColorHandle();
      this.updateInput();
      this.updateModel(event);
    }, "pickColor"),
    pickHue: /* @__PURE__ */ __name(function pickHue(event) {
      var top = this.hueView.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);
      this.hsbValue = this.validateHSB({
        h: Math.floor(360 * (150 - Math.max(0, Math.min(150, (event.pageY || event.changedTouches[0].pageY) - top))) / 150),
        s: 100,
        b: 100
      });
      this.selfUpdate = true;
      this.updateColorSelector();
      this.updateHue();
      this.updateModel(event);
      this.updateInput();
    }, "pickHue"),
    updateModel: /* @__PURE__ */ __name(function updateModel4(event) {
      var value4 = this.modelValue;
      switch (this.format) {
        case "hex":
          value4 = this.HSBtoHEX(this.hsbValue);
          break;
        case "rgb":
          value4 = this.HSBtoRGB(this.hsbValue);
          break;
        case "hsb":
          value4 = this.hsbValue;
          break;
      }
      this.$emit("update:modelValue", value4);
      this.$emit("change", {
        event,
        value: value4
      });
    }, "updateModel"),
    updateColorSelector: /* @__PURE__ */ __name(function updateColorSelector() {
      if (this.colorSelector) {
        var hsbValue = this.validateHSB({
          h: this.hsbValue.h,
          s: 100,
          b: 100
        });
        this.colorSelector.style.backgroundColor = "#" + this.HSBtoHEX(hsbValue);
      }
    }, "updateColorSelector"),
    updateColorHandle: /* @__PURE__ */ __name(function updateColorHandle() {
      if (this.colorHandle) {
        this.colorHandle.style.left = Math.floor(150 * this.hsbValue.s / 100) + "px";
        this.colorHandle.style.top = Math.floor(150 * (100 - this.hsbValue.b) / 100) + "px";
      }
    }, "updateColorHandle"),
    updateHue: /* @__PURE__ */ __name(function updateHue() {
      if (this.hueHandle) {
        this.hueHandle.style.top = Math.floor(150 - 150 * this.hsbValue.h / 360) + "px";
      }
    }, "updateHue"),
    updateInput: /* @__PURE__ */ __name(function updateInput2() {
      if (this.$refs.input) {
        this.$refs.input.style.backgroundColor = "#" + this.HSBtoHEX(this.hsbValue);
      }
    }, "updateInput"),
    updateUI: /* @__PURE__ */ __name(function updateUI() {
      this.updateHue();
      this.updateColorHandle();
      this.updateInput();
      this.updateColorSelector();
    }, "updateUI"),
    validateHSB: /* @__PURE__ */ __name(function validateHSB(hsb) {
      return {
        h: Math.min(360, Math.max(0, hsb.h)),
        s: Math.min(100, Math.max(0, hsb.s)),
        b: Math.min(100, Math.max(0, hsb.b))
      };
    }, "validateHSB"),
    validateRGB: /* @__PURE__ */ __name(function validateRGB(rgb) {
      return {
        r: Math.min(255, Math.max(0, rgb.r)),
        g: Math.min(255, Math.max(0, rgb.g)),
        b: Math.min(255, Math.max(0, rgb.b))
      };
    }, "validateRGB"),
    validateHEX: /* @__PURE__ */ __name(function validateHEX(hex) {
      var len = 6 - hex.length;
      if (len > 0) {
        var o = [];
        for (var i2 = 0; i2 < len; i2++) {
          o.push("0");
        }
        o.push(hex);
        hex = o.join("");
      }
      return hex;
    }, "validateHEX"),
    HEXtoRGB: /* @__PURE__ */ __name(function HEXtoRGB(hex) {
      var hexValue = parseInt(hex.indexOf("#") > -1 ? hex.substring(1) : hex, 16);
      return {
        r: hexValue >> 16,
        g: (hexValue & 65280) >> 8,
        b: hexValue & 255
      };
    }, "HEXtoRGB"),
    HEXtoHSB: /* @__PURE__ */ __name(function HEXtoHSB(hex) {
      return this.RGBtoHSB(this.HEXtoRGB(hex));
    }, "HEXtoHSB"),
    RGBtoHSB: /* @__PURE__ */ __name(function RGBtoHSB(rgb) {
      var hsb = {
        h: 0,
        s: 0,
        b: 0
      };
      var min = Math.min(rgb.r, rgb.g, rgb.b);
      var max = Math.max(rgb.r, rgb.g, rgb.b);
      var delta2 = max - min;
      hsb.b = max;
      hsb.s = max !== 0 ? 255 * delta2 / max : 0;
      if (hsb.s !== 0) {
        if (rgb.r === max) {
          hsb.h = (rgb.g - rgb.b) / delta2;
        } else if (rgb.g === max) {
          hsb.h = 2 + (rgb.b - rgb.r) / delta2;
        } else {
          hsb.h = 4 + (rgb.r - rgb.g) / delta2;
        }
      } else {
        hsb.h = -1;
      }
      hsb.h *= 60;
      if (hsb.h < 0) {
        hsb.h += 360;
      }
      hsb.s *= 100 / 255;
      hsb.b *= 100 / 255;
      return hsb;
    }, "RGBtoHSB"),
    HSBtoRGB: /* @__PURE__ */ __name(function HSBtoRGB(hsb) {
      var rgb = {
        r: null,
        g: null,
        b: null
      };
      var h2 = Math.round(hsb.h);
      var s = Math.round(hsb.s * 255 / 100);
      var v2 = Math.round(hsb.b * 255 / 100);
      if (s === 0) {
        rgb = {
          r: v2,
          g: v2,
          b: v2
        };
      } else {
        var t1 = v2;
        var t2 = (255 - s) * v2 / 255;
        var t3 = (t1 - t2) * (h2 % 60) / 60;
        if (h2 === 360) h2 = 0;
        if (h2 < 60) {
          rgb.r = t1;
          rgb.b = t2;
          rgb.g = t2 + t3;
        } else if (h2 < 120) {
          rgb.g = t1;
          rgb.b = t2;
          rgb.r = t1 - t3;
        } else if (h2 < 180) {
          rgb.g = t1;
          rgb.r = t2;
          rgb.b = t2 + t3;
        } else if (h2 < 240) {
          rgb.b = t1;
          rgb.r = t2;
          rgb.g = t1 - t3;
        } else if (h2 < 300) {
          rgb.b = t1;
          rgb.g = t2;
          rgb.r = t2 + t3;
        } else if (h2 < 360) {
          rgb.r = t1;
          rgb.g = t2;
          rgb.b = t1 - t3;
        } else {
          rgb.r = 0;
          rgb.g = 0;
          rgb.b = 0;
        }
      }
      return {
        r: Math.round(rgb.r),
        g: Math.round(rgb.g),
        b: Math.round(rgb.b)
      };
    }, "HSBtoRGB"),
    RGBtoHEX: /* @__PURE__ */ __name(function RGBtoHEX(rgb) {
      var hex = [rgb.r.toString(16), rgb.g.toString(16), rgb.b.toString(16)];
      for (var key in hex) {
        if (hex[key].length === 1) {
          hex[key] = "0" + hex[key];
        }
      }
      return hex.join("");
    }, "RGBtoHEX"),
    HSBtoHEX: /* @__PURE__ */ __name(function HSBtoHEX(hsb) {
      return this.RGBtoHEX(this.HSBtoRGB(hsb));
    }, "HSBtoHEX"),
    toHSB: /* @__PURE__ */ __name(function toHSB(value4) {
      var hsb;
      if (value4) {
        switch (this.format) {
          case "hex":
            hsb = this.HEXtoHSB(value4);
            break;
          case "rgb":
            hsb = this.RGBtoHSB(value4);
            break;
          case "hsb":
            hsb = value4;
            break;
        }
      } else {
        hsb = this.HEXtoHSB(this.defaultColor);
      }
      return hsb;
    }, "toHSB"),
    onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter2(el) {
      this.updateUI();
      this.alignOverlay();
      this.bindOutsideClickListener();
      this.bindScrollListener();
      this.bindResizeListener();
      if (this.autoZIndex) {
        ZIndex.set("overlay", el, this.baseZIndex, this.$primevue.config.zIndex.overlay);
      }
      this.$emit("show");
    }, "onOverlayEnter"),
    onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave2() {
      this.unbindOutsideClickListener();
      this.unbindScrollListener();
      this.unbindResizeListener();
      this.clearRefs();
      this.$emit("hide");
    }, "onOverlayLeave"),
    onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave2(el) {
      if (this.autoZIndex) {
        ZIndex.clear(el);
      }
    }, "onOverlayAfterLeave"),
    alignOverlay: /* @__PURE__ */ __name(function alignOverlay3() {
      if (this.appendTo === "self") relativePosition(this.picker, this.$refs.input);
      else absolutePosition(this.picker, this.$refs.input);
    }, "alignOverlay"),
    onInputClick: /* @__PURE__ */ __name(function onInputClick2() {
      if (this.disabled) {
        return;
      }
      this.overlayVisible = !this.overlayVisible;
    }, "onInputClick"),
    onInputKeydown: /* @__PURE__ */ __name(function onInputKeydown(event) {
      switch (event.code) {
        case "Space":
          this.overlayVisible = !this.overlayVisible;
          event.preventDefault();
          break;
        case "Escape":
        case "Tab":
          this.overlayVisible = false;
          break;
      }
    }, "onInputKeydown"),
    onColorMousedown: /* @__PURE__ */ __name(function onColorMousedown(event) {
      if (this.disabled) {
        return;
      }
      this.bindDragListeners();
      this.onColorDragStart(event);
    }, "onColorMousedown"),
    onColorDragStart: /* @__PURE__ */ __name(function onColorDragStart(event) {
      if (this.disabled) {
        return;
      }
      this.colorDragging = true;
      this.pickColor(event);
      this.$el.setAttribute("p-colorpicker-dragging", "true");
      !this.isUnstyled && addClass(this.$el, "p-colorpicker-dragging");
      event.preventDefault();
    }, "onColorDragStart"),
    onDrag: /* @__PURE__ */ __name(function onDrag(event) {
      if (this.colorDragging) {
        this.pickColor(event);
        event.preventDefault();
      }
      if (this.hueDragging) {
        this.pickHue(event);
        event.preventDefault();
      }
    }, "onDrag"),
    onDragEnd: /* @__PURE__ */ __name(function onDragEnd() {
      this.colorDragging = false;
      this.hueDragging = false;
      this.$el.setAttribute("p-colorpicker-dragging", "false");
      !this.isUnstyled && removeClass(this.$el, "p-colorpicker-dragging");
      this.unbindDragListeners();
    }, "onDragEnd"),
    onHueMousedown: /* @__PURE__ */ __name(function onHueMousedown(event) {
      if (this.disabled) {
        return;
      }
      this.bindDragListeners();
      this.onHueDragStart(event);
    }, "onHueMousedown"),
    onHueDragStart: /* @__PURE__ */ __name(function onHueDragStart(event) {
      if (this.disabled) {
        return;
      }
      this.hueDragging = true;
      this.pickHue(event);
      !this.isUnstyled && addClass(this.$el, "p-colorpicker-dragging");
    }, "onHueDragStart"),
    isInputClicked: /* @__PURE__ */ __name(function isInputClicked(event) {
      return this.$refs.input && this.$refs.input.isSameNode(event.target);
    }, "isInputClicked"),
    bindDragListeners: /* @__PURE__ */ __name(function bindDragListeners() {
      this.bindDocumentMouseMoveListener();
      this.bindDocumentMouseUpListener();
    }, "bindDragListeners"),
    unbindDragListeners: /* @__PURE__ */ __name(function unbindDragListeners() {
      this.unbindDocumentMouseMoveListener();
      this.unbindDocumentMouseUpListener();
    }, "unbindDragListeners"),
    bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener2() {
      var _this = this;
      if (!this.outsideClickListener) {
        this.outsideClickListener = function(event) {
          if (_this.overlayVisible && _this.picker && !_this.picker.contains(event.target) && !_this.isInputClicked(event)) {
            _this.overlayVisible = false;
          }
        };
        document.addEventListener("click", this.outsideClickListener);
      }
    }, "bindOutsideClickListener"),
    unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener2() {
      if (this.outsideClickListener) {
        document.removeEventListener("click", this.outsideClickListener);
        this.outsideClickListener = null;
      }
    }, "unbindOutsideClickListener"),
    bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener3() {
      var _this2 = this;
      if (!this.scrollHandler) {
        this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function() {
          if (_this2.overlayVisible) {
            _this2.overlayVisible = false;
          }
        });
      }
      this.scrollHandler.bindScrollListener();
    }, "bindScrollListener"),
    unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener3() {
      if (this.scrollHandler) {
        this.scrollHandler.unbindScrollListener();
      }
    }, "unbindScrollListener"),
    bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener3() {
      var _this3 = this;
      if (!this.resizeListener) {
        this.resizeListener = function() {
          if (_this3.overlayVisible && !isTouchDevice()) {
            _this3.overlayVisible = false;
          }
        };
        window.addEventListener("resize", this.resizeListener);
      }
    }, "bindResizeListener"),
    unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener3() {
      if (this.resizeListener) {
        window.removeEventListener("resize", this.resizeListener);
        this.resizeListener = null;
      }
    }, "unbindResizeListener"),
    bindDocumentMouseMoveListener: /* @__PURE__ */ __name(function bindDocumentMouseMoveListener() {
      if (!this.documentMouseMoveListener) {
        this.documentMouseMoveListener = this.onDrag.bind(this);
        document.addEventListener("mousemove", this.documentMouseMoveListener);
      }
    }, "bindDocumentMouseMoveListener"),
    unbindDocumentMouseMoveListener: /* @__PURE__ */ __name(function unbindDocumentMouseMoveListener() {
      if (this.documentMouseMoveListener) {
        document.removeEventListener("mousemove", this.documentMouseMoveListener);
        this.documentMouseMoveListener = null;
      }
    }, "unbindDocumentMouseMoveListener"),
    bindDocumentMouseUpListener: /* @__PURE__ */ __name(function bindDocumentMouseUpListener() {
      if (!this.documentMouseUpListener) {
        this.documentMouseUpListener = this.onDragEnd.bind(this);
        document.addEventListener("mouseup", this.documentMouseUpListener);
      }
    }, "bindDocumentMouseUpListener"),
    unbindDocumentMouseUpListener: /* @__PURE__ */ __name(function unbindDocumentMouseUpListener() {
      if (this.documentMouseUpListener) {
        document.removeEventListener("mouseup", this.documentMouseUpListener);
        this.documentMouseUpListener = null;
      }
    }, "unbindDocumentMouseUpListener"),
    pickerRef: /* @__PURE__ */ __name(function pickerRef(el) {
      this.picker = el;
    }, "pickerRef"),
    colorSelectorRef: /* @__PURE__ */ __name(function colorSelectorRef(el) {
      this.colorSelector = el;
    }, "colorSelectorRef"),
    colorHandleRef: /* @__PURE__ */ __name(function colorHandleRef(el) {
      this.colorHandle = el;
    }, "colorHandleRef"),
    hueViewRef: /* @__PURE__ */ __name(function hueViewRef(el) {
      this.hueView = el;
    }, "hueViewRef"),
    hueHandleRef: /* @__PURE__ */ __name(function hueHandleRef(el) {
      this.hueHandle = el;
    }, "hueHandleRef"),
    clearRefs: /* @__PURE__ */ __name(function clearRefs() {
      this.picker = null;
      this.colorSelector = null;
      this.colorHandle = null;
      this.hueView = null;
      this.hueHandle = null;
    }, "clearRefs"),
    onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick2(event) {
      OverlayEventBus.emit("overlay-click", {
        originalEvent: event,
        target: this.$el
      });
    }, "onOverlayClick")
  },
  components: {
    Portal: script$Q
  }
};
var _hoisted_1$J = ["id", "tabindex", "disabled"];
function render$i(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_Portal = resolveComponent("Portal");
  return openBlock(), createElementBlock("div", mergeProps({
    ref: "container",
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [!_ctx.inline ? (openBlock(), createElementBlock("input", mergeProps({
    key: 0,
    ref: "input",
    id: _ctx.inputId,
    type: "text",
    "class": _ctx.cx("preview"),
    readonly: "readonly",
    tabindex: _ctx.tabindex,
    disabled: _ctx.disabled,
    onClick: _cache[0] || (_cache[0] = function() {
      return $options.onInputClick && $options.onInputClick.apply($options, arguments);
    }),
    onKeydown: _cache[1] || (_cache[1] = function() {
      return $options.onInputKeydown && $options.onInputKeydown.apply($options, arguments);
    })
  }, _ctx.ptm("preview")), null, 16, _hoisted_1$J)) : createCommentVNode("", true), createVNode(_component_Portal, {
    appendTo: _ctx.appendTo,
    disabled: _ctx.inline
  }, {
    "default": withCtx(function() {
      return [createVNode(Transition, mergeProps({
        name: "p-connected-overlay",
        onEnter: $options.onOverlayEnter,
        onLeave: $options.onOverlayLeave,
        onAfterLeave: $options.onOverlayAfterLeave
      }, _ctx.ptm("transition")), {
        "default": withCtx(function() {
          return [(_ctx.inline ? true : $data.overlayVisible) ? (openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            ref: $options.pickerRef,
            "class": [_ctx.cx("panel"), _ctx.panelClass],
            onClick: _cache[10] || (_cache[10] = function() {
              return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
            })
          }, _ctx.ptm("panel")), [createBaseVNode("div", mergeProps({
            "class": _ctx.cx("content")
          }, _ctx.ptm("content")), [createBaseVNode("div", mergeProps({
            ref: $options.colorSelectorRef,
            "class": _ctx.cx("colorSelector"),
            onMousedown: _cache[2] || (_cache[2] = function($event) {
              return $options.onColorMousedown($event);
            }),
            onTouchstart: _cache[3] || (_cache[3] = function($event) {
              return $options.onColorDragStart($event);
            }),
            onTouchmove: _cache[4] || (_cache[4] = function($event) {
              return $options.onDrag($event);
            }),
            onTouchend: _cache[5] || (_cache[5] = function($event) {
              return $options.onDragEnd();
            })
          }, _ctx.ptm("colorSelector")), [createBaseVNode("div", mergeProps({
            "class": _ctx.cx("colorBackground")
          }, _ctx.ptm("colorBackground")), [createBaseVNode("div", mergeProps({
            ref: $options.colorHandleRef,
            "class": _ctx.cx("colorHandle")
          }, _ctx.ptm("colorHandle")), null, 16)], 16)], 16), createBaseVNode("div", mergeProps({
            ref: $options.hueViewRef,
            "class": _ctx.cx("hue"),
            onMousedown: _cache[6] || (_cache[6] = function($event) {
              return $options.onHueMousedown($event);
            }),
            onTouchstart: _cache[7] || (_cache[7] = function($event) {
              return $options.onHueDragStart($event);
            }),
            onTouchmove: _cache[8] || (_cache[8] = function($event) {
              return $options.onDrag($event);
            }),
            onTouchend: _cache[9] || (_cache[9] = function($event) {
              return $options.onDragEnd();
            })
          }, _ctx.ptm("hue")), [createBaseVNode("div", mergeProps({
            ref: $options.hueHandleRef,
            "class": _ctx.cx("hueHandle")
          }, _ctx.ptm("hueHandle")), null, 16)], 16)], 16)], 16)) : createCommentVNode("", true)];
        }),
        _: 1
      }, 16, ["onEnter", "onLeave", "onAfterLeave"])];
    }),
    _: 1
  }, 8, ["appendTo", "disabled"])], 16);
}
__name(render$i, "render$i");
script$j.render = render$i;
const _hoisted_1$I = { class: "color-picker-wrapper flex items-center gap-2" };
const _hoisted_2$w = { class: "flex items-center justify-between p-2" };
const _sfc_main$E = /* @__PURE__ */ defineComponent({
  __name: "FormColorPicker",
  props: /* @__PURE__ */ mergeModels({
    defaultValue: {},
    label: {}
  }, {
    "modelValue": {},
    "modelModifiers": {}
  }),
  emits: ["update:modelValue"],
  setup(__props) {
    const modelValue3 = useModel(__props, "modelValue");
    const props = __props;
    const resetColor = /* @__PURE__ */ __name(() => {
      modelValue3.value = props.defaultValue || "#000000";
    }, "resetColor");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$I, [
        createVNode(unref(script$j), {
          modelValue: modelValue3.value,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue3.value = $event)
        }, {
          header: withCtx(() => [
            createBaseVNode("div", _hoisted_2$w, [
              createBaseVNode("span", null, toDisplayString$1(props.label), 1),
              props.defaultValue ? (openBlock(), createBlock(unref(script$R), {
                key: 0,
                icon: "pi pi-refresh",
                text: "",
                size: "small",
                onClick: resetColor
              })) : createCommentVNode("", true)
            ])
          ]),
          _: 1
        }, 8, ["modelValue"]),
        createVNode(unref(script$G), {
          modelValue: modelValue3.value,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue3.value = $event),
          class: "w-28",
          placeholder: _ctx.label
        }, null, 8, ["modelValue", "placeholder"])
      ]);
    };
  }
});
const _hoisted_1$H = { class: "image-upload-wrapper" };
const _hoisted_2$v = { class: "flex gap-2 items-center" };
const _hoisted_3$h = ["src"];
const _hoisted_4$c = {
  key: 1,
  class: "pi pi-image text-gray-400 text-xl"
};
const _hoisted_5$9 = { class: "flex flex-col gap-2" };
const _sfc_main$D = /* @__PURE__ */ defineComponent({
  __name: "FormImageUpload",
  props: {
    modelValue: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit2 = __emit;
    const fileInput2 = ref(null);
    const triggerFileInput = /* @__PURE__ */ __name(() => {
      fileInput2.value?.click();
    }, "triggerFileInput");
    const handleFileUpload = /* @__PURE__ */ __name((event) => {
      const target = event.target;
      if (target.files && target.files[0]) {
        const file = target.files[0];
        const reader = new FileReader();
        reader.onload = (e2) => {
          emit2("update:modelValue", e2.target?.result);
        };
        reader.readAsDataURL(file);
      }
    }, "handleFileUpload");
    const clearImage = /* @__PURE__ */ __name(() => {
      emit2("update:modelValue", "");
      if (fileInput2.value) {
        fileInput2.value.value = "";
      }
    }, "clearImage");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$H, [
        createBaseVNode("div", _hoisted_2$v, [
          createBaseVNode("div", {
            class: normalizeClass(["preview-box border rounded p-2 w-16 h-16 flex items-center justify-center", { "bg-gray-100 dark:bg-gray-800": !_ctx.modelValue }])
          }, [
            _ctx.modelValue ? (openBlock(), createElementBlock("img", {
              key: 0,
              src: _ctx.modelValue,
              class: "max-w-full max-h-full object-contain"
            }, null, 8, _hoisted_3$h)) : (openBlock(), createElementBlock("i", _hoisted_4$c))
          ], 2),
          createBaseVNode("div", _hoisted_5$9, [
            createVNode(unref(script$R), {
              icon: "pi pi-upload",
              label: _ctx.$t("g.upload"),
              size: "small",
              onClick: triggerFileInput
            }, null, 8, ["label"]),
            _ctx.modelValue ? (openBlock(), createBlock(unref(script$R), {
              key: 0,
              class: "w-full",
              outlined: "",
              icon: "pi pi-trash",
              severity: "danger",
              size: "small",
              onClick: clearImage
            })) : createCommentVNode("", true)
          ])
        ]),
        createBaseVNode("input", {
          ref_key: "fileInput",
          ref: fileInput2,
          type: "file",
          class: "hidden",
          accept: "image/*",
          onChange: handleFileUpload
        }, null, 544)
      ]);
    };
  }
});
var theme$b = /* @__PURE__ */ __name(function theme28(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-slider {\n    position: relative;\n    background: ".concat(dt2("slider.track.background"), ";\n    border-radius: ").concat(dt2("slider.border.radius"), ";\n}\n\n.p-slider-handle {\n    cursor: grab;\n    touch-action: none;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    height: ").concat(dt2("slider.handle.height"), ";\n    width: ").concat(dt2("slider.handle.width"), ";\n    background: ").concat(dt2("slider.handle.background"), ";\n    border-radius: ").concat(dt2("slider.handle.border.radius"), ";\n    transition: background ").concat(dt2("slider.transition.duration"), ", color ").concat(dt2("slider.transition.duration"), ", border-color ").concat(dt2("slider.transition.duration"), ", box-shadow ").concat(dt2("slider.transition.duration"), ", outline-color ").concat(dt2("slider.transition.duration"), ';\n    outline-color: transparent;\n}\n\n.p-slider-handle::before {\n    content: "";\n    width: ').concat(dt2("slider.handle.content.width"), ";\n    height: ").concat(dt2("slider.handle.content.height"), ";\n    display: block;\n    background: ").concat(dt2("slider.handle.content.background"), ";\n    border-radius: ").concat(dt2("slider.handle.content.border.radius"), ";\n    box-shadow: ").concat(dt2("slider.handle.content.shadow"), ";\n    transition: background ").concat(dt2("slider.transition.duration"), ";\n}\n\n.p-slider:not(.p-disabled) .p-slider-handle:hover {\n    background: ").concat(dt2("slider.handle.hover.background"), ";\n}\n\n.p-slider:not(.p-disabled) .p-slider-handle:hover::before {\n    background: ").concat(dt2("slider.handle.content.hover.background"), ";\n}\n\n.p-slider-handle:focus-visible {\n    border-color: ").concat(dt2("slider.handle.focus.border.color"), ";\n    box-shadow: ").concat(dt2("slider.handle.focus.ring.shadow"), ";\n    outline: ").concat(dt2("slider.handle.focus.ring.width"), " ").concat(dt2("slider.handle.focus.ring.style"), " ").concat(dt2("slider.handle.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("slider.handle.focus.ring.offset"), ";\n}\n\n.p-slider-range {\n    display: block;\n    background: ").concat(dt2("slider.range.background"), ";\n    border-radius: ").concat(dt2("slider.border.radius"), ";\n}\n\n.p-slider.p-slider-horizontal {\n    height: ").concat(dt2("slider.track.size"), ";\n}\n\n.p-slider-horizontal .p-slider-range {\n    top: 0;\n    left: 0;\n    height: 100%;\n}\n\n.p-slider-horizontal .p-slider-handle {\n    top: 50%;\n    margin-top: calc(-1 * calc(").concat(dt2("slider.handle.height"), " / 2));\n    margin-left: calc(-1 * calc(").concat(dt2("slider.handle.width"), " / 2));\n}\n\n.p-slider-vertical {\n    min-height: 100px;\n    width: ").concat(dt2("slider.track.size"), ";\n}\n\n.p-slider-vertical .p-slider-handle {\n    left: 50%;\n    margin-left: calc(-1 * calc(").concat(dt2("slider.handle.width"), " / 2));\n    margin-bottom: calc(-1 * calc(").concat(dt2("slider.handle.height"), " / 2));\n}\n\n.p-slider-vertical .p-slider-range {\n    bottom: 0;\n    left: 0;\n    width: 100%;\n}\n");
}, "theme");
var inlineStyles = {
  handle: {
    position: "absolute"
  },
  range: {
    position: "absolute"
  }
};
var classes$b = {
  root: /* @__PURE__ */ __name(function root17(_ref2) {
    var props = _ref2.props;
    return ["p-slider p-component", {
      "p-disabled": props.disabled,
      "p-slider-horizontal": props.orientation === "horizontal",
      "p-slider-vertical": props.orientation === "vertical"
    }];
  }, "root"),
  range: "p-slider-range",
  handle: "p-slider-handle"
};
var SliderStyle = BaseStyle.extend({
  name: "slider",
  theme: theme$b,
  classes: classes$b,
  inlineStyles
});
var script$1$b = {
  name: "BaseSlider",
  "extends": script$_,
  props: {
    modelValue: [Number, Array],
    min: {
      type: Number,
      "default": 0
    },
    max: {
      type: Number,
      "default": 100
    },
    orientation: {
      type: String,
      "default": "horizontal"
    },
    step: {
      type: Number,
      "default": null
    },
    range: {
      type: Boolean,
      "default": false
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: Number,
      "default": 0
    },
    ariaLabelledby: {
      type: String,
      "default": null
    },
    ariaLabel: {
      type: String,
      "default": null
    }
  },
  style: SliderStyle,
  provide: /* @__PURE__ */ __name(function provide30() {
    return {
      $pcSlider: this,
      $parentInstance: this
    };
  }, "provide")
};
function _toConsumableArray$7(r) {
  return _arrayWithoutHoles$7(r) || _iterableToArray$7(r) || _unsupportedIterableToArray$9(r) || _nonIterableSpread$7();
}
__name(_toConsumableArray$7, "_toConsumableArray$7");
function _nonIterableSpread$7() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$7, "_nonIterableSpread$7");
function _unsupportedIterableToArray$9(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$9(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$9(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$9, "_unsupportedIterableToArray$9");
function _iterableToArray$7(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$7, "_iterableToArray$7");
function _arrayWithoutHoles$7(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$9(r);
}
__name(_arrayWithoutHoles$7, "_arrayWithoutHoles$7");
function _arrayLikeToArray$9(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$9, "_arrayLikeToArray$9");
var script$i = {
  name: "Slider",
  "extends": script$1$b,
  inheritAttrs: false,
  emits: ["update:modelValue", "change", "slideend"],
  dragging: false,
  handleIndex: null,
  initX: null,
  initY: null,
  barWidth: null,
  barHeight: null,
  dragListener: null,
  dragEndListener: null,
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount6() {
    this.unbindDragListeners();
  }, "beforeUnmount"),
  methods: {
    updateDomData: /* @__PURE__ */ __name(function updateDomData() {
      var rect = this.$el.getBoundingClientRect();
      this.initX = rect.left + getWindowScrollLeft();
      this.initY = rect.top + getWindowScrollTop();
      this.barWidth = this.$el.offsetWidth;
      this.barHeight = this.$el.offsetHeight;
    }, "updateDomData"),
    setValue: /* @__PURE__ */ __name(function setValue(event) {
      var handleValue;
      var pageX = event.touches ? event.touches[0].pageX : event.pageX;
      var pageY = event.touches ? event.touches[0].pageY : event.pageY;
      if (this.orientation === "horizontal") handleValue = (pageX - this.initX) * 100 / this.barWidth;
      else handleValue = (this.initY + this.barHeight - pageY) * 100 / this.barHeight;
      var newValue2 = (this.max - this.min) * (handleValue / 100) + this.min;
      if (this.step) {
        var oldValue2 = this.range ? this.value[this.handleIndex] : this.value;
        var diff2 = newValue2 - oldValue2;
        if (diff2 < 0) newValue2 = oldValue2 + Math.ceil(newValue2 / this.step - oldValue2 / this.step) * this.step;
        else if (diff2 > 0) newValue2 = oldValue2 + Math.floor(newValue2 / this.step - oldValue2 / this.step) * this.step;
      } else {
        newValue2 = Math.floor(newValue2);
      }
      this.updateModel(event, newValue2);
    }, "setValue"),
    updateModel: /* @__PURE__ */ __name(function updateModel5(event, value4) {
      var newValue2 = parseFloat(value4.toFixed(10));
      var modelValue3;
      if (this.range) {
        modelValue3 = this.value ? _toConsumableArray$7(this.value) : [];
        if (this.handleIndex == 0) {
          if (newValue2 < this.min) newValue2 = this.min;
          else if (newValue2 >= this.max) newValue2 = this.max;
          modelValue3[0] = newValue2;
        } else {
          if (newValue2 > this.max) newValue2 = this.max;
          else if (newValue2 <= this.min) newValue2 = this.min;
          modelValue3[1] = newValue2;
        }
      } else {
        if (newValue2 < this.min) newValue2 = this.min;
        else if (newValue2 > this.max) newValue2 = this.max;
        modelValue3 = newValue2;
      }
      this.$emit("update:modelValue", modelValue3);
      this.$emit("change", modelValue3);
    }, "updateModel"),
    onDragStart: /* @__PURE__ */ __name(function onDragStart(event, index2) {
      if (this.disabled) {
        return;
      }
      this.$el.setAttribute("data-p-sliding", true);
      this.dragging = true;
      this.updateDomData();
      if (this.range && this.value[0] === this.max) {
        this.handleIndex = 0;
      } else {
        this.handleIndex = index2;
      }
      event.currentTarget.focus();
      event.preventDefault();
    }, "onDragStart"),
    onDrag: /* @__PURE__ */ __name(function onDrag2(event) {
      if (this.dragging) {
        this.setValue(event);
        event.preventDefault();
      }
    }, "onDrag"),
    onDragEnd: /* @__PURE__ */ __name(function onDragEnd2(event) {
      if (this.dragging) {
        this.dragging = false;
        this.$el.setAttribute("data-p-sliding", false);
        this.$emit("slideend", {
          originalEvent: event,
          value: this.value
        });
      }
    }, "onDragEnd"),
    onBarClick: /* @__PURE__ */ __name(function onBarClick(event) {
      if (this.disabled) {
        return;
      }
      if (getAttribute(event.target, "data-pc-section") !== "handle") {
        this.updateDomData();
        this.setValue(event);
      }
    }, "onBarClick"),
    onMouseDown: /* @__PURE__ */ __name(function onMouseDown2(event, index2) {
      this.bindDragListeners();
      this.onDragStart(event, index2);
    }, "onMouseDown"),
    onKeyDown: /* @__PURE__ */ __name(function onKeyDown5(event, index2) {
      this.handleIndex = index2;
      switch (event.code) {
        case "ArrowDown":
        case "ArrowLeft":
          this.decrementValue(event, index2);
          event.preventDefault();
          break;
        case "ArrowUp":
        case "ArrowRight":
          this.incrementValue(event, index2);
          event.preventDefault();
          break;
        case "PageDown":
          this.decrementValue(event, index2, true);
          event.preventDefault();
          break;
        case "PageUp":
          this.incrementValue(event, index2, true);
          event.preventDefault();
          break;
        case "Home":
          this.updateModel(event, this.min);
          event.preventDefault();
          break;
        case "End":
          this.updateModel(event, this.max);
          event.preventDefault();
          break;
      }
    }, "onKeyDown"),
    decrementValue: /* @__PURE__ */ __name(function decrementValue(event, index2) {
      var pageKey = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
      var newValue2;
      if (this.range) {
        if (this.step) newValue2 = this.value[index2] - this.step;
        else newValue2 = this.value[index2] - 1;
      } else {
        if (this.step) newValue2 = this.value - this.step;
        else if (!this.step && pageKey) newValue2 = this.value - 10;
        else newValue2 = this.value - 1;
      }
      this.updateModel(event, newValue2);
      event.preventDefault();
    }, "decrementValue"),
    incrementValue: /* @__PURE__ */ __name(function incrementValue(event, index2) {
      var pageKey = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
      var newValue2;
      if (this.range) {
        if (this.step) newValue2 = this.value[index2] + this.step;
        else newValue2 = this.value[index2] + 1;
      } else {
        if (this.step) newValue2 = this.value + this.step;
        else if (!this.step && pageKey) newValue2 = this.value + 10;
        else newValue2 = this.value + 1;
      }
      this.updateModel(event, newValue2);
      event.preventDefault();
    }, "incrementValue"),
    bindDragListeners: /* @__PURE__ */ __name(function bindDragListeners2() {
      if (!this.dragListener) {
        this.dragListener = this.onDrag.bind(this);
        document.addEventListener("mousemove", this.dragListener);
      }
      if (!this.dragEndListener) {
        this.dragEndListener = this.onDragEnd.bind(this);
        document.addEventListener("mouseup", this.dragEndListener);
      }
    }, "bindDragListeners"),
    unbindDragListeners: /* @__PURE__ */ __name(function unbindDragListeners2() {
      if (this.dragListener) {
        document.removeEventListener("mousemove", this.dragListener);
        this.dragListener = null;
      }
      if (this.dragEndListener) {
        document.removeEventListener("mouseup", this.dragEndListener);
        this.dragEndListener = null;
      }
    }, "unbindDragListeners")
  },
  computed: {
    value: /* @__PURE__ */ __name(function value2() {
      var _this$modelValue3;
      if (this.range) {
        var _this$modelValue$, _this$modelValue, _this$modelValue$2, _this$modelValue2;
        return [(_this$modelValue$ = (_this$modelValue = this.modelValue) === null || _this$modelValue === void 0 ? void 0 : _this$modelValue[0]) !== null && _this$modelValue$ !== void 0 ? _this$modelValue$ : this.min, (_this$modelValue$2 = (_this$modelValue2 = this.modelValue) === null || _this$modelValue2 === void 0 ? void 0 : _this$modelValue2[1]) !== null && _this$modelValue$2 !== void 0 ? _this$modelValue$2 : this.max];
      }
      return (_this$modelValue3 = this.modelValue) !== null && _this$modelValue3 !== void 0 ? _this$modelValue3 : this.min;
    }, "value"),
    horizontal: /* @__PURE__ */ __name(function horizontal() {
      return this.orientation === "horizontal";
    }, "horizontal"),
    vertical: /* @__PURE__ */ __name(function vertical() {
      return this.orientation === "vertical";
    }, "vertical"),
    rangeStyle: /* @__PURE__ */ __name(function rangeStyle() {
      if (this.range) {
        var rangeSliderWidth = this.rangeEndPosition > this.rangeStartPosition ? this.rangeEndPosition - this.rangeStartPosition : this.rangeStartPosition - this.rangeEndPosition;
        var rangeSliderPosition = this.rangeEndPosition > this.rangeStartPosition ? this.rangeStartPosition : this.rangeEndPosition;
        if (this.horizontal) return {
          left: rangeSliderPosition + "%",
          width: rangeSliderWidth + "%"
        };
        else return {
          bottom: rangeSliderPosition + "%",
          height: rangeSliderWidth + "%"
        };
      } else {
        if (this.horizontal) return {
          width: this.handlePosition + "%"
        };
        else return {
          height: this.handlePosition + "%"
        };
      }
    }, "rangeStyle"),
    handleStyle: /* @__PURE__ */ __name(function handleStyle() {
      if (this.horizontal) return {
        left: this.handlePosition + "%"
      };
      else return {
        bottom: this.handlePosition + "%"
      };
    }, "handleStyle"),
    handlePosition: /* @__PURE__ */ __name(function handlePosition() {
      if (this.value < this.min) return 0;
      else if (this.value > this.max) return 100;
      else return (this.value - this.min) * 100 / (this.max - this.min);
    }, "handlePosition"),
    rangeStartPosition: /* @__PURE__ */ __name(function rangeStartPosition() {
      if (this.value && this.value[0]) return (this.value[0] < this.min ? 0 : this.value[0] - this.min) * 100 / (this.max - this.min);
      else return 0;
    }, "rangeStartPosition"),
    rangeEndPosition: /* @__PURE__ */ __name(function rangeEndPosition() {
      if (this.value && this.value.length === 2) return (this.value[1] > this.max ? 100 : this.value[1] - this.min) * 100 / (this.max - this.min);
      else return 100;
    }, "rangeEndPosition"),
    rangeStartHandleStyle: /* @__PURE__ */ __name(function rangeStartHandleStyle() {
      if (this.horizontal) return {
        left: this.rangeStartPosition + "%"
      };
      else return {
        bottom: this.rangeStartPosition + "%"
      };
    }, "rangeStartHandleStyle"),
    rangeEndHandleStyle: /* @__PURE__ */ __name(function rangeEndHandleStyle() {
      if (this.horizontal) return {
        left: this.rangeEndPosition + "%"
      };
      else return {
        bottom: this.rangeEndPosition + "%"
      };
    }, "rangeEndHandleStyle")
  }
};
var _hoisted_1$G = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
var _hoisted_2$u = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
var _hoisted_3$g = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
function render$h(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    onClick: _cache[15] || (_cache[15] = function() {
      return $options.onBarClick && $options.onBarClick.apply($options, arguments);
    })
  }, _ctx.ptmi("root"), {
    "data-p-sliding": false
  }), [createBaseVNode("span", mergeProps({
    "class": _ctx.cx("range"),
    style: [_ctx.sx("range"), $options.rangeStyle]
  }, _ctx.ptm("range")), null, 16), !_ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
    key: 0,
    "class": _ctx.cx("handle"),
    style: [_ctx.sx("handle"), $options.handleStyle],
    onTouchstartPassive: _cache[0] || (_cache[0] = function($event) {
      return $options.onDragStart($event);
    }),
    onTouchmovePassive: _cache[1] || (_cache[1] = function($event) {
      return $options.onDrag($event);
    }),
    onTouchend: _cache[2] || (_cache[2] = function($event) {
      return $options.onDragEnd($event);
    }),
    onMousedown: _cache[3] || (_cache[3] = function($event) {
      return $options.onMouseDown($event);
    }),
    onKeydown: _cache[4] || (_cache[4] = function($event) {
      return $options.onKeyDown($event);
    }),
    tabindex: _ctx.tabindex,
    role: "slider",
    "aria-valuemin": _ctx.min,
    "aria-valuenow": _ctx.modelValue,
    "aria-valuemax": _ctx.max,
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-label": _ctx.ariaLabel,
    "aria-orientation": _ctx.orientation
  }, _ctx.ptm("handle")), null, 16, _hoisted_1$G)) : createCommentVNode("", true), _ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
    key: 1,
    "class": _ctx.cx("handle"),
    style: [_ctx.sx("handle"), $options.rangeStartHandleStyle],
    onTouchstartPassive: _cache[5] || (_cache[5] = function($event) {
      return $options.onDragStart($event, 0);
    }),
    onTouchmovePassive: _cache[6] || (_cache[6] = function($event) {
      return $options.onDrag($event);
    }),
    onTouchend: _cache[7] || (_cache[7] = function($event) {
      return $options.onDragEnd($event);
    }),
    onMousedown: _cache[8] || (_cache[8] = function($event) {
      return $options.onMouseDown($event, 0);
    }),
    onKeydown: _cache[9] || (_cache[9] = function($event) {
      return $options.onKeyDown($event, 0);
    }),
    tabindex: _ctx.tabindex,
    role: "slider",
    "aria-valuemin": _ctx.min,
    "aria-valuenow": _ctx.modelValue ? _ctx.modelValue[0] : null,
    "aria-valuemax": _ctx.max,
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-label": _ctx.ariaLabel,
    "aria-orientation": _ctx.orientation
  }, _ctx.ptm("startHandler")), null, 16, _hoisted_2$u)) : createCommentVNode("", true), _ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
    key: 2,
    "class": _ctx.cx("handle"),
    style: [_ctx.sx("handle"), $options.rangeEndHandleStyle],
    onTouchstartPassive: _cache[10] || (_cache[10] = function($event) {
      return $options.onDragStart($event, 1);
    }),
    onTouchmovePassive: _cache[11] || (_cache[11] = function($event) {
      return $options.onDrag($event);
    }),
    onTouchend: _cache[12] || (_cache[12] = function($event) {
      return $options.onDragEnd($event);
    }),
    onMousedown: _cache[13] || (_cache[13] = function($event) {
      return $options.onMouseDown($event, 1);
    }),
    onKeydown: _cache[14] || (_cache[14] = function($event) {
      return $options.onKeyDown($event, 1);
    }),
    tabindex: _ctx.tabindex,
    role: "slider",
    "aria-valuemin": _ctx.min,
    "aria-valuenow": _ctx.modelValue ? _ctx.modelValue[1] : null,
    "aria-valuemax": _ctx.max,
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-label": _ctx.ariaLabel,
    "aria-orientation": _ctx.orientation
  }, _ctx.ptm("endHandler")), null, 16, _hoisted_3$g)) : createCommentVNode("", true)], 16);
}
__name(render$h, "render$h");
script$i.render = render$h;
const _hoisted_1$F = { class: "input-slider flex flex-row items-center gap-2" };
const _sfc_main$C = /* @__PURE__ */ defineComponent({
  __name: "InputSlider",
  props: {
    modelValue: {},
    inputClass: {},
    sliderClass: {},
    min: {},
    max: {},
    step: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit2 = __emit;
    const localValue = ref(props.modelValue);
    watch(
      () => props.modelValue,
      (newValue2) => {
        localValue.value = newValue2;
      }
    );
    const updateValue3 = /* @__PURE__ */ __name((newValue2) => {
      if (newValue2 === null) {
        newValue2 = Number(props.min) || 0;
      }
      const min = Number(props.min ?? Number.NEGATIVE_INFINITY);
      const max = Number(props.max ?? Number.POSITIVE_INFINITY);
      const step3 = Number(props.step) || 1;
      newValue2 = Math.max(min, Math.min(max, newValue2));
      newValue2 = Math.round(newValue2 / step3) * step3;
      localValue.value = newValue2;
      emit2("update:modelValue", newValue2);
    }, "updateValue");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$F, [
        createVNode(unref(script$i), {
          modelValue: _ctx.modelValue,
          "onUpdate:modelValue": updateValue3,
          class: normalizeClass(["slider-part", _ctx.sliderClass]),
          min: _ctx.min,
          max: _ctx.max,
          step: _ctx.step
        }, null, 8, ["modelValue", "class", "min", "max", "step"]),
        createVNode(unref(script$l), {
          modelValue: _ctx.modelValue,
          "onUpdate:modelValue": updateValue3,
          class: normalizeClass(["input-part", _ctx.inputClass]),
          "max-fraction-digits": 3,
          min: _ctx.min,
          max: _ctx.max,
          step: _ctx.step,
          allowEmpty: false
        }, null, 8, ["modelValue", "class", "min", "max", "step"])
      ]);
    };
  }
});
const _withScopeId$i = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-e4e3022d"), n = n(), popScopeId(), n), "_withScopeId$i");
const _hoisted_1$E = { class: "flex flex-row items-center gap-2" };
const _hoisted_2$t = { class: "form-label flex flex-grow items-center" };
const _hoisted_3$f = {
  key: 0,
  class: "pi pi-info-circle bg-transparent"
};
const _hoisted_4$b = { class: "form-input flex justify-end" };
const _sfc_main$B = /* @__PURE__ */ defineComponent({
  __name: "FormItem",
  props: /* @__PURE__ */ mergeModels({
    item: {},
    id: {},
    labelClass: {}
  }, {
    "formValue": {},
    "formValueModifiers": {}
  }),
  emits: ["update:formValue"],
  setup(__props) {
    const formValue = useModel(__props, "formValue");
    const props = __props;
    function getFormAttrs(item3) {
      const attrs4 = { ...item3.attrs || {} };
      const inputType = item3.type;
      if (typeof inputType === "function") {
        attrs4["renderFunction"] = () => inputType(
          props.item.name,
          (v2) => formValue.value = v2,
          formValue.value,
          item3.attrs
        );
      }
      switch (item3.type) {
        case "combo":
          attrs4["options"] = typeof item3.options === "function" ? (
            // @ts-expect-error: Audit and deprecate usage of legacy options type:
            // (value) => [string | {text: string, value: string}]
            item3.options(formValue.value)
          ) : item3.options;
          if (typeof item3.options[0] !== "string") {
            attrs4["optionLabel"] = "text";
            attrs4["optionValue"] = "value";
          }
          break;
      }
      return attrs4;
    }
    __name(getFormAttrs, "getFormAttrs");
    function getFormComponent(item3) {
      if (typeof item3.type === "function") {
        return _sfc_main$F;
      }
      switch (item3.type) {
        case "boolean":
          return script$k;
        case "number":
          return script$l;
        case "slider":
          return _sfc_main$C;
        case "combo":
          return script$o;
        case "image":
          return _sfc_main$D;
        case "color":
          return _sfc_main$E;
        default:
          return script$G;
      }
    }
    __name(getFormComponent, "getFormComponent");
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return openBlock(), createElementBlock("div", _hoisted_1$E, [
        createBaseVNode("div", _hoisted_2$t, [
          createBaseVNode("span", {
            class: normalizeClass(["text-muted", props.labelClass])
          }, [
            renderSlot(_ctx.$slots, "name-prefix", {}, void 0, true),
            createTextVNode(" " + toDisplayString$1(props.item.name) + " ", 1),
            props.item.tooltip ? withDirectives((openBlock(), createElementBlock("i", _hoisted_3$f, null, 512)), [
              [_directive_tooltip, props.item.tooltip]
            ]) : createCommentVNode("", true),
            renderSlot(_ctx.$slots, "name-suffix", {}, void 0, true)
          ], 2)
        ]),
        createBaseVNode("div", _hoisted_4$b, [
          (openBlock(), createBlock(resolveDynamicComponent(markRaw(getFormComponent(props.item))), mergeProps({
            id: props.id,
            modelValue: formValue.value,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formValue.value = $event)
          }, getFormAttrs(props.item)), null, 16, ["id", "modelValue"]))
        ])
      ]);
    };
  }
});
const FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-e4e3022d"]]);
const _sfc_main$A = /* @__PURE__ */ defineComponent({
  __name: "SettingItem",
  props: {
    setting: {}
  },
  setup(__props) {
    const props = __props;
    const { t: t2 } = useI18n();
    function translateOptions(options4) {
      return options4.map((option3) => {
        const optionLabel = typeof option3 === "string" ? option3 : option3.text;
        const optionValue = typeof option3 === "string" ? option3 : option3.value;
        return {
          text: t2(
            `settings.${normalizeI18nKey(props.setting.id)}.options.${normalizeI18nKey(optionLabel)}`,
            optionLabel
          ),
          value: optionValue
        };
      });
    }
    __name(translateOptions, "translateOptions");
    const formItem = computed(() => {
      const normalizedId = normalizeI18nKey(props.setting.id);
      return {
        ...props.setting,
        name: t2(`settings.${normalizedId}.name`, props.setting.name),
        tooltip: props.setting.tooltip ? t2(`settings.${normalizedId}.tooltip`, props.setting.tooltip) : void 0,
        options: props.setting.options ? translateOptions(props.setting.options) : void 0
      };
    });
    const settingStore = useSettingStore();
    const settingValue = computed(() => settingStore.get(props.setting.id));
    const updateSettingValue = /* @__PURE__ */ __name((value4) => {
      settingStore.set(props.setting.id, value4);
    }, "updateSettingValue");
    return (_ctx, _cache) => {
      return openBlock(), createBlock(FormItem, {
        item: formItem.value,
        id: _ctx.setting.id,
        formValue: settingValue.value,
        "onUpdate:formValue": updateSettingValue
      }, {
        "name-prefix": withCtx(() => [
          _ctx.setting.experimental ? (openBlock(), createBlock(unref(script$x), {
            key: 0,
            value: _ctx.$t("g.experimental")
          }, null, 8, ["value"])) : createCommentVNode("", true),
          _ctx.setting.deprecated ? (openBlock(), createBlock(unref(script$x), {
            key: 1,
            value: _ctx.$t("g.deprecated"),
            severity: "danger"
          }, null, 8, ["value"])) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["item", "id", "formValue"]);
    };
  }
});
const _hoisted_1$D = { class: "setting-group" };
const _sfc_main$z = /* @__PURE__ */ defineComponent({
  __name: "SettingGroup",
  props: {
    group: {},
    divider: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$D, [
        _ctx.divider ? (openBlock(), createBlock(unref(script$O), { key: 0 })) : createCommentVNode("", true),
        createBaseVNode("h3", null, toDisplayString$1(_ctx.$t(`settingsCategories.${unref(normalizeI18nKey)(_ctx.group.label)}`, _ctx.group.label)), 1),
        (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.group.settings, (setting) => {
          return openBlock(), createElementBlock("div", {
            key: setting.id,
            class: "setting-item mb-4"
          }, [
            createVNode(_sfc_main$A, { setting }, null, 8, ["setting"])
          ]);
        }), 128))
      ]);
    };
  }
});
const _hoisted_1$C = { key: 0 };
const _sfc_main$y = /* @__PURE__ */ defineComponent({
  __name: "SettingsPanel",
  props: {
    settingGroups: {}
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return props.settingGroups.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$C, [
        (openBlock(true), createElementBlock(Fragment$1, null, renderList(props.settingGroups, (group, i2) => {
          return openBlock(), createBlock(_sfc_main$z, {
            key: group.label,
            divider: i2 !== 0,
            group
          }, null, 8, ["divider", "group"]);
        }), 128))
      ])) : (openBlock(), createBlock(NoResultsPlaceholder, {
        key: 1,
        icon: "pi pi-search",
        title: _ctx.$t("g.noResultsFound"),
        message: _ctx.$t("g.searchFailedMessage")
      }, null, 8, ["title", "message"]));
    };
  }
});
const _withScopeId$h = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-67f71ae9"), n = n(), popScopeId(), n), "_withScopeId$h");
const _hoisted_1$B = { class: "settings-container" };
const _hoisted_2$s = /* @__PURE__ */ _withScopeId$h(() => /* @__PURE__ */ createBaseVNode("div", null, "Loading keybinding panel...", -1));
const _hoisted_3$e = /* @__PURE__ */ _withScopeId$h(() => /* @__PURE__ */ createBaseVNode("div", null, "Loading extension panel...", -1));
const _hoisted_4$a = /* @__PURE__ */ _withScopeId$h(() => /* @__PURE__ */ createBaseVNode("div", null, "Loading server config panel...", -1));
const _sfc_main$x = /* @__PURE__ */ defineComponent({
  __name: "SettingDialogContent",
  props: {
    defaultPanel: {}
  },
  setup(__props) {
    const props = __props;
    const KeybindingPanel = /* @__PURE__ */ defineAsyncComponent(
      () => __vitePreload(() => import("./KeybindingPanel-Dc3C4lG1.js"), true ? __vite__mapDeps([20,21,3,2,4,22]) : void 0, import.meta.url)
    );
    const ExtensionPanel = /* @__PURE__ */ defineAsyncComponent(
      () => __vitePreload(() => import("./ExtensionPanel-D4Phn0Zr.js"), true ? __vite__mapDeps([23,21,3,2]) : void 0, import.meta.url)
    );
    const ServerConfigPanel = /* @__PURE__ */ defineAsyncComponent(
      () => __vitePreload(() => import("./ServerConfigPanel-Be4StJmv.js"), true ? __vite__mapDeps([24,5]) : void 0, import.meta.url)
    );
    const aboutPanelNode = {
      key: "about",
      label: "About",
      children: []
    };
    const keybindingPanelNode = {
      key: "keybinding",
      label: "Keybinding",
      children: []
    };
    const extensionPanelNode = {
      key: "extension",
      label: "Extension",
      children: []
    };
    const serverConfigPanelNode = {
      key: "server-config",
      label: "Server-Config",
      children: []
    };
    const serverConfigPanelNodeList = computed(() => {
      return isElectron() ? [serverConfigPanelNode] : [];
    });
    const settingStore = useSettingStore();
    const settingRoot = computed(() => settingStore.settingTree);
    const settingCategories = computed(
      () => settingRoot.value.children ?? []
    );
    const { t: t2 } = useI18n();
    const categories = computed(
      () => [
        ...settingCategories.value,
        keybindingPanelNode,
        extensionPanelNode,
        ...serverConfigPanelNodeList.value,
        aboutPanelNode
      ].map((node3) => ({
        ...node3,
        translatedLabel: t2(
          `settingsCategories.${normalizeI18nKey(node3.label)}`,
          node3.label
        )
      }))
    );
    const activeCategory = ref(null);
    const getDefaultCategory = /* @__PURE__ */ __name(() => {
      return props.defaultPanel ? categories.value.find((x2) => x2.key === props.defaultPanel) ?? categories.value[0] : categories.value[0];
    }, "getDefaultCategory");
    onMounted(() => {
      activeCategory.value = getDefaultCategory();
    });
    const sortedGroups = /* @__PURE__ */ __name((category) => {
      return [...category.children ?? []].sort((a, b) => a.label.localeCompare(b.label)).map((group) => ({
        label: group.label,
        settings: flattenTree(group)
      }));
    }, "sortedGroups");
    const searchQuery = ref("");
    const filteredSettingIds = ref([]);
    const searchInProgress = ref(false);
    watch(searchQuery, () => searchInProgress.value = true);
    const searchResults = computed(() => {
      const groupedSettings = {};
      filteredSettingIds.value.forEach((id3) => {
        const setting = settingStore.settingsById[id3];
        const info = getSettingInfo(setting);
        const groupLabel = info.subCategory;
        if (activeCategory.value === null || activeCategory.value.label === info.category) {
          if (!groupedSettings[groupLabel]) {
            groupedSettings[groupLabel] = [];
          }
          groupedSettings[groupLabel].push(setting);
        }
      });
      return Object.entries(groupedSettings).map(([label5, settings]) => ({
        label: label5,
        settings
      }));
    });
    const searchResultsCategories = computed(() => {
      return new Set(
        filteredSettingIds.value.map(
          (id3) => getSettingInfo(settingStore.settingsById[id3]).category
        )
      );
    });
    const handleSearch = /* @__PURE__ */ __name((query) => {
      if (!query) {
        filteredSettingIds.value = [];
        activeCategory.value ??= getDefaultCategory();
        return;
      }
      const queryLower = query.toLocaleLowerCase();
      const allSettings = flattenTree(settingRoot.value);
      const filteredSettings = allSettings.filter((setting) => {
        const idLower = setting.id.toLowerCase();
        const nameLower = setting.name.toLowerCase();
        const translatedName = st(
          `settings.${normalizeI18nKey(setting.id)}.name`,
          setting.name
        ).toLocaleLowerCase();
        const info = getSettingInfo(setting);
        const translatedCategory = st(
          `settingsCategories.${normalizeI18nKey(info.category)}`,
          info.category
        ).toLocaleLowerCase();
        const translatedSubCategory = st(
          `settingsCategories.${normalizeI18nKey(info.subCategory)}`,
          info.subCategory
        ).toLocaleLowerCase();
        return idLower.includes(queryLower) || nameLower.includes(queryLower) || translatedName.includes(queryLower) || translatedCategory.includes(queryLower) || translatedSubCategory.includes(queryLower);
      });
      filteredSettingIds.value = filteredSettings.map((x2) => x2.id);
      searchInProgress.value = false;
      activeCategory.value = null;
    }, "handleSearch");
    const inSearch = computed(
      () => searchQuery.value.length > 0 && !searchInProgress.value
    );
    const tabValue = computed(
      () => inSearch.value ? "Search Results" : activeCategory.value?.label
    );
    watch(activeCategory, (_2, oldValue2) => {
      if (!tabValue.value) {
        activeCategory.value = oldValue2;
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$B, [
        createVNode(unref(script$N), { class: "settings-sidebar flex-shrink-0 p-2 w-48 2xl:w-64" }, {
          default: withCtx(() => [
            createVNode(SearchBox, {
              class: "settings-search-box w-full mb-2",
              modelValue: searchQuery.value,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
              onSearch: handleSearch,
              placeholder: _ctx.$t("g.searchSettings") + "..."
            }, null, 8, ["modelValue", "placeholder"]),
            createVNode(unref(script$E), {
              modelValue: activeCategory.value,
              "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => activeCategory.value = $event),
              options: categories.value,
              optionLabel: "translatedLabel",
              scrollHeight: "100%",
              optionDisabled: /* @__PURE__ */ __name((option3) => inSearch.value && !searchResultsCategories.value.has(option3.label), "optionDisabled"),
              class: "border-none w-full"
            }, null, 8, ["modelValue", "options", "optionDisabled"])
          ]),
          _: 1
        }),
        createVNode(unref(script$O), {
          layout: "vertical",
          class: "mx-1 2xl:mx-4 hidden md:flex"
        }),
        createVNode(unref(script$O), {
          layout: "horizontal",
          class: "flex md:hidden"
        }),
        createVNode(unref(script$A), {
          value: tabValue.value,
          lazy: true,
          class: "settings-content h-full w-full"
        }, {
          default: withCtx(() => [
            createVNode(unref(script$B), { class: "settings-tab-panels h-full w-full pr-0" }, {
              default: withCtx(() => [
                createVNode(_sfc_main$K, { value: "Search Results" }, {
                  default: withCtx(() => [
                    createVNode(_sfc_main$y, { settingGroups: searchResults.value }, null, 8, ["settingGroups"])
                  ]),
                  _: 1
                }),
                (openBlock(true), createElementBlock(Fragment$1, null, renderList(settingCategories.value, (category) => {
                  return openBlock(), createBlock(_sfc_main$K, {
                    key: category.key,
                    value: category.label
                  }, {
                    header: withCtx(() => [
                      tabValue.value === "Comfy" ? (openBlock(), createBlock(_sfc_main$H, { key: 0 })) : createCommentVNode("", true),
                      tabValue.value === "Comfy" ? (openBlock(), createBlock(_sfc_main$G, { key: 1 })) : createCommentVNode("", true),
                      tabValue.value === "Appearance" ? (openBlock(), createBlock(_sfc_main$I, { key: 2 })) : createCommentVNode("", true)
                    ]),
                    default: withCtx(() => [
                      createVNode(_sfc_main$y, {
                        settingGroups: sortedGroups(category)
                      }, null, 8, ["settingGroups"])
                    ]),
                    _: 2
                  }, 1032, ["value"]);
                }), 128)),
                createVNode(_sfc_main$J),
                (openBlock(), createBlock(Suspense, null, {
                  fallback: withCtx(() => [
                    _hoisted_2$s
                  ]),
                  default: withCtx(() => [
                    createVNode(unref(KeybindingPanel))
                  ]),
                  _: 1
                })),
                (openBlock(), createBlock(Suspense, null, {
                  fallback: withCtx(() => [
                    _hoisted_3$e
                  ]),
                  default: withCtx(() => [
                    createVNode(unref(ExtensionPanel))
                  ]),
                  _: 1
                })),
                (openBlock(), createBlock(Suspense, null, {
                  fallback: withCtx(() => [
                    _hoisted_4$a
                  ]),
                  default: withCtx(() => [
                    createVNode(unref(ServerConfigPanel))
                  ]),
                  _: 1
                }))
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["value"])
      ]);
    };
  }
});
const SettingDialogContent = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-67f71ae9"]]);
const _sfc_main$w = {};
const _withScopeId$g = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-43089afc"), n = n(), popScopeId(), n), "_withScopeId$g");
const _hoisted_1$A = { class: "px-4" };
const _hoisted_2$r = /* @__PURE__ */ _withScopeId$g(() => /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-cog" }, null, -1));
function _sfc_render(_ctx, _cache) {
  return openBlock(), createElementBlock("div", null, [
    createBaseVNode("h2", _hoisted_1$A, [
      _hoisted_2$r,
      createBaseVNode("span", null, toDisplayString$1(_ctx.$t("g.settings")), 1)
    ])
  ]);
}
__name(_sfc_render, "_sfc_render");
const SettingDialogHeader = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render], ["__scopeId", "data-v-43089afc"]]);
var script$h = {
  name: "ChevronUpIcon",
  "extends": script$X
};
var _hoisted_1$z = /* @__PURE__ */ createBaseVNode("path", {
  d: "M12.2097 10.4113C12.1057 10.4118 12.0027 10.3915 11.9067 10.3516C11.8107 10.3118 11.7237 10.2532 11.6506 10.1792L6.93602 5.46461L2.22139 10.1476C2.07272 10.244 1.89599 10.2877 1.71953 10.2717C1.54307 10.2556 1.3771 10.1808 1.24822 10.0593C1.11933 9.93766 1.035 9.77633 1.00874 9.6011C0.982477 9.42587 1.0158 9.2469 1.10338 9.09287L6.37701 3.81923C6.52533 3.6711 6.72639 3.58789 6.93602 3.58789C7.14565 3.58789 7.3467 3.6711 7.49502 3.81923L12.7687 9.09287C12.9168 9.24119 13 9.44225 13 9.65187C13 9.8615 12.9168 10.0626 12.7687 10.2109C12.616 10.3487 12.4151 10.4207 12.2097 10.4113Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$q = [_hoisted_1$z];
function render$g(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$q, 16);
}
__name(render$g, "render$g");
script$h.render = render$g;
var theme$a = /* @__PURE__ */ __name(function theme29(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-carousel {\n    display: flex;\n    flex-direction: column;\n}\n\n.p-carousel-content-container {\n    display: flex;\n    flex-direction: column;\n    overflow: auto;\n}\n\n.p-carousel-content {\n    display: flex;\n    flex-direction: row;\n    gap: ".concat(dt2("carousel.content.gap"), ";\n}\n\n.p-carousel-viewport {\n    overflow: hidden;\n    width: 100%;\n}\n\n.p-carousel-item-list {\n    display: flex;\n    flex-direction: row;\n}\n\n.p-carousel-prev-button,\n.p-carousel-next-button {\n    align-self: center;\n}\n\n.p-carousel-indicator-list {\n    display: flex;\n    flex-direction: row;\n    justify-content: center;\n    flex-wrap: wrap;\n    padding: ").concat(dt2("carousel.indicator.list.padding"), ";\n    gap: ").concat(dt2("carousel.indicator.list.gap"), ";\n    margin: 0;\n    list-style: none;\n}\n\n.p-carousel-indicator-button {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    background: ").concat(dt2("carousel.indicator.background"), ";\n    width: ").concat(dt2("carousel.indicator.width"), ";\n    height: ").concat(dt2("carousel.indicator.height"), ";\n    border: 0 none;\n    transition: background ").concat(dt2("carousel.transition.duration"), ", color ").concat(dt2("carousel.transition.duration"), ", outline-color ").concat(dt2("carousel.transition.duration"), ", box-shadow ").concat(dt2("carousel.transition.duration"), ";\n    outline-color: transparent;\n    border-radius: ").concat(dt2("carousel.indicator.border.radius"), ";\n    padding: 0;\n    margin: 0;\n    user-select: none;\n    cursor: pointer;\n}\n\n.p-carousel-indicator-button:focus-visible {\n    box-shadow: ").concat(dt2("carousel.indicator.focus.ring.shadow"), ";\n    outline: ").concat(dt2("carousel.indicator.focus.ring.width"), " ").concat(dt2("carousel.indicator.focus.ring.style"), " ").concat(dt2("carousel.indicator.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("carousel.indicator.focus.ring.offset"), ";\n}\n\n.p-carousel-indicator-button:hover {\n    background: ").concat(dt2("carousel.indicator.hover.background"), ";\n}\n\n.p-carousel-indicator-active .p-carousel-indicator-button {\n    background: ").concat(dt2("carousel.indicator.active.background"), ";\n}\n\n.p-carousel-vertical .p-carousel-content {\n    flex-direction: column;\n}\n\n.p-carousel-vertical .p-carousel-item-list {\n    flex-direction: column;\n    height: 100%;\n}\n\n.p-items-hidden .p-carousel-item {\n    visibility: hidden;\n}\n\n.p-items-hidden .p-carousel-item.p-carousel-item-active {\n    visibility: visible;\n}\n");
}, "theme");
var classes$a = {
  root: /* @__PURE__ */ __name(function root18(_ref2) {
    var instance = _ref2.instance;
    return ["p-carousel p-component", {
      "p-carousel-vertical": instance.isVertical(),
      "p-carousel-horizontal": !instance.isVertical()
    }];
  }, "root"),
  header: "p-carousel-header",
  contentContainer: "p-carousel-content-container",
  content: "p-carousel-content",
  pcPrevButton: /* @__PURE__ */ __name(function pcPrevButton(_ref3) {
    var instance = _ref3.instance;
    return ["p-carousel-prev-button", {
      "p-disabled": instance.backwardIsDisabled
    }];
  }, "pcPrevButton"),
  viewport: "p-carousel-viewport",
  itemList: "p-carousel-item-list",
  itemClone: /* @__PURE__ */ __name(function itemClone(_ref4) {
    var index2 = _ref4.index, value4 = _ref4.value, totalShiftedItems = _ref4.totalShiftedItems, d_numVisible = _ref4.d_numVisible;
    return ["p-carousel-item p-carousel-item-clone", {
      "p-carousel-item-active": totalShiftedItems * -1 === value4.length + d_numVisible,
      "p-carousel-item-start": index2 === 0,
      "p-carousel-item-end": value4.slice(-1 * d_numVisible).length - 1 === index2
    }];
  }, "itemClone"),
  item: /* @__PURE__ */ __name(function item(_ref5) {
    var instance = _ref5.instance, index2 = _ref5.index;
    return ["p-carousel-item", {
      "p-carousel-item-active": instance.firstIndex() <= index2 && instance.lastIndex() >= index2,
      "p-carousel-item-start": instance.firstIndex() === index2,
      "p-carousel-item-end": instance.lastIndex() === index2
    }];
  }, "item"),
  pcNextButton: /* @__PURE__ */ __name(function pcNextButton(_ref6) {
    var instance = _ref6.instance;
    return ["p-carousel-next-button", {
      "p-disabled": instance.forwardIsDisabled
    }];
  }, "pcNextButton"),
  indicatorList: "p-carousel-indicator-list",
  indicator: /* @__PURE__ */ __name(function indicator(_ref7) {
    var instance = _ref7.instance, index2 = _ref7.index;
    return ["p-carousel-indicator", {
      "p-carousel-indicator-active": instance.d_page === index2
    }];
  }, "indicator"),
  indicatorButton: "p-carousel-indicator-button",
  footer: "p-carousel-footer"
};
var CarouselStyle = BaseStyle.extend({
  name: "carousel",
  theme: theme$a,
  classes: classes$a
});
var script$1$a = {
  name: "BaseCarousel",
  "extends": script$_,
  props: {
    value: null,
    page: {
      type: Number,
      "default": 0
    },
    numVisible: {
      type: Number,
      "default": 1
    },
    numScroll: {
      type: Number,
      "default": 1
    },
    responsiveOptions: Array,
    orientation: {
      type: String,
      "default": "horizontal"
    },
    verticalViewPortHeight: {
      type: String,
      "default": "300px"
    },
    contentClass: String,
    containerClass: String,
    indicatorsContentClass: String,
    circular: {
      type: Boolean,
      "default": false
    },
    autoplayInterval: {
      type: Number,
      "default": 0
    },
    showNavigators: {
      type: Boolean,
      "default": true
    },
    showIndicators: {
      type: Boolean,
      "default": true
    },
    prevButtonProps: {
      type: Object,
      "default": /* @__PURE__ */ __name(function _default4() {
        return {
          severity: "secondary",
          text: true,
          rounded: true
        };
      }, "_default")
    },
    nextButtonProps: {
      type: Object,
      "default": /* @__PURE__ */ __name(function _default5() {
        return {
          severity: "secondary",
          text: true,
          rounded: true
        };
      }, "_default")
    }
  },
  style: CarouselStyle,
  provide: /* @__PURE__ */ __name(function provide31() {
    return {
      $pcCarousel: this,
      $parentInstance: this
    };
  }, "provide")
};
function _toConsumableArray$6(r) {
  return _arrayWithoutHoles$6(r) || _iterableToArray$6(r) || _unsupportedIterableToArray$8(r) || _nonIterableSpread$6();
}
__name(_toConsumableArray$6, "_toConsumableArray$6");
function _nonIterableSpread$6() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$6, "_nonIterableSpread$6");
function _unsupportedIterableToArray$8(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$8(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$8(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$8, "_unsupportedIterableToArray$8");
function _iterableToArray$6(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$6, "_iterableToArray$6");
function _arrayWithoutHoles$6(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$8(r);
}
__name(_arrayWithoutHoles$6, "_arrayWithoutHoles$6");
function _arrayLikeToArray$8(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$8, "_arrayLikeToArray$8");
var script$g = {
  name: "Carousel",
  "extends": script$1$a,
  inheritAttrs: false,
  emits: ["update:page"],
  isRemainingItemsAdded: false,
  data: /* @__PURE__ */ __name(function data14() {
    return {
      remainingItems: 0,
      d_numVisible: this.numVisible,
      d_numScroll: this.numScroll,
      d_oldNumScroll: 0,
      d_oldNumVisible: 0,
      d_oldValue: null,
      d_page: this.page,
      totalShiftedItems: this.page * this.numScroll * -1,
      allowAutoplay: !!this.autoplayInterval,
      d_circular: this.circular || this.allowAutoplay,
      swipeThreshold: 20
    };
  }, "data"),
  watch: {
    page: /* @__PURE__ */ __name(function page(newValue2) {
      if (newValue2 > this.d_page) {
        this.navForward({}, newValue2);
      } else if (newValue2 < this.d_page) {
        this.navBackward({}, newValue2);
      }
      this.d_page = newValue2;
    }, "page"),
    circular: /* @__PURE__ */ __name(function circular(newValue2) {
      this.d_circular = newValue2;
    }, "circular"),
    numVisible: /* @__PURE__ */ __name(function numVisible(newValue2, oldValue2) {
      this.d_numVisible = newValue2;
      this.d_oldNumVisible = oldValue2;
    }, "numVisible"),
    numScroll: /* @__PURE__ */ __name(function numScroll(newValue2, oldValue2) {
      this.d_oldNumScroll = oldValue2;
      this.d_numScroll = newValue2;
    }, "numScroll"),
    value: /* @__PURE__ */ __name(function value3(oldValue2) {
      this.d_oldValue = oldValue2;
    }, "value")
  },
  mounted: /* @__PURE__ */ __name(function mounted14() {
    var stateChanged = false;
    this.$el.setAttribute(this.attributeSelector, "");
    this.createStyle();
    this.calculatePosition();
    if (this.responsiveOptions) {
      this.bindDocumentListeners();
    }
    if (this.isCircular()) {
      var totalShiftedItems = this.totalShiftedItems;
      if (this.d_page === 0) {
        totalShiftedItems = -1 * this.d_numVisible;
      } else if (totalShiftedItems === 0) {
        totalShiftedItems = -1 * this.value.length;
        if (this.remainingItems > 0) {
          this.isRemainingItemsAdded = true;
        }
      }
      if (totalShiftedItems !== this.totalShiftedItems) {
        this.totalShiftedItems = totalShiftedItems;
        stateChanged = true;
      }
    }
    if (!stateChanged && this.isAutoplay()) {
      this.startAutoplay();
    }
  }, "mounted"),
  updated: /* @__PURE__ */ __name(function updated9() {
    if (!this.empty) {
      var isCircular2 = this.isCircular();
      var stateChanged = false;
      var totalShiftedItems = this.totalShiftedItems;
      if (this.autoplayInterval) {
        this.stopAutoplay();
      }
      if (this.d_oldNumScroll !== this.d_numScroll || this.d_oldNumVisible !== this.d_numVisible || this.d_oldValue.length !== this.value.length) {
        this.remainingItems = (this.value.length - this.d_numVisible) % this.d_numScroll;
        var page2 = this.d_page;
        if (this.totalIndicators !== 0 && page2 >= this.totalIndicators) {
          page2 = this.totalIndicators - 1;
          this.$emit("update:page", page2);
          this.d_page = page2;
          stateChanged = true;
        }
        totalShiftedItems = page2 * this.d_numScroll * -1;
        if (isCircular2) {
          totalShiftedItems -= this.d_numVisible;
        }
        if (page2 === this.totalIndicators - 1 && this.remainingItems > 0) {
          totalShiftedItems += -1 * this.remainingItems + this.d_numScroll;
          this.isRemainingItemsAdded = true;
        } else {
          this.isRemainingItemsAdded = false;
        }
        if (totalShiftedItems !== this.totalShiftedItems) {
          this.totalShiftedItems = totalShiftedItems;
          stateChanged = true;
        }
        this.d_oldNumScroll = this.d_numScroll;
        this.d_oldNumVisible = this.d_numVisible;
        this.d_oldValue = this.value;
        this.$refs.itemsContainer.style.transform = this.isVertical() ? "translate3d(0, ".concat(totalShiftedItems * (100 / this.d_numVisible), "%, 0)") : "translate3d(".concat(totalShiftedItems * (100 / this.d_numVisible), "%, 0, 0)");
      }
      if (isCircular2) {
        if (this.d_page === 0) {
          totalShiftedItems = -1 * this.d_numVisible;
        } else if (totalShiftedItems === 0) {
          totalShiftedItems = -1 * this.value.length;
          if (this.remainingItems > 0) {
            this.isRemainingItemsAdded = true;
          }
        }
        if (totalShiftedItems !== this.totalShiftedItems) {
          this.totalShiftedItems = totalShiftedItems;
          stateChanged = true;
        }
      }
      if (!stateChanged && this.isAutoplay()) {
        this.startAutoplay();
      }
    }
  }, "updated"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount7() {
    if (this.responsiveOptions) {
      this.unbindDocumentListeners();
    }
    if (this.autoplayInterval) {
      this.stopAutoplay();
    }
  }, "beforeUnmount"),
  methods: {
    getIndicatorPTOptions: /* @__PURE__ */ __name(function getIndicatorPTOptions(key, index2) {
      return this.ptm(key, {
        context: {
          highlighted: index2 === this.d_page
        }
      });
    }, "getIndicatorPTOptions"),
    getItemPTOptions: /* @__PURE__ */ __name(function getItemPTOptions(key, index2) {
      return this.ptm(key, {
        context: {
          index: index2,
          active: this.firstIndex() <= index2 && this.lastIndex() >= index2,
          start: this.firstIndex() === index2,
          end: this.lastIndex() === index2
        }
      });
    }, "getItemPTOptions"),
    step: /* @__PURE__ */ __name(function step(dir, page2) {
      var totalShiftedItems = this.totalShiftedItems;
      var isCircular2 = this.isCircular();
      if (page2 != null) {
        totalShiftedItems = this.d_numScroll * page2 * -1;
        if (isCircular2) {
          totalShiftedItems -= this.d_numVisible;
        }
        this.isRemainingItemsAdded = false;
      } else {
        totalShiftedItems += this.d_numScroll * dir;
        if (this.isRemainingItemsAdded) {
          totalShiftedItems += this.remainingItems - this.d_numScroll * dir;
          this.isRemainingItemsAdded = false;
        }
        var originalShiftedItems = isCircular2 ? totalShiftedItems + this.d_numVisible : totalShiftedItems;
        page2 = Math.abs(Math.floor(originalShiftedItems / this.d_numScroll));
      }
      if (isCircular2 && this.d_page === this.totalIndicators - 1 && dir === -1) {
        totalShiftedItems = -1 * (this.value.length + this.d_numVisible);
        page2 = 0;
      } else if (isCircular2 && this.d_page === 0 && dir === 1) {
        totalShiftedItems = 0;
        page2 = this.totalIndicators - 1;
      } else if (page2 === this.totalIndicators - 1 && this.remainingItems > 0) {
        totalShiftedItems += this.remainingItems * -1 - this.d_numScroll * dir;
        this.isRemainingItemsAdded = true;
      }
      if (this.$refs.itemsContainer) {
        !this.isUnstyled && removeClass(this.$refs.itemsContainer, "p-items-hidden");
        this.$refs.itemsContainer.style.transform = this.isVertical() ? "translate3d(0, ".concat(totalShiftedItems * (100 / this.d_numVisible), "%, 0)") : "translate3d(".concat(totalShiftedItems * (100 / this.d_numVisible), "%, 0, 0)");
        this.$refs.itemsContainer.style.transition = "transform 500ms ease 0s";
      }
      this.totalShiftedItems = totalShiftedItems;
      this.$emit("update:page", page2);
      this.d_page = page2;
    }, "step"),
    calculatePosition: /* @__PURE__ */ __name(function calculatePosition() {
      if (this.$refs.itemsContainer && this.responsiveOptions) {
        var windowWidth = window.innerWidth;
        var matchedResponsiveOptionsData = {
          numVisible: this.numVisible,
          numScroll: this.numScroll
        };
        for (var i2 = 0; i2 < this.responsiveOptions.length; i2++) {
          var res = this.responsiveOptions[i2];
          if (parseInt(res.breakpoint, 10) >= windowWidth) {
            matchedResponsiveOptionsData = res;
          }
        }
        if (this.d_numScroll !== matchedResponsiveOptionsData.numScroll) {
          var page2 = this.d_page;
          page2 = parseInt(page2 * this.d_numScroll / matchedResponsiveOptionsData.numScroll);
          this.totalShiftedItems = matchedResponsiveOptionsData.numScroll * page2 * -1;
          if (this.isCircular()) {
            this.totalShiftedItems -= matchedResponsiveOptionsData.numVisible;
          }
          this.d_numScroll = matchedResponsiveOptionsData.numScroll;
          this.$emit("update:page", page2);
          this.d_page = page2;
        }
        if (this.d_numVisible !== matchedResponsiveOptionsData.numVisible) {
          this.d_numVisible = matchedResponsiveOptionsData.numVisible;
        }
      }
    }, "calculatePosition"),
    navBackward: /* @__PURE__ */ __name(function navBackward(e2, index2) {
      if (this.d_circular || this.d_page !== 0) {
        this.step(1, index2);
      }
      this.allowAutoplay = false;
      if (e2.cancelable) {
        e2.preventDefault();
      }
    }, "navBackward"),
    navForward: /* @__PURE__ */ __name(function navForward(e2, index2) {
      if (this.d_circular || this.d_page < this.totalIndicators - 1) {
        this.step(-1, index2);
      }
      this.allowAutoplay = false;
      if (e2.cancelable) {
        e2.preventDefault();
      }
    }, "navForward"),
    onIndicatorClick: /* @__PURE__ */ __name(function onIndicatorClick(e2, index2) {
      var page2 = this.d_page;
      if (index2 > page2) {
        this.navForward(e2, index2);
      } else if (index2 < page2) {
        this.navBackward(e2, index2);
      }
    }, "onIndicatorClick"),
    onTransitionEnd: /* @__PURE__ */ __name(function onTransitionEnd() {
      if (this.$refs.itemsContainer) {
        !this.isUnstyled && addClass(this.$refs.itemsContainer, "p-items-hidden");
        this.$refs.itemsContainer.style.transition = "";
        if ((this.d_page === 0 || this.d_page === this.totalIndicators - 1) && this.isCircular()) {
          this.$refs.itemsContainer.style.transform = this.isVertical() ? "translate3d(0, ".concat(this.totalShiftedItems * (100 / this.d_numVisible), "%, 0)") : "translate3d(".concat(this.totalShiftedItems * (100 / this.d_numVisible), "%, 0, 0)");
        }
      }
    }, "onTransitionEnd"),
    onTouchStart: /* @__PURE__ */ __name(function onTouchStart(e2) {
      var touchobj = e2.changedTouches[0];
      this.startPos = {
        x: touchobj.pageX,
        y: touchobj.pageY
      };
    }, "onTouchStart"),
    onTouchMove: /* @__PURE__ */ __name(function onTouchMove(e2) {
      var touchobj = e2.changedTouches[0];
      var diff2 = this.isVertical() ? touchobj.pageY - this.startPos.y : touchobj.pageX - this.startPos.x;
      if (Math.abs(diff2) > this.swipeThreshold && e2.cancelable) {
        e2.preventDefault();
      }
    }, "onTouchMove"),
    onTouchEnd: /* @__PURE__ */ __name(function onTouchEnd(e2) {
      var touchobj = e2.changedTouches[0];
      if (this.isVertical()) {
        this.changePageOnTouch(e2, touchobj.pageY - this.startPos.y);
      } else {
        this.changePageOnTouch(e2, touchobj.pageX - this.startPos.x);
      }
    }, "onTouchEnd"),
    changePageOnTouch: /* @__PURE__ */ __name(function changePageOnTouch(e2, diff2) {
      if (Math.abs(diff2) > this.swipeThreshold) {
        if (diff2 < 0) {
          this.navForward(e2);
        } else {
          this.navBackward(e2);
        }
      }
    }, "changePageOnTouch"),
    onIndicatorKeydown: /* @__PURE__ */ __name(function onIndicatorKeydown(event) {
      switch (event.code) {
        case "ArrowRight":
          this.onRightKey();
          break;
        case "ArrowLeft":
          this.onLeftKey();
          break;
        case "Home":
          this.onHomeKey();
          event.preventDefault();
          break;
        case "End":
          this.onEndKey();
          event.preventDefault();
          break;
        case "ArrowUp":
        case "ArrowDown":
        case "PageUp":
        case "PageDown":
          event.preventDefault();
          break;
        case "Tab":
          this.onTabKey();
          break;
      }
    }, "onIndicatorKeydown"),
    onRightKey: /* @__PURE__ */ __name(function onRightKey() {
      var indicators = _toConsumableArray$6(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, activeIndex3 + 1 === indicators.length ? indicators.length - 1 : activeIndex3 + 1);
    }, "onRightKey"),
    onLeftKey: /* @__PURE__ */ __name(function onLeftKey() {
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, activeIndex3 - 1 <= 0 ? 0 : activeIndex3 - 1);
    }, "onLeftKey"),
    onHomeKey: /* @__PURE__ */ __name(function onHomeKey3() {
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, 0);
    }, "onHomeKey"),
    onEndKey: /* @__PURE__ */ __name(function onEndKey3() {
      var indicators = _toConsumableArray$6(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, indicators.length - 1);
    }, "onEndKey"),
    onTabKey: /* @__PURE__ */ __name(function onTabKey2() {
      var indicators = _toConsumableArray$6(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      var highlightedIndex = indicators.findIndex(function(ind) {
        return getAttribute(ind, "data-p-active") === true;
      });
      var activeIndicator = findSingle(this.$refs.indicatorContent, '[data-pc-section="indicator"] > button[tabindex="0"]');
      var activeIndex3 = indicators.findIndex(function(ind) {
        return ind === activeIndicator.parentElement;
      });
      indicators[activeIndex3].children[0].tabIndex = "-1";
      indicators[highlightedIndex].children[0].tabIndex = "0";
    }, "onTabKey"),
    findFocusedIndicatorIndex: /* @__PURE__ */ __name(function findFocusedIndicatorIndex() {
      var indicators = _toConsumableArray$6(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      var activeIndicator = findSingle(this.$refs.indicatorContent, '[data-pc-section="indicator"] > button[tabindex="0"]');
      return indicators.findIndex(function(ind) {
        return ind === activeIndicator.parentElement;
      });
    }, "findFocusedIndicatorIndex"),
    changedFocusedIndicator: /* @__PURE__ */ __name(function changedFocusedIndicator(prevInd, nextInd) {
      var indicators = _toConsumableArray$6(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      indicators[prevInd].children[0].tabIndex = "-1";
      indicators[nextInd].children[0].tabIndex = "0";
      indicators[nextInd].children[0].focus();
    }, "changedFocusedIndicator"),
    bindDocumentListeners: /* @__PURE__ */ __name(function bindDocumentListeners() {
      var _this = this;
      if (!this.documentResizeListener) {
        this.documentResizeListener = function(e2) {
          _this.calculatePosition(e2);
        };
        window.addEventListener("resize", this.documentResizeListener);
      }
    }, "bindDocumentListeners"),
    unbindDocumentListeners: /* @__PURE__ */ __name(function unbindDocumentListeners() {
      if (this.documentResizeListener) {
        window.removeEventListener("resize", this.documentResizeListener);
        this.documentResizeListener = null;
      }
    }, "unbindDocumentListeners"),
    startAutoplay: /* @__PURE__ */ __name(function startAutoplay() {
      var _this2 = this;
      this.interval = setInterval(function() {
        if (_this2.d_page === _this2.totalIndicators - 1) {
          _this2.step(-1, 0);
        } else {
          _this2.step(-1, _this2.d_page + 1);
        }
      }, this.autoplayInterval);
    }, "startAutoplay"),
    stopAutoplay: /* @__PURE__ */ __name(function stopAutoplay() {
      if (this.interval) {
        clearInterval(this.interval);
      }
    }, "stopAutoplay"),
    createStyle: /* @__PURE__ */ __name(function createStyle2() {
      if (!this.carouselStyle) {
        var _this$$primevue;
        this.carouselStyle = document.createElement("style");
        this.carouselStyle.type = "text/css";
        setAttribute(this.carouselStyle, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
        document.body.appendChild(this.carouselStyle);
      }
      var innerHTML = "\n                .p-carousel[".concat(this.attributeSelector, "] .p-carousel-item {\n                    flex: 1 0 ").concat(100 / this.d_numVisible, "%\n                }\n            ");
      if (this.responsiveOptions && !this.isUnstyled) {
        var _responsiveOptions = _toConsumableArray$6(this.responsiveOptions);
        var comparer = localeComparator();
        _responsiveOptions.sort(function(data1, data24) {
          var value1 = data1.breakpoint;
          var value22 = data24.breakpoint;
          return sort(value1, value22, -1, comparer);
        });
        for (var i2 = 0; i2 < _responsiveOptions.length; i2++) {
          var res = _responsiveOptions[i2];
          innerHTML += "\n                        @media screen and (max-width: ".concat(res.breakpoint, ") {\n                            .p-carousel[").concat(this.attributeSelector, "] .p-carousel-item {\n                                flex: 1 0 ").concat(100 / res.numVisible, "%\n                            }\n                        }\n                    ");
        }
      }
      this.carouselStyle.innerHTML = innerHTML;
    }, "createStyle"),
    isVertical: /* @__PURE__ */ __name(function isVertical3() {
      return this.orientation === "vertical";
    }, "isVertical"),
    isCircular: /* @__PURE__ */ __name(function isCircular() {
      return this.value && this.d_circular && this.value.length >= this.d_numVisible;
    }, "isCircular"),
    isAutoplay: /* @__PURE__ */ __name(function isAutoplay() {
      return this.autoplayInterval && this.allowAutoplay;
    }, "isAutoplay"),
    firstIndex: /* @__PURE__ */ __name(function firstIndex() {
      return this.isCircular() ? -1 * (this.totalShiftedItems + this.d_numVisible) : this.totalShiftedItems * -1;
    }, "firstIndex"),
    lastIndex: /* @__PURE__ */ __name(function lastIndex() {
      return this.firstIndex() + this.d_numVisible - 1;
    }, "lastIndex"),
    ariaSlideNumber: /* @__PURE__ */ __name(function ariaSlideNumber(value4) {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g, value4) : void 0;
    }, "ariaSlideNumber"),
    ariaPageLabel: /* @__PURE__ */ __name(function ariaPageLabel(value4) {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g, value4) : void 0;
    }, "ariaPageLabel")
  },
  computed: {
    totalIndicators: /* @__PURE__ */ __name(function totalIndicators() {
      return this.value ? Math.max(Math.ceil((this.value.length - this.d_numVisible) / this.d_numScroll) + 1, 0) : 0;
    }, "totalIndicators"),
    backwardIsDisabled: /* @__PURE__ */ __name(function backwardIsDisabled() {
      return this.value && (!this.circular || this.value.length < this.d_numVisible) && this.d_page === 0;
    }, "backwardIsDisabled"),
    forwardIsDisabled: /* @__PURE__ */ __name(function forwardIsDisabled() {
      return this.value && (!this.circular || this.value.length < this.d_numVisible) && (this.d_page === this.totalIndicators - 1 || this.totalIndicators === 0);
    }, "forwardIsDisabled"),
    ariaSlideLabel: /* @__PURE__ */ __name(function ariaSlideLabel() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.slide : void 0;
    }, "ariaSlideLabel"),
    ariaPrevButtonLabel: /* @__PURE__ */ __name(function ariaPrevButtonLabel() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.prevPageLabel : void 0;
    }, "ariaPrevButtonLabel"),
    ariaNextButtonLabel: /* @__PURE__ */ __name(function ariaNextButtonLabel() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.nextPageLabel : void 0;
    }, "ariaNextButtonLabel"),
    attributeSelector: /* @__PURE__ */ __name(function attributeSelector2() {
      return UniqueComponentId();
    }, "attributeSelector"),
    empty: /* @__PURE__ */ __name(function empty2() {
      return !this.value || this.value.length === 0;
    }, "empty"),
    emptyMessageText: /* @__PURE__ */ __name(function emptyMessageText3() {
      var _this$$primevue$confi;
      return ((_this$$primevue$confi = this.$primevue.config) === null || _this$$primevue$confi === void 0 || (_this$$primevue$confi = _this$$primevue$confi.locale) === null || _this$$primevue$confi === void 0 ? void 0 : _this$$primevue$confi.emptyMessage) || "";
    }, "emptyMessageText")
  },
  components: {
    Button: script$R,
    ChevronRightIcon: script$u,
    ChevronDownIcon: script$p,
    ChevronLeftIcon: script$v,
    ChevronUpIcon: script$h
  },
  directives: {
    ripple: Ripple
  }
};
var _hoisted_1$y = ["aria-live"];
var _hoisted_2$p = ["data-p-carousel-item-active", "data-p-carousel-item-start", "data-p-carousel-item-end"];
var _hoisted_3$d = ["aria-hidden", "aria-label", "aria-roledescription", "data-p-carousel-item-active", "data-p-carousel-item-start", "data-p-carousel-item-end"];
var _hoisted_4$9 = ["data-p-active"];
var _hoisted_5$8 = ["tabindex", "aria-label", "aria-current", "onClick"];
function render$f(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_Button = resolveComponent("Button");
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    role: "region"
  }, _ctx.ptmi("root")), [_ctx.$slots.header ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("header")
  }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header")], 16)) : createCommentVNode("", true), !$options.empty ? (openBlock(), createElementBlock("div", mergeProps({
    key: 1,
    "class": [_ctx.cx("contentContainer"), _ctx.containerClass]
  }, _ctx.ptm("contentContainer")), [createBaseVNode("div", mergeProps({
    "class": [_ctx.cx("content"), _ctx.contentClass],
    "aria-live": $data.allowAutoplay ? "polite" : "off"
  }, _ctx.ptm("content")), [_ctx.showNavigators ? (openBlock(), createBlock(_component_Button, mergeProps({
    key: 0,
    "class": _ctx.cx("pcPrevButton"),
    disabled: $options.backwardIsDisabled,
    "aria-label": $options.ariaPrevButtonLabel,
    unstyled: _ctx.unstyled,
    onClick: $options.navBackward
  }, _ctx.prevButtonProps, {
    pt: _ctx.ptm("pcPrevButton"),
    "data-pc-group-section": "navigator"
  }), {
    icon: withCtx(function(slotProps) {
      return [renderSlot(_ctx.$slots, "previcon", {}, function() {
        return [(openBlock(), createBlock(resolveDynamicComponent($options.isVertical() ? "ChevronUpIcon" : "ChevronLeftIcon"), mergeProps({
          "class": slotProps.icon
        }, _ctx.ptm("pcPrevButton")["icon"]), null, 16, ["class"]))];
      })];
    }),
    _: 3
  }, 16, ["class", "disabled", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("viewport"),
    style: [{
      height: $options.isVertical() ? _ctx.verticalViewPortHeight : "auto"
    }],
    onTouchend: _cache[1] || (_cache[1] = function() {
      return $options.onTouchEnd && $options.onTouchEnd.apply($options, arguments);
    }),
    onTouchstart: _cache[2] || (_cache[2] = function() {
      return $options.onTouchStart && $options.onTouchStart.apply($options, arguments);
    }),
    onTouchmove: _cache[3] || (_cache[3] = function() {
      return $options.onTouchMove && $options.onTouchMove.apply($options, arguments);
    })
  }, _ctx.ptm("viewport")), [createBaseVNode("div", mergeProps({
    ref: "itemsContainer",
    "class": _ctx.cx("itemList"),
    onTransitionend: _cache[0] || (_cache[0] = function() {
      return $options.onTransitionEnd && $options.onTransitionEnd.apply($options, arguments);
    })
  }, _ctx.ptm("itemList")), [$options.isCircular() ? (openBlock(true), createElementBlock(Fragment$1, {
    key: 0
  }, renderList(_ctx.value.slice(-1 * $data.d_numVisible), function(item3, index2) {
    return openBlock(), createElementBlock("div", mergeProps({
      key: index2 + "_scloned",
      "class": _ctx.cx("itemClone", {
        index: index2,
        value: _ctx.value,
        totalShiftedItems: $data.totalShiftedItems,
        d_numVisible: $data.d_numVisible
      }),
      ref_for: true
    }, _ctx.ptm("itemClone"), {
      "data-p-carousel-item-active": $data.totalShiftedItems * -1 === _ctx.value.length + $data.d_numVisible,
      "data-p-carousel-item-start": index2 === 0,
      "data-p-carousel-item-end": _ctx.value.slice(-1 * $data.d_numVisible).length - 1 === index2
    }), [renderSlot(_ctx.$slots, "item", {
      data: item3,
      index: index2
    })], 16, _hoisted_2$p);
  }), 128)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.value, function(item3, index2) {
    return openBlock(), createElementBlock("div", mergeProps({
      key: index2,
      "class": _ctx.cx("item", {
        index: index2
      }),
      role: "group",
      "aria-hidden": $options.firstIndex() > index2 || $options.lastIndex() < index2 ? true : void 0,
      "aria-label": $options.ariaSlideNumber(index2),
      "aria-roledescription": $options.ariaSlideLabel,
      ref_for: true
    }, $options.getItemPTOptions("item", index2), {
      "data-p-carousel-item-active": $options.firstIndex() <= index2 && $options.lastIndex() >= index2,
      "data-p-carousel-item-start": $options.firstIndex() === index2,
      "data-p-carousel-item-end": $options.lastIndex() === index2
    }), [renderSlot(_ctx.$slots, "item", {
      data: item3,
      index: index2
    })], 16, _hoisted_3$d);
  }), 128)), $options.isCircular() ? (openBlock(true), createElementBlock(Fragment$1, {
    key: 1
  }, renderList(_ctx.value.slice(0, $data.d_numVisible), function(item3, index2) {
    return openBlock(), createElementBlock("div", mergeProps({
      key: index2 + "_fcloned",
      "class": _ctx.cx("itemClone", {
        index: index2,
        value: _ctx.value,
        totalShiftedItems: $data.totalShiftedItems,
        d_numVisible: $data.d_numVisible
      }),
      ref_for: true
    }, _ctx.ptm("itemClone")), [renderSlot(_ctx.$slots, "item", {
      data: item3,
      index: index2
    })], 16);
  }), 128)) : createCommentVNode("", true)], 16)], 16), _ctx.showNavigators ? (openBlock(), createBlock(_component_Button, mergeProps({
    key: 1,
    "class": _ctx.cx("pcNextButton"),
    disabled: $options.forwardIsDisabled,
    "aria-label": $options.ariaNextButtonLabel,
    unstyled: _ctx.unstyled,
    onClick: $options.navForward
  }, _ctx.nextButtonProps, {
    pt: _ctx.ptm("pcNextButton"),
    "data-pc-group-section": "navigator"
  }), {
    icon: withCtx(function(slotProps) {
      return [renderSlot(_ctx.$slots, "nexticon", {}, function() {
        return [(openBlock(), createBlock(resolveDynamicComponent($options.isVertical() ? "ChevronDownIcon" : "ChevronRightIcon"), mergeProps({
          "class": slotProps["class"]
        }, _ctx.ptm("pcNextButton")["icon"]), null, 16, ["class"]))];
      })];
    }),
    _: 3
  }, 16, ["class", "disabled", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true)], 16, _hoisted_1$y), $options.totalIndicators >= 0 && _ctx.showIndicators ? (openBlock(), createElementBlock("ul", mergeProps({
    key: 0,
    ref: "indicatorContent",
    "class": [_ctx.cx("indicatorList"), _ctx.indicatorsContentClass],
    onKeydown: _cache[4] || (_cache[4] = function() {
      return $options.onIndicatorKeydown && $options.onIndicatorKeydown.apply($options, arguments);
    })
  }, _ctx.ptm("indicatorList")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($options.totalIndicators, function(indicator3, i2) {
    return openBlock(), createElementBlock("li", mergeProps({
      key: "p-carousel-indicator-" + i2.toString(),
      "class": _ctx.cx("indicator", {
        index: i2
      }),
      ref_for: true
    }, $options.getIndicatorPTOptions("indicator", i2), {
      "data-p-active": $data.d_page === i2
    }), [createBaseVNode("button", mergeProps({
      "class": _ctx.cx("indicatorButton"),
      type: "button",
      tabindex: $data.d_page === i2 ? "0" : "-1",
      "aria-label": $options.ariaPageLabel(i2 + 1),
      "aria-current": $data.d_page === i2 ? "page" : void 0,
      onClick: /* @__PURE__ */ __name(function onClick3($event) {
        return $options.onIndicatorClick($event, i2);
      }, "onClick"),
      ref_for: true
    }, $options.getIndicatorPTOptions("indicatorButton", i2)), null, 16, _hoisted_5$8)], 16, _hoisted_4$9);
  }), 128))], 16)) : createCommentVNode("", true)], 16)) : renderSlot(_ctx.$slots, "empty", {
    key: 2
  }, function() {
    return [createTextVNode(toDisplayString$1($options.emptyMessageText), 1)];
  }), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({
    key: 3,
    "class": _ctx.cx("footer")
  }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true)], 16);
}
__name(render$f, "render$f");
script$g.render = render$f;
const _withScopeId$f = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-d65acb9a"), n = n(), popScopeId(), n), "_withScopeId$f");
const _hoisted_1$x = { class: "flex items-center justify-center" };
const _hoisted_2$o = { class: "relative overflow-hidden rounded-lg cursor-pointer w-64 h-64" };
const _hoisted_3$c = ["src"];
const _hoisted_4$8 = {
  key: 1,
  class: "w-64 h-64 content-center text-center"
};
const _hoisted_5$7 = /* @__PURE__ */ _withScopeId$f(() => /* @__PURE__ */ createBaseVNode("i", {
  class: "pi pi-file",
  style: { "font-size": "4rem" }
}, null, -1));
const _hoisted_6$6 = [
  _hoisted_5$7
];
const _hoisted_7$4 = /* @__PURE__ */ _withScopeId$f(() => /* @__PURE__ */ createBaseVNode("a", null, [
  /* @__PURE__ */ createBaseVNode("div", { class: "absolute top-0 left-0 w-64 h-64 overflow-hidden opacity-0 transition duration-300 ease-in-out hover:opacity-100 bg-opacity-50 bg-black flex items-center justify-center" }, [
    /* @__PURE__ */ createBaseVNode("i", {
      class: "pi pi-play-circle",
      style: { "color": "white" }
    })
  ])
], -1));
const _sfc_main$v = /* @__PURE__ */ defineComponent({
  __name: "TemplateWorkflowCard",
  props: {
    moduleName: {},
    workflowName: {},
    loading: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const imageError = ref(false);
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(script$M), {
        "data-testid": `template-workflow-${props.workflowName}`
      }, {
        header: withCtx(() => [
          createBaseVNode("div", _hoisted_1$x, [
            createBaseVNode("div", _hoisted_2$o, [
              !imageError.value ? (openBlock(), createElementBlock("img", {
                key: 0,
                src: props.moduleName === "default" ? `templates/${props.workflowName}.jpg` : `api/workflow_templates/${props.moduleName}/${props.workflowName}.jpg`,
                onError: _cache[0] || (_cache[0] = ($event) => imageError.value = true),
                class: "w-64 h-64 rounded-lg object-cover thumbnail"
              }, null, 40, _hoisted_3$c)) : (openBlock(), createElementBlock("div", _hoisted_4$8, _hoisted_6$6)),
              _hoisted_7$4,
              _ctx.loading ? (openBlock(), createBlock(unref(script$Y), {
                key: 2,
                class: "absolute inset-0 z-1 w-3/12 h-full"
              })) : createCommentVNode("", true)
            ])
          ])
        ]),
        subtitle: withCtx(() => [
          props.moduleName === "default" ? (openBlock(), createElementBlock(Fragment$1, { key: 0 }, [
            createTextVNode(toDisplayString$1(_ctx.$t(
              `templateWorkflows.template.${props.workflowName}`,
              props.workflowName
            )), 1)
          ], 64)) : (openBlock(), createElementBlock(Fragment$1, { key: 1 }, [
            createTextVNode(toDisplayString$1(props.workflowName), 1)
          ], 64))
        ]),
        _: 1
      }, 8, ["data-testid"]);
    };
  }
});
const TemplateWorkflowCard = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-d65acb9a"]]);
const useWorkflowTemplatesStore = /* @__PURE__ */ defineStore(
  "workflowTemplates",
  () => {
    const items2 = ref({});
    const isLoaded = ref(false);
    async function loadWorkflowTemplates() {
      try {
        if (!isLoaded.value) {
          items2.value = await api.getWorkflowTemplates();
          isLoaded.value = true;
        }
      } catch (error2) {
        console.error("Error fetching workflow templates:", error2);
      }
    }
    __name(loadWorkflowTemplates, "loadWorkflowTemplates");
    return {
      items: items2,
      isLoaded,
      loadWorkflowTemplates
    };
  }
);
const _withScopeId$e = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-fc26284b"), n = n(), popScopeId(), n), "_withScopeId$e");
const _hoisted_1$w = {
  class: "flex h-96",
  "data-testid": "template-workflows-content"
};
const _hoisted_2$n = { class: "relative" };
const _hoisted_3$b = ["onClick"];
const _sfc_main$u = /* @__PURE__ */ defineComponent({
  __name: "TemplateWorkflowsContent",
  setup(__props) {
    const { t: t2 } = useI18n();
    const comfyUITemplates = {
      moduleName: "default",
      title: "ComfyUI",
      templates: ["default", "image2image", "upscale", "flux_schnell"]
    };
    const responsiveOptions = ref([
      {
        breakpoint: "1660px",
        numVisible: 3,
        numScroll: 2
      },
      {
        breakpoint: "1360px",
        numVisible: 2,
        numScroll: 1
      },
      {
        breakpoint: "960px",
        numVisible: 1,
        numScroll: 1
      }
    ]);
    const workflowTemplatesStore = useWorkflowTemplatesStore();
    const selectedTab = ref(comfyUITemplates);
    const workflowLoading = ref(null);
    const tabs2 = computed(() => {
      return [
        comfyUITemplates,
        ...Object.entries(workflowTemplatesStore.items).map(([key, value4]) => ({
          moduleName: key,
          title: key,
          templates: value4
        }))
      ];
    });
    onMounted(async () => {
      await workflowTemplatesStore.loadWorkflowTemplates();
    });
    const handleTabSelection = /* @__PURE__ */ __name((selection) => {
      if (selection !== selectedTab.value && selection !== null)
        selectedTab.value = selection;
    }, "handleTabSelection");
    const loadWorkflow = /* @__PURE__ */ __name(async (id3) => {
      workflowLoading.value = id3;
      let json;
      if (selectedTab.value.moduleName === "default") {
        json = await fetch(api.fileURL(`/templates/${id3}.json`)).then(
          (r) => r.json()
        );
      } else {
        json = await fetch(
          api.apiURL(
            `/workflow_templates/${selectedTab.value.moduleName}/${id3}.json`
          )
        ).then((r) => r.json());
      }
      useDialogStore().closeDialog();
      const workflowName = selectedTab.value.moduleName === "default" ? t2(`templateWorkflows.template.${id3}`, id3) : id3;
      await app$1.loadGraphData(json, true, true, workflowName);
      return false;
    }, "loadWorkflow");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$w, [
        createBaseVNode("div", _hoisted_2$n, [
          !unref(workflowTemplatesStore).isLoaded ? (openBlock(), createBlock(unref(script$Y), {
            key: 0,
            class: "absolute w-8 h-full inset-0"
          })) : createCommentVNode("", true),
          createVNode(unref(script$E), {
            "model-value": selectedTab.value,
            "onUpdate:modelValue": handleTabSelection,
            options: tabs2.value,
            optionLabel: "title",
            "scroll-height": "auto",
            class: "overflow-y-auto w-64 h-full",
            listStyle: "max-height:unset"
          }, null, 8, ["model-value", "options"])
        ]),
        (openBlock(), createBlock(unref(script$g), {
          class: "carousel justify-center",
          value: selectedTab.value.templates,
          "responsive-options": responsiveOptions.value,
          numVisible: 4,
          numScroll: 3,
          key: selectedTab.value.moduleName
        }, {
          item: withCtx((slotProps) => [
            createBaseVNode("div", {
              onClick: /* @__PURE__ */ __name(($event) => loadWorkflow(slotProps.data), "onClick")
            }, [
              createVNode(TemplateWorkflowCard, {
                moduleName: selectedTab.value.moduleName,
                workflowName: slotProps.data,
                loading: slotProps.data === workflowLoading.value
              }, null, 8, ["moduleName", "workflowName", "loading"])
            ], 8, _hoisted_3$b)
          ]),
          _: 1
        }, 8, ["value", "responsive-options"]))
      ]);
    };
  }
});
const TemplateWorkflowsContent = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-fc26284b"]]);
const useDialogService = /* @__PURE__ */ __name(() => {
  const dialogStore = useDialogStore();
  function showLoadWorkflowWarning(props) {
    dialogStore.showDialog({
      key: "global-load-workflow-warning",
      component: LoadWorkflowWarning,
      props
    });
  }
  __name(showLoadWorkflowWarning, "showLoadWorkflowWarning");
  function showMissingModelsWarning(props) {
    dialogStore.showDialog({
      key: "global-missing-models-warning",
      component: MissingModelsWarning,
      props
    });
  }
  __name(showMissingModelsWarning, "showMissingModelsWarning");
  function showSettingsDialog(panel2) {
    const props = panel2 ? { props: { defaultPanel: panel2 } } : void 0;
    dialogStore.showDialog({
      key: "global-settings",
      headerComponent: SettingDialogHeader,
      component: SettingDialogContent,
      ...props
    });
  }
  __name(showSettingsDialog, "showSettingsDialog");
  function showAboutDialog() {
    dialogStore.showDialog({
      key: "global-settings",
      headerComponent: SettingDialogHeader,
      component: SettingDialogContent,
      props: {
        defaultPanel: "about"
      }
    });
  }
  __name(showAboutDialog, "showAboutDialog");
  function showExecutionErrorDialog(error2) {
    dialogStore.showDialog({
      key: "global-execution-error",
      component: ExecutionErrorDialogContent,
      props: {
        error: error2
      }
    });
  }
  __name(showExecutionErrorDialog, "showExecutionErrorDialog");
  function showTemplateWorkflowsDialog() {
    dialogStore.showDialog({
      key: "global-template-workflows",
      title: t("templateWorkflows.title"),
      component: TemplateWorkflowsContent
    });
  }
  __name(showTemplateWorkflowsDialog, "showTemplateWorkflowsDialog");
  async function prompt({
    title,
    message: message3,
    defaultValue = ""
  }) {
    return new Promise((resolve2) => {
      dialogStore.showDialog({
        key: "global-prompt",
        title,
        component: _sfc_main$P,
        props: {
          message: message3,
          defaultValue,
          onConfirm: /* @__PURE__ */ __name((value4) => {
            resolve2(value4);
          }, "onConfirm")
        },
        dialogComponentProps: {
          onClose: /* @__PURE__ */ __name(() => {
            resolve2(null);
          }, "onClose")
        }
      });
    });
  }
  __name(prompt, "prompt");
  async function confirm2({
    title,
    message: message3,
    type = "default",
    itemList = []
  }) {
    return new Promise((resolve2) => {
      const options4 = {
        key: "global-prompt",
        title,
        component: ConfirmationDialogContent,
        props: {
          message: message3,
          type,
          itemList,
          onConfirm: resolve2
        },
        dialogComponentProps: {
          onClose: /* @__PURE__ */ __name(() => resolve2(null), "onClose")
        }
      };
      dialogStore.showDialog(options4);
    });
  }
  __name(confirm2, "confirm");
  return {
    showLoadWorkflowWarning,
    showMissingModelsWarning,
    showSettingsDialog,
    showAboutDialog,
    showExecutionErrorDialog,
    showTemplateWorkflowsDialog,
    prompt,
    confirm: confirm2
  };
}, "useDialogService");
class KeybindingImpl {
  static {
    __name(this, "KeybindingImpl");
  }
  commandId;
  combo;
  targetSelector;
  constructor(obj) {
    this.commandId = obj.commandId;
    this.combo = new KeyComboImpl(obj.combo);
    this.targetSelector = obj.targetSelector;
  }
  equals(other) {
    const raw = toRaw(other);
    return raw instanceof KeybindingImpl ? this.commandId === raw.commandId && this.combo.equals(raw.combo) && this.targetSelector === raw.targetSelector : false;
  }
}
class KeyComboImpl {
  static {
    __name(this, "KeyComboImpl");
  }
  key;
  // ctrl or meta(cmd on mac)
  ctrl;
  alt;
  shift;
  constructor(obj) {
    this.key = obj.key;
    this.ctrl = obj.ctrl ?? false;
    this.alt = obj.alt ?? false;
    this.shift = obj.shift ?? false;
  }
  static fromEvent(event) {
    return new KeyComboImpl({
      key: event.key,
      ctrl: event.ctrlKey || event.metaKey,
      alt: event.altKey,
      shift: event.shiftKey
    });
  }
  equals(other) {
    const raw = toRaw(other);
    return raw instanceof KeyComboImpl ? this.key.toUpperCase() === raw.key.toUpperCase() && this.ctrl === raw.ctrl && this.alt === raw.alt && this.shift === raw.shift : false;
  }
  serialize() {
    return `${this.key.toUpperCase()}:${this.ctrl}:${this.alt}:${this.shift}`;
  }
  toString() {
    return this.getKeySequences().join(" + ");
  }
  get hasModifier() {
    return this.ctrl || this.alt || this.shift;
  }
  get isModifier() {
    return ["Control", "Meta", "Alt", "Shift"].includes(this.key);
  }
  getKeySequences() {
    const sequences = [];
    if (this.ctrl) {
      sequences.push("Ctrl");
    }
    if (this.alt) {
      sequences.push("Alt");
    }
    if (this.shift) {
      sequences.push("Shift");
    }
    sequences.push(this.key);
    return sequences;
  }
}
const useKeybindingStore = /* @__PURE__ */ defineStore("keybinding", () => {
  const defaultKeybindings = ref({});
  const userKeybindings = ref({});
  const userUnsetKeybindings = ref({});
  function getUserKeybindings() {
    return userKeybindings.value;
  }
  __name(getUserKeybindings, "getUserKeybindings");
  function getUserUnsetKeybindings() {
    return userUnsetKeybindings.value;
  }
  __name(getUserUnsetKeybindings, "getUserUnsetKeybindings");
  const keybindingByKeyCombo = computed(() => {
    const result = {
      ...defaultKeybindings.value
    };
    for (const keybinding of Object.values(userUnsetKeybindings.value)) {
      const serializedCombo = keybinding.combo.serialize();
      if (result[serializedCombo]?.equals(keybinding)) {
        delete result[serializedCombo];
      }
    }
    return {
      ...result,
      ...userKeybindings.value
    };
  });
  const keybindings = computed(
    () => Object.values(keybindingByKeyCombo.value)
  );
  function getKeybinding(combo) {
    return keybindingByKeyCombo.value[combo.serialize()];
  }
  __name(getKeybinding, "getKeybinding");
  function createKeybindingsByCommandId(keybindings2) {
    const result = {};
    for (const keybinding of keybindings2) {
      if (!(keybinding.commandId in result)) {
        result[keybinding.commandId] = [];
      }
      result[keybinding.commandId].push(keybinding);
    }
    return result;
  }
  __name(createKeybindingsByCommandId, "createKeybindingsByCommandId");
  const keybindingsByCommandId = computed(
    () => {
      return createKeybindingsByCommandId(keybindings.value);
    }
  );
  function getKeybindingsByCommandId(commandId) {
    return keybindingsByCommandId.value[commandId] ?? [];
  }
  __name(getKeybindingsByCommandId, "getKeybindingsByCommandId");
  const defaultKeybindingsByCommandId = computed(() => {
    return createKeybindingsByCommandId(Object.values(defaultKeybindings.value));
  });
  function getKeybindingByCommandId(commandId) {
    return getKeybindingsByCommandId(commandId)[0];
  }
  __name(getKeybindingByCommandId, "getKeybindingByCommandId");
  function addKeybinding(target, keybinding, { existOk = false }) {
    if (!existOk && keybinding.combo.serialize() in target.value) {
      throw new Error(
        `Keybinding on ${keybinding.combo} already exists on ${target.value[keybinding.combo.serialize()].commandId}`
      );
    }
    target.value[keybinding.combo.serialize()] = keybinding;
  }
  __name(addKeybinding, "addKeybinding");
  function addDefaultKeybinding(keybinding) {
    addKeybinding(defaultKeybindings, keybinding, { existOk: false });
  }
  __name(addDefaultKeybinding, "addDefaultKeybinding");
  function addUserKeybinding(keybinding) {
    const defaultKeybinding = defaultKeybindings.value[keybinding.combo.serialize()];
    const userUnsetKeybinding = userUnsetKeybindings.value[keybinding.combo.serialize()];
    if (keybinding.equals(defaultKeybinding) && keybinding.equals(userUnsetKeybinding)) {
      delete userUnsetKeybindings.value[keybinding.combo.serialize()];
      return;
    }
    if (defaultKeybinding && !defaultKeybinding.equals(userUnsetKeybinding)) {
      unsetKeybinding(defaultKeybinding);
    }
    addKeybinding(userKeybindings, keybinding, { existOk: true });
  }
  __name(addUserKeybinding, "addUserKeybinding");
  function unsetKeybinding(keybinding) {
    const serializedCombo = keybinding.combo.serialize();
    if (!(serializedCombo in keybindingByKeyCombo.value)) {
      console.warn(
        `Trying to unset non-exist keybinding: ${JSON.stringify(keybinding)}`
      );
      return;
    }
    if (userKeybindings.value[serializedCombo]?.equals(keybinding)) {
      delete userKeybindings.value[serializedCombo];
      return;
    }
    if (defaultKeybindings.value[serializedCombo]?.equals(keybinding)) {
      addKeybinding(userUnsetKeybindings, keybinding, { existOk: false });
      return;
    }
    throw new Error(`Unknown keybinding: ${JSON.stringify(keybinding)}`);
  }
  __name(unsetKeybinding, "unsetKeybinding");
  function updateKeybindingOnCommand(keybinding) {
    const currentKeybinding = getKeybindingByCommandId(keybinding.commandId);
    if (currentKeybinding?.equals(keybinding)) {
      return false;
    }
    if (currentKeybinding) {
      unsetKeybinding(currentKeybinding);
    }
    addUserKeybinding(keybinding);
    return true;
  }
  __name(updateKeybindingOnCommand, "updateKeybindingOnCommand");
  function resetKeybindings() {
    userKeybindings.value = {};
    userUnsetKeybindings.value = {};
  }
  __name(resetKeybindings, "resetKeybindings");
  function isCommandKeybindingModified(commandId) {
    const currentKeybinding = getKeybindingByCommandId(commandId);
    const defaultKeybinding = defaultKeybindingsByCommandId.value[commandId]?.[0];
    return !(currentKeybinding === void 0 && defaultKeybinding === void 0 || currentKeybinding?.equals(defaultKeybinding));
  }
  __name(isCommandKeybindingModified, "isCommandKeybindingModified");
  return {
    keybindings,
    getUserKeybindings,
    getUserUnsetKeybindings,
    getKeybinding,
    getKeybindingsByCommandId,
    getKeybindingByCommandId,
    addDefaultKeybinding,
    addUserKeybinding,
    unsetKeybinding,
    updateKeybindingOnCommand,
    resetKeybindings,
    isCommandKeybindingModified
  };
});
class ComfyCommandImpl {
  static {
    __name(this, "ComfyCommandImpl");
  }
  id;
  function;
  _label;
  _icon;
  _tooltip;
  _menubarLabel;
  versionAdded;
  confirmation;
  constructor(command2) {
    this.id = command2.id;
    this.function = command2.function;
    this._label = command2.label;
    this._icon = command2.icon;
    this._tooltip = command2.tooltip;
    this._menubarLabel = command2.menubarLabel ?? command2.label;
    this.versionAdded = command2.versionAdded;
    this.confirmation = command2.confirmation;
  }
  get label() {
    return typeof this._label === "function" ? this._label() : this._label;
  }
  get icon() {
    return typeof this._icon === "function" ? this._icon() : this._icon;
  }
  get tooltip() {
    return typeof this._tooltip === "function" ? this._tooltip() : this._tooltip;
  }
  get menubarLabel() {
    return typeof this._menubarLabel === "function" ? this._menubarLabel() : this._menubarLabel;
  }
  get keybinding() {
    return useKeybindingStore().getKeybindingByCommandId(this.id);
  }
}
const useCommandStore = /* @__PURE__ */ defineStore("command", () => {
  const commandsById = ref({});
  const commands2 = computed(() => Object.values(commandsById.value));
  const registerCommand = /* @__PURE__ */ __name((command2) => {
    if (commandsById.value[command2.id]) {
      console.warn(`Command ${command2.id} already registered`);
    }
    commandsById.value[command2.id] = new ComfyCommandImpl(command2);
  }, "registerCommand");
  const registerCommands = /* @__PURE__ */ __name((commands22) => {
    for (const command2 of commands22) {
      registerCommand(command2);
    }
  }, "registerCommands");
  const getCommand = /* @__PURE__ */ __name((command2) => {
    return commandsById.value[command2];
  }, "getCommand");
  const { wrapWithErrorHandlingAsync } = useErrorHandling();
  const execute = /* @__PURE__ */ __name(async (commandId, errorHandler) => {
    const command2 = getCommand(commandId);
    if (command2) {
      await wrapWithErrorHandlingAsync(command2.function, errorHandler)();
    } else {
      throw new Error(`Command ${commandId} not found`);
    }
  }, "execute");
  const isRegistered = /* @__PURE__ */ __name((command2) => {
    return !!commandsById.value[command2];
  }, "isRegistered");
  const loadExtensionCommands = /* @__PURE__ */ __name((extension) => {
    if (extension.commands) {
      for (const command2 of extension.commands) {
        registerCommand(command2);
      }
    }
  }, "loadExtensionCommands");
  return {
    commands: commands2,
    execute,
    getCommand,
    registerCommand,
    registerCommands,
    isRegistered,
    loadExtensionCommands
  };
});
const CORE_MENU_COMMANDS = [
  [["Workflow"], ["Comfy.NewBlankWorkflow"]],
  [["Workflow"], ["Comfy.OpenWorkflow", "Comfy.BrowseTemplates"]],
  [
    ["Workflow"],
    [
      "Comfy.SaveWorkflow",
      "Comfy.SaveWorkflowAs",
      "Comfy.ExportWorkflow",
      "Comfy.ExportWorkflowAPI"
    ]
  ],
  [["Edit"], ["Comfy.Undo", "Comfy.Redo"]],
  [["Edit"], ["Comfy.RefreshNodeDefinitions"]],
  [["Edit"], ["Comfy.ClearWorkflow"]],
  [["Edit"], ["Comfy.OpenClipspace"]],
  [
    ["Help"],
    [
      "Comfy.Help.OpenComfyUIIssues",
      "Comfy.Help.OpenComfyUIDocs",
      "Comfy.Help.OpenComfyOrgDiscord"
    ]
  ],
  [["Help"], ["Comfy.Help.AboutComfyUI"]]
];
const useMenuItemStore = /* @__PURE__ */ defineStore("menuItem", () => {
  const commandStore = useCommandStore();
  const menuItems = ref([]);
  const registerMenuGroup = /* @__PURE__ */ __name((path, items2) => {
    let currentLevel = menuItems.value;
    for (let i2 = 0; i2 < path.length; i2++) {
      const segment = path[i2];
      let found2 = currentLevel.find((item3) => item3.label === segment);
      if (!found2) {
        found2 = {
          label: segment,
          items: []
        };
        currentLevel.push(found2);
      }
      if (!found2.items) {
        found2.items = [];
      }
      currentLevel = found2.items;
    }
    if (currentLevel.length > 0) {
      currentLevel.push({
        separator: true
      });
    }
    currentLevel.push(...items2);
  }, "registerMenuGroup");
  const registerCommands = /* @__PURE__ */ __name((path, commandIds) => {
    const items2 = commandIds.map((commandId) => commandStore.getCommand(commandId)).map(
      (command2) => ({
        command: /* @__PURE__ */ __name(() => commandStore.execute(command2.id), "command"),
        label: command2.menubarLabel,
        icon: command2.icon,
        tooltip: command2.tooltip,
        comfyCommand: command2
      })
    );
    registerMenuGroup(path, items2);
  }, "registerCommands");
  const loadExtensionMenuCommands = /* @__PURE__ */ __name((extension) => {
    if (!extension.menuCommands) {
      return;
    }
    const extensionCommandIds = new Set(
      extension.commands?.map((command2) => command2.id) ?? []
    );
    extension.menuCommands.forEach((menuCommand) => {
      const commands2 = menuCommand.commands.filter(
        (command2) => extensionCommandIds.has(command2)
      );
      if (commands2.length) {
        registerCommands(menuCommand.path, commands2);
      }
    });
  }, "loadExtensionMenuCommands");
  const registerCoreMenuCommands = /* @__PURE__ */ __name(() => {
    for (const [path, commands2] of CORE_MENU_COMMANDS) {
      registerCommands(path, commands2);
    }
  }, "registerCoreMenuCommands");
  return {
    menuItems,
    registerMenuGroup,
    registerCommands,
    loadExtensionMenuCommands,
    registerCoreMenuCommands
  };
});
function OrderedMap(content2) {
  this.content = content2;
}
__name(OrderedMap, "OrderedMap");
OrderedMap.prototype = {
  constructor: OrderedMap,
  find: /* @__PURE__ */ __name(function(key) {
    for (var i2 = 0; i2 < this.content.length; i2 += 2)
      if (this.content[i2] === key) return i2;
    return -1;
  }, "find"),
  // :: (string) → ?any
  // Retrieve the value stored under `key`, or return undefined when
  // no such key exists.
  get: /* @__PURE__ */ __name(function(key) {
    var found2 = this.find(key);
    return found2 == -1 ? void 0 : this.content[found2 + 1];
  }, "get"),
  // :: (string, any, ?string) → OrderedMap
  // Create a new map by replacing the value of `key` with a new
  // value, or adding a binding to the end of the map. If `newKey` is
  // given, the key of the binding will be replaced with that key.
  update: /* @__PURE__ */ __name(function(key, value4, newKey) {
    var self2 = newKey && newKey != key ? this.remove(newKey) : this;
    var found2 = self2.find(key), content2 = self2.content.slice();
    if (found2 == -1) {
      content2.push(newKey || key, value4);
    } else {
      content2[found2 + 1] = value4;
      if (newKey) content2[found2] = newKey;
    }
    return new OrderedMap(content2);
  }, "update"),
  // :: (string) → OrderedMap
  // Return a map with the given key removed, if it existed.
  remove: /* @__PURE__ */ __name(function(key) {
    var found2 = this.find(key);
    if (found2 == -1) return this;
    var content2 = this.content.slice();
    content2.splice(found2, 2);
    return new OrderedMap(content2);
  }, "remove"),
  // :: (string, any) → OrderedMap
  // Add a new key to the start of the map.
  addToStart: /* @__PURE__ */ __name(function(key, value4) {
    return new OrderedMap([key, value4].concat(this.remove(key).content));
  }, "addToStart"),
  // :: (string, any) → OrderedMap
  // Add a new key to the end of the map.
  addToEnd: /* @__PURE__ */ __name(function(key, value4) {
    var content2 = this.remove(key).content.slice();
    content2.push(key, value4);
    return new OrderedMap(content2);
  }, "addToEnd"),
  // :: (string, string, any) → OrderedMap
  // Add a key after the given key. If `place` is not found, the new
  // key is added to the end.
  addBefore: /* @__PURE__ */ __name(function(place, key, value4) {
    var without = this.remove(key), content2 = without.content.slice();
    var found2 = without.find(place);
    content2.splice(found2 == -1 ? content2.length : found2, 0, key, value4);
    return new OrderedMap(content2);
  }, "addBefore"),
  // :: ((key: string, value: any))
  // Call the given function for each key/value pair in the map, in
  // order.
  forEach: /* @__PURE__ */ __name(function(f) {
    for (var i2 = 0; i2 < this.content.length; i2 += 2)
      f(this.content[i2], this.content[i2 + 1]);
  }, "forEach"),
  // :: (union<Object, OrderedMap>) → OrderedMap
  // Create a new map by prepending the keys in this map that don't
  // appear in `map` before the keys in `map`.
  prepend: /* @__PURE__ */ __name(function(map3) {
    map3 = OrderedMap.from(map3);
    if (!map3.size) return this;
    return new OrderedMap(map3.content.concat(this.subtract(map3).content));
  }, "prepend"),
  // :: (union<Object, OrderedMap>) → OrderedMap
  // Create a new map by appending the keys in this map that don't
  // appear in `map` after the keys in `map`.
  append: /* @__PURE__ */ __name(function(map3) {
    map3 = OrderedMap.from(map3);
    if (!map3.size) return this;
    return new OrderedMap(this.subtract(map3).content.concat(map3.content));
  }, "append"),
  // :: (union<Object, OrderedMap>) → OrderedMap
  // Create a map containing all the keys in this map that don't
  // appear in `map`.
  subtract: /* @__PURE__ */ __name(function(map3) {
    var result = this;
    map3 = OrderedMap.from(map3);
    for (var i2 = 0; i2 < map3.content.length; i2 += 2)
      result = result.remove(map3.content[i2]);
    return result;
  }, "subtract"),
  // :: () → Object
  // Turn ordered map into a plain object.
  toObject: /* @__PURE__ */ __name(function() {
    var result = {};
    this.forEach(function(key, value4) {
      result[key] = value4;
    });
    return result;
  }, "toObject"),
  // :: number
  // The amount of keys in this map.
  get size() {
    return this.content.length >> 1;
  }
};
OrderedMap.from = function(value4) {
  if (value4 instanceof OrderedMap) return value4;
  var content2 = [];
  if (value4) for (var prop2 in value4) content2.push(prop2, value4[prop2]);
  return new OrderedMap(content2);
};
function findDiffStart(a, b, pos2) {
  for (let i2 = 0; ; i2++) {
    if (i2 == a.childCount || i2 == b.childCount)
      return a.childCount == b.childCount ? null : pos2;
    let childA = a.child(i2), childB = b.child(i2);
    if (childA == childB) {
      pos2 += childA.nodeSize;
      continue;
    }
    if (!childA.sameMarkup(childB))
      return pos2;
    if (childA.isText && childA.text != childB.text) {
      for (let j = 0; childA.text[j] == childB.text[j]; j++)
        pos2++;
      return pos2;
    }
    if (childA.content.size || childB.content.size) {
      let inner = findDiffStart(childA.content, childB.content, pos2 + 1);
      if (inner != null)
        return inner;
    }
    pos2 += childA.nodeSize;
  }
}
__name(findDiffStart, "findDiffStart");
function findDiffEnd(a, b, posA, posB) {
  for (let iA = a.childCount, iB = b.childCount; ; ) {
    if (iA == 0 || iB == 0)
      return iA == iB ? null : { a: posA, b: posB };
    let childA = a.child(--iA), childB = b.child(--iB), size2 = childA.nodeSize;
    if (childA == childB) {
      posA -= size2;
      posB -= size2;
      continue;
    }
    if (!childA.sameMarkup(childB))
      return { a: posA, b: posB };
    if (childA.isText && childA.text != childB.text) {
      let same = 0, minSize = Math.min(childA.text.length, childB.text.length);
      while (same < minSize && childA.text[childA.text.length - same - 1] == childB.text[childB.text.length - same - 1]) {
        same++;
        posA--;
        posB--;
      }
      return { a: posA, b: posB };
    }
    if (childA.content.size || childB.content.size) {
      let inner = findDiffEnd(childA.content, childB.content, posA - 1, posB - 1);
      if (inner)
        return inner;
    }
    posA -= size2;
    posB -= size2;
  }
}
__name(findDiffEnd, "findDiffEnd");
class Fragment {
  static {
    __name(this, "Fragment");
  }
  /**
  @internal
  */
  constructor(content2, size2) {
    this.content = content2;
    this.size = size2 || 0;
    if (size2 == null)
      for (let i2 = 0; i2 < content2.length; i2++)
        this.size += content2[i2].nodeSize;
  }
  /**
  Invoke a callback for all descendant nodes between the given two
  positions (relative to start of this fragment). Doesn't descend
  into a node when the callback returns `false`.
  */
  nodesBetween(from2, to, f, nodeStart = 0, parent) {
    for (let i2 = 0, pos2 = 0; pos2 < to; i2++) {
      let child = this.content[i2], end = pos2 + child.nodeSize;
      if (end > from2 && f(child, nodeStart + pos2, parent || null, i2) !== false && child.content.size) {
        let start2 = pos2 + 1;
        child.nodesBetween(Math.max(0, from2 - start2), Math.min(child.content.size, to - start2), f, nodeStart + start2);
      }
      pos2 = end;
    }
  }
  /**
  Call the given callback for every descendant node. `pos` will be
  relative to the start of the fragment. The callback may return
  `false` to prevent traversal of a given node's children.
  */
  descendants(f) {
    this.nodesBetween(0, this.size, f);
  }
  /**
  Extract the text between `from` and `to`. See the same method on
  [`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).
  */
  textBetween(from2, to, blockSeparator, leafText) {
    let text2 = "", first2 = true;
    this.nodesBetween(from2, to, (node3, pos2) => {
      let nodeText = node3.isText ? node3.text.slice(Math.max(from2, pos2) - pos2, to - pos2) : !node3.isLeaf ? "" : leafText ? typeof leafText === "function" ? leafText(node3) : leafText : node3.type.spec.leafText ? node3.type.spec.leafText(node3) : "";
      if (node3.isBlock && (node3.isLeaf && nodeText || node3.isTextblock) && blockSeparator) {
        if (first2)
          first2 = false;
        else
          text2 += blockSeparator;
      }
      text2 += nodeText;
    }, 0);
    return text2;
  }
  /**
  Create a new fragment containing the combined content of this
  fragment and the other.
  */
  append(other) {
    if (!other.size)
      return this;
    if (!this.size)
      return other;
    let last = this.lastChild, first2 = other.firstChild, content2 = this.content.slice(), i2 = 0;
    if (last.isText && last.sameMarkup(first2)) {
      content2[content2.length - 1] = last.withText(last.text + first2.text);
      i2 = 1;
    }
    for (; i2 < other.content.length; i2++)
      content2.push(other.content[i2]);
    return new Fragment(content2, this.size + other.size);
  }
  /**
  Cut out the sub-fragment between the two given positions.
  */
  cut(from2, to = this.size) {
    if (from2 == 0 && to == this.size)
      return this;
    let result = [], size2 = 0;
    if (to > from2)
      for (let i2 = 0, pos2 = 0; pos2 < to; i2++) {
        let child = this.content[i2], end = pos2 + child.nodeSize;
        if (end > from2) {
          if (pos2 < from2 || end > to) {
            if (child.isText)
              child = child.cut(Math.max(0, from2 - pos2), Math.min(child.text.length, to - pos2));
            else
              child = child.cut(Math.max(0, from2 - pos2 - 1), Math.min(child.content.size, to - pos2 - 1));
          }
          result.push(child);
          size2 += child.nodeSize;
        }
        pos2 = end;
      }
    return new Fragment(result, size2);
  }
  /**
  @internal
  */
  cutByIndex(from2, to) {
    if (from2 == to)
      return Fragment.empty;
    if (from2 == 0 && to == this.content.length)
      return this;
    return new Fragment(this.content.slice(from2, to));
  }
  /**
  Create a new fragment in which the node at the given index is
  replaced by the given node.
  */
  replaceChild(index2, node3) {
    let current = this.content[index2];
    if (current == node3)
      return this;
    let copy2 = this.content.slice();
    let size2 = this.size + node3.nodeSize - current.nodeSize;
    copy2[index2] = node3;
    return new Fragment(copy2, size2);
  }
  /**
  Create a new fragment by prepending the given node to this
  fragment.
  */
  addToStart(node3) {
    return new Fragment([node3].concat(this.content), this.size + node3.nodeSize);
  }
  /**
  Create a new fragment by appending the given node to this
  fragment.
  */
  addToEnd(node3) {
    return new Fragment(this.content.concat(node3), this.size + node3.nodeSize);
  }
  /**
  Compare this fragment to another one.
  */
  eq(other) {
    if (this.content.length != other.content.length)
      return false;
    for (let i2 = 0; i2 < this.content.length; i2++)
      if (!this.content[i2].eq(other.content[i2]))
        return false;
    return true;
  }
  /**
  The first child of the fragment, or `null` if it is empty.
  */
  get firstChild() {
    return this.content.length ? this.content[0] : null;
  }
  /**
  The last child of the fragment, or `null` if it is empty.
  */
  get lastChild() {
    return this.content.length ? this.content[this.content.length - 1] : null;
  }
  /**
  The number of child nodes in this fragment.
  */
  get childCount() {
    return this.content.length;
  }
  /**
  Get the child node at the given index. Raise an error when the
  index is out of range.
  */
  child(index2) {
    let found2 = this.content[index2];
    if (!found2)
      throw new RangeError("Index " + index2 + " out of range for " + this);
    return found2;
  }
  /**
  Get the child node at the given index, if it exists.
  */
  maybeChild(index2) {
    return this.content[index2] || null;
  }
  /**
  Call `f` for every child node, passing the node, its offset
  into this parent node, and its index.
  */
  forEach(f) {
    for (let i2 = 0, p2 = 0; i2 < this.content.length; i2++) {
      let child = this.content[i2];
      f(child, p2, i2);
      p2 += child.nodeSize;
    }
  }
  /**
  Find the first position at which this fragment and another
  fragment differ, or `null` if they are the same.
  */
  findDiffStart(other, pos2 = 0) {
    return findDiffStart(this, other, pos2);
  }
  /**
  Find the first position, searching from the end, at which this
  fragment and the given fragment differ, or `null` if they are
  the same. Since this position will not be the same in both
  nodes, an object with two separate positions is returned.
  */
  findDiffEnd(other, pos2 = this.size, otherPos = other.size) {
    return findDiffEnd(this, other, pos2, otherPos);
  }
  /**
  Find the index and inner offset corresponding to a given relative
  position in this fragment. The result object will be reused
  (overwritten) the next time the function is called. @internal
  */
  findIndex(pos2, round = -1) {
    if (pos2 == 0)
      return retIndex(0, pos2);
    if (pos2 == this.size)
      return retIndex(this.content.length, pos2);
    if (pos2 > this.size || pos2 < 0)
      throw new RangeError(`Position ${pos2} outside of fragment (${this})`);
    for (let i2 = 0, curPos = 0; ; i2++) {
      let cur = this.child(i2), end = curPos + cur.nodeSize;
      if (end >= pos2) {
        if (end == pos2 || round > 0)
          return retIndex(i2 + 1, end);
        return retIndex(i2, curPos);
      }
      curPos = end;
    }
  }
  /**
  Return a debugging string that describes this fragment.
  */
  toString() {
    return "<" + this.toStringInner() + ">";
  }
  /**
  @internal
  */
  toStringInner() {
    return this.content.join(", ");
  }
  /**
  Create a JSON-serializeable representation of this fragment.
  */
  toJSON() {
    return this.content.length ? this.content.map((n) => n.toJSON()) : null;
  }
  /**
  Deserialize a fragment from its JSON representation.
  */
  static fromJSON(schema2, value4) {
    if (!value4)
      return Fragment.empty;
    if (!Array.isArray(value4))
      throw new RangeError("Invalid input for Fragment.fromJSON");
    return new Fragment(value4.map(schema2.nodeFromJSON));
  }
  /**
  Build a fragment from an array of nodes. Ensures that adjacent
  text nodes with the same marks are joined together.
  */
  static fromArray(array) {
    if (!array.length)
      return Fragment.empty;
    let joined, size2 = 0;
    for (let i2 = 0; i2 < array.length; i2++) {
      let node3 = array[i2];
      size2 += node3.nodeSize;
      if (i2 && node3.isText && array[i2 - 1].sameMarkup(node3)) {
        if (!joined)
          joined = array.slice(0, i2);
        joined[joined.length - 1] = node3.withText(joined[joined.length - 1].text + node3.text);
      } else if (joined) {
        joined.push(node3);
      }
    }
    return new Fragment(joined || array, size2);
  }
  /**
  Create a fragment from something that can be interpreted as a
  set of nodes. For `null`, it returns the empty fragment. For a
  fragment, the fragment itself. For a node or array of nodes, a
  fragment containing those nodes.
  */
  static from(nodes) {
    if (!nodes)
      return Fragment.empty;
    if (nodes instanceof Fragment)
      return nodes;
    if (Array.isArray(nodes))
      return this.fromArray(nodes);
    if (nodes.attrs)
      return new Fragment([nodes], nodes.nodeSize);
    throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
  }
}
Fragment.empty = new Fragment([], 0);
const found = { index: 0, offset: 0 };
function retIndex(index2, offset) {
  found.index = index2;
  found.offset = offset;
  return found;
}
__name(retIndex, "retIndex");
function compareDeep(a, b) {
  if (a === b)
    return true;
  if (!(a && typeof a == "object") || !(b && typeof b == "object"))
    return false;
  let array = Array.isArray(a);
  if (Array.isArray(b) != array)
    return false;
  if (array) {
    if (a.length != b.length)
      return false;
    for (let i2 = 0; i2 < a.length; i2++)
      if (!compareDeep(a[i2], b[i2]))
        return false;
  } else {
    for (let p2 in a)
      if (!(p2 in b) || !compareDeep(a[p2], b[p2]))
        return false;
    for (let p2 in b)
      if (!(p2 in a))
        return false;
  }
  return true;
}
__name(compareDeep, "compareDeep");
let Mark$1 = class Mark2 {
  static {
    __name(this, "Mark");
  }
  /**
  @internal
  */
  constructor(type, attrs4) {
    this.type = type;
    this.attrs = attrs4;
  }
  /**
  Given a set of marks, create a new set which contains this one as
  well, in the right position. If this mark is already in the set,
  the set itself is returned. If any marks that are set to be
  [exclusive](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) with this mark are present,
  those are replaced by this one.
  */
  addToSet(set3) {
    let copy2, placed = false;
    for (let i2 = 0; i2 < set3.length; i2++) {
      let other = set3[i2];
      if (this.eq(other))
        return set3;
      if (this.type.excludes(other.type)) {
        if (!copy2)
          copy2 = set3.slice(0, i2);
      } else if (other.type.excludes(this.type)) {
        return set3;
      } else {
        if (!placed && other.type.rank > this.type.rank) {
          if (!copy2)
            copy2 = set3.slice(0, i2);
          copy2.push(this);
          placed = true;
        }
        if (copy2)
          copy2.push(other);
      }
    }
    if (!copy2)
      copy2 = set3.slice();
    if (!placed)
      copy2.push(this);
    return copy2;
  }
  /**
  Remove this mark from the given set, returning a new set. If this
  mark is not in the set, the set itself is returned.
  */
  removeFromSet(set3) {
    for (let i2 = 0; i2 < set3.length; i2++)
      if (this.eq(set3[i2]))
        return set3.slice(0, i2).concat(set3.slice(i2 + 1));
    return set3;
  }
  /**
  Test whether this mark is in the given set of marks.
  */
  isInSet(set3) {
    for (let i2 = 0; i2 < set3.length; i2++)
      if (this.eq(set3[i2]))
        return true;
    return false;
  }
  /**
  Test whether this mark has the same type and attributes as
  another mark.
  */
  eq(other) {
    return this == other || this.type == other.type && compareDeep(this.attrs, other.attrs);
  }
  /**
  Convert this mark to a JSON-serializeable representation.
  */
  toJSON() {
    let obj = { type: this.type.name };
    for (let _2 in this.attrs) {
      obj.attrs = this.attrs;
      break;
    }
    return obj;
  }
  /**
  Deserialize a mark from JSON.
  */
  static fromJSON(schema2, json) {
    if (!json)
      throw new RangeError("Invalid input for Mark.fromJSON");
    let type = schema2.marks[json.type];
    if (!type)
      throw new RangeError(`There is no mark type ${json.type} in this schema`);
    let mark2 = type.create(json.attrs);
    type.checkAttrs(mark2.attrs);
    return mark2;
  }
  /**
  Test whether two sets of marks are identical.
  */
  static sameSet(a, b) {
    if (a == b)
      return true;
    if (a.length != b.length)
      return false;
    for (let i2 = 0; i2 < a.length; i2++)
      if (!a[i2].eq(b[i2]))
        return false;
    return true;
  }
  /**
  Create a properly sorted mark set from null, a single mark, or an
  unsorted array of marks.
  */
  static setFrom(marks) {
    if (!marks || Array.isArray(marks) && marks.length == 0)
      return Mark2.none;
    if (marks instanceof Mark2)
      return [marks];
    let copy2 = marks.slice();
    copy2.sort((a, b) => a.type.rank - b.type.rank);
    return copy2;
  }
};
Mark$1.none = [];
class ReplaceError extends Error {
  static {
    __name(this, "ReplaceError");
  }
}
class Slice {
  static {
    __name(this, "Slice");
  }
  /**
  Create a slice. When specifying a non-zero open depth, you must
  make sure that there are nodes of at least that depth at the
  appropriate side of the fragment—i.e. if the fragment is an
  empty paragraph node, `openStart` and `openEnd` can't be greater
  than 1.
  
  It is not necessary for the content of open nodes to conform to
  the schema's content constraints, though it should be a valid
  start/end/middle for such a node, depending on which sides are
  open.
  */
  constructor(content2, openStart, openEnd) {
    this.content = content2;
    this.openStart = openStart;
    this.openEnd = openEnd;
  }
  /**
  The size this slice would add when inserted into a document.
  */
  get size() {
    return this.content.size - this.openStart - this.openEnd;
  }
  /**
  @internal
  */
  insertAt(pos2, fragment) {
    let content2 = insertInto(this.content, pos2 + this.openStart, fragment);
    return content2 && new Slice(content2, this.openStart, this.openEnd);
  }
  /**
  @internal
  */
  removeBetween(from2, to) {
    return new Slice(removeRange(this.content, from2 + this.openStart, to + this.openStart), this.openStart, this.openEnd);
  }
  /**
  Tests whether this slice is equal to another slice.
  */
  eq(other) {
    return this.content.eq(other.content) && this.openStart == other.openStart && this.openEnd == other.openEnd;
  }
  /**
  @internal
  */
  toString() {
    return this.content + "(" + this.openStart + "," + this.openEnd + ")";
  }
  /**
  Convert a slice to a JSON-serializable representation.
  */
  toJSON() {
    if (!this.content.size)
      return null;
    let json = { content: this.content.toJSON() };
    if (this.openStart > 0)
      json.openStart = this.openStart;
    if (this.openEnd > 0)
      json.openEnd = this.openEnd;
    return json;
  }
  /**
  Deserialize a slice from its JSON representation.
  */
  static fromJSON(schema2, json) {
    if (!json)
      return Slice.empty;
    let openStart = json.openStart || 0, openEnd = json.openEnd || 0;
    if (typeof openStart != "number" || typeof openEnd != "number")
      throw new RangeError("Invalid input for Slice.fromJSON");
    return new Slice(Fragment.fromJSON(schema2, json.content), openStart, openEnd);
  }
  /**
  Create a slice from a fragment by taking the maximum possible
  open value on both side of the fragment.
  */
  static maxOpen(fragment, openIsolating = true) {
    let openStart = 0, openEnd = 0;
    for (let n = fragment.firstChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.firstChild)
      openStart++;
    for (let n = fragment.lastChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.lastChild)
      openEnd++;
    return new Slice(fragment, openStart, openEnd);
  }
}
Slice.empty = new Slice(Fragment.empty, 0, 0);
function removeRange(content2, from2, to) {
  let { index: index2, offset } = content2.findIndex(from2), child = content2.maybeChild(index2);
  let { index: indexTo, offset: offsetTo } = content2.findIndex(to);
  if (offset == from2 || child.isText) {
    if (offsetTo != to && !content2.child(indexTo).isText)
      throw new RangeError("Removing non-flat range");
    return content2.cut(0, from2).append(content2.cut(to));
  }
  if (index2 != indexTo)
    throw new RangeError("Removing non-flat range");
  return content2.replaceChild(index2, child.copy(removeRange(child.content, from2 - offset - 1, to - offset - 1)));
}
__name(removeRange, "removeRange");
function insertInto(content2, dist3, insert2, parent) {
  let { index: index2, offset } = content2.findIndex(dist3), child = content2.maybeChild(index2);
  if (offset == dist3 || child.isText) {
    if (parent && !parent.canReplace(index2, index2, insert2))
      return null;
    return content2.cut(0, dist3).append(insert2).append(content2.cut(dist3));
  }
  let inner = insertInto(child.content, dist3 - offset - 1, insert2);
  return inner && content2.replaceChild(index2, child.copy(inner));
}
__name(insertInto, "insertInto");
function replace$1($from, $to, slice2) {
  if (slice2.openStart > $from.depth)
    throw new ReplaceError("Inserted content deeper than insertion position");
  if ($from.depth - slice2.openStart != $to.depth - slice2.openEnd)
    throw new ReplaceError("Inconsistent open depths");
  return replaceOuter($from, $to, slice2, 0);
}
__name(replace$1, "replace$1");
function replaceOuter($from, $to, slice2, depth) {
  let index2 = $from.index(depth), node3 = $from.node(depth);
  if (index2 == $to.index(depth) && depth < $from.depth - slice2.openStart) {
    let inner = replaceOuter($from, $to, slice2, depth + 1);
    return node3.copy(node3.content.replaceChild(index2, inner));
  } else if (!slice2.content.size) {
    return close(node3, replaceTwoWay($from, $to, depth));
  } else if (!slice2.openStart && !slice2.openEnd && $from.depth == depth && $to.depth == depth) {
    let parent = $from.parent, content2 = parent.content;
    return close(parent, content2.cut(0, $from.parentOffset).append(slice2.content).append(content2.cut($to.parentOffset)));
  } else {
    let { start: start2, end } = prepareSliceForReplace(slice2, $from);
    return close(node3, replaceThreeWay($from, start2, end, $to, depth));
  }
}
__name(replaceOuter, "replaceOuter");
function checkJoin(main, sub) {
  if (!sub.type.compatibleContent(main.type))
    throw new ReplaceError("Cannot join " + sub.type.name + " onto " + main.type.name);
}
__name(checkJoin, "checkJoin");
function joinable$1($before, $after, depth) {
  let node3 = $before.node(depth);
  checkJoin(node3, $after.node(depth));
  return node3;
}
__name(joinable$1, "joinable$1");
function addNode(child, target) {
  let last = target.length - 1;
  if (last >= 0 && child.isText && child.sameMarkup(target[last]))
    target[last] = child.withText(target[last].text + child.text);
  else
    target.push(child);
}
__name(addNode, "addNode");
function addRange($start, $end, depth, target) {
  let node3 = ($end || $start).node(depth);
  let startIndex = 0, endIndex = $end ? $end.index(depth) : node3.childCount;
  if ($start) {
    startIndex = $start.index(depth);
    if ($start.depth > depth) {
      startIndex++;
    } else if ($start.textOffset) {
      addNode($start.nodeAfter, target);
      startIndex++;
    }
  }
  for (let i2 = startIndex; i2 < endIndex; i2++)
    addNode(node3.child(i2), target);
  if ($end && $end.depth == depth && $end.textOffset)
    addNode($end.nodeBefore, target);
}
__name(addRange, "addRange");
function close(node3, content2) {
  node3.type.checkContent(content2);
  return node3.copy(content2);
}
__name(close, "close");
function replaceThreeWay($from, $start, $end, $to, depth) {
  let openStart = $from.depth > depth && joinable$1($from, $start, depth + 1);
  let openEnd = $to.depth > depth && joinable$1($end, $to, depth + 1);
  let content2 = [];
  addRange(null, $from, depth, content2);
  if (openStart && openEnd && $start.index(depth) == $end.index(depth)) {
    checkJoin(openStart, openEnd);
    addNode(close(openStart, replaceThreeWay($from, $start, $end, $to, depth + 1)), content2);
  } else {
    if (openStart)
      addNode(close(openStart, replaceTwoWay($from, $start, depth + 1)), content2);
    addRange($start, $end, depth, content2);
    if (openEnd)
      addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content2);
  }
  addRange($to, null, depth, content2);
  return new Fragment(content2);
}
__name(replaceThreeWay, "replaceThreeWay");
function replaceTwoWay($from, $to, depth) {
  let content2 = [];
  addRange(null, $from, depth, content2);
  if ($from.depth > depth) {
    let type = joinable$1($from, $to, depth + 1);
    addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content2);
  }
  addRange($to, null, depth, content2);
  return new Fragment(content2);
}
__name(replaceTwoWay, "replaceTwoWay");
function prepareSliceForReplace(slice2, $along) {
  let extra = $along.depth - slice2.openStart, parent = $along.node(extra);
  let node3 = parent.copy(slice2.content);
  for (let i2 = extra - 1; i2 >= 0; i2--)
    node3 = $along.node(i2).copy(Fragment.from(node3));
  return {
    start: node3.resolveNoCache(slice2.openStart + extra),
    end: node3.resolveNoCache(node3.content.size - slice2.openEnd - extra)
  };
}
__name(prepareSliceForReplace, "prepareSliceForReplace");
class ResolvedPos {
  static {
    __name(this, "ResolvedPos");
  }
  /**
  @internal
  */
  constructor(pos2, path, parentOffset) {
    this.pos = pos2;
    this.path = path;
    this.parentOffset = parentOffset;
    this.depth = path.length / 3 - 1;
  }
  /**
  @internal
  */
  resolveDepth(val) {
    if (val == null)
      return this.depth;
    if (val < 0)
      return this.depth + val;
    return val;
  }
  /**
  The parent node that the position points into. Note that even if
  a position points into a text node, that node is not considered
  the parent—text nodes are ‘flat’ in this model, and have no content.
  */
  get parent() {
    return this.node(this.depth);
  }
  /**
  The root node in which the position was resolved.
  */
  get doc() {
    return this.node(0);
  }
  /**
  The ancestor node at the given level. `p.node(p.depth)` is the
  same as `p.parent`.
  */
  node(depth) {
    return this.path[this.resolveDepth(depth) * 3];
  }
  /**
  The index into the ancestor at the given level. If this points
  at the 3rd node in the 2nd paragraph on the top level, for
  example, `p.index(0)` is 1 and `p.index(1)` is 2.
  */
  index(depth) {
    return this.path[this.resolveDepth(depth) * 3 + 1];
  }
  /**
  The index pointing after this position into the ancestor at the
  given level.
  */
  indexAfter(depth) {
    depth = this.resolveDepth(depth);
    return this.index(depth) + (depth == this.depth && !this.textOffset ? 0 : 1);
  }
  /**
  The (absolute) position at the start of the node at the given
  level.
  */
  start(depth) {
    depth = this.resolveDepth(depth);
    return depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;
  }
  /**
  The (absolute) position at the end of the node at the given
  level.
  */
  end(depth) {
    depth = this.resolveDepth(depth);
    return this.start(depth) + this.node(depth).content.size;
  }
  /**
  The (absolute) position directly before the wrapping node at the
  given level, or, when `depth` is `this.depth + 1`, the original
  position.
  */
  before(depth) {
    depth = this.resolveDepth(depth);
    if (!depth)
      throw new RangeError("There is no position before the top-level node");
    return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1];
  }
  /**
  The (absolute) position directly after the wrapping node at the
  given level, or the original position when `depth` is `this.depth + 1`.
  */
  after(depth) {
    depth = this.resolveDepth(depth);
    if (!depth)
      throw new RangeError("There is no position after the top-level node");
    return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1] + this.path[depth * 3].nodeSize;
  }
  /**
  When this position points into a text node, this returns the
  distance between the position and the start of the text node.
  Will be zero for positions that point between nodes.
  */
  get textOffset() {
    return this.pos - this.path[this.path.length - 1];
  }
  /**
  Get the node directly after the position, if any. If the position
  points into a text node, only the part of that node after the
  position is returned.
  */
  get nodeAfter() {
    let parent = this.parent, index2 = this.index(this.depth);
    if (index2 == parent.childCount)
      return null;
    let dOff = this.pos - this.path[this.path.length - 1], child = parent.child(index2);
    return dOff ? parent.child(index2).cut(dOff) : child;
  }
  /**
  Get the node directly before the position, if any. If the
  position points into a text node, only the part of that node
  before the position is returned.
  */
  get nodeBefore() {
    let index2 = this.index(this.depth);
    let dOff = this.pos - this.path[this.path.length - 1];
    if (dOff)
      return this.parent.child(index2).cut(0, dOff);
    return index2 == 0 ? null : this.parent.child(index2 - 1);
  }
  /**
  Get the position at the given index in the parent node at the
  given depth (which defaults to `this.depth`).
  */
  posAtIndex(index2, depth) {
    depth = this.resolveDepth(depth);
    let node3 = this.path[depth * 3], pos2 = depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;
    for (let i2 = 0; i2 < index2; i2++)
      pos2 += node3.child(i2).nodeSize;
    return pos2;
  }
  /**
  Get the marks at this position, factoring in the surrounding
  marks' [`inclusive`](https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive) property. If the
  position is at the start of a non-empty node, the marks of the
  node after it (if any) are returned.
  */
  marks() {
    let parent = this.parent, index2 = this.index();
    if (parent.content.size == 0)
      return Mark$1.none;
    if (this.textOffset)
      return parent.child(index2).marks;
    let main = parent.maybeChild(index2 - 1), other = parent.maybeChild(index2);
    if (!main) {
      let tmp = main;
      main = other;
      other = tmp;
    }
    let marks = main.marks;
    for (var i2 = 0; i2 < marks.length; i2++)
      if (marks[i2].type.spec.inclusive === false && (!other || !marks[i2].isInSet(other.marks)))
        marks = marks[i2--].removeFromSet(marks);
    return marks;
  }
  /**
  Get the marks after the current position, if any, except those
  that are non-inclusive and not present at position `$end`. This
  is mostly useful for getting the set of marks to preserve after a
  deletion. Will return `null` if this position is at the end of
  its parent node or its parent node isn't a textblock (in which
  case no marks should be preserved).
  */
  marksAcross($end) {
    let after = this.parent.maybeChild(this.index());
    if (!after || !after.isInline)
      return null;
    let marks = after.marks, next2 = $end.parent.maybeChild($end.index());
    for (var i2 = 0; i2 < marks.length; i2++)
      if (marks[i2].type.spec.inclusive === false && (!next2 || !marks[i2].isInSet(next2.marks)))
        marks = marks[i2--].removeFromSet(marks);
    return marks;
  }
  /**
  The depth up to which this position and the given (non-resolved)
  position share the same parent nodes.
  */
  sharedDepth(pos2) {
    for (let depth = this.depth; depth > 0; depth--)
      if (this.start(depth) <= pos2 && this.end(depth) >= pos2)
        return depth;
    return 0;
  }
  /**
  Returns a range based on the place where this position and the
  given position diverge around block content. If both point into
  the same textblock, for example, a range around that textblock
  will be returned. If they point into different blocks, the range
  around those blocks in their shared ancestor is returned. You can
  pass in an optional predicate that will be called with a parent
  node to see if a range into that parent is acceptable.
  */
  blockRange(other = this, pred) {
    if (other.pos < this.pos)
      return other.blockRange(this);
    for (let d = this.depth - (this.parent.inlineContent || this.pos == other.pos ? 1 : 0); d >= 0; d--)
      if (other.pos <= this.end(d) && (!pred || pred(this.node(d))))
        return new NodeRange(this, other, d);
    return null;
  }
  /**
  Query whether the given position shares the same parent node.
  */
  sameParent(other) {
    return this.pos - this.parentOffset == other.pos - other.parentOffset;
  }
  /**
  Return the greater of this and the given position.
  */
  max(other) {
    return other.pos > this.pos ? other : this;
  }
  /**
  Return the smaller of this and the given position.
  */
  min(other) {
    return other.pos < this.pos ? other : this;
  }
  /**
  @internal
  */
  toString() {
    let str = "";
    for (let i2 = 1; i2 <= this.depth; i2++)
      str += (str ? "/" : "") + this.node(i2).type.name + "_" + this.index(i2 - 1);
    return str + ":" + this.parentOffset;
  }
  /**
  @internal
  */
  static resolve(doc2, pos2) {
    if (!(pos2 >= 0 && pos2 <= doc2.content.size))
      throw new RangeError("Position " + pos2 + " out of range");
    let path = [];
    let start2 = 0, parentOffset = pos2;
    for (let node3 = doc2; ; ) {
      let { index: index2, offset } = node3.content.findIndex(parentOffset);
      let rem = parentOffset - offset;
      path.push(node3, index2, start2 + offset);
      if (!rem)
        break;
      node3 = node3.child(index2);
      if (node3.isText)
        break;
      parentOffset = rem - 1;
      start2 += offset + 1;
    }
    return new ResolvedPos(pos2, path, parentOffset);
  }
  /**
  @internal
  */
  static resolveCached(doc2, pos2) {
    let cache2 = resolveCache.get(doc2);
    if (cache2) {
      for (let i2 = 0; i2 < cache2.elts.length; i2++) {
        let elt = cache2.elts[i2];
        if (elt.pos == pos2)
          return elt;
      }
    } else {
      resolveCache.set(doc2, cache2 = new ResolveCache());
    }
    let result = cache2.elts[cache2.i] = ResolvedPos.resolve(doc2, pos2);
    cache2.i = (cache2.i + 1) % resolveCacheSize;
    return result;
  }
}
class ResolveCache {
  static {
    __name(this, "ResolveCache");
  }
  constructor() {
    this.elts = [];
    this.i = 0;
  }
}
const resolveCacheSize = 12, resolveCache = /* @__PURE__ */ new WeakMap();
class NodeRange {
  static {
    __name(this, "NodeRange");
  }
  /**
  Construct a node range. `$from` and `$to` should point into the
  same node until at least the given `depth`, since a node range
  denotes an adjacent set of nodes in a single parent node.
  */
  constructor($from, $to, depth) {
    this.$from = $from;
    this.$to = $to;
    this.depth = depth;
  }
  /**
  The position at the start of the range.
  */
  get start() {
    return this.$from.before(this.depth + 1);
  }
  /**
  The position at the end of the range.
  */
  get end() {
    return this.$to.after(this.depth + 1);
  }
  /**
  The parent node that the range points into.
  */
  get parent() {
    return this.$from.node(this.depth);
  }
  /**
  The start index of the range in the parent node.
  */
  get startIndex() {
    return this.$from.index(this.depth);
  }
  /**
  The end index of the range in the parent node.
  */
  get endIndex() {
    return this.$to.indexAfter(this.depth);
  }
}
const emptyAttrs = /* @__PURE__ */ Object.create(null);
let Node$2 = class Node2 {
  static {
    __name(this, "Node");
  }
  /**
  @internal
  */
  constructor(type, attrs4, content2, marks = Mark$1.none) {
    this.type = type;
    this.attrs = attrs4;
    this.marks = marks;
    this.content = content2 || Fragment.empty;
  }
  /**
  The array of this node's child nodes.
  */
  get children() {
    return this.content.content;
  }
  /**
  The size of this node, as defined by the integer-based [indexing
  scheme](/docs/guide/#doc.indexing). For text nodes, this is the
  amount of characters. For other leaf nodes, it is one. For
  non-leaf nodes, it is the size of the content plus two (the
  start and end token).
  */
  get nodeSize() {
    return this.isLeaf ? 1 : 2 + this.content.size;
  }
  /**
  The number of children that the node has.
  */
  get childCount() {
    return this.content.childCount;
  }
  /**
  Get the child node at the given index. Raises an error when the
  index is out of range.
  */
  child(index2) {
    return this.content.child(index2);
  }
  /**
  Get the child node at the given index, if it exists.
  */
  maybeChild(index2) {
    return this.content.maybeChild(index2);
  }
  /**
  Call `f` for every child node, passing the node, its offset
  into this parent node, and its index.
  */
  forEach(f) {
    this.content.forEach(f);
  }
  /**
  Invoke a callback for all descendant nodes recursively between
  the given two positions that are relative to start of this
  node's content. The callback is invoked with the node, its
  position relative to the original node (method receiver),
  its parent node, and its child index. When the callback returns
  false for a given node, that node's children will not be
  recursed over. The last parameter can be used to specify a
  starting position to count from.
  */
  nodesBetween(from2, to, f, startPos = 0) {
    this.content.nodesBetween(from2, to, f, startPos, this);
  }
  /**
  Call the given callback for every descendant node. Doesn't
  descend into a node when the callback returns `false`.
  */
  descendants(f) {
    this.nodesBetween(0, this.content.size, f);
  }
  /**
  Concatenates all the text nodes found in this fragment and its
  children.
  */
  get textContent() {
    return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, "");
  }
  /**
  Get all text between positions `from` and `to`. When
  `blockSeparator` is given, it will be inserted to separate text
  from different block nodes. If `leafText` is given, it'll be
  inserted for every non-text leaf node encountered, otherwise
  [`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec^leafText) will be used.
  */
  textBetween(from2, to, blockSeparator, leafText) {
    return this.content.textBetween(from2, to, blockSeparator, leafText);
  }
  /**
  Returns this node's first child, or `null` if there are no
  children.
  */
  get firstChild() {
    return this.content.firstChild;
  }
  /**
  Returns this node's last child, or `null` if there are no
  children.
  */
  get lastChild() {
    return this.content.lastChild;
  }
  /**
  Test whether two nodes represent the same piece of document.
  */
  eq(other) {
    return this == other || this.sameMarkup(other) && this.content.eq(other.content);
  }
  /**
  Compare the markup (type, attributes, and marks) of this node to
  those of another. Returns `true` if both have the same markup.
  */
  sameMarkup(other) {
    return this.hasMarkup(other.type, other.attrs, other.marks);
  }
  /**
  Check whether this node's markup correspond to the given type,
  attributes, and marks.
  */
  hasMarkup(type, attrs4, marks) {
    return this.type == type && compareDeep(this.attrs, attrs4 || type.defaultAttrs || emptyAttrs) && Mark$1.sameSet(this.marks, marks || Mark$1.none);
  }
  /**
  Create a new node with the same markup as this node, containing
  the given content (or empty, if no content is given).
  */
  copy(content2 = null) {
    if (content2 == this.content)
      return this;
    return new Node2(this.type, this.attrs, content2, this.marks);
  }
  /**
  Create a copy of this node, with the given set of marks instead
  of the node's own marks.
  */
  mark(marks) {
    return marks == this.marks ? this : new Node2(this.type, this.attrs, this.content, marks);
  }
  /**
  Create a copy of this node with only the content between the
  given positions. If `to` is not given, it defaults to the end of
  the node.
  */
  cut(from2, to = this.content.size) {
    if (from2 == 0 && to == this.content.size)
      return this;
    return this.copy(this.content.cut(from2, to));
  }
  /**
  Cut out the part of the document between the given positions, and
  return it as a `Slice` object.
  */
  slice(from2, to = this.content.size, includeParents = false) {
    if (from2 == to)
      return Slice.empty;
    let $from = this.resolve(from2), $to = this.resolve(to);
    let depth = includeParents ? 0 : $from.sharedDepth(to);
    let start2 = $from.start(depth), node3 = $from.node(depth);
    let content2 = node3.content.cut($from.pos - start2, $to.pos - start2);
    return new Slice(content2, $from.depth - depth, $to.depth - depth);
  }
  /**
  Replace the part of the document between the given positions with
  the given slice. The slice must 'fit', meaning its open sides
  must be able to connect to the surrounding content, and its
  content nodes must be valid children for the node they are placed
  into. If any of this is violated, an error of type
  [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
  */
  replace(from2, to, slice2) {
    return replace$1(this.resolve(from2), this.resolve(to), slice2);
  }
  /**
  Find the node directly after the given position.
  */
  nodeAt(pos2) {
    for (let node3 = this; ; ) {
      let { index: index2, offset } = node3.content.findIndex(pos2);
      node3 = node3.maybeChild(index2);
      if (!node3)
        return null;
      if (offset == pos2 || node3.isText)
        return node3;
      pos2 -= offset + 1;
    }
  }
  /**
  Find the (direct) child node after the given offset, if any,
  and return it along with its index and offset relative to this
  node.
  */
  childAfter(pos2) {
    let { index: index2, offset } = this.content.findIndex(pos2);
    return { node: this.content.maybeChild(index2), index: index2, offset };
  }
  /**
  Find the (direct) child node before the given offset, if any,
  and return it along with its index and offset relative to this
  node.
  */
  childBefore(pos2) {
    if (pos2 == 0)
      return { node: null, index: 0, offset: 0 };
    let { index: index2, offset } = this.content.findIndex(pos2);
    if (offset < pos2)
      return { node: this.content.child(index2), index: index2, offset };
    let node3 = this.content.child(index2 - 1);
    return { node: node3, index: index2 - 1, offset: offset - node3.nodeSize };
  }
  /**
  Resolve the given position in the document, returning an
  [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
  */
  resolve(pos2) {
    return ResolvedPos.resolveCached(this, pos2);
  }
  /**
  @internal
  */
  resolveNoCache(pos2) {
    return ResolvedPos.resolve(this, pos2);
  }
  /**
  Test whether a given mark or mark type occurs in this document
  between the two given positions.
  */
  rangeHasMark(from2, to, type) {
    let found2 = false;
    if (to > from2)
      this.nodesBetween(from2, to, (node3) => {
        if (type.isInSet(node3.marks))
          found2 = true;
        return !found2;
      });
    return found2;
  }
  /**
  True when this is a block (non-inline node)
  */
  get isBlock() {
    return this.type.isBlock;
  }
  /**
  True when this is a textblock node, a block node with inline
  content.
  */
  get isTextblock() {
    return this.type.isTextblock;
  }
  /**
  True when this node allows inline content.
  */
  get inlineContent() {
    return this.type.inlineContent;
  }
  /**
  True when this is an inline node (a text node or a node that can
  appear among text).
  */
  get isInline() {
    return this.type.isInline;
  }
  /**
  True when this is a text node.
  */
  get isText() {
    return this.type.isText;
  }
  /**
  True when this is a leaf node.
  */
  get isLeaf() {
    return this.type.isLeaf;
  }
  /**
  True when this is an atom, i.e. when it does not have directly
  editable content. This is usually the same as `isLeaf`, but can
  be configured with the [`atom` property](https://prosemirror.net/docs/ref/#model.NodeSpec.atom)
  on a node's spec (typically used when the node is displayed as
  an uneditable [node view](https://prosemirror.net/docs/ref/#view.NodeView)).
  */
  get isAtom() {
    return this.type.isAtom;
  }
  /**
  Return a string representation of this node for debugging
  purposes.
  */
  toString() {
    if (this.type.spec.toDebugString)
      return this.type.spec.toDebugString(this);
    let name2 = this.type.name;
    if (this.content.size)
      name2 += "(" + this.content.toStringInner() + ")";
    return wrapMarks(this.marks, name2);
  }
  /**
  Get the content match in this node at the given index.
  */
  contentMatchAt(index2) {
    let match2 = this.type.contentMatch.matchFragment(this.content, 0, index2);
    if (!match2)
      throw new Error("Called contentMatchAt on a node with invalid content");
    return match2;
  }
  /**
  Test whether replacing the range between `from` and `to` (by
  child index) with the given replacement fragment (which defaults
  to the empty fragment) would leave the node's content valid. You
  can optionally pass `start` and `end` indices into the
  replacement fragment.
  */
  canReplace(from2, to, replacement = Fragment.empty, start2 = 0, end = replacement.childCount) {
    let one = this.contentMatchAt(from2).matchFragment(replacement, start2, end);
    let two = one && one.matchFragment(this.content, to);
    if (!two || !two.validEnd)
      return false;
    for (let i2 = start2; i2 < end; i2++)
      if (!this.type.allowsMarks(replacement.child(i2).marks))
        return false;
    return true;
  }
  /**
  Test whether replacing the range `from` to `to` (by index) with
  a node of the given type would leave the node's content valid.
  */
  canReplaceWith(from2, to, type, marks) {
    if (marks && !this.type.allowsMarks(marks))
      return false;
    let start2 = this.contentMatchAt(from2).matchType(type);
    let end = start2 && start2.matchFragment(this.content, to);
    return end ? end.validEnd : false;
  }
  /**
  Test whether the given node's content could be appended to this
  node. If that node is empty, this will only return true if there
  is at least one node type that can appear in both nodes (to avoid
  merging completely incompatible nodes).
  */
  canAppend(other) {
    if (other.content.size)
      return this.canReplace(this.childCount, this.childCount, other.content);
    else
      return this.type.compatibleContent(other.type);
  }
  /**
  Check whether this node and its descendants conform to the
  schema, and raise an exception when they do not.
  */
  check() {
    this.type.checkContent(this.content);
    this.type.checkAttrs(this.attrs);
    let copy2 = Mark$1.none;
    for (let i2 = 0; i2 < this.marks.length; i2++) {
      let mark2 = this.marks[i2];
      mark2.type.checkAttrs(mark2.attrs);
      copy2 = mark2.addToSet(copy2);
    }
    if (!Mark$1.sameSet(copy2, this.marks))
      throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((m) => m.type.name)}`);
    this.content.forEach((node3) => node3.check());
  }
  /**
  Return a JSON-serializeable representation of this node.
  */
  toJSON() {
    let obj = { type: this.type.name };
    for (let _2 in this.attrs) {
      obj.attrs = this.attrs;
      break;
    }
    if (this.content.size)
      obj.content = this.content.toJSON();
    if (this.marks.length)
      obj.marks = this.marks.map((n) => n.toJSON());
    return obj;
  }
  /**
  Deserialize a node from its JSON representation.
  */
  static fromJSON(schema2, json) {
    if (!json)
      throw new RangeError("Invalid input for Node.fromJSON");
    let marks = void 0;
    if (json.marks) {
      if (!Array.isArray(json.marks))
        throw new RangeError("Invalid mark data for Node.fromJSON");
      marks = json.marks.map(schema2.markFromJSON);
    }
    if (json.type == "text") {
      if (typeof json.text != "string")
        throw new RangeError("Invalid text node in JSON");
      return schema2.text(json.text, marks);
    }
    let content2 = Fragment.fromJSON(schema2, json.content);
    let node3 = schema2.nodeType(json.type).create(json.attrs, content2, marks);
    node3.type.checkAttrs(node3.attrs);
    return node3;
  }
};
Node$2.prototype.text = void 0;
class TextNode extends Node$2 {
  static {
    __name(this, "TextNode");
  }
  /**
  @internal
  */
  constructor(type, attrs4, content2, marks) {
    super(type, attrs4, null, marks);
    if (!content2)
      throw new RangeError("Empty text nodes are not allowed");
    this.text = content2;
  }
  toString() {
    if (this.type.spec.toDebugString)
      return this.type.spec.toDebugString(this);
    return wrapMarks(this.marks, JSON.stringify(this.text));
  }
  get textContent() {
    return this.text;
  }
  textBetween(from2, to) {
    return this.text.slice(from2, to);
  }
  get nodeSize() {
    return this.text.length;
  }
  mark(marks) {
    return marks == this.marks ? this : new TextNode(this.type, this.attrs, this.text, marks);
  }
  withText(text2) {
    if (text2 == this.text)
      return this;
    return new TextNode(this.type, this.attrs, text2, this.marks);
  }
  cut(from2 = 0, to = this.text.length) {
    if (from2 == 0 && to == this.text.length)
      return this;
    return this.withText(this.text.slice(from2, to));
  }
  eq(other) {
    return this.sameMarkup(other) && this.text == other.text;
  }
  toJSON() {
    let base2 = super.toJSON();
    base2.text = this.text;
    return base2;
  }
}
function wrapMarks(marks, str) {
  for (let i2 = marks.length - 1; i2 >= 0; i2--)
    str = marks[i2].type.name + "(" + str + ")";
  return str;
}
__name(wrapMarks, "wrapMarks");
class ContentMatch {
  static {
    __name(this, "ContentMatch");
  }
  /**
  @internal
  */
  constructor(validEnd) {
    this.validEnd = validEnd;
    this.next = [];
    this.wrapCache = [];
  }
  /**
  @internal
  */
  static parse(string, nodeTypes) {
    let stream = new TokenStream(string, nodeTypes);
    if (stream.next == null)
      return ContentMatch.empty;
    let expr = parseExpr(stream);
    if (stream.next)
      stream.err("Unexpected trailing text");
    let match2 = dfa(nfa(expr));
    checkForDeadEnds(match2, stream);
    return match2;
  }
  /**
  Match a node type, returning a match after that node if
  successful.
  */
  matchType(type) {
    for (let i2 = 0; i2 < this.next.length; i2++)
      if (this.next[i2].type == type)
        return this.next[i2].next;
    return null;
  }
  /**
  Try to match a fragment. Returns the resulting match when
  successful.
  */
  matchFragment(frag, start2 = 0, end = frag.childCount) {
    let cur = this;
    for (let i2 = start2; cur && i2 < end; i2++)
      cur = cur.matchType(frag.child(i2).type);
    return cur;
  }
  /**
  @internal
  */
  get inlineContent() {
    return this.next.length != 0 && this.next[0].type.isInline;
  }
  /**
  Get the first matching node type at this match position that can
  be generated.
  */
  get defaultType() {
    for (let i2 = 0; i2 < this.next.length; i2++) {
      let { type } = this.next[i2];
      if (!(type.isText || type.hasRequiredAttrs()))
        return type;
    }
    return null;
  }
  /**
  @internal
  */
  compatible(other) {
    for (let i2 = 0; i2 < this.next.length; i2++)
      for (let j = 0; j < other.next.length; j++)
        if (this.next[i2].type == other.next[j].type)
          return true;
    return false;
  }
  /**
  Try to match the given fragment, and if that fails, see if it can
  be made to match by inserting nodes in front of it. When
  successful, return a fragment of inserted nodes (which may be
  empty if nothing had to be inserted). When `toEnd` is true, only
  return a fragment if the resulting match goes to the end of the
  content expression.
  */
  fillBefore(after, toEnd = false, startIndex = 0) {
    let seen2 = [this];
    function search2(match2, types) {
      let finished = match2.matchFragment(after, startIndex);
      if (finished && (!toEnd || finished.validEnd))
        return Fragment.from(types.map((tp) => tp.createAndFill()));
      for (let i2 = 0; i2 < match2.next.length; i2++) {
        let { type, next: next2 } = match2.next[i2];
        if (!(type.isText || type.hasRequiredAttrs()) && seen2.indexOf(next2) == -1) {
          seen2.push(next2);
          let found2 = search2(next2, types.concat(type));
          if (found2)
            return found2;
        }
      }
      return null;
    }
    __name(search2, "search");
    return search2(this, []);
  }
  /**
  Find a set of wrapping node types that would allow a node of the
  given type to appear at this position. The result may be empty
  (when it fits directly) and will be null when no such wrapping
  exists.
  */
  findWrapping(target) {
    for (let i2 = 0; i2 < this.wrapCache.length; i2 += 2)
      if (this.wrapCache[i2] == target)
        return this.wrapCache[i2 + 1];
    let computed2 = this.computeWrapping(target);
    this.wrapCache.push(target, computed2);
    return computed2;
  }
  /**
  @internal
  */
  computeWrapping(target) {
    let seen2 = /* @__PURE__ */ Object.create(null), active3 = [{ match: this, type: null, via: null }];
    while (active3.length) {
      let current = active3.shift(), match2 = current.match;
      if (match2.matchType(target)) {
        let result = [];
        for (let obj = current; obj.type; obj = obj.via)
          result.push(obj.type);
        return result.reverse();
      }
      for (let i2 = 0; i2 < match2.next.length; i2++) {
        let { type, next: next2 } = match2.next[i2];
        if (!type.isLeaf && !type.hasRequiredAttrs() && !(type.name in seen2) && (!current.type || next2.validEnd)) {
          active3.push({ match: type.contentMatch, type, via: current });
          seen2[type.name] = true;
        }
      }
    }
    return null;
  }
  /**
  The number of outgoing edges this node has in the finite
  automaton that describes the content expression.
  */
  get edgeCount() {
    return this.next.length;
  }
  /**
  Get the _n_​th outgoing edge from this node in the finite
  automaton that describes the content expression.
  */
  edge(n) {
    if (n >= this.next.length)
      throw new RangeError(`There's no ${n}th edge in this content match`);
    return this.next[n];
  }
  /**
  @internal
  */
  toString() {
    let seen2 = [];
    function scan(m) {
      seen2.push(m);
      for (let i2 = 0; i2 < m.next.length; i2++)
        if (seen2.indexOf(m.next[i2].next) == -1)
          scan(m.next[i2].next);
    }
    __name(scan, "scan");
    scan(this);
    return seen2.map((m, i2) => {
      let out = i2 + (m.validEnd ? "*" : " ") + " ";
      for (let i3 = 0; i3 < m.next.length; i3++)
        out += (i3 ? ", " : "") + m.next[i3].type.name + "->" + seen2.indexOf(m.next[i3].next);
      return out;
    }).join("\n");
  }
}
ContentMatch.empty = new ContentMatch(true);
class TokenStream {
  static {
    __name(this, "TokenStream");
  }
  constructor(string, nodeTypes) {
    this.string = string;
    this.nodeTypes = nodeTypes;
    this.inline = null;
    this.pos = 0;
    this.tokens = string.split(/\s*(?=\b|\W|$)/);
    if (this.tokens[this.tokens.length - 1] == "")
      this.tokens.pop();
    if (this.tokens[0] == "")
      this.tokens.shift();
  }
  get next() {
    return this.tokens[this.pos];
  }
  eat(tok) {
    return this.next == tok && (this.pos++ || true);
  }
  err(str) {
    throw new SyntaxError(str + " (in content expression '" + this.string + "')");
  }
}
function parseExpr(stream) {
  let exprs = [];
  do {
    exprs.push(parseExprSeq(stream));
  } while (stream.eat("|"));
  return exprs.length == 1 ? exprs[0] : { type: "choice", exprs };
}
__name(parseExpr, "parseExpr");
function parseExprSeq(stream) {
  let exprs = [];
  do {
    exprs.push(parseExprSubscript(stream));
  } while (stream.next && stream.next != ")" && stream.next != "|");
  return exprs.length == 1 ? exprs[0] : { type: "seq", exprs };
}
__name(parseExprSeq, "parseExprSeq");
function parseExprSubscript(stream) {
  let expr = parseExprAtom(stream);
  for (; ; ) {
    if (stream.eat("+"))
      expr = { type: "plus", expr };
    else if (stream.eat("*"))
      expr = { type: "star", expr };
    else if (stream.eat("?"))
      expr = { type: "opt", expr };
    else if (stream.eat("{"))
      expr = parseExprRange(stream, expr);
    else
      break;
  }
  return expr;
}
__name(parseExprSubscript, "parseExprSubscript");
function parseNum(stream) {
  if (/\D/.test(stream.next))
    stream.err("Expected number, got '" + stream.next + "'");
  let result = Number(stream.next);
  stream.pos++;
  return result;
}
__name(parseNum, "parseNum");
function parseExprRange(stream, expr) {
  let min = parseNum(stream), max = min;
  if (stream.eat(",")) {
    if (stream.next != "}")
      max = parseNum(stream);
    else
      max = -1;
  }
  if (!stream.eat("}"))
    stream.err("Unclosed braced range");
  return { type: "range", min, max, expr };
}
__name(parseExprRange, "parseExprRange");
function resolveName(stream, name2) {
  let types = stream.nodeTypes, type = types[name2];
  if (type)
    return [type];
  let result = [];
  for (let typeName in types) {
    let type2 = types[typeName];
    if (type2.isInGroup(name2))
      result.push(type2);
  }
  if (result.length == 0)
    stream.err("No node type or group '" + name2 + "' found");
  return result;
}
__name(resolveName, "resolveName");
function parseExprAtom(stream) {
  if (stream.eat("(")) {
    let expr = parseExpr(stream);
    if (!stream.eat(")"))
      stream.err("Missing closing paren");
    return expr;
  } else if (!/\W/.test(stream.next)) {
    let exprs = resolveName(stream, stream.next).map((type) => {
      if (stream.inline == null)
        stream.inline = type.isInline;
      else if (stream.inline != type.isInline)
        stream.err("Mixing inline and block content");
      return { type: "name", value: type };
    });
    stream.pos++;
    return exprs.length == 1 ? exprs[0] : { type: "choice", exprs };
  } else {
    stream.err("Unexpected token '" + stream.next + "'");
  }
}
__name(parseExprAtom, "parseExprAtom");
function nfa(expr) {
  let nfa2 = [[]];
  connect(compile2(expr, 0), node3());
  return nfa2;
  function node3() {
    return nfa2.push([]) - 1;
  }
  __name(node3, "node");
  function edge(from2, to, term) {
    let edge2 = { term, to };
    nfa2[from2].push(edge2);
    return edge2;
  }
  __name(edge, "edge");
  function connect(edges, to) {
    edges.forEach((edge2) => edge2.to = to);
  }
  __name(connect, "connect");
  function compile2(expr2, from2) {
    if (expr2.type == "choice") {
      return expr2.exprs.reduce((out, expr3) => out.concat(compile2(expr3, from2)), []);
    } else if (expr2.type == "seq") {
      for (let i2 = 0; ; i2++) {
        let next2 = compile2(expr2.exprs[i2], from2);
        if (i2 == expr2.exprs.length - 1)
          return next2;
        connect(next2, from2 = node3());
      }
    } else if (expr2.type == "star") {
      let loop = node3();
      edge(from2, loop);
      connect(compile2(expr2.expr, loop), loop);
      return [edge(loop)];
    } else if (expr2.type == "plus") {
      let loop = node3();
      connect(compile2(expr2.expr, from2), loop);
      connect(compile2(expr2.expr, loop), loop);
      return [edge(loop)];
    } else if (expr2.type == "opt") {
      return [edge(from2)].concat(compile2(expr2.expr, from2));
    } else if (expr2.type == "range") {
      let cur = from2;
      for (let i2 = 0; i2 < expr2.min; i2++) {
        let next2 = node3();
        connect(compile2(expr2.expr, cur), next2);
        cur = next2;
      }
      if (expr2.max == -1) {
        connect(compile2(expr2.expr, cur), cur);
      } else {
        for (let i2 = expr2.min; i2 < expr2.max; i2++) {
          let next2 = node3();
          edge(cur, next2);
          connect(compile2(expr2.expr, cur), next2);
          cur = next2;
        }
      }
      return [edge(cur)];
    } else if (expr2.type == "name") {
      return [edge(from2, void 0, expr2.value)];
    } else {
      throw new Error("Unknown expr type");
    }
  }
  __name(compile2, "compile");
}
__name(nfa, "nfa");
function cmp(a, b) {
  return b - a;
}
__name(cmp, "cmp");
function nullFrom(nfa2, node3) {
  let result = [];
  scan(node3);
  return result.sort(cmp);
  function scan(node4) {
    let edges = nfa2[node4];
    if (edges.length == 1 && !edges[0].term)
      return scan(edges[0].to);
    result.push(node4);
    for (let i2 = 0; i2 < edges.length; i2++) {
      let { term, to } = edges[i2];
      if (!term && result.indexOf(to) == -1)
        scan(to);
    }
  }
  __name(scan, "scan");
}
__name(nullFrom, "nullFrom");
function dfa(nfa2) {
  let labeled = /* @__PURE__ */ Object.create(null);
  return explore(nullFrom(nfa2, 0));
  function explore(states) {
    let out = [];
    states.forEach((node3) => {
      nfa2[node3].forEach(({ term, to }) => {
        if (!term)
          return;
        let set3;
        for (let i2 = 0; i2 < out.length; i2++)
          if (out[i2][0] == term)
            set3 = out[i2][1];
        nullFrom(nfa2, to).forEach((node4) => {
          if (!set3)
            out.push([term, set3 = []]);
          if (set3.indexOf(node4) == -1)
            set3.push(node4);
        });
      });
    });
    let state = labeled[states.join(",")] = new ContentMatch(states.indexOf(nfa2.length - 1) > -1);
    for (let i2 = 0; i2 < out.length; i2++) {
      let states2 = out[i2][1].sort(cmp);
      state.next.push({ type: out[i2][0], next: labeled[states2.join(",")] || explore(states2) });
    }
    return state;
  }
  __name(explore, "explore");
}
__name(dfa, "dfa");
function checkForDeadEnds(match2, stream) {
  for (let i2 = 0, work = [match2]; i2 < work.length; i2++) {
    let state = work[i2], dead = !state.validEnd, nodes = [];
    for (let j = 0; j < state.next.length; j++) {
      let { type, next: next2 } = state.next[j];
      nodes.push(type.name);
      if (dead && !(type.isText || type.hasRequiredAttrs()))
        dead = false;
      if (work.indexOf(next2) == -1)
        work.push(next2);
    }
    if (dead)
      stream.err("Only non-generatable nodes (" + nodes.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
  }
}
__name(checkForDeadEnds, "checkForDeadEnds");
function defaultAttrs(attrs4) {
  let defaults2 = /* @__PURE__ */ Object.create(null);
  for (let attrName in attrs4) {
    let attr = attrs4[attrName];
    if (!attr.hasDefault)
      return null;
    defaults2[attrName] = attr.default;
  }
  return defaults2;
}
__name(defaultAttrs, "defaultAttrs");
function computeAttrs(attrs4, value4) {
  let built = /* @__PURE__ */ Object.create(null);
  for (let name2 in attrs4) {
    let given = value4 && value4[name2];
    if (given === void 0) {
      let attr = attrs4[name2];
      if (attr.hasDefault)
        given = attr.default;
      else
        throw new RangeError("No value supplied for attribute " + name2);
    }
    built[name2] = given;
  }
  return built;
}
__name(computeAttrs, "computeAttrs");
function checkAttrs(attrs4, values, type, name2) {
  for (let name3 in values)
    if (!(name3 in attrs4))
      throw new RangeError(`Unsupported attribute ${name3} for ${type} of type ${name3}`);
  for (let name3 in attrs4) {
    let attr = attrs4[name3];
    if (attr.validate)
      attr.validate(values[name3]);
  }
}
__name(checkAttrs, "checkAttrs");
function initAttrs(typeName, attrs4) {
  let result = /* @__PURE__ */ Object.create(null);
  if (attrs4)
    for (let name2 in attrs4)
      result[name2] = new Attribute(typeName, name2, attrs4[name2]);
  return result;
}
__name(initAttrs, "initAttrs");
let NodeType$1 = class NodeType2 {
  static {
    __name(this, "NodeType");
  }
  /**
  @internal
  */
  constructor(name2, schema2, spec) {
    this.name = name2;
    this.schema = schema2;
    this.spec = spec;
    this.markSet = null;
    this.groups = spec.group ? spec.group.split(" ") : [];
    this.attrs = initAttrs(name2, spec.attrs);
    this.defaultAttrs = defaultAttrs(this.attrs);
    this.contentMatch = null;
    this.inlineContent = null;
    this.isBlock = !(spec.inline || name2 == "text");
    this.isText = name2 == "text";
  }
  /**
  True if this is an inline type.
  */
  get isInline() {
    return !this.isBlock;
  }
  /**
  True if this is a textblock type, a block that contains inline
  content.
  */
  get isTextblock() {
    return this.isBlock && this.inlineContent;
  }
  /**
  True for node types that allow no content.
  */
  get isLeaf() {
    return this.contentMatch == ContentMatch.empty;
  }
  /**
  True when this node is an atom, i.e. when it does not have
  directly editable content.
  */
  get isAtom() {
    return this.isLeaf || !!this.spec.atom;
  }
  /**
  Return true when this node type is part of the given
  [group](https://prosemirror.net/docs/ref/#model.NodeSpec.group).
  */
  isInGroup(group) {
    return this.groups.indexOf(group) > -1;
  }
  /**
  The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.
  */
  get whitespace() {
    return this.spec.whitespace || (this.spec.code ? "pre" : "normal");
  }
  /**
  Tells you whether this node type has any required attributes.
  */
  hasRequiredAttrs() {
    for (let n in this.attrs)
      if (this.attrs[n].isRequired)
        return true;
    return false;
  }
  /**
  Indicates whether this node allows some of the same content as
  the given node type.
  */
  compatibleContent(other) {
    return this == other || this.contentMatch.compatible(other.contentMatch);
  }
  /**
  @internal
  */
  computeAttrs(attrs4) {
    if (!attrs4 && this.defaultAttrs)
      return this.defaultAttrs;
    else
      return computeAttrs(this.attrs, attrs4);
  }
  /**
  Create a `Node` of this type. The given attributes are
  checked and defaulted (you can pass `null` to use the type's
  defaults entirely, if no required attributes exist). `content`
  may be a `Fragment`, a node, an array of nodes, or
  `null`. Similarly `marks` may be `null` to default to the empty
  set of marks.
  */
  create(attrs4 = null, content2, marks) {
    if (this.isText)
      throw new Error("NodeType.create can't construct text nodes");
    return new Node$2(this, this.computeAttrs(attrs4), Fragment.from(content2), Mark$1.setFrom(marks));
  }
  /**
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
  against the node type's content restrictions, and throw an error
  if it doesn't match.
  */
  createChecked(attrs4 = null, content2, marks) {
    content2 = Fragment.from(content2);
    this.checkContent(content2);
    return new Node$2(this, this.computeAttrs(attrs4), content2, Mark$1.setFrom(marks));
  }
  /**
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
  necessary to add nodes to the start or end of the given fragment
  to make it fit the node. If no fitting wrapping can be found,
  return null. Note that, due to the fact that required nodes can
  always be created, this will always succeed if you pass null or
  `Fragment.empty` as content.
  */
  createAndFill(attrs4 = null, content2, marks) {
    attrs4 = this.computeAttrs(attrs4);
    content2 = Fragment.from(content2);
    if (content2.size) {
      let before = this.contentMatch.fillBefore(content2);
      if (!before)
        return null;
      content2 = before.append(content2);
    }
    let matched = this.contentMatch.matchFragment(content2);
    let after = matched && matched.fillBefore(Fragment.empty, true);
    if (!after)
      return null;
    return new Node$2(this, attrs4, content2.append(after), Mark$1.setFrom(marks));
  }
  /**
  Returns true if the given fragment is valid content for this node
  type.
  */
  validContent(content2) {
    let result = this.contentMatch.matchFragment(content2);
    if (!result || !result.validEnd)
      return false;
    for (let i2 = 0; i2 < content2.childCount; i2++)
      if (!this.allowsMarks(content2.child(i2).marks))
        return false;
    return true;
  }
  /**
  Throws a RangeError if the given fragment is not valid content for this
  node type.
  @internal
  */
  checkContent(content2) {
    if (!this.validContent(content2))
      throw new RangeError(`Invalid content for node ${this.name}: ${content2.toString().slice(0, 50)}`);
  }
  /**
  @internal
  */
  checkAttrs(attrs4) {
    checkAttrs(this.attrs, attrs4, "node", this.name);
  }
  /**
  Check whether the given mark type is allowed in this node.
  */
  allowsMarkType(markType) {
    return this.markSet == null || this.markSet.indexOf(markType) > -1;
  }
  /**
  Test whether the given set of marks are allowed in this node.
  */
  allowsMarks(marks) {
    if (this.markSet == null)
      return true;
    for (let i2 = 0; i2 < marks.length; i2++)
      if (!this.allowsMarkType(marks[i2].type))
        return false;
    return true;
  }
  /**
  Removes the marks that are not allowed in this node from the given set.
  */
  allowedMarks(marks) {
    if (this.markSet == null)
      return marks;
    let copy2;
    for (let i2 = 0; i2 < marks.length; i2++) {
      if (!this.allowsMarkType(marks[i2].type)) {
        if (!copy2)
          copy2 = marks.slice(0, i2);
      } else if (copy2) {
        copy2.push(marks[i2]);
      }
    }
    return !copy2 ? marks : copy2.length ? copy2 : Mark$1.none;
  }
  /**
  @internal
  */
  static compile(nodes, schema2) {
    let result = /* @__PURE__ */ Object.create(null);
    nodes.forEach((name2, spec) => result[name2] = new NodeType2(name2, schema2, spec));
    let topType = schema2.spec.topNode || "doc";
    if (!result[topType])
      throw new RangeError("Schema is missing its top node type ('" + topType + "')");
    if (!result.text)
      throw new RangeError("Every schema needs a 'text' type");
    for (let _2 in result.text.attrs)
      throw new RangeError("The text node type should not have attributes");
    return result;
  }
};
function validateType(typeName, attrName, type) {
  let types = type.split("|");
  return (value4) => {
    let name2 = value4 === null ? "null" : typeof value4;
    if (types.indexOf(name2) < 0)
      throw new RangeError(`Expected value of type ${types} for attribute ${attrName} on type ${typeName}, got ${name2}`);
  };
}
__name(validateType, "validateType");
class Attribute {
  static {
    __name(this, "Attribute");
  }
  constructor(typeName, attrName, options4) {
    this.hasDefault = Object.prototype.hasOwnProperty.call(options4, "default");
    this.default = options4.default;
    this.validate = typeof options4.validate == "string" ? validateType(typeName, attrName, options4.validate) : options4.validate;
  }
  get isRequired() {
    return !this.hasDefault;
  }
}
class MarkType {
  static {
    __name(this, "MarkType");
  }
  /**
  @internal
  */
  constructor(name2, rank, schema2, spec) {
    this.name = name2;
    this.rank = rank;
    this.schema = schema2;
    this.spec = spec;
    this.attrs = initAttrs(name2, spec.attrs);
    this.excluded = null;
    let defaults2 = defaultAttrs(this.attrs);
    this.instance = defaults2 ? new Mark$1(this, defaults2) : null;
  }
  /**
  Create a mark of this type. `attrs` may be `null` or an object
  containing only some of the mark's attributes. The others, if
  they have defaults, will be added.
  */
  create(attrs4 = null) {
    if (!attrs4 && this.instance)
      return this.instance;
    return new Mark$1(this, computeAttrs(this.attrs, attrs4));
  }
  /**
  @internal
  */
  static compile(marks, schema2) {
    let result = /* @__PURE__ */ Object.create(null), rank = 0;
    marks.forEach((name2, spec) => result[name2] = new MarkType(name2, rank++, schema2, spec));
    return result;
  }
  /**
  When there is a mark of this type in the given set, a new set
  without it is returned. Otherwise, the input set is returned.
  */
  removeFromSet(set3) {
    for (var i2 = 0; i2 < set3.length; i2++)
      if (set3[i2].type == this) {
        set3 = set3.slice(0, i2).concat(set3.slice(i2 + 1));
        i2--;
      }
    return set3;
  }
  /**
  Tests whether there is a mark of this type in the given set.
  */
  isInSet(set3) {
    for (let i2 = 0; i2 < set3.length; i2++)
      if (set3[i2].type == this)
        return set3[i2];
  }
  /**
  @internal
  */
  checkAttrs(attrs4) {
    checkAttrs(this.attrs, attrs4, "mark", this.name);
  }
  /**
  Queries whether a given mark type is
  [excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.
  */
  excludes(other) {
    return this.excluded.indexOf(other) > -1;
  }
}
class Schema {
  static {
    __name(this, "Schema");
  }
  /**
  Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
  */
  constructor(spec) {
    this.linebreakReplacement = null;
    this.cached = /* @__PURE__ */ Object.create(null);
    let instanceSpec = this.spec = {};
    for (let prop2 in spec)
      instanceSpec[prop2] = spec[prop2];
    instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);
    this.marks = MarkType.compile(this.spec.marks, this);
    let contentExprCache = /* @__PURE__ */ Object.create(null);
    for (let prop2 in this.nodes) {
      if (prop2 in this.marks)
        throw new RangeError(prop2 + " can not be both a node and a mark");
      let type = this.nodes[prop2], contentExpr = type.spec.content || "", markExpr = type.spec.marks;
      type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));
      type.inlineContent = type.contentMatch.inlineContent;
      if (type.spec.linebreakReplacement) {
        if (this.linebreakReplacement)
          throw new RangeError("Multiple linebreak nodes defined");
        if (!type.isInline || !type.isLeaf)
          throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
        this.linebreakReplacement = type;
      }
      type.markSet = markExpr == "_" ? null : markExpr ? gatherMarks(this, markExpr.split(" ")) : markExpr == "" || !type.inlineContent ? [] : null;
    }
    for (let prop2 in this.marks) {
      let type = this.marks[prop2], excl = type.spec.excludes;
      type.excluded = excl == null ? [type] : excl == "" ? [] : gatherMarks(this, excl.split(" "));
    }
    this.nodeFromJSON = this.nodeFromJSON.bind(this);
    this.markFromJSON = this.markFromJSON.bind(this);
    this.topNodeType = this.nodes[this.spec.topNode || "doc"];
    this.cached.wrappings = /* @__PURE__ */ Object.create(null);
  }
  /**
  Create a node in this schema. The `type` may be a string or a
  `NodeType` instance. Attributes will be extended with defaults,
  `content` may be a `Fragment`, `null`, a `Node`, or an array of
  nodes.
  */
  node(type, attrs4 = null, content2, marks) {
    if (typeof type == "string")
      type = this.nodeType(type);
    else if (!(type instanceof NodeType$1))
      throw new RangeError("Invalid node type: " + type);
    else if (type.schema != this)
      throw new RangeError("Node type from different schema used (" + type.name + ")");
    return type.createChecked(attrs4, content2, marks);
  }
  /**
  Create a text node in the schema. Empty text nodes are not
  allowed.
  */
  text(text2, marks) {
    let type = this.nodes.text;
    return new TextNode(type, type.defaultAttrs, text2, Mark$1.setFrom(marks));
  }
  /**
  Create a mark with the given type and attributes.
  */
  mark(type, attrs4) {
    if (typeof type == "string")
      type = this.marks[type];
    return type.create(attrs4);
  }
  /**
  Deserialize a node from its JSON representation. This method is
  bound.
  */
  nodeFromJSON(json) {
    return Node$2.fromJSON(this, json);
  }
  /**
  Deserialize a mark from its JSON representation. This method is
  bound.
  */
  markFromJSON(json) {
    return Mark$1.fromJSON(this, json);
  }
  /**
  @internal
  */
  nodeType(name2) {
    let found2 = this.nodes[name2];
    if (!found2)
      throw new RangeError("Unknown node type: " + name2);
    return found2;
  }
}
function gatherMarks(schema2, marks) {
  let found2 = [];
  for (let i2 = 0; i2 < marks.length; i2++) {
    let name2 = marks[i2], mark2 = schema2.marks[name2], ok = mark2;
    if (mark2) {
      found2.push(mark2);
    } else {
      for (let prop2 in schema2.marks) {
        let mark3 = schema2.marks[prop2];
        if (name2 == "_" || mark3.spec.group && mark3.spec.group.split(" ").indexOf(name2) > -1)
          found2.push(ok = mark3);
      }
    }
    if (!ok)
      throw new SyntaxError("Unknown mark type: '" + marks[i2] + "'");
  }
  return found2;
}
__name(gatherMarks, "gatherMarks");
function isTagRule(rule) {
  return rule.tag != null;
}
__name(isTagRule, "isTagRule");
function isStyleRule(rule) {
  return rule.style != null;
}
__name(isStyleRule, "isStyleRule");
class DOMParser {
  static {
    __name(this, "DOMParser");
  }
  /**
  Create a parser that targets the given schema, using the given
  parsing rules.
  */
  constructor(schema2, rules) {
    this.schema = schema2;
    this.rules = rules;
    this.tags = [];
    this.styles = [];
    let matchedStyles = this.matchedStyles = [];
    rules.forEach((rule) => {
      if (isTagRule(rule)) {
        this.tags.push(rule);
      } else if (isStyleRule(rule)) {
        let prop2 = /[^=]*/.exec(rule.style)[0];
        if (matchedStyles.indexOf(prop2) < 0)
          matchedStyles.push(prop2);
        this.styles.push(rule);
      }
    });
    this.normalizeLists = !this.tags.some((r) => {
      if (!/^(ul|ol)\b/.test(r.tag) || !r.node)
        return false;
      let node3 = schema2.nodes[r.node];
      return node3.contentMatch.matchType(node3);
    });
  }
  /**
  Parse a document from the content of a DOM node.
  */
  parse(dom, options4 = {}) {
    let context = new ParseContext(this, options4, false);
    context.addAll(dom, Mark$1.none, options4.from, options4.to);
    return context.finish();
  }
  /**
  Parses the content of the given DOM node, like
  [`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of
  options. But unlike that method, which produces a whole node,
  this one returns a slice that is open at the sides, meaning that
  the schema constraints aren't applied to the start of nodes to
  the left of the input and the end of nodes at the end.
  */
  parseSlice(dom, options4 = {}) {
    let context = new ParseContext(this, options4, true);
    context.addAll(dom, Mark$1.none, options4.from, options4.to);
    return Slice.maxOpen(context.finish());
  }
  /**
  @internal
  */
  matchTag(dom, context, after) {
    for (let i2 = after ? this.tags.indexOf(after) + 1 : 0; i2 < this.tags.length; i2++) {
      let rule = this.tags[i2];
      if (matches(dom, rule.tag) && (rule.namespace === void 0 || dom.namespaceURI == rule.namespace) && (!rule.context || context.matchesContext(rule.context))) {
        if (rule.getAttrs) {
          let result = rule.getAttrs(dom);
          if (result === false)
            continue;
          rule.attrs = result || void 0;
        }
        return rule;
      }
    }
  }
  /**
  @internal
  */
  matchStyle(prop2, value4, context, after) {
    for (let i2 = after ? this.styles.indexOf(after) + 1 : 0; i2 < this.styles.length; i2++) {
      let rule = this.styles[i2], style2 = rule.style;
      if (style2.indexOf(prop2) != 0 || rule.context && !context.matchesContext(rule.context) || // Test that the style string either precisely matches the prop,
      // or has an '=' sign after the prop, followed by the given
      // value.
      style2.length > prop2.length && (style2.charCodeAt(prop2.length) != 61 || style2.slice(prop2.length + 1) != value4))
        continue;
      if (rule.getAttrs) {
        let result = rule.getAttrs(value4);
        if (result === false)
          continue;
        rule.attrs = result || void 0;
      }
      return rule;
    }
  }
  /**
  @internal
  */
  static schemaRules(schema2) {
    let result = [];
    function insert2(rule) {
      let priority = rule.priority == null ? 50 : rule.priority, i2 = 0;
      for (; i2 < result.length; i2++) {
        let next2 = result[i2], nextPriority = next2.priority == null ? 50 : next2.priority;
        if (nextPriority < priority)
          break;
      }
      result.splice(i2, 0, rule);
    }
    __name(insert2, "insert");
    for (let name2 in schema2.marks) {
      let rules = schema2.marks[name2].spec.parseDOM;
      if (rules)
        rules.forEach((rule) => {
          insert2(rule = copy(rule));
          if (!(rule.mark || rule.ignore || rule.clearMark))
            rule.mark = name2;
        });
    }
    for (let name2 in schema2.nodes) {
      let rules = schema2.nodes[name2].spec.parseDOM;
      if (rules)
        rules.forEach((rule) => {
          insert2(rule = copy(rule));
          if (!(rule.node || rule.ignore || rule.mark))
            rule.node = name2;
        });
    }
    return result;
  }
  /**
  Construct a DOM parser using the parsing rules listed in a
  schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by
  [priority](https://prosemirror.net/docs/ref/#model.ParseRule.priority).
  */
  static fromSchema(schema2) {
    return schema2.cached.domParser || (schema2.cached.domParser = new DOMParser(schema2, DOMParser.schemaRules(schema2)));
  }
}
const blockTags = {
  address: true,
  article: true,
  aside: true,
  blockquote: true,
  canvas: true,
  dd: true,
  div: true,
  dl: true,
  fieldset: true,
  figcaption: true,
  figure: true,
  footer: true,
  form: true,
  h1: true,
  h2: true,
  h3: true,
  h4: true,
  h5: true,
  h6: true,
  header: true,
  hgroup: true,
  hr: true,
  li: true,
  noscript: true,
  ol: true,
  output: true,
  p: true,
  pre: true,
  section: true,
  table: true,
  tfoot: true,
  ul: true
};
const ignoreTags = {
  head: true,
  noscript: true,
  object: true,
  script: true,
  style: true,
  title: true
};
const listTags = { ol: true, ul: true };
const OPT_PRESERVE_WS = 1, OPT_PRESERVE_WS_FULL = 2, OPT_OPEN_LEFT = 4;
function wsOptionsFor(type, preserveWhitespace, base2) {
  if (preserveWhitespace != null)
    return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | (preserveWhitespace === "full" ? OPT_PRESERVE_WS_FULL : 0);
  return type && type.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base2 & ~OPT_OPEN_LEFT;
}
__name(wsOptionsFor, "wsOptionsFor");
class NodeContext {
  static {
    __name(this, "NodeContext");
  }
  constructor(type, attrs4, marks, solid, match2, options4) {
    this.type = type;
    this.attrs = attrs4;
    this.marks = marks;
    this.solid = solid;
    this.options = options4;
    this.content = [];
    this.activeMarks = Mark$1.none;
    this.match = match2 || (options4 & OPT_OPEN_LEFT ? null : type.contentMatch);
  }
  findWrapping(node3) {
    if (!this.match) {
      if (!this.type)
        return [];
      let fill = this.type.contentMatch.fillBefore(Fragment.from(node3));
      if (fill) {
        this.match = this.type.contentMatch.matchFragment(fill);
      } else {
        let start2 = this.type.contentMatch, wrap2;
        if (wrap2 = start2.findWrapping(node3.type)) {
          this.match = start2;
          return wrap2;
        } else {
          return null;
        }
      }
    }
    return this.match.findWrapping(node3.type);
  }
  finish(openEnd) {
    if (!(this.options & OPT_PRESERVE_WS)) {
      let last = this.content[this.content.length - 1], m;
      if (last && last.isText && (m = /[ \t\r\n\u000c]+$/.exec(last.text))) {
        let text2 = last;
        if (last.text.length == m[0].length)
          this.content.pop();
        else
          this.content[this.content.length - 1] = text2.withText(text2.text.slice(0, text2.text.length - m[0].length));
      }
    }
    let content2 = Fragment.from(this.content);
    if (!openEnd && this.match)
      content2 = content2.append(this.match.fillBefore(Fragment.empty, true));
    return this.type ? this.type.create(this.attrs, content2, this.marks) : content2;
  }
  inlineContext(node3) {
    if (this.type)
      return this.type.inlineContent;
    if (this.content.length)
      return this.content[0].isInline;
    return node3.parentNode && !blockTags.hasOwnProperty(node3.parentNode.nodeName.toLowerCase());
  }
}
class ParseContext {
  static {
    __name(this, "ParseContext");
  }
  constructor(parser, options4, isOpen) {
    this.parser = parser;
    this.options = options4;
    this.isOpen = isOpen;
    this.open = 0;
    this.localPreserveWS = false;
    let topNode = options4.topNode, topContext;
    let topOptions = wsOptionsFor(null, options4.preserveWhitespace, 0) | (isOpen ? OPT_OPEN_LEFT : 0);
    if (topNode)
      topContext = new NodeContext(topNode.type, topNode.attrs, Mark$1.none, true, options4.topMatch || topNode.type.contentMatch, topOptions);
    else if (isOpen)
      topContext = new NodeContext(null, null, Mark$1.none, true, null, topOptions);
    else
      topContext = new NodeContext(parser.schema.topNodeType, null, Mark$1.none, true, null, topOptions);
    this.nodes = [topContext];
    this.find = options4.findPositions;
    this.needsBlock = false;
  }
  get top() {
    return this.nodes[this.open];
  }
  // Add a DOM node to the content. Text is inserted as text node,
  // otherwise, the node is passed to `addElement` or, if it has a
  // `style` attribute, `addElementWithStyles`.
  addDOM(dom, marks) {
    if (dom.nodeType == 3)
      this.addTextNode(dom, marks);
    else if (dom.nodeType == 1)
      this.addElement(dom, marks);
  }
  addTextNode(dom, marks) {
    let value4 = dom.nodeValue;
    let top = this.top, preserveWS = top.options & OPT_PRESERVE_WS_FULL ? "full" : this.localPreserveWS || (top.options & OPT_PRESERVE_WS) > 0;
    if (preserveWS === "full" || top.inlineContext(dom) || /[^ \t\r\n\u000c]/.test(value4)) {
      if (!preserveWS) {
        value4 = value4.replace(/[ \t\r\n\u000c]+/g, " ");
        if (/^[ \t\r\n\u000c]/.test(value4) && this.open == this.nodes.length - 1) {
          let nodeBefore = top.content[top.content.length - 1];
          let domNodeBefore = dom.previousSibling;
          if (!nodeBefore || domNodeBefore && domNodeBefore.nodeName == "BR" || nodeBefore.isText && /[ \t\r\n\u000c]$/.test(nodeBefore.text))
            value4 = value4.slice(1);
        }
      } else if (preserveWS !== "full") {
        value4 = value4.replace(/\r?\n|\r/g, " ");
      } else {
        value4 = value4.replace(/\r\n?/g, "\n");
      }
      if (value4)
        this.insertNode(this.parser.schema.text(value4), marks);
      this.findInText(dom);
    } else {
      this.findInside(dom);
    }
  }
  // Try to find a handler for the given tag and use that to parse. If
  // none is found, the element's content nodes are added directly.
  addElement(dom, marks, matchAfter) {
    let outerWS = this.localPreserveWS, top = this.top;
    if (dom.tagName == "PRE" || /pre/.test(dom.style && dom.style.whiteSpace))
      this.localPreserveWS = true;
    let name2 = dom.nodeName.toLowerCase(), ruleID;
    if (listTags.hasOwnProperty(name2) && this.parser.normalizeLists)
      normalizeList(dom);
    let rule = this.options.ruleFromNode && this.options.ruleFromNode(dom) || (ruleID = this.parser.matchTag(dom, this, matchAfter));
    out: if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name2)) {
      this.findInside(dom);
      this.ignoreFallback(dom, marks);
    } else if (!rule || rule.skip || rule.closeParent) {
      if (rule && rule.closeParent)
        this.open = Math.max(0, this.open - 1);
      else if (rule && rule.skip.nodeType)
        dom = rule.skip;
      let sync, oldNeedsBlock = this.needsBlock;
      if (blockTags.hasOwnProperty(name2)) {
        if (top.content.length && top.content[0].isInline && this.open) {
          this.open--;
          top = this.top;
        }
        sync = true;
        if (!top.type)
          this.needsBlock = true;
      } else if (!dom.firstChild) {
        this.leafFallback(dom, marks);
        break out;
      }
      let innerMarks = rule && rule.skip ? marks : this.readStyles(dom, marks);
      if (innerMarks)
        this.addAll(dom, innerMarks);
      if (sync)
        this.sync(top);
      this.needsBlock = oldNeedsBlock;
    } else {
      let innerMarks = this.readStyles(dom, marks);
      if (innerMarks)
        this.addElementByRule(dom, rule, innerMarks, rule.consuming === false ? ruleID : void 0);
    }
    this.localPreserveWS = outerWS;
  }
  // Called for leaf DOM nodes that would otherwise be ignored
  leafFallback(dom, marks) {
    if (dom.nodeName == "BR" && this.top.type && this.top.type.inlineContent)
      this.addTextNode(dom.ownerDocument.createTextNode("\n"), marks);
  }
  // Called for ignored nodes
  ignoreFallback(dom, marks) {
    if (dom.nodeName == "BR" && (!this.top.type || !this.top.type.inlineContent))
      this.findPlace(this.parser.schema.text("-"), marks);
  }
  // Run any style parser associated with the node's styles. Either
  // return an updated array of marks, or null to indicate some of the
  // styles had a rule with `ignore` set.
  readStyles(dom, marks) {
    let styles = dom.style;
    if (styles && styles.length)
      for (let i2 = 0; i2 < this.parser.matchedStyles.length; i2++) {
        let name2 = this.parser.matchedStyles[i2], value4 = styles.getPropertyValue(name2);
        if (value4)
          for (let after = void 0; ; ) {
            let rule = this.parser.matchStyle(name2, value4, this, after);
            if (!rule)
              break;
            if (rule.ignore)
              return null;
            if (rule.clearMark)
              marks = marks.filter((m) => !rule.clearMark(m));
            else
              marks = marks.concat(this.parser.schema.marks[rule.mark].create(rule.attrs));
            if (rule.consuming === false)
              after = rule;
            else
              break;
          }
      }
    return marks;
  }
  // Look up a handler for the given node. If none are found, return
  // false. Otherwise, apply it, use its return value to drive the way
  // the node's content is wrapped, and return true.
  addElementByRule(dom, rule, marks, continueAfter) {
    let sync, nodeType;
    if (rule.node) {
      nodeType = this.parser.schema.nodes[rule.node];
      if (!nodeType.isLeaf) {
        let inner = this.enter(nodeType, rule.attrs || null, marks, rule.preserveWhitespace);
        if (inner) {
          sync = true;
          marks = inner;
        }
      } else if (!this.insertNode(nodeType.create(rule.attrs), marks)) {
        this.leafFallback(dom, marks);
      }
    } else {
      let markType = this.parser.schema.marks[rule.mark];
      marks = marks.concat(markType.create(rule.attrs));
    }
    let startIn = this.top;
    if (nodeType && nodeType.isLeaf) {
      this.findInside(dom);
    } else if (continueAfter) {
      this.addElement(dom, marks, continueAfter);
    } else if (rule.getContent) {
      this.findInside(dom);
      rule.getContent(dom, this.parser.schema).forEach((node3) => this.insertNode(node3, marks));
    } else {
      let contentDOM = dom;
      if (typeof rule.contentElement == "string")
        contentDOM = dom.querySelector(rule.contentElement);
      else if (typeof rule.contentElement == "function")
        contentDOM = rule.contentElement(dom);
      else if (rule.contentElement)
        contentDOM = rule.contentElement;
      this.findAround(dom, contentDOM, true);
      this.addAll(contentDOM, marks);
      this.findAround(dom, contentDOM, false);
    }
    if (sync && this.sync(startIn))
      this.open--;
  }
  // Add all child nodes between `startIndex` and `endIndex` (or the
  // whole node, if not given). If `sync` is passed, use it to
  // synchronize after every block element.
  addAll(parent, marks, startIndex, endIndex) {
    let index2 = startIndex || 0;
    for (let dom = startIndex ? parent.childNodes[startIndex] : parent.firstChild, end = endIndex == null ? null : parent.childNodes[endIndex]; dom != end; dom = dom.nextSibling, ++index2) {
      this.findAtPoint(parent, index2);
      this.addDOM(dom, marks);
    }
    this.findAtPoint(parent, index2);
  }
  // Try to find a way to fit the given node type into the current
  // context. May add intermediate wrappers and/or leave non-solid
  // nodes that we're in.
  findPlace(node3, marks) {
    let route, sync;
    for (let depth = this.open; depth >= 0; depth--) {
      let cx2 = this.nodes[depth];
      let found2 = cx2.findWrapping(node3);
      if (found2 && (!route || route.length > found2.length)) {
        route = found2;
        sync = cx2;
        if (!found2.length)
          break;
      }
      if (cx2.solid)
        break;
    }
    if (!route)
      return null;
    this.sync(sync);
    for (let i2 = 0; i2 < route.length; i2++)
      marks = this.enterInner(route[i2], null, marks, false);
    return marks;
  }
  // Try to insert the given node, adjusting the context when needed.
  insertNode(node3, marks) {
    if (node3.isInline && this.needsBlock && !this.top.type) {
      let block3 = this.textblockFromContext();
      if (block3)
        marks = this.enterInner(block3, null, marks);
    }
    let innerMarks = this.findPlace(node3, marks);
    if (innerMarks) {
      this.closeExtra();
      let top = this.top;
      if (top.match)
        top.match = top.match.matchType(node3.type);
      let nodeMarks = Mark$1.none;
      for (let m of innerMarks.concat(node3.marks))
        if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, node3.type))
          nodeMarks = m.addToSet(nodeMarks);
      top.content.push(node3.mark(nodeMarks));
      return true;
    }
    return false;
  }
  // Try to start a node of the given type, adjusting the context when
  // necessary.
  enter(type, attrs4, marks, preserveWS) {
    let innerMarks = this.findPlace(type.create(attrs4), marks);
    if (innerMarks)
      innerMarks = this.enterInner(type, attrs4, marks, true, preserveWS);
    return innerMarks;
  }
  // Open a node of the given type
  enterInner(type, attrs4, marks, solid = false, preserveWS) {
    this.closeExtra();
    let top = this.top;
    top.match = top.match && top.match.matchType(type);
    let options4 = wsOptionsFor(type, preserveWS, top.options);
    if (top.options & OPT_OPEN_LEFT && top.content.length == 0)
      options4 |= OPT_OPEN_LEFT;
    let applyMarks = Mark$1.none;
    marks = marks.filter((m) => {
      if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, type)) {
        applyMarks = m.addToSet(applyMarks);
        return false;
      }
      return true;
    });
    this.nodes.push(new NodeContext(type, attrs4, applyMarks, solid, null, options4));
    this.open++;
    return marks;
  }
  // Make sure all nodes above this.open are finished and added to
  // their parents
  closeExtra(openEnd = false) {
    let i2 = this.nodes.length - 1;
    if (i2 > this.open) {
      for (; i2 > this.open; i2--)
        this.nodes[i2 - 1].content.push(this.nodes[i2].finish(openEnd));
      this.nodes.length = this.open + 1;
    }
  }
  finish() {
    this.open = 0;
    this.closeExtra(this.isOpen);
    return this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));
  }
  sync(to) {
    for (let i2 = this.open; i2 >= 0; i2--) {
      if (this.nodes[i2] == to) {
        this.open = i2;
        return true;
      } else if (this.localPreserveWS) {
        this.nodes[i2].options |= OPT_PRESERVE_WS;
      }
    }
    return false;
  }
  get currentPos() {
    this.closeExtra();
    let pos2 = 0;
    for (let i2 = this.open; i2 >= 0; i2--) {
      let content2 = this.nodes[i2].content;
      for (let j = content2.length - 1; j >= 0; j--)
        pos2 += content2[j].nodeSize;
      if (i2)
        pos2++;
    }
    return pos2;
  }
  findAtPoint(parent, offset) {
    if (this.find)
      for (let i2 = 0; i2 < this.find.length; i2++) {
        if (this.find[i2].node == parent && this.find[i2].offset == offset)
          this.find[i2].pos = this.currentPos;
      }
  }
  findInside(parent) {
    if (this.find)
      for (let i2 = 0; i2 < this.find.length; i2++) {
        if (this.find[i2].pos == null && parent.nodeType == 1 && parent.contains(this.find[i2].node))
          this.find[i2].pos = this.currentPos;
      }
  }
  findAround(parent, content2, before) {
    if (parent != content2 && this.find)
      for (let i2 = 0; i2 < this.find.length; i2++) {
        if (this.find[i2].pos == null && parent.nodeType == 1 && parent.contains(this.find[i2].node)) {
          let pos2 = content2.compareDocumentPosition(this.find[i2].node);
          if (pos2 & (before ? 2 : 4))
            this.find[i2].pos = this.currentPos;
        }
      }
  }
  findInText(textNode) {
    if (this.find)
      for (let i2 = 0; i2 < this.find.length; i2++) {
        if (this.find[i2].node == textNode)
          this.find[i2].pos = this.currentPos - (textNode.nodeValue.length - this.find[i2].offset);
      }
  }
  // Determines whether the given context string matches this context.
  matchesContext(context) {
    if (context.indexOf("|") > -1)
      return context.split(/\s*\|\s*/).some(this.matchesContext, this);
    let parts2 = context.split("/");
    let option3 = this.options.context;
    let useRoot = !this.isOpen && (!option3 || option3.parent.type == this.nodes[0].type);
    let minDepth = -(option3 ? option3.depth + 1 : 0) + (useRoot ? 0 : 1);
    let match2 = /* @__PURE__ */ __name((i2, depth) => {
      for (; i2 >= 0; i2--) {
        let part = parts2[i2];
        if (part == "") {
          if (i2 == parts2.length - 1 || i2 == 0)
            continue;
          for (; depth >= minDepth; depth--)
            if (match2(i2 - 1, depth))
              return true;
          return false;
        } else {
          let next2 = depth > 0 || depth == 0 && useRoot ? this.nodes[depth].type : option3 && depth >= minDepth ? option3.node(depth - minDepth).type : null;
          if (!next2 || next2.name != part && !next2.isInGroup(part))
            return false;
          depth--;
        }
      }
      return true;
    }, "match");
    return match2(parts2.length - 1, this.open);
  }
  textblockFromContext() {
    let $context = this.options.context;
    if ($context)
      for (let d = $context.depth; d >= 0; d--) {
        let deflt = $context.node(d).contentMatchAt($context.indexAfter(d)).defaultType;
        if (deflt && deflt.isTextblock && deflt.defaultAttrs)
          return deflt;
      }
    for (let name2 in this.parser.schema.nodes) {
      let type = this.parser.schema.nodes[name2];
      if (type.isTextblock && type.defaultAttrs)
        return type;
    }
  }
}
function normalizeList(dom) {
  for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {
    let name2 = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;
    if (name2 && listTags.hasOwnProperty(name2) && prevItem) {
      prevItem.appendChild(child);
      child = prevItem;
    } else if (name2 == "li") {
      prevItem = child;
    } else if (name2) {
      prevItem = null;
    }
  }
}
__name(normalizeList, "normalizeList");
function matches(dom, selector) {
  return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector);
}
__name(matches, "matches");
function copy(obj) {
  let copy2 = {};
  for (let prop2 in obj)
    copy2[prop2] = obj[prop2];
  return copy2;
}
__name(copy, "copy");
function markMayApply(markType, nodeType) {
  let nodes = nodeType.schema.nodes;
  for (let name2 in nodes) {
    let parent = nodes[name2];
    if (!parent.allowsMarkType(markType))
      continue;
    let seen2 = [], scan = /* @__PURE__ */ __name((match2) => {
      seen2.push(match2);
      for (let i2 = 0; i2 < match2.edgeCount; i2++) {
        let { type, next: next2 } = match2.edge(i2);
        if (type == nodeType)
          return true;
        if (seen2.indexOf(next2) < 0 && scan(next2))
          return true;
      }
    }, "scan");
    if (scan(parent.contentMatch))
      return true;
  }
}
__name(markMayApply, "markMayApply");
class DOMSerializer {
  static {
    __name(this, "DOMSerializer");
  }
  /**
  Create a serializer. `nodes` should map node names to functions
  that take a node and return a description of the corresponding
  DOM. `marks` does the same for mark names, but also gets an
  argument that tells it whether the mark's content is block or
  inline content (for typical use, it'll always be inline). A mark
  serializer may be `null` to indicate that marks of that type
  should not be serialized.
  */
  constructor(nodes, marks) {
    this.nodes = nodes;
    this.marks = marks;
  }
  /**
  Serialize the content of this fragment to a DOM fragment. When
  not in the browser, the `document` option, containing a DOM
  document, should be passed so that the serializer can create
  nodes.
  */
  serializeFragment(fragment, options4 = {}, target) {
    if (!target)
      target = doc$1(options4).createDocumentFragment();
    let top = target, active3 = [];
    fragment.forEach((node3) => {
      if (active3.length || node3.marks.length) {
        let keep = 0, rendered = 0;
        while (keep < active3.length && rendered < node3.marks.length) {
          let next2 = node3.marks[rendered];
          if (!this.marks[next2.type.name]) {
            rendered++;
            continue;
          }
          if (!next2.eq(active3[keep][0]) || next2.type.spec.spanning === false)
            break;
          keep++;
          rendered++;
        }
        while (keep < active3.length)
          top = active3.pop()[1];
        while (rendered < node3.marks.length) {
          let add3 = node3.marks[rendered++];
          let markDOM = this.serializeMark(add3, node3.isInline, options4);
          if (markDOM) {
            active3.push([add3, top]);
            top.appendChild(markDOM.dom);
            top = markDOM.contentDOM || markDOM.dom;
          }
        }
      }
      top.appendChild(this.serializeNodeInner(node3, options4));
    });
    return target;
  }
  /**
  @internal
  */
  serializeNodeInner(node3, options4) {
    let { dom, contentDOM } = renderSpec(doc$1(options4), this.nodes[node3.type.name](node3), null, node3.attrs);
    if (contentDOM) {
      if (node3.isLeaf)
        throw new RangeError("Content hole not allowed in a leaf node spec");
      this.serializeFragment(node3.content, options4, contentDOM);
    }
    return dom;
  }
  /**
  Serialize this node to a DOM node. This can be useful when you
  need to serialize a part of a document, as opposed to the whole
  document. To serialize a whole document, use
  [`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on
  its [content](https://prosemirror.net/docs/ref/#model.Node.content).
  */
  serializeNode(node3, options4 = {}) {
    let dom = this.serializeNodeInner(node3, options4);
    for (let i2 = node3.marks.length - 1; i2 >= 0; i2--) {
      let wrap2 = this.serializeMark(node3.marks[i2], node3.isInline, options4);
      if (wrap2) {
        (wrap2.contentDOM || wrap2.dom).appendChild(dom);
        dom = wrap2.dom;
      }
    }
    return dom;
  }
  /**
  @internal
  */
  serializeMark(mark2, inline3, options4 = {}) {
    let toDOM = this.marks[mark2.type.name];
    return toDOM && renderSpec(doc$1(options4), toDOM(mark2, inline3), null, mark2.attrs);
  }
  static renderSpec(doc2, structure, xmlNS = null, blockArraysIn) {
    return renderSpec(doc2, structure, xmlNS, blockArraysIn);
  }
  /**
  Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
  properties in a schema's node and mark specs.
  */
  static fromSchema(schema2) {
    return schema2.cached.domSerializer || (schema2.cached.domSerializer = new DOMSerializer(this.nodesFromSchema(schema2), this.marksFromSchema(schema2)));
  }
  /**
  Gather the serializers in a schema's node specs into an object.
  This can be useful as a base to build a custom serializer from.
  */
  static nodesFromSchema(schema2) {
    let result = gatherToDOM(schema2.nodes);
    if (!result.text)
      result.text = (node3) => node3.text;
    return result;
  }
  /**
  Gather the serializers in a schema's mark specs into an object.
  */
  static marksFromSchema(schema2) {
    return gatherToDOM(schema2.marks);
  }
}
function gatherToDOM(obj) {
  let result = {};
  for (let name2 in obj) {
    let toDOM = obj[name2].spec.toDOM;
    if (toDOM)
      result[name2] = toDOM;
  }
  return result;
}
__name(gatherToDOM, "gatherToDOM");
function doc$1(options4) {
  return options4.document || window.document;
}
__name(doc$1, "doc$1");
const suspiciousAttributeCache = /* @__PURE__ */ new WeakMap();
function suspiciousAttributes(attrs4) {
  let value4 = suspiciousAttributeCache.get(attrs4);
  if (value4 === void 0)
    suspiciousAttributeCache.set(attrs4, value4 = suspiciousAttributesInner(attrs4));
  return value4;
}
__name(suspiciousAttributes, "suspiciousAttributes");
function suspiciousAttributesInner(attrs4) {
  let result = null;
  function scan(value4) {
    if (value4 && typeof value4 == "object") {
      if (Array.isArray(value4)) {
        if (typeof value4[0] == "string") {
          if (!result)
            result = [];
          result.push(value4);
        } else {
          for (let i2 = 0; i2 < value4.length; i2++)
            scan(value4[i2]);
        }
      } else {
        for (let prop2 in value4)
          scan(value4[prop2]);
      }
    }
  }
  __name(scan, "scan");
  scan(attrs4);
  return result;
}
__name(suspiciousAttributesInner, "suspiciousAttributesInner");
function renderSpec(doc2, structure, xmlNS, blockArraysIn) {
  if (typeof structure == "string")
    return { dom: doc2.createTextNode(structure) };
  if (structure.nodeType != null)
    return { dom: structure };
  if (structure.dom && structure.dom.nodeType != null)
    return structure;
  let tagName = structure[0], suspicious;
  if (typeof tagName != "string")
    throw new RangeError("Invalid array passed to renderSpec");
  if (blockArraysIn && (suspicious = suspiciousAttributes(blockArraysIn)) && suspicious.indexOf(structure) > -1)
    throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
  let space = tagName.indexOf(" ");
  if (space > 0) {
    xmlNS = tagName.slice(0, space);
    tagName = tagName.slice(space + 1);
  }
  let contentDOM;
  let dom = xmlNS ? doc2.createElementNS(xmlNS, tagName) : doc2.createElement(tagName);
  let attrs4 = structure[1], start2 = 1;
  if (attrs4 && typeof attrs4 == "object" && attrs4.nodeType == null && !Array.isArray(attrs4)) {
    start2 = 2;
    for (let name2 in attrs4)
      if (attrs4[name2] != null) {
        let space2 = name2.indexOf(" ");
        if (space2 > 0)
          dom.setAttributeNS(name2.slice(0, space2), name2.slice(space2 + 1), attrs4[name2]);
        else
          dom.setAttribute(name2, attrs4[name2]);
      }
  }
  for (let i2 = start2; i2 < structure.length; i2++) {
    let child = structure[i2];
    if (child === 0) {
      if (i2 < structure.length - 1 || i2 > start2)
        throw new RangeError("Content hole must be the only child of its parent node");
      return { dom, contentDOM: dom };
    } else {
      let { dom: inner, contentDOM: innerContent } = renderSpec(doc2, child, xmlNS, blockArraysIn);
      dom.appendChild(inner);
      if (innerContent) {
        if (contentDOM)
          throw new RangeError("Multiple content holes");
        contentDOM = innerContent;
      }
    }
  }
  return { dom, contentDOM };
}
__name(renderSpec, "renderSpec");
const lower16 = 65535;
const factor16 = Math.pow(2, 16);
function makeRecover(index2, offset) {
  return index2 + offset * factor16;
}
__name(makeRecover, "makeRecover");
function recoverIndex(value4) {
  return value4 & lower16;
}
__name(recoverIndex, "recoverIndex");
function recoverOffset(value4) {
  return (value4 - (value4 & lower16)) / factor16;
}
__name(recoverOffset, "recoverOffset");
const DEL_BEFORE = 1, DEL_AFTER = 2, DEL_ACROSS = 4, DEL_SIDE = 8;
class MapResult {
  static {
    __name(this, "MapResult");
  }
  /**
  @internal
  */
  constructor(pos2, delInfo, recover) {
    this.pos = pos2;
    this.delInfo = delInfo;
    this.recover = recover;
  }
  /**
  Tells you whether the position was deleted, that is, whether the
  step removed the token on the side queried (via the `assoc`)
  argument from the document.
  */
  get deleted() {
    return (this.delInfo & DEL_SIDE) > 0;
  }
  /**
  Tells you whether the token before the mapped position was deleted.
  */
  get deletedBefore() {
    return (this.delInfo & (DEL_BEFORE | DEL_ACROSS)) > 0;
  }
  /**
  True when the token after the mapped position was deleted.
  */
  get deletedAfter() {
    return (this.delInfo & (DEL_AFTER | DEL_ACROSS)) > 0;
  }
  /**
  Tells whether any of the steps mapped through deletes across the
  position (including both the token before and after the
  position).
  */
  get deletedAcross() {
    return (this.delInfo & DEL_ACROSS) > 0;
  }
}
class StepMap {
  static {
    __name(this, "StepMap");
  }
  /**
  Create a position map. The modifications to the document are
  represented as an array of numbers, in which each group of three
  represents a modified chunk as `[start, oldSize, newSize]`.
  */
  constructor(ranges, inverted = false) {
    this.ranges = ranges;
    this.inverted = inverted;
    if (!ranges.length && StepMap.empty)
      return StepMap.empty;
  }
  /**
  @internal
  */
  recover(value4) {
    let diff2 = 0, index2 = recoverIndex(value4);
    if (!this.inverted)
      for (let i2 = 0; i2 < index2; i2++)
        diff2 += this.ranges[i2 * 3 + 2] - this.ranges[i2 * 3 + 1];
    return this.ranges[index2 * 3] + diff2 + recoverOffset(value4);
  }
  mapResult(pos2, assoc = 1) {
    return this._map(pos2, assoc, false);
  }
  map(pos2, assoc = 1) {
    return this._map(pos2, assoc, true);
  }
  /**
  @internal
  */
  _map(pos2, assoc, simple) {
    let diff2 = 0, oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;
    for (let i2 = 0; i2 < this.ranges.length; i2 += 3) {
      let start2 = this.ranges[i2] - (this.inverted ? diff2 : 0);
      if (start2 > pos2)
        break;
      let oldSize = this.ranges[i2 + oldIndex], newSize = this.ranges[i2 + newIndex], end = start2 + oldSize;
      if (pos2 <= end) {
        let side = !oldSize ? assoc : pos2 == start2 ? -1 : pos2 == end ? 1 : assoc;
        let result = start2 + diff2 + (side < 0 ? 0 : newSize);
        if (simple)
          return result;
        let recover = pos2 == (assoc < 0 ? start2 : end) ? null : makeRecover(i2 / 3, pos2 - start2);
        let del2 = pos2 == start2 ? DEL_AFTER : pos2 == end ? DEL_BEFORE : DEL_ACROSS;
        if (assoc < 0 ? pos2 != start2 : pos2 != end)
          del2 |= DEL_SIDE;
        return new MapResult(result, del2, recover);
      }
      diff2 += newSize - oldSize;
    }
    return simple ? pos2 + diff2 : new MapResult(pos2 + diff2, 0, null);
  }
  /**
  @internal
  */
  touches(pos2, recover) {
    let diff2 = 0, index2 = recoverIndex(recover);
    let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;
    for (let i2 = 0; i2 < this.ranges.length; i2 += 3) {
      let start2 = this.ranges[i2] - (this.inverted ? diff2 : 0);
      if (start2 > pos2)
        break;
      let oldSize = this.ranges[i2 + oldIndex], end = start2 + oldSize;
      if (pos2 <= end && i2 == index2 * 3)
        return true;
      diff2 += this.ranges[i2 + newIndex] - oldSize;
    }
    return false;
  }
  /**
  Calls the given function on each of the changed ranges included in
  this map.
  */
  forEach(f) {
    let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;
    for (let i2 = 0, diff2 = 0; i2 < this.ranges.length; i2 += 3) {
      let start2 = this.ranges[i2], oldStart = start2 - (this.inverted ? diff2 : 0), newStart = start2 + (this.inverted ? 0 : diff2);
      let oldSize = this.ranges[i2 + oldIndex], newSize = this.ranges[i2 + newIndex];
      f(oldStart, oldStart + oldSize, newStart, newStart + newSize);
      diff2 += newSize - oldSize;
    }
  }
  /**
  Create an inverted version of this map. The result can be used to
  map positions in the post-step document to the pre-step document.
  */
  invert() {
    return new StepMap(this.ranges, !this.inverted);
  }
  /**
  @internal
  */
  toString() {
    return (this.inverted ? "-" : "") + JSON.stringify(this.ranges);
  }
  /**
  Create a map that moves all positions by offset `n` (which may be
  negative). This can be useful when applying steps meant for a
  sub-document to a larger document, or vice-versa.
  */
  static offset(n) {
    return n == 0 ? StepMap.empty : new StepMap(n < 0 ? [0, -n, 0] : [0, 0, n]);
  }
}
StepMap.empty = new StepMap([]);
class Mapping {
  static {
    __name(this, "Mapping");
  }
  /**
  Create a new mapping with the given position maps.
  */
  constructor(maps = [], mirror, from2 = 0, to = maps.length) {
    this.maps = maps;
    this.mirror = mirror;
    this.from = from2;
    this.to = to;
  }
  /**
  Create a mapping that maps only through a part of this one.
  */
  slice(from2 = 0, to = this.maps.length) {
    return new Mapping(this.maps, this.mirror, from2, to);
  }
  /**
  @internal
  */
  copy() {
    return new Mapping(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to);
  }
  /**
  Add a step map to the end of this mapping. If `mirrors` is
  given, it should be the index of the step map that is the mirror
  image of this one.
  */
  appendMap(map3, mirrors) {
    this.to = this.maps.push(map3);
    if (mirrors != null)
      this.setMirror(this.maps.length - 1, mirrors);
  }
  /**
  Add all the step maps in a given mapping to this one (preserving
  mirroring information).
  */
  appendMapping(mapping) {
    for (let i2 = 0, startSize = this.maps.length; i2 < mapping.maps.length; i2++) {
      let mirr = mapping.getMirror(i2);
      this.appendMap(mapping.maps[i2], mirr != null && mirr < i2 ? startSize + mirr : void 0);
    }
  }
  /**
  Finds the offset of the step map that mirrors the map at the
  given offset, in this mapping (as per the second argument to
  `appendMap`).
  */
  getMirror(n) {
    if (this.mirror) {
      for (let i2 = 0; i2 < this.mirror.length; i2++)
        if (this.mirror[i2] == n)
          return this.mirror[i2 + (i2 % 2 ? -1 : 1)];
    }
  }
  /**
  @internal
  */
  setMirror(n, m) {
    if (!this.mirror)
      this.mirror = [];
    this.mirror.push(n, m);
  }
  /**
  Append the inverse of the given mapping to this one.
  */
  appendMappingInverted(mapping) {
    for (let i2 = mapping.maps.length - 1, totalSize = this.maps.length + mapping.maps.length; i2 >= 0; i2--) {
      let mirr = mapping.getMirror(i2);
      this.appendMap(mapping.maps[i2].invert(), mirr != null && mirr > i2 ? totalSize - mirr - 1 : void 0);
    }
  }
  /**
  Create an inverted version of this mapping.
  */
  invert() {
    let inverse = new Mapping();
    inverse.appendMappingInverted(this);
    return inverse;
  }
  /**
  Map a position through this mapping.
  */
  map(pos2, assoc = 1) {
    if (this.mirror)
      return this._map(pos2, assoc, true);
    for (let i2 = this.from; i2 < this.to; i2++)
      pos2 = this.maps[i2].map(pos2, assoc);
    return pos2;
  }
  /**
  Map a position through this mapping, returning a mapping
  result.
  */
  mapResult(pos2, assoc = 1) {
    return this._map(pos2, assoc, false);
  }
  /**
  @internal
  */
  _map(pos2, assoc, simple) {
    let delInfo = 0;
    for (let i2 = this.from; i2 < this.to; i2++) {
      let map3 = this.maps[i2], result = map3.mapResult(pos2, assoc);
      if (result.recover != null) {
        let corr = this.getMirror(i2);
        if (corr != null && corr > i2 && corr < this.to) {
          i2 = corr;
          pos2 = this.maps[corr].recover(result.recover);
          continue;
        }
      }
      delInfo |= result.delInfo;
      pos2 = result.pos;
    }
    return simple ? pos2 : new MapResult(pos2, delInfo, null);
  }
}
const stepsByID = /* @__PURE__ */ Object.create(null);
class Step {
  static {
    __name(this, "Step");
  }
  /**
  Get the step map that represents the changes made by this step,
  and which can be used to transform between positions in the old
  and the new document.
  */
  getMap() {
    return StepMap.empty;
  }
  /**
  Try to merge this step with another one, to be applied directly
  after it. Returns the merged step when possible, null if the
  steps can't be merged.
  */
  merge(other) {
    return null;
  }
  /**
  Deserialize a step from its JSON representation. Will call
  through to the step class' own implementation of this method.
  */
  static fromJSON(schema2, json) {
    if (!json || !json.stepType)
      throw new RangeError("Invalid input for Step.fromJSON");
    let type = stepsByID[json.stepType];
    if (!type)
      throw new RangeError(`No step type ${json.stepType} defined`);
    return type.fromJSON(schema2, json);
  }
  /**
  To be able to serialize steps to JSON, each step needs a string
  ID to attach to its JSON representation. Use this method to
  register an ID for your step classes. Try to pick something
  that's unlikely to clash with steps from other modules.
  */
  static jsonID(id3, stepClass) {
    if (id3 in stepsByID)
      throw new RangeError("Duplicate use of step JSON ID " + id3);
    stepsByID[id3] = stepClass;
    stepClass.prototype.jsonID = id3;
    return stepClass;
  }
}
class StepResult {
  static {
    __name(this, "StepResult");
  }
  /**
  @internal
  */
  constructor(doc2, failed) {
    this.doc = doc2;
    this.failed = failed;
  }
  /**
  Create a successful step result.
  */
  static ok(doc2) {
    return new StepResult(doc2, null);
  }
  /**
  Create a failed step result.
  */
  static fail(message3) {
    return new StepResult(null, message3);
  }
  /**
  Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
  arguments. Create a successful result if it succeeds, and a
  failed one if it throws a `ReplaceError`.
  */
  static fromReplace(doc2, from2, to, slice2) {
    try {
      return StepResult.ok(doc2.replace(from2, to, slice2));
    } catch (e2) {
      if (e2 instanceof ReplaceError)
        return StepResult.fail(e2.message);
      throw e2;
    }
  }
}
function mapFragment(fragment, f, parent) {
  let mapped = [];
  for (let i2 = 0; i2 < fragment.childCount; i2++) {
    let child = fragment.child(i2);
    if (child.content.size)
      child = child.copy(mapFragment(child.content, f, child));
    if (child.isInline)
      child = f(child, parent, i2);
    mapped.push(child);
  }
  return Fragment.fromArray(mapped);
}
__name(mapFragment, "mapFragment");
class AddMarkStep extends Step {
  static {
    __name(this, "AddMarkStep");
  }
  /**
  Create a mark step.
  */
  constructor(from2, to, mark2) {
    super();
    this.from = from2;
    this.to = to;
    this.mark = mark2;
  }
  apply(doc2) {
    let oldSlice = doc2.slice(this.from, this.to), $from = doc2.resolve(this.from);
    let parent = $from.node($from.sharedDepth(this.to));
    let slice2 = new Slice(mapFragment(oldSlice.content, (node3, parent2) => {
      if (!node3.isAtom || !parent2.type.allowsMarkType(this.mark.type))
        return node3;
      return node3.mark(this.mark.addToSet(node3.marks));
    }, parent), oldSlice.openStart, oldSlice.openEnd);
    return StepResult.fromReplace(doc2, this.from, this.to, slice2);
  }
  invert() {
    return new RemoveMarkStep(this.from, this.to, this.mark);
  }
  map(mapping) {
    let from2 = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);
    if (from2.deleted && to.deleted || from2.pos >= to.pos)
      return null;
    return new AddMarkStep(from2.pos, to.pos, this.mark);
  }
  merge(other) {
    if (other instanceof AddMarkStep && other.mark.eq(this.mark) && this.from <= other.to && this.to >= other.from)
      return new AddMarkStep(Math.min(this.from, other.from), Math.max(this.to, other.to), this.mark);
    return null;
  }
  toJSON() {
    return {
      stepType: "addMark",
      mark: this.mark.toJSON(),
      from: this.from,
      to: this.to
    };
  }
  /**
  @internal
  */
  static fromJSON(schema2, json) {
    if (typeof json.from != "number" || typeof json.to != "number")
      throw new RangeError("Invalid input for AddMarkStep.fromJSON");
    return new AddMarkStep(json.from, json.to, schema2.markFromJSON(json.mark));
  }
}
Step.jsonID("addMark", AddMarkStep);
class RemoveMarkStep extends Step {
  static {
    __name(this, "RemoveMarkStep");
  }
  /**
  Create a mark-removing step.
  */
  constructor(from2, to, mark2) {
    super();
    this.from = from2;
    this.to = to;
    this.mark = mark2;
  }
  apply(doc2) {
    let oldSlice = doc2.slice(this.from, this.to);
    let slice2 = new Slice(mapFragment(oldSlice.content, (node3) => {
      return node3.mark(this.mark.removeFromSet(node3.marks));
    }, doc2), oldSlice.openStart, oldSlice.openEnd);
    return StepResult.fromReplace(doc2, this.from, this.to, slice2);
  }
  invert() {
    return new AddMarkStep(this.from, this.to, this.mark);
  }
  map(mapping) {
    let from2 = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);
    if (from2.deleted && to.deleted || from2.pos >= to.pos)
      return null;
    return new RemoveMarkStep(from2.pos, to.pos, this.mark);
  }
  merge(other) {
    if (other instanceof RemoveMarkStep && other.mark.eq(this.mark) && this.from <= other.to && this.to >= other.from)
      return new RemoveMarkStep(Math.min(this.from, other.from), Math.max(this.to, other.to), this.mark);
    return null;
  }
  toJSON() {
    return {
      stepType: "removeMark",
      mark: this.mark.toJSON(),
      from: this.from,
      to: this.to
    };
  }
  /**
  @internal
  */
  static fromJSON(schema2, json) {
    if (typeof json.from != "number" || typeof json.to != "number")
      throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
    return new RemoveMarkStep(json.from, json.to, schema2.markFromJSON(json.mark));
  }
}
Step.jsonID("removeMark", RemoveMarkStep);
class AddNodeMarkStep extends Step {
  static {
    __name(this, "AddNodeMarkStep");
  }
  /**
  Create a node mark step.
  */
  constructor(pos2, mark2) {
    super();
    this.pos = pos2;
    this.mark = mark2;
  }
  apply(doc2) {
    let node3 = doc2.nodeAt(this.pos);
    if (!node3)
      return StepResult.fail("No node at mark step's position");
    let updated13 = node3.type.create(node3.attrs, null, this.mark.addToSet(node3.marks));
    return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(Fragment.from(updated13), 0, node3.isLeaf ? 0 : 1));
  }
  invert(doc2) {
    let node3 = doc2.nodeAt(this.pos);
    if (node3) {
      let newSet = this.mark.addToSet(node3.marks);
      if (newSet.length == node3.marks.length) {
        for (let i2 = 0; i2 < node3.marks.length; i2++)
          if (!node3.marks[i2].isInSet(newSet))
            return new AddNodeMarkStep(this.pos, node3.marks[i2]);
        return new AddNodeMarkStep(this.pos, this.mark);
      }
    }
    return new RemoveNodeMarkStep(this.pos, this.mark);
  }
  map(mapping) {
    let pos2 = mapping.mapResult(this.pos, 1);
    return pos2.deletedAfter ? null : new AddNodeMarkStep(pos2.pos, this.mark);
  }
  toJSON() {
    return { stepType: "addNodeMark", pos: this.pos, mark: this.mark.toJSON() };
  }
  /**
  @internal
  */
  static fromJSON(schema2, json) {
    if (typeof json.pos != "number")
      throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
    return new AddNodeMarkStep(json.pos, schema2.markFromJSON(json.mark));
  }
}
Step.jsonID("addNodeMark", AddNodeMarkStep);
class RemoveNodeMarkStep extends Step {
  static {
    __name(this, "RemoveNodeMarkStep");
  }
  /**
  Create a mark-removing step.
  */
  constructor(pos2, mark2) {
    super();
    this.pos = pos2;
    this.mark = mark2;
  }
  apply(doc2) {
    let node3 = doc2.nodeAt(this.pos);
    if (!node3)
      return StepResult.fail("No node at mark step's position");
    let updated13 = node3.type.create(node3.attrs, null, this.mark.removeFromSet(node3.marks));
    return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(Fragment.from(updated13), 0, node3.isLeaf ? 0 : 1));
  }
  invert(doc2) {
    let node3 = doc2.nodeAt(this.pos);
    if (!node3 || !this.mark.isInSet(node3.marks))
      return this;
    return new AddNodeMarkStep(this.pos, this.mark);
  }
  map(mapping) {
    let pos2 = mapping.mapResult(this.pos, 1);
    return pos2.deletedAfter ? null : new RemoveNodeMarkStep(pos2.pos, this.mark);
  }
  toJSON() {
    return { stepType: "removeNodeMark", pos: this.pos, mark: this.mark.toJSON() };
  }
  /**
  @internal
  */
  static fromJSON(schema2, json) {
    if (typeof json.pos != "number")
      throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
    return new RemoveNodeMarkStep(json.pos, schema2.markFromJSON(json.mark));
  }
}
Step.jsonID("removeNodeMark", RemoveNodeMarkStep);
class ReplaceStep extends Step {
  static {
    __name(this, "ReplaceStep");
  }
  /**
  The given `slice` should fit the 'gap' between `from` and
  `to`—the depths must line up, and the surrounding nodes must be
  able to be joined with the open sides of the slice. When
  `structure` is true, the step will fail if the content between
  from and to is not just a sequence of closing and then opening
  tokens (this is to guard against rebased replace steps
  overwriting something they weren't supposed to).
  */
  constructor(from2, to, slice2, structure = false) {
    super();
    this.from = from2;
    this.to = to;
    this.slice = slice2;
    this.structure = structure;
  }
  apply(doc2) {
    if (this.structure && contentBetween(doc2, this.from, this.to))
      return StepResult.fail("Structure replace would overwrite content");
    return StepResult.fromReplace(doc2, this.from, this.to, this.slice);
  }
  getMap() {
    return new StepMap([this.from, this.to - this.from, this.slice.size]);
  }
  invert(doc2) {
    return new ReplaceStep(this.from, this.from + this.slice.size, doc2.slice(this.from, this.to));
  }
  map(mapping) {
    let from2 = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);
    if (from2.deletedAcross && to.deletedAcross)
      return null;
    return new ReplaceStep(from2.pos, Math.max(from2.pos, to.pos), this.slice);
  }
  merge(other) {
    if (!(other instanceof ReplaceStep) || other.structure || this.structure)
      return null;
    if (this.from + this.slice.size == other.from && !this.slice.openEnd && !other.slice.openStart) {
      let slice2 = this.slice.size + other.slice.size == 0 ? Slice.empty : new Slice(this.slice.content.append(other.slice.content), this.slice.openStart, other.slice.openEnd);
      return new ReplaceStep(this.from, this.to + (other.to - other.from), slice2, this.structure);
    } else if (other.to == this.from && !this.slice.openStart && !other.slice.openEnd) {
      let slice2 = this.slice.size + other.slice.size == 0 ? Slice.empty : new Slice(other.slice.content.append(this.slice.content), other.slice.openStart, this.slice.openEnd);
      return new ReplaceStep(other.from, this.to, slice2, this.structure);
    } else {
      return null;
    }
  }
  toJSON() {
    let json = { stepType: "replace", from: this.from, to: this.to };
    if (this.slice.size)
      json.slice = this.slice.toJSON();
    if (this.structure)
      json.structure = true;
    return json;
  }
  /**
  @internal
  */
  static fromJSON(schema2, json) {
    if (typeof json.from != "number" || typeof json.to != "number")
      throw new RangeError("Invalid input for ReplaceStep.fromJSON");
    return new ReplaceStep(json.from, json.to, Slice.fromJSON(schema2, json.slice), !!json.structure);
  }
}
Step.jsonID("replace", ReplaceStep);
class ReplaceAroundStep extends Step {
  static {
    __name(this, "ReplaceAroundStep");
  }
  /**
  Create a replace-around step with the given range and gap.
  `insert` should be the point in the slice into which the content
  of the gap should be moved. `structure` has the same meaning as
  it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.
  */
  constructor(from2, to, gapFrom, gapTo, slice2, insert2, structure = false) {
    super();
    this.from = from2;
    this.to = to;
    this.gapFrom = gapFrom;
    this.gapTo = gapTo;
    this.slice = slice2;
    this.insert = insert2;
    this.structure = structure;
  }
  apply(doc2) {
    if (this.structure && (contentBetween(doc2, this.from, this.gapFrom) || contentBetween(doc2, this.gapTo, this.to)))
      return StepResult.fail("Structure gap-replace would overwrite content");
    let gap = doc2.slice(this.gapFrom, this.gapTo);
    if (gap.openStart || gap.openEnd)
      return StepResult.fail("Gap is not a flat range");
    let inserted = this.slice.insertAt(this.insert, gap.content);
    if (!inserted)
      return StepResult.fail("Content does not fit in gap");
    return StepResult.fromReplace(doc2, this.from, this.to, inserted);
  }
  getMap() {
    return new StepMap([
      this.from,
      this.gapFrom - this.from,
      this.insert,
      this.gapTo,
      this.to - this.gapTo,
      this.slice.size - this.insert
    ]);
  }
  invert(doc2) {
    let gap = this.gapTo - this.gapFrom;
    return new ReplaceAroundStep(this.from, this.from + this.slice.size + gap, this.from + this.insert, this.from + this.insert + gap, doc2.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
  }
  map(mapping) {
    let from2 = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);
    let gapFrom = this.from == this.gapFrom ? from2.pos : mapping.map(this.gapFrom, -1);
    let gapTo = this.to == this.gapTo ? to.pos : mapping.map(this.gapTo, 1);
    if (from2.deletedAcross && to.deletedAcross || gapFrom < from2.pos || gapTo > to.pos)
      return null;
    return new ReplaceAroundStep(from2.pos, to.pos, gapFrom, gapTo, this.slice, this.insert, this.structure);
  }
  toJSON() {
    let json = {
      stepType: "replaceAround",
      from: this.from,
      to: this.to,
      gapFrom: this.gapFrom,
      gapTo: this.gapTo,
      insert: this.insert
    };
    if (this.slice.size)
      json.slice = this.slice.toJSON();
    if (this.structure)
      json.structure = true;
    return json;
  }
  /**
  @internal
  */
  static fromJSON(schema2, json) {
    if (typeof json.from != "number" || typeof json.to != "number" || typeof json.gapFrom != "number" || typeof json.gapTo != "number" || typeof json.insert != "number")
      throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
    return new ReplaceAroundStep(json.from, json.to, json.gapFrom, json.gapTo, Slice.fromJSON(schema2, json.slice), json.insert, !!json.structure);
  }
}
Step.jsonID("replaceAround", ReplaceAroundStep);
function contentBetween(doc2, from2, to) {
  let $from = doc2.resolve(from2), dist3 = to - from2, depth = $from.depth;
  while (dist3 > 0 && depth > 0 && $from.indexAfter(depth) == $from.node(depth).childCount) {
    depth--;
    dist3--;
  }
  if (dist3 > 0) {
    let next2 = $from.node(depth).maybeChild($from.indexAfter(depth));
    while (dist3 > 0) {
      if (!next2 || next2.isLeaf)
        return true;
      next2 = next2.firstChild;
      dist3--;
    }
  }
  return false;
}
__name(contentBetween, "contentBetween");
function addMark(tr2, from2, to, mark2) {
  let removed = [], added = [];
  let removing, adding;
  tr2.doc.nodesBetween(from2, to, (node3, pos2, parent) => {
    if (!node3.isInline)
      return;
    let marks = node3.marks;
    if (!mark2.isInSet(marks) && parent.type.allowsMarkType(mark2.type)) {
      let start2 = Math.max(pos2, from2), end = Math.min(pos2 + node3.nodeSize, to);
      let newSet = mark2.addToSet(marks);
      for (let i2 = 0; i2 < marks.length; i2++) {
        if (!marks[i2].isInSet(newSet)) {
          if (removing && removing.to == start2 && removing.mark.eq(marks[i2]))
            removing.to = end;
          else
            removed.push(removing = new RemoveMarkStep(start2, end, marks[i2]));
        }
      }
      if (adding && adding.to == start2)
        adding.to = end;
      else
        added.push(adding = new AddMarkStep(start2, end, mark2));
    }
  });
  removed.forEach((s) => tr2.step(s));
  added.forEach((s) => tr2.step(s));
}
__name(addMark, "addMark");
function removeMark(tr2, from2, to, mark2) {
  let matched = [], step3 = 0;
  tr2.doc.nodesBetween(from2, to, (node3, pos2) => {
    if (!node3.isInline)
      return;
    step3++;
    let toRemove = null;
    if (mark2 instanceof MarkType) {
      let set3 = node3.marks, found2;
      while (found2 = mark2.isInSet(set3)) {
        (toRemove || (toRemove = [])).push(found2);
        set3 = found2.removeFromSet(set3);
      }
    } else if (mark2) {
      if (mark2.isInSet(node3.marks))
        toRemove = [mark2];
    } else {
      toRemove = node3.marks;
    }
    if (toRemove && toRemove.length) {
      let end = Math.min(pos2 + node3.nodeSize, to);
      for (let i2 = 0; i2 < toRemove.length; i2++) {
        let style2 = toRemove[i2], found2;
        for (let j = 0; j < matched.length; j++) {
          let m = matched[j];
          if (m.step == step3 - 1 && style2.eq(matched[j].style))
            found2 = m;
        }
        if (found2) {
          found2.to = end;
          found2.step = step3;
        } else {
          matched.push({ style: style2, from: Math.max(pos2, from2), to: end, step: step3 });
        }
      }
    }
  });
  matched.forEach((m) => tr2.step(new RemoveMarkStep(m.from, m.to, m.style)));
}
__name(removeMark, "removeMark");
function clearIncompatible(tr2, pos2, parentType, match2 = parentType.contentMatch, clearNewlines = true) {
  let node3 = tr2.doc.nodeAt(pos2);
  let replSteps = [], cur = pos2 + 1;
  for (let i2 = 0; i2 < node3.childCount; i2++) {
    let child = node3.child(i2), end = cur + child.nodeSize;
    let allowed = match2.matchType(child.type);
    if (!allowed) {
      replSteps.push(new ReplaceStep(cur, end, Slice.empty));
    } else {
      match2 = allowed;
      for (let j = 0; j < child.marks.length; j++)
        if (!parentType.allowsMarkType(child.marks[j].type))
          tr2.step(new RemoveMarkStep(cur, end, child.marks[j]));
      if (clearNewlines && child.isText && parentType.whitespace != "pre") {
        let m, newline2 = /\r?\n|\r/g, slice2;
        while (m = newline2.exec(child.text)) {
          if (!slice2)
            slice2 = new Slice(Fragment.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
          replSteps.push(new ReplaceStep(cur + m.index, cur + m.index + m[0].length, slice2));
        }
      }
    }
    cur = end;
  }
  if (!match2.validEnd) {
    let fill = match2.fillBefore(Fragment.empty, true);
    tr2.replace(cur, cur, new Slice(fill, 0, 0));
  }
  for (let i2 = replSteps.length - 1; i2 >= 0; i2--)
    tr2.step(replSteps[i2]);
}
__name(clearIncompatible, "clearIncompatible");
function canCut(node3, start2, end) {
  return (start2 == 0 || node3.canReplace(start2, node3.childCount)) && (end == node3.childCount || node3.canReplace(0, end));
}
__name(canCut, "canCut");
function liftTarget(range2) {
  let parent = range2.parent;
  let content2 = parent.content.cutByIndex(range2.startIndex, range2.endIndex);
  for (let depth = range2.depth; ; --depth) {
    let node3 = range2.$from.node(depth);
    let index2 = range2.$from.index(depth), endIndex = range2.$to.indexAfter(depth);
    if (depth < range2.depth && node3.canReplace(index2, endIndex, content2))
      return depth;
    if (depth == 0 || node3.type.spec.isolating || !canCut(node3, index2, endIndex))
      break;
  }
  return null;
}
__name(liftTarget, "liftTarget");
function lift$2(tr2, range2, target) {
  let { $from, $to, depth } = range2;
  let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
  let start2 = gapStart, end = gapEnd;
  let before = Fragment.empty, openStart = 0;
  for (let d = depth, splitting = false; d > target; d--)
    if (splitting || $from.index(d) > 0) {
      splitting = true;
      before = Fragment.from($from.node(d).copy(before));
      openStart++;
    } else {
      start2--;
    }
  let after = Fragment.empty, openEnd = 0;
  for (let d = depth, splitting = false; d > target; d--)
    if (splitting || $to.after(d + 1) < $to.end(d)) {
      splitting = true;
      after = Fragment.from($to.node(d).copy(after));
      openEnd++;
    } else {
      end++;
    }
  tr2.step(new ReplaceAroundStep(start2, end, gapStart, gapEnd, new Slice(before.append(after), openStart, openEnd), before.size - openStart, true));
}
__name(lift$2, "lift$2");
function findWrapping(range2, nodeType, attrs4 = null, innerRange = range2) {
  let around = findWrappingOutside(range2, nodeType);
  let inner = around && findWrappingInside(innerRange, nodeType);
  if (!inner)
    return null;
  return around.map(withAttrs).concat({ type: nodeType, attrs: attrs4 }).concat(inner.map(withAttrs));
}
__name(findWrapping, "findWrapping");
function withAttrs(type) {
  return { type, attrs: null };
}
__name(withAttrs, "withAttrs");
function findWrappingOutside(range2, type) {
  let { parent, startIndex, endIndex } = range2;
  let around = parent.contentMatchAt(startIndex).findWrapping(type);
  if (!around)
    return null;
  let outer = around.length ? around[0] : type;
  return parent.canReplaceWith(startIndex, endIndex, outer) ? around : null;
}
__name(findWrappingOutside, "findWrappingOutside");
function findWrappingInside(range2, type) {
  let { parent, startIndex, endIndex } = range2;
  let inner = parent.child(startIndex);
  let inside = type.contentMatch.findWrapping(inner.type);
  if (!inside)
    return null;
  let lastType = inside.length ? inside[inside.length - 1] : type;
  let innerMatch = lastType.contentMatch;
  for (let i2 = startIndex; innerMatch && i2 < endIndex; i2++)
    innerMatch = innerMatch.matchType(parent.child(i2).type);
  if (!innerMatch || !innerMatch.validEnd)
    return null;
  return inside;
}
__name(findWrappingInside, "findWrappingInside");
function wrap(tr2, range2, wrappers) {
  let content2 = Fragment.empty;
  for (let i2 = wrappers.length - 1; i2 >= 0; i2--) {
    if (content2.size) {
      let match2 = wrappers[i2].type.contentMatch.matchFragment(content2);
      if (!match2 || !match2.validEnd)
        throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
    }
    content2 = Fragment.from(wrappers[i2].type.create(wrappers[i2].attrs, content2));
  }
  let start2 = range2.start, end = range2.end;
  tr2.step(new ReplaceAroundStep(start2, end, start2, end, new Slice(content2, 0, 0), wrappers.length, true));
}
__name(wrap, "wrap");
function setBlockType$1(tr2, from2, to, type, attrs4) {
  if (!type.isTextblock)
    throw new RangeError("Type given to setBlockType should be a textblock");
  let mapFrom = tr2.steps.length;
  tr2.doc.nodesBetween(from2, to, (node3, pos2) => {
    let attrsHere = typeof attrs4 == "function" ? attrs4(node3) : attrs4;
    if (node3.isTextblock && !node3.hasMarkup(type, attrsHere) && canChangeType(tr2.doc, tr2.mapping.slice(mapFrom).map(pos2), type)) {
      let convertNewlines = null;
      if (type.schema.linebreakReplacement) {
        let pre = type.whitespace == "pre", supportLinebreak = !!type.contentMatch.matchType(type.schema.linebreakReplacement);
        if (pre && !supportLinebreak)
          convertNewlines = false;
        else if (!pre && supportLinebreak)
          convertNewlines = true;
      }
      if (convertNewlines === false)
        replaceLinebreaks(tr2, node3, pos2, mapFrom);
      clearIncompatible(tr2, tr2.mapping.slice(mapFrom).map(pos2, 1), type, void 0, convertNewlines === null);
      let mapping = tr2.mapping.slice(mapFrom);
      let startM = mapping.map(pos2, 1), endM = mapping.map(pos2 + node3.nodeSize, 1);
      tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment.from(type.create(attrsHere, null, node3.marks)), 0, 0), 1, true));
      if (convertNewlines === true)
        replaceNewlines(tr2, node3, pos2, mapFrom);
      return false;
    }
  });
}
__name(setBlockType$1, "setBlockType$1");
function replaceNewlines(tr2, node3, pos2, mapFrom) {
  node3.forEach((child, offset) => {
    if (child.isText) {
      let m, newline2 = /\r?\n|\r/g;
      while (m = newline2.exec(child.text)) {
        let start2 = tr2.mapping.slice(mapFrom).map(pos2 + 1 + offset + m.index);
        tr2.replaceWith(start2, start2 + 1, node3.type.schema.linebreakReplacement.create());
      }
    }
  });
}
__name(replaceNewlines, "replaceNewlines");
function replaceLinebreaks(tr2, node3, pos2, mapFrom) {
  node3.forEach((child, offset) => {
    if (child.type == child.type.schema.linebreakReplacement) {
      let start2 = tr2.mapping.slice(mapFrom).map(pos2 + 1 + offset);
      tr2.replaceWith(start2, start2 + 1, node3.type.schema.text("\n"));
    }
  });
}
__name(replaceLinebreaks, "replaceLinebreaks");
function canChangeType(doc2, pos2, type) {
  let $pos = doc2.resolve(pos2), index2 = $pos.index();
  return $pos.parent.canReplaceWith(index2, index2 + 1, type);
}
__name(canChangeType, "canChangeType");
function setNodeMarkup(tr2, pos2, type, attrs4, marks) {
  let node3 = tr2.doc.nodeAt(pos2);
  if (!node3)
    throw new RangeError("No node at given position");
  if (!type)
    type = node3.type;
  let newNode = type.create(attrs4, null, marks || node3.marks);
  if (node3.isLeaf)
    return tr2.replaceWith(pos2, pos2 + node3.nodeSize, newNode);
  if (!type.validContent(node3.content))
    throw new RangeError("Invalid content for node type " + type.name);
  tr2.step(new ReplaceAroundStep(pos2, pos2 + node3.nodeSize, pos2 + 1, pos2 + node3.nodeSize - 1, new Slice(Fragment.from(newNode), 0, 0), 1, true));
}
__name(setNodeMarkup, "setNodeMarkup");
function canSplit(doc2, pos2, depth = 1, typesAfter) {
  let $pos = doc2.resolve(pos2), base2 = $pos.depth - depth;
  let innerType = typesAfter && typesAfter[typesAfter.length - 1] || $pos.parent;
  if (base2 < 0 || $pos.parent.type.spec.isolating || !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) || !innerType.type.validContent($pos.parent.content.cutByIndex($pos.index(), $pos.parent.childCount)))
    return false;
  for (let d = $pos.depth - 1, i2 = depth - 2; d > base2; d--, i2--) {
    let node3 = $pos.node(d), index3 = $pos.index(d);
    if (node3.type.spec.isolating)
      return false;
    let rest = node3.content.cutByIndex(index3, node3.childCount);
    let overrideChild = typesAfter && typesAfter[i2 + 1];
    if (overrideChild)
      rest = rest.replaceChild(0, overrideChild.type.create(overrideChild.attrs));
    let after = typesAfter && typesAfter[i2] || node3;
    if (!node3.canReplace(index3 + 1, node3.childCount) || !after.type.validContent(rest))
      return false;
  }
  let index2 = $pos.indexAfter(base2);
  let baseType = typesAfter && typesAfter[0];
  return $pos.node(base2).canReplaceWith(index2, index2, baseType ? baseType.type : $pos.node(base2 + 1).type);
}
__name(canSplit, "canSplit");
function split(tr2, pos2, depth = 1, typesAfter) {
  let $pos = tr2.doc.resolve(pos2), before = Fragment.empty, after = Fragment.empty;
  for (let d = $pos.depth, e2 = $pos.depth - depth, i2 = depth - 1; d > e2; d--, i2--) {
    before = Fragment.from($pos.node(d).copy(before));
    let typeAfter = typesAfter && typesAfter[i2];
    after = Fragment.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
  }
  tr2.step(new ReplaceStep(pos2, pos2, new Slice(before.append(after), depth, depth), true));
}
__name(split, "split");
function canJoin(doc2, pos2) {
  let $pos = doc2.resolve(pos2), index2 = $pos.index();
  return joinable($pos.nodeBefore, $pos.nodeAfter) && $pos.parent.canReplace(index2, index2 + 1);
}
__name(canJoin, "canJoin");
function canAppendWithSubstitutedLinebreaks(a, b) {
  if (!b.content.size)
    a.type.compatibleContent(b.type);
  let match2 = a.contentMatchAt(a.childCount);
  let { linebreakReplacement } = a.type.schema;
  for (let i2 = 0; i2 < b.childCount; i2++) {
    let child = b.child(i2);
    let type = child.type == linebreakReplacement ? a.type.schema.nodes.text : child.type;
    match2 = match2.matchType(type);
    if (!match2)
      return false;
    if (!a.type.allowsMarks(child.marks))
      return false;
  }
  return match2.validEnd;
}
__name(canAppendWithSubstitutedLinebreaks, "canAppendWithSubstitutedLinebreaks");
function joinable(a, b) {
  return !!(a && b && !a.isLeaf && canAppendWithSubstitutedLinebreaks(a, b));
}
__name(joinable, "joinable");
function joinPoint(doc2, pos2, dir = -1) {
  let $pos = doc2.resolve(pos2);
  for (let d = $pos.depth; ; d--) {
    let before, after, index2 = $pos.index(d);
    if (d == $pos.depth) {
      before = $pos.nodeBefore;
      after = $pos.nodeAfter;
    } else if (dir > 0) {
      before = $pos.node(d + 1);
      index2++;
      after = $pos.node(d).maybeChild(index2);
    } else {
      before = $pos.node(d).maybeChild(index2 - 1);
      after = $pos.node(d + 1);
    }
    if (before && !before.isTextblock && joinable(before, after) && $pos.node(d).canReplace(index2, index2 + 1))
      return pos2;
    if (d == 0)
      break;
    pos2 = dir < 0 ? $pos.before(d) : $pos.after(d);
  }
}
__name(joinPoint, "joinPoint");
function join(tr2, pos2, depth) {
  let convertNewlines = null;
  let { linebreakReplacement } = tr2.doc.type.schema;
  let $before = tr2.doc.resolve(pos2 - depth), beforeType = $before.node().type;
  if (linebreakReplacement && beforeType.inlineContent) {
    let pre = beforeType.whitespace == "pre";
    let supportLinebreak = !!beforeType.contentMatch.matchType(linebreakReplacement);
    if (pre && !supportLinebreak)
      convertNewlines = false;
    else if (!pre && supportLinebreak)
      convertNewlines = true;
  }
  let mapFrom = tr2.steps.length;
  if (convertNewlines === false) {
    let $after = tr2.doc.resolve(pos2 + depth);
    replaceLinebreaks(tr2, $after.node(), $after.before(), mapFrom);
  }
  if (beforeType.inlineContent)
    clearIncompatible(tr2, pos2 + depth - 1, beforeType, $before.node().contentMatchAt($before.index()), convertNewlines == null);
  let mapping = tr2.mapping.slice(mapFrom), start2 = mapping.map(pos2 - depth);
  tr2.step(new ReplaceStep(start2, mapping.map(pos2 + depth, -1), Slice.empty, true));
  if (convertNewlines === true) {
    let $full = tr2.doc.resolve(start2);
    replaceNewlines(tr2, $full.node(), $full.before(), tr2.steps.length);
  }
  return tr2;
}
__name(join, "join");
function insertPoint(doc2, pos2, nodeType) {
  let $pos = doc2.resolve(pos2);
  if ($pos.parent.canReplaceWith($pos.index(), $pos.index(), nodeType))
    return pos2;
  if ($pos.parentOffset == 0)
    for (let d = $pos.depth - 1; d >= 0; d--) {
      let index2 = $pos.index(d);
      if ($pos.node(d).canReplaceWith(index2, index2, nodeType))
        return $pos.before(d + 1);
      if (index2 > 0)
        return null;
    }
  if ($pos.parentOffset == $pos.parent.content.size)
    for (let d = $pos.depth - 1; d >= 0; d--) {
      let index2 = $pos.indexAfter(d);
      if ($pos.node(d).canReplaceWith(index2, index2, nodeType))
        return $pos.after(d + 1);
      if (index2 < $pos.node(d).childCount)
        return null;
    }
  return null;
}
__name(insertPoint, "insertPoint");
function dropPoint(doc2, pos2, slice2) {
  let $pos = doc2.resolve(pos2);
  if (!slice2.content.size)
    return pos2;
  let content2 = slice2.content;
  for (let i2 = 0; i2 < slice2.openStart; i2++)
    content2 = content2.firstChild.content;
  for (let pass = 1; pass <= (slice2.openStart == 0 && slice2.size ? 2 : 1); pass++) {
    for (let d = $pos.depth; d >= 0; d--) {
      let bias = d == $pos.depth ? 0 : $pos.pos <= ($pos.start(d + 1) + $pos.end(d + 1)) / 2 ? -1 : 1;
      let insertPos = $pos.index(d) + (bias > 0 ? 1 : 0);
      let parent = $pos.node(d), fits = false;
      if (pass == 1) {
        fits = parent.canReplace(insertPos, insertPos, content2);
      } else {
        let wrapping = parent.contentMatchAt(insertPos).findWrapping(content2.firstChild.type);
        fits = wrapping && parent.canReplaceWith(insertPos, insertPos, wrapping[0]);
      }
      if (fits)
        return bias == 0 ? $pos.pos : bias < 0 ? $pos.before(d + 1) : $pos.after(d + 1);
    }
  }
  return null;
}
__name(dropPoint, "dropPoint");
function replaceStep(doc2, from2, to = from2, slice2 = Slice.empty) {
  if (from2 == to && !slice2.size)
    return null;
  let $from = doc2.resolve(from2), $to = doc2.resolve(to);
  if (fitsTrivially($from, $to, slice2))
    return new ReplaceStep(from2, to, slice2);
  return new Fitter($from, $to, slice2).fit();
}
__name(replaceStep, "replaceStep");
function fitsTrivially($from, $to, slice2) {
  return !slice2.openStart && !slice2.openEnd && $from.start() == $to.start() && $from.parent.canReplace($from.index(), $to.index(), slice2.content);
}
__name(fitsTrivially, "fitsTrivially");
class Fitter {
  static {
    __name(this, "Fitter");
  }
  constructor($from, $to, unplaced) {
    this.$from = $from;
    this.$to = $to;
    this.unplaced = unplaced;
    this.frontier = [];
    this.placed = Fragment.empty;
    for (let i2 = 0; i2 <= $from.depth; i2++) {
      let node3 = $from.node(i2);
      this.frontier.push({
        type: node3.type,
        match: node3.contentMatchAt($from.indexAfter(i2))
      });
    }
    for (let i2 = $from.depth; i2 > 0; i2--)
      this.placed = Fragment.from($from.node(i2).copy(this.placed));
  }
  get depth() {
    return this.frontier.length - 1;
  }
  fit() {
    while (this.unplaced.size) {
      let fit = this.findFittable();
      if (fit)
        this.placeNodes(fit);
      else
        this.openMore() || this.dropNode();
    }
    let moveInline = this.mustMoveInline(), placedSize = this.placed.size - this.depth - this.$from.depth;
    let $from = this.$from, $to = this.close(moveInline < 0 ? this.$to : $from.doc.resolve(moveInline));
    if (!$to)
      return null;
    let content2 = this.placed, openStart = $from.depth, openEnd = $to.depth;
    while (openStart && openEnd && content2.childCount == 1) {
      content2 = content2.firstChild.content;
      openStart--;
      openEnd--;
    }
    let slice2 = new Slice(content2, openStart, openEnd);
    if (moveInline > -1)
      return new ReplaceAroundStep($from.pos, moveInline, this.$to.pos, this.$to.end(), slice2, placedSize);
    if (slice2.size || $from.pos != this.$to.pos)
      return new ReplaceStep($from.pos, $to.pos, slice2);
    return null;
  }
  // Find a position on the start spine of `this.unplaced` that has
  // content that can be moved somewhere on the frontier. Returns two
  // depths, one for the slice and one for the frontier.
  findFittable() {
    let startDepth = this.unplaced.openStart;
    for (let cur = this.unplaced.content, d = 0, openEnd = this.unplaced.openEnd; d < startDepth; d++) {
      let node3 = cur.firstChild;
      if (cur.childCount > 1)
        openEnd = 0;
      if (node3.type.spec.isolating && openEnd <= d) {
        startDepth = d;
        break;
      }
      cur = node3.content;
    }
    for (let pass = 1; pass <= 2; pass++) {
      for (let sliceDepth = pass == 1 ? startDepth : this.unplaced.openStart; sliceDepth >= 0; sliceDepth--) {
        let fragment, parent = null;
        if (sliceDepth) {
          parent = contentAt(this.unplaced.content, sliceDepth - 1).firstChild;
          fragment = parent.content;
        } else {
          fragment = this.unplaced.content;
        }
        let first2 = fragment.firstChild;
        for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
          let { type, match: match2 } = this.frontier[frontierDepth], wrap2, inject2 = null;
          if (pass == 1 && (first2 ? match2.matchType(first2.type) || (inject2 = match2.fillBefore(Fragment.from(first2), false)) : parent && type.compatibleContent(parent.type)))
            return { sliceDepth, frontierDepth, parent, inject: inject2 };
          else if (pass == 2 && first2 && (wrap2 = match2.findWrapping(first2.type)))
            return { sliceDepth, frontierDepth, parent, wrap: wrap2 };
          if (parent && match2.matchType(parent.type))
            break;
        }
      }
    }
  }
  openMore() {
    let { content: content2, openStart, openEnd } = this.unplaced;
    let inner = contentAt(content2, openStart);
    if (!inner.childCount || inner.firstChild.isLeaf)
      return false;
    this.unplaced = new Slice(content2, openStart + 1, Math.max(openEnd, inner.size + openStart >= content2.size - openEnd ? openStart + 1 : 0));
    return true;
  }
  dropNode() {
    let { content: content2, openStart, openEnd } = this.unplaced;
    let inner = contentAt(content2, openStart);
    if (inner.childCount <= 1 && openStart > 0) {
      let openAtEnd = content2.size - openStart <= openStart + inner.size;
      this.unplaced = new Slice(dropFromFragment(content2, openStart - 1, 1), openStart - 1, openAtEnd ? openStart - 1 : openEnd);
    } else {
      this.unplaced = new Slice(dropFromFragment(content2, openStart, 1), openStart, openEnd);
    }
  }
  // Move content from the unplaced slice at `sliceDepth` to the
  // frontier node at `frontierDepth`. Close that frontier node when
  // applicable.
  placeNodes({ sliceDepth, frontierDepth, parent, inject: inject2, wrap: wrap2 }) {
    while (this.depth > frontierDepth)
      this.closeFrontierNode();
    if (wrap2)
      for (let i2 = 0; i2 < wrap2.length; i2++)
        this.openFrontierNode(wrap2[i2]);
    let slice2 = this.unplaced, fragment = parent ? parent.content : slice2.content;
    let openStart = slice2.openStart - sliceDepth;
    let taken = 0, add3 = [];
    let { match: match2, type } = this.frontier[frontierDepth];
    if (inject2) {
      for (let i2 = 0; i2 < inject2.childCount; i2++)
        add3.push(inject2.child(i2));
      match2 = match2.matchFragment(inject2);
    }
    let openEndCount = fragment.size + sliceDepth - (slice2.content.size - slice2.openEnd);
    while (taken < fragment.childCount) {
      let next2 = fragment.child(taken), matches2 = match2.matchType(next2.type);
      if (!matches2)
        break;
      taken++;
      if (taken > 1 || openStart == 0 || next2.content.size) {
        match2 = matches2;
        add3.push(closeNodeStart(next2.mark(type.allowedMarks(next2.marks)), taken == 1 ? openStart : 0, taken == fragment.childCount ? openEndCount : -1));
      }
    }
    let toEnd = taken == fragment.childCount;
    if (!toEnd)
      openEndCount = -1;
    this.placed = addToFragment(this.placed, frontierDepth, Fragment.from(add3));
    this.frontier[frontierDepth].match = match2;
    if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
      this.closeFrontierNode();
    for (let i2 = 0, cur = fragment; i2 < openEndCount; i2++) {
      let node3 = cur.lastChild;
      this.frontier.push({ type: node3.type, match: node3.contentMatchAt(node3.childCount) });
      cur = node3.content;
    }
    this.unplaced = !toEnd ? new Slice(dropFromFragment(slice2.content, sliceDepth, taken), slice2.openStart, slice2.openEnd) : sliceDepth == 0 ? Slice.empty : new Slice(dropFromFragment(slice2.content, sliceDepth - 1, 1), sliceDepth - 1, openEndCount < 0 ? slice2.openEnd : sliceDepth - 1);
  }
  mustMoveInline() {
    if (!this.$to.parent.isTextblock)
      return -1;
    let top = this.frontier[this.depth], level;
    if (!top.type.isTextblock || !contentAfterFits(this.$to, this.$to.depth, top.type, top.match, false) || this.$to.depth == this.depth && (level = this.findCloseLevel(this.$to)) && level.depth == this.depth)
      return -1;
    let { depth } = this.$to, after = this.$to.after(depth);
    while (depth > 1 && after == this.$to.end(--depth))
      ++after;
    return after;
  }
  findCloseLevel($to) {
    scan: for (let i2 = Math.min(this.depth, $to.depth); i2 >= 0; i2--) {
      let { match: match2, type } = this.frontier[i2];
      let dropInner = i2 < $to.depth && $to.end(i2 + 1) == $to.pos + ($to.depth - (i2 + 1));
      let fit = contentAfterFits($to, i2, type, match2, dropInner);
      if (!fit)
        continue;
      for (let d = i2 - 1; d >= 0; d--) {
        let { match: match3, type: type2 } = this.frontier[d];
        let matches2 = contentAfterFits($to, d, type2, match3, true);
        if (!matches2 || matches2.childCount)
          continue scan;
      }
      return { depth: i2, fit, move: dropInner ? $to.doc.resolve($to.after(i2 + 1)) : $to };
    }
  }
  close($to) {
    let close5 = this.findCloseLevel($to);
    if (!close5)
      return null;
    while (this.depth > close5.depth)
      this.closeFrontierNode();
    if (close5.fit.childCount)
      this.placed = addToFragment(this.placed, close5.depth, close5.fit);
    $to = close5.move;
    for (let d = close5.depth + 1; d <= $to.depth; d++) {
      let node3 = $to.node(d), add3 = node3.type.contentMatch.fillBefore(node3.content, true, $to.index(d));
      this.openFrontierNode(node3.type, node3.attrs, add3);
    }
    return $to;
  }
  openFrontierNode(type, attrs4 = null, content2) {
    let top = this.frontier[this.depth];
    top.match = top.match.matchType(type);
    this.placed = addToFragment(this.placed, this.depth, Fragment.from(type.create(attrs4, content2)));
    this.frontier.push({ type, match: type.contentMatch });
  }
  closeFrontierNode() {
    let open2 = this.frontier.pop();
    let add3 = open2.match.fillBefore(Fragment.empty, true);
    if (add3.childCount)
      this.placed = addToFragment(this.placed, this.frontier.length, add3);
  }
}
function dropFromFragment(fragment, depth, count) {
  if (depth == 0)
    return fragment.cutByIndex(count, fragment.childCount);
  return fragment.replaceChild(0, fragment.firstChild.copy(dropFromFragment(fragment.firstChild.content, depth - 1, count)));
}
__name(dropFromFragment, "dropFromFragment");
function addToFragment(fragment, depth, content2) {
  if (depth == 0)
    return fragment.append(content2);
  return fragment.replaceChild(fragment.childCount - 1, fragment.lastChild.copy(addToFragment(fragment.lastChild.content, depth - 1, content2)));
}
__name(addToFragment, "addToFragment");
function contentAt(fragment, depth) {
  for (let i2 = 0; i2 < depth; i2++)
    fragment = fragment.firstChild.content;
  return fragment;
}
__name(contentAt, "contentAt");
function closeNodeStart(node3, openStart, openEnd) {
  if (openStart <= 0)
    return node3;
  let frag = node3.content;
  if (openStart > 1)
    frag = frag.replaceChild(0, closeNodeStart(frag.firstChild, openStart - 1, frag.childCount == 1 ? openEnd - 1 : 0));
  if (openStart > 0) {
    frag = node3.type.contentMatch.fillBefore(frag).append(frag);
    if (openEnd <= 0)
      frag = frag.append(node3.type.contentMatch.matchFragment(frag).fillBefore(Fragment.empty, true));
  }
  return node3.copy(frag);
}
__name(closeNodeStart, "closeNodeStart");
function contentAfterFits($to, depth, type, match2, open2) {
  let node3 = $to.node(depth), index2 = open2 ? $to.indexAfter(depth) : $to.index(depth);
  if (index2 == node3.childCount && !type.compatibleContent(node3.type))
    return null;
  let fit = match2.fillBefore(node3.content, true, index2);
  return fit && !invalidMarks(type, node3.content, index2) ? fit : null;
}
__name(contentAfterFits, "contentAfterFits");
function invalidMarks(type, fragment, start2) {
  for (let i2 = start2; i2 < fragment.childCount; i2++)
    if (!type.allowsMarks(fragment.child(i2).marks))
      return true;
  return false;
}
__name(invalidMarks, "invalidMarks");
function definesContent(type) {
  return type.spec.defining || type.spec.definingForContent;
}
__name(definesContent, "definesContent");
function replaceRange(tr2, from2, to, slice2) {
  if (!slice2.size)
    return tr2.deleteRange(from2, to);
  let $from = tr2.doc.resolve(from2), $to = tr2.doc.resolve(to);
  if (fitsTrivially($from, $to, slice2))
    return tr2.step(new ReplaceStep(from2, to, slice2));
  let targetDepths = coveredDepths($from, tr2.doc.resolve(to));
  if (targetDepths[targetDepths.length - 1] == 0)
    targetDepths.pop();
  let preferredTarget = -($from.depth + 1);
  targetDepths.unshift(preferredTarget);
  for (let d = $from.depth, pos2 = $from.pos - 1; d > 0; d--, pos2--) {
    let spec = $from.node(d).type.spec;
    if (spec.defining || spec.definingAsContext || spec.isolating)
      break;
    if (targetDepths.indexOf(d) > -1)
      preferredTarget = d;
    else if ($from.before(d) == pos2)
      targetDepths.splice(1, 0, -d);
  }
  let preferredTargetIndex = targetDepths.indexOf(preferredTarget);
  let leftNodes = [], preferredDepth = slice2.openStart;
  for (let content2 = slice2.content, i2 = 0; ; i2++) {
    let node3 = content2.firstChild;
    leftNodes.push(node3);
    if (i2 == slice2.openStart)
      break;
    content2 = node3.content;
  }
  for (let d = preferredDepth - 1; d >= 0; d--) {
    let leftNode = leftNodes[d], def2 = definesContent(leftNode.type);
    if (def2 && !leftNode.sameMarkup($from.node(Math.abs(preferredTarget) - 1)))
      preferredDepth = d;
    else if (def2 || !leftNode.type.isTextblock)
      break;
  }
  for (let j = slice2.openStart; j >= 0; j--) {
    let openDepth = (j + preferredDepth + 1) % (slice2.openStart + 1);
    let insert2 = leftNodes[openDepth];
    if (!insert2)
      continue;
    for (let i2 = 0; i2 < targetDepths.length; i2++) {
      let targetDepth = targetDepths[(i2 + preferredTargetIndex) % targetDepths.length], expand = true;
      if (targetDepth < 0) {
        expand = false;
        targetDepth = -targetDepth;
      }
      let parent = $from.node(targetDepth - 1), index2 = $from.index(targetDepth - 1);
      if (parent.canReplaceWith(index2, index2, insert2.type, insert2.marks))
        return tr2.replace($from.before(targetDepth), expand ? $to.after(targetDepth) : to, new Slice(closeFragment(slice2.content, 0, slice2.openStart, openDepth), openDepth, slice2.openEnd));
    }
  }
  let startSteps = tr2.steps.length;
  for (let i2 = targetDepths.length - 1; i2 >= 0; i2--) {
    tr2.replace(from2, to, slice2);
    if (tr2.steps.length > startSteps)
      break;
    let depth = targetDepths[i2];
    if (depth < 0)
      continue;
    from2 = $from.before(depth);
    to = $to.after(depth);
  }
}
__name(replaceRange, "replaceRange");
function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
  if (depth < oldOpen) {
    let first2 = fragment.firstChild;
    fragment = fragment.replaceChild(0, first2.copy(closeFragment(first2.content, depth + 1, oldOpen, newOpen, first2)));
  }
  if (depth > newOpen) {
    let match2 = parent.contentMatchAt(0);
    let start2 = match2.fillBefore(fragment).append(fragment);
    fragment = start2.append(match2.matchFragment(start2).fillBefore(Fragment.empty, true));
  }
  return fragment;
}
__name(closeFragment, "closeFragment");
function replaceRangeWith(tr2, from2, to, node3) {
  if (!node3.isInline && from2 == to && tr2.doc.resolve(from2).parent.content.size) {
    let point = insertPoint(tr2.doc, from2, node3.type);
    if (point != null)
      from2 = to = point;
  }
  tr2.replaceRange(from2, to, new Slice(Fragment.from(node3), 0, 0));
}
__name(replaceRangeWith, "replaceRangeWith");
function deleteRange$1(tr2, from2, to) {
  let $from = tr2.doc.resolve(from2), $to = tr2.doc.resolve(to);
  let covered = coveredDepths($from, $to);
  for (let i2 = 0; i2 < covered.length; i2++) {
    let depth = covered[i2], last = i2 == covered.length - 1;
    if (last && depth == 0 || $from.node(depth).type.contentMatch.validEnd)
      return tr2.delete($from.start(depth), $to.end(depth));
    if (depth > 0 && (last || $from.node(depth - 1).canReplace($from.index(depth - 1), $to.indexAfter(depth - 1))))
      return tr2.delete($from.before(depth), $to.after(depth));
  }
  for (let d = 1; d <= $from.depth && d <= $to.depth; d++) {
    if (from2 - $from.start(d) == $from.depth - d && to > $from.end(d) && $to.end(d) - to != $to.depth - d && $from.start(d - 1) == $to.start(d - 1) && $from.node(d - 1).canReplace($from.index(d - 1), $to.index(d - 1)))
      return tr2.delete($from.before(d), to);
  }
  tr2.delete(from2, to);
}
__name(deleteRange$1, "deleteRange$1");
function coveredDepths($from, $to) {
  let result = [], minDepth = Math.min($from.depth, $to.depth);
  for (let d = minDepth; d >= 0; d--) {
    let start2 = $from.start(d);
    if (start2 < $from.pos - ($from.depth - d) || $to.end(d) > $to.pos + ($to.depth - d) || $from.node(d).type.spec.isolating || $to.node(d).type.spec.isolating)
      break;
    if (start2 == $to.start(d) || d == $from.depth && d == $to.depth && $from.parent.inlineContent && $to.parent.inlineContent && d && $to.start(d - 1) == start2 - 1)
      result.push(d);
  }
  return result;
}
__name(coveredDepths, "coveredDepths");
class AttrStep extends Step {
  static {
    __name(this, "AttrStep");
  }
  /**
  Construct an attribute step.
  */
  constructor(pos2, attr, value4) {
    super();
    this.pos = pos2;
    this.attr = attr;
    this.value = value4;
  }
  apply(doc2) {
    let node3 = doc2.nodeAt(this.pos);
    if (!node3)
      return StepResult.fail("No node at attribute step's position");
    let attrs4 = /* @__PURE__ */ Object.create(null);
    for (let name2 in node3.attrs)
      attrs4[name2] = node3.attrs[name2];
    attrs4[this.attr] = this.value;
    let updated13 = node3.type.create(attrs4, null, node3.marks);
    return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(Fragment.from(updated13), 0, node3.isLeaf ? 0 : 1));
  }
  getMap() {
    return StepMap.empty;
  }
  invert(doc2) {
    return new AttrStep(this.pos, this.attr, doc2.nodeAt(this.pos).attrs[this.attr]);
  }
  map(mapping) {
    let pos2 = mapping.mapResult(this.pos, 1);
    return pos2.deletedAfter ? null : new AttrStep(pos2.pos, this.attr, this.value);
  }
  toJSON() {
    return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
  }
  static fromJSON(schema2, json) {
    if (typeof json.pos != "number" || typeof json.attr != "string")
      throw new RangeError("Invalid input for AttrStep.fromJSON");
    return new AttrStep(json.pos, json.attr, json.value);
  }
}
Step.jsonID("attr", AttrStep);
class DocAttrStep extends Step {
  static {
    __name(this, "DocAttrStep");
  }
  /**
  Construct an attribute step.
  */
  constructor(attr, value4) {
    super();
    this.attr = attr;
    this.value = value4;
  }
  apply(doc2) {
    let attrs4 = /* @__PURE__ */ Object.create(null);
    for (let name2 in doc2.attrs)
      attrs4[name2] = doc2.attrs[name2];
    attrs4[this.attr] = this.value;
    let updated13 = doc2.type.create(attrs4, doc2.content, doc2.marks);
    return StepResult.ok(updated13);
  }
  getMap() {
    return StepMap.empty;
  }
  invert(doc2) {
    return new DocAttrStep(this.attr, doc2.attrs[this.attr]);
  }
  map(mapping) {
    return this;
  }
  toJSON() {
    return { stepType: "docAttr", attr: this.attr, value: this.value };
  }
  static fromJSON(schema2, json) {
    if (typeof json.attr != "string")
      throw new RangeError("Invalid input for DocAttrStep.fromJSON");
    return new DocAttrStep(json.attr, json.value);
  }
}
Step.jsonID("docAttr", DocAttrStep);
let TransformError = class extends Error {
  static {
    __name(this, "TransformError");
  }
};
TransformError = /* @__PURE__ */ __name(function TransformError2(message3) {
  let err = Error.call(this, message3);
  err.__proto__ = TransformError2.prototype;
  return err;
}, "TransformError");
TransformError.prototype = Object.create(Error.prototype);
TransformError.prototype.constructor = TransformError;
TransformError.prototype.name = "TransformError";
class Transform {
  static {
    __name(this, "Transform");
  }
  /**
  Create a transform that starts with the given document.
  */
  constructor(doc2) {
    this.doc = doc2;
    this.steps = [];
    this.docs = [];
    this.mapping = new Mapping();
  }
  /**
  The starting document.
  */
  get before() {
    return this.docs.length ? this.docs[0] : this.doc;
  }
  /**
  Apply a new step in this transform, saving the result. Throws an
  error when the step fails.
  */
  step(step3) {
    let result = this.maybeStep(step3);
    if (result.failed)
      throw new TransformError(result.failed);
    return this;
  }
  /**
  Try to apply a step in this transformation, ignoring it if it
  fails. Returns the step result.
  */
  maybeStep(step3) {
    let result = step3.apply(this.doc);
    if (!result.failed)
      this.addStep(step3, result.doc);
    return result;
  }
  /**
  True when the document has been changed (when there are any
  steps).
  */
  get docChanged() {
    return this.steps.length > 0;
  }
  /**
  @internal
  */
  addStep(step3, doc2) {
    this.docs.push(this.doc);
    this.steps.push(step3);
    this.mapping.appendMap(step3.getMap());
    this.doc = doc2;
  }
  /**
  Replace the part of the document between `from` and `to` with the
  given `slice`.
  */
  replace(from2, to = from2, slice2 = Slice.empty) {
    let step3 = replaceStep(this.doc, from2, to, slice2);
    if (step3)
      this.step(step3);
    return this;
  }
  /**
  Replace the given range with the given content, which may be a
  fragment, node, or array of nodes.
  */
  replaceWith(from2, to, content2) {
    return this.replace(from2, to, new Slice(Fragment.from(content2), 0, 0));
  }
  /**
  Delete the content between the given positions.
  */
  delete(from2, to) {
    return this.replace(from2, to, Slice.empty);
  }
  /**
  Insert the given content at the given position.
  */
  insert(pos2, content2) {
    return this.replaceWith(pos2, pos2, content2);
  }
  /**
  Replace a range of the document with a given slice, using
  `from`, `to`, and the slice's
  [`openStart`](https://prosemirror.net/docs/ref/#model.Slice.openStart) property as hints, rather
  than fixed start and end points. This method may grow the
  replaced area or close open nodes in the slice in order to get a
  fit that is more in line with WYSIWYG expectations, by dropping
  fully covered parent nodes of the replaced region when they are
  marked [non-defining as
  context](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext), or including an
  open parent node from the slice that _is_ marked as [defining
  its content](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).
  
  This is the method, for example, to handle paste. The similar
  [`replace`](https://prosemirror.net/docs/ref/#transform.Transform.replace) method is a more
  primitive tool which will _not_ move the start and end of its given
  range, and is useful in situations where you need more precise
  control over what happens.
  */
  replaceRange(from2, to, slice2) {
    replaceRange(this, from2, to, slice2);
    return this;
  }
  /**
  Replace the given range with a node, but use `from` and `to` as
  hints, rather than precise positions. When from and to are the same
  and are at the start or end of a parent node in which the given
  node doesn't fit, this method may _move_ them out towards a parent
  that does allow the given node to be placed. When the given range
  completely covers a parent node, this method may completely replace
  that parent node.
  */
  replaceRangeWith(from2, to, node3) {
    replaceRangeWith(this, from2, to, node3);
    return this;
  }
  /**
  Delete the given range, expanding it to cover fully covered
  parent nodes until a valid replace is found.
  */
  deleteRange(from2, to) {
    deleteRange$1(this, from2, to);
    return this;
  }
  /**
  Split the content in the given range off from its parent, if there
  is sibling content before or after it, and move it up the tree to
  the depth specified by `target`. You'll probably want to use
  [`liftTarget`](https://prosemirror.net/docs/ref/#transform.liftTarget) to compute `target`, to make
  sure the lift is valid.
  */
  lift(range2, target) {
    lift$2(this, range2, target);
    return this;
  }
  /**
  Join the blocks around the given position. If depth is 2, their
  last and first siblings are also joined, and so on.
  */
  join(pos2, depth = 1) {
    join(this, pos2, depth);
    return this;
  }
  /**
  Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
  The wrappers are assumed to be valid in this position, and should
  probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
  */
  wrap(range2, wrappers) {
    wrap(this, range2, wrappers);
    return this;
  }
  /**
  Set the type of all textblocks (partly) between `from` and `to` to
  the given node type with the given attributes.
  */
  setBlockType(from2, to = from2, type, attrs4 = null) {
    setBlockType$1(this, from2, to, type, attrs4);
    return this;
  }
  /**
  Change the type, attributes, and/or marks of the node at `pos`.
  When `type` isn't given, the existing node type is preserved,
  */
  setNodeMarkup(pos2, type, attrs4 = null, marks) {
    setNodeMarkup(this, pos2, type, attrs4, marks);
    return this;
  }
  /**
  Set a single attribute on a given node to a new value.
  The `pos` addresses the document content. Use `setDocAttribute`
  to set attributes on the document itself.
  */
  setNodeAttribute(pos2, attr, value4) {
    this.step(new AttrStep(pos2, attr, value4));
    return this;
  }
  /**
  Set a single attribute on the document to a new value.
  */
  setDocAttribute(attr, value4) {
    this.step(new DocAttrStep(attr, value4));
    return this;
  }
  /**
  Add a mark to the node at position `pos`.
  */
  addNodeMark(pos2, mark2) {
    this.step(new AddNodeMarkStep(pos2, mark2));
    return this;
  }
  /**
  Remove a mark (or a mark of the given type) from the node at
  position `pos`.
  */
  removeNodeMark(pos2, mark2) {
    if (!(mark2 instanceof Mark$1)) {
      let node3 = this.doc.nodeAt(pos2);
      if (!node3)
        throw new RangeError("No node at position " + pos2);
      mark2 = mark2.isInSet(node3.marks);
      if (!mark2)
        return this;
    }
    this.step(new RemoveNodeMarkStep(pos2, mark2));
    return this;
  }
  /**
  Split the node at the given position, and optionally, if `depth` is
  greater than one, any number of nodes above that. By default, the
  parts split off will inherit the node type of the original node.
  This can be changed by passing an array of types and attributes to
  use after the split.
  */
  split(pos2, depth = 1, typesAfter) {
    split(this, pos2, depth, typesAfter);
    return this;
  }
  /**
  Add the given mark to the inline content between `from` and `to`.
  */
  addMark(from2, to, mark2) {
    addMark(this, from2, to, mark2);
    return this;
  }
  /**
  Remove marks from inline nodes between `from` and `to`. When
  `mark` is a single mark, remove precisely that mark. When it is
  a mark type, remove all marks of that type. When it is null,
  remove all marks of any type.
  */
  removeMark(from2, to, mark2) {
    removeMark(this, from2, to, mark2);
    return this;
  }
  /**
  Removes all marks and nodes from the content of the node at
  `pos` that don't match the given new parent node type. Accepts
  an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as
  third argument.
  */
  clearIncompatible(pos2, parentType, match2) {
    clearIncompatible(this, pos2, parentType, match2);
    return this;
  }
}
const classesById = /* @__PURE__ */ Object.create(null);
class Selection {
  static {
    __name(this, "Selection");
  }
  /**
  Initialize a selection with the head and anchor and ranges. If no
  ranges are given, constructs a single range across `$anchor` and
  `$head`.
  */
  constructor($anchor, $head, ranges) {
    this.$anchor = $anchor;
    this.$head = $head;
    this.ranges = ranges || [new SelectionRange($anchor.min($head), $anchor.max($head))];
  }
  /**
  The selection's anchor, as an unresolved position.
  */
  get anchor() {
    return this.$anchor.pos;
  }
  /**
  The selection's head.
  */
  get head() {
    return this.$head.pos;
  }
  /**
  The lower bound of the selection's main range.
  */
  get from() {
    return this.$from.pos;
  }
  /**
  The upper bound of the selection's main range.
  */
  get to() {
    return this.$to.pos;
  }
  /**
  The resolved lower  bound of the selection's main range.
  */
  get $from() {
    return this.ranges[0].$from;
  }
  /**
  The resolved upper bound of the selection's main range.
  */
  get $to() {
    return this.ranges[0].$to;
  }
  /**
  Indicates whether the selection contains any content.
  */
  get empty() {
    let ranges = this.ranges;
    for (let i2 = 0; i2 < ranges.length; i2++)
      if (ranges[i2].$from.pos != ranges[i2].$to.pos)
        return false;
    return true;
  }
  /**
  Get the content of this selection as a slice.
  */
  content() {
    return this.$from.doc.slice(this.from, this.to, true);
  }
  /**
  Replace the selection with a slice or, if no slice is given,
  delete the selection. Will append to the given transaction.
  */
  replace(tr2, content2 = Slice.empty) {
    let lastNode = content2.content.lastChild, lastParent = null;
    for (let i2 = 0; i2 < content2.openEnd; i2++) {
      lastParent = lastNode;
      lastNode = lastNode.lastChild;
    }
    let mapFrom = tr2.steps.length, ranges = this.ranges;
    for (let i2 = 0; i2 < ranges.length; i2++) {
      let { $from, $to } = ranges[i2], mapping = tr2.mapping.slice(mapFrom);
      tr2.replaceRange(mapping.map($from.pos), mapping.map($to.pos), i2 ? Slice.empty : content2);
      if (i2 == 0)
        selectionToInsertionEnd$1(tr2, mapFrom, (lastNode ? lastNode.isInline : lastParent && lastParent.isTextblock) ? -1 : 1);
    }
  }
  /**
  Replace the selection with the given node, appending the changes
  to the given transaction.
  */
  replaceWith(tr2, node3) {
    let mapFrom = tr2.steps.length, ranges = this.ranges;
    for (let i2 = 0; i2 < ranges.length; i2++) {
      let { $from, $to } = ranges[i2], mapping = tr2.mapping.slice(mapFrom);
      let from2 = mapping.map($from.pos), to = mapping.map($to.pos);
      if (i2) {
        tr2.deleteRange(from2, to);
      } else {
        tr2.replaceRangeWith(from2, to, node3);
        selectionToInsertionEnd$1(tr2, mapFrom, node3.isInline ? -1 : 1);
      }
    }
  }
  /**
  Find a valid cursor or leaf node selection starting at the given
  position and searching back if `dir` is negative, and forward if
  positive. When `textOnly` is true, only consider cursor
  selections. Will return null when no valid selection position is
  found.
  */
  static findFrom($pos, dir, textOnly = false) {
    let inner = $pos.parent.inlineContent ? new TextSelection($pos) : findSelectionIn($pos.node(0), $pos.parent, $pos.pos, $pos.index(), dir, textOnly);
    if (inner)
      return inner;
    for (let depth = $pos.depth - 1; depth >= 0; depth--) {
      let found2 = dir < 0 ? findSelectionIn($pos.node(0), $pos.node(depth), $pos.before(depth + 1), $pos.index(depth), dir, textOnly) : findSelectionIn($pos.node(0), $pos.node(depth), $pos.after(depth + 1), $pos.index(depth) + 1, dir, textOnly);
      if (found2)
        return found2;
    }
    return null;
  }
  /**
  Find a valid cursor or leaf node selection near the given
  position. Searches forward first by default, but if `bias` is
  negative, it will search backwards first.
  */
  static near($pos, bias = 1) {
    return this.findFrom($pos, bias) || this.findFrom($pos, -bias) || new AllSelection($pos.node(0));
  }
  /**
  Find the cursor or leaf node selection closest to the start of
  the given document. Will return an
  [`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
  exists.
  */
  static atStart(doc2) {
    return findSelectionIn(doc2, doc2, 0, 0, 1) || new AllSelection(doc2);
  }
  /**
  Find the cursor or leaf node selection closest to the end of the
  given document.
  */
  static atEnd(doc2) {
    return findSelectionIn(doc2, doc2, doc2.content.size, doc2.childCount, -1) || new AllSelection(doc2);
  }
  /**
  Deserialize the JSON representation of a selection. Must be
  implemented for custom classes (as a static class method).
  */
  static fromJSON(doc2, json) {
    if (!json || !json.type)
      throw new RangeError("Invalid input for Selection.fromJSON");
    let cls = classesById[json.type];
    if (!cls)
      throw new RangeError(`No selection type ${json.type} defined`);
    return cls.fromJSON(doc2, json);
  }
  /**
  To be able to deserialize selections from JSON, custom selection
  classes must register themselves with an ID string, so that they
  can be disambiguated. Try to pick something that's unlikely to
  clash with classes from other modules.
  */
  static jsonID(id3, selectionClass) {
    if (id3 in classesById)
      throw new RangeError("Duplicate use of selection JSON ID " + id3);
    classesById[id3] = selectionClass;
    selectionClass.prototype.jsonID = id3;
    return selectionClass;
  }
  /**
  Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
  which is a value that can be mapped without having access to a
  current document, and later resolved to a real selection for a
  given document again. (This is used mostly by the history to
  track and restore old selections.) The default implementation of
  this method just converts the selection to a text selection and
  returns the bookmark for that.
  */
  getBookmark() {
    return TextSelection.between(this.$anchor, this.$head).getBookmark();
  }
}
Selection.prototype.visible = true;
class SelectionRange {
  static {
    __name(this, "SelectionRange");
  }
  /**
  Create a range.
  */
  constructor($from, $to) {
    this.$from = $from;
    this.$to = $to;
  }
}
let warnedAboutTextSelection = false;
function checkTextSelection($pos) {
  if (!warnedAboutTextSelection && !$pos.parent.inlineContent) {
    warnedAboutTextSelection = true;
    console["warn"]("TextSelection endpoint not pointing into a node with inline content (" + $pos.parent.type.name + ")");
  }
}
__name(checkTextSelection, "checkTextSelection");
class TextSelection extends Selection {
  static {
    __name(this, "TextSelection");
  }
  /**
  Construct a text selection between the given points.
  */
  constructor($anchor, $head = $anchor) {
    checkTextSelection($anchor);
    checkTextSelection($head);
    super($anchor, $head);
  }
  /**
  Returns a resolved position if this is a cursor selection (an
  empty text selection), and null otherwise.
  */
  get $cursor() {
    return this.$anchor.pos == this.$head.pos ? this.$head : null;
  }
  map(doc2, mapping) {
    let $head = doc2.resolve(mapping.map(this.head));
    if (!$head.parent.inlineContent)
      return Selection.near($head);
    let $anchor = doc2.resolve(mapping.map(this.anchor));
    return new TextSelection($anchor.parent.inlineContent ? $anchor : $head, $head);
  }
  replace(tr2, content2 = Slice.empty) {
    super.replace(tr2, content2);
    if (content2 == Slice.empty) {
      let marks = this.$from.marksAcross(this.$to);
      if (marks)
        tr2.ensureMarks(marks);
    }
  }
  eq(other) {
    return other instanceof TextSelection && other.anchor == this.anchor && other.head == this.head;
  }
  getBookmark() {
    return new TextBookmark(this.anchor, this.head);
  }
  toJSON() {
    return { type: "text", anchor: this.anchor, head: this.head };
  }
  /**
  @internal
  */
  static fromJSON(doc2, json) {
    if (typeof json.anchor != "number" || typeof json.head != "number")
      throw new RangeError("Invalid input for TextSelection.fromJSON");
    return new TextSelection(doc2.resolve(json.anchor), doc2.resolve(json.head));
  }
  /**
  Create a text selection from non-resolved positions.
  */
  static create(doc2, anchor, head = anchor) {
    let $anchor = doc2.resolve(anchor);
    return new this($anchor, head == anchor ? $anchor : doc2.resolve(head));
  }
  /**
  Return a text selection that spans the given positions or, if
  they aren't text positions, find a text selection near them.
  `bias` determines whether the method searches forward (default)
  or backwards (negative number) first. Will fall back to calling
  [`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document
  doesn't contain a valid text position.
  */
  static between($anchor, $head, bias) {
    let dPos = $anchor.pos - $head.pos;
    if (!bias || dPos)
      bias = dPos >= 0 ? 1 : -1;
    if (!$head.parent.inlineContent) {
      let found2 = Selection.findFrom($head, bias, true) || Selection.findFrom($head, -bias, true);
      if (found2)
        $head = found2.$head;
      else
        return Selection.near($head, bias);
    }
    if (!$anchor.parent.inlineContent) {
      if (dPos == 0) {
        $anchor = $head;
      } else {
        $anchor = (Selection.findFrom($anchor, -bias, true) || Selection.findFrom($anchor, bias, true)).$anchor;
        if ($anchor.pos < $head.pos != dPos < 0)
          $anchor = $head;
      }
    }
    return new TextSelection($anchor, $head);
  }
}
Selection.jsonID("text", TextSelection);
class TextBookmark {
  static {
    __name(this, "TextBookmark");
  }
  constructor(anchor, head) {
    this.anchor = anchor;
    this.head = head;
  }
  map(mapping) {
    return new TextBookmark(mapping.map(this.anchor), mapping.map(this.head));
  }
  resolve(doc2) {
    return TextSelection.between(doc2.resolve(this.anchor), doc2.resolve(this.head));
  }
}
class NodeSelection extends Selection {
  static {
    __name(this, "NodeSelection");
  }
  /**
  Create a node selection. Does not verify the validity of its
  argument.
  */
  constructor($pos) {
    let node3 = $pos.nodeAfter;
    let $end = $pos.node(0).resolve($pos.pos + node3.nodeSize);
    super($pos, $end);
    this.node = node3;
  }
  map(doc2, mapping) {
    let { deleted, pos: pos2 } = mapping.mapResult(this.anchor);
    let $pos = doc2.resolve(pos2);
    if (deleted)
      return Selection.near($pos);
    return new NodeSelection($pos);
  }
  content() {
    return new Slice(Fragment.from(this.node), 0, 0);
  }
  eq(other) {
    return other instanceof NodeSelection && other.anchor == this.anchor;
  }
  toJSON() {
    return { type: "node", anchor: this.anchor };
  }
  getBookmark() {
    return new NodeBookmark(this.anchor);
  }
  /**
  @internal
  */
  static fromJSON(doc2, json) {
    if (typeof json.anchor != "number")
      throw new RangeError("Invalid input for NodeSelection.fromJSON");
    return new NodeSelection(doc2.resolve(json.anchor));
  }
  /**
  Create a node selection from non-resolved positions.
  */
  static create(doc2, from2) {
    return new NodeSelection(doc2.resolve(from2));
  }
  /**
  Determines whether the given node may be selected as a node
  selection.
  */
  static isSelectable(node3) {
    return !node3.isText && node3.type.spec.selectable !== false;
  }
}
NodeSelection.prototype.visible = false;
Selection.jsonID("node", NodeSelection);
class NodeBookmark {
  static {
    __name(this, "NodeBookmark");
  }
  constructor(anchor) {
    this.anchor = anchor;
  }
  map(mapping) {
    let { deleted, pos: pos2 } = mapping.mapResult(this.anchor);
    return deleted ? new TextBookmark(pos2, pos2) : new NodeBookmark(pos2);
  }
  resolve(doc2) {
    let $pos = doc2.resolve(this.anchor), node3 = $pos.nodeAfter;
    if (node3 && NodeSelection.isSelectable(node3))
      return new NodeSelection($pos);
    return Selection.near($pos);
  }
}
class AllSelection extends Selection {
  static {
    __name(this, "AllSelection");
  }
  /**
  Create an all-selection over the given document.
  */
  constructor(doc2) {
    super(doc2.resolve(0), doc2.resolve(doc2.content.size));
  }
  replace(tr2, content2 = Slice.empty) {
    if (content2 == Slice.empty) {
      tr2.delete(0, tr2.doc.content.size);
      let sel = Selection.atStart(tr2.doc);
      if (!sel.eq(tr2.selection))
        tr2.setSelection(sel);
    } else {
      super.replace(tr2, content2);
    }
  }
  toJSON() {
    return { type: "all" };
  }
  /**
  @internal
  */
  static fromJSON(doc2) {
    return new AllSelection(doc2);
  }
  map(doc2) {
    return new AllSelection(doc2);
  }
  eq(other) {
    return other instanceof AllSelection;
  }
  getBookmark() {
    return AllBookmark;
  }
}
Selection.jsonID("all", AllSelection);
const AllBookmark = {
  map() {
    return this;
  },
  resolve(doc2) {
    return new AllSelection(doc2);
  }
};
function findSelectionIn(doc2, node3, pos2, index2, dir, text2 = false) {
  if (node3.inlineContent)
    return TextSelection.create(doc2, pos2);
  for (let i2 = index2 - (dir > 0 ? 0 : 1); dir > 0 ? i2 < node3.childCount : i2 >= 0; i2 += dir) {
    let child = node3.child(i2);
    if (!child.isAtom) {
      let inner = findSelectionIn(doc2, child, pos2 + dir, dir < 0 ? child.childCount : 0, dir, text2);
      if (inner)
        return inner;
    } else if (!text2 && NodeSelection.isSelectable(child)) {
      return NodeSelection.create(doc2, pos2 - (dir < 0 ? child.nodeSize : 0));
    }
    pos2 += child.nodeSize * dir;
  }
  return null;
}
__name(findSelectionIn, "findSelectionIn");
function selectionToInsertionEnd$1(tr2, startLen, bias) {
  let last = tr2.steps.length - 1;
  if (last < startLen)
    return;
  let step3 = tr2.steps[last];
  if (!(step3 instanceof ReplaceStep || step3 instanceof ReplaceAroundStep))
    return;
  let map3 = tr2.mapping.maps[last], end;
  map3.forEach((_from, _to, _newFrom, newTo) => {
    if (end == null)
      end = newTo;
  });
  tr2.setSelection(Selection.near(tr2.doc.resolve(end), bias));
}
__name(selectionToInsertionEnd$1, "selectionToInsertionEnd$1");
const UPDATED_SEL = 1, UPDATED_MARKS = 2, UPDATED_SCROLL = 4;
class Transaction extends Transform {
  static {
    __name(this, "Transaction");
  }
  /**
  @internal
  */
  constructor(state) {
    super(state.doc);
    this.curSelectionFor = 0;
    this.updated = 0;
    this.meta = /* @__PURE__ */ Object.create(null);
    this.time = Date.now();
    this.curSelection = state.selection;
    this.storedMarks = state.storedMarks;
  }
  /**
  The transaction's current selection. This defaults to the editor
  selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the
  transaction, but can be overwritten with
  [`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).
  */
  get selection() {
    if (this.curSelectionFor < this.steps.length) {
      this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor));
      this.curSelectionFor = this.steps.length;
    }
    return this.curSelection;
  }
  /**
  Update the transaction's current selection. Will determine the
  selection that the editor gets when the transaction is applied.
  */
  setSelection(selection) {
    if (selection.$from.doc != this.doc)
      throw new RangeError("Selection passed to setSelection must point at the current document");
    this.curSelection = selection;
    this.curSelectionFor = this.steps.length;
    this.updated = (this.updated | UPDATED_SEL) & ~UPDATED_MARKS;
    this.storedMarks = null;
    return this;
  }
  /**
  Whether the selection was explicitly updated by this transaction.
  */
  get selectionSet() {
    return (this.updated & UPDATED_SEL) > 0;
  }
  /**
  Set the current stored marks.
  */
  setStoredMarks(marks) {
    this.storedMarks = marks;
    this.updated |= UPDATED_MARKS;
    return this;
  }
  /**
  Make sure the current stored marks or, if that is null, the marks
  at the selection, match the given set of marks. Does nothing if
  this is already the case.
  */
  ensureMarks(marks) {
    if (!Mark$1.sameSet(this.storedMarks || this.selection.$from.marks(), marks))
      this.setStoredMarks(marks);
    return this;
  }
  /**
  Add a mark to the set of stored marks.
  */
  addStoredMark(mark2) {
    return this.ensureMarks(mark2.addToSet(this.storedMarks || this.selection.$head.marks()));
  }
  /**
  Remove a mark or mark type from the set of stored marks.
  */
  removeStoredMark(mark2) {
    return this.ensureMarks(mark2.removeFromSet(this.storedMarks || this.selection.$head.marks()));
  }
  /**
  Whether the stored marks were explicitly set for this transaction.
  */
  get storedMarksSet() {
    return (this.updated & UPDATED_MARKS) > 0;
  }
  /**
  @internal
  */
  addStep(step3, doc2) {
    super.addStep(step3, doc2);
    this.updated = this.updated & ~UPDATED_MARKS;
    this.storedMarks = null;
  }
  /**
  Update the timestamp for the transaction.
  */
  setTime(time) {
    this.time = time;
    return this;
  }
  /**
  Replace the current selection with the given slice.
  */
  replaceSelection(slice2) {
    this.selection.replace(this, slice2);
    return this;
  }
  /**
  Replace the selection with the given node. When `inheritMarks` is
  true and the content is inline, it inherits the marks from the
  place where it is inserted.
  */
  replaceSelectionWith(node3, inheritMarks = true) {
    let selection = this.selection;
    if (inheritMarks)
      node3 = node3.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : selection.$from.marksAcross(selection.$to) || Mark$1.none));
    selection.replaceWith(this, node3);
    return this;
  }
  /**
  Delete the selection.
  */
  deleteSelection() {
    this.selection.replace(this);
    return this;
  }
  /**
  Replace the given range, or the selection if no range is given,
  with a text node containing the given string.
  */
  insertText(text2, from2, to) {
    let schema2 = this.doc.type.schema;
    if (from2 == null) {
      if (!text2)
        return this.deleteSelection();
      return this.replaceSelectionWith(schema2.text(text2), true);
    } else {
      if (to == null)
        to = from2;
      to = to == null ? from2 : to;
      if (!text2)
        return this.deleteRange(from2, to);
      let marks = this.storedMarks;
      if (!marks) {
        let $from = this.doc.resolve(from2);
        marks = to == from2 ? $from.marks() : $from.marksAcross(this.doc.resolve(to));
      }
      this.replaceRangeWith(from2, to, schema2.text(text2, marks));
      if (!this.selection.empty)
        this.setSelection(Selection.near(this.selection.$to));
      return this;
    }
  }
  /**
  Store a metadata property in this transaction, keyed either by
  name or by plugin.
  */
  setMeta(key, value4) {
    this.meta[typeof key == "string" ? key : key.key] = value4;
    return this;
  }
  /**
  Retrieve a metadata property for a given name or plugin.
  */
  getMeta(key) {
    return this.meta[typeof key == "string" ? key : key.key];
  }
  /**
  Returns true if this transaction doesn't contain any metadata,
  and can thus safely be extended.
  */
  get isGeneric() {
    for (let _2 in this.meta)
      return false;
    return true;
  }
  /**
  Indicate that the editor should scroll the selection into view
  when updated to the state produced by this transaction.
  */
  scrollIntoView() {
    this.updated |= UPDATED_SCROLL;
    return this;
  }
  /**
  True when this transaction has had `scrollIntoView` called on it.
  */
  get scrolledIntoView() {
    return (this.updated & UPDATED_SCROLL) > 0;
  }
}
function bind$2(f, self2) {
  return !self2 || !f ? f : f.bind(self2);
}
__name(bind$2, "bind$2");
class FieldDesc {
  static {
    __name(this, "FieldDesc");
  }
  constructor(name2, desc, self2) {
    this.name = name2;
    this.init = bind$2(desc.init, self2);
    this.apply = bind$2(desc.apply, self2);
  }
}
const baseFields = [
  new FieldDesc("doc", {
    init(config2) {
      return config2.doc || config2.schema.topNodeType.createAndFill();
    },
    apply(tr2) {
      return tr2.doc;
    }
  }),
  new FieldDesc("selection", {
    init(config2, instance) {
      return config2.selection || Selection.atStart(instance.doc);
    },
    apply(tr2) {
      return tr2.selection;
    }
  }),
  new FieldDesc("storedMarks", {
    init(config2) {
      return config2.storedMarks || null;
    },
    apply(tr2, _marks, _old, state) {
      return state.selection.$cursor ? tr2.storedMarks : null;
    }
  }),
  new FieldDesc("scrollToSelection", {
    init() {
      return 0;
    },
    apply(tr2, prev2) {
      return tr2.scrolledIntoView ? prev2 + 1 : prev2;
    }
  })
];
class Configuration {
  static {
    __name(this, "Configuration");
  }
  constructor(schema2, plugins) {
    this.schema = schema2;
    this.plugins = [];
    this.pluginsByKey = /* @__PURE__ */ Object.create(null);
    this.fields = baseFields.slice();
    if (plugins)
      plugins.forEach((plugin) => {
        if (this.pluginsByKey[plugin.key])
          throw new RangeError("Adding different instances of a keyed plugin (" + plugin.key + ")");
        this.plugins.push(plugin);
        this.pluginsByKey[plugin.key] = plugin;
        if (plugin.spec.state)
          this.fields.push(new FieldDesc(plugin.key, plugin.spec.state, plugin));
      });
  }
}
class EditorState {
  static {
    __name(this, "EditorState");
  }
  /**
  @internal
  */
  constructor(config2) {
    this.config = config2;
  }
  /**
  The schema of the state's document.
  */
  get schema() {
    return this.config.schema;
  }
  /**
  The plugins that are active in this state.
  */
  get plugins() {
    return this.config.plugins;
  }
  /**
  Apply the given transaction to produce a new state.
  */
  apply(tr2) {
    return this.applyTransaction(tr2).state;
  }
  /**
  @internal
  */
  filterTransaction(tr2, ignore = -1) {
    for (let i2 = 0; i2 < this.config.plugins.length; i2++)
      if (i2 != ignore) {
        let plugin = this.config.plugins[i2];
        if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr2, this))
          return false;
      }
    return true;
  }
  /**
  Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that
  returns the precise transactions that were applied (which might
  be influenced by the [transaction
  hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of
  plugins) along with the new state.
  */
  applyTransaction(rootTr) {
    if (!this.filterTransaction(rootTr))
      return { state: this, transactions: [] };
    let trs = [rootTr], newState = this.applyInner(rootTr), seen2 = null;
    for (; ; ) {
      let haveNew = false;
      for (let i2 = 0; i2 < this.config.plugins.length; i2++) {
        let plugin = this.config.plugins[i2];
        if (plugin.spec.appendTransaction) {
          let n = seen2 ? seen2[i2].n : 0, oldState = seen2 ? seen2[i2].state : this;
          let tr2 = n < trs.length && plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState);
          if (tr2 && newState.filterTransaction(tr2, i2)) {
            tr2.setMeta("appendedTransaction", rootTr);
            if (!seen2) {
              seen2 = [];
              for (let j = 0; j < this.config.plugins.length; j++)
                seen2.push(j < i2 ? { state: newState, n: trs.length } : { state: this, n: 0 });
            }
            trs.push(tr2);
            newState = newState.applyInner(tr2);
            haveNew = true;
          }
          if (seen2)
            seen2[i2] = { state: newState, n: trs.length };
        }
      }
      if (!haveNew)
        return { state: newState, transactions: trs };
    }
  }
  /**
  @internal
  */
  applyInner(tr2) {
    if (!tr2.before.eq(this.doc))
      throw new RangeError("Applying a mismatched transaction");
    let newInstance = new EditorState(this.config), fields = this.config.fields;
    for (let i2 = 0; i2 < fields.length; i2++) {
      let field = fields[i2];
      newInstance[field.name] = field.apply(tr2, this[field.name], this, newInstance);
    }
    return newInstance;
  }
  /**
  Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
  */
  get tr() {
    return new Transaction(this);
  }
  /**
  Create a new state.
  */
  static create(config2) {
    let $config = new Configuration(config2.doc ? config2.doc.type.schema : config2.schema, config2.plugins);
    let instance = new EditorState($config);
    for (let i2 = 0; i2 < $config.fields.length; i2++)
      instance[$config.fields[i2].name] = $config.fields[i2].init(config2, instance);
    return instance;
  }
  /**
  Create a new state based on this one, but with an adjusted set
  of active plugins. State fields that exist in both sets of
  plugins are kept unchanged. Those that no longer exist are
  dropped, and those that are new are initialized using their
  [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new
  configuration object..
  */
  reconfigure(config2) {
    let $config = new Configuration(this.schema, config2.plugins);
    let fields = $config.fields, instance = new EditorState($config);
    for (let i2 = 0; i2 < fields.length; i2++) {
      let name2 = fields[i2].name;
      instance[name2] = this.hasOwnProperty(name2) ? this[name2] : fields[i2].init(config2, instance);
    }
    return instance;
  }
  /**
  Serialize this state to JSON. If you want to serialize the state
  of plugins, pass an object mapping property names to use in the
  resulting JSON object to plugin objects. The argument may also be
  a string or number, in which case it is ignored, to support the
  way `JSON.stringify` calls `toString` methods.
  */
  toJSON(pluginFields) {
    let result = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };
    if (this.storedMarks)
      result.storedMarks = this.storedMarks.map((m) => m.toJSON());
    if (pluginFields && typeof pluginFields == "object")
      for (let prop2 in pluginFields) {
        if (prop2 == "doc" || prop2 == "selection")
          throw new RangeError("The JSON fields `doc` and `selection` are reserved");
        let plugin = pluginFields[prop2], state = plugin.spec.state;
        if (state && state.toJSON)
          result[prop2] = state.toJSON.call(plugin, this[plugin.key]);
      }
    return result;
  }
  /**
  Deserialize a JSON representation of a state. `config` should
  have at least a `schema` field, and should contain array of
  plugins to initialize the state with. `pluginFields` can be used
  to deserialize the state of plugins, by associating plugin
  instances with the property names they use in the JSON object.
  */
  static fromJSON(config2, json, pluginFields) {
    if (!json)
      throw new RangeError("Invalid input for EditorState.fromJSON");
    if (!config2.schema)
      throw new RangeError("Required config field 'schema' missing");
    let $config = new Configuration(config2.schema, config2.plugins);
    let instance = new EditorState($config);
    $config.fields.forEach((field) => {
      if (field.name == "doc") {
        instance.doc = Node$2.fromJSON(config2.schema, json.doc);
      } else if (field.name == "selection") {
        instance.selection = Selection.fromJSON(instance.doc, json.selection);
      } else if (field.name == "storedMarks") {
        if (json.storedMarks)
          instance.storedMarks = json.storedMarks.map(config2.schema.markFromJSON);
      } else {
        if (pluginFields)
          for (let prop2 in pluginFields) {
            let plugin = pluginFields[prop2], state = plugin.spec.state;
            if (plugin.key == field.name && state && state.fromJSON && Object.prototype.hasOwnProperty.call(json, prop2)) {
              instance[field.name] = state.fromJSON.call(plugin, config2, json[prop2], instance);
              return;
            }
          }
        instance[field.name] = field.init(config2, instance);
      }
    });
    return instance;
  }
}
function bindProps(obj, self2, target) {
  for (let prop2 in obj) {
    let val = obj[prop2];
    if (val instanceof Function)
      val = val.bind(self2);
    else if (prop2 == "handleDOMEvents")
      val = bindProps(val, self2, {});
    target[prop2] = val;
  }
  return target;
}
__name(bindProps, "bindProps");
class Plugin {
  static {
    __name(this, "Plugin");
  }
  /**
  Create a plugin.
  */
  constructor(spec) {
    this.spec = spec;
    this.props = {};
    if (spec.props)
      bindProps(spec.props, this, this.props);
    this.key = spec.key ? spec.key.key : createKey$1("plugin");
  }
  /**
  Extract the plugin's state field from an editor state.
  */
  getState(state) {
    return state[this.key];
  }
}
const keys = /* @__PURE__ */ Object.create(null);
function createKey$1(name2) {
  if (name2 in keys)
    return name2 + "$" + ++keys[name2];
  keys[name2] = 0;
  return name2 + "$";
}
__name(createKey$1, "createKey$1");
class PluginKey {
  static {
    __name(this, "PluginKey");
  }
  /**
  Create a plugin key.
  */
  constructor(name2 = "key") {
    this.key = createKey$1(name2);
  }
  /**
  Get the active plugin with this key, if any, from an editor
  state.
  */
  get(state) {
    return state.config.pluginsByKey[this.key];
  }
  /**
  Get the plugin's state from an editor state.
  */
  getState(state) {
    return state[this.key];
  }
}
const domIndex = /* @__PURE__ */ __name(function(node3) {
  for (var index2 = 0; ; index2++) {
    node3 = node3.previousSibling;
    if (!node3)
      return index2;
  }
}, "domIndex");
const parentNode = /* @__PURE__ */ __name(function(node3) {
  let parent = node3.assignedSlot || node3.parentNode;
  return parent && parent.nodeType == 11 ? parent.host : parent;
}, "parentNode");
let reusedRange = null;
const textRange = /* @__PURE__ */ __name(function(node3, from2, to) {
  let range2 = reusedRange || (reusedRange = document.createRange());
  range2.setEnd(node3, to == null ? node3.nodeValue.length : to);
  range2.setStart(node3, from2 || 0);
  return range2;
}, "textRange");
const clearReusedRange = /* @__PURE__ */ __name(function() {
  reusedRange = null;
}, "clearReusedRange");
const isEquivalentPosition = /* @__PURE__ */ __name(function(node3, off, targetNode, targetOff) {
  return targetNode && (scanFor(node3, off, targetNode, targetOff, -1) || scanFor(node3, off, targetNode, targetOff, 1));
}, "isEquivalentPosition");
const atomElements = /^(img|br|input|textarea|hr)$/i;
function scanFor(node3, off, targetNode, targetOff, dir) {
  for (; ; ) {
    if (node3 == targetNode && off == targetOff)
      return true;
    if (off == (dir < 0 ? 0 : nodeSize(node3))) {
      let parent = node3.parentNode;
      if (!parent || parent.nodeType != 1 || hasBlockDesc(node3) || atomElements.test(node3.nodeName) || node3.contentEditable == "false")
        return false;
      off = domIndex(node3) + (dir < 0 ? 0 : 1);
      node3 = parent;
    } else if (node3.nodeType == 1) {
      node3 = node3.childNodes[off + (dir < 0 ? -1 : 0)];
      if (node3.contentEditable == "false")
        return false;
      off = dir < 0 ? nodeSize(node3) : 0;
    } else {
      return false;
    }
  }
}
__name(scanFor, "scanFor");
function nodeSize(node3) {
  return node3.nodeType == 3 ? node3.nodeValue.length : node3.childNodes.length;
}
__name(nodeSize, "nodeSize");
function textNodeBefore$1(node3, offset) {
  for (; ; ) {
    if (node3.nodeType == 3 && offset)
      return node3;
    if (node3.nodeType == 1 && offset > 0) {
      if (node3.contentEditable == "false")
        return null;
      node3 = node3.childNodes[offset - 1];
      offset = nodeSize(node3);
    } else if (node3.parentNode && !hasBlockDesc(node3)) {
      offset = domIndex(node3);
      node3 = node3.parentNode;
    } else {
      return null;
    }
  }
}
__name(textNodeBefore$1, "textNodeBefore$1");
function textNodeAfter$1(node3, offset) {
  for (; ; ) {
    if (node3.nodeType == 3 && offset < node3.nodeValue.length)
      return node3;
    if (node3.nodeType == 1 && offset < node3.childNodes.length) {
      if (node3.contentEditable == "false")
        return null;
      node3 = node3.childNodes[offset];
      offset = 0;
    } else if (node3.parentNode && !hasBlockDesc(node3)) {
      offset = domIndex(node3) + 1;
      node3 = node3.parentNode;
    } else {
      return null;
    }
  }
}
__name(textNodeAfter$1, "textNodeAfter$1");
function isOnEdge(node3, offset, parent) {
  for (let atStart = offset == 0, atEnd = offset == nodeSize(node3); atStart || atEnd; ) {
    if (node3 == parent)
      return true;
    let index2 = domIndex(node3);
    node3 = node3.parentNode;
    if (!node3)
      return false;
    atStart = atStart && index2 == 0;
    atEnd = atEnd && index2 == nodeSize(node3);
  }
}
__name(isOnEdge, "isOnEdge");
function hasBlockDesc(dom) {
  let desc;
  for (let cur = dom; cur; cur = cur.parentNode)
    if (desc = cur.pmViewDesc)
      break;
  return desc && desc.node && desc.node.isBlock && (desc.dom == dom || desc.contentDOM == dom);
}
__name(hasBlockDesc, "hasBlockDesc");
const selectionCollapsed = /* @__PURE__ */ __name(function(domSel) {
  return domSel.focusNode && isEquivalentPosition(domSel.focusNode, domSel.focusOffset, domSel.anchorNode, domSel.anchorOffset);
}, "selectionCollapsed");
function keyEvent(keyCode, key) {
  let event = document.createEvent("Event");
  event.initEvent("keydown", true, true);
  event.keyCode = keyCode;
  event.key = event.code = key;
  return event;
}
__name(keyEvent, "keyEvent");
function deepActiveElement(doc2) {
  let elt = doc2.activeElement;
  while (elt && elt.shadowRoot)
    elt = elt.shadowRoot.activeElement;
  return elt;
}
__name(deepActiveElement, "deepActiveElement");
function caretFromPoint(doc2, x2, y2) {
  if (doc2.caretPositionFromPoint) {
    try {
      let pos2 = doc2.caretPositionFromPoint(x2, y2);
      if (pos2)
        return { node: pos2.offsetNode, offset: Math.min(nodeSize(pos2.offsetNode), pos2.offset) };
    } catch (_2) {
    }
  }
  if (doc2.caretRangeFromPoint) {
    let range2 = doc2.caretRangeFromPoint(x2, y2);
    if (range2)
      return { node: range2.startContainer, offset: Math.min(nodeSize(range2.startContainer), range2.startOffset) };
  }
}
__name(caretFromPoint, "caretFromPoint");
const nav = typeof navigator != "undefined" ? navigator : null;
const doc = typeof document != "undefined" ? document : null;
const agent = nav && nav.userAgent || "";
const ie_edge = /Edge\/(\d+)/.exec(agent);
const ie_upto10 = /MSIE \d/.exec(agent);
const ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(agent);
const ie$1 = !!(ie_upto10 || ie_11up || ie_edge);
const ie_version = ie_upto10 ? document.documentMode : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0;
const gecko = !ie$1 && /gecko\/(\d+)/i.test(agent);
gecko && +(/Firefox\/(\d+)/.exec(agent) || [0, 0])[1];
const _chrome = !ie$1 && /Chrome\/(\d+)/.exec(agent);
const chrome = !!_chrome;
const chrome_version = _chrome ? +_chrome[1] : 0;
const safari = !ie$1 && !!nav && /Apple Computer/.test(nav.vendor);
const ios = safari && (/Mobile\/\w+/.test(agent) || !!nav && nav.maxTouchPoints > 2);
const mac$3 = ios || (nav ? /Mac/.test(nav.platform) : false);
const windows = nav ? /Win/.test(nav.platform) : false;
const android = /Android \d/.test(agent);
const webkit = !!doc && "webkitFontSmoothing" in doc.documentElement.style;
const webkit_version = webkit ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
function windowRect(doc2) {
  let vp = doc2.defaultView && doc2.defaultView.visualViewport;
  if (vp)
    return {
      left: 0,
      right: vp.width,
      top: 0,
      bottom: vp.height
    };
  return {
    left: 0,
    right: doc2.documentElement.clientWidth,
    top: 0,
    bottom: doc2.documentElement.clientHeight
  };
}
__name(windowRect, "windowRect");
function getSide(value4, side) {
  return typeof value4 == "number" ? value4 : value4[side];
}
__name(getSide, "getSide");
function clientRect(node3) {
  let rect = node3.getBoundingClientRect();
  let scaleX = rect.width / node3.offsetWidth || 1;
  let scaleY = rect.height / node3.offsetHeight || 1;
  return {
    left: rect.left,
    right: rect.left + node3.clientWidth * scaleX,
    top: rect.top,
    bottom: rect.top + node3.clientHeight * scaleY
  };
}
__name(clientRect, "clientRect");
function scrollRectIntoView(view, rect, startDOM) {
  let scrollThreshold = view.someProp("scrollThreshold") || 0, scrollMargin = view.someProp("scrollMargin") || 5;
  let doc2 = view.dom.ownerDocument;
  for (let parent = startDOM || view.dom; ; parent = parentNode(parent)) {
    if (!parent)
      break;
    if (parent.nodeType != 1)
      continue;
    let elt = parent;
    let atTop = elt == doc2.body;
    let bounding = atTop ? windowRect(doc2) : clientRect(elt);
    let moveX = 0, moveY = 0;
    if (rect.top < bounding.top + getSide(scrollThreshold, "top"))
      moveY = -(bounding.top - rect.top + getSide(scrollMargin, "top"));
    else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, "bottom"))
      moveY = rect.bottom - rect.top > bounding.bottom - bounding.top ? rect.top + getSide(scrollMargin, "top") - bounding.top : rect.bottom - bounding.bottom + getSide(scrollMargin, "bottom");
    if (rect.left < bounding.left + getSide(scrollThreshold, "left"))
      moveX = -(bounding.left - rect.left + getSide(scrollMargin, "left"));
    else if (rect.right > bounding.right - getSide(scrollThreshold, "right"))
      moveX = rect.right - bounding.right + getSide(scrollMargin, "right");
    if (moveX || moveY) {
      if (atTop) {
        doc2.defaultView.scrollBy(moveX, moveY);
      } else {
        let startX = elt.scrollLeft, startY = elt.scrollTop;
        if (moveY)
          elt.scrollTop += moveY;
        if (moveX)
          elt.scrollLeft += moveX;
        let dX = elt.scrollLeft - startX, dY = elt.scrollTop - startY;
        rect = { left: rect.left - dX, top: rect.top - dY, right: rect.right - dX, bottom: rect.bottom - dY };
      }
    }
    if (atTop || /^(fixed|sticky)$/.test(getComputedStyle(parent).position))
      break;
  }
}
__name(scrollRectIntoView, "scrollRectIntoView");
function storeScrollPos(view) {
  let rect = view.dom.getBoundingClientRect(), startY = Math.max(0, rect.top);
  let refDOM, refTop;
  for (let x2 = (rect.left + rect.right) / 2, y2 = startY + 1; y2 < Math.min(innerHeight, rect.bottom); y2 += 5) {
    let dom = view.root.elementFromPoint(x2, y2);
    if (!dom || dom == view.dom || !view.dom.contains(dom))
      continue;
    let localRect = dom.getBoundingClientRect();
    if (localRect.top >= startY - 20) {
      refDOM = dom;
      refTop = localRect.top;
      break;
    }
  }
  return { refDOM, refTop, stack: scrollStack(view.dom) };
}
__name(storeScrollPos, "storeScrollPos");
function scrollStack(dom) {
  let stack2 = [], doc2 = dom.ownerDocument;
  for (let cur = dom; cur; cur = parentNode(cur)) {
    stack2.push({ dom: cur, top: cur.scrollTop, left: cur.scrollLeft });
    if (dom == doc2)
      break;
  }
  return stack2;
}
__name(scrollStack, "scrollStack");
function resetScrollPos({ refDOM, refTop, stack: stack2 }) {
  let newRefTop = refDOM ? refDOM.getBoundingClientRect().top : 0;
  restoreScrollStack(stack2, newRefTop == 0 ? 0 : newRefTop - refTop);
}
__name(resetScrollPos, "resetScrollPos");
function restoreScrollStack(stack2, dTop) {
  for (let i2 = 0; i2 < stack2.length; i2++) {
    let { dom, top, left } = stack2[i2];
    if (dom.scrollTop != top + dTop)
      dom.scrollTop = top + dTop;
    if (dom.scrollLeft != left)
      dom.scrollLeft = left;
  }
}
__name(restoreScrollStack, "restoreScrollStack");
let preventScrollSupported = null;
function focusPreventScroll(dom) {
  if (dom.setActive)
    return dom.setActive();
  if (preventScrollSupported)
    return dom.focus(preventScrollSupported);
  let stored = scrollStack(dom);
  dom.focus(preventScrollSupported == null ? {
    get preventScroll() {
      preventScrollSupported = { preventScroll: true };
      return true;
    }
  } : void 0);
  if (!preventScrollSupported) {
    preventScrollSupported = false;
    restoreScrollStack(stored, 0);
  }
}
__name(focusPreventScroll, "focusPreventScroll");
function findOffsetInNode(node3, coords) {
  let closest, dxClosest = 2e8, coordsClosest, offset = 0;
  let rowBot = coords.top, rowTop = coords.top;
  let firstBelow, coordsBelow;
  for (let child = node3.firstChild, childIndex = 0; child; child = child.nextSibling, childIndex++) {
    let rects;
    if (child.nodeType == 1)
      rects = child.getClientRects();
    else if (child.nodeType == 3)
      rects = textRange(child).getClientRects();
    else
      continue;
    for (let i2 = 0; i2 < rects.length; i2++) {
      let rect = rects[i2];
      if (rect.top <= rowBot && rect.bottom >= rowTop) {
        rowBot = Math.max(rect.bottom, rowBot);
        rowTop = Math.min(rect.top, rowTop);
        let dx = rect.left > coords.left ? rect.left - coords.left : rect.right < coords.left ? coords.left - rect.right : 0;
        if (dx < dxClosest) {
          closest = child;
          dxClosest = dx;
          coordsClosest = dx && closest.nodeType == 3 ? {
            left: rect.right < coords.left ? rect.right : rect.left,
            top: coords.top
          } : coords;
          if (child.nodeType == 1 && dx)
            offset = childIndex + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0);
          continue;
        }
      } else if (rect.top > coords.top && !firstBelow && rect.left <= coords.left && rect.right >= coords.left) {
        firstBelow = child;
        coordsBelow = { left: Math.max(rect.left, Math.min(rect.right, coords.left)), top: rect.top };
      }
      if (!closest && (coords.left >= rect.right && coords.top >= rect.top || coords.left >= rect.left && coords.top >= rect.bottom))
        offset = childIndex + 1;
    }
  }
  if (!closest && firstBelow) {
    closest = firstBelow;
    coordsClosest = coordsBelow;
    dxClosest = 0;
  }
  if (closest && closest.nodeType == 3)
    return findOffsetInText(closest, coordsClosest);
  if (!closest || dxClosest && closest.nodeType == 1)
    return { node: node3, offset };
  return findOffsetInNode(closest, coordsClosest);
}
__name(findOffsetInNode, "findOffsetInNode");
function findOffsetInText(node3, coords) {
  let len = node3.nodeValue.length;
  let range2 = document.createRange();
  for (let i2 = 0; i2 < len; i2++) {
    range2.setEnd(node3, i2 + 1);
    range2.setStart(node3, i2);
    let rect = singleRect(range2, 1);
    if (rect.top == rect.bottom)
      continue;
    if (inRect(coords, rect))
      return { node: node3, offset: i2 + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0) };
  }
  return { node: node3, offset: 0 };
}
__name(findOffsetInText, "findOffsetInText");
function inRect(coords, rect) {
  return coords.left >= rect.left - 1 && coords.left <= rect.right + 1 && coords.top >= rect.top - 1 && coords.top <= rect.bottom + 1;
}
__name(inRect, "inRect");
function targetKludge(dom, coords) {
  let parent = dom.parentNode;
  if (parent && /^li$/i.test(parent.nodeName) && coords.left < dom.getBoundingClientRect().left)
    return parent;
  return dom;
}
__name(targetKludge, "targetKludge");
function posFromElement(view, elt, coords) {
  let { node: node3, offset } = findOffsetInNode(elt, coords), bias = -1;
  if (node3.nodeType == 1 && !node3.firstChild) {
    let rect = node3.getBoundingClientRect();
    bias = rect.left != rect.right && coords.left > (rect.left + rect.right) / 2 ? 1 : -1;
  }
  return view.docView.posFromDOM(node3, offset, bias);
}
__name(posFromElement, "posFromElement");
function posFromCaret(view, node3, offset, coords) {
  let outsideBlock = -1;
  for (let cur = node3, sawBlock = false; ; ) {
    if (cur == view.dom)
      break;
    let desc = view.docView.nearestDesc(cur, true), rect;
    if (!desc)
      return null;
    if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) && // Ignore elements with zero-size bounding rectangles
    ((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {
      if (desc.node.isBlock && desc.parent) {
        if (!sawBlock && rect.left > coords.left || rect.top > coords.top)
          outsideBlock = desc.posBefore;
        else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top)
          outsideBlock = desc.posAfter;
        sawBlock = true;
      }
      if (!desc.contentDOM && outsideBlock < 0 && !desc.node.isText) {
        let before = desc.node.isBlock ? coords.top < (rect.top + rect.bottom) / 2 : coords.left < (rect.left + rect.right) / 2;
        return before ? desc.posBefore : desc.posAfter;
      }
    }
    cur = desc.dom.parentNode;
  }
  return outsideBlock > -1 ? outsideBlock : view.docView.posFromDOM(node3, offset, -1);
}
__name(posFromCaret, "posFromCaret");
function elementFromPoint(element, coords, box) {
  let len = element.childNodes.length;
  if (len && box.top < box.bottom) {
    for (let startI = Math.max(0, Math.min(len - 1, Math.floor(len * (coords.top - box.top) / (box.bottom - box.top)) - 2)), i2 = startI; ; ) {
      let child = element.childNodes[i2];
      if (child.nodeType == 1) {
        let rects = child.getClientRects();
        for (let j = 0; j < rects.length; j++) {
          let rect = rects[j];
          if (inRect(coords, rect))
            return elementFromPoint(child, coords, rect);
        }
      }
      if ((i2 = (i2 + 1) % len) == startI)
        break;
    }
  }
  return element;
}
__name(elementFromPoint, "elementFromPoint");
function posAtCoords(view, coords) {
  let doc2 = view.dom.ownerDocument, node3, offset = 0;
  let caret = caretFromPoint(doc2, coords.left, coords.top);
  if (caret)
    ({ node: node3, offset } = caret);
  let elt = (view.root.elementFromPoint ? view.root : doc2).elementFromPoint(coords.left, coords.top);
  let pos2;
  if (!elt || !view.dom.contains(elt.nodeType != 1 ? elt.parentNode : elt)) {
    let box = view.dom.getBoundingClientRect();
    if (!inRect(coords, box))
      return null;
    elt = elementFromPoint(view.dom, coords, box);
    if (!elt)
      return null;
  }
  if (safari) {
    for (let p2 = elt; node3 && p2; p2 = parentNode(p2))
      if (p2.draggable)
        node3 = void 0;
  }
  elt = targetKludge(elt, coords);
  if (node3) {
    if (gecko && node3.nodeType == 1) {
      offset = Math.min(offset, node3.childNodes.length);
      if (offset < node3.childNodes.length) {
        let next2 = node3.childNodes[offset], box;
        if (next2.nodeName == "IMG" && (box = next2.getBoundingClientRect()).right <= coords.left && box.bottom > coords.top)
          offset++;
      }
    }
    let prev2;
    if (webkit && offset && node3.nodeType == 1 && (prev2 = node3.childNodes[offset - 1]).nodeType == 1 && prev2.contentEditable == "false" && prev2.getBoundingClientRect().top >= coords.top)
      offset--;
    if (node3 == view.dom && offset == node3.childNodes.length - 1 && node3.lastChild.nodeType == 1 && coords.top > node3.lastChild.getBoundingClientRect().bottom)
      pos2 = view.state.doc.content.size;
    else if (offset == 0 || node3.nodeType != 1 || node3.childNodes[offset - 1].nodeName != "BR")
      pos2 = posFromCaret(view, node3, offset, coords);
  }
  if (pos2 == null)
    pos2 = posFromElement(view, elt, coords);
  let desc = view.docView.nearestDesc(elt, true);
  return { pos: pos2, inside: desc ? desc.posAtStart - desc.border : -1 };
}
__name(posAtCoords, "posAtCoords");
function nonZero(rect) {
  return rect.top < rect.bottom || rect.left < rect.right;
}
__name(nonZero, "nonZero");
function singleRect(target, bias) {
  let rects = target.getClientRects();
  if (rects.length) {
    let first2 = rects[bias < 0 ? 0 : rects.length - 1];
    if (nonZero(first2))
      return first2;
  }
  return Array.prototype.find.call(rects, nonZero) || target.getBoundingClientRect();
}
__name(singleRect, "singleRect");
const BIDI = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
function coordsAtPos(view, pos2, side) {
  let { node: node3, offset, atom } = view.docView.domFromPos(pos2, side < 0 ? -1 : 1);
  let supportEmptyRange = webkit || gecko;
  if (node3.nodeType == 3) {
    if (supportEmptyRange && (BIDI.test(node3.nodeValue) || (side < 0 ? !offset : offset == node3.nodeValue.length))) {
      let rect = singleRect(textRange(node3, offset, offset), side);
      if (gecko && offset && /\s/.test(node3.nodeValue[offset - 1]) && offset < node3.nodeValue.length) {
        let rectBefore = singleRect(textRange(node3, offset - 1, offset - 1), -1);
        if (rectBefore.top == rect.top) {
          let rectAfter = singleRect(textRange(node3, offset, offset + 1), -1);
          if (rectAfter.top != rect.top)
            return flattenV(rectAfter, rectAfter.left < rectBefore.left);
        }
      }
      return rect;
    } else {
      let from2 = offset, to = offset, takeSide = side < 0 ? 1 : -1;
      if (side < 0 && !offset) {
        to++;
        takeSide = -1;
      } else if (side >= 0 && offset == node3.nodeValue.length) {
        from2--;
        takeSide = 1;
      } else if (side < 0) {
        from2--;
      } else {
        to++;
      }
      return flattenV(singleRect(textRange(node3, from2, to), takeSide), takeSide < 0);
    }
  }
  let $dom = view.state.doc.resolve(pos2 - (atom || 0));
  if (!$dom.parent.inlineContent) {
    if (atom == null && offset && (side < 0 || offset == nodeSize(node3))) {
      let before = node3.childNodes[offset - 1];
      if (before.nodeType == 1)
        return flattenH(before.getBoundingClientRect(), false);
    }
    if (atom == null && offset < nodeSize(node3)) {
      let after = node3.childNodes[offset];
      if (after.nodeType == 1)
        return flattenH(after.getBoundingClientRect(), true);
    }
    return flattenH(node3.getBoundingClientRect(), side >= 0);
  }
  if (atom == null && offset && (side < 0 || offset == nodeSize(node3))) {
    let before = node3.childNodes[offset - 1];
    let target = before.nodeType == 3 ? textRange(before, nodeSize(before) - (supportEmptyRange ? 0 : 1)) : before.nodeType == 1 && (before.nodeName != "BR" || !before.nextSibling) ? before : null;
    if (target)
      return flattenV(singleRect(target, 1), false);
  }
  if (atom == null && offset < nodeSize(node3)) {
    let after = node3.childNodes[offset];
    while (after.pmViewDesc && after.pmViewDesc.ignoreForCoords)
      after = after.nextSibling;
    let target = !after ? null : after.nodeType == 3 ? textRange(after, 0, supportEmptyRange ? 0 : 1) : after.nodeType == 1 ? after : null;
    if (target)
      return flattenV(singleRect(target, -1), true);
  }
  return flattenV(singleRect(node3.nodeType == 3 ? textRange(node3) : node3, -side), side >= 0);
}
__name(coordsAtPos, "coordsAtPos");
function flattenV(rect, left) {
  if (rect.width == 0)
    return rect;
  let x2 = left ? rect.left : rect.right;
  return { top: rect.top, bottom: rect.bottom, left: x2, right: x2 };
}
__name(flattenV, "flattenV");
function flattenH(rect, top) {
  if (rect.height == 0)
    return rect;
  let y2 = top ? rect.top : rect.bottom;
  return { top: y2, bottom: y2, left: rect.left, right: rect.right };
}
__name(flattenH, "flattenH");
function withFlushedState(view, state, f) {
  let viewState = view.state, active3 = view.root.activeElement;
  if (viewState != state)
    view.updateState(state);
  if (active3 != view.dom)
    view.focus();
  try {
    return f();
  } finally {
    if (viewState != state)
      view.updateState(viewState);
    if (active3 != view.dom && active3)
      active3.focus();
  }
}
__name(withFlushedState, "withFlushedState");
function endOfTextblockVertical(view, state, dir) {
  let sel = state.selection;
  let $pos = dir == "up" ? sel.$from : sel.$to;
  return withFlushedState(view, state, () => {
    let { node: dom } = view.docView.domFromPos($pos.pos, dir == "up" ? -1 : 1);
    for (; ; ) {
      let nearest = view.docView.nearestDesc(dom, true);
      if (!nearest)
        break;
      if (nearest.node.isBlock) {
        dom = nearest.contentDOM || nearest.dom;
        break;
      }
      dom = nearest.dom.parentNode;
    }
    let coords = coordsAtPos(view, $pos.pos, 1);
    for (let child = dom.firstChild; child; child = child.nextSibling) {
      let boxes;
      if (child.nodeType == 1)
        boxes = child.getClientRects();
      else if (child.nodeType == 3)
        boxes = textRange(child, 0, child.nodeValue.length).getClientRects();
      else
        continue;
      for (let i2 = 0; i2 < boxes.length; i2++) {
        let box = boxes[i2];
        if (box.bottom > box.top + 1 && (dir == "up" ? coords.top - box.top > (box.bottom - coords.top) * 2 : box.bottom - coords.bottom > (coords.bottom - box.top) * 2))
          return false;
      }
    }
    return true;
  });
}
__name(endOfTextblockVertical, "endOfTextblockVertical");
const maybeRTL = /[\u0590-\u08ac]/;
function endOfTextblockHorizontal(view, state, dir) {
  let { $head } = state.selection;
  if (!$head.parent.isTextblock)
    return false;
  let offset = $head.parentOffset, atStart = !offset, atEnd = offset == $head.parent.content.size;
  let sel = view.domSelection();
  if (!sel)
    return $head.pos == $head.start() || $head.pos == $head.end();
  if (!maybeRTL.test($head.parent.textContent) || !sel.modify)
    return dir == "left" || dir == "backward" ? atStart : atEnd;
  return withFlushedState(view, state, () => {
    let { focusNode: oldNode, focusOffset: oldOff, anchorNode, anchorOffset } = view.domSelectionRange();
    let oldBidiLevel = sel.caretBidiLevel;
    sel.modify("move", dir, "character");
    let parentDOM = $head.depth ? view.docView.domAfterPos($head.before()) : view.dom;
    let { focusNode: newNode, focusOffset: newOff } = view.domSelectionRange();
    let result = newNode && !parentDOM.contains(newNode.nodeType == 1 ? newNode : newNode.parentNode) || oldNode == newNode && oldOff == newOff;
    try {
      sel.collapse(anchorNode, anchorOffset);
      if (oldNode && (oldNode != anchorNode || oldOff != anchorOffset) && sel.extend)
        sel.extend(oldNode, oldOff);
    } catch (_2) {
    }
    if (oldBidiLevel != null)
      sel.caretBidiLevel = oldBidiLevel;
    return result;
  });
}
__name(endOfTextblockHorizontal, "endOfTextblockHorizontal");
let cachedState = null;
let cachedDir = null;
let cachedResult = false;
function endOfTextblock(view, state, dir) {
  if (cachedState == state && cachedDir == dir)
    return cachedResult;
  cachedState = state;
  cachedDir = dir;
  return cachedResult = dir == "up" || dir == "down" ? endOfTextblockVertical(view, state, dir) : endOfTextblockHorizontal(view, state, dir);
}
__name(endOfTextblock, "endOfTextblock");
const NOT_DIRTY = 0, CHILD_DIRTY = 1, CONTENT_DIRTY = 2, NODE_DIRTY = 3;
class ViewDesc {
  static {
    __name(this, "ViewDesc");
  }
  constructor(parent, children, dom, contentDOM) {
    this.parent = parent;
    this.children = children;
    this.dom = dom;
    this.contentDOM = contentDOM;
    this.dirty = NOT_DIRTY;
    dom.pmViewDesc = this;
  }
  // Used to check whether a given description corresponds to a
  // widget/mark/node.
  matchesWidget(widget2) {
    return false;
  }
  matchesMark(mark2) {
    return false;
  }
  matchesNode(node3, outerDeco, innerDeco) {
    return false;
  }
  matchesHack(nodeName) {
    return false;
  }
  // When parsing in-editor content (in domchange.js), we allow
  // descriptions to determine the parse rules that should be used to
  // parse them.
  parseRule() {
    return null;
  }
  // Used by the editor's event handler to ignore events that come
  // from certain descs.
  stopEvent(event) {
    return false;
  }
  // The size of the content represented by this desc.
  get size() {
    let size2 = 0;
    for (let i2 = 0; i2 < this.children.length; i2++)
      size2 += this.children[i2].size;
    return size2;
  }
  // For block nodes, this represents the space taken up by their
  // start/end tokens.
  get border() {
    return 0;
  }
  destroy() {
    this.parent = void 0;
    if (this.dom.pmViewDesc == this)
      this.dom.pmViewDesc = void 0;
    for (let i2 = 0; i2 < this.children.length; i2++)
      this.children[i2].destroy();
  }
  posBeforeChild(child) {
    for (let i2 = 0, pos2 = this.posAtStart; ; i2++) {
      let cur = this.children[i2];
      if (cur == child)
        return pos2;
      pos2 += cur.size;
    }
  }
  get posBefore() {
    return this.parent.posBeforeChild(this);
  }
  get posAtStart() {
    return this.parent ? this.parent.posBeforeChild(this) + this.border : 0;
  }
  get posAfter() {
    return this.posBefore + this.size;
  }
  get posAtEnd() {
    return this.posAtStart + this.size - 2 * this.border;
  }
  localPosFromDOM(dom, offset, bias) {
    if (this.contentDOM && this.contentDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode)) {
      if (bias < 0) {
        let domBefore, desc;
        if (dom == this.contentDOM) {
          domBefore = dom.childNodes[offset - 1];
        } else {
          while (dom.parentNode != this.contentDOM)
            dom = dom.parentNode;
          domBefore = dom.previousSibling;
        }
        while (domBefore && !((desc = domBefore.pmViewDesc) && desc.parent == this))
          domBefore = domBefore.previousSibling;
        return domBefore ? this.posBeforeChild(desc) + desc.size : this.posAtStart;
      } else {
        let domAfter, desc;
        if (dom == this.contentDOM) {
          domAfter = dom.childNodes[offset];
        } else {
          while (dom.parentNode != this.contentDOM)
            dom = dom.parentNode;
          domAfter = dom.nextSibling;
        }
        while (domAfter && !((desc = domAfter.pmViewDesc) && desc.parent == this))
          domAfter = domAfter.nextSibling;
        return domAfter ? this.posBeforeChild(desc) : this.posAtEnd;
      }
    }
    let atEnd;
    if (dom == this.dom && this.contentDOM) {
      atEnd = offset > domIndex(this.contentDOM);
    } else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM)) {
      atEnd = dom.compareDocumentPosition(this.contentDOM) & 2;
    } else if (this.dom.firstChild) {
      if (offset == 0)
        for (let search2 = dom; ; search2 = search2.parentNode) {
          if (search2 == this.dom) {
            atEnd = false;
            break;
          }
          if (search2.previousSibling)
            break;
        }
      if (atEnd == null && offset == dom.childNodes.length)
        for (let search2 = dom; ; search2 = search2.parentNode) {
          if (search2 == this.dom) {
            atEnd = true;
            break;
          }
          if (search2.nextSibling)
            break;
        }
    }
    return (atEnd == null ? bias > 0 : atEnd) ? this.posAtEnd : this.posAtStart;
  }
  nearestDesc(dom, onlyNodes = false) {
    for (let first2 = true, cur = dom; cur; cur = cur.parentNode) {
      let desc = this.getDesc(cur), nodeDOM;
      if (desc && (!onlyNodes || desc.node)) {
        if (first2 && (nodeDOM = desc.nodeDOM) && !(nodeDOM.nodeType == 1 ? nodeDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode) : nodeDOM == dom))
          first2 = false;
        else
          return desc;
      }
    }
  }
  getDesc(dom) {
    let desc = dom.pmViewDesc;
    for (let cur = desc; cur; cur = cur.parent)
      if (cur == this)
        return desc;
  }
  posFromDOM(dom, offset, bias) {
    for (let scan = dom; scan; scan = scan.parentNode) {
      let desc = this.getDesc(scan);
      if (desc)
        return desc.localPosFromDOM(dom, offset, bias);
    }
    return -1;
  }
  // Find the desc for the node after the given pos, if any. (When a
  // parent node overrode rendering, there might not be one.)
  descAt(pos2) {
    for (let i2 = 0, offset = 0; i2 < this.children.length; i2++) {
      let child = this.children[i2], end = offset + child.size;
      if (offset == pos2 && end != offset) {
        while (!child.border && child.children.length)
          child = child.children[0];
        return child;
      }
      if (pos2 < end)
        return child.descAt(pos2 - offset - child.border);
      offset = end;
    }
  }
  domFromPos(pos2, side) {
    if (!this.contentDOM)
      return { node: this.dom, offset: 0, atom: pos2 + 1 };
    let i2 = 0, offset = 0;
    for (let curPos = 0; i2 < this.children.length; i2++) {
      let child = this.children[i2], end = curPos + child.size;
      if (end > pos2 || child instanceof TrailingHackViewDesc) {
        offset = pos2 - curPos;
        break;
      }
      curPos = end;
    }
    if (offset)
      return this.children[i2].domFromPos(offset - this.children[i2].border, side);
    for (let prev2; i2 && !(prev2 = this.children[i2 - 1]).size && prev2 instanceof WidgetViewDesc && prev2.side >= 0; i2--) {
    }
    if (side <= 0) {
      let prev2, enter2 = true;
      for (; ; i2--, enter2 = false) {
        prev2 = i2 ? this.children[i2 - 1] : null;
        if (!prev2 || prev2.dom.parentNode == this.contentDOM)
          break;
      }
      if (prev2 && side && enter2 && !prev2.border && !prev2.domAtom)
        return prev2.domFromPos(prev2.size, side);
      return { node: this.contentDOM, offset: prev2 ? domIndex(prev2.dom) + 1 : 0 };
    } else {
      let next2, enter2 = true;
      for (; ; i2++, enter2 = false) {
        next2 = i2 < this.children.length ? this.children[i2] : null;
        if (!next2 || next2.dom.parentNode == this.contentDOM)
          break;
      }
      if (next2 && enter2 && !next2.border && !next2.domAtom)
        return next2.domFromPos(0, side);
      return { node: this.contentDOM, offset: next2 ? domIndex(next2.dom) : this.contentDOM.childNodes.length };
    }
  }
  // Used to find a DOM range in a single parent for a given changed
  // range.
  parseRange(from2, to, base2 = 0) {
    if (this.children.length == 0)
      return { node: this.contentDOM, from: from2, to, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };
    let fromOffset = -1, toOffset = -1;
    for (let offset = base2, i2 = 0; ; i2++) {
      let child = this.children[i2], end = offset + child.size;
      if (fromOffset == -1 && from2 <= end) {
        let childBase = offset + child.border;
        if (from2 >= childBase && to <= end - child.border && child.node && child.contentDOM && this.contentDOM.contains(child.contentDOM))
          return child.parseRange(from2, to, childBase);
        from2 = offset;
        for (let j = i2; j > 0; j--) {
          let prev2 = this.children[j - 1];
          if (prev2.size && prev2.dom.parentNode == this.contentDOM && !prev2.emptyChildAt(1)) {
            fromOffset = domIndex(prev2.dom) + 1;
            break;
          }
          from2 -= prev2.size;
        }
        if (fromOffset == -1)
          fromOffset = 0;
      }
      if (fromOffset > -1 && (end > to || i2 == this.children.length - 1)) {
        to = end;
        for (let j = i2 + 1; j < this.children.length; j++) {
          let next2 = this.children[j];
          if (next2.size && next2.dom.parentNode == this.contentDOM && !next2.emptyChildAt(-1)) {
            toOffset = domIndex(next2.dom);
            break;
          }
          to += next2.size;
        }
        if (toOffset == -1)
          toOffset = this.contentDOM.childNodes.length;
        break;
      }
      offset = end;
    }
    return { node: this.contentDOM, from: from2, to, fromOffset, toOffset };
  }
  emptyChildAt(side) {
    if (this.border || !this.contentDOM || !this.children.length)
      return false;
    let child = this.children[side < 0 ? 0 : this.children.length - 1];
    return child.size == 0 || child.emptyChildAt(side);
  }
  domAfterPos(pos2) {
    let { node: node3, offset } = this.domFromPos(pos2, 0);
    if (node3.nodeType != 1 || offset == node3.childNodes.length)
      throw new RangeError("No node after pos " + pos2);
    return node3.childNodes[offset];
  }
  // View descs are responsible for setting any selection that falls
  // entirely inside of them, so that custom implementations can do
  // custom things with the selection. Note that this falls apart when
  // a selection starts in such a node and ends in another, in which
  // case we just use whatever domFromPos produces as a best effort.
  setSelection(anchor, head, view, force = false) {
    let from2 = Math.min(anchor, head), to = Math.max(anchor, head);
    for (let i2 = 0, offset = 0; i2 < this.children.length; i2++) {
      let child = this.children[i2], end = offset + child.size;
      if (from2 > offset && to < end)
        return child.setSelection(anchor - offset - child.border, head - offset - child.border, view, force);
      offset = end;
    }
    let anchorDOM = this.domFromPos(anchor, anchor ? -1 : 1);
    let headDOM = head == anchor ? anchorDOM : this.domFromPos(head, head ? -1 : 1);
    let domSel = view.root.getSelection();
    let selRange = view.domSelectionRange();
    let brKludge = false;
    if ((gecko || safari) && anchor == head) {
      let { node: node3, offset } = anchorDOM;
      if (node3.nodeType == 3) {
        brKludge = !!(offset && node3.nodeValue[offset - 1] == "\n");
        if (brKludge && offset == node3.nodeValue.length) {
          for (let scan = node3, after; scan; scan = scan.parentNode) {
            if (after = scan.nextSibling) {
              if (after.nodeName == "BR")
                anchorDOM = headDOM = { node: after.parentNode, offset: domIndex(after) + 1 };
              break;
            }
            let desc = scan.pmViewDesc;
            if (desc && desc.node && desc.node.isBlock)
              break;
          }
        }
      } else {
        let prev2 = node3.childNodes[offset - 1];
        brKludge = prev2 && (prev2.nodeName == "BR" || prev2.contentEditable == "false");
      }
    }
    if (gecko && selRange.focusNode && selRange.focusNode != headDOM.node && selRange.focusNode.nodeType == 1) {
      let after = selRange.focusNode.childNodes[selRange.focusOffset];
      if (after && after.contentEditable == "false")
        force = true;
    }
    if (!(force || brKludge && safari) && isEquivalentPosition(anchorDOM.node, anchorDOM.offset, selRange.anchorNode, selRange.anchorOffset) && isEquivalentPosition(headDOM.node, headDOM.offset, selRange.focusNode, selRange.focusOffset))
      return;
    let domSelExtended = false;
    if ((domSel.extend || anchor == head) && !brKludge) {
      domSel.collapse(anchorDOM.node, anchorDOM.offset);
      try {
        if (anchor != head)
          domSel.extend(headDOM.node, headDOM.offset);
        domSelExtended = true;
      } catch (_2) {
      }
    }
    if (!domSelExtended) {
      if (anchor > head) {
        let tmp = anchorDOM;
        anchorDOM = headDOM;
        headDOM = tmp;
      }
      let range2 = document.createRange();
      range2.setEnd(headDOM.node, headDOM.offset);
      range2.setStart(anchorDOM.node, anchorDOM.offset);
      domSel.removeAllRanges();
      domSel.addRange(range2);
    }
  }
  ignoreMutation(mutation) {
    return !this.contentDOM && mutation.type != "selection";
  }
  get contentLost() {
    return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);
  }
  // Remove a subtree of the element tree that has been touched
  // by a DOM change, so that the next update will redraw it.
  markDirty(from2, to) {
    for (let offset = 0, i2 = 0; i2 < this.children.length; i2++) {
      let child = this.children[i2], end = offset + child.size;
      if (offset == end ? from2 <= end && to >= offset : from2 < end && to > offset) {
        let startInside = offset + child.border, endInside = end - child.border;
        if (from2 >= startInside && to <= endInside) {
          this.dirty = from2 == offset || to == end ? CONTENT_DIRTY : CHILD_DIRTY;
          if (from2 == startInside && to == endInside && (child.contentLost || child.dom.parentNode != this.contentDOM))
            child.dirty = NODE_DIRTY;
          else
            child.markDirty(from2 - startInside, to - startInside);
          return;
        } else {
          child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM && !child.children.length ? CONTENT_DIRTY : NODE_DIRTY;
        }
      }
      offset = end;
    }
    this.dirty = CONTENT_DIRTY;
  }
  markParentsDirty() {
    let level = 1;
    for (let node3 = this.parent; node3; node3 = node3.parent, level++) {
      let dirty = level == 1 ? CONTENT_DIRTY : CHILD_DIRTY;
      if (node3.dirty < dirty)
        node3.dirty = dirty;
    }
  }
  get domAtom() {
    return false;
  }
  get ignoreForCoords() {
    return false;
  }
  isText(text2) {
    return false;
  }
}
class WidgetViewDesc extends ViewDesc {
  static {
    __name(this, "WidgetViewDesc");
  }
  constructor(parent, widget2, view, pos2) {
    let self2, dom = widget2.type.toDOM;
    if (typeof dom == "function")
      dom = dom(view, () => {
        if (!self2)
          return pos2;
        if (self2.parent)
          return self2.parent.posBeforeChild(self2);
      });
    if (!widget2.type.spec.raw) {
      if (dom.nodeType != 1) {
        let wrap2 = document.createElement("span");
        wrap2.appendChild(dom);
        dom = wrap2;
      }
      dom.contentEditable = "false";
      dom.classList.add("ProseMirror-widget");
    }
    super(parent, [], dom, null);
    this.widget = widget2;
    this.widget = widget2;
    self2 = this;
  }
  matchesWidget(widget2) {
    return this.dirty == NOT_DIRTY && widget2.type.eq(this.widget.type);
  }
  parseRule() {
    return { ignore: true };
  }
  stopEvent(event) {
    let stop2 = this.widget.spec.stopEvent;
    return stop2 ? stop2(event) : false;
  }
  ignoreMutation(mutation) {
    return mutation.type != "selection" || this.widget.spec.ignoreSelection;
  }
  destroy() {
    this.widget.type.destroy(this.dom);
    super.destroy();
  }
  get domAtom() {
    return true;
  }
  get side() {
    return this.widget.type.side;
  }
}
class CompositionViewDesc extends ViewDesc {
  static {
    __name(this, "CompositionViewDesc");
  }
  constructor(parent, dom, textDOM, text2) {
    super(parent, [], dom, null);
    this.textDOM = textDOM;
    this.text = text2;
  }
  get size() {
    return this.text.length;
  }
  localPosFromDOM(dom, offset) {
    if (dom != this.textDOM)
      return this.posAtStart + (offset ? this.size : 0);
    return this.posAtStart + offset;
  }
  domFromPos(pos2) {
    return { node: this.textDOM, offset: pos2 };
  }
  ignoreMutation(mut) {
    return mut.type === "characterData" && mut.target.nodeValue == mut.oldValue;
  }
}
class MarkViewDesc extends ViewDesc {
  static {
    __name(this, "MarkViewDesc");
  }
  constructor(parent, mark2, dom, contentDOM, spec) {
    super(parent, [], dom, contentDOM);
    this.mark = mark2;
    this.spec = spec;
  }
  static create(parent, mark2, inline3, view) {
    let custom2 = view.nodeViews[mark2.type.name];
    let spec = custom2 && custom2(mark2, view, inline3);
    if (!spec || !spec.dom)
      spec = DOMSerializer.renderSpec(document, mark2.type.spec.toDOM(mark2, inline3), null, mark2.attrs);
    return new MarkViewDesc(parent, mark2, spec.dom, spec.contentDOM || spec.dom, spec);
  }
  parseRule() {
    if (this.dirty & NODE_DIRTY || this.mark.type.spec.reparseInView)
      return null;
    return { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
  }
  matchesMark(mark2) {
    return this.dirty != NODE_DIRTY && this.mark.eq(mark2);
  }
  markDirty(from2, to) {
    super.markDirty(from2, to);
    if (this.dirty != NOT_DIRTY) {
      let parent = this.parent;
      while (!parent.node)
        parent = parent.parent;
      if (parent.dirty < this.dirty)
        parent.dirty = this.dirty;
      this.dirty = NOT_DIRTY;
    }
  }
  slice(from2, to, view) {
    let copy2 = MarkViewDesc.create(this.parent, this.mark, true, view);
    let nodes = this.children, size2 = this.size;
    if (to < size2)
      nodes = replaceNodes(nodes, to, size2, view);
    if (from2 > 0)
      nodes = replaceNodes(nodes, 0, from2, view);
    for (let i2 = 0; i2 < nodes.length; i2++)
      nodes[i2].parent = copy2;
    copy2.children = nodes;
    return copy2;
  }
  ignoreMutation(mutation) {
    return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);
  }
  destroy() {
    if (this.spec.destroy)
      this.spec.destroy();
    super.destroy();
  }
}
class NodeViewDesc extends ViewDesc {
  static {
    __name(this, "NodeViewDesc");
  }
  constructor(parent, node3, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos2) {
    super(parent, [], dom, contentDOM);
    this.node = node3;
    this.outerDeco = outerDeco;
    this.innerDeco = innerDeco;
    this.nodeDOM = nodeDOM;
  }
  // By default, a node is rendered using the `toDOM` method from the
  // node type spec. But client code can use the `nodeViews` spec to
  // supply a custom node view, which can influence various aspects of
  // the way the node works.
  //
  // (Using subclassing for this was intentionally decided against,
  // since it'd require exposing a whole slew of finicky
  // implementation details to the user code that they probably will
  // never need.)
  static create(parent, node3, outerDeco, innerDeco, view, pos2) {
    let custom2 = view.nodeViews[node3.type.name], descObj;
    let spec = custom2 && custom2(node3, view, () => {
      if (!descObj)
        return pos2;
      if (descObj.parent)
        return descObj.parent.posBeforeChild(descObj);
    }, outerDeco, innerDeco);
    let dom = spec && spec.dom, contentDOM = spec && spec.contentDOM;
    if (node3.isText) {
      if (!dom)
        dom = document.createTextNode(node3.text);
      else if (dom.nodeType != 3)
        throw new RangeError("Text must be rendered as a DOM text node");
    } else if (!dom) {
      let spec2 = DOMSerializer.renderSpec(document, node3.type.spec.toDOM(node3), null, node3.attrs);
      ({ dom, contentDOM } = spec2);
    }
    if (!contentDOM && !node3.isText && dom.nodeName != "BR") {
      if (!dom.hasAttribute("contenteditable"))
        dom.contentEditable = "false";
      if (node3.type.spec.draggable)
        dom.draggable = true;
    }
    let nodeDOM = dom;
    dom = applyOuterDeco(dom, outerDeco, node3);
    if (spec)
      return descObj = new CustomNodeViewDesc(parent, node3, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, spec, view, pos2 + 1);
    else if (node3.isText)
      return new TextViewDesc(parent, node3, outerDeco, innerDeco, dom, nodeDOM, view);
    else
      return new NodeViewDesc(parent, node3, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, view, pos2 + 1);
  }
  parseRule() {
    if (this.node.type.spec.reparseInView)
      return null;
    let rule = { node: this.node.type.name, attrs: this.node.attrs };
    if (this.node.type.whitespace == "pre")
      rule.preserveWhitespace = "full";
    if (!this.contentDOM) {
      rule.getContent = () => this.node.content;
    } else if (!this.contentLost) {
      rule.contentElement = this.contentDOM;
    } else {
      for (let i2 = this.children.length - 1; i2 >= 0; i2--) {
        let child = this.children[i2];
        if (this.dom.contains(child.dom.parentNode)) {
          rule.contentElement = child.dom.parentNode;
          break;
        }
      }
      if (!rule.contentElement)
        rule.getContent = () => Fragment.empty;
    }
    return rule;
  }
  matchesNode(node3, outerDeco, innerDeco) {
    return this.dirty == NOT_DIRTY && node3.eq(this.node) && sameOuterDeco(outerDeco, this.outerDeco) && innerDeco.eq(this.innerDeco);
  }
  get size() {
    return this.node.nodeSize;
  }
  get border() {
    return this.node.isLeaf ? 0 : 1;
  }
  // Syncs `this.children` to match `this.node.content` and the local
  // decorations, possibly introducing nesting for marks. Then, in a
  // separate step, syncs the DOM inside `this.contentDOM` to
  // `this.children`.
  updateChildren(view, pos2) {
    let inline3 = this.node.inlineContent, off = pos2;
    let composition = view.composing ? this.localCompositionInfo(view, pos2) : null;
    let localComposition = composition && composition.pos > -1 ? composition : null;
    let compositionInChild = composition && composition.pos < 0;
    let updater = new ViewTreeUpdater(this, localComposition && localComposition.node, view);
    iterDeco(this.node, this.innerDeco, (widget2, i2, insideNode) => {
      if (widget2.spec.marks)
        updater.syncToMarks(widget2.spec.marks, inline3, view);
      else if (widget2.type.side >= 0 && !insideNode)
        updater.syncToMarks(i2 == this.node.childCount ? Mark$1.none : this.node.child(i2).marks, inline3, view);
      updater.placeWidget(widget2, view, off);
    }, (child, outerDeco, innerDeco, i2) => {
      updater.syncToMarks(child.marks, inline3, view);
      let compIndex;
      if (updater.findNodeMatch(child, outerDeco, innerDeco, i2)) ;
      else if (compositionInChild && view.state.selection.from > off && view.state.selection.to < off + child.nodeSize && (compIndex = updater.findIndexWithChild(composition.node)) > -1 && updater.updateNodeAt(child, outerDeco, innerDeco, compIndex, view)) ;
      else if (updater.updateNextNode(child, outerDeco, innerDeco, view, i2, off)) ;
      else {
        updater.addNode(child, outerDeco, innerDeco, view, off);
      }
      off += child.nodeSize;
    });
    updater.syncToMarks([], inline3, view);
    if (this.node.isTextblock)
      updater.addTextblockHacks();
    updater.destroyRest();
    if (updater.changed || this.dirty == CONTENT_DIRTY) {
      if (localComposition)
        this.protectLocalComposition(view, localComposition);
      renderDescs(this.contentDOM, this.children, view);
      if (ios)
        iosHacks(this.dom);
    }
  }
  localCompositionInfo(view, pos2) {
    let { from: from2, to } = view.state.selection;
    if (!(view.state.selection instanceof TextSelection) || from2 < pos2 || to > pos2 + this.node.content.size)
      return null;
    let textNode = view.input.compositionNode;
    if (!textNode || !this.dom.contains(textNode.parentNode))
      return null;
    if (this.node.inlineContent) {
      let text2 = textNode.nodeValue;
      let textPos = findTextInFragment(this.node.content, text2, from2 - pos2, to - pos2);
      return textPos < 0 ? null : { node: textNode, pos: textPos, text: text2 };
    } else {
      return { node: textNode, pos: -1, text: "" };
    }
  }
  protectLocalComposition(view, { node: node3, pos: pos2, text: text2 }) {
    if (this.getDesc(node3))
      return;
    let topNode = node3;
    for (; ; topNode = topNode.parentNode) {
      if (topNode.parentNode == this.contentDOM)
        break;
      while (topNode.previousSibling)
        topNode.parentNode.removeChild(topNode.previousSibling);
      while (topNode.nextSibling)
        topNode.parentNode.removeChild(topNode.nextSibling);
      if (topNode.pmViewDesc)
        topNode.pmViewDesc = void 0;
    }
    let desc = new CompositionViewDesc(this, topNode, node3, text2);
    view.input.compositionNodes.push(desc);
    this.children = replaceNodes(this.children, pos2, pos2 + text2.length, view, desc);
  }
  // If this desc must be updated to match the given node decoration,
  // do so and return true.
  update(node3, outerDeco, innerDeco, view) {
    if (this.dirty == NODE_DIRTY || !node3.sameMarkup(this.node))
      return false;
    this.updateInner(node3, outerDeco, innerDeco, view);
    return true;
  }
  updateInner(node3, outerDeco, innerDeco, view) {
    this.updateOuterDeco(outerDeco);
    this.node = node3;
    this.innerDeco = innerDeco;
    if (this.contentDOM)
      this.updateChildren(view, this.posAtStart);
    this.dirty = NOT_DIRTY;
  }
  updateOuterDeco(outerDeco) {
    if (sameOuterDeco(outerDeco, this.outerDeco))
      return;
    let needsWrap = this.nodeDOM.nodeType != 1;
    let oldDOM = this.dom;
    this.dom = patchOuterDeco(this.dom, this.nodeDOM, computeOuterDeco(this.outerDeco, this.node, needsWrap), computeOuterDeco(outerDeco, this.node, needsWrap));
    if (this.dom != oldDOM) {
      oldDOM.pmViewDesc = void 0;
      this.dom.pmViewDesc = this;
    }
    this.outerDeco = outerDeco;
  }
  // Mark this node as being the selected node.
  selectNode() {
    if (this.nodeDOM.nodeType == 1)
      this.nodeDOM.classList.add("ProseMirror-selectednode");
    if (this.contentDOM || !this.node.type.spec.draggable)
      this.dom.draggable = true;
  }
  // Remove selected node marking from this node.
  deselectNode() {
    if (this.nodeDOM.nodeType == 1) {
      this.nodeDOM.classList.remove("ProseMirror-selectednode");
      if (this.contentDOM || !this.node.type.spec.draggable)
        this.dom.removeAttribute("draggable");
    }
  }
  get domAtom() {
    return this.node.isAtom;
  }
}
function docViewDesc(doc2, outerDeco, innerDeco, dom, view) {
  applyOuterDeco(dom, outerDeco, doc2);
  let docView = new NodeViewDesc(void 0, doc2, outerDeco, innerDeco, dom, dom, dom, view, 0);
  if (docView.contentDOM)
    docView.updateChildren(view, 0);
  return docView;
}
__name(docViewDesc, "docViewDesc");
class TextViewDesc extends NodeViewDesc {
  static {
    __name(this, "TextViewDesc");
  }
  constructor(parent, node3, outerDeco, innerDeco, dom, nodeDOM, view) {
    super(parent, node3, outerDeco, innerDeco, dom, null, nodeDOM, view, 0);
  }
  parseRule() {
    let skip = this.nodeDOM.parentNode;
    while (skip && skip != this.dom && !skip.pmIsDeco)
      skip = skip.parentNode;
    return { skip: skip || true };
  }
  update(node3, outerDeco, innerDeco, view) {
    if (this.dirty == NODE_DIRTY || this.dirty != NOT_DIRTY && !this.inParent() || !node3.sameMarkup(this.node))
      return false;
    this.updateOuterDeco(outerDeco);
    if ((this.dirty != NOT_DIRTY || node3.text != this.node.text) && node3.text != this.nodeDOM.nodeValue) {
      this.nodeDOM.nodeValue = node3.text;
      if (view.trackWrites == this.nodeDOM)
        view.trackWrites = null;
    }
    this.node = node3;
    this.dirty = NOT_DIRTY;
    return true;
  }
  inParent() {
    let parentDOM = this.parent.contentDOM;
    for (let n = this.nodeDOM; n; n = n.parentNode)
      if (n == parentDOM)
        return true;
    return false;
  }
  domFromPos(pos2) {
    return { node: this.nodeDOM, offset: pos2 };
  }
  localPosFromDOM(dom, offset, bias) {
    if (dom == this.nodeDOM)
      return this.posAtStart + Math.min(offset, this.node.text.length);
    return super.localPosFromDOM(dom, offset, bias);
  }
  ignoreMutation(mutation) {
    return mutation.type != "characterData" && mutation.type != "selection";
  }
  slice(from2, to, view) {
    let node3 = this.node.cut(from2, to), dom = document.createTextNode(node3.text);
    return new TextViewDesc(this.parent, node3, this.outerDeco, this.innerDeco, dom, dom, view);
  }
  markDirty(from2, to) {
    super.markDirty(from2, to);
    if (this.dom != this.nodeDOM && (from2 == 0 || to == this.nodeDOM.nodeValue.length))
      this.dirty = NODE_DIRTY;
  }
  get domAtom() {
    return false;
  }
  isText(text2) {
    return this.node.text == text2;
  }
}
class TrailingHackViewDesc extends ViewDesc {
  static {
    __name(this, "TrailingHackViewDesc");
  }
  parseRule() {
    return { ignore: true };
  }
  matchesHack(nodeName) {
    return this.dirty == NOT_DIRTY && this.dom.nodeName == nodeName;
  }
  get domAtom() {
    return true;
  }
  get ignoreForCoords() {
    return this.dom.nodeName == "IMG";
  }
}
class CustomNodeViewDesc extends NodeViewDesc {
  static {
    __name(this, "CustomNodeViewDesc");
  }
  constructor(parent, node3, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec, view, pos2) {
    super(parent, node3, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos2);
    this.spec = spec;
  }
  // A custom `update` method gets to decide whether the update goes
  // through. If it does, and there's a `contentDOM` node, our logic
  // updates the children.
  update(node3, outerDeco, innerDeco, view) {
    if (this.dirty == NODE_DIRTY)
      return false;
    if (this.spec.update && (this.node.type == node3.type || this.spec.multiType)) {
      let result = this.spec.update(node3, outerDeco, innerDeco);
      if (result)
        this.updateInner(node3, outerDeco, innerDeco, view);
      return result;
    } else if (!this.contentDOM && !node3.isLeaf) {
      return false;
    } else {
      return super.update(node3, outerDeco, innerDeco, view);
    }
  }
  selectNode() {
    this.spec.selectNode ? this.spec.selectNode() : super.selectNode();
  }
  deselectNode() {
    this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();
  }
  setSelection(anchor, head, view, force) {
    this.spec.setSelection ? this.spec.setSelection(anchor, head, view.root) : super.setSelection(anchor, head, view, force);
  }
  destroy() {
    if (this.spec.destroy)
      this.spec.destroy();
    super.destroy();
  }
  stopEvent(event) {
    return this.spec.stopEvent ? this.spec.stopEvent(event) : false;
  }
  ignoreMutation(mutation) {
    return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);
  }
}
function renderDescs(parentDOM, descs, view) {
  let dom = parentDOM.firstChild, written = false;
  for (let i2 = 0; i2 < descs.length; i2++) {
    let desc = descs[i2], childDOM = desc.dom;
    if (childDOM.parentNode == parentDOM) {
      while (childDOM != dom) {
        dom = rm(dom);
        written = true;
      }
      dom = dom.nextSibling;
    } else {
      written = true;
      parentDOM.insertBefore(childDOM, dom);
    }
    if (desc instanceof MarkViewDesc) {
      let pos2 = dom ? dom.previousSibling : parentDOM.lastChild;
      renderDescs(desc.contentDOM, desc.children, view);
      dom = pos2 ? pos2.nextSibling : parentDOM.firstChild;
    }
  }
  while (dom) {
    dom = rm(dom);
    written = true;
  }
  if (written && view.trackWrites == parentDOM)
    view.trackWrites = null;
}
__name(renderDescs, "renderDescs");
const OuterDecoLevel = /* @__PURE__ */ __name(function(nodeName) {
  if (nodeName)
    this.nodeName = nodeName;
}, "OuterDecoLevel");
OuterDecoLevel.prototype = /* @__PURE__ */ Object.create(null);
const noDeco = [new OuterDecoLevel()];
function computeOuterDeco(outerDeco, node3, needsWrap) {
  if (outerDeco.length == 0)
    return noDeco;
  let top = needsWrap ? noDeco[0] : new OuterDecoLevel(), result = [top];
  for (let i2 = 0; i2 < outerDeco.length; i2++) {
    let attrs4 = outerDeco[i2].type.attrs;
    if (!attrs4)
      continue;
    if (attrs4.nodeName)
      result.push(top = new OuterDecoLevel(attrs4.nodeName));
    for (let name2 in attrs4) {
      let val = attrs4[name2];
      if (val == null)
        continue;
      if (needsWrap && result.length == 1)
        result.push(top = new OuterDecoLevel(node3.isInline ? "span" : "div"));
      if (name2 == "class")
        top.class = (top.class ? top.class + " " : "") + val;
      else if (name2 == "style")
        top.style = (top.style ? top.style + ";" : "") + val;
      else if (name2 != "nodeName")
        top[name2] = val;
    }
  }
  return result;
}
__name(computeOuterDeco, "computeOuterDeco");
function patchOuterDeco(outerDOM, nodeDOM, prevComputed, curComputed) {
  if (prevComputed == noDeco && curComputed == noDeco)
    return nodeDOM;
  let curDOM = nodeDOM;
  for (let i2 = 0; i2 < curComputed.length; i2++) {
    let deco = curComputed[i2], prev2 = prevComputed[i2];
    if (i2) {
      let parent;
      if (prev2 && prev2.nodeName == deco.nodeName && curDOM != outerDOM && (parent = curDOM.parentNode) && parent.nodeName.toLowerCase() == deco.nodeName) {
        curDOM = parent;
      } else {
        parent = document.createElement(deco.nodeName);
        parent.pmIsDeco = true;
        parent.appendChild(curDOM);
        prev2 = noDeco[0];
        curDOM = parent;
      }
    }
    patchAttributes(curDOM, prev2 || noDeco[0], deco);
  }
  return curDOM;
}
__name(patchOuterDeco, "patchOuterDeco");
function patchAttributes(dom, prev2, cur) {
  for (let name2 in prev2)
    if (name2 != "class" && name2 != "style" && name2 != "nodeName" && !(name2 in cur))
      dom.removeAttribute(name2);
  for (let name2 in cur)
    if (name2 != "class" && name2 != "style" && name2 != "nodeName" && cur[name2] != prev2[name2])
      dom.setAttribute(name2, cur[name2]);
  if (prev2.class != cur.class) {
    let prevList = prev2.class ? prev2.class.split(" ").filter(Boolean) : [];
    let curList = cur.class ? cur.class.split(" ").filter(Boolean) : [];
    for (let i2 = 0; i2 < prevList.length; i2++)
      if (curList.indexOf(prevList[i2]) == -1)
        dom.classList.remove(prevList[i2]);
    for (let i2 = 0; i2 < curList.length; i2++)
      if (prevList.indexOf(curList[i2]) == -1)
        dom.classList.add(curList[i2]);
    if (dom.classList.length == 0)
      dom.removeAttribute("class");
  }
  if (prev2.style != cur.style) {
    if (prev2.style) {
      let prop2 = /\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g, m;
      while (m = prop2.exec(prev2.style))
        dom.style.removeProperty(m[1]);
    }
    if (cur.style)
      dom.style.cssText += cur.style;
  }
}
__name(patchAttributes, "patchAttributes");
function applyOuterDeco(dom, deco, node3) {
  return patchOuterDeco(dom, dom, noDeco, computeOuterDeco(deco, node3, dom.nodeType != 1));
}
__name(applyOuterDeco, "applyOuterDeco");
function sameOuterDeco(a, b) {
  if (a.length != b.length)
    return false;
  for (let i2 = 0; i2 < a.length; i2++)
    if (!a[i2].type.eq(b[i2].type))
      return false;
  return true;
}
__name(sameOuterDeco, "sameOuterDeco");
function rm(dom) {
  let next2 = dom.nextSibling;
  dom.parentNode.removeChild(dom);
  return next2;
}
__name(rm, "rm");
class ViewTreeUpdater {
  static {
    __name(this, "ViewTreeUpdater");
  }
  constructor(top, lock, view) {
    this.lock = lock;
    this.view = view;
    this.index = 0;
    this.stack = [];
    this.changed = false;
    this.top = top;
    this.preMatch = preMatch(top.node.content, top);
  }
  // Destroy and remove the children between the given indices in
  // `this.top`.
  destroyBetween(start2, end) {
    if (start2 == end)
      return;
    for (let i2 = start2; i2 < end; i2++)
      this.top.children[i2].destroy();
    this.top.children.splice(start2, end - start2);
    this.changed = true;
  }
  // Destroy all remaining children in `this.top`.
  destroyRest() {
    this.destroyBetween(this.index, this.top.children.length);
  }
  // Sync the current stack of mark descs with the given array of
  // marks, reusing existing mark descs when possible.
  syncToMarks(marks, inline3, view) {
    let keep = 0, depth = this.stack.length >> 1;
    let maxKeep = Math.min(depth, marks.length);
    while (keep < maxKeep && (keep == depth - 1 ? this.top : this.stack[keep + 1 << 1]).matchesMark(marks[keep]) && marks[keep].type.spec.spanning !== false)
      keep++;
    while (keep < depth) {
      this.destroyRest();
      this.top.dirty = NOT_DIRTY;
      this.index = this.stack.pop();
      this.top = this.stack.pop();
      depth--;
    }
    while (depth < marks.length) {
      this.stack.push(this.top, this.index + 1);
      let found2 = -1;
      for (let i2 = this.index; i2 < Math.min(this.index + 3, this.top.children.length); i2++) {
        let next2 = this.top.children[i2];
        if (next2.matchesMark(marks[depth]) && !this.isLocked(next2.dom)) {
          found2 = i2;
          break;
        }
      }
      if (found2 > -1) {
        if (found2 > this.index) {
          this.changed = true;
          this.destroyBetween(this.index, found2);
        }
        this.top = this.top.children[this.index];
      } else {
        let markDesc = MarkViewDesc.create(this.top, marks[depth], inline3, view);
        this.top.children.splice(this.index, 0, markDesc);
        this.top = markDesc;
        this.changed = true;
      }
      this.index = 0;
      depth++;
    }
  }
  // Try to find a node desc matching the given data. Skip over it and
  // return true when successful.
  findNodeMatch(node3, outerDeco, innerDeco, index2) {
    let found2 = -1, targetDesc;
    if (index2 >= this.preMatch.index && (targetDesc = this.preMatch.matches[index2 - this.preMatch.index]).parent == this.top && targetDesc.matchesNode(node3, outerDeco, innerDeco)) {
      found2 = this.top.children.indexOf(targetDesc, this.index);
    } else {
      for (let i2 = this.index, e2 = Math.min(this.top.children.length, i2 + 5); i2 < e2; i2++) {
        let child = this.top.children[i2];
        if (child.matchesNode(node3, outerDeco, innerDeco) && !this.preMatch.matched.has(child)) {
          found2 = i2;
          break;
        }
      }
    }
    if (found2 < 0)
      return false;
    this.destroyBetween(this.index, found2);
    this.index++;
    return true;
  }
  updateNodeAt(node3, outerDeco, innerDeco, index2, view) {
    let child = this.top.children[index2];
    if (child.dirty == NODE_DIRTY && child.dom == child.contentDOM)
      child.dirty = CONTENT_DIRTY;
    if (!child.update(node3, outerDeco, innerDeco, view))
      return false;
    this.destroyBetween(this.index, index2);
    this.index++;
    return true;
  }
  findIndexWithChild(domNode) {
    for (; ; ) {
      let parent = domNode.parentNode;
      if (!parent)
        return -1;
      if (parent == this.top.contentDOM) {
        let desc = domNode.pmViewDesc;
        if (desc)
          for (let i2 = this.index; i2 < this.top.children.length; i2++) {
            if (this.top.children[i2] == desc)
              return i2;
          }
        return -1;
      }
      domNode = parent;
    }
  }
  // Try to update the next node, if any, to the given data. Checks
  // pre-matches to avoid overwriting nodes that could still be used.
  updateNextNode(node3, outerDeco, innerDeco, view, index2, pos2) {
    for (let i2 = this.index; i2 < this.top.children.length; i2++) {
      let next2 = this.top.children[i2];
      if (next2 instanceof NodeViewDesc) {
        let preMatch2 = this.preMatch.matched.get(next2);
        if (preMatch2 != null && preMatch2 != index2)
          return false;
        let nextDOM = next2.dom, updated13;
        let locked = this.isLocked(nextDOM) && !(node3.isText && next2.node && next2.node.isText && next2.nodeDOM.nodeValue == node3.text && next2.dirty != NODE_DIRTY && sameOuterDeco(outerDeco, next2.outerDeco));
        if (!locked && next2.update(node3, outerDeco, innerDeco, view)) {
          this.destroyBetween(this.index, i2);
          if (next2.dom != nextDOM)
            this.changed = true;
          this.index++;
          return true;
        } else if (!locked && (updated13 = this.recreateWrapper(next2, node3, outerDeco, innerDeco, view, pos2))) {
          this.destroyBetween(this.index, i2);
          this.top.children[this.index] = updated13;
          if (updated13.contentDOM) {
            updated13.dirty = CONTENT_DIRTY;
            updated13.updateChildren(view, pos2 + 1);
            updated13.dirty = NOT_DIRTY;
          }
          this.changed = true;
          this.index++;
          return true;
        }
        break;
      }
    }
    return false;
  }
  // When a node with content is replaced by a different node with
  // identical content, move over its children.
  recreateWrapper(next2, node3, outerDeco, innerDeco, view, pos2) {
    if (next2.dirty || node3.isAtom || !next2.children.length || !next2.node.content.eq(node3.content) || !sameOuterDeco(outerDeco, next2.outerDeco) || !innerDeco.eq(next2.innerDeco))
      return null;
    let wrapper = NodeViewDesc.create(this.top, node3, outerDeco, innerDeco, view, pos2);
    if (wrapper.contentDOM) {
      wrapper.children = next2.children;
      next2.children = [];
      for (let ch of wrapper.children)
        ch.parent = wrapper;
    }
    next2.destroy();
    return wrapper;
  }
  // Insert the node as a newly created node desc.
  addNode(node3, outerDeco, innerDeco, view, pos2) {
    let desc = NodeViewDesc.create(this.top, node3, outerDeco, innerDeco, view, pos2);
    if (desc.contentDOM)
      desc.updateChildren(view, pos2 + 1);
    this.top.children.splice(this.index++, 0, desc);
    this.changed = true;
  }
  placeWidget(widget2, view, pos2) {
    let next2 = this.index < this.top.children.length ? this.top.children[this.index] : null;
    if (next2 && next2.matchesWidget(widget2) && (widget2 == next2.widget || !next2.widget.type.toDOM.parentNode)) {
      this.index++;
    } else {
      let desc = new WidgetViewDesc(this.top, widget2, view, pos2);
      this.top.children.splice(this.index++, 0, desc);
      this.changed = true;
    }
  }
  // Make sure a textblock looks and behaves correctly in
  // contentEditable.
  addTextblockHacks() {
    let lastChild = this.top.children[this.index - 1], parent = this.top;
    while (lastChild instanceof MarkViewDesc) {
      parent = lastChild;
      lastChild = parent.children[parent.children.length - 1];
    }
    if (!lastChild || // Empty textblock
    !(lastChild instanceof TextViewDesc) || /\n$/.test(lastChild.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(lastChild.node.text)) {
      if ((safari || chrome) && lastChild && lastChild.dom.contentEditable == "false")
        this.addHackNode("IMG", parent);
      this.addHackNode("BR", this.top);
    }
  }
  addHackNode(nodeName, parent) {
    if (parent == this.top && this.index < parent.children.length && parent.children[this.index].matchesHack(nodeName)) {
      this.index++;
    } else {
      let dom = document.createElement(nodeName);
      if (nodeName == "IMG") {
        dom.className = "ProseMirror-separator";
        dom.alt = "";
      }
      if (nodeName == "BR")
        dom.className = "ProseMirror-trailingBreak";
      let hack = new TrailingHackViewDesc(this.top, [], dom, null);
      if (parent != this.top)
        parent.children.push(hack);
      else
        parent.children.splice(this.index++, 0, hack);
      this.changed = true;
    }
  }
  isLocked(node3) {
    return this.lock && (node3 == this.lock || node3.nodeType == 1 && node3.contains(this.lock.parentNode));
  }
}
function preMatch(frag, parentDesc) {
  let curDesc = parentDesc, descI = curDesc.children.length;
  let fI = frag.childCount, matched = /* @__PURE__ */ new Map(), matches2 = [];
  outer: while (fI > 0) {
    let desc;
    for (; ; ) {
      if (descI) {
        let next2 = curDesc.children[descI - 1];
        if (next2 instanceof MarkViewDesc) {
          curDesc = next2;
          descI = next2.children.length;
        } else {
          desc = next2;
          descI--;
          break;
        }
      } else if (curDesc == parentDesc) {
        break outer;
      } else {
        descI = curDesc.parent.children.indexOf(curDesc);
        curDesc = curDesc.parent;
      }
    }
    let node3 = desc.node;
    if (!node3)
      continue;
    if (node3 != frag.child(fI - 1))
      break;
    --fI;
    matched.set(desc, fI);
    matches2.push(desc);
  }
  return { index: fI, matched, matches: matches2.reverse() };
}
__name(preMatch, "preMatch");
function compareSide(a, b) {
  return a.type.side - b.type.side;
}
__name(compareSide, "compareSide");
function iterDeco(parent, deco, onWidget, onNode) {
  let locals = deco.locals(parent), offset = 0;
  if (locals.length == 0) {
    for (let i2 = 0; i2 < parent.childCount; i2++) {
      let child = parent.child(i2);
      onNode(child, locals, deco.forChild(offset, child), i2);
      offset += child.nodeSize;
    }
    return;
  }
  let decoIndex = 0, active3 = [], restNode = null;
  for (let parentIndex = 0; ; ) {
    let widget2, widgets;
    while (decoIndex < locals.length && locals[decoIndex].to == offset) {
      let next2 = locals[decoIndex++];
      if (next2.widget) {
        if (!widget2)
          widget2 = next2;
        else
          (widgets || (widgets = [widget2])).push(next2);
      }
    }
    if (widget2) {
      if (widgets) {
        widgets.sort(compareSide);
        for (let i2 = 0; i2 < widgets.length; i2++)
          onWidget(widgets[i2], parentIndex, !!restNode);
      } else {
        onWidget(widget2, parentIndex, !!restNode);
      }
    }
    let child, index2;
    if (restNode) {
      index2 = -1;
      child = restNode;
      restNode = null;
    } else if (parentIndex < parent.childCount) {
      index2 = parentIndex;
      child = parent.child(parentIndex++);
    } else {
      break;
    }
    for (let i2 = 0; i2 < active3.length; i2++)
      if (active3[i2].to <= offset)
        active3.splice(i2--, 1);
    while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset)
      active3.push(locals[decoIndex++]);
    let end = offset + child.nodeSize;
    if (child.isText) {
      let cutAt = end;
      if (decoIndex < locals.length && locals[decoIndex].from < cutAt)
        cutAt = locals[decoIndex].from;
      for (let i2 = 0; i2 < active3.length; i2++)
        if (active3[i2].to < cutAt)
          cutAt = active3[i2].to;
      if (cutAt < end) {
        restNode = child.cut(cutAt - offset);
        child = child.cut(0, cutAt - offset);
        end = cutAt;
        index2 = -1;
      }
    } else {
      while (decoIndex < locals.length && locals[decoIndex].to < end)
        decoIndex++;
    }
    let outerDeco = child.isInline && !child.isLeaf ? active3.filter((d) => !d.inline) : active3.slice();
    onNode(child, outerDeco, deco.forChild(offset, child), index2);
    offset = end;
  }
}
__name(iterDeco, "iterDeco");
function iosHacks(dom) {
  if (dom.nodeName == "UL" || dom.nodeName == "OL") {
    let oldCSS = dom.style.cssText;
    dom.style.cssText = oldCSS + "; list-style: square !important";
    window.getComputedStyle(dom).listStyle;
    dom.style.cssText = oldCSS;
  }
}
__name(iosHacks, "iosHacks");
function findTextInFragment(frag, text2, from2, to) {
  for (let i2 = 0, pos2 = 0; i2 < frag.childCount && pos2 <= to; ) {
    let child = frag.child(i2++), childStart = pos2;
    pos2 += child.nodeSize;
    if (!child.isText)
      continue;
    let str = child.text;
    while (i2 < frag.childCount) {
      let next2 = frag.child(i2++);
      pos2 += next2.nodeSize;
      if (!next2.isText)
        break;
      str += next2.text;
    }
    if (pos2 >= from2) {
      if (pos2 >= to && str.slice(to - text2.length - childStart, to - childStart) == text2)
        return to - text2.length;
      let found2 = childStart < to ? str.lastIndexOf(text2, to - childStart - 1) : -1;
      if (found2 >= 0 && found2 + text2.length + childStart >= from2)
        return childStart + found2;
      if (from2 == to && str.length >= to + text2.length - childStart && str.slice(to - childStart, to - childStart + text2.length) == text2)
        return to;
    }
  }
  return -1;
}
__name(findTextInFragment, "findTextInFragment");
function replaceNodes(nodes, from2, to, view, replacement) {
  let result = [];
  for (let i2 = 0, off = 0; i2 < nodes.length; i2++) {
    let child = nodes[i2], start2 = off, end = off += child.size;
    if (start2 >= to || end <= from2) {
      result.push(child);
    } else {
      if (start2 < from2)
        result.push(child.slice(0, from2 - start2, view));
      if (replacement) {
        result.push(replacement);
        replacement = void 0;
      }
      if (end > to)
        result.push(child.slice(to - start2, child.size, view));
    }
  }
  return result;
}
__name(replaceNodes, "replaceNodes");
function selectionFromDOM(view, origin2 = null) {
  let domSel = view.domSelectionRange(), doc2 = view.state.doc;
  if (!domSel.focusNode)
    return null;
  let nearestDesc = view.docView.nearestDesc(domSel.focusNode), inWidget = nearestDesc && nearestDesc.size == 0;
  let head = view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset, 1);
  if (head < 0)
    return null;
  let $head = doc2.resolve(head), anchor, selection;
  if (selectionCollapsed(domSel)) {
    anchor = head;
    while (nearestDesc && !nearestDesc.node)
      nearestDesc = nearestDesc.parent;
    let nearestDescNode = nearestDesc.node;
    if (nearestDesc && nearestDescNode.isAtom && NodeSelection.isSelectable(nearestDescNode) && nearestDesc.parent && !(nearestDescNode.isInline && isOnEdge(domSel.focusNode, domSel.focusOffset, nearestDesc.dom))) {
      let pos2 = nearestDesc.posBefore;
      selection = new NodeSelection(head == pos2 ? $head : doc2.resolve(pos2));
    }
  } else {
    if (domSel instanceof view.dom.ownerDocument.defaultView.Selection && domSel.rangeCount > 1) {
      let min = head, max = head;
      for (let i2 = 0; i2 < domSel.rangeCount; i2++) {
        let range2 = domSel.getRangeAt(i2);
        min = Math.min(min, view.docView.posFromDOM(range2.startContainer, range2.startOffset, 1));
        max = Math.max(max, view.docView.posFromDOM(range2.endContainer, range2.endOffset, -1));
      }
      if (min < 0)
        return null;
      [anchor, head] = max == view.state.selection.anchor ? [max, min] : [min, max];
      $head = doc2.resolve(head);
    } else {
      anchor = view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset, 1);
    }
    if (anchor < 0)
      return null;
  }
  let $anchor = doc2.resolve(anchor);
  if (!selection) {
    let bias = origin2 == "pointer" || view.state.selection.head < $head.pos && !inWidget ? 1 : -1;
    selection = selectionBetween(view, $anchor, $head, bias);
  }
  return selection;
}
__name(selectionFromDOM, "selectionFromDOM");
function editorOwnsSelection(view) {
  return view.editable ? view.hasFocus() : hasSelection(view) && document.activeElement && document.activeElement.contains(view.dom);
}
__name(editorOwnsSelection, "editorOwnsSelection");
function selectionToDOM(view, force = false) {
  let sel = view.state.selection;
  syncNodeSelection(view, sel);
  if (!editorOwnsSelection(view))
    return;
  if (!force && view.input.mouseDown && view.input.mouseDown.allowDefault && chrome) {
    let domSel = view.domSelectionRange(), curSel = view.domObserver.currentSelection;
    if (domSel.anchorNode && curSel.anchorNode && isEquivalentPosition(domSel.anchorNode, domSel.anchorOffset, curSel.anchorNode, curSel.anchorOffset)) {
      view.input.mouseDown.delayedSelectionSync = true;
      view.domObserver.setCurSelection();
      return;
    }
  }
  view.domObserver.disconnectSelection();
  if (view.cursorWrapper) {
    selectCursorWrapper(view);
  } else {
    let { anchor, head } = sel, resetEditableFrom, resetEditableTo;
    if (brokenSelectBetweenUneditable && !(sel instanceof TextSelection)) {
      if (!sel.$from.parent.inlineContent)
        resetEditableFrom = temporarilyEditableNear(view, sel.from);
      if (!sel.empty && !sel.$from.parent.inlineContent)
        resetEditableTo = temporarilyEditableNear(view, sel.to);
    }
    view.docView.setSelection(anchor, head, view, force);
    if (brokenSelectBetweenUneditable) {
      if (resetEditableFrom)
        resetEditable(resetEditableFrom);
      if (resetEditableTo)
        resetEditable(resetEditableTo);
    }
    if (sel.visible) {
      view.dom.classList.remove("ProseMirror-hideselection");
    } else {
      view.dom.classList.add("ProseMirror-hideselection");
      if ("onselectionchange" in document)
        removeClassOnSelectionChange(view);
    }
  }
  view.domObserver.setCurSelection();
  view.domObserver.connectSelection();
}
__name(selectionToDOM, "selectionToDOM");
const brokenSelectBetweenUneditable = safari || chrome && chrome_version < 63;
function temporarilyEditableNear(view, pos2) {
  let { node: node3, offset } = view.docView.domFromPos(pos2, 0);
  let after = offset < node3.childNodes.length ? node3.childNodes[offset] : null;
  let before = offset ? node3.childNodes[offset - 1] : null;
  if (safari && after && after.contentEditable == "false")
    return setEditable(after);
  if ((!after || after.contentEditable == "false") && (!before || before.contentEditable == "false")) {
    if (after)
      return setEditable(after);
    else if (before)
      return setEditable(before);
  }
}
__name(temporarilyEditableNear, "temporarilyEditableNear");
function setEditable(element) {
  element.contentEditable = "true";
  if (safari && element.draggable) {
    element.draggable = false;
    element.wasDraggable = true;
  }
  return element;
}
__name(setEditable, "setEditable");
function resetEditable(element) {
  element.contentEditable = "false";
  if (element.wasDraggable) {
    element.draggable = true;
    element.wasDraggable = null;
  }
}
__name(resetEditable, "resetEditable");
function removeClassOnSelectionChange(view) {
  let doc2 = view.dom.ownerDocument;
  doc2.removeEventListener("selectionchange", view.input.hideSelectionGuard);
  let domSel = view.domSelectionRange();
  let node3 = domSel.anchorNode, offset = domSel.anchorOffset;
  doc2.addEventListener("selectionchange", view.input.hideSelectionGuard = () => {
    if (domSel.anchorNode != node3 || domSel.anchorOffset != offset) {
      doc2.removeEventListener("selectionchange", view.input.hideSelectionGuard);
      setTimeout(() => {
        if (!editorOwnsSelection(view) || view.state.selection.visible)
          view.dom.classList.remove("ProseMirror-hideselection");
      }, 20);
    }
  });
}
__name(removeClassOnSelectionChange, "removeClassOnSelectionChange");
function selectCursorWrapper(view) {
  let domSel = view.domSelection(), range2 = document.createRange();
  if (!domSel)
    return;
  let node3 = view.cursorWrapper.dom, img = node3.nodeName == "IMG";
  if (img)
    range2.setStart(node3.parentNode, domIndex(node3) + 1);
  else
    range2.setStart(node3, 0);
  range2.collapse(true);
  domSel.removeAllRanges();
  domSel.addRange(range2);
  if (!img && !view.state.selection.visible && ie$1 && ie_version <= 11) {
    node3.disabled = true;
    node3.disabled = false;
  }
}
__name(selectCursorWrapper, "selectCursorWrapper");
function syncNodeSelection(view, sel) {
  if (sel instanceof NodeSelection) {
    let desc = view.docView.descAt(sel.from);
    if (desc != view.lastSelectedViewDesc) {
      clearNodeSelection(view);
      if (desc)
        desc.selectNode();
      view.lastSelectedViewDesc = desc;
    }
  } else {
    clearNodeSelection(view);
  }
}
__name(syncNodeSelection, "syncNodeSelection");
function clearNodeSelection(view) {
  if (view.lastSelectedViewDesc) {
    if (view.lastSelectedViewDesc.parent)
      view.lastSelectedViewDesc.deselectNode();
    view.lastSelectedViewDesc = void 0;
  }
}
__name(clearNodeSelection, "clearNodeSelection");
function selectionBetween(view, $anchor, $head, bias) {
  return view.someProp("createSelectionBetween", (f) => f(view, $anchor, $head)) || TextSelection.between($anchor, $head, bias);
}
__name(selectionBetween, "selectionBetween");
function hasFocusAndSelection(view) {
  if (view.editable && !view.hasFocus())
    return false;
  return hasSelection(view);
}
__name(hasFocusAndSelection, "hasFocusAndSelection");
function hasSelection(view) {
  let sel = view.domSelectionRange();
  if (!sel.anchorNode)
    return false;
  try {
    return view.dom.contains(sel.anchorNode.nodeType == 3 ? sel.anchorNode.parentNode : sel.anchorNode) && (view.editable || view.dom.contains(sel.focusNode.nodeType == 3 ? sel.focusNode.parentNode : sel.focusNode));
  } catch (_2) {
    return false;
  }
}
__name(hasSelection, "hasSelection");
function anchorInRightPlace(view) {
  let anchorDOM = view.docView.domFromPos(view.state.selection.anchor, 0);
  let domSel = view.domSelectionRange();
  return isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset);
}
__name(anchorInRightPlace, "anchorInRightPlace");
function moveSelectionBlock(state, dir) {
  let { $anchor, $head } = state.selection;
  let $side = dir > 0 ? $anchor.max($head) : $anchor.min($head);
  let $start = !$side.parent.inlineContent ? $side : $side.depth ? state.doc.resolve(dir > 0 ? $side.after() : $side.before()) : null;
  return $start && Selection.findFrom($start, dir);
}
__name(moveSelectionBlock, "moveSelectionBlock");
function apply(view, sel) {
  view.dispatch(view.state.tr.setSelection(sel).scrollIntoView());
  return true;
}
__name(apply, "apply");
function selectHorizontally(view, dir, mods) {
  let sel = view.state.selection;
  if (sel instanceof TextSelection) {
    if (mods.indexOf("s") > -1) {
      let { $head } = sel, node3 = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter;
      if (!node3 || node3.isText || !node3.isLeaf)
        return false;
      let $newHead = view.state.doc.resolve($head.pos + node3.nodeSize * (dir < 0 ? -1 : 1));
      return apply(view, new TextSelection(sel.$anchor, $newHead));
    } else if (!sel.empty) {
      return false;
    } else if (view.endOfTextblock(dir > 0 ? "forward" : "backward")) {
      let next2 = moveSelectionBlock(view.state, dir);
      if (next2 && next2 instanceof NodeSelection)
        return apply(view, next2);
      return false;
    } else if (!(mac$3 && mods.indexOf("m") > -1)) {
      let $head = sel.$head, node3 = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter, desc;
      if (!node3 || node3.isText)
        return false;
      let nodePos = dir < 0 ? $head.pos - node3.nodeSize : $head.pos;
      if (!(node3.isAtom || (desc = view.docView.descAt(nodePos)) && !desc.contentDOM))
        return false;
      if (NodeSelection.isSelectable(node3)) {
        return apply(view, new NodeSelection(dir < 0 ? view.state.doc.resolve($head.pos - node3.nodeSize) : $head));
      } else if (webkit) {
        return apply(view, new TextSelection(view.state.doc.resolve(dir < 0 ? nodePos : nodePos + node3.nodeSize)));
      } else {
        return false;
      }
    }
  } else if (sel instanceof NodeSelection && sel.node.isInline) {
    return apply(view, new TextSelection(dir > 0 ? sel.$to : sel.$from));
  } else {
    let next2 = moveSelectionBlock(view.state, dir);
    if (next2)
      return apply(view, next2);
    return false;
  }
}
__name(selectHorizontally, "selectHorizontally");
function nodeLen(node3) {
  return node3.nodeType == 3 ? node3.nodeValue.length : node3.childNodes.length;
}
__name(nodeLen, "nodeLen");
function isIgnorable(dom, dir) {
  let desc = dom.pmViewDesc;
  return desc && desc.size == 0 && (dir < 0 || dom.nextSibling || dom.nodeName != "BR");
}
__name(isIgnorable, "isIgnorable");
function skipIgnoredNodes(view, dir) {
  return dir < 0 ? skipIgnoredNodesBefore(view) : skipIgnoredNodesAfter(view);
}
__name(skipIgnoredNodes, "skipIgnoredNodes");
function skipIgnoredNodesBefore(view) {
  let sel = view.domSelectionRange();
  let node3 = sel.focusNode, offset = sel.focusOffset;
  if (!node3)
    return;
  let moveNode, moveOffset, force = false;
  if (gecko && node3.nodeType == 1 && offset < nodeLen(node3) && isIgnorable(node3.childNodes[offset], -1))
    force = true;
  for (; ; ) {
    if (offset > 0) {
      if (node3.nodeType != 1) {
        break;
      } else {
        let before = node3.childNodes[offset - 1];
        if (isIgnorable(before, -1)) {
          moveNode = node3;
          moveOffset = --offset;
        } else if (before.nodeType == 3) {
          node3 = before;
          offset = node3.nodeValue.length;
        } else
          break;
      }
    } else if (isBlockNode(node3)) {
      break;
    } else {
      let prev2 = node3.previousSibling;
      while (prev2 && isIgnorable(prev2, -1)) {
        moveNode = node3.parentNode;
        moveOffset = domIndex(prev2);
        prev2 = prev2.previousSibling;
      }
      if (!prev2) {
        node3 = node3.parentNode;
        if (node3 == view.dom)
          break;
        offset = 0;
      } else {
        node3 = prev2;
        offset = nodeLen(node3);
      }
    }
  }
  if (force)
    setSelFocus(view, node3, offset);
  else if (moveNode)
    setSelFocus(view, moveNode, moveOffset);
}
__name(skipIgnoredNodesBefore, "skipIgnoredNodesBefore");
function skipIgnoredNodesAfter(view) {
  let sel = view.domSelectionRange();
  let node3 = sel.focusNode, offset = sel.focusOffset;
  if (!node3)
    return;
  let len = nodeLen(node3);
  let moveNode, moveOffset;
  for (; ; ) {
    if (offset < len) {
      if (node3.nodeType != 1)
        break;
      let after = node3.childNodes[offset];
      if (isIgnorable(after, 1)) {
        moveNode = node3;
        moveOffset = ++offset;
      } else
        break;
    } else if (isBlockNode(node3)) {
      break;
    } else {
      let next2 = node3.nextSibling;
      while (next2 && isIgnorable(next2, 1)) {
        moveNode = next2.parentNode;
        moveOffset = domIndex(next2) + 1;
        next2 = next2.nextSibling;
      }
      if (!next2) {
        node3 = node3.parentNode;
        if (node3 == view.dom)
          break;
        offset = len = 0;
      } else {
        node3 = next2;
        offset = 0;
        len = nodeLen(node3);
      }
    }
  }
  if (moveNode)
    setSelFocus(view, moveNode, moveOffset);
}
__name(skipIgnoredNodesAfter, "skipIgnoredNodesAfter");
function isBlockNode(dom) {
  let desc = dom.pmViewDesc;
  return desc && desc.node && desc.node.isBlock;
}
__name(isBlockNode, "isBlockNode");
function textNodeAfter(node3, offset) {
  while (node3 && offset == node3.childNodes.length && !hasBlockDesc(node3)) {
    offset = domIndex(node3) + 1;
    node3 = node3.parentNode;
  }
  while (node3 && offset < node3.childNodes.length) {
    let next2 = node3.childNodes[offset];
    if (next2.nodeType == 3)
      return next2;
    if (next2.nodeType == 1 && next2.contentEditable == "false")
      break;
    node3 = next2;
    offset = 0;
  }
}
__name(textNodeAfter, "textNodeAfter");
function textNodeBefore(node3, offset) {
  while (node3 && !offset && !hasBlockDesc(node3)) {
    offset = domIndex(node3);
    node3 = node3.parentNode;
  }
  while (node3 && offset) {
    let next2 = node3.childNodes[offset - 1];
    if (next2.nodeType == 3)
      return next2;
    if (next2.nodeType == 1 && next2.contentEditable == "false")
      break;
    node3 = next2;
    offset = node3.childNodes.length;
  }
}
__name(textNodeBefore, "textNodeBefore");
function setSelFocus(view, node3, offset) {
  if (node3.nodeType != 3) {
    let before, after;
    if (after = textNodeAfter(node3, offset)) {
      node3 = after;
      offset = 0;
    } else if (before = textNodeBefore(node3, offset)) {
      node3 = before;
      offset = before.nodeValue.length;
    }
  }
  let sel = view.domSelection();
  if (!sel)
    return;
  if (selectionCollapsed(sel)) {
    let range2 = document.createRange();
    range2.setEnd(node3, offset);
    range2.setStart(node3, offset);
    sel.removeAllRanges();
    sel.addRange(range2);
  } else if (sel.extend) {
    sel.extend(node3, offset);
  }
  view.domObserver.setCurSelection();
  let { state } = view;
  setTimeout(() => {
    if (view.state == state)
      selectionToDOM(view);
  }, 50);
}
__name(setSelFocus, "setSelFocus");
function findDirection(view, pos2) {
  let $pos = view.state.doc.resolve(pos2);
  if (!(chrome || windows) && $pos.parent.inlineContent) {
    let coords = view.coordsAtPos(pos2);
    if (pos2 > $pos.start()) {
      let before = view.coordsAtPos(pos2 - 1);
      let mid = (before.top + before.bottom) / 2;
      if (mid > coords.top && mid < coords.bottom && Math.abs(before.left - coords.left) > 1)
        return before.left < coords.left ? "ltr" : "rtl";
    }
    if (pos2 < $pos.end()) {
      let after = view.coordsAtPos(pos2 + 1);
      let mid = (after.top + after.bottom) / 2;
      if (mid > coords.top && mid < coords.bottom && Math.abs(after.left - coords.left) > 1)
        return after.left > coords.left ? "ltr" : "rtl";
    }
  }
  let computed2 = getComputedStyle(view.dom).direction;
  return computed2 == "rtl" ? "rtl" : "ltr";
}
__name(findDirection, "findDirection");
function selectVertically(view, dir, mods) {
  let sel = view.state.selection;
  if (sel instanceof TextSelection && !sel.empty || mods.indexOf("s") > -1)
    return false;
  if (mac$3 && mods.indexOf("m") > -1)
    return false;
  let { $from, $to } = sel;
  if (!$from.parent.inlineContent || view.endOfTextblock(dir < 0 ? "up" : "down")) {
    let next2 = moveSelectionBlock(view.state, dir);
    if (next2 && next2 instanceof NodeSelection)
      return apply(view, next2);
  }
  if (!$from.parent.inlineContent) {
    let side = dir < 0 ? $from : $to;
    let beyond = sel instanceof AllSelection ? Selection.near(side, dir) : Selection.findFrom(side, dir);
    return beyond ? apply(view, beyond) : false;
  }
  return false;
}
__name(selectVertically, "selectVertically");
function stopNativeHorizontalDelete(view, dir) {
  if (!(view.state.selection instanceof TextSelection))
    return true;
  let { $head, $anchor, empty: empty3 } = view.state.selection;
  if (!$head.sameParent($anchor))
    return true;
  if (!empty3)
    return false;
  if (view.endOfTextblock(dir > 0 ? "forward" : "backward"))
    return true;
  let nextNode = !$head.textOffset && (dir < 0 ? $head.nodeBefore : $head.nodeAfter);
  if (nextNode && !nextNode.isText) {
    let tr2 = view.state.tr;
    if (dir < 0)
      tr2.delete($head.pos - nextNode.nodeSize, $head.pos);
    else
      tr2.delete($head.pos, $head.pos + nextNode.nodeSize);
    view.dispatch(tr2);
    return true;
  }
  return false;
}
__name(stopNativeHorizontalDelete, "stopNativeHorizontalDelete");
function switchEditable(view, node3, state) {
  view.domObserver.stop();
  node3.contentEditable = state;
  view.domObserver.start();
}
__name(switchEditable, "switchEditable");
function safariDownArrowBug(view) {
  if (!safari || view.state.selection.$head.parentOffset > 0)
    return false;
  let { focusNode: focusNode2, focusOffset } = view.domSelectionRange();
  if (focusNode2 && focusNode2.nodeType == 1 && focusOffset == 0 && focusNode2.firstChild && focusNode2.firstChild.contentEditable == "false") {
    let child = focusNode2.firstChild;
    switchEditable(view, child, "true");
    setTimeout(() => switchEditable(view, child, "false"), 20);
  }
  return false;
}
__name(safariDownArrowBug, "safariDownArrowBug");
function getMods(event) {
  let result = "";
  if (event.ctrlKey)
    result += "c";
  if (event.metaKey)
    result += "m";
  if (event.altKey)
    result += "a";
  if (event.shiftKey)
    result += "s";
  return result;
}
__name(getMods, "getMods");
function captureKeyDown(view, event) {
  let code2 = event.keyCode, mods = getMods(event);
  if (code2 == 8 || mac$3 && code2 == 72 && mods == "c") {
    return stopNativeHorizontalDelete(view, -1) || skipIgnoredNodes(view, -1);
  } else if (code2 == 46 && !event.shiftKey || mac$3 && code2 == 68 && mods == "c") {
    return stopNativeHorizontalDelete(view, 1) || skipIgnoredNodes(view, 1);
  } else if (code2 == 13 || code2 == 27) {
    return true;
  } else if (code2 == 37 || mac$3 && code2 == 66 && mods == "c") {
    let dir = code2 == 37 ? findDirection(view, view.state.selection.from) == "ltr" ? -1 : 1 : -1;
    return selectHorizontally(view, dir, mods) || skipIgnoredNodes(view, dir);
  } else if (code2 == 39 || mac$3 && code2 == 70 && mods == "c") {
    let dir = code2 == 39 ? findDirection(view, view.state.selection.from) == "ltr" ? 1 : -1 : 1;
    return selectHorizontally(view, dir, mods) || skipIgnoredNodes(view, dir);
  } else if (code2 == 38 || mac$3 && code2 == 80 && mods == "c") {
    return selectVertically(view, -1, mods) || skipIgnoredNodes(view, -1);
  } else if (code2 == 40 || mac$3 && code2 == 78 && mods == "c") {
    return safariDownArrowBug(view) || selectVertically(view, 1, mods) || skipIgnoredNodes(view, 1);
  } else if (mods == (mac$3 ? "m" : "c") && (code2 == 66 || code2 == 73 || code2 == 89 || code2 == 90)) {
    return true;
  }
  return false;
}
__name(captureKeyDown, "captureKeyDown");
function serializeForClipboard(view, slice2) {
  view.someProp("transformCopied", (f) => {
    slice2 = f(slice2, view);
  });
  let context = [], { content: content2, openStart, openEnd } = slice2;
  while (openStart > 1 && openEnd > 1 && content2.childCount == 1 && content2.firstChild.childCount == 1) {
    openStart--;
    openEnd--;
    let node3 = content2.firstChild;
    context.push(node3.type.name, node3.attrs != node3.type.defaultAttrs ? node3.attrs : null);
    content2 = node3.content;
  }
  let serializer = view.someProp("clipboardSerializer") || DOMSerializer.fromSchema(view.state.schema);
  let doc2 = detachedDoc(), wrap2 = doc2.createElement("div");
  wrap2.appendChild(serializer.serializeFragment(content2, { document: doc2 }));
  let firstChild = wrap2.firstChild, needsWrap, wrappers = 0;
  while (firstChild && firstChild.nodeType == 1 && (needsWrap = wrapMap[firstChild.nodeName.toLowerCase()])) {
    for (let i2 = needsWrap.length - 1; i2 >= 0; i2--) {
      let wrapper = doc2.createElement(needsWrap[i2]);
      while (wrap2.firstChild)
        wrapper.appendChild(wrap2.firstChild);
      wrap2.appendChild(wrapper);
      wrappers++;
    }
    firstChild = wrap2.firstChild;
  }
  if (firstChild && firstChild.nodeType == 1)
    firstChild.setAttribute("data-pm-slice", `${openStart} ${openEnd}${wrappers ? ` -${wrappers}` : ""} ${JSON.stringify(context)}`);
  let text2 = view.someProp("clipboardTextSerializer", (f) => f(slice2, view)) || slice2.content.textBetween(0, slice2.content.size, "\n\n");
  return { dom: wrap2, text: text2, slice: slice2 };
}
__name(serializeForClipboard, "serializeForClipboard");
function parseFromClipboard(view, text2, html, plainText, $context) {
  let inCode = $context.parent.type.spec.code;
  let dom, slice2;
  if (!html && !text2)
    return null;
  let asText = text2 && (plainText || inCode || !html);
  if (asText) {
    view.someProp("transformPastedText", (f) => {
      text2 = f(text2, inCode || plainText, view);
    });
    if (inCode)
      return text2 ? new Slice(Fragment.from(view.state.schema.text(text2.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
    let parsed = view.someProp("clipboardTextParser", (f) => f(text2, $context, plainText, view));
    if (parsed) {
      slice2 = parsed;
    } else {
      let marks = $context.marks();
      let { schema: schema2 } = view.state, serializer = DOMSerializer.fromSchema(schema2);
      dom = document.createElement("div");
      text2.split(/(?:\r\n?|\n)+/).forEach((block3) => {
        let p2 = dom.appendChild(document.createElement("p"));
        if (block3)
          p2.appendChild(serializer.serializeNode(schema2.text(block3, marks)));
      });
    }
  } else {
    view.someProp("transformPastedHTML", (f) => {
      html = f(html, view);
    });
    dom = readHTML(html);
    if (webkit)
      restoreReplacedSpaces(dom);
  }
  let contextNode = dom && dom.querySelector("[data-pm-slice]");
  let sliceData = contextNode && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(contextNode.getAttribute("data-pm-slice") || "");
  if (sliceData && sliceData[3])
    for (let i2 = +sliceData[3]; i2 > 0; i2--) {
      let child = dom.firstChild;
      while (child && child.nodeType != 1)
        child = child.nextSibling;
      if (!child)
        break;
      dom = child;
    }
  if (!slice2) {
    let parser = view.someProp("clipboardParser") || view.someProp("domParser") || DOMParser.fromSchema(view.state.schema);
    slice2 = parser.parseSlice(dom, {
      preserveWhitespace: !!(asText || sliceData),
      context: $context,
      ruleFromNode(dom2) {
        if (dom2.nodeName == "BR" && !dom2.nextSibling && dom2.parentNode && !inlineParents.test(dom2.parentNode.nodeName))
          return { ignore: true };
        return null;
      }
    });
  }
  if (sliceData) {
    slice2 = addContext(closeSlice(slice2, +sliceData[1], +sliceData[2]), sliceData[4]);
  } else {
    slice2 = Slice.maxOpen(normalizeSiblings(slice2.content, $context), true);
    if (slice2.openStart || slice2.openEnd) {
      let openStart = 0, openEnd = 0;
      for (let node3 = slice2.content.firstChild; openStart < slice2.openStart && !node3.type.spec.isolating; openStart++, node3 = node3.firstChild) {
      }
      for (let node3 = slice2.content.lastChild; openEnd < slice2.openEnd && !node3.type.spec.isolating; openEnd++, node3 = node3.lastChild) {
      }
      slice2 = closeSlice(slice2, openStart, openEnd);
    }
  }
  view.someProp("transformPasted", (f) => {
    slice2 = f(slice2, view);
  });
  return slice2;
}
__name(parseFromClipboard, "parseFromClipboard");
const inlineParents = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
function normalizeSiblings(fragment, $context) {
  if (fragment.childCount < 2)
    return fragment;
  for (let d = $context.depth; d >= 0; d--) {
    let parent = $context.node(d);
    let match2 = parent.contentMatchAt($context.index(d));
    let lastWrap, result = [];
    fragment.forEach((node3) => {
      if (!result)
        return;
      let wrap2 = match2.findWrapping(node3.type), inLast;
      if (!wrap2)
        return result = null;
      if (inLast = result.length && lastWrap.length && addToSibling(wrap2, lastWrap, node3, result[result.length - 1], 0)) {
        result[result.length - 1] = inLast;
      } else {
        if (result.length)
          result[result.length - 1] = closeRight(result[result.length - 1], lastWrap.length);
        let wrapped = withWrappers(node3, wrap2);
        result.push(wrapped);
        match2 = match2.matchType(wrapped.type);
        lastWrap = wrap2;
      }
    });
    if (result)
      return Fragment.from(result);
  }
  return fragment;
}
__name(normalizeSiblings, "normalizeSiblings");
function withWrappers(node3, wrap2, from2 = 0) {
  for (let i2 = wrap2.length - 1; i2 >= from2; i2--)
    node3 = wrap2[i2].create(null, Fragment.from(node3));
  return node3;
}
__name(withWrappers, "withWrappers");
function addToSibling(wrap2, lastWrap, node3, sibling, depth) {
  if (depth < wrap2.length && depth < lastWrap.length && wrap2[depth] == lastWrap[depth]) {
    let inner = addToSibling(wrap2, lastWrap, node3, sibling.lastChild, depth + 1);
    if (inner)
      return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
    let match2 = sibling.contentMatchAt(sibling.childCount);
    if (match2.matchType(depth == wrap2.length - 1 ? node3.type : wrap2[depth + 1]))
      return sibling.copy(sibling.content.append(Fragment.from(withWrappers(node3, wrap2, depth + 1))));
  }
}
__name(addToSibling, "addToSibling");
function closeRight(node3, depth) {
  if (depth == 0)
    return node3;
  let fragment = node3.content.replaceChild(node3.childCount - 1, closeRight(node3.lastChild, depth - 1));
  let fill = node3.contentMatchAt(node3.childCount).fillBefore(Fragment.empty, true);
  return node3.copy(fragment.append(fill));
}
__name(closeRight, "closeRight");
function closeRange(fragment, side, from2, to, depth, openEnd) {
  let node3 = side < 0 ? fragment.firstChild : fragment.lastChild, inner = node3.content;
  if (fragment.childCount > 1)
    openEnd = 0;
  if (depth < to - 1)
    inner = closeRange(inner, side, from2, to, depth + 1, openEnd);
  if (depth >= from2)
    inner = side < 0 ? node3.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node3.contentMatchAt(node3.childCount).fillBefore(Fragment.empty, true));
  return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node3.copy(inner));
}
__name(closeRange, "closeRange");
function closeSlice(slice2, openStart, openEnd) {
  if (openStart < slice2.openStart)
    slice2 = new Slice(closeRange(slice2.content, -1, openStart, slice2.openStart, 0, slice2.openEnd), openStart, slice2.openEnd);
  if (openEnd < slice2.openEnd)
    slice2 = new Slice(closeRange(slice2.content, 1, openEnd, slice2.openEnd, 0, 0), slice2.openStart, openEnd);
  return slice2;
}
__name(closeSlice, "closeSlice");
const wrapMap = {
  thead: ["table"],
  tbody: ["table"],
  tfoot: ["table"],
  caption: ["table"],
  colgroup: ["table"],
  col: ["table", "colgroup"],
  tr: ["table", "tbody"],
  td: ["table", "tbody", "tr"],
  th: ["table", "tbody", "tr"]
};
let _detachedDoc = null;
function detachedDoc() {
  return _detachedDoc || (_detachedDoc = document.implementation.createHTMLDocument("title"));
}
__name(detachedDoc, "detachedDoc");
let _policy = null;
function maybeWrapTrusted(html) {
  let trustedTypes = window.trustedTypes;
  if (!trustedTypes)
    return html;
  if (!_policy)
    _policy = trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: /* @__PURE__ */ __name((s) => s, "createHTML") });
  return _policy.createHTML(html);
}
__name(maybeWrapTrusted, "maybeWrapTrusted");
function readHTML(html) {
  let metas = /^(\s*<meta [^>]*>)*/.exec(html);
  if (metas)
    html = html.slice(metas[0].length);
  let elt = detachedDoc().createElement("div");
  let firstTag = /<([a-z][^>\s]+)/i.exec(html), wrap2;
  if (wrap2 = firstTag && wrapMap[firstTag[1].toLowerCase()])
    html = wrap2.map((n) => "<" + n + ">").join("") + html + wrap2.map((n) => "</" + n + ">").reverse().join("");
  elt.innerHTML = maybeWrapTrusted(html);
  if (wrap2)
    for (let i2 = 0; i2 < wrap2.length; i2++)
      elt = elt.querySelector(wrap2[i2]) || elt;
  return elt;
}
__name(readHTML, "readHTML");
function restoreReplacedSpaces(dom) {
  let nodes = dom.querySelectorAll(chrome ? "span:not([class]):not([style])" : "span.Apple-converted-space");
  for (let i2 = 0; i2 < nodes.length; i2++) {
    let node3 = nodes[i2];
    if (node3.childNodes.length == 1 && node3.textContent == " " && node3.parentNode)
      node3.parentNode.replaceChild(dom.ownerDocument.createTextNode(" "), node3);
  }
}
__name(restoreReplacedSpaces, "restoreReplacedSpaces");
function addContext(slice2, context) {
  if (!slice2.size)
    return slice2;
  let schema2 = slice2.content.firstChild.type.schema, array;
  try {
    array = JSON.parse(context);
  } catch (e2) {
    return slice2;
  }
  let { content: content2, openStart, openEnd } = slice2;
  for (let i2 = array.length - 2; i2 >= 0; i2 -= 2) {
    let type = schema2.nodes[array[i2]];
    if (!type || type.hasRequiredAttrs())
      break;
    content2 = Fragment.from(type.create(array[i2 + 1], content2));
    openStart++;
    openEnd++;
  }
  return new Slice(content2, openStart, openEnd);
}
__name(addContext, "addContext");
const handlers = {};
const editHandlers = {};
const passiveHandlers = { touchstart: true, touchmove: true };
class InputState {
  static {
    __name(this, "InputState");
  }
  constructor() {
    this.shiftKey = false;
    this.mouseDown = null;
    this.lastKeyCode = null;
    this.lastKeyCodeTime = 0;
    this.lastClick = { time: 0, x: 0, y: 0, type: "" };
    this.lastSelectionOrigin = null;
    this.lastSelectionTime = 0;
    this.lastIOSEnter = 0;
    this.lastIOSEnterFallbackTimeout = -1;
    this.lastFocus = 0;
    this.lastTouch = 0;
    this.lastChromeDelete = 0;
    this.composing = false;
    this.compositionNode = null;
    this.composingTimeout = -1;
    this.compositionNodes = [];
    this.compositionEndedAt = -2e8;
    this.compositionID = 1;
    this.compositionPendingChanges = 0;
    this.domChangeCount = 0;
    this.eventHandlers = /* @__PURE__ */ Object.create(null);
    this.hideSelectionGuard = null;
  }
}
function initInput(view) {
  for (let event in handlers) {
    let handler6 = handlers[event];
    view.dom.addEventListener(event, view.input.eventHandlers[event] = (event2) => {
      if (eventBelongsToView(view, event2) && !runCustomHandler(view, event2) && (view.editable || !(event2.type in editHandlers)))
        handler6(view, event2);
    }, passiveHandlers[event] ? { passive: true } : void 0);
  }
  if (safari)
    view.dom.addEventListener("input", () => null);
  ensureListeners(view);
}
__name(initInput, "initInput");
function setSelectionOrigin(view, origin2) {
  view.input.lastSelectionOrigin = origin2;
  view.input.lastSelectionTime = Date.now();
}
__name(setSelectionOrigin, "setSelectionOrigin");
function destroyInput(view) {
  view.domObserver.stop();
  for (let type in view.input.eventHandlers)
    view.dom.removeEventListener(type, view.input.eventHandlers[type]);
  clearTimeout(view.input.composingTimeout);
  clearTimeout(view.input.lastIOSEnterFallbackTimeout);
}
__name(destroyInput, "destroyInput");
function ensureListeners(view) {
  view.someProp("handleDOMEvents", (currentHandlers) => {
    for (let type in currentHandlers)
      if (!view.input.eventHandlers[type])
        view.dom.addEventListener(type, view.input.eventHandlers[type] = (event) => runCustomHandler(view, event));
  });
}
__name(ensureListeners, "ensureListeners");
function runCustomHandler(view, event) {
  return view.someProp("handleDOMEvents", (handlers2) => {
    let handler6 = handlers2[event.type];
    return handler6 ? handler6(view, event) || event.defaultPrevented : false;
  });
}
__name(runCustomHandler, "runCustomHandler");
function eventBelongsToView(view, event) {
  if (!event.bubbles)
    return true;
  if (event.defaultPrevented)
    return false;
  for (let node3 = event.target; node3 != view.dom; node3 = node3.parentNode)
    if (!node3 || node3.nodeType == 11 || node3.pmViewDesc && node3.pmViewDesc.stopEvent(event))
      return false;
  return true;
}
__name(eventBelongsToView, "eventBelongsToView");
function dispatchEvent(view, event) {
  if (!runCustomHandler(view, event) && handlers[event.type] && (view.editable || !(event.type in editHandlers)))
    handlers[event.type](view, event);
}
__name(dispatchEvent, "dispatchEvent");
editHandlers.keydown = (view, _event) => {
  let event = _event;
  view.input.shiftKey = event.keyCode == 16 || event.shiftKey;
  if (inOrNearComposition(view, event))
    return;
  view.input.lastKeyCode = event.keyCode;
  view.input.lastKeyCodeTime = Date.now();
  if (android && chrome && event.keyCode == 13)
    return;
  if (event.keyCode != 229)
    view.domObserver.forceFlush();
  if (ios && event.keyCode == 13 && !event.ctrlKey && !event.altKey && !event.metaKey) {
    let now2 = Date.now();
    view.input.lastIOSEnter = now2;
    view.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
      if (view.input.lastIOSEnter == now2) {
        view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")));
        view.input.lastIOSEnter = 0;
      }
    }, 200);
  } else if (view.someProp("handleKeyDown", (f) => f(view, event)) || captureKeyDown(view, event)) {
    event.preventDefault();
  } else {
    setSelectionOrigin(view, "key");
  }
};
editHandlers.keyup = (view, event) => {
  if (event.keyCode == 16)
    view.input.shiftKey = false;
};
editHandlers.keypress = (view, _event) => {
  let event = _event;
  if (inOrNearComposition(view, event) || !event.charCode || event.ctrlKey && !event.altKey || mac$3 && event.metaKey)
    return;
  if (view.someProp("handleKeyPress", (f) => f(view, event))) {
    event.preventDefault();
    return;
  }
  let sel = view.state.selection;
  if (!(sel instanceof TextSelection) || !sel.$from.sameParent(sel.$to)) {
    let text2 = String.fromCharCode(event.charCode);
    if (!/[\r\n]/.test(text2) && !view.someProp("handleTextInput", (f) => f(view, sel.$from.pos, sel.$to.pos, text2)))
      view.dispatch(view.state.tr.insertText(text2).scrollIntoView());
    event.preventDefault();
  }
};
function eventCoords(event) {
  return { left: event.clientX, top: event.clientY };
}
__name(eventCoords, "eventCoords");
function isNear(event, click2) {
  let dx = click2.x - event.clientX, dy = click2.y - event.clientY;
  return dx * dx + dy * dy < 100;
}
__name(isNear, "isNear");
function runHandlerOnContext(view, propName, pos2, inside, event) {
  if (inside == -1)
    return false;
  let $pos = view.state.doc.resolve(inside);
  for (let i2 = $pos.depth + 1; i2 > 0; i2--) {
    if (view.someProp(propName, (f) => i2 > $pos.depth ? f(view, pos2, $pos.nodeAfter, $pos.before(i2), event, true) : f(view, pos2, $pos.node(i2), $pos.before(i2), event, false)))
      return true;
  }
  return false;
}
__name(runHandlerOnContext, "runHandlerOnContext");
function updateSelection(view, selection, origin2) {
  if (!view.focused)
    view.focus();
  if (view.state.selection.eq(selection))
    return;
  let tr2 = view.state.tr.setSelection(selection);
  if (origin2 == "pointer")
    tr2.setMeta("pointer", true);
  view.dispatch(tr2);
}
__name(updateSelection, "updateSelection");
function selectClickedLeaf(view, inside) {
  if (inside == -1)
    return false;
  let $pos = view.state.doc.resolve(inside), node3 = $pos.nodeAfter;
  if (node3 && node3.isAtom && NodeSelection.isSelectable(node3)) {
    updateSelection(view, new NodeSelection($pos), "pointer");
    return true;
  }
  return false;
}
__name(selectClickedLeaf, "selectClickedLeaf");
function selectClickedNode(view, inside) {
  if (inside == -1)
    return false;
  let sel = view.state.selection, selectedNode, selectAt;
  if (sel instanceof NodeSelection)
    selectedNode = sel.node;
  let $pos = view.state.doc.resolve(inside);
  for (let i2 = $pos.depth + 1; i2 > 0; i2--) {
    let node3 = i2 > $pos.depth ? $pos.nodeAfter : $pos.node(i2);
    if (NodeSelection.isSelectable(node3)) {
      if (selectedNode && sel.$from.depth > 0 && i2 >= sel.$from.depth && $pos.before(sel.$from.depth + 1) == sel.$from.pos)
        selectAt = $pos.before(sel.$from.depth);
      else
        selectAt = $pos.before(i2);
      break;
    }
  }
  if (selectAt != null) {
    updateSelection(view, NodeSelection.create(view.state.doc, selectAt), "pointer");
    return true;
  } else {
    return false;
  }
}
__name(selectClickedNode, "selectClickedNode");
function handleSingleClick(view, pos2, inside, event, selectNode) {
  return runHandlerOnContext(view, "handleClickOn", pos2, inside, event) || view.someProp("handleClick", (f) => f(view, pos2, event)) || (selectNode ? selectClickedNode(view, inside) : selectClickedLeaf(view, inside));
}
__name(handleSingleClick, "handleSingleClick");
function handleDoubleClick(view, pos2, inside, event) {
  return runHandlerOnContext(view, "handleDoubleClickOn", pos2, inside, event) || view.someProp("handleDoubleClick", (f) => f(view, pos2, event));
}
__name(handleDoubleClick, "handleDoubleClick");
function handleTripleClick$1(view, pos2, inside, event) {
  return runHandlerOnContext(view, "handleTripleClickOn", pos2, inside, event) || view.someProp("handleTripleClick", (f) => f(view, pos2, event)) || defaultTripleClick(view, inside, event);
}
__name(handleTripleClick$1, "handleTripleClick$1");
function defaultTripleClick(view, inside, event) {
  if (event.button != 0)
    return false;
  let doc2 = view.state.doc;
  if (inside == -1) {
    if (doc2.inlineContent) {
      updateSelection(view, TextSelection.create(doc2, 0, doc2.content.size), "pointer");
      return true;
    }
    return false;
  }
  let $pos = doc2.resolve(inside);
  for (let i2 = $pos.depth + 1; i2 > 0; i2--) {
    let node3 = i2 > $pos.depth ? $pos.nodeAfter : $pos.node(i2);
    let nodePos = $pos.before(i2);
    if (node3.inlineContent)
      updateSelection(view, TextSelection.create(doc2, nodePos + 1, nodePos + 1 + node3.content.size), "pointer");
    else if (NodeSelection.isSelectable(node3))
      updateSelection(view, NodeSelection.create(doc2, nodePos), "pointer");
    else
      continue;
    return true;
  }
}
__name(defaultTripleClick, "defaultTripleClick");
function forceDOMFlush(view) {
  return endComposition(view);
}
__name(forceDOMFlush, "forceDOMFlush");
const selectNodeModifier = mac$3 ? "metaKey" : "ctrlKey";
handlers.mousedown = (view, _event) => {
  let event = _event;
  view.input.shiftKey = event.shiftKey;
  let flushed = forceDOMFlush(view);
  let now2 = Date.now(), type = "singleClick";
  if (now2 - view.input.lastClick.time < 500 && isNear(event, view.input.lastClick) && !event[selectNodeModifier]) {
    if (view.input.lastClick.type == "singleClick")
      type = "doubleClick";
    else if (view.input.lastClick.type == "doubleClick")
      type = "tripleClick";
  }
  view.input.lastClick = { time: now2, x: event.clientX, y: event.clientY, type };
  let pos2 = view.posAtCoords(eventCoords(event));
  if (!pos2)
    return;
  if (type == "singleClick") {
    if (view.input.mouseDown)
      view.input.mouseDown.done();
    view.input.mouseDown = new MouseDown(view, pos2, event, !!flushed);
  } else if ((type == "doubleClick" ? handleDoubleClick : handleTripleClick$1)(view, pos2.pos, pos2.inside, event)) {
    event.preventDefault();
  } else {
    setSelectionOrigin(view, "pointer");
  }
};
class MouseDown {
  static {
    __name(this, "MouseDown");
  }
  constructor(view, pos2, event, flushed) {
    this.view = view;
    this.pos = pos2;
    this.event = event;
    this.flushed = flushed;
    this.delayedSelectionSync = false;
    this.mightDrag = null;
    this.startDoc = view.state.doc;
    this.selectNode = !!event[selectNodeModifier];
    this.allowDefault = event.shiftKey;
    let targetNode, targetPos;
    if (pos2.inside > -1) {
      targetNode = view.state.doc.nodeAt(pos2.inside);
      targetPos = pos2.inside;
    } else {
      let $pos = view.state.doc.resolve(pos2.pos);
      targetNode = $pos.parent;
      targetPos = $pos.depth ? $pos.before() : 0;
    }
    const target = flushed ? null : event.target;
    const targetDesc = target ? view.docView.nearestDesc(target, true) : null;
    this.target = targetDesc && targetDesc.dom.nodeType == 1 ? targetDesc.dom : null;
    let { selection } = view.state;
    if (event.button == 0 && targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false || selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos)
      this.mightDrag = {
        node: targetNode,
        pos: targetPos,
        addAttr: !!(this.target && !this.target.draggable),
        setUneditable: !!(this.target && gecko && !this.target.hasAttribute("contentEditable"))
      };
    if (this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable)) {
      this.view.domObserver.stop();
      if (this.mightDrag.addAttr)
        this.target.draggable = true;
      if (this.mightDrag.setUneditable)
        setTimeout(() => {
          if (this.view.input.mouseDown == this)
            this.target.setAttribute("contentEditable", "false");
        }, 20);
      this.view.domObserver.start();
    }
    view.root.addEventListener("mouseup", this.up = this.up.bind(this));
    view.root.addEventListener("mousemove", this.move = this.move.bind(this));
    setSelectionOrigin(view, "pointer");
  }
  done() {
    this.view.root.removeEventListener("mouseup", this.up);
    this.view.root.removeEventListener("mousemove", this.move);
    if (this.mightDrag && this.target) {
      this.view.domObserver.stop();
      if (this.mightDrag.addAttr)
        this.target.removeAttribute("draggable");
      if (this.mightDrag.setUneditable)
        this.target.removeAttribute("contentEditable");
      this.view.domObserver.start();
    }
    if (this.delayedSelectionSync)
      setTimeout(() => selectionToDOM(this.view));
    this.view.input.mouseDown = null;
  }
  up(event) {
    this.done();
    if (!this.view.dom.contains(event.target))
      return;
    let pos2 = this.pos;
    if (this.view.state.doc != this.startDoc)
      pos2 = this.view.posAtCoords(eventCoords(event));
    this.updateAllowDefault(event);
    if (this.allowDefault || !pos2) {
      setSelectionOrigin(this.view, "pointer");
    } else if (handleSingleClick(this.view, pos2.pos, pos2.inside, event, this.selectNode)) {
      event.preventDefault();
    } else if (event.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
    safari && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
    // cursor, but still report that the node is selected
    // when asked through getSelection. You'll then get a
    // situation where clicking at the point where that
    // (hidden) cursor is doesn't change the selection, and
    // thus doesn't get a reaction from ProseMirror. This
    // works around that.
    chrome && !this.view.state.selection.visible && Math.min(Math.abs(pos2.pos - this.view.state.selection.from), Math.abs(pos2.pos - this.view.state.selection.to)) <= 2)) {
      updateSelection(this.view, Selection.near(this.view.state.doc.resolve(pos2.pos)), "pointer");
      event.preventDefault();
    } else {
      setSelectionOrigin(this.view, "pointer");
    }
  }
  move(event) {
    this.updateAllowDefault(event);
    setSelectionOrigin(this.view, "pointer");
    if (event.buttons == 0)
      this.done();
  }
  updateAllowDefault(event) {
    if (!this.allowDefault && (Math.abs(this.event.x - event.clientX) > 4 || Math.abs(this.event.y - event.clientY) > 4))
      this.allowDefault = true;
  }
}
handlers.touchstart = (view) => {
  view.input.lastTouch = Date.now();
  forceDOMFlush(view);
  setSelectionOrigin(view, "pointer");
};
handlers.touchmove = (view) => {
  view.input.lastTouch = Date.now();
  setSelectionOrigin(view, "pointer");
};
handlers.contextmenu = (view) => forceDOMFlush(view);
function inOrNearComposition(view, event) {
  if (view.composing)
    return true;
  if (safari && Math.abs(event.timeStamp - view.input.compositionEndedAt) < 500) {
    view.input.compositionEndedAt = -2e8;
    return true;
  }
  return false;
}
__name(inOrNearComposition, "inOrNearComposition");
const timeoutComposition = android ? 5e3 : -1;
editHandlers.compositionstart = editHandlers.compositionupdate = (view) => {
  if (!view.composing) {
    view.domObserver.flush();
    let { state } = view, $pos = state.selection.$to;
    if (state.selection instanceof TextSelection && (state.storedMarks || !$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some((m) => m.type.spec.inclusive === false))) {
      view.markCursor = view.state.storedMarks || $pos.marks();
      endComposition(view, true);
      view.markCursor = null;
    } else {
      endComposition(view, !state.selection.empty);
      if (gecko && state.selection.empty && $pos.parentOffset && !$pos.textOffset && $pos.nodeBefore.marks.length) {
        let sel = view.domSelectionRange();
        for (let node3 = sel.focusNode, offset = sel.focusOffset; node3 && node3.nodeType == 1 && offset != 0; ) {
          let before = offset < 0 ? node3.lastChild : node3.childNodes[offset - 1];
          if (!before)
            break;
          if (before.nodeType == 3) {
            let sel2 = view.domSelection();
            if (sel2)
              sel2.collapse(before, before.nodeValue.length);
            break;
          } else {
            node3 = before;
            offset = -1;
          }
        }
      }
    }
    view.input.composing = true;
  }
  scheduleComposeEnd(view, timeoutComposition);
};
editHandlers.compositionend = (view, event) => {
  if (view.composing) {
    view.input.composing = false;
    view.input.compositionEndedAt = event.timeStamp;
    view.input.compositionPendingChanges = view.domObserver.pendingRecords().length ? view.input.compositionID : 0;
    view.input.compositionNode = null;
    if (view.input.compositionPendingChanges)
      Promise.resolve().then(() => view.domObserver.flush());
    view.input.compositionID++;
    scheduleComposeEnd(view, 20);
  }
};
function scheduleComposeEnd(view, delay) {
  clearTimeout(view.input.composingTimeout);
  if (delay > -1)
    view.input.composingTimeout = setTimeout(() => endComposition(view), delay);
}
__name(scheduleComposeEnd, "scheduleComposeEnd");
function clearComposition(view) {
  if (view.composing) {
    view.input.composing = false;
    view.input.compositionEndedAt = timestampFromCustomEvent();
  }
  while (view.input.compositionNodes.length > 0)
    view.input.compositionNodes.pop().markParentsDirty();
}
__name(clearComposition, "clearComposition");
function findCompositionNode(view) {
  let sel = view.domSelectionRange();
  if (!sel.focusNode)
    return null;
  let textBefore = textNodeBefore$1(sel.focusNode, sel.focusOffset);
  let textAfter = textNodeAfter$1(sel.focusNode, sel.focusOffset);
  if (textBefore && textAfter && textBefore != textAfter) {
    let descAfter = textAfter.pmViewDesc, lastChanged = view.domObserver.lastChangedTextNode;
    if (textBefore == lastChanged || textAfter == lastChanged)
      return lastChanged;
    if (!descAfter || !descAfter.isText(textAfter.nodeValue)) {
      return textAfter;
    } else if (view.input.compositionNode == textAfter) {
      let descBefore = textBefore.pmViewDesc;
      if (!(!descBefore || !descBefore.isText(textBefore.nodeValue)))
        return textAfter;
    }
  }
  return textBefore || textAfter;
}
__name(findCompositionNode, "findCompositionNode");
function timestampFromCustomEvent() {
  let event = document.createEvent("Event");
  event.initEvent("event", true, true);
  return event.timeStamp;
}
__name(timestampFromCustomEvent, "timestampFromCustomEvent");
function endComposition(view, restarting = false) {
  if (android && view.domObserver.flushingSoon >= 0)
    return;
  view.domObserver.forceFlush();
  clearComposition(view);
  if (restarting || view.docView && view.docView.dirty) {
    let sel = selectionFromDOM(view);
    if (sel && !sel.eq(view.state.selection))
      view.dispatch(view.state.tr.setSelection(sel));
    else if ((view.markCursor || restarting) && !view.state.selection.empty)
      view.dispatch(view.state.tr.deleteSelection());
    else
      view.updateState(view.state);
    return true;
  }
  return false;
}
__name(endComposition, "endComposition");
function captureCopy(view, dom) {
  if (!view.dom.parentNode)
    return;
  let wrap2 = view.dom.parentNode.appendChild(document.createElement("div"));
  wrap2.appendChild(dom);
  wrap2.style.cssText = "position: fixed; left: -10000px; top: 10px";
  let sel = getSelection(), range2 = document.createRange();
  range2.selectNodeContents(dom);
  view.dom.blur();
  sel.removeAllRanges();
  sel.addRange(range2);
  setTimeout(() => {
    if (wrap2.parentNode)
      wrap2.parentNode.removeChild(wrap2);
    view.focus();
  }, 50);
}
__name(captureCopy, "captureCopy");
const brokenClipboardAPI = ie$1 && ie_version < 15 || ios && webkit_version < 604;
handlers.copy = editHandlers.cut = (view, _event) => {
  let event = _event;
  let sel = view.state.selection, cut2 = event.type == "cut";
  if (sel.empty)
    return;
  let data24 = brokenClipboardAPI ? null : event.clipboardData;
  let slice2 = sel.content(), { dom, text: text2 } = serializeForClipboard(view, slice2);
  if (data24) {
    event.preventDefault();
    data24.clearData();
    data24.setData("text/html", dom.innerHTML);
    data24.setData("text/plain", text2);
  } else {
    captureCopy(view, dom);
  }
  if (cut2)
    view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
};
function sliceSingleNode(slice2) {
  return slice2.openStart == 0 && slice2.openEnd == 0 && slice2.content.childCount == 1 ? slice2.content.firstChild : null;
}
__name(sliceSingleNode, "sliceSingleNode");
function capturePaste(view, event) {
  if (!view.dom.parentNode)
    return;
  let plainText = view.input.shiftKey || view.state.selection.$from.parent.type.spec.code;
  let target = view.dom.parentNode.appendChild(document.createElement(plainText ? "textarea" : "div"));
  if (!plainText)
    target.contentEditable = "true";
  target.style.cssText = "position: fixed; left: -10000px; top: 10px";
  target.focus();
  let plain = view.input.shiftKey && view.input.lastKeyCode != 45;
  setTimeout(() => {
    view.focus();
    if (target.parentNode)
      target.parentNode.removeChild(target);
    if (plainText)
      doPaste(view, target.value, null, plain, event);
    else
      doPaste(view, target.textContent, target.innerHTML, plain, event);
  }, 50);
}
__name(capturePaste, "capturePaste");
function doPaste(view, text2, html, preferPlain, event) {
  let slice2 = parseFromClipboard(view, text2, html, preferPlain, view.state.selection.$from);
  if (view.someProp("handlePaste", (f) => f(view, event, slice2 || Slice.empty)))
    return true;
  if (!slice2)
    return false;
  let singleNode = sliceSingleNode(slice2);
  let tr2 = singleNode ? view.state.tr.replaceSelectionWith(singleNode, preferPlain) : view.state.tr.replaceSelection(slice2);
  view.dispatch(tr2.scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste"));
  return true;
}
__name(doPaste, "doPaste");
function getText$1(clipboardData) {
  let text2 = clipboardData.getData("text/plain") || clipboardData.getData("Text");
  if (text2)
    return text2;
  let uris = clipboardData.getData("text/uri-list");
  return uris ? uris.replace(/\r?\n/g, " ") : "";
}
__name(getText$1, "getText$1");
editHandlers.paste = (view, _event) => {
  let event = _event;
  if (view.composing && !android)
    return;
  let data24 = brokenClipboardAPI ? null : event.clipboardData;
  let plain = view.input.shiftKey && view.input.lastKeyCode != 45;
  if (data24 && doPaste(view, getText$1(data24), data24.getData("text/html"), plain, event))
    event.preventDefault();
  else
    capturePaste(view, event);
};
class Dragging {
  static {
    __name(this, "Dragging");
  }
  constructor(slice2, move, node3) {
    this.slice = slice2;
    this.move = move;
    this.node = node3;
  }
}
const dragCopyModifier = mac$3 ? "altKey" : "ctrlKey";
handlers.dragstart = (view, _event) => {
  let event = _event;
  let mouseDown = view.input.mouseDown;
  if (mouseDown)
    mouseDown.done();
  if (!event.dataTransfer)
    return;
  let sel = view.state.selection;
  let pos2 = sel.empty ? null : view.posAtCoords(eventCoords(event));
  let node3;
  if (pos2 && pos2.pos >= sel.from && pos2.pos <= (sel instanceof NodeSelection ? sel.to - 1 : sel.to)) ;
  else if (mouseDown && mouseDown.mightDrag) {
    node3 = NodeSelection.create(view.state.doc, mouseDown.mightDrag.pos);
  } else if (event.target && event.target.nodeType == 1) {
    let desc = view.docView.nearestDesc(event.target, true);
    if (desc && desc.node.type.spec.draggable && desc != view.docView)
      node3 = NodeSelection.create(view.state.doc, desc.posBefore);
  }
  let draggedSlice = (node3 || view.state.selection).content();
  let { dom, text: text2, slice: slice2 } = serializeForClipboard(view, draggedSlice);
  if (!event.dataTransfer.files.length || !chrome || chrome_version > 120)
    event.dataTransfer.clearData();
  event.dataTransfer.setData(brokenClipboardAPI ? "Text" : "text/html", dom.innerHTML);
  event.dataTransfer.effectAllowed = "copyMove";
  if (!brokenClipboardAPI)
    event.dataTransfer.setData("text/plain", text2);
  view.dragging = new Dragging(slice2, !event[dragCopyModifier], node3);
};
handlers.dragend = (view) => {
  let dragging = view.dragging;
  window.setTimeout(() => {
    if (view.dragging == dragging)
      view.dragging = null;
  }, 50);
};
editHandlers.dragover = editHandlers.dragenter = (_2, e2) => e2.preventDefault();
editHandlers.drop = (view, _event) => {
  let event = _event;
  let dragging = view.dragging;
  view.dragging = null;
  if (!event.dataTransfer)
    return;
  let eventPos = view.posAtCoords(eventCoords(event));
  if (!eventPos)
    return;
  let $mouse = view.state.doc.resolve(eventPos.pos);
  let slice2 = dragging && dragging.slice;
  if (slice2) {
    view.someProp("transformPasted", (f) => {
      slice2 = f(slice2, view);
    });
  } else {
    slice2 = parseFromClipboard(view, getText$1(event.dataTransfer), brokenClipboardAPI ? null : event.dataTransfer.getData("text/html"), false, $mouse);
  }
  let move = !!(dragging && !event[dragCopyModifier]);
  if (view.someProp("handleDrop", (f) => f(view, event, slice2 || Slice.empty, move))) {
    event.preventDefault();
    return;
  }
  if (!slice2)
    return;
  event.preventDefault();
  let insertPos = slice2 ? dropPoint(view.state.doc, $mouse.pos, slice2) : $mouse.pos;
  if (insertPos == null)
    insertPos = $mouse.pos;
  let tr2 = view.state.tr;
  if (move) {
    let { node: node3 } = dragging;
    if (node3)
      node3.replace(tr2);
    else
      tr2.deleteSelection();
  }
  let pos2 = tr2.mapping.map(insertPos);
  let isNode = slice2.openStart == 0 && slice2.openEnd == 0 && slice2.content.childCount == 1;
  let beforeInsert = tr2.doc;
  if (isNode)
    tr2.replaceRangeWith(pos2, pos2, slice2.content.firstChild);
  else
    tr2.replaceRange(pos2, pos2, slice2);
  if (tr2.doc.eq(beforeInsert))
    return;
  let $pos = tr2.doc.resolve(pos2);
  if (isNode && NodeSelection.isSelectable(slice2.content.firstChild) && $pos.nodeAfter && $pos.nodeAfter.sameMarkup(slice2.content.firstChild)) {
    tr2.setSelection(new NodeSelection($pos));
  } else {
    let end = tr2.mapping.map(insertPos);
    tr2.mapping.maps[tr2.mapping.maps.length - 1].forEach((_from, _to, _newFrom, newTo) => end = newTo);
    tr2.setSelection(selectionBetween(view, $pos, tr2.doc.resolve(end)));
  }
  view.focus();
  view.dispatch(tr2.setMeta("uiEvent", "drop"));
};
handlers.focus = (view) => {
  view.input.lastFocus = Date.now();
  if (!view.focused) {
    view.domObserver.stop();
    view.dom.classList.add("ProseMirror-focused");
    view.domObserver.start();
    view.focused = true;
    setTimeout(() => {
      if (view.docView && view.hasFocus() && !view.domObserver.currentSelection.eq(view.domSelectionRange()))
        selectionToDOM(view);
    }, 20);
  }
};
handlers.blur = (view, _event) => {
  let event = _event;
  if (view.focused) {
    view.domObserver.stop();
    view.dom.classList.remove("ProseMirror-focused");
    view.domObserver.start();
    if (event.relatedTarget && view.dom.contains(event.relatedTarget))
      view.domObserver.currentSelection.clear();
    view.focused = false;
  }
};
handlers.beforeinput = (view, _event) => {
  let event = _event;
  if (chrome && android && event.inputType == "deleteContentBackward") {
    view.domObserver.flushSoon();
    let { domChangeCount } = view.input;
    setTimeout(() => {
      if (view.input.domChangeCount != domChangeCount)
        return;
      view.dom.blur();
      view.focus();
      if (view.someProp("handleKeyDown", (f) => f(view, keyEvent(8, "Backspace"))))
        return;
      let { $cursor } = view.state.selection;
      if ($cursor && $cursor.pos > 0)
        view.dispatch(view.state.tr.delete($cursor.pos - 1, $cursor.pos).scrollIntoView());
    }, 50);
  }
};
for (let prop2 in editHandlers)
  handlers[prop2] = editHandlers[prop2];
function compareObjs(a, b) {
  if (a == b)
    return true;
  for (let p2 in a)
    if (a[p2] !== b[p2])
      return false;
  for (let p2 in b)
    if (!(p2 in a))
      return false;
  return true;
}
__name(compareObjs, "compareObjs");
class WidgetType {
  static {
    __name(this, "WidgetType");
  }
  constructor(toDOM, spec) {
    this.toDOM = toDOM;
    this.spec = spec || noSpec;
    this.side = this.spec.side || 0;
  }
  map(mapping, span, offset, oldOffset) {
    let { pos: pos2, deleted } = mapping.mapResult(span.from + oldOffset, this.side < 0 ? -1 : 1);
    return deleted ? null : new Decoration(pos2 - offset, pos2 - offset, this);
  }
  valid() {
    return true;
  }
  eq(other) {
    return this == other || other instanceof WidgetType && (this.spec.key && this.spec.key == other.spec.key || this.toDOM == other.toDOM && compareObjs(this.spec, other.spec));
  }
  destroy(node3) {
    if (this.spec.destroy)
      this.spec.destroy(node3);
  }
}
class InlineType {
  static {
    __name(this, "InlineType");
  }
  constructor(attrs4, spec) {
    this.attrs = attrs4;
    this.spec = spec || noSpec;
  }
  map(mapping, span, offset, oldOffset) {
    let from2 = mapping.map(span.from + oldOffset, this.spec.inclusiveStart ? -1 : 1) - offset;
    let to = mapping.map(span.to + oldOffset, this.spec.inclusiveEnd ? 1 : -1) - offset;
    return from2 >= to ? null : new Decoration(from2, to, this);
  }
  valid(_2, span) {
    return span.from < span.to;
  }
  eq(other) {
    return this == other || other instanceof InlineType && compareObjs(this.attrs, other.attrs) && compareObjs(this.spec, other.spec);
  }
  static is(span) {
    return span.type instanceof InlineType;
  }
  destroy() {
  }
}
class NodeType {
  static {
    __name(this, "NodeType");
  }
  constructor(attrs4, spec) {
    this.attrs = attrs4;
    this.spec = spec || noSpec;
  }
  map(mapping, span, offset, oldOffset) {
    let from2 = mapping.mapResult(span.from + oldOffset, 1);
    if (from2.deleted)
      return null;
    let to = mapping.mapResult(span.to + oldOffset, -1);
    if (to.deleted || to.pos <= from2.pos)
      return null;
    return new Decoration(from2.pos - offset, to.pos - offset, this);
  }
  valid(node3, span) {
    let { index: index2, offset } = node3.content.findIndex(span.from), child;
    return offset == span.from && !(child = node3.child(index2)).isText && offset + child.nodeSize == span.to;
  }
  eq(other) {
    return this == other || other instanceof NodeType && compareObjs(this.attrs, other.attrs) && compareObjs(this.spec, other.spec);
  }
  destroy() {
  }
}
class Decoration {
  static {
    __name(this, "Decoration");
  }
  /**
  @internal
  */
  constructor(from2, to, type) {
    this.from = from2;
    this.to = to;
    this.type = type;
  }
  /**
  @internal
  */
  copy(from2, to) {
    return new Decoration(from2, to, this.type);
  }
  /**
  @internal
  */
  eq(other, offset = 0) {
    return this.type.eq(other.type) && this.from + offset == other.from && this.to + offset == other.to;
  }
  /**
  @internal
  */
  map(mapping, offset, oldOffset) {
    return this.type.map(mapping, this, offset, oldOffset);
  }
  /**
  Creates a widget decoration, which is a DOM node that's shown in
  the document at the given position. It is recommended that you
  delay rendering the widget by passing a function that will be
  called when the widget is actually drawn in a view, but you can
  also directly pass a DOM node. `getPos` can be used to find the
  widget's current document position.
  */
  static widget(pos2, toDOM, spec) {
    return new Decoration(pos2, pos2, new WidgetType(toDOM, spec));
  }
  /**
  Creates an inline decoration, which adds the given attributes to
  each inline node between `from` and `to`.
  */
  static inline(from2, to, attrs4, spec) {
    return new Decoration(from2, to, new InlineType(attrs4, spec));
  }
  /**
  Creates a node decoration. `from` and `to` should point precisely
  before and after a node in the document. That node, and only that
  node, will receive the given attributes.
  */
  static node(from2, to, attrs4, spec) {
    return new Decoration(from2, to, new NodeType(attrs4, spec));
  }
  /**
  The spec provided when creating this decoration. Can be useful
  if you've stored extra information in that object.
  */
  get spec() {
    return this.type.spec;
  }
  /**
  @internal
  */
  get inline() {
    return this.type instanceof InlineType;
  }
  /**
  @internal
  */
  get widget() {
    return this.type instanceof WidgetType;
  }
}
const none = [], noSpec = {};
class DecorationSet {
  static {
    __name(this, "DecorationSet");
  }
  /**
  @internal
  */
  constructor(local, children) {
    this.local = local.length ? local : none;
    this.children = children.length ? children : none;
  }
  /**
  Create a set of decorations, using the structure of the given
  document. This will consume (modify) the `decorations` array, so
  you must make a copy if you want need to preserve that.
  */
  static create(doc2, decorations) {
    return decorations.length ? buildTree(decorations, doc2, 0, noSpec) : empty;
  }
  /**
  Find all decorations in this set which touch the given range
  (including decorations that start or end directly at the
  boundaries) and match the given predicate on their spec. When
  `start` and `end` are omitted, all decorations in the set are
  considered. When `predicate` isn't given, all decorations are
  assumed to match.
  */
  find(start2, end, predicate) {
    let result = [];
    this.findInner(start2 == null ? 0 : start2, end == null ? 1e9 : end, result, 0, predicate);
    return result;
  }
  findInner(start2, end, result, offset, predicate) {
    for (let i2 = 0; i2 < this.local.length; i2++) {
      let span = this.local[i2];
      if (span.from <= end && span.to >= start2 && (!predicate || predicate(span.spec)))
        result.push(span.copy(span.from + offset, span.to + offset));
    }
    for (let i2 = 0; i2 < this.children.length; i2 += 3) {
      if (this.children[i2] < end && this.children[i2 + 1] > start2) {
        let childOff = this.children[i2] + 1;
        this.children[i2 + 2].findInner(start2 - childOff, end - childOff, result, offset + childOff, predicate);
      }
    }
  }
  /**
  Map the set of decorations in response to a change in the
  document.
  */
  map(mapping, doc2, options4) {
    if (this == empty || mapping.maps.length == 0)
      return this;
    return this.mapInner(mapping, doc2, 0, 0, options4 || noSpec);
  }
  /**
  @internal
  */
  mapInner(mapping, node3, offset, oldOffset, options4) {
    let newLocal;
    for (let i2 = 0; i2 < this.local.length; i2++) {
      let mapped = this.local[i2].map(mapping, offset, oldOffset);
      if (mapped && mapped.type.valid(node3, mapped))
        (newLocal || (newLocal = [])).push(mapped);
      else if (options4.onRemove)
        options4.onRemove(this.local[i2].spec);
    }
    if (this.children.length)
      return mapChildren(this.children, newLocal || [], mapping, node3, offset, oldOffset, options4);
    else
      return newLocal ? new DecorationSet(newLocal.sort(byPos), none) : empty;
  }
  /**
  Add the given array of decorations to the ones in the set,
  producing a new set. Consumes the `decorations` array. Needs
  access to the current document to create the appropriate tree
  structure.
  */
  add(doc2, decorations) {
    if (!decorations.length)
      return this;
    if (this == empty)
      return DecorationSet.create(doc2, decorations);
    return this.addInner(doc2, decorations, 0);
  }
  addInner(doc2, decorations, offset) {
    let children, childIndex = 0;
    doc2.forEach((childNode, childOffset) => {
      let baseOffset = childOffset + offset, found2;
      if (!(found2 = takeSpansForNode(decorations, childNode, baseOffset)))
        return;
      if (!children)
        children = this.children.slice();
      while (childIndex < children.length && children[childIndex] < childOffset)
        childIndex += 3;
      if (children[childIndex] == childOffset)
        children[childIndex + 2] = children[childIndex + 2].addInner(childNode, found2, baseOffset + 1);
      else
        children.splice(childIndex, 0, childOffset, childOffset + childNode.nodeSize, buildTree(found2, childNode, baseOffset + 1, noSpec));
      childIndex += 3;
    });
    let local = moveSpans(childIndex ? withoutNulls(decorations) : decorations, -offset);
    for (let i2 = 0; i2 < local.length; i2++)
      if (!local[i2].type.valid(doc2, local[i2]))
        local.splice(i2--, 1);
    return new DecorationSet(local.length ? this.local.concat(local).sort(byPos) : this.local, children || this.children);
  }
  /**
  Create a new set that contains the decorations in this set, minus
  the ones in the given array.
  */
  remove(decorations) {
    if (decorations.length == 0 || this == empty)
      return this;
    return this.removeInner(decorations, 0);
  }
  removeInner(decorations, offset) {
    let children = this.children, local = this.local;
    for (let i2 = 0; i2 < children.length; i2 += 3) {
      let found2;
      let from2 = children[i2] + offset, to = children[i2 + 1] + offset;
      for (let j = 0, span; j < decorations.length; j++)
        if (span = decorations[j]) {
          if (span.from > from2 && span.to < to) {
            decorations[j] = null;
            (found2 || (found2 = [])).push(span);
          }
        }
      if (!found2)
        continue;
      if (children == this.children)
        children = this.children.slice();
      let removed = children[i2 + 2].removeInner(found2, from2 + 1);
      if (removed != empty) {
        children[i2 + 2] = removed;
      } else {
        children.splice(i2, 3);
        i2 -= 3;
      }
    }
    if (local.length) {
      for (let i2 = 0, span; i2 < decorations.length; i2++)
        if (span = decorations[i2]) {
          for (let j = 0; j < local.length; j++)
            if (local[j].eq(span, offset)) {
              if (local == this.local)
                local = this.local.slice();
              local.splice(j--, 1);
            }
        }
    }
    if (children == this.children && local == this.local)
      return this;
    return local.length || children.length ? new DecorationSet(local, children) : empty;
  }
  forChild(offset, node3) {
    if (this == empty)
      return this;
    if (node3.isLeaf)
      return DecorationSet.empty;
    let child, local;
    for (let i2 = 0; i2 < this.children.length; i2 += 3)
      if (this.children[i2] >= offset) {
        if (this.children[i2] == offset)
          child = this.children[i2 + 2];
        break;
      }
    let start2 = offset + 1, end = start2 + node3.content.size;
    for (let i2 = 0; i2 < this.local.length; i2++) {
      let dec = this.local[i2];
      if (dec.from < end && dec.to > start2 && dec.type instanceof InlineType) {
        let from2 = Math.max(start2, dec.from) - start2, to = Math.min(end, dec.to) - start2;
        if (from2 < to)
          (local || (local = [])).push(dec.copy(from2, to));
      }
    }
    if (local) {
      let localSet = new DecorationSet(local.sort(byPos), none);
      return child ? new DecorationGroup([localSet, child]) : localSet;
    }
    return child || empty;
  }
  /**
  @internal
  */
  eq(other) {
    if (this == other)
      return true;
    if (!(other instanceof DecorationSet) || this.local.length != other.local.length || this.children.length != other.children.length)
      return false;
    for (let i2 = 0; i2 < this.local.length; i2++)
      if (!this.local[i2].eq(other.local[i2]))
        return false;
    for (let i2 = 0; i2 < this.children.length; i2 += 3)
      if (this.children[i2] != other.children[i2] || this.children[i2 + 1] != other.children[i2 + 1] || !this.children[i2 + 2].eq(other.children[i2 + 2]))
        return false;
    return true;
  }
  /**
  @internal
  */
  locals(node3) {
    return removeOverlap(this.localsInner(node3));
  }
  /**
  @internal
  */
  localsInner(node3) {
    if (this == empty)
      return none;
    if (node3.inlineContent || !this.local.some(InlineType.is))
      return this.local;
    let result = [];
    for (let i2 = 0; i2 < this.local.length; i2++) {
      if (!(this.local[i2].type instanceof InlineType))
        result.push(this.local[i2]);
    }
    return result;
  }
  forEachSet(f) {
    f(this);
  }
}
DecorationSet.empty = new DecorationSet([], []);
DecorationSet.removeOverlap = removeOverlap;
const empty = DecorationSet.empty;
class DecorationGroup {
  static {
    __name(this, "DecorationGroup");
  }
  constructor(members) {
    this.members = members;
  }
  map(mapping, doc2) {
    const mappedDecos = this.members.map((member) => member.map(mapping, doc2, noSpec));
    return DecorationGroup.from(mappedDecos);
  }
  forChild(offset, child) {
    if (child.isLeaf)
      return DecorationSet.empty;
    let found2 = [];
    for (let i2 = 0; i2 < this.members.length; i2++) {
      let result = this.members[i2].forChild(offset, child);
      if (result == empty)
        continue;
      if (result instanceof DecorationGroup)
        found2 = found2.concat(result.members);
      else
        found2.push(result);
    }
    return DecorationGroup.from(found2);
  }
  eq(other) {
    if (!(other instanceof DecorationGroup) || other.members.length != this.members.length)
      return false;
    for (let i2 = 0; i2 < this.members.length; i2++)
      if (!this.members[i2].eq(other.members[i2]))
        return false;
    return true;
  }
  locals(node3) {
    let result, sorted = true;
    for (let i2 = 0; i2 < this.members.length; i2++) {
      let locals = this.members[i2].localsInner(node3);
      if (!locals.length)
        continue;
      if (!result) {
        result = locals;
      } else {
        if (sorted) {
          result = result.slice();
          sorted = false;
        }
        for (let j = 0; j < locals.length; j++)
          result.push(locals[j]);
      }
    }
    return result ? removeOverlap(sorted ? result : result.sort(byPos)) : none;
  }
  // Create a group for the given array of decoration sets, or return
  // a single set when possible.
  static from(members) {
    switch (members.length) {
      case 0:
        return empty;
      case 1:
        return members[0];
      default:
        return new DecorationGroup(members.every((m) => m instanceof DecorationSet) ? members : members.reduce((r, m) => r.concat(m instanceof DecorationSet ? m : m.members), []));
    }
  }
  forEachSet(f) {
    for (let i2 = 0; i2 < this.members.length; i2++)
      this.members[i2].forEachSet(f);
  }
}
function mapChildren(oldChildren, newLocal, mapping, node3, offset, oldOffset, options4) {
  let children = oldChildren.slice();
  for (let i2 = 0, baseOffset = oldOffset; i2 < mapping.maps.length; i2++) {
    let moved = 0;
    mapping.maps[i2].forEach((oldStart, oldEnd, newStart, newEnd) => {
      let dSize = newEnd - newStart - (oldEnd - oldStart);
      for (let i3 = 0; i3 < children.length; i3 += 3) {
        let end = children[i3 + 1];
        if (end < 0 || oldStart > end + baseOffset - moved)
          continue;
        let start2 = children[i3] + baseOffset - moved;
        if (oldEnd >= start2) {
          children[i3 + 1] = oldStart <= start2 ? -2 : -1;
        } else if (oldStart >= baseOffset && dSize) {
          children[i3] += dSize;
          children[i3 + 1] += dSize;
        }
      }
      moved += dSize;
    });
    baseOffset = mapping.maps[i2].map(baseOffset, -1);
  }
  let mustRebuild = false;
  for (let i2 = 0; i2 < children.length; i2 += 3)
    if (children[i2 + 1] < 0) {
      if (children[i2 + 1] == -2) {
        mustRebuild = true;
        children[i2 + 1] = -1;
        continue;
      }
      let from2 = mapping.map(oldChildren[i2] + oldOffset), fromLocal = from2 - offset;
      if (fromLocal < 0 || fromLocal >= node3.content.size) {
        mustRebuild = true;
        continue;
      }
      let to = mapping.map(oldChildren[i2 + 1] + oldOffset, -1), toLocal = to - offset;
      let { index: index2, offset: childOffset } = node3.content.findIndex(fromLocal);
      let childNode = node3.maybeChild(index2);
      if (childNode && childOffset == fromLocal && childOffset + childNode.nodeSize == toLocal) {
        let mapped = children[i2 + 2].mapInner(mapping, childNode, from2 + 1, oldChildren[i2] + oldOffset + 1, options4);
        if (mapped != empty) {
          children[i2] = fromLocal;
          children[i2 + 1] = toLocal;
          children[i2 + 2] = mapped;
        } else {
          children[i2 + 1] = -2;
          mustRebuild = true;
        }
      } else {
        mustRebuild = true;
      }
    }
  if (mustRebuild) {
    let decorations = mapAndGatherRemainingDecorations(children, oldChildren, newLocal, mapping, offset, oldOffset, options4);
    let built = buildTree(decorations, node3, 0, options4);
    newLocal = built.local;
    for (let i2 = 0; i2 < children.length; i2 += 3)
      if (children[i2 + 1] < 0) {
        children.splice(i2, 3);
        i2 -= 3;
      }
    for (let i2 = 0, j = 0; i2 < built.children.length; i2 += 3) {
      let from2 = built.children[i2];
      while (j < children.length && children[j] < from2)
        j += 3;
      children.splice(j, 0, built.children[i2], built.children[i2 + 1], built.children[i2 + 2]);
    }
  }
  return new DecorationSet(newLocal.sort(byPos), children);
}
__name(mapChildren, "mapChildren");
function moveSpans(spans, offset) {
  if (!offset || !spans.length)
    return spans;
  let result = [];
  for (let i2 = 0; i2 < spans.length; i2++) {
    let span = spans[i2];
    result.push(new Decoration(span.from + offset, span.to + offset, span.type));
  }
  return result;
}
__name(moveSpans, "moveSpans");
function mapAndGatherRemainingDecorations(children, oldChildren, decorations, mapping, offset, oldOffset, options4) {
  function gather(set3, oldOffset2) {
    for (let i2 = 0; i2 < set3.local.length; i2++) {
      let mapped = set3.local[i2].map(mapping, offset, oldOffset2);
      if (mapped)
        decorations.push(mapped);
      else if (options4.onRemove)
        options4.onRemove(set3.local[i2].spec);
    }
    for (let i2 = 0; i2 < set3.children.length; i2 += 3)
      gather(set3.children[i2 + 2], set3.children[i2] + oldOffset2 + 1);
  }
  __name(gather, "gather");
  for (let i2 = 0; i2 < children.length; i2 += 3)
    if (children[i2 + 1] == -1)
      gather(children[i2 + 2], oldChildren[i2] + oldOffset + 1);
  return decorations;
}
__name(mapAndGatherRemainingDecorations, "mapAndGatherRemainingDecorations");
function takeSpansForNode(spans, node3, offset) {
  if (node3.isLeaf)
    return null;
  let end = offset + node3.nodeSize, found2 = null;
  for (let i2 = 0, span; i2 < spans.length; i2++) {
    if ((span = spans[i2]) && span.from > offset && span.to < end) {
      (found2 || (found2 = [])).push(span);
      spans[i2] = null;
    }
  }
  return found2;
}
__name(takeSpansForNode, "takeSpansForNode");
function withoutNulls(array) {
  let result = [];
  for (let i2 = 0; i2 < array.length; i2++)
    if (array[i2] != null)
      result.push(array[i2]);
  return result;
}
__name(withoutNulls, "withoutNulls");
function buildTree(spans, node3, offset, options4) {
  let children = [], hasNulls = false;
  node3.forEach((childNode, localStart) => {
    let found2 = takeSpansForNode(spans, childNode, localStart + offset);
    if (found2) {
      hasNulls = true;
      let subtree = buildTree(found2, childNode, offset + localStart + 1, options4);
      if (subtree != empty)
        children.push(localStart, localStart + childNode.nodeSize, subtree);
    }
  });
  let locals = moveSpans(hasNulls ? withoutNulls(spans) : spans, -offset).sort(byPos);
  for (let i2 = 0; i2 < locals.length; i2++)
    if (!locals[i2].type.valid(node3, locals[i2])) {
      if (options4.onRemove)
        options4.onRemove(locals[i2].spec);
      locals.splice(i2--, 1);
    }
  return locals.length || children.length ? new DecorationSet(locals, children) : empty;
}
__name(buildTree, "buildTree");
function byPos(a, b) {
  return a.from - b.from || a.to - b.to;
}
__name(byPos, "byPos");
function removeOverlap(spans) {
  let working = spans;
  for (let i2 = 0; i2 < working.length - 1; i2++) {
    let span = working[i2];
    if (span.from != span.to)
      for (let j = i2 + 1; j < working.length; j++) {
        let next2 = working[j];
        if (next2.from == span.from) {
          if (next2.to != span.to) {
            if (working == spans)
              working = spans.slice();
            working[j] = next2.copy(next2.from, span.to);
            insertAhead(working, j + 1, next2.copy(span.to, next2.to));
          }
          continue;
        } else {
          if (next2.from < span.to) {
            if (working == spans)
              working = spans.slice();
            working[i2] = span.copy(span.from, next2.from);
            insertAhead(working, j, span.copy(next2.from, span.to));
          }
          break;
        }
      }
  }
  return working;
}
__name(removeOverlap, "removeOverlap");
function insertAhead(array, i2, deco) {
  while (i2 < array.length && byPos(deco, array[i2]) > 0)
    i2++;
  array.splice(i2, 0, deco);
}
__name(insertAhead, "insertAhead");
function viewDecorations(view) {
  let found2 = [];
  view.someProp("decorations", (f) => {
    let result = f(view.state);
    if (result && result != empty)
      found2.push(result);
  });
  if (view.cursorWrapper)
    found2.push(DecorationSet.create(view.state.doc, [view.cursorWrapper.deco]));
  return DecorationGroup.from(found2);
}
__name(viewDecorations, "viewDecorations");
const observeOptions = {
  childList: true,
  characterData: true,
  characterDataOldValue: true,
  attributes: true,
  attributeOldValue: true,
  subtree: true
};
const useCharData = ie$1 && ie_version <= 11;
class SelectionState {
  static {
    __name(this, "SelectionState");
  }
  constructor() {
    this.anchorNode = null;
    this.anchorOffset = 0;
    this.focusNode = null;
    this.focusOffset = 0;
  }
  set(sel) {
    this.anchorNode = sel.anchorNode;
    this.anchorOffset = sel.anchorOffset;
    this.focusNode = sel.focusNode;
    this.focusOffset = sel.focusOffset;
  }
  clear() {
    this.anchorNode = this.focusNode = null;
  }
  eq(sel) {
    return sel.anchorNode == this.anchorNode && sel.anchorOffset == this.anchorOffset && sel.focusNode == this.focusNode && sel.focusOffset == this.focusOffset;
  }
}
class DOMObserver {
  static {
    __name(this, "DOMObserver");
  }
  constructor(view, handleDOMChange) {
    this.view = view;
    this.handleDOMChange = handleDOMChange;
    this.queue = [];
    this.flushingSoon = -1;
    this.observer = null;
    this.currentSelection = new SelectionState();
    this.onCharData = null;
    this.suppressingSelectionUpdates = false;
    this.lastChangedTextNode = null;
    this.observer = window.MutationObserver && new window.MutationObserver((mutations) => {
      for (let i2 = 0; i2 < mutations.length; i2++)
        this.queue.push(mutations[i2]);
      if (ie$1 && ie_version <= 11 && mutations.some((m) => m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length))
        this.flushSoon();
      else
        this.flush();
    });
    if (useCharData) {
      this.onCharData = (e2) => {
        this.queue.push({ target: e2.target, type: "characterData", oldValue: e2.prevValue });
        this.flushSoon();
      };
    }
    this.onSelectionChange = this.onSelectionChange.bind(this);
  }
  flushSoon() {
    if (this.flushingSoon < 0)
      this.flushingSoon = window.setTimeout(() => {
        this.flushingSoon = -1;
        this.flush();
      }, 20);
  }
  forceFlush() {
    if (this.flushingSoon > -1) {
      window.clearTimeout(this.flushingSoon);
      this.flushingSoon = -1;
      this.flush();
    }
  }
  start() {
    if (this.observer) {
      this.observer.takeRecords();
      this.observer.observe(this.view.dom, observeOptions);
    }
    if (this.onCharData)
      this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData);
    this.connectSelection();
  }
  stop() {
    if (this.observer) {
      let take = this.observer.takeRecords();
      if (take.length) {
        for (let i2 = 0; i2 < take.length; i2++)
          this.queue.push(take[i2]);
        window.setTimeout(() => this.flush(), 20);
      }
      this.observer.disconnect();
    }
    if (this.onCharData)
      this.view.dom.removeEventListener("DOMCharacterDataModified", this.onCharData);
    this.disconnectSelection();
  }
  connectSelection() {
    this.view.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange);
  }
  disconnectSelection() {
    this.view.dom.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange);
  }
  suppressSelectionUpdates() {
    this.suppressingSelectionUpdates = true;
    setTimeout(() => this.suppressingSelectionUpdates = false, 50);
  }
  onSelectionChange() {
    if (!hasFocusAndSelection(this.view))
      return;
    if (this.suppressingSelectionUpdates)
      return selectionToDOM(this.view);
    if (ie$1 && ie_version <= 11 && !this.view.state.selection.empty) {
      let sel = this.view.domSelectionRange();
      if (sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))
        return this.flushSoon();
    }
    this.flush();
  }
  setCurSelection() {
    this.currentSelection.set(this.view.domSelectionRange());
  }
  ignoreSelectionChange(sel) {
    if (!sel.focusNode)
      return true;
    let ancestors = /* @__PURE__ */ new Set(), container;
    for (let scan = sel.focusNode; scan; scan = parentNode(scan))
      ancestors.add(scan);
    for (let scan = sel.anchorNode; scan; scan = parentNode(scan))
      if (ancestors.has(scan)) {
        container = scan;
        break;
      }
    let desc = container && this.view.docView.nearestDesc(container);
    if (desc && desc.ignoreMutation({
      type: "selection",
      target: container.nodeType == 3 ? container.parentNode : container
    })) {
      this.setCurSelection();
      return true;
    }
  }
  pendingRecords() {
    if (this.observer)
      for (let mut of this.observer.takeRecords())
        this.queue.push(mut);
    return this.queue;
  }
  flush() {
    let { view } = this;
    if (!view.docView || this.flushingSoon > -1)
      return;
    let mutations = this.pendingRecords();
    if (mutations.length)
      this.queue = [];
    let sel = view.domSelectionRange();
    let newSel = !this.suppressingSelectionUpdates && !this.currentSelection.eq(sel) && hasFocusAndSelection(view) && !this.ignoreSelectionChange(sel);
    let from2 = -1, to = -1, typeOver = false, added = [];
    if (view.editable) {
      for (let i2 = 0; i2 < mutations.length; i2++) {
        let result = this.registerMutation(mutations[i2], added);
        if (result) {
          from2 = from2 < 0 ? result.from : Math.min(result.from, from2);
          to = to < 0 ? result.to : Math.max(result.to, to);
          if (result.typeOver)
            typeOver = true;
        }
      }
    }
    if (gecko && added.length) {
      let brs = added.filter((n) => n.nodeName == "BR");
      if (brs.length == 2) {
        let [a, b] = brs;
        if (a.parentNode && a.parentNode.parentNode == b.parentNode)
          b.remove();
        else
          a.remove();
      } else {
        let { focusNode: focusNode2 } = this.currentSelection;
        for (let br of brs) {
          let parent = br.parentNode;
          if (parent && parent.nodeName == "LI" && (!focusNode2 || blockParent(view, focusNode2) != parent))
            br.remove();
        }
      }
    }
    let readSel = null;
    if (from2 < 0 && newSel && view.input.lastFocus > Date.now() - 200 && Math.max(view.input.lastTouch, view.input.lastClick.time) < Date.now() - 300 && selectionCollapsed(sel) && (readSel = selectionFromDOM(view)) && readSel.eq(Selection.near(view.state.doc.resolve(0), 1))) {
      view.input.lastFocus = 0;
      selectionToDOM(view);
      this.currentSelection.set(sel);
      view.scrollToSelection();
    } else if (from2 > -1 || newSel) {
      if (from2 > -1) {
        view.docView.markDirty(from2, to);
        checkCSS(view);
      }
      this.handleDOMChange(from2, to, typeOver, added);
      if (view.docView && view.docView.dirty)
        view.updateState(view.state);
      else if (!this.currentSelection.eq(sel))
        selectionToDOM(view);
      this.currentSelection.set(sel);
    }
  }
  registerMutation(mut, added) {
    if (added.indexOf(mut.target) > -1)
      return null;
    let desc = this.view.docView.nearestDesc(mut.target);
    if (mut.type == "attributes" && (desc == this.view.docView || mut.attributeName == "contenteditable" || // Firefox sometimes fires spurious events for null/empty styles
    mut.attributeName == "style" && !mut.oldValue && !mut.target.getAttribute("style")))
      return null;
    if (!desc || desc.ignoreMutation(mut))
      return null;
    if (mut.type == "childList") {
      for (let i2 = 0; i2 < mut.addedNodes.length; i2++) {
        let node3 = mut.addedNodes[i2];
        added.push(node3);
        if (node3.nodeType == 3)
          this.lastChangedTextNode = node3;
      }
      if (desc.contentDOM && desc.contentDOM != desc.dom && !desc.contentDOM.contains(mut.target))
        return { from: desc.posBefore, to: desc.posAfter };
      let prev2 = mut.previousSibling, next2 = mut.nextSibling;
      if (ie$1 && ie_version <= 11 && mut.addedNodes.length) {
        for (let i2 = 0; i2 < mut.addedNodes.length; i2++) {
          let { previousSibling, nextSibling } = mut.addedNodes[i2];
          if (!previousSibling || Array.prototype.indexOf.call(mut.addedNodes, previousSibling) < 0)
            prev2 = previousSibling;
          if (!nextSibling || Array.prototype.indexOf.call(mut.addedNodes, nextSibling) < 0)
            next2 = nextSibling;
        }
      }
      let fromOffset = prev2 && prev2.parentNode == mut.target ? domIndex(prev2) + 1 : 0;
      let from2 = desc.localPosFromDOM(mut.target, fromOffset, -1);
      let toOffset = next2 && next2.parentNode == mut.target ? domIndex(next2) : mut.target.childNodes.length;
      let to = desc.localPosFromDOM(mut.target, toOffset, 1);
      return { from: from2, to };
    } else if (mut.type == "attributes") {
      return { from: desc.posAtStart - desc.border, to: desc.posAtEnd + desc.border };
    } else {
      this.lastChangedTextNode = mut.target;
      return {
        from: desc.posAtStart,
        to: desc.posAtEnd,
        // An event was generated for a text change that didn't change
        // any text. Mark the dom change to fall back to assuming the
        // selection was typed over with an identical value if it can't
        // find another change.
        typeOver: mut.target.nodeValue == mut.oldValue
      };
    }
  }
}
let cssChecked = /* @__PURE__ */ new WeakMap();
let cssCheckWarned = false;
function checkCSS(view) {
  if (cssChecked.has(view))
    return;
  cssChecked.set(view, null);
  if (["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(view.dom).whiteSpace) !== -1) {
    view.requiresGeckoHackNode = gecko;
    if (cssCheckWarned)
      return;
    console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.");
    cssCheckWarned = true;
  }
}
__name(checkCSS, "checkCSS");
function rangeToSelectionRange(view, range2) {
  let anchorNode = range2.startContainer, anchorOffset = range2.startOffset;
  let focusNode2 = range2.endContainer, focusOffset = range2.endOffset;
  let currentAnchor = view.domAtPos(view.state.selection.anchor);
  if (isEquivalentPosition(currentAnchor.node, currentAnchor.offset, focusNode2, focusOffset))
    [anchorNode, anchorOffset, focusNode2, focusOffset] = [focusNode2, focusOffset, anchorNode, anchorOffset];
  return { anchorNode, anchorOffset, focusNode: focusNode2, focusOffset };
}
__name(rangeToSelectionRange, "rangeToSelectionRange");
function safariShadowSelectionRange(view, selection) {
  if (selection.getComposedRanges) {
    let range2 = selection.getComposedRanges(view.root)[0];
    if (range2)
      return rangeToSelectionRange(view, range2);
  }
  let found2;
  function read(event) {
    event.preventDefault();
    event.stopImmediatePropagation();
    found2 = event.getTargetRanges()[0];
  }
  __name(read, "read");
  view.dom.addEventListener("beforeinput", read, true);
  document.execCommand("indent");
  view.dom.removeEventListener("beforeinput", read, true);
  return found2 ? rangeToSelectionRange(view, found2) : null;
}
__name(safariShadowSelectionRange, "safariShadowSelectionRange");
function blockParent(view, node3) {
  for (let p2 = node3.parentNode; p2 && p2 != view.dom; p2 = p2.parentNode) {
    let desc = view.docView.nearestDesc(p2, true);
    if (desc && desc.node.isBlock)
      return p2;
  }
  return null;
}
__name(blockParent, "blockParent");
function parseBetween(view, from_, to_) {
  let { node: parent, fromOffset, toOffset, from: from2, to } = view.docView.parseRange(from_, to_);
  let domSel = view.domSelectionRange();
  let find2;
  let anchor = domSel.anchorNode;
  if (anchor && view.dom.contains(anchor.nodeType == 1 ? anchor : anchor.parentNode)) {
    find2 = [{ node: anchor, offset: domSel.anchorOffset }];
    if (!selectionCollapsed(domSel))
      find2.push({ node: domSel.focusNode, offset: domSel.focusOffset });
  }
  if (chrome && view.input.lastKeyCode === 8) {
    for (let off = toOffset; off > fromOffset; off--) {
      let node3 = parent.childNodes[off - 1], desc = node3.pmViewDesc;
      if (node3.nodeName == "BR" && !desc) {
        toOffset = off;
        break;
      }
      if (!desc || desc.size)
        break;
    }
  }
  let startDoc = view.state.doc;
  let parser = view.someProp("domParser") || DOMParser.fromSchema(view.state.schema);
  let $from = startDoc.resolve(from2);
  let sel = null, doc2 = parser.parse(parent, {
    topNode: $from.parent,
    topMatch: $from.parent.contentMatchAt($from.index()),
    topOpen: true,
    from: fromOffset,
    to: toOffset,
    preserveWhitespace: $from.parent.type.whitespace == "pre" ? "full" : true,
    findPositions: find2,
    ruleFromNode,
    context: $from
  });
  if (find2 && find2[0].pos != null) {
    let anchor2 = find2[0].pos, head = find2[1] && find2[1].pos;
    if (head == null)
      head = anchor2;
    sel = { anchor: anchor2 + from2, head: head + from2 };
  }
  return { doc: doc2, sel, from: from2, to };
}
__name(parseBetween, "parseBetween");
function ruleFromNode(dom) {
  let desc = dom.pmViewDesc;
  if (desc) {
    return desc.parseRule();
  } else if (dom.nodeName == "BR" && dom.parentNode) {
    if (safari && /^(ul|ol)$/i.test(dom.parentNode.nodeName)) {
      let skip = document.createElement("div");
      skip.appendChild(document.createElement("li"));
      return { skip };
    } else if (dom.parentNode.lastChild == dom || safari && /^(tr|table)$/i.test(dom.parentNode.nodeName)) {
      return { ignore: true };
    }
  } else if (dom.nodeName == "IMG" && dom.getAttribute("mark-placeholder")) {
    return { ignore: true };
  }
  return null;
}
__name(ruleFromNode, "ruleFromNode");
const isInline$1 = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
function readDOMChange(view, from2, to, typeOver, addedNodes) {
  let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);
  view.input.compositionPendingChanges = 0;
  if (from2 < 0) {
    let origin2 = view.input.lastSelectionTime > Date.now() - 50 ? view.input.lastSelectionOrigin : null;
    let newSel = selectionFromDOM(view, origin2);
    if (newSel && !view.state.selection.eq(newSel)) {
      if (chrome && android && view.input.lastKeyCode === 13 && Date.now() - 100 < view.input.lastKeyCodeTime && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter"))))
        return;
      let tr3 = view.state.tr.setSelection(newSel);
      if (origin2 == "pointer")
        tr3.setMeta("pointer", true);
      else if (origin2 == "key")
        tr3.scrollIntoView();
      if (compositionID)
        tr3.setMeta("composition", compositionID);
      view.dispatch(tr3);
    }
    return;
  }
  let $before = view.state.doc.resolve(from2);
  let shared = $before.sharedDepth(to);
  from2 = $before.before(shared + 1);
  to = view.state.doc.resolve(to).after(shared + 1);
  let sel = view.state.selection;
  let parse2 = parseBetween(view, from2, to);
  let doc2 = view.state.doc, compare2 = doc2.slice(parse2.from, parse2.to);
  let preferredPos, preferredSide;
  if (view.input.lastKeyCode === 8 && Date.now() - 100 < view.input.lastKeyCodeTime) {
    preferredPos = view.state.selection.to;
    preferredSide = "end";
  } else {
    preferredPos = view.state.selection.from;
    preferredSide = "start";
  }
  view.input.lastKeyCode = null;
  let change = findDiff(compare2.content, parse2.doc.content, parse2.from, preferredPos, preferredSide);
  if (change)
    view.input.domChangeCount++;
  if ((ios && view.input.lastIOSEnter > Date.now() - 225 || android) && addedNodes.some((n) => n.nodeType == 1 && !isInline$1.test(n.nodeName)) && (!change || change.endA >= change.endB) && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")))) {
    view.input.lastIOSEnter = 0;
    return;
  }
  if (!change) {
    if (typeOver && sel instanceof TextSelection && !sel.empty && sel.$head.sameParent(sel.$anchor) && !view.composing && !(parse2.sel && parse2.sel.anchor != parse2.sel.head)) {
      change = { start: sel.from, endA: sel.to, endB: sel.to };
    } else {
      if (parse2.sel) {
        let sel2 = resolveSelection(view, view.state.doc, parse2.sel);
        if (sel2 && !sel2.eq(view.state.selection)) {
          let tr3 = view.state.tr.setSelection(sel2);
          if (compositionID)
            tr3.setMeta("composition", compositionID);
          view.dispatch(tr3);
        }
      }
      return;
    }
  }
  if (view.state.selection.from < view.state.selection.to && change.start == change.endB && view.state.selection instanceof TextSelection) {
    if (change.start > view.state.selection.from && change.start <= view.state.selection.from + 2 && view.state.selection.from >= parse2.from) {
      change.start = view.state.selection.from;
    } else if (change.endA < view.state.selection.to && change.endA >= view.state.selection.to - 2 && view.state.selection.to <= parse2.to) {
      change.endB += view.state.selection.to - change.endA;
      change.endA = view.state.selection.to;
    }
  }
  if (ie$1 && ie_version <= 11 && change.endB == change.start + 1 && change.endA == change.start && change.start > parse2.from && parse2.doc.textBetween(change.start - parse2.from - 1, change.start - parse2.from + 1) == "  ") {
    change.start--;
    change.endA--;
    change.endB--;
  }
  let $from = parse2.doc.resolveNoCache(change.start - parse2.from);
  let $to = parse2.doc.resolveNoCache(change.endB - parse2.from);
  let $fromA = doc2.resolve(change.start);
  let inlineChange = $from.sameParent($to) && $from.parent.inlineContent && $fromA.end() >= change.endA;
  let nextSel;
  if ((ios && view.input.lastIOSEnter > Date.now() - 225 && (!inlineChange || addedNodes.some((n) => n.nodeName == "DIV" || n.nodeName == "P")) || !inlineChange && $from.pos < parse2.doc.content.size && !$from.sameParent($to) && (nextSel = Selection.findFrom(parse2.doc.resolve($from.pos + 1), 1, true)) && nextSel.head == $to.pos) && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")))) {
    view.input.lastIOSEnter = 0;
    return;
  }
  if (view.state.selection.anchor > change.start && looksLikeBackspace(doc2, change.start, change.endA, $from, $to) && view.someProp("handleKeyDown", (f) => f(view, keyEvent(8, "Backspace")))) {
    if (android && chrome)
      view.domObserver.suppressSelectionUpdates();
    return;
  }
  if (chrome && change.endB == change.start)
    view.input.lastChromeDelete = Date.now();
  if (android && !inlineChange && $from.start() != $to.start() && $to.parentOffset == 0 && $from.depth == $to.depth && parse2.sel && parse2.sel.anchor == parse2.sel.head && parse2.sel.head == change.endA) {
    change.endB -= 2;
    $to = parse2.doc.resolveNoCache(change.endB - parse2.from);
    setTimeout(() => {
      view.someProp("handleKeyDown", function(f) {
        return f(view, keyEvent(13, "Enter"));
      });
    }, 20);
  }
  let chFrom = change.start, chTo = change.endA;
  let tr2, storedMarks, markChange;
  if (inlineChange) {
    if ($from.pos == $to.pos) {
      if (ie$1 && ie_version <= 11 && $from.parentOffset == 0) {
        view.domObserver.suppressSelectionUpdates();
        setTimeout(() => selectionToDOM(view), 20);
      }
      tr2 = view.state.tr.delete(chFrom, chTo);
      storedMarks = doc2.resolve(change.start).marksAcross(doc2.resolve(change.endA));
    } else if (
      // Adding or removing a mark
      change.endA == change.endB && (markChange = isMarkChange($from.parent.content.cut($from.parentOffset, $to.parentOffset), $fromA.parent.content.cut($fromA.parentOffset, change.endA - $fromA.start())))
    ) {
      tr2 = view.state.tr;
      if (markChange.type == "add")
        tr2.addMark(chFrom, chTo, markChange.mark);
      else
        tr2.removeMark(chFrom, chTo, markChange.mark);
    } else if ($from.parent.child($from.index()).isText && $from.index() == $to.index() - ($to.textOffset ? 0 : 1)) {
      let text2 = $from.parent.textBetween($from.parentOffset, $to.parentOffset);
      if (view.someProp("handleTextInput", (f) => f(view, chFrom, chTo, text2)))
        return;
      tr2 = view.state.tr.insertText(text2, chFrom, chTo);
    }
  }
  if (!tr2)
    tr2 = view.state.tr.replace(chFrom, chTo, parse2.doc.slice(change.start - parse2.from, change.endB - parse2.from));
  if (parse2.sel) {
    let sel2 = resolveSelection(view, tr2.doc, parse2.sel);
    if (sel2 && !(chrome && view.composing && sel2.empty && (change.start != change.endB || view.input.lastChromeDelete < Date.now() - 100) && (sel2.head == chFrom || sel2.head == tr2.mapping.map(chTo) - 1) || ie$1 && sel2.empty && sel2.head == chFrom))
      tr2.setSelection(sel2);
  }
  if (storedMarks)
    tr2.ensureMarks(storedMarks);
  if (compositionID)
    tr2.setMeta("composition", compositionID);
  view.dispatch(tr2.scrollIntoView());
}
__name(readDOMChange, "readDOMChange");
function resolveSelection(view, doc2, parsedSel) {
  if (Math.max(parsedSel.anchor, parsedSel.head) > doc2.content.size)
    return null;
  return selectionBetween(view, doc2.resolve(parsedSel.anchor), doc2.resolve(parsedSel.head));
}
__name(resolveSelection, "resolveSelection");
function isMarkChange(cur, prev2) {
  let curMarks = cur.firstChild.marks, prevMarks = prev2.firstChild.marks;
  let added = curMarks, removed = prevMarks, type, mark2, update;
  for (let i2 = 0; i2 < prevMarks.length; i2++)
    added = prevMarks[i2].removeFromSet(added);
  for (let i2 = 0; i2 < curMarks.length; i2++)
    removed = curMarks[i2].removeFromSet(removed);
  if (added.length == 1 && removed.length == 0) {
    mark2 = added[0];
    type = "add";
    update = /* @__PURE__ */ __name((node3) => node3.mark(mark2.addToSet(node3.marks)), "update");
  } else if (added.length == 0 && removed.length == 1) {
    mark2 = removed[0];
    type = "remove";
    update = /* @__PURE__ */ __name((node3) => node3.mark(mark2.removeFromSet(node3.marks)), "update");
  } else {
    return null;
  }
  let updated13 = [];
  for (let i2 = 0; i2 < prev2.childCount; i2++)
    updated13.push(update(prev2.child(i2)));
  if (Fragment.from(updated13).eq(cur))
    return { mark: mark2, type };
}
__name(isMarkChange, "isMarkChange");
function looksLikeBackspace(old, start2, end, $newStart, $newEnd) {
  if (
    // The content must have shrunk
    end - start2 <= $newEnd.pos - $newStart.pos || // newEnd must point directly at or after the end of the block that newStart points into
    skipClosingAndOpening($newStart, true, false) < $newEnd.pos
  )
    return false;
  let $start = old.resolve(start2);
  if (!$newStart.parent.isTextblock) {
    let after = $start.nodeAfter;
    return after != null && end == start2 + after.nodeSize;
  }
  if ($start.parentOffset < $start.parent.content.size || !$start.parent.isTextblock)
    return false;
  let $next = old.resolve(skipClosingAndOpening($start, true, true));
  if (!$next.parent.isTextblock || $next.pos > end || skipClosingAndOpening($next, true, false) < end)
    return false;
  return $newStart.parent.content.cut($newStart.parentOffset).eq($next.parent.content);
}
__name(looksLikeBackspace, "looksLikeBackspace");
function skipClosingAndOpening($pos, fromEnd, mayOpen) {
  let depth = $pos.depth, end = fromEnd ? $pos.end() : $pos.pos;
  while (depth > 0 && (fromEnd || $pos.indexAfter(depth) == $pos.node(depth).childCount)) {
    depth--;
    end++;
    fromEnd = false;
  }
  if (mayOpen) {
    let next2 = $pos.node(depth).maybeChild($pos.indexAfter(depth));
    while (next2 && !next2.isLeaf) {
      next2 = next2.firstChild;
      end++;
    }
  }
  return end;
}
__name(skipClosingAndOpening, "skipClosingAndOpening");
function findDiff(a, b, pos2, preferredPos, preferredSide) {
  let start2 = a.findDiffStart(b, pos2);
  if (start2 == null)
    return null;
  let { a: endA, b: endB } = a.findDiffEnd(b, pos2 + a.size, pos2 + b.size);
  if (preferredSide == "end") {
    let adjust = Math.max(0, start2 - Math.min(endA, endB));
    preferredPos -= endA + adjust - start2;
  }
  if (endA < start2 && a.size < b.size) {
    let move = preferredPos <= start2 && preferredPos >= endA ? start2 - preferredPos : 0;
    start2 -= move;
    if (start2 && start2 < b.size && isSurrogatePair(b.textBetween(start2 - 1, start2 + 1)))
      start2 += move ? 1 : -1;
    endB = start2 + (endB - endA);
    endA = start2;
  } else if (endB < start2) {
    let move = preferredPos <= start2 && preferredPos >= endB ? start2 - preferredPos : 0;
    start2 -= move;
    if (start2 && start2 < a.size && isSurrogatePair(a.textBetween(start2 - 1, start2 + 1)))
      start2 += move ? 1 : -1;
    endA = start2 + (endA - endB);
    endB = start2;
  }
  return { start: start2, endA, endB };
}
__name(findDiff, "findDiff");
function isSurrogatePair(str) {
  if (str.length != 2)
    return false;
  let a = str.charCodeAt(0), b = str.charCodeAt(1);
  return a >= 56320 && a <= 57343 && b >= 55296 && b <= 56319;
}
__name(isSurrogatePair, "isSurrogatePair");
const __serializeForClipboard = serializeForClipboard;
const __parseFromClipboard = parseFromClipboard;
const __endComposition = endComposition;
class EditorView {
  static {
    __name(this, "EditorView");
  }
  /**
  Create a view. `place` may be a DOM node that the editor should
  be appended to, a function that will place it into the document,
  or an object whose `mount` property holds the node to use as the
  document container. If it is `null`, the editor will not be
  added to the document.
  */
  constructor(place, props) {
    this._root = null;
    this.focused = false;
    this.trackWrites = null;
    this.mounted = false;
    this.markCursor = null;
    this.cursorWrapper = null;
    this.lastSelectedViewDesc = void 0;
    this.input = new InputState();
    this.prevDirectPlugins = [];
    this.pluginViews = [];
    this.requiresGeckoHackNode = false;
    this.dragging = null;
    this._props = props;
    this.state = props.state;
    this.directPlugins = props.plugins || [];
    this.directPlugins.forEach(checkStateComponent);
    this.dispatch = this.dispatch.bind(this);
    this.dom = place && place.mount || document.createElement("div");
    if (place) {
      if (place.appendChild)
        place.appendChild(this.dom);
      else if (typeof place == "function")
        place(this.dom);
      else if (place.mount)
        this.mounted = true;
    }
    this.editable = getEditable(this);
    updateCursorWrapper(this);
    this.nodeViews = buildNodeViews(this);
    this.docView = docViewDesc(this.state.doc, computeDocDeco(this), viewDecorations(this), this.dom, this);
    this.domObserver = new DOMObserver(this, (from2, to, typeOver, added) => readDOMChange(this, from2, to, typeOver, added));
    this.domObserver.start();
    initInput(this);
    this.updatePluginViews();
  }
  /**
  Holds `true` when a
  [composition](https://w3c.github.io/uievents/#events-compositionevents)
  is active.
  */
  get composing() {
    return this.input.composing;
  }
  /**
  The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).
  */
  get props() {
    if (this._props.state != this.state) {
      let prev2 = this._props;
      this._props = {};
      for (let name2 in prev2)
        this._props[name2] = prev2[name2];
      this._props.state = this.state;
    }
    return this._props;
  }
  /**
  Update the view's props. Will immediately cause an update to
  the DOM.
  */
  update(props) {
    if (props.handleDOMEvents != this._props.handleDOMEvents)
      ensureListeners(this);
    let prevProps = this._props;
    this._props = props;
    if (props.plugins) {
      props.plugins.forEach(checkStateComponent);
      this.directPlugins = props.plugins;
    }
    this.updateStateInner(props.state, prevProps);
  }
  /**
  Update the view by updating existing props object with the object
  given as argument. Equivalent to `view.update(Object.assign({},
  view.props, props))`.
  */
  setProps(props) {
    let updated13 = {};
    for (let name2 in this._props)
      updated13[name2] = this._props[name2];
    updated13.state = this.state;
    for (let name2 in props)
      updated13[name2] = props[name2];
    this.update(updated13);
  }
  /**
  Update the editor's `state` prop, without touching any of the
  other props.
  */
  updateState(state) {
    this.updateStateInner(state, this._props);
  }
  updateStateInner(state, prevProps) {
    var _a2;
    let prev2 = this.state, redraw = false, updateSel = false;
    if (state.storedMarks && this.composing) {
      clearComposition(this);
      updateSel = true;
    }
    this.state = state;
    let pluginsChanged = prev2.plugins != state.plugins || this._props.plugins != prevProps.plugins;
    if (pluginsChanged || this._props.plugins != prevProps.plugins || this._props.nodeViews != prevProps.nodeViews) {
      let nodeViews = buildNodeViews(this);
      if (changedNodeViews(nodeViews, this.nodeViews)) {
        this.nodeViews = nodeViews;
        redraw = true;
      }
    }
    if (pluginsChanged || prevProps.handleDOMEvents != this._props.handleDOMEvents) {
      ensureListeners(this);
    }
    this.editable = getEditable(this);
    updateCursorWrapper(this);
    let innerDeco = viewDecorations(this), outerDeco = computeDocDeco(this);
    let scroll = prev2.plugins != state.plugins && !prev2.doc.eq(state.doc) ? "reset" : state.scrollToSelection > prev2.scrollToSelection ? "to selection" : "preserve";
    let updateDoc = redraw || !this.docView.matchesNode(state.doc, outerDeco, innerDeco);
    if (updateDoc || !state.selection.eq(prev2.selection))
      updateSel = true;
    let oldScrollPos = scroll == "preserve" && updateSel && this.dom.style.overflowAnchor == null && storeScrollPos(this);
    if (updateSel) {
      this.domObserver.stop();
      let forceSelUpdate = updateDoc && (ie$1 || chrome) && !this.composing && !prev2.selection.empty && !state.selection.empty && selectionContextChanged(prev2.selection, state.selection);
      if (updateDoc) {
        let chromeKludge = chrome ? this.trackWrites = this.domSelectionRange().focusNode : null;
        if (this.composing)
          this.input.compositionNode = findCompositionNode(this);
        if (redraw || !this.docView.update(state.doc, outerDeco, innerDeco, this)) {
          this.docView.updateOuterDeco(outerDeco);
          this.docView.destroy();
          this.docView = docViewDesc(state.doc, outerDeco, innerDeco, this.dom, this);
        }
        if (chromeKludge && !this.trackWrites)
          forceSelUpdate = true;
      }
      if (forceSelUpdate || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && anchorInRightPlace(this))) {
        selectionToDOM(this, forceSelUpdate);
      } else {
        syncNodeSelection(this, state.selection);
        this.domObserver.setCurSelection();
      }
      this.domObserver.start();
    }
    this.updatePluginViews(prev2);
    if (((_a2 = this.dragging) === null || _a2 === void 0 ? void 0 : _a2.node) && !prev2.doc.eq(state.doc))
      this.updateDraggedNode(this.dragging, prev2);
    if (scroll == "reset") {
      this.dom.scrollTop = 0;
    } else if (scroll == "to selection") {
      this.scrollToSelection();
    } else if (oldScrollPos) {
      resetScrollPos(oldScrollPos);
    }
  }
  /**
  @internal
  */
  scrollToSelection() {
    let startDOM = this.domSelectionRange().focusNode;
    if (this.someProp("handleScrollToSelection", (f) => f(this))) ;
    else if (this.state.selection instanceof NodeSelection) {
      let target = this.docView.domAfterPos(this.state.selection.from);
      if (target.nodeType == 1)
        scrollRectIntoView(this, target.getBoundingClientRect(), startDOM);
    } else {
      scrollRectIntoView(this, this.coordsAtPos(this.state.selection.head, 1), startDOM);
    }
  }
  destroyPluginViews() {
    let view;
    while (view = this.pluginViews.pop())
      if (view.destroy)
        view.destroy();
  }
  updatePluginViews(prevState) {
    if (!prevState || prevState.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {
      this.prevDirectPlugins = this.directPlugins;
      this.destroyPluginViews();
      for (let i2 = 0; i2 < this.directPlugins.length; i2++) {
        let plugin = this.directPlugins[i2];
        if (plugin.spec.view)
          this.pluginViews.push(plugin.spec.view(this));
      }
      for (let i2 = 0; i2 < this.state.plugins.length; i2++) {
        let plugin = this.state.plugins[i2];
        if (plugin.spec.view)
          this.pluginViews.push(plugin.spec.view(this));
      }
    } else {
      for (let i2 = 0; i2 < this.pluginViews.length; i2++) {
        let pluginView = this.pluginViews[i2];
        if (pluginView.update)
          pluginView.update(this, prevState);
      }
    }
  }
  updateDraggedNode(dragging, prev2) {
    let sel = dragging.node, found2 = -1;
    if (this.state.doc.nodeAt(sel.from) == sel.node) {
      found2 = sel.from;
    } else {
      let movedPos = sel.from + (this.state.doc.content.size - prev2.doc.content.size);
      let moved = movedPos > 0 && this.state.doc.nodeAt(movedPos);
      if (moved == sel.node)
        found2 = movedPos;
    }
    this.dragging = new Dragging(dragging.slice, dragging.move, found2 < 0 ? void 0 : NodeSelection.create(this.state.doc, found2));
  }
  someProp(propName, f) {
    let prop2 = this._props && this._props[propName], value4;
    if (prop2 != null && (value4 = f ? f(prop2) : prop2))
      return value4;
    for (let i2 = 0; i2 < this.directPlugins.length; i2++) {
      let prop3 = this.directPlugins[i2].props[propName];
      if (prop3 != null && (value4 = f ? f(prop3) : prop3))
        return value4;
    }
    let plugins = this.state.plugins;
    if (plugins)
      for (let i2 = 0; i2 < plugins.length; i2++) {
        let prop3 = plugins[i2].props[propName];
        if (prop3 != null && (value4 = f ? f(prop3) : prop3))
          return value4;
      }
  }
  /**
  Query whether the view has focus.
  */
  hasFocus() {
    if (ie$1) {
      let node3 = this.root.activeElement;
      if (node3 == this.dom)
        return true;
      if (!node3 || !this.dom.contains(node3))
        return false;
      while (node3 && this.dom != node3 && this.dom.contains(node3)) {
        if (node3.contentEditable == "false")
          return false;
        node3 = node3.parentElement;
      }
      return true;
    }
    return this.root.activeElement == this.dom;
  }
  /**
  Focus the editor.
  */
  focus() {
    this.domObserver.stop();
    if (this.editable)
      focusPreventScroll(this.dom);
    selectionToDOM(this);
    this.domObserver.start();
  }
  /**
  Get the document root in which the editor exists. This will
  usually be the top-level `document`, but might be a [shadow
  DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)
  root if the editor is inside one.
  */
  get root() {
    let cached = this._root;
    if (cached == null)
      for (let search2 = this.dom.parentNode; search2; search2 = search2.parentNode) {
        if (search2.nodeType == 9 || search2.nodeType == 11 && search2.host) {
          if (!search2.getSelection)
            Object.getPrototypeOf(search2).getSelection = () => search2.ownerDocument.getSelection();
          return this._root = search2;
        }
      }
    return cached || document;
  }
  /**
  When an existing editor view is moved to a new document or
  shadow tree, call this to make it recompute its root.
  */
  updateRoot() {
    this._root = null;
  }
  /**
  Given a pair of viewport coordinates, return the document
  position that corresponds to them. May return null if the given
  coordinates aren't inside of the editor. When an object is
  returned, its `pos` property is the position nearest to the
  coordinates, and its `inside` property holds the position of the
  inner node that the position falls inside of, or -1 if it is at
  the top level, not in any node.
  */
  posAtCoords(coords) {
    return posAtCoords(this, coords);
  }
  /**
  Returns the viewport rectangle at a given document position.
  `left` and `right` will be the same number, as this returns a
  flat cursor-ish rectangle. If the position is between two things
  that aren't directly adjacent, `side` determines which element
  is used. When < 0, the element before the position is used,
  otherwise the element after.
  */
  coordsAtPos(pos2, side = 1) {
    return coordsAtPos(this, pos2, side);
  }
  /**
  Find the DOM position that corresponds to the given document
  position. When `side` is negative, find the position as close as
  possible to the content before the position. When positive,
  prefer positions close to the content after the position. When
  zero, prefer as shallow a position as possible.
  
  Note that you should **not** mutate the editor's internal DOM,
  only inspect it (and even that is usually not necessary).
  */
  domAtPos(pos2, side = 0) {
    return this.docView.domFromPos(pos2, side);
  }
  /**
  Find the DOM node that represents the document node after the
  given position. May return `null` when the position doesn't point
  in front of a node or if the node is inside an opaque node view.
  
  This is intended to be able to call things like
  `getBoundingClientRect` on that DOM node. Do **not** mutate the
  editor DOM directly, or add styling this way, since that will be
  immediately overriden by the editor as it redraws the node.
  */
  nodeDOM(pos2) {
    let desc = this.docView.descAt(pos2);
    return desc ? desc.nodeDOM : null;
  }
  /**
  Find the document position that corresponds to a given DOM
  position. (Whenever possible, it is preferable to inspect the
  document structure directly, rather than poking around in the
  DOM, but sometimes—for example when interpreting an event
  target—you don't have a choice.)
  
  The `bias` parameter can be used to influence which side of a DOM
  node to use when the position is inside a leaf node.
  */
  posAtDOM(node3, offset, bias = -1) {
    let pos2 = this.docView.posFromDOM(node3, offset, bias);
    if (pos2 == null)
      throw new RangeError("DOM position not inside the editor");
    return pos2;
  }
  /**
  Find out whether the selection is at the end of a textblock when
  moving in a given direction. When, for example, given `"left"`,
  it will return true if moving left from the current cursor
  position would leave that position's parent textblock. Will apply
  to the view's current state by default, but it is possible to
  pass a different state.
  */
  endOfTextblock(dir, state) {
    return endOfTextblock(this, state || this.state, dir);
  }
  /**
  Run the editor's paste logic with the given HTML string. The
  `event`, if given, will be passed to the
  [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
  */
  pasteHTML(html, event) {
    return doPaste(this, "", html, false, event || new ClipboardEvent("paste"));
  }
  /**
  Run the editor's paste logic with the given plain-text input.
  */
  pasteText(text2, event) {
    return doPaste(this, text2, null, true, event || new ClipboardEvent("paste"));
  }
  /**
  Removes the editor from the DOM and destroys all [node
  views](https://prosemirror.net/docs/ref/#view.NodeView).
  */
  destroy() {
    if (!this.docView)
      return;
    destroyInput(this);
    this.destroyPluginViews();
    if (this.mounted) {
      this.docView.update(this.state.doc, [], viewDecorations(this), this);
      this.dom.textContent = "";
    } else if (this.dom.parentNode) {
      this.dom.parentNode.removeChild(this.dom);
    }
    this.docView.destroy();
    this.docView = null;
    clearReusedRange();
  }
  /**
  This is true when the view has been
  [destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be
  used anymore).
  */
  get isDestroyed() {
    return this.docView == null;
  }
  /**
  Used for testing.
  */
  dispatchEvent(event) {
    return dispatchEvent(this, event);
  }
  /**
  Dispatch a transaction. Will call
  [`dispatchTransaction`](https://prosemirror.net/docs/ref/#view.DirectEditorProps.dispatchTransaction)
  when given, and otherwise defaults to applying the transaction to
  the current state and calling
  [`updateState`](https://prosemirror.net/docs/ref/#view.EditorView.updateState) with the result.
  This method is bound to the view instance, so that it can be
  easily passed around.
  */
  dispatch(tr2) {
    let dispatchTransaction = this._props.dispatchTransaction;
    if (dispatchTransaction)
      dispatchTransaction.call(this, tr2);
    else
      this.updateState(this.state.apply(tr2));
  }
  /**
  @internal
  */
  domSelectionRange() {
    let sel = this.domSelection();
    if (!sel)
      return { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
    return safari && this.root.nodeType === 11 && deepActiveElement(this.dom.ownerDocument) == this.dom && safariShadowSelectionRange(this, sel) || sel;
  }
  /**
  @internal
  */
  domSelection() {
    return this.root.getSelection();
  }
}
function computeDocDeco(view) {
  let attrs4 = /* @__PURE__ */ Object.create(null);
  attrs4.class = "ProseMirror";
  attrs4.contenteditable = String(view.editable);
  view.someProp("attributes", (value4) => {
    if (typeof value4 == "function")
      value4 = value4(view.state);
    if (value4)
      for (let attr in value4) {
        if (attr == "class")
          attrs4.class += " " + value4[attr];
        else if (attr == "style")
          attrs4.style = (attrs4.style ? attrs4.style + ";" : "") + value4[attr];
        else if (!attrs4[attr] && attr != "contenteditable" && attr != "nodeName")
          attrs4[attr] = String(value4[attr]);
      }
  });
  if (!attrs4.translate)
    attrs4.translate = "no";
  return [Decoration.node(0, view.state.doc.content.size, attrs4)];
}
__name(computeDocDeco, "computeDocDeco");
function updateCursorWrapper(view) {
  if (view.markCursor) {
    let dom = document.createElement("img");
    dom.className = "ProseMirror-separator";
    dom.setAttribute("mark-placeholder", "true");
    dom.setAttribute("alt", "");
    view.cursorWrapper = { dom, deco: Decoration.widget(view.state.selection.from, dom, { raw: true, marks: view.markCursor }) };
  } else {
    view.cursorWrapper = null;
  }
}
__name(updateCursorWrapper, "updateCursorWrapper");
function getEditable(view) {
  return !view.someProp("editable", (value4) => value4(view.state) === false);
}
__name(getEditable, "getEditable");
function selectionContextChanged(sel1, sel2) {
  let depth = Math.min(sel1.$anchor.sharedDepth(sel1.head), sel2.$anchor.sharedDepth(sel2.head));
  return sel1.$anchor.start(depth) != sel2.$anchor.start(depth);
}
__name(selectionContextChanged, "selectionContextChanged");
function buildNodeViews(view) {
  let result = /* @__PURE__ */ Object.create(null);
  function add3(obj) {
    for (let prop2 in obj)
      if (!Object.prototype.hasOwnProperty.call(result, prop2))
        result[prop2] = obj[prop2];
  }
  __name(add3, "add");
  view.someProp("nodeViews", add3);
  view.someProp("markViews", add3);
  return result;
}
__name(buildNodeViews, "buildNodeViews");
function changedNodeViews(a, b) {
  let nA = 0, nB = 0;
  for (let prop2 in a) {
    if (a[prop2] != b[prop2])
      return true;
    nA++;
  }
  for (let _2 in b)
    nB++;
  return nA != nB;
}
__name(changedNodeViews, "changedNodeViews");
function checkStateComponent(plugin) {
  if (plugin.spec.state || plugin.spec.filterTransaction || plugin.spec.appendTransaction)
    throw new RangeError("Plugins passed directly to the view must not have a state component");
}
__name(checkStateComponent, "checkStateComponent");
var base$1 = {
  8: "Backspace",
  9: "Tab",
  10: "Enter",
  12: "NumLock",
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  20: "CapsLock",
  27: "Escape",
  32: " ",
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "ArrowLeft",
  38: "ArrowUp",
  39: "ArrowRight",
  40: "ArrowDown",
  44: "PrintScreen",
  45: "Insert",
  46: "Delete",
  59: ";",
  61: "=",
  91: "Meta",
  92: "Meta",
  106: "*",
  107: "+",
  108: ",",
  109: "-",
  110: ".",
  111: "/",
  144: "NumLock",
  145: "ScrollLock",
  160: "Shift",
  161: "Shift",
  162: "Control",
  163: "Control",
  164: "Alt",
  165: "Alt",
  173: "-",
  186: ";",
  187: "=",
  188: ",",
  189: "-",
  190: ".",
  191: "/",
  192: "`",
  219: "[",
  220: "\\",
  221: "]",
  222: "'"
};
var shift = {
  48: ")",
  49: "!",
  50: "@",
  51: "#",
  52: "$",
  53: "%",
  54: "^",
  55: "&",
  56: "*",
  57: "(",
  59: ":",
  61: "+",
  173: "_",
  186: ":",
  187: "+",
  188: "<",
  189: "_",
  190: ">",
  191: "?",
  192: "~",
  219: "{",
  220: "|",
  221: "}",
  222: '"'
};
var mac$2 = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
for (var i = 0; i < 10; i++) base$1[48 + i] = base$1[96 + i] = String(i);
for (var i = 1; i <= 24; i++) base$1[i + 111] = "F" + i;
for (var i = 65; i <= 90; i++) {
  base$1[i] = String.fromCharCode(i + 32);
  shift[i] = String.fromCharCode(i);
}
for (var code$1 in base$1) if (!shift.hasOwnProperty(code$1)) shift[code$1] = base$1[code$1];
function keyName(event) {
  var ignoreKey = mac$2 && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey || ie && event.shiftKey && event.key && event.key.length == 1 || event.key == "Unidentified";
  var name2 = !ignoreKey && event.key || (event.shiftKey ? shift : base$1)[event.keyCode] || event.key || "Unidentified";
  if (name2 == "Esc") name2 = "Escape";
  if (name2 == "Del") name2 = "Delete";
  if (name2 == "Left") name2 = "ArrowLeft";
  if (name2 == "Up") name2 = "ArrowUp";
  if (name2 == "Right") name2 = "ArrowRight";
  if (name2 == "Down") name2 = "ArrowDown";
  return name2;
}
__name(keyName, "keyName");
const mac$1 = typeof navigator != "undefined" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : false;
function normalizeKeyName$1(name2) {
  let parts2 = name2.split(/-(?!$)/), result = parts2[parts2.length - 1];
  if (result == "Space")
    result = " ";
  let alt, ctrl, shift2, meta;
  for (let i2 = 0; i2 < parts2.length - 1; i2++) {
    let mod = parts2[i2];
    if (/^(cmd|meta|m)$/i.test(mod))
      meta = true;
    else if (/^a(lt)?$/i.test(mod))
      alt = true;
    else if (/^(c|ctrl|control)$/i.test(mod))
      ctrl = true;
    else if (/^s(hift)?$/i.test(mod))
      shift2 = true;
    else if (/^mod$/i.test(mod)) {
      if (mac$1)
        meta = true;
      else
        ctrl = true;
    } else
      throw new Error("Unrecognized modifier name: " + mod);
  }
  if (alt)
    result = "Alt-" + result;
  if (ctrl)
    result = "Ctrl-" + result;
  if (meta)
    result = "Meta-" + result;
  if (shift2)
    result = "Shift-" + result;
  return result;
}
__name(normalizeKeyName$1, "normalizeKeyName$1");
function normalize$1(map3) {
  let copy2 = /* @__PURE__ */ Object.create(null);
  for (let prop2 in map3)
    copy2[normalizeKeyName$1(prop2)] = map3[prop2];
  return copy2;
}
__name(normalize$1, "normalize$1");
function modifiers(name2, event, shift2 = true) {
  if (event.altKey)
    name2 = "Alt-" + name2;
  if (event.ctrlKey)
    name2 = "Ctrl-" + name2;
  if (event.metaKey)
    name2 = "Meta-" + name2;
  if (shift2 && event.shiftKey)
    name2 = "Shift-" + name2;
  return name2;
}
__name(modifiers, "modifiers");
function keymap(bindings) {
  return new Plugin({ props: { handleKeyDown: keydownHandler(bindings) } });
}
__name(keymap, "keymap");
function keydownHandler(bindings) {
  let map3 = normalize$1(bindings);
  return function(view, event) {
    let name2 = keyName(event), baseName, direct = map3[modifiers(name2, event)];
    if (direct && direct(view.state, view.dispatch, view))
      return true;
    if (name2.length == 1 && name2 != " ") {
      if (event.shiftKey) {
        let noShift = map3[modifiers(name2, event, false)];
        if (noShift && noShift(view.state, view.dispatch, view))
          return true;
      }
      if ((event.shiftKey || event.altKey || event.metaKey || name2.charCodeAt(0) > 127) && (baseName = base$1[event.keyCode]) && baseName != name2) {
        let fromCode = map3[modifiers(baseName, event)];
        if (fromCode && fromCode(view.state, view.dispatch, view))
          return true;
      }
    }
    return false;
  };
}
__name(keydownHandler, "keydownHandler");
const deleteSelection$1 = /* @__PURE__ */ __name((state, dispatch) => {
  if (state.selection.empty)
    return false;
  if (dispatch)
    dispatch(state.tr.deleteSelection().scrollIntoView());
  return true;
}, "deleteSelection$1");
function atBlockStart(state, view) {
  let { $cursor } = state.selection;
  if (!$cursor || (view ? !view.endOfTextblock("backward", state) : $cursor.parentOffset > 0))
    return null;
  return $cursor;
}
__name(atBlockStart, "atBlockStart");
const joinBackward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
  let $cursor = atBlockStart(state, view);
  if (!$cursor)
    return false;
  let $cut = findCutBefore($cursor);
  if (!$cut) {
    let range2 = $cursor.blockRange(), target = range2 && liftTarget(range2);
    if (target == null)
      return false;
    if (dispatch)
      dispatch(state.tr.lift(range2, target).scrollIntoView());
    return true;
  }
  let before = $cut.nodeBefore;
  if (deleteBarrier(state, $cut, dispatch, -1))
    return true;
  if ($cursor.parent.content.size == 0 && (textblockAt(before, "end") || NodeSelection.isSelectable(before))) {
    for (let depth = $cursor.depth; ; depth--) {
      let delStep = replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), Slice.empty);
      if (delStep && delStep.slice.size < delStep.to - delStep.from) {
        if (dispatch) {
          let tr2 = state.tr.step(delStep);
          tr2.setSelection(textblockAt(before, "end") ? Selection.findFrom(tr2.doc.resolve(tr2.mapping.map($cut.pos, -1)), -1) : NodeSelection.create(tr2.doc, $cut.pos - before.nodeSize));
          dispatch(tr2.scrollIntoView());
        }
        return true;
      }
      if (depth == 1 || $cursor.node(depth - 1).childCount > 1)
        break;
    }
  }
  if (before.isAtom && $cut.depth == $cursor.depth - 1) {
    if (dispatch)
      dispatch(state.tr.delete($cut.pos - before.nodeSize, $cut.pos).scrollIntoView());
    return true;
  }
  return false;
}, "joinBackward$1");
const joinTextblockBackward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
  let $cursor = atBlockStart(state, view);
  if (!$cursor)
    return false;
  let $cut = findCutBefore($cursor);
  return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;
}, "joinTextblockBackward$1");
const joinTextblockForward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
  let $cursor = atBlockEnd(state, view);
  if (!$cursor)
    return false;
  let $cut = findCutAfter($cursor);
  return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;
}, "joinTextblockForward$1");
function joinTextblocksAround(state, $cut, dispatch) {
  let before = $cut.nodeBefore, beforeText = before, beforePos = $cut.pos - 1;
  for (; !beforeText.isTextblock; beforePos--) {
    if (beforeText.type.spec.isolating)
      return false;
    let child = beforeText.lastChild;
    if (!child)
      return false;
    beforeText = child;
  }
  let after = $cut.nodeAfter, afterText = after, afterPos = $cut.pos + 1;
  for (; !afterText.isTextblock; afterPos++) {
    if (afterText.type.spec.isolating)
      return false;
    let child = afterText.firstChild;
    if (!child)
      return false;
    afterText = child;
  }
  let step3 = replaceStep(state.doc, beforePos, afterPos, Slice.empty);
  if (!step3 || step3.from != beforePos || step3 instanceof ReplaceStep && step3.slice.size >= afterPos - beforePos)
    return false;
  if (dispatch) {
    let tr2 = state.tr.step(step3);
    tr2.setSelection(TextSelection.create(tr2.doc, beforePos));
    dispatch(tr2.scrollIntoView());
  }
  return true;
}
__name(joinTextblocksAround, "joinTextblocksAround");
function textblockAt(node3, side, only = false) {
  for (let scan = node3; scan; scan = side == "start" ? scan.firstChild : scan.lastChild) {
    if (scan.isTextblock)
      return true;
    if (only && scan.childCount != 1)
      return false;
  }
  return false;
}
__name(textblockAt, "textblockAt");
const selectNodeBackward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
  let { $head, empty: empty3 } = state.selection, $cut = $head;
  if (!empty3)
    return false;
  if ($head.parent.isTextblock) {
    if (view ? !view.endOfTextblock("backward", state) : $head.parentOffset > 0)
      return false;
    $cut = findCutBefore($head);
  }
  let node3 = $cut && $cut.nodeBefore;
  if (!node3 || !NodeSelection.isSelectable(node3))
    return false;
  if (dispatch)
    dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos - node3.nodeSize)).scrollIntoView());
  return true;
}, "selectNodeBackward$1");
function findCutBefore($pos) {
  if (!$pos.parent.type.spec.isolating)
    for (let i2 = $pos.depth - 1; i2 >= 0; i2--) {
      if ($pos.index(i2) > 0)
        return $pos.doc.resolve($pos.before(i2 + 1));
      if ($pos.node(i2).type.spec.isolating)
        break;
    }
  return null;
}
__name(findCutBefore, "findCutBefore");
function atBlockEnd(state, view) {
  let { $cursor } = state.selection;
  if (!$cursor || (view ? !view.endOfTextblock("forward", state) : $cursor.parentOffset < $cursor.parent.content.size))
    return null;
  return $cursor;
}
__name(atBlockEnd, "atBlockEnd");
const joinForward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
  let $cursor = atBlockEnd(state, view);
  if (!$cursor)
    return false;
  let $cut = findCutAfter($cursor);
  if (!$cut)
    return false;
  let after = $cut.nodeAfter;
  if (deleteBarrier(state, $cut, dispatch, 1))
    return true;
  if ($cursor.parent.content.size == 0 && (textblockAt(after, "start") || NodeSelection.isSelectable(after))) {
    let delStep = replaceStep(state.doc, $cursor.before(), $cursor.after(), Slice.empty);
    if (delStep && delStep.slice.size < delStep.to - delStep.from) {
      if (dispatch) {
        let tr2 = state.tr.step(delStep);
        tr2.setSelection(textblockAt(after, "start") ? Selection.findFrom(tr2.doc.resolve(tr2.mapping.map($cut.pos)), 1) : NodeSelection.create(tr2.doc, tr2.mapping.map($cut.pos)));
        dispatch(tr2.scrollIntoView());
      }
      return true;
    }
  }
  if (after.isAtom && $cut.depth == $cursor.depth - 1) {
    if (dispatch)
      dispatch(state.tr.delete($cut.pos, $cut.pos + after.nodeSize).scrollIntoView());
    return true;
  }
  return false;
}, "joinForward$1");
const selectNodeForward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
  let { $head, empty: empty3 } = state.selection, $cut = $head;
  if (!empty3)
    return false;
  if ($head.parent.isTextblock) {
    if (view ? !view.endOfTextblock("forward", state) : $head.parentOffset < $head.parent.content.size)
      return false;
    $cut = findCutAfter($head);
  }
  let node3 = $cut && $cut.nodeAfter;
  if (!node3 || !NodeSelection.isSelectable(node3))
    return false;
  if (dispatch)
    dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos)).scrollIntoView());
  return true;
}, "selectNodeForward$1");
function findCutAfter($pos) {
  if (!$pos.parent.type.spec.isolating)
    for (let i2 = $pos.depth - 1; i2 >= 0; i2--) {
      let parent = $pos.node(i2);
      if ($pos.index(i2) + 1 < parent.childCount)
        return $pos.doc.resolve($pos.after(i2 + 1));
      if (parent.type.spec.isolating)
        break;
    }
  return null;
}
__name(findCutAfter, "findCutAfter");
const joinUp$1 = /* @__PURE__ */ __name((state, dispatch) => {
  let sel = state.selection, nodeSel = sel instanceof NodeSelection, point;
  if (nodeSel) {
    if (sel.node.isTextblock || !canJoin(state.doc, sel.from))
      return false;
    point = sel.from;
  } else {
    point = joinPoint(state.doc, sel.from, -1);
    if (point == null)
      return false;
  }
  if (dispatch) {
    let tr2 = state.tr.join(point);
    if (nodeSel)
      tr2.setSelection(NodeSelection.create(tr2.doc, point - state.doc.resolve(point).nodeBefore.nodeSize));
    dispatch(tr2.scrollIntoView());
  }
  return true;
}, "joinUp$1");
const joinDown$1 = /* @__PURE__ */ __name((state, dispatch) => {
  let sel = state.selection, point;
  if (sel instanceof NodeSelection) {
    if (sel.node.isTextblock || !canJoin(state.doc, sel.to))
      return false;
    point = sel.to;
  } else {
    point = joinPoint(state.doc, sel.to, 1);
    if (point == null)
      return false;
  }
  if (dispatch)
    dispatch(state.tr.join(point).scrollIntoView());
  return true;
}, "joinDown$1");
const lift$1 = /* @__PURE__ */ __name((state, dispatch) => {
  let { $from, $to } = state.selection;
  let range2 = $from.blockRange($to), target = range2 && liftTarget(range2);
  if (target == null)
    return false;
  if (dispatch)
    dispatch(state.tr.lift(range2, target).scrollIntoView());
  return true;
}, "lift$1");
const newlineInCode$1 = /* @__PURE__ */ __name((state, dispatch) => {
  let { $head, $anchor } = state.selection;
  if (!$head.parent.type.spec.code || !$head.sameParent($anchor))
    return false;
  if (dispatch)
    dispatch(state.tr.insertText("\n").scrollIntoView());
  return true;
}, "newlineInCode$1");
function defaultBlockAt$1(match2) {
  for (let i2 = 0; i2 < match2.edgeCount; i2++) {
    let { type } = match2.edge(i2);
    if (type.isTextblock && !type.hasRequiredAttrs())
      return type;
  }
  return null;
}
__name(defaultBlockAt$1, "defaultBlockAt$1");
const exitCode$1 = /* @__PURE__ */ __name((state, dispatch) => {
  let { $head, $anchor } = state.selection;
  if (!$head.parent.type.spec.code || !$head.sameParent($anchor))
    return false;
  let above = $head.node(-1), after = $head.indexAfter(-1), type = defaultBlockAt$1(above.contentMatchAt(after));
  if (!type || !above.canReplaceWith(after, after, type))
    return false;
  if (dispatch) {
    let pos2 = $head.after(), tr2 = state.tr.replaceWith(pos2, pos2, type.createAndFill());
    tr2.setSelection(Selection.near(tr2.doc.resolve(pos2), 1));
    dispatch(tr2.scrollIntoView());
  }
  return true;
}, "exitCode$1");
const createParagraphNear$1 = /* @__PURE__ */ __name((state, dispatch) => {
  let sel = state.selection, { $from, $to } = sel;
  if (sel instanceof AllSelection || $from.parent.inlineContent || $to.parent.inlineContent)
    return false;
  let type = defaultBlockAt$1($to.parent.contentMatchAt($to.indexAfter()));
  if (!type || !type.isTextblock)
    return false;
  if (dispatch) {
    let side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to).pos;
    let tr2 = state.tr.insert(side, type.createAndFill());
    tr2.setSelection(TextSelection.create(tr2.doc, side + 1));
    dispatch(tr2.scrollIntoView());
  }
  return true;
}, "createParagraphNear$1");
const liftEmptyBlock$1 = /* @__PURE__ */ __name((state, dispatch) => {
  let { $cursor } = state.selection;
  if (!$cursor || $cursor.parent.content.size)
    return false;
  if ($cursor.depth > 1 && $cursor.after() != $cursor.end(-1)) {
    let before = $cursor.before();
    if (canSplit(state.doc, before)) {
      if (dispatch)
        dispatch(state.tr.split(before).scrollIntoView());
      return true;
    }
  }
  let range2 = $cursor.blockRange(), target = range2 && liftTarget(range2);
  if (target == null)
    return false;
  if (dispatch)
    dispatch(state.tr.lift(range2, target).scrollIntoView());
  return true;
}, "liftEmptyBlock$1");
function splitBlockAs(splitNode) {
  return (state, dispatch) => {
    let { $from, $to } = state.selection;
    if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
      if (!$from.parentOffset || !canSplit(state.doc, $from.pos))
        return false;
      if (dispatch)
        dispatch(state.tr.split($from.pos).scrollIntoView());
      return true;
    }
    if (!$from.depth)
      return false;
    let types = [];
    let splitDepth, deflt, atEnd = false, atStart = false;
    for (let d = $from.depth; ; d--) {
      let node3 = $from.node(d);
      if (node3.isBlock) {
        atEnd = $from.end(d) == $from.pos + ($from.depth - d);
        atStart = $from.start(d) == $from.pos - ($from.depth - d);
        deflt = defaultBlockAt$1($from.node(d - 1).contentMatchAt($from.indexAfter(d - 1)));
        let splitType = splitNode && splitNode($to.parent, atEnd, $from);
        types.unshift(splitType || (atEnd && deflt ? { type: deflt } : null));
        splitDepth = d;
        break;
      } else {
        if (d == 1)
          return false;
        types.unshift(null);
      }
    }
    let tr2 = state.tr;
    if (state.selection instanceof TextSelection || state.selection instanceof AllSelection)
      tr2.deleteSelection();
    let splitPos = tr2.mapping.map($from.pos);
    let can = canSplit(tr2.doc, splitPos, types.length, types);
    if (!can) {
      types[0] = deflt ? { type: deflt } : null;
      can = canSplit(tr2.doc, splitPos, types.length, types);
    }
    tr2.split(splitPos, types.length, types);
    if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {
      let first2 = tr2.mapping.map($from.before(splitDepth)), $first = tr2.doc.resolve(first2);
      if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))
        tr2.setNodeMarkup(tr2.mapping.map($from.before(splitDepth)), deflt);
    }
    if (dispatch)
      dispatch(tr2.scrollIntoView());
    return true;
  };
}
__name(splitBlockAs, "splitBlockAs");
const splitBlock$1 = splitBlockAs();
const splitBlockKeepMarks = /* @__PURE__ */ __name((state, dispatch) => {
  return splitBlock$1(state, dispatch && ((tr2) => {
    let marks = state.storedMarks || state.selection.$to.parentOffset && state.selection.$from.marks();
    if (marks)
      tr2.ensureMarks(marks);
    dispatch(tr2);
  }));
}, "splitBlockKeepMarks");
const selectParentNode$1 = /* @__PURE__ */ __name((state, dispatch) => {
  let { $from, to } = state.selection, pos2;
  let same = $from.sharedDepth(to);
  if (same == 0)
    return false;
  pos2 = $from.before(same);
  if (dispatch)
    dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos2)));
  return true;
}, "selectParentNode$1");
const selectAll$1 = /* @__PURE__ */ __name((state, dispatch) => {
  if (dispatch)
    dispatch(state.tr.setSelection(new AllSelection(state.doc)));
  return true;
}, "selectAll$1");
function joinMaybeClear(state, $pos, dispatch) {
  let before = $pos.nodeBefore, after = $pos.nodeAfter, index2 = $pos.index();
  if (!before || !after || !before.type.compatibleContent(after.type))
    return false;
  if (!before.content.size && $pos.parent.canReplace(index2 - 1, index2)) {
    if (dispatch)
      dispatch(state.tr.delete($pos.pos - before.nodeSize, $pos.pos).scrollIntoView());
    return true;
  }
  if (!$pos.parent.canReplace(index2, index2 + 1) || !(after.isTextblock || canJoin(state.doc, $pos.pos)))
    return false;
  if (dispatch)
    dispatch(state.tr.join($pos.pos).scrollIntoView());
  return true;
}
__name(joinMaybeClear, "joinMaybeClear");
function deleteBarrier(state, $cut, dispatch, dir) {
  let before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match2;
  let isolated = before.type.spec.isolating || after.type.spec.isolating;
  if (!isolated && joinMaybeClear(state, $cut, dispatch))
    return true;
  let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
  if (canDelAfter && (conn = (match2 = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match2.matchType(conn[0] || after.type).validEnd) {
    if (dispatch) {
      let end = $cut.pos + after.nodeSize, wrap2 = Fragment.empty;
      for (let i2 = conn.length - 1; i2 >= 0; i2--)
        wrap2 = Fragment.from(conn[i2].create(null, wrap2));
      wrap2 = Fragment.from(before.copy(wrap2));
      let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap2, 1, 0), conn.length, true));
      let $joinAt = tr2.doc.resolve(end + 2 * conn.length);
      if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr2.doc, $joinAt.pos))
        tr2.join($joinAt.pos);
      dispatch(tr2.scrollIntoView());
    }
    return true;
  }
  let selAfter = after.type.spec.isolating || dir > 0 && isolated ? null : Selection.findFrom($cut, 1);
  let range2 = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range2 && liftTarget(range2);
  if (target != null && target >= $cut.depth) {
    if (dispatch)
      dispatch(state.tr.lift(range2, target).scrollIntoView());
    return true;
  }
  if (canDelAfter && textblockAt(after, "start", true) && textblockAt(before, "end")) {
    let at = before, wrap2 = [];
    for (; ; ) {
      wrap2.push(at);
      if (at.isTextblock)
        break;
      at = at.lastChild;
    }
    let afterText = after, afterDepth = 1;
    for (; !afterText.isTextblock; afterText = afterText.firstChild)
      afterDepth++;
    if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
      if (dispatch) {
        let end = Fragment.empty;
        for (let i2 = wrap2.length - 1; i2 >= 0; i2--)
          end = Fragment.from(wrap2[i2].copy(end));
        let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap2.length, 0), 0, true));
        dispatch(tr2.scrollIntoView());
      }
      return true;
    }
  }
  return false;
}
__name(deleteBarrier, "deleteBarrier");
function selectTextblockSide(side) {
  return function(state, dispatch) {
    let sel = state.selection, $pos = side < 0 ? sel.$from : sel.$to;
    let depth = $pos.depth;
    while ($pos.node(depth).isInline) {
      if (!depth)
        return false;
      depth--;
    }
    if (!$pos.node(depth).isTextblock)
      return false;
    if (dispatch)
      dispatch(state.tr.setSelection(TextSelection.create(state.doc, side < 0 ? $pos.start(depth) : $pos.end(depth))));
    return true;
  };
}
__name(selectTextblockSide, "selectTextblockSide");
const selectTextblockStart$1 = selectTextblockSide(-1);
const selectTextblockEnd$1 = selectTextblockSide(1);
function wrapIn$1(nodeType, attrs4 = null) {
  return function(state, dispatch) {
    let { $from, $to } = state.selection;
    let range2 = $from.blockRange($to), wrapping = range2 && findWrapping(range2, nodeType, attrs4);
    if (!wrapping)
      return false;
    if (dispatch)
      dispatch(state.tr.wrap(range2, wrapping).scrollIntoView());
    return true;
  };
}
__name(wrapIn$1, "wrapIn$1");
function setBlockType(nodeType, attrs4 = null) {
  return function(state, dispatch) {
    let applicable = false;
    for (let i2 = 0; i2 < state.selection.ranges.length && !applicable; i2++) {
      let { $from: { pos: from2 }, $to: { pos: to } } = state.selection.ranges[i2];
      state.doc.nodesBetween(from2, to, (node3, pos2) => {
        if (applicable)
          return false;
        if (!node3.isTextblock || node3.hasMarkup(nodeType, attrs4))
          return;
        if (node3.type == nodeType) {
          applicable = true;
        } else {
          let $pos = state.doc.resolve(pos2), index2 = $pos.index();
          applicable = $pos.parent.canReplaceWith(index2, index2 + 1, nodeType);
        }
      });
    }
    if (!applicable)
      return false;
    if (dispatch) {
      let tr2 = state.tr;
      for (let i2 = 0; i2 < state.selection.ranges.length; i2++) {
        let { $from: { pos: from2 }, $to: { pos: to } } = state.selection.ranges[i2];
        tr2.setBlockType(from2, to, nodeType, attrs4);
      }
      dispatch(tr2.scrollIntoView());
    }
    return true;
  };
}
__name(setBlockType, "setBlockType");
function markApplies(doc2, ranges, type, enterAtoms) {
  for (let i2 = 0; i2 < ranges.length; i2++) {
    let { $from, $to } = ranges[i2];
    let can = $from.depth == 0 ? doc2.inlineContent && doc2.type.allowsMarkType(type) : false;
    doc2.nodesBetween($from.pos, $to.pos, (node3, pos2) => {
      if (can || !enterAtoms && node3.isAtom && node3.isInline && pos2 >= $from.pos && pos2 + node3.nodeSize <= $to.pos)
        return false;
      can = node3.inlineContent && node3.type.allowsMarkType(type);
    });
    if (can)
      return true;
  }
  return false;
}
__name(markApplies, "markApplies");
function removeInlineAtoms(ranges) {
  let result = [];
  for (let i2 = 0; i2 < ranges.length; i2++) {
    let { $from, $to } = ranges[i2];
    $from.doc.nodesBetween($from.pos, $to.pos, (node3, pos2) => {
      if (node3.isAtom && node3.content.size && node3.isInline && pos2 >= $from.pos && pos2 + node3.nodeSize <= $to.pos) {
        if (pos2 + 1 > $from.pos)
          result.push(new SelectionRange($from, $from.doc.resolve(pos2 + 1)));
        $from = $from.doc.resolve(pos2 + 1 + node3.content.size);
        return false;
      }
    });
    if ($from.pos < $to.pos)
      result.push(new SelectionRange($from, $to));
  }
  return result;
}
__name(removeInlineAtoms, "removeInlineAtoms");
function toggleMark$1(markType, attrs4 = null, options4) {
  let removeWhenPresent = (options4 && options4.removeWhenPresent) !== false;
  let enterAtoms = (options4 && options4.enterInlineAtoms) !== false;
  return function(state, dispatch) {
    let { empty: empty3, $cursor, ranges } = state.selection;
    if (empty3 && !$cursor || !markApplies(state.doc, ranges, markType, enterAtoms))
      return false;
    if (dispatch) {
      if ($cursor) {
        if (markType.isInSet(state.storedMarks || $cursor.marks()))
          dispatch(state.tr.removeStoredMark(markType));
        else
          dispatch(state.tr.addStoredMark(markType.create(attrs4)));
      } else {
        let add3, tr2 = state.tr;
        if (!enterAtoms)
          ranges = removeInlineAtoms(ranges);
        if (removeWhenPresent) {
          add3 = !ranges.some((r) => state.doc.rangeHasMark(r.$from.pos, r.$to.pos, markType));
        } else {
          add3 = !ranges.every((r) => {
            let missing = false;
            tr2.doc.nodesBetween(r.$from.pos, r.$to.pos, (node3, pos2, parent) => {
              if (missing)
                return false;
              missing = !markType.isInSet(node3.marks) && !!parent && parent.type.allowsMarkType(markType) && !(node3.isText && /^\s*$/.test(node3.textBetween(Math.max(0, r.$from.pos - pos2), Math.min(node3.nodeSize, r.$to.pos - pos2))));
            });
            return !missing;
          });
        }
        for (let i2 = 0; i2 < ranges.length; i2++) {
          let { $from, $to } = ranges[i2];
          if (!add3) {
            tr2.removeMark($from.pos, $to.pos, markType);
          } else {
            let from2 = $from.pos, to = $to.pos, start2 = $from.nodeAfter, end = $to.nodeBefore;
            let spaceStart = start2 && start2.isText ? /^\s*/.exec(start2.text)[0].length : 0;
            let spaceEnd = end && end.isText ? /\s*$/.exec(end.text)[0].length : 0;
            if (from2 + spaceStart < to) {
              from2 += spaceStart;
              to -= spaceEnd;
            }
            tr2.addMark(from2, to, markType.create(attrs4));
          }
        }
        dispatch(tr2.scrollIntoView());
      }
    }
    return true;
  };
}
__name(toggleMark$1, "toggleMark$1");
function wrapDispatchForJoin(dispatch, isJoinable) {
  return (tr2) => {
    if (!tr2.isGeneric)
      return dispatch(tr2);
    let ranges = [];
    for (let i2 = 0; i2 < tr2.mapping.maps.length; i2++) {
      let map3 = tr2.mapping.maps[i2];
      for (let j = 0; j < ranges.length; j++)
        ranges[j] = map3.map(ranges[j]);
      map3.forEach((_s, _e, from2, to) => ranges.push(from2, to));
    }
    let joinable2 = [];
    for (let i2 = 0; i2 < ranges.length; i2 += 2) {
      let from2 = ranges[i2], to = ranges[i2 + 1];
      let $from = tr2.doc.resolve(from2), depth = $from.sharedDepth(to), parent = $from.node(depth);
      for (let index2 = $from.indexAfter(depth), pos2 = $from.after(depth + 1); pos2 <= to; ++index2) {
        let after = parent.maybeChild(index2);
        if (!after)
          break;
        if (index2 && joinable2.indexOf(pos2) == -1) {
          let before = parent.child(index2 - 1);
          if (before.type == after.type && isJoinable(before, after))
            joinable2.push(pos2);
        }
        pos2 += after.nodeSize;
      }
    }
    joinable2.sort((a, b) => a - b);
    for (let i2 = joinable2.length - 1; i2 >= 0; i2--) {
      if (canJoin(tr2.doc, joinable2[i2]))
        tr2.join(joinable2[i2]);
    }
    dispatch(tr2);
  };
}
__name(wrapDispatchForJoin, "wrapDispatchForJoin");
function autoJoin(command2, isJoinable) {
  let canJoin2 = Array.isArray(isJoinable) ? (node3) => isJoinable.indexOf(node3.type.name) > -1 : isJoinable;
  return (state, dispatch, view) => command2(state, dispatch && wrapDispatchForJoin(dispatch, canJoin2), view);
}
__name(autoJoin, "autoJoin");
function chainCommands(...commands2) {
  return function(state, dispatch, view) {
    for (let i2 = 0; i2 < commands2.length; i2++)
      if (commands2[i2](state, dispatch, view))
        return true;
    return false;
  };
}
__name(chainCommands, "chainCommands");
let backspace = chainCommands(deleteSelection$1, joinBackward$1, selectNodeBackward$1);
let del = chainCommands(deleteSelection$1, joinForward$1, selectNodeForward$1);
const pcBaseKeymap = {
  "Enter": chainCommands(newlineInCode$1, createParagraphNear$1, liftEmptyBlock$1, splitBlock$1),
  "Mod-Enter": exitCode$1,
  "Backspace": backspace,
  "Mod-Backspace": backspace,
  "Shift-Backspace": backspace,
  "Delete": del,
  "Mod-Delete": del,
  "Mod-a": selectAll$1
};
const macBaseKeymap = {
  "Ctrl-h": pcBaseKeymap["Backspace"],
  "Alt-Backspace": pcBaseKeymap["Mod-Backspace"],
  "Ctrl-d": pcBaseKeymap["Delete"],
  "Ctrl-Alt-Backspace": pcBaseKeymap["Mod-Delete"],
  "Alt-Delete": pcBaseKeymap["Mod-Delete"],
  "Alt-d": pcBaseKeymap["Mod-Delete"],
  "Ctrl-a": selectTextblockStart$1,
  "Ctrl-e": selectTextblockEnd$1
};
for (let key in pcBaseKeymap)
  macBaseKeymap[key] = pcBaseKeymap[key];
const mac = typeof navigator != "undefined" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os != "undefined" && os.platform ? os.platform() == "darwin" : false;
const baseKeymap = mac ? macBaseKeymap : pcBaseKeymap;
const olDOM = ["ol", 0], ulDOM = ["ul", 0], liDOM = ["li", 0];
const orderedList = {
  attrs: { order: { default: 1, validate: "number" } },
  parseDOM: [{ tag: "ol", getAttrs(dom) {
    return { order: dom.hasAttribute("start") ? +dom.getAttribute("start") : 1 };
  } }],
  toDOM(node3) {
    return node3.attrs.order == 1 ? olDOM : ["ol", { start: node3.attrs.order }, 0];
  }
};
const bulletList = {
  parseDOM: [{ tag: "ul" }],
  toDOM() {
    return ulDOM;
  }
};
const listItem = {
  parseDOM: [{ tag: "li" }],
  toDOM() {
    return liDOM;
  },
  defining: true
};
function add(obj, props) {
  let copy2 = {};
  for (let prop2 in obj)
    copy2[prop2] = obj[prop2];
  for (let prop2 in props)
    copy2[prop2] = props[prop2];
  return copy2;
}
__name(add, "add");
function addListNodes(nodes, itemContent, listGroup) {
  return nodes.append({
    ordered_list: add(orderedList, { content: "list_item+", group: listGroup }),
    bullet_list: add(bulletList, { content: "list_item+", group: listGroup }),
    list_item: add(listItem, { content: itemContent })
  });
}
__name(addListNodes, "addListNodes");
function wrapInList$1(listType, attrs4 = null) {
  return function(state, dispatch) {
    let { $from, $to } = state.selection;
    let range2 = $from.blockRange($to);
    if (!range2)
      return false;
    let tr2 = dispatch ? state.tr : null;
    if (!wrapRangeInList(tr2, range2, listType, attrs4))
      return false;
    if (dispatch)
      dispatch(tr2.scrollIntoView());
    return true;
  };
}
__name(wrapInList$1, "wrapInList$1");
function wrapRangeInList(tr2, range2, listType, attrs4 = null) {
  let doJoin = false, outerRange = range2, doc2 = range2.$from.doc;
  if (range2.depth >= 2 && range2.$from.node(range2.depth - 1).type.compatibleContent(listType) && range2.startIndex == 0) {
    if (range2.$from.index(range2.depth - 1) == 0)
      return false;
    let $insert = doc2.resolve(range2.start - 2);
    outerRange = new NodeRange($insert, $insert, range2.depth);
    if (range2.endIndex < range2.parent.childCount)
      range2 = new NodeRange(range2.$from, doc2.resolve(range2.$to.end(range2.depth)), range2.depth);
    doJoin = true;
  }
  let wrap2 = findWrapping(outerRange, listType, attrs4, range2);
  if (!wrap2)
    return false;
  if (tr2)
    doWrapInList(tr2, range2, wrap2, doJoin, listType);
  return true;
}
__name(wrapRangeInList, "wrapRangeInList");
function doWrapInList(tr2, range2, wrappers, joinBefore, listType) {
  let content2 = Fragment.empty;
  for (let i2 = wrappers.length - 1; i2 >= 0; i2--)
    content2 = Fragment.from(wrappers[i2].type.create(wrappers[i2].attrs, content2));
  tr2.step(new ReplaceAroundStep(range2.start - (joinBefore ? 2 : 0), range2.end, range2.start, range2.end, new Slice(content2, 0, 0), wrappers.length, true));
  let found2 = 0;
  for (let i2 = 0; i2 < wrappers.length; i2++)
    if (wrappers[i2].type == listType)
      found2 = i2 + 1;
  let splitDepth = wrappers.length - found2;
  let splitPos = range2.start + wrappers.length - (joinBefore ? 2 : 0), parent = range2.parent;
  for (let i2 = range2.startIndex, e2 = range2.endIndex, first2 = true; i2 < e2; i2++, first2 = false) {
    if (!first2 && canSplit(tr2.doc, splitPos, splitDepth)) {
      tr2.split(splitPos, splitDepth);
      splitPos += 2 * splitDepth;
    }
    splitPos += parent.child(i2).nodeSize;
  }
  return tr2;
}
__name(doWrapInList, "doWrapInList");
function splitListItem$1(itemType, itemAttrs) {
  return function(state, dispatch) {
    let { $from, $to, node: node3 } = state.selection;
    if (node3 && node3.isBlock || $from.depth < 2 || !$from.sameParent($to))
      return false;
    let grandParent = $from.node(-1);
    if (grandParent.type != itemType)
      return false;
    if ($from.parent.content.size == 0 && $from.node(-1).childCount == $from.indexAfter(-1)) {
      if ($from.depth == 3 || $from.node(-3).type != itemType || $from.index(-2) != $from.node(-2).childCount - 1)
        return false;
      if (dispatch) {
        let wrap2 = Fragment.empty;
        let depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
        for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d--)
          wrap2 = Fragment.from($from.node(d).copy(wrap2));
        let depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1 : $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
        wrap2 = wrap2.append(Fragment.from(itemType.createAndFill()));
        let start2 = $from.before($from.depth - (depthBefore - 1));
        let tr3 = state.tr.replace(start2, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
        let sel = -1;
        tr3.doc.nodesBetween(start2, tr3.doc.content.size, (node4, pos2) => {
          if (sel > -1)
            return false;
          if (node4.isTextblock && node4.content.size == 0)
            sel = pos2 + 1;
        });
        if (sel > -1)
          tr3.setSelection(Selection.near(tr3.doc.resolve(sel)));
        dispatch(tr3.scrollIntoView());
      }
      return true;
    }
    let nextType = $to.pos == $from.end() ? grandParent.contentMatchAt(0).defaultType : null;
    let tr2 = state.tr.delete($from.pos, $to.pos);
    let types = nextType ? [itemAttrs ? { type: itemType, attrs: itemAttrs } : null, { type: nextType }] : void 0;
    if (!canSplit(tr2.doc, $from.pos, 2, types))
      return false;
    if (dispatch)
      dispatch(tr2.split($from.pos, 2, types).scrollIntoView());
    return true;
  };
}
__name(splitListItem$1, "splitListItem$1");
function splitListItemKeepMarks(itemType, itemAttrs) {
  let split2 = splitListItem$1(itemType, itemAttrs);
  return (state, dispatch) => {
    return split2(state, dispatch && ((tr2) => {
      let marks = state.storedMarks || state.selection.$to.parentOffset && state.selection.$from.marks();
      if (marks)
        tr2.ensureMarks(marks);
      dispatch(tr2);
    }));
  };
}
__name(splitListItemKeepMarks, "splitListItemKeepMarks");
function liftListItem$1(itemType) {
  return function(state, dispatch) {
    let { $from, $to } = state.selection;
    let range2 = $from.blockRange($to, (node3) => node3.childCount > 0 && node3.firstChild.type == itemType);
    if (!range2)
      return false;
    if (!dispatch)
      return true;
    if ($from.node(range2.depth - 1).type == itemType)
      return liftToOuterList(state, dispatch, itemType, range2);
    else
      return liftOutOfList(state, dispatch, range2);
  };
}
__name(liftListItem$1, "liftListItem$1");
function liftToOuterList(state, dispatch, itemType, range2) {
  let tr2 = state.tr, end = range2.end, endOfList = range2.$to.end(range2.depth);
  if (end < endOfList) {
    tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment.from(itemType.create(null, range2.parent.copy())), 1, 0), 1, true));
    range2 = new NodeRange(tr2.doc.resolve(range2.$from.pos), tr2.doc.resolve(endOfList), range2.depth);
  }
  const target = liftTarget(range2);
  if (target == null)
    return false;
  tr2.lift(range2, target);
  let after = tr2.mapping.map(end, -1) - 1;
  if (canJoin(tr2.doc, after))
    tr2.join(after);
  dispatch(tr2.scrollIntoView());
  return true;
}
__name(liftToOuterList, "liftToOuterList");
function liftOutOfList(state, dispatch, range2) {
  let tr2 = state.tr, list2 = range2.parent;
  for (let pos2 = range2.end, i2 = range2.endIndex - 1, e2 = range2.startIndex; i2 > e2; i2--) {
    pos2 -= list2.child(i2).nodeSize;
    tr2.delete(pos2 - 1, pos2 + 1);
  }
  let $start = tr2.doc.resolve(range2.start), item3 = $start.nodeAfter;
  if (tr2.mapping.map(range2.end) != range2.start + $start.nodeAfter.nodeSize)
    return false;
  let atStart = range2.startIndex == 0, atEnd = range2.endIndex == list2.childCount;
  let parent = $start.node(-1), indexBefore = $start.index(-1);
  if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item3.content.append(atEnd ? Fragment.empty : Fragment.from(list2))))
    return false;
  let start2 = $start.pos, end = start2 + item3.nodeSize;
  tr2.step(new ReplaceAroundStep(start2 - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start2 + 1, end - 1, new Slice((atStart ? Fragment.empty : Fragment.from(list2.copy(Fragment.empty))).append(atEnd ? Fragment.empty : Fragment.from(list2.copy(Fragment.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
  dispatch(tr2.scrollIntoView());
  return true;
}
__name(liftOutOfList, "liftOutOfList");
function sinkListItem$1(itemType) {
  return function(state, dispatch) {
    let { $from, $to } = state.selection;
    let range2 = $from.blockRange($to, (node3) => node3.childCount > 0 && node3.firstChild.type == itemType);
    if (!range2)
      return false;
    let startIndex = range2.startIndex;
    if (startIndex == 0)
      return false;
    let parent = range2.parent, nodeBefore = parent.child(startIndex - 1);
    if (nodeBefore.type != itemType)
      return false;
    if (dispatch) {
      let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
      let inner = Fragment.from(nestedBefore ? itemType.create() : null);
      let slice2 = new Slice(Fragment.from(itemType.create(null, Fragment.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
      let before = range2.start, after = range2.end;
      dispatch(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice2, 1, true)).scrollIntoView());
    }
    return true;
  };
}
__name(sinkListItem$1, "sinkListItem$1");
function createChainableState(config2) {
  const { state, transaction } = config2;
  let { selection } = transaction;
  let { doc: doc2 } = transaction;
  let { storedMarks } = transaction;
  return {
    ...state,
    apply: state.apply.bind(state),
    applyTransaction: state.applyTransaction.bind(state),
    plugins: state.plugins,
    schema: state.schema,
    reconfigure: state.reconfigure.bind(state),
    toJSON: state.toJSON.bind(state),
    get storedMarks() {
      return storedMarks;
    },
    get selection() {
      return selection;
    },
    get doc() {
      return doc2;
    },
    get tr() {
      selection = transaction.selection;
      doc2 = transaction.doc;
      storedMarks = transaction.storedMarks;
      return transaction;
    }
  };
}
__name(createChainableState, "createChainableState");
class CommandManager {
  static {
    __name(this, "CommandManager");
  }
  constructor(props) {
    this.editor = props.editor;
    this.rawCommands = this.editor.extensionManager.commands;
    this.customState = props.state;
  }
  get hasCustomState() {
    return !!this.customState;
  }
  get state() {
    return this.customState || this.editor.state;
  }
  get commands() {
    const { rawCommands, editor, state } = this;
    const { view } = editor;
    const { tr: tr2 } = state;
    const props = this.buildProps(tr2);
    return Object.fromEntries(Object.entries(rawCommands).map(([name2, command2]) => {
      const method = /* @__PURE__ */ __name((...args) => {
        const callback = command2(...args)(props);
        if (!tr2.getMeta("preventDispatch") && !this.hasCustomState) {
          view.dispatch(tr2);
        }
        return callback;
      }, "method");
      return [name2, method];
    }));
  }
  get chain() {
    return () => this.createChain();
  }
  get can() {
    return () => this.createCan();
  }
  createChain(startTr, shouldDispatch = true) {
    const { rawCommands, editor, state } = this;
    const { view } = editor;
    const callbacks = [];
    const hasStartTransaction = !!startTr;
    const tr2 = startTr || state.tr;
    const run2 = /* @__PURE__ */ __name(() => {
      if (!hasStartTransaction && shouldDispatch && !tr2.getMeta("preventDispatch") && !this.hasCustomState) {
        view.dispatch(tr2);
      }
      return callbacks.every((callback) => callback === true);
    }, "run");
    const chain = {
      ...Object.fromEntries(Object.entries(rawCommands).map(([name2, command2]) => {
        const chainedCommand = /* @__PURE__ */ __name((...args) => {
          const props = this.buildProps(tr2, shouldDispatch);
          const callback = command2(...args)(props);
          callbacks.push(callback);
          return chain;
        }, "chainedCommand");
        return [name2, chainedCommand];
      })),
      run: run2
    };
    return chain;
  }
  createCan(startTr) {
    const { rawCommands, state } = this;
    const dispatch = false;
    const tr2 = startTr || state.tr;
    const props = this.buildProps(tr2, dispatch);
    const formattedCommands = Object.fromEntries(Object.entries(rawCommands).map(([name2, command2]) => {
      return [name2, (...args) => command2(...args)({ ...props, dispatch: void 0 })];
    }));
    return {
      ...formattedCommands,
      chain: /* @__PURE__ */ __name(() => this.createChain(tr2, dispatch), "chain")
    };
  }
  buildProps(tr2, shouldDispatch = true) {
    const { rawCommands, editor, state } = this;
    const { view } = editor;
    const props = {
      tr: tr2,
      editor,
      view,
      state: createChainableState({
        state,
        transaction: tr2
      }),
      dispatch: shouldDispatch ? () => void 0 : void 0,
      chain: /* @__PURE__ */ __name(() => this.createChain(tr2, shouldDispatch), "chain"),
      can: /* @__PURE__ */ __name(() => this.createCan(tr2), "can"),
      get commands() {
        return Object.fromEntries(Object.entries(rawCommands).map(([name2, command2]) => {
          return [name2, (...args) => command2(...args)(props)];
        }));
      }
    };
    return props;
  }
}
class EventEmitter {
  static {
    __name(this, "EventEmitter");
  }
  constructor() {
    this.callbacks = {};
  }
  on(event, fn) {
    if (!this.callbacks[event]) {
      this.callbacks[event] = [];
    }
    this.callbacks[event].push(fn);
    return this;
  }
  emit(event, ...args) {
    const callbacks = this.callbacks[event];
    if (callbacks) {
      callbacks.forEach((callback) => callback.apply(this, args));
    }
    return this;
  }
  off(event, fn) {
    const callbacks = this.callbacks[event];
    if (callbacks) {
      if (fn) {
        this.callbacks[event] = callbacks.filter((callback) => callback !== fn);
      } else {
        delete this.callbacks[event];
      }
    }
    return this;
  }
  once(event, fn) {
    const onceFn = /* @__PURE__ */ __name((...args) => {
      this.off(event, onceFn);
      fn.apply(this, args);
    }, "onceFn");
    return this.on(event, onceFn);
  }
  removeAllListeners() {
    this.callbacks = {};
  }
}
function getExtensionField(extension, field, context) {
  if (extension.config[field] === void 0 && extension.parent) {
    return getExtensionField(extension.parent, field, context);
  }
  if (typeof extension.config[field] === "function") {
    const value4 = extension.config[field].bind({
      ...context,
      parent: extension.parent ? getExtensionField(extension.parent, field, context) : null
    });
    return value4;
  }
  return extension.config[field];
}
__name(getExtensionField, "getExtensionField");
function splitExtensions(extensions) {
  const baseExtensions = extensions.filter((extension) => extension.type === "extension");
  const nodeExtensions = extensions.filter((extension) => extension.type === "node");
  const markExtensions = extensions.filter((extension) => extension.type === "mark");
  return {
    baseExtensions,
    nodeExtensions,
    markExtensions
  };
}
__name(splitExtensions, "splitExtensions");
function getAttributesFromExtensions(extensions) {
  const extensionAttributes = [];
  const { nodeExtensions, markExtensions } = splitExtensions(extensions);
  const nodeAndMarkExtensions = [...nodeExtensions, ...markExtensions];
  const defaultAttribute = {
    default: null,
    rendered: true,
    renderHTML: null,
    parseHTML: null,
    keepOnSplit: true,
    isRequired: false
  };
  extensions.forEach((extension) => {
    const context = {
      name: extension.name,
      options: extension.options,
      storage: extension.storage,
      extensions: nodeAndMarkExtensions
    };
    const addGlobalAttributes = getExtensionField(extension, "addGlobalAttributes", context);
    if (!addGlobalAttributes) {
      return;
    }
    const globalAttributes = addGlobalAttributes();
    globalAttributes.forEach((globalAttribute) => {
      globalAttribute.types.forEach((type) => {
        Object.entries(globalAttribute.attributes).forEach(([name2, attribute2]) => {
          extensionAttributes.push({
            type,
            name: name2,
            attribute: {
              ...defaultAttribute,
              ...attribute2
            }
          });
        });
      });
    });
  });
  nodeAndMarkExtensions.forEach((extension) => {
    const context = {
      name: extension.name,
      options: extension.options,
      storage: extension.storage
    };
    const addAttributes = getExtensionField(extension, "addAttributes", context);
    if (!addAttributes) {
      return;
    }
    const attributes = addAttributes();
    Object.entries(attributes).forEach(([name2, attribute2]) => {
      const mergedAttr = {
        ...defaultAttribute,
        ...attribute2
      };
      if (typeof (mergedAttr === null || mergedAttr === void 0 ? void 0 : mergedAttr.default) === "function") {
        mergedAttr.default = mergedAttr.default();
      }
      if ((mergedAttr === null || mergedAttr === void 0 ? void 0 : mergedAttr.isRequired) && (mergedAttr === null || mergedAttr === void 0 ? void 0 : mergedAttr.default) === void 0) {
        delete mergedAttr.default;
      }
      extensionAttributes.push({
        type: extension.name,
        name: name2,
        attribute: mergedAttr
      });
    });
  });
  return extensionAttributes;
}
__name(getAttributesFromExtensions, "getAttributesFromExtensions");
function getNodeType(nameOrType, schema2) {
  if (typeof nameOrType === "string") {
    if (!schema2.nodes[nameOrType]) {
      throw Error(`There is no node type named '${nameOrType}'. Maybe you forgot to add the extension?`);
    }
    return schema2.nodes[nameOrType];
  }
  return nameOrType;
}
__name(getNodeType, "getNodeType");
function mergeAttributes(...objects) {
  return objects.filter((item3) => !!item3).reduce((items2, item3) => {
    const mergedAttributes = { ...items2 };
    Object.entries(item3).forEach(([key, value4]) => {
      const exists = mergedAttributes[key];
      if (!exists) {
        mergedAttributes[key] = value4;
        return;
      }
      if (key === "class") {
        const valueClasses = value4 ? value4.split(" ") : [];
        const existingClasses = mergedAttributes[key] ? mergedAttributes[key].split(" ") : [];
        const insertClasses = valueClasses.filter((valueClass) => !existingClasses.includes(valueClass));
        mergedAttributes[key] = [...existingClasses, ...insertClasses].join(" ");
      } else if (key === "style") {
        const newStyles = value4 ? value4.split(";").map((style2) => style2.trim()).filter(Boolean) : [];
        const existingStyles = mergedAttributes[key] ? mergedAttributes[key].split(";").map((style2) => style2.trim()).filter(Boolean) : [];
        const styleMap = /* @__PURE__ */ new Map();
        existingStyles.forEach((style2) => {
          const [property, val] = style2.split(":").map((part) => part.trim());
          styleMap.set(property, val);
        });
        newStyles.forEach((style2) => {
          const [property, val] = style2.split(":").map((part) => part.trim());
          styleMap.set(property, val);
        });
        mergedAttributes[key] = Array.from(styleMap.entries()).map(([property, val]) => `${property}: ${val}`).join("; ");
      } else {
        mergedAttributes[key] = value4;
      }
    });
    return mergedAttributes;
  }, {});
}
__name(mergeAttributes, "mergeAttributes");
function getRenderedAttributes(nodeOrMark, extensionAttributes) {
  return extensionAttributes.filter((attribute2) => attribute2.type === nodeOrMark.type.name).filter((item3) => item3.attribute.rendered).map((item3) => {
    if (!item3.attribute.renderHTML) {
      return {
        [item3.name]: nodeOrMark.attrs[item3.name]
      };
    }
    return item3.attribute.renderHTML(nodeOrMark.attrs) || {};
  }).reduce((attributes, attribute2) => mergeAttributes(attributes, attribute2), {});
}
__name(getRenderedAttributes, "getRenderedAttributes");
function isFunction$1(value4) {
  return typeof value4 === "function";
}
__name(isFunction$1, "isFunction$1");
function callOrReturn(value4, context = void 0, ...props) {
  if (isFunction$1(value4)) {
    if (context) {
      return value4.bind(context)(...props);
    }
    return value4(...props);
  }
  return value4;
}
__name(callOrReturn, "callOrReturn");
function isEmptyObject(value4 = {}) {
  return Object.keys(value4).length === 0 && value4.constructor === Object;
}
__name(isEmptyObject, "isEmptyObject");
function fromString(value4) {
  if (typeof value4 !== "string") {
    return value4;
  }
  if (value4.match(/^[+-]?(?:\d*\.)?\d+$/)) {
    return Number(value4);
  }
  if (value4 === "true") {
    return true;
  }
  if (value4 === "false") {
    return false;
  }
  return value4;
}
__name(fromString, "fromString");
function injectExtensionAttributesToParseRule(parseRule, extensionAttributes) {
  if ("style" in parseRule) {
    return parseRule;
  }
  return {
    ...parseRule,
    getAttrs: /* @__PURE__ */ __name((node3) => {
      const oldAttributes = parseRule.getAttrs ? parseRule.getAttrs(node3) : parseRule.attrs;
      if (oldAttributes === false) {
        return false;
      }
      const newAttributes = extensionAttributes.reduce((items2, item3) => {
        const value4 = item3.attribute.parseHTML ? item3.attribute.parseHTML(node3) : fromString(node3.getAttribute(item3.name));
        if (value4 === null || value4 === void 0) {
          return items2;
        }
        return {
          ...items2,
          [item3.name]: value4
        };
      }, {});
      return { ...oldAttributes, ...newAttributes };
    }, "getAttrs")
  };
}
__name(injectExtensionAttributesToParseRule, "injectExtensionAttributesToParseRule");
function cleanUpSchemaItem(data24) {
  return Object.fromEntries(
    // @ts-ignore
    Object.entries(data24).filter(([key, value4]) => {
      if (key === "attrs" && isEmptyObject(value4)) {
        return false;
      }
      return value4 !== null && value4 !== void 0;
    })
  );
}
__name(cleanUpSchemaItem, "cleanUpSchemaItem");
function getSchemaByResolvedExtensions(extensions, editor) {
  var _a2;
  const allAttributes = getAttributesFromExtensions(extensions);
  const { nodeExtensions, markExtensions } = splitExtensions(extensions);
  const topNode = (_a2 = nodeExtensions.find((extension) => getExtensionField(extension, "topNode"))) === null || _a2 === void 0 ? void 0 : _a2.name;
  const nodes = Object.fromEntries(nodeExtensions.map((extension) => {
    const extensionAttributes = allAttributes.filter((attribute2) => attribute2.type === extension.name);
    const context = {
      name: extension.name,
      options: extension.options,
      storage: extension.storage,
      editor
    };
    const extraNodeFields = extensions.reduce((fields, e2) => {
      const extendNodeSchema = getExtensionField(e2, "extendNodeSchema", context);
      return {
        ...fields,
        ...extendNodeSchema ? extendNodeSchema(extension) : {}
      };
    }, {});
    const schema2 = cleanUpSchemaItem({
      ...extraNodeFields,
      content: callOrReturn(getExtensionField(extension, "content", context)),
      marks: callOrReturn(getExtensionField(extension, "marks", context)),
      group: callOrReturn(getExtensionField(extension, "group", context)),
      inline: callOrReturn(getExtensionField(extension, "inline", context)),
      atom: callOrReturn(getExtensionField(extension, "atom", context)),
      selectable: callOrReturn(getExtensionField(extension, "selectable", context)),
      draggable: callOrReturn(getExtensionField(extension, "draggable", context)),
      code: callOrReturn(getExtensionField(extension, "code", context)),
      whitespace: callOrReturn(getExtensionField(extension, "whitespace", context)),
      linebreakReplacement: callOrReturn(getExtensionField(extension, "linebreakReplacement", context)),
      defining: callOrReturn(getExtensionField(extension, "defining", context)),
      isolating: callOrReturn(getExtensionField(extension, "isolating", context)),
      attrs: Object.fromEntries(extensionAttributes.map((extensionAttribute) => {
        var _a3;
        return [extensionAttribute.name, { default: (_a3 = extensionAttribute === null || extensionAttribute === void 0 ? void 0 : extensionAttribute.attribute) === null || _a3 === void 0 ? void 0 : _a3.default }];
      }))
    });
    const parseHTML = callOrReturn(getExtensionField(extension, "parseHTML", context));
    if (parseHTML) {
      schema2.parseDOM = parseHTML.map((parseRule) => injectExtensionAttributesToParseRule(parseRule, extensionAttributes));
    }
    const renderHTML = getExtensionField(extension, "renderHTML", context);
    if (renderHTML) {
      schema2.toDOM = (node3) => renderHTML({
        node: node3,
        HTMLAttributes: getRenderedAttributes(node3, extensionAttributes)
      });
    }
    const renderText = getExtensionField(extension, "renderText", context);
    if (renderText) {
      schema2.toText = renderText;
    }
    return [extension.name, schema2];
  }));
  const marks = Object.fromEntries(markExtensions.map((extension) => {
    const extensionAttributes = allAttributes.filter((attribute2) => attribute2.type === extension.name);
    const context = {
      name: extension.name,
      options: extension.options,
      storage: extension.storage,
      editor
    };
    const extraMarkFields = extensions.reduce((fields, e2) => {
      const extendMarkSchema = getExtensionField(e2, "extendMarkSchema", context);
      return {
        ...fields,
        ...extendMarkSchema ? extendMarkSchema(extension) : {}
      };
    }, {});
    const schema2 = cleanUpSchemaItem({
      ...extraMarkFields,
      inclusive: callOrReturn(getExtensionField(extension, "inclusive", context)),
      excludes: callOrReturn(getExtensionField(extension, "excludes", context)),
      group: callOrReturn(getExtensionField(extension, "group", context)),
      spanning: callOrReturn(getExtensionField(extension, "spanning", context)),
      code: callOrReturn(getExtensionField(extension, "code", context)),
      attrs: Object.fromEntries(extensionAttributes.map((extensionAttribute) => {
        var _a3;
        return [extensionAttribute.name, { default: (_a3 = extensionAttribute === null || extensionAttribute === void 0 ? void 0 : extensionAttribute.attribute) === null || _a3 === void 0 ? void 0 : _a3.default }];
      }))
    });
    const parseHTML = callOrReturn(getExtensionField(extension, "parseHTML", context));
    if (parseHTML) {
      schema2.parseDOM = parseHTML.map((parseRule) => injectExtensionAttributesToParseRule(parseRule, extensionAttributes));
    }
    const renderHTML = getExtensionField(extension, "renderHTML", context);
    if (renderHTML) {
      schema2.toDOM = (mark2) => renderHTML({
        mark: mark2,
        HTMLAttributes: getRenderedAttributes(mark2, extensionAttributes)
      });
    }
    return [extension.name, schema2];
  }));
  return new Schema({
    topNode,
    nodes,
    marks
  });
}
__name(getSchemaByResolvedExtensions, "getSchemaByResolvedExtensions");
function getSchemaTypeByName(name2, schema2) {
  return schema2.nodes[name2] || schema2.marks[name2] || null;
}
__name(getSchemaTypeByName, "getSchemaTypeByName");
function isExtensionRulesEnabled(extension, enabled) {
  if (Array.isArray(enabled)) {
    return enabled.some((enabledExtension) => {
      const name2 = typeof enabledExtension === "string" ? enabledExtension : enabledExtension.name;
      return name2 === extension.name;
    });
  }
  return enabled;
}
__name(isExtensionRulesEnabled, "isExtensionRulesEnabled");
function getHTMLFromFragment(fragment, schema2) {
  const documentFragment = DOMSerializer.fromSchema(schema2).serializeFragment(fragment);
  const temporaryDocument = document.implementation.createHTMLDocument();
  const container = temporaryDocument.createElement("div");
  container.appendChild(documentFragment);
  return container.innerHTML;
}
__name(getHTMLFromFragment, "getHTMLFromFragment");
const getTextContentFromNodes = /* @__PURE__ */ __name(($from, maxMatch = 500) => {
  let textBefore = "";
  const sliceEndPos = $from.parentOffset;
  $from.parent.nodesBetween(Math.max(0, sliceEndPos - maxMatch), sliceEndPos, (node3, pos2, parent, index2) => {
    var _a2, _b;
    const chunk = ((_b = (_a2 = node3.type.spec).toText) === null || _b === void 0 ? void 0 : _b.call(_a2, {
      node: node3,
      pos: pos2,
      parent,
      index: index2
    })) || node3.textContent || "%leaf%";
    textBefore += node3.isAtom && !node3.isText ? chunk : chunk.slice(0, Math.max(0, sliceEndPos - pos2));
  });
  return textBefore;
}, "getTextContentFromNodes");
function isRegExp$1(value4) {
  return Object.prototype.toString.call(value4) === "[object RegExp]";
}
__name(isRegExp$1, "isRegExp$1");
class InputRule {
  static {
    __name(this, "InputRule");
  }
  constructor(config2) {
    this.find = config2.find;
    this.handler = config2.handler;
  }
}
const inputRuleMatcherHandler = /* @__PURE__ */ __name((text2, find2) => {
  if (isRegExp$1(find2)) {
    return find2.exec(text2);
  }
  const inputRuleMatch = find2(text2);
  if (!inputRuleMatch) {
    return null;
  }
  const result = [inputRuleMatch.text];
  result.index = inputRuleMatch.index;
  result.input = text2;
  result.data = inputRuleMatch.data;
  if (inputRuleMatch.replaceWith) {
    if (!inputRuleMatch.text.includes(inputRuleMatch.replaceWith)) {
      console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".');
    }
    result.push(inputRuleMatch.replaceWith);
  }
  return result;
}, "inputRuleMatcherHandler");
function run$1$1(config2) {
  var _a2;
  const { editor, from: from2, to, text: text2, rules, plugin } = config2;
  const { view } = editor;
  if (view.composing) {
    return false;
  }
  const $from = view.state.doc.resolve(from2);
  if (
    // check for code node
    $from.parent.type.spec.code || !!((_a2 = $from.nodeBefore || $from.nodeAfter) === null || _a2 === void 0 ? void 0 : _a2.marks.find((mark2) => mark2.type.spec.code))
  ) {
    return false;
  }
  let matched = false;
  const textBefore = getTextContentFromNodes($from) + text2;
  rules.forEach((rule) => {
    if (matched) {
      return;
    }
    const match2 = inputRuleMatcherHandler(textBefore, rule.find);
    if (!match2) {
      return;
    }
    const tr2 = view.state.tr;
    const state = createChainableState({
      state: view.state,
      transaction: tr2
    });
    const range2 = {
      from: from2 - (match2[0].length - text2.length),
      to
    };
    const { commands: commands2, chain, can } = new CommandManager({
      editor,
      state
    });
    const handler6 = rule.handler({
      state,
      range: range2,
      match: match2,
      commands: commands2,
      chain,
      can
    });
    if (handler6 === null || !tr2.steps.length) {
      return;
    }
    tr2.setMeta(plugin, {
      transform: tr2,
      from: from2,
      to,
      text: text2
    });
    view.dispatch(tr2);
    matched = true;
  });
  return matched;
}
__name(run$1$1, "run$1$1");
function inputRulesPlugin(props) {
  const { editor, rules } = props;
  const plugin = new Plugin({
    state: {
      init() {
        return null;
      },
      apply(tr2, prev2, state) {
        const stored = tr2.getMeta(plugin);
        if (stored) {
          return stored;
        }
        const simulatedInputMeta = tr2.getMeta("applyInputRules");
        const isSimulatedInput = !!simulatedInputMeta;
        if (isSimulatedInput) {
          setTimeout(() => {
            let { text: text2 } = simulatedInputMeta;
            if (typeof text2 === "string") {
              text2 = text2;
            } else {
              text2 = getHTMLFromFragment(Fragment.from(text2), state.schema);
            }
            const { from: from2 } = simulatedInputMeta;
            const to = from2 + text2.length;
            run$1$1({
              editor,
              from: from2,
              to,
              text: text2,
              rules,
              plugin
            });
          });
        }
        return tr2.selectionSet || tr2.docChanged ? null : prev2;
      }
    },
    props: {
      handleTextInput(view, from2, to, text2) {
        return run$1$1({
          editor,
          from: from2,
          to,
          text: text2,
          rules,
          plugin
        });
      },
      handleDOMEvents: {
        compositionend: /* @__PURE__ */ __name((view) => {
          setTimeout(() => {
            const { $cursor } = view.state.selection;
            if ($cursor) {
              run$1$1({
                editor,
                from: $cursor.pos,
                to: $cursor.pos,
                text: "",
                rules,
                plugin
              });
            }
          });
          return false;
        }, "compositionend")
      },
      // add support for input rules to trigger on enter
      // this is useful for example for code blocks
      handleKeyDown(view, event) {
        if (event.key !== "Enter") {
          return false;
        }
        const { $cursor } = view.state.selection;
        if ($cursor) {
          return run$1$1({
            editor,
            from: $cursor.pos,
            to: $cursor.pos,
            text: "\n",
            rules,
            plugin
          });
        }
        return false;
      }
    },
    // @ts-ignore
    isInputRules: true
  });
  return plugin;
}
__name(inputRulesPlugin, "inputRulesPlugin");
function getType(value4) {
  return Object.prototype.toString.call(value4).slice(8, -1);
}
__name(getType, "getType");
function isPlainObject(value4) {
  if (getType(value4) !== "Object") {
    return false;
  }
  return value4.constructor === Object && Object.getPrototypeOf(value4) === Object.prototype;
}
__name(isPlainObject, "isPlainObject");
function mergeDeep(target, source) {
  const output = { ...target };
  if (isPlainObject(target) && isPlainObject(source)) {
    Object.keys(source).forEach((key) => {
      if (isPlainObject(source[key]) && isPlainObject(target[key])) {
        output[key] = mergeDeep(target[key], source[key]);
      } else {
        output[key] = source[key];
      }
    });
  }
  return output;
}
__name(mergeDeep, "mergeDeep");
class Mark {
  static {
    __name(this, "Mark");
  }
  constructor(config2 = {}) {
    this.type = "mark";
    this.name = "mark";
    this.parent = null;
    this.child = null;
    this.config = {
      name: this.name,
      defaultOptions: {}
    };
    this.config = {
      ...this.config,
      ...config2
    };
    this.name = this.config.name;
    if (config2.defaultOptions && Object.keys(config2.defaultOptions).length > 0) {
      console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`);
    }
    this.options = this.config.defaultOptions;
    if (this.config.addOptions) {
      this.options = callOrReturn(getExtensionField(this, "addOptions", {
        name: this.name
      }));
    }
    this.storage = callOrReturn(getExtensionField(this, "addStorage", {
      name: this.name,
      options: this.options
    })) || {};
  }
  static create(config2 = {}) {
    return new Mark(config2);
  }
  configure(options4 = {}) {
    const extension = this.extend({
      ...this.config,
      addOptions: /* @__PURE__ */ __name(() => {
        return mergeDeep(this.options, options4);
      }, "addOptions")
    });
    extension.name = this.name;
    extension.parent = this.parent;
    return extension;
  }
  extend(extendedConfig = {}) {
    const extension = new Mark(extendedConfig);
    extension.parent = this;
    this.child = extension;
    extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
    if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
      console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
    }
    extension.options = callOrReturn(getExtensionField(extension, "addOptions", {
      name: extension.name
    }));
    extension.storage = callOrReturn(getExtensionField(extension, "addStorage", {
      name: extension.name,
      options: extension.options
    }));
    return extension;
  }
  static handleExit({ editor, mark: mark2 }) {
    const { tr: tr2 } = editor.state;
    const currentPos = editor.state.selection.$from;
    const isAtEnd = currentPos.pos === currentPos.end();
    if (isAtEnd) {
      const currentMarks = currentPos.marks();
      const isInMark = !!currentMarks.find((m) => (m === null || m === void 0 ? void 0 : m.type.name) === mark2.name);
      if (!isInMark) {
        return false;
      }
      const removeMark2 = currentMarks.find((m) => (m === null || m === void 0 ? void 0 : m.type.name) === mark2.name);
      if (removeMark2) {
        tr2.removeStoredMark(removeMark2);
      }
      tr2.insertText(" ", currentPos.pos);
      editor.view.dispatch(tr2);
      return true;
    }
    return false;
  }
}
function isNumber$2(value4) {
  return typeof value4 === "number";
}
__name(isNumber$2, "isNumber$2");
class PasteRule {
  static {
    __name(this, "PasteRule");
  }
  constructor(config2) {
    this.find = config2.find;
    this.handler = config2.handler;
  }
}
const pasteRuleMatcherHandler = /* @__PURE__ */ __name((text2, find2, event) => {
  if (isRegExp$1(find2)) {
    return [...text2.matchAll(find2)];
  }
  const matches2 = find2(text2, event);
  if (!matches2) {
    return [];
  }
  return matches2.map((pasteRuleMatch) => {
    const result = [pasteRuleMatch.text];
    result.index = pasteRuleMatch.index;
    result.input = text2;
    result.data = pasteRuleMatch.data;
    if (pasteRuleMatch.replaceWith) {
      if (!pasteRuleMatch.text.includes(pasteRuleMatch.replaceWith)) {
        console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".');
      }
      result.push(pasteRuleMatch.replaceWith);
    }
    return result;
  });
}, "pasteRuleMatcherHandler");
function run$2(config2) {
  const { editor, state, from: from2, to, rule, pasteEvent, dropEvent } = config2;
  const { commands: commands2, chain, can } = new CommandManager({
    editor,
    state
  });
  const handlers2 = [];
  state.doc.nodesBetween(from2, to, (node3, pos2) => {
    if (!node3.isTextblock || node3.type.spec.code) {
      return;
    }
    const resolvedFrom = Math.max(from2, pos2);
    const resolvedTo = Math.min(to, pos2 + node3.content.size);
    const textToMatch = node3.textBetween(resolvedFrom - pos2, resolvedTo - pos2, void 0, "￼");
    const matches2 = pasteRuleMatcherHandler(textToMatch, rule.find, pasteEvent);
    matches2.forEach((match2) => {
      if (match2.index === void 0) {
        return;
      }
      const start2 = resolvedFrom + match2.index + 1;
      const end = start2 + match2[0].length;
      const range2 = {
        from: state.tr.mapping.map(start2),
        to: state.tr.mapping.map(end)
      };
      const handler6 = rule.handler({
        state,
        range: range2,
        match: match2,
        commands: commands2,
        chain,
        can,
        pasteEvent,
        dropEvent
      });
      handlers2.push(handler6);
    });
  });
  const success = handlers2.every((handler6) => handler6 !== null);
  return success;
}
__name(run$2, "run$2");
const createClipboardPasteEvent = /* @__PURE__ */ __name((text2) => {
  var _a2;
  const event = new ClipboardEvent("paste", {
    clipboardData: new DataTransfer()
  });
  (_a2 = event.clipboardData) === null || _a2 === void 0 ? void 0 : _a2.setData("text/html", text2);
  return event;
}, "createClipboardPasteEvent");
function pasteRulesPlugin(props) {
  const { editor, rules } = props;
  let dragSourceElement = null;
  let isPastedFromProseMirror = false;
  let isDroppedFromProseMirror = false;
  let pasteEvent = typeof ClipboardEvent !== "undefined" ? new ClipboardEvent("paste") : null;
  let dropEvent;
  try {
    dropEvent = typeof DragEvent !== "undefined" ? new DragEvent("drop") : null;
  } catch (e2) {
    dropEvent = null;
  }
  const processEvent = /* @__PURE__ */ __name(({ state, from: from2, to, rule, pasteEvt }) => {
    const tr2 = state.tr;
    const chainableState = createChainableState({
      state,
      transaction: tr2
    });
    const handler6 = run$2({
      editor,
      state: chainableState,
      from: Math.max(from2 - 1, 0),
      to: to.b - 1,
      rule,
      pasteEvent: pasteEvt,
      dropEvent
    });
    if (!handler6 || !tr2.steps.length) {
      return;
    }
    try {
      dropEvent = typeof DragEvent !== "undefined" ? new DragEvent("drop") : null;
    } catch (e2) {
      dropEvent = null;
    }
    pasteEvent = typeof ClipboardEvent !== "undefined" ? new ClipboardEvent("paste") : null;
    return tr2;
  }, "processEvent");
  const plugins = rules.map((rule) => {
    return new Plugin({
      // we register a global drag handler to track the current drag source element
      view(view) {
        const handleDragstart = /* @__PURE__ */ __name((event) => {
          var _a2;
          dragSourceElement = ((_a2 = view.dom.parentElement) === null || _a2 === void 0 ? void 0 : _a2.contains(event.target)) ? view.dom.parentElement : null;
        }, "handleDragstart");
        window.addEventListener("dragstart", handleDragstart);
        return {
          destroy() {
            window.removeEventListener("dragstart", handleDragstart);
          }
        };
      },
      props: {
        handleDOMEvents: {
          drop: /* @__PURE__ */ __name((view, event) => {
            isDroppedFromProseMirror = dragSourceElement === view.dom.parentElement;
            dropEvent = event;
            return false;
          }, "drop"),
          paste: /* @__PURE__ */ __name((_view, event) => {
            var _a2;
            const html = (_a2 = event.clipboardData) === null || _a2 === void 0 ? void 0 : _a2.getData("text/html");
            pasteEvent = event;
            isPastedFromProseMirror = !!(html === null || html === void 0 ? void 0 : html.includes("data-pm-slice"));
            return false;
          }, "paste")
        }
      },
      appendTransaction: /* @__PURE__ */ __name((transactions, oldState, state) => {
        const transaction = transactions[0];
        const isPaste = transaction.getMeta("uiEvent") === "paste" && !isPastedFromProseMirror;
        const isDrop = transaction.getMeta("uiEvent") === "drop" && !isDroppedFromProseMirror;
        const simulatedPasteMeta = transaction.getMeta("applyPasteRules");
        const isSimulatedPaste = !!simulatedPasteMeta;
        if (!isPaste && !isDrop && !isSimulatedPaste) {
          return;
        }
        if (isSimulatedPaste) {
          let { text: text2 } = simulatedPasteMeta;
          if (typeof text2 === "string") {
            text2 = text2;
          } else {
            text2 = getHTMLFromFragment(Fragment.from(text2), state.schema);
          }
          const { from: from3 } = simulatedPasteMeta;
          const to2 = from3 + text2.length;
          const pasteEvt = createClipboardPasteEvent(text2);
          return processEvent({
            rule,
            state,
            from: from3,
            to: { b: to2 },
            pasteEvt
          });
        }
        const from2 = oldState.doc.content.findDiffStart(state.doc.content);
        const to = oldState.doc.content.findDiffEnd(state.doc.content);
        if (!isNumber$2(from2) || !to || from2 === to.b) {
          return;
        }
        return processEvent({
          rule,
          state,
          from: from2,
          to,
          pasteEvt: pasteEvent
        });
      }, "appendTransaction")
    });
  });
  return plugins;
}
__name(pasteRulesPlugin, "pasteRulesPlugin");
function findDuplicates(items2) {
  const filtered = items2.filter((el, index2) => items2.indexOf(el) !== index2);
  return Array.from(new Set(filtered));
}
__name(findDuplicates, "findDuplicates");
class ExtensionManager {
  static {
    __name(this, "ExtensionManager");
  }
  constructor(extensions, editor) {
    this.splittableMarks = [];
    this.editor = editor;
    this.extensions = ExtensionManager.resolve(extensions);
    this.schema = getSchemaByResolvedExtensions(this.extensions, editor);
    this.setupExtensions();
  }
  /**
   * Returns a flattened and sorted extension list while
   * also checking for duplicated extensions and warns the user.
   * @param extensions An array of Tiptap extensions
   * @returns An flattened and sorted array of Tiptap extensions
   */
  static resolve(extensions) {
    const resolvedExtensions = ExtensionManager.sort(ExtensionManager.flatten(extensions));
    const duplicatedNames = findDuplicates(resolvedExtensions.map((extension) => extension.name));
    if (duplicatedNames.length) {
      console.warn(`[tiptap warn]: Duplicate extension names found: [${duplicatedNames.map((item3) => `'${item3}'`).join(", ")}]. This can lead to issues.`);
    }
    return resolvedExtensions;
  }
  /**
   * Create a flattened array of extensions by traversing the `addExtensions` field.
   * @param extensions An array of Tiptap extensions
   * @returns A flattened array of Tiptap extensions
   */
  static flatten(extensions) {
    return extensions.map((extension) => {
      const context = {
        name: extension.name,
        options: extension.options,
        storage: extension.storage
      };
      const addExtensions = getExtensionField(extension, "addExtensions", context);
      if (addExtensions) {
        return [extension, ...this.flatten(addExtensions())];
      }
      return extension;
    }).flat(10);
  }
  /**
   * Sort extensions by priority.
   * @param extensions An array of Tiptap extensions
   * @returns A sorted array of Tiptap extensions by priority
   */
  static sort(extensions) {
    const defaultPriority = 100;
    return extensions.sort((a, b) => {
      const priorityA = getExtensionField(a, "priority") || defaultPriority;
      const priorityB = getExtensionField(b, "priority") || defaultPriority;
      if (priorityA > priorityB) {
        return -1;
      }
      if (priorityA < priorityB) {
        return 1;
      }
      return 0;
    });
  }
  /**
   * Get all commands from the extensions.
   * @returns An object with all commands where the key is the command name and the value is the command function
   */
  get commands() {
    return this.extensions.reduce((commands2, extension) => {
      const context = {
        name: extension.name,
        options: extension.options,
        storage: extension.storage,
        editor: this.editor,
        type: getSchemaTypeByName(extension.name, this.schema)
      };
      const addCommands = getExtensionField(extension, "addCommands", context);
      if (!addCommands) {
        return commands2;
      }
      return {
        ...commands2,
        ...addCommands()
      };
    }, {});
  }
  /**
   * Get all registered Prosemirror plugins from the extensions.
   * @returns An array of Prosemirror plugins
   */
  get plugins() {
    const { editor } = this;
    const extensions = ExtensionManager.sort([...this.extensions].reverse());
    const inputRules = [];
    const pasteRules = [];
    const allPlugins = extensions.map((extension) => {
      const context = {
        name: extension.name,
        options: extension.options,
        storage: extension.storage,
        editor,
        type: getSchemaTypeByName(extension.name, this.schema)
      };
      const plugins = [];
      const addKeyboardShortcuts = getExtensionField(extension, "addKeyboardShortcuts", context);
      let defaultBindings = {};
      if (extension.type === "mark" && getExtensionField(extension, "exitable", context)) {
        defaultBindings.ArrowRight = () => Mark.handleExit({ editor, mark: extension });
      }
      if (addKeyboardShortcuts) {
        const bindings = Object.fromEntries(Object.entries(addKeyboardShortcuts()).map(([shortcut, method]) => {
          return [shortcut, () => method({ editor })];
        }));
        defaultBindings = { ...defaultBindings, ...bindings };
      }
      const keyMapPlugin = keymap(defaultBindings);
      plugins.push(keyMapPlugin);
      const addInputRules = getExtensionField(extension, "addInputRules", context);
      if (isExtensionRulesEnabled(extension, editor.options.enableInputRules) && addInputRules) {
        inputRules.push(...addInputRules());
      }
      const addPasteRules = getExtensionField(extension, "addPasteRules", context);
      if (isExtensionRulesEnabled(extension, editor.options.enablePasteRules) && addPasteRules) {
        pasteRules.push(...addPasteRules());
      }
      const addProseMirrorPlugins = getExtensionField(extension, "addProseMirrorPlugins", context);
      if (addProseMirrorPlugins) {
        const proseMirrorPlugins = addProseMirrorPlugins();
        plugins.push(...proseMirrorPlugins);
      }
      return plugins;
    }).flat();
    return [
      inputRulesPlugin({
        editor,
        rules: inputRules
      }),
      ...pasteRulesPlugin({
        editor,
        rules: pasteRules
      }),
      ...allPlugins
    ];
  }
  /**
   * Get all attributes from the extensions.
   * @returns An array of attributes
   */
  get attributes() {
    return getAttributesFromExtensions(this.extensions);
  }
  /**
   * Get all node views from the extensions.
   * @returns An object with all node views where the key is the node name and the value is the node view function
   */
  get nodeViews() {
    const { editor } = this;
    const { nodeExtensions } = splitExtensions(this.extensions);
    return Object.fromEntries(nodeExtensions.filter((extension) => !!getExtensionField(extension, "addNodeView")).map((extension) => {
      const extensionAttributes = this.attributes.filter((attribute2) => attribute2.type === extension.name);
      const context = {
        name: extension.name,
        options: extension.options,
        storage: extension.storage,
        editor,
        type: getNodeType(extension.name, this.schema)
      };
      const addNodeView = getExtensionField(extension, "addNodeView", context);
      if (!addNodeView) {
        return [];
      }
      const nodeview = /* @__PURE__ */ __name((node3, view, getPos, decorations, innerDecorations) => {
        const HTMLAttributes = getRenderedAttributes(node3, extensionAttributes);
        return addNodeView()({
          // pass-through
          node: node3,
          view,
          getPos,
          decorations,
          innerDecorations,
          // tiptap-specific
          editor,
          extension,
          HTMLAttributes
        });
      }, "nodeview");
      return [extension.name, nodeview];
    }));
  }
  /**
   * Go through all extensions, create extension storages & setup marks
   * & bind editor event listener.
   */
  setupExtensions() {
    this.extensions.forEach((extension) => {
      var _a2;
      this.editor.extensionStorage[extension.name] = extension.storage;
      const context = {
        name: extension.name,
        options: extension.options,
        storage: extension.storage,
        editor: this.editor,
        type: getSchemaTypeByName(extension.name, this.schema)
      };
      if (extension.type === "mark") {
        const keepOnSplit = (_a2 = callOrReturn(getExtensionField(extension, "keepOnSplit", context))) !== null && _a2 !== void 0 ? _a2 : true;
        if (keepOnSplit) {
          this.splittableMarks.push(extension.name);
        }
      }
      const onBeforeCreate = getExtensionField(extension, "onBeforeCreate", context);
      const onCreate = getExtensionField(extension, "onCreate", context);
      const onUpdate = getExtensionField(extension, "onUpdate", context);
      const onSelectionUpdate = getExtensionField(extension, "onSelectionUpdate", context);
      const onTransaction = getExtensionField(extension, "onTransaction", context);
      const onFocus7 = getExtensionField(extension, "onFocus", context);
      const onBlur7 = getExtensionField(extension, "onBlur", context);
      const onDestroy = getExtensionField(extension, "onDestroy", context);
      if (onBeforeCreate) {
        this.editor.on("beforeCreate", onBeforeCreate);
      }
      if (onCreate) {
        this.editor.on("create", onCreate);
      }
      if (onUpdate) {
        this.editor.on("update", onUpdate);
      }
      if (onSelectionUpdate) {
        this.editor.on("selectionUpdate", onSelectionUpdate);
      }
      if (onTransaction) {
        this.editor.on("transaction", onTransaction);
      }
      if (onFocus7) {
        this.editor.on("focus", onFocus7);
      }
      if (onBlur7) {
        this.editor.on("blur", onBlur7);
      }
      if (onDestroy) {
        this.editor.on("destroy", onDestroy);
      }
    });
  }
}
class Extension {
  static {
    __name(this, "Extension");
  }
  constructor(config2 = {}) {
    this.type = "extension";
    this.name = "extension";
    this.parent = null;
    this.child = null;
    this.config = {
      name: this.name,
      defaultOptions: {}
    };
    this.config = {
      ...this.config,
      ...config2
    };
    this.name = this.config.name;
    if (config2.defaultOptions && Object.keys(config2.defaultOptions).length > 0) {
      console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`);
    }
    this.options = this.config.defaultOptions;
    if (this.config.addOptions) {
      this.options = callOrReturn(getExtensionField(this, "addOptions", {
        name: this.name
      }));
    }
    this.storage = callOrReturn(getExtensionField(this, "addStorage", {
      name: this.name,
      options: this.options
    })) || {};
  }
  static create(config2 = {}) {
    return new Extension(config2);
  }
  configure(options4 = {}) {
    const extension = this.extend({
      ...this.config,
      addOptions: /* @__PURE__ */ __name(() => {
        return mergeDeep(this.options, options4);
      }, "addOptions")
    });
    extension.name = this.name;
    extension.parent = this.parent;
    return extension;
  }
  extend(extendedConfig = {}) {
    const extension = new Extension({ ...this.config, ...extendedConfig });
    extension.parent = this;
    this.child = extension;
    extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
    if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
      console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
    }
    extension.options = callOrReturn(getExtensionField(extension, "addOptions", {
      name: extension.name
    }));
    extension.storage = callOrReturn(getExtensionField(extension, "addStorage", {
      name: extension.name,
      options: extension.options
    }));
    return extension;
  }
}
function getTextBetween(startNode, range2, options4) {
  const { from: from2, to } = range2;
  const { blockSeparator = "\n\n", textSerializers = {} } = options4 || {};
  let text2 = "";
  startNode.nodesBetween(from2, to, (node3, pos2, parent, index2) => {
    var _a2;
    if (node3.isBlock && pos2 > from2) {
      text2 += blockSeparator;
    }
    const textSerializer = textSerializers === null || textSerializers === void 0 ? void 0 : textSerializers[node3.type.name];
    if (textSerializer) {
      if (parent) {
        text2 += textSerializer({
          node: node3,
          pos: pos2,
          parent,
          index: index2,
          range: range2
        });
      }
      return false;
    }
    if (node3.isText) {
      text2 += (_a2 = node3 === null || node3 === void 0 ? void 0 : node3.text) === null || _a2 === void 0 ? void 0 : _a2.slice(Math.max(from2, pos2) - pos2, to - pos2);
    }
  });
  return text2;
}
__name(getTextBetween, "getTextBetween");
function getTextSerializersFromSchema(schema2) {
  return Object.fromEntries(Object.entries(schema2.nodes).filter(([, node3]) => node3.spec.toText).map(([name2, node3]) => [name2, node3.spec.toText]));
}
__name(getTextSerializersFromSchema, "getTextSerializersFromSchema");
const ClipboardTextSerializer = Extension.create({
  name: "clipboardTextSerializer",
  addOptions() {
    return {
      blockSeparator: void 0
    };
  },
  addProseMirrorPlugins() {
    return [
      new Plugin({
        key: new PluginKey("clipboardTextSerializer"),
        props: {
          clipboardTextSerializer: /* @__PURE__ */ __name(() => {
            const { editor } = this;
            const { state, schema: schema2 } = editor;
            const { doc: doc2, selection } = state;
            const { ranges } = selection;
            const from2 = Math.min(...ranges.map((range3) => range3.$from.pos));
            const to = Math.max(...ranges.map((range3) => range3.$to.pos));
            const textSerializers = getTextSerializersFromSchema(schema2);
            const range2 = { from: from2, to };
            return getTextBetween(doc2, range2, {
              ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
              textSerializers
            });
          }, "clipboardTextSerializer")
        }
      })
    ];
  }
});
const blur = /* @__PURE__ */ __name(() => ({ editor, view }) => {
  requestAnimationFrame(() => {
    var _a2;
    if (!editor.isDestroyed) {
      view.dom.blur();
      (_a2 = window === null || window === void 0 ? void 0 : window.getSelection()) === null || _a2 === void 0 ? void 0 : _a2.removeAllRanges();
    }
  });
  return true;
}, "blur");
const clearContent = /* @__PURE__ */ __name((emitUpdate = false) => ({ commands: commands2 }) => {
  return commands2.setContent("", emitUpdate);
}, "clearContent");
const clearNodes = /* @__PURE__ */ __name(() => ({ state, tr: tr2, dispatch }) => {
  const { selection } = tr2;
  const { ranges } = selection;
  if (!dispatch) {
    return true;
  }
  ranges.forEach(({ $from, $to }) => {
    state.doc.nodesBetween($from.pos, $to.pos, (node3, pos2) => {
      if (node3.type.isText) {
        return;
      }
      const { doc: doc2, mapping } = tr2;
      const $mappedFrom = doc2.resolve(mapping.map(pos2));
      const $mappedTo = doc2.resolve(mapping.map(pos2 + node3.nodeSize));
      const nodeRange = $mappedFrom.blockRange($mappedTo);
      if (!nodeRange) {
        return;
      }
      const targetLiftDepth = liftTarget(nodeRange);
      if (node3.type.isTextblock) {
        const { defaultType } = $mappedFrom.parent.contentMatchAt($mappedFrom.index());
        tr2.setNodeMarkup(nodeRange.start, defaultType);
      }
      if (targetLiftDepth || targetLiftDepth === 0) {
        tr2.lift(nodeRange, targetLiftDepth);
      }
    });
  });
  return true;
}, "clearNodes");
const command = /* @__PURE__ */ __name((fn) => (props) => {
  return fn(props);
}, "command");
const createParagraphNear = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return createParagraphNear$1(state, dispatch);
}, "createParagraphNear");
const cut = /* @__PURE__ */ __name((originRange, targetPos) => ({ editor, tr: tr2 }) => {
  const { state } = editor;
  const contentSlice = state.doc.slice(originRange.from, originRange.to);
  tr2.deleteRange(originRange.from, originRange.to);
  const newPos = tr2.mapping.map(targetPos);
  tr2.insert(newPos, contentSlice.content);
  tr2.setSelection(new TextSelection(tr2.doc.resolve(newPos - 1)));
  return true;
}, "cut");
const deleteCurrentNode = /* @__PURE__ */ __name(() => ({ tr: tr2, dispatch }) => {
  const { selection } = tr2;
  const currentNode = selection.$anchor.node();
  if (currentNode.content.size > 0) {
    return false;
  }
  const $pos = tr2.selection.$anchor;
  for (let depth = $pos.depth; depth > 0; depth -= 1) {
    const node3 = $pos.node(depth);
    if (node3.type === currentNode.type) {
      if (dispatch) {
        const from2 = $pos.before(depth);
        const to = $pos.after(depth);
        tr2.delete(from2, to).scrollIntoView();
      }
      return true;
    }
  }
  return false;
}, "deleteCurrentNode");
const deleteNode = /* @__PURE__ */ __name((typeOrName) => ({ tr: tr2, state, dispatch }) => {
  const type = getNodeType(typeOrName, state.schema);
  const $pos = tr2.selection.$anchor;
  for (let depth = $pos.depth; depth > 0; depth -= 1) {
    const node3 = $pos.node(depth);
    if (node3.type === type) {
      if (dispatch) {
        const from2 = $pos.before(depth);
        const to = $pos.after(depth);
        tr2.delete(from2, to).scrollIntoView();
      }
      return true;
    }
  }
  return false;
}, "deleteNode");
const deleteRange = /* @__PURE__ */ __name((range2) => ({ tr: tr2, dispatch }) => {
  const { from: from2, to } = range2;
  if (dispatch) {
    tr2.delete(from2, to);
  }
  return true;
}, "deleteRange");
const deleteSelection = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return deleteSelection$1(state, dispatch);
}, "deleteSelection");
const enter = /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
  return commands2.keyboardShortcut("Enter");
}, "enter");
const exitCode = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return exitCode$1(state, dispatch);
}, "exitCode");
function objectIncludes(object1, object2, options4 = { strict: true }) {
  const keys2 = Object.keys(object2);
  if (!keys2.length) {
    return true;
  }
  return keys2.every((key) => {
    if (options4.strict) {
      return object2[key] === object1[key];
    }
    if (isRegExp$1(object2[key])) {
      return object2[key].test(object1[key]);
    }
    return object2[key] === object1[key];
  });
}
__name(objectIncludes, "objectIncludes");
function findMarkInSet(marks, type, attributes = {}) {
  return marks.find((item3) => {
    return item3.type === type && objectIncludes(
      // Only check equality for the attributes that are provided
      Object.fromEntries(Object.keys(attributes).map((k) => [k, item3.attrs[k]])),
      attributes
    );
  });
}
__name(findMarkInSet, "findMarkInSet");
function isMarkInSet(marks, type, attributes = {}) {
  return !!findMarkInSet(marks, type, attributes);
}
__name(isMarkInSet, "isMarkInSet");
function getMarkRange($pos, type, attributes) {
  var _a2;
  if (!$pos || !type) {
    return;
  }
  let start2 = $pos.parent.childAfter($pos.parentOffset);
  if (!start2.node || !start2.node.marks.some((mark3) => mark3.type === type)) {
    start2 = $pos.parent.childBefore($pos.parentOffset);
  }
  if (!start2.node || !start2.node.marks.some((mark3) => mark3.type === type)) {
    return;
  }
  attributes = attributes || ((_a2 = start2.node.marks[0]) === null || _a2 === void 0 ? void 0 : _a2.attrs);
  const mark2 = findMarkInSet([...start2.node.marks], type, attributes);
  if (!mark2) {
    return;
  }
  let startIndex = start2.index;
  let startPos = $pos.start() + start2.offset;
  let endIndex = startIndex + 1;
  let endPos = startPos + start2.node.nodeSize;
  while (startIndex > 0 && isMarkInSet([...$pos.parent.child(startIndex - 1).marks], type, attributes)) {
    startIndex -= 1;
    startPos -= $pos.parent.child(startIndex).nodeSize;
  }
  while (endIndex < $pos.parent.childCount && isMarkInSet([...$pos.parent.child(endIndex).marks], type, attributes)) {
    endPos += $pos.parent.child(endIndex).nodeSize;
    endIndex += 1;
  }
  return {
    from: startPos,
    to: endPos
  };
}
__name(getMarkRange, "getMarkRange");
function getMarkType(nameOrType, schema2) {
  if (typeof nameOrType === "string") {
    if (!schema2.marks[nameOrType]) {
      throw Error(`There is no mark type named '${nameOrType}'. Maybe you forgot to add the extension?`);
    }
    return schema2.marks[nameOrType];
  }
  return nameOrType;
}
__name(getMarkType, "getMarkType");
const extendMarkRange = /* @__PURE__ */ __name((typeOrName, attributes = {}) => ({ tr: tr2, state, dispatch }) => {
  const type = getMarkType(typeOrName, state.schema);
  const { doc: doc2, selection } = tr2;
  const { $from, from: from2, to } = selection;
  if (dispatch) {
    const range2 = getMarkRange($from, type, attributes);
    if (range2 && range2.from <= from2 && range2.to >= to) {
      const newSelection = TextSelection.create(doc2, range2.from, range2.to);
      tr2.setSelection(newSelection);
    }
  }
  return true;
}, "extendMarkRange");
const first = /* @__PURE__ */ __name((commands2) => (props) => {
  const items2 = typeof commands2 === "function" ? commands2(props) : commands2;
  for (let i2 = 0; i2 < items2.length; i2 += 1) {
    if (items2[i2](props)) {
      return true;
    }
  }
  return false;
}, "first");
function isTextSelection(value4) {
  return value4 instanceof TextSelection;
}
__name(isTextSelection, "isTextSelection");
function minMax(value4 = 0, min = 0, max = 0) {
  return Math.min(Math.max(value4, min), max);
}
__name(minMax, "minMax");
function resolveFocusPosition(doc2, position3 = null) {
  if (!position3) {
    return null;
  }
  const selectionAtStart = Selection.atStart(doc2);
  const selectionAtEnd = Selection.atEnd(doc2);
  if (position3 === "start" || position3 === true) {
    return selectionAtStart;
  }
  if (position3 === "end") {
    return selectionAtEnd;
  }
  const minPos = selectionAtStart.from;
  const maxPos = selectionAtEnd.to;
  if (position3 === "all") {
    return TextSelection.create(doc2, minMax(0, minPos, maxPos), minMax(doc2.content.size, minPos, maxPos));
  }
  return TextSelection.create(doc2, minMax(position3, minPos, maxPos), minMax(position3, minPos, maxPos));
}
__name(resolveFocusPosition, "resolveFocusPosition");
function isiOS() {
  return [
    "iPad Simulator",
    "iPhone Simulator",
    "iPod Simulator",
    "iPad",
    "iPhone",
    "iPod"
  ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
}
__name(isiOS, "isiOS");
const focus = /* @__PURE__ */ __name((position3 = null, options4 = {}) => ({ editor, view, tr: tr2, dispatch }) => {
  options4 = {
    scrollIntoView: true,
    ...options4
  };
  const delayedFocus = /* @__PURE__ */ __name(() => {
    if (isiOS()) {
      view.dom.focus();
    }
    requestAnimationFrame(() => {
      if (!editor.isDestroyed) {
        view.focus();
        if (options4 === null || options4 === void 0 ? void 0 : options4.scrollIntoView) {
          editor.commands.scrollIntoView();
        }
      }
    });
  }, "delayedFocus");
  if (view.hasFocus() && position3 === null || position3 === false) {
    return true;
  }
  if (dispatch && position3 === null && !isTextSelection(editor.state.selection)) {
    delayedFocus();
    return true;
  }
  const selection = resolveFocusPosition(tr2.doc, position3) || editor.state.selection;
  const isSameSelection = editor.state.selection.eq(selection);
  if (dispatch) {
    if (!isSameSelection) {
      tr2.setSelection(selection);
    }
    if (isSameSelection && tr2.storedMarks) {
      tr2.setStoredMarks(tr2.storedMarks);
    }
    delayedFocus();
  }
  return true;
}, "focus");
const forEach = /* @__PURE__ */ __name((items2, fn) => (props) => {
  return items2.every((item3, index2) => fn(item3, { ...props, index: index2 }));
}, "forEach");
const insertContent = /* @__PURE__ */ __name((value4, options4) => ({ tr: tr2, commands: commands2 }) => {
  return commands2.insertContentAt({ from: tr2.selection.from, to: tr2.selection.to }, value4, options4);
}, "insertContent");
const removeWhitespaces = /* @__PURE__ */ __name((node3) => {
  const children = node3.childNodes;
  for (let i2 = children.length - 1; i2 >= 0; i2 -= 1) {
    const child = children[i2];
    if (child.nodeType === 3 && child.nodeValue && /^(\n\s\s|\n)$/.test(child.nodeValue)) {
      node3.removeChild(child);
    } else if (child.nodeType === 1) {
      removeWhitespaces(child);
    }
  }
  return node3;
}, "removeWhitespaces");
function elementFromString$1(value4) {
  const wrappedValue = `<body>${value4}</body>`;
  const html = new window.DOMParser().parseFromString(wrappedValue, "text/html").body;
  return removeWhitespaces(html);
}
__name(elementFromString$1, "elementFromString$1");
function createNodeFromContent(content2, schema2, options4) {
  if (content2 instanceof Node$2 || content2 instanceof Fragment) {
    return content2;
  }
  options4 = {
    slice: true,
    parseOptions: {},
    ...options4
  };
  const isJSONContent = typeof content2 === "object" && content2 !== null;
  const isTextContent = typeof content2 === "string";
  if (isJSONContent) {
    try {
      const isArrayContent = Array.isArray(content2) && content2.length > 0;
      if (isArrayContent) {
        return Fragment.fromArray(content2.map((item3) => schema2.nodeFromJSON(item3)));
      }
      const node3 = schema2.nodeFromJSON(content2);
      if (options4.errorOnInvalidContent) {
        node3.check();
      }
      return node3;
    } catch (error2) {
      if (options4.errorOnInvalidContent) {
        throw new Error("[tiptap error]: Invalid JSON content", { cause: error2 });
      }
      console.warn("[tiptap warn]: Invalid content.", "Passed value:", content2, "Error:", error2);
      return createNodeFromContent("", schema2, options4);
    }
  }
  if (isTextContent) {
    if (options4.errorOnInvalidContent) {
      let hasInvalidContent = false;
      let invalidContent = "";
      const contentCheckSchema = new Schema({
        topNode: schema2.spec.topNode,
        marks: schema2.spec.marks,
        // Prosemirror's schemas are executed such that: the last to execute, matches last
        // This means that we can add a catch-all node at the end of the schema to catch any content that we don't know how to handle
        nodes: schema2.spec.nodes.append({
          __tiptap__private__unknown__catch__all__node: {
            content: "inline*",
            group: "block",
            parseDOM: [
              {
                tag: "*",
                getAttrs: /* @__PURE__ */ __name((e2) => {
                  hasInvalidContent = true;
                  invalidContent = typeof e2 === "string" ? e2 : e2.outerHTML;
                  return null;
                }, "getAttrs")
              }
            ]
          }
        })
      });
      if (options4.slice) {
        DOMParser.fromSchema(contentCheckSchema).parseSlice(elementFromString$1(content2), options4.parseOptions);
      } else {
        DOMParser.fromSchema(contentCheckSchema).parse(elementFromString$1(content2), options4.parseOptions);
      }
      if (options4.errorOnInvalidContent && hasInvalidContent) {
        throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${invalidContent}`) });
      }
    }
    const parser = DOMParser.fromSchema(schema2);
    if (options4.slice) {
      return parser.parseSlice(elementFromString$1(content2), options4.parseOptions).content;
    }
    return parser.parse(elementFromString$1(content2), options4.parseOptions);
  }
  return createNodeFromContent("", schema2, options4);
}
__name(createNodeFromContent, "createNodeFromContent");
function selectionToInsertionEnd(tr2, startLen, bias) {
  const last = tr2.steps.length - 1;
  if (last < startLen) {
    return;
  }
  const step3 = tr2.steps[last];
  if (!(step3 instanceof ReplaceStep || step3 instanceof ReplaceAroundStep)) {
    return;
  }
  const map3 = tr2.mapping.maps[last];
  let end = 0;
  map3.forEach((_from, _to, _newFrom, newTo) => {
    if (end === 0) {
      end = newTo;
    }
  });
  tr2.setSelection(Selection.near(tr2.doc.resolve(end), bias));
}
__name(selectionToInsertionEnd, "selectionToInsertionEnd");
const isFragment = /* @__PURE__ */ __name((nodeOrFragment) => {
  return !("type" in nodeOrFragment);
}, "isFragment");
const insertContentAt = /* @__PURE__ */ __name((position3, value4, options4) => ({ tr: tr2, dispatch, editor }) => {
  var _a2;
  if (dispatch) {
    options4 = {
      parseOptions: editor.options.parseOptions,
      updateSelection: true,
      applyInputRules: false,
      applyPasteRules: false,
      ...options4
    };
    let content2;
    try {
      content2 = createNodeFromContent(value4, editor.schema, {
        parseOptions: {
          preserveWhitespace: "full",
          ...options4.parseOptions
        },
        errorOnInvalidContent: (_a2 = options4.errorOnInvalidContent) !== null && _a2 !== void 0 ? _a2 : editor.options.enableContentCheck
      });
    } catch (e2) {
      editor.emit("contentError", {
        editor,
        error: e2,
        disableCollaboration: /* @__PURE__ */ __name(() => {
          if (editor.storage.collaboration) {
            editor.storage.collaboration.isDisabled = true;
          }
        }, "disableCollaboration")
      });
      return false;
    }
    let { from: from2, to } = typeof position3 === "number" ? { from: position3, to: position3 } : { from: position3.from, to: position3.to };
    let isOnlyTextContent = true;
    let isOnlyBlockContent = true;
    const nodes = isFragment(content2) ? content2 : [content2];
    nodes.forEach((node3) => {
      node3.check();
      isOnlyTextContent = isOnlyTextContent ? node3.isText && node3.marks.length === 0 : false;
      isOnlyBlockContent = isOnlyBlockContent ? node3.isBlock : false;
    });
    if (from2 === to && isOnlyBlockContent) {
      const { parent } = tr2.doc.resolve(from2);
      const isEmptyTextBlock = parent.isTextblock && !parent.type.spec.code && !parent.childCount;
      if (isEmptyTextBlock) {
        from2 -= 1;
        to += 1;
      }
    }
    let newContent;
    if (isOnlyTextContent) {
      if (Array.isArray(value4)) {
        newContent = value4.map((v2) => v2.text || "").join("");
      } else if (value4 instanceof Fragment) {
        let text2 = "";
        value4.forEach((node3) => {
          if (node3.text) {
            text2 += node3.text;
          }
        });
        newContent = text2;
      } else if (typeof value4 === "object" && !!value4 && !!value4.text) {
        newContent = value4.text;
      } else {
        newContent = value4;
      }
      tr2.insertText(newContent, from2, to);
    } else {
      newContent = content2;
      tr2.replaceWith(from2, to, newContent);
    }
    if (options4.updateSelection) {
      selectionToInsertionEnd(tr2, tr2.steps.length - 1, -1);
    }
    if (options4.applyInputRules) {
      tr2.setMeta("applyInputRules", { from: from2, text: newContent });
    }
    if (options4.applyPasteRules) {
      tr2.setMeta("applyPasteRules", { from: from2, text: newContent });
    }
  }
  return true;
}, "insertContentAt");
const joinUp = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return joinUp$1(state, dispatch);
}, "joinUp");
const joinDown = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return joinDown$1(state, dispatch);
}, "joinDown");
const joinBackward = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return joinBackward$1(state, dispatch);
}, "joinBackward");
const joinForward = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return joinForward$1(state, dispatch);
}, "joinForward");
const joinItemBackward = /* @__PURE__ */ __name(() => ({ state, dispatch, tr: tr2 }) => {
  try {
    const point = joinPoint(state.doc, state.selection.$from.pos, -1);
    if (point === null || point === void 0) {
      return false;
    }
    tr2.join(point, 2);
    if (dispatch) {
      dispatch(tr2);
    }
    return true;
  } catch (e2) {
    return false;
  }
}, "joinItemBackward");
const joinItemForward = /* @__PURE__ */ __name(() => ({ state, dispatch, tr: tr2 }) => {
  try {
    const point = joinPoint(state.doc, state.selection.$from.pos, 1);
    if (point === null || point === void 0) {
      return false;
    }
    tr2.join(point, 2);
    if (dispatch) {
      dispatch(tr2);
    }
    return true;
  } catch (e2) {
    return false;
  }
}, "joinItemForward");
const joinTextblockBackward = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return joinTextblockBackward$1(state, dispatch);
}, "joinTextblockBackward");
const joinTextblockForward = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return joinTextblockForward$1(state, dispatch);
}, "joinTextblockForward");
function isMacOS() {
  return typeof navigator !== "undefined" ? /Mac/.test(navigator.platform) : false;
}
__name(isMacOS, "isMacOS");
function normalizeKeyName(name2) {
  const parts2 = name2.split(/-(?!$)/);
  let result = parts2[parts2.length - 1];
  if (result === "Space") {
    result = " ";
  }
  let alt;
  let ctrl;
  let shift2;
  let meta;
  for (let i2 = 0; i2 < parts2.length - 1; i2 += 1) {
    const mod = parts2[i2];
    if (/^(cmd|meta|m)$/i.test(mod)) {
      meta = true;
    } else if (/^a(lt)?$/i.test(mod)) {
      alt = true;
    } else if (/^(c|ctrl|control)$/i.test(mod)) {
      ctrl = true;
    } else if (/^s(hift)?$/i.test(mod)) {
      shift2 = true;
    } else if (/^mod$/i.test(mod)) {
      if (isiOS() || isMacOS()) {
        meta = true;
      } else {
        ctrl = true;
      }
    } else {
      throw new Error(`Unrecognized modifier name: ${mod}`);
    }
  }
  if (alt) {
    result = `Alt-${result}`;
  }
  if (ctrl) {
    result = `Ctrl-${result}`;
  }
  if (meta) {
    result = `Meta-${result}`;
  }
  if (shift2) {
    result = `Shift-${result}`;
  }
  return result;
}
__name(normalizeKeyName, "normalizeKeyName");
const keyboardShortcut = /* @__PURE__ */ __name((name2) => ({ editor, view, tr: tr2, dispatch }) => {
  const keys2 = normalizeKeyName(name2).split(/-(?!$)/);
  const key = keys2.find((item3) => !["Alt", "Ctrl", "Meta", "Shift"].includes(item3));
  const event = new KeyboardEvent("keydown", {
    key: key === "Space" ? " " : key,
    altKey: keys2.includes("Alt"),
    ctrlKey: keys2.includes("Ctrl"),
    metaKey: keys2.includes("Meta"),
    shiftKey: keys2.includes("Shift"),
    bubbles: true,
    cancelable: true
  });
  const capturedTransaction = editor.captureTransaction(() => {
    view.someProp("handleKeyDown", (f) => f(view, event));
  });
  capturedTransaction === null || capturedTransaction === void 0 ? void 0 : capturedTransaction.steps.forEach((step3) => {
    const newStep = step3.map(tr2.mapping);
    if (newStep && dispatch) {
      tr2.maybeStep(newStep);
    }
  });
  return true;
}, "keyboardShortcut");
function isNodeActive(state, typeOrName, attributes = {}) {
  const { from: from2, to, empty: empty3 } = state.selection;
  const type = typeOrName ? getNodeType(typeOrName, state.schema) : null;
  const nodeRanges = [];
  state.doc.nodesBetween(from2, to, (node3, pos2) => {
    if (node3.isText) {
      return;
    }
    const relativeFrom = Math.max(from2, pos2);
    const relativeTo = Math.min(to, pos2 + node3.nodeSize);
    nodeRanges.push({
      node: node3,
      from: relativeFrom,
      to: relativeTo
    });
  });
  const selectionRange = to - from2;
  const matchedNodeRanges = nodeRanges.filter((nodeRange) => {
    if (!type) {
      return true;
    }
    return type.name === nodeRange.node.type.name;
  }).filter((nodeRange) => objectIncludes(nodeRange.node.attrs, attributes, { strict: false }));
  if (empty3) {
    return !!matchedNodeRanges.length;
  }
  const range2 = matchedNodeRanges.reduce((sum, nodeRange) => sum + nodeRange.to - nodeRange.from, 0);
  return range2 >= selectionRange;
}
__name(isNodeActive, "isNodeActive");
const lift = /* @__PURE__ */ __name((typeOrName, attributes = {}) => ({ state, dispatch }) => {
  const type = getNodeType(typeOrName, state.schema);
  const isActive2 = isNodeActive(state, type, attributes);
  if (!isActive2) {
    return false;
  }
  return lift$1(state, dispatch);
}, "lift");
const liftEmptyBlock = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return liftEmptyBlock$1(state, dispatch);
}, "liftEmptyBlock");
const liftListItem = /* @__PURE__ */ __name((typeOrName) => ({ state, dispatch }) => {
  const type = getNodeType(typeOrName, state.schema);
  return liftListItem$1(type)(state, dispatch);
}, "liftListItem");
const newlineInCode = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return newlineInCode$1(state, dispatch);
}, "newlineInCode");
function getSchemaTypeNameByName(name2, schema2) {
  if (schema2.nodes[name2]) {
    return "node";
  }
  if (schema2.marks[name2]) {
    return "mark";
  }
  return null;
}
__name(getSchemaTypeNameByName, "getSchemaTypeNameByName");
function deleteProps(obj, propOrProps) {
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
  return Object.keys(obj).reduce((newObj, prop2) => {
    if (!props.includes(prop2)) {
      newObj[prop2] = obj[prop2];
    }
    return newObj;
  }, {});
}
__name(deleteProps, "deleteProps");
const resetAttributes = /* @__PURE__ */ __name((typeOrName, attributes) => ({ tr: tr2, state, dispatch }) => {
  let nodeType = null;
  let markType = null;
  const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
  if (!schemaType) {
    return false;
  }
  if (schemaType === "node") {
    nodeType = getNodeType(typeOrName, state.schema);
  }
  if (schemaType === "mark") {
    markType = getMarkType(typeOrName, state.schema);
  }
  if (dispatch) {
    tr2.selection.ranges.forEach((range2) => {
      state.doc.nodesBetween(range2.$from.pos, range2.$to.pos, (node3, pos2) => {
        if (nodeType && nodeType === node3.type) {
          tr2.setNodeMarkup(pos2, void 0, deleteProps(node3.attrs, attributes));
        }
        if (markType && node3.marks.length) {
          node3.marks.forEach((mark2) => {
            if (markType === mark2.type) {
              tr2.addMark(pos2, pos2 + node3.nodeSize, markType.create(deleteProps(mark2.attrs, attributes)));
            }
          });
        }
      });
    });
  }
  return true;
}, "resetAttributes");
const scrollIntoView = /* @__PURE__ */ __name(() => ({ tr: tr2, dispatch }) => {
  if (dispatch) {
    tr2.scrollIntoView();
  }
  return true;
}, "scrollIntoView");
const selectAll = /* @__PURE__ */ __name(() => ({ tr: tr2, commands: commands2 }) => {
  return commands2.setTextSelection({
    from: 0,
    to: tr2.doc.content.size
  });
}, "selectAll");
const selectNodeBackward = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return selectNodeBackward$1(state, dispatch);
}, "selectNodeBackward");
const selectNodeForward = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return selectNodeForward$1(state, dispatch);
}, "selectNodeForward");
const selectParentNode = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return selectParentNode$1(state, dispatch);
}, "selectParentNode");
const selectTextblockEnd = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return selectTextblockEnd$1(state, dispatch);
}, "selectTextblockEnd");
const selectTextblockStart = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  return selectTextblockStart$1(state, dispatch);
}, "selectTextblockStart");
function createDocument(content2, schema2, parseOptions = {}, options4 = {}) {
  return createNodeFromContent(content2, schema2, {
    slice: false,
    parseOptions,
    errorOnInvalidContent: options4.errorOnInvalidContent
  });
}
__name(createDocument, "createDocument");
const setContent = /* @__PURE__ */ __name((content2, emitUpdate = false, parseOptions = {}, options4 = {}) => ({ editor, tr: tr2, dispatch, commands: commands2 }) => {
  var _a2, _b;
  const { doc: doc2 } = tr2;
  if (parseOptions.preserveWhitespace !== "full") {
    const document2 = createDocument(content2, editor.schema, parseOptions, {
      errorOnInvalidContent: (_a2 = options4.errorOnInvalidContent) !== null && _a2 !== void 0 ? _a2 : editor.options.enableContentCheck
    });
    if (dispatch) {
      tr2.replaceWith(0, doc2.content.size, document2).setMeta("preventUpdate", !emitUpdate);
    }
    return true;
  }
  if (dispatch) {
    tr2.setMeta("preventUpdate", !emitUpdate);
  }
  return commands2.insertContentAt({ from: 0, to: doc2.content.size }, content2, {
    parseOptions,
    errorOnInvalidContent: (_b = options4.errorOnInvalidContent) !== null && _b !== void 0 ? _b : editor.options.enableContentCheck
  });
}, "setContent");
function getMarkAttributes(state, typeOrName) {
  const type = getMarkType(typeOrName, state.schema);
  const { from: from2, to, empty: empty3 } = state.selection;
  const marks = [];
  if (empty3) {
    if (state.storedMarks) {
      marks.push(...state.storedMarks);
    }
    marks.push(...state.selection.$head.marks());
  } else {
    state.doc.nodesBetween(from2, to, (node3) => {
      marks.push(...node3.marks);
    });
  }
  const mark2 = marks.find((markItem) => markItem.type.name === type.name);
  if (!mark2) {
    return {};
  }
  return { ...mark2.attrs };
}
__name(getMarkAttributes, "getMarkAttributes");
function combineTransactionSteps(oldDoc, transactions) {
  const transform2 = new Transform(oldDoc);
  transactions.forEach((transaction) => {
    transaction.steps.forEach((step3) => {
      transform2.step(step3);
    });
  });
  return transform2;
}
__name(combineTransactionSteps, "combineTransactionSteps");
function defaultBlockAt(match2) {
  for (let i2 = 0; i2 < match2.edgeCount; i2 += 1) {
    const { type } = match2.edge(i2);
    if (type.isTextblock && !type.hasRequiredAttrs()) {
      return type;
    }
  }
  return null;
}
__name(defaultBlockAt, "defaultBlockAt");
function findChildren(node3, predicate) {
  const nodesWithPos = [];
  node3.descendants((child, pos2) => {
    if (predicate(child)) {
      nodesWithPos.push({
        node: child,
        pos: pos2
      });
    }
  });
  return nodesWithPos;
}
__name(findChildren, "findChildren");
function findChildrenInRange(node3, range2, predicate) {
  const nodesWithPos = [];
  node3.nodesBetween(range2.from, range2.to, (child, pos2) => {
    if (predicate(child)) {
      nodesWithPos.push({
        node: child,
        pos: pos2
      });
    }
  });
  return nodesWithPos;
}
__name(findChildrenInRange, "findChildrenInRange");
function findParentNodeClosestToPos($pos, predicate) {
  for (let i2 = $pos.depth; i2 > 0; i2 -= 1) {
    const node3 = $pos.node(i2);
    if (predicate(node3)) {
      return {
        pos: i2 > 0 ? $pos.before(i2) : 0,
        start: $pos.start(i2),
        depth: i2,
        node: node3
      };
    }
  }
}
__name(findParentNodeClosestToPos, "findParentNodeClosestToPos");
function findParentNode(predicate) {
  return (selection) => findParentNodeClosestToPos(selection.$from, predicate);
}
__name(findParentNode, "findParentNode");
function getSchema(extensions, editor) {
  const resolvedExtensions = ExtensionManager.resolve(extensions);
  return getSchemaByResolvedExtensions(resolvedExtensions, editor);
}
__name(getSchema, "getSchema");
function generateHTML(doc2, extensions) {
  const schema2 = getSchema(extensions);
  const contentNode = Node$2.fromJSON(schema2, doc2);
  return getHTMLFromFragment(contentNode.content, schema2);
}
__name(generateHTML, "generateHTML");
function generateJSON(html, extensions) {
  const schema2 = getSchema(extensions);
  const dom = elementFromString$1(html);
  return DOMParser.fromSchema(schema2).parse(dom).toJSON();
}
__name(generateJSON, "generateJSON");
function getText(node3, options4) {
  const range2 = {
    from: 0,
    to: node3.content.size
  };
  return getTextBetween(node3, range2, options4);
}
__name(getText, "getText");
function generateText(doc2, extensions, options4) {
  const { blockSeparator = "\n\n", textSerializers = {} } = options4 || {};
  const schema2 = getSchema(extensions);
  const contentNode = Node$2.fromJSON(schema2, doc2);
  return getText(contentNode, {
    blockSeparator,
    textSerializers: {
      ...getTextSerializersFromSchema(schema2),
      ...textSerializers
    }
  });
}
__name(generateText, "generateText");
function getNodeAttributes(state, typeOrName) {
  const type = getNodeType(typeOrName, state.schema);
  const { from: from2, to } = state.selection;
  const nodes = [];
  state.doc.nodesBetween(from2, to, (node4) => {
    nodes.push(node4);
  });
  const node3 = nodes.reverse().find((nodeItem) => nodeItem.type.name === type.name);
  if (!node3) {
    return {};
  }
  return { ...node3.attrs };
}
__name(getNodeAttributes, "getNodeAttributes");
function getAttributes(state, typeOrName) {
  const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
  if (schemaType === "node") {
    return getNodeAttributes(state, typeOrName);
  }
  if (schemaType === "mark") {
    return getMarkAttributes(state, typeOrName);
  }
  return {};
}
__name(getAttributes, "getAttributes");
function removeDuplicates(array, by = JSON.stringify) {
  const seen2 = {};
  return array.filter((item3) => {
    const key = by(item3);
    return Object.prototype.hasOwnProperty.call(seen2, key) ? false : seen2[key] = true;
  });
}
__name(removeDuplicates, "removeDuplicates");
function simplifyChangedRanges(changes) {
  const uniqueChanges = removeDuplicates(changes);
  return uniqueChanges.length === 1 ? uniqueChanges : uniqueChanges.filter((change, index2) => {
    const rest = uniqueChanges.filter((_2, i2) => i2 !== index2);
    return !rest.some((otherChange) => {
      return change.oldRange.from >= otherChange.oldRange.from && change.oldRange.to <= otherChange.oldRange.to && change.newRange.from >= otherChange.newRange.from && change.newRange.to <= otherChange.newRange.to;
    });
  });
}
__name(simplifyChangedRanges, "simplifyChangedRanges");
function getChangedRanges(transform2) {
  const { mapping, steps } = transform2;
  const changes = [];
  mapping.maps.forEach((stepMap, index2) => {
    const ranges = [];
    if (!stepMap.ranges.length) {
      const { from: from2, to } = steps[index2];
      if (from2 === void 0 || to === void 0) {
        return;
      }
      ranges.push({ from: from2, to });
    } else {
      stepMap.forEach((from2, to) => {
        ranges.push({ from: from2, to });
      });
    }
    ranges.forEach(({ from: from2, to }) => {
      const newStart = mapping.slice(index2).map(from2, -1);
      const newEnd = mapping.slice(index2).map(to);
      const oldStart = mapping.invert().map(newStart, -1);
      const oldEnd = mapping.invert().map(newEnd);
      changes.push({
        oldRange: {
          from: oldStart,
          to: oldEnd
        },
        newRange: {
          from: newStart,
          to: newEnd
        }
      });
    });
  });
  return simplifyChangedRanges(changes);
}
__name(getChangedRanges, "getChangedRanges");
function getDebugJSON(node3, startOffset = 0) {
  const isTopNode = node3.type === node3.type.schema.topNodeType;
  const increment = isTopNode ? 0 : 1;
  const from2 = startOffset;
  const to = from2 + node3.nodeSize;
  const marks = node3.marks.map((mark2) => {
    const output2 = {
      type: mark2.type.name
    };
    if (Object.keys(mark2.attrs).length) {
      output2.attrs = { ...mark2.attrs };
    }
    return output2;
  });
  const attrs4 = { ...node3.attrs };
  const output = {
    type: node3.type.name,
    from: from2,
    to
  };
  if (Object.keys(attrs4).length) {
    output.attrs = attrs4;
  }
  if (marks.length) {
    output.marks = marks;
  }
  if (node3.content.childCount) {
    output.content = [];
    node3.forEach((child, offset) => {
      var _a2;
      (_a2 = output.content) === null || _a2 === void 0 ? void 0 : _a2.push(getDebugJSON(child, startOffset + offset + increment));
    });
  }
  if (node3.text) {
    output.text = node3.text;
  }
  return output;
}
__name(getDebugJSON, "getDebugJSON");
function getMarksBetween(from2, to, doc2) {
  const marks = [];
  if (from2 === to) {
    doc2.resolve(from2).marks().forEach((mark2) => {
      const $pos = doc2.resolve(from2);
      const range2 = getMarkRange($pos, mark2.type);
      if (!range2) {
        return;
      }
      marks.push({
        mark: mark2,
        ...range2
      });
    });
  } else {
    doc2.nodesBetween(from2, to, (node3, pos2) => {
      if (!node3 || (node3 === null || node3 === void 0 ? void 0 : node3.nodeSize) === void 0) {
        return;
      }
      marks.push(...node3.marks.map((mark2) => ({
        from: pos2,
        to: pos2 + node3.nodeSize,
        mark: mark2
      })));
    });
  }
  return marks;
}
__name(getMarksBetween, "getMarksBetween");
const getNodeAtPosition = /* @__PURE__ */ __name((state, typeOrName, pos2, maxDepth = 20) => {
  const $pos = state.doc.resolve(pos2);
  let currentDepth = maxDepth;
  let node3 = null;
  while (currentDepth > 0 && node3 === null) {
    const currentNode = $pos.node(currentDepth);
    if ((currentNode === null || currentNode === void 0 ? void 0 : currentNode.type.name) === typeOrName) {
      node3 = currentNode;
    } else {
      currentDepth -= 1;
    }
  }
  return [node3, currentDepth];
}, "getNodeAtPosition");
function getSplittedAttributes(extensionAttributes, typeName, attributes) {
  return Object.fromEntries(Object.entries(attributes).filter(([name2]) => {
    const extensionAttribute = extensionAttributes.find((item3) => {
      return item3.type === typeName && item3.name === name2;
    });
    if (!extensionAttribute) {
      return false;
    }
    return extensionAttribute.attribute.keepOnSplit;
  }));
}
__name(getSplittedAttributes, "getSplittedAttributes");
function isMarkActive(state, typeOrName, attributes = {}) {
  const { empty: empty3, ranges } = state.selection;
  const type = typeOrName ? getMarkType(typeOrName, state.schema) : null;
  if (empty3) {
    return !!(state.storedMarks || state.selection.$from.marks()).filter((mark2) => {
      if (!type) {
        return true;
      }
      return type.name === mark2.type.name;
    }).find((mark2) => objectIncludes(mark2.attrs, attributes, { strict: false }));
  }
  let selectionRange = 0;
  const markRanges = [];
  ranges.forEach(({ $from, $to }) => {
    const from2 = $from.pos;
    const to = $to.pos;
    state.doc.nodesBetween(from2, to, (node3, pos2) => {
      if (!node3.isText && !node3.marks.length) {
        return;
      }
      const relativeFrom = Math.max(from2, pos2);
      const relativeTo = Math.min(to, pos2 + node3.nodeSize);
      const range3 = relativeTo - relativeFrom;
      selectionRange += range3;
      markRanges.push(...node3.marks.map((mark2) => ({
        mark: mark2,
        from: relativeFrom,
        to: relativeTo
      })));
    });
  });
  if (selectionRange === 0) {
    return false;
  }
  const matchedRange = markRanges.filter((markRange) => {
    if (!type) {
      return true;
    }
    return type.name === markRange.mark.type.name;
  }).filter((markRange) => objectIncludes(markRange.mark.attrs, attributes, { strict: false })).reduce((sum, markRange) => sum + markRange.to - markRange.from, 0);
  const excludedRange = markRanges.filter((markRange) => {
    if (!type) {
      return true;
    }
    return markRange.mark.type !== type && markRange.mark.type.excludes(type);
  }).reduce((sum, markRange) => sum + markRange.to - markRange.from, 0);
  const range2 = matchedRange > 0 ? matchedRange + excludedRange : matchedRange;
  return range2 >= selectionRange;
}
__name(isMarkActive, "isMarkActive");
function isActive(state, name2, attributes = {}) {
  if (!name2) {
    return isNodeActive(state, null, attributes) || isMarkActive(state, null, attributes);
  }
  const schemaType = getSchemaTypeNameByName(name2, state.schema);
  if (schemaType === "node") {
    return isNodeActive(state, name2, attributes);
  }
  if (schemaType === "mark") {
    return isMarkActive(state, name2, attributes);
  }
  return false;
}
__name(isActive, "isActive");
const isAtEndOfNode = /* @__PURE__ */ __name((state, nodeType) => {
  const { $from, $to, $anchor } = state.selection;
  if (nodeType) {
    const parentNode2 = findParentNode((node3) => node3.type.name === nodeType)(state.selection);
    if (!parentNode2) {
      return false;
    }
    const $parentPos = state.doc.resolve(parentNode2.pos + 1);
    if ($anchor.pos + 1 === $parentPos.end()) {
      return true;
    }
    return false;
  }
  if ($to.parentOffset < $to.parent.nodeSize - 2 || $from.pos !== $to.pos) {
    return false;
  }
  return true;
}, "isAtEndOfNode");
const isAtStartOfNode = /* @__PURE__ */ __name((state) => {
  const { $from, $to } = state.selection;
  if ($from.parentOffset > 0 || $from.pos !== $to.pos) {
    return false;
  }
  return true;
}, "isAtStartOfNode");
function isList(name2, extensions) {
  const { nodeExtensions } = splitExtensions(extensions);
  const extension = nodeExtensions.find((item3) => item3.name === name2);
  if (!extension) {
    return false;
  }
  const context = {
    name: extension.name,
    options: extension.options,
    storage: extension.storage
  };
  const group = callOrReturn(getExtensionField(extension, "group", context));
  if (typeof group !== "string") {
    return false;
  }
  return group.split(" ").includes("list");
}
__name(isList, "isList");
function isNodeEmpty(node3, { checkChildren = true, ignoreWhitespace = false } = {}) {
  var _a2;
  if (ignoreWhitespace) {
    if (node3.type.name === "hardBreak") {
      return true;
    }
    if (node3.isText) {
      return /^\s*$/m.test((_a2 = node3.text) !== null && _a2 !== void 0 ? _a2 : "");
    }
  }
  if (node3.isText) {
    return !node3.text;
  }
  if (node3.isAtom || node3.isLeaf) {
    return false;
  }
  if (node3.content.childCount === 0) {
    return true;
  }
  if (checkChildren) {
    let isContentEmpty = true;
    node3.content.forEach((childNode) => {
      if (isContentEmpty === false) {
        return;
      }
      if (!isNodeEmpty(childNode, { ignoreWhitespace, checkChildren })) {
        isContentEmpty = false;
      }
    });
    return isContentEmpty;
  }
  return false;
}
__name(isNodeEmpty, "isNodeEmpty");
function isNodeSelection(value4) {
  return value4 instanceof NodeSelection;
}
__name(isNodeSelection, "isNodeSelection");
function posToDOMRect(view, from2, to) {
  const minPos = 0;
  const maxPos = view.state.doc.content.size;
  const resolvedFrom = minMax(from2, minPos, maxPos);
  const resolvedEnd = minMax(to, minPos, maxPos);
  const start2 = view.coordsAtPos(resolvedFrom);
  const end = view.coordsAtPos(resolvedEnd, -1);
  const top = Math.min(start2.top, end.top);
  const bottom = Math.max(start2.bottom, end.bottom);
  const left = Math.min(start2.left, end.left);
  const right = Math.max(start2.right, end.right);
  const width2 = right - left;
  const height = bottom - top;
  const x2 = left;
  const y2 = top;
  const data24 = {
    top,
    bottom,
    left,
    right,
    width: width2,
    height,
    x: x2,
    y: y2
  };
  return {
    ...data24,
    toJSON: /* @__PURE__ */ __name(() => data24, "toJSON")
  };
}
__name(posToDOMRect, "posToDOMRect");
function canSetMark(state, tr2, newMarkType) {
  var _a2;
  const { selection } = tr2;
  let cursor = null;
  if (isTextSelection(selection)) {
    cursor = selection.$cursor;
  }
  if (cursor) {
    const currentMarks = (_a2 = state.storedMarks) !== null && _a2 !== void 0 ? _a2 : cursor.marks();
    return !!newMarkType.isInSet(currentMarks) || !currentMarks.some((mark2) => mark2.type.excludes(newMarkType));
  }
  const { ranges } = selection;
  return ranges.some(({ $from, $to }) => {
    let someNodeSupportsMark = $from.depth === 0 ? state.doc.inlineContent && state.doc.type.allowsMarkType(newMarkType) : false;
    state.doc.nodesBetween($from.pos, $to.pos, (node3, _pos, parent) => {
      if (someNodeSupportsMark) {
        return false;
      }
      if (node3.isInline) {
        const parentAllowsMarkType = !parent || parent.type.allowsMarkType(newMarkType);
        const currentMarksAllowMarkType = !!newMarkType.isInSet(node3.marks) || !node3.marks.some((otherMark) => otherMark.type.excludes(newMarkType));
        someNodeSupportsMark = parentAllowsMarkType && currentMarksAllowMarkType;
      }
      return !someNodeSupportsMark;
    });
    return someNodeSupportsMark;
  });
}
__name(canSetMark, "canSetMark");
const setMark = /* @__PURE__ */ __name((typeOrName, attributes = {}) => ({ tr: tr2, state, dispatch }) => {
  const { selection } = tr2;
  const { empty: empty3, ranges } = selection;
  const type = getMarkType(typeOrName, state.schema);
  if (dispatch) {
    if (empty3) {
      const oldAttributes = getMarkAttributes(state, type);
      tr2.addStoredMark(type.create({
        ...oldAttributes,
        ...attributes
      }));
    } else {
      ranges.forEach((range2) => {
        const from2 = range2.$from.pos;
        const to = range2.$to.pos;
        state.doc.nodesBetween(from2, to, (node3, pos2) => {
          const trimmedFrom = Math.max(pos2, from2);
          const trimmedTo = Math.min(pos2 + node3.nodeSize, to);
          const someHasMark = node3.marks.find((mark2) => mark2.type === type);
          if (someHasMark) {
            node3.marks.forEach((mark2) => {
              if (type === mark2.type) {
                tr2.addMark(trimmedFrom, trimmedTo, type.create({
                  ...mark2.attrs,
                  ...attributes
                }));
              }
            });
          } else {
            tr2.addMark(trimmedFrom, trimmedTo, type.create(attributes));
          }
        });
      });
    }
  }
  return canSetMark(state, tr2, type);
}, "setMark");
const setMeta = /* @__PURE__ */ __name((key, value4) => ({ tr: tr2 }) => {
  tr2.setMeta(key, value4);
  return true;
}, "setMeta");
const setNode = /* @__PURE__ */ __name((typeOrName, attributes = {}) => ({ state, dispatch, chain }) => {
  const type = getNodeType(typeOrName, state.schema);
  let attributesToCopy;
  if (state.selection.$anchor.sameParent(state.selection.$head)) {
    attributesToCopy = state.selection.$anchor.parent.attrs;
  }
  if (!type.isTextblock) {
    console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.');
    return false;
  }
  return chain().command(({ commands: commands2 }) => {
    const canSetBlock = setBlockType(type, { ...attributesToCopy, ...attributes })(state);
    if (canSetBlock) {
      return true;
    }
    return commands2.clearNodes();
  }).command(({ state: updatedState }) => {
    return setBlockType(type, { ...attributesToCopy, ...attributes })(updatedState, dispatch);
  }).run();
}, "setNode");
const setNodeSelection = /* @__PURE__ */ __name((position3) => ({ tr: tr2, dispatch }) => {
  if (dispatch) {
    const { doc: doc2 } = tr2;
    const from2 = minMax(position3, 0, doc2.content.size);
    const selection = NodeSelection.create(doc2, from2);
    tr2.setSelection(selection);
  }
  return true;
}, "setNodeSelection");
const setTextSelection = /* @__PURE__ */ __name((position3) => ({ tr: tr2, dispatch }) => {
  if (dispatch) {
    const { doc: doc2 } = tr2;
    const { from: from2, to } = typeof position3 === "number" ? { from: position3, to: position3 } : position3;
    const minPos = TextSelection.atStart(doc2).from;
    const maxPos = TextSelection.atEnd(doc2).to;
    const resolvedFrom = minMax(from2, minPos, maxPos);
    const resolvedEnd = minMax(to, minPos, maxPos);
    const selection = TextSelection.create(doc2, resolvedFrom, resolvedEnd);
    tr2.setSelection(selection);
  }
  return true;
}, "setTextSelection");
const sinkListItem = /* @__PURE__ */ __name((typeOrName) => ({ state, dispatch }) => {
  const type = getNodeType(typeOrName, state.schema);
  return sinkListItem$1(type)(state, dispatch);
}, "sinkListItem");
function ensureMarks(state, splittableMarks) {
  const marks = state.storedMarks || state.selection.$to.parentOffset && state.selection.$from.marks();
  if (marks) {
    const filteredMarks = marks.filter((mark2) => splittableMarks === null || splittableMarks === void 0 ? void 0 : splittableMarks.includes(mark2.type.name));
    state.tr.ensureMarks(filteredMarks);
  }
}
__name(ensureMarks, "ensureMarks");
const splitBlock = /* @__PURE__ */ __name(({ keepMarks = true } = {}) => ({ tr: tr2, state, dispatch, editor }) => {
  const { selection, doc: doc2 } = tr2;
  const { $from, $to } = selection;
  const extensionAttributes = editor.extensionManager.attributes;
  const newAttributes = getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs);
  if (selection instanceof NodeSelection && selection.node.isBlock) {
    if (!$from.parentOffset || !canSplit(doc2, $from.pos)) {
      return false;
    }
    if (dispatch) {
      if (keepMarks) {
        ensureMarks(state, editor.extensionManager.splittableMarks);
      }
      tr2.split($from.pos).scrollIntoView();
    }
    return true;
  }
  if (!$from.parent.isBlock) {
    return false;
  }
  const atEnd = $to.parentOffset === $to.parent.content.size;
  const deflt = $from.depth === 0 ? void 0 : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));
  let types = atEnd && deflt ? [
    {
      type: deflt,
      attrs: newAttributes
    }
  ] : void 0;
  let can = canSplit(tr2.doc, tr2.mapping.map($from.pos), 1, types);
  if (!types && !can && canSplit(tr2.doc, tr2.mapping.map($from.pos), 1, deflt ? [{ type: deflt }] : void 0)) {
    can = true;
    types = deflt ? [
      {
        type: deflt,
        attrs: newAttributes
      }
    ] : void 0;
  }
  if (dispatch) {
    if (can) {
      if (selection instanceof TextSelection) {
        tr2.deleteSelection();
      }
      tr2.split(tr2.mapping.map($from.pos), 1, types);
      if (deflt && !atEnd && !$from.parentOffset && $from.parent.type !== deflt) {
        const first2 = tr2.mapping.map($from.before());
        const $first = tr2.doc.resolve(first2);
        if ($from.node(-1).canReplaceWith($first.index(), $first.index() + 1, deflt)) {
          tr2.setNodeMarkup(tr2.mapping.map($from.before()), deflt);
        }
      }
    }
    if (keepMarks) {
      ensureMarks(state, editor.extensionManager.splittableMarks);
    }
    tr2.scrollIntoView();
  }
  return can;
}, "splitBlock");
const splitListItem = /* @__PURE__ */ __name((typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispatch, editor }) => {
  var _a2;
  const type = getNodeType(typeOrName, state.schema);
  const { $from, $to } = state.selection;
  const node3 = state.selection.node;
  if (node3 && node3.isBlock || $from.depth < 2 || !$from.sameParent($to)) {
    return false;
  }
  const grandParent = $from.node(-1);
  if (grandParent.type !== type) {
    return false;
  }
  const extensionAttributes = editor.extensionManager.attributes;
  if ($from.parent.content.size === 0 && $from.node(-1).childCount === $from.indexAfter(-1)) {
    if ($from.depth === 2 || $from.node(-3).type !== type || $from.index(-2) !== $from.node(-2).childCount - 1) {
      return false;
    }
    if (dispatch) {
      let wrap2 = Fragment.empty;
      const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
      for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) {
        wrap2 = Fragment.from($from.node(d).copy(wrap2));
      }
      const depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1 : $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
      const newNextTypeAttributes2 = {
        ...getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs),
        ...overrideAttrs
      };
      const nextType2 = ((_a2 = type.contentMatch.defaultType) === null || _a2 === void 0 ? void 0 : _a2.createAndFill(newNextTypeAttributes2)) || void 0;
      wrap2 = wrap2.append(Fragment.from(type.createAndFill(null, nextType2) || void 0));
      const start2 = $from.before($from.depth - (depthBefore - 1));
      tr2.replace(start2, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
      let sel = -1;
      tr2.doc.nodesBetween(start2, tr2.doc.content.size, (n, pos2) => {
        if (sel > -1) {
          return false;
        }
        if (n.isTextblock && n.content.size === 0) {
          sel = pos2 + 1;
        }
      });
      if (sel > -1) {
        tr2.setSelection(TextSelection.near(tr2.doc.resolve(sel)));
      }
      tr2.scrollIntoView();
    }
    return true;
  }
  const nextType = $to.pos === $from.end() ? grandParent.contentMatchAt(0).defaultType : null;
  const newTypeAttributes = {
    ...getSplittedAttributes(extensionAttributes, grandParent.type.name, grandParent.attrs),
    ...overrideAttrs
  };
  const newNextTypeAttributes = {
    ...getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs),
    ...overrideAttrs
  };
  tr2.delete($from.pos, $to.pos);
  const types = nextType ? [
    { type, attrs: newTypeAttributes },
    { type: nextType, attrs: newNextTypeAttributes }
  ] : [{ type, attrs: newTypeAttributes }];
  if (!canSplit(tr2.doc, $from.pos, 2)) {
    return false;
  }
  if (dispatch) {
    const { selection, storedMarks } = state;
    const { splittableMarks } = editor.extensionManager;
    const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
    tr2.split($from.pos, 2, types).scrollIntoView();
    if (!marks || !dispatch) {
      return true;
    }
    const filteredMarks = marks.filter((mark2) => splittableMarks.includes(mark2.type.name));
    tr2.ensureMarks(filteredMarks);
  }
  return true;
}, "splitListItem");
const joinListBackwards = /* @__PURE__ */ __name((tr2, listType) => {
  const list2 = findParentNode((node3) => node3.type === listType)(tr2.selection);
  if (!list2) {
    return true;
  }
  const before = tr2.doc.resolve(Math.max(0, list2.pos - 1)).before(list2.depth);
  if (before === void 0) {
    return true;
  }
  const nodeBefore = tr2.doc.nodeAt(before);
  const canJoinBackwards = list2.node.type === (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type) && canJoin(tr2.doc, list2.pos);
  if (!canJoinBackwards) {
    return true;
  }
  tr2.join(list2.pos);
  return true;
}, "joinListBackwards");
const joinListForwards = /* @__PURE__ */ __name((tr2, listType) => {
  const list2 = findParentNode((node3) => node3.type === listType)(tr2.selection);
  if (!list2) {
    return true;
  }
  const after = tr2.doc.resolve(list2.start).after(list2.depth);
  if (after === void 0) {
    return true;
  }
  const nodeAfter = tr2.doc.nodeAt(after);
  const canJoinForwards = list2.node.type === (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.type) && canJoin(tr2.doc, after);
  if (!canJoinForwards) {
    return true;
  }
  tr2.join(after);
  return true;
}, "joinListForwards");
const toggleList = /* @__PURE__ */ __name((listTypeOrName, itemTypeOrName, keepMarks, attributes = {}) => ({ editor, tr: tr2, state, dispatch, chain, commands: commands2, can }) => {
  const { extensions, splittableMarks } = editor.extensionManager;
  const listType = getNodeType(listTypeOrName, state.schema);
  const itemType = getNodeType(itemTypeOrName, state.schema);
  const { selection, storedMarks } = state;
  const { $from, $to } = selection;
  const range2 = $from.blockRange($to);
  const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
  if (!range2) {
    return false;
  }
  const parentList = findParentNode((node3) => isList(node3.type.name, extensions))(selection);
  if (range2.depth >= 1 && parentList && range2.depth - parentList.depth <= 1) {
    if (parentList.node.type === listType) {
      return commands2.liftListItem(itemType);
    }
    if (isList(parentList.node.type.name, extensions) && listType.validContent(parentList.node.content) && dispatch) {
      return chain().command(() => {
        tr2.setNodeMarkup(parentList.pos, listType);
        return true;
      }).command(() => joinListBackwards(tr2, listType)).command(() => joinListForwards(tr2, listType)).run();
    }
  }
  if (!keepMarks || !marks || !dispatch) {
    return chain().command(() => {
      const canWrapInList = can().wrapInList(listType, attributes);
      if (canWrapInList) {
        return true;
      }
      return commands2.clearNodes();
    }).wrapInList(listType, attributes).command(() => joinListBackwards(tr2, listType)).command(() => joinListForwards(tr2, listType)).run();
  }
  return chain().command(() => {
    const canWrapInList = can().wrapInList(listType, attributes);
    const filteredMarks = marks.filter((mark2) => splittableMarks.includes(mark2.type.name));
    tr2.ensureMarks(filteredMarks);
    if (canWrapInList) {
      return true;
    }
    return commands2.clearNodes();
  }).wrapInList(listType, attributes).command(() => joinListBackwards(tr2, listType)).command(() => joinListForwards(tr2, listType)).run();
}, "toggleList");
const toggleMark = /* @__PURE__ */ __name((typeOrName, attributes = {}, options4 = {}) => ({ state, commands: commands2 }) => {
  const { extendEmptyMarkRange = false } = options4;
  const type = getMarkType(typeOrName, state.schema);
  const isActive2 = isMarkActive(state, type, attributes);
  if (isActive2) {
    return commands2.unsetMark(type, { extendEmptyMarkRange });
  }
  return commands2.setMark(type, attributes);
}, "toggleMark");
const toggleNode = /* @__PURE__ */ __name((typeOrName, toggleTypeOrName, attributes = {}) => ({ state, commands: commands2 }) => {
  const type = getNodeType(typeOrName, state.schema);
  const toggleType = getNodeType(toggleTypeOrName, state.schema);
  const isActive2 = isNodeActive(state, type, attributes);
  let attributesToCopy;
  if (state.selection.$anchor.sameParent(state.selection.$head)) {
    attributesToCopy = state.selection.$anchor.parent.attrs;
  }
  if (isActive2) {
    return commands2.setNode(toggleType, attributesToCopy);
  }
  return commands2.setNode(type, { ...attributesToCopy, ...attributes });
}, "toggleNode");
const toggleWrap = /* @__PURE__ */ __name((typeOrName, attributes = {}) => ({ state, commands: commands2 }) => {
  const type = getNodeType(typeOrName, state.schema);
  const isActive2 = isNodeActive(state, type, attributes);
  if (isActive2) {
    return commands2.lift(type);
  }
  return commands2.wrapIn(type, attributes);
}, "toggleWrap");
const undoInputRule = /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
  const plugins = state.plugins;
  for (let i2 = 0; i2 < plugins.length; i2 += 1) {
    const plugin = plugins[i2];
    let undoable;
    if (plugin.spec.isInputRules && (undoable = plugin.getState(state))) {
      if (dispatch) {
        const tr2 = state.tr;
        const toUndo = undoable.transform;
        for (let j = toUndo.steps.length - 1; j >= 0; j -= 1) {
          tr2.step(toUndo.steps[j].invert(toUndo.docs[j]));
        }
        if (undoable.text) {
          const marks = tr2.doc.resolve(undoable.from).marks();
          tr2.replaceWith(undoable.from, undoable.to, state.schema.text(undoable.text, marks));
        } else {
          tr2.delete(undoable.from, undoable.to);
        }
      }
      return true;
    }
  }
  return false;
}, "undoInputRule");
const unsetAllMarks = /* @__PURE__ */ __name(() => ({ tr: tr2, dispatch }) => {
  const { selection } = tr2;
  const { empty: empty3, ranges } = selection;
  if (empty3) {
    return true;
  }
  if (dispatch) {
    ranges.forEach((range2) => {
      tr2.removeMark(range2.$from.pos, range2.$to.pos);
    });
  }
  return true;
}, "unsetAllMarks");
const unsetMark = /* @__PURE__ */ __name((typeOrName, options4 = {}) => ({ tr: tr2, state, dispatch }) => {
  var _a2;
  const { extendEmptyMarkRange = false } = options4;
  const { selection } = tr2;
  const type = getMarkType(typeOrName, state.schema);
  const { $from, empty: empty3, ranges } = selection;
  if (!dispatch) {
    return true;
  }
  if (empty3 && extendEmptyMarkRange) {
    let { from: from2, to } = selection;
    const attrs4 = (_a2 = $from.marks().find((mark2) => mark2.type === type)) === null || _a2 === void 0 ? void 0 : _a2.attrs;
    const range2 = getMarkRange($from, type, attrs4);
    if (range2) {
      from2 = range2.from;
      to = range2.to;
    }
    tr2.removeMark(from2, to, type);
  } else {
    ranges.forEach((range2) => {
      tr2.removeMark(range2.$from.pos, range2.$to.pos, type);
    });
  }
  tr2.removeStoredMark(type);
  return true;
}, "unsetMark");
const updateAttributes = /* @__PURE__ */ __name((typeOrName, attributes = {}) => ({ tr: tr2, state, dispatch }) => {
  let nodeType = null;
  let markType = null;
  const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
  if (!schemaType) {
    return false;
  }
  if (schemaType === "node") {
    nodeType = getNodeType(typeOrName, state.schema);
  }
  if (schemaType === "mark") {
    markType = getMarkType(typeOrName, state.schema);
  }
  if (dispatch) {
    tr2.selection.ranges.forEach((range2) => {
      const from2 = range2.$from.pos;
      const to = range2.$to.pos;
      let lastPos;
      let lastNode;
      let trimmedFrom;
      let trimmedTo;
      if (tr2.selection.empty) {
        state.doc.nodesBetween(from2, to, (node3, pos2) => {
          if (nodeType && nodeType === node3.type) {
            trimmedFrom = Math.max(pos2, from2);
            trimmedTo = Math.min(pos2 + node3.nodeSize, to);
            lastPos = pos2;
            lastNode = node3;
          }
        });
      } else {
        state.doc.nodesBetween(from2, to, (node3, pos2) => {
          if (pos2 < from2 && nodeType && nodeType === node3.type) {
            trimmedFrom = Math.max(pos2, from2);
            trimmedTo = Math.min(pos2 + node3.nodeSize, to);
            lastPos = pos2;
            lastNode = node3;
          }
          if (pos2 >= from2 && pos2 <= to) {
            if (nodeType && nodeType === node3.type) {
              tr2.setNodeMarkup(pos2, void 0, {
                ...node3.attrs,
                ...attributes
              });
            }
            if (markType && node3.marks.length) {
              node3.marks.forEach((mark2) => {
                if (markType === mark2.type) {
                  const trimmedFrom2 = Math.max(pos2, from2);
                  const trimmedTo2 = Math.min(pos2 + node3.nodeSize, to);
                  tr2.addMark(trimmedFrom2, trimmedTo2, markType.create({
                    ...mark2.attrs,
                    ...attributes
                  }));
                }
              });
            }
          }
        });
      }
      if (lastNode) {
        if (lastPos !== void 0) {
          tr2.setNodeMarkup(lastPos, void 0, {
            ...lastNode.attrs,
            ...attributes
          });
        }
        if (markType && lastNode.marks.length) {
          lastNode.marks.forEach((mark2) => {
            if (markType === mark2.type) {
              tr2.addMark(trimmedFrom, trimmedTo, markType.create({
                ...mark2.attrs,
                ...attributes
              }));
            }
          });
        }
      }
    });
  }
  return true;
}, "updateAttributes");
const wrapIn = /* @__PURE__ */ __name((typeOrName, attributes = {}) => ({ state, dispatch }) => {
  const type = getNodeType(typeOrName, state.schema);
  return wrapIn$1(type, attributes)(state, dispatch);
}, "wrapIn");
const wrapInList = /* @__PURE__ */ __name((typeOrName, attributes = {}) => ({ state, dispatch }) => {
  const type = getNodeType(typeOrName, state.schema);
  return wrapInList$1(type, attributes)(state, dispatch);
}, "wrapInList");
var commands = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  blur,
  clearContent,
  clearNodes,
  command,
  createParagraphNear,
  cut,
  deleteCurrentNode,
  deleteNode,
  deleteRange,
  deleteSelection,
  enter,
  exitCode,
  extendMarkRange,
  first,
  focus,
  forEach,
  insertContent,
  insertContentAt,
  joinBackward,
  joinDown,
  joinForward,
  joinItemBackward,
  joinItemForward,
  joinTextblockBackward,
  joinTextblockForward,
  joinUp,
  keyboardShortcut,
  lift,
  liftEmptyBlock,
  liftListItem,
  newlineInCode,
  resetAttributes,
  scrollIntoView,
  selectAll,
  selectNodeBackward,
  selectNodeForward,
  selectParentNode,
  selectTextblockEnd,
  selectTextblockStart,
  setContent,
  setMark,
  setMeta,
  setNode,
  setNodeSelection,
  setTextSelection,
  sinkListItem,
  splitBlock,
  splitListItem,
  toggleList,
  toggleMark,
  toggleNode,
  toggleWrap,
  undoInputRule,
  unsetAllMarks,
  unsetMark,
  updateAttributes,
  wrapIn,
  wrapInList
});
const Commands = Extension.create({
  name: "commands",
  addCommands() {
    return {
      ...commands
    };
  }
});
const Drop = Extension.create({
  name: "drop",
  addProseMirrorPlugins() {
    return [
      new Plugin({
        key: new PluginKey("tiptapDrop"),
        props: {
          handleDrop: /* @__PURE__ */ __name((_2, e2, slice2, moved) => {
            this.editor.emit("drop", {
              editor: this.editor,
              event: e2,
              slice: slice2,
              moved
            });
          }, "handleDrop")
        }
      })
    ];
  }
});
const Editable = Extension.create({
  name: "editable",
  addProseMirrorPlugins() {
    return [
      new Plugin({
        key: new PluginKey("editable"),
        props: {
          editable: /* @__PURE__ */ __name(() => this.editor.options.editable, "editable")
        }
      })
    ];
  }
});
const FocusEvents = Extension.create({
  name: "focusEvents",
  addProseMirrorPlugins() {
    const { editor } = this;
    return [
      new Plugin({
        key: new PluginKey("focusEvents"),
        props: {
          handleDOMEvents: {
            focus: /* @__PURE__ */ __name((view, event) => {
              editor.isFocused = true;
              const transaction = editor.state.tr.setMeta("focus", { event }).setMeta("addToHistory", false);
              view.dispatch(transaction);
              return false;
            }, "focus"),
            blur: /* @__PURE__ */ __name((view, event) => {
              editor.isFocused = false;
              const transaction = editor.state.tr.setMeta("blur", { event }).setMeta("addToHistory", false);
              view.dispatch(transaction);
              return false;
            }, "blur")
          }
        }
      })
    ];
  }
});
const Keymap = Extension.create({
  name: "keymap",
  addKeyboardShortcuts() {
    const handleBackspace = /* @__PURE__ */ __name(() => this.editor.commands.first(({ commands: commands2 }) => [
      () => commands2.undoInputRule(),
      // maybe convert first text block node to default node
      () => commands2.command(({ tr: tr2 }) => {
        const { selection, doc: doc2 } = tr2;
        const { empty: empty3, $anchor } = selection;
        const { pos: pos2, parent } = $anchor;
        const $parentPos = $anchor.parent.isTextblock && pos2 > 0 ? tr2.doc.resolve(pos2 - 1) : $anchor;
        const parentIsIsolating = $parentPos.parent.type.spec.isolating;
        const parentPos = $anchor.pos - $anchor.parentOffset;
        const isAtStart = parentIsIsolating && $parentPos.parent.childCount === 1 ? parentPos === $anchor.pos : Selection.atStart(doc2).from === pos2;
        if (!empty3 || !parent.type.isTextblock || parent.textContent.length || !isAtStart || isAtStart && $anchor.parent.type.name === "paragraph") {
          return false;
        }
        return commands2.clearNodes();
      }),
      () => commands2.deleteSelection(),
      () => commands2.joinBackward(),
      () => commands2.selectNodeBackward()
    ]), "handleBackspace");
    const handleDelete = /* @__PURE__ */ __name(() => this.editor.commands.first(({ commands: commands2 }) => [
      () => commands2.deleteSelection(),
      () => commands2.deleteCurrentNode(),
      () => commands2.joinForward(),
      () => commands2.selectNodeForward()
    ]), "handleDelete");
    const handleEnter = /* @__PURE__ */ __name(() => this.editor.commands.first(({ commands: commands2 }) => [
      () => commands2.newlineInCode(),
      () => commands2.createParagraphNear(),
      () => commands2.liftEmptyBlock(),
      () => commands2.splitBlock()
    ]), "handleEnter");
    const baseKeymap2 = {
      Enter: handleEnter,
      "Mod-Enter": /* @__PURE__ */ __name(() => this.editor.commands.exitCode(), "Mod-Enter"),
      Backspace: handleBackspace,
      "Mod-Backspace": handleBackspace,
      "Shift-Backspace": handleBackspace,
      Delete: handleDelete,
      "Mod-Delete": handleDelete,
      "Mod-a": /* @__PURE__ */ __name(() => this.editor.commands.selectAll(), "Mod-a")
    };
    const pcKeymap = {
      ...baseKeymap2
    };
    const macKeymap = {
      ...baseKeymap2,
      "Ctrl-h": handleBackspace,
      "Alt-Backspace": handleBackspace,
      "Ctrl-d": handleDelete,
      "Ctrl-Alt-Backspace": handleDelete,
      "Alt-Delete": handleDelete,
      "Alt-d": handleDelete,
      "Ctrl-a": /* @__PURE__ */ __name(() => this.editor.commands.selectTextblockStart(), "Ctrl-a"),
      "Ctrl-e": /* @__PURE__ */ __name(() => this.editor.commands.selectTextblockEnd(), "Ctrl-e")
    };
    if (isiOS() || isMacOS()) {
      return macKeymap;
    }
    return pcKeymap;
  },
  addProseMirrorPlugins() {
    return [
      // With this plugin we check if the whole document was selected and deleted.
      // In this case we will additionally call `clearNodes()` to convert e.g. a heading
      // to a paragraph if necessary.
      // This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
      // with many other commands.
      new Plugin({
        key: new PluginKey("clearDocument"),
        appendTransaction: /* @__PURE__ */ __name((transactions, oldState, newState) => {
          const docChanges = transactions.some((transaction) => transaction.docChanged) && !oldState.doc.eq(newState.doc);
          const ignoreTr = transactions.some((transaction) => transaction.getMeta("preventClearDocument"));
          if (!docChanges || ignoreTr) {
            return;
          }
          const { empty: empty3, from: from2, to } = oldState.selection;
          const allFrom = Selection.atStart(oldState.doc).from;
          const allEnd = Selection.atEnd(oldState.doc).to;
          const allWasSelected = from2 === allFrom && to === allEnd;
          if (empty3 || !allWasSelected) {
            return;
          }
          const isEmpty3 = isNodeEmpty(newState.doc);
          if (!isEmpty3) {
            return;
          }
          const tr2 = newState.tr;
          const state = createChainableState({
            state: newState,
            transaction: tr2
          });
          const { commands: commands2 } = new CommandManager({
            editor: this.editor,
            state
          });
          commands2.clearNodes();
          if (!tr2.steps.length) {
            return;
          }
          return tr2;
        }, "appendTransaction")
      })
    ];
  }
});
const Paste = Extension.create({
  name: "paste",
  addProseMirrorPlugins() {
    return [
      new Plugin({
        key: new PluginKey("tiptapPaste"),
        props: {
          handlePaste: /* @__PURE__ */ __name((_view, e2, slice2) => {
            this.editor.emit("paste", {
              editor: this.editor,
              event: e2,
              slice: slice2
            });
          }, "handlePaste")
        }
      })
    ];
  }
});
const Tabindex = Extension.create({
  name: "tabindex",
  addProseMirrorPlugins() {
    return [
      new Plugin({
        key: new PluginKey("tabindex"),
        props: {
          attributes: /* @__PURE__ */ __name(() => this.editor.isEditable ? { tabindex: "0" } : {}, "attributes")
        }
      })
    ];
  }
});
var index$1 = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  ClipboardTextSerializer,
  Commands,
  Drop,
  Editable,
  FocusEvents,
  Keymap,
  Paste,
  Tabindex
});
class NodePos {
  static {
    __name(this, "NodePos");
  }
  get name() {
    return this.node.type.name;
  }
  constructor(pos2, editor, isBlock = false, node3 = null) {
    this.currentNode = null;
    this.actualDepth = null;
    this.isBlock = isBlock;
    this.resolvedPos = pos2;
    this.editor = editor;
    this.currentNode = node3;
  }
  get node() {
    return this.currentNode || this.resolvedPos.node();
  }
  get element() {
    return this.editor.view.domAtPos(this.pos).node;
  }
  get depth() {
    var _a2;
    return (_a2 = this.actualDepth) !== null && _a2 !== void 0 ? _a2 : this.resolvedPos.depth;
  }
  get pos() {
    return this.resolvedPos.pos;
  }
  get content() {
    return this.node.content;
  }
  set content(content2) {
    let from2 = this.from;
    let to = this.to;
    if (this.isBlock) {
      if (this.content.size === 0) {
        console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
        return;
      }
      from2 = this.from + 1;
      to = this.to - 1;
    }
    this.editor.commands.insertContentAt({ from: from2, to }, content2);
  }
  get attributes() {
    return this.node.attrs;
  }
  get textContent() {
    return this.node.textContent;
  }
  get size() {
    return this.node.nodeSize;
  }
  get from() {
    if (this.isBlock) {
      return this.pos;
    }
    return this.resolvedPos.start(this.resolvedPos.depth);
  }
  get range() {
    return {
      from: this.from,
      to: this.to
    };
  }
  get to() {
    if (this.isBlock) {
      return this.pos + this.size;
    }
    return this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
  }
  get parent() {
    if (this.depth === 0) {
      return null;
    }
    const parentPos = this.resolvedPos.start(this.resolvedPos.depth - 1);
    const $pos = this.resolvedPos.doc.resolve(parentPos);
    return new NodePos($pos, this.editor);
  }
  get before() {
    let $pos = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
    if ($pos.depth !== this.depth) {
      $pos = this.resolvedPos.doc.resolve(this.from - 3);
    }
    return new NodePos($pos, this.editor);
  }
  get after() {
    let $pos = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
    if ($pos.depth !== this.depth) {
      $pos = this.resolvedPos.doc.resolve(this.to + 3);
    }
    return new NodePos($pos, this.editor);
  }
  get children() {
    const children = [];
    this.node.content.forEach((node3, offset) => {
      const isBlock = node3.isBlock && !node3.isTextblock;
      const isNonTextAtom = node3.isAtom && !node3.isText;
      const targetPos = this.pos + offset + (isNonTextAtom ? 0 : 1);
      const $pos = this.resolvedPos.doc.resolve(targetPos);
      if (!isBlock && $pos.depth <= this.depth) {
        return;
      }
      const childNodePos = new NodePos($pos, this.editor, isBlock, isBlock ? node3 : null);
      if (isBlock) {
        childNodePos.actualDepth = this.depth + 1;
      }
      children.push(new NodePos($pos, this.editor, isBlock, isBlock ? node3 : null));
    });
    return children;
  }
  get firstChild() {
    return this.children[0] || null;
  }
  get lastChild() {
    const children = this.children;
    return children[children.length - 1] || null;
  }
  closest(selector, attributes = {}) {
    let node3 = null;
    let currentNode = this.parent;
    while (currentNode && !node3) {
      if (currentNode.node.type.name === selector) {
        if (Object.keys(attributes).length > 0) {
          const nodeAttributes = currentNode.node.attrs;
          const attrKeys = Object.keys(attributes);
          for (let index2 = 0; index2 < attrKeys.length; index2 += 1) {
            const key = attrKeys[index2];
            if (nodeAttributes[key] !== attributes[key]) {
              break;
            }
          }
        } else {
          node3 = currentNode;
        }
      }
      currentNode = currentNode.parent;
    }
    return node3;
  }
  querySelector(selector, attributes = {}) {
    return this.querySelectorAll(selector, attributes, true)[0] || null;
  }
  querySelectorAll(selector, attributes = {}, firstItemOnly = false) {
    let nodes = [];
    if (!this.children || this.children.length === 0) {
      return nodes;
    }
    const attrKeys = Object.keys(attributes);
    this.children.forEach((childPos) => {
      if (firstItemOnly && nodes.length > 0) {
        return;
      }
      if (childPos.node.type.name === selector) {
        const doesAllAttributesMatch = attrKeys.every((key) => attributes[key] === childPos.node.attrs[key]);
        if (doesAllAttributesMatch) {
          nodes.push(childPos);
        }
      }
      if (firstItemOnly && nodes.length > 0) {
        return;
      }
      nodes = nodes.concat(childPos.querySelectorAll(selector, attributes, firstItemOnly));
    });
    return nodes;
  }
  setAttribute(attributes) {
    const { tr: tr2 } = this.editor.state;
    tr2.setNodeMarkup(this.from, void 0, {
      ...this.node.attrs,
      ...attributes
    });
    this.editor.view.dispatch(tr2);
  }
}
const style = `.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}

.tippy-box[data-animation=fade][data-state=hidden] {
  opacity: 0
}`;
function createStyleTag(style2, nonce, suffix2) {
  const tiptapStyleTag = document.querySelector(`style[data-tiptap-style${suffix2 ? `-${suffix2}` : ""}]`);
  if (tiptapStyleTag !== null) {
    return tiptapStyleTag;
  }
  const styleNode = document.createElement("style");
  if (nonce) {
    styleNode.setAttribute("nonce", nonce);
  }
  styleNode.setAttribute(`data-tiptap-style${suffix2 ? `-${suffix2}` : ""}`, "");
  styleNode.innerHTML = style2;
  document.getElementsByTagName("head")[0].appendChild(styleNode);
  return styleNode;
}
__name(createStyleTag, "createStyleTag");
class Editor extends EventEmitter {
  static {
    __name(this, "Editor");
  }
  constructor(options4 = {}) {
    super();
    this.isFocused = false;
    this.isInitialized = false;
    this.extensionStorage = {};
    this.options = {
      element: document.createElement("div"),
      content: "",
      injectCSS: true,
      injectNonce: void 0,
      extensions: [],
      autofocus: false,
      editable: true,
      editorProps: {},
      parseOptions: {},
      coreExtensionOptions: {},
      enableInputRules: true,
      enablePasteRules: true,
      enableCoreExtensions: true,
      enableContentCheck: false,
      onBeforeCreate: /* @__PURE__ */ __name(() => null, "onBeforeCreate"),
      onCreate: /* @__PURE__ */ __name(() => null, "onCreate"),
      onUpdate: /* @__PURE__ */ __name(() => null, "onUpdate"),
      onSelectionUpdate: /* @__PURE__ */ __name(() => null, "onSelectionUpdate"),
      onTransaction: /* @__PURE__ */ __name(() => null, "onTransaction"),
      onFocus: /* @__PURE__ */ __name(() => null, "onFocus"),
      onBlur: /* @__PURE__ */ __name(() => null, "onBlur"),
      onDestroy: /* @__PURE__ */ __name(() => null, "onDestroy"),
      onContentError: /* @__PURE__ */ __name(({ error: error2 }) => {
        throw error2;
      }, "onContentError"),
      onPaste: /* @__PURE__ */ __name(() => null, "onPaste"),
      onDrop: /* @__PURE__ */ __name(() => null, "onDrop")
    };
    this.isCapturingTransaction = false;
    this.capturedTransaction = null;
    this.setOptions(options4);
    this.createExtensionManager();
    this.createCommandManager();
    this.createSchema();
    this.on("beforeCreate", this.options.onBeforeCreate);
    this.emit("beforeCreate", { editor: this });
    this.on("contentError", this.options.onContentError);
    this.createView();
    this.injectCSS();
    this.on("create", this.options.onCreate);
    this.on("update", this.options.onUpdate);
    this.on("selectionUpdate", this.options.onSelectionUpdate);
    this.on("transaction", this.options.onTransaction);
    this.on("focus", this.options.onFocus);
    this.on("blur", this.options.onBlur);
    this.on("destroy", this.options.onDestroy);
    this.on("drop", ({ event, slice: slice2, moved }) => this.options.onDrop(event, slice2, moved));
    this.on("paste", ({ event, slice: slice2 }) => this.options.onPaste(event, slice2));
    window.setTimeout(() => {
      if (this.isDestroyed) {
        return;
      }
      this.commands.focus(this.options.autofocus);
      this.emit("create", { editor: this });
      this.isInitialized = true;
    }, 0);
  }
  /**
   * Returns the editor storage.
   */
  get storage() {
    return this.extensionStorage;
  }
  /**
   * An object of all registered commands.
   */
  get commands() {
    return this.commandManager.commands;
  }
  /**
   * Create a command chain to call multiple commands at once.
   */
  chain() {
    return this.commandManager.chain();
  }
  /**
   * Check if a command or a command chain can be executed. Without executing it.
   */
  can() {
    return this.commandManager.can();
  }
  /**
   * Inject CSS styles.
   */
  injectCSS() {
    if (this.options.injectCSS && document) {
      this.css = createStyleTag(style, this.options.injectNonce);
    }
  }
  /**
   * Update editor options.
   *
   * @param options A list of options
   */
  setOptions(options4 = {}) {
    this.options = {
      ...this.options,
      ...options4
    };
    if (!this.view || !this.state || this.isDestroyed) {
      return;
    }
    if (this.options.editorProps) {
      this.view.setProps(this.options.editorProps);
    }
    this.view.updateState(this.state);
  }
  /**
   * Update editable state of the editor.
   */
  setEditable(editable, emitUpdate = true) {
    this.setOptions({ editable });
    if (emitUpdate) {
      this.emit("update", { editor: this, transaction: this.state.tr });
    }
  }
  /**
   * Returns whether the editor is editable.
   */
  get isEditable() {
    return this.options.editable && this.view && this.view.editable;
  }
  /**
   * Returns the editor state.
   */
  get state() {
    return this.view.state;
  }
  /**
   * Register a ProseMirror plugin.
   *
   * @param plugin A ProseMirror plugin
   * @param handlePlugins Control how to merge the plugin into the existing plugins.
   * @returns The new editor state
   */
  registerPlugin(plugin, handlePlugins) {
    const plugins = isFunction$1(handlePlugins) ? handlePlugins(plugin, [...this.state.plugins]) : [...this.state.plugins, plugin];
    const state = this.state.reconfigure({ plugins });
    this.view.updateState(state);
    return state;
  }
  /**
   * Unregister a ProseMirror plugin.
   *
   * @param nameOrPluginKeyToRemove The plugins name
   * @returns The new editor state or undefined if the editor is destroyed
   */
  unregisterPlugin(nameOrPluginKeyToRemove) {
    if (this.isDestroyed) {
      return void 0;
    }
    const prevPlugins = this.state.plugins;
    let plugins = prevPlugins;
    [].concat(nameOrPluginKeyToRemove).forEach((nameOrPluginKey) => {
      const name2 = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
      plugins = prevPlugins.filter((plugin) => !plugin.key.startsWith(name2));
    });
    if (prevPlugins.length === plugins.length) {
      return void 0;
    }
    const state = this.state.reconfigure({
      plugins
    });
    this.view.updateState(state);
    return state;
  }
  /**
   * Creates an extension manager.
   */
  createExtensionManager() {
    var _a2, _b;
    const coreExtensions = this.options.enableCoreExtensions ? [
      Editable,
      ClipboardTextSerializer.configure({
        blockSeparator: (_b = (_a2 = this.options.coreExtensionOptions) === null || _a2 === void 0 ? void 0 : _a2.clipboardTextSerializer) === null || _b === void 0 ? void 0 : _b.blockSeparator
      }),
      Commands,
      FocusEvents,
      Keymap,
      Tabindex,
      Drop,
      Paste
    ].filter((ext) => {
      if (typeof this.options.enableCoreExtensions === "object") {
        return this.options.enableCoreExtensions[ext.name] !== false;
      }
      return true;
    }) : [];
    const allExtensions = [...coreExtensions, ...this.options.extensions].filter((extension) => {
      return ["extension", "node", "mark"].includes(extension === null || extension === void 0 ? void 0 : extension.type);
    });
    this.extensionManager = new ExtensionManager(allExtensions, this);
  }
  /**
   * Creates an command manager.
   */
  createCommandManager() {
    this.commandManager = new CommandManager({
      editor: this
    });
  }
  /**
   * Creates a ProseMirror schema.
   */
  createSchema() {
    this.schema = this.extensionManager.schema;
  }
  /**
   * Creates a ProseMirror view.
   */
  createView() {
    var _a2;
    let doc2;
    try {
      doc2 = createDocument(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
    } catch (e2) {
      if (!(e2 instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(e2.message)) {
        throw e2;
      }
      this.emit("contentError", {
        editor: this,
        error: e2,
        disableCollaboration: /* @__PURE__ */ __name(() => {
          if (this.storage.collaboration) {
            this.storage.collaboration.isDisabled = true;
          }
          this.options.extensions = this.options.extensions.filter((extension) => extension.name !== "collaboration");
          this.createExtensionManager();
        }, "disableCollaboration")
      });
      doc2 = createDocument(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: false });
    }
    const selection = resolveFocusPosition(doc2, this.options.autofocus);
    this.view = new EditorView(this.options.element, {
      ...this.options.editorProps,
      attributes: {
        // add `role="textbox"` to the editor element
        role: "textbox",
        ...(_a2 = this.options.editorProps) === null || _a2 === void 0 ? void 0 : _a2.attributes
      },
      dispatchTransaction: this.dispatchTransaction.bind(this),
      state: EditorState.create({
        doc: doc2,
        selection: selection || void 0
      })
    });
    const newState = this.state.reconfigure({
      plugins: this.extensionManager.plugins
    });
    this.view.updateState(newState);
    this.createNodeViews();
    this.prependClass();
    const dom = this.view.dom;
    dom.editor = this;
  }
  /**
   * Creates all node views.
   */
  createNodeViews() {
    if (this.view.isDestroyed) {
      return;
    }
    this.view.setProps({
      nodeViews: this.extensionManager.nodeViews
    });
  }
  /**
   * Prepend class name to element.
   */
  prependClass() {
    this.view.dom.className = `tiptap ${this.view.dom.className}`;
  }
  captureTransaction(fn) {
    this.isCapturingTransaction = true;
    fn();
    this.isCapturingTransaction = false;
    const tr2 = this.capturedTransaction;
    this.capturedTransaction = null;
    return tr2;
  }
  /**
   * The callback over which to send transactions (state updates) produced by the view.
   *
   * @param transaction An editor state transaction
   */
  dispatchTransaction(transaction) {
    if (this.view.isDestroyed) {
      return;
    }
    if (this.isCapturingTransaction) {
      if (!this.capturedTransaction) {
        this.capturedTransaction = transaction;
        return;
      }
      transaction.steps.forEach((step3) => {
        var _a2;
        return (_a2 = this.capturedTransaction) === null || _a2 === void 0 ? void 0 : _a2.step(step3);
      });
      return;
    }
    const state = this.state.apply(transaction);
    const selectionHasChanged = !this.state.selection.eq(state.selection);
    this.emit("beforeTransaction", {
      editor: this,
      transaction,
      nextState: state
    });
    this.view.updateState(state);
    this.emit("transaction", {
      editor: this,
      transaction
    });
    if (selectionHasChanged) {
      this.emit("selectionUpdate", {
        editor: this,
        transaction
      });
    }
    const focus5 = transaction.getMeta("focus");
    const blur2 = transaction.getMeta("blur");
    if (focus5) {
      this.emit("focus", {
        editor: this,
        event: focus5.event,
        transaction
      });
    }
    if (blur2) {
      this.emit("blur", {
        editor: this,
        event: blur2.event,
        transaction
      });
    }
    if (!transaction.docChanged || transaction.getMeta("preventUpdate")) {
      return;
    }
    this.emit("update", {
      editor: this,
      transaction
    });
  }
  /**
   * Get attributes of the currently selected node or mark.
   */
  getAttributes(nameOrType) {
    return getAttributes(this.state, nameOrType);
  }
  isActive(nameOrAttributes, attributesOrUndefined) {
    const name2 = typeof nameOrAttributes === "string" ? nameOrAttributes : null;
    const attributes = typeof nameOrAttributes === "string" ? attributesOrUndefined : nameOrAttributes;
    return isActive(this.state, name2, attributes);
  }
  /**
   * Get the document as JSON.
   */
  getJSON() {
    return this.state.doc.toJSON();
  }
  /**
   * Get the document as HTML.
   */
  getHTML() {
    return getHTMLFromFragment(this.state.doc.content, this.schema);
  }
  /**
   * Get the document as text.
   */
  getText(options4) {
    const { blockSeparator = "\n\n", textSerializers = {} } = options4 || {};
    return getText(this.state.doc, {
      blockSeparator,
      textSerializers: {
        ...getTextSerializersFromSchema(this.schema),
        ...textSerializers
      }
    });
  }
  /**
   * Check if there is no content.
   */
  get isEmpty() {
    return isNodeEmpty(this.state.doc);
  }
  /**
   * Get the number of characters for the current document.
   *
   * @deprecated
   */
  getCharacterCount() {
    console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.');
    return this.state.doc.content.size - 2;
  }
  /**
   * Destroy the editor.
   */
  destroy() {
    this.emit("destroy");
    if (this.view) {
      const dom = this.view.dom;
      if (dom && dom.editor) {
        delete dom.editor;
      }
      this.view.destroy();
    }
    this.removeAllListeners();
  }
  /**
   * Check if the editor is already destroyed.
   */
  get isDestroyed() {
    var _a2;
    return !((_a2 = this.view) === null || _a2 === void 0 ? void 0 : _a2.docView);
  }
  $node(selector, attributes) {
    var _a2;
    return ((_a2 = this.$doc) === null || _a2 === void 0 ? void 0 : _a2.querySelector(selector, attributes)) || null;
  }
  $nodes(selector, attributes) {
    var _a2;
    return ((_a2 = this.$doc) === null || _a2 === void 0 ? void 0 : _a2.querySelectorAll(selector, attributes)) || null;
  }
  $pos(pos2) {
    const $pos = this.state.doc.resolve(pos2);
    return new NodePos($pos, this);
  }
  get $doc() {
    return this.$pos(0);
  }
}
function markInputRule(config2) {
  return new InputRule({
    find: config2.find,
    handler: /* @__PURE__ */ __name(({ state, range: range2, match: match2 }) => {
      const attributes = callOrReturn(config2.getAttributes, void 0, match2);
      if (attributes === false || attributes === null) {
        return null;
      }
      const { tr: tr2 } = state;
      const captureGroup = match2[match2.length - 1];
      const fullMatch = match2[0];
      if (captureGroup) {
        const startSpaces = fullMatch.search(/\S/);
        const textStart = range2.from + fullMatch.indexOf(captureGroup);
        const textEnd = textStart + captureGroup.length;
        const excludedMarks = getMarksBetween(range2.from, range2.to, state.doc).filter((item3) => {
          const excluded = item3.mark.type.excluded;
          return excluded.find((type) => type === config2.type && type !== item3.mark.type);
        }).filter((item3) => item3.to > textStart);
        if (excludedMarks.length) {
          return null;
        }
        if (textEnd < range2.to) {
          tr2.delete(textEnd, range2.to);
        }
        if (textStart > range2.from) {
          tr2.delete(range2.from + startSpaces, textStart);
        }
        const markEnd = range2.from + startSpaces + captureGroup.length;
        tr2.addMark(range2.from + startSpaces, markEnd, config2.type.create(attributes || {}));
        tr2.removeStoredMark(config2.type);
      }
    }, "handler")
  });
}
__name(markInputRule, "markInputRule");
function nodeInputRule(config2) {
  return new InputRule({
    find: config2.find,
    handler: /* @__PURE__ */ __name(({ state, range: range2, match: match2 }) => {
      const attributes = callOrReturn(config2.getAttributes, void 0, match2) || {};
      const { tr: tr2 } = state;
      const start2 = range2.from;
      let end = range2.to;
      const newNode = config2.type.create(attributes);
      if (match2[1]) {
        const offset = match2[0].lastIndexOf(match2[1]);
        let matchStart = start2 + offset;
        if (matchStart > end) {
          matchStart = end;
        } else {
          end = matchStart + match2[1].length;
        }
        const lastChar = match2[0][match2[0].length - 1];
        tr2.insertText(lastChar, start2 + match2[0].length - 1);
        tr2.replaceWith(matchStart, end, newNode);
      } else if (match2[0]) {
        const insertionStart = config2.type.isInline ? start2 : start2 - 1;
        tr2.insert(insertionStart, config2.type.create(attributes)).delete(tr2.mapping.map(start2), tr2.mapping.map(end));
      }
      tr2.scrollIntoView();
    }, "handler")
  });
}
__name(nodeInputRule, "nodeInputRule");
function textblockTypeInputRule(config2) {
  return new InputRule({
    find: config2.find,
    handler: /* @__PURE__ */ __name(({ state, range: range2, match: match2 }) => {
      const $start = state.doc.resolve(range2.from);
      const attributes = callOrReturn(config2.getAttributes, void 0, match2) || {};
      if (!$start.node(-1).canReplaceWith($start.index(-1), $start.indexAfter(-1), config2.type)) {
        return null;
      }
      state.tr.delete(range2.from, range2.to).setBlockType(range2.from, range2.from, config2.type, attributes);
    }, "handler")
  });
}
__name(textblockTypeInputRule, "textblockTypeInputRule");
function textInputRule(config2) {
  return new InputRule({
    find: config2.find,
    handler: /* @__PURE__ */ __name(({ state, range: range2, match: match2 }) => {
      let insert2 = config2.replace;
      let start2 = range2.from;
      const end = range2.to;
      if (match2[1]) {
        const offset = match2[0].lastIndexOf(match2[1]);
        insert2 += match2[0].slice(offset + match2[1].length);
        start2 += offset;
        const cutOff = start2 - end;
        if (cutOff > 0) {
          insert2 = match2[0].slice(offset - cutOff, offset) + insert2;
          start2 = end;
        }
      }
      state.tr.insertText(insert2, start2, end);
    }, "handler")
  });
}
__name(textInputRule, "textInputRule");
function wrappingInputRule(config2) {
  return new InputRule({
    find: config2.find,
    handler: /* @__PURE__ */ __name(({ state, range: range2, match: match2, chain }) => {
      const attributes = callOrReturn(config2.getAttributes, void 0, match2) || {};
      const tr2 = state.tr.delete(range2.from, range2.to);
      const $start = tr2.doc.resolve(range2.from);
      const blockRange = $start.blockRange();
      const wrapping = blockRange && findWrapping(blockRange, config2.type, attributes);
      if (!wrapping) {
        return null;
      }
      tr2.wrap(blockRange, wrapping);
      if (config2.keepMarks && config2.editor) {
        const { selection, storedMarks } = state;
        const { splittableMarks } = config2.editor.extensionManager;
        const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
        if (marks) {
          const filteredMarks = marks.filter((mark2) => splittableMarks.includes(mark2.type.name));
          tr2.ensureMarks(filteredMarks);
        }
      }
      if (config2.keepAttributes) {
        const nodeType = config2.type.name === "bulletList" || config2.type.name === "orderedList" ? "listItem" : "taskList";
        chain().updateAttributes(nodeType, attributes).run();
      }
      const before = tr2.doc.resolve(range2.from - 1).nodeBefore;
      if (before && before.type === config2.type && canJoin(tr2.doc, range2.from - 1) && (!config2.joinPredicate || config2.joinPredicate(match2, before))) {
        tr2.join(range2.from - 1);
      }
    }, "handler")
  });
}
__name(wrappingInputRule, "wrappingInputRule");
let Node$1 = class Node3 {
  static {
    __name(this, "Node");
  }
  constructor(config2 = {}) {
    this.type = "node";
    this.name = "node";
    this.parent = null;
    this.child = null;
    this.config = {
      name: this.name,
      defaultOptions: {}
    };
    this.config = {
      ...this.config,
      ...config2
    };
    this.name = this.config.name;
    if (config2.defaultOptions && Object.keys(config2.defaultOptions).length > 0) {
      console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`);
    }
    this.options = this.config.defaultOptions;
    if (this.config.addOptions) {
      this.options = callOrReturn(getExtensionField(this, "addOptions", {
        name: this.name
      }));
    }
    this.storage = callOrReturn(getExtensionField(this, "addStorage", {
      name: this.name,
      options: this.options
    })) || {};
  }
  static create(config2 = {}) {
    return new Node3(config2);
  }
  configure(options4 = {}) {
    const extension = this.extend({
      ...this.config,
      addOptions: /* @__PURE__ */ __name(() => {
        return mergeDeep(this.options, options4);
      }, "addOptions")
    });
    extension.name = this.name;
    extension.parent = this.parent;
    return extension;
  }
  extend(extendedConfig = {}) {
    const extension = new Node3(extendedConfig);
    extension.parent = this;
    this.child = extension;
    extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
    if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
      console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
    }
    extension.options = callOrReturn(getExtensionField(extension, "addOptions", {
      name: extension.name
    }));
    extension.storage = callOrReturn(getExtensionField(extension, "addStorage", {
      name: extension.name,
      options: extension.options
    }));
    return extension;
  }
};
function isAndroid$1() {
  return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
}
__name(isAndroid$1, "isAndroid$1");
class NodeView {
  static {
    __name(this, "NodeView");
  }
  constructor(component, props, options4) {
    this.isDragging = false;
    this.component = component;
    this.editor = props.editor;
    this.options = {
      stopEvent: null,
      ignoreMutation: null,
      ...options4
    };
    this.extension = props.extension;
    this.node = props.node;
    this.decorations = props.decorations;
    this.innerDecorations = props.innerDecorations;
    this.view = props.view;
    this.HTMLAttributes = props.HTMLAttributes;
    this.getPos = props.getPos;
    this.mount();
  }
  mount() {
    return;
  }
  get dom() {
    return this.editor.view.dom;
  }
  get contentDOM() {
    return null;
  }
  onDragStart(event) {
    var _a2, _b, _c, _d, _e, _f, _g;
    const { view } = this.editor;
    const target = event.target;
    const dragHandle = target.nodeType === 3 ? (_a2 = target.parentElement) === null || _a2 === void 0 ? void 0 : _a2.closest("[data-drag-handle]") : target.closest("[data-drag-handle]");
    if (!this.dom || ((_b = this.contentDOM) === null || _b === void 0 ? void 0 : _b.contains(target)) || !dragHandle) {
      return;
    }
    let x2 = 0;
    let y2 = 0;
    if (this.dom !== dragHandle) {
      const domBox = this.dom.getBoundingClientRect();
      const handleBox = dragHandle.getBoundingClientRect();
      const offsetX = (_c = event.offsetX) !== null && _c !== void 0 ? _c : (_d = event.nativeEvent) === null || _d === void 0 ? void 0 : _d.offsetX;
      const offsetY = (_e = event.offsetY) !== null && _e !== void 0 ? _e : (_f = event.nativeEvent) === null || _f === void 0 ? void 0 : _f.offsetY;
      x2 = handleBox.x - domBox.x + offsetX;
      y2 = handleBox.y - domBox.y + offsetY;
    }
    (_g = event.dataTransfer) === null || _g === void 0 ? void 0 : _g.setDragImage(this.dom, x2, y2);
    const pos2 = this.getPos();
    if (typeof pos2 !== "number") {
      return;
    }
    const selection = NodeSelection.create(view.state.doc, pos2);
    const transaction = view.state.tr.setSelection(selection);
    view.dispatch(transaction);
  }
  stopEvent(event) {
    var _a2;
    if (!this.dom) {
      return false;
    }
    if (typeof this.options.stopEvent === "function") {
      return this.options.stopEvent({ event });
    }
    const target = event.target;
    const isInElement = this.dom.contains(target) && !((_a2 = this.contentDOM) === null || _a2 === void 0 ? void 0 : _a2.contains(target));
    if (!isInElement) {
      return false;
    }
    const isDragEvent = event.type.startsWith("drag");
    const isDropEvent = event.type === "drop";
    const isInput = ["INPUT", "BUTTON", "SELECT", "TEXTAREA"].includes(target.tagName) || target.isContentEditable;
    if (isInput && !isDropEvent && !isDragEvent) {
      return true;
    }
    const { isEditable } = this.editor;
    const { isDragging } = this;
    const isDraggable = !!this.node.type.spec.draggable;
    const isSelectable = NodeSelection.isSelectable(this.node);
    const isCopyEvent = event.type === "copy";
    const isPasteEvent = event.type === "paste";
    const isCutEvent = event.type === "cut";
    const isClickEvent = event.type === "mousedown";
    if (!isDraggable && isSelectable && isDragEvent) {
      event.preventDefault();
    }
    if (isDraggable && isDragEvent && !isDragging) {
      event.preventDefault();
      return false;
    }
    if (isDraggable && isEditable && !isDragging && isClickEvent) {
      const dragHandle = target.closest("[data-drag-handle]");
      const isValidDragHandle = dragHandle && (this.dom === dragHandle || this.dom.contains(dragHandle));
      if (isValidDragHandle) {
        this.isDragging = true;
        document.addEventListener("dragend", () => {
          this.isDragging = false;
        }, { once: true });
        document.addEventListener("drop", () => {
          this.isDragging = false;
        }, { once: true });
        document.addEventListener("mouseup", () => {
          this.isDragging = false;
        }, { once: true });
      }
    }
    if (isDragging || isDropEvent || isCopyEvent || isPasteEvent || isCutEvent || isClickEvent && isSelectable) {
      return false;
    }
    return true;
  }
  /**
   * Called when a DOM [mutation](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) or a selection change happens within the view.
   * @return `false` if the editor should re-read the selection or re-parse the range around the mutation
   * @return `true` if it can safely be ignored.
   */
  ignoreMutation(mutation) {
    if (!this.dom || !this.contentDOM) {
      return true;
    }
    if (typeof this.options.ignoreMutation === "function") {
      return this.options.ignoreMutation({ mutation });
    }
    if (this.node.isLeaf || this.node.isAtom) {
      return true;
    }
    if (mutation.type === "selection") {
      return false;
    }
    if (this.dom.contains(mutation.target) && mutation.type === "childList" && (isiOS() || isAndroid$1()) && this.editor.isFocused) {
      const changedNodes = [
        ...Array.from(mutation.addedNodes),
        ...Array.from(mutation.removedNodes)
      ];
      if (changedNodes.every((node3) => node3.isContentEditable)) {
        return false;
      }
    }
    if (this.contentDOM === mutation.target && mutation.type === "attributes") {
      return true;
    }
    if (this.contentDOM.contains(mutation.target)) {
      return false;
    }
    return true;
  }
  /**
   * Update the attributes of the prosemirror node.
   */
  updateAttributes(attributes) {
    this.editor.commands.command(({ tr: tr2 }) => {
      const pos2 = this.getPos();
      if (typeof pos2 !== "number") {
        return false;
      }
      tr2.setNodeMarkup(pos2, void 0, {
        ...this.node.attrs,
        ...attributes
      });
      return true;
    });
  }
  /**
   * Delete the node.
   */
  deleteNode() {
    const from2 = this.getPos();
    if (typeof from2 !== "number") {
      return;
    }
    const to = from2 + this.node.nodeSize;
    this.editor.commands.deleteRange({ from: from2, to });
  }
}
function markPasteRule(config2) {
  return new PasteRule({
    find: config2.find,
    handler: /* @__PURE__ */ __name(({ state, range: range2, match: match2, pasteEvent }) => {
      const attributes = callOrReturn(config2.getAttributes, void 0, match2, pasteEvent);
      if (attributes === false || attributes === null) {
        return null;
      }
      const { tr: tr2 } = state;
      const captureGroup = match2[match2.length - 1];
      const fullMatch = match2[0];
      let markEnd = range2.to;
      if (captureGroup) {
        const startSpaces = fullMatch.search(/\S/);
        const textStart = range2.from + fullMatch.indexOf(captureGroup);
        const textEnd = textStart + captureGroup.length;
        const excludedMarks = getMarksBetween(range2.from, range2.to, state.doc).filter((item3) => {
          const excluded = item3.mark.type.excluded;
          return excluded.find((type) => type === config2.type && type !== item3.mark.type);
        }).filter((item3) => item3.to > textStart);
        if (excludedMarks.length) {
          return null;
        }
        if (textEnd < range2.to) {
          tr2.delete(textEnd, range2.to);
        }
        if (textStart > range2.from) {
          tr2.delete(range2.from + startSpaces, textStart);
        }
        markEnd = range2.from + startSpaces + captureGroup.length;
        tr2.addMark(range2.from + startSpaces, markEnd, config2.type.create(attributes || {}));
        tr2.removeStoredMark(config2.type);
      }
    }, "handler")
  });
}
__name(markPasteRule, "markPasteRule");
function escapeForRegEx(string) {
  return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
}
__name(escapeForRegEx, "escapeForRegEx");
function isString$3(value4) {
  return typeof value4 === "string";
}
__name(isString$3, "isString$3");
function nodePasteRule(config2) {
  return new PasteRule({
    find: config2.find,
    handler({ match: match2, chain, range: range2, pasteEvent }) {
      const attributes = callOrReturn(config2.getAttributes, void 0, match2, pasteEvent);
      const content2 = callOrReturn(config2.getContent, void 0, attributes);
      if (attributes === false || attributes === null) {
        return null;
      }
      const node3 = { type: config2.type.name, attrs: attributes };
      if (content2) {
        node3.content = content2;
      }
      if (match2.input) {
        chain().deleteRange(range2).insertContentAt(range2.from, node3);
      }
    }
  });
}
__name(nodePasteRule, "nodePasteRule");
function textPasteRule(config2) {
  return new PasteRule({
    find: config2.find,
    handler: /* @__PURE__ */ __name(({ state, range: range2, match: match2 }) => {
      let insert2 = config2.replace;
      let start2 = range2.from;
      const end = range2.to;
      if (match2[1]) {
        const offset = match2[0].lastIndexOf(match2[1]);
        insert2 += match2[0].slice(offset + match2[1].length);
        start2 += offset;
        const cutOff = start2 - end;
        if (cutOff > 0) {
          insert2 = match2[0].slice(offset - cutOff, offset) + insert2;
          start2 = end;
        }
      }
      state.tr.insertText(insert2, start2, end);
    }, "handler")
  });
}
__name(textPasteRule, "textPasteRule");
class Tracker {
  static {
    __name(this, "Tracker");
  }
  constructor(transaction) {
    this.transaction = transaction;
    this.currentStep = this.transaction.steps.length;
  }
  map(position3) {
    let deleted = false;
    const mappedPosition = this.transaction.steps.slice(this.currentStep).reduce((newPosition, step3) => {
      const mapResult = step3.getMap().mapResult(newPosition);
      if (mapResult.deleted) {
        deleted = true;
      }
      return mapResult.pos;
    }, position3);
    return {
      position: mappedPosition,
      deleted
    };
  }
}
const encodedTlds = "[encoded data, 4538 characters]ögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2";
const encodedUtlds = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2";
const assign$2 = /* @__PURE__ */ __name((target, properties) => {
  for (const key in properties) {
    target[key] = properties[key];
  }
  return target;
}, "assign$2");
const numeric = "numeric";
const ascii = "ascii";
const alpha = "alpha";
const asciinumeric = "asciinumeric";
const alphanumeric = "alphanumeric";
const domain = "domain";
const emoji = "emoji";
const scheme = "scheme";
const slashscheme = "slashscheme";
const whitespace = "whitespace";
function registerGroup(name2, groups) {
  if (!(name2 in groups)) {
    groups[name2] = [];
  }
  return groups[name2];
}
__name(registerGroup, "registerGroup");
function addToGroups(t2, flags, groups) {
  if (flags[numeric]) {
    flags[asciinumeric] = true;
    flags[alphanumeric] = true;
  }
  if (flags[ascii]) {
    flags[asciinumeric] = true;
    flags[alpha] = true;
  }
  if (flags[asciinumeric]) {
    flags[alphanumeric] = true;
  }
  if (flags[alpha]) {
    flags[alphanumeric] = true;
  }
  if (flags[alphanumeric]) {
    flags[domain] = true;
  }
  if (flags[emoji]) {
    flags[domain] = true;
  }
  for (const k in flags) {
    const group = registerGroup(k, groups);
    if (group.indexOf(t2) < 0) {
      group.push(t2);
    }
  }
}
__name(addToGroups, "addToGroups");
function flagsForToken(t2, groups) {
  const result = {};
  for (const c in groups) {
    if (groups[c].indexOf(t2) >= 0) {
      result[c] = true;
    }
  }
  return result;
}
__name(flagsForToken, "flagsForToken");
function State(token = null) {
  this.j = {};
  this.jr = [];
  this.jd = null;
  this.t = token;
}
__name(State, "State");
State.groups = {};
State.prototype = {
  accepts() {
    return !!this.t;
  },
  /**
   * Follow an existing transition from the given input to the next state.
   * Does not mutate.
   * @param {string} input character or token type to transition on
   * @returns {?State<T>} the next state, if any
   */
  go(input) {
    const state = this;
    const nextState = state.j[input];
    if (nextState) {
      return nextState;
    }
    for (let i2 = 0; i2 < state.jr.length; i2++) {
      const regex2 = state.jr[i2][0];
      const nextState2 = state.jr[i2][1];
      if (nextState2 && regex2.test(input)) {
        return nextState2;
      }
    }
    return state.jd;
  },
  /**
   * Whether the state has a transition for the given input. Set the second
   * argument to true to only look for an exact match (and not a default or
   * regular-expression-based transition)
   * @param {string} input
   * @param {boolean} exactOnly
   */
  has(input, exactOnly = false) {
    return exactOnly ? input in this.j : !!this.go(input);
  },
  /**
   * Short for "transition all"; create a transition from the array of items
   * in the given list to the same final resulting state.
   * @param {string | string[]} inputs Group of inputs to transition on
   * @param {Transition<T> | State<T>} [next] Transition options
   * @param {Flags} [flags] Collections flags to add token to
   * @param {Collections<T>} [groups] Master list of token groups
   */
  ta(inputs, next2, flags, groups) {
    for (let i2 = 0; i2 < inputs.length; i2++) {
      this.tt(inputs[i2], next2, flags, groups);
    }
  },
  /**
   * Short for "take regexp transition"; defines a transition for this state
   * when it encounters a token which matches the given regular expression
   * @param {RegExp} regexp Regular expression transition (populate first)
   * @param {T | State<T>} [next] Transition options
   * @param {Flags} [flags] Collections flags to add token to
   * @param {Collections<T>} [groups] Master list of token groups
   * @returns {State<T>} taken after the given input
   */
  tr(regexp2, next2, flags, groups) {
    groups = groups || State.groups;
    let nextState;
    if (next2 && next2.j) {
      nextState = next2;
    } else {
      nextState = new State(next2);
      if (flags && groups) {
        addToGroups(next2, flags, groups);
      }
    }
    this.jr.push([regexp2, nextState]);
    return nextState;
  },
  /**
   * Short for "take transitions", will take as many sequential transitions as
   * the length of the given input and returns the
   * resulting final state.
   * @param {string | string[]} input
   * @param {T | State<T>} [next] Transition options
   * @param {Flags} [flags] Collections flags to add token to
   * @param {Collections<T>} [groups] Master list of token groups
   * @returns {State<T>} taken after the given input
   */
  ts(input, next2, flags, groups) {
    let state = this;
    const len = input.length;
    if (!len) {
      return state;
    }
    for (let i2 = 0; i2 < len - 1; i2++) {
      state = state.tt(input[i2]);
    }
    return state.tt(input[len - 1], next2, flags, groups);
  },
  /**
   * Short for "take transition", this is a method for building/working with
   * state machines.
   *
   * If a state already exists for the given input, returns it.
   *
   * If a token is specified, that state will emit that token when reached by
   * the linkify engine.
   *
   * If no state exists, it will be initialized with some default transitions
   * that resemble existing default transitions.
   *
   * If a state is given for the second argument, that state will be
   * transitioned to on the given input regardless of what that input
   * previously did.
   *
   * Specify a token group flags to define groups that this token belongs to.
   * The token will be added to corresponding entires in the given groups
   * object.
   *
   * @param {string} input character, token type to transition on
   * @param {T | State<T>} [next] Transition options
   * @param {Flags} [flags] Collections flags to add token to
   * @param {Collections<T>} [groups] Master list of groups
   * @returns {State<T>} taken after the given input
   */
  tt(input, next2, flags, groups) {
    groups = groups || State.groups;
    const state = this;
    if (next2 && next2.j) {
      state.j[input] = next2;
      return next2;
    }
    const t2 = next2;
    let nextState, templateState = state.go(input);
    if (templateState) {
      nextState = new State();
      assign$2(nextState.j, templateState.j);
      nextState.jr.push.apply(nextState.jr, templateState.jr);
      nextState.jd = templateState.jd;
      nextState.t = templateState.t;
    } else {
      nextState = new State();
    }
    if (t2) {
      if (groups) {
        if (nextState.t && typeof nextState.t === "string") {
          const allFlags = assign$2(flagsForToken(nextState.t, groups), flags);
          addToGroups(t2, allFlags, groups);
        } else if (flags) {
          addToGroups(t2, flags, groups);
        }
      }
      nextState.t = t2;
    }
    state.j[input] = nextState;
    return nextState;
  }
};
const ta = /* @__PURE__ */ __name((state, input, next2, flags, groups) => state.ta(input, next2, flags, groups), "ta");
const tr = /* @__PURE__ */ __name((state, regexp2, next2, flags, groups) => state.tr(regexp2, next2, flags, groups), "tr");
const ts = /* @__PURE__ */ __name((state, input, next2, flags, groups) => state.ts(input, next2, flags, groups), "ts");
const tt = /* @__PURE__ */ __name((state, input, next2, flags, groups) => state.tt(input, next2, flags, groups), "tt");
const WORD = "WORD";
const UWORD = "UWORD";
const ASCIINUMERICAL = "ASCIINUMERICAL";
const ALPHANUMERICAL = "ALPHANUMERICAL";
const LOCALHOST = "LOCALHOST";
const TLD = "TLD";
const UTLD = "UTLD";
const SCHEME = "SCHEME";
const SLASH_SCHEME = "SLASH_SCHEME";
const NUM = "NUM";
const WS = "WS";
const NL = "NL";
const OPENBRACE = "OPENBRACE";
const CLOSEBRACE = "CLOSEBRACE";
const OPENBRACKET = "OPENBRACKET";
const CLOSEBRACKET = "CLOSEBRACKET";
const OPENPAREN = "OPENPAREN";
const CLOSEPAREN = "CLOSEPAREN";
const OPENANGLEBRACKET = "OPENANGLEBRACKET";
const CLOSEANGLEBRACKET = "CLOSEANGLEBRACKET";
const FULLWIDTHLEFTPAREN = "FULLWIDTHLEFTPAREN";
const FULLWIDTHRIGHTPAREN = "FULLWIDTHRIGHTPAREN";
const LEFTCORNERBRACKET = "LEFTCORNERBRACKET";
const RIGHTCORNERBRACKET = "RIGHTCORNERBRACKET";
const LEFTWHITECORNERBRACKET = "LEFTWHITECORNERBRACKET";
const RIGHTWHITECORNERBRACKET = "RIGHTWHITECORNERBRACKET";
const FULLWIDTHLESSTHAN = "FULLWIDTHLESSTHAN";
const FULLWIDTHGREATERTHAN = "FULLWIDTHGREATERTHAN";
const AMPERSAND = "AMPERSAND";
const APOSTROPHE$1 = "APOSTROPHE";
const ASTERISK = "ASTERISK";
const AT = "AT";
const BACKSLASH = "BACKSLASH";
const BACKTICK = "BACKTICK";
const CARET = "CARET";
const COLON = "COLON";
const COMMA = "COMMA";
const DOLLAR = "DOLLAR";
const DOT = "DOT";
const EQUALS = "EQUALS";
const EXCLAMATION = "EXCLAMATION";
const HYPHEN = "HYPHEN";
const PERCENT = "PERCENT";
const PIPE = "PIPE";
const PLUS = "PLUS";
const POUND = "POUND";
const QUERY = "QUERY";
const QUOTE = "QUOTE";
const FULLWIDTHMIDDLEDOT = "FULLWIDTHMIDDLEDOT";
const SEMI = "SEMI";
const SLASH = "SLASH";
const TILDE = "TILDE";
const UNDERSCORE = "UNDERSCORE";
const EMOJI$1 = "EMOJI";
const SYM = "SYM";
var tk = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  WORD,
  UWORD,
  ASCIINUMERICAL,
  ALPHANUMERICAL,
  LOCALHOST,
  TLD,
  UTLD,
  SCHEME,
  SLASH_SCHEME,
  NUM,
  WS,
  NL,
  OPENBRACE,
  CLOSEBRACE,
  OPENBRACKET,
  CLOSEBRACKET,
  OPENPAREN,
  CLOSEPAREN,
  OPENANGLEBRACKET,
  CLOSEANGLEBRACKET,
  FULLWIDTHLEFTPAREN,
  FULLWIDTHRIGHTPAREN,
  LEFTCORNERBRACKET,
  RIGHTCORNERBRACKET,
  LEFTWHITECORNERBRACKET,
  RIGHTWHITECORNERBRACKET,
  FULLWIDTHLESSTHAN,
  FULLWIDTHGREATERTHAN,
  AMPERSAND,
  APOSTROPHE: APOSTROPHE$1,
  ASTERISK,
  AT,
  BACKSLASH,
  BACKTICK,
  CARET,
  COLON,
  COMMA,
  DOLLAR,
  DOT,
  EQUALS,
  EXCLAMATION,
  HYPHEN,
  PERCENT,
  PIPE,
  PLUS,
  POUND,
  QUERY,
  QUOTE,
  FULLWIDTHMIDDLEDOT,
  SEMI,
  SLASH,
  TILDE,
  UNDERSCORE,
  EMOJI: EMOJI$1,
  SYM
});
const ASCII_LETTER = /[a-z]/;
const LETTER = /\p{L}/u;
const EMOJI = /\p{Emoji}/u;
const EMOJI_VARIATION$1 = /\ufe0f/;
const DIGIT = /\d/;
const SPACE$1 = /\s/;
var regexp = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  ASCII_LETTER,
  LETTER,
  EMOJI,
  EMOJI_VARIATION: EMOJI_VARIATION$1,
  DIGIT,
  SPACE: SPACE$1
});
const CR = "\r";
const LF = "\n";
const EMOJI_VARIATION = "️";
const EMOJI_JOINER = "‍";
const OBJECT_REPLACEMENT = "￼";
let tlds = null, utlds = null;
function init$2(customSchemes = []) {
  const groups = {};
  State.groups = groups;
  const Start = new State();
  if (tlds == null) {
    tlds = decodeTlds(encodedTlds);
  }
  if (utlds == null) {
    utlds = decodeTlds(encodedUtlds);
  }
  tt(Start, "'", APOSTROPHE$1);
  tt(Start, "{", OPENBRACE);
  tt(Start, "}", CLOSEBRACE);
  tt(Start, "[", OPENBRACKET);
  tt(Start, "]", CLOSEBRACKET);
  tt(Start, "(", OPENPAREN);
  tt(Start, ")", CLOSEPAREN);
  tt(Start, "<", OPENANGLEBRACKET);
  tt(Start, ">", CLOSEANGLEBRACKET);
  tt(Start, "（", FULLWIDTHLEFTPAREN);
  tt(Start, "）", FULLWIDTHRIGHTPAREN);
  tt(Start, "「", LEFTCORNERBRACKET);
  tt(Start, "」", RIGHTCORNERBRACKET);
  tt(Start, "『", LEFTWHITECORNERBRACKET);
  tt(Start, "』", RIGHTWHITECORNERBRACKET);
  tt(Start, "＜", FULLWIDTHLESSTHAN);
  tt(Start, "＞", FULLWIDTHGREATERTHAN);
  tt(Start, "&", AMPERSAND);
  tt(Start, "*", ASTERISK);
  tt(Start, "@", AT);
  tt(Start, "`", BACKTICK);
  tt(Start, "^", CARET);
  tt(Start, ":", COLON);
  tt(Start, ",", COMMA);
  tt(Start, "$", DOLLAR);
  tt(Start, ".", DOT);
  tt(Start, "=", EQUALS);
  tt(Start, "!", EXCLAMATION);
  tt(Start, "-", HYPHEN);
  tt(Start, "%", PERCENT);
  tt(Start, "|", PIPE);
  tt(Start, "+", PLUS);
  tt(Start, "#", POUND);
  tt(Start, "?", QUERY);
  tt(Start, '"', QUOTE);
  tt(Start, "/", SLASH);
  tt(Start, ";", SEMI);
  tt(Start, "~", TILDE);
  tt(Start, "_", UNDERSCORE);
  tt(Start, "\\", BACKSLASH);
  tt(Start, "・", FULLWIDTHMIDDLEDOT);
  const Num = tr(Start, DIGIT, NUM, {
    [numeric]: true
  });
  tr(Num, DIGIT, Num);
  const Asciinumeric = tr(Num, ASCII_LETTER, ASCIINUMERICAL, {
    [asciinumeric]: true
  });
  const Alphanumeric = tr(Num, LETTER, ALPHANUMERICAL, {
    [alphanumeric]: true
  });
  const Word = tr(Start, ASCII_LETTER, WORD, {
    [ascii]: true
  });
  tr(Word, DIGIT, Asciinumeric);
  tr(Word, ASCII_LETTER, Word);
  tr(Asciinumeric, DIGIT, Asciinumeric);
  tr(Asciinumeric, ASCII_LETTER, Asciinumeric);
  const UWord = tr(Start, LETTER, UWORD, {
    [alpha]: true
  });
  tr(UWord, ASCII_LETTER);
  tr(UWord, DIGIT, Alphanumeric);
  tr(UWord, LETTER, UWord);
  tr(Alphanumeric, DIGIT, Alphanumeric);
  tr(Alphanumeric, ASCII_LETTER);
  tr(Alphanumeric, LETTER, Alphanumeric);
  const Nl2 = tt(Start, LF, NL, {
    [whitespace]: true
  });
  const Cr = tt(Start, CR, WS, {
    [whitespace]: true
  });
  const Ws = tr(Start, SPACE$1, WS, {
    [whitespace]: true
  });
  tt(Start, OBJECT_REPLACEMENT, Ws);
  tt(Cr, LF, Nl2);
  tt(Cr, OBJECT_REPLACEMENT, Ws);
  tr(Cr, SPACE$1, Ws);
  tt(Ws, CR);
  tt(Ws, LF);
  tr(Ws, SPACE$1, Ws);
  tt(Ws, OBJECT_REPLACEMENT, Ws);
  const Emoji = tr(Start, EMOJI, EMOJI$1, {
    [emoji]: true
  });
  tt(Emoji, "#");
  tr(Emoji, EMOJI, Emoji);
  tt(Emoji, EMOJI_VARIATION, Emoji);
  const EmojiJoiner = tt(Emoji, EMOJI_JOINER);
  tt(EmojiJoiner, "#");
  tr(EmojiJoiner, EMOJI, Emoji);
  const wordjr = [[ASCII_LETTER, Word], [DIGIT, Asciinumeric]];
  const uwordjr = [[ASCII_LETTER, null], [LETTER, UWord], [DIGIT, Alphanumeric]];
  for (let i2 = 0; i2 < tlds.length; i2++) {
    fastts(Start, tlds[i2], TLD, WORD, wordjr);
  }
  for (let i2 = 0; i2 < utlds.length; i2++) {
    fastts(Start, utlds[i2], UTLD, UWORD, uwordjr);
  }
  addToGroups(TLD, {
    tld: true,
    ascii: true
  }, groups);
  addToGroups(UTLD, {
    utld: true,
    alpha: true
  }, groups);
  fastts(Start, "file", SCHEME, WORD, wordjr);
  fastts(Start, "mailto", SCHEME, WORD, wordjr);
  fastts(Start, "http", SLASH_SCHEME, WORD, wordjr);
  fastts(Start, "https", SLASH_SCHEME, WORD, wordjr);
  fastts(Start, "ftp", SLASH_SCHEME, WORD, wordjr);
  fastts(Start, "ftps", SLASH_SCHEME, WORD, wordjr);
  addToGroups(SCHEME, {
    scheme: true,
    ascii: true
  }, groups);
  addToGroups(SLASH_SCHEME, {
    slashscheme: true,
    ascii: true
  }, groups);
  customSchemes = customSchemes.sort((a, b) => a[0] > b[0] ? 1 : -1);
  for (let i2 = 0; i2 < customSchemes.length; i2++) {
    const sch = customSchemes[i2][0];
    const optionalSlashSlash = customSchemes[i2][1];
    const flags = optionalSlashSlash ? {
      [scheme]: true
    } : {
      [slashscheme]: true
    };
    if (sch.indexOf("-") >= 0) {
      flags[domain] = true;
    } else if (!ASCII_LETTER.test(sch)) {
      flags[numeric] = true;
    } else if (DIGIT.test(sch)) {
      flags[asciinumeric] = true;
    } else {
      flags[ascii] = true;
    }
    ts(Start, sch, sch, flags);
  }
  ts(Start, "localhost", LOCALHOST, {
    ascii: true
  });
  Start.jd = new State(SYM);
  return {
    start: Start,
    tokens: assign$2({
      groups
    }, tk)
  };
}
__name(init$2, "init$2");
function run$1(start2, str) {
  const iterable = stringToArray(str.replace(/[A-Z]/g, (c) => c.toLowerCase()));
  const charCount = iterable.length;
  const tokens = [];
  let cursor = 0;
  let charCursor = 0;
  while (charCursor < charCount) {
    let state = start2;
    let nextState = null;
    let tokenLength = 0;
    let latestAccepting = null;
    let sinceAccepts = -1;
    let charsSinceAccepts = -1;
    while (charCursor < charCount && (nextState = state.go(iterable[charCursor]))) {
      state = nextState;
      if (state.accepts()) {
        sinceAccepts = 0;
        charsSinceAccepts = 0;
        latestAccepting = state;
      } else if (sinceAccepts >= 0) {
        sinceAccepts += iterable[charCursor].length;
        charsSinceAccepts++;
      }
      tokenLength += iterable[charCursor].length;
      cursor += iterable[charCursor].length;
      charCursor++;
    }
    cursor -= sinceAccepts;
    charCursor -= charsSinceAccepts;
    tokenLength -= sinceAccepts;
    tokens.push({
      t: latestAccepting.t,
      // token type/name
      v: str.slice(cursor - tokenLength, cursor),
      // string value
      s: cursor - tokenLength,
      // start index
      e: cursor
      // end index (excluding)
    });
  }
  return tokens;
}
__name(run$1, "run$1");
function stringToArray(str) {
  const result = [];
  const len = str.length;
  let index2 = 0;
  while (index2 < len) {
    let first2 = str.charCodeAt(index2);
    let second;
    let char = first2 < 55296 || first2 > 56319 || index2 + 1 === len || (second = str.charCodeAt(index2 + 1)) < 56320 || second > 57343 ? str[index2] : str.slice(index2, index2 + 2);
    result.push(char);
    index2 += char.length;
  }
  return result;
}
__name(stringToArray, "stringToArray");
function fastts(state, input, t2, defaultt, jr) {
  let next2;
  const len = input.length;
  for (let i2 = 0; i2 < len - 1; i2++) {
    const char = input[i2];
    if (state.j[char]) {
      next2 = state.j[char];
    } else {
      next2 = new State(defaultt);
      next2.jr = jr.slice();
      state.j[char] = next2;
    }
    state = next2;
  }
  next2 = new State(t2);
  next2.jr = jr.slice();
  state.j[input[len - 1]] = next2;
  return next2;
}
__name(fastts, "fastts");
function decodeTlds(encoded) {
  const words = [];
  const stack2 = [];
  let i2 = 0;
  let digits = "0123456789";
  while (i2 < encoded.length) {
    let popDigitCount = 0;
    while (digits.indexOf(encoded[i2 + popDigitCount]) >= 0) {
      popDigitCount++;
    }
    if (popDigitCount > 0) {
      words.push(stack2.join(""));
      for (let popCount = parseInt(encoded.substring(i2, i2 + popDigitCount), 10); popCount > 0; popCount--) {
        stack2.pop();
      }
      i2 += popDigitCount;
    } else {
      stack2.push(encoded[i2]);
      i2++;
    }
  }
  return words;
}
__name(decodeTlds, "decodeTlds");
const defaults = {
  defaultProtocol: "http",
  events: null,
  format: noop,
  formatHref: noop,
  nl2br: false,
  tagName: "a",
  target: null,
  rel: null,
  validate: true,
  truncate: Infinity,
  className: null,
  attributes: null,
  ignoreTags: [],
  render: null
};
function Options(opts, defaultRender = null) {
  let o = assign$2({}, defaults);
  if (opts) {
    o = assign$2(o, opts instanceof Options ? opts.o : opts);
  }
  const ignoredTags = o.ignoreTags;
  const uppercaseIgnoredTags = [];
  for (let i2 = 0; i2 < ignoredTags.length; i2++) {
    uppercaseIgnoredTags.push(ignoredTags[i2].toUpperCase());
  }
  this.o = o;
  if (defaultRender) {
    this.defaultRender = defaultRender;
  }
  this.ignoreTags = uppercaseIgnoredTags;
}
__name(Options, "Options");
Options.prototype = {
  o: defaults,
  /**
   * @type string[]
   */
  ignoreTags: [],
  /**
   * @param {IntermediateRepresentation} ir
   * @returns {any}
   */
  defaultRender(ir) {
    return ir;
  },
  /**
   * Returns true or false based on whether a token should be displayed as a
   * link based on the user options.
   * @param {MultiToken} token
   * @returns {boolean}
   */
  check(token) {
    return this.get("validate", token.toString(), token);
  },
  // Private methods
  /**
   * Resolve an option's value based on the value of the option and the given
   * params. If operator and token are specified and the target option is
   * callable, automatically calls the function with the given argument.
   * @template {keyof Opts} K
   * @param {K} key Name of option to use
   * @param {string} [operator] will be passed to the target option if it's a
   * function. If not specified, RAW function value gets returned
   * @param {MultiToken} [token] The token from linkify.tokenize
   * @returns {Opts[K] | any}
   */
  get(key, operator, token) {
    const isCallable = operator != null;
    let option3 = this.o[key];
    if (!option3) {
      return option3;
    }
    if (typeof option3 === "object") {
      option3 = token.t in option3 ? option3[token.t] : defaults[key];
      if (typeof option3 === "function" && isCallable) {
        option3 = option3(operator, token);
      }
    } else if (typeof option3 === "function" && isCallable) {
      option3 = option3(operator, token.t, token);
    }
    return option3;
  },
  /**
   * @template {keyof Opts} L
   * @param {L} key Name of options object to use
   * @param {string} [operator]
   * @param {MultiToken} [token]
   * @returns {Opts[L] | any}
   */
  getObj(key, operator, token) {
    let obj = this.o[key];
    if (typeof obj === "function" && operator != null) {
      obj = obj(operator, token.t, token);
    }
    return obj;
  },
  /**
   * Convert the given token to a rendered element that may be added to the
   * calling-interface's DOM
   * @param {MultiToken} token Token to render to an HTML element
   * @returns {any} Render result; e.g., HTML string, DOM element, React
   *   Component, etc.
   */
  render(token) {
    const ir = token.render(this);
    const renderFn = this.get("render", null, token) || this.defaultRender;
    return renderFn(ir, token.t, token);
  }
};
function noop(val) {
  return val;
}
__name(noop, "noop");
var options = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  defaults,
  Options,
  assign: assign$2
});
function MultiToken(value4, tokens) {
  this.t = "token";
  this.v = value4;
  this.tk = tokens;
}
__name(MultiToken, "MultiToken");
MultiToken.prototype = {
  isLink: false,
  /**
   * Return the string this token represents.
   * @return {string}
   */
  toString() {
    return this.v;
  },
  /**
   * What should the value for this token be in the `href` HTML attribute?
   * Returns the `.toString` value by default.
   * @param {string} [scheme]
   * @return {string}
   */
  toHref(scheme2) {
    return this.toString();
  },
  /**
   * @param {Options} options Formatting options
   * @returns {string}
   */
  toFormattedString(options4) {
    const val = this.toString();
    const truncate = options4.get("truncate", val, this);
    const formatted = options4.get("format", val, this);
    return truncate && formatted.length > truncate ? formatted.substring(0, truncate) + "…" : formatted;
  },
  /**
   *
   * @param {Options} options
   * @returns {string}
   */
  toFormattedHref(options4) {
    return options4.get("formatHref", this.toHref(options4.get("defaultProtocol")), this);
  },
  /**
   * The start index of this token in the original input string
   * @returns {number}
   */
  startIndex() {
    return this.tk[0].s;
  },
  /**
   * The end index of this token in the original input string (up to this
   * index but not including it)
   * @returns {number}
   */
  endIndex() {
    return this.tk[this.tk.length - 1].e;
  },
  /**
  	Returns an object  of relevant values for this token, which includes keys
  	* type - Kind of token ('url', 'email', etc.)
  	* value - Original text
  	* href - The value that should be added to the anchor tag's href
  		attribute
  		@method toObject
  	@param {string} [protocol] `'http'` by default
  */
  toObject(protocol = defaults.defaultProtocol) {
    return {
      type: this.t,
      value: this.toString(),
      isLink: this.isLink,
      href: this.toHref(protocol),
      start: this.startIndex(),
      end: this.endIndex()
    };
  },
  /**
   *
   * @param {Options} options Formatting option
   */
  toFormattedObject(options4) {
    return {
      type: this.t,
      value: this.toFormattedString(options4),
      isLink: this.isLink,
      href: this.toFormattedHref(options4),
      start: this.startIndex(),
      end: this.endIndex()
    };
  },
  /**
   * Whether this token should be rendered as a link according to the given options
   * @param {Options} options
   * @returns {boolean}
   */
  validate(options4) {
    return options4.get("validate", this.toString(), this);
  },
  /**
   * Return an object that represents how this link should be rendered.
   * @param {Options} options Formattinng options
   */
  render(options4) {
    const token = this;
    const href = this.toHref(options4.get("defaultProtocol"));
    const formattedHref = options4.get("formatHref", href, this);
    const tagName = options4.get("tagName", href, token);
    const content2 = this.toFormattedString(options4);
    const attributes = {};
    const className = options4.get("className", href, token);
    const target = options4.get("target", href, token);
    const rel = options4.get("rel", href, token);
    const attrs4 = options4.getObj("attributes", href, token);
    const eventListeners = options4.getObj("events", href, token);
    attributes.href = formattedHref;
    if (className) {
      attributes.class = className;
    }
    if (target) {
      attributes.target = target;
    }
    if (rel) {
      attributes.rel = rel;
    }
    if (attrs4) {
      assign$2(attributes, attrs4);
    }
    return {
      tagName,
      attributes,
      content: content2,
      eventListeners
    };
  }
};
function createTokenClass(type, props) {
  class Token2 extends MultiToken {
    static {
      __name(this, "Token");
    }
    constructor(value4, tokens) {
      super(value4, tokens);
      this.t = type;
    }
  }
  for (const p2 in props) {
    Token2.prototype[p2] = props[p2];
  }
  Token2.t = type;
  return Token2;
}
__name(createTokenClass, "createTokenClass");
const Email = createTokenClass("email", {
  isLink: true,
  toHref() {
    return "mailto:" + this.toString();
  }
});
const Text$3 = createTokenClass("text");
const Nl = createTokenClass("nl");
const Url$1 = createTokenClass("url", {
  isLink: true,
  /**
  	Lowercases relevant parts of the domain and adds the protocol if
  	required. Note that this will not escape unsafe HTML characters in the
  	URL.
  		@param {string} [scheme] default scheme (e.g., 'https')
  	@return {string} the full href
  */
  toHref(scheme2 = defaults.defaultProtocol) {
    return this.hasProtocol() ? this.v : `${scheme2}://${this.v}`;
  },
  /**
   * Check whether this URL token has a protocol
   * @return {boolean}
   */
  hasProtocol() {
    const tokens = this.tk;
    return tokens.length >= 2 && tokens[0].t !== LOCALHOST && tokens[1].t === COLON;
  }
});
var multi = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  MultiToken,
  Base: MultiToken,
  createTokenClass,
  Email,
  Text: Text$3,
  Nl,
  Url: Url$1
});
const makeState = /* @__PURE__ */ __name((arg) => new State(arg), "makeState");
function init$1({
  groups
}) {
  const qsAccepting = groups.domain.concat([AMPERSAND, ASTERISK, AT, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, NUM, PERCENT, PIPE, PLUS, POUND, SLASH, SYM, TILDE, UNDERSCORE]);
  const qsNonAccepting = [COLON, COMMA, DOT, EXCLAMATION, PERCENT, QUERY, QUOTE, SEMI, OPENANGLEBRACKET, CLOSEANGLEBRACKET, OPENBRACE, CLOSEBRACE, CLOSEBRACKET, OPENBRACKET, OPENPAREN, CLOSEPAREN, FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN, LEFTCORNERBRACKET, RIGHTCORNERBRACKET, LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET, FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN];
  const localpartAccepting = [AMPERSAND, APOSTROPHE$1, ASTERISK, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, OPENBRACE, CLOSEBRACE, PERCENT, PIPE, PLUS, POUND, QUERY, SLASH, SYM, TILDE, UNDERSCORE];
  const Start = makeState();
  const Localpart = tt(Start, TILDE);
  ta(Localpart, localpartAccepting, Localpart);
  ta(Localpart, groups.domain, Localpart);
  const Domain = makeState(), Scheme = makeState(), SlashScheme = makeState();
  ta(Start, groups.domain, Domain);
  ta(Start, groups.scheme, Scheme);
  ta(Start, groups.slashscheme, SlashScheme);
  ta(Domain, localpartAccepting, Localpart);
  ta(Domain, groups.domain, Domain);
  const LocalpartAt = tt(Domain, AT);
  tt(Localpart, AT, LocalpartAt);
  tt(Scheme, AT, LocalpartAt);
  tt(SlashScheme, AT, LocalpartAt);
  const LocalpartDot = tt(Localpart, DOT);
  ta(LocalpartDot, localpartAccepting, Localpart);
  ta(LocalpartDot, groups.domain, Localpart);
  const EmailDomain = makeState();
  ta(LocalpartAt, groups.domain, EmailDomain);
  ta(EmailDomain, groups.domain, EmailDomain);
  const EmailDomainDot = tt(EmailDomain, DOT);
  ta(EmailDomainDot, groups.domain, EmailDomain);
  const Email$1 = makeState(Email);
  ta(EmailDomainDot, groups.tld, Email$1);
  ta(EmailDomainDot, groups.utld, Email$1);
  tt(LocalpartAt, LOCALHOST, Email$1);
  const EmailDomainHyphen = tt(EmailDomain, HYPHEN);
  tt(EmailDomainHyphen, HYPHEN, EmailDomainHyphen);
  ta(EmailDomainHyphen, groups.domain, EmailDomain);
  ta(Email$1, groups.domain, EmailDomain);
  tt(Email$1, DOT, EmailDomainDot);
  tt(Email$1, HYPHEN, EmailDomainHyphen);
  const EmailColon = tt(Email$1, COLON);
  ta(EmailColon, groups.numeric, Email);
  const DomainHyphen = tt(Domain, HYPHEN);
  const DomainDot = tt(Domain, DOT);
  tt(DomainHyphen, HYPHEN, DomainHyphen);
  ta(DomainHyphen, groups.domain, Domain);
  ta(DomainDot, localpartAccepting, Localpart);
  ta(DomainDot, groups.domain, Domain);
  const DomainDotTld = makeState(Url$1);
  ta(DomainDot, groups.tld, DomainDotTld);
  ta(DomainDot, groups.utld, DomainDotTld);
  ta(DomainDotTld, groups.domain, Domain);
  ta(DomainDotTld, localpartAccepting, Localpart);
  tt(DomainDotTld, DOT, DomainDot);
  tt(DomainDotTld, HYPHEN, DomainHyphen);
  tt(DomainDotTld, AT, LocalpartAt);
  const DomainDotTldColon = tt(DomainDotTld, COLON);
  const DomainDotTldColonPort = makeState(Url$1);
  ta(DomainDotTldColon, groups.numeric, DomainDotTldColonPort);
  const Url$1$1 = makeState(Url$1);
  const UrlNonaccept = makeState();
  ta(Url$1$1, qsAccepting, Url$1$1);
  ta(Url$1$1, qsNonAccepting, UrlNonaccept);
  ta(UrlNonaccept, qsAccepting, Url$1$1);
  ta(UrlNonaccept, qsNonAccepting, UrlNonaccept);
  tt(DomainDotTld, SLASH, Url$1$1);
  tt(DomainDotTldColonPort, SLASH, Url$1$1);
  const SchemeColon = tt(Scheme, COLON);
  const SlashSchemeColon = tt(SlashScheme, COLON);
  const SlashSchemeColonSlash = tt(SlashSchemeColon, SLASH);
  const UriPrefix = tt(SlashSchemeColonSlash, SLASH);
  ta(Scheme, groups.domain, Domain);
  tt(Scheme, DOT, DomainDot);
  tt(Scheme, HYPHEN, DomainHyphen);
  ta(SlashScheme, groups.domain, Domain);
  tt(SlashScheme, DOT, DomainDot);
  tt(SlashScheme, HYPHEN, DomainHyphen);
  ta(SchemeColon, groups.domain, Url$1$1);
  tt(SchemeColon, SLASH, Url$1$1);
  tt(SchemeColon, QUERY, Url$1$1);
  ta(UriPrefix, groups.domain, Url$1$1);
  ta(UriPrefix, qsAccepting, Url$1$1);
  tt(UriPrefix, SLASH, Url$1$1);
  const bracketPairs = [
    [OPENBRACE, CLOSEBRACE],
    // {}
    [OPENBRACKET, CLOSEBRACKET],
    // []
    [OPENPAREN, CLOSEPAREN],
    // ()
    [OPENANGLEBRACKET, CLOSEANGLEBRACKET],
    // <>
    [FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN],
    // （）
    [LEFTCORNERBRACKET, RIGHTCORNERBRACKET],
    // 「」
    [LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET],
    // 『』
    [FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN]
    // ＜＞
  ];
  for (let i2 = 0; i2 < bracketPairs.length; i2++) {
    const [OPEN, CLOSE] = bracketPairs[i2];
    const UrlOpen = tt(Url$1$1, OPEN);
    tt(UrlNonaccept, OPEN, UrlOpen);
    tt(UrlOpen, CLOSE, Url$1$1);
    const UrlOpenQ = makeState(Url$1);
    ta(UrlOpen, qsAccepting, UrlOpenQ);
    const UrlOpenSyms = makeState();
    ta(UrlOpen, qsNonAccepting);
    ta(UrlOpenQ, qsAccepting, UrlOpenQ);
    ta(UrlOpenQ, qsNonAccepting, UrlOpenSyms);
    ta(UrlOpenSyms, qsAccepting, UrlOpenQ);
    ta(UrlOpenSyms, qsNonAccepting, UrlOpenSyms);
    tt(UrlOpenQ, CLOSE, Url$1$1);
    tt(UrlOpenSyms, CLOSE, Url$1$1);
  }
  tt(Start, LOCALHOST, DomainDotTld);
  tt(Start, NL, Nl);
  return {
    start: Start,
    tokens: tk
  };
}
__name(init$1, "init$1");
function run(start2, input, tokens) {
  let len = tokens.length;
  let cursor = 0;
  let multis = [];
  let textTokens = [];
  while (cursor < len) {
    let state = start2;
    let secondState = null;
    let nextState = null;
    let multiLength = 0;
    let latestAccepting = null;
    let sinceAccepts = -1;
    while (cursor < len && !(secondState = state.go(tokens[cursor].t))) {
      textTokens.push(tokens[cursor++]);
    }
    while (cursor < len && (nextState = secondState || state.go(tokens[cursor].t))) {
      secondState = null;
      state = nextState;
      if (state.accepts()) {
        sinceAccepts = 0;
        latestAccepting = state;
      } else if (sinceAccepts >= 0) {
        sinceAccepts++;
      }
      cursor++;
      multiLength++;
    }
    if (sinceAccepts < 0) {
      cursor -= multiLength;
      if (cursor < len) {
        textTokens.push(tokens[cursor]);
        cursor++;
      }
    } else {
      if (textTokens.length > 0) {
        multis.push(initMultiToken(Text$3, input, textTokens));
        textTokens = [];
      }
      cursor -= sinceAccepts;
      multiLength -= sinceAccepts;
      const Multi = latestAccepting.t;
      const subtokens = tokens.slice(cursor - multiLength, cursor);
      multis.push(initMultiToken(Multi, input, subtokens));
    }
  }
  if (textTokens.length > 0) {
    multis.push(initMultiToken(Text$3, input, textTokens));
  }
  return multis;
}
__name(run, "run");
function initMultiToken(Multi, input, tokens) {
  const startIdx = tokens[0].s;
  const endIdx = tokens[tokens.length - 1].e;
  const value4 = input.slice(startIdx, endIdx);
  return new Multi(value4, tokens);
}
__name(initMultiToken, "initMultiToken");
const warn = typeof console !== "undefined" && console && console.warn || (() => {
});
const warnAdvice = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.";
const INIT = {
  scanner: null,
  parser: null,
  tokenQueue: [],
  pluginQueue: [],
  customSchemes: [],
  initialized: false
};
function reset() {
  State.groups = {};
  INIT.scanner = null;
  INIT.parser = null;
  INIT.tokenQueue = [];
  INIT.pluginQueue = [];
  INIT.customSchemes = [];
  INIT.initialized = false;
  return INIT;
}
__name(reset, "reset");
function registerTokenPlugin(name2, plugin) {
  if (typeof plugin !== "function") {
    throw new Error(`linkifyjs: Invalid token plugin ${plugin} (expects function)`);
  }
  for (let i2 = 0; i2 < INIT.tokenQueue.length; i2++) {
    if (name2 === INIT.tokenQueue[i2][0]) {
      warn(`linkifyjs: token plugin "${name2}" already registered - will be overwritten`);
      INIT.tokenQueue[i2] = [name2, plugin];
      return;
    }
  }
  INIT.tokenQueue.push([name2, plugin]);
  if (INIT.initialized) {
    warn(`linkifyjs: already initialized - will not register token plugin "${name2}" ${warnAdvice}`);
  }
}
__name(registerTokenPlugin, "registerTokenPlugin");
function registerPlugin(name2, plugin) {
  if (typeof plugin !== "function") {
    throw new Error(`linkifyjs: Invalid plugin ${plugin} (expects function)`);
  }
  for (let i2 = 0; i2 < INIT.pluginQueue.length; i2++) {
    if (name2 === INIT.pluginQueue[i2][0]) {
      warn(`linkifyjs: plugin "${name2}" already registered - will be overwritten`);
      INIT.pluginQueue[i2] = [name2, plugin];
      return;
    }
  }
  INIT.pluginQueue.push([name2, plugin]);
  if (INIT.initialized) {
    warn(`linkifyjs: already initialized - will not register plugin "${name2}" ${warnAdvice}`);
  }
}
__name(registerPlugin, "registerPlugin");
function registerCustomProtocol(scheme2, optionalSlashSlash = false) {
  if (INIT.initialized) {
    warn(`linkifyjs: already initialized - will not register custom scheme "${scheme2}" ${warnAdvice}`);
  }
  if (!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(scheme2)) {
    throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);
  }
  INIT.customSchemes.push([scheme2, optionalSlashSlash]);
}
__name(registerCustomProtocol, "registerCustomProtocol");
function init() {
  INIT.scanner = init$2(INIT.customSchemes);
  for (let i2 = 0; i2 < INIT.tokenQueue.length; i2++) {
    INIT.tokenQueue[i2][1]({
      scanner: INIT.scanner
    });
  }
  INIT.parser = init$1(INIT.scanner.tokens);
  for (let i2 = 0; i2 < INIT.pluginQueue.length; i2++) {
    INIT.pluginQueue[i2][1]({
      scanner: INIT.scanner,
      parser: INIT.parser
    });
  }
  INIT.initialized = true;
  return INIT;
}
__name(init, "init");
function tokenize(str) {
  if (!INIT.initialized) {
    init();
  }
  return run(INIT.parser.start, str, run$1(INIT.scanner.start, str));
}
__name(tokenize, "tokenize");
tokenize.scan = run$1;
function find(str, type = null, opts = null) {
  if (type && typeof type === "object") {
    if (opts) {
      throw Error(`linkifyjs: Invalid link type ${type}; must be a string`);
    }
    opts = type;
    type = null;
  }
  const options4 = new Options(opts);
  const tokens = tokenize(str);
  const filtered = [];
  for (let i2 = 0; i2 < tokens.length; i2++) {
    const token = tokens[i2];
    if (token.isLink && (!type || token.t === type) && options4.check(token)) {
      filtered.push(token.toFormattedObject(options4));
    }
  }
  return filtered;
}
__name(find, "find");
function test(str, type = null) {
  const tokens = tokenize(str);
  return tokens.length === 1 && tokens[0].isLink && (!type || tokens[0].t === type);
}
__name(test, "test");
function isValidLinkStructure(tokens) {
  if (tokens.length === 1) {
    return tokens[0].isLink;
  }
  if (tokens.length === 3 && tokens[1].isLink) {
    return ["()", "[]"].includes(tokens[0].value + tokens[2].value);
  }
  return false;
}
__name(isValidLinkStructure, "isValidLinkStructure");
function autolink$1(options4) {
  return new Plugin({
    key: new PluginKey("autolink"),
    appendTransaction: /* @__PURE__ */ __name((transactions, oldState, newState) => {
      const docChanges = transactions.some((transaction) => transaction.docChanged) && !oldState.doc.eq(newState.doc);
      const preventAutolink = transactions.some((transaction) => transaction.getMeta("preventAutolink"));
      if (!docChanges || preventAutolink) {
        return;
      }
      const { tr: tr2 } = newState;
      const transform2 = combineTransactionSteps(oldState.doc, [...transactions]);
      const changes = getChangedRanges(transform2);
      changes.forEach(({ newRange }) => {
        const nodesInChangedRanges = findChildrenInRange(newState.doc, newRange, (node3) => node3.isTextblock);
        let textBlock;
        let textBeforeWhitespace;
        if (nodesInChangedRanges.length > 1) {
          textBlock = nodesInChangedRanges[0];
          textBeforeWhitespace = newState.doc.textBetween(textBlock.pos, textBlock.pos + textBlock.node.nodeSize, void 0, " ");
        } else if (nodesInChangedRanges.length && newState.doc.textBetween(newRange.from, newRange.to, " ", " ").endsWith(" ")) {
          textBlock = nodesInChangedRanges[0];
          textBeforeWhitespace = newState.doc.textBetween(textBlock.pos, newRange.to, void 0, " ");
        }
        if (textBlock && textBeforeWhitespace) {
          const wordsBeforeWhitespace = textBeforeWhitespace.split(" ").filter((s) => s !== "");
          if (wordsBeforeWhitespace.length <= 0) {
            return false;
          }
          const lastWordBeforeSpace = wordsBeforeWhitespace[wordsBeforeWhitespace.length - 1];
          const lastWordAndBlockOffset = textBlock.pos + textBeforeWhitespace.lastIndexOf(lastWordBeforeSpace);
          if (!lastWordBeforeSpace) {
            return false;
          }
          const linksBeforeSpace = tokenize(lastWordBeforeSpace).map((t2) => t2.toObject(options4.defaultProtocol));
          if (!isValidLinkStructure(linksBeforeSpace)) {
            return false;
          }
          linksBeforeSpace.filter((link2) => link2.isLink).map((link2) => ({
            ...link2,
            from: lastWordAndBlockOffset + link2.start + 1,
            to: lastWordAndBlockOffset + link2.end + 1
          })).filter((link2) => {
            if (!newState.schema.marks.code) {
              return true;
            }
            return !newState.doc.rangeHasMark(link2.from, link2.to, newState.schema.marks.code);
          }).filter((link2) => options4.validate(link2.value)).filter((link2) => options4.shouldAutoLink(link2.value)).forEach((link2) => {
            if (getMarksBetween(link2.from, link2.to, newState.doc).some((item3) => item3.mark.type === options4.type)) {
              return;
            }
            tr2.addMark(link2.from, link2.to, options4.type.create({
              href: link2.href
            }));
          });
        }
      });
      if (!tr2.steps.length) {
        return;
      }
      return tr2;
    }, "appendTransaction")
  });
}
__name(autolink$1, "autolink$1");
function clickHandler(options4) {
  return new Plugin({
    key: new PluginKey("handleClickLink"),
    props: {
      handleClick: /* @__PURE__ */ __name((view, pos2, event) => {
        var _a2, _b;
        if (event.button !== 0) {
          return false;
        }
        if (!view.editable) {
          return false;
        }
        let a = event.target;
        const els = [];
        while (a.nodeName !== "DIV") {
          els.push(a);
          a = a.parentNode;
        }
        if (!els.find((value4) => value4.nodeName === "A")) {
          return false;
        }
        const attrs4 = getAttributes(view.state, options4.type.name);
        const link2 = event.target;
        const href = (_a2 = link2 === null || link2 === void 0 ? void 0 : link2.href) !== null && _a2 !== void 0 ? _a2 : attrs4.href;
        const target = (_b = link2 === null || link2 === void 0 ? void 0 : link2.target) !== null && _b !== void 0 ? _b : attrs4.target;
        if (link2 && href) {
          window.open(href, target);
          return true;
        }
        return false;
      }, "handleClick")
    }
  });
}
__name(clickHandler, "clickHandler");
function pasteHandler(options4) {
  return new Plugin({
    key: new PluginKey("handlePasteLink"),
    props: {
      handlePaste: /* @__PURE__ */ __name((view, event, slice2) => {
        const { state } = view;
        const { selection } = state;
        const { empty: empty3 } = selection;
        if (empty3) {
          return false;
        }
        let textContent = "";
        slice2.content.forEach((node3) => {
          textContent += node3.textContent;
        });
        const link2 = find(textContent, { defaultProtocol: options4.defaultProtocol }).find((item3) => item3.isLink && item3.value === textContent);
        if (!textContent || !link2) {
          return false;
        }
        options4.editor.commands.setMark(options4.type, {
          href: link2.href
        });
        return true;
      }, "handlePaste")
    }
  });
}
__name(pasteHandler, "pasteHandler");
const pasteRegex$2 = /https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;
const ATTR_WHITESPACE = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;
function isAllowedUri(uri, protocols) {
  const allowedProtocols = [
    "http",
    "https",
    "ftp",
    "ftps",
    "mailto",
    "tel",
    "callto",
    "sms",
    "cid",
    "xmpp"
  ];
  if (protocols) {
    protocols.forEach((protocol) => {
      const nextProtocol = typeof protocol === "string" ? protocol : protocol.scheme;
      if (nextProtocol) {
        allowedProtocols.push(nextProtocol);
      }
    });
  }
  return !uri || uri.replace(ATTR_WHITESPACE, "").match(new RegExp(
    // eslint-disable-next-line no-useless-escape
    `^(?:(?:${allowedProtocols.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,
    "i"
  ));
}
__name(isAllowedUri, "isAllowedUri");
const Link$2 = Mark.create({
  name: "link",
  priority: 1e3,
  keepOnSplit: false,
  exitable: true,
  onCreate() {
    if (this.options.validate && !this.options.shouldAutoLink) {
      this.options.shouldAutoLink = this.options.validate;
      console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.");
    }
    this.options.protocols.forEach((protocol) => {
      if (typeof protocol === "string") {
        registerCustomProtocol(protocol);
        return;
      }
      registerCustomProtocol(protocol.scheme, protocol.optionalSlashes);
    });
  },
  onDestroy() {
    reset();
  },
  inclusive() {
    return this.options.autolink;
  },
  addOptions() {
    return {
      openOnClick: true,
      linkOnPaste: true,
      autolink: true,
      protocols: [],
      defaultProtocol: "http",
      HTMLAttributes: {
        target: "_blank",
        rel: "noopener noreferrer nofollow",
        class: null
      },
      isAllowedUri: /* @__PURE__ */ __name((url, ctx) => !!isAllowedUri(url, ctx.protocols), "isAllowedUri"),
      validate: /* @__PURE__ */ __name((url) => !!url, "validate"),
      shouldAutoLink: /* @__PURE__ */ __name((url) => !!url, "shouldAutoLink")
    };
  },
  addAttributes() {
    return {
      href: {
        default: null,
        parseHTML(element) {
          return element.getAttribute("href");
        }
      },
      target: {
        default: this.options.HTMLAttributes.target
      },
      rel: {
        default: this.options.HTMLAttributes.rel
      },
      class: {
        default: this.options.HTMLAttributes.class
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "a[href]",
        getAttrs: /* @__PURE__ */ __name((dom) => {
          const href = dom.getAttribute("href");
          if (!href || !this.options.isAllowedUri(href, {
            defaultValidate: /* @__PURE__ */ __name((url) => !!isAllowedUri(url, this.options.protocols), "defaultValidate"),
            protocols: this.options.protocols,
            defaultProtocol: this.options.defaultProtocol
          })) {
            return false;
          }
          return null;
        }, "getAttrs")
      }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    if (!this.options.isAllowedUri(HTMLAttributes.href, {
      defaultValidate: /* @__PURE__ */ __name((href) => !!isAllowedUri(href, this.options.protocols), "defaultValidate"),
      protocols: this.options.protocols,
      defaultProtocol: this.options.defaultProtocol
    })) {
      return [
        "a",
        mergeAttributes(this.options.HTMLAttributes, { ...HTMLAttributes, href: "" }),
        0
      ];
    }
    return ["a", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      setLink: /* @__PURE__ */ __name((attributes) => ({ chain }) => {
        const { href } = attributes;
        if (!this.options.isAllowedUri(href, {
          defaultValidate: /* @__PURE__ */ __name((url) => !!isAllowedUri(url, this.options.protocols), "defaultValidate"),
          protocols: this.options.protocols,
          defaultProtocol: this.options.defaultProtocol
        })) {
          return false;
        }
        return chain().setMark(this.name, attributes).setMeta("preventAutolink", true).run();
      }, "setLink"),
      toggleLink: /* @__PURE__ */ __name((attributes) => ({ chain }) => {
        const { href } = attributes;
        if (!this.options.isAllowedUri(href, {
          defaultValidate: /* @__PURE__ */ __name((url) => !!isAllowedUri(url, this.options.protocols), "defaultValidate"),
          protocols: this.options.protocols,
          defaultProtocol: this.options.defaultProtocol
        })) {
          return false;
        }
        return chain().toggleMark(this.name, attributes, { extendEmptyMarkRange: true }).setMeta("preventAutolink", true).run();
      }, "toggleLink"),
      unsetLink: /* @__PURE__ */ __name(() => ({ chain }) => {
        return chain().unsetMark(this.name, { extendEmptyMarkRange: true }).setMeta("preventAutolink", true).run();
      }, "unsetLink")
    };
  },
  addPasteRules() {
    return [
      markPasteRule({
        find: /* @__PURE__ */ __name((text2) => {
          const foundLinks = [];
          if (text2) {
            const { protocols, defaultProtocol } = this.options;
            const links = find(text2).filter((item3) => item3.isLink && this.options.isAllowedUri(item3.value, {
              defaultValidate: /* @__PURE__ */ __name((href) => !!isAllowedUri(href, protocols), "defaultValidate"),
              protocols,
              defaultProtocol
            }));
            if (links.length) {
              links.forEach((link2) => foundLinks.push({
                text: link2.value,
                data: {
                  href: link2.href
                },
                index: link2.start
              }));
            }
          }
          return foundLinks;
        }, "find"),
        type: this.type,
        getAttributes: /* @__PURE__ */ __name((match2) => {
          var _a2;
          return {
            href: (_a2 = match2.data) === null || _a2 === void 0 ? void 0 : _a2.href
          };
        }, "getAttributes")
      })
    ];
  },
  addProseMirrorPlugins() {
    const plugins = [];
    const { protocols, defaultProtocol } = this.options;
    if (this.options.autolink) {
      plugins.push(autolink$1({
        type: this.type,
        defaultProtocol: this.options.defaultProtocol,
        validate: /* @__PURE__ */ __name((url) => this.options.isAllowedUri(url, {
          defaultValidate: /* @__PURE__ */ __name((href) => !!isAllowedUri(href, protocols), "defaultValidate"),
          protocols,
          defaultProtocol
        }), "validate"),
        shouldAutoLink: this.options.shouldAutoLink
      }));
    }
    if (this.options.openOnClick === true) {
      plugins.push(clickHandler({
        type: this.type
      }));
    }
    if (this.options.linkOnPaste) {
      plugins.push(pasteHandler({
        editor: this.editor,
        defaultProtocol: this.options.defaultProtocol,
        type: this.type
      }));
    }
    return plugins;
  }
});
var readFromCache;
var addToCache;
if (typeof WeakMap != "undefined") {
  let cache2 = /* @__PURE__ */ new WeakMap();
  readFromCache = /* @__PURE__ */ __name((key) => cache2.get(key), "readFromCache");
  addToCache = /* @__PURE__ */ __name((key, value4) => {
    cache2.set(key, value4);
    return value4;
  }, "addToCache");
} else {
  const cache2 = [];
  const cacheSize = 10;
  let cachePos = 0;
  readFromCache = /* @__PURE__ */ __name((key) => {
    for (let i2 = 0; i2 < cache2.length; i2 += 2)
      if (cache2[i2] == key)
        return cache2[i2 + 1];
  }, "readFromCache");
  addToCache = /* @__PURE__ */ __name((key, value4) => {
    if (cachePos == cacheSize)
      cachePos = 0;
    cache2[cachePos++] = key;
    return cache2[cachePos++] = value4;
  }, "addToCache");
}
var TableMap = class {
  static {
    __name(this, "TableMap");
  }
  constructor(width2, height, map3, problems) {
    this.width = width2;
    this.height = height;
    this.map = map3;
    this.problems = problems;
  }
  // Find the dimensions of the cell at the given position.
  findCell(pos2) {
    for (let i2 = 0; i2 < this.map.length; i2++) {
      const curPos = this.map[i2];
      if (curPos != pos2)
        continue;
      const left = i2 % this.width;
      const top = i2 / this.width | 0;
      let right = left + 1;
      let bottom = top + 1;
      for (let j = 1; right < this.width && this.map[i2 + j] == curPos; j++) {
        right++;
      }
      for (let j = 1; bottom < this.height && this.map[i2 + this.width * j] == curPos; j++) {
        bottom++;
      }
      return { left, top, right, bottom };
    }
    throw new RangeError(`No cell with offset ${pos2} found`);
  }
  // Find the left side of the cell at the given position.
  colCount(pos2) {
    for (let i2 = 0; i2 < this.map.length; i2++) {
      if (this.map[i2] == pos2) {
        return i2 % this.width;
      }
    }
    throw new RangeError(`No cell with offset ${pos2} found`);
  }
  // Find the next cell in the given direction, starting from the cell
  // at `pos`, if any.
  nextCell(pos2, axis, dir) {
    const { left, right, top, bottom } = this.findCell(pos2);
    if (axis == "horiz") {
      if (dir < 0 ? left == 0 : right == this.width)
        return null;
      return this.map[top * this.width + (dir < 0 ? left - 1 : right)];
    } else {
      if (dir < 0 ? top == 0 : bottom == this.height)
        return null;
      return this.map[left + this.width * (dir < 0 ? top - 1 : bottom)];
    }
  }
  // Get the rectangle spanning the two given cells.
  rectBetween(a, b) {
    const {
      left: leftA,
      right: rightA,
      top: topA,
      bottom: bottomA
    } = this.findCell(a);
    const {
      left: leftB,
      right: rightB,
      top: topB,
      bottom: bottomB
    } = this.findCell(b);
    return {
      left: Math.min(leftA, leftB),
      top: Math.min(topA, topB),
      right: Math.max(rightA, rightB),
      bottom: Math.max(bottomA, bottomB)
    };
  }
  // Return the position of all cells that have the top left corner in
  // the given rectangle.
  cellsInRect(rect) {
    const result = [];
    const seen2 = {};
    for (let row = rect.top; row < rect.bottom; row++) {
      for (let col = rect.left; col < rect.right; col++) {
        const index2 = row * this.width + col;
        const pos2 = this.map[index2];
        if (seen2[pos2])
          continue;
        seen2[pos2] = true;
        if (col == rect.left && col && this.map[index2 - 1] == pos2 || row == rect.top && row && this.map[index2 - this.width] == pos2) {
          continue;
        }
        result.push(pos2);
      }
    }
    return result;
  }
  // Return the position at which the cell at the given row and column
  // starts, or would start, if a cell started there.
  positionAt(row, col, table2) {
    for (let i2 = 0, rowStart = 0; ; i2++) {
      const rowEnd = rowStart + table2.child(i2).nodeSize;
      if (i2 == row) {
        let index2 = col + row * this.width;
        const rowEndIndex = (row + 1) * this.width;
        while (index2 < rowEndIndex && this.map[index2] < rowStart)
          index2++;
        return index2 == rowEndIndex ? rowEnd - 1 : this.map[index2];
      }
      rowStart = rowEnd;
    }
  }
  // Find the table map for the given table node.
  static get(table2) {
    return readFromCache(table2) || addToCache(table2, computeMap(table2));
  }
};
function computeMap(table2) {
  if (table2.type.spec.tableRole != "table")
    throw new RangeError("Not a table node: " + table2.type.name);
  const width2 = findWidth(table2), height = table2.childCount;
  const map3 = [];
  let mapPos = 0;
  let problems = null;
  const colWidths = [];
  for (let i2 = 0, e2 = width2 * height; i2 < e2; i2++)
    map3[i2] = 0;
  for (let row = 0, pos2 = 0; row < height; row++) {
    const rowNode = table2.child(row);
    pos2++;
    for (let i2 = 0; ; i2++) {
      while (mapPos < map3.length && map3[mapPos] != 0)
        mapPos++;
      if (i2 == rowNode.childCount)
        break;
      const cellNode = rowNode.child(i2);
      const { colspan, rowspan, colwidth } = cellNode.attrs;
      for (let h2 = 0; h2 < rowspan; h2++) {
        if (h2 + row >= height) {
          (problems || (problems = [])).push({
            type: "overlong_rowspan",
            pos: pos2,
            n: rowspan - h2
          });
          break;
        }
        const start2 = mapPos + h2 * width2;
        for (let w = 0; w < colspan; w++) {
          if (map3[start2 + w] == 0)
            map3[start2 + w] = pos2;
          else
            (problems || (problems = [])).push({
              type: "collision",
              row,
              pos: pos2,
              n: colspan - w
            });
          const colW = colwidth && colwidth[w];
          if (colW) {
            const widthIndex = (start2 + w) % width2 * 2, prev2 = colWidths[widthIndex];
            if (prev2 == null || prev2 != colW && colWidths[widthIndex + 1] == 1) {
              colWidths[widthIndex] = colW;
              colWidths[widthIndex + 1] = 1;
            } else if (prev2 == colW) {
              colWidths[widthIndex + 1]++;
            }
          }
        }
      }
      mapPos += colspan;
      pos2 += cellNode.nodeSize;
    }
    const expectedPos = (row + 1) * width2;
    let missing = 0;
    while (mapPos < expectedPos)
      if (map3[mapPos++] == 0)
        missing++;
    if (missing)
      (problems || (problems = [])).push({ type: "missing", row, n: missing });
    pos2++;
  }
  const tableMap = new TableMap(width2, height, map3, problems);
  let badWidths = false;
  for (let i2 = 0; !badWidths && i2 < colWidths.length; i2 += 2)
    if (colWidths[i2] != null && colWidths[i2 + 1] < height)
      badWidths = true;
  if (badWidths)
    findBadColWidths(tableMap, colWidths, table2);
  return tableMap;
}
__name(computeMap, "computeMap");
function findWidth(table2) {
  let width2 = -1;
  let hasRowSpan = false;
  for (let row = 0; row < table2.childCount; row++) {
    const rowNode = table2.child(row);
    let rowWidth = 0;
    if (hasRowSpan)
      for (let j = 0; j < row; j++) {
        const prevRow = table2.child(j);
        for (let i2 = 0; i2 < prevRow.childCount; i2++) {
          const cell = prevRow.child(i2);
          if (j + cell.attrs.rowspan > row)
            rowWidth += cell.attrs.colspan;
        }
      }
    for (let i2 = 0; i2 < rowNode.childCount; i2++) {
      const cell = rowNode.child(i2);
      rowWidth += cell.attrs.colspan;
      if (cell.attrs.rowspan > 1)
        hasRowSpan = true;
    }
    if (width2 == -1)
      width2 = rowWidth;
    else if (width2 != rowWidth)
      width2 = Math.max(width2, rowWidth);
  }
  return width2;
}
__name(findWidth, "findWidth");
function findBadColWidths(map3, colWidths, table2) {
  if (!map3.problems)
    map3.problems = [];
  const seen2 = {};
  for (let i2 = 0; i2 < map3.map.length; i2++) {
    const pos2 = map3.map[i2];
    if (seen2[pos2])
      continue;
    seen2[pos2] = true;
    const node3 = table2.nodeAt(pos2);
    if (!node3) {
      throw new RangeError(`No cell with offset ${pos2} found`);
    }
    let updated13 = null;
    const attrs4 = node3.attrs;
    for (let j = 0; j < attrs4.colspan; j++) {
      const col = (i2 + j) % map3.width;
      const colWidth = colWidths[col * 2];
      if (colWidth != null && (!attrs4.colwidth || attrs4.colwidth[j] != colWidth))
        (updated13 || (updated13 = freshColWidth(attrs4)))[j] = colWidth;
    }
    if (updated13)
      map3.problems.unshift({
        type: "colwidth mismatch",
        pos: pos2,
        colwidth: updated13
      });
  }
}
__name(findBadColWidths, "findBadColWidths");
function freshColWidth(attrs4) {
  if (attrs4.colwidth)
    return attrs4.colwidth.slice();
  const result = [];
  for (let i2 = 0; i2 < attrs4.colspan; i2++)
    result.push(0);
  return result;
}
__name(freshColWidth, "freshColWidth");
function getCellAttrs(dom, extraAttrs) {
  if (typeof dom === "string") {
    return {};
  }
  const widthAttr = dom.getAttribute("data-colwidth");
  const widths = widthAttr && /^\d+(,\d+)*$/.test(widthAttr) ? widthAttr.split(",").map((s) => Number(s)) : null;
  const colspan = Number(dom.getAttribute("colspan") || 1);
  const result = {
    colspan,
    rowspan: Number(dom.getAttribute("rowspan") || 1),
    colwidth: widths && widths.length == colspan ? widths : null
  };
  for (const prop2 in extraAttrs) {
    const getter = extraAttrs[prop2].getFromDOM;
    const value4 = getter && getter(dom);
    if (value4 != null) {
      result[prop2] = value4;
    }
  }
  return result;
}
__name(getCellAttrs, "getCellAttrs");
function setCellAttrs(node3, extraAttrs) {
  const attrs4 = {};
  if (node3.attrs.colspan != 1)
    attrs4.colspan = node3.attrs.colspan;
  if (node3.attrs.rowspan != 1)
    attrs4.rowspan = node3.attrs.rowspan;
  if (node3.attrs.colwidth)
    attrs4["data-colwidth"] = node3.attrs.colwidth.join(",");
  for (const prop2 in extraAttrs) {
    const setter = extraAttrs[prop2].setDOMAttr;
    if (setter)
      setter(node3.attrs[prop2], attrs4);
  }
  return attrs4;
}
__name(setCellAttrs, "setCellAttrs");
function tableNodes(options4) {
  const extraAttrs = options4.cellAttributes || {};
  const cellAttrs = {
    colspan: { default: 1 },
    rowspan: { default: 1 },
    colwidth: { default: null }
  };
  for (const prop2 in extraAttrs)
    cellAttrs[prop2] = { default: extraAttrs[prop2].default };
  return {
    table: {
      content: "table_row+",
      tableRole: "table",
      isolating: true,
      group: options4.tableGroup,
      parseDOM: [{ tag: "table" }],
      toDOM() {
        return ["table", ["tbody", 0]];
      }
    },
    table_row: {
      content: "(table_cell | table_header)*",
      tableRole: "row",
      parseDOM: [{ tag: "tr" }],
      toDOM() {
        return ["tr", 0];
      }
    },
    table_cell: {
      content: options4.cellContent,
      attrs: cellAttrs,
      tableRole: "cell",
      isolating: true,
      parseDOM: [
        { tag: "td", getAttrs: /* @__PURE__ */ __name((dom) => getCellAttrs(dom, extraAttrs), "getAttrs") }
      ],
      toDOM(node3) {
        return ["td", setCellAttrs(node3, extraAttrs), 0];
      }
    },
    table_header: {
      content: options4.cellContent,
      attrs: cellAttrs,
      tableRole: "header_cell",
      isolating: true,
      parseDOM: [
        { tag: "th", getAttrs: /* @__PURE__ */ __name((dom) => getCellAttrs(dom, extraAttrs), "getAttrs") }
      ],
      toDOM(node3) {
        return ["th", setCellAttrs(node3, extraAttrs), 0];
      }
    }
  };
}
__name(tableNodes, "tableNodes");
function tableNodeTypes(schema2) {
  let result = schema2.cached.tableNodeTypes;
  if (!result) {
    result = schema2.cached.tableNodeTypes = {};
    for (const name2 in schema2.nodes) {
      const type = schema2.nodes[name2], role = type.spec.tableRole;
      if (role)
        result[role] = type;
    }
  }
  return result;
}
__name(tableNodeTypes, "tableNodeTypes");
var tableEditingKey = new PluginKey("selectingCells");
function cellAround($pos) {
  for (let d = $pos.depth - 1; d > 0; d--)
    if ($pos.node(d).type.spec.tableRole == "row")
      return $pos.node(0).resolve($pos.before(d + 1));
  return null;
}
__name(cellAround, "cellAround");
function cellWrapping($pos) {
  for (let d = $pos.depth; d > 0; d--) {
    const role = $pos.node(d).type.spec.tableRole;
    if (role === "cell" || role === "header_cell")
      return $pos.node(d);
  }
  return null;
}
__name(cellWrapping, "cellWrapping");
function isInTable(state) {
  const $head = state.selection.$head;
  for (let d = $head.depth; d > 0; d--)
    if ($head.node(d).type.spec.tableRole == "row")
      return true;
  return false;
}
__name(isInTable, "isInTable");
function selectionCell(state) {
  const sel = state.selection;
  if ("$anchorCell" in sel && sel.$anchorCell) {
    return sel.$anchorCell.pos > sel.$headCell.pos ? sel.$anchorCell : sel.$headCell;
  } else if ("node" in sel && sel.node && sel.node.type.spec.tableRole == "cell") {
    return sel.$anchor;
  }
  const $cell = cellAround(sel.$head) || cellNear(sel.$head);
  if ($cell) {
    return $cell;
  }
  throw new RangeError(`No cell found around position ${sel.head}`);
}
__name(selectionCell, "selectionCell");
function cellNear($pos) {
  for (let after = $pos.nodeAfter, pos2 = $pos.pos; after; after = after.firstChild, pos2++) {
    const role = after.type.spec.tableRole;
    if (role == "cell" || role == "header_cell")
      return $pos.doc.resolve(pos2);
  }
  for (let before = $pos.nodeBefore, pos2 = $pos.pos; before; before = before.lastChild, pos2--) {
    const role = before.type.spec.tableRole;
    if (role == "cell" || role == "header_cell")
      return $pos.doc.resolve(pos2 - before.nodeSize);
  }
}
__name(cellNear, "cellNear");
function pointsAtCell($pos) {
  return $pos.parent.type.spec.tableRole == "row" && !!$pos.nodeAfter;
}
__name(pointsAtCell, "pointsAtCell");
function moveCellForward($pos) {
  return $pos.node(0).resolve($pos.pos + $pos.nodeAfter.nodeSize);
}
__name(moveCellForward, "moveCellForward");
function inSameTable($cellA, $cellB) {
  return $cellA.depth == $cellB.depth && $cellA.pos >= $cellB.start(-1) && $cellA.pos <= $cellB.end(-1);
}
__name(inSameTable, "inSameTable");
function findCell($pos) {
  return TableMap.get($pos.node(-1)).findCell($pos.pos - $pos.start(-1));
}
__name(findCell, "findCell");
function colCount($pos) {
  return TableMap.get($pos.node(-1)).colCount($pos.pos - $pos.start(-1));
}
__name(colCount, "colCount");
function nextCell($pos, axis, dir) {
  const table2 = $pos.node(-1);
  const map3 = TableMap.get(table2);
  const tableStart = $pos.start(-1);
  const moved = map3.nextCell($pos.pos - tableStart, axis, dir);
  return moved == null ? null : $pos.node(0).resolve(tableStart + moved);
}
__name(nextCell, "nextCell");
function removeColSpan(attrs4, pos2, n = 1) {
  const result = { ...attrs4, colspan: attrs4.colspan - n };
  if (result.colwidth) {
    result.colwidth = result.colwidth.slice();
    result.colwidth.splice(pos2, n);
    if (!result.colwidth.some((w) => w > 0))
      result.colwidth = null;
  }
  return result;
}
__name(removeColSpan, "removeColSpan");
function addColSpan(attrs4, pos2, n = 1) {
  const result = { ...attrs4, colspan: attrs4.colspan + n };
  if (result.colwidth) {
    result.colwidth = result.colwidth.slice();
    for (let i2 = 0; i2 < n; i2++)
      result.colwidth.splice(pos2, 0, 0);
  }
  return result;
}
__name(addColSpan, "addColSpan");
function columnIsHeader(map3, table2, col) {
  const headerCell = tableNodeTypes(table2.type.schema).header_cell;
  for (let row = 0; row < map3.height; row++)
    if (table2.nodeAt(map3.map[col + row * map3.width]).type != headerCell)
      return false;
  return true;
}
__name(columnIsHeader, "columnIsHeader");
var CellSelection = class _CellSelection extends Selection {
  static {
    __name(this, "_CellSelection");
  }
  // A table selection is identified by its anchor and head cells. The
  // positions given to this constructor should point _before_ two
  // cells in the same table. They may be the same, to select a single
  // cell.
  constructor($anchorCell, $headCell = $anchorCell) {
    const table2 = $anchorCell.node(-1);
    const map3 = TableMap.get(table2);
    const tableStart = $anchorCell.start(-1);
    const rect = map3.rectBetween(
      $anchorCell.pos - tableStart,
      $headCell.pos - tableStart
    );
    const doc2 = $anchorCell.node(0);
    const cells = map3.cellsInRect(rect).filter((p2) => p2 != $headCell.pos - tableStart);
    cells.unshift($headCell.pos - tableStart);
    const ranges = cells.map((pos2) => {
      const cell = table2.nodeAt(pos2);
      if (!cell) {
        throw RangeError(`No cell with offset ${pos2} found`);
      }
      const from2 = tableStart + pos2 + 1;
      return new SelectionRange(
        doc2.resolve(from2),
        doc2.resolve(from2 + cell.content.size)
      );
    });
    super(ranges[0].$from, ranges[0].$to, ranges);
    this.$anchorCell = $anchorCell;
    this.$headCell = $headCell;
  }
  map(doc2, mapping) {
    const $anchorCell = doc2.resolve(mapping.map(this.$anchorCell.pos));
    const $headCell = doc2.resolve(mapping.map(this.$headCell.pos));
    if (pointsAtCell($anchorCell) && pointsAtCell($headCell) && inSameTable($anchorCell, $headCell)) {
      const tableChanged = this.$anchorCell.node(-1) != $anchorCell.node(-1);
      if (tableChanged && this.isRowSelection())
        return _CellSelection.rowSelection($anchorCell, $headCell);
      else if (tableChanged && this.isColSelection())
        return _CellSelection.colSelection($anchorCell, $headCell);
      else
        return new _CellSelection($anchorCell, $headCell);
    }
    return TextSelection.between($anchorCell, $headCell);
  }
  // Returns a rectangular slice of table rows containing the selected
  // cells.
  content() {
    const table2 = this.$anchorCell.node(-1);
    const map3 = TableMap.get(table2);
    const tableStart = this.$anchorCell.start(-1);
    const rect = map3.rectBetween(
      this.$anchorCell.pos - tableStart,
      this.$headCell.pos - tableStart
    );
    const seen2 = {};
    const rows = [];
    for (let row = rect.top; row < rect.bottom; row++) {
      const rowContent = [];
      for (let index2 = row * map3.width + rect.left, col = rect.left; col < rect.right; col++, index2++) {
        const pos2 = map3.map[index2];
        if (seen2[pos2])
          continue;
        seen2[pos2] = true;
        const cellRect = map3.findCell(pos2);
        let cell = table2.nodeAt(pos2);
        if (!cell) {
          throw RangeError(`No cell with offset ${pos2} found`);
        }
        const extraLeft = rect.left - cellRect.left;
        const extraRight = cellRect.right - rect.right;
        if (extraLeft > 0 || extraRight > 0) {
          let attrs4 = cell.attrs;
          if (extraLeft > 0) {
            attrs4 = removeColSpan(attrs4, 0, extraLeft);
          }
          if (extraRight > 0) {
            attrs4 = removeColSpan(
              attrs4,
              attrs4.colspan - extraRight,
              extraRight
            );
          }
          if (cellRect.left < rect.left) {
            cell = cell.type.createAndFill(attrs4);
            if (!cell) {
              throw RangeError(
                `Could not create cell with attrs ${JSON.stringify(attrs4)}`
              );
            }
          } else {
            cell = cell.type.create(attrs4, cell.content);
          }
        }
        if (cellRect.top < rect.top || cellRect.bottom > rect.bottom) {
          const attrs4 = {
            ...cell.attrs,
            rowspan: Math.min(cellRect.bottom, rect.bottom) - Math.max(cellRect.top, rect.top)
          };
          if (cellRect.top < rect.top) {
            cell = cell.type.createAndFill(attrs4);
          } else {
            cell = cell.type.create(attrs4, cell.content);
          }
        }
        rowContent.push(cell);
      }
      rows.push(table2.child(row).copy(Fragment.from(rowContent)));
    }
    const fragment = this.isColSelection() && this.isRowSelection() ? table2 : rows;
    return new Slice(Fragment.from(fragment), 1, 1);
  }
  replace(tr2, content2 = Slice.empty) {
    const mapFrom = tr2.steps.length, ranges = this.ranges;
    for (let i2 = 0; i2 < ranges.length; i2++) {
      const { $from, $to } = ranges[i2], mapping = tr2.mapping.slice(mapFrom);
      tr2.replace(
        mapping.map($from.pos),
        mapping.map($to.pos),
        i2 ? Slice.empty : content2
      );
    }
    const sel = Selection.findFrom(
      tr2.doc.resolve(tr2.mapping.slice(mapFrom).map(this.to)),
      -1
    );
    if (sel)
      tr2.setSelection(sel);
  }
  replaceWith(tr2, node3) {
    this.replace(tr2, new Slice(Fragment.from(node3), 0, 0));
  }
  forEachCell(f) {
    const table2 = this.$anchorCell.node(-1);
    const map3 = TableMap.get(table2);
    const tableStart = this.$anchorCell.start(-1);
    const cells = map3.cellsInRect(
      map3.rectBetween(
        this.$anchorCell.pos - tableStart,
        this.$headCell.pos - tableStart
      )
    );
    for (let i2 = 0; i2 < cells.length; i2++) {
      f(table2.nodeAt(cells[i2]), tableStart + cells[i2]);
    }
  }
  // True if this selection goes all the way from the top to the
  // bottom of the table.
  isColSelection() {
    const anchorTop = this.$anchorCell.index(-1);
    const headTop = this.$headCell.index(-1);
    if (Math.min(anchorTop, headTop) > 0)
      return false;
    const anchorBottom = anchorTop + this.$anchorCell.nodeAfter.attrs.rowspan;
    const headBottom = headTop + this.$headCell.nodeAfter.attrs.rowspan;
    return Math.max(anchorBottom, headBottom) == this.$headCell.node(-1).childCount;
  }
  // Returns the smallest column selection that covers the given anchor
  // and head cell.
  static colSelection($anchorCell, $headCell = $anchorCell) {
    const table2 = $anchorCell.node(-1);
    const map3 = TableMap.get(table2);
    const tableStart = $anchorCell.start(-1);
    const anchorRect = map3.findCell($anchorCell.pos - tableStart);
    const headRect = map3.findCell($headCell.pos - tableStart);
    const doc2 = $anchorCell.node(0);
    if (anchorRect.top <= headRect.top) {
      if (anchorRect.top > 0)
        $anchorCell = doc2.resolve(tableStart + map3.map[anchorRect.left]);
      if (headRect.bottom < map3.height)
        $headCell = doc2.resolve(
          tableStart + map3.map[map3.width * (map3.height - 1) + headRect.right - 1]
        );
    } else {
      if (headRect.top > 0)
        $headCell = doc2.resolve(tableStart + map3.map[headRect.left]);
      if (anchorRect.bottom < map3.height)
        $anchorCell = doc2.resolve(
          tableStart + map3.map[map3.width * (map3.height - 1) + anchorRect.right - 1]
        );
    }
    return new _CellSelection($anchorCell, $headCell);
  }
  // True if this selection goes all the way from the left to the
  // right of the table.
  isRowSelection() {
    const table2 = this.$anchorCell.node(-1);
    const map3 = TableMap.get(table2);
    const tableStart = this.$anchorCell.start(-1);
    const anchorLeft = map3.colCount(this.$anchorCell.pos - tableStart);
    const headLeft = map3.colCount(this.$headCell.pos - tableStart);
    if (Math.min(anchorLeft, headLeft) > 0)
      return false;
    const anchorRight = anchorLeft + this.$anchorCell.nodeAfter.attrs.colspan;
    const headRight = headLeft + this.$headCell.nodeAfter.attrs.colspan;
    return Math.max(anchorRight, headRight) == map3.width;
  }
  eq(other) {
    return other instanceof _CellSelection && other.$anchorCell.pos == this.$anchorCell.pos && other.$headCell.pos == this.$headCell.pos;
  }
  // Returns the smallest row selection that covers the given anchor
  // and head cell.
  static rowSelection($anchorCell, $headCell = $anchorCell) {
    const table2 = $anchorCell.node(-1);
    const map3 = TableMap.get(table2);
    const tableStart = $anchorCell.start(-1);
    const anchorRect = map3.findCell($anchorCell.pos - tableStart);
    const headRect = map3.findCell($headCell.pos - tableStart);
    const doc2 = $anchorCell.node(0);
    if (anchorRect.left <= headRect.left) {
      if (anchorRect.left > 0)
        $anchorCell = doc2.resolve(
          tableStart + map3.map[anchorRect.top * map3.width]
        );
      if (headRect.right < map3.width)
        $headCell = doc2.resolve(
          tableStart + map3.map[map3.width * (headRect.top + 1) - 1]
        );
    } else {
      if (headRect.left > 0)
        $headCell = doc2.resolve(tableStart + map3.map[headRect.top * map3.width]);
      if (anchorRect.right < map3.width)
        $anchorCell = doc2.resolve(
          tableStart + map3.map[map3.width * (anchorRect.top + 1) - 1]
        );
    }
    return new _CellSelection($anchorCell, $headCell);
  }
  toJSON() {
    return {
      type: "cell",
      anchor: this.$anchorCell.pos,
      head: this.$headCell.pos
    };
  }
  static fromJSON(doc2, json) {
    return new _CellSelection(doc2.resolve(json.anchor), doc2.resolve(json.head));
  }
  static create(doc2, anchorCell, headCell = anchorCell) {
    return new _CellSelection(doc2.resolve(anchorCell), doc2.resolve(headCell));
  }
  getBookmark() {
    return new CellBookmark(this.$anchorCell.pos, this.$headCell.pos);
  }
};
CellSelection.prototype.visible = false;
Selection.jsonID("cell", CellSelection);
var CellBookmark = class _CellBookmark {
  static {
    __name(this, "_CellBookmark");
  }
  constructor(anchor, head) {
    this.anchor = anchor;
    this.head = head;
  }
  map(mapping) {
    return new _CellBookmark(mapping.map(this.anchor), mapping.map(this.head));
  }
  resolve(doc2) {
    const $anchorCell = doc2.resolve(this.anchor), $headCell = doc2.resolve(this.head);
    if ($anchorCell.parent.type.spec.tableRole == "row" && $headCell.parent.type.spec.tableRole == "row" && $anchorCell.index() < $anchorCell.parent.childCount && $headCell.index() < $headCell.parent.childCount && inSameTable($anchorCell, $headCell))
      return new CellSelection($anchorCell, $headCell);
    else
      return Selection.near($headCell, 1);
  }
};
function drawCellSelection(state) {
  if (!(state.selection instanceof CellSelection))
    return null;
  const cells = [];
  state.selection.forEachCell((node3, pos2) => {
    cells.push(
      Decoration.node(pos2, pos2 + node3.nodeSize, { class: "selectedCell" })
    );
  });
  return DecorationSet.create(state.doc, cells);
}
__name(drawCellSelection, "drawCellSelection");
function isCellBoundarySelection({ $from, $to }) {
  if ($from.pos == $to.pos || $from.pos < $to.pos - 6)
    return false;
  let afterFrom = $from.pos;
  let beforeTo = $to.pos;
  let depth = $from.depth;
  for (; depth >= 0; depth--, afterFrom++)
    if ($from.after(depth + 1) < $from.end(depth))
      break;
  for (let d = $to.depth; d >= 0; d--, beforeTo--)
    if ($to.before(d + 1) > $to.start(d))
      break;
  return afterFrom == beforeTo && /row|table/.test($from.node(depth).type.spec.tableRole);
}
__name(isCellBoundarySelection, "isCellBoundarySelection");
function isTextSelectionAcrossCells({ $from, $to }) {
  let fromCellBoundaryNode;
  let toCellBoundaryNode;
  for (let i2 = $from.depth; i2 > 0; i2--) {
    const node3 = $from.node(i2);
    if (node3.type.spec.tableRole === "cell" || node3.type.spec.tableRole === "header_cell") {
      fromCellBoundaryNode = node3;
      break;
    }
  }
  for (let i2 = $to.depth; i2 > 0; i2--) {
    const node3 = $to.node(i2);
    if (node3.type.spec.tableRole === "cell" || node3.type.spec.tableRole === "header_cell") {
      toCellBoundaryNode = node3;
      break;
    }
  }
  return fromCellBoundaryNode !== toCellBoundaryNode && $to.parentOffset === 0;
}
__name(isTextSelectionAcrossCells, "isTextSelectionAcrossCells");
function normalizeSelection(state, tr2, allowTableNodeSelection) {
  const sel = (tr2 || state).selection;
  const doc2 = (tr2 || state).doc;
  let normalize3;
  let role;
  if (sel instanceof NodeSelection && (role = sel.node.type.spec.tableRole)) {
    if (role == "cell" || role == "header_cell") {
      normalize3 = CellSelection.create(doc2, sel.from);
    } else if (role == "row") {
      const $cell = doc2.resolve(sel.from + 1);
      normalize3 = CellSelection.rowSelection($cell, $cell);
    } else if (!allowTableNodeSelection) {
      const map3 = TableMap.get(sel.node);
      const start2 = sel.from + 1;
      const lastCell = start2 + map3.map[map3.width * map3.height - 1];
      normalize3 = CellSelection.create(doc2, start2 + 1, lastCell);
    }
  } else if (sel instanceof TextSelection && isCellBoundarySelection(sel)) {
    normalize3 = TextSelection.create(doc2, sel.from);
  } else if (sel instanceof TextSelection && isTextSelectionAcrossCells(sel)) {
    normalize3 = TextSelection.create(doc2, sel.$from.start(), sel.$from.end());
  }
  if (normalize3)
    (tr2 || (tr2 = state.tr)).setSelection(normalize3);
  return tr2;
}
__name(normalizeSelection, "normalizeSelection");
var fixTablesKey = new PluginKey("fix-tables");
function changedDescendants(old, cur, offset, f) {
  const oldSize = old.childCount, curSize = cur.childCount;
  outer:
    for (let i2 = 0, j = 0; i2 < curSize; i2++) {
      const child = cur.child(i2);
      for (let scan = j, e2 = Math.min(oldSize, i2 + 3); scan < e2; scan++) {
        if (old.child(scan) == child) {
          j = scan + 1;
          offset += child.nodeSize;
          continue outer;
        }
      }
      f(child, offset);
      if (j < oldSize && old.child(j).sameMarkup(child))
        changedDescendants(old.child(j), child, offset + 1, f);
      else
        child.nodesBetween(0, child.content.size, f, offset + 1);
      offset += child.nodeSize;
    }
}
__name(changedDescendants, "changedDescendants");
function fixTables(state, oldState) {
  let tr2;
  const check = /* @__PURE__ */ __name((node3, pos2) => {
    if (node3.type.spec.tableRole == "table")
      tr2 = fixTable(state, node3, pos2, tr2);
  }, "check");
  if (!oldState)
    state.doc.descendants(check);
  else if (oldState.doc != state.doc)
    changedDescendants(oldState.doc, state.doc, 0, check);
  return tr2;
}
__name(fixTables, "fixTables");
function fixTable(state, table2, tablePos, tr2) {
  const map3 = TableMap.get(table2);
  if (!map3.problems)
    return tr2;
  if (!tr2)
    tr2 = state.tr;
  const mustAdd = [];
  for (let i2 = 0; i2 < map3.height; i2++)
    mustAdd.push(0);
  for (let i2 = 0; i2 < map3.problems.length; i2++) {
    const prob = map3.problems[i2];
    if (prob.type == "collision") {
      const cell = table2.nodeAt(prob.pos);
      if (!cell)
        continue;
      const attrs4 = cell.attrs;
      for (let j = 0; j < attrs4.rowspan; j++)
        mustAdd[prob.row + j] += prob.n;
      tr2.setNodeMarkup(
        tr2.mapping.map(tablePos + 1 + prob.pos),
        null,
        removeColSpan(attrs4, attrs4.colspan - prob.n, prob.n)
      );
    } else if (prob.type == "missing") {
      mustAdd[prob.row] += prob.n;
    } else if (prob.type == "overlong_rowspan") {
      const cell = table2.nodeAt(prob.pos);
      if (!cell)
        continue;
      tr2.setNodeMarkup(tr2.mapping.map(tablePos + 1 + prob.pos), null, {
        ...cell.attrs,
        rowspan: cell.attrs.rowspan - prob.n
      });
    } else if (prob.type == "colwidth mismatch") {
      const cell = table2.nodeAt(prob.pos);
      if (!cell)
        continue;
      tr2.setNodeMarkup(tr2.mapping.map(tablePos + 1 + prob.pos), null, {
        ...cell.attrs,
        colwidth: prob.colwidth
      });
    }
  }
  let first2, last;
  for (let i2 = 0; i2 < mustAdd.length; i2++)
    if (mustAdd[i2]) {
      if (first2 == null)
        first2 = i2;
      last = i2;
    }
  for (let i2 = 0, pos2 = tablePos + 1; i2 < map3.height; i2++) {
    const row = table2.child(i2);
    const end = pos2 + row.nodeSize;
    const add3 = mustAdd[i2];
    if (add3 > 0) {
      let role = "cell";
      if (row.firstChild) {
        role = row.firstChild.type.spec.tableRole;
      }
      const nodes = [];
      for (let j = 0; j < add3; j++) {
        const node3 = tableNodeTypes(state.schema)[role].createAndFill();
        if (node3)
          nodes.push(node3);
      }
      const side = (i2 == 0 || first2 == i2 - 1) && last == i2 ? pos2 + 1 : end - 1;
      tr2.insert(tr2.mapping.map(side), nodes);
    }
    pos2 = end;
  }
  return tr2.setMeta(fixTablesKey, { fixTables: true });
}
__name(fixTable, "fixTable");
function selectedRect(state) {
  const sel = state.selection;
  const $pos = selectionCell(state);
  const table2 = $pos.node(-1);
  const tableStart = $pos.start(-1);
  const map3 = TableMap.get(table2);
  const rect = sel instanceof CellSelection ? map3.rectBetween(
    sel.$anchorCell.pos - tableStart,
    sel.$headCell.pos - tableStart
  ) : map3.findCell($pos.pos - tableStart);
  return { ...rect, tableStart, map: map3, table: table2 };
}
__name(selectedRect, "selectedRect");
function addColumn(tr2, { map: map3, tableStart, table: table2 }, col) {
  let refColumn = col > 0 ? -1 : 0;
  if (columnIsHeader(map3, table2, col + refColumn)) {
    refColumn = col == 0 || col == map3.width ? null : 0;
  }
  for (let row = 0; row < map3.height; row++) {
    const index2 = row * map3.width + col;
    if (col > 0 && col < map3.width && map3.map[index2 - 1] == map3.map[index2]) {
      const pos2 = map3.map[index2];
      const cell = table2.nodeAt(pos2);
      tr2.setNodeMarkup(
        tr2.mapping.map(tableStart + pos2),
        null,
        addColSpan(cell.attrs, col - map3.colCount(pos2))
      );
      row += cell.attrs.rowspan - 1;
    } else {
      const type = refColumn == null ? tableNodeTypes(table2.type.schema).cell : table2.nodeAt(map3.map[index2 + refColumn]).type;
      const pos2 = map3.positionAt(row, col, table2);
      tr2.insert(tr2.mapping.map(tableStart + pos2), type.createAndFill());
    }
  }
  return tr2;
}
__name(addColumn, "addColumn");
function addColumnBefore(state, dispatch) {
  if (!isInTable(state))
    return false;
  if (dispatch) {
    const rect = selectedRect(state);
    dispatch(addColumn(state.tr, rect, rect.left));
  }
  return true;
}
__name(addColumnBefore, "addColumnBefore");
function addColumnAfter(state, dispatch) {
  if (!isInTable(state))
    return false;
  if (dispatch) {
    const rect = selectedRect(state);
    dispatch(addColumn(state.tr, rect, rect.right));
  }
  return true;
}
__name(addColumnAfter, "addColumnAfter");
function removeColumn(tr2, { map: map3, table: table2, tableStart }, col) {
  const mapStart = tr2.mapping.maps.length;
  for (let row = 0; row < map3.height; ) {
    const index2 = row * map3.width + col;
    const pos2 = map3.map[index2];
    const cell = table2.nodeAt(pos2);
    const attrs4 = cell.attrs;
    if (col > 0 && map3.map[index2 - 1] == pos2 || col < map3.width - 1 && map3.map[index2 + 1] == pos2) {
      tr2.setNodeMarkup(
        tr2.mapping.slice(mapStart).map(tableStart + pos2),
        null,
        removeColSpan(attrs4, col - map3.colCount(pos2))
      );
    } else {
      const start2 = tr2.mapping.slice(mapStart).map(tableStart + pos2);
      tr2.delete(start2, start2 + cell.nodeSize);
    }
    row += attrs4.rowspan;
  }
}
__name(removeColumn, "removeColumn");
function deleteColumn(state, dispatch) {
  if (!isInTable(state))
    return false;
  if (dispatch) {
    const rect = selectedRect(state);
    const tr2 = state.tr;
    if (rect.left == 0 && rect.right == rect.map.width)
      return false;
    for (let i2 = rect.right - 1; ; i2--) {
      removeColumn(tr2, rect, i2);
      if (i2 == rect.left)
        break;
      const table2 = rect.tableStart ? tr2.doc.nodeAt(rect.tableStart - 1) : tr2.doc;
      if (!table2) {
        throw RangeError("No table found");
      }
      rect.table = table2;
      rect.map = TableMap.get(table2);
    }
    dispatch(tr2);
  }
  return true;
}
__name(deleteColumn, "deleteColumn");
function rowIsHeader(map3, table2, row) {
  var _a2;
  const headerCell = tableNodeTypes(table2.type.schema).header_cell;
  for (let col = 0; col < map3.width; col++)
    if (((_a2 = table2.nodeAt(map3.map[col + row * map3.width])) == null ? void 0 : _a2.type) != headerCell)
      return false;
  return true;
}
__name(rowIsHeader, "rowIsHeader");
function addRow(tr2, { map: map3, tableStart, table: table2 }, row) {
  var _a2;
  let rowPos = tableStart;
  for (let i2 = 0; i2 < row; i2++)
    rowPos += table2.child(i2).nodeSize;
  const cells = [];
  let refRow = row > 0 ? -1 : 0;
  if (rowIsHeader(map3, table2, row + refRow))
    refRow = row == 0 || row == map3.height ? null : 0;
  for (let col = 0, index2 = map3.width * row; col < map3.width; col++, index2++) {
    if (row > 0 && row < map3.height && map3.map[index2] == map3.map[index2 - map3.width]) {
      const pos2 = map3.map[index2];
      const attrs4 = table2.nodeAt(pos2).attrs;
      tr2.setNodeMarkup(tableStart + pos2, null, {
        ...attrs4,
        rowspan: attrs4.rowspan + 1
      });
      col += attrs4.colspan - 1;
    } else {
      const type = refRow == null ? tableNodeTypes(table2.type.schema).cell : (_a2 = table2.nodeAt(map3.map[index2 + refRow * map3.width])) == null ? void 0 : _a2.type;
      const node3 = type == null ? void 0 : type.createAndFill();
      if (node3)
        cells.push(node3);
    }
  }
  tr2.insert(rowPos, tableNodeTypes(table2.type.schema).row.create(null, cells));
  return tr2;
}
__name(addRow, "addRow");
function addRowBefore(state, dispatch) {
  if (!isInTable(state))
    return false;
  if (dispatch) {
    const rect = selectedRect(state);
    dispatch(addRow(state.tr, rect, rect.top));
  }
  return true;
}
__name(addRowBefore, "addRowBefore");
function addRowAfter(state, dispatch) {
  if (!isInTable(state))
    return false;
  if (dispatch) {
    const rect = selectedRect(state);
    dispatch(addRow(state.tr, rect, rect.bottom));
  }
  return true;
}
__name(addRowAfter, "addRowAfter");
function removeRow(tr2, { map: map3, table: table2, tableStart }, row) {
  let rowPos = 0;
  for (let i2 = 0; i2 < row; i2++)
    rowPos += table2.child(i2).nodeSize;
  const nextRow = rowPos + table2.child(row).nodeSize;
  const mapFrom = tr2.mapping.maps.length;
  tr2.delete(rowPos + tableStart, nextRow + tableStart);
  const seen2 = /* @__PURE__ */ new Set();
  for (let col = 0, index2 = row * map3.width; col < map3.width; col++, index2++) {
    const pos2 = map3.map[index2];
    if (seen2.has(pos2))
      continue;
    seen2.add(pos2);
    if (row > 0 && pos2 == map3.map[index2 - map3.width]) {
      const attrs4 = table2.nodeAt(pos2).attrs;
      tr2.setNodeMarkup(tr2.mapping.slice(mapFrom).map(pos2 + tableStart), null, {
        ...attrs4,
        rowspan: attrs4.rowspan - 1
      });
      col += attrs4.colspan - 1;
    } else if (row < map3.height && pos2 == map3.map[index2 + map3.width]) {
      const cell = table2.nodeAt(pos2);
      const attrs4 = cell.attrs;
      const copy2 = cell.type.create(
        { ...attrs4, rowspan: cell.attrs.rowspan - 1 },
        cell.content
      );
      const newPos = map3.positionAt(row + 1, col, table2);
      tr2.insert(tr2.mapping.slice(mapFrom).map(tableStart + newPos), copy2);
      col += attrs4.colspan - 1;
    }
  }
}
__name(removeRow, "removeRow");
function deleteRow(state, dispatch) {
  if (!isInTable(state))
    return false;
  if (dispatch) {
    const rect = selectedRect(state), tr2 = state.tr;
    if (rect.top == 0 && rect.bottom == rect.map.height)
      return false;
    for (let i2 = rect.bottom - 1; ; i2--) {
      removeRow(tr2, rect, i2);
      if (i2 == rect.top)
        break;
      const table2 = rect.tableStart ? tr2.doc.nodeAt(rect.tableStart - 1) : tr2.doc;
      if (!table2) {
        throw RangeError("No table found");
      }
      rect.table = table2;
      rect.map = TableMap.get(rect.table);
    }
    dispatch(tr2);
  }
  return true;
}
__name(deleteRow, "deleteRow");
function isEmpty(cell) {
  const c = cell.content;
  return c.childCount == 1 && c.child(0).isTextblock && c.child(0).childCount == 0;
}
__name(isEmpty, "isEmpty");
function cellsOverlapRectangle({ width: width2, height, map: map3 }, rect) {
  let indexTop = rect.top * width2 + rect.left, indexLeft = indexTop;
  let indexBottom = (rect.bottom - 1) * width2 + rect.left, indexRight = indexTop + (rect.right - rect.left - 1);
  for (let i2 = rect.top; i2 < rect.bottom; i2++) {
    if (rect.left > 0 && map3[indexLeft] == map3[indexLeft - 1] || rect.right < width2 && map3[indexRight] == map3[indexRight + 1])
      return true;
    indexLeft += width2;
    indexRight += width2;
  }
  for (let i2 = rect.left; i2 < rect.right; i2++) {
    if (rect.top > 0 && map3[indexTop] == map3[indexTop - width2] || rect.bottom < height && map3[indexBottom] == map3[indexBottom + width2])
      return true;
    indexTop++;
    indexBottom++;
  }
  return false;
}
__name(cellsOverlapRectangle, "cellsOverlapRectangle");
function mergeCells(state, dispatch) {
  const sel = state.selection;
  if (!(sel instanceof CellSelection) || sel.$anchorCell.pos == sel.$headCell.pos)
    return false;
  const rect = selectedRect(state), { map: map3 } = rect;
  if (cellsOverlapRectangle(map3, rect))
    return false;
  if (dispatch) {
    const tr2 = state.tr;
    const seen2 = {};
    let content2 = Fragment.empty;
    let mergedPos;
    let mergedCell;
    for (let row = rect.top; row < rect.bottom; row++) {
      for (let col = rect.left; col < rect.right; col++) {
        const cellPos = map3.map[row * map3.width + col];
        const cell = rect.table.nodeAt(cellPos);
        if (seen2[cellPos] || !cell)
          continue;
        seen2[cellPos] = true;
        if (mergedPos == null) {
          mergedPos = cellPos;
          mergedCell = cell;
        } else {
          if (!isEmpty(cell))
            content2 = content2.append(cell.content);
          const mapped = tr2.mapping.map(cellPos + rect.tableStart);
          tr2.delete(mapped, mapped + cell.nodeSize);
        }
      }
    }
    if (mergedPos == null || mergedCell == null) {
      return true;
    }
    tr2.setNodeMarkup(mergedPos + rect.tableStart, null, {
      ...addColSpan(
        mergedCell.attrs,
        mergedCell.attrs.colspan,
        rect.right - rect.left - mergedCell.attrs.colspan
      ),
      rowspan: rect.bottom - rect.top
    });
    if (content2.size) {
      const end = mergedPos + 1 + mergedCell.content.size;
      const start2 = isEmpty(mergedCell) ? mergedPos + 1 : end;
      tr2.replaceWith(start2 + rect.tableStart, end + rect.tableStart, content2);
    }
    tr2.setSelection(
      new CellSelection(tr2.doc.resolve(mergedPos + rect.tableStart))
    );
    dispatch(tr2);
  }
  return true;
}
__name(mergeCells, "mergeCells");
function splitCell(state, dispatch) {
  const nodeTypes = tableNodeTypes(state.schema);
  return splitCellWithType(({ node: node3 }) => {
    return nodeTypes[node3.type.spec.tableRole];
  })(state, dispatch);
}
__name(splitCell, "splitCell");
function splitCellWithType(getCellType) {
  return (state, dispatch) => {
    var _a2;
    const sel = state.selection;
    let cellNode;
    let cellPos;
    if (!(sel instanceof CellSelection)) {
      cellNode = cellWrapping(sel.$from);
      if (!cellNode)
        return false;
      cellPos = (_a2 = cellAround(sel.$from)) == null ? void 0 : _a2.pos;
    } else {
      if (sel.$anchorCell.pos != sel.$headCell.pos)
        return false;
      cellNode = sel.$anchorCell.nodeAfter;
      cellPos = sel.$anchorCell.pos;
    }
    if (cellNode == null || cellPos == null) {
      return false;
    }
    if (cellNode.attrs.colspan == 1 && cellNode.attrs.rowspan == 1) {
      return false;
    }
    if (dispatch) {
      let baseAttrs = cellNode.attrs;
      const attrs4 = [];
      const colwidth = baseAttrs.colwidth;
      if (baseAttrs.rowspan > 1)
        baseAttrs = { ...baseAttrs, rowspan: 1 };
      if (baseAttrs.colspan > 1)
        baseAttrs = { ...baseAttrs, colspan: 1 };
      const rect = selectedRect(state), tr2 = state.tr;
      for (let i2 = 0; i2 < rect.right - rect.left; i2++)
        attrs4.push(
          colwidth ? {
            ...baseAttrs,
            colwidth: colwidth && colwidth[i2] ? [colwidth[i2]] : null
          } : baseAttrs
        );
      let lastCell;
      for (let row = rect.top; row < rect.bottom; row++) {
        let pos2 = rect.map.positionAt(row, rect.left, rect.table);
        if (row == rect.top)
          pos2 += cellNode.nodeSize;
        for (let col = rect.left, i2 = 0; col < rect.right; col++, i2++) {
          if (col == rect.left && row == rect.top)
            continue;
          tr2.insert(
            lastCell = tr2.mapping.map(pos2 + rect.tableStart, 1),
            getCellType({ node: cellNode, row, col }).createAndFill(attrs4[i2])
          );
        }
      }
      tr2.setNodeMarkup(
        cellPos,
        getCellType({ node: cellNode, row: rect.top, col: rect.left }),
        attrs4[0]
      );
      if (sel instanceof CellSelection)
        tr2.setSelection(
          new CellSelection(
            tr2.doc.resolve(sel.$anchorCell.pos),
            lastCell ? tr2.doc.resolve(lastCell) : void 0
          )
        );
      dispatch(tr2);
    }
    return true;
  };
}
__name(splitCellWithType, "splitCellWithType");
function setCellAttr(name2, value4) {
  return function(state, dispatch) {
    if (!isInTable(state))
      return false;
    const $cell = selectionCell(state);
    if ($cell.nodeAfter.attrs[name2] === value4)
      return false;
    if (dispatch) {
      const tr2 = state.tr;
      if (state.selection instanceof CellSelection)
        state.selection.forEachCell((node3, pos2) => {
          if (node3.attrs[name2] !== value4)
            tr2.setNodeMarkup(pos2, null, {
              ...node3.attrs,
              [name2]: value4
            });
        });
      else
        tr2.setNodeMarkup($cell.pos, null, {
          ...$cell.nodeAfter.attrs,
          [name2]: value4
        });
      dispatch(tr2);
    }
    return true;
  };
}
__name(setCellAttr, "setCellAttr");
function deprecated_toggleHeader(type) {
  return function(state, dispatch) {
    if (!isInTable(state))
      return false;
    if (dispatch) {
      const types = tableNodeTypes(state.schema);
      const rect = selectedRect(state), tr2 = state.tr;
      const cells = rect.map.cellsInRect(
        type == "column" ? {
          left: rect.left,
          top: 0,
          right: rect.right,
          bottom: rect.map.height
        } : type == "row" ? {
          left: 0,
          top: rect.top,
          right: rect.map.width,
          bottom: rect.bottom
        } : rect
      );
      const nodes = cells.map((pos2) => rect.table.nodeAt(pos2));
      for (let i2 = 0; i2 < cells.length; i2++)
        if (nodes[i2].type == types.header_cell)
          tr2.setNodeMarkup(
            rect.tableStart + cells[i2],
            types.cell,
            nodes[i2].attrs
          );
      if (tr2.steps.length == 0)
        for (let i2 = 0; i2 < cells.length; i2++)
          tr2.setNodeMarkup(
            rect.tableStart + cells[i2],
            types.header_cell,
            nodes[i2].attrs
          );
      dispatch(tr2);
    }
    return true;
  };
}
__name(deprecated_toggleHeader, "deprecated_toggleHeader");
function isHeaderEnabledByType(type, rect, types) {
  const cellPositions = rect.map.cellsInRect({
    left: 0,
    top: 0,
    right: type == "row" ? rect.map.width : 1,
    bottom: type == "column" ? rect.map.height : 1
  });
  for (let i2 = 0; i2 < cellPositions.length; i2++) {
    const cell = rect.table.nodeAt(cellPositions[i2]);
    if (cell && cell.type !== types.header_cell) {
      return false;
    }
  }
  return true;
}
__name(isHeaderEnabledByType, "isHeaderEnabledByType");
function toggleHeader(type, options4) {
  options4 = options4 || { useDeprecatedLogic: false };
  if (options4.useDeprecatedLogic)
    return deprecated_toggleHeader(type);
  return function(state, dispatch) {
    if (!isInTable(state))
      return false;
    if (dispatch) {
      const types = tableNodeTypes(state.schema);
      const rect = selectedRect(state), tr2 = state.tr;
      const isHeaderRowEnabled = isHeaderEnabledByType("row", rect, types);
      const isHeaderColumnEnabled = isHeaderEnabledByType(
        "column",
        rect,
        types
      );
      const isHeaderEnabled = type === "column" ? isHeaderRowEnabled : type === "row" ? isHeaderColumnEnabled : false;
      const selectionStartsAt = isHeaderEnabled ? 1 : 0;
      const cellsRect = type == "column" ? {
        left: 0,
        top: selectionStartsAt,
        right: 1,
        bottom: rect.map.height
      } : type == "row" ? {
        left: selectionStartsAt,
        top: 0,
        right: rect.map.width,
        bottom: 1
      } : rect;
      const newType = type == "column" ? isHeaderColumnEnabled ? types.cell : types.header_cell : type == "row" ? isHeaderRowEnabled ? types.cell : types.header_cell : types.cell;
      rect.map.cellsInRect(cellsRect).forEach((relativeCellPos) => {
        const cellPos = relativeCellPos + rect.tableStart;
        const cell = tr2.doc.nodeAt(cellPos);
        if (cell) {
          tr2.setNodeMarkup(cellPos, newType, cell.attrs);
        }
      });
      dispatch(tr2);
    }
    return true;
  };
}
__name(toggleHeader, "toggleHeader");
var toggleHeaderRow = toggleHeader("row", {
  useDeprecatedLogic: true
});
var toggleHeaderColumn = toggleHeader("column", {
  useDeprecatedLogic: true
});
var toggleHeaderCell = toggleHeader("cell", {
  useDeprecatedLogic: true
});
function findNextCell($cell, dir) {
  if (dir < 0) {
    const before = $cell.nodeBefore;
    if (before)
      return $cell.pos - before.nodeSize;
    for (let row = $cell.index(-1) - 1, rowEnd = $cell.before(); row >= 0; row--) {
      const rowNode = $cell.node(-1).child(row);
      const lastChild = rowNode.lastChild;
      if (lastChild) {
        return rowEnd - 1 - lastChild.nodeSize;
      }
      rowEnd -= rowNode.nodeSize;
    }
  } else {
    if ($cell.index() < $cell.parent.childCount - 1) {
      return $cell.pos + $cell.nodeAfter.nodeSize;
    }
    const table2 = $cell.node(-1);
    for (let row = $cell.indexAfter(-1), rowStart = $cell.after(); row < table2.childCount; row++) {
      const rowNode = table2.child(row);
      if (rowNode.childCount)
        return rowStart + 1;
      rowStart += rowNode.nodeSize;
    }
  }
  return null;
}
__name(findNextCell, "findNextCell");
function goToNextCell(direction) {
  return function(state, dispatch) {
    if (!isInTable(state))
      return false;
    const cell = findNextCell(selectionCell(state), direction);
    if (cell == null)
      return false;
    if (dispatch) {
      const $cell = state.doc.resolve(cell);
      dispatch(
        state.tr.setSelection(TextSelection.between($cell, moveCellForward($cell))).scrollIntoView()
      );
    }
    return true;
  };
}
__name(goToNextCell, "goToNextCell");
function deleteTable(state, dispatch) {
  const $pos = state.selection.$anchor;
  for (let d = $pos.depth; d > 0; d--) {
    const node3 = $pos.node(d);
    if (node3.type.spec.tableRole == "table") {
      if (dispatch)
        dispatch(
          state.tr.delete($pos.before(d), $pos.after(d)).scrollIntoView()
        );
      return true;
    }
  }
  return false;
}
__name(deleteTable, "deleteTable");
function deleteCellSelection(state, dispatch) {
  const sel = state.selection;
  if (!(sel instanceof CellSelection))
    return false;
  if (dispatch) {
    const tr2 = state.tr;
    const baseContent = tableNodeTypes(state.schema).cell.createAndFill().content;
    sel.forEachCell((cell, pos2) => {
      if (!cell.content.eq(baseContent))
        tr2.replace(
          tr2.mapping.map(pos2 + 1),
          tr2.mapping.map(pos2 + cell.nodeSize - 1),
          new Slice(baseContent, 0, 0)
        );
    });
    if (tr2.docChanged)
      dispatch(tr2);
  }
  return true;
}
__name(deleteCellSelection, "deleteCellSelection");
function pastedCells(slice2) {
  if (!slice2.size)
    return null;
  let { content: content2, openStart, openEnd } = slice2;
  while (content2.childCount == 1 && (openStart > 0 && openEnd > 0 || content2.child(0).type.spec.tableRole == "table")) {
    openStart--;
    openEnd--;
    content2 = content2.child(0).content;
  }
  const first2 = content2.child(0);
  const role = first2.type.spec.tableRole;
  const schema2 = first2.type.schema, rows = [];
  if (role == "row") {
    for (let i2 = 0; i2 < content2.childCount; i2++) {
      let cells = content2.child(i2).content;
      const left = i2 ? 0 : Math.max(0, openStart - 1);
      const right = i2 < content2.childCount - 1 ? 0 : Math.max(0, openEnd - 1);
      if (left || right)
        cells = fitSlice(
          tableNodeTypes(schema2).row,
          new Slice(cells, left, right)
        ).content;
      rows.push(cells);
    }
  } else if (role == "cell" || role == "header_cell") {
    rows.push(
      openStart || openEnd ? fitSlice(
        tableNodeTypes(schema2).row,
        new Slice(content2, openStart, openEnd)
      ).content : content2
    );
  } else {
    return null;
  }
  return ensureRectangular(schema2, rows);
}
__name(pastedCells, "pastedCells");
function ensureRectangular(schema2, rows) {
  const widths = [];
  for (let i2 = 0; i2 < rows.length; i2++) {
    const row = rows[i2];
    for (let j = row.childCount - 1; j >= 0; j--) {
      const { rowspan, colspan } = row.child(j).attrs;
      for (let r = i2; r < i2 + rowspan; r++)
        widths[r] = (widths[r] || 0) + colspan;
    }
  }
  let width2 = 0;
  for (let r = 0; r < widths.length; r++)
    width2 = Math.max(width2, widths[r]);
  for (let r = 0; r < widths.length; r++) {
    if (r >= rows.length)
      rows.push(Fragment.empty);
    if (widths[r] < width2) {
      const empty3 = tableNodeTypes(schema2).cell.createAndFill();
      const cells = [];
      for (let i2 = widths[r]; i2 < width2; i2++) {
        cells.push(empty3);
      }
      rows[r] = rows[r].append(Fragment.from(cells));
    }
  }
  return { height: rows.length, width: width2, rows };
}
__name(ensureRectangular, "ensureRectangular");
function fitSlice(nodeType, slice2) {
  const node3 = nodeType.createAndFill();
  const tr2 = new Transform(node3).replace(0, node3.content.size, slice2);
  return tr2.doc;
}
__name(fitSlice, "fitSlice");
function clipCells({ width: width2, height, rows }, newWidth, newHeight) {
  if (width2 != newWidth) {
    const added = [];
    const newRows = [];
    for (let row = 0; row < rows.length; row++) {
      const frag = rows[row], cells = [];
      for (let col = added[row] || 0, i2 = 0; col < newWidth; i2++) {
        let cell = frag.child(i2 % frag.childCount);
        if (col + cell.attrs.colspan > newWidth)
          cell = cell.type.createChecked(
            removeColSpan(
              cell.attrs,
              cell.attrs.colspan,
              col + cell.attrs.colspan - newWidth
            ),
            cell.content
          );
        cells.push(cell);
        col += cell.attrs.colspan;
        for (let j = 1; j < cell.attrs.rowspan; j++)
          added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
      }
      newRows.push(Fragment.from(cells));
    }
    rows = newRows;
    width2 = newWidth;
  }
  if (height != newHeight) {
    const newRows = [];
    for (let row = 0, i2 = 0; row < newHeight; row++, i2++) {
      const cells = [], source = rows[i2 % height];
      for (let j = 0; j < source.childCount; j++) {
        let cell = source.child(j);
        if (row + cell.attrs.rowspan > newHeight)
          cell = cell.type.create(
            {
              ...cell.attrs,
              rowspan: Math.max(1, newHeight - cell.attrs.rowspan)
            },
            cell.content
          );
        cells.push(cell);
      }
      newRows.push(Fragment.from(cells));
    }
    rows = newRows;
    height = newHeight;
  }
  return { width: width2, height, rows };
}
__name(clipCells, "clipCells");
function growTable(tr2, map3, table2, start2, width2, height, mapFrom) {
  const schema2 = tr2.doc.type.schema;
  const types = tableNodeTypes(schema2);
  let empty3;
  let emptyHead;
  if (width2 > map3.width) {
    for (let row = 0, rowEnd = 0; row < map3.height; row++) {
      const rowNode = table2.child(row);
      rowEnd += rowNode.nodeSize;
      const cells = [];
      let add3;
      if (rowNode.lastChild == null || rowNode.lastChild.type == types.cell)
        add3 = empty3 || (empty3 = types.cell.createAndFill());
      else
        add3 = emptyHead || (emptyHead = types.header_cell.createAndFill());
      for (let i2 = map3.width; i2 < width2; i2++)
        cells.push(add3);
      tr2.insert(tr2.mapping.slice(mapFrom).map(rowEnd - 1 + start2), cells);
    }
  }
  if (height > map3.height) {
    const cells = [];
    for (let i2 = 0, start22 = (map3.height - 1) * map3.width; i2 < Math.max(map3.width, width2); i2++) {
      const header3 = i2 >= map3.width ? false : table2.nodeAt(map3.map[start22 + i2]).type == types.header_cell;
      cells.push(
        header3 ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty3 || (empty3 = types.cell.createAndFill())
      );
    }
    const emptyRow = types.row.create(null, Fragment.from(cells)), rows = [];
    for (let i2 = map3.height; i2 < height; i2++)
      rows.push(emptyRow);
    tr2.insert(tr2.mapping.slice(mapFrom).map(start2 + table2.nodeSize - 2), rows);
  }
  return !!(empty3 || emptyHead);
}
__name(growTable, "growTable");
function isolateHorizontal(tr2, map3, table2, start2, left, right, top, mapFrom) {
  if (top == 0 || top == map3.height)
    return false;
  let found2 = false;
  for (let col = left; col < right; col++) {
    const index2 = top * map3.width + col, pos2 = map3.map[index2];
    if (map3.map[index2 - map3.width] == pos2) {
      found2 = true;
      const cell = table2.nodeAt(pos2);
      const { top: cellTop, left: cellLeft } = map3.findCell(pos2);
      tr2.setNodeMarkup(tr2.mapping.slice(mapFrom).map(pos2 + start2), null, {
        ...cell.attrs,
        rowspan: top - cellTop
      });
      tr2.insert(
        tr2.mapping.slice(mapFrom).map(map3.positionAt(top, cellLeft, table2)),
        cell.type.createAndFill({
          ...cell.attrs,
          rowspan: cellTop + cell.attrs.rowspan - top
        })
      );
      col += cell.attrs.colspan - 1;
    }
  }
  return found2;
}
__name(isolateHorizontal, "isolateHorizontal");
function isolateVertical(tr2, map3, table2, start2, top, bottom, left, mapFrom) {
  if (left == 0 || left == map3.width)
    return false;
  let found2 = false;
  for (let row = top; row < bottom; row++) {
    const index2 = row * map3.width + left, pos2 = map3.map[index2];
    if (map3.map[index2 - 1] == pos2) {
      found2 = true;
      const cell = table2.nodeAt(pos2);
      const cellLeft = map3.colCount(pos2);
      const updatePos = tr2.mapping.slice(mapFrom).map(pos2 + start2);
      tr2.setNodeMarkup(
        updatePos,
        null,
        removeColSpan(
          cell.attrs,
          left - cellLeft,
          cell.attrs.colspan - (left - cellLeft)
        )
      );
      tr2.insert(
        updatePos + cell.nodeSize,
        cell.type.createAndFill(
          removeColSpan(cell.attrs, 0, left - cellLeft)
        )
      );
      row += cell.attrs.rowspan - 1;
    }
  }
  return found2;
}
__name(isolateVertical, "isolateVertical");
function insertCells(state, dispatch, tableStart, rect, cells) {
  let table2 = tableStart ? state.doc.nodeAt(tableStart - 1) : state.doc;
  if (!table2) {
    throw new Error("No table found");
  }
  let map3 = TableMap.get(table2);
  const { top, left } = rect;
  const right = left + cells.width, bottom = top + cells.height;
  const tr2 = state.tr;
  let mapFrom = 0;
  function recomp() {
    table2 = tableStart ? tr2.doc.nodeAt(tableStart - 1) : tr2.doc;
    if (!table2) {
      throw new Error("No table found");
    }
    map3 = TableMap.get(table2);
    mapFrom = tr2.mapping.maps.length;
  }
  __name(recomp, "recomp");
  if (growTable(tr2, map3, table2, tableStart, right, bottom, mapFrom))
    recomp();
  if (isolateHorizontal(tr2, map3, table2, tableStart, left, right, top, mapFrom))
    recomp();
  if (isolateHorizontal(tr2, map3, table2, tableStart, left, right, bottom, mapFrom))
    recomp();
  if (isolateVertical(tr2, map3, table2, tableStart, top, bottom, left, mapFrom))
    recomp();
  if (isolateVertical(tr2, map3, table2, tableStart, top, bottom, right, mapFrom))
    recomp();
  for (let row = top; row < bottom; row++) {
    const from2 = map3.positionAt(row, left, table2), to = map3.positionAt(row, right, table2);
    tr2.replace(
      tr2.mapping.slice(mapFrom).map(from2 + tableStart),
      tr2.mapping.slice(mapFrom).map(to + tableStart),
      new Slice(cells.rows[row - top], 0, 0)
    );
  }
  recomp();
  tr2.setSelection(
    new CellSelection(
      tr2.doc.resolve(tableStart + map3.positionAt(top, left, table2)),
      tr2.doc.resolve(tableStart + map3.positionAt(bottom - 1, right - 1, table2))
    )
  );
  dispatch(tr2);
}
__name(insertCells, "insertCells");
var handleKeyDown$1 = keydownHandler({
  ArrowLeft: arrow$1("horiz", -1),
  ArrowRight: arrow$1("horiz", 1),
  ArrowUp: arrow$1("vert", -1),
  ArrowDown: arrow$1("vert", 1),
  "Shift-ArrowLeft": shiftArrow("horiz", -1),
  "Shift-ArrowRight": shiftArrow("horiz", 1),
  "Shift-ArrowUp": shiftArrow("vert", -1),
  "Shift-ArrowDown": shiftArrow("vert", 1),
  Backspace: deleteCellSelection,
  "Mod-Backspace": deleteCellSelection,
  Delete: deleteCellSelection,
  "Mod-Delete": deleteCellSelection
});
function maybeSetSelection(state, dispatch, selection) {
  if (selection.eq(state.selection))
    return false;
  if (dispatch)
    dispatch(state.tr.setSelection(selection).scrollIntoView());
  return true;
}
__name(maybeSetSelection, "maybeSetSelection");
function arrow$1(axis, dir) {
  return (state, dispatch, view) => {
    if (!view)
      return false;
    const sel = state.selection;
    if (sel instanceof CellSelection) {
      return maybeSetSelection(
        state,
        dispatch,
        Selection.near(sel.$headCell, dir)
      );
    }
    if (axis != "horiz" && !sel.empty)
      return false;
    const end = atEndOfCell(view, axis, dir);
    if (end == null)
      return false;
    if (axis == "horiz") {
      return maybeSetSelection(
        state,
        dispatch,
        Selection.near(state.doc.resolve(sel.head + dir), dir)
      );
    } else {
      const $cell = state.doc.resolve(end);
      const $next = nextCell($cell, axis, dir);
      let newSel;
      if ($next)
        newSel = Selection.near($next, 1);
      else if (dir < 0)
        newSel = Selection.near(state.doc.resolve($cell.before(-1)), -1);
      else
        newSel = Selection.near(state.doc.resolve($cell.after(-1)), 1);
      return maybeSetSelection(state, dispatch, newSel);
    }
  };
}
__name(arrow$1, "arrow$1");
function shiftArrow(axis, dir) {
  return (state, dispatch, view) => {
    if (!view)
      return false;
    const sel = state.selection;
    let cellSel;
    if (sel instanceof CellSelection) {
      cellSel = sel;
    } else {
      const end = atEndOfCell(view, axis, dir);
      if (end == null)
        return false;
      cellSel = new CellSelection(state.doc.resolve(end));
    }
    const $head = nextCell(cellSel.$headCell, axis, dir);
    if (!$head)
      return false;
    return maybeSetSelection(
      state,
      dispatch,
      new CellSelection(cellSel.$anchorCell, $head)
    );
  };
}
__name(shiftArrow, "shiftArrow");
function handleTripleClick(view, pos2) {
  const doc2 = view.state.doc, $cell = cellAround(doc2.resolve(pos2));
  if (!$cell)
    return false;
  view.dispatch(view.state.tr.setSelection(new CellSelection($cell)));
  return true;
}
__name(handleTripleClick, "handleTripleClick");
function handlePaste(view, _2, slice2) {
  if (!isInTable(view.state))
    return false;
  let cells = pastedCells(slice2);
  const sel = view.state.selection;
  if (sel instanceof CellSelection) {
    if (!cells)
      cells = {
        width: 1,
        height: 1,
        rows: [
          Fragment.from(
            fitSlice(tableNodeTypes(view.state.schema).cell, slice2)
          )
        ]
      };
    const table2 = sel.$anchorCell.node(-1);
    const start2 = sel.$anchorCell.start(-1);
    const rect = TableMap.get(table2).rectBetween(
      sel.$anchorCell.pos - start2,
      sel.$headCell.pos - start2
    );
    cells = clipCells(cells, rect.right - rect.left, rect.bottom - rect.top);
    insertCells(view.state, view.dispatch, start2, rect, cells);
    return true;
  } else if (cells) {
    const $cell = selectionCell(view.state);
    const start2 = $cell.start(-1);
    insertCells(
      view.state,
      view.dispatch,
      start2,
      TableMap.get($cell.node(-1)).findCell($cell.pos - start2),
      cells
    );
    return true;
  } else {
    return false;
  }
}
__name(handlePaste, "handlePaste");
function handleMouseDown(view, startEvent) {
  var _a2;
  if (startEvent.ctrlKey || startEvent.metaKey)
    return;
  const startDOMCell = domInCell(view, startEvent.target);
  let $anchor;
  if (startEvent.shiftKey && view.state.selection instanceof CellSelection) {
    setCellSelection(view.state.selection.$anchorCell, startEvent);
    startEvent.preventDefault();
  } else if (startEvent.shiftKey && startDOMCell && ($anchor = cellAround(view.state.selection.$anchor)) != null && ((_a2 = cellUnderMouse(view, startEvent)) == null ? void 0 : _a2.pos) != $anchor.pos) {
    setCellSelection($anchor, startEvent);
    startEvent.preventDefault();
  } else if (!startDOMCell) {
    return;
  }
  function setCellSelection($anchor2, event) {
    let $head = cellUnderMouse(view, event);
    const starting = tableEditingKey.getState(view.state) == null;
    if (!$head || !inSameTable($anchor2, $head)) {
      if (starting)
        $head = $anchor2;
      else
        return;
    }
    const selection = new CellSelection($anchor2, $head);
    if (starting || !view.state.selection.eq(selection)) {
      const tr2 = view.state.tr.setSelection(selection);
      if (starting)
        tr2.setMeta(tableEditingKey, $anchor2.pos);
      view.dispatch(tr2);
    }
  }
  __name(setCellSelection, "setCellSelection");
  function stop2() {
    view.root.removeEventListener("mouseup", stop2);
    view.root.removeEventListener("dragstart", stop2);
    view.root.removeEventListener("mousemove", move);
    if (tableEditingKey.getState(view.state) != null)
      view.dispatch(view.state.tr.setMeta(tableEditingKey, -1));
  }
  __name(stop2, "stop");
  function move(_event) {
    const event = _event;
    const anchor = tableEditingKey.getState(view.state);
    let $anchor2;
    if (anchor != null) {
      $anchor2 = view.state.doc.resolve(anchor);
    } else if (domInCell(view, event.target) != startDOMCell) {
      $anchor2 = cellUnderMouse(view, startEvent);
      if (!$anchor2)
        return stop2();
    }
    if ($anchor2)
      setCellSelection($anchor2, event);
  }
  __name(move, "move");
  view.root.addEventListener("mouseup", stop2);
  view.root.addEventListener("dragstart", stop2);
  view.root.addEventListener("mousemove", move);
}
__name(handleMouseDown, "handleMouseDown");
function atEndOfCell(view, axis, dir) {
  if (!(view.state.selection instanceof TextSelection))
    return null;
  const { $head } = view.state.selection;
  for (let d = $head.depth - 1; d >= 0; d--) {
    const parent = $head.node(d), index2 = dir < 0 ? $head.index(d) : $head.indexAfter(d);
    if (index2 != (dir < 0 ? 0 : parent.childCount))
      return null;
    if (parent.type.spec.tableRole == "cell" || parent.type.spec.tableRole == "header_cell") {
      const cellPos = $head.before(d);
      const dirStr = axis == "vert" ? dir > 0 ? "down" : "up" : dir > 0 ? "right" : "left";
      return view.endOfTextblock(dirStr) ? cellPos : null;
    }
  }
  return null;
}
__name(atEndOfCell, "atEndOfCell");
function domInCell(view, dom) {
  for (; dom && dom != view.dom; dom = dom.parentNode) {
    if (dom.nodeName == "TD" || dom.nodeName == "TH") {
      return dom;
    }
  }
  return null;
}
__name(domInCell, "domInCell");
function cellUnderMouse(view, event) {
  const mousePos = view.posAtCoords({
    left: event.clientX,
    top: event.clientY
  });
  if (!mousePos)
    return null;
  return mousePos ? cellAround(view.state.doc.resolve(mousePos.pos)) : null;
}
__name(cellUnderMouse, "cellUnderMouse");
var TableView$1 = class TableView2 {
  static {
    __name(this, "TableView");
  }
  constructor(node3, defaultCellMinWidth) {
    this.node = node3;
    this.defaultCellMinWidth = defaultCellMinWidth;
    this.dom = document.createElement("div");
    this.dom.className = "tableWrapper";
    this.table = this.dom.appendChild(document.createElement("table"));
    this.table.style.setProperty(
      "--default-cell-min-width",
      `${defaultCellMinWidth}px`
    );
    this.colgroup = this.table.appendChild(document.createElement("colgroup"));
    updateColumnsOnResize(node3, this.colgroup, this.table, defaultCellMinWidth);
    this.contentDOM = this.table.appendChild(document.createElement("tbody"));
  }
  update(node3) {
    if (node3.type != this.node.type)
      return false;
    this.node = node3;
    updateColumnsOnResize(
      node3,
      this.colgroup,
      this.table,
      this.defaultCellMinWidth
    );
    return true;
  }
  ignoreMutation(record) {
    return record.type == "attributes" && (record.target == this.table || this.colgroup.contains(record.target));
  }
};
function updateColumnsOnResize(node3, colgroup, table2, defaultCellMinWidth, overrideCol, overrideValue) {
  var _a2;
  let totalWidth = 0;
  let fixedWidth = true;
  let nextDOM = colgroup.firstChild;
  const row = node3.firstChild;
  if (!row)
    return;
  for (let i2 = 0, col = 0; i2 < row.childCount; i2++) {
    const { colspan, colwidth } = row.child(i2).attrs;
    for (let j = 0; j < colspan; j++, col++) {
      const hasWidth = overrideCol == col ? overrideValue : colwidth && colwidth[j];
      const cssWidth = hasWidth ? hasWidth + "px" : "";
      totalWidth += hasWidth || defaultCellMinWidth;
      if (!hasWidth)
        fixedWidth = false;
      if (!nextDOM) {
        const col2 = document.createElement("col");
        col2.style.width = cssWidth;
        colgroup.appendChild(col2);
      } else {
        if (nextDOM.style.width != cssWidth) {
          nextDOM.style.width = cssWidth;
        }
        nextDOM = nextDOM.nextSibling;
      }
    }
  }
  while (nextDOM) {
    const after = nextDOM.nextSibling;
    (_a2 = nextDOM.parentNode) == null ? void 0 : _a2.removeChild(nextDOM);
    nextDOM = after;
  }
  if (fixedWidth) {
    table2.style.width = totalWidth + "px";
    table2.style.minWidth = "";
  } else {
    table2.style.width = "";
    table2.style.minWidth = totalWidth + "px";
  }
}
__name(updateColumnsOnResize, "updateColumnsOnResize");
var columnResizingPluginKey = new PluginKey(
  "tableColumnResizing"
);
function columnResizing({
  handleWidth = 5,
  cellMinWidth = 25,
  defaultCellMinWidth = 100,
  View = TableView$1,
  lastColumnResizable = true
} = {}) {
  const plugin = new Plugin({
    key: columnResizingPluginKey,
    state: {
      init(_2, state) {
        var _a2, _b;
        const nodeViews = (_b = (_a2 = plugin.spec) == null ? void 0 : _a2.props) == null ? void 0 : _b.nodeViews;
        const tableName = tableNodeTypes(state.schema).table.name;
        if (View && nodeViews) {
          nodeViews[tableName] = (node3, view) => {
            return new View(node3, defaultCellMinWidth, view);
          };
        }
        return new ResizeState(-1, false);
      },
      apply(tr2, prev2) {
        return prev2.apply(tr2);
      }
    },
    props: {
      attributes: /* @__PURE__ */ __name((state) => {
        const pluginState = columnResizingPluginKey.getState(state);
        return pluginState && pluginState.activeHandle > -1 ? { class: "resize-cursor" } : {};
      }, "attributes"),
      handleDOMEvents: {
        mousemove: /* @__PURE__ */ __name((view, event) => {
          handleMouseMove(view, event, handleWidth, lastColumnResizable);
        }, "mousemove"),
        mouseleave: /* @__PURE__ */ __name((view) => {
          handleMouseLeave(view);
        }, "mouseleave"),
        mousedown: /* @__PURE__ */ __name((view, event) => {
          handleMouseDown2(view, event, cellMinWidth, defaultCellMinWidth);
        }, "mousedown")
      },
      decorations: /* @__PURE__ */ __name((state) => {
        const pluginState = columnResizingPluginKey.getState(state);
        if (pluginState && pluginState.activeHandle > -1) {
          return handleDecorations(state, pluginState.activeHandle);
        }
      }, "decorations"),
      nodeViews: {}
    }
  });
  return plugin;
}
__name(columnResizing, "columnResizing");
var ResizeState = class _ResizeState {
  static {
    __name(this, "_ResizeState");
  }
  constructor(activeHandle, dragging) {
    this.activeHandle = activeHandle;
    this.dragging = dragging;
  }
  apply(tr2) {
    const state = this;
    const action = tr2.getMeta(columnResizingPluginKey);
    if (action && action.setHandle != null)
      return new _ResizeState(action.setHandle, false);
    if (action && action.setDragging !== void 0)
      return new _ResizeState(state.activeHandle, action.setDragging);
    if (state.activeHandle > -1 && tr2.docChanged) {
      let handle = tr2.mapping.map(state.activeHandle, -1);
      if (!pointsAtCell(tr2.doc.resolve(handle))) {
        handle = -1;
      }
      return new _ResizeState(handle, state.dragging);
    }
    return state;
  }
};
function handleMouseMove(view, event, handleWidth, lastColumnResizable) {
  const pluginState = columnResizingPluginKey.getState(view.state);
  if (!pluginState)
    return;
  if (!pluginState.dragging) {
    const target = domCellAround(event.target);
    let cell = -1;
    if (target) {
      const { left, right } = target.getBoundingClientRect();
      if (event.clientX - left <= handleWidth)
        cell = edgeCell(view, event, "left", handleWidth);
      else if (right - event.clientX <= handleWidth)
        cell = edgeCell(view, event, "right", handleWidth);
    }
    if (cell != pluginState.activeHandle) {
      if (!lastColumnResizable && cell !== -1) {
        const $cell = view.state.doc.resolve(cell);
        const table2 = $cell.node(-1);
        const map3 = TableMap.get(table2);
        const tableStart = $cell.start(-1);
        const col = map3.colCount($cell.pos - tableStart) + $cell.nodeAfter.attrs.colspan - 1;
        if (col == map3.width - 1) {
          return;
        }
      }
      updateHandle(view, cell);
    }
  }
}
__name(handleMouseMove, "handleMouseMove");
function handleMouseLeave(view) {
  const pluginState = columnResizingPluginKey.getState(view.state);
  if (pluginState && pluginState.activeHandle > -1 && !pluginState.dragging)
    updateHandle(view, -1);
}
__name(handleMouseLeave, "handleMouseLeave");
function handleMouseDown2(view, event, cellMinWidth, defaultCellMinWidth) {
  var _a2;
  const win = (_a2 = view.dom.ownerDocument.defaultView) != null ? _a2 : window;
  const pluginState = columnResizingPluginKey.getState(view.state);
  if (!pluginState || pluginState.activeHandle == -1 || pluginState.dragging)
    return false;
  const cell = view.state.doc.nodeAt(pluginState.activeHandle);
  const width2 = currentColWidth(view, pluginState.activeHandle, cell.attrs);
  view.dispatch(
    view.state.tr.setMeta(columnResizingPluginKey, {
      setDragging: { startX: event.clientX, startWidth: width2 }
    })
  );
  function finish(event2) {
    win.removeEventListener("mouseup", finish);
    win.removeEventListener("mousemove", move);
    const pluginState2 = columnResizingPluginKey.getState(view.state);
    if (pluginState2 == null ? void 0 : pluginState2.dragging) {
      updateColumnWidth(
        view,
        pluginState2.activeHandle,
        draggedWidth(pluginState2.dragging, event2, cellMinWidth)
      );
      view.dispatch(
        view.state.tr.setMeta(columnResizingPluginKey, { setDragging: null })
      );
    }
  }
  __name(finish, "finish");
  function move(event2) {
    if (!event2.which)
      return finish(event2);
    const pluginState2 = columnResizingPluginKey.getState(view.state);
    if (!pluginState2)
      return;
    if (pluginState2.dragging) {
      const dragged = draggedWidth(pluginState2.dragging, event2, cellMinWidth);
      displayColumnWidth(
        view,
        pluginState2.activeHandle,
        dragged,
        defaultCellMinWidth
      );
    }
  }
  __name(move, "move");
  displayColumnWidth(
    view,
    pluginState.activeHandle,
    width2,
    defaultCellMinWidth
  );
  win.addEventListener("mouseup", finish);
  win.addEventListener("mousemove", move);
  event.preventDefault();
  return true;
}
__name(handleMouseDown2, "handleMouseDown2");
function currentColWidth(view, cellPos, { colspan, colwidth }) {
  const width2 = colwidth && colwidth[colwidth.length - 1];
  if (width2)
    return width2;
  const dom = view.domAtPos(cellPos);
  const node3 = dom.node.childNodes[dom.offset];
  let domWidth = node3.offsetWidth, parts2 = colspan;
  if (colwidth) {
    for (let i2 = 0; i2 < colspan; i2++)
      if (colwidth[i2]) {
        domWidth -= colwidth[i2];
        parts2--;
      }
  }
  return domWidth / parts2;
}
__name(currentColWidth, "currentColWidth");
function domCellAround(target) {
  while (target && target.nodeName != "TD" && target.nodeName != "TH")
    target = target.classList && target.classList.contains("ProseMirror") ? null : target.parentNode;
  return target;
}
__name(domCellAround, "domCellAround");
function edgeCell(view, event, side, handleWidth) {
  const offset = side == "right" ? -handleWidth : handleWidth;
  const found2 = view.posAtCoords({
    left: event.clientX + offset,
    top: event.clientY
  });
  if (!found2)
    return -1;
  const { pos: pos2 } = found2;
  const $cell = cellAround(view.state.doc.resolve(pos2));
  if (!$cell)
    return -1;
  if (side == "right")
    return $cell.pos;
  const map3 = TableMap.get($cell.node(-1)), start2 = $cell.start(-1);
  const index2 = map3.map.indexOf($cell.pos - start2);
  return index2 % map3.width == 0 ? -1 : start2 + map3.map[index2 - 1];
}
__name(edgeCell, "edgeCell");
function draggedWidth(dragging, event, resizeMinWidth) {
  const offset = event.clientX - dragging.startX;
  return Math.max(resizeMinWidth, dragging.startWidth + offset);
}
__name(draggedWidth, "draggedWidth");
function updateHandle(view, value4) {
  view.dispatch(
    view.state.tr.setMeta(columnResizingPluginKey, { setHandle: value4 })
  );
}
__name(updateHandle, "updateHandle");
function updateColumnWidth(view, cell, width2) {
  const $cell = view.state.doc.resolve(cell);
  const table2 = $cell.node(-1), map3 = TableMap.get(table2), start2 = $cell.start(-1);
  const col = map3.colCount($cell.pos - start2) + $cell.nodeAfter.attrs.colspan - 1;
  const tr2 = view.state.tr;
  for (let row = 0; row < map3.height; row++) {
    const mapIndex = row * map3.width + col;
    if (row && map3.map[mapIndex] == map3.map[mapIndex - map3.width])
      continue;
    const pos2 = map3.map[mapIndex];
    const attrs4 = table2.nodeAt(pos2).attrs;
    const index2 = attrs4.colspan == 1 ? 0 : col - map3.colCount(pos2);
    if (attrs4.colwidth && attrs4.colwidth[index2] == width2)
      continue;
    const colwidth = attrs4.colwidth ? attrs4.colwidth.slice() : zeroes(attrs4.colspan);
    colwidth[index2] = width2;
    tr2.setNodeMarkup(start2 + pos2, null, { ...attrs4, colwidth });
  }
  if (tr2.docChanged)
    view.dispatch(tr2);
}
__name(updateColumnWidth, "updateColumnWidth");
function displayColumnWidth(view, cell, width2, defaultCellMinWidth) {
  const $cell = view.state.doc.resolve(cell);
  const table2 = $cell.node(-1), start2 = $cell.start(-1);
  const col = TableMap.get(table2).colCount($cell.pos - start2) + $cell.nodeAfter.attrs.colspan - 1;
  let dom = view.domAtPos($cell.start(-1)).node;
  while (dom && dom.nodeName != "TABLE") {
    dom = dom.parentNode;
  }
  if (!dom)
    return;
  updateColumnsOnResize(
    table2,
    dom.firstChild,
    dom,
    defaultCellMinWidth,
    col,
    width2
  );
}
__name(displayColumnWidth, "displayColumnWidth");
function zeroes(n) {
  return Array(n).fill(0);
}
__name(zeroes, "zeroes");
function handleDecorations(state, cell) {
  var _a2;
  const decorations = [];
  const $cell = state.doc.resolve(cell);
  const table2 = $cell.node(-1);
  if (!table2) {
    return DecorationSet.empty;
  }
  const map3 = TableMap.get(table2);
  const start2 = $cell.start(-1);
  const col = map3.colCount($cell.pos - start2) + $cell.nodeAfter.attrs.colspan - 1;
  for (let row = 0; row < map3.height; row++) {
    const index2 = col + row * map3.width;
    if ((col == map3.width - 1 || map3.map[index2] != map3.map[index2 + 1]) && (row == 0 || map3.map[index2] != map3.map[index2 - map3.width])) {
      const cellPos = map3.map[index2];
      const pos2 = start2 + cellPos + table2.nodeAt(cellPos).nodeSize - 1;
      const dom = document.createElement("div");
      dom.className = "column-resize-handle";
      if ((_a2 = columnResizingPluginKey.getState(state)) == null ? void 0 : _a2.dragging) {
        decorations.push(
          Decoration.node(
            start2 + cellPos,
            start2 + cellPos + table2.nodeAt(cellPos).nodeSize,
            {
              class: "column-resize-dragging"
            }
          )
        );
      }
      decorations.push(Decoration.widget(pos2, dom));
    }
  }
  return DecorationSet.create(state.doc, decorations);
}
__name(handleDecorations, "handleDecorations");
function tableEditing({
  allowTableNodeSelection = false
} = {}) {
  return new Plugin({
    key: tableEditingKey,
    // This piece of state is used to remember when a mouse-drag
    // cell-selection is happening, so that it can continue even as
    // transactions (which might move its anchor cell) come in.
    state: {
      init() {
        return null;
      },
      apply(tr2, cur) {
        const set3 = tr2.getMeta(tableEditingKey);
        if (set3 != null)
          return set3 == -1 ? null : set3;
        if (cur == null || !tr2.docChanged)
          return cur;
        const { deleted, pos: pos2 } = tr2.mapping.mapResult(cur);
        return deleted ? null : pos2;
      }
    },
    props: {
      decorations: drawCellSelection,
      handleDOMEvents: {
        mousedown: handleMouseDown
      },
      createSelectionBetween(view) {
        return tableEditingKey.getState(view.state) != null ? view.state.selection : null;
      },
      handleTripleClick,
      handleKeyDown: handleKeyDown$1,
      handlePaste
    },
    appendTransaction(_2, oldState, state) {
      return normalizeSelection(
        state,
        fixTables(state, oldState),
        allowTableNodeSelection
      );
    }
  });
}
__name(tableEditing, "tableEditing");
function getColStyleDeclaration(minWidth, width2) {
  if (width2) {
    return ["width", `${Math.max(width2, minWidth)}px`];
  }
  return ["min-width", `${minWidth}px`];
}
__name(getColStyleDeclaration, "getColStyleDeclaration");
function updateColumns(node3, colgroup, table2, cellMinWidth, overrideCol, overrideValue) {
  var _a2;
  let totalWidth = 0;
  let fixedWidth = true;
  let nextDOM = colgroup.firstChild;
  const row = node3.firstChild;
  if (row !== null) {
    for (let i2 = 0, col = 0; i2 < row.childCount; i2 += 1) {
      const { colspan, colwidth } = row.child(i2).attrs;
      for (let j = 0; j < colspan; j += 1, col += 1) {
        const hasWidth = overrideCol === col ? overrideValue : colwidth && colwidth[j];
        const cssWidth = hasWidth ? `${hasWidth}px` : "";
        totalWidth += hasWidth || cellMinWidth;
        if (!hasWidth) {
          fixedWidth = false;
        }
        if (!nextDOM) {
          const colElement = document.createElement("col");
          const [propertyKey, propertyValue] = getColStyleDeclaration(cellMinWidth, hasWidth);
          colElement.style.setProperty(propertyKey, propertyValue);
          colgroup.appendChild(colElement);
        } else {
          if (nextDOM.style.width !== cssWidth) {
            const [propertyKey, propertyValue] = getColStyleDeclaration(cellMinWidth, hasWidth);
            nextDOM.style.setProperty(propertyKey, propertyValue);
          }
          nextDOM = nextDOM.nextSibling;
        }
      }
    }
  }
  while (nextDOM) {
    const after = nextDOM.nextSibling;
    (_a2 = nextDOM.parentNode) === null || _a2 === void 0 ? void 0 : _a2.removeChild(nextDOM);
    nextDOM = after;
  }
  if (fixedWidth) {
    table2.style.width = `${totalWidth}px`;
    table2.style.minWidth = "";
  } else {
    table2.style.width = "";
    table2.style.minWidth = `${totalWidth}px`;
  }
}
__name(updateColumns, "updateColumns");
class TableView {
  static {
    __name(this, "TableView");
  }
  constructor(node3, cellMinWidth) {
    this.node = node3;
    this.cellMinWidth = cellMinWidth;
    this.dom = document.createElement("div");
    this.dom.className = "tableWrapper";
    this.table = this.dom.appendChild(document.createElement("table"));
    this.colgroup = this.table.appendChild(document.createElement("colgroup"));
    updateColumns(node3, this.colgroup, this.table, cellMinWidth);
    this.contentDOM = this.table.appendChild(document.createElement("tbody"));
  }
  update(node3) {
    if (node3.type !== this.node.type) {
      return false;
    }
    this.node = node3;
    updateColumns(node3, this.colgroup, this.table, this.cellMinWidth);
    return true;
  }
  ignoreMutation(mutation) {
    return mutation.type === "attributes" && (mutation.target === this.table || this.colgroup.contains(mutation.target));
  }
}
function createColGroup(node3, cellMinWidth, overrideCol, overrideValue) {
  let totalWidth = 0;
  let fixedWidth = true;
  const cols = [];
  const row = node3.firstChild;
  if (!row) {
    return {};
  }
  for (let i2 = 0, col = 0; i2 < row.childCount; i2 += 1) {
    const { colspan, colwidth } = row.child(i2).attrs;
    for (let j = 0; j < colspan; j += 1, col += 1) {
      const hasWidth = overrideCol === col ? overrideValue : colwidth && colwidth[j];
      totalWidth += hasWidth || cellMinWidth;
      if (!hasWidth) {
        fixedWidth = false;
      }
      const [property, value4] = getColStyleDeclaration(cellMinWidth, hasWidth);
      cols.push([
        "col",
        { style: `${property}: ${value4}` }
      ]);
    }
  }
  const tableWidth = fixedWidth ? `${totalWidth}px` : "";
  const tableMinWidth = fixedWidth ? "" : `${totalWidth}px`;
  const colgroup = ["colgroup", {}, ...cols];
  return { colgroup, tableWidth, tableMinWidth };
}
__name(createColGroup, "createColGroup");
function createCell(cellType, cellContent) {
  if (cellContent) {
    return cellType.createChecked(null, cellContent);
  }
  return cellType.createAndFill();
}
__name(createCell, "createCell");
function getTableNodeTypes(schema2) {
  if (schema2.cached.tableNodeTypes) {
    return schema2.cached.tableNodeTypes;
  }
  const roles = {};
  Object.keys(schema2.nodes).forEach((type) => {
    const nodeType = schema2.nodes[type];
    if (nodeType.spec.tableRole) {
      roles[nodeType.spec.tableRole] = nodeType;
    }
  });
  schema2.cached.tableNodeTypes = roles;
  return roles;
}
__name(getTableNodeTypes, "getTableNodeTypes");
function createTable(schema2, rowsCount, colsCount, withHeaderRow, cellContent) {
  const types = getTableNodeTypes(schema2);
  const headerCells = [];
  const cells = [];
  for (let index2 = 0; index2 < colsCount; index2 += 1) {
    const cell = createCell(types.cell, cellContent);
    if (cell) {
      cells.push(cell);
    }
    if (withHeaderRow) {
      const headerCell = createCell(types.header_cell, cellContent);
      if (headerCell) {
        headerCells.push(headerCell);
      }
    }
  }
  const rows = [];
  for (let index2 = 0; index2 < rowsCount; index2 += 1) {
    rows.push(types.row.createChecked(null, withHeaderRow && index2 === 0 ? headerCells : cells));
  }
  return types.table.createChecked(null, rows);
}
__name(createTable, "createTable");
function isCellSelection(value4) {
  return value4 instanceof CellSelection;
}
__name(isCellSelection, "isCellSelection");
const deleteTableWhenAllCellsSelected = /* @__PURE__ */ __name(({ editor }) => {
  const { selection } = editor.state;
  if (!isCellSelection(selection)) {
    return false;
  }
  let cellCount = 0;
  const table2 = findParentNodeClosestToPos(selection.ranges[0].$from, (node3) => {
    return node3.type.name === "table";
  });
  table2 === null || table2 === void 0 ? void 0 : table2.node.descendants((node3) => {
    if (node3.type.name === "table") {
      return false;
    }
    if (["tableCell", "tableHeader"].includes(node3.type.name)) {
      cellCount += 1;
    }
  });
  const allCellsSelected = cellCount === selection.ranges.length;
  if (!allCellsSelected) {
    return false;
  }
  editor.commands.deleteTable();
  return true;
}, "deleteTableWhenAllCellsSelected");
const Table$2 = Node$1.create({
  name: "table",
  // @ts-ignore
  addOptions() {
    return {
      HTMLAttributes: {},
      resizable: false,
      handleWidth: 5,
      cellMinWidth: 25,
      // TODO: fix
      View: TableView,
      lastColumnResizable: true,
      allowTableNodeSelection: false
    };
  },
  content: "tableRow+",
  tableRole: "table",
  isolating: true,
  group: "block",
  parseHTML() {
    return [{ tag: "table" }];
  },
  renderHTML({ node: node3, HTMLAttributes }) {
    const { colgroup, tableWidth, tableMinWidth } = createColGroup(node3, this.options.cellMinWidth);
    const table2 = [
      "table",
      mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
        style: tableWidth ? `width: ${tableWidth}` : `min-width: ${tableMinWidth}`
      }),
      colgroup,
      ["tbody", 0]
    ];
    return table2;
  },
  addCommands() {
    return {
      insertTable: /* @__PURE__ */ __name(({ rows = 3, cols = 3, withHeaderRow = true } = {}) => ({ tr: tr2, dispatch, editor }) => {
        const node3 = createTable(editor.schema, rows, cols, withHeaderRow);
        if (dispatch) {
          const offset = tr2.selection.from + 1;
          tr2.replaceSelectionWith(node3).scrollIntoView().setSelection(TextSelection.near(tr2.doc.resolve(offset)));
        }
        return true;
      }, "insertTable"),
      addColumnBefore: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return addColumnBefore(state, dispatch);
      }, "addColumnBefore"),
      addColumnAfter: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return addColumnAfter(state, dispatch);
      }, "addColumnAfter"),
      deleteColumn: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return deleteColumn(state, dispatch);
      }, "deleteColumn"),
      addRowBefore: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return addRowBefore(state, dispatch);
      }, "addRowBefore"),
      addRowAfter: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return addRowAfter(state, dispatch);
      }, "addRowAfter"),
      deleteRow: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return deleteRow(state, dispatch);
      }, "deleteRow"),
      deleteTable: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return deleteTable(state, dispatch);
      }, "deleteTable"),
      mergeCells: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return mergeCells(state, dispatch);
      }, "mergeCells"),
      splitCell: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return splitCell(state, dispatch);
      }, "splitCell"),
      toggleHeaderColumn: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return toggleHeader("column")(state, dispatch);
      }, "toggleHeaderColumn"),
      toggleHeaderRow: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return toggleHeader("row")(state, dispatch);
      }, "toggleHeaderRow"),
      toggleHeaderCell: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return toggleHeaderCell(state, dispatch);
      }, "toggleHeaderCell"),
      mergeOrSplit: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        if (mergeCells(state, dispatch)) {
          return true;
        }
        return splitCell(state, dispatch);
      }, "mergeOrSplit"),
      setCellAttribute: /* @__PURE__ */ __name((name2, value4) => ({ state, dispatch }) => {
        return setCellAttr(name2, value4)(state, dispatch);
      }, "setCellAttribute"),
      goToNextCell: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return goToNextCell(1)(state, dispatch);
      }, "goToNextCell"),
      goToPreviousCell: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return goToNextCell(-1)(state, dispatch);
      }, "goToPreviousCell"),
      fixTables: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        if (dispatch) {
          fixTables(state);
        }
        return true;
      }, "fixTables"),
      setCellSelection: /* @__PURE__ */ __name((position3) => ({ tr: tr2, dispatch }) => {
        if (dispatch) {
          const selection = CellSelection.create(tr2.doc, position3.anchorCell, position3.headCell);
          tr2.setSelection(selection);
        }
        return true;
      }, "setCellSelection")
    };
  },
  addKeyboardShortcuts() {
    return {
      Tab: /* @__PURE__ */ __name(() => {
        if (this.editor.commands.goToNextCell()) {
          return true;
        }
        if (!this.editor.can().addRowAfter()) {
          return false;
        }
        return this.editor.chain().addRowAfter().goToNextCell().run();
      }, "Tab"),
      "Shift-Tab": /* @__PURE__ */ __name(() => this.editor.commands.goToPreviousCell(), "Shift-Tab"),
      Backspace: deleteTableWhenAllCellsSelected,
      "Mod-Backspace": deleteTableWhenAllCellsSelected,
      Delete: deleteTableWhenAllCellsSelected,
      "Mod-Delete": deleteTableWhenAllCellsSelected
    };
  },
  addProseMirrorPlugins() {
    const isResizable = this.options.resizable && this.editor.isEditable;
    return [
      ...isResizable ? [
        columnResizing({
          handleWidth: this.options.handleWidth,
          cellMinWidth: this.options.cellMinWidth,
          defaultCellMinWidth: this.options.cellMinWidth,
          View: this.options.View,
          lastColumnResizable: this.options.lastColumnResizable
        })
      ] : [],
      tableEditing({
        allowTableNodeSelection: this.options.allowTableNodeSelection
      })
    ];
  },
  extendNodeSchema(extension) {
    const context = {
      name: extension.name,
      options: extension.options,
      storage: extension.storage
    };
    return {
      tableRole: callOrReturn(getExtensionField(extension, "tableRole", context))
    };
  }
});
const TableCell = Node$1.create({
  name: "tableCell",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  content: "block+",
  addAttributes() {
    return {
      colspan: {
        default: 1
      },
      rowspan: {
        default: 1
      },
      colwidth: {
        default: null,
        parseHTML: /* @__PURE__ */ __name((element) => {
          const colwidth = element.getAttribute("colwidth");
          const value4 = colwidth ? colwidth.split(",").map((width2) => parseInt(width2, 10)) : null;
          return value4;
        }, "parseHTML")
      }
    };
  },
  tableRole: "cell",
  isolating: true,
  parseHTML() {
    return [
      { tag: "td" }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["td", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  }
});
const TableHeader = Node$1.create({
  name: "tableHeader",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  content: "block+",
  addAttributes() {
    return {
      colspan: {
        default: 1
      },
      rowspan: {
        default: 1
      },
      colwidth: {
        default: null,
        parseHTML: /* @__PURE__ */ __name((element) => {
          const colwidth = element.getAttribute("colwidth");
          const value4 = colwidth ? colwidth.split(",").map((width2) => parseInt(width2, 10)) : null;
          return value4;
        }, "parseHTML")
      }
    };
  },
  tableRole: "header_cell",
  isolating: true,
  parseHTML() {
    return [
      { tag: "th" }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["th", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  }
});
const TableRow = Node$1.create({
  name: "tableRow",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  content: "(tableCell | tableHeader)*",
  tableRole: "row",
  parseHTML() {
    return [
      { tag: "tr" }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["tr", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  }
});
const inputRegex$4 = /^\s*>\s$/;
const Blockquote$2 = Node$1.create({
  name: "blockquote",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  content: "block+",
  group: "block",
  defining: true,
  parseHTML() {
    return [
      { tag: "blockquote" }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["blockquote", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      setBlockquote: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.wrapIn(this.name);
      }, "setBlockquote"),
      toggleBlockquote: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.toggleWrap(this.name);
      }, "toggleBlockquote"),
      unsetBlockquote: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.lift(this.name);
      }, "unsetBlockquote")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-b": /* @__PURE__ */ __name(() => this.editor.commands.toggleBlockquote(), "Mod-Shift-b")
    };
  },
  addInputRules() {
    return [
      wrappingInputRule({
        find: inputRegex$4,
        type: this.type
      })
    ];
  }
});
const starInputRegex$1 = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/;
const starPasteRegex$1 = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g;
const underscoreInputRegex$1 = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/;
const underscorePasteRegex$1 = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
const Bold$2 = Mark.create({
  name: "bold",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "strong"
      },
      {
        tag: "b",
        getAttrs: /* @__PURE__ */ __name((node3) => node3.style.fontWeight !== "normal" && null, "getAttrs")
      },
      {
        style: "font-weight=400",
        clearMark: /* @__PURE__ */ __name((mark2) => mark2.type.name === this.name, "clearMark")
      },
      {
        style: "font-weight",
        getAttrs: /* @__PURE__ */ __name((value4) => /^(bold(er)?|[5-9]\d{2,})$/.test(value4) && null, "getAttrs")
      }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["strong", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      setBold: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.setMark(this.name);
      }, "setBold"),
      toggleBold: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.toggleMark(this.name);
      }, "toggleBold"),
      unsetBold: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.unsetMark(this.name);
      }, "unsetBold")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-b": /* @__PURE__ */ __name(() => this.editor.commands.toggleBold(), "Mod-b"),
      "Mod-B": /* @__PURE__ */ __name(() => this.editor.commands.toggleBold(), "Mod-B")
    };
  },
  addInputRules() {
    return [
      markInputRule({
        find: starInputRegex$1,
        type: this.type
      }),
      markInputRule({
        find: underscoreInputRegex$1,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      markPasteRule({
        find: starPasteRegex$1,
        type: this.type
      }),
      markPasteRule({
        find: underscorePasteRegex$1,
        type: this.type
      })
    ];
  }
});
const ListItemName$1 = "listItem";
const TextStyleName$1 = "textStyle";
const inputRegex$3 = /^\s*([-+*])\s$/;
const BulletList$2 = Node$1.create({
  name: "bulletList",
  addOptions() {
    return {
      itemTypeName: "listItem",
      HTMLAttributes: {},
      keepMarks: false,
      keepAttributes: false
    };
  },
  group: "block list",
  content() {
    return `${this.options.itemTypeName}+`;
  },
  parseHTML() {
    return [
      { tag: "ul" }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["ul", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      toggleBulletList: /* @__PURE__ */ __name(() => ({ commands: commands2, chain }) => {
        if (this.options.keepAttributes) {
          return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName$1, this.editor.getAttributes(TextStyleName$1)).run();
        }
        return commands2.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);
      }, "toggleBulletList")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-8": /* @__PURE__ */ __name(() => this.editor.commands.toggleBulletList(), "Mod-Shift-8")
    };
  },
  addInputRules() {
    let inputRule = wrappingInputRule({
      find: inputRegex$3,
      type: this.type
    });
    if (this.options.keepMarks || this.options.keepAttributes) {
      inputRule = wrappingInputRule({
        find: inputRegex$3,
        type: this.type,
        keepMarks: this.options.keepMarks,
        keepAttributes: this.options.keepAttributes,
        getAttributes: /* @__PURE__ */ __name(() => {
          return this.editor.getAttributes(TextStyleName$1);
        }, "getAttributes"),
        editor: this.editor
      });
    }
    return [
      inputRule
    ];
  }
});
const inputRegex$2 = /(?<!`)`([^`]+)`(?!`)/;
const pasteRegex$1 = /(?<!`)`([^`]+)`(?!`)/g;
const Code$2 = Mark.create({
  name: "code",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  excludes: "_",
  code: true,
  exitable: true,
  parseHTML() {
    return [
      { tag: "code" }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["code", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      setCode: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.setMark(this.name);
      }, "setCode"),
      toggleCode: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.toggleMark(this.name);
      }, "toggleCode"),
      unsetCode: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.unsetMark(this.name);
      }, "unsetCode")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-e": /* @__PURE__ */ __name(() => this.editor.commands.toggleCode(), "Mod-e")
    };
  },
  addInputRules() {
    return [
      markInputRule({
        find: inputRegex$2,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      markPasteRule({
        find: pasteRegex$1,
        type: this.type
      })
    ];
  }
});
const backtickInputRegex = /^```([a-z]+)?[\s\n]$/;
const tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/;
const CodeBlock$2 = Node$1.create({
  name: "codeBlock",
  addOptions() {
    return {
      languageClassPrefix: "language-",
      exitOnTripleEnter: true,
      exitOnArrowDown: true,
      defaultLanguage: null,
      HTMLAttributes: {}
    };
  },
  content: "text*",
  marks: "",
  group: "block",
  code: true,
  defining: true,
  addAttributes() {
    return {
      language: {
        default: this.options.defaultLanguage,
        parseHTML: /* @__PURE__ */ __name((element) => {
          var _a2;
          const { languageClassPrefix } = this.options;
          const classNames = [...((_a2 = element.firstElementChild) === null || _a2 === void 0 ? void 0 : _a2.classList) || []];
          const languages = classNames.filter((className) => className.startsWith(languageClassPrefix)).map((className) => className.replace(languageClassPrefix, ""));
          const language = languages[0];
          if (!language) {
            return null;
          }
          return language;
        }, "parseHTML"),
        rendered: false
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "pre",
        preserveWhitespace: "full"
      }
    ];
  },
  renderHTML({ node: node3, HTMLAttributes }) {
    return [
      "pre",
      mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
      [
        "code",
        {
          class: node3.attrs.language ? this.options.languageClassPrefix + node3.attrs.language : null
        },
        0
      ]
    ];
  },
  addCommands() {
    return {
      setCodeBlock: /* @__PURE__ */ __name((attributes) => ({ commands: commands2 }) => {
        return commands2.setNode(this.name, attributes);
      }, "setCodeBlock"),
      toggleCodeBlock: /* @__PURE__ */ __name((attributes) => ({ commands: commands2 }) => {
        return commands2.toggleNode(this.name, "paragraph", attributes);
      }, "toggleCodeBlock")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Alt-c": /* @__PURE__ */ __name(() => this.editor.commands.toggleCodeBlock(), "Mod-Alt-c"),
      // remove code block when at start of document or code block is empty
      Backspace: /* @__PURE__ */ __name(() => {
        const { empty: empty3, $anchor } = this.editor.state.selection;
        const isAtStart = $anchor.pos === 1;
        if (!empty3 || $anchor.parent.type.name !== this.name) {
          return false;
        }
        if (isAtStart || !$anchor.parent.textContent.length) {
          return this.editor.commands.clearNodes();
        }
        return false;
      }, "Backspace"),
      // exit node on triple enter
      Enter: /* @__PURE__ */ __name(({ editor }) => {
        if (!this.options.exitOnTripleEnter) {
          return false;
        }
        const { state } = editor;
        const { selection } = state;
        const { $from, empty: empty3 } = selection;
        if (!empty3 || $from.parent.type !== this.type) {
          return false;
        }
        const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;
        const endsWithDoubleNewline = $from.parent.textContent.endsWith("\n\n");
        if (!isAtEnd || !endsWithDoubleNewline) {
          return false;
        }
        return editor.chain().command(({ tr: tr2 }) => {
          tr2.delete($from.pos - 2, $from.pos);
          return true;
        }).exitCode().run();
      }, "Enter"),
      // exit node on arrow down
      ArrowDown: /* @__PURE__ */ __name(({ editor }) => {
        if (!this.options.exitOnArrowDown) {
          return false;
        }
        const { state } = editor;
        const { selection, doc: doc2 } = state;
        const { $from, empty: empty3 } = selection;
        if (!empty3 || $from.parent.type !== this.type) {
          return false;
        }
        const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;
        if (!isAtEnd) {
          return false;
        }
        const after = $from.after();
        if (after === void 0) {
          return false;
        }
        const nodeAfter = doc2.nodeAt(after);
        if (nodeAfter) {
          return editor.commands.command(({ tr: tr2 }) => {
            tr2.setSelection(Selection.near(doc2.resolve(after)));
            return true;
          });
        }
        return editor.commands.exitCode();
      }, "ArrowDown")
    };
  },
  addInputRules() {
    return [
      textblockTypeInputRule({
        find: backtickInputRegex,
        type: this.type,
        getAttributes: /* @__PURE__ */ __name((match2) => ({
          language: match2[1]
        }), "getAttributes")
      }),
      textblockTypeInputRule({
        find: tildeInputRegex,
        type: this.type,
        getAttributes: /* @__PURE__ */ __name((match2) => ({
          language: match2[1]
        }), "getAttributes")
      })
    ];
  },
  addProseMirrorPlugins() {
    return [
      // this plugin creates a code block for pasted content from VS Code
      // we can also detect the copied code language
      new Plugin({
        key: new PluginKey("codeBlockVSCodeHandler"),
        props: {
          handlePaste: /* @__PURE__ */ __name((view, event) => {
            if (!event.clipboardData) {
              return false;
            }
            if (this.editor.isActive(this.type.name)) {
              return false;
            }
            const text2 = event.clipboardData.getData("text/plain");
            const vscode = event.clipboardData.getData("vscode-editor-data");
            const vscodeData = vscode ? JSON.parse(vscode) : void 0;
            const language = vscodeData === null || vscodeData === void 0 ? void 0 : vscodeData.mode;
            if (!text2 || !language) {
              return false;
            }
            const { tr: tr2, schema: schema2 } = view.state;
            const textNode = schema2.text(text2.replace(/\r\n?/g, "\n"));
            tr2.replaceSelectionWith(this.type.create({ language }, textNode));
            if (tr2.selection.$from.parent.type !== this.type) {
              tr2.setSelection(TextSelection.near(tr2.doc.resolve(Math.max(0, tr2.selection.from - 2))));
            }
            tr2.setMeta("paste", true);
            view.dispatch(tr2);
            return true;
          }, "handlePaste")
        }
      })
    ];
  }
});
const Document$1 = Node$1.create({
  name: "doc",
  topNode: true,
  content: "block+"
});
function dropCursor(options4 = {}) {
  return new Plugin({
    view(editorView) {
      return new DropCursorView(editorView, options4);
    }
  });
}
__name(dropCursor, "dropCursor");
class DropCursorView {
  static {
    __name(this, "DropCursorView");
  }
  constructor(editorView, options4) {
    var _a2;
    this.editorView = editorView;
    this.cursorPos = null;
    this.element = null;
    this.timeout = -1;
    this.width = (_a2 = options4.width) !== null && _a2 !== void 0 ? _a2 : 1;
    this.color = options4.color === false ? void 0 : options4.color || "black";
    this.class = options4.class;
    this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((name2) => {
      let handler6 = /* @__PURE__ */ __name((e2) => {
        this[name2](e2);
      }, "handler");
      editorView.dom.addEventListener(name2, handler6);
      return { name: name2, handler: handler6 };
    });
  }
  destroy() {
    this.handlers.forEach(({ name: name2, handler: handler6 }) => this.editorView.dom.removeEventListener(name2, handler6));
  }
  update(editorView, prevState) {
    if (this.cursorPos != null && prevState.doc != editorView.state.doc) {
      if (this.cursorPos > editorView.state.doc.content.size)
        this.setCursor(null);
      else
        this.updateOverlay();
    }
  }
  setCursor(pos2) {
    if (pos2 == this.cursorPos)
      return;
    this.cursorPos = pos2;
    if (pos2 == null) {
      this.element.parentNode.removeChild(this.element);
      this.element = null;
    } else {
      this.updateOverlay();
    }
  }
  updateOverlay() {
    let $pos = this.editorView.state.doc.resolve(this.cursorPos);
    let isBlock = !$pos.parent.inlineContent, rect;
    if (isBlock) {
      let before = $pos.nodeBefore, after = $pos.nodeAfter;
      if (before || after) {
        let node3 = this.editorView.nodeDOM(this.cursorPos - (before ? before.nodeSize : 0));
        if (node3) {
          let nodeRect = node3.getBoundingClientRect();
          let top = before ? nodeRect.bottom : nodeRect.top;
          if (before && after)
            top = (top + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2;
          rect = { left: nodeRect.left, right: nodeRect.right, top: top - this.width / 2, bottom: top + this.width / 2 };
        }
      }
    }
    if (!rect) {
      let coords = this.editorView.coordsAtPos(this.cursorPos);
      rect = { left: coords.left - this.width / 2, right: coords.left + this.width / 2, top: coords.top, bottom: coords.bottom };
    }
    let parent = this.editorView.dom.offsetParent;
    if (!this.element) {
      this.element = parent.appendChild(document.createElement("div"));
      if (this.class)
        this.element.className = this.class;
      this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;";
      if (this.color) {
        this.element.style.backgroundColor = this.color;
      }
    }
    this.element.classList.toggle("prosemirror-dropcursor-block", isBlock);
    this.element.classList.toggle("prosemirror-dropcursor-inline", !isBlock);
    let parentLeft, parentTop;
    if (!parent || parent == document.body && getComputedStyle(parent).position == "static") {
      parentLeft = -pageXOffset;
      parentTop = -pageYOffset;
    } else {
      let rect2 = parent.getBoundingClientRect();
      parentLeft = rect2.left - parent.scrollLeft;
      parentTop = rect2.top - parent.scrollTop;
    }
    this.element.style.left = rect.left - parentLeft + "px";
    this.element.style.top = rect.top - parentTop + "px";
    this.element.style.width = rect.right - rect.left + "px";
    this.element.style.height = rect.bottom - rect.top + "px";
  }
  scheduleRemoval(timeout) {
    clearTimeout(this.timeout);
    this.timeout = setTimeout(() => this.setCursor(null), timeout);
  }
  dragover(event) {
    if (!this.editorView.editable)
      return;
    let pos2 = this.editorView.posAtCoords({ left: event.clientX, top: event.clientY });
    let node3 = pos2 && pos2.inside >= 0 && this.editorView.state.doc.nodeAt(pos2.inside);
    let disableDropCursor = node3 && node3.type.spec.disableDropCursor;
    let disabled2 = typeof disableDropCursor == "function" ? disableDropCursor(this.editorView, pos2, event) : disableDropCursor;
    if (pos2 && !disabled2) {
      let target = pos2.pos;
      if (this.editorView.dragging && this.editorView.dragging.slice) {
        let point = dropPoint(this.editorView.state.doc, target, this.editorView.dragging.slice);
        if (point != null)
          target = point;
      }
      this.setCursor(target);
      this.scheduleRemoval(5e3);
    }
  }
  dragend() {
    this.scheduleRemoval(20);
  }
  drop() {
    this.scheduleRemoval(20);
  }
  dragleave(event) {
    if (event.target == this.editorView.dom || !this.editorView.dom.contains(event.relatedTarget))
      this.setCursor(null);
  }
}
const Dropcursor = Extension.create({
  name: "dropCursor",
  addOptions() {
    return {
      color: "currentColor",
      width: 1,
      class: void 0
    };
  },
  addProseMirrorPlugins() {
    return [
      dropCursor(this.options)
    ];
  }
});
class GapCursor extends Selection {
  static {
    __name(this, "GapCursor");
  }
  /**
  Create a gap cursor.
  */
  constructor($pos) {
    super($pos, $pos);
  }
  map(doc2, mapping) {
    let $pos = doc2.resolve(mapping.map(this.head));
    return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
  }
  content() {
    return Slice.empty;
  }
  eq(other) {
    return other instanceof GapCursor && other.head == this.head;
  }
  toJSON() {
    return { type: "gapcursor", pos: this.head };
  }
  /**
  @internal
  */
  static fromJSON(doc2, json) {
    if (typeof json.pos != "number")
      throw new RangeError("Invalid input for GapCursor.fromJSON");
    return new GapCursor(doc2.resolve(json.pos));
  }
  /**
  @internal
  */
  getBookmark() {
    return new GapBookmark(this.anchor);
  }
  /**
  @internal
  */
  static valid($pos) {
    let parent = $pos.parent;
    if (parent.isTextblock || !closedBefore($pos) || !closedAfter($pos))
      return false;
    let override = parent.type.spec.allowGapCursor;
    if (override != null)
      return override;
    let deflt = parent.contentMatchAt($pos.index()).defaultType;
    return deflt && deflt.isTextblock;
  }
  /**
  @internal
  */
  static findGapCursorFrom($pos, dir, mustMove = false) {
    search: for (; ; ) {
      if (!mustMove && GapCursor.valid($pos))
        return $pos;
      let pos2 = $pos.pos, next2 = null;
      for (let d = $pos.depth; ; d--) {
        let parent = $pos.node(d);
        if (dir > 0 ? $pos.indexAfter(d) < parent.childCount : $pos.index(d) > 0) {
          next2 = parent.child(dir > 0 ? $pos.indexAfter(d) : $pos.index(d) - 1);
          break;
        } else if (d == 0) {
          return null;
        }
        pos2 += dir;
        let $cur = $pos.doc.resolve(pos2);
        if (GapCursor.valid($cur))
          return $cur;
      }
      for (; ; ) {
        let inside = dir > 0 ? next2.firstChild : next2.lastChild;
        if (!inside) {
          if (next2.isAtom && !next2.isText && !NodeSelection.isSelectable(next2)) {
            $pos = $pos.doc.resolve(pos2 + next2.nodeSize * dir);
            mustMove = false;
            continue search;
          }
          break;
        }
        next2 = inside;
        pos2 += dir;
        let $cur = $pos.doc.resolve(pos2);
        if (GapCursor.valid($cur))
          return $cur;
      }
      return null;
    }
  }
}
GapCursor.prototype.visible = false;
GapCursor.findFrom = GapCursor.findGapCursorFrom;
Selection.jsonID("gapcursor", GapCursor);
class GapBookmark {
  static {
    __name(this, "GapBookmark");
  }
  constructor(pos2) {
    this.pos = pos2;
  }
  map(mapping) {
    return new GapBookmark(mapping.map(this.pos));
  }
  resolve(doc2) {
    let $pos = doc2.resolve(this.pos);
    return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
  }
}
function closedBefore($pos) {
  for (let d = $pos.depth; d >= 0; d--) {
    let index2 = $pos.index(d), parent = $pos.node(d);
    if (index2 == 0) {
      if (parent.type.spec.isolating)
        return true;
      continue;
    }
    for (let before = parent.child(index2 - 1); ; before = before.lastChild) {
      if (before.childCount == 0 && !before.inlineContent || before.isAtom || before.type.spec.isolating)
        return true;
      if (before.inlineContent)
        return false;
    }
  }
  return true;
}
__name(closedBefore, "closedBefore");
function closedAfter($pos) {
  for (let d = $pos.depth; d >= 0; d--) {
    let index2 = $pos.indexAfter(d), parent = $pos.node(d);
    if (index2 == parent.childCount) {
      if (parent.type.spec.isolating)
        return true;
      continue;
    }
    for (let after = parent.child(index2); ; after = after.firstChild) {
      if (after.childCount == 0 && !after.inlineContent || after.isAtom || after.type.spec.isolating)
        return true;
      if (after.inlineContent)
        return false;
    }
  }
  return true;
}
__name(closedAfter, "closedAfter");
function gapCursor() {
  return new Plugin({
    props: {
      decorations: drawGapCursor,
      createSelectionBetween(_view, $anchor, $head) {
        return $anchor.pos == $head.pos && GapCursor.valid($head) ? new GapCursor($head) : null;
      },
      handleClick,
      handleKeyDown,
      handleDOMEvents: { beforeinput }
    }
  });
}
__name(gapCursor, "gapCursor");
const handleKeyDown = keydownHandler({
  "ArrowLeft": arrow("horiz", -1),
  "ArrowRight": arrow("horiz", 1),
  "ArrowUp": arrow("vert", -1),
  "ArrowDown": arrow("vert", 1)
});
function arrow(axis, dir) {
  const dirStr = axis == "vert" ? dir > 0 ? "down" : "up" : dir > 0 ? "right" : "left";
  return function(state, dispatch, view) {
    let sel = state.selection;
    let $start = dir > 0 ? sel.$to : sel.$from, mustMove = sel.empty;
    if (sel instanceof TextSelection) {
      if (!view.endOfTextblock(dirStr) || $start.depth == 0)
        return false;
      mustMove = false;
      $start = state.doc.resolve(dir > 0 ? $start.after() : $start.before());
    }
    let $found = GapCursor.findGapCursorFrom($start, dir, mustMove);
    if (!$found)
      return false;
    if (dispatch)
      dispatch(state.tr.setSelection(new GapCursor($found)));
    return true;
  };
}
__name(arrow, "arrow");
function handleClick(view, pos2, event) {
  if (!view || !view.editable)
    return false;
  let $pos = view.state.doc.resolve(pos2);
  if (!GapCursor.valid($pos))
    return false;
  let clickPos = view.posAtCoords({ left: event.clientX, top: event.clientY });
  if (clickPos && clickPos.inside > -1 && NodeSelection.isSelectable(view.state.doc.nodeAt(clickPos.inside)))
    return false;
  view.dispatch(view.state.tr.setSelection(new GapCursor($pos)));
  return true;
}
__name(handleClick, "handleClick");
function beforeinput(view, event) {
  if (event.inputType != "insertCompositionText" || !(view.state.selection instanceof GapCursor))
    return false;
  let { $from } = view.state.selection;
  let insert2 = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);
  if (!insert2)
    return false;
  let frag = Fragment.empty;
  for (let i2 = insert2.length - 1; i2 >= 0; i2--)
    frag = Fragment.from(insert2[i2].createAndFill(null, frag));
  let tr2 = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));
  tr2.setSelection(TextSelection.near(tr2.doc.resolve($from.pos + 1)));
  view.dispatch(tr2);
  return false;
}
__name(beforeinput, "beforeinput");
function drawGapCursor(state) {
  if (!(state.selection instanceof GapCursor))
    return null;
  let node3 = document.createElement("div");
  node3.className = "ProseMirror-gapcursor";
  return DecorationSet.create(state.doc, [Decoration.widget(state.selection.head, node3, { key: "gapcursor" })]);
}
__name(drawGapCursor, "drawGapCursor");
const Gapcursor = Extension.create({
  name: "gapCursor",
  addProseMirrorPlugins() {
    return [
      gapCursor()
    ];
  },
  extendNodeSchema(extension) {
    var _a2;
    const context = {
      name: extension.name,
      options: extension.options,
      storage: extension.storage
    };
    return {
      allowGapCursor: (_a2 = callOrReturn(getExtensionField(extension, "allowGapCursor", context))) !== null && _a2 !== void 0 ? _a2 : null
    };
  }
});
const HardBreak$2 = Node$1.create({
  name: "hardBreak",
  addOptions() {
    return {
      keepMarks: true,
      HTMLAttributes: {}
    };
  },
  inline: true,
  group: "inline",
  selectable: false,
  linebreakReplacement: true,
  parseHTML() {
    return [
      { tag: "br" }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["br", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
  },
  renderText() {
    return "\n";
  },
  addCommands() {
    return {
      setHardBreak: /* @__PURE__ */ __name(() => ({ commands: commands2, chain, state, editor }) => {
        return commands2.first([
          () => commands2.exitCode(),
          () => commands2.command(() => {
            const { selection, storedMarks } = state;
            if (selection.$from.parent.type.spec.isolating) {
              return false;
            }
            const { keepMarks } = this.options;
            const { splittableMarks } = editor.extensionManager;
            const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
            return chain().insertContent({ type: this.name }).command(({ tr: tr2, dispatch }) => {
              if (dispatch && marks && keepMarks) {
                const filteredMarks = marks.filter((mark2) => splittableMarks.includes(mark2.type.name));
                tr2.ensureMarks(filteredMarks);
              }
              return true;
            }).run();
          })
        ]);
      }, "setHardBreak")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Enter": /* @__PURE__ */ __name(() => this.editor.commands.setHardBreak(), "Mod-Enter"),
      "Shift-Enter": /* @__PURE__ */ __name(() => this.editor.commands.setHardBreak(), "Shift-Enter")
    };
  }
});
const Heading$2 = Node$1.create({
  name: "heading",
  addOptions() {
    return {
      levels: [1, 2, 3, 4, 5, 6],
      HTMLAttributes: {}
    };
  },
  content: "inline*",
  group: "block",
  defining: true,
  addAttributes() {
    return {
      level: {
        default: 1,
        rendered: false
      }
    };
  },
  parseHTML() {
    return this.options.levels.map((level) => ({
      tag: `h${level}`,
      attrs: { level }
    }));
  },
  renderHTML({ node: node3, HTMLAttributes }) {
    const hasLevel = this.options.levels.includes(node3.attrs.level);
    const level = hasLevel ? node3.attrs.level : this.options.levels[0];
    return [`h${level}`, mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      setHeading: /* @__PURE__ */ __name((attributes) => ({ commands: commands2 }) => {
        if (!this.options.levels.includes(attributes.level)) {
          return false;
        }
        return commands2.setNode(this.name, attributes);
      }, "setHeading"),
      toggleHeading: /* @__PURE__ */ __name((attributes) => ({ commands: commands2 }) => {
        if (!this.options.levels.includes(attributes.level)) {
          return false;
        }
        return commands2.toggleNode(this.name, "paragraph", attributes);
      }, "toggleHeading")
    };
  },
  addKeyboardShortcuts() {
    return this.options.levels.reduce((items2, level) => ({
      ...items2,
      ...{
        [`Mod-Alt-${level}`]: () => this.editor.commands.toggleHeading({ level })
      }
    }), {});
  },
  addInputRules() {
    return this.options.levels.map((level) => {
      return textblockTypeInputRule({
        find: new RegExp(`^(#{1,${level}})\\s$`),
        type: this.type,
        getAttributes: {
          level
        }
      });
    });
  }
});
var GOOD_LEAF_SIZE = 200;
var RopeSequence = /* @__PURE__ */ __name(function RopeSequence2() {
}, "RopeSequence");
RopeSequence.prototype.append = /* @__PURE__ */ __name(function append2(other) {
  if (!other.length) {
    return this;
  }
  other = RopeSequence.from(other);
  return !this.length && other || other.length < GOOD_LEAF_SIZE && this.leafAppend(other) || this.length < GOOD_LEAF_SIZE && other.leafPrepend(this) || this.appendInner(other);
}, "append");
RopeSequence.prototype.prepend = /* @__PURE__ */ __name(function prepend(other) {
  if (!other.length) {
    return this;
  }
  return RopeSequence.from(other).append(this);
}, "prepend");
RopeSequence.prototype.appendInner = /* @__PURE__ */ __name(function appendInner(other) {
  return new Append(this, other);
}, "appendInner");
RopeSequence.prototype.slice = /* @__PURE__ */ __name(function slice(from2, to) {
  if (from2 === void 0) from2 = 0;
  if (to === void 0) to = this.length;
  if (from2 >= to) {
    return RopeSequence.empty;
  }
  return this.sliceInner(Math.max(0, from2), Math.min(this.length, to));
}, "slice");
RopeSequence.prototype.get = /* @__PURE__ */ __name(function get2(i2) {
  if (i2 < 0 || i2 >= this.length) {
    return void 0;
  }
  return this.getInner(i2);
}, "get");
RopeSequence.prototype.forEach = /* @__PURE__ */ __name(function forEach2(f, from2, to) {
  if (from2 === void 0) from2 = 0;
  if (to === void 0) to = this.length;
  if (from2 <= to) {
    this.forEachInner(f, from2, to, 0);
  } else {
    this.forEachInvertedInner(f, from2, to, 0);
  }
}, "forEach");
RopeSequence.prototype.map = /* @__PURE__ */ __name(function map2(f, from2, to) {
  if (from2 === void 0) from2 = 0;
  if (to === void 0) to = this.length;
  var result = [];
  this.forEach(function(elt, i2) {
    return result.push(f(elt, i2));
  }, from2, to);
  return result;
}, "map");
RopeSequence.from = /* @__PURE__ */ __name(function from(values) {
  if (values instanceof RopeSequence) {
    return values;
  }
  return values && values.length ? new Leaf(values) : RopeSequence.empty;
}, "from");
var Leaf = /* @__PURE__ */ function(RopeSequence3) {
  function Leaf2(values) {
    RopeSequence3.call(this);
    this.values = values;
  }
  __name(Leaf2, "Leaf");
  if (RopeSequence3) Leaf2.__proto__ = RopeSequence3;
  Leaf2.prototype = Object.create(RopeSequence3 && RopeSequence3.prototype);
  Leaf2.prototype.constructor = Leaf2;
  var prototypeAccessors = { length: { configurable: true }, depth: { configurable: true } };
  Leaf2.prototype.flatten = /* @__PURE__ */ __name(function flatten() {
    return this.values;
  }, "flatten");
  Leaf2.prototype.sliceInner = /* @__PURE__ */ __name(function sliceInner(from2, to) {
    if (from2 == 0 && to == this.length) {
      return this;
    }
    return new Leaf2(this.values.slice(from2, to));
  }, "sliceInner");
  Leaf2.prototype.getInner = /* @__PURE__ */ __name(function getInner(i2) {
    return this.values[i2];
  }, "getInner");
  Leaf2.prototype.forEachInner = /* @__PURE__ */ __name(function forEachInner(f, from2, to, start2) {
    for (var i2 = from2; i2 < to; i2++) {
      if (f(this.values[i2], start2 + i2) === false) {
        return false;
      }
    }
  }, "forEachInner");
  Leaf2.prototype.forEachInvertedInner = /* @__PURE__ */ __name(function forEachInvertedInner(f, from2, to, start2) {
    for (var i2 = from2 - 1; i2 >= to; i2--) {
      if (f(this.values[i2], start2 + i2) === false) {
        return false;
      }
    }
  }, "forEachInvertedInner");
  Leaf2.prototype.leafAppend = /* @__PURE__ */ __name(function leafAppend(other) {
    if (this.length + other.length <= GOOD_LEAF_SIZE) {
      return new Leaf2(this.values.concat(other.flatten()));
    }
  }, "leafAppend");
  Leaf2.prototype.leafPrepend = /* @__PURE__ */ __name(function leafPrepend(other) {
    if (this.length + other.length <= GOOD_LEAF_SIZE) {
      return new Leaf2(other.flatten().concat(this.values));
    }
  }, "leafPrepend");
  prototypeAccessors.length.get = function() {
    return this.values.length;
  };
  prototypeAccessors.depth.get = function() {
    return 0;
  };
  Object.defineProperties(Leaf2.prototype, prototypeAccessors);
  return Leaf2;
}(RopeSequence);
RopeSequence.empty = new Leaf([]);
var Append = /* @__PURE__ */ function(RopeSequence3) {
  function Append2(left, right) {
    RopeSequence3.call(this);
    this.left = left;
    this.right = right;
    this.length = left.length + right.length;
    this.depth = Math.max(left.depth, right.depth) + 1;
  }
  __name(Append2, "Append");
  if (RopeSequence3) Append2.__proto__ = RopeSequence3;
  Append2.prototype = Object.create(RopeSequence3 && RopeSequence3.prototype);
  Append2.prototype.constructor = Append2;
  Append2.prototype.flatten = /* @__PURE__ */ __name(function flatten() {
    return this.left.flatten().concat(this.right.flatten());
  }, "flatten");
  Append2.prototype.getInner = /* @__PURE__ */ __name(function getInner(i2) {
    return i2 < this.left.length ? this.left.get(i2) : this.right.get(i2 - this.left.length);
  }, "getInner");
  Append2.prototype.forEachInner = /* @__PURE__ */ __name(function forEachInner(f, from2, to, start2) {
    var leftLen = this.left.length;
    if (from2 < leftLen && this.left.forEachInner(f, from2, Math.min(to, leftLen), start2) === false) {
      return false;
    }
    if (to > leftLen && this.right.forEachInner(f, Math.max(from2 - leftLen, 0), Math.min(this.length, to) - leftLen, start2 + leftLen) === false) {
      return false;
    }
  }, "forEachInner");
  Append2.prototype.forEachInvertedInner = /* @__PURE__ */ __name(function forEachInvertedInner(f, from2, to, start2) {
    var leftLen = this.left.length;
    if (from2 > leftLen && this.right.forEachInvertedInner(f, from2 - leftLen, Math.max(to, leftLen) - leftLen, start2 + leftLen) === false) {
      return false;
    }
    if (to < leftLen && this.left.forEachInvertedInner(f, Math.min(from2, leftLen), to, start2) === false) {
      return false;
    }
  }, "forEachInvertedInner");
  Append2.prototype.sliceInner = /* @__PURE__ */ __name(function sliceInner(from2, to) {
    if (from2 == 0 && to == this.length) {
      return this;
    }
    var leftLen = this.left.length;
    if (to <= leftLen) {
      return this.left.slice(from2, to);
    }
    if (from2 >= leftLen) {
      return this.right.slice(from2 - leftLen, to - leftLen);
    }
    return this.left.slice(from2, leftLen).append(this.right.slice(0, to - leftLen));
  }, "sliceInner");
  Append2.prototype.leafAppend = /* @__PURE__ */ __name(function leafAppend(other) {
    var inner = this.right.leafAppend(other);
    if (inner) {
      return new Append2(this.left, inner);
    }
  }, "leafAppend");
  Append2.prototype.leafPrepend = /* @__PURE__ */ __name(function leafPrepend(other) {
    var inner = this.left.leafPrepend(other);
    if (inner) {
      return new Append2(inner, this.right);
    }
  }, "leafPrepend");
  Append2.prototype.appendInner = /* @__PURE__ */ __name(function appendInner2(other) {
    if (this.left.depth >= Math.max(this.right.depth, other.depth) + 1) {
      return new Append2(this.left, new Append2(this.right, other));
    }
    return new Append2(this, other);
  }, "appendInner");
  return Append2;
}(RopeSequence);
const max_empty_items = 500;
class Branch {
  static {
    __name(this, "Branch");
  }
  constructor(items2, eventCount) {
    this.items = items2;
    this.eventCount = eventCount;
  }
  // Pop the latest event off the branch's history and apply it
  // to a document transform.
  popEvent(state, preserveItems) {
    if (this.eventCount == 0)
      return null;
    let end = this.items.length;
    for (; ; end--) {
      let next2 = this.items.get(end - 1);
      if (next2.selection) {
        --end;
        break;
      }
    }
    let remap, mapFrom;
    if (preserveItems) {
      remap = this.remapping(end, this.items.length);
      mapFrom = remap.maps.length;
    }
    let transform2 = state.tr;
    let selection, remaining;
    let addAfter = [], addBefore = [];
    this.items.forEach((item3, i2) => {
      if (!item3.step) {
        if (!remap) {
          remap = this.remapping(end, i2 + 1);
          mapFrom = remap.maps.length;
        }
        mapFrom--;
        addBefore.push(item3);
        return;
      }
      if (remap) {
        addBefore.push(new Item(item3.map));
        let step3 = item3.step.map(remap.slice(mapFrom)), map3;
        if (step3 && transform2.maybeStep(step3).doc) {
          map3 = transform2.mapping.maps[transform2.mapping.maps.length - 1];
          addAfter.push(new Item(map3, void 0, void 0, addAfter.length + addBefore.length));
        }
        mapFrom--;
        if (map3)
          remap.appendMap(map3, mapFrom);
      } else {
        transform2.maybeStep(item3.step);
      }
      if (item3.selection) {
        selection = remap ? item3.selection.map(remap.slice(mapFrom)) : item3.selection;
        remaining = new Branch(this.items.slice(0, end).append(addBefore.reverse().concat(addAfter)), this.eventCount - 1);
        return false;
      }
    }, this.items.length, 0);
    return { remaining, transform: transform2, selection };
  }
  // Create a new branch with the given transform added.
  addTransform(transform2, selection, histOptions, preserveItems) {
    let newItems = [], eventCount = this.eventCount;
    let oldItems = this.items, lastItem = !preserveItems && oldItems.length ? oldItems.get(oldItems.length - 1) : null;
    for (let i2 = 0; i2 < transform2.steps.length; i2++) {
      let step3 = transform2.steps[i2].invert(transform2.docs[i2]);
      let item3 = new Item(transform2.mapping.maps[i2], step3, selection), merged;
      if (merged = lastItem && lastItem.merge(item3)) {
        item3 = merged;
        if (i2)
          newItems.pop();
        else
          oldItems = oldItems.slice(0, oldItems.length - 1);
      }
      newItems.push(item3);
      if (selection) {
        eventCount++;
        selection = void 0;
      }
      if (!preserveItems)
        lastItem = item3;
    }
    let overflow = eventCount - histOptions.depth;
    if (overflow > DEPTH_OVERFLOW) {
      oldItems = cutOffEvents(oldItems, overflow);
      eventCount -= overflow;
    }
    return new Branch(oldItems.append(newItems), eventCount);
  }
  remapping(from2, to) {
    let maps = new Mapping();
    this.items.forEach((item3, i2) => {
      let mirrorPos = item3.mirrorOffset != null && i2 - item3.mirrorOffset >= from2 ? maps.maps.length - item3.mirrorOffset : void 0;
      maps.appendMap(item3.map, mirrorPos);
    }, from2, to);
    return maps;
  }
  addMaps(array) {
    if (this.eventCount == 0)
      return this;
    return new Branch(this.items.append(array.map((map3) => new Item(map3))), this.eventCount);
  }
  // When the collab module receives remote changes, the history has
  // to know about those, so that it can adjust the steps that were
  // rebased on top of the remote changes, and include the position
  // maps for the remote changes in its array of items.
  rebased(rebasedTransform, rebasedCount) {
    if (!this.eventCount)
      return this;
    let rebasedItems = [], start2 = Math.max(0, this.items.length - rebasedCount);
    let mapping = rebasedTransform.mapping;
    let newUntil = rebasedTransform.steps.length;
    let eventCount = this.eventCount;
    this.items.forEach((item3) => {
      if (item3.selection)
        eventCount--;
    }, start2);
    let iRebased = rebasedCount;
    this.items.forEach((item3) => {
      let pos2 = mapping.getMirror(--iRebased);
      if (pos2 == null)
        return;
      newUntil = Math.min(newUntil, pos2);
      let map3 = mapping.maps[pos2];
      if (item3.step) {
        let step3 = rebasedTransform.steps[pos2].invert(rebasedTransform.docs[pos2]);
        let selection = item3.selection && item3.selection.map(mapping.slice(iRebased + 1, pos2));
        if (selection)
          eventCount++;
        rebasedItems.push(new Item(map3, step3, selection));
      } else {
        rebasedItems.push(new Item(map3));
      }
    }, start2);
    let newMaps = [];
    for (let i2 = rebasedCount; i2 < newUntil; i2++)
      newMaps.push(new Item(mapping.maps[i2]));
    let items2 = this.items.slice(0, start2).append(newMaps).append(rebasedItems);
    let branch = new Branch(items2, eventCount);
    if (branch.emptyItemCount() > max_empty_items)
      branch = branch.compress(this.items.length - rebasedItems.length);
    return branch;
  }
  emptyItemCount() {
    let count = 0;
    this.items.forEach((item3) => {
      if (!item3.step)
        count++;
    });
    return count;
  }
  // Compressing a branch means rewriting it to push the air (map-only
  // items) out. During collaboration, these naturally accumulate
  // because each remote change adds one. The `upto` argument is used
  // to ensure that only the items below a given level are compressed,
  // because `rebased` relies on a clean, untouched set of items in
  // order to associate old items with rebased steps.
  compress(upto = this.items.length) {
    let remap = this.remapping(0, upto), mapFrom = remap.maps.length;
    let items2 = [], events2 = 0;
    this.items.forEach((item3, i2) => {
      if (i2 >= upto) {
        items2.push(item3);
        if (item3.selection)
          events2++;
      } else if (item3.step) {
        let step3 = item3.step.map(remap.slice(mapFrom)), map3 = step3 && step3.getMap();
        mapFrom--;
        if (map3)
          remap.appendMap(map3, mapFrom);
        if (step3) {
          let selection = item3.selection && item3.selection.map(remap.slice(mapFrom));
          if (selection)
            events2++;
          let newItem = new Item(map3.invert(), step3, selection), merged, last = items2.length - 1;
          if (merged = items2.length && items2[last].merge(newItem))
            items2[last] = merged;
          else
            items2.push(newItem);
        }
      } else if (item3.map) {
        mapFrom--;
      }
    }, this.items.length, 0);
    return new Branch(RopeSequence.from(items2.reverse()), events2);
  }
}
Branch.empty = new Branch(RopeSequence.empty, 0);
function cutOffEvents(items2, n) {
  let cutPoint;
  items2.forEach((item3, i2) => {
    if (item3.selection && n-- == 0) {
      cutPoint = i2;
      return false;
    }
  });
  return items2.slice(cutPoint);
}
__name(cutOffEvents, "cutOffEvents");
class Item {
  static {
    __name(this, "Item");
  }
  constructor(map3, step3, selection, mirrorOffset) {
    this.map = map3;
    this.step = step3;
    this.selection = selection;
    this.mirrorOffset = mirrorOffset;
  }
  merge(other) {
    if (this.step && other.step && !other.selection) {
      let step3 = other.step.merge(this.step);
      if (step3)
        return new Item(step3.getMap().invert(), step3, this.selection);
    }
  }
}
class HistoryState {
  static {
    __name(this, "HistoryState");
  }
  constructor(done, undone, prevRanges, prevTime, prevComposition) {
    this.done = done;
    this.undone = undone;
    this.prevRanges = prevRanges;
    this.prevTime = prevTime;
    this.prevComposition = prevComposition;
  }
}
const DEPTH_OVERFLOW = 20;
function applyTransaction(history2, state, tr2, options4) {
  let historyTr = tr2.getMeta(historyKey), rebased;
  if (historyTr)
    return historyTr.historyState;
  if (tr2.getMeta(closeHistoryKey))
    history2 = new HistoryState(history2.done, history2.undone, null, 0, -1);
  let appended = tr2.getMeta("appendedTransaction");
  if (tr2.steps.length == 0) {
    return history2;
  } else if (appended && appended.getMeta(historyKey)) {
    if (appended.getMeta(historyKey).redo)
      return new HistoryState(history2.done.addTransform(tr2, void 0, options4, mustPreserveItems(state)), history2.undone, rangesFor(tr2.mapping.maps), history2.prevTime, history2.prevComposition);
    else
      return new HistoryState(history2.done, history2.undone.addTransform(tr2, void 0, options4, mustPreserveItems(state)), null, history2.prevTime, history2.prevComposition);
  } else if (tr2.getMeta("addToHistory") !== false && !(appended && appended.getMeta("addToHistory") === false)) {
    let composition = tr2.getMeta("composition");
    let newGroup = history2.prevTime == 0 || !appended && history2.prevComposition != composition && (history2.prevTime < (tr2.time || 0) - options4.newGroupDelay || !isAdjacentTo(tr2, history2.prevRanges));
    let prevRanges = appended ? mapRanges(history2.prevRanges, tr2.mapping) : rangesFor(tr2.mapping.maps);
    return new HistoryState(history2.done.addTransform(tr2, newGroup ? state.selection.getBookmark() : void 0, options4, mustPreserveItems(state)), Branch.empty, prevRanges, tr2.time, composition == null ? history2.prevComposition : composition);
  } else if (rebased = tr2.getMeta("rebased")) {
    return new HistoryState(history2.done.rebased(tr2, rebased), history2.undone.rebased(tr2, rebased), mapRanges(history2.prevRanges, tr2.mapping), history2.prevTime, history2.prevComposition);
  } else {
    return new HistoryState(history2.done.addMaps(tr2.mapping.maps), history2.undone.addMaps(tr2.mapping.maps), mapRanges(history2.prevRanges, tr2.mapping), history2.prevTime, history2.prevComposition);
  }
}
__name(applyTransaction, "applyTransaction");
function isAdjacentTo(transform2, prevRanges) {
  if (!prevRanges)
    return false;
  if (!transform2.docChanged)
    return true;
  let adjacent = false;
  transform2.mapping.maps[0].forEach((start2, end) => {
    for (let i2 = 0; i2 < prevRanges.length; i2 += 2)
      if (start2 <= prevRanges[i2 + 1] && end >= prevRanges[i2])
        adjacent = true;
  });
  return adjacent;
}
__name(isAdjacentTo, "isAdjacentTo");
function rangesFor(maps) {
  let result = [];
  for (let i2 = maps.length - 1; i2 >= 0 && result.length == 0; i2--)
    maps[i2].forEach((_from, _to, from2, to) => result.push(from2, to));
  return result;
}
__name(rangesFor, "rangesFor");
function mapRanges(ranges, mapping) {
  if (!ranges)
    return null;
  let result = [];
  for (let i2 = 0; i2 < ranges.length; i2 += 2) {
    let from2 = mapping.map(ranges[i2], 1), to = mapping.map(ranges[i2 + 1], -1);
    if (from2 <= to)
      result.push(from2, to);
  }
  return result;
}
__name(mapRanges, "mapRanges");
function histTransaction(history2, state, redo2) {
  let preserveItems = mustPreserveItems(state);
  let histOptions = historyKey.get(state).spec.config;
  let pop = (redo2 ? history2.undone : history2.done).popEvent(state, preserveItems);
  if (!pop)
    return null;
  let selection = pop.selection.resolve(pop.transform.doc);
  let added = (redo2 ? history2.done : history2.undone).addTransform(pop.transform, state.selection.getBookmark(), histOptions, preserveItems);
  let newHist = new HistoryState(redo2 ? added : pop.remaining, redo2 ? pop.remaining : added, null, 0, -1);
  return pop.transform.setSelection(selection).setMeta(historyKey, { redo: redo2, historyState: newHist });
}
__name(histTransaction, "histTransaction");
let cachedPreserveItems = false, cachedPreserveItemsPlugins = null;
function mustPreserveItems(state) {
  let plugins = state.plugins;
  if (cachedPreserveItemsPlugins != plugins) {
    cachedPreserveItems = false;
    cachedPreserveItemsPlugins = plugins;
    for (let i2 = 0; i2 < plugins.length; i2++)
      if (plugins[i2].spec.historyPreserveItems) {
        cachedPreserveItems = true;
        break;
      }
  }
  return cachedPreserveItems;
}
__name(mustPreserveItems, "mustPreserveItems");
function closeHistory(tr2) {
  return tr2.setMeta(closeHistoryKey, true);
}
__name(closeHistory, "closeHistory");
const historyKey = new PluginKey("history");
const closeHistoryKey = new PluginKey("closeHistory");
function history$1(config2 = {}) {
  config2 = {
    depth: config2.depth || 100,
    newGroupDelay: config2.newGroupDelay || 500
  };
  return new Plugin({
    key: historyKey,
    state: {
      init() {
        return new HistoryState(Branch.empty, Branch.empty, null, 0, -1);
      },
      apply(tr2, hist, state) {
        return applyTransaction(hist, state, tr2, config2);
      }
    },
    config: config2,
    props: {
      handleDOMEvents: {
        beforeinput(view, e2) {
          let inputType = e2.inputType;
          let command2 = inputType == "historyUndo" ? undo : inputType == "historyRedo" ? redo : null;
          if (!command2)
            return false;
          e2.preventDefault();
          return command2(view.state, view.dispatch);
        }
      }
    }
  });
}
__name(history$1, "history$1");
function buildCommand(redo2, scroll) {
  return (state, dispatch) => {
    let hist = historyKey.getState(state);
    if (!hist || (redo2 ? hist.undone : hist.done).eventCount == 0)
      return false;
    if (dispatch) {
      let tr2 = histTransaction(hist, state, redo2);
      if (tr2)
        dispatch(scroll ? tr2.scrollIntoView() : tr2);
    }
    return true;
  };
}
__name(buildCommand, "buildCommand");
const undo = buildCommand(false, true);
const redo = buildCommand(true, true);
const undoNoScroll = buildCommand(false, false);
const redoNoScroll = buildCommand(true, false);
function undoDepth(state) {
  let hist = historyKey.getState(state);
  return hist ? hist.done.eventCount : 0;
}
__name(undoDepth, "undoDepth");
function redoDepth(state) {
  let hist = historyKey.getState(state);
  return hist ? hist.undone.eventCount : 0;
}
__name(redoDepth, "redoDepth");
const History = Extension.create({
  name: "history",
  addOptions() {
    return {
      depth: 100,
      newGroupDelay: 500
    };
  },
  addCommands() {
    return {
      undo: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return undo(state, dispatch);
      }, "undo"),
      redo: /* @__PURE__ */ __name(() => ({ state, dispatch }) => {
        return redo(state, dispatch);
      }, "redo")
    };
  },
  addProseMirrorPlugins() {
    return [
      history$1(this.options)
    ];
  },
  addKeyboardShortcuts() {
    return {
      "Mod-z": /* @__PURE__ */ __name(() => this.editor.commands.undo(), "Mod-z"),
      "Shift-Mod-z": /* @__PURE__ */ __name(() => this.editor.commands.redo(), "Shift-Mod-z"),
      "Mod-y": /* @__PURE__ */ __name(() => this.editor.commands.redo(), "Mod-y"),
      // Russian keyboard layouts
      "Mod-я": /* @__PURE__ */ __name(() => this.editor.commands.undo(), "Mod-я"),
      "Shift-Mod-я": /* @__PURE__ */ __name(() => this.editor.commands.redo(), "Shift-Mod-я")
    };
  }
});
const HorizontalRule$2 = Node$1.create({
  name: "horizontalRule",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  group: "block",
  parseHTML() {
    return [{ tag: "hr" }];
  },
  renderHTML({ HTMLAttributes }) {
    return ["hr", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
  },
  addCommands() {
    return {
      setHorizontalRule: /* @__PURE__ */ __name(() => ({ chain, state }) => {
        const { selection } = state;
        const { $from: $originFrom, $to: $originTo } = selection;
        const currentChain = chain();
        if ($originFrom.parentOffset === 0) {
          currentChain.insertContentAt({
            from: Math.max($originFrom.pos - 1, 0),
            to: $originTo.pos
          }, {
            type: this.name
          });
        } else if (isNodeSelection(selection)) {
          currentChain.insertContentAt($originTo.pos, {
            type: this.name
          });
        } else {
          currentChain.insertContent({ type: this.name });
        }
        return currentChain.command(({ tr: tr2, dispatch }) => {
          var _a2;
          if (dispatch) {
            const { $to } = tr2.selection;
            const posAfter = $to.end();
            if ($to.nodeAfter) {
              if ($to.nodeAfter.isTextblock) {
                tr2.setSelection(TextSelection.create(tr2.doc, $to.pos + 1));
              } else if ($to.nodeAfter.isBlock) {
                tr2.setSelection(NodeSelection.create(tr2.doc, $to.pos));
              } else {
                tr2.setSelection(TextSelection.create(tr2.doc, $to.pos));
              }
            } else {
              const node3 = (_a2 = $to.parent.type.contentMatch.defaultType) === null || _a2 === void 0 ? void 0 : _a2.create();
              if (node3) {
                tr2.insert(posAfter, node3);
                tr2.setSelection(TextSelection.create(tr2.doc, posAfter + 1));
              }
            }
            tr2.scrollIntoView();
          }
          return true;
        }).run();
      }, "setHorizontalRule")
    };
  },
  addInputRules() {
    return [
      nodeInputRule({
        find: /^(?:---|—-|___\s|\*\*\*\s)$/,
        type: this.type
      })
    ];
  }
});
const starInputRegex = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/;
const starPasteRegex = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g;
const underscoreInputRegex = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/;
const underscorePasteRegex = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g;
const Italic$2 = Mark.create({
  name: "italic",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "em"
      },
      {
        tag: "i",
        getAttrs: /* @__PURE__ */ __name((node3) => node3.style.fontStyle !== "normal" && null, "getAttrs")
      },
      {
        style: "font-style=normal",
        clearMark: /* @__PURE__ */ __name((mark2) => mark2.type.name === this.name, "clearMark")
      },
      {
        style: "font-style=italic"
      }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["em", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      setItalic: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.setMark(this.name);
      }, "setItalic"),
      toggleItalic: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.toggleMark(this.name);
      }, "toggleItalic"),
      unsetItalic: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.unsetMark(this.name);
      }, "unsetItalic")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-i": /* @__PURE__ */ __name(() => this.editor.commands.toggleItalic(), "Mod-i"),
      "Mod-I": /* @__PURE__ */ __name(() => this.editor.commands.toggleItalic(), "Mod-I")
    };
  },
  addInputRules() {
    return [
      markInputRule({
        find: starInputRegex,
        type: this.type
      }),
      markInputRule({
        find: underscoreInputRegex,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      markPasteRule({
        find: starPasteRegex,
        type: this.type
      }),
      markPasteRule({
        find: underscorePasteRegex,
        type: this.type
      })
    ];
  }
});
const ListItem$2 = Node$1.create({
  name: "listItem",
  addOptions() {
    return {
      HTMLAttributes: {},
      bulletListTypeName: "bulletList",
      orderedListTypeName: "orderedList"
    };
  },
  content: "paragraph block*",
  defining: true,
  parseHTML() {
    return [
      {
        tag: "li"
      }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["li", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addKeyboardShortcuts() {
    return {
      Enter: /* @__PURE__ */ __name(() => this.editor.commands.splitListItem(this.name), "Enter"),
      Tab: /* @__PURE__ */ __name(() => this.editor.commands.sinkListItem(this.name), "Tab"),
      "Shift-Tab": /* @__PURE__ */ __name(() => this.editor.commands.liftListItem(this.name), "Shift-Tab")
    };
  }
});
const ListItemName = "listItem";
const TextStyleName = "textStyle";
const inputRegex$1 = /^(\d+)\.\s$/;
const OrderedList$2 = Node$1.create({
  name: "orderedList",
  addOptions() {
    return {
      itemTypeName: "listItem",
      HTMLAttributes: {},
      keepMarks: false,
      keepAttributes: false
    };
  },
  group: "block list",
  content() {
    return `${this.options.itemTypeName}+`;
  },
  addAttributes() {
    return {
      start: {
        default: 1,
        parseHTML: /* @__PURE__ */ __name((element) => {
          return element.hasAttribute("start") ? parseInt(element.getAttribute("start") || "", 10) : 1;
        }, "parseHTML")
      },
      type: {
        default: void 0,
        parseHTML: /* @__PURE__ */ __name((element) => element.getAttribute("type"), "parseHTML")
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "ol"
      }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    const { start: start2, ...attributesWithoutStart } = HTMLAttributes;
    return start2 === 1 ? ["ol", mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0] : ["ol", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      toggleOrderedList: /* @__PURE__ */ __name(() => ({ commands: commands2, chain }) => {
        if (this.options.keepAttributes) {
          return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run();
        }
        return commands2.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);
      }, "toggleOrderedList")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-7": /* @__PURE__ */ __name(() => this.editor.commands.toggleOrderedList(), "Mod-Shift-7")
    };
  },
  addInputRules() {
    let inputRule = wrappingInputRule({
      find: inputRegex$1,
      type: this.type,
      getAttributes: /* @__PURE__ */ __name((match2) => ({ start: +match2[1] }), "getAttributes"),
      joinPredicate: /* @__PURE__ */ __name((match2, node3) => node3.childCount + node3.attrs.start === +match2[1], "joinPredicate")
    });
    if (this.options.keepMarks || this.options.keepAttributes) {
      inputRule = wrappingInputRule({
        find: inputRegex$1,
        type: this.type,
        keepMarks: this.options.keepMarks,
        keepAttributes: this.options.keepAttributes,
        getAttributes: /* @__PURE__ */ __name((match2) => ({ start: +match2[1], ...this.editor.getAttributes(TextStyleName) }), "getAttributes"),
        joinPredicate: /* @__PURE__ */ __name((match2, node3) => node3.childCount + node3.attrs.start === +match2[1], "joinPredicate"),
        editor: this.editor
      });
    }
    return [
      inputRule
    ];
  }
});
const Paragraph$2 = Node$1.create({
  name: "paragraph",
  priority: 1e3,
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  group: "block",
  content: "inline*",
  parseHTML() {
    return [
      { tag: "p" }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["p", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      setParagraph: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.setNode(this.name);
      }, "setParagraph")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Alt-0": /* @__PURE__ */ __name(() => this.editor.commands.setParagraph(), "Mod-Alt-0")
    };
  }
});
const inputRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/;
const pasteRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g;
const Strike$2 = Mark.create({
  name: "strike",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "s"
      },
      {
        tag: "del"
      },
      {
        tag: "strike"
      },
      {
        style: "text-decoration",
        consuming: false,
        getAttrs: /* @__PURE__ */ __name((style2) => style2.includes("line-through") ? {} : false, "getAttrs")
      }
    ];
  },
  renderHTML({ HTMLAttributes }) {
    return ["s", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
  },
  addCommands() {
    return {
      setStrike: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.setMark(this.name);
      }, "setStrike"),
      toggleStrike: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.toggleMark(this.name);
      }, "toggleStrike"),
      unsetStrike: /* @__PURE__ */ __name(() => ({ commands: commands2 }) => {
        return commands2.unsetMark(this.name);
      }, "unsetStrike")
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-s": /* @__PURE__ */ __name(() => this.editor.commands.toggleStrike(), "Mod-Shift-s")
    };
  },
  addInputRules() {
    return [
      markInputRule({
        find: inputRegex,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      markPasteRule({
        find: pasteRegex,
        type: this.type
      })
    ];
  }
});
const Text$2 = Node$1.create({
  name: "text",
  group: "inline"
});
const StarterKit = Extension.create({
  name: "starterKit",
  addExtensions() {
    var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
    const extensions = [];
    if (this.options.bold !== false) {
      extensions.push(Bold$2.configure((_a2 = this.options) === null || _a2 === void 0 ? void 0 : _a2.bold));
    }
    if (this.options.blockquote !== false) {
      extensions.push(Blockquote$2.configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.blockquote));
    }
    if (this.options.bulletList !== false) {
      extensions.push(BulletList$2.configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList));
    }
    if (this.options.code !== false) {
      extensions.push(Code$2.configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code));
    }
    if (this.options.codeBlock !== false) {
      extensions.push(CodeBlock$2.configure((_e = this.options) === null || _e === void 0 ? void 0 : _e.codeBlock));
    }
    if (this.options.document !== false) {
      extensions.push(Document$1.configure((_f = this.options) === null || _f === void 0 ? void 0 : _f.document));
    }
    if (this.options.dropcursor !== false) {
      extensions.push(Dropcursor.configure((_g = this.options) === null || _g === void 0 ? void 0 : _g.dropcursor));
    }
    if (this.options.gapcursor !== false) {
      extensions.push(Gapcursor.configure((_h = this.options) === null || _h === void 0 ? void 0 : _h.gapcursor));
    }
    if (this.options.hardBreak !== false) {
      extensions.push(HardBreak$2.configure((_j = this.options) === null || _j === void 0 ? void 0 : _j.hardBreak));
    }
    if (this.options.heading !== false) {
      extensions.push(Heading$2.configure((_k = this.options) === null || _k === void 0 ? void 0 : _k.heading));
    }
    if (this.options.history !== false) {
      extensions.push(History.configure((_l = this.options) === null || _l === void 0 ? void 0 : _l.history));
    }
    if (this.options.horizontalRule !== false) {
      extensions.push(HorizontalRule$2.configure((_m = this.options) === null || _m === void 0 ? void 0 : _m.horizontalRule));
    }
    if (this.options.italic !== false) {
      extensions.push(Italic$2.configure((_o = this.options) === null || _o === void 0 ? void 0 : _o.italic));
    }
    if (this.options.listItem !== false) {
      extensions.push(ListItem$2.configure((_p = this.options) === null || _p === void 0 ? void 0 : _p.listItem));
    }
    if (this.options.orderedList !== false) {
      extensions.push(OrderedList$2.configure((_q = this.options) === null || _q === void 0 ? void 0 : _q.orderedList));
    }
    if (this.options.paragraph !== false) {
      extensions.push(Paragraph$2.configure((_r = this.options) === null || _r === void 0 ? void 0 : _r.paragraph));
    }
    if (this.options.strike !== false) {
      extensions.push(Strike$2.configure((_s = this.options) === null || _s === void 0 ? void 0 : _s.strike));
    }
    if (this.options.text !== false) {
      extensions.push(Text$2.configure((_t = this.options) === null || _t === void 0 ? void 0 : _t.text));
    }
    return extensions;
  }
});
const decodeCache = {};
function getDecodeCache(exclude) {
  let cache2 = decodeCache[exclude];
  if (cache2) {
    return cache2;
  }
  cache2 = decodeCache[exclude] = [];
  for (let i2 = 0; i2 < 128; i2++) {
    const ch = String.fromCharCode(i2);
    cache2.push(ch);
  }
  for (let i2 = 0; i2 < exclude.length; i2++) {
    const ch = exclude.charCodeAt(i2);
    cache2[ch] = "%" + ("0" + ch.toString(16).toUpperCase()).slice(-2);
  }
  return cache2;
}
__name(getDecodeCache, "getDecodeCache");
function decode$2(string, exclude) {
  if (typeof exclude !== "string") {
    exclude = decode$2.defaultChars;
  }
  const cache2 = getDecodeCache(exclude);
  return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
    let result = "";
    for (let i2 = 0, l = seq.length; i2 < l; i2 += 3) {
      const b1 = parseInt(seq.slice(i2 + 1, i2 + 3), 16);
      if (b1 < 128) {
        result += cache2[b1];
        continue;
      }
      if ((b1 & 224) === 192 && i2 + 3 < l) {
        const b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
        if ((b2 & 192) === 128) {
          const chr = b1 << 6 & 1984 | b2 & 63;
          if (chr < 128) {
            result += "��";
          } else {
            result += String.fromCharCode(chr);
          }
          i2 += 3;
          continue;
        }
      }
      if ((b1 & 240) === 224 && i2 + 6 < l) {
        const b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
        const b3 = parseInt(seq.slice(i2 + 7, i2 + 9), 16);
        if ((b2 & 192) === 128 && (b3 & 192) === 128) {
          const chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63;
          if (chr < 2048 || chr >= 55296 && chr <= 57343) {
            result += "���";
          } else {
            result += String.fromCharCode(chr);
          }
          i2 += 6;
          continue;
        }
      }
      if ((b1 & 248) === 240 && i2 + 9 < l) {
        const b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
        const b3 = parseInt(seq.slice(i2 + 7, i2 + 9), 16);
        const b4 = parseInt(seq.slice(i2 + 10, i2 + 12), 16);
        if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) {
          let chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63;
          if (chr < 65536 || chr > 1114111) {
            result += "����";
          } else {
            chr -= 65536;
            result += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023));
          }
          i2 += 9;
          continue;
        }
      }
      result += "�";
    }
    return result;
  });
}
__name(decode$2, "decode$2");
decode$2.defaultChars = ";/?:@&=+$,#";
decode$2.componentChars = "";
const encodeCache = {};
function getEncodeCache(exclude) {
  let cache2 = encodeCache[exclude];
  if (cache2) {
    return cache2;
  }
  cache2 = encodeCache[exclude] = [];
  for (let i2 = 0; i2 < 128; i2++) {
    const ch = String.fromCharCode(i2);
    if (/^[0-9a-z]$/i.test(ch)) {
      cache2.push(ch);
    } else {
      cache2.push("%" + ("0" + i2.toString(16).toUpperCase()).slice(-2));
    }
  }
  for (let i2 = 0; i2 < exclude.length; i2++) {
    cache2[exclude.charCodeAt(i2)] = exclude[i2];
  }
  return cache2;
}
__name(getEncodeCache, "getEncodeCache");
function encode$2(string, exclude, keepEscaped) {
  if (typeof exclude !== "string") {
    keepEscaped = exclude;
    exclude = encode$2.defaultChars;
  }
  if (typeof keepEscaped === "undefined") {
    keepEscaped = true;
  }
  const cache2 = getEncodeCache(exclude);
  let result = "";
  for (let i2 = 0, l = string.length; i2 < l; i2++) {
    const code2 = string.charCodeAt(i2);
    if (keepEscaped && code2 === 37 && i2 + 2 < l) {
      if (/^[0-9a-f]{2}$/i.test(string.slice(i2 + 1, i2 + 3))) {
        result += string.slice(i2, i2 + 3);
        i2 += 2;
        continue;
      }
    }
    if (code2 < 128) {
      result += cache2[code2];
      continue;
    }
    if (code2 >= 55296 && code2 <= 57343) {
      if (code2 >= 55296 && code2 <= 56319 && i2 + 1 < l) {
        const nextCode = string.charCodeAt(i2 + 1);
        if (nextCode >= 56320 && nextCode <= 57343) {
          result += encodeURIComponent(string[i2] + string[i2 + 1]);
          i2++;
          continue;
        }
      }
      result += "%EF%BF%BD";
      continue;
    }
    result += encodeURIComponent(string[i2]);
  }
  return result;
}
__name(encode$2, "encode$2");
encode$2.defaultChars = ";/?:@&=+$,-_.!~*'()#";
encode$2.componentChars = "-_.!~*'()";
function format$2(url) {
  let result = "";
  result += url.protocol || "";
  result += url.slashes ? "//" : "";
  result += url.auth ? url.auth + "@" : "";
  if (url.hostname && url.hostname.indexOf(":") !== -1) {
    result += "[" + url.hostname + "]";
  } else {
    result += url.hostname || "";
  }
  result += url.port ? ":" + url.port : "";
  result += url.pathname || "";
  result += url.search || "";
  result += url.hash || "";
  return result;
}
__name(format$2, "format$2");
;
function Url() {
  this.protocol = null;
  this.slashes = null;
  this.auth = null;
  this.port = null;
  this.hostname = null;
  this.hash = null;
  this.search = null;
  this.pathname = null;
}
__name(Url, "Url");
const protocolPattern = /^([a-z0-9.+-]+:)/i;
const portPattern = /:[0-9]*$/;
const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/;
const delims = ["<", ">", '"', "`", " ", "\r", "\n", "	"];
const unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims);
const autoEscape = ["'"].concat(unwise);
const nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape);
const hostEndingChars = ["/", "?", "#"];
const hostnameMaxLen = 255;
const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;
const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;
const hostlessProtocol = {
  javascript: true,
  "javascript:": true
};
const slashedProtocol = {
  http: true,
  https: true,
  ftp: true,
  gopher: true,
  file: true,
  "http:": true,
  "https:": true,
  "ftp:": true,
  "gopher:": true,
  "file:": true
};
function urlParse(url, slashesDenoteHost) {
  if (url && url instanceof Url) return url;
  const u = new Url();
  u.parse(url, slashesDenoteHost);
  return u;
}
__name(urlParse, "urlParse");
Url.prototype.parse = function(url, slashesDenoteHost) {
  let lowerProto, hec, slashes;
  let rest = url;
  rest = rest.trim();
  if (!slashesDenoteHost && url.split("#").length === 1) {
    const simplePath = simplePathPattern.exec(rest);
    if (simplePath) {
      this.pathname = simplePath[1];
      if (simplePath[2]) {
        this.search = simplePath[2];
      }
      return this;
    }
  }
  let proto = protocolPattern.exec(rest);
  if (proto) {
    proto = proto[0];
    lowerProto = proto.toLowerCase();
    this.protocol = proto;
    rest = rest.substr(proto.length);
  }
  if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
    slashes = rest.substr(0, 2) === "//";
    if (slashes && !(proto && hostlessProtocol[proto])) {
      rest = rest.substr(2);
      this.slashes = true;
    }
  }
  if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
    let hostEnd = -1;
    for (let i2 = 0; i2 < hostEndingChars.length; i2++) {
      hec = rest.indexOf(hostEndingChars[i2]);
      if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
        hostEnd = hec;
      }
    }
    let auth, atSign;
    if (hostEnd === -1) {
      atSign = rest.lastIndexOf("@");
    } else {
      atSign = rest.lastIndexOf("@", hostEnd);
    }
    if (atSign !== -1) {
      auth = rest.slice(0, atSign);
      rest = rest.slice(atSign + 1);
      this.auth = auth;
    }
    hostEnd = -1;
    for (let i2 = 0; i2 < nonHostChars.length; i2++) {
      hec = rest.indexOf(nonHostChars[i2]);
      if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
        hostEnd = hec;
      }
    }
    if (hostEnd === -1) {
      hostEnd = rest.length;
    }
    if (rest[hostEnd - 1] === ":") {
      hostEnd--;
    }
    const host = rest.slice(0, hostEnd);
    rest = rest.slice(hostEnd);
    this.parseHost(host);
    this.hostname = this.hostname || "";
    const ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
    if (!ipv6Hostname) {
      const hostparts = this.hostname.split(/\./);
      for (let i2 = 0, l = hostparts.length; i2 < l; i2++) {
        const part = hostparts[i2];
        if (!part) {
          continue;
        }
        if (!part.match(hostnamePartPattern)) {
          let newpart = "";
          for (let j = 0, k = part.length; j < k; j++) {
            if (part.charCodeAt(j) > 127) {
              newpart += "x";
            } else {
              newpart += part[j];
            }
          }
          if (!newpart.match(hostnamePartPattern)) {
            const validParts = hostparts.slice(0, i2);
            const notHost = hostparts.slice(i2 + 1);
            const bit = part.match(hostnamePartStart);
            if (bit) {
              validParts.push(bit[1]);
              notHost.unshift(bit[2]);
            }
            if (notHost.length) {
              rest = notHost.join(".") + rest;
            }
            this.hostname = validParts.join(".");
            break;
          }
        }
      }
    }
    if (this.hostname.length > hostnameMaxLen) {
      this.hostname = "";
    }
    if (ipv6Hostname) {
      this.hostname = this.hostname.substr(1, this.hostname.length - 2);
    }
  }
  const hash = rest.indexOf("#");
  if (hash !== -1) {
    this.hash = rest.substr(hash);
    rest = rest.slice(0, hash);
  }
  const qm = rest.indexOf("?");
  if (qm !== -1) {
    this.search = rest.substr(qm);
    rest = rest.slice(0, qm);
  }
  if (rest) {
    this.pathname = rest;
  }
  if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
    this.pathname = "";
  }
  return this;
};
Url.prototype.parseHost = function(host) {
  let port = portPattern.exec(host);
  if (port) {
    port = port[0];
    if (port !== ":") {
      this.port = port.substr(1);
    }
    host = host.substr(0, host.length - port.length);
  }
  if (host) {
    this.hostname = host;
  }
};
const mdurl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  decode: decode$2,
  encode: encode$2,
  format: format$2,
  parse: urlParse
}, Symbol.toStringTag, { value: "Module" }));
const Any = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
const Cc = /[\0-\x1F\x7F-\x9F]/;
const regex$1 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;
const P = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;
const regex = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;
const Z = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
const ucmicro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Any,
  Cc,
  Cf: regex$1,
  P,
  S: regex,
  Z
}, Symbol.toStringTag, { value: "Module" }));
const htmlDecodeTree = new Uint16Array(
  // prettier-ignore
  'ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((c) => c.charCodeAt(0))
);
const xmlDecodeTree = new Uint16Array(
  // prettier-ignore
  "Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((c) => c.charCodeAt(0))
);
var _a;
const decodeMap = /* @__PURE__ */ new Map([
  [0, 65533],
  // C1 Unicode control character reference replacements
  [128, 8364],
  [130, 8218],
  [131, 402],
  [132, 8222],
  [133, 8230],
  [134, 8224],
  [135, 8225],
  [136, 710],
  [137, 8240],
  [138, 352],
  [139, 8249],
  [140, 338],
  [142, 381],
  [145, 8216],
  [146, 8217],
  [147, 8220],
  [148, 8221],
  [149, 8226],
  [150, 8211],
  [151, 8212],
  [152, 732],
  [153, 8482],
  [154, 353],
  [155, 8250],
  [156, 339],
  [158, 382],
  [159, 376]
]);
const fromCodePoint$1 = (
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
  (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function(codePoint) {
    let output = "";
    if (codePoint > 65535) {
      codePoint -= 65536;
      output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
      codePoint = 56320 | codePoint & 1023;
    }
    output += String.fromCharCode(codePoint);
    return output;
  }
);
function replaceCodePoint(codePoint) {
  var _a2;
  if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
    return 65533;
  }
  return (_a2 = decodeMap.get(codePoint)) !== null && _a2 !== void 0 ? _a2 : codePoint;
}
__name(replaceCodePoint, "replaceCodePoint");
function decodeCodePoint(codePoint) {
  return fromCodePoint$1(replaceCodePoint(codePoint));
}
__name(decodeCodePoint, "decodeCodePoint");
var CharCodes;
(function(CharCodes2) {
  CharCodes2[CharCodes2["NUM"] = 35] = "NUM";
  CharCodes2[CharCodes2["SEMI"] = 59] = "SEMI";
  CharCodes2[CharCodes2["EQUALS"] = 61] = "EQUALS";
  CharCodes2[CharCodes2["ZERO"] = 48] = "ZERO";
  CharCodes2[CharCodes2["NINE"] = 57] = "NINE";
  CharCodes2[CharCodes2["LOWER_A"] = 97] = "LOWER_A";
  CharCodes2[CharCodes2["LOWER_F"] = 102] = "LOWER_F";
  CharCodes2[CharCodes2["LOWER_X"] = 120] = "LOWER_X";
  CharCodes2[CharCodes2["LOWER_Z"] = 122] = "LOWER_Z";
  CharCodes2[CharCodes2["UPPER_A"] = 65] = "UPPER_A";
  CharCodes2[CharCodes2["UPPER_F"] = 70] = "UPPER_F";
  CharCodes2[CharCodes2["UPPER_Z"] = 90] = "UPPER_Z";
})(CharCodes || (CharCodes = {}));
const TO_LOWER_BIT = 32;
var BinTrieFlags;
(function(BinTrieFlags2) {
  BinTrieFlags2[BinTrieFlags2["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
  BinTrieFlags2[BinTrieFlags2["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
  BinTrieFlags2[BinTrieFlags2["JUMP_TABLE"] = 127] = "JUMP_TABLE";
})(BinTrieFlags || (BinTrieFlags = {}));
function isNumber$1(code2) {
  return code2 >= CharCodes.ZERO && code2 <= CharCodes.NINE;
}
__name(isNumber$1, "isNumber$1");
function isHexadecimalCharacter(code2) {
  return code2 >= CharCodes.UPPER_A && code2 <= CharCodes.UPPER_F || code2 >= CharCodes.LOWER_A && code2 <= CharCodes.LOWER_F;
}
__name(isHexadecimalCharacter, "isHexadecimalCharacter");
function isAsciiAlphaNumeric(code2) {
  return code2 >= CharCodes.UPPER_A && code2 <= CharCodes.UPPER_Z || code2 >= CharCodes.LOWER_A && code2 <= CharCodes.LOWER_Z || isNumber$1(code2);
}
__name(isAsciiAlphaNumeric, "isAsciiAlphaNumeric");
function isEntityInAttributeInvalidEnd(code2) {
  return code2 === CharCodes.EQUALS || isAsciiAlphaNumeric(code2);
}
__name(isEntityInAttributeInvalidEnd, "isEntityInAttributeInvalidEnd");
var EntityDecoderState;
(function(EntityDecoderState2) {
  EntityDecoderState2[EntityDecoderState2["EntityStart"] = 0] = "EntityStart";
  EntityDecoderState2[EntityDecoderState2["NumericStart"] = 1] = "NumericStart";
  EntityDecoderState2[EntityDecoderState2["NumericDecimal"] = 2] = "NumericDecimal";
  EntityDecoderState2[EntityDecoderState2["NumericHex"] = 3] = "NumericHex";
  EntityDecoderState2[EntityDecoderState2["NamedEntity"] = 4] = "NamedEntity";
})(EntityDecoderState || (EntityDecoderState = {}));
var DecodingMode;
(function(DecodingMode2) {
  DecodingMode2[DecodingMode2["Legacy"] = 0] = "Legacy";
  DecodingMode2[DecodingMode2["Strict"] = 1] = "Strict";
  DecodingMode2[DecodingMode2["Attribute"] = 2] = "Attribute";
})(DecodingMode || (DecodingMode = {}));
class EntityDecoder {
  static {
    __name(this, "EntityDecoder");
  }
  constructor(decodeTree, emitCodePoint, errors2) {
    this.decodeTree = decodeTree;
    this.emitCodePoint = emitCodePoint;
    this.errors = errors2;
    this.state = EntityDecoderState.EntityStart;
    this.consumed = 1;
    this.result = 0;
    this.treeIndex = 0;
    this.excess = 1;
    this.decodeMode = DecodingMode.Strict;
  }
  /** Resets the instance to make it reusable. */
  startEntity(decodeMode) {
    this.decodeMode = decodeMode;
    this.state = EntityDecoderState.EntityStart;
    this.result = 0;
    this.treeIndex = 0;
    this.excess = 1;
    this.consumed = 1;
  }
  /**
   * Write an entity to the decoder. This can be called multiple times with partial entities.
   * If the entity is incomplete, the decoder will return -1.
   *
   * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
   * entity is incomplete, and resume when the next string is written.
   *
   * @param string The string containing the entity (or a continuation of the entity).
   * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  write(str, offset) {
    switch (this.state) {
      case EntityDecoderState.EntityStart: {
        if (str.charCodeAt(offset) === CharCodes.NUM) {
          this.state = EntityDecoderState.NumericStart;
          this.consumed += 1;
          return this.stateNumericStart(str, offset + 1);
        }
        this.state = EntityDecoderState.NamedEntity;
        return this.stateNamedEntity(str, offset);
      }
      case EntityDecoderState.NumericStart: {
        return this.stateNumericStart(str, offset);
      }
      case EntityDecoderState.NumericDecimal: {
        return this.stateNumericDecimal(str, offset);
      }
      case EntityDecoderState.NumericHex: {
        return this.stateNumericHex(str, offset);
      }
      case EntityDecoderState.NamedEntity: {
        return this.stateNamedEntity(str, offset);
      }
    }
  }
  /**
   * Switches between the numeric decimal and hexadecimal states.
   *
   * Equivalent to the `Numeric character reference state` in the HTML spec.
   *
   * @param str The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericStart(str, offset) {
    if (offset >= str.length) {
      return -1;
    }
    if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
      this.state = EntityDecoderState.NumericHex;
      this.consumed += 1;
      return this.stateNumericHex(str, offset + 1);
    }
    this.state = EntityDecoderState.NumericDecimal;
    return this.stateNumericDecimal(str, offset);
  }
  addToNumericResult(str, start2, end, base2) {
    if (start2 !== end) {
      const digitCount = end - start2;
      this.result = this.result * Math.pow(base2, digitCount) + parseInt(str.substr(start2, digitCount), base2);
      this.consumed += digitCount;
    }
  }
  /**
   * Parses a hexadecimal numeric entity.
   *
   * Equivalent to the `Hexademical character reference state` in the HTML spec.
   *
   * @param str The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericHex(str, offset) {
    const startIdx = offset;
    while (offset < str.length) {
      const char = str.charCodeAt(offset);
      if (isNumber$1(char) || isHexadecimalCharacter(char)) {
        offset += 1;
      } else {
        this.addToNumericResult(str, startIdx, offset, 16);
        return this.emitNumericEntity(char, 3);
      }
    }
    this.addToNumericResult(str, startIdx, offset, 16);
    return -1;
  }
  /**
   * Parses a decimal numeric entity.
   *
   * Equivalent to the `Decimal character reference state` in the HTML spec.
   *
   * @param str The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericDecimal(str, offset) {
    const startIdx = offset;
    while (offset < str.length) {
      const char = str.charCodeAt(offset);
      if (isNumber$1(char)) {
        offset += 1;
      } else {
        this.addToNumericResult(str, startIdx, offset, 10);
        return this.emitNumericEntity(char, 2);
      }
    }
    this.addToNumericResult(str, startIdx, offset, 10);
    return -1;
  }
  /**
   * Validate and emit a numeric entity.
   *
   * Implements the logic from the `Hexademical character reference start
   * state` and `Numeric character reference end state` in the HTML spec.
   *
   * @param lastCp The last code point of the entity. Used to see if the
   *               entity was terminated with a semicolon.
   * @param expectedLength The minimum number of characters that should be
   *                       consumed. Used to validate that at least one digit
   *                       was consumed.
   * @returns The number of characters that were consumed.
   */
  emitNumericEntity(lastCp, expectedLength) {
    var _a2;
    if (this.consumed <= expectedLength) {
      (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.absenceOfDigitsInNumericCharacterReference(this.consumed);
      return 0;
    }
    if (lastCp === CharCodes.SEMI) {
      this.consumed += 1;
    } else if (this.decodeMode === DecodingMode.Strict) {
      return 0;
    }
    this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
    if (this.errors) {
      if (lastCp !== CharCodes.SEMI) {
        this.errors.missingSemicolonAfterCharacterReference();
      }
      this.errors.validateNumericCharacterReference(this.result);
    }
    return this.consumed;
  }
  /**
   * Parses a named entity.
   *
   * Equivalent to the `Named character reference state` in the HTML spec.
   *
   * @param str The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNamedEntity(str, offset) {
    const { decodeTree } = this;
    let current = decodeTree[this.treeIndex];
    let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
    for (; offset < str.length; offset++, this.excess++) {
      const char = str.charCodeAt(offset);
      this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
      if (this.treeIndex < 0) {
        return this.result === 0 || // If we are parsing an attribute
        this.decodeMode === DecodingMode.Attribute && // We shouldn't have consumed any characters after the entity,
        (valueLength === 0 || // And there should be no invalid characters.
        isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
      }
      current = decodeTree[this.treeIndex];
      valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
      if (valueLength !== 0) {
        if (char === CharCodes.SEMI) {
          return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
        }
        if (this.decodeMode !== DecodingMode.Strict) {
          this.result = this.treeIndex;
          this.consumed += this.excess;
          this.excess = 0;
        }
      }
    }
    return -1;
  }
  /**
   * Emit a named entity that was not terminated with a semicolon.
   *
   * @returns The number of characters consumed.
   */
  emitNotTerminatedNamedEntity() {
    var _a2;
    const { result, decodeTree } = this;
    const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
    this.emitNamedEntityData(result, valueLength, this.consumed);
    (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.missingSemicolonAfterCharacterReference();
    return this.consumed;
  }
  /**
   * Emit a named entity.
   *
   * @param result The index of the entity in the decode tree.
   * @param valueLength The number of bytes in the entity.
   * @param consumed The number of characters consumed.
   *
   * @returns The number of characters consumed.
   */
  emitNamedEntityData(result, valueLength, consumed) {
    const { decodeTree } = this;
    this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed);
    if (valueLength === 3) {
      this.emitCodePoint(decodeTree[result + 2], consumed);
    }
    return consumed;
  }
  /**
   * Signal to the parser that the end of the input was reached.
   *
   * Remaining data will be emitted and relevant errors will be produced.
   *
   * @returns The number of characters consumed.
   */
  end() {
    var _a2;
    switch (this.state) {
      case EntityDecoderState.NamedEntity: {
        return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
      }
      case EntityDecoderState.NumericDecimal: {
        return this.emitNumericEntity(0, 2);
      }
      case EntityDecoderState.NumericHex: {
        return this.emitNumericEntity(0, 3);
      }
      case EntityDecoderState.NumericStart: {
        (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.absenceOfDigitsInNumericCharacterReference(this.consumed);
        return 0;
      }
      case EntityDecoderState.EntityStart: {
        return 0;
      }
    }
  }
}
function getDecoder(decodeTree) {
  let ret = "";
  const decoder = new EntityDecoder(decodeTree, (str) => ret += fromCodePoint$1(str));
  return /* @__PURE__ */ __name(function decodeWithTrie(str, decodeMode) {
    let lastIndex2 = 0;
    let offset = 0;
    while ((offset = str.indexOf("&", offset)) >= 0) {
      ret += str.slice(lastIndex2, offset);
      decoder.startEntity(decodeMode);
      const len = decoder.write(
        str,
        // Skip the "&"
        offset + 1
      );
      if (len < 0) {
        lastIndex2 = offset + decoder.end();
        break;
      }
      lastIndex2 = offset + len;
      offset = len === 0 ? lastIndex2 + 1 : lastIndex2;
    }
    const result = ret + str.slice(lastIndex2);
    ret = "";
    return result;
  }, "decodeWithTrie");
}
__name(getDecoder, "getDecoder");
function determineBranch(decodeTree, current, nodeIdx, char) {
  const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
  const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
  if (branchCount === 0) {
    return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;
  }
  if (jumpOffset) {
    const value4 = char - jumpOffset;
    return value4 < 0 || value4 >= branchCount ? -1 : decodeTree[nodeIdx + value4] - 1;
  }
  let lo = nodeIdx;
  let hi = lo + branchCount - 1;
  while (lo <= hi) {
    const mid = lo + hi >>> 1;
    const midVal = decodeTree[mid];
    if (midVal < char) {
      lo = mid + 1;
    } else if (midVal > char) {
      hi = mid - 1;
    } else {
      return decodeTree[mid + branchCount];
    }
  }
  return -1;
}
__name(determineBranch, "determineBranch");
const htmlDecoder = getDecoder(htmlDecodeTree);
const xmlDecoder = getDecoder(xmlDecodeTree);
function decodeHTML(str, mode2 = DecodingMode.Legacy) {
  return htmlDecoder(str, mode2);
}
__name(decodeHTML, "decodeHTML");
function decodeHTMLAttribute(str) {
  return htmlDecoder(str, DecodingMode.Attribute);
}
__name(decodeHTMLAttribute, "decodeHTMLAttribute");
function decodeHTMLStrict(str) {
  return htmlDecoder(str, DecodingMode.Strict);
}
__name(decodeHTMLStrict, "decodeHTMLStrict");
function decodeXML(str) {
  return xmlDecoder(str, DecodingMode.Strict);
}
__name(decodeXML, "decodeXML");
function restoreDiff(arr) {
  for (let i2 = 1; i2 < arr.length; i2++) {
    arr[i2][0] += arr[i2 - 1][0] + 1;
  }
  return arr;
}
__name(restoreDiff, "restoreDiff");
const htmlTrie = new Map(/* @__PURE__ */ restoreDiff([[9, "&Tab;"], [0, "&NewLine;"], [22, "&excl;"], [0, "&quot;"], [0, "&num;"], [0, "&dollar;"], [0, "&percnt;"], [0, "&amp;"], [0, "&apos;"], [0, "&lpar;"], [0, "&rpar;"], [0, "&ast;"], [0, "&plus;"], [0, "&comma;"], [1, "&period;"], [0, "&sol;"], [10, "&colon;"], [0, "&semi;"], [0, { v: "&lt;", n: 8402, o: "&nvlt;" }], [0, { v: "&equals;", n: 8421, o: "&bne;" }], [0, { v: "&gt;", n: 8402, o: "&nvgt;" }], [0, "&quest;"], [0, "&commat;"], [26, "&lbrack;"], [0, "&bsol;"], [0, "&rbrack;"], [0, "&Hat;"], [0, "&lowbar;"], [0, "&DiacriticalGrave;"], [5, { n: 106, o: "&fjlig;" }], [20, "&lbrace;"], [0, "&verbar;"], [0, "&rbrace;"], [34, "&nbsp;"], [0, "&iexcl;"], [0, "&cent;"], [0, "&pound;"], [0, "&curren;"], [0, "&yen;"], [0, "&brvbar;"], [0, "&sect;"], [0, "&die;"], [0, "&copy;"], [0, "&ordf;"], [0, "&laquo;"], [0, "&not;"], [0, "&shy;"], [0, "&circledR;"], [0, "&macr;"], [0, "&deg;"], [0, "&PlusMinus;"], [0, "&sup2;"], [0, "&sup3;"], [0, "&acute;"], [0, "&micro;"], [0, "&para;"], [0, "&centerdot;"], [0, "&cedil;"], [0, "&sup1;"], [0, "&ordm;"], [0, "&raquo;"], [0, "&frac14;"], [0, "&frac12;"], [0, "&frac34;"], [0, "&iquest;"], [0, "&Agrave;"], [0, "&Aacute;"], [0, "&Acirc;"], [0, "&Atilde;"], [0, "&Auml;"], [0, "&angst;"], [0, "&AElig;"], [0, "&Ccedil;"], [0, "&Egrave;"], [0, "&Eacute;"], [0, "&Ecirc;"], [0, "&Euml;"], [0, "&Igrave;"], [0, "&Iacute;"], [0, "&Icirc;"], [0, "&Iuml;"], [0, "&ETH;"], [0, "&Ntilde;"], [0, "&Ograve;"], [0, "&Oacute;"], [0, "&Ocirc;"], [0, "&Otilde;"], [0, "&Ouml;"], [0, "&times;"], [0, "&Oslash;"], [0, "&Ugrave;"], [0, "&Uacute;"], [0, "&Ucirc;"], [0, "&Uuml;"], [0, "&Yacute;"], [0, "&THORN;"], [0, "&szlig;"], [0, "&agrave;"], [0, "&aacute;"], [0, "&acirc;"], [0, "&atilde;"], [0, "&auml;"], [0, "&aring;"], [0, "&aelig;"], [0, "&ccedil;"], [0, "&egrave;"], [0, "&eacute;"], [0, "&ecirc;"], [0, "&euml;"], [0, "&igrave;"], [0, "&iacute;"], [0, "&icirc;"], [0, "&iuml;"], [0, "&eth;"], [0, "&ntilde;"], [0, "&ograve;"], [0, "&oacute;"], [0, "&ocirc;"], [0, "&otilde;"], [0, "&ouml;"], [0, "&div;"], [0, "&oslash;"], [0, "&ugrave;"], [0, "&uacute;"], [0, "&ucirc;"], [0, "&uuml;"], [0, "&yacute;"], [0, "&thorn;"], [0, "&yuml;"], [0, "&Amacr;"], [0, "&amacr;"], [0, "&Abreve;"], [0, "&abreve;"], [0, "&Aogon;"], [0, "&aogon;"], [0, "&Cacute;"], [0, "&cacute;"], [0, "&Ccirc;"], [0, "&ccirc;"], [0, "&Cdot;"], [0, "&cdot;"], [0, "&Ccaron;"], [0, "&ccaron;"], [0, "&Dcaron;"], [0, "&dcaron;"], [0, "&Dstrok;"], [0, "&dstrok;"], [0, "&Emacr;"], [0, "&emacr;"], [2, "&Edot;"], [0, "&edot;"], [0, "&Eogon;"], [0, "&eogon;"], [0, "&Ecaron;"], [0, "&ecaron;"], [0, "&Gcirc;"], [0, "&gcirc;"], [0, "&Gbreve;"], [0, "&gbreve;"], [0, "&Gdot;"], [0, "&gdot;"], [0, "&Gcedil;"], [1, "&Hcirc;"], [0, "&hcirc;"], [0, "&Hstrok;"], [0, "&hstrok;"], [0, "&Itilde;"], [0, "&itilde;"], [0, "&Imacr;"], [0, "&imacr;"], [2, "&Iogon;"], [0, "&iogon;"], [0, "&Idot;"], [0, "&imath;"], [0, "&IJlig;"], [0, "&ijlig;"], [0, "&Jcirc;"], [0, "&jcirc;"], [0, "&Kcedil;"], [0, "&kcedil;"], [0, "&kgreen;"], [0, "&Lacute;"], [0, "&lacute;"], [0, "&Lcedil;"], [0, "&lcedil;"], [0, "&Lcaron;"], [0, "&lcaron;"], [0, "&Lmidot;"], [0, "&lmidot;"], [0, "&Lstrok;"], [0, "&lstrok;"], [0, "&Nacute;"], [0, "&nacute;"], [0, "&Ncedil;"], [0, "&ncedil;"], [0, "&Ncaron;"], [0, "&ncaron;"], [0, "&napos;"], [0, "&ENG;"], [0, "&eng;"], [0, "&Omacr;"], [0, "&omacr;"], [2, "&Odblac;"], [0, "&odblac;"], [0, "&OElig;"], [0, "&oelig;"], [0, "&Racute;"], [0, "&racute;"], [0, "&Rcedil;"], [0, "&rcedil;"], [0, "&Rcaron;"], [0, "&rcaron;"], [0, "&Sacute;"], [0, "&sacute;"], [0, "&Scirc;"], [0, "&scirc;"], [0, "&Scedil;"], [0, "&scedil;"], [0, "&Scaron;"], [0, "&scaron;"], [0, "&Tcedil;"], [0, "&tcedil;"], [0, "&Tcaron;"], [0, "&tcaron;"], [0, "&Tstrok;"], [0, "&tstrok;"], [0, "&Utilde;"], [0, "&utilde;"], [0, "&Umacr;"], [0, "&umacr;"], [0, "&Ubreve;"], [0, "&ubreve;"], [0, "&Uring;"], [0, "&uring;"], [0, "&Udblac;"], [0, "&udblac;"], [0, "&Uogon;"], [0, "&uogon;"], [0, "&Wcirc;"], [0, "&wcirc;"], [0, "&Ycirc;"], [0, "&ycirc;"], [0, "&Yuml;"], [0, "&Zacute;"], [0, "&zacute;"], [0, "&Zdot;"], [0, "&zdot;"], [0, "&Zcaron;"], [0, "&zcaron;"], [19, "&fnof;"], [34, "&imped;"], [63, "&gacute;"], [65, "&jmath;"], [142, "&circ;"], [0, "&caron;"], [16, "&breve;"], [0, "&DiacriticalDot;"], [0, "&ring;"], [0, "&ogon;"], [0, "&DiacriticalTilde;"], [0, "&dblac;"], [51, "&DownBreve;"], [127, "&Alpha;"], [0, "&Beta;"], [0, "&Gamma;"], [0, "&Delta;"], [0, "&Epsilon;"], [0, "&Zeta;"], [0, "&Eta;"], [0, "&Theta;"], [0, "&Iota;"], [0, "&Kappa;"], [0, "&Lambda;"], [0, "&Mu;"], [0, "&Nu;"], [0, "&Xi;"], [0, "&Omicron;"], [0, "&Pi;"], [0, "&Rho;"], [1, "&Sigma;"], [0, "&Tau;"], [0, "&Upsilon;"], [0, "&Phi;"], [0, "&Chi;"], [0, "&Psi;"], [0, "&ohm;"], [7, "&alpha;"], [0, "&beta;"], [0, "&gamma;"], [0, "&delta;"], [0, "&epsi;"], [0, "&zeta;"], [0, "&eta;"], [0, "&theta;"], [0, "&iota;"], [0, "&kappa;"], [0, "&lambda;"], [0, "&mu;"], [0, "&nu;"], [0, "&xi;"], [0, "&omicron;"], [0, "&pi;"], [0, "&rho;"], [0, "&sigmaf;"], [0, "&sigma;"], [0, "&tau;"], [0, "&upsi;"], [0, "&phi;"], [0, "&chi;"], [0, "&psi;"], [0, "&omega;"], [7, "&thetasym;"], [0, "&Upsi;"], [2, "&phiv;"], [0, "&piv;"], [5, "&Gammad;"], [0, "&digamma;"], [18, "&kappav;"], [0, "&rhov;"], [3, "&epsiv;"], [0, "&backepsilon;"], [10, "&IOcy;"], [0, "&DJcy;"], [0, "&GJcy;"], [0, "&Jukcy;"], [0, "&DScy;"], [0, "&Iukcy;"], [0, "&YIcy;"], [0, "&Jsercy;"], [0, "&LJcy;"], [0, "&NJcy;"], [0, "&TSHcy;"], [0, "&KJcy;"], [1, "&Ubrcy;"], [0, "&DZcy;"], [0, "&Acy;"], [0, "&Bcy;"], [0, "&Vcy;"], [0, "&Gcy;"], [0, "&Dcy;"], [0, "&IEcy;"], [0, "&ZHcy;"], [0, "&Zcy;"], [0, "&Icy;"], [0, "&Jcy;"], [0, "&Kcy;"], [0, "&Lcy;"], [0, "&Mcy;"], [0, "&Ncy;"], [0, "&Ocy;"], [0, "&Pcy;"], [0, "&Rcy;"], [0, "&Scy;"], [0, "&Tcy;"], [0, "&Ucy;"], [0, "&Fcy;"], [0, "&KHcy;"], [0, "&TScy;"], [0, "&CHcy;"], [0, "&SHcy;"], [0, "&SHCHcy;"], [0, "&HARDcy;"], [0, "&Ycy;"], [0, "&SOFTcy;"], [0, "&Ecy;"], [0, "&YUcy;"], [0, "&YAcy;"], [0, "&acy;"], [0, "&bcy;"], [0, "&vcy;"], [0, "&gcy;"], [0, "&dcy;"], [0, "&iecy;"], [0, "&zhcy;"], [0, "&zcy;"], [0, "&icy;"], [0, "&jcy;"], [0, "&kcy;"], [0, "&lcy;"], [0, "&mcy;"], [0, "&ncy;"], [0, "&ocy;"], [0, "&pcy;"], [0, "&rcy;"], [0, "&scy;"], [0, "&tcy;"], [0, "&ucy;"], [0, "&fcy;"], [0, "&khcy;"], [0, "&tscy;"], [0, "&chcy;"], [0, "&shcy;"], [0, "&shchcy;"], [0, "&hardcy;"], [0, "&ycy;"], [0, "&softcy;"], [0, "&ecy;"], [0, "&yucy;"], [0, "&yacy;"], [1, "&iocy;"], [0, "&djcy;"], [0, "&gjcy;"], [0, "&jukcy;"], [0, "&dscy;"], [0, "&iukcy;"], [0, "&yicy;"], [0, "&jsercy;"], [0, "&ljcy;"], [0, "&njcy;"], [0, "&tshcy;"], [0, "&kjcy;"], [1, "&ubrcy;"], [0, "&dzcy;"], [7074, "&ensp;"], [0, "&emsp;"], [0, "&emsp13;"], [0, "&emsp14;"], [1, "&numsp;"], [0, "&puncsp;"], [0, "&ThinSpace;"], [0, "&hairsp;"], [0, "&NegativeMediumSpace;"], [0, "&zwnj;"], [0, "&zwj;"], [0, "&lrm;"], [0, "&rlm;"], [0, "&dash;"], [2, "&ndash;"], [0, "&mdash;"], [0, "&horbar;"], [0, "&Verbar;"], [1, "&lsquo;"], [0, "&CloseCurlyQuote;"], [0, "&lsquor;"], [1, "&ldquo;"], [0, "&CloseCurlyDoubleQuote;"], [0, "&bdquo;"], [1, "&dagger;"], [0, "&Dagger;"], [0, "&bull;"], [2, "&nldr;"], [0, "&hellip;"], [9, "&permil;"], [0, "&pertenk;"], [0, "&prime;"], [0, "&Prime;"], [0, "&tprime;"], [0, "&backprime;"], [3, "&lsaquo;"], [0, "&rsaquo;"], [3, "&oline;"], [2, "&caret;"], [1, "&hybull;"], [0, "&frasl;"], [10, "&bsemi;"], [7, "&qprime;"], [7, { v: "&MediumSpace;", n: 8202, o: "&ThickSpace;" }], [0, "&NoBreak;"], [0, "&af;"], [0, "&InvisibleTimes;"], [0, "&ic;"], [72, "&euro;"], [46, "&tdot;"], [0, "&DotDot;"], [37, "&complexes;"], [2, "&incare;"], [4, "&gscr;"], [0, "&hamilt;"], [0, "&Hfr;"], [0, "&Hopf;"], [0, "&planckh;"], [0, "&hbar;"], [0, "&imagline;"], [0, "&Ifr;"], [0, "&lagran;"], [0, "&ell;"], [1, "&naturals;"], [0, "&numero;"], [0, "&copysr;"], [0, "&weierp;"], [0, "&Popf;"], [0, "&Qopf;"], [0, "&realine;"], [0, "&real;"], [0, "&reals;"], [0, "&rx;"], [3, "&trade;"], [1, "&integers;"], [2, "&mho;"], [0, "&zeetrf;"], [0, "&iiota;"], [2, "&bernou;"], [0, "&Cayleys;"], [1, "&escr;"], [0, "&Escr;"], [0, "&Fouriertrf;"], [1, "&Mellintrf;"], [0, "&order;"], [0, "&alefsym;"], [0, "&beth;"], [0, "&gimel;"], [0, "&daleth;"], [12, "&CapitalDifferentialD;"], [0, "&dd;"], [0, "&ee;"], [0, "&ii;"], [10, "&frac13;"], [0, "&frac23;"], [0, "&frac15;"], [0, "&frac25;"], [0, "&frac35;"], [0, "&frac45;"], [0, "&frac16;"], [0, "&frac56;"], [0, "&frac18;"], [0, "&frac38;"], [0, "&frac58;"], [0, "&frac78;"], [49, "&larr;"], [0, "&ShortUpArrow;"], [0, "&rarr;"], [0, "&darr;"], [0, "&harr;"], [0, "&updownarrow;"], [0, "&nwarr;"], [0, "&nearr;"], [0, "&LowerRightArrow;"], [0, "&LowerLeftArrow;"], [0, "&nlarr;"], [0, "&nrarr;"], [1, { v: "&rarrw;", n: 824, o: "&nrarrw;" }], [0, "&Larr;"], [0, "&Uarr;"], [0, "&Rarr;"], [0, "&Darr;"], [0, "&larrtl;"], [0, "&rarrtl;"], [0, "&LeftTeeArrow;"], [0, "&mapstoup;"], [0, "&map;"], [0, "&DownTeeArrow;"], [1, "&hookleftarrow;"], [0, "&hookrightarrow;"], [0, "&larrlp;"], [0, "&looparrowright;"], [0, "&harrw;"], [0, "&nharr;"], [1, "&lsh;"], [0, "&rsh;"], [0, "&ldsh;"], [0, "&rdsh;"], [1, "&crarr;"], [0, "&cularr;"], [0, "&curarr;"], [2, "&circlearrowleft;"], [0, "&circlearrowright;"], [0, "&leftharpoonup;"], [0, "&DownLeftVector;"], [0, "&RightUpVector;"], [0, "&LeftUpVector;"], [0, "&rharu;"], [0, "&DownRightVector;"], [0, "&dharr;"], [0, "&dharl;"], [0, "&RightArrowLeftArrow;"], [0, "&udarr;"], [0, "&LeftArrowRightArrow;"], [0, "&leftleftarrows;"], [0, "&upuparrows;"], [0, "&rightrightarrows;"], [0, "&ddarr;"], [0, "&leftrightharpoons;"], [0, "&Equilibrium;"], [0, "&nlArr;"], [0, "&nhArr;"], [0, "&nrArr;"], [0, "&DoubleLeftArrow;"], [0, "&DoubleUpArrow;"], [0, "&DoubleRightArrow;"], [0, "&dArr;"], [0, "&DoubleLeftRightArrow;"], [0, "&DoubleUpDownArrow;"], [0, "&nwArr;"], [0, "&neArr;"], [0, "&seArr;"], [0, "&swArr;"], [0, "&lAarr;"], [0, "&rAarr;"], [1, "&zigrarr;"], [6, "&larrb;"], [0, "&rarrb;"], [15, "&DownArrowUpArrow;"], [7, "&loarr;"], [0, "&roarr;"], [0, "&hoarr;"], [0, "&forall;"], [0, "&comp;"], [0, { v: "&part;", n: 824, o: "&npart;" }], [0, "&exist;"], [0, "&nexist;"], [0, "&empty;"], [1, "&Del;"], [0, "&Element;"], [0, "&NotElement;"], [1, "&ni;"], [0, "&notni;"], [2, "&prod;"], [0, "&coprod;"], [0, "&sum;"], [0, "&minus;"], [0, "&MinusPlus;"], [0, "&dotplus;"], [1, "&Backslash;"], [0, "&lowast;"], [0, "&compfn;"], [1, "&radic;"], [2, "&prop;"], [0, "&infin;"], [0, "&angrt;"], [0, { v: "&ang;", n: 8402, o: "&nang;" }], [0, "&angmsd;"], [0, "&angsph;"], [0, "&mid;"], [0, "&nmid;"], [0, "&DoubleVerticalBar;"], [0, "&NotDoubleVerticalBar;"], [0, "&and;"], [0, "&or;"], [0, { v: "&cap;", n: 65024, o: "&caps;" }], [0, { v: "&cup;", n: 65024, o: "&cups;" }], [0, "&int;"], [0, "&Int;"], [0, "&iiint;"], [0, "&conint;"], [0, "&Conint;"], [0, "&Cconint;"], [0, "&cwint;"], [0, "&ClockwiseContourIntegral;"], [0, "&awconint;"], [0, "&there4;"], [0, "&becaus;"], [0, "&ratio;"], [0, "&Colon;"], [0, "&dotminus;"], [1, "&mDDot;"], [0, "&homtht;"], [0, { v: "&sim;", n: 8402, o: "&nvsim;" }], [0, { v: "&backsim;", n: 817, o: "&race;" }], [0, { v: "&ac;", n: 819, o: "&acE;" }], [0, "&acd;"], [0, "&VerticalTilde;"], [0, "&NotTilde;"], [0, { v: "&eqsim;", n: 824, o: "&nesim;" }], [0, "&sime;"], [0, "&NotTildeEqual;"], [0, "&cong;"], [0, "&simne;"], [0, "&ncong;"], [0, "&ap;"], [0, "&nap;"], [0, "&ape;"], [0, { v: "&apid;", n: 824, o: "&napid;" }], [0, "&backcong;"], [0, { v: "&asympeq;", n: 8402, o: "&nvap;" }], [0, { v: "&bump;", n: 824, o: "&nbump;" }], [0, { v: "&bumpe;", n: 824, o: "&nbumpe;" }], [0, { v: "&doteq;", n: 824, o: "&nedot;" }], [0, "&doteqdot;"], [0, "&efDot;"], [0, "&erDot;"], [0, "&Assign;"], [0, "&ecolon;"], [0, "&ecir;"], [0, "&circeq;"], [1, "&wedgeq;"], [0, "&veeeq;"], [1, "&triangleq;"], [2, "&equest;"], [0, "&ne;"], [0, { v: "&Congruent;", n: 8421, o: "&bnequiv;" }], [0, "&nequiv;"], [1, { v: "&le;", n: 8402, o: "&nvle;" }], [0, { v: "&ge;", n: 8402, o: "&nvge;" }], [0, { v: "&lE;", n: 824, o: "&nlE;" }], [0, { v: "&gE;", n: 824, o: "&ngE;" }], [0, { v: "&lnE;", n: 65024, o: "&lvertneqq;" }], [0, { v: "&gnE;", n: 65024, o: "&gvertneqq;" }], [0, { v: "&ll;", n: new Map(/* @__PURE__ */ restoreDiff([[824, "&nLtv;"], [7577, "&nLt;"]])) }], [0, { v: "&gg;", n: new Map(/* @__PURE__ */ restoreDiff([[824, "&nGtv;"], [7577, "&nGt;"]])) }], [0, "&between;"], [0, "&NotCupCap;"], [0, "&nless;"], [0, "&ngt;"], [0, "&nle;"], [0, "&nge;"], [0, "&lesssim;"], [0, "&GreaterTilde;"], [0, "&nlsim;"], [0, "&ngsim;"], [0, "&LessGreater;"], [0, "&gl;"], [0, "&NotLessGreater;"], [0, "&NotGreaterLess;"], [0, "&pr;"], [0, "&sc;"], [0, "&prcue;"], [0, "&sccue;"], [0, "&PrecedesTilde;"], [0, { v: "&scsim;", n: 824, o: "&NotSucceedsTilde;" }], [0, "&NotPrecedes;"], [0, "&NotSucceeds;"], [0, { v: "&sub;", n: 8402, o: "&NotSubset;" }], [0, { v: "&sup;", n: 8402, o: "&NotSuperset;" }], [0, "&nsub;"], [0, "&nsup;"], [0, "&sube;"], [0, "&supe;"], [0, "&NotSubsetEqual;"], [0, "&NotSupersetEqual;"], [0, { v: "&subne;", n: 65024, o: "&varsubsetneq;" }], [0, { v: "&supne;", n: 65024, o: "&varsupsetneq;" }], [1, "&cupdot;"], [0, "&UnionPlus;"], [0, { v: "&sqsub;", n: 824, o: "&NotSquareSubset;" }], [0, { v: "&sqsup;", n: 824, o: "&NotSquareSuperset;" }], [0, "&sqsube;"], [0, "&sqsupe;"], [0, { v: "&sqcap;", n: 65024, o: "&sqcaps;" }], [0, { v: "&sqcup;", n: 65024, o: "&sqcups;" }], [0, "&CirclePlus;"], [0, "&CircleMinus;"], [0, "&CircleTimes;"], [0, "&osol;"], [0, "&CircleDot;"], [0, "&circledcirc;"], [0, "&circledast;"], [1, "&circleddash;"], [0, "&boxplus;"], [0, "&boxminus;"], [0, "&boxtimes;"], [0, "&dotsquare;"], [0, "&RightTee;"], [0, "&dashv;"], [0, "&DownTee;"], [0, "&bot;"], [1, "&models;"], [0, "&DoubleRightTee;"], [0, "&Vdash;"], [0, "&Vvdash;"], [0, "&VDash;"], [0, "&nvdash;"], [0, "&nvDash;"], [0, "&nVdash;"], [0, "&nVDash;"], [0, "&prurel;"], [1, "&LeftTriangle;"], [0, "&RightTriangle;"], [0, { v: "&LeftTriangleEqual;", n: 8402, o: "&nvltrie;" }], [0, { v: "&RightTriangleEqual;", n: 8402, o: "&nvrtrie;" }], [0, "&origof;"], [0, "&imof;"], [0, "&multimap;"], [0, "&hercon;"], [0, "&intcal;"], [0, "&veebar;"], [1, "&barvee;"], [0, "&angrtvb;"], [0, "&lrtri;"], [0, "&bigwedge;"], [0, "&bigvee;"], [0, "&bigcap;"], [0, "&bigcup;"], [0, "&diam;"], [0, "&sdot;"], [0, "&sstarf;"], [0, "&divideontimes;"], [0, "&bowtie;"], [0, "&ltimes;"], [0, "&rtimes;"], [0, "&leftthreetimes;"], [0, "&rightthreetimes;"], [0, "&backsimeq;"], [0, "&curlyvee;"], [0, "&curlywedge;"], [0, "&Sub;"], [0, "&Sup;"], [0, "&Cap;"], [0, "&Cup;"], [0, "&fork;"], [0, "&epar;"], [0, "&lessdot;"], [0, "&gtdot;"], [0, { v: "&Ll;", n: 824, o: "&nLl;" }], [0, { v: "&Gg;", n: 824, o: "&nGg;" }], [0, { v: "&leg;", n: 65024, o: "&lesg;" }], [0, { v: "&gel;", n: 65024, o: "&gesl;" }], [2, "&cuepr;"], [0, "&cuesc;"], [0, "&NotPrecedesSlantEqual;"], [0, "&NotSucceedsSlantEqual;"], [0, "&NotSquareSubsetEqual;"], [0, "&NotSquareSupersetEqual;"], [2, "&lnsim;"], [0, "&gnsim;"], [0, "&precnsim;"], [0, "&scnsim;"], [0, "&nltri;"], [0, "&NotRightTriangle;"], [0, "&nltrie;"], [0, "&NotRightTriangleEqual;"], [0, "&vellip;"], [0, "&ctdot;"], [0, "&utdot;"], [0, "&dtdot;"], [0, "&disin;"], [0, "&isinsv;"], [0, "&isins;"], [0, { v: "&isindot;", n: 824, o: "&notindot;" }], [0, "&notinvc;"], [0, "&notinvb;"], [1, { v: "&isinE;", n: 824, o: "&notinE;" }], [0, "&nisd;"], [0, "&xnis;"], [0, "&nis;"], [0, "&notnivc;"], [0, "&notnivb;"], [6, "&barwed;"], [0, "&Barwed;"], [1, "&lceil;"], [0, "&rceil;"], [0, "&LeftFloor;"], [0, "&rfloor;"], [0, "&drcrop;"], [0, "&dlcrop;"], [0, "&urcrop;"], [0, "&ulcrop;"], [0, "&bnot;"], [1, "&profline;"], [0, "&profsurf;"], [1, "&telrec;"], [0, "&target;"], [5, "&ulcorn;"], [0, "&urcorn;"], [0, "&dlcorn;"], [0, "&drcorn;"], [2, "&frown;"], [0, "&smile;"], [9, "&cylcty;"], [0, "&profalar;"], [7, "&topbot;"], [6, "&ovbar;"], [1, "&solbar;"], [60, "&angzarr;"], [51, "&lmoustache;"], [0, "&rmoustache;"], [2, "&OverBracket;"], [0, "&bbrk;"], [0, "&bbrktbrk;"], [37, "&OverParenthesis;"], [0, "&UnderParenthesis;"], [0, "&OverBrace;"], [0, "&UnderBrace;"], [2, "&trpezium;"], [4, "&elinters;"], [59, "&blank;"], [164, "&circledS;"], [55, "&boxh;"], [1, "&boxv;"], [9, "&boxdr;"], [3, "&boxdl;"], [3, "&boxur;"], [3, "&boxul;"], [3, "&boxvr;"], [7, "&boxvl;"], [7, "&boxhd;"], [7, "&boxhu;"], [7, "&boxvh;"], [19, "&boxH;"], [0, "&boxV;"], [0, "&boxdR;"], [0, "&boxDr;"], [0, "&boxDR;"], [0, "&boxdL;"], [0, "&boxDl;"], [0, "&boxDL;"], [0, "&boxuR;"], [0, "&boxUr;"], [0, "&boxUR;"], [0, "&boxuL;"], [0, "&boxUl;"], [0, "&boxUL;"], [0, "&boxvR;"], [0, "&boxVr;"], [0, "&boxVR;"], [0, "&boxvL;"], [0, "&boxVl;"], [0, "&boxVL;"], [0, "&boxHd;"], [0, "&boxhD;"], [0, "&boxHD;"], [0, "&boxHu;"], [0, "&boxhU;"], [0, "&boxHU;"], [0, "&boxvH;"], [0, "&boxVh;"], [0, "&boxVH;"], [19, "&uhblk;"], [3, "&lhblk;"], [3, "&block;"], [8, "&blk14;"], [0, "&blk12;"], [0, "&blk34;"], [13, "&square;"], [8, "&blacksquare;"], [0, "&EmptyVerySmallSquare;"], [1, "&rect;"], [0, "&marker;"], [2, "&fltns;"], [1, "&bigtriangleup;"], [0, "&blacktriangle;"], [0, "&triangle;"], [2, "&blacktriangleright;"], [0, "&rtri;"], [3, "&bigtriangledown;"], [0, "&blacktriangledown;"], [0, "&dtri;"], [2, "&blacktriangleleft;"], [0, "&ltri;"], [6, "&loz;"], [0, "&cir;"], [32, "&tridot;"], [2, "&bigcirc;"], [8, "&ultri;"], [0, "&urtri;"], [0, "&lltri;"], [0, "&EmptySmallSquare;"], [0, "&FilledSmallSquare;"], [8, "&bigstar;"], [0, "&star;"], [7, "&phone;"], [49, "&female;"], [1, "&male;"], [29, "&spades;"], [2, "&clubs;"], [1, "&hearts;"], [0, "&diamondsuit;"], [3, "&sung;"], [2, "&flat;"], [0, "&natural;"], [0, "&sharp;"], [163, "&check;"], [3, "&cross;"], [8, "&malt;"], [21, "&sext;"], [33, "&VerticalSeparator;"], [25, "&lbbrk;"], [0, "&rbbrk;"], [84, "&bsolhsub;"], [0, "&suphsol;"], [28, "&LeftDoubleBracket;"], [0, "&RightDoubleBracket;"], [0, "&lang;"], [0, "&rang;"], [0, "&Lang;"], [0, "&Rang;"], [0, "&loang;"], [0, "&roang;"], [7, "&longleftarrow;"], [0, "&longrightarrow;"], [0, "&longleftrightarrow;"], [0, "&DoubleLongLeftArrow;"], [0, "&DoubleLongRightArrow;"], [0, "&DoubleLongLeftRightArrow;"], [1, "&longmapsto;"], [2, "&dzigrarr;"], [258, "&nvlArr;"], [0, "&nvrArr;"], [0, "&nvHarr;"], [0, "&Map;"], [6, "&lbarr;"], [0, "&bkarow;"], [0, "&lBarr;"], [0, "&dbkarow;"], [0, "&drbkarow;"], [0, "&DDotrahd;"], [0, "&UpArrowBar;"], [0, "&DownArrowBar;"], [2, "&Rarrtl;"], [2, "&latail;"], [0, "&ratail;"], [0, "&lAtail;"], [0, "&rAtail;"], [0, "&larrfs;"], [0, "&rarrfs;"], [0, "&larrbfs;"], [0, "&rarrbfs;"], [2, "&nwarhk;"], [0, "&nearhk;"], [0, "&hksearow;"], [0, "&hkswarow;"], [0, "&nwnear;"], [0, "&nesear;"], [0, "&seswar;"], [0, "&swnwar;"], [8, { v: "&rarrc;", n: 824, o: "&nrarrc;" }], [1, "&cudarrr;"], [0, "&ldca;"], [0, "&rdca;"], [0, "&cudarrl;"], [0, "&larrpl;"], [2, "&curarrm;"], [0, "&cularrp;"], [7, "&rarrpl;"], [2, "&harrcir;"], [0, "&Uarrocir;"], [0, "&lurdshar;"], [0, "&ldrushar;"], [2, "&LeftRightVector;"], [0, "&RightUpDownVector;"], [0, "&DownLeftRightVector;"], [0, "&LeftUpDownVector;"], [0, "&LeftVectorBar;"], [0, "&RightVectorBar;"], [0, "&RightUpVectorBar;"], [0, "&RightDownVectorBar;"], [0, "&DownLeftVectorBar;"], [0, "&DownRightVectorBar;"], [0, "&LeftUpVectorBar;"], [0, "&LeftDownVectorBar;"], [0, "&LeftTeeVector;"], [0, "&RightTeeVector;"], [0, "&RightUpTeeVector;"], [0, "&RightDownTeeVector;"], [0, "&DownLeftTeeVector;"], [0, "&DownRightTeeVector;"], [0, "&LeftUpTeeVector;"], [0, "&LeftDownTeeVector;"], [0, "&lHar;"], [0, "&uHar;"], [0, "&rHar;"], [0, "&dHar;"], [0, "&luruhar;"], [0, "&ldrdhar;"], [0, "&ruluhar;"], [0, "&rdldhar;"], [0, "&lharul;"], [0, "&llhard;"], [0, "&rharul;"], [0, "&lrhard;"], [0, "&udhar;"], [0, "&duhar;"], [0, "&RoundImplies;"], [0, "&erarr;"], [0, "&simrarr;"], [0, "&larrsim;"], [0, "&rarrsim;"], [0, "&rarrap;"], [0, "&ltlarr;"], [1, "&gtrarr;"], [0, "&subrarr;"], [1, "&suplarr;"], [0, "&lfisht;"], [0, "&rfisht;"], [0, "&ufisht;"], [0, "&dfisht;"], [5, "&lopar;"], [0, "&ropar;"], [4, "&lbrke;"], [0, "&rbrke;"], [0, "&lbrkslu;"], [0, "&rbrksld;"], [0, "&lbrksld;"], [0, "&rbrkslu;"], [0, "&langd;"], [0, "&rangd;"], [0, "&lparlt;"], [0, "&rpargt;"], [0, "&gtlPar;"], [0, "&ltrPar;"], [3, "&vzigzag;"], [1, "&vangrt;"], [0, "&angrtvbd;"], [6, "&ange;"], [0, "&range;"], [0, "&dwangle;"], [0, "&uwangle;"], [0, "&angmsdaa;"], [0, "&angmsdab;"], [0, "&angmsdac;"], [0, "&angmsdad;"], [0, "&angmsdae;"], [0, "&angmsdaf;"], [0, "&angmsdag;"], [0, "&angmsdah;"], [0, "&bemptyv;"], [0, "&demptyv;"], [0, "&cemptyv;"], [0, "&raemptyv;"], [0, "&laemptyv;"], [0, "&ohbar;"], [0, "&omid;"], [0, "&opar;"], [1, "&operp;"], [1, "&olcross;"], [0, "&odsold;"], [1, "&olcir;"], [0, "&ofcir;"], [0, "&olt;"], [0, "&ogt;"], [0, "&cirscir;"], [0, "&cirE;"], [0, "&solb;"], [0, "&bsolb;"], [3, "&boxbox;"], [3, "&trisb;"], [0, "&rtriltri;"], [0, { v: "&LeftTriangleBar;", n: 824, o: "&NotLeftTriangleBar;" }], [0, { v: "&RightTriangleBar;", n: 824, o: "&NotRightTriangleBar;" }], [11, "&iinfin;"], [0, "&infintie;"], [0, "&nvinfin;"], [4, "&eparsl;"], [0, "&smeparsl;"], [0, "&eqvparsl;"], [5, "&blacklozenge;"], [8, "&RuleDelayed;"], [1, "&dsol;"], [9, "&bigodot;"], [0, "&bigoplus;"], [0, "&bigotimes;"], [1, "&biguplus;"], [1, "&bigsqcup;"], [5, "&iiiint;"], [0, "&fpartint;"], [2, "&cirfnint;"], [0, "&awint;"], [0, "&rppolint;"], [0, "&scpolint;"], [0, "&npolint;"], [0, "&pointint;"], [0, "&quatint;"], [0, "&intlarhk;"], [10, "&pluscir;"], [0, "&plusacir;"], [0, "&simplus;"], [0, "&plusdu;"], [0, "&plussim;"], [0, "&plustwo;"], [1, "&mcomma;"], [0, "&minusdu;"], [2, "&loplus;"], [0, "&roplus;"], [0, "&Cross;"], [0, "&timesd;"], [0, "&timesbar;"], [1, "&smashp;"], [0, "&lotimes;"], [0, "&rotimes;"], [0, "&otimesas;"], [0, "&Otimes;"], [0, "&odiv;"], [0, "&triplus;"], [0, "&triminus;"], [0, "&tritime;"], [0, "&intprod;"], [2, "&amalg;"], [0, "&capdot;"], [1, "&ncup;"], [0, "&ncap;"], [0, "&capand;"], [0, "&cupor;"], [0, "&cupcap;"], [0, "&capcup;"], [0, "&cupbrcap;"], [0, "&capbrcup;"], [0, "&cupcup;"], [0, "&capcap;"], [0, "&ccups;"], [0, "&ccaps;"], [2, "&ccupssm;"], [2, "&And;"], [0, "&Or;"], [0, "&andand;"], [0, "&oror;"], [0, "&orslope;"], [0, "&andslope;"], [1, "&andv;"], [0, "&orv;"], [0, "&andd;"], [0, "&ord;"], [1, "&wedbar;"], [6, "&sdote;"], [3, "&simdot;"], [2, { v: "&congdot;", n: 824, o: "&ncongdot;" }], [0, "&easter;"], [0, "&apacir;"], [0, { v: "&apE;", n: 824, o: "&napE;" }], [0, "&eplus;"], [0, "&pluse;"], [0, "&Esim;"], [0, "&Colone;"], [0, "&Equal;"], [1, "&ddotseq;"], [0, "&equivDD;"], [0, "&ltcir;"], [0, "&gtcir;"], [0, "&ltquest;"], [0, "&gtquest;"], [0, { v: "&leqslant;", n: 824, o: "&nleqslant;" }], [0, { v: "&geqslant;", n: 824, o: "&ngeqslant;" }], [0, "&lesdot;"], [0, "&gesdot;"], [0, "&lesdoto;"], [0, "&gesdoto;"], [0, "&lesdotor;"], [0, "&gesdotol;"], [0, "&lap;"], [0, "&gap;"], [0, "&lne;"], [0, "&gne;"], [0, "&lnap;"], [0, "&gnap;"], [0, "&lEg;"], [0, "&gEl;"], [0, "&lsime;"], [0, "&gsime;"], [0, "&lsimg;"], [0, "&gsiml;"], [0, "&lgE;"], [0, "&glE;"], [0, "&lesges;"], [0, "&gesles;"], [0, "&els;"], [0, "&egs;"], [0, "&elsdot;"], [0, "&egsdot;"], [0, "&el;"], [0, "&eg;"], [2, "&siml;"], [0, "&simg;"], [0, "&simlE;"], [0, "&simgE;"], [0, { v: "&LessLess;", n: 824, o: "&NotNestedLessLess;" }], [0, { v: "&GreaterGreater;", n: 824, o: "&NotNestedGreaterGreater;" }], [1, "&glj;"], [0, "&gla;"], [0, "&ltcc;"], [0, "&gtcc;"], [0, "&lescc;"], [0, "&gescc;"], [0, "&smt;"], [0, "&lat;"], [0, { v: "&smte;", n: 65024, o: "&smtes;" }], [0, { v: "&late;", n: 65024, o: "&lates;" }], [0, "&bumpE;"], [0, { v: "&PrecedesEqual;", n: 824, o: "&NotPrecedesEqual;" }], [0, { v: "&sce;", n: 824, o: "&NotSucceedsEqual;" }], [2, "&prE;"], [0, "&scE;"], [0, "&precneqq;"], [0, "&scnE;"], [0, "&prap;"], [0, "&scap;"], [0, "&precnapprox;"], [0, "&scnap;"], [0, "&Pr;"], [0, "&Sc;"], [0, "&subdot;"], [0, "&supdot;"], [0, "&subplus;"], [0, "&supplus;"], [0, "&submult;"], [0, "&supmult;"], [0, "&subedot;"], [0, "&supedot;"], [0, { v: "&subE;", n: 824, o: "&nsubE;" }], [0, { v: "&supE;", n: 824, o: "&nsupE;" }], [0, "&subsim;"], [0, "&supsim;"], [2, { v: "&subnE;", n: 65024, o: "&varsubsetneqq;" }], [0, { v: "&supnE;", n: 65024, o: "&varsupsetneqq;" }], [2, "&csub;"], [0, "&csup;"], [0, "&csube;"], [0, "&csupe;"], [0, "&subsup;"], [0, "&supsub;"], [0, "&subsub;"], [0, "&supsup;"], [0, "&suphsub;"], [0, "&supdsub;"], [0, "&forkv;"], [0, "&topfork;"], [0, "&mlcp;"], [8, "&Dashv;"], [1, "&Vdashl;"], [0, "&Barv;"], [0, "&vBar;"], [0, "&vBarv;"], [1, "&Vbar;"], [0, "&Not;"], [0, "&bNot;"], [0, "&rnmid;"], [0, "&cirmid;"], [0, "&midcir;"], [0, "&topcir;"], [0, "&nhpar;"], [0, "&parsim;"], [9, { v: "&parsl;", n: 8421, o: "&nparsl;" }], [44343, { n: new Map(/* @__PURE__ */ restoreDiff([[56476, "&Ascr;"], [1, "&Cscr;"], [0, "&Dscr;"], [2, "&Gscr;"], [2, "&Jscr;"], [0, "&Kscr;"], [2, "&Nscr;"], [0, "&Oscr;"], [0, "&Pscr;"], [0, "&Qscr;"], [1, "&Sscr;"], [0, "&Tscr;"], [0, "&Uscr;"], [0, "&Vscr;"], [0, "&Wscr;"], [0, "&Xscr;"], [0, "&Yscr;"], [0, "&Zscr;"], [0, "&ascr;"], [0, "&bscr;"], [0, "&cscr;"], [0, "&dscr;"], [1, "&fscr;"], [1, "&hscr;"], [0, "&iscr;"], [0, "&jscr;"], [0, "&kscr;"], [0, "&lscr;"], [0, "&mscr;"], [0, "&nscr;"], [1, "&pscr;"], [0, "&qscr;"], [0, "&rscr;"], [0, "&sscr;"], [0, "&tscr;"], [0, "&uscr;"], [0, "&vscr;"], [0, "&wscr;"], [0, "&xscr;"], [0, "&yscr;"], [0, "&zscr;"], [52, "&Afr;"], [0, "&Bfr;"], [1, "&Dfr;"], [0, "&Efr;"], [0, "&Ffr;"], [0, "&Gfr;"], [2, "&Jfr;"], [0, "&Kfr;"], [0, "&Lfr;"], [0, "&Mfr;"], [0, "&Nfr;"], [0, "&Ofr;"], [0, "&Pfr;"], [0, "&Qfr;"], [1, "&Sfr;"], [0, "&Tfr;"], [0, "&Ufr;"], [0, "&Vfr;"], [0, "&Wfr;"], [0, "&Xfr;"], [0, "&Yfr;"], [1, "&afr;"], [0, "&bfr;"], [0, "&cfr;"], [0, "&dfr;"], [0, "&efr;"], [0, "&ffr;"], [0, "&gfr;"], [0, "&hfr;"], [0, "&ifr;"], [0, "&jfr;"], [0, "&kfr;"], [0, "&lfr;"], [0, "&mfr;"], [0, "&nfr;"], [0, "&ofr;"], [0, "&pfr;"], [0, "&qfr;"], [0, "&rfr;"], [0, "&sfr;"], [0, "&tfr;"], [0, "&ufr;"], [0, "&vfr;"], [0, "&wfr;"], [0, "&xfr;"], [0, "&yfr;"], [0, "&zfr;"], [0, "&Aopf;"], [0, "&Bopf;"], [1, "&Dopf;"], [0, "&Eopf;"], [0, "&Fopf;"], [0, "&Gopf;"], [1, "&Iopf;"], [0, "&Jopf;"], [0, "&Kopf;"], [0, "&Lopf;"], [0, "&Mopf;"], [1, "&Oopf;"], [3, "&Sopf;"], [0, "&Topf;"], [0, "&Uopf;"], [0, "&Vopf;"], [0, "&Wopf;"], [0, "&Xopf;"], [0, "&Yopf;"], [1, "&aopf;"], [0, "&bopf;"], [0, "&copf;"], [0, "&dopf;"], [0, "&eopf;"], [0, "&fopf;"], [0, "&gopf;"], [0, "&hopf;"], [0, "&iopf;"], [0, "&jopf;"], [0, "&kopf;"], [0, "&lopf;"], [0, "&mopf;"], [0, "&nopf;"], [0, "&oopf;"], [0, "&popf;"], [0, "&qopf;"], [0, "&ropf;"], [0, "&sopf;"], [0, "&topf;"], [0, "&uopf;"], [0, "&vopf;"], [0, "&wopf;"], [0, "&xopf;"], [0, "&yopf;"], [0, "&zopf;"]])) }], [8906, "&fflig;"], [0, "&filig;"], [0, "&fllig;"], [0, "&ffilig;"], [0, "&ffllig;"]]));
const xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
const xmlCodeMap = /* @__PURE__ */ new Map([
  [34, "&quot;"],
  [38, "&amp;"],
  [39, "&apos;"],
  [60, "&lt;"],
  [62, "&gt;"]
]);
const getCodePoint = (
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
  String.prototype.codePointAt != null ? (str, index2) => str.codePointAt(index2) : (
    // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
    (c, index2) => (c.charCodeAt(index2) & 64512) === 55296 ? (c.charCodeAt(index2) - 55296) * 1024 + c.charCodeAt(index2 + 1) - 56320 + 65536 : c.charCodeAt(index2)
  )
);
function encodeXML(str) {
  let ret = "";
  let lastIdx = 0;
  let match2;
  while ((match2 = xmlReplacer.exec(str)) !== null) {
    const i2 = match2.index;
    const char = str.charCodeAt(i2);
    const next2 = xmlCodeMap.get(char);
    if (next2 !== void 0) {
      ret += str.substring(lastIdx, i2) + next2;
      lastIdx = i2 + 1;
    } else {
      ret += `${str.substring(lastIdx, i2)}&#x${getCodePoint(str, i2).toString(16)};`;
      lastIdx = xmlReplacer.lastIndex += Number((char & 64512) === 55296);
    }
  }
  return ret + str.substr(lastIdx);
}
__name(encodeXML, "encodeXML");
const escape$2 = encodeXML;
function getEscaper(regex2, map3) {
  return /* @__PURE__ */ __name(function escape2(data24) {
    let match2;
    let lastIdx = 0;
    let result = "";
    while (match2 = regex2.exec(data24)) {
      if (lastIdx !== match2.index) {
        result += data24.substring(lastIdx, match2.index);
      }
      result += map3.get(match2[0].charCodeAt(0));
      lastIdx = match2.index + 1;
    }
    return result + data24.substring(lastIdx);
  }, "escape");
}
__name(getEscaper, "getEscaper");
const escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap);
const escapeAttribute = getEscaper(/["&\u00A0]/g, /* @__PURE__ */ new Map([
  [34, "&quot;"],
  [38, "&amp;"],
  [160, "&nbsp;"]
]));
const escapeText = getEscaper(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
  [38, "&amp;"],
  [60, "&lt;"],
  [62, "&gt;"],
  [160, "&nbsp;"]
]));
const htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;
function encodeHTML(data24) {
  return encodeHTMLTrieRe(htmlReplacer, data24);
}
__name(encodeHTML, "encodeHTML");
function encodeNonAsciiHTML(data24) {
  return encodeHTMLTrieRe(xmlReplacer, data24);
}
__name(encodeNonAsciiHTML, "encodeNonAsciiHTML");
function encodeHTMLTrieRe(regExp, str) {
  let ret = "";
  let lastIdx = 0;
  let match2;
  while ((match2 = regExp.exec(str)) !== null) {
    const i2 = match2.index;
    ret += str.substring(lastIdx, i2);
    const char = str.charCodeAt(i2);
    let next2 = htmlTrie.get(char);
    if (typeof next2 === "object") {
      if (i2 + 1 < str.length) {
        const nextChar = str.charCodeAt(i2 + 1);
        const value4 = typeof next2.n === "number" ? next2.n === nextChar ? next2.o : void 0 : next2.n.get(nextChar);
        if (value4 !== void 0) {
          ret += value4;
          lastIdx = regExp.lastIndex += 1;
          continue;
        }
      }
      next2 = next2.v;
    }
    if (next2 !== void 0) {
      ret += next2;
      lastIdx = i2 + 1;
    } else {
      const cp = getCodePoint(str, i2);
      ret += `&#x${cp.toString(16)};`;
      lastIdx = regExp.lastIndex += Number(cp !== char);
    }
  }
  return ret + str.substr(lastIdx);
}
__name(encodeHTMLTrieRe, "encodeHTMLTrieRe");
var EntityLevel;
(function(EntityLevel2) {
  EntityLevel2[EntityLevel2["XML"] = 0] = "XML";
  EntityLevel2[EntityLevel2["HTML"] = 1] = "HTML";
})(EntityLevel || (EntityLevel = {}));
var EncodingMode;
(function(EncodingMode2) {
  EncodingMode2[EncodingMode2["UTF8"] = 0] = "UTF8";
  EncodingMode2[EncodingMode2["ASCII"] = 1] = "ASCII";
  EncodingMode2[EncodingMode2["Extensive"] = 2] = "Extensive";
  EncodingMode2[EncodingMode2["Attribute"] = 3] = "Attribute";
  EncodingMode2[EncodingMode2["Text"] = 4] = "Text";
})(EncodingMode || (EncodingMode = {}));
function decode$1(data24, options4 = EntityLevel.XML) {
  const level = typeof options4 === "number" ? options4 : options4.level;
  if (level === EntityLevel.HTML) {
    const mode2 = typeof options4 === "object" ? options4.mode : void 0;
    return decodeHTML(data24, mode2);
  }
  return decodeXML(data24);
}
__name(decode$1, "decode$1");
function decodeStrict(data24, options4 = EntityLevel.XML) {
  var _a2;
  const opts = typeof options4 === "number" ? { level: options4 } : options4;
  (_a2 = opts.mode) !== null && _a2 !== void 0 ? _a2 : opts.mode = DecodingMode.Strict;
  return decode$1(data24, opts);
}
__name(decodeStrict, "decodeStrict");
function encode$1(data24, options4 = EntityLevel.XML) {
  const opts = typeof options4 === "number" ? { level: options4 } : options4;
  if (opts.mode === EncodingMode.UTF8)
    return escapeUTF8(data24);
  if (opts.mode === EncodingMode.Attribute)
    return escapeAttribute(data24);
  if (opts.mode === EncodingMode.Text)
    return escapeText(data24);
  if (opts.level === EntityLevel.HTML) {
    if (opts.mode === EncodingMode.ASCII) {
      return encodeNonAsciiHTML(data24);
    }
    return encodeHTML(data24);
  }
  return encodeXML(data24);
}
__name(encode$1, "encode$1");
function _class$1(obj) {
  return Object.prototype.toString.call(obj);
}
__name(_class$1, "_class$1");
function isString$2(obj) {
  return _class$1(obj) === "[object String]";
}
__name(isString$2, "isString$2");
const _hasOwnProperty = Object.prototype.hasOwnProperty;
function has(object, key) {
  return _hasOwnProperty.call(object, key);
}
__name(has, "has");
function assign$1(obj) {
  const sources = Array.prototype.slice.call(arguments, 1);
  sources.forEach(function(source) {
    if (!source) {
      return;
    }
    if (typeof source !== "object") {
      throw new TypeError(source + "must be object");
    }
    Object.keys(source).forEach(function(key) {
      obj[key] = source[key];
    });
  });
  return obj;
}
__name(assign$1, "assign$1");
function arrayReplaceAt(src, pos2, newElements) {
  return [].concat(src.slice(0, pos2), newElements, src.slice(pos2 + 1));
}
__name(arrayReplaceAt, "arrayReplaceAt");
function isValidEntityCode(c) {
  if (c >= 55296 && c <= 57343) {
    return false;
  }
  if (c >= 64976 && c <= 65007) {
    return false;
  }
  if ((c & 65535) === 65535 || (c & 65535) === 65534) {
    return false;
  }
  if (c >= 0 && c <= 8) {
    return false;
  }
  if (c === 11) {
    return false;
  }
  if (c >= 14 && c <= 31) {
    return false;
  }
  if (c >= 127 && c <= 159) {
    return false;
  }
  if (c > 1114111) {
    return false;
  }
  return true;
}
__name(isValidEntityCode, "isValidEntityCode");
function fromCodePoint(c) {
  if (c > 65535) {
    c -= 65536;
    const surrogate1 = 55296 + (c >> 10);
    const surrogate2 = 56320 + (c & 1023);
    return String.fromCharCode(surrogate1, surrogate2);
  }
  return String.fromCharCode(c);
}
__name(fromCodePoint, "fromCodePoint");
const UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g;
const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + "|" + ENTITY_RE.source, "gi");
const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
function replaceEntityPattern(match2, name2) {
  if (name2.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name2)) {
    const code2 = name2[1].toLowerCase() === "x" ? parseInt(name2.slice(2), 16) : parseInt(name2.slice(1), 10);
    if (isValidEntityCode(code2)) {
      return fromCodePoint(code2);
    }
    return match2;
  }
  const decoded = decodeHTML(match2);
  if (decoded !== match2) {
    return decoded;
  }
  return match2;
}
__name(replaceEntityPattern, "replaceEntityPattern");
function unescapeMd(str) {
  if (str.indexOf("\\") < 0) {
    return str;
  }
  return str.replace(UNESCAPE_MD_RE, "$1");
}
__name(unescapeMd, "unescapeMd");
function unescapeAll(str) {
  if (str.indexOf("\\") < 0 && str.indexOf("&") < 0) {
    return str;
  }
  return str.replace(UNESCAPE_ALL_RE, function(match2, escaped, entity2) {
    if (escaped) {
      return escaped;
    }
    return replaceEntityPattern(match2, entity2);
  });
}
__name(unescapeAll, "unescapeAll");
const HTML_ESCAPE_TEST_RE = /[&<>"]/;
const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
const HTML_REPLACEMENTS = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;"
};
function replaceUnsafeChar(ch) {
  return HTML_REPLACEMENTS[ch];
}
__name(replaceUnsafeChar, "replaceUnsafeChar");
function escapeHtml(str) {
  if (HTML_ESCAPE_TEST_RE.test(str)) {
    return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
  }
  return str;
}
__name(escapeHtml, "escapeHtml");
const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
function escapeRE$1(str) {
  return str.replace(REGEXP_ESCAPE_RE, "\\$&");
}
__name(escapeRE$1, "escapeRE$1");
function isSpace(code2) {
  switch (code2) {
    case 9:
    case 32:
      return true;
  }
  return false;
}
__name(isSpace, "isSpace");
function isWhiteSpace(code2) {
  if (code2 >= 8192 && code2 <= 8202) {
    return true;
  }
  switch (code2) {
    case 9:
    case 10:
    case 11:
    case 12:
    case 13:
    case 32:
    case 160:
    case 5760:
    case 8239:
    case 8287:
    case 12288:
      return true;
  }
  return false;
}
__name(isWhiteSpace, "isWhiteSpace");
function isPunctChar(ch) {
  return P.test(ch) || regex.test(ch);
}
__name(isPunctChar, "isPunctChar");
function isMdAsciiPunct(ch) {
  switch (ch) {
    case 33:
    case 34:
    case 35:
    case 36:
    case 37:
    case 38:
    case 39:
    case 40:
    case 41:
    case 42:
    case 43:
    case 44:
    case 45:
    case 46:
    case 47:
    case 58:
    case 59:
    case 60:
    case 61:
    case 62:
    case 63:
    case 64:
    case 91:
    case 92:
    case 93:
    case 94:
    case 95:
    case 96:
    case 123:
    case 124:
    case 125:
    case 126:
      return true;
    default:
      return false;
  }
}
__name(isMdAsciiPunct, "isMdAsciiPunct");
function normalizeReference(str) {
  str = str.trim().replace(/\s+/g, " ");
  if ("ẞ".toLowerCase() === "Ṿ") {
    str = str.replace(/ẞ/g, "ß");
  }
  return str.toLowerCase().toUpperCase();
}
__name(normalizeReference, "normalizeReference");
const lib = { mdurl, ucmicro };
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  arrayReplaceAt,
  assign: assign$1,
  escapeHtml,
  escapeRE: escapeRE$1,
  fromCodePoint,
  has,
  isMdAsciiPunct,
  isPunctChar,
  isSpace,
  isString: isString$2,
  isValidEntityCode,
  isWhiteSpace,
  lib,
  normalizeReference,
  unescapeAll,
  unescapeMd
}, Symbol.toStringTag, { value: "Module" }));
function parseLinkLabel(state, start2, disableNested) {
  let level, found2, marker, prevPos;
  const max = state.posMax;
  const oldPos = state.pos;
  state.pos = start2 + 1;
  level = 1;
  while (state.pos < max) {
    marker = state.src.charCodeAt(state.pos);
    if (marker === 93) {
      level--;
      if (level === 0) {
        found2 = true;
        break;
      }
    }
    prevPos = state.pos;
    state.md.inline.skipToken(state);
    if (marker === 91) {
      if (prevPos === state.pos - 1) {
        level++;
      } else if (disableNested) {
        state.pos = oldPos;
        return -1;
      }
    }
  }
  let labelEnd = -1;
  if (found2) {
    labelEnd = state.pos;
  }
  state.pos = oldPos;
  return labelEnd;
}
__name(parseLinkLabel, "parseLinkLabel");
function parseLinkDestination(str, start2, max) {
  let code2;
  let pos2 = start2;
  const result = {
    ok: false,
    pos: 0,
    str: ""
  };
  if (str.charCodeAt(pos2) === 60) {
    pos2++;
    while (pos2 < max) {
      code2 = str.charCodeAt(pos2);
      if (code2 === 10) {
        return result;
      }
      if (code2 === 60) {
        return result;
      }
      if (code2 === 62) {
        result.pos = pos2 + 1;
        result.str = unescapeAll(str.slice(start2 + 1, pos2));
        result.ok = true;
        return result;
      }
      if (code2 === 92 && pos2 + 1 < max) {
        pos2 += 2;
        continue;
      }
      pos2++;
    }
    return result;
  }
  let level = 0;
  while (pos2 < max) {
    code2 = str.charCodeAt(pos2);
    if (code2 === 32) {
      break;
    }
    if (code2 < 32 || code2 === 127) {
      break;
    }
    if (code2 === 92 && pos2 + 1 < max) {
      if (str.charCodeAt(pos2 + 1) === 32) {
        break;
      }
      pos2 += 2;
      continue;
    }
    if (code2 === 40) {
      level++;
      if (level > 32) {
        return result;
      }
    }
    if (code2 === 41) {
      if (level === 0) {
        break;
      }
      level--;
    }
    pos2++;
  }
  if (start2 === pos2) {
    return result;
  }
  if (level !== 0) {
    return result;
  }
  result.str = unescapeAll(str.slice(start2, pos2));
  result.pos = pos2;
  result.ok = true;
  return result;
}
__name(parseLinkDestination, "parseLinkDestination");
function parseLinkTitle(str, start2, max, prev_state) {
  let code2;
  let pos2 = start2;
  const state = {
    // if `true`, this is a valid link title
    ok: false,
    // if `true`, this link can be continued on the next line
    can_continue: false,
    // if `ok`, it's the position of the first character after the closing marker
    pos: 0,
    // if `ok`, it's the unescaped title
    str: "",
    // expected closing marker character code
    marker: 0
  };
  if (prev_state) {
    state.str = prev_state.str;
    state.marker = prev_state.marker;
  } else {
    if (pos2 >= max) {
      return state;
    }
    let marker = str.charCodeAt(pos2);
    if (marker !== 34 && marker !== 39 && marker !== 40) {
      return state;
    }
    start2++;
    pos2++;
    if (marker === 40) {
      marker = 41;
    }
    state.marker = marker;
  }
  while (pos2 < max) {
    code2 = str.charCodeAt(pos2);
    if (code2 === state.marker) {
      state.pos = pos2 + 1;
      state.str += unescapeAll(str.slice(start2, pos2));
      state.ok = true;
      return state;
    } else if (code2 === 40 && state.marker === 41) {
      return state;
    } else if (code2 === 92 && pos2 + 1 < max) {
      pos2++;
    }
    pos2++;
  }
  state.can_continue = true;
  state.str += unescapeAll(str.slice(start2, pos2));
  return state;
}
__name(parseLinkTitle, "parseLinkTitle");
const helpers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  parseLinkDestination,
  parseLinkLabel,
  parseLinkTitle
}, Symbol.toStringTag, { value: "Module" }));
const default_rules = {};
default_rules.code_inline = function(tokens, idx, options4, env, slf) {
  const token = tokens[idx];
  return "<code" + slf.renderAttrs(token) + ">" + escapeHtml(token.content) + "</code>";
};
default_rules.code_block = function(tokens, idx, options4, env, slf) {
  const token = tokens[idx];
  return "<pre" + slf.renderAttrs(token) + "><code>" + escapeHtml(tokens[idx].content) + "</code></pre>\n";
};
default_rules.fence = function(tokens, idx, options4, env, slf) {
  const token = tokens[idx];
  const info = token.info ? unescapeAll(token.info).trim() : "";
  let langName = "";
  let langAttrs = "";
  if (info) {
    const arr = info.split(/(\s+)/g);
    langName = arr[0];
    langAttrs = arr.slice(2).join("");
  }
  let highlighted;
  if (options4.highlight) {
    highlighted = options4.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);
  } else {
    highlighted = escapeHtml(token.content);
  }
  if (highlighted.indexOf("<pre") === 0) {
    return highlighted + "\n";
  }
  if (info) {
    const i2 = token.attrIndex("class");
    const tmpAttrs = token.attrs ? token.attrs.slice() : [];
    if (i2 < 0) {
      tmpAttrs.push(["class", options4.langPrefix + langName]);
    } else {
      tmpAttrs[i2] = tmpAttrs[i2].slice();
      tmpAttrs[i2][1] += " " + options4.langPrefix + langName;
    }
    const tmpToken = {
      attrs: tmpAttrs
    };
    return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>
`;
  }
  return `<pre><code${slf.renderAttrs(token)}>${highlighted}</code></pre>
`;
};
default_rules.image = function(tokens, idx, options4, env, slf) {
  const token = tokens[idx];
  token.attrs[token.attrIndex("alt")][1] = slf.renderInlineAsText(token.children, options4, env);
  return slf.renderToken(tokens, idx, options4);
};
default_rules.hardbreak = function(tokens, idx, options4) {
  return options4.xhtmlOut ? "<br />\n" : "<br>\n";
};
default_rules.softbreak = function(tokens, idx, options4) {
  return options4.breaks ? options4.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
};
default_rules.text = function(tokens, idx) {
  return escapeHtml(tokens[idx].content);
};
default_rules.html_block = function(tokens, idx) {
  return tokens[idx].content;
};
default_rules.html_inline = function(tokens, idx) {
  return tokens[idx].content;
};
function Renderer() {
  this.rules = assign$1({}, default_rules);
}
__name(Renderer, "Renderer");
Renderer.prototype.renderAttrs = /* @__PURE__ */ __name(function renderAttrs(token) {
  let i2, l, result;
  if (!token.attrs) {
    return "";
  }
  result = "";
  for (i2 = 0, l = token.attrs.length; i2 < l; i2++) {
    result += " " + escapeHtml(token.attrs[i2][0]) + '="' + escapeHtml(token.attrs[i2][1]) + '"';
  }
  return result;
}, "renderAttrs");
Renderer.prototype.renderToken = /* @__PURE__ */ __name(function renderToken(tokens, idx, options4) {
  const token = tokens[idx];
  let result = "";
  if (token.hidden) {
    return "";
  }
  if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
    result += "\n";
  }
  result += (token.nesting === -1 ? "</" : "<") + token.tag;
  result += this.renderAttrs(token);
  if (token.nesting === 0 && options4.xhtmlOut) {
    result += " /";
  }
  let needLf = false;
  if (token.block) {
    needLf = true;
    if (token.nesting === 1) {
      if (idx + 1 < tokens.length) {
        const nextToken = tokens[idx + 1];
        if (nextToken.type === "inline" || nextToken.hidden) {
          needLf = false;
        } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
          needLf = false;
        }
      }
    }
  }
  result += needLf ? ">\n" : ">";
  return result;
}, "renderToken");
Renderer.prototype.renderInline = function(tokens, options4, env) {
  let result = "";
  const rules = this.rules;
  for (let i2 = 0, len = tokens.length; i2 < len; i2++) {
    const type = tokens[i2].type;
    if (typeof rules[type] !== "undefined") {
      result += rules[type](tokens, i2, options4, env, this);
    } else {
      result += this.renderToken(tokens, i2, options4);
    }
  }
  return result;
};
Renderer.prototype.renderInlineAsText = function(tokens, options4, env) {
  let result = "";
  for (let i2 = 0, len = tokens.length; i2 < len; i2++) {
    switch (tokens[i2].type) {
      case "text":
        result += tokens[i2].content;
        break;
      case "image":
        result += this.renderInlineAsText(tokens[i2].children, options4, env);
        break;
      case "html_inline":
      case "html_block":
        result += tokens[i2].content;
        break;
      case "softbreak":
      case "hardbreak":
        result += "\n";
        break;
      default:
    }
  }
  return result;
};
Renderer.prototype.render = function(tokens, options4, env) {
  let result = "";
  const rules = this.rules;
  for (let i2 = 0, len = tokens.length; i2 < len; i2++) {
    const type = tokens[i2].type;
    if (type === "inline") {
      result += this.renderInline(tokens[i2].children, options4, env);
    } else if (typeof rules[type] !== "undefined") {
      result += rules[type](tokens, i2, options4, env, this);
    } else {
      result += this.renderToken(tokens, i2, options4, env);
    }
  }
  return result;
};
function Ruler() {
  this.__rules__ = [];
  this.__cache__ = null;
}
__name(Ruler, "Ruler");
Ruler.prototype.__find__ = function(name2) {
  for (let i2 = 0; i2 < this.__rules__.length; i2++) {
    if (this.__rules__[i2].name === name2) {
      return i2;
    }
  }
  return -1;
};
Ruler.prototype.__compile__ = function() {
  const self2 = this;
  const chains = [""];
  self2.__rules__.forEach(function(rule) {
    if (!rule.enabled) {
      return;
    }
    rule.alt.forEach(function(altName) {
      if (chains.indexOf(altName) < 0) {
        chains.push(altName);
      }
    });
  });
  self2.__cache__ = {};
  chains.forEach(function(chain) {
    self2.__cache__[chain] = [];
    self2.__rules__.forEach(function(rule) {
      if (!rule.enabled) {
        return;
      }
      if (chain && rule.alt.indexOf(chain) < 0) {
        return;
      }
      self2.__cache__[chain].push(rule.fn);
    });
  });
};
Ruler.prototype.at = function(name2, fn, options4) {
  const index2 = this.__find__(name2);
  const opt = options4 || {};
  if (index2 === -1) {
    throw new Error("Parser rule not found: " + name2);
  }
  this.__rules__[index2].fn = fn;
  this.__rules__[index2].alt = opt.alt || [];
  this.__cache__ = null;
};
Ruler.prototype.before = function(beforeName, ruleName, fn, options4) {
  const index2 = this.__find__(beforeName);
  const opt = options4 || {};
  if (index2 === -1) {
    throw new Error("Parser rule not found: " + beforeName);
  }
  this.__rules__.splice(index2, 0, {
    name: ruleName,
    enabled: true,
    fn,
    alt: opt.alt || []
  });
  this.__cache__ = null;
};
Ruler.prototype.after = function(afterName, ruleName, fn, options4) {
  const index2 = this.__find__(afterName);
  const opt = options4 || {};
  if (index2 === -1) {
    throw new Error("Parser rule not found: " + afterName);
  }
  this.__rules__.splice(index2 + 1, 0, {
    name: ruleName,
    enabled: true,
    fn,
    alt: opt.alt || []
  });
  this.__cache__ = null;
};
Ruler.prototype.push = function(ruleName, fn, options4) {
  const opt = options4 || {};
  this.__rules__.push({
    name: ruleName,
    enabled: true,
    fn,
    alt: opt.alt || []
  });
  this.__cache__ = null;
};
Ruler.prototype.enable = function(list2, ignoreInvalid) {
  if (!Array.isArray(list2)) {
    list2 = [list2];
  }
  const result = [];
  list2.forEach(function(name2) {
    const idx = this.__find__(name2);
    if (idx < 0) {
      if (ignoreInvalid) {
        return;
      }
      throw new Error("Rules manager: invalid rule name " + name2);
    }
    this.__rules__[idx].enabled = true;
    result.push(name2);
  }, this);
  this.__cache__ = null;
  return result;
};
Ruler.prototype.enableOnly = function(list2, ignoreInvalid) {
  if (!Array.isArray(list2)) {
    list2 = [list2];
  }
  this.__rules__.forEach(function(rule) {
    rule.enabled = false;
  });
  this.enable(list2, ignoreInvalid);
};
Ruler.prototype.disable = function(list2, ignoreInvalid) {
  if (!Array.isArray(list2)) {
    list2 = [list2];
  }
  const result = [];
  list2.forEach(function(name2) {
    const idx = this.__find__(name2);
    if (idx < 0) {
      if (ignoreInvalid) {
        return;
      }
      throw new Error("Rules manager: invalid rule name " + name2);
    }
    this.__rules__[idx].enabled = false;
    result.push(name2);
  }, this);
  this.__cache__ = null;
  return result;
};
Ruler.prototype.getRules = function(chainName) {
  if (this.__cache__ === null) {
    this.__compile__();
  }
  return this.__cache__[chainName] || [];
};
function Token(type, tag, nesting) {
  this.type = type;
  this.tag = tag;
  this.attrs = null;
  this.map = null;
  this.nesting = nesting;
  this.level = 0;
  this.children = null;
  this.content = "";
  this.markup = "";
  this.info = "";
  this.meta = null;
  this.block = false;
  this.hidden = false;
}
__name(Token, "Token");
Token.prototype.attrIndex = /* @__PURE__ */ __name(function attrIndex(name2) {
  if (!this.attrs) {
    return -1;
  }
  const attrs4 = this.attrs;
  for (let i2 = 0, len = attrs4.length; i2 < len; i2++) {
    if (attrs4[i2][0] === name2) {
      return i2;
    }
  }
  return -1;
}, "attrIndex");
Token.prototype.attrPush = /* @__PURE__ */ __name(function attrPush(attrData) {
  if (this.attrs) {
    this.attrs.push(attrData);
  } else {
    this.attrs = [attrData];
  }
}, "attrPush");
Token.prototype.attrSet = /* @__PURE__ */ __name(function attrSet2(name2, value4) {
  const idx = this.attrIndex(name2);
  const attrData = [name2, value4];
  if (idx < 0) {
    this.attrPush(attrData);
  } else {
    this.attrs[idx] = attrData;
  }
}, "attrSet");
Token.prototype.attrGet = /* @__PURE__ */ __name(function attrGet(name2) {
  const idx = this.attrIndex(name2);
  let value4 = null;
  if (idx >= 0) {
    value4 = this.attrs[idx][1];
  }
  return value4;
}, "attrGet");
Token.prototype.attrJoin = /* @__PURE__ */ __name(function attrJoin(name2, value4) {
  const idx = this.attrIndex(name2);
  if (idx < 0) {
    this.attrPush([name2, value4]);
  } else {
    this.attrs[idx][1] = this.attrs[idx][1] + " " + value4;
  }
}, "attrJoin");
function StateCore(src, md2, env) {
  this.src = src;
  this.env = env;
  this.tokens = [];
  this.inlineMode = false;
  this.md = md2;
}
__name(StateCore, "StateCore");
StateCore.prototype.Token = Token;
const NEWLINES_RE = /\r\n?|\n/g;
const NULL_RE = /\0/g;
function normalize(state) {
  let str;
  str = state.src.replace(NEWLINES_RE, "\n");
  str = str.replace(NULL_RE, "�");
  state.src = str;
}
__name(normalize, "normalize");
function block(state) {
  let token;
  if (state.inlineMode) {
    token = new state.Token("inline", "", 0);
    token.content = state.src;
    token.map = [0, 1];
    token.children = [];
    state.tokens.push(token);
  } else {
    state.md.block.parse(state.src, state.md, state.env, state.tokens);
  }
}
__name(block, "block");
function inline(state) {
  const tokens = state.tokens;
  for (let i2 = 0, l = tokens.length; i2 < l; i2++) {
    const tok = tokens[i2];
    if (tok.type === "inline") {
      state.md.inline.parse(tok.content, state.md, state.env, tok.children);
    }
  }
}
__name(inline, "inline");
function isLinkOpen$1(str) {
  return /^<a[>\s]/i.test(str);
}
__name(isLinkOpen$1, "isLinkOpen$1");
function isLinkClose$1(str) {
  return /^<\/a\s*>/i.test(str);
}
__name(isLinkClose$1, "isLinkClose$1");
function linkify$1(state) {
  const blockTokens = state.tokens;
  if (!state.md.options.linkify) {
    return;
  }
  for (let j = 0, l = blockTokens.length; j < l; j++) {
    if (blockTokens[j].type !== "inline" || !state.md.linkify.pretest(blockTokens[j].content)) {
      continue;
    }
    let tokens = blockTokens[j].children;
    let htmlLinkLevel = 0;
    for (let i2 = tokens.length - 1; i2 >= 0; i2--) {
      const currentToken = tokens[i2];
      if (currentToken.type === "link_close") {
        i2--;
        while (tokens[i2].level !== currentToken.level && tokens[i2].type !== "link_open") {
          i2--;
        }
        continue;
      }
      if (currentToken.type === "html_inline") {
        if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) {
          htmlLinkLevel--;
        }
        if (isLinkClose$1(currentToken.content)) {
          htmlLinkLevel++;
        }
      }
      if (htmlLinkLevel > 0) {
        continue;
      }
      if (currentToken.type === "text" && state.md.linkify.test(currentToken.content)) {
        const text2 = currentToken.content;
        let links = state.md.linkify.match(text2);
        const nodes = [];
        let level = currentToken.level;
        let lastPos = 0;
        if (links.length > 0 && links[0].index === 0 && i2 > 0 && tokens[i2 - 1].type === "text_special") {
          links = links.slice(1);
        }
        for (let ln = 0; ln < links.length; ln++) {
          const url = links[ln].url;
          const fullUrl = state.md.normalizeLink(url);
          if (!state.md.validateLink(fullUrl)) {
            continue;
          }
          let urlText = links[ln].text;
          if (!links[ln].schema) {
            urlText = state.md.normalizeLinkText("http://" + urlText).replace(/^http:\/\//, "");
          } else if (links[ln].schema === "mailto:" && !/^mailto:/i.test(urlText)) {
            urlText = state.md.normalizeLinkText("mailto:" + urlText).replace(/^mailto:/, "");
          } else {
            urlText = state.md.normalizeLinkText(urlText);
          }
          const pos2 = links[ln].index;
          if (pos2 > lastPos) {
            const token = new state.Token("text", "", 0);
            token.content = text2.slice(lastPos, pos2);
            token.level = level;
            nodes.push(token);
          }
          const token_o = new state.Token("link_open", "a", 1);
          token_o.attrs = [["href", fullUrl]];
          token_o.level = level++;
          token_o.markup = "linkify";
          token_o.info = "auto";
          nodes.push(token_o);
          const token_t = new state.Token("text", "", 0);
          token_t.content = urlText;
          token_t.level = level;
          nodes.push(token_t);
          const token_c = new state.Token("link_close", "a", -1);
          token_c.level = --level;
          token_c.markup = "linkify";
          token_c.info = "auto";
          nodes.push(token_c);
          lastPos = links[ln].lastIndex;
        }
        if (lastPos < text2.length) {
          const token = new state.Token("text", "", 0);
          token.content = text2.slice(lastPos);
          token.level = level;
          nodes.push(token);
        }
        blockTokens[j].children = tokens = arrayReplaceAt(tokens, i2, nodes);
      }
    }
  }
}
__name(linkify$1, "linkify$1");
const RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
const SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i;
const SCOPED_ABBR_RE = /\((c|tm|r)\)/ig;
const SCOPED_ABBR = {
  c: "©",
  r: "®",
  tm: "™"
};
function replaceFn(match2, name2) {
  return SCOPED_ABBR[name2.toLowerCase()];
}
__name(replaceFn, "replaceFn");
function replace_scoped(inlineTokens) {
  let inside_autolink = 0;
  for (let i2 = inlineTokens.length - 1; i2 >= 0; i2--) {
    const token = inlineTokens[i2];
    if (token.type === "text" && !inside_autolink) {
      token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
    }
    if (token.type === "link_open" && token.info === "auto") {
      inside_autolink--;
    }
    if (token.type === "link_close" && token.info === "auto") {
      inside_autolink++;
    }
  }
}
__name(replace_scoped, "replace_scoped");
function replace_rare(inlineTokens) {
  let inside_autolink = 0;
  for (let i2 = inlineTokens.length - 1; i2 >= 0; i2--) {
    const token = inlineTokens[i2];
    if (token.type === "text" && !inside_autolink) {
      if (RARE_RE.test(token.content)) {
        token.content = token.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1—").replace(/(^|\s)--(?=\s|$)/mg, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1–");
      }
    }
    if (token.type === "link_open" && token.info === "auto") {
      inside_autolink--;
    }
    if (token.type === "link_close" && token.info === "auto") {
      inside_autolink++;
    }
  }
}
__name(replace_rare, "replace_rare");
function replace(state) {
  let blkIdx;
  if (!state.md.options.typographer) {
    return;
  }
  for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
    if (state.tokens[blkIdx].type !== "inline") {
      continue;
    }
    if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
      replace_scoped(state.tokens[blkIdx].children);
    }
    if (RARE_RE.test(state.tokens[blkIdx].content)) {
      replace_rare(state.tokens[blkIdx].children);
    }
  }
}
__name(replace, "replace");
const QUOTE_TEST_RE = /['"]/;
const QUOTE_RE = /['"]/g;
const APOSTROPHE = "’";
function replaceAt(str, index2, ch) {
  return str.slice(0, index2) + ch + str.slice(index2 + 1);
}
__name(replaceAt, "replaceAt");
function process_inlines(tokens, state) {
  let j;
  const stack2 = [];
  for (let i2 = 0; i2 < tokens.length; i2++) {
    const token = tokens[i2];
    const thisLevel = tokens[i2].level;
    for (j = stack2.length - 1; j >= 0; j--) {
      if (stack2[j].level <= thisLevel) {
        break;
      }
    }
    stack2.length = j + 1;
    if (token.type !== "text") {
      continue;
    }
    let text2 = token.content;
    let pos2 = 0;
    let max = text2.length;
    OUTER:
      while (pos2 < max) {
        QUOTE_RE.lastIndex = pos2;
        const t2 = QUOTE_RE.exec(text2);
        if (!t2) {
          break;
        }
        let canOpen = true;
        let canClose = true;
        pos2 = t2.index + 1;
        const isSingle = t2[0] === "'";
        let lastChar = 32;
        if (t2.index - 1 >= 0) {
          lastChar = text2.charCodeAt(t2.index - 1);
        } else {
          for (j = i2 - 1; j >= 0; j--) {
            if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break;
            if (!tokens[j].content) continue;
            lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
            break;
          }
        }
        let nextChar = 32;
        if (pos2 < max) {
          nextChar = text2.charCodeAt(pos2);
        } else {
          for (j = i2 + 1; j < tokens.length; j++) {
            if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break;
            if (!tokens[j].content) continue;
            nextChar = tokens[j].content.charCodeAt(0);
            break;
          }
        }
        const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
        const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
        const isLastWhiteSpace = isWhiteSpace(lastChar);
        const isNextWhiteSpace = isWhiteSpace(nextChar);
        if (isNextWhiteSpace) {
          canOpen = false;
        } else if (isNextPunctChar) {
          if (!(isLastWhiteSpace || isLastPunctChar)) {
            canOpen = false;
          }
        }
        if (isLastWhiteSpace) {
          canClose = false;
        } else if (isLastPunctChar) {
          if (!(isNextWhiteSpace || isNextPunctChar)) {
            canClose = false;
          }
        }
        if (nextChar === 34 && t2[0] === '"') {
          if (lastChar >= 48 && lastChar <= 57) {
            canClose = canOpen = false;
          }
        }
        if (canOpen && canClose) {
          canOpen = isLastPunctChar;
          canClose = isNextPunctChar;
        }
        if (!canOpen && !canClose) {
          if (isSingle) {
            token.content = replaceAt(token.content, t2.index, APOSTROPHE);
          }
          continue;
        }
        if (canClose) {
          for (j = stack2.length - 1; j >= 0; j--) {
            let item3 = stack2[j];
            if (stack2[j].level < thisLevel) {
              break;
            }
            if (item3.single === isSingle && stack2[j].level === thisLevel) {
              item3 = stack2[j];
              let openQuote;
              let closeQuote;
              if (isSingle) {
                openQuote = state.md.options.quotes[2];
                closeQuote = state.md.options.quotes[3];
              } else {
                openQuote = state.md.options.quotes[0];
                closeQuote = state.md.options.quotes[1];
              }
              token.content = replaceAt(token.content, t2.index, closeQuote);
              tokens[item3.token].content = replaceAt(
                tokens[item3.token].content,
                item3.pos,
                openQuote
              );
              pos2 += closeQuote.length - 1;
              if (item3.token === i2) {
                pos2 += openQuote.length - 1;
              }
              text2 = token.content;
              max = text2.length;
              stack2.length = j;
              continue OUTER;
            }
          }
        }
        if (canOpen) {
          stack2.push({
            token: i2,
            pos: t2.index,
            single: isSingle,
            level: thisLevel
          });
        } else if (canClose && isSingle) {
          token.content = replaceAt(token.content, t2.index, APOSTROPHE);
        }
      }
  }
}
__name(process_inlines, "process_inlines");
function smartquotes(state) {
  if (!state.md.options.typographer) {
    return;
  }
  for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
    if (state.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
      continue;
    }
    process_inlines(state.tokens[blkIdx].children, state);
  }
}
__name(smartquotes, "smartquotes");
function text_join(state) {
  let curr, last;
  const blockTokens = state.tokens;
  const l = blockTokens.length;
  for (let j = 0; j < l; j++) {
    if (blockTokens[j].type !== "inline") continue;
    const tokens = blockTokens[j].children;
    const max = tokens.length;
    for (curr = 0; curr < max; curr++) {
      if (tokens[curr].type === "text_special") {
        tokens[curr].type = "text";
      }
    }
    for (curr = last = 0; curr < max; curr++) {
      if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") {
        tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
      } else {
        if (curr !== last) {
          tokens[last] = tokens[curr];
        }
        last++;
      }
    }
    if (curr !== last) {
      tokens.length = last;
    }
  }
}
__name(text_join, "text_join");
const _rules$2 = [
  ["normalize", normalize],
  ["block", block],
  ["inline", inline],
  ["linkify", linkify$1],
  ["replacements", replace],
  ["smartquotes", smartquotes],
  // `text_join` finds `text_special` tokens (for escape sequences)
  // and joins them with the rest of the text
  ["text_join", text_join]
];
function Core() {
  this.ruler = new Ruler();
  for (let i2 = 0; i2 < _rules$2.length; i2++) {
    this.ruler.push(_rules$2[i2][0], _rules$2[i2][1]);
  }
}
__name(Core, "Core");
Core.prototype.process = function(state) {
  const rules = this.ruler.getRules("");
  for (let i2 = 0, l = rules.length; i2 < l; i2++) {
    rules[i2](state);
  }
};
Core.prototype.State = StateCore;
function StateBlock(src, md2, env, tokens) {
  this.src = src;
  this.md = md2;
  this.env = env;
  this.tokens = tokens;
  this.bMarks = [];
  this.eMarks = [];
  this.tShift = [];
  this.sCount = [];
  this.bsCount = [];
  this.blkIndent = 0;
  this.line = 0;
  this.lineMax = 0;
  this.tight = false;
  this.ddIndent = -1;
  this.listIndent = -1;
  this.parentType = "root";
  this.level = 0;
  const s = this.src;
  for (let start2 = 0, pos2 = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos2 < len; pos2++) {
    const ch = s.charCodeAt(pos2);
    if (!indent_found) {
      if (isSpace(ch)) {
        indent++;
        if (ch === 9) {
          offset += 4 - offset % 4;
        } else {
          offset++;
        }
        continue;
      } else {
        indent_found = true;
      }
    }
    if (ch === 10 || pos2 === len - 1) {
      if (ch !== 10) {
        pos2++;
      }
      this.bMarks.push(start2);
      this.eMarks.push(pos2);
      this.tShift.push(indent);
      this.sCount.push(offset);
      this.bsCount.push(0);
      indent_found = false;
      indent = 0;
      offset = 0;
      start2 = pos2 + 1;
    }
  }
  this.bMarks.push(s.length);
  this.eMarks.push(s.length);
  this.tShift.push(0);
  this.sCount.push(0);
  this.bsCount.push(0);
  this.lineMax = this.bMarks.length - 1;
}
__name(StateBlock, "StateBlock");
StateBlock.prototype.push = function(type, tag, nesting) {
  const token = new Token(type, tag, nesting);
  token.block = true;
  if (nesting < 0) this.level--;
  token.level = this.level;
  if (nesting > 0) this.level++;
  this.tokens.push(token);
  return token;
};
StateBlock.prototype.isEmpty = /* @__PURE__ */ __name(function isEmpty2(line) {
  return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
}, "isEmpty");
StateBlock.prototype.skipEmptyLines = /* @__PURE__ */ __name(function skipEmptyLines(from2) {
  for (let max = this.lineMax; from2 < max; from2++) {
    if (this.bMarks[from2] + this.tShift[from2] < this.eMarks[from2]) {
      break;
    }
  }
  return from2;
}, "skipEmptyLines");
StateBlock.prototype.skipSpaces = /* @__PURE__ */ __name(function skipSpaces(pos2) {
  for (let max = this.src.length; pos2 < max; pos2++) {
    const ch = this.src.charCodeAt(pos2);
    if (!isSpace(ch)) {
      break;
    }
  }
  return pos2;
}, "skipSpaces");
StateBlock.prototype.skipSpacesBack = /* @__PURE__ */ __name(function skipSpacesBack(pos2, min) {
  if (pos2 <= min) {
    return pos2;
  }
  while (pos2 > min) {
    if (!isSpace(this.src.charCodeAt(--pos2))) {
      return pos2 + 1;
    }
  }
  return pos2;
}, "skipSpacesBack");
StateBlock.prototype.skipChars = /* @__PURE__ */ __name(function skipChars(pos2, code2) {
  for (let max = this.src.length; pos2 < max; pos2++) {
    if (this.src.charCodeAt(pos2) !== code2) {
      break;
    }
  }
  return pos2;
}, "skipChars");
StateBlock.prototype.skipCharsBack = /* @__PURE__ */ __name(function skipCharsBack(pos2, code2, min) {
  if (pos2 <= min) {
    return pos2;
  }
  while (pos2 > min) {
    if (code2 !== this.src.charCodeAt(--pos2)) {
      return pos2 + 1;
    }
  }
  return pos2;
}, "skipCharsBack");
StateBlock.prototype.getLines = /* @__PURE__ */ __name(function getLines(begin, end, indent, keepLastLF) {
  if (begin >= end) {
    return "";
  }
  const queue2 = new Array(end - begin);
  for (let i2 = 0, line = begin; line < end; line++, i2++) {
    let lineIndent = 0;
    const lineStart = this.bMarks[line];
    let first2 = lineStart;
    let last;
    if (line + 1 < end || keepLastLF) {
      last = this.eMarks[line] + 1;
    } else {
      last = this.eMarks[line];
    }
    while (first2 < last && lineIndent < indent) {
      const ch = this.src.charCodeAt(first2);
      if (isSpace(ch)) {
        if (ch === 9) {
          lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
        } else {
          lineIndent++;
        }
      } else if (first2 - lineStart < this.tShift[line]) {
        lineIndent++;
      } else {
        break;
      }
      first2++;
    }
    if (lineIndent > indent) {
      queue2[i2] = new Array(lineIndent - indent + 1).join(" ") + this.src.slice(first2, last);
    } else {
      queue2[i2] = this.src.slice(first2, last);
    }
  }
  return queue2.join("");
}, "getLines");
StateBlock.prototype.Token = Token;
const MAX_AUTOCOMPLETED_CELLS = 65536;
function getLine(state, line) {
  const pos2 = state.bMarks[line] + state.tShift[line];
  const max = state.eMarks[line];
  return state.src.slice(pos2, max);
}
__name(getLine, "getLine");
function escapedSplit(str) {
  const result = [];
  const max = str.length;
  let pos2 = 0;
  let ch = str.charCodeAt(pos2);
  let isEscaped = false;
  let lastPos = 0;
  let current = "";
  while (pos2 < max) {
    if (ch === 124) {
      if (!isEscaped) {
        result.push(current + str.substring(lastPos, pos2));
        current = "";
        lastPos = pos2 + 1;
      } else {
        current += str.substring(lastPos, pos2 - 1);
        lastPos = pos2;
      }
    }
    isEscaped = ch === 92;
    pos2++;
    ch = str.charCodeAt(pos2);
  }
  result.push(current + str.substring(lastPos));
  return result;
}
__name(escapedSplit, "escapedSplit");
function table(state, startLine, endLine, silent) {
  if (startLine + 2 > endLine) {
    return false;
  }
  let nextLine = startLine + 1;
  if (state.sCount[nextLine] < state.blkIndent) {
    return false;
  }
  if (state.sCount[nextLine] - state.blkIndent >= 4) {
    return false;
  }
  let pos2 = state.bMarks[nextLine] + state.tShift[nextLine];
  if (pos2 >= state.eMarks[nextLine]) {
    return false;
  }
  const firstCh = state.src.charCodeAt(pos2++);
  if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) {
    return false;
  }
  if (pos2 >= state.eMarks[nextLine]) {
    return false;
  }
  const secondCh = state.src.charCodeAt(pos2++);
  if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace(secondCh)) {
    return false;
  }
  if (firstCh === 45 && isSpace(secondCh)) {
    return false;
  }
  while (pos2 < state.eMarks[nextLine]) {
    const ch = state.src.charCodeAt(pos2);
    if (ch !== 124 && ch !== 45 && ch !== 58 && !isSpace(ch)) {
      return false;
    }
    pos2++;
  }
  let lineText = getLine(state, startLine + 1);
  let columns = lineText.split("|");
  const aligns = [];
  for (let i2 = 0; i2 < columns.length; i2++) {
    const t2 = columns[i2].trim();
    if (!t2) {
      if (i2 === 0 || i2 === columns.length - 1) {
        continue;
      } else {
        return false;
      }
    }
    if (!/^:?-+:?$/.test(t2)) {
      return false;
    }
    if (t2.charCodeAt(t2.length - 1) === 58) {
      aligns.push(t2.charCodeAt(0) === 58 ? "center" : "right");
    } else if (t2.charCodeAt(0) === 58) {
      aligns.push("left");
    } else {
      aligns.push("");
    }
  }
  lineText = getLine(state, startLine).trim();
  if (lineText.indexOf("|") === -1) {
    return false;
  }
  if (state.sCount[startLine] - state.blkIndent >= 4) {
    return false;
  }
  columns = escapedSplit(lineText);
  if (columns.length && columns[0] === "") columns.shift();
  if (columns.length && columns[columns.length - 1] === "") columns.pop();
  const columnCount = columns.length;
  if (columnCount === 0 || columnCount !== aligns.length) {
    return false;
  }
  if (silent) {
    return true;
  }
  const oldParentType = state.parentType;
  state.parentType = "table";
  const terminatorRules = state.md.block.ruler.getRules("blockquote");
  const token_to = state.push("table_open", "table", 1);
  const tableLines = [startLine, 0];
  token_to.map = tableLines;
  const token_tho = state.push("thead_open", "thead", 1);
  token_tho.map = [startLine, startLine + 1];
  const token_htro = state.push("tr_open", "tr", 1);
  token_htro.map = [startLine, startLine + 1];
  for (let i2 = 0; i2 < columns.length; i2++) {
    const token_ho = state.push("th_open", "th", 1);
    if (aligns[i2]) {
      token_ho.attrs = [["style", "text-align:" + aligns[i2]]];
    }
    const token_il = state.push("inline", "", 0);
    token_il.content = columns[i2].trim();
    token_il.children = [];
    state.push("th_close", "th", -1);
  }
  state.push("tr_close", "tr", -1);
  state.push("thead_close", "thead", -1);
  let tbodyLines;
  let autocompletedCells = 0;
  for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
    if (state.sCount[nextLine] < state.blkIndent) {
      break;
    }
    let terminate = false;
    for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
      if (terminatorRules[i2](state, nextLine, endLine, true)) {
        terminate = true;
        break;
      }
    }
    if (terminate) {
      break;
    }
    lineText = getLine(state, nextLine).trim();
    if (!lineText) {
      break;
    }
    if (state.sCount[nextLine] - state.blkIndent >= 4) {
      break;
    }
    columns = escapedSplit(lineText);
    if (columns.length && columns[0] === "") columns.shift();
    if (columns.length && columns[columns.length - 1] === "") columns.pop();
    autocompletedCells += columnCount - columns.length;
    if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) {
      break;
    }
    if (nextLine === startLine + 2) {
      const token_tbo = state.push("tbody_open", "tbody", 1);
      token_tbo.map = tbodyLines = [startLine + 2, 0];
    }
    const token_tro = state.push("tr_open", "tr", 1);
    token_tro.map = [nextLine, nextLine + 1];
    for (let i2 = 0; i2 < columnCount; i2++) {
      const token_tdo = state.push("td_open", "td", 1);
      if (aligns[i2]) {
        token_tdo.attrs = [["style", "text-align:" + aligns[i2]]];
      }
      const token_il = state.push("inline", "", 0);
      token_il.content = columns[i2] ? columns[i2].trim() : "";
      token_il.children = [];
      state.push("td_close", "td", -1);
    }
    state.push("tr_close", "tr", -1);
  }
  if (tbodyLines) {
    state.push("tbody_close", "tbody", -1);
    tbodyLines[1] = nextLine;
  }
  state.push("table_close", "table", -1);
  tableLines[1] = nextLine;
  state.parentType = oldParentType;
  state.line = nextLine;
  return true;
}
__name(table, "table");
function code(state, startLine, endLine) {
  if (state.sCount[startLine] - state.blkIndent < 4) {
    return false;
  }
  let nextLine = startLine + 1;
  let last = nextLine;
  while (nextLine < endLine) {
    if (state.isEmpty(nextLine)) {
      nextLine++;
      continue;
    }
    if (state.sCount[nextLine] - state.blkIndent >= 4) {
      nextLine++;
      last = nextLine;
      continue;
    }
    break;
  }
  state.line = last;
  const token = state.push("code_block", "code", 0);
  token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + "\n";
  token.map = [startLine, state.line];
  return true;
}
__name(code, "code");
function fence(state, startLine, endLine, silent) {
  let pos2 = state.bMarks[startLine] + state.tShift[startLine];
  let max = state.eMarks[startLine];
  if (state.sCount[startLine] - state.blkIndent >= 4) {
    return false;
  }
  if (pos2 + 3 > max) {
    return false;
  }
  const marker = state.src.charCodeAt(pos2);
  if (marker !== 126 && marker !== 96) {
    return false;
  }
  let mem = pos2;
  pos2 = state.skipChars(pos2, marker);
  let len = pos2 - mem;
  if (len < 3) {
    return false;
  }
  const markup = state.src.slice(mem, pos2);
  const params = state.src.slice(pos2, max);
  if (marker === 96) {
    if (params.indexOf(String.fromCharCode(marker)) >= 0) {
      return false;
    }
  }
  if (silent) {
    return true;
  }
  let nextLine = startLine;
  let haveEndMarker = false;
  for (; ; ) {
    nextLine++;
    if (nextLine >= endLine) {
      break;
    }
    pos2 = mem = state.bMarks[nextLine] + state.tShift[nextLine];
    max = state.eMarks[nextLine];
    if (pos2 < max && state.sCount[nextLine] < state.blkIndent) {
      break;
    }
    if (state.src.charCodeAt(pos2) !== marker) {
      continue;
    }
    if (state.sCount[nextLine] - state.blkIndent >= 4) {
      continue;
    }
    pos2 = state.skipChars(pos2, marker);
    if (pos2 - mem < len) {
      continue;
    }
    pos2 = state.skipSpaces(pos2);
    if (pos2 < max) {
      continue;
    }
    haveEndMarker = true;
    break;
  }
  len = state.sCount[startLine];
  state.line = nextLine + (haveEndMarker ? 1 : 0);
  const token = state.push("fence", "code", 0);
  token.info = params;
  token.content = state.getLines(startLine + 1, nextLine, len, true);
  token.markup = markup;
  token.map = [startLine, state.line];
  return true;
}
__name(fence, "fence");
function blockquote(state, startLine, endLine, silent) {
  let pos2 = state.bMarks[startLine] + state.tShift[startLine];
  let max = state.eMarks[startLine];
  const oldLineMax = state.lineMax;
  if (state.sCount[startLine] - state.blkIndent >= 4) {
    return false;
  }
  if (state.src.charCodeAt(pos2) !== 62) {
    return false;
  }
  if (silent) {
    return true;
  }
  const oldBMarks = [];
  const oldBSCount = [];
  const oldSCount = [];
  const oldTShift = [];
  const terminatorRules = state.md.block.ruler.getRules("blockquote");
  const oldParentType = state.parentType;
  state.parentType = "blockquote";
  let lastLineEmpty = false;
  let nextLine;
  for (nextLine = startLine; nextLine < endLine; nextLine++) {
    const isOutdented = state.sCount[nextLine] < state.blkIndent;
    pos2 = state.bMarks[nextLine] + state.tShift[nextLine];
    max = state.eMarks[nextLine];
    if (pos2 >= max) {
      break;
    }
    if (state.src.charCodeAt(pos2++) === 62 && !isOutdented) {
      let initial = state.sCount[nextLine] + 1;
      let spaceAfterMarker;
      let adjustTab;
      if (state.src.charCodeAt(pos2) === 32) {
        pos2++;
        initial++;
        adjustTab = false;
        spaceAfterMarker = true;
      } else if (state.src.charCodeAt(pos2) === 9) {
        spaceAfterMarker = true;
        if ((state.bsCount[nextLine] + initial) % 4 === 3) {
          pos2++;
          initial++;
          adjustTab = false;
        } else {
          adjustTab = true;
        }
      } else {
        spaceAfterMarker = false;
      }
      let offset = initial;
      oldBMarks.push(state.bMarks[nextLine]);
      state.bMarks[nextLine] = pos2;
      while (pos2 < max) {
        const ch = state.src.charCodeAt(pos2);
        if (isSpace(ch)) {
          if (ch === 9) {
            offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
          } else {
            offset++;
          }
        } else {
          break;
        }
        pos2++;
      }
      lastLineEmpty = pos2 >= max;
      oldBSCount.push(state.bsCount[nextLine]);
      state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
      oldSCount.push(state.sCount[nextLine]);
      state.sCount[nextLine] = offset - initial;
      oldTShift.push(state.tShift[nextLine]);
      state.tShift[nextLine] = pos2 - state.bMarks[nextLine];
      continue;
    }
    if (lastLineEmpty) {
      break;
    }
    let terminate = false;
    for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
      if (terminatorRules[i2](state, nextLine, endLine, true)) {
        terminate = true;
        break;
      }
    }
    if (terminate) {
      state.lineMax = nextLine;
      if (state.blkIndent !== 0) {
        oldBMarks.push(state.bMarks[nextLine]);
        oldBSCount.push(state.bsCount[nextLine]);
        oldTShift.push(state.tShift[nextLine]);
        oldSCount.push(state.sCount[nextLine]);
        state.sCount[nextLine] -= state.blkIndent;
      }
      break;
    }
    oldBMarks.push(state.bMarks[nextLine]);
    oldBSCount.push(state.bsCount[nextLine]);
    oldTShift.push(state.tShift[nextLine]);
    oldSCount.push(state.sCount[nextLine]);
    state.sCount[nextLine] = -1;
  }
  const oldIndent = state.blkIndent;
  state.blkIndent = 0;
  const token_o = state.push("blockquote_open", "blockquote", 1);
  token_o.markup = ">";
  const lines = [startLine, 0];
  token_o.map = lines;
  state.md.block.tokenize(state, startLine, nextLine);
  const token_c = state.push("blockquote_close", "blockquote", -1);
  token_c.markup = ">";
  state.lineMax = oldLineMax;
  state.parentType = oldParentType;
  lines[1] = state.line;
  for (let i2 = 0; i2 < oldTShift.length; i2++) {
    state.bMarks[i2 + startLine] = oldBMarks[i2];
    state.tShift[i2 + startLine] = oldTShift[i2];
    state.sCount[i2 + startLine] = oldSCount[i2];
    state.bsCount[i2 + startLine] = oldBSCount[i2];
  }
  state.blkIndent = oldIndent;
  return true;
}
__name(blockquote, "blockquote");
function hr(state, startLine, endLine, silent) {
  const max = state.eMarks[startLine];
  if (state.sCount[startLine] - state.blkIndent >= 4) {
    return false;
  }
  let pos2 = state.bMarks[startLine] + state.tShift[startLine];
  const marker = state.src.charCodeAt(pos2++);
  if (marker !== 42 && marker !== 45 && marker !== 95) {
    return false;
  }
  let cnt = 1;
  while (pos2 < max) {
    const ch = state.src.charCodeAt(pos2++);
    if (ch !== marker && !isSpace(ch)) {
      return false;
    }
    if (ch === marker) {
      cnt++;
    }
  }
  if (cnt < 3) {
    return false;
  }
  if (silent) {
    return true;
  }
  state.line = startLine + 1;
  const token = state.push("hr", "hr", 0);
  token.map = [startLine, state.line];
  token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
  return true;
}
__name(hr, "hr");
function skipBulletListMarker(state, startLine) {
  const max = state.eMarks[startLine];
  let pos2 = state.bMarks[startLine] + state.tShift[startLine];
  const marker = state.src.charCodeAt(pos2++);
  if (marker !== 42 && marker !== 45 && marker !== 43) {
    return -1;
  }
  if (pos2 < max) {
    const ch = state.src.charCodeAt(pos2);
    if (!isSpace(ch)) {
      return -1;
    }
  }
  return pos2;
}
__name(skipBulletListMarker, "skipBulletListMarker");
function skipOrderedListMarker(state, startLine) {
  const start2 = state.bMarks[startLine] + state.tShift[startLine];
  const max = state.eMarks[startLine];
  let pos2 = start2;
  if (pos2 + 1 >= max) {
    return -1;
  }
  let ch = state.src.charCodeAt(pos2++);
  if (ch < 48 || ch > 57) {
    return -1;
  }
  for (; ; ) {
    if (pos2 >= max) {
      return -1;
    }
    ch = state.src.charCodeAt(pos2++);
    if (ch >= 48 && ch <= 57) {
      if (pos2 - start2 >= 10) {
        return -1;
      }
      continue;
    }
    if (ch === 41 || ch === 46) {
      break;
    }
    return -1;
  }
  if (pos2 < max) {
    ch = state.src.charCodeAt(pos2);
    if (!isSpace(ch)) {
      return -1;
    }
  }
  return pos2;
}
__name(skipOrderedListMarker, "skipOrderedListMarker");
function markTightParagraphs(state, idx) {
  const level = state.level + 2;
  for (let i2 = idx + 2, l = state.tokens.length - 2; i2 < l; i2++) {
    if (state.tokens[i2].level === level && state.tokens[i2].type === "paragraph_open") {
      state.tokens[i2 + 2].hidden = true;
      state.tokens[i2].hidden = true;
      i2 += 2;
    }
  }
}
__name(markTightParagraphs, "markTightParagraphs");
function list(state, startLine, endLine, silent) {
  let max, pos2, start2, token;
  let nextLine = startLine;
  let tight = true;
  if (state.sCount[nextLine] - state.blkIndent >= 4) {
    return false;
  }
  if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) {
    return false;
  }
  let isTerminatingParagraph = false;
  if (silent && state.parentType === "paragraph") {
    if (state.sCount[nextLine] >= state.blkIndent) {
      isTerminatingParagraph = true;
    }
  }
  let isOrdered;
  let markerValue;
  let posAfterMarker;
  if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {
    isOrdered = true;
    start2 = state.bMarks[nextLine] + state.tShift[nextLine];
    markerValue = Number(state.src.slice(start2, posAfterMarker - 1));
    if (isTerminatingParagraph && markerValue !== 1) return false;
  } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {
    isOrdered = false;
  } else {
    return false;
  }
  if (isTerminatingParagraph) {
    if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false;
  }
  if (silent) {
    return true;
  }
  const markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
  const listTokIdx = state.tokens.length;
  if (isOrdered) {
    token = state.push("ordered_list_open", "ol", 1);
    if (markerValue !== 1) {
      token.attrs = [["start", markerValue]];
    }
  } else {
    token = state.push("bullet_list_open", "ul", 1);
  }
  const listLines = [nextLine, 0];
  token.map = listLines;
  token.markup = String.fromCharCode(markerCharCode);
  let prevEmptyEnd = false;
  const terminatorRules = state.md.block.ruler.getRules("list");
  const oldParentType = state.parentType;
  state.parentType = "list";
  while (nextLine < endLine) {
    pos2 = posAfterMarker;
    max = state.eMarks[nextLine];
    const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]);
    let offset = initial;
    while (pos2 < max) {
      const ch = state.src.charCodeAt(pos2);
      if (ch === 9) {
        offset += 4 - (offset + state.bsCount[nextLine]) % 4;
      } else if (ch === 32) {
        offset++;
      } else {
        break;
      }
      pos2++;
    }
    const contentStart = pos2;
    let indentAfterMarker;
    if (contentStart >= max) {
      indentAfterMarker = 1;
    } else {
      indentAfterMarker = offset - initial;
    }
    if (indentAfterMarker > 4) {
      indentAfterMarker = 1;
    }
    const indent = initial + indentAfterMarker;
    token = state.push("list_item_open", "li", 1);
    token.markup = String.fromCharCode(markerCharCode);
    const itemLines = [nextLine, 0];
    token.map = itemLines;
    if (isOrdered) {
      token.info = state.src.slice(start2, posAfterMarker - 1);
    }
    const oldTight = state.tight;
    const oldTShift = state.tShift[nextLine];
    const oldSCount = state.sCount[nextLine];
    const oldListIndent = state.listIndent;
    state.listIndent = state.blkIndent;
    state.blkIndent = indent;
    state.tight = true;
    state.tShift[nextLine] = contentStart - state.bMarks[nextLine];
    state.sCount[nextLine] = offset;
    if (contentStart >= max && state.isEmpty(nextLine + 1)) {
      state.line = Math.min(state.line + 2, endLine);
    } else {
      state.md.block.tokenize(state, nextLine, endLine, true);
    }
    if (!state.tight || prevEmptyEnd) {
      tight = false;
    }
    prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1);
    state.blkIndent = state.listIndent;
    state.listIndent = oldListIndent;
    state.tShift[nextLine] = oldTShift;
    state.sCount[nextLine] = oldSCount;
    state.tight = oldTight;
    token = state.push("list_item_close", "li", -1);
    token.markup = String.fromCharCode(markerCharCode);
    nextLine = state.line;
    itemLines[1] = nextLine;
    if (nextLine >= endLine) {
      break;
    }
    if (state.sCount[nextLine] < state.blkIndent) {
      break;
    }
    if (state.sCount[nextLine] - state.blkIndent >= 4) {
      break;
    }
    let terminate = false;
    for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
      if (terminatorRules[i2](state, nextLine, endLine, true)) {
        terminate = true;
        break;
      }
    }
    if (terminate) {
      break;
    }
    if (isOrdered) {
      posAfterMarker = skipOrderedListMarker(state, nextLine);
      if (posAfterMarker < 0) {
        break;
      }
      start2 = state.bMarks[nextLine] + state.tShift[nextLine];
    } else {
      posAfterMarker = skipBulletListMarker(state, nextLine);
      if (posAfterMarker < 0) {
        break;
      }
    }
    if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) {
      break;
    }
  }
  if (isOrdered) {
    token = state.push("ordered_list_close", "ol", -1);
  } else {
    token = state.push("bullet_list_close", "ul", -1);
  }
  token.markup = String.fromCharCode(markerCharCode);
  listLines[1] = nextLine;
  state.line = nextLine;
  state.parentType = oldParentType;
  if (tight) {
    markTightParagraphs(state, listTokIdx);
  }
  return true;
}
__name(list, "list");
function reference(state, startLine, _endLine, silent) {
  let pos2 = state.bMarks[startLine] + state.tShift[startLine];
  let max = state.eMarks[startLine];
  let nextLine = startLine + 1;
  if (state.sCount[startLine] - state.blkIndent >= 4) {
    return false;
  }
  if (state.src.charCodeAt(pos2) !== 91) {
    return false;
  }
  function getNextLine(nextLine2) {
    const endLine = state.lineMax;
    if (nextLine2 >= endLine || state.isEmpty(nextLine2)) {
      return null;
    }
    let isContinuation = false;
    if (state.sCount[nextLine2] - state.blkIndent > 3) {
      isContinuation = true;
    }
    if (state.sCount[nextLine2] < 0) {
      isContinuation = true;
    }
    if (!isContinuation) {
      const terminatorRules = state.md.block.ruler.getRules("reference");
      const oldParentType = state.parentType;
      state.parentType = "reference";
      let terminate = false;
      for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
        if (terminatorRules[i2](state, nextLine2, endLine, true)) {
          terminate = true;
          break;
        }
      }
      state.parentType = oldParentType;
      if (terminate) {
        return null;
      }
    }
    const pos3 = state.bMarks[nextLine2] + state.tShift[nextLine2];
    const max2 = state.eMarks[nextLine2];
    return state.src.slice(pos3, max2 + 1);
  }
  __name(getNextLine, "getNextLine");
  let str = state.src.slice(pos2, max + 1);
  max = str.length;
  let labelEnd = -1;
  for (pos2 = 1; pos2 < max; pos2++) {
    const ch = str.charCodeAt(pos2);
    if (ch === 91) {
      return false;
    } else if (ch === 93) {
      labelEnd = pos2;
      break;
    } else if (ch === 10) {
      const lineContent = getNextLine(nextLine);
      if (lineContent !== null) {
        str += lineContent;
        max = str.length;
        nextLine++;
      }
    } else if (ch === 92) {
      pos2++;
      if (pos2 < max && str.charCodeAt(pos2) === 10) {
        const lineContent = getNextLine(nextLine);
        if (lineContent !== null) {
          str += lineContent;
          max = str.length;
          nextLine++;
        }
      }
    }
  }
  if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) {
    return false;
  }
  for (pos2 = labelEnd + 2; pos2 < max; pos2++) {
    const ch = str.charCodeAt(pos2);
    if (ch === 10) {
      const lineContent = getNextLine(nextLine);
      if (lineContent !== null) {
        str += lineContent;
        max = str.length;
        nextLine++;
      }
    } else if (isSpace(ch)) {
    } else {
      break;
    }
  }
  const destRes = state.md.helpers.parseLinkDestination(str, pos2, max);
  if (!destRes.ok) {
    return false;
  }
  const href = state.md.normalizeLink(destRes.str);
  if (!state.md.validateLink(href)) {
    return false;
  }
  pos2 = destRes.pos;
  const destEndPos = pos2;
  const destEndLineNo = nextLine;
  const start2 = pos2;
  for (; pos2 < max; pos2++) {
    const ch = str.charCodeAt(pos2);
    if (ch === 10) {
      const lineContent = getNextLine(nextLine);
      if (lineContent !== null) {
        str += lineContent;
        max = str.length;
        nextLine++;
      }
    } else if (isSpace(ch)) {
    } else {
      break;
    }
  }
  let titleRes = state.md.helpers.parseLinkTitle(str, pos2, max);
  while (titleRes.can_continue) {
    const lineContent = getNextLine(nextLine);
    if (lineContent === null) break;
    str += lineContent;
    pos2 = max;
    max = str.length;
    nextLine++;
    titleRes = state.md.helpers.parseLinkTitle(str, pos2, max, titleRes);
  }
  let title;
  if (pos2 < max && start2 !== pos2 && titleRes.ok) {
    title = titleRes.str;
    pos2 = titleRes.pos;
  } else {
    title = "";
    pos2 = destEndPos;
    nextLine = destEndLineNo;
  }
  while (pos2 < max) {
    const ch = str.charCodeAt(pos2);
    if (!isSpace(ch)) {
      break;
    }
    pos2++;
  }
  if (pos2 < max && str.charCodeAt(pos2) !== 10) {
    if (title) {
      title = "";
      pos2 = destEndPos;
      nextLine = destEndLineNo;
      while (pos2 < max) {
        const ch = str.charCodeAt(pos2);
        if (!isSpace(ch)) {
          break;
        }
        pos2++;
      }
    }
  }
  if (pos2 < max && str.charCodeAt(pos2) !== 10) {
    return false;
  }
  const label5 = normalizeReference(str.slice(1, labelEnd));
  if (!label5) {
    return false;
  }
  if (silent) {
    return true;
  }
  if (typeof state.env.references === "undefined") {
    state.env.references = {};
  }
  if (typeof state.env.references[label5] === "undefined") {
    state.env.references[label5] = { title, href };
  }
  state.line = nextLine;
  return true;
}
__name(reference, "reference");
const block_names = [
  "address",
  "article",
  "aside",
  "base",
  "basefont",
  "blockquote",
  "body",
  "caption",
  "center",
  "col",
  "colgroup",
  "dd",
  "details",
  "dialog",
  "dir",
  "div",
  "dl",
  "dt",
  "fieldset",
  "figcaption",
  "figure",
  "footer",
  "form",
  "frame",
  "frameset",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "head",
  "header",
  "hr",
  "html",
  "iframe",
  "legend",
  "li",
  "link",
  "main",
  "menu",
  "menuitem",
  "nav",
  "noframes",
  "ol",
  "optgroup",
  "option",
  "p",
  "param",
  "search",
  "section",
  "summary",
  "table",
  "tbody",
  "td",
  "tfoot",
  "th",
  "thead",
  "title",
  "tr",
  "track",
  "ul"
];
const attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*";
const unquoted = "[^\"'=<>`\\x00-\\x20]+";
const single_quoted = "'[^']*'";
const double_quoted = '"[^"]*"';
const attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")";
const attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)";
const open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>";
const close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
const comment = "<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->";
const processing = "<[?][\\s\\S]*?[?]>";
const declaration = "<![A-Za-z][^>]*>";
const cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>";
const HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment + "|" + processing + "|" + declaration + "|" + cdata + ")");
const HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")");
const HTML_SEQUENCES = [
  [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true],
  [/^<!--/, /-->/, true],
  [/^<\?/, /\?>/, true],
  [/^<![A-Z]/, />/, true],
  [/^<!\[CDATA\[/, /\]\]>/, true],
  [new RegExp("^</?(" + block_names.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, true],
  [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + "\\s*$"), /^$/, false]
];
function html_block(state, startLine, endLine, silent) {
  let pos2 = state.bMarks[startLine] + state.tShift[startLine];
  let max = state.eMarks[startLine];
  if (state.sCount[startLine] - state.blkIndent >= 4) {
    return false;
  }
  if (!state.md.options.html) {
    return false;
  }
  if (state.src.charCodeAt(pos2) !== 60) {
    return false;
  }
  let lineText = state.src.slice(pos2, max);
  let i2 = 0;
  for (; i2 < HTML_SEQUENCES.length; i2++) {
    if (HTML_SEQUENCES[i2][0].test(lineText)) {
      break;
    }
  }
  if (i2 === HTML_SEQUENCES.length) {
    return false;
  }
  if (silent) {
    return HTML_SEQUENCES[i2][2];
  }
  let nextLine = startLine + 1;
  if (!HTML_SEQUENCES[i2][1].test(lineText)) {
    for (; nextLine < endLine; nextLine++) {
      if (state.sCount[nextLine] < state.blkIndent) {
        break;
      }
      pos2 = state.bMarks[nextLine] + state.tShift[nextLine];
      max = state.eMarks[nextLine];
      lineText = state.src.slice(pos2, max);
      if (HTML_SEQUENCES[i2][1].test(lineText)) {
        if (lineText.length !== 0) {
          nextLine++;
        }
        break;
      }
    }
  }
  state.line = nextLine;
  const token = state.push("html_block", "", 0);
  token.map = [startLine, nextLine];
  token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
  return true;
}
__name(html_block, "html_block");
function heading(state, startLine, endLine, silent) {
  let pos2 = state.bMarks[startLine] + state.tShift[startLine];
  let max = state.eMarks[startLine];
  if (state.sCount[startLine] - state.blkIndent >= 4) {
    return false;
  }
  let ch = state.src.charCodeAt(pos2);
  if (ch !== 35 || pos2 >= max) {
    return false;
  }
  let level = 1;
  ch = state.src.charCodeAt(++pos2);
  while (ch === 35 && pos2 < max && level <= 6) {
    level++;
    ch = state.src.charCodeAt(++pos2);
  }
  if (level > 6 || pos2 < max && !isSpace(ch)) {
    return false;
  }
  if (silent) {
    return true;
  }
  max = state.skipSpacesBack(max, pos2);
  const tmp = state.skipCharsBack(max, 35, pos2);
  if (tmp > pos2 && isSpace(state.src.charCodeAt(tmp - 1))) {
    max = tmp;
  }
  state.line = startLine + 1;
  const token_o = state.push("heading_open", "h" + String(level), 1);
  token_o.markup = "########".slice(0, level);
  token_o.map = [startLine, state.line];
  const token_i = state.push("inline", "", 0);
  token_i.content = state.src.slice(pos2, max).trim();
  token_i.map = [startLine, state.line];
  token_i.children = [];
  const token_c = state.push("heading_close", "h" + String(level), -1);
  token_c.markup = "########".slice(0, level);
  return true;
}
__name(heading, "heading");
function lheading(state, startLine, endLine) {
  const terminatorRules = state.md.block.ruler.getRules("paragraph");
  if (state.sCount[startLine] - state.blkIndent >= 4) {
    return false;
  }
  const oldParentType = state.parentType;
  state.parentType = "paragraph";
  let level = 0;
  let marker;
  let nextLine = startLine + 1;
  for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
    if (state.sCount[nextLine] - state.blkIndent > 3) {
      continue;
    }
    if (state.sCount[nextLine] >= state.blkIndent) {
      let pos2 = state.bMarks[nextLine] + state.tShift[nextLine];
      const max = state.eMarks[nextLine];
      if (pos2 < max) {
        marker = state.src.charCodeAt(pos2);
        if (marker === 45 || marker === 61) {
          pos2 = state.skipChars(pos2, marker);
          pos2 = state.skipSpaces(pos2);
          if (pos2 >= max) {
            level = marker === 61 ? 1 : 2;
            break;
          }
        }
      }
    }
    if (state.sCount[nextLine] < 0) {
      continue;
    }
    let terminate = false;
    for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
      if (terminatorRules[i2](state, nextLine, endLine, true)) {
        terminate = true;
        break;
      }
    }
    if (terminate) {
      break;
    }
  }
  if (!level) {
    return false;
  }
  const content2 = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  state.line = nextLine + 1;
  const token_o = state.push("heading_open", "h" + String(level), 1);
  token_o.markup = String.fromCharCode(marker);
  token_o.map = [startLine, state.line];
  const token_i = state.push("inline", "", 0);
  token_i.content = content2;
  token_i.map = [startLine, state.line - 1];
  token_i.children = [];
  const token_c = state.push("heading_close", "h" + String(level), -1);
  token_c.markup = String.fromCharCode(marker);
  state.parentType = oldParentType;
  return true;
}
__name(lheading, "lheading");
function paragraph(state, startLine, endLine) {
  const terminatorRules = state.md.block.ruler.getRules("paragraph");
  const oldParentType = state.parentType;
  let nextLine = startLine + 1;
  state.parentType = "paragraph";
  for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
    if (state.sCount[nextLine] - state.blkIndent > 3) {
      continue;
    }
    if (state.sCount[nextLine] < 0) {
      continue;
    }
    let terminate = false;
    for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
      if (terminatorRules[i2](state, nextLine, endLine, true)) {
        terminate = true;
        break;
      }
    }
    if (terminate) {
      break;
    }
  }
  const content2 = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  state.line = nextLine;
  const token_o = state.push("paragraph_open", "p", 1);
  token_o.map = [startLine, state.line];
  const token_i = state.push("inline", "", 0);
  token_i.content = content2;
  token_i.map = [startLine, state.line];
  token_i.children = [];
  state.push("paragraph_close", "p", -1);
  state.parentType = oldParentType;
  return true;
}
__name(paragraph, "paragraph");
const _rules$1 = [
  // First 2 params - rule name & source. Secondary array - list of rules,
  // which can be terminated by this one.
  ["table", table, ["paragraph", "reference"]],
  ["code", code],
  ["fence", fence, ["paragraph", "reference", "blockquote", "list"]],
  ["blockquote", blockquote, ["paragraph", "reference", "blockquote", "list"]],
  ["hr", hr, ["paragraph", "reference", "blockquote", "list"]],
  ["list", list, ["paragraph", "reference", "blockquote"]],
  ["reference", reference],
  ["html_block", html_block, ["paragraph", "reference", "blockquote"]],
  ["heading", heading, ["paragraph", "reference", "blockquote"]],
  ["lheading", lheading],
  ["paragraph", paragraph]
];
function ParserBlock() {
  this.ruler = new Ruler();
  for (let i2 = 0; i2 < _rules$1.length; i2++) {
    this.ruler.push(_rules$1[i2][0], _rules$1[i2][1], { alt: (_rules$1[i2][2] || []).slice() });
  }
}
__name(ParserBlock, "ParserBlock");
ParserBlock.prototype.tokenize = function(state, startLine, endLine) {
  const rules = this.ruler.getRules("");
  const len = rules.length;
  const maxNesting = state.md.options.maxNesting;
  let line = startLine;
  let hasEmptyLines = false;
  while (line < endLine) {
    state.line = line = state.skipEmptyLines(line);
    if (line >= endLine) {
      break;
    }
    if (state.sCount[line] < state.blkIndent) {
      break;
    }
    if (state.level >= maxNesting) {
      state.line = endLine;
      break;
    }
    const prevLine = state.line;
    let ok = false;
    for (let i2 = 0; i2 < len; i2++) {
      ok = rules[i2](state, line, endLine, false);
      if (ok) {
        if (prevLine >= state.line) {
          throw new Error("block rule didn't increment state.line");
        }
        break;
      }
    }
    if (!ok) throw new Error("none of the block rules matched");
    state.tight = !hasEmptyLines;
    if (state.isEmpty(state.line - 1)) {
      hasEmptyLines = true;
    }
    line = state.line;
    if (line < endLine && state.isEmpty(line)) {
      hasEmptyLines = true;
      line++;
      state.line = line;
    }
  }
};
ParserBlock.prototype.parse = function(src, md2, env, outTokens) {
  if (!src) {
    return;
  }
  const state = new this.State(src, md2, env, outTokens);
  this.tokenize(state, state.line, state.lineMax);
};
ParserBlock.prototype.State = StateBlock;
function StateInline(src, md2, env, outTokens) {
  this.src = src;
  this.env = env;
  this.md = md2;
  this.tokens = outTokens;
  this.tokens_meta = Array(outTokens.length);
  this.pos = 0;
  this.posMax = this.src.length;
  this.level = 0;
  this.pending = "";
  this.pendingLevel = 0;
  this.cache = {};
  this.delimiters = [];
  this._prev_delimiters = [];
  this.backticks = {};
  this.backticksScanned = false;
  this.linkLevel = 0;
}
__name(StateInline, "StateInline");
StateInline.prototype.pushPending = function() {
  const token = new Token("text", "", 0);
  token.content = this.pending;
  token.level = this.pendingLevel;
  this.tokens.push(token);
  this.pending = "";
  return token;
};
StateInline.prototype.push = function(type, tag, nesting) {
  if (this.pending) {
    this.pushPending();
  }
  const token = new Token(type, tag, nesting);
  let token_meta = null;
  if (nesting < 0) {
    this.level--;
    this.delimiters = this._prev_delimiters.pop();
  }
  token.level = this.level;
  if (nesting > 0) {
    this.level++;
    this._prev_delimiters.push(this.delimiters);
    this.delimiters = [];
    token_meta = { delimiters: this.delimiters };
  }
  this.pendingLevel = this.level;
  this.tokens.push(token);
  this.tokens_meta.push(token_meta);
  return token;
};
StateInline.prototype.scanDelims = function(start2, canSplitWord) {
  const max = this.posMax;
  const marker = this.src.charCodeAt(start2);
  const lastChar = start2 > 0 ? this.src.charCodeAt(start2 - 1) : 32;
  let pos2 = start2;
  while (pos2 < max && this.src.charCodeAt(pos2) === marker) {
    pos2++;
  }
  const count = pos2 - start2;
  const nextChar = pos2 < max ? this.src.charCodeAt(pos2) : 32;
  const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  const isLastWhiteSpace = isWhiteSpace(lastChar);
  const isNextWhiteSpace = isWhiteSpace(nextChar);
  const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
  const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar);
  const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar);
  const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar);
  return { can_open, can_close, length: count };
};
StateInline.prototype.Token = Token;
function isTerminatorChar(ch) {
  switch (ch) {
    case 10:
    case 33:
    case 35:
    case 36:
    case 37:
    case 38:
    case 42:
    case 43:
    case 45:
    case 58:
    case 60:
    case 61:
    case 62:
    case 64:
    case 91:
    case 92:
    case 93:
    case 94:
    case 95:
    case 96:
    case 123:
    case 125:
    case 126:
      return true;
    default:
      return false;
  }
}
__name(isTerminatorChar, "isTerminatorChar");
function text(state, silent) {
  let pos2 = state.pos;
  while (pos2 < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos2))) {
    pos2++;
  }
  if (pos2 === state.pos) {
    return false;
  }
  if (!silent) {
    state.pending += state.src.slice(state.pos, pos2);
  }
  state.pos = pos2;
  return true;
}
__name(text, "text");
const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
function linkify(state, silent) {
  if (!state.md.options.linkify) return false;
  if (state.linkLevel > 0) return false;
  const pos2 = state.pos;
  const max = state.posMax;
  if (pos2 + 3 > max) return false;
  if (state.src.charCodeAt(pos2) !== 58) return false;
  if (state.src.charCodeAt(pos2 + 1) !== 47) return false;
  if (state.src.charCodeAt(pos2 + 2) !== 47) return false;
  const match2 = state.pending.match(SCHEME_RE);
  if (!match2) return false;
  const proto = match2[1];
  const link2 = state.md.linkify.matchAtStart(state.src.slice(pos2 - proto.length));
  if (!link2) return false;
  let url = link2.url;
  if (url.length <= proto.length) return false;
  url = url.replace(/\*+$/, "");
  const fullUrl = state.md.normalizeLink(url);
  if (!state.md.validateLink(fullUrl)) return false;
  if (!silent) {
    state.pending = state.pending.slice(0, -proto.length);
    const token_o = state.push("link_open", "a", 1);
    token_o.attrs = [["href", fullUrl]];
    token_o.markup = "linkify";
    token_o.info = "auto";
    const token_t = state.push("text", "", 0);
    token_t.content = state.md.normalizeLinkText(url);
    const token_c = state.push("link_close", "a", -1);
    token_c.markup = "linkify";
    token_c.info = "auto";
  }
  state.pos += url.length - proto.length;
  return true;
}
__name(linkify, "linkify");
function newline(state, silent) {
  let pos2 = state.pos;
  if (state.src.charCodeAt(pos2) !== 10) {
    return false;
  }
  const pmax = state.pending.length - 1;
  const max = state.posMax;
  if (!silent) {
    if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {
      if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
        let ws = pmax - 1;
        while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) ws--;
        state.pending = state.pending.slice(0, ws);
        state.push("hardbreak", "br", 0);
      } else {
        state.pending = state.pending.slice(0, -1);
        state.push("softbreak", "br", 0);
      }
    } else {
      state.push("softbreak", "br", 0);
    }
  }
  pos2++;
  while (pos2 < max && isSpace(state.src.charCodeAt(pos2))) {
    pos2++;
  }
  state.pos = pos2;
  return true;
}
__name(newline, "newline");
const ESCAPED = [];
for (let i2 = 0; i2 < 256; i2++) {
  ESCAPED.push(0);
}
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(ch) {
  ESCAPED[ch.charCodeAt(0)] = 1;
});
function escape$1(state, silent) {
  let pos2 = state.pos;
  const max = state.posMax;
  if (state.src.charCodeAt(pos2) !== 92) return false;
  pos2++;
  if (pos2 >= max) return false;
  let ch1 = state.src.charCodeAt(pos2);
  if (ch1 === 10) {
    if (!silent) {
      state.push("hardbreak", "br", 0);
    }
    pos2++;
    while (pos2 < max) {
      ch1 = state.src.charCodeAt(pos2);
      if (!isSpace(ch1)) break;
      pos2++;
    }
    state.pos = pos2;
    return true;
  }
  let escapedStr = state.src[pos2];
  if (ch1 >= 55296 && ch1 <= 56319 && pos2 + 1 < max) {
    const ch2 = state.src.charCodeAt(pos2 + 1);
    if (ch2 >= 56320 && ch2 <= 57343) {
      escapedStr += state.src[pos2 + 1];
      pos2++;
    }
  }
  const origStr = "\\" + escapedStr;
  if (!silent) {
    const token = state.push("text_special", "", 0);
    if (ch1 < 256 && ESCAPED[ch1] !== 0) {
      token.content = escapedStr;
    } else {
      token.content = origStr;
    }
    token.markup = origStr;
    token.info = "escape";
  }
  state.pos = pos2 + 1;
  return true;
}
__name(escape$1, "escape$1");
function backtick(state, silent) {
  let pos2 = state.pos;
  const ch = state.src.charCodeAt(pos2);
  if (ch !== 96) {
    return false;
  }
  const start2 = pos2;
  pos2++;
  const max = state.posMax;
  while (pos2 < max && state.src.charCodeAt(pos2) === 96) {
    pos2++;
  }
  const marker = state.src.slice(start2, pos2);
  const openerLength = marker.length;
  if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start2) {
    if (!silent) state.pending += marker;
    state.pos += openerLength;
    return true;
  }
  let matchEnd = pos2;
  let matchStart;
  while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1) {
    matchEnd = matchStart + 1;
    while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96) {
      matchEnd++;
    }
    const closerLength = matchEnd - matchStart;
    if (closerLength === openerLength) {
      if (!silent) {
        const token = state.push("code_inline", "code", 0);
        token.markup = marker;
        token.content = state.src.slice(pos2, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
      }
      state.pos = matchEnd;
      return true;
    }
    state.backticks[closerLength] = matchStart;
  }
  state.backticksScanned = true;
  if (!silent) state.pending += marker;
  state.pos += openerLength;
  return true;
}
__name(backtick, "backtick");
function strikethrough_tokenize(state, silent) {
  const start2 = state.pos;
  const marker = state.src.charCodeAt(start2);
  if (silent) {
    return false;
  }
  if (marker !== 126) {
    return false;
  }
  const scanned = state.scanDelims(state.pos, true);
  let len = scanned.length;
  const ch = String.fromCharCode(marker);
  if (len < 2) {
    return false;
  }
  let token;
  if (len % 2) {
    token = state.push("text", "", 0);
    token.content = ch;
    len--;
  }
  for (let i2 = 0; i2 < len; i2 += 2) {
    token = state.push("text", "", 0);
    token.content = ch + ch;
    state.delimiters.push({
      marker,
      length: 0,
      // disable "rule of 3" length checks meant for emphasis
      token: state.tokens.length - 1,
      end: -1,
      open: scanned.can_open,
      close: scanned.can_close
    });
  }
  state.pos += scanned.length;
  return true;
}
__name(strikethrough_tokenize, "strikethrough_tokenize");
function postProcess$1(state, delimiters) {
  let token;
  const loneMarkers = [];
  const max = delimiters.length;
  for (let i2 = 0; i2 < max; i2++) {
    const startDelim = delimiters[i2];
    if (startDelim.marker !== 126) {
      continue;
    }
    if (startDelim.end === -1) {
      continue;
    }
    const endDelim = delimiters[startDelim.end];
    token = state.tokens[startDelim.token];
    token.type = "s_open";
    token.tag = "s";
    token.nesting = 1;
    token.markup = "~~";
    token.content = "";
    token = state.tokens[endDelim.token];
    token.type = "s_close";
    token.tag = "s";
    token.nesting = -1;
    token.markup = "~~";
    token.content = "";
    if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "~") {
      loneMarkers.push(endDelim.token - 1);
    }
  }
  while (loneMarkers.length) {
    const i2 = loneMarkers.pop();
    let j = i2 + 1;
    while (j < state.tokens.length && state.tokens[j].type === "s_close") {
      j++;
    }
    j--;
    if (i2 !== j) {
      token = state.tokens[j];
      state.tokens[j] = state.tokens[i2];
      state.tokens[i2] = token;
    }
  }
}
__name(postProcess$1, "postProcess$1");
function strikethrough_postProcess(state) {
  const tokens_meta = state.tokens_meta;
  const max = state.tokens_meta.length;
  postProcess$1(state, state.delimiters);
  for (let curr = 0; curr < max; curr++) {
    if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
      postProcess$1(state, tokens_meta[curr].delimiters);
    }
  }
}
__name(strikethrough_postProcess, "strikethrough_postProcess");
const r_strikethrough = {
  tokenize: strikethrough_tokenize,
  postProcess: strikethrough_postProcess
};
function emphasis_tokenize(state, silent) {
  const start2 = state.pos;
  const marker = state.src.charCodeAt(start2);
  if (silent) {
    return false;
  }
  if (marker !== 95 && marker !== 42) {
    return false;
  }
  const scanned = state.scanDelims(state.pos, marker === 42);
  for (let i2 = 0; i2 < scanned.length; i2++) {
    const token = state.push("text", "", 0);
    token.content = String.fromCharCode(marker);
    state.delimiters.push({
      // Char code of the starting marker (number).
      //
      marker,
      // Total length of these series of delimiters.
      //
      length: scanned.length,
      // A position of the token this delimiter corresponds to.
      //
      token: state.tokens.length - 1,
      // If this delimiter is matched as a valid opener, `end` will be
      // equal to its position, otherwise it's `-1`.
      //
      end: -1,
      // Boolean flags that determine if this delimiter could open or close
      // an emphasis.
      //
      open: scanned.can_open,
      close: scanned.can_close
    });
  }
  state.pos += scanned.length;
  return true;
}
__name(emphasis_tokenize, "emphasis_tokenize");
function postProcess(state, delimiters) {
  const max = delimiters.length;
  for (let i2 = max - 1; i2 >= 0; i2--) {
    const startDelim = delimiters[i2];
    if (startDelim.marker !== 95 && startDelim.marker !== 42) {
      continue;
    }
    if (startDelim.end === -1) {
      continue;
    }
    const endDelim = delimiters[startDelim.end];
    const isStrong = i2 > 0 && delimiters[i2 - 1].end === startDelim.end + 1 && // check that first two markers match and adjacent
    delimiters[i2 - 1].marker === startDelim.marker && delimiters[i2 - 1].token === startDelim.token - 1 && // check that last two markers are adjacent (we can safely assume they match)
    delimiters[startDelim.end + 1].token === endDelim.token + 1;
    const ch = String.fromCharCode(startDelim.marker);
    const token_o = state.tokens[startDelim.token];
    token_o.type = isStrong ? "strong_open" : "em_open";
    token_o.tag = isStrong ? "strong" : "em";
    token_o.nesting = 1;
    token_o.markup = isStrong ? ch + ch : ch;
    token_o.content = "";
    const token_c = state.tokens[endDelim.token];
    token_c.type = isStrong ? "strong_close" : "em_close";
    token_c.tag = isStrong ? "strong" : "em";
    token_c.nesting = -1;
    token_c.markup = isStrong ? ch + ch : ch;
    token_c.content = "";
    if (isStrong) {
      state.tokens[delimiters[i2 - 1].token].content = "";
      state.tokens[delimiters[startDelim.end + 1].token].content = "";
      i2--;
    }
  }
}
__name(postProcess, "postProcess");
function emphasis_post_process(state) {
  const tokens_meta = state.tokens_meta;
  const max = state.tokens_meta.length;
  postProcess(state, state.delimiters);
  for (let curr = 0; curr < max; curr++) {
    if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
      postProcess(state, tokens_meta[curr].delimiters);
    }
  }
}
__name(emphasis_post_process, "emphasis_post_process");
const r_emphasis = {
  tokenize: emphasis_tokenize,
  postProcess: emphasis_post_process
};
function link(state, silent) {
  let code2, label5, res, ref2;
  let href = "";
  let title = "";
  let start2 = state.pos;
  let parseReference = true;
  if (state.src.charCodeAt(state.pos) !== 91) {
    return false;
  }
  const oldPos = state.pos;
  const max = state.posMax;
  const labelStart = state.pos + 1;
  const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
  if (labelEnd < 0) {
    return false;
  }
  let pos2 = labelEnd + 1;
  if (pos2 < max && state.src.charCodeAt(pos2) === 40) {
    parseReference = false;
    pos2++;
    for (; pos2 < max; pos2++) {
      code2 = state.src.charCodeAt(pos2);
      if (!isSpace(code2) && code2 !== 10) {
        break;
      }
    }
    if (pos2 >= max) {
      return false;
    }
    start2 = pos2;
    res = state.md.helpers.parseLinkDestination(state.src, pos2, state.posMax);
    if (res.ok) {
      href = state.md.normalizeLink(res.str);
      if (state.md.validateLink(href)) {
        pos2 = res.pos;
      } else {
        href = "";
      }
      start2 = pos2;
      for (; pos2 < max; pos2++) {
        code2 = state.src.charCodeAt(pos2);
        if (!isSpace(code2) && code2 !== 10) {
          break;
        }
      }
      res = state.md.helpers.parseLinkTitle(state.src, pos2, state.posMax);
      if (pos2 < max && start2 !== pos2 && res.ok) {
        title = res.str;
        pos2 = res.pos;
        for (; pos2 < max; pos2++) {
          code2 = state.src.charCodeAt(pos2);
          if (!isSpace(code2) && code2 !== 10) {
            break;
          }
        }
      }
    }
    if (pos2 >= max || state.src.charCodeAt(pos2) !== 41) {
      parseReference = true;
    }
    pos2++;
  }
  if (parseReference) {
    if (typeof state.env.references === "undefined") {
      return false;
    }
    if (pos2 < max && state.src.charCodeAt(pos2) === 91) {
      start2 = pos2 + 1;
      pos2 = state.md.helpers.parseLinkLabel(state, pos2);
      if (pos2 >= 0) {
        label5 = state.src.slice(start2, pos2++);
      } else {
        pos2 = labelEnd + 1;
      }
    } else {
      pos2 = labelEnd + 1;
    }
    if (!label5) {
      label5 = state.src.slice(labelStart, labelEnd);
    }
    ref2 = state.env.references[normalizeReference(label5)];
    if (!ref2) {
      state.pos = oldPos;
      return false;
    }
    href = ref2.href;
    title = ref2.title;
  }
  if (!silent) {
    state.pos = labelStart;
    state.posMax = labelEnd;
    const token_o = state.push("link_open", "a", 1);
    const attrs4 = [["href", href]];
    token_o.attrs = attrs4;
    if (title) {
      attrs4.push(["title", title]);
    }
    state.linkLevel++;
    state.md.inline.tokenize(state);
    state.linkLevel--;
    state.push("link_close", "a", -1);
  }
  state.pos = pos2;
  state.posMax = max;
  return true;
}
__name(link, "link");
function image(state, silent) {
  let code2, content2, label5, pos2, ref2, res, title, start2;
  let href = "";
  const oldPos = state.pos;
  const max = state.posMax;
  if (state.src.charCodeAt(state.pos) !== 33) {
    return false;
  }
  if (state.src.charCodeAt(state.pos + 1) !== 91) {
    return false;
  }
  const labelStart = state.pos + 2;
  const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
  if (labelEnd < 0) {
    return false;
  }
  pos2 = labelEnd + 1;
  if (pos2 < max && state.src.charCodeAt(pos2) === 40) {
    pos2++;
    for (; pos2 < max; pos2++) {
      code2 = state.src.charCodeAt(pos2);
      if (!isSpace(code2) && code2 !== 10) {
        break;
      }
    }
    if (pos2 >= max) {
      return false;
    }
    start2 = pos2;
    res = state.md.helpers.parseLinkDestination(state.src, pos2, state.posMax);
    if (res.ok) {
      href = state.md.normalizeLink(res.str);
      if (state.md.validateLink(href)) {
        pos2 = res.pos;
      } else {
        href = "";
      }
    }
    start2 = pos2;
    for (; pos2 < max; pos2++) {
      code2 = state.src.charCodeAt(pos2);
      if (!isSpace(code2) && code2 !== 10) {
        break;
      }
    }
    res = state.md.helpers.parseLinkTitle(state.src, pos2, state.posMax);
    if (pos2 < max && start2 !== pos2 && res.ok) {
      title = res.str;
      pos2 = res.pos;
      for (; pos2 < max; pos2++) {
        code2 = state.src.charCodeAt(pos2);
        if (!isSpace(code2) && code2 !== 10) {
          break;
        }
      }
    } else {
      title = "";
    }
    if (pos2 >= max || state.src.charCodeAt(pos2) !== 41) {
      state.pos = oldPos;
      return false;
    }
    pos2++;
  } else {
    if (typeof state.env.references === "undefined") {
      return false;
    }
    if (pos2 < max && state.src.charCodeAt(pos2) === 91) {
      start2 = pos2 + 1;
      pos2 = state.md.helpers.parseLinkLabel(state, pos2);
      if (pos2 >= 0) {
        label5 = state.src.slice(start2, pos2++);
      } else {
        pos2 = labelEnd + 1;
      }
    } else {
      pos2 = labelEnd + 1;
    }
    if (!label5) {
      label5 = state.src.slice(labelStart, labelEnd);
    }
    ref2 = state.env.references[normalizeReference(label5)];
    if (!ref2) {
      state.pos = oldPos;
      return false;
    }
    href = ref2.href;
    title = ref2.title;
  }
  if (!silent) {
    content2 = state.src.slice(labelStart, labelEnd);
    const tokens = [];
    state.md.inline.parse(
      content2,
      state.md,
      state.env,
      tokens
    );
    const token = state.push("image", "img", 0);
    const attrs4 = [["src", href], ["alt", ""]];
    token.attrs = attrs4;
    token.children = tokens;
    token.content = content2;
    if (title) {
      attrs4.push(["title", title]);
    }
  }
  state.pos = pos2;
  state.posMax = max;
  return true;
}
__name(image, "image");
const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;
const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
function autolink(state, silent) {
  let pos2 = state.pos;
  if (state.src.charCodeAt(pos2) !== 60) {
    return false;
  }
  const start2 = state.pos;
  const max = state.posMax;
  for (; ; ) {
    if (++pos2 >= max) return false;
    const ch = state.src.charCodeAt(pos2);
    if (ch === 60) return false;
    if (ch === 62) break;
  }
  const url = state.src.slice(start2 + 1, pos2);
  if (AUTOLINK_RE.test(url)) {
    const fullUrl = state.md.normalizeLink(url);
    if (!state.md.validateLink(fullUrl)) {
      return false;
    }
    if (!silent) {
      const token_o = state.push("link_open", "a", 1);
      token_o.attrs = [["href", fullUrl]];
      token_o.markup = "autolink";
      token_o.info = "auto";
      const token_t = state.push("text", "", 0);
      token_t.content = state.md.normalizeLinkText(url);
      const token_c = state.push("link_close", "a", -1);
      token_c.markup = "autolink";
      token_c.info = "auto";
    }
    state.pos += url.length + 2;
    return true;
  }
  if (EMAIL_RE.test(url)) {
    const fullUrl = state.md.normalizeLink("mailto:" + url);
    if (!state.md.validateLink(fullUrl)) {
      return false;
    }
    if (!silent) {
      const token_o = state.push("link_open", "a", 1);
      token_o.attrs = [["href", fullUrl]];
      token_o.markup = "autolink";
      token_o.info = "auto";
      const token_t = state.push("text", "", 0);
      token_t.content = state.md.normalizeLinkText(url);
      const token_c = state.push("link_close", "a", -1);
      token_c.markup = "autolink";
      token_c.info = "auto";
    }
    state.pos += url.length + 2;
    return true;
  }
  return false;
}
__name(autolink, "autolink");
function isLinkOpen(str) {
  return /^<a[>\s]/i.test(str);
}
__name(isLinkOpen, "isLinkOpen");
function isLinkClose(str) {
  return /^<\/a\s*>/i.test(str);
}
__name(isLinkClose, "isLinkClose");
function isLetter(ch) {
  const lc = ch | 32;
  return lc >= 97 && lc <= 122;
}
__name(isLetter, "isLetter");
function html_inline(state, silent) {
  if (!state.md.options.html) {
    return false;
  }
  const max = state.posMax;
  const pos2 = state.pos;
  if (state.src.charCodeAt(pos2) !== 60 || pos2 + 2 >= max) {
    return false;
  }
  const ch = state.src.charCodeAt(pos2 + 1);
  if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) {
    return false;
  }
  const match2 = state.src.slice(pos2).match(HTML_TAG_RE);
  if (!match2) {
    return false;
  }
  if (!silent) {
    const token = state.push("html_inline", "", 0);
    token.content = match2[0];
    if (isLinkOpen(token.content)) state.linkLevel++;
    if (isLinkClose(token.content)) state.linkLevel--;
  }
  state.pos += match2[0].length;
  return true;
}
__name(html_inline, "html_inline");
const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
function entity(state, silent) {
  const pos2 = state.pos;
  const max = state.posMax;
  if (state.src.charCodeAt(pos2) !== 38) return false;
  if (pos2 + 1 >= max) return false;
  const ch = state.src.charCodeAt(pos2 + 1);
  if (ch === 35) {
    const match2 = state.src.slice(pos2).match(DIGITAL_RE);
    if (match2) {
      if (!silent) {
        const code2 = match2[1][0].toLowerCase() === "x" ? parseInt(match2[1].slice(1), 16) : parseInt(match2[1], 10);
        const token = state.push("text_special", "", 0);
        token.content = isValidEntityCode(code2) ? fromCodePoint(code2) : fromCodePoint(65533);
        token.markup = match2[0];
        token.info = "entity";
      }
      state.pos += match2[0].length;
      return true;
    }
  } else {
    const match2 = state.src.slice(pos2).match(NAMED_RE);
    if (match2) {
      const decoded = decodeHTML(match2[0]);
      if (decoded !== match2[0]) {
        if (!silent) {
          const token = state.push("text_special", "", 0);
          token.content = decoded;
          token.markup = match2[0];
          token.info = "entity";
        }
        state.pos += match2[0].length;
        return true;
      }
    }
  }
  return false;
}
__name(entity, "entity");
function processDelimiters(delimiters) {
  const openersBottom = {};
  const max = delimiters.length;
  if (!max) return;
  let headerIdx = 0;
  let lastTokenIdx = -2;
  const jumps = [];
  for (let closerIdx = 0; closerIdx < max; closerIdx++) {
    const closer = delimiters[closerIdx];
    jumps.push(0);
    if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {
      headerIdx = closerIdx;
    }
    lastTokenIdx = closer.token;
    closer.length = closer.length || 0;
    if (!closer.close) continue;
    if (!openersBottom.hasOwnProperty(closer.marker)) {
      openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1];
    }
    const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];
    let openerIdx = headerIdx - jumps[headerIdx] - 1;
    let newMinOpenerIdx = openerIdx;
    for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {
      const opener = delimiters[openerIdx];
      if (opener.marker !== closer.marker) continue;
      if (opener.open && opener.end < 0) {
        let isOddMatch = false;
        if (opener.close || closer.open) {
          if ((opener.length + closer.length) % 3 === 0) {
            if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
              isOddMatch = true;
            }
          }
        }
        if (!isOddMatch) {
          const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;
          jumps[closerIdx] = closerIdx - openerIdx + lastJump;
          jumps[openerIdx] = lastJump;
          closer.open = false;
          opener.end = closerIdx;
          opener.close = false;
          newMinOpenerIdx = -1;
          lastTokenIdx = -2;
          break;
        }
      }
    }
    if (newMinOpenerIdx !== -1) {
      openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;
    }
  }
}
__name(processDelimiters, "processDelimiters");
function link_pairs(state) {
  const tokens_meta = state.tokens_meta;
  const max = state.tokens_meta.length;
  processDelimiters(state.delimiters);
  for (let curr = 0; curr < max; curr++) {
    if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
      processDelimiters(tokens_meta[curr].delimiters);
    }
  }
}
__name(link_pairs, "link_pairs");
function fragments_join(state) {
  let curr, last;
  let level = 0;
  const tokens = state.tokens;
  const max = state.tokens.length;
  for (curr = last = 0; curr < max; curr++) {
    if (tokens[curr].nesting < 0) level--;
    tokens[curr].level = level;
    if (tokens[curr].nesting > 0) level++;
    if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") {
      tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
    } else {
      if (curr !== last) {
        tokens[last] = tokens[curr];
      }
      last++;
    }
  }
  if (curr !== last) {
    tokens.length = last;
  }
}
__name(fragments_join, "fragments_join");
const _rules = [
  ["text", text],
  ["linkify", linkify],
  ["newline", newline],
  ["escape", escape$1],
  ["backticks", backtick],
  ["strikethrough", r_strikethrough.tokenize],
  ["emphasis", r_emphasis.tokenize],
  ["link", link],
  ["image", image],
  ["autolink", autolink],
  ["html_inline", html_inline],
  ["entity", entity]
];
const _rules2 = [
  ["balance_pairs", link_pairs],
  ["strikethrough", r_strikethrough.postProcess],
  ["emphasis", r_emphasis.postProcess],
  // rules for pairs separate '**' into its own text tokens, which may be left unused,
  // rule below merges unused segments back with the rest of the text
  ["fragments_join", fragments_join]
];
function ParserInline() {
  this.ruler = new Ruler();
  for (let i2 = 0; i2 < _rules.length; i2++) {
    this.ruler.push(_rules[i2][0], _rules[i2][1]);
  }
  this.ruler2 = new Ruler();
  for (let i2 = 0; i2 < _rules2.length; i2++) {
    this.ruler2.push(_rules2[i2][0], _rules2[i2][1]);
  }
}
__name(ParserInline, "ParserInline");
ParserInline.prototype.skipToken = function(state) {
  const pos2 = state.pos;
  const rules = this.ruler.getRules("");
  const len = rules.length;
  const maxNesting = state.md.options.maxNesting;
  const cache2 = state.cache;
  if (typeof cache2[pos2] !== "undefined") {
    state.pos = cache2[pos2];
    return;
  }
  let ok = false;
  if (state.level < maxNesting) {
    for (let i2 = 0; i2 < len; i2++) {
      state.level++;
      ok = rules[i2](state, true);
      state.level--;
      if (ok) {
        if (pos2 >= state.pos) {
          throw new Error("inline rule didn't increment state.pos");
        }
        break;
      }
    }
  } else {
    state.pos = state.posMax;
  }
  if (!ok) {
    state.pos++;
  }
  cache2[pos2] = state.pos;
};
ParserInline.prototype.tokenize = function(state) {
  const rules = this.ruler.getRules("");
  const len = rules.length;
  const end = state.posMax;
  const maxNesting = state.md.options.maxNesting;
  while (state.pos < end) {
    const prevPos = state.pos;
    let ok = false;
    if (state.level < maxNesting) {
      for (let i2 = 0; i2 < len; i2++) {
        ok = rules[i2](state, false);
        if (ok) {
          if (prevPos >= state.pos) {
            throw new Error("inline rule didn't increment state.pos");
          }
          break;
        }
      }
    }
    if (ok) {
      if (state.pos >= end) {
        break;
      }
      continue;
    }
    state.pending += state.src[state.pos++];
  }
  if (state.pending) {
    state.pushPending();
  }
};
ParserInline.prototype.parse = function(str, md2, env, outTokens) {
  const state = new this.State(str, md2, env, outTokens);
  this.tokenize(state);
  const rules = this.ruler2.getRules("");
  const len = rules.length;
  for (let i2 = 0; i2 < len; i2++) {
    rules[i2](state);
  }
};
ParserInline.prototype.State = StateInline;
function reFactory(opts) {
  const re = {};
  opts = opts || {};
  re.src_Any = Any.source;
  re.src_Cc = Cc.source;
  re.src_Z = Z.source;
  re.src_P = P.source;
  re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join("|");
  re.src_ZCc = [re.src_Z, re.src_Cc].join("|");
  const text_separators = "[><｜]";
  re.src_pseudo_letter = "(?:(?!" + text_separators + "|" + re.src_ZPCc + ")" + re.src_Any + ")";
  re.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
  re.src_auth = "(?:(?:(?!" + re.src_ZCc + "|[@/\\[\\]()]).)+@)?";
  re.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";
  re.src_host_terminator = "(?=$|" + text_separators + "|" + re.src_ZPCc + ")(?!" + (opts["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + re.src_ZPCc + "))";
  re.src_path = "(?:[/?#](?:(?!" + re.src_ZCc + "|" + text_separators + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + re.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + re.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + re.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + re.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + re.src_ZCc + "|[']).)+\\'|\\'(?=" + re.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + re.src_ZCc + "|[.]|$)|" + (opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + // allow `,,,` in paths
  ",(?!" + re.src_ZCc + "|$)|;(?!" + re.src_ZCc + "|$)|\\!+(?!" + re.src_ZCc + "|[!]|$)|\\?(?!" + re.src_ZCc + "|[?]|$))+|\\/)?";
  re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
  re.src_xn = "xn--[a-z0-9\\-]{1,59}";
  re.src_domain_root = // Allow letters & digits (http://test1)
  "(?:" + re.src_xn + "|" + re.src_pseudo_letter + "{1,63})";
  re.src_domain = "(?:" + re.src_xn + "|(?:" + re.src_pseudo_letter + ")|(?:" + re.src_pseudo_letter + "(?:-|" + re.src_pseudo_letter + "){0,61}" + re.src_pseudo_letter + "))";
  re.src_host = "(?:(?:(?:(?:" + re.src_domain + ")\\.)*" + re.src_domain + "))";
  re.tpl_host_fuzzy = "(?:" + re.src_ip4 + "|(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%)))";
  re.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%))";
  re.src_host_strict = re.src_host + re.src_host_terminator;
  re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator;
  re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator;
  re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
  re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
  re.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + re.src_ZPCc + "|>|$))";
  re.tpl_email_fuzzy = "(^|" + text_separators + '|"|\\(|' + re.src_ZCc + ")(" + re.src_email_name + "@" + re.tpl_host_fuzzy_strict + ")";
  re.tpl_link_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
  // but can start with > (markdown blockquote)
  "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" + re.src_ZPCc + "))((?![$+<=>^`|｜])" + re.tpl_host_port_fuzzy_strict + re.src_path + ")";
  re.tpl_link_no_ip_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
  // but can start with > (markdown blockquote)
  "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" + re.src_ZPCc + "))((?![$+<=>^`|｜])" + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ")";
  return re;
}
__name(reFactory, "reFactory");
function assign(obj) {
  const sources = Array.prototype.slice.call(arguments, 1);
  sources.forEach(function(source) {
    if (!source) {
      return;
    }
    Object.keys(source).forEach(function(key) {
      obj[key] = source[key];
    });
  });
  return obj;
}
__name(assign, "assign");
function _class(obj) {
  return Object.prototype.toString.call(obj);
}
__name(_class, "_class");
function isString$1(obj) {
  return _class(obj) === "[object String]";
}
__name(isString$1, "isString$1");
function isObject$1(obj) {
  return _class(obj) === "[object Object]";
}
__name(isObject$1, "isObject$1");
function isRegExp(obj) {
  return _class(obj) === "[object RegExp]";
}
__name(isRegExp, "isRegExp");
function isFunction(obj) {
  return _class(obj) === "[object Function]";
}
__name(isFunction, "isFunction");
function escapeRE(str) {
  return str.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
}
__name(escapeRE, "escapeRE");
const defaultOptions = {
  fuzzyLink: true,
  fuzzyEmail: true,
  fuzzyIP: false
};
function isOptionsObj(obj) {
  return Object.keys(obj || {}).reduce(function(acc, k) {
    return acc || defaultOptions.hasOwnProperty(k);
  }, false);
}
__name(isOptionsObj, "isOptionsObj");
const defaultSchemas = {
  "http:": {
    validate: /* @__PURE__ */ __name(function(text2, pos2, self2) {
      const tail = text2.slice(pos2);
      if (!self2.re.http) {
        self2.re.http = new RegExp(
          "^\\/\\/" + self2.re.src_auth + self2.re.src_host_port_strict + self2.re.src_path,
          "i"
        );
      }
      if (self2.re.http.test(tail)) {
        return tail.match(self2.re.http)[0].length;
      }
      return 0;
    }, "validate")
  },
  "https:": "http:",
  "ftp:": "http:",
  "//": {
    validate: /* @__PURE__ */ __name(function(text2, pos2, self2) {
      const tail = text2.slice(pos2);
      if (!self2.re.no_http) {
        self2.re.no_http = new RegExp(
          "^" + self2.re.src_auth + // Don't allow single-level domains, because of false positives like '//test'
          // with code comments
          "(?:localhost|(?:(?:" + self2.re.src_domain + ")\\.)+" + self2.re.src_domain_root + ")" + self2.re.src_port + self2.re.src_host_terminator + self2.re.src_path,
          "i"
        );
      }
      if (self2.re.no_http.test(tail)) {
        if (pos2 >= 3 && text2[pos2 - 3] === ":") {
          return 0;
        }
        if (pos2 >= 3 && text2[pos2 - 3] === "/") {
          return 0;
        }
        return tail.match(self2.re.no_http)[0].length;
      }
      return 0;
    }, "validate")
  },
  "mailto:": {
    validate: /* @__PURE__ */ __name(function(text2, pos2, self2) {
      const tail = text2.slice(pos2);
      if (!self2.re.mailto) {
        self2.re.mailto = new RegExp(
          "^" + self2.re.src_email_name + "@" + self2.re.src_host_strict,
          "i"
        );
      }
      if (self2.re.mailto.test(tail)) {
        return tail.match(self2.re.mailto)[0].length;
      }
      return 0;
    }, "validate")
  }
};
const tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
const tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");
function resetScanCache(self2) {
  self2.__index__ = -1;
  self2.__text_cache__ = "";
}
__name(resetScanCache, "resetScanCache");
function createValidator(re) {
  return function(text2, pos2) {
    const tail = text2.slice(pos2);
    if (re.test(tail)) {
      return tail.match(re)[0].length;
    }
    return 0;
  };
}
__name(createValidator, "createValidator");
function createNormalizer() {
  return function(match2, self2) {
    self2.normalize(match2);
  };
}
__name(createNormalizer, "createNormalizer");
function compile(self2) {
  const re = self2.re = reFactory(self2.__opts__);
  const tlds3 = self2.__tlds__.slice();
  self2.onCompile();
  if (!self2.__tlds_replaced__) {
    tlds3.push(tlds_2ch_src_re);
  }
  tlds3.push(re.src_xn);
  re.src_tlds = tlds3.join("|");
  function untpl(tpl) {
    return tpl.replace("%TLDS%", re.src_tlds);
  }
  __name(untpl, "untpl");
  re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
  re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
  re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
  re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
  const aliases = [];
  self2.__compiled__ = {};
  function schemaError(name2, val) {
    throw new Error('(LinkifyIt) Invalid schema "' + name2 + '": ' + val);
  }
  __name(schemaError, "schemaError");
  Object.keys(self2.__schemas__).forEach(function(name2) {
    const val = self2.__schemas__[name2];
    if (val === null) {
      return;
    }
    const compiled = { validate: null, link: null };
    self2.__compiled__[name2] = compiled;
    if (isObject$1(val)) {
      if (isRegExp(val.validate)) {
        compiled.validate = createValidator(val.validate);
      } else if (isFunction(val.validate)) {
        compiled.validate = val.validate;
      } else {
        schemaError(name2, val);
      }
      if (isFunction(val.normalize)) {
        compiled.normalize = val.normalize;
      } else if (!val.normalize) {
        compiled.normalize = createNormalizer();
      } else {
        schemaError(name2, val);
      }
      return;
    }
    if (isString$1(val)) {
      aliases.push(name2);
      return;
    }
    schemaError(name2, val);
  });
  aliases.forEach(function(alias) {
    if (!self2.__compiled__[self2.__schemas__[alias]]) {
      return;
    }
    self2.__compiled__[alias].validate = self2.__compiled__[self2.__schemas__[alias]].validate;
    self2.__compiled__[alias].normalize = self2.__compiled__[self2.__schemas__[alias]].normalize;
  });
  self2.__compiled__[""] = { validate: null, normalize: createNormalizer() };
  const slist = Object.keys(self2.__compiled__).filter(function(name2) {
    return name2.length > 0 && self2.__compiled__[name2];
  }).map(escapeRE).join("|");
  self2.re.schema_test = RegExp("(^|(?!_)(?:[><｜]|" + re.src_ZPCc + "))(" + slist + ")", "i");
  self2.re.schema_search = RegExp("(^|(?!_)(?:[><｜]|" + re.src_ZPCc + "))(" + slist + ")", "ig");
  self2.re.schema_at_start = RegExp("^" + self2.re.schema_search.source, "i");
  self2.re.pretest = RegExp(
    "(" + self2.re.schema_test.source + ")|(" + self2.re.host_fuzzy_test.source + ")|@",
    "i"
  );
  resetScanCache(self2);
}
__name(compile, "compile");
function Match(self2, shift2) {
  const start2 = self2.__index__;
  const end = self2.__last_index__;
  const text2 = self2.__text_cache__.slice(start2, end);
  this.schema = self2.__schema__.toLowerCase();
  this.index = start2 + shift2;
  this.lastIndex = end + shift2;
  this.raw = text2;
  this.text = text2;
  this.url = text2;
}
__name(Match, "Match");
function createMatch(self2, shift2) {
  const match2 = new Match(self2, shift2);
  self2.__compiled__[match2.schema].normalize(match2, self2);
  return match2;
}
__name(createMatch, "createMatch");
function LinkifyIt(schemas, options4) {
  if (!(this instanceof LinkifyIt)) {
    return new LinkifyIt(schemas, options4);
  }
  if (!options4) {
    if (isOptionsObj(schemas)) {
      options4 = schemas;
      schemas = {};
    }
  }
  this.__opts__ = assign({}, defaultOptions, options4);
  this.__index__ = -1;
  this.__last_index__ = -1;
  this.__schema__ = "";
  this.__text_cache__ = "";
  this.__schemas__ = assign({}, defaultSchemas, schemas);
  this.__compiled__ = {};
  this.__tlds__ = tlds_default;
  this.__tlds_replaced__ = false;
  this.re = {};
  compile(this);
}
__name(LinkifyIt, "LinkifyIt");
LinkifyIt.prototype.add = /* @__PURE__ */ __name(function add2(schema2, definition) {
  this.__schemas__[schema2] = definition;
  compile(this);
  return this;
}, "add");
LinkifyIt.prototype.set = /* @__PURE__ */ __name(function set2(options4) {
  this.__opts__ = assign(this.__opts__, options4);
  return this;
}, "set");
LinkifyIt.prototype.test = /* @__PURE__ */ __name(function test2(text2) {
  this.__text_cache__ = text2;
  this.__index__ = -1;
  if (!text2.length) {
    return false;
  }
  let m, ml, me, len, shift2, next2, re, tld_pos, at_pos;
  if (this.re.schema_test.test(text2)) {
    re = this.re.schema_search;
    re.lastIndex = 0;
    while ((m = re.exec(text2)) !== null) {
      len = this.testSchemaAt(text2, m[2], re.lastIndex);
      if (len) {
        this.__schema__ = m[2];
        this.__index__ = m.index + m[1].length;
        this.__last_index__ = m.index + m[0].length + len;
        break;
      }
    }
  }
  if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
    tld_pos = text2.search(this.re.host_fuzzy_test);
    if (tld_pos >= 0) {
      if (this.__index__ < 0 || tld_pos < this.__index__) {
        if ((ml = text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
          shift2 = ml.index + ml[1].length;
          if (this.__index__ < 0 || shift2 < this.__index__) {
            this.__schema__ = "";
            this.__index__ = shift2;
            this.__last_index__ = ml.index + ml[0].length;
          }
        }
      }
    }
  }
  if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
    at_pos = text2.indexOf("@");
    if (at_pos >= 0) {
      if ((me = text2.match(this.re.email_fuzzy)) !== null) {
        shift2 = me.index + me[1].length;
        next2 = me.index + me[0].length;
        if (this.__index__ < 0 || shift2 < this.__index__ || shift2 === this.__index__ && next2 > this.__last_index__) {
          this.__schema__ = "mailto:";
          this.__index__ = shift2;
          this.__last_index__ = next2;
        }
      }
    }
  }
  return this.__index__ >= 0;
}, "test");
LinkifyIt.prototype.pretest = /* @__PURE__ */ __name(function pretest(text2) {
  return this.re.pretest.test(text2);
}, "pretest");
LinkifyIt.prototype.testSchemaAt = /* @__PURE__ */ __name(function testSchemaAt(text2, schema2, pos2) {
  if (!this.__compiled__[schema2.toLowerCase()]) {
    return 0;
  }
  return this.__compiled__[schema2.toLowerCase()].validate(text2, pos2, this);
}, "testSchemaAt");
LinkifyIt.prototype.match = /* @__PURE__ */ __name(function match(text2) {
  const result = [];
  let shift2 = 0;
  if (this.__index__ >= 0 && this.__text_cache__ === text2) {
    result.push(createMatch(this, shift2));
    shift2 = this.__last_index__;
  }
  let tail = shift2 ? text2.slice(shift2) : text2;
  while (this.test(tail)) {
    result.push(createMatch(this, shift2));
    tail = tail.slice(this.__last_index__);
    shift2 += this.__last_index__;
  }
  if (result.length) {
    return result;
  }
  return null;
}, "match");
LinkifyIt.prototype.matchAtStart = /* @__PURE__ */ __name(function matchAtStart(text2) {
  this.__text_cache__ = text2;
  this.__index__ = -1;
  if (!text2.length) return null;
  const m = this.re.schema_at_start.exec(text2);
  if (!m) return null;
  const len = this.testSchemaAt(text2, m[2], m[0].length);
  if (!len) return null;
  this.__schema__ = m[2];
  this.__index__ = m.index + m[1].length;
  this.__last_index__ = m.index + m[0].length + len;
  return createMatch(this, 0);
}, "matchAtStart");
LinkifyIt.prototype.tlds = /* @__PURE__ */ __name(function tlds2(list2, keepOld) {
  list2 = Array.isArray(list2) ? list2 : [list2];
  if (!keepOld) {
    this.__tlds__ = list2.slice();
    this.__tlds_replaced__ = true;
    compile(this);
    return this;
  }
  this.__tlds__ = this.__tlds__.concat(list2).sort().filter(function(el, idx, arr) {
    return el !== arr[idx - 1];
  }).reverse();
  compile(this);
  return this;
}, "tlds");
LinkifyIt.prototype.normalize = /* @__PURE__ */ __name(function normalize2(match2) {
  if (!match2.schema) {
    match2.url = "http://" + match2.url;
  }
  if (match2.schema === "mailto:" && !/^mailto:/i.test(match2.url)) {
    match2.url = "mailto:" + match2.url;
  }
}, "normalize");
LinkifyIt.prototype.onCompile = /* @__PURE__ */ __name(function onCompile() {
}, "onCompile");
"use strict";
const maxInt = 2147483647;
const base = 36;
const tMin = 1;
const tMax = 26;
const skew = 38;
const damp = 700;
const initialBias = 72;
const initialN = 128;
const delimiter = "-";
const regexPunycode = /^xn--/;
const regexNonASCII = /[^\0-\x7F]/;
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
const errors = {
  "overflow": "Overflow: input needs wider integers to process",
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  "invalid-input": "Invalid input"
};
const baseMinusTMin = base - tMin;
const floor = Math.floor;
const stringFromCharCode = String.fromCharCode;
function error(type) {
  throw new RangeError(errors[type]);
}
__name(error, "error");
function map(array, callback) {
  const result = [];
  let length = array.length;
  while (length--) {
    result[length] = callback(array[length]);
  }
  return result;
}
__name(map, "map");
function mapDomain(domain2, callback) {
  const parts2 = domain2.split("@");
  let result = "";
  if (parts2.length > 1) {
    result = parts2[0] + "@";
    domain2 = parts2[1];
  }
  domain2 = domain2.replace(regexSeparators, ".");
  const labels = domain2.split(".");
  const encoded = map(labels, callback).join(".");
  return result + encoded;
}
__name(mapDomain, "mapDomain");
function ucs2decode(string) {
  const output = [];
  let counter = 0;
  const length = string.length;
  while (counter < length) {
    const value4 = string.charCodeAt(counter++);
    if (value4 >= 55296 && value4 <= 56319 && counter < length) {
      const extra = string.charCodeAt(counter++);
      if ((extra & 64512) == 56320) {
        output.push(((value4 & 1023) << 10) + (extra & 1023) + 65536);
      } else {
        output.push(value4);
        counter--;
      }
    } else {
      output.push(value4);
    }
  }
  return output;
}
__name(ucs2decode, "ucs2decode");
const ucs2encode = /* @__PURE__ */ __name((codePoints) => String.fromCodePoint(...codePoints), "ucs2encode");
const basicToDigit = /* @__PURE__ */ __name(function(codePoint) {
  if (codePoint >= 48 && codePoint < 58) {
    return 26 + (codePoint - 48);
  }
  if (codePoint >= 65 && codePoint < 91) {
    return codePoint - 65;
  }
  if (codePoint >= 97 && codePoint < 123) {
    return codePoint - 97;
  }
  return base;
}, "basicToDigit");
const digitToBasic = /* @__PURE__ */ __name(function(digit, flag) {
  return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
}, "digitToBasic");
const adapt = /* @__PURE__ */ __name(function(delta2, numPoints, firstTime) {
  let k = 0;
  delta2 = firstTime ? floor(delta2 / damp) : delta2 >> 1;
  delta2 += floor(delta2 / numPoints);
  for (; delta2 > baseMinusTMin * tMax >> 1; k += base) {
    delta2 = floor(delta2 / baseMinusTMin);
  }
  return floor(k + (baseMinusTMin + 1) * delta2 / (delta2 + skew));
}, "adapt");
const decode = /* @__PURE__ */ __name(function(input) {
  const output = [];
  const inputLength = input.length;
  let i2 = 0;
  let n = initialN;
  let bias = initialBias;
  let basic = input.lastIndexOf(delimiter);
  if (basic < 0) {
    basic = 0;
  }
  for (let j = 0; j < basic; ++j) {
    if (input.charCodeAt(j) >= 128) {
      error("not-basic");
    }
    output.push(input.charCodeAt(j));
  }
  for (let index2 = basic > 0 ? basic + 1 : 0; index2 < inputLength; ) {
    const oldi = i2;
    for (let w = 1, k = base; ; k += base) {
      if (index2 >= inputLength) {
        error("invalid-input");
      }
      const digit = basicToDigit(input.charCodeAt(index2++));
      if (digit >= base) {
        error("invalid-input");
      }
      if (digit > floor((maxInt - i2) / w)) {
        error("overflow");
      }
      i2 += digit * w;
      const t2 = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
      if (digit < t2) {
        break;
      }
      const baseMinusT = base - t2;
      if (w > floor(maxInt / baseMinusT)) {
        error("overflow");
      }
      w *= baseMinusT;
    }
    const out = output.length + 1;
    bias = adapt(i2 - oldi, out, oldi == 0);
    if (floor(i2 / out) > maxInt - n) {
      error("overflow");
    }
    n += floor(i2 / out);
    i2 %= out;
    output.splice(i2++, 0, n);
  }
  return String.fromCodePoint(...output);
}, "decode");
const encode = /* @__PURE__ */ __name(function(input) {
  const output = [];
  input = ucs2decode(input);
  const inputLength = input.length;
  let n = initialN;
  let delta2 = 0;
  let bias = initialBias;
  for (const currentValue of input) {
    if (currentValue < 128) {
      output.push(stringFromCharCode(currentValue));
    }
  }
  const basicLength = output.length;
  let handledCPCount = basicLength;
  if (basicLength) {
    output.push(delimiter);
  }
  while (handledCPCount < inputLength) {
    let m = maxInt;
    for (const currentValue of input) {
      if (currentValue >= n && currentValue < m) {
        m = currentValue;
      }
    }
    const handledCPCountPlusOne = handledCPCount + 1;
    if (m - n > floor((maxInt - delta2) / handledCPCountPlusOne)) {
      error("overflow");
    }
    delta2 += (m - n) * handledCPCountPlusOne;
    n = m;
    for (const currentValue of input) {
      if (currentValue < n && ++delta2 > maxInt) {
        error("overflow");
      }
      if (currentValue === n) {
        let q = delta2;
        for (let k = base; ; k += base) {
          const t2 = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
          if (q < t2) {
            break;
          }
          const qMinusT = q - t2;
          const baseMinusT = base - t2;
          output.push(
            stringFromCharCode(digitToBasic(t2 + qMinusT % baseMinusT, 0))
          );
          q = floor(qMinusT / baseMinusT);
        }
        output.push(stringFromCharCode(digitToBasic(q, 0)));
        bias = adapt(delta2, handledCPCountPlusOne, handledCPCount === basicLength);
        delta2 = 0;
        ++handledCPCount;
      }
    }
    ++delta2;
    ++n;
  }
  return output.join("");
}, "encode");
const toUnicode = /* @__PURE__ */ __name(function(input) {
  return mapDomain(input, function(string) {
    return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
  });
}, "toUnicode");
const toASCII = /* @__PURE__ */ __name(function(input) {
  return mapDomain(input, function(string) {
    return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
  });
}, "toASCII");
const punycode = {
  /**
   * A string representing the current Punycode.js version number.
   * @memberOf punycode
   * @type String
   */
  "version": "2.3.1",
  /**
   * An object of methods to convert from JavaScript's internal character
   * representation (UCS-2) to Unicode code points, and back.
   * @see <https://mathiasbynens.be/notes/javascript-encoding>
   * @memberOf punycode
   * @type Object
   */
  "ucs2": {
    "decode": ucs2decode,
    "encode": ucs2encode
  },
  "decode": decode,
  "encode": encode,
  "toASCII": toASCII,
  "toUnicode": toUnicode
};
const cfg_default = {
  options: {
    // Enable HTML tags in source
    html: false,
    // Use '/' to close single tags (<br />)
    xhtmlOut: false,
    // Convert '\n' in paragraphs into <br>
    breaks: false,
    // CSS language prefix for fenced blocks
    langPrefix: "language-",
    // autoconvert URL-like texts to links
    linkify: false,
    // Enable some language-neutral replacements + quotes beautification
    typographer: false,
    // Double + single quotes replacement pairs, when typographer enabled,
    // and smartquotes on. Could be either a String or an Array.
    //
    // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
    // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
    quotes: "“”‘’",
    /* “”‘’ */
    // Highlighter function. Should return escaped HTML,
    // or '' if the source string is not changed and should be escaped externaly.
    // If result starts with <pre... internal wrapper is skipped.
    //
    // function (/*str, lang*/) { return ''; }
    //
    highlight: null,
    // Internal protection, recursion limit
    maxNesting: 100
  },
  components: {
    core: {},
    block: {},
    inline: {}
  }
};
const cfg_zero = {
  options: {
    // Enable HTML tags in source
    html: false,
    // Use '/' to close single tags (<br />)
    xhtmlOut: false,
    // Convert '\n' in paragraphs into <br>
    breaks: false,
    // CSS language prefix for fenced blocks
    langPrefix: "language-",
    // autoconvert URL-like texts to links
    linkify: false,
    // Enable some language-neutral replacements + quotes beautification
    typographer: false,
    // Double + single quotes replacement pairs, when typographer enabled,
    // and smartquotes on. Could be either a String or an Array.
    //
    // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
    // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
    quotes: "“”‘’",
    /* “”‘’ */
    // Highlighter function. Should return escaped HTML,
    // or '' if the source string is not changed and should be escaped externaly.
    // If result starts with <pre... internal wrapper is skipped.
    //
    // function (/*str, lang*/) { return ''; }
    //
    highlight: null,
    // Internal protection, recursion limit
    maxNesting: 20
  },
  components: {
    core: {
      rules: [
        "normalize",
        "block",
        "inline",
        "text_join"
      ]
    },
    block: {
      rules: [
        "paragraph"
      ]
    },
    inline: {
      rules: [
        "text"
      ],
      rules2: [
        "balance_pairs",
        "fragments_join"
      ]
    }
  }
};
const cfg_commonmark = {
  options: {
    // Enable HTML tags in source
    html: true,
    // Use '/' to close single tags (<br />)
    xhtmlOut: true,
    // Convert '\n' in paragraphs into <br>
    breaks: false,
    // CSS language prefix for fenced blocks
    langPrefix: "language-",
    // autoconvert URL-like texts to links
    linkify: false,
    // Enable some language-neutral replacements + quotes beautification
    typographer: false,
    // Double + single quotes replacement pairs, when typographer enabled,
    // and smartquotes on. Could be either a String or an Array.
    //
    // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
    // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
    quotes: "“”‘’",
    /* “”‘’ */
    // Highlighter function. Should return escaped HTML,
    // or '' if the source string is not changed and should be escaped externaly.
    // If result starts with <pre... internal wrapper is skipped.
    //
    // function (/*str, lang*/) { return ''; }
    //
    highlight: null,
    // Internal protection, recursion limit
    maxNesting: 20
  },
  components: {
    core: {
      rules: [
        "normalize",
        "block",
        "inline",
        "text_join"
      ]
    },
    block: {
      rules: [
        "blockquote",
        "code",
        "fence",
        "heading",
        "hr",
        "html_block",
        "lheading",
        "list",
        "reference",
        "paragraph"
      ]
    },
    inline: {
      rules: [
        "autolink",
        "backticks",
        "emphasis",
        "entity",
        "escape",
        "html_inline",
        "image",
        "link",
        "newline",
        "text"
      ],
      rules2: [
        "balance_pairs",
        "emphasis",
        "fragments_join"
      ]
    }
  }
};
const config = {
  default: cfg_default,
  zero: cfg_zero,
  commonmark: cfg_commonmark
};
const BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
const GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
function validateLink(url) {
  const str = url.trim().toLowerCase();
  return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true;
}
__name(validateLink, "validateLink");
const RECODE_HOSTNAME_FOR = ["http:", "https:", "mailto:"];
function normalizeLink(url) {
  const parsed = urlParse(url, true);
  if (parsed.hostname) {
    if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
      try {
        parsed.hostname = punycode.toASCII(parsed.hostname);
      } catch (er) {
      }
    }
  }
  return encode$2(format$2(parsed));
}
__name(normalizeLink, "normalizeLink");
function normalizeLinkText(url) {
  const parsed = urlParse(url, true);
  if (parsed.hostname) {
    if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
      try {
        parsed.hostname = punycode.toUnicode(parsed.hostname);
      } catch (er) {
      }
    }
  }
  return decode$2(format$2(parsed), decode$2.defaultChars + "%");
}
__name(normalizeLinkText, "normalizeLinkText");
function MarkdownIt(presetName, options4) {
  if (!(this instanceof MarkdownIt)) {
    return new MarkdownIt(presetName, options4);
  }
  if (!options4) {
    if (!isString$2(presetName)) {
      options4 = presetName || {};
      presetName = "default";
    }
  }
  this.inline = new ParserInline();
  this.block = new ParserBlock();
  this.core = new Core();
  this.renderer = new Renderer();
  this.linkify = new LinkifyIt();
  this.validateLink = validateLink;
  this.normalizeLink = normalizeLink;
  this.normalizeLinkText = normalizeLinkText;
  this.utils = utils;
  this.helpers = assign$1({}, helpers);
  this.options = {};
  this.configure(presetName);
  if (options4) {
    this.set(options4);
  }
}
__name(MarkdownIt, "MarkdownIt");
MarkdownIt.prototype.set = function(options4) {
  assign$1(this.options, options4);
  return this;
};
MarkdownIt.prototype.configure = function(presets) {
  const self2 = this;
  if (isString$2(presets)) {
    const presetName = presets;
    presets = config[presetName];
    if (!presets) {
      throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name');
    }
  }
  if (!presets) {
    throw new Error("Wrong `markdown-it` preset, can't be empty");
  }
  if (presets.options) {
    self2.set(presets.options);
  }
  if (presets.components) {
    Object.keys(presets.components).forEach(function(name2) {
      if (presets.components[name2].rules) {
        self2[name2].ruler.enableOnly(presets.components[name2].rules);
      }
      if (presets.components[name2].rules2) {
        self2[name2].ruler2.enableOnly(presets.components[name2].rules2);
      }
    });
  }
  return this;
};
MarkdownIt.prototype.enable = function(list2, ignoreInvalid) {
  let result = [];
  if (!Array.isArray(list2)) {
    list2 = [list2];
  }
  ["core", "block", "inline"].forEach(function(chain) {
    result = result.concat(this[chain].ruler.enable(list2, true));
  }, this);
  result = result.concat(this.inline.ruler2.enable(list2, true));
  const missed = list2.filter(function(name2) {
    return result.indexOf(name2) < 0;
  });
  if (missed.length && !ignoreInvalid) {
    throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + missed);
  }
  return this;
};
MarkdownIt.prototype.disable = function(list2, ignoreInvalid) {
  let result = [];
  if (!Array.isArray(list2)) {
    list2 = [list2];
  }
  ["core", "block", "inline"].forEach(function(chain) {
    result = result.concat(this[chain].ruler.disable(list2, true));
  }, this);
  result = result.concat(this.inline.ruler2.disable(list2, true));
  const missed = list2.filter(function(name2) {
    return result.indexOf(name2) < 0;
  });
  if (missed.length && !ignoreInvalid) {
    throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + missed);
  }
  return this;
};
MarkdownIt.prototype.use = function(plugin) {
  const args = [this].concat(Array.prototype.slice.call(arguments, 1));
  plugin.apply(plugin, args);
  return this;
};
MarkdownIt.prototype.parse = function(src, env) {
  if (typeof src !== "string") {
    throw new Error("Input data should be a String");
  }
  const state = new this.core.State(src, this, env);
  this.core.process(state);
  return state.tokens;
};
MarkdownIt.prototype.render = function(src, env) {
  env = env || {};
  return this.renderer.render(this.parse(src, env), this.options, env);
};
MarkdownIt.prototype.parseInline = function(src, env) {
  const state = new this.core.State(src, this, env);
  state.inlineMode = true;
  this.core.process(state);
  return state.tokens;
};
MarkdownIt.prototype.renderInline = function(src, env) {
  env = env || {};
  return this.renderer.render(this.parseInline(src, env), this.options, env);
};
const schema = new Schema({
  nodes: {
    doc: {
      content: "block+"
    },
    paragraph: {
      content: "inline*",
      group: "block",
      parseDOM: [{ tag: "p" }],
      toDOM() {
        return ["p", 0];
      }
    },
    blockquote: {
      content: "block+",
      group: "block",
      parseDOM: [{ tag: "blockquote" }],
      toDOM() {
        return ["blockquote", 0];
      }
    },
    horizontal_rule: {
      group: "block",
      parseDOM: [{ tag: "hr" }],
      toDOM() {
        return ["div", ["hr"]];
      }
    },
    heading: {
      attrs: { level: { default: 1 } },
      content: "(text | image)*",
      group: "block",
      defining: true,
      parseDOM: [
        { tag: "h1", attrs: { level: 1 } },
        { tag: "h2", attrs: { level: 2 } },
        { tag: "h3", attrs: { level: 3 } },
        { tag: "h4", attrs: { level: 4 } },
        { tag: "h5", attrs: { level: 5 } },
        { tag: "h6", attrs: { level: 6 } }
      ],
      toDOM(node3) {
        return ["h" + node3.attrs.level, 0];
      }
    },
    code_block: {
      content: "text*",
      group: "block",
      code: true,
      defining: true,
      marks: "",
      attrs: { params: { default: "" } },
      parseDOM: [{ tag: "pre", preserveWhitespace: "full", getAttrs: /* @__PURE__ */ __name((node3) => ({ params: node3.getAttribute("data-params") || "" }), "getAttrs") }],
      toDOM(node3) {
        return ["pre", node3.attrs.params ? { "data-params": node3.attrs.params } : {}, ["code", 0]];
      }
    },
    ordered_list: {
      content: "list_item+",
      group: "block",
      attrs: { order: { default: 1 }, tight: { default: false } },
      parseDOM: [{ tag: "ol", getAttrs(dom) {
        return {
          order: dom.hasAttribute("start") ? +dom.getAttribute("start") : 1,
          tight: dom.hasAttribute("data-tight")
        };
      } }],
      toDOM(node3) {
        return ["ol", {
          start: node3.attrs.order == 1 ? null : node3.attrs.order,
          "data-tight": node3.attrs.tight ? "true" : null
        }, 0];
      }
    },
    bullet_list: {
      content: "list_item+",
      group: "block",
      attrs: { tight: { default: false } },
      parseDOM: [{ tag: "ul", getAttrs: /* @__PURE__ */ __name((dom) => ({ tight: dom.hasAttribute("data-tight") }), "getAttrs") }],
      toDOM(node3) {
        return ["ul", { "data-tight": node3.attrs.tight ? "true" : null }, 0];
      }
    },
    list_item: {
      content: "block+",
      defining: true,
      parseDOM: [{ tag: "li" }],
      toDOM() {
        return ["li", 0];
      }
    },
    text: {
      group: "inline"
    },
    image: {
      inline: true,
      attrs: {
        src: {},
        alt: { default: null },
        title: { default: null }
      },
      group: "inline",
      draggable: true,
      parseDOM: [{ tag: "img[src]", getAttrs(dom) {
        return {
          src: dom.getAttribute("src"),
          title: dom.getAttribute("title"),
          alt: dom.getAttribute("alt")
        };
      } }],
      toDOM(node3) {
        return ["img", node3.attrs];
      }
    },
    hard_break: {
      inline: true,
      group: "inline",
      selectable: false,
      parseDOM: [{ tag: "br" }],
      toDOM() {
        return ["br"];
      }
    }
  },
  marks: {
    em: {
      parseDOM: [
        { tag: "i" },
        { tag: "em" },
        { style: "font-style=italic" },
        { style: "font-style=normal", clearMark: /* @__PURE__ */ __name((m) => m.type.name == "em", "clearMark") }
      ],
      toDOM() {
        return ["em"];
      }
    },
    strong: {
      parseDOM: [
        { tag: "strong" },
        { tag: "b", getAttrs: /* @__PURE__ */ __name((node3) => node3.style.fontWeight != "normal" && null, "getAttrs") },
        { style: "font-weight=400", clearMark: /* @__PURE__ */ __name((m) => m.type.name == "strong", "clearMark") },
        { style: "font-weight", getAttrs: /* @__PURE__ */ __name((value4) => /^(bold(er)?|[5-9]\d{2,})$/.test(value4) && null, "getAttrs") }
      ],
      toDOM() {
        return ["strong"];
      }
    },
    link: {
      attrs: {
        href: {},
        title: { default: null }
      },
      inclusive: false,
      parseDOM: [{ tag: "a[href]", getAttrs(dom) {
        return { href: dom.getAttribute("href"), title: dom.getAttribute("title") };
      } }],
      toDOM(node3) {
        return ["a", node3.attrs];
      }
    },
    code: {
      parseDOM: [{ tag: "code" }],
      toDOM() {
        return ["code"];
      }
    }
  }
});
function maybeMerge(a, b) {
  if (a.isText && b.isText && Mark$1.sameSet(a.marks, b.marks))
    return a.withText(a.text + b.text);
}
__name(maybeMerge, "maybeMerge");
class MarkdownParseState {
  static {
    __name(this, "MarkdownParseState");
  }
  constructor(schema2, tokenHandlers2) {
    this.schema = schema2;
    this.tokenHandlers = tokenHandlers2;
    this.stack = [{ type: schema2.topNodeType, attrs: null, content: [], marks: Mark$1.none }];
  }
  top() {
    return this.stack[this.stack.length - 1];
  }
  push(elt) {
    if (this.stack.length)
      this.top().content.push(elt);
  }
  // Adds the given text to the current position in the document,
  // using the current marks as styling.
  addText(text2) {
    if (!text2)
      return;
    let top = this.top(), nodes = top.content, last = nodes[nodes.length - 1];
    let node3 = this.schema.text(text2, top.marks), merged;
    if (last && (merged = maybeMerge(last, node3)))
      nodes[nodes.length - 1] = merged;
    else
      nodes.push(node3);
  }
  // Adds the given mark to the set of active marks.
  openMark(mark2) {
    let top = this.top();
    top.marks = mark2.addToSet(top.marks);
  }
  // Removes the given mark from the set of active marks.
  closeMark(mark2) {
    let top = this.top();
    top.marks = mark2.removeFromSet(top.marks);
  }
  parseTokens(toks) {
    for (let i2 = 0; i2 < toks.length; i2++) {
      let tok = toks[i2];
      let handler6 = this.tokenHandlers[tok.type];
      if (!handler6)
        throw new Error("Token type `" + tok.type + "` not supported by Markdown parser");
      handler6(this, tok, toks, i2);
    }
  }
  // Add a node at the current position.
  addNode(type, attrs4, content2) {
    let top = this.top();
    let node3 = type.createAndFill(attrs4, content2, top ? top.marks : []);
    if (!node3)
      return null;
    this.push(node3);
    return node3;
  }
  // Wrap subsequent content in a node of the given type.
  openNode(type, attrs4) {
    this.stack.push({ type, attrs: attrs4, content: [], marks: Mark$1.none });
  }
  // Close and return the node that is currently on top of the stack.
  closeNode() {
    let info = this.stack.pop();
    return this.addNode(info.type, info.attrs, info.content);
  }
}
function attrs(spec, token, tokens, i2) {
  if (spec.getAttrs)
    return spec.getAttrs(token, tokens, i2);
  else if (spec.attrs instanceof Function)
    return spec.attrs(token);
  else
    return spec.attrs;
}
__name(attrs, "attrs");
function noCloseToken(spec, type) {
  return spec.noCloseToken || type == "code_inline" || type == "code_block" || type == "fence";
}
__name(noCloseToken, "noCloseToken");
function withoutTrailingNewline(str) {
  return str[str.length - 1] == "\n" ? str.slice(0, str.length - 1) : str;
}
__name(withoutTrailingNewline, "withoutTrailingNewline");
function noOp() {
}
__name(noOp, "noOp");
function tokenHandlers(schema2, tokens) {
  let handlers2 = /* @__PURE__ */ Object.create(null);
  for (let type in tokens) {
    let spec = tokens[type];
    if (spec.block) {
      let nodeType = schema2.nodeType(spec.block);
      if (noCloseToken(spec, type)) {
        handlers2[type] = (state, tok, tokens2, i2) => {
          state.openNode(nodeType, attrs(spec, tok, tokens2, i2));
          state.addText(withoutTrailingNewline(tok.content));
          state.closeNode();
        };
      } else {
        handlers2[type + "_open"] = (state, tok, tokens2, i2) => state.openNode(nodeType, attrs(spec, tok, tokens2, i2));
        handlers2[type + "_close"] = (state) => state.closeNode();
      }
    } else if (spec.node) {
      let nodeType = schema2.nodeType(spec.node);
      handlers2[type] = (state, tok, tokens2, i2) => state.addNode(nodeType, attrs(spec, tok, tokens2, i2));
    } else if (spec.mark) {
      let markType = schema2.marks[spec.mark];
      if (noCloseToken(spec, type)) {
        handlers2[type] = (state, tok, tokens2, i2) => {
          state.openMark(markType.create(attrs(spec, tok, tokens2, i2)));
          state.addText(withoutTrailingNewline(tok.content));
          state.closeMark(markType);
        };
      } else {
        handlers2[type + "_open"] = (state, tok, tokens2, i2) => state.openMark(markType.create(attrs(spec, tok, tokens2, i2)));
        handlers2[type + "_close"] = (state) => state.closeMark(markType);
      }
    } else if (spec.ignore) {
      if (noCloseToken(spec, type)) {
        handlers2[type] = noOp;
      } else {
        handlers2[type + "_open"] = noOp;
        handlers2[type + "_close"] = noOp;
      }
    } else {
      throw new RangeError("Unrecognized parsing spec " + JSON.stringify(spec));
    }
  }
  handlers2.text = (state, tok) => state.addText(tok.content);
  handlers2.inline = (state, tok) => state.parseTokens(tok.children);
  handlers2.softbreak = handlers2.softbreak || ((state) => state.addText(" "));
  return handlers2;
}
__name(tokenHandlers, "tokenHandlers");
let MarkdownParser$1 = class MarkdownParser2 {
  static {
    __name(this, "MarkdownParser");
  }
  /**
  Create a parser with the given configuration. You can configure
  the markdown-it parser to parse the dialect you want, and provide
  a description of the ProseMirror entities those tokens map to in
  the `tokens` object, which maps token names to descriptions of
  what to do with them. Such a description is an object, and may
  have the following properties:
  */
  constructor(schema2, tokenizer, tokens) {
    this.schema = schema2;
    this.tokenizer = tokenizer;
    this.tokens = tokens;
    this.tokenHandlers = tokenHandlers(schema2, tokens);
  }
  /**
  Parse a string as [CommonMark](http://commonmark.org/) markup,
  and create a ProseMirror document as prescribed by this parser's
  rules.
  
  The second argument, when given, is passed through to the
  [Markdown
  parser](https://markdown-it.github.io/markdown-it/#MarkdownIt.parse).
  */
  parse(text2, markdownEnv = {}) {
    let state = new MarkdownParseState(this.schema, this.tokenHandlers), doc2;
    state.parseTokens(this.tokenizer.parse(text2, markdownEnv));
    do {
      doc2 = state.closeNode();
    } while (state.stack.length);
    return doc2 || this.schema.topNodeType.createAndFill();
  }
};
function listIsTight(tokens, i2) {
  while (++i2 < tokens.length)
    if (tokens[i2].type != "list_item_open")
      return tokens[i2].hidden;
  return false;
}
__name(listIsTight, "listIsTight");
const defaultMarkdownParser = new MarkdownParser$1(schema, MarkdownIt("commonmark", { html: false }), {
  blockquote: { block: "blockquote" },
  paragraph: { block: "paragraph" },
  list_item: { block: "list_item" },
  bullet_list: { block: "bullet_list", getAttrs: /* @__PURE__ */ __name((_2, tokens, i2) => ({ tight: listIsTight(tokens, i2) }), "getAttrs") },
  ordered_list: { block: "ordered_list", getAttrs: /* @__PURE__ */ __name((tok, tokens, i2) => ({
    order: +tok.attrGet("start") || 1,
    tight: listIsTight(tokens, i2)
  }), "getAttrs") },
  heading: { block: "heading", getAttrs: /* @__PURE__ */ __name((tok) => ({ level: +tok.tag.slice(1) }), "getAttrs") },
  code_block: { block: "code_block", noCloseToken: true },
  fence: { block: "code_block", getAttrs: /* @__PURE__ */ __name((tok) => ({ params: tok.info || "" }), "getAttrs"), noCloseToken: true },
  hr: { node: "horizontal_rule" },
  image: { node: "image", getAttrs: /* @__PURE__ */ __name((tok) => ({
    src: tok.attrGet("src"),
    title: tok.attrGet("title") || null,
    alt: tok.children[0] && tok.children[0].content || null
  }), "getAttrs") },
  hardbreak: { node: "hard_break" },
  em: { mark: "em" },
  strong: { mark: "strong" },
  link: { mark: "link", getAttrs: /* @__PURE__ */ __name((tok) => ({
    href: tok.attrGet("href"),
    title: tok.attrGet("title") || null
  }), "getAttrs") },
  code_inline: { mark: "code", noCloseToken: true }
});
const blankMark = { open: "", close: "", mixable: true };
let MarkdownSerializer$1 = class MarkdownSerializer2 {
  static {
    __name(this, "MarkdownSerializer");
  }
  /**
  Construct a serializer with the given configuration. The `nodes`
  object should map node names in a given schema to function that
  take a serializer state and such a node, and serialize the node.
  */
  constructor(nodes, marks, options4 = {}) {
    this.nodes = nodes;
    this.marks = marks;
    this.options = options4;
  }
  /**
  Serialize the content of the given node to
  [CommonMark](http://commonmark.org/).
  */
  serialize(content2, options4 = {}) {
    options4 = Object.assign({}, this.options, options4);
    let state = new MarkdownSerializerState$1(this.nodes, this.marks, options4);
    state.renderContent(content2);
    return state.out;
  }
};
const defaultMarkdownSerializer = new MarkdownSerializer$1({
  blockquote(state, node3) {
    state.wrapBlock("> ", null, node3, () => state.renderContent(node3));
  },
  code_block(state, node3) {
    const backticks = node3.textContent.match(/`{3,}/gm);
    const fence2 = backticks ? backticks.sort().slice(-1)[0] + "`" : "```";
    state.write(fence2 + (node3.attrs.params || "") + "\n");
    state.text(node3.textContent, false);
    state.write("\n");
    state.write(fence2);
    state.closeBlock(node3);
  },
  heading(state, node3) {
    state.write(state.repeat("#", node3.attrs.level) + " ");
    state.renderInline(node3, false);
    state.closeBlock(node3);
  },
  horizontal_rule(state, node3) {
    state.write(node3.attrs.markup || "---");
    state.closeBlock(node3);
  },
  bullet_list(state, node3) {
    state.renderList(node3, "  ", () => (node3.attrs.bullet || "*") + " ");
  },
  ordered_list(state, node3) {
    let start2 = node3.attrs.order || 1;
    let maxW = String(start2 + node3.childCount - 1).length;
    let space = state.repeat(" ", maxW + 2);
    state.renderList(node3, space, (i2) => {
      let nStr = String(start2 + i2);
      return state.repeat(" ", maxW - nStr.length) + nStr + ". ";
    });
  },
  list_item(state, node3) {
    state.renderContent(node3);
  },
  paragraph(state, node3) {
    state.renderInline(node3);
    state.closeBlock(node3);
  },
  image(state, node3) {
    state.write("![" + state.esc(node3.attrs.alt || "") + "](" + node3.attrs.src.replace(/[\(\)]/g, "\\$&") + (node3.attrs.title ? ' "' + node3.attrs.title.replace(/"/g, '\\"') + '"' : "") + ")");
  },
  hard_break(state, node3, parent, index2) {
    for (let i2 = index2 + 1; i2 < parent.childCount; i2++)
      if (parent.child(i2).type != node3.type) {
        state.write("\\\n");
        return;
      }
  },
  text(state, node3) {
    state.text(node3.text, !state.inAutolink);
  }
}, {
  em: { open: "*", close: "*", mixable: true, expelEnclosingWhitespace: true },
  strong: { open: "**", close: "**", mixable: true, expelEnclosingWhitespace: true },
  link: {
    open(state, mark2, parent, index2) {
      state.inAutolink = isPlainURL(mark2, parent, index2);
      return state.inAutolink ? "<" : "[";
    },
    close(state, mark2, parent, index2) {
      let { inAutolink } = state;
      state.inAutolink = void 0;
      return inAutolink ? ">" : "](" + mark2.attrs.href.replace(/[\(\)"]/g, "\\$&") + (mark2.attrs.title ? ` "${mark2.attrs.title.replace(/"/g, '\\"')}"` : "") + ")";
    },
    mixable: true
  },
  code: {
    open(_state, _mark, parent, index2) {
      return backticksFor(parent.child(index2), -1);
    },
    close(_state, _mark, parent, index2) {
      return backticksFor(parent.child(index2 - 1), 1);
    },
    escape: false
  }
});
function backticksFor(node3, side) {
  let ticks = /`+/g, m, len = 0;
  if (node3.isText)
    while (m = ticks.exec(node3.text))
      len = Math.max(len, m[0].length);
  let result = len > 0 && side > 0 ? " `" : "`";
  for (let i2 = 0; i2 < len; i2++)
    result += "`";
  if (len > 0 && side < 0)
    result += " ";
  return result;
}
__name(backticksFor, "backticksFor");
function isPlainURL(link2, parent, index2) {
  if (link2.attrs.title || !/^\w+:/.test(link2.attrs.href))
    return false;
  let content2 = parent.child(index2);
  if (!content2.isText || content2.text != link2.attrs.href || content2.marks[content2.marks.length - 1] != link2)
    return false;
  return index2 == parent.childCount - 1 || !link2.isInSet(parent.child(index2 + 1).marks);
}
__name(isPlainURL, "isPlainURL");
let MarkdownSerializerState$1 = class MarkdownSerializerState2 {
  static {
    __name(this, "MarkdownSerializerState");
  }
  /**
  @internal
  */
  constructor(nodes, marks, options4) {
    this.nodes = nodes;
    this.marks = marks;
    this.options = options4;
    this.delim = "";
    this.out = "";
    this.closed = null;
    this.inAutolink = void 0;
    this.atBlockStart = false;
    this.inTightList = false;
    if (typeof this.options.tightLists == "undefined")
      this.options.tightLists = false;
    if (typeof this.options.hardBreakNodeName == "undefined")
      this.options.hardBreakNodeName = "hard_break";
  }
  /**
  @internal
  */
  flushClose(size2 = 2) {
    if (this.closed) {
      if (!this.atBlank())
        this.out += "\n";
      if (size2 > 1) {
        let delimMin = this.delim;
        let trim2 = /\s+$/.exec(delimMin);
        if (trim2)
          delimMin = delimMin.slice(0, delimMin.length - trim2[0].length);
        for (let i2 = 1; i2 < size2; i2++)
          this.out += delimMin + "\n";
      }
      this.closed = null;
    }
  }
  /**
  @internal
  */
  getMark(name2) {
    let info = this.marks[name2];
    if (!info) {
      if (this.options.strict !== false)
        throw new Error(`Mark type \`${name2}\` not supported by Markdown renderer`);
      info = blankMark;
    }
    return info;
  }
  /**
  Render a block, prefixing each line with `delim`, and the first
  line in `firstDelim`. `node` should be the node that is closed at
  the end of the block, and `f` is a function that renders the
  content of the block.
  */
  wrapBlock(delim, firstDelim, node3, f) {
    let old = this.delim;
    this.write(firstDelim != null ? firstDelim : delim);
    this.delim += delim;
    f();
    this.delim = old;
    this.closeBlock(node3);
  }
  /**
  @internal
  */
  atBlank() {
    return /(^|\n)$/.test(this.out);
  }
  /**
  Ensure the current content ends with a newline.
  */
  ensureNewLine() {
    if (!this.atBlank())
      this.out += "\n";
  }
  /**
  Prepare the state for writing output (closing closed paragraphs,
  adding delimiters, and so on), and then optionally add content
  (unescaped) to the output.
  */
  write(content2) {
    this.flushClose();
    if (this.delim && this.atBlank())
      this.out += this.delim;
    if (content2)
      this.out += content2;
  }
  /**
  Close the block for the given node.
  */
  closeBlock(node3) {
    this.closed = node3;
  }
  /**
  Add the given text to the document. When escape is not `false`,
  it will be escaped.
  */
  text(text2, escape2 = true) {
    let lines = text2.split("\n");
    for (let i2 = 0; i2 < lines.length; i2++) {
      this.write();
      if (!escape2 && lines[i2][0] == "[" && /(^|[^\\])\!$/.test(this.out))
        this.out = this.out.slice(0, this.out.length - 1) + "\\!";
      this.out += escape2 ? this.esc(lines[i2], this.atBlockStart) : lines[i2];
      if (i2 != lines.length - 1)
        this.out += "\n";
    }
  }
  /**
  Render the given node as a block.
  */
  render(node3, parent, index2) {
    if (this.nodes[node3.type.name]) {
      this.nodes[node3.type.name](this, node3, parent, index2);
    } else {
      if (this.options.strict !== false) {
        throw new Error("Token type `" + node3.type.name + "` not supported by Markdown renderer");
      } else if (!node3.type.isLeaf) {
        if (node3.type.inlineContent)
          this.renderInline(node3);
        else
          this.renderContent(node3);
        if (node3.isBlock)
          this.closeBlock(node3);
      }
    }
  }
  /**
  Render the contents of `parent` as block nodes.
  */
  renderContent(parent) {
    parent.forEach((node3, _2, i2) => this.render(node3, parent, i2));
  }
  /**
  Render the contents of `parent` as inline content.
  */
  renderInline(parent, fromBlockStart = true) {
    this.atBlockStart = fromBlockStart;
    let active3 = [], trailing = "";
    let progress = /* @__PURE__ */ __name((node3, offset, index2) => {
      let marks = node3 ? node3.marks : [];
      if (node3 && node3.type.name === this.options.hardBreakNodeName)
        marks = marks.filter((m) => {
          if (index2 + 1 == parent.childCount)
            return false;
          let next2 = parent.child(index2 + 1);
          return m.isInSet(next2.marks) && (!next2.isText || /\S/.test(next2.text));
        });
      let leading = trailing;
      trailing = "";
      if (node3 && node3.isText && marks.some((mark2) => {
        let info = this.getMark(mark2.type.name);
        return info && info.expelEnclosingWhitespace && !mark2.isInSet(active3);
      })) {
        let [_2, lead, rest] = /^(\s*)(.*)$/m.exec(node3.text);
        if (lead) {
          leading += lead;
          node3 = rest ? node3.withText(rest) : null;
          if (!node3)
            marks = active3;
        }
      }
      if (node3 && node3.isText && marks.some((mark2) => {
        let info = this.getMark(mark2.type.name);
        return info && info.expelEnclosingWhitespace && (index2 == parent.childCount - 1 || !mark2.isInSet(parent.child(index2 + 1).marks));
      })) {
        let [_2, rest, trail] = /^(.*?)(\s*)$/m.exec(node3.text);
        if (trail) {
          trailing = trail;
          node3 = rest ? node3.withText(rest) : null;
          if (!node3)
            marks = active3;
        }
      }
      let inner = marks.length ? marks[marks.length - 1] : null;
      let noEsc = inner && this.getMark(inner.type.name).escape === false;
      let len = marks.length - (noEsc ? 1 : 0);
      outer: for (let i2 = 0; i2 < len; i2++) {
        let mark2 = marks[i2];
        if (!this.getMark(mark2.type.name).mixable)
          break;
        for (let j = 0; j < active3.length; j++) {
          let other = active3[j];
          if (!this.getMark(other.type.name).mixable)
            break;
          if (mark2.eq(other)) {
            if (i2 > j)
              marks = marks.slice(0, j).concat(mark2).concat(marks.slice(j, i2)).concat(marks.slice(i2 + 1, len));
            else if (j > i2)
              marks = marks.slice(0, i2).concat(marks.slice(i2 + 1, j)).concat(mark2).concat(marks.slice(j, len));
            continue outer;
          }
        }
      }
      let keep = 0;
      while (keep < Math.min(active3.length, len) && marks[keep].eq(active3[keep]))
        ++keep;
      while (keep < active3.length)
        this.text(this.markString(active3.pop(), false, parent, index2), false);
      if (leading)
        this.text(leading);
      if (node3) {
        while (active3.length < len) {
          let add3 = marks[active3.length];
          active3.push(add3);
          this.text(this.markString(add3, true, parent, index2), false);
          this.atBlockStart = false;
        }
        if (noEsc && node3.isText)
          this.text(this.markString(inner, true, parent, index2) + node3.text + this.markString(inner, false, parent, index2 + 1), false);
        else
          this.render(node3, parent, index2);
        this.atBlockStart = false;
      }
      if ((node3 === null || node3 === void 0 ? void 0 : node3.isText) && node3.nodeSize > 0) {
        this.atBlockStart = false;
      }
    }, "progress");
    parent.forEach(progress);
    progress(null, 0, parent.childCount);
    this.atBlockStart = false;
  }
  /**
  Render a node's content as a list. `delim` should be the extra
  indentation added to all lines except the first in an item,
  `firstDelim` is a function going from an item index to a
  delimiter for the first line of the item.
  */
  renderList(node3, delim, firstDelim) {
    if (this.closed && this.closed.type == node3.type)
      this.flushClose(3);
    else if (this.inTightList)
      this.flushClose(1);
    let isTight = typeof node3.attrs.tight != "undefined" ? node3.attrs.tight : this.options.tightLists;
    let prevTight = this.inTightList;
    this.inTightList = isTight;
    node3.forEach((child, _2, i2) => {
      if (i2 && isTight)
        this.flushClose(1);
      this.wrapBlock(delim, firstDelim(i2), node3, () => this.render(child, node3, i2));
    });
    this.inTightList = prevTight;
  }
  /**
  Escape the given string so that it can safely appear in Markdown
  content. If `startOfLine` is true, also escape characters that
  have special meaning only at the start of the line.
  */
  esc(str, startOfLine = false) {
    str = str.replace(/[`*\\~\[\]_]/g, (m, i2) => m == "_" && i2 > 0 && i2 + 1 < str.length && str[i2 - 1].match(/\w/) && str[i2 + 1].match(/\w/) ? m : "\\" + m);
    if (startOfLine)
      str = str.replace(/^(\+[ ]|[\-*>])/, "\\$&").replace(/^(\s*)(#{1,6})(\s|$)/, "$1\\$2$3").replace(/^(\s*\d+)\.\s/, "$1\\. ");
    if (this.options.escapeExtraCharacters)
      str = str.replace(this.options.escapeExtraCharacters, "\\$&");
    return str;
  }
  /**
  @internal
  */
  quote(str) {
    let wrap2 = str.indexOf('"') == -1 ? '""' : str.indexOf("'") == -1 ? "''" : "()";
    return wrap2[0] + str + wrap2[1];
  }
  /**
  Repeat the given string `n` times.
  */
  repeat(str, n) {
    let out = "";
    for (let i2 = 0; i2 < n; i2++)
      out += str;
    return out;
  }
  /**
  Get the markdown string for a given opening or closing mark.
  */
  markString(mark2, open2, parent, index2) {
    let info = this.getMark(mark2.type.name);
    let value4 = open2 ? info.open : info.close;
    return typeof value4 == "string" ? value4 : value4(this, mark2, parent, index2);
  }
  /**
  Get leading and trailing whitespace from a string. Values of
  leading or trailing property of the return object will be undefined
  if there is no match.
  */
  getEnclosingWhitespace(text2) {
    return {
      leading: (text2.match(/^(\s+)/) || [void 0])[0],
      trailing: (text2.match(/(\s+)$/) || [void 0])[0]
    };
  }
};
var disableCheckboxes = true;
var useLabelWrapper = false;
var useLabelAfter = false;
var markdownItTaskLists = /* @__PURE__ */ __name(function(md2, options4) {
  if (options4) {
    disableCheckboxes = !options4.enabled;
    useLabelWrapper = !!options4.label;
    useLabelAfter = !!options4.labelAfter;
  }
  md2.core.ruler.after("inline", "github-task-lists", function(state) {
    var tokens = state.tokens;
    for (var i2 = 2; i2 < tokens.length; i2++) {
      if (isTodoItem(tokens, i2)) {
        todoify(tokens[i2], state.Token);
        attrSet(tokens[i2 - 2], "class", "task-list-item" + (!disableCheckboxes ? " enabled" : ""));
        attrSet(tokens[parentToken(tokens, i2 - 2)], "class", "contains-task-list");
      }
    }
  });
}, "markdownItTaskLists");
function attrSet(token, name2, value4) {
  var index2 = token.attrIndex(name2);
  var attr = [name2, value4];
  if (index2 < 0) {
    token.attrPush(attr);
  } else {
    token.attrs[index2] = attr;
  }
}
__name(attrSet, "attrSet");
function parentToken(tokens, index2) {
  var targetLevel = tokens[index2].level - 1;
  for (var i2 = index2 - 1; i2 >= 0; i2--) {
    if (tokens[i2].level === targetLevel) {
      return i2;
    }
  }
  return -1;
}
__name(parentToken, "parentToken");
function isTodoItem(tokens, index2) {
  return isInline(tokens[index2]) && isParagraph(tokens[index2 - 1]) && isListItem(tokens[index2 - 2]) && startsWithTodoMarkdown(tokens[index2]);
}
__name(isTodoItem, "isTodoItem");
function todoify(token, TokenConstructor) {
  token.children.unshift(makeCheckbox(token, TokenConstructor));
  token.children[1].content = token.children[1].content.slice(3);
  token.content = token.content.slice(3);
  if (useLabelWrapper) {
    if (useLabelAfter) {
      token.children.pop();
      var id3 = "task-item-" + Math.ceil(Math.random() * (1e4 * 1e3) - 1e3);
      token.children[0].content = token.children[0].content.slice(0, -1) + ' id="' + id3 + '">';
      token.children.push(afterLabel(token.content, id3, TokenConstructor));
    } else {
      token.children.unshift(beginLabel(TokenConstructor));
      token.children.push(endLabel(TokenConstructor));
    }
  }
}
__name(todoify, "todoify");
function makeCheckbox(token, TokenConstructor) {
  var checkbox = new TokenConstructor("html_inline", "", 0);
  var disabledAttr = disableCheckboxes ? ' disabled="" ' : "";
  if (token.content.indexOf("[ ] ") === 0) {
    checkbox.content = '<input class="task-list-item-checkbox"' + disabledAttr + 'type="checkbox">';
  } else if (token.content.indexOf("[x] ") === 0 || token.content.indexOf("[X] ") === 0) {
    checkbox.content = '<input class="task-list-item-checkbox" checked=""' + disabledAttr + 'type="checkbox">';
  }
  return checkbox;
}
__name(makeCheckbox, "makeCheckbox");
function beginLabel(TokenConstructor) {
  var token = new TokenConstructor("html_inline", "", 0);
  token.content = "<label>";
  return token;
}
__name(beginLabel, "beginLabel");
function endLabel(TokenConstructor) {
  var token = new TokenConstructor("html_inline", "", 0);
  token.content = "</label>";
  return token;
}
__name(endLabel, "endLabel");
function afterLabel(content2, id3, TokenConstructor) {
  var token = new TokenConstructor("html_inline", "", 0);
  token.content = '<label class="task-list-item-label" for="' + id3 + '">' + content2 + "</label>";
  token.attrs = [{ for: id3 }];
  return token;
}
__name(afterLabel, "afterLabel");
function isInline(token) {
  return token.type === "inline";
}
__name(isInline, "isInline");
function isParagraph(token) {
  return token.type === "paragraph_open";
}
__name(isParagraph, "isParagraph");
function isListItem(token) {
  return token.type === "list_item_open";
}
__name(isListItem, "isListItem");
function startsWithTodoMarkdown(token) {
  return token.content.indexOf("[ ] ") === 0 || token.content.indexOf("[x] ") === 0 || token.content.indexOf("[X] ") === 0;
}
__name(startsWithTodoMarkdown, "startsWithTodoMarkdown");
const taskListPlugin = /* @__PURE__ */ getDefaultExportFromCjs(markdownItTaskLists);
var __defProp = Object.defineProperty;
var __defNormalProp = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp");
var __publicField = /* @__PURE__ */ __name((obj, key, value4) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value4);
  return value4;
}, "__publicField");
const MarkdownTightLists = Extension.create({
  name: "markdownTightLists",
  addOptions: /* @__PURE__ */ __name(() => ({
    tight: true,
    tightClass: "tight",
    listTypes: ["bulletList", "orderedList"]
  }), "addOptions"),
  addGlobalAttributes() {
    return [{
      types: this.options.listTypes,
      attributes: {
        tight: {
          default: this.options.tight,
          parseHTML: /* @__PURE__ */ __name((element) => element.getAttribute("data-tight") === "true" || !element.querySelector("p"), "parseHTML"),
          renderHTML: /* @__PURE__ */ __name((attributes) => ({
            class: attributes.tight ? this.options.tightClass : null,
            "data-tight": attributes.tight ? "true" : null
          }), "renderHTML")
        }
      }
    }];
  },
  addCommands() {
    var _this = this;
    return {
      toggleTight: /* @__PURE__ */ __name(function() {
        let tight = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
        return (_ref) => {
          let {
            editor,
            commands: commands2
          } = _ref;
          function toggleTight(name2) {
            if (!editor.isActive(name2)) {
              return false;
            }
            const attrs4 = editor.getAttributes(name2);
            return commands2.updateAttributes(name2, {
              tight: tight !== null && tight !== void 0 ? tight : !(attrs4 !== null && attrs4 !== void 0 && attrs4.tight)
            });
          }
          __name(toggleTight, "toggleTight");
          return _this.options.listTypes.some((name2) => toggleTight(name2));
        };
      }, "toggleTight")
    };
  }
});
const md = MarkdownIt();
function scanDelims(text2, pos2) {
  md.inline.State.prototype.scanDelims.call({
    src: text2,
    posMax: text2.length
  });
  const state = new md.inline.State(text2, null, null, []);
  return state.scanDelims(pos2, true);
}
__name(scanDelims, "scanDelims");
function shiftDelim(text2, delim, start2, offset) {
  let res = text2.substring(0, start2) + text2.substring(start2 + delim.length);
  res = res.substring(0, start2 + offset) + delim + res.substring(start2 + offset);
  return res;
}
__name(shiftDelim, "shiftDelim");
function trimStart(text2, delim, from2, to) {
  let pos2 = from2, res = text2;
  while (pos2 < to) {
    if (scanDelims(res, pos2).can_open) {
      break;
    }
    res = shiftDelim(res, delim, pos2, 1);
    pos2++;
  }
  return {
    text: res,
    from: pos2,
    to
  };
}
__name(trimStart, "trimStart");
function trimEnd(text2, delim, from2, to) {
  let pos2 = to, res = text2;
  while (pos2 > from2) {
    if (scanDelims(res, pos2).can_close) {
      break;
    }
    res = shiftDelim(res, delim, pos2, -1);
    pos2--;
  }
  return {
    text: res,
    from: from2,
    to: pos2
  };
}
__name(trimEnd, "trimEnd");
function trimInline(text2, delim, from2, to) {
  let state = {
    text: text2,
    from: from2,
    to
  };
  state = trimStart(state.text, delim, state.from, state.to);
  state = trimEnd(state.text, delim, state.from, state.to);
  if (state.to - state.from < delim.length + 1) {
    state.text = state.text.substring(0, state.from) + state.text.substring(state.to + delim.length);
  }
  return state.text;
}
__name(trimInline, "trimInline");
class MarkdownSerializerState extends MarkdownSerializerState$1 {
  static {
    __name(this, "MarkdownSerializerState");
  }
  constructor(nodes, marks, options4) {
    super(nodes, marks, options4 !== null && options4 !== void 0 ? options4 : {});
    __publicField(this, "inTable", false);
    this.inlines = [];
  }
  render(node3, parent, index2) {
    super.render(node3, parent, index2);
    const top = this.inlines[this.inlines.length - 1];
    if (top !== null && top !== void 0 && top.start && top !== null && top !== void 0 && top.end) {
      const {
        delimiter: delimiter2,
        start: start2,
        end
      } = this.normalizeInline(top);
      this.out = trimInline(this.out, delimiter2, start2, end);
      this.inlines.pop();
    }
  }
  markString(mark2, open2, parent, index2) {
    const info = this.marks[mark2.type.name];
    if (info.expelEnclosingWhitespace) {
      if (open2) {
        this.inlines.push({
          start: this.out.length,
          delimiter: info.open
        });
      } else {
        const top = this.inlines.pop();
        this.inlines.push({
          ...top,
          end: this.out.length
        });
      }
    }
    return super.markString(mark2, open2, parent, index2);
  }
  normalizeInline(inline3) {
    let {
      start: start2,
      end
    } = inline3;
    while (this.out.charAt(start2).match(/\s/)) {
      start2++;
    }
    return {
      ...inline3,
      start: start2
    };
  }
}
const HTMLMark = Mark.create({
  name: "markdownHTMLMark",
  /**
   * @return {{markdown: MarkdownMarkSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: {
          open(state, mark2) {
            var _getMarkTags$, _getMarkTags;
            if (!this.editor.storage.markdown.options.html) {
              console.warn(`Tiptap Markdown: "${mark2.type.name}" mark is only available in html mode`);
              return "";
            }
            return (_getMarkTags$ = (_getMarkTags = getMarkTags(mark2)) === null || _getMarkTags === void 0 ? void 0 : _getMarkTags[0]) !== null && _getMarkTags$ !== void 0 ? _getMarkTags$ : "";
          },
          close(state, mark2) {
            var _getMarkTags$2, _getMarkTags2;
            if (!this.editor.storage.markdown.options.html) {
              return "";
            }
            return (_getMarkTags$2 = (_getMarkTags2 = getMarkTags(mark2)) === null || _getMarkTags2 === void 0 ? void 0 : _getMarkTags2[1]) !== null && _getMarkTags$2 !== void 0 ? _getMarkTags$2 : "";
          }
        },
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
function getMarkTags(mark2) {
  const schema2 = mark2.type.schema;
  const node3 = schema2.text(" ", [mark2]);
  const html = getHTMLFromFragment(Fragment.from(node3), schema2);
  const match2 = html.match(/^(<.*?>) (<\/.*?>)$/);
  return match2 ? [match2[1], match2[2]] : null;
}
__name(getMarkTags, "getMarkTags");
function elementFromString(value4) {
  const wrappedValue = `<body>${value4}</body>`;
  return new window.DOMParser().parseFromString(wrappedValue, "text/html").body;
}
__name(elementFromString, "elementFromString");
function escapeHTML(value4) {
  return value4 === null || value4 === void 0 ? void 0 : value4.replace(/</g, "&lt;").replace(/>/g, "&gt;");
}
__name(escapeHTML, "escapeHTML");
function extractElement(node3) {
  const parent = node3.parentElement;
  const prepend2 = parent.cloneNode();
  while (parent.firstChild && parent.firstChild !== node3) {
    prepend2.appendChild(parent.firstChild);
  }
  if (prepend2.childNodes.length > 0) {
    parent.parentElement.insertBefore(prepend2, parent);
  }
  parent.parentElement.insertBefore(node3, parent);
  if (parent.childNodes.length === 0) {
    parent.remove();
  }
}
__name(extractElement, "extractElement");
function unwrapElement(node3) {
  const parent = node3.parentNode;
  while (node3.firstChild)
    parent.insertBefore(node3.firstChild, node3);
  parent.removeChild(node3);
}
__name(unwrapElement, "unwrapElement");
const HTMLNode = Node$1.create({
  name: "markdownHTMLNode",
  addStorage() {
    return {
      markdown: {
        serialize(state, node3, parent) {
          if (this.editor.storage.markdown.options.html) {
            state.write(serializeHTML(node3, parent));
          } else {
            console.warn(`Tiptap Markdown: "${node3.type.name}" node is only available in html mode`);
            state.write(`[${node3.type.name}]`);
          }
          if (node3.isBlock) {
            state.closeBlock(node3);
          }
        },
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
function serializeHTML(node3, parent) {
  const schema2 = node3.type.schema;
  const html = getHTMLFromFragment(Fragment.from(node3), schema2);
  if (node3.isBlock && (parent instanceof Fragment || parent.type.name === schema2.topNodeType.name)) {
    return formatBlock(html);
  }
  return html;
}
__name(serializeHTML, "serializeHTML");
function formatBlock(html) {
  const dom = elementFromString(html);
  const element = dom.firstElementChild;
  element.innerHTML = element.innerHTML.trim() ? `
${element.innerHTML}
` : `
`;
  return element.outerHTML;
}
__name(formatBlock, "formatBlock");
const Blockquote = Node$1.create({
  name: "blockquote"
});
const Blockquote$1 = Blockquote.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.nodes.blockquote,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const BulletList = Node$1.create({
  name: "bulletList"
});
const BulletList$1 = BulletList.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize(state, node3) {
          return state.renderList(node3, "  ", () => (this.editor.storage.markdown.options.bulletListMarker || "-") + " ");
        },
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const CodeBlock = Node$1.create({
  name: "codeBlock"
});
const CodeBlock$1 = CodeBlock.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize(state, node3) {
          state.write("```" + (node3.attrs.language || "") + "\n");
          state.text(node3.textContent, false);
          state.ensureNewLine();
          state.write("```");
          state.closeBlock(node3);
        },
        parse: {
          setup(markdownit2) {
            var _this$options$languag;
            markdownit2.set({
              langPrefix: (_this$options$languag = this.options.languageClassPrefix) !== null && _this$options$languag !== void 0 ? _this$options$languag : "language-"
            });
          },
          updateDOM(element) {
            element.innerHTML = element.innerHTML.replace(/\n<\/code><\/pre>/g, "</code></pre>");
          }
        }
      }
    };
  }
});
const HardBreak = Node$1.create({
  name: "hardBreak"
});
const HardBreak$1 = HardBreak.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize(state, node3, parent, index2) {
          for (let i2 = index2 + 1; i2 < parent.childCount; i2++)
            if (parent.child(i2).type != node3.type) {
              state.write(state.inTable ? HTMLNode.storage.markdown.serialize.call(this, state, node3, parent) : "\\\n");
              return;
            }
        },
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const Heading = Node$1.create({
  name: "heading"
});
const Heading$1 = Heading.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.nodes.heading,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const HorizontalRule = Node$1.create({
  name: "horizontalRule"
});
const HorizontalRule$1 = HorizontalRule.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.nodes.horizontal_rule,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const Image$1 = Node$1.create({
  name: "image"
});
const Image$1$1 = Image$1.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.nodes.image,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const ListItem = Node$1.create({
  name: "listItem"
});
const ListItem$1 = ListItem.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.nodes.list_item,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const OrderedList = Node$1.create({
  name: "orderedList"
});
function findIndexOfAdjacentNode(node3, parent, index2) {
  let i2 = 0;
  for (; index2 - i2 > 0; i2++) {
    if (parent.child(index2 - i2 - 1).type.name !== node3.type.name) {
      break;
    }
  }
  return i2;
}
__name(findIndexOfAdjacentNode, "findIndexOfAdjacentNode");
const OrderedList$1 = OrderedList.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize(state, node3, parent, index2) {
          const start2 = node3.attrs.start || 1;
          const maxW = String(start2 + node3.childCount - 1).length;
          const space = state.repeat(" ", maxW + 2);
          const adjacentIndex = findIndexOfAdjacentNode(node3, parent, index2);
          const separator = adjacentIndex % 2 ? ") " : ". ";
          state.renderList(node3, space, (i2) => {
            const nStr = String(start2 + i2);
            return state.repeat(" ", maxW - nStr.length) + nStr + separator;
          });
        },
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const Paragraph = Node$1.create({
  name: "paragraph"
});
const Paragraph$1 = Paragraph.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.nodes.paragraph,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
function childNodes(node3) {
  var _node$content$content, _node$content;
  return (_node$content$content = node3 === null || node3 === void 0 || (_node$content = node3.content) === null || _node$content === void 0 ? void 0 : _node$content.content) !== null && _node$content$content !== void 0 ? _node$content$content : [];
}
__name(childNodes, "childNodes");
const Table = Node$1.create({
  name: "table"
});
const Table$1 = Table.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize(state, node3, parent) {
          if (!isMarkdownSerializable(node3)) {
            HTMLNode.storage.markdown.serialize.call(this, state, node3, parent);
            return;
          }
          state.inTable = true;
          node3.forEach((row, p2, i2) => {
            state.write("| ");
            row.forEach((col, p22, j) => {
              if (j) {
                state.write(" | ");
              }
              const cellContent = col.firstChild;
              if (cellContent.textContent.trim()) {
                state.renderInline(cellContent);
              }
            });
            state.write(" |");
            state.ensureNewLine();
            if (!i2) {
              const delimiterRow = Array.from({
                length: row.childCount
              }).map(() => "---").join(" | ");
              state.write(`| ${delimiterRow} |`);
              state.ensureNewLine();
            }
          });
          state.closeBlock(node3);
          state.inTable = false;
        },
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
function hasSpan(node3) {
  return node3.attrs.colspan > 1 || node3.attrs.rowspan > 1;
}
__name(hasSpan, "hasSpan");
function isMarkdownSerializable(node3) {
  const rows = childNodes(node3);
  const firstRow = rows[0];
  const bodyRows = rows.slice(1);
  if (childNodes(firstRow).some((cell) => cell.type.name !== "tableHeader" || hasSpan(cell) || cell.childCount > 1)) {
    return false;
  }
  if (bodyRows.some((row) => childNodes(row).some((cell) => cell.type.name === "tableHeader" || hasSpan(cell) || cell.childCount > 1))) {
    return false;
  }
  return true;
}
__name(isMarkdownSerializable, "isMarkdownSerializable");
const TaskItem$1 = Node$1.create({
  name: "taskItem"
});
const TaskItem$1$1 = TaskItem$1.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize(state, node3) {
          const check = node3.attrs.checked ? "[x]" : "[ ]";
          state.write(`${check} `);
          state.renderContent(node3);
        },
        parse: {
          updateDOM(element) {
            [...element.querySelectorAll(".task-list-item")].forEach((item3) => {
              const input = item3.querySelector("input");
              item3.setAttribute("data-type", "taskItem");
              if (input) {
                item3.setAttribute("data-checked", input.checked);
                input.remove();
              }
            });
          }
        }
      }
    };
  }
});
const TaskList = Node$1.create({
  name: "taskList"
});
const TaskList$1 = TaskList.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: BulletList$1.storage.markdown.serialize,
        parse: {
          setup(markdownit2) {
            markdownit2.use(taskListPlugin);
          },
          updateDOM(element) {
            [...element.querySelectorAll(".contains-task-list")].forEach((list2) => {
              list2.setAttribute("data-type", "taskList");
            });
          }
        }
      }
    };
  }
});
const Text$1 = Node$1.create({
  name: "text"
});
const Text$1$1 = Text$1.extend({
  /**
   * @return {{markdown: MarkdownNodeSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize(state, node3) {
          state.text(escapeHTML(node3.text));
        },
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const Bold = Mark.create({
  name: "bold"
});
const Bold$1 = Bold.extend({
  /**
   * @return {{markdown: MarkdownMarkSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.marks.strong,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const Code = Mark.create({
  name: "code"
});
const Code$1 = Code.extend({
  /**
   * @return {{markdown: MarkdownMarkSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.marks.code,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const Italic = Mark.create({
  name: "italic"
});
const Italic$1 = Italic.extend({
  /**
   * @return {{markdown: MarkdownMarkSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.marks.em,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const Link = Mark.create({
  name: "link"
});
const Link$1 = Link.extend({
  /**
   * @return {{markdown: MarkdownMarkSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: defaultMarkdownSerializer.marks.link,
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const Strike = Mark.create({
  name: "strike"
});
const Strike$1 = Strike.extend({
  /**
   * @return {{markdown: MarkdownMarkSpec}}
   */
  addStorage() {
    return {
      markdown: {
        serialize: {
          open: "~~",
          close: "~~",
          expelEnclosingWhitespace: true
        },
        parse: {
          // handled by markdown-it
        }
      }
    };
  }
});
const markdownExtensions = [Blockquote$1, BulletList$1, CodeBlock$1, HardBreak$1, Heading$1, HorizontalRule$1, HTMLNode, Image$1$1, ListItem$1, OrderedList$1, Paragraph$1, Table$1, TaskItem$1$1, TaskList$1, Text$1$1, Bold$1, Code$1, HTMLMark, Italic$1, Link$1, Strike$1];
function getMarkdownSpec(extension) {
  var _extension$storage, _markdownExtensions$f;
  const markdownSpec = (_extension$storage = extension.storage) === null || _extension$storage === void 0 ? void 0 : _extension$storage.markdown;
  const defaultMarkdownSpec = (_markdownExtensions$f = markdownExtensions.find((e2) => e2.name === extension.name)) === null || _markdownExtensions$f === void 0 ? void 0 : _markdownExtensions$f.storage.markdown;
  if (markdownSpec || defaultMarkdownSpec) {
    return {
      ...defaultMarkdownSpec,
      ...markdownSpec
    };
  }
  return null;
}
__name(getMarkdownSpec, "getMarkdownSpec");
class MarkdownSerializer {
  static {
    __name(this, "MarkdownSerializer");
  }
  constructor(editor) {
    __publicField(this, "editor", null);
    this.editor = editor;
  }
  serialize(content2) {
    const state = new MarkdownSerializerState(this.nodes, this.marks, {
      hardBreakNodeName: HardBreak$1.name
    });
    state.renderContent(content2);
    return state.out;
  }
  get nodes() {
    var _this$editor$extensio;
    return {
      ...Object.fromEntries(Object.keys(this.editor.schema.nodes).map((name2) => [name2, this.serializeNode(HTMLNode)])),
      ...Object.fromEntries((_this$editor$extensio = this.editor.extensionManager.extensions.filter((extension) => extension.type === "node" && this.serializeNode(extension)).map((extension) => [extension.name, this.serializeNode(extension)])) !== null && _this$editor$extensio !== void 0 ? _this$editor$extensio : [])
    };
  }
  get marks() {
    var _this$editor$extensio2;
    return {
      ...Object.fromEntries(Object.keys(this.editor.schema.marks).map((name2) => [name2, this.serializeMark(HTMLMark)])),
      ...Object.fromEntries((_this$editor$extensio2 = this.editor.extensionManager.extensions.filter((extension) => extension.type === "mark" && this.serializeMark(extension)).map((extension) => [extension.name, this.serializeMark(extension)])) !== null && _this$editor$extensio2 !== void 0 ? _this$editor$extensio2 : [])
    };
  }
  serializeNode(node3) {
    var _getMarkdownSpec;
    return (_getMarkdownSpec = getMarkdownSpec(node3)) === null || _getMarkdownSpec === void 0 || (_getMarkdownSpec = _getMarkdownSpec.serialize) === null || _getMarkdownSpec === void 0 ? void 0 : _getMarkdownSpec.bind({
      editor: this.editor,
      options: node3.options
    });
  }
  serializeMark(mark2) {
    var _getMarkdownSpec2;
    const serialize = (_getMarkdownSpec2 = getMarkdownSpec(mark2)) === null || _getMarkdownSpec2 === void 0 ? void 0 : _getMarkdownSpec2.serialize;
    return serialize ? {
      ...serialize,
      open: typeof serialize.open === "function" ? serialize.open.bind({
        editor: this.editor,
        options: mark2.options
      }) : serialize.open,
      close: typeof serialize.close === "function" ? serialize.close.bind({
        editor: this.editor,
        options: mark2.options
      }) : serialize.close
    } : null;
  }
}
class MarkdownParser {
  static {
    __name(this, "MarkdownParser");
  }
  constructor(editor, _ref) {
    __publicField(this, "editor", null);
    __publicField(this, "md", null);
    let {
      html,
      linkify: linkify2,
      breaks
    } = _ref;
    this.editor = editor;
    this.md = this.withPatchedRenderer(MarkdownIt({
      html,
      linkify: linkify2,
      breaks
    }));
  }
  parse(content2) {
    let {
      inline: inline3
    } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (typeof content2 === "string") {
      this.editor.extensionManager.extensions.forEach((extension) => {
        var _getMarkdownSpec;
        return (_getMarkdownSpec = getMarkdownSpec(extension)) === null || _getMarkdownSpec === void 0 || (_getMarkdownSpec = _getMarkdownSpec.parse) === null || _getMarkdownSpec === void 0 || (_getMarkdownSpec = _getMarkdownSpec.setup) === null || _getMarkdownSpec === void 0 ? void 0 : _getMarkdownSpec.call({
          editor: this.editor,
          options: extension.options
        }, this.md);
      });
      const renderedHTML = this.md.render(content2);
      const element = elementFromString(renderedHTML);
      this.editor.extensionManager.extensions.forEach((extension) => {
        var _getMarkdownSpec2;
        return (_getMarkdownSpec2 = getMarkdownSpec(extension)) === null || _getMarkdownSpec2 === void 0 || (_getMarkdownSpec2 = _getMarkdownSpec2.parse) === null || _getMarkdownSpec2 === void 0 || (_getMarkdownSpec2 = _getMarkdownSpec2.updateDOM) === null || _getMarkdownSpec2 === void 0 ? void 0 : _getMarkdownSpec2.call({
          editor: this.editor,
          options: extension.options
        }, element);
      });
      this.normalizeDOM(element, {
        inline: inline3,
        content: content2
      });
      return element.innerHTML;
    }
    return content2;
  }
  normalizeDOM(node3, _ref2) {
    let {
      inline: inline3,
      content: content2
    } = _ref2;
    this.normalizeBlocks(node3);
    node3.querySelectorAll("*").forEach((el) => {
      var _el$nextSibling;
      if (((_el$nextSibling = el.nextSibling) === null || _el$nextSibling === void 0 ? void 0 : _el$nextSibling.nodeType) === Node.TEXT_NODE && !el.closest("pre")) {
        el.nextSibling.textContent = el.nextSibling.textContent.replace(/^\n/, "");
      }
    });
    if (inline3) {
      this.normalizeInline(node3, content2);
    }
    return node3;
  }
  normalizeBlocks(node3) {
    const blocks = Object.values(this.editor.schema.nodes).filter((node22) => node22.isBlock);
    const selector = blocks.map((block3) => {
      var _block$spec$parseDOM;
      return (_block$spec$parseDOM = block3.spec.parseDOM) === null || _block$spec$parseDOM === void 0 ? void 0 : _block$spec$parseDOM.map((spec) => spec.tag);
    }).flat().filter(Boolean).join(",");
    if (!selector) {
      return;
    }
    [...node3.querySelectorAll(selector)].forEach((el) => {
      if (el.parentElement.matches("p")) {
        extractElement(el);
      }
    });
  }
  normalizeInline(node3, content2) {
    var _node$firstElementChi;
    if ((_node$firstElementChi = node3.firstElementChild) !== null && _node$firstElementChi !== void 0 && _node$firstElementChi.matches("p")) {
      var _content$match$, _content$match, _content$match$2, _content$match2;
      const firstParagraph = node3.firstElementChild;
      const {
        nextElementSibling
      } = firstParagraph;
      const startSpaces = (_content$match$ = (_content$match = content2.match(/^\s+/)) === null || _content$match === void 0 ? void 0 : _content$match[0]) !== null && _content$match$ !== void 0 ? _content$match$ : "";
      const endSpaces = !nextElementSibling ? (_content$match$2 = (_content$match2 = content2.match(/\s+$/)) === null || _content$match2 === void 0 ? void 0 : _content$match2[0]) !== null && _content$match$2 !== void 0 ? _content$match$2 : "" : "";
      if (content2.match(/^\n\n/)) {
        firstParagraph.innerHTML = `${firstParagraph.innerHTML}${endSpaces}`;
        return;
      }
      unwrapElement(firstParagraph);
      node3.innerHTML = `${startSpaces}${node3.innerHTML}${endSpaces}`;
    }
  }
  /**
   * @param {markdownit} md
   */
  withPatchedRenderer(md2) {
    const withoutNewLine = /* @__PURE__ */ __name((renderer2) => function() {
      const rendered = renderer2(...arguments);
      if (rendered === "\n") {
        return rendered;
      }
      if (rendered[rendered.length - 1] === "\n") {
        return rendered.slice(0, -1);
      }
      return rendered;
    }, "withoutNewLine");
    md2.renderer.rules.hardbreak = withoutNewLine(md2.renderer.rules.hardbreak);
    md2.renderer.rules.softbreak = withoutNewLine(md2.renderer.rules.softbreak);
    md2.renderer.rules.fence = withoutNewLine(md2.renderer.rules.fence);
    md2.renderer.rules.code_block = withoutNewLine(md2.renderer.rules.code_block);
    md2.renderer.renderToken = withoutNewLine(md2.renderer.renderToken.bind(md2.renderer));
    return md2;
  }
}
const MarkdownClipboard = Extension.create({
  name: "markdownClipboard",
  addOptions() {
    return {
      transformPastedText: false,
      transformCopiedText: false
    };
  },
  addProseMirrorPlugins() {
    return [new Plugin({
      key: new PluginKey("markdownClipboard"),
      props: {
        clipboardTextParser: /* @__PURE__ */ __name((text2, context, plainText) => {
          if (plainText || !this.options.transformPastedText) {
            return null;
          }
          const parsed = this.editor.storage.markdown.parser.parse(text2, {
            inline: true
          });
          return DOMParser.fromSchema(this.editor.schema).parseSlice(elementFromString(parsed), {
            preserveWhitespace: true,
            context
          });
        }, "clipboardTextParser"),
        /**
         * @param {import('prosemirror-model').Slice} slice
         */
        clipboardTextSerializer: /* @__PURE__ */ __name((slice2) => {
          if (!this.options.transformCopiedText) {
            return null;
          }
          return this.editor.storage.markdown.serializer.serialize(slice2.content);
        }, "clipboardTextSerializer")
      }
    })];
  }
});
const Markdown = Extension.create({
  name: "markdown",
  priority: 50,
  addOptions() {
    return {
      html: true,
      tightLists: true,
      tightListClass: "tight",
      bulletListMarker: "-",
      linkify: false,
      breaks: false,
      transformPastedText: false,
      transformCopiedText: false
    };
  },
  addCommands() {
    const commands2 = index$1.Commands.config.addCommands();
    return {
      setContent: /* @__PURE__ */ __name((content2, emitUpdate, parseOptions) => (props) => {
        return commands2.setContent(props.editor.storage.markdown.parser.parse(content2), emitUpdate, parseOptions)(props);
      }, "setContent"),
      insertContentAt: /* @__PURE__ */ __name((range2, content2, options4) => (props) => {
        return commands2.insertContentAt(range2, props.editor.storage.markdown.parser.parse(content2, {
          inline: true
        }), options4)(props);
      }, "insertContentAt")
    };
  },
  onBeforeCreate() {
    this.editor.storage.markdown = {
      options: {
        ...this.options
      },
      parser: new MarkdownParser(this.editor, this.options),
      serializer: new MarkdownSerializer(this.editor),
      getMarkdown: /* @__PURE__ */ __name(() => {
        return this.editor.storage.markdown.serializer.serialize(this.editor.state.doc);
      }, "getMarkdown")
    };
    this.editor.options.initialContent = this.editor.options.content;
    this.editor.options.content = this.editor.storage.markdown.parser.parse(this.editor.options.content);
  },
  onCreate() {
    this.editor.options.content = this.editor.options.initialContent;
    delete this.editor.options.initialContent;
  },
  addStorage() {
    return {
      /// storage will be defined in onBeforeCreate() to prevent initial object overriding
    };
  },
  addExtensions() {
    return [MarkdownTightLists.configure({
      tight: this.options.tightLists,
      tightClass: this.options.tightListClass
    }), MarkdownClipboard.configure({
      transformPastedText: this.options.transformPastedText,
      transformCopiedText: this.options.transformCopiedText
    })];
  }
});
const SIZE = Symbol();
function intersect(a, b) {
  const x2 = Math.max(a.x, b.x);
  const num1 = Math.min(a.x + a.width, b.x + b.width);
  const y2 = Math.max(a.y, b.y);
  const num2 = Math.min(a.y + a.height, b.y + b.height);
  if (num1 >= x2 && num2 >= y2) return [x2, y2, num1 - x2, num2 - y2];
  else return null;
}
__name(intersect, "intersect");
function getClipPath(node3, element, canvasRect) {
  const selectedNode = Object.values(
    app$1.canvas.selected_nodes
  )[0];
  if (selectedNode && selectedNode !== node3) {
    const elRect = element.getBoundingClientRect();
    const MARGIN = 4;
    const { offset, scale } = app$1.canvas.ds;
    const { renderArea } = selectedNode;
    const intersection = intersect(
      {
        x: elRect.left - canvasRect.left,
        y: elRect.top - canvasRect.top,
        width: elRect.width,
        height: elRect.height
      },
      {
        x: (renderArea[0] + offset[0] - MARGIN) * scale,
        y: (renderArea[1] + offset[1] - MARGIN) * scale,
        width: (renderArea[2] + 2 * MARGIN) * scale,
        height: (renderArea[3] + 2 * MARGIN) * scale
      }
    );
    if (!intersection) {
      return "";
    }
    const clipX = (intersection[0] - elRect.left + canvasRect.left) / scale + "px";
    const clipY = (intersection[1] - elRect.top + canvasRect.top) / scale + "px";
    const clipWidth = intersection[2] / scale + "px";
    const clipHeight = intersection[3] / scale + "px";
    const path = `polygon(0% 0%, 0% 100%, ${clipX} 100%, ${clipX} ${clipY}, calc(${clipX} + ${clipWidth}) ${clipY}, calc(${clipX} + ${clipWidth}) calc(${clipY} + ${clipHeight}), ${clipX} calc(${clipY} + ${clipHeight}), ${clipX} 100%, 100% 100%, 100% 0%)`;
    return path;
  }
  return "";
}
__name(getClipPath, "getClipPath");
function computeSize(size2) {
  if (this.widgets?.[0]?.last_y == null) return;
  let y2 = this.widgets[0].last_y;
  let freeSpace = size2[1] - y2;
  let widgetHeight = 0;
  let dom = [];
  for (const w of this.widgets) {
    if (w.type === "converted-widget") {
      delete w.computedHeight;
    } else if (w.computeSize) {
      widgetHeight += w.computeSize()[1] + 4;
    } else if (w.element) {
      const styles = getComputedStyle(w.element);
      let minHeight = w.options.getMinHeight?.() ?? parseInt(styles.getPropertyValue("--comfy-widget-min-height"));
      let maxHeight = w.options.getMaxHeight?.() ?? parseInt(styles.getPropertyValue("--comfy-widget-max-height"));
      let prefHeight = w.options.getHeight?.() ?? styles.getPropertyValue("--comfy-widget-height");
      if (prefHeight.endsWith?.("%")) {
        prefHeight = size2[1] * (parseFloat(prefHeight.substring(0, prefHeight.length - 1)) / 100);
      } else {
        prefHeight = parseInt(prefHeight);
        if (isNaN(minHeight)) {
          minHeight = prefHeight;
        }
      }
      if (isNaN(minHeight)) {
        minHeight = 50;
      }
      if (!isNaN(maxHeight)) {
        if (!isNaN(prefHeight)) {
          prefHeight = Math.min(prefHeight, maxHeight);
        } else {
          prefHeight = maxHeight;
        }
      }
      dom.push({
        minHeight,
        prefHeight,
        w
      });
    } else {
      widgetHeight += LiteGraph.NODE_WIDGET_HEIGHT + 4;
    }
  }
  freeSpace -= widgetHeight;
  const prefGrow = [];
  const canGrow = [];
  let growBy = 0;
  for (const d of dom) {
    freeSpace -= d.minHeight;
    if (isNaN(d.prefHeight)) {
      canGrow.push(d);
      d.w.computedHeight = d.minHeight;
    } else {
      const diff2 = d.prefHeight - d.minHeight;
      if (diff2 > 0) {
        prefGrow.push(d);
        growBy += diff2;
        d.diff = diff2;
      } else {
        d.w.computedHeight = d.minHeight;
      }
    }
  }
  if (this.imgs && !this.widgets.find((w) => w.name === ANIM_PREVIEW_WIDGET)) {
    freeSpace -= 220;
  }
  this.freeWidgetSpace = freeSpace;
  if (freeSpace < 0) {
    size2[1] -= freeSpace;
    this.graph.setDirtyCanvas(true);
  } else {
    const growDiff = freeSpace - growBy;
    if (growDiff > 0) {
      freeSpace = growDiff;
      for (const d of prefGrow) {
        d.w.computedHeight = d.prefHeight;
      }
    } else {
      const shared = -growDiff / prefGrow.length;
      for (const d of prefGrow) {
        d.w.computedHeight = d.prefHeight - shared;
      }
      freeSpace = 0;
    }
    if (freeSpace > 0 && canGrow.length) {
      const shared = freeSpace / canGrow.length;
      for (const d of canGrow) {
        d.w.computedHeight += shared;
      }
    }
  }
  for (const w of this.widgets) {
    w.y = y2;
    if (w.computedHeight) {
      y2 += w.computedHeight;
    } else if (w.computeSize) {
      y2 += w.computeSize()[1] + 4;
    } else {
      y2 += LiteGraph.NODE_WIDGET_HEIGHT + 4;
    }
  }
}
__name(computeSize, "computeSize");
const elementWidgets = /* @__PURE__ */ new Set();
const computeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
LGraphCanvas.prototype.computeVisibleNodes = function() {
  const visibleNodes = computeVisibleNodes.apply(this, arguments);
  for (const node3 of app$1.graph.nodes) {
    if (elementWidgets.has(node3)) {
      const hidden = visibleNodes.indexOf(node3) === -1;
      for (const w of node3.widgets) {
        if (w.element) {
          w.element.dataset.isInVisibleNodes = hidden ? "false" : "true";
          const shouldOtherwiseHide = w.element.dataset.shouldHide === "true";
          const isCollapsed = w.element.dataset.collapsed === "true";
          const wasHidden = w.element.hidden;
          const actualHidden = hidden || shouldOtherwiseHide || isCollapsed;
          w.element.hidden = actualHidden;
          w.element.style.display = actualHidden ? "none" : null;
          if (actualHidden && !wasHidden) {
            w.options.onHide?.(w);
          }
        }
      }
    }
  }
  return visibleNodes;
};
LGraphNode.prototype.addDOMWidget = function(name2, type, element, options4 = {}) {
  options4 = { hideOnZoom: true, selectOn: ["focus", "click"], ...options4 };
  if (!element.parentElement) {
    app$1.canvasContainer.append(element);
  }
  element.hidden = true;
  element.style.display = "none";
  let mouseDownHandler;
  if (element.blur) {
    mouseDownHandler = /* @__PURE__ */ __name((event) => {
      if (!element.contains(event.target)) {
        element.blur();
      }
    }, "mouseDownHandler");
    document.addEventListener("mousedown", mouseDownHandler);
  }
  const { nodeData } = this.constructor;
  const tooltip = (nodeData?.input.required?.[name2] ?? nodeData?.input.optional?.[name2])?.[1]?.tooltip;
  if (tooltip && !element.title) {
    element.title = tooltip;
  }
  const widget2 = {
    // @ts-expect-error All unrecognized types will be treated the same way as 'custom'
    // in litegraph internally.
    type,
    name: name2,
    get value() {
      return options4.getValue?.() ?? void 0;
    },
    set value(v2) {
      options4.setValue?.(v2);
      widget2.callback?.(widget2.value);
    },
    draw: /* @__PURE__ */ __name(function(ctx, node3, widgetWidth, y2, widgetHeight) {
      if (widget2.computedHeight == null) {
        computeSize.call(node3, node3.size);
      }
      const { offset, scale } = app$1.canvas.ds;
      const hidden = !!options4.hideOnZoom && scale < 0.5 || widget2.computedHeight <= 0 || // @ts-expect-error Used by widgetInputs.ts
      widget2.type === "converted-widget" || // @ts-expect-error Used by groupNode.ts
      widget2.type === "hidden";
      element.dataset.shouldHide = hidden ? "true" : "false";
      const isInVisibleNodes = element.dataset.isInVisibleNodes === "true";
      const isCollapsed = element.dataset.collapsed === "true";
      const actualHidden = hidden || !isInVisibleNodes || isCollapsed;
      const wasHidden = element.hidden;
      element.hidden = actualHidden;
      element.style.display = actualHidden ? "none" : null;
      if (actualHidden && !wasHidden) {
        widget2.options.onHide?.(widget2);
      }
      if (actualHidden) {
        return;
      }
      const elRect = ctx.canvas.getBoundingClientRect();
      const margin = 10;
      const top = node3.pos[0] + offset[0] + margin;
      const left = node3.pos[1] + offset[1] + margin + y2;
      Object.assign(element.style, {
        transformOrigin: "0 0",
        transform: `scale(${scale})`,
        left: `${top * scale}px`,
        top: `${left * scale}px`,
        width: `${widgetWidth - margin * 2}px`,
        height: `${(widget2.computedHeight ?? 50) - margin * 2}px`,
        position: "absolute",
        zIndex: app$1.graph.nodes.indexOf(node3),
        pointerEvents: app$1.canvas.read_only ? "none" : "auto"
      });
      if (useSettingStore().get("Comfy.DOMClippingEnabled")) {
        element.style.clipPath = getClipPath(node3, element, elRect);
        element.style.willChange = "clip-path";
      }
      this.options.onDraw?.(widget2);
    }, "draw"),
    element,
    options: options4,
    onRemove() {
      if (mouseDownHandler) {
        document.removeEventListener("mousedown", mouseDownHandler);
      }
      element.remove();
    }
  };
  for (const evt of options4.selectOn) {
    element.addEventListener(evt, () => {
      app$1.canvas.selectNode(this);
      app$1.canvas.bringToFront(this);
    });
  }
  this.addCustomWidget(widget2);
  elementWidgets.add(this);
  const collapse = this.collapse;
  this.collapse = function() {
    collapse.apply(this, arguments);
    if (this.flags?.collapsed) {
      element.hidden = true;
      element.style.display = "none";
    }
    element.dataset.collapsed = this.flags?.collapsed ? "true" : "false";
  };
  const onRemoved = this.onRemoved;
  this.onRemoved = function() {
    element.remove();
    elementWidgets.delete(this);
    onRemoved?.apply(this, arguments);
  };
  if (!this[SIZE]) {
    this[SIZE] = true;
    const onResize2 = this.onResize;
    this.onResize = function(size2) {
      options4.beforeResize?.call(widget2, this);
      computeSize.call(this, size2);
      onResize2?.apply(this, arguments);
      options4.afterResize?.call(widget2, this);
    };
  }
  return widget2;
};
function controlValueRunBefore() {
  return useSettingStore().get("Comfy.WidgetControlMode") === "before";
}
__name(controlValueRunBefore, "controlValueRunBefore");
function updateControlWidgetLabel(widget2) {
  let replacement = "after";
  let find2 = "before";
  if (controlValueRunBefore()) {
    ;
    [find2, replacement] = [replacement, find2];
  }
  widget2.label = (widget2.label ?? widget2.name).replace(find2, replacement);
}
__name(updateControlWidgetLabel, "updateControlWidgetLabel");
const IS_CONTROL_WIDGET = Symbol();
const HAS_EXECUTED = Symbol();
function getNumberDefaults(inputData, defaultStep, precision, enable_rounding) {
  let defaultVal = inputData[1]["default"];
  let { min, max, step: step3, round } = inputData[1];
  if (defaultVal == void 0) defaultVal = 0;
  if (min == void 0) min = 0;
  if (max == void 0) max = 2048;
  if (step3 == void 0) step3 = defaultStep;
  if (precision == void 0) {
    precision = Math.max(-Math.floor(Math.log10(step3)), 0);
  }
  if (enable_rounding && (round == void 0 || round === true)) {
    round = Math.round(1e6 * Math.pow(0.1, precision)) / 1e6;
  }
  return {
    val: defaultVal,
    config: { min, max, step: 10 * step3, round, precision }
  };
}
__name(getNumberDefaults, "getNumberDefaults");
function addValueControlWidget(node3, targetWidget, defaultValue = "randomize", values, widgetName, inputData) {
  let name2 = inputData[1]?.control_after_generate;
  if (typeof name2 !== "string") {
    name2 = widgetName;
  }
  const widgets = addValueControlWidgets(
    node3,
    targetWidget,
    defaultValue,
    {
      addFilterList: false,
      controlAfterGenerateName: name2
    },
    inputData
  );
  return widgets[0];
}
__name(addValueControlWidget, "addValueControlWidget");
function addValueControlWidgets(node3, targetWidget, defaultValue = "randomize", options4, inputData) {
  if (!defaultValue) defaultValue = "randomize";
  if (!options4) options4 = {};
  const getName = /* @__PURE__ */ __name((defaultName, optionName) => {
    let name2 = defaultName;
    if (options4[optionName]) {
      name2 = options4[optionName];
    } else if (typeof inputData?.[1]?.[defaultName] === "string") {
      name2 = inputData?.[1]?.[defaultName];
    } else if (inputData?.[1]?.control_prefix) {
      name2 = inputData?.[1]?.control_prefix + " " + name2;
    }
    return name2;
  }, "getName");
  const widgets = [];
  const valueControl = node3.addWidget(
    "combo",
    getName("control_after_generate", "controlAfterGenerateName"),
    defaultValue,
    function() {
    },
    {
      values: ["fixed", "increment", "decrement", "randomize"],
      serialize: false
      // Don't include this in prompt.
    }
  );
  valueControl.tooltip = "Allows the linked widget to be changed automatically, for example randomizing the noise seed.";
  valueControl[IS_CONTROL_WIDGET] = true;
  updateControlWidgetLabel(valueControl);
  widgets.push(valueControl);
  const isCombo = targetWidget.type === "combo";
  let comboFilter;
  if (isCombo) {
    valueControl.options.values.push("increment-wrap");
  }
  if (isCombo && options4.addFilterList !== false) {
    comboFilter = node3.addWidget(
      "string",
      getName("control_filter_list", "controlFilterListName"),
      "",
      function() {
      },
      {
        serialize: false
        // Don't include this in prompt.
      }
    );
    updateControlWidgetLabel(comboFilter);
    comboFilter.tooltip = "Allows for filtering the list of values when changing the value via the control generate mode. Allows for RegEx matches in the format /abc/ to only filter to values containing 'abc'.";
    widgets.push(comboFilter);
  }
  const applyWidgetControl = /* @__PURE__ */ __name(() => {
    var v2 = valueControl.value;
    if (isCombo && v2 !== "fixed") {
      let values = targetWidget.options.values;
      const filter4 = comboFilter?.value;
      if (filter4) {
        let check;
        if (filter4.startsWith("/") && filter4.endsWith("/")) {
          try {
            const regex2 = new RegExp(filter4.substring(1, filter4.length - 1));
            check = /* @__PURE__ */ __name((item3) => regex2.test(item3), "check");
          } catch (error2) {
            console.error(
              "Error constructing RegExp filter for node " + node3.id,
              filter4,
              error2
            );
          }
        }
        if (!check) {
          const lower = filter4.toLocaleLowerCase();
          check = /* @__PURE__ */ __name((item3) => item3.toLocaleLowerCase().includes(lower), "check");
        }
        values = values.filter((item3) => check(item3));
        if (!values.length && targetWidget.options.values.length) {
          console.warn(
            "Filter for node " + node3.id + " has filtered out all items",
            filter4
          );
        }
      }
      let current_index = values.indexOf(targetWidget.value);
      let current_length = values.length;
      switch (v2) {
        case "increment":
          current_index += 1;
          break;
        case "increment-wrap":
          current_index += 1;
          if (current_index >= current_length) {
            current_index = 0;
          }
          break;
        case "decrement":
          current_index -= 1;
          break;
        case "randomize":
          current_index = Math.floor(Math.random() * current_length);
          break;
        default:
          break;
      }
      current_index = Math.max(0, current_index);
      current_index = Math.min(current_length - 1, current_index);
      if (current_index >= 0) {
        let value4 = values[current_index];
        targetWidget.value = value4;
        targetWidget.callback(value4);
      }
    } else {
      let min = targetWidget.options.min;
      let max = targetWidget.options.max;
      max = Math.min(1125899906842624, max);
      min = Math.max(-1125899906842624, min);
      let range2 = (max - min) / (targetWidget.options.step / 10);
      switch (v2) {
        case "fixed":
          break;
        case "increment":
          targetWidget.value += targetWidget.options.step / 10;
          break;
        case "decrement":
          targetWidget.value -= targetWidget.options.step / 10;
          break;
        case "randomize":
          targetWidget.value = Math.floor(Math.random() * range2) * (targetWidget.options.step / 10) + min;
          break;
        default:
          break;
      }
      if (targetWidget.value < min) targetWidget.value = min;
      if (targetWidget.value > max) targetWidget.value = max;
      targetWidget.callback(targetWidget.value);
    }
  }, "applyWidgetControl");
  valueControl.beforeQueued = () => {
    if (controlValueRunBefore()) {
      if (valueControl[HAS_EXECUTED]) {
        applyWidgetControl();
      }
    }
    valueControl[HAS_EXECUTED] = true;
  };
  valueControl.afterQueued = () => {
    if (!controlValueRunBefore()) {
      applyWidgetControl();
    }
  };
  return widgets;
}
__name(addValueControlWidgets, "addValueControlWidgets");
function seedWidget(node3, inputName, inputData, app2, widgetName) {
  const seed = createIntWidget(node3, inputName, inputData, app2, true);
  const seedControl = addValueControlWidget(
    node3,
    seed.widget,
    "randomize",
    void 0,
    widgetName,
    inputData
  );
  seed.widget.linkedWidgets = [seedControl];
  return seed;
}
__name(seedWidget, "seedWidget");
function createIntWidget(node3, inputName, inputData, app2, isSeedInput = false) {
  const control = inputData[1]?.control_after_generate;
  if (!isSeedInput && control) {
    return seedWidget(
      node3,
      inputName,
      inputData,
      app2,
      typeof control === "string" ? control : void 0
    );
  }
  let widgetType = isSlider(inputData[1]["display"], app2);
  const { val, config: config2 } = getNumberDefaults(inputData, 1, 0, true);
  Object.assign(config2, { precision: 0 });
  return {
    widget: node3.addWidget(
      widgetType,
      inputName,
      val,
      function(v2) {
        const s = this.options.step / 10;
        let sh = this.options.min % s;
        if (isNaN(sh)) {
          sh = 0;
        }
        this.value = Math.round((v2 - sh) / s) * s + sh;
      },
      config2
    )
  };
}
__name(createIntWidget, "createIntWidget");
function addMultilineWidget(node3, name2, opts, app2) {
  const inputEl = document.createElement("textarea");
  inputEl.className = "comfy-multiline-input";
  inputEl.value = opts.defaultVal;
  inputEl.placeholder = opts.placeholder || name2;
  if (app2.vueAppReady) {
    inputEl.spellcheck = useSettingStore().get(
      "Comfy.TextareaWidget.Spellcheck"
    );
  }
  const widget2 = node3.addDOMWidget(name2, "customtext", inputEl, {
    getValue() {
      return inputEl.value;
    },
    setValue(v2) {
      inputEl.value = v2;
    }
  });
  widget2.inputEl = inputEl;
  inputEl.addEventListener("input", () => {
    widget2.callback?.(widget2.value);
  });
  inputEl.addEventListener("pointerdown", (event) => {
    if (event.button === 1) {
      app2.canvas.processMouseDown(event);
    }
  });
  inputEl.addEventListener("pointermove", (event) => {
    if ((event.buttons & 4) === 4) {
      app2.canvas.processMouseMove(event);
    }
  });
  inputEl.addEventListener("pointerup", (event) => {
    if (event.button === 1) {
      app2.canvas.processMouseUp(event);
    }
  });
  return { minWidth: 400, minHeight: 200, widget: widget2 };
}
__name(addMultilineWidget, "addMultilineWidget");
function addMarkdownWidget(node3, name2, opts, app2) {
  Markdown.configure({
    html: false,
    breaks: true,
    transformPastedText: true
  });
  const editor = new Editor({
    extensions: [
      StarterKit,
      Markdown,
      Link$2,
      Table$2,
      TableCell,
      TableHeader,
      TableRow
    ],
    content: opts.defaultVal,
    editable: false
  });
  const inputEl = editor.options.element;
  inputEl.classList.add("comfy-markdown");
  const textarea = document.createElement("textarea");
  inputEl.append(textarea);
  const widget2 = node3.addDOMWidget(name2, "MARKDOWN", inputEl, {
    getValue() {
      return textarea.value;
    },
    setValue(v2) {
      textarea.value = v2;
      editor.commands.setContent(v2);
    }
  });
  widget2.inputEl = inputEl;
  editor.options.element.addEventListener(
    "pointerdown",
    (event) => {
      if (event.button !== 0) {
        app2.canvas.processMouseDown(event);
        return;
      }
      if (event.target instanceof HTMLAnchorElement) {
        return;
      }
      inputEl.classList.add("editing");
      setTimeout(() => {
        textarea.focus();
      }, 0);
    }
  );
  textarea.addEventListener("blur", () => {
    inputEl.classList.remove("editing");
  });
  textarea.addEventListener("change", () => {
    editor.commands.setContent(textarea.value);
    widget2.callback?.(widget2.value);
  });
  inputEl.addEventListener("keydown", (event) => {
    event.stopPropagation();
  });
  inputEl.addEventListener("pointerdown", (event) => {
    if (event.button === 1) {
      app2.canvas.processMouseDown(event);
    }
  });
  inputEl.addEventListener("pointermove", (event) => {
    if ((event.buttons & 4) === 4) {
      app2.canvas.processMouseMove(event);
    }
  });
  inputEl.addEventListener("pointerup", (event) => {
    if (event.button === 1) {
      app2.canvas.processMouseUp(event);
    }
  });
  return { minWidth: 400, minHeight: 200, widget: widget2 };
}
__name(addMarkdownWidget, "addMarkdownWidget");
function isSlider(display, app2) {
  if (app2.ui.settings.getSettingValue("Comfy.DisableSliders")) {
    return "number";
  }
  return display === "slider" ? "slider" : "number";
}
__name(isSlider, "isSlider");
const ComfyWidgets = {
  "INT:seed": seedWidget,
  "INT:noise_seed": seedWidget,
  FLOAT(node3, inputName, inputData, app2) {
    let widgetType = isSlider(inputData[1]["display"], app2);
    let precision = app2.ui.settings.getSettingValue(
      "Comfy.FloatRoundingPrecision"
    );
    let disable_rounding = app2.ui.settings.getSettingValue(
      "Comfy.DisableFloatRounding"
    );
    if (precision == 0) precision = void 0;
    const { val, config: config2 } = getNumberDefaults(
      inputData,
      0.5,
      precision,
      !disable_rounding
    );
    return {
      widget: node3.addWidget(
        widgetType,
        inputName,
        val,
        function(v2) {
          if (config2.round) {
            this.value = Math.round((v2 + Number.EPSILON) / config2.round) * config2.round;
            if (this.value > config2.max) this.value = config2.max;
            if (this.value < config2.min) this.value = config2.min;
          } else {
            this.value = v2;
          }
        },
        config2
      )
    };
  },
  INT(node3, inputName, inputData, app2) {
    return createIntWidget(node3, inputName, inputData, app2);
  },
  BOOLEAN(node3, inputName, inputData) {
    let defaultVal = false;
    let options4 = {};
    if (inputData[1]) {
      if (inputData[1].default) defaultVal = inputData[1].default;
      if (inputData[1].label_on) options4["on"] = inputData[1].label_on;
      if (inputData[1].label_off) options4["off"] = inputData[1].label_off;
    }
    return {
      widget: node3.addWidget("toggle", inputName, defaultVal, () => {
      }, options4)
    };
  },
  STRING(node3, inputName, inputData, app2) {
    const defaultVal = inputData[1].default || "";
    const multiline = !!inputData[1].multiline;
    let res;
    if (multiline) {
      res = addMultilineWidget(
        node3,
        inputName,
        { defaultVal, ...inputData[1] },
        app2
      );
    } else {
      res = {
        widget: node3.addWidget("text", inputName, defaultVal, () => {
        }, {})
      };
    }
    if (inputData[1].dynamicPrompts != void 0)
      res.widget.dynamicPrompts = inputData[1].dynamicPrompts;
    return res;
  },
  MARKDOWN(node3, inputName, inputData, app2) {
    const defaultVal = inputData[1].default || "";
    let res;
    res = addMarkdownWidget(
      node3,
      inputName,
      { defaultVal, ...inputData[1] },
      app2
    );
    return res;
  },
  COMBO(node3, inputName, inputData) {
    const type = inputData[0];
    let defaultValue = type[0];
    if (inputData[1] && inputData[1].default) {
      defaultValue = inputData[1].default;
    }
    const res = {
      widget: node3.addWidget("combo", inputName, defaultValue, () => {
      }, {
        values: type
      })
    };
    if (inputData[1]?.control_after_generate) {
      res.widget.linkedWidgets = addValueControlWidgets(
        node3,
        res.widget,
        void 0,
        void 0,
        inputData
      );
    }
    return res;
  },
  IMAGEUPLOAD(node3, inputName, inputData, app2) {
    const imageWidget = node3.widgets.find(
      (w) => w.name === (inputData[1]?.widget ?? "image")
    );
    let uploadWidget;
    function showImage(name2) {
      const img = new Image();
      img.onload = () => {
        node3.imgs = [img];
        app2.graph.setDirtyCanvas(true);
      };
      let folder_separator = name2.lastIndexOf("/");
      let subfolder = "";
      if (folder_separator > -1) {
        subfolder = name2.substring(0, folder_separator);
        name2 = name2.substring(folder_separator + 1);
      }
      img.src = api.apiURL(
        `/view?filename=${encodeURIComponent(name2)}&type=input&subfolder=${subfolder}${app2.getPreviewFormatParam()}${app2.getRandParam()}`
      );
      node3.setSizeForImage?.();
    }
    __name(showImage, "showImage");
    var default_value = imageWidget.value;
    Object.defineProperty(imageWidget, "value", {
      set: /* @__PURE__ */ __name(function(value4) {
        this._real_value = value4;
      }, "set"),
      get: /* @__PURE__ */ __name(function() {
        if (!this._real_value) {
          return default_value;
        }
        let value4 = this._real_value;
        if (value4.filename) {
          let real_value = value4;
          value4 = "";
          if (real_value.subfolder) {
            value4 = real_value.subfolder + "/";
          }
          value4 += real_value.filename;
          if (real_value.type && real_value.type !== "input")
            value4 += ` [${real_value.type}]`;
        }
        return value4;
      }, "get")
    });
    const cb = node3.callback;
    imageWidget.callback = function() {
      showImage(imageWidget.value);
      if (cb) {
        return cb.apply(this, arguments);
      }
    };
    requestAnimationFrame(() => {
      if (imageWidget.value) {
        showImage(imageWidget.value);
      }
    });
    async function uploadFile2(file, updateNode, pasted = false) {
      try {
        const body = new FormData();
        body.append("image", file);
        if (pasted) body.append("subfolder", "pasted");
        const resp = await api.fetchApi("/upload/image", {
          method: "POST",
          body
        });
        if (resp.status === 200) {
          const data24 = await resp.json();
          let path = data24.name;
          if (data24.subfolder) path = data24.subfolder + "/" + path;
          if (!imageWidget.options.values.includes(path)) {
            imageWidget.options.values.push(path);
          }
          if (updateNode) {
            showImage(path);
            imageWidget.value = path;
          }
        } else {
          useToastStore().addAlert(resp.status + " - " + resp.statusText);
        }
      } catch (error2) {
        useToastStore().addAlert(error2);
      }
    }
    __name(uploadFile2, "uploadFile");
    const fileInput2 = document.createElement("input");
    Object.assign(fileInput2, {
      type: "file",
      accept: "image/jpeg,image/png,image/webp",
      style: "display: none",
      onchange: /* @__PURE__ */ __name(async () => {
        if (fileInput2.files.length) {
          await uploadFile2(fileInput2.files[0], true);
        }
      }, "onchange")
    });
    document.body.append(fileInput2);
    uploadWidget = node3.addWidget("button", inputName, "image", () => {
      fileInput2.click();
    });
    uploadWidget.label = "choose file to upload";
    uploadWidget.serialize = false;
    node3.onDragOver = function(e2) {
      if (e2.dataTransfer && e2.dataTransfer.items) {
        const image2 = [...e2.dataTransfer.items].find((f) => f.kind === "file");
        return !!image2;
      }
      return false;
    };
    node3.onDragDrop = function(e2) {
      console.log("onDragDrop called");
      let handled = false;
      for (const file of e2.dataTransfer.files) {
        if (file.type.startsWith("image/")) {
          uploadFile2(file, !handled);
          handled = true;
        }
      }
      return handled;
    };
    node3.pasteFile = function(file) {
      if (file.type.startsWith("image/")) {
        const is_pasted = file.name === "image.png" && file.lastModified - Date.now() < 2e3;
        uploadFile2(file, true, is_pasted);
        return true;
      }
      return false;
    };
    return { widget: uploadWidget };
  }
};
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.widgets = window.comfyAPI.widgets || {};
window.comfyAPI.widgets.updateControlWidgetLabel = updateControlWidgetLabel;
window.comfyAPI.widgets.IS_CONTROL_WIDGET = IS_CONTROL_WIDGET;
window.comfyAPI.widgets.addValueControlWidget = addValueControlWidget;
window.comfyAPI.widgets.addValueControlWidgets = addValueControlWidgets;
window.comfyAPI.widgets.ComfyWidgets = ComfyWidgets;
const useWidgetStore = /* @__PURE__ */ defineStore("widget", () => {
  const coreWidgets = ComfyWidgets;
  const customWidgets = ref({});
  const widgets = computed(() => ({
    ...customWidgets.value,
    ...coreWidgets
  }));
  function getWidgetType(type, inputName) {
    if (type === "COMBO") {
      return "COMBO";
    } else if (`${type}:${inputName}` in widgets.value) {
      return `${type}:${inputName}`;
    } else if (type in widgets.value) {
      return type;
    } else {
      return null;
    }
  }
  __name(getWidgetType, "getWidgetType");
  function inputIsWidget(spec) {
    return getWidgetType(spec.type, spec.name) !== null;
  }
  __name(inputIsWidget, "inputIsWidget");
  function registerCustomWidgets(newWidgets) {
    customWidgets.value = {
      ...customWidgets.value,
      ...newWidgets
    };
  }
  __name(registerCustomWidgets, "registerCustomWidgets");
  return {
    widgets,
    getWidgetType,
    inputIsWidget,
    registerCustomWidgets
  };
});
var addonFit$2 = { exports: {} };
var addonFit = addonFit$2.exports;
(function(module, exports) {
  !function(e2, t2) {
    true ? module.exports = t2() : false ? (void 0)([], t2) : true ? exports.FitAddon = t2() : e2.FitAddon = t2();
  }(self, () => (() => {
    "use strict";
    var e2 = {};
    return (() => {
      var t2 = e2;
      Object.defineProperty(t2, "__esModule", { value: true }), t2.FitAddon = void 0, t2.FitAddon = class {
        activate(e3) {
          this._terminal = e3;
        }
        dispose() {
        }
        fit() {
          const e3 = this.proposeDimensions();
          if (!e3 || !this._terminal || isNaN(e3.cols) || isNaN(e3.rows)) return;
          const t3 = this._terminal._core;
          this._terminal.rows === e3.rows && this._terminal.cols === e3.cols || (t3._renderService.clear(), this._terminal.resize(e3.cols, e3.rows));
        }
        proposeDimensions() {
          if (!this._terminal) return;
          if (!this._terminal.element || !this._terminal.element.parentElement) return;
          const e3 = this._terminal._core, t3 = e3._renderService.dimensions;
          if (0 === t3.css.cell.width || 0 === t3.css.cell.height) return;
          const r = 0 === this._terminal.options.scrollback ? 0 : e3.viewport.scrollBarWidth, i2 = window.getComputedStyle(this._terminal.element.parentElement), o = parseInt(i2.getPropertyValue("height")), s = Math.max(0, parseInt(i2.getPropertyValue("width"))), n = window.getComputedStyle(this._terminal.element), l = o - (parseInt(n.getPropertyValue("padding-top")) + parseInt(n.getPropertyValue("padding-bottom"))), a = s - (parseInt(n.getPropertyValue("padding-right")) + parseInt(n.getPropertyValue("padding-left"))) - r;
          return { cols: Math.max(2, Math.floor(a / t3.css.cell.width)), rows: Math.max(1, Math.floor(l / t3.css.cell.height)) };
        }
      };
    })(), e2;
  })());
})(addonFit$2, addonFit$2.exports);
var addonFitExports = addonFit$2.exports;
const addonFit$1 = /* @__PURE__ */ getDefaultExportFromCjs(addonFitExports);
var xterm$2 = { exports: {} };
var xterm = xterm$2.exports;
(function(module, exports) {
  !function(e2, t2) {
    if (true) module.exports = t2();
    else if (false) (void 0)([], t2);
    else {
      var i2 = t2();
      for (var s in i2) (true ? exports : e2)[s] = i2[s];
    }
  }(globalThis, () => (() => {
    "use strict";
    var e2 = { 4567: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.AccessibilityManager = void 0;
      const n = i3(9042), o = i3(9924), a = i3(844), h2 = i3(4725), c = i3(2585), l = i3(3656);
      let d = t3.AccessibilityManager = class extends a.Disposable {
        constructor(e4, t4, i4, s3) {
          super(), this._terminal = e4, this._coreBrowserService = i4, this._renderService = s3, this._rowColumns = /* @__PURE__ */ new WeakMap(), this._liveRegionLineCount = 0, this._charsToConsume = [], this._charsToAnnounce = "", this._accessibilityContainer = this._coreBrowserService.mainDocument.createElement("div"), this._accessibilityContainer.classList.add("xterm-accessibility"), this._rowContainer = this._coreBrowserService.mainDocument.createElement("div"), this._rowContainer.setAttribute("role", "list"), this._rowContainer.classList.add("xterm-accessibility-tree"), this._rowElements = [];
          for (let e5 = 0; e5 < this._terminal.rows; e5++) this._rowElements[e5] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[e5]);
          if (this._topBoundaryFocusListener = (e5) => this._handleBoundaryFocus(e5, 0), this._bottomBoundaryFocusListener = (e5) => this._handleBoundaryFocus(e5, 1), this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions(), this._accessibilityContainer.appendChild(this._rowContainer), this._liveRegion = this._coreBrowserService.mainDocument.createElement("div"), this._liveRegion.classList.add("live-region"), this._liveRegion.setAttribute("aria-live", "assertive"), this._accessibilityContainer.appendChild(this._liveRegion), this._liveRegionDebouncer = this.register(new o.TimeBasedDebouncer(this._renderRows.bind(this))), !this._terminal.element) throw new Error("Cannot enable accessibility before Terminal.open");
          this._terminal.element.insertAdjacentElement("afterbegin", this._accessibilityContainer), this.register(this._terminal.onResize((e5) => this._handleResize(e5.rows))), this.register(this._terminal.onRender((e5) => this._refreshRows(e5.start, e5.end))), this.register(this._terminal.onScroll(() => this._refreshRows())), this.register(this._terminal.onA11yChar((e5) => this._handleChar(e5))), this.register(this._terminal.onLineFeed(() => this._handleChar("\n"))), this.register(this._terminal.onA11yTab((e5) => this._handleTab(e5))), this.register(this._terminal.onKey((e5) => this._handleKey(e5.key))), this.register(this._terminal.onBlur(() => this._clearLiveRegion())), this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions())), this.register((0, l.addDisposableDomListener)(document, "selectionchange", () => this._handleSelectionChange())), this.register(this._coreBrowserService.onDprChange(() => this._refreshRowsDimensions())), this._refreshRows(), this.register((0, a.toDisposable)(() => {
            this._accessibilityContainer.remove(), this._rowElements.length = 0;
          }));
        }
        _handleTab(e4) {
          for (let t4 = 0; t4 < e4; t4++) this._handleChar(" ");
        }
        _handleChar(e4) {
          this._liveRegionLineCount < 21 && (this._charsToConsume.length > 0 ? this._charsToConsume.shift() !== e4 && (this._charsToAnnounce += e4) : this._charsToAnnounce += e4, "\n" === e4 && (this._liveRegionLineCount++, 21 === this._liveRegionLineCount && (this._liveRegion.textContent += n.tooMuchOutput)));
        }
        _clearLiveRegion() {
          this._liveRegion.textContent = "", this._liveRegionLineCount = 0;
        }
        _handleKey(e4) {
          this._clearLiveRegion(), /\p{Control}/u.test(e4) || this._charsToConsume.push(e4);
        }
        _refreshRows(e4, t4) {
          this._liveRegionDebouncer.refresh(e4, t4, this._terminal.rows);
        }
        _renderRows(e4, t4) {
          const i4 = this._terminal.buffer, s3 = i4.lines.length.toString();
          for (let r2 = e4; r2 <= t4; r2++) {
            const e5 = i4.lines.get(i4.ydisp + r2), t5 = [], n2 = e5?.translateToString(true, void 0, void 0, t5) || "", o2 = (i4.ydisp + r2 + 1).toString(), a2 = this._rowElements[r2];
            a2 && (0 === n2.length ? (a2.innerText = " ", this._rowColumns.set(a2, [0, 1])) : (a2.textContent = n2, this._rowColumns.set(a2, t5)), a2.setAttribute("aria-posinset", o2), a2.setAttribute("aria-setsize", s3));
          }
          this._announceCharacters();
        }
        _announceCharacters() {
          0 !== this._charsToAnnounce.length && (this._liveRegion.textContent += this._charsToAnnounce, this._charsToAnnounce = "");
        }
        _handleBoundaryFocus(e4, t4) {
          const i4 = e4.target, s3 = this._rowElements[0 === t4 ? 1 : this._rowElements.length - 2];
          if (i4.getAttribute("aria-posinset") === (0 === t4 ? "1" : `${this._terminal.buffer.lines.length}`)) return;
          if (e4.relatedTarget !== s3) return;
          let r2, n2;
          if (0 === t4 ? (r2 = i4, n2 = this._rowElements.pop(), this._rowContainer.removeChild(n2)) : (r2 = this._rowElements.shift(), n2 = i4, this._rowContainer.removeChild(r2)), r2.removeEventListener("focus", this._topBoundaryFocusListener), n2.removeEventListener("focus", this._bottomBoundaryFocusListener), 0 === t4) {
            const e5 = this._createAccessibilityTreeNode();
            this._rowElements.unshift(e5), this._rowContainer.insertAdjacentElement("afterbegin", e5);
          } else {
            const e5 = this._createAccessibilityTreeNode();
            this._rowElements.push(e5), this._rowContainer.appendChild(e5);
          }
          this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._terminal.scrollLines(0 === t4 ? -1 : 1), this._rowElements[0 === t4 ? 1 : this._rowElements.length - 2].focus(), e4.preventDefault(), e4.stopImmediatePropagation();
        }
        _handleSelectionChange() {
          if (0 === this._rowElements.length) return;
          const e4 = document.getSelection();
          if (!e4) return;
          if (e4.isCollapsed) return void (this._rowContainer.contains(e4.anchorNode) && this._terminal.clearSelection());
          if (!e4.anchorNode || !e4.focusNode) return void console.error("anchorNode and/or focusNode are null");
          let t4 = { node: e4.anchorNode, offset: e4.anchorOffset }, i4 = { node: e4.focusNode, offset: e4.focusOffset };
          if ((t4.node.compareDocumentPosition(i4.node) & Node.DOCUMENT_POSITION_PRECEDING || t4.node === i4.node && t4.offset > i4.offset) && ([t4, i4] = [i4, t4]), t4.node.compareDocumentPosition(this._rowElements[0]) & (Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING) && (t4 = { node: this._rowElements[0].childNodes[0], offset: 0 }), !this._rowContainer.contains(t4.node)) return;
          const s3 = this._rowElements.slice(-1)[0];
          if (i4.node.compareDocumentPosition(s3) & (Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_PRECEDING) && (i4 = { node: s3, offset: s3.textContent?.length ?? 0 }), !this._rowContainer.contains(i4.node)) return;
          const r2 = /* @__PURE__ */ __name(({ node: e5, offset: t5 }) => {
            const i5 = e5 instanceof Text ? e5.parentNode : e5;
            let s4 = parseInt(i5?.getAttribute("aria-posinset"), 10) - 1;
            if (isNaN(s4)) return console.warn("row is invalid. Race condition?"), null;
            const r3 = this._rowColumns.get(i5);
            if (!r3) return console.warn("columns is null. Race condition?"), null;
            let n3 = t5 < r3.length ? r3[t5] : r3.slice(-1)[0] + 1;
            return n3 >= this._terminal.cols && (++s4, n3 = 0), { row: s4, column: n3 };
          }, "r"), n2 = r2(t4), o2 = r2(i4);
          if (n2 && o2) {
            if (n2.row > o2.row || n2.row === o2.row && n2.column >= o2.column) throw new Error("invalid range");
            this._terminal.select(n2.column, n2.row, (o2.row - n2.row) * this._terminal.cols - n2.column + o2.column);
          }
        }
        _handleResize(e4) {
          this._rowElements[this._rowElements.length - 1].removeEventListener("focus", this._bottomBoundaryFocusListener);
          for (let e5 = this._rowContainer.children.length; e5 < this._terminal.rows; e5++) this._rowElements[e5] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[e5]);
          for (; this._rowElements.length > e4; ) this._rowContainer.removeChild(this._rowElements.pop());
          this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions();
        }
        _createAccessibilityTreeNode() {
          const e4 = this._coreBrowserService.mainDocument.createElement("div");
          return e4.setAttribute("role", "listitem"), e4.tabIndex = -1, this._refreshRowDimensions(e4), e4;
        }
        _refreshRowsDimensions() {
          if (this._renderService.dimensions.css.cell.height) {
            this._accessibilityContainer.style.width = `${this._renderService.dimensions.css.canvas.width}px`, this._rowElements.length !== this._terminal.rows && this._handleResize(this._terminal.rows);
            for (let e4 = 0; e4 < this._terminal.rows; e4++) this._refreshRowDimensions(this._rowElements[e4]);
          }
        }
        _refreshRowDimensions(e4) {
          e4.style.height = `${this._renderService.dimensions.css.cell.height}px`;
        }
      };
      t3.AccessibilityManager = d = s2([r(1, c.IInstantiationService), r(2, h2.ICoreBrowserService), r(3, h2.IRenderService)], d);
    }, 3614: (e3, t3) => {
      function i3(e4) {
        return e4.replace(/\r?\n/g, "\r");
      }
      __name(i3, "i");
      function s2(e4, t4) {
        return t4 ? "\x1B[200~" + e4 + "\x1B[201~" : e4;
      }
      __name(s2, "s");
      function r(e4, t4, r2, n2) {
        e4 = s2(e4 = i3(e4), r2.decPrivateModes.bracketedPasteMode && true !== n2.rawOptions.ignoreBracketedPasteMode), r2.triggerDataEvent(e4, true), t4.value = "";
      }
      __name(r, "r");
      function n(e4, t4, i4) {
        const s3 = i4.getBoundingClientRect(), r2 = e4.clientX - s3.left - 10, n2 = e4.clientY - s3.top - 10;
        t4.style.width = "20px", t4.style.height = "20px", t4.style.left = `${r2}px`, t4.style.top = `${n2}px`, t4.style.zIndex = "1000", t4.focus();
      }
      __name(n, "n");
      Object.defineProperty(t3, "__esModule", { value: true }), t3.rightClickHandler = t3.moveTextAreaUnderMouseCursor = t3.paste = t3.handlePasteEvent = t3.copyHandler = t3.bracketTextForPaste = t3.prepareTextForTerminal = void 0, t3.prepareTextForTerminal = i3, t3.bracketTextForPaste = s2, t3.copyHandler = function(e4, t4) {
        e4.clipboardData && e4.clipboardData.setData("text/plain", t4.selectionText), e4.preventDefault();
      }, t3.handlePasteEvent = function(e4, t4, i4, s3) {
        e4.stopPropagation(), e4.clipboardData && r(e4.clipboardData.getData("text/plain"), t4, i4, s3);
      }, t3.paste = r, t3.moveTextAreaUnderMouseCursor = n, t3.rightClickHandler = function(e4, t4, i4, s3, r2) {
        n(e4, t4, i4), r2 && s3.rightClickSelect(e4), t4.value = s3.selectionText, t4.select();
      };
    }, 7239: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.ColorContrastCache = void 0;
      const s2 = i3(1505);
      t3.ColorContrastCache = class {
        constructor() {
          this._color = new s2.TwoKeyMap(), this._css = new s2.TwoKeyMap();
        }
        setCss(e4, t4, i4) {
          this._css.set(e4, t4, i4);
        }
        getCss(e4, t4) {
          return this._css.get(e4, t4);
        }
        setColor(e4, t4, i4) {
          this._color.set(e4, t4, i4);
        }
        getColor(e4, t4) {
          return this._color.get(e4, t4);
        }
        clear() {
          this._color.clear(), this._css.clear();
        }
      };
    }, 3656: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.addDisposableDomListener = void 0, t3.addDisposableDomListener = function(e4, t4, i3, s2) {
        e4.addEventListener(t4, i3, s2);
        let r = false;
        return { dispose: /* @__PURE__ */ __name(() => {
          r || (r = true, e4.removeEventListener(t4, i3, s2));
        }, "dispose") };
      };
    }, 3551: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.Linkifier = void 0;
      const n = i3(3656), o = i3(8460), a = i3(844), h2 = i3(2585), c = i3(4725);
      let l = t3.Linkifier = class extends a.Disposable {
        get currentLink() {
          return this._currentLink;
        }
        constructor(e4, t4, i4, s3, r2) {
          super(), this._element = e4, this._mouseService = t4, this._renderService = i4, this._bufferService = s3, this._linkProviderService = r2, this._linkCacheDisposables = [], this._isMouseOut = true, this._wasResized = false, this._activeLine = -1, this._onShowLinkUnderline = this.register(new o.EventEmitter()), this.onShowLinkUnderline = this._onShowLinkUnderline.event, this._onHideLinkUnderline = this.register(new o.EventEmitter()), this.onHideLinkUnderline = this._onHideLinkUnderline.event, this.register((0, a.getDisposeArrayDisposable)(this._linkCacheDisposables)), this.register((0, a.toDisposable)(() => {
            this._lastMouseEvent = void 0, this._activeProviderReplies?.clear();
          })), this.register(this._bufferService.onResize(() => {
            this._clearCurrentLink(), this._wasResized = true;
          })), this.register((0, n.addDisposableDomListener)(this._element, "mouseleave", () => {
            this._isMouseOut = true, this._clearCurrentLink();
          })), this.register((0, n.addDisposableDomListener)(this._element, "mousemove", this._handleMouseMove.bind(this))), this.register((0, n.addDisposableDomListener)(this._element, "mousedown", this._handleMouseDown.bind(this))), this.register((0, n.addDisposableDomListener)(this._element, "mouseup", this._handleMouseUp.bind(this)));
        }
        _handleMouseMove(e4) {
          this._lastMouseEvent = e4;
          const t4 = this._positionFromMouseEvent(e4, this._element, this._mouseService);
          if (!t4) return;
          this._isMouseOut = false;
          const i4 = e4.composedPath();
          for (let e5 = 0; e5 < i4.length; e5++) {
            const t5 = i4[e5];
            if (t5.classList.contains("xterm")) break;
            if (t5.classList.contains("xterm-hover")) return;
          }
          this._lastBufferCell && t4.x === this._lastBufferCell.x && t4.y === this._lastBufferCell.y || (this._handleHover(t4), this._lastBufferCell = t4);
        }
        _handleHover(e4) {
          if (this._activeLine !== e4.y || this._wasResized) return this._clearCurrentLink(), this._askForLink(e4, false), void (this._wasResized = false);
          this._currentLink && this._linkAtPosition(this._currentLink.link, e4) || (this._clearCurrentLink(), this._askForLink(e4, true));
        }
        _askForLink(e4, t4) {
          this._activeProviderReplies && t4 || (this._activeProviderReplies?.forEach((e5) => {
            e5?.forEach((e6) => {
              e6.link.dispose && e6.link.dispose();
            });
          }), this._activeProviderReplies = /* @__PURE__ */ new Map(), this._activeLine = e4.y);
          let i4 = false;
          for (const [s3, r2] of this._linkProviderService.linkProviders.entries()) if (t4) {
            const t5 = this._activeProviderReplies?.get(s3);
            t5 && (i4 = this._checkLinkProviderResult(s3, e4, i4));
          } else r2.provideLinks(e4.y, (t5) => {
            if (this._isMouseOut) return;
            const r3 = t5?.map((e5) => ({ link: e5 }));
            this._activeProviderReplies?.set(s3, r3), i4 = this._checkLinkProviderResult(s3, e4, i4), this._activeProviderReplies?.size === this._linkProviderService.linkProviders.length && this._removeIntersectingLinks(e4.y, this._activeProviderReplies);
          });
        }
        _removeIntersectingLinks(e4, t4) {
          const i4 = /* @__PURE__ */ new Set();
          for (let s3 = 0; s3 < t4.size; s3++) {
            const r2 = t4.get(s3);
            if (r2) for (let t5 = 0; t5 < r2.length; t5++) {
              const s4 = r2[t5], n2 = s4.link.range.start.y < e4 ? 0 : s4.link.range.start.x, o2 = s4.link.range.end.y > e4 ? this._bufferService.cols : s4.link.range.end.x;
              for (let e5 = n2; e5 <= o2; e5++) {
                if (i4.has(e5)) {
                  r2.splice(t5--, 1);
                  break;
                }
                i4.add(e5);
              }
            }
          }
        }
        _checkLinkProviderResult(e4, t4, i4) {
          if (!this._activeProviderReplies) return i4;
          const s3 = this._activeProviderReplies.get(e4);
          let r2 = false;
          for (let t5 = 0; t5 < e4; t5++) this._activeProviderReplies.has(t5) && !this._activeProviderReplies.get(t5) || (r2 = true);
          if (!r2 && s3) {
            const e5 = s3.find((e6) => this._linkAtPosition(e6.link, t4));
            e5 && (i4 = true, this._handleNewLink(e5));
          }
          if (this._activeProviderReplies.size === this._linkProviderService.linkProviders.length && !i4) for (let e5 = 0; e5 < this._activeProviderReplies.size; e5++) {
            const s4 = this._activeProviderReplies.get(e5)?.find((e6) => this._linkAtPosition(e6.link, t4));
            if (s4) {
              i4 = true, this._handleNewLink(s4);
              break;
            }
          }
          return i4;
        }
        _handleMouseDown() {
          this._mouseDownLink = this._currentLink;
        }
        _handleMouseUp(e4) {
          if (!this._currentLink) return;
          const t4 = this._positionFromMouseEvent(e4, this._element, this._mouseService);
          t4 && this._mouseDownLink === this._currentLink && this._linkAtPosition(this._currentLink.link, t4) && this._currentLink.link.activate(e4, this._currentLink.link.text);
        }
        _clearCurrentLink(e4, t4) {
          this._currentLink && this._lastMouseEvent && (!e4 || !t4 || this._currentLink.link.range.start.y >= e4 && this._currentLink.link.range.end.y <= t4) && (this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent), this._currentLink = void 0, (0, a.disposeArray)(this._linkCacheDisposables));
        }
        _handleNewLink(e4) {
          if (!this._lastMouseEvent) return;
          const t4 = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);
          t4 && this._linkAtPosition(e4.link, t4) && (this._currentLink = e4, this._currentLink.state = { decorations: { underline: void 0 === e4.link.decorations || e4.link.decorations.underline, pointerCursor: void 0 === e4.link.decorations || e4.link.decorations.pointerCursor }, isHovered: true }, this._linkHover(this._element, e4.link, this._lastMouseEvent), e4.link.decorations = {}, Object.defineProperties(e4.link.decorations, { pointerCursor: { get: /* @__PURE__ */ __name(() => this._currentLink?.state?.decorations.pointerCursor, "get"), set: /* @__PURE__ */ __name((e5) => {
            this._currentLink?.state && this._currentLink.state.decorations.pointerCursor !== e5 && (this._currentLink.state.decorations.pointerCursor = e5, this._currentLink.state.isHovered && this._element.classList.toggle("xterm-cursor-pointer", e5));
          }, "set") }, underline: { get: /* @__PURE__ */ __name(() => this._currentLink?.state?.decorations.underline, "get"), set: /* @__PURE__ */ __name((t5) => {
            this._currentLink?.state && this._currentLink?.state?.decorations.underline !== t5 && (this._currentLink.state.decorations.underline = t5, this._currentLink.state.isHovered && this._fireUnderlineEvent(e4.link, t5));
          }, "set") } }), this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e5) => {
            if (!this._currentLink) return;
            const t5 = 0 === e5.start ? 0 : e5.start + 1 + this._bufferService.buffer.ydisp, i4 = this._bufferService.buffer.ydisp + 1 + e5.end;
            if (this._currentLink.link.range.start.y >= t5 && this._currentLink.link.range.end.y <= i4 && (this._clearCurrentLink(t5, i4), this._lastMouseEvent)) {
              const e6 = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);
              e6 && this._askForLink(e6, false);
            }
          })));
        }
        _linkHover(e4, t4, i4) {
          this._currentLink?.state && (this._currentLink.state.isHovered = true, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(t4, true), this._currentLink.state.decorations.pointerCursor && e4.classList.add("xterm-cursor-pointer")), t4.hover && t4.hover(i4, t4.text);
        }
        _fireUnderlineEvent(e4, t4) {
          const i4 = e4.range, s3 = this._bufferService.buffer.ydisp, r2 = this._createLinkUnderlineEvent(i4.start.x - 1, i4.start.y - s3 - 1, i4.end.x, i4.end.y - s3 - 1, void 0);
          (t4 ? this._onShowLinkUnderline : this._onHideLinkUnderline).fire(r2);
        }
        _linkLeave(e4, t4, i4) {
          this._currentLink?.state && (this._currentLink.state.isHovered = false, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(t4, false), this._currentLink.state.decorations.pointerCursor && e4.classList.remove("xterm-cursor-pointer")), t4.leave && t4.leave(i4, t4.text);
        }
        _linkAtPosition(e4, t4) {
          const i4 = e4.range.start.y * this._bufferService.cols + e4.range.start.x, s3 = e4.range.end.y * this._bufferService.cols + e4.range.end.x, r2 = t4.y * this._bufferService.cols + t4.x;
          return i4 <= r2 && r2 <= s3;
        }
        _positionFromMouseEvent(e4, t4, i4) {
          const s3 = i4.getCoords(e4, t4, this._bufferService.cols, this._bufferService.rows);
          if (s3) return { x: s3[0], y: s3[1] + this._bufferService.buffer.ydisp };
        }
        _createLinkUnderlineEvent(e4, t4, i4, s3, r2) {
          return { x1: e4, y1: t4, x2: i4, y2: s3, cols: this._bufferService.cols, fg: r2 };
        }
      };
      t3.Linkifier = l = s2([r(1, c.IMouseService), r(2, c.IRenderService), r(3, h2.IBufferService), r(4, c.ILinkProviderService)], l);
    }, 9042: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.tooMuchOutput = t3.promptLabel = void 0, t3.promptLabel = "Terminal input", t3.tooMuchOutput = "Too much output to announce, navigate to rows manually to read";
    }, 3730: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.OscLinkProvider = void 0;
      const n = i3(511), o = i3(2585);
      let a = t3.OscLinkProvider = class {
        constructor(e4, t4, i4) {
          this._bufferService = e4, this._optionsService = t4, this._oscLinkService = i4;
        }
        provideLinks(e4, t4) {
          const i4 = this._bufferService.buffer.lines.get(e4 - 1);
          if (!i4) return void t4(void 0);
          const s3 = [], r2 = this._optionsService.rawOptions.linkHandler, o2 = new n.CellData(), a2 = i4.getTrimmedLength();
          let c = -1, l = -1, d = false;
          for (let t5 = 0; t5 < a2; t5++) if (-1 !== l || i4.hasContent(t5)) {
            if (i4.loadCell(t5, o2), o2.hasExtendedAttrs() && o2.extended.urlId) {
              if (-1 === l) {
                l = t5, c = o2.extended.urlId;
                continue;
              }
              d = o2.extended.urlId !== c;
            } else -1 !== l && (d = true);
            if (d || -1 !== l && t5 === a2 - 1) {
              const i5 = this._oscLinkService.getLinkData(c)?.uri;
              if (i5) {
                const n2 = { start: { x: l + 1, y: e4 }, end: { x: t5 + (d || t5 !== a2 - 1 ? 0 : 1), y: e4 } };
                let o3 = false;
                if (!r2?.allowNonHttpProtocols) try {
                  const e5 = new URL(i5);
                  ["http:", "https:"].includes(e5.protocol) || (o3 = true);
                } catch (e5) {
                  o3 = true;
                }
                o3 || s3.push({ text: i5, range: n2, activate: /* @__PURE__ */ __name((e5, t6) => r2 ? r2.activate(e5, t6, n2) : h2(0, t6), "activate"), hover: /* @__PURE__ */ __name((e5, t6) => r2?.hover?.(e5, t6, n2), "hover"), leave: /* @__PURE__ */ __name((e5, t6) => r2?.leave?.(e5, t6, n2), "leave") });
              }
              d = false, o2.hasExtendedAttrs() && o2.extended.urlId ? (l = t5, c = o2.extended.urlId) : (l = -1, c = -1);
            }
          }
          t4(s3);
        }
      };
      function h2(e4, t4) {
        if (confirm(`Do you want to navigate to ${t4}?

WARNING: This link could potentially be dangerous`)) {
          const e5 = window.open();
          if (e5) {
            try {
              e5.opener = null;
            } catch {
            }
            e5.location.href = t4;
          } else console.warn("Opening link blocked as opener could not be cleared");
        }
      }
      __name(h2, "h");
      t3.OscLinkProvider = a = s2([r(0, o.IBufferService), r(1, o.IOptionsService), r(2, o.IOscLinkService)], a);
    }, 6193: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.RenderDebouncer = void 0, t3.RenderDebouncer = class {
        constructor(e4, t4) {
          this._renderCallback = e4, this._coreBrowserService = t4, this._refreshCallbacks = [];
        }
        dispose() {
          this._animationFrame && (this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0);
        }
        addRefreshCallback(e4) {
          return this._refreshCallbacks.push(e4), this._animationFrame || (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh())), this._animationFrame;
        }
        refresh(e4, t4, i3) {
          this._rowCount = i3, e4 = void 0 !== e4 ? e4 : 0, t4 = void 0 !== t4 ? t4 : this._rowCount - 1, this._rowStart = void 0 !== this._rowStart ? Math.min(this._rowStart, e4) : e4, this._rowEnd = void 0 !== this._rowEnd ? Math.max(this._rowEnd, t4) : t4, this._animationFrame || (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh()));
        }
        _innerRefresh() {
          if (this._animationFrame = void 0, void 0 === this._rowStart || void 0 === this._rowEnd || void 0 === this._rowCount) return void this._runRefreshCallbacks();
          const e4 = Math.max(this._rowStart, 0), t4 = Math.min(this._rowEnd, this._rowCount - 1);
          this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(e4, t4), this._runRefreshCallbacks();
        }
        _runRefreshCallbacks() {
          for (const e4 of this._refreshCallbacks) e4(0);
          this._refreshCallbacks = [];
        }
      };
    }, 3236: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.Terminal = void 0;
      const s2 = i3(3614), r = i3(3656), n = i3(3551), o = i3(9042), a = i3(3730), h2 = i3(1680), c = i3(3107), l = i3(5744), d = i3(2950), _2 = i3(1296), u = i3(428), f = i3(4269), v2 = i3(5114), p2 = i3(8934), g2 = i3(3230), m = i3(9312), S = i3(4725), C = i3(6731), b = i3(8055), w = i3(8969), y2 = i3(8460), E = i3(844), k = i3(6114), L = i3(8437), D = i3(2584), R = i3(7399), x2 = i3(5941), A = i3(9074), B = i3(2585), T = i3(5435), M = i3(4567), O = i3(779);
      class P2 extends w.CoreTerminal {
        static {
          __name(this, "P");
        }
        get onFocus() {
          return this._onFocus.event;
        }
        get onBlur() {
          return this._onBlur.event;
        }
        get onA11yChar() {
          return this._onA11yCharEmitter.event;
        }
        get onA11yTab() {
          return this._onA11yTabEmitter.event;
        }
        get onWillOpen() {
          return this._onWillOpen.event;
        }
        constructor(e4 = {}) {
          super(e4), this.browser = k, this._keyDownHandled = false, this._keyDownSeen = false, this._keyPressHandled = false, this._unprocessedDeadKey = false, this._accessibilityManager = this.register(new E.MutableDisposable()), this._onCursorMove = this.register(new y2.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onKey = this.register(new y2.EventEmitter()), this.onKey = this._onKey.event, this._onRender = this.register(new y2.EventEmitter()), this.onRender = this._onRender.event, this._onSelectionChange = this.register(new y2.EventEmitter()), this.onSelectionChange = this._onSelectionChange.event, this._onTitleChange = this.register(new y2.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onBell = this.register(new y2.EventEmitter()), this.onBell = this._onBell.event, this._onFocus = this.register(new y2.EventEmitter()), this._onBlur = this.register(new y2.EventEmitter()), this._onA11yCharEmitter = this.register(new y2.EventEmitter()), this._onA11yTabEmitter = this.register(new y2.EventEmitter()), this._onWillOpen = this.register(new y2.EventEmitter()), this._setup(), this._decorationService = this._instantiationService.createInstance(A.DecorationService), this._instantiationService.setService(B.IDecorationService, this._decorationService), this._linkProviderService = this._instantiationService.createInstance(O.LinkProviderService), this._instantiationService.setService(S.ILinkProviderService, this._linkProviderService), this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(a.OscLinkProvider)), this.register(this._inputHandler.onRequestBell(() => this._onBell.fire())), this.register(this._inputHandler.onRequestRefreshRows((e5, t4) => this.refresh(e5, t4))), this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus())), this.register(this._inputHandler.onRequestReset(() => this.reset())), this.register(this._inputHandler.onRequestWindowsOptionsReport((e5) => this._reportWindowsOptions(e5))), this.register(this._inputHandler.onColor((e5) => this._handleColorEvent(e5))), this.register((0, y2.forwardEvent)(this._inputHandler.onCursorMove, this._onCursorMove)), this.register((0, y2.forwardEvent)(this._inputHandler.onTitleChange, this._onTitleChange)), this.register((0, y2.forwardEvent)(this._inputHandler.onA11yChar, this._onA11yCharEmitter)), this.register((0, y2.forwardEvent)(this._inputHandler.onA11yTab, this._onA11yTabEmitter)), this.register(this._bufferService.onResize((e5) => this._afterResize(e5.cols, e5.rows))), this.register((0, E.toDisposable)(() => {
            this._customKeyEventHandler = void 0, this.element?.parentNode?.removeChild(this.element);
          }));
        }
        _handleColorEvent(e4) {
          if (this._themeService) for (const t4 of e4) {
            let e5, i4 = "";
            switch (t4.index) {
              case 256:
                e5 = "foreground", i4 = "10";
                break;
              case 257:
                e5 = "background", i4 = "11";
                break;
              case 258:
                e5 = "cursor", i4 = "12";
                break;
              default:
                e5 = "ansi", i4 = "4;" + t4.index;
            }
            switch (t4.type) {
              case 0:
                const s3 = b.color.toColorRGB("ansi" === e5 ? this._themeService.colors.ansi[t4.index] : this._themeService.colors[e5]);
                this.coreService.triggerDataEvent(`${D.C0.ESC}]${i4};${(0, x2.toRgbString)(s3)}${D.C1_ESCAPED.ST}`);
                break;
              case 1:
                if ("ansi" === e5) this._themeService.modifyColors((e6) => e6.ansi[t4.index] = b.channels.toColor(...t4.color));
                else {
                  const i5 = e5;
                  this._themeService.modifyColors((e6) => e6[i5] = b.channels.toColor(...t4.color));
                }
                break;
              case 2:
                this._themeService.restoreColor(t4.index);
            }
          }
        }
        _setup() {
          super._setup(), this._customKeyEventHandler = void 0;
        }
        get buffer() {
          return this.buffers.active;
        }
        focus() {
          this.textarea && this.textarea.focus({ preventScroll: true });
        }
        _handleScreenReaderModeOptionChange(e4) {
          e4 ? !this._accessibilityManager.value && this._renderService && (this._accessibilityManager.value = this._instantiationService.createInstance(M.AccessibilityManager, this)) : this._accessibilityManager.clear();
        }
        _handleTextAreaFocus(e4) {
          this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(D.C0.ESC + "[I"), this.element.classList.add("focus"), this._showCursor(), this._onFocus.fire();
        }
        blur() {
          return this.textarea?.blur();
        }
        _handleTextAreaBlur() {
          this.textarea.value = "", this.refresh(this.buffer.y, this.buffer.y), this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(D.C0.ESC + "[O"), this.element.classList.remove("focus"), this._onBlur.fire();
        }
        _syncTextArea() {
          if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper.isComposing || !this._renderService) return;
          const e4 = this.buffer.ybase + this.buffer.y, t4 = this.buffer.lines.get(e4);
          if (!t4) return;
          const i4 = Math.min(this.buffer.x, this.cols - 1), s3 = this._renderService.dimensions.css.cell.height, r2 = t4.getWidth(i4), n2 = this._renderService.dimensions.css.cell.width * r2, o2 = this.buffer.y * this._renderService.dimensions.css.cell.height, a2 = i4 * this._renderService.dimensions.css.cell.width;
          this.textarea.style.left = a2 + "px", this.textarea.style.top = o2 + "px", this.textarea.style.width = n2 + "px", this.textarea.style.height = s3 + "px", this.textarea.style.lineHeight = s3 + "px", this.textarea.style.zIndex = "-5";
        }
        _initGlobal() {
          this._bindKeys(), this.register((0, r.addDisposableDomListener)(this.element, "copy", (e5) => {
            this.hasSelection() && (0, s2.copyHandler)(e5, this._selectionService);
          }));
          const e4 = /* @__PURE__ */ __name((e5) => (0, s2.handlePasteEvent)(e5, this.textarea, this.coreService, this.optionsService), "e");
          this.register((0, r.addDisposableDomListener)(this.textarea, "paste", e4)), this.register((0, r.addDisposableDomListener)(this.element, "paste", e4)), k.isFirefox ? this.register((0, r.addDisposableDomListener)(this.element, "mousedown", (e5) => {
            2 === e5.button && (0, s2.rightClickHandler)(e5, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord);
          })) : this.register((0, r.addDisposableDomListener)(this.element, "contextmenu", (e5) => {
            (0, s2.rightClickHandler)(e5, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord);
          })), k.isLinux && this.register((0, r.addDisposableDomListener)(this.element, "auxclick", (e5) => {
            1 === e5.button && (0, s2.moveTextAreaUnderMouseCursor)(e5, this.textarea, this.screenElement);
          }));
        }
        _bindKeys() {
          this.register((0, r.addDisposableDomListener)(this.textarea, "keyup", (e4) => this._keyUp(e4), true)), this.register((0, r.addDisposableDomListener)(this.textarea, "keydown", (e4) => this._keyDown(e4), true)), this.register((0, r.addDisposableDomListener)(this.textarea, "keypress", (e4) => this._keyPress(e4), true)), this.register((0, r.addDisposableDomListener)(this.textarea, "compositionstart", () => this._compositionHelper.compositionstart())), this.register((0, r.addDisposableDomListener)(this.textarea, "compositionupdate", (e4) => this._compositionHelper.compositionupdate(e4))), this.register((0, r.addDisposableDomListener)(this.textarea, "compositionend", () => this._compositionHelper.compositionend())), this.register((0, r.addDisposableDomListener)(this.textarea, "input", (e4) => this._inputEvent(e4), true)), this.register(this.onRender(() => this._compositionHelper.updateCompositionElements()));
        }
        open(e4) {
          if (!e4) throw new Error("Terminal requires a parent element.");
          if (e4.isConnected || this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"), this.element?.ownerDocument.defaultView && this._coreBrowserService) return void (this.element.ownerDocument.defaultView !== this._coreBrowserService.window && (this._coreBrowserService.window = this.element.ownerDocument.defaultView));
          this._document = e4.ownerDocument, this.options.documentOverride && this.options.documentOverride instanceof Document && (this._document = this.optionsService.rawOptions.documentOverride), this.element = this._document.createElement("div"), this.element.dir = "ltr", this.element.classList.add("terminal"), this.element.classList.add("xterm"), e4.appendChild(this.element);
          const t4 = this._document.createDocumentFragment();
          this._viewportElement = this._document.createElement("div"), this._viewportElement.classList.add("xterm-viewport"), t4.appendChild(this._viewportElement), this._viewportScrollArea = this._document.createElement("div"), this._viewportScrollArea.classList.add("xterm-scroll-area"), this._viewportElement.appendChild(this._viewportScrollArea), this.screenElement = this._document.createElement("div"), this.screenElement.classList.add("xterm-screen"), this.register((0, r.addDisposableDomListener)(this.screenElement, "mousemove", (e5) => this.updateCursorStyle(e5))), this._helperContainer = this._document.createElement("div"), this._helperContainer.classList.add("xterm-helpers"), this.screenElement.appendChild(this._helperContainer), t4.appendChild(this.screenElement), this.textarea = this._document.createElement("textarea"), this.textarea.classList.add("xterm-helper-textarea"), this.textarea.setAttribute("aria-label", o.promptLabel), k.isChromeOS || this.textarea.setAttribute("aria-multiline", "false"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.tabIndex = 0, this._coreBrowserService = this.register(this._instantiationService.createInstance(v2.CoreBrowserService, this.textarea, e4.ownerDocument.defaultView ?? window, this._document ?? "undefined" != typeof window ? window.document : null)), this._instantiationService.setService(S.ICoreBrowserService, this._coreBrowserService), this.register((0, r.addDisposableDomListener)(this.textarea, "focus", (e5) => this._handleTextAreaFocus(e5))), this.register((0, r.addDisposableDomListener)(this.textarea, "blur", () => this._handleTextAreaBlur())), this._helperContainer.appendChild(this.textarea), this._charSizeService = this._instantiationService.createInstance(u.CharSizeService, this._document, this._helperContainer), this._instantiationService.setService(S.ICharSizeService, this._charSizeService), this._themeService = this._instantiationService.createInstance(C.ThemeService), this._instantiationService.setService(S.IThemeService, this._themeService), this._characterJoinerService = this._instantiationService.createInstance(f.CharacterJoinerService), this._instantiationService.setService(S.ICharacterJoinerService, this._characterJoinerService), this._renderService = this.register(this._instantiationService.createInstance(g2.RenderService, this.rows, this.screenElement)), this._instantiationService.setService(S.IRenderService, this._renderService), this.register(this._renderService.onRenderedViewportChange((e5) => this._onRender.fire(e5))), this.onResize((e5) => this._renderService.resize(e5.cols, e5.rows)), this._compositionView = this._document.createElement("div"), this._compositionView.classList.add("composition-view"), this._compositionHelper = this._instantiationService.createInstance(d.CompositionHelper, this.textarea, this._compositionView), this._helperContainer.appendChild(this._compositionView), this._mouseService = this._instantiationService.createInstance(p2.MouseService), this._instantiationService.setService(S.IMouseService, this._mouseService), this.linkifier = this.register(this._instantiationService.createInstance(n.Linkifier, this.screenElement)), this.element.appendChild(t4);
          try {
            this._onWillOpen.fire(this.element);
          } catch {
          }
          this._renderService.hasRenderer() || this._renderService.setRenderer(this._createRenderer()), this.viewport = this._instantiationService.createInstance(h2.Viewport, this._viewportElement, this._viewportScrollArea), this.viewport.onRequestScrollLines((e5) => this.scrollLines(e5.amount, e5.suppressScrollEvent, 1)), this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport.syncScrollArea())), this.register(this.viewport), this.register(this.onCursorMove(() => {
            this._renderService.handleCursorMove(), this._syncTextArea();
          })), this.register(this.onResize(() => this._renderService.handleResize(this.cols, this.rows))), this.register(this.onBlur(() => this._renderService.handleBlur())), this.register(this.onFocus(() => this._renderService.handleFocus())), this.register(this._renderService.onDimensionsChange(() => this.viewport.syncScrollArea())), this._selectionService = this.register(this._instantiationService.createInstance(m.SelectionService, this.element, this.screenElement, this.linkifier)), this._instantiationService.setService(S.ISelectionService, this._selectionService), this.register(this._selectionService.onRequestScrollLines((e5) => this.scrollLines(e5.amount, e5.suppressScrollEvent))), this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire())), this.register(this._selectionService.onRequestRedraw((e5) => this._renderService.handleSelectionChanged(e5.start, e5.end, e5.columnSelectMode))), this.register(this._selectionService.onLinuxMouseSelection((e5) => {
            this.textarea.value = e5, this.textarea.focus(), this.textarea.select();
          })), this.register(this._onScroll.event((e5) => {
            this.viewport.syncScrollArea(), this._selectionService.refresh();
          })), this.register((0, r.addDisposableDomListener)(this._viewportElement, "scroll", () => this._selectionService.refresh())), this.register(this._instantiationService.createInstance(c.BufferDecorationRenderer, this.screenElement)), this.register((0, r.addDisposableDomListener)(this.element, "mousedown", (e5) => this._selectionService.handleMouseDown(e5))), this.coreMouseService.areMouseEventsActive ? (this._selectionService.disable(), this.element.classList.add("enable-mouse-events")) : this._selectionService.enable(), this.options.screenReaderMode && (this._accessibilityManager.value = this._instantiationService.createInstance(M.AccessibilityManager, this)), this.register(this.optionsService.onSpecificOptionChange("screenReaderMode", (e5) => this._handleScreenReaderModeOptionChange(e5))), this.options.overviewRulerWidth && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer, this._viewportElement, this.screenElement))), this.optionsService.onSpecificOptionChange("overviewRulerWidth", (e5) => {
            !this._overviewRulerRenderer && e5 && this._viewportElement && this.screenElement && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer, this._viewportElement, this.screenElement)));
          }), this._charSizeService.measure(), this.refresh(0, this.rows - 1), this._initGlobal(), this.bindMouse();
        }
        _createRenderer() {
          return this._instantiationService.createInstance(_2.DomRenderer, this, this._document, this.element, this.screenElement, this._viewportElement, this._helperContainer, this.linkifier);
        }
        bindMouse() {
          const e4 = this, t4 = this.element;
          function i4(t5) {
            const i5 = e4._mouseService.getMouseReportCoords(t5, e4.screenElement);
            if (!i5) return false;
            let s4, r2;
            switch (t5.overrideType || t5.type) {
              case "mousemove":
                r2 = 32, void 0 === t5.buttons ? (s4 = 3, void 0 !== t5.button && (s4 = t5.button < 3 ? t5.button : 3)) : s4 = 1 & t5.buttons ? 0 : 4 & t5.buttons ? 1 : 2 & t5.buttons ? 2 : 3;
                break;
              case "mouseup":
                r2 = 0, s4 = t5.button < 3 ? t5.button : 3;
                break;
              case "mousedown":
                r2 = 1, s4 = t5.button < 3 ? t5.button : 3;
                break;
              case "wheel":
                if (e4._customWheelEventHandler && false === e4._customWheelEventHandler(t5)) return false;
                if (0 === e4.viewport.getLinesScrolled(t5)) return false;
                r2 = t5.deltaY < 0 ? 0 : 1, s4 = 4;
                break;
              default:
                return false;
            }
            return !(void 0 === r2 || void 0 === s4 || s4 > 4) && e4.coreMouseService.triggerMouseEvent({ col: i5.col, row: i5.row, x: i5.x, y: i5.y, button: s4, action: r2, ctrl: t5.ctrlKey, alt: t5.altKey, shift: t5.shiftKey });
          }
          __name(i4, "i");
          const s3 = { mouseup: null, wheel: null, mousedrag: null, mousemove: null }, n2 = { mouseup: /* @__PURE__ */ __name((e5) => (i4(e5), e5.buttons || (this._document.removeEventListener("mouseup", s3.mouseup), s3.mousedrag && this._document.removeEventListener("mousemove", s3.mousedrag)), this.cancel(e5)), "mouseup"), wheel: /* @__PURE__ */ __name((e5) => (i4(e5), this.cancel(e5, true)), "wheel"), mousedrag: /* @__PURE__ */ __name((e5) => {
            e5.buttons && i4(e5);
          }, "mousedrag"), mousemove: /* @__PURE__ */ __name((e5) => {
            e5.buttons || i4(e5);
          }, "mousemove") };
          this.register(this.coreMouseService.onProtocolChange((e5) => {
            e5 ? ("debug" === this.optionsService.rawOptions.logLevel && this._logService.debug("Binding to mouse events:", this.coreMouseService.explainEvents(e5)), this.element.classList.add("enable-mouse-events"), this._selectionService.disable()) : (this._logService.debug("Unbinding from mouse events."), this.element.classList.remove("enable-mouse-events"), this._selectionService.enable()), 8 & e5 ? s3.mousemove || (t4.addEventListener("mousemove", n2.mousemove), s3.mousemove = n2.mousemove) : (t4.removeEventListener("mousemove", s3.mousemove), s3.mousemove = null), 16 & e5 ? s3.wheel || (t4.addEventListener("wheel", n2.wheel, { passive: false }), s3.wheel = n2.wheel) : (t4.removeEventListener("wheel", s3.wheel), s3.wheel = null), 2 & e5 ? s3.mouseup || (s3.mouseup = n2.mouseup) : (this._document.removeEventListener("mouseup", s3.mouseup), s3.mouseup = null), 4 & e5 ? s3.mousedrag || (s3.mousedrag = n2.mousedrag) : (this._document.removeEventListener("mousemove", s3.mousedrag), s3.mousedrag = null);
          })), this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol, this.register((0, r.addDisposableDomListener)(t4, "mousedown", (e5) => {
            if (e5.preventDefault(), this.focus(), this.coreMouseService.areMouseEventsActive && !this._selectionService.shouldForceSelection(e5)) return i4(e5), s3.mouseup && this._document.addEventListener("mouseup", s3.mouseup), s3.mousedrag && this._document.addEventListener("mousemove", s3.mousedrag), this.cancel(e5);
          })), this.register((0, r.addDisposableDomListener)(t4, "wheel", (e5) => {
            if (!s3.wheel) {
              if (this._customWheelEventHandler && false === this._customWheelEventHandler(e5)) return false;
              if (!this.buffer.hasScrollback) {
                const t5 = this.viewport.getLinesScrolled(e5);
                if (0 === t5) return;
                const i5 = D.C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? "O" : "[") + (e5.deltaY < 0 ? "A" : "B");
                let s4 = "";
                for (let e6 = 0; e6 < Math.abs(t5); e6++) s4 += i5;
                return this.coreService.triggerDataEvent(s4, true), this.cancel(e5, true);
              }
              return this.viewport.handleWheel(e5) ? this.cancel(e5) : void 0;
            }
          }, { passive: false })), this.register((0, r.addDisposableDomListener)(t4, "touchstart", (e5) => {
            if (!this.coreMouseService.areMouseEventsActive) return this.viewport.handleTouchStart(e5), this.cancel(e5);
          }, { passive: true })), this.register((0, r.addDisposableDomListener)(t4, "touchmove", (e5) => {
            if (!this.coreMouseService.areMouseEventsActive) return this.viewport.handleTouchMove(e5) ? void 0 : this.cancel(e5);
          }, { passive: false }));
        }
        refresh(e4, t4) {
          this._renderService?.refreshRows(e4, t4);
        }
        updateCursorStyle(e4) {
          this._selectionService?.shouldColumnSelect(e4) ? this.element.classList.add("column-select") : this.element.classList.remove("column-select");
        }
        _showCursor() {
          this.coreService.isCursorInitialized || (this.coreService.isCursorInitialized = true, this.refresh(this.buffer.y, this.buffer.y));
        }
        scrollLines(e4, t4, i4 = 0) {
          1 === i4 ? (super.scrollLines(e4, t4, i4), this.refresh(0, this.rows - 1)) : this.viewport?.scrollLines(e4);
        }
        paste(e4) {
          (0, s2.paste)(e4, this.textarea, this.coreService, this.optionsService);
        }
        attachCustomKeyEventHandler(e4) {
          this._customKeyEventHandler = e4;
        }
        attachCustomWheelEventHandler(e4) {
          this._customWheelEventHandler = e4;
        }
        registerLinkProvider(e4) {
          return this._linkProviderService.registerLinkProvider(e4);
        }
        registerCharacterJoiner(e4) {
          if (!this._characterJoinerService) throw new Error("Terminal must be opened first");
          const t4 = this._characterJoinerService.register(e4);
          return this.refresh(0, this.rows - 1), t4;
        }
        deregisterCharacterJoiner(e4) {
          if (!this._characterJoinerService) throw new Error("Terminal must be opened first");
          this._characterJoinerService.deregister(e4) && this.refresh(0, this.rows - 1);
        }
        get markers() {
          return this.buffer.markers;
        }
        registerMarker(e4) {
          return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + e4);
        }
        registerDecoration(e4) {
          return this._decorationService.registerDecoration(e4);
        }
        hasSelection() {
          return !!this._selectionService && this._selectionService.hasSelection;
        }
        select(e4, t4, i4) {
          this._selectionService.setSelection(e4, t4, i4);
        }
        getSelection() {
          return this._selectionService ? this._selectionService.selectionText : "";
        }
        getSelectionPosition() {
          if (this._selectionService && this._selectionService.hasSelection) return { start: { x: this._selectionService.selectionStart[0], y: this._selectionService.selectionStart[1] }, end: { x: this._selectionService.selectionEnd[0], y: this._selectionService.selectionEnd[1] } };
        }
        clearSelection() {
          this._selectionService?.clearSelection();
        }
        selectAll() {
          this._selectionService?.selectAll();
        }
        selectLines(e4, t4) {
          this._selectionService?.selectLines(e4, t4);
        }
        _keyDown(e4) {
          if (this._keyDownHandled = false, this._keyDownSeen = true, this._customKeyEventHandler && false === this._customKeyEventHandler(e4)) return false;
          const t4 = this.browser.isMac && this.options.macOptionIsMeta && e4.altKey;
          if (!t4 && !this._compositionHelper.keydown(e4)) return this.options.scrollOnUserInput && this.buffer.ybase !== this.buffer.ydisp && this.scrollToBottom(), false;
          t4 || "Dead" !== e4.key && "AltGraph" !== e4.key || (this._unprocessedDeadKey = true);
          const i4 = (0, R.evaluateKeyboardEvent)(e4, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta);
          if (this.updateCursorStyle(e4), 3 === i4.type || 2 === i4.type) {
            const t5 = this.rows - 1;
            return this.scrollLines(2 === i4.type ? -t5 : t5), this.cancel(e4, true);
          }
          return 1 === i4.type && this.selectAll(), !!this._isThirdLevelShift(this.browser, e4) || (i4.cancel && this.cancel(e4, true), !i4.key || !!(e4.key && !e4.ctrlKey && !e4.altKey && !e4.metaKey && 1 === e4.key.length && e4.key.charCodeAt(0) >= 65 && e4.key.charCodeAt(0) <= 90) || (this._unprocessedDeadKey ? (this._unprocessedDeadKey = false, true) : (i4.key !== D.C0.ETX && i4.key !== D.C0.CR || (this.textarea.value = ""), this._onKey.fire({ key: i4.key, domEvent: e4 }), this._showCursor(), this.coreService.triggerDataEvent(i4.key, true), !this.optionsService.rawOptions.screenReaderMode || e4.altKey || e4.ctrlKey ? this.cancel(e4, true) : void (this._keyDownHandled = true))));
        }
        _isThirdLevelShift(e4, t4) {
          const i4 = e4.isMac && !this.options.macOptionIsMeta && t4.altKey && !t4.ctrlKey && !t4.metaKey || e4.isWindows && t4.altKey && t4.ctrlKey && !t4.metaKey || e4.isWindows && t4.getModifierState("AltGraph");
          return "keypress" === t4.type ? i4 : i4 && (!t4.keyCode || t4.keyCode > 47);
        }
        _keyUp(e4) {
          this._keyDownSeen = false, this._customKeyEventHandler && false === this._customKeyEventHandler(e4) || (function(e5) {
            return 16 === e5.keyCode || 17 === e5.keyCode || 18 === e5.keyCode;
          }(e4) || this.focus(), this.updateCursorStyle(e4), this._keyPressHandled = false);
        }
        _keyPress(e4) {
          let t4;
          if (this._keyPressHandled = false, this._keyDownHandled) return false;
          if (this._customKeyEventHandler && false === this._customKeyEventHandler(e4)) return false;
          if (this.cancel(e4), e4.charCode) t4 = e4.charCode;
          else if (null === e4.which || void 0 === e4.which) t4 = e4.keyCode;
          else {
            if (0 === e4.which || 0 === e4.charCode) return false;
            t4 = e4.which;
          }
          return !(!t4 || (e4.altKey || e4.ctrlKey || e4.metaKey) && !this._isThirdLevelShift(this.browser, e4) || (t4 = String.fromCharCode(t4), this._onKey.fire({ key: t4, domEvent: e4 }), this._showCursor(), this.coreService.triggerDataEvent(t4, true), this._keyPressHandled = true, this._unprocessedDeadKey = false, 0));
        }
        _inputEvent(e4) {
          if (e4.data && "insertText" === e4.inputType && (!e4.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) {
            if (this._keyPressHandled) return false;
            this._unprocessedDeadKey = false;
            const t4 = e4.data;
            return this.coreService.triggerDataEvent(t4, true), this.cancel(e4), true;
          }
          return false;
        }
        resize(e4, t4) {
          e4 !== this.cols || t4 !== this.rows ? super.resize(e4, t4) : this._charSizeService && !this._charSizeService.hasValidSize && this._charSizeService.measure();
        }
        _afterResize(e4, t4) {
          this._charSizeService?.measure(), this.viewport?.syncScrollArea(true);
        }
        clear() {
          if (0 !== this.buffer.ybase || 0 !== this.buffer.y) {
            this.buffer.clearAllMarkers(), this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)), this.buffer.lines.length = 1, this.buffer.ydisp = 0, this.buffer.ybase = 0, this.buffer.y = 0;
            for (let e4 = 1; e4 < this.rows; e4++) this.buffer.lines.push(this.buffer.getBlankLine(L.DEFAULT_ATTR_DATA));
            this._onScroll.fire({ position: this.buffer.ydisp, source: 0 }), this.viewport?.reset(), this.refresh(0, this.rows - 1);
          }
        }
        reset() {
          this.options.rows = this.rows, this.options.cols = this.cols;
          const e4 = this._customKeyEventHandler;
          this._setup(), super.reset(), this._selectionService?.reset(), this._decorationService.reset(), this.viewport?.reset(), this._customKeyEventHandler = e4, this.refresh(0, this.rows - 1);
        }
        clearTextureAtlas() {
          this._renderService?.clearTextureAtlas();
        }
        _reportFocus() {
          this.element?.classList.contains("focus") ? this.coreService.triggerDataEvent(D.C0.ESC + "[I") : this.coreService.triggerDataEvent(D.C0.ESC + "[O");
        }
        _reportWindowsOptions(e4) {
          if (this._renderService) switch (e4) {
            case T.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:
              const e5 = this._renderService.dimensions.css.canvas.width.toFixed(0), t4 = this._renderService.dimensions.css.canvas.height.toFixed(0);
              this.coreService.triggerDataEvent(`${D.C0.ESC}[4;${t4};${e5}t`);
              break;
            case T.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:
              const i4 = this._renderService.dimensions.css.cell.width.toFixed(0), s3 = this._renderService.dimensions.css.cell.height.toFixed(0);
              this.coreService.triggerDataEvent(`${D.C0.ESC}[6;${s3};${i4}t`);
          }
        }
        cancel(e4, t4) {
          if (this.options.cancelEvents || t4) return e4.preventDefault(), e4.stopPropagation(), false;
        }
      }
      t3.Terminal = P2;
    }, 9924: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.TimeBasedDebouncer = void 0, t3.TimeBasedDebouncer = class {
        constructor(e4, t4 = 1e3) {
          this._renderCallback = e4, this._debounceThresholdMS = t4, this._lastRefreshMs = 0, this._additionalRefreshRequested = false;
        }
        dispose() {
          this._refreshTimeoutID && clearTimeout(this._refreshTimeoutID);
        }
        refresh(e4, t4, i3) {
          this._rowCount = i3, e4 = void 0 !== e4 ? e4 : 0, t4 = void 0 !== t4 ? t4 : this._rowCount - 1, this._rowStart = void 0 !== this._rowStart ? Math.min(this._rowStart, e4) : e4, this._rowEnd = void 0 !== this._rowEnd ? Math.max(this._rowEnd, t4) : t4;
          const s2 = Date.now();
          if (s2 - this._lastRefreshMs >= this._debounceThresholdMS) this._lastRefreshMs = s2, this._innerRefresh();
          else if (!this._additionalRefreshRequested) {
            const e5 = s2 - this._lastRefreshMs, t5 = this._debounceThresholdMS - e5;
            this._additionalRefreshRequested = true, this._refreshTimeoutID = window.setTimeout(() => {
              this._lastRefreshMs = Date.now(), this._innerRefresh(), this._additionalRefreshRequested = false, this._refreshTimeoutID = void 0;
            }, t5);
          }
        }
        _innerRefresh() {
          if (void 0 === this._rowStart || void 0 === this._rowEnd || void 0 === this._rowCount) return;
          const e4 = Math.max(this._rowStart, 0), t4 = Math.min(this._rowEnd, this._rowCount - 1);
          this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(e4, t4);
        }
      };
    }, 1680: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.Viewport = void 0;
      const n = i3(3656), o = i3(4725), a = i3(8460), h2 = i3(844), c = i3(2585);
      let l = t3.Viewport = class extends h2.Disposable {
        constructor(e4, t4, i4, s3, r2, o2, h3, c2) {
          super(), this._viewportElement = e4, this._scrollArea = t4, this._bufferService = i4, this._optionsService = s3, this._charSizeService = r2, this._renderService = o2, this._coreBrowserService = h3, this.scrollBarWidth = 0, this._currentRowHeight = 0, this._currentDeviceCellHeight = 0, this._lastRecordedBufferLength = 0, this._lastRecordedViewportHeight = 0, this._lastRecordedBufferHeight = 0, this._lastTouchY = 0, this._lastScrollTop = 0, this._wheelPartialScroll = 0, this._refreshAnimationFrame = null, this._ignoreNextScrollEvent = false, this._smoothScrollState = { startTime: 0, origin: -1, target: -1 }, this._onRequestScrollLines = this.register(new a.EventEmitter()), this.onRequestScrollLines = this._onRequestScrollLines.event, this.scrollBarWidth = this._viewportElement.offsetWidth - this._scrollArea.offsetWidth || 15, this.register((0, n.addDisposableDomListener)(this._viewportElement, "scroll", this._handleScroll.bind(this))), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate((e5) => this._activeBuffer = e5.activeBuffer)), this._renderDimensions = this._renderService.dimensions, this.register(this._renderService.onDimensionsChange((e5) => this._renderDimensions = e5)), this._handleThemeChange(c2.colors), this.register(c2.onChangeColors((e5) => this._handleThemeChange(e5))), this.register(this._optionsService.onSpecificOptionChange("scrollback", () => this.syncScrollArea())), setTimeout(() => this.syncScrollArea());
        }
        _handleThemeChange(e4) {
          this._viewportElement.style.backgroundColor = e4.background.css;
        }
        reset() {
          this._currentRowHeight = 0, this._currentDeviceCellHeight = 0, this._lastRecordedBufferLength = 0, this._lastRecordedViewportHeight = 0, this._lastRecordedBufferHeight = 0, this._lastTouchY = 0, this._lastScrollTop = 0, this._coreBrowserService.window.requestAnimationFrame(() => this.syncScrollArea());
        }
        _refresh(e4) {
          if (e4) return this._innerRefresh(), void (null !== this._refreshAnimationFrame && this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));
          null === this._refreshAnimationFrame && (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh()));
        }
        _innerRefresh() {
          if (this._charSizeService.height > 0) {
            this._currentRowHeight = this._renderDimensions.device.cell.height / this._coreBrowserService.dpr, this._currentDeviceCellHeight = this._renderDimensions.device.cell.height, this._lastRecordedViewportHeight = this._viewportElement.offsetHeight;
            const e5 = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._renderDimensions.css.canvas.height);
            this._lastRecordedBufferHeight !== e5 && (this._lastRecordedBufferHeight = e5, this._scrollArea.style.height = this._lastRecordedBufferHeight + "px");
          }
          const e4 = this._bufferService.buffer.ydisp * this._currentRowHeight;
          this._viewportElement.scrollTop !== e4 && (this._ignoreNextScrollEvent = true, this._viewportElement.scrollTop = e4), this._refreshAnimationFrame = null;
        }
        syncScrollArea(e4 = false) {
          if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length) return this._lastRecordedBufferLength = this._bufferService.buffer.lines.length, void this._refresh(e4);
          this._lastRecordedViewportHeight === this._renderService.dimensions.css.canvas.height && this._lastScrollTop === this._activeBuffer.ydisp * this._currentRowHeight && this._renderDimensions.device.cell.height === this._currentDeviceCellHeight || this._refresh(e4);
        }
        _handleScroll(e4) {
          if (this._lastScrollTop = this._viewportElement.scrollTop, !this._viewportElement.offsetParent) return;
          if (this._ignoreNextScrollEvent) return this._ignoreNextScrollEvent = false, void this._onRequestScrollLines.fire({ amount: 0, suppressScrollEvent: true });
          const t4 = Math.round(this._lastScrollTop / this._currentRowHeight) - this._bufferService.buffer.ydisp;
          this._onRequestScrollLines.fire({ amount: t4, suppressScrollEvent: true });
        }
        _smoothScroll() {
          if (this._isDisposed || -1 === this._smoothScrollState.origin || -1 === this._smoothScrollState.target) return;
          const e4 = this._smoothScrollPercent();
          this._viewportElement.scrollTop = this._smoothScrollState.origin + Math.round(e4 * (this._smoothScrollState.target - this._smoothScrollState.origin)), e4 < 1 ? this._coreBrowserService.window.requestAnimationFrame(() => this._smoothScroll()) : this._clearSmoothScrollState();
        }
        _smoothScrollPercent() {
          return this._optionsService.rawOptions.smoothScrollDuration && this._smoothScrollState.startTime ? Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollDuration, 1), 0) : 1;
        }
        _clearSmoothScrollState() {
          this._smoothScrollState.startTime = 0, this._smoothScrollState.origin = -1, this._smoothScrollState.target = -1;
        }
        _bubbleScroll(e4, t4) {
          const i4 = this._viewportElement.scrollTop + this._lastRecordedViewportHeight;
          return !(t4 < 0 && 0 !== this._viewportElement.scrollTop || t4 > 0 && i4 < this._lastRecordedBufferHeight) || (e4.cancelable && e4.preventDefault(), false);
        }
        handleWheel(e4) {
          const t4 = this._getPixelsScrolled(e4);
          return 0 !== t4 && (this._optionsService.rawOptions.smoothScrollDuration ? (this._smoothScrollState.startTime = Date.now(), this._smoothScrollPercent() < 1 ? (this._smoothScrollState.origin = this._viewportElement.scrollTop, -1 === this._smoothScrollState.target ? this._smoothScrollState.target = this._viewportElement.scrollTop + t4 : this._smoothScrollState.target += t4, this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0), this._smoothScroll()) : this._clearSmoothScrollState()) : this._viewportElement.scrollTop += t4, this._bubbleScroll(e4, t4));
        }
        scrollLines(e4) {
          if (0 !== e4) if (this._optionsService.rawOptions.smoothScrollDuration) {
            const t4 = e4 * this._currentRowHeight;
            this._smoothScrollState.startTime = Date.now(), this._smoothScrollPercent() < 1 ? (this._smoothScrollState.origin = this._viewportElement.scrollTop, this._smoothScrollState.target = this._smoothScrollState.origin + t4, this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0), this._smoothScroll()) : this._clearSmoothScrollState();
          } else this._onRequestScrollLines.fire({ amount: e4, suppressScrollEvent: false });
        }
        _getPixelsScrolled(e4) {
          if (0 === e4.deltaY || e4.shiftKey) return 0;
          let t4 = this._applyScrollModifier(e4.deltaY, e4);
          return e4.deltaMode === WheelEvent.DOM_DELTA_LINE ? t4 *= this._currentRowHeight : e4.deltaMode === WheelEvent.DOM_DELTA_PAGE && (t4 *= this._currentRowHeight * this._bufferService.rows), t4;
        }
        getBufferElements(e4, t4) {
          let i4, s3 = "";
          const r2 = [], n2 = t4 ?? this._bufferService.buffer.lines.length, o2 = this._bufferService.buffer.lines;
          for (let t5 = e4; t5 < n2; t5++) {
            const e5 = o2.get(t5);
            if (!e5) continue;
            const n3 = o2.get(t5 + 1)?.isWrapped;
            if (s3 += e5.translateToString(!n3), !n3 || t5 === o2.length - 1) {
              const e6 = document.createElement("div");
              e6.textContent = s3, r2.push(e6), s3.length > 0 && (i4 = e6), s3 = "";
            }
          }
          return { bufferElements: r2, cursorElement: i4 };
        }
        getLinesScrolled(e4) {
          if (0 === e4.deltaY || e4.shiftKey) return 0;
          let t4 = this._applyScrollModifier(e4.deltaY, e4);
          return e4.deltaMode === WheelEvent.DOM_DELTA_PIXEL ? (t4 /= this._currentRowHeight + 0, this._wheelPartialScroll += t4, t4 = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1), this._wheelPartialScroll %= 1) : e4.deltaMode === WheelEvent.DOM_DELTA_PAGE && (t4 *= this._bufferService.rows), t4;
        }
        _applyScrollModifier(e4, t4) {
          const i4 = this._optionsService.rawOptions.fastScrollModifier;
          return "alt" === i4 && t4.altKey || "ctrl" === i4 && t4.ctrlKey || "shift" === i4 && t4.shiftKey ? e4 * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity : e4 * this._optionsService.rawOptions.scrollSensitivity;
        }
        handleTouchStart(e4) {
          this._lastTouchY = e4.touches[0].pageY;
        }
        handleTouchMove(e4) {
          const t4 = this._lastTouchY - e4.touches[0].pageY;
          return this._lastTouchY = e4.touches[0].pageY, 0 !== t4 && (this._viewportElement.scrollTop += t4, this._bubbleScroll(e4, t4));
        }
      };
      t3.Viewport = l = s2([r(2, c.IBufferService), r(3, c.IOptionsService), r(4, o.ICharSizeService), r(5, o.IRenderService), r(6, o.ICoreBrowserService), r(7, o.IThemeService)], l);
    }, 3107: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.BufferDecorationRenderer = void 0;
      const n = i3(4725), o = i3(844), a = i3(2585);
      let h2 = t3.BufferDecorationRenderer = class extends o.Disposable {
        constructor(e4, t4, i4, s3, r2) {
          super(), this._screenElement = e4, this._bufferService = t4, this._coreBrowserService = i4, this._decorationService = s3, this._renderService = r2, this._decorationElements = /* @__PURE__ */ new Map(), this._altBufferIsActive = false, this._dimensionsChanged = false, this._container = document.createElement("div"), this._container.classList.add("xterm-decoration-container"), this._screenElement.appendChild(this._container), this.register(this._renderService.onRenderedViewportChange(() => this._doRefreshDecorations())), this.register(this._renderService.onDimensionsChange(() => {
            this._dimensionsChanged = true, this._queueRefresh();
          })), this.register(this._coreBrowserService.onDprChange(() => this._queueRefresh())), this.register(this._bufferService.buffers.onBufferActivate(() => {
            this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt;
          })), this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh())), this.register(this._decorationService.onDecorationRemoved((e5) => this._removeDecoration(e5))), this.register((0, o.toDisposable)(() => {
            this._container.remove(), this._decorationElements.clear();
          }));
        }
        _queueRefresh() {
          void 0 === this._animationFrame && (this._animationFrame = this._renderService.addRefreshCallback(() => {
            this._doRefreshDecorations(), this._animationFrame = void 0;
          }));
        }
        _doRefreshDecorations() {
          for (const e4 of this._decorationService.decorations) this._renderDecoration(e4);
          this._dimensionsChanged = false;
        }
        _renderDecoration(e4) {
          this._refreshStyle(e4), this._dimensionsChanged && this._refreshXPosition(e4);
        }
        _createElement(e4) {
          const t4 = this._coreBrowserService.mainDocument.createElement("div");
          t4.classList.add("xterm-decoration"), t4.classList.toggle("xterm-decoration-top-layer", "top" === e4?.options?.layer), t4.style.width = `${Math.round((e4.options.width || 1) * this._renderService.dimensions.css.cell.width)}px`, t4.style.height = (e4.options.height || 1) * this._renderService.dimensions.css.cell.height + "px", t4.style.top = (e4.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.css.cell.height + "px", t4.style.lineHeight = `${this._renderService.dimensions.css.cell.height}px`;
          const i4 = e4.options.x ?? 0;
          return i4 && i4 > this._bufferService.cols && (t4.style.display = "none"), this._refreshXPosition(e4, t4), t4;
        }
        _refreshStyle(e4) {
          const t4 = e4.marker.line - this._bufferService.buffers.active.ydisp;
          if (t4 < 0 || t4 >= this._bufferService.rows) e4.element && (e4.element.style.display = "none", e4.onRenderEmitter.fire(e4.element));
          else {
            let i4 = this._decorationElements.get(e4);
            i4 || (i4 = this._createElement(e4), e4.element = i4, this._decorationElements.set(e4, i4), this._container.appendChild(i4), e4.onDispose(() => {
              this._decorationElements.delete(e4), i4.remove();
            })), i4.style.top = t4 * this._renderService.dimensions.css.cell.height + "px", i4.style.display = this._altBufferIsActive ? "none" : "block", e4.onRenderEmitter.fire(i4);
          }
        }
        _refreshXPosition(e4, t4 = e4.element) {
          if (!t4) return;
          const i4 = e4.options.x ?? 0;
          "right" === (e4.options.anchor || "left") ? t4.style.right = i4 ? i4 * this._renderService.dimensions.css.cell.width + "px" : "" : t4.style.left = i4 ? i4 * this._renderService.dimensions.css.cell.width + "px" : "";
        }
        _removeDecoration(e4) {
          this._decorationElements.get(e4)?.remove(), this._decorationElements.delete(e4), e4.dispose();
        }
      };
      t3.BufferDecorationRenderer = h2 = s2([r(1, a.IBufferService), r(2, n.ICoreBrowserService), r(3, a.IDecorationService), r(4, n.IRenderService)], h2);
    }, 5871: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.ColorZoneStore = void 0, t3.ColorZoneStore = class {
        constructor() {
          this._zones = [], this._zonePool = [], this._zonePoolIndex = 0, this._linePadding = { full: 0, left: 0, center: 0, right: 0 };
        }
        get zones() {
          return this._zonePool.length = Math.min(this._zonePool.length, this._zones.length), this._zones;
        }
        clear() {
          this._zones.length = 0, this._zonePoolIndex = 0;
        }
        addDecoration(e4) {
          if (e4.options.overviewRulerOptions) {
            for (const t4 of this._zones) if (t4.color === e4.options.overviewRulerOptions.color && t4.position === e4.options.overviewRulerOptions.position) {
              if (this._lineIntersectsZone(t4, e4.marker.line)) return;
              if (this._lineAdjacentToZone(t4, e4.marker.line, e4.options.overviewRulerOptions.position)) return void this._addLineToZone(t4, e4.marker.line);
            }
            if (this._zonePoolIndex < this._zonePool.length) return this._zonePool[this._zonePoolIndex].color = e4.options.overviewRulerOptions.color, this._zonePool[this._zonePoolIndex].position = e4.options.overviewRulerOptions.position, this._zonePool[this._zonePoolIndex].startBufferLine = e4.marker.line, this._zonePool[this._zonePoolIndex].endBufferLine = e4.marker.line, void this._zones.push(this._zonePool[this._zonePoolIndex++]);
            this._zones.push({ color: e4.options.overviewRulerOptions.color, position: e4.options.overviewRulerOptions.position, startBufferLine: e4.marker.line, endBufferLine: e4.marker.line }), this._zonePool.push(this._zones[this._zones.length - 1]), this._zonePoolIndex++;
          }
        }
        setPadding(e4) {
          this._linePadding = e4;
        }
        _lineIntersectsZone(e4, t4) {
          return t4 >= e4.startBufferLine && t4 <= e4.endBufferLine;
        }
        _lineAdjacentToZone(e4, t4, i3) {
          return t4 >= e4.startBufferLine - this._linePadding[i3 || "full"] && t4 <= e4.endBufferLine + this._linePadding[i3 || "full"];
        }
        _addLineToZone(e4, t4) {
          e4.startBufferLine = Math.min(e4.startBufferLine, t4), e4.endBufferLine = Math.max(e4.endBufferLine, t4);
        }
      };
    }, 5744: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.OverviewRulerRenderer = void 0;
      const n = i3(5871), o = i3(4725), a = i3(844), h2 = i3(2585), c = { full: 0, left: 0, center: 0, right: 0 }, l = { full: 0, left: 0, center: 0, right: 0 }, d = { full: 0, left: 0, center: 0, right: 0 };
      let _2 = t3.OverviewRulerRenderer = class extends a.Disposable {
        get _width() {
          return this._optionsService.options.overviewRulerWidth || 0;
        }
        constructor(e4, t4, i4, s3, r2, o2, h3) {
          super(), this._viewportElement = e4, this._screenElement = t4, this._bufferService = i4, this._decorationService = s3, this._renderService = r2, this._optionsService = o2, this._coreBrowserService = h3, this._colorZoneStore = new n.ColorZoneStore(), this._shouldUpdateDimensions = true, this._shouldUpdateAnchor = true, this._lastKnownBufferLength = 0, this._canvas = this._coreBrowserService.mainDocument.createElement("canvas"), this._canvas.classList.add("xterm-decoration-overview-ruler"), this._refreshCanvasDimensions(), this._viewportElement.parentElement?.insertBefore(this._canvas, this._viewportElement);
          const c2 = this._canvas.getContext("2d");
          if (!c2) throw new Error("Ctx cannot be null");
          this._ctx = c2, this._registerDecorationListeners(), this._registerBufferChangeListeners(), this._registerDimensionChangeListeners(), this.register((0, a.toDisposable)(() => {
            this._canvas?.remove();
          }));
        }
        _registerDecorationListeners() {
          this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(void 0, true))), this.register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(void 0, true)));
        }
        _registerBufferChangeListeners() {
          this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh())), this.register(this._bufferService.buffers.onBufferActivate(() => {
            this._canvas.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? "none" : "block";
          })), this.register(this._bufferService.onScroll(() => {
            this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length && (this._refreshDrawHeightConstants(), this._refreshColorZonePadding());
          }));
        }
        _registerDimensionChangeListeners() {
          this.register(this._renderService.onRender(() => {
            this._containerHeight && this._containerHeight === this._screenElement.clientHeight || (this._queueRefresh(true), this._containerHeight = this._screenElement.clientHeight);
          })), this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth", () => this._queueRefresh(true))), this.register(this._coreBrowserService.onDprChange(() => this._queueRefresh(true))), this._queueRefresh(true);
        }
        _refreshDrawConstants() {
          const e4 = Math.floor(this._canvas.width / 3), t4 = Math.ceil(this._canvas.width / 3);
          l.full = this._canvas.width, l.left = e4, l.center = t4, l.right = e4, this._refreshDrawHeightConstants(), d.full = 0, d.left = 0, d.center = l.left, d.right = l.left + l.center;
        }
        _refreshDrawHeightConstants() {
          c.full = Math.round(2 * this._coreBrowserService.dpr);
          const e4 = this._canvas.height / this._bufferService.buffer.lines.length, t4 = Math.round(Math.max(Math.min(e4, 12), 6) * this._coreBrowserService.dpr);
          c.left = t4, c.center = t4, c.right = t4;
        }
        _refreshColorZonePadding() {
          this._colorZoneStore.setPadding({ full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * c.full), left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * c.left), center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * c.center), right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * c.right) }), this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length;
        }
        _refreshCanvasDimensions() {
          this._canvas.style.width = `${this._width}px`, this._canvas.width = Math.round(this._width * this._coreBrowserService.dpr), this._canvas.style.height = `${this._screenElement.clientHeight}px`, this._canvas.height = Math.round(this._screenElement.clientHeight * this._coreBrowserService.dpr), this._refreshDrawConstants(), this._refreshColorZonePadding();
        }
        _refreshDecorations() {
          this._shouldUpdateDimensions && this._refreshCanvasDimensions(), this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height), this._colorZoneStore.clear();
          for (const e5 of this._decorationService.decorations) this._colorZoneStore.addDecoration(e5);
          this._ctx.lineWidth = 1;
          const e4 = this._colorZoneStore.zones;
          for (const t4 of e4) "full" !== t4.position && this._renderColorZone(t4);
          for (const t4 of e4) "full" === t4.position && this._renderColorZone(t4);
          this._shouldUpdateDimensions = false, this._shouldUpdateAnchor = false;
        }
        _renderColorZone(e4) {
          this._ctx.fillStyle = e4.color, this._ctx.fillRect(d[e4.position || "full"], Math.round((this._canvas.height - 1) * (e4.startBufferLine / this._bufferService.buffers.active.lines.length) - c[e4.position || "full"] / 2), l[e4.position || "full"], Math.round((this._canvas.height - 1) * ((e4.endBufferLine - e4.startBufferLine) / this._bufferService.buffers.active.lines.length) + c[e4.position || "full"]));
        }
        _queueRefresh(e4, t4) {
          this._shouldUpdateDimensions = e4 || this._shouldUpdateDimensions, this._shouldUpdateAnchor = t4 || this._shouldUpdateAnchor, void 0 === this._animationFrame && (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
            this._refreshDecorations(), this._animationFrame = void 0;
          }));
        }
      };
      t3.OverviewRulerRenderer = _2 = s2([r(2, h2.IBufferService), r(3, h2.IDecorationService), r(4, o.IRenderService), r(5, h2.IOptionsService), r(6, o.ICoreBrowserService)], _2);
    }, 2950: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CompositionHelper = void 0;
      const n = i3(4725), o = i3(2585), a = i3(2584);
      let h2 = t3.CompositionHelper = class {
        get isComposing() {
          return this._isComposing;
        }
        constructor(e4, t4, i4, s3, r2, n2) {
          this._textarea = e4, this._compositionView = t4, this._bufferService = i4, this._optionsService = s3, this._coreService = r2, this._renderService = n2, this._isComposing = false, this._isSendingComposition = false, this._compositionPosition = { start: 0, end: 0 }, this._dataAlreadySent = "";
        }
        compositionstart() {
          this._isComposing = true, this._compositionPosition.start = this._textarea.value.length, this._compositionView.textContent = "", this._dataAlreadySent = "", this._compositionView.classList.add("active");
        }
        compositionupdate(e4) {
          this._compositionView.textContent = e4.data, this.updateCompositionElements(), setTimeout(() => {
            this._compositionPosition.end = this._textarea.value.length;
          }, 0);
        }
        compositionend() {
          this._finalizeComposition(true);
        }
        keydown(e4) {
          if (this._isComposing || this._isSendingComposition) {
            if (229 === e4.keyCode) return false;
            if (16 === e4.keyCode || 17 === e4.keyCode || 18 === e4.keyCode) return false;
            this._finalizeComposition(false);
          }
          return 229 !== e4.keyCode || (this._handleAnyTextareaChanges(), false);
        }
        _finalizeComposition(e4) {
          if (this._compositionView.classList.remove("active"), this._isComposing = false, e4) {
            const e5 = { start: this._compositionPosition.start, end: this._compositionPosition.end };
            this._isSendingComposition = true, setTimeout(() => {
              if (this._isSendingComposition) {
                let t4;
                this._isSendingComposition = false, e5.start += this._dataAlreadySent.length, t4 = this._isComposing ? this._textarea.value.substring(e5.start, e5.end) : this._textarea.value.substring(e5.start), t4.length > 0 && this._coreService.triggerDataEvent(t4, true);
              }
            }, 0);
          } else {
            this._isSendingComposition = false;
            const e5 = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end);
            this._coreService.triggerDataEvent(e5, true);
          }
        }
        _handleAnyTextareaChanges() {
          const e4 = this._textarea.value;
          setTimeout(() => {
            if (!this._isComposing) {
              const t4 = this._textarea.value, i4 = t4.replace(e4, "");
              this._dataAlreadySent = i4, t4.length > e4.length ? this._coreService.triggerDataEvent(i4, true) : t4.length < e4.length ? this._coreService.triggerDataEvent(`${a.C0.DEL}`, true) : t4.length === e4.length && t4 !== e4 && this._coreService.triggerDataEvent(t4, true);
            }
          }, 0);
        }
        updateCompositionElements(e4) {
          if (this._isComposing) {
            if (this._bufferService.buffer.isCursorInViewport) {
              const e5 = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1), t4 = this._renderService.dimensions.css.cell.height, i4 = this._bufferService.buffer.y * this._renderService.dimensions.css.cell.height, s3 = e5 * this._renderService.dimensions.css.cell.width;
              this._compositionView.style.left = s3 + "px", this._compositionView.style.top = i4 + "px", this._compositionView.style.height = t4 + "px", this._compositionView.style.lineHeight = t4 + "px", this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + "px";
              const r2 = this._compositionView.getBoundingClientRect();
              this._textarea.style.left = s3 + "px", this._textarea.style.top = i4 + "px", this._textarea.style.width = Math.max(r2.width, 1) + "px", this._textarea.style.height = Math.max(r2.height, 1) + "px", this._textarea.style.lineHeight = r2.height + "px";
            }
            e4 || setTimeout(() => this.updateCompositionElements(true), 0);
          }
        }
      };
      t3.CompositionHelper = h2 = s2([r(2, o.IBufferService), r(3, o.IOptionsService), r(4, o.ICoreService), r(5, n.IRenderService)], h2);
    }, 9806: (e3, t3) => {
      function i3(e4, t4, i4) {
        const s2 = i4.getBoundingClientRect(), r = e4.getComputedStyle(i4), n = parseInt(r.getPropertyValue("padding-left")), o = parseInt(r.getPropertyValue("padding-top"));
        return [t4.clientX - s2.left - n, t4.clientY - s2.top - o];
      }
      __name(i3, "i");
      Object.defineProperty(t3, "__esModule", { value: true }), t3.getCoords = t3.getCoordsRelativeToElement = void 0, t3.getCoordsRelativeToElement = i3, t3.getCoords = function(e4, t4, s2, r, n, o, a, h2, c) {
        if (!o) return;
        const l = i3(e4, t4, s2);
        return l ? (l[0] = Math.ceil((l[0] + (c ? a / 2 : 0)) / a), l[1] = Math.ceil(l[1] / h2), l[0] = Math.min(Math.max(l[0], 1), r + (c ? 1 : 0)), l[1] = Math.min(Math.max(l[1], 1), n), l) : void 0;
      };
    }, 9504: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.moveToCellSequence = void 0;
      const s2 = i3(2584);
      function r(e4, t4, i4, s3) {
        const r2 = e4 - n(e4, i4), a2 = t4 - n(t4, i4), l = Math.abs(r2 - a2) - function(e5, t5, i5) {
          let s4 = 0;
          const r3 = e5 - n(e5, i5), a3 = t5 - n(t5, i5);
          for (let n2 = 0; n2 < Math.abs(r3 - a3); n2++) {
            const a4 = "A" === o(e5, t5) ? -1 : 1, h3 = i5.buffer.lines.get(r3 + a4 * n2);
            h3?.isWrapped && s4++;
          }
          return s4;
        }(e4, t4, i4);
        return c(l, h2(o(e4, t4), s3));
      }
      __name(r, "r");
      function n(e4, t4) {
        let i4 = 0, s3 = t4.buffer.lines.get(e4), r2 = s3?.isWrapped;
        for (; r2 && e4 >= 0 && e4 < t4.rows; ) i4++, s3 = t4.buffer.lines.get(--e4), r2 = s3?.isWrapped;
        return i4;
      }
      __name(n, "n");
      function o(e4, t4) {
        return e4 > t4 ? "A" : "B";
      }
      __name(o, "o");
      function a(e4, t4, i4, s3, r2, n2) {
        let o2 = e4, a2 = t4, h3 = "";
        for (; o2 !== i4 || a2 !== s3; ) o2 += r2 ? 1 : -1, r2 && o2 > n2.cols - 1 ? (h3 += n2.buffer.translateBufferLineToString(a2, false, e4, o2), o2 = 0, e4 = 0, a2++) : !r2 && o2 < 0 && (h3 += n2.buffer.translateBufferLineToString(a2, false, 0, e4 + 1), o2 = n2.cols - 1, e4 = o2, a2--);
        return h3 + n2.buffer.translateBufferLineToString(a2, false, e4, o2);
      }
      __name(a, "a");
      function h2(e4, t4) {
        const i4 = t4 ? "O" : "[";
        return s2.C0.ESC + i4 + e4;
      }
      __name(h2, "h");
      function c(e4, t4) {
        e4 = Math.floor(e4);
        let i4 = "";
        for (let s3 = 0; s3 < e4; s3++) i4 += t4;
        return i4;
      }
      __name(c, "c");
      t3.moveToCellSequence = function(e4, t4, i4, s3) {
        const o2 = i4.buffer.x, l = i4.buffer.y;
        if (!i4.buffer.hasScrollback) return function(e5, t5, i5, s4, o3, l2) {
          return 0 === r(t5, s4, o3, l2).length ? "" : c(a(e5, t5, e5, t5 - n(t5, o3), false, o3).length, h2("D", l2));
        }(o2, l, 0, t4, i4, s3) + r(l, t4, i4, s3) + function(e5, t5, i5, s4, o3, l2) {
          let d2;
          d2 = r(t5, s4, o3, l2).length > 0 ? s4 - n(s4, o3) : t5;
          const _3 = s4, u = function(e6, t6, i6, s5, o4, a2) {
            let h3;
            return h3 = r(i6, s5, o4, a2).length > 0 ? s5 - n(s5, o4) : t6, e6 < i6 && h3 <= s5 || e6 >= i6 && h3 < s5 ? "C" : "D";
          }(e5, t5, i5, s4, o3, l2);
          return c(a(e5, d2, i5, _3, "C" === u, o3).length, h2(u, l2));
        }(o2, l, e4, t4, i4, s3);
        let d;
        if (l === t4) return d = o2 > e4 ? "D" : "C", c(Math.abs(o2 - e4), h2(d, s3));
        d = l > t4 ? "D" : "C";
        const _2 = Math.abs(l - t4);
        return c(function(e5, t5) {
          return t5.cols - e5;
        }(l > t4 ? e4 : o2, i4) + (_2 - 1) * i4.cols + 1 + ((l > t4 ? o2 : e4) - 1), h2(d, s3));
      };
    }, 1296: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.DomRenderer = void 0;
      const n = i3(3787), o = i3(2550), a = i3(2223), h2 = i3(6171), c = i3(6052), l = i3(4725), d = i3(8055), _2 = i3(8460), u = i3(844), f = i3(2585), v2 = "xterm-dom-renderer-owner-", p2 = "xterm-rows", g2 = "xterm-fg-", m = "xterm-bg-", S = "xterm-focus", C = "xterm-selection";
      let b = 1, w = t3.DomRenderer = class extends u.Disposable {
        constructor(e4, t4, i4, s3, r2, a2, l2, d2, f2, g3, m2, S2, w2) {
          super(), this._terminal = e4, this._document = t4, this._element = i4, this._screenElement = s3, this._viewportElement = r2, this._helperContainer = a2, this._linkifier2 = l2, this._charSizeService = f2, this._optionsService = g3, this._bufferService = m2, this._coreBrowserService = S2, this._themeService = w2, this._terminalClass = b++, this._rowElements = [], this._selectionRenderModel = (0, c.createSelectionRenderModel)(), this.onRequestRedraw = this.register(new _2.EventEmitter()).event, this._rowContainer = this._document.createElement("div"), this._rowContainer.classList.add(p2), this._rowContainer.style.lineHeight = "normal", this._rowContainer.setAttribute("aria-hidden", "true"), this._refreshRowElements(this._bufferService.cols, this._bufferService.rows), this._selectionContainer = this._document.createElement("div"), this._selectionContainer.classList.add(C), this._selectionContainer.setAttribute("aria-hidden", "true"), this.dimensions = (0, h2.createRenderDimensions)(), this._updateDimensions(), this.register(this._optionsService.onOptionChange(() => this._handleOptionsChanged())), this.register(this._themeService.onChangeColors((e5) => this._injectCss(e5))), this._injectCss(this._themeService.colors), this._rowFactory = d2.createInstance(n.DomRendererRowFactory, document), this._element.classList.add(v2 + this._terminalClass), this._screenElement.appendChild(this._rowContainer), this._screenElement.appendChild(this._selectionContainer), this.register(this._linkifier2.onShowLinkUnderline((e5) => this._handleLinkHover(e5))), this.register(this._linkifier2.onHideLinkUnderline((e5) => this._handleLinkLeave(e5))), this.register((0, u.toDisposable)(() => {
            this._element.classList.remove(v2 + this._terminalClass), this._rowContainer.remove(), this._selectionContainer.remove(), this._widthCache.dispose(), this._themeStyleElement.remove(), this._dimensionsStyleElement.remove();
          })), this._widthCache = new o.WidthCache(this._document, this._helperContainer), this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize, this._optionsService.rawOptions.fontWeight, this._optionsService.rawOptions.fontWeightBold), this._setDefaultSpacing();
        }
        _updateDimensions() {
          const e4 = this._coreBrowserService.dpr;
          this.dimensions.device.char.width = this._charSizeService.width * e4, this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * e4), this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing), this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight), this.dimensions.device.char.left = 0, this.dimensions.device.char.top = 0, this.dimensions.device.canvas.width = this.dimensions.device.cell.width * this._bufferService.cols, this.dimensions.device.canvas.height = this.dimensions.device.cell.height * this._bufferService.rows, this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / e4), this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / e4), this.dimensions.css.cell.width = this.dimensions.css.canvas.width / this._bufferService.cols, this.dimensions.css.cell.height = this.dimensions.css.canvas.height / this._bufferService.rows;
          for (const e5 of this._rowElements) e5.style.width = `${this.dimensions.css.canvas.width}px`, e5.style.height = `${this.dimensions.css.cell.height}px`, e5.style.lineHeight = `${this.dimensions.css.cell.height}px`, e5.style.overflow = "hidden";
          this._dimensionsStyleElement || (this._dimensionsStyleElement = this._document.createElement("style"), this._screenElement.appendChild(this._dimensionsStyleElement));
          const t4 = `${this._terminalSelector} .${p2} span { display: inline-block; height: 100%; vertical-align: top;}`;
          this._dimensionsStyleElement.textContent = t4, this._selectionContainer.style.height = this._viewportElement.style.height, this._screenElement.style.width = `${this.dimensions.css.canvas.width}px`, this._screenElement.style.height = `${this.dimensions.css.canvas.height}px`;
        }
        _injectCss(e4) {
          this._themeStyleElement || (this._themeStyleElement = this._document.createElement("style"), this._screenElement.appendChild(this._themeStyleElement));
          let t4 = `${this._terminalSelector} .${p2} { color: ${e4.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;
          t4 += `${this._terminalSelector} .${p2} .xterm-dim { color: ${d.color.multiplyOpacity(e4.foreground, 0.5).css};}`, t4 += `${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;
          const i4 = `blink_underline_${this._terminalClass}`, s3 = `blink_bar_${this._terminalClass}`, r2 = `blink_block_${this._terminalClass}`;
          t4 += `@keyframes ${i4} { 50% {  border-bottom-style: hidden; }}`, t4 += `@keyframes ${s3} { 50% {  box-shadow: none; }}`, t4 += `@keyframes ${r2} { 0% {  background-color: ${e4.cursor.css};  color: ${e4.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${e4.cursor.css}; }}`, t4 += `${this._terminalSelector} .${p2}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i4} 1s step-end infinite;}${this._terminalSelector} .${p2}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s3} 1s step-end infinite;}${this._terminalSelector} .${p2}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r2} 1s step-end infinite;}${this._terminalSelector} .${p2} .xterm-cursor.xterm-cursor-block { background-color: ${e4.cursor.css}; color: ${e4.cursorAccent.css};}${this._terminalSelector} .${p2} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e4.cursor.css} !important; color: ${e4.cursorAccent.css} !important;}${this._terminalSelector} .${p2} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e4.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${p2} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e4.cursor.css} inset;}${this._terminalSelector} .${p2} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e4.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`, t4 += `${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${e4.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${e4.selectionInactiveBackgroundOpaque.css};}`;
          for (const [i5, s4] of e4.ansi.entries()) t4 += `${this._terminalSelector} .${g2}${i5} { color: ${s4.css}; }${this._terminalSelector} .${g2}${i5}.xterm-dim { color: ${d.color.multiplyOpacity(s4, 0.5).css}; }${this._terminalSelector} .${m}${i5} { background-color: ${s4.css}; }`;
          t4 += `${this._terminalSelector} .${g2}${a.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(e4.background).css}; }${this._terminalSelector} .${g2}${a.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(e4.background), 0.5).css}; }${this._terminalSelector} .${m}${a.INVERTED_DEFAULT_COLOR} { background-color: ${e4.foreground.css}; }`, this._themeStyleElement.textContent = t4;
        }
        _setDefaultSpacing() {
          const e4 = this.dimensions.css.cell.width - this._widthCache.get("W", false, false);
          this._rowContainer.style.letterSpacing = `${e4}px`, this._rowFactory.defaultSpacing = e4;
        }
        handleDevicePixelRatioChange() {
          this._updateDimensions(), this._widthCache.clear(), this._setDefaultSpacing();
        }
        _refreshRowElements(e4, t4) {
          for (let e5 = this._rowElements.length; e5 <= t4; e5++) {
            const e6 = this._document.createElement("div");
            this._rowContainer.appendChild(e6), this._rowElements.push(e6);
          }
          for (; this._rowElements.length > t4; ) this._rowContainer.removeChild(this._rowElements.pop());
        }
        handleResize(e4, t4) {
          this._refreshRowElements(e4, t4), this._updateDimensions(), this.handleSelectionChanged(this._selectionRenderModel.selectionStart, this._selectionRenderModel.selectionEnd, this._selectionRenderModel.columnSelectMode);
        }
        handleCharSizeChanged() {
          this._updateDimensions(), this._widthCache.clear(), this._setDefaultSpacing();
        }
        handleBlur() {
          this._rowContainer.classList.remove(S), this.renderRows(0, this._bufferService.rows - 1);
        }
        handleFocus() {
          this._rowContainer.classList.add(S), this.renderRows(this._bufferService.buffer.y, this._bufferService.buffer.y);
        }
        handleSelectionChanged(e4, t4, i4) {
          if (this._selectionContainer.replaceChildren(), this._rowFactory.handleSelectionChanged(e4, t4, i4), this.renderRows(0, this._bufferService.rows - 1), !e4 || !t4) return;
          this._selectionRenderModel.update(this._terminal, e4, t4, i4);
          const s3 = this._selectionRenderModel.viewportStartRow, r2 = this._selectionRenderModel.viewportEndRow, n2 = this._selectionRenderModel.viewportCappedStartRow, o2 = this._selectionRenderModel.viewportCappedEndRow;
          if (n2 >= this._bufferService.rows || o2 < 0) return;
          const a2 = this._document.createDocumentFragment();
          if (i4) {
            const i5 = e4[0] > t4[0];
            a2.appendChild(this._createSelectionElement(n2, i5 ? t4[0] : e4[0], i5 ? e4[0] : t4[0], o2 - n2 + 1));
          } else {
            const i5 = s3 === n2 ? e4[0] : 0, h3 = n2 === r2 ? t4[0] : this._bufferService.cols;
            a2.appendChild(this._createSelectionElement(n2, i5, h3));
            const c2 = o2 - n2 - 1;
            if (a2.appendChild(this._createSelectionElement(n2 + 1, 0, this._bufferService.cols, c2)), n2 !== o2) {
              const e5 = r2 === o2 ? t4[0] : this._bufferService.cols;
              a2.appendChild(this._createSelectionElement(o2, 0, e5));
            }
          }
          this._selectionContainer.appendChild(a2);
        }
        _createSelectionElement(e4, t4, i4, s3 = 1) {
          const r2 = this._document.createElement("div"), n2 = t4 * this.dimensions.css.cell.width;
          let o2 = this.dimensions.css.cell.width * (i4 - t4);
          return n2 + o2 > this.dimensions.css.canvas.width && (o2 = this.dimensions.css.canvas.width - n2), r2.style.height = s3 * this.dimensions.css.cell.height + "px", r2.style.top = e4 * this.dimensions.css.cell.height + "px", r2.style.left = `${n2}px`, r2.style.width = `${o2}px`, r2;
        }
        handleCursorMove() {
        }
        _handleOptionsChanged() {
          this._updateDimensions(), this._injectCss(this._themeService.colors), this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize, this._optionsService.rawOptions.fontWeight, this._optionsService.rawOptions.fontWeightBold), this._setDefaultSpacing();
        }
        clear() {
          for (const e4 of this._rowElements) e4.replaceChildren();
        }
        renderRows(e4, t4) {
          const i4 = this._bufferService.buffer, s3 = i4.ybase + i4.y, r2 = Math.min(i4.x, this._bufferService.cols - 1), n2 = this._optionsService.rawOptions.cursorBlink, o2 = this._optionsService.rawOptions.cursorStyle, a2 = this._optionsService.rawOptions.cursorInactiveStyle;
          for (let h3 = e4; h3 <= t4; h3++) {
            const e5 = h3 + i4.ydisp, t5 = this._rowElements[h3], c2 = i4.lines.get(e5);
            if (!t5 || !c2) break;
            t5.replaceChildren(...this._rowFactory.createRow(c2, e5, e5 === s3, o2, a2, r2, n2, this.dimensions.css.cell.width, this._widthCache, -1, -1));
          }
        }
        get _terminalSelector() {
          return `.${v2}${this._terminalClass}`;
        }
        _handleLinkHover(e4) {
          this._setCellUnderline(e4.x1, e4.x2, e4.y1, e4.y2, e4.cols, true);
        }
        _handleLinkLeave(e4) {
          this._setCellUnderline(e4.x1, e4.x2, e4.y1, e4.y2, e4.cols, false);
        }
        _setCellUnderline(e4, t4, i4, s3, r2, n2) {
          i4 < 0 && (e4 = 0), s3 < 0 && (t4 = 0);
          const o2 = this._bufferService.rows - 1;
          i4 = Math.max(Math.min(i4, o2), 0), s3 = Math.max(Math.min(s3, o2), 0), r2 = Math.min(r2, this._bufferService.cols);
          const a2 = this._bufferService.buffer, h3 = a2.ybase + a2.y, c2 = Math.min(a2.x, r2 - 1), l2 = this._optionsService.rawOptions.cursorBlink, d2 = this._optionsService.rawOptions.cursorStyle, _3 = this._optionsService.rawOptions.cursorInactiveStyle;
          for (let o3 = i4; o3 <= s3; ++o3) {
            const u2 = o3 + a2.ydisp, f2 = this._rowElements[o3], v3 = a2.lines.get(u2);
            if (!f2 || !v3) break;
            f2.replaceChildren(...this._rowFactory.createRow(v3, u2, u2 === h3, d2, _3, c2, l2, this.dimensions.css.cell.width, this._widthCache, n2 ? o3 === i4 ? e4 : 0 : -1, n2 ? (o3 === s3 ? t4 : r2) - 1 : -1));
          }
        }
      };
      t3.DomRenderer = w = s2([r(7, f.IInstantiationService), r(8, l.ICharSizeService), r(9, f.IOptionsService), r(10, f.IBufferService), r(11, l.ICoreBrowserService), r(12, l.IThemeService)], w);
    }, 3787: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.DomRendererRowFactory = void 0;
      const n = i3(2223), o = i3(643), a = i3(511), h2 = i3(2585), c = i3(8055), l = i3(4725), d = i3(4269), _2 = i3(6171), u = i3(3734);
      let f = t3.DomRendererRowFactory = class {
        constructor(e4, t4, i4, s3, r2, n2, o2) {
          this._document = e4, this._characterJoinerService = t4, this._optionsService = i4, this._coreBrowserService = s3, this._coreService = r2, this._decorationService = n2, this._themeService = o2, this._workCell = new a.CellData(), this._columnSelectMode = false, this.defaultSpacing = 0;
        }
        handleSelectionChanged(e4, t4, i4) {
          this._selectionStart = e4, this._selectionEnd = t4, this._columnSelectMode = i4;
        }
        createRow(e4, t4, i4, s3, r2, a2, h3, l2, _3, f2, p2) {
          const g2 = [], m = this._characterJoinerService.getJoinedCharacters(t4), S = this._themeService.colors;
          let C, b = e4.getNoBgTrimmedLength();
          i4 && b < a2 + 1 && (b = a2 + 1);
          let w = 0, y2 = "", E = 0, k = 0, L = 0, D = false, R = 0, x2 = false, A = 0;
          const B = [], T = -1 !== f2 && -1 !== p2;
          for (let M = 0; M < b; M++) {
            e4.loadCell(M, this._workCell);
            let b2 = this._workCell.getWidth();
            if (0 === b2) continue;
            let O = false, P2 = M, I = this._workCell;
            if (m.length > 0 && M === m[0][0]) {
              O = true;
              const t5 = m.shift();
              I = new d.JoinedCellData(this._workCell, e4.translateToString(true, t5[0], t5[1]), t5[1] - t5[0]), P2 = t5[1] - 1, b2 = I.getWidth();
            }
            const H = this._isCellInSelection(M, t4), F = i4 && M === a2, W = T && M >= f2 && M <= p2;
            let U = false;
            this._decorationService.forEachDecorationAtCell(M, t4, void 0, (e5) => {
              U = true;
            });
            let N = I.getChars() || o.WHITESPACE_CELL_CHAR;
            if (" " === N && (I.isUnderline() || I.isOverline()) && (N = " "), A = b2 * l2 - _3.get(N, I.isBold(), I.isItalic()), C) {
              if (w && (H && x2 || !H && !x2 && I.bg === E) && (H && x2 && S.selectionForeground || I.fg === k) && I.extended.ext === L && W === D && A === R && !F && !O && !U) {
                I.isInvisible() ? y2 += o.WHITESPACE_CELL_CHAR : y2 += N, w++;
                continue;
              }
              w && (C.textContent = y2), C = this._document.createElement("span"), w = 0, y2 = "";
            } else C = this._document.createElement("span");
            if (E = I.bg, k = I.fg, L = I.extended.ext, D = W, R = A, x2 = H, O && a2 >= M && a2 <= P2 && (a2 = M), !this._coreService.isCursorHidden && F && this._coreService.isCursorInitialized) {
              if (B.push("xterm-cursor"), this._coreBrowserService.isFocused) h3 && B.push("xterm-cursor-blink"), B.push("bar" === s3 ? "xterm-cursor-bar" : "underline" === s3 ? "xterm-cursor-underline" : "xterm-cursor-block");
              else if (r2) switch (r2) {
                case "outline":
                  B.push("xterm-cursor-outline");
                  break;
                case "block":
                  B.push("xterm-cursor-block");
                  break;
                case "bar":
                  B.push("xterm-cursor-bar");
                  break;
                case "underline":
                  B.push("xterm-cursor-underline");
              }
            }
            if (I.isBold() && B.push("xterm-bold"), I.isItalic() && B.push("xterm-italic"), I.isDim() && B.push("xterm-dim"), y2 = I.isInvisible() ? o.WHITESPACE_CELL_CHAR : I.getChars() || o.WHITESPACE_CELL_CHAR, I.isUnderline() && (B.push(`xterm-underline-${I.extended.underlineStyle}`), " " === y2 && (y2 = " "), !I.isUnderlineColorDefault())) if (I.isUnderlineColorRGB()) C.style.textDecorationColor = `rgb(${u.AttributeData.toColorRGB(I.getUnderlineColor()).join(",")})`;
            else {
              let e5 = I.getUnderlineColor();
              this._optionsService.rawOptions.drawBoldTextInBrightColors && I.isBold() && e5 < 8 && (e5 += 8), C.style.textDecorationColor = S.ansi[e5].css;
            }
            I.isOverline() && (B.push("xterm-overline"), " " === y2 && (y2 = " ")), I.isStrikethrough() && B.push("xterm-strikethrough"), W && (C.style.textDecoration = "underline");
            let $ = I.getFgColor(), j = I.getFgColorMode(), z2 = I.getBgColor(), K = I.getBgColorMode();
            const q = !!I.isInverse();
            if (q) {
              const e5 = $;
              $ = z2, z2 = e5;
              const t5 = j;
              j = K, K = t5;
            }
            let V, G, X, J = false;
            switch (this._decorationService.forEachDecorationAtCell(M, t4, void 0, (e5) => {
              "top" !== e5.options.layer && J || (e5.backgroundColorRGB && (K = 50331648, z2 = e5.backgroundColorRGB.rgba >> 8 & 16777215, V = e5.backgroundColorRGB), e5.foregroundColorRGB && (j = 50331648, $ = e5.foregroundColorRGB.rgba >> 8 & 16777215, G = e5.foregroundColorRGB), J = "top" === e5.options.layer);
            }), !J && H && (V = this._coreBrowserService.isFocused ? S.selectionBackgroundOpaque : S.selectionInactiveBackgroundOpaque, z2 = V.rgba >> 8 & 16777215, K = 50331648, J = true, S.selectionForeground && (j = 50331648, $ = S.selectionForeground.rgba >> 8 & 16777215, G = S.selectionForeground)), J && B.push("xterm-decoration-top"), K) {
              case 16777216:
              case 33554432:
                X = S.ansi[z2], B.push(`xterm-bg-${z2}`);
                break;
              case 50331648:
                X = c.channels.toColor(z2 >> 16, z2 >> 8 & 255, 255 & z2), this._addStyle(C, `background-color:#${v2((z2 >>> 0).toString(16), "0", 6)}`);
                break;
              default:
                q ? (X = S.foreground, B.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)) : X = S.background;
            }
            switch (V || I.isDim() && (V = c.color.multiplyOpacity(X, 0.5)), j) {
              case 16777216:
              case 33554432:
                I.isBold() && $ < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors && ($ += 8), this._applyMinimumContrast(C, X, S.ansi[$], I, V, void 0) || B.push(`xterm-fg-${$}`);
                break;
              case 50331648:
                const e5 = c.channels.toColor($ >> 16 & 255, $ >> 8 & 255, 255 & $);
                this._applyMinimumContrast(C, X, e5, I, V, G) || this._addStyle(C, `color:#${v2($.toString(16), "0", 6)}`);
                break;
              default:
                this._applyMinimumContrast(C, X, S.foreground, I, V, G) || q && B.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`);
            }
            B.length && (C.className = B.join(" "), B.length = 0), F || O || U ? C.textContent = y2 : w++, A !== this.defaultSpacing && (C.style.letterSpacing = `${A}px`), g2.push(C), M = P2;
          }
          return C && w && (C.textContent = y2), g2;
        }
        _applyMinimumContrast(e4, t4, i4, s3, r2, n2) {
          if (1 === this._optionsService.rawOptions.minimumContrastRatio || (0, _2.treatGlyphAsBackgroundColor)(s3.getCode())) return false;
          const o2 = this._getContrastCache(s3);
          let a2;
          if (r2 || n2 || (a2 = o2.getColor(t4.rgba, i4.rgba)), void 0 === a2) {
            const e5 = this._optionsService.rawOptions.minimumContrastRatio / (s3.isDim() ? 2 : 1);
            a2 = c.color.ensureContrastRatio(r2 || t4, n2 || i4, e5), o2.setColor((r2 || t4).rgba, (n2 || i4).rgba, a2 ?? null);
          }
          return !!a2 && (this._addStyle(e4, `color:${a2.css}`), true);
        }
        _getContrastCache(e4) {
          return e4.isDim() ? this._themeService.colors.halfContrastCache : this._themeService.colors.contrastCache;
        }
        _addStyle(e4, t4) {
          e4.setAttribute("style", `${e4.getAttribute("style") || ""}${t4};`);
        }
        _isCellInSelection(e4, t4) {
          const i4 = this._selectionStart, s3 = this._selectionEnd;
          return !(!i4 || !s3) && (this._columnSelectMode ? i4[0] <= s3[0] ? e4 >= i4[0] && t4 >= i4[1] && e4 < s3[0] && t4 <= s3[1] : e4 < i4[0] && t4 >= i4[1] && e4 >= s3[0] && t4 <= s3[1] : t4 > i4[1] && t4 < s3[1] || i4[1] === s3[1] && t4 === i4[1] && e4 >= i4[0] && e4 < s3[0] || i4[1] < s3[1] && t4 === s3[1] && e4 < s3[0] || i4[1] < s3[1] && t4 === i4[1] && e4 >= i4[0]);
        }
      };
      function v2(e4, t4, i4) {
        for (; e4.length < i4; ) e4 = t4 + e4;
        return e4;
      }
      __name(v2, "v");
      t3.DomRendererRowFactory = f = s2([r(1, l.ICharacterJoinerService), r(2, h2.IOptionsService), r(3, l.ICoreBrowserService), r(4, h2.ICoreService), r(5, h2.IDecorationService), r(6, l.IThemeService)], f);
    }, 2550: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.WidthCache = void 0, t3.WidthCache = class {
        constructor(e4, t4) {
          this._flat = new Float32Array(256), this._font = "", this._fontSize = 0, this._weight = "normal", this._weightBold = "bold", this._measureElements = [], this._container = e4.createElement("div"), this._container.classList.add("xterm-width-cache-measure-container"), this._container.setAttribute("aria-hidden", "true"), this._container.style.whiteSpace = "pre", this._container.style.fontKerning = "none";
          const i3 = e4.createElement("span");
          i3.classList.add("xterm-char-measure-element");
          const s2 = e4.createElement("span");
          s2.classList.add("xterm-char-measure-element"), s2.style.fontWeight = "bold";
          const r = e4.createElement("span");
          r.classList.add("xterm-char-measure-element"), r.style.fontStyle = "italic";
          const n = e4.createElement("span");
          n.classList.add("xterm-char-measure-element"), n.style.fontWeight = "bold", n.style.fontStyle = "italic", this._measureElements = [i3, s2, r, n], this._container.appendChild(i3), this._container.appendChild(s2), this._container.appendChild(r), this._container.appendChild(n), t4.appendChild(this._container), this.clear();
        }
        dispose() {
          this._container.remove(), this._measureElements.length = 0, this._holey = void 0;
        }
        clear() {
          this._flat.fill(-9999), this._holey = /* @__PURE__ */ new Map();
        }
        setFont(e4, t4, i3, s2) {
          e4 === this._font && t4 === this._fontSize && i3 === this._weight && s2 === this._weightBold || (this._font = e4, this._fontSize = t4, this._weight = i3, this._weightBold = s2, this._container.style.fontFamily = this._font, this._container.style.fontSize = `${this._fontSize}px`, this._measureElements[0].style.fontWeight = `${i3}`, this._measureElements[1].style.fontWeight = `${s2}`, this._measureElements[2].style.fontWeight = `${i3}`, this._measureElements[3].style.fontWeight = `${s2}`, this.clear());
        }
        get(e4, t4, i3) {
          let s2 = 0;
          if (!t4 && !i3 && 1 === e4.length && (s2 = e4.charCodeAt(0)) < 256) {
            if (-9999 !== this._flat[s2]) return this._flat[s2];
            const t5 = this._measure(e4, 0);
            return t5 > 0 && (this._flat[s2] = t5), t5;
          }
          let r = e4;
          t4 && (r += "B"), i3 && (r += "I");
          let n = this._holey.get(r);
          if (void 0 === n) {
            let s3 = 0;
            t4 && (s3 |= 1), i3 && (s3 |= 2), n = this._measure(e4, s3), n > 0 && this._holey.set(r, n);
          }
          return n;
        }
        _measure(e4, t4) {
          const i3 = this._measureElements[t4];
          return i3.textContent = e4.repeat(32), i3.offsetWidth / 32;
        }
      };
    }, 2223: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.TEXT_BASELINE = t3.DIM_OPACITY = t3.INVERTED_DEFAULT_COLOR = void 0;
      const s2 = i3(6114);
      t3.INVERTED_DEFAULT_COLOR = 257, t3.DIM_OPACITY = 0.5, t3.TEXT_BASELINE = s2.isFirefox || s2.isLegacyEdge ? "bottom" : "ideographic";
    }, 6171: (e3, t3) => {
      function i3(e4) {
        return 57508 <= e4 && e4 <= 57558;
      }
      __name(i3, "i");
      function s2(e4) {
        return e4 >= 128512 && e4 <= 128591 || e4 >= 127744 && e4 <= 128511 || e4 >= 128640 && e4 <= 128767 || e4 >= 9728 && e4 <= 9983 || e4 >= 9984 && e4 <= 10175 || e4 >= 65024 && e4 <= 65039 || e4 >= 129280 && e4 <= 129535 || e4 >= 127462 && e4 <= 127487;
      }
      __name(s2, "s");
      Object.defineProperty(t3, "__esModule", { value: true }), t3.computeNextVariantOffset = t3.createRenderDimensions = t3.treatGlyphAsBackgroundColor = t3.allowRescaling = t3.isEmoji = t3.isRestrictedPowerlineGlyph = t3.isPowerlineGlyph = t3.throwIfFalsy = void 0, t3.throwIfFalsy = function(e4) {
        if (!e4) throw new Error("value must not be falsy");
        return e4;
      }, t3.isPowerlineGlyph = i3, t3.isRestrictedPowerlineGlyph = function(e4) {
        return 57520 <= e4 && e4 <= 57527;
      }, t3.isEmoji = s2, t3.allowRescaling = function(e4, t4, r, n) {
        return 1 === t4 && r > Math.ceil(1.5 * n) && void 0 !== e4 && e4 > 255 && !s2(e4) && !i3(e4) && !function(e5) {
          return 57344 <= e5 && e5 <= 63743;
        }(e4);
      }, t3.treatGlyphAsBackgroundColor = function(e4) {
        return i3(e4) || function(e5) {
          return 9472 <= e5 && e5 <= 9631;
        }(e4);
      }, t3.createRenderDimensions = function() {
        return { css: { canvas: { width: 0, height: 0 }, cell: { width: 0, height: 0 } }, device: { canvas: { width: 0, height: 0 }, cell: { width: 0, height: 0 }, char: { width: 0, height: 0, left: 0, top: 0 } } };
      }, t3.computeNextVariantOffset = function(e4, t4, i4 = 0) {
        return (e4 - (2 * Math.round(t4) - i4)) % (2 * Math.round(t4));
      };
    }, 6052: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.createSelectionRenderModel = void 0;
      class i3 {
        static {
          __name(this, "i");
        }
        constructor() {
          this.clear();
        }
        clear() {
          this.hasSelection = false, this.columnSelectMode = false, this.viewportStartRow = 0, this.viewportEndRow = 0, this.viewportCappedStartRow = 0, this.viewportCappedEndRow = 0, this.startCol = 0, this.endCol = 0, this.selectionStart = void 0, this.selectionEnd = void 0;
        }
        update(e4, t4, i4, s2 = false) {
          if (this.selectionStart = t4, this.selectionEnd = i4, !t4 || !i4 || t4[0] === i4[0] && t4[1] === i4[1]) return void this.clear();
          const r = e4.buffers.active.ydisp, n = t4[1] - r, o = i4[1] - r, a = Math.max(n, 0), h2 = Math.min(o, e4.rows - 1);
          a >= e4.rows || h2 < 0 ? this.clear() : (this.hasSelection = true, this.columnSelectMode = s2, this.viewportStartRow = n, this.viewportEndRow = o, this.viewportCappedStartRow = a, this.viewportCappedEndRow = h2, this.startCol = t4[0], this.endCol = i4[0]);
        }
        isCellSelected(e4, t4, i4) {
          return !!this.hasSelection && (i4 -= e4.buffer.active.viewportY, this.columnSelectMode ? this.startCol <= this.endCol ? t4 >= this.startCol && i4 >= this.viewportCappedStartRow && t4 < this.endCol && i4 <= this.viewportCappedEndRow : t4 < this.startCol && i4 >= this.viewportCappedStartRow && t4 >= this.endCol && i4 <= this.viewportCappedEndRow : i4 > this.viewportStartRow && i4 < this.viewportEndRow || this.viewportStartRow === this.viewportEndRow && i4 === this.viewportStartRow && t4 >= this.startCol && t4 < this.endCol || this.viewportStartRow < this.viewportEndRow && i4 === this.viewportEndRow && t4 < this.endCol || this.viewportStartRow < this.viewportEndRow && i4 === this.viewportStartRow && t4 >= this.startCol);
        }
      }
      t3.createSelectionRenderModel = function() {
        return new i3();
      };
    }, 456: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.SelectionModel = void 0, t3.SelectionModel = class {
        constructor(e4) {
          this._bufferService = e4, this.isSelectAllActive = false, this.selectionStartLength = 0;
        }
        clearSelection() {
          this.selectionStart = void 0, this.selectionEnd = void 0, this.isSelectAllActive = false, this.selectionStartLength = 0;
        }
        get finalSelectionStart() {
          return this.isSelectAllActive ? [0, 0] : this.selectionEnd && this.selectionStart && this.areSelectionValuesReversed() ? this.selectionEnd : this.selectionStart;
        }
        get finalSelectionEnd() {
          if (this.isSelectAllActive) return [this._bufferService.cols, this._bufferService.buffer.ybase + this._bufferService.rows - 1];
          if (this.selectionStart) {
            if (!this.selectionEnd || this.areSelectionValuesReversed()) {
              const e4 = this.selectionStart[0] + this.selectionStartLength;
              return e4 > this._bufferService.cols ? e4 % this._bufferService.cols == 0 ? [this._bufferService.cols, this.selectionStart[1] + Math.floor(e4 / this._bufferService.cols) - 1] : [e4 % this._bufferService.cols, this.selectionStart[1] + Math.floor(e4 / this._bufferService.cols)] : [e4, this.selectionStart[1]];
            }
            if (this.selectionStartLength && this.selectionEnd[1] === this.selectionStart[1]) {
              const e4 = this.selectionStart[0] + this.selectionStartLength;
              return e4 > this._bufferService.cols ? [e4 % this._bufferService.cols, this.selectionStart[1] + Math.floor(e4 / this._bufferService.cols)] : [Math.max(e4, this.selectionEnd[0]), this.selectionEnd[1]];
            }
            return this.selectionEnd;
          }
        }
        areSelectionValuesReversed() {
          const e4 = this.selectionStart, t4 = this.selectionEnd;
          return !(!e4 || !t4) && (e4[1] > t4[1] || e4[1] === t4[1] && e4[0] > t4[0]);
        }
        handleTrim(e4) {
          return this.selectionStart && (this.selectionStart[1] -= e4), this.selectionEnd && (this.selectionEnd[1] -= e4), this.selectionEnd && this.selectionEnd[1] < 0 ? (this.clearSelection(), true) : (this.selectionStart && this.selectionStart[1] < 0 && (this.selectionStart[1] = 0), false);
        }
      };
    }, 428: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CharSizeService = void 0;
      const n = i3(2585), o = i3(8460), a = i3(844);
      let h2 = t3.CharSizeService = class extends a.Disposable {
        get hasValidSize() {
          return this.width > 0 && this.height > 0;
        }
        constructor(e4, t4, i4) {
          super(), this._optionsService = i4, this.width = 0, this.height = 0, this._onCharSizeChange = this.register(new o.EventEmitter()), this.onCharSizeChange = this._onCharSizeChange.event;
          try {
            this._measureStrategy = this.register(new d(this._optionsService));
          } catch {
            this._measureStrategy = this.register(new l(e4, t4, this._optionsService));
          }
          this.register(this._optionsService.onMultipleOptionChange(["fontFamily", "fontSize"], () => this.measure()));
        }
        measure() {
          const e4 = this._measureStrategy.measure();
          e4.width === this.width && e4.height === this.height || (this.width = e4.width, this.height = e4.height, this._onCharSizeChange.fire());
        }
      };
      t3.CharSizeService = h2 = s2([r(2, n.IOptionsService)], h2);
      class c extends a.Disposable {
        static {
          __name(this, "c");
        }
        constructor() {
          super(...arguments), this._result = { width: 0, height: 0 };
        }
        _validateAndSet(e4, t4) {
          void 0 !== e4 && e4 > 0 && void 0 !== t4 && t4 > 0 && (this._result.width = e4, this._result.height = t4);
        }
      }
      class l extends c {
        static {
          __name(this, "l");
        }
        constructor(e4, t4, i4) {
          super(), this._document = e4, this._parentElement = t4, this._optionsService = i4, this._measureElement = this._document.createElement("span"), this._measureElement.classList.add("xterm-char-measure-element"), this._measureElement.textContent = "W".repeat(32), this._measureElement.setAttribute("aria-hidden", "true"), this._measureElement.style.whiteSpace = "pre", this._measureElement.style.fontKerning = "none", this._parentElement.appendChild(this._measureElement);
        }
        measure() {
          return this._measureElement.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`, this._validateAndSet(Number(this._measureElement.offsetWidth) / 32, Number(this._measureElement.offsetHeight)), this._result;
        }
      }
      class d extends c {
        static {
          __name(this, "d");
        }
        constructor(e4) {
          super(), this._optionsService = e4, this._canvas = new OffscreenCanvas(100, 100), this._ctx = this._canvas.getContext("2d");
          const t4 = this._ctx.measureText("W");
          if (!("width" in t4 && "fontBoundingBoxAscent" in t4 && "fontBoundingBoxDescent" in t4)) throw new Error("Required font metrics not supported");
        }
        measure() {
          this._ctx.font = `${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;
          const e4 = this._ctx.measureText("W");
          return this._validateAndSet(e4.width, e4.fontBoundingBoxAscent + e4.fontBoundingBoxDescent), this._result;
        }
      }
    }, 4269: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CharacterJoinerService = t3.JoinedCellData = void 0;
      const n = i3(3734), o = i3(643), a = i3(511), h2 = i3(2585);
      class c extends n.AttributeData {
        static {
          __name(this, "c");
        }
        constructor(e4, t4, i4) {
          super(), this.content = 0, this.combinedData = "", this.fg = e4.fg, this.bg = e4.bg, this.combinedData = t4, this._width = i4;
        }
        isCombined() {
          return 2097152;
        }
        getWidth() {
          return this._width;
        }
        getChars() {
          return this.combinedData;
        }
        getCode() {
          return 2097151;
        }
        setFromCharData(e4) {
          throw new Error("not implemented");
        }
        getAsCharData() {
          return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
        }
      }
      t3.JoinedCellData = c;
      let l = t3.CharacterJoinerService = class e4 {
        static {
          __name(this, "e");
        }
        constructor(e5) {
          this._bufferService = e5, this._characterJoiners = [], this._nextCharacterJoinerId = 0, this._workCell = new a.CellData();
        }
        register(e5) {
          const t4 = { id: this._nextCharacterJoinerId++, handler: e5 };
          return this._characterJoiners.push(t4), t4.id;
        }
        deregister(e5) {
          for (let t4 = 0; t4 < this._characterJoiners.length; t4++) if (this._characterJoiners[t4].id === e5) return this._characterJoiners.splice(t4, 1), true;
          return false;
        }
        getJoinedCharacters(e5) {
          if (0 === this._characterJoiners.length) return [];
          const t4 = this._bufferService.buffer.lines.get(e5);
          if (!t4 || 0 === t4.length) return [];
          const i4 = [], s3 = t4.translateToString(true);
          let r2 = 0, n2 = 0, a2 = 0, h3 = t4.getFg(0), c2 = t4.getBg(0);
          for (let e6 = 0; e6 < t4.getTrimmedLength(); e6++) if (t4.loadCell(e6, this._workCell), 0 !== this._workCell.getWidth()) {
            if (this._workCell.fg !== h3 || this._workCell.bg !== c2) {
              if (e6 - r2 > 1) {
                const e7 = this._getJoinedRanges(s3, a2, n2, t4, r2);
                for (let t5 = 0; t5 < e7.length; t5++) i4.push(e7[t5]);
              }
              r2 = e6, a2 = n2, h3 = this._workCell.fg, c2 = this._workCell.bg;
            }
            n2 += this._workCell.getChars().length || o.WHITESPACE_CELL_CHAR.length;
          }
          if (this._bufferService.cols - r2 > 1) {
            const e6 = this._getJoinedRanges(s3, a2, n2, t4, r2);
            for (let t5 = 0; t5 < e6.length; t5++) i4.push(e6[t5]);
          }
          return i4;
        }
        _getJoinedRanges(t4, i4, s3, r2, n2) {
          const o2 = t4.substring(i4, s3);
          let a2 = [];
          try {
            a2 = this._characterJoiners[0].handler(o2);
          } catch (e5) {
            console.error(e5);
          }
          for (let t5 = 1; t5 < this._characterJoiners.length; t5++) try {
            const i5 = this._characterJoiners[t5].handler(o2);
            for (let t6 = 0; t6 < i5.length; t6++) e4._mergeRanges(a2, i5[t6]);
          } catch (e5) {
            console.error(e5);
          }
          return this._stringRangesToCellRanges(a2, r2, n2), a2;
        }
        _stringRangesToCellRanges(e5, t4, i4) {
          let s3 = 0, r2 = false, n2 = 0, a2 = e5[s3];
          if (a2) {
            for (let h3 = i4; h3 < this._bufferService.cols; h3++) {
              const i5 = t4.getWidth(h3), c2 = t4.getString(h3).length || o.WHITESPACE_CELL_CHAR.length;
              if (0 !== i5) {
                if (!r2 && a2[0] <= n2 && (a2[0] = h3, r2 = true), a2[1] <= n2) {
                  if (a2[1] = h3, a2 = e5[++s3], !a2) break;
                  a2[0] <= n2 ? (a2[0] = h3, r2 = true) : r2 = false;
                }
                n2 += c2;
              }
            }
            a2 && (a2[1] = this._bufferService.cols);
          }
        }
        static _mergeRanges(e5, t4) {
          let i4 = false;
          for (let s3 = 0; s3 < e5.length; s3++) {
            const r2 = e5[s3];
            if (i4) {
              if (t4[1] <= r2[0]) return e5[s3 - 1][1] = t4[1], e5;
              if (t4[1] <= r2[1]) return e5[s3 - 1][1] = Math.max(t4[1], r2[1]), e5.splice(s3, 1), e5;
              e5.splice(s3, 1), s3--;
            } else {
              if (t4[1] <= r2[0]) return e5.splice(s3, 0, t4), e5;
              if (t4[1] <= r2[1]) return r2[0] = Math.min(t4[0], r2[0]), e5;
              t4[0] < r2[1] && (r2[0] = Math.min(t4[0], r2[0]), i4 = true);
            }
          }
          return i4 ? e5[e5.length - 1][1] = t4[1] : e5.push(t4), e5;
        }
      };
      t3.CharacterJoinerService = l = s2([r(0, h2.IBufferService)], l);
    }, 5114: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CoreBrowserService = void 0;
      const s2 = i3(844), r = i3(8460), n = i3(3656);
      class o extends s2.Disposable {
        static {
          __name(this, "o");
        }
        constructor(e4, t4, i4) {
          super(), this._textarea = e4, this._window = t4, this.mainDocument = i4, this._isFocused = false, this._cachedIsFocused = void 0, this._screenDprMonitor = new a(this._window), this._onDprChange = this.register(new r.EventEmitter()), this.onDprChange = this._onDprChange.event, this._onWindowChange = this.register(new r.EventEmitter()), this.onWindowChange = this._onWindowChange.event, this.register(this.onWindowChange((e5) => this._screenDprMonitor.setWindow(e5))), this.register((0, r.forwardEvent)(this._screenDprMonitor.onDprChange, this._onDprChange)), this._textarea.addEventListener("focus", () => this._isFocused = true), this._textarea.addEventListener("blur", () => this._isFocused = false);
        }
        get window() {
          return this._window;
        }
        set window(e4) {
          this._window !== e4 && (this._window = e4, this._onWindowChange.fire(this._window));
        }
        get dpr() {
          return this.window.devicePixelRatio;
        }
        get isFocused() {
          return void 0 === this._cachedIsFocused && (this._cachedIsFocused = this._isFocused && this._textarea.ownerDocument.hasFocus(), queueMicrotask(() => this._cachedIsFocused = void 0)), this._cachedIsFocused;
        }
      }
      t3.CoreBrowserService = o;
      class a extends s2.Disposable {
        static {
          __name(this, "a");
        }
        constructor(e4) {
          super(), this._parentWindow = e4, this._windowResizeListener = this.register(new s2.MutableDisposable()), this._onDprChange = this.register(new r.EventEmitter()), this.onDprChange = this._onDprChange.event, this._outerListener = () => this._setDprAndFireIfDiffers(), this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio, this._updateDpr(), this._setWindowResizeListener(), this.register((0, s2.toDisposable)(() => this.clearListener()));
        }
        setWindow(e4) {
          this._parentWindow = e4, this._setWindowResizeListener(), this._setDprAndFireIfDiffers();
        }
        _setWindowResizeListener() {
          this._windowResizeListener.value = (0, n.addDisposableDomListener)(this._parentWindow, "resize", () => this._setDprAndFireIfDiffers());
        }
        _setDprAndFireIfDiffers() {
          this._parentWindow.devicePixelRatio !== this._currentDevicePixelRatio && this._onDprChange.fire(this._parentWindow.devicePixelRatio), this._updateDpr();
        }
        _updateDpr() {
          this._outerListener && (this._resolutionMediaMatchList?.removeListener(this._outerListener), this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio, this._resolutionMediaMatchList = this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`), this._resolutionMediaMatchList.addListener(this._outerListener));
        }
        clearListener() {
          this._resolutionMediaMatchList && this._outerListener && (this._resolutionMediaMatchList.removeListener(this._outerListener), this._resolutionMediaMatchList = void 0, this._outerListener = void 0);
        }
      }
    }, 779: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.LinkProviderService = void 0;
      const s2 = i3(844);
      class r extends s2.Disposable {
        static {
          __name(this, "r");
        }
        constructor() {
          super(), this.linkProviders = [], this.register((0, s2.toDisposable)(() => this.linkProviders.length = 0));
        }
        registerLinkProvider(e4) {
          return this.linkProviders.push(e4), { dispose: /* @__PURE__ */ __name(() => {
            const t4 = this.linkProviders.indexOf(e4);
            -1 !== t4 && this.linkProviders.splice(t4, 1);
          }, "dispose") };
        }
      }
      t3.LinkProviderService = r;
    }, 8934: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.MouseService = void 0;
      const n = i3(4725), o = i3(9806);
      let a = t3.MouseService = class {
        constructor(e4, t4) {
          this._renderService = e4, this._charSizeService = t4;
        }
        getCoords(e4, t4, i4, s3, r2) {
          return (0, o.getCoords)(window, e4, t4, i4, s3, this._charSizeService.hasValidSize, this._renderService.dimensions.css.cell.width, this._renderService.dimensions.css.cell.height, r2);
        }
        getMouseReportCoords(e4, t4) {
          const i4 = (0, o.getCoordsRelativeToElement)(window, e4, t4);
          if (this._charSizeService.hasValidSize) return i4[0] = Math.min(Math.max(i4[0], 0), this._renderService.dimensions.css.canvas.width - 1), i4[1] = Math.min(Math.max(i4[1], 0), this._renderService.dimensions.css.canvas.height - 1), { col: Math.floor(i4[0] / this._renderService.dimensions.css.cell.width), row: Math.floor(i4[1] / this._renderService.dimensions.css.cell.height), x: Math.floor(i4[0]), y: Math.floor(i4[1]) };
        }
      };
      t3.MouseService = a = s2([r(0, n.IRenderService), r(1, n.ICharSizeService)], a);
    }, 3230: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.RenderService = void 0;
      const n = i3(6193), o = i3(4725), a = i3(8460), h2 = i3(844), c = i3(7226), l = i3(2585);
      let d = t3.RenderService = class extends h2.Disposable {
        get dimensions() {
          return this._renderer.value.dimensions;
        }
        constructor(e4, t4, i4, s3, r2, o2, l2, d2) {
          super(), this._rowCount = e4, this._charSizeService = s3, this._renderer = this.register(new h2.MutableDisposable()), this._pausedResizeTask = new c.DebouncedIdleTask(), this._observerDisposable = this.register(new h2.MutableDisposable()), this._isPaused = false, this._needsFullRefresh = false, this._isNextRenderRedrawOnly = true, this._needsSelectionRefresh = false, this._canvasWidth = 0, this._canvasHeight = 0, this._selectionState = { start: void 0, end: void 0, columnSelectMode: false }, this._onDimensionsChange = this.register(new a.EventEmitter()), this.onDimensionsChange = this._onDimensionsChange.event, this._onRenderedViewportChange = this.register(new a.EventEmitter()), this.onRenderedViewportChange = this._onRenderedViewportChange.event, this._onRender = this.register(new a.EventEmitter()), this.onRender = this._onRender.event, this._onRefreshRequest = this.register(new a.EventEmitter()), this.onRefreshRequest = this._onRefreshRequest.event, this._renderDebouncer = new n.RenderDebouncer((e5, t5) => this._renderRows(e5, t5), l2), this.register(this._renderDebouncer), this.register(l2.onDprChange(() => this.handleDevicePixelRatioChange())), this.register(o2.onResize(() => this._fullRefresh())), this.register(o2.buffers.onBufferActivate(() => this._renderer.value?.clear())), this.register(i4.onOptionChange(() => this._handleOptionsChanged())), this.register(this._charSizeService.onCharSizeChange(() => this.handleCharSizeChanged())), this.register(r2.onDecorationRegistered(() => this._fullRefresh())), this.register(r2.onDecorationRemoved(() => this._fullRefresh())), this.register(i4.onMultipleOptionChange(["customGlyphs", "drawBoldTextInBrightColors", "letterSpacing", "lineHeight", "fontFamily", "fontSize", "fontWeight", "fontWeightBold", "minimumContrastRatio", "rescaleOverlappingGlyphs"], () => {
            this.clear(), this.handleResize(o2.cols, o2.rows), this._fullRefresh();
          })), this.register(i4.onMultipleOptionChange(["cursorBlink", "cursorStyle"], () => this.refreshRows(o2.buffer.y, o2.buffer.y, true))), this.register(d2.onChangeColors(() => this._fullRefresh())), this._registerIntersectionObserver(l2.window, t4), this.register(l2.onWindowChange((e5) => this._registerIntersectionObserver(e5, t4)));
        }
        _registerIntersectionObserver(e4, t4) {
          if ("IntersectionObserver" in e4) {
            const i4 = new e4.IntersectionObserver((e5) => this._handleIntersectionChange(e5[e5.length - 1]), { threshold: 0 });
            i4.observe(t4), this._observerDisposable.value = (0, h2.toDisposable)(() => i4.disconnect());
          }
        }
        _handleIntersectionChange(e4) {
          this._isPaused = void 0 === e4.isIntersecting ? 0 === e4.intersectionRatio : !e4.isIntersecting, this._isPaused || this._charSizeService.hasValidSize || this._charSizeService.measure(), !this._isPaused && this._needsFullRefresh && (this._pausedResizeTask.flush(), this.refreshRows(0, this._rowCount - 1), this._needsFullRefresh = false);
        }
        refreshRows(e4, t4, i4 = false) {
          this._isPaused ? this._needsFullRefresh = true : (i4 || (this._isNextRenderRedrawOnly = false), this._renderDebouncer.refresh(e4, t4, this._rowCount));
        }
        _renderRows(e4, t4) {
          this._renderer.value && (e4 = Math.min(e4, this._rowCount - 1), t4 = Math.min(t4, this._rowCount - 1), this._renderer.value.renderRows(e4, t4), this._needsSelectionRefresh && (this._renderer.value.handleSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode), this._needsSelectionRefresh = false), this._isNextRenderRedrawOnly || this._onRenderedViewportChange.fire({ start: e4, end: t4 }), this._onRender.fire({ start: e4, end: t4 }), this._isNextRenderRedrawOnly = true);
        }
        resize(e4, t4) {
          this._rowCount = t4, this._fireOnCanvasResize();
        }
        _handleOptionsChanged() {
          this._renderer.value && (this.refreshRows(0, this._rowCount - 1), this._fireOnCanvasResize());
        }
        _fireOnCanvasResize() {
          this._renderer.value && (this._renderer.value.dimensions.css.canvas.width === this._canvasWidth && this._renderer.value.dimensions.css.canvas.height === this._canvasHeight || this._onDimensionsChange.fire(this._renderer.value.dimensions));
        }
        hasRenderer() {
          return !!this._renderer.value;
        }
        setRenderer(e4) {
          this._renderer.value = e4, this._renderer.value && (this._renderer.value.onRequestRedraw((e5) => this.refreshRows(e5.start, e5.end, true)), this._needsSelectionRefresh = true, this._fullRefresh());
        }
        addRefreshCallback(e4) {
          return this._renderDebouncer.addRefreshCallback(e4);
        }
        _fullRefresh() {
          this._isPaused ? this._needsFullRefresh = true : this.refreshRows(0, this._rowCount - 1);
        }
        clearTextureAtlas() {
          this._renderer.value && (this._renderer.value.clearTextureAtlas?.(), this._fullRefresh());
        }
        handleDevicePixelRatioChange() {
          this._charSizeService.measure(), this._renderer.value && (this._renderer.value.handleDevicePixelRatioChange(), this.refreshRows(0, this._rowCount - 1));
        }
        handleResize(e4, t4) {
          this._renderer.value && (this._isPaused ? this._pausedResizeTask.set(() => this._renderer.value?.handleResize(e4, t4)) : this._renderer.value.handleResize(e4, t4), this._fullRefresh());
        }
        handleCharSizeChanged() {
          this._renderer.value?.handleCharSizeChanged();
        }
        handleBlur() {
          this._renderer.value?.handleBlur();
        }
        handleFocus() {
          this._renderer.value?.handleFocus();
        }
        handleSelectionChanged(e4, t4, i4) {
          this._selectionState.start = e4, this._selectionState.end = t4, this._selectionState.columnSelectMode = i4, this._renderer.value?.handleSelectionChanged(e4, t4, i4);
        }
        handleCursorMove() {
          this._renderer.value?.handleCursorMove();
        }
        clear() {
          this._renderer.value?.clear();
        }
      };
      t3.RenderService = d = s2([r(2, l.IOptionsService), r(3, o.ICharSizeService), r(4, l.IDecorationService), r(5, l.IBufferService), r(6, o.ICoreBrowserService), r(7, o.IThemeService)], d);
    }, 9312: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.SelectionService = void 0;
      const n = i3(9806), o = i3(9504), a = i3(456), h2 = i3(4725), c = i3(8460), l = i3(844), d = i3(6114), _2 = i3(4841), u = i3(511), f = i3(2585), v2 = String.fromCharCode(160), p2 = new RegExp(v2, "g");
      let g2 = t3.SelectionService = class extends l.Disposable {
        constructor(e4, t4, i4, s3, r2, n2, o2, h3, d2) {
          super(), this._element = e4, this._screenElement = t4, this._linkifier = i4, this._bufferService = s3, this._coreService = r2, this._mouseService = n2, this._optionsService = o2, this._renderService = h3, this._coreBrowserService = d2, this._dragScrollAmount = 0, this._enabled = true, this._workCell = new u.CellData(), this._mouseDownTimeStamp = 0, this._oldHasSelection = false, this._oldSelectionStart = void 0, this._oldSelectionEnd = void 0, this._onLinuxMouseSelection = this.register(new c.EventEmitter()), this.onLinuxMouseSelection = this._onLinuxMouseSelection.event, this._onRedrawRequest = this.register(new c.EventEmitter()), this.onRequestRedraw = this._onRedrawRequest.event, this._onSelectionChange = this.register(new c.EventEmitter()), this.onSelectionChange = this._onSelectionChange.event, this._onRequestScrollLines = this.register(new c.EventEmitter()), this.onRequestScrollLines = this._onRequestScrollLines.event, this._mouseMoveListener = (e5) => this._handleMouseMove(e5), this._mouseUpListener = (e5) => this._handleMouseUp(e5), this._coreService.onUserInput(() => {
            this.hasSelection && this.clearSelection();
          }), this._trimListener = this._bufferService.buffer.lines.onTrim((e5) => this._handleTrim(e5)), this.register(this._bufferService.buffers.onBufferActivate((e5) => this._handleBufferActivate(e5))), this.enable(), this._model = new a.SelectionModel(this._bufferService), this._activeSelectionMode = 0, this.register((0, l.toDisposable)(() => {
            this._removeMouseDownListeners();
          }));
        }
        reset() {
          this.clearSelection();
        }
        disable() {
          this.clearSelection(), this._enabled = false;
        }
        enable() {
          this._enabled = true;
        }
        get selectionStart() {
          return this._model.finalSelectionStart;
        }
        get selectionEnd() {
          return this._model.finalSelectionEnd;
        }
        get hasSelection() {
          const e4 = this._model.finalSelectionStart, t4 = this._model.finalSelectionEnd;
          return !(!e4 || !t4 || e4[0] === t4[0] && e4[1] === t4[1]);
        }
        get selectionText() {
          const e4 = this._model.finalSelectionStart, t4 = this._model.finalSelectionEnd;
          if (!e4 || !t4) return "";
          const i4 = this._bufferService.buffer, s3 = [];
          if (3 === this._activeSelectionMode) {
            if (e4[0] === t4[0]) return "";
            const r2 = e4[0] < t4[0] ? e4[0] : t4[0], n2 = e4[0] < t4[0] ? t4[0] : e4[0];
            for (let o2 = e4[1]; o2 <= t4[1]; o2++) {
              const e5 = i4.translateBufferLineToString(o2, true, r2, n2);
              s3.push(e5);
            }
          } else {
            const r2 = e4[1] === t4[1] ? t4[0] : void 0;
            s3.push(i4.translateBufferLineToString(e4[1], true, e4[0], r2));
            for (let r3 = e4[1] + 1; r3 <= t4[1] - 1; r3++) {
              const e5 = i4.lines.get(r3), t5 = i4.translateBufferLineToString(r3, true);
              e5?.isWrapped ? s3[s3.length - 1] += t5 : s3.push(t5);
            }
            if (e4[1] !== t4[1]) {
              const e5 = i4.lines.get(t4[1]), r3 = i4.translateBufferLineToString(t4[1], true, 0, t4[0]);
              e5 && e5.isWrapped ? s3[s3.length - 1] += r3 : s3.push(r3);
            }
          }
          return s3.map((e5) => e5.replace(p2, " ")).join(d.isWindows ? "\r\n" : "\n");
        }
        clearSelection() {
          this._model.clearSelection(), this._removeMouseDownListeners(), this.refresh(), this._onSelectionChange.fire();
        }
        refresh(e4) {
          this._refreshAnimationFrame || (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._refresh())), d.isLinux && e4 && this.selectionText.length && this._onLinuxMouseSelection.fire(this.selectionText);
        }
        _refresh() {
          this._refreshAnimationFrame = void 0, this._onRedrawRequest.fire({ start: this._model.finalSelectionStart, end: this._model.finalSelectionEnd, columnSelectMode: 3 === this._activeSelectionMode });
        }
        _isClickInSelection(e4) {
          const t4 = this._getMouseBufferCoords(e4), i4 = this._model.finalSelectionStart, s3 = this._model.finalSelectionEnd;
          return !!(i4 && s3 && t4) && this._areCoordsInSelection(t4, i4, s3);
        }
        isCellInSelection(e4, t4) {
          const i4 = this._model.finalSelectionStart, s3 = this._model.finalSelectionEnd;
          return !(!i4 || !s3) && this._areCoordsInSelection([e4, t4], i4, s3);
        }
        _areCoordsInSelection(e4, t4, i4) {
          return e4[1] > t4[1] && e4[1] < i4[1] || t4[1] === i4[1] && e4[1] === t4[1] && e4[0] >= t4[0] && e4[0] < i4[0] || t4[1] < i4[1] && e4[1] === i4[1] && e4[0] < i4[0] || t4[1] < i4[1] && e4[1] === t4[1] && e4[0] >= t4[0];
        }
        _selectWordAtCursor(e4, t4) {
          const i4 = this._linkifier.currentLink?.link?.range;
          if (i4) return this._model.selectionStart = [i4.start.x - 1, i4.start.y - 1], this._model.selectionStartLength = (0, _2.getRangeLength)(i4, this._bufferService.cols), this._model.selectionEnd = void 0, true;
          const s3 = this._getMouseBufferCoords(e4);
          return !!s3 && (this._selectWordAt(s3, t4), this._model.selectionEnd = void 0, true);
        }
        selectAll() {
          this._model.isSelectAllActive = true, this.refresh(), this._onSelectionChange.fire();
        }
        selectLines(e4, t4) {
          this._model.clearSelection(), e4 = Math.max(e4, 0), t4 = Math.min(t4, this._bufferService.buffer.lines.length - 1), this._model.selectionStart = [0, e4], this._model.selectionEnd = [this._bufferService.cols, t4], this.refresh(), this._onSelectionChange.fire();
        }
        _handleTrim(e4) {
          this._model.handleTrim(e4) && this.refresh();
        }
        _getMouseBufferCoords(e4) {
          const t4 = this._mouseService.getCoords(e4, this._screenElement, this._bufferService.cols, this._bufferService.rows, true);
          if (t4) return t4[0]--, t4[1]--, t4[1] += this._bufferService.buffer.ydisp, t4;
        }
        _getMouseEventScrollAmount(e4) {
          let t4 = (0, n.getCoordsRelativeToElement)(this._coreBrowserService.window, e4, this._screenElement)[1];
          const i4 = this._renderService.dimensions.css.canvas.height;
          return t4 >= 0 && t4 <= i4 ? 0 : (t4 > i4 && (t4 -= i4), t4 = Math.min(Math.max(t4, -50), 50), t4 /= 50, t4 / Math.abs(t4) + Math.round(14 * t4));
        }
        shouldForceSelection(e4) {
          return d.isMac ? e4.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection : e4.shiftKey;
        }
        handleMouseDown(e4) {
          if (this._mouseDownTimeStamp = e4.timeStamp, (2 !== e4.button || !this.hasSelection) && 0 === e4.button) {
            if (!this._enabled) {
              if (!this.shouldForceSelection(e4)) return;
              e4.stopPropagation();
            }
            e4.preventDefault(), this._dragScrollAmount = 0, this._enabled && e4.shiftKey ? this._handleIncrementalClick(e4) : 1 === e4.detail ? this._handleSingleClick(e4) : 2 === e4.detail ? this._handleDoubleClick(e4) : 3 === e4.detail && this._handleTripleClick(e4), this._addMouseDownListeners(), this.refresh(true);
          }
        }
        _addMouseDownListeners() {
          this._screenElement.ownerDocument && (this._screenElement.ownerDocument.addEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.addEventListener("mouseup", this._mouseUpListener)), this._dragScrollIntervalTimer = this._coreBrowserService.window.setInterval(() => this._dragScroll(), 50);
        }
        _removeMouseDownListeners() {
          this._screenElement.ownerDocument && (this._screenElement.ownerDocument.removeEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.removeEventListener("mouseup", this._mouseUpListener)), this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer), this._dragScrollIntervalTimer = void 0;
        }
        _handleIncrementalClick(e4) {
          this._model.selectionStart && (this._model.selectionEnd = this._getMouseBufferCoords(e4));
        }
        _handleSingleClick(e4) {
          if (this._model.selectionStartLength = 0, this._model.isSelectAllActive = false, this._activeSelectionMode = this.shouldColumnSelect(e4) ? 3 : 0, this._model.selectionStart = this._getMouseBufferCoords(e4), !this._model.selectionStart) return;
          this._model.selectionEnd = void 0;
          const t4 = this._bufferService.buffer.lines.get(this._model.selectionStart[1]);
          t4 && t4.length !== this._model.selectionStart[0] && 0 === t4.hasWidth(this._model.selectionStart[0]) && this._model.selectionStart[0]++;
        }
        _handleDoubleClick(e4) {
          this._selectWordAtCursor(e4, true) && (this._activeSelectionMode = 1);
        }
        _handleTripleClick(e4) {
          const t4 = this._getMouseBufferCoords(e4);
          t4 && (this._activeSelectionMode = 2, this._selectLineAt(t4[1]));
        }
        shouldColumnSelect(e4) {
          return e4.altKey && !(d.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection);
        }
        _handleMouseMove(e4) {
          if (e4.stopImmediatePropagation(), !this._model.selectionStart) return;
          const t4 = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null;
          if (this._model.selectionEnd = this._getMouseBufferCoords(e4), !this._model.selectionEnd) return void this.refresh(true);
          2 === this._activeSelectionMode ? this._model.selectionEnd[1] < this._model.selectionStart[1] ? this._model.selectionEnd[0] = 0 : this._model.selectionEnd[0] = this._bufferService.cols : 1 === this._activeSelectionMode && this._selectToWordAt(this._model.selectionEnd), this._dragScrollAmount = this._getMouseEventScrollAmount(e4), 3 !== this._activeSelectionMode && (this._dragScrollAmount > 0 ? this._model.selectionEnd[0] = this._bufferService.cols : this._dragScrollAmount < 0 && (this._model.selectionEnd[0] = 0));
          const i4 = this._bufferService.buffer;
          if (this._model.selectionEnd[1] < i4.lines.length) {
            const e5 = i4.lines.get(this._model.selectionEnd[1]);
            e5 && 0 === e5.hasWidth(this._model.selectionEnd[0]) && this._model.selectionEnd[0] < this._bufferService.cols && this._model.selectionEnd[0]++;
          }
          t4 && t4[0] === this._model.selectionEnd[0] && t4[1] === this._model.selectionEnd[1] || this.refresh(true);
        }
        _dragScroll() {
          if (this._model.selectionEnd && this._model.selectionStart && this._dragScrollAmount) {
            this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false });
            const e4 = this._bufferService.buffer;
            this._dragScrollAmount > 0 ? (3 !== this._activeSelectionMode && (this._model.selectionEnd[0] = this._bufferService.cols), this._model.selectionEnd[1] = Math.min(e4.ydisp + this._bufferService.rows, e4.lines.length - 1)) : (3 !== this._activeSelectionMode && (this._model.selectionEnd[0] = 0), this._model.selectionEnd[1] = e4.ydisp), this.refresh();
          }
        }
        _handleMouseUp(e4) {
          const t4 = e4.timeStamp - this._mouseDownTimeStamp;
          if (this._removeMouseDownListeners(), this.selectionText.length <= 1 && t4 < 500 && e4.altKey && this._optionsService.rawOptions.altClickMovesCursor) {
            if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) {
              const t5 = this._mouseService.getCoords(e4, this._element, this._bufferService.cols, this._bufferService.rows, false);
              if (t5 && void 0 !== t5[0] && void 0 !== t5[1]) {
                const e5 = (0, o.moveToCellSequence)(t5[0] - 1, t5[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys);
                this._coreService.triggerDataEvent(e5, true);
              }
            }
          } else this._fireEventIfSelectionChanged();
        }
        _fireEventIfSelectionChanged() {
          const e4 = this._model.finalSelectionStart, t4 = this._model.finalSelectionEnd, i4 = !(!e4 || !t4 || e4[0] === t4[0] && e4[1] === t4[1]);
          i4 ? e4 && t4 && (this._oldSelectionStart && this._oldSelectionEnd && e4[0] === this._oldSelectionStart[0] && e4[1] === this._oldSelectionStart[1] && t4[0] === this._oldSelectionEnd[0] && t4[1] === this._oldSelectionEnd[1] || this._fireOnSelectionChange(e4, t4, i4)) : this._oldHasSelection && this._fireOnSelectionChange(e4, t4, i4);
        }
        _fireOnSelectionChange(e4, t4, i4) {
          this._oldSelectionStart = e4, this._oldSelectionEnd = t4, this._oldHasSelection = i4, this._onSelectionChange.fire();
        }
        _handleBufferActivate(e4) {
          this.clearSelection(), this._trimListener.dispose(), this._trimListener = e4.activeBuffer.lines.onTrim((e5) => this._handleTrim(e5));
        }
        _convertViewportColToCharacterIndex(e4, t4) {
          let i4 = t4;
          for (let s3 = 0; t4 >= s3; s3++) {
            const r2 = e4.loadCell(s3, this._workCell).getChars().length;
            0 === this._workCell.getWidth() ? i4-- : r2 > 1 && t4 !== s3 && (i4 += r2 - 1);
          }
          return i4;
        }
        setSelection(e4, t4, i4) {
          this._model.clearSelection(), this._removeMouseDownListeners(), this._model.selectionStart = [e4, t4], this._model.selectionStartLength = i4, this.refresh(), this._fireEventIfSelectionChanged();
        }
        rightClickSelect(e4) {
          this._isClickInSelection(e4) || (this._selectWordAtCursor(e4, false) && this.refresh(true), this._fireEventIfSelectionChanged());
        }
        _getWordAt(e4, t4, i4 = true, s3 = true) {
          if (e4[0] >= this._bufferService.cols) return;
          const r2 = this._bufferService.buffer, n2 = r2.lines.get(e4[1]);
          if (!n2) return;
          const o2 = r2.translateBufferLineToString(e4[1], false);
          let a2 = this._convertViewportColToCharacterIndex(n2, e4[0]), h3 = a2;
          const c2 = e4[0] - a2;
          let l2 = 0, d2 = 0, _3 = 0, u2 = 0;
          if (" " === o2.charAt(a2)) {
            for (; a2 > 0 && " " === o2.charAt(a2 - 1); ) a2--;
            for (; h3 < o2.length && " " === o2.charAt(h3 + 1); ) h3++;
          } else {
            let t5 = e4[0], i5 = e4[0];
            0 === n2.getWidth(t5) && (l2++, t5--), 2 === n2.getWidth(i5) && (d2++, i5++);
            const s4 = n2.getString(i5).length;
            for (s4 > 1 && (u2 += s4 - 1, h3 += s4 - 1); t5 > 0 && a2 > 0 && !this._isCharWordSeparator(n2.loadCell(t5 - 1, this._workCell)); ) {
              n2.loadCell(t5 - 1, this._workCell);
              const e5 = this._workCell.getChars().length;
              0 === this._workCell.getWidth() ? (l2++, t5--) : e5 > 1 && (_3 += e5 - 1, a2 -= e5 - 1), a2--, t5--;
            }
            for (; i5 < n2.length && h3 + 1 < o2.length && !this._isCharWordSeparator(n2.loadCell(i5 + 1, this._workCell)); ) {
              n2.loadCell(i5 + 1, this._workCell);
              const e5 = this._workCell.getChars().length;
              2 === this._workCell.getWidth() ? (d2++, i5++) : e5 > 1 && (u2 += e5 - 1, h3 += e5 - 1), h3++, i5++;
            }
          }
          h3++;
          let f2 = a2 + c2 - l2 + _3, v3 = Math.min(this._bufferService.cols, h3 - a2 + l2 + d2 - _3 - u2);
          if (t4 || "" !== o2.slice(a2, h3).trim()) {
            if (i4 && 0 === f2 && 32 !== n2.getCodePoint(0)) {
              const t5 = r2.lines.get(e4[1] - 1);
              if (t5 && n2.isWrapped && 32 !== t5.getCodePoint(this._bufferService.cols - 1)) {
                const t6 = this._getWordAt([this._bufferService.cols - 1, e4[1] - 1], false, true, false);
                if (t6) {
                  const e5 = this._bufferService.cols - t6.start;
                  f2 -= e5, v3 += e5;
                }
              }
            }
            if (s3 && f2 + v3 === this._bufferService.cols && 32 !== n2.getCodePoint(this._bufferService.cols - 1)) {
              const t5 = r2.lines.get(e4[1] + 1);
              if (t5?.isWrapped && 32 !== t5.getCodePoint(0)) {
                const t6 = this._getWordAt([0, e4[1] + 1], false, false, true);
                t6 && (v3 += t6.length);
              }
            }
            return { start: f2, length: v3 };
          }
        }
        _selectWordAt(e4, t4) {
          const i4 = this._getWordAt(e4, t4);
          if (i4) {
            for (; i4.start < 0; ) i4.start += this._bufferService.cols, e4[1]--;
            this._model.selectionStart = [i4.start, e4[1]], this._model.selectionStartLength = i4.length;
          }
        }
        _selectToWordAt(e4) {
          const t4 = this._getWordAt(e4, true);
          if (t4) {
            let i4 = e4[1];
            for (; t4.start < 0; ) t4.start += this._bufferService.cols, i4--;
            if (!this._model.areSelectionValuesReversed()) for (; t4.start + t4.length > this._bufferService.cols; ) t4.length -= this._bufferService.cols, i4++;
            this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? t4.start : t4.start + t4.length, i4];
          }
        }
        _isCharWordSeparator(e4) {
          return 0 !== e4.getWidth() && this._optionsService.rawOptions.wordSeparator.indexOf(e4.getChars()) >= 0;
        }
        _selectLineAt(e4) {
          const t4 = this._bufferService.buffer.getWrappedRangeForLine(e4), i4 = { start: { x: 0, y: t4.first }, end: { x: this._bufferService.cols - 1, y: t4.last } };
          this._model.selectionStart = [0, t4.first], this._model.selectionEnd = void 0, this._model.selectionStartLength = (0, _2.getRangeLength)(i4, this._bufferService.cols);
        }
      };
      t3.SelectionService = g2 = s2([r(3, f.IBufferService), r(4, f.ICoreService), r(5, h2.IMouseService), r(6, f.IOptionsService), r(7, h2.IRenderService), r(8, h2.ICoreBrowserService)], g2);
    }, 4725: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.ILinkProviderService = t3.IThemeService = t3.ICharacterJoinerService = t3.ISelectionService = t3.IRenderService = t3.IMouseService = t3.ICoreBrowserService = t3.ICharSizeService = void 0;
      const s2 = i3(8343);
      t3.ICharSizeService = (0, s2.createDecorator)("CharSizeService"), t3.ICoreBrowserService = (0, s2.createDecorator)("CoreBrowserService"), t3.IMouseService = (0, s2.createDecorator)("MouseService"), t3.IRenderService = (0, s2.createDecorator)("RenderService"), t3.ISelectionService = (0, s2.createDecorator)("SelectionService"), t3.ICharacterJoinerService = (0, s2.createDecorator)("CharacterJoinerService"), t3.IThemeService = (0, s2.createDecorator)("ThemeService"), t3.ILinkProviderService = (0, s2.createDecorator)("LinkProviderService");
    }, 6731: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.ThemeService = t3.DEFAULT_ANSI_COLORS = void 0;
      const n = i3(7239), o = i3(8055), a = i3(8460), h2 = i3(844), c = i3(2585), l = o.css.toColor("#ffffff"), d = o.css.toColor("#000000"), _2 = o.css.toColor("#ffffff"), u = o.css.toColor("#000000"), f = { css: "rgba(255, 255, 255, 0.3)", rgba: 4294967117 };
      t3.DEFAULT_ANSI_COLORS = Object.freeze((() => {
        const e4 = [o.css.toColor("#2e3436"), o.css.toColor("#cc0000"), o.css.toColor("#4e9a06"), o.css.toColor("#c4a000"), o.css.toColor("#3465a4"), o.css.toColor("#75507b"), o.css.toColor("#06989a"), o.css.toColor("#d3d7cf"), o.css.toColor("#555753"), o.css.toColor("#ef2929"), o.css.toColor("#8ae234"), o.css.toColor("#fce94f"), o.css.toColor("#729fcf"), o.css.toColor("#ad7fa8"), o.css.toColor("#34e2e2"), o.css.toColor("#eeeeec")], t4 = [0, 95, 135, 175, 215, 255];
        for (let i4 = 0; i4 < 216; i4++) {
          const s3 = t4[i4 / 36 % 6 | 0], r2 = t4[i4 / 6 % 6 | 0], n2 = t4[i4 % 6];
          e4.push({ css: o.channels.toCss(s3, r2, n2), rgba: o.channels.toRgba(s3, r2, n2) });
        }
        for (let t5 = 0; t5 < 24; t5++) {
          const i4 = 8 + 10 * t5;
          e4.push({ css: o.channels.toCss(i4, i4, i4), rgba: o.channels.toRgba(i4, i4, i4) });
        }
        return e4;
      })());
      let v2 = t3.ThemeService = class extends h2.Disposable {
        get colors() {
          return this._colors;
        }
        constructor(e4) {
          super(), this._optionsService = e4, this._contrastCache = new n.ColorContrastCache(), this._halfContrastCache = new n.ColorContrastCache(), this._onChangeColors = this.register(new a.EventEmitter()), this.onChangeColors = this._onChangeColors.event, this._colors = { foreground: l, background: d, cursor: _2, cursorAccent: u, selectionForeground: void 0, selectionBackgroundTransparent: f, selectionBackgroundOpaque: o.color.blend(d, f), selectionInactiveBackgroundTransparent: f, selectionInactiveBackgroundOpaque: o.color.blend(d, f), ansi: t3.DEFAULT_ANSI_COLORS.slice(), contrastCache: this._contrastCache, halfContrastCache: this._halfContrastCache }, this._updateRestoreColors(), this._setTheme(this._optionsService.rawOptions.theme), this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio", () => this._contrastCache.clear())), this.register(this._optionsService.onSpecificOptionChange("theme", () => this._setTheme(this._optionsService.rawOptions.theme)));
        }
        _setTheme(e4 = {}) {
          const i4 = this._colors;
          if (i4.foreground = p2(e4.foreground, l), i4.background = p2(e4.background, d), i4.cursor = p2(e4.cursor, _2), i4.cursorAccent = p2(e4.cursorAccent, u), i4.selectionBackgroundTransparent = p2(e4.selectionBackground, f), i4.selectionBackgroundOpaque = o.color.blend(i4.background, i4.selectionBackgroundTransparent), i4.selectionInactiveBackgroundTransparent = p2(e4.selectionInactiveBackground, i4.selectionBackgroundTransparent), i4.selectionInactiveBackgroundOpaque = o.color.blend(i4.background, i4.selectionInactiveBackgroundTransparent), i4.selectionForeground = e4.selectionForeground ? p2(e4.selectionForeground, o.NULL_COLOR) : void 0, i4.selectionForeground === o.NULL_COLOR && (i4.selectionForeground = void 0), o.color.isOpaque(i4.selectionBackgroundTransparent)) {
            const e5 = 0.3;
            i4.selectionBackgroundTransparent = o.color.opacity(i4.selectionBackgroundTransparent, e5);
          }
          if (o.color.isOpaque(i4.selectionInactiveBackgroundTransparent)) {
            const e5 = 0.3;
            i4.selectionInactiveBackgroundTransparent = o.color.opacity(i4.selectionInactiveBackgroundTransparent, e5);
          }
          if (i4.ansi = t3.DEFAULT_ANSI_COLORS.slice(), i4.ansi[0] = p2(e4.black, t3.DEFAULT_ANSI_COLORS[0]), i4.ansi[1] = p2(e4.red, t3.DEFAULT_ANSI_COLORS[1]), i4.ansi[2] = p2(e4.green, t3.DEFAULT_ANSI_COLORS[2]), i4.ansi[3] = p2(e4.yellow, t3.DEFAULT_ANSI_COLORS[3]), i4.ansi[4] = p2(e4.blue, t3.DEFAULT_ANSI_COLORS[4]), i4.ansi[5] = p2(e4.magenta, t3.DEFAULT_ANSI_COLORS[5]), i4.ansi[6] = p2(e4.cyan, t3.DEFAULT_ANSI_COLORS[6]), i4.ansi[7] = p2(e4.white, t3.DEFAULT_ANSI_COLORS[7]), i4.ansi[8] = p2(e4.brightBlack, t3.DEFAULT_ANSI_COLORS[8]), i4.ansi[9] = p2(e4.brightRed, t3.DEFAULT_ANSI_COLORS[9]), i4.ansi[10] = p2(e4.brightGreen, t3.DEFAULT_ANSI_COLORS[10]), i4.ansi[11] = p2(e4.brightYellow, t3.DEFAULT_ANSI_COLORS[11]), i4.ansi[12] = p2(e4.brightBlue, t3.DEFAULT_ANSI_COLORS[12]), i4.ansi[13] = p2(e4.brightMagenta, t3.DEFAULT_ANSI_COLORS[13]), i4.ansi[14] = p2(e4.brightCyan, t3.DEFAULT_ANSI_COLORS[14]), i4.ansi[15] = p2(e4.brightWhite, t3.DEFAULT_ANSI_COLORS[15]), e4.extendedAnsi) {
            const s3 = Math.min(i4.ansi.length - 16, e4.extendedAnsi.length);
            for (let r2 = 0; r2 < s3; r2++) i4.ansi[r2 + 16] = p2(e4.extendedAnsi[r2], t3.DEFAULT_ANSI_COLORS[r2 + 16]);
          }
          this._contrastCache.clear(), this._halfContrastCache.clear(), this._updateRestoreColors(), this._onChangeColors.fire(this.colors);
        }
        restoreColor(e4) {
          this._restoreColor(e4), this._onChangeColors.fire(this.colors);
        }
        _restoreColor(e4) {
          if (void 0 !== e4) switch (e4) {
            case 256:
              this._colors.foreground = this._restoreColors.foreground;
              break;
            case 257:
              this._colors.background = this._restoreColors.background;
              break;
            case 258:
              this._colors.cursor = this._restoreColors.cursor;
              break;
            default:
              this._colors.ansi[e4] = this._restoreColors.ansi[e4];
          }
          else for (let e5 = 0; e5 < this._restoreColors.ansi.length; ++e5) this._colors.ansi[e5] = this._restoreColors.ansi[e5];
        }
        modifyColors(e4) {
          e4(this._colors), this._onChangeColors.fire(this.colors);
        }
        _updateRestoreColors() {
          this._restoreColors = { foreground: this._colors.foreground, background: this._colors.background, cursor: this._colors.cursor, ansi: this._colors.ansi.slice() };
        }
      };
      function p2(e4, t4) {
        if (void 0 !== e4) try {
          return o.css.toColor(e4);
        } catch {
        }
        return t4;
      }
      __name(p2, "p");
      t3.ThemeService = v2 = s2([r(0, c.IOptionsService)], v2);
    }, 6349: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CircularList = void 0;
      const s2 = i3(8460), r = i3(844);
      class n extends r.Disposable {
        static {
          __name(this, "n");
        }
        constructor(e4) {
          super(), this._maxLength = e4, this.onDeleteEmitter = this.register(new s2.EventEmitter()), this.onDelete = this.onDeleteEmitter.event, this.onInsertEmitter = this.register(new s2.EventEmitter()), this.onInsert = this.onInsertEmitter.event, this.onTrimEmitter = this.register(new s2.EventEmitter()), this.onTrim = this.onTrimEmitter.event, this._array = new Array(this._maxLength), this._startIndex = 0, this._length = 0;
        }
        get maxLength() {
          return this._maxLength;
        }
        set maxLength(e4) {
          if (this._maxLength === e4) return;
          const t4 = new Array(e4);
          for (let i4 = 0; i4 < Math.min(e4, this.length); i4++) t4[i4] = this._array[this._getCyclicIndex(i4)];
          this._array = t4, this._maxLength = e4, this._startIndex = 0;
        }
        get length() {
          return this._length;
        }
        set length(e4) {
          if (e4 > this._length) for (let t4 = this._length; t4 < e4; t4++) this._array[t4] = void 0;
          this._length = e4;
        }
        get(e4) {
          return this._array[this._getCyclicIndex(e4)];
        }
        set(e4, t4) {
          this._array[this._getCyclicIndex(e4)] = t4;
        }
        push(e4) {
          this._array[this._getCyclicIndex(this._length)] = e4, this._length === this._maxLength ? (this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1)) : this._length++;
        }
        recycle() {
          if (this._length !== this._maxLength) throw new Error("Can only recycle when the buffer is full");
          return this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1), this._array[this._getCyclicIndex(this._length - 1)];
        }
        get isFull() {
          return this._length === this._maxLength;
        }
        pop() {
          return this._array[this._getCyclicIndex(this._length-- - 1)];
        }
        splice(e4, t4, ...i4) {
          if (t4) {
            for (let i5 = e4; i5 < this._length - t4; i5++) this._array[this._getCyclicIndex(i5)] = this._array[this._getCyclicIndex(i5 + t4)];
            this._length -= t4, this.onDeleteEmitter.fire({ index: e4, amount: t4 });
          }
          for (let t5 = this._length - 1; t5 >= e4; t5--) this._array[this._getCyclicIndex(t5 + i4.length)] = this._array[this._getCyclicIndex(t5)];
          for (let t5 = 0; t5 < i4.length; t5++) this._array[this._getCyclicIndex(e4 + t5)] = i4[t5];
          if (i4.length && this.onInsertEmitter.fire({ index: e4, amount: i4.length }), this._length + i4.length > this._maxLength) {
            const e5 = this._length + i4.length - this._maxLength;
            this._startIndex += e5, this._length = this._maxLength, this.onTrimEmitter.fire(e5);
          } else this._length += i4.length;
        }
        trimStart(e4) {
          e4 > this._length && (e4 = this._length), this._startIndex += e4, this._length -= e4, this.onTrimEmitter.fire(e4);
        }
        shiftElements(e4, t4, i4) {
          if (!(t4 <= 0)) {
            if (e4 < 0 || e4 >= this._length) throw new Error("start argument out of range");
            if (e4 + i4 < 0) throw new Error("Cannot shift elements in list beyond index 0");
            if (i4 > 0) {
              for (let s4 = t4 - 1; s4 >= 0; s4--) this.set(e4 + s4 + i4, this.get(e4 + s4));
              const s3 = e4 + t4 + i4 - this._length;
              if (s3 > 0) for (this._length += s3; this._length > this._maxLength; ) this._length--, this._startIndex++, this.onTrimEmitter.fire(1);
            } else for (let s3 = 0; s3 < t4; s3++) this.set(e4 + s3 + i4, this.get(e4 + s3));
          }
        }
        _getCyclicIndex(e4) {
          return (this._startIndex + e4) % this._maxLength;
        }
      }
      t3.CircularList = n;
    }, 1439: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.clone = void 0, t3.clone = /* @__PURE__ */ __name(function e4(t4, i3 = 5) {
        if ("object" != typeof t4) return t4;
        const s2 = Array.isArray(t4) ? [] : {};
        for (const r in t4) s2[r] = i3 <= 1 ? t4[r] : t4[r] && e4(t4[r], i3 - 1);
        return s2;
      }, "e");
    }, 8055: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.contrastRatio = t3.toPaddedHex = t3.rgba = t3.rgb = t3.css = t3.color = t3.channels = t3.NULL_COLOR = void 0;
      let i3 = 0, s2 = 0, r = 0, n = 0;
      var o, a, h2, c, l;
      function d(e4) {
        const t4 = e4.toString(16);
        return t4.length < 2 ? "0" + t4 : t4;
      }
      __name(d, "d");
      function _2(e4, t4) {
        return e4 < t4 ? (t4 + 0.05) / (e4 + 0.05) : (e4 + 0.05) / (t4 + 0.05);
      }
      __name(_2, "_");
      t3.NULL_COLOR = { css: "#00000000", rgba: 0 }, function(e4) {
        e4.toCss = function(e5, t4, i4, s3) {
          return void 0 !== s3 ? `#${d(e5)}${d(t4)}${d(i4)}${d(s3)}` : `#${d(e5)}${d(t4)}${d(i4)}`;
        }, e4.toRgba = function(e5, t4, i4, s3 = 255) {
          return (e5 << 24 | t4 << 16 | i4 << 8 | s3) >>> 0;
        }, e4.toColor = function(t4, i4, s3, r2) {
          return { css: e4.toCss(t4, i4, s3, r2), rgba: e4.toRgba(t4, i4, s3, r2) };
        };
      }(o || (t3.channels = o = {})), function(e4) {
        function t4(e5, t5) {
          return n = Math.round(255 * t5), [i3, s2, r] = l.toChannels(e5.rgba), { css: o.toCss(i3, s2, r, n), rgba: o.toRgba(i3, s2, r, n) };
        }
        __name(t4, "t");
        e4.blend = function(e5, t5) {
          if (n = (255 & t5.rgba) / 255, 1 === n) return { css: t5.css, rgba: t5.rgba };
          const a2 = t5.rgba >> 24 & 255, h3 = t5.rgba >> 16 & 255, c2 = t5.rgba >> 8 & 255, l2 = e5.rgba >> 24 & 255, d2 = e5.rgba >> 16 & 255, _3 = e5.rgba >> 8 & 255;
          return i3 = l2 + Math.round((a2 - l2) * n), s2 = d2 + Math.round((h3 - d2) * n), r = _3 + Math.round((c2 - _3) * n), { css: o.toCss(i3, s2, r), rgba: o.toRgba(i3, s2, r) };
        }, e4.isOpaque = function(e5) {
          return 255 == (255 & e5.rgba);
        }, e4.ensureContrastRatio = function(e5, t5, i4) {
          const s3 = l.ensureContrastRatio(e5.rgba, t5.rgba, i4);
          if (s3) return o.toColor(s3 >> 24 & 255, s3 >> 16 & 255, s3 >> 8 & 255);
        }, e4.opaque = function(e5) {
          const t5 = (255 | e5.rgba) >>> 0;
          return [i3, s2, r] = l.toChannels(t5), { css: o.toCss(i3, s2, r), rgba: t5 };
        }, e4.opacity = t4, e4.multiplyOpacity = function(e5, i4) {
          return n = 255 & e5.rgba, t4(e5, n * i4 / 255);
        }, e4.toColorRGB = function(e5) {
          return [e5.rgba >> 24 & 255, e5.rgba >> 16 & 255, e5.rgba >> 8 & 255];
        };
      }(a || (t3.color = a = {})), function(e4) {
        let t4, a2;
        try {
          const e5 = document.createElement("canvas");
          e5.width = 1, e5.height = 1;
          const i4 = e5.getContext("2d", { willReadFrequently: true });
          i4 && (t4 = i4, t4.globalCompositeOperation = "copy", a2 = t4.createLinearGradient(0, 0, 1, 1));
        } catch {
        }
        e4.toColor = function(e5) {
          if (e5.match(/#[\da-f]{3,8}/i)) switch (e5.length) {
            case 4:
              return i3 = parseInt(e5.slice(1, 2).repeat(2), 16), s2 = parseInt(e5.slice(2, 3).repeat(2), 16), r = parseInt(e5.slice(3, 4).repeat(2), 16), o.toColor(i3, s2, r);
            case 5:
              return i3 = parseInt(e5.slice(1, 2).repeat(2), 16), s2 = parseInt(e5.slice(2, 3).repeat(2), 16), r = parseInt(e5.slice(3, 4).repeat(2), 16), n = parseInt(e5.slice(4, 5).repeat(2), 16), o.toColor(i3, s2, r, n);
            case 7:
              return { css: e5, rgba: (parseInt(e5.slice(1), 16) << 8 | 255) >>> 0 };
            case 9:
              return { css: e5, rgba: parseInt(e5.slice(1), 16) >>> 0 };
          }
          const h3 = e5.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
          if (h3) return i3 = parseInt(h3[1]), s2 = parseInt(h3[2]), r = parseInt(h3[3]), n = Math.round(255 * (void 0 === h3[5] ? 1 : parseFloat(h3[5]))), o.toColor(i3, s2, r, n);
          if (!t4 || !a2) throw new Error("css.toColor: Unsupported css format");
          if (t4.fillStyle = a2, t4.fillStyle = e5, "string" != typeof t4.fillStyle) throw new Error("css.toColor: Unsupported css format");
          if (t4.fillRect(0, 0, 1, 1), [i3, s2, r, n] = t4.getImageData(0, 0, 1, 1).data, 255 !== n) throw new Error("css.toColor: Unsupported css format");
          return { rgba: o.toRgba(i3, s2, r, n), css: e5 };
        };
      }(h2 || (t3.css = h2 = {})), function(e4) {
        function t4(e5, t5, i4) {
          const s3 = e5 / 255, r2 = t5 / 255, n2 = i4 / 255;
          return 0.2126 * (s3 <= 0.03928 ? s3 / 12.92 : Math.pow((s3 + 0.055) / 1.055, 2.4)) + 0.7152 * (r2 <= 0.03928 ? r2 / 12.92 : Math.pow((r2 + 0.055) / 1.055, 2.4)) + 0.0722 * (n2 <= 0.03928 ? n2 / 12.92 : Math.pow((n2 + 0.055) / 1.055, 2.4));
        }
        __name(t4, "t");
        e4.relativeLuminance = function(e5) {
          return t4(e5 >> 16 & 255, e5 >> 8 & 255, 255 & e5);
        }, e4.relativeLuminance2 = t4;
      }(c || (t3.rgb = c = {})), function(e4) {
        function t4(e5, t5, i4) {
          const s3 = e5 >> 24 & 255, r2 = e5 >> 16 & 255, n2 = e5 >> 8 & 255;
          let o2 = t5 >> 24 & 255, a3 = t5 >> 16 & 255, h3 = t5 >> 8 & 255, l2 = _2(c.relativeLuminance2(o2, a3, h3), c.relativeLuminance2(s3, r2, n2));
          for (; l2 < i4 && (o2 > 0 || a3 > 0 || h3 > 0); ) o2 -= Math.max(0, Math.ceil(0.1 * o2)), a3 -= Math.max(0, Math.ceil(0.1 * a3)), h3 -= Math.max(0, Math.ceil(0.1 * h3)), l2 = _2(c.relativeLuminance2(o2, a3, h3), c.relativeLuminance2(s3, r2, n2));
          return (o2 << 24 | a3 << 16 | h3 << 8 | 255) >>> 0;
        }
        __name(t4, "t");
        function a2(e5, t5, i4) {
          const s3 = e5 >> 24 & 255, r2 = e5 >> 16 & 255, n2 = e5 >> 8 & 255;
          let o2 = t5 >> 24 & 255, a3 = t5 >> 16 & 255, h3 = t5 >> 8 & 255, l2 = _2(c.relativeLuminance2(o2, a3, h3), c.relativeLuminance2(s3, r2, n2));
          for (; l2 < i4 && (o2 < 255 || a3 < 255 || h3 < 255); ) o2 = Math.min(255, o2 + Math.ceil(0.1 * (255 - o2))), a3 = Math.min(255, a3 + Math.ceil(0.1 * (255 - a3))), h3 = Math.min(255, h3 + Math.ceil(0.1 * (255 - h3))), l2 = _2(c.relativeLuminance2(o2, a3, h3), c.relativeLuminance2(s3, r2, n2));
          return (o2 << 24 | a3 << 16 | h3 << 8 | 255) >>> 0;
        }
        __name(a2, "a");
        e4.blend = function(e5, t5) {
          if (n = (255 & t5) / 255, 1 === n) return t5;
          const a3 = t5 >> 24 & 255, h3 = t5 >> 16 & 255, c2 = t5 >> 8 & 255, l2 = e5 >> 24 & 255, d2 = e5 >> 16 & 255, _3 = e5 >> 8 & 255;
          return i3 = l2 + Math.round((a3 - l2) * n), s2 = d2 + Math.round((h3 - d2) * n), r = _3 + Math.round((c2 - _3) * n), o.toRgba(i3, s2, r);
        }, e4.ensureContrastRatio = function(e5, i4, s3) {
          const r2 = c.relativeLuminance(e5 >> 8), n2 = c.relativeLuminance(i4 >> 8);
          if (_2(r2, n2) < s3) {
            if (n2 < r2) {
              const n3 = t4(e5, i4, s3), o3 = _2(r2, c.relativeLuminance(n3 >> 8));
              if (o3 < s3) {
                const t5 = a2(e5, i4, s3);
                return o3 > _2(r2, c.relativeLuminance(t5 >> 8)) ? n3 : t5;
              }
              return n3;
            }
            const o2 = a2(e5, i4, s3), h3 = _2(r2, c.relativeLuminance(o2 >> 8));
            if (h3 < s3) {
              const n3 = t4(e5, i4, s3);
              return h3 > _2(r2, c.relativeLuminance(n3 >> 8)) ? o2 : n3;
            }
            return o2;
          }
        }, e4.reduceLuminance = t4, e4.increaseLuminance = a2, e4.toChannels = function(e5) {
          return [e5 >> 24 & 255, e5 >> 16 & 255, e5 >> 8 & 255, 255 & e5];
        };
      }(l || (t3.rgba = l = {})), t3.toPaddedHex = d, t3.contrastRatio = _2;
    }, 8969: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CoreTerminal = void 0;
      const s2 = i3(844), r = i3(2585), n = i3(4348), o = i3(7866), a = i3(744), h2 = i3(7302), c = i3(6975), l = i3(8460), d = i3(1753), _2 = i3(1480), u = i3(7994), f = i3(9282), v2 = i3(5435), p2 = i3(5981), g2 = i3(2660);
      let m = false;
      class S extends s2.Disposable {
        static {
          __name(this, "S");
        }
        get onScroll() {
          return this._onScrollApi || (this._onScrollApi = this.register(new l.EventEmitter()), this._onScroll.event((e4) => {
            this._onScrollApi?.fire(e4.position);
          })), this._onScrollApi.event;
        }
        get cols() {
          return this._bufferService.cols;
        }
        get rows() {
          return this._bufferService.rows;
        }
        get buffers() {
          return this._bufferService.buffers;
        }
        get options() {
          return this.optionsService.options;
        }
        set options(e4) {
          for (const t4 in e4) this.optionsService.options[t4] = e4[t4];
        }
        constructor(e4) {
          super(), this._windowsWrappingHeuristics = this.register(new s2.MutableDisposable()), this._onBinary = this.register(new l.EventEmitter()), this.onBinary = this._onBinary.event, this._onData = this.register(new l.EventEmitter()), this.onData = this._onData.event, this._onLineFeed = this.register(new l.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onResize = this.register(new l.EventEmitter()), this.onResize = this._onResize.event, this._onWriteParsed = this.register(new l.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event, this._onScroll = this.register(new l.EventEmitter()), this._instantiationService = new n.InstantiationService(), this.optionsService = this.register(new h2.OptionsService(e4)), this._instantiationService.setService(r.IOptionsService, this.optionsService), this._bufferService = this.register(this._instantiationService.createInstance(a.BufferService)), this._instantiationService.setService(r.IBufferService, this._bufferService), this._logService = this.register(this._instantiationService.createInstance(o.LogService)), this._instantiationService.setService(r.ILogService, this._logService), this.coreService = this.register(this._instantiationService.createInstance(c.CoreService)), this._instantiationService.setService(r.ICoreService, this.coreService), this.coreMouseService = this.register(this._instantiationService.createInstance(d.CoreMouseService)), this._instantiationService.setService(r.ICoreMouseService, this.coreMouseService), this.unicodeService = this.register(this._instantiationService.createInstance(_2.UnicodeService)), this._instantiationService.setService(r.IUnicodeService, this.unicodeService), this._charsetService = this._instantiationService.createInstance(u.CharsetService), this._instantiationService.setService(r.ICharsetService, this._charsetService), this._oscLinkService = this._instantiationService.createInstance(g2.OscLinkService), this._instantiationService.setService(r.IOscLinkService, this._oscLinkService), this._inputHandler = this.register(new v2.InputHandler(this._bufferService, this._charsetService, this.coreService, this._logService, this.optionsService, this._oscLinkService, this.coreMouseService, this.unicodeService)), this.register((0, l.forwardEvent)(this._inputHandler.onLineFeed, this._onLineFeed)), this.register(this._inputHandler), this.register((0, l.forwardEvent)(this._bufferService.onResize, this._onResize)), this.register((0, l.forwardEvent)(this.coreService.onData, this._onData)), this.register((0, l.forwardEvent)(this.coreService.onBinary, this._onBinary)), this.register(this.coreService.onRequestScrollToBottom(() => this.scrollToBottom())), this.register(this.coreService.onUserInput(() => this._writeBuffer.handleUserInput())), this.register(this.optionsService.onMultipleOptionChange(["windowsMode", "windowsPty"], () => this._handleWindowsPtyOptionChange())), this.register(this._bufferService.onScroll((e5) => {
            this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
          })), this.register(this._inputHandler.onScroll((e5) => {
            this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
          })), this._writeBuffer = this.register(new p2.WriteBuffer((e5, t4) => this._inputHandler.parse(e5, t4))), this.register((0, l.forwardEvent)(this._writeBuffer.onWriteParsed, this._onWriteParsed));
        }
        write(e4, t4) {
          this._writeBuffer.write(e4, t4);
        }
        writeSync(e4, t4) {
          this._logService.logLevel <= r.LogLevelEnum.WARN && !m && (this._logService.warn("writeSync is unreliable and will be removed soon."), m = true), this._writeBuffer.writeSync(e4, t4);
        }
        input(e4, t4 = true) {
          this.coreService.triggerDataEvent(e4, t4);
        }
        resize(e4, t4) {
          isNaN(e4) || isNaN(t4) || (e4 = Math.max(e4, a.MINIMUM_COLS), t4 = Math.max(t4, a.MINIMUM_ROWS), this._bufferService.resize(e4, t4));
        }
        scroll(e4, t4 = false) {
          this._bufferService.scroll(e4, t4);
        }
        scrollLines(e4, t4, i4) {
          this._bufferService.scrollLines(e4, t4, i4);
        }
        scrollPages(e4) {
          this.scrollLines(e4 * (this.rows - 1));
        }
        scrollToTop() {
          this.scrollLines(-this._bufferService.buffer.ydisp);
        }
        scrollToBottom() {
          this.scrollLines(this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
        }
        scrollToLine(e4) {
          const t4 = e4 - this._bufferService.buffer.ydisp;
          0 !== t4 && this.scrollLines(t4);
        }
        registerEscHandler(e4, t4) {
          return this._inputHandler.registerEscHandler(e4, t4);
        }
        registerDcsHandler(e4, t4) {
          return this._inputHandler.registerDcsHandler(e4, t4);
        }
        registerCsiHandler(e4, t4) {
          return this._inputHandler.registerCsiHandler(e4, t4);
        }
        registerOscHandler(e4, t4) {
          return this._inputHandler.registerOscHandler(e4, t4);
        }
        _setup() {
          this._handleWindowsPtyOptionChange();
        }
        reset() {
          this._inputHandler.reset(), this._bufferService.reset(), this._charsetService.reset(), this.coreService.reset(), this.coreMouseService.reset();
        }
        _handleWindowsPtyOptionChange() {
          let e4 = false;
          const t4 = this.optionsService.rawOptions.windowsPty;
          t4 && void 0 !== t4.buildNumber && void 0 !== t4.buildNumber ? e4 = !!("conpty" === t4.backend && t4.buildNumber < 21376) : this.optionsService.rawOptions.windowsMode && (e4 = true), e4 ? this._enableWindowsWrappingHeuristics() : this._windowsWrappingHeuristics.clear();
        }
        _enableWindowsWrappingHeuristics() {
          if (!this._windowsWrappingHeuristics.value) {
            const e4 = [];
            e4.push(this.onLineFeed(f.updateWindowsModeWrappedState.bind(null, this._bufferService))), e4.push(this.registerCsiHandler({ final: "H" }, () => ((0, f.updateWindowsModeWrappedState)(this._bufferService), false))), this._windowsWrappingHeuristics.value = (0, s2.toDisposable)(() => {
              for (const t4 of e4) t4.dispose();
            });
          }
        }
      }
      t3.CoreTerminal = S;
    }, 8460: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.runAndSubscribe = t3.forwardEvent = t3.EventEmitter = void 0, t3.EventEmitter = class {
        constructor() {
          this._listeners = [], this._disposed = false;
        }
        get event() {
          return this._event || (this._event = (e4) => (this._listeners.push(e4), { dispose: /* @__PURE__ */ __name(() => {
            if (!this._disposed) {
              for (let t4 = 0; t4 < this._listeners.length; t4++) if (this._listeners[t4] === e4) return void this._listeners.splice(t4, 1);
            }
          }, "dispose") })), this._event;
        }
        fire(e4, t4) {
          const i3 = [];
          for (let e5 = 0; e5 < this._listeners.length; e5++) i3.push(this._listeners[e5]);
          for (let s2 = 0; s2 < i3.length; s2++) i3[s2].call(void 0, e4, t4);
        }
        dispose() {
          this.clearListeners(), this._disposed = true;
        }
        clearListeners() {
          this._listeners && (this._listeners.length = 0);
        }
      }, t3.forwardEvent = function(e4, t4) {
        return e4((e5) => t4.fire(e5));
      }, t3.runAndSubscribe = function(e4, t4) {
        return t4(void 0), e4((e5) => t4(e5));
      };
    }, 5435: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.InputHandler = t3.WindowsOptionsReportType = void 0;
      const n = i3(2584), o = i3(7116), a = i3(2015), h2 = i3(844), c = i3(482), l = i3(8437), d = i3(8460), _2 = i3(643), u = i3(511), f = i3(3734), v2 = i3(2585), p2 = i3(1480), g2 = i3(6242), m = i3(6351), S = i3(5941), C = { "(": 0, ")": 1, "*": 2, "+": 3, "-": 1, ".": 2 }, b = 131072;
      function w(e4, t4) {
        if (e4 > 24) return t4.setWinLines || false;
        switch (e4) {
          case 1:
            return !!t4.restoreWin;
          case 2:
            return !!t4.minimizeWin;
          case 3:
            return !!t4.setWinPosition;
          case 4:
            return !!t4.setWinSizePixels;
          case 5:
            return !!t4.raiseWin;
          case 6:
            return !!t4.lowerWin;
          case 7:
            return !!t4.refreshWin;
          case 8:
            return !!t4.setWinSizeChars;
          case 9:
            return !!t4.maximizeWin;
          case 10:
            return !!t4.fullscreenWin;
          case 11:
            return !!t4.getWinState;
          case 13:
            return !!t4.getWinPosition;
          case 14:
            return !!t4.getWinSizePixels;
          case 15:
            return !!t4.getScreenSizePixels;
          case 16:
            return !!t4.getCellSizePixels;
          case 18:
            return !!t4.getWinSizeChars;
          case 19:
            return !!t4.getScreenSizeChars;
          case 20:
            return !!t4.getIconTitle;
          case 21:
            return !!t4.getWinTitle;
          case 22:
            return !!t4.pushTitle;
          case 23:
            return !!t4.popTitle;
          case 24:
            return !!t4.setWinLines;
        }
        return false;
      }
      __name(w, "w");
      var y2;
      !function(e4) {
        e4[e4.GET_WIN_SIZE_PIXELS = 0] = "GET_WIN_SIZE_PIXELS", e4[e4.GET_CELL_SIZE_PIXELS = 1] = "GET_CELL_SIZE_PIXELS";
      }(y2 || (t3.WindowsOptionsReportType = y2 = {}));
      let E = 0;
      class k extends h2.Disposable {
        static {
          __name(this, "k");
        }
        getAttrData() {
          return this._curAttrData;
        }
        constructor(e4, t4, i4, s3, r2, h3, _3, f2, v3 = new a.EscapeSequenceParser()) {
          super(), this._bufferService = e4, this._charsetService = t4, this._coreService = i4, this._logService = s3, this._optionsService = r2, this._oscLinkService = h3, this._coreMouseService = _3, this._unicodeService = f2, this._parser = v3, this._parseBuffer = new Uint32Array(4096), this._stringDecoder = new c.StringToUtf32(), this._utf8Decoder = new c.Utf8ToUtf32(), this._workCell = new u.CellData(), this._windowTitle = "", this._iconName = "", this._windowTitleStack = [], this._iconNameStack = [], this._curAttrData = l.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = l.DEFAULT_ATTR_DATA.clone(), this._onRequestBell = this.register(new d.EventEmitter()), this.onRequestBell = this._onRequestBell.event, this._onRequestRefreshRows = this.register(new d.EventEmitter()), this.onRequestRefreshRows = this._onRequestRefreshRows.event, this._onRequestReset = this.register(new d.EventEmitter()), this.onRequestReset = this._onRequestReset.event, this._onRequestSendFocus = this.register(new d.EventEmitter()), this.onRequestSendFocus = this._onRequestSendFocus.event, this._onRequestSyncScrollBar = this.register(new d.EventEmitter()), this.onRequestSyncScrollBar = this._onRequestSyncScrollBar.event, this._onRequestWindowsOptionsReport = this.register(new d.EventEmitter()), this.onRequestWindowsOptionsReport = this._onRequestWindowsOptionsReport.event, this._onA11yChar = this.register(new d.EventEmitter()), this.onA11yChar = this._onA11yChar.event, this._onA11yTab = this.register(new d.EventEmitter()), this.onA11yTab = this._onA11yTab.event, this._onCursorMove = this.register(new d.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onLineFeed = this.register(new d.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onScroll = this.register(new d.EventEmitter()), this.onScroll = this._onScroll.event, this._onTitleChange = this.register(new d.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onColor = this.register(new d.EventEmitter()), this.onColor = this._onColor.event, this._parseStack = { paused: false, cursorStartX: 0, cursorStartY: 0, decodedLength: 0, position: 0 }, this._specialColors = [256, 257, 258], this.register(this._parser), this._dirtyRowTracker = new L(this._bufferService), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate((e5) => this._activeBuffer = e5.activeBuffer)), this._parser.setCsiHandlerFallback((e5, t5) => {
            this._logService.debug("Unknown CSI code: ", { identifier: this._parser.identToString(e5), params: t5.toArray() });
          }), this._parser.setEscHandlerFallback((e5) => {
            this._logService.debug("Unknown ESC code: ", { identifier: this._parser.identToString(e5) });
          }), this._parser.setExecuteHandlerFallback((e5) => {
            this._logService.debug("Unknown EXECUTE code: ", { code: e5 });
          }), this._parser.setOscHandlerFallback((e5, t5, i5) => {
            this._logService.debug("Unknown OSC code: ", { identifier: e5, action: t5, data: i5 });
          }), this._parser.setDcsHandlerFallback((e5, t5, i5) => {
            "HOOK" === t5 && (i5 = i5.toArray()), this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(e5), action: t5, payload: i5 });
          }), this._parser.setPrintHandler((e5, t5, i5) => this.print(e5, t5, i5)), this._parser.registerCsiHandler({ final: "@" }, (e5) => this.insertChars(e5)), this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, (e5) => this.scrollLeft(e5)), this._parser.registerCsiHandler({ final: "A" }, (e5) => this.cursorUp(e5)), this._parser.registerCsiHandler({ intermediates: " ", final: "A" }, (e5) => this.scrollRight(e5)), this._parser.registerCsiHandler({ final: "B" }, (e5) => this.cursorDown(e5)), this._parser.registerCsiHandler({ final: "C" }, (e5) => this.cursorForward(e5)), this._parser.registerCsiHandler({ final: "D" }, (e5) => this.cursorBackward(e5)), this._parser.registerCsiHandler({ final: "E" }, (e5) => this.cursorNextLine(e5)), this._parser.registerCsiHandler({ final: "F" }, (e5) => this.cursorPrecedingLine(e5)), this._parser.registerCsiHandler({ final: "G" }, (e5) => this.cursorCharAbsolute(e5)), this._parser.registerCsiHandler({ final: "H" }, (e5) => this.cursorPosition(e5)), this._parser.registerCsiHandler({ final: "I" }, (e5) => this.cursorForwardTab(e5)), this._parser.registerCsiHandler({ final: "J" }, (e5) => this.eraseInDisplay(e5, false)), this._parser.registerCsiHandler({ prefix: "?", final: "J" }, (e5) => this.eraseInDisplay(e5, true)), this._parser.registerCsiHandler({ final: "K" }, (e5) => this.eraseInLine(e5, false)), this._parser.registerCsiHandler({ prefix: "?", final: "K" }, (e5) => this.eraseInLine(e5, true)), this._parser.registerCsiHandler({ final: "L" }, (e5) => this.insertLines(e5)), this._parser.registerCsiHandler({ final: "M" }, (e5) => this.deleteLines(e5)), this._parser.registerCsiHandler({ final: "P" }, (e5) => this.deleteChars(e5)), this._parser.registerCsiHandler({ final: "S" }, (e5) => this.scrollUp(e5)), this._parser.registerCsiHandler({ final: "T" }, (e5) => this.scrollDown(e5)), this._parser.registerCsiHandler({ final: "X" }, (e5) => this.eraseChars(e5)), this._parser.registerCsiHandler({ final: "Z" }, (e5) => this.cursorBackwardTab(e5)), this._parser.registerCsiHandler({ final: "`" }, (e5) => this.charPosAbsolute(e5)), this._parser.registerCsiHandler({ final: "a" }, (e5) => this.hPositionRelative(e5)), this._parser.registerCsiHandler({ final: "b" }, (e5) => this.repeatPrecedingCharacter(e5)), this._parser.registerCsiHandler({ final: "c" }, (e5) => this.sendDeviceAttributesPrimary(e5)), this._parser.registerCsiHandler({ prefix: ">", final: "c" }, (e5) => this.sendDeviceAttributesSecondary(e5)), this._parser.registerCsiHandler({ final: "d" }, (e5) => this.linePosAbsolute(e5)), this._parser.registerCsiHandler({ final: "e" }, (e5) => this.vPositionRelative(e5)), this._parser.registerCsiHandler({ final: "f" }, (e5) => this.hVPosition(e5)), this._parser.registerCsiHandler({ final: "g" }, (e5) => this.tabClear(e5)), this._parser.registerCsiHandler({ final: "h" }, (e5) => this.setMode(e5)), this._parser.registerCsiHandler({ prefix: "?", final: "h" }, (e5) => this.setModePrivate(e5)), this._parser.registerCsiHandler({ final: "l" }, (e5) => this.resetMode(e5)), this._parser.registerCsiHandler({ prefix: "?", final: "l" }, (e5) => this.resetModePrivate(e5)), this._parser.registerCsiHandler({ final: "m" }, (e5) => this.charAttributes(e5)), this._parser.registerCsiHandler({ final: "n" }, (e5) => this.deviceStatus(e5)), this._parser.registerCsiHandler({ prefix: "?", final: "n" }, (e5) => this.deviceStatusPrivate(e5)), this._parser.registerCsiHandler({ intermediates: "!", final: "p" }, (e5) => this.softReset(e5)), this._parser.registerCsiHandler({ intermediates: " ", final: "q" }, (e5) => this.setCursorStyle(e5)), this._parser.registerCsiHandler({ final: "r" }, (e5) => this.setScrollRegion(e5)), this._parser.registerCsiHandler({ final: "s" }, (e5) => this.saveCursor(e5)), this._parser.registerCsiHandler({ final: "t" }, (e5) => this.windowOptions(e5)), this._parser.registerCsiHandler({ final: "u" }, (e5) => this.restoreCursor(e5)), this._parser.registerCsiHandler({ intermediates: "'", final: "}" }, (e5) => this.insertColumns(e5)), this._parser.registerCsiHandler({ intermediates: "'", final: "~" }, (e5) => this.deleteColumns(e5)), this._parser.registerCsiHandler({ intermediates: '"', final: "q" }, (e5) => this.selectProtected(e5)), this._parser.registerCsiHandler({ intermediates: "$", final: "p" }, (e5) => this.requestMode(e5, true)), this._parser.registerCsiHandler({ prefix: "?", intermediates: "$", final: "p" }, (e5) => this.requestMode(e5, false)), this._parser.setExecuteHandler(n.C0.BEL, () => this.bell()), this._parser.setExecuteHandler(n.C0.LF, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.VT, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.FF, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.CR, () => this.carriageReturn()), this._parser.setExecuteHandler(n.C0.BS, () => this.backspace()), this._parser.setExecuteHandler(n.C0.HT, () => this.tab()), this._parser.setExecuteHandler(n.C0.SO, () => this.shiftOut()), this._parser.setExecuteHandler(n.C0.SI, () => this.shiftIn()), this._parser.setExecuteHandler(n.C1.IND, () => this.index()), this._parser.setExecuteHandler(n.C1.NEL, () => this.nextLine()), this._parser.setExecuteHandler(n.C1.HTS, () => this.tabSet()), this._parser.registerOscHandler(0, new g2.OscHandler((e5) => (this.setTitle(e5), this.setIconName(e5), true))), this._parser.registerOscHandler(1, new g2.OscHandler((e5) => this.setIconName(e5))), this._parser.registerOscHandler(2, new g2.OscHandler((e5) => this.setTitle(e5))), this._parser.registerOscHandler(4, new g2.OscHandler((e5) => this.setOrReportIndexedColor(e5))), this._parser.registerOscHandler(8, new g2.OscHandler((e5) => this.setHyperlink(e5))), this._parser.registerOscHandler(10, new g2.OscHandler((e5) => this.setOrReportFgColor(e5))), this._parser.registerOscHandler(11, new g2.OscHandler((e5) => this.setOrReportBgColor(e5))), this._parser.registerOscHandler(12, new g2.OscHandler((e5) => this.setOrReportCursorColor(e5))), this._parser.registerOscHandler(104, new g2.OscHandler((e5) => this.restoreIndexedColor(e5))), this._parser.registerOscHandler(110, new g2.OscHandler((e5) => this.restoreFgColor(e5))), this._parser.registerOscHandler(111, new g2.OscHandler((e5) => this.restoreBgColor(e5))), this._parser.registerOscHandler(112, new g2.OscHandler((e5) => this.restoreCursorColor(e5))), this._parser.registerEscHandler({ final: "7" }, () => this.saveCursor()), this._parser.registerEscHandler({ final: "8" }, () => this.restoreCursor()), this._parser.registerEscHandler({ final: "D" }, () => this.index()), this._parser.registerEscHandler({ final: "E" }, () => this.nextLine()), this._parser.registerEscHandler({ final: "H" }, () => this.tabSet()), this._parser.registerEscHandler({ final: "M" }, () => this.reverseIndex()), this._parser.registerEscHandler({ final: "=" }, () => this.keypadApplicationMode()), this._parser.registerEscHandler({ final: ">" }, () => this.keypadNumericMode()), this._parser.registerEscHandler({ final: "c" }, () => this.fullReset()), this._parser.registerEscHandler({ final: "n" }, () => this.setgLevel(2)), this._parser.registerEscHandler({ final: "o" }, () => this.setgLevel(3)), this._parser.registerEscHandler({ final: "|" }, () => this.setgLevel(3)), this._parser.registerEscHandler({ final: "}" }, () => this.setgLevel(2)), this._parser.registerEscHandler({ final: "~" }, () => this.setgLevel(1)), this._parser.registerEscHandler({ intermediates: "%", final: "@" }, () => this.selectDefaultCharset()), this._parser.registerEscHandler({ intermediates: "%", final: "G" }, () => this.selectDefaultCharset());
          for (const e5 in o.CHARSETS) this._parser.registerEscHandler({ intermediates: "(", final: e5 }, () => this.selectCharset("(" + e5)), this._parser.registerEscHandler({ intermediates: ")", final: e5 }, () => this.selectCharset(")" + e5)), this._parser.registerEscHandler({ intermediates: "*", final: e5 }, () => this.selectCharset("*" + e5)), this._parser.registerEscHandler({ intermediates: "+", final: e5 }, () => this.selectCharset("+" + e5)), this._parser.registerEscHandler({ intermediates: "-", final: e5 }, () => this.selectCharset("-" + e5)), this._parser.registerEscHandler({ intermediates: ".", final: e5 }, () => this.selectCharset("." + e5)), this._parser.registerEscHandler({ intermediates: "/", final: e5 }, () => this.selectCharset("/" + e5));
          this._parser.registerEscHandler({ intermediates: "#", final: "8" }, () => this.screenAlignmentPattern()), this._parser.setErrorHandler((e5) => (this._logService.error("Parsing error: ", e5), e5)), this._parser.registerDcsHandler({ intermediates: "$", final: "q" }, new m.DcsHandler((e5, t5) => this.requestStatusString(e5, t5)));
        }
        _preserveStack(e4, t4, i4, s3) {
          this._parseStack.paused = true, this._parseStack.cursorStartX = e4, this._parseStack.cursorStartY = t4, this._parseStack.decodedLength = i4, this._parseStack.position = s3;
        }
        _logSlowResolvingAsync(e4) {
          this._logService.logLevel <= v2.LogLevelEnum.WARN && Promise.race([e4, new Promise((e5, t4) => setTimeout(() => t4("#SLOW_TIMEOUT"), 5e3))]).catch((e5) => {
            if ("#SLOW_TIMEOUT" !== e5) throw e5;
            console.warn("async parser handler taking longer than 5000 ms");
          });
        }
        _getCurrentLinkId() {
          return this._curAttrData.extended.urlId;
        }
        parse(e4, t4) {
          let i4, s3 = this._activeBuffer.x, r2 = this._activeBuffer.y, n2 = 0;
          const o2 = this._parseStack.paused;
          if (o2) {
            if (i4 = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, t4)) return this._logSlowResolvingAsync(i4), i4;
            s3 = this._parseStack.cursorStartX, r2 = this._parseStack.cursorStartY, this._parseStack.paused = false, e4.length > b && (n2 = this._parseStack.position + b);
          }
          if (this._logService.logLevel <= v2.LogLevelEnum.DEBUG && this._logService.debug("parsing data" + ("string" == typeof e4 ? ` "${e4}"` : ` "${Array.prototype.map.call(e4, (e5) => String.fromCharCode(e5)).join("")}"`), "string" == typeof e4 ? e4.split("").map((e5) => e5.charCodeAt(0)) : e4), this._parseBuffer.length < e4.length && this._parseBuffer.length < b && (this._parseBuffer = new Uint32Array(Math.min(e4.length, b))), o2 || this._dirtyRowTracker.clearRange(), e4.length > b) for (let t5 = n2; t5 < e4.length; t5 += b) {
            const n3 = t5 + b < e4.length ? t5 + b : e4.length, o3 = "string" == typeof e4 ? this._stringDecoder.decode(e4.substring(t5, n3), this._parseBuffer) : this._utf8Decoder.decode(e4.subarray(t5, n3), this._parseBuffer);
            if (i4 = this._parser.parse(this._parseBuffer, o3)) return this._preserveStack(s3, r2, o3, t5), this._logSlowResolvingAsync(i4), i4;
          }
          else if (!o2) {
            const t5 = "string" == typeof e4 ? this._stringDecoder.decode(e4, this._parseBuffer) : this._utf8Decoder.decode(e4, this._parseBuffer);
            if (i4 = this._parser.parse(this._parseBuffer, t5)) return this._preserveStack(s3, r2, t5, 0), this._logSlowResolvingAsync(i4), i4;
          }
          this._activeBuffer.x === s3 && this._activeBuffer.y === r2 || this._onCursorMove.fire();
          const a2 = this._dirtyRowTracker.end + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp), h3 = this._dirtyRowTracker.start + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
          h3 < this._bufferService.rows && this._onRequestRefreshRows.fire(Math.min(h3, this._bufferService.rows - 1), Math.min(a2, this._bufferService.rows - 1));
        }
        print(e4, t4, i4) {
          let s3, r2;
          const n2 = this._charsetService.charset, o2 = this._optionsService.rawOptions.screenReaderMode, a2 = this._bufferService.cols, h3 = this._coreService.decPrivateModes.wraparound, d2 = this._coreService.modes.insertMode, u2 = this._curAttrData;
          let f2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
          this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._activeBuffer.x && i4 - t4 > 0 && 2 === f2.getWidth(this._activeBuffer.x - 1) && f2.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, u2);
          let v3 = this._parser.precedingJoinState;
          for (let g3 = t4; g3 < i4; ++g3) {
            if (s3 = e4[g3], s3 < 127 && n2) {
              const e5 = n2[String.fromCharCode(s3)];
              e5 && (s3 = e5.charCodeAt(0));
            }
            const t5 = this._unicodeService.charProperties(s3, v3);
            r2 = p2.UnicodeService.extractWidth(t5);
            const i5 = p2.UnicodeService.extractShouldJoin(t5), m2 = i5 ? p2.UnicodeService.extractWidth(v3) : 0;
            if (v3 = t5, o2 && this._onA11yChar.fire((0, c.stringFromCodePoint)(s3)), this._getCurrentLinkId() && this._oscLinkService.addLineToLink(this._getCurrentLinkId(), this._activeBuffer.ybase + this._activeBuffer.y), this._activeBuffer.x + r2 - m2 > a2) {
              if (h3) {
                const e5 = f2;
                let t6 = this._activeBuffer.x - m2;
                for (this._activeBuffer.x = m2, this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData(), true)) : (this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = true), f2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y), m2 > 0 && f2 instanceof l.BufferLine && f2.copyCellsFrom(e5, t6, 0, m2, false); t6 < a2; ) e5.setCellFromCodepoint(t6++, 0, 1, u2);
              } else if (this._activeBuffer.x = a2 - 1, 2 === r2) continue;
            }
            if (i5 && this._activeBuffer.x) {
              const e5 = f2.getWidth(this._activeBuffer.x - 1) ? 1 : 2;
              f2.addCodepointToCell(this._activeBuffer.x - e5, s3, r2);
              for (let e6 = r2 - m2; --e6 >= 0; ) f2.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, u2);
            } else if (d2 && (f2.insertCells(this._activeBuffer.x, r2 - m2, this._activeBuffer.getNullCell(u2)), 2 === f2.getWidth(a2 - 1) && f2.setCellFromCodepoint(a2 - 1, _2.NULL_CELL_CODE, _2.NULL_CELL_WIDTH, u2)), f2.setCellFromCodepoint(this._activeBuffer.x++, s3, r2, u2), r2 > 0) for (; --r2; ) f2.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, u2);
          }
          this._parser.precedingJoinState = v3, this._activeBuffer.x < a2 && i4 - t4 > 0 && 0 === f2.getWidth(this._activeBuffer.x) && !f2.hasContent(this._activeBuffer.x) && f2.setCellFromCodepoint(this._activeBuffer.x, 0, 1, u2), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
        }
        registerCsiHandler(e4, t4) {
          return "t" !== e4.final || e4.prefix || e4.intermediates ? this._parser.registerCsiHandler(e4, t4) : this._parser.registerCsiHandler(e4, (e5) => !w(e5.params[0], this._optionsService.rawOptions.windowOptions) || t4(e5));
        }
        registerDcsHandler(e4, t4) {
          return this._parser.registerDcsHandler(e4, new m.DcsHandler(t4));
        }
        registerEscHandler(e4, t4) {
          return this._parser.registerEscHandler(e4, t4);
        }
        registerOscHandler(e4, t4) {
          return this._parser.registerOscHandler(e4, new g2.OscHandler(t4));
        }
        bell() {
          return this._onRequestBell.fire(), true;
        }
        lineFeed() {
          return this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._optionsService.rawOptions.convertEol && (this._activeBuffer.x = 0), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows ? this._activeBuffer.y = this._bufferService.rows - 1 : this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = false, this._activeBuffer.x >= this._bufferService.cols && this._activeBuffer.x--, this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._onLineFeed.fire(), true;
        }
        carriageReturn() {
          return this._activeBuffer.x = 0, true;
        }
        backspace() {
          if (!this._coreService.decPrivateModes.reverseWraparound) return this._restrictCursor(), this._activeBuffer.x > 0 && this._activeBuffer.x--, true;
          if (this._restrictCursor(this._bufferService.cols), this._activeBuffer.x > 0) this._activeBuffer.x--;
          else if (0 === this._activeBuffer.x && this._activeBuffer.y > this._activeBuffer.scrollTop && this._activeBuffer.y <= this._activeBuffer.scrollBottom && this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)?.isWrapped) {
            this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = false, this._activeBuffer.y--, this._activeBuffer.x = this._bufferService.cols - 1;
            const e4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
            e4.hasWidth(this._activeBuffer.x) && !e4.hasContent(this._activeBuffer.x) && this._activeBuffer.x--;
          }
          return this._restrictCursor(), true;
        }
        tab() {
          if (this._activeBuffer.x >= this._bufferService.cols) return true;
          const e4 = this._activeBuffer.x;
          return this._activeBuffer.x = this._activeBuffer.nextStop(), this._optionsService.rawOptions.screenReaderMode && this._onA11yTab.fire(this._activeBuffer.x - e4), true;
        }
        shiftOut() {
          return this._charsetService.setgLevel(1), true;
        }
        shiftIn() {
          return this._charsetService.setgLevel(0), true;
        }
        _restrictCursor(e4 = this._bufferService.cols - 1) {
          this._activeBuffer.x = Math.min(e4, Math.max(0, this._activeBuffer.x)), this._activeBuffer.y = this._coreService.decPrivateModes.origin ? Math.min(this._activeBuffer.scrollBottom, Math.max(this._activeBuffer.scrollTop, this._activeBuffer.y)) : Math.min(this._bufferService.rows - 1, Math.max(0, this._activeBuffer.y)), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
        }
        _setCursor(e4, t4) {
          this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._coreService.decPrivateModes.origin ? (this._activeBuffer.x = e4, this._activeBuffer.y = this._activeBuffer.scrollTop + t4) : (this._activeBuffer.x = e4, this._activeBuffer.y = t4), this._restrictCursor(), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
        }
        _moveCursor(e4, t4) {
          this._restrictCursor(), this._setCursor(this._activeBuffer.x + e4, this._activeBuffer.y + t4);
        }
        cursorUp(e4) {
          const t4 = this._activeBuffer.y - this._activeBuffer.scrollTop;
          return t4 >= 0 ? this._moveCursor(0, -Math.min(t4, e4.params[0] || 1)) : this._moveCursor(0, -(e4.params[0] || 1)), true;
        }
        cursorDown(e4) {
          const t4 = this._activeBuffer.scrollBottom - this._activeBuffer.y;
          return t4 >= 0 ? this._moveCursor(0, Math.min(t4, e4.params[0] || 1)) : this._moveCursor(0, e4.params[0] || 1), true;
        }
        cursorForward(e4) {
          return this._moveCursor(e4.params[0] || 1, 0), true;
        }
        cursorBackward(e4) {
          return this._moveCursor(-(e4.params[0] || 1), 0), true;
        }
        cursorNextLine(e4) {
          return this.cursorDown(e4), this._activeBuffer.x = 0, true;
        }
        cursorPrecedingLine(e4) {
          return this.cursorUp(e4), this._activeBuffer.x = 0, true;
        }
        cursorCharAbsolute(e4) {
          return this._setCursor((e4.params[0] || 1) - 1, this._activeBuffer.y), true;
        }
        cursorPosition(e4) {
          return this._setCursor(e4.length >= 2 ? (e4.params[1] || 1) - 1 : 0, (e4.params[0] || 1) - 1), true;
        }
        charPosAbsolute(e4) {
          return this._setCursor((e4.params[0] || 1) - 1, this._activeBuffer.y), true;
        }
        hPositionRelative(e4) {
          return this._moveCursor(e4.params[0] || 1, 0), true;
        }
        linePosAbsolute(e4) {
          return this._setCursor(this._activeBuffer.x, (e4.params[0] || 1) - 1), true;
        }
        vPositionRelative(e4) {
          return this._moveCursor(0, e4.params[0] || 1), true;
        }
        hVPosition(e4) {
          return this.cursorPosition(e4), true;
        }
        tabClear(e4) {
          const t4 = e4.params[0];
          return 0 === t4 ? delete this._activeBuffer.tabs[this._activeBuffer.x] : 3 === t4 && (this._activeBuffer.tabs = {}), true;
        }
        cursorForwardTab(e4) {
          if (this._activeBuffer.x >= this._bufferService.cols) return true;
          let t4 = e4.params[0] || 1;
          for (; t4--; ) this._activeBuffer.x = this._activeBuffer.nextStop();
          return true;
        }
        cursorBackwardTab(e4) {
          if (this._activeBuffer.x >= this._bufferService.cols) return true;
          let t4 = e4.params[0] || 1;
          for (; t4--; ) this._activeBuffer.x = this._activeBuffer.prevStop();
          return true;
        }
        selectProtected(e4) {
          const t4 = e4.params[0];
          return 1 === t4 && (this._curAttrData.bg |= 536870912), 2 !== t4 && 0 !== t4 || (this._curAttrData.bg &= -536870913), true;
        }
        _eraseInBufferLine(e4, t4, i4, s3 = false, r2 = false) {
          const n2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4);
          n2.replaceCells(t4, i4, this._activeBuffer.getNullCell(this._eraseAttrData()), r2), s3 && (n2.isWrapped = false);
        }
        _resetBufferLine(e4, t4 = false) {
          const i4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4);
          i4 && (i4.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), t4), this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + e4), i4.isWrapped = false);
        }
        eraseInDisplay(e4, t4 = false) {
          let i4;
          switch (this._restrictCursor(this._bufferService.cols), e4.params[0]) {
            case 0:
              for (i4 = this._activeBuffer.y, this._dirtyRowTracker.markDirty(i4), this._eraseInBufferLine(i4++, this._activeBuffer.x, this._bufferService.cols, 0 === this._activeBuffer.x, t4); i4 < this._bufferService.rows; i4++) this._resetBufferLine(i4, t4);
              this._dirtyRowTracker.markDirty(i4);
              break;
            case 1:
              for (i4 = this._activeBuffer.y, this._dirtyRowTracker.markDirty(i4), this._eraseInBufferLine(i4, 0, this._activeBuffer.x + 1, true, t4), this._activeBuffer.x + 1 >= this._bufferService.cols && (this._activeBuffer.lines.get(i4 + 1).isWrapped = false); i4--; ) this._resetBufferLine(i4, t4);
              this._dirtyRowTracker.markDirty(0);
              break;
            case 2:
              for (i4 = this._bufferService.rows, this._dirtyRowTracker.markDirty(i4 - 1); i4--; ) this._resetBufferLine(i4, t4);
              this._dirtyRowTracker.markDirty(0);
              break;
            case 3:
              const e5 = this._activeBuffer.lines.length - this._bufferService.rows;
              e5 > 0 && (this._activeBuffer.lines.trimStart(e5), this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - e5, 0), this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - e5, 0), this._onScroll.fire(0));
          }
          return true;
        }
        eraseInLine(e4, t4 = false) {
          switch (this._restrictCursor(this._bufferService.cols), e4.params[0]) {
            case 0:
              this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, 0 === this._activeBuffer.x, t4);
              break;
            case 1:
              this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, false, t4);
              break;
            case 2:
              this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, true, t4);
          }
          return this._dirtyRowTracker.markDirty(this._activeBuffer.y), true;
        }
        insertLines(e4) {
          this._restrictCursor();
          let t4 = e4.params[0] || 1;
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true;
          const i4 = this._activeBuffer.ybase + this._activeBuffer.y, s3 = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, r2 = this._bufferService.rows - 1 + this._activeBuffer.ybase - s3 + 1;
          for (; t4--; ) this._activeBuffer.lines.splice(r2 - 1, 1), this._activeBuffer.lines.splice(i4, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, true;
        }
        deleteLines(e4) {
          this._restrictCursor();
          let t4 = e4.params[0] || 1;
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true;
          const i4 = this._activeBuffer.ybase + this._activeBuffer.y;
          let s3;
          for (s3 = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, s3 = this._bufferService.rows - 1 + this._activeBuffer.ybase - s3; t4--; ) this._activeBuffer.lines.splice(i4, 1), this._activeBuffer.lines.splice(s3, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, true;
        }
        insertChars(e4) {
          this._restrictCursor();
          const t4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
          return t4 && (t4.insertCells(this._activeBuffer.x, e4.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), true;
        }
        deleteChars(e4) {
          this._restrictCursor();
          const t4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
          return t4 && (t4.deleteCells(this._activeBuffer.x, e4.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), true;
        }
        scrollUp(e4) {
          let t4 = e4.params[0] || 1;
          for (; t4--; ) this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 1), this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true;
        }
        scrollDown(e4) {
          let t4 = e4.params[0] || 1;
          for (; t4--; ) this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 1), this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 0, this._activeBuffer.getBlankLine(l.DEFAULT_ATTR_DATA));
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true;
        }
        scrollLeft(e4) {
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true;
          const t4 = e4.params[0] || 1;
          for (let e5 = this._activeBuffer.scrollTop; e5 <= this._activeBuffer.scrollBottom; ++e5) {
            const i4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e5);
            i4.deleteCells(0, t4, this._activeBuffer.getNullCell(this._eraseAttrData())), i4.isWrapped = false;
          }
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true;
        }
        scrollRight(e4) {
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true;
          const t4 = e4.params[0] || 1;
          for (let e5 = this._activeBuffer.scrollTop; e5 <= this._activeBuffer.scrollBottom; ++e5) {
            const i4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e5);
            i4.insertCells(0, t4, this._activeBuffer.getNullCell(this._eraseAttrData())), i4.isWrapped = false;
          }
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true;
        }
        insertColumns(e4) {
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true;
          const t4 = e4.params[0] || 1;
          for (let e5 = this._activeBuffer.scrollTop; e5 <= this._activeBuffer.scrollBottom; ++e5) {
            const i4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e5);
            i4.insertCells(this._activeBuffer.x, t4, this._activeBuffer.getNullCell(this._eraseAttrData())), i4.isWrapped = false;
          }
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true;
        }
        deleteColumns(e4) {
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return true;
          const t4 = e4.params[0] || 1;
          for (let e5 = this._activeBuffer.scrollTop; e5 <= this._activeBuffer.scrollBottom; ++e5) {
            const i4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e5);
            i4.deleteCells(this._activeBuffer.x, t4, this._activeBuffer.getNullCell(this._eraseAttrData())), i4.isWrapped = false;
          }
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), true;
        }
        eraseChars(e4) {
          this._restrictCursor();
          const t4 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
          return t4 && (t4.replaceCells(this._activeBuffer.x, this._activeBuffer.x + (e4.params[0] || 1), this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), true;
        }
        repeatPrecedingCharacter(e4) {
          const t4 = this._parser.precedingJoinState;
          if (!t4) return true;
          const i4 = e4.params[0] || 1, s3 = p2.UnicodeService.extractWidth(t4), r2 = this._activeBuffer.x - s3, n2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).getString(r2), o2 = new Uint32Array(n2.length * i4);
          let a2 = 0;
          for (let e5 = 0; e5 < n2.length; ) {
            const t5 = n2.codePointAt(e5) || 0;
            o2[a2++] = t5, e5 += t5 > 65535 ? 2 : 1;
          }
          let h3 = a2;
          for (let e5 = 1; e5 < i4; ++e5) o2.copyWithin(h3, 0, a2), h3 += a2;
          return this.print(o2, 0, h3), true;
        }
        sendDeviceAttributesPrimary(e4) {
          return e4.params[0] > 0 || (this._is("xterm") || this._is("rxvt-unicode") || this._is("screen") ? this._coreService.triggerDataEvent(n.C0.ESC + "[?1;2c") : this._is("linux") && this._coreService.triggerDataEvent(n.C0.ESC + "[?6c")), true;
        }
        sendDeviceAttributesSecondary(e4) {
          return e4.params[0] > 0 || (this._is("xterm") ? this._coreService.triggerDataEvent(n.C0.ESC + "[>0;276;0c") : this._is("rxvt-unicode") ? this._coreService.triggerDataEvent(n.C0.ESC + "[>85;95;0c") : this._is("linux") ? this._coreService.triggerDataEvent(e4.params[0] + "c") : this._is("screen") && this._coreService.triggerDataEvent(n.C0.ESC + "[>83;40003;0c")), true;
        }
        _is(e4) {
          return 0 === (this._optionsService.rawOptions.termName + "").indexOf(e4);
        }
        setMode(e4) {
          for (let t4 = 0; t4 < e4.length; t4++) switch (e4.params[t4]) {
            case 4:
              this._coreService.modes.insertMode = true;
              break;
            case 20:
              this._optionsService.options.convertEol = true;
          }
          return true;
        }
        setModePrivate(e4) {
          for (let t4 = 0; t4 < e4.length; t4++) switch (e4.params[t4]) {
            case 1:
              this._coreService.decPrivateModes.applicationCursorKeys = true;
              break;
            case 2:
              this._charsetService.setgCharset(0, o.DEFAULT_CHARSET), this._charsetService.setgCharset(1, o.DEFAULT_CHARSET), this._charsetService.setgCharset(2, o.DEFAULT_CHARSET), this._charsetService.setgCharset(3, o.DEFAULT_CHARSET);
              break;
            case 3:
              this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(132, this._bufferService.rows), this._onRequestReset.fire());
              break;
            case 6:
              this._coreService.decPrivateModes.origin = true, this._setCursor(0, 0);
              break;
            case 7:
              this._coreService.decPrivateModes.wraparound = true;
              break;
            case 12:
              this._optionsService.options.cursorBlink = true;
              break;
            case 45:
              this._coreService.decPrivateModes.reverseWraparound = true;
              break;
            case 66:
              this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = true, this._onRequestSyncScrollBar.fire();
              break;
            case 9:
              this._coreMouseService.activeProtocol = "X10";
              break;
            case 1e3:
              this._coreMouseService.activeProtocol = "VT200";
              break;
            case 1002:
              this._coreMouseService.activeProtocol = "DRAG";
              break;
            case 1003:
              this._coreMouseService.activeProtocol = "ANY";
              break;
            case 1004:
              this._coreService.decPrivateModes.sendFocus = true, this._onRequestSendFocus.fire();
              break;
            case 1005:
              this._logService.debug("DECSET 1005 not supported (see #2507)");
              break;
            case 1006:
              this._coreMouseService.activeEncoding = "SGR";
              break;
            case 1015:
              this._logService.debug("DECSET 1015 not supported (see #2507)");
              break;
            case 1016:
              this._coreMouseService.activeEncoding = "SGR_PIXELS";
              break;
            case 25:
              this._coreService.isCursorHidden = false;
              break;
            case 1048:
              this.saveCursor();
              break;
            case 1049:
              this.saveCursor();
            case 47:
            case 1047:
              this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()), this._coreService.isCursorInitialized = true, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire();
              break;
            case 2004:
              this._coreService.decPrivateModes.bracketedPasteMode = true;
          }
          return true;
        }
        resetMode(e4) {
          for (let t4 = 0; t4 < e4.length; t4++) switch (e4.params[t4]) {
            case 4:
              this._coreService.modes.insertMode = false;
              break;
            case 20:
              this._optionsService.options.convertEol = false;
          }
          return true;
        }
        resetModePrivate(e4) {
          for (let t4 = 0; t4 < e4.length; t4++) switch (e4.params[t4]) {
            case 1:
              this._coreService.decPrivateModes.applicationCursorKeys = false;
              break;
            case 3:
              this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(80, this._bufferService.rows), this._onRequestReset.fire());
              break;
            case 6:
              this._coreService.decPrivateModes.origin = false, this._setCursor(0, 0);
              break;
            case 7:
              this._coreService.decPrivateModes.wraparound = false;
              break;
            case 12:
              this._optionsService.options.cursorBlink = false;
              break;
            case 45:
              this._coreService.decPrivateModes.reverseWraparound = false;
              break;
            case 66:
              this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = false, this._onRequestSyncScrollBar.fire();
              break;
            case 9:
            case 1e3:
            case 1002:
            case 1003:
              this._coreMouseService.activeProtocol = "NONE";
              break;
            case 1004:
              this._coreService.decPrivateModes.sendFocus = false;
              break;
            case 1005:
              this._logService.debug("DECRST 1005 not supported (see #2507)");
              break;
            case 1006:
            case 1016:
              this._coreMouseService.activeEncoding = "DEFAULT";
              break;
            case 1015:
              this._logService.debug("DECRST 1015 not supported (see #2507)");
              break;
            case 25:
              this._coreService.isCursorHidden = true;
              break;
            case 1048:
              this.restoreCursor();
              break;
            case 1049:
            case 47:
            case 1047:
              this._bufferService.buffers.activateNormalBuffer(), 1049 === e4.params[t4] && this.restoreCursor(), this._coreService.isCursorInitialized = true, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire();
              break;
            case 2004:
              this._coreService.decPrivateModes.bracketedPasteMode = false;
          }
          return true;
        }
        requestMode(e4, t4) {
          const i4 = this._coreService.decPrivateModes, { activeProtocol: s3, activeEncoding: r2 } = this._coreMouseService, o2 = this._coreService, { buffers: a2, cols: h3 } = this._bufferService, { active: c2, alt: l2 } = a2, d2 = this._optionsService.rawOptions, _3 = /* @__PURE__ */ __name((e5) => e5 ? 1 : 2, "_"), u2 = e4.params[0];
          return f2 = u2, v3 = t4 ? 2 === u2 ? 4 : 4 === u2 ? _3(o2.modes.insertMode) : 12 === u2 ? 3 : 20 === u2 ? _3(d2.convertEol) : 0 : 1 === u2 ? _3(i4.applicationCursorKeys) : 3 === u2 ? d2.windowOptions.setWinLines ? 80 === h3 ? 2 : 132 === h3 ? 1 : 0 : 0 : 6 === u2 ? _3(i4.origin) : 7 === u2 ? _3(i4.wraparound) : 8 === u2 ? 3 : 9 === u2 ? _3("X10" === s3) : 12 === u2 ? _3(d2.cursorBlink) : 25 === u2 ? _3(!o2.isCursorHidden) : 45 === u2 ? _3(i4.reverseWraparound) : 66 === u2 ? _3(i4.applicationKeypad) : 67 === u2 ? 4 : 1e3 === u2 ? _3("VT200" === s3) : 1002 === u2 ? _3("DRAG" === s3) : 1003 === u2 ? _3("ANY" === s3) : 1004 === u2 ? _3(i4.sendFocus) : 1005 === u2 ? 4 : 1006 === u2 ? _3("SGR" === r2) : 1015 === u2 ? 4 : 1016 === u2 ? _3("SGR_PIXELS" === r2) : 1048 === u2 ? 1 : 47 === u2 || 1047 === u2 || 1049 === u2 ? _3(c2 === l2) : 2004 === u2 ? _3(i4.bracketedPasteMode) : 0, o2.triggerDataEvent(`${n.C0.ESC}[${t4 ? "" : "?"}${f2};${v3}$y`), true;
          var f2, v3;
        }
        _updateAttrColor(e4, t4, i4, s3, r2) {
          return 2 === t4 ? (e4 |= 50331648, e4 &= -16777216, e4 |= f.AttributeData.fromColorRGB([i4, s3, r2])) : 5 === t4 && (e4 &= -50331904, e4 |= 33554432 | 255 & i4), e4;
        }
        _extractColor(e4, t4, i4) {
          const s3 = [0, 0, -1, 0, 0, 0];
          let r2 = 0, n2 = 0;
          do {
            if (s3[n2 + r2] = e4.params[t4 + n2], e4.hasSubParams(t4 + n2)) {
              const i5 = e4.getSubParams(t4 + n2);
              let o2 = 0;
              do {
                5 === s3[1] && (r2 = 1), s3[n2 + o2 + 1 + r2] = i5[o2];
              } while (++o2 < i5.length && o2 + n2 + 1 + r2 < s3.length);
              break;
            }
            if (5 === s3[1] && n2 + r2 >= 2 || 2 === s3[1] && n2 + r2 >= 5) break;
            s3[1] && (r2 = 1);
          } while (++n2 + t4 < e4.length && n2 + r2 < s3.length);
          for (let e5 = 2; e5 < s3.length; ++e5) -1 === s3[e5] && (s3[e5] = 0);
          switch (s3[0]) {
            case 38:
              i4.fg = this._updateAttrColor(i4.fg, s3[1], s3[3], s3[4], s3[5]);
              break;
            case 48:
              i4.bg = this._updateAttrColor(i4.bg, s3[1], s3[3], s3[4], s3[5]);
              break;
            case 58:
              i4.extended = i4.extended.clone(), i4.extended.underlineColor = this._updateAttrColor(i4.extended.underlineColor, s3[1], s3[3], s3[4], s3[5]);
          }
          return n2;
        }
        _processUnderline(e4, t4) {
          t4.extended = t4.extended.clone(), (!~e4 || e4 > 5) && (e4 = 1), t4.extended.underlineStyle = e4, t4.fg |= 268435456, 0 === e4 && (t4.fg &= -268435457), t4.updateExtended();
        }
        _processSGR0(e4) {
          e4.fg = l.DEFAULT_ATTR_DATA.fg, e4.bg = l.DEFAULT_ATTR_DATA.bg, e4.extended = e4.extended.clone(), e4.extended.underlineStyle = 0, e4.extended.underlineColor &= -67108864, e4.updateExtended();
        }
        charAttributes(e4) {
          if (1 === e4.length && 0 === e4.params[0]) return this._processSGR0(this._curAttrData), true;
          const t4 = e4.length;
          let i4;
          const s3 = this._curAttrData;
          for (let r2 = 0; r2 < t4; r2++) i4 = e4.params[r2], i4 >= 30 && i4 <= 37 ? (s3.fg &= -50331904, s3.fg |= 16777216 | i4 - 30) : i4 >= 40 && i4 <= 47 ? (s3.bg &= -50331904, s3.bg |= 16777216 | i4 - 40) : i4 >= 90 && i4 <= 97 ? (s3.fg &= -50331904, s3.fg |= 16777224 | i4 - 90) : i4 >= 100 && i4 <= 107 ? (s3.bg &= -50331904, s3.bg |= 16777224 | i4 - 100) : 0 === i4 ? this._processSGR0(s3) : 1 === i4 ? s3.fg |= 134217728 : 3 === i4 ? s3.bg |= 67108864 : 4 === i4 ? (s3.fg |= 268435456, this._processUnderline(e4.hasSubParams(r2) ? e4.getSubParams(r2)[0] : 1, s3)) : 5 === i4 ? s3.fg |= 536870912 : 7 === i4 ? s3.fg |= 67108864 : 8 === i4 ? s3.fg |= 1073741824 : 9 === i4 ? s3.fg |= 2147483648 : 2 === i4 ? s3.bg |= 134217728 : 21 === i4 ? this._processUnderline(2, s3) : 22 === i4 ? (s3.fg &= -134217729, s3.bg &= -134217729) : 23 === i4 ? s3.bg &= -67108865 : 24 === i4 ? (s3.fg &= -268435457, this._processUnderline(0, s3)) : 25 === i4 ? s3.fg &= -536870913 : 27 === i4 ? s3.fg &= -67108865 : 28 === i4 ? s3.fg &= -1073741825 : 29 === i4 ? s3.fg &= 2147483647 : 39 === i4 ? (s3.fg &= -67108864, s3.fg |= 16777215 & l.DEFAULT_ATTR_DATA.fg) : 49 === i4 ? (s3.bg &= -67108864, s3.bg |= 16777215 & l.DEFAULT_ATTR_DATA.bg) : 38 === i4 || 48 === i4 || 58 === i4 ? r2 += this._extractColor(e4, r2, s3) : 53 === i4 ? s3.bg |= 1073741824 : 55 === i4 ? s3.bg &= -1073741825 : 59 === i4 ? (s3.extended = s3.extended.clone(), s3.extended.underlineColor = -1, s3.updateExtended()) : 100 === i4 ? (s3.fg &= -67108864, s3.fg |= 16777215 & l.DEFAULT_ATTR_DATA.fg, s3.bg &= -67108864, s3.bg |= 16777215 & l.DEFAULT_ATTR_DATA.bg) : this._logService.debug("Unknown SGR attribute: %d.", i4);
          return true;
        }
        deviceStatus(e4) {
          switch (e4.params[0]) {
            case 5:
              this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);
              break;
            case 6:
              const e5 = this._activeBuffer.y + 1, t4 = this._activeBuffer.x + 1;
              this._coreService.triggerDataEvent(`${n.C0.ESC}[${e5};${t4}R`);
          }
          return true;
        }
        deviceStatusPrivate(e4) {
          if (6 === e4.params[0]) {
            const e5 = this._activeBuffer.y + 1, t4 = this._activeBuffer.x + 1;
            this._coreService.triggerDataEvent(`${n.C0.ESC}[?${e5};${t4}R`);
          }
          return true;
        }
        softReset(e4) {
          return this._coreService.isCursorHidden = false, this._onRequestSyncScrollBar.fire(), this._activeBuffer.scrollTop = 0, this._activeBuffer.scrollBottom = this._bufferService.rows - 1, this._curAttrData = l.DEFAULT_ATTR_DATA.clone(), this._coreService.reset(), this._charsetService.reset(), this._activeBuffer.savedX = 0, this._activeBuffer.savedY = this._activeBuffer.ybase, this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg, this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg, this._activeBuffer.savedCharset = this._charsetService.charset, this._coreService.decPrivateModes.origin = false, true;
        }
        setCursorStyle(e4) {
          const t4 = e4.params[0] || 1;
          switch (t4) {
            case 1:
            case 2:
              this._optionsService.options.cursorStyle = "block";
              break;
            case 3:
            case 4:
              this._optionsService.options.cursorStyle = "underline";
              break;
            case 5:
            case 6:
              this._optionsService.options.cursorStyle = "bar";
          }
          const i4 = t4 % 2 == 1;
          return this._optionsService.options.cursorBlink = i4, true;
        }
        setScrollRegion(e4) {
          const t4 = e4.params[0] || 1;
          let i4;
          return (e4.length < 2 || (i4 = e4.params[1]) > this._bufferService.rows || 0 === i4) && (i4 = this._bufferService.rows), i4 > t4 && (this._activeBuffer.scrollTop = t4 - 1, this._activeBuffer.scrollBottom = i4 - 1, this._setCursor(0, 0)), true;
        }
        windowOptions(e4) {
          if (!w(e4.params[0], this._optionsService.rawOptions.windowOptions)) return true;
          const t4 = e4.length > 1 ? e4.params[1] : 0;
          switch (e4.params[0]) {
            case 14:
              2 !== t4 && this._onRequestWindowsOptionsReport.fire(y2.GET_WIN_SIZE_PIXELS);
              break;
            case 16:
              this._onRequestWindowsOptionsReport.fire(y2.GET_CELL_SIZE_PIXELS);
              break;
            case 18:
              this._bufferService && this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);
              break;
            case 22:
              0 !== t4 && 2 !== t4 || (this._windowTitleStack.push(this._windowTitle), this._windowTitleStack.length > 10 && this._windowTitleStack.shift()), 0 !== t4 && 1 !== t4 || (this._iconNameStack.push(this._iconName), this._iconNameStack.length > 10 && this._iconNameStack.shift());
              break;
            case 23:
              0 !== t4 && 2 !== t4 || this._windowTitleStack.length && this.setTitle(this._windowTitleStack.pop()), 0 !== t4 && 1 !== t4 || this._iconNameStack.length && this.setIconName(this._iconNameStack.pop());
          }
          return true;
        }
        saveCursor(e4) {
          return this._activeBuffer.savedX = this._activeBuffer.x, this._activeBuffer.savedY = this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg, this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg, this._activeBuffer.savedCharset = this._charsetService.charset, true;
        }
        restoreCursor(e4) {
          return this._activeBuffer.x = this._activeBuffer.savedX || 0, this._activeBuffer.y = Math.max(this._activeBuffer.savedY - this._activeBuffer.ybase, 0), this._curAttrData.fg = this._activeBuffer.savedCurAttrData.fg, this._curAttrData.bg = this._activeBuffer.savedCurAttrData.bg, this._charsetService.charset = this._savedCharset, this._activeBuffer.savedCharset && (this._charsetService.charset = this._activeBuffer.savedCharset), this._restrictCursor(), true;
        }
        setTitle(e4) {
          return this._windowTitle = e4, this._onTitleChange.fire(e4), true;
        }
        setIconName(e4) {
          return this._iconName = e4, true;
        }
        setOrReportIndexedColor(e4) {
          const t4 = [], i4 = e4.split(";");
          for (; i4.length > 1; ) {
            const e5 = i4.shift(), s3 = i4.shift();
            if (/^\d+$/.exec(e5)) {
              const i5 = parseInt(e5);
              if (D(i5)) if ("?" === s3) t4.push({ type: 0, index: i5 });
              else {
                const e6 = (0, S.parseColor)(s3);
                e6 && t4.push({ type: 1, index: i5, color: e6 });
              }
            }
          }
          return t4.length && this._onColor.fire(t4), true;
        }
        setHyperlink(e4) {
          const t4 = e4.split(";");
          return !(t4.length < 2) && (t4[1] ? this._createHyperlink(t4[0], t4[1]) : !t4[0] && this._finishHyperlink());
        }
        _createHyperlink(e4, t4) {
          this._getCurrentLinkId() && this._finishHyperlink();
          const i4 = e4.split(":");
          let s3;
          const r2 = i4.findIndex((e5) => e5.startsWith("id="));
          return -1 !== r2 && (s3 = i4[r2].slice(3) || void 0), this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = this._oscLinkService.registerLink({ id: s3, uri: t4 }), this._curAttrData.updateExtended(), true;
        }
        _finishHyperlink() {
          return this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = 0, this._curAttrData.updateExtended(), true;
        }
        _setOrReportSpecialColor(e4, t4) {
          const i4 = e4.split(";");
          for (let e5 = 0; e5 < i4.length && !(t4 >= this._specialColors.length); ++e5, ++t4) if ("?" === i4[e5]) this._onColor.fire([{ type: 0, index: this._specialColors[t4] }]);
          else {
            const s3 = (0, S.parseColor)(i4[e5]);
            s3 && this._onColor.fire([{ type: 1, index: this._specialColors[t4], color: s3 }]);
          }
          return true;
        }
        setOrReportFgColor(e4) {
          return this._setOrReportSpecialColor(e4, 0);
        }
        setOrReportBgColor(e4) {
          return this._setOrReportSpecialColor(e4, 1);
        }
        setOrReportCursorColor(e4) {
          return this._setOrReportSpecialColor(e4, 2);
        }
        restoreIndexedColor(e4) {
          if (!e4) return this._onColor.fire([{ type: 2 }]), true;
          const t4 = [], i4 = e4.split(";");
          for (let e5 = 0; e5 < i4.length; ++e5) if (/^\d+$/.exec(i4[e5])) {
            const s3 = parseInt(i4[e5]);
            D(s3) && t4.push({ type: 2, index: s3 });
          }
          return t4.length && this._onColor.fire(t4), true;
        }
        restoreFgColor(e4) {
          return this._onColor.fire([{ type: 2, index: 256 }]), true;
        }
        restoreBgColor(e4) {
          return this._onColor.fire([{ type: 2, index: 257 }]), true;
        }
        restoreCursorColor(e4) {
          return this._onColor.fire([{ type: 2, index: 258 }]), true;
        }
        nextLine() {
          return this._activeBuffer.x = 0, this.index(), true;
        }
        keypadApplicationMode() {
          return this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = true, this._onRequestSyncScrollBar.fire(), true;
        }
        keypadNumericMode() {
          return this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = false, this._onRequestSyncScrollBar.fire(), true;
        }
        selectDefaultCharset() {
          return this._charsetService.setgLevel(0), this._charsetService.setgCharset(0, o.DEFAULT_CHARSET), true;
        }
        selectCharset(e4) {
          return 2 !== e4.length ? (this.selectDefaultCharset(), true) : ("/" === e4[0] || this._charsetService.setgCharset(C[e4[0]], o.CHARSETS[e4[1]] || o.DEFAULT_CHARSET), true);
        }
        index() {
          return this._restrictCursor(), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._restrictCursor(), true;
        }
        tabSet() {
          return this._activeBuffer.tabs[this._activeBuffer.x] = true, true;
        }
        reverseIndex() {
          if (this._restrictCursor(), this._activeBuffer.y === this._activeBuffer.scrollTop) {
            const e4 = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop;
            this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, e4, 1), this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData())), this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
          } else this._activeBuffer.y--, this._restrictCursor();
          return true;
        }
        fullReset() {
          return this._parser.reset(), this._onRequestReset.fire(), true;
        }
        reset() {
          this._curAttrData = l.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = l.DEFAULT_ATTR_DATA.clone();
        }
        _eraseAttrData() {
          return this._eraseAttrDataInternal.bg &= -67108864, this._eraseAttrDataInternal.bg |= 67108863 & this._curAttrData.bg, this._eraseAttrDataInternal;
        }
        setgLevel(e4) {
          return this._charsetService.setgLevel(e4), true;
        }
        screenAlignmentPattern() {
          const e4 = new u.CellData();
          e4.content = 1 << 22 | "E".charCodeAt(0), e4.fg = this._curAttrData.fg, e4.bg = this._curAttrData.bg, this._setCursor(0, 0);
          for (let t4 = 0; t4 < this._bufferService.rows; ++t4) {
            const i4 = this._activeBuffer.ybase + this._activeBuffer.y + t4, s3 = this._activeBuffer.lines.get(i4);
            s3 && (s3.fill(e4), s3.isWrapped = false);
          }
          return this._dirtyRowTracker.markAllDirty(), this._setCursor(0, 0), true;
        }
        requestStatusString(e4, t4) {
          const i4 = this._bufferService.buffer, s3 = this._optionsService.rawOptions;
          return ((e5) => (this._coreService.triggerDataEvent(`${n.C0.ESC}${e5}${n.C0.ESC}\\`), true))('"q' === e4 ? `P1$r${this._curAttrData.isProtected() ? 1 : 0}"q` : '"p' === e4 ? 'P1$r61;1"p' : "r" === e4 ? `P1$r${i4.scrollTop + 1};${i4.scrollBottom + 1}r` : "m" === e4 ? "P1$r0m" : " q" === e4 ? `P1$r${{ block: 2, underline: 4, bar: 6 }[s3.cursorStyle] - (s3.cursorBlink ? 1 : 0)} q` : "P0$r");
        }
        markRangeDirty(e4, t4) {
          this._dirtyRowTracker.markRangeDirty(e4, t4);
        }
      }
      t3.InputHandler = k;
      let L = class {
        static {
          __name(this, "L");
        }
        constructor(e4) {
          this._bufferService = e4, this.clearRange();
        }
        clearRange() {
          this.start = this._bufferService.buffer.y, this.end = this._bufferService.buffer.y;
        }
        markDirty(e4) {
          e4 < this.start ? this.start = e4 : e4 > this.end && (this.end = e4);
        }
        markRangeDirty(e4, t4) {
          e4 > t4 && (E = e4, e4 = t4, t4 = E), e4 < this.start && (this.start = e4), t4 > this.end && (this.end = t4);
        }
        markAllDirty() {
          this.markRangeDirty(0, this._bufferService.rows - 1);
        }
      };
      function D(e4) {
        return 0 <= e4 && e4 < 256;
      }
      __name(D, "D");
      L = s2([r(0, v2.IBufferService)], L);
    }, 844: (e3, t3) => {
      function i3(e4) {
        for (const t4 of e4) t4.dispose();
        e4.length = 0;
      }
      __name(i3, "i");
      Object.defineProperty(t3, "__esModule", { value: true }), t3.getDisposeArrayDisposable = t3.disposeArray = t3.toDisposable = t3.MutableDisposable = t3.Disposable = void 0, t3.Disposable = class {
        constructor() {
          this._disposables = [], this._isDisposed = false;
        }
        dispose() {
          this._isDisposed = true;
          for (const e4 of this._disposables) e4.dispose();
          this._disposables.length = 0;
        }
        register(e4) {
          return this._disposables.push(e4), e4;
        }
        unregister(e4) {
          const t4 = this._disposables.indexOf(e4);
          -1 !== t4 && this._disposables.splice(t4, 1);
        }
      }, t3.MutableDisposable = class {
        constructor() {
          this._isDisposed = false;
        }
        get value() {
          return this._isDisposed ? void 0 : this._value;
        }
        set value(e4) {
          this._isDisposed || e4 === this._value || (this._value?.dispose(), this._value = e4);
        }
        clear() {
          this.value = void 0;
        }
        dispose() {
          this._isDisposed = true, this._value?.dispose(), this._value = void 0;
        }
      }, t3.toDisposable = function(e4) {
        return { dispose: e4 };
      }, t3.disposeArray = i3, t3.getDisposeArrayDisposable = function(e4) {
        return { dispose: /* @__PURE__ */ __name(() => i3(e4), "dispose") };
      };
    }, 1505: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.FourKeyMap = t3.TwoKeyMap = void 0;
      class i3 {
        static {
          __name(this, "i");
        }
        constructor() {
          this._data = {};
        }
        set(e4, t4, i4) {
          this._data[e4] || (this._data[e4] = {}), this._data[e4][t4] = i4;
        }
        get(e4, t4) {
          return this._data[e4] ? this._data[e4][t4] : void 0;
        }
        clear() {
          this._data = {};
        }
      }
      t3.TwoKeyMap = i3, t3.FourKeyMap = class {
        constructor() {
          this._data = new i3();
        }
        set(e4, t4, s2, r, n) {
          this._data.get(e4, t4) || this._data.set(e4, t4, new i3()), this._data.get(e4, t4).set(s2, r, n);
        }
        get(e4, t4, i4, s2) {
          return this._data.get(e4, t4)?.get(i4, s2);
        }
        clear() {
          this._data.clear();
        }
      };
    }, 6114: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.isChromeOS = t3.isLinux = t3.isWindows = t3.isIphone = t3.isIpad = t3.isMac = t3.getSafariVersion = t3.isSafari = t3.isLegacyEdge = t3.isFirefox = t3.isNode = void 0, t3.isNode = "undefined" != typeof process && "title" in process;
      const i3 = t3.isNode ? "node" : navigator.userAgent, s2 = t3.isNode ? "node" : navigator.platform;
      t3.isFirefox = i3.includes("Firefox"), t3.isLegacyEdge = i3.includes("Edge"), t3.isSafari = /^((?!chrome|android).)*safari/i.test(i3), t3.getSafariVersion = function() {
        if (!t3.isSafari) return 0;
        const e4 = i3.match(/Version\/(\d+)/);
        return null === e4 || e4.length < 2 ? 0 : parseInt(e4[1]);
      }, t3.isMac = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(s2), t3.isIpad = "iPad" === s2, t3.isIphone = "iPhone" === s2, t3.isWindows = ["Windows", "Win16", "Win32", "WinCE"].includes(s2), t3.isLinux = s2.indexOf("Linux") >= 0, t3.isChromeOS = /\bCrOS\b/.test(i3);
    }, 6106: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.SortedList = void 0;
      let i3 = 0;
      t3.SortedList = class {
        constructor(e4) {
          this._getKey = e4, this._array = [];
        }
        clear() {
          this._array.length = 0;
        }
        insert(e4) {
          0 !== this._array.length ? (i3 = this._search(this._getKey(e4)), this._array.splice(i3, 0, e4)) : this._array.push(e4);
        }
        delete(e4) {
          if (0 === this._array.length) return false;
          const t4 = this._getKey(e4);
          if (void 0 === t4) return false;
          if (i3 = this._search(t4), -1 === i3) return false;
          if (this._getKey(this._array[i3]) !== t4) return false;
          do {
            if (this._array[i3] === e4) return this._array.splice(i3, 1), true;
          } while (++i3 < this._array.length && this._getKey(this._array[i3]) === t4);
          return false;
        }
        *getKeyIterator(e4) {
          if (0 !== this._array.length && (i3 = this._search(e4), !(i3 < 0 || i3 >= this._array.length) && this._getKey(this._array[i3]) === e4)) do {
            yield this._array[i3];
          } while (++i3 < this._array.length && this._getKey(this._array[i3]) === e4);
        }
        forEachByKey(e4, t4) {
          if (0 !== this._array.length && (i3 = this._search(e4), !(i3 < 0 || i3 >= this._array.length) && this._getKey(this._array[i3]) === e4)) do {
            t4(this._array[i3]);
          } while (++i3 < this._array.length && this._getKey(this._array[i3]) === e4);
        }
        values() {
          return [...this._array].values();
        }
        _search(e4) {
          let t4 = 0, i4 = this._array.length - 1;
          for (; i4 >= t4; ) {
            let s2 = t4 + i4 >> 1;
            const r = this._getKey(this._array[s2]);
            if (r > e4) i4 = s2 - 1;
            else {
              if (!(r < e4)) {
                for (; s2 > 0 && this._getKey(this._array[s2 - 1]) === e4; ) s2--;
                return s2;
              }
              t4 = s2 + 1;
            }
          }
          return t4;
        }
      };
    }, 7226: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.DebouncedIdleTask = t3.IdleTaskQueue = t3.PriorityTaskQueue = void 0;
      const s2 = i3(6114);
      class r {
        static {
          __name(this, "r");
        }
        constructor() {
          this._tasks = [], this._i = 0;
        }
        enqueue(e4) {
          this._tasks.push(e4), this._start();
        }
        flush() {
          for (; this._i < this._tasks.length; ) this._tasks[this._i]() || this._i++;
          this.clear();
        }
        clear() {
          this._idleCallback && (this._cancelCallback(this._idleCallback), this._idleCallback = void 0), this._i = 0, this._tasks.length = 0;
        }
        _start() {
          this._idleCallback || (this._idleCallback = this._requestCallback(this._process.bind(this)));
        }
        _process(e4) {
          this._idleCallback = void 0;
          let t4 = 0, i4 = 0, s3 = e4.timeRemaining(), r2 = 0;
          for (; this._i < this._tasks.length; ) {
            if (t4 = Date.now(), this._tasks[this._i]() || this._i++, t4 = Math.max(1, Date.now() - t4), i4 = Math.max(t4, i4), r2 = e4.timeRemaining(), 1.5 * i4 > r2) return s3 - t4 < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s3 - t4))}ms`), void this._start();
            s3 = r2;
          }
          this.clear();
        }
      }
      class n extends r {
        static {
          __name(this, "n");
        }
        _requestCallback(e4) {
          return setTimeout(() => e4(this._createDeadline(16)));
        }
        _cancelCallback(e4) {
          clearTimeout(e4);
        }
        _createDeadline(e4) {
          const t4 = Date.now() + e4;
          return { timeRemaining: /* @__PURE__ */ __name(() => Math.max(0, t4 - Date.now()), "timeRemaining") };
        }
      }
      t3.PriorityTaskQueue = n, t3.IdleTaskQueue = !s2.isNode && "requestIdleCallback" in window ? class extends r {
        _requestCallback(e4) {
          return requestIdleCallback(e4);
        }
        _cancelCallback(e4) {
          cancelIdleCallback(e4);
        }
      } : n, t3.DebouncedIdleTask = class {
        constructor() {
          this._queue = new t3.IdleTaskQueue();
        }
        set(e4) {
          this._queue.clear(), this._queue.enqueue(e4);
        }
        flush() {
          this._queue.flush();
        }
      };
    }, 9282: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.updateWindowsModeWrappedState = void 0;
      const s2 = i3(643);
      t3.updateWindowsModeWrappedState = function(e4) {
        const t4 = e4.buffer.lines.get(e4.buffer.ybase + e4.buffer.y - 1), i4 = t4?.get(e4.cols - 1), r = e4.buffer.lines.get(e4.buffer.ybase + e4.buffer.y);
        r && i4 && (r.isWrapped = i4[s2.CHAR_DATA_CODE_INDEX] !== s2.NULL_CELL_CODE && i4[s2.CHAR_DATA_CODE_INDEX] !== s2.WHITESPACE_CELL_CODE);
      };
    }, 3734: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.ExtendedAttrs = t3.AttributeData = void 0;
      class i3 {
        static {
          __name(this, "i");
        }
        constructor() {
          this.fg = 0, this.bg = 0, this.extended = new s2();
        }
        static toColorRGB(e4) {
          return [e4 >>> 16 & 255, e4 >>> 8 & 255, 255 & e4];
        }
        static fromColorRGB(e4) {
          return (255 & e4[0]) << 16 | (255 & e4[1]) << 8 | 255 & e4[2];
        }
        clone() {
          const e4 = new i3();
          return e4.fg = this.fg, e4.bg = this.bg, e4.extended = this.extended.clone(), e4;
        }
        isInverse() {
          return 67108864 & this.fg;
        }
        isBold() {
          return 134217728 & this.fg;
        }
        isUnderline() {
          return this.hasExtendedAttrs() && 0 !== this.extended.underlineStyle ? 1 : 268435456 & this.fg;
        }
        isBlink() {
          return 536870912 & this.fg;
        }
        isInvisible() {
          return 1073741824 & this.fg;
        }
        isItalic() {
          return 67108864 & this.bg;
        }
        isDim() {
          return 134217728 & this.bg;
        }
        isStrikethrough() {
          return 2147483648 & this.fg;
        }
        isProtected() {
          return 536870912 & this.bg;
        }
        isOverline() {
          return 1073741824 & this.bg;
        }
        getFgColorMode() {
          return 50331648 & this.fg;
        }
        getBgColorMode() {
          return 50331648 & this.bg;
        }
        isFgRGB() {
          return 50331648 == (50331648 & this.fg);
        }
        isBgRGB() {
          return 50331648 == (50331648 & this.bg);
        }
        isFgPalette() {
          return 16777216 == (50331648 & this.fg) || 33554432 == (50331648 & this.fg);
        }
        isBgPalette() {
          return 16777216 == (50331648 & this.bg) || 33554432 == (50331648 & this.bg);
        }
        isFgDefault() {
          return 0 == (50331648 & this.fg);
        }
        isBgDefault() {
          return 0 == (50331648 & this.bg);
        }
        isAttributeDefault() {
          return 0 === this.fg && 0 === this.bg;
        }
        getFgColor() {
          switch (50331648 & this.fg) {
            case 16777216:
            case 33554432:
              return 255 & this.fg;
            case 50331648:
              return 16777215 & this.fg;
            default:
              return -1;
          }
        }
        getBgColor() {
          switch (50331648 & this.bg) {
            case 16777216:
            case 33554432:
              return 255 & this.bg;
            case 50331648:
              return 16777215 & this.bg;
            default:
              return -1;
          }
        }
        hasExtendedAttrs() {
          return 268435456 & this.bg;
        }
        updateExtended() {
          this.extended.isEmpty() ? this.bg &= -268435457 : this.bg |= 268435456;
        }
        getUnderlineColor() {
          if (268435456 & this.bg && ~this.extended.underlineColor) switch (50331648 & this.extended.underlineColor) {
            case 16777216:
            case 33554432:
              return 255 & this.extended.underlineColor;
            case 50331648:
              return 16777215 & this.extended.underlineColor;
            default:
              return this.getFgColor();
          }
          return this.getFgColor();
        }
        getUnderlineColorMode() {
          return 268435456 & this.bg && ~this.extended.underlineColor ? 50331648 & this.extended.underlineColor : this.getFgColorMode();
        }
        isUnderlineColorRGB() {
          return 268435456 & this.bg && ~this.extended.underlineColor ? 50331648 == (50331648 & this.extended.underlineColor) : this.isFgRGB();
        }
        isUnderlineColorPalette() {
          return 268435456 & this.bg && ~this.extended.underlineColor ? 16777216 == (50331648 & this.extended.underlineColor) || 33554432 == (50331648 & this.extended.underlineColor) : this.isFgPalette();
        }
        isUnderlineColorDefault() {
          return 268435456 & this.bg && ~this.extended.underlineColor ? 0 == (50331648 & this.extended.underlineColor) : this.isFgDefault();
        }
        getUnderlineStyle() {
          return 268435456 & this.fg ? 268435456 & this.bg ? this.extended.underlineStyle : 1 : 0;
        }
        getUnderlineVariantOffset() {
          return this.extended.underlineVariantOffset;
        }
      }
      t3.AttributeData = i3;
      class s2 {
        static {
          __name(this, "s");
        }
        get ext() {
          return this._urlId ? -469762049 & this._ext | this.underlineStyle << 26 : this._ext;
        }
        set ext(e4) {
          this._ext = e4;
        }
        get underlineStyle() {
          return this._urlId ? 5 : (469762048 & this._ext) >> 26;
        }
        set underlineStyle(e4) {
          this._ext &= -469762049, this._ext |= e4 << 26 & 469762048;
        }
        get underlineColor() {
          return 67108863 & this._ext;
        }
        set underlineColor(e4) {
          this._ext &= -67108864, this._ext |= 67108863 & e4;
        }
        get urlId() {
          return this._urlId;
        }
        set urlId(e4) {
          this._urlId = e4;
        }
        get underlineVariantOffset() {
          const e4 = (3758096384 & this._ext) >> 29;
          return e4 < 0 ? 4294967288 ^ e4 : e4;
        }
        set underlineVariantOffset(e4) {
          this._ext &= 536870911, this._ext |= e4 << 29 & 3758096384;
        }
        constructor(e4 = 0, t4 = 0) {
          this._ext = 0, this._urlId = 0, this._ext = e4, this._urlId = t4;
        }
        clone() {
          return new s2(this._ext, this._urlId);
        }
        isEmpty() {
          return 0 === this.underlineStyle && 0 === this._urlId;
        }
      }
      t3.ExtendedAttrs = s2;
    }, 9092: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.Buffer = t3.MAX_BUFFER_SIZE = void 0;
      const s2 = i3(6349), r = i3(7226), n = i3(3734), o = i3(8437), a = i3(4634), h2 = i3(511), c = i3(643), l = i3(4863), d = i3(7116);
      t3.MAX_BUFFER_SIZE = 4294967295, t3.Buffer = class {
        constructor(e4, t4, i4) {
          this._hasScrollback = e4, this._optionsService = t4, this._bufferService = i4, this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.tabs = {}, this.savedY = 0, this.savedX = 0, this.savedCurAttrData = o.DEFAULT_ATTR_DATA.clone(), this.savedCharset = d.DEFAULT_CHARSET, this.markers = [], this._nullCell = h2.CellData.fromCharData([0, c.NULL_CELL_CHAR, c.NULL_CELL_WIDTH, c.NULL_CELL_CODE]), this._whitespaceCell = h2.CellData.fromCharData([0, c.WHITESPACE_CELL_CHAR, c.WHITESPACE_CELL_WIDTH, c.WHITESPACE_CELL_CODE]), this._isClearing = false, this._memoryCleanupQueue = new r.IdleTaskQueue(), this._memoryCleanupPosition = 0, this._cols = this._bufferService.cols, this._rows = this._bufferService.rows, this.lines = new s2.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops();
        }
        getNullCell(e4) {
          return e4 ? (this._nullCell.fg = e4.fg, this._nullCell.bg = e4.bg, this._nullCell.extended = e4.extended) : (this._nullCell.fg = 0, this._nullCell.bg = 0, this._nullCell.extended = new n.ExtendedAttrs()), this._nullCell;
        }
        getWhitespaceCell(e4) {
          return e4 ? (this._whitespaceCell.fg = e4.fg, this._whitespaceCell.bg = e4.bg, this._whitespaceCell.extended = e4.extended) : (this._whitespaceCell.fg = 0, this._whitespaceCell.bg = 0, this._whitespaceCell.extended = new n.ExtendedAttrs()), this._whitespaceCell;
        }
        getBlankLine(e4, t4) {
          return new o.BufferLine(this._bufferService.cols, this.getNullCell(e4), t4);
        }
        get hasScrollback() {
          return this._hasScrollback && this.lines.maxLength > this._rows;
        }
        get isCursorInViewport() {
          const e4 = this.ybase + this.y - this.ydisp;
          return e4 >= 0 && e4 < this._rows;
        }
        _getCorrectBufferLength(e4) {
          if (!this._hasScrollback) return e4;
          const i4 = e4 + this._optionsService.rawOptions.scrollback;
          return i4 > t3.MAX_BUFFER_SIZE ? t3.MAX_BUFFER_SIZE : i4;
        }
        fillViewportRows(e4) {
          if (0 === this.lines.length) {
            void 0 === e4 && (e4 = o.DEFAULT_ATTR_DATA);
            let t4 = this._rows;
            for (; t4--; ) this.lines.push(this.getBlankLine(e4));
          }
        }
        clear() {
          this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.lines = new s2.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops();
        }
        resize(e4, t4) {
          const i4 = this.getNullCell(o.DEFAULT_ATTR_DATA);
          let s3 = 0;
          const r2 = this._getCorrectBufferLength(t4);
          if (r2 > this.lines.maxLength && (this.lines.maxLength = r2), this.lines.length > 0) {
            if (this._cols < e4) for (let t5 = 0; t5 < this.lines.length; t5++) s3 += +this.lines.get(t5).resize(e4, i4);
            let n2 = 0;
            if (this._rows < t4) for (let s4 = this._rows; s4 < t4; s4++) this.lines.length < t4 + this.ybase && (this._optionsService.rawOptions.windowsMode || void 0 !== this._optionsService.rawOptions.windowsPty.backend || void 0 !== this._optionsService.rawOptions.windowsPty.buildNumber ? this.lines.push(new o.BufferLine(e4, i4)) : this.ybase > 0 && this.lines.length <= this.ybase + this.y + n2 + 1 ? (this.ybase--, n2++, this.ydisp > 0 && this.ydisp--) : this.lines.push(new o.BufferLine(e4, i4)));
            else for (let e5 = this._rows; e5 > t4; e5--) this.lines.length > t4 + this.ybase && (this.lines.length > this.ybase + this.y + 1 ? this.lines.pop() : (this.ybase++, this.ydisp++));
            if (r2 < this.lines.maxLength) {
              const e5 = this.lines.length - r2;
              e5 > 0 && (this.lines.trimStart(e5), this.ybase = Math.max(this.ybase - e5, 0), this.ydisp = Math.max(this.ydisp - e5, 0), this.savedY = Math.max(this.savedY - e5, 0)), this.lines.maxLength = r2;
            }
            this.x = Math.min(this.x, e4 - 1), this.y = Math.min(this.y, t4 - 1), n2 && (this.y += n2), this.savedX = Math.min(this.savedX, e4 - 1), this.scrollTop = 0;
          }
          if (this.scrollBottom = t4 - 1, this._isReflowEnabled && (this._reflow(e4, t4), this._cols > e4)) for (let t5 = 0; t5 < this.lines.length; t5++) s3 += +this.lines.get(t5).resize(e4, i4);
          this._cols = e4, this._rows = t4, this._memoryCleanupQueue.clear(), s3 > 0.1 * this.lines.length && (this._memoryCleanupPosition = 0, this._memoryCleanupQueue.enqueue(() => this._batchedMemoryCleanup()));
        }
        _batchedMemoryCleanup() {
          let e4 = true;
          this._memoryCleanupPosition >= this.lines.length && (this._memoryCleanupPosition = 0, e4 = false);
          let t4 = 0;
          for (; this._memoryCleanupPosition < this.lines.length; ) if (t4 += this.lines.get(this._memoryCleanupPosition++).cleanupMemory(), t4 > 100) return true;
          return e4;
        }
        get _isReflowEnabled() {
          const e4 = this._optionsService.rawOptions.windowsPty;
          return e4 && e4.buildNumber ? this._hasScrollback && "conpty" === e4.backend && e4.buildNumber >= 21376 : this._hasScrollback && !this._optionsService.rawOptions.windowsMode;
        }
        _reflow(e4, t4) {
          this._cols !== e4 && (e4 > this._cols ? this._reflowLarger(e4, t4) : this._reflowSmaller(e4, t4));
        }
        _reflowLarger(e4, t4) {
          const i4 = (0, a.reflowLargerGetLinesToRemove)(this.lines, this._cols, e4, this.ybase + this.y, this.getNullCell(o.DEFAULT_ATTR_DATA));
          if (i4.length > 0) {
            const s3 = (0, a.reflowLargerCreateNewLayout)(this.lines, i4);
            (0, a.reflowLargerApplyNewLayout)(this.lines, s3.layout), this._reflowLargerAdjustViewport(e4, t4, s3.countRemoved);
          }
        }
        _reflowLargerAdjustViewport(e4, t4, i4) {
          const s3 = this.getNullCell(o.DEFAULT_ATTR_DATA);
          let r2 = i4;
          for (; r2-- > 0; ) 0 === this.ybase ? (this.y > 0 && this.y--, this.lines.length < t4 && this.lines.push(new o.BufferLine(e4, s3))) : (this.ydisp === this.ybase && this.ydisp--, this.ybase--);
          this.savedY = Math.max(this.savedY - i4, 0);
        }
        _reflowSmaller(e4, t4) {
          const i4 = this.getNullCell(o.DEFAULT_ATTR_DATA), s3 = [];
          let r2 = 0;
          for (let n2 = this.lines.length - 1; n2 >= 0; n2--) {
            let h3 = this.lines.get(n2);
            if (!h3 || !h3.isWrapped && h3.getTrimmedLength() <= e4) continue;
            const c2 = [h3];
            for (; h3.isWrapped && n2 > 0; ) h3 = this.lines.get(--n2), c2.unshift(h3);
            const l2 = this.ybase + this.y;
            if (l2 >= n2 && l2 < n2 + c2.length) continue;
            const d2 = c2[c2.length - 1].getTrimmedLength(), _2 = (0, a.reflowSmallerGetNewLineLengths)(c2, this._cols, e4), u = _2.length - c2.length;
            let f;
            f = 0 === this.ybase && this.y !== this.lines.length - 1 ? Math.max(0, this.y - this.lines.maxLength + u) : Math.max(0, this.lines.length - this.lines.maxLength + u);
            const v2 = [];
            for (let e5 = 0; e5 < u; e5++) {
              const e6 = this.getBlankLine(o.DEFAULT_ATTR_DATA, true);
              v2.push(e6);
            }
            v2.length > 0 && (s3.push({ start: n2 + c2.length + r2, newLines: v2 }), r2 += v2.length), c2.push(...v2);
            let p2 = _2.length - 1, g2 = _2[p2];
            0 === g2 && (p2--, g2 = _2[p2]);
            let m = c2.length - u - 1, S = d2;
            for (; m >= 0; ) {
              const e5 = Math.min(S, g2);
              if (void 0 === c2[p2]) break;
              if (c2[p2].copyCellsFrom(c2[m], S - e5, g2 - e5, e5, true), g2 -= e5, 0 === g2 && (p2--, g2 = _2[p2]), S -= e5, 0 === S) {
                m--;
                const e6 = Math.max(m, 0);
                S = (0, a.getWrappedLineTrimmedLength)(c2, e6, this._cols);
              }
            }
            for (let t5 = 0; t5 < c2.length; t5++) _2[t5] < e4 && c2[t5].setCell(_2[t5], i4);
            let C = u - f;
            for (; C-- > 0; ) 0 === this.ybase ? this.y < t4 - 1 ? (this.y++, this.lines.pop()) : (this.ybase++, this.ydisp++) : this.ybase < Math.min(this.lines.maxLength, this.lines.length + r2) - t4 && (this.ybase === this.ydisp && this.ydisp++, this.ybase++);
            this.savedY = Math.min(this.savedY + u, this.ybase + t4 - 1);
          }
          if (s3.length > 0) {
            const e5 = [], t5 = [];
            for (let e6 = 0; e6 < this.lines.length; e6++) t5.push(this.lines.get(e6));
            const i5 = this.lines.length;
            let n2 = i5 - 1, o2 = 0, a2 = s3[o2];
            this.lines.length = Math.min(this.lines.maxLength, this.lines.length + r2);
            let h3 = 0;
            for (let c3 = Math.min(this.lines.maxLength - 1, i5 + r2 - 1); c3 >= 0; c3--) if (a2 && a2.start > n2 + h3) {
              for (let e6 = a2.newLines.length - 1; e6 >= 0; e6--) this.lines.set(c3--, a2.newLines[e6]);
              c3++, e5.push({ index: n2 + 1, amount: a2.newLines.length }), h3 += a2.newLines.length, a2 = s3[++o2];
            } else this.lines.set(c3, t5[n2--]);
            let c2 = 0;
            for (let t6 = e5.length - 1; t6 >= 0; t6--) e5[t6].index += c2, this.lines.onInsertEmitter.fire(e5[t6]), c2 += e5[t6].amount;
            const l2 = Math.max(0, i5 + r2 - this.lines.maxLength);
            l2 > 0 && this.lines.onTrimEmitter.fire(l2);
          }
        }
        translateBufferLineToString(e4, t4, i4 = 0, s3) {
          const r2 = this.lines.get(e4);
          return r2 ? r2.translateToString(t4, i4, s3) : "";
        }
        getWrappedRangeForLine(e4) {
          let t4 = e4, i4 = e4;
          for (; t4 > 0 && this.lines.get(t4).isWrapped; ) t4--;
          for (; i4 + 1 < this.lines.length && this.lines.get(i4 + 1).isWrapped; ) i4++;
          return { first: t4, last: i4 };
        }
        setupTabStops(e4) {
          for (null != e4 ? this.tabs[e4] || (e4 = this.prevStop(e4)) : (this.tabs = {}, e4 = 0); e4 < this._cols; e4 += this._optionsService.rawOptions.tabStopWidth) this.tabs[e4] = true;
        }
        prevStop(e4) {
          for (null == e4 && (e4 = this.x); !this.tabs[--e4] && e4 > 0; ) ;
          return e4 >= this._cols ? this._cols - 1 : e4 < 0 ? 0 : e4;
        }
        nextStop(e4) {
          for (null == e4 && (e4 = this.x); !this.tabs[++e4] && e4 < this._cols; ) ;
          return e4 >= this._cols ? this._cols - 1 : e4 < 0 ? 0 : e4;
        }
        clearMarkers(e4) {
          this._isClearing = true;
          for (let t4 = 0; t4 < this.markers.length; t4++) this.markers[t4].line === e4 && (this.markers[t4].dispose(), this.markers.splice(t4--, 1));
          this._isClearing = false;
        }
        clearAllMarkers() {
          this._isClearing = true;
          for (let e4 = 0; e4 < this.markers.length; e4++) this.markers[e4].dispose(), this.markers.splice(e4--, 1);
          this._isClearing = false;
        }
        addMarker(e4) {
          const t4 = new l.Marker(e4);
          return this.markers.push(t4), t4.register(this.lines.onTrim((e5) => {
            t4.line -= e5, t4.line < 0 && t4.dispose();
          })), t4.register(this.lines.onInsert((e5) => {
            t4.line >= e5.index && (t4.line += e5.amount);
          })), t4.register(this.lines.onDelete((e5) => {
            t4.line >= e5.index && t4.line < e5.index + e5.amount && t4.dispose(), t4.line > e5.index && (t4.line -= e5.amount);
          })), t4.register(t4.onDispose(() => this._removeMarker(t4))), t4;
        }
        _removeMarker(e4) {
          this._isClearing || this.markers.splice(this.markers.indexOf(e4), 1);
        }
      };
    }, 8437: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.BufferLine = t3.DEFAULT_ATTR_DATA = void 0;
      const s2 = i3(3734), r = i3(511), n = i3(643), o = i3(482);
      t3.DEFAULT_ATTR_DATA = Object.freeze(new s2.AttributeData());
      let a = 0;
      class h2 {
        static {
          __name(this, "h");
        }
        constructor(e4, t4, i4 = false) {
          this.isWrapped = i4, this._combined = {}, this._extendedAttrs = {}, this._data = new Uint32Array(3 * e4);
          const s3 = t4 || r.CellData.fromCharData([0, n.NULL_CELL_CHAR, n.NULL_CELL_WIDTH, n.NULL_CELL_CODE]);
          for (let t5 = 0; t5 < e4; ++t5) this.setCell(t5, s3);
          this.length = e4;
        }
        get(e4) {
          const t4 = this._data[3 * e4 + 0], i4 = 2097151 & t4;
          return [this._data[3 * e4 + 1], 2097152 & t4 ? this._combined[e4] : i4 ? (0, o.stringFromCodePoint)(i4) : "", t4 >> 22, 2097152 & t4 ? this._combined[e4].charCodeAt(this._combined[e4].length - 1) : i4];
        }
        set(e4, t4) {
          this._data[3 * e4 + 1] = t4[n.CHAR_DATA_ATTR_INDEX], t4[n.CHAR_DATA_CHAR_INDEX].length > 1 ? (this._combined[e4] = t4[1], this._data[3 * e4 + 0] = 2097152 | e4 | t4[n.CHAR_DATA_WIDTH_INDEX] << 22) : this._data[3 * e4 + 0] = t4[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | t4[n.CHAR_DATA_WIDTH_INDEX] << 22;
        }
        getWidth(e4) {
          return this._data[3 * e4 + 0] >> 22;
        }
        hasWidth(e4) {
          return 12582912 & this._data[3 * e4 + 0];
        }
        getFg(e4) {
          return this._data[3 * e4 + 1];
        }
        getBg(e4) {
          return this._data[3 * e4 + 2];
        }
        hasContent(e4) {
          return 4194303 & this._data[3 * e4 + 0];
        }
        getCodePoint(e4) {
          const t4 = this._data[3 * e4 + 0];
          return 2097152 & t4 ? this._combined[e4].charCodeAt(this._combined[e4].length - 1) : 2097151 & t4;
        }
        isCombined(e4) {
          return 2097152 & this._data[3 * e4 + 0];
        }
        getString(e4) {
          const t4 = this._data[3 * e4 + 0];
          return 2097152 & t4 ? this._combined[e4] : 2097151 & t4 ? (0, o.stringFromCodePoint)(2097151 & t4) : "";
        }
        isProtected(e4) {
          return 536870912 & this._data[3 * e4 + 2];
        }
        loadCell(e4, t4) {
          return a = 3 * e4, t4.content = this._data[a + 0], t4.fg = this._data[a + 1], t4.bg = this._data[a + 2], 2097152 & t4.content && (t4.combinedData = this._combined[e4]), 268435456 & t4.bg && (t4.extended = this._extendedAttrs[e4]), t4;
        }
        setCell(e4, t4) {
          2097152 & t4.content && (this._combined[e4] = t4.combinedData), 268435456 & t4.bg && (this._extendedAttrs[e4] = t4.extended), this._data[3 * e4 + 0] = t4.content, this._data[3 * e4 + 1] = t4.fg, this._data[3 * e4 + 2] = t4.bg;
        }
        setCellFromCodepoint(e4, t4, i4, s3) {
          268435456 & s3.bg && (this._extendedAttrs[e4] = s3.extended), this._data[3 * e4 + 0] = t4 | i4 << 22, this._data[3 * e4 + 1] = s3.fg, this._data[3 * e4 + 2] = s3.bg;
        }
        addCodepointToCell(e4, t4, i4) {
          let s3 = this._data[3 * e4 + 0];
          2097152 & s3 ? this._combined[e4] += (0, o.stringFromCodePoint)(t4) : 2097151 & s3 ? (this._combined[e4] = (0, o.stringFromCodePoint)(2097151 & s3) + (0, o.stringFromCodePoint)(t4), s3 &= -2097152, s3 |= 2097152) : s3 = t4 | 1 << 22, i4 && (s3 &= -12582913, s3 |= i4 << 22), this._data[3 * e4 + 0] = s3;
        }
        insertCells(e4, t4, i4) {
          if ((e4 %= this.length) && 2 === this.getWidth(e4 - 1) && this.setCellFromCodepoint(e4 - 1, 0, 1, i4), t4 < this.length - e4) {
            const s3 = new r.CellData();
            for (let i5 = this.length - e4 - t4 - 1; i5 >= 0; --i5) this.setCell(e4 + t4 + i5, this.loadCell(e4 + i5, s3));
            for (let s4 = 0; s4 < t4; ++s4) this.setCell(e4 + s4, i4);
          } else for (let t5 = e4; t5 < this.length; ++t5) this.setCell(t5, i4);
          2 === this.getWidth(this.length - 1) && this.setCellFromCodepoint(this.length - 1, 0, 1, i4);
        }
        deleteCells(e4, t4, i4) {
          if (e4 %= this.length, t4 < this.length - e4) {
            const s3 = new r.CellData();
            for (let i5 = 0; i5 < this.length - e4 - t4; ++i5) this.setCell(e4 + i5, this.loadCell(e4 + t4 + i5, s3));
            for (let e5 = this.length - t4; e5 < this.length; ++e5) this.setCell(e5, i4);
          } else for (let t5 = e4; t5 < this.length; ++t5) this.setCell(t5, i4);
          e4 && 2 === this.getWidth(e4 - 1) && this.setCellFromCodepoint(e4 - 1, 0, 1, i4), 0 !== this.getWidth(e4) || this.hasContent(e4) || this.setCellFromCodepoint(e4, 0, 1, i4);
        }
        replaceCells(e4, t4, i4, s3 = false) {
          if (s3) for (e4 && 2 === this.getWidth(e4 - 1) && !this.isProtected(e4 - 1) && this.setCellFromCodepoint(e4 - 1, 0, 1, i4), t4 < this.length && 2 === this.getWidth(t4 - 1) && !this.isProtected(t4) && this.setCellFromCodepoint(t4, 0, 1, i4); e4 < t4 && e4 < this.length; ) this.isProtected(e4) || this.setCell(e4, i4), e4++;
          else for (e4 && 2 === this.getWidth(e4 - 1) && this.setCellFromCodepoint(e4 - 1, 0, 1, i4), t4 < this.length && 2 === this.getWidth(t4 - 1) && this.setCellFromCodepoint(t4, 0, 1, i4); e4 < t4 && e4 < this.length; ) this.setCell(e4++, i4);
        }
        resize(e4, t4) {
          if (e4 === this.length) return 4 * this._data.length * 2 < this._data.buffer.byteLength;
          const i4 = 3 * e4;
          if (e4 > this.length) {
            if (this._data.buffer.byteLength >= 4 * i4) this._data = new Uint32Array(this._data.buffer, 0, i4);
            else {
              const e5 = new Uint32Array(i4);
              e5.set(this._data), this._data = e5;
            }
            for (let i5 = this.length; i5 < e4; ++i5) this.setCell(i5, t4);
          } else {
            this._data = this._data.subarray(0, i4);
            const t5 = Object.keys(this._combined);
            for (let i5 = 0; i5 < t5.length; i5++) {
              const s4 = parseInt(t5[i5], 10);
              s4 >= e4 && delete this._combined[s4];
            }
            const s3 = Object.keys(this._extendedAttrs);
            for (let t6 = 0; t6 < s3.length; t6++) {
              const i5 = parseInt(s3[t6], 10);
              i5 >= e4 && delete this._extendedAttrs[i5];
            }
          }
          return this.length = e4, 4 * i4 * 2 < this._data.buffer.byteLength;
        }
        cleanupMemory() {
          if (4 * this._data.length * 2 < this._data.buffer.byteLength) {
            const e4 = new Uint32Array(this._data.length);
            return e4.set(this._data), this._data = e4, 1;
          }
          return 0;
        }
        fill(e4, t4 = false) {
          if (t4) for (let t5 = 0; t5 < this.length; ++t5) this.isProtected(t5) || this.setCell(t5, e4);
          else {
            this._combined = {}, this._extendedAttrs = {};
            for (let t5 = 0; t5 < this.length; ++t5) this.setCell(t5, e4);
          }
        }
        copyFrom(e4) {
          this.length !== e4.length ? this._data = new Uint32Array(e4._data) : this._data.set(e4._data), this.length = e4.length, this._combined = {};
          for (const t4 in e4._combined) this._combined[t4] = e4._combined[t4];
          this._extendedAttrs = {};
          for (const t4 in e4._extendedAttrs) this._extendedAttrs[t4] = e4._extendedAttrs[t4];
          this.isWrapped = e4.isWrapped;
        }
        clone() {
          const e4 = new h2(0);
          e4._data = new Uint32Array(this._data), e4.length = this.length;
          for (const t4 in this._combined) e4._combined[t4] = this._combined[t4];
          for (const t4 in this._extendedAttrs) e4._extendedAttrs[t4] = this._extendedAttrs[t4];
          return e4.isWrapped = this.isWrapped, e4;
        }
        getTrimmedLength() {
          for (let e4 = this.length - 1; e4 >= 0; --e4) if (4194303 & this._data[3 * e4 + 0]) return e4 + (this._data[3 * e4 + 0] >> 22);
          return 0;
        }
        getNoBgTrimmedLength() {
          for (let e4 = this.length - 1; e4 >= 0; --e4) if (4194303 & this._data[3 * e4 + 0] || 50331648 & this._data[3 * e4 + 2]) return e4 + (this._data[3 * e4 + 0] >> 22);
          return 0;
        }
        copyCellsFrom(e4, t4, i4, s3, r2) {
          const n2 = e4._data;
          if (r2) for (let r3 = s3 - 1; r3 >= 0; r3--) {
            for (let e5 = 0; e5 < 3; e5++) this._data[3 * (i4 + r3) + e5] = n2[3 * (t4 + r3) + e5];
            268435456 & n2[3 * (t4 + r3) + 2] && (this._extendedAttrs[i4 + r3] = e4._extendedAttrs[t4 + r3]);
          }
          else for (let r3 = 0; r3 < s3; r3++) {
            for (let e5 = 0; e5 < 3; e5++) this._data[3 * (i4 + r3) + e5] = n2[3 * (t4 + r3) + e5];
            268435456 & n2[3 * (t4 + r3) + 2] && (this._extendedAttrs[i4 + r3] = e4._extendedAttrs[t4 + r3]);
          }
          const o2 = Object.keys(e4._combined);
          for (let s4 = 0; s4 < o2.length; s4++) {
            const r3 = parseInt(o2[s4], 10);
            r3 >= t4 && (this._combined[r3 - t4 + i4] = e4._combined[r3]);
          }
        }
        translateToString(e4, t4, i4, s3) {
          t4 = t4 ?? 0, i4 = i4 ?? this.length, e4 && (i4 = Math.min(i4, this.getTrimmedLength())), s3 && (s3.length = 0);
          let r2 = "";
          for (; t4 < i4; ) {
            const e5 = this._data[3 * t4 + 0], i5 = 2097151 & e5, a2 = 2097152 & e5 ? this._combined[t4] : i5 ? (0, o.stringFromCodePoint)(i5) : n.WHITESPACE_CELL_CHAR;
            if (r2 += a2, s3) for (let e6 = 0; e6 < a2.length; ++e6) s3.push(t4);
            t4 += e5 >> 22 || 1;
          }
          return s3 && s3.push(t4), r2;
        }
      }
      t3.BufferLine = h2;
    }, 4841: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.getRangeLength = void 0, t3.getRangeLength = function(e4, t4) {
        if (e4.start.y > e4.end.y) throw new Error(`Buffer range end (${e4.end.x}, ${e4.end.y}) cannot be before start (${e4.start.x}, ${e4.start.y})`);
        return t4 * (e4.end.y - e4.start.y) + (e4.end.x - e4.start.x + 1);
      };
    }, 4634: (e3, t3) => {
      function i3(e4, t4, i4) {
        if (t4 === e4.length - 1) return e4[t4].getTrimmedLength();
        const s2 = !e4[t4].hasContent(i4 - 1) && 1 === e4[t4].getWidth(i4 - 1), r = 2 === e4[t4 + 1].getWidth(0);
        return s2 && r ? i4 - 1 : i4;
      }
      __name(i3, "i");
      Object.defineProperty(t3, "__esModule", { value: true }), t3.getWrappedLineTrimmedLength = t3.reflowSmallerGetNewLineLengths = t3.reflowLargerApplyNewLayout = t3.reflowLargerCreateNewLayout = t3.reflowLargerGetLinesToRemove = void 0, t3.reflowLargerGetLinesToRemove = function(e4, t4, s2, r, n) {
        const o = [];
        for (let a = 0; a < e4.length - 1; a++) {
          let h2 = a, c = e4.get(++h2);
          if (!c.isWrapped) continue;
          const l = [e4.get(a)];
          for (; h2 < e4.length && c.isWrapped; ) l.push(c), c = e4.get(++h2);
          if (r >= a && r < h2) {
            a += l.length - 1;
            continue;
          }
          let d = 0, _2 = i3(l, d, t4), u = 1, f = 0;
          for (; u < l.length; ) {
            const e5 = i3(l, u, t4), r2 = e5 - f, o2 = s2 - _2, a2 = Math.min(r2, o2);
            l[d].copyCellsFrom(l[u], f, _2, a2, false), _2 += a2, _2 === s2 && (d++, _2 = 0), f += a2, f === e5 && (u++, f = 0), 0 === _2 && 0 !== d && 2 === l[d - 1].getWidth(s2 - 1) && (l[d].copyCellsFrom(l[d - 1], s2 - 1, _2++, 1, false), l[d - 1].setCell(s2 - 1, n));
          }
          l[d].replaceCells(_2, s2, n);
          let v2 = 0;
          for (let e5 = l.length - 1; e5 > 0 && (e5 > d || 0 === l[e5].getTrimmedLength()); e5--) v2++;
          v2 > 0 && (o.push(a + l.length - v2), o.push(v2)), a += l.length - 1;
        }
        return o;
      }, t3.reflowLargerCreateNewLayout = function(e4, t4) {
        const i4 = [];
        let s2 = 0, r = t4[s2], n = 0;
        for (let o = 0; o < e4.length; o++) if (r === o) {
          const i5 = t4[++s2];
          e4.onDeleteEmitter.fire({ index: o - n, amount: i5 }), o += i5 - 1, n += i5, r = t4[++s2];
        } else i4.push(o);
        return { layout: i4, countRemoved: n };
      }, t3.reflowLargerApplyNewLayout = function(e4, t4) {
        const i4 = [];
        for (let s2 = 0; s2 < t4.length; s2++) i4.push(e4.get(t4[s2]));
        for (let t5 = 0; t5 < i4.length; t5++) e4.set(t5, i4[t5]);
        e4.length = t4.length;
      }, t3.reflowSmallerGetNewLineLengths = function(e4, t4, s2) {
        const r = [], n = e4.map((s3, r2) => i3(e4, r2, t4)).reduce((e5, t5) => e5 + t5);
        let o = 0, a = 0, h2 = 0;
        for (; h2 < n; ) {
          if (n - h2 < s2) {
            r.push(n - h2);
            break;
          }
          o += s2;
          const c = i3(e4, a, t4);
          o > c && (o -= c, a++);
          const l = 2 === e4[a].getWidth(o - 1);
          l && o--;
          const d = l ? s2 - 1 : s2;
          r.push(d), h2 += d;
        }
        return r;
      }, t3.getWrappedLineTrimmedLength = i3;
    }, 5295: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.BufferSet = void 0;
      const s2 = i3(8460), r = i3(844), n = i3(9092);
      class o extends r.Disposable {
        static {
          __name(this, "o");
        }
        constructor(e4, t4) {
          super(), this._optionsService = e4, this._bufferService = t4, this._onBufferActivate = this.register(new s2.EventEmitter()), this.onBufferActivate = this._onBufferActivate.event, this.reset(), this.register(this._optionsService.onSpecificOptionChange("scrollback", () => this.resize(this._bufferService.cols, this._bufferService.rows))), this.register(this._optionsService.onSpecificOptionChange("tabStopWidth", () => this.setupTabStops()));
        }
        reset() {
          this._normal = new n.Buffer(true, this._optionsService, this._bufferService), this._normal.fillViewportRows(), this._alt = new n.Buffer(false, this._optionsService, this._bufferService), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }), this.setupTabStops();
        }
        get alt() {
          return this._alt;
        }
        get active() {
          return this._activeBuffer;
        }
        get normal() {
          return this._normal;
        }
        activateNormalBuffer() {
          this._activeBuffer !== this._normal && (this._normal.x = this._alt.x, this._normal.y = this._alt.y, this._alt.clearAllMarkers(), this._alt.clear(), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }));
        }
        activateAltBuffer(e4) {
          this._activeBuffer !== this._alt && (this._alt.fillViewportRows(e4), this._alt.x = this._normal.x, this._alt.y = this._normal.y, this._activeBuffer = this._alt, this._onBufferActivate.fire({ activeBuffer: this._alt, inactiveBuffer: this._normal }));
        }
        resize(e4, t4) {
          this._normal.resize(e4, t4), this._alt.resize(e4, t4), this.setupTabStops(e4);
        }
        setupTabStops(e4) {
          this._normal.setupTabStops(e4), this._alt.setupTabStops(e4);
        }
      }
      t3.BufferSet = o;
    }, 511: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CellData = void 0;
      const s2 = i3(482), r = i3(643), n = i3(3734);
      class o extends n.AttributeData {
        static {
          __name(this, "o");
        }
        constructor() {
          super(...arguments), this.content = 0, this.fg = 0, this.bg = 0, this.extended = new n.ExtendedAttrs(), this.combinedData = "";
        }
        static fromCharData(e4) {
          const t4 = new o();
          return t4.setFromCharData(e4), t4;
        }
        isCombined() {
          return 2097152 & this.content;
        }
        getWidth() {
          return this.content >> 22;
        }
        getChars() {
          return 2097152 & this.content ? this.combinedData : 2097151 & this.content ? (0, s2.stringFromCodePoint)(2097151 & this.content) : "";
        }
        getCode() {
          return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : 2097151 & this.content;
        }
        setFromCharData(e4) {
          this.fg = e4[r.CHAR_DATA_ATTR_INDEX], this.bg = 0;
          let t4 = false;
          if (e4[r.CHAR_DATA_CHAR_INDEX].length > 2) t4 = true;
          else if (2 === e4[r.CHAR_DATA_CHAR_INDEX].length) {
            const i4 = e4[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);
            if (55296 <= i4 && i4 <= 56319) {
              const s3 = e4[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);
              56320 <= s3 && s3 <= 57343 ? this.content = 1024 * (i4 - 55296) + s3 - 56320 + 65536 | e4[r.CHAR_DATA_WIDTH_INDEX] << 22 : t4 = true;
            } else t4 = true;
          } else this.content = e4[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | e4[r.CHAR_DATA_WIDTH_INDEX] << 22;
          t4 && (this.combinedData = e4[r.CHAR_DATA_CHAR_INDEX], this.content = 2097152 | e4[r.CHAR_DATA_WIDTH_INDEX] << 22);
        }
        getAsCharData() {
          return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
        }
      }
      t3.CellData = o;
    }, 643: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.WHITESPACE_CELL_CODE = t3.WHITESPACE_CELL_WIDTH = t3.WHITESPACE_CELL_CHAR = t3.NULL_CELL_CODE = t3.NULL_CELL_WIDTH = t3.NULL_CELL_CHAR = t3.CHAR_DATA_CODE_INDEX = t3.CHAR_DATA_WIDTH_INDEX = t3.CHAR_DATA_CHAR_INDEX = t3.CHAR_DATA_ATTR_INDEX = t3.DEFAULT_EXT = t3.DEFAULT_ATTR = t3.DEFAULT_COLOR = void 0, t3.DEFAULT_COLOR = 0, t3.DEFAULT_ATTR = 256 | t3.DEFAULT_COLOR << 9, t3.DEFAULT_EXT = 0, t3.CHAR_DATA_ATTR_INDEX = 0, t3.CHAR_DATA_CHAR_INDEX = 1, t3.CHAR_DATA_WIDTH_INDEX = 2, t3.CHAR_DATA_CODE_INDEX = 3, t3.NULL_CELL_CHAR = "", t3.NULL_CELL_WIDTH = 1, t3.NULL_CELL_CODE = 0, t3.WHITESPACE_CELL_CHAR = " ", t3.WHITESPACE_CELL_WIDTH = 1, t3.WHITESPACE_CELL_CODE = 32;
    }, 4863: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.Marker = void 0;
      const s2 = i3(8460), r = i3(844);
      class n {
        static {
          __name(this, "n");
        }
        get id() {
          return this._id;
        }
        constructor(e4) {
          this.line = e4, this.isDisposed = false, this._disposables = [], this._id = n._nextId++, this._onDispose = this.register(new s2.EventEmitter()), this.onDispose = this._onDispose.event;
        }
        dispose() {
          this.isDisposed || (this.isDisposed = true, this.line = -1, this._onDispose.fire(), (0, r.disposeArray)(this._disposables), this._disposables.length = 0);
        }
        register(e4) {
          return this._disposables.push(e4), e4;
        }
      }
      t3.Marker = n, n._nextId = 1;
    }, 7116: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.DEFAULT_CHARSET = t3.CHARSETS = void 0, t3.CHARSETS = {}, t3.DEFAULT_CHARSET = t3.CHARSETS.B, t3.CHARSETS[0] = { "`": "◆", a: "▒", b: "␉", c: "␌", d: "␍", e: "␊", f: "°", g: "±", h: "␤", i: "␋", j: "┘", k: "┐", l: "┌", m: "└", n: "┼", o: "⎺", p: "⎻", q: "─", r: "⎼", s: "⎽", t: "├", u: "┤", v: "┴", w: "┬", x: "│", y: "≤", z: "≥", "{": "π", "|": "≠", "}": "£", "~": "·" }, t3.CHARSETS.A = { "#": "£" }, t3.CHARSETS.B = void 0, t3.CHARSETS[4] = { "#": "£", "@": "¾", "[": "ij", "\\": "½", "]": "|", "{": "¨", "|": "f", "}": "¼", "~": "´" }, t3.CHARSETS.C = t3.CHARSETS[5] = { "[": "Ä", "\\": "Ö", "]": "Å", "^": "Ü", "`": "é", "{": "ä", "|": "ö", "}": "å", "~": "ü" }, t3.CHARSETS.R = { "#": "£", "@": "à", "[": "°", "\\": "ç", "]": "§", "{": "é", "|": "ù", "}": "è", "~": "¨" }, t3.CHARSETS.Q = { "@": "à", "[": "â", "\\": "ç", "]": "ê", "^": "î", "`": "ô", "{": "é", "|": "ù", "}": "è", "~": "û" }, t3.CHARSETS.K = { "@": "§", "[": "Ä", "\\": "Ö", "]": "Ü", "{": "ä", "|": "ö", "}": "ü", "~": "ß" }, t3.CHARSETS.Y = { "#": "£", "@": "§", "[": "°", "\\": "ç", "]": "é", "`": "ù", "{": "à", "|": "ò", "}": "è", "~": "ì" }, t3.CHARSETS.E = t3.CHARSETS[6] = { "@": "Ä", "[": "Æ", "\\": "Ø", "]": "Å", "^": "Ü", "`": "ä", "{": "æ", "|": "ø", "}": "å", "~": "ü" }, t3.CHARSETS.Z = { "#": "£", "@": "§", "[": "¡", "\\": "Ñ", "]": "¿", "{": "°", "|": "ñ", "}": "ç" }, t3.CHARSETS.H = t3.CHARSETS[7] = { "@": "É", "[": "Ä", "\\": "Ö", "]": "Å", "^": "Ü", "`": "é", "{": "ä", "|": "ö", "}": "å", "~": "ü" }, t3.CHARSETS["="] = { "#": "ù", "@": "à", "[": "é", "\\": "ç", "]": "ê", "^": "î", _: "è", "`": "ô", "{": "ä", "|": "ö", "}": "ü", "~": "û" };
    }, 2584: (e3, t3) => {
      var i3, s2, r;
      Object.defineProperty(t3, "__esModule", { value: true }), t3.C1_ESCAPED = t3.C1 = t3.C0 = void 0, function(e4) {
        e4.NUL = "\0", e4.SOH = "", e4.STX = "", e4.ETX = "", e4.EOT = "", e4.ENQ = "", e4.ACK = "", e4.BEL = "\x07", e4.BS = "\b", e4.HT = "	", e4.LF = "\n", e4.VT = "\v", e4.FF = "\f", e4.CR = "\r", e4.SO = "", e4.SI = "", e4.DLE = "", e4.DC1 = "", e4.DC2 = "", e4.DC3 = "", e4.DC4 = "", e4.NAK = "", e4.SYN = "", e4.ETB = "", e4.CAN = "", e4.EM = "", e4.SUB = "", e4.ESC = "\x1B", e4.FS = "", e4.GS = "", e4.RS = "", e4.US = "", e4.SP = " ", e4.DEL = "";
      }(i3 || (t3.C0 = i3 = {})), function(e4) {
        e4.PAD = "", e4.HOP = "", e4.BPH = "", e4.NBH = "", e4.IND = "", e4.NEL = "", e4.SSA = "", e4.ESA = "", e4.HTS = "", e4.HTJ = "", e4.VTS = "", e4.PLD = "", e4.PLU = "", e4.RI = "", e4.SS2 = "", e4.SS3 = "", e4.DCS = "", e4.PU1 = "", e4.PU2 = "", e4.STS = "", e4.CCH = "", e4.MW = "", e4.SPA = "", e4.EPA = "", e4.SOS = "", e4.SGCI = "", e4.SCI = "", e4.CSI = "", e4.ST = "", e4.OSC = "", e4.PM = "", e4.APC = "";
      }(s2 || (t3.C1 = s2 = {})), function(e4) {
        e4.ST = `${i3.ESC}\\`;
      }(r || (t3.C1_ESCAPED = r = {}));
    }, 7399: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.evaluateKeyboardEvent = void 0;
      const s2 = i3(2584), r = { 48: ["0", ")"], 49: ["1", "!"], 50: ["2", "@"], 51: ["3", "#"], 52: ["4", "$"], 53: ["5", "%"], 54: ["6", "^"], 55: ["7", "&"], 56: ["8", "*"], 57: ["9", "("], 186: [";", ":"], 187: ["=", "+"], 188: [",", "<"], 189: ["-", "_"], 190: [".", ">"], 191: ["/", "?"], 192: ["`", "~"], 219: ["[", "{"], 220: ["\\", "|"], 221: ["]", "}"], 222: ["'", '"'] };
      t3.evaluateKeyboardEvent = function(e4, t4, i4, n) {
        const o = { type: 0, cancel: false, key: void 0 }, a = (e4.shiftKey ? 1 : 0) | (e4.altKey ? 2 : 0) | (e4.ctrlKey ? 4 : 0) | (e4.metaKey ? 8 : 0);
        switch (e4.keyCode) {
          case 0:
            "UIKeyInputUpArrow" === e4.key ? o.key = t4 ? s2.C0.ESC + "OA" : s2.C0.ESC + "[A" : "UIKeyInputLeftArrow" === e4.key ? o.key = t4 ? s2.C0.ESC + "OD" : s2.C0.ESC + "[D" : "UIKeyInputRightArrow" === e4.key ? o.key = t4 ? s2.C0.ESC + "OC" : s2.C0.ESC + "[C" : "UIKeyInputDownArrow" === e4.key && (o.key = t4 ? s2.C0.ESC + "OB" : s2.C0.ESC + "[B");
            break;
          case 8:
            o.key = e4.ctrlKey ? "\b" : s2.C0.DEL, e4.altKey && (o.key = s2.C0.ESC + o.key);
            break;
          case 9:
            if (e4.shiftKey) {
              o.key = s2.C0.ESC + "[Z";
              break;
            }
            o.key = s2.C0.HT, o.cancel = true;
            break;
          case 13:
            o.key = e4.altKey ? s2.C0.ESC + s2.C0.CR : s2.C0.CR, o.cancel = true;
            break;
          case 27:
            o.key = s2.C0.ESC, e4.altKey && (o.key = s2.C0.ESC + s2.C0.ESC), o.cancel = true;
            break;
          case 37:
            if (e4.metaKey) break;
            a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "D", o.key === s2.C0.ESC + "[1;3D" && (o.key = s2.C0.ESC + (i4 ? "b" : "[1;5D"))) : o.key = t4 ? s2.C0.ESC + "OD" : s2.C0.ESC + "[D";
            break;
          case 39:
            if (e4.metaKey) break;
            a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "C", o.key === s2.C0.ESC + "[1;3C" && (o.key = s2.C0.ESC + (i4 ? "f" : "[1;5C"))) : o.key = t4 ? s2.C0.ESC + "OC" : s2.C0.ESC + "[C";
            break;
          case 38:
            if (e4.metaKey) break;
            a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "A", i4 || o.key !== s2.C0.ESC + "[1;3A" || (o.key = s2.C0.ESC + "[1;5A")) : o.key = t4 ? s2.C0.ESC + "OA" : s2.C0.ESC + "[A";
            break;
          case 40:
            if (e4.metaKey) break;
            a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "B", i4 || o.key !== s2.C0.ESC + "[1;3B" || (o.key = s2.C0.ESC + "[1;5B")) : o.key = t4 ? s2.C0.ESC + "OB" : s2.C0.ESC + "[B";
            break;
          case 45:
            e4.shiftKey || e4.ctrlKey || (o.key = s2.C0.ESC + "[2~");
            break;
          case 46:
            o.key = a ? s2.C0.ESC + "[3;" + (a + 1) + "~" : s2.C0.ESC + "[3~";
            break;
          case 36:
            o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "H" : t4 ? s2.C0.ESC + "OH" : s2.C0.ESC + "[H";
            break;
          case 35:
            o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "F" : t4 ? s2.C0.ESC + "OF" : s2.C0.ESC + "[F";
            break;
          case 33:
            e4.shiftKey ? o.type = 2 : e4.ctrlKey ? o.key = s2.C0.ESC + "[5;" + (a + 1) + "~" : o.key = s2.C0.ESC + "[5~";
            break;
          case 34:
            e4.shiftKey ? o.type = 3 : e4.ctrlKey ? o.key = s2.C0.ESC + "[6;" + (a + 1) + "~" : o.key = s2.C0.ESC + "[6~";
            break;
          case 112:
            o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "P" : s2.C0.ESC + "OP";
            break;
          case 113:
            o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "Q" : s2.C0.ESC + "OQ";
            break;
          case 114:
            o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "R" : s2.C0.ESC + "OR";
            break;
          case 115:
            o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "S" : s2.C0.ESC + "OS";
            break;
          case 116:
            o.key = a ? s2.C0.ESC + "[15;" + (a + 1) + "~" : s2.C0.ESC + "[15~";
            break;
          case 117:
            o.key = a ? s2.C0.ESC + "[17;" + (a + 1) + "~" : s2.C0.ESC + "[17~";
            break;
          case 118:
            o.key = a ? s2.C0.ESC + "[18;" + (a + 1) + "~" : s2.C0.ESC + "[18~";
            break;
          case 119:
            o.key = a ? s2.C0.ESC + "[19;" + (a + 1) + "~" : s2.C0.ESC + "[19~";
            break;
          case 120:
            o.key = a ? s2.C0.ESC + "[20;" + (a + 1) + "~" : s2.C0.ESC + "[20~";
            break;
          case 121:
            o.key = a ? s2.C0.ESC + "[21;" + (a + 1) + "~" : s2.C0.ESC + "[21~";
            break;
          case 122:
            o.key = a ? s2.C0.ESC + "[23;" + (a + 1) + "~" : s2.C0.ESC + "[23~";
            break;
          case 123:
            o.key = a ? s2.C0.ESC + "[24;" + (a + 1) + "~" : s2.C0.ESC + "[24~";
            break;
          default:
            if (!e4.ctrlKey || e4.shiftKey || e4.altKey || e4.metaKey) if (i4 && !n || !e4.altKey || e4.metaKey) !i4 || e4.altKey || e4.ctrlKey || e4.shiftKey || !e4.metaKey ? e4.key && !e4.ctrlKey && !e4.altKey && !e4.metaKey && e4.keyCode >= 48 && 1 === e4.key.length ? o.key = e4.key : e4.key && e4.ctrlKey && ("_" === e4.key && (o.key = s2.C0.US), "@" === e4.key && (o.key = s2.C0.NUL)) : 65 === e4.keyCode && (o.type = 1);
            else {
              const t5 = r[e4.keyCode], i5 = t5?.[e4.shiftKey ? 1 : 0];
              if (i5) o.key = s2.C0.ESC + i5;
              else if (e4.keyCode >= 65 && e4.keyCode <= 90) {
                const t6 = e4.ctrlKey ? e4.keyCode - 64 : e4.keyCode + 32;
                let i6 = String.fromCharCode(t6);
                e4.shiftKey && (i6 = i6.toUpperCase()), o.key = s2.C0.ESC + i6;
              } else if (32 === e4.keyCode) o.key = s2.C0.ESC + (e4.ctrlKey ? s2.C0.NUL : " ");
              else if ("Dead" === e4.key && e4.code.startsWith("Key")) {
                let t6 = e4.code.slice(3, 4);
                e4.shiftKey || (t6 = t6.toLowerCase()), o.key = s2.C0.ESC + t6, o.cancel = true;
              }
            }
            else e4.keyCode >= 65 && e4.keyCode <= 90 ? o.key = String.fromCharCode(e4.keyCode - 64) : 32 === e4.keyCode ? o.key = s2.C0.NUL : e4.keyCode >= 51 && e4.keyCode <= 55 ? o.key = String.fromCharCode(e4.keyCode - 51 + 27) : 56 === e4.keyCode ? o.key = s2.C0.DEL : 219 === e4.keyCode ? o.key = s2.C0.ESC : 220 === e4.keyCode ? o.key = s2.C0.FS : 221 === e4.keyCode && (o.key = s2.C0.GS);
        }
        return o;
      };
    }, 482: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.Utf8ToUtf32 = t3.StringToUtf32 = t3.utf32ToString = t3.stringFromCodePoint = void 0, t3.stringFromCodePoint = function(e4) {
        return e4 > 65535 ? (e4 -= 65536, String.fromCharCode(55296 + (e4 >> 10)) + String.fromCharCode(e4 % 1024 + 56320)) : String.fromCharCode(e4);
      }, t3.utf32ToString = function(e4, t4 = 0, i3 = e4.length) {
        let s2 = "";
        for (let r = t4; r < i3; ++r) {
          let t5 = e4[r];
          t5 > 65535 ? (t5 -= 65536, s2 += String.fromCharCode(55296 + (t5 >> 10)) + String.fromCharCode(t5 % 1024 + 56320)) : s2 += String.fromCharCode(t5);
        }
        return s2;
      }, t3.StringToUtf32 = class {
        constructor() {
          this._interim = 0;
        }
        clear() {
          this._interim = 0;
        }
        decode(e4, t4) {
          const i3 = e4.length;
          if (!i3) return 0;
          let s2 = 0, r = 0;
          if (this._interim) {
            const i4 = e4.charCodeAt(r++);
            56320 <= i4 && i4 <= 57343 ? t4[s2++] = 1024 * (this._interim - 55296) + i4 - 56320 + 65536 : (t4[s2++] = this._interim, t4[s2++] = i4), this._interim = 0;
          }
          for (let n = r; n < i3; ++n) {
            const r2 = e4.charCodeAt(n);
            if (55296 <= r2 && r2 <= 56319) {
              if (++n >= i3) return this._interim = r2, s2;
              const o = e4.charCodeAt(n);
              56320 <= o && o <= 57343 ? t4[s2++] = 1024 * (r2 - 55296) + o - 56320 + 65536 : (t4[s2++] = r2, t4[s2++] = o);
            } else 65279 !== r2 && (t4[s2++] = r2);
          }
          return s2;
        }
      }, t3.Utf8ToUtf32 = class {
        constructor() {
          this.interim = new Uint8Array(3);
        }
        clear() {
          this.interim.fill(0);
        }
        decode(e4, t4) {
          const i3 = e4.length;
          if (!i3) return 0;
          let s2, r, n, o, a = 0, h2 = 0, c = 0;
          if (this.interim[0]) {
            let s3 = false, r2 = this.interim[0];
            r2 &= 192 == (224 & r2) ? 31 : 224 == (240 & r2) ? 15 : 7;
            let n2, o2 = 0;
            for (; (n2 = 63 & this.interim[++o2]) && o2 < 4; ) r2 <<= 6, r2 |= n2;
            const h3 = 192 == (224 & this.interim[0]) ? 2 : 224 == (240 & this.interim[0]) ? 3 : 4, l2 = h3 - o2;
            for (; c < l2; ) {
              if (c >= i3) return 0;
              if (n2 = e4[c++], 128 != (192 & n2)) {
                c--, s3 = true;
                break;
              }
              this.interim[o2++] = n2, r2 <<= 6, r2 |= 63 & n2;
            }
            s3 || (2 === h3 ? r2 < 128 ? c-- : t4[a++] = r2 : 3 === h3 ? r2 < 2048 || r2 >= 55296 && r2 <= 57343 || 65279 === r2 || (t4[a++] = r2) : r2 < 65536 || r2 > 1114111 || (t4[a++] = r2)), this.interim.fill(0);
          }
          const l = i3 - 4;
          let d = c;
          for (; d < i3; ) {
            for (; !(!(d < l) || 128 & (s2 = e4[d]) || 128 & (r = e4[d + 1]) || 128 & (n = e4[d + 2]) || 128 & (o = e4[d + 3])); ) t4[a++] = s2, t4[a++] = r, t4[a++] = n, t4[a++] = o, d += 4;
            if (s2 = e4[d++], s2 < 128) t4[a++] = s2;
            else if (192 == (224 & s2)) {
              if (d >= i3) return this.interim[0] = s2, a;
              if (r = e4[d++], 128 != (192 & r)) {
                d--;
                continue;
              }
              if (h2 = (31 & s2) << 6 | 63 & r, h2 < 128) {
                d--;
                continue;
              }
              t4[a++] = h2;
            } else if (224 == (240 & s2)) {
              if (d >= i3) return this.interim[0] = s2, a;
              if (r = e4[d++], 128 != (192 & r)) {
                d--;
                continue;
              }
              if (d >= i3) return this.interim[0] = s2, this.interim[1] = r, a;
              if (n = e4[d++], 128 != (192 & n)) {
                d--;
                continue;
              }
              if (h2 = (15 & s2) << 12 | (63 & r) << 6 | 63 & n, h2 < 2048 || h2 >= 55296 && h2 <= 57343 || 65279 === h2) continue;
              t4[a++] = h2;
            } else if (240 == (248 & s2)) {
              if (d >= i3) return this.interim[0] = s2, a;
              if (r = e4[d++], 128 != (192 & r)) {
                d--;
                continue;
              }
              if (d >= i3) return this.interim[0] = s2, this.interim[1] = r, a;
              if (n = e4[d++], 128 != (192 & n)) {
                d--;
                continue;
              }
              if (d >= i3) return this.interim[0] = s2, this.interim[1] = r, this.interim[2] = n, a;
              if (o = e4[d++], 128 != (192 & o)) {
                d--;
                continue;
              }
              if (h2 = (7 & s2) << 18 | (63 & r) << 12 | (63 & n) << 6 | 63 & o, h2 < 65536 || h2 > 1114111) continue;
              t4[a++] = h2;
            }
          }
          return a;
        }
      };
    }, 225: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.UnicodeV6 = void 0;
      const s2 = i3(1480), r = [[768, 879], [1155, 1158], [1160, 1161], [1425, 1469], [1471, 1471], [1473, 1474], [1476, 1477], [1479, 1479], [1536, 1539], [1552, 1557], [1611, 1630], [1648, 1648], [1750, 1764], [1767, 1768], [1770, 1773], [1807, 1807], [1809, 1809], [1840, 1866], [1958, 1968], [2027, 2035], [2305, 2306], [2364, 2364], [2369, 2376], [2381, 2381], [2385, 2388], [2402, 2403], [2433, 2433], [2492, 2492], [2497, 2500], [2509, 2509], [2530, 2531], [2561, 2562], [2620, 2620], [2625, 2626], [2631, 2632], [2635, 2637], [2672, 2673], [2689, 2690], [2748, 2748], [2753, 2757], [2759, 2760], [2765, 2765], [2786, 2787], [2817, 2817], [2876, 2876], [2879, 2879], [2881, 2883], [2893, 2893], [2902, 2902], [2946, 2946], [3008, 3008], [3021, 3021], [3134, 3136], [3142, 3144], [3146, 3149], [3157, 3158], [3260, 3260], [3263, 3263], [3270, 3270], [3276, 3277], [3298, 3299], [3393, 3395], [3405, 3405], [3530, 3530], [3538, 3540], [3542, 3542], [3633, 3633], [3636, 3642], [3655, 3662], [3761, 3761], [3764, 3769], [3771, 3772], [3784, 3789], [3864, 3865], [3893, 3893], [3895, 3895], [3897, 3897], [3953, 3966], [3968, 3972], [3974, 3975], [3984, 3991], [3993, 4028], [4038, 4038], [4141, 4144], [4146, 4146], [4150, 4151], [4153, 4153], [4184, 4185], [4448, 4607], [4959, 4959], [5906, 5908], [5938, 5940], [5970, 5971], [6002, 6003], [6068, 6069], [6071, 6077], [6086, 6086], [6089, 6099], [6109, 6109], [6155, 6157], [6313, 6313], [6432, 6434], [6439, 6440], [6450, 6450], [6457, 6459], [6679, 6680], [6912, 6915], [6964, 6964], [6966, 6970], [6972, 6972], [6978, 6978], [7019, 7027], [7616, 7626], [7678, 7679], [8203, 8207], [8234, 8238], [8288, 8291], [8298, 8303], [8400, 8431], [12330, 12335], [12441, 12442], [43014, 43014], [43019, 43019], [43045, 43046], [64286, 64286], [65024, 65039], [65056, 65059], [65279, 65279], [65529, 65531]], n = [[68097, 68099], [68101, 68102], [68108, 68111], [68152, 68154], [68159, 68159], [119143, 119145], [119155, 119170], [119173, 119179], [119210, 119213], [119362, 119364], [917505, 917505], [917536, 917631], [917760, 917999]];
      let o;
      t3.UnicodeV6 = class {
        constructor() {
          if (this.version = "6", !o) {
            o = new Uint8Array(65536), o.fill(1), o[0] = 0, o.fill(0, 1, 32), o.fill(0, 127, 160), o.fill(2, 4352, 4448), o[9001] = 2, o[9002] = 2, o.fill(2, 11904, 42192), o[12351] = 1, o.fill(2, 44032, 55204), o.fill(2, 63744, 64256), o.fill(2, 65040, 65050), o.fill(2, 65072, 65136), o.fill(2, 65280, 65377), o.fill(2, 65504, 65511);
            for (let e4 = 0; e4 < r.length; ++e4) o.fill(0, r[e4][0], r[e4][1] + 1);
          }
        }
        wcwidth(e4) {
          return e4 < 32 ? 0 : e4 < 127 ? 1 : e4 < 65536 ? o[e4] : function(e5, t4) {
            let i4, s3 = 0, r2 = t4.length - 1;
            if (e5 < t4[0][0] || e5 > t4[r2][1]) return false;
            for (; r2 >= s3; ) if (i4 = s3 + r2 >> 1, e5 > t4[i4][1]) s3 = i4 + 1;
            else {
              if (!(e5 < t4[i4][0])) return true;
              r2 = i4 - 1;
            }
            return false;
          }(e4, n) ? 0 : e4 >= 131072 && e4 <= 196605 || e4 >= 196608 && e4 <= 262141 ? 2 : 1;
        }
        charProperties(e4, t4) {
          let i4 = this.wcwidth(e4), r2 = 0 === i4 && 0 !== t4;
          if (r2) {
            const e5 = s2.UnicodeService.extractWidth(t4);
            0 === e5 ? r2 = false : e5 > i4 && (i4 = e5);
          }
          return s2.UnicodeService.createPropertyValue(0, i4, r2);
        }
      };
    }, 5981: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.WriteBuffer = void 0;
      const s2 = i3(8460), r = i3(844);
      class n extends r.Disposable {
        static {
          __name(this, "n");
        }
        constructor(e4) {
          super(), this._action = e4, this._writeBuffer = [], this._callbacks = [], this._pendingData = 0, this._bufferOffset = 0, this._isSyncWriting = false, this._syncCalls = 0, this._didUserInput = false, this._onWriteParsed = this.register(new s2.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event;
        }
        handleUserInput() {
          this._didUserInput = true;
        }
        writeSync(e4, t4) {
          if (void 0 !== t4 && this._syncCalls > t4) return void (this._syncCalls = 0);
          if (this._pendingData += e4.length, this._writeBuffer.push(e4), this._callbacks.push(void 0), this._syncCalls++, this._isSyncWriting) return;
          let i4;
          for (this._isSyncWriting = true; i4 = this._writeBuffer.shift(); ) {
            this._action(i4);
            const e5 = this._callbacks.shift();
            e5 && e5();
          }
          this._pendingData = 0, this._bufferOffset = 2147483647, this._isSyncWriting = false, this._syncCalls = 0;
        }
        write(e4, t4) {
          if (this._pendingData > 5e7) throw new Error("write data discarded, use flow control to avoid losing data");
          if (!this._writeBuffer.length) {
            if (this._bufferOffset = 0, this._didUserInput) return this._didUserInput = false, this._pendingData += e4.length, this._writeBuffer.push(e4), this._callbacks.push(t4), void this._innerWrite();
            setTimeout(() => this._innerWrite());
          }
          this._pendingData += e4.length, this._writeBuffer.push(e4), this._callbacks.push(t4);
        }
        _innerWrite(e4 = 0, t4 = true) {
          const i4 = e4 || Date.now();
          for (; this._writeBuffer.length > this._bufferOffset; ) {
            const e5 = this._writeBuffer[this._bufferOffset], s3 = this._action(e5, t4);
            if (s3) {
              const e6 = /* @__PURE__ */ __name((e7) => Date.now() - i4 >= 12 ? setTimeout(() => this._innerWrite(0, e7)) : this._innerWrite(i4, e7), "e");
              return void s3.catch((e7) => (queueMicrotask(() => {
                throw e7;
              }), Promise.resolve(false))).then(e6);
            }
            const r2 = this._callbacks[this._bufferOffset];
            if (r2 && r2(), this._bufferOffset++, this._pendingData -= e5.length, Date.now() - i4 >= 12) break;
          }
          this._writeBuffer.length > this._bufferOffset ? (this._bufferOffset > 50 && (this._writeBuffer = this._writeBuffer.slice(this._bufferOffset), this._callbacks = this._callbacks.slice(this._bufferOffset), this._bufferOffset = 0), setTimeout(() => this._innerWrite())) : (this._writeBuffer.length = 0, this._callbacks.length = 0, this._pendingData = 0, this._bufferOffset = 0), this._onWriteParsed.fire();
        }
      }
      t3.WriteBuffer = n;
    }, 5941: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.toRgbString = t3.parseColor = void 0;
      const i3 = /^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/, s2 = /^[\da-f]+$/;
      function r(e4, t4) {
        const i4 = e4.toString(16), s3 = i4.length < 2 ? "0" + i4 : i4;
        switch (t4) {
          case 4:
            return i4[0];
          case 8:
            return s3;
          case 12:
            return (s3 + s3).slice(0, 3);
          default:
            return s3 + s3;
        }
      }
      __name(r, "r");
      t3.parseColor = function(e4) {
        if (!e4) return;
        let t4 = e4.toLowerCase();
        if (0 === t4.indexOf("rgb:")) {
          t4 = t4.slice(4);
          const e5 = i3.exec(t4);
          if (e5) {
            const t5 = e5[1] ? 15 : e5[4] ? 255 : e5[7] ? 4095 : 65535;
            return [Math.round(parseInt(e5[1] || e5[4] || e5[7] || e5[10], 16) / t5 * 255), Math.round(parseInt(e5[2] || e5[5] || e5[8] || e5[11], 16) / t5 * 255), Math.round(parseInt(e5[3] || e5[6] || e5[9] || e5[12], 16) / t5 * 255)];
          }
        } else if (0 === t4.indexOf("#") && (t4 = t4.slice(1), s2.exec(t4) && [3, 6, 9, 12].includes(t4.length))) {
          const e5 = t4.length / 3, i4 = [0, 0, 0];
          for (let s3 = 0; s3 < 3; ++s3) {
            const r2 = parseInt(t4.slice(e5 * s3, e5 * s3 + e5), 16);
            i4[s3] = 1 === e5 ? r2 << 4 : 2 === e5 ? r2 : 3 === e5 ? r2 >> 4 : r2 >> 8;
          }
          return i4;
        }
      }, t3.toRgbString = function(e4, t4 = 16) {
        const [i4, s3, n] = e4;
        return `rgb:${r(i4, t4)}/${r(s3, t4)}/${r(n, t4)}`;
      };
    }, 5770: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.PAYLOAD_LIMIT = void 0, t3.PAYLOAD_LIMIT = 1e7;
    }, 6351: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.DcsHandler = t3.DcsParser = void 0;
      const s2 = i3(482), r = i3(8742), n = i3(5770), o = [];
      t3.DcsParser = class {
        constructor() {
          this._handlers = /* @__PURE__ */ Object.create(null), this._active = o, this._ident = 0, this._handlerFb = () => {
          }, this._stack = { paused: false, loopPosition: 0, fallThrough: false };
        }
        dispose() {
          this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
          }, this._active = o;
        }
        registerHandler(e4, t4) {
          void 0 === this._handlers[e4] && (this._handlers[e4] = []);
          const i4 = this._handlers[e4];
          return i4.push(t4), { dispose: /* @__PURE__ */ __name(() => {
            const e5 = i4.indexOf(t4);
            -1 !== e5 && i4.splice(e5, 1);
          }, "dispose") };
        }
        clearHandler(e4) {
          this._handlers[e4] && delete this._handlers[e4];
        }
        setHandlerFallback(e4) {
          this._handlerFb = e4;
        }
        reset() {
          if (this._active.length) for (let e4 = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; e4 >= 0; --e4) this._active[e4].unhook(false);
          this._stack.paused = false, this._active = o, this._ident = 0;
        }
        hook(e4, t4) {
          if (this.reset(), this._ident = e4, this._active = this._handlers[e4] || o, this._active.length) for (let e5 = this._active.length - 1; e5 >= 0; e5--) this._active[e5].hook(t4);
          else this._handlerFb(this._ident, "HOOK", t4);
        }
        put(e4, t4, i4) {
          if (this._active.length) for (let s3 = this._active.length - 1; s3 >= 0; s3--) this._active[s3].put(e4, t4, i4);
          else this._handlerFb(this._ident, "PUT", (0, s2.utf32ToString)(e4, t4, i4));
        }
        unhook(e4, t4 = true) {
          if (this._active.length) {
            let i4 = false, s3 = this._active.length - 1, r2 = false;
            if (this._stack.paused && (s3 = this._stack.loopPosition - 1, i4 = t4, r2 = this._stack.fallThrough, this._stack.paused = false), !r2 && false === i4) {
              for (; s3 >= 0 && (i4 = this._active[s3].unhook(e4), true !== i4); s3--) if (i4 instanceof Promise) return this._stack.paused = true, this._stack.loopPosition = s3, this._stack.fallThrough = false, i4;
              s3--;
            }
            for (; s3 >= 0; s3--) if (i4 = this._active[s3].unhook(false), i4 instanceof Promise) return this._stack.paused = true, this._stack.loopPosition = s3, this._stack.fallThrough = true, i4;
          } else this._handlerFb(this._ident, "UNHOOK", e4);
          this._active = o, this._ident = 0;
        }
      };
      const a = new r.Params();
      a.addParam(0), t3.DcsHandler = class {
        constructor(e4) {
          this._handler = e4, this._data = "", this._params = a, this._hitLimit = false;
        }
        hook(e4) {
          this._params = e4.length > 1 || e4.params[0] ? e4.clone() : a, this._data = "", this._hitLimit = false;
        }
        put(e4, t4, i4) {
          this._hitLimit || (this._data += (0, s2.utf32ToString)(e4, t4, i4), this._data.length > n.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = true));
        }
        unhook(e4) {
          let t4 = false;
          if (this._hitLimit) t4 = false;
          else if (e4 && (t4 = this._handler(this._data, this._params), t4 instanceof Promise)) return t4.then((e5) => (this._params = a, this._data = "", this._hitLimit = false, e5));
          return this._params = a, this._data = "", this._hitLimit = false, t4;
        }
      };
    }, 2015: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.EscapeSequenceParser = t3.VT500_TRANSITION_TABLE = t3.TransitionTable = void 0;
      const s2 = i3(844), r = i3(8742), n = i3(6242), o = i3(6351);
      class a {
        static {
          __name(this, "a");
        }
        constructor(e4) {
          this.table = new Uint8Array(e4);
        }
        setDefault(e4, t4) {
          this.table.fill(e4 << 4 | t4);
        }
        add(e4, t4, i4, s3) {
          this.table[t4 << 8 | e4] = i4 << 4 | s3;
        }
        addMany(e4, t4, i4, s3) {
          for (let r2 = 0; r2 < e4.length; r2++) this.table[t4 << 8 | e4[r2]] = i4 << 4 | s3;
        }
      }
      t3.TransitionTable = a;
      const h2 = 160;
      t3.VT500_TRANSITION_TABLE = function() {
        const e4 = new a(4095), t4 = Array.apply(null, Array(256)).map((e5, t5) => t5), i4 = /* @__PURE__ */ __name((e5, i5) => t4.slice(e5, i5), "i"), s3 = i4(32, 127), r2 = i4(0, 24);
        r2.push(25), r2.push.apply(r2, i4(28, 32));
        const n2 = i4(0, 14);
        let o2;
        for (o2 in e4.setDefault(1, 0), e4.addMany(s3, 0, 2, 0), n2) e4.addMany([24, 26, 153, 154], o2, 3, 0), e4.addMany(i4(128, 144), o2, 3, 0), e4.addMany(i4(144, 152), o2, 3, 0), e4.add(156, o2, 0, 0), e4.add(27, o2, 11, 1), e4.add(157, o2, 4, 8), e4.addMany([152, 158, 159], o2, 0, 7), e4.add(155, o2, 11, 3), e4.add(144, o2, 11, 9);
        return e4.addMany(r2, 0, 3, 0), e4.addMany(r2, 1, 3, 1), e4.add(127, 1, 0, 1), e4.addMany(r2, 8, 0, 8), e4.addMany(r2, 3, 3, 3), e4.add(127, 3, 0, 3), e4.addMany(r2, 4, 3, 4), e4.add(127, 4, 0, 4), e4.addMany(r2, 6, 3, 6), e4.addMany(r2, 5, 3, 5), e4.add(127, 5, 0, 5), e4.addMany(r2, 2, 3, 2), e4.add(127, 2, 0, 2), e4.add(93, 1, 4, 8), e4.addMany(s3, 8, 5, 8), e4.add(127, 8, 5, 8), e4.addMany([156, 27, 24, 26, 7], 8, 6, 0), e4.addMany(i4(28, 32), 8, 0, 8), e4.addMany([88, 94, 95], 1, 0, 7), e4.addMany(s3, 7, 0, 7), e4.addMany(r2, 7, 0, 7), e4.add(156, 7, 0, 0), e4.add(127, 7, 0, 7), e4.add(91, 1, 11, 3), e4.addMany(i4(64, 127), 3, 7, 0), e4.addMany(i4(48, 60), 3, 8, 4), e4.addMany([60, 61, 62, 63], 3, 9, 4), e4.addMany(i4(48, 60), 4, 8, 4), e4.addMany(i4(64, 127), 4, 7, 0), e4.addMany([60, 61, 62, 63], 4, 0, 6), e4.addMany(i4(32, 64), 6, 0, 6), e4.add(127, 6, 0, 6), e4.addMany(i4(64, 127), 6, 0, 0), e4.addMany(i4(32, 48), 3, 9, 5), e4.addMany(i4(32, 48), 5, 9, 5), e4.addMany(i4(48, 64), 5, 0, 6), e4.addMany(i4(64, 127), 5, 7, 0), e4.addMany(i4(32, 48), 4, 9, 5), e4.addMany(i4(32, 48), 1, 9, 2), e4.addMany(i4(32, 48), 2, 9, 2), e4.addMany(i4(48, 127), 2, 10, 0), e4.addMany(i4(48, 80), 1, 10, 0), e4.addMany(i4(81, 88), 1, 10, 0), e4.addMany([89, 90, 92], 1, 10, 0), e4.addMany(i4(96, 127), 1, 10, 0), e4.add(80, 1, 11, 9), e4.addMany(r2, 9, 0, 9), e4.add(127, 9, 0, 9), e4.addMany(i4(28, 32), 9, 0, 9), e4.addMany(i4(32, 48), 9, 9, 12), e4.addMany(i4(48, 60), 9, 8, 10), e4.addMany([60, 61, 62, 63], 9, 9, 10), e4.addMany(r2, 11, 0, 11), e4.addMany(i4(32, 128), 11, 0, 11), e4.addMany(i4(28, 32), 11, 0, 11), e4.addMany(r2, 10, 0, 10), e4.add(127, 10, 0, 10), e4.addMany(i4(28, 32), 10, 0, 10), e4.addMany(i4(48, 60), 10, 8, 10), e4.addMany([60, 61, 62, 63], 10, 0, 11), e4.addMany(i4(32, 48), 10, 9, 12), e4.addMany(r2, 12, 0, 12), e4.add(127, 12, 0, 12), e4.addMany(i4(28, 32), 12, 0, 12), e4.addMany(i4(32, 48), 12, 9, 12), e4.addMany(i4(48, 64), 12, 0, 11), e4.addMany(i4(64, 127), 12, 12, 13), e4.addMany(i4(64, 127), 10, 12, 13), e4.addMany(i4(64, 127), 9, 12, 13), e4.addMany(r2, 13, 13, 13), e4.addMany(s3, 13, 13, 13), e4.add(127, 13, 0, 13), e4.addMany([27, 156, 24, 26], 13, 14, 0), e4.add(h2, 0, 2, 0), e4.add(h2, 8, 5, 8), e4.add(h2, 6, 0, 6), e4.add(h2, 11, 0, 11), e4.add(h2, 13, 13, 13), e4;
      }();
      class c extends s2.Disposable {
        static {
          __name(this, "c");
        }
        constructor(e4 = t3.VT500_TRANSITION_TABLE) {
          super(), this._transitions = e4, this._parseStack = { state: 0, handlers: [], handlerPos: 0, transition: 0, chunkPos: 0 }, this.initialState = 0, this.currentState = this.initialState, this._params = new r.Params(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, this._printHandlerFb = (e5, t4, i4) => {
          }, this._executeHandlerFb = (e5) => {
          }, this._csiHandlerFb = (e5, t4) => {
          }, this._escHandlerFb = (e5) => {
          }, this._errorHandlerFb = (e5) => e5, this._printHandler = this._printHandlerFb, this._executeHandlers = /* @__PURE__ */ Object.create(null), this._csiHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null), this.register((0, s2.toDisposable)(() => {
            this._csiHandlers = /* @__PURE__ */ Object.create(null), this._executeHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null);
          })), this._oscParser = this.register(new n.OscParser()), this._dcsParser = this.register(new o.DcsParser()), this._errorHandler = this._errorHandlerFb, this.registerEscHandler({ final: "\\" }, () => true);
        }
        _identifier(e4, t4 = [64, 126]) {
          let i4 = 0;
          if (e4.prefix) {
            if (e4.prefix.length > 1) throw new Error("only one byte as prefix supported");
            if (i4 = e4.prefix.charCodeAt(0), i4 && 60 > i4 || i4 > 63) throw new Error("prefix must be in range 0x3c .. 0x3f");
          }
          if (e4.intermediates) {
            if (e4.intermediates.length > 2) throw new Error("only two bytes as intermediates are supported");
            for (let t5 = 0; t5 < e4.intermediates.length; ++t5) {
              const s4 = e4.intermediates.charCodeAt(t5);
              if (32 > s4 || s4 > 47) throw new Error("intermediate must be in range 0x20 .. 0x2f");
              i4 <<= 8, i4 |= s4;
            }
          }
          if (1 !== e4.final.length) throw new Error("final must be a single byte");
          const s3 = e4.final.charCodeAt(0);
          if (t4[0] > s3 || s3 > t4[1]) throw new Error(`final must be in range ${t4[0]} .. ${t4[1]}`);
          return i4 <<= 8, i4 |= s3, i4;
        }
        identToString(e4) {
          const t4 = [];
          for (; e4; ) t4.push(String.fromCharCode(255 & e4)), e4 >>= 8;
          return t4.reverse().join("");
        }
        setPrintHandler(e4) {
          this._printHandler = e4;
        }
        clearPrintHandler() {
          this._printHandler = this._printHandlerFb;
        }
        registerEscHandler(e4, t4) {
          const i4 = this._identifier(e4, [48, 126]);
          void 0 === this._escHandlers[i4] && (this._escHandlers[i4] = []);
          const s3 = this._escHandlers[i4];
          return s3.push(t4), { dispose: /* @__PURE__ */ __name(() => {
            const e5 = s3.indexOf(t4);
            -1 !== e5 && s3.splice(e5, 1);
          }, "dispose") };
        }
        clearEscHandler(e4) {
          this._escHandlers[this._identifier(e4, [48, 126])] && delete this._escHandlers[this._identifier(e4, [48, 126])];
        }
        setEscHandlerFallback(e4) {
          this._escHandlerFb = e4;
        }
        setExecuteHandler(e4, t4) {
          this._executeHandlers[e4.charCodeAt(0)] = t4;
        }
        clearExecuteHandler(e4) {
          this._executeHandlers[e4.charCodeAt(0)] && delete this._executeHandlers[e4.charCodeAt(0)];
        }
        setExecuteHandlerFallback(e4) {
          this._executeHandlerFb = e4;
        }
        registerCsiHandler(e4, t4) {
          const i4 = this._identifier(e4);
          void 0 === this._csiHandlers[i4] && (this._csiHandlers[i4] = []);
          const s3 = this._csiHandlers[i4];
          return s3.push(t4), { dispose: /* @__PURE__ */ __name(() => {
            const e5 = s3.indexOf(t4);
            -1 !== e5 && s3.splice(e5, 1);
          }, "dispose") };
        }
        clearCsiHandler(e4) {
          this._csiHandlers[this._identifier(e4)] && delete this._csiHandlers[this._identifier(e4)];
        }
        setCsiHandlerFallback(e4) {
          this._csiHandlerFb = e4;
        }
        registerDcsHandler(e4, t4) {
          return this._dcsParser.registerHandler(this._identifier(e4), t4);
        }
        clearDcsHandler(e4) {
          this._dcsParser.clearHandler(this._identifier(e4));
        }
        setDcsHandlerFallback(e4) {
          this._dcsParser.setHandlerFallback(e4);
        }
        registerOscHandler(e4, t4) {
          return this._oscParser.registerHandler(e4, t4);
        }
        clearOscHandler(e4) {
          this._oscParser.clearHandler(e4);
        }
        setOscHandlerFallback(e4) {
          this._oscParser.setHandlerFallback(e4);
        }
        setErrorHandler(e4) {
          this._errorHandler = e4;
        }
        clearErrorHandler() {
          this._errorHandler = this._errorHandlerFb;
        }
        reset() {
          this.currentState = this.initialState, this._oscParser.reset(), this._dcsParser.reset(), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, 0 !== this._parseStack.state && (this._parseStack.state = 2, this._parseStack.handlers = []);
        }
        _preserveStack(e4, t4, i4, s3, r2) {
          this._parseStack.state = e4, this._parseStack.handlers = t4, this._parseStack.handlerPos = i4, this._parseStack.transition = s3, this._parseStack.chunkPos = r2;
        }
        parse(e4, t4, i4) {
          let s3, r2 = 0, n2 = 0, o2 = 0;
          if (this._parseStack.state) if (2 === this._parseStack.state) this._parseStack.state = 0, o2 = this._parseStack.chunkPos + 1;
          else {
            if (void 0 === i4 || 1 === this._parseStack.state) throw this._parseStack.state = 1, new Error("improper continuation due to previous async handler, giving up parsing");
            const t5 = this._parseStack.handlers;
            let n3 = this._parseStack.handlerPos - 1;
            switch (this._parseStack.state) {
              case 3:
                if (false === i4 && n3 > -1) {
                  for (; n3 >= 0 && (s3 = t5[n3](this._params), true !== s3); n3--) if (s3 instanceof Promise) return this._parseStack.handlerPos = n3, s3;
                }
                this._parseStack.handlers = [];
                break;
              case 4:
                if (false === i4 && n3 > -1) {
                  for (; n3 >= 0 && (s3 = t5[n3](), true !== s3); n3--) if (s3 instanceof Promise) return this._parseStack.handlerPos = n3, s3;
                }
                this._parseStack.handlers = [];
                break;
              case 6:
                if (r2 = e4[this._parseStack.chunkPos], s3 = this._dcsParser.unhook(24 !== r2 && 26 !== r2, i4), s3) return s3;
                27 === r2 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0;
                break;
              case 5:
                if (r2 = e4[this._parseStack.chunkPos], s3 = this._oscParser.end(24 !== r2 && 26 !== r2, i4), s3) return s3;
                27 === r2 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0;
            }
            this._parseStack.state = 0, o2 = this._parseStack.chunkPos + 1, this.precedingJoinState = 0, this.currentState = 15 & this._parseStack.transition;
          }
          for (let i5 = o2; i5 < t4; ++i5) {
            switch (r2 = e4[i5], n2 = this._transitions.table[this.currentState << 8 | (r2 < 160 ? r2 : h2)], n2 >> 4) {
              case 2:
                for (let s4 = i5 + 1; ; ++s4) {
                  if (s4 >= t4 || (r2 = e4[s4]) < 32 || r2 > 126 && r2 < h2) {
                    this._printHandler(e4, i5, s4), i5 = s4 - 1;
                    break;
                  }
                  if (++s4 >= t4 || (r2 = e4[s4]) < 32 || r2 > 126 && r2 < h2) {
                    this._printHandler(e4, i5, s4), i5 = s4 - 1;
                    break;
                  }
                  if (++s4 >= t4 || (r2 = e4[s4]) < 32 || r2 > 126 && r2 < h2) {
                    this._printHandler(e4, i5, s4), i5 = s4 - 1;
                    break;
                  }
                  if (++s4 >= t4 || (r2 = e4[s4]) < 32 || r2 > 126 && r2 < h2) {
                    this._printHandler(e4, i5, s4), i5 = s4 - 1;
                    break;
                  }
                }
                break;
              case 3:
                this._executeHandlers[r2] ? this._executeHandlers[r2]() : this._executeHandlerFb(r2), this.precedingJoinState = 0;
                break;
              case 0:
                break;
              case 1:
                if (this._errorHandler({ position: i5, code: r2, currentState: this.currentState, collect: this._collect, params: this._params, abort: false }).abort) return;
                break;
              case 7:
                const o3 = this._csiHandlers[this._collect << 8 | r2];
                let a2 = o3 ? o3.length - 1 : -1;
                for (; a2 >= 0 && (s3 = o3[a2](this._params), true !== s3); a2--) if (s3 instanceof Promise) return this._preserveStack(3, o3, a2, n2, i5), s3;
                a2 < 0 && this._csiHandlerFb(this._collect << 8 | r2, this._params), this.precedingJoinState = 0;
                break;
              case 8:
                do {
                  switch (r2) {
                    case 59:
                      this._params.addParam(0);
                      break;
                    case 58:
                      this._params.addSubParam(-1);
                      break;
                    default:
                      this._params.addDigit(r2 - 48);
                  }
                } while (++i5 < t4 && (r2 = e4[i5]) > 47 && r2 < 60);
                i5--;
                break;
              case 9:
                this._collect <<= 8, this._collect |= r2;
                break;
              case 10:
                const c2 = this._escHandlers[this._collect << 8 | r2];
                let l = c2 ? c2.length - 1 : -1;
                for (; l >= 0 && (s3 = c2[l](), true !== s3); l--) if (s3 instanceof Promise) return this._preserveStack(4, c2, l, n2, i5), s3;
                l < 0 && this._escHandlerFb(this._collect << 8 | r2), this.precedingJoinState = 0;
                break;
              case 11:
                this._params.reset(), this._params.addParam(0), this._collect = 0;
                break;
              case 12:
                this._dcsParser.hook(this._collect << 8 | r2, this._params);
                break;
              case 13:
                for (let s4 = i5 + 1; ; ++s4) if (s4 >= t4 || 24 === (r2 = e4[s4]) || 26 === r2 || 27 === r2 || r2 > 127 && r2 < h2) {
                  this._dcsParser.put(e4, i5, s4), i5 = s4 - 1;
                  break;
                }
                break;
              case 14:
                if (s3 = this._dcsParser.unhook(24 !== r2 && 26 !== r2), s3) return this._preserveStack(6, [], 0, n2, i5), s3;
                27 === r2 && (n2 |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0;
                break;
              case 4:
                this._oscParser.start();
                break;
              case 5:
                for (let s4 = i5 + 1; ; s4++) if (s4 >= t4 || (r2 = e4[s4]) < 32 || r2 > 127 && r2 < h2) {
                  this._oscParser.put(e4, i5, s4), i5 = s4 - 1;
                  break;
                }
                break;
              case 6:
                if (s3 = this._oscParser.end(24 !== r2 && 26 !== r2), s3) return this._preserveStack(5, [], 0, n2, i5), s3;
                27 === r2 && (n2 |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0;
            }
            this.currentState = 15 & n2;
          }
        }
      }
      t3.EscapeSequenceParser = c;
    }, 6242: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.OscHandler = t3.OscParser = void 0;
      const s2 = i3(5770), r = i3(482), n = [];
      t3.OscParser = class {
        constructor() {
          this._state = 0, this._active = n, this._id = -1, this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
          }, this._stack = { paused: false, loopPosition: 0, fallThrough: false };
        }
        registerHandler(e4, t4) {
          void 0 === this._handlers[e4] && (this._handlers[e4] = []);
          const i4 = this._handlers[e4];
          return i4.push(t4), { dispose: /* @__PURE__ */ __name(() => {
            const e5 = i4.indexOf(t4);
            -1 !== e5 && i4.splice(e5, 1);
          }, "dispose") };
        }
        clearHandler(e4) {
          this._handlers[e4] && delete this._handlers[e4];
        }
        setHandlerFallback(e4) {
          this._handlerFb = e4;
        }
        dispose() {
          this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
          }, this._active = n;
        }
        reset() {
          if (2 === this._state) for (let e4 = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; e4 >= 0; --e4) this._active[e4].end(false);
          this._stack.paused = false, this._active = n, this._id = -1, this._state = 0;
        }
        _start() {
          if (this._active = this._handlers[this._id] || n, this._active.length) for (let e4 = this._active.length - 1; e4 >= 0; e4--) this._active[e4].start();
          else this._handlerFb(this._id, "START");
        }
        _put(e4, t4, i4) {
          if (this._active.length) for (let s3 = this._active.length - 1; s3 >= 0; s3--) this._active[s3].put(e4, t4, i4);
          else this._handlerFb(this._id, "PUT", (0, r.utf32ToString)(e4, t4, i4));
        }
        start() {
          this.reset(), this._state = 1;
        }
        put(e4, t4, i4) {
          if (3 !== this._state) {
            if (1 === this._state) for (; t4 < i4; ) {
              const i5 = e4[t4++];
              if (59 === i5) {
                this._state = 2, this._start();
                break;
              }
              if (i5 < 48 || 57 < i5) return void (this._state = 3);
              -1 === this._id && (this._id = 0), this._id = 10 * this._id + i5 - 48;
            }
            2 === this._state && i4 - t4 > 0 && this._put(e4, t4, i4);
          }
        }
        end(e4, t4 = true) {
          if (0 !== this._state) {
            if (3 !== this._state) if (1 === this._state && this._start(), this._active.length) {
              let i4 = false, s3 = this._active.length - 1, r2 = false;
              if (this._stack.paused && (s3 = this._stack.loopPosition - 1, i4 = t4, r2 = this._stack.fallThrough, this._stack.paused = false), !r2 && false === i4) {
                for (; s3 >= 0 && (i4 = this._active[s3].end(e4), true !== i4); s3--) if (i4 instanceof Promise) return this._stack.paused = true, this._stack.loopPosition = s3, this._stack.fallThrough = false, i4;
                s3--;
              }
              for (; s3 >= 0; s3--) if (i4 = this._active[s3].end(false), i4 instanceof Promise) return this._stack.paused = true, this._stack.loopPosition = s3, this._stack.fallThrough = true, i4;
            } else this._handlerFb(this._id, "END", e4);
            this._active = n, this._id = -1, this._state = 0;
          }
        }
      }, t3.OscHandler = class {
        constructor(e4) {
          this._handler = e4, this._data = "", this._hitLimit = false;
        }
        start() {
          this._data = "", this._hitLimit = false;
        }
        put(e4, t4, i4) {
          this._hitLimit || (this._data += (0, r.utf32ToString)(e4, t4, i4), this._data.length > s2.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = true));
        }
        end(e4) {
          let t4 = false;
          if (this._hitLimit) t4 = false;
          else if (e4 && (t4 = this._handler(this._data), t4 instanceof Promise)) return t4.then((e5) => (this._data = "", this._hitLimit = false, e5));
          return this._data = "", this._hitLimit = false, t4;
        }
      };
    }, 8742: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.Params = void 0;
      const i3 = 2147483647;
      class s2 {
        static {
          __name(this, "s");
        }
        static fromArray(e4) {
          const t4 = new s2();
          if (!e4.length) return t4;
          for (let i4 = Array.isArray(e4[0]) ? 1 : 0; i4 < e4.length; ++i4) {
            const s3 = e4[i4];
            if (Array.isArray(s3)) for (let e5 = 0; e5 < s3.length; ++e5) t4.addSubParam(s3[e5]);
            else t4.addParam(s3);
          }
          return t4;
        }
        constructor(e4 = 32, t4 = 32) {
          if (this.maxLength = e4, this.maxSubParamsLength = t4, t4 > 256) throw new Error("maxSubParamsLength must not be greater than 256");
          this.params = new Int32Array(e4), this.length = 0, this._subParams = new Int32Array(t4), this._subParamsLength = 0, this._subParamsIdx = new Uint16Array(e4), this._rejectDigits = false, this._rejectSubDigits = false, this._digitIsSub = false;
        }
        clone() {
          const e4 = new s2(this.maxLength, this.maxSubParamsLength);
          return e4.params.set(this.params), e4.length = this.length, e4._subParams.set(this._subParams), e4._subParamsLength = this._subParamsLength, e4._subParamsIdx.set(this._subParamsIdx), e4._rejectDigits = this._rejectDigits, e4._rejectSubDigits = this._rejectSubDigits, e4._digitIsSub = this._digitIsSub, e4;
        }
        toArray() {
          const e4 = [];
          for (let t4 = 0; t4 < this.length; ++t4) {
            e4.push(this.params[t4]);
            const i4 = this._subParamsIdx[t4] >> 8, s3 = 255 & this._subParamsIdx[t4];
            s3 - i4 > 0 && e4.push(Array.prototype.slice.call(this._subParams, i4, s3));
          }
          return e4;
        }
        reset() {
          this.length = 0, this._subParamsLength = 0, this._rejectDigits = false, this._rejectSubDigits = false, this._digitIsSub = false;
        }
        addParam(e4) {
          if (this._digitIsSub = false, this.length >= this.maxLength) this._rejectDigits = true;
          else {
            if (e4 < -1) throw new Error("values lesser than -1 are not allowed");
            this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength, this.params[this.length++] = e4 > i3 ? i3 : e4;
          }
        }
        addSubParam(e4) {
          if (this._digitIsSub = true, this.length) if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) this._rejectSubDigits = true;
          else {
            if (e4 < -1) throw new Error("values lesser than -1 are not allowed");
            this._subParams[this._subParamsLength++] = e4 > i3 ? i3 : e4, this._subParamsIdx[this.length - 1]++;
          }
        }
        hasSubParams(e4) {
          return (255 & this._subParamsIdx[e4]) - (this._subParamsIdx[e4] >> 8) > 0;
        }
        getSubParams(e4) {
          const t4 = this._subParamsIdx[e4] >> 8, i4 = 255 & this._subParamsIdx[e4];
          return i4 - t4 > 0 ? this._subParams.subarray(t4, i4) : null;
        }
        getSubParamsAll() {
          const e4 = {};
          for (let t4 = 0; t4 < this.length; ++t4) {
            const i4 = this._subParamsIdx[t4] >> 8, s3 = 255 & this._subParamsIdx[t4];
            s3 - i4 > 0 && (e4[t4] = this._subParams.slice(i4, s3));
          }
          return e4;
        }
        addDigit(e4) {
          let t4;
          if (this._rejectDigits || !(t4 = this._digitIsSub ? this._subParamsLength : this.length) || this._digitIsSub && this._rejectSubDigits) return;
          const s3 = this._digitIsSub ? this._subParams : this.params, r = s3[t4 - 1];
          s3[t4 - 1] = ~r ? Math.min(10 * r + e4, i3) : e4;
        }
      }
      t3.Params = s2;
    }, 5741: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.AddonManager = void 0, t3.AddonManager = class {
        constructor() {
          this._addons = [];
        }
        dispose() {
          for (let e4 = this._addons.length - 1; e4 >= 0; e4--) this._addons[e4].instance.dispose();
        }
        loadAddon(e4, t4) {
          const i3 = { instance: t4, dispose: t4.dispose, isDisposed: false };
          this._addons.push(i3), t4.dispose = () => this._wrappedAddonDispose(i3), t4.activate(e4);
        }
        _wrappedAddonDispose(e4) {
          if (e4.isDisposed) return;
          let t4 = -1;
          for (let i3 = 0; i3 < this._addons.length; i3++) if (this._addons[i3] === e4) {
            t4 = i3;
            break;
          }
          if (-1 === t4) throw new Error("Could not dispose an addon that has not been loaded");
          e4.isDisposed = true, e4.dispose.apply(e4.instance), this._addons.splice(t4, 1);
        }
      };
    }, 8771: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.BufferApiView = void 0;
      const s2 = i3(3785), r = i3(511);
      t3.BufferApiView = class {
        constructor(e4, t4) {
          this._buffer = e4, this.type = t4;
        }
        init(e4) {
          return this._buffer = e4, this;
        }
        get cursorY() {
          return this._buffer.y;
        }
        get cursorX() {
          return this._buffer.x;
        }
        get viewportY() {
          return this._buffer.ydisp;
        }
        get baseY() {
          return this._buffer.ybase;
        }
        get length() {
          return this._buffer.lines.length;
        }
        getLine(e4) {
          const t4 = this._buffer.lines.get(e4);
          if (t4) return new s2.BufferLineApiView(t4);
        }
        getNullCell() {
          return new r.CellData();
        }
      };
    }, 3785: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.BufferLineApiView = void 0;
      const s2 = i3(511);
      t3.BufferLineApiView = class {
        constructor(e4) {
          this._line = e4;
        }
        get isWrapped() {
          return this._line.isWrapped;
        }
        get length() {
          return this._line.length;
        }
        getCell(e4, t4) {
          if (!(e4 < 0 || e4 >= this._line.length)) return t4 ? (this._line.loadCell(e4, t4), t4) : this._line.loadCell(e4, new s2.CellData());
        }
        translateToString(e4, t4, i4) {
          return this._line.translateToString(e4, t4, i4);
        }
      };
    }, 8285: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.BufferNamespaceApi = void 0;
      const s2 = i3(8771), r = i3(8460), n = i3(844);
      class o extends n.Disposable {
        static {
          __name(this, "o");
        }
        constructor(e4) {
          super(), this._core = e4, this._onBufferChange = this.register(new r.EventEmitter()), this.onBufferChange = this._onBufferChange.event, this._normal = new s2.BufferApiView(this._core.buffers.normal, "normal"), this._alternate = new s2.BufferApiView(this._core.buffers.alt, "alternate"), this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active));
        }
        get active() {
          if (this._core.buffers.active === this._core.buffers.normal) return this.normal;
          if (this._core.buffers.active === this._core.buffers.alt) return this.alternate;
          throw new Error("Active buffer is neither normal nor alternate");
        }
        get normal() {
          return this._normal.init(this._core.buffers.normal);
        }
        get alternate() {
          return this._alternate.init(this._core.buffers.alt);
        }
      }
      t3.BufferNamespaceApi = o;
    }, 7975: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.ParserApi = void 0, t3.ParserApi = class {
        constructor(e4) {
          this._core = e4;
        }
        registerCsiHandler(e4, t4) {
          return this._core.registerCsiHandler(e4, (e5) => t4(e5.toArray()));
        }
        addCsiHandler(e4, t4) {
          return this.registerCsiHandler(e4, t4);
        }
        registerDcsHandler(e4, t4) {
          return this._core.registerDcsHandler(e4, (e5, i3) => t4(e5, i3.toArray()));
        }
        addDcsHandler(e4, t4) {
          return this.registerDcsHandler(e4, t4);
        }
        registerEscHandler(e4, t4) {
          return this._core.registerEscHandler(e4, t4);
        }
        addEscHandler(e4, t4) {
          return this.registerEscHandler(e4, t4);
        }
        registerOscHandler(e4, t4) {
          return this._core.registerOscHandler(e4, t4);
        }
        addOscHandler(e4, t4) {
          return this.registerOscHandler(e4, t4);
        }
      };
    }, 7090: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.UnicodeApi = void 0, t3.UnicodeApi = class {
        constructor(e4) {
          this._core = e4;
        }
        register(e4) {
          this._core.unicodeService.register(e4);
        }
        get versions() {
          return this._core.unicodeService.versions;
        }
        get activeVersion() {
          return this._core.unicodeService.activeVersion;
        }
        set activeVersion(e4) {
          this._core.unicodeService.activeVersion = e4;
        }
      };
    }, 744: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.BufferService = t3.MINIMUM_ROWS = t3.MINIMUM_COLS = void 0;
      const n = i3(8460), o = i3(844), a = i3(5295), h2 = i3(2585);
      t3.MINIMUM_COLS = 2, t3.MINIMUM_ROWS = 1;
      let c = t3.BufferService = class extends o.Disposable {
        get buffer() {
          return this.buffers.active;
        }
        constructor(e4) {
          super(), this.isUserScrolling = false, this._onResize = this.register(new n.EventEmitter()), this.onResize = this._onResize.event, this._onScroll = this.register(new n.EventEmitter()), this.onScroll = this._onScroll.event, this.cols = Math.max(e4.rawOptions.cols || 0, t3.MINIMUM_COLS), this.rows = Math.max(e4.rawOptions.rows || 0, t3.MINIMUM_ROWS), this.buffers = this.register(new a.BufferSet(e4, this));
        }
        resize(e4, t4) {
          this.cols = e4, this.rows = t4, this.buffers.resize(e4, t4), this._onResize.fire({ cols: e4, rows: t4 });
        }
        reset() {
          this.buffers.reset(), this.isUserScrolling = false;
        }
        scroll(e4, t4 = false) {
          const i4 = this.buffer;
          let s3;
          s3 = this._cachedBlankLine, s3 && s3.length === this.cols && s3.getFg(0) === e4.fg && s3.getBg(0) === e4.bg || (s3 = i4.getBlankLine(e4, t4), this._cachedBlankLine = s3), s3.isWrapped = t4;
          const r2 = i4.ybase + i4.scrollTop, n2 = i4.ybase + i4.scrollBottom;
          if (0 === i4.scrollTop) {
            const e5 = i4.lines.isFull;
            n2 === i4.lines.length - 1 ? e5 ? i4.lines.recycle().copyFrom(s3) : i4.lines.push(s3.clone()) : i4.lines.splice(n2 + 1, 0, s3.clone()), e5 ? this.isUserScrolling && (i4.ydisp = Math.max(i4.ydisp - 1, 0)) : (i4.ybase++, this.isUserScrolling || i4.ydisp++);
          } else {
            const e5 = n2 - r2 + 1;
            i4.lines.shiftElements(r2 + 1, e5 - 1, -1), i4.lines.set(n2, s3.clone());
          }
          this.isUserScrolling || (i4.ydisp = i4.ybase), this._onScroll.fire(i4.ydisp);
        }
        scrollLines(e4, t4, i4) {
          const s3 = this.buffer;
          if (e4 < 0) {
            if (0 === s3.ydisp) return;
            this.isUserScrolling = true;
          } else e4 + s3.ydisp >= s3.ybase && (this.isUserScrolling = false);
          const r2 = s3.ydisp;
          s3.ydisp = Math.max(Math.min(s3.ydisp + e4, s3.ybase), 0), r2 !== s3.ydisp && (t4 || this._onScroll.fire(s3.ydisp));
        }
      };
      t3.BufferService = c = s2([r(0, h2.IOptionsService)], c);
    }, 7994: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CharsetService = void 0, t3.CharsetService = class {
        constructor() {
          this.glevel = 0, this._charsets = [];
        }
        reset() {
          this.charset = void 0, this._charsets = [], this.glevel = 0;
        }
        setgLevel(e4) {
          this.glevel = e4, this.charset = this._charsets[e4];
        }
        setgCharset(e4, t4) {
          this._charsets[e4] = t4, this.glevel === e4 && (this.charset = t4);
        }
      };
    }, 1753: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CoreMouseService = void 0;
      const n = i3(2585), o = i3(8460), a = i3(844), h2 = { NONE: { events: 0, restrict: /* @__PURE__ */ __name(() => false, "restrict") }, X10: { events: 1, restrict: /* @__PURE__ */ __name((e4) => 4 !== e4.button && 1 === e4.action && (e4.ctrl = false, e4.alt = false, e4.shift = false, true), "restrict") }, VT200: { events: 19, restrict: /* @__PURE__ */ __name((e4) => 32 !== e4.action, "restrict") }, DRAG: { events: 23, restrict: /* @__PURE__ */ __name((e4) => 32 !== e4.action || 3 !== e4.button, "restrict") }, ANY: { events: 31, restrict: /* @__PURE__ */ __name((e4) => true, "restrict") } };
      function c(e4, t4) {
        let i4 = (e4.ctrl ? 16 : 0) | (e4.shift ? 4 : 0) | (e4.alt ? 8 : 0);
        return 4 === e4.button ? (i4 |= 64, i4 |= e4.action) : (i4 |= 3 & e4.button, 4 & e4.button && (i4 |= 64), 8 & e4.button && (i4 |= 128), 32 === e4.action ? i4 |= 32 : 0 !== e4.action || t4 || (i4 |= 3)), i4;
      }
      __name(c, "c");
      const l = String.fromCharCode, d = { DEFAULT: /* @__PURE__ */ __name((e4) => {
        const t4 = [c(e4, false) + 32, e4.col + 32, e4.row + 32];
        return t4[0] > 255 || t4[1] > 255 || t4[2] > 255 ? "" : `\x1B[M${l(t4[0])}${l(t4[1])}${l(t4[2])}`;
      }, "DEFAULT"), SGR: /* @__PURE__ */ __name((e4) => {
        const t4 = 0 === e4.action && 4 !== e4.button ? "m" : "M";
        return `\x1B[<${c(e4, true)};${e4.col};${e4.row}${t4}`;
      }, "SGR"), SGR_PIXELS: /* @__PURE__ */ __name((e4) => {
        const t4 = 0 === e4.action && 4 !== e4.button ? "m" : "M";
        return `\x1B[<${c(e4, true)};${e4.x};${e4.y}${t4}`;
      }, "SGR_PIXELS") };
      let _2 = t3.CoreMouseService = class extends a.Disposable {
        constructor(e4, t4) {
          super(), this._bufferService = e4, this._coreService = t4, this._protocols = {}, this._encodings = {}, this._activeProtocol = "", this._activeEncoding = "", this._lastEvent = null, this._onProtocolChange = this.register(new o.EventEmitter()), this.onProtocolChange = this._onProtocolChange.event;
          for (const e5 of Object.keys(h2)) this.addProtocol(e5, h2[e5]);
          for (const e5 of Object.keys(d)) this.addEncoding(e5, d[e5]);
          this.reset();
        }
        addProtocol(e4, t4) {
          this._protocols[e4] = t4;
        }
        addEncoding(e4, t4) {
          this._encodings[e4] = t4;
        }
        get activeProtocol() {
          return this._activeProtocol;
        }
        get areMouseEventsActive() {
          return 0 !== this._protocols[this._activeProtocol].events;
        }
        set activeProtocol(e4) {
          if (!this._protocols[e4]) throw new Error(`unknown protocol "${e4}"`);
          this._activeProtocol = e4, this._onProtocolChange.fire(this._protocols[e4].events);
        }
        get activeEncoding() {
          return this._activeEncoding;
        }
        set activeEncoding(e4) {
          if (!this._encodings[e4]) throw new Error(`unknown encoding "${e4}"`);
          this._activeEncoding = e4;
        }
        reset() {
          this.activeProtocol = "NONE", this.activeEncoding = "DEFAULT", this._lastEvent = null;
        }
        triggerMouseEvent(e4) {
          if (e4.col < 0 || e4.col >= this._bufferService.cols || e4.row < 0 || e4.row >= this._bufferService.rows) return false;
          if (4 === e4.button && 32 === e4.action) return false;
          if (3 === e4.button && 32 !== e4.action) return false;
          if (4 !== e4.button && (2 === e4.action || 3 === e4.action)) return false;
          if (e4.col++, e4.row++, 32 === e4.action && this._lastEvent && this._equalEvents(this._lastEvent, e4, "SGR_PIXELS" === this._activeEncoding)) return false;
          if (!this._protocols[this._activeProtocol].restrict(e4)) return false;
          const t4 = this._encodings[this._activeEncoding](e4);
          return t4 && ("DEFAULT" === this._activeEncoding ? this._coreService.triggerBinaryEvent(t4) : this._coreService.triggerDataEvent(t4, true)), this._lastEvent = e4, true;
        }
        explainEvents(e4) {
          return { down: !!(1 & e4), up: !!(2 & e4), drag: !!(4 & e4), move: !!(8 & e4), wheel: !!(16 & e4) };
        }
        _equalEvents(e4, t4, i4) {
          if (i4) {
            if (e4.x !== t4.x) return false;
            if (e4.y !== t4.y) return false;
          } else {
            if (e4.col !== t4.col) return false;
            if (e4.row !== t4.row) return false;
          }
          return e4.button === t4.button && e4.action === t4.action && e4.ctrl === t4.ctrl && e4.alt === t4.alt && e4.shift === t4.shift;
        }
      };
      t3.CoreMouseService = _2 = s2([r(0, n.IBufferService), r(1, n.ICoreService)], _2);
    }, 6975: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.CoreService = void 0;
      const n = i3(1439), o = i3(8460), a = i3(844), h2 = i3(2585), c = Object.freeze({ insertMode: false }), l = Object.freeze({ applicationCursorKeys: false, applicationKeypad: false, bracketedPasteMode: false, origin: false, reverseWraparound: false, sendFocus: false, wraparound: true });
      let d = t3.CoreService = class extends a.Disposable {
        constructor(e4, t4, i4) {
          super(), this._bufferService = e4, this._logService = t4, this._optionsService = i4, this.isCursorInitialized = false, this.isCursorHidden = false, this._onData = this.register(new o.EventEmitter()), this.onData = this._onData.event, this._onUserInput = this.register(new o.EventEmitter()), this.onUserInput = this._onUserInput.event, this._onBinary = this.register(new o.EventEmitter()), this.onBinary = this._onBinary.event, this._onRequestScrollToBottom = this.register(new o.EventEmitter()), this.onRequestScrollToBottom = this._onRequestScrollToBottom.event, this.modes = (0, n.clone)(c), this.decPrivateModes = (0, n.clone)(l);
        }
        reset() {
          this.modes = (0, n.clone)(c), this.decPrivateModes = (0, n.clone)(l);
        }
        triggerDataEvent(e4, t4 = false) {
          if (this._optionsService.rawOptions.disableStdin) return;
          const i4 = this._bufferService.buffer;
          t4 && this._optionsService.rawOptions.scrollOnUserInput && i4.ybase !== i4.ydisp && this._onRequestScrollToBottom.fire(), t4 && this._onUserInput.fire(), this._logService.debug(`sending data "${e4}"`, () => e4.split("").map((e5) => e5.charCodeAt(0))), this._onData.fire(e4);
        }
        triggerBinaryEvent(e4) {
          this._optionsService.rawOptions.disableStdin || (this._logService.debug(`sending binary "${e4}"`, () => e4.split("").map((e5) => e5.charCodeAt(0))), this._onBinary.fire(e4));
        }
      };
      t3.CoreService = d = s2([r(0, h2.IBufferService), r(1, h2.ILogService), r(2, h2.IOptionsService)], d);
    }, 9074: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.DecorationService = void 0;
      const s2 = i3(8055), r = i3(8460), n = i3(844), o = i3(6106);
      let a = 0, h2 = 0;
      class c extends n.Disposable {
        static {
          __name(this, "c");
        }
        get decorations() {
          return this._decorations.values();
        }
        constructor() {
          super(), this._decorations = new o.SortedList((e4) => e4?.marker.line), this._onDecorationRegistered = this.register(new r.EventEmitter()), this.onDecorationRegistered = this._onDecorationRegistered.event, this._onDecorationRemoved = this.register(new r.EventEmitter()), this.onDecorationRemoved = this._onDecorationRemoved.event, this.register((0, n.toDisposable)(() => this.reset()));
        }
        registerDecoration(e4) {
          if (e4.marker.isDisposed) return;
          const t4 = new l(e4);
          if (t4) {
            const e5 = t4.marker.onDispose(() => t4.dispose());
            t4.onDispose(() => {
              t4 && (this._decorations.delete(t4) && this._onDecorationRemoved.fire(t4), e5.dispose());
            }), this._decorations.insert(t4), this._onDecorationRegistered.fire(t4);
          }
          return t4;
        }
        reset() {
          for (const e4 of this._decorations.values()) e4.dispose();
          this._decorations.clear();
        }
        *getDecorationsAtCell(e4, t4, i4) {
          let s3 = 0, r2 = 0;
          for (const n2 of this._decorations.getKeyIterator(t4)) s3 = n2.options.x ?? 0, r2 = s3 + (n2.options.width ?? 1), e4 >= s3 && e4 < r2 && (!i4 || (n2.options.layer ?? "bottom") === i4) && (yield n2);
        }
        forEachDecorationAtCell(e4, t4, i4, s3) {
          this._decorations.forEachByKey(t4, (t5) => {
            a = t5.options.x ?? 0, h2 = a + (t5.options.width ?? 1), e4 >= a && e4 < h2 && (!i4 || (t5.options.layer ?? "bottom") === i4) && s3(t5);
          });
        }
      }
      t3.DecorationService = c;
      class l extends n.Disposable {
        static {
          __name(this, "l");
        }
        get isDisposed() {
          return this._isDisposed;
        }
        get backgroundColorRGB() {
          return null === this._cachedBg && (this.options.backgroundColor ? this._cachedBg = s2.css.toColor(this.options.backgroundColor) : this._cachedBg = void 0), this._cachedBg;
        }
        get foregroundColorRGB() {
          return null === this._cachedFg && (this.options.foregroundColor ? this._cachedFg = s2.css.toColor(this.options.foregroundColor) : this._cachedFg = void 0), this._cachedFg;
        }
        constructor(e4) {
          super(), this.options = e4, this.onRenderEmitter = this.register(new r.EventEmitter()), this.onRender = this.onRenderEmitter.event, this._onDispose = this.register(new r.EventEmitter()), this.onDispose = this._onDispose.event, this._cachedBg = null, this._cachedFg = null, this.marker = e4.marker, this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position && (this.options.overviewRulerOptions.position = "full");
        }
        dispose() {
          this._onDispose.fire(), super.dispose();
        }
      }
    }, 4348: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.InstantiationService = t3.ServiceCollection = void 0;
      const s2 = i3(2585), r = i3(8343);
      class n {
        static {
          __name(this, "n");
        }
        constructor(...e4) {
          this._entries = /* @__PURE__ */ new Map();
          for (const [t4, i4] of e4) this.set(t4, i4);
        }
        set(e4, t4) {
          const i4 = this._entries.get(e4);
          return this._entries.set(e4, t4), i4;
        }
        forEach(e4) {
          for (const [t4, i4] of this._entries.entries()) e4(t4, i4);
        }
        has(e4) {
          return this._entries.has(e4);
        }
        get(e4) {
          return this._entries.get(e4);
        }
      }
      t3.ServiceCollection = n, t3.InstantiationService = class {
        constructor() {
          this._services = new n(), this._services.set(s2.IInstantiationService, this);
        }
        setService(e4, t4) {
          this._services.set(e4, t4);
        }
        getService(e4) {
          return this._services.get(e4);
        }
        createInstance(e4, ...t4) {
          const i4 = (0, r.getServiceDependencies)(e4).sort((e5, t5) => e5.index - t5.index), s3 = [];
          for (const t5 of i4) {
            const i5 = this._services.get(t5.id);
            if (!i5) throw new Error(`[createInstance] ${e4.name} depends on UNKNOWN service ${t5.id}.`);
            s3.push(i5);
          }
          const n2 = i4.length > 0 ? i4[0].index : t4.length;
          if (t4.length !== n2) throw new Error(`[createInstance] First service dependency of ${e4.name} at position ${n2 + 1} conflicts with ${t4.length} static arguments`);
          return new e4(...[...t4, ...s3]);
        }
      };
    }, 7866: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a2 = e4.length - 1; a2 >= 0; a2--) (r2 = e4[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.traceCall = t3.setTraceLogger = t3.LogService = void 0;
      const n = i3(844), o = i3(2585), a = { trace: o.LogLevelEnum.TRACE, debug: o.LogLevelEnum.DEBUG, info: o.LogLevelEnum.INFO, warn: o.LogLevelEnum.WARN, error: o.LogLevelEnum.ERROR, off: o.LogLevelEnum.OFF };
      let h2, c = t3.LogService = class extends n.Disposable {
        get logLevel() {
          return this._logLevel;
        }
        constructor(e4) {
          super(), this._optionsService = e4, this._logLevel = o.LogLevelEnum.OFF, this._updateLogLevel(), this.register(this._optionsService.onSpecificOptionChange("logLevel", () => this._updateLogLevel())), h2 = this;
        }
        _updateLogLevel() {
          this._logLevel = a[this._optionsService.rawOptions.logLevel];
        }
        _evalLazyOptionalParams(e4) {
          for (let t4 = 0; t4 < e4.length; t4++) "function" == typeof e4[t4] && (e4[t4] = e4[t4]());
        }
        _log(e4, t4, i4) {
          this._evalLazyOptionalParams(i4), e4.call(console, (this._optionsService.options.logger ? "" : "xterm.js: ") + t4, ...i4);
        }
        trace(e4, ...t4) {
          this._logLevel <= o.LogLevelEnum.TRACE && this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger) ?? console.log, e4, t4);
        }
        debug(e4, ...t4) {
          this._logLevel <= o.LogLevelEnum.DEBUG && this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger) ?? console.log, e4, t4);
        }
        info(e4, ...t4) {
          this._logLevel <= o.LogLevelEnum.INFO && this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger) ?? console.info, e4, t4);
        }
        warn(e4, ...t4) {
          this._logLevel <= o.LogLevelEnum.WARN && this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger) ?? console.warn, e4, t4);
        }
        error(e4, ...t4) {
          this._logLevel <= o.LogLevelEnum.ERROR && this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger) ?? console.error, e4, t4);
        }
      };
      t3.LogService = c = s2([r(0, o.IOptionsService)], c), t3.setTraceLogger = function(e4) {
        h2 = e4;
      }, t3.traceCall = function(e4, t4, i4) {
        if ("function" != typeof i4.value) throw new Error("not supported");
        const s3 = i4.value;
        i4.value = function(...e5) {
          if (h2.logLevel !== o.LogLevelEnum.TRACE) return s3.apply(this, e5);
          h2.trace(`GlyphRenderer#${s3.name}(${e5.map((e6) => JSON.stringify(e6)).join(", ")})`);
          const t5 = s3.apply(this, e5);
          return h2.trace(`GlyphRenderer#${s3.name} return`, t5), t5;
        };
      };
    }, 7302: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.OptionsService = t3.DEFAULT_OPTIONS = void 0;
      const s2 = i3(8460), r = i3(844), n = i3(6114);
      t3.DEFAULT_OPTIONS = { cols: 80, rows: 24, cursorBlink: false, cursorStyle: "block", cursorWidth: 1, cursorInactiveStyle: "outline", customGlyphs: true, drawBoldTextInBrightColors: true, documentOverride: null, fastScrollModifier: "alt", fastScrollSensitivity: 5, fontFamily: "courier-new, courier, monospace", fontSize: 15, fontWeight: "normal", fontWeightBold: "bold", ignoreBracketedPasteMode: false, lineHeight: 1, letterSpacing: 0, linkHandler: null, logLevel: "info", logger: null, scrollback: 1e3, scrollOnUserInput: true, scrollSensitivity: 1, screenReaderMode: false, smoothScrollDuration: 0, macOptionIsMeta: false, macOptionClickForcesSelection: false, minimumContrastRatio: 1, disableStdin: false, allowProposedApi: false, allowTransparency: false, tabStopWidth: 8, theme: {}, rescaleOverlappingGlyphs: false, rightClickSelectsWord: n.isMac, windowOptions: {}, windowsMode: false, windowsPty: {}, wordSeparator: " ()[]{}',\"`", altClickMovesCursor: true, convertEol: false, termName: "xterm", cancelEvents: false, overviewRulerWidth: 0 };
      const o = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"];
      class a extends r.Disposable {
        static {
          __name(this, "a");
        }
        constructor(e4) {
          super(), this._onOptionChange = this.register(new s2.EventEmitter()), this.onOptionChange = this._onOptionChange.event;
          const i4 = { ...t3.DEFAULT_OPTIONS };
          for (const t4 in e4) if (t4 in i4) try {
            const s3 = e4[t4];
            i4[t4] = this._sanitizeAndValidateOption(t4, s3);
          } catch (e5) {
            console.error(e5);
          }
          this.rawOptions = i4, this.options = { ...i4 }, this._setupOptions(), this.register((0, r.toDisposable)(() => {
            this.rawOptions.linkHandler = null, this.rawOptions.documentOverride = null;
          }));
        }
        onSpecificOptionChange(e4, t4) {
          return this.onOptionChange((i4) => {
            i4 === e4 && t4(this.rawOptions[e4]);
          });
        }
        onMultipleOptionChange(e4, t4) {
          return this.onOptionChange((i4) => {
            -1 !== e4.indexOf(i4) && t4();
          });
        }
        _setupOptions() {
          const e4 = /* @__PURE__ */ __name((e5) => {
            if (!(e5 in t3.DEFAULT_OPTIONS)) throw new Error(`No option with key "${e5}"`);
            return this.rawOptions[e5];
          }, "e"), i4 = /* @__PURE__ */ __name((e5, i5) => {
            if (!(e5 in t3.DEFAULT_OPTIONS)) throw new Error(`No option with key "${e5}"`);
            i5 = this._sanitizeAndValidateOption(e5, i5), this.rawOptions[e5] !== i5 && (this.rawOptions[e5] = i5, this._onOptionChange.fire(e5));
          }, "i");
          for (const t4 in this.rawOptions) {
            const s3 = { get: e4.bind(this, t4), set: i4.bind(this, t4) };
            Object.defineProperty(this.options, t4, s3);
          }
        }
        _sanitizeAndValidateOption(e4, i4) {
          switch (e4) {
            case "cursorStyle":
              if (i4 || (i4 = t3.DEFAULT_OPTIONS[e4]), !/* @__PURE__ */ function(e5) {
                return "block" === e5 || "underline" === e5 || "bar" === e5;
              }(i4)) throw new Error(`"${i4}" is not a valid value for ${e4}`);
              break;
            case "wordSeparator":
              i4 || (i4 = t3.DEFAULT_OPTIONS[e4]);
              break;
            case "fontWeight":
            case "fontWeightBold":
              if ("number" == typeof i4 && 1 <= i4 && i4 <= 1e3) break;
              i4 = o.includes(i4) ? i4 : t3.DEFAULT_OPTIONS[e4];
              break;
            case "cursorWidth":
              i4 = Math.floor(i4);
            case "lineHeight":
            case "tabStopWidth":
              if (i4 < 1) throw new Error(`${e4} cannot be less than 1, value: ${i4}`);
              break;
            case "minimumContrastRatio":
              i4 = Math.max(1, Math.min(21, Math.round(10 * i4) / 10));
              break;
            case "scrollback":
              if ((i4 = Math.min(i4, 4294967295)) < 0) throw new Error(`${e4} cannot be less than 0, value: ${i4}`);
              break;
            case "fastScrollSensitivity":
            case "scrollSensitivity":
              if (i4 <= 0) throw new Error(`${e4} cannot be less than or equal to 0, value: ${i4}`);
              break;
            case "rows":
            case "cols":
              if (!i4 && 0 !== i4) throw new Error(`${e4} must be numeric, value: ${i4}`);
              break;
            case "windowsPty":
              i4 = i4 ?? {};
          }
          return i4;
        }
      }
      t3.OptionsService = a;
    }, 2660: function(e3, t3, i3) {
      var s2 = this && this.__decorate || function(e4, t4, i4, s3) {
        var r2, n2 = arguments.length, o2 = n2 < 3 ? t4 : null === s3 ? s3 = Object.getOwnPropertyDescriptor(t4, i4) : s3;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) o2 = Reflect.decorate(e4, t4, i4, s3);
        else for (var a = e4.length - 1; a >= 0; a--) (r2 = e4[a]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t4, i4, o2) : r2(t4, i4)) || o2);
        return n2 > 3 && o2 && Object.defineProperty(t4, i4, o2), o2;
      }, r = this && this.__param || function(e4, t4) {
        return function(i4, s3) {
          t4(i4, s3, e4);
        };
      };
      Object.defineProperty(t3, "__esModule", { value: true }), t3.OscLinkService = void 0;
      const n = i3(2585);
      let o = t3.OscLinkService = class {
        constructor(e4) {
          this._bufferService = e4, this._nextId = 1, this._entriesWithId = /* @__PURE__ */ new Map(), this._dataByLinkId = /* @__PURE__ */ new Map();
        }
        registerLink(e4) {
          const t4 = this._bufferService.buffer;
          if (void 0 === e4.id) {
            const i5 = t4.addMarker(t4.ybase + t4.y), s4 = { data: e4, id: this._nextId++, lines: [i5] };
            return i5.onDispose(() => this._removeMarkerFromLink(s4, i5)), this._dataByLinkId.set(s4.id, s4), s4.id;
          }
          const i4 = e4, s3 = this._getEntryIdKey(i4), r2 = this._entriesWithId.get(s3);
          if (r2) return this.addLineToLink(r2.id, t4.ybase + t4.y), r2.id;
          const n2 = t4.addMarker(t4.ybase + t4.y), o2 = { id: this._nextId++, key: this._getEntryIdKey(i4), data: i4, lines: [n2] };
          return n2.onDispose(() => this._removeMarkerFromLink(o2, n2)), this._entriesWithId.set(o2.key, o2), this._dataByLinkId.set(o2.id, o2), o2.id;
        }
        addLineToLink(e4, t4) {
          const i4 = this._dataByLinkId.get(e4);
          if (i4 && i4.lines.every((e5) => e5.line !== t4)) {
            const e5 = this._bufferService.buffer.addMarker(t4);
            i4.lines.push(e5), e5.onDispose(() => this._removeMarkerFromLink(i4, e5));
          }
        }
        getLinkData(e4) {
          return this._dataByLinkId.get(e4)?.data;
        }
        _getEntryIdKey(e4) {
          return `${e4.id};;${e4.uri}`;
        }
        _removeMarkerFromLink(e4, t4) {
          const i4 = e4.lines.indexOf(t4);
          -1 !== i4 && (e4.lines.splice(i4, 1), 0 === e4.lines.length && (void 0 !== e4.data.id && this._entriesWithId.delete(e4.key), this._dataByLinkId.delete(e4.id)));
        }
      };
      t3.OscLinkService = o = s2([r(0, n.IBufferService)], o);
    }, 8343: (e3, t3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.createDecorator = t3.getServiceDependencies = t3.serviceRegistry = void 0;
      const i3 = "di$target", s2 = "di$dependencies";
      t3.serviceRegistry = /* @__PURE__ */ new Map(), t3.getServiceDependencies = function(e4) {
        return e4[s2] || [];
      }, t3.createDecorator = function(e4) {
        if (t3.serviceRegistry.has(e4)) return t3.serviceRegistry.get(e4);
        const r = /* @__PURE__ */ __name(function(e5, t4, n) {
          if (3 !== arguments.length) throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
          !function(e6, t5, r2) {
            t5[i3] === t5 ? t5[s2].push({ id: e6, index: r2 }) : (t5[s2] = [{ id: e6, index: r2 }], t5[i3] = t5);
          }(r, e5, n);
        }, "r");
        return r.toString = () => e4, t3.serviceRegistry.set(e4, r), r;
      };
    }, 2585: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.IDecorationService = t3.IUnicodeService = t3.IOscLinkService = t3.IOptionsService = t3.ILogService = t3.LogLevelEnum = t3.IInstantiationService = t3.ICharsetService = t3.ICoreService = t3.ICoreMouseService = t3.IBufferService = void 0;
      const s2 = i3(8343);
      var r;
      t3.IBufferService = (0, s2.createDecorator)("BufferService"), t3.ICoreMouseService = (0, s2.createDecorator)("CoreMouseService"), t3.ICoreService = (0, s2.createDecorator)("CoreService"), t3.ICharsetService = (0, s2.createDecorator)("CharsetService"), t3.IInstantiationService = (0, s2.createDecorator)("InstantiationService"), function(e4) {
        e4[e4.TRACE = 0] = "TRACE", e4[e4.DEBUG = 1] = "DEBUG", e4[e4.INFO = 2] = "INFO", e4[e4.WARN = 3] = "WARN", e4[e4.ERROR = 4] = "ERROR", e4[e4.OFF = 5] = "OFF";
      }(r || (t3.LogLevelEnum = r = {})), t3.ILogService = (0, s2.createDecorator)("LogService"), t3.IOptionsService = (0, s2.createDecorator)("OptionsService"), t3.IOscLinkService = (0, s2.createDecorator)("OscLinkService"), t3.IUnicodeService = (0, s2.createDecorator)("UnicodeService"), t3.IDecorationService = (0, s2.createDecorator)("DecorationService");
    }, 1480: (e3, t3, i3) => {
      Object.defineProperty(t3, "__esModule", { value: true }), t3.UnicodeService = void 0;
      const s2 = i3(8460), r = i3(225);
      class n {
        static {
          __name(this, "n");
        }
        static extractShouldJoin(e4) {
          return 0 != (1 & e4);
        }
        static extractWidth(e4) {
          return e4 >> 1 & 3;
        }
        static extractCharKind(e4) {
          return e4 >> 3;
        }
        static createPropertyValue(e4, t4, i4 = false) {
          return (16777215 & e4) << 3 | (3 & t4) << 1 | (i4 ? 1 : 0);
        }
        constructor() {
          this._providers = /* @__PURE__ */ Object.create(null), this._active = "", this._onChange = new s2.EventEmitter(), this.onChange = this._onChange.event;
          const e4 = new r.UnicodeV6();
          this.register(e4), this._active = e4.version, this._activeProvider = e4;
        }
        dispose() {
          this._onChange.dispose();
        }
        get versions() {
          return Object.keys(this._providers);
        }
        get activeVersion() {
          return this._active;
        }
        set activeVersion(e4) {
          if (!this._providers[e4]) throw new Error(`unknown Unicode version "${e4}"`);
          this._active = e4, this._activeProvider = this._providers[e4], this._onChange.fire(e4);
        }
        register(e4) {
          this._providers[e4.version] = e4;
        }
        wcwidth(e4) {
          return this._activeProvider.wcwidth(e4);
        }
        getStringCellWidth(e4) {
          let t4 = 0, i4 = 0;
          const s3 = e4.length;
          for (let r2 = 0; r2 < s3; ++r2) {
            let o = e4.charCodeAt(r2);
            if (55296 <= o && o <= 56319) {
              if (++r2 >= s3) return t4 + this.wcwidth(o);
              const i5 = e4.charCodeAt(r2);
              56320 <= i5 && i5 <= 57343 ? o = 1024 * (o - 55296) + i5 - 56320 + 65536 : t4 += this.wcwidth(i5);
            }
            const a = this.charProperties(o, i4);
            let h2 = n.extractWidth(a);
            n.extractShouldJoin(a) && (h2 -= n.extractWidth(i4)), t4 += h2, i4 = a;
          }
          return t4;
        }
        charProperties(e4, t4) {
          return this._activeProvider.charProperties(e4, t4);
        }
      }
      t3.UnicodeService = n;
    } }, t2 = {};
    function i2(s2) {
      var r = t2[s2];
      if (void 0 !== r) return r.exports;
      var n = t2[s2] = { exports: {} };
      return e2[s2].call(n.exports, n, n.exports, i2), n.exports;
    }
    __name(i2, "i");
    var s = {};
    return (() => {
      var e3 = s;
      Object.defineProperty(e3, "__esModule", { value: true }), e3.Terminal = void 0;
      const t3 = i2(9042), r = i2(3236), n = i2(844), o = i2(5741), a = i2(8285), h2 = i2(7975), c = i2(7090), l = ["cols", "rows"];
      class d extends n.Disposable {
        static {
          __name(this, "d");
        }
        constructor(e4) {
          super(), this._core = this.register(new r.Terminal(e4)), this._addonManager = this.register(new o.AddonManager()), this._publicOptions = { ...this._core.options };
          const t4 = /* @__PURE__ */ __name((e5) => this._core.options[e5], "t"), i3 = /* @__PURE__ */ __name((e5, t5) => {
            this._checkReadonlyOptions(e5), this._core.options[e5] = t5;
          }, "i");
          for (const e5 in this._core.options) {
            const s2 = { get: t4.bind(this, e5), set: i3.bind(this, e5) };
            Object.defineProperty(this._publicOptions, e5, s2);
          }
        }
        _checkReadonlyOptions(e4) {
          if (l.includes(e4)) throw new Error(`Option "${e4}" can only be set in the constructor`);
        }
        _checkProposedApi() {
          if (!this._core.optionsService.rawOptions.allowProposedApi) throw new Error("You must set the allowProposedApi option to true to use proposed API");
        }
        get onBell() {
          return this._core.onBell;
        }
        get onBinary() {
          return this._core.onBinary;
        }
        get onCursorMove() {
          return this._core.onCursorMove;
        }
        get onData() {
          return this._core.onData;
        }
        get onKey() {
          return this._core.onKey;
        }
        get onLineFeed() {
          return this._core.onLineFeed;
        }
        get onRender() {
          return this._core.onRender;
        }
        get onResize() {
          return this._core.onResize;
        }
        get onScroll() {
          return this._core.onScroll;
        }
        get onSelectionChange() {
          return this._core.onSelectionChange;
        }
        get onTitleChange() {
          return this._core.onTitleChange;
        }
        get onWriteParsed() {
          return this._core.onWriteParsed;
        }
        get element() {
          return this._core.element;
        }
        get parser() {
          return this._parser || (this._parser = new h2.ParserApi(this._core)), this._parser;
        }
        get unicode() {
          return this._checkProposedApi(), new c.UnicodeApi(this._core);
        }
        get textarea() {
          return this._core.textarea;
        }
        get rows() {
          return this._core.rows;
        }
        get cols() {
          return this._core.cols;
        }
        get buffer() {
          return this._buffer || (this._buffer = this.register(new a.BufferNamespaceApi(this._core))), this._buffer;
        }
        get markers() {
          return this._checkProposedApi(), this._core.markers;
        }
        get modes() {
          const e4 = this._core.coreService.decPrivateModes;
          let t4 = "none";
          switch (this._core.coreMouseService.activeProtocol) {
            case "X10":
              t4 = "x10";
              break;
            case "VT200":
              t4 = "vt200";
              break;
            case "DRAG":
              t4 = "drag";
              break;
            case "ANY":
              t4 = "any";
          }
          return { applicationCursorKeysMode: e4.applicationCursorKeys, applicationKeypadMode: e4.applicationKeypad, bracketedPasteMode: e4.bracketedPasteMode, insertMode: this._core.coreService.modes.insertMode, mouseTrackingMode: t4, originMode: e4.origin, reverseWraparoundMode: e4.reverseWraparound, sendFocusMode: e4.sendFocus, wraparoundMode: e4.wraparound };
        }
        get options() {
          return this._publicOptions;
        }
        set options(e4) {
          for (const t4 in e4) this._publicOptions[t4] = e4[t4];
        }
        blur() {
          this._core.blur();
        }
        focus() {
          this._core.focus();
        }
        input(e4, t4 = true) {
          this._core.input(e4, t4);
        }
        resize(e4, t4) {
          this._verifyIntegers(e4, t4), this._core.resize(e4, t4);
        }
        open(e4) {
          this._core.open(e4);
        }
        attachCustomKeyEventHandler(e4) {
          this._core.attachCustomKeyEventHandler(e4);
        }
        attachCustomWheelEventHandler(e4) {
          this._core.attachCustomWheelEventHandler(e4);
        }
        registerLinkProvider(e4) {
          return this._core.registerLinkProvider(e4);
        }
        registerCharacterJoiner(e4) {
          return this._checkProposedApi(), this._core.registerCharacterJoiner(e4);
        }
        deregisterCharacterJoiner(e4) {
          this._checkProposedApi(), this._core.deregisterCharacterJoiner(e4);
        }
        registerMarker(e4 = 0) {
          return this._verifyIntegers(e4), this._core.registerMarker(e4);
        }
        registerDecoration(e4) {
          return this._checkProposedApi(), this._verifyPositiveIntegers(e4.x ?? 0, e4.width ?? 0, e4.height ?? 0), this._core.registerDecoration(e4);
        }
        hasSelection() {
          return this._core.hasSelection();
        }
        select(e4, t4, i3) {
          this._verifyIntegers(e4, t4, i3), this._core.select(e4, t4, i3);
        }
        getSelection() {
          return this._core.getSelection();
        }
        getSelectionPosition() {
          return this._core.getSelectionPosition();
        }
        clearSelection() {
          this._core.clearSelection();
        }
        selectAll() {
          this._core.selectAll();
        }
        selectLines(e4, t4) {
          this._verifyIntegers(e4, t4), this._core.selectLines(e4, t4);
        }
        dispose() {
          super.dispose();
        }
        scrollLines(e4) {
          this._verifyIntegers(e4), this._core.scrollLines(e4);
        }
        scrollPages(e4) {
          this._verifyIntegers(e4), this._core.scrollPages(e4);
        }
        scrollToTop() {
          this._core.scrollToTop();
        }
        scrollToBottom() {
          this._core.scrollToBottom();
        }
        scrollToLine(e4) {
          this._verifyIntegers(e4), this._core.scrollToLine(e4);
        }
        clear() {
          this._core.clear();
        }
        write(e4, t4) {
          this._core.write(e4, t4);
        }
        writeln(e4, t4) {
          this._core.write(e4), this._core.write("\r\n", t4);
        }
        paste(e4) {
          this._core.paste(e4);
        }
        refresh(e4, t4) {
          this._verifyIntegers(e4, t4), this._core.refresh(e4, t4);
        }
        reset() {
          this._core.reset();
        }
        clearTextureAtlas() {
          this._core.clearTextureAtlas();
        }
        loadAddon(e4) {
          this._addonManager.loadAddon(this, e4);
        }
        static get strings() {
          return t3;
        }
        _verifyIntegers(...e4) {
          for (const t4 of e4) if (t4 === 1 / 0 || isNaN(t4) || t4 % 1 != 0) throw new Error("This API only accepts integers");
        }
        _verifyPositiveIntegers(...e4) {
          for (const t4 of e4) if (t4 && (t4 === 1 / 0 || isNaN(t4) || t4 % 1 != 0 || t4 < 0)) throw new Error("This API only accepts positive integers");
        }
      }
      e3.Terminal = d;
    })(), s;
  })());
})(xterm$2, xterm$2.exports);
var xtermExports = xterm$2.exports;
const xterm$1 = /* @__PURE__ */ getDefaultExportFromCjs(xtermExports);
function useTerminal(element) {
  const fitAddon = new addonFitExports.FitAddon();
  const terminal = markRaw(
    new xtermExports.Terminal({
      convertEol: true
    })
  );
  terminal.loadAddon(fitAddon);
  terminal.attachCustomKeyEventHandler((event) => {
    if (event.type === "keydown" && (event.ctrlKey || event.metaKey)) {
      if (event.key === "c" || event.key === "v") {
        return false;
      }
    }
    return true;
  });
  onMounted(async () => {
    terminal.open(element.value);
  });
  onUnmounted(() => {
    terminal.dispose();
  });
  return {
    terminal,
    useAutoSize(root24, autoRows = true, autoCols = true, onResize2) {
      const ensureValidRows = /* @__PURE__ */ __name((rows) => {
        if (rows == null || isNaN(rows)) {
          return root24.value?.clientHeight / 20;
        }
        return rows;
      }, "ensureValidRows");
      const ensureValidCols = /* @__PURE__ */ __name((cols) => {
        if (cols == null || isNaN(cols)) {
          return root24.value?.clientWidth / 8;
        }
        return cols;
      }, "ensureValidCols");
      const resize = /* @__PURE__ */ __name(() => {
        const dims = fitAddon.proposeDimensions();
        terminal.resize(
          autoCols ? ensureValidCols(dims?.cols) : terminal.cols,
          autoRows ? ensureValidRows(dims?.rows) : terminal.rows
        );
        onResize2?.();
      }, "resize");
      const resizeObserver = new ResizeObserver(lodashExports.debounce(resize, 25));
      onMounted(async () => {
        resizeObserver.observe(root24.value);
        resize();
      });
      onUnmounted(() => {
        resizeObserver.disconnect();
      });
      return { resize };
    }
  };
}
__name(useTerminal, "useTerminal");
const _withScopeId$d = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-250ab9af"), n = n(), popScopeId(), n), "_withScopeId$d");
const _hoisted_1$v = { class: "p-terminal rounded-none h-full w-full p-2" };
const _sfc_main$t = /* @__PURE__ */ defineComponent({
  __name: "BaseTerminal",
  emits: ["created"],
  setup(__props, { emit: __emit }) {
    const emit2 = __emit;
    const terminalEl = ref();
    const rootEl = ref();
    emit2("created", useTerminal(terminalEl), rootEl);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "relative overflow-hidden h-full w-full bg-black",
        ref_key: "rootEl",
        ref: rootEl
      }, [
        createBaseVNode("div", _hoisted_1$v, [
          createBaseVNode("div", {
            class: "h-full terminal-host",
            ref_key: "terminalEl",
            ref: terminalEl
          }, null, 512)
        ])
      ], 512);
    };
  }
});
const BaseTerminal = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-250ab9af"]]);
const _sfc_main$s = /* @__PURE__ */ defineComponent({
  __name: "CommandTerminal",
  setup(__props) {
    const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root24) => {
      const terminalApi = electronAPI().Terminal;
      let offData;
      let offOutput;
      useAutoSize(root24, true, true, () => {
        if (!terminal.element?.offsetParent) return;
        terminalApi.resize(terminal.cols, terminal.rows);
      });
      onMounted(async () => {
        offData = terminal.onData(async (message3) => {
          terminalApi.write(message3);
        });
        offOutput = terminalApi.onOutput((message3) => {
          terminal.write(message3);
        });
        const restore = await terminalApi.restore();
        setTimeout(() => {
          if (restore.buffer.length) {
            terminal.resize(restore.size.cols, restore.size.rows);
            terminal.write(restore.buffer.join(""));
          }
        }, 500);
      });
      onUnmounted(() => {
        offData?.dispose();
        offOutput?.();
      });
    }, "terminalCreated");
    return (_ctx, _cache) => {
      return openBlock(), createBlock(BaseTerminal, { onCreated: terminalCreated });
    };
  }
});
const CommandTerminal = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-6187144a"]]);
const useExecutionStore = /* @__PURE__ */ defineStore("execution", () => {
  const clientId = ref(null);
  const activePromptId = ref(null);
  const queuedPrompts = ref({});
  const executingNodeId = ref(null);
  const executingNode = computed(() => {
    if (!executingNodeId.value) return null;
    const workflow = activePrompt.value?.workflow;
    if (!workflow) return null;
    const canvasState = workflow.changeTracker?.activeState ?? null;
    if (!canvasState) return null;
    return canvasState.nodes.find(
      (n) => String(n.id) === executingNodeId.value
    ) ?? null;
  });
  const _executingNodeProgress = ref(null);
  const executingNodeProgress = computed(
    () => _executingNodeProgress.value ? Math.round(
      _executingNodeProgress.value.value / _executingNodeProgress.value.max * 100
    ) : null
  );
  const activePrompt = computed(
    () => queuedPrompts.value[activePromptId.value ?? ""]
  );
  const totalNodesToExecute = computed(() => {
    if (!activePrompt.value) return 0;
    return Object.values(activePrompt.value.nodes).length;
  });
  const isIdle = computed(() => !activePromptId.value);
  const nodesExecuted = computed(() => {
    if (!activePrompt.value) return 0;
    return Object.values(activePrompt.value.nodes).filter(Boolean).length;
  });
  const executionProgress = computed(() => {
    if (!activePrompt.value) return 0;
    const total = totalNodesToExecute.value;
    const done = nodesExecuted.value;
    return Math.round(done / total * 100);
  });
  function bindExecutionEvents() {
    api.addEventListener(
      "execution_start",
      handleExecutionStart
    );
    api.addEventListener(
      "execution_cached",
      handleExecutionCached
    );
    api.addEventListener("executed", handleExecuted);
    api.addEventListener("executing", handleExecuting);
    api.addEventListener("progress", handleProgress);
    api.addEventListener("status", handleStatus);
  }
  __name(bindExecutionEvents, "bindExecutionEvents");
  function unbindExecutionEvents() {
    api.removeEventListener(
      "execution_start",
      handleExecutionStart
    );
    api.removeEventListener(
      "execution_cached",
      handleExecutionCached
    );
    api.removeEventListener("executed", handleExecuted);
    api.removeEventListener("executing", handleExecuting);
    api.removeEventListener("progress", handleProgress);
    api.removeEventListener("status", handleStatus);
  }
  __name(unbindExecutionEvents, "unbindExecutionEvents");
  function handleExecutionStart(e2) {
    activePromptId.value = e2.detail.prompt_id;
    queuedPrompts.value[activePromptId.value] ??= { nodes: {} };
  }
  __name(handleExecutionStart, "handleExecutionStart");
  function handleExecutionCached(e2) {
    if (!activePrompt.value) return;
    for (const n of e2.detail.nodes) {
      activePrompt.value.nodes[n] = true;
    }
  }
  __name(handleExecutionCached, "handleExecutionCached");
  function handleExecuted(e2) {
    if (!activePrompt.value) return;
    activePrompt.value.nodes[e2.detail.node] = true;
  }
  __name(handleExecuted, "handleExecuted");
  function handleExecuting(e2) {
    _executingNodeProgress.value = null;
    if (!activePrompt.value) return;
    if (executingNodeId.value && activePrompt.value) {
      activePrompt.value.nodes[executingNodeId.value] = true;
    }
    executingNodeId.value = e2.detail ? String(e2.detail) : null;
    if (!executingNodeId.value) {
      if (activePromptId.value) {
        delete queuedPrompts.value[activePromptId.value];
      }
      activePromptId.value = null;
    }
  }
  __name(handleExecuting, "handleExecuting");
  function handleProgress(e2) {
    _executingNodeProgress.value = e2.detail;
  }
  __name(handleProgress, "handleProgress");
  function handleStatus(e2) {
    if (api.clientId) {
      clientId.value = api.clientId;
      api.removeEventListener("status", handleStatus);
    }
  }
  __name(handleStatus, "handleStatus");
  function storePrompt({
    nodes,
    id: id3,
    workflow
  }) {
    queuedPrompts.value[id3] ??= { nodes: {} };
    const queuedPrompt = queuedPrompts.value[id3];
    queuedPrompt.nodes = {
      ...nodes.reduce((p2, n) => {
        p2[n] = false;
        return p2;
      }, {}),
      ...queuedPrompt.nodes
    };
    queuedPrompt.workflow = workflow;
    console.debug(
      `queued task ${id3} with ${Object.values(queuedPrompt.nodes).length} nodes`
    );
  }
  __name(storePrompt, "storePrompt");
  return {
    isIdle,
    clientId,
    activePromptId,
    queuedPrompts,
    executingNodeId,
    activePrompt,
    totalNodesToExecute,
    nodesExecuted,
    executionProgress,
    executingNode,
    executingNodeProgress,
    bindExecutionEvents,
    unbindExecutionEvents,
    storePrompt,
    // Raw executing progress data for backward compatibility in ComfyApp.
    _executingNodeProgress
  };
});
const _withScopeId$c = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-b27b58f4"), n = n(), popScopeId(), n), "_withScopeId$c");
const _hoisted_1$u = { class: "bg-black h-full w-full" };
const _hoisted_2$m = {
  key: 0,
  class: "p-4 text-center"
};
const _sfc_main$r = /* @__PURE__ */ defineComponent({
  __name: "LogsTerminal",
  setup(__props) {
    const errorMessage = ref("");
    const loading2 = ref(true);
    const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root24) => {
      useAutoSize(root24, true, false);
      const update = /* @__PURE__ */ __name((entries, size2) => {
        if (size2) {
          terminal.resize(size2.cols, terminal.rows);
        }
        terminal.write(entries.map((e2) => e2.m).join(""));
      }, "update");
      const logReceived = /* @__PURE__ */ __name((e2) => {
        update(e2.detail.entries, e2.detail.size);
      }, "logReceived");
      const loadLogEntries = /* @__PURE__ */ __name(async () => {
        const logs = await api.getRawLogs();
        update(logs.entries, logs.size);
      }, "loadLogEntries");
      const watchLogs = /* @__PURE__ */ __name(async () => {
        const { clientId } = storeToRefs(useExecutionStore());
        if (!clientId.value) {
          await until(clientId).not.toBeNull();
        }
        api.subscribeLogs(true);
        api.addEventListener("logs", logReceived);
      }, "watchLogs");
      onMounted(async () => {
        try {
          await loadLogEntries();
        } catch (err) {
          console.error("Error loading logs", err);
          errorMessage.value = "Unable to load logs, please ensure you have updated your ComfyUI backend.";
          return;
        }
        await watchLogs();
        loading2.value = false;
      });
      onUnmounted(() => {
        if (api.clientId) {
          api.subscribeLogs(false);
        }
        api.removeEventListener("logs", logReceived);
      });
    }, "terminalCreated");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$u, [
        errorMessage.value ? (openBlock(), createElementBlock("p", _hoisted_2$m, toDisplayString$1(errorMessage.value), 1)) : loading2.value ? (openBlock(), createBlock(unref(script$Y), {
          key: 1,
          class: "relative inset-0 flex justify-center items-center h-full z-10"
        })) : createCommentVNode("", true),
        withDirectives(createVNode(BaseTerminal, { onCreated: terminalCreated }, null, 512), [
          [vShow, !loading2.value]
        ])
      ]);
    };
  }
});
const LogsTerminal = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-b27b58f4"]]);
const useLogsTerminalTab = /* @__PURE__ */ __name(() => {
  const { t: t2 } = useI18n();
  return {
    id: "logs-terminal",
    title: t2("g.logs"),
    component: markRaw(LogsTerminal),
    type: "vue"
  };
}, "useLogsTerminalTab");
const useCommandTerminalTab = /* @__PURE__ */ __name(() => {
  const { t: t2 } = useI18n();
  return {
    id: "command-terminal",
    title: t2("g.terminal"),
    component: markRaw(CommandTerminal),
    type: "vue"
  };
}, "useCommandTerminalTab");
const useBottomPanelStore = /* @__PURE__ */ defineStore("bottomPanel", () => {
  const bottomPanelVisible = ref(false);
  const toggleBottomPanel = /* @__PURE__ */ __name(() => {
    if (bottomPanelTabs.value.length === 0) {
      return;
    }
    bottomPanelVisible.value = !bottomPanelVisible.value;
  }, "toggleBottomPanel");
  const bottomPanelTabs = ref([]);
  const activeBottomPanelTabId = ref(null);
  const activeBottomPanelTab = computed(() => {
    return bottomPanelTabs.value.find(
      (tab) => tab.id === activeBottomPanelTabId.value
    ) ?? null;
  });
  const setActiveTab = /* @__PURE__ */ __name((tabId) => {
    activeBottomPanelTabId.value = tabId;
  }, "setActiveTab");
  const toggleBottomPanelTab = /* @__PURE__ */ __name((tabId) => {
    if (activeBottomPanelTabId.value === tabId && bottomPanelVisible.value) {
      bottomPanelVisible.value = false;
    } else {
      activeBottomPanelTabId.value = tabId;
      bottomPanelVisible.value = true;
    }
  }, "toggleBottomPanelTab");
  const registerBottomPanelTab = /* @__PURE__ */ __name((tab) => {
    bottomPanelTabs.value = [...bottomPanelTabs.value, tab];
    if (bottomPanelTabs.value.length === 1) {
      activeBottomPanelTabId.value = tab.id;
    }
    useCommandStore().registerCommand({
      id: `Workspace.ToggleBottomPanelTab.${tab.id}`,
      icon: "pi pi-list",
      label: `Toggle ${tab.title} Bottom Panel`,
      function: /* @__PURE__ */ __name(() => toggleBottomPanelTab(tab.id), "function")
    });
  }, "registerBottomPanelTab");
  const registerCoreBottomPanelTabs = /* @__PURE__ */ __name(() => {
    registerBottomPanelTab(useLogsTerminalTab());
    if (isElectron()) {
      registerBottomPanelTab(useCommandTerminalTab());
    }
  }, "registerCoreBottomPanelTabs");
  const registerExtensionBottomPanelTabs = /* @__PURE__ */ __name((extension) => {
    if (extension.bottomPanelTabs) {
      extension.bottomPanelTabs.forEach(registerBottomPanelTab);
    }
  }, "registerExtensionBottomPanelTabs");
  return {
    bottomPanelVisible,
    toggleBottomPanel,
    bottomPanelTabs,
    activeBottomPanelTab,
    activeBottomPanelTabId,
    setActiveTab,
    toggleBottomPanelTab,
    registerBottomPanelTab,
    registerCoreBottomPanelTabs,
    registerExtensionBottomPanelTabs
  };
});
const useExtensionService = /* @__PURE__ */ __name(() => {
  const extensionStore = useExtensionStore();
  const settingStore = useSettingStore();
  const keybindingStore = useKeybindingStore();
  const { wrapWithErrorHandling } = useErrorHandling();
  const loadExtensions = /* @__PURE__ */ __name(async () => {
    extensionStore.loadDisabledExtensionNames(
      settingStore.get("Comfy.Extension.Disabled")
    );
    const extensions = await api.getExtensions();
    await __vitePreload(() => import("./index-Bordpmzt.js"), true ? __vite__mapDeps([25,26]) : void 0, import.meta.url);
    extensionStore.captureCoreExtensions();
    await Promise.all(
      extensions.filter((extension) => !extension.includes("extensions/core")).map(async (ext) => {
        try {
          await import(
            /* @vite-ignore */
            api.fileURL(ext)
          );
        } catch (error2) {
          console.error("Error loading extension", ext, error2);
        }
      })
    );
  }, "loadExtensions");
  const registerExtension = /* @__PURE__ */ __name((extension) => {
    extensionStore.registerExtension(extension);
    const addKeybinding = wrapWithErrorHandling(
      keybindingStore.addDefaultKeybinding
    );
    const addSetting = wrapWithErrorHandling(settingStore.addSetting);
    extension.keybindings?.forEach((keybinding) => {
      addKeybinding(new KeybindingImpl(keybinding));
    });
    useCommandStore().loadExtensionCommands(extension);
    useMenuItemStore().loadExtensionMenuCommands(extension);
    extension.settings?.forEach(addSetting);
    useBottomPanelStore().registerExtensionBottomPanelTabs(extension);
    if (extension.getCustomWidgets) {
      ;
      (async () => {
        if (extension.getCustomWidgets) {
          const widgets = await extension.getCustomWidgets(app$1);
          useWidgetStore().registerCustomWidgets(widgets);
        }
      })();
    }
  }, "registerExtension");
  const invokeExtensions = /* @__PURE__ */ __name((method, ...args) => {
    const results = [];
    for (const ext of extensionStore.enabledExtensions) {
      if (method in ext) {
        try {
          results.push(ext[method](...args, app$1));
        } catch (error2) {
          console.error(
            `Error calling extension '${ext.name}' method '${method}'`,
            { error: error2 },
            { extension: ext },
            { args }
          );
        }
      }
    }
    return results;
  }, "invokeExtensions");
  const invokeExtensionsAsync = /* @__PURE__ */ __name(async (method, ...args) => {
    return await Promise.all(
      extensionStore.enabledExtensions.map(async (ext) => {
        if (method in ext) {
          try {
            return await ext[method](...args, app$1);
          } catch (error2) {
            console.error(
              `Error calling extension '${ext.name}' method '${method}'`,
              { error: error2 },
              { extension: ext },
              { args }
            );
          }
        }
      })
    );
  }, "invokeExtensionsAsync");
  return {
    loadExtensions,
    registerExtension,
    invokeExtensions,
    invokeExtensionsAsync
  };
}, "useExtensionService");
let ComfyDialog$1 = class ComfyDialog2 extends EventTarget {
  static {
    __name(this, "ComfyDialog");
  }
  element;
  textElement;
  #buttons;
  constructor(type = "div", buttons = null) {
    super();
    this.#buttons = buttons;
    this.element = $el(type + ".comfy-modal", { parent: document.body }, [
      $el("div.comfy-modal-content", [
        $el("p", { $: /* @__PURE__ */ __name((p2) => this.textElement = p2, "$") }),
        ...this.createButtons()
      ])
    ]);
  }
  createButtons() {
    return this.#buttons ?? [
      $el("button", {
        type: "button",
        textContent: "Close",
        onclick: /* @__PURE__ */ __name(() => this.close(), "onclick")
      })
    ];
  }
  close() {
    this.element.style.display = "none";
  }
  show(html) {
    if (typeof html === "string") {
      this.textElement.innerHTML = html;
    } else {
      this.textElement.replaceChildren(
        ...html instanceof Array ? html : [html]
      );
    }
    this.element.style.display = "flex";
  }
};
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.dialog = window.comfyAPI.dialog || {};
window.comfyAPI.dialog.ComfyDialog = ComfyDialog$1;
class ComfySettingsDialog extends ComfyDialog$1 {
  static {
    __name(this, "ComfySettingsDialog");
  }
  app;
  constructor(app2) {
    super();
    this.app = app2;
  }
  dispatchChange(id3, value4, oldValue2) {
    this.dispatchEvent(
      new CustomEvent(id3 + ".change", {
        detail: {
          value: value4,
          oldValue: oldValue2
        }
      })
    );
  }
  /**
   * @deprecated Use `settingStore.settingValues` instead.
   */
  get settingsValues() {
    return useSettingStore().settingValues;
  }
  /**
   * @deprecated Use `settingStore.settingsById` instead.
   */
  get settingsLookup() {
    return useSettingStore().settingsById;
  }
  /**
   * @deprecated Use `settingStore.settingsById` instead.
   */
  get settingsParamLookup() {
    return useSettingStore().settingsById;
  }
  /**
   * @deprecated Use `settingStore.get` instead.
   */
  getSettingValue(id3, defaultValue) {
    if (defaultValue !== void 0) {
      console.warn(
        `Parameter defaultValue is deprecated. The default value in settings definition will be used instead.`
      );
    }
    return useSettingStore().get(id3);
  }
  /**
   * @deprecated Use `settingStore.getDefaultValue` instead.
   */
  getSettingDefaultValue(id3) {
    return useSettingStore().getDefaultValue(id3);
  }
  /**
   * @deprecated Use `settingStore.set` instead.
   */
  async setSettingValueAsync(id3, value4) {
    await useSettingStore().set(id3, value4);
  }
  /**
   * @deprecated Use `settingStore.set` instead.
   */
  setSettingValue(id3, value4) {
    useSettingStore().set(id3, value4).catch((err) => {
      useToastStore().addAlert(`Error saving setting '${id3}': ${err}`);
    });
  }
  /**
   * @deprecated Deprecated for external callers/extensions. Use
   * `ComfyExtension.settings` field instead.
   *
   * Example:
   * ```ts
   * app.registerExtension({
   *   name: 'My Extension',
   *   settings: [
   *     {
   *       id: 'My.Setting',
   *       name: 'My Setting',
   *       type: 'text',
   *       defaultValue: 'Hello, world!'
   *     }
   *   ]
   * })
   * ```
   */
  addSetting(params) {
    const settingStore = useSettingStore();
    settingStore.addSetting(params);
    return {
      get value() {
        return settingStore.get(params.id);
      },
      set value(v2) {
        settingStore.set(params.id, v2);
      }
    };
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.settings = window.comfyAPI.settings || {};
window.comfyAPI.settings.ComfySettingsDialog = ComfySettingsDialog;
function toggleSwitch(name2, items2, e2) {
  const onChange5 = e2?.onChange;
  let selectedIndex;
  let elements;
  function updateSelected(index2) {
    if (selectedIndex != null) {
      elements[selectedIndex].classList.remove("comfy-toggle-selected");
    }
    onChange5?.({
      item: items2[index2],
      prev: selectedIndex == null ? void 0 : items2[selectedIndex]
    });
    selectedIndex = index2;
    elements[selectedIndex].classList.add("comfy-toggle-selected");
  }
  __name(updateSelected, "updateSelected");
  elements = items2.map((item3, i2) => {
    if (typeof item3 === "string") item3 = { text: item3 };
    if (!item3.value) item3.value = item3.text;
    const toggle4 = $el(
      "label",
      {
        textContent: item3.text,
        title: item3.tooltip ?? ""
      },
      $el("input", {
        name: name2,
        type: "radio",
        value: item3.value ?? item3.text,
        checked: item3.selected,
        onchange: /* @__PURE__ */ __name(() => {
          updateSelected(i2);
        }, "onchange")
      })
    );
    if (item3.selected) {
      updateSelected(i2);
    }
    return toggle4;
  });
  const container = $el("div.comfy-toggle-switch", elements);
  if (selectedIndex == null) {
    elements[0].children[0].checked = true;
    updateSelected(0);
  }
  return container;
}
__name(toggleSwitch, "toggleSwitch");
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.toggleSwitch = window.comfyAPI.toggleSwitch || {};
window.comfyAPI.toggleSwitch.toggleSwitch = toggleSwitch;
const ComfyDialog = ComfyDialog$1;
function $el(tag, propsOrChildren, children) {
  const split2 = tag.split(".");
  const element = document.createElement(split2.shift());
  if (split2.length > 0) {
    element.classList.add(...split2);
  }
  if (propsOrChildren) {
    if (typeof propsOrChildren === "string") {
      propsOrChildren = { textContent: propsOrChildren };
    } else if (propsOrChildren instanceof Element) {
      propsOrChildren = [propsOrChildren];
    }
    if (Array.isArray(propsOrChildren)) {
      element.append(...propsOrChildren);
    } else {
      const {
        parent,
        $: cb,
        dataset,
        style: style2,
        ...rest
      } = propsOrChildren;
      if (rest.for) {
        element.setAttribute("for", rest.for);
      }
      if (style2) {
        Object.assign(element.style, style2);
      }
      if (dataset) {
        Object.assign(element.dataset, dataset);
      }
      Object.assign(element, rest);
      if (children) {
        element.append(...Array.isArray(children) ? children : [children]);
      }
      if (parent) {
        parent.append(element);
      }
      if (cb) {
        cb(element);
      }
    }
  }
  return element;
}
__name($el, "$el");
function dragElement(dragEl, settings) {
  var posDiffX = 0, posDiffY = 0, posStartX = 0, posStartY = 0, newPosX = 0, newPosY = 0;
  if (dragEl.getElementsByClassName("drag-handle")[0]) {
    dragEl.getElementsByClassName("drag-handle")[0].onmousedown = dragMouseDown;
  } else {
    dragEl.onmousedown = dragMouseDown;
  }
  const resizeObserver = new ResizeObserver(() => {
    ensureInBounds();
  }).observe(dragEl);
  function ensureInBounds() {
    try {
      newPosX = Math.min(
        document.body.clientWidth - dragEl.clientWidth,
        Math.max(0, dragEl.offsetLeft)
      );
      newPosY = Math.min(
        document.body.clientHeight - dragEl.clientHeight,
        Math.max(0, dragEl.offsetTop)
      );
      positionElement();
    } catch (exception) {
    }
  }
  __name(ensureInBounds, "ensureInBounds");
  function positionElement() {
    if (dragEl.style.display === "none") return;
    const halfWidth = document.body.clientWidth / 2;
    const anchorRight = newPosX + dragEl.clientWidth / 2 > halfWidth;
    if (anchorRight) {
      dragEl.style.left = "unset";
      dragEl.style.right = document.body.clientWidth - newPosX - dragEl.clientWidth + "px";
    } else {
      dragEl.style.left = newPosX + "px";
      dragEl.style.right = "unset";
    }
    dragEl.style.top = newPosY + "px";
    dragEl.style.bottom = "unset";
    if (savePos) {
      localStorage.setItem(
        "Comfy.MenuPosition",
        JSON.stringify({
          x: dragEl.offsetLeft,
          y: dragEl.offsetTop
        })
      );
    }
  }
  __name(positionElement, "positionElement");
  function restorePos() {
    let posString = localStorage.getItem("Comfy.MenuPosition");
    if (posString) {
      const pos2 = JSON.parse(posString);
      newPosX = pos2.x;
      newPosY = pos2.y;
      positionElement();
      ensureInBounds();
    }
  }
  __name(restorePos, "restorePos");
  let savePos = void 0;
  restorePos();
  savePos = true;
  function dragMouseDown(e2) {
    e2 = e2 || window.event;
    e2.preventDefault();
    posStartX = e2.clientX;
    posStartY = e2.clientY;
    document.onmouseup = closeDragElement;
    document.onmousemove = elementDrag;
  }
  __name(dragMouseDown, "dragMouseDown");
  function elementDrag(e2) {
    e2 = e2 || window.event;
    e2.preventDefault();
    dragEl.classList.add("comfy-menu-manual-pos");
    posDiffX = e2.clientX - posStartX;
    posDiffY = e2.clientY - posStartY;
    posStartX = e2.clientX;
    posStartY = e2.clientY;
    newPosX = Math.min(
      document.body.clientWidth - dragEl.clientWidth,
      Math.max(0, dragEl.offsetLeft + posDiffX)
    );
    newPosY = Math.min(
      document.body.clientHeight - dragEl.clientHeight,
      Math.max(0, dragEl.offsetTop + posDiffY)
    );
    positionElement();
  }
  __name(elementDrag, "elementDrag");
  window.addEventListener("resize", () => {
    ensureInBounds();
  });
  function closeDragElement() {
    document.onmouseup = null;
    document.onmousemove = null;
  }
  __name(closeDragElement, "closeDragElement");
  return restorePos;
}
__name(dragElement, "dragElement");
class ComfyList {
  static {
    __name(this, "ComfyList");
  }
  #type;
  #text;
  #reverse;
  element;
  button;
  constructor(text2, type, reverse2) {
    this.#text = text2;
    this.#type = type || text2.toLowerCase();
    this.#reverse = reverse2 || false;
    this.element = $el("div.comfy-list");
    this.element.style.display = "none";
  }
  get visible() {
    return this.element.style.display !== "none";
  }
  async load() {
    const items2 = await api.getItems(this.#type);
    this.element.replaceChildren(
      ...Object.keys(items2).flatMap((section) => [
        $el("h4", {
          textContent: section
        }),
        $el("div.comfy-list-items", [
          ...(this.#reverse ? items2[section].reverse() : items2[section]).map(
            (item3) => {
              const removeAction = "remove" in item3 ? item3.remove : {
                name: "Delete",
                cb: /* @__PURE__ */ __name(() => api.deleteItem(this.#type, item3.prompt[1]), "cb")
              };
              return $el("div", { textContent: item3.prompt[0] + ": " }, [
                $el("button", {
                  textContent: "Load",
                  onclick: /* @__PURE__ */ __name(async () => {
                    await app$1.loadGraphData(
                      item3.prompt[3].extra_pnginfo.workflow,
                      true,
                      false
                    );
                    if ("outputs" in item3) {
                      app$1.nodeOutputs = {};
                      for (const [key, value4] of Object.entries(item3.outputs)) {
                        const realKey = item3["meta"]?.[key]?.display_node ?? key;
                        app$1.nodeOutputs[realKey] = value4;
                      }
                    }
                  }, "onclick")
                }),
                $el("button", {
                  textContent: removeAction.name,
                  onclick: /* @__PURE__ */ __name(async () => {
                    await removeAction.cb();
                    await this.update();
                  }, "onclick")
                })
              ]);
            }
          )
        ])
      ]),
      $el("div.comfy-list-actions", [
        $el("button", {
          textContent: "Clear " + this.#text,
          onclick: /* @__PURE__ */ __name(async () => {
            await api.clearItems(this.#type);
            await this.load();
          }, "onclick")
        }),
        $el("button", { textContent: "Refresh", onclick: /* @__PURE__ */ __name(() => this.load(), "onclick") })
      ])
    );
  }
  async update() {
    if (this.visible) {
      await this.load();
    }
  }
  async show() {
    this.element.style.display = "block";
    this.button.textContent = "Close";
    await this.load();
  }
  hide() {
    this.element.style.display = "none";
    this.button.textContent = "View " + this.#text;
  }
  toggle() {
    if (this.visible) {
      this.hide();
      return false;
    } else {
      this.show();
      return true;
    }
  }
}
class ComfyUI {
  static {
    __name(this, "ComfyUI");
  }
  app;
  dialog;
  settings;
  batchCount;
  lastQueueSize;
  queue;
  history;
  autoQueueMode;
  graphHasChanged;
  autoQueueEnabled;
  menuContainer;
  queueSize;
  restoreMenuPosition;
  loadFile;
  constructor(app2) {
    this.app = app2;
    this.dialog = new ComfyDialog();
    this.settings = new ComfySettingsDialog(app2);
    this.batchCount = 1;
    this.lastQueueSize = 0;
    this.queue = new ComfyList("Queue");
    this.history = new ComfyList("History", "history", true);
    api.addEventListener("status", () => {
      this.queue.update();
      this.history.update();
    });
    this.setup(document.body);
  }
  setup(containerElement) {
    const fileInput2 = $el("input", {
      id: "comfy-file-input",
      type: "file",
      accept: ".json,image/png,.latent,.safetensors,image/webp,audio/flac",
      style: { display: "none" },
      parent: document.body,
      onchange: /* @__PURE__ */ __name(async () => {
        await app$1.handleFile(fileInput2.files[0]);
        fileInput2.value = "";
      }, "onchange")
    });
    this.loadFile = () => fileInput2.click();
    const autoQueueModeEl = toggleSwitch(
      "autoQueueMode",
      [
        {
          text: "instant",
          tooltip: "A new prompt will be queued as soon as the queue reaches 0"
        },
        {
          text: "change",
          tooltip: "A new prompt will be queued when the queue is at 0 and the graph is/has changed"
        }
      ],
      {
        onChange: /* @__PURE__ */ __name((value4) => {
          this.autoQueueMode = value4.item.value;
        }, "onChange")
      }
    );
    autoQueueModeEl.style.display = "none";
    api.addEventListener("graphChanged", () => {
      if (this.autoQueueMode === "change" && this.autoQueueEnabled === true) {
        if (this.lastQueueSize === 0) {
          this.graphHasChanged = false;
          app$1.queuePrompt(0, this.batchCount);
        } else {
          this.graphHasChanged = true;
        }
      }
    });
    this.menuContainer = $el("div.comfy-menu", { parent: containerElement }, [
      $el(
        "div.drag-handle.comfy-menu-header",
        {
          style: {
            overflow: "hidden",
            position: "relative",
            width: "100%",
            cursor: "default"
          }
        },
        [
          $el("span.drag-handle"),
          $el("span.comfy-menu-queue-size", { $: /* @__PURE__ */ __name((q) => this.queueSize = q, "$") }),
          $el("div.comfy-menu-actions", [
            $el("button.comfy-settings-btn", {
              textContent: "⚙️",
              onclick: /* @__PURE__ */ __name(() => {
                useDialogService().showSettingsDialog();
              }, "onclick")
            }),
            $el("button.comfy-close-menu-btn", {
              textContent: "×",
              onclick: /* @__PURE__ */ __name(() => {
                useWorkspaceStore().focusMode = true;
              }, "onclick")
            })
          ])
        ]
      ),
      $el("button.comfy-queue-btn", {
        id: "queue-button",
        textContent: "Queue Prompt",
        onclick: /* @__PURE__ */ __name(() => app$1.queuePrompt(0, this.batchCount), "onclick")
      }),
      $el("div", {}, [
        $el("label", { innerHTML: "Extra options" }, [
          $el("input", {
            type: "checkbox",
            onchange: /* @__PURE__ */ __name((i2) => {
              document.getElementById("extraOptions").style.display = i2.srcElement.checked ? "block" : "none";
              this.batchCount = i2.srcElement.checked ? Number.parseInt(
                document.getElementById(
                  "batchCountInputRange"
                ).value
              ) : 1;
              document.getElementById("autoQueueCheckbox").checked = false;
              this.autoQueueEnabled = false;
            }, "onchange")
          })
        ])
      ]),
      $el(
        "div",
        { id: "extraOptions", style: { width: "100%", display: "none" } },
        [
          $el("div", [
            $el("label", { innerHTML: "Batch count" }),
            $el("input", {
              id: "batchCountInputNumber",
              type: "number",
              value: this.batchCount,
              min: "1",
              style: { width: "35%", marginLeft: "0.4em" },
              oninput: /* @__PURE__ */ __name((i2) => {
                this.batchCount = i2.target.value;
                document.getElementById(
                  "batchCountInputRange"
                ).value = this.batchCount.toString();
              }, "oninput")
            }),
            $el("input", {
              id: "batchCountInputRange",
              type: "range",
              min: "1",
              max: "100",
              value: this.batchCount,
              oninput: /* @__PURE__ */ __name((i2) => {
                this.batchCount = i2.srcElement.value;
                document.getElementById(
                  "batchCountInputNumber"
                ).value = i2.srcElement.value;
              }, "oninput")
            })
          ]),
          $el("div", [
            $el("label", {
              for: "autoQueueCheckbox",
              innerHTML: "Auto Queue"
            }),
            $el("input", {
              id: "autoQueueCheckbox",
              type: "checkbox",
              checked: false,
              title: "Automatically queue prompt when the queue size hits 0",
              onchange: /* @__PURE__ */ __name((e2) => {
                this.autoQueueEnabled = e2.target.checked;
                autoQueueModeEl.style.display = this.autoQueueEnabled ? "" : "none";
              }, "onchange")
            }),
            autoQueueModeEl
          ])
        ]
      ),
      $el("div.comfy-menu-btns", [
        $el("button", {
          id: "queue-front-button",
          textContent: "Queue Front",
          onclick: /* @__PURE__ */ __name(() => app$1.queuePrompt(-1, this.batchCount), "onclick")
        }),
        $el("button", {
          $: /* @__PURE__ */ __name((b) => this.queue.button = b, "$"),
          id: "comfy-view-queue-button",
          textContent: "View Queue",
          onclick: /* @__PURE__ */ __name(() => {
            this.history.hide();
            this.queue.toggle();
          }, "onclick")
        }),
        $el("button", {
          $: /* @__PURE__ */ __name((b) => this.history.button = b, "$"),
          id: "comfy-view-history-button",
          textContent: "View History",
          onclick: /* @__PURE__ */ __name(() => {
            this.queue.hide();
            this.history.toggle();
          }, "onclick")
        })
      ]),
      this.queue.element,
      this.history.element,
      $el("button", {
        id: "comfy-save-button",
        textContent: "Save",
        onclick: /* @__PURE__ */ __name(() => {
          useCommandStore().execute("Comfy.ExportWorkflow");
        }, "onclick")
      }),
      $el("button", {
        id: "comfy-dev-save-api-button",
        textContent: "Save (API Format)",
        style: { width: "100%", display: "none" },
        onclick: /* @__PURE__ */ __name(() => {
          useCommandStore().execute("Comfy.ExportWorkflowAPI");
        }, "onclick")
      }),
      $el("button", {
        id: "comfy-load-button",
        textContent: "Load",
        onclick: /* @__PURE__ */ __name(() => fileInput2.click(), "onclick")
      }),
      $el("button", {
        id: "comfy-refresh-button",
        textContent: "Refresh",
        onclick: /* @__PURE__ */ __name(() => app$1.refreshComboInNodes(), "onclick")
      }),
      $el("button", {
        id: "comfy-clipspace-button",
        textContent: "Clipspace",
        onclick: /* @__PURE__ */ __name(() => app$1.openClipspace(), "onclick")
      }),
      $el("button", {
        id: "comfy-clear-button",
        textContent: "Clear",
        onclick: /* @__PURE__ */ __name(() => {
          if (!useSettingStore().get("Comfy.ConfirmClear") || confirm("Clear workflow?")) {
            app$1.clean();
            app$1.graph.clear();
            app$1.resetView();
            api.dispatchCustomEvent("graphCleared");
          }
        }, "onclick")
      }),
      $el("button", {
        id: "comfy-load-default-button",
        textContent: "Load Default",
        onclick: /* @__PURE__ */ __name(async () => {
          if (!useSettingStore().get("Comfy.ConfirmClear") || confirm("Load default workflow?")) {
            app$1.resetView();
            await app$1.loadGraphData();
          }
        }, "onclick")
      }),
      $el("button", {
        id: "comfy-reset-view-button",
        textContent: "Reset View",
        onclick: /* @__PURE__ */ __name(async () => {
          app$1.resetView();
        }, "onclick")
      })
    ]);
    this.menuContainer.style.display = "none";
    this.restoreMenuPosition = dragElement(this.menuContainer, this.settings);
    this.setStatus({ exec_info: { queue_remaining: "X" } });
  }
  setStatus(status) {
    this.queueSize.textContent = "Queue size: " + (status ? status.exec_info.queue_remaining : "ERR");
    if (status) {
      if (this.lastQueueSize != 0 && status.exec_info.queue_remaining == 0 && this.autoQueueEnabled && (this.autoQueueMode === "instant" || this.graphHasChanged) && !app$1.lastExecutionError) {
        app$1.queuePrompt(0, this.batchCount);
        status.exec_info.queue_remaining += this.batchCount;
        this.graphHasChanged = false;
      }
      this.lastQueueSize = status.exec_info.queue_remaining;
    }
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.ui = window.comfyAPI.ui || {};
window.comfyAPI.ui.ComfyDialog = ComfyDialog;
window.comfyAPI.ui.$el = $el;
window.comfyAPI.ui.ComfyUI = ComfyUI;
function calculateImageGrid(imgs, dw, dh) {
  let best = 0;
  let w = imgs[0].naturalWidth;
  let h2 = imgs[0].naturalHeight;
  const numImages = imgs.length;
  let cellWidth, cellHeight, cols, rows, shiftX;
  for (let c = 1; c <= numImages; c++) {
    const r = Math.ceil(numImages / c);
    const cW = dw / c;
    const cH = dh / r;
    const scaleX = cW / w;
    const scaleY = cH / h2;
    const scale = Math.min(scaleX, scaleY, 1);
    const imageW = w * scale;
    const imageH = h2 * scale;
    const area = imageW * imageH * numImages;
    if (area > best) {
      best = area;
      cellWidth = imageW;
      cellHeight = imageH;
      cols = c;
      rows = r;
      shiftX = c * ((cW - imageW) / 2);
    }
  }
  return { cellWidth, cellHeight, cols, rows, shiftX };
}
__name(calculateImageGrid, "calculateImageGrid");
function createImageHost(node3) {
  const el = $el("div.comfy-img-preview");
  let currentImgs;
  let first2 = true;
  function updateSize() {
    let w = null;
    let h2 = null;
    if (currentImgs) {
      let elH = el.clientHeight;
      if (first2) {
        first2 = false;
        if (elH < 190) {
          elH = 190;
        }
        el.style.setProperty("--comfy-widget-min-height", elH.toString());
      } else {
        el.style.setProperty("--comfy-widget-min-height", null);
      }
      const nw = node3.size[0];
      ({ cellWidth: w, cellHeight: h2 } = calculateImageGrid(
        currentImgs,
        nw - 20,
        elH
      ));
      w += "px";
      h2 += "px";
      el.style.setProperty("--comfy-img-preview-width", w);
      el.style.setProperty("--comfy-img-preview-height", h2);
    }
  }
  __name(updateSize, "updateSize");
  return {
    el,
    updateImages(imgs) {
      if (imgs !== currentImgs) {
        if (currentImgs == null) {
          requestAnimationFrame(() => {
            updateSize();
          });
        }
        el.replaceChildren(...imgs);
        currentImgs = imgs;
        node3.onResize(node3.size);
        node3.graph.setDirtyCanvas(true, true);
      }
    },
    getHeight() {
      updateSize();
    },
    onDraw() {
      el.style.pointerEvents = "all";
      const over = document.elementFromPoint(
        app$1.canvas.mouse[0],
        app$1.canvas.mouse[1]
      );
      el.style.pointerEvents = "none";
      if (!over) return;
      const idx = currentImgs.indexOf(over);
      node3.overIndex = idx;
    }
  };
}
__name(createImageHost, "createImageHost");
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.imagePreview = window.comfyAPI.imagePreview || {};
window.comfyAPI.imagePreview.calculateImageGrid = calculateImageGrid;
window.comfyAPI.imagePreview.createImageHost = createImageHost;
const useLitegraphService = /* @__PURE__ */ __name(() => {
  const extensionService = useExtensionService();
  const toastStore = useToastStore();
  async function registerNodeDef(nodeId, nodeData) {
    const node3 = class ComfyNode extends LGraphNode {
      static {
        __name(this, "ComfyNode");
      }
      static comfyClass = nodeData.name;
      // TODO: change to "title?" once litegraph.d.ts has been updated
      static title = nodeData.display_name || nodeData.name;
      static nodeData = nodeData;
      static category;
      constructor(title) {
        super(title);
        const requiredInputs = nodeData.input.required;
        let inputs = nodeData["input"]["required"];
        if (nodeData["input"]["optional"] != void 0) {
          inputs = Object.assign(
            {},
            nodeData["input"]["required"],
            nodeData["input"]["optional"]
          );
        }
        const config2 = { minWidth: 1, minHeight: 1 };
        for (const inputName in inputs) {
          const _inputData = inputs[inputName];
          const type = _inputData[0];
          const options4 = _inputData[1] ?? {};
          const inputData = [type, options4];
          const nameKey = `nodeDefs.${normalizeI18nKey(nodeData.name)}.inputs.${normalizeI18nKey(inputName)}.name`;
          const inputIsRequired = requiredInputs && inputName in requiredInputs;
          let widgetCreated = true;
          const widgetType = app$1.getWidgetType(inputData, inputName);
          if (widgetType) {
            if (widgetType === "COMBO") {
              Object.assign(
                config2,
                app$1.widgets.COMBO(this, inputName, inputData, app$1) || {}
              );
            } else {
              Object.assign(
                config2,
                app$1.widgets[widgetType](this, inputName, inputData, app$1) || {}
              );
            }
            if (config2.widget) {
              config2.widget.label = st(nameKey, inputName);
            }
          } else {
            const shapeOptions = inputIsRequired ? {} : { shape: LiteGraph.SlotShape.HollowCircle };
            const inputOptions = {
              ...shapeOptions,
              localized_name: st(nameKey, inputName)
            };
            this.addInput(inputName, type, inputOptions);
            widgetCreated = false;
          }
          if (widgetCreated && config2?.widget) {
            config2.widget.options ??= {};
            if (!inputIsRequired) {
              config2.widget.options.inputIsOptional = true;
            }
            if (inputData[1]?.forceInput) {
              config2.widget.options.forceInput = true;
            }
            if (inputData[1]?.defaultInput) {
              config2.widget.options.defaultInput = true;
            }
            if (inputData[1]?.advanced) {
              config2.widget.advanced = true;
            }
            if (inputData[1]?.hidden) {
              config2.widget.hidden = true;
            }
          }
        }
        for (const o in nodeData["output"]) {
          let output = nodeData["output"][o];
          if (output instanceof Array) output = "COMBO";
          const outputName = nodeData["output_name"][o] || output;
          const outputIsList = nodeData["output_is_list"][o];
          const shapeOptions = outputIsList ? { shape: LiteGraph.GRID_SHAPE } : {};
          const nameKey = `nodeDefs.${normalizeI18nKey(nodeData.name)}.outputs.${o}.name`;
          const typeKey = `dataTypes.${normalizeI18nKey(output)}`;
          const outputOptions = {
            ...shapeOptions,
            // If the output name is different from the output type, use the output name.
            // e.g.
            // - type ("INT"); name ("Positive") => translate name
            // - type ("FLOAT"); name ("FLOAT") => translate type
            localized_name: output !== outputName ? st(nameKey, outputName) : st(typeKey, outputName)
          };
          this.addOutput(outputName, output, outputOptions);
        }
        const s = this.computeSize();
        s[0] = Math.max(config2.minWidth, s[0] * 1.5);
        s[1] = Math.max(config2.minHeight, s[1]);
        this.size = s;
        this.serialize_widgets = true;
        extensionService.invokeExtensionsAsync("nodeCreated", this);
      }
      configure(data24) {
        const merge2 = /* @__PURE__ */ __name((current, incoming) => {
          const result = { ...incoming };
          if (current.widget === void 0 && incoming.widget !== void 0) {
            this.inputs.push(current);
            return incoming;
          }
          for (const key of ["name", "type", "shape", "localized_name"]) {
            if (current[key] !== void 0) {
              result[key] = current[key];
            }
          }
          return result;
        }, "merge");
        for (const field of ["inputs", "outputs"]) {
          const slots = data24[field] ?? [];
          data24[field] = slots.map(
            (slot, i2) => merge2(this[field][i2] ?? {}, slot)
          );
        }
        super.configure(data24);
      }
    };
    node3.prototype.comfyClass = nodeData.name;
    addNodeContextMenuHandler(node3);
    addDrawBackgroundHandler(node3);
    addNodeKeyHandler(node3);
    await extensionService.invokeExtensionsAsync(
      "beforeRegisterNodeDef",
      node3,
      nodeData
    );
    LiteGraph.registerNodeType(nodeId, node3);
    node3.category = nodeData.category;
  }
  __name(registerNodeDef, "registerNodeDef");
  function addNodeContextMenuHandler(node3) {
    function getCopyImageOption(img) {
      if (typeof window.ClipboardItem === "undefined") return [];
      return [
        {
          content: "Copy Image",
          // @ts-expect-error: async callback is not accepted by litegraph
          callback: /* @__PURE__ */ __name(async () => {
            const url = new URL(img.src);
            url.searchParams.delete("preview");
            const writeImage = /* @__PURE__ */ __name(async (blob) => {
              await navigator.clipboard.write([
                new ClipboardItem({
                  [blob.type]: blob
                })
              ]);
            }, "writeImage");
            try {
              const data24 = await fetch(url);
              const blob = await data24.blob();
              try {
                await writeImage(blob);
              } catch (error2) {
                if (blob.type !== "image/png") {
                  const canvas = $el("canvas", {
                    width: img.naturalWidth,
                    height: img.naturalHeight
                  });
                  const ctx = canvas.getContext("2d");
                  let image2;
                  if (typeof window.createImageBitmap === "undefined") {
                    image2 = new Image();
                    const p2 = new Promise((resolve2, reject3) => {
                      image2.onload = resolve2;
                      image2.onerror = reject3;
                    }).finally(() => {
                      URL.revokeObjectURL(image2.src);
                    });
                    image2.src = URL.createObjectURL(blob);
                    await p2;
                  } else {
                    image2 = await createImageBitmap(blob);
                  }
                  try {
                    ctx.drawImage(image2, 0, 0);
                    canvas.toBlob(writeImage, "image/png");
                  } finally {
                    if (typeof image2.close === "function") {
                      image2.close();
                    }
                  }
                  return;
                }
                throw error2;
              }
            } catch (error2) {
              toastStore.addAlert(
                "Error copying image: " + (error2.message ?? error2)
              );
            }
          }, "callback")
        }
      ];
    }
    __name(getCopyImageOption, "getCopyImageOption");
    node3.prototype.getExtraMenuOptions = function(_2, options4) {
      if (this.imgs) {
        let img;
        if (this.imageIndex != null) {
          img = this.imgs[this.imageIndex];
        } else if (this.overIndex != null) {
          img = this.imgs[this.overIndex];
        }
        if (img) {
          options4.unshift(
            {
              content: "Open Image",
              callback: /* @__PURE__ */ __name(() => {
                const url = new URL(img.src);
                url.searchParams.delete("preview");
                window.open(url, "_blank");
              }, "callback")
            },
            ...getCopyImageOption(img),
            {
              content: "Save Image",
              callback: /* @__PURE__ */ __name(() => {
                const a = document.createElement("a");
                const url = new URL(img.src);
                url.searchParams.delete("preview");
                a.href = url.toString();
                a.setAttribute(
                  "download",
                  new URLSearchParams(url.search).get("filename")
                );
                document.body.append(a);
                a.click();
                requestAnimationFrame(() => a.remove());
              }, "callback")
            }
          );
        }
      }
      options4.push({
        content: "Bypass",
        callback: /* @__PURE__ */ __name((obj) => {
          const mode2 = this.mode === LGraphEventMode.BYPASS ? LGraphEventMode.ALWAYS : LGraphEventMode.BYPASS;
          for (const item3 of app$1.canvas.selectedItems) {
            if (item3 instanceof LGraphNode) item3.mode = mode2;
          }
          this.graph.change();
        }, "callback")
      });
      if (!ComfyApp.clipspace_return_node) {
        options4.push({
          content: "Copy (Clipspace)",
          callback: /* @__PURE__ */ __name((obj) => {
            ComfyApp.copyToClipspace(this);
          }, "callback")
        });
        if (ComfyApp.clipspace != null) {
          options4.push({
            content: "Paste (Clipspace)",
            callback: /* @__PURE__ */ __name(() => {
              ComfyApp.pasteFromClipspace(this);
            }, "callback")
          });
        }
        if (ComfyApp.isImageNode(this)) {
          options4.push({
            content: "Open in MaskEditor",
            callback: /* @__PURE__ */ __name((obj) => {
              ComfyApp.copyToClipspace(this);
              ComfyApp.clipspace_return_node = this;
              ComfyApp.open_maskeditor();
            }, "callback")
          });
        }
      }
      return [];
    };
  }
  __name(addNodeContextMenuHandler, "addNodeContextMenuHandler");
  function addDrawBackgroundHandler(node3) {
    function getImageTop(node22) {
      let shiftY;
      if (node22.imageOffset != null) {
        return node22.imageOffset;
      } else if (node22.widgets?.length) {
        const w = node22.widgets[node22.widgets.length - 1];
        shiftY = w.last_y;
        if (w.computeSize) {
          shiftY += w.computeSize()[1] + 4;
        } else if (w.computedHeight) {
          shiftY += w.computedHeight;
        } else {
          shiftY += LiteGraph.NODE_WIDGET_HEIGHT + 4;
        }
      } else {
        return node22.computeSize()[1];
      }
      return shiftY;
    }
    __name(getImageTop, "getImageTop");
    node3.prototype.setSizeForImage = function(force) {
      if (!force && this.animatedImages) return;
      if (this.inputHeight || this.freeWidgetSpace > 210) {
        this.setSize(this.size);
        return;
      }
      const minHeight = getImageTop(this) + 220;
      if (this.size[1] < minHeight) {
        this.setSize([this.size[0], minHeight]);
      }
    };
    function unsafeDrawBackground(ctx) {
      if (this.flags.collapsed) return;
      const imgURLs = [];
      let imagesChanged = false;
      const output = app$1.nodeOutputs[this.id + ""];
      if (output?.images && this.images !== output.images) {
        this.animatedImages = output?.animated?.find(Boolean);
        this.images = output.images;
        imagesChanged = true;
        const preview22 = this.animatedImages ? "" : app$1.getPreviewFormatParam();
        for (const params of output.images) {
          const imgUrlPart = new URLSearchParams(params).toString();
          const rand2 = app$1.getRandParam();
          const imgUrl = api.apiURL(`/view?${imgUrlPart}${preview22}${rand2}`);
          imgURLs.push(imgUrl);
        }
      }
      const preview2 = app$1.nodePreviewImages[this.id + ""];
      if (this.preview !== preview2) {
        this.preview = preview2;
        imagesChanged = true;
        if (preview2 != null) {
          imgURLs.push(preview2);
        }
      }
      if (imagesChanged) {
        this.imageIndex = null;
        if (imgURLs.length > 0) {
          Promise.all(
            imgURLs.flat().map((src) => {
              return new Promise((r) => {
                const img = new Image();
                img.onload = () => r(img);
                img.onerror = () => r(null);
                img.src = src;
              });
            })
          ).then((imgs) => {
            if ((!output || this.images === output.images) && (!preview2 || this.preview === preview2)) {
              this.imgs = imgs.filter(Boolean);
              this.setSizeForImage?.();
              app$1.graph.setDirtyCanvas(true);
            }
          });
        } else {
          this.imgs = null;
        }
      }
      const is_all_same_aspect_ratio = /* @__PURE__ */ __name((imgs) => {
        const ratio = imgs[0].naturalWidth / imgs[0].naturalHeight;
        for (let i2 = 1; i2 < imgs.length; i2++) {
          const this_ratio = imgs[i2].naturalWidth / imgs[i2].naturalHeight;
          if (ratio != this_ratio) return false;
        }
        return true;
      }, "is_all_same_aspect_ratio");
      if (!this.imgs?.length) return;
      const widgetIdx = this.widgets?.findIndex(
        (w2) => w2.name === ANIM_PREVIEW_WIDGET
      );
      if (this.animatedImages) {
        if (widgetIdx > -1) {
          const widget2 = this.widgets[widgetIdx];
          widget2.options.host.updateImages(this.imgs);
        } else {
          const host = createImageHost(this);
          this.setSizeForImage(true);
          const widget2 = this.addDOMWidget(
            ANIM_PREVIEW_WIDGET,
            "img",
            host.el,
            {
              host,
              getHeight: host.getHeight,
              onDraw: host.onDraw,
              hideOnZoom: false
            }
          );
          widget2.serializeValue = () => void 0;
          widget2.options.host.updateImages(this.imgs);
        }
        return;
      }
      if (widgetIdx > -1) {
        this.widgets[widgetIdx].onRemove?.();
        this.widgets.splice(widgetIdx, 1);
      }
      const canvas = app$1.graph.list_of_graphcanvas[0];
      const mouse = canvas.graph_mouse;
      if (!canvas.pointer_is_down && this.pointerDown) {
        if (mouse[0] === this.pointerDown.pos[0] && mouse[1] === this.pointerDown.pos[1]) {
          this.imageIndex = this.pointerDown.index;
        }
        this.pointerDown = null;
      }
      let { imageIndex } = this;
      const numImages = this.imgs.length;
      if (numImages === 1 && !imageIndex) {
        this.imageIndex = imageIndex = 0;
      }
      const shiftY = getImageTop(this);
      const dw = this.size[0];
      const dh = this.size[1] - shiftY;
      if (imageIndex == null) {
        let cellWidth;
        let cellHeight;
        let shiftX;
        let cell_padding;
        let cols;
        const compact_mode = is_all_same_aspect_ratio(this.imgs);
        if (!compact_mode) {
          cell_padding = 2;
          const largestDimension = this.imgs.reduce(
            (acc, current) => Math.max(acc, current.naturalWidth, current.naturalHeight),
            0
          );
          const fakeImgs = [];
          fakeImgs.length = this.imgs.length;
          fakeImgs[0] = {
            naturalWidth: largestDimension,
            naturalHeight: largestDimension
          };
          ({ cellWidth, cellHeight, cols, shiftX } = calculateImageGrid(
            fakeImgs,
            dw,
            dh
          ));
        } else {
          cell_padding = 0;
          ({ cellWidth, cellHeight, cols, shiftX } = calculateImageGrid(
            this.imgs,
            dw,
            dh
          ));
        }
        let anyHovered = false;
        this.imageRects = [];
        for (let i2 = 0; i2 < numImages; i2++) {
          const img = this.imgs[i2];
          const row = Math.floor(i2 / cols);
          const col = i2 % cols;
          const x22 = col * cellWidth + shiftX;
          const y22 = row * cellHeight + shiftY;
          if (!anyHovered) {
            anyHovered = LiteGraph.isInsideRectangle(
              mouse[0],
              mouse[1],
              x22 + this.pos[0],
              y22 + this.pos[1],
              cellWidth,
              cellHeight
            );
            if (anyHovered) {
              this.overIndex = i2;
              let value4 = 110;
              if (canvas.pointer_is_down) {
                if (!this.pointerDown || this.pointerDown.index !== i2) {
                  this.pointerDown = { index: i2, pos: [...mouse] };
                }
                value4 = 125;
              }
              ctx.filter = `contrast(${value4}%) brightness(${value4}%)`;
              canvas.canvas.style.cursor = "pointer";
            }
          }
          this.imageRects.push([x22, y22, cellWidth, cellHeight]);
          const wratio = cellWidth / img.width;
          const hratio = cellHeight / img.height;
          const ratio = Math.min(wratio, hratio);
          const imgHeight = ratio * img.height;
          const imgY = row * cellHeight + shiftY + (cellHeight - imgHeight) / 2;
          const imgWidth = ratio * img.width;
          const imgX = col * cellWidth + shiftX + (cellWidth - imgWidth) / 2;
          ctx.drawImage(
            img,
            imgX + cell_padding,
            imgY + cell_padding,
            imgWidth - cell_padding * 2,
            imgHeight - cell_padding * 2
          );
          if (!compact_mode) {
            ctx.strokeStyle = "#8F8F8F";
            ctx.lineWidth = 1;
            ctx.strokeRect(
              x22 + cell_padding,
              y22 + cell_padding,
              cellWidth - cell_padding * 2,
              cellHeight - cell_padding * 2
            );
          }
          ctx.filter = "none";
        }
        if (!anyHovered) {
          this.pointerDown = null;
          this.overIndex = null;
        }
        return;
      }
      let w = this.imgs[imageIndex].naturalWidth;
      let h2 = this.imgs[imageIndex].naturalHeight;
      const scaleX = dw / w;
      const scaleY = dh / h2;
      const scale = Math.min(scaleX, scaleY, 1);
      w *= scale;
      h2 *= scale;
      const x2 = (dw - w) / 2;
      const y2 = (dh - h2) / 2 + shiftY;
      ctx.drawImage(this.imgs[imageIndex], x2, y2, w, h2);
      const drawButton = /* @__PURE__ */ __name((x22, y22, sz, text2) => {
        const hovered = LiteGraph.isInsideRectangle(
          mouse[0],
          mouse[1],
          x22 + this.pos[0],
          y22 + this.pos[1],
          sz,
          sz
        );
        let fill = "#333";
        let textFill = "#fff";
        let isClicking = false;
        if (hovered) {
          canvas.canvas.style.cursor = "pointer";
          if (canvas.pointer_is_down) {
            fill = "#1e90ff";
            isClicking = true;
          } else {
            fill = "#eee";
            textFill = "#000";
          }
        }
        ctx.fillStyle = fill;
        ctx.beginPath();
        ctx.roundRect(x22, y22, sz, sz, [4]);
        ctx.fill();
        ctx.fillStyle = textFill;
        ctx.font = "12px Arial";
        ctx.textAlign = "center";
        ctx.fillText(text2, x22 + 15, y22 + 20);
        return isClicking;
      }, "drawButton");
      if (!(numImages > 1)) return;
      const imageNum = this.imageIndex + 1;
      if (drawButton(dw - 40, dh + shiftY - 40, 30, `${imageNum}/${numImages}`)) {
        const i2 = imageNum >= numImages ? 0 : imageNum;
        if (!this.pointerDown || this.pointerDown.index !== i2) {
          this.pointerDown = { index: i2, pos: [...mouse] };
        }
      }
      if (drawButton(dw - 40, shiftY + 10, 30, `x`)) {
        if (!this.pointerDown || this.pointerDown.index !== null) {
          this.pointerDown = { index: null, pos: [...mouse] };
        }
      }
    }
    __name(unsafeDrawBackground, "unsafeDrawBackground");
    node3.prototype.onDrawBackground = function(ctx) {
      try {
        unsafeDrawBackground.call(this, ctx);
      } catch (error2) {
        console.error("Error drawing node background", error2);
      }
    };
  }
  __name(addDrawBackgroundHandler, "addDrawBackgroundHandler");
  function addNodeKeyHandler(node3) {
    const origNodeOnKeyDown = node3.prototype.onKeyDown;
    node3.prototype.onKeyDown = function(e2) {
      if (origNodeOnKeyDown && origNodeOnKeyDown.apply(this, e2) === false) {
        return false;
      }
      if (this.flags.collapsed || !this.imgs || this.imageIndex === null) {
        return;
      }
      let handled = false;
      if (e2.key === "ArrowLeft" || e2.key === "ArrowRight") {
        if (e2.key === "ArrowLeft") {
          this.imageIndex -= 1;
        } else if (e2.key === "ArrowRight") {
          this.imageIndex += 1;
        }
        this.imageIndex %= this.imgs.length;
        if (this.imageIndex < 0) {
          this.imageIndex = this.imgs.length + this.imageIndex;
        }
        handled = true;
      } else if (e2.key === "Escape") {
        this.imageIndex = null;
        handled = true;
      }
      if (handled === true) {
        e2.preventDefault();
        e2.stopImmediatePropagation();
        return false;
      }
    };
  }
  __name(addNodeKeyHandler, "addNodeKeyHandler");
  function addNodeOnGraph(nodeDef, options4 = {}) {
    options4.pos ??= getCanvasCenter();
    const node3 = LiteGraph.createNode(
      nodeDef.name,
      nodeDef.display_name,
      options4
    );
    app$1.graph.add(node3);
    return node3;
  }
  __name(addNodeOnGraph, "addNodeOnGraph");
  function getCanvasCenter() {
    const dpi = Math.max(window.devicePixelRatio ?? 1, 1);
    const [x2, y2, w, h2] = app$1.canvas.ds.visible_area;
    return [x2 + w / dpi / 2, y2 + h2 / dpi / 2];
  }
  __name(getCanvasCenter, "getCanvasCenter");
  function goToNode(nodeId) {
    const graphNode = app$1.graph.getNodeById(nodeId);
    if (!graphNode) return;
    app$1.canvas.animateToBounds(graphNode.boundingRect);
  }
  __name(goToNode, "goToNode");
  return {
    registerNodeDef,
    addNodeOnGraph,
    getCanvasCenter,
    goToNode
  };
}, "useLitegraphService");
const defaultGraph = {
  last_node_id: 9,
  last_link_id: 9,
  nodes: [
    {
      id: 7,
      type: "CLIPTextEncode",
      pos: [413, 389],
      size: [425.27801513671875, 180.6060791015625],
      flags: {},
      order: 3,
      mode: 0,
      inputs: [{ name: "clip", type: "CLIP", link: 5 }],
      outputs: [
        {
          name: "CONDITIONING",
          type: "CONDITIONING",
          links: [6],
          slot_index: 0
        }
      ],
      properties: {},
      widgets_values: ["text, watermark"]
    },
    {
      id: 6,
      type: "CLIPTextEncode",
      pos: [415, 186],
      size: [422.84503173828125, 164.31304931640625],
      flags: {},
      order: 2,
      mode: 0,
      inputs: [{ name: "clip", type: "CLIP", link: 3 }],
      outputs: [
        {
          name: "CONDITIONING",
          type: "CONDITIONING",
          links: [4],
          slot_index: 0
        }
      ],
      properties: {},
      widgets_values: [
        "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
      ]
    },
    {
      id: 5,
      type: "EmptyLatentImage",
      pos: [473, 609],
      size: [315, 106],
      flags: {},
      order: 1,
      mode: 0,
      outputs: [{ name: "LATENT", type: "LATENT", links: [2], slot_index: 0 }],
      properties: {},
      widgets_values: [512, 512, 1]
    },
    {
      id: 3,
      type: "KSampler",
      pos: [863, 186],
      size: [315, 262],
      flags: {},
      order: 4,
      mode: 0,
      inputs: [
        { name: "model", type: "MODEL", link: 1 },
        { name: "positive", type: "CONDITIONING", link: 4 },
        { name: "negative", type: "CONDITIONING", link: 6 },
        { name: "latent_image", type: "LATENT", link: 2 }
      ],
      outputs: [{ name: "LATENT", type: "LATENT", links: [7], slot_index: 0 }],
      properties: {},
      widgets_values: [156680208700286, true, 20, 8, "euler", "normal", 1]
    },
    {
      id: 8,
      type: "VAEDecode",
      pos: [1209, 188],
      size: [210, 46],
      flags: {},
      order: 5,
      mode: 0,
      inputs: [
        { name: "samples", type: "LATENT", link: 7 },
        { name: "vae", type: "VAE", link: 8 }
      ],
      outputs: [{ name: "IMAGE", type: "IMAGE", links: [9], slot_index: 0 }],
      properties: {}
    },
    {
      id: 9,
      type: "SaveImage",
      pos: [1451, 189],
      size: [210, 26],
      flags: {},
      order: 6,
      mode: 0,
      inputs: [{ name: "images", type: "IMAGE", link: 9 }],
      properties: {}
    },
    {
      id: 4,
      type: "CheckpointLoaderSimple",
      pos: [26, 474],
      size: [315, 98],
      flags: {},
      order: 0,
      mode: 0,
      outputs: [
        { name: "MODEL", type: "MODEL", links: [1], slot_index: 0 },
        { name: "CLIP", type: "CLIP", links: [3, 5], slot_index: 1 },
        { name: "VAE", type: "VAE", links: [8], slot_index: 2 }
      ],
      properties: {},
      widgets_values: ["v1-5-pruned-emaonly.ckpt"]
    }
  ],
  links: [
    [1, 4, 0, 3, 0, "MODEL"],
    [2, 5, 0, 3, 3, "LATENT"],
    [3, 4, 1, 6, 0, "CLIP"],
    [4, 6, 0, 3, 1, "CONDITIONING"],
    [5, 4, 1, 7, 0, "CLIP"],
    [6, 7, 0, 3, 2, "CONDITIONING"],
    [7, 3, 0, 8, 0, "LATENT"],
    [8, 4, 2, 8, 1, "VAE"],
    [9, 8, 0, 9, 0, "IMAGE"]
  ],
  groups: [],
  config: {},
  extra: {},
  version: 0.4
};
const defaultGraphJSON = JSON.stringify(defaultGraph);
const blankGraph = {
  last_node_id: 0,
  last_link_id: 0,
  nodes: [],
  links: [],
  groups: [],
  config: {},
  extra: {},
  version: 0.4
};
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.defaultGraph = window.comfyAPI.defaultGraph || {};
window.comfyAPI.defaultGraph.defaultGraph = defaultGraph;
window.comfyAPI.defaultGraph.defaultGraphJSON = defaultGraphJSON;
window.comfyAPI.defaultGraph.blankGraph = blankGraph;
const parts = {
  d: /* @__PURE__ */ __name((d) => d.getDate(), "d"),
  M: /* @__PURE__ */ __name((d) => d.getMonth() + 1, "M"),
  h: /* @__PURE__ */ __name((d) => d.getHours(), "h"),
  m: /* @__PURE__ */ __name((d) => d.getMinutes(), "m"),
  s: /* @__PURE__ */ __name((d) => d.getSeconds(), "s")
};
const format$1 = Object.keys(parts).map((k) => k + k + "?").join("|") + "|yyy?y?";
function formatDate(text2, date) {
  return text2.replace(new RegExp(format$1, "g"), (text22) => {
    if (text22 === "yy") return (date.getFullYear() + "").substring(2);
    if (text22 === "yyyy") return date.getFullYear().toString();
    if (text22[0] in parts) {
      const p2 = parts[text22[0]](date);
      return (p2 + "").padStart(text22.length, "0");
    }
    return text22;
  });
}
__name(formatDate, "formatDate");
function clone$3(obj) {
  try {
    if (typeof structuredClone !== "undefined") {
      return structuredClone(obj);
    }
  } catch (error2) {
  }
  return JSON.parse(JSON.stringify(obj));
}
__name(clone$3, "clone$3");
function applyTextReplacements(app2, value4) {
  return value4.replace(/%([^%]+)%/g, function(match2, text2) {
    const split2 = text2.split(".");
    if (split2.length !== 2) {
      if (split2[0].startsWith("date:")) {
        return formatDate(split2[0].substring(5), /* @__PURE__ */ new Date());
      }
      if (text2 !== "width" && text2 !== "height") {
        console.warn("Invalid replacement pattern", text2);
      }
      return match2;
    }
    let nodes = app2.graph.nodes.filter(
      (n) => n.properties?.["Node name for S&R"] === split2[0]
    );
    if (!nodes.length) {
      nodes = app2.graph.nodes.filter((n) => n.title === split2[0]);
    }
    if (!nodes.length) {
      console.warn("Unable to find node", split2[0]);
      return match2;
    }
    if (nodes.length > 1) {
      console.warn("Multiple nodes matched", split2[0], "using first match");
    }
    const node3 = nodes[0];
    const widget2 = node3.widgets?.find((w) => w.name === split2[1]);
    if (!widget2) {
      console.warn("Unable to find widget", split2[1], "on node", split2[0], node3);
      return match2;
    }
    return ((widget2.value ?? "") + "").replaceAll(/\/|\\/g, "_");
  });
}
__name(applyTextReplacements, "applyTextReplacements");
async function addStylesheet(urlOrFile, relativeTo) {
  return new Promise((res, rej) => {
    let url;
    if (urlOrFile.endsWith(".js")) {
      url = urlOrFile.substr(0, urlOrFile.length - 2) + "css";
    } else {
      url = new URL(
        urlOrFile,
        relativeTo ?? `${window.location.protocol}//${window.location.host}`
      ).toString();
    }
    $el("link", {
      parent: document.head,
      rel: "stylesheet",
      type: "text/css",
      href: url,
      onload: res,
      onerror: rej
    });
  });
}
__name(addStylesheet, "addStylesheet");
function downloadBlob(filename, blob) {
  const url = URL.createObjectURL(blob);
  const a = $el("a", {
    href: url,
    download: filename,
    style: { display: "none" },
    parent: document.body
  });
  a.click();
  setTimeout(function() {
    a.remove();
    window.URL.revokeObjectURL(url);
  }, 0);
}
__name(downloadBlob, "downloadBlob");
function uploadFile(accept3) {
  return new Promise((resolve2, reject3) => {
    const input = document.createElement("input");
    input.type = "file";
    input.accept = accept3;
    input.onchange = (e2) => {
      const file = e2.target.files?.[0];
      if (!file) return reject3(new Error("No file selected"));
      resolve2(file);
    };
    input.click();
  });
}
__name(uploadFile, "uploadFile");
function prop(target, name2, defaultValue, onChanged) {
  let currentValue;
  Object.defineProperty(target, name2, {
    get() {
      return currentValue;
    },
    set(newValue2) {
      const prevValue = currentValue;
      currentValue = newValue2;
      onChanged?.(currentValue, prevValue, target, name2);
    }
  });
  return defaultValue;
}
__name(prop, "prop");
function getStorageValue(id3) {
  const clientId = api.clientId ?? api.initialClientId;
  return (clientId && sessionStorage.getItem(`${id3}:${clientId}`)) ?? localStorage.getItem(id3);
}
__name(getStorageValue, "getStorageValue");
function setStorageValue(id3, value4) {
  const clientId = api.clientId ?? api.initialClientId;
  if (clientId) {
    sessionStorage.setItem(`${id3}:${clientId}`, value4);
  }
  localStorage.setItem(id3, value4);
}
__name(setStorageValue, "setStorageValue");
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.utils = window.comfyAPI.utils || {};
window.comfyAPI.utils.clone = clone$3;
window.comfyAPI.utils.applyTextReplacements = applyTextReplacements;
window.comfyAPI.utils.addStylesheet = addStylesheet;
window.comfyAPI.utils.downloadBlob = downloadBlob;
window.comfyAPI.utils.uploadFile = uploadFile;
window.comfyAPI.utils.prop = prop;
window.comfyAPI.utils.getStorageValue = getStorageValue;
window.comfyAPI.utils.setStorageValue = setStorageValue;
class Processor {
  static {
    __name(this, "Processor");
  }
  constructor(options4) {
    this.selfOptions = options4 || {};
    this.pipes = {};
  }
  options(options4) {
    if (options4) {
      this.selfOptions = options4;
    }
    return this.selfOptions;
  }
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  pipe(name2, pipeArg) {
    let pipe = pipeArg;
    if (typeof name2 === "string") {
      if (typeof pipe === "undefined") {
        return this.pipes[name2];
      } else {
        this.pipes[name2] = pipe;
      }
    }
    if (name2 && name2.name) {
      pipe = name2;
      if (pipe.processor === this) {
        return pipe;
      }
      this.pipes[pipe.name] = pipe;
    }
    pipe.processor = this;
    return pipe;
  }
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  process(input, pipe) {
    let context = input;
    context.options = this.options();
    let nextPipe = pipe || input.pipe || "default";
    let lastPipe;
    while (nextPipe) {
      if (typeof context.nextAfterChildren !== "undefined") {
        context.next = context.nextAfterChildren;
        context.nextAfterChildren = null;
      }
      if (typeof nextPipe === "string") {
        nextPipe = this.pipe(nextPipe);
      }
      nextPipe.process(context);
      lastPipe = nextPipe;
      nextPipe = null;
      if (context) {
        if (context.next) {
          context = context.next;
          nextPipe = context.pipe || lastPipe;
        }
      }
    }
    return context.hasResult ? context.result : void 0;
  }
}
class Pipe {
  static {
    __name(this, "Pipe");
  }
  constructor(name2) {
    this.name = name2;
    this.filters = [];
  }
  process(input) {
    if (!this.processor) {
      throw new Error("add this pipe to a processor before using it");
    }
    const debug = this.debug;
    const length = this.filters.length;
    const context = input;
    for (let index2 = 0; index2 < length; index2++) {
      const filter4 = this.filters[index2];
      if (debug) {
        this.log(`filter: ${filter4.filterName}`);
      }
      filter4(context);
      if (typeof context === "object" && context.exiting) {
        context.exiting = false;
        break;
      }
    }
    if (!context.next && this.resultCheck) {
      this.resultCheck(context);
    }
  }
  log(msg) {
    console.log(`[jsondiffpatch] ${this.name} pipe, ${msg}`);
  }
  append(...args) {
    this.filters.push(...args);
    return this;
  }
  prepend(...args) {
    this.filters.unshift(...args);
    return this;
  }
  indexOf(filterName) {
    if (!filterName) {
      throw new Error("a filter name is required");
    }
    for (let index2 = 0; index2 < this.filters.length; index2++) {
      const filter4 = this.filters[index2];
      if (filter4.filterName === filterName) {
        return index2;
      }
    }
    throw new Error(`filter not found: ${filterName}`);
  }
  list() {
    return this.filters.map((f) => f.filterName);
  }
  after(filterName, ...params) {
    const index2 = this.indexOf(filterName);
    this.filters.splice(index2 + 1, 0, ...params);
    return this;
  }
  before(filterName, ...params) {
    const index2 = this.indexOf(filterName);
    this.filters.splice(index2, 0, ...params);
    return this;
  }
  replace(filterName, ...params) {
    const index2 = this.indexOf(filterName);
    this.filters.splice(index2, 1, ...params);
    return this;
  }
  remove(filterName) {
    const index2 = this.indexOf(filterName);
    this.filters.splice(index2, 1);
    return this;
  }
  clear() {
    this.filters.length = 0;
    return this;
  }
  shouldHaveResult(should) {
    if (should === false) {
      this.resultCheck = null;
      return;
    }
    if (this.resultCheck) {
      return;
    }
    this.resultCheck = (context) => {
      if (!context.hasResult) {
        console.log(context);
        const error2 = new Error(`${this.name} failed`);
        error2.noResult = true;
        throw error2;
      }
    };
    return this;
  }
}
class Context {
  static {
    __name(this, "Context");
  }
  setResult(result) {
    this.result = result;
    this.hasResult = true;
    return this;
  }
  exit() {
    this.exiting = true;
    return this;
  }
  push(child, name2) {
    child.parent = this;
    if (typeof name2 !== "undefined") {
      child.childName = name2;
    }
    child.root = this.root || this;
    child.options = child.options || this.options;
    if (!this.children) {
      this.children = [child];
      this.nextAfterChildren = this.next || null;
      this.next = child;
    } else {
      this.children[this.children.length - 1].next = child;
      this.children.push(child);
    }
    child.next = this;
    return this;
  }
}
function cloneRegExp(re) {
  const regexMatch = /^\/(.*)\/([gimyu]*)$/.exec(re.toString());
  return new RegExp(regexMatch[1], regexMatch[2]);
}
__name(cloneRegExp, "cloneRegExp");
function clone$2(arg) {
  if (typeof arg !== "object") {
    return arg;
  }
  if (arg === null) {
    return null;
  }
  if (Array.isArray(arg)) {
    return arg.map(clone$2);
  }
  if (arg instanceof Date) {
    return new Date(arg.getTime());
  }
  if (arg instanceof RegExp) {
    return cloneRegExp(arg);
  }
  const cloned = {};
  for (const name2 in arg) {
    if (Object.prototype.hasOwnProperty.call(arg, name2)) {
      cloned[name2] = clone$2(arg[name2]);
    }
  }
  return cloned;
}
__name(clone$2, "clone$2");
class DiffContext extends Context {
  static {
    __name(this, "DiffContext");
  }
  constructor(left, right) {
    super();
    this.left = left;
    this.right = right;
    this.pipe = "diff";
  }
  setResult(result) {
    if (this.options.cloneDiffValues && typeof result === "object") {
      const clone2 = typeof this.options.cloneDiffValues === "function" ? this.options.cloneDiffValues : clone$2;
      if (typeof result[0] === "object") {
        result[0] = clone2(result[0]);
      }
      if (typeof result[1] === "object") {
        result[1] = clone2(result[1]);
      }
    }
    return super.setResult(result);
  }
}
class PatchContext extends Context {
  static {
    __name(this, "PatchContext");
  }
  constructor(left, delta2) {
    super();
    this.left = left;
    this.delta = delta2;
    this.pipe = "patch";
  }
}
class ReverseContext extends Context {
  static {
    __name(this, "ReverseContext");
  }
  constructor(delta2) {
    super();
    this.delta = delta2;
    this.pipe = "reverse";
  }
}
const diffFilter$3 = /* @__PURE__ */ __name(function trivialMatchesDiffFilter(context) {
  if (context.left === context.right) {
    context.setResult(void 0).exit();
    return;
  }
  if (typeof context.left === "undefined") {
    if (typeof context.right === "function") {
      throw new Error("functions are not supported");
    }
    context.setResult([context.right]).exit();
    return;
  }
  if (typeof context.right === "undefined") {
    context.setResult([context.left, 0, 0]).exit();
    return;
  }
  if (typeof context.left === "function" || typeof context.right === "function") {
    throw new Error("functions are not supported");
  }
  context.leftType = context.left === null ? "null" : typeof context.left;
  context.rightType = context.right === null ? "null" : typeof context.right;
  if (context.leftType !== context.rightType) {
    context.setResult([context.left, context.right]).exit();
    return;
  }
  if (context.leftType === "boolean" || context.leftType === "number") {
    context.setResult([context.left, context.right]).exit();
    return;
  }
  if (context.leftType === "object") {
    context.leftIsArray = Array.isArray(context.left);
  }
  if (context.rightType === "object") {
    context.rightIsArray = Array.isArray(context.right);
  }
  if (context.leftIsArray !== context.rightIsArray) {
    context.setResult([context.left, context.right]).exit();
    return;
  }
  if (context.left instanceof RegExp) {
    if (context.right instanceof RegExp) {
      context.setResult([context.left.toString(), context.right.toString()]).exit();
    } else {
      context.setResult([context.left, context.right]).exit();
    }
  }
}, "trivialMatchesDiffFilter");
diffFilter$3.filterName = "trivial";
const patchFilter$3 = /* @__PURE__ */ __name(function trivialMatchesPatchFilter(context) {
  if (typeof context.delta === "undefined") {
    context.setResult(context.left).exit();
    return;
  }
  context.nested = !Array.isArray(context.delta);
  if (context.nested) {
    return;
  }
  const nonNestedDelta = context.delta;
  if (nonNestedDelta.length === 1) {
    context.setResult(nonNestedDelta[0]).exit();
    return;
  }
  if (nonNestedDelta.length === 2) {
    if (context.left instanceof RegExp) {
      const regexArgs = /^\/(.*)\/([gimyu]+)$/.exec(nonNestedDelta[1]);
      if (regexArgs) {
        context.setResult(new RegExp(regexArgs[1], regexArgs[2])).exit();
        return;
      }
    }
    context.setResult(nonNestedDelta[1]).exit();
    return;
  }
  if (nonNestedDelta.length === 3 && nonNestedDelta[2] === 0) {
    context.setResult(void 0).exit();
  }
}, "trivialMatchesPatchFilter");
patchFilter$3.filterName = "trivial";
const reverseFilter$3 = /* @__PURE__ */ __name(function trivialReferseFilter(context) {
  if (typeof context.delta === "undefined") {
    context.setResult(context.delta).exit();
    return;
  }
  context.nested = !Array.isArray(context.delta);
  if (context.nested) {
    return;
  }
  const nonNestedDelta = context.delta;
  if (nonNestedDelta.length === 1) {
    context.setResult([nonNestedDelta[0], 0, 0]).exit();
    return;
  }
  if (nonNestedDelta.length === 2) {
    context.setResult([nonNestedDelta[1], nonNestedDelta[0]]).exit();
    return;
  }
  if (nonNestedDelta.length === 3 && nonNestedDelta[2] === 0) {
    context.setResult([nonNestedDelta[0]]).exit();
  }
}, "trivialReferseFilter");
reverseFilter$3.filterName = "trivial";
const collectChildrenDiffFilter = /* @__PURE__ */ __name((context) => {
  if (!context || !context.children) {
    return;
  }
  const length = context.children.length;
  let child;
  let result = context.result;
  for (let index2 = 0; index2 < length; index2++) {
    child = context.children[index2];
    if (typeof child.result === "undefined") {
      continue;
    }
    result = result || {};
    result[child.childName] = child.result;
  }
  if (result && context.leftIsArray) {
    result._t = "a";
  }
  context.setResult(result).exit();
}, "collectChildrenDiffFilter");
collectChildrenDiffFilter.filterName = "collectChildren";
const objectsDiffFilter = /* @__PURE__ */ __name((context) => {
  if (context.leftIsArray || context.leftType !== "object") {
    return;
  }
  const left = context.left;
  const right = context.right;
  let name2;
  let child;
  const propertyFilter = context.options.propertyFilter;
  for (name2 in left) {
    if (!Object.prototype.hasOwnProperty.call(left, name2)) {
      continue;
    }
    if (propertyFilter && !propertyFilter(name2, context)) {
      continue;
    }
    child = new DiffContext(left[name2], right[name2]);
    context.push(child, name2);
  }
  for (name2 in right) {
    if (!Object.prototype.hasOwnProperty.call(right, name2)) {
      continue;
    }
    if (propertyFilter && !propertyFilter(name2, context)) {
      continue;
    }
    if (typeof left[name2] === "undefined") {
      child = new DiffContext(void 0, right[name2]);
      context.push(child, name2);
    }
  }
  if (!context.children || context.children.length === 0) {
    context.setResult(void 0).exit();
    return;
  }
  context.exit();
}, "objectsDiffFilter");
objectsDiffFilter.filterName = "objects";
const patchFilter$2 = /* @__PURE__ */ __name(function nestedPatchFilter(context) {
  if (!context.nested) {
    return;
  }
  const nestedDelta = context.delta;
  if (nestedDelta._t) {
    return;
  }
  const objectDelta = nestedDelta;
  let name2;
  let child;
  for (name2 in objectDelta) {
    child = new PatchContext(context.left[name2], objectDelta[name2]);
    context.push(child, name2);
  }
  context.exit();
}, "nestedPatchFilter");
patchFilter$2.filterName = "objects";
const collectChildrenPatchFilter$1 = /* @__PURE__ */ __name(function collectChildrenPatchFilter2(context) {
  if (!context || !context.children) {
    return;
  }
  const deltaWithChildren = context.delta;
  if (deltaWithChildren._t) {
    return;
  }
  const object = context.left;
  const length = context.children.length;
  let child;
  for (let index2 = 0; index2 < length; index2++) {
    child = context.children[index2];
    const property = child.childName;
    if (Object.prototype.hasOwnProperty.call(context.left, property) && child.result === void 0) {
      delete object[property];
    } else if (object[property] !== child.result) {
      object[property] = child.result;
    }
  }
  context.setResult(object).exit();
}, "collectChildrenPatchFilter");
collectChildrenPatchFilter$1.filterName = "collectChildren";
const reverseFilter$2 = /* @__PURE__ */ __name(function nestedReverseFilter(context) {
  if (!context.nested) {
    return;
  }
  const nestedDelta = context.delta;
  if (nestedDelta._t) {
    return;
  }
  const objectDelta = context.delta;
  let name2;
  let child;
  for (name2 in objectDelta) {
    child = new ReverseContext(objectDelta[name2]);
    context.push(child, name2);
  }
  context.exit();
}, "nestedReverseFilter");
reverseFilter$2.filterName = "objects";
const collectChildrenReverseFilter$1 = /* @__PURE__ */ __name((context) => {
  if (!context || !context.children) {
    return;
  }
  const deltaWithChildren = context.delta;
  if (deltaWithChildren._t) {
    return;
  }
  const length = context.children.length;
  let child;
  const delta2 = {};
  for (let index2 = 0; index2 < length; index2++) {
    child = context.children[index2];
    const property = child.childName;
    if (delta2[property] !== child.result) {
      delta2[property] = child.result;
    }
  }
  context.setResult(delta2).exit();
}, "collectChildrenReverseFilter$1");
collectChildrenReverseFilter$1.filterName = "collectChildren";
const defaultMatch = /* @__PURE__ */ __name(function(array1, array2, index1, index2) {
  return array1[index1] === array2[index2];
}, "defaultMatch");
const lengthMatrix = /* @__PURE__ */ __name(function(array1, array2, match2, context) {
  const len1 = array1.length;
  const len2 = array2.length;
  let x2, y2;
  const matrix = new Array(len1 + 1);
  for (x2 = 0; x2 < len1 + 1; x2++) {
    matrix[x2] = new Array(len2 + 1);
    for (y2 = 0; y2 < len2 + 1; y2++) {
      matrix[x2][y2] = 0;
    }
  }
  matrix.match = match2;
  for (x2 = 1; x2 < len1 + 1; x2++) {
    for (y2 = 1; y2 < len2 + 1; y2++) {
      if (match2(array1, array2, x2 - 1, y2 - 1, context)) {
        matrix[x2][y2] = matrix[x2 - 1][y2 - 1] + 1;
      } else {
        matrix[x2][y2] = Math.max(matrix[x2 - 1][y2], matrix[x2][y2 - 1]);
      }
    }
  }
  return matrix;
}, "lengthMatrix");
const backtrack = /* @__PURE__ */ __name(function(matrix, array1, array2, context) {
  let index1 = array1.length;
  let index2 = array2.length;
  const subsequence = {
    sequence: [],
    indices1: [],
    indices2: []
  };
  while (index1 !== 0 && index2 !== 0) {
    const sameLetter = matrix.match(array1, array2, index1 - 1, index2 - 1, context);
    if (sameLetter) {
      subsequence.sequence.unshift(array1[index1 - 1]);
      subsequence.indices1.unshift(index1 - 1);
      subsequence.indices2.unshift(index2 - 1);
      --index1;
      --index2;
    } else {
      const valueAtMatrixAbove = matrix[index1][index2 - 1];
      const valueAtMatrixLeft = matrix[index1 - 1][index2];
      if (valueAtMatrixAbove > valueAtMatrixLeft) {
        --index2;
      } else {
        --index1;
      }
    }
  }
  return subsequence;
}, "backtrack");
const get$1 = /* @__PURE__ */ __name(function(array1, array2, match2, context) {
  const innerContext = context || {};
  const matrix = lengthMatrix(array1, array2, match2 || defaultMatch, innerContext);
  return backtrack(matrix, array1, array2, innerContext);
}, "get$1");
const lcs = {
  get: get$1
};
const ARRAY_MOVE = 3;
function arraysHaveMatchByRef(array1, array2, len1, len2) {
  for (let index1 = 0; index1 < len1; index1++) {
    const val1 = array1[index1];
    for (let index2 = 0; index2 < len2; index2++) {
      const val2 = array2[index2];
      if (index1 !== index2 && val1 === val2) {
        return true;
      }
    }
  }
}
__name(arraysHaveMatchByRef, "arraysHaveMatchByRef");
function matchItems(array1, array2, index1, index2, context) {
  const value1 = array1[index1];
  const value22 = array2[index2];
  if (value1 === value22) {
    return true;
  }
  if (typeof value1 !== "object" || typeof value22 !== "object") {
    return false;
  }
  const objectHash = context.objectHash;
  if (!objectHash) {
    return context.matchByPosition && index1 === index2;
  }
  context.hashCache1 = context.hashCache1 || [];
  let hash1 = context.hashCache1[index1];
  if (typeof hash1 === "undefined") {
    context.hashCache1[index1] = hash1 = objectHash(value1, index1);
  }
  if (typeof hash1 === "undefined") {
    return false;
  }
  context.hashCache2 = context.hashCache2 || [];
  let hash2 = context.hashCache2[index2];
  if (typeof hash2 === "undefined") {
    context.hashCache2[index2] = hash2 = objectHash(value22, index2);
  }
  if (typeof hash2 === "undefined") {
    return false;
  }
  return hash1 === hash2;
}
__name(matchItems, "matchItems");
const diffFilter$2 = /* @__PURE__ */ __name(function arraysDiffFilter(context) {
  if (!context.leftIsArray) {
    return;
  }
  const matchContext = {
    objectHash: context.options && context.options.objectHash,
    matchByPosition: context.options && context.options.matchByPosition
  };
  let commonHead = 0;
  let commonTail = 0;
  let index2;
  let index1;
  let index22;
  const array1 = context.left;
  const array2 = context.right;
  const len1 = array1.length;
  const len2 = array2.length;
  let child;
  if (len1 > 0 && len2 > 0 && !matchContext.objectHash && typeof matchContext.matchByPosition !== "boolean") {
    matchContext.matchByPosition = !arraysHaveMatchByRef(array1, array2, len1, len2);
  }
  while (commonHead < len1 && commonHead < len2 && matchItems(array1, array2, commonHead, commonHead, matchContext)) {
    index2 = commonHead;
    child = new DiffContext(array1[index2], array2[index2]);
    context.push(child, index2);
    commonHead++;
  }
  while (commonTail + commonHead < len1 && commonTail + commonHead < len2 && matchItems(array1, array2, len1 - 1 - commonTail, len2 - 1 - commonTail, matchContext)) {
    index1 = len1 - 1 - commonTail;
    index22 = len2 - 1 - commonTail;
    child = new DiffContext(array1[index1], array2[index22]);
    context.push(child, index22);
    commonTail++;
  }
  let result;
  if (commonHead + commonTail === len1) {
    if (len1 === len2) {
      context.setResult(void 0).exit();
      return;
    }
    result = result || {
      _t: "a"
    };
    for (index2 = commonHead; index2 < len2 - commonTail; index2++) {
      result[index2] = [array2[index2]];
    }
    context.setResult(result).exit();
    return;
  }
  if (commonHead + commonTail === len2) {
    result = result || {
      _t: "a"
    };
    for (index2 = commonHead; index2 < len1 - commonTail; index2++) {
      result[`_${index2}`] = [array1[index2], 0, 0];
    }
    context.setResult(result).exit();
    return;
  }
  delete matchContext.hashCache1;
  delete matchContext.hashCache2;
  const trimmed1 = array1.slice(commonHead, len1 - commonTail);
  const trimmed2 = array2.slice(commonHead, len2 - commonTail);
  const seq = lcs.get(trimmed1, trimmed2, matchItems, matchContext);
  const removedItems = [];
  result = result || {
    _t: "a"
  };
  for (index2 = commonHead; index2 < len1 - commonTail; index2++) {
    if (seq.indices1.indexOf(index2 - commonHead) < 0) {
      result[`_${index2}`] = [array1[index2], 0, 0];
      removedItems.push(index2);
    }
  }
  let detectMove = true;
  if (context.options && context.options.arrays && context.options.arrays.detectMove === false) {
    detectMove = false;
  }
  let includeValueOnMove = false;
  if (context.options && context.options.arrays && context.options.arrays.includeValueOnMove) {
    includeValueOnMove = true;
  }
  const removedItemsLength = removedItems.length;
  for (index2 = commonHead; index2 < len2 - commonTail; index2++) {
    const indexOnArray2 = seq.indices2.indexOf(index2 - commonHead);
    if (indexOnArray2 < 0) {
      let isMove = false;
      if (detectMove && removedItemsLength > 0) {
        for (let removeItemIndex1 = 0; removeItemIndex1 < removedItemsLength; removeItemIndex1++) {
          index1 = removedItems[removeItemIndex1];
          if (matchItems(trimmed1, trimmed2, index1 - commonHead, index2 - commonHead, matchContext)) {
            result[`_${index1}`].splice(1, 2, index2, ARRAY_MOVE);
            if (!includeValueOnMove) {
              result[`_${index1}`][0] = "";
            }
            index22 = index2;
            child = new DiffContext(array1[index1], array2[index22]);
            context.push(child, index22);
            removedItems.splice(removeItemIndex1, 1);
            isMove = true;
            break;
          }
        }
      }
      if (!isMove) {
        result[index2] = [array2[index2]];
      }
    } else {
      index1 = seq.indices1[indexOnArray2] + commonHead;
      index22 = seq.indices2[indexOnArray2] + commonHead;
      child = new DiffContext(array1[index1], array2[index22]);
      context.push(child, index22);
    }
  }
  context.setResult(result).exit();
}, "arraysDiffFilter");
diffFilter$2.filterName = "arrays";
const compare = {
  numerically(a, b) {
    return a - b;
  },
  numericallyBy(name2) {
    return (a, b) => a[name2] - b[name2];
  }
};
const patchFilter$1 = /* @__PURE__ */ __name(function nestedPatchFilter2(context) {
  if (!context.nested) {
    return;
  }
  const nestedDelta = context.delta;
  if (nestedDelta._t !== "a") {
    return;
  }
  let index2;
  let index1;
  const delta2 = nestedDelta;
  const array = context.left;
  let toRemove = [];
  let toInsert = [];
  const toModify = [];
  for (index2 in delta2) {
    if (index2 !== "_t") {
      if (index2[0] === "_") {
        const removedOrMovedIndex = index2;
        if (delta2[removedOrMovedIndex][2] === 0 || delta2[removedOrMovedIndex][2] === ARRAY_MOVE) {
          toRemove.push(parseInt(index2.slice(1), 10));
        } else {
          throw new Error(`only removal or move can be applied at original array indices, invalid diff type: ${delta2[removedOrMovedIndex][2]}`);
        }
      } else {
        const numberIndex = index2;
        if (delta2[numberIndex].length === 1) {
          toInsert.push({
            index: parseInt(numberIndex, 10),
            value: delta2[numberIndex][0]
          });
        } else {
          toModify.push({
            index: parseInt(numberIndex, 10),
            delta: delta2[numberIndex]
          });
        }
      }
    }
  }
  toRemove = toRemove.sort(compare.numerically);
  for (index2 = toRemove.length - 1; index2 >= 0; index2--) {
    index1 = toRemove[index2];
    const indexDiff = delta2[`_${index1}`];
    const removedValue = array.splice(index1, 1)[0];
    if (indexDiff[2] === ARRAY_MOVE) {
      toInsert.push({
        index: indexDiff[1],
        value: removedValue
      });
    }
  }
  toInsert = toInsert.sort(compare.numericallyBy("index"));
  const toInsertLength = toInsert.length;
  for (index2 = 0; index2 < toInsertLength; index2++) {
    const insertion = toInsert[index2];
    array.splice(insertion.index, 0, insertion.value);
  }
  const toModifyLength = toModify.length;
  let child;
  if (toModifyLength > 0) {
    for (index2 = 0; index2 < toModifyLength; index2++) {
      const modification = toModify[index2];
      child = new PatchContext(array[modification.index], modification.delta);
      context.push(child, modification.index);
    }
  }
  if (!context.children) {
    context.setResult(array).exit();
    return;
  }
  context.exit();
}, "nestedPatchFilter");
patchFilter$1.filterName = "arrays";
const collectChildrenPatchFilter = /* @__PURE__ */ __name(function collectChildrenPatchFilter3(context) {
  if (!context || !context.children) {
    return;
  }
  const deltaWithChildren = context.delta;
  if (deltaWithChildren._t !== "a") {
    return;
  }
  const array = context.left;
  const length = context.children.length;
  let child;
  for (let index2 = 0; index2 < length; index2++) {
    child = context.children[index2];
    const arrayIndex = child.childName;
    array[arrayIndex] = child.result;
  }
  context.setResult(array).exit();
}, "collectChildrenPatchFilter");
collectChildrenPatchFilter.filterName = "arraysCollectChildren";
const reverseFilter$1 = /* @__PURE__ */ __name(function arraysReverseFilter(context) {
  if (!context.nested) {
    const nonNestedDelta = context.delta;
    if (nonNestedDelta[2] === ARRAY_MOVE) {
      const arrayMoveDelta = nonNestedDelta;
      context.newName = `_${arrayMoveDelta[1]}`;
      context.setResult([
        arrayMoveDelta[0],
        parseInt(context.childName.substring(1), 10),
        ARRAY_MOVE
      ]).exit();
    }
    return;
  }
  const nestedDelta = context.delta;
  if (nestedDelta._t !== "a") {
    return;
  }
  const arrayDelta = nestedDelta;
  let name2;
  let child;
  for (name2 in arrayDelta) {
    if (name2 === "_t") {
      continue;
    }
    child = new ReverseContext(arrayDelta[name2]);
    context.push(child, name2);
  }
  context.exit();
}, "arraysReverseFilter");
reverseFilter$1.filterName = "arrays";
const reverseArrayDeltaIndex = /* @__PURE__ */ __name((delta2, index2, itemDelta) => {
  if (typeof index2 === "string" && index2[0] === "_") {
    return parseInt(index2.substring(1), 10);
  } else if (Array.isArray(itemDelta) && itemDelta[2] === 0) {
    return `_${index2}`;
  }
  let reverseIndex = +index2;
  for (const deltaIndex in delta2) {
    const deltaItem = delta2[deltaIndex];
    if (Array.isArray(deltaItem)) {
      if (deltaItem[2] === ARRAY_MOVE) {
        const moveFromIndex = parseInt(deltaIndex.substring(1), 10);
        const moveToIndex = deltaItem[1];
        if (moveToIndex === +index2) {
          return moveFromIndex;
        }
        if (moveFromIndex <= reverseIndex && moveToIndex > reverseIndex) {
          reverseIndex++;
        } else if (moveFromIndex >= reverseIndex && moveToIndex < reverseIndex) {
          reverseIndex--;
        }
      } else if (deltaItem[2] === 0) {
        const deleteIndex = parseInt(deltaIndex.substring(1), 10);
        if (deleteIndex <= reverseIndex) {
          reverseIndex++;
        }
      } else if (deltaItem.length === 1 && parseInt(deltaIndex, 10) <= reverseIndex) {
        reverseIndex--;
      }
    }
  }
  return reverseIndex;
}, "reverseArrayDeltaIndex");
const collectChildrenReverseFilter = /* @__PURE__ */ __name((context) => {
  if (!context || !context.children) {
    return;
  }
  const deltaWithChildren = context.delta;
  if (deltaWithChildren._t !== "a") {
    return;
  }
  const arrayDelta = deltaWithChildren;
  const length = context.children.length;
  let child;
  const delta2 = {
    _t: "a"
  };
  for (let index2 = 0; index2 < length; index2++) {
    child = context.children[index2];
    let name2 = child.newName;
    if (typeof name2 === "undefined") {
      name2 = reverseArrayDeltaIndex(arrayDelta, child.childName, child.result);
    }
    if (delta2[name2] !== child.result) {
      delta2[name2] = child.result;
    }
  }
  context.setResult(delta2).exit();
}, "collectChildrenReverseFilter");
collectChildrenReverseFilter.filterName = "arraysCollectChildren";
const diffFilter$1 = /* @__PURE__ */ __name(function datesDiffFilter(context) {
  if (context.left instanceof Date) {
    if (context.right instanceof Date) {
      if (context.left.getTime() !== context.right.getTime()) {
        context.setResult([context.left, context.right]);
      } else {
        context.setResult(void 0);
      }
    } else {
      context.setResult([context.left, context.right]);
    }
    context.exit();
  } else if (context.right instanceof Date) {
    context.setResult([context.left, context.right]).exit();
  }
}, "datesDiffFilter");
diffFilter$1.filterName = "dates";
const TEXT_DIFF = 2;
const DEFAULT_MIN_LENGTH = 60;
let cachedDiffPatch = null;
function getDiffMatchPatch(options4, required) {
  var _a2;
  if (!cachedDiffPatch) {
    let instance;
    if ((_a2 = options4 === null || options4 === void 0 ? void 0 : options4.textDiff) === null || _a2 === void 0 ? void 0 : _a2.diffMatchPatch) {
      instance = new options4.textDiff.diffMatchPatch();
    } else {
      if (!required) {
        return null;
      }
      const error2 = new Error("The diff-match-patch library was not provided. Pass the library in through the options or use the `jsondiffpatch/with-text-diffs` entry-point.");
      error2.diff_match_patch_not_found = true;
      throw error2;
    }
    cachedDiffPatch = {
      diff: /* @__PURE__ */ __name(function(txt1, txt2) {
        return instance.patch_toText(instance.patch_make(txt1, txt2));
      }, "diff"),
      patch: /* @__PURE__ */ __name(function(txt1, patch2) {
        const results = instance.patch_apply(instance.patch_fromText(patch2), txt1);
        for (let i2 = 0; i2 < results[1].length; i2++) {
          if (!results[1][i2]) {
            const error2 = new Error("text patch failed");
            error2.textPatchFailed = true;
          }
        }
        return results[0];
      }, "patch")
    };
  }
  return cachedDiffPatch;
}
__name(getDiffMatchPatch, "getDiffMatchPatch");
const diffFilter = /* @__PURE__ */ __name(function textsDiffFilter(context) {
  if (context.leftType !== "string") {
    return;
  }
  const left = context.left;
  const right = context.right;
  const minLength = context.options && context.options.textDiff && context.options.textDiff.minLength || DEFAULT_MIN_LENGTH;
  if (left.length < minLength || right.length < minLength) {
    context.setResult([left, right]).exit();
    return;
  }
  const diffMatchPatch = getDiffMatchPatch(context.options);
  if (!diffMatchPatch) {
    context.setResult([left, right]).exit();
    return;
  }
  const diff2 = diffMatchPatch.diff;
  context.setResult([diff2(left, right), 0, TEXT_DIFF]).exit();
}, "textsDiffFilter");
diffFilter.filterName = "texts";
const patchFilter = /* @__PURE__ */ __name(function textsPatchFilter(context) {
  if (context.nested) {
    return;
  }
  const nonNestedDelta = context.delta;
  if (nonNestedDelta[2] !== TEXT_DIFF) {
    return;
  }
  const textDiffDelta = nonNestedDelta;
  const patch2 = getDiffMatchPatch(context.options, true).patch;
  context.setResult(patch2(context.left, textDiffDelta[0])).exit();
}, "textsPatchFilter");
patchFilter.filterName = "texts";
const textDeltaReverse = /* @__PURE__ */ __name(function(delta2) {
  let i2;
  let l;
  let line;
  let lineTmp;
  let header3 = null;
  const headerRegex = /^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;
  let lineHeader;
  const lines = delta2.split("\n");
  for (i2 = 0, l = lines.length; i2 < l; i2++) {
    line = lines[i2];
    const lineStart = line.slice(0, 1);
    if (lineStart === "@") {
      header3 = headerRegex.exec(line);
      lineHeader = i2;
      lines[lineHeader] = "@@ -" + header3[3] + "," + header3[4] + " +" + header3[1] + "," + header3[2] + " @@";
    } else if (lineStart === "+") {
      lines[i2] = "-" + lines[i2].slice(1);
      if (lines[i2 - 1].slice(0, 1) === "+") {
        lineTmp = lines[i2];
        lines[i2] = lines[i2 - 1];
        lines[i2 - 1] = lineTmp;
      }
    } else if (lineStart === "-") {
      lines[i2] = "+" + lines[i2].slice(1);
    }
  }
  return lines.join("\n");
}, "textDeltaReverse");
const reverseFilter = /* @__PURE__ */ __name(function textsReverseFilter(context) {
  if (context.nested) {
    return;
  }
  const nonNestedDelta = context.delta;
  if (nonNestedDelta[2] !== TEXT_DIFF) {
    return;
  }
  const textDiffDelta = nonNestedDelta;
  context.setResult([textDeltaReverse(textDiffDelta[0]), 0, TEXT_DIFF]).exit();
}, "textsReverseFilter");
reverseFilter.filterName = "texts";
class DiffPatcher {
  static {
    __name(this, "DiffPatcher");
  }
  constructor(options4) {
    this.processor = new Processor(options4);
    this.processor.pipe(new Pipe("diff").append(collectChildrenDiffFilter, diffFilter$3, diffFilter$1, diffFilter, objectsDiffFilter, diffFilter$2).shouldHaveResult());
    this.processor.pipe(new Pipe("patch").append(collectChildrenPatchFilter$1, collectChildrenPatchFilter, patchFilter$3, patchFilter, patchFilter$2, patchFilter$1).shouldHaveResult());
    this.processor.pipe(new Pipe("reverse").append(collectChildrenReverseFilter$1, collectChildrenReverseFilter, reverseFilter$3, reverseFilter, reverseFilter$2, reverseFilter$1).shouldHaveResult());
  }
  options(options4) {
    return this.processor.options(options4);
  }
  diff(left, right) {
    return this.processor.process(new DiffContext(left, right));
  }
  patch(left, delta2) {
    return this.processor.process(new PatchContext(left, delta2));
  }
  reverse(delta2) {
    return this.processor.process(new ReverseContext(delta2));
  }
  unpatch(right, delta2) {
    return this.patch(right, this.reverse(delta2));
  }
  clone(value4) {
    return clone$2(value4);
  }
}
function dateReviver(key, value4) {
  let parts2;
  if (typeof value4 === "string") {
    parts2 = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d*))?(Z|([+-])(\d{2}):(\d{2}))$/.exec(value4);
    if (parts2) {
      return new Date(Date.UTC(+parts2[1], +parts2[2] - 1, +parts2[3], +parts2[4], +parts2[5], +parts2[6], +(parts2[7] || 0)));
    }
  }
  return value4;
}
__name(dateReviver, "dateReviver");
function create(options4) {
  return new DiffPatcher(options4);
}
__name(create, "create");
let defaultInstance;
function diff(left, right) {
  if (!defaultInstance) {
    defaultInstance = new DiffPatcher();
  }
  return defaultInstance.diff(left, right);
}
__name(diff, "diff");
function patch(left, delta2) {
  if (!defaultInstance) {
    defaultInstance = new DiffPatcher();
  }
  return defaultInstance.patch(left, delta2);
}
__name(patch, "patch");
function unpatch(right, delta2) {
  if (!defaultInstance) {
    defaultInstance = new DiffPatcher();
  }
  return defaultInstance.unpatch(right, delta2);
}
__name(unpatch, "unpatch");
function reverse(delta2) {
  if (!defaultInstance) {
    defaultInstance = new DiffPatcher();
  }
  return defaultInstance.reverse(delta2);
}
__name(reverse, "reverse");
function clone$1(value4) {
  if (!defaultInstance) {
    defaultInstance = new DiffPatcher();
  }
  return defaultInstance.clone(value4);
}
__name(clone$1, "clone$1");
var loglevel$1 = { exports: {} };
var loglevel = loglevel$1.exports;
(function(module) {
  (function(root24, definition) {
    "use strict";
    if (false) {
      (void 0)(definition);
    } else if (module.exports) {
      module.exports = definition();
    } else {
      root24.log = definition();
    }
  })(commonjsGlobal, function() {
    "use strict";
    var noop2 = /* @__PURE__ */ __name(function() {
    }, "noop");
    var undefinedType2 = "undefined";
    var isIE = typeof window !== undefinedType2 && typeof window.navigator !== undefinedType2 && /Trident\/|MSIE /.test(window.navigator.userAgent);
    var logMethods = [
      "trace",
      "debug",
      "info",
      "warn",
      "error"
    ];
    var _loggersByName = {};
    var defaultLogger = null;
    function bindMethod(obj, methodName) {
      var method = obj[methodName];
      if (typeof method.bind === "function") {
        return method.bind(obj);
      } else {
        try {
          return Function.prototype.bind.call(method, obj);
        } catch (e2) {
          return function() {
            return Function.prototype.apply.apply(method, [obj, arguments]);
          };
        }
      }
    }
    __name(bindMethod, "bindMethod");
    function traceForIE() {
      if (console.log) {
        if (console.log.apply) {
          console.log.apply(console, arguments);
        } else {
          Function.prototype.apply.apply(console.log, [console, arguments]);
        }
      }
      if (console.trace) console.trace();
    }
    __name(traceForIE, "traceForIE");
    function realMethod(methodName) {
      if (methodName === "debug") {
        methodName = "log";
      }
      if (typeof console === undefinedType2) {
        return false;
      } else if (methodName === "trace" && isIE) {
        return traceForIE;
      } else if (console[methodName] !== void 0) {
        return bindMethod(console, methodName);
      } else if (console.log !== void 0) {
        return bindMethod(console, "log");
      } else {
        return noop2;
      }
    }
    __name(realMethod, "realMethod");
    function replaceLoggingMethods() {
      var level = this.getLevel();
      for (var i2 = 0; i2 < logMethods.length; i2++) {
        var methodName = logMethods[i2];
        this[methodName] = i2 < level ? noop2 : this.methodFactory(methodName, level, this.name);
      }
      this.log = this.debug;
      if (typeof console === undefinedType2 && level < this.levels.SILENT) {
        return "No console available for logging";
      }
    }
    __name(replaceLoggingMethods, "replaceLoggingMethods");
    function enableLoggingWhenConsoleArrives(methodName) {
      return function() {
        if (typeof console !== undefinedType2) {
          replaceLoggingMethods.call(this);
          this[methodName].apply(this, arguments);
        }
      };
    }
    __name(enableLoggingWhenConsoleArrives, "enableLoggingWhenConsoleArrives");
    function defaultMethodFactory(methodName, _level, _loggerName) {
      return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
    }
    __name(defaultMethodFactory, "defaultMethodFactory");
    function Logger(name2, factory) {
      var self2 = this;
      var inheritedLevel;
      var defaultLevel;
      var userLevel;
      var storageKey = "loglevel";
      if (typeof name2 === "string") {
        storageKey += ":" + name2;
      } else if (typeof name2 === "symbol") {
        storageKey = void 0;
      }
      function persistLevelIfPossible(levelNum) {
        var levelName = (logMethods[levelNum] || "silent").toUpperCase();
        if (typeof window === undefinedType2 || !storageKey) return;
        try {
          window.localStorage[storageKey] = levelName;
          return;
        } catch (ignore) {
        }
        try {
          window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
        } catch (ignore) {
        }
      }
      __name(persistLevelIfPossible, "persistLevelIfPossible");
      function getPersistedLevel() {
        var storedLevel;
        if (typeof window === undefinedType2 || !storageKey) return;
        try {
          storedLevel = window.localStorage[storageKey];
        } catch (ignore) {
        }
        if (typeof storedLevel === undefinedType2) {
          try {
            var cookie = window.document.cookie;
            var cookieName = encodeURIComponent(storageKey);
            var location2 = cookie.indexOf(cookieName + "=");
            if (location2 !== -1) {
              storedLevel = /^([^;]+)/.exec(
                cookie.slice(location2 + cookieName.length + 1)
              )[1];
            }
          } catch (ignore) {
          }
        }
        if (self2.levels[storedLevel] === void 0) {
          storedLevel = void 0;
        }
        return storedLevel;
      }
      __name(getPersistedLevel, "getPersistedLevel");
      function clearPersistedLevel() {
        if (typeof window === undefinedType2 || !storageKey) return;
        try {
          window.localStorage.removeItem(storageKey);
        } catch (ignore) {
        }
        try {
          window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
        } catch (ignore) {
        }
      }
      __name(clearPersistedLevel, "clearPersistedLevel");
      function normalizeLevel(input) {
        var level = input;
        if (typeof level === "string" && self2.levels[level.toUpperCase()] !== void 0) {
          level = self2.levels[level.toUpperCase()];
        }
        if (typeof level === "number" && level >= 0 && level <= self2.levels.SILENT) {
          return level;
        } else {
          throw new TypeError("log.setLevel() called with invalid level: " + input);
        }
      }
      __name(normalizeLevel, "normalizeLevel");
      self2.name = name2;
      self2.levels = {
        "TRACE": 0,
        "DEBUG": 1,
        "INFO": 2,
        "WARN": 3,
        "ERROR": 4,
        "SILENT": 5
      };
      self2.methodFactory = factory || defaultMethodFactory;
      self2.getLevel = function() {
        if (userLevel != null) {
          return userLevel;
        } else if (defaultLevel != null) {
          return defaultLevel;
        } else {
          return inheritedLevel;
        }
      };
      self2.setLevel = function(level, persist) {
        userLevel = normalizeLevel(level);
        if (persist !== false) {
          persistLevelIfPossible(userLevel);
        }
        return replaceLoggingMethods.call(self2);
      };
      self2.setDefaultLevel = function(level) {
        defaultLevel = normalizeLevel(level);
        if (!getPersistedLevel()) {
          self2.setLevel(level, false);
        }
      };
      self2.resetLevel = function() {
        userLevel = null;
        clearPersistedLevel();
        replaceLoggingMethods.call(self2);
      };
      self2.enableAll = function(persist) {
        self2.setLevel(self2.levels.TRACE, persist);
      };
      self2.disableAll = function(persist) {
        self2.setLevel(self2.levels.SILENT, persist);
      };
      self2.rebuild = function() {
        if (defaultLogger !== self2) {
          inheritedLevel = normalizeLevel(defaultLogger.getLevel());
        }
        replaceLoggingMethods.call(self2);
        if (defaultLogger === self2) {
          for (var childName in _loggersByName) {
            _loggersByName[childName].rebuild();
          }
        }
      };
      inheritedLevel = normalizeLevel(
        defaultLogger ? defaultLogger.getLevel() : "WARN"
      );
      var initialLevel = getPersistedLevel();
      if (initialLevel != null) {
        userLevel = normalizeLevel(initialLevel);
      }
      replaceLoggingMethods.call(self2);
    }
    __name(Logger, "Logger");
    defaultLogger = new Logger();
    defaultLogger.getLogger = /* @__PURE__ */ __name(function getLogger(name2) {
      if (typeof name2 !== "symbol" && typeof name2 !== "string" || name2 === "") {
        throw new TypeError("You must supply a name when creating a logger.");
      }
      var logger2 = _loggersByName[name2];
      if (!logger2) {
        logger2 = _loggersByName[name2] = new Logger(
          name2,
          defaultLogger.methodFactory
        );
      }
      return logger2;
    }, "getLogger");
    var _log = typeof window !== undefinedType2 ? window.log : void 0;
    defaultLogger.noConflict = function() {
      if (typeof window !== undefinedType2 && window.log === defaultLogger) {
        window.log = _log;
      }
      return defaultLogger;
    };
    defaultLogger.getLoggers = /* @__PURE__ */ __name(function getLoggers() {
      return _loggersByName;
    }, "getLoggers");
    defaultLogger["default"] = defaultLogger;
    return defaultLogger;
  });
})(loglevel$1);
var loglevelExports = loglevel$1.exports;
const log = /* @__PURE__ */ getDefaultExportFromCjs(loglevelExports);
function clone(obj) {
  return JSON.parse(JSON.stringify(obj));
}
__name(clone, "clone");
const logger = log.getLogger("ChangeTracker");
logger.setLevel("info");
class ChangeTracker {
  static {
    __name(this, "ChangeTracker");
  }
  constructor(workflow, initialState) {
    this.workflow = workflow;
    this.initialState = initialState;
    this.activeState = initialState;
  }
  static MAX_HISTORY = 50;
  /**
   * The active state of the workflow.
   */
  activeState;
  undoQueue = [];
  redoQueue = [];
  changeCount = 0;
  /**
   * Whether the redo/undo restoring is in progress.
   */
  restoringState = false;
  ds;
  nodeOutputs;
  static app;
  get app() {
    return ChangeTracker.app;
  }
  /**
   * Save the current state as the initial state.
   */
  reset(state) {
    if (this.restoringState) return;
    logger.debug("Reset State");
    if (state) this.activeState = clone(state);
    this.initialState = clone(this.activeState);
  }
  store() {
    this.ds = {
      scale: this.app.canvas.ds.scale,
      offset: [this.app.canvas.ds.offset[0], this.app.canvas.ds.offset[1]]
    };
  }
  restore() {
    if (this.ds) {
      this.app.canvas.ds.scale = this.ds.scale;
      this.app.canvas.ds.offset = this.ds.offset;
    }
    if (this.nodeOutputs) {
      this.app.nodeOutputs = this.nodeOutputs;
    }
  }
  updateModified() {
    api.dispatchCustomEvent("graphChanged", this.activeState);
    const workflow = useWorkflowStore().getWorkflowByPath(this.workflow.path);
    if (workflow) {
      workflow.isModified = !ChangeTracker.graphEqual(
        this.initialState,
        this.activeState
      );
      if (logger.getLevel() <= logger.levels.DEBUG && workflow.isModified) {
        const diff2 = ChangeTracker.graphDiff(
          this.initialState,
          this.activeState
        );
        logger.debug("Graph diff:", diff2);
      }
    }
  }
  checkState() {
    if (!this.app.graph || this.changeCount) return;
    const currentState = clone(this.app.graph.serialize());
    if (!this.activeState) {
      this.activeState = currentState;
      return;
    }
    if (!ChangeTracker.graphEqual(this.activeState, currentState)) {
      this.undoQueue.push(this.activeState);
      if (this.undoQueue.length > ChangeTracker.MAX_HISTORY) {
        this.undoQueue.shift();
      }
      logger.debug("Diff detected. Undo queue length:", this.undoQueue.length);
      this.activeState = currentState;
      this.redoQueue.length = 0;
      this.updateModified();
    }
  }
  async updateState(source, target) {
    const prevState = source.pop();
    if (prevState) {
      target.push(this.activeState);
      this.restoringState = true;
      try {
        await this.app.loadGraphData(prevState, false, false, this.workflow, {
          showMissingModelsDialog: false,
          showMissingNodesDialog: false
        });
        this.activeState = prevState;
        this.updateModified();
      } finally {
        this.restoringState = false;
      }
    }
  }
  async undo() {
    await this.updateState(this.undoQueue, this.redoQueue);
    logger.debug(
      "Undo. Undo queue length:",
      this.undoQueue.length,
      "Redo queue length:",
      this.redoQueue.length
    );
  }
  async redo() {
    await this.updateState(this.redoQueue, this.undoQueue);
    logger.debug(
      "Redo. Undo queue length:",
      this.undoQueue.length,
      "Redo queue length:",
      this.redoQueue.length
    );
  }
  async undoRedo(e2) {
    if ((e2.ctrlKey || e2.metaKey) && !e2.altKey) {
      const key = e2.key.toUpperCase();
      if (key === "Y" && !e2.shiftKey || key == "Z" && e2.shiftKey) {
        await this.redo();
        return true;
      } else if (key === "Z" && !e2.shiftKey) {
        await this.undo();
        return true;
      }
    }
  }
  beforeChange() {
    this.changeCount++;
  }
  afterChange() {
    if (!--this.changeCount) {
      this.checkState();
    }
  }
  static init(app2) {
    const getCurrentChangeTracker = /* @__PURE__ */ __name(() => useWorkflowStore().activeWorkflow?.changeTracker, "getCurrentChangeTracker");
    const checkState = /* @__PURE__ */ __name(() => getCurrentChangeTracker()?.checkState(), "checkState");
    ChangeTracker.app = app2;
    let keyIgnored = false;
    window.addEventListener(
      "keydown",
      (e2) => {
        if (e2.repeat) return;
        const activeEl = document.activeElement;
        requestAnimationFrame(async () => {
          let bindInputEl = null;
          if (!app2.ui.autoQueueEnabled || app2.ui.autoQueueMode === "instant") {
            if (activeEl?.tagName === "INPUT" || activeEl && "type" in activeEl && activeEl.type === "textarea") {
              return;
            }
            bindInputEl = activeEl;
          }
          keyIgnored = e2.key === "Control" || e2.key === "Shift" || e2.key === "Alt" || e2.key === "Meta";
          if (keyIgnored) return;
          const changeTracker = getCurrentChangeTracker();
          if (!changeTracker) return;
          if (await changeTracker.undoRedo(e2)) return;
          if (ChangeTracker.bindInput(app2, bindInputEl)) return;
          logger.debug("checkState on keydown");
          changeTracker.checkState();
        });
      },
      true
    );
    window.addEventListener("keyup", (e2) => {
      if (keyIgnored) {
        keyIgnored = false;
        logger.debug("checkState on keyup");
        checkState();
      }
    });
    window.addEventListener("mouseup", () => {
      logger.debug("checkState on mouseup");
      checkState();
    });
    api.addEventListener("promptQueued", () => {
      logger.debug("checkState on promptQueued");
      checkState();
    });
    api.addEventListener("graphCleared", () => {
      logger.debug("checkState on graphCleared");
      checkState();
    });
    const processMouseUp = LGraphCanvas.prototype.processMouseUp;
    LGraphCanvas.prototype.processMouseUp = function(e2) {
      const v2 = processMouseUp.apply(this, [e2]);
      logger.debug("checkState on processMouseUp");
      checkState();
      return v2;
    };
    const processMouseDown = LGraphCanvas.prototype.processMouseDown;
    LGraphCanvas.prototype.processMouseDown = function(e2) {
      const v2 = processMouseDown.apply(this, [e2]);
      logger.debug("checkState on processMouseDown");
      checkState();
      return v2;
    };
    const prompt = LGraphCanvas.prototype.prompt;
    LGraphCanvas.prototype.prompt = function(title, value4, callback, event) {
      const extendedCallback = /* @__PURE__ */ __name((v2) => {
        callback(v2);
        checkState();
      }, "extendedCallback");
      logger.debug("checkState on prompt");
      return prompt.apply(this, [title, value4, extendedCallback, event]);
    };
    const close5 = LiteGraph.ContextMenu.prototype.close;
    LiteGraph.ContextMenu.prototype.close = function(e2) {
      const v2 = close5.apply(this, [e2]);
      logger.debug("checkState on contextMenuClose");
      checkState();
      return v2;
    };
    const onNodeAdded = LiteGraph.LGraph.prototype.onNodeAdded;
    LiteGraph.LGraph.prototype.onNodeAdded = function(node3) {
      const v2 = onNodeAdded?.apply(this, [node3]);
      if (!app2?.configuringGraph) {
        logger.debug("checkState on onNodeAdded");
        checkState();
      }
      return v2;
    };
    document.addEventListener("litegraph:canvas", (e2) => {
      const detail = e2.detail;
      if (detail.subType === "before-change") {
        getCurrentChangeTracker()?.beforeChange();
      } else if (detail.subType === "after-change") {
        getCurrentChangeTracker()?.afterChange();
      }
    });
    api.addEventListener("executed", (e2) => {
      const detail = e2.detail;
      const workflow = useExecutionStore().queuedPrompts[detail.prompt_id]?.workflow;
      const changeTracker = workflow?.changeTracker;
      if (!changeTracker) return;
      changeTracker.nodeOutputs ??= {};
      const nodeOutputs = changeTracker.nodeOutputs;
      const output = nodeOutputs[detail.node];
      if (detail.merge && output) {
        for (const k in detail.output ?? {}) {
          const v2 = output[k];
          if (v2 instanceof Array) {
            output[k] = v2.concat(detail.output[k]);
          } else {
            output[k] = detail.output[k];
          }
        }
      } else {
        nodeOutputs[detail.node] = detail.output;
      }
    });
  }
  static bindInput(app2, activeEl) {
    if (!activeEl || activeEl.tagName === "CANVAS" || activeEl.tagName === "BODY") {
      return false;
    }
    for (const evt of ["change", "input", "blur"]) {
      const htmlElement = activeEl;
      if (`on${evt}` in htmlElement) {
        const listener = /* @__PURE__ */ __name(() => {
          useWorkflowStore().activeWorkflow?.changeTracker?.checkState?.();
          htmlElement.removeEventListener(evt, listener);
        }, "listener");
        htmlElement.addEventListener(evt, listener);
        return true;
      }
    }
    return false;
  }
  static graphEqual(a, b) {
    if (a === b) return true;
    if (typeof a == "object" && a && typeof b == "object" && b) {
      if (!_.isEqualWith(a.nodes, b.nodes, (arrA, arrB) => {
        if (Array.isArray(arrA) && Array.isArray(arrB)) {
          return _.isEqual(new Set(arrA), new Set(arrB));
        }
      })) {
        return false;
      }
      if (!_.isEqual(_.omit(a.extra ?? {}, ["ds"]), _.omit(b.extra ?? {}, ["ds"])))
        return false;
      for (const key of ["links", "reroutes", "groups"]) {
        if (!_.isEqual(a[key], b[key])) {
          return false;
        }
      }
      return true;
    }
    return false;
  }
  static graphDiff(a, b) {
    function sortGraphNodes(graph) {
      return {
        links: graph.links,
        groups: graph.groups,
        nodes: graph.nodes.sort((a2, b2) => {
          if (typeof a2.id === "number" && typeof b2.id === "number") {
            return a2.id - b2.id;
          }
          return 0;
        })
      };
    }
    __name(sortGraphNodes, "sortGraphNodes");
    return diff(sortGraphNodes(a), sortGraphNodes(b));
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.changeTracker = window.comfyAPI.changeTracker || {};
window.comfyAPI.changeTracker.ChangeTracker = ChangeTracker;
async function syncEntities(dir, entityByPath, createEntity, updateEntity, exclude = () => false) {
  const files = (await api.listUserDataFullInfo(dir)).map((file) => ({
    ...file,
    path: dir ? `${dir}/${file.path}` : file.path
  }));
  for (const file of files) {
    const existingEntity = entityByPath[file.path];
    if (!existingEntity) {
      entityByPath[file.path] = createEntity(file);
    } else if (exclude(existingEntity)) {
      continue;
    } else {
      updateEntity(existingEntity, file);
    }
  }
  for (const [path, entity2] of Object.entries(entityByPath)) {
    if (exclude(entity2)) continue;
    if (!files.some((file) => file.path === path)) {
      delete entityByPath[path];
    }
  }
}
__name(syncEntities, "syncEntities");
class UserFile {
  static {
    __name(this, "UserFile");
  }
  constructor(path, lastModified, size2) {
    this.path = path;
    this.lastModified = lastModified;
    this.size = size2;
    const details = getPathDetails(path);
    this.path = path;
    this.directory = details.directory;
    this.fullFilename = details.fullFilename;
    this.filename = details.filename;
    this.suffix = details.suffix;
  }
  /**
   * Various path components.
   * Example:
   * - path: 'dir/file.txt'
   * - directory: 'dir'
   * - fullFilename: 'file.txt'
   * - filename: 'file'
   * - suffix: 'txt'
   */
  directory;
  fullFilename;
  filename;
  suffix;
  isLoading = false;
  content = null;
  originalContent = null;
  updatePath(newPath) {
    const details = getPathDetails(newPath);
    this.path = newPath;
    this.directory = details.directory;
    this.fullFilename = details.fullFilename;
    this.filename = details.filename;
    this.suffix = details.suffix;
  }
  static createTemporary(path) {
    return new UserFile(path, Date.now(), -1);
  }
  get isTemporary() {
    return this.size === -1;
  }
  get isPersisted() {
    return !this.isTemporary;
  }
  get key() {
    return this.path;
  }
  get isLoaded() {
    return this.content !== null;
  }
  get isModified() {
    return this.content !== this.originalContent;
  }
  /**
   * Loads the file content from the remote storage.
   */
  async load({
    force = false
  } = {}) {
    if (this.isTemporary || !force && this.isLoaded)
      return this;
    this.isLoading = true;
    const resp = await api.getUserData(this.path);
    if (resp.status !== 200) {
      throw new Error(
        `Failed to load file '${this.path}': ${resp.status} ${resp.statusText}`
      );
    }
    this.content = await resp.text();
    this.originalContent = this.content;
    this.isLoading = false;
    return this;
  }
  /**
   * Unloads the file content from memory
   */
  unload() {
    this.content = null;
    this.originalContent = null;
    this.isLoading = false;
  }
  async saveAs(newPath) {
    const tempFile = this.isTemporary ? this : UserFile.createTemporary(newPath);
    tempFile.content = this.content;
    await tempFile.save();
    return tempFile;
  }
  /**
   * Saves the file to the remote storage.
   * @param force Whether to force the save even if the file is not modified.
   */
  async save({ force = false } = {}) {
    if (this.isPersisted && !this.isModified && !force) return this;
    const resp = await api.storeUserData(this.path, this.content, {
      overwrite: this.isPersisted,
      throwOnError: true,
      full_info: true
    });
    const updatedFile = await resp.json();
    if (typeof updatedFile === "object") {
      this.lastModified = updatedFile.modified;
      this.size = updatedFile.size;
    }
    this.originalContent = this.content;
    return this;
  }
  async delete() {
    if (this.isTemporary) return;
    const resp = await api.deleteUserData(this.path);
    if (resp.status !== 204) {
      throw new Error(
        `Failed to delete file '${this.path}': ${resp.status} ${resp.statusText}`
      );
    }
  }
  async rename(newPath) {
    if (this.isTemporary) {
      this.updatePath(newPath);
      return this;
    }
    const resp = await api.moveUserData(this.path, newPath);
    if (resp.status !== 200) {
      throw new Error(
        `Failed to rename file '${this.path}': ${resp.status} ${resp.statusText}`
      );
    }
    this.updatePath(newPath);
    const updatedFile = await resp.json();
    if (typeof updatedFile === "object") {
      this.lastModified = updatedFile.modified;
      this.size = updatedFile.size;
    }
    return this;
  }
}
const useUserFileStore = /* @__PURE__ */ defineStore("userFile", () => {
  const userFilesByPath = ref({});
  const userFiles = computed(() => Object.values(userFilesByPath.value));
  const modifiedFiles = computed(
    () => userFiles.value.filter((file) => file.isModified)
  );
  const loadedFiles = computed(
    () => userFiles.value.filter((file) => file.isLoaded)
  );
  const fileTree = computed(
    () => buildTree$1(
      userFiles.value,
      (userFile) => userFile.path.split("/")
    )
  );
  const syncFiles = /* @__PURE__ */ __name(async (dir = "") => {
    await syncEntities(
      dir,
      userFilesByPath.value,
      (file) => new UserFile(file.path, file.modified, file.size),
      (existingFile, file) => {
        existingFile.lastModified = file.modified;
        existingFile.size = file.size;
        existingFile.unload();
      }
    );
  }, "syncFiles");
  return {
    userFiles,
    modifiedFiles,
    loadedFiles,
    fileTree,
    syncFiles
  };
});
class ComfyWorkflow extends UserFile {
  static {
    __name(this, "ComfyWorkflow");
  }
  static basePath = "workflows/";
  /**
   * The change tracker for the workflow. Non-reactive raw object.
   */
  changeTracker = null;
  /**
   * Whether the workflow has been modified comparing to the initial state.
   */
  _isModified = false;
  /**
   * @param options The path, modified, and size of the workflow.
   * Note: path is the full path, including the 'workflows/' prefix.
   */
  constructor(options4) {
    super(options4.path, options4.modified, options4.size);
  }
  get key() {
    return this.path.substring(ComfyWorkflow.basePath.length);
  }
  get activeState() {
    return this.changeTracker?.activeState ?? null;
  }
  get initialState() {
    return this.changeTracker?.initialState ?? null;
  }
  get isLoaded() {
    return this.changeTracker !== null;
  }
  get isModified() {
    return this._isModified;
  }
  set isModified(value4) {
    this._isModified = value4;
  }
  /**
   * Load the workflow content from remote storage. Directly returns the loaded
   * workflow if the content is already loaded.
   *
   * @param force Whether to force loading the content even if it is already loaded.
   * @returns this
   */
  async load({
    force = false
  } = {}) {
    await super.load({ force });
    if (!force && this.isLoaded) return this;
    if (!this.originalContent) {
      throw new Error("[ASSERT] Workflow content should be loaded");
    }
    console.debug("load and start tracking of workflow", this.path);
    this.changeTracker = markRaw(
      new ChangeTracker(
        this,
        /* initialState= */
        JSON.parse(this.originalContent)
      )
    );
    return this;
  }
  unload() {
    console.debug("unload workflow", this.path);
    this.changeTracker = null;
    super.unload();
  }
  async save() {
    this.content = JSON.stringify(this.activeState);
    const ret = await super.save({ force: true });
    this.changeTracker?.reset();
    this.isModified = false;
    return ret;
  }
  /**
   * Save the workflow as a new file.
   * @param path The path to save the workflow to. Note: with 'workflows/' prefix.
   * @returns this
   */
  async saveAs(path) {
    this.content = JSON.stringify(this.activeState);
    return await super.saveAs(path);
  }
}
const useWorkflowStore = /* @__PURE__ */ defineStore("workflow", () => {
  const detachWorkflow = /* @__PURE__ */ __name((workflow) => {
    delete workflowLookup.value[workflow.path];
    const index2 = openWorkflowPaths.value.indexOf(workflow.path);
    if (index2 !== -1) {
      openWorkflowPaths.value = openWorkflowPaths.value.filter(
        (path) => path !== workflow.path
      );
    }
    return index2;
  }, "detachWorkflow");
  const attachWorkflow = /* @__PURE__ */ __name((workflow, openIndex = -1) => {
    workflowLookup.value[workflow.path] = workflow;
    if (openIndex !== -1) {
      openWorkflowPaths.value.splice(openIndex, 0, workflow.path);
    }
  }, "attachWorkflow");
  const activeWorkflow = ref(null);
  const isActive2 = /* @__PURE__ */ __name((workflow) => activeWorkflow.value?.path === workflow.path, "isActive");
  const workflowLookup = ref({});
  const workflows = computed(
    () => Object.values(workflowLookup.value)
  );
  const getWorkflowByPath = /* @__PURE__ */ __name((path) => workflowLookup.value[path] ?? null, "getWorkflowByPath");
  const openWorkflowPaths = ref([]);
  const openWorkflowPathSet = computed(() => new Set(openWorkflowPaths.value));
  const openWorkflows = computed(
    () => openWorkflowPaths.value.map((path) => workflowLookup.value[path])
  );
  const reorderWorkflows = /* @__PURE__ */ __name((from2, to) => {
    const movedTab = openWorkflowPaths.value[from2];
    openWorkflowPaths.value.splice(from2, 1);
    openWorkflowPaths.value.splice(to, 0, movedTab);
  }, "reorderWorkflows");
  const isOpen = /* @__PURE__ */ __name((workflow) => openWorkflowPathSet.value.has(workflow.path), "isOpen");
  const openWorkflow = /* @__PURE__ */ __name(async (workflow) => {
    if (isActive2(workflow)) return workflow;
    if (!openWorkflowPaths.value.includes(workflow.path)) {
      openWorkflowPaths.value.push(workflow.path);
    }
    const loadedWorkflow = await workflow.load();
    activeWorkflow.value = loadedWorkflow;
    console.debug("[workflowStore] open workflow", workflow.path);
    return loadedWorkflow;
  }, "openWorkflow");
  const getUnconflictedPath = /* @__PURE__ */ __name((basePath2) => {
    const { directory, filename, suffix: suffix2 } = getPathDetails(basePath2);
    let counter = 2;
    let newPath = basePath2;
    while (workflowLookup.value[newPath]) {
      newPath = `${directory}/${filename} (${counter}).${suffix2}`;
      counter++;
    }
    return newPath;
  }, "getUnconflictedPath");
  const createTemporary = /* @__PURE__ */ __name((path, workflowData) => {
    const fullPath = getUnconflictedPath(
      ComfyWorkflow.basePath + (path ?? "Unsaved Workflow.json")
    );
    const workflow = new ComfyWorkflow({
      path: fullPath,
      modified: Date.now(),
      size: -1
    });
    workflow.originalContent = workflow.content = workflowData ? JSON.stringify(workflowData) : defaultGraphJSON;
    workflowLookup.value[workflow.path] = workflow;
    return workflow;
  }, "createTemporary");
  const closeWorkflow = /* @__PURE__ */ __name(async (workflow) => {
    openWorkflowPaths.value = openWorkflowPaths.value.filter(
      (path) => path !== workflow.path
    );
    if (workflow.isTemporary) {
      delete workflowLookup.value[workflow.path];
    } else {
      workflow.unload();
    }
    console.debug("[workflowStore] close workflow", workflow.path);
  }, "closeWorkflow");
  const openedWorkflowIndexShift = /* @__PURE__ */ __name((shift2) => {
    const index2 = openWorkflowPaths.value.indexOf(
      activeWorkflow.value?.path ?? ""
    );
    if (index2 !== -1) {
      const length = openWorkflows.value.length;
      const nextIndex = (index2 + shift2 + length) % length;
      const nextWorkflow = openWorkflows.value[nextIndex];
      return nextWorkflow ?? null;
    }
    return null;
  }, "openedWorkflowIndexShift");
  const persistedWorkflows = computed(
    () => Array.from(workflows.value).filter((workflow) => workflow.isPersisted)
  );
  const syncWorkflows = /* @__PURE__ */ __name(async (dir = "") => {
    await syncEntities(
      dir ? "workflows/" + dir : "workflows",
      workflowLookup.value,
      (file) => new ComfyWorkflow({
        path: file.path,
        modified: file.modified,
        size: file.size
      }),
      (existingWorkflow, file) => {
        existingWorkflow.lastModified = file.modified;
        existingWorkflow.size = file.size;
        existingWorkflow.unload();
      },
      /* exclude */
      (workflow) => workflow.isTemporary
    );
  }, "syncWorkflows");
  const bookmarkStore = useWorkflowBookmarkStore();
  const bookmarkedWorkflows = computed(
    () => workflows.value.filter(
      (workflow) => bookmarkStore.isBookmarked(workflow.path)
    )
  );
  const modifiedWorkflows = computed(
    () => workflows.value.filter((workflow) => workflow.isModified)
  );
  const isBusy = ref(false);
  const renameWorkflow = /* @__PURE__ */ __name(async (workflow, newPath) => {
    isBusy.value = true;
    try {
      const oldPath = workflow.path;
      const wasBookmarked = bookmarkStore.isBookmarked(oldPath);
      const openIndex = detachWorkflow(workflow);
      try {
        await workflow.rename(newPath);
      } finally {
        attachWorkflow(workflow, openIndex);
      }
      if (wasBookmarked) {
        bookmarkStore.setBookmarked(oldPath, false);
        bookmarkStore.setBookmarked(newPath, true);
      }
    } finally {
      isBusy.value = false;
    }
  }, "renameWorkflow");
  const deleteWorkflow = /* @__PURE__ */ __name(async (workflow) => {
    isBusy.value = true;
    try {
      await workflow.delete();
      if (bookmarkStore.isBookmarked(workflow.path)) {
        bookmarkStore.setBookmarked(workflow.path, false);
      }
      delete workflowLookup.value[workflow.path];
    } finally {
      isBusy.value = false;
    }
  }, "deleteWorkflow");
  const saveWorkflow = /* @__PURE__ */ __name(async (workflow) => {
    isBusy.value = true;
    try {
      const openIndex = detachWorkflow(workflow);
      try {
        await workflow.save();
      } finally {
        attachWorkflow(workflow, openIndex);
      }
    } finally {
      isBusy.value = false;
    }
  }, "saveWorkflow");
  return {
    activeWorkflow,
    isActive: isActive2,
    openWorkflows,
    openedWorkflowIndexShift,
    openWorkflow,
    isOpen,
    isBusy,
    closeWorkflow,
    createTemporary,
    renameWorkflow,
    deleteWorkflow,
    saveWorkflow,
    reorderWorkflows,
    workflows,
    bookmarkedWorkflows,
    persistedWorkflows,
    modifiedWorkflows,
    getWorkflowByPath,
    syncWorkflows
  };
});
const useWorkflowBookmarkStore = /* @__PURE__ */ defineStore("workflowBookmark", () => {
  const bookmarks = ref(/* @__PURE__ */ new Set());
  const isBookmarked = /* @__PURE__ */ __name((path) => bookmarks.value.has(path), "isBookmarked");
  const loadBookmarks = /* @__PURE__ */ __name(async () => {
    const resp = await api.getUserData("workflows/.index.json");
    if (resp.status === 200) {
      const info = await resp.json();
      bookmarks.value = new Set(info?.favorites ?? []);
    }
  }, "loadBookmarks");
  const saveBookmarks = /* @__PURE__ */ __name(async () => {
    await api.storeUserData("workflows/.index.json", {
      favorites: Array.from(bookmarks.value)
    });
  }, "saveBookmarks");
  const setBookmarked = /* @__PURE__ */ __name((path, value4) => {
    if (bookmarks.value.has(path) === value4) return;
    if (value4) {
      bookmarks.value.add(path);
    } else {
      bookmarks.value.delete(path);
    }
    saveBookmarks();
  }, "setBookmarked");
  const toggleBookmarked = /* @__PURE__ */ __name((path) => {
    setBookmarked(path, !bookmarks.value.has(path));
  }, "toggleBookmarked");
  return {
    isBookmarked,
    loadBookmarks,
    saveBookmarks,
    setBookmarked,
    toggleBookmarked
  };
});
const useWorkflowService = /* @__PURE__ */ __name(() => {
  const settingStore = useSettingStore();
  const workflowStore = useWorkflowStore();
  const toastStore = useToastStore();
  const dialogService = useDialogService();
  async function getFilename(defaultName) {
    if (settingStore.get("Comfy.PromptFilename")) {
      let filename = await dialogService.prompt({
        title: t("workflowService.exportWorkflow"),
        message: t("workflowService.enterFilename") + ":",
        defaultValue: defaultName
      });
      if (!filename) return null;
      if (!filename.toLowerCase().endsWith(".json")) {
        filename += ".json";
      }
      return filename;
    }
    return defaultName;
  }
  __name(getFilename, "getFilename");
  const exportWorkflow = /* @__PURE__ */ __name(async (filename, promptProperty) => {
    const workflow = workflowStore.activeWorkflow;
    if (workflow?.path) {
      filename = workflow.filename;
    }
    const p2 = await app$1.graphToPrompt();
    const json = JSON.stringify(p2[promptProperty], null, 2);
    const blob = new Blob([json], { type: "application/json" });
    const file = await getFilename(filename);
    if (!file) return;
    downloadBlob(file, blob);
  }, "exportWorkflow");
  const saveWorkflowAs = /* @__PURE__ */ __name(async (workflow) => {
    const newFilename = await dialogService.prompt({
      title: t("workflowService.saveWorkflow"),
      message: t("workflowService.enterFilename") + ":",
      defaultValue: workflow.filename
    });
    if (!newFilename) return;
    const newPath = workflow.directory + "/" + appendJsonExt(newFilename);
    const newKey = newPath.substring(ComfyWorkflow.basePath.length);
    const existingWorkflow = workflowStore.getWorkflowByPath(newPath);
    if (existingWorkflow && !existingWorkflow.isTemporary) {
      const res = await dialogService.confirm({
        title: t("sideToolbar.workflowTab.confirmOverwriteTitle"),
        type: "overwrite",
        message: t("sideToolbar.workflowTab.confirmOverwrite"),
        itemList: [newPath]
      });
      if (res !== true) return;
      if (existingWorkflow.path === workflow.path) {
        await saveWorkflow(workflow);
        return;
      }
      const deleted = await deleteWorkflow(existingWorkflow, true);
      if (!deleted) return;
    }
    if (workflow.isTemporary) {
      await renameWorkflow(workflow, newPath);
      await workflowStore.saveWorkflow(workflow);
    } else {
      const tempWorkflow = workflowStore.createTemporary(
        newKey,
        workflow.activeState
      );
      await openWorkflow(tempWorkflow);
      await workflowStore.saveWorkflow(tempWorkflow);
    }
  }, "saveWorkflowAs");
  const saveWorkflow = /* @__PURE__ */ __name(async (workflow) => {
    if (workflow.isTemporary) {
      await saveWorkflowAs(workflow);
    } else {
      await workflowStore.saveWorkflow(workflow);
    }
  }, "saveWorkflow");
  const loadDefaultWorkflow = /* @__PURE__ */ __name(async () => {
    await app$1.loadGraphData(defaultGraph);
  }, "loadDefaultWorkflow");
  const loadBlankWorkflow = /* @__PURE__ */ __name(async () => {
    await app$1.loadGraphData(blankGraph);
  }, "loadBlankWorkflow");
  const reloadCurrentWorkflow = /* @__PURE__ */ __name(async () => {
    const workflow = workflowStore.activeWorkflow;
    if (workflow) {
      await openWorkflow(workflow, { force: true });
    }
  }, "reloadCurrentWorkflow");
  const openWorkflow = /* @__PURE__ */ __name(async (workflow, options4 = { force: false }) => {
    if (workflowStore.isActive(workflow) && !options4.force) return;
    const loadFromRemote = !workflow.isLoaded;
    if (loadFromRemote) {
      await workflow.load();
    }
    await app$1.loadGraphData(
      toRaw(workflow.activeState),
      /* clean=*/
      true,
      /* restore_view=*/
      true,
      workflow,
      {
        showMissingModelsDialog: loadFromRemote,
        showMissingNodesDialog: loadFromRemote
      }
    );
  }, "openWorkflow");
  const closeWorkflow = /* @__PURE__ */ __name(async (workflow, options4 = { warnIfUnsaved: true }) => {
    if (!workflow.isLoaded) {
      return true;
    }
    if (workflow.isModified && options4.warnIfUnsaved) {
      const confirmed = await dialogService.confirm({
        title: t("sideToolbar.workflowTab.dirtyCloseTitle"),
        type: "dirtyClose",
        message: t("sideToolbar.workflowTab.dirtyClose"),
        itemList: [workflow.path]
      });
      if (confirmed === null) return false;
      if (confirmed === true) {
        await saveWorkflow(workflow);
      }
    }
    if (workflowStore.openWorkflows.length === 1) {
      await loadDefaultWorkflow();
    }
    if (workflowStore.isActive(workflow)) {
      await loadNextOpenedWorkflow();
    }
    await workflowStore.closeWorkflow(workflow);
    return true;
  }, "closeWorkflow");
  const renameWorkflow = /* @__PURE__ */ __name(async (workflow, newPath) => {
    await workflowStore.renameWorkflow(workflow, newPath);
  }, "renameWorkflow");
  const deleteWorkflow = /* @__PURE__ */ __name(async (workflow, silent = false) => {
    const bypassConfirm = !settingStore.get("Comfy.Workflow.ConfirmDelete");
    let confirmed = bypassConfirm || silent;
    if (!confirmed) {
      confirmed = await dialogService.confirm({
        title: t("sideToolbar.workflowTab.confirmDeleteTitle"),
        type: "delete",
        message: t("sideToolbar.workflowTab.confirmDelete"),
        itemList: [workflow.path]
      });
      if (!confirmed) return false;
    }
    if (workflowStore.isOpen(workflow)) {
      const closed = await closeWorkflow(workflow, {
        warnIfUnsaved: !confirmed
      });
      if (!closed) return false;
    }
    await workflowStore.deleteWorkflow(workflow);
    if (!silent) {
      toastStore.add({
        severity: "info",
        summary: t("sideToolbar.workflowTab.deleted"),
        life: 1e3
      });
    }
    return true;
  }, "deleteWorkflow");
  const beforeLoadNewGraph = /* @__PURE__ */ __name(() => {
    const workflowStore2 = useWorkspaceStore().workflow;
    const activeWorkflow = workflowStore2.activeWorkflow;
    if (activeWorkflow) {
      activeWorkflow.changeTracker.store();
    }
  }, "beforeLoadNewGraph");
  const afterLoadNewGraph = /* @__PURE__ */ __name(async (value4, workflowData) => {
    const workflowStore2 = useWorkspaceStore().workflow;
    if (typeof value4 === "string") {
      const workflow = workflowStore2.getWorkflowByPath(
        ComfyWorkflow.basePath + appendJsonExt(value4)
      );
      if (workflow?.isPersisted) {
        const loadedWorkflow2 = await workflowStore2.openWorkflow(workflow);
        loadedWorkflow2.changeTracker.restore();
        loadedWorkflow2.changeTracker.reset(workflowData);
        return;
      }
    }
    if (value4 === null || typeof value4 === "string") {
      const path = value4;
      const tempWorkflow = workflowStore2.createTemporary(
        path ? appendJsonExt(path) : void 0,
        workflowData
      );
      await workflowStore2.openWorkflow(tempWorkflow);
      return;
    }
    const loadedWorkflow = await workflowStore2.openWorkflow(value4);
    loadedWorkflow.changeTracker.reset(workflowData);
    loadedWorkflow.changeTracker.restore();
  }, "afterLoadNewGraph");
  const insertWorkflow = /* @__PURE__ */ __name(async (workflow) => {
    const loadedWorkflow = await workflow.load();
    const data24 = loadedWorkflow.initialState;
    const old = localStorage.getItem("litegrapheditor_clipboard");
    const graph = new LGraph(data24);
    const canvasElement = document.createElement("canvas");
    const canvas = new LGraphCanvas(canvasElement, graph, {
      skip_events: true,
      skip_render: true
    });
    canvas.reroutesEnabled = app$1.canvas.reroutesEnabled;
    canvas.selectItems();
    canvas.copyToClipboard();
    app$1.canvas.pasteFromClipboard();
    if (old !== null) {
      localStorage.setItem("litegrapheditor_clipboard", old);
    }
  }, "insertWorkflow");
  const loadNextOpenedWorkflow = /* @__PURE__ */ __name(async () => {
    const nextWorkflow = workflowStore.openedWorkflowIndexShift(1);
    if (nextWorkflow) {
      await openWorkflow(nextWorkflow);
    }
  }, "loadNextOpenedWorkflow");
  const loadPreviousOpenedWorkflow = /* @__PURE__ */ __name(async () => {
    const previousWorkflow = workflowStore.openedWorkflowIndexShift(-1);
    if (previousWorkflow) {
      await openWorkflow(previousWorkflow);
    }
  }, "loadPreviousOpenedWorkflow");
  const duplicateWorkflow = /* @__PURE__ */ __name(async (workflow) => {
    const state = JSON.parse(JSON.stringify(workflow.activeState));
    const suffix2 = workflow.isPersisted ? " (Copy)" : "";
    const filename = workflow.filename.replace(/\s*\(\d+\)$/, "") + suffix2;
    await app$1.loadGraphData(state, true, true, filename);
  }, "duplicateWorkflow");
  return {
    exportWorkflow,
    saveWorkflowAs,
    saveWorkflow,
    loadDefaultWorkflow,
    loadBlankWorkflow,
    reloadCurrentWorkflow,
    openWorkflow,
    closeWorkflow,
    renameWorkflow,
    deleteWorkflow,
    insertWorkflow,
    loadNextOpenedWorkflow,
    loadPreviousOpenedWorkflow,
    duplicateWorkflow,
    afterLoadNewGraph,
    beforeLoadNewGraph
  };
}, "useWorkflowService");
function _findInMetadata(metadata, ...keys2) {
  for (const key of keys2) {
    if (key in metadata) {
      return metadata[key];
    }
    for (const k in metadata) {
      if (k.endsWith(key)) {
        return metadata[k];
      }
    }
  }
  return null;
}
__name(_findInMetadata, "_findInMetadata");
class ComfyModelDef {
  static {
    __name(this, "ComfyModelDef");
  }
  /** Path to the model */
  path_index;
  /** Proper filename of the model */
  file_name;
  /** Normalized filename of the model, with all backslashes replaced with forward slashes */
  normalized_file_name;
  /** Directory containing the model, eg 'checkpoints' */
  directory;
  /** Simplified copy of name, used as a default title. Excludes the directory and the '.safetensors' file extension */
  simplified_file_name;
  /** Key for the model, used to uniquely identify the model. */
  key;
  /** Title / display name of the model, sometimes same as the name but not always */
  title;
  /** Metadata: architecture ID for the model, such as 'stable-diffusion-xl-v1-base' */
  architecture_id = "";
  /** Metadata: author of the model */
  author = "";
  /** Metadata: resolution of the model, eg '1024x1024' */
  resolution = "";
  /** Metadata: description of the model */
  description = "";
  /** Metadata: usage hint for the model */
  usage_hint = "";
  /** Metadata: trigger phrase for the model */
  trigger_phrase = "";
  /** Metadata: tags list for the model */
  tags = [];
  /** Metadata: image for the model */
  image = "";
  /** Whether the model metadata has been loaded from the server, used for `load()` */
  has_loaded_metadata = false;
  /** If true, a metadata load request has been triggered, but may or may not yet have finished loading */
  is_load_requested = false;
  /** A string full of auto-computed lowercase-only searchable text for this model */
  searchable = "";
  constructor(name2, directory, pathIndex) {
    this.path_index = pathIndex;
    this.file_name = name2;
    this.normalized_file_name = name2.replaceAll("\\", "/");
    this.simplified_file_name = this.normalized_file_name.split("/").pop() ?? "";
    if (this.simplified_file_name.endsWith(".safetensors")) {
      this.simplified_file_name = this.simplified_file_name.slice(
        0,
        -".safetensors".length
      );
    }
    this.title = this.simplified_file_name;
    this.directory = directory;
    this.key = `${directory}/${this.normalized_file_name}`;
    this.updateSearchable();
  }
  updateSearchable() {
    this.searchable = [
      this.file_name,
      this.title,
      this.author,
      this.description,
      this.trigger_phrase,
      this.tags.join(", ")
    ].join("\n").toLowerCase();
  }
  /** Loads the model metadata from the server, filling in this object if data is available */
  async load() {
    if (this.has_loaded_metadata || this.is_load_requested) {
      return;
    }
    this.is_load_requested = true;
    try {
      const metadata = await api.viewMetadata(this.directory, this.file_name);
      if (!metadata) {
        return;
      }
      this.title = _findInMetadata(
        metadata,
        "modelspec.title",
        "title",
        "display_name",
        "name"
      ) || this.title;
      this.architecture_id = _findInMetadata(metadata, "modelspec.architecture", "architecture") || "";
      this.author = _findInMetadata(metadata, "modelspec.author", "author") || "";
      this.description = _findInMetadata(metadata, "modelspec.description", "description") || "";
      this.resolution = _findInMetadata(metadata, "modelspec.resolution", "resolution") || "";
      this.usage_hint = _findInMetadata(metadata, "modelspec.usage_hint", "usage_hint") || "";
      this.trigger_phrase = _findInMetadata(
        metadata,
        "modelspec.trigger_phrase",
        "trigger_phrase"
      ) || "";
      this.image = _findInMetadata(
        metadata,
        "modelspec.thumbnail",
        "thumbnail",
        "image",
        "icon"
      ) || "";
      const tagsCommaSeparated = _findInMetadata(metadata, "modelspec.tags", "tags") || "";
      this.tags = tagsCommaSeparated.split(",").map((tag) => tag.trim());
      this.has_loaded_metadata = true;
      this.updateSearchable();
    } catch (error2) {
      console.error("Error loading model metadata", this.file_name, this, error2);
    }
  }
}
var ResourceState = /* @__PURE__ */ ((ResourceState2) => {
  ResourceState2[ResourceState2["Uninitialized"] = 0] = "Uninitialized";
  ResourceState2[ResourceState2["Loading"] = 1] = "Loading";
  ResourceState2[ResourceState2["Loaded"] = 2] = "Loaded";
  return ResourceState2;
})(ResourceState || {});
class ModelFolder {
  static {
    __name(this, "ModelFolder");
  }
  constructor(directory) {
    this.directory = directory;
  }
  /** Models in this folder */
  models = {};
  state = 0;
  get key() {
    return this.directory + "/";
  }
  /**
   * Loads the models in this folder from the server
   */
  async load() {
    if (this.state !== 0) {
      return this;
    }
    this.state = 1;
    const models = await api.getModels(this.directory);
    for (const model of models) {
      this.models[`${model.pathIndex}/${model.name}`] = new ComfyModelDef(
        model.name,
        this.directory,
        model.pathIndex
      );
    }
    this.state = 2;
    return this;
  }
}
const useModelStore = /* @__PURE__ */ defineStore("models", () => {
  const modelFolderNames = ref([]);
  const modelFolderByName = ref({});
  const modelFolders = computed(
    () => modelFolderNames.value.map(
      (folderName) => modelFolderByName.value[folderName]
    )
  );
  const models = computed(
    () => modelFolders.value.flatMap((folder) => Object.values(folder.models))
  );
  async function loadModelFolders() {
    const resData = await api.getModelFolders();
    modelFolderNames.value = resData.map((folder) => folder.name);
    modelFolderByName.value = {};
    for (const folderName of modelFolderNames.value) {
      modelFolderByName.value[folderName] = new ModelFolder(folderName);
    }
  }
  __name(loadModelFolders, "loadModelFolders");
  async function getLoadedModelFolder(folderName) {
    const folder = modelFolderByName.value[folderName];
    return folder ? await folder.load() : null;
  }
  __name(getLoadedModelFolder, "getLoadedModelFolder");
  async function loadModels() {
    return Promise.all(modelFolders.value.map((folder) => folder.load()));
  }
  __name(loadModels, "loadModels");
  return {
    models,
    modelFolders,
    loadModelFolders,
    loadModels,
    getLoadedModelFolder
  };
});
function isArray(value4) {
  return !Array.isArray ? getTag(value4) === "[object Array]" : Array.isArray(value4);
}
__name(isArray, "isArray");
const INFINITY = 1 / 0;
function baseToString(value4) {
  if (typeof value4 == "string") {
    return value4;
  }
  let result = value4 + "";
  return result == "0" && 1 / value4 == -INFINITY ? "-0" : result;
}
__name(baseToString, "baseToString");
function toString(value4) {
  return value4 == null ? "" : baseToString(value4);
}
__name(toString, "toString");
function isString(value4) {
  return typeof value4 === "string";
}
__name(isString, "isString");
function isNumber(value4) {
  return typeof value4 === "number";
}
__name(isNumber, "isNumber");
function isBoolean(value4) {
  return value4 === true || value4 === false || isObjectLike(value4) && getTag(value4) == "[object Boolean]";
}
__name(isBoolean, "isBoolean");
function isObject(value4) {
  return typeof value4 === "object";
}
__name(isObject, "isObject");
function isObjectLike(value4) {
  return isObject(value4) && value4 !== null;
}
__name(isObjectLike, "isObjectLike");
function isDefined(value4) {
  return value4 !== void 0 && value4 !== null;
}
__name(isDefined, "isDefined");
function isBlank(value4) {
  return !value4.trim().length;
}
__name(isBlank, "isBlank");
function getTag(value4) {
  return value4 == null ? value4 === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value4);
}
__name(getTag, "getTag");
const EXTENDED_SEARCH_UNAVAILABLE = "Extended search is not available";
const INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = /* @__PURE__ */ __name((key) => `Invalid value for key ${key}`, "LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY");
const PATTERN_LENGTH_TOO_LARGE = /* @__PURE__ */ __name((max) => `Pattern length exceeds max of ${max}.`, "PATTERN_LENGTH_TOO_LARGE");
const MISSING_KEY_PROPERTY = /* @__PURE__ */ __name((name2) => `Missing ${name2} property in key`, "MISSING_KEY_PROPERTY");
const INVALID_KEY_WEIGHT_VALUE = /* @__PURE__ */ __name((key) => `Property 'weight' in key '${key}' must be a positive integer`, "INVALID_KEY_WEIGHT_VALUE");
const hasOwn = Object.prototype.hasOwnProperty;
class KeyStore {
  static {
    __name(this, "KeyStore");
  }
  constructor(keys2) {
    this._keys = [];
    this._keyMap = {};
    let totalWeight = 0;
    keys2.forEach((key) => {
      let obj = createKey(key);
      this._keys.push(obj);
      this._keyMap[obj.id] = obj;
      totalWeight += obj.weight;
    });
    this._keys.forEach((key) => {
      key.weight /= totalWeight;
    });
  }
  get(keyId) {
    return this._keyMap[keyId];
  }
  keys() {
    return this._keys;
  }
  toJSON() {
    return JSON.stringify(this._keys);
  }
}
function createKey(key) {
  let path = null;
  let id3 = null;
  let src = null;
  let weight = 1;
  let getFn = null;
  if (isString(key) || isArray(key)) {
    src = key;
    path = createKeyPath(key);
    id3 = createKeyId(key);
  } else {
    if (!hasOwn.call(key, "name")) {
      throw new Error(MISSING_KEY_PROPERTY("name"));
    }
    const name2 = key.name;
    src = name2;
    if (hasOwn.call(key, "weight")) {
      weight = key.weight;
      if (weight <= 0) {
        throw new Error(INVALID_KEY_WEIGHT_VALUE(name2));
      }
    }
    path = createKeyPath(name2);
    id3 = createKeyId(name2);
    getFn = key.getFn;
  }
  return { path, id: id3, weight, src, getFn };
}
__name(createKey, "createKey");
function createKeyPath(key) {
  return isArray(key) ? key : key.split(".");
}
__name(createKeyPath, "createKeyPath");
function createKeyId(key) {
  return isArray(key) ? key.join(".") : key;
}
__name(createKeyId, "createKeyId");
function get(obj, path) {
  let list2 = [];
  let arr = false;
  const deepGet = /* @__PURE__ */ __name((obj2, path2, index2) => {
    if (!isDefined(obj2)) {
      return;
    }
    if (!path2[index2]) {
      list2.push(obj2);
    } else {
      let key = path2[index2];
      const value4 = obj2[key];
      if (!isDefined(value4)) {
        return;
      }
      if (index2 === path2.length - 1 && (isString(value4) || isNumber(value4) || isBoolean(value4))) {
        list2.push(toString(value4));
      } else if (isArray(value4)) {
        arr = true;
        for (let i2 = 0, len = value4.length; i2 < len; i2 += 1) {
          deepGet(value4[i2], path2, index2 + 1);
        }
      } else if (path2.length) {
        deepGet(value4, path2, index2 + 1);
      }
    }
  }, "deepGet");
  deepGet(obj, isString(path) ? path.split(".") : path, 0);
  return arr ? list2 : list2[0];
}
__name(get, "get");
const MatchOptions = {
  // Whether the matches should be included in the result set. When `true`, each record in the result
  // set will include the indices of the matched characters.
  // These can consequently be used for highlighting purposes.
  includeMatches: false,
  // When `true`, the matching function will continue to the end of a search pattern even if
  // a perfect match has already been located in the string.
  findAllMatches: false,
  // Minimum number of characters that must be matched before a result is considered a match
  minMatchCharLength: 1
};
const BasicOptions = {
  // When `true`, the algorithm continues searching to the end of the input even if a perfect
  // match is found before the end of the same input.
  isCaseSensitive: false,
  // When true, the matching function will continue to the end of a search pattern even if
  includeScore: false,
  // List of properties that will be searched. This also supports nested properties.
  keys: [],
  // Whether to sort the result list, by score
  shouldSort: true,
  // Default sort function: sort by ascending score, ascending index
  sortFn: /* @__PURE__ */ __name((a, b) => a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1, "sortFn")
};
const FuzzyOptions = {
  // Approximately where in the text is the pattern expected to be found?
  location: 0,
  // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
  // (of both letters and location), a threshold of '1.0' would match anything.
  threshold: 0.6,
  // Determines how close the match must be to the fuzzy location (specified above).
  // An exact letter match which is 'distance' characters away from the fuzzy location
  // would score as a complete mismatch. A distance of '0' requires the match be at
  // the exact location specified, a threshold of '1000' would require a perfect match
  // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
  distance: 100
};
const AdvancedOptions = {
  // When `true`, it enables the use of unix-like search commands
  useExtendedSearch: false,
  // The get function to use when fetching an object's properties.
  // The default will search nested paths *ie foo.bar.baz*
  getFn: get,
  // When `true`, search will ignore `location` and `distance`, so it won't matter
  // where in the string the pattern appears.
  // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
  ignoreLocation: false,
  // When `true`, the calculation for the relevance score (used for sorting) will
  // ignore the field-length norm.
  // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
  ignoreFieldNorm: false,
  // The weight to determine how much field length norm effects scoring.
  fieldNormWeight: 1
};
var Config = {
  ...BasicOptions,
  ...MatchOptions,
  ...FuzzyOptions,
  ...AdvancedOptions
};
const SPACE = /[^ ]+/g;
function norm(weight = 1, mantissa = 3) {
  const cache2 = /* @__PURE__ */ new Map();
  const m = Math.pow(10, mantissa);
  return {
    get(value4) {
      const numTokens = value4.match(SPACE).length;
      if (cache2.has(numTokens)) {
        return cache2.get(numTokens);
      }
      const norm2 = 1 / Math.pow(numTokens, 0.5 * weight);
      const n = parseFloat(Math.round(norm2 * m) / m);
      cache2.set(numTokens, n);
      return n;
    },
    clear() {
      cache2.clear();
    }
  };
}
__name(norm, "norm");
class FuseIndex {
  static {
    __name(this, "FuseIndex");
  }
  constructor({
    getFn = Config.getFn,
    fieldNormWeight = Config.fieldNormWeight
  } = {}) {
    this.norm = norm(fieldNormWeight, 3);
    this.getFn = getFn;
    this.isCreated = false;
    this.setIndexRecords();
  }
  setSources(docs = []) {
    this.docs = docs;
  }
  setIndexRecords(records = []) {
    this.records = records;
  }
  setKeys(keys2 = []) {
    this.keys = keys2;
    this._keysMap = {};
    keys2.forEach((key, idx) => {
      this._keysMap[key.id] = idx;
    });
  }
  create() {
    if (this.isCreated || !this.docs.length) {
      return;
    }
    this.isCreated = true;
    if (isString(this.docs[0])) {
      this.docs.forEach((doc2, docIndex) => {
        this._addString(doc2, docIndex);
      });
    } else {
      this.docs.forEach((doc2, docIndex) => {
        this._addObject(doc2, docIndex);
      });
    }
    this.norm.clear();
  }
  // Adds a doc to the end of the index
  add(doc2) {
    const idx = this.size();
    if (isString(doc2)) {
      this._addString(doc2, idx);
    } else {
      this._addObject(doc2, idx);
    }
  }
  // Removes the doc at the specified index of the index
  removeAt(idx) {
    this.records.splice(idx, 1);
    for (let i2 = idx, len = this.size(); i2 < len; i2 += 1) {
      this.records[i2].i -= 1;
    }
  }
  getValueForItemAtKeyId(item3, keyId) {
    return item3[this._keysMap[keyId]];
  }
  size() {
    return this.records.length;
  }
  _addString(doc2, docIndex) {
    if (!isDefined(doc2) || isBlank(doc2)) {
      return;
    }
    let record = {
      v: doc2,
      i: docIndex,
      n: this.norm.get(doc2)
    };
    this.records.push(record);
  }
  _addObject(doc2, docIndex) {
    let record = { i: docIndex, $: {} };
    this.keys.forEach((key, keyIndex) => {
      let value4 = key.getFn ? key.getFn(doc2) : this.getFn(doc2, key.path);
      if (!isDefined(value4)) {
        return;
      }
      if (isArray(value4)) {
        let subRecords = [];
        const stack2 = [{ nestedArrIndex: -1, value: value4 }];
        while (stack2.length) {
          const { nestedArrIndex, value: value5 } = stack2.pop();
          if (!isDefined(value5)) {
            continue;
          }
          if (isString(value5) && !isBlank(value5)) {
            let subRecord = {
              v: value5,
              i: nestedArrIndex,
              n: this.norm.get(value5)
            };
            subRecords.push(subRecord);
          } else if (isArray(value5)) {
            value5.forEach((item3, k) => {
              stack2.push({
                nestedArrIndex: k,
                value: item3
              });
            });
          } else ;
        }
        record.$[keyIndex] = subRecords;
      } else if (isString(value4) && !isBlank(value4)) {
        let subRecord = {
          v: value4,
          n: this.norm.get(value4)
        };
        record.$[keyIndex] = subRecord;
      }
    });
    this.records.push(record);
  }
  toJSON() {
    return {
      keys: this.keys,
      records: this.records
    };
  }
}
function createIndex(keys2, docs, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {
  const myIndex = new FuseIndex({ getFn, fieldNormWeight });
  myIndex.setKeys(keys2.map(createKey));
  myIndex.setSources(docs);
  myIndex.create();
  return myIndex;
}
__name(createIndex, "createIndex");
function parseIndex(data24, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {
  const { keys: keys2, records } = data24;
  const myIndex = new FuseIndex({ getFn, fieldNormWeight });
  myIndex.setKeys(keys2);
  myIndex.setIndexRecords(records);
  return myIndex;
}
__name(parseIndex, "parseIndex");
function computeScore$1(pattern, {
  errors: errors2 = 0,
  currentLocation = 0,
  expectedLocation = 0,
  distance: distance2 = Config.distance,
  ignoreLocation = Config.ignoreLocation
} = {}) {
  const accuracy = errors2 / pattern.length;
  if (ignoreLocation) {
    return accuracy;
  }
  const proximity = Math.abs(expectedLocation - currentLocation);
  if (!distance2) {
    return proximity ? 1 : accuracy;
  }
  return accuracy + proximity / distance2;
}
__name(computeScore$1, "computeScore$1");
function convertMaskToIndices(matchmask = [], minMatchCharLength = Config.minMatchCharLength) {
  let indices = [];
  let start2 = -1;
  let end = -1;
  let i2 = 0;
  for (let len = matchmask.length; i2 < len; i2 += 1) {
    let match2 = matchmask[i2];
    if (match2 && start2 === -1) {
      start2 = i2;
    } else if (!match2 && start2 !== -1) {
      end = i2 - 1;
      if (end - start2 + 1 >= minMatchCharLength) {
        indices.push([start2, end]);
      }
      start2 = -1;
    }
  }
  if (matchmask[i2 - 1] && i2 - start2 >= minMatchCharLength) {
    indices.push([start2, i2 - 1]);
  }
  return indices;
}
__name(convertMaskToIndices, "convertMaskToIndices");
const MAX_BITS = 32;
function search(text2, pattern, patternAlphabet, {
  location: location2 = Config.location,
  distance: distance2 = Config.distance,
  threshold = Config.threshold,
  findAllMatches = Config.findAllMatches,
  minMatchCharLength = Config.minMatchCharLength,
  includeMatches = Config.includeMatches,
  ignoreLocation = Config.ignoreLocation
} = {}) {
  if (pattern.length > MAX_BITS) {
    throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));
  }
  const patternLen = pattern.length;
  const textLen = text2.length;
  const expectedLocation = Math.max(0, Math.min(location2, textLen));
  let currentThreshold = threshold;
  let bestLocation = expectedLocation;
  const computeMatches = minMatchCharLength > 1 || includeMatches;
  const matchMask = computeMatches ? Array(textLen) : [];
  let index2;
  while ((index2 = text2.indexOf(pattern, bestLocation)) > -1) {
    let score = computeScore$1(pattern, {
      currentLocation: index2,
      expectedLocation,
      distance: distance2,
      ignoreLocation
    });
    currentThreshold = Math.min(score, currentThreshold);
    bestLocation = index2 + patternLen;
    if (computeMatches) {
      let i2 = 0;
      while (i2 < patternLen) {
        matchMask[index2 + i2] = 1;
        i2 += 1;
      }
    }
  }
  bestLocation = -1;
  let lastBitArr = [];
  let finalScore = 1;
  let binMax = patternLen + textLen;
  const mask3 = 1 << patternLen - 1;
  for (let i2 = 0; i2 < patternLen; i2 += 1) {
    let binMin = 0;
    let binMid = binMax;
    while (binMin < binMid) {
      const score2 = computeScore$1(pattern, {
        errors: i2,
        currentLocation: expectedLocation + binMid,
        expectedLocation,
        distance: distance2,
        ignoreLocation
      });
      if (score2 <= currentThreshold) {
        binMin = binMid;
      } else {
        binMax = binMid;
      }
      binMid = Math.floor((binMax - binMin) / 2 + binMin);
    }
    binMax = binMid;
    let start2 = Math.max(1, expectedLocation - binMid + 1);
    let finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen;
    let bitArr = Array(finish + 2);
    bitArr[finish + 1] = (1 << i2) - 1;
    for (let j = finish; j >= start2; j -= 1) {
      let currentLocation = j - 1;
      let charMatch = patternAlphabet[text2.charAt(currentLocation)];
      if (computeMatches) {
        matchMask[currentLocation] = +!!charMatch;
      }
      bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch;
      if (i2) {
        bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];
      }
      if (bitArr[j] & mask3) {
        finalScore = computeScore$1(pattern, {
          errors: i2,
          currentLocation,
          expectedLocation,
          distance: distance2,
          ignoreLocation
        });
        if (finalScore <= currentThreshold) {
          currentThreshold = finalScore;
          bestLocation = currentLocation;
          if (bestLocation <= expectedLocation) {
            break;
          }
          start2 = Math.max(1, 2 * expectedLocation - bestLocation);
        }
      }
    }
    const score = computeScore$1(pattern, {
      errors: i2 + 1,
      currentLocation: expectedLocation,
      expectedLocation,
      distance: distance2,
      ignoreLocation
    });
    if (score > currentThreshold) {
      break;
    }
    lastBitArr = bitArr;
  }
  const result = {
    isMatch: bestLocation >= 0,
    // Count exact matches (those with a score of 0) to be "almost" exact
    score: Math.max(1e-3, finalScore)
  };
  if (computeMatches) {
    const indices = convertMaskToIndices(matchMask, minMatchCharLength);
    if (!indices.length) {
      result.isMatch = false;
    } else if (includeMatches) {
      result.indices = indices;
    }
  }
  return result;
}
__name(search, "search");
function createPatternAlphabet(pattern) {
  let mask3 = {};
  for (let i2 = 0, len = pattern.length; i2 < len; i2 += 1) {
    const char = pattern.charAt(i2);
    mask3[char] = (mask3[char] || 0) | 1 << len - i2 - 1;
  }
  return mask3;
}
__name(createPatternAlphabet, "createPatternAlphabet");
class BitapSearch {
  static {
    __name(this, "BitapSearch");
  }
  constructor(pattern, {
    location: location2 = Config.location,
    threshold = Config.threshold,
    distance: distance2 = Config.distance,
    includeMatches = Config.includeMatches,
    findAllMatches = Config.findAllMatches,
    minMatchCharLength = Config.minMatchCharLength,
    isCaseSensitive = Config.isCaseSensitive,
    ignoreLocation = Config.ignoreLocation
  } = {}) {
    this.options = {
      location: location2,
      threshold,
      distance: distance2,
      includeMatches,
      findAllMatches,
      minMatchCharLength,
      isCaseSensitive,
      ignoreLocation
    };
    this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
    this.chunks = [];
    if (!this.pattern.length) {
      return;
    }
    const addChunk = /* @__PURE__ */ __name((pattern2, startIndex) => {
      this.chunks.push({
        pattern: pattern2,
        alphabet: createPatternAlphabet(pattern2),
        startIndex
      });
    }, "addChunk");
    const len = this.pattern.length;
    if (len > MAX_BITS) {
      let i2 = 0;
      const remainder = len % MAX_BITS;
      const end = len - remainder;
      while (i2 < end) {
        addChunk(this.pattern.substr(i2, MAX_BITS), i2);
        i2 += MAX_BITS;
      }
      if (remainder) {
        const startIndex = len - MAX_BITS;
        addChunk(this.pattern.substr(startIndex), startIndex);
      }
    } else {
      addChunk(this.pattern, 0);
    }
  }
  searchIn(text2) {
    const { isCaseSensitive, includeMatches } = this.options;
    if (!isCaseSensitive) {
      text2 = text2.toLowerCase();
    }
    if (this.pattern === text2) {
      let result2 = {
        isMatch: true,
        score: 0
      };
      if (includeMatches) {
        result2.indices = [[0, text2.length - 1]];
      }
      return result2;
    }
    const {
      location: location2,
      distance: distance2,
      threshold,
      findAllMatches,
      minMatchCharLength,
      ignoreLocation
    } = this.options;
    let allIndices = [];
    let totalScore = 0;
    let hasMatches = false;
    this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
      const { isMatch, score, indices } = search(text2, pattern, alphabet, {
        location: location2 + startIndex,
        distance: distance2,
        threshold,
        findAllMatches,
        minMatchCharLength,
        includeMatches,
        ignoreLocation
      });
      if (isMatch) {
        hasMatches = true;
      }
      totalScore += score;
      if (isMatch && indices) {
        allIndices = [...allIndices, ...indices];
      }
    });
    let result = {
      isMatch: hasMatches,
      score: hasMatches ? totalScore / this.chunks.length : 1
    };
    if (hasMatches && includeMatches) {
      result.indices = allIndices;
    }
    return result;
  }
}
class BaseMatch {
  static {
    __name(this, "BaseMatch");
  }
  constructor(pattern) {
    this.pattern = pattern;
  }
  static isMultiMatch(pattern) {
    return getMatch(pattern, this.multiRegex);
  }
  static isSingleMatch(pattern) {
    return getMatch(pattern, this.singleRegex);
  }
  search() {
  }
}
function getMatch(pattern, exp) {
  const matches2 = pattern.match(exp);
  return matches2 ? matches2[1] : null;
}
__name(getMatch, "getMatch");
class ExactMatch extends BaseMatch {
  static {
    __name(this, "ExactMatch");
  }
  constructor(pattern) {
    super(pattern);
  }
  static get type() {
    return "exact";
  }
  static get multiRegex() {
    return /^="(.*)"$/;
  }
  static get singleRegex() {
    return /^=(.*)$/;
  }
  search(text2) {
    const isMatch = text2 === this.pattern;
    return {
      isMatch,
      score: isMatch ? 0 : 1,
      indices: [0, this.pattern.length - 1]
    };
  }
}
class InverseExactMatch extends BaseMatch {
  static {
    __name(this, "InverseExactMatch");
  }
  constructor(pattern) {
    super(pattern);
  }
  static get type() {
    return "inverse-exact";
  }
  static get multiRegex() {
    return /^!"(.*)"$/;
  }
  static get singleRegex() {
    return /^!(.*)$/;
  }
  search(text2) {
    const index2 = text2.indexOf(this.pattern);
    const isMatch = index2 === -1;
    return {
      isMatch,
      score: isMatch ? 0 : 1,
      indices: [0, text2.length - 1]
    };
  }
}
class PrefixExactMatch extends BaseMatch {
  static {
    __name(this, "PrefixExactMatch");
  }
  constructor(pattern) {
    super(pattern);
  }
  static get type() {
    return "prefix-exact";
  }
  static get multiRegex() {
    return /^\^"(.*)"$/;
  }
  static get singleRegex() {
    return /^\^(.*)$/;
  }
  search(text2) {
    const isMatch = text2.startsWith(this.pattern);
    return {
      isMatch,
      score: isMatch ? 0 : 1,
      indices: [0, this.pattern.length - 1]
    };
  }
}
class InversePrefixExactMatch extends BaseMatch {
  static {
    __name(this, "InversePrefixExactMatch");
  }
  constructor(pattern) {
    super(pattern);
  }
  static get type() {
    return "inverse-prefix-exact";
  }
  static get multiRegex() {
    return /^!\^"(.*)"$/;
  }
  static get singleRegex() {
    return /^!\^(.*)$/;
  }
  search(text2) {
    const isMatch = !text2.startsWith(this.pattern);
    return {
      isMatch,
      score: isMatch ? 0 : 1,
      indices: [0, text2.length - 1]
    };
  }
}
class SuffixExactMatch extends BaseMatch {
  static {
    __name(this, "SuffixExactMatch");
  }
  constructor(pattern) {
    super(pattern);
  }
  static get type() {
    return "suffix-exact";
  }
  static get multiRegex() {
    return /^"(.*)"\$$/;
  }
  static get singleRegex() {
    return /^(.*)\$$/;
  }
  search(text2) {
    const isMatch = text2.endsWith(this.pattern);
    return {
      isMatch,
      score: isMatch ? 0 : 1,
      indices: [text2.length - this.pattern.length, text2.length - 1]
    };
  }
}
class InverseSuffixExactMatch extends BaseMatch {
  static {
    __name(this, "InverseSuffixExactMatch");
  }
  constructor(pattern) {
    super(pattern);
  }
  static get type() {
    return "inverse-suffix-exact";
  }
  static get multiRegex() {
    return /^!"(.*)"\$$/;
  }
  static get singleRegex() {
    return /^!(.*)\$$/;
  }
  search(text2) {
    const isMatch = !text2.endsWith(this.pattern);
    return {
      isMatch,
      score: isMatch ? 0 : 1,
      indices: [0, text2.length - 1]
    };
  }
}
class FuzzyMatch extends BaseMatch {
  static {
    __name(this, "FuzzyMatch");
  }
  constructor(pattern, {
    location: location2 = Config.location,
    threshold = Config.threshold,
    distance: distance2 = Config.distance,
    includeMatches = Config.includeMatches,
    findAllMatches = Config.findAllMatches,
    minMatchCharLength = Config.minMatchCharLength,
    isCaseSensitive = Config.isCaseSensitive,
    ignoreLocation = Config.ignoreLocation
  } = {}) {
    super(pattern);
    this._bitapSearch = new BitapSearch(pattern, {
      location: location2,
      threshold,
      distance: distance2,
      includeMatches,
      findAllMatches,
      minMatchCharLength,
      isCaseSensitive,
      ignoreLocation
    });
  }
  static get type() {
    return "fuzzy";
  }
  static get multiRegex() {
    return /^"(.*)"$/;
  }
  static get singleRegex() {
    return /^(.*)$/;
  }
  search(text2) {
    return this._bitapSearch.searchIn(text2);
  }
}
class IncludeMatch extends BaseMatch {
  static {
    __name(this, "IncludeMatch");
  }
  constructor(pattern) {
    super(pattern);
  }
  static get type() {
    return "include";
  }
  static get multiRegex() {
    return /^'"(.*)"$/;
  }
  static get singleRegex() {
    return /^'(.*)$/;
  }
  search(text2) {
    let location2 = 0;
    let index2;
    const indices = [];
    const patternLen = this.pattern.length;
    while ((index2 = text2.indexOf(this.pattern, location2)) > -1) {
      location2 = index2 + patternLen;
      indices.push([index2, location2 - 1]);
    }
    const isMatch = !!indices.length;
    return {
      isMatch,
      score: isMatch ? 0 : 1,
      indices
    };
  }
}
const searchers = [
  ExactMatch,
  IncludeMatch,
  PrefixExactMatch,
  InversePrefixExactMatch,
  InverseSuffixExactMatch,
  SuffixExactMatch,
  InverseExactMatch,
  FuzzyMatch
];
const searchersLen = searchers.length;
const SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;
const OR_TOKEN = "|";
function parseQuery(pattern, options4 = {}) {
  return pattern.split(OR_TOKEN).map((item3) => {
    let query = item3.trim().split(SPACE_RE).filter((item4) => item4 && !!item4.trim());
    let results = [];
    for (let i2 = 0, len = query.length; i2 < len; i2 += 1) {
      const queryItem = query[i2];
      let found2 = false;
      let idx = -1;
      while (!found2 && ++idx < searchersLen) {
        const searcher = searchers[idx];
        let token = searcher.isMultiMatch(queryItem);
        if (token) {
          results.push(new searcher(token, options4));
          found2 = true;
        }
      }
      if (found2) {
        continue;
      }
      idx = -1;
      while (++idx < searchersLen) {
        const searcher = searchers[idx];
        let token = searcher.isSingleMatch(queryItem);
        if (token) {
          results.push(new searcher(token, options4));
          break;
        }
      }
    }
    return results;
  });
}
__name(parseQuery, "parseQuery");
const MultiMatchSet = /* @__PURE__ */ new Set([FuzzyMatch.type, IncludeMatch.type]);
class ExtendedSearch {
  static {
    __name(this, "ExtendedSearch");
  }
  constructor(pattern, {
    isCaseSensitive = Config.isCaseSensitive,
    includeMatches = Config.includeMatches,
    minMatchCharLength = Config.minMatchCharLength,
    ignoreLocation = Config.ignoreLocation,
    findAllMatches = Config.findAllMatches,
    location: location2 = Config.location,
    threshold = Config.threshold,
    distance: distance2 = Config.distance
  } = {}) {
    this.query = null;
    this.options = {
      isCaseSensitive,
      includeMatches,
      minMatchCharLength,
      findAllMatches,
      ignoreLocation,
      location: location2,
      threshold,
      distance: distance2
    };
    this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
    this.query = parseQuery(this.pattern, this.options);
  }
  static condition(_2, options4) {
    return options4.useExtendedSearch;
  }
  searchIn(text2) {
    const query = this.query;
    if (!query) {
      return {
        isMatch: false,
        score: 1
      };
    }
    const { includeMatches, isCaseSensitive } = this.options;
    text2 = isCaseSensitive ? text2 : text2.toLowerCase();
    let numMatches = 0;
    let allIndices = [];
    let totalScore = 0;
    for (let i2 = 0, qLen = query.length; i2 < qLen; i2 += 1) {
      const searchers2 = query[i2];
      allIndices.length = 0;
      numMatches = 0;
      for (let j = 0, pLen = searchers2.length; j < pLen; j += 1) {
        const searcher = searchers2[j];
        const { isMatch, indices, score } = searcher.search(text2);
        if (isMatch) {
          numMatches += 1;
          totalScore += score;
          if (includeMatches) {
            const type = searcher.constructor.type;
            if (MultiMatchSet.has(type)) {
              allIndices = [...allIndices, ...indices];
            } else {
              allIndices.push(indices);
            }
          }
        } else {
          totalScore = 0;
          numMatches = 0;
          allIndices.length = 0;
          break;
        }
      }
      if (numMatches) {
        let result = {
          isMatch: true,
          score: totalScore / numMatches
        };
        if (includeMatches) {
          result.indices = allIndices;
        }
        return result;
      }
    }
    return {
      isMatch: false,
      score: 1
    };
  }
}
const registeredSearchers = [];
function register$1(...args) {
  registeredSearchers.push(...args);
}
__name(register$1, "register$1");
function createSearcher(pattern, options4) {
  for (let i2 = 0, len = registeredSearchers.length; i2 < len; i2 += 1) {
    let searcherClass = registeredSearchers[i2];
    if (searcherClass.condition(pattern, options4)) {
      return new searcherClass(pattern, options4);
    }
  }
  return new BitapSearch(pattern, options4);
}
__name(createSearcher, "createSearcher");
const LogicalOperator = {
  AND: "$and",
  OR: "$or"
};
const KeyType = {
  PATH: "$path",
  PATTERN: "$val"
};
const isExpression = /* @__PURE__ */ __name((query) => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]), "isExpression");
const isPath = /* @__PURE__ */ __name((query) => !!query[KeyType.PATH], "isPath");
const isLeaf = /* @__PURE__ */ __name((query) => !isArray(query) && isObject(query) && !isExpression(query), "isLeaf");
const convertToExplicit = /* @__PURE__ */ __name((query) => ({
  [LogicalOperator.AND]: Object.keys(query).map((key) => ({
    [key]: query[key]
  }))
}), "convertToExplicit");
function parse(query, options4, { auto = true } = {}) {
  const next2 = /* @__PURE__ */ __name((query2) => {
    let keys2 = Object.keys(query2);
    const isQueryPath = isPath(query2);
    if (!isQueryPath && keys2.length > 1 && !isExpression(query2)) {
      return next2(convertToExplicit(query2));
    }
    if (isLeaf(query2)) {
      const key = isQueryPath ? query2[KeyType.PATH] : keys2[0];
      const pattern = isQueryPath ? query2[KeyType.PATTERN] : query2[key];
      if (!isString(pattern)) {
        throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
      }
      const obj = {
        keyId: createKeyId(key),
        pattern
      };
      if (auto) {
        obj.searcher = createSearcher(pattern, options4);
      }
      return obj;
    }
    let node3 = {
      children: [],
      operator: keys2[0]
    };
    keys2.forEach((key) => {
      const value4 = query2[key];
      if (isArray(value4)) {
        value4.forEach((item3) => {
          node3.children.push(next2(item3));
        });
      }
    });
    return node3;
  }, "next");
  if (!isExpression(query)) {
    query = convertToExplicit(query);
  }
  return next2(query);
}
__name(parse, "parse");
function computeScore(results, { ignoreFieldNorm = Config.ignoreFieldNorm }) {
  results.forEach((result) => {
    let totalScore = 1;
    result.matches.forEach(({ key, norm: norm2, score }) => {
      const weight = key ? key.weight : null;
      totalScore *= Math.pow(
        score === 0 && weight ? Number.EPSILON : score,
        (weight || 1) * (ignoreFieldNorm ? 1 : norm2)
      );
    });
    result.score = totalScore;
  });
}
__name(computeScore, "computeScore");
function transformMatches(result, data24) {
  const matches2 = result.matches;
  data24.matches = [];
  if (!isDefined(matches2)) {
    return;
  }
  matches2.forEach((match2) => {
    if (!isDefined(match2.indices) || !match2.indices.length) {
      return;
    }
    const { indices, value: value4 } = match2;
    let obj = {
      indices,
      value: value4
    };
    if (match2.key) {
      obj.key = match2.key.src;
    }
    if (match2.idx > -1) {
      obj.refIndex = match2.idx;
    }
    data24.matches.push(obj);
  });
}
__name(transformMatches, "transformMatches");
function transformScore(result, data24) {
  data24.score = result.score;
}
__name(transformScore, "transformScore");
function format(results, docs, {
  includeMatches = Config.includeMatches,
  includeScore = Config.includeScore
} = {}) {
  const transformers = [];
  if (includeMatches) transformers.push(transformMatches);
  if (includeScore) transformers.push(transformScore);
  return results.map((result) => {
    const { idx } = result;
    const data24 = {
      item: docs[idx],
      refIndex: idx
    };
    if (transformers.length) {
      transformers.forEach((transformer) => {
        transformer(result, data24);
      });
    }
    return data24;
  });
}
__name(format, "format");
class Fuse {
  static {
    __name(this, "Fuse");
  }
  constructor(docs, options4 = {}, index2) {
    this.options = { ...Config, ...options4 };
    if (this.options.useExtendedSearch && false) {
      throw new Error(EXTENDED_SEARCH_UNAVAILABLE);
    }
    this._keyStore = new KeyStore(this.options.keys);
    this.setCollection(docs, index2);
  }
  setCollection(docs, index2) {
    this._docs = docs;
    if (index2 && !(index2 instanceof FuseIndex)) {
      throw new Error(INCORRECT_INDEX_TYPE);
    }
    this._myIndex = index2 || createIndex(this.options.keys, this._docs, {
      getFn: this.options.getFn,
      fieldNormWeight: this.options.fieldNormWeight
    });
  }
  add(doc2) {
    if (!isDefined(doc2)) {
      return;
    }
    this._docs.push(doc2);
    this._myIndex.add(doc2);
  }
  remove(predicate = () => false) {
    const results = [];
    for (let i2 = 0, len = this._docs.length; i2 < len; i2 += 1) {
      const doc2 = this._docs[i2];
      if (predicate(doc2, i2)) {
        this.removeAt(i2);
        i2 -= 1;
        len -= 1;
        results.push(doc2);
      }
    }
    return results;
  }
  removeAt(idx) {
    this._docs.splice(idx, 1);
    this._myIndex.removeAt(idx);
  }
  getIndex() {
    return this._myIndex;
  }
  search(query, { limit = -1 } = {}) {
    const {
      includeMatches,
      includeScore,
      shouldSort,
      sortFn,
      ignoreFieldNorm
    } = this.options;
    let results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);
    computeScore(results, { ignoreFieldNorm });
    if (shouldSort) {
      results.sort(sortFn);
    }
    if (isNumber(limit) && limit > -1) {
      results = results.slice(0, limit);
    }
    return format(results, this._docs, {
      includeMatches,
      includeScore
    });
  }
  _searchStringList(query) {
    const searcher = createSearcher(query, this.options);
    const { records } = this._myIndex;
    const results = [];
    records.forEach(({ v: text2, i: idx, n: norm2 }) => {
      if (!isDefined(text2)) {
        return;
      }
      const { isMatch, score, indices } = searcher.searchIn(text2);
      if (isMatch) {
        results.push({
          item: text2,
          idx,
          matches: [{ score, value: text2, norm: norm2, indices }]
        });
      }
    });
    return results;
  }
  _searchLogical(query) {
    const expression = parse(query, this.options);
    const evaluate = /* @__PURE__ */ __name((node3, item3, idx) => {
      if (!node3.children) {
        const { keyId, searcher } = node3;
        const matches2 = this._findMatches({
          key: this._keyStore.get(keyId),
          value: this._myIndex.getValueForItemAtKeyId(item3, keyId),
          searcher
        });
        if (matches2 && matches2.length) {
          return [
            {
              idx,
              item: item3,
              matches: matches2
            }
          ];
        }
        return [];
      }
      const res = [];
      for (let i2 = 0, len = node3.children.length; i2 < len; i2 += 1) {
        const child = node3.children[i2];
        const result = evaluate(child, item3, idx);
        if (result.length) {
          res.push(...result);
        } else if (node3.operator === LogicalOperator.AND) {
          return [];
        }
      }
      return res;
    }, "evaluate");
    const records = this._myIndex.records;
    const resultMap = {};
    const results = [];
    records.forEach(({ $: item3, i: idx }) => {
      if (isDefined(item3)) {
        let expResults = evaluate(expression, item3, idx);
        if (expResults.length) {
          if (!resultMap[idx]) {
            resultMap[idx] = { idx, item: item3, matches: [] };
            results.push(resultMap[idx]);
          }
          expResults.forEach(({ matches: matches2 }) => {
            resultMap[idx].matches.push(...matches2);
          });
        }
      }
    });
    return results;
  }
  _searchObjectList(query) {
    const searcher = createSearcher(query, this.options);
    const { keys: keys2, records } = this._myIndex;
    const results = [];
    records.forEach(({ $: item3, i: idx }) => {
      if (!isDefined(item3)) {
        return;
      }
      let matches2 = [];
      keys2.forEach((key, keyIndex) => {
        matches2.push(
          ...this._findMatches({
            key,
            value: item3[keyIndex],
            searcher
          })
        );
      });
      if (matches2.length) {
        results.push({
          idx,
          item: item3,
          matches: matches2
        });
      }
    });
    return results;
  }
  _findMatches({ key, value: value4, searcher }) {
    if (!isDefined(value4)) {
      return [];
    }
    let matches2 = [];
    if (isArray(value4)) {
      value4.forEach(({ v: text2, i: idx, n: norm2 }) => {
        if (!isDefined(text2)) {
          return;
        }
        const { isMatch, score, indices } = searcher.searchIn(text2);
        if (isMatch) {
          matches2.push({
            score,
            key,
            value: text2,
            idx,
            norm: norm2,
            indices
          });
        }
      });
    } else {
      const { v: text2, n: norm2 } = value4;
      const { isMatch, score, indices } = searcher.searchIn(text2);
      if (isMatch) {
        matches2.push({ score, key, value: text2, norm: norm2, indices });
      }
    }
    return matches2;
  }
}
Fuse.version = "7.0.0";
Fuse.createIndex = createIndex;
Fuse.parseIndex = parseIndex;
Fuse.config = Config;
{
  Fuse.parseQuery = parse;
}
{
  register$1(ExtendedSearch);
}
class FuseSearch {
  static {
    __name(this, "FuseSearch");
  }
  fuse;
  keys;
  data;
  advancedScoring;
  constructor(data24, options4, createIndex2 = true, advancedScoring = false) {
    this.data = data24;
    this.keys = options4.keys ?? [];
    this.advancedScoring = advancedScoring;
    const index2 = createIndex2 && options4?.keys ? Fuse.createIndex(options4.keys, data24) : void 0;
    this.fuse = new Fuse(data24, options4, index2);
  }
  search(query, options4) {
    const fuseResult = !query ? this.data.map((x2) => ({ item: x2, score: 0 })) : this.fuse.search(query, options4);
    if (!this.advancedScoring) {
      return fuseResult.map((x2) => x2.item);
    }
    const aux = fuseResult.map((x2) => ({
      item: x2.item,
      scores: this.calcAuxScores(query.toLocaleLowerCase(), x2.item, x2.score)
    })).sort((a, b) => this.compareAux(a.scores, b.scores));
    return aux.map((x2) => x2.item);
  }
  calcAuxScores(query, entry, score) {
    let values = [];
    if (!this.keys.length) values = [entry];
    else values = this.keys.map((x2) => entry[x2]);
    const scores = values.map((x2) => this.calcAuxSingle(query, x2, score));
    let result = scores.sort(this.compareAux)[0];
    const deprecated = values.some(
      (x2) => x2.toLocaleLowerCase().includes("deprecated")
    );
    result[0] += deprecated && result[0] != 0 ? 5 : 0;
    if (entry["postProcessSearchScores"]) {
      result = entry["postProcessSearchScores"](result);
    }
    return result;
  }
  calcAuxSingle(query, item3, score) {
    const itemWords = item3.split(/ |\b|(?<=[a-z])(?=[A-Z])|(?=[A-Z][a-z])/).map((x2) => x2.toLocaleLowerCase());
    const queryParts = query.split(" ");
    item3 = item3.toLocaleLowerCase();
    let main = 9;
    let aux1 = 0;
    let aux2 = 0;
    if (item3 == query) {
      main = 0;
    } else if (item3.startsWith(query)) {
      main = 1;
      aux2 = item3.length;
    } else if (itemWords.includes(query)) {
      main = 2;
      aux1 = item3.indexOf(query) + item3.length * 0.5;
      aux2 = item3.length;
    } else if (item3.includes(query)) {
      main = 3;
      aux1 = item3.indexOf(query) + item3.length * 0.5;
      aux2 = item3.length;
    } else if (queryParts.every((x2) => itemWords.includes(x2))) {
      const indexes = queryParts.map((x2) => itemWords.indexOf(x2));
      const min = Math.min(...indexes);
      const max = Math.max(...indexes);
      main = 4;
      aux1 = max - min + max * 0.5 + item3.length * 0.5;
      aux2 = item3.length;
    } else if (queryParts.every((x2) => item3.includes(x2))) {
      const min = Math.min(...queryParts.map((x2) => item3.indexOf(x2)));
      const max = Math.max(...queryParts.map((x2) => item3.indexOf(x2) + x2.length));
      main = 5;
      aux1 = max - min + max * 0.5 + item3.length * 0.5;
      aux2 = item3.length;
    }
    const lengthPenalty = 0.2 * (1 - Math.min(item3.length, query.length) / Math.max(item3.length, query.length));
    return [main, aux1, aux2, score + lengthPenalty];
  }
  compareAux(a, b) {
    for (let i2 = 0; i2 < Math.min(a.length, b.length); i2++) {
      if (a[i2] !== b[i2]) {
        return a[i2] - b[i2];
      }
    }
    return a.length - b.length;
  }
}
class NodeFilter {
  static {
    __name(this, "NodeFilter");
  }
  constructor(id3, name2, invokeSequence, longInvokeSequence, nodeOptions, nodeDefs, options4) {
    this.id = id3;
    this.name = name2;
    this.invokeSequence = invokeSequence;
    this.longInvokeSequence = longInvokeSequence;
    this.nodeOptions = nodeOptions;
    this.fuseSearch = new FuseSearch(this.getAllNodeOptions(nodeDefs), options4);
  }
  fuseSearch;
  getNodeOptions(node3) {
    return this.nodeOptions instanceof Function ? this.nodeOptions(node3) : this.nodeOptions;
  }
  getAllNodeOptions(nodeDefs) {
    return [
      ...new Set(
        nodeDefs.reduce((acc, nodeDef) => {
          return [...acc, ...this.getNodeOptions(nodeDef)];
        }, [])
      )
    ];
  }
  matches(node3, value4, extraOptions) {
    const matchWildcards = extraOptions?.matchWildcards !== false;
    if (matchWildcards && value4 === "*") {
      return true;
    }
    const options4 = this.getNodeOptions(node3);
    return options4.includes(value4) || matchWildcards && _.some(options4, (option3) => option3 === "*");
  }
}
class NodeSearchService {
  static {
    __name(this, "NodeSearchService");
  }
  nodeFuseSearch;
  nodeFilters;
  constructor(data24) {
    this.nodeFuseSearch = new FuseSearch(
      data24,
      {
        keys: ["name", "display_name"],
        includeScore: true,
        threshold: 0.3,
        shouldSort: false,
        useExtendedSearch: true
      },
      true,
      true
    );
    const filterSearchOptions = {
      includeScore: true,
      threshold: 0.3,
      shouldSort: true
    };
    const inputTypeFilter = new NodeFilter(
      /* id */
      "input",
      /* name */
      "Input Type",
      /* invokeSequence */
      "i",
      /* longInvokeSequence */
      "input",
      (node3) => node3.inputs.all.map((input) => input.type),
      data24,
      filterSearchOptions
    );
    const outputTypeFilter = new NodeFilter(
      /* id */
      "output",
      /* name */
      "Output Type",
      /* invokeSequence */
      "o",
      /* longInvokeSequence */
      "output",
      (node3) => node3.outputs.all.map((output) => output.type),
      data24,
      filterSearchOptions
    );
    const nodeCategoryFilter = new NodeFilter(
      /* id */
      "category",
      /* name */
      "Category",
      /* invokeSequence */
      "c",
      /* longInvokeSequence */
      "category",
      (node3) => [node3.category],
      data24,
      filterSearchOptions
    );
    const nodeSourceFilter = new NodeFilter(
      /* id */
      "source",
      /* name */
      "Source",
      /* invokeSequence */
      "s",
      /* longInvokeSequence */
      "source",
      (node3) => [node3.nodeSource.displayText],
      data24,
      filterSearchOptions
    );
    this.nodeFilters = [
      inputTypeFilter,
      outputTypeFilter,
      nodeCategoryFilter,
      nodeSourceFilter
    ];
  }
  endsWithFilterStartSequence(query) {
    return query.endsWith(":");
  }
  searchNode(query, filters = [], options4, extraOptions) {
    const matchedNodes = this.nodeFuseSearch.search(query);
    const results = matchedNodes.filter((node3) => {
      return _.every(filters, (filterAndValue) => {
        const [filter4, value4] = filterAndValue;
        return filter4.matches(node3, value4, extraOptions);
      });
    });
    return options4?.limit ? results.slice(0, options4.limit) : results;
  }
  getFilterById(id3) {
    return this.nodeFilters.find((filter4) => filter4.id === id3);
  }
}
class ComfyInputsSpec {
  static {
    __name(this, "ComfyInputsSpec");
  }
  required;
  optional;
  hidden;
  constructor(obj) {
    this.required = ComfyInputsSpec.transformInputSpecRecord(obj.required ?? {});
    this.optional = ComfyInputsSpec.transformInputSpecRecord(obj.optional ?? {});
    this.hidden = obj.hidden;
  }
  static transformInputSpecRecord(record) {
    const result = {};
    for (const [key, value4] of Object.entries(record)) {
      result[key] = ComfyInputsSpec.transformSingleInputSpec(key, value4);
    }
    return result;
  }
  static isInputSpec(obj) {
    return Array.isArray(obj) && obj.length >= 1 && (typeof obj[0] === "string" || Array.isArray(obj[0]));
  }
  static transformSingleInputSpec(name2, value4) {
    if (!ComfyInputsSpec.isInputSpec(value4)) return value4;
    const [typeRaw, _spec] = value4;
    const spec = _spec ?? {};
    const type = Array.isArray(typeRaw) ? "COMBO" : value4[0];
    switch (type) {
      case "COMBO":
        return {
          name: name2,
          type,
          ...spec,
          comboOptions: typeRaw,
          default: spec.default ?? typeRaw[0]
        };
      case "INT":
      case "FLOAT":
      case "BOOLEAN":
      case "STRING":
      default:
        return { name: name2, type, ...spec };
    }
  }
  get all() {
    return [...Object.values(this.required), ...Object.values(this.optional)];
  }
  getInput(name2) {
    return this.required[name2] ?? this.optional[name2];
  }
}
class ComfyOutputSpec {
  static {
    __name(this, "ComfyOutputSpec");
  }
  constructor(index2, name2, type, is_list, comboOptions, tooltip) {
    this.index = index2;
    this.name = name2;
    this.type = type;
    this.is_list = is_list;
    this.comboOptions = comboOptions;
    this.tooltip = tooltip;
  }
}
class ComfyOutputsSpec {
  static {
    __name(this, "ComfyOutputsSpec");
  }
  constructor(outputs) {
    this.outputs = outputs;
  }
  get all() {
    return this.outputs;
  }
}
class ComfyNodeDefImpl {
  static {
    __name(this, "ComfyNodeDefImpl");
  }
  // ComfyNodeDef fields
  name;
  display_name;
  /**
   * Category is not marked as readonly as the bookmark system
   * needs to write to it to assign a node to a custom folder.
   */
  category;
  python_module;
  description;
  deprecated;
  experimental;
  output_node;
  /**
   * @deprecated Use `inputs` instead
   */
  input;
  /**
   * @deprecated Use `outputs` instead
   */
  output;
  /**
   * @deprecated Use `outputs[n].is_list` instead
   */
  output_is_list;
  /**
   * @deprecated Use `outputs[n].name` instead
   */
  output_name;
  /**
   * @deprecated Use `outputs[n].tooltip` instead
   */
  output_tooltips;
  // ComfyNodeDefImpl fields
  inputs;
  outputs;
  nodeSource;
  constructor(obj) {
    this.name = obj.name;
    this.display_name = obj.display_name;
    this.category = obj.category;
    this.python_module = obj.python_module;
    this.description = obj.description;
    this.deprecated = obj.deprecated ?? obj.category === "";
    this.experimental = obj.experimental ?? obj.category.startsWith("_for_testing");
    this.output_node = obj.output_node;
    this.input = obj.input ?? {};
    this.output = obj.output ?? [];
    this.output_is_list = obj.output_is_list;
    this.output_name = obj.output_name;
    this.output_tooltips = obj.output_tooltips;
    this.inputs = new ComfyInputsSpec(obj.input ?? {});
    this.outputs = ComfyNodeDefImpl.transformOutputSpec(obj);
    this.nodeSource = getNodeSource(obj.python_module);
  }
  static transformOutputSpec(obj) {
    const { output, output_is_list, output_name, output_tooltips } = obj;
    const result = (output ?? []).map((type, index2) => {
      const typeString = Array.isArray(type) ? "COMBO" : type;
      return new ComfyOutputSpec(
        index2,
        output_name?.[index2],
        typeString,
        output_is_list?.[index2],
        Array.isArray(type) ? type : void 0,
        output_tooltips?.[index2]
      );
    });
    return new ComfyOutputsSpec(result);
  }
  get nodePath() {
    return (this.category ? this.category + "/" : "") + this.name;
  }
  get isDummyFolder() {
    return this.name === "";
  }
  postProcessSearchScores(scores) {
    const nodeFrequencyStore = useNodeFrequencyStore();
    const nodeFrequency = nodeFrequencyStore.getNodeFrequencyByName(this.name);
    return [scores[0], -nodeFrequency, ...scores.slice(1)];
  }
  get isCoreNode() {
    return this.nodeSource.type === NodeSourceType.Core;
  }
  get nodeLifeCycleBadgeText() {
    if (this.deprecated) return "[DEPR]";
    if (this.experimental) return "[BETA]";
    return "";
  }
}
const SYSTEM_NODE_DEFS = {
  PrimitiveNode: {
    name: "PrimitiveNode",
    display_name: "Primitive",
    category: "utils",
    input: { required: {}, optional: {} },
    output: ["*"],
    output_name: ["connect to widget input"],
    output_is_list: [false],
    output_node: false,
    python_module: "nodes",
    description: "Primitive values like numbers, strings, and booleans."
  },
  Reroute: {
    name: "Reroute",
    display_name: "Reroute",
    category: "utils",
    input: { required: { "": ["*"] }, optional: {} },
    output: ["*"],
    output_name: [""],
    output_is_list: [false],
    output_node: false,
    python_module: "nodes",
    description: "Reroute the connection to another node."
  },
  Note: {
    name: "Note",
    display_name: "Note",
    category: "utils",
    input: { required: {}, optional: {} },
    output: [],
    output_name: [],
    output_is_list: [],
    output_node: false,
    python_module: "nodes",
    description: "Node that add notes to your project"
  },
  MarkdownNote: {
    name: "MarkdownNote",
    display_name: "Markdown Note",
    category: "utils",
    input: { required: {}, optional: {} },
    output: [],
    output_name: [],
    output_is_list: [],
    output_node: false,
    python_module: "nodes",
    description: "Node that add notes to your project. Reformats text as markdown."
  }
};
function buildNodeDefTree(nodeDefs) {
  return buildTree$1(
    nodeDefs,
    (nodeDef) => nodeDef.nodePath.split("/")
  );
}
__name(buildNodeDefTree, "buildNodeDefTree");
function createDummyFolderNodeDef(folderPath) {
  return new ComfyNodeDefImpl({
    name: "",
    display_name: "",
    category: folderPath.endsWith("/") ? folderPath.slice(0, -1) : folderPath,
    python_module: "nodes",
    description: "Dummy Folder Node (User should never see this string)",
    input: {},
    output: [],
    output_name: [],
    output_is_list: [],
    output_node: false
  });
}
__name(createDummyFolderNodeDef, "createDummyFolderNodeDef");
const useNodeDefStore = /* @__PURE__ */ defineStore("nodeDef", () => {
  const nodeDefsByName = ref({});
  const nodeDefsByDisplayName = ref({});
  const showDeprecated = ref(false);
  const showExperimental = ref(false);
  const nodeDefs = computed(() => Object.values(nodeDefsByName.value));
  const nodeDataTypes = computed(() => {
    const types = /* @__PURE__ */ new Set();
    for (const nodeDef of nodeDefs.value) {
      for (const input of nodeDef.inputs.all) {
        types.add(input.type);
      }
      for (const output of nodeDef.outputs.all) {
        types.add(output.type);
      }
    }
    return types;
  });
  const visibleNodeDefs = computed(
    () => nodeDefs.value.filter(
      (nodeDef) => (showDeprecated.value || !nodeDef.deprecated) && (showExperimental.value || !nodeDef.experimental)
    )
  );
  const nodeSearchService = computed(
    () => new NodeSearchService(visibleNodeDefs.value)
  );
  const nodeTree = computed(() => buildNodeDefTree(visibleNodeDefs.value));
  function updateNodeDefs(nodeDefs2) {
    const newNodeDefsByName = {};
    const newNodeDefsByDisplayName = {};
    for (const nodeDef of nodeDefs2) {
      try {
        const nodeDefImpl = new ComfyNodeDefImpl(nodeDef);
        newNodeDefsByName[nodeDef.name] = nodeDefImpl;
        newNodeDefsByDisplayName[nodeDef.display_name] = nodeDefImpl;
      } catch (e2) {
        console.error("Error adding nodeDef:", e2);
      }
    }
    nodeDefsByName.value = newNodeDefsByName;
    nodeDefsByDisplayName.value = newNodeDefsByDisplayName;
  }
  __name(updateNodeDefs, "updateNodeDefs");
  function addNodeDef(nodeDef) {
    const nodeDefImpl = new ComfyNodeDefImpl(nodeDef);
    nodeDefsByName.value[nodeDef.name] = nodeDefImpl;
    nodeDefsByDisplayName.value[nodeDef.display_name] = nodeDefImpl;
  }
  __name(addNodeDef, "addNodeDef");
  function fromLGraphNode(node3) {
    return nodeDefsByName.value[node3.constructor?.nodeData?.name] ?? null;
  }
  __name(fromLGraphNode, "fromLGraphNode");
  return {
    nodeDefsByName,
    nodeDefsByDisplayName,
    showDeprecated,
    showExperimental,
    nodeDefs,
    nodeDataTypes,
    visibleNodeDefs,
    nodeSearchService,
    nodeTree,
    updateNodeDefs,
    addNodeDef,
    fromLGraphNode
  };
});
const useNodeFrequencyStore = /* @__PURE__ */ defineStore("nodeFrequency", () => {
  const topNodeDefLimit = ref(64);
  const nodeFrequencyLookup = ref({});
  const nodeNamesByFrequency = computed(
    () => Object.keys(nodeFrequencyLookup.value)
  );
  const isLoaded = ref(false);
  const loadNodeFrequencies = /* @__PURE__ */ __name(async () => {
    if (!isLoaded.value) {
      try {
        const response = await axios.get("assets/sorted-custom-node-map.json");
        nodeFrequencyLookup.value = response.data;
        isLoaded.value = true;
      } catch (error2) {
        console.error("Error loading node frequencies:", error2);
      }
    }
  }, "loadNodeFrequencies");
  const getNodeFrequency = /* @__PURE__ */ __name((nodeDef) => {
    return getNodeFrequencyByName(nodeDef.name);
  }, "getNodeFrequency");
  const getNodeFrequencyByName = /* @__PURE__ */ __name((nodeName) => {
    return nodeFrequencyLookup.value[nodeName] ?? 0;
  }, "getNodeFrequencyByName");
  const nodeDefStore = useNodeDefStore();
  const topNodeDefs = computed(() => {
    return nodeNamesByFrequency.value.map((nodeName) => nodeDefStore.nodeDefsByName[nodeName]).filter((nodeDef) => nodeDef !== void 0).slice(0, topNodeDefLimit.value);
  });
  return {
    nodeNamesByFrequency,
    topNodeDefs,
    isLoaded,
    loadNodeFrequencies,
    getNodeFrequency,
    getNodeFrequencyByName
  };
});
function rgbToHsl({ r, g: g2, b }) {
  r /= 255;
  g2 /= 255;
  b /= 255;
  const max = Math.max(r, g2, b), min = Math.min(r, g2, b);
  let h2 = 0, s = 0;
  const l = (max + min) / 2;
  if (max !== min) {
    const d = max - min;
    s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
    switch (max) {
      case r:
        h2 = (g2 - b) / d + (g2 < b ? 6 : 0);
        break;
      case g2:
        h2 = (b - r) / d + 2;
        break;
      case b:
        h2 = (r - g2) / d + 4;
        break;
    }
    h2 /= 6;
  }
  return { h: h2, s, l };
}
__name(rgbToHsl, "rgbToHsl");
function hexToRgb(hex) {
  let r = 0, g2 = 0, b = 0;
  if (hex.length == 4) {
    r = parseInt(hex[1] + hex[1], 16);
    g2 = parseInt(hex[2] + hex[2], 16);
    b = parseInt(hex[3] + hex[3], 16);
  } else if (hex.length == 7) {
    r = parseInt(hex.slice(1, 3), 16);
    g2 = parseInt(hex.slice(3, 5), 16);
    b = parseInt(hex.slice(5, 7), 16);
  }
  return { r, g: g2, b };
}
__name(hexToRgb, "hexToRgb");
const identifyColorFormat = /* @__PURE__ */ __name((color2) => {
  if (!color2) return null;
  if (color2.startsWith("#") && (color2.length === 4 || color2.length === 7))
    return "hex";
  if (/rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*/.test(color2))
    return color2.includes("rgba") ? "rgba" : "rgb";
  if (/hsla?\(\s*\d+(\.\d+)?\s*,\s*\d+(\.\d+)?%\s*,\s*\d+(\.\d+)?%/.test(color2))
    return color2.includes("hsla") ? "hsla" : "hsl";
  return null;
}, "identifyColorFormat");
const isHSLA = /* @__PURE__ */ __name((color2) => {
  if (typeof color2 !== "object" || color2 === null) return false;
  return ["h", "s", "l", "a"].every(
    (key) => typeof color2[key] === "number" && !isNaN(color2[key])
  );
}, "isHSLA");
function parseToHSLA(color2, format2) {
  let match2;
  switch (format2) {
    case "hex": {
      const hsl = rgbToHsl(hexToRgb(color2));
      return {
        h: Math.round(hsl.h * 360),
        s: +(hsl.s * 100).toFixed(1),
        l: +(hsl.l * 100).toFixed(1),
        a: 1
      };
    }
    case "rgb":
    case "rgba": {
      match2 = color2.match(/\d+(\.\d+)?/g);
      if (!match2 || match2.length < 3) return null;
      const [r, g2, b] = match2.map(Number);
      const hsl = rgbToHsl({ r, g: g2, b });
      const a = format2 === "rgba" && match2[3] ? parseFloat(match2[3]) : 1;
      return {
        h: Math.round(hsl.h * 360),
        s: +(hsl.s * 100).toFixed(1),
        l: +(hsl.l * 100).toFixed(1),
        a
      };
    }
    case "hsl":
    case "hsla": {
      match2 = color2.match(/\d+(\.\d+)?/g);
      if (!match2 || match2.length < 3) return null;
      const [h2, s, l] = match2.map(Number);
      const a = format2 === "hsla" && match2[3] ? parseFloat(match2[3]) : 1;
      return { h: h2, s, l, a };
    }
    default:
      return null;
  }
}
__name(parseToHSLA, "parseToHSLA");
const applyColorAdjustments = /* @__PURE__ */ __name((color2, options4) => {
  if (!Object.keys(options4).length) return color2;
  const format2 = identifyColorFormat(color2);
  if (!format2) {
    console.warn(`Unsupported color format in color palette: ${color2}`);
    return color2;
  }
  const hsla = parseToHSLA(color2, format2);
  if (!isHSLA(hsla)) {
    console.warn(`Invalid color values in color palette: ${color2}`);
    return color2;
  }
  if (options4.lightness) {
    hsla.l = Math.max(0, Math.min(100, hsla.l + options4.lightness * 100));
  }
  if (options4.opacity) {
    hsla.a = Math.max(0, Math.min(1, options4.opacity));
  }
  return `hsla(${hsla.h}, ${hsla.s}%, ${hsla.l}%, ${hsla.a})`;
}, "applyColorAdjustments");
const adjustColor = lodashExports.memoize(
  applyColorAdjustments,
  (color2, options4) => `${color2}-${JSON.stringify(options4)}`
);
function serialise(nodes, graph) {
  const serialisable = {
    nodes: [],
    links: []
  };
  let index2 = 0;
  const cloneable = [];
  for (const node3 of nodes) {
    if (node3.clonable === false) continue;
    node3._relative_id = index2++;
    cloneable.push(node3);
  }
  for (const node3 of cloneable) {
    const cloned = node3.clone();
    if (!cloned) {
      console.warn("node type not found: " + node3.type);
      continue;
    }
    serialisable.nodes.push(cloned.serialize());
    if (!node3.inputs?.length) continue;
    for (const input of node3.inputs) {
      if (!input || input.link == null) continue;
      const link2 = graph.links.get(input.link);
      if (!link2) continue;
      const outNode = graph.getNodeById(link2.origin_id);
      if (!outNode) continue;
      serialisable.links.push([
        outNode._relative_id,
        link2.origin_slot,
        node3._relative_id,
        link2.target_slot,
        outNode.id
      ]);
    }
  }
  return JSON.stringify(serialisable);
}
__name(serialise, "serialise");
function deserialiseAndCreate(data24, canvas) {
  if (!data24) return;
  const { graph, graph_mouse } = canvas;
  canvas.emitBeforeChange();
  try {
    graph.beforeChange();
    const deserialised = JSON.parse(data24);
    const topLeft = [Infinity, Infinity];
    for (const { pos: pos2 } of deserialised.nodes) {
      if (topLeft[0] > pos2[0]) topLeft[0] = pos2[0];
      if (topLeft[1] > pos2[1]) topLeft[1] = pos2[1];
    }
    if (!Number.isFinite(topLeft[0]) || !Number.isFinite(topLeft[1])) {
      topLeft[0] = graph_mouse[0];
      topLeft[1] = graph_mouse[1];
    }
    const nodes = [];
    for (const info of deserialised.nodes) {
      const node3 = LiteGraph.createNode(info.type);
      if (!node3) continue;
      node3.configure(info);
      node3.pos[0] += graph_mouse[0] - topLeft[0];
      node3.pos[1] += graph_mouse[1] - topLeft[1];
      graph.add(node3, true);
      nodes.push(node3);
    }
    for (const info of deserialised.links) {
      const relativeId = info[0];
      const outNode = relativeId != null ? nodes[relativeId] : void 0;
      const inNode = nodes[info[2]];
      if (outNode && inNode) outNode.connect(info[1], inNode, info[3]);
      else console.warn("Warning, nodes missing on pasting");
    }
    canvas.selectNodes(nodes);
    graph.afterChange();
  } finally {
    canvas.emitAfterChange();
  }
}
__name(deserialiseAndCreate, "deserialiseAndCreate");
function getFromFlacBuffer(buffer2) {
  const dataView = new DataView(buffer2);
  const signature = String.fromCharCode(...new Uint8Array(buffer2, 0, 4));
  if (signature !== "fLaC") {
    console.error("Not a valid FLAC file");
    return;
  }
  let offset = 4;
  let vorbisComment = null;
  while (offset < dataView.byteLength) {
    const isLastBlock = dataView.getUint8(offset) & 128;
    const blockType = dataView.getUint8(offset) & 127;
    const blockSize = dataView.getUint32(offset, false) & 16777215;
    offset += 4;
    if (blockType === 4) {
      vorbisComment = parseVorbisComment(
        new DataView(buffer2, offset, blockSize)
      );
    }
    offset += blockSize;
    if (isLastBlock) break;
  }
  return vorbisComment;
}
__name(getFromFlacBuffer, "getFromFlacBuffer");
function getFromFlacFile(file) {
  return new Promise((r) => {
    const reader = new FileReader();
    reader.onload = function(event) {
      const arrayBuffer = event.target.result;
      r(getFromFlacBuffer(arrayBuffer));
    };
    reader.readAsArrayBuffer(file);
  });
}
__name(getFromFlacFile, "getFromFlacFile");
function parseVorbisComment(dataView) {
  let offset = 0;
  const vendorLength = dataView.getUint32(offset, true);
  offset += 4;
  const vendorString = getString(dataView, offset, vendorLength);
  offset += vendorLength;
  const userCommentListLength = dataView.getUint32(offset, true);
  offset += 4;
  const comments = {};
  for (let i2 = 0; i2 < userCommentListLength; i2++) {
    const commentLength = dataView.getUint32(offset, true);
    offset += 4;
    const comment2 = getString(dataView, offset, commentLength);
    offset += commentLength;
    const ind = comment2.indexOf("=");
    const key = comment2.substring(0, ind);
    comments[key] = comment2.substring(ind + 1);
  }
  return comments;
}
__name(parseVorbisComment, "parseVorbisComment");
function getString(dataView, offset, length) {
  let string = "";
  for (let i2 = 0; i2 < length; i2++) {
    string += String.fromCharCode(dataView.getUint8(offset + i2));
  }
  return string;
}
__name(getString, "getString");
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.flac = window.comfyAPI.flac || {};
window.comfyAPI.flac.getFromFlacBuffer = getFromFlacBuffer;
window.comfyAPI.flac.getFromFlacFile = getFromFlacFile;
function getFromPngBuffer(buffer2) {
  const pngData = new Uint8Array(buffer2);
  const dataView = new DataView(pngData.buffer);
  if (dataView.getUint32(0) !== 2303741511) {
    console.error("Not a valid PNG file");
    return;
  }
  let offset = 8;
  let txt_chunks = {};
  while (offset < pngData.length) {
    const length = dataView.getUint32(offset);
    const type = String.fromCharCode(...pngData.slice(offset + 4, offset + 8));
    if (type === "tEXt" || type == "comf" || type === "iTXt") {
      let keyword_end = offset + 8;
      while (pngData[keyword_end] !== 0) {
        keyword_end++;
      }
      const keyword = String.fromCharCode(
        ...pngData.slice(offset + 8, keyword_end)
      );
      const contentArraySegment = pngData.slice(
        keyword_end + 1,
        offset + 8 + length
      );
      const contentJson = new TextDecoder("utf-8").decode(contentArraySegment);
      txt_chunks[keyword] = contentJson;
    }
    offset += 12 + length;
  }
  return txt_chunks;
}
__name(getFromPngBuffer, "getFromPngBuffer");
function getFromPngFile(file) {
  return new Promise((r) => {
    const reader = new FileReader();
    reader.onload = (event) => {
      r(getFromPngBuffer(event.target.result));
    };
    reader.readAsArrayBuffer(file);
  });
}
__name(getFromPngFile, "getFromPngFile");
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.png = window.comfyAPI.png || {};
window.comfyAPI.png.getFromPngBuffer = getFromPngBuffer;
window.comfyAPI.png.getFromPngFile = getFromPngFile;
function getPngMetadata(file) {
  return getFromPngFile(file);
}
__name(getPngMetadata, "getPngMetadata");
function getFlacMetadata(file) {
  return getFromFlacFile(file);
}
__name(getFlacMetadata, "getFlacMetadata");
function parseExifData(exifData) {
  const isLittleEndian = String.fromCharCode(...exifData.slice(0, 2)) === "II";
  function readInt(offset, isLittleEndian2, length) {
    let arr = exifData.slice(offset, offset + length);
    if (length === 2) {
      return new DataView(arr.buffer, arr.byteOffset, arr.byteLength).getUint16(
        0,
        isLittleEndian2
      );
    } else if (length === 4) {
      return new DataView(arr.buffer, arr.byteOffset, arr.byteLength).getUint32(
        0,
        isLittleEndian2
      );
    }
  }
  __name(readInt, "readInt");
  const ifdOffset = readInt(4, isLittleEndian, 4);
  function parseIFD(offset) {
    const numEntries = readInt(offset, isLittleEndian, 2);
    const result = {};
    for (let i2 = 0; i2 < numEntries; i2++) {
      const entryOffset = offset + 2 + i2 * 12;
      const tag = readInt(entryOffset, isLittleEndian, 2);
      const type = readInt(entryOffset + 2, isLittleEndian, 2);
      const numValues = readInt(entryOffset + 4, isLittleEndian, 4);
      const valueOffset = readInt(entryOffset + 8, isLittleEndian, 4);
      let value4;
      if (type === 2) {
        value4 = new TextDecoder("utf-8").decode(
          exifData.subarray(valueOffset, valueOffset + numValues - 1)
        );
      }
      result[tag] = value4;
    }
    return result;
  }
  __name(parseIFD, "parseIFD");
  const ifdData = parseIFD(ifdOffset);
  return ifdData;
}
__name(parseExifData, "parseExifData");
function splitValues(input) {
  var output = {};
  for (var key in input) {
    var value4 = input[key];
    var splitValues2 = value4.split(":", 2);
    output[splitValues2[0]] = splitValues2[1];
  }
  return output;
}
__name(splitValues, "splitValues");
function getWebpMetadata(file) {
  return new Promise((r) => {
    const reader = new FileReader();
    reader.onload = (event) => {
      const webp = new Uint8Array(event.target.result);
      const dataView = new DataView(webp.buffer);
      if (dataView.getUint32(0) !== 1380533830 || dataView.getUint32(8) !== 1464156752) {
        console.error("Not a valid WEBP file");
        r({});
        return;
      }
      let offset = 12;
      let txt_chunks = {};
      while (offset < webp.length) {
        const chunk_length = dataView.getUint32(offset + 4, true);
        const chunk_type = String.fromCharCode(
          ...webp.slice(offset, offset + 4)
        );
        if (chunk_type === "EXIF") {
          if (String.fromCharCode(...webp.slice(offset + 8, offset + 8 + 6)) == "Exif\0\0") {
            offset += 6;
          }
          let data24 = parseExifData(
            webp.slice(offset + 8, offset + 8 + chunk_length)
          );
          for (var key in data24) {
            const value4 = data24[key];
            if (typeof value4 === "string") {
              const index2 = value4.indexOf(":");
              txt_chunks[value4.slice(0, index2)] = value4.slice(index2 + 1);
            }
          }
          break;
        }
        offset += 8 + chunk_length;
      }
      r(txt_chunks);
    };
    reader.readAsArrayBuffer(file);
  });
}
__name(getWebpMetadata, "getWebpMetadata");
function getLatentMetadata(file) {
  return new Promise((r) => {
    const reader = new FileReader();
    reader.onload = (event) => {
      const safetensorsData = new Uint8Array(event.target.result);
      const dataView = new DataView(safetensorsData.buffer);
      let header_size = dataView.getUint32(0, true);
      let offset = 8;
      let header3 = JSON.parse(
        new TextDecoder().decode(
          safetensorsData.slice(offset, offset + header_size)
        )
      );
      r(header3.__metadata__);
    };
    var slice2 = file.slice(0, 1024 * 1024 * 4);
    reader.readAsArrayBuffer(slice2);
  });
}
__name(getLatentMetadata, "getLatentMetadata");
async function importA1111(graph, parameters) {
  const p2 = parameters.lastIndexOf("\nSteps:");
  if (p2 > -1) {
    const embeddings = await api.getEmbeddings();
    const opts = parameters.substr(p2).split("\n")[1].match(
      new RegExp('\\s*([^:]+:\\s*([^"\\{].*?|".*?"|\\{.*?\\}))\\s*(,|$)', "g")
    ).reduce((p3, n) => {
      const s = n.split(":");
      if (s[1].endsWith(",")) {
        s[1] = s[1].substr(0, s[1].length - 1);
      }
      p3[s[0].trim().toLowerCase()] = s[1].trim();
      return p3;
    }, {});
    const p22 = parameters.lastIndexOf("\nNegative prompt:", p2);
    if (p22 > -1) {
      let positive = parameters.substr(0, p22).trim();
      let negative = parameters.substring(p22 + 18, p2).trim();
      const ckptNode = LiteGraph.createNode("CheckpointLoaderSimple");
      const clipSkipNode = LiteGraph.createNode("CLIPSetLastLayer");
      const positiveNode = LiteGraph.createNode("CLIPTextEncode");
      const negativeNode = LiteGraph.createNode("CLIPTextEncode");
      const samplerNode = LiteGraph.createNode("KSampler");
      const imageNode = LiteGraph.createNode("EmptyLatentImage");
      const vaeNode = LiteGraph.createNode("VAEDecode");
      const vaeLoaderNode = LiteGraph.createNode("VAELoader");
      const saveNode = LiteGraph.createNode("SaveImage");
      let hrSamplerNode = null;
      let hrSteps = null;
      const ceil64 = /* @__PURE__ */ __name((v2) => Math.ceil(v2 / 64) * 64, "ceil64");
      const getWidget = /* @__PURE__ */ __name((node3, name2) => {
        return node3.widgets.find((w) => w.name === name2);
      }, "getWidget");
      const setWidgetValue2 = /* @__PURE__ */ __name((node3, name2, value4, isOptionPrefix) => {
        const w = getWidget(node3, name2);
        if (isOptionPrefix) {
          const o = w.options.values.find((w2) => w2.startsWith(value4));
          if (o) {
            w.value = o;
          } else {
            console.warn(`Unknown value '${value4}' for widget '${name2}'`, node3);
            w.value = value4;
          }
        } else {
          w.value = value4;
        }
      }, "setWidgetValue");
      const createLoraNodes = /* @__PURE__ */ __name((clipNode, text2, prevClip, prevModel) => {
        const loras = [];
        text2 = text2.replace(/<lora:([^:]+:[^>]+)>/g, function(m, c) {
          const s = c.split(":");
          const weight = parseFloat(s[1]);
          if (isNaN(weight)) {
            console.warn("Invalid LORA", m);
          } else {
            loras.push({ name: s[0], weight });
          }
          return "";
        });
        for (const l of loras) {
          const loraNode = LiteGraph.createNode("LoraLoader");
          graph.add(loraNode);
          setWidgetValue2(loraNode, "lora_name", l.name, true);
          setWidgetValue2(loraNode, "strength_model", l.weight);
          setWidgetValue2(loraNode, "strength_clip", l.weight);
          prevModel.node.connect(prevModel.index, loraNode, 0);
          prevClip.node.connect(prevClip.index, loraNode, 1);
          prevModel = { node: loraNode, index: 0 };
          prevClip = { node: loraNode, index: 1 };
        }
        prevClip.node.connect(1, clipNode, 0);
        prevModel.node.connect(0, samplerNode, 0);
        if (hrSamplerNode) {
          prevModel.node.connect(0, hrSamplerNode, 0);
        }
        return { text: text2, prevModel, prevClip };
      }, "createLoraNodes");
      const replaceEmbeddings = /* @__PURE__ */ __name((text2) => {
        if (!embeddings.length) return text2;
        return text2.replaceAll(
          new RegExp(
            "\\b(" + embeddings.map((e2) => e2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("\\b|\\b") + ")\\b",
            "ig"
          ),
          "embedding:$1"
        );
      }, "replaceEmbeddings");
      const popOpt = /* @__PURE__ */ __name((name2) => {
        const v2 = opts[name2];
        delete opts[name2];
        return v2;
      }, "popOpt");
      graph.clear();
      graph.add(ckptNode);
      graph.add(clipSkipNode);
      graph.add(positiveNode);
      graph.add(negativeNode);
      graph.add(samplerNode);
      graph.add(imageNode);
      graph.add(vaeNode);
      graph.add(vaeLoaderNode);
      graph.add(saveNode);
      ckptNode.connect(1, clipSkipNode, 0);
      clipSkipNode.connect(0, positiveNode, 0);
      clipSkipNode.connect(0, negativeNode, 0);
      ckptNode.connect(0, samplerNode, 0);
      positiveNode.connect(0, samplerNode, 1);
      negativeNode.connect(0, samplerNode, 2);
      imageNode.connect(0, samplerNode, 3);
      vaeNode.connect(0, saveNode, 0);
      samplerNode.connect(0, vaeNode, 0);
      vaeLoaderNode.connect(0, vaeNode, 1);
      const handlers2 = {
        model(v2) {
          setWidgetValue2(ckptNode, "ckpt_name", v2, true);
        },
        vae(v2) {
          setWidgetValue2(vaeLoaderNode, "vae_name", v2, true);
        },
        "cfg scale"(v2) {
          setWidgetValue2(samplerNode, "cfg", +v2);
        },
        "clip skip"(v2) {
          setWidgetValue2(clipSkipNode, "stop_at_clip_layer", -v2);
        },
        sampler(v2) {
          let name2 = v2.toLowerCase().replace("++", "pp").replaceAll(" ", "_");
          if (name2.includes("karras")) {
            name2 = name2.replace("karras", "").replace(/_+$/, "");
            setWidgetValue2(samplerNode, "scheduler", "karras");
          } else {
            setWidgetValue2(samplerNode, "scheduler", "normal");
          }
          const w = getWidget(samplerNode, "sampler_name");
          const o = w.options.values.find(
            (w2) => w2 === name2 || w2 === "sample_" + name2
          );
          if (o) {
            setWidgetValue2(samplerNode, "sampler_name", o);
          }
        },
        size(v2) {
          const wxh = v2.split("x");
          const w = ceil64(+wxh[0]);
          const h2 = ceil64(+wxh[1]);
          const hrUp = popOpt("hires upscale");
          const hrSz = popOpt("hires resize");
          hrSteps = popOpt("hires steps");
          let hrMethod = popOpt("hires upscaler");
          setWidgetValue2(imageNode, "width", w);
          setWidgetValue2(imageNode, "height", h2);
          if (hrUp || hrSz) {
            let uw, uh;
            if (hrUp) {
              uw = w * hrUp;
              uh = h2 * hrUp;
            } else {
              const s = hrSz.split("x");
              uw = +s[0];
              uh = +s[1];
            }
            let upscaleNode;
            let latentNode;
            if (hrMethod.startsWith("Latent")) {
              latentNode = upscaleNode = LiteGraph.createNode("LatentUpscale");
              graph.add(upscaleNode);
              samplerNode.connect(0, upscaleNode, 0);
              switch (hrMethod) {
                case "Latent (nearest-exact)":
                  hrMethod = "nearest-exact";
                  break;
              }
              setWidgetValue2(upscaleNode, "upscale_method", hrMethod, true);
            } else {
              const decode2 = LiteGraph.createNode("VAEDecodeTiled");
              graph.add(decode2);
              samplerNode.connect(0, decode2, 0);
              vaeLoaderNode.connect(0, decode2, 1);
              const upscaleLoaderNode = LiteGraph.createNode("UpscaleModelLoader");
              graph.add(upscaleLoaderNode);
              setWidgetValue2(upscaleLoaderNode, "model_name", hrMethod, true);
              const modelUpscaleNode = LiteGraph.createNode(
                "ImageUpscaleWithModel"
              );
              graph.add(modelUpscaleNode);
              decode2.connect(0, modelUpscaleNode, 1);
              upscaleLoaderNode.connect(0, modelUpscaleNode, 0);
              upscaleNode = LiteGraph.createNode("ImageScale");
              graph.add(upscaleNode);
              modelUpscaleNode.connect(0, upscaleNode, 0);
              const vaeEncodeNode = latentNode = LiteGraph.createNode("VAEEncodeTiled");
              graph.add(vaeEncodeNode);
              upscaleNode.connect(0, vaeEncodeNode, 0);
              vaeLoaderNode.connect(0, vaeEncodeNode, 1);
            }
            setWidgetValue2(upscaleNode, "width", ceil64(uw));
            setWidgetValue2(upscaleNode, "height", ceil64(uh));
            hrSamplerNode = LiteGraph.createNode("KSampler");
            graph.add(hrSamplerNode);
            ckptNode.connect(0, hrSamplerNode, 0);
            positiveNode.connect(0, hrSamplerNode, 1);
            negativeNode.connect(0, hrSamplerNode, 2);
            latentNode.connect(0, hrSamplerNode, 3);
            hrSamplerNode.connect(0, vaeNode, 0);
          }
        },
        steps(v2) {
          setWidgetValue2(samplerNode, "steps", +v2);
        },
        seed(v2) {
          setWidgetValue2(samplerNode, "seed", +v2);
        }
      };
      for (const opt in opts) {
        if (opt in handlers2) {
          handlers2[opt](popOpt(opt));
        }
      }
      if (hrSamplerNode) {
        setWidgetValue2(
          hrSamplerNode,
          "steps",
          hrSteps ? +hrSteps : getWidget(samplerNode, "steps").value
        );
        setWidgetValue2(
          hrSamplerNode,
          "cfg",
          getWidget(samplerNode, "cfg").value
        );
        setWidgetValue2(
          hrSamplerNode,
          "scheduler",
          getWidget(samplerNode, "scheduler").value
        );
        setWidgetValue2(
          hrSamplerNode,
          "sampler_name",
          getWidget(samplerNode, "sampler_name").value
        );
        setWidgetValue2(
          hrSamplerNode,
          "denoise",
          +(popOpt("denoising strength") || "1")
        );
      }
      let n = createLoraNodes(
        positiveNode,
        positive,
        { node: clipSkipNode, index: 0 },
        { node: ckptNode, index: 0 }
      );
      positive = n.text;
      n = createLoraNodes(negativeNode, negative, n.prevClip, n.prevModel);
      negative = n.text;
      setWidgetValue2(positiveNode, "text", replaceEmbeddings(positive));
      setWidgetValue2(negativeNode, "text", replaceEmbeddings(negative));
      graph.arrange();
      for (const opt of [
        "model hash",
        "ensd",
        "version",
        "vae hash",
        "ti hashes",
        "lora hashes",
        "hashes"
      ]) {
        delete opts[opt];
      }
      console.warn("Unhandled parameters:", opts);
    }
  }
}
__name(importA1111, "importA1111");
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.pnginfo = window.comfyAPI.pnginfo || {};
window.comfyAPI.pnginfo.getPngMetadata = getPngMetadata;
window.comfyAPI.pnginfo.getFlacMetadata = getFlacMetadata;
window.comfyAPI.pnginfo.getWebpMetadata = getWebpMetadata;
window.comfyAPI.pnginfo.getLatentMetadata = getLatentMetadata;
window.comfyAPI.pnginfo.importA1111 = importA1111;
class ComfyButtonGroup {
  static {
    __name(this, "ComfyButtonGroup");
  }
  element = $el("div.comfyui-button-group");
  buttons;
  constructor(...buttons) {
    this.buttons = prop(this, "buttons", buttons, () => this.update());
  }
  insert(button, index2) {
    this.buttons.splice(index2, 0, button);
    this.update();
  }
  append(button) {
    this.buttons.push(button);
    this.update();
  }
  remove(indexOrButton) {
    if (typeof indexOrButton !== "number") {
      indexOrButton = this.buttons.indexOf(indexOrButton);
    }
    if (indexOrButton > -1) {
      const r = this.buttons.splice(indexOrButton, 1);
      this.update();
      return r;
    }
  }
  update() {
    this.element.replaceChildren(...this.buttons.map((b) => b["element"] ?? b));
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.buttonGroup = window.comfyAPI.buttonGroup || {};
window.comfyAPI.buttonGroup.ComfyButtonGroup = ComfyButtonGroup;
function applyClasses(element, classList, ...requiredClasses) {
  classList ??= "";
  let str;
  if (typeof classList === "string") {
    str = classList;
  } else if (classList instanceof Array) {
    str = classList.join(" ");
  } else {
    str = Object.entries(classList).reduce((p2, c) => {
      if (c[1]) {
        p2 += (p2.length ? " " : "") + c[0];
      }
      return p2;
    }, "");
  }
  element.className = str;
  if (requiredClasses) {
    element.classList.add(...requiredClasses);
  }
}
__name(applyClasses, "applyClasses");
function toggleElement(element, {
  onHide: onHide3,
  onShow
} = {}) {
  let placeholder;
  let hidden;
  return (value4) => {
    if (value4) {
      if (hidden) {
        hidden = false;
        placeholder.replaceWith(element);
      }
      onShow?.(element, value4);
    } else {
      if (!placeholder) {
        placeholder = document.createComment("");
      }
      hidden = true;
      element.replaceWith(placeholder);
      onHide3?.(element);
    }
  };
}
__name(toggleElement, "toggleElement");
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.utils = window.comfyAPI.utils || {};
window.comfyAPI.utils.applyClasses = applyClasses;
window.comfyAPI.utils.toggleElement = toggleElement;
class ComfyButton {
  static {
    __name(this, "ComfyButton");
  }
  #over = 0;
  #popupOpen = false;
  isOver = false;
  iconElement = $el("i.mdi");
  contentElement = $el("span");
  popup;
  element;
  overIcon;
  iconSize;
  content;
  icon;
  tooltip;
  classList;
  hidden;
  enabled;
  action;
  constructor({
    icon: icon3,
    overIcon,
    iconSize,
    content: content2,
    tooltip,
    action,
    classList = "comfyui-button",
    visibilitySetting,
    app: app2,
    enabled = true
  }) {
    this.element = $el(
      "button",
      {
        onmouseenter: /* @__PURE__ */ __name(() => {
          this.isOver = true;
          if (this.overIcon) {
            this.updateIcon();
          }
        }, "onmouseenter"),
        onmouseleave: /* @__PURE__ */ __name(() => {
          this.isOver = false;
          if (this.overIcon) {
            this.updateIcon();
          }
        }, "onmouseleave")
      },
      [this.iconElement, this.contentElement]
    );
    this.icon = prop(
      this,
      "icon",
      icon3,
      toggleElement(this.iconElement, { onShow: this.updateIcon })
    );
    this.overIcon = prop(this, "overIcon", overIcon, () => {
      if (this.isOver) {
        this.updateIcon();
      }
    });
    this.iconSize = prop(this, "iconSize", iconSize, this.updateIcon);
    this.content = prop(
      this,
      "content",
      content2,
      toggleElement(this.contentElement, {
        onShow: /* @__PURE__ */ __name((el, v2) => {
          if (typeof v2 === "string") {
            el.textContent = v2;
          } else {
            el.replaceChildren(v2);
          }
        }, "onShow")
      })
    );
    this.tooltip = prop(this, "tooltip", tooltip, (v2) => {
      if (v2) {
        this.element.title = v2;
      } else {
        this.element.removeAttribute("title");
      }
    });
    if (tooltip !== void 0) {
      this.element.setAttribute("aria-label", tooltip);
    }
    this.classList = prop(this, "classList", classList, this.updateClasses);
    this.hidden = prop(this, "hidden", false, this.updateClasses);
    this.enabled = prop(this, "enabled", enabled, () => {
      this.updateClasses();
      this.element.disabled = !this.enabled;
    });
    this.action = prop(this, "action", action);
    this.element.addEventListener("click", (e2) => {
      if (this.popup) {
        if (!this.#over) {
          this.popup.toggle();
        }
      }
      this.action?.(e2, this);
    });
    if (visibilitySetting?.id) {
      const settingUpdated = /* @__PURE__ */ __name(() => {
        this.hidden = app2.ui.settings.getSettingValue(visibilitySetting.id) !== visibilitySetting.showValue;
      }, "settingUpdated");
      app2.ui.settings.addEventListener(
        visibilitySetting.id + ".change",
        settingUpdated
      );
      settingUpdated();
    }
  }
  updateIcon = /* @__PURE__ */ __name(() => this.iconElement.className = `mdi mdi-${this.isOver && this.overIcon || this.icon}${this.iconSize ? " mdi-" + this.iconSize + "px" : ""}`, "updateIcon");
  updateClasses = /* @__PURE__ */ __name(() => {
    const internalClasses = [];
    if (this.hidden) {
      internalClasses.push("hidden");
    }
    if (!this.enabled) {
      internalClasses.push("disabled");
    }
    if (this.popup) {
      if (this.#popupOpen) {
        internalClasses.push("popup-open");
      } else {
        internalClasses.push("popup-closed");
      }
    }
    applyClasses(this.element, this.classList, ...internalClasses);
  }, "updateClasses");
  withPopup(popup, mode2 = "click") {
    this.popup = popup;
    if (mode2 === "hover") {
      for (const el of [this.element, this.popup.element]) {
        el.addEventListener("mouseenter", () => {
          this.popup.open = !!++this.#over;
        });
        el.addEventListener("mouseleave", () => {
          this.popup.open = !!--this.#over;
        });
      }
    }
    popup.addEventListener("change", () => {
      this.#popupOpen = popup.open;
      this.updateClasses();
    });
    return this;
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.button = window.comfyAPI.button || {};
window.comfyAPI.button.ComfyButton = ComfyButton;
class ComfyPopup extends EventTarget {
  static {
    __name(this, "ComfyPopup");
  }
  element = $el("div.comfyui-popup");
  open;
  children;
  target;
  ignoreTarget;
  container;
  position;
  closeOnEscape;
  horizontal;
  classList;
  constructor({
    target,
    container = document.body,
    classList = "",
    ignoreTarget = true,
    closeOnEscape: closeOnEscape2 = true,
    position: position3 = "absolute",
    horizontal: horizontal2 = "left"
  }, ...children) {
    super();
    this.target = target;
    this.ignoreTarget = ignoreTarget;
    this.container = container;
    this.position = position3;
    this.closeOnEscape = closeOnEscape2;
    this.horizontal = horizontal2;
    container.append(this.element);
    this.children = prop(this, "children", children, () => {
      this.element.replaceChildren(...this.children);
      this.update();
    });
    this.classList = prop(
      this,
      "classList",
      classList,
      () => applyClasses(this.element, this.classList, "comfyui-popup", horizontal2)
    );
    this.open = prop(this, "open", false, (v2, o) => {
      if (v2 === o) return;
      if (v2) {
        this.#show();
      } else {
        this.#hide();
      }
    });
  }
  toggle() {
    this.open = !this.open;
  }
  #hide() {
    this.element.classList.remove("open");
    window.removeEventListener("resize", this.update);
    window.removeEventListener("click", this.#clickHandler, { capture: true });
    window.removeEventListener("keydown", this.#escHandler, { capture: true });
    this.dispatchEvent(new CustomEvent("close"));
    this.dispatchEvent(new CustomEvent("change"));
  }
  #show() {
    this.element.classList.add("open");
    this.update();
    window.addEventListener("resize", this.update);
    window.addEventListener("click", this.#clickHandler, { capture: true });
    if (this.closeOnEscape) {
      window.addEventListener("keydown", this.#escHandler, { capture: true });
    }
    this.dispatchEvent(new CustomEvent("open"));
    this.dispatchEvent(new CustomEvent("change"));
  }
  #escHandler = /* @__PURE__ */ __name((e2) => {
    if (e2.key === "Escape") {
      this.open = false;
      e2.preventDefault();
      e2.stopImmediatePropagation();
    }
  }, "#escHandler");
  #clickHandler = /* @__PURE__ */ __name((e2) => {
    const target = e2.target;
    if (!this.element.contains(target) && this.ignoreTarget && !this.target.contains(target)) {
      this.open = false;
    }
  }, "#clickHandler");
  update = /* @__PURE__ */ __name(() => {
    const rect = this.target.getBoundingClientRect();
    this.element.style.setProperty("--bottom", "unset");
    if (this.position === "absolute") {
      if (this.horizontal === "left") {
        this.element.style.setProperty("--left", rect.left + "px");
      } else {
        this.element.style.setProperty(
          "--left",
          rect.right - this.element.clientWidth + "px"
        );
      }
      this.element.style.setProperty("--top", rect.bottom + "px");
      this.element.style.setProperty("--limit", rect.bottom + "px");
    } else {
      this.element.style.setProperty("--left", "0px");
      this.element.style.setProperty("--top", rect.height + "px");
      this.element.style.setProperty("--limit", rect.height + "px");
    }
    const thisRect = this.element.getBoundingClientRect();
    if (thisRect.height < 30) {
      this.element.style.setProperty("--top", "unset");
      this.element.style.setProperty("--bottom", rect.height + 5 + "px");
      this.element.style.setProperty("--limit", rect.height + 5 + "px");
    }
  }, "update");
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.popup = window.comfyAPI.popup || {};
window.comfyAPI.popup.ComfyPopup = ComfyPopup;
class ComfySplitButton {
  static {
    __name(this, "ComfySplitButton");
  }
  arrow;
  element;
  popup;
  items;
  constructor({
    primary,
    mode: mode2,
    horizontal: horizontal2 = "left",
    position: position3 = "relative"
  }, ...items2) {
    this.arrow = new ComfyButton({
      icon: "chevron-down"
    });
    this.element = $el(
      "div.comfyui-split-button" + (mode2 === "hover" ? ".hover" : ""),
      [
        $el(
          "div.comfyui-split-primary",
          {
            ariaLabel: "Queue current workflow"
          },
          primary.element
        ),
        $el(
          "div.comfyui-split-arrow",
          {
            ariaLabel: "Open extra opens",
            ariaHasPopup: "true"
          },
          this.arrow.element
        )
      ]
    );
    this.popup = new ComfyPopup({
      target: this.element,
      container: position3 === "relative" ? this.element : document.body,
      classList: "comfyui-split-button-popup" + (mode2 === "hover" ? " hover" : ""),
      closeOnEscape: mode2 === "click",
      position: position3,
      horizontal: horizontal2
    });
    this.arrow.withPopup(this.popup, mode2);
    this.items = prop(this, "items", items2, () => this.update());
  }
  update() {
    this.popup.element.replaceChildren(
      ...this.items.map((b) => "element" in b ? b.element : b)
    );
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.splitButton = window.comfyAPI.splitButton || {};
window.comfyAPI.splitButton.ComfySplitButton = ComfySplitButton;
class ComfyAsyncDialog extends ComfyDialog$1 {
  static {
    __name(this, "ComfyAsyncDialog");
  }
  #resolve;
  constructor(actions) {
    super(
      "dialog.comfy-dialog.comfyui-dialog",
      actions?.map((opt) => {
        if (typeof opt === "string") {
          opt = { text: opt };
        }
        return $el("button.comfyui-button", {
          type: "button",
          textContent: opt.text,
          onclick: /* @__PURE__ */ __name(() => this.close(opt.value ?? opt.text), "onclick")
        });
      })
    );
  }
  show(html) {
    this.element.addEventListener("close", () => {
      this.close();
    });
    super.show(html);
    return new Promise((resolve2) => {
      this.#resolve = resolve2;
    });
  }
  showModal(html) {
    this.element.addEventListener("close", () => {
      this.close();
    });
    super.show(html);
    this.element.showModal();
    return new Promise((resolve2) => {
      this.#resolve = resolve2;
    });
  }
  close(result = null) {
    this.#resolve(result);
    this.element.close();
    super.close();
  }
  static async prompt({
    title = null,
    message: message3,
    actions
  }) {
    const dialog = new ComfyAsyncDialog(actions);
    const content2 = [$el("span", message3)];
    if (title) {
      content2.unshift($el("h3", title));
    }
    const res = await dialog.showModal(content2);
    dialog.element.remove();
    return res;
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.asyncDialog = window.comfyAPI.asyncDialog || {};
window.comfyAPI.asyncDialog.ComfyAsyncDialog = ComfyAsyncDialog;
$el("style", {
  parent: document.head,
  textContent: `
        .draggable-item {
            position: relative;
            will-change: transform;
            user-select: none;
        }
        .draggable-item.is-idle {
            transition: 0.25s ease transform;
        }
        .draggable-item.is-draggable {
            z-index: 10;
        }
    `
});
class DraggableList extends EventTarget {
  static {
    __name(this, "DraggableList");
  }
  listContainer;
  draggableItem;
  pointerStartX;
  pointerStartY;
  scrollYMax;
  itemsGap = 0;
  items = [];
  itemSelector;
  handleClass = "drag-handle";
  off = [];
  offDrag = [];
  constructor(element, itemSelector) {
    super();
    this.listContainer = element;
    this.itemSelector = itemSelector;
    if (!this.listContainer) return;
    this.off.push(this.on(this.listContainer, "mousedown", this.dragStart));
    this.off.push(this.on(this.listContainer, "touchstart", this.dragStart));
    this.off.push(this.on(document, "mouseup", this.dragEnd));
    this.off.push(this.on(document, "touchend", this.dragEnd));
  }
  getAllItems() {
    if (!this.items?.length) {
      this.items = Array.from(
        this.listContainer.querySelectorAll(this.itemSelector)
      );
      this.items.forEach((element) => {
        element.classList.add("is-idle");
      });
    }
    return this.items;
  }
  getIdleItems() {
    return this.getAllItems().filter(
      (item3) => item3.classList.contains("is-idle")
    );
  }
  isItemAbove(item3) {
    return item3.hasAttribute("data-is-above");
  }
  isItemToggled(item3) {
    return item3.hasAttribute("data-is-toggled");
  }
  on(source, event, listener, options4) {
    listener = listener.bind(this);
    source.addEventListener(event, listener, options4);
    return () => source.removeEventListener(event, listener);
  }
  dragStart(e2) {
    if (e2.target.classList.contains(this.handleClass)) {
      this.draggableItem = e2.target.closest(this.itemSelector);
    }
    if (!this.draggableItem) return;
    this.pointerStartX = e2.clientX || e2.touches[0].clientX;
    this.pointerStartY = e2.clientY || e2.touches[0].clientY;
    this.scrollYMax = this.listContainer.scrollHeight - this.listContainer.clientHeight;
    this.setItemsGap();
    this.initDraggableItem();
    this.initItemsState();
    this.offDrag.push(this.on(document, "mousemove", this.drag));
    this.offDrag.push(
      this.on(document, "touchmove", this.drag, { passive: false })
    );
    this.dispatchEvent(
      new CustomEvent("dragstart", {
        detail: {
          element: this.draggableItem,
          position: this.getAllItems().indexOf(this.draggableItem)
        }
      })
    );
  }
  setItemsGap() {
    if (this.getIdleItems().length <= 1) {
      this.itemsGap = 0;
      return;
    }
    const item1 = this.getIdleItems()[0];
    const item22 = this.getIdleItems()[1];
    const item1Rect = item1.getBoundingClientRect();
    const item2Rect = item22.getBoundingClientRect();
    this.itemsGap = Math.abs(item1Rect.bottom - item2Rect.top);
  }
  initItemsState() {
    this.getIdleItems().forEach((item3, i2) => {
      if (this.getAllItems().indexOf(this.draggableItem) > i2) {
        item3.dataset.isAbove = "";
      }
    });
  }
  initDraggableItem() {
    this.draggableItem.classList.remove("is-idle");
    this.draggableItem.classList.add("is-draggable");
  }
  drag(e2) {
    if (!this.draggableItem) return;
    e2.preventDefault();
    const clientX = e2.clientX || e2.touches[0].clientX;
    const clientY = e2.clientY || e2.touches[0].clientY;
    const listRect = this.listContainer.getBoundingClientRect();
    if (clientY > listRect.bottom) {
      if (this.listContainer.scrollTop < this.scrollYMax) {
        this.listContainer.scrollBy(0, 10);
        this.pointerStartY -= 10;
      }
    } else if (clientY < listRect.top && this.listContainer.scrollTop > 0) {
      this.pointerStartY += 10;
      this.listContainer.scrollBy(0, -10);
    }
    const pointerOffsetX = clientX - this.pointerStartX;
    const pointerOffsetY = clientY - this.pointerStartY;
    this.updateIdleItemsStateAndPosition();
    this.draggableItem.style.transform = `translate(${pointerOffsetX}px, ${pointerOffsetY}px)`;
  }
  updateIdleItemsStateAndPosition() {
    const draggableItemRect = this.draggableItem.getBoundingClientRect();
    const draggableItemY = draggableItemRect.top + draggableItemRect.height / 2;
    this.getIdleItems().forEach((item3) => {
      const itemRect = item3.getBoundingClientRect();
      const itemY = itemRect.top + itemRect.height / 2;
      if (this.isItemAbove(item3)) {
        if (draggableItemY <= itemY) {
          item3.dataset.isToggled = "";
        } else {
          delete item3.dataset.isToggled;
        }
      } else {
        if (draggableItemY >= itemY) {
          item3.dataset.isToggled = "";
        } else {
          delete item3.dataset.isToggled;
        }
      }
    });
    this.getIdleItems().forEach((item3) => {
      if (this.isItemToggled(item3)) {
        const direction = this.isItemAbove(item3) ? 1 : -1;
        item3.style.transform = `translateY(${direction * (draggableItemRect.height + this.itemsGap)}px)`;
      } else {
        item3.style.transform = "";
      }
    });
  }
  dragEnd() {
    if (!this.draggableItem) return;
    this.applyNewItemsOrder();
    this.cleanup();
  }
  applyNewItemsOrder() {
    const reorderedItems = [];
    let oldPosition = -1;
    this.getAllItems().forEach((item3, index2) => {
      if (item3 === this.draggableItem) {
        oldPosition = index2;
        return;
      }
      if (!this.isItemToggled(item3)) {
        reorderedItems[index2] = item3;
        return;
      }
      const newIndex = this.isItemAbove(item3) ? index2 + 1 : index2 - 1;
      reorderedItems[newIndex] = item3;
    });
    for (let index2 = 0; index2 < this.getAllItems().length; index2++) {
      const item3 = reorderedItems[index2];
      if (typeof item3 === "undefined") {
        reorderedItems[index2] = this.draggableItem;
      }
    }
    reorderedItems.forEach((item3) => {
      this.listContainer.appendChild(item3);
    });
    this.items = reorderedItems;
    this.dispatchEvent(
      new CustomEvent("dragend", {
        detail: {
          element: this.draggableItem,
          oldPosition,
          newPosition: reorderedItems.indexOf(this.draggableItem)
        }
      })
    );
  }
  cleanup() {
    this.itemsGap = 0;
    this.items = [];
    this.unsetDraggableItem();
    this.unsetItemState();
    this.offDrag.forEach((f) => f());
    this.offDrag = [];
  }
  unsetDraggableItem() {
    this.draggableItem.style = null;
    this.draggableItem.classList.remove("is-draggable");
    this.draggableItem.classList.add("is-idle");
    this.draggableItem = null;
  }
  unsetItemState() {
    this.getIdleItems().forEach((item3, i2) => {
      delete item3.dataset.isAbove;
      delete item3.dataset.isToggled;
      item3.style.transform = "";
    });
  }
  dispose() {
    this.off.forEach((f) => f());
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.draggableList = window.comfyAPI.draggableList || {};
window.comfyAPI.draggableList.DraggableList = DraggableList;
class ComfyAppMenu {
  static {
    __name(this, "ComfyAppMenu");
  }
  app;
  actionsGroup;
  settingsGroup;
  viewGroup;
  element;
  constructor(app2) {
    this.app = app2;
    this.actionsGroup = new ComfyButtonGroup();
    this.settingsGroup = new ComfyButtonGroup();
    this.viewGroup = new ComfyButtonGroup();
    this.element = $el("div.flex.gap-2.mx-2", [
      this.actionsGroup.element,
      this.settingsGroup.element,
      this.viewGroup.element
    ]);
  }
}
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.index = window.comfyAPI.index || {};
window.comfyAPI.index.ComfyAppMenu = ComfyAppMenu;
const ANIM_PREVIEW_WIDGET = "$$comfy_animation_preview";
function sanitizeNodeName(string) {
  let entityMap = {
    "&": "",
    "<": "",
    ">": "",
    '"': "",
    "'": "",
    "`": "",
    "=": ""
  };
  return String(string).replace(/[&<>"'`=]/g, /* @__PURE__ */ __name(function fromEntityMap(s) {
    return entityMap[s];
  }, "fromEntityMap"));
}
__name(sanitizeNodeName, "sanitizeNodeName");
class ComfyApp {
  static {
    __name(this, "ComfyApp");
  }
  /**
   * List of entries to queue
   * @type {{number: number, batchCount: number}[]}
   */
  #queueItems = [];
  /**
   * If the queue is currently being processed
   * @type {boolean}
   */
  #processingQueue = false;
  /**
   * Content Clipboard
   * @type {serialized node object}
   */
  static clipspace = null;
  static clipspace_invalidate_handler = null;
  static open_maskeditor = null;
  static clipspace_return_node = null;
  vueAppReady;
  api;
  ui;
  extensionManager;
  _nodeOutputs;
  nodePreviewImages;
  graph;
  canvas;
  dragOverNode;
  canvasEl;
  // x, y, scale
  zoom_drag_start;
  lastNodeErrors;
  /** @type {ExecutionErrorWsMessage} */
  lastExecutionError;
  configuringGraph;
  ctx;
  bodyTop;
  bodyLeft;
  bodyRight;
  bodyBottom;
  canvasContainer;
  menu;
  bypassBgColor;
  // Set by Comfy.Clipspace extension
  openClipspace = /* @__PURE__ */ __name(() => {
  }, "openClipspace");
  /**
   * @deprecated Use useExecutionStore().executingNodeId instead
   */
  get runningNodeId() {
    return useExecutionStore().executingNodeId;
  }
  /**
   * @deprecated Use useWorkspaceStore().shiftDown instead
   */
  get shiftDown() {
    return useWorkspaceStore().shiftDown;
  }
  /**
   * @deprecated Use useWidgetStore().widgets instead
   */
  get widgets() {
    if (this.vueAppReady) {
      return useWidgetStore().widgets;
    }
    return ComfyWidgets;
  }
  /**
   * @deprecated storageLocation is always 'server' since
   * https://github.com/comfyanonymous/ComfyUI/commit/53c8a99e6c00b5e20425100f6680cd9ea2652218
   */
  get storageLocation() {
    return "server";
  }
  /**
   * @deprecated storage migration is no longer needed.
   */
  get isNewUserSession() {
    return false;
  }
  /**
   * @deprecated Use useExtensionStore().extensions instead
   */
  get extensions() {
    return useExtensionStore().extensions;
  }
  /**
   * The progress on the current executing node, if the node reports any.
   * @deprecated Use useExecutionStore().executingNodeProgress instead
   */
  get progress() {
    return useExecutionStore()._executingNodeProgress;
  }
  constructor() {
    this.vueAppReady = false;
    this.ui = new ComfyUI(this);
    this.api = api;
    this.bodyTop = $el("div.comfyui-body-top", { parent: document.body });
    this.bodyLeft = $el("div.comfyui-body-left", { parent: document.body });
    this.bodyRight = $el("div.comfyui-body-right", { parent: document.body });
    this.bodyBottom = $el("div.comfyui-body-bottom", { parent: document.body });
    this.canvasContainer = $el("div.graph-canvas-container", {
      parent: document.body
    });
    this.menu = new ComfyAppMenu(this);
    this.bypassBgColor = "#FF00FF";
    this.nodeOutputs = {};
    this.nodePreviewImages = {};
  }
  get nodeOutputs() {
    return this._nodeOutputs;
  }
  set nodeOutputs(value4) {
    this._nodeOutputs = value4;
    if (this.vueAppReady)
      useExtensionService().invokeExtensions("onNodeOutputsUpdated", value4);
  }
  getPreviewFormatParam() {
    let preview_format = this.ui.settings.getSettingValue("Comfy.PreviewFormat");
    if (preview_format) return `&preview=${preview_format}`;
    else return "";
  }
  getRandParam() {
    return "&rand=" + Math.random();
  }
  static isImageNode(node3) {
    return node3.imgs || node3 && node3.widgets && node3.widgets.findIndex((obj) => obj.name === "image") >= 0;
  }
  static onClipspaceEditorSave() {
    if (ComfyApp.clipspace_return_node) {
      ComfyApp.pasteFromClipspace(ComfyApp.clipspace_return_node);
    }
  }
  static onClipspaceEditorClosed() {
    ComfyApp.clipspace_return_node = null;
  }
  static copyToClipspace(node3) {
    var widgets = null;
    if (node3.widgets) {
      widgets = node3.widgets.map(({ type, name: name2, value: value4 }) => ({
        type,
        name: name2,
        value: value4
      }));
    }
    var imgs = void 0;
    var orig_imgs = void 0;
    if (node3.imgs != void 0) {
      imgs = [];
      orig_imgs = [];
      for (let i2 = 0; i2 < node3.imgs.length; i2++) {
        imgs[i2] = new Image();
        imgs[i2].src = node3.imgs[i2].src;
        orig_imgs[i2] = imgs[i2];
      }
    }
    var selectedIndex = 0;
    if (node3.imageIndex) {
      selectedIndex = node3.imageIndex;
    }
    ComfyApp.clipspace = {
      widgets,
      imgs,
      original_imgs: orig_imgs,
      images: node3.images,
      selectedIndex,
      img_paste_mode: "selected"
      // reset to default im_paste_mode state on copy action
    };
    ComfyApp.clipspace_return_node = null;
    if (ComfyApp.clipspace_invalidate_handler) {
      ComfyApp.clipspace_invalidate_handler();
    }
  }
  static pasteFromClipspace(node3) {
    if (ComfyApp.clipspace) {
      if (ComfyApp.clipspace.imgs && node3.imgs) {
        if (node3.images && ComfyApp.clipspace.images) {
          if (ComfyApp.clipspace["img_paste_mode"] == "selected") {
            node3.images = [
              ComfyApp.clipspace.images[ComfyApp.clipspace["selectedIndex"]]
            ];
          } else {
            node3.images = ComfyApp.clipspace.images;
          }
          if (app$1.nodeOutputs[node3.id + ""])
            app$1.nodeOutputs[node3.id + ""].images = node3.images;
        }
        if (ComfyApp.clipspace.imgs) {
          if (ComfyApp.clipspace["img_paste_mode"] == "selected") {
            const img = new Image();
            img.src = ComfyApp.clipspace.imgs[ComfyApp.clipspace["selectedIndex"]].src;
            node3.imgs = [img];
            node3.imageIndex = 0;
          } else {
            const imgs = [];
            for (let i2 = 0; i2 < ComfyApp.clipspace.imgs.length; i2++) {
              imgs[i2] = new Image();
              imgs[i2].src = ComfyApp.clipspace.imgs[i2].src;
              node3.imgs = imgs;
            }
          }
        }
      }
      if (node3.widgets) {
        if (ComfyApp.clipspace.images) {
          const clip_image = ComfyApp.clipspace.images[ComfyApp.clipspace["selectedIndex"]];
          const index2 = node3.widgets.findIndex((obj) => obj.name === "image");
          if (index2 >= 0) {
            if (node3.widgets[index2].type != "image" && typeof node3.widgets[index2].value == "string" && clip_image.filename) {
              node3.widgets[index2].value = (clip_image.subfolder ? clip_image.subfolder + "/" : "") + clip_image.filename + (clip_image.type ? ` [${clip_image.type}]` : "");
            } else {
              node3.widgets[index2].value = clip_image;
            }
          }
        }
        if (ComfyApp.clipspace.widgets) {
          ComfyApp.clipspace.widgets.forEach(({ type, name: name2, value: value4 }) => {
            const prop2 = Object.values(node3.widgets).find(
              // @ts-expect-errorg
              (obj) => obj.type === type && obj.name === name2
            );
            if (prop2 && prop2.type != "button") {
              if (
                // @ts-expect-error
                prop2.type != "image" && // @ts-expect-error
                typeof prop2.value == "string" && value4.filename
              ) {
                prop2.value = (value4.subfolder ? value4.subfolder + "/" : "") + value4.filename + (value4.type ? ` [${value4.type}]` : "");
              } else {
                prop2.value = value4;
                prop2.callback(value4);
              }
            }
          });
        }
      }
      app$1.graph.setDirtyCanvas(true);
    }
  }
  #addRestoreWorkflowView() {
    const serialize = LGraph$1.prototype.serialize;
    const self2 = this;
    LGraph$1.prototype.serialize = function() {
      const workflow = serialize.apply(this, arguments);
      if (useSettingStore().get("Comfy.EnableWorkflowViewRestore")) {
        if (!workflow.extra) {
          workflow.extra = {};
        }
        workflow.extra.ds = {
          scale: self2.canvas.ds.scale,
          offset: self2.canvas.ds.offset
        };
      } else if (workflow.extra?.ds) {
        delete workflow.extra.ds;
      }
      return workflow;
    };
  }
  /**
   * Adds a handler allowing drag+drop of files onto the window to load workflows
   */
  #addDropHandler() {
    document.addEventListener("drop", async (event) => {
      event.preventDefault();
      event.stopPropagation();
      const n = this.dragOverNode;
      this.dragOverNode = null;
      if (n && n.onDragDrop && await n.onDragDrop(event)) {
        return;
      }
      if (event.dataTransfer.files.length && event.dataTransfer.files[0].type !== "image/bmp") {
        await this.handleFile(event.dataTransfer.files[0]);
      } else {
        const validTypes = ["text/uri-list", "text/x-moz-url"];
        const match2 = [...event.dataTransfer.types].find(
          (t2) => validTypes.find((v2) => t2 === v2)
        );
        if (match2) {
          const uri = event.dataTransfer.getData(match2)?.split("\n")?.[0];
          if (uri) {
            await this.handleFile(await (await fetch(uri)).blob());
          }
        }
      }
    });
    this.canvasEl.addEventListener("dragleave", async () => {
      if (this.dragOverNode) {
        this.dragOverNode = null;
        this.graph.setDirtyCanvas(false, true);
      }
    });
    this.canvasEl.addEventListener(
      "dragover",
      (e2) => {
        this.canvas.adjustMouseEvent(e2);
        const node3 = this.graph.getNodeOnPos(e2.canvasX, e2.canvasY);
        if (node3) {
          if (node3.onDragOver && node3.onDragOver(e2)) {
            this.dragOverNode = node3;
            requestAnimationFrame(() => {
              this.graph.setDirtyCanvas(false, true);
            });
            return;
          }
        }
        this.dragOverNode = null;
      },
      false
    );
  }
  /**
   * Adds a handler on paste that extracts and loads images or workflows from pasted JSON data
   */
  #addPasteHandler() {
    document.addEventListener("paste", async (e2) => {
      if (this.shiftDown) return;
      let data24 = e2.clipboardData || window.clipboardData;
      const items2 = data24.items;
      for (const item3 of items2) {
        if (item3.type.startsWith("image/")) {
          var imageNode = null;
          if (this.canvas.current_node && this.canvas.current_node.is_selected && ComfyApp.isImageNode(this.canvas.current_node)) {
            imageNode = this.canvas.current_node;
          }
          if (!imageNode) {
            const newNode = LiteGraph.createNode("LoadImage");
            newNode.pos = [...this.canvas.graph_mouse];
            imageNode = this.graph.add(newNode);
            this.graph.change();
          }
          const blob = item3.getAsFile();
          imageNode.pasteFile(blob);
          return;
        }
      }
      data24 = data24.getData("text/plain");
      let workflow = null;
      try {
        data24 = data24.slice(data24.indexOf("{"));
        workflow = JSON.parse(data24);
      } catch (err) {
        try {
          data24 = data24.slice(data24.indexOf("workflow\n"));
          data24 = data24.slice(data24.indexOf("{"));
          workflow = JSON.parse(data24);
        } catch (error2) {
          workflow = null;
        }
      }
      if (workflow && workflow.version && workflow.nodes && workflow.extra) {
        await this.loadGraphData(workflow);
      } else {
        if (e2.target instanceof HTMLTextAreaElement && e2.target.type === "textarea" || e2.target instanceof HTMLInputElement && e2.target.type === "text") {
          return;
        }
        this.canvas.pasteFromClipboard();
      }
    });
  }
  /**
   * Adds a handler on copy that serializes selected nodes to JSON
   */
  #addCopyHandler() {
    document.addEventListener("copy", (e2) => {
      if (!(e2.target instanceof Element)) {
        return;
      }
      if (e2.target instanceof HTMLTextAreaElement && e2.target.type === "textarea" || e2.target instanceof HTMLInputElement && e2.target.type === "text") {
        return;
      }
      const isTargetInGraph = e2.target.classList.contains("litegraph") || e2.target.classList.contains("graph-canvas-container");
      if (isTargetInGraph && this.canvas.selected_nodes) {
        this.canvas.copyToClipboard();
        e2.clipboardData.setData("text", " ");
        e2.preventDefault();
        e2.stopImmediatePropagation();
        return false;
      }
    });
  }
  /**
   * Handle mouse
   *
   * Move group by header
   */
  #addProcessMouseHandler() {
    const self2 = this;
    const origProcessMouseDown = LGraphCanvas.prototype.processMouseDown;
    LGraphCanvas.prototype.processMouseDown = function(e2) {
      const useFastZoom = useSettingStore().get("Comfy.Graph.CtrlShiftZoom");
      if (useFastZoom && e2.ctrlKey && e2.shiftKey && !e2.altKey && e2.buttons) {
        self2.zoom_drag_start = [e2.x, e2.y, this.ds.scale];
        return;
      }
      const res = origProcessMouseDown.apply(this, arguments);
      return res;
    };
    const origProcessMouseMove = LGraphCanvas.prototype.processMouseMove;
    LGraphCanvas.prototype.processMouseMove = function(e2) {
      if (e2.ctrlKey && e2.shiftKey && self2.zoom_drag_start) {
        if (!e2.buttons) {
          self2.zoom_drag_start = null;
          return;
        }
        let deltaY = e2.y - self2.zoom_drag_start[1];
        let startScale = self2.zoom_drag_start[2];
        let scale = startScale - deltaY / 100;
        this.ds.changeScale(scale, [
          self2.zoom_drag_start[0],
          self2.zoom_drag_start[1]
        ]);
        this.graph.change();
        return;
      }
      return origProcessMouseMove.apply(this, arguments);
    };
  }
  /**
   * Handle keypress
   */
  #addProcessKeyHandler() {
    const origProcessKey = LGraphCanvas.prototype.processKey;
    LGraphCanvas.prototype.processKey = function(e2) {
      if (!this.graph) {
        return;
      }
      var block_default = false;
      if (e2.target instanceof Element && e2.target.localName == "input") {
        return;
      }
      if (e2.type == "keydown" && !e2.repeat) {
        const keyCombo = KeyComboImpl.fromEvent(e2);
        const keybindingStore = useKeybindingStore();
        const keybinding = keybindingStore.getKeybinding(keyCombo);
        if (keybinding && keybinding.targetSelector === "#graph-canvas") {
          useCommandStore().execute(keybinding.commandId);
          block_default = true;
        }
        if (e2.key === "c" && (e2.metaKey || e2.ctrlKey)) {
          return true;
        }
        if ((e2.key === "v" || e2.key == "V") && (e2.metaKey || e2.ctrlKey) && !e2.shiftKey) {
          return true;
        }
      }
      this.graph.change();
      if (block_default) {
        e2.preventDefault();
        e2.stopImmediatePropagation();
        return false;
      }
      return origProcessKey.apply(this, arguments);
    };
  }
  /**
   * Draws group header bar
   */
  #addDrawGroupsHandler() {
    const self2 = this;
    const origDrawGroups = LGraphCanvas.prototype.drawGroups;
    LGraphCanvas.prototype.drawGroups = function(canvas, ctx) {
      if (!this.graph) {
        return;
      }
      var groups = this.graph.groups;
      ctx.save();
      ctx.globalAlpha = 0.7 * this.editor_alpha;
      for (var i2 = 0; i2 < groups.length; ++i2) {
        var group = groups[i2];
        if (!LiteGraph.overlapBounding(this.visible_area, group._bounding)) {
          continue;
        }
        ctx.fillStyle = group.color || "#335";
        ctx.strokeStyle = group.color || "#335";
        var pos2 = group._pos;
        var size2 = group._size;
        ctx.globalAlpha = 0.25 * this.editor_alpha;
        ctx.beginPath();
        var font_size = group.font_size || LiteGraph.DEFAULT_GROUP_FONT_SIZE;
        ctx.rect(pos2[0] + 0.5, pos2[1] + 0.5, size2[0], font_size * 1.4);
        ctx.fill();
        ctx.globalAlpha = this.editor_alpha;
      }
      ctx.restore();
      const res = origDrawGroups.apply(this, arguments);
      return res;
    };
  }
  /**
   * Draws node highlights (executing, drag drop) and progress bar
   */
  #addDrawNodeHandler() {
    const origDrawNodeShape = LGraphCanvas.prototype.drawNodeShape;
    const self2 = this;
    LGraphCanvas.prototype.drawNodeShape = function(node3, ctx, size2, fgcolor, bgcolor, selected2) {
      const res = origDrawNodeShape.apply(this, arguments);
      const nodeErrors = self2.lastNodeErrors?.[node3.id];
      let color2 = null;
      let lineWidth = 1;
      if (node3.id === +self2.runningNodeId) {
        color2 = "#0f0";
      } else if (self2.dragOverNode && node3.id === self2.dragOverNode.id) {
        color2 = "dodgerblue";
      } else if (nodeErrors?.errors) {
        color2 = "red";
        lineWidth = 2;
      } else if (self2.lastExecutionError && +self2.lastExecutionError.node_id === node3.id) {
        color2 = "#f0f";
        lineWidth = 2;
      }
      if (color2) {
        const shape = node3._shape || node3.constructor.shape || LiteGraph.ROUND_SHAPE;
        ctx.lineWidth = lineWidth;
        ctx.globalAlpha = 0.8;
        ctx.beginPath();
        if (shape == LiteGraph.BOX_SHAPE)
          ctx.rect(
            -6,
            -6 - LiteGraph.NODE_TITLE_HEIGHT,
            12 + size2[0] + 1,
            12 + size2[1] + LiteGraph.NODE_TITLE_HEIGHT
          );
        else if (shape == LiteGraph.ROUND_SHAPE || shape == LiteGraph.CARD_SHAPE && node3.flags.collapsed)
          ctx.roundRect(
            -6,
            -6 - LiteGraph.NODE_TITLE_HEIGHT,
            12 + size2[0] + 1,
            12 + size2[1] + LiteGraph.NODE_TITLE_HEIGHT,
            this.round_radius * 2
          );
        else if (shape == LiteGraph.CARD_SHAPE)
          ctx.roundRect(
            -6,
            -6 - LiteGraph.NODE_TITLE_HEIGHT,
            12 + size2[0] + 1,
            12 + size2[1] + LiteGraph.NODE_TITLE_HEIGHT,
            [this.round_radius * 2, this.round_radius * 2, 2, 2]
          );
        else if (shape == LiteGraph.CIRCLE_SHAPE)
          ctx.arc(
            size2[0] * 0.5,
            size2[1] * 0.5,
            size2[0] * 0.5 + 6,
            0,
            Math.PI * 2
          );
        ctx.strokeStyle = color2;
        ctx.stroke();
        ctx.strokeStyle = fgcolor;
        ctx.globalAlpha = 1;
      }
      if (self2.progress && node3.id === +self2.runningNodeId) {
        ctx.fillStyle = "green";
        ctx.fillRect(
          0,
          0,
          size2[0] * (self2.progress.value / self2.progress.max),
          6
        );
        ctx.fillStyle = bgcolor;
      }
      if (nodeErrors) {
        ctx.lineWidth = 2;
        ctx.strokeStyle = "red";
        for (const error2 of nodeErrors.errors) {
          if (error2.extra_info && error2.extra_info.input_name) {
            const inputIndex = node3.findInputSlot(error2.extra_info.input_name);
            if (inputIndex !== -1) {
              let pos2 = node3.getConnectionPos(true, inputIndex);
              ctx.beginPath();
              ctx.arc(
                pos2[0] - node3.pos[0],
                pos2[1] - node3.pos[1],
                12,
                0,
                2 * Math.PI,
                false
              );
              ctx.stroke();
            }
          }
        }
      }
      return res;
    };
    const origDrawNode = LGraphCanvas.prototype.drawNode;
    LGraphCanvas.prototype.drawNode = function(node3, ctx) {
      const editor_alpha = this.editor_alpha;
      const old_color = node3.color;
      const old_bgcolor = node3.bgcolor;
      if (node3.mode === LGraphEventMode.NEVER) {
        this.editor_alpha = 0.4;
      }
      let bgColor;
      if (node3.mode === LGraphEventMode.BYPASS) {
        bgColor = app$1.bypassBgColor;
        this.editor_alpha = 0.2;
      } else {
        bgColor = old_bgcolor || LiteGraph.NODE_DEFAULT_BGCOLOR;
      }
      const adjustments = {};
      const opacity = useSettingStore().get("Comfy.Node.Opacity");
      if (opacity) adjustments.opacity = opacity;
      if (useSettingStore().get("Comfy.ColorPalette") === "light") {
        adjustments.lightness = 0.5;
        if (old_color) {
          node3.color = adjustColor(old_color, { lightness: 0.5 });
        }
      }
      node3.bgcolor = adjustColor(bgColor, adjustments);
      const res = origDrawNode.apply(this, arguments);
      this.editor_alpha = editor_alpha;
      node3.color = old_color;
      node3.bgcolor = old_bgcolor;
      return res;
    };
  }
  /**
   * Handles updates from the API socket
   */
  #addApiUpdateHandlers() {
    api.addEventListener("status", ({ detail }) => {
      this.ui.setStatus(detail);
    });
    api.addEventListener("progress", ({ detail }) => {
      this.graph.setDirtyCanvas(true, false);
    });
    api.addEventListener("executing", ({ detail }) => {
      this.graph.setDirtyCanvas(true, false);
      this.revokePreviews(this.runningNodeId);
      delete this.nodePreviewImages[this.runningNodeId];
    });
    api.addEventListener("executed", ({ detail }) => {
      const output = this.nodeOutputs[detail.display_node || detail.node];
      if (detail.merge && output) {
        for (const k in detail.output ?? {}) {
          const v2 = output[k];
          if (v2 instanceof Array) {
            output[k] = v2.concat(detail.output[k]);
          } else {
            output[k] = detail.output[k];
          }
        }
      } else {
        this.nodeOutputs[detail.display_node || detail.node] = detail.output;
      }
      const node3 = this.graph.getNodeById(detail.display_node || detail.node);
      if (node3) {
        if (node3.onExecuted) node3.onExecuted(detail.output);
      }
    });
    api.addEventListener("execution_start", ({ detail }) => {
      this.lastExecutionError = null;
      this.graph.nodes.forEach((node3) => {
        if (node3.onExecutionStart) node3.onExecutionStart();
      });
    });
    api.addEventListener("execution_error", ({ detail }) => {
      this.lastExecutionError = detail;
      useDialogService().showExecutionErrorDialog(detail);
      this.canvas.draw(true, true);
    });
    api.addEventListener("b_preview", ({ detail }) => {
      const id3 = this.runningNodeId;
      if (id3 == null) return;
      const blob = detail;
      const blobUrl = URL.createObjectURL(blob);
      this.revokePreviews(id3);
      this.nodePreviewImages[id3] = [blobUrl];
    });
    api.init();
  }
  #addConfigureHandler() {
    const app2 = this;
    const configure = LGraph$1.prototype.configure;
    LGraph$1.prototype.configure = function() {
      app2.configuringGraph = true;
      try {
        return configure.apply(this, arguments);
      } finally {
        app2.configuringGraph = false;
      }
    };
  }
  #addAfterConfigureHandler() {
    const app2 = this;
    const onConfigure = app2.graph.onConfigure;
    app2.graph.onConfigure = function() {
      for (const node3 of app2.graph.nodes) {
        node3.onGraphConfigured?.();
      }
      const r = onConfigure?.apply(this, arguments);
      for (const node3 of app2.graph.nodes) {
        node3.onAfterGraphConfigured?.();
      }
      return r;
    };
  }
  /**
   * Set up the app on the page
   */
  async setup(canvasEl) {
    this.canvasEl = canvasEl;
    this.resizeCanvas();
    await useWorkspaceStore().workflow.syncWorkflows();
    await useExtensionService().loadExtensions();
    this.#addProcessMouseHandler();
    this.#addProcessKeyHandler();
    this.#addConfigureHandler();
    this.#addApiUpdateHandlers();
    this.#addRestoreWorkflowView();
    this.graph = new LGraph$1();
    this.#addAfterConfigureHandler();
    this.canvas = new LGraphCanvas(canvasEl, this.graph);
    this.canvas.state = shallowReactive(this.canvas.state);
    this.ctx = canvasEl.getContext("2d");
    LiteGraph.alt_drag_do_clone_nodes = true;
    this.graph.start();
    this.resizeCanvas();
    window.addEventListener("resize", () => this.resizeCanvas());
    const ro = new ResizeObserver(() => this.resizeCanvas());
    ro.observe(this.bodyTop);
    ro.observe(this.bodyLeft);
    ro.observe(this.bodyRight);
    ro.observe(this.bodyBottom);
    await useExtensionService().invokeExtensionsAsync("init");
    await this.registerNodes();
    let restored = false;
    try {
      const loadWorkflow = /* @__PURE__ */ __name(async (json) => {
        if (json) {
          const workflow = JSON.parse(json);
          const workflowName = getStorageValue("Comfy.PreviousWorkflow");
          await this.loadGraphData(workflow, true, true, workflowName);
          return true;
        }
      }, "loadWorkflow");
      const clientId = api.initialClientId ?? api.clientId;
      restored = clientId && await loadWorkflow(
        sessionStorage.getItem(`workflow:${clientId}`)
      ) || await loadWorkflow(localStorage.getItem("workflow"));
    } catch (err) {
      console.error("Error loading previous workflow", err);
    }
    if (!restored) {
      await this.loadGraphData();
    }
    this.#addDrawNodeHandler();
    this.#addDrawGroupsHandler();
    this.#addDropHandler();
    this.#addCopyHandler();
    this.#addPasteHandler();
    await useExtensionService().invokeExtensionsAsync("setup");
  }
  resizeCanvas() {
    const scale = Math.max(window.devicePixelRatio, 1);
    this.canvasEl.height = this.canvasEl.width = NaN;
    const { width: width2, height } = this.canvasEl.getBoundingClientRect();
    this.canvasEl.width = Math.round(width2 * scale);
    this.canvasEl.height = Math.round(height * scale);
    this.canvasEl.getContext("2d").scale(scale, scale);
    this.canvas?.draw(true, true);
  }
  updateVueAppNodeDefs(defs) {
    const rawDefs = Object.fromEntries(
      Object.entries(LiteGraph.registered_node_types).map(([name2, node3]) => [
        name2,
        {
          name: name2,
          display_name: name2,
          category: node3.category || "__frontend_only__",
          input: { required: {}, optional: {} },
          output: [],
          output_name: [],
          output_is_list: [],
          python_module: "custom_nodes.frontend_only",
          description: `Frontend only node for ${name2}`
        }
      ])
    );
    const allNodeDefs = {
      ...rawDefs,
      ...defs,
      ...SYSTEM_NODE_DEFS
    };
    const nodeDefStore = useNodeDefStore();
    const nodeDefArray = Object.values(allNodeDefs);
    useExtensionService().invokeExtensions(
      "beforeRegisterVueAppNodeDefs",
      nodeDefArray,
      this
    );
    nodeDefStore.updateNodeDefs(nodeDefArray);
  }
  #translateNodeDefs(defs) {
    return Object.fromEntries(
      Object.entries(defs).map(([name2, def2]) => [
        name2,
        {
          ...def2,
          display_name: st(
            `nodeDefs.${name2}.display_name`,
            def2.display_name ?? def2.name
          ),
          description: def2.description ? st(`nodeDefs.${name2}.description`, def2.description) : void 0,
          category: def2.category.split("/").map((category) => st(`nodeCategories.${category}`, category)).join("/")
        }
      ])
    );
  }
  async #getNodeDefs() {
    return this.#translateNodeDefs(
      await api.getNodeDefs({
        validate: useSettingStore().get("Comfy.Validation.NodeDefs")
      })
    );
  }
  /**
   * Registers nodes with the graph
   */
  async registerNodes() {
    const defs = await this.#getNodeDefs();
    await this.registerNodesFromDefs(defs);
    await useExtensionService().invokeExtensionsAsync("registerCustomNodes");
    if (this.vueAppReady) {
      this.updateVueAppNodeDefs(defs);
    }
  }
  /**
   * Remove the impl after groupNode jest tests are removed.
   * @deprecated Use useWidgetStore().getWidgetType instead
   */
  getWidgetType(inputData, inputName) {
    const type = inputData[0];
    if (Array.isArray(type)) {
      return "COMBO";
    } else if (`${type}:${inputName}` in this.widgets) {
      return `${type}:${inputName}`;
    } else if (type in this.widgets) {
      return type;
    } else {
      return null;
    }
  }
  async registerNodeDef(nodeId, nodeData) {
    return await useLitegraphService().registerNodeDef(nodeId, nodeData);
  }
  async registerNodesFromDefs(defs) {
    await useExtensionService().invokeExtensionsAsync("addCustomNodeDefs", defs);
    for (const nodeId in defs) {
      this.registerNodeDef(nodeId, defs[nodeId]);
    }
  }
  loadTemplateData(templateData) {
    if (!templateData?.templates) {
      return;
    }
    const old = localStorage.getItem("litegrapheditor_clipboard");
    var maxY, nodeBottom, node3;
    for (const template of templateData.templates) {
      if (!template?.data) {
        continue;
      }
      const data24 = JSON.parse(template.data);
      if (!data24.reroutes) {
        deserialiseAndCreate(template.data, app$1.canvas);
      } else {
        localStorage.setItem("litegrapheditor_clipboard", template.data);
        app$1.canvas.pasteFromClipboard();
      }
      maxY = false;
      for (const i2 in app$1.canvas.selected_nodes) {
        node3 = app$1.canvas.selected_nodes[i2];
        nodeBottom = node3.pos[1] + node3.size[1];
        if (maxY === false || nodeBottom > maxY) {
          maxY = nodeBottom;
        }
      }
      app$1.canvas.graph_mouse[1] = maxY + 50;
    }
    localStorage.setItem("litegrapheditor_clipboard", old);
  }
  #showMissingNodesError(missingNodeTypes) {
    if (useSettingStore().get("Comfy.Workflow.ShowMissingNodesWarning")) {
      useDialogService().showLoadWorkflowWarning({ missingNodeTypes });
    }
  }
  #showMissingModelsError(missingModels, paths) {
    if (useSettingStore().get("Comfy.Workflow.ShowMissingModelsWarning")) {
      useDialogService().showMissingModelsWarning({
        missingModels,
        paths
      });
    }
  }
  async loadGraphData(graphData, clean = true, restore_view = true, workflow = null, { showMissingNodesDialog = true, showMissingModelsDialog = true } = {}) {
    if (clean !== false) {
      this.clean();
    }
    let reset_invalid_values = false;
    if (!graphData) {
      graphData = defaultGraph;
      reset_invalid_values = true;
    }
    graphData = clone$3(graphData);
    if (useSettingStore().get("Comfy.Validation.Workflows")) {
      const validatedGraphData = await validateComfyWorkflow(
        graphData,
        /* onError=*/
        (err) => {
          useToastStore().addAlert(err);
        }
      );
      graphData = validatedGraphData ?? graphData;
    }
    useWorkflowService().beforeLoadNewGraph();
    const missingNodeTypes = [];
    const missingModels = [];
    await useExtensionService().invokeExtensionsAsync(
      "beforeConfigureGraph",
      graphData,
      missingNodeTypes
      // TODO: missingModels
    );
    for (let n of graphData.nodes) {
      if (n.type == "T2IAdapterLoader") n.type = "ControlNetLoader";
      if (n.type == "ConditioningAverage ") n.type = "ConditioningAverage";
      if (n.type == "SDV_img2vid_Conditioning")
        n.type = "SVD_img2vid_Conditioning";
      if (!(n.type in LiteGraph.registered_node_types)) {
        missingNodeTypes.push(n.type);
        n.type = sanitizeNodeName(n.type);
      }
    }
    if (graphData.models && useSettingStore().get("Comfy.Workflow.ShowMissingModelsWarning")) {
      for (const m of graphData.models) {
        const models_available = await useModelStore().getLoadedModelFolder(
          m.directory
        );
        if (models_available === null) {
          m.directory_invalid = true;
          missingModels.push(m);
        } else if (!(m.name in models_available.models)) {
          missingModels.push(m);
        }
      }
    }
    try {
      this.graph.configure(graphData);
      if (restore_view && useSettingStore().get("Comfy.EnableWorkflowViewRestore") && graphData.extra?.ds) {
        this.canvas.ds.offset = graphData.extra.ds.offset;
        this.canvas.ds.scale = graphData.extra.ds.scale;
      }
    } catch (error2) {
      let errorHint = [];
      const filename = error2.fileName || (error2.stack || "").match(/(\/extensions\/.*\.js)/)?.[1];
      const pos2 = (filename || "").indexOf("/extensions/");
      if (pos2 > -1) {
        errorHint.push(
          $el("span", {
            textContent: "This may be due to the following script:"
          }),
          $el("br"),
          $el("span", {
            style: {
              fontWeight: "bold"
            },
            textContent: filename.substring(pos2)
          })
        );
      }
      this.ui.dialog.show(
        $el("div", [
          $el("p", {
            textContent: "Loading aborted due to error reloading workflow data"
          }),
          $el("pre", {
            style: { padding: "5px", backgroundColor: "rgba(255,0,0,0.2)" },
            textContent: error2.toString()
          }),
          $el("pre", {
            style: {
              padding: "5px",
              color: "#ccc",
              fontSize: "10px",
              maxHeight: "50vh",
              overflow: "auto",
              backgroundColor: "rgba(0,0,0,0.2)"
            },
            textContent: error2.stack || "No stacktrace available"
          }),
          ...errorHint
        ]).outerHTML
      );
      return;
    }
    for (const node3 of this.graph.nodes) {
      const size2 = node3.computeSize();
      size2[0] = Math.max(node3.size[0], size2[0]);
      size2[1] = Math.max(node3.size[1], size2[1]);
      node3.size = size2;
      if (node3.widgets) {
        for (let widget2 of node3.widgets) {
          if (node3.type == "KSampler" || node3.type == "KSamplerAdvanced") {
            if (widget2.name == "sampler_name") {
              if (typeof widget2.value === "string" && widget2.value.startsWith("sample_")) {
                widget2.value = widget2.value.slice(7);
              }
            }
          }
          if (node3.type == "KSampler" || node3.type == "KSamplerAdvanced" || node3.type == "PrimitiveNode") {
            if (widget2.name == "control_after_generate") {
              if (widget2.value === true) {
                widget2.value = "randomize";
              } else if (widget2.value === false) {
                widget2.value = "fixed";
              }
            }
          }
          if (reset_invalid_values) {
            if (widget2.type == "combo") {
              if (!widget2.options.values.includes(widget2.value) && widget2.options.values.length > 0) {
                widget2.value = widget2.options.values[0];
              }
            }
          }
        }
      }
      useExtensionService().invokeExtensions("loadedGraphNode", node3);
    }
    if (missingNodeTypes.length && showMissingNodesDialog) {
      this.#showMissingNodesError(missingNodeTypes);
    }
    if (missingModels.length && showMissingModelsDialog) {
      const paths = await api.getFolderPaths();
      this.#showMissingModelsError(missingModels, paths);
    }
    await useExtensionService().invokeExtensionsAsync(
      "afterConfigureGraph",
      missingNodeTypes
    );
    await useWorkflowService().afterLoadNewGraph(
      workflow,
      // @ts-expect-error zod types issue. Will be fixed after we enable ts-strict
      this.graph.serialize()
    );
    requestAnimationFrame(() => {
      this.graph.setDirtyCanvas(true, true);
    });
  }
  /**
   * Serializes a graph using preferred user settings.
   * @param graph The litegraph to serialize.
   * @returns A serialized graph (aka workflow) with preferred user settings.
   */
  serializeGraph(graph = this.graph) {
    const sortNodes = useSettingStore().get("Comfy.Workflow.SortNodeIdOnSave");
    return graph.serialize({ sortNodes });
  }
  /**
   * Converts the current graph workflow for sending to the API.
   * Note: Node widgets are updated before serialization to prepare queueing.
   * @returns The workflow and node links
   */
  async graphToPrompt(graph = this.graph, clean = true) {
    for (const outerNode of this.graph.computeExecutionOrder(false)) {
      if (outerNode.widgets) {
        for (const widget2 of outerNode.widgets) {
          widget2.beforeQueued?.();
        }
      }
      const innerNodes = outerNode.getInnerNodes ? outerNode.getInnerNodes() : [outerNode];
      for (const node3 of innerNodes) {
        if (node3.isVirtualNode) {
          if (node3.applyToGraph) {
            node3.applyToGraph();
          }
        }
      }
    }
    const workflow = this.serializeGraph(graph);
    for (const node3 of workflow.nodes) {
      for (const slot of node3.inputs) {
        delete slot.localized_name;
      }
      for (const slot of node3.outputs) {
        delete slot.localized_name;
      }
    }
    const output = {};
    for (const outerNode of graph.computeExecutionOrder(false)) {
      const skipNode = outerNode.mode === LGraphEventMode.NEVER || outerNode.mode === LGraphEventMode.BYPASS;
      const innerNodes = !skipNode && outerNode.getInnerNodes ? outerNode.getInnerNodes() : [outerNode];
      for (const node3 of innerNodes) {
        if (node3.isVirtualNode) {
          continue;
        }
        if (node3.mode === LGraphEventMode.NEVER || node3.mode === LGraphEventMode.BYPASS) {
          continue;
        }
        const inputs = {};
        const widgets = node3.widgets;
        if (widgets) {
          for (const i2 in widgets) {
            const widget2 = widgets[i2];
            if (!widget2.options || widget2.options.serialize !== false) {
              inputs[widget2.name] = widget2.serializeValue ? await widget2.serializeValue(node3, i2) : widget2.value;
            }
          }
        }
        for (let i2 in node3.inputs) {
          let parent = node3.getInputNode(i2);
          if (parent) {
            let link2 = node3.getInputLink(i2);
            while (parent.mode === LGraphEventMode.BYPASS || parent.isVirtualNode) {
              let found2 = false;
              if (parent.isVirtualNode) {
                link2 = parent.getInputLink(link2.origin_slot);
                if (link2) {
                  parent = parent.getInputNode(link2.target_slot);
                  if (parent) {
                    found2 = true;
                  }
                }
              } else if (link2 && parent.mode === LGraphEventMode.BYPASS) {
                let all_inputs = [link2.origin_slot];
                if (parent.inputs) {
                  all_inputs = all_inputs.concat(Object.keys(parent.inputs));
                  for (let parent_input in all_inputs) {
                    parent_input = all_inputs[parent_input];
                    if (parent.inputs[parent_input]?.type === node3.inputs[i2].type) {
                      link2 = parent.getInputLink(parent_input);
                      if (link2) {
                        parent = parent.getInputNode(parent_input);
                      }
                      found2 = true;
                      break;
                    }
                  }
                }
              }
              if (!found2) {
                break;
              }
            }
            if (link2) {
              if (parent?.updateLink) {
                link2 = parent.updateLink(link2);
              }
              if (link2) {
                inputs[node3.inputs[i2].name] = [
                  String(link2.origin_id),
                  parseInt(link2.origin_slot)
                ];
              }
            }
          }
        }
        const node_data = {
          inputs,
          class_type: node3.comfyClass
        };
        node_data["_meta"] = {
          title: node3.title
        };
        output[String(node3.id)] = node_data;
      }
    }
    if (clean) {
      for (const o in output) {
        for (const i2 in output[o].inputs) {
          if (Array.isArray(output[o].inputs[i2]) && output[o].inputs[i2].length === 2 && !output[output[o].inputs[i2][0]]) {
            delete output[o].inputs[i2];
          }
        }
      }
    }
    return { workflow, output };
  }
  #formatPromptError(error2) {
    if (error2 == null) {
      return "(unknown error)";
    } else if (typeof error2 === "string") {
      return error2;
    } else if (error2.stack && error2.message) {
      return error2.toString();
    } else if (error2.response) {
      let message3 = error2.response.error.message;
      if (error2.response.error.details)
        message3 += ": " + error2.response.error.details;
      for (const [nodeID, nodeError] of Object.entries(
        error2.response.node_errors
      )) {
        message3 += "\n" + nodeError.class_type + ":";
        for (const errorReason of nodeError.errors) {
          message3 += "\n    - " + errorReason.message + ": " + errorReason.details;
        }
      }
      return message3;
    }
    return "(unknown error)";
  }
  async queuePrompt(number2, batchCount = 1) {
    this.#queueItems.push({ number: number2, batchCount });
    if (this.#processingQueue) {
      return;
    }
    this.#processingQueue = true;
    this.lastNodeErrors = null;
    try {
      while (this.#queueItems.length) {
        ;
        ({ number: number2, batchCount } = this.#queueItems.pop());
        for (let i2 = 0; i2 < batchCount; i2++) {
          const p2 = await this.graphToPrompt();
          try {
            const res = await api.queuePrompt(number2, p2);
            this.lastNodeErrors = res.node_errors;
            if (this.lastNodeErrors.length > 0) {
              this.canvas.draw(true, true);
            } else {
              try {
                useExecutionStore().storePrompt({
                  id: res.prompt_id,
                  nodes: Object.keys(p2.output),
                  workflow: useWorkspaceStore().workflow.activeWorkflow
                });
              } catch (error2) {
              }
            }
          } catch (error2) {
            const formattedError = this.#formatPromptError(error2);
            this.ui.dialog.show(formattedError);
            if (error2.response) {
              this.lastNodeErrors = error2.response.node_errors;
              this.canvas.draw(true, true);
            }
            break;
          }
          for (const n of p2.workflow.nodes) {
            const node3 = this.graph.getNodeById(n.id);
            if (node3.widgets) {
              for (const widget2 of node3.widgets) {
                if (widget2.afterQueued) {
                  widget2.afterQueued();
                }
              }
            }
          }
          this.canvas.draw(true, true);
          await this.ui.queue.update();
        }
      }
    } finally {
      this.#processingQueue = false;
    }
    api.dispatchCustomEvent("promptQueued", { number: number2, batchCount });
    return !this.lastNodeErrors;
  }
  showErrorOnFileLoad(file) {
    this.ui.dialog.show(
      $el("div", [
        $el("p", { textContent: `Unable to find workflow in ${file.name}` })
      ]).outerHTML
    );
  }
  /**
   * Loads workflow data from the specified file
   * @param {File} file
   */
  async handleFile(file) {
    const removeExt = /* @__PURE__ */ __name((f) => {
      if (!f) return f;
      const p2 = f.lastIndexOf(".");
      if (p2 === -1) return f;
      return f.substring(0, p2);
    }, "removeExt");
    const fileName = removeExt(file.name);
    if (file.type === "image/png") {
      const pngInfo = await getPngMetadata(file);
      if (pngInfo?.workflow) {
        await this.loadGraphData(
          JSON.parse(pngInfo.workflow),
          true,
          true,
          fileName
        );
      } else if (pngInfo?.prompt) {
        this.loadApiJson(JSON.parse(pngInfo.prompt), fileName);
      } else if (pngInfo?.parameters) {
        useWorkflowService().beforeLoadNewGraph();
        importA1111(this.graph, pngInfo.parameters);
        useWorkflowService().afterLoadNewGraph(fileName, this.serializeGraph());
      } else {
        this.showErrorOnFileLoad(file);
      }
    } else if (file.type === "image/webp") {
      const pngInfo = await getWebpMetadata(file);
      const workflow = pngInfo?.workflow || pngInfo?.Workflow;
      const prompt = pngInfo?.prompt || pngInfo?.Prompt;
      if (workflow) {
        this.loadGraphData(JSON.parse(workflow), true, true, fileName);
      } else if (prompt) {
        this.loadApiJson(JSON.parse(prompt), fileName);
      } else {
        this.showErrorOnFileLoad(file);
      }
    } else if (file.type === "audio/flac" || file.type === "audio/x-flac") {
      const pngInfo = await getFlacMetadata(file);
      const workflow = pngInfo?.workflow || pngInfo?.Workflow;
      const prompt = pngInfo?.prompt || pngInfo?.Prompt;
      if (workflow) {
        this.loadGraphData(JSON.parse(workflow), true, true, fileName);
      } else if (prompt) {
        this.loadApiJson(JSON.parse(prompt), fileName);
      } else {
        this.showErrorOnFileLoad(file);
      }
    } else if (file.type === "application/json" || file.name?.endsWith(".json")) {
      const reader = new FileReader();
      reader.onload = async () => {
        const readerResult = reader.result;
        const jsonContent = JSON.parse(readerResult);
        if (jsonContent?.templates) {
          this.loadTemplateData(jsonContent);
        } else if (this.isApiJson(jsonContent)) {
          this.loadApiJson(jsonContent, fileName);
        } else {
          await this.loadGraphData(
            JSON.parse(readerResult),
            true,
            false,
            fileName
          );
        }
      };
      reader.readAsText(file);
    } else if (file.name?.endsWith(".latent") || file.name?.endsWith(".safetensors")) {
      const info = await getLatentMetadata(file);
      if (info.workflow) {
        await this.loadGraphData(
          // @ts-expect-error
          JSON.parse(info.workflow),
          true,
          true,
          fileName
        );
      } else if (info.prompt) {
        this.loadApiJson(JSON.parse(info.prompt));
      } else {
        this.showErrorOnFileLoad(file);
      }
    } else {
      this.showErrorOnFileLoad(file);
    }
  }
  isApiJson(data24) {
    return Object.values(data24).every((v2) => v2.class_type);
  }
  loadApiJson(apiData, fileName) {
    useWorkflowService().beforeLoadNewGraph();
    const missingNodeTypes = Object.values(apiData).filter(
      // @ts-expect-error
      (n) => !LiteGraph.registered_node_types[n.class_type]
    );
    if (missingNodeTypes.length) {
      this.#showMissingNodesError(
        // @ts-expect-error
        missingNodeTypes.map((t2) => t2.class_type)
      );
      return;
    }
    const ids = Object.keys(apiData);
    app$1.graph.clear();
    for (const id3 of ids) {
      const data24 = apiData[id3];
      const node3 = LiteGraph.createNode(data24.class_type);
      node3.id = isNaN(+id3) ? id3 : +id3;
      node3.title = data24._meta?.title ?? node3.title;
      app$1.graph.add(node3);
    }
    for (const id3 of ids) {
      const data24 = apiData[id3];
      const node3 = app$1.graph.getNodeById(id3);
      for (const input in data24.inputs ?? {}) {
        const value4 = data24.inputs[input];
        if (value4 instanceof Array) {
          const [fromId, fromSlot] = value4;
          const fromNode = app$1.graph.getNodeById(fromId);
          let toSlot = node3.inputs?.findIndex((inp) => inp.name === input);
          if (toSlot == null || toSlot === -1) {
            try {
              const widget2 = node3.widgets?.find((w) => w.name === input);
              if (widget2 && node3.convertWidgetToInput?.(widget2)) {
                toSlot = node3.inputs?.length - 1;
              }
            } catch (error2) {
            }
          }
          if (toSlot != null || toSlot !== -1) {
            fromNode.connect(fromSlot, node3, toSlot);
          }
        } else {
          const widget2 = node3.widgets?.find((w) => w.name === input);
          if (widget2) {
            widget2.value = value4;
            widget2.callback?.(value4);
          }
        }
      }
    }
    app$1.graph.arrange();
    for (const id3 of ids) {
      const data24 = apiData[id3];
      const node3 = app$1.graph.getNodeById(id3);
      for (const input in data24.inputs ?? {}) {
        const value4 = data24.inputs[input];
        if (value4 instanceof Array) {
          const [fromId, fromSlot] = value4;
          const fromNode = app$1.graph.getNodeById(fromId);
          let toSlot = node3.inputs?.findIndex((inp) => inp.name === input);
          if (toSlot == null || toSlot === -1) {
            try {
              const widget2 = node3.widgets?.find((w) => w.name === input);
              if (widget2 && node3.convertWidgetToInput?.(widget2)) {
                toSlot = node3.inputs?.length - 1;
              }
            } catch (error2) {
            }
          }
          if (toSlot != null || toSlot !== -1) {
            fromNode.connect(fromSlot, node3, toSlot);
          }
        } else {
          const widget2 = node3.widgets?.find((w) => w.name === input);
          if (widget2) {
            widget2.value = value4;
            widget2.callback?.(value4);
          }
        }
      }
    }
    app$1.graph.arrange();
    useWorkflowService().afterLoadNewGraph(fileName, this.serializeGraph());
  }
  /**
   * Registers a Comfy web extension with the app
   * @param {ComfyExtension} extension
   * @deprecated Use useExtensionService().registerExtension instead
   */
  registerExtension(extension) {
    useExtensionService().registerExtension(extension);
  }
  /**
   * Refresh combo list on whole nodes
   */
  async refreshComboInNodes() {
    const requestToastMessage = {
      severity: "info",
      summary: "Update",
      detail: "Update requested"
    };
    if (this.vueAppReady) {
      useToastStore().add(requestToastMessage);
    }
    const defs = await this.#getNodeDefs();
    for (const nodeId in defs) {
      this.registerNodeDef(nodeId, defs[nodeId]);
    }
    for (let nodeNum in this.graph.nodes) {
      const node3 = this.graph.nodes[nodeNum];
      const def2 = defs[node3.type];
      node3.refreshComboInNode?.(defs);
      if (!def2) continue;
      for (const widgetNum in node3.widgets) {
        const widget2 = node3.widgets[widgetNum];
        if (widget2.type == "combo" && def2["input"]["required"][widget2.name] !== void 0) {
          widget2.options.values = def2["input"]["required"][widget2.name][0];
        }
      }
    }
    await useExtensionService().invokeExtensionsAsync(
      "refreshComboInNodes",
      defs
    );
    if (this.vueAppReady) {
      this.updateVueAppNodeDefs(defs);
      useToastStore().remove(requestToastMessage);
      useToastStore().add({
        severity: "success",
        summary: "Updated",
        detail: "Node definitions updated",
        life: 1e3
      });
    }
  }
  resetView() {
    app$1.canvas.ds.scale = 1;
    app$1.canvas.ds.offset = [0, 0];
    app$1.graph.setDirtyCanvas(true, true);
  }
  /**
   * Frees memory allocated to image preview blobs for a specific node, by revoking the URLs associated with them.
   * @param nodeId ID of the node to revoke all preview images of
   */
  revokePreviews(nodeId) {
    if (!this.nodePreviewImages[nodeId]?.[Symbol.iterator]) return;
    for (const url of this.nodePreviewImages[nodeId]) {
      URL.revokeObjectURL(url);
    }
  }
  /**
   * Clean current state
   */
  clean() {
    this.nodeOutputs = {};
    for (const id3 of Object.keys(this.nodePreviewImages)) {
      this.revokePreviews(id3);
    }
    this.nodePreviewImages = {};
    this.lastNodeErrors = null;
    this.lastExecutionError = null;
  }
  clientPosToCanvasPos(pos2) {
    const rect = this.canvasContainer.getBoundingClientRect();
    const containerOffsets = [rect.left, rect.top];
    return _.zip(pos2, this.canvas.ds.offset, containerOffsets).map(
      ([p2, o1, o2]) => (p2 - o2) / this.canvas.ds.scale - o1
    );
  }
  canvasPosToClientPos(pos2) {
    const rect = this.canvasContainer.getBoundingClientRect();
    const containerOffsets = [rect.left, rect.top];
    return _.zip(pos2, this.canvas.ds.offset, containerOffsets).map(
      ([p2, o1, o2]) => (p2 + o1) * this.canvas.ds.scale + o2
    );
  }
}
const app$1 = new ComfyApp();
window.comfyAPI = window.comfyAPI || {};
window.comfyAPI.app = window.comfyAPI.app || {};
window.comfyAPI.app.ANIM_PREVIEW_WIDGET = ANIM_PREVIEW_WIDGET;
window.comfyAPI.app.ComfyApp = ComfyApp;
window.comfyAPI.app.app = app$1;
const useColorPaletteService = /* @__PURE__ */ __name(() => {
  const colorPaletteStore = useColorPaletteStore();
  const settingStore = useSettingStore();
  const nodeDefStore = useNodeDefStore();
  const { wrapWithErrorHandling, wrapWithErrorHandlingAsync } = useErrorHandling();
  const validateColorPalette = /* @__PURE__ */ __name((data24) => {
    const result = paletteSchema.safeParse(data24);
    if (result.success) return result.data;
    const error2 = fromZodError(result.error);
    throw new Error(`Invalid color palette against zod schema:
${error2}`);
  }, "validateColorPalette");
  const persistCustomColorPalettes = /* @__PURE__ */ __name(() => {
    settingStore.set(
      "Comfy.CustomColorPalettes",
      colorPaletteStore.customPalettes
    );
  }, "persistCustomColorPalettes");
  const deleteCustomColorPalette = /* @__PURE__ */ __name((colorPaletteId) => {
    colorPaletteStore.deleteCustomPalette(colorPaletteId);
    persistCustomColorPalettes();
  }, "deleteCustomColorPalette");
  const addCustomColorPalette = /* @__PURE__ */ __name((colorPalette) => {
    validateColorPalette(colorPalette);
    colorPaletteStore.addCustomPalette(colorPalette);
    persistCustomColorPalettes();
  }, "addCustomColorPalette");
  const loadLinkColorPalette = /* @__PURE__ */ __name((linkColorPalette) => {
    const types = Object.fromEntries(
      Array.from(nodeDefStore.nodeDataTypes).map((type) => [type, ""])
    );
    Object.assign(
      app$1.canvas.default_connection_color_byType,
      types,
      linkColorPalette
    );
    Object.assign(LGraphCanvas.link_type_colors, types, linkColorPalette);
  }, "loadLinkColorPalette");
  const loadLiteGraphColorPalette = /* @__PURE__ */ __name((palette) => {
    app$1.bypassBgColor = palette.NODE_BYPASS_BGCOLOR;
    app$1.canvas.node_title_color = palette.NODE_TITLE_COLOR;
    app$1.canvas.default_link_color = palette.LINK_COLOR;
    app$1.canvas.background_image = palette.BACKGROUND_IMAGE;
    app$1.canvas.clear_background_color = palette.CLEAR_BACKGROUND_COLOR;
    app$1.canvas._pattern = void 0;
    for (const [key, value4] of Object.entries(palette)) {
      if (Object.prototype.hasOwnProperty.call(LiteGraph, key)) {
        if (key === "NODE_DEFAULT_SHAPE" && typeof value4 === "string") {
          console.warn(
            `litegraph_base.NODE_DEFAULT_SHAPE only accepts [${[
              LiteGraph.BOX_SHAPE,
              LiteGraph.ROUND_SHAPE,
              LiteGraph.CARD_SHAPE
            ].join(", ")}] but got ${value4}`
          );
          LiteGraph.NODE_DEFAULT_SHAPE = LiteGraph.ROUND_SHAPE;
        } else {
          ;
          LiteGraph[key] = value4;
        }
      }
    }
  }, "loadLiteGraphColorPalette");
  const loadComfyColorPalette = /* @__PURE__ */ __name((comfyColorPalette) => {
    if (comfyColorPalette) {
      const rootStyle = document.documentElement.style;
      for (const [key, value4] of Object.entries(comfyColorPalette)) {
        rootStyle.setProperty("--" + key, value4);
      }
    }
  }, "loadComfyColorPalette");
  const loadColorPalette = /* @__PURE__ */ __name(async (colorPaletteId) => {
    const colorPalette = colorPaletteStore.palettesLookup[colorPaletteId];
    if (!colorPalette) {
      throw new Error(`Color palette ${colorPaletteId} not found`);
    }
    const completedPalette = colorPaletteStore.completePalette(colorPalette);
    loadLinkColorPalette(completedPalette.colors.node_slot);
    loadLiteGraphColorPalette(completedPalette.colors.litegraph_base);
    loadComfyColorPalette(completedPalette.colors.comfy_base);
    app$1.canvas.setDirty(true, true);
    colorPaletteStore.activePaletteId = colorPaletteId;
  }, "loadColorPalette");
  const exportColorPalette = /* @__PURE__ */ __name((colorPaletteId) => {
    const colorPalette = colorPaletteStore.palettesLookup[colorPaletteId];
    if (!colorPalette) {
      throw new Error(`Color palette ${colorPaletteId} not found`);
    }
    downloadBlob(
      colorPalette.id + ".json",
      new Blob([JSON.stringify(toRaw(colorPalette), null, 2)], {
        type: "application/json"
      })
    );
  }, "exportColorPalette");
  const importColorPalette = /* @__PURE__ */ __name(async () => {
    const file = await uploadFile("application/json");
    const text2 = await file.text();
    const palette = JSON.parse(text2);
    addCustomColorPalette(palette);
    return palette;
  }, "importColorPalette");
  return {
    addCustomColorPalette: wrapWithErrorHandling(addCustomColorPalette),
    deleteCustomColorPalette: wrapWithErrorHandling(deleteCustomColorPalette),
    loadColorPalette: wrapWithErrorHandlingAsync(loadColorPalette),
    exportColorPalette: wrapWithErrorHandling(exportColorPalette),
    importColorPalette: wrapWithErrorHandlingAsync(importColorPalette)
  };
}, "useColorPaletteService");
var TaskItemDisplayStatus = /* @__PURE__ */ ((TaskItemDisplayStatus2) => {
  TaskItemDisplayStatus2["Running"] = "Running";
  TaskItemDisplayStatus2["Pending"] = "Pending";
  TaskItemDisplayStatus2["Completed"] = "Completed";
  TaskItemDisplayStatus2["Failed"] = "Failed";
  TaskItemDisplayStatus2["Cancelled"] = "Cancelled";
  return TaskItemDisplayStatus2;
})(TaskItemDisplayStatus || {});
class ResultItemImpl {
  static {
    __name(this, "ResultItemImpl");
  }
  filename;
  subfolder;
  type;
  nodeId;
  // 'audio' | 'images' | ...
  mediaType;
  // VHS output specific fields
  format;
  frame_rate;
  constructor(obj) {
    this.filename = obj.filename ?? "";
    this.subfolder = obj.subfolder ?? "";
    this.type = obj.type ?? "";
    this.nodeId = obj.nodeId;
    this.mediaType = obj.mediaType;
    this.format = obj.format;
    this.frame_rate = obj.frame_rate;
  }
  get urlParams() {
    const params = new URLSearchParams();
    params.set("filename", this.filename);
    params.set("type", this.type);
    params.set("subfolder", this.subfolder);
    if (this.format) {
      params.set("format", this.format);
    }
    if (this.frame_rate) {
      params.set("frame_rate", this.frame_rate.toString());
    }
    return params;
  }
  /**
   * VHS advanced preview URL. `/viewvideo` endpoint is provided by VHS node.
   *
   * `/viewvideo` always returns a webm file.
   */
  get vhsAdvancedPreviewUrl() {
    return api.apiURL("/viewvideo?" + this.urlParams);
  }
  get url() {
    return api.apiURL("/view?" + this.urlParams);
  }
  get urlWithTimestamp() {
    return `${this.url}&t=${+/* @__PURE__ */ new Date()}`;
  }
  get isVhsFormat() {
    return !!this.format && !!this.frame_rate;
  }
  get htmlVideoType() {
    const defaultType = void 0;
    if (!this.isVhsFormat) {
      return defaultType;
    }
    if (this.format?.endsWith("webm")) {
      return "video/webm";
    }
    if (this.format?.endsWith("mp4")) {
      return "video/mp4";
    }
    return defaultType;
  }
  get isVideo() {
    return !this.isImage && !!this.format?.startsWith("video/");
  }
  get isGif() {
    return this.filename.endsWith(".gif");
  }
  get isWebp() {
    return this.filename.endsWith(".webp");
  }
  get isImage() {
    return this.mediaType === "images" || this.isGif || this.isWebp;
  }
  get supportsPreview() {
    return this.isImage || this.isVideo;
  }
}
class TaskItemImpl {
  static {
    __name(this, "TaskItemImpl");
  }
  taskType;
  prompt;
  status;
  outputs;
  flatOutputs;
  constructor(taskType, prompt, status, outputs, flatOutputs) {
    this.taskType = taskType;
    this.prompt = prompt;
    this.status = status;
    this.outputs = outputs ?? {};
    this.flatOutputs = flatOutputs ?? this.calculateFlatOutputs();
  }
  calculateFlatOutputs() {
    if (!this.outputs) {
      return [];
    }
    return Object.entries(this.outputs).flatMap(
      ([nodeId, nodeOutputs]) => Object.entries(nodeOutputs).flatMap(
        ([mediaType, items2]) => items2.map(
          (item3) => new ResultItemImpl({
            ...item3,
            nodeId,
            mediaType
          })
        )
      )
    );
  }
  get previewOutput() {
    return this.flatOutputs.find(
      // Prefer saved media files over the temp previews
      (output) => output.type === "output" && output.supportsPreview
    ) ?? this.flatOutputs.find((output) => output.supportsPreview);
  }
  get apiTaskType() {
    switch (this.taskType) {
      case "Running":
      case "Pending":
        return "queue";
      case "History":
        return "history";
    }
  }
  get key() {
    return this.promptId + this.displayStatus;
  }
  get queueIndex() {
    return this.prompt[0];
  }
  get promptId() {
    return this.prompt[1];
  }
  get promptInputs() {
    return this.prompt[2];
  }
  get extraData() {
    return this.prompt[3];
  }
  get outputsToExecute() {
    return this.prompt[4];
  }
  get extraPngInfo() {
    return this.extraData.extra_pnginfo;
  }
  get clientId() {
    return this.extraData.client_id;
  }
  get workflow() {
    return this.extraPngInfo?.workflow;
  }
  get messages() {
    return this.status?.messages || [];
  }
  get interrupted() {
    return _.some(
      this.messages,
      (message3) => message3[0] === "execution_interrupted"
    );
  }
  get isHistory() {
    return this.taskType === "History";
  }
  get isRunning() {
    return this.taskType === "Running";
  }
  get displayStatus() {
    switch (this.taskType) {
      case "Running":
        return "Running";
      case "Pending":
        return "Pending";
      case "History":
        if (this.interrupted) return "Cancelled";
        switch (this.status.status_str) {
          case "success":
            return "Completed";
          case "error":
            return "Failed";
        }
    }
  }
  get executionStartTimestamp() {
    const message3 = this.messages.find(
      (message22) => message22[0] === "execution_start"
    );
    return message3 ? message3[1].timestamp : void 0;
  }
  get executionEndTimestamp() {
    const messages2 = this.messages.filter(
      (message3) => [
        "execution_success",
        "execution_interrupted",
        "execution_error"
      ].includes(message3[0])
    );
    if (!messages2.length) {
      return void 0;
    }
    return _.max(messages2.map((message3) => message3[1].timestamp));
  }
  get executionTime() {
    if (!this.executionStartTimestamp || !this.executionEndTimestamp) {
      return void 0;
    }
    return this.executionEndTimestamp - this.executionStartTimestamp;
  }
  get executionTimeInSeconds() {
    return this.executionTime !== void 0 ? this.executionTime / 1e3 : void 0;
  }
  async loadWorkflow(app2) {
    if (!this.workflow) {
      return;
    }
    await app2.loadGraphData(toRaw(this.workflow));
    if (this.outputs) {
      app2.nodeOutputs = toRaw(this.outputs);
    }
  }
  flatten() {
    if (this.displayStatus !== "Completed") {
      return [this];
    }
    return this.flatOutputs.map(
      (output, i2) => new TaskItemImpl(
        this.taskType,
        [
          this.queueIndex,
          `${this.promptId}-${i2}`,
          this.promptInputs,
          this.extraData,
          this.outputsToExecute
        ],
        this.status,
        {
          [output.nodeId]: {
            [output.mediaType]: [output]
          }
        },
        [output]
      )
    );
  }
}
const useQueueStore = /* @__PURE__ */ defineStore("queue", () => {
  const runningTasks = ref([]);
  const pendingTasks = ref([]);
  const historyTasks = ref([]);
  const maxHistoryItems = ref(64);
  const isLoading = ref(false);
  const tasks = computed(
    () => [
      ...pendingTasks.value,
      ...runningTasks.value,
      ...historyTasks.value
    ]
  );
  const flatTasks = computed(
    () => tasks.value.flatMap((task) => task.flatten())
  );
  const lastHistoryQueueIndex = computed(
    () => historyTasks.value.length ? historyTasks.value[0].queueIndex : -1
  );
  const hasPendingTasks = computed(() => pendingTasks.value.length > 0);
  const update = /* @__PURE__ */ __name(async () => {
    isLoading.value = true;
    try {
      const [queue2, history2] = await Promise.all([
        api.getQueue(),
        api.getHistory(maxHistoryItems.value)
      ]);
      const toClassAll = /* @__PURE__ */ __name((tasks2) => tasks2.map(
        (task) => new TaskItemImpl(
          task.taskType,
          task.prompt,
          // status and outputs only exist on history tasks
          "status" in task ? task.status : void 0,
          "outputs" in task ? task.outputs : void 0
        )
      ).sort((a, b) => b.queueIndex - a.queueIndex), "toClassAll");
      runningTasks.value = toClassAll(queue2.Running);
      pendingTasks.value = toClassAll(queue2.Pending);
      const allIndex = new Set(
        history2.History.map((item3) => item3.prompt[0])
      );
      const newHistoryItems = toClassAll(
        history2.History.filter(
          (item3) => item3.prompt[0] > lastHistoryQueueIndex.value
        )
      );
      const existingHistoryItems = historyTasks.value.filter(
        (item3) => allIndex.has(item3.queueIndex)
      );
      historyTasks.value = [...newHistoryItems, ...existingHistoryItems].slice(0, maxHistoryItems.value).sort((a, b) => b.queueIndex - a.queueIndex);
    } finally {
      isLoading.value = false;
    }
  }, "update");
  const clear2 = /* @__PURE__ */ __name(async (targets = ["queue", "history"]) => {
    if (targets.length === 0) {
      return;
    }
    await Promise.all(targets.map((type) => api.clearItems(type)));
    await update();
  }, "clear");
  const deleteTask = /* @__PURE__ */ __name(async (task) => {
    await api.deleteItem(task.apiTaskType, task.promptId);
    await update();
  }, "deleteTask");
  return {
    runningTasks,
    pendingTasks,
    historyTasks,
    maxHistoryItems,
    isLoading,
    tasks,
    flatTasks,
    lastHistoryQueueIndex,
    hasPendingTasks,
    update,
    clear: clear2,
    delete: deleteTask
  };
});
const useQueuePendingTaskCountStore = /* @__PURE__ */ defineStore(
  "queuePendingTaskCount",
  {
    state: /* @__PURE__ */ __name(() => ({
      count: 0
    }), "state"),
    actions: {
      update(e2) {
        this.count = e2.detail?.exec_info?.queue_remaining || 0;
      }
    }
  }
);
const useQueueSettingsStore = /* @__PURE__ */ defineStore("queueSettingsStore", {
  state: /* @__PURE__ */ __name(() => ({
    mode: "disabled",
    batchCount: 1
  }), "state")
});
var theme$9 = /* @__PURE__ */ __name(function theme30(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-contextmenu {\n    background: ".concat(dt2("contextmenu.background"), ";\n    color: ").concat(dt2("contextmenu.color"), ";\n    border: 1px solid ").concat(dt2("contextmenu.border.color"), ";\n    border-radius: ").concat(dt2("contextmenu.border.radius"), ";\n    box-shadow: ").concat(dt2("contextmenu.shadow"), ";\n    min-width: 12.5rem;\n}\n\n.p-contextmenu-root-list,\n.p-contextmenu-submenu {\n    margin: 0;\n    padding: ").concat(dt2("contextmenu.list.padding"), ";\n    list-style: none;\n    outline: 0 none;\n    display: flex;\n    flex-direction: column;\n    gap: ").concat(dt2("contextmenu.list.gap"), ";\n}\n\n.p-contextmenu-submenu {\n    position: absolute;\n    display: flex;\n    flex-direction: column;\n    min-width: 100%;\n    z-index: 1;\n    background: ").concat(dt2("contextmenu.background"), ";\n    color: ").concat(dt2("contextmenu.color"), ";\n    border: 1px solid ").concat(dt2("contextmenu.border.color"), ";\n    border-radius: ").concat(dt2("contextmenu.border.radius"), ";\n    box-shadow: ").concat(dt2("contextmenu.shadow"), ";\n}\n\n.p-contextmenu-item {\n    position: relative;\n}\n\n.p-contextmenu-item-content {\n    transition: background ").concat(dt2("contextmenu.transition.duration"), ", color ").concat(dt2("contextmenu.transition.duration"), ";\n    border-radius: ").concat(dt2("contextmenu.item.border.radius"), ";\n    color: ").concat(dt2("contextmenu.item.color"), ";\n}\n\n.p-contextmenu-item-link {\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    text-decoration: none;\n    overflow: hidden;\n    position: relative;\n    color: inherit;\n    padding: ").concat(dt2("contextmenu.item.padding"), ";\n    gap: ").concat(dt2("contextmenu.item.gap"), ";\n    user-select: none;\n}\n\n.p-contextmenu-item-label {\n    line-height: 1;\n}\n\n.p-contextmenu-item-icon {\n    color: ").concat(dt2("contextmenu.item.icon.color"), ";\n}\n\n.p-contextmenu-submenu-icon {\n    color: ").concat(dt2("contextmenu.submenu.icon.color"), ";\n    margin-left: auto;\n    font-size: ").concat(dt2("contextmenu.submenu.icon.size"), ";\n    width: ").concat(dt2("contextmenu.submenu.icon.size"), ";\n    height: ").concat(dt2("contextmenu.submenu.icon.size"), ";\n}\n\n.p-contextmenu-item.p-focus > .p-contextmenu-item-content {\n    color: ").concat(dt2("contextmenu.item.focus.color"), ";\n    background: ").concat(dt2("contextmenu.item.focus.background"), ";\n}\n\n.p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-item-icon {\n    color: ").concat(dt2("contextmenu.item.icon.focus.color"), ";\n}\n\n.p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-submenu-icon {\n    color: ").concat(dt2("contextmenu.submenu.icon.focus.color"), ";\n}\n\n.p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover {\n    color: ").concat(dt2("contextmenu.item.focus.color"), ";\n    background: ").concat(dt2("contextmenu.item.focus.background"), ";\n}\n\n.p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-item-icon {\n    color: ").concat(dt2("contextmenu.item.icon.focus.color"), ";\n}\n\n.p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-submenu-icon {\n    color: ").concat(dt2("contextmenu.submenu.icon.focus.color"), ";\n}\n\n.p-contextmenu-item-active > .p-contextmenu-item-content {\n    color: ").concat(dt2("contextmenu.item.active.color"), ";\n    background: ").concat(dt2("contextmenu.item.active.background"), ";\n}\n\n.p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-item-icon {\n    color: ").concat(dt2("contextmenu.item.icon.active.color"), ";\n}\n\n.p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {\n    color: ").concat(dt2("contextmenu.submenu.icon.active.color"), ";\n}\n\n.p-contextmenu-separator {\n    border-top: 1px solid  ").concat(dt2("contextmenu.separator.border.color"), ";\n}\n\n.p-contextmenu-enter-from,\n.p-contextmenu-leave-active {\n    opacity: 0;\n}\n\n.p-contextmenu-enter-active {\n    transition: opacity 250ms;\n}\n");
}, "theme");
var classes$9 = {
  root: "p-contextmenu p-component",
  rootList: "p-contextmenu-root-list",
  item: /* @__PURE__ */ __name(function item2(_ref2) {
    var instance = _ref2.instance, processedItem = _ref2.processedItem;
    return ["p-contextmenu-item", {
      "p-contextmenu-item-active": instance.isItemActive(processedItem),
      "p-focus": instance.isItemFocused(processedItem),
      "p-disabled": instance.isItemDisabled(processedItem)
    }];
  }, "item"),
  itemContent: "p-contextmenu-item-content",
  itemLink: "p-contextmenu-item-link",
  itemIcon: "p-contextmenu-item-icon",
  itemLabel: "p-contextmenu-item-label",
  submenuIcon: "p-contextmenu-submenu-icon",
  submenu: "p-contextmenu-submenu",
  separator: "p-contextmenu-separator"
};
var ContextMenuStyle = BaseStyle.extend({
  name: "contextmenu",
  theme: theme$9,
  classes: classes$9
});
var script$f = {
  name: "AngleRightIcon",
  "extends": script$X
};
var _hoisted_1$t = /* @__PURE__ */ createBaseVNode("path", {
  d: "M5.25 11.1728C5.14929 11.1694 5.05033 11.1455 4.9592 11.1025C4.86806 11.0595 4.78666 10.9984 4.72 10.9228C4.57955 10.7822 4.50066 10.5916 4.50066 10.3928C4.50066 10.1941 4.57955 10.0035 4.72 9.86283L7.72 6.86283L4.72 3.86283C4.66067 3.71882 4.64765 3.55991 4.68275 3.40816C4.71785 3.25642 4.79932 3.11936 4.91585 3.01602C5.03238 2.91268 5.17819 2.84819 5.33305 2.83149C5.4879 2.81479 5.64411 2.84671 5.78 2.92283L9.28 6.42283C9.42045 6.56346 9.49934 6.75408 9.49934 6.95283C9.49934 7.15158 9.42045 7.34221 9.28 7.48283L5.78 10.9228C5.71333 10.9984 5.63193 11.0595 5.5408 11.1025C5.44966 11.1455 5.35071 11.1694 5.25 11.1728Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$l = [_hoisted_1$t];
function render$e(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$l, 16);
}
__name(render$e, "render$e");
script$f.render = render$e;
var script$2$2 = {
  name: "BaseContextMenu",
  "extends": script$_,
  props: {
    model: {
      type: Array,
      "default": null
    },
    appendTo: {
      type: [String, Object],
      "default": "body"
    },
    autoZIndex: {
      type: Boolean,
      "default": true
    },
    baseZIndex: {
      type: Number,
      "default": 0
    },
    global: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: Number,
      "default": 0
    },
    ariaLabelledby: {
      type: String,
      "default": null
    },
    ariaLabel: {
      type: String,
      "default": null
    }
  },
  style: ContextMenuStyle,
  provide: /* @__PURE__ */ __name(function provide32() {
    return {
      $pcContextMenu: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$1$9 = {
  name: "ContextMenuSub",
  hostName: "ContextMenu",
  "extends": script$_,
  emits: ["item-click", "item-mouseenter", "item-mousemove"],
  props: {
    items: {
      type: Array,
      "default": null
    },
    menuId: {
      type: String,
      "default": null
    },
    focusedItemId: {
      type: String,
      "default": null
    },
    root: {
      type: Boolean,
      "default": false
    },
    visible: {
      type: Boolean,
      "default": false
    },
    level: {
      type: Number,
      "default": 0
    },
    templates: {
      type: Object,
      "default": null
    },
    activeItemPath: {
      type: Object,
      "default": null
    },
    tabindex: {
      type: Number,
      "default": 0
    }
  },
  methods: {
    getItemId: /* @__PURE__ */ __name(function getItemId(processedItem) {
      return "".concat(this.menuId, "_").concat(processedItem.key);
    }, "getItemId"),
    getItemKey: /* @__PURE__ */ __name(function getItemKey(processedItem) {
      return this.getItemId(processedItem);
    }, "getItemKey"),
    getItemProp: /* @__PURE__ */ __name(function getItemProp(processedItem, name2, params) {
      return processedItem && processedItem.item ? resolve$1(processedItem.item[name2], params) : void 0;
    }, "getItemProp"),
    getItemLabel: /* @__PURE__ */ __name(function getItemLabel(processedItem) {
      return this.getItemProp(processedItem, "label");
    }, "getItemLabel"),
    getItemLabelId: /* @__PURE__ */ __name(function getItemLabelId(processedItem) {
      return "".concat(this.menuId, "_").concat(processedItem.key, "_label");
    }, "getItemLabelId"),
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions5(key, processedItem, index2) {
      return this.ptm(key, {
        context: {
          item: processedItem.item,
          active: this.isItemActive(processedItem),
          focused: this.isItemFocused(processedItem),
          disabled: this.isItemDisabled(processedItem),
          index: index2
        }
      });
    }, "getPTOptions"),
    isItemActive: /* @__PURE__ */ __name(function isItemActive(processedItem) {
      return this.activeItemPath.some(function(path) {
        return path.key === processedItem.key;
      });
    }, "isItemActive"),
    isItemVisible: /* @__PURE__ */ __name(function isItemVisible(processedItem) {
      return this.getItemProp(processedItem, "visible") !== false;
    }, "isItemVisible"),
    isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled(processedItem) {
      return this.getItemProp(processedItem, "disabled");
    }, "isItemDisabled"),
    isItemFocused: /* @__PURE__ */ __name(function isItemFocused(processedItem) {
      return this.focusedItemId === this.getItemId(processedItem);
    }, "isItemFocused"),
    isItemGroup: /* @__PURE__ */ __name(function isItemGroup(processedItem) {
      return isNotEmpty(processedItem.items);
    }, "isItemGroup"),
    onItemClick: /* @__PURE__ */ __name(function onItemClick(event, processedItem) {
      this.getItemProp(processedItem, "command", {
        originalEvent: event,
        item: processedItem.item
      });
      this.$emit("item-click", {
        originalEvent: event,
        processedItem,
        isFocus: true
      });
    }, "onItemClick"),
    onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter(event, processedItem) {
      this.$emit("item-mouseenter", {
        originalEvent: event,
        processedItem
      });
    }, "onItemMouseEnter"),
    onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove(event, processedItem) {
      this.$emit("item-mousemove", {
        originalEvent: event,
        processedItem,
        isFocus: true
      });
    }, "onItemMouseMove"),
    getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize() {
      var _this = this;
      return this.items.filter(function(processedItem) {
        return _this.isItemVisible(processedItem) && !_this.getItemProp(processedItem, "separator");
      }).length;
    }, "getAriaSetSize"),
    getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset3(index2) {
      var _this2 = this;
      return index2 - this.items.slice(0, index2).filter(function(processedItem) {
        return _this2.isItemVisible(processedItem) && _this2.getItemProp(processedItem, "separator");
      }).length + 1;
    }, "getAriaPosInset"),
    onEnter: /* @__PURE__ */ __name(function onEnter2() {
      nestedPosition(this.$refs.container, this.level);
    }, "onEnter"),
    getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps(processedItem, index2) {
      return {
        action: mergeProps({
          "class": this.cx("itemLink"),
          tabindex: -1,
          "aria-hidden": true
        }, this.getPTOptions("itemLink", processedItem, index2)),
        icon: mergeProps({
          "class": [this.cx("itemIcon"), this.getItemProp(processedItem, "icon")]
        }, this.getPTOptions("itemIcon", processedItem, index2)),
        label: mergeProps({
          "class": this.cx("itemLabel")
        }, this.getPTOptions("itemLabel", processedItem, index2)),
        submenuicon: mergeProps({
          "class": this.cx("submenuIcon")
        }, this.getPTOptions("submenuicon", processedItem, index2))
      };
    }, "getMenuItemProps")
  },
  components: {
    AngleRightIcon: script$f
  },
  directives: {
    ripple: Ripple
  }
};
var _hoisted_1$s = ["tabindex"];
var _hoisted_2$k = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"];
var _hoisted_3$a = ["onClick", "onMouseenter", "onMousemove"];
var _hoisted_4$7 = ["href", "target"];
var _hoisted_5$6 = ["id"];
var _hoisted_6$5 = ["id"];
function render$1$2(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_AngleRightIcon = resolveComponent("AngleRightIcon");
  var _component_ContextMenuSub = resolveComponent("ContextMenuSub", true);
  var _directive_ripple = resolveDirective("ripple");
  return openBlock(), createBlock(Transition, mergeProps({
    name: "p-contextmenusub",
    onEnter: $options.onEnter
  }, _ctx.ptm("menu.transition")), {
    "default": withCtx(function() {
      return [($props.root ? true : $props.visible) ? (openBlock(), createElementBlock("ul", mergeProps({
        key: 0,
        ref: "container",
        tabindex: $props.tabindex
      }, _ctx.ptm("rootList")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($props.items, function(processedItem, index2) {
        return openBlock(), createElementBlock(Fragment$1, {
          key: $options.getItemKey(processedItem)
        }, [$options.isItemVisible(processedItem) && !$options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({
          key: 0,
          id: $options.getItemId(processedItem),
          style: $options.getItemProp(processedItem, "style"),
          "class": [_ctx.cx("item", {
            processedItem
          }), $options.getItemProp(processedItem, "class")],
          role: "menuitem",
          "aria-label": $options.getItemLabel(processedItem),
          "aria-disabled": $options.isItemDisabled(processedItem) || void 0,
          "aria-expanded": $options.isItemGroup(processedItem) ? $options.isItemActive(processedItem) : void 0,
          "aria-haspopup": $options.isItemGroup(processedItem) && !$options.getItemProp(processedItem, "to") ? "menu" : void 0,
          "aria-level": $props.level + 1,
          "aria-setsize": $options.getAriaSetSize(),
          "aria-posinset": $options.getAriaPosInset(index2),
          ref_for: true
        }, $options.getPTOptions("item", processedItem, index2), {
          "data-p-active": $options.isItemActive(processedItem),
          "data-p-focused": $options.isItemFocused(processedItem),
          "data-p-disabled": $options.isItemDisabled(processedItem)
        }), [createBaseVNode("div", mergeProps({
          "class": _ctx.cx("itemContent"),
          onClick: /* @__PURE__ */ __name(function onClick3($event) {
            return $options.onItemClick($event, processedItem);
          }, "onClick"),
          onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) {
            return $options.onItemMouseEnter($event, processedItem);
          }, "onMouseenter"),
          onMousemove: /* @__PURE__ */ __name(function onMousemove($event) {
            return $options.onItemMouseMove($event, processedItem);
          }, "onMousemove"),
          ref_for: true
        }, $options.getPTOptions("itemContent", processedItem, index2)), [!$props.templates.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({
          key: 0,
          href: $options.getItemProp(processedItem, "url"),
          "class": _ctx.cx("itemLink"),
          target: $options.getItemProp(processedItem, "target"),
          tabindex: "-1",
          ref_for: true
        }, $options.getPTOptions("itemLink", processedItem, index2)), [$props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), {
          key: 0,
          item: processedItem.item,
          "class": normalizeClass(_ctx.cx("itemIcon"))
        }, null, 8, ["item", "class"])) : $options.getItemProp(processedItem, "icon") ? (openBlock(), createElementBlock("span", mergeProps({
          key: 1,
          "class": [_ctx.cx("itemIcon"), $options.getItemProp(processedItem, "icon")],
          ref_for: true
        }, $options.getPTOptions("itemIcon", processedItem, index2)), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
          id: $options.getItemLabelId(processedItem),
          "class": _ctx.cx("itemLabel"),
          ref_for: true
        }, $options.getPTOptions("itemLabel", processedItem, index2)), toDisplayString$1($options.getItemLabel(processedItem)), 17, _hoisted_5$6), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment$1, {
          key: 2
        }, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), {
          key: 0,
          active: $options.isItemActive(processedItem),
          "class": normalizeClass(_ctx.cx("submenuIcon"))
        }, null, 8, ["active", "class"])) : (openBlock(), createBlock(_component_AngleRightIcon, mergeProps({
          key: 1,
          "class": _ctx.cx("submenuIcon"),
          ref_for: true
        }, $options.getPTOptions("submenuicon", processedItem, index2)), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_4$7)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), {
          key: 1,
          item: processedItem.item,
          hasSubmenu: $options.getItemProp(processedItem, "items"),
          label: $options.getItemLabel(processedItem),
          props: $options.getMenuItemProps(processedItem, index2)
        }, null, 8, ["item", "hasSubmenu", "label", "props"]))], 16, _hoisted_3$a), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_ContextMenuSub, mergeProps({
          key: 0,
          id: $options.getItemId(processedItem) + "_list",
          role: "menu",
          "class": _ctx.cx("submenu"),
          menuId: $props.menuId,
          focusedItemId: $props.focusedItemId,
          items: processedItem.items,
          templates: $props.templates,
          activeItemPath: $props.activeItemPath,
          level: $props.level + 1,
          visible: $options.isItemActive(processedItem) && $options.isItemGroup(processedItem),
          pt: _ctx.pt,
          unstyled: _ctx.unstyled,
          onItemClick: _cache[0] || (_cache[0] = function($event) {
            return _ctx.$emit("item-click", $event);
          }),
          onItemMouseenter: _cache[1] || (_cache[1] = function($event) {
            return _ctx.$emit("item-mouseenter", $event);
          }),
          onItemMousemove: _cache[2] || (_cache[2] = function($event) {
            return _ctx.$emit("item-mousemove", $event);
          }),
          "aria-labelledby": $options.getItemLabelId(processedItem),
          ref_for: true
        }, _ctx.ptm("submenu")), null, 16, ["id", "class", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "level", "visible", "pt", "unstyled", "aria-labelledby"])) : createCommentVNode("", true)], 16, _hoisted_2$k)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({
          key: 1,
          id: $options.getItemId(processedItem),
          style: $options.getItemProp(processedItem, "style"),
          "class": [_ctx.cx("separator"), $options.getItemProp(processedItem, "class")],
          role: "separator",
          ref_for: true
        }, _ctx.ptm("separator")), null, 16, _hoisted_6$5)) : createCommentVNode("", true)], 64);
      }), 128))], 16, _hoisted_1$s)) : createCommentVNode("", true)];
    }),
    _: 1
  }, 16, ["onEnter"]);
}
__name(render$1$2, "render$1$2");
script$1$9.render = render$1$2;
var script$e = {
  name: "ContextMenu",
  "extends": script$2$2,
  inheritAttrs: false,
  emits: ["focus", "blur", "show", "hide", "before-show", "before-hide"],
  target: null,
  outsideClickListener: null,
  resizeListener: null,
  documentContextMenuListener: null,
  pageX: null,
  pageY: null,
  container: null,
  list: null,
  data: /* @__PURE__ */ __name(function data15() {
    return {
      id: this.$attrs.id,
      focused: false,
      focusedItemInfo: {
        index: -1,
        level: 0,
        parentKey: ""
      },
      activeItemPath: [],
      visible: false,
      submenuVisible: false
    };
  }, "data"),
  watch: {
    "$attrs.id": /* @__PURE__ */ __name(function $attrsId7(newValue2) {
      this.id = newValue2 || UniqueComponentId();
    }, "$attrsId"),
    activeItemPath: /* @__PURE__ */ __name(function activeItemPath(newPath) {
      if (isNotEmpty(newPath)) {
        this.bindOutsideClickListener();
        this.bindResizeListener();
      } else if (!this.visible) {
        this.unbindOutsideClickListener();
        this.unbindResizeListener();
      }
    }, "activeItemPath")
  },
  mounted: /* @__PURE__ */ __name(function mounted15() {
    this.id = this.id || UniqueComponentId();
    if (this.global) {
      this.bindDocumentContextMenuListener();
    }
  }, "mounted"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount8() {
    this.unbindResizeListener();
    this.unbindOutsideClickListener();
    this.unbindDocumentContextMenuListener();
    if (this.container && this.autoZIndex) {
      ZIndex.clear(this.container);
    }
    this.target = null;
    this.container = null;
  }, "beforeUnmount"),
  methods: {
    getItemProp: /* @__PURE__ */ __name(function getItemProp2(item3, name2) {
      return item3 ? resolve$1(item3[name2]) : void 0;
    }, "getItemProp"),
    getItemLabel: /* @__PURE__ */ __name(function getItemLabel2(item3) {
      return this.getItemProp(item3, "label");
    }, "getItemLabel"),
    isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled2(item3) {
      return this.getItemProp(item3, "disabled");
    }, "isItemDisabled"),
    isItemVisible: /* @__PURE__ */ __name(function isItemVisible2(item3) {
      return this.getItemProp(item3, "visible") !== false;
    }, "isItemVisible"),
    isItemGroup: /* @__PURE__ */ __name(function isItemGroup2(item3) {
      return isNotEmpty(this.getItemProp(item3, "items"));
    }, "isItemGroup"),
    isItemSeparator: /* @__PURE__ */ __name(function isItemSeparator(item3) {
      return this.getItemProp(item3, "separator");
    }, "isItemSeparator"),
    getProccessedItemLabel: /* @__PURE__ */ __name(function getProccessedItemLabel(processedItem) {
      return processedItem ? this.getItemLabel(processedItem.item) : void 0;
    }, "getProccessedItemLabel"),
    isProccessedItemGroup: /* @__PURE__ */ __name(function isProccessedItemGroup(processedItem) {
      return processedItem && isNotEmpty(processedItem.items);
    }, "isProccessedItemGroup"),
    toggle: /* @__PURE__ */ __name(function toggle(event) {
      this.visible ? this.hide() : this.show(event);
    }, "toggle"),
    show: /* @__PURE__ */ __name(function show3(event) {
      this.$emit("before-show");
      this.activeItemPath = [];
      this.focusedItemInfo = {
        index: -1,
        level: 0,
        parentKey: ""
      };
      focus$1(this.list);
      this.pageX = event.pageX;
      this.pageY = event.pageY;
      this.visible ? this.position() : this.visible = true;
      event.stopPropagation();
      event.preventDefault();
    }, "show"),
    hide: /* @__PURE__ */ __name(function hide3() {
      this.$emit("before-hide");
      this.visible = false;
      this.activeItemPath = [];
      this.focusedItemInfo = {
        index: -1,
        level: 0,
        parentKey: ""
      };
    }, "hide"),
    onFocus: /* @__PURE__ */ __name(function onFocus5(event) {
      this.focused = true;
      this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : {
        index: -1,
        level: 0,
        parentKey: ""
      };
      this.$emit("focus", event);
    }, "onFocus"),
    onBlur: /* @__PURE__ */ __name(function onBlur5(event) {
      this.focused = false;
      this.focusedItemInfo = {
        index: -1,
        level: 0,
        parentKey: ""
      };
      this.searchValue = "";
      this.$emit("blur", event);
    }, "onBlur"),
    onKeyDown: /* @__PURE__ */ __name(function onKeyDown6(event) {
      var metaKey = event.metaKey || event.ctrlKey;
      switch (event.code) {
        case "ArrowDown":
          this.onArrowDownKey(event);
          break;
        case "ArrowUp":
          this.onArrowUpKey(event);
          break;
        case "ArrowLeft":
          this.onArrowLeftKey(event);
          break;
        case "ArrowRight":
          this.onArrowRightKey(event);
          break;
        case "Home":
          this.onHomeKey(event);
          break;
        case "End":
          this.onEndKey(event);
          break;
        case "Space":
          this.onSpaceKey(event);
          break;
        case "Enter":
        case "NumpadEnter":
          this.onEnterKey(event);
          break;
        case "Escape":
          this.onEscapeKey(event);
          break;
        case "Tab":
          this.onTabKey(event);
          break;
        case "PageDown":
        case "PageUp":
        case "Backspace":
        case "ShiftLeft":
        case "ShiftRight":
          break;
        default:
          if (!metaKey && isPrintableCharacter(event.key)) {
            this.searchItems(event, event.key);
          }
          break;
      }
    }, "onKeyDown"),
    onItemChange: /* @__PURE__ */ __name(function onItemChange(event) {
      var processedItem = event.processedItem, isFocus = event.isFocus;
      if (isEmpty$1(processedItem)) return;
      var index2 = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey, items2 = processedItem.items;
      var grouped = isNotEmpty(items2);
      var activeItemPath2 = this.activeItemPath.filter(function(p2) {
        return p2.parentKey !== parentKey && p2.parentKey !== key;
      });
      if (grouped) {
        activeItemPath2.push(processedItem);
        this.submenuVisible = true;
      }
      this.focusedItemInfo = {
        index: index2,
        level,
        parentKey
      };
      this.activeItemPath = activeItemPath2;
      isFocus && focus$1(this.list);
    }, "onItemChange"),
    onItemClick: /* @__PURE__ */ __name(function onItemClick2(event) {
      var processedItem = event.processedItem;
      var grouped = this.isProccessedItemGroup(processedItem);
      var selected2 = this.isSelected(processedItem);
      if (selected2) {
        var index2 = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey;
        this.activeItemPath = this.activeItemPath.filter(function(p2) {
          return key !== p2.key && key.startsWith(p2.key);
        });
        this.focusedItemInfo = {
          index: index2,
          level,
          parentKey
        };
        focus$1(this.list);
      } else {
        grouped ? this.onItemChange(event) : this.hide();
      }
    }, "onItemClick"),
    onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter2(event) {
      this.onItemChange(event);
    }, "onItemMouseEnter"),
    onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove2(event) {
      if (this.focused) {
        this.changeFocusedItemIndex(event, event.processedItem.index);
      }
    }, "onItemMouseMove"),
    onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey3(event) {
      var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex();
      this.changeFocusedItemIndex(event, itemIndex);
      event.preventDefault();
    }, "onArrowDownKey"),
    onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey3(event) {
      if (event.altKey) {
        if (this.focusedItemInfo.index !== -1) {
          var processedItem = this.visibleItems[this.focusedItemInfo.index];
          var grouped = this.isProccessedItemGroup(processedItem);
          !grouped && this.onItemChange({
            originalEvent: event,
            processedItem
          });
        }
        this.popup && this.hide();
        event.preventDefault();
      } else {
        var itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex();
        this.changeFocusedItemIndex(event, itemIndex);
        event.preventDefault();
      }
    }, "onArrowUpKey"),
    onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey3(event) {
      var _this = this;
      var processedItem = this.visibleItems[this.focusedItemInfo.index];
      var parentItem = this.activeItemPath.find(function(p2) {
        return p2.key === processedItem.parentKey;
      });
      var root24 = isEmpty$1(processedItem.parent);
      if (!root24) {
        this.focusedItemInfo = {
          index: -1,
          parentKey: parentItem ? parentItem.parentKey : ""
        };
        this.searchValue = "";
        this.onArrowDownKey(event);
      }
      this.activeItemPath = this.activeItemPath.filter(function(p2) {
        return p2.parentKey !== _this.focusedItemInfo.parentKey;
      });
      event.preventDefault();
    }, "onArrowLeftKey"),
    onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey(event) {
      var processedItem = this.visibleItems[this.focusedItemInfo.index];
      var grouped = this.isProccessedItemGroup(processedItem);
      if (grouped) {
        this.onItemChange({
          originalEvent: event,
          processedItem
        });
        this.focusedItemInfo = {
          index: -1,
          parentKey: processedItem.key
        };
        this.searchValue = "";
        this.onArrowDownKey(event);
      }
      event.preventDefault();
    }, "onArrowRightKey"),
    onHomeKey: /* @__PURE__ */ __name(function onHomeKey4(event) {
      this.changeFocusedItemIndex(event, this.findFirstItemIndex());
      event.preventDefault();
    }, "onHomeKey"),
    onEndKey: /* @__PURE__ */ __name(function onEndKey4(event) {
      this.changeFocusedItemIndex(event, this.findLastItemIndex());
      event.preventDefault();
    }, "onEndKey"),
    onEnterKey: /* @__PURE__ */ __name(function onEnterKey3(event) {
      if (this.focusedItemInfo.index !== -1) {
        var element = findSingle(this.list, 'li[id="'.concat("".concat(this.focusedItemIdx), '"]'));
        var anchorElement = element && findSingle(element, '[data-pc-section="itemlink"]');
        anchorElement ? anchorElement.click() : element && element.click();
        var processedItem = this.visibleItems[this.focusedItemInfo.index];
        var grouped = this.isProccessedItemGroup(processedItem);
        !grouped && (this.focusedItemInfo.index = this.findFirstFocusedItemIndex());
      }
      event.preventDefault();
    }, "onEnterKey"),
    onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey3(event) {
      this.onEnterKey(event);
    }, "onSpaceKey"),
    onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey2(event) {
      this.hide();
      !this.popup && (this.focusedItemInfo.index = this.findFirstFocusedItemIndex());
      event.preventDefault();
    }, "onEscapeKey"),
    onTabKey: /* @__PURE__ */ __name(function onTabKey3(event) {
      if (this.focusedItemInfo.index !== -1) {
        var processedItem = this.visibleItems[this.focusedItemInfo.index];
        var grouped = this.isProccessedItemGroup(processedItem);
        !grouped && this.onItemChange({
          originalEvent: event,
          processedItem
        });
      }
      this.hide();
    }, "onTabKey"),
    onEnter: /* @__PURE__ */ __name(function onEnter3(el) {
      addStyle(el, {
        position: "absolute"
      });
      this.position();
      if (this.autoZIndex) {
        ZIndex.set("menu", el, this.baseZIndex + this.$primevue.config.zIndex.menu);
      }
    }, "onEnter"),
    onAfterEnter: /* @__PURE__ */ __name(function onAfterEnter2() {
      this.bindOutsideClickListener();
      this.bindResizeListener();
      this.$emit("show");
      focus$1(this.list);
    }, "onAfterEnter"),
    onLeave: /* @__PURE__ */ __name(function onLeave2() {
      this.$emit("hide");
      this.container = null;
    }, "onLeave"),
    onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave2(el) {
      if (this.autoZIndex) {
        ZIndex.clear(el);
      }
      this.unbindOutsideClickListener();
      this.unbindResizeListener();
    }, "onAfterLeave"),
    position: /* @__PURE__ */ __name(function position() {
      var left = this.pageX + 1;
      var top = this.pageY + 1;
      var width2 = this.container.offsetParent ? this.container.offsetWidth : getHiddenElementOuterWidth(this.container);
      var height = this.container.offsetParent ? this.container.offsetHeight : getHiddenElementOuterHeight(this.container);
      var viewport = getViewport();
      if (left + width2 - document.body.scrollLeft > viewport.width) {
        left -= width2;
      }
      if (top + height - document.body.scrollTop > viewport.height) {
        top -= height;
      }
      if (left < document.body.scrollLeft) {
        left = document.body.scrollLeft;
      }
      if (top < document.body.scrollTop) {
        top = document.body.scrollTop;
      }
      this.container.style.left = left + "px";
      this.container.style.top = top + "px";
    }, "position"),
    bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener3() {
      var _this2 = this;
      if (!this.outsideClickListener) {
        this.outsideClickListener = function(event) {
          var isOutsideContainer = _this2.container && !_this2.container.contains(event.target);
          var isOutsideTarget = _this2.visible ? !(_this2.target && (_this2.target === event.target || _this2.target.contains(event.target))) : true;
          if (isOutsideContainer && isOutsideTarget) {
            _this2.hide();
          }
        };
        document.addEventListener("click", this.outsideClickListener);
      }
    }, "bindOutsideClickListener"),
    unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener3() {
      if (this.outsideClickListener) {
        document.removeEventListener("click", this.outsideClickListener);
        this.outsideClickListener = null;
      }
    }, "unbindOutsideClickListener"),
    bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener4() {
      var _this3 = this;
      if (!this.resizeListener) {
        this.resizeListener = function() {
          if (_this3.visible && !isTouchDevice()) {
            _this3.hide();
          }
        };
        window.addEventListener("resize", this.resizeListener);
      }
    }, "bindResizeListener"),
    unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener4() {
      if (this.resizeListener) {
        window.removeEventListener("resize", this.resizeListener);
        this.resizeListener = null;
      }
    }, "unbindResizeListener"),
    bindDocumentContextMenuListener: /* @__PURE__ */ __name(function bindDocumentContextMenuListener() {
      var _this4 = this;
      if (!this.documentContextMenuListener) {
        this.documentContextMenuListener = function(event) {
          event.button === 2 && _this4.show(event);
        };
        document.addEventListener("contextmenu", this.documentContextMenuListener);
      }
    }, "bindDocumentContextMenuListener"),
    unbindDocumentContextMenuListener: /* @__PURE__ */ __name(function unbindDocumentContextMenuListener() {
      if (this.documentContextMenuListener) {
        document.removeEventListener("contextmenu", this.documentContextMenuListener);
        this.documentContextMenuListener = null;
      }
    }, "unbindDocumentContextMenuListener"),
    isItemMatched: /* @__PURE__ */ __name(function isItemMatched(processedItem) {
      var _this$getProccessedIt;
      return this.isValidItem(processedItem) && ((_this$getProccessedIt = this.getProccessedItemLabel(processedItem)) === null || _this$getProccessedIt === void 0 ? void 0 : _this$getProccessedIt.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase()));
    }, "isItemMatched"),
    isValidItem: /* @__PURE__ */ __name(function isValidItem(processedItem) {
      return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item);
    }, "isValidItem"),
    isValidSelectedItem: /* @__PURE__ */ __name(function isValidSelectedItem(processedItem) {
      return this.isValidItem(processedItem) && this.isSelected(processedItem);
    }, "isValidSelectedItem"),
    isSelected: /* @__PURE__ */ __name(function isSelected3(processedItem) {
      return this.activeItemPath.some(function(p2) {
        return p2.key === processedItem.key;
      });
    }, "isSelected"),
    findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex() {
      var _this5 = this;
      return this.visibleItems.findIndex(function(processedItem) {
        return _this5.isValidItem(processedItem);
      });
    }, "findFirstItemIndex"),
    findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex() {
      var _this6 = this;
      return findLastIndex(this.visibleItems, function(processedItem) {
        return _this6.isValidItem(processedItem);
      });
    }, "findLastItemIndex"),
    findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex(index2) {
      var _this7 = this;
      var matchedItemIndex = index2 < this.visibleItems.length - 1 ? this.visibleItems.slice(index2 + 1).findIndex(function(processedItem) {
        return _this7.isValidItem(processedItem);
      }) : -1;
      return matchedItemIndex > -1 ? matchedItemIndex + index2 + 1 : index2;
    }, "findNextItemIndex"),
    findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex(index2) {
      var _this8 = this;
      var matchedItemIndex = index2 > 0 ? findLastIndex(this.visibleItems.slice(0, index2), function(processedItem) {
        return _this8.isValidItem(processedItem);
      }) : -1;
      return matchedItemIndex > -1 ? matchedItemIndex : index2;
    }, "findPrevItemIndex"),
    findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex() {
      var _this9 = this;
      return this.visibleItems.findIndex(function(processedItem) {
        return _this9.isValidSelectedItem(processedItem);
      });
    }, "findSelectedItemIndex"),
    findFirstFocusedItemIndex: /* @__PURE__ */ __name(function findFirstFocusedItemIndex() {
      var selectedIndex = this.findSelectedItemIndex();
      return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex;
    }, "findFirstFocusedItemIndex"),
    findLastFocusedItemIndex: /* @__PURE__ */ __name(function findLastFocusedItemIndex() {
      var selectedIndex = this.findSelectedItemIndex();
      return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex;
    }, "findLastFocusedItemIndex"),
    searchItems: /* @__PURE__ */ __name(function searchItems(event, _char) {
      var _this10 = this;
      this.searchValue = (this.searchValue || "") + _char;
      var itemIndex = -1;
      var matched = false;
      if (this.focusedItemInfo.index !== -1) {
        itemIndex = this.visibleItems.slice(this.focusedItemInfo.index).findIndex(function(processedItem) {
          return _this10.isItemMatched(processedItem);
        });
        itemIndex = itemIndex === -1 ? this.visibleItems.slice(0, this.focusedItemInfo.index).findIndex(function(processedItem) {
          return _this10.isItemMatched(processedItem);
        }) : itemIndex + this.focusedItemInfo.index;
      } else {
        itemIndex = this.visibleItems.findIndex(function(processedItem) {
          return _this10.isItemMatched(processedItem);
        });
      }
      if (itemIndex !== -1) {
        matched = true;
      }
      if (itemIndex === -1 && this.focusedItemInfo.index === -1) {
        itemIndex = this.findFirstFocusedItemIndex();
      }
      if (itemIndex !== -1) {
        this.changeFocusedItemIndex(event, itemIndex);
      }
      if (this.searchTimeout) {
        clearTimeout(this.searchTimeout);
      }
      this.searchTimeout = setTimeout(function() {
        _this10.searchValue = "";
        _this10.searchTimeout = null;
      }, 500);
      return matched;
    }, "searchItems"),
    changeFocusedItemIndex: /* @__PURE__ */ __name(function changeFocusedItemIndex(event, index2) {
      if (this.focusedItemInfo.index !== index2) {
        this.focusedItemInfo.index = index2;
        this.scrollInView();
      }
    }, "changeFocusedItemIndex"),
    scrollInView: /* @__PURE__ */ __name(function scrollInView6() {
      var index2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
      var id3 = index2 !== -1 ? "".concat(this.id, "_").concat(index2) : this.focusedItemIdx;
      var element = findSingle(this.list, 'li[id="'.concat(id3, '"]'));
      if (element) {
        element.scrollIntoView && element.scrollIntoView({
          block: "nearest",
          inline: "start"
        });
      }
    }, "scrollInView"),
    createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems(items2) {
      var _this11 = this;
      var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
      var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
      var processedItems2 = [];
      items2 && items2.forEach(function(item3, index2) {
        var key = (parentKey !== "" ? parentKey + "_" : "") + index2;
        var newItem = {
          item: item3,
          index: index2,
          level,
          key,
          parent,
          parentKey
        };
        newItem["items"] = _this11.createProcessedItems(item3.items, level + 1, newItem, key);
        processedItems2.push(newItem);
      });
      return processedItems2;
    }, "createProcessedItems"),
    containerRef: /* @__PURE__ */ __name(function containerRef2(el) {
      this.container = el;
    }, "containerRef"),
    listRef: /* @__PURE__ */ __name(function listRef3(el) {
      this.list = el ? el.$el : void 0;
    }, "listRef")
  },
  computed: {
    processedItems: /* @__PURE__ */ __name(function processedItems() {
      return this.createProcessedItems(this.model || []);
    }, "processedItems"),
    visibleItems: /* @__PURE__ */ __name(function visibleItems() {
      var _this12 = this;
      var processedItem = this.activeItemPath.find(function(p2) {
        return p2.key === _this12.focusedItemInfo.parentKey;
      });
      return processedItem ? processedItem.items : this.processedItems;
    }, "visibleItems"),
    focusedItemIdx: /* @__PURE__ */ __name(function focusedItemIdx() {
      return this.focusedItemInfo.index !== -1 ? "".concat(this.id).concat(isNotEmpty(this.focusedItemInfo.parentKey) ? "_" + this.focusedItemInfo.parentKey : "", "_").concat(this.focusedItemInfo.index) : null;
    }, "focusedItemIdx")
  },
  components: {
    ContextMenuSub: script$1$9,
    Portal: script$Q
  }
};
function render$d(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_ContextMenuSub = resolveComponent("ContextMenuSub");
  var _component_Portal = resolveComponent("Portal");
  return openBlock(), createBlock(_component_Portal, {
    appendTo: _ctx.appendTo
  }, {
    "default": withCtx(function() {
      return [createVNode(Transition, mergeProps({
        name: "p-contextmenu",
        onEnter: $options.onEnter,
        onAfterEnter: $options.onAfterEnter,
        onLeave: $options.onLeave,
        onAfterLeave: $options.onAfterLeave
      }, _ctx.ptm("transition")), {
        "default": withCtx(function() {
          return [$data.visible ? (openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            ref: $options.containerRef,
            "class": _ctx.cx("root")
          }, _ctx.ptmi("root")), [createVNode(_component_ContextMenuSub, {
            ref: $options.listRef,
            id: $data.id + "_list",
            "class": normalizeClass(_ctx.cx("rootList")),
            role: "menubar",
            root: true,
            tabindex: _ctx.tabindex,
            "aria-orientation": "vertical",
            "aria-activedescendant": $data.focused ? $options.focusedItemIdx : void 0,
            menuId: $data.id,
            focusedItemId: $data.focused ? $options.focusedItemIdx : void 0,
            items: $options.processedItems,
            templates: _ctx.$slots,
            activeItemPath: $data.activeItemPath,
            "aria-labelledby": _ctx.ariaLabelledby,
            "aria-label": _ctx.ariaLabel,
            level: 0,
            visible: $data.submenuVisible,
            pt: _ctx.pt,
            unstyled: _ctx.unstyled,
            onFocus: $options.onFocus,
            onBlur: $options.onBlur,
            onKeydown: $options.onKeyDown,
            onItemClick: $options.onItemClick,
            onItemMouseenter: $options.onItemMouseEnter,
            onItemMousemove: $options.onItemMouseMove
          }, null, 8, ["id", "class", "tabindex", "aria-activedescendant", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "aria-labelledby", "aria-label", "visible", "pt", "unstyled", "onFocus", "onBlur", "onKeydown", "onItemClick", "onItemMouseenter", "onItemMousemove"])], 16)) : createCommentVNode("", true)];
        }),
        _: 1
      }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])];
    }),
    _: 1
  }, 8, ["appendTo"]);
}
__name(render$d, "render$d");
script$e.render = render$d;
var theme$8 = /* @__PURE__ */ __name(function theme31(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-tree {\n    background: ".concat(dt2("tree.background"), ";\n    color: ").concat(dt2("tree.color"), ";\n    padding: ").concat(dt2("tree.padding"), ";\n}\n\n.p-tree-root-children,\n.p-tree-node-children {\n    display: flex;\n    list-style-type: none;\n    flex-direction: column;\n    margin: 0;\n    gap: ").concat(dt2("tree.gap"), ";\n}\n\n.p-tree-root-children {\n    padding: ").concat(dt2("tree.gap"), " 0 0 0;\n}\n\n.p-tree-node-children {\n    padding: ").concat(dt2("tree.gap"), " 0 0 ").concat(dt2("tree.indent"), ";\n}\n\n.p-tree-node {\n    padding: 0;\n    outline: 0 none;\n}\n\n.p-tree-node-content {\n    border-radius: ").concat(dt2("tree.node.border.radius"), ";\n    padding: ").concat(dt2("tree.node.padding"), ";\n    display: flex;\n    align-items: center;\n    outline-color: transparent;\n    color: ").concat(dt2("tree.node.color"), ";\n    gap: ").concat(dt2("tree.node.gap"), ";\n    transition: background ").concat(dt2("tree.transition.duration"), ", color ").concat(dt2("tree.transition.duration"), ", outline-color ").concat(dt2("tree.transition.duration"), ", box-shadow ").concat(dt2("tree.transition.duration"), ";\n}\n\n.p-tree-node:focus-visible > .p-tree-node-content {\n    box-shadow: ").concat(dt2("tree.node.focus.ring.shadow"), ";\n    outline: ").concat(dt2("tree.node.focus.ring.width"), " ").concat(dt2("tree.node.focus.ring.style"), " ").concat(dt2("tree.node.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("tree.node.focus.ring.offset"), ";\n}\n\n.p-tree-node-content.p-tree-node-selectable:not(.p-tree-node-selected):hover {\n    background: ").concat(dt2("tree.node.hover.background"), ";\n    color: ").concat(dt2("tree.node.hover.color"), ";\n}\n\n.p-tree-node-content.p-tree-node-selectable:not(.p-tree-node-selected):hover .p-tree-node-icon {\n    color: ").concat(dt2("tree.node.icon.hover.color"), ";\n}\n\n.p-tree-node-content.p-tree-node-selected {\n    background: ").concat(dt2("tree.node.selected.background"), ";\n    color: ").concat(dt2("tree.node.selected.color"), ";\n}\n\n.p-tree-node-content.p-tree-node-selected .p-tree-node-toggle-button {\n    color: inherit;\n}\n\n.p-tree-node-toggle-button {\n    cursor: pointer;\n    user-select: none;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    overflow: hidden;\n    position: relative;\n    flex-shrink: 0;\n    width: ").concat(dt2("tree.node.toggle.button.size"), ";\n    height: ").concat(dt2("tree.node.toggle.button.size"), ";\n    color: ").concat(dt2("tree.node.toggle.button.color"), ";\n    border: 0 none;\n    background: transparent;\n    border-radius: ").concat(dt2("tree.node.toggle.button.border.radius"), ";\n    transition: background ").concat(dt2("tree.transition.duration"), ", color ").concat(dt2("tree.transition.duration"), ", border-color ").concat(dt2("tree.transition.duration"), ", outline-color ").concat(dt2("tree.transition.duration"), ", box-shadow ").concat(dt2("tree.transition.duration"), ";\n    outline-color: transparent;\n    padding: 0;\n}\n\n.p-tree-node-toggle-button:enabled:hover {\n    background: ").concat(dt2("tree.node.toggle.button.hover.background"), ";\n    color: ").concat(dt2("tree.node.toggle.button.hover.color"), ";\n}\n\n.p-tree-node-content.p-tree-node-selected .p-tree-node-toggle-button:hover {\n    background: ").concat(dt2("tree.node.toggle.button.selected.hover.background"), ";\n    color: ").concat(dt2("tree.node.toggle.button.selected.hover.color"), ";\n}\n\n.p-tree-root {\n    overflow: auto;\n}\n\n.p-tree-node-selectable {\n    cursor: pointer;\n    user-select: none;\n}\n\n.p-tree-node-leaf > .p-tree-node-content .p-tree-node-toggle-button {\n    visibility: hidden;\n}\n\n.p-tree-node-icon {\n    color: ").concat(dt2("tree.node.icon.color"), ";\n    transition: color ").concat(dt2("tree.transition.duration"), ";\n}\n\n.p-tree-node-content.p-tree-node-selected .p-tree-node-icon {\n    color: ").concat(dt2("tree.node.icon.selected.color"), ";\n}\n\n.p-tree-filter-input {\n    width: 100%;\n}\n\n.p-tree-loading {\n    position: relative;\n    height: 100%;\n}\n\n.p-tree-loading-icon {\n    font-size: ").concat(dt2("tree.loading.icon.size"), ";\n    width: ").concat(dt2("tree.loading.icon.size"), ";\n    height: ").concat(dt2("tree.loading.icon.size"), ";\n}\n\n.p-tree .p-tree-mask {\n    position: absolute;\n    z-index: 1;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.p-tree-flex-scrollable {\n    display: flex;\n    flex: 1;\n    height: 100%;\n    flex-direction: column;\n}\n\n.p-tree-flex-scrollable .p-tree-root {\n    flex: 1;\n}\n");
}, "theme");
var classes$8 = {
  root: /* @__PURE__ */ __name(function root19(_ref2) {
    var props = _ref2.props;
    return ["p-tree p-component", {
      "p-tree-selectable": props.selectionMode != null,
      "p-tree-loading": props.loading,
      "p-tree-flex-scrollable": props.scrollHeight === "flex"
    }];
  }, "root"),
  mask: "p-tree-mask p-overlay-mask",
  loadingIcon: "p-tree-loading-icon",
  pcFilterInput: "p-tree-filter-input",
  wrapper: "p-tree-root",
  //TODO: discuss
  rootChildren: "p-tree-root-children",
  node: /* @__PURE__ */ __name(function node2(_ref3) {
    var instance = _ref3.instance;
    return ["p-tree-node", {
      "p-tree-node-leaf": instance.leaf
    }];
  }, "node"),
  nodeContent: /* @__PURE__ */ __name(function nodeContent(_ref4) {
    var instance = _ref4.instance;
    return ["p-tree-node-content", instance.node.styleClass, {
      "p-tree-node-selectable": instance.selectable,
      "p-tree-node-selected": instance.checkboxMode && instance.$parentInstance.highlightOnSelect ? instance.checked : instance.selected
    }];
  }, "nodeContent"),
  nodeToggleButton: "p-tree-node-toggle-button",
  nodeToggleIcon: "p-tree-node-toggle-icon",
  nodeCheckbox: "p-tree-node-checkbox",
  nodeIcon: "p-tree-node-icon",
  nodeLabel: "p-tree-node-label",
  nodeChildren: "p-tree-node-children"
};
var TreeStyle = BaseStyle.extend({
  name: "tree",
  theme: theme$8,
  classes: classes$8
});
var script$d = {
  name: "MinusIcon",
  "extends": script$X
};
var _hoisted_1$r = /* @__PURE__ */ createBaseVNode("path", {
  d: "M13.2222 7.77778H0.777778C0.571498 7.77778 0.373667 7.69584 0.227806 7.54998C0.0819442 7.40412 0 7.20629 0 7.00001C0 6.79373 0.0819442 6.5959 0.227806 6.45003C0.373667 6.30417 0.571498 6.22223 0.777778 6.22223H13.2222C13.4285 6.22223 13.6263 6.30417 13.7722 6.45003C13.9181 6.5959 14 6.79373 14 7.00001C14 7.20629 13.9181 7.40412 13.7722 7.54998C13.6263 7.69584 13.4285 7.77778 13.2222 7.77778Z",
  fill: "currentColor"
}, null, -1);
var _hoisted_2$j = [_hoisted_1$r];
function render$c(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", mergeProps({
    width: "14",
    height: "14",
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, _ctx.pti()), _hoisted_2$j, 16);
}
__name(render$c, "render$c");
script$d.render = render$c;
var theme$7 = /* @__PURE__ */ __name(function theme32(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-checkbox {\n    position: relative;\n    display: inline-flex;\n    user-select: none;\n    vertical-align: bottom;\n    width: ".concat(dt2("checkbox.width"), ";\n    height: ").concat(dt2("checkbox.height"), ";\n}\n\n.p-checkbox-input {\n    cursor: pointer;\n    appearance: none;\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    padding: 0;\n    margin: 0;\n    opacity: 0;\n    z-index: 1;\n    outline: 0 none;\n    border: 1px solid transparent;\n    border-radius: ").concat(dt2("checkbox.border.radius"), ";\n}\n\n.p-checkbox-box {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    border-radius: ").concat(dt2("checkbox.border.radius"), ";\n    border: 1px solid ").concat(dt2("checkbox.border.color"), ";\n    background: ").concat(dt2("checkbox.background"), ";\n    width: ").concat(dt2("checkbox.width"), ";\n    height: ").concat(dt2("checkbox.height"), ";\n    transition: background ").concat(dt2("checkbox.transition.duration"), ", color ").concat(dt2("checkbox.transition.duration"), ", border-color ").concat(dt2("checkbox.transition.duration"), ", box-shadow ").concat(dt2("checkbox.transition.duration"), ", outline-color ").concat(dt2("checkbox.transition.duration"), ";\n    outline-color: transparent;\n    box-shadow: ").concat(dt2("checkbox.shadow"), ";\n}\n\n.p-checkbox-icon {\n    transition-duration: ").concat(dt2("checkbox.transition.duration"), ";\n    color: ").concat(dt2("checkbox.icon.color"), ";\n    font-size: ").concat(dt2("checkbox.icon.size"), ";\n    width: ").concat(dt2("checkbox.icon.size"), ";\n    height: ").concat(dt2("checkbox.icon.size"), ";\n}\n\n.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {\n    border-color: ").concat(dt2("checkbox.hover.border.color"), ";\n}\n\n.p-checkbox-checked .p-checkbox-box {\n    border-color: ").concat(dt2("checkbox.checked.border.color"), ";\n    background: ").concat(dt2("checkbox.checked.background"), ";\n}\n\n.p-checkbox-checked .p-checkbox-icon {\n    color: ").concat(dt2("checkbox.icon.checked.color"), ";\n}\n\n.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {\n    background: ").concat(dt2("checkbox.checked.hover.background"), ";\n    border-color: ").concat(dt2("checkbox.checked.hover.border.color"), ";\n}\n\n.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-icon {\n    color: ").concat(dt2("checkbox.icon.checked.hover.color"), ";\n}\n\n.p-checkbox:not(.p-disabled):has(.p-checkbox-input:focus-visible) .p-checkbox-box {\n    border-color: ").concat(dt2("checkbox.focus.border.color"), ";\n    box-shadow: ").concat(dt2("checkbox.focus.ring.shadow"), ";\n    outline: ").concat(dt2("checkbox.focus.ring.width"), " ").concat(dt2("checkbox.focus.ring.style"), " ").concat(dt2("checkbox.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("checkbox.focus.ring.offset"), ";\n}\n\n.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:focus-visible) .p-checkbox-box {\n    border-color: ").concat(dt2("checkbox.checked.focus.border.color"), ";\n}\n\n.p-checkbox.p-invalid > .p-checkbox-box {\n    border-color: ").concat(dt2("checkbox.invalid.border.color"), ";\n}\n\n.p-checkbox.p-variant-filled .p-checkbox-box {\n    background: ").concat(dt2("checkbox.filled.background"), ";\n}\n\n.p-checkbox-checked.p-variant-filled .p-checkbox-box {\n    background: ").concat(dt2("checkbox.checked.background"), ";\n}\n\n.p-checkbox-checked.p-variant-filled:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {\n    background: ").concat(dt2("checkbox.checked.hover.background"), ";\n}\n\n.p-checkbox.p-disabled {\n    opacity: 1;\n}\n\n.p-checkbox.p-disabled .p-checkbox-box {\n    background: ").concat(dt2("checkbox.disabled.background"), ";\n    border-color: ").concat(dt2("checkbox.checked.disabled.border.color"), ";\n}\n\n.p-checkbox.p-disabled .p-checkbox-box .p-checkbox-icon {\n    color: ").concat(dt2("checkbox.icon.disabled.color"), ";\n}\n");
}, "theme");
var classes$7 = {
  root: /* @__PURE__ */ __name(function root20(_ref2) {
    var instance = _ref2.instance, props = _ref2.props;
    return ["p-checkbox p-component", {
      "p-checkbox-checked": instance.checked,
      "p-disabled": props.disabled,
      "p-invalid": props.invalid,
      "p-variant-filled": props.variant ? props.variant === "filled" : instance.$primevue.config.inputStyle === "filled" || instance.$primevue.config.inputVariant === "filled"
    }];
  }, "root"),
  box: "p-checkbox-box",
  input: "p-checkbox-input",
  icon: "p-checkbox-icon"
};
var CheckboxStyle = BaseStyle.extend({
  name: "checkbox",
  theme: theme$7,
  classes: classes$7
});
var script$1$8 = {
  name: "BaseCheckbox",
  "extends": script$_,
  props: {
    value: null,
    modelValue: null,
    binary: Boolean,
    name: {
      type: String,
      "default": null
    },
    indeterminate: {
      type: Boolean,
      "default": false
    },
    trueValue: {
      type: null,
      "default": true
    },
    falseValue: {
      type: null,
      "default": false
    },
    variant: {
      type: String,
      "default": null
    },
    invalid: {
      type: Boolean,
      "default": false
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    readonly: {
      type: Boolean,
      "default": false
    },
    required: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: Number,
      "default": null
    },
    inputId: {
      type: String,
      "default": null
    },
    inputClass: {
      type: [String, Object],
      "default": null
    },
    inputStyle: {
      type: Object,
      "default": null
    },
    ariaLabelledby: {
      type: String,
      "default": null
    },
    ariaLabel: {
      type: String,
      "default": null
    }
  },
  style: CheckboxStyle,
  provide: /* @__PURE__ */ __name(function provide33() {
    return {
      $pcCheckbox: this,
      $parentInstance: this
    };
  }, "provide")
};
function _toConsumableArray$5(r) {
  return _arrayWithoutHoles$5(r) || _iterableToArray$5(r) || _unsupportedIterableToArray$7(r) || _nonIterableSpread$5();
}
__name(_toConsumableArray$5, "_toConsumableArray$5");
function _nonIterableSpread$5() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$5, "_nonIterableSpread$5");
function _unsupportedIterableToArray$7(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$7(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$7(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$7, "_unsupportedIterableToArray$7");
function _iterableToArray$5(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$5, "_iterableToArray$5");
function _arrayWithoutHoles$5(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$7(r);
}
__name(_arrayWithoutHoles$5, "_arrayWithoutHoles$5");
function _arrayLikeToArray$7(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$7, "_arrayLikeToArray$7");
var script$c = {
  name: "Checkbox",
  "extends": script$1$8,
  inheritAttrs: false,
  emits: ["update:modelValue", "change", "focus", "blur", "update:indeterminate"],
  data: /* @__PURE__ */ __name(function data16() {
    return {
      d_indeterminate: this.indeterminate
    };
  }, "data"),
  watch: {
    indeterminate: /* @__PURE__ */ __name(function indeterminate2(newValue2) {
      this.d_indeterminate = newValue2;
    }, "indeterminate")
  },
  methods: {
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions6(key) {
      var _ptm = key === "root" ? this.ptmi : this.ptm;
      return _ptm(key, {
        context: {
          checked: this.checked,
          indeterminate: this.d_indeterminate,
          disabled: this.disabled
        }
      });
    }, "getPTOptions"),
    onChange: /* @__PURE__ */ __name(function onChange3(event) {
      var _this = this;
      if (!this.disabled && !this.readonly) {
        var newModelValue;
        if (this.binary) {
          newModelValue = this.d_indeterminate ? this.trueValue : this.checked ? this.falseValue : this.trueValue;
        } else {
          if (this.checked || this.d_indeterminate) newModelValue = this.modelValue.filter(function(val) {
            return !equals(val, _this.value);
          });
          else newModelValue = this.modelValue ? [].concat(_toConsumableArray$5(this.modelValue), [this.value]) : [this.value];
        }
        if (this.d_indeterminate) {
          this.d_indeterminate = false;
          this.$emit("update:indeterminate", this.d_indeterminate);
        }
        this.$emit("update:modelValue", newModelValue);
        this.$emit("change", event);
      }
    }, "onChange"),
    onFocus: /* @__PURE__ */ __name(function onFocus6(event) {
      this.$emit("focus", event);
    }, "onFocus"),
    onBlur: /* @__PURE__ */ __name(function onBlur6(event) {
      this.$emit("blur", event);
    }, "onBlur")
  },
  computed: {
    checked: /* @__PURE__ */ __name(function checked2() {
      return this.d_indeterminate ? false : this.binary ? this.modelValue === this.trueValue : contains(this.value, this.modelValue);
    }, "checked")
  },
  components: {
    CheckIcon: script$K,
    MinusIcon: script$d
  }
};
var _hoisted_1$q = ["data-p-checked", "data-p-indeterminate", "data-p-disabled"];
var _hoisted_2$i = ["id", "value", "name", "checked", "tabindex", "disabled", "readonly", "required", "aria-labelledby", "aria-label", "aria-invalid", "aria-checked"];
function render$b(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_CheckIcon = resolveComponent("CheckIcon");
  var _component_MinusIcon = resolveComponent("MinusIcon");
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root")
  }, $options.getPTOptions("root"), {
    "data-p-checked": $options.checked,
    "data-p-indeterminate": $data.d_indeterminate || void 0,
    "data-p-disabled": _ctx.disabled
  }), [createBaseVNode("input", mergeProps({
    id: _ctx.inputId,
    type: "checkbox",
    "class": [_ctx.cx("input"), _ctx.inputClass],
    style: _ctx.inputStyle,
    value: _ctx.value,
    name: _ctx.name,
    checked: $options.checked,
    tabindex: _ctx.tabindex,
    disabled: _ctx.disabled,
    readonly: _ctx.readonly,
    required: _ctx.required,
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-label": _ctx.ariaLabel,
    "aria-invalid": _ctx.invalid || void 0,
    "aria-checked": $data.d_indeterminate ? "mixed" : void 0,
    onFocus: _cache[0] || (_cache[0] = function() {
      return $options.onFocus && $options.onFocus.apply($options, arguments);
    }),
    onBlur: _cache[1] || (_cache[1] = function() {
      return $options.onBlur && $options.onBlur.apply($options, arguments);
    }),
    onChange: _cache[2] || (_cache[2] = function() {
      return $options.onChange && $options.onChange.apply($options, arguments);
    })
  }, $options.getPTOptions("input")), null, 16, _hoisted_2$i), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("box")
  }, $options.getPTOptions("box")), [renderSlot(_ctx.$slots, "icon", {
    checked: $options.checked,
    indeterminate: $data.d_indeterminate,
    "class": normalizeClass(_ctx.cx("icon"))
  }, function() {
    return [$options.checked ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({
      key: 0,
      "class": _ctx.cx("icon")
    }, $options.getPTOptions("icon")), null, 16, ["class"])) : $data.d_indeterminate ? (openBlock(), createBlock(_component_MinusIcon, mergeProps({
      key: 1,
      "class": _ctx.cx("icon")
    }, $options.getPTOptions("icon")), null, 16, ["class"])) : createCommentVNode("", true)];
  })], 16)], 16, _hoisted_1$q);
}
__name(render$b, "render$b");
script$c.render = render$b;
var script$2$1 = {
  name: "BaseTree",
  "extends": script$_,
  props: {
    value: {
      type: null,
      "default": null
    },
    expandedKeys: {
      type: null,
      "default": null
    },
    selectionKeys: {
      type: null,
      "default": null
    },
    selectionMode: {
      type: String,
      "default": null
    },
    metaKeySelection: {
      type: Boolean,
      "default": false
    },
    loading: {
      type: Boolean,
      "default": false
    },
    loadingIcon: {
      type: String,
      "default": void 0
    },
    loadingMode: {
      type: String,
      "default": "mask"
    },
    filter: {
      type: Boolean,
      "default": false
    },
    filterBy: {
      type: String,
      "default": "label"
    },
    filterMode: {
      type: String,
      "default": "lenient"
    },
    filterPlaceholder: {
      type: String,
      "default": null
    },
    filterLocale: {
      type: String,
      "default": void 0
    },
    highlightOnSelect: {
      type: Boolean,
      "default": false
    },
    scrollHeight: {
      type: String,
      "default": null
    },
    level: {
      type: Number,
      "default": 0
    },
    ariaLabelledby: {
      type: String,
      "default": null
    },
    ariaLabel: {
      type: String,
      "default": null
    }
  },
  style: TreeStyle,
  provide: /* @__PURE__ */ __name(function provide34() {
    return {
      $pcTree: this,
      $parentInstance: this
    };
  }, "provide")
};
function _typeof$1$1(o) {
  "@babel/helpers - typeof";
  return _typeof$1$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$1$1(o);
}
__name(_typeof$1$1, "_typeof$1$1");
function _createForOfIteratorHelper$1$1(r, e2) {
  var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (!t2) {
    if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$1$1(r)) || e2) {
      t2 && (r = t2);
      var _n = 0, F = /* @__PURE__ */ __name(function F2() {
      }, "F");
      return { s: F, n: /* @__PURE__ */ __name(function n() {
        return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
      }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
        throw r2;
      }, "e"), f: F };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var o, a = true, u = false;
  return { s: /* @__PURE__ */ __name(function s() {
    t2 = t2.call(r);
  }, "s"), n: /* @__PURE__ */ __name(function n() {
    var r2 = t2.next();
    return a = r2.done, r2;
  }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
    u = true, o = r2;
  }, "e"), f: /* @__PURE__ */ __name(function f() {
    try {
      a || null == t2["return"] || t2["return"]();
    } finally {
      if (u) throw o;
    }
  }, "f") };
}
__name(_createForOfIteratorHelper$1$1, "_createForOfIteratorHelper$1$1");
function ownKeys$1$1(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$1$1, "ownKeys$1$1");
function _objectSpread$1$1(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$1$1(Object(t2), true).forEach(function(r2) {
      _defineProperty$1$1(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1$1(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$1$1, "_objectSpread$1$1");
function _defineProperty$1$1(e2, r, t2) {
  return (r = _toPropertyKey$1$1(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$1$1, "_defineProperty$1$1");
function _toPropertyKey$1$1(t2) {
  var i2 = _toPrimitive$1$1(t2, "string");
  return "symbol" == _typeof$1$1(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$1$1, "_toPropertyKey$1$1");
function _toPrimitive$1$1(t2, r) {
  if ("object" != _typeof$1$1(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$1$1(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$1$1, "_toPrimitive$1$1");
function _toConsumableArray$1$1(r) {
  return _arrayWithoutHoles$1$1(r) || _iterableToArray$1$1(r) || _unsupportedIterableToArray$1$1(r) || _nonIterableSpread$1$1();
}
__name(_toConsumableArray$1$1, "_toConsumableArray$1$1");
function _nonIterableSpread$1$1() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$1$1, "_nonIterableSpread$1$1");
function _unsupportedIterableToArray$1$1(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$1$1(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$1$1(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$1$1, "_unsupportedIterableToArray$1$1");
function _iterableToArray$1$1(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$1$1, "_iterableToArray$1$1");
function _arrayWithoutHoles$1$1(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$1$1(r);
}
__name(_arrayWithoutHoles$1$1, "_arrayWithoutHoles$1$1");
function _arrayLikeToArray$1$1(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$1$1, "_arrayLikeToArray$1$1");
var script$1$7 = {
  name: "TreeNode",
  hostName: "Tree",
  "extends": script$_,
  emits: ["node-toggle", "node-click", "checkbox-change"],
  props: {
    node: {
      type: null,
      "default": null
    },
    expandedKeys: {
      type: null,
      "default": null
    },
    loadingMode: {
      type: String,
      "default": "mask"
    },
    selectionKeys: {
      type: null,
      "default": null
    },
    selectionMode: {
      type: String,
      "default": null
    },
    templates: {
      type: null,
      "default": null
    },
    level: {
      type: Number,
      "default": null
    },
    index: null
  },
  nodeTouched: false,
  toggleClicked: false,
  mounted: /* @__PURE__ */ __name(function mounted16() {
    this.setAllNodesTabIndexes();
  }, "mounted"),
  methods: {
    toggle: /* @__PURE__ */ __name(function toggle2() {
      this.$emit("node-toggle", this.node);
      this.toggleClicked = true;
    }, "toggle"),
    label: /* @__PURE__ */ __name(function label3(node3) {
      return typeof node3.label === "function" ? node3.label() : node3.label;
    }, "label"),
    onChildNodeToggle: /* @__PURE__ */ __name(function onChildNodeToggle(node3) {
      this.$emit("node-toggle", node3);
    }, "onChildNodeToggle"),
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions7(key) {
      return this.ptm(key, {
        context: {
          index: this.index,
          expanded: this.expanded,
          selected: this.selected,
          checked: this.checked,
          leaf: this.leaf
        }
      });
    }, "getPTOptions"),
    onClick: /* @__PURE__ */ __name(function onClick2(event) {
      if (this.toggleClicked || getAttribute(event.target, '[data-pc-section="nodetogglebutton"]') || getAttribute(event.target.parentElement, '[data-pc-section="nodetogglebutton"]')) {
        this.toggleClicked = false;
        return;
      }
      if (this.isCheckboxSelectionMode()) {
        if (this.node.selectable != false) {
          this.toggleCheckbox();
        }
      } else {
        this.$emit("node-click", {
          originalEvent: event,
          nodeTouched: this.nodeTouched,
          node: this.node
        });
      }
      this.nodeTouched = false;
    }, "onClick"),
    onChildNodeClick: /* @__PURE__ */ __name(function onChildNodeClick(event) {
      this.$emit("node-click", event);
    }, "onChildNodeClick"),
    onTouchEnd: /* @__PURE__ */ __name(function onTouchEnd2() {
      this.nodeTouched = true;
    }, "onTouchEnd"),
    onKeyDown: /* @__PURE__ */ __name(function onKeyDown7(event) {
      if (!this.isSameNode(event)) return;
      switch (event.code) {
        case "Tab":
          this.onTabKey(event);
          break;
        case "ArrowDown":
          this.onArrowDown(event);
          break;
        case "ArrowUp":
          this.onArrowUp(event);
          break;
        case "ArrowRight":
          this.onArrowRight(event);
          break;
        case "ArrowLeft":
          this.onArrowLeft(event);
          break;
        case "Enter":
        case "NumpadEnter":
        case "Space":
          this.onEnterKey(event);
          break;
      }
    }, "onKeyDown"),
    onArrowDown: /* @__PURE__ */ __name(function onArrowDown(event) {
      var nodeElement = event.target.getAttribute("data-pc-section") === "nodetogglebutton" ? event.target.closest('[role="treeitem"]') : event.target;
      var listElement = nodeElement.children[1];
      if (listElement) {
        this.focusRowChange(nodeElement, listElement.children[0]);
      } else {
        if (nodeElement.nextElementSibling) {
          this.focusRowChange(nodeElement, nodeElement.nextElementSibling);
        } else {
          var nextSiblingAncestor = this.findNextSiblingOfAncestor(nodeElement);
          if (nextSiblingAncestor) {
            this.focusRowChange(nodeElement, nextSiblingAncestor);
          }
        }
      }
      event.preventDefault();
    }, "onArrowDown"),
    onArrowUp: /* @__PURE__ */ __name(function onArrowUp(event) {
      var nodeElement = event.target;
      if (nodeElement.previousElementSibling) {
        this.focusRowChange(nodeElement, nodeElement.previousElementSibling, this.findLastVisibleDescendant(nodeElement.previousElementSibling));
      } else {
        var parentNodeElement = this.getParentNodeElement(nodeElement);
        if (parentNodeElement) {
          this.focusRowChange(nodeElement, parentNodeElement);
        }
      }
      event.preventDefault();
    }, "onArrowUp"),
    onArrowRight: /* @__PURE__ */ __name(function onArrowRight(event) {
      var _this = this;
      if (this.leaf || this.expanded) return;
      event.currentTarget.tabIndex = -1;
      this.$emit("node-toggle", this.node);
      this.$nextTick(function() {
        _this.onArrowDown(event);
      });
    }, "onArrowRight"),
    onArrowLeft: /* @__PURE__ */ __name(function onArrowLeft(event) {
      var togglerElement = findSingle(event.currentTarget, '[data-pc-section="nodetogglebutton"]');
      if (this.level === 0 && !this.expanded) {
        return false;
      }
      if (this.expanded && !this.leaf) {
        togglerElement.click();
        return false;
      }
      var target = this.findBeforeClickableNode(event.currentTarget);
      if (target) {
        this.focusRowChange(event.currentTarget, target);
      }
    }, "onArrowLeft"),
    onEnterKey: /* @__PURE__ */ __name(function onEnterKey4(event) {
      this.setTabIndexForSelectionMode(event, this.nodeTouched);
      this.onClick(event);
      event.preventDefault();
    }, "onEnterKey"),
    onTabKey: /* @__PURE__ */ __name(function onTabKey4() {
      this.setAllNodesTabIndexes();
    }, "onTabKey"),
    setAllNodesTabIndexes: /* @__PURE__ */ __name(function setAllNodesTabIndexes() {
      var nodes = find$1(this.$refs.currentNode.closest('[data-pc-section="rootchildren"]'), '[role="treeitem"]');
      var hasSelectedNode = _toConsumableArray$1$1(nodes).some(function(node3) {
        return node3.getAttribute("aria-selected") === "true" || node3.getAttribute("aria-checked") === "true";
      });
      _toConsumableArray$1$1(nodes).forEach(function(node3) {
        node3.tabIndex = -1;
      });
      if (hasSelectedNode) {
        var selectedNodes = _toConsumableArray$1$1(nodes).filter(function(node3) {
          return node3.getAttribute("aria-selected") === "true" || node3.getAttribute("aria-checked") === "true";
        });
        selectedNodes[0].tabIndex = 0;
        return;
      }
      _toConsumableArray$1$1(nodes)[0].tabIndex = 0;
    }, "setAllNodesTabIndexes"),
    setTabIndexForSelectionMode: /* @__PURE__ */ __name(function setTabIndexForSelectionMode(event, nodeTouched) {
      if (this.selectionMode !== null) {
        var elements = _toConsumableArray$1$1(find$1(this.$refs.currentNode.parentElement, '[role="treeitem"]'));
        event.currentTarget.tabIndex = nodeTouched === false ? -1 : 0;
        if (elements.every(function(element) {
          return element.tabIndex === -1;
        })) {
          elements[0].tabIndex = 0;
        }
      }
    }, "setTabIndexForSelectionMode"),
    focusRowChange: /* @__PURE__ */ __name(function focusRowChange(firstFocusableRow, currentFocusedRow, lastVisibleDescendant) {
      firstFocusableRow.tabIndex = "-1";
      currentFocusedRow.tabIndex = "0";
      this.focusNode(lastVisibleDescendant || currentFocusedRow);
    }, "focusRowChange"),
    findBeforeClickableNode: /* @__PURE__ */ __name(function findBeforeClickableNode(node3) {
      var parentListElement = node3.closest("ul").closest("li");
      if (parentListElement) {
        var prevNodeButton = findSingle(parentListElement, "button");
        if (prevNodeButton && prevNodeButton.style.visibility !== "hidden") {
          return parentListElement;
        }
        return this.findBeforeClickableNode(node3.previousElementSibling);
      }
      return null;
    }, "findBeforeClickableNode"),
    toggleCheckbox: /* @__PURE__ */ __name(function toggleCheckbox() {
      var _selectionKeys = this.selectionKeys ? _objectSpread$1$1({}, this.selectionKeys) : {};
      var _check = !this.checked;
      this.propagateDown(this.node, _check, _selectionKeys);
      this.$emit("checkbox-change", {
        node: this.node,
        check: _check,
        selectionKeys: _selectionKeys
      });
    }, "toggleCheckbox"),
    propagateDown: /* @__PURE__ */ __name(function propagateDown(node3, check, selectionKeys) {
      if (check && node3.selectable != false) selectionKeys[node3.key] = {
        checked: true,
        partialChecked: false
      };
      else delete selectionKeys[node3.key];
      if (node3.children && node3.children.length) {
        var _iterator = _createForOfIteratorHelper$1$1(node3.children), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var child = _step.value;
            this.propagateDown(child, check, selectionKeys);
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
      }
    }, "propagateDown"),
    propagateUp: /* @__PURE__ */ __name(function propagateUp(event) {
      var check = event.check;
      var _selectionKeys = _objectSpread$1$1({}, event.selectionKeys);
      var checkedChildCount = 0;
      var childPartialSelected = false;
      var _iterator2 = _createForOfIteratorHelper$1$1(this.node.children), _step2;
      try {
        for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
          var child = _step2.value;
          if (_selectionKeys[child.key] && _selectionKeys[child.key].checked) checkedChildCount++;
          else if (_selectionKeys[child.key] && _selectionKeys[child.key].partialChecked) childPartialSelected = true;
        }
      } catch (err) {
        _iterator2.e(err);
      } finally {
        _iterator2.f();
      }
      if (check && checkedChildCount === this.node.children.length) {
        _selectionKeys[this.node.key] = {
          checked: true,
          partialChecked: false
        };
      } else {
        if (!check) {
          delete _selectionKeys[this.node.key];
        }
        if (childPartialSelected || checkedChildCount > 0 && checkedChildCount !== this.node.children.length) _selectionKeys[this.node.key] = {
          checked: false,
          partialChecked: true
        };
        else delete _selectionKeys[this.node.key];
      }
      this.$emit("checkbox-change", {
        node: event.node,
        check: event.check,
        selectionKeys: _selectionKeys
      });
    }, "propagateUp"),
    onChildCheckboxChange: /* @__PURE__ */ __name(function onChildCheckboxChange(event) {
      this.$emit("checkbox-change", event);
    }, "onChildCheckboxChange"),
    findNextSiblingOfAncestor: /* @__PURE__ */ __name(function findNextSiblingOfAncestor(nodeElement) {
      var parentNodeElement = this.getParentNodeElement(nodeElement);
      if (parentNodeElement) {
        if (parentNodeElement.nextElementSibling) return parentNodeElement.nextElementSibling;
        else return this.findNextSiblingOfAncestor(parentNodeElement);
      } else {
        return null;
      }
    }, "findNextSiblingOfAncestor"),
    findLastVisibleDescendant: /* @__PURE__ */ __name(function findLastVisibleDescendant(nodeElement) {
      var childrenListElement = nodeElement.children[1];
      if (childrenListElement) {
        var lastChildElement = childrenListElement.children[childrenListElement.children.length - 1];
        return this.findLastVisibleDescendant(lastChildElement);
      } else {
        return nodeElement;
      }
    }, "findLastVisibleDescendant"),
    getParentNodeElement: /* @__PURE__ */ __name(function getParentNodeElement(nodeElement) {
      var parentNodeElement = nodeElement.parentElement.parentElement;
      return getAttribute(parentNodeElement, "role") === "treeitem" ? parentNodeElement : null;
    }, "getParentNodeElement"),
    focusNode: /* @__PURE__ */ __name(function focusNode(element) {
      element.focus();
    }, "focusNode"),
    isCheckboxSelectionMode: /* @__PURE__ */ __name(function isCheckboxSelectionMode() {
      return this.selectionMode === "checkbox";
    }, "isCheckboxSelectionMode"),
    isSameNode: /* @__PURE__ */ __name(function isSameNode(event) {
      return event.currentTarget && (event.currentTarget.isSameNode(event.target) || event.currentTarget.isSameNode(event.target.closest('[role="treeitem"]')));
    }, "isSameNode")
  },
  computed: {
    hasChildren: /* @__PURE__ */ __name(function hasChildren() {
      return this.node.children && this.node.children.length > 0;
    }, "hasChildren"),
    expanded: /* @__PURE__ */ __name(function expanded() {
      return this.expandedKeys && this.expandedKeys[this.node.key] === true;
    }, "expanded"),
    leaf: /* @__PURE__ */ __name(function leaf() {
      return this.node.leaf === false ? false : !(this.node.children && this.node.children.length);
    }, "leaf"),
    selectable: /* @__PURE__ */ __name(function selectable() {
      return this.node.selectable === false ? false : this.selectionMode != null;
    }, "selectable"),
    selected: /* @__PURE__ */ __name(function selected() {
      return this.selectionMode && this.selectionKeys ? this.selectionKeys[this.node.key] === true : false;
    }, "selected"),
    checkboxMode: /* @__PURE__ */ __name(function checkboxMode() {
      return this.selectionMode === "checkbox" && this.node.selectable !== false;
    }, "checkboxMode"),
    checked: /* @__PURE__ */ __name(function checked3() {
      return this.selectionKeys ? this.selectionKeys[this.node.key] && this.selectionKeys[this.node.key].checked : false;
    }, "checked"),
    partialChecked: /* @__PURE__ */ __name(function partialChecked() {
      return this.selectionKeys ? this.selectionKeys[this.node.key] && this.selectionKeys[this.node.key].partialChecked : false;
    }, "partialChecked"),
    ariaChecked: /* @__PURE__ */ __name(function ariaChecked() {
      return this.selectionMode === "single" || this.selectionMode === "multiple" ? this.selected : void 0;
    }, "ariaChecked"),
    ariaSelected: /* @__PURE__ */ __name(function ariaSelected() {
      return this.checkboxMode ? this.checked : void 0;
    }, "ariaSelected")
  },
  components: {
    Checkbox: script$c,
    ChevronDownIcon: script$p,
    ChevronRightIcon: script$u,
    CheckIcon: script$K,
    MinusIcon: script$d,
    SpinnerIcon: script$T
  },
  directives: {
    ripple: Ripple
  }
};
var _hoisted_1$1$2 = ["aria-label", "aria-selected", "aria-expanded", "aria-setsize", "aria-posinset", "aria-level", "aria-checked", "tabindex"];
var _hoisted_2$h = ["data-p-selected", "data-p-selectable"];
function render$1$1(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
  var _component_Checkbox = resolveComponent("Checkbox");
  var _component_TreeNode = resolveComponent("TreeNode", true);
  var _directive_ripple = resolveDirective("ripple");
  return openBlock(), createElementBlock("li", mergeProps({
    ref: "currentNode",
    "class": _ctx.cx("node"),
    role: "treeitem",
    "aria-label": $options.label($props.node),
    "aria-selected": $options.ariaSelected,
    "aria-expanded": $options.expanded,
    "aria-setsize": $props.node.children ? $props.node.children.length : 0,
    "aria-posinset": $props.index + 1,
    "aria-level": $props.level,
    "aria-checked": $options.ariaChecked,
    tabindex: $props.index === 0 ? 0 : -1,
    onKeydown: _cache[4] || (_cache[4] = function() {
      return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
    })
  }, $props.level === 1 ? $options.getPTOptions("node") : _ctx.ptm("nodeChildren")), [createBaseVNode("div", mergeProps({
    "class": _ctx.cx("nodeContent"),
    onClick: _cache[2] || (_cache[2] = function() {
      return $options.onClick && $options.onClick.apply($options, arguments);
    }),
    onTouchend: _cache[3] || (_cache[3] = function() {
      return $options.onTouchEnd && $options.onTouchEnd.apply($options, arguments);
    }),
    style: $props.node.style
  }, $options.getPTOptions("nodeContent"), {
    "data-p-selected": $options.checkboxMode ? $options.checked : $options.selected,
    "data-p-selectable": $options.selectable
  }), [withDirectives((openBlock(), createElementBlock("button", mergeProps({
    type: "button",
    "class": _ctx.cx("nodeToggleButton"),
    onClick: _cache[0] || (_cache[0] = function() {
      return $options.toggle && $options.toggle.apply($options, arguments);
    }),
    tabindex: "-1"
  }, $options.getPTOptions("nodeToggleButton")), [$props.node.loading && $props.loadingMode === "icon" ? (openBlock(), createElementBlock(Fragment$1, {
    key: 0
  }, [$props.templates["nodetoggleicon"] || $props.templates["nodetogglericon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["nodetoggleicon"] || $props.templates["nodetogglericon"]), {
    key: 0,
    "class": normalizeClass(_ctx.cx("nodeToggleIcon"))
  }, null, 8, ["class"])) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
    key: 1,
    spin: "",
    "class": _ctx.cx("nodetogglericon")
  }, _ctx.ptm("nodeToggleIcon")), null, 16, ["class"]))], 64)) : (openBlock(), createElementBlock(Fragment$1, {
    key: 1
  }, [$props.templates["nodetoggleicon"] || $props.templates["togglericon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["nodetoggleicon"] || $props.templates["togglericon"]), {
    key: 0,
    node: $props.node,
    expanded: $options.expanded,
    "class": normalizeClass(_ctx.cx("nodeToggleIcon"))
  }, null, 8, ["node", "expanded", "class"])) : $options.expanded ? (openBlock(), createBlock(resolveDynamicComponent($props.node.expandedIcon ? "span" : "ChevronDownIcon"), mergeProps({
    key: 1,
    "class": _ctx.cx("nodeToggleIcon")
  }, $options.getPTOptions("nodeToggleIcon")), null, 16, ["class"])) : (openBlock(), createBlock(resolveDynamicComponent($props.node.collapsedIcon ? "span" : "ChevronRightIcon"), mergeProps({
    key: 2,
    "class": _ctx.cx("nodeToggleIcon")
  }, $options.getPTOptions("nodeToggleIcon")), null, 16, ["class"]))], 64))], 16)), [[_directive_ripple]]), $options.checkboxMode ? (openBlock(), createBlock(_component_Checkbox, {
    key: 0,
    modelValue: $options.checked,
    binary: true,
    indeterminate: $options.partialChecked,
    "class": normalizeClass(_ctx.cx("nodeCheckbox")),
    tabindex: -1,
    unstyled: _ctx.unstyled,
    pt: $options.getPTOptions("nodeCheckbox"),
    "data-p-partialchecked": $options.partialChecked
  }, {
    icon: withCtx(function(slotProps) {
      return [$props.templates["checkboxicon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["checkboxicon"]), {
        key: 0,
        checked: slotProps.checked,
        partialChecked: $options.partialChecked,
        "class": normalizeClass(slotProps["class"])
      }, null, 8, ["checked", "partialChecked", "class"])) : createCommentVNode("", true)];
    }),
    _: 1
  }, 8, ["modelValue", "indeterminate", "class", "unstyled", "pt", "data-p-partialchecked"])) : createCommentVNode("", true), $props.templates["nodeicon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["nodeicon"]), mergeProps({
    key: 1,
    node: $props.node,
    "class": [_ctx.cx("nodeIcon")]
  }, $options.getPTOptions("nodeIcon")), null, 16, ["node", "class"])) : (openBlock(), createElementBlock("span", mergeProps({
    key: 2,
    "class": [_ctx.cx("nodeIcon"), $props.node.icon]
  }, $options.getPTOptions("nodeIcon")), null, 16)), createBaseVNode("span", mergeProps({
    "class": _ctx.cx("nodeLabel")
  }, $options.getPTOptions("nodeLabel"), {
    onKeydown: _cache[1] || (_cache[1] = withModifiers(function() {
    }, ["stop"]))
  }), [$props.templates[$props.node.type] || $props.templates["default"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates[$props.node.type] || $props.templates["default"]), {
    key: 0,
    node: $props.node,
    selected: $options.checkboxMode ? $options.checked : $options.selected
  }, null, 8, ["node", "selected"])) : (openBlock(), createElementBlock(Fragment$1, {
    key: 1
  }, [createTextVNode(toDisplayString$1($options.label($props.node)), 1)], 64))], 16)], 16, _hoisted_2$h), $options.hasChildren && $options.expanded ? (openBlock(), createElementBlock("ul", mergeProps({
    key: 0,
    "class": _ctx.cx("nodeChildren"),
    role: "group"
  }, _ctx.ptm("nodeChildren")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($props.node.children, function(childNode) {
    return openBlock(), createBlock(_component_TreeNode, {
      key: childNode.key,
      node: childNode,
      templates: $props.templates,
      level: $props.level + 1,
      loadingMode: $props.loadingMode,
      expandedKeys: $props.expandedKeys,
      onNodeToggle: $options.onChildNodeToggle,
      onNodeClick: $options.onChildNodeClick,
      selectionMode: $props.selectionMode,
      selectionKeys: $props.selectionKeys,
      onCheckboxChange: $options.propagateUp,
      unstyled: _ctx.unstyled,
      pt: _ctx.pt
    }, null, 8, ["node", "templates", "level", "loadingMode", "expandedKeys", "onNodeToggle", "onNodeClick", "selectionMode", "selectionKeys", "onCheckboxChange", "unstyled", "pt"]);
  }), 128))], 16)) : createCommentVNode("", true)], 16, _hoisted_1$1$2);
}
__name(render$1$1, "render$1$1");
script$1$7.render = render$1$1;
function _typeof$4(o) {
  "@babel/helpers - typeof";
  return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$4(o);
}
__name(_typeof$4, "_typeof$4");
function _createForOfIteratorHelper$3(r, e2) {
  var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (!t2) {
    if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$6(r)) || e2) {
      t2 && (r = t2);
      var _n = 0, F = /* @__PURE__ */ __name(function F2() {
      }, "F");
      return { s: F, n: /* @__PURE__ */ __name(function n() {
        return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
      }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
        throw r2;
      }, "e"), f: F };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var o, a = true, u = false;
  return { s: /* @__PURE__ */ __name(function s() {
    t2 = t2.call(r);
  }, "s"), n: /* @__PURE__ */ __name(function n() {
    var r2 = t2.next();
    return a = r2.done, r2;
  }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
    u = true, o = r2;
  }, "e"), f: /* @__PURE__ */ __name(function f() {
    try {
      a || null == t2["return"] || t2["return"]();
    } finally {
      if (u) throw o;
    }
  }, "f") };
}
__name(_createForOfIteratorHelper$3, "_createForOfIteratorHelper$3");
function _toConsumableArray$4(r) {
  return _arrayWithoutHoles$4(r) || _iterableToArray$4(r) || _unsupportedIterableToArray$6(r) || _nonIterableSpread$4();
}
__name(_toConsumableArray$4, "_toConsumableArray$4");
function _nonIterableSpread$4() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$4, "_nonIterableSpread$4");
function _unsupportedIterableToArray$6(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$6(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$6(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$6, "_unsupportedIterableToArray$6");
function _iterableToArray$4(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$4, "_iterableToArray$4");
function _arrayWithoutHoles$4(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$6(r);
}
__name(_arrayWithoutHoles$4, "_arrayWithoutHoles$4");
function _arrayLikeToArray$6(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$6, "_arrayLikeToArray$6");
function ownKeys$6(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$6, "ownKeys$6");
function _objectSpread$6(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$6(Object(t2), true).forEach(function(r2) {
      _defineProperty$4(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$6(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$6, "_objectSpread$6");
function _defineProperty$4(e2, r, t2) {
  return (r = _toPropertyKey$3(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$4, "_defineProperty$4");
function _toPropertyKey$3(t2) {
  var i2 = _toPrimitive$3(t2, "string");
  return "symbol" == _typeof$4(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$3, "_toPropertyKey$3");
function _toPrimitive$3(t2, r) {
  if ("object" != _typeof$4(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$4(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$3, "_toPrimitive$3");
var script$b = {
  name: "Tree",
  "extends": script$2$1,
  inheritAttrs: false,
  emits: ["node-expand", "node-collapse", "update:expandedKeys", "update:selectionKeys", "node-select", "node-unselect", "filter"],
  data: /* @__PURE__ */ __name(function data17() {
    return {
      d_expandedKeys: this.expandedKeys || {},
      filterValue: null
    };
  }, "data"),
  watch: {
    expandedKeys: /* @__PURE__ */ __name(function expandedKeys(newValue2) {
      this.d_expandedKeys = newValue2;
    }, "expandedKeys")
  },
  methods: {
    onNodeToggle: /* @__PURE__ */ __name(function onNodeToggle(node3) {
      var key = node3.key;
      if (this.d_expandedKeys[key]) {
        delete this.d_expandedKeys[key];
        this.$emit("node-collapse", node3);
      } else {
        this.d_expandedKeys[key] = true;
        this.$emit("node-expand", node3);
      }
      this.d_expandedKeys = _objectSpread$6({}, this.d_expandedKeys);
      this.$emit("update:expandedKeys", this.d_expandedKeys);
    }, "onNodeToggle"),
    onNodeClick: /* @__PURE__ */ __name(function onNodeClick(event) {
      if (this.selectionMode != null && event.node.selectable !== false) {
        var metaSelection = event.nodeTouched ? false : this.metaKeySelection;
        var _selectionKeys = metaSelection ? this.handleSelectionWithMetaKey(event) : this.handleSelectionWithoutMetaKey(event);
        this.$emit("update:selectionKeys", _selectionKeys);
      }
    }, "onNodeClick"),
    onCheckboxChange: /* @__PURE__ */ __name(function onCheckboxChange(event) {
      this.$emit("update:selectionKeys", event.selectionKeys);
      if (event.check) this.$emit("node-select", event.node);
      else this.$emit("node-unselect", event.node);
    }, "onCheckboxChange"),
    handleSelectionWithMetaKey: /* @__PURE__ */ __name(function handleSelectionWithMetaKey(event) {
      var originalEvent = event.originalEvent;
      var node3 = event.node;
      var metaKey = originalEvent.metaKey || originalEvent.ctrlKey;
      var selected2 = this.isNodeSelected(node3);
      var _selectionKeys;
      if (selected2 && metaKey) {
        if (this.isSingleSelectionMode()) {
          _selectionKeys = {};
        } else {
          _selectionKeys = _objectSpread$6({}, this.selectionKeys);
          delete _selectionKeys[node3.key];
        }
        this.$emit("node-unselect", node3);
      } else {
        if (this.isSingleSelectionMode()) {
          _selectionKeys = {};
        } else if (this.isMultipleSelectionMode()) {
          _selectionKeys = !metaKey ? {} : this.selectionKeys ? _objectSpread$6({}, this.selectionKeys) : {};
        }
        _selectionKeys[node3.key] = true;
        this.$emit("node-select", node3);
      }
      return _selectionKeys;
    }, "handleSelectionWithMetaKey"),
    handleSelectionWithoutMetaKey: /* @__PURE__ */ __name(function handleSelectionWithoutMetaKey(event) {
      var node3 = event.node;
      var selected2 = this.isNodeSelected(node3);
      var _selectionKeys;
      if (this.isSingleSelectionMode()) {
        if (selected2) {
          _selectionKeys = {};
          this.$emit("node-unselect", node3);
        } else {
          _selectionKeys = {};
          _selectionKeys[node3.key] = true;
          this.$emit("node-select", node3);
        }
      } else {
        if (selected2) {
          _selectionKeys = _objectSpread$6({}, this.selectionKeys);
          delete _selectionKeys[node3.key];
          this.$emit("node-unselect", node3);
        } else {
          _selectionKeys = this.selectionKeys ? _objectSpread$6({}, this.selectionKeys) : {};
          _selectionKeys[node3.key] = true;
          this.$emit("node-select", node3);
        }
      }
      return _selectionKeys;
    }, "handleSelectionWithoutMetaKey"),
    isSingleSelectionMode: /* @__PURE__ */ __name(function isSingleSelectionMode() {
      return this.selectionMode === "single";
    }, "isSingleSelectionMode"),
    isMultipleSelectionMode: /* @__PURE__ */ __name(function isMultipleSelectionMode() {
      return this.selectionMode === "multiple";
    }, "isMultipleSelectionMode"),
    isNodeSelected: /* @__PURE__ */ __name(function isNodeSelected(node3) {
      return this.selectionMode && this.selectionKeys ? this.selectionKeys[node3.key] === true : false;
    }, "isNodeSelected"),
    isChecked: /* @__PURE__ */ __name(function isChecked(node3) {
      return this.selectionKeys ? this.selectionKeys[node3.key] && this.selectionKeys[node3.key].checked : false;
    }, "isChecked"),
    isNodeLeaf: /* @__PURE__ */ __name(function isNodeLeaf(node3) {
      return node3.leaf === false ? false : !(node3.children && node3.children.length);
    }, "isNodeLeaf"),
    onFilterKeydown: /* @__PURE__ */ __name(function onFilterKeydown(event) {
      if (event.code === "Enter" || event.code === "NumpadEnter") {
        event.preventDefault();
      }
      this.$emit("filter", {
        originalEvent: event,
        value: event.target.value
      });
    }, "onFilterKeydown"),
    findFilteredNodes: /* @__PURE__ */ __name(function findFilteredNodes(node3, paramsWithoutNode) {
      if (node3) {
        var matched = false;
        if (node3.children) {
          var childNodes2 = _toConsumableArray$4(node3.children);
          node3.children = [];
          var _iterator = _createForOfIteratorHelper$3(childNodes2), _step;
          try {
            for (_iterator.s(); !(_step = _iterator.n()).done; ) {
              var childNode = _step.value;
              var copyChildNode = _objectSpread$6({}, childNode);
              if (this.isFilterMatched(copyChildNode, paramsWithoutNode)) {
                matched = true;
                node3.children.push(copyChildNode);
              }
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }
        }
        if (matched) {
          return true;
        }
      }
    }, "findFilteredNodes"),
    isFilterMatched: /* @__PURE__ */ __name(function isFilterMatched(node3, _ref) {
      var searchFields3 = _ref.searchFields, filterText = _ref.filterText, strict = _ref.strict;
      var matched = false;
      var _iterator2 = _createForOfIteratorHelper$3(searchFields3), _step2;
      try {
        for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
          var field = _step2.value;
          var fieldValue = String(resolveFieldData(node3, field)).toLocaleLowerCase(this.filterLocale);
          if (fieldValue.indexOf(filterText) > -1) {
            matched = true;
          }
        }
      } catch (err) {
        _iterator2.e(err);
      } finally {
        _iterator2.f();
      }
      if (!matched || strict && !this.isNodeLeaf(node3)) {
        matched = this.findFilteredNodes(node3, {
          searchFields: searchFields3,
          filterText,
          strict
        }) || matched;
      }
      return matched;
    }, "isFilterMatched")
  },
  computed: {
    filteredValue: /* @__PURE__ */ __name(function filteredValue() {
      var filteredNodes = [];
      var searchFields3 = this.filterBy.split(",");
      var filterText = this.filterValue.trim().toLocaleLowerCase(this.filterLocale);
      var strict = this.filterMode === "strict";
      var _iterator3 = _createForOfIteratorHelper$3(this.value), _step3;
      try {
        for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
          var node3 = _step3.value;
          var _node = _objectSpread$6({}, node3);
          var paramsWithoutNode = {
            searchFields: searchFields3,
            filterText,
            strict
          };
          if (strict && (this.findFilteredNodes(_node, paramsWithoutNode) || this.isFilterMatched(_node, paramsWithoutNode)) || !strict && (this.isFilterMatched(_node, paramsWithoutNode) || this.findFilteredNodes(_node, paramsWithoutNode))) {
            filteredNodes.push(_node);
          }
        }
      } catch (err) {
        _iterator3.e(err);
      } finally {
        _iterator3.f();
      }
      return filteredNodes;
    }, "filteredValue"),
    valueToRender: /* @__PURE__ */ __name(function valueToRender() {
      if (this.filterValue && this.filterValue.trim().length > 0) return this.filteredValue;
      else return this.value;
    }, "valueToRender")
  },
  components: {
    TreeNode: script$1$7,
    InputText: script$G,
    InputIcon: script$H,
    IconField: script$I,
    SearchIcon: script$J,
    SpinnerIcon: script$T
  }
};
var _hoisted_1$p = ["aria-labelledby", "aria-label"];
function render$a(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
  var _component_InputText = resolveComponent("InputText");
  var _component_SearchIcon = resolveComponent("SearchIcon");
  var _component_InputIcon = resolveComponent("InputIcon");
  var _component_IconField = resolveComponent("IconField");
  var _component_TreeNode = resolveComponent("TreeNode");
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root")
  }, _ctx.ptmi("root")), [_ctx.loading && _ctx.loadingMode === "mask" ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    "class": _ctx.cx("mask")
  }, _ctx.ptm("mask")), [renderSlot(_ctx.$slots, "loadingicon", {
    "class": normalizeClass(_ctx.cx("loadingIcon"))
  }, function() {
    return [_ctx.loadingIcon ? (openBlock(), createElementBlock("i", mergeProps({
      key: 0,
      "class": [_ctx.cx("loadingIcon"), "pi-spin", _ctx.loadingIcon]
    }, _ctx.ptm("loadingIcon")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
      key: 1,
      spin: "",
      "class": _ctx.cx("loadingIcon")
    }, _ctx.ptm("loadingIcon")), null, 16, ["class"]))];
  })], 16)) : createCommentVNode("", true), _ctx.filter ? (openBlock(), createBlock(_component_IconField, {
    key: 1,
    unstyled: _ctx.unstyled,
    pt: _ctx.ptm("pcFilterContainer")
  }, {
    "default": withCtx(function() {
      return [createVNode(_component_InputText, {
        modelValue: $data.filterValue,
        "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) {
          return $data.filterValue = $event;
        }),
        autocomplete: "off",
        "class": normalizeClass(_ctx.cx("pcFilter")),
        placeholder: _ctx.filterPlaceholder,
        unstyled: _ctx.unstyled,
        onKeydown: $options.onFilterKeydown,
        pt: _ctx.ptm("pcFilter")
      }, null, 8, ["modelValue", "class", "placeholder", "unstyled", "onKeydown", "pt"]), createVNode(_component_InputIcon, {
        unstyled: _ctx.unstyled,
        pt: _ctx.ptm("pcFilterIconContainer")
      }, {
        "default": withCtx(function() {
          return [renderSlot(_ctx.$slots, _ctx.$slots.filtericon ? "filtericon" : "searchicon", {
            "class": normalizeClass(_ctx.cx("filterIcon"))
          }, function() {
            return [createVNode(_component_SearchIcon, mergeProps({
              "class": _ctx.cx("filterIcon")
            }, _ctx.ptm("filterIcon")), null, 16, ["class"])];
          })];
        }),
        _: 3
      }, 8, ["unstyled", "pt"])];
    }),
    _: 3
  }, 8, ["unstyled", "pt"])) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("wrapper"),
    style: {
      maxHeight: _ctx.scrollHeight
    }
  }, _ctx.ptm("wrapper")), [createBaseVNode("ul", mergeProps({
    "class": _ctx.cx("rootChildren"),
    role: "tree",
    "aria-labelledby": _ctx.ariaLabelledby,
    "aria-label": _ctx.ariaLabel
  }, _ctx.ptm("rootChildren")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($options.valueToRender, function(node3, index2) {
    return openBlock(), createBlock(_component_TreeNode, {
      key: node3.key,
      node: node3,
      templates: _ctx.$slots,
      level: _ctx.level + 1,
      index: index2,
      expandedKeys: $data.d_expandedKeys,
      onNodeToggle: $options.onNodeToggle,
      onNodeClick: $options.onNodeClick,
      selectionMode: _ctx.selectionMode,
      selectionKeys: _ctx.selectionKeys,
      onCheckboxChange: $options.onCheckboxChange,
      loadingMode: _ctx.loadingMode,
      unstyled: _ctx.unstyled,
      pt: _ctx.pt
    }, null, 8, ["node", "templates", "level", "index", "expandedKeys", "onNodeToggle", "onNodeClick", "selectionMode", "selectionKeys", "onCheckboxChange", "loadingMode", "unstyled", "pt"]);
  }), 128))], 16, _hoisted_1$p)], 16)], 16);
}
__name(render$a, "render$a");
script$b.render = render$a;
const _withScopeId$b = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-d670c40f"), n = n(), popScopeId(), n), "_withScopeId$b");
const _hoisted_1$o = { class: "editable-text" };
const _hoisted_2$g = { key: 0 };
const _sfc_main$q = /* @__PURE__ */ defineComponent({
  __name: "EditableText",
  props: {
    modelValue: {},
    isEditing: { type: Boolean, default: false }
  },
  emits: ["update:modelValue", "edit"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit2 = __emit;
    const inputValue = ref(props.modelValue);
    const inputRef = ref(null);
    const blurInputElement = /* @__PURE__ */ __name(() => {
      inputRef.value?.$el.blur();
    }, "blurInputElement");
    const finishEditing = /* @__PURE__ */ __name(() => {
      emit2("edit", inputValue.value);
    }, "finishEditing");
    watch(
      () => props.isEditing,
      (newVal) => {
        if (newVal) {
          inputValue.value = props.modelValue;
          nextTick(() => {
            if (!inputRef.value) return;
            const fileName = inputValue.value.includes(".") ? inputValue.value.split(".").slice(0, -1).join(".") : inputValue.value;
            const start2 = 0;
            const end = fileName.length;
            const inputElement = inputRef.value.$el;
            inputElement.setSelectionRange?.(start2, end);
          });
        }
      },
      { immediate: true }
    );
    const vFocus = {
      mounted: /* @__PURE__ */ __name((el) => el.focus(), "mounted")
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$o, [
        !props.isEditing ? (openBlock(), createElementBlock("span", _hoisted_2$g, toDisplayString$1(_ctx.modelValue), 1)) : withDirectives((openBlock(), createBlock(unref(script$G), {
          key: 1,
          type: "text",
          size: "small",
          fluid: "",
          modelValue: inputValue.value,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
          ref_key: "inputRef",
          ref: inputRef,
          onKeyup: withKeys(blurInputElement, ["enter"]),
          onClick: _cache[1] || (_cache[1] = withModifiers(() => {
          }, ["stop"])),
          pt: {
            root: {
              onBlur: finishEditing
            }
          }
        }, null, 8, ["modelValue", "pt"])), [
          [vFocus]
        ])
      ]);
    };
  }
});
const EditableText = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-d670c40f"]]);
function _arrayWithHoles(r) {
  if (Array.isArray(r)) return r;
}
__name(_arrayWithHoles, "_arrayWithHoles");
function _iterableToArrayLimit(r, l) {
  var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (null != t2) {
    var e2, n, i2, u, a = [], f = true, o = false;
    try {
      if (i2 = (t2 = t2.call(r)).next, 0 === l) {
        if (Object(t2) !== t2) return;
        f = false;
      } else for (; !(f = (e2 = i2.call(t2)).done) && (a.push(e2.value), a.length !== l); f = true) ;
    } catch (r2) {
      o = true, n = r2;
    } finally {
      try {
        if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
      } finally {
        if (o) throw n;
      }
    }
    return a;
  }
}
__name(_iterableToArrayLimit, "_iterableToArrayLimit");
function _arrayLikeToArray$5(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$5, "_arrayLikeToArray$5");
function _unsupportedIterableToArray$5(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$5(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$5(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$5, "_unsupportedIterableToArray$5");
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableRest, "_nonIterableRest");
function _slicedToArray(r, e2) {
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e2) || _unsupportedIterableToArray$5(r, e2) || _nonIterableRest();
}
__name(_slicedToArray, "_slicedToArray");
var dist = {};
var bind$1 = {};
"use strict";
Object.defineProperty(bind$1, "__esModule", { value: true });
var bind_2 = bind$1.bind = void 0;
function bind(target, _a2) {
  var type = _a2.type, listener = _a2.listener, options4 = _a2.options;
  target.addEventListener(type, listener, options4);
  return /* @__PURE__ */ __name(function unbind2() {
    target.removeEventListener(type, listener, options4);
  }, "unbind");
}
__name(bind, "bind");
bind_2 = bind$1.bind = bind;
var bindAll$1 = {};
"use strict";
var __assign = commonjsGlobal && commonjsGlobal.__assign || function() {
  __assign = Object.assign || function(t2) {
    for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
      s = arguments[i2];
      for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2))
        t2[p2] = s[p2];
    }
    return t2;
  };
  return __assign.apply(this, arguments);
};
Object.defineProperty(bindAll$1, "__esModule", { value: true });
var bindAll_2 = bindAll$1.bindAll = void 0;
var bind_1 = bind$1;
function toOptions(value4) {
  if (typeof value4 === "undefined") {
    return void 0;
  }
  if (typeof value4 === "boolean") {
    return {
      capture: value4
    };
  }
  return value4;
}
__name(toOptions, "toOptions");
function getBinding(original, sharedOptions) {
  if (sharedOptions == null) {
    return original;
  }
  var binding = __assign(__assign({}, original), { options: __assign(__assign({}, toOptions(sharedOptions)), toOptions(original.options)) });
  return binding;
}
__name(getBinding, "getBinding");
function bindAll(target, bindings, sharedOptions) {
  var unbinds = bindings.map(function(original) {
    var binding = getBinding(original, sharedOptions);
    return (0, bind_1.bind)(target, binding);
  });
  return /* @__PURE__ */ __name(function unbindAll() {
    unbinds.forEach(function(unbind2) {
      return unbind2();
    });
  }, "unbindAll");
}
__name(bindAll, "bindAll");
bindAll_2 = bindAll$1.bindAll = bindAll;
(function(exports) {
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.bindAll = exports.bind = void 0;
  var bind_12 = bind$1;
  Object.defineProperty(exports, "bind", { enumerable: true, get: /* @__PURE__ */ __name(function() {
    return bind_12.bind;
  }, "get") });
  var bind_all_1 = bindAll$1;
  Object.defineProperty(exports, "bindAll", { enumerable: true, get: /* @__PURE__ */ __name(function() {
    return bind_all_1.bindAll;
  }, "get") });
})(dist);
const index = /* @__PURE__ */ getDefaultExportFromCjs(dist);
var honeyPotDataAttribute = "data-pdnd-honey-pot";
function isHoneyPotElement(target) {
  return target instanceof Element && target.hasAttribute(honeyPotDataAttribute);
}
__name(isHoneyPotElement, "isHoneyPotElement");
function getElementFromPointWithoutHoneypot(client) {
  var _document$elementsFro = document.elementsFromPoint(client.x, client.y), _document$elementsFro2 = _slicedToArray(_document$elementsFro, 2), top = _document$elementsFro2[0], second = _document$elementsFro2[1];
  if (!top) {
    return null;
  }
  if (isHoneyPotElement(top)) {
    return second !== null && second !== void 0 ? second : null;
  }
  return top;
}
__name(getElementFromPointWithoutHoneypot, "getElementFromPointWithoutHoneypot");
function _typeof$3(o) {
  "@babel/helpers - typeof";
  return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$3(o);
}
__name(_typeof$3, "_typeof$3");
function toPrimitive(t2, r) {
  if ("object" != _typeof$3(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$3(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(toPrimitive, "toPrimitive");
function toPropertyKey(t2) {
  var i2 = toPrimitive(t2, "string");
  return "symbol" == _typeof$3(i2) ? i2 : i2 + "";
}
__name(toPropertyKey, "toPropertyKey");
function _defineProperty$3(e2, r, t2) {
  return (r = toPropertyKey(r)) in e2 ? Object.defineProperty(e2, r, {
    value: t2,
    enumerable: true,
    configurable: true,
    writable: true
  }) : e2[r] = t2, e2;
}
__name(_defineProperty$3, "_defineProperty$3");
var maxZIndex = 2147483647;
function ownKeys$5(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$5, "ownKeys$5");
function _objectSpread$5(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$5(Object(t2), true).forEach(function(r2) {
      _defineProperty$3(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$5(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$5, "_objectSpread$5");
var honeyPotSize = 2;
var halfHoneyPotSize = honeyPotSize / 2;
function floorToClosestPixel(point) {
  return {
    x: Math.floor(point.x),
    y: Math.floor(point.y)
  };
}
__name(floorToClosestPixel, "floorToClosestPixel");
function pullBackByHalfHoneyPotSize(point) {
  return {
    x: point.x - halfHoneyPotSize,
    y: point.y - halfHoneyPotSize
  };
}
__name(pullBackByHalfHoneyPotSize, "pullBackByHalfHoneyPotSize");
function preventGoingBackwardsOffScreen(point) {
  return {
    x: Math.max(point.x, 0),
    y: Math.max(point.y, 0)
  };
}
__name(preventGoingBackwardsOffScreen, "preventGoingBackwardsOffScreen");
function preventGoingForwardsOffScreen(point) {
  return {
    x: Math.min(point.x, window.innerWidth - honeyPotSize),
    y: Math.min(point.y, window.innerHeight - honeyPotSize)
  };
}
__name(preventGoingForwardsOffScreen, "preventGoingForwardsOffScreen");
function getHoneyPotRectFor(_ref) {
  var client = _ref.client;
  var point = preventGoingForwardsOffScreen(preventGoingBackwardsOffScreen(pullBackByHalfHoneyPotSize(floorToClosestPixel(client))));
  return DOMRect.fromRect({
    x: point.x,
    y: point.y,
    width: honeyPotSize,
    height: honeyPotSize
  });
}
__name(getHoneyPotRectFor, "getHoneyPotRectFor");
function getRectStyles(_ref2) {
  var clientRect2 = _ref2.clientRect;
  return {
    left: "".concat(clientRect2.left, "px"),
    top: "".concat(clientRect2.top, "px"),
    width: "".concat(clientRect2.width, "px"),
    height: "".concat(clientRect2.height, "px")
  };
}
__name(getRectStyles, "getRectStyles");
function isWithin(_ref3) {
  var client = _ref3.client, clientRect2 = _ref3.clientRect;
  return (
    // is within horizontal bounds
    client.x >= clientRect2.x && client.x <= clientRect2.x + clientRect2.width && // is within vertical bounds
    client.y >= clientRect2.y && client.y <= clientRect2.y + clientRect2.height
  );
}
__name(isWithin, "isWithin");
function mountHoneyPot(_ref4) {
  var initial = _ref4.initial;
  var element = document.createElement("div");
  element.setAttribute(honeyPotDataAttribute, "true");
  var clientRect2 = getHoneyPotRectFor({
    client: initial
  });
  Object.assign(element.style, _objectSpread$5(_objectSpread$5({
    // Setting a background color explicitly to avoid any inherited styles.
    // Looks like this could be `opacity: 0`, but worried that _might_
    // cause the element to be ignored on some platforms.
    // When debugging, set backgroundColor to something like "red".
    backgroundColor: "transparent",
    position: "fixed",
    // Being explicit to avoid inheriting styles
    padding: 0,
    margin: 0,
    boxSizing: "border-box"
  }, getRectStyles({
    clientRect: clientRect2
  })), {}, {
    // We want this element to absorb pointer events,
    // it's kind of the whole point 😉
    pointerEvents: "auto",
    // Want to make sure the honey pot is top of everything else.
    // Don't need to worry about native drag previews, as they will
    // have been rendered (and removed) before the honey pot is rendered
    zIndex: maxZIndex
  }));
  document.body.appendChild(element);
  var unbindPointerMove = dist.bind(window, {
    type: "pointermove",
    listener: /* @__PURE__ */ __name(function listener(event) {
      var client = {
        x: event.clientX,
        y: event.clientY
      };
      clientRect2 = getHoneyPotRectFor({
        client
      });
      Object.assign(element.style, getRectStyles({
        clientRect: clientRect2
      }));
    }, "listener"),
    // using capture so we are less likely to be impacted by event stopping
    options: {
      capture: true
    }
  });
  return /* @__PURE__ */ __name(function finish(_ref5) {
    var current = _ref5.current;
    unbindPointerMove();
    if (isWithin({
      client: current,
      clientRect: clientRect2
    })) {
      element.remove();
      return;
    }
    function cleanup() {
      unbindPostDragEvents();
      element.remove();
    }
    __name(cleanup, "cleanup");
    var unbindPostDragEvents = dist.bindAll(window, [
      {
        type: "pointerdown",
        listener: cleanup
      },
      {
        type: "pointermove",
        listener: cleanup
      },
      {
        type: "focusin",
        listener: cleanup
      },
      {
        type: "focusout",
        listener: cleanup
      },
      // a 'pointerdown' should happen before 'dragstart', but just being super safe
      {
        type: "dragstart",
        listener: cleanup
      },
      // if the user has dragged something out of the window
      // and then is dragging something back into the window
      // the first events we will see are "dragenter" (and then "dragover").
      // So if we see any of these we need to clear the post drag fix.
      {
        type: "dragenter",
        listener: cleanup
      },
      {
        type: "dragover",
        listener: cleanup
      }
      // Not adding a "wheel" event listener, as "wheel" by itself does not
      // resolve the bug.
    ], {
      // Using `capture` so less likely to be impacted by other code stopping events
      capture: true
    });
  }, "finish");
}
__name(mountHoneyPot, "mountHoneyPot");
function makeHoneyPotFix() {
  var latestPointerMove = null;
  function bindEvents3() {
    latestPointerMove = null;
    return dist.bind(window, {
      type: "pointermove",
      listener: /* @__PURE__ */ __name(function listener(event) {
        latestPointerMove = {
          x: event.clientX,
          y: event.clientY
        };
      }, "listener"),
      // listening for pointer move in capture phase
      // so we are less likely to be impacted by events being stopped.
      options: {
        capture: true
      }
    });
  }
  __name(bindEvents3, "bindEvents");
  function getOnPostDispatch() {
    var finish = null;
    return /* @__PURE__ */ __name(function onPostEvent(_ref6) {
      var eventName = _ref6.eventName, payload = _ref6.payload;
      if (eventName === "onDragStart") {
        var _latestPointerMove;
        var input = payload.location.initial.input;
        var initial = (_latestPointerMove = latestPointerMove) !== null && _latestPointerMove !== void 0 ? _latestPointerMove : {
          x: input.clientX,
          y: input.clientY
        };
        finish = mountHoneyPot({
          initial
        });
      }
      if (eventName === "onDrop") {
        var _finish;
        var _input = payload.location.current.input;
        (_finish = finish) === null || _finish === void 0 || _finish({
          current: {
            x: _input.clientX,
            y: _input.clientY
          }
        });
        finish = null;
        latestPointerMove = null;
      }
    }, "onPostEvent");
  }
  __name(getOnPostDispatch, "getOnPostDispatch");
  return {
    bindEvents: bindEvents3,
    getOnPostDispatch
  };
}
__name(makeHoneyPotFix, "makeHoneyPotFix");
function _arrayWithoutHoles$3(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$5(r);
}
__name(_arrayWithoutHoles$3, "_arrayWithoutHoles$3");
function _iterableToArray$3(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$3, "_iterableToArray$3");
function _nonIterableSpread$3() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$3, "_nonIterableSpread$3");
function _toConsumableArray$3(r) {
  return _arrayWithoutHoles$3(r) || _iterableToArray$3(r) || _unsupportedIterableToArray$5(r) || _nonIterableSpread$3();
}
__name(_toConsumableArray$3, "_toConsumableArray$3");
function once(fn) {
  var cache2 = null;
  return /* @__PURE__ */ __name(function wrapped() {
    if (!cache2) {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      var result = fn.apply(this, args);
      cache2 = {
        result
      };
    }
    return cache2.result;
  }, "wrapped");
}
__name(once, "once");
var isFirefox = once(/* @__PURE__ */ __name(function isFirefox2() {
  if (false) {
    return false;
  }
  return navigator.userAgent.includes("Firefox");
}, "isFirefox2"));
var isSafari = once(/* @__PURE__ */ __name(function isSafari2() {
  if (false) {
    return false;
  }
  var _navigator2 = navigator, userAgent = _navigator2.userAgent;
  return userAgent.includes("AppleWebKit") && !userAgent.includes("Chrome");
}, "isSafari2"));
var symbols = {
  isLeavingWindow: Symbol("leaving"),
  isEnteringWindow: Symbol("entering")
};
function isEnteringWindowInSafari(_ref) {
  var dragEnter = _ref.dragEnter;
  if (!isSafari()) {
    return false;
  }
  return dragEnter.hasOwnProperty(symbols.isEnteringWindow);
}
__name(isEnteringWindowInSafari, "isEnteringWindowInSafari");
function isLeavingWindowInSafari(_ref2) {
  var dragLeave = _ref2.dragLeave;
  if (!isSafari()) {
    return false;
  }
  return dragLeave.hasOwnProperty(symbols.isLeavingWindow);
}
__name(isLeavingWindowInSafari, "isLeavingWindowInSafari");
(/* @__PURE__ */ __name(function fixSafari() {
  if (typeof window === "undefined") {
    return;
  }
  if (false) {
    return;
  }
  if (!isSafari()) {
    return;
  }
  function getInitialState() {
    return {
      enterCount: 0,
      isOverWindow: false
    };
  }
  __name(getInitialState, "getInitialState");
  var state = getInitialState();
  function resetState() {
    state = getInitialState();
  }
  __name(resetState, "resetState");
  dist.bindAll(
    window,
    [{
      type: "dragstart",
      listener: /* @__PURE__ */ __name(function listener() {
        state.enterCount = 0;
        state.isOverWindow = true;
      }, "listener")
    }, {
      type: "drop",
      listener: resetState
    }, {
      type: "dragend",
      listener: resetState
    }, {
      type: "dragenter",
      listener: /* @__PURE__ */ __name(function listener(event) {
        if (!state.isOverWindow && state.enterCount === 0) {
          event[symbols.isEnteringWindow] = true;
        }
        state.isOverWindow = true;
        state.enterCount++;
      }, "listener")
    }, {
      type: "dragleave",
      listener: /* @__PURE__ */ __name(function listener(event) {
        state.enterCount--;
        if (state.isOverWindow && state.enterCount === 0) {
          event[symbols.isLeavingWindow] = true;
          state.isOverWindow = false;
        }
      }, "listener")
    }],
    // using `capture: true` so that adding event listeners
    // in bubble phase will have the correct symbols
    {
      capture: true
    }
  );
}, "fixSafari"))();
function isNodeLike(target) {
  return "nodeName" in target;
}
__name(isNodeLike, "isNodeLike");
function isFromAnotherWindow(eventTarget) {
  return isNodeLike(eventTarget) && eventTarget.ownerDocument !== document;
}
__name(isFromAnotherWindow, "isFromAnotherWindow");
function isLeavingWindow(_ref) {
  var dragLeave = _ref.dragLeave;
  var type = dragLeave.type, relatedTarget = dragLeave.relatedTarget;
  if (type !== "dragleave") {
    return false;
  }
  if (isSafari()) {
    return isLeavingWindowInSafari({
      dragLeave
    });
  }
  if (relatedTarget == null) {
    return true;
  }
  if (isFirefox()) {
    return isFromAnotherWindow(relatedTarget);
  }
  return relatedTarget instanceof HTMLIFrameElement;
}
__name(isLeavingWindow, "isLeavingWindow");
function getBindingsForBrokenDrags(_ref) {
  var onDragEnd3 = _ref.onDragEnd;
  return [
    // ## Detecting drag ending for removed draggables
    //
    // If a draggable element is removed during a drag and the user drops:
    // 1. if over a valid drop target: we get a "drop" event to know the drag is finished
    // 2. if not over a valid drop target (or cancelled): we get nothing
    // The "dragend" event will not fire on the source draggable if it has been
    // removed from the DOM.
    // So we need to figure out if a drag operation has finished by looking at other events
    // We can do this by looking at other events
    // ### First detection: "pointermove" events
    // 1. "pointermove" events cannot fire during a drag and drop operation
    // according to the spec. So if we get a "pointermove" it means that
    // the drag and drop operations has finished. So if we get a "pointermove"
    // we know that the drag is over
    // 2. 🦊😤 Drag and drop operations are _supposed_ to suppress
    // other pointer events. However, firefox will allow a few
    // pointer event to get through after a drag starts.
    // The most I've seen is 3
    {
      type: "pointermove",
      listener: /* @__PURE__ */ function() {
        var callCount = 0;
        return /* @__PURE__ */ __name(function listener() {
          if (callCount < 20) {
            callCount++;
            return;
          }
          onDragEnd3();
        }, "listener");
      }()
    },
    // ### Second detection: "pointerdown" events
    // If we receive this event then we know that a drag operation has finished
    // and potentially another one is about to start.
    // Note: `pointerdown` fires on all browsers / platforms before "dragstart"
    {
      type: "pointerdown",
      listener: onDragEnd3
    }
  ];
}
__name(getBindingsForBrokenDrags, "getBindingsForBrokenDrags");
function getInput(event) {
  return {
    altKey: event.altKey,
    button: event.button,
    buttons: event.buttons,
    ctrlKey: event.ctrlKey,
    metaKey: event.metaKey,
    shiftKey: event.shiftKey,
    clientX: event.clientX,
    clientY: event.clientY,
    pageX: event.pageX,
    pageY: event.pageY
  };
}
__name(getInput, "getInput");
var rafSchd = /* @__PURE__ */ __name(function rafSchd2(fn) {
  var lastArgs = [];
  var frameId = null;
  var wrapperFn = /* @__PURE__ */ __name(function wrapperFn2() {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    lastArgs = args;
    if (frameId) {
      return;
    }
    frameId = requestAnimationFrame(function() {
      frameId = null;
      fn.apply(void 0, lastArgs);
    });
  }, "wrapperFn");
  wrapperFn.cancel = function() {
    if (!frameId) {
      return;
    }
    cancelAnimationFrame(frameId);
    frameId = null;
  };
  return wrapperFn;
}, "rafSchd");
var scheduleOnDrag = rafSchd(function(fn) {
  return fn();
});
var dragStart = /* @__PURE__ */ function() {
  var scheduled = null;
  function schedule(fn) {
    var frameId = requestAnimationFrame(function() {
      scheduled = null;
      fn();
    });
    scheduled = {
      frameId,
      fn
    };
  }
  __name(schedule, "schedule");
  function flush() {
    if (scheduled) {
      cancelAnimationFrame(scheduled.frameId);
      scheduled.fn();
      scheduled = null;
    }
  }
  __name(flush, "flush");
  return {
    schedule,
    flush
  };
}();
function makeDispatch(_ref) {
  var source = _ref.source, initial = _ref.initial, dispatchEvent2 = _ref.dispatchEvent;
  var previous = {
    dropTargets: []
  };
  function safeDispatch(args) {
    dispatchEvent2(args);
    previous = {
      dropTargets: args.payload.location.current.dropTargets
    };
  }
  __name(safeDispatch, "safeDispatch");
  var dispatch = {
    start: /* @__PURE__ */ __name(function start2(_ref2) {
      var nativeSetDragImage = _ref2.nativeSetDragImage;
      var location2 = {
        current: initial,
        previous,
        initial
      };
      safeDispatch({
        eventName: "onGenerateDragPreview",
        payload: {
          source,
          location: location2,
          nativeSetDragImage
        }
      });
      dragStart.schedule(function() {
        safeDispatch({
          eventName: "onDragStart",
          payload: {
            source,
            location: location2
          }
        });
      });
    }, "start"),
    dragUpdate: /* @__PURE__ */ __name(function dragUpdate(_ref3) {
      var current = _ref3.current;
      dragStart.flush();
      scheduleOnDrag.cancel();
      safeDispatch({
        eventName: "onDropTargetChange",
        payload: {
          source,
          location: {
            initial,
            previous,
            current
          }
        }
      });
    }, "dragUpdate"),
    drag: /* @__PURE__ */ __name(function drag(_ref4) {
      var current = _ref4.current;
      scheduleOnDrag(function() {
        dragStart.flush();
        var location2 = {
          initial,
          previous,
          current
        };
        safeDispatch({
          eventName: "onDrag",
          payload: {
            source,
            location: location2
          }
        });
      });
    }, "drag"),
    drop: /* @__PURE__ */ __name(function drop(_ref5) {
      var current = _ref5.current, updatedSourcePayload = _ref5.updatedSourcePayload;
      dragStart.flush();
      scheduleOnDrag.cancel();
      safeDispatch({
        eventName: "onDrop",
        payload: {
          source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,
          location: {
            current,
            previous,
            initial
          }
        }
      });
    }, "drop")
  };
  return dispatch;
}
__name(makeDispatch, "makeDispatch");
var globalState = {
  isActive: false
};
function canStart() {
  return !globalState.isActive;
}
__name(canStart, "canStart");
function getNativeSetDragImage(event) {
  if (event.dataTransfer) {
    return event.dataTransfer.setDragImage.bind(event.dataTransfer);
  }
  return null;
}
__name(getNativeSetDragImage, "getNativeSetDragImage");
function hasHierarchyChanged(_ref) {
  var current = _ref.current, next2 = _ref.next;
  if (current.length !== next2.length) {
    return true;
  }
  for (var i2 = 0; i2 < current.length; i2++) {
    if (current[i2].element !== next2[i2].element) {
      return true;
    }
  }
  return false;
}
__name(hasHierarchyChanged, "hasHierarchyChanged");
function start(_ref2) {
  var event = _ref2.event, dragType = _ref2.dragType, getDropTargetsOver = _ref2.getDropTargetsOver, dispatchEvent2 = _ref2.dispatchEvent;
  if (!canStart()) {
    return;
  }
  var initial = getStartLocation({
    event,
    dragType,
    getDropTargetsOver
  });
  globalState.isActive = true;
  var state = {
    current: initial
  };
  setDropEffectOnEvent({
    event,
    current: initial.dropTargets
  });
  var dispatch = makeDispatch({
    source: dragType.payload,
    dispatchEvent: dispatchEvent2,
    initial
  });
  function updateState(next2) {
    var hasChanged2 = hasHierarchyChanged({
      current: state.current.dropTargets,
      next: next2.dropTargets
    });
    state.current = next2;
    if (hasChanged2) {
      dispatch.dragUpdate({
        current: state.current
      });
    }
  }
  __name(updateState, "updateState");
  function onUpdateEvent(event2) {
    var input = getInput(event2);
    var target = isHoneyPotElement(event2.target) ? getElementFromPointWithoutHoneypot({
      x: input.clientX,
      y: input.clientY
    }) : event2.target;
    var nextDropTargets = getDropTargetsOver({
      target,
      input,
      source: dragType.payload,
      current: state.current.dropTargets
    });
    if (nextDropTargets.length) {
      event2.preventDefault();
      setDropEffectOnEvent({
        event: event2,
        current: nextDropTargets
      });
    }
    updateState({
      dropTargets: nextDropTargets,
      input
    });
  }
  __name(onUpdateEvent, "onUpdateEvent");
  function cancel() {
    if (state.current.dropTargets.length) {
      updateState({
        dropTargets: [],
        input: state.current.input
      });
    }
    dispatch.drop({
      current: state.current,
      updatedSourcePayload: null
    });
    finish();
  }
  __name(cancel, "cancel");
  function finish() {
    globalState.isActive = false;
    unbindEvents3();
  }
  __name(finish, "finish");
  var unbindEvents3 = dist.bindAll(
    window,
    [{
      // 👋 Note: we are repurposing the `dragover` event as our `drag` event
      // this is because firefox does not publish pointer coordinates during
      // a `drag` event, but does for every other type of drag event
      // `dragover` fires on all elements that are being dragged over
      // Because we are binding to `window` - our `dragover` is effectively the same as a `drag`
      // 🦊😤
      type: "dragover",
      listener: /* @__PURE__ */ __name(function listener(event2) {
        onUpdateEvent(event2);
        dispatch.drag({
          current: state.current
        });
      }, "listener")
    }, {
      type: "dragenter",
      listener: onUpdateEvent
    }, {
      type: "dragleave",
      listener: /* @__PURE__ */ __name(function listener(event2) {
        if (!isLeavingWindow({
          dragLeave: event2
        })) {
          return;
        }
        updateState({
          input: state.current.input,
          dropTargets: []
        });
        if (dragType.startedFrom === "external") {
          cancel();
        }
      }, "listener")
    }, {
      // A "drop" can only happen if the browser allowed the drop
      type: "drop",
      listener: /* @__PURE__ */ __name(function listener(event2) {
        state.current = {
          dropTargets: state.current.dropTargets,
          input: getInput(event2)
        };
        if (!state.current.dropTargets.length) {
          cancel();
          return;
        }
        event2.preventDefault();
        setDropEffectOnEvent({
          event: event2,
          current: state.current.dropTargets
        });
        dispatch.drop({
          current: state.current,
          // When dropping something native, we need to extract the latest
          // `.items` from the "drop" event as it is now accessible
          updatedSourcePayload: dragType.type === "external" ? dragType.getDropPayload(event2) : null
        });
        finish();
      }, "listener")
    }, {
      // "dragend" fires when on the drag source (eg a draggable element)
      // when the drag is finished.
      // "dragend" will fire after "drop" (if there was a successful drop)
      // "dragend" does not fire if the draggable source has been removed during the drag
      // or for external drag sources (eg files)
      // This "dragend" listener will not fire if there was a successful drop
      // as we will have already removed the event listener
      type: "dragend",
      listener: /* @__PURE__ */ __name(function listener(event2) {
        state.current = {
          dropTargets: state.current.dropTargets,
          input: getInput(event2)
        };
        cancel();
      }, "listener")
    }].concat(_toConsumableArray$3(getBindingsForBrokenDrags({
      onDragEnd: cancel
    }))),
    // Once we have started a managed drag operation it is important that we see / own all drag events
    // We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
    // all "drop" events in the bubble phase on the `document.body`.
    // This meant that we never saw the "drop" event.
    {
      capture: true
    }
  );
  dispatch.start({
    nativeSetDragImage: getNativeSetDragImage(event)
  });
}
__name(start, "start");
function setDropEffectOnEvent(_ref3) {
  var _current$;
  var event = _ref3.event, current = _ref3.current;
  var innerMost = (_current$ = current[0]) === null || _current$ === void 0 ? void 0 : _current$.dropEffect;
  if (innerMost != null && event.dataTransfer) {
    event.dataTransfer.dropEffect = innerMost;
  }
}
__name(setDropEffectOnEvent, "setDropEffectOnEvent");
function getStartLocation(_ref4) {
  var event = _ref4.event, dragType = _ref4.dragType, getDropTargetsOver = _ref4.getDropTargetsOver;
  var input = getInput(event);
  if (dragType.startedFrom === "external") {
    return {
      input,
      dropTargets: []
    };
  }
  var dropTargets = getDropTargetsOver({
    input,
    source: dragType.payload,
    target: event.target,
    current: []
  });
  return {
    input,
    dropTargets
  };
}
__name(getStartLocation, "getStartLocation");
var lifecycle = {
  canStart,
  start
};
var ledger = /* @__PURE__ */ new Map();
function registerUsage(_ref) {
  var typeKey = _ref.typeKey, mount2 = _ref.mount;
  var entry = ledger.get(typeKey);
  if (entry) {
    entry.usageCount++;
    return entry;
  }
  var initial = {
    typeKey,
    unmount: mount2(),
    usageCount: 1
  };
  ledger.set(typeKey, initial);
  return initial;
}
__name(registerUsage, "registerUsage");
function register(args) {
  var entry = registerUsage(args);
  return /* @__PURE__ */ __name(function unregister() {
    entry.usageCount--;
    if (entry.usageCount > 0) {
      return;
    }
    entry.unmount();
    ledger.delete(args.typeKey);
  }, "unregister");
}
__name(register, "register");
function combine() {
  for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
    fns[_key] = arguments[_key];
  }
  return /* @__PURE__ */ __name(function cleanup() {
    fns.forEach(function(fn) {
      return fn();
    });
  }, "cleanup");
}
__name(combine, "combine");
function addAttribute(element, _ref) {
  var attribute2 = _ref.attribute, value4 = _ref.value;
  element.setAttribute(attribute2, value4);
  return function() {
    return element.removeAttribute(attribute2);
  };
}
__name(addAttribute, "addAttribute");
function ownKeys$4(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$4, "ownKeys$4");
function _objectSpread$4(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$4(Object(t2), true).forEach(function(r2) {
      _defineProperty$3(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$4(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$4, "_objectSpread$4");
function _createForOfIteratorHelper$2(r, e2) {
  var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (!t2) {
    if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$4(r)) || e2 && r && "number" == typeof r.length) {
      t2 && (r = t2);
      var _n = 0, F = /* @__PURE__ */ __name(function F2() {
      }, "F2");
      return { s: F, n: /* @__PURE__ */ __name(function n() {
        return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
      }, "n"), e: /* @__PURE__ */ __name(function e22(r2) {
        throw r2;
      }, "e2"), f: F };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var o, a = true, u = false;
  return { s: /* @__PURE__ */ __name(function s() {
    t2 = t2.call(r);
  }, "s"), n: /* @__PURE__ */ __name(function n() {
    var r2 = t2.next();
    return a = r2.done, r2;
  }, "n"), e: /* @__PURE__ */ __name(function e22(r2) {
    u = true, o = r2;
  }, "e2"), f: /* @__PURE__ */ __name(function f() {
    try {
      a || null == t2.return || t2.return();
    } finally {
      if (u) throw o;
    }
  }, "f") };
}
__name(_createForOfIteratorHelper$2, "_createForOfIteratorHelper$2");
function _unsupportedIterableToArray$4(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$4(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$4(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$4, "_unsupportedIterableToArray$4");
function _arrayLikeToArray$4(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$4, "_arrayLikeToArray$4");
function copyReverse(array) {
  return array.slice(0).reverse();
}
__name(copyReverse, "copyReverse");
function makeDropTarget(_ref) {
  var typeKey = _ref.typeKey, defaultDropEffect = _ref.defaultDropEffect;
  var registry = /* @__PURE__ */ new WeakMap();
  var dropTargetDataAtt = "data-drop-target-for-".concat(typeKey);
  var dropTargetSelector = "[".concat(dropTargetDataAtt, "]");
  function addToRegistry2(args) {
    registry.set(args.element, args);
    return function() {
      return registry.delete(args.element);
    };
  }
  __name(addToRegistry2, "addToRegistry");
  function dropTargetForConsumers(args) {
    if (false) {
      var existing = registry.get(args.element);
      if (existing) {
        console.warn("You have already registered a [".concat(typeKey, "] dropTarget on the same element"), {
          existing,
          proposed: args
        });
      }
      if (args.element instanceof HTMLIFrameElement) {
        console.warn("\n            We recommend not registering <iframe> elements as drop targets\n            as it can result in some strange browser event ordering.\n          ".replace(/\s{2,}/g, " ").trim());
      }
    }
    return combine(addAttribute(args.element, {
      attribute: dropTargetDataAtt,
      value: "true"
    }), addToRegistry2(args));
  }
  __name(dropTargetForConsumers, "dropTargetForConsumers");
  function getActualDropTargets(_ref2) {
    var _args$getData, _args$getData2, _args$getDropEffect, _args$getDropEffect2;
    var source = _ref2.source, target = _ref2.target, input = _ref2.input, _ref2$result = _ref2.result, result = _ref2$result === void 0 ? [] : _ref2$result;
    if (target == null) {
      return result;
    }
    if (!(target instanceof Element)) {
      if (target instanceof Node) {
        return getActualDropTargets({
          source,
          target: target.parentElement,
          input,
          result
        });
      }
      return result;
    }
    var closest = target.closest(dropTargetSelector);
    if (closest == null) {
      return result;
    }
    var args = registry.get(closest);
    if (args == null) {
      return result;
    }
    var feedback = {
      input,
      source,
      element: args.element
    };
    if (args.canDrop && !args.canDrop(feedback)) {
      return getActualDropTargets({
        source,
        target: args.element.parentElement,
        input,
        result
      });
    }
    var data24 = (_args$getData = (_args$getData2 = args.getData) === null || _args$getData2 === void 0 ? void 0 : _args$getData2.call(args, feedback)) !== null && _args$getData !== void 0 ? _args$getData : {};
    var dropEffect = (_args$getDropEffect = (_args$getDropEffect2 = args.getDropEffect) === null || _args$getDropEffect2 === void 0 ? void 0 : _args$getDropEffect2.call(args, feedback)) !== null && _args$getDropEffect !== void 0 ? _args$getDropEffect : defaultDropEffect;
    var record = {
      data: data24,
      element: args.element,
      dropEffect,
      // we are collecting _actual_ drop targets, so these are
      // being applied _not_ due to stickiness
      isActiveDueToStickiness: false
    };
    return getActualDropTargets({
      source,
      target: args.element.parentElement,
      input,
      // Using bubble ordering. Same ordering as `event.getPath()`
      result: [].concat(_toConsumableArray$3(result), [record])
    });
  }
  __name(getActualDropTargets, "getActualDropTargets");
  function notifyCurrent(_ref3) {
    var eventName = _ref3.eventName, payload = _ref3.payload;
    var _iterator = _createForOfIteratorHelper$2(payload.location.current.dropTargets), _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done; ) {
        var _entry$eventName;
        var record = _step.value;
        var entry = registry.get(record.element);
        var args = _objectSpread$4(_objectSpread$4({}, payload), {}, {
          self: record
        });
        entry === null || entry === void 0 || (_entry$eventName = entry[eventName]) === null || _entry$eventName === void 0 || _entry$eventName.call(
          entry,
          // I cannot seem to get the types right here.
          // TS doesn't seem to like that one event can need `nativeSetDragImage`
          // @ts-expect-error
          args
        );
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
  }
  __name(notifyCurrent, "notifyCurrent");
  var actions = {
    onGenerateDragPreview: notifyCurrent,
    onDrag: notifyCurrent,
    onDragStart: notifyCurrent,
    onDrop: notifyCurrent,
    onDropTargetChange: /* @__PURE__ */ __name(function onDropTargetChange(_ref4) {
      var payload = _ref4.payload;
      var isCurrent = new Set(payload.location.current.dropTargets.map(function(record2) {
        return record2.element;
      }));
      var visited = /* @__PURE__ */ new Set();
      var _iterator2 = _createForOfIteratorHelper$2(payload.location.previous.dropTargets), _step2;
      try {
        for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
          var _entry$onDropTargetCh;
          var record = _step2.value;
          visited.add(record.element);
          var entry = registry.get(record.element);
          var isOver = isCurrent.has(record.element);
          var args = _objectSpread$4(_objectSpread$4({}, payload), {}, {
            self: record
          });
          entry === null || entry === void 0 || (_entry$onDropTargetCh = entry.onDropTargetChange) === null || _entry$onDropTargetCh === void 0 || _entry$onDropTargetCh.call(entry, args);
          if (!isOver) {
            var _entry$onDragLeave;
            entry === null || entry === void 0 || (_entry$onDragLeave = entry.onDragLeave) === null || _entry$onDragLeave === void 0 || _entry$onDragLeave.call(entry, args);
          }
        }
      } catch (err) {
        _iterator2.e(err);
      } finally {
        _iterator2.f();
      }
      var _iterator3 = _createForOfIteratorHelper$2(payload.location.current.dropTargets), _step3;
      try {
        for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
          var _entry$onDropTargetCh2, _entry$onDragEnter;
          var _record = _step3.value;
          if (visited.has(_record.element)) {
            continue;
          }
          var _args = _objectSpread$4(_objectSpread$4({}, payload), {}, {
            self: _record
          });
          var _entry = registry.get(_record.element);
          _entry === null || _entry === void 0 || (_entry$onDropTargetCh2 = _entry.onDropTargetChange) === null || _entry$onDropTargetCh2 === void 0 || _entry$onDropTargetCh2.call(_entry, _args);
          _entry === null || _entry === void 0 || (_entry$onDragEnter = _entry.onDragEnter) === null || _entry$onDragEnter === void 0 || _entry$onDragEnter.call(_entry, _args);
        }
      } catch (err) {
        _iterator3.e(err);
      } finally {
        _iterator3.f();
      }
    }, "onDropTargetChange")
  };
  function dispatchEvent2(args) {
    actions[args.eventName](args);
  }
  __name(dispatchEvent2, "dispatchEvent");
  function getIsOver(_ref5) {
    var source = _ref5.source, target = _ref5.target, input = _ref5.input, current = _ref5.current;
    var actual = getActualDropTargets({
      source,
      target,
      input
    });
    if (actual.length >= current.length) {
      return actual;
    }
    var lastCaptureOrdered = copyReverse(current);
    var actualCaptureOrdered = copyReverse(actual);
    var resultCaptureOrdered = [];
    for (var index2 = 0; index2 < lastCaptureOrdered.length; index2++) {
      var _argsForLast$getIsSti;
      var last = lastCaptureOrdered[index2];
      var fresh = actualCaptureOrdered[index2];
      if (fresh != null) {
        resultCaptureOrdered.push(fresh);
        continue;
      }
      var parent = resultCaptureOrdered[index2 - 1];
      var lastParent = lastCaptureOrdered[index2 - 1];
      if ((parent === null || parent === void 0 ? void 0 : parent.element) !== (lastParent === null || lastParent === void 0 ? void 0 : lastParent.element)) {
        break;
      }
      var argsForLast = registry.get(last.element);
      if (!argsForLast) {
        break;
      }
      var feedback = {
        input,
        source,
        element: argsForLast.element
      };
      if (argsForLast.canDrop && !argsForLast.canDrop(feedback)) {
        break;
      }
      if (!((_argsForLast$getIsSti = argsForLast.getIsSticky) !== null && _argsForLast$getIsSti !== void 0 && _argsForLast$getIsSti.call(argsForLast, feedback))) {
        break;
      }
      resultCaptureOrdered.push(_objectSpread$4(_objectSpread$4({}, last), {}, {
        // making it clear to consumers this drop target is active due to stickiness
        isActiveDueToStickiness: true
      }));
    }
    return copyReverse(resultCaptureOrdered);
  }
  __name(getIsOver, "getIsOver");
  return {
    dropTargetForConsumers,
    getIsOver,
    dispatchEvent: dispatchEvent2
  };
}
__name(makeDropTarget, "makeDropTarget");
function _createForOfIteratorHelper$1(r, e2) {
  var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (!t2) {
    if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$3(r)) || e2 && r && "number" == typeof r.length) {
      t2 && (r = t2);
      var _n = 0, F = /* @__PURE__ */ __name(function F2() {
      }, "F");
      return { s: F, n: /* @__PURE__ */ __name(function n() {
        return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
      }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
        throw r2;
      }, "e"), f: F };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var o, a = true, u = false;
  return { s: /* @__PURE__ */ __name(function s() {
    t2 = t2.call(r);
  }, "s"), n: /* @__PURE__ */ __name(function n() {
    var r2 = t2.next();
    return a = r2.done, r2;
  }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
    u = true, o = r2;
  }, "e"), f: /* @__PURE__ */ __name(function f() {
    try {
      a || null == t2.return || t2.return();
    } finally {
      if (u) throw o;
    }
  }, "f") };
}
__name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper$1");
function _unsupportedIterableToArray$3(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$3(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$3(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$3, "_unsupportedIterableToArray$3");
function _arrayLikeToArray$3(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$3, "_arrayLikeToArray$3");
function ownKeys$3(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$3, "ownKeys$3");
function _objectSpread$3(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$3(Object(t2), true).forEach(function(r2) {
      _defineProperty$3(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$3(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$3, "_objectSpread$3");
function makeMonitor() {
  var registry = /* @__PURE__ */ new Set();
  var dragging = null;
  function tryAddToActive(monitor) {
    if (!dragging) {
      return;
    }
    if (!monitor.canMonitor || monitor.canMonitor(dragging.canMonitorArgs)) {
      dragging.active.add(monitor);
    }
  }
  __name(tryAddToActive, "tryAddToActive");
  function monitorForConsumers(args) {
    var entry = _objectSpread$3({}, args);
    registry.add(entry);
    tryAddToActive(entry);
    return /* @__PURE__ */ __name(function cleanup() {
      registry.delete(entry);
      if (dragging) {
        dragging.active.delete(entry);
      }
    }, "cleanup");
  }
  __name(monitorForConsumers, "monitorForConsumers");
  function dispatchEvent2(_ref) {
    var eventName = _ref.eventName, payload = _ref.payload;
    if (eventName === "onGenerateDragPreview") {
      dragging = {
        canMonitorArgs: {
          initial: payload.location.initial,
          source: payload.source
        },
        active: /* @__PURE__ */ new Set()
      };
      var _iterator = _createForOfIteratorHelper$1(registry), _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var monitor = _step.value;
          tryAddToActive(monitor);
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
    }
    if (!dragging) {
      return;
    }
    var active3 = Array.from(dragging.active);
    for (var _i = 0, _active = active3; _i < _active.length; _i++) {
      var _monitor = _active[_i];
      if (dragging.active.has(_monitor)) {
        var _monitor$eventName;
        (_monitor$eventName = _monitor[eventName]) === null || _monitor$eventName === void 0 || _monitor$eventName.call(_monitor, payload);
      }
    }
    if (eventName === "onDrop") {
      dragging.active.clear();
      dragging = null;
    }
  }
  __name(dispatchEvent2, "dispatchEvent");
  return {
    dispatchEvent: dispatchEvent2,
    monitorForConsumers
  };
}
__name(makeMonitor, "makeMonitor");
function makeAdapter(_ref) {
  var typeKey = _ref.typeKey, mount2 = _ref.mount, dispatchEventToSource2 = _ref.dispatchEventToSource, onPostDispatch = _ref.onPostDispatch, defaultDropEffect = _ref.defaultDropEffect;
  var monitorAPI = makeMonitor();
  var dropTargetAPI = makeDropTarget({
    typeKey,
    defaultDropEffect
  });
  function dispatchEvent2(args) {
    dispatchEventToSource2 === null || dispatchEventToSource2 === void 0 || dispatchEventToSource2(args);
    dropTargetAPI.dispatchEvent(args);
    monitorAPI.dispatchEvent(args);
    onPostDispatch === null || onPostDispatch === void 0 || onPostDispatch(args);
  }
  __name(dispatchEvent2, "dispatchEvent");
  function start2(_ref2) {
    var event = _ref2.event, dragType = _ref2.dragType;
    lifecycle.start({
      event,
      dragType,
      getDropTargetsOver: dropTargetAPI.getIsOver,
      dispatchEvent: dispatchEvent2
    });
  }
  __name(start2, "start");
  function registerUsage2() {
    function mountAdapter() {
      var api2 = {
        canStart: lifecycle.canStart,
        start: start2
      };
      return mount2(api2);
    }
    __name(mountAdapter, "mountAdapter");
    return register({
      typeKey,
      mount: mountAdapter
    });
  }
  __name(registerUsage2, "registerUsage");
  return {
    registerUsage: registerUsage2,
    dropTarget: dropTargetAPI.dropTargetForConsumers,
    monitor: monitorAPI.monitorForConsumers
  };
}
__name(makeAdapter, "makeAdapter");
var isAndroid = once(/* @__PURE__ */ __name(function isAndroid2() {
  return navigator.userAgent.toLocaleLowerCase().includes("android");
}, "isAndroid"));
var androidFallbackText = "pdnd:android-fallback";
var textMediaType = "text/plain";
var URLMediaType = "text/uri-list";
var elementAdapterNativeDataKey = "application/vnd.pdnd";
var draggableRegistry = /* @__PURE__ */ new WeakMap();
function addToRegistry(args) {
  draggableRegistry.set(args.element, args);
  return /* @__PURE__ */ __name(function cleanup() {
    draggableRegistry.delete(args.element);
  }, "cleanup");
}
__name(addToRegistry, "addToRegistry");
var honeyPotFix = makeHoneyPotFix();
var adapter = makeAdapter({
  typeKey: "element",
  defaultDropEffect: "move",
  mount: /* @__PURE__ */ __name(function mount(api2) {
    return combine(honeyPotFix.bindEvents(), dist.bind(document, {
      type: "dragstart",
      listener: /* @__PURE__ */ __name(function listener(event) {
        var _entry$dragHandle, _entry$getInitialData, _entry$getInitialData2, _entry$dragHandle2, _entry$getInitialData3, _entry$getInitialData4;
        if (!api2.canStart(event)) {
          return;
        }
        if (event.defaultPrevented) {
          return;
        }
        if (!event.dataTransfer) {
          if (false) {
            console.warn("\n              It appears as though you have are not testing DragEvents correctly.\n\n              - If you are unit testing, ensure you have polyfilled DragEvent.\n              - If you are browser testing, ensure you are dispatching drag events correctly.\n\n              Please see our testing guides for more information:\n              https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n            ".replace(/ {2}/g, ""));
          }
          return;
        }
        var target = event.target;
        if (!(target instanceof HTMLElement)) {
          return null;
        }
        var entry = draggableRegistry.get(target);
        if (!entry) {
          return null;
        }
        var input = getInput(event);
        var feedback = {
          element: entry.element,
          dragHandle: (_entry$dragHandle = entry.dragHandle) !== null && _entry$dragHandle !== void 0 ? _entry$dragHandle : null,
          input
        };
        if (entry.canDrag && !entry.canDrag(feedback)) {
          event.preventDefault();
          return null;
        }
        if (entry.dragHandle) {
          var over = getElementFromPointWithoutHoneypot({
            x: input.clientX,
            y: input.clientY
          });
          if (!entry.dragHandle.contains(over)) {
            event.preventDefault();
            return null;
          }
        }
        var nativeData = (_entry$getInitialData = (_entry$getInitialData2 = entry.getInitialDataForExternal) === null || _entry$getInitialData2 === void 0 ? void 0 : _entry$getInitialData2.call(entry, feedback)) !== null && _entry$getInitialData !== void 0 ? _entry$getInitialData : null;
        if (nativeData) {
          for (var _i = 0, _Object$entries = Object.entries(nativeData); _i < _Object$entries.length; _i++) {
            var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), key = _Object$entries$_i[0], data24 = _Object$entries$_i[1];
            event.dataTransfer.setData(key, data24 !== null && data24 !== void 0 ? data24 : "");
          }
        }
        if (isAndroid() && !event.dataTransfer.types.includes(textMediaType) && !event.dataTransfer.types.includes(URLMediaType)) {
          event.dataTransfer.setData(textMediaType, androidFallbackText);
        }
        event.dataTransfer.setData(elementAdapterNativeDataKey, "");
        var payload = {
          element: entry.element,
          dragHandle: (_entry$dragHandle2 = entry.dragHandle) !== null && _entry$dragHandle2 !== void 0 ? _entry$dragHandle2 : null,
          data: (_entry$getInitialData3 = (_entry$getInitialData4 = entry.getInitialData) === null || _entry$getInitialData4 === void 0 ? void 0 : _entry$getInitialData4.call(entry, feedback)) !== null && _entry$getInitialData3 !== void 0 ? _entry$getInitialData3 : {}
        };
        var dragType = {
          type: "element",
          payload,
          startedFrom: "internal"
        };
        api2.start({
          event,
          dragType
        });
      }, "listener")
    }));
  }, "mount"),
  dispatchEventToSource: /* @__PURE__ */ __name(function dispatchEventToSource(_ref) {
    var _draggableRegistry$ge, _draggableRegistry$ge2;
    var eventName = _ref.eventName, payload = _ref.payload;
    (_draggableRegistry$ge = draggableRegistry.get(payload.source.element)) === null || _draggableRegistry$ge === void 0 || (_draggableRegistry$ge2 = _draggableRegistry$ge[eventName]) === null || _draggableRegistry$ge2 === void 0 || _draggableRegistry$ge2.call(
      _draggableRegistry$ge,
      // I cannot seem to get the types right here.
      // TS doesn't seem to like that one event can need `nativeSetDragImage`
      // @ts-expect-error
      payload
    );
  }, "dispatchEventToSource"),
  onPostDispatch: honeyPotFix.getOnPostDispatch()
});
var dropTargetForElements = adapter.dropTarget;
var monitorForElements = adapter.monitor;
function draggable(args) {
  if (false) {
    if (args.dragHandle && !args.element.contains(args.dragHandle)) {
      console.warn("Drag handle element must be contained in draggable element", {
        element: args.element,
        dragHandle: args.dragHandle
      });
    }
  }
  if (false) {
    var existing = draggableRegistry.get(args.element);
    if (existing) {
      console.warn("You have already registered a `draggable` on the same element", {
        existing,
        proposed: args
      });
    }
  }
  return combine(
    // making the draggable register the adapter rather than drop targets
    // this is because you *must* have a draggable element to start a drag
    // but you _might_ not have any drop targets immediately
    // (You might create drop targets async)
    adapter.registerUsage(),
    addToRegistry(args),
    addAttribute(args.element, {
      attribute: "draggable",
      value: "true"
    })
  );
}
__name(draggable, "draggable");
function usePragmaticDroppable(dropTargetElement, options4) {
  let cleanup = /* @__PURE__ */ __name(() => {
  }, "cleanup");
  onMounted(() => {
    const element = typeof dropTargetElement === "function" ? dropTargetElement() : dropTargetElement;
    if (!element) {
      return;
    }
    cleanup = dropTargetForElements({
      element,
      ...options4
    });
  });
  onBeforeUnmount(() => {
    cleanup();
  });
}
__name(usePragmaticDroppable, "usePragmaticDroppable");
function usePragmaticDraggable(draggableElement, options4) {
  let cleanup = /* @__PURE__ */ __name(() => {
  }, "cleanup");
  onMounted(() => {
    const element = typeof draggableElement === "function" ? draggableElement() : draggableElement;
    if (!element) {
      return;
    }
    cleanup = draggable({
      element,
      ...options4
    });
  });
  onBeforeUnmount(() => {
    cleanup();
  });
}
__name(usePragmaticDraggable, "usePragmaticDraggable");
const _withScopeId$a = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-a6457774"), n = n(), popScopeId(), n), "_withScopeId$a");
const _hoisted_1$n = { class: "node-content" };
const _hoisted_2$f = { class: "node-label" };
const _hoisted_3$9 = { class: "node-actions" };
const _sfc_main$p = /* @__PURE__ */ defineComponent({
  __name: "TreeExplorerTreeNode",
  props: {
    node: {}
  },
  emits: ["itemDropped", "dragStart", "dragEnd"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit2 = __emit;
    const nodeBadgeText = computed(() => {
      if (props.node.leaf) {
        return "";
      }
      if (props.node.badgeText !== void 0 && props.node.badgeText !== null) {
        return props.node.badgeText;
      }
      return props.node.totalLeaves.toString();
    });
    const showNodeBadgeText = computed(() => nodeBadgeText.value !== "");
    const labelEditable = computed(() => !!props.node.handleRename);
    const renameEditingNode = inject("renameEditingNode");
    const isEditing = computed(
      () => labelEditable.value && renameEditingNode.value?.key === props.node.key
    );
    const errorHandling = useErrorHandling();
    const handleRename = errorHandling.wrapWithErrorHandlingAsync(
      async (newName) => {
        await props.node.handleRename(props.node, newName);
      },
      props.node.handleError,
      () => {
        renameEditingNode.value = null;
      }
    );
    const container = ref(null);
    const canDrop = ref(false);
    const treeNodeElementGetter = /* @__PURE__ */ __name(() => container.value?.closest(".p-tree-node-content"), "treeNodeElementGetter");
    if (props.node.draggable) {
      usePragmaticDraggable(treeNodeElementGetter, {
        getInitialData: /* @__PURE__ */ __name(() => {
          return {
            type: "tree-explorer-node",
            data: props.node
          };
        }, "getInitialData"),
        onDragStart: /* @__PURE__ */ __name(() => emit2("dragStart", props.node), "onDragStart"),
        onDrop: /* @__PURE__ */ __name(() => emit2("dragEnd", props.node), "onDrop")
      });
    }
    if (props.node.droppable) {
      usePragmaticDroppable(treeNodeElementGetter, {
        onDrop: /* @__PURE__ */ __name(async (event) => {
          const dndData = event.source.data;
          if (dndData.type === "tree-explorer-node") {
            await props.node.handleDrop?.(props.node, dndData);
            canDrop.value = false;
            emit2("itemDropped", props.node, dndData.data);
          }
        }, "onDrop"),
        onDragEnter: /* @__PURE__ */ __name((event) => {
          const dndData = event.source.data;
          if (dndData.type === "tree-explorer-node") {
            canDrop.value = true;
          }
        }, "onDragEnter"),
        onDragLeave: /* @__PURE__ */ __name(() => {
          canDrop.value = false;
        }, "onDragLeave")
      });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass([
          "tree-node",
          {
            "can-drop": canDrop.value,
            "tree-folder": !props.node.leaf,
            "tree-leaf": props.node.leaf
          }
        ]),
        ref_key: "container",
        ref: container
      }, [
        createBaseVNode("div", _hoisted_1$n, [
          createBaseVNode("span", _hoisted_2$f, [
            renderSlot(_ctx.$slots, "before-label", {
              node: props.node
            }, void 0, true),
            createVNode(EditableText, {
              modelValue: _ctx.node.label,
              isEditing: isEditing.value,
              onEdit: unref(handleRename)
            }, null, 8, ["modelValue", "isEditing", "onEdit"]),
            renderSlot(_ctx.$slots, "after-label", {
              node: props.node
            }, void 0, true)
          ]),
          showNodeBadgeText.value ? (openBlock(), createBlock(unref(script$S), {
            key: 0,
            value: nodeBadgeText.value,
            severity: "secondary",
            class: "leaf-count-badge"
          }, null, 8, ["value"])) : createCommentVNode("", true)
        ]),
        createBaseVNode("div", _hoisted_3$9, [
          renderSlot(_ctx.$slots, "actions", {
            node: props.node
          }, void 0, true)
        ])
      ], 2);
    };
  }
});
const TreeExplorerTreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-a6457774"]]);
const _sfc_main$o = /* @__PURE__ */ defineComponent({
  __name: "TreeExplorer",
  props: /* @__PURE__ */ mergeModels({
    roots: {},
    class: {}
  }, {
    "expandedKeys": {},
    "expandedKeysModifiers": {},
    "selectionKeys": {},
    "selectionKeysModifiers": {}
  }),
  emits: /* @__PURE__ */ mergeModels(["nodeClick", "nodeDelete", "contextMenu"], ["update:expandedKeys", "update:selectionKeys"]),
  setup(__props, { expose: __expose, emit: __emit }) {
    const expandedKeys2 = useModel(__props, "expandedKeys");
    provide("expandedKeys", expandedKeys2);
    const selectionKeys = useModel(__props, "selectionKeys");
    provide("selectionKeys", selectionKeys);
    const storeSelectionKeys = selectionKeys.value !== void 0;
    const props = __props;
    const emit2 = __emit;
    const renderedRoots = computed(() => {
      return props.roots.map(fillNodeInfo);
    });
    const getTreeNodeIcon = /* @__PURE__ */ __name((node3) => {
      if (node3.getIcon) {
        const icon3 = node3.getIcon(node3);
        if (icon3) {
          return icon3;
        }
      } else if (node3.icon) {
        return node3.icon;
      }
      if (node3.leaf) {
        return "pi pi-file";
      }
      const isExpanded = expandedKeys2.value[node3.key];
      return isExpanded ? "pi pi-folder-open" : "pi pi-folder";
    }, "getTreeNodeIcon");
    const fillNodeInfo = /* @__PURE__ */ __name((node3) => {
      const children = node3.children?.map(fillNodeInfo);
      const totalLeaves = node3.leaf ? 1 : children.reduce((acc, child) => acc + child.totalLeaves, 0);
      return {
        ...node3,
        icon: getTreeNodeIcon(node3),
        children,
        type: node3.leaf ? "node" : "folder",
        totalLeaves,
        badgeText: node3.getBadgeText ? node3.getBadgeText(node3) : null
      };
    }, "fillNodeInfo");
    const onNodeContentClick = /* @__PURE__ */ __name(async (e2, node3) => {
      if (!storeSelectionKeys) {
        selectionKeys.value = {};
      }
      if (node3.handleClick) {
        await node3.handleClick(node3, e2);
      }
      emit2("nodeClick", node3, e2);
    }, "onNodeContentClick");
    const menu2 = ref(null);
    const menuTargetNode = ref(null);
    provide("menuTargetNode", menuTargetNode);
    const extraMenuItems = computed(() => {
      return menuTargetNode.value?.contextMenuItems ? typeof menuTargetNode.value.contextMenuItems === "function" ? menuTargetNode.value.contextMenuItems(menuTargetNode.value) : menuTargetNode.value.contextMenuItems : [];
    });
    const renameEditingNode = ref(null);
    provide("renameEditingNode", renameEditingNode);
    const { t: t2 } = useI18n();
    const renameCommand = /* @__PURE__ */ __name((node3) => {
      renameEditingNode.value = node3;
    }, "renameCommand");
    const deleteCommand = /* @__PURE__ */ __name(async (node3) => {
      await node3.handleDelete?.(node3);
      emit2("nodeDelete", node3);
    }, "deleteCommand");
    const menuItems = computed(
      () => [
        {
          label: t2("g.rename"),
          icon: "pi pi-file-edit",
          command: /* @__PURE__ */ __name(() => renameCommand(menuTargetNode.value), "command"),
          visible: menuTargetNode.value?.handleRename !== void 0
        },
        {
          label: t2("g.delete"),
          icon: "pi pi-trash",
          command: /* @__PURE__ */ __name(() => deleteCommand(menuTargetNode.value), "command"),
          visible: menuTargetNode.value?.handleDelete !== void 0,
          isAsync: true
          // The delete command can be async
        },
        ...extraMenuItems.value
      ].map((menuItem) => ({
        ...menuItem,
        command: wrapCommandWithErrorHandler(menuItem.command, {
          isAsync: menuItem.isAsync ?? false
        })
      }))
    );
    const handleContextMenu = /* @__PURE__ */ __name((node3, e2) => {
      menuTargetNode.value = node3;
      emit2("contextMenu", node3, e2);
      if (menuItems.value.filter((item3) => item3.visible).length > 0) {
        menu2.value?.show(e2);
      }
    }, "handleContextMenu");
    const errorHandling = useErrorHandling();
    const wrapCommandWithErrorHandler = /* @__PURE__ */ __name((command2, { isAsync: isAsync2 = false }) => {
      return isAsync2 ? errorHandling.wrapWithErrorHandlingAsync(
        command2,
        menuTargetNode.value?.handleError
      ) : errorHandling.wrapWithErrorHandling(
        command2,
        menuTargetNode.value?.handleError
      );
    }, "wrapCommandWithErrorHandler");
    __expose({
      renameCommand,
      deleteCommand
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(unref(script$b), {
          class: normalizeClass(["tree-explorer py-0 px-2 2xl:px-4", props.class]),
          expandedKeys: expandedKeys2.value,
          "onUpdate:expandedKeys": _cache[0] || (_cache[0] = ($event) => expandedKeys2.value = $event),
          selectionKeys: selectionKeys.value,
          "onUpdate:selectionKeys": _cache[1] || (_cache[1] = ($event) => selectionKeys.value = $event),
          value: renderedRoots.value,
          selectionMode: "single",
          pt: {
            nodeLabel: "tree-explorer-node-label",
            nodeContent: /* @__PURE__ */ __name(({ props: props2 }) => ({
              onClick: /* @__PURE__ */ __name((e2) => onNodeContentClick(e2, props2.node), "onClick"),
              onContextmenu: /* @__PURE__ */ __name((e2) => handleContextMenu(props2.node, e2), "onContextmenu")
            }), "nodeContent"),
            nodeToggleButton: /* @__PURE__ */ __name(() => ({
              onClick: /* @__PURE__ */ __name((e2) => {
                e2.stopImmediatePropagation();
              }, "onClick")
            }), "nodeToggleButton")
          }
        }, {
          folder: withCtx(({ node: node3 }) => [
            renderSlot(_ctx.$slots, "folder", { node: node3 }, () => [
              createVNode(TreeExplorerTreeNode, { node: node3 }, null, 8, ["node"])
            ], true)
          ]),
          node: withCtx(({ node: node3 }) => [
            renderSlot(_ctx.$slots, "node", { node: node3 }, () => [
              createVNode(TreeExplorerTreeNode, { node: node3 }, null, 8, ["node"])
            ], true)
          ]),
          _: 3
        }, 8, ["class", "expandedKeys", "selectionKeys", "value", "pt"]),
        createVNode(unref(script$e), {
          ref_key: "menu",
          ref: menu2,
          model: menuItems.value
        }, null, 8, ["model"])
      ], 64);
    };
  }
});
const TreeExplorer = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-31d518da"]]);
var theme$6 = /* @__PURE__ */ __name(function theme33(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-toolbar {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    flex-wrap: wrap;\n    padding: ".concat(dt2("toolbar.padding"), ";\n    background: ").concat(dt2("toolbar.background"), ";\n    border: 1px solid ").concat(dt2("toolbar.border.color"), ";\n    color: ").concat(dt2("toolbar.color"), ";\n    border-radius: ").concat(dt2("toolbar.border.radius"), ";\n    gap: ").concat(dt2("toolbar.gap"), ";\n}\n\n.p-toolbar-start,\n.p-toolbar-center,\n.p-toolbar-end {\n    display: flex;\n    align-items: center;\n}\n");
}, "theme");
var classes$6 = {
  root: "p-toolbar p-component",
  start: "p-toolbar-start",
  center: "p-toolbar-center",
  end: "p-toolbar-end"
};
var ToolbarStyle = BaseStyle.extend({
  name: "toolbar",
  theme: theme$6,
  classes: classes$6
});
var script$1$6 = {
  name: "BaseToolbar",
  "extends": script$_,
  props: {
    ariaLabelledby: {
      type: String,
      "default": null
    }
  },
  style: ToolbarStyle,
  provide: /* @__PURE__ */ __name(function provide35() {
    return {
      $pcToolbar: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$a = {
  name: "Toolbar",
  "extends": script$1$6,
  inheritAttrs: false
};
var _hoisted_1$m = ["aria-labelledby"];
function render$9(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    role: "toolbar",
    "aria-labelledby": _ctx.ariaLabelledby
  }, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({
    "class": _ctx.cx("start")
  }, _ctx.ptm("start")), [renderSlot(_ctx.$slots, "start")], 16), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("center")
  }, _ctx.ptm("center")), [renderSlot(_ctx.$slots, "center")], 16), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("end")
  }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)], 16, _hoisted_1$m);
}
__name(render$9, "render$9");
script$a.render = render$9;
const _withScopeId$9 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-9159c070"), n = n(), popScopeId(), n), "_withScopeId$9");
const _hoisted_1$l = { class: "comfy-vue-side-bar-header" };
const _hoisted_2$e = { class: "text-sm" };
const _sfc_main$n = /* @__PURE__ */ defineComponent({
  __name: "SidebarTabTemplate",
  props: {
    title: {},
    class: {}
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["comfy-vue-side-bar-container flex flex-col h-full", props.class])
      }, [
        createBaseVNode("div", _hoisted_1$l, [
          createVNode(unref(script$a), { class: "flex-shrink-0 border-x-0 border-t-0 rounded-none px-2 py-1 min-h-8" }, {
            start: withCtx(() => [
              createBaseVNode("span", _hoisted_2$e, toDisplayString$1(props.title.toUpperCase()), 1)
            ]),
            end: withCtx(() => [
              renderSlot(_ctx.$slots, "tool-buttons", {}, void 0, true)
            ]),
            _: 3
          }),
          renderSlot(_ctx.$slots, "header", {}, void 0, true)
        ]),
        createVNode(unref(script$N), { class: "comfy-vue-side-bar-body flex-grow h-0" }, {
          default: withCtx(() => [
            renderSlot(_ctx.$slots, "body", {}, void 0, true)
          ]),
          _: 3
        })
      ], 2);
    };
  }
});
const SidebarTabTemplate = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-9159c070"]]);
const _hoisted_1$k = { class: "flex flex-col" };
const _hoisted_2$d = { key: 0 };
const _hoisted_3$8 = {
  key: 1,
  class: "mt-2 flex flex-row items-center gap-2"
};
const _sfc_main$m = /* @__PURE__ */ defineComponent({
  __name: "DownloadItem",
  props: {
    download: {}
  },
  setup(__props) {
    const { t: t2 } = useI18n();
    const electronDownloadStore = useElectronDownloadStore();
    const props = __props;
    const getDownloadLabel = /* @__PURE__ */ __name((savePath) => {
      let parts2 = (savePath ?? "").split("/");
      parts2 = parts2.length === 1 ? parts2[0].split("\\") : parts2;
      const name2 = parts2.pop();
      const dir = parts2.pop();
      return `${dir}/${name2}`;
    }, "getDownloadLabel");
    const triggerCancelDownload = /* @__PURE__ */ __name(() => electronDownloadStore.cancel(props.download.url), "triggerCancelDownload");
    const triggerPauseDownload = /* @__PURE__ */ __name(() => electronDownloadStore.pause(props.download.url), "triggerPauseDownload");
    const triggerResumeDownload = /* @__PURE__ */ __name(() => electronDownloadStore.resume(props.download.url), "triggerResumeDownload");
    const handleRemoveDownload = /* @__PURE__ */ __name(() => {
      electronDownloadStore.$patch((state) => {
        state.downloads = state.downloads.filter(
          ({ url }) => url !== props.download.url
        );
      });
    }, "handleRemoveDownload");
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return openBlock(), createElementBlock("div", _hoisted_1$k, [
        createBaseVNode("div", null, toDisplayString$1(getDownloadLabel(_ctx.download.savePath)), 1),
        ["cancelled", "error"].includes(_ctx.download.status) ? (openBlock(), createElementBlock("div", _hoisted_2$d, [
          createVNode(unref(script$y), {
            class: "h-6 text-sm font-light bg-red-700 mt-2",
            removable: "",
            onRemove: handleRemoveDownload
          }, {
            default: withCtx(() => [
              createTextVNode(toDisplayString$1(unref(t2)("electronFileDownload.cancelled")), 1)
            ]),
            _: 1
          })
        ])) : createCommentVNode("", true),
        ["in_progress", "paused", "completed"].includes(_ctx.download.status) ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
          createVNode(unref(script$D), {
            class: "flex-1",
            value: Number((_ctx.download.progress * 100).toFixed(1)),
            "show-value": _ctx.download.progress > 0.1
          }, null, 8, ["value", "show-value"]),
          _ctx.download.status === "in_progress" ? withDirectives((openBlock(), createBlock(unref(script$R), {
            key: 0,
            class: "file-action-button w-[22px] h-[22px]",
            size: "small",
            rounded: "",
            onClick: triggerPauseDownload,
            icon: "pi pi-pause"
          }, null, 512)), [
            [
              _directive_tooltip,
              unref(t2)("electronFileDownload.pause"),
              void 0,
              { top: true }
            ]
          ]) : createCommentVNode("", true),
          _ctx.download.status === "paused" ? withDirectives((openBlock(), createBlock(unref(script$R), {
            key: 1,
            class: "file-action-button w-[22px] h-[22px]",
            size: "small",
            rounded: "",
            onClick: triggerResumeDownload,
            icon: "pi pi-play"
          }, null, 512)), [
            [
              _directive_tooltip,
              unref(t2)("electronFileDownload.resume"),
              void 0,
              { top: true }
            ]
          ]) : createCommentVNode("", true),
          ["in_progress", "paused"].includes(_ctx.download.status) ? withDirectives((openBlock(), createBlock(unref(script$R), {
            key: 2,
            class: "file-action-button w-[22px] h-[22px] p-red",
            size: "small",
            rounded: "",
            severity: "danger",
            onClick: triggerCancelDownload,
            icon: "pi pi-times-circle"
          }, null, 512)), [
            [
              _directive_tooltip,
              unref(t2)("electronFileDownload.cancel"),
              void 0,
              { top: true }
            ]
          ]) : createCommentVNode("", true)
        ])) : createCommentVNode("", true)
      ]);
    };
  }
});
const _hoisted_1$j = {
  key: 0,
  class: "mx-6 mb-4"
};
const _hoisted_2$c = { class: "text-lg my-4" };
const _sfc_main$l = /* @__PURE__ */ defineComponent({
  __name: "ElectronDownloadItems",
  setup(__props) {
    const electronDownloadStore = useElectronDownloadStore();
    const { inProgressDownloads } = storeToRefs(electronDownloadStore);
    return (_ctx, _cache) => {
      return unref(inProgressDownloads).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
        createBaseVNode("div", _hoisted_2$c, toDisplayString$1(_ctx.$t("electronFileDownload.inProgress")), 1),
        (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(inProgressDownloads), (download2) => {
          return openBlock(), createBlock(_sfc_main$m, {
            key: download2.url,
            download: download2
          }, null, 8, ["download"]);
        }), 128))
      ])) : createCommentVNode("", true);
    };
  }
});
const _withScopeId$8 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-32e6c4d9"), n = n(), popScopeId(), n), "_withScopeId$8");
const _hoisted_1$i = { class: "model_preview" };
const _hoisted_2$b = { class: "model_preview_title" };
const _hoisted_3$7 = { class: "model_preview_top_container" };
const _hoisted_4$6 = { class: "model_preview_filename" };
const _hoisted_5$5 = {
  key: 0,
  class: "model_preview_architecture"
};
const _hoisted_6$4 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ createBaseVNode("span", { class: "model_preview_prefix" }, "Architecture: ", -1));
const _hoisted_7$3 = {
  key: 1,
  class: "model_preview_author"
};
const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ createBaseVNode("span", { class: "model_preview_prefix" }, "Author: ", -1));
const _hoisted_9$2 = {
  key: 0,
  class: "model_preview_image"
};
const _hoisted_10$2 = ["src"];
const _hoisted_11$2 = {
  key: 1,
  class: "model_preview_usage_hint"
};
const _hoisted_12$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ createBaseVNode("span", { class: "model_preview_prefix" }, "Usage hint: ", -1));
const _hoisted_13$1 = {
  key: 2,
  class: "model_preview_trigger_phrase"
};
const _hoisted_14 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ createBaseVNode("span", { class: "model_preview_prefix" }, "Trigger phrase: ", -1));
const _hoisted_15 = {
  key: 3,
  class: "model_preview_description"
};
const _hoisted_16 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ createBaseVNode("span", { class: "model_preview_prefix" }, "Description: ", -1));
const _sfc_main$k = /* @__PURE__ */ defineComponent({
  __name: "ModelPreview",
  props: {
    modelDef: {
      type: ComfyModelDef,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const modelDef = props.modelDef;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$i, [
        createBaseVNode("div", _hoisted_2$b, toDisplayString$1(unref(modelDef).title), 1),
        createBaseVNode("div", _hoisted_3$7, [
          createBaseVNode("div", _hoisted_4$6, toDisplayString$1(unref(modelDef).file_name), 1),
          unref(modelDef).architecture_id ? (openBlock(), createElementBlock("div", _hoisted_5$5, [
            _hoisted_6$4,
            createTextVNode(" " + toDisplayString$1(unref(modelDef).architecture_id), 1)
          ])) : createCommentVNode("", true),
          unref(modelDef).author ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
            _hoisted_8$2,
            createTextVNode(" " + toDisplayString$1(unref(modelDef).author), 1)
          ])) : createCommentVNode("", true)
        ]),
        unref(modelDef).image ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
          createBaseVNode("img", {
            src: unref(modelDef).image
          }, null, 8, _hoisted_10$2)
        ])) : createCommentVNode("", true),
        unref(modelDef).usage_hint ? (openBlock(), createElementBlock("div", _hoisted_11$2, [
          _hoisted_12$1,
          createTextVNode(" " + toDisplayString$1(unref(modelDef).usage_hint), 1)
        ])) : createCommentVNode("", true),
        unref(modelDef).trigger_phrase ? (openBlock(), createElementBlock("div", _hoisted_13$1, [
          _hoisted_14,
          createTextVNode(" " + toDisplayString$1(unref(modelDef).trigger_phrase), 1)
        ])) : createCommentVNode("", true),
        unref(modelDef).description ? (openBlock(), createElementBlock("div", _hoisted_15, [
          _hoisted_16,
          createTextVNode(" " + toDisplayString$1(unref(modelDef).description), 1)
        ])) : createCommentVNode("", true)
      ]);
    };
  }
});
const ModelPreview = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-32e6c4d9"]]);
const _withScopeId$7 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-b45ea43e"), n = n(), popScopeId(), n), "_withScopeId$7");
const _hoisted_1$h = {
  key: 0,
  class: "model-lib-model-icon-container"
};
const _sfc_main$j = /* @__PURE__ */ defineComponent({
  __name: "ModelTreeLeaf",
  props: {
    node: {}
  },
  setup(__props) {
    const props = __props;
    const modelDef = computed(() => props.node.data);
    const modelPreviewUrl = computed(() => {
      if (modelDef.value?.image) {
        return modelDef.value.image;
      }
      const folder = modelDef.value.directory;
      const path_index = modelDef.value.path_index;
      const extension = modelDef.value.file_name.split(".").pop();
      const filename = modelDef.value.file_name.replace(`.${extension}`, ".webp");
      const encodedFilename = encodeURIComponent(filename).replace(/%2F/g, "/");
      return `/api/experiment/models/preview/${folder}/${path_index}/${encodedFilename}`;
    });
    const previewRef = ref(null);
    const modelPreviewStyle = ref({
      position: "absolute",
      top: "0px",
      left: "0px"
    });
    const settingStore = useSettingStore();
    const sidebarLocation = computed(
      () => settingStore.get("Comfy.Sidebar.Location")
    );
    const handleModelHover = /* @__PURE__ */ __name(async () => {
      const hoverTarget = modelContentElement.value;
      const targetRect = hoverTarget.getBoundingClientRect();
      const previewHeight = previewRef.value?.$el.offsetHeight || 0;
      const availableSpaceBelow = window.innerHeight - targetRect.bottom;
      modelPreviewStyle.value.top = previewHeight > availableSpaceBelow ? `${Math.max(0, targetRect.top - (previewHeight - availableSpaceBelow) - 20)}px` : `${targetRect.top - 40}px`;
      if (sidebarLocation.value === "left") {
        modelPreviewStyle.value.left = `${targetRect.right}px`;
      } else {
        modelPreviewStyle.value.left = `${targetRect.left - 400}px`;
      }
      modelDef.value.load();
    }, "handleModelHover");
    const container = ref(null);
    const modelContentElement = ref(null);
    const isHovered = ref(false);
    const showPreview = computed(() => {
      return isHovered.value && modelDef.value && modelDef.value.has_loaded_metadata && (modelDef.value.author || modelDef.value.simplified_file_name != modelDef.value.title || modelDef.value.description || modelDef.value.usage_hint || modelDef.value.trigger_phrase || modelDef.value.image);
    });
    const handleMouseEnter = /* @__PURE__ */ __name(async () => {
      isHovered.value = true;
      await nextTick();
      handleModelHover();
    }, "handleMouseEnter");
    const handleMouseLeave2 = /* @__PURE__ */ __name(() => {
      isHovered.value = false;
    }, "handleMouseLeave");
    onMounted(() => {
      modelContentElement.value = container.value?.closest(".p-tree-node-content");
      modelContentElement.value?.addEventListener("mouseenter", handleMouseEnter);
      modelContentElement.value?.addEventListener("mouseleave", handleMouseLeave2);
      modelDef.value.load();
    });
    onUnmounted(() => {
      modelContentElement.value?.removeEventListener("mouseenter", handleMouseEnter);
      modelContentElement.value?.removeEventListener("mouseleave", handleMouseLeave2);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "container",
        ref: container,
        class: "model-lib-node-container h-full w-full"
      }, [
        createVNode(TreeExplorerTreeNode, { node: _ctx.node }, {
          "before-label": withCtx(() => [
            modelPreviewUrl.value ? (openBlock(), createElementBlock("span", _hoisted_1$h, [
              createBaseVNode("span", {
                class: "model-lib-model-icon",
                style: normalizeStyle({ backgroundImage: `url(${modelPreviewUrl.value})` })
              }, null, 4)
            ])) : createCommentVNode("", true)
          ]),
          _: 1
        }, 8, ["node"]),
        showPreview.value ? (openBlock(), createBlock(Teleport, {
          key: 0,
          to: "#model-library-model-preview-container"
        }, [
          createBaseVNode("div", {
            class: "model-lib-model-preview",
            style: normalizeStyle(modelPreviewStyle.value)
          }, [
            createVNode(ModelPreview, {
              ref_key: "previewRef",
              ref: previewRef,
              modelDef: modelDef.value
            }, null, 8, ["modelDef"])
          ], 4)
        ])) : createCommentVNode("", true)
      ], 512);
    };
  }
});
const ModelTreeLeaf = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-b45ea43e"]]);
function useTreeExpansion(expandedKeys2) {
  const toggleNode2 = /* @__PURE__ */ __name((node3) => {
    if (node3.key && typeof node3.key === "string") {
      if (node3.key in expandedKeys2.value) {
        delete expandedKeys2.value[node3.key];
      } else {
        expandedKeys2.value[node3.key] = true;
      }
    }
  }, "toggleNode");
  const toggleNodeRecursive = /* @__PURE__ */ __name((node3) => {
    if (node3.key && typeof node3.key === "string") {
      if (node3.key in expandedKeys2.value) {
        collapseNode(node3);
      } else {
        expandNode(node3);
      }
    }
  }, "toggleNodeRecursive");
  const expandNode = /* @__PURE__ */ __name((node3) => {
    if (node3.key && typeof node3.key === "string" && node3.children && node3.children.length) {
      expandedKeys2.value[node3.key] = true;
      for (const child of node3.children) {
        expandNode(child);
      }
    }
  }, "expandNode");
  const collapseNode = /* @__PURE__ */ __name((node3) => {
    if (node3.key && typeof node3.key === "string" && node3.children && node3.children.length) {
      delete expandedKeys2.value[node3.key];
      for (const child of node3.children) {
        collapseNode(child);
      }
    }
  }, "collapseNode");
  const toggleNodeOnEvent = /* @__PURE__ */ __name((e2, node3) => {
    if (e2.ctrlKey) {
      toggleNodeRecursive(node3);
    } else {
      toggleNode2(node3);
    }
  }, "toggleNodeOnEvent");
  return {
    toggleNode: toggleNode2,
    toggleNodeRecursive,
    expandNode,
    collapseNode,
    toggleNodeOnEvent
  };
}
__name(useTreeExpansion, "useTreeExpansion");
class ModelNodeProvider {
  static {
    __name(this, "ModelNodeProvider");
  }
  /** The node definition to use for this model. */
  nodeDef;
  /** The node input key for where to inside the model name. */
  key;
  constructor(nodeDef, key) {
    this.nodeDef = nodeDef;
    this.key = key;
  }
}
const useModelToNodeStore = /* @__PURE__ */ defineStore("modelToNode", () => {
  const modelToNodeMap = ref({});
  const nodeDefStore = useNodeDefStore();
  const haveDefaultsLoaded = ref(false);
  function getNodeProvider(modelType) {
    registerDefaults();
    return modelToNodeMap.value[modelType]?.[0];
  }
  __name(getNodeProvider, "getNodeProvider");
  function getAllNodeProviders(modelType) {
    registerDefaults();
    return modelToNodeMap.value[modelType] ?? [];
  }
  __name(getAllNodeProviders, "getAllNodeProviders");
  function registerNodeProvider(modelType, nodeProvider) {
    registerDefaults();
    if (!modelToNodeMap.value[modelType]) {
      modelToNodeMap.value[modelType] = [];
    }
    modelToNodeMap.value[modelType].push(nodeProvider);
  }
  __name(registerNodeProvider, "registerNodeProvider");
  function quickRegister(modelType, nodeClass, key) {
    registerNodeProvider(
      modelType,
      new ModelNodeProvider(nodeDefStore.nodeDefsByName[nodeClass], key)
    );
  }
  __name(quickRegister, "quickRegister");
  function registerDefaults() {
    if (haveDefaultsLoaded.value) {
      return;
    }
    if (Object.keys(nodeDefStore.nodeDefsByName).length === 0) {
      return;
    }
    haveDefaultsLoaded.value = true;
    quickRegister("checkpoints", "CheckpointLoaderSimple", "ckpt_name");
    quickRegister("checkpoints", "ImageOnlyCheckpointLoader", "ckpt_name");
    quickRegister("loras", "LoraLoader", "lora_name");
    quickRegister("loras", "LoraLoaderModelOnly", "lora_name");
    quickRegister("vae", "VAELoader", "vae_name");
    quickRegister("controlnet", "ControlNetLoader", "control_net_name");
  }
  __name(registerDefaults, "registerDefaults");
  return {
    modelToNodeMap,
    getNodeProvider,
    getAllNodeProviders,
    registerNodeProvider,
    quickRegister,
    registerDefaults
  };
});
const _withScopeId$6 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-0bb2ac55"), n = n(), popScopeId(), n), "_withScopeId$6");
const _hoisted_1$g = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ createBaseVNode("div", { id: "model-library-model-preview-container" }, null, -1));
const _sfc_main$i = /* @__PURE__ */ defineComponent({
  __name: "ModelLibrarySidebarTab",
  setup(__props) {
    const modelStore = useModelStore();
    const modelToNodeStore = useModelToNodeStore();
    const settingStore = useSettingStore();
    const searchQuery = ref("");
    const expandedKeys2 = ref({});
    const { expandNode, toggleNodeOnEvent } = useTreeExpansion(expandedKeys2);
    const filteredModels = ref([]);
    const handleSearch = /* @__PURE__ */ __name(async (query) => {
      if (!query) {
        filteredModels.value = [];
        expandedKeys2.value = {};
        return;
      }
      await modelStore.loadModels();
      const search2 = query.toLocaleLowerCase();
      filteredModels.value = modelStore.models.filter((model) => {
        return model.searchable.includes(search2);
      });
      nextTick(() => {
        expandNode(root24.value);
      });
    }, "handleSearch");
    const root24 = computed(() => {
      const allNodes = searchQuery.value ? filteredModels.value : [...modelStore.modelFolders, ...modelStore.models];
      return buildTree$1(
        allNodes,
        (modelOrFolder) => modelOrFolder.key.split("/")
      );
    });
    const renderedRoot = computed(() => {
      const nameFormat = settingStore.get("Comfy.ModelLibrary.NameFormat");
      const fillNodeInfo = /* @__PURE__ */ __name((node3) => {
        const children = node3.children?.map(fillNodeInfo);
        const model = node3.leaf && node3.data ? node3.data : null;
        const folder = !node3.leaf && node3.data ? node3.data : null;
        return {
          key: node3.key,
          label: model ? nameFormat === "title" ? model.title : model.simplified_file_name : node3.label,
          leaf: node3.leaf,
          data: node3.data,
          getIcon: /* @__PURE__ */ __name(() => {
            if (model) {
              return model.image ? "pi pi-image" : "pi pi-file";
            }
            if (folder) {
              return folder.state === ResourceState.Loading ? "pi pi-spin pi-spinner" : "pi pi-folder";
            }
            return "pi pi-folder";
          }, "getIcon"),
          getBadgeText: /* @__PURE__ */ __name(() => {
            if (!folder) {
              return null;
            }
            return folder.state === ResourceState.Loaded ? null : "";
          }, "getBadgeText"),
          children,
          draggable: node3.leaf,
          handleClick: /* @__PURE__ */ __name((node22, e2) => {
            if (node22.leaf) {
              const provider = modelToNodeStore.getNodeProvider(model.directory);
              if (provider) {
                const node32 = useLitegraphService().addNodeOnGraph(provider.nodeDef);
                const widget2 = node32.widgets.find(
                  (widget22) => widget22.name === provider.key
                );
                if (widget2) {
                  widget2.value = model.file_name;
                }
              }
            } else {
              toggleNodeOnEvent(e2, node22);
            }
          }, "handleClick")
        };
      }, "fillNodeInfo");
      return fillNodeInfo(root24.value);
    });
    watch(
      toRef$1(expandedKeys2, "value"),
      (newExpandedKeys) => {
        Object.entries(newExpandedKeys).forEach(([key, isExpanded]) => {
          if (isExpanded) {
            const folderPath = key.split("/").slice(1).join("/");
            if (folderPath && !folderPath.includes("/")) {
              modelStore.getLoadedModelFolder(folderPath);
            }
          }
        });
      },
      { deep: true }
    );
    onMounted(async () => {
      if (settingStore.get("Comfy.ModelLibrary.AutoLoadAll")) {
        await modelStore.loadModels();
      }
    });
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(SidebarTabTemplate, {
          title: _ctx.$t("sideToolbar.modelLibrary"),
          class: "bg-[var(--p-tree-background)]"
        }, {
          "tool-buttons": withCtx(() => [
            withDirectives(createVNode(unref(script$R), {
              icon: "pi pi-refresh",
              onClick: unref(modelStore).loadModelFolders,
              severity: "secondary",
              text: ""
            }, null, 8, ["onClick"]), [
              [
                _directive_tooltip,
                _ctx.$t("g.refresh"),
                void 0,
                { bottom: true }
              ]
            ]),
            withDirectives(createVNode(unref(script$R), {
              icon: "pi pi-cloud-download",
              onClick: unref(modelStore).loadModels,
              severity: "secondary",
              text: ""
            }, null, 8, ["onClick"]), [
              [
                _directive_tooltip,
                _ctx.$t("g.loadAllFolders"),
                void 0,
                { bottom: true }
              ]
            ])
          ]),
          header: withCtx(() => [
            createVNode(SearchBox, {
              class: "model-lib-search-box p-2 2xl:p-4",
              modelValue: searchQuery.value,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
              placeholder: _ctx.$t("g.searchModels") + "...",
              onSearch: handleSearch
            }, null, 8, ["modelValue", "placeholder"])
          ]),
          body: withCtx(() => [
            unref(isElectron)() ? (openBlock(), createBlock(_sfc_main$l, { key: 0 })) : createCommentVNode("", true),
            createVNode(TreeExplorer, {
              class: "model-lib-tree-explorer",
              roots: renderedRoot.value.children,
              expandedKeys: expandedKeys2.value,
              "onUpdate:expandedKeys": _cache[1] || (_cache[1] = ($event) => expandedKeys2.value = $event)
            }, {
              node: withCtx(({ node: node3 }) => [
                createVNode(ModelTreeLeaf, { node: node3 }, null, 8, ["node"])
              ]),
              _: 1
            }, 8, ["roots", "expandedKeys"])
          ]),
          _: 1
        }, 8, ["title"]),
        _hoisted_1$g
      ], 64);
    };
  }
});
const ModelLibrarySidebarTab = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-0bb2ac55"]]);
const useModelLibrarySidebarTab = /* @__PURE__ */ __name(() => {
  const { t: t2 } = useI18n();
  return {
    id: "model-library",
    icon: "pi pi-box",
    title: t2("sideToolbar.modelLibrary"),
    tooltip: t2("sideToolbar.modelLibrary"),
    component: markRaw(ModelLibrarySidebarTab),
    type: "vue",
    iconBadge: /* @__PURE__ */ __name(() => {
      if (isElectron()) {
        const electronDownloadStore = useElectronDownloadStore();
        if (electronDownloadStore.inProgressDownloads.length > 0) {
          return electronDownloadStore.inProgressDownloads.length.toString();
        }
      }
      return null;
    }, "iconBadge")
  };
}, "useModelLibrarySidebarTab");
var theme$5 = /* @__PURE__ */ __name(function theme34(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-popover {\n    margin-top: ".concat(dt2("popover.gutter"), ";\n    background: ").concat(dt2("popover.background"), ";\n    color: ").concat(dt2("popover.color"), ";\n    border: 1px solid ").concat(dt2("popover.border.color"), ";\n    border-radius: ").concat(dt2("popover.border.radius"), ";\n    box-shadow: ").concat(dt2("popover.shadow"), ";\n}\n\n.p-popover-content {\n    padding: ").concat(dt2("popover.content.padding"), ";\n}\n\n.p-popover-flipped {\n    margin-top: calc(").concat(dt2("popover.gutter"), " * -1);\n    margin-bottom: ").concat(dt2("popover.gutter"), ";\n}\n\n.p-popover-enter-from {\n    opacity: 0;\n    transform: scaleY(0.8);\n}\n\n.p-popover-leave-to {\n    opacity: 0;\n}\n\n.p-popover-enter-active {\n    transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.p-popover-leave-active {\n    transition: opacity 0.1s linear;\n}\n\n.p-popover:after,\n.p-popover:before {\n    bottom: 100%;\n    left: calc(").concat(dt2("popover.arrow.offset"), " + ").concat(dt2("popover.arrow.left"), ');\n    content: " ";\n    height: 0;\n    width: 0;\n    position: absolute;\n    pointer-events: none;\n}\n\n.p-popover:after {\n    border-width: calc(').concat(dt2("popover.gutter"), " - 2px);\n    margin-left: calc(-1 * (").concat(dt2("popover.gutter"), " - 2px));\n    border-style: solid;\n    border-color: transparent;\n    border-bottom-color: ").concat(dt2("popover.background"), ";\n}\n\n.p-popover:before {\n    border-width: ").concat(dt2("popover.gutter"), ";\n    margin-left: calc(-1 * ").concat(dt2("popover.gutter"), ");\n    border-style: solid;\n    border-color: transparent;\n    border-bottom-color: ").concat(dt2("popover.border.color"), ";\n}\n\n.p-popover-flipped:after,\n.p-popover-flipped:before {\n    bottom: auto;\n    top: 100%;\n}\n\n.p-popover.p-popover-flipped:after {\n    border-bottom-color: transparent;\n    border-top-color: ").concat(dt2("popover.background"), ";\n}\n\n.p-popover.p-popover-flipped:before {\n    border-bottom-color: transparent;\n    border-top-color: ").concat(dt2("popover.border.color"), ";\n}\n");
}, "theme");
var classes$5 = {
  root: "p-popover p-component",
  content: "p-popover-content"
};
var PopoverStyle = BaseStyle.extend({
  name: "popover",
  theme: theme$5,
  classes: classes$5
});
var script$1$5 = {
  name: "BasePopover",
  "extends": script$_,
  props: {
    dismissable: {
      type: Boolean,
      "default": true
    },
    appendTo: {
      type: [String, Object],
      "default": "body"
    },
    baseZIndex: {
      type: Number,
      "default": 0
    },
    autoZIndex: {
      type: Boolean,
      "default": true
    },
    breakpoints: {
      type: Object,
      "default": null
    },
    closeOnEscape: {
      type: Boolean,
      "default": true
    }
  },
  style: PopoverStyle,
  provide: /* @__PURE__ */ __name(function provide36() {
    return {
      $pcPopover: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$9 = {
  name: "Popover",
  "extends": script$1$5,
  inheritAttrs: false,
  emits: ["show", "hide"],
  data: /* @__PURE__ */ __name(function data18() {
    return {
      visible: false
    };
  }, "data"),
  watch: {
    dismissable: {
      immediate: true,
      handler: /* @__PURE__ */ __name(function handler5(newValue2) {
        if (newValue2) {
          this.bindOutsideClickListener();
        } else {
          this.unbindOutsideClickListener();
        }
      }, "handler")
    }
  },
  selfClick: false,
  target: null,
  eventTarget: null,
  outsideClickListener: null,
  scrollHandler: null,
  resizeListener: null,
  container: null,
  styleElement: null,
  overlayEventListener: null,
  documentKeydownListener: null,
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount9() {
    if (this.dismissable) {
      this.unbindOutsideClickListener();
    }
    if (this.scrollHandler) {
      this.scrollHandler.destroy();
      this.scrollHandler = null;
    }
    this.destroyStyle();
    this.unbindResizeListener();
    this.target = null;
    if (this.container && this.autoZIndex) {
      ZIndex.clear(this.container);
    }
    if (this.overlayEventListener) {
      OverlayEventBus.off("overlay-click", this.overlayEventListener);
      this.overlayEventListener = null;
    }
    this.container = null;
  }, "beforeUnmount"),
  mounted: /* @__PURE__ */ __name(function mounted17() {
    if (this.breakpoints) {
      this.createStyle();
    }
  }, "mounted"),
  methods: {
    toggle: /* @__PURE__ */ __name(function toggle3(event, target) {
      if (this.visible) this.hide();
      else this.show(event, target);
    }, "toggle"),
    show: /* @__PURE__ */ __name(function show4(event, target) {
      this.visible = true;
      this.eventTarget = event.currentTarget;
      this.target = target || event.currentTarget;
    }, "show"),
    hide: /* @__PURE__ */ __name(function hide4() {
      this.visible = false;
    }, "hide"),
    onContentClick: /* @__PURE__ */ __name(function onContentClick() {
      this.selfClick = true;
    }, "onContentClick"),
    onEnter: /* @__PURE__ */ __name(function onEnter4(el) {
      var _this = this;
      this.container.setAttribute(this.attributeSelector, "");
      addStyle(el, {
        position: "absolute",
        top: "0",
        left: "0"
      });
      this.alignOverlay();
      if (this.dismissable) {
        this.bindOutsideClickListener();
      }
      this.bindScrollListener();
      this.bindResizeListener();
      if (this.autoZIndex) {
        ZIndex.set("overlay", el, this.baseZIndex + this.$primevue.config.zIndex.overlay);
      }
      this.overlayEventListener = function(e2) {
        if (_this.container.contains(e2.target)) {
          _this.selfClick = true;
        }
      };
      this.focus();
      OverlayEventBus.on("overlay-click", this.overlayEventListener);
      this.$emit("show");
      if (this.closeOnEscape) {
        this.bindDocumentKeyDownListener();
      }
    }, "onEnter"),
    onLeave: /* @__PURE__ */ __name(function onLeave3() {
      this.unbindOutsideClickListener();
      this.unbindScrollListener();
      this.unbindResizeListener();
      this.unbindDocumentKeyDownListener();
      OverlayEventBus.off("overlay-click", this.overlayEventListener);
      this.overlayEventListener = null;
      this.$emit("hide");
    }, "onLeave"),
    onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave3(el) {
      if (this.autoZIndex) {
        ZIndex.clear(el);
      }
    }, "onAfterLeave"),
    alignOverlay: /* @__PURE__ */ __name(function alignOverlay4() {
      absolutePosition(this.container, this.target, false);
      var containerOffset = getOffset(this.container);
      var targetOffset = getOffset(this.target);
      var arrowLeft = 0;
      if (containerOffset.left < targetOffset.left) {
        arrowLeft = targetOffset.left - containerOffset.left;
      }
      this.container.style.setProperty($dt("popover.arrow.left").name, "".concat(arrowLeft, "px"));
      if (containerOffset.top < targetOffset.top) {
        this.container.setAttribute("data-p-popover-flipped", "true");
        !this.isUnstyled && addClass(this.container, "p-popover-flipped");
      }
    }, "alignOverlay"),
    onContentKeydown: /* @__PURE__ */ __name(function onContentKeydown(event) {
      if (event.code === "Escape" && this.closeOnEscape) {
        this.hide();
        focus$1(this.target);
      }
    }, "onContentKeydown"),
    onButtonKeydown: /* @__PURE__ */ __name(function onButtonKeydown(event) {
      switch (event.code) {
        case "ArrowDown":
        case "ArrowUp":
        case "ArrowLeft":
        case "ArrowRight":
          event.preventDefault();
      }
    }, "onButtonKeydown"),
    focus: /* @__PURE__ */ __name(function focus2() {
      var focusTarget = this.container.querySelector("[autofocus]");
      if (focusTarget) {
        focusTarget.focus();
      }
    }, "focus"),
    onKeyDown: /* @__PURE__ */ __name(function onKeyDown8(event) {
      if (event.code === "Escape" && this.closeOnEscape) {
        this.visible = false;
      }
    }, "onKeyDown"),
    bindDocumentKeyDownListener: /* @__PURE__ */ __name(function bindDocumentKeyDownListener2() {
      if (!this.documentKeydownListener) {
        this.documentKeydownListener = this.onKeyDown.bind(this);
        window.document.addEventListener("keydown", this.documentKeydownListener);
      }
    }, "bindDocumentKeyDownListener"),
    unbindDocumentKeyDownListener: /* @__PURE__ */ __name(function unbindDocumentKeyDownListener2() {
      if (this.documentKeydownListener) {
        window.document.removeEventListener("keydown", this.documentKeydownListener);
        this.documentKeydownListener = null;
      }
    }, "unbindDocumentKeyDownListener"),
    bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener4() {
      var _this2 = this;
      if (!this.outsideClickListener && isClient$1()) {
        this.outsideClickListener = function(event) {
          if (_this2.visible && !_this2.selfClick && !_this2.isTargetClicked(event)) {
            _this2.visible = false;
          }
          _this2.selfClick = false;
        };
        document.addEventListener("click", this.outsideClickListener);
      }
    }, "bindOutsideClickListener"),
    unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener4() {
      if (this.outsideClickListener) {
        document.removeEventListener("click", this.outsideClickListener);
        this.outsideClickListener = null;
        this.selfClick = false;
      }
    }, "unbindOutsideClickListener"),
    bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener4() {
      var _this3 = this;
      if (!this.scrollHandler) {
        this.scrollHandler = new ConnectedOverlayScrollHandler(this.target, function() {
          if (_this3.visible) {
            _this3.visible = false;
          }
        });
      }
      this.scrollHandler.bindScrollListener();
    }, "bindScrollListener"),
    unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener4() {
      if (this.scrollHandler) {
        this.scrollHandler.unbindScrollListener();
      }
    }, "unbindScrollListener"),
    bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener5() {
      var _this4 = this;
      if (!this.resizeListener) {
        this.resizeListener = function() {
          if (_this4.visible && !isTouchDevice()) {
            _this4.visible = false;
          }
        };
        window.addEventListener("resize", this.resizeListener);
      }
    }, "bindResizeListener"),
    unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener5() {
      if (this.resizeListener) {
        window.removeEventListener("resize", this.resizeListener);
        this.resizeListener = null;
      }
    }, "unbindResizeListener"),
    isTargetClicked: /* @__PURE__ */ __name(function isTargetClicked(event) {
      return this.eventTarget && (this.eventTarget === event.target || this.eventTarget.contains(event.target));
    }, "isTargetClicked"),
    containerRef: /* @__PURE__ */ __name(function containerRef3(el) {
      this.container = el;
    }, "containerRef"),
    createStyle: /* @__PURE__ */ __name(function createStyle3() {
      if (!this.styleElement && !this.isUnstyled) {
        var _this$$primevue;
        this.styleElement = document.createElement("style");
        this.styleElement.type = "text/css";
        setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
        document.head.appendChild(this.styleElement);
        var innerHTML = "";
        for (var breakpoint in this.breakpoints) {
          innerHTML += "\n                        @media screen and (max-width: ".concat(breakpoint, ") {\n                            .p-popover[").concat(this.attributeSelector, "] {\n                                width: ").concat(this.breakpoints[breakpoint], " !important;\n                            }\n                        }\n                    ");
        }
        this.styleElement.innerHTML = innerHTML;
      }
    }, "createStyle"),
    destroyStyle: /* @__PURE__ */ __name(function destroyStyle2() {
      if (this.styleElement) {
        document.head.removeChild(this.styleElement);
        this.styleElement = null;
      }
    }, "destroyStyle"),
    onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick3(event) {
      OverlayEventBus.emit("overlay-click", {
        originalEvent: event,
        target: this.target
      });
    }, "onOverlayClick")
  },
  computed: {
    attributeSelector: /* @__PURE__ */ __name(function attributeSelector3() {
      return UniqueComponentId();
    }, "attributeSelector")
  },
  directives: {
    focustrap: FocusTrap,
    ripple: Ripple
  },
  components: {
    Portal: script$Q
  }
};
var _hoisted_1$f = ["aria-modal"];
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_Portal = resolveComponent("Portal");
  var _directive_focustrap = resolveDirective("focustrap");
  return openBlock(), createBlock(_component_Portal, {
    appendTo: _ctx.appendTo
  }, {
    "default": withCtx(function() {
      return [createVNode(Transition, mergeProps({
        name: "p-popover",
        onEnter: $options.onEnter,
        onLeave: $options.onLeave,
        onAfterLeave: $options.onAfterLeave
      }, _ctx.ptm("transition")), {
        "default": withCtx(function() {
          return [$data.visible ? withDirectives((openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            ref: $options.containerRef,
            role: "dialog",
            "aria-modal": $data.visible,
            onClick: _cache[3] || (_cache[3] = function() {
              return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
            }),
            "class": _ctx.cx("root")
          }, _ctx.ptmi("root")), [_ctx.$slots.container ? renderSlot(_ctx.$slots, "container", {
            key: 0,
            closeCallback: $options.hide,
            keydownCallback: /* @__PURE__ */ __name(function keydownCallback(event) {
              return $options.onButtonKeydown(event);
            }, "keydownCallback")
          }) : (openBlock(), createElementBlock("div", mergeProps({
            key: 1,
            "class": _ctx.cx("content"),
            onClick: _cache[0] || (_cache[0] = function() {
              return $options.onContentClick && $options.onContentClick.apply($options, arguments);
            }),
            onMousedown: _cache[1] || (_cache[1] = function() {
              return $options.onContentClick && $options.onContentClick.apply($options, arguments);
            }),
            onKeydown: _cache[2] || (_cache[2] = function() {
              return $options.onContentKeydown && $options.onContentKeydown.apply($options, arguments);
            })
          }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "default")], 16))], 16, _hoisted_1$f)), [[_directive_focustrap]]) : createCommentVNode("", true)];
        }),
        _: 3
      }, 16, ["onEnter", "onLeave", "onAfterLeave"])];
    }),
    _: 3
  }, 8, ["appendTo"]);
}
__name(render$8, "render$8");
script$9.render = render$8;
var theme$4 = /* @__PURE__ */ __name(function theme35(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-togglebutton {\n    display: inline-flex;\n    cursor: pointer;\n    user-select: none;\n    align-items: center;\n    justify-content: center;\n    overflow: hidden;\n    position: relative;\n    color: ".concat(dt2("togglebutton.color"), ";\n    background: ").concat(dt2("togglebutton.background"), ";\n    border: 1px solid ").concat(dt2("togglebutton.border.color"), ";\n    padding: ").concat(dt2("togglebutton.padding"), ";\n    font-size: 1rem;\n    font-family: inherit;\n    font-feature-settings: inherit;\n    transition: background ").concat(dt2("togglebutton.transition.duration"), ", color ").concat(dt2("togglebutton.transition.duration"), ", border-color ").concat(dt2("togglebutton.transition.duration"), ",\n        outline-color ").concat(dt2("togglebutton.transition.duration"), ", box-shadow ").concat(dt2("togglebutton.transition.duration"), ";\n    border-radius: ").concat(dt2("togglebutton.border.radius"), ";\n    outline-color: transparent;\n    font-weight: ").concat(dt2("togglebutton.font.weight"), ";\n}\n\n.p-togglebutton-content {\n    position: relative;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    gap: ").concat(dt2("togglebutton.gap"), ';\n}\n\n.p-togglebutton-label,\n.p-togglebutton-icon {\n    position: relative;\n    transition: none;\n}\n\n.p-togglebutton::before {\n    content: "";\n    background: transparent;\n    transition: background ').concat(dt2("togglebutton.transition.duration"), ", color ").concat(dt2("togglebutton.transition.duration"), ", border-color ").concat(dt2("togglebutton.transition.duration"), ",\n            outline-color ").concat(dt2("togglebutton.transition.duration"), ", box-shadow ").concat(dt2("togglebutton.transition.duration"), ";\n    position: absolute;\n    left: ").concat(dt2("togglebutton.content.left"), ";\n    top: ").concat(dt2("togglebutton.content.top"), ";\n    width: calc(100% - calc(2 *  ").concat(dt2("togglebutton.content.left"), "));\n    height: calc(100% - calc(2 *  ").concat(dt2("togglebutton.content.top"), "));\n    border-radius: ").concat(dt2("togglebutton.border.radius"), ";\n}\n\n.p-togglebutton.p-togglebutton-checked::before {\n    background: ").concat(dt2("togglebutton.content.checked.background"), ";\n    box-shadow: ").concat(dt2("togglebutton.content.checked.shadow"), ";\n}\n\n.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover {\n    background: ").concat(dt2("togglebutton.hover.background"), ";\n    color: ").concat(dt2("togglebutton.hover.color"), ";\n}\n\n.p-togglebutton.p-togglebutton-checked {\n    background: ").concat(dt2("togglebutton.checked.background"), ";\n    border-color: ").concat(dt2("togglebutton.checked.border.color"), ";\n    color: ").concat(dt2("togglebutton.checked.color"), ";\n}\n\n.p-togglebutton:focus-visible {\n    box-shadow: ").concat(dt2("togglebutton.focus.ring.shadow"), ";\n    outline: ").concat(dt2("togglebutton.focus.ring.width"), " ").concat(dt2("togglebutton.focus.ring.style"), " ").concat(dt2("togglebutton.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("togglebutton.focus.ring.offset"), ";\n}\n\n.p-togglebutton.p-invalid {\n    border-color: ").concat(dt2("togglebutton.invalid.border.color"), ";\n}\n\n.p-togglebutton:disabled {\n    opacity: 1;\n    cursor: default;\n    background: ").concat(dt2("togglebutton.disabled.background"), ";\n    border-color: ").concat(dt2("togglebutton.disabled.border.color"), ";\n    color: ").concat(dt2("togglebutton.disabled.color"), ";\n}\n\n.p-togglebutton-icon {\n    color: ").concat(dt2("togglebutton.icon.color"), ";\n}\n\n.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover .p-togglebutton-icon {\n    color: ").concat(dt2("togglebutton.icon.hover.color"), ";\n}\n\n.p-togglebutton.p-togglebutton-checked .p-togglebutton-icon {\n    color: ").concat(dt2("togglebutton.icon.checked.color"), ";\n}\n\n.p-togglebutton:disabled .p-togglebutton-icon {\n    color: ").concat(dt2("togglebutton.icon.disabled.color"), ";\n}\n");
}, "theme");
var classes$4 = {
  root: /* @__PURE__ */ __name(function root21(_ref2) {
    var instance = _ref2.instance, props = _ref2.props;
    return ["p-togglebutton p-component", {
      "p-togglebutton-checked": instance.active,
      "p-invalid": props.invalid
    }];
  }, "root"),
  content: "p-togglebutton-content",
  icon: "p-togglebutton-icon",
  label: "p-togglebutton-label"
};
var ToggleButtonStyle = BaseStyle.extend({
  name: "togglebutton",
  theme: theme$4,
  classes: classes$4
});
var script$1$4 = {
  name: "BaseToggleButton",
  "extends": script$_,
  props: {
    modelValue: Boolean,
    onIcon: String,
    offIcon: String,
    onLabel: {
      type: String,
      "default": "Yes"
    },
    offLabel: {
      type: String,
      "default": "No"
    },
    iconPos: {
      type: String,
      "default": "left"
    },
    invalid: {
      type: Boolean,
      "default": false
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    readonly: {
      type: Boolean,
      "default": false
    },
    tabindex: {
      type: Number,
      "default": null
    },
    ariaLabelledby: {
      type: String,
      "default": null
    },
    ariaLabel: {
      type: String,
      "default": null
    }
  },
  style: ToggleButtonStyle,
  provide: /* @__PURE__ */ __name(function provide37() {
    return {
      $pcToggleButton: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$8 = {
  name: "ToggleButton",
  "extends": script$1$4,
  inheritAttrs: false,
  emits: ["update:modelValue", "change"],
  methods: {
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions8(key) {
      var _ptm = key === "root" ? this.ptmi : this.ptm;
      return _ptm(key, {
        context: {
          active: this.active,
          disabled: this.disabled
        }
      });
    }, "getPTOptions"),
    onChange: /* @__PURE__ */ __name(function onChange4(event) {
      if (!this.disabled && !this.readonly) {
        this.$emit("update:modelValue", !this.modelValue);
        this.$emit("change", event);
      }
    }, "onChange")
  },
  computed: {
    active: /* @__PURE__ */ __name(function active2() {
      return this.modelValue === true;
    }, "active"),
    hasLabel: /* @__PURE__ */ __name(function hasLabel() {
      return isNotEmpty(this.onLabel) && isNotEmpty(this.offLabel);
    }, "hasLabel"),
    label: /* @__PURE__ */ __name(function label4() {
      return this.hasLabel ? this.modelValue ? this.onLabel : this.offLabel : "&nbsp;";
    }, "label")
  },
  directives: {
    ripple: Ripple
  }
};
var _hoisted_1$e = ["tabindex", "disabled", "aria-pressed", "data-p-checked", "data-p-disabled"];
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
  var _directive_ripple = resolveDirective("ripple");
  return withDirectives((openBlock(), createElementBlock("button", mergeProps({
    type: "button",
    "class": _ctx.cx("root"),
    tabindex: _ctx.tabindex,
    disabled: _ctx.disabled,
    "aria-pressed": _ctx.modelValue,
    onClick: _cache[0] || (_cache[0] = function() {
      return $options.onChange && $options.onChange.apply($options, arguments);
    })
  }, $options.getPTOptions("root"), {
    "data-p-checked": $options.active,
    "data-p-disabled": _ctx.disabled
  }), [createBaseVNode("span", mergeProps({
    "class": _ctx.cx("content")
  }, $options.getPTOptions("content")), [renderSlot(_ctx.$slots, "default", {}, function() {
    return [renderSlot(_ctx.$slots, "icon", {
      value: _ctx.modelValue,
      "class": normalizeClass(_ctx.cx("icon"))
    }, function() {
      return [_ctx.onIcon || _ctx.offIcon ? (openBlock(), createElementBlock("span", mergeProps({
        key: 0,
        "class": [_ctx.cx("icon"), _ctx.modelValue ? _ctx.onIcon : _ctx.offIcon]
      }, $options.getPTOptions("icon")), null, 16)) : createCommentVNode("", true)];
    }), createBaseVNode("span", mergeProps({
      "class": _ctx.cx("label")
    }, $options.getPTOptions("label")), toDisplayString$1($options.label), 17)];
  })], 16)], 16, _hoisted_1$e)), [[_directive_ripple]]);
}
__name(render$7, "render$7");
script$8.render = render$7;
var theme$3 = /* @__PURE__ */ __name(function theme36(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-selectbutton {\n    display: inline-flex;\n    user-select: none;\n    vertical-align: bottom;\n    outline-color: transparent;\n    border-radius: ".concat(dt2("selectbutton.border.radius"), ";\n}\n\n.p-selectbutton .p-togglebutton {\n    border-radius: 0;\n    border-width: 1px 1px 1px 0;\n}\n\n.p-selectbutton .p-togglebutton:focus-visible {\n    position: relative;\n    z-index: 1;\n}\n\n.p-selectbutton .p-togglebutton:first-child {\n    border-left-width: 1px;\n    border-top-left-radius: ").concat(dt2("selectbutton.border.radius"), ";\n    border-bottom-left-radius: ").concat(dt2("selectbutton.border.radius"), ";\n}\n\n.p-selectbutton .p-togglebutton:last-child {\n    border-top-right-radius: ").concat(dt2("selectbutton.border.radius"), ";\n    border-bottom-right-radius: ").concat(dt2("selectbutton.border.radius"), ";\n}\n\n.p-selectbutton.p-invalid {\n    outline: 1px solid ").concat(dt2("selectbutton.invalid.border.color"), ";\n    outline-offset: 0;\n}\n");
}, "theme");
var classes$3 = {
  root: /* @__PURE__ */ __name(function root22(_ref2) {
    var props = _ref2.props;
    return ["p-selectbutton p-component", {
      "p-invalid": props.invalid
    }];
  }, "root")
};
var SelectButtonStyle = BaseStyle.extend({
  name: "selectbutton",
  theme: theme$3,
  classes: classes$3
});
var script$1$3 = {
  name: "BaseSelectButton",
  "extends": script$_,
  props: {
    modelValue: null,
    options: Array,
    optionLabel: null,
    optionValue: null,
    optionDisabled: null,
    multiple: Boolean,
    allowEmpty: {
      type: Boolean,
      "default": true
    },
    invalid: {
      type: Boolean,
      "default": false
    },
    disabled: Boolean,
    dataKey: null,
    ariaLabelledby: {
      type: String,
      "default": null
    }
  },
  style: SelectButtonStyle,
  provide: /* @__PURE__ */ __name(function provide38() {
    return {
      $pcSelectButton: this,
      $parentInstance: this
    };
  }, "provide")
};
function _createForOfIteratorHelper(r, e2) {
  var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (!t2) {
    if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$2(r)) || e2) {
      t2 && (r = t2);
      var _n = 0, F = /* @__PURE__ */ __name(function F2() {
      }, "F");
      return { s: F, n: /* @__PURE__ */ __name(function n() {
        return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
      }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
        throw r2;
      }, "e"), f: F };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var o, a = true, u = false;
  return { s: /* @__PURE__ */ __name(function s() {
    t2 = t2.call(r);
  }, "s"), n: /* @__PURE__ */ __name(function n() {
    var r2 = t2.next();
    return a = r2.done, r2;
  }, "n"), e: /* @__PURE__ */ __name(function e3(r2) {
    u = true, o = r2;
  }, "e"), f: /* @__PURE__ */ __name(function f() {
    try {
      a || null == t2["return"] || t2["return"]();
    } finally {
      if (u) throw o;
    }
  }, "f") };
}
__name(_createForOfIteratorHelper, "_createForOfIteratorHelper");
function _toConsumableArray$2(r) {
  return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread$2();
}
__name(_toConsumableArray$2, "_toConsumableArray$2");
function _nonIterableSpread$2() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$2, "_nonIterableSpread$2");
function _unsupportedIterableToArray$2(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$2(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$2(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray$2");
function _iterableToArray$2(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$2, "_iterableToArray$2");
function _arrayWithoutHoles$2(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$2(r);
}
__name(_arrayWithoutHoles$2, "_arrayWithoutHoles$2");
function _arrayLikeToArray$2(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$2, "_arrayLikeToArray$2");
var script$7 = {
  name: "SelectButton",
  "extends": script$1$3,
  inheritAttrs: false,
  emits: ["update:modelValue", "change"],
  methods: {
    getOptionLabel: /* @__PURE__ */ __name(function getOptionLabel3(option3) {
      return this.optionLabel ? resolveFieldData(option3, this.optionLabel) : option3;
    }, "getOptionLabel"),
    getOptionValue: /* @__PURE__ */ __name(function getOptionValue3(option3) {
      return this.optionValue ? resolveFieldData(option3, this.optionValue) : option3;
    }, "getOptionValue"),
    getOptionRenderKey: /* @__PURE__ */ __name(function getOptionRenderKey3(option3) {
      return this.dataKey ? resolveFieldData(option3, this.dataKey) : this.getOptionLabel(option3);
    }, "getOptionRenderKey"),
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions9(option3, key) {
      return this.ptm(key, {
        context: {
          active: this.isSelected(option3),
          disabled: this.isOptionDisabled(option3),
          option: option3
        }
      });
    }, "getPTOptions"),
    isOptionDisabled: /* @__PURE__ */ __name(function isOptionDisabled3(option3) {
      return this.optionDisabled ? resolveFieldData(option3, this.optionDisabled) : false;
    }, "isOptionDisabled"),
    onOptionSelect: /* @__PURE__ */ __name(function onOptionSelect3(event, option3, index2) {
      var _this = this;
      if (this.disabled || this.isOptionDisabled(option3)) {
        return;
      }
      var selected2 = this.isSelected(option3);
      if (selected2 && !this.allowEmpty) {
        return;
      }
      var optionValue = this.getOptionValue(option3);
      var newValue2;
      if (this.multiple) {
        if (selected2) newValue2 = this.modelValue.filter(function(val) {
          return !equals(val, optionValue, _this.equalityKey);
        });
        else newValue2 = this.modelValue ? [].concat(_toConsumableArray$2(this.modelValue), [optionValue]) : [optionValue];
      } else {
        newValue2 = selected2 ? null : optionValue;
      }
      this.focusedIndex = index2;
      this.$emit("update:modelValue", newValue2);
      this.$emit("change", {
        event,
        value: newValue2
      });
    }, "onOptionSelect"),
    isSelected: /* @__PURE__ */ __name(function isSelected4(option3) {
      var selected2 = false;
      var optionValue = this.getOptionValue(option3);
      if (this.multiple) {
        if (this.modelValue) {
          var _iterator = _createForOfIteratorHelper(this.modelValue), _step;
          try {
            for (_iterator.s(); !(_step = _iterator.n()).done; ) {
              var val = _step.value;
              if (equals(val, optionValue, this.equalityKey)) {
                selected2 = true;
                break;
              }
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }
        }
      } else {
        selected2 = equals(this.modelValue, optionValue, this.equalityKey);
      }
      return selected2;
    }, "isSelected")
  },
  computed: {
    equalityKey: /* @__PURE__ */ __name(function equalityKey3() {
      return this.optionValue ? null : this.dataKey;
    }, "equalityKey")
  },
  directives: {
    ripple: Ripple
  },
  components: {
    ToggleButton: script$8
  }
};
var _hoisted_1$d = ["aria-labelledby"];
function render$6(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_ToggleButton = resolveComponent("ToggleButton");
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("root"),
    role: "group",
    "aria-labelledby": _ctx.ariaLabelledby
  }, _ctx.ptmi("root")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.options, function(option3, index2) {
    return openBlock(), createBlock(_component_ToggleButton, {
      key: $options.getOptionRenderKey(option3),
      modelValue: $options.isSelected(option3),
      onLabel: $options.getOptionLabel(option3),
      offLabel: $options.getOptionLabel(option3),
      disabled: _ctx.disabled || $options.isOptionDisabled(option3),
      unstyled: _ctx.unstyled,
      onChange: /* @__PURE__ */ __name(function onChange5($event) {
        return $options.onOptionSelect($event, option3, index2);
      }, "onChange"),
      pt: _ctx.ptm("pcButton")
    }, createSlots({
      _: 2
    }, [_ctx.$slots.option ? {
      name: "default",
      fn: withCtx(function() {
        return [renderSlot(_ctx.$slots, "option", {
          option: option3,
          index: index2
        }, function() {
          return [createBaseVNode("span", mergeProps({
            ref_for: true
          }, _ctx.ptm("pcButton")["label"]), toDisplayString$1($options.getOptionLabel(option3)), 17)];
        })];
      }),
      key: "0"
    } : void 0]), 1032, ["modelValue", "onLabel", "offLabel", "disabled", "unstyled", "onChange", "pt"]);
  }), 128))], 16, _hoisted_1$d);
}
__name(render$6, "render$6");
script$7.render = render$6;
const _withScopeId$5 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-c4279e6b"), n = n(), popScopeId(), n), "_withScopeId$5");
const _hoisted_1$c = { class: "_content" };
const _hoisted_2$a = { class: "_footer" };
const _sfc_main$h = /* @__PURE__ */ defineComponent({
  __name: "NodeSearchFilter",
  emits: ["addFilter"],
  setup(__props, { emit: __emit }) {
    const filters = computed(() => nodeDefStore.nodeSearchService.nodeFilters);
    const selectedFilter = ref();
    const filterValues = computed(() => selectedFilter.value?.fuseSearch.data ?? []);
    const selectedFilterValue = ref("");
    const nodeDefStore = useNodeDefStore();
    onMounted(() => {
      selectedFilter.value = nodeDefStore.nodeSearchService.nodeFilters[0];
      updateSelectedFilterValue();
    });
    const emit2 = __emit;
    const updateSelectedFilterValue = /* @__PURE__ */ __name(() => {
      if (filterValues.value.includes(selectedFilterValue.value)) {
        return;
      }
      selectedFilterValue.value = filterValues.value[0];
    }, "updateSelectedFilterValue");
    const submit = /* @__PURE__ */ __name(() => {
      emit2("addFilter", [
        selectedFilter.value,
        selectedFilterValue.value
      ]);
    }, "submit");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment$1, null, [
        createBaseVNode("div", _hoisted_1$c, [
          createVNode(unref(script$7), {
            class: "filter-type-select",
            modelValue: selectedFilter.value,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedFilter.value = $event),
            options: filters.value,
            allowEmpty: false,
            optionLabel: "name",
            onChange: updateSelectedFilterValue
          }, null, 8, ["modelValue", "options"]),
          createVNode(unref(script$o), {
            class: "filter-value-select",
            modelValue: selectedFilterValue.value,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedFilterValue.value = $event),
            options: filterValues.value,
            filter: "",
            autoFilterFocus: ""
          }, null, 8, ["modelValue", "options"])
        ]),
        createBaseVNode("div", _hoisted_2$a, [
          createVNode(unref(script$R), {
            type: "button",
            label: _ctx.$t("g.add"),
            onClick: submit
          }, null, 8, ["label"])
        ])
      ], 64);
    };
  }
});
const NodeSearchFilter = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-c4279e6b"]]);
const _withScopeId$4 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-d9792337"), n = n(), popScopeId(), n), "_withScopeId$4");
const _hoisted_1$b = { class: "_sb_node_preview" };
const _hoisted_2$9 = { class: "_sb_table" };
const _hoisted_3$6 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createBaseVNode("div", { class: "_sb_dot headdot" }, null, -1));
const _hoisted_4$5 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createBaseVNode("div", { class: "_sb_preview_badge" }, "PREVIEW", -1));
const _hoisted_5$4 = { class: "_sb_col" };
const _hoisted_6$3 = { class: "_sb_col" };
const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createBaseVNode("div", { class: "_sb_col middle-column" }, null, -1));
const _hoisted_8$1 = { class: "_sb_col" };
const _hoisted_9$1 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createBaseVNode("div", { class: "_sb_col _sb_arrow" }, "◀", -1));
const _hoisted_10$1 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createBaseVNode("div", { class: "_sb_col middle-column" }, null, -1));
const _hoisted_11$1 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createBaseVNode("div", { class: "_sb_col _sb_arrow" }, "▶", -1));
const _sfc_main$g = /* @__PURE__ */ defineComponent({
  __name: "NodePreview",
  props: {
    nodeDef: {
      type: ComfyNodeDefImpl,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const colorPaletteStore = useColorPaletteStore();
    const litegraphColors = computed(
      () => colorPaletteStore.completedActivePalette.colors.litegraph_base
    );
    const widgetStore = useWidgetStore();
    const nodeDef = props.nodeDef;
    const allInputDefs = nodeDef.inputs.all;
    const allOutputDefs = nodeDef.outputs.all;
    const slotInputDefs = allInputDefs.filter(
      (input) => !widgetStore.inputIsWidget(input)
    );
    const widgetInputDefs = allInputDefs.filter(
      (input) => widgetStore.inputIsWidget(input)
    );
    const truncateDefaultValue = /* @__PURE__ */ __name((value4, charLimit = 32) => {
      let stringValue;
      if (typeof value4 === "object" && value4 !== null) {
        stringValue = JSON.stringify(value4);
      } else if (Array.isArray(value4)) {
        stringValue = JSON.stringify(value4);
      } else if (typeof value4 === "string") {
        stringValue = value4;
      } else {
        stringValue = String(value4);
      }
      return _.truncate(stringValue, { length: charLimit });
    }, "truncateDefaultValue");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$b, [
        createBaseVNode("div", _hoisted_2$9, [
          createBaseVNode("div", {
            class: "node_header",
            style: normalizeStyle({
              backgroundColor: litegraphColors.value.NODE_DEFAULT_COLOR,
              color: litegraphColors.value.NODE_TITLE_COLOR
            })
          }, [
            _hoisted_3$6,
            createTextVNode(" " + toDisplayString$1(unref(nodeDef).display_name), 1)
          ], 4),
          _hoisted_4$5,
          (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(_).zip(unref(slotInputDefs), unref(allOutputDefs)), ([slotInput, slotOutput]) => {
            return openBlock(), createElementBlock("div", {
              class: "_sb_row slot_row",
              key: (slotInput?.name || "") + (slotOutput?.index.toString() || "")
            }, [
              createBaseVNode("div", _hoisted_5$4, [
                slotInput ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  class: normalizeClass(["_sb_dot", slotInput.type])
                }, null, 2)) : createCommentVNode("", true)
              ]),
              createBaseVNode("div", _hoisted_6$3, toDisplayString$1(slotInput ? slotInput.name : ""), 1),
              _hoisted_7$2,
              createBaseVNode("div", {
                class: "_sb_col _sb_inherit",
                style: normalizeStyle({
                  color: litegraphColors.value.NODE_TEXT_COLOR
                })
              }, toDisplayString$1(slotOutput ? slotOutput.name : ""), 5),
              createBaseVNode("div", _hoisted_8$1, [
                slotOutput ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  class: normalizeClass(["_sb_dot", slotOutput.type])
                }, null, 2)) : createCommentVNode("", true)
              ])
            ]);
          }), 128)),
          (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(widgetInputDefs), (widgetInput) => {
            return openBlock(), createElementBlock("div", {
              class: "_sb_row _long_field",
              key: widgetInput.name
            }, [
              _hoisted_9$1,
              createBaseVNode("div", {
                class: "_sb_col",
                style: normalizeStyle({
                  color: litegraphColors.value.WIDGET_SECONDARY_TEXT_COLOR
                })
              }, toDisplayString$1(widgetInput.name), 5),
              _hoisted_10$1,
              createBaseVNode("div", {
                class: "_sb_col _sb_inherit",
                style: normalizeStyle({ color: litegraphColors.value.WIDGET_TEXT_COLOR })
              }, toDisplayString$1(truncateDefaultValue(widgetInput.default)), 5),
              _hoisted_11$1
            ]);
          }), 128))
        ]),
        unref(nodeDef).description ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: "_sb_description",
          style: normalizeStyle({
            color: litegraphColors.value.WIDGET_SECONDARY_TEXT_COLOR,
            backgroundColor: litegraphColors.value.WIDGET_BGCOLOR
          })
        }, toDisplayString$1(unref(nodeDef).description), 5)) : createCommentVNode("", true)
      ]);
    };
  }
});
const NodePreview = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-d9792337"]]);
const BOOKMARK_SETTING_ID = "Comfy.NodeLibrary.Bookmarks.V2";
const useNodeBookmarkStore = /* @__PURE__ */ defineStore("nodeBookmark", () => {
  const settingStore = useSettingStore();
  const nodeDefStore = useNodeDefStore();
  const bookmarks = computed(
    () => settingStore.get(BOOKMARK_SETTING_ID)
  );
  const bookmarksSet = computed(() => new Set(bookmarks.value));
  const bookmarkedRoot = computed(
    () => buildBookmarkTree(bookmarks.value)
  );
  const isBookmarked = /* @__PURE__ */ __name((node3) => bookmarksSet.value.has(node3.nodePath) || bookmarksSet.value.has(node3.name), "isBookmarked");
  const toggleBookmark = /* @__PURE__ */ __name((node3) => {
    if (isBookmarked(node3)) {
      deleteBookmark(node3.nodePath);
      deleteBookmark(node3.name);
    } else {
      addBookmark(node3.name);
    }
  }, "toggleBookmark");
  const buildBookmarkTree = /* @__PURE__ */ __name((bookmarks2) => {
    const bookmarkNodes = bookmarks2.map((bookmark) => {
      if (bookmark.endsWith("/")) return createDummyFolderNodeDef(bookmark);
      const parts2 = bookmark.split("/");
      const name2 = parts2.pop() ?? "";
      const category = parts2.join("/");
      const srcNodeDef = nodeDefStore.nodeDefsByName[name2];
      if (!srcNodeDef) {
        return null;
      }
      const nodeDef = _.clone(srcNodeDef);
      nodeDef.category = category;
      return nodeDef;
    }).filter((nodeDef) => nodeDef !== null);
    return buildNodeDefTree(bookmarkNodes);
  }, "buildBookmarkTree");
  const addBookmark = /* @__PURE__ */ __name((nodePath) => {
    settingStore.set(BOOKMARK_SETTING_ID, [...bookmarks.value, nodePath]);
  }, "addBookmark");
  const deleteBookmark = /* @__PURE__ */ __name((nodePath) => {
    settingStore.set(
      BOOKMARK_SETTING_ID,
      bookmarks.value.filter((b) => b !== nodePath)
    );
  }, "deleteBookmark");
  const addNewBookmarkFolder = /* @__PURE__ */ __name((parent) => {
    const parentPath = parent ? parent.nodePath : "";
    let newFolderPath = parentPath + "New Folder/";
    let suffix2 = 1;
    while (bookmarks.value.some((b) => b.startsWith(newFolderPath))) {
      newFolderPath = parentPath + `New Folder ${suffix2}/`;
      suffix2++;
    }
    addBookmark(newFolderPath);
    return newFolderPath;
  }, "addNewBookmarkFolder");
  const renameBookmarkFolder = /* @__PURE__ */ __name((folderNode, newName) => {
    if (!folderNode.isDummyFolder) {
      throw new Error("Cannot rename non-folder node");
    }
    if (newName.includes("/")) {
      throw new Error('Folder name cannot contain "/"');
    }
    const newNodePath = folderNode.category.split("/").slice(0, -1).concat(newName).join("/") + "/";
    if (newNodePath === folderNode.nodePath) {
      return;
    }
    if (bookmarks.value.some((b) => b.startsWith(newNodePath))) {
      throw new Error(`Folder name "${newNodePath}" already exists`);
    }
    settingStore.set(
      BOOKMARK_SETTING_ID,
      bookmarks.value.map(
        (b) => b.startsWith(folderNode.nodePath) ? b.replace(folderNode.nodePath, newNodePath) : b
      )
    );
    renameBookmarkCustomization(folderNode.nodePath, newNodePath);
  }, "renameBookmarkFolder");
  const deleteBookmarkFolder = /* @__PURE__ */ __name((folderNode) => {
    if (!folderNode.isDummyFolder) {
      throw new Error("Cannot delete non-folder node");
    }
    settingStore.set(
      BOOKMARK_SETTING_ID,
      bookmarks.value.filter(
        (b) => b !== folderNode.nodePath && !b.startsWith(folderNode.nodePath)
      )
    );
    deleteBookmarkCustomization(folderNode.nodePath);
  }, "deleteBookmarkFolder");
  const bookmarksCustomization = computed(() => settingStore.get("Comfy.NodeLibrary.BookmarksCustomization"));
  const updateBookmarkCustomization = /* @__PURE__ */ __name((nodePath, customization) => {
    const currentCustomization = bookmarksCustomization.value[nodePath] || {};
    const newCustomization = { ...currentCustomization, ...customization };
    if (newCustomization.icon === defaultBookmarkIcon) {
      delete newCustomization.icon;
    }
    if (newCustomization.color === defaultBookmarkColor) {
      delete newCustomization.color;
    }
    if (Object.keys(newCustomization).length === 0) {
      deleteBookmarkCustomization(nodePath);
    } else {
      settingStore.set("Comfy.NodeLibrary.BookmarksCustomization", {
        ...bookmarksCustomization.value,
        [nodePath]: newCustomization
      });
    }
  }, "updateBookmarkCustomization");
  const deleteBookmarkCustomization = /* @__PURE__ */ __name((nodePath) => {
    settingStore.set("Comfy.NodeLibrary.BookmarksCustomization", {
      ...bookmarksCustomization.value,
      [nodePath]: void 0
    });
  }, "deleteBookmarkCustomization");
  const renameBookmarkCustomization = /* @__PURE__ */ __name((oldNodePath, newNodePath) => {
    const updatedCustomization = { ...bookmarksCustomization.value };
    if (updatedCustomization[oldNodePath]) {
      updatedCustomization[newNodePath] = updatedCustomization[oldNodePath];
      delete updatedCustomization[oldNodePath];
    }
    settingStore.set(
      "Comfy.NodeLibrary.BookmarksCustomization",
      updatedCustomization
    );
  }, "renameBookmarkCustomization");
  const defaultBookmarkIcon = "pi-bookmark-fill";
  const defaultBookmarkColor = "#a1a1aa";
  return {
    bookmarks,
    bookmarkedRoot,
    isBookmarked,
    toggleBookmark,
    addBookmark,
    addNewBookmarkFolder,
    renameBookmarkFolder,
    deleteBookmarkFolder,
    bookmarksCustomization,
    updateBookmarkCustomization,
    deleteBookmarkCustomization,
    renameBookmarkCustomization,
    defaultBookmarkIcon,
    defaultBookmarkColor
  };
});
const _sfc_main$f = /* @__PURE__ */ defineComponent({
  __name: "NodeTreeLeaf",
  props: {
    node: {}
  },
  emits: ["toggle-bookmark"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const nodeDef = computed(() => props.node.data);
    const nodeBookmarkStore = useNodeBookmarkStore();
    const isBookmarked = computed(
      () => nodeBookmarkStore.isBookmarked(nodeDef.value)
    );
    const settingStore = useSettingStore();
    const sidebarLocation = computed(
      () => settingStore.get("Comfy.Sidebar.Location")
    );
    const emit2 = __emit;
    const toggleBookmark = /* @__PURE__ */ __name(() => {
      nodeBookmarkStore.toggleBookmark(nodeDef.value);
    }, "toggleBookmark");
    const previewRef = ref(null);
    const nodePreviewStyle = ref({
      position: "absolute",
      top: "0px",
      left: "0px"
    });
    const handleNodeHover = /* @__PURE__ */ __name(async () => {
      const hoverTarget = nodeContentElement.value;
      const targetRect = hoverTarget.getBoundingClientRect();
      const previewHeight = previewRef.value?.$el.offsetHeight || 0;
      const availableSpaceBelow = window.innerHeight - targetRect.bottom;
      nodePreviewStyle.value.top = previewHeight > availableSpaceBelow ? `${Math.max(0, targetRect.top - (previewHeight - availableSpaceBelow) - 20)}px` : `${targetRect.top - 40}px`;
      if (sidebarLocation.value === "left") {
        nodePreviewStyle.value.left = `${targetRect.right}px`;
      } else {
        nodePreviewStyle.value.left = `${targetRect.left - 400}px`;
      }
    }, "handleNodeHover");
    const container = ref(null);
    const nodeContentElement = ref(null);
    const isHovered = ref(false);
    const handleMouseEnter = /* @__PURE__ */ __name(async () => {
      isHovered.value = true;
      await nextTick();
      handleNodeHover();
    }, "handleMouseEnter");
    const handleMouseLeave2 = /* @__PURE__ */ __name(() => {
      isHovered.value = false;
    }, "handleMouseLeave");
    onMounted(() => {
      nodeContentElement.value = container.value?.closest(".p-tree-node-content");
      nodeContentElement.value?.addEventListener("mouseenter", handleMouseEnter);
      nodeContentElement.value?.addEventListener("mouseleave", handleMouseLeave2);
    });
    onUnmounted(() => {
      nodeContentElement.value?.removeEventListener("mouseenter", handleMouseEnter);
      nodeContentElement.value?.removeEventListener("mouseleave", handleMouseLeave2);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "container",
        ref: container,
        class: "node-lib-node-container"
      }, [
        createVNode(TreeExplorerTreeNode, { node: _ctx.node }, {
          "before-label": withCtx(() => [
            nodeDef.value.experimental ? (openBlock(), createBlock(unref(script$x), {
              key: 0,
              value: _ctx.$t("g.experimental"),
              severity: "primary"
            }, null, 8, ["value"])) : createCommentVNode("", true),
            nodeDef.value.deprecated ? (openBlock(), createBlock(unref(script$x), {
              key: 1,
              value: _ctx.$t("g.deprecated"),
              severity: "danger"
            }, null, 8, ["value"])) : createCommentVNode("", true)
          ]),
          actions: withCtx(() => [
            createVNode(unref(script$R), {
              class: "bookmark-button",
              size: "small",
              icon: isBookmarked.value ? "pi pi-bookmark-fill" : "pi pi-bookmark",
              text: "",
              severity: "secondary",
              onClick: withModifiers(toggleBookmark, ["stop"])
            }, null, 8, ["icon"])
          ]),
          _: 1
        }, 8, ["node"]),
        isHovered.value ? (openBlock(), createBlock(Teleport, {
          key: 0,
          to: "#node-library-node-preview-container"
        }, [
          createBaseVNode("div", {
            class: "node-lib-node-preview",
            style: normalizeStyle(nodePreviewStyle.value)
          }, [
            createVNode(NodePreview, {
              ref_key: "previewRef",
              ref: previewRef,
              nodeDef: nodeDef.value
            }, null, 8, ["nodeDef"])
          ], 4)
        ])) : createCommentVNode("", true)
      ], 512);
    };
  }
});
const NodeTreeLeaf = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-da9a8962"]]);
const _withScopeId$3 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-4b8adc78"), n = n(), popScopeId(), n), "_withScopeId$3");
const _hoisted_1$a = { class: "p-fluid" };
const _hoisted_2$8 = { class: "field icon-field" };
const _hoisted_3$5 = { for: "icon" };
const _hoisted_4$4 = { class: "field color-field" };
const _hoisted_5$3 = { for: "color" };
const _hoisted_6$2 = { class: "color-picker-container" };
const _hoisted_7$1 = {
  key: 1,
  class: "pi pi-palette",
  style: { fontSize: "1.2rem" }
};
const _sfc_main$e = /* @__PURE__ */ defineComponent({
  __name: "CustomizationDialog",
  props: {
    modelValue: { type: Boolean },
    initialIcon: {},
    initialColor: {}
  },
  emits: ["update:modelValue", "confirm"],
  setup(__props, { emit: __emit }) {
    const { t: t2 } = useI18n();
    const props = __props;
    const emit2 = __emit;
    const visible = computed({
      get: /* @__PURE__ */ __name(() => props.modelValue, "get"),
      set: /* @__PURE__ */ __name((value4) => emit2("update:modelValue", value4), "set")
    });
    const nodeBookmarkStore = useNodeBookmarkStore();
    const iconOptions = [
      { name: t2("icon.bookmark"), value: nodeBookmarkStore.defaultBookmarkIcon },
      { name: t2("icon.folder"), value: "pi-folder" },
      { name: t2("icon.star"), value: "pi-star" },
      { name: t2("icon.heart"), value: "pi-heart" },
      { name: t2("icon.file"), value: "pi-file" },
      { name: t2("icon.inbox"), value: "pi-inbox" },
      { name: t2("icon.box"), value: "pi-box" },
      { name: t2("icon.briefcase"), value: "pi-briefcase" }
    ];
    const colorOptions = [
      { name: t2("color.default"), value: nodeBookmarkStore.defaultBookmarkColor },
      { name: t2("color.blue"), value: "#007bff" },
      { name: t2("color.green"), value: "#28a745" },
      { name: t2("color.red"), value: "#dc3545" },
      { name: t2("color.pink"), value: "#e83e8c" },
      { name: t2("color.yellow"), value: "#ffc107" },
      { name: t2("color.custom"), value: "custom" }
    ];
    const defaultIcon = iconOptions.find(
      (option3) => option3.value === nodeBookmarkStore.defaultBookmarkIcon
    );
    const defaultColor = colorOptions.find(
      (option3) => option3.value === nodeBookmarkStore.defaultBookmarkColor
    );
    const selectedIcon = ref(defaultIcon);
    const selectedColor = ref(defaultColor);
    const finalColor = computed(
      () => selectedColor.value.value === "custom" ? `#${customColor.value}` : selectedColor.value.value
    );
    const customColor = ref("000000");
    const closeDialog = /* @__PURE__ */ __name(() => {
      visible.value = false;
    }, "closeDialog");
    const confirmCustomization = /* @__PURE__ */ __name(() => {
      emit2("confirm", selectedIcon.value.value, finalColor.value);
      closeDialog();
    }, "confirmCustomization");
    const resetCustomization = /* @__PURE__ */ __name(() => {
      selectedIcon.value = iconOptions.find((option3) => option3.value === props.initialIcon) || defaultIcon;
      const colorOption = colorOptions.find(
        (option3) => option3.value === props.initialColor
      );
      if (!props.initialColor) {
        selectedColor.value = defaultColor;
      } else if (!colorOption) {
        customColor.value = props.initialColor.replace("#", "");
        selectedColor.value = { name: t2("color.custom"), value: "custom" };
      } else {
        selectedColor.value = colorOption;
      }
    }, "resetCustomization");
    watch(
      () => props.modelValue,
      (newValue2) => {
        if (newValue2) {
          resetCustomization();
        }
      },
      { immediate: true }
    );
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return openBlock(), createBlock(unref(script$P), {
        visible: visible.value,
        "onUpdate:visible": _cache[3] || (_cache[3] = ($event) => visible.value = $event),
        header: _ctx.$t("g.customizeFolder")
      }, {
        footer: withCtx(() => [
          createVNode(unref(script$R), {
            label: _ctx.$t("g.reset"),
            icon: "pi pi-refresh",
            onClick: resetCustomization,
            class: "p-button-text"
          }, null, 8, ["label"]),
          createVNode(unref(script$R), {
            label: _ctx.$t("g.confirm"),
            icon: "pi pi-check",
            onClick: confirmCustomization,
            autofocus: ""
          }, null, 8, ["label"])
        ]),
        default: withCtx(() => [
          createBaseVNode("div", _hoisted_1$a, [
            createBaseVNode("div", _hoisted_2$8, [
              createBaseVNode("label", _hoisted_3$5, toDisplayString$1(_ctx.$t("g.icon")), 1),
              createVNode(unref(script$7), {
                modelValue: selectedIcon.value,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedIcon.value = $event),
                options: iconOptions,
                optionLabel: "name",
                dataKey: "value"
              }, {
                option: withCtx((slotProps) => [
                  createBaseVNode("i", {
                    class: normalizeClass(["pi", slotProps.option.value, "mr-2"]),
                    style: normalizeStyle({ color: finalColor.value })
                  }, null, 6)
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            createVNode(unref(script$O)),
            createBaseVNode("div", _hoisted_4$4, [
              createBaseVNode("label", _hoisted_5$3, toDisplayString$1(_ctx.$t("g.color")), 1),
              createBaseVNode("div", _hoisted_6$2, [
                createVNode(unref(script$7), {
                  modelValue: selectedColor.value,
                  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedColor.value = $event),
                  options: colorOptions,
                  optionLabel: "name",
                  dataKey: "value"
                }, {
                  option: withCtx((slotProps) => [
                    slotProps.option.value !== "custom" ? (openBlock(), createElementBlock("div", {
                      key: 0,
                      style: normalizeStyle({
                        width: "20px",
                        height: "20px",
                        backgroundColor: slotProps.option.value,
                        borderRadius: "50%"
                      })
                    }, null, 4)) : withDirectives((openBlock(), createElementBlock("i", _hoisted_7$1, null, 512)), [
                      [_directive_tooltip, _ctx.$t("g.customColor")]
                    ])
                  ]),
                  _: 1
                }, 8, ["modelValue"]),
                selectedColor.value.value === "custom" ? (openBlock(), createBlock(unref(script$j), {
                  key: 0,
                  modelValue: customColor.value,
                  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => customColor.value = $event)
                }, null, 8, ["modelValue"])) : createCommentVNode("", true)
              ])
            ])
          ])
        ]),
        _: 1
      }, 8, ["visible", "header"]);
    };
  }
});
const FolderCustomizationDialog = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-4b8adc78"]]);
const _sfc_main$d = /* @__PURE__ */ defineComponent({
  __name: "NodeTreeFolder",
  props: {
    node: {}
  },
  setup(__props) {
    const props = __props;
    const nodeBookmarkStore = useNodeBookmarkStore();
    const customization = computed(() => {
      return nodeBookmarkStore.bookmarksCustomization[props.node.data.nodePath];
    });
    const treeNodeElement = ref(null);
    const iconElement = ref(null);
    let stopWatchCustomization = null;
    const container = ref(null);
    onMounted(() => {
      treeNodeElement.value = container.value?.closest(
        ".p-tree-node-content"
      );
      iconElement.value = treeNodeElement.value.querySelector(
        ":scope > .p-tree-node-icon"
      );
      updateIconColor();
      stopWatchCustomization = watch(customization, updateIconColor, { deep: true });
    });
    const updateIconColor = /* @__PURE__ */ __name(() => {
      if (iconElement.value && customization.value) {
        iconElement.value.style.color = customization.value.color;
      }
    }, "updateIconColor");
    onUnmounted(() => {
      if (stopWatchCustomization) {
        stopWatchCustomization();
      }
    });
    const expandedKeys2 = inject("expandedKeys");
    const handleItemDrop = /* @__PURE__ */ __name((node3) => {
      expandedKeys2.value[node3.key] = true;
    }, "handleItemDrop");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "container",
        ref: container,
        class: "node-lib-node-container"
      }, [
        createVNode(TreeExplorerTreeNode, {
          node: _ctx.node,
          onItemDropped: handleItemDrop
        }, null, 8, ["node"])
      ], 512);
    };
  }
});
const _sfc_main$c = /* @__PURE__ */ defineComponent({
  __name: "NodeBookmarkTreeExplorer",
  props: {
    filteredNodeDefs: {}
  },
  setup(__props, { expose: __expose }) {
    const props = __props;
    const expandedKeys2 = ref({});
    const { expandNode, toggleNodeOnEvent } = useTreeExpansion(expandedKeys2);
    const nodeBookmarkStore = useNodeBookmarkStore();
    const bookmarkedRoot = computed(() => {
      const filterTree = /* @__PURE__ */ __name((node3) => {
        if (node3.leaf) {
          return props.filteredNodeDefs.some((def2) => def2.name === node3.data.name) ? node3 : null;
        }
        const filteredChildren = node3.children?.map(filterTree).filter((child) => child !== null);
        if (filteredChildren && filteredChildren.length > 0) {
          return {
            ...node3,
            children: filteredChildren
          };
        }
        return null;
      }, "filterTree");
      return props.filteredNodeDefs.length ? filterTree(nodeBookmarkStore.bookmarkedRoot) || {
        key: "root",
        label: "Root",
        children: []
      } : nodeBookmarkStore.bookmarkedRoot;
    });
    watch(
      () => props.filteredNodeDefs,
      (newValue2) => {
        if (newValue2.length) {
          nextTick(() => expandNode(bookmarkedRoot.value));
        }
      }
    );
    const { t: t2 } = useI18n();
    const extraMenuItems = /* @__PURE__ */ __name((menuTargetNode) => [
      {
        label: t2("g.newFolder"),
        icon: "pi pi-folder-plus",
        command: /* @__PURE__ */ __name(() => {
          addNewBookmarkFolder(menuTargetNode);
        }, "command"),
        visible: !menuTargetNode?.leaf
      },
      {
        label: t2("g.customize"),
        icon: "pi pi-palette",
        command: /* @__PURE__ */ __name(() => {
          const customization = nodeBookmarkStore.bookmarksCustomization[menuTargetNode.data.nodePath];
          initialIcon.value = customization?.icon || nodeBookmarkStore.defaultBookmarkIcon;
          initialColor.value = customization?.color || nodeBookmarkStore.defaultBookmarkColor;
          showCustomizationDialog.value = true;
          customizationTargetNodePath.value = menuTargetNode.data.nodePath;
        }, "command"),
        visible: !menuTargetNode?.leaf
      }
    ], "extraMenuItems");
    const renderedBookmarkedRoot = computed(
      () => {
        const fillNodeInfo = /* @__PURE__ */ __name((node3) => {
          const children = node3.children?.map(fillNodeInfo);
          const sortedChildren = children?.sort((a, b) => {
            if (a.leaf === b.leaf) {
              return a.label.localeCompare(b.label);
            }
            return a.leaf ? 1 : -1;
          });
          return {
            key: node3.key,
            label: node3.leaf ? node3.data.display_name : node3.label,
            leaf: node3.leaf,
            data: node3.data,
            getIcon: /* @__PURE__ */ __name((node22) => {
              if (node22.leaf) {
                return "pi pi-circle-fill";
              }
              const customization = nodeBookmarkStore.bookmarksCustomization[node22.data?.nodePath];
              return customization?.icon ? "pi " + customization.icon : "pi pi-bookmark-fill";
            }, "getIcon"),
            children: sortedChildren,
            draggable: node3.leaf,
            droppable: !node3.leaf,
            handleDrop: /* @__PURE__ */ __name((node22, data24) => {
              const nodeDefToAdd = data24.data.data;
              if (nodeBookmarkStore.isBookmarked(nodeDefToAdd)) {
                nodeBookmarkStore.toggleBookmark(nodeDefToAdd);
              }
              const folderNodeDef = node22.data;
              const nodePath = folderNodeDef.category + "/" + nodeDefToAdd.name;
              nodeBookmarkStore.addBookmark(nodePath);
            }, "handleDrop"),
            handleClick: /* @__PURE__ */ __name((node22, e2) => {
              if (node22.leaf) {
                useLitegraphService().addNodeOnGraph(node22.data);
              } else {
                toggleNodeOnEvent(e2, node22);
              }
            }, "handleClick"),
            contextMenuItems: extraMenuItems,
            ...node3.leaf ? {} : {
              handleRename,
              handleDelete: /* @__PURE__ */ __name((node22) => {
                nodeBookmarkStore.deleteBookmarkFolder(node22.data);
              }, "handleDelete")
            }
          };
        }, "fillNodeInfo");
        return fillNodeInfo(bookmarkedRoot.value);
      }
    );
    const treeExplorerRef = ref(null);
    const addNewBookmarkFolder = /* @__PURE__ */ __name((parent) => {
      const newFolderKey = "root/" + nodeBookmarkStore.addNewBookmarkFolder(parent?.data).slice(0, -1);
      nextTick(() => {
        treeExplorerRef.value?.renameCommand(
          findNodeByKey(
            renderedBookmarkedRoot.value,
            newFolderKey
          )
        );
        if (parent) {
          expandedKeys2.value[parent.key] = true;
        }
      });
    }, "addNewBookmarkFolder");
    __expose({
      addNewBookmarkFolder
    });
    const handleRename = /* @__PURE__ */ __name((node3, newName) => {
      if (node3.data && node3.data.isDummyFolder) {
        nodeBookmarkStore.renameBookmarkFolder(node3.data, newName);
      }
    }, "handleRename");
    const showCustomizationDialog = ref(false);
    const initialIcon = ref(nodeBookmarkStore.defaultBookmarkIcon);
    const initialColor = ref(nodeBookmarkStore.defaultBookmarkColor);
    const customizationTargetNodePath = ref("");
    const updateCustomization = /* @__PURE__ */ __name((icon3, color2) => {
      if (customizationTargetNodePath.value) {
        nodeBookmarkStore.updateBookmarkCustomization(
          customizationTargetNodePath.value,
          { icon: icon3, color: color2 }
        );
      }
    }, "updateCustomization");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(TreeExplorer, {
          class: "node-lib-bookmark-tree-explorer",
          ref_key: "treeExplorerRef",
          ref: treeExplorerRef,
          roots: renderedBookmarkedRoot.value.children,
          expandedKeys: expandedKeys2.value
        }, {
          folder: withCtx(({ node: node3 }) => [
            createVNode(_sfc_main$d, { node: node3 }, null, 8, ["node"])
          ]),
          node: withCtx(({ node: node3 }) => [
            createVNode(NodeTreeLeaf, { node: node3 }, null, 8, ["node"])
          ]),
          _: 1
        }, 8, ["roots", "expandedKeys"]),
        createVNode(FolderCustomizationDialog, {
          modelValue: showCustomizationDialog.value,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showCustomizationDialog.value = $event),
          onConfirm: updateCustomization,
          initialIcon: initialIcon.value,
          initialColor: initialColor.value
        }, null, 8, ["modelValue", "initialIcon", "initialColor"])
      ], 64);
    };
  }
});
const _hoisted_1$9 = /* @__PURE__ */ createBaseVNode("div", { id: "node-library-node-preview-container" }, null, -1);
const _sfc_main$b = /* @__PURE__ */ defineComponent({
  __name: "NodeLibrarySidebarTab",
  setup(__props) {
    const nodeDefStore = useNodeDefStore();
    const nodeBookmarkStore = useNodeBookmarkStore();
    const expandedKeys2 = ref({});
    const { expandNode, toggleNodeOnEvent } = useTreeExpansion(expandedKeys2);
    const nodeBookmarkTreeExplorerRef = ref(null);
    const searchFilter = ref(null);
    const alphabeticalSort = ref(false);
    const searchQuery = ref("");
    const root24 = computed(() => {
      const root25 = filteredRoot.value || nodeDefStore.nodeTree;
      return alphabeticalSort.value ? sortedTree(root25, { groupLeaf: true }) : root25;
    });
    const renderedRoot = computed(() => {
      const fillNodeInfo = /* @__PURE__ */ __name((node3) => {
        const children = node3.children?.map(fillNodeInfo);
        return {
          key: node3.key,
          label: node3.leaf ? node3.data.display_name : node3.label,
          leaf: node3.leaf,
          data: node3.data,
          getIcon: /* @__PURE__ */ __name((node22) => {
            if (node22.leaf) {
              return "pi pi-circle-fill";
            }
          }, "getIcon"),
          children,
          draggable: node3.leaf,
          handleClick: /* @__PURE__ */ __name((node22, e2) => {
            if (node22.leaf) {
              useLitegraphService().addNodeOnGraph(node22.data);
            } else {
              toggleNodeOnEvent(e2, node22);
            }
          }, "handleClick")
        };
      }, "fillNodeInfo");
      return fillNodeInfo(root24.value);
    });
    const filteredNodeDefs = ref([]);
    const filteredRoot = computed(() => {
      if (!filteredNodeDefs.value.length) {
        return null;
      }
      return buildNodeDefTree(filteredNodeDefs.value);
    });
    const filters = ref([]);
    const handleSearch = /* @__PURE__ */ __name((query) => {
      if (query.length === 0 && !filters.value.length) {
        filteredNodeDefs.value = [];
        expandedKeys2.value = {};
        return;
      }
      const f = filters.value.map((f2) => f2.filter);
      filteredNodeDefs.value = nodeDefStore.nodeSearchService.searchNode(
        query,
        f,
        {
          limit: 64
        },
        {
          matchWildcards: false
        }
      );
      nextTick(() => {
        expandNode(filteredRoot.value);
      });
    }, "handleSearch");
    const onAddFilter = /* @__PURE__ */ __name((filterAndValue) => {
      filters.value.push({
        filter: filterAndValue,
        badge: filterAndValue[0].invokeSequence.toUpperCase(),
        badgeClass: filterAndValue[0].invokeSequence + "-badge",
        text: filterAndValue[1],
        id: +/* @__PURE__ */ new Date()
      });
      handleSearch(searchQuery.value);
    }, "onAddFilter");
    const onRemoveFilter = /* @__PURE__ */ __name((filterAndValue) => {
      const index2 = filters.value.findIndex((f) => f === filterAndValue);
      if (index2 !== -1) {
        filters.value.splice(index2, 1);
      }
      handleSearch(searchQuery.value);
    }, "onRemoveFilter");
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(SidebarTabTemplate, {
          title: _ctx.$t("sideToolbar.nodeLibrary"),
          class: "bg-[var(--p-tree-background)]"
        }, {
          "tool-buttons": withCtx(() => [
            withDirectives(createVNode(unref(script$R), {
              class: "new-folder-button",
              icon: "pi pi-folder-plus",
              text: "",
              severity: "secondary",
              onClick: _cache[0] || (_cache[0] = ($event) => nodeBookmarkTreeExplorerRef.value?.addNewBookmarkFolder())
            }, null, 512), [
              [
                _directive_tooltip,
                _ctx.$t("g.newFolder"),
                void 0,
                { bottom: true }
              ]
            ]),
            withDirectives(createVNode(unref(script$R), {
              class: "sort-button",
              icon: alphabeticalSort.value ? "pi pi-sort-alpha-down" : "pi pi-sort-alt",
              text: "",
              severity: "secondary",
              onClick: _cache[1] || (_cache[1] = ($event) => alphabeticalSort.value = !alphabeticalSort.value)
            }, null, 8, ["icon"]), [
              [
                _directive_tooltip,
                _ctx.$t("sideToolbar.nodeLibraryTab.sortOrder"),
                void 0,
                { bottom: true }
              ]
            ])
          ]),
          header: withCtx(() => [
            createVNode(SearchBox, {
              class: "node-lib-search-box p-2 2xl:p-4",
              modelValue: searchQuery.value,
              "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchQuery.value = $event),
              onSearch: handleSearch,
              onShowFilter: _cache[3] || (_cache[3] = ($event) => searchFilter.value.toggle($event)),
              onRemoveFilter,
              placeholder: _ctx.$t("g.searchNodes") + "...",
              "filter-icon": "pi pi-filter",
              filters: filters.value
            }, null, 8, ["modelValue", "placeholder", "filters"]),
            createVNode(unref(script$9), {
              ref_key: "searchFilter",
              ref: searchFilter,
              class: "ml-[-13px]"
            }, {
              default: withCtx(() => [
                createVNode(NodeSearchFilter, { onAddFilter })
              ]),
              _: 1
            }, 512)
          ]),
          body: withCtx(() => [
            createVNode(_sfc_main$c, {
              ref_key: "nodeBookmarkTreeExplorerRef",
              ref: nodeBookmarkTreeExplorerRef,
              "filtered-node-defs": filteredNodeDefs.value
            }, null, 8, ["filtered-node-defs"]),
            withDirectives(createVNode(unref(script$O), {
              type: "dashed",
              class: "m-2"
            }, null, 512), [
              [vShow, unref(nodeBookmarkStore).bookmarks.length > 0]
            ]),
            createVNode(TreeExplorer, {
              class: "node-lib-tree-explorer",
              roots: renderedRoot.value.children,
              expandedKeys: expandedKeys2.value,
              "onUpdate:expandedKeys": _cache[4] || (_cache[4] = ($event) => expandedKeys2.value = $event)
            }, {
              node: withCtx(({ node: node3 }) => [
                createVNode(NodeTreeLeaf, { node: node3 }, null, 8, ["node"])
              ]),
              _: 1
            }, 8, ["roots", "expandedKeys"])
          ]),
          _: 1
        }, 8, ["title"]),
        _hoisted_1$9
      ], 64);
    };
  }
});
const useNodeLibrarySidebarTab = /* @__PURE__ */ __name(() => {
  const { t: t2 } = useI18n();
  return {
    id: "node-library",
    icon: "pi pi-book",
    title: t2("sideToolbar.nodeLibrary"),
    tooltip: t2("sideToolbar.nodeLibrary"),
    component: markRaw(_sfc_main$b),
    type: "vue"
  };
}, "useNodeLibrarySidebarTab");
var theme$2 = /* @__PURE__ */ __name(function theme37(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-confirmpopup {\n    position: absolute;\n    margin-top: ".concat(dt2("confirmpopup.gutter"), ";\n    top: 0;\n    left: 0;\n    background: ").concat(dt2("confirmpopup.background"), ";\n    color: ").concat(dt2("confirmpopup.color"), ";\n    border: 1px solid ").concat(dt2("confirmpopup.border.color"), ";\n    border-radius: ").concat(dt2("confirmpopup.border.radius"), ";\n    box-shadow: ").concat(dt2("confirmpopup.shadow"), ";\n}\n\n.p-confirmpopup-content {\n    display: flex;\n    align-items: center;\n    padding: ").concat(dt2("confirmpopup.content.padding"), ";\n    gap: ").concat(dt2("confirmpopup.content.gap"), ";\n}\n\n.p-confirmpopup-icon {\n    font-size: ").concat(dt2("confirmpopup.icon.size"), ";\n    width: ").concat(dt2("confirmpopup.icon.size"), ";\n    height: ").concat(dt2("confirmpopup.icon.size"), ";\n    color: ").concat(dt2("confirmpopup.icon.color"), ";\n}\n\n.p-confirmpopup-footer {\n    display: flex;\n    justify-content: flex-end;\n    gap: ").concat(dt2("confirmpopup.footer.gap"), ";\n    padding: ").concat(dt2("confirmpopup.footer.padding"), ";\n}\n\n.p-confirmpopup-footer button {\n    width: auto;\n}\n\n.p-confirmpopup-footer button:last-child {\n    margin: 0;\n}\n\n.p-confirmpopup-flipped {\n    margin-top: calc(").concat(dt2("confirmpopup.gutter"), " * -1);\n    margin-bottom: ").concat(dt2("confirmpopup.gutter"), ";\n}\n\n.p-confirmpopup-enter-from {\n    opacity: 0;\n    transform: scaleY(0.8);\n}\n\n.p-confirmpopup-leave-to {\n    opacity: 0;\n}\n\n.p-confirmpopup-enter-active {\n    transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.p-confirmpopup-leave-active {\n    transition: opacity 0.1s linear;\n}\n\n.p-confirmpopup:after,\n.p-confirmpopup:before {\n    bottom: 100%;\n    left: calc(").concat(dt2("confirmpopup.arrow.offset"), " + ").concat(dt2("confirmpopup.arrow.left"), ');\n    content: " ";\n    height: 0;\n    width: 0;\n    position: absolute;\n    pointer-events: none;\n}\n\n.p-confirmpopup:after {\n    border-width: calc(').concat(dt2("confirmpopup.gutter"), " - 2px);\n    margin-left: calc(-1 * (").concat(dt2("confirmpopup.gutter"), " - 2px));\n    border-style: solid;\n    border-color: transparent;\n    border-bottom-color: ").concat(dt2("confirmpopup.background"), ";\n}\n\n.p-confirmpopup:before {\n    border-width: ").concat(dt2("confirmpopup.gutter"), ";\n    margin-left: calc(-1 * ").concat(dt2("confirmpopup.gutter"), ");\n    border-style: solid;\n    border-color: transparent;\n    border-bottom-color: ").concat(dt2("confirmpopup.border.color"), ";\n}\n\n.p-confirmpopup-flipped:after,\n.p-confirmpopup-flipped:before {\n    bottom: auto;\n    top: 100%;\n}\n\n.p-confirmpopup-flipped:after {\n    border-bottom-color: transparent;\n    border-top-color: ").concat(dt2("confirmpopup.background"), ";\n}\n\n.p-confirmpopup-flipped:before {\n    border-bottom-color: transparent;\n    border-top-color: ").concat(dt2("confirmpopup.border.color"), ";\n}\n");
}, "theme");
var classes$2 = {
  root: "p-confirmpopup p-component",
  content: "p-confirmpopup-content",
  icon: "p-confirmpopup-icon",
  message: "p-confirmpopup-message",
  footer: "p-confirmpopup-footer",
  pcRejectButton: "p-confirmpopup-reject-button",
  pcAcceptButton: "p-confirmpopup-accept-button"
};
var ConfirmPopupStyle = BaseStyle.extend({
  name: "confirmpopup",
  theme: theme$2,
  classes: classes$2
});
var script$1$2 = {
  name: "BaseConfirmPopup",
  "extends": script$_,
  props: {
    group: String
  },
  style: ConfirmPopupStyle,
  provide: /* @__PURE__ */ __name(function provide39() {
    return {
      $pcConfirmPopup: this,
      $parentInstance: this
    };
  }, "provide")
};
var script$6 = {
  name: "ConfirmPopup",
  "extends": script$1$2,
  inheritAttrs: false,
  data: /* @__PURE__ */ __name(function data19() {
    return {
      visible: false,
      confirmation: null,
      autoFocusAccept: null,
      autoFocusReject: null,
      target: null
    };
  }, "data"),
  target: null,
  outsideClickListener: null,
  scrollHandler: null,
  resizeListener: null,
  container: null,
  confirmListener: null,
  closeListener: null,
  mounted: /* @__PURE__ */ __name(function mounted18() {
    var _this = this;
    this.confirmListener = function(options4) {
      if (!options4) {
        return;
      }
      if (options4.group === _this.group) {
        _this.confirmation = options4;
        _this.target = options4.target;
        if (_this.confirmation.onShow) {
          _this.confirmation.onShow();
        }
        _this.visible = true;
      }
    };
    this.closeListener = function() {
      _this.visible = false;
      _this.confirmation = null;
    };
    ConfirmationEventBus.on("confirm", this.confirmListener);
    ConfirmationEventBus.on("close", this.closeListener);
  }, "mounted"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount10() {
    ConfirmationEventBus.off("confirm", this.confirmListener);
    ConfirmationEventBus.off("close", this.closeListener);
    this.unbindOutsideClickListener();
    if (this.scrollHandler) {
      this.scrollHandler.destroy();
      this.scrollHandler = null;
    }
    this.unbindResizeListener();
    if (this.container) {
      ZIndex.clear(this.container);
      this.container = null;
    }
    this.target = null;
    this.confirmation = null;
  }, "beforeUnmount"),
  methods: {
    accept: /* @__PURE__ */ __name(function accept() {
      if (this.confirmation.accept) {
        this.confirmation.accept();
      }
      this.visible = false;
    }, "accept"),
    reject: /* @__PURE__ */ __name(function reject() {
      if (this.confirmation.reject) {
        this.confirmation.reject();
      }
      this.visible = false;
    }, "reject"),
    onHide: /* @__PURE__ */ __name(function onHide() {
      if (this.confirmation.onHide) {
        this.confirmation.onHide();
      }
      this.visible = false;
    }, "onHide"),
    onAcceptKeydown: /* @__PURE__ */ __name(function onAcceptKeydown(event) {
      if (event.code === "Space" || event.code === "Enter" || event.code === "NumpadEnter") {
        this.accept();
        focus$1(this.target);
        event.preventDefault();
      }
    }, "onAcceptKeydown"),
    onRejectKeydown: /* @__PURE__ */ __name(function onRejectKeydown(event) {
      if (event.code === "Space" || event.code === "Enter" || event.code === "NumpadEnter") {
        this.reject();
        focus$1(this.target);
        event.preventDefault();
      }
    }, "onRejectKeydown"),
    onEnter: /* @__PURE__ */ __name(function onEnter5(el) {
      this.autoFocusAccept = this.confirmation.defaultFocus === void 0 || this.confirmation.defaultFocus === "accept" ? true : false;
      this.autoFocusReject = this.confirmation.defaultFocus === "reject" ? true : false;
      this.target = document.activeElement;
      this.bindOutsideClickListener();
      this.bindScrollListener();
      this.bindResizeListener();
      ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay);
    }, "onEnter"),
    onAfterEnter: /* @__PURE__ */ __name(function onAfterEnter3() {
      this.focus();
    }, "onAfterEnter"),
    onLeave: /* @__PURE__ */ __name(function onLeave4() {
      this.autoFocusAccept = null;
      this.autoFocusReject = null;
      focus$1(this.target);
      this.target = null;
      this.unbindOutsideClickListener();
      this.unbindScrollListener();
      this.unbindResizeListener();
    }, "onLeave"),
    onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave4(el) {
      ZIndex.clear(el);
    }, "onAfterLeave"),
    alignOverlay: /* @__PURE__ */ __name(function alignOverlay5() {
      absolutePosition(this.container, this.target, false);
      var containerOffset = getOffset(this.container);
      var targetOffset = getOffset(this.target);
      var arrowLeft = 0;
      if (containerOffset.left < targetOffset.left) {
        arrowLeft = targetOffset.left - containerOffset.left;
      }
      this.container.style.setProperty($dt("confirmpopup.arrow.left").name, "".concat(arrowLeft, "px"));
      if (containerOffset.top < targetOffset.top) {
        this.container.setAttribute("data-p-confirmpopup-flipped", "true");
        !this.isUnstyled && addClass(this.container, "p-confirmpopup-flipped");
      }
    }, "alignOverlay"),
    bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener5() {
      var _this2 = this;
      if (!this.outsideClickListener) {
        this.outsideClickListener = function(event) {
          if (_this2.visible && _this2.container && !_this2.container.contains(event.target) && !_this2.isTargetClicked(event)) {
            if (_this2.confirmation.onHide) {
              _this2.confirmation.onHide();
            }
            _this2.visible = false;
          } else {
            _this2.alignOverlay();
          }
        };
        document.addEventListener("click", this.outsideClickListener);
      }
    }, "bindOutsideClickListener"),
    unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener5() {
      if (this.outsideClickListener) {
        document.removeEventListener("click", this.outsideClickListener);
        this.outsideClickListener = null;
      }
    }, "unbindOutsideClickListener"),
    bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener5() {
      var _this3 = this;
      if (!this.scrollHandler) {
        this.scrollHandler = new ConnectedOverlayScrollHandler(this.target, function() {
          if (_this3.visible) {
            _this3.visible = false;
          }
        });
      }
      this.scrollHandler.bindScrollListener();
    }, "bindScrollListener"),
    unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener5() {
      if (this.scrollHandler) {
        this.scrollHandler.unbindScrollListener();
      }
    }, "unbindScrollListener"),
    bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener6() {
      var _this4 = this;
      if (!this.resizeListener) {
        this.resizeListener = function() {
          if (_this4.visible && !isTouchDevice()) {
            _this4.visible = false;
          }
        };
        window.addEventListener("resize", this.resizeListener);
      }
    }, "bindResizeListener"),
    unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener6() {
      if (this.resizeListener) {
        window.removeEventListener("resize", this.resizeListener);
        this.resizeListener = null;
      }
    }, "unbindResizeListener"),
    focus: /* @__PURE__ */ __name(function focus3() {
      var focusTarget = this.container.querySelector("[autofocus]");
      if (focusTarget) {
        focusTarget.focus({
          preventScroll: true
        });
      }
    }, "focus"),
    isTargetClicked: /* @__PURE__ */ __name(function isTargetClicked2(event) {
      return this.target && (this.target === event.target || this.target.contains(event.target));
    }, "isTargetClicked"),
    containerRef: /* @__PURE__ */ __name(function containerRef4(el) {
      this.container = el;
    }, "containerRef"),
    onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick4(event) {
      OverlayEventBus.emit("overlay-click", {
        originalEvent: event,
        target: this.target
      });
    }, "onOverlayClick"),
    onOverlayKeydown: /* @__PURE__ */ __name(function onOverlayKeydown(event) {
      if (event.code === "Escape") {
        ConfirmationEventBus.emit("close", this.closeListener);
        focus$1(this.target);
      }
    }, "onOverlayKeydown")
  },
  computed: {
    message: /* @__PURE__ */ __name(function message() {
      return this.confirmation ? this.confirmation.message : null;
    }, "message"),
    acceptLabel: /* @__PURE__ */ __name(function acceptLabel() {
      if (this.confirmation) {
        var _confirmation$acceptP;
        var confirmation = this.confirmation;
        return confirmation.acceptLabel || ((_confirmation$acceptP = confirmation.acceptProps) === null || _confirmation$acceptP === void 0 ? void 0 : _confirmation$acceptP.label) || this.$primevue.config.locale.accept;
      }
      return this.$primevue.config.locale.accept;
    }, "acceptLabel"),
    rejectLabel: /* @__PURE__ */ __name(function rejectLabel() {
      if (this.confirmation) {
        var _confirmation$rejectP;
        var confirmation = this.confirmation;
        return confirmation.rejectLabel || ((_confirmation$rejectP = confirmation.rejectProps) === null || _confirmation$rejectP === void 0 ? void 0 : _confirmation$rejectP.label) || this.$primevue.config.locale.reject;
      }
      return this.$primevue.config.locale.reject;
    }, "rejectLabel"),
    acceptIcon: /* @__PURE__ */ __name(function acceptIcon() {
      var _this$confirmation;
      return this.confirmation ? this.confirmation.acceptIcon : (_this$confirmation = this.confirmation) !== null && _this$confirmation !== void 0 && _this$confirmation.acceptProps ? this.confirmation.acceptProps.icon : null;
    }, "acceptIcon"),
    rejectIcon: /* @__PURE__ */ __name(function rejectIcon() {
      var _this$confirmation2;
      return this.confirmation ? this.confirmation.rejectIcon : (_this$confirmation2 = this.confirmation) !== null && _this$confirmation2 !== void 0 && _this$confirmation2.rejectProps ? this.confirmation.rejectProps.icon : null;
    }, "rejectIcon")
  },
  components: {
    Button: script$R,
    Portal: script$Q
  },
  directives: {
    focustrap: FocusTrap
  }
};
var _hoisted_1$8 = ["aria-modal"];
function render$5(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_Button = resolveComponent("Button");
  var _component_Portal = resolveComponent("Portal");
  var _directive_focustrap = resolveDirective("focustrap");
  return openBlock(), createBlock(_component_Portal, null, {
    "default": withCtx(function() {
      return [createVNode(Transition, mergeProps({
        name: "p-confirmpopup",
        onEnter: $options.onEnter,
        onAfterEnter: $options.onAfterEnter,
        onLeave: $options.onLeave,
        onAfterLeave: $options.onAfterLeave
      }, _ctx.ptm("transition")), {
        "default": withCtx(function() {
          var _$data$confirmation$r, _$data$confirmation$r2, _$data$confirmation$a;
          return [$data.visible ? withDirectives((openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            ref: $options.containerRef,
            role: "alertdialog",
            "class": _ctx.cx("root"),
            "aria-modal": $data.visible,
            onClick: _cache[2] || (_cache[2] = function() {
              return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
            }),
            onKeydown: _cache[3] || (_cache[3] = function() {
              return $options.onOverlayKeydown && $options.onOverlayKeydown.apply($options, arguments);
            })
          }, _ctx.ptmi("root")), [_ctx.$slots.container ? renderSlot(_ctx.$slots, "container", {
            key: 0,
            message: $data.confirmation,
            acceptCallback: $options.accept,
            rejectCallback: $options.reject
          }) : (openBlock(), createElementBlock(Fragment$1, {
            key: 1
          }, [!_ctx.$slots.message ? (openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            "class": _ctx.cx("content")
          }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "icon", {}, function() {
            return [_ctx.$slots.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.icon), {
              key: 0,
              "class": normalizeClass(_ctx.cx("icon"))
            }, null, 8, ["class"])) : $data.confirmation.icon ? (openBlock(), createElementBlock("span", mergeProps({
              key: 1,
              "class": [$data.confirmation.icon, _ctx.cx("icon")]
            }, _ctx.ptm("icon")), null, 16)) : createCommentVNode("", true)];
          }), createBaseVNode("span", mergeProps({
            "class": _ctx.cx("message")
          }, _ctx.ptm("message")), toDisplayString$1($data.confirmation.message), 17)], 16)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.message), {
            key: 1,
            message: $data.confirmation
          }, null, 8, ["message"])), createBaseVNode("div", mergeProps({
            "class": _ctx.cx("footer")
          }, _ctx.ptm("footer")), [createVNode(_component_Button, mergeProps({
            "class": [_ctx.cx("pcRejectButton"), $data.confirmation.rejectClass],
            autofocus: $data.autoFocusReject,
            unstyled: _ctx.unstyled,
            size: ((_$data$confirmation$r = $data.confirmation.rejectProps) === null || _$data$confirmation$r === void 0 ? void 0 : _$data$confirmation$r.size) || "small",
            text: ((_$data$confirmation$r2 = $data.confirmation.rejectProps) === null || _$data$confirmation$r2 === void 0 ? void 0 : _$data$confirmation$r2.text) || false,
            onClick: _cache[0] || (_cache[0] = function($event) {
              return $options.reject();
            }),
            onKeydown: $options.onRejectKeydown
          }, $data.confirmation.rejectProps, {
            label: $options.rejectLabel,
            pt: _ctx.ptm("pcRejectButton")
          }), createSlots({
            _: 2
          }, [$options.rejectIcon || _ctx.$slots.rejecticon ? {
            name: "icon",
            fn: withCtx(function(iconProps) {
              return [renderSlot(_ctx.$slots, "rejecticon", {}, function() {
                return [createBaseVNode("span", mergeProps({
                  "class": [$options.rejectIcon, iconProps["class"]]
                }, _ctx.ptm("pcRejectButton")["icon"], {
                  "data-pc-section": "rejectbuttonicon"
                }), null, 16)];
              })];
            }),
            key: "0"
          } : void 0]), 1040, ["class", "autofocus", "unstyled", "size", "text", "onKeydown", "label", "pt"]), createVNode(_component_Button, mergeProps({
            "class": [_ctx.cx("pcAcceptButton"), $data.confirmation.acceptClass],
            autofocus: $data.autoFocusAccept,
            unstyled: _ctx.unstyled,
            size: ((_$data$confirmation$a = $data.confirmation.acceptProps) === null || _$data$confirmation$a === void 0 ? void 0 : _$data$confirmation$a.size) || "small",
            onClick: _cache[1] || (_cache[1] = function($event) {
              return $options.accept();
            }),
            onKeydown: $options.onAcceptKeydown
          }, $data.confirmation.acceptProps, {
            label: $options.acceptLabel,
            pt: _ctx.ptm("pcAcceptButton")
          }), createSlots({
            _: 2
          }, [$options.acceptIcon || _ctx.$slots.accepticon ? {
            name: "icon",
            fn: withCtx(function(iconProps) {
              return [renderSlot(_ctx.$slots, "accepticon", {}, function() {
                return [createBaseVNode("span", mergeProps({
                  "class": [$options.acceptIcon, iconProps["class"]]
                }, _ctx.ptm("pcAcceptButton")["icon"], {
                  "data-pc-section": "acceptbuttonicon"
                }), null, 16)];
              })];
            }),
            key: "0"
          } : void 0]), 1040, ["class", "autofocus", "unstyled", "size", "onKeydown", "label", "pt"])], 16)], 64))], 16, _hoisted_1$8)), [[_directive_focustrap]]) : createCommentVNode("", true)];
        }),
        _: 3
      }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])];
    }),
    _: 3
  });
}
__name(render$5, "render$5");
script$6.render = render$5;
const _sfc_main$a = /* @__PURE__ */ defineComponent({
  __name: "VirtualGrid",
  props: {
    items: {},
    gridStyle: {},
    bufferRows: {},
    scrollThrottle: {},
    resizeDebounce: {},
    defaultItemSize: {}
  },
  setup(__props) {
    const props = __props;
    const {
      bufferRows = 1,
      scrollThrottle = 64,
      resizeDebounce = 64,
      defaultItemSize = 200
    } = props;
    const itemSize2 = ref(defaultItemSize);
    const container = ref(null);
    const { width: width2, height } = useElementSize(container);
    const { y: scrollY } = useScroll(container, {
      throttle: scrollThrottle,
      eventListenerOptions: { passive: true }
    });
    const cols = computed(() => Math.floor(width2.value / itemSize2.value) || 1);
    const viewRows = computed(() => Math.ceil(height.value / itemSize2.value));
    const offsetRows = computed(() => Math.floor(scrollY.value / itemSize2.value));
    const isValidGrid = computed(
      () => height.value && width2.value && props.items?.length
    );
    const state = computed(() => {
      const fromRow = offsetRows.value - bufferRows;
      const toRow = offsetRows.value + bufferRows + viewRows.value;
      const fromCol = fromRow * cols.value;
      const toCol = toRow * cols.value;
      return {
        start: lodashExports.clamp(fromCol, 0, props.items?.length),
        end: lodashExports.clamp(toCol, fromCol, props.items?.length)
      };
    });
    const renderedItems = computed(
      () => isValidGrid.value ? props.items.slice(state.value.start, state.value.end) : []
    );
    const updateItemSize = /* @__PURE__ */ __name(() => {
      if (container.value) {
        const firstItem = container.value.querySelector("[data-virtual-grid-item]");
        itemSize2.value = firstItem?.clientHeight || defaultItemSize;
      }
    }, "updateItemSize");
    const onResize2 = lodashExports.debounce(updateItemSize, resizeDebounce);
    watch([width2, height], onResize2, { flush: "post" });
    onBeforeUnmount(() => {
      onResize2.cancel();
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "container",
        ref: container,
        class: "scroll-container"
      }, [
        createBaseVNode("div", {
          style: normalizeStyle({ height: `${state.value.start / cols.value * itemSize2.value}px` })
        }, null, 4),
        createBaseVNode("div", {
          style: normalizeStyle(_ctx.gridStyle)
        }, [
          (openBlock(true), createElementBlock(Fragment$1, null, renderList(renderedItems.value, (item3) => {
            return openBlock(), createElementBlock("div", {
              key: item3.key,
              "data-virtual-grid-item": ""
            }, [
              renderSlot(_ctx.$slots, "item", { item: item3 }, void 0, true)
            ]);
          }), 128))
        ], 4),
        createBaseVNode("div", {
          style: normalizeStyle({
            height: `${(props.items.length - state.value.end) / cols.value * itemSize2.value}px`
          })
        }, null, 4)
      ], 512);
    };
  }
});
const VirtualGrid = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-ad33a347"]]);
var theme$1 = /* @__PURE__ */ __name(function theme38(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-galleria {\n    overflow: hidden;\n    border-style: solid;\n    border-width: ".concat(dt2("galleria.border.width"), ";\n    border-color: ").concat(dt2("galleria.border.color"), ";\n    border-radius: ").concat(dt2("galleria.border.radius"), ";\n}\n\n.p-galleria-content {\n    display: flex;\n    flex-direction: column;\n}\n\n.p-galleria-items-container {\n    display: flex;\n    flex-direction: column;\n    position: relative;\n}\n\n.p-galleria-items {\n    position: relative;\n    display: flex;\n    height: 100%;\n}\n\n.p-galleria-nav-button {\n    position: absolute;\n    top: 50%;\n    display: inline-flex;\n    justify-content: center;\n    align-items: center;\n    overflow: hidden;\n    background: ").concat(dt2("galleria.nav.button.background"), ";\n    color: ").concat(dt2("galleria.nav.button.color"), ";\n    width: ").concat(dt2("galleria.nav.button.size"), ";\n    height: ").concat(dt2("galleria.nav.button.size"), ";\n    transition: background ").concat(dt2("galleria.transition.duration"), ", color ").concat(dt2("galleria.transition.duration"), ", outline-color ").concat(dt2("galleria.transition.duration"), ", box-shadow ").concat(dt2("galleria.transition.duration"), ";\n    margin: calc(-1 * calc(").concat(dt2("galleria.nav.button.size"), ") / 2) ").concat(dt2("galleria.nav.button.gutter"), " 0 ").concat(dt2("galleria.nav.button.gutter"), ";\n    padding: 0;\n    user-select: none;\n    border: 0 none;\n    cursor: pointer;\n    outline-color: transparent;\n}\n\n.p-galleria-nav-button:not(.p-disabled):hover {\n    background: ").concat(dt2("galleria.nav.button.hover.background"), ";\n    color: ").concat(dt2("galleria.nav.button.hover.color"), ";\n}\n\n.p-galleria-nav-button:not(.p-disabled):focus-visible {\n    box-shadow: ").concat(dt2("galleria.nav.button.focus.ring.shadow"), ";\n    outline: ").concat(dt2("galleria.nav.button.focus.ring.width"), " ").concat(dt2("galleria.nav.button.focus.ring.style"), " ").concat(dt2("galleria.nav.button.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("galleria.nav.button.focus.ring.offset"), ";\n}\n\n.p-galleria-next-icon,\n.p-galleria-prev-icon {\n    font-size: ").concat(dt2("galleria.nav.icon.size"), ";\n    width: ").concat(dt2("galleria.nav.icon.size"), ";\n    height: ").concat(dt2("galleria.nav.icon.size"), ";\n}\n\n.p-galleria-prev-button {\n    border-radius: ").concat(dt2("galleria.nav.button.prev.border.radius"), ";\n    left: 0;\n}\n\n.p-galleria-next-button {\n    border-radius: ").concat(dt2("galleria.nav.button.next.border.radius"), ";\n    right: 0;\n}\n\n.p-galleria-item {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    height: 100%;\n    width: 100%;\n}\n\n.p-galleria-hover-navigators .p-galleria-nav-button {\n    pointer-events: none;\n    opacity: 0;\n    transition: opacity ").concat(dt2("galleria.transition.duration"), " ease-in-out;\n}\n\n.p-galleria-hover-navigators .p-galleria-items-container:hover .p-galleria-nav-button {\n    pointer-events: all;\n    opacity: 1;\n}\n\n.p-galleria-hover-navigators .p-galleria-items-container:hover .p-galleria-nav-button.p-disabled {\n    pointer-events: none;\n}\n\n.p-galleria-caption {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    width: 100%;\n    background: ").concat(dt2("galleria.caption.background"), ";\n    color: ").concat(dt2("galleria.caption.color"), ";\n    padding: ").concat(dt2("galleria.caption.padding"), ";\n}\n\n.p-galleria-thumbnails {\n    display: flex;\n    flex-direction: column;\n    overflow: auto;\n    flex-shrink: 0;\n}\n\n.p-galleria-thumbnail-nav-button {\n    align-self: center;\n    flex: 0 0 auto;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    overflow: hidden;\n    position: relative;\n    margin: 0 ").concat(dt2("galleria.thumbnail.nav.button.gutter"), ";\n    padding: 0;\n    border: none;\n    user-select: none;\n    cursor: pointer;\n    background: transparent;\n    color: ").concat(dt2("galleria.thumbnail.nav.button.color"), ";\n    width: ").concat(dt2("galleria.thumbnail.nav.button.size"), ";\n    height: ").concat(dt2("galleria.thumbnail.nav.button.size"), ";\n    transition: background ").concat(dt2("galleria.transition.duration"), ", color ").concat(dt2("galleria.transition.duration"), ", outline-color ").concat(dt2("galleria.transition.duration"), ";\n    outline-color: transparent;\n    border-radius: ").concat(dt2("galleria.thumbnail.nav.button.border.radius"), ";\n}\n\n.p-galleria-thumbnail-nav-button:hover {\n    background: ").concat(dt2("galleria.thumbnail.nav.button.hover.background"), ";\n    color: ").concat(dt2("galleria.thumbnail.nav.button.hover.color"), ";\n}\n\n.p-galleria-thumbnail-nav-button:focus-visible {\n    box-shadow: ").concat(dt2("galleria.thumbnail.nav.button.focus.ring.shadow"), ";\n    outline: ").concat(dt2("galleria.thumbnail.nav.button.focus.ring.width"), " ").concat(dt2("galleria.thumbnail.nav.button.focus.ring.style"), " ").concat(dt2("galleria.thumbnail.nav.button.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("galleria.thumbnail.nav.button.focus.ring.offset"), ";\n}\n\n.p-galleria-thumbnail-nav-button .p-galleria-thumbnail-next-icon,\n.p-galleria-thumbnail-nav-button .p-galleria-thumbnail-prev-icon {\n    font-size: ").concat(dt2("galleria.thumbnail.nav.button.icon.size"), ";\n    width: ").concat(dt2("galleria.thumbnail.nav.button.icon.size"), ";\n    height: ").concat(dt2("galleria.thumbnail.nav.button.icon.size"), ";\n}\n\n.p-galleria-thumbnails-content {\n    display: flex;\n    flex-direction: row;\n    background: ").concat(dt2("galleria.thumbnails.content.background"), ";\n    padding: ").concat(dt2("galleria.thumbnails.content.padding"), ";\n}\n\n.p-galleria-thumbnails-viewport {\n    overflow: hidden;\n    width: 100%;\n}\n\n.p-galleria-thumbnail-items {\n    display: flex;\n}\n\n.p-galleria-thumbnail-item {\n    overflow: auto;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    cursor: pointer;\n    opacity: 0.5;\n}\n\n.p-galleria-thumbnail {\n    outline-color: transparent;\n}\n\n.p-galleria-thumbnail-item:hover {\n    opacity: 1;\n    transition: opacity 0.3s;\n}\n\n.p-galleria-thumbnail-item-current {\n    opacity: 1;\n}\n\n.p-galleria-thumbnails-left .p-galleria-content,\n.p-galleria-thumbnails-right .p-galleria-content {\n    flex-direction: row;\n}\n\n.p-galleria-thumbnails-left .p-galleria-items-container,\n.p-galleria-thumbnails-right .p-galleria-items-container {\n    flex-direction: row;\n}\n\n.p-galleria-thumbnails-left .p-galleria-items-container,\n.p-galleria-thumbnails-top .p-galleria-items-container {\n    order: 2;\n}\n\n.p-galleria-thumbnails-left .p-galleria-thumbnails,\n.p-galleria-thumbnails-top .p-galleria-thumbnails {\n    order: 1;\n}\n\n.p-galleria-thumbnails-left .p-galleria-thumbnails-content,\n.p-galleria-thumbnails-right .p-galleria-thumbnails-content {\n    flex-direction: column;\n    flex-grow: 1;\n}\n\n.p-galleria-thumbnails-left .p-galleria-thumbnail-items,\n.p-galleria-thumbnails-right .p-galleria-thumbnail-items {\n    flex-direction: column;\n    height: 100%;\n}\n\n.p-galleria-indicator-list {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: ").concat(dt2("galleria.indicator.list.padding"), ";\n    gap: ").concat(dt2("galleria.indicator.list.gap"), ";\n    margin: 0;\n    list-style: none;\n}\n\n.p-galleria-indicator-button {\n    display: inline-flex;\n    align-items: center;\n    background: ").concat(dt2("galleria.indicator.button.background"), ";\n    width: ").concat(dt2("galleria.indicator.button.width"), ";\n    height: ").concat(dt2("galleria.indicator.button.height"), ";\n    transition: background ").concat(dt2("galleria.transition.duration"), ", color ").concat(dt2("galleria.transition.duration"), ", outline-color ").concat(dt2("galleria.transition.duration"), ", box-shadow ").concat(dt2("galleria.transition.duration"), ";\n    outline-color: transparent;\n    border-radius: ").concat(dt2("galleria.indicator.button.border.radius"), ";\n    margin: 0;\n    padding: 0;\n    border: none;\n    user-select: none;\n    cursor: pointer;\n}\n\n.p-galleria-indicator-button:hover {\n    background: ").concat(dt2("galleria.indicator.button.hover.background"), ";\n}\n\n.p-galleria-indicator-button:focus-visible {\n    box-shadow: ").concat(dt2("galleria.indicator.button.focus.ring.shadow"), ";\n    outline: ").concat(dt2("galleria.indicator.button.focus.ring.width"), " ").concat(dt2("galleria.indicator.button.focus.ring.style"), " ").concat(dt2("galleria.indicator.button.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("galleria.indicator.button.focus.ring.offset"), ";\n}\n\n.p-galleria-indicator-active .p-galleria-indicator-button {\n    background: ").concat(dt2("galleria.indicator.button.active.background"), ";\n}\n\n.p-galleria-indicators-left .p-galleria-items-container,\n.p-galleria-indicators-right .p-galleria-items-container {\n    flex-direction: row;\n    align-items: center;\n}\n\n.p-galleria-indicators-left .p-galleria-items,\n.p-galleria-indicators-top .p-galleria-items {\n    order: 2;\n}\n\n.p-galleria-indicators-left .p-galleria-indicator-list,\n.p-galleria-indicators-top .p-galleria-indicator-list {\n    order: 1;\n}\n\n.p-galleria-indicators-left .p-galleria-indicator-list,\n.p-galleria-indicators-right .p-galleria-indicator-list {\n    flex-direction: column;\n}\n\n.p-galleria-inset-indicators .p-galleria-indicator-list {\n    position: absolute;\n    display: flex;\n    z-index: 1;\n    background: ").concat(dt2("galleria.inset.indicator.list.background"), ";\n}\n\n.p-galleria-inset-indicators .p-galleria-indicator-button {\n    background: ").concat(dt2("galleria.inset.indicator.button.background"), ";\n}\n\n.p-galleria-inset-indicators .p-galleria-indicator-button:hover {\n    background: ").concat(dt2("galleria.inset.indicator.button.hover.background"), ";\n}\n\n.p-galleria-inset-indicators .p-galleria-indicator-active .p-galleria-indicator-button {\n    background: ").concat(dt2("galleria.inset.indicator.button.active.background"), ";\n}\n\n.p-galleria-inset-indicators.p-galleria-indicators-top .p-galleria-indicator-list {\n    top: 0;\n    left: 0;\n    width: 100%;\n    align-items: flex-start;\n}\n\n.p-galleria-inset-indicators.p-galleria-indicators-right .p-galleria-indicator-list {\n    right: 0;\n    top: 0;\n    height: 100%;\n    align-items: flex-end;\n}\n\n.p-galleria-inset-indicators.p-galleria-indicators-bottom .p-galleria-indicator-list {\n    bottom: 0;\n    left: 0;\n    width: 100%;\n    align-items: flex-end;\n}\n\n.p-galleria-inset-indicators.p-galleria-indicators-left .p-galleria-indicator-list {\n    left: 0;\n    top: 0;\n    height: 100%;\n    align-items: flex-start;\n}\n\n.p-galleria-mask {\n    position: fixed;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.p-galleria-close-button {\n    position: absolute;\n    top: 0;\n    right: 0;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    overflow: hidden;\n    margin: ").concat(dt2("galleria.close.button.gutter"), ";\n    background: ").concat(dt2("galleria.close.button.background"), ";\n    color: ").concat(dt2("galleria.close.button.color"), ";\n    width: ").concat(dt2("galleria.close.button.size"), ";\n    height: ").concat(dt2("galleria.close.button.size"), ";\n    padding: 0;\n    border: none;\n    user-select: none;\n    cursor: pointer;\n    border-radius: ").concat(dt2("galleria.close.button.border.radius"), ";\n    outline-color: transparent;\n    transition: background ").concat(dt2("galleria.transition.duration"), ", color ").concat(dt2("galleria.transition.duration"), ", outline-color ").concat(dt2("galleria.transition.duration"), ";\n}\n\n.p-galleria-close-icon {\n    font-size: ").concat(dt2("galleria.close.button.icon.size"), ";\n    width: ").concat(dt2("galleria.close.button.icon.size"), ";\n    height: ").concat(dt2("galleria.close.button.icon.size"), ";\n}\n\n.p-galleria-close-button:hover {\n    background: ").concat(dt2("galleria.close.button.hover.background"), ";\n    color: ").concat(dt2("galleria.close.button.hover.color"), ";\n}\n\n.p-galleria-close-button:focus-visible {\n    box-shadow: ").concat(dt2("galleria.close.button.focus.ring.shadow"), ";\n    outline: ").concat(dt2("galleria.close.button.focus.ring.width"), " ").concat(dt2("galleria.close.button.focus.ring.style"), " ").concat(dt2("galleria.close.button.focus.ring.color"), ";\n    outline-offset: ").concat(dt2("galleria.close.button.focus.ring.offset"), ";\n}\n\n.p-galleria-mask .p-galleria-nav-button {\n    position: fixed;\n    top: 50%;\n}\n\n.p-galleria-enter-active {\n    transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n\n.p-galleria-leave-active {\n    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.p-galleria-enter-from,\n.p-galleria-leave-to {\n    opacity: 0;\n    transform: scale(0.7);\n}\n\n.p-galleria-enter-active .p-galleria-nav-button {\n    opacity: 0;\n}\n\n.p-items-hidden .p-galleria-thumbnail-item {\n    visibility: hidden;\n}\n\n.p-items-hidden .p-galleria-thumbnail-item.p-galleria-thumbnail-item-active {\n    visibility: visible;\n}\n");
}, "theme");
var classes$1 = {
  mask: "p-galleria-mask p-overlay-mask p-overlay-mask-enter",
  root: /* @__PURE__ */ __name(function root23(_ref2) {
    var instance = _ref2.instance;
    var thumbnailsPosClass = instance.$attrs.showThumbnails && instance.getPositionClass("p-galleria-thumbnails", instance.$attrs.thumbnailsPosition);
    var indicatorPosClass = instance.$attrs.showIndicators && instance.getPositionClass("p-galleria-indicators", instance.$attrs.indicatorsPosition);
    return ["p-galleria p-component", {
      "p-galleria-fullscreen": instance.$attrs.fullScreen,
      "p-galleria-inset-indicators": instance.$attrs.showIndicatorsOnItem,
      "p-galleria-hover-navigators": instance.$attrs.showItemNavigatorsOnHover && !instance.$attrs.fullScreen
    }, thumbnailsPosClass, indicatorPosClass];
  }, "root"),
  closeButton: "p-galleria-close-button",
  closeIcon: "p-galleria-close-icon",
  header: "p-galleria-header",
  content: "p-galleria-content",
  footer: "p-galleria-footer",
  itemsContainer: "p-galleria-items-container",
  items: "p-galleria-items",
  prevButton: /* @__PURE__ */ __name(function prevButton(_ref3) {
    var instance = _ref3.instance;
    return ["p-galleria-prev-button p-galleria-nav-button", {
      "p-disabled": instance.isNavBackwardDisabled()
    }];
  }, "prevButton"),
  prevIcon: "p-galleria-prev-icon",
  item: "p-galleria-item",
  nextButton: /* @__PURE__ */ __name(function nextButton(_ref4) {
    var instance = _ref4.instance;
    return ["p-galleria-next-button p-galleria-nav-button", {
      "p-disabled": instance.isNavForwardDisabled()
    }];
  }, "nextButton"),
  nextIcon: "p-galleria-next-icon",
  caption: "p-galleria-caption",
  indicatorList: "p-galleria-indicator-list",
  indicator: /* @__PURE__ */ __name(function indicator2(_ref5) {
    var instance = _ref5.instance, index2 = _ref5.index;
    return ["p-galleria-indicator", {
      "p-galleria-indicator-active": instance.isIndicatorItemActive(index2)
    }];
  }, "indicator"),
  indicatorButton: "p-galleria-indicator-button",
  thumbnails: "p-galleria-thumbnails",
  thumbnailContent: "p-galleria-thumbnails-content",
  thumbnailPrevButton: /* @__PURE__ */ __name(function thumbnailPrevButton(_ref6) {
    var instance = _ref6.instance;
    return ["p-galleria-thumbnail-prev-button p-galleria-thumbnail-nav-button", {
      "p-disabled": instance.isNavBackwardDisabled()
    }];
  }, "thumbnailPrevButton"),
  thumbnailPrevIcon: "p-galleria-thumbnail-prev-icon",
  thumbnailsViewport: "p-galleria-thumbnails-viewport",
  thumbnailItems: "p-galleria-thumbnail-items",
  thumbnailItem: /* @__PURE__ */ __name(function thumbnailItem(_ref7) {
    var instance = _ref7.instance, index2 = _ref7.index, activeIndex3 = _ref7.activeIndex;
    return ["p-galleria-thumbnail-item", {
      "p-galleria-thumbnail-item-current": activeIndex3 === index2,
      "p-galleria-thumbnail-item-active": instance.isItemActive(index2),
      "p-galleria-thumbnail-item-start": instance.firstItemAciveIndex() === index2,
      "p-galleria-thumbnail-item-end": instance.lastItemActiveIndex() === index2
    }];
  }, "thumbnailItem"),
  thumbnail: "p-galleria-thumbnail",
  thumbnailNextButton: /* @__PURE__ */ __name(function thumbnailNextButton(_ref8) {
    var instance = _ref8.instance;
    return ["p-galleria-thumbnail-next-button  p-galleria-thumbnail-nav-button", {
      "p-disabled": instance.isNavForwardDisabled()
    }];
  }, "thumbnailNextButton"),
  thumbnailNextIcon: "p-galleria-thumbnail-next-icon"
};
var GalleriaStyle = BaseStyle.extend({
  name: "galleria",
  theme: theme$1,
  classes: classes$1
});
var script$4 = {
  name: "BaseGalleria",
  "extends": script$_,
  props: {
    id: {
      type: String,
      "default": null
    },
    value: {
      type: Array,
      "default": null
    },
    activeIndex: {
      type: Number,
      "default": 0
    },
    fullScreen: {
      type: Boolean,
      "default": false
    },
    visible: {
      type: Boolean,
      "default": false
    },
    numVisible: {
      type: Number,
      "default": 3
    },
    responsiveOptions: {
      type: Array,
      "default": null
    },
    showItemNavigators: {
      type: Boolean,
      "default": false
    },
    showThumbnailNavigators: {
      type: Boolean,
      "default": true
    },
    showItemNavigatorsOnHover: {
      type: Boolean,
      "default": false
    },
    changeItemOnIndicatorHover: {
      type: Boolean,
      "default": false
    },
    circular: {
      type: Boolean,
      "default": false
    },
    autoPlay: {
      type: Boolean,
      "default": false
    },
    transitionInterval: {
      type: Number,
      "default": 4e3
    },
    showThumbnails: {
      type: Boolean,
      "default": true
    },
    thumbnailsPosition: {
      type: String,
      "default": "bottom"
    },
    verticalThumbnailViewPortHeight: {
      type: String,
      "default": "300px"
    },
    showIndicators: {
      type: Boolean,
      "default": false
    },
    showIndicatorsOnItem: {
      type: Boolean,
      "default": false
    },
    indicatorsPosition: {
      type: String,
      "default": "bottom"
    },
    baseZIndex: {
      type: Number,
      "default": 0
    },
    maskClass: {
      type: String,
      "default": null
    },
    containerStyle: {
      type: null,
      "default": null
    },
    containerClass: {
      type: null,
      "default": null
    },
    containerProps: {
      type: null,
      "default": null
    },
    prevButtonProps: {
      type: null,
      "default": null
    },
    nextButtonProps: {
      type: null,
      "default": null
    },
    ariaLabel: {
      type: String,
      "default": null
    },
    ariaRoledescription: {
      type: String,
      "default": null
    }
  },
  style: GalleriaStyle,
  provide: /* @__PURE__ */ __name(function provide40() {
    return {
      $pcGalleria: this,
      $parentInstance: this
    };
  }, "provide")
};
function _toConsumableArray$1(r) {
  return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread$1();
}
__name(_toConsumableArray$1, "_toConsumableArray$1");
function _nonIterableSpread$1() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread$1, "_nonIterableSpread$1");
function _unsupportedIterableToArray$1(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$1(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray$1");
function _iterableToArray$1(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray$1, "_iterableToArray$1");
function _arrayWithoutHoles$1(r) {
  if (Array.isArray(r)) return _arrayLikeToArray$1(r);
}
__name(_arrayWithoutHoles$1, "_arrayWithoutHoles$1");
function _arrayLikeToArray$1(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray$1, "_arrayLikeToArray$1");
var script$3 = {
  name: "GalleriaItem",
  hostName: "Galleria",
  "extends": script$_,
  emits: ["start-slideshow", "stop-slideshow", "update:activeIndex"],
  props: {
    circular: {
      type: Boolean,
      "default": false
    },
    activeIndex: {
      type: Number,
      "default": 0
    },
    value: {
      type: Array,
      "default": null
    },
    showItemNavigators: {
      type: Boolean,
      "default": true
    },
    showIndicators: {
      type: Boolean,
      "default": true
    },
    slideShowActive: {
      type: Boolean,
      "default": true
    },
    changeItemOnIndicatorHover: {
      type: Boolean,
      "default": true
    },
    autoPlay: {
      type: Boolean,
      "default": false
    },
    templates: {
      type: null,
      "default": null
    },
    id: {
      type: String,
      "default": null
    }
  },
  mounted: /* @__PURE__ */ __name(function mounted19() {
    if (this.autoPlay) {
      this.$emit("start-slideshow");
    }
  }, "mounted"),
  methods: {
    getIndicatorPTOptions: /* @__PURE__ */ __name(function getIndicatorPTOptions2(index2) {
      return {
        context: {
          highlighted: this.activeIndex === index2
        }
      };
    }, "getIndicatorPTOptions"),
    next: /* @__PURE__ */ __name(function next() {
      var nextItemIndex = this.activeIndex + 1;
      var activeIndex3 = this.circular && this.value.length - 1 === this.activeIndex ? 0 : nextItemIndex;
      this.$emit("update:activeIndex", activeIndex3);
    }, "next"),
    prev: /* @__PURE__ */ __name(function prev() {
      var prevItemIndex = this.activeIndex !== 0 ? this.activeIndex - 1 : 0;
      var activeIndex3 = this.circular && this.activeIndex === 0 ? this.value.length - 1 : prevItemIndex;
      this.$emit("update:activeIndex", activeIndex3);
    }, "prev"),
    stopSlideShow: /* @__PURE__ */ __name(function stopSlideShow() {
      if (this.slideShowActive && this.stopSlideShow) {
        this.$emit("stop-slideshow");
      }
    }, "stopSlideShow"),
    navBackward: /* @__PURE__ */ __name(function navBackward2(e2) {
      this.stopSlideShow();
      this.prev();
      if (e2 && e2.cancelable) {
        e2.preventDefault();
      }
    }, "navBackward"),
    navForward: /* @__PURE__ */ __name(function navForward2(e2) {
      this.stopSlideShow();
      this.next();
      if (e2 && e2.cancelable) {
        e2.preventDefault();
      }
    }, "navForward"),
    onIndicatorClick: /* @__PURE__ */ __name(function onIndicatorClick2(index2) {
      this.stopSlideShow();
      this.$emit("update:activeIndex", index2);
    }, "onIndicatorClick"),
    onIndicatorMouseEnter: /* @__PURE__ */ __name(function onIndicatorMouseEnter(index2) {
      if (this.changeItemOnIndicatorHover) {
        this.stopSlideShow();
        this.$emit("update:activeIndex", index2);
      }
    }, "onIndicatorMouseEnter"),
    onIndicatorKeyDown: /* @__PURE__ */ __name(function onIndicatorKeyDown(event, index2) {
      switch (event.code) {
        case "Enter":
        case "NumpadEnter":
        case "Space":
          this.stopSlideShow();
          this.$emit("update:activeIndex", index2);
          event.preventDefault();
          break;
        case "ArrowRight":
          this.onRightKey();
          break;
        case "ArrowLeft":
          this.onLeftKey();
          break;
        case "Home":
          this.onHomeKey();
          event.preventDefault();
          break;
        case "End":
          this.onEndKey();
          event.preventDefault();
          break;
        case "Tab":
          this.onTabKey();
          break;
        case "ArrowDown":
        case "ArrowUp":
        case "PageUp":
        case "PageDown":
          event.preventDefault();
          break;
      }
    }, "onIndicatorKeyDown"),
    onRightKey: /* @__PURE__ */ __name(function onRightKey2() {
      var indicators = _toConsumableArray$1(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, activeIndex3 + 1 === indicators.length ? indicators.length - 1 : activeIndex3 + 1);
    }, "onRightKey"),
    onLeftKey: /* @__PURE__ */ __name(function onLeftKey2() {
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, activeIndex3 - 1 <= 0 ? 0 : activeIndex3 - 1);
    }, "onLeftKey"),
    onHomeKey: /* @__PURE__ */ __name(function onHomeKey5() {
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, 0);
    }, "onHomeKey"),
    onEndKey: /* @__PURE__ */ __name(function onEndKey5() {
      var indicators = _toConsumableArray$1(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, indicators.length - 1);
    }, "onEndKey"),
    onTabKey: /* @__PURE__ */ __name(function onTabKey5() {
      var indicators = _toConsumableArray$1(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      var highlightedIndex = indicators.findIndex(function(ind) {
        return getAttribute(ind, "data-p-active") === true;
      });
      var activeIndicator = findSingle(this.$refs.indicatorContent, '[data-pc-section="indicator"] > button[tabindex="0"]');
      var activeIndex3 = indicators.findIndex(function(ind) {
        return ind === activeIndicator.parentElement;
      });
      indicators[activeIndex3].children[0].tabIndex = "-1";
      indicators[highlightedIndex].children[0].tabIndex = "0";
    }, "onTabKey"),
    findFocusedIndicatorIndex: /* @__PURE__ */ __name(function findFocusedIndicatorIndex2() {
      var indicators = _toConsumableArray$1(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      var activeIndicator = findSingle(this.$refs.indicatorContent, '[data-pc-section="indicator"] > button[tabindex="0"]');
      return indicators.findIndex(function(ind) {
        return ind === activeIndicator.parentElement;
      });
    }, "findFocusedIndicatorIndex"),
    changedFocusedIndicator: /* @__PURE__ */ __name(function changedFocusedIndicator2(prevInd, nextInd) {
      var indicators = _toConsumableArray$1(find$1(this.$refs.indicatorContent, '[data-pc-section="indicator"]'));
      indicators[prevInd].children[0].tabIndex = "-1";
      indicators[nextInd].children[0].tabIndex = "0";
      indicators[nextInd].children[0].focus();
    }, "changedFocusedIndicator"),
    isIndicatorItemActive: /* @__PURE__ */ __name(function isIndicatorItemActive(index2) {
      return this.activeIndex === index2;
    }, "isIndicatorItemActive"),
    isNavBackwardDisabled: /* @__PURE__ */ __name(function isNavBackwardDisabled() {
      return !this.circular && this.activeIndex === 0;
    }, "isNavBackwardDisabled"),
    isNavForwardDisabled: /* @__PURE__ */ __name(function isNavForwardDisabled() {
      return !this.circular && this.activeIndex === this.value.length - 1;
    }, "isNavForwardDisabled"),
    ariaSlideNumber: /* @__PURE__ */ __name(function ariaSlideNumber2(value4) {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g, value4) : void 0;
    }, "ariaSlideNumber"),
    ariaPageLabel: /* @__PURE__ */ __name(function ariaPageLabel2(value4) {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g, value4) : void 0;
    }, "ariaPageLabel")
  },
  computed: {
    activeItem: /* @__PURE__ */ __name(function activeItem() {
      return this.value[this.activeIndex];
    }, "activeItem"),
    ariaSlideLabel: /* @__PURE__ */ __name(function ariaSlideLabel2() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.slide : void 0;
    }, "ariaSlideLabel")
  },
  components: {
    ChevronLeftIcon: script$v,
    ChevronRightIcon: script$u
  },
  directives: {
    ripple: Ripple
  }
};
var _hoisted_1$3$1 = ["disabled"];
var _hoisted_2$2$1 = ["id", "aria-label", "aria-roledescription"];
var _hoisted_3$2$1 = ["disabled"];
var _hoisted_4$1$1 = ["aria-label", "aria-selected", "aria-controls", "onClick", "onMouseenter", "onKeydown", "data-p-active"];
var _hoisted_5$2 = ["tabindex"];
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
  var _directive_ripple = resolveDirective("ripple");
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("itemsContainer")
  }, _ctx.ptm("itemsContainer")), [createBaseVNode("div", mergeProps({
    "class": _ctx.cx("items")
  }, _ctx.ptm("items")), [$props.showItemNavigators ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
    key: 0,
    type: "button",
    "class": _ctx.cx("prevButton"),
    onClick: _cache[0] || (_cache[0] = function($event) {
      return $options.navBackward($event);
    }),
    disabled: $options.isNavBackwardDisabled()
  }, _ctx.ptm("prevButton"), {
    "data-pc-group-section": "itemnavigator"
  }), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.previousitemicon || "ChevronLeftIcon"), mergeProps({
    "class": _ctx.cx("prevIcon")
  }, _ctx.ptm("prevIcon")), null, 16, ["class"]))], 16, _hoisted_1$3$1)), [[_directive_ripple]]) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    id: $props.id + "_item_" + $props.activeIndex,
    "class": _ctx.cx("item"),
    role: "group",
    "aria-label": $options.ariaSlideNumber($props.activeIndex + 1),
    "aria-roledescription": $options.ariaSlideLabel
  }, _ctx.ptm("item")), [$props.templates.item ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), {
    key: 0,
    item: $options.activeItem
  }, null, 8, ["item"])) : createCommentVNode("", true)], 16, _hoisted_2$2$1), $props.showItemNavigators ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
    key: 1,
    type: "button",
    "class": _ctx.cx("nextButton"),
    onClick: _cache[1] || (_cache[1] = function($event) {
      return $options.navForward($event);
    }),
    disabled: $options.isNavForwardDisabled()
  }, _ctx.ptm("nextButton"), {
    "data-pc-group-section": "itemnavigator"
  }), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.nextitemicon || "ChevronRightIcon"), mergeProps({
    "class": _ctx.cx("nextIcon")
  }, _ctx.ptm("nextIcon")), null, 16, ["class"]))], 16, _hoisted_3$2$1)), [[_directive_ripple]]) : createCommentVNode("", true), $props.templates["caption"] ? (openBlock(), createElementBlock("div", mergeProps({
    key: 2,
    "class": _ctx.cx("caption")
  }, _ctx.ptm("caption")), [$props.templates.caption ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.caption), {
    key: 0,
    item: $options.activeItem
  }, null, 8, ["item"])) : createCommentVNode("", true)], 16)) : createCommentVNode("", true)], 16), $props.showIndicators ? (openBlock(), createElementBlock("ul", mergeProps({
    key: 0,
    ref: "indicatorContent",
    "class": _ctx.cx("indicatorList")
  }, _ctx.ptm("indicatorList")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($props.value, function(item3, index2) {
    return openBlock(), createElementBlock("li", mergeProps({
      key: "p-galleria-indicator-".concat(index2),
      "class": _ctx.cx("indicator", {
        index: index2
      }),
      "aria-label": $options.ariaPageLabel(index2 + 1),
      "aria-selected": $props.activeIndex === index2,
      "aria-controls": $props.id + "_item_" + index2,
      onClick: /* @__PURE__ */ __name(function onClick3($event) {
        return $options.onIndicatorClick(index2);
      }, "onClick"),
      onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) {
        return $options.onIndicatorMouseEnter(index2);
      }, "onMouseenter"),
      onKeydown: /* @__PURE__ */ __name(function onKeydown3($event) {
        return $options.onIndicatorKeyDown($event, index2);
      }, "onKeydown"),
      ref_for: true
    }, _ctx.ptm("indicator", $options.getIndicatorPTOptions(index2)), {
      "data-p-active": $options.isIndicatorItemActive(index2)
    }), [!$props.templates["indicator"] ? (openBlock(), createElementBlock("button", mergeProps({
      key: 0,
      type: "button",
      tabindex: $props.activeIndex === index2 ? "0" : "-1",
      "class": _ctx.cx("indicatorButton"),
      ref_for: true
    }, _ctx.ptm("indicatorButton", $options.getIndicatorPTOptions(index2))), null, 16, _hoisted_5$2)) : createCommentVNode("", true), $props.templates.indicator ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.indicator), {
      key: 1,
      index: index2
    }, null, 8, ["index"])) : createCommentVNode("", true)], 16, _hoisted_4$1$1);
  }), 128))], 16)) : createCommentVNode("", true)], 16);
}
__name(render$3, "render$3");
script$3.render = render$3;
function _toConsumableArray(r) {
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}
__name(_toConsumableArray, "_toConsumableArray");
function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
__name(_nonIterableSpread, "_nonIterableSpread");
function _unsupportedIterableToArray(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray(r, a);
    var t2 = {}.toString.call(r).slice(8, -1);
    return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r, a) : void 0;
  }
}
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
function _iterableToArray(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
__name(_iterableToArray, "_iterableToArray");
function _arrayWithoutHoles(r) {
  if (Array.isArray(r)) return _arrayLikeToArray(r);
}
__name(_arrayWithoutHoles, "_arrayWithoutHoles");
function _arrayLikeToArray(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e2 = 0, n = Array(a); e2 < a; e2++) n[e2] = r[e2];
  return n;
}
__name(_arrayLikeToArray, "_arrayLikeToArray");
var script$2 = {
  name: "GalleriaThumbnails",
  hostName: "Galleria",
  "extends": script$_,
  emits: ["stop-slideshow", "update:activeIndex"],
  props: {
    containerId: {
      type: String,
      "default": null
    },
    value: {
      type: Array,
      "default": null
    },
    numVisible: {
      type: Number,
      "default": 3
    },
    activeIndex: {
      type: Number,
      "default": 0
    },
    isVertical: {
      type: Boolean,
      "default": false
    },
    slideShowActive: {
      type: Boolean,
      "default": false
    },
    circular: {
      type: Boolean,
      "default": false
    },
    responsiveOptions: {
      type: Array,
      "default": null
    },
    contentHeight: {
      type: String,
      "default": "300px"
    },
    showThumbnailNavigators: {
      type: Boolean,
      "default": true
    },
    templates: {
      type: null,
      "default": null
    },
    prevButtonProps: {
      type: null,
      "default": null
    },
    nextButtonProps: {
      type: null,
      "default": null
    }
  },
  startPos: null,
  thumbnailsStyle: null,
  sortedResponsiveOptions: null,
  data: /* @__PURE__ */ __name(function data20() {
    return {
      d_numVisible: this.numVisible,
      d_oldNumVisible: this.numVisible,
      d_activeIndex: this.activeIndex,
      d_oldActiveItemIndex: this.activeIndex,
      totalShiftedItems: 0,
      page: 0
    };
  }, "data"),
  watch: {
    numVisible: /* @__PURE__ */ __name(function numVisible2(newValue2, oldValue2) {
      this.d_numVisible = newValue2;
      this.d_oldNumVisible = oldValue2;
    }, "numVisible"),
    activeIndex: /* @__PURE__ */ __name(function activeIndex2(newValue2, oldValue2) {
      this.d_activeIndex = newValue2;
      this.d_oldActiveItemIndex = oldValue2;
    }, "activeIndex")
  },
  mounted: /* @__PURE__ */ __name(function mounted20() {
    this.createStyle();
    this.calculatePosition();
    if (this.responsiveOptions) {
      this.bindDocumentListeners();
    }
  }, "mounted"),
  updated: /* @__PURE__ */ __name(function updated10() {
    var totalShiftedItems = this.totalShiftedItems;
    if (this.d_oldNumVisible !== this.d_numVisible || this.d_oldActiveItemIndex !== this.d_activeIndex) {
      if (this.d_activeIndex <= this.getMedianItemIndex()) {
        totalShiftedItems = 0;
      } else if (this.value.length - this.d_numVisible + this.getMedianItemIndex() < this.d_activeIndex) {
        totalShiftedItems = this.d_numVisible - this.value.length;
      } else if (this.value.length - this.d_numVisible < this.d_activeIndex && this.d_numVisible % 2 === 0) {
        totalShiftedItems = this.d_activeIndex * -1 + this.getMedianItemIndex() + 1;
      } else {
        totalShiftedItems = this.d_activeIndex * -1 + this.getMedianItemIndex();
      }
      if (totalShiftedItems !== this.totalShiftedItems) {
        this.totalShiftedItems = totalShiftedItems;
      }
      this.$refs.itemsContainer.style.transform = this.isVertical ? "translate3d(0, ".concat(totalShiftedItems * (100 / this.d_numVisible), "%, 0)") : "translate3d(".concat(totalShiftedItems * (100 / this.d_numVisible), "%, 0, 0)");
      if (this.d_oldActiveItemIndex !== this.d_activeIndex) {
        document.body.setAttribute("data-p-items-hidden", "false");
        !this.isUnstyled && removeClass(this.$refs.itemsContainer, "p-items-hidden");
        this.$refs.itemsContainer.style.transition = "transform 500ms ease 0s";
      }
      this.d_oldActiveItemIndex = this.d_activeIndex;
      this.d_oldNumVisible = this.d_numVisible;
    }
  }, "updated"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount11() {
    if (this.responsiveOptions) {
      this.unbindDocumentListeners();
    }
    if (this.thumbnailsStyle) {
      this.thumbnailsStyle.parentNode.removeChild(this.thumbnailsStyle);
    }
  }, "beforeUnmount"),
  methods: {
    step: /* @__PURE__ */ __name(function step2(dir) {
      var totalShiftedItems = this.totalShiftedItems + dir;
      if (dir < 0 && -1 * totalShiftedItems + this.d_numVisible > this.value.length - 1) {
        totalShiftedItems = this.d_numVisible - this.value.length;
      } else if (dir > 0 && totalShiftedItems > 0) {
        totalShiftedItems = 0;
      }
      if (this.circular) {
        if (dir < 0 && this.value.length - 1 === this.d_activeIndex) {
          totalShiftedItems = 0;
        } else if (dir > 0 && this.d_activeIndex === 0) {
          totalShiftedItems = this.d_numVisible - this.value.length;
        }
      }
      if (this.$refs.itemsContainer) {
        document.body.setAttribute("data-p-items-hidden", "false");
        !this.isUnstyled && removeClass(this.$refs.itemsContainer, "p-items-hidden");
        this.$refs.itemsContainer.style.transform = this.isVertical ? "translate3d(0, ".concat(totalShiftedItems * (100 / this.d_numVisible), "%, 0)") : "translate3d(".concat(totalShiftedItems * (100 / this.d_numVisible), "%, 0, 0)");
        this.$refs.itemsContainer.style.transition = "transform 500ms ease 0s";
      }
      this.totalShiftedItems = totalShiftedItems;
    }, "step"),
    stopSlideShow: /* @__PURE__ */ __name(function stopSlideShow2() {
      if (this.slideShowActive && this.stopSlideShow) {
        this.$emit("stop-slideshow");
      }
    }, "stopSlideShow"),
    getMedianItemIndex: /* @__PURE__ */ __name(function getMedianItemIndex() {
      var index2 = Math.floor(this.d_numVisible / 2);
      return this.d_numVisible % 2 ? index2 : index2 - 1;
    }, "getMedianItemIndex"),
    navBackward: /* @__PURE__ */ __name(function navBackward3(e2) {
      this.stopSlideShow();
      var prevItemIndex = this.d_activeIndex !== 0 ? this.d_activeIndex - 1 : 0;
      var diff2 = prevItemIndex + this.totalShiftedItems;
      if (this.d_numVisible - diff2 - 1 > this.getMedianItemIndex() && (-1 * this.totalShiftedItems !== 0 || this.circular)) {
        this.step(1);
      }
      var activeIndex3 = this.circular && this.d_activeIndex === 0 ? this.value.length - 1 : prevItemIndex;
      this.$emit("update:activeIndex", activeIndex3);
      if (e2.cancelable) {
        e2.preventDefault();
      }
    }, "navBackward"),
    navForward: /* @__PURE__ */ __name(function navForward3(e2) {
      this.stopSlideShow();
      var nextItemIndex = this.d_activeIndex === this.value.length - 1 ? this.value.length - 1 : this.d_activeIndex + 1;
      if (nextItemIndex + this.totalShiftedItems > this.getMedianItemIndex() && (-1 * this.totalShiftedItems < this.getTotalPageNumber() - 1 || this.circular)) {
        this.step(-1);
      }
      var activeIndex3 = this.circular && this.value.length - 1 === this.d_activeIndex ? 0 : nextItemIndex;
      this.$emit("update:activeIndex", activeIndex3);
      if (e2.cancelable) {
        e2.preventDefault();
      }
    }, "navForward"),
    onItemClick: /* @__PURE__ */ __name(function onItemClick3(index2) {
      this.stopSlideShow();
      var selectedItemIndex = index2;
      if (selectedItemIndex !== this.d_activeIndex) {
        var diff2 = selectedItemIndex + this.totalShiftedItems;
        var dir = 0;
        if (selectedItemIndex < this.d_activeIndex) {
          dir = this.d_numVisible - diff2 - 1 - this.getMedianItemIndex();
          if (dir > 0 && -1 * this.totalShiftedItems !== 0) {
            this.step(dir);
          }
        } else {
          dir = this.getMedianItemIndex() - diff2;
          if (dir < 0 && -1 * this.totalShiftedItems < this.getTotalPageNumber() - 1) {
            this.step(dir);
          }
        }
        this.$emit("update:activeIndex", selectedItemIndex);
      }
    }, "onItemClick"),
    onThumbnailKeydown: /* @__PURE__ */ __name(function onThumbnailKeydown(event, index2) {
      if (event.code === "Enter" || event.code === "NumpadEnter" || event.code === "Space") {
        this.onItemClick(index2);
        event.preventDefault();
      }
      switch (event.code) {
        case "ArrowRight":
          this.onRightKey();
          break;
        case "ArrowLeft":
          this.onLeftKey();
          break;
        case "Home":
          this.onHomeKey();
          event.preventDefault();
          break;
        case "End":
          this.onEndKey();
          event.preventDefault();
          break;
        case "ArrowUp":
        case "ArrowDown":
          event.preventDefault();
          break;
        case "Tab":
          this.onTabKey();
          break;
      }
    }, "onThumbnailKeydown"),
    onRightKey: /* @__PURE__ */ __name(function onRightKey3() {
      var indicators = find$1(this.$refs.itemsContainer, '[data-pc-section="thumbnailitem"]');
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, activeIndex3 + 1 === indicators.length ? indicators.length - 1 : activeIndex3 + 1);
    }, "onRightKey"),
    onLeftKey: /* @__PURE__ */ __name(function onLeftKey3() {
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, activeIndex3 - 1 <= 0 ? 0 : activeIndex3 - 1);
    }, "onLeftKey"),
    onHomeKey: /* @__PURE__ */ __name(function onHomeKey6() {
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, 0);
    }, "onHomeKey"),
    onEndKey: /* @__PURE__ */ __name(function onEndKey6() {
      var indicators = find$1(this.$refs.itemsContainer, '[data-pc-section="thumbnailitem"]');
      var activeIndex3 = this.findFocusedIndicatorIndex();
      this.changedFocusedIndicator(activeIndex3, indicators.length - 1);
    }, "onEndKey"),
    onTabKey: /* @__PURE__ */ __name(function onTabKey6() {
      var indicators = _toConsumableArray(find$1(this.$refs.itemsContainer, '[data-pc-section="thumbnailitem"]'));
      var highlightedIndex = indicators.findIndex(function(ind) {
        return getAttribute(ind, "data-p-active") === true;
      });
      var activeIndicator = findSingle(this.$refs.itemsContainer, '[tabindex="0"]');
      var activeIndex3 = indicators.findIndex(function(ind) {
        return ind === activeIndicator.parentElement;
      });
      indicators[activeIndex3].children[0].tabIndex = "-1";
      indicators[highlightedIndex].children[0].tabIndex = "0";
    }, "onTabKey"),
    findFocusedIndicatorIndex: /* @__PURE__ */ __name(function findFocusedIndicatorIndex3() {
      var indicators = _toConsumableArray(find$1(this.$refs.itemsContainer, '[data-pc-section="thumbnailitem"]'));
      var activeIndicator = findSingle(this.$refs.itemsContainer, '[data-pc-section="thumbnailitem"] > [tabindex="0"]');
      return indicators.findIndex(function(ind) {
        return ind === activeIndicator.parentElement;
      });
    }, "findFocusedIndicatorIndex"),
    changedFocusedIndicator: /* @__PURE__ */ __name(function changedFocusedIndicator3(prevInd, nextInd) {
      var indicators = find$1(this.$refs.itemsContainer, '[data-pc-section="thumbnailitem"]');
      indicators[prevInd].children[0].tabIndex = "-1";
      indicators[nextInd].children[0].tabIndex = "0";
      indicators[nextInd].children[0].focus();
    }, "changedFocusedIndicator"),
    onTransitionEnd: /* @__PURE__ */ __name(function onTransitionEnd2(e2) {
      if (this.$refs.itemsContainer && e2.propertyName === "transform") {
        document.body.setAttribute("data-p-items-hidden", "true");
        !this.isUnstyled && addClass(this.$refs.itemsContainer, "p-items-hidden");
        this.$refs.itemsContainer.style.transition = "";
      }
    }, "onTransitionEnd"),
    onTouchStart: /* @__PURE__ */ __name(function onTouchStart2(e2) {
      var touchobj = e2.changedTouches[0];
      this.startPos = {
        x: touchobj.pageX,
        y: touchobj.pageY
      };
    }, "onTouchStart"),
    onTouchMove: /* @__PURE__ */ __name(function onTouchMove2(e2) {
      if (e2.cancelable) {
        e2.preventDefault();
      }
    }, "onTouchMove"),
    onTouchEnd: /* @__PURE__ */ __name(function onTouchEnd3(e2) {
      var touchobj = e2.changedTouches[0];
      if (this.isVertical) {
        this.changePageOnTouch(e2, touchobj.pageY - this.startPos.y);
      } else {
        this.changePageOnTouch(e2, touchobj.pageX - this.startPos.x);
      }
    }, "onTouchEnd"),
    changePageOnTouch: /* @__PURE__ */ __name(function changePageOnTouch2(e2, diff2) {
      if (diff2 < 0) {
        this.navForward(e2);
      } else {
        this.navBackward(e2);
      }
    }, "changePageOnTouch"),
    getTotalPageNumber: /* @__PURE__ */ __name(function getTotalPageNumber() {
      return this.value.length > this.d_numVisible ? this.value.length - this.d_numVisible + 1 : 0;
    }, "getTotalPageNumber"),
    createStyle: /* @__PURE__ */ __name(function createStyle4() {
      if (!this.thumbnailsStyle) {
        var _this$$primevue;
        this.thumbnailsStyle = document.createElement("style");
        this.thumbnailsStyle.type = "text/css";
        setAttribute(this.thumbnailsStyle, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
        document.body.appendChild(this.thumbnailsStyle);
      }
      var innerHTML = "\n                #".concat(this.containerId, ' [data-pc-section="thumbnailitem"] {\n                    flex: 1 0 ').concat(100 / this.d_numVisible, "%\n                }\n            ");
      if (this.responsiveOptions && !this.isUnstyled) {
        this.sortedResponsiveOptions = _toConsumableArray(this.responsiveOptions);
        var comparer = localeComparator();
        this.sortedResponsiveOptions.sort(function(data1, data24) {
          var value1 = data1.breakpoint;
          var value22 = data24.breakpoint;
          return sort(value1, value22, -1, comparer);
        });
        for (var i2 = 0; i2 < this.sortedResponsiveOptions.length; i2++) {
          var res = this.sortedResponsiveOptions[i2];
          innerHTML += "\n                        @media screen and (max-width: ".concat(res.breakpoint, ") {\n                            #").concat(this.containerId, " .p-galleria-thumbnail-item {\n                                flex: 1 0 ").concat(100 / res.numVisible, "%\n                            }\n                        }\n                    ");
        }
      }
      this.thumbnailsStyle.innerHTML = innerHTML;
    }, "createStyle"),
    calculatePosition: /* @__PURE__ */ __name(function calculatePosition2() {
      if (this.$refs.itemsContainer && this.sortedResponsiveOptions) {
        var windowWidth = window.innerWidth;
        var matchedResponsiveData = {
          numVisible: this.numVisible
        };
        for (var i2 = 0; i2 < this.sortedResponsiveOptions.length; i2++) {
          var res = this.sortedResponsiveOptions[i2];
          if (parseInt(res.breakpoint, 10) >= windowWidth) {
            matchedResponsiveData = res;
          }
        }
        if (this.d_numVisible !== matchedResponsiveData.numVisible) {
          this.d_numVisible = matchedResponsiveData.numVisible;
        }
      }
    }, "calculatePosition"),
    bindDocumentListeners: /* @__PURE__ */ __name(function bindDocumentListeners2() {
      var _this = this;
      if (!this.documentResizeListener) {
        this.documentResizeListener = function() {
          _this.calculatePosition();
        };
        window.addEventListener("resize", this.documentResizeListener);
      }
    }, "bindDocumentListeners"),
    unbindDocumentListeners: /* @__PURE__ */ __name(function unbindDocumentListeners2() {
      if (this.documentResizeListener) {
        window.removeEventListener("resize", this.documentResizeListener);
        this.documentResizeListener = null;
      }
    }, "unbindDocumentListeners"),
    isNavBackwardDisabled: /* @__PURE__ */ __name(function isNavBackwardDisabled2() {
      return !this.circular && this.d_activeIndex === 0 || this.value.length <= this.d_numVisible;
    }, "isNavBackwardDisabled"),
    isNavForwardDisabled: /* @__PURE__ */ __name(function isNavForwardDisabled2() {
      return !this.circular && this.d_activeIndex === this.value.length - 1 || this.value.length <= this.d_numVisible;
    }, "isNavForwardDisabled"),
    firstItemAciveIndex: /* @__PURE__ */ __name(function firstItemAciveIndex() {
      return this.totalShiftedItems * -1;
    }, "firstItemAciveIndex"),
    lastItemActiveIndex: /* @__PURE__ */ __name(function lastItemActiveIndex() {
      return this.firstItemAciveIndex() + this.d_numVisible - 1;
    }, "lastItemActiveIndex"),
    isItemActive: /* @__PURE__ */ __name(function isItemActive2(index2) {
      return this.firstItemAciveIndex() <= index2 && this.lastItemActiveIndex() >= index2;
    }, "isItemActive"),
    ariaPageLabel: /* @__PURE__ */ __name(function ariaPageLabel3(value4) {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g, value4) : void 0;
    }, "ariaPageLabel")
  },
  computed: {
    ariaPrevButtonLabel: /* @__PURE__ */ __name(function ariaPrevButtonLabel2() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.prevPageLabel : void 0;
    }, "ariaPrevButtonLabel"),
    ariaNextButtonLabel: /* @__PURE__ */ __name(function ariaNextButtonLabel2() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.nextPageLabel : void 0;
    }, "ariaNextButtonLabel")
  },
  components: {
    ChevronLeftIcon: script$v,
    ChevronRightIcon: script$u,
    ChevronUpIcon: script$h,
    ChevronDownIcon: script$p
  },
  directives: {
    ripple: Ripple
  }
};
function _typeof$2(o) {
  "@babel/helpers - typeof";
  return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$2(o);
}
__name(_typeof$2, "_typeof$2");
function ownKeys$2(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$2, "ownKeys$2");
function _objectSpread$2(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$2(Object(t2), true).forEach(function(r2) {
      _defineProperty$2(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$2(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$2, "_objectSpread$2");
function _defineProperty$2(e2, r, t2) {
  return (r = _toPropertyKey$2(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$2, "_defineProperty$2");
function _toPropertyKey$2(t2) {
  var i2 = _toPrimitive$2(t2, "string");
  return "symbol" == _typeof$2(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$2, "_toPropertyKey$2");
function _toPrimitive$2(t2, r) {
  if ("object" != _typeof$2(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$2(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$2, "_toPrimitive$2");
var _hoisted_1$2$1 = ["disabled", "aria-label"];
var _hoisted_2$1$1 = ["data-p-active", "aria-selected", "aria-controls", "onKeydown", "data-p-galleria-thumbnail-item-current", "data-p-galleria-thumbnail-item-active", "data-p-galleria-thumbnail-item-start", "data-p-galleria-thumbnail-item-end"];
var _hoisted_3$1$1 = ["tabindex", "aria-label", "aria-current", "onClick"];
var _hoisted_4$3 = ["disabled", "aria-label"];
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
  var _directive_ripple = resolveDirective("ripple");
  return openBlock(), createElementBlock("div", mergeProps({
    "class": _ctx.cx("thumbnails")
  }, _ctx.ptm("thumbnails")), [createBaseVNode("div", mergeProps({
    "class": _ctx.cx("thumbnailContent")
  }, _ctx.ptm("thumbnailContent")), [$props.showThumbnailNavigators ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
    key: 0,
    "class": _ctx.cx("thumbnailPrevButton"),
    disabled: $options.isNavBackwardDisabled(),
    type: "button",
    "aria-label": $options.ariaPrevButtonLabel,
    onClick: _cache[0] || (_cache[0] = function($event) {
      return $options.navBackward($event);
    })
  }, _objectSpread$2(_objectSpread$2({}, $props.prevButtonProps), _ctx.ptm("thumbnailPrevButton")), {
    "data-pc-group-section": "thumbnailnavigator"
  }), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.previousthumbnailicon || ($props.isVertical ? "ChevronUpIcon" : "ChevronLeftIcon")), mergeProps({
    "class": _ctx.cx("thumbnailPrevIcon")
  }, _ctx.ptm("thumbnailPrevIcon")), null, 16, ["class"]))], 16, _hoisted_1$2$1)), [[_directive_ripple]]) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("thumbnailsViewport"),
    style: {
      height: $props.isVertical ? $props.contentHeight : ""
    }
  }, _ctx.ptm("thumbnailsViewport")), [createBaseVNode("div", mergeProps({
    ref: "itemsContainer",
    "class": _ctx.cx("thumbnailItems"),
    role: "tablist",
    onTransitionend: _cache[1] || (_cache[1] = function($event) {
      return $options.onTransitionEnd($event);
    }),
    onTouchstart: _cache[2] || (_cache[2] = function($event) {
      return $options.onTouchStart($event);
    }),
    onTouchmove: _cache[3] || (_cache[3] = function($event) {
      return $options.onTouchMove($event);
    }),
    onTouchend: _cache[4] || (_cache[4] = function($event) {
      return $options.onTouchEnd($event);
    })
  }, _ctx.ptm("thumbnailItems")), [(openBlock(true), createElementBlock(Fragment$1, null, renderList($props.value, function(item3, index2) {
    return openBlock(), createElementBlock("div", mergeProps({
      key: "p-galleria-thumbnail-item-".concat(index2),
      "class": _ctx.cx("thumbnailItem", {
        index: index2,
        activeIndex: $props.activeIndex
      }),
      role: "tab",
      "data-p-active": $props.activeIndex === index2,
      "aria-selected": $props.activeIndex === index2,
      "aria-controls": $props.containerId + "_item_" + index2,
      onKeydown: /* @__PURE__ */ __name(function onKeydown3($event) {
        return $options.onThumbnailKeydown($event, index2);
      }, "onKeydown"),
      ref_for: true
    }, _ctx.ptm("thumbnailItem"), {
      "data-p-galleria-thumbnail-item-current": $props.activeIndex === index2,
      "data-p-galleria-thumbnail-item-active": $options.isItemActive(index2),
      "data-p-galleria-thumbnail-item-start": $options.firstItemAciveIndex() === index2,
      "data-p-galleria-thumbnail-item-end": $options.lastItemActiveIndex() === index2
    }), [createBaseVNode("div", mergeProps({
      "class": _ctx.cx("thumbnail"),
      tabindex: $props.activeIndex === index2 ? "0" : "-1",
      "aria-label": $options.ariaPageLabel(index2 + 1),
      "aria-current": $props.activeIndex === index2 ? "page" : void 0,
      onClick: /* @__PURE__ */ __name(function onClick3($event) {
        return $options.onItemClick(index2);
      }, "onClick"),
      ref_for: true
    }, _ctx.ptm("thumbnail")), [$props.templates.thumbnail ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.thumbnail), {
      key: 0,
      item: item3
    }, null, 8, ["item"])) : createCommentVNode("", true)], 16, _hoisted_3$1$1)], 16, _hoisted_2$1$1);
  }), 128))], 16)], 16), $props.showThumbnailNavigators ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
    key: 1,
    "class": _ctx.cx("thumbnailNextButton"),
    disabled: $options.isNavForwardDisabled(),
    type: "button",
    "aria-label": $options.ariaNextButtonLabel,
    onClick: _cache[5] || (_cache[5] = function($event) {
      return $options.navForward($event);
    })
  }, _objectSpread$2(_objectSpread$2({}, $props.nextButtonProps), _ctx.ptm("thumbnailNextButton")), {
    "data-pc-group-section": "thumbnailnavigator"
  }), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.nextthumbnailicon || ($props.isVertical ? "ChevronDownIcon" : "ChevronRightIcon")), mergeProps({
    "class": _ctx.cx("thumbnailNextIcon")
  }, _ctx.ptm("thumbnailNextIcon")), null, 16, ["class"]))], 16, _hoisted_4$3)), [[_directive_ripple]]) : createCommentVNode("", true)], 16)], 16);
}
__name(render$2, "render$2");
script$2.render = render$2;
function _typeof$1(o) {
  "@babel/helpers - typeof";
  return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof$1(o);
}
__name(_typeof$1, "_typeof$1");
function ownKeys$1(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys$1, "ownKeys$1");
function _objectSpread$1(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys$1(Object(t2), true).forEach(function(r2) {
      _defineProperty$1(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread$1, "_objectSpread$1");
function _defineProperty$1(e2, r, t2) {
  return (r = _toPropertyKey$1(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty$1, "_defineProperty$1");
function _toPropertyKey$1(t2) {
  var i2 = _toPrimitive$1(t2, "string");
  return "symbol" == _typeof$1(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey$1, "_toPropertyKey$1");
function _toPrimitive$1(t2, r) {
  if ("object" != _typeof$1(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof$1(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive$1, "_toPrimitive$1");
var script$1$1 = {
  name: "GalleriaContent",
  hostName: "Galleria",
  "extends": script$_,
  inheritAttrs: false,
  interval: null,
  emits: ["activeitem-change", "mask-hide"],
  data: /* @__PURE__ */ __name(function data21() {
    return {
      id: this.$attrs.id || UniqueComponentId(),
      activeIndex: this.$attrs.activeIndex,
      numVisible: this.$attrs.numVisible,
      slideShowActive: false
    };
  }, "data"),
  watch: {
    "$attrs.id": /* @__PURE__ */ __name(function $attrsId8(newValue2) {
      this.id = newValue2 || UniqueComponentId();
    }, "$attrsId"),
    "$attrs.value": /* @__PURE__ */ __name(function $attrsValue(newVal) {
      if (newVal && newVal.length < this.numVisible) {
        this.numVisible = newVal.length;
      }
    }, "$attrsValue"),
    "$attrs.activeIndex": /* @__PURE__ */ __name(function $attrsActiveIndex(newVal) {
      this.activeIndex = newVal;
    }, "$attrsActiveIndex"),
    "$attrs.numVisible": /* @__PURE__ */ __name(function $attrsNumVisible(newVal) {
      this.numVisible = newVal;
    }, "$attrsNumVisible"),
    "$attrs.autoPlay": /* @__PURE__ */ __name(function $attrsAutoPlay(newVal) {
      newVal ? this.startSlideShow() : this.stopSlideShow();
    }, "$attrsAutoPlay")
  },
  mounted: /* @__PURE__ */ __name(function mounted21() {
    this.id = this.id || UniqueComponentId();
  }, "mounted"),
  updated: /* @__PURE__ */ __name(function updated11() {
    this.$emit("activeitem-change", this.activeIndex);
  }, "updated"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount12() {
    if (this.slideShowActive) {
      this.stopSlideShow();
    }
  }, "beforeUnmount"),
  methods: {
    getPTOptions: /* @__PURE__ */ __name(function getPTOptions10(key) {
      return this.ptm(key, {
        props: _objectSpread$1(_objectSpread$1({}, this.$attrs), {}, {
          pt: this.pt,
          unstyled: this.unstyled
        })
      });
    }, "getPTOptions"),
    isAutoPlayActive: /* @__PURE__ */ __name(function isAutoPlayActive() {
      return this.slideShowActive;
    }, "isAutoPlayActive"),
    startSlideShow: /* @__PURE__ */ __name(function startSlideShow() {
      var _this = this;
      this.interval = setInterval(function() {
        var activeIndex3 = _this.$attrs.circular && _this.$attrs.value.length - 1 === _this.activeIndex ? 0 : _this.activeIndex + 1;
        _this.activeIndex = activeIndex3;
      }, this.$attrs.transitionInterval);
      this.slideShowActive = true;
    }, "startSlideShow"),
    stopSlideShow: /* @__PURE__ */ __name(function stopSlideShow3() {
      if (this.interval) {
        clearInterval(this.interval);
      }
      this.slideShowActive = false;
    }, "stopSlideShow"),
    getPositionClass: /* @__PURE__ */ __name(function getPositionClass(preClassName, position3) {
      var positions = ["top", "left", "bottom", "right"];
      var pos2 = positions.find(function(item3) {
        return item3 === position3;
      });
      return pos2 ? "".concat(preClassName, "-").concat(pos2) : "";
    }, "getPositionClass"),
    isVertical: /* @__PURE__ */ __name(function isVertical4() {
      return this.$attrs.thumbnailsPosition === "left" || this.$attrs.thumbnailsPosition === "right";
    }, "isVertical")
  },
  computed: {
    closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel3() {
      return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0;
    }, "closeAriaLabel")
  },
  components: {
    GalleriaItem: script$3,
    GalleriaThumbnails: script$2,
    TimesIcon: script$W
  },
  directives: {
    ripple: Ripple
  }
};
function _typeof(o) {
  "@babel/helpers - typeof";
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof(o);
}
__name(_typeof, "_typeof");
function ownKeys(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
__name(ownKeys, "ownKeys");
function _objectSpread(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys(Object(t2), true).forEach(function(r2) {
      _defineProperty(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
__name(_objectSpread, "_objectSpread");
function _defineProperty(e2, r, t2) {
  return (r = _toPropertyKey(r)) in e2 ? Object.defineProperty(e2, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r] = t2, e2;
}
__name(_defineProperty, "_defineProperty");
function _toPropertyKey(t2) {
  var i2 = _toPrimitive(t2, "string");
  return "symbol" == _typeof(i2) ? i2 : i2 + "";
}
__name(_toPropertyKey, "_toPropertyKey");
function _toPrimitive(t2, r) {
  if ("object" != _typeof(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r || "default");
    if ("object" != _typeof(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
__name(_toPrimitive, "_toPrimitive");
var _hoisted_1$1$1 = ["id", "aria-label", "aria-roledescription"];
var _hoisted_2$7 = ["aria-label"];
var _hoisted_3$4 = ["aria-live"];
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_GalleriaItem = resolveComponent("GalleriaItem");
  var _component_GalleriaThumbnails = resolveComponent("GalleriaThumbnails");
  var _directive_ripple = resolveDirective("ripple");
  return _ctx.$attrs.value && _ctx.$attrs.value.length > 0 ? (openBlock(), createElementBlock("div", mergeProps({
    key: 0,
    id: $data.id,
    role: "region",
    "class": [_ctx.cx("root"), _ctx.$attrs.containerClass],
    style: _ctx.$attrs.containerStyle,
    "aria-label": _ctx.$attrs.ariaLabel,
    "aria-roledescription": _ctx.$attrs.ariaRoledescription
  }, _objectSpread(_objectSpread({}, _ctx.$attrs.containerProps), $options.getPTOptions("root"))), [_ctx.$attrs.fullScreen ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
    key: 0,
    autofocus: "",
    type: "button",
    "class": _ctx.cx("closeButton"),
    "aria-label": $options.closeAriaLabel,
    onClick: _cache[0] || (_cache[0] = function($event) {
      return _ctx.$emit("mask-hide");
    })
  }, $options.getPTOptions("closeButton")), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$attrs.templates["closeicon"] || "TimesIcon"), mergeProps({
    "class": _ctx.cx("closeIcon")
  }, $options.getPTOptions("closeIcon")), null, 16, ["class"]))], 16, _hoisted_2$7)), [[_directive_ripple]]) : createCommentVNode("", true), _ctx.$attrs.templates && _ctx.$attrs.templates["header"] ? (openBlock(), createElementBlock("div", mergeProps({
    key: 1,
    "class": _ctx.cx("header")
  }, $options.getPTOptions("header")), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$attrs.templates["header"])))], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
    "class": _ctx.cx("content"),
    "aria-live": _ctx.$attrs.autoPlay ? "polite" : "off"
  }, $options.getPTOptions("content")), [createVNode(_component_GalleriaItem, {
    id: $data.id,
    activeIndex: $data.activeIndex,
    "onUpdate:activeIndex": _cache[1] || (_cache[1] = function($event) {
      return $data.activeIndex = $event;
    }),
    slideShowActive: $data.slideShowActive,
    "onUpdate:slideShowActive": _cache[2] || (_cache[2] = function($event) {
      return $data.slideShowActive = $event;
    }),
    value: _ctx.$attrs.value,
    circular: _ctx.$attrs.circular,
    templates: _ctx.$attrs.templates,
    showIndicators: _ctx.$attrs.showIndicators,
    changeItemOnIndicatorHover: _ctx.$attrs.changeItemOnIndicatorHover,
    showItemNavigators: _ctx.$attrs.showItemNavigators,
    autoPlay: _ctx.$attrs.autoPlay,
    onStartSlideshow: $options.startSlideShow,
    onStopSlideshow: $options.stopSlideShow,
    pt: _ctx.pt,
    unstyled: _ctx.unstyled
  }, null, 8, ["id", "activeIndex", "slideShowActive", "value", "circular", "templates", "showIndicators", "changeItemOnIndicatorHover", "showItemNavigators", "autoPlay", "onStartSlideshow", "onStopSlideshow", "pt", "unstyled"]), _ctx.$attrs.showThumbnails ? (openBlock(), createBlock(_component_GalleriaThumbnails, {
    key: 0,
    activeIndex: $data.activeIndex,
    "onUpdate:activeIndex": _cache[3] || (_cache[3] = function($event) {
      return $data.activeIndex = $event;
    }),
    slideShowActive: $data.slideShowActive,
    "onUpdate:slideShowActive": _cache[4] || (_cache[4] = function($event) {
      return $data.slideShowActive = $event;
    }),
    containerId: $data.id,
    value: _ctx.$attrs.value,
    templates: _ctx.$attrs.templates,
    numVisible: $data.numVisible,
    responsiveOptions: _ctx.$attrs.responsiveOptions,
    circular: _ctx.$attrs.circular,
    isVertical: $options.isVertical(),
    contentHeight: _ctx.$attrs.verticalThumbnailViewPortHeight,
    showThumbnailNavigators: _ctx.$attrs.showThumbnailNavigators,
    prevButtonProps: _ctx.$attrs.prevButtonProps,
    nextButtonProps: _ctx.$attrs.nextButtonProps,
    onStopSlideshow: $options.stopSlideShow,
    pt: _ctx.pt,
    unstyled: _ctx.unstyled
  }, null, 8, ["activeIndex", "slideShowActive", "containerId", "value", "templates", "numVisible", "responsiveOptions", "circular", "isVertical", "contentHeight", "showThumbnailNavigators", "prevButtonProps", "nextButtonProps", "onStopSlideshow", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_3$4), _ctx.$attrs.templates && _ctx.$attrs.templates["footer"] ? (openBlock(), createElementBlock("div", mergeProps({
    key: 2,
    "class": _ctx.cx("footer")
  }, $options.getPTOptions("footer")), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$attrs.templates["footer"])))], 16)) : createCommentVNode("", true)], 16, _hoisted_1$1$1)) : createCommentVNode("", true);
}
__name(render$1, "render$1");
script$1$1.render = render$1;
var script$5 = {
  name: "Galleria",
  "extends": script$4,
  inheritAttrs: false,
  emits: ["update:activeIndex", "update:visible"],
  container: null,
  mask: null,
  data: /* @__PURE__ */ __name(function data22() {
    return {
      containerVisible: this.visible
    };
  }, "data"),
  updated: /* @__PURE__ */ __name(function updated12() {
    if (this.fullScreen && this.visible) {
      this.containerVisible = this.visible;
    }
  }, "updated"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount13() {
    if (this.fullScreen) {
      unblockBodyScroll();
    }
    this.mask = null;
    if (this.container) {
      ZIndex.clear(this.container);
      this.container = null;
    }
  }, "beforeUnmount"),
  methods: {
    onBeforeEnter: /* @__PURE__ */ __name(function onBeforeEnter2(el) {
      ZIndex.set("modal", el, this.baseZIndex || this.$primevue.config.zIndex.modal);
    }, "onBeforeEnter"),
    onEnter: /* @__PURE__ */ __name(function onEnter6(el) {
      this.mask.style.zIndex = String(parseInt(el.style.zIndex, 10) - 1);
      blockBodyScroll();
      this.focus();
    }, "onEnter"),
    onBeforeLeave: /* @__PURE__ */ __name(function onBeforeLeave2() {
      !this.isUnstyled && addClass(this.mask, "p-overlay-mask-leave");
    }, "onBeforeLeave"),
    onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave5(el) {
      ZIndex.clear(el);
      this.containerVisible = false;
      unblockBodyScroll();
    }, "onAfterLeave"),
    onActiveItemChange: /* @__PURE__ */ __name(function onActiveItemChange(index2) {
      if (this.activeIndex !== index2) {
        this.$emit("update:activeIndex", index2);
      }
    }, "onActiveItemChange"),
    maskHide: /* @__PURE__ */ __name(function maskHide() {
      this.$emit("update:visible", false);
    }, "maskHide"),
    containerRef: /* @__PURE__ */ __name(function containerRef5(el) {
      this.container = el;
    }, "containerRef"),
    maskRef: /* @__PURE__ */ __name(function maskRef2(el) {
      this.mask = el;
    }, "maskRef"),
    focus: /* @__PURE__ */ __name(function focus4() {
      var focusTarget = this.container.$el.querySelector("[autofocus]");
      if (focusTarget) {
        focusTarget.focus();
      }
    }, "focus")
  },
  components: {
    GalleriaContent: script$1$1,
    Portal: script$Q
  },
  directives: {
    focustrap: FocusTrap
  }
};
var _hoisted_1$7 = ["aria-modal"];
function render$4(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_GalleriaContent = resolveComponent("GalleriaContent");
  var _component_Portal = resolveComponent("Portal");
  var _directive_focustrap = resolveDirective("focustrap");
  return _ctx.fullScreen ? (openBlock(), createBlock(_component_Portal, {
    key: 0
  }, {
    "default": withCtx(function() {
      return [$data.containerVisible ? (openBlock(), createElementBlock("div", mergeProps({
        key: 0,
        ref: $options.maskRef,
        "class": [_ctx.cx("mask"), _ctx.maskClass],
        role: "dialog",
        "aria-modal": _ctx.fullScreen ? "true" : void 0
      }, _ctx.ptm("mask")), [createVNode(Transition, mergeProps({
        name: "p-galleria",
        onBeforeEnter: $options.onBeforeEnter,
        onEnter: $options.onEnter,
        onBeforeLeave: $options.onBeforeLeave,
        onAfterLeave: $options.onAfterLeave,
        appear: ""
      }, _ctx.ptm("transition")), {
        "default": withCtx(function() {
          return [_ctx.visible ? withDirectives((openBlock(), createBlock(_component_GalleriaContent, mergeProps({
            key: 0,
            ref: $options.containerRef,
            onMaskHide: $options.maskHide,
            templates: _ctx.$slots,
            onActiveitemChange: $options.onActiveItemChange,
            pt: _ctx.pt,
            unstyled: _ctx.unstyled
          }, _ctx.$props), null, 16, ["onMaskHide", "templates", "onActiveitemChange", "pt", "unstyled"])), [[_directive_focustrap]]) : createCommentVNode("", true)];
        }),
        _: 1
      }, 16, ["onBeforeEnter", "onEnter", "onBeforeLeave", "onAfterLeave"])], 16, _hoisted_1$7)) : createCommentVNode("", true)];
    }),
    _: 1
  })) : (openBlock(), createBlock(_component_GalleriaContent, mergeProps({
    key: 1,
    templates: _ctx.$slots,
    onActiveitemChange: $options.onActiveItemChange,
    pt: _ctx.pt,
    unstyled: _ctx.unstyled
  }, _ctx.$props), null, 16, ["templates", "onActiveitemChange", "pt", "unstyled"]));
}
__name(render$4, "render$4");
script$5.render = render$4;
const _withScopeId$2 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-ffe66146"), n = n(), popScopeId(), n), "_withScopeId$2");
const _hoisted_1$6 = ["src", "data-test"];
const _hoisted_2$6 = ["src"];
const _hoisted_3$3 = {
  key: 1,
  class: "broken-image-placeholder"
};
const _hoisted_4$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-image" }, null, -1));
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
  __name: "ComfyImage",
  props: {
    src: {},
    class: {},
    contain: { type: Boolean, default: false }
  },
  setup(__props) {
    const props = __props;
    const imageBroken = ref(false);
    const handleImageError = /* @__PURE__ */ __name((e2) => {
      imageBroken.value = true;
    }, "handleImageError");
    const classArray = computed(() => {
      if (Array.isArray(props.class)) {
        return props.class;
      } else if (typeof props.class === "string") {
        return props.class.split(" ");
      } else if (typeof props.class === "object") {
        return Object.keys(props.class).filter((key) => props.class[key]);
      }
      return [];
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment$1, null, [
        !imageBroken.value ? (openBlock(), createElementBlock("span", {
          key: 0,
          class: normalizeClass(["comfy-image-wrap", [{ contain: _ctx.contain }]])
        }, [
          _ctx.contain ? (openBlock(), createElementBlock("img", {
            key: 0,
            src: _ctx.src,
            onError: handleImageError,
            "data-test": _ctx.src,
            class: "comfy-image-blur",
            style: normalizeStyle({ "background-image": `url(${_ctx.src})` })
          }, null, 44, _hoisted_1$6)) : createCommentVNode("", true),
          createBaseVNode("img", {
            src: _ctx.src,
            onError: handleImageError,
            class: normalizeClass(["comfy-image-main", [...classArray.value]])
          }, null, 42, _hoisted_2$6)
        ], 2)) : createCommentVNode("", true),
        imageBroken.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
          _hoisted_4$2,
          createBaseVNode("span", null, toDisplayString$1(_ctx.$t("g.imageFailedToLoad")), 1)
        ])) : createCommentVNode("", true)
      ], 64);
    };
  }
});
const ComfyImage = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-ffe66146"]]);
const _hoisted_1$5 = {
  controls: "",
  width: "100%",
  height: "100%"
};
const _hoisted_2$5 = ["src", "type"];
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
  __name: "ResultVideo",
  props: {
    result: {}
  },
  setup(__props) {
    const props = __props;
    const settingStore = useSettingStore();
    const vhsAdvancedPreviews = computed(
      () => settingStore.get("VHS.AdvancedPreviews")
    );
    const url = computed(
      () => vhsAdvancedPreviews.value ? props.result.vhsAdvancedPreviewUrl : props.result.url
    );
    const htmlVideoType = computed(
      () => vhsAdvancedPreviews.value ? "video/webm" : props.result.htmlVideoType
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("video", _hoisted_1$5, [
        createBaseVNode("source", {
          src: url.value,
          type: htmlVideoType.value
        }, null, 8, _hoisted_2$5),
        createTextVNode(" " + toDisplayString$1(_ctx.$t("g.videoFailedToLoad")), 1)
      ]);
    };
  }
});
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
  __name: "ResultGallery",
  props: {
    allGalleryItems: {},
    activeIndex: {}
  },
  emits: ["update:activeIndex"],
  setup(__props, { emit: __emit }) {
    const galleryVisible = ref(false);
    const emit2 = __emit;
    const props = __props;
    let maskMouseDownTarget = null;
    const onMaskMouseDown2 = /* @__PURE__ */ __name((event) => {
      maskMouseDownTarget = event.target;
    }, "onMaskMouseDown");
    const onMaskMouseUp2 = /* @__PURE__ */ __name((event) => {
      const maskEl = document.querySelector("[data-mask]");
      if (galleryVisible.value && maskMouseDownTarget === event.target && maskMouseDownTarget === maskEl) {
        galleryVisible.value = false;
        handleVisibilityChange(false);
      }
    }, "onMaskMouseUp");
    watch(
      () => props.activeIndex,
      (index2) => {
        if (index2 !== -1) {
          galleryVisible.value = true;
        }
      }
    );
    const handleVisibilityChange = /* @__PURE__ */ __name((visible) => {
      if (!visible) {
        emit2("update:activeIndex", -1);
      }
    }, "handleVisibilityChange");
    const handleActiveIndexChange = /* @__PURE__ */ __name((index2) => {
      emit2("update:activeIndex", index2);
    }, "handleActiveIndexChange");
    const handleKeyDown2 = /* @__PURE__ */ __name((event) => {
      if (!galleryVisible.value) return;
      switch (event.key) {
        case "ArrowLeft":
          navigateImage(-1);
          break;
        case "ArrowRight":
          navigateImage(1);
          break;
        case "Escape":
          galleryVisible.value = false;
          handleVisibilityChange(false);
          break;
      }
    }, "handleKeyDown");
    const navigateImage = /* @__PURE__ */ __name((direction) => {
      const newIndex = (props.activeIndex + direction + props.allGalleryItems.length) % props.allGalleryItems.length;
      emit2("update:activeIndex", newIndex);
    }, "navigateImage");
    onMounted(() => {
      window.addEventListener("keydown", handleKeyDown2);
    });
    onUnmounted(() => {
      window.removeEventListener("keydown", handleKeyDown2);
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(script$5), {
        visible: galleryVisible.value,
        "onUpdate:visible": [
          _cache[0] || (_cache[0] = ($event) => galleryVisible.value = $event),
          handleVisibilityChange
        ],
        activeIndex: _ctx.activeIndex,
        "onUpdate:activeIndex": handleActiveIndexChange,
        value: _ctx.allGalleryItems,
        showIndicators: false,
        changeItemOnIndicatorHover: "",
        showItemNavigators: "",
        fullScreen: "",
        circular: "",
        showThumbnails: false,
        pt: {
          mask: {
            onMousedown: onMaskMouseDown2,
            onMouseup: onMaskMouseUp2,
            "data-mask": true
          }
        }
      }, {
        item: withCtx(({ item: item3 }) => [
          item3.isImage ? (openBlock(), createBlock(ComfyImage, {
            key: item3.url,
            src: item3.url,
            contain: false,
            class: "galleria-image"
          }, null, 8, ["src"])) : item3.isVideo ? (openBlock(), createBlock(_sfc_main$8, {
            key: 1,
            result: item3
          }, null, 8, ["result"])) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["visible", "activeIndex", "value", "pt"]);
    };
  }
});
const _withScopeId$1 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-61515e14"), n = n(), popScopeId(), n), "_withScopeId$1");
const _hoisted_1$4 = {
  key: 2,
  class: "task-result-preview"
};
const _hoisted_2$4 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-file" }, null, -1));
const _hoisted_3$2 = {
  key: 3,
  class: "preview-mask"
};
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
  __name: "ResultItem",
  props: {
    result: {}
  },
  emits: ["preview"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit2 = __emit;
    const resultContainer = ref(null);
    const settingStore = useSettingStore();
    const imageFit = computed(
      () => settingStore.get("Comfy.Queue.ImageFit")
    );
    onMounted(() => {
      if (props.result.mediaType === "images") {
        resultContainer.value?.querySelectorAll("img").forEach((img) => {
          img.draggable = true;
        });
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "result-container",
        ref_key: "resultContainer",
        ref: resultContainer
      }, [
        _ctx.result.isImage ? (openBlock(), createBlock(ComfyImage, {
          key: 0,
          src: _ctx.result.url,
          class: "task-output-image",
          contain: imageFit.value === "contain"
        }, null, 8, ["src", "contain"])) : _ctx.result.isVideo ? (openBlock(), createBlock(_sfc_main$8, {
          key: 1,
          result: _ctx.result
        }, null, 8, ["result"])) : (openBlock(), createElementBlock("div", _hoisted_1$4, [
          _hoisted_2$4,
          createBaseVNode("span", null, toDisplayString$1(_ctx.result.mediaType), 1)
        ])),
        _ctx.result.supportsPreview ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
          createVNode(unref(script$R), {
            icon: "pi pi-eye",
            severity: "secondary",
            onClick: _cache[0] || (_cache[0] = ($event) => emit2("preview", _ctx.result)),
            rounded: ""
          })
        ])) : createCommentVNode("", true)
      ], 512);
    };
  }
});
const ResultItem = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-61515e14"]]);
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-b676a511"), n = n(), popScopeId(), n), "_withScopeId");
const _hoisted_1$3 = { class: "task-result-preview" };
const _hoisted_2$3 = {
  key: 0,
  class: "pi pi-spin pi-spinner"
};
const _hoisted_3$1 = ["src"];
const _hoisted_4$1 = { key: 2 };
const _hoisted_5$1 = {
  key: 3,
  class: "pi pi-exclamation-triangle"
};
const _hoisted_6$1 = {
  key: 4,
  class: "pi pi-exclamation-circle"
};
const _hoisted_7 = { class: "task-item-details" };
const _hoisted_8 = { class: "tag-wrapper status-tag-group" };
const _hoisted_9 = ["innerHTML"];
const _hoisted_10 = {
  key: 0,
  class: "task-time"
};
const _hoisted_11 = {
  key: 1,
  class: "task-prompt-id"
};
const _hoisted_12 = { class: "tag-wrapper" };
const _hoisted_13 = { style: { "font-weight": "bold" } };
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
  __name: "TaskItem",
  props: {
    task: {},
    isFlatTask: { type: Boolean }
  },
  emits: ["contextmenu", "preview", "task-output-length-clicked"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const litegraphService = useLitegraphService();
    const flatOutputs = props.task.flatOutputs;
    const coverResult = flatOutputs.length ? props.task.previewOutput || flatOutputs[0] : null;
    const node3 = flatOutputs.length && props.task.workflow ? props.task.workflow.nodes.find(
      (n) => n.id == coverResult.nodeId
    ) ?? null : null;
    const progressPreviewBlobUrl = ref("");
    const emit2 = __emit;
    onMounted(() => {
      api.addEventListener("b_preview", onProgressPreviewReceived);
    });
    onUnmounted(() => {
      if (progressPreviewBlobUrl.value) {
        URL.revokeObjectURL(progressPreviewBlobUrl.value);
      }
      api.removeEventListener("b_preview", onProgressPreviewReceived);
    });
    const handleContextMenu = /* @__PURE__ */ __name((e2) => {
      emit2("contextmenu", { task: props.task, event: e2, node: node3 });
    }, "handleContextMenu");
    const handlePreview = /* @__PURE__ */ __name(() => {
      emit2("preview", props.task);
    }, "handlePreview");
    const handleOutputLengthClick = /* @__PURE__ */ __name(() => {
      emit2("task-output-length-clicked", props.task);
    }, "handleOutputLengthClick");
    const taskTagSeverity = /* @__PURE__ */ __name((status) => {
      switch (status) {
        case TaskItemDisplayStatus.Pending:
          return "secondary";
        case TaskItemDisplayStatus.Running:
          return "info";
        case TaskItemDisplayStatus.Completed:
          return "success";
        case TaskItemDisplayStatus.Failed:
          return "danger";
        case TaskItemDisplayStatus.Cancelled:
          return "warn";
      }
    }, "taskTagSeverity");
    const taskStatusText = /* @__PURE__ */ __name((status) => {
      switch (status) {
        case TaskItemDisplayStatus.Pending:
          return "Pending";
        case TaskItemDisplayStatus.Running:
          return '<i class="pi pi-spin pi-spinner" style="font-weight: bold"></i> Running';
        case TaskItemDisplayStatus.Completed:
          return '<i class="pi pi-check" style="font-weight: bold"></i>';
        case TaskItemDisplayStatus.Failed:
          return "Failed";
        case TaskItemDisplayStatus.Cancelled:
          return "Cancelled";
      }
    }, "taskStatusText");
    const formatTime = /* @__PURE__ */ __name((time) => {
      if (time === void 0) {
        return "";
      }
      return `${time.toFixed(2)}s`;
    }, "formatTime");
    const onProgressPreviewReceived = /* @__PURE__ */ __name(async ({ detail }) => {
      if (props.task.displayStatus === TaskItemDisplayStatus.Running) {
        if (progressPreviewBlobUrl.value) {
          URL.revokeObjectURL(progressPreviewBlobUrl.value);
        }
        progressPreviewBlobUrl.value = URL.createObjectURL(detail);
      }
    }, "onProgressPreviewReceived");
    const cancelledWithResults = computed(() => {
      return props.task.displayStatus === TaskItemDisplayStatus.Cancelled && flatOutputs.length;
    });
    const cancelledWithoutResults = computed(() => {
      return props.task.displayStatus === TaskItemDisplayStatus.Cancelled && flatOutputs.length === 0;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "task-item",
        onContextmenu: handleContextMenu
      }, [
        createBaseVNode("div", _hoisted_1$3, [
          _ctx.task.displayStatus === unref(TaskItemDisplayStatus).Completed || cancelledWithResults.value ? (openBlock(), createElementBlock(Fragment$1, { key: 0 }, [
            unref(flatOutputs).length ? (openBlock(), createBlock(ResultItem, {
              key: 0,
              result: unref(coverResult),
              onPreview: handlePreview
            }, null, 8, ["result"])) : createCommentVNode("", true)
          ], 64)) : createCommentVNode("", true),
          _ctx.task.displayStatus === unref(TaskItemDisplayStatus).Running ? (openBlock(), createElementBlock(Fragment$1, { key: 1 }, [
            !progressPreviewBlobUrl.value ? (openBlock(), createElementBlock("i", _hoisted_2$3)) : (openBlock(), createElementBlock("img", {
              key: 1,
              src: progressPreviewBlobUrl.value,
              class: "progress-preview-img"
            }, null, 8, _hoisted_3$1))
          ], 64)) : _ctx.task.displayStatus === unref(TaskItemDisplayStatus).Pending ? (openBlock(), createElementBlock("span", _hoisted_4$1, "...")) : cancelledWithoutResults.value ? (openBlock(), createElementBlock("i", _hoisted_5$1)) : _ctx.task.displayStatus === unref(TaskItemDisplayStatus).Failed ? (openBlock(), createElementBlock("i", _hoisted_6$1)) : createCommentVNode("", true)
        ]),
        createBaseVNode("div", _hoisted_7, [
          createBaseVNode("div", _hoisted_8, [
            _ctx.isFlatTask && _ctx.task.isHistory ? (openBlock(), createBlock(unref(script$x), {
              key: 0,
              class: "node-name-tag"
            }, {
              default: withCtx(() => [
                createVNode(unref(script$R), {
                  class: "task-node-link",
                  label: `${unref(node3)?.type} (#${unref(node3)?.id})`,
                  link: "",
                  size: "small",
                  onClick: _cache[0] || (_cache[0] = ($event) => unref(litegraphService).goToNode(unref(node3)?.id))
                }, null, 8, ["label"])
              ]),
              _: 1
            })) : createCommentVNode("", true),
            createVNode(unref(script$x), {
              severity: taskTagSeverity(_ctx.task.displayStatus)
            }, {
              default: withCtx(() => [
                createBaseVNode("span", {
                  innerHTML: taskStatusText(_ctx.task.displayStatus)
                }, null, 8, _hoisted_9),
                _ctx.task.isHistory ? (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString$1(formatTime(_ctx.task.executionTimeInSeconds)), 1)) : createCommentVNode("", true),
                _ctx.isFlatTask ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString$1(_ctx.task.promptId.split("-")[0]), 1)) : createCommentVNode("", true)
              ]),
              _: 1
            }, 8, ["severity"])
          ]),
          createBaseVNode("div", _hoisted_12, [
            _ctx.task.isHistory && unref(flatOutputs).length > 1 ? (openBlock(), createBlock(unref(script$R), {
              key: 0,
              outlined: "",
              onClick: handleOutputLengthClick
            }, {
              default: withCtx(() => [
                createBaseVNode("span", _hoisted_13, toDisplayString$1(unref(flatOutputs).length), 1)
              ]),
              _: 1
            })) : createCommentVNode("", true)
          ])
        ])
      ], 32);
    };
  }
});
const TaskItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-b676a511"]]);
const _hoisted_1$2 = { key: 1 };
const _hoisted_2$2 = { key: 2 };
const IMAGE_FIT = "Comfy.Queue.ImageFit";
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  __name: "QueueSidebarTab",
  setup(__props) {
    const confirm2 = useConfirm();
    const toast = useToast();
    const queueStore = useQueueStore();
    const settingStore = useSettingStore();
    const commandStore = useCommandStore();
    const { t: t2 } = useI18n();
    const isExpanded = ref(false);
    const galleryActiveIndex = ref(-1);
    const allGalleryItems = shallowRef([]);
    const folderTask = ref(null);
    const isInFolderView = computed(() => folderTask.value !== null);
    const imageFit = computed(() => settingStore.get(IMAGE_FIT));
    const allTasks = computed(
      () => isInFolderView.value ? folderTask.value ? folderTask.value.flatten() : [] : isExpanded.value ? queueStore.flatTasks : queueStore.tasks
    );
    const updateGalleryItems = /* @__PURE__ */ __name(() => {
      allGalleryItems.value = allTasks.value.flatMap((task) => {
        const previewOutput = task.previewOutput;
        return previewOutput ? [previewOutput] : [];
      });
    }, "updateGalleryItems");
    const toggleExpanded = /* @__PURE__ */ __name(() => {
      isExpanded.value = !isExpanded.value;
    }, "toggleExpanded");
    const removeTask = /* @__PURE__ */ __name((task) => {
      if (task.isRunning) {
        api.interrupt();
      }
      queueStore.delete(task);
    }, "removeTask");
    const removeAllTasks = /* @__PURE__ */ __name(async () => {
      await queueStore.clear();
    }, "removeAllTasks");
    const confirmRemoveAll = /* @__PURE__ */ __name((event) => {
      confirm2.require({
        target: event.currentTarget,
        message: "Do you want to delete all tasks?",
        icon: "pi pi-info-circle",
        rejectProps: {
          label: "Cancel",
          severity: "secondary",
          outlined: true
        },
        acceptProps: {
          label: "Delete",
          severity: "danger"
        },
        accept: /* @__PURE__ */ __name(async () => {
          await removeAllTasks();
          toast.add({
            severity: "info",
            summary: "Confirmed",
            detail: "Tasks deleted",
            life: 3e3
          });
        }, "accept")
      });
    }, "confirmRemoveAll");
    const onStatus = /* @__PURE__ */ __name(async () => {
      await queueStore.update();
    }, "onStatus");
    const menu2 = ref(null);
    const menuTargetTask = ref(null);
    const menuTargetNode = ref(null);
    const menuItems = computed(() => [
      {
        label: t2("g.delete"),
        icon: "pi pi-trash",
        command: /* @__PURE__ */ __name(() => menuTargetTask.value && removeTask(menuTargetTask.value), "command"),
        disabled: isExpanded.value || isInFolderView.value
      },
      {
        label: t2("g.loadWorkflow"),
        icon: "pi pi-file-export",
        command: /* @__PURE__ */ __name(() => menuTargetTask.value?.loadWorkflow(app$1), "command"),
        disabled: !menuTargetTask.value?.workflow
      },
      {
        label: t2("g.goToNode"),
        icon: "pi pi-arrow-circle-right",
        command: /* @__PURE__ */ __name(() => useLitegraphService().goToNode(menuTargetNode.value?.id), "command"),
        visible: !!menuTargetNode.value
      }
    ]);
    const handleContextMenu = /* @__PURE__ */ __name(({
      task,
      event,
      node: node3
    }) => {
      menuTargetTask.value = task;
      menuTargetNode.value = node3;
      menu2.value?.show(event);
    }, "handleContextMenu");
    const handlePreview = /* @__PURE__ */ __name((task) => {
      updateGalleryItems();
      galleryActiveIndex.value = allGalleryItems.value.findIndex(
        (item3) => item3.url === task.previewOutput?.url
      );
    }, "handlePreview");
    const enterFolderView = /* @__PURE__ */ __name((task) => {
      folderTask.value = task;
    }, "enterFolderView");
    const exitFolderView = /* @__PURE__ */ __name(() => {
      folderTask.value = null;
    }, "exitFolderView");
    const toggleImageFit = /* @__PURE__ */ __name(() => {
      settingStore.set(IMAGE_FIT, imageFit.value === "cover" ? "contain" : "cover");
    }, "toggleImageFit");
    watch(allTasks, () => {
      const isGalleryOpen = galleryActiveIndex.value !== -1;
      if (!isGalleryOpen) return;
      const prevLength = allGalleryItems.value.length;
      updateGalleryItems();
      const lengthChange = allGalleryItems.value.length - prevLength;
      if (!lengthChange) return;
      const newIndex = galleryActiveIndex.value + lengthChange;
      galleryActiveIndex.value = Math.max(0, newIndex);
    });
    onMounted(() => {
      api.addEventListener("status", onStatus);
      queueStore.update();
    });
    onUnmounted(() => {
      api.removeEventListener("status", onStatus);
    });
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(SidebarTabTemplate, {
          title: _ctx.$t("sideToolbar.queue")
        }, {
          "tool-buttons": withCtx(() => [
            withDirectives(createVNode(unref(script$R), {
              icon: imageFit.value === "cover" ? "pi pi-arrow-down-left-and-arrow-up-right-to-center" : "pi pi-arrow-up-right-and-arrow-down-left-from-center",
              text: "",
              severity: "secondary",
              onClick: toggleImageFit,
              class: "toggle-expanded-button"
            }, null, 8, ["icon"]), [
              [
                _directive_tooltip,
                _ctx.$t(`sideToolbar.queueTab.${imageFit.value}ImagePreview`),
                void 0,
                { bottom: true }
              ]
            ]),
            isInFolderView.value ? withDirectives((openBlock(), createBlock(unref(script$R), {
              key: 0,
              icon: "pi pi-arrow-left",
              text: "",
              severity: "secondary",
              onClick: exitFolderView,
              class: "back-button"
            }, null, 512)), [
              [
                _directive_tooltip,
                _ctx.$t("sideToolbar.queueTab.backToAllTasks"),
                void 0,
                { bottom: true }
              ]
            ]) : (openBlock(), createElementBlock(Fragment$1, { key: 1 }, [
              withDirectives(createVNode(unref(script$R), {
                icon: isExpanded.value ? "pi pi-images" : "pi pi-image",
                text: "",
                severity: "secondary",
                onClick: toggleExpanded,
                class: "toggle-expanded-button"
              }, null, 8, ["icon"]), [
                [_directive_tooltip, _ctx.$t("sideToolbar.queueTab.showFlatList")]
              ]),
              unref(queueStore).hasPendingTasks ? withDirectives((openBlock(), createBlock(unref(script$R), {
                key: 0,
                icon: "pi pi-stop",
                severity: "danger",
                text: "",
                onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.ClearPendingTasks"))
              }, null, 512)), [
                [
                  _directive_tooltip,
                  _ctx.$t("sideToolbar.queueTab.clearPendingTasks"),
                  void 0,
                  { bottom: true }
                ]
              ]) : createCommentVNode("", true),
              createVNode(unref(script$R), {
                icon: "pi pi-trash",
                text: "",
                severity: "primary",
                onClick: _cache[1] || (_cache[1] = ($event) => confirmRemoveAll($event)),
                class: "clear-all-button"
              })
            ], 64))
          ]),
          body: withCtx(() => [
            allTasks.value?.length ? (openBlock(), createBlock(VirtualGrid, {
              key: 0,
              items: allTasks.value,
              gridStyle: {
                display: "grid",
                gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
                padding: "0.5rem",
                gap: "0.5rem"
              }
            }, {
              item: withCtx(({ item: item3 }) => [
                createVNode(TaskItem, {
                  task: item3,
                  isFlatTask: isExpanded.value || isInFolderView.value,
                  onContextmenu: handleContextMenu,
                  onPreview: handlePreview,
                  onTaskOutputLengthClicked: _cache[2] || (_cache[2] = ($event) => enterFolderView($event))
                }, null, 8, ["task", "isFlatTask"])
              ]),
              _: 1
            }, 8, ["items"])) : unref(queueStore).isLoading ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
              createVNode(unref(script$Y), { style: { "width": "50px", "left": "50%", "transform": "translateX(-50%)" } })
            ])) : (openBlock(), createElementBlock("div", _hoisted_2$2, [
              createVNode(NoResultsPlaceholder, {
                icon: "pi pi-info-circle",
                title: _ctx.$t("g.noTasksFound"),
                message: _ctx.$t("g.noTasksFoundMessage")
              }, null, 8, ["title", "message"])
            ]))
          ]),
          _: 1
        }, 8, ["title"]),
        createVNode(unref(script$6)),
        createVNode(unref(script$e), {
          ref_key: "menu",
          ref: menu2,
          model: menuItems.value
        }, null, 8, ["model"]),
        createVNode(_sfc_main$7, {
          activeIndex: galleryActiveIndex.value,
          "onUpdate:activeIndex": _cache[3] || (_cache[3] = ($event) => galleryActiveIndex.value = $event),
          allGalleryItems: allGalleryItems.value
        }, null, 8, ["activeIndex", "allGalleryItems"])
      ], 64);
    };
  }
});
const useQueueSidebarTab = /* @__PURE__ */ __name(() => {
  const { t: t2 } = useI18n();
  const queuePendingTaskCountStore = useQueuePendingTaskCountStore();
  return {
    id: "queue",
    icon: "pi pi-history",
    iconBadge: /* @__PURE__ */ __name(() => {
      const value4 = queuePendingTaskCountStore.count.toString();
      return value4 === "0" ? null : value4;
    }, "iconBadge"),
    title: t2("sideToolbar.queue"),
    tooltip: t2("sideToolbar.queue"),
    component: markRaw(_sfc_main$4),
    type: "vue"
  };
}, "useQueueSidebarTab");
var theme = /* @__PURE__ */ __name(function theme39(_ref) {
  var dt2 = _ref.dt;
  return "\n.p-confirmdialog .p-dialog-content {\n    display: flex;\n    align-items: center;\n    gap:  ".concat(dt2("confirmdialog.content.gap"), ";\n}\n\n.p-confirmdialog-icon {\n    color: ").concat(dt2("confirmdialog.icon.color"), ";\n    font-size: ").concat(dt2("confirmdialog.icon.size"), ";\n    width: ").concat(dt2("confirmdialog.icon.size"), ";\n    height: ").concat(dt2("confirmdialog.icon.size"), ";\n}\n");
}, "theme");
var classes = {
  root: "p-confirmdialog",
  icon: "p-confirmdialog-icon",
  message: "p-confirmdialog-message",
  pcRejectButton: "p-confirmdialog-reject-button",
  pcAcceptButton: "p-confirmdialog-accept-button"
};
var ConfirmDialogStyle = BaseStyle.extend({
  name: "confirmdialog",
  theme,
  classes
});
var script$1 = {
  name: "BaseConfirmDialog",
  "extends": script$_,
  props: {
    group: String,
    breakpoints: {
      type: Object,
      "default": null
    },
    draggable: {
      type: Boolean,
      "default": true
    }
  },
  style: ConfirmDialogStyle,
  provide: /* @__PURE__ */ __name(function provide41() {
    return {
      $pcConfirmDialog: this,
      $parentInstance: this
    };
  }, "provide")
};
var script = {
  name: "ConfirmDialog",
  "extends": script$1,
  confirmListener: null,
  closeListener: null,
  data: /* @__PURE__ */ __name(function data23() {
    return {
      visible: false,
      confirmation: null
    };
  }, "data"),
  mounted: /* @__PURE__ */ __name(function mounted22() {
    var _this = this;
    this.confirmListener = function(options4) {
      if (!options4) {
        return;
      }
      if (options4.group === _this.group) {
        _this.confirmation = options4;
        if (_this.confirmation.onShow) {
          _this.confirmation.onShow();
        }
        _this.visible = true;
      }
    };
    this.closeListener = function() {
      _this.visible = false;
      _this.confirmation = null;
    };
    ConfirmationEventBus.on("confirm", this.confirmListener);
    ConfirmationEventBus.on("close", this.closeListener);
  }, "mounted"),
  beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount14() {
    ConfirmationEventBus.off("confirm", this.confirmListener);
    ConfirmationEventBus.off("close", this.closeListener);
  }, "beforeUnmount"),
  methods: {
    accept: /* @__PURE__ */ __name(function accept2() {
      if (this.confirmation.accept) {
        this.confirmation.accept();
      }
      this.visible = false;
    }, "accept"),
    reject: /* @__PURE__ */ __name(function reject2() {
      if (this.confirmation.reject) {
        this.confirmation.reject();
      }
      this.visible = false;
    }, "reject"),
    onHide: /* @__PURE__ */ __name(function onHide2() {
      if (this.confirmation.onHide) {
        this.confirmation.onHide();
      }
      this.visible = false;
    }, "onHide")
  },
  computed: {
    header: /* @__PURE__ */ __name(function header2() {
      return this.confirmation ? this.confirmation.header : null;
    }, "header"),
    message: /* @__PURE__ */ __name(function message2() {
      return this.confirmation ? this.confirmation.message : null;
    }, "message"),
    blockScroll: /* @__PURE__ */ __name(function blockScroll() {
      return this.confirmation ? this.confirmation.blockScroll : true;
    }, "blockScroll"),
    position: /* @__PURE__ */ __name(function position2() {
      return this.confirmation ? this.confirmation.position : null;
    }, "position"),
    acceptLabel: /* @__PURE__ */ __name(function acceptLabel2() {
      if (this.confirmation) {
        var _confirmation$acceptP;
        var confirmation = this.confirmation;
        return confirmation.acceptLabel || ((_confirmation$acceptP = confirmation.acceptProps) === null || _confirmation$acceptP === void 0 ? void 0 : _confirmation$acceptP.label) || this.$primevue.config.locale.accept;
      }
      return this.$primevue.config.locale.accept;
    }, "acceptLabel"),
    rejectLabel: /* @__PURE__ */ __name(function rejectLabel2() {
      if (this.confirmation) {
        var _confirmation$rejectP;
        var confirmation = this.confirmation;
        return confirmation.rejectLabel || ((_confirmation$rejectP = confirmation.rejectProps) === null || _confirmation$rejectP === void 0 ? void 0 : _confirmation$rejectP.label) || this.$primevue.config.locale.reject;
      }
      return this.$primevue.config.locale.reject;
    }, "rejectLabel"),
    acceptIcon: /* @__PURE__ */ __name(function acceptIcon2() {
      var _this$confirmation;
      return this.confirmation ? this.confirmation.acceptIcon : (_this$confirmation = this.confirmation) !== null && _this$confirmation !== void 0 && _this$confirmation.acceptProps ? this.confirmation.acceptProps.icon : null;
    }, "acceptIcon"),
    rejectIcon: /* @__PURE__ */ __name(function rejectIcon2() {
      var _this$confirmation2;
      return this.confirmation ? this.confirmation.rejectIcon : (_this$confirmation2 = this.confirmation) !== null && _this$confirmation2 !== void 0 && _this$confirmation2.rejectProps ? this.confirmation.rejectProps.icon : null;
    }, "rejectIcon"),
    autoFocusAccept: /* @__PURE__ */ __name(function autoFocusAccept() {
      return this.confirmation.defaultFocus === void 0 || this.confirmation.defaultFocus === "accept" ? true : false;
    }, "autoFocusAccept"),
    autoFocusReject: /* @__PURE__ */ __name(function autoFocusReject() {
      return this.confirmation.defaultFocus === "reject" ? true : false;
    }, "autoFocusReject"),
    closeOnEscape: /* @__PURE__ */ __name(function closeOnEscape() {
      return this.confirmation ? this.confirmation.closeOnEscape : true;
    }, "closeOnEscape")
  },
  components: {
    Dialog: script$P,
    Button: script$R
  }
};
function render(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_Button = resolveComponent("Button");
  var _component_Dialog = resolveComponent("Dialog");
  return openBlock(), createBlock(_component_Dialog, {
    visible: $data.visible,
    "onUpdate:visible": [_cache[2] || (_cache[2] = function($event) {
      return $data.visible = $event;
    }), $options.onHide],
    role: "alertdialog",
    "class": normalizeClass(_ctx.cx("root")),
    modal: true,
    header: $options.header,
    blockScroll: $options.blockScroll,
    position: $options.position,
    breakpoints: _ctx.breakpoints,
    closeOnEscape: $options.closeOnEscape,
    draggable: _ctx.draggable,
    pt: _ctx.pt,
    unstyled: _ctx.unstyled
  }, createSlots({
    "default": withCtx(function() {
      return [!_ctx.$slots.container ? (openBlock(), createElementBlock(Fragment$1, {
        key: 0
      }, [!_ctx.$slots.message ? (openBlock(), createElementBlock(Fragment$1, {
        key: 0
      }, [renderSlot(_ctx.$slots, "icon", {}, function() {
        return [_ctx.$slots.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.icon), {
          key: 0,
          "class": normalizeClass(_ctx.cx("icon"))
        }, null, 8, ["class"])) : $data.confirmation.icon ? (openBlock(), createElementBlock("span", mergeProps({
          key: 1,
          "class": [$data.confirmation.icon, _ctx.cx("icon")]
        }, _ctx.ptm("icon")), null, 16)) : createCommentVNode("", true)];
      }), createBaseVNode("span", mergeProps({
        "class": _ctx.cx("message")
      }, _ctx.ptm("message")), toDisplayString$1($options.message), 17)], 64)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.message), {
        key: 1,
        message: $data.confirmation
      }, null, 8, ["message"]))], 64)) : createCommentVNode("", true)];
    }),
    _: 2
  }, [_ctx.$slots.container ? {
    name: "container",
    fn: withCtx(function(slotProps) {
      return [renderSlot(_ctx.$slots, "container", {
        message: $data.confirmation,
        closeCallback: slotProps.onclose,
        acceptCallback: $options.accept,
        rejectCallback: $options.reject
      })];
    }),
    key: "0"
  } : void 0, !_ctx.$slots.container ? {
    name: "footer",
    fn: withCtx(function() {
      var _$data$confirmation$r;
      return [createVNode(_component_Button, mergeProps({
        "class": [_ctx.cx("pcRejectButton"), $data.confirmation.rejectClass],
        autofocus: $options.autoFocusReject,
        unstyled: _ctx.unstyled,
        text: ((_$data$confirmation$r = $data.confirmation.rejectProps) === null || _$data$confirmation$r === void 0 ? void 0 : _$data$confirmation$r.text) || false,
        onClick: _cache[0] || (_cache[0] = function($event) {
          return $options.reject();
        })
      }, $data.confirmation.rejectProps, {
        label: $options.rejectLabel,
        pt: _ctx.ptm("pcRejectButton")
      }), createSlots({
        _: 2
      }, [$options.rejectIcon || _ctx.$slots.rejecticon ? {
        name: "icon",
        fn: withCtx(function(iconProps) {
          return [renderSlot(_ctx.$slots, "rejecticon", {}, function() {
            return [createBaseVNode("span", mergeProps({
              "class": [$options.rejectIcon, iconProps["class"]]
            }, _ctx.ptm("pcRejectButton")["icon"], {
              "data-pc-section": "rejectbuttonicon"
            }), null, 16)];
          })];
        }),
        key: "0"
      } : void 0]), 1040, ["class", "autofocus", "unstyled", "text", "label", "pt"]), createVNode(_component_Button, mergeProps({
        label: $options.acceptLabel,
        "class": [_ctx.cx("pcAcceptButton"), $data.confirmation.acceptClass],
        autofocus: $options.autoFocusAccept,
        unstyled: _ctx.unstyled,
        onClick: _cache[1] || (_cache[1] = function($event) {
          return $options.accept();
        })
      }, $data.confirmation.acceptProps, {
        pt: _ctx.ptm("pcAcceptButton")
      }), createSlots({
        _: 2
      }, [$options.acceptIcon || _ctx.$slots.accepticon ? {
        name: "icon",
        fn: withCtx(function(iconProps) {
          return [renderSlot(_ctx.$slots, "accepticon", {}, function() {
            return [createBaseVNode("span", mergeProps({
              "class": [$options.acceptIcon, iconProps["class"]]
            }, _ctx.ptm("pcAcceptButton")["icon"], {
              "data-pc-section": "acceptbuttonicon"
            }), null, 16)];
          })];
        }),
        key: "0"
      } : void 0]), 1040, ["label", "class", "autofocus", "unstyled", "pt"])];
    }),
    key: "1"
  } : void 0]), 1032, ["visible", "class", "header", "blockScroll", "position", "breakpoints", "closeOnEscape", "draggable", "onUpdate:visible", "pt", "unstyled"]);
}
__name(render, "render");
script.render = render;
const _hoisted_1$1 = {
  key: 0,
  class: "mr-2 shrink-0"
};
const _hoisted_2$1 = {
  key: 1,
  class: "ml-2 shrink-0"
};
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  __name: "TextDivider",
  props: {
    text: {},
    class: {},
    position: { default: "left" },
    align: { default: "center" },
    type: { default: "solid" },
    layout: { default: "horizontal" }
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["flex items-center", props.class])
      }, [
        _ctx.position === "left" ? (openBlock(), createElementBlock("span", _hoisted_1$1, toDisplayString$1(_ctx.text), 1)) : createCommentVNode("", true),
        createVNode(unref(script$O), {
          align: _ctx.align,
          type: _ctx.type,
          layout: _ctx.layout,
          class: "flex-grow"
        }, null, 8, ["align", "type", "layout"]),
        _ctx.position === "right" ? (openBlock(), createElementBlock("span", _hoisted_2$1, toDisplayString$1(_ctx.text), 1)) : createCommentVNode("", true)
      ], 2);
    };
  }
});
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "WorkflowTreeLeaf",
  props: {
    node: {}
  },
  setup(__props) {
    const props = __props;
    const workflowBookmarkStore = useWorkflowBookmarkStore();
    const isBookmarked = computed(
      () => workflowBookmarkStore.isBookmarked(props.node.data.path)
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(TreeExplorerTreeNode, { node: _ctx.node }, {
        actions: withCtx(({ node: node3 }) => [
          createVNode(unref(script$R), {
            icon: isBookmarked.value ? "pi pi-bookmark-fill" : "pi pi-bookmark",
            text: "",
            severity: "secondary",
            size: "small",
            onClick: withModifiers(($event) => unref(workflowBookmarkStore).toggleBookmarked(node3.data.path), ["stop"])
          }, null, 8, ["icon", "onClick"])
        ]),
        _: 1
      }, 8, ["node"]);
    };
  }
});
const _hoisted_1 = {
  key: 0,
  class: "comfyui-workflows-panel"
};
const _hoisted_2 = {
  key: 0,
  class: "comfyui-workflows-open"
};
const _hoisted_3 = { key: 0 };
const _hoisted_4 = { class: "comfyui-workflows-bookmarks" };
const _hoisted_5 = { class: "comfyui-workflows-browse" };
const _hoisted_6 = {
  key: 1,
  class: "comfyui-workflows-search-panel"
};
var WorkflowTreeType = /* @__PURE__ */ ((WorkflowTreeType2) => {
  WorkflowTreeType2["Open"] = "Open";
  WorkflowTreeType2["Bookmarks"] = "Bookmarks";
  WorkflowTreeType2["Browse"] = "Browse";
  return WorkflowTreeType2;
})(WorkflowTreeType || {});
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "WorkflowsSidebarTab",
  setup(__props) {
    const settingStore = useSettingStore();
    const workflowTabsPosition = computed(
      () => settingStore.get("Comfy.Workflow.WorkflowTabsPosition")
    );
    const searchQuery = ref("");
    const isSearching = computed(() => searchQuery.value.length > 0);
    const filteredWorkflows = ref([]);
    const filteredRoot = computed(() => {
      return buildWorkflowTree(filteredWorkflows.value);
    });
    const handleSearch = /* @__PURE__ */ __name((query) => {
      if (query.length === 0) {
        filteredWorkflows.value = [];
        expandedKeys2.value = {};
        return;
      }
      const lowerQuery = query.toLocaleLowerCase();
      filteredWorkflows.value = workflowStore.workflows.filter((workflow) => {
        return workflow.path.toLocaleLowerCase().includes(lowerQuery);
      });
      nextTick(() => {
        expandNode(filteredRoot.value);
      });
    }, "handleSearch");
    const commandStore = useCommandStore();
    const workflowStore = useWorkflowStore();
    const workflowService2 = useWorkflowService();
    const workspaceStore = useWorkspaceStore();
    const { t: t2 } = useI18n();
    const expandedKeys2 = ref({});
    const { expandNode, toggleNodeOnEvent } = useTreeExpansion(expandedKeys2);
    const handleCloseWorkflow = /* @__PURE__ */ __name((workflow) => {
      if (workflow) {
        workflowService2.closeWorkflow(workflow, {
          warnIfUnsaved: !workspaceStore.shiftDown
        });
      }
    }, "handleCloseWorkflow");
    const buildWorkflowTree = /* @__PURE__ */ __name((workflows) => {
      return buildTree$1(
        workflows,
        (workflow) => workflow.key.split("/")
      );
    }, "buildWorkflowTree");
    const workflowsTree = computed(
      () => sortedTree(buildWorkflowTree(workflowStore.persistedWorkflows), {
        groupLeaf: true
      })
    );
    const bookmarkedWorkflowsTree = computed(
      () => buildTree$1(workflowStore.bookmarkedWorkflows, (workflow) => [workflow.key])
    );
    const openWorkflowsTree = computed(
      () => buildTree$1(workflowStore.openWorkflows, (workflow) => [workflow.key])
    );
    const renderTreeNode = /* @__PURE__ */ __name((node3, type) => {
      const children = node3.children?.map((child) => renderTreeNode(child, type));
      const workflow = node3.data;
      const handleClick2 = /* @__PURE__ */ __name((node22, e2) => {
        if (node22.leaf) {
          workflowService2.openWorkflow(workflow);
        } else {
          toggleNodeOnEvent(e2, node22);
        }
      }, "handleClick");
      const actions = node3.leaf ? {
        handleClick: handleClick2,
        handleRename: /* @__PURE__ */ __name(async (node22, newName) => {
          const newPath = type === "Browse" ? workflow.directory + "/" + appendJsonExt(newName) : ComfyWorkflow.basePath + appendJsonExt(newName);
          await workflowService2.renameWorkflow(workflow, newPath);
        }, "handleRename"),
        handleDelete: workflow.isTemporary ? void 0 : async () => {
          await workflowService2.deleteWorkflow(workflow);
        },
        contextMenuItems: /* @__PURE__ */ __name((node22) => {
          return [
            {
              label: t2("g.insert"),
              icon: "pi pi-file-export",
              command: /* @__PURE__ */ __name(() => {
                const workflow2 = node22.data;
                workflowService2.insertWorkflow(workflow2);
              }, "command")
            }
          ];
        }, "contextMenuItems")
      } : { handleClick: handleClick2 };
      return {
        key: node3.key,
        label: node3.label,
        leaf: node3.leaf,
        data: node3.data,
        children,
        ...actions
      };
    }, "renderTreeNode");
    const selectionKeys = computed(() => ({
      [`root/${workflowStore.activeWorkflow?.key}`]: true
    }));
    const workflowBookmarkStore = useWorkflowBookmarkStore();
    onMounted(async () => {
      await workflowBookmarkStore.loadBookmarks();
    });
    return (_ctx, _cache) => {
      const _directive_tooltip = resolveDirective("tooltip");
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(SidebarTabTemplate, {
          title: _ctx.$t("sideToolbar.workflows"),
          class: "workflows-sidebar-tab bg-[var(--p-tree-background)]"
        }, {
          "tool-buttons": withCtx(() => [
            withDirectives(createVNode(unref(script$R), {
              class: "browse-templates-button",
              icon: "pi pi-th-large",
              text: "",
              onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.BrowseTemplates"))
            }, null, 512), [
              [
                _directive_tooltip,
                _ctx.$t("sideToolbar.browseTemplates"),
                void 0,
                { bottom: true }
              ]
            ]),
            withDirectives(createVNode(unref(script$R), {
              class: "open-workflow-button",
              icon: "pi pi-folder-open",
              text: "",
              onClick: _cache[1] || (_cache[1] = () => unref(commandStore).execute("Comfy.OpenWorkflow"))
            }, null, 512), [
              [
                _directive_tooltip,
                _ctx.$t("sideToolbar.openWorkflow"),
                void 0,
                { bottom: true }
              ]
            ]),
            withDirectives(createVNode(unref(script$R), {
              class: "new-blank-workflow-button",
              icon: "pi pi-plus",
              onClick: _cache[2] || (_cache[2] = () => unref(commandStore).execute("Comfy.NewBlankWorkflow")),
              text: ""
            }, null, 512), [
              [
                _directive_tooltip,
                _ctx.$t("sideToolbar.newBlankWorkflow"),
                void 0,
                { bottom: true }
              ]
            ])
          ]),
          header: withCtx(() => [
            createVNode(SearchBox, {
              class: "workflows-search-box p-2 2xl:p-4",
              modelValue: searchQuery.value,
              "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => searchQuery.value = $event),
              onSearch: handleSearch,
              placeholder: _ctx.$t("g.searchWorkflows") + "..."
            }, null, 8, ["modelValue", "placeholder"])
          ]),
          body: withCtx(() => [
            !isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
              workflowTabsPosition.value === "Sidebar" ? (openBlock(), createElementBlock("div", _hoisted_2, [
                createVNode(_sfc_main$3, {
                  text: unref(t2)("sideToolbar.workflowTab.workflowTreeType.open"),
                  type: "dashed",
                  class: "ml-2"
                }, null, 8, ["text"]),
                createVNode(TreeExplorer, {
                  roots: renderTreeNode(
                    openWorkflowsTree.value,
                    "Open"
                    /* Open */
                  ).children,
                  selectionKeys: selectionKeys.value
                }, {
                  node: withCtx(({ node: node3 }) => [
                    createVNode(TreeExplorerTreeNode, { node: node3 }, {
                      "before-label": withCtx(({ node: node22 }) => [
                        node22.data.isModified || !node22.data.isPersisted ? (openBlock(), createElementBlock("span", _hoisted_3, "*")) : createCommentVNode("", true)
                      ]),
                      actions: withCtx(({ node: node22 }) => [
                        createVNode(unref(script$R), {
                          class: "close-workflow-button",
                          icon: "pi pi-times",
                          text: "",
                          severity: unref(workspaceStore).shiftDown ? "danger" : "secondary",
                          size: "small",
                          onClick: withModifiers(($event) => handleCloseWorkflow(node22.data), ["stop"])
                        }, null, 8, ["severity", "onClick"])
                      ]),
                      _: 2
                    }, 1032, ["node"])
                  ]),
                  _: 1
                }, 8, ["roots", "selectionKeys"])
              ])) : createCommentVNode("", true),
              withDirectives(createBaseVNode("div", _hoisted_4, [
                createVNode(_sfc_main$3, {
                  text: unref(t2)("sideToolbar.workflowTab.workflowTreeType.bookmarks"),
                  type: "dashed",
                  class: "ml-2"
                }, null, 8, ["text"]),
                createVNode(TreeExplorer, {
                  roots: renderTreeNode(
                    bookmarkedWorkflowsTree.value,
                    "Bookmarks"
                    /* Bookmarks */
                  ).children
                }, {
                  node: withCtx(({ node: node3 }) => [
                    createVNode(_sfc_main$2, { node: node3 }, null, 8, ["node"])
                  ]),
                  _: 1
                }, 8, ["roots"])
              ], 512), [
                [vShow, unref(workflowStore).bookmarkedWorkflows.length > 0]
              ]),
              createBaseVNode("div", _hoisted_5, [
                createVNode(_sfc_main$3, {
                  text: unref(t2)("sideToolbar.workflowTab.workflowTreeType.browse"),
                  type: "dashed",
                  class: "ml-2"
                }, null, 8, ["text"]),
                unref(workflowStore).persistedWorkflows.length > 0 ? (openBlock(), createBlock(TreeExplorer, {
                  key: 0,
                  roots: renderTreeNode(
                    workflowsTree.value,
                    "Browse"
                    /* Browse */
                  ).children,
                  expandedKeys: expandedKeys2.value,
                  "onUpdate:expandedKeys": _cache[4] || (_cache[4] = ($event) => expandedKeys2.value = $event)
                }, {
                  node: withCtx(({ node: node3 }) => [
                    createVNode(_sfc_main$2, { node: node3 }, null, 8, ["node"])
                  ]),
                  _: 1
                }, 8, ["roots", "expandedKeys"])) : (openBlock(), createBlock(NoResultsPlaceholder, {
                  key: 1,
                  icon: "pi pi-folder",
                  title: _ctx.$t("g.empty"),
                  message: _ctx.$t("g.noWorkflowsFound")
                }, null, 8, ["title", "message"]))
              ])
            ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
              createVNode(TreeExplorer, {
                roots: renderTreeNode(
                  filteredRoot.value,
                  "Browse"
                  /* Browse */
                ).children,
                expandedKeys: expandedKeys2.value,
                "onUpdate:expandedKeys": _cache[5] || (_cache[5] = ($event) => expandedKeys2.value = $event)
              }, {
                node: withCtx(({ node: node3 }) => [
                  createVNode(_sfc_main$2, { node: node3 }, null, 8, ["node"])
                ]),
                _: 1
              }, 8, ["roots", "expandedKeys"])
            ]))
          ]),
          _: 1
        }, 8, ["title"]),
        createVNode(unref(script))
      ], 64);
    };
  }
});
const useWorkflowsSidebarTab = /* @__PURE__ */ __name(() => {
  const { t: t2 } = useI18n();
  const settingStore = useSettingStore();
  const workflowStore = useWorkflowStore();
  return {
    id: "workflows",
    icon: "pi pi-folder-open",
    iconBadge: /* @__PURE__ */ __name(() => {
      if (settingStore.get("Comfy.Workflow.WorkflowTabsPosition") !== "Sidebar") {
        return null;
      }
      const value4 = workflowStore.openWorkflows.length.toString();
      return value4 === "0" ? null : value4;
    }, "iconBadge"),
    title: t2("sideToolbar.workflows"),
    tooltip: t2("sideToolbar.workflows"),
    component: markRaw(_sfc_main$1),
    type: "vue"
  };
}, "useWorkflowsSidebarTab");
const useSidebarTabStore = /* @__PURE__ */ defineStore("sidebarTab", () => {
  const sidebarTabs = ref([]);
  const activeSidebarTabId = ref(null);
  const activeSidebarTab = computed(() => {
    return sidebarTabs.value.find((tab) => tab.id === activeSidebarTabId.value) ?? null;
  });
  const toggleSidebarTab = /* @__PURE__ */ __name((tabId) => {
    activeSidebarTabId.value = activeSidebarTabId.value === tabId ? null : tabId;
  }, "toggleSidebarTab");
  const registerSidebarTab = /* @__PURE__ */ __name((tab) => {
    sidebarTabs.value = [...sidebarTabs.value, tab];
    useCommandStore().registerCommand({
      id: `Workspace.ToggleSidebarTab.${tab.id}`,
      icon: tab.icon,
      label: `Toggle ${tab.title} Sidebar`,
      tooltip: tab.tooltip,
      versionAdded: "1.3.9",
      function: /* @__PURE__ */ __name(() => {
        toggleSidebarTab(tab.id);
      }, "function")
    });
  }, "registerSidebarTab");
  const unregisterSidebarTab = /* @__PURE__ */ __name((id3) => {
    const index2 = sidebarTabs.value.findIndex((tab) => tab.id === id3);
    if (index2 !== -1) {
      const tab = sidebarTabs.value[index2];
      if (tab.type === "custom" && tab.destroy) {
        tab.destroy();
      }
      const newSidebarTabs = [...sidebarTabs.value];
      newSidebarTabs.splice(index2, 1);
      sidebarTabs.value = newSidebarTabs;
    }
  }, "unregisterSidebarTab");
  const registerCoreSidebarTabs = /* @__PURE__ */ __name(() => {
    registerSidebarTab(useQueueSidebarTab());
    registerSidebarTab(useNodeLibrarySidebarTab());
    registerSidebarTab(useModelLibrarySidebarTab());
    registerSidebarTab(useWorkflowsSidebarTab());
  }, "registerCoreSidebarTabs");
  return {
    sidebarTabs,
    activeSidebarTabId,
    activeSidebarTab,
    toggleSidebarTab,
    registerSidebarTab,
    unregisterSidebarTab,
    registerCoreSidebarTabs
  };
});
const useWorkspaceStore = /* @__PURE__ */ defineStore("workspace", () => {
  const spinner = ref(false);
  const shiftDown = ref(false);
  const focusMode = ref(false);
  const toast = computed(() => useToastStore());
  const queueSettings = computed(() => useQueueSettingsStore());
  const command2 = computed(() => ({
    commands: useCommandStore().commands,
    execute: useCommandStore().execute
  }));
  const sidebarTab = computed(() => useSidebarTabStore());
  const setting = computed(() => ({
    settings: useSettingStore().settingsById,
    get: useSettingStore().get,
    set: useSettingStore().set
  }));
  const workflow = computed(() => useWorkflowStore());
  const colorPalette = useColorPaletteService();
  const dialog = useDialogService();
  function registerSidebarTab(tab) {
    sidebarTab.value.registerSidebarTab(tab);
  }
  __name(registerSidebarTab, "registerSidebarTab");
  function unregisterSidebarTab(id3) {
    sidebarTab.value.unregisterSidebarTab(id3);
  }
  __name(unregisterSidebarTab, "unregisterSidebarTab");
  function getSidebarTabs() {
    return sidebarTab.value.sidebarTabs;
  }
  __name(getSidebarTabs, "getSidebarTabs");
  return {
    spinner,
    shiftDown,
    focusMode,
    toggleFocusMode: /* @__PURE__ */ __name(() => {
      focusMode.value = !focusMode.value;
    }, "toggleFocusMode"),
    toast,
    queueSettings,
    command: command2,
    sidebarTab,
    setting,
    workflow,
    colorPalette,
    dialog,
    registerSidebarTab,
    unregisterSidebarTab,
    getSidebarTabs
  };
});
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "App",
  setup(__props) {
    const workspaceStore = useWorkspaceStore();
    const isLoading = computed(() => workspaceStore.spinner);
    const handleKey = /* @__PURE__ */ __name((e2) => {
      workspaceStore.shiftDown = e2.shiftKey;
    }, "handleKey");
    useEventListener(window, "keydown", handleKey);
    useEventListener(window, "keyup", handleKey);
    const showContextMenu = /* @__PURE__ */ __name((event) => {
      const { target } = event;
      switch (true) {
        case target instanceof HTMLTextAreaElement:
        case (target instanceof HTMLInputElement && target.type === "text"):
          showNativeMenu({ type: "text" });
          return;
      }
    }, "showContextMenu");
    onMounted(() => {
      window["__COMFYUI_FRONTEND_VERSION__"] = config$1.app_version;
      console.log("ComfyUI Front-end version:", config$1.app_version);
      if (isElectron()) {
        document.addEventListener("contextmenu", showContextMenu);
      }
    });
    return (_ctx, _cache) => {
      const _component_router_view = resolveComponent("router-view");
      return openBlock(), createElementBlock(Fragment$1, null, [
        createVNode(_component_router_view),
        isLoading.value ? (openBlock(), createBlock(unref(script$Y), {
          key: 0,
          class: "absolute inset-0 flex justify-center items-center h-screen"
        })) : createCommentVNode("", true),
        createVNode(_sfc_main$Z),
        createVNode(unref(script$Z), {
          "full-screen": "",
          blocked: isLoading.value
        }, null, 8, ["blocked"])
      ], 64);
    };
  }
});
const ComfyUIPreset = definePreset(index$2, {
  semantic: {
    primary: index$2["primitive"].blue
  }
});
const app = createApp(_sfc_main);
const pinia = createPinia();
app.directive("tooltip", Tooltip);
app.use(router).use(PrimeVue, {
  theme: {
    preset: ComfyUIPreset,
    options: {
      prefix: "p",
      cssLayer: {
        name: "primevue",
        order: "primevue, tailwind-utilities"
      },
      // This is a workaround for the issue with the dark mode selector
      // https://github.com/primefaces/primevue/issues/5515
      darkModeSelector: ".dark-theme, :root:has(.dark-theme)"
    }
  }
}).use(ConfirmationService).use(ToastService).use(pinia).use(i18n).mount("#vue-app");
export {
  defineStore as $,
  getVNodeProp as A,
  BaseStyle as B,
  isArray$5 as C,
  mergeProps as D,
  renderList as E,
  Fragment$1 as F,
  resolveDynamicComponent as G,
  createBaseVNode as H,
  createCommentVNode as I,
  renderSlot as J,
  useSidebarTabStore as K,
  useBottomPanelStore as L,
  withCtx as M,
  createVNode as N,
  getAttribute as O,
  findSingle as P,
  focus$1 as Q,
  equals as R,
  Ripple as S,
  normalizeClass as T,
  getOffset as U,
  script$v as V,
  script$u as W,
  toDisplayString$1 as X,
  script$A as Y,
  markRaw as Z,
  _export_sfc as _,
  useSettingStore as a,
  useKeybindingStore as a$,
  shallowRef as a0,
  useI18n as a1,
  useCommandStore as a2,
  LiteGraph as a3,
  useColorPaletteStore as a4,
  watch as a5,
  useNodeDefStore as a6,
  BadgePosition as a7,
  LGraphBadge as a8,
  _ as a9,
  script$y as aA,
  resolveComponent as aB,
  Transition as aC,
  createSlots as aD,
  createTextVNode as aE,
  useNodeFrequencyStore as aF,
  useNodeBookmarkStore as aG,
  highlightQuery as aH,
  script$x as aI,
  formatNumberWithSuffix as aJ,
  NodeSourceType as aK,
  pushScopeId as aL,
  popScopeId as aM,
  NodePreview as aN,
  NodeSearchFilter as aO,
  script$P as aP,
  SearchFilterChip as aQ,
  useLitegraphService as aR,
  storeToRefs as aS,
  isRef as aT,
  toRaw as aU,
  LinkReleaseTriggerAction as aV,
  script$S as aW,
  useUserStore as aX,
  useDialogStore as aY,
  SettingDialogHeader as aZ,
  SettingDialogContent as a_,
  NodeBadgeMode as aa,
  ref as ab,
  useEventListener as ac,
  nextTick as ad,
  st as ae,
  normalizeI18nKey as af,
  LGraphGroup as ag,
  LGraphNode as ah,
  EditableText as ai,
  isNotEmpty as aj,
  UniqueComponentId as ak,
  ZIndex as al,
  resolveFieldData as am,
  OverlayEventBus as an,
  isEmpty$1 as ao,
  addStyle as ap,
  relativePosition as aq,
  absolutePosition as ar,
  ConnectedOverlayScrollHandler as as,
  isTouchDevice as at,
  findLastIndex as au,
  script$G as av,
  script$F as aw,
  script$Q as ax,
  script$p as ay,
  script$T as az,
  useWorkflowStore as b,
  BaseTerminal as b$,
  Teleport as b0,
  LinkMarkerShape as b1,
  useModelToNodeStore as b2,
  CanvasPointer as b3,
  IS_CONTROL_WIDGET as b4,
  updateControlWidgetLabel as b5,
  useColorPaletteService as b6,
  setStorageValue as b7,
  api as b8,
  usePragmaticDroppable as b9,
  useQueuePendingTaskCountStore as bA,
  useLocalStorage as bB,
  useDraggable as bC,
  watchDebounced as bD,
  inject as bE,
  useElementBounding as bF,
  lodashExports as bG,
  useEventBus as bH,
  script$n as bI,
  guardReactiveProps as bJ,
  useMenuItemStore as bK,
  usePragmaticDraggable as bL,
  withModifiers as bM,
  script$7 as bN,
  script$e as bO,
  provide as bP,
  script$O as bQ,
  useDialogService as bR,
  LGraphEventMode as bS,
  useQueueStore as bT,
  i18n as bU,
  useModelStore as bV,
  useRouter as bW,
  withKeys as bX,
  script$o as bY,
  script$q as bZ,
  ProgressStatus as b_,
  LGraph$1 as ba,
  LLink as bb,
  DragAndScale as bc,
  LGraphCanvas as bd,
  ContextMenu as be,
  ChangeTracker as bf,
  useWorkflowService as bg,
  ComfyNodeDefImpl as bh,
  ComfyModelDef as bi,
  script$r as bj,
  script$K as bk,
  script$s as bl,
  script$z as bm,
  script$W as bn,
  normalizeProps as bo,
  ToastEventBus as bp,
  setAttribute as bq,
  TransitionGroup as br,
  useToast as bs,
  useToastStore as bt,
  resolve$1 as bu,
  nestedPosition as bv,
  script$f as bw,
  isPrintableCharacter as bx,
  useQueueSettingsStore as by,
  script$l as bz,
  computed as c,
  electronAPI as c0,
  findIndexInList as c1,
  find$1 as c2,
  useModel as c3,
  script$k as c4,
  script$H as c5,
  script$I as c6,
  MigrationItems as c7,
  script$c as c8,
  script$d as c9,
  FocusTrap as cA,
  getIndex as cB,
  isClickable as cC,
  clearSelection as cD,
  localeComparator as cE,
  sort as cF,
  FilterService as cG,
  exportCSV as cH,
  getHiddenElementOuterWidth as cI,
  getHiddenElementOuterHeight as cJ,
  reorderArray as cK,
  getWindowScrollTop as cL,
  removeClass as cM,
  addClass as cN,
  useCopyToClipboard as cO,
  FormItem as cP,
  ComfyDialog as ca,
  $el as cb,
  ComfyApp as cc,
  useExtensionService as cd,
  processDynamicPrompt as ce,
  isElectron as cf,
  t as cg,
  DraggableList as ch,
  applyTextReplacements as ci,
  ComfyWidgets as cj,
  addValueControlWidgets as ck,
  serialise as cl,
  deserialiseAndCreate as cm,
  FilterMatchMode as cn,
  SearchBox as co,
  _sfc_main$K as cp,
  KeyComboImpl as cq,
  KeybindingImpl as cr,
  useExtensionStore as cs,
  script$X as ct,
  getFirstFocusableElement as cu,
  invokeElementMethod as cv,
  getNextElementSibling as cw,
  getPreviousElementSibling as cx,
  _default as cy,
  FilterOperator as cz,
  defineComponent as d,
  useTitle as e,
  createElementBlock as f,
  useWorkspaceStore as g,
  app$1 as h,
  withDirectives as i,
  unref as j,
  createBlock as k,
  script$R as l,
  onMounted as m,
  normalizeStyle as n,
  openBlock as o,
  onBeforeUnmount as p,
  script$_ as q,
  resolveDirective as r,
  showNativeMenu as s,
  getWidth as t,
  useExecutionStore as u,
  vShow as v,
  watchEffect as w,
  getHeight as x,
  getOuterWidth as y,
  getOuterHeight as z
};
//# sourceMappingURL=index-DjNHn37O.js.map
