//=============================================================================
// forge.js - In-game cheat & editor overlay for RPG Maker MV/MZ
//=============================================================================
/*:
 * @target MZ MV
 * @plugindesc Forge - modern in-game editor
 * @author len, shellawa
 * @url https://gitgud.io/zero64801/forge-mvmz/
 */
/*<DazedMTLTool-Forge-bootstrap>*/
(function () {
  var toggleKey = "f8";
  var uiScale = "2.5";
  // Forge's shortcut matcher uses legacy keyCode. Some NW.js/Wine builds deliver
  // keydown with keyCode=0 while still setting key/code - map those back.
  window.__dazedKeyCode = function (e) {
    var kc = e.keyCode || e.which || 0;
    if (kc) return kc;
    var key = String(e.key || "").toLowerCase();
    var code = String(e.code || "");
    if (key === "control") return 17;
    if (key === "alt") return 18;
    if (key === "shift") return 16;
    if (key === "meta") return 91;
    var fm = /^f(\d{1,2})$/.exec(key) || /^f(\d{1,2})$/i.exec(code);
    if (fm) return 111 + parseInt(fm[1], 10);
    var km = /^key([a-z])$/i.exec(code);
    if (km) return km[1].toUpperCase().charCodeAt(0);
    if (key.length === 1) {
      var c = key.charCodeAt(0);
      if (c >= 97 && c <= 122) return c - 32;
      if (c >= 48 && c <= 57) return c;
    }
    var dm = /^digit([0-9])$/i.exec(code);
    if (dm) return 48 + parseInt(dm[1], 10);
    return 0;
  };
  try {
    var saved = JSON.parse(localStorage.getItem("forge:shortcuts") || "{}");
    saved.toggle_ui = Object.assign({}, saved.toggle_ui, { keyStr: toggleKey, enabled: true });
    localStorage.setItem("forge:shortcuts", JSON.stringify(saved));
  } catch (e) {}
  function resolveUiScale(v) {
    if (v !== "auto" && v != null && String(v).trim() !== "") {
      var n = parseFloat(v);
      if (!isNaN(n) && n > 0) return Math.max(0.75, Math.min(3, n));
    }
    var base = 816;
    var gameW = (typeof Graphics !== "undefined" && Graphics.width) ? Graphics.width : 0;
    var viewW = window.innerWidth || document.documentElement.clientWidth || base;
    var w = Math.max(gameW || base, viewW);
    var scale = w / base;
    var dpr = window.devicePixelRatio || 1;
    if (dpr > 1.15) scale *= Math.min(2, 0.75 + dpr * 0.35);
    return Math.max(1, Math.min(2.75, scale));
  }
  function applyUiScale() {
    var host = document.getElementById("forge-mvmz-host");
    if (!host) return;
    var fx = resolveUiScale(uiScale);
    host.style.zoom = String(fx);
  }
  if (!window.__dazedForgeUiScaleHook) {
    window.__dazedForgeUiScaleHook = true;
    var observer = new MutationObserver(applyUiScale);
    observer.observe(document.documentElement, { childList: true, subtree: true });
    window.addEventListener("resize", applyUiScale);
    setInterval(applyUiScale, 500);
  }
  applyUiScale();
})();
/*</DazedMTLTool-Forge-bootstrap>*/
(function(){var e=document.createElement(`style`);e.textContent=`@import "https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap";:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-400:#ff6568;--color-orange-400:#ff8b1a;--color-yellow-300:#ffe02a;--color-yellow-400:#fac800;--color-yellow-500:#edb200;--color-fuchsia-500:#e12afb;--color-gray-200:#e5e7eb;--color-gray-300:#d1d5dc;--color-gray-400:#99a1af;--color-gray-500:#6a7282;--color-gray-600:#4a5565;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#0b0c10;--color-bg2:#13151f;--color-text:#f1f5f9;--color-text-dim:#9aa1b1;--color-accent:#6366f1;--color-accent-weak:#1e3a6e;--color-border:#222533;--color-danger:#ef4444;--color-ok:#10b981;--color-warn:#fb923c;--color-frozen:#8b5cf6}@supports (color:lab(0% 0 0)){:root,:host{--color-red-400:lab(63.7053% 60.745 31.3109);--color-orange-400:lab(70.0429% 42.5156 75.8207);--color-yellow-300:lab(89.7033% -.480294 84.4917);--color-yellow-400:lab(83.2664% 8.65132 106.895);--color-yellow-500:lab(76.3898% 14.5258 98.4589);--color-fuchsia-500:lab(56.4256% 83.132 -64.639);--color-gray-200:lab(91.6229% -.159115 -2.26791);--color-gray-300:lab(85.1236% -.612259 -3.7138);--color-gray-400:lab(65.9269% -.832707 -8.17473);--color-gray-500:lab(47.7841% -.393182 -10.0268);--color-gray-600:lab(35.6337% -1.58697 -10.8425)}}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::-webkit-file-upload-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:transparent;border-radius:0}::-webkit-file-upload-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:transparent;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:transparent;border-radius:0}:where(select:-webkit-any([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:-webkit-any([multiple],[size])) optgroup option{padding-left:20px}:where(select:is([multiple],[size])) optgroup option{padding-left:20px}::-webkit-file-upload-button{margin-right:4px}::file-selector-button{margin-right:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button{-webkit-appearance:button;appearance:button}input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;appearance:button}::-webkit-file-upload-button{-webkit-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;bottom:0;left:0;right:0}.top-0{top:0}.top-4{top:calc(var(--spacing) * 4)}.top-\\[-0\\.5px\\]{top:-.5px}.top-\\[4px\\]{top:4px}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.left-4{left:calc(var(--spacing) * 4)}.left-\\[4px\\]{left:4px}.left-\\[24px\\]{left:24px}.z-2147482999{z-index:2147482999}.z-2147483000{z-index:2147483000}.z-2147483647{z-index:2147483647}.m-0{margin:0}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-1{margin-right:var(--spacing)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-4{margin-right:calc(var(--spacing) * 4)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.min-h-0{min-height:0}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-32{width:calc(var(--spacing) * 32)}.w-40{width:calc(var(--spacing) * 40)}.w-48{width:calc(var(--spacing) * 48)}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-nwse-resize{cursor:nwse-resize}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.grid-cols-\\[repeat\\(auto-fit\\,minmax\\(140px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}.grid-cols-\\[repeat\\(auto-fit\\,minmax\\(160px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}.grid-cols-\\[repeat\\(auto-fit\\,minmax\\(260px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}.grid-cols-\\[repeat\\(auto-fit\\,minmax\\(300px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{grid-gap:calc(var(--spacing) * 2);gap:calc(var(--spacing) * 2)}.gap-3{grid-gap:calc(var(--spacing) * 3);gap:calc(var(--spacing) * 3)}.gap-4{grid-gap:calc(var(--spacing) * 4);gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-top:calc(var(--spacing) * var(--tw-space-y-reverse));margin-bottom:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-top:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-bottom:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-top:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-bottom:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-top:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-bottom:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-left:calc(var(--spacing) * var(--tw-space-x-reverse));margin-right:calc(var(--spacing) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1\\.5>:not(:last-child)){--tw-space-x-reverse:0;margin-left:calc(calc(var(--spacing) * 1.5) * var(--tw-space-x-reverse));margin-right:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-left:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-right:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2\\.5>:not(:last-child)){--tw-space-x-reverse:0;margin-left:calc(calc(var(--spacing) * 2.5) * var(--tw-space-x-reverse));margin-right:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-left:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-right:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3\\.5>:not(:last-child)){--tw-space-x-reverse:0;margin-left:calc(calc(var(--spacing) * 3.5) * var(--tw-space-x-reverse));margin-right:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-left:calc(calc(var(--spacing) * 4) * var(--tw-space-x-reverse));margin-right:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border>:not(:last-child)){border-color:var(--color-border)}:where(.divide-border\\/50>:not(:last-child)){border-color:rgba(34,37,51,.5)}@supports (color:color-mix(in lab, red, red)){:where(.divide-border\\/50>:not(:last-child)){border-color:color-mix(in oklab, var(--color-border) 50%, transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[\\#2a2d3a\\]{border-color:#2a2d3a}.border-accent{border-color:var(--color-accent)}.border-accent\\/30{border-color:rgba(99,102,241,.3)}@supports (color:color-mix(in lab, red, red)){.border-accent\\/30{border-color:color-mix(in oklab, var(--color-accent) 30%, transparent)}}.border-accent\\/50{border-color:rgba(99,102,241,.5)}@supports (color:color-mix(in lab, red, red)){.border-accent\\/50{border-color:color-mix(in oklab, var(--color-accent) 50%, transparent)}}.border-border{border-color:var(--color-border)}.border-border\\/50{border-color:rgba(34,37,51,.5)}@supports (color:color-mix(in lab, red, red)){.border-border\\/50{border-color:color-mix(in oklab, var(--color-border) 50%, transparent)}}.border-danger\\/30{border-color:rgba(239,68,68,.3)}@supports (color:color-mix(in lab, red, red)){.border-danger\\/30{border-color:color-mix(in oklab, var(--color-danger) 30%, transparent)}}.border-fuchsia-500\\/30{border-color:rgba(225,42,251,.3)}@supports (color:color-mix(in lab, red, red)){.border-fuchsia-500\\/30{border-color:color-mix(in oklab, var(--color-fuchsia-500) 30%, transparent)}}.border-gray-500\\/30{border-color:rgba(106,114,130,.3)}@supports (color:color-mix(in lab, red, red)){.border-gray-500\\/30{border-color:color-mix(in oklab, var(--color-gray-500) 30%, transparent)}}.border-ok\\/30{border-color:rgba(16,185,129,.3)}@supports (color:color-mix(in lab, red, red)){.border-ok\\/30{border-color:color-mix(in oklab, var(--color-ok) 30%, transparent)}}.border-warn\\/30{border-color:rgba(251,146,60,.3)}@supports (color:color-mix(in lab, red, red)){.border-warn\\/30{border-color:color-mix(in oklab, var(--color-warn) 30%, transparent)}}.border-yellow-500\\/30{border-color:rgba(237,178,0,.3)}@supports (color:color-mix(in lab, red, red)){.border-yellow-500\\/30{border-color:color-mix(in oklab, var(--color-yellow-500) 30%, transparent)}}.border-l-frozen{border-left-color:var(--color-frozen)}.bg-\\[\\#1a1d24\\]{background-color:#1a1d24}.bg-\\[\\#3a3f4d\\]{background-color:#3a3f4d}.bg-\\[\\#7ba4ff\\]\\/10{background-color:rgba(123,164,255,.1);background-color:lab(67.3388% 4.90472 -50.2993/.1)}.bg-\\[\\#13151a\\]{background-color:#13151a}.bg-accent{background-color:var(--color-accent)}.bg-accent-weak{background-color:var(--color-accent-weak)}.bg-accent\\/5{background-color:rgba(99,102,241,.05)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/5{background-color:color-mix(in oklab, var(--color-accent) 5%, transparent)}}.bg-accent\\/10{background-color:rgba(99,102,241,.1)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/10{background-color:color-mix(in oklab, var(--color-accent) 10%, transparent)}}.bg-accent\\/20{background-color:rgba(99,102,241,.2)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/20{background-color:color-mix(in oklab, var(--color-accent) 20%, transparent)}}.bg-bg{background-color:var(--color-bg)}.bg-bg2{background-color:var(--color-bg2)}.bg-border{background-color:var(--color-border)}.bg-border\\/50{background-color:rgba(34,37,51,.5)}@supports (color:color-mix(in lab, red, red)){.bg-border\\/50{background-color:color-mix(in oklab, var(--color-border) 50%, transparent)}}.bg-danger{background-color:var(--color-danger)}.bg-danger\\/10{background-color:rgba(239,68,68,.1)}@supports (color:color-mix(in lab, red, red)){.bg-danger\\/10{background-color:color-mix(in oklab, var(--color-danger) 10%, transparent)}}.bg-danger\\/20{background-color:rgba(239,68,68,.2)}@supports (color:color-mix(in lab, red, red)){.bg-danger\\/20{background-color:color-mix(in oklab, var(--color-danger) 20%, transparent)}}.bg-frozen\\/20{background-color:rgba(139,92,246,.2)}@supports (color:color-mix(in lab, red, red)){.bg-frozen\\/20{background-color:color-mix(in oklab, var(--color-frozen) 20%, transparent)}}.bg-fuchsia-500\\/10{background-color:rgba(225,42,251,.1)}@supports (color:color-mix(in lab, red, red)){.bg-fuchsia-500\\/10{background-color:color-mix(in oklab, var(--color-fuchsia-500) 10%, transparent)}}.bg-gray-500\\/10{background-color:rgba(106,114,130,.1)}@supports (color:color-mix(in lab, red, red)){.bg-gray-500\\/10{background-color:color-mix(in oklab, var(--color-gray-500) 10%, transparent)}}.bg-ok{background-color:var(--color-ok)}.bg-ok\\/10{background-color:rgba(16,185,129,.1)}@supports (color:color-mix(in lab, red, red)){.bg-ok\\/10{background-color:color-mix(in oklab, var(--color-ok) 10%, transparent)}}.bg-ok\\/20{background-color:rgba(16,185,129,.2)}@supports (color:color-mix(in lab, red, red)){.bg-ok\\/20{background-color:color-mix(in oklab, var(--color-ok) 20%, transparent)}}.bg-transparent{background-color:transparent}.bg-warn\\/10{background-color:rgba(251,146,60,.1)}@supports (color:color-mix(in lab, red, red)){.bg-warn\\/10{background-color:color-mix(in oklab, var(--color-warn) 10%, transparent)}}.bg-white{background-color:var(--color-white)}.bg-yellow-500\\/10{background-color:rgba(237,178,0,.1)}@supports (color:color-mix(in lab, red, red)){.bg-yellow-500\\/10{background-color:color-mix(in oklab, var(--color-yellow-500) 10%, transparent)}}.fill-current{fill:currentColor}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-1{padding-left:var(--spacing);padding-right:var(--spacing)}.px-1\\.5{padding-left:calc(var(--spacing) * 1.5);padding-right:calc(var(--spacing) * 1.5)}.px-2{padding-left:calc(var(--spacing) * 2);padding-right:calc(var(--spacing) * 2)}.px-2\\.5{padding-left:calc(var(--spacing) * 2.5);padding-right:calc(var(--spacing) * 2.5)}.px-3{padding-left:calc(var(--spacing) * 3);padding-right:calc(var(--spacing) * 3)}.px-3\\.5{padding-left:calc(var(--spacing) * 3.5);padding-right:calc(var(--spacing) * 3.5)}.px-4{padding-left:calc(var(--spacing) * 4);padding-right:calc(var(--spacing) * 4)}.py-0\\.5{padding-top:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * .5)}.py-1{padding-top:var(--spacing);padding-bottom:var(--spacing)}.py-1\\.5{padding-top:calc(var(--spacing) * 1.5);padding-bottom:calc(var(--spacing) * 1.5)}.py-2{padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 2)}.py-3{padding-top:calc(var(--spacing) * 3);padding-bottom:calc(var(--spacing) * 3)}.pt-1{padding-top:var(--spacing)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[\\#7ba4ff\\]{color:#7ba4ff}.text-accent{color:var(--color-accent)}.text-danger{color:var(--color-danger)}.text-frozen{color:var(--color-frozen)}.text-fuchsia-500{color:var(--color-fuchsia-500)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-ok{color:var(--color-ok)}.text-orange-400{color:var(--color-orange-400)}.text-text{color:var(--color-text)}.text-text-dim{color:var(--color-text-dim)}.text-warn{color:var(--color-warn)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.uppercase{text-transform:uppercase}.opacity-50{opacity:.5}.opacity-90{opacity:.9}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,rgba(0,0,0,.1)), 0 1px 2px -1px var(--tw-shadow-color,rgba(0,0,0,.1));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,rgba(0,0,0,.25));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,rgba(0,0,0,.1)), 0 4px 6px -4px var(--tw-shadow-color,rgba(0,0,0,.1));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,rgba(0,0,0,.1)), 0 1px 2px -1px var(--tw-shadow-color,rgba(0,0,0,.1));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{user-select:none}.select-text{user-select:text}@media (hover:hover){.group-hover\\:text-accent:is(:where(.group):hover *){color:var(--color-accent)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.first-letter\\:text-\\[\\#7ba4ff\\]:first-letter{color:#7ba4ff}@media (hover:hover){.hover\\:bg-\\[\\#2a2d3a\\]:hover{background-color:#2a2d3a}.hover\\:bg-accent\\/20:hover{background-color:rgba(99,102,241,.2)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/20:hover{background-color:color-mix(in oklab, var(--color-accent) 20%, transparent)}}.hover\\:bg-accent\\/30:hover{background-color:rgba(99,102,241,.3)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/30:hover{background-color:color-mix(in oklab, var(--color-accent) 30%, transparent)}}.hover\\:bg-accent\\/80:hover{background-color:rgba(99,102,241,.8)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/80:hover{background-color:color-mix(in oklab, var(--color-accent) 80%, transparent)}}.hover\\:bg-accent\\/85:hover{background-color:rgba(99,102,241,.85)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/85:hover{background-color:color-mix(in oklab, var(--color-accent) 85%, transparent)}}.hover\\:bg-border:hover{background-color:var(--color-border)}.hover\\:bg-border\\/30:hover{background-color:rgba(34,37,51,.3)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-border\\/30:hover{background-color:color-mix(in oklab, var(--color-border) 30%, transparent)}}.hover\\:bg-border\\/50:hover{background-color:rgba(34,37,51,.5)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-border\\/50:hover{background-color:color-mix(in oklab, var(--color-border) 50%, transparent)}}.hover\\:bg-border\\/80:hover{background-color:rgba(34,37,51,.8)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-border\\/80:hover{background-color:color-mix(in oklab, var(--color-border) 80%, transparent)}}.hover\\:bg-danger\\/20:hover{background-color:rgba(239,68,68,.2)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-danger\\/20:hover{background-color:color-mix(in oklab, var(--color-danger) 20%, transparent)}}.hover\\:bg-danger\\/30:hover{background-color:rgba(239,68,68,.3)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-danger\\/30:hover{background-color:color-mix(in oklab, var(--color-danger) 30%, transparent)}}.hover\\:bg-danger\\/80:hover{background-color:rgba(239,68,68,.8)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-danger\\/80:hover{background-color:color-mix(in oklab, var(--color-danger) 80%, transparent)}}.hover\\:bg-frozen\\/30:hover{background-color:rgba(139,92,246,.3)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-frozen\\/30:hover{background-color:color-mix(in oklab, var(--color-frozen) 30%, transparent)}}.hover\\:bg-ok\\/30:hover{background-color:rgba(16,185,129,.3)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-ok\\/30:hover{background-color:color-mix(in oklab, var(--color-ok) 30%, transparent)}}.hover\\:text-danger:hover{color:var(--color-danger)}.hover\\:text-gray-200:hover{color:var(--color-gray-200)}.hover\\:text-gray-300:hover{color:var(--color-gray-300)}.hover\\:text-gray-400:hover{color:var(--color-gray-400)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-yellow-300:hover{color:var(--color-yellow-300)}.hover\\:opacity-100:hover{opacity:1}.hover\\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:border-accent:focus{border-color:var(--color-accent)}.focus\\:bg-border\\/30:focus{background-color:rgba(34,37,51,.3)}@supports (color:color-mix(in lab, red, red)){.focus\\:bg-border\\/30:focus{background-color:color-mix(in oklab, var(--color-border) 30%, transparent)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.disabled\\:opacity-50:disabled{opacity:.5}:host{--color-bg:#0b0c10;--color-bg-elev:#13151f;--color-bg-input:#1a1c29;--color-bg2:#13151f;--color-text:#f1f5f9;--color-text-dim:#9aa1b1;--color-text-faint:#646b7d;--color-accent:#6366f1;--color-accent-weak:#1e3a6e;--color-border:#222533;--color-danger:#ef4444;--color-ok:#10b981;--color-warn:#fb923c;--color-frozen:#8b5cf6}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#222533;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#6366f1}body,:host{color:#f1f5f9;font-family:Outfit,system-ui,-apple-system,sans-serif}*,:after,:before{--tw-border-style:solid}.cursor-grab{cursor:-webkit-grab;cursor:grab}.active\\:cursor-grabbing:active{cursor:-webkit-grabbing;cursor:grabbing}.space-x-1>:not([hidden])~:not([hidden]){margin-left:4px}.space-x-1\\.5>:not([hidden])~:not([hidden]){margin-left:6px}.space-x-2>:not([hidden])~:not([hidden]){margin-left:8px}.space-x-2\\.5>:not([hidden])~:not([hidden]){margin-left:10px}.space-x-3>:not([hidden])~:not([hidden]){margin-left:12px}.space-x-4>:not([hidden])~:not([hidden]){margin-left:16px}.space-y-0\\.5>:not([hidden])~:not([hidden]){margin-top:2px}.space-y-1>:not([hidden])~:not([hidden]){margin-top:4px}.space-y-2>:not([hidden])~:not([hidden]){margin-top:8px}.space-y-2\\.5>:not([hidden])~:not([hidden]){margin-top:10px}.space-y-3>:not([hidden])~:not([hidden]){margin-top:12px}.space-y-4>:not([hidden])~:not([hidden]){margin-top:16px}.space-y-6>:not([hidden])~:not([hidden]){margin-top:24px}.divide-y>:not([hidden])~:not([hidden]){border-top-width:1px;border-color:var(--color-border)}input,textarea,[contenteditable=true]{user-select:text!important}button,button:focus{outline:none!important}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 transparent}@property --tw-duration{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 transparent;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 transparent;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 transparent;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 transparent;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 transparent;--tw-duration:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}
/*$vite$:1*/`,document.head.appendChild(e);var t=!1,n=Array.isArray,r=Array.prototype.indexOf,i=Array.prototype.includes,a=Array.from,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,l=Object.prototype,u=Array.prototype,d=Object.getPrototypeOf,f=Object.isExtensible;function p(e){return typeof e==`function`}var m=()=>{};function h(e){return e()}function g(e){for(var t=0;t<e.length;t++)e[t]()}function _(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function v(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}function y(e){"@babel/helpers - typeof";return y=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},y(e)}function b(e,t){if(y(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(y(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function x(e){var t=b(e,`string`);return y(t)==`symbol`?t:t+``}function S(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ee,C=1<<24,w=1024,te=2048,ne=4096,re=8192,ie=16384,ae=32768,oe=1<<25,se=65536,ce=1<<19,le=1<<20,ue=1<<25,de=65536,fe=1<<21,pe=1<<22,me=1<<23,he=Symbol(`$state`),ge=Symbol(`legacy props`),_e=Symbol(``),ve=Symbol(`proxy path`),ye=Symbol(`attributes`),be=Symbol(`class`),xe=Symbol(`style`),Se=Symbol(`text`),Ce=Symbol(`form reset`),we=Symbol(`hmr anchor`),Te=new class extends Error{constructor(...e){super(...e),S(this,`name`,`StaleReactionError`),S(this,`message`,"The reaction that called `getAbortSignal()` was re-run or destroyed")}},Ee=!!((ee=globalThis.document)!=null&&ee.contentType)&&globalThis.document.contentType.includes(`xml`);function De(e){if(t){let t=Error(`invariant_violation\nAn invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app — please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${e}"\nhttps://svelte.dev/e/invariant_violation`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/invariant_violation`)}function Oe(e){if(t){let t=Error(`lifecycle_outside_component\n\`${e}(...)\` can only be used during component initialisation\nhttps://svelte.dev/e/lifecycle_outside_component`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ke(){if(t){let e=Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Ae(){if(t){let e=Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/bind_invalid_checkbox_value`)}function je(){if(t){let e=Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/derived_references_self`)}function Me(e,n,r){if(t){let t=Error(`each_key_duplicate\n${r?`Keyed each block has duplicate key \`${r}\` at indexes ${e} and ${n}`:`Keyed each block has duplicate key at indexes ${e} and ${n}`}\nhttps://svelte.dev/e/each_key_duplicate`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ne(e,n,r){if(t){let t=Error(`each_key_volatile\nKeyed each block has key that is not idempotent — the key for item at index ${e} was \`${n}\` but is now \`${r}\`. Keys must be the same each time for a given item\nhttps://svelte.dev/e/each_key_volatile`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/each_key_volatile`)}function Pe(e){if(t){let t=Error(`effect_in_teardown\n\`${e}\` cannot be used inside an effect cleanup function\nhttps://svelte.dev/e/effect_in_teardown`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Fe(){if(t){let e=Error(`effect_in_unowned_derived
Effect cannot be created inside a \`$derived\` value that was not itself created inside an effect
https://svelte.dev/e/effect_in_unowned_derived`);throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Ie(e){if(t){let t=Error(`effect_orphan\n\`${e}\` can only be used inside an effect (e.g. during component initialisation)\nhttps://svelte.dev/e/effect_orphan`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/effect_orphan`)}function Le(){if(t){let e=Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Re(){if(t){let e=Error("invalid_snippet\nCould not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\nhttps://svelte.dev/e/invalid_snippet");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/invalid_snippet`)}function ze(e){if(t){let t=Error(`props_invalid_value\nCannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value\nhttps://svelte.dev/e/props_invalid_value`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/props_invalid_value`)}function Be(e){if(t){let t=Error(`props_rest_readonly\nRest element properties of \`$props()\` such as \`${e}\` are readonly\nhttps://svelte.dev/e/props_rest_readonly`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/props_rest_readonly`)}function Ve(e){if(t){let t=Error(`rune_outside_svelte\nThe \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files\nhttps://svelte.dev/e/rune_outside_svelte`);throw t.name=`Svelte error`,t}else throw Error(`https://svelte.dev/e/rune_outside_svelte`)}function He(){if(t){let e=Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ue(){if(t){let e=Error(`state_prototype_fixed
Cannot set prototype of \`$state\` object
https://svelte.dev/e/state_prototype_fixed`);throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function We(){if(t){let e=Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ge(){if(t){let e=Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name=`Svelte error`,e}else throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ke={},qe=Symbol(`uninitialized`),Je=Symbol(`filename`),Ye=`http://www.w3.org/1999/xhtml`,Xe=`http://www.w3.org/2000/svg`,Ze=`font-weight: bold`,Qe=`font-weight: normal`;function $e(e){t?console.warn(`%c[svelte] await_reactivity_loss\n%cDetected reactivity loss when reading \`${e}\`. This happens when state is read in an async function after an earlier \`await\`\nhttps://svelte.dev/e/await_reactivity_loss`,Ze,Qe):console.warn(`https://svelte.dev/e/await_reactivity_loss`)}function et(e,n){t?console.warn(`%c[svelte] await_waterfall\n%cAn async derived, \`${e}\` (${n}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\nhttps://svelte.dev/e/await_waterfall`,Ze,Qe):console.warn(`https://svelte.dev/e/await_waterfall`)}function tt(){t?console.warn(`%c[svelte] derived_inert
%cReading a derived belonging to a now-destroyed effect may result in stale values
https://svelte.dev/e/derived_inert`,Ze,Qe):console.warn(`https://svelte.dev/e/derived_inert`)}function nt(e,n,r){t?console.warn(`%c[svelte] hydration_attribute_changed\n%cThe \`${e}\` attribute on \`${n}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value\nhttps://svelte.dev/e/hydration_attribute_changed`,Ze,Qe):console.warn(`https://svelte.dev/e/hydration_attribute_changed`)}function rt(e){t?console.warn(`%c[svelte] hydration_mismatch\n%c${e?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${e}`:`Hydration failed because the initial UI does not match what was rendered on the server`}\nhttps://svelte.dev/e/hydration_mismatch`,Ze,Qe):console.warn(`https://svelte.dev/e/hydration_mismatch`)}function it(){t?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `<select multiple>` element should be an array, but it received a non-array value. The selection will be kept as is.\nhttps://svelte.dev/e/select_multiple_invalid_value",Ze,Qe):console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function at(e){t?console.warn(`%c[svelte] state_proxy_equality_mismatch\n%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results\nhttps://svelte.dev/e/state_proxy_equality_mismatch`,Ze,Qe):console.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`)}function ot(){t?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Ze,Qe):console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var T=!1;function st(e){T=e}var E;function ct(e){if(e===null)throw rt(),Ke;return E=e}function lt(){return ct(gi(E))}function D(e){if(T){if(gi(E)!==null)throw rt(),Ke;E=e}}function ut(e=1){if(T){for(var t=e,n=E;t--;)n=gi(n);E=n}}function dt(e=!0){for(var t=0,n=E;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=gi(n);e&&n.remove(),n=i}}function ft(e){if(!e||e.nodeType!==8)throw rt(),Ke;return e.data}function pt(e){return e===this.v}function mt(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function ht(e){return!mt(e,this.v)}var gt=!1,_t=!1,vt=!1;function yt(){_t=!0}var bt=null;function xt(e,t){return e.label=t,St(e.v,t),e}function St(e,t){var n;return e==null||(n=e[ve])==null||n.call(e,t),e}function Ct(e){let t=Error(),n=wt();return n.length===0?null:(n.unshift(`
`),o(t,`stack`,{value:n.join(`
`)}),o(t,`name`,{value:e}),t)}function wt(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=Error().stack;if(Error.stackTraceLimit=e,!t)return[];let n=t.split(`
`),r=[];for(let e=0;e<n.length;e++){let t=n[e],i=t.replaceAll(`\\`,`/`);if(t.trim()!==`Error`){if(t.includes(`validate_each_keys`))return[];i.includes(`svelte/src/internal`)||i.includes(`node_modules/.vite`)||r.push(t)}}return r}function Tt(e,n){if(!t)throw Error(`invariant(...) was not guarded by if (DEV)`);e||De(n)}var O=null;function Et(e){O=e}var Dt=null;function Ot(e){Dt=e}var kt=null;function At(e){kt=e}function jt(e){return Ft(`getContext`).get(e)}function Mt(e,n=!1,r){O={p:O,i:!1,c:null,e:null,s:e,x:null,r:V,l:_t&&!n?{s:null,u:null,$:[]}:null},t&&(O.function=r,kt=r)}function Nt(e){var n=O,r=n.e;if(r!==null){n.e=null;for(var i of r)Ni(i)}if(e!==void 0&&(n.x=e),n.i=!0,O=n.p,t){var a;kt=(a=O==null?void 0:O.function)==null?null:a}return e==null?{}:e}function Pt(){return!_t||O!==null&&O.l===null}function Ft(e){var t,n;return O===null&&Oe(e),(n=(t=O).c)==null?t.c=new Map(It(O)||void 0):n}function It(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var Lt=[];function Rt(){var e=Lt;Lt=[],g(e)}function zt(e){if(Lt.length===0&&!ir){var t=Lt;queueMicrotask(()=>{t===Lt&&Rt()})}Lt.push(e)}function Bt(){for(;Lt.length>0;)Rt()}var Vt=new WeakMap;function Ht(e){var n=V;if(n===null)return B.f|=me,e;if(t&&e instanceof Error&&!Vt.has(e)&&Vt.set(e,Wt(e,n)),!(n.f&32768)&&!(n.f&4))throw t&&!n.parent&&e instanceof Error&&Gt(e),e;Ut(e,n)}function Ut(e,n){if(!(n!==null&&n.f&16384)){for(;n!==null;){if(n.f&128){if(!(n.f&32768))throw e;try{n.b.error(e);return}catch(t){e=t}}n=n.parent}throw t&&e instanceof Error&&Gt(e),e}}function Wt(e,t){var n,r;let i=s(e,`message`);if(!(i&&!i.configurable)){for(var a=ui?`  `:`	`,o=`\n${a}in ${((n=t.fn)==null?void 0:n.name)||`<unknown>`}`,c=t.ctx;c!==null;){var l;o+=`\n${a}in ${(l=c.function)==null?void 0:l[Je].split(`/`).pop()}`,c=c.p}return{message:e.message+`\n${o}\n`,stack:(r=e.stack)==null?void 0:r.split(`
`).filter(e=>!e.includes(`svelte/src/internal`)).join(`
`)}}}function Gt(e){let t=Vt.get(e);t&&(o(e,`message`,{value:t.message}),o(e,`stack`,{value:t.stack}))}var Kt=~(te|ne|w);function qt(e,t){e.f=e.f&Kt|t}function Jt(e){e.f&512||e.deps===null?qt(e,w):qt(e,ne)}function Yt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=de,Yt(t.deps))}function Xt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Yt(e.deps),qt(e,w)}var Zt=!1,Qt=!1;function $t(e){var t=Qt;try{return Qt=!1,[e(),Qt]}finally{Qt=t}}function en(e){let n=0,r=Xr(0),i;return t&&xt(r,`createSubscriber version`),()=>{Ai()&&(H(r),Ri(()=>(n===0&&(i=Ea(()=>e(()=>ei(r)))),n+=1,()=>{zt(()=>{--n,n===0&&(i==null||i(),i=void 0,ei(r))})})))}}function tn(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function nn(e,t){tn(e,t),t.add(e)}function k(e,t,n){tn(e,t),t.set(e,n)}function A(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function j(e,t,n){return e.set(A(e,t),n),n}function M(e,t){return e.get(A(e,t))}var rn=se|ce;function an(e,t,n,r){new Cn(e,t,n,r)}var on=new WeakMap,sn=new WeakMap,cn=new WeakMap,ln=new WeakMap,un=new WeakMap,dn=new WeakMap,fn=new WeakMap,pn=new WeakMap,mn=new WeakMap,hn=new WeakMap,gn=new WeakMap,_n=new WeakMap,vn=new WeakMap,yn=new WeakMap,bn=new WeakMap,xn=new WeakMap,Sn=new WeakSet,Cn=class{constructor(e,n,r,i){var a,o;nn(this,Sn),S(this,`parent`,void 0),S(this,`is_pending`,!1),S(this,`transform_error`,void 0),k(this,on,void 0),k(this,sn,T?E:null),k(this,cn,void 0),k(this,ln,void 0),k(this,un,void 0),k(this,dn,null),k(this,fn,null),k(this,pn,null),k(this,mn,null),k(this,hn,0),k(this,gn,0),k(this,_n,!1),k(this,vn,new Set),k(this,yn,new Set),k(this,bn,null),k(this,xn,en(()=>(j(bn,this,Xr(M(hn,this))),t&&xt(M(bn,this),`$effect.pending()`),()=>{j(bn,this,null)}))),j(on,this,e),j(cn,this,n),j(ln,this,e=>{var t=V;t.b=this,t.f|=128,r(e)}),this.parent=V.b,this.transform_error=(a=i==null?(o=this.parent)==null?void 0:o.transform_error:i)==null?(e=>e):a,j(un,this,zi(()=>{if(T){let e=M(sn,this);lt();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));A(Sn,this,Tn).call(this,t)}else t?A(Sn,this,En).call(this):A(Sn,this,wn).call(this)}else A(Sn,this,Dn).call(this)},rn)),T&&j(on,this,E)}defer_effect(e){Xt(e,M(vn,this),M(yn,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!M(cn,this).pending}update_pending_count(e,t){A(Sn,this,An).call(this,e,t),j(hn,this,M(hn,this)+e),!(!M(bn,this)||M(_n,this))&&(j(_n,this,!0),zt(()=>{j(_n,this,!1),M(bn,this)&&Qr(M(bn,this),M(hn,this))}))}get_effect_pending(){return M(xn,this).call(this),H(M(bn,this))}error(e){if(!M(cn,this).onerror&&!M(cn,this).failed)throw e;N!=null&&N.is_fork?(M(dn,this)&&N.skip_effect(M(dn,this)),M(fn,this)&&N.skip_effect(M(fn,this)),M(pn,this)&&N.skip_effect(M(pn,this)),N.oncommit(()=>{A(Sn,this,jn).call(this,e)})):A(Sn,this,jn).call(this,e)}};function wn(){try{j(dn,this,Vi(()=>M(ln,this).call(this,M(on,this))))}catch(e){this.error(e)}}function Tn(e){let t=M(cn,this).failed;t&&j(pn,this,Vi(()=>{t(M(on,this),()=>e,()=>()=>{})}))}function En(){let e=M(cn,this).pending;e&&(this.is_pending=!0,j(fn,this,Vi(()=>e(M(on,this)))),zt(()=>{var e=j(mn,this,document.createDocumentFragment()),t=mi();e.append(t),j(dn,this,A(Sn,this,kn).call(this,()=>Vi(()=>M(ln,this).call(this,t)))),M(gn,this)===0&&(M(on,this).before(e),j(mn,this,null),Ji(M(fn,this),()=>{j(fn,this,null)}),A(Sn,this,On).call(this,N))}))}function Dn(){try{if(this.is_pending=this.has_pending_snippet(),j(gn,this,0),j(hn,this,0),j(dn,this,Vi(()=>{M(ln,this).call(this,M(on,this))})),M(gn,this)>0){var e=j(mn,this,document.createDocumentFragment());Qi(M(dn,this),e);let t=M(cn,this).pending;j(fn,this,Vi(()=>t(M(on,this))))}else A(Sn,this,On).call(this,N)}catch(e){this.error(e)}}function On(e){this.is_pending=!1,e.transfer_effects(M(vn,this),M(yn,this))}function kn(e){var t=V,n=B,r=O;aa(M(un,this)),ia(M(un,this)),Et(M(un,this).ctx);try{return Dr.ensure(),e()}catch(e){return Ht(e),null}finally{aa(t),ia(n),Et(r)}}function An(e,t){if(!this.has_pending_snippet()){if(this.parent){var n;A(Sn,n=this.parent,An).call(n,e,t)}return}j(gn,this,M(gn,this)+e),M(gn,this)===0&&(A(Sn,this,On).call(this,t),M(fn,this)&&Ji(M(fn,this),()=>{j(fn,this,null)}),M(mn,this)&&(M(on,this).before(M(mn,this)),j(mn,this,null)))}function jn(e){M(dn,this)&&(Gi(M(dn,this)),j(dn,this,null)),M(fn,this)&&(Gi(M(fn,this)),j(fn,this,null)),M(pn,this)&&(Gi(M(pn,this)),j(pn,this,null)),T&&(ct(M(sn,this)),ut(),ct(dt()));var t=M(cn,this).onerror;let n=M(cn,this).failed;var r=!1,i=!1;let a=()=>{if(r){ot();return}r=!0,i&&Ge(),M(pn,this)!==null&&Ji(M(pn,this),()=>{j(pn,this,null)}),A(Sn,this,kn).call(this,()=>{A(Sn,this,Dn).call(this)})},o=e=>{try{i=!0,t==null||t(e,a),i=!1}catch(e){Ut(e,M(un,this)&&M(un,this).parent)}n&&j(pn,this,A(Sn,this,kn).call(this,()=>{try{return Vi(()=>{var t=V;t.b=this,t.f|=128,n(M(on,this),()=>e,()=>a)})}catch(e){return Ut(e,M(un,this).parent),null}}))};zt(()=>{var t;try{t=this.transform_error(e)}catch(e){Ut(e,M(un,this)&&M(un,this).parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>Ut(e,M(un,this)&&M(un,this).parent)):o(t)})}function Mn(e,t){this.v=e,this.k=t}function Nn(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Mn;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`?`return`:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(a.done?`return`:`normal`,n)},function(e){r(`throw`,e)})}catch(e){i(`throw`,e)}}function i(e,i){switch(e){case`return`:t.resolve({value:i,done:!0});break;case`throw`:t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}Nn.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Nn.prototype.next=function(e){return this._invoke(`next`,e)},Nn.prototype.throw=function(e){return this._invoke(`throw`,e)},Nn.prototype.return=function(e){return this._invoke(`return`,e)};function Pn(e,n,r,i){let a=Pt()?Vn:Gn;var o=e.filter(e=>!e.settled),s=n.map(a);if(t&&s.forEach((e,t)=>{e.label=n[t].toString().replace(`() => `,``).replaceAll(`$.eager(() => `,`$state.eager(`).replace(/\$\.get\((.+?)\)/g,(e,t)=>t)}),r.length===0&&o.length===0){i(s);return}var c=V,l=Fn(),u=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(e=>e.promise)):null;function d(e){if(!(c.f&16384)){l();try{i([...s,...e])}catch(e){Ut(e,c)}In()}}var f=Ln();if(r.length===0){u.then(()=>d([])).finally(f);return}function p(){Promise.all(r.map(e=>Un(e))).then(d).catch(e=>Ut(e,c)).finally(f)}u?u.then(()=>{l(),p(),In()}):p()}function Fn(){var e=V,n=B,r=O,i=N;if(t)var a=Dt;return function(o=!0){aa(e),ia(n),Et(r),o&&!(e.f&16384)&&(i==null||i.activate(),i==null||i.apply()),t&&(zn(null),Ot(a))}}function In(e=!0){aa(null),ia(null),Et(null),e&&(N==null||N.deactivate()),t&&(zn(null),Ot(null))}function Ln(){var e=V,t=e.b,n=N,r=!!(t!=null&&t.is_rendered());return t==null||t.update_pending_count(1,n),n.increment(r,e),()=>{t==null||t.update_pending_count(-1,n),n.decrement(r,e)}}var Rn=null;function zn(e){Rn=e}var Bn=new Set;function Vn(e){var n=2|te;V!==null&&(V.f|=ce);let r={ctx:O,deps:null,effects:null,equals:pt,f:n,fn:e,reactions:null,rv:0,v:qe,wv:0,parent:V,ac:null};return t&&vt&&(r.created=Ct(`created at`)),r}var Hn=Symbol(`obsolete`);function Un(e,n,r){let i=V;i===null&&ke();var a=void 0,o=Xr(qe);t&&(o.label=n==null?e.toString():n);var s=!B,c=new Set;return Li(()=>{var n=V;t&&(Rn={effect:n,effect_deps:new Set,warned:!1});var l=_();a=l.promise;try{Promise.resolve(e()).then(l.resolve,e=>{e!==Te&&l.reject(e)}).finally(In)}catch(e){l.reject(e),In()}if(t){if(Rn){if(n.deps!==null)for(let e=0;e<la;e+=1)Rn.effect_deps.add(n.deps[e]);if(ca!==null)for(let e=0;e<ca.length;e+=1)Rn.effect_deps.add(ca[e])}Rn=null}var u=N;if(s){var d;if(n.f&32768)var f=Ln();if((d=i.b)!=null&&d.is_rendered()){var p;(p=u.async_deriveds.get(n))==null||p.reject(Hn)}else for(let e of c.values())e.reject(Hn);c.add(l),u.async_deriveds.set(n,l)}let m=(e,i=void 0)=>{t&&(Rn=null),f==null||f(),c.delete(l),i!==Hn&&(u.activate(),i?(o.f|=me,Qr(o,i)):(o.f&8388608&&(o.f^=me),t&&r!==void 0&&!o.equals(e)&&(Bn.add(o),setTimeout(()=>{Bn.has(o)&&!(n.f&16384)&&(et(o.label,r),Bn.delete(o))})),Qr(o,e)),u.deactivate())};l.promise.then(m,e=>m(null,e||`unknown`))}),ji(()=>{for(let e of c)e.reject(Hn)}),t&&(o.f|=pe),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function Wn(e){let t=Vn(e);return gt||sa(t),t}function Gn(e){let t=Vn(e);return t.equals=ht,t}function Kn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Gi(t[n])}}var qn=[];function Jn(e){var n,r=V,a=e.parent;if(!ta&&a!==null&&e.v!==qe&&a.f&24576)return tt(),e.v;if(aa(a),t){let t=Gr;qr(new Set);try{i.call(qn,e)&&je(),qn.push(e),e.f&=~de,Kn(e),n=ya(e)}finally{aa(r),qr(t),qn.pop()}}else try{e.f&=~de,Kn(e),n=ya(e)}finally{aa(r)}return n}function Yn(e){var t=Jn(e);if(!e.equals(t)&&(e.wv=ga(),(!(N!=null&&N.is_fork)||e.deps===null)&&(N===null?e.v=t:(N.capture(e,t,!0),tr==null||tr.capture(e,t,!0)),e.deps===null))){qt(e,w);return}ta||(nr===null?Jt(e):(Ai()||N!=null&&N.is_fork)&&nr.set(e,t))}function Xn(e){if(e.effects!==null){for(let r of e.effects)if(r.teardown||r.ac){var t,n;(t=r.teardown)==null||t.call(r),(n=r.ac)==null||n.abort(Te),r.fn!==null&&(r.teardown=m),r.ac=null,xa(r,0),Ui(r)}}}function Zn(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Sa(t)}var Qn,$n=null,er=null,N=null,tr=null,nr=null,rr=null,ir=!1,ar=!1,or=null,sr=null,cr=0,lr=new Set,ur=1,dr=new WeakMap,fr=new WeakMap,pr=new WeakMap,mr=new WeakMap,hr=new WeakMap,gr=new WeakMap,_r=new WeakMap,vr=new WeakMap,yr=new WeakMap,br=new WeakMap,xr=new WeakMap,Sr=new WeakMap,Cr=new WeakMap,wr=new WeakMap,Tr=new WeakMap,Er=new WeakSet,Dr=class e{constructor(){nn(this,Er),S(this,`id`,ur++),k(this,dr,!1),S(this,`linked`,!0),k(this,fr,null),k(this,pr,null),S(this,`async_deriveds`,new Map),S(this,`current`,new Map),S(this,`previous`,new Map),k(this,mr,new Set),k(this,hr,new Set),k(this,gr,0),k(this,_r,new Map),k(this,vr,null),k(this,yr,[]),k(this,br,[]),k(this,xr,new Set),k(this,Sr,new Set),k(this,Cr,new Map),k(this,wr,new Set),S(this,`is_fork`,!1),k(this,Tr,!1),er===null?$n=er=this:(j(pr,er,this),j(fr,this,er)),er=this}skip_effect(e){M(Cr,this).has(e)||M(Cr,this).set(e,{d:[],m:[]}),M(wr,this).delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=M(Cr,this).get(e);if(n){M(Cr,this).delete(e);for(var r of n.d)qt(r,te),t(r);for(r of n.m)qt(r,ne),t(r)}M(wr,this).add(e)}capture(e,t,n=!1){e.v!==qe&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),nr==null||nr.set(e,t)),this.is_fork||(e.v=t)}activate(){N=this}deactivate(){N=null,nr=null}flush(){try{t&&lr.clear(),ar=!0,N=this,A(Er,this,kr).call(this)}finally{if(cr=0,rr=null,or=null,sr=null,ar=!1,N=null,nr=null,Kr.clear(),t)for(let e of lr)e.updated=null}}discard(){var e;for(let e of M(hr,this))e(this);M(hr,this).clear();for(let e of this.async_deriveds.values())e.reject(Hn);A(Er,this,Fr).call(this),(e=M(vr,this))==null||e.resolve()}register_created_effect(e){M(br,this).push(e)}increment(e,t){if(j(gr,this,M(gr,this)+1),e){var n;let e=(n=M(_r,this).get(t))==null?0:n;M(_r,this).set(t,e+1)}}decrement(e,t){if(j(gr,this,M(gr,this)-1),e){var n;let e=(n=M(_r,this).get(t))==null?0:n;e===1?M(_r,this).delete(t):M(_r,this).set(t,e-1)}M(Tr,this)||(j(Tr,this,!0),zt(()=>{j(Tr,this,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)M(xr,this).add(t);for(let e of t)M(Sr,this).add(e);e.clear(),t.clear()}oncommit(e){M(mr,this).add(e)}ondiscard(e){M(hr,this).add(e)}settled(){var e;return((e=M(vr,this))==null?j(vr,this,_()):e).promise}static ensure(){if(N===null){let t=N=new e;!ar&&!ir&&zt(()=>{M(dr,t)||t.flush()})}return N}apply(){if(!gt||!this.is_fork&&M(fr,this)===null&&M(pr,this)===null){nr=null;return}nr=new Map;for(let[e,[t]]of this.current)nr.set(e,t);for(let t=$n;t!==null;t=M(pr,t))if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)nr.has(e)||nr.set(e,n)}}schedule(e){var t;if(rr=e,(t=e.b)!=null&&t.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(or!==null&&n===V&&(gt||(B===null||!(B.f&2))&&!Zt))return;if(r&96){if(!(r&1024))return;n.f^=w}}M(yr,this).push(n)}};Qn=Dr;function Or(){if(this.is_fork)return!0;for(let n of M(_r,this).keys()){for(var e=n,t=!1;e.parent!==null;){if(M(Cr,this).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}function kr(){var e;if(j(dr,this,!0),cr++>1e3&&(A(Er,this,Fr).call(this),Lr()),t)for(let e of this.current.keys())lr.add(e);for(let e of M(xr,this))M(Sr,this).delete(e),qt(e,te),this.schedule(e);for(let e of M(Sr,this))qt(e,ne),this.schedule(e);let n=M(yr,this);j(yr,this,[]),this.apply();var r=or=[],i=[],a=sr=[];for(let e of n)try{A(Er,this,Ar).call(this,e,r,i)}catch(t){throw Wr(e),A(Er,this,Or).call(this)||this.discard(),t}if(N=null,a.length>0){var o=Qn.ensure();for(let e of a)o.schedule(e)}if(or=null,sr=null,A(Er,this,Or).call(this)){A(Er,this,Nr).call(this,i),A(Er,this,Nr).call(this,r);for(let[e,t]of M(Cr,this))Ur(e,t);a.length>0&&A(Er,N,kr).call(N);return}let s=A(Er,this,jr).call(this);if(s){A(Er,this,Nr).call(this,i),A(Er,this,Nr).call(this,r),A(Er,s,Mr).call(s,this);return}M(xr,this).clear(),M(Sr,this).clear();for(let e of M(mr,this))e(this);M(mr,this).clear(),tr=this,zr(i),zr(r),tr=null,(e=M(vr,this))==null||e.resolve();var c=N;if(M(gr,this)===0&&(M(yr,this).length===0||c!==null)&&(A(Er,this,Fr).call(this),gt&&(A(Er,this,Pr).call(this),N=c)),M(yr,this).length>0)if(c!==null){let e=c;M(yr,e).push(...M(yr,this).filter(t=>!M(yr,e).includes(t)))}else c=this;c!==null&&A(Er,c,kr).call(c)}function Ar(e,t,n){e.f^=w;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||M(Cr,this).has(r))&&r.fn!==null){a?r.f^=w:i&4?t.push(r):gt&&i&16777224?n.push(r):_a(r)&&(i&16&&M(Sr,this).add(r),Sa(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}function jr(){for(var e=M(fr,this);e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=M(fr,e)}return null}function Mr(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(M(xr,e),M(Sr,e));let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(M(Sr,this).delete(i),qt(i,te),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),A(Er,e,Fr).call(e),N=this,A(Er,this,kr).call(this)}function Nr(e){for(var t=0;t<e.length;t+=1)Xt(e[t],M(xr,this),M(Sr,this))}function Pr(){for(let d=$n;d!==null;d=M(pr,d)){var e=d.id<this.id,n=[];for(let[t,[i,a]]of this.current){if(d.current.has(t)){var r=d.current.get(t)[0];if(e&&i!==r)d.current.set(t,[i,a]);else continue}n.push(t)}if(e)for(let[e,t]of this.async_deriveds){let n=d.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var i=[...d.current.keys()].filter(e=>!d.current.get(e)[1]);if(!(!M(dr,d)||i.length===0)){var a=i.filter(e=>!this.current.has(e));if(a.length===0)e&&d.discard();else if(n.length>0){if(t&&!M(Tr,d)&&Tt(M(yr,d).length===0,`Batch has scheduled roots`),e)for(let e of M(wr,this))d.unskip_effect(e,e=>{e.f&4194320?d.schedule(e):A(Er,d,Nr).call(d,[e])});d.activate();var o=new Set,s=new Map;for(var c of n)Br(c,a,o,s);s=new Map;var l=[...d.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(l.length>0)for(let e of M(br,this))!(e.f&155648)&&Vr(e,l,s)&&(e.f&4194320?(qt(e,te),d.schedule(e)):M(xr,d).add(e));if(M(yr,d).length>0&&!M(Tr,d)){d.apply();for(var u of M(yr,d))A(Er,d,Ar).call(d,u,[],[]);j(yr,d,[])}d.deactivate()}}}}function Fr(){if(this.linked){var e=M(fr,this),t=M(pr,this);e===null?$n=t:j(pr,e,t),t===null?er=e:j(fr,t,e),this.linked=!1}}function Ir(e){var t=ir;ir=!0;try{var n;for(e&&(N!==null&&!N.is_fork&&N.flush(),n=e());;){if(Bt(),N===null)return n;N.flush()}}finally{ir=t}}function Lr(){if(t){var e=new Map;for(let t of N.current.keys()){var n;for(let[i,a]of(n=t.updated)==null?[]:n){var r=e.get(i);r||(r={error:a.error,count:0},e.set(i,r)),r.count+=a.count}}for(let t of e.values())t.error&&console.error(t.error)}try{Le()}catch(e){t&&o(e,`stack`,{value:``}),Ut(e,rr)}}var Rr=null;function zr(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&_a(r)&&(Rr=new Set,Sa(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&qi(r),(Rr==null?void 0:Rr.size)>0)){Kr.clear();for(let e of Rr){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Rr.has(n)&&(Rr.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Sa(n)}}Rr.clear()}}Rr=null}}function Br(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Br(i,t,n,r):e&4194320&&!(e&2048)&&Vr(i,t,r)&&(qt(i,te),Hr(i))}}function Vr(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(i.call(t,r))return!0;if(r.f&2&&Vr(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function Hr(e){N.schedule(e)}function Ur(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),qt(e,w);for(var n=e.first;n!==null;)Ur(n,t),n=n.next}}function Wr(e){qt(e,w);for(var t=e.first;t!==null;)Wr(t),t=t.next}var Gr=new Set,Kr=new Map;function qr(e){Gr=e}var Jr=!1;function Yr(){Jr=!0}function Xr(e,n){var r={f:0,v:e,reactions:null,equals:pt,rv:0,wv:0};return t&&vt&&(r.created=n==null?Ct(`created at`):n,r.updated=null,r.set_during_effect=!1,r.trace=null),r}function P(e,t){let n=Xr(e,t);return sa(n),n}function Zr(e,t=!1,n=!0){let r=Xr(e);if(t||(r.equals=ht),_t&&n&&O!==null&&O.l!==null){var i,a;((a=(i=O.l).s)==null?i.s=[]:a).push(r)}return r}function F(e,n,r=!1){B!==null&&(!ra||B.f&131072)&&Pt()&&B.f&4325394&&(oa===null||!oa.has(e))&&We();let i=r?I(n):n;return t&&St(i,e.label),Qr(e,i,sr)}function Qr(e,n,r=null){if(!e.equals(n)){Kr.set(e,ta?n:e.v);var i=Dr.ensure();if(i.capture(e,n),t){if(vt||V!==null){var a,o;e.updated!=null||(e.updated=new Map);let t=((a=(o=e.updated.get(``))==null?void 0:o.count)==null?0:a)+1;if(e.updated.set(``,{error:null,count:t}),vt||t>5){let t=Ct(`updated at`);if(t!==null){let n=e.updated.get(t.stack);n||(n={error:t,count:0},e.updated.set(t.stack,n)),n.count++}}}V!==null&&(e.set_during_effect=!0)}if(e.f&2){let t=e;e.f&2048&&Jn(t),nr===null&&Jt(t)}e.wv=ga(),ti(e,te,r),Pt()&&V!==null&&V.f&1024&&!(V.f&96)&&(ua===null?da([e]):ua.push(e)),!i.is_fork&&Gr.size>0&&!Jr&&$r()}return n}function $r(){Jr=!1;for(let e of Gr){e.f&1024&&qt(e,ne);let t;try{t=_a(e)}catch(e){t=!0}t&&Sa(e)}Gr.clear()}function ei(e){F(e,e.v+1)}function ti(e,t,n){var r=e.reactions;if(r!==null)for(var i=Pt(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===V)){var l=(c&te)===0;if(l&&qt(s,t),c&131072)Gr.add(s);else if(c&2){var u=s;nr==null||nr.delete(u),c&65536||(c&512&&(V===null||!(V.f&2097152))&&(s.f|=de),ti(u,ne,n))}else if(l){var d=s;c&16&&Rr!==null&&Rr.add(d),n===null?Hr(d):n.push(d)}}}}var ni=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function I(e){if(typeof e!=`object`||!e||he in e)return e;let r=d(e);if(r!==l&&r!==u)return e;var i=new Map,a=n(e),o=P(0),c=t&&vt?Ct(`created at`):null,f=ma,p=e=>{if(ma===f)return e();var t=B,n=ma;ia(null),ha(f);var r=e();return ia(t),ha(n),r};a&&(i.set(`length`,P(e.length,c)),t&&(e=si(e)));var m=``;let h=!1;function g(e){if(!h){h=!0,m=e,xt(o,`${m} version`);for(let[e,t]of i)xt(t,ri(m,e));h=!1}}return new Proxy(e,{defineProperty(e,n,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&He();var a=i.get(n);return a===void 0?p(()=>{var e=P(r.value,c);return i.set(n,e),t&&typeof n==`string`&&xt(e,ri(m,n)),e}):F(a,r.value,!0),!0},deleteProperty(e,n){var r=i.get(n);if(r===void 0){if(n in e){let e=p(()=>P(qe,c));i.set(n,e),ei(o),t&&xt(e,ri(m,n))}}else F(r,qe),ei(o);return!0},get(n,r,a){var o;if(r===he)return e;if(t&&r===ve)return g;var l=i.get(r),u=r in n;if(l===void 0&&(!u||(o=s(n,r))!=null&&o.writable)&&(l=p(()=>{var e=P(I(u?n[r]:qe),c);return t&&xt(e,ri(m,r)),e}),i.set(r,l)),l!==void 0){var d=H(l);return d===qe?void 0:d}return Reflect.get(n,r,a)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var r=i.get(t);r&&(n.value=H(r))}else if(n===void 0){var a=i.get(t),o=a==null?void 0:a.v;if(a!==void 0&&o!==qe)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,n){var r;if(n===he)return!0;var a=i.get(n),o=a!==void 0&&a.v!==qe||Reflect.has(e,n);return(a!==void 0||V!==null&&(!o||(r=s(e,n))!=null&&r.writable))&&(a===void 0&&(a=p(()=>{var r=P(o?I(e[n]):qe,c);return t&&xt(r,ri(m,n)),r}),i.set(n,a)),H(a)===qe)?!1:o},set(e,n,r,l){var u=i.get(n),d=n in e;if(a&&n===`length`)for(var f=r;f<u.v;f+=1){var h=i.get(f+``);h===void 0?f in e&&(h=p(()=>P(qe,c)),i.set(f+``,h),t&&xt(h,ri(m,f))):F(h,qe)}if(u===void 0){var g;(!d||(g=s(e,n))!=null&&g.writable)&&(u=p(()=>P(void 0,c)),t&&xt(u,ri(m,n)),F(u,I(r)),i.set(n,u))}else{d=u.v!==qe;var _=p(()=>I(r));F(u,_)}var v=Reflect.getOwnPropertyDescriptor(e,n);if(v!=null&&v.set&&v.set.call(l,r),!d){if(a&&typeof n==`string`){var y=i.get(`length`),b=Number(n);Number.isInteger(b)&&b>=y.v&&F(y,b+1)}ei(o)}return!0},ownKeys(e){H(o);var t=Reflect.ownKeys(e).filter(e=>{var t=i.get(e);return t===void 0||t.v!==qe});for(var[n,r]of i)r.v!==qe&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ue()}})}function ri(e,t){var n;return typeof t==`symbol`?`${e}[Symbol(${(n=t.description)==null?``:n})]`:ni.test(t)?`${e}.${t}`:/^\d+$/.test(t)?`${e}[${t}]`:`${e}['${t}']`}function ii(e){try{if(typeof e==`object`&&e&&he in e)return e[he]}catch(e){}return e}function ai(e,t){return Object.is(ii(e),ii(t))}var oi=new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);function si(e){return new Proxy(e,{get(e,t,n){var r=Reflect.get(e,t,n);return oi.has(t)?function(...e){Yr();var t=r.apply(this,e);return $r(),t}:r}})}function ci(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:n,lastIndexOf:r,includes:i}=e;e.indexOf=function(e,t){let r=n.call(this,e,t);if(r===-1){for(let n=t==null?0:t;n<this.length;n+=1)if(ii(this[n])===e){at(`array.indexOf(...)`);break}}return r},e.lastIndexOf=function(e,t){let n=r.call(this,e,t==null?this.length-1:t);if(n===-1){for(let n=0;n<=(t==null?this.length-1:t);n+=1)if(ii(this[n])===e){at(`array.lastIndexOf(...)`);break}}return n},e.includes=function(e,t){let n=i.call(this,e,t);if(!n){for(let t=0;t<this.length;t+=1)if(ii(this[t])===e){at(`array.includes(...)`);break}}return n},Array.__svelte_cleanup=()=>{e.indexOf=n,e.lastIndexOf=r,e.includes=i}}var li,ui,di,fi;function pi(){if(li===void 0){li=window,ui=/Firefox/.test(navigator.userAgent);var e=Element.prototype,n=Node.prototype,r=Text.prototype;di=s(n,`firstChild`).get,fi=s(n,`nextSibling`).get,f(e)&&(e[be]=void 0,e[ye]=null,e[xe]=void 0,e.__e=void 0),f(r)&&(r[Se]=void 0),t&&(e.__svelte_meta=null,ci())}}function mi(e=``){return document.createTextNode(e)}function hi(e){return di.call(e)}function gi(e){return fi.call(e)}function L(e,t){if(!T)return hi(e);var n=hi(E);if(n===null)n=E.appendChild(mi());else if(t&&n.nodeType!==3){var r=mi();return n==null||n.before(r),ct(r),r}return t&&xi(n),ct(n),n}function _i(e,t=!1){if(!T){var n=hi(e);return n instanceof Comment&&n.data===``?gi(n):n}if(t){if((E==null?void 0:E.nodeType)!==3){var r=mi();return E==null||E.before(r),ct(r),r}xi(E)}return E}function R(e,t=1,n=!1){let r=T?E:e;for(var i;t--;)i=r,r=gi(r);if(!T)return r;if(n){if((r==null?void 0:r.nodeType)!==3){var a=mi();return r===null?i==null||i.after(a):r.before(a),ct(a),a}xi(r)}return ct(r),r}function vi(e){e.textContent=``}function yi(){return!gt||Rr!==null?!1:(V.f&ae)!==0}function bi(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function xi(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Si(e,t){if(t){let t=document.body;e.autofocus=!0,zt(()=>{document.activeElement===t&&e.focus()})}}var Ci=!1;function wi(){Ci||(Ci=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let n of e.target.elements){var t;(t=n[Ce])==null||t.call(n)}})},{capture:!0}))}function Ti(e){var t=B,n=V;ia(null),aa(null);try{return e()}finally{ia(t),aa(n)}}function Ei(e,t,n,r=n){e.addEventListener(t,()=>Ti(n));let i=e[Ce];i?e[Ce]=()=>{i(),r(!0)}:e[Ce]=()=>r(!0),wi()}function Di(e){V===null&&(B===null&&Ie(e),Fe()),ta&&Pe(e)}function Oi(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ki(e,n){var r=V;if(t)for(;r!==null&&r.f&131072;)r=r.parent;r!==null&&r.f&8192&&(e|=re);var i={ctx:O,deps:null,nodes:null,f:e|te|512,first:null,fn:n,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};t&&(i.component_function=kt),N==null||N.register_created_effect(i);var a=i;if(e&4)or===null?Dr.ensure().schedule(i):or.push(i);else if(n!==null){try{Sa(i)}catch(e){throw Gi(i),e}a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&!(a.f&524288)&&(a=a.first,e&16&&e&65536&&a!==null&&(a.f|=se))}if(a!==null&&(a.parent=r,r!==null&&Oi(a,r),B!==null&&B.f&2&&!(e&64))){var o,s=B;((o=s.effects)==null?s.effects=[]:o).push(a)}return i}function Ai(){return B!==null&&!ra}function ji(e){let t=ki(8,null);return qt(t,w),t.teardown=e,t}function Mi(e){Di(`$effect`),t&&o(e,`name`,{value:`$effect`});var n=V.f;if(!B&&n&32&&O!==null&&!O.i){var r,i=O;((r=i.e)==null?i.e=[]:r).push(e)}else return Ni(e)}function Ni(e){return ki(4|le,e)}function Pi(e){return Di(`$effect.pre`),t&&o(e,`name`,{value:`$effect.pre`}),ki(8|le,e)}function Fi(e){Dr.ensure();let t=ki(64|ce,e);return(e={})=>new Promise(n=>{e.outro?Ji(t,()=>{Gi(t),n(void 0)}):(Gi(t),n(void 0))})}function Ii(e){return ki(4,e)}function Li(e){return ki(pe|ce,e)}function Ri(e,t=0){return ki(8|t,e)}function z(e,t=[],n=[],r=[]){Pn(r,t,n,t=>{ki(8,()=>{e(...t.map(H))})})}function zi(e,n=0){var r=ki(16|n,e);return t&&(r.dev_stack=Dt),r}function Bi(e,n=0){var r=ki(C|n,e);return t&&(r.dev_stack=Dt),r}function Vi(e){return ki(32|ce,e)}function Hi(e){var t=e.teardown;if(t!==null){let e=ta,n=B;na(!0),ia(null);try{t.call(null)}finally{na(e),ia(n)}}}function Ui(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Ti(()=>{e.abort(Te)});var r=n.next;n.f&64?n.parent=null:Gi(n,t),n=r}}function Wi(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Gi(t),t=n}}function Gi(e,n=!0){var r=!1;(n||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Ki(e.nodes.start,e.nodes.end),r=!0),e.f|=oe,Ui(e,n&&!r),xa(e,0);var i=e.nodes&&e.nodes.t;if(i!==null)for(let e of i)e.stop();Hi(e),e.f^=oe,e.f|=ie;var a=e.parent;a!==null&&a.first!==null&&qi(e),t&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ki(e,t){for(;e!==null;){var n=e===t?null:gi(e);e.remove(),e=n}}function qi(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Ji(e,t,n=!0){var r=[];Yi(e,r,!0);var i=()=>{n&&Gi(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Yi(e,t,n){if(!(e.f&8192)){e.f^=re;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Yi(i,t,o?n:!1)}i=a}}}function Xi(e){Zi(e,!0)}function Zi(e,t){if(e.f&8192){e.f^=re,e.f&1024||(qt(e,te),Dr.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Zi(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Qi(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:gi(n);t.append(n),n=i}}var $i=null,ea=!1,ta=!1;function na(e){ta=e}var B=null,ra=!1;function ia(e){B=e}var V=null;function aa(e){V=e}var oa=null;function sa(e){if(B!==null&&(!gt||B.f&2)){var t;((t=oa)==null?oa=new Set:t).add(e)}}var ca=null,la=0,ua=null;function da(e){ua=e}var fa=1,pa=0,ma=pa;function ha(e){ma=e}function ga(){return++fa}function _a(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~de),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(_a(a)&&Yn(a),a.wv>e.wv)return!0}t&512&&nr===null&&qt(e,w)}return!1}function va(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!gt&&oa!==null&&oa.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?va(a,t,!1):t===a&&(n?qt(a,te):a.f&1024&&qt(a,ne),Hr(a))}}function ya(e){var t=ca,n=la,r=ua,i=B,a=oa,o=O,s=ra,c=ma,l=e.f;ca=null,la=0,ua=null,B=l&96?null:e,oa=null,Et(e.ctx),ra=!1,ma=++pa,e.ac!==null&&(Ti(()=>{e.ac.abort(Te)}),e.ac=null);try{e.f|=fe;var u=e.fn,d=u();e.f|=ae;var f=e.deps,p=N==null?void 0:N.is_fork;if(ca!==null){var m;if(p||xa(e,la),f!==null&&la>0)for(f.length=la+ca.length,m=0;m<ca.length;m++)f[la+m]=ca[m];else e.deps=f=ca;if(Ai()&&e.f&512)for(m=la;m<f.length;m++){var h,g;((g=(h=f[m]).reactions)==null?h.reactions=[]:g).push(e)}}else !p&&f!==null&&la<f.length&&(xa(e,la),f.length=la);if(Pt()&&ua!==null&&!ra&&f!==null&&!(e.f&6146))for(m=0;m<ua.length;m++)va(ua[m],e);if(i!==null&&i!==e){if(pa++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=pa;if(t!==null)for(let e of t)e.rv=pa;ua!==null&&(r===null?r=ua:r.push(...ua))}return e.f&8388608&&(e.f^=me),d}catch(e){return Ht(e)}finally{e.f^=fe,ca=t,la=n,ua=r,B=i,oa=a,Et(o),ra=s,ma=c}}function ba(e,t){let n=t.reactions;if(n!==null){var a=r.call(n,e);if(a!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[a]=n[o],n.pop())}}if(n===null&&t.f&2&&(ca===null||!i.call(ca,t))){var s=t;s.f&512&&(s.f^=512,s.f&=~de),s.v!==qe&&Jt(s),Xn(s),xa(s,0)}}function xa(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)ba(e,n[r])}function Sa(e){var n=e.f;if(!(n&16384)){qt(e,w);var r=V,i=ea;if(V=e,ea=!0,t){var a,o=kt;At(e.component_function);var s=Dt;Ot((a=e.dev_stack)==null?Dt:a)}try{n&16777232?Wi(e):Ui(e),Hi(e);var c=ya(e);if(e.teardown=typeof c==`function`?c:null,e.wv=fa,t&&vt&&e.f&2048&&e.deps!==null)for(var l of e.deps)l.set_during_effect&&(l.wv=ga(),l.set_during_effect=!1)}finally{ea=i,V=r,t&&(At(o),Ot(s))}}}async function Ca(){if(gt)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Ir()}function H(e){var n=(e.f&2)!=0;if($i==null||$i.add(e),B!==null&&!ra&&!(V!==null&&V.f&16384)&&(oa===null||!oa.has(e))){var r=B.deps;if(B.f&2097152)e.rv<pa&&(e.rv=pa,ca===null&&r!==null&&r[la]===e?la++:ca===null?ca=[e]:ca.push(e));else{var a;(a=B).deps!=null||(a.deps=[]),i.call(B.deps,e)||B.deps.push(e);var o=e.reactions;o===null?e.reactions=[B]:i.call(o,B)||o.push(B)}}if(t){if(!ra&&Rn&&N===null&&tr===null&&!Rn.warned&&!(Rn.effect.f&2097152)&&!Rn.effect_deps.has(e)){Rn.warned=!0,$e(e.label);var s=Ct(`traced at`);s&&console.warn(s)}if(Bn.delete(e),vt&&!ra&&bt!==null&&B!==null&&bt.reaction===B){if(e.trace)e.trace();else if(s=Ct(`traced at`),s){var c=bt.entries.get(e);c===void 0&&(c={traces:[]},bt.entries.set(e,c));var l=c.traces[c.traces.length-1];s.stack!==(l==null?void 0:l.stack)&&c.traces.push(s)}}}if(ta&&Kr.has(e))return Kr.get(e);if(n){var u=e;if(ta){var d=u.v;return(!(u.f&1024)&&u.reactions!==null||Ta(u))&&(d=Jn(u)),Kr.set(u,d),d}var f=(u.f&512)==0&&!ra&&B!==null&&(ea||(B.f&512)!=0),p=(u.f&ae)===0;_a(u)&&(f&&(u.f|=512),Yn(u)),f&&!p&&(Zn(u),wa(u))}if(nr!=null&&nr.has(e))return nr.get(e);if(e.f&8388608)throw e.v;return e.v}function wa(e){if(e.f|=512,e.deps!==null)for(let n of e.deps){var t;((t=n.reactions)==null?n.reactions=[]:t).push(e),n.f&2&&!(n.f&512)&&(Zn(n),wa(n))}}function Ta(e){if(e.v===qe)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Kr.has(t)||t.f&2&&Ta(t))return!0;return!1}function Ea(e){var t=ra;try{return ra=!0,e()}finally{ra=t}}function Da(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(he in e)Oa(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&he in n&&Oa(n)}}}function Oa(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{Oa(e[n],t)}catch(e){}let n=d(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=c(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch(e){}}}}}function ka(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var Aa=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function ja(e){return Aa.includes(e)}var Ma=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),Na={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function Pa(e){var t;return e=e.toLowerCase(),(t=Na[e])==null?e:t}[...Ma];var Fa=[`touchstart`,`touchmove`];function Ia(e){return Fa.includes(e)}var La=[`textarea`,`script`,`style`,`title`];function Ra(e){return La.includes(e)}var za=Symbol(`events`),Ba=new Set,Va=new Set;function Ha(e,t,n,r={}){function i(e){if(r.capture||Ka.call(t,e),!e.cancelBubble)return Ti(()=>n==null?void 0:n.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?zt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Ua(e,t,n,r,i){var a={capture:r,passive:i},o=Ha(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ji(()=>{t.removeEventListener(e,o,a)})}function U(e,t,n){var r;((r=t[za])==null?t[za]={}:r)[e]=n}function Wa(e){for(var t=0;t<e.length;t++)Ba.add(e[t]);for(var n of Va)n(e)}var Ga=null;function Ka(e){var t,n=this,r=n.ownerDocument,i=e.type,a=((t=e.composedPath)==null?void 0:t.call(e))||[],s=a[0]||e.target;Ga=e;var c=0,l=Ga===e&&e[za];if(l){var u=a.indexOf(l);if(u!==-1&&(n===document||n===window)){e[za]=n;return}var d=a.indexOf(n);if(d===-1)return;u<=d&&(c=u)}if(s=a[c]||e.target,s!==n){o(e,`currentTarget`,{configurable:!0,get(){return s||r}});var f=B,p=V;ia(null),aa(null);try{for(var m,h=[];s!==null&&s!==n;){try{var g,_=(g=s[za])==null?void 0:g[i];_!=null&&(!s.disabled||e.target===s)&&_.call(s,e)}catch(e){m?h.push(e):m=e}if(e.cancelBubble)break;c++,s=c<a.length?a[c]:null}if(m){for(let e of h)queueMicrotask(()=>{throw e});throw m}}finally{e[za]=n,delete e.currentTarget,ia(f),aa(p)}}}var qa,Ja=((qa=globalThis)==null||(qa=qa.window)==null?void 0:qa.trustedTypes)&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Ya(e){var t;return(t=Ja==null?void 0:Ja.createHTML(e))==null?e:t}function Xa(e){var t=bi(`template`);return t.innerHTML=Ya(e.replaceAll(`<!>`,`<!---->`)),t.content}function Za(e,t){var n=V;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function W(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(T)return Za(E,null),E;i===void 0&&(i=Xa(a?e:`<!>`+e),n||(i=hi(i)));var t=r||ui?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=hi(t),s=t.lastChild;Za(o,s)}else Za(t,t);return t}}function Qa(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(T)return Za(E,null),E;if(!o){var e=hi(Xa(a));if(i)for(o=document.createDocumentFragment();hi(e);)o.appendChild(hi(e));else o=hi(e)}var t=o.cloneNode(!0);if(i){var n=hi(t),r=t.lastChild;Za(n,r)}else Za(t,t);return t}}function $a(e,t){return Qa(e,t,`svg`)}function eo(){if(T)return Za(E,null),E;var e=document.createDocumentFragment(),t=document.createComment(``),n=mi();return e.append(t,n),Za(t,n),e}function G(e,t){if(T){var n=V;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=E),lt();return}e!==null&&e.before(t)}function K(e,t){var n,r,i=t==null?``:typeof t==`object`?`${t}`:t;i!==((r=(n=e)[Se])==null?n[Se]=e.nodeValue:r)&&(e[Se]=i,e.nodeValue=`${i}`)}function to(e,t){return ro(e,t)}var no=new Map;function ro(e,{target:t,anchor:n,props:r={},events:i,context:o,intro:s=!0,transformError:c}){pi();var l=void 0,u=Fi(()=>{var s=n==null?t.appendChild(mi()):n;an(s,{pending:()=>{}},t=>{Mt({});var n=O;if(o&&(n.c=o),i&&(r.$$events=i),T&&Za(t,null),l=e(t,r)||{},T&&(V.nodes.end=E,E===null||E.nodeType!==8||E.data!==`]`))throw rt(),Ke;Nt()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Ia(r);for(let e of[t,document]){var a=no.get(e);a===void 0&&(a=new Map,no.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Ka,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(a(Ba)),Va.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=no.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Ka),r.delete(e),r.size===0&&no.delete(n)):r.set(e,i)}if(Va.delete(d),s!==n){var a;(a=s.parentNode)==null||a.removeChild(s)}}});return io.set(l,u),l}var io=new WeakMap,ao=new WeakMap,oo=new WeakMap,so=new WeakMap,co=new WeakMap,lo=new WeakMap,uo=new WeakMap,fo=new WeakMap,po=class{constructor(e,n=!0){S(this,`anchor`,void 0),k(this,ao,new Map),k(this,oo,new Map),k(this,so,new Map),k(this,co,new Set),k(this,lo,!0),k(this,uo,e=>{if(M(ao,this).has(e)){var n=M(ao,this).get(e),r=M(oo,this).get(n);if(r)Xi(r),M(co,this).delete(n);else{var i=M(so,this).get(n);i&&(Xi(i.effect),M(oo,this).set(n,i.effect),M(so,this).delete(n),t&&(i.fragment.lastChild[we]=this.anchor),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(let[t,n]of M(ao,this)){if(M(ao,this).delete(t),t===e)break;let r=M(so,this).get(n);r&&(Gi(r.effect),M(so,this).delete(n))}for(let[e,t]of M(oo,this)){if(e===n||M(co,this).has(e))continue;let i=()=>{if(Array.from(M(ao,this).values()).includes(e)){var n=document.createDocumentFragment();Qi(t,n),n.append(mi()),M(so,this).set(e,{effect:t,fragment:n})}else Gi(t);M(co,this).delete(e),M(oo,this).delete(e)};M(lo,this)||!r?(M(co,this).add(e),Ji(t,i,!1)):i()}}}),k(this,fo,e=>{M(ao,this).delete(e);let t=Array.from(M(ao,this).values());for(let[e,n]of M(so,this))t.includes(e)||(Gi(n.effect),M(so,this).delete(e))}),this.anchor=e,j(lo,this,n)}ensure(e,t){var n=N,r=yi();if(t&&!M(oo,this).has(e)&&!M(so,this).has(e))if(r){var i=document.createDocumentFragment(),a=mi();i.append(a),M(so,this).set(e,{effect:Vi(()=>t(a)),fragment:i})}else M(oo,this).set(e,Vi(()=>t(this.anchor)));if(M(ao,this).set(n,e),r){for(let[t,r]of M(oo,this))t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of M(so,this))t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(M(uo,this)),n.ondiscard(M(fo,this))}else T&&(this.anchor=E),M(uo,this).call(this,n)}};function mo(e,t,n=!1){var r;T&&(r=E,lt());var i=new po(e),a=n?se:0;function o(e,t){if(T){var n=ft(r);if(e!==parseInt(n.substring(1))){var a=dt();ct(a),i.anchor=a,st(!1),i.ensure(e,t),st(!0);return}}i.ensure(e,t)}zi(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function ho(e,t){return t}function go(e,t,n){for(var r=[],i=t.length,o,s=t.length,c=0;c<i;c++){let n=t[c];Ji(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;_o(e,a(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=r.length===0&&n!==null;if(l){var u=n,d=u.parentNode;vi(d),d.append(u),e.items.clear()}_o(e,t,!l)}else{var f;o={pending:new Set(t),done:new Set},((f=e.outrogroups)==null?e.outrogroups=new Set:f).add(o)}}function _o(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r!=null&&r.has(a)?(a.f|=ue,Qi(a,document.createDocumentFragment())):Gi(t[i],n)}}var vo;function yo(e,r,i,o,s,c=null){var l=e,u=new Map;if(r&4){var d=e;l=T?ct(hi(d)):d.appendChild(mi())}T&&lt();var f=null,p=Gn(()=>{var e=i();return n(e)?e:e==null?[]:a(e)});t&&xt(p,`{#each ...}`);var m,h=new Map,g=!0;function _(e){y.effect.f&16384||(y.pending.delete(e),y.fallback=f,xo(y,m,l,r,o),f!==null&&(m.length===0?f.f&33554432?(f.f^=ue,Co(f,null,l)):Xi(f):Ji(f,()=>{f=null})))}function v(e){y.pending.delete(e)}var y={effect:zi(()=>{m=H(p);var e=m.length;let n=!1;T&&ft(l)===`[!`!=(e===0)&&(l=dt(),ct(l),st(!1),n=!0);for(var a=new Set,d=N,y=yi(),b=0;b<e;b+=1){T&&E.nodeType===8&&E.data===`]`&&(l=E,n=!0,st(!1));var x=m[b],S=o(x,b);if(t){var ee=o(x,b);S!==ee&&Ne(String(b),String(S),String(ee))}var C=g?null:u.get(S);if(C)C.v&&Qr(C.v,x),C.i&&Qr(C.i,b),y&&d.unskip_effect(C.e);else{var w;C=So(u,g?l:(w=vo)==null?vo=mi():w,x,S,b,s,r,i),g||(C.e.f|=ue),u.set(S,C)}a.add(S)}if(e===0&&c&&!f&&(g?f=Vi(()=>c(l)):(f=Vi(()=>{var e;return c((e=vo)==null?vo=mi():e)}),f.f|=ue)),e>a.size&&(t?To(m,o):Me(``,``,``)),T&&e>0&&ct(dt()),!g)if(h.set(d,a),y){for(let[e,t]of u)a.has(e)||d.skip_effect(t.e);d.oncommit(_),d.ondiscard(v)}else _(d);n&&st(!0),H(p)}),flags:r,items:u,pending:h,outrogroups:null,fallback:f};g=!1,T&&(l=E)}function bo(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function xo(e,t,n,r,i){var o=(r&8)!=0,s=t.length,c=e.items,l=bo(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o){for(v=0;v<s;v+=1)if(h=t[v],g=i(h,v),_=c.get(g).e,!(_.f&33554432)){var y,b;(y=_.nodes)==null||(y=y.a)==null||y.measure(),((b=f)==null?f=new Set:b).add(_)}}for(v=0;v<s;v+=1){if(h=t[v],g=i(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Xi(_),o)){var x,S;(x=_.nodes)==null||(x=x.a)==null||x.unfix(),((S=f)==null?f=new Set:S).delete(_)}if(_.f&33554432)if(_.f^=ue,_===l)Co(_,null,n);else{var ee=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),wo(e,d,_),wo(e,_,ee),Co(_,ee,n),d=_,p=[],m=[],l=bo(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var C=m[0],w;d=C.prev;var te=p[0],ne=p[p.length-1];for(w=0;w<p.length;w+=1)Co(p[w],C,n);for(w=0;w<m.length;w+=1)u.delete(m[w]);wo(e,te.prev,ne.next),wo(e,d,te),wo(e,ne,C),l=C,d=ne,--v,p=[],m=[]}else u.delete(_),Co(_,l,n),wo(e,_.prev,_.next),wo(e,_,d===null?e.effect.first:d.next),wo(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;){var re;((re=u)==null?u=new Set:re).add(l),m.push(l),l=bo(l.next)}if(l===null)continue}_.f&33554432||p.push(_),d=_,l=bo(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)if(t.pending.size===0){var ie;_o(e,a(t.done)),(ie=e.outrogroups)==null||ie.delete(t)}e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var ae=[];if(u!==void 0)for(_ of u)_.f&8192||ae.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&ae.push(l),l=bo(l.next);var oe=ae.length;if(oe>0){var se=r&4&&s===0?n:null;if(o){for(v=0;v<oe;v+=1){var ce;(ce=ae[v].nodes)==null||(ce=ce.a)==null||ce.measure()}for(v=0;v<oe;v+=1){var le;(le=ae[v].nodes)==null||(le=le.a)==null||le.fix()}}go(e,ae,se)}}o&&zt(()=>{if(f!==void 0)for(_ of f){var e;(e=_.nodes)==null||(e=e.a)==null||e.apply()}})}function So(e,n,r,i,a,o,s,c){var l=s&1?s&16?Xr(r):Zr(r,!1,!1):null,u=s&2?Xr(a):null;return t&&l&&(l.trace=()=>{var e;c()[(e=u==null?void 0:u.v)==null?a:e]}),{v:l,i:u,e:Vi(()=>(o(n,l==null?r:l,u==null?a:u,c),()=>{e.delete(i)}))}}function Co(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=gi(r);if(a.before(r),r===i)return;r=o}}function wo(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function To(e,t){let n=new Map,r=e.length;for(let i=0;i<r;i++){let r=t(e[i],i);if(n.has(r)){let e=String(n.get(r)),t=String(i),a=String(r);a.startsWith(`[object `)&&(a=null),Me(e,t,a)}n.set(r,i)}}function Eo(e,n,...r){var i=new po(e);zi(()=>{var e;let a=(e=n())==null?null:e;t&&a==null&&Re(),i.ensure(a,a&&(e=>a(e,...r)))},se)}var Do=()=>performance.now(),Oo={tick:e=>requestAnimationFrame(e),now:()=>Do(),tasks:new Set};function ko(){let e=Oo.now();Oo.tasks.forEach(t=>{t.c(e)||(Oo.tasks.delete(t),t.f())}),Oo.tasks.size!==0&&Oo.tick(ko)}function Ao(e){let t;return Oo.tasks.size===0&&Oo.tick(ko),{promise:new Promise(n=>{Oo.tasks.add(t={c:e,f:n})}),abort(){Oo.tasks.delete(t)}}}function jo(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function Mo(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=jo(n.trim());t[i]=r.trim()}return t}var No=e=>e,Po=null;function Fo(e){Po=e}function Io(e,t,n){var r,i=((r=Po)==null?V:r).nodes,a,o,s,c=null;i.a!=null||(i.a={element:e,measure(){a=this.element.getBoundingClientRect()},apply(){if(s==null||s.abort(),o=this.element.getBoundingClientRect(),a.left!==o.left||a.right!==o.right||a.top!==o.top||a.bottom!==o.bottom){let e=t()(this.element,{from:a,to:o},n==null?void 0:n());s=Lo(this.element,e,void 0,1,()=>{},()=>{s==null||s.abort(),s=void 0})}},fix(){if(!e.getAnimations().length){var{position:t,width:n,height:r}=getComputedStyle(e);if(t!==`absolute`&&t!==`fixed`){var i=e.style;c={position:i.position,width:i.width,height:i.height,transform:i.transform},i.position=`absolute`,i.width=n,i.height=r;var o=e.getBoundingClientRect();if(a.left!==o.left||a.top!==o.top){var s=`translate(${a.left-o.left}px, ${a.top-o.top}px)`;i.transform=i.transform?`${i.transform} ${s}`:s}}}},unfix(){if(c){var t=e.style;t.position=c.position,t.width=c.width,t.height=c.height,t.transform=c.transform}}}),i.a.element=e}function Lo(e,t,n,r,i,a){var o=r===1;if(p(t)){var s,c=!1;return zt(()=>{c||(s=Lo(e,t({direction:o?`in`:`out`}),n,r,i,a))}),{abort:()=>{c=!0,s==null||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(n==null||n.deactivate(),!(t!=null&&t.duration)&&!(t!=null&&t.delay))return i(),a(),{abort:m,deactivate:m,reset:m,t:()=>r};let{delay:l=0,css:u,tick:d,easing:f=No}=t;var h=[];if(o&&n===void 0&&(d&&d(0,1),u)){var g=Mo(u(0,1));h.push(g,g)}var _=()=>1-r,v=e.animate(h,{duration:l,fill:`forwards`});return v.onfinish=()=>{var o;v.cancel(),i();var s=(o=n==null?void 0:n.t())==null?1-r:o;n==null||n.abort();var c=r-s,l=t.duration*Math.abs(c),p=[];if(l>0){var m=!1;if(u)for(var h=Math.ceil(l/(1e3/60)),g=0;g<=h;g+=1){var y=s+c*f(g/h),b=Mo(u(y,1-y));p.push(b),m||(m=b.overflow===`hidden`)}m&&(e.style.overflow=`hidden`),_=()=>{var e=v.currentTime;return s+c*f(e/l)},d&&Ao(()=>{if(v.playState!==`running`)return!1;var e=_();return d(e,1-e),!0})}v=e.animate(p,{duration:l,fill:`forwards`}),v.onfinish=()=>{_=()=>r,d==null||d(r,1-r),a()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=m)},deactivate:()=>{a=m},reset:()=>{r===0&&(d==null||d(1,0))},t:()=>_()}}function Ro(e,n,r,i,a,o){let s=T;T&&lt();var c=t&&o&&(O==null?void 0:O.function[Je]),l=null;T&&E.nodeType===1&&(l=E,lt());var u=T?E:e,d=V,f=new po(u,!1);zi(()=>{let e=n()||null;var s=a?a():r||e===`svg`?Xe:void 0;if(e===null){f.ensure(null,null);return}return f.ensure(e,n=>{if(e){if(l=T?l:bi(e,s),t&&o&&(l.__svelte_meta={parent:Dt,loc:{file:c,line:o[0],column:o[1]}}),Za(l,l),i){var r=null;T&&Ra(e)&&l.append(r=document.createComment(``));var a=T?hi(l):l.appendChild(mi());T&&(a===null?st(!1):ct(a)),Fo(d),i(l,a),r==null||r.remove(),Fo(null)}V.nodes.end=l,n.before(l)}T&&ct(n)}),()=>{}},se),ji(()=>{}),s&&(st(!0),ct(u))}function zo(e,t){var n=void 0,r;Bi(()=>{n!==(n=t())&&(r&&(Gi(r),r=null),n&&(r=Vi(()=>{Ii(()=>n(e))})))})}function Bo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Bo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Vo(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Bo(e))&&(r&&(r+=` `),r+=t);return r}function Ho(e){return typeof e==`object`?Vo(e):e==null?``:e}var Uo=[...` 	
\r\f\xA0\v﻿`];function Wo(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Uo.includes(r[o-1]))&&(s===r.length||Uo.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Go(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Ko(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function qo(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Ko)),i&&c.push(...Object.keys(i).map(Ko));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Ko(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Go(r)),i&&(n+=Go(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Jo(e,t,n,r,i,a){var o=e[be];if(T||o!==n||o===void 0){var s=Wo(n,r,a);(!T||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[be]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Yo(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Xo(e,t,n,r){var i=e[xe];if(T||i!==t){var a=qo(t,r);(!T||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[xe]=t}else r&&(Array.isArray(r)?(Yo(e,n==null?void 0:n[0],r[0]),Yo(e,n==null?void 0:n[1],r[1],`important`)):Yo(e,n,r));return r}function Zo(e,t,r=!1){if(e.multiple){if(t==null)return;if(!n(t))return it();for(var i of e.options)i.selected=t.includes(es(i));return}for(i of e.options)if(ai(es(i),t)){i.selected=!0;return}(!r||t!==void 0)&&(e.selectedIndex=-1)}function Qo(e){var t=new MutationObserver(()=>{Zo(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),ji(()=>{t.disconnect()})}function $o(e,t,n=t){var r=new WeakSet,i=!0;Ei(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),es);else{var o,s=(o=e.querySelector(i))==null?e.querySelector(`option:not([disabled])`):o;a=s&&es(s)}n(a),e.__value=a,N!==null&&r.add(N)}),Ii(()=>{var a=t();if(e===document.activeElement){var o=gt?tr:N;if(r.has(o))return}if(Zo(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=es(s),n(a))}e.__value=a,i=!1}),Qo(e)}function es(e){return`__value`in e?e.__value:e.value}var ts=Symbol(`class`),ns=Symbol(`style`),rs=Symbol(`is custom element`),is=Symbol(`is html`),as=Ee?`link`:`LINK`,os=Ee?`input`:`INPUT`,ss=Ee?`option`:`OPTION`,cs=Ee?`select`:`SELECT`,ls=Ee?`progress`:`PROGRESS`;function us(e){if(T){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;ps(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;ps(e,`checked`,null),e.checked=r}}};e[Ce]=n,zt(n),wi()}}function ds(e,t){var n=gs(e);n.value===(n.value=t==null?void 0:t)||e.value===t&&(t!==0||e.nodeName!==ls)||(e.value=t==null?``:t)}function fs(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function ps(e,t,n,r){var i=gs(e);if(T&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===as)){r||ys(e,t,n==null?``:n);return}i[t]!==(i[t]=n)&&(t===`loading`&&(e[_e]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&vs(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ms(e,t,n,r,i=!1,a=!1){if(T&&i&&e.nodeName===os){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||us(o)}var s=gs(e),c=s[rs],l=!s[is];let u=T&&c;u&&st(!1);var d=t||{},f=e.nodeName===ss;for(var p in t)p in n||(n[p]=null);n.class?n.class=Ho(n.class):(r||n[ts])&&(n.class=null),n[ns]&&(n.style!=null||(n.style=null));var m=vs(e);if(e.nodeName===os&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==d.type||h===void 0&&e.hasAttribute(`type`))&&(d.type=h,ps(e,`type`,h,a))}for(let i in n){let o=n[i];if(f&&i===`value`&&o==null){e.value=e.__value=``,d[i]=o;continue}if(i===`class`){Jo(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t==null?void 0:t[ts],n[ts]),d[i]=o,d[ts]=n[ts];continue}if(i===`style`){Xo(e,o,t==null?void 0:t[ns],n[ns]),d[i]=o,d[ns]=n[ns];continue}var g=d[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){d[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=ja(r);if(ka(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(o!=null)continue;e.removeEventListener(r,d[n],t),d[n]=null}if(v)U(r,e,o),Wa([r]);else if(o!=null){function y(e){d[i].call(this,e)}d[n]=Ha(r,e,y,t)}}else if(i===`style`)ps(e,i,o);else if(i===`autofocus`)Si(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&f)fs(e,o);else{var b=i;l||(b=Pa(b));var x=b===`defaultValue`||b===`defaultChecked`;if(o==null&&!c&&!x)if(s[i]=null,b===`value`||b===`checked`){let n=e,r=t===void 0;if(b===`value`){let e=n.defaultValue;n.removeAttribute(b),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(b),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else x||m.includes(b)&&(c||typeof o!=`string`)?(e[b]=o,b in s&&(s[b]=qe)):typeof o!=`function`&&ps(e,b,o,a)}}}return u&&st(!0),d}function hs(e,t,n=[],r=[],i=[],a,o=!1,s=!1){Pn(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===cs,l=!1;if(Bi(()=>{var u=t(...n.map(H)),d=ms(e,r,u,a,o,s);l&&c&&`value`in u&&Zo(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||Gi(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&Gi(i[t]),i[t]=Vi(()=>zo(e,()=>f))),d[t]=f}r=d}),c){var u=e;Ii(()=>{Zo(u,r.value,!0),Qo(u)})}l=!0})}function gs(e){var t,n;return(n=(t=e)[ye])==null?t[ye]={[rs]:e.nodeName.includes(`-`),[is]:e.namespaceURI===Ye}:n}var _s=new Map;function vs(e){var t=e.getAttribute(`is`)||e.nodeName,n=_s.get(t);if(n)return n;_s.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=c(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.push(o);i=d(i)}return n}function ys(e,n,r){var i;t&&(n===`srcset`&&Ss(e,r)||bs((i=e.getAttribute(n))==null?``:i,r)||nt(n,e.outerHTML.replace(e.innerHTML,e.innerHTML&&`...`),String(r)))}function bs(e,t){return e===t?!0:new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function xs(e){return e.split(`,`).map(e=>e.trim().split(` `).filter(Boolean))}function Ss(e,t){var n=xs(e.srcset),r=xs(t);return r.length===n.length&&r.every(([e,t],r)=>t===n[r][1]&&(bs(n[r][0],e)||bs(e,n[r][0])))}function Cs(e,n,r=n){var i=new WeakSet;Ei(e,`input`,async a=>{t&&e.type===`checkbox`&&Ae();var o=a?e.defaultValue:e.value;if(o=ws(e)?Ts(o):o,r(o),N!==null&&i.add(N),await Ca(),o!==(o=n())){var s,c=e.selectionStart,l=e.selectionEnd,u=e.value.length;if(e.value=(s=o)==null?``:s,l!==null){var d=e.value.length;c===l&&l===u&&d>u?(e.selectionStart=d,e.selectionEnd=d):(e.selectionStart=c,e.selectionEnd=Math.min(l,d))}}}),(T&&e.defaultValue!==e.value||Ea(n)==null&&e.value)&&(r(ws(e)?Ts(e.value):e.value),N!==null&&i.add(N)),Ri(()=>{t&&e.type===`checkbox`&&Ae();var r=n();if(e===document.activeElement){var a=gt?tr:N;if(i.has(a))return}ws(e)&&r===Ts(e.value)||e.type===`date`&&!r&&!e.value||r!==e.value&&(e.value=r==null?``:r)})}function ws(e){var t=e.type;return t===`number`||t===`range`}function Ts(e){return e===``?null:+e}var Es,Ds=new WeakMap,Os=new WeakMap,ks=new WeakMap,As=new WeakSet,js=class{constructor(e){nn(this,As),k(this,Ds,new WeakMap),k(this,Os,void 0),k(this,ks,void 0),j(ks,this,e)}observe(e,t){var n=M(Ds,this).get(e)||new Set;return n.add(t),M(Ds,this).set(e,n),A(As,this,Ms).call(this).observe(e,M(ks,this)),()=>{var n=M(Ds,this).get(e);n.delete(t),n.size===0&&(M(Ds,this).delete(e),M(Os,this).unobserve(e))}}};Es=js;function Ms(){var e;return(e=M(Os,this))==null?j(Os,this,new ResizeObserver(e=>{for(var t of e){Es.entries.set(t.target,t);for(var n of M(Ds,this).get(t.target)||[])n(t)}})):e}S(js,`entries`,new WeakMap);function Ns(e,t){return e===t||(e==null?void 0:e[he])===t}function Ps(e={},t,n,r){var i=O.r,a=V;return Ii(()=>{var o,s;return Ri(()=>{o=s,s=(r==null?void 0:r())||[],Ea(()=>{Ns(n(...s),e)||(t(e,...s),o&&Ns(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Ns(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c==null||c()}}}),e}function Fs(e=!1){let t=O,n=t.l.u;if(!n)return;let r=()=>Da(t.s);if(e){let e=0,n={},i=Vn(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>H(i)}n.b.length&&Pi(()=>{Is(t,r),g(n.b)}),Mi(()=>{let e=Ea(()=>n.m.map(h));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&Mi(()=>{Is(t,r),g(n.a)})}function Is(e,t){if(e.l.s)for(let t of e.l.s)H(t);t()}function Ls(e){var t=Xr(0);return function(){return arguments.length===1?(F(t,H(t)+1),arguments[0]):(H(t),e())}}var Rs={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,n){return t&&Be(`${e.name}.${String(n)}`),!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.has(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function zs(e,n,r){return new Proxy(t?{props:e,exclude:n,name:r,other:{},to_proxy:[]}:{props:e,exclude:n},Rs)}var Bs={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(p(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];p(i)&&(i=i());let a=s(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(p(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=s(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===he||t===ge)return!1;for(let n of e.props)if(p(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(p(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function Vs(...e){return new Proxy({props:e},Bs)}function Hs(e,n,r,i){var a=!_t||(r&2)!=0,o=(r&8)!=0,c=(r&16)!=0,l=i,u=!0,d=void 0,f=()=>c&&a?(d!=null||(d=Vn(i)),H(d)):(u&&(u=!1,l=c?Ea(i):i),l);let p;if(o){var m,h,g=he in e||ge in e;p=(m=(h=s(e,n))==null?void 0:h.set)==null?g&&n in e?t=>e[n]=t:void 0:m}var _,v=!1;o?[_,v]=$t(()=>e[n]):_=e[n],_===void 0&&i!==void 0&&(_=f(),p&&(a&&ze(n),p(_)));var y=a?()=>{var t=e[n];return t===void 0?f():(u=!0,t)}:()=>{var t=e[n];return t!==void 0&&(l=void 0),t===void 0?l:t};if(a&&!(r&4))return y;if(p){var b=e.$$legacy;return(function(e,t){return arguments.length>0?((!a||!t||b||v)&&p(t?y():e),e):y()})}var x=!1,S=(r&1?Vn:Gn)(()=>(x=!1,y()));t&&(S.label=n),o&&H(S);var ee=V;return(function(e,t){if(arguments.length>0){let n=t?H(S):a&&o?I(e):e;return F(S,n),x=!0,l!==void 0&&(l=n),e}return ta&&x||ee.f&16384?S.v:H(S)})}if(t){function Us(e){if(!(e in globalThis)){let t;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(t!==void 0)return t;Ve(e)},set:e=>{t=e}})}}Us(`$state`),Us(`$effect`),Us(`$derived`),Us(`$inspect`),Us(`$props`),Us(`$bindable`)}function Ws(e){O===null&&Oe(`onMount`),_t&&O.l!==null?Gs(O).m.push(e):Mi(()=>{let t=Ea(e);if(typeof t==`function`)return t})}function Gs(e){var t,n=e.l;return(t=n.u)==null?n.u={a:[],b:[],m:[]}:t}if(typeof window<`u`){var Ks,qs,Js,Ys;((qs=(Ks=(Ys=(Js=window).__svelte)==null?Js.__svelte={}:Ys).v)==null?Ks.v=new Set:qs).add(`5`)}var Xs={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},Zs=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Qs=Symbol(`lucide-context`),$s=()=>jt(Qs),ec=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),tc=$a(`<svg><!><!></svg>`);function nc(e,t){var n;Mt(t,!0);let r=(n=$s())==null?{}:n,i=Hs(t,`color`,19,()=>{var e;return(e=r.color)==null?`currentColor`:e}),a=Hs(t,`size`,19,()=>{var e;return(e=r.size)==null?24:e}),o=Hs(t,`strokeWidth`,19,()=>{var e;return(e=r.strokeWidth)==null?2:e}),s=Hs(t,`absoluteStrokeWidth`,19,()=>{var e;return(e=r.absoluteStrokeWidth)==null?!1:e}),c=Hs(t,`iconNode`,19,()=>[]),l=zs(t,ec),u=Wn(()=>s()?Number(o())*24/Number(a()):o());var d=tc();hs(d,e=>({...Xs,...e,...l,width:a(),height:a(),stroke:i(),"stroke-width":H(u),class:[`lucide-icon lucide`,r.class,t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!Zs(l)&&{"aria-hidden":`true`}]);var f=L(d);yo(f,17,c,ho,(e,t)=>{var n=Wn(()=>v(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=eo();Ro(_i(a),r,!0,(e,t)=>{hs(e,()=>({...i()}))}),G(e,a)}),Eo(R(f),()=>{var e;return(e=t.children)==null?m:e}),D(d),G(e,d),Nt()}var rc=new Set([`$$slots`,`$$events`,`$$legacy`]);function ic(e,t){let n=zs(t,rc),r=[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`}]];nc(e,Vs({name:`hash`},()=>n,{get iconNode(){return r}}))}var ac=new Set([`$$slots`,`$$events`,`$$legacy`]);function oc(e,t){let n=zs(t,ac),r=[[`path`,{d:`M10 8h.01`}],[`path`,{d:`M12 12h.01`}],[`path`,{d:`M14 8h.01`}],[`path`,{d:`M16 12h.01`}],[`path`,{d:`M18 8h.01`}],[`path`,{d:`M6 8h.01`}],[`path`,{d:`M7 16h10`}],[`path`,{d:`M8 12h.01`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`}]];nc(e,Vs({name:`keyboard`},()=>n,{get iconNode(){return r}}))}var sc=new Set([`$$slots`,`$$events`,`$$legacy`]);function cc(e,t){let n=zs(t,sc),r=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`}]];nc(e,Vs({name:`lock-open`},()=>n,{get iconNode(){return r}}))}var lc=new Set([`$$slots`,`$$events`,`$$legacy`]);function uc(e,t){let n=zs(t,lc),r=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]];nc(e,Vs({name:`lock`},()=>n,{get iconNode(){return r}}))}var dc=new Set([`$$slots`,`$$events`,`$$legacy`]);function fc(e,t){let n=zs(t,dc),r=[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`}],[`circle`,{cx:`12`,cy:`10`,r:`3`}]];nc(e,Vs({name:`map-pin`},()=>n,{get iconNode(){return r}}))}var pc=new Set([`$$slots`,`$$events`,`$$legacy`]);function mc(e,t){let n=zs(t,pc),r=[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}]];nc(e,Vs({name:`message-square`},()=>n,{get iconNode(){return r}}))}var hc=new Set([`$$slots`,`$$events`,`$$legacy`]);function gc(e,t){let n=zs(t,hc),r=[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`}],[`path`,{d:`M12 22V12`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`}],[`path`,{d:`m7.5 4.27 9 5.15`}]];nc(e,Vs({name:`package`},()=>n,{get iconNode(){return r}}))}var _c=new Set([`$$slots`,`$$events`,`$$legacy`]);function vc(e,t){let n=zs(t,_c),r=[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];nc(e,Vs({name:`settings`},()=>n,{get iconNode(){return r}}))}var yc=new Set([`$$slots`,`$$events`,`$$legacy`]);function bc(e,t){let n=zs(t,yc),r=[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`}]];nc(e,Vs({name:`star`},()=>n,{get iconNode(){return r}}))}var xc=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sc(e,t){let n=zs(t,xc),r=[[`circle`,{cx:`9`,cy:`12`,r:`3`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`}]];nc(e,Vs({name:`toggle-left`},()=>n,{get iconNode(){return r}}))}var Cc=new Set([`$$slots`,`$$events`,`$$legacy`]);function wc(e,t){let n=zs(t,Cc),r=[[`path`,{d:`M10 11v6`}],[`path`,{d:`M14 11v6`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}],[`path`,{d:`M3 6h18`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]];nc(e,Vs({name:`trash-2`},()=>n,{get iconNode(){return r}}))}var Tc=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ec(e,t){let n=zs(t,Tc),r=[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}],[`path`,{d:`M3 6h18`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]];nc(e,Vs({name:`trash`},()=>n,{get iconNode(){return r}}))}var Dc=new Set([`$$slots`,`$$events`,`$$legacy`]);function Oc(e,t){let n=zs(t,Dc),r=[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`}],[`circle`,{cx:`12`,cy:`7`,r:`4`}]];nc(e,Vs({name:`user`},()=>n,{get iconNode(){return r}}))}var kc=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ac(e,t){let n=zs(t,kc),r=[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`}]];nc(e,Vs({name:`wrench`},()=>n,{get iconNode(){return r}}))}var jc=new Set([`$$slots`,`$$events`,`$$legacy`]);function Mc(e,t){let n=zs(t,jc),r=[[`path`,{d:`M18 6 6 18`}],[`path`,{d:`m6 6 12 12`}]];nc(e,Vs({name:`x`},()=>n,{get iconNode(){return r}}))}var Nc=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pc(e,t){let n=zs(t,Nc),r=[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`}]];nc(e,Vs({name:`zap`},()=>n,{get iconNode(){return r}}))}var Fc=function(e){return e.Item=`item`,e.Weapon=`weapon`,e.Armor=`armor`,e}({}),Ic=function(e){return e.General=`general`,e.Vars=`vars`,e.Switches=`switches`,e.Inv=`inv`,e.Actors=`actors`,e.Map=`map`,e.CommonEv=`commonev`,e.Locks=`locks`,e.Logs=`logs`,e.Shortcuts=`shortcuts`,e.Settings=`settings`,e}({}),Lc=function(e){return e[e.MHP=0]=`MHP`,e[e.MMP=1]=`MMP`,e[e.ATK=2]=`ATK`,e[e.DEF=3]=`DEF`,e[e.MAT=4]=`MAT`,e[e.MDF=5]=`MDF`,e[e.AGI=6]=`AGI`,e[e.LUK=7]=`LUK`,e}({}),Rc=new WeakMap,zc=new class{constructor(){k(this,Rc,P(I([])))}get toasts(){return H(M(Rc,this))}set toasts(e){F(M(Rc,this),e,!0)}show(e,t=`info`,n=1500){let r=Math.random().toString(),i={id:r,type:t,message:e,duration:n};this.toasts=[...this.toasts,i],setTimeout(()=>{this.dismiss(r)},n)}dismiss(e){this.toasts=this.toasts.filter(t=>t.id!==e)}},Bc=e=>!!e&&typeof e.then==`function`,q={vars:{count:()=>{var e;return!((e=window.$dataSystem)==null||(e=e.variables)==null)&&e.length?window.$dataSystem.variables.length-1:0},name:e=>{var t;let n=(t=window.$dataSystem)==null||(t=t.variables)==null?void 0:t[e];return n?String(n):`Variable ${e}`},get:e=>{var t;return(t=window.$gameVariables)==null?void 0:t.value(e)},set:(e,t)=>{if(!window.$gameVariables)return;let n=q.vars.get(e),r=t;if(typeof n==`number`&&typeof t==`string`){let e=Number(t);!isNaN(e)&&t.trim()!==``&&(r=e)}else typeof n==`boolean`&&typeof t==`string`&&(r=t.toLowerCase()===`true`||t===`1`);window.$gameVariables.setValue(e,r)},list:()=>{let e=q.vars.count(),t=[];for(let n=1;n<=e;n++)t.push({id:n,name:q.vars.name(n),value:q.vars.get(n)});return t}},switches:{count:()=>{var e;return!((e=window.$dataSystem)==null||(e=e.switches)==null)&&e.length?window.$dataSystem.switches.length-1:0},name:e=>{var t;let n=(t=window.$dataSystem)==null||(t=t.switches)==null?void 0:t[e];return n?String(n):`Switch ${e}`},get:e=>{var t;return!!((t=window.$gameSwitches)!=null&&t.value(e))},set:(e,t)=>{window.$gameSwitches&&window.$gameSwitches.setValue(e,!!t)},toggle:e=>{q.switches.set(e,!q.switches.get(e))},list:()=>{let e=q.switches.count(),t=[];for(let n=1;n<=e;n++)t.push({id:n,name:q.switches.name(n),value:q.switches.get(n)});return t}},inv:{table:e=>e===Fc.Item?window.$dataItems||[]:e===Fc.Weapon?window.$dataWeapons||[]:e===Fc.Armor&&window.$dataArmors||[],data:(e,t)=>q.inv.table(e)[t],count:(e,t)=>{let n=q.inv.data(e,t);return n&&window.$gameParty?window.$gameParty.numItems(n):0},maxStack:(e,t)=>{let n=q.inv.data(e,t);return n&&window.$gameParty?window.$gameParty.maxItems(n):99},grant:(e,t,n)=>{let r=q.inv.data(e,t);r&&window.$gameParty&&window.$gameParty.gainItem(r,n,!1)},setCount:(e,t,n)=>{let r=q.inv.count(e,t),i=q.inv.maxStack(e,t);n=Math.max(0,Math.min(i,n)),n!==r&&q.inv.grant(e,t,n-r)},list:e=>{let t=q.inv.table(e),n=[];for(let r=1;r<t.length;r++){let i=t[r];i&&i.name&&n.push({id:r,name:i.name,description:i.description||``,count:q.inv.count(e,r)})}return n}},gold:{get:()=>window.$gameParty?window.$gameParty.gold():0,max:()=>window.$gameParty&&window.$gameParty.maxGold?window.$gameParty.maxGold():99999999,add:e=>{window.$gameParty&&(e>0?window.$gameParty.gainGold(e):e<0&&window.$gameParty.loseGold(-e))},set:e=>{let t=q.gold.max();e=Math.max(0,Math.min(t,e)),q.gold.add(e-q.gold.get())}},party:{members:()=>window.$gameParty?window.$gameParty.members().map(e=>({id:e.actorId(),name:e.name(),level:typeof e.level==`function`?e.level():e._level||1})):[],steps:()=>window.$gameParty?window.$gameParty.steps():0,playtime:()=>window.Graphics?Math.floor(window.Graphics.frameCount/60):0,recoverAll:()=>{window.$gameParty&&window.$gameParty.members().forEach(e=>{var t;(t=e.recoverAll)==null||t.call(e)})}},map:{list:()=>window.$dataMapInfos?window.$dataMapInfos.filter(e=>!!e).map(e=>({id:e.id,name:e.name,parentId:e.parentId})):[],current:()=>!window.$gameMap||!window.$gamePlayer?null:{mapId:window.$gameMap.mapId(),x:window.$gamePlayer.x,y:window.$gamePlayer.y,dir:window.$gamePlayer.direction()},teleport:(e,t,n,r=0,i=0)=>{window.$gamePlayer&&window.$gamePlayer.reserveTransfer(e,t,n,r,i)},speed:e=>{window.$gamePlayer&&(e=Math.max(1,Math.min(8,e)),window.$gamePlayer.setMoveSpeed(e))},events:()=>!window.$gameMap||typeof window.$gameMap.events!=`function`?[]:(window.$gameMap.events()||[]).map(e=>{let t=typeof e.event==`function`?e.event():null,n=t&&t.name?t.name:`Event ${e._eventId||0}`,r=typeof e.x==`number`?e.x:e._x||0,i=typeof e.y==`number`?e.y:e._y||0;return{id:typeof e.eventId==`function`?e.eventId():e._eventId||0,name:n,x:r,y:i}}),loadMapEvents:async e=>{if(e<=0)return[];try{let t=`data/Map${e.toString().padStart(3,`0`)}.json`,n=await(await fetch(t)).json();return!n||!n.events?[]:n.events.filter(e=>e).map(e=>{let t=e.name||`Event ${e.id}`;if(t.match(/^EV\d+$/i)){if(e.note)t=`${t} (${e.note.split(`
`)[0].trim()})`;else if(e.pages&&e.pages.length>0){let n=e.pages[0].list;if(n&&n.length>0){let e=n.find(e=>e.code===108||e.code===401);if(e&&e.parameters&&e.parameters[0]){let n=String(e.parameters[0]).substring(0,20).trim();n&&(t=`${t} [${n}]`)}}}}return{id:e.id,name:t,x:e.x,y:e.y}})}catch(t){return console.warn(`Failed to load events for map`,e,t),[]}}},commonev:{list:()=>window.$dataCommonEvents?window.$dataCommonEvents.filter(e=>e&&e.name).map(e=>({id:e.id,name:e.name})):[],run:e=>{window.$gameTemp&&window.$gameTemp.reserveCommonEvent(e)}},battle:{inBattle:()=>!window.SceneManager||!window.SceneManager._scene?!1:window.SceneManager._scene.constructor.name===`Scene_Battle`,canExecuteBattleEnd:()=>q.battle.inBattle()&&window.BattleManager&&window.BattleManager._phase!==`battleEnd`,instantWin:()=>{!q.battle.inBattle()||!window.$gameTroop||!window.BattleManager||(window.$gameTroop.members().forEach(e=>{e.isDead()||(e.setHp(0),e.deathStateId&&e.addNewState&&e.addNewState(e.deathStateId()),e.performCollapse&&e.performCollapse(),e.refresh&&e.refresh())}),window.BattleManager.checkBattleEnd())},flee:()=>{!q.battle.inBattle()||!window.BattleManager||window.BattleManager.processAbort()},forceVictory:()=>{!q.battle.canExecuteBattleEnd()||!window.$gameTroop||!window.BattleManager||(window.$gameTroop.members().forEach(e=>{e.deathStateId&&e.addNewState&&e.addNewState(e.deathStateId())}),window.BattleManager.processVictory(),zc.show(`Forced victory from battle!`,`success`))},forceDefeat:()=>{!q.battle.canExecuteBattleEnd()||!window.$gameParty||!window.BattleManager||(window.$gameParty.members().forEach(e=>{e.deathStateId&&e.addNewState&&e.addNewState(e.deathStateId())}),window.BattleManager.processDefeat(),zc.show(`Forced defeat from battle...`,`warn`))},forceEscape:()=>{!q.battle.canExecuteBattleEnd()||!window.$gameParty||!window.BattleManager||!window.SoundManager||(window.$gameParty.performEscape(),window.SoundManager.playEscape(),window.BattleManager._escaped=!0,window.BattleManager.processEscape(),zc.show(`Forced escape from battle`,`success`))},changeAllEnemyHealth:e=>{!q.battle.inBattle()||!window.$gameTroop||(window.$gameTroop.members().forEach(t=>t.setHp(e)),zc.show(`HP to ${e} for all enemies`,`success`))},recoverAllEnemy:()=>{!q.battle.inBattle()||!window.$gameTroop||(window.$gameTroop.members().forEach(e=>{e.setHp(e.mhp),e.setMp(e.mmp),e.maxTp&&e.setTp&&e.setTp(e.maxTp())}),zc.show(`Recovery all enemies`,`success`))},changeAllPartyHealth:e=>{window.$gameParty&&(window.$gameParty.members().forEach(t=>t.setHp(e)),zc.show(`HP to ${e} for all party members`,`success`))},recoverAllParty:()=>{window.$gameParty&&(window.$gameParty.members().forEach(e=>{e.setHp(e.mhp),e.setMp(e.mmp),e.maxTp&&e.setTp&&e.setTp(e.maxTp())}),zc.show(`Recovery all party members`,`success`))}},scene:{gotoTitle:()=>{window.SceneManager&&window.Scene_Title&&window.SceneManager.goto(window.Scene_Title)},toggleSaveScene:()=>{var e;if(!window.SceneManager||!window.Scene_Save||!window.Scene_Load)return;let t=(e=window.SceneManager._scene)==null?void 0:e.constructor;t===window.Scene_Save?window.SceneManager.pop():t===window.Scene_Load?window.SceneManager.goto(window.Scene_Save):window.SceneManager.push(window.Scene_Save)},toggleLoadScene:()=>{var e;if(!window.SceneManager||!window.Scene_Save||!window.Scene_Load)return;let t=(e=window.SceneManager._scene)==null?void 0:e.constructor;t===window.Scene_Load?window.SceneManager.pop():t===window.Scene_Save?window.SceneManager.goto(window.Scene_Load):window.SceneManager.push(window.Scene_Load)},quickSave:(e=1)=>{window.$gameSystem&&window.DataManager?(window.$gameSystem.onBeforeSave(),window.DataManager.saveGame(e),zc.show(`Game Saved - Slot ${e}`,`success`)):zc.show(`Quick Save failed`,`error`)},quickLoad:async(e=1)=>{if(window.DataManager&&window.SceneManager&&window.Scene_Map)try{let t=window.DataManager.loadGame(e);Bc(t)?(await t,q.scene.completeQuickLoad(e)):t?q.scene.completeQuickLoad(e):zc.show(`Quick Load failed`,`error`)}catch(e){console.error(e),zc.show(`Quick Load failed`,`error`)}else zc.show(`Quick Load failed`,`error`)},completeQuickLoad:e=>{var t,n,r,i,a,o;if(!(!window.SceneManager||!window.Scene_Map)){if(window.$gameSystem&&window.$dataSystem&&typeof window.$gameSystem.versionId==`function`&&typeof window.$dataSystem.versionId==`number`&&window.$gameSystem.versionId()!==window.$dataSystem.versionId&&window.$gameMap&&window.$gamePlayer){var s,c;let e=window.$gameMap.mapId(),t=window.$gamePlayer.x,n=window.$gamePlayer.y,r=window.$gamePlayer.direction();window.$gamePlayer.reserveTransfer(e,t,n,r,0),(s=(c=window.$gamePlayer).requestMapReload)==null||s.call(c)}(t=window.SoundManager)==null||(n=t.playLoad)==null||n.call(t),(r=window.SceneManager._scene)==null||(i=r.fadeOutAll)==null||i.call(r),window.SceneManager.goto(window.Scene_Map),(a=window.$gameSystem)==null||(o=a.onAfterLoad)==null||o.call(a),zc.show(`Game Loaded - Slot ${e}`,`success`)}}},system:{openDevTool:()=>{if(typeof window<`u`&&window.require)try{let e=window.require(`nw.gui`);e&&e.Window&&e.Window.get&&e.Window.get().showDevTools()}catch(e){}}}},J={list:()=>window.$dataActors?window.$dataActors.filter(e=>!!e).map(e=>{let t=window.$gameActors?window.$gameActors.actor(e.id):null;return{id:e.id,name:t?t.name():e.name,level:t&&(typeof t.level==`function`?t.level():t._level)||1,inParty:t&&window.$gameParty?window.$gameParty.members().includes(t):!1}}):[],get:e=>{var t;if(!window.$gameActors)return null;let n=window.$gameActors.actor(e);if(!n)return null;let r=[];for(let e=0;e<8;e++)r.push({id:e,value:n.param?n.param(e):0});let i=window.$dataSkills?window.$dataSkills.filter(e=>!!e).map(e=>({id:e.id,name:e.name,learned:n.hasSkill?n.hasSkill(e.id):!1})):[],a=n.equips&&n.equips()?n.equips().map((e,t)=>({slotId:t,name:e?e.name:`Empty`,item:e})):[],o=n.states&&n.states()?n.states().map(e=>({id:e.id,name:e.name})):[];return{id:n.actorId(),name:n.name(),level:typeof n.level==`function`?n.level()||1:n._level||1,exp:n.currentExp?n.currentExp():0,nextExp:n.nextRequiredExp?n.nextRequiredExp():0,hp:n.hp,mp:n.mp,tp:n.tp,mhp:n.mhp,mmp:n.mmp,mtp:n.maxTp?n.maxTp():100,params:r,skills:i,states:o,equips:a,inParty:(t=window.$gameParty)==null?void 0:t.members().includes(n)}},setLevel:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.changeLevel&&r.changeLevel(Math.max(1,Math.min(r.maxLevel?r.maxLevel():99,t)),!1)},setExp:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.changeExp&&r.changeExp(Math.max(0,t),!1)},setHp:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.setHp&&r.setHp(Math.max(0,Math.min(r.mhp,t)))},setMp:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.setMp&&r.setMp(Math.max(0,Math.min(r.mmp,t)))},setTp:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e),i=r&&r.maxTp?r.maxTp():100;r&&r.setTp&&r.setTp(Math.max(0,Math.min(i,t)))},addParam:(e,t,n)=>{var r;let i=(r=window.$gameActors)==null?void 0:r.actor(e);i&&i.addParam&&i.addParam(t,n)},setParam:(e,t,n)=>{var r;let i=(r=window.$gameActors)==null?void 0:r.actor(e);if(!i||!i.param||!i.addParam)return;let a=1;i.paramRate&&(a*=i.paramRate(t)),i.paramBuffRate&&(a*=i.paramBuffRate(t)),a===0&&(a=1);let o=i.paramBase?i.paramBase(t):0,s=i.paramPlus?i.paramPlus(t):0,c=Math.round(n/a)-o-s;i.addParam(t,c)},learnSkill:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.learnSkill&&r.learnSkill(t)},forgetSkill:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.forgetSkill&&r.forgetSkill(t)},recover:e=>{var t;let n=(t=window.$gameActors)==null?void 0:t.actor(e);n&&n.recoverAll&&n.recoverAll()},setName:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.setName&&r.setName(String(t))},addToParty:e=>{window.$gameParty&&window.$gameParty.addActor&&window.$gameParty.addActor(e)},removeFromParty:e=>{window.$gameParty&&window.$gameParty.removeActor&&window.$gameParty.removeActor(e)},listStates:()=>window.$dataStates?window.$dataStates.filter(e=>!!(e&&e.name)):[],addState:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.addState&&r.addState(t)},removeState:(e,t)=>{var n;let r=(n=window.$gameActors)==null?void 0:n.actor(e);r&&r.removeState&&r.removeState(t)},clearStates:e=>{var t;let n=(t=window.$gameActors)==null?void 0:t.actor(e);n&&n.clearStates&&n.clearStates()}},Y=I({vars:new Map,switches:new Map,items:new Map,gold:null,stats:new Map,noclip:!1}),Vc=!1,Hc=null,X={install:()=>{if(!Vc&&!(typeof window>`u`)&&!window.__FORGE_LOCKS__){if(window.__FORGE_LOCKS__=!0,window.Game_Variables&&window.Game_Variables.prototype.setValue){let e=window.Game_Variables.prototype.setValue;window.Game_Variables.prototype.setValue=function(t,n){Y.vars.has(t)&&(n=Y.vars.get(t)),e.call(this,t,n)}}if(window.Game_Switches&&window.Game_Switches.prototype.setValue){let e=window.Game_Switches.prototype.setValue;window.Game_Switches.prototype.setValue=function(t,n){Y.switches.has(t)&&(n=Y.switches.get(t)),e.call(this,t,n)}}if(window.Game_Party&&window.Game_Party.prototype.gainGold&&(Hc=window.Game_Party.prototype.gainGold,window.Game_Party.prototype.gainGold=function(e){Y.gold===null&&Hc.call(this,e)}),window.Scene_Base&&window.Scene_Base.prototype.update){let e=window.Scene_Base.prototype.update;window.Scene_Base.prototype.update=function(){e.call(this),X.tick()}}if(window.DataManager){if(window.DataManager.setupNewGame){let e=window.DataManager.setupNewGame;window.DataManager.setupNewGame=function(...t){e.apply(this,t)}}if(window.DataManager.extractSaveContents){let e=window.DataManager.extractSaveContents;window.DataManager.extractSaveContents=function(...t){let n=e.apply(this,t);return X.applyValueLocks(),n}}}X.loadFromStorage(),Vc=!0}},saveToStorage:()=>{try{let e={vars:Array.from(Y.vars.entries()),switches:Array.from(Y.switches.entries()),items:Array.from(Y.items.entries()),gold:Y.gold,stats:Array.from(Y.stats.entries()),noclip:Y.noclip};localStorage.setItem(`forge:locks`,JSON.stringify(e))}catch(e){}},loadFromStorage:()=>{try{let e=localStorage.getItem(`forge:locks`);if(e){let t=JSON.parse(e);Y.vars=new Map(t.vars||[]),Y.switches=new Map(t.switches||[]),Y.items=new Map(t.items||[]),Y.gold=t.gold===void 0?null:t.gold,Y.stats=new Map(t.stats||[]),t.noclip&&X.setNoclip(!0,!0)}}catch(e){}},tick:()=>{if(X.applyValueLocks(),Y.noclip&&window.$gamePlayer&&!window.$gamePlayer.isThrough()&&window.$gamePlayer.setThrough(!0),Y.gold!==null&&window.$gameParty){let e=window.$gameParty.gold();e!==Y.gold&&Hc&&Hc.call(window.$gameParty,Y.gold-e)}if(Y.stats.size>0&&window.$gameActors)for(let[e,t]of Y.stats.entries()){let[n,r]=e.split(`:`),i=parseInt(n,10),a=window.$gameActors.actor(i);if(a){if(r===`hp`&&a.hp!==t)J.setHp(i,t);else if(r===`mp`&&a.mp!==t)J.setMp(i,t);else if(r===`tp`&&a.tp!==t)J.setTp(i,t);else if(r===`level`&&(typeof a.level==`function`?a.level():a._level)!==t)J.setLevel(i,t);else if(r===`exp`&&(a.currentExp?a.currentExp():0)!==t)J.setExp(i,t);else if(r.startsWith(`param_`)){let e=parseInt(r.split(`_`)[1],10);a.param&&a.param(e)!==t&&J.setParam(i,e,t)}}}if(Y.items.size>0&&window.$gameParty)for(let[e,t]of Y.items.entries()){let[n,r]=e.split(`:`),i=parseInt(r,10),a=n;q.inv.setCount(a,i,t)}},applyValueLocks:()=>{if(Y.vars.size>0&&window.$gameVariables)for(let[e,t]of Y.vars.entries())window.$gameVariables.value(e)!==t&&window.$gameVariables.setValue(e,t);if(Y.switches.size>0&&window.$gameSwitches)for(let[e,t]of Y.switches.entries())window.$gameSwitches.value(e)!==t&&window.$gameSwitches.setValue(e,t)},freezeVar:(e,t)=>{t?Y.vars.set(e,q.vars.get(e)):Y.vars.delete(e),Y.vars=new Map(Y.vars),X.saveToStorage()},freezeSwitch:(e,t)=>{t?Y.switches.set(e,q.switches.get(e)):Y.switches.delete(e),Y.switches=new Map(Y.switches),X.saveToStorage()},freezeItem:(e,t,n)=>{let r=`${e}:${t}`;n?Y.items.set(r,q.inv.count(e,t)):Y.items.delete(r),Y.items=new Map(Y.items),X.saveToStorage()},freezeGold:e=>{e?Y.gold=q.gold.get():Y.gold=null,X.saveToStorage()},freezeStat:(e,t,n)=>{let r=`${e}:${t}`;if(n){let n=J.get(e),i=0;if(n){if(t===`hp`||t===`mp`||t===`tp`||t===`level`||t===`exp`)i=n[t];else if(t.startsWith(`param_`)){let e=parseInt(t.split(`_`)[1],10),r=n.params.find(t=>t.id===e);r&&(i=r.value)}}Y.stats.set(r,i)}else Y.stats.delete(r);Y.stats=new Map(Y.stats),X.saveToStorage()},setNoclip:(e,t=!1)=>{Y.noclip=e,window.$gamePlayer&&window.$gamePlayer.setThrough(e),t||zc.show(`Noclip: ${e?`ON`:`OFF`}`,e?`success`:`info`)},clearAll:()=>{Y.vars.clear(),Y.vars=new Map,Y.switches.clear(),Y.switches=new Map,Y.items.clear(),Y.items=new Map,Y.stats.clear(),Y.stats=new Map,Y.gold=null,X.setNoclip(!1,!0),X.saveToStorage()},summary:()=>{let e=[];return Y.vars.forEach((t,n)=>e.push({type:`var`,id:n,label:q.vars.name(n),value:t})),Y.switches.forEach((t,n)=>e.push({type:`switch`,id:n,label:q.switches.name(n),value:t})),Y.items.forEach((t,n)=>{let[r,i]=n.split(`:`),a=parseInt(i,10),o=q.inv.data(r,a);e.push({type:`item`,key:n,label:o?o.name:n,value:t})}),Y.gold!==null&&e.push({type:`gold`,id:`gold`,label:`Gold`,value:Y.gold}),Y.stats.forEach((t,n)=>{var r;let[i,a]=n.split(`:`),o=parseInt(i,10),s=((r=J.get(o))==null?void 0:r.name)||`Actor ${o}`,c=`${s} ${a.toUpperCase()}`,l=`stat`;a.startsWith(`param_`)&&(l=`param`,c=`${s} ${[`Max HP`,`Max MP`,`Attack`,`Defense`,`M. Attack`,`M. Defense`,`Agility`,`Luck`][parseInt(a.split(`_`)[1],10)]||a}`),e.push({type:l,key:n,label:c,value:t})}),e}},Z=I({god:!1,ohko:!1,noEncounter:!1,speed:1,speedBoost:2,speedUseKey:!0,speedHeld:!1,messageSkip:!1}),Uc=!1,Wc={install:()=>{if(!Uc&&!(typeof window>`u`)&&!window.__FORGE_CHEATS__){if(window.__FORGE_CHEATS__=!0,window.Game_Action&&window.Game_Action.prototype.executeHpDamage){let e=window.Game_Action.prototype.executeHpDamage;window.Game_Action.prototype.executeHpDamage=function(t,n){Z.god&&t.isActor()&&n>0&&(n=0),Z.ohko&&this.subject().isActor()&&t.isEnemy()&&(n=t.hp),e.call(this,t,n)}}if(window.Game_Battler&&window.Game_Battler.prototype.gainHp){let e=window.Game_Battler.prototype.gainHp;window.Game_Battler.prototype.gainHp=function(t){Z.god&&this.isActor()&&t<0&&(t=0),e.call(this,t)}}if(window.Game_Actor&&window.Game_Actor.prototype.executeFloorDamage){let e=window.Game_Actor.prototype.executeFloorDamage;window.Game_Actor.prototype.executeFloorDamage=function(){Z.god||e.call(this)}}if(window.Game_Player&&window.Game_Player.prototype.encounterProgressValue){let e=window.Game_Player.prototype.encounterProgressValue;window.Game_Player.prototype.encounterProgressValue=function(){return Z.noEncounter?0:e.call(this)}}if(window.SceneManager&&window.SceneManager.updateScene){let e=window.SceneManager.updateScene,t=0,n=e=>{if(e.isCurrentSceneStarted){if(!e.isCurrentSceneStarted())return!1}else if(e._scene&&e._scene.isStarted&&!e._scene.isStarted())return!1;return!(e.isSceneChanging&&e.isSceneChanging()||window.$gamePlayer&&window.$gamePlayer.isTransferring&&window.$gamePlayer.isTransferring()||window.DataManager&&window.DataManager.isMapLoaded&&!window.DataManager.isMapLoaded())};window.SceneManager.updateScene=function(){let r=Z.speedHeld?Z.speedBoost:Z.speed;if(Z.speedUseKey&&!Z.speedHeld&&(r=1),r>=1)if(e.call(this),r>1&&this._scene&&typeof this._scene.update==`function`&&n(this)){t+=r-1;let e=0;for(;t>=1&&e++<64;){--t;try{this._scene.update()}catch(e){t=0;break}}}else t=0;else if(t+=r,t>=1)--t,e.call(this);else if(this._scene){let t=this._scene.update;this._scene.update=function(){};try{e.call(this)}finally{this._scene.update=t}}}}if(window.Window_Message&&window.Window_Message.prototype.updateShowFast){let e=window.Window_Message.prototype.updateShowFast;window.Window_Message.prototype.updateShowFast=function(){e.call(this),Z.messageSkip&&(this._showFast=!0,this._pauseSkip=!0)}}if(window.Window_Message&&window.Window_Message.prototype.updateInput){let e=window.Window_Message.prototype.updateInput;window.Window_Message.prototype.updateInput=function(){let t=e.call(this);return this.pause&&Z.messageSkip?(this.pause=!1,this._textState||this.terminateMessage(),!0):t}}if(window.Window_ScrollText&&window.Window_ScrollText.prototype.scrollSpeed){let e=window.Window_ScrollText.prototype.scrollSpeed;window.Window_ScrollText.prototype.scrollSpeed=function(){let t=e.call(this);return Z.messageSkip&&(t*=100),t}}if(window.Window_BattleLog&&window.Window_BattleLog.prototype.messageSpeed){let e=window.Window_BattleLog.prototype.messageSpeed;window.Window_BattleLog.prototype.messageSpeed=function(){let t=e.call(this);return Z.messageSkip&&(t=1),t}}Uc=!0}},setGod:e=>{Z.god=e},setOhko:e=>{Z.ohko=e},setNoEncounter:e=>{Z.noEncounter=e},setSpeed:e=>{Z.speed=e},setSpeedBoost:e=>{Z.speedBoost=e},setSpeedUseKey:e=>{Z.speedUseKey=e},startSpeedHold:()=>{Z.speedHeld=!0},stopSpeedHold:()=>{Z.speedHeld=!1},setMessageSkip:e=>{Z.messageSkip=e}},Gc={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,meta:91,rightclick:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,"numpad*":106,"numpad+":107,"numpad-":109,"numpad.":110,"numpad/":111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,mycomputer:182,mycalculator:183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Kc={};for(let e of Object.keys(Gc))Kc[e.toLowerCase()]=Gc[e];var qc={};for(let e of Object.keys(Kc))qc[Kc[e]]=e;var Jc=new Set([17,18,16,91]),Yc=class e{constructor(e,t,n,r,i){S(this,`code`,void 0),S(this,`ctrl`,void 0),S(this,`alt`,void 0),S(this,`shift`,void 0),S(this,`meta`,void 0),this.code=e,this.ctrl=t,this.alt=n,this.shift=r,this.meta=i}static createEmpty(){return new e(256,!1,!1,!1,!1)}static fromKey(t){return new e(t.code,t.ctrl,t.alt,t.shift,t.meta)}static fromString(t){if(!t||t===``)return e.createEmpty();let n=t.toLowerCase().split(` `);if(n.length===0)throw Error(`No keymap found`);let r=null,i=!1,a=!1,o=!1,s=!1;for(let e of n)switch(e=e.trim(),e){case`ctrl`:case`control`:i=!0;break;case`alt`:a=!0;break;case`shift`:o=!0;break;case`meta`:s=!0;break;default:if(r!==null)throw Error(`Cannot combine multiple standard keys`);if(!Object.prototype.hasOwnProperty.call(Kc,e))throw Error(`Unknown key: ${e}`);r=Kc[e]}return r===null&&(r=256),new e(r,i,a,o,s)}static fromEvent(t){var k=window.__dazedKeyCode(t);return Jc.has(k)?e._fromCombiningAloneEvent(t):new e(k,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey)}static _fromCombiningAloneEvent(t){return new e(256,t.keyCode===17||t.ctrlKey,t.keyCode===18||t.altKey,t.keyCode===16||t.shiftKey,t.keyCode===91||t.metaKey)}isEmpty(){return this.code===256&&!this.ctrl&&!this.alt&&!this.shift&&!this.meta}isCombiningKey(){return this.code===256&&!this.isEmpty()}equals(e){return this.code===e.code&&this.ctrl===e.ctrl&&this.alt===e.alt&&this.shift===e.shift&&this.meta===e.meta}contains(e){return(!e.ctrl||this.ctrl)&&(!e.alt||this.alt)&&(!e.shift||this.shift)&&(!e.meta||this.meta)&&(e.isCombiningKey()||e.code===this.code)}countPressingKeys(){let e=0;return this.code!==256&&(e+=1),this.ctrl&&(e+=1),this.alt&&(e+=1),this.shift&&(e+=1),this.meta&&(e+=1),e}asStringArray(){if(this.isEmpty())return[];let e=[];return this.ctrl&&e.push(`ctrl`),this.alt&&e.push(`alt`),this.shift&&e.push(`shift`),this.meta&&e.push(`meta`),this.code!==256&&e.push(qc[this.code]||`key_${this.code}`),e}adjustCombiningKey(e){this.ctrl=e.ctrlKey,this.alt=e.altKey,this.shift=e.shiftKey,this.meta=e.metaKey}add(e){if(Jc.has(e)){this._setCombiningKey(e,!0);return}this.code=e}remove(e){if(Jc.has(e)){this._setCombiningKey(e,!1);return}this.code===e&&(this.code=256)}_setCombiningKey(e,t){switch(e){case 17:this.ctrl=t;break;case 18:this.alt=t;break;case 16:this.shift=t;break;case 91:this.meta=t;break}}capitalize(e){return e.length===0?``:e.length===1?e.charAt(0).toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}asString(){return this.asStringArray().join(` `)}asDisplayString(){return this.asStringArray().map(e=>this.capitalize(e)).join(` + `)}},Q=I({visible:!1,activeTab:Ic.General,targetActorId:null,targetActorStat:null,targetVarId:null,targetSwitchId:null,targetItemKey:null}),$={currentKey:Yc.createEmpty(),shortcuts:[],activeShortcutIds:new Set,init:e=>{let t=localStorage.getItem(`forge:shortcuts`),n={};if(t)try{n=JSON.parse(t)}catch(e){}$.shortcuts=e.map(e=>{let t=n[e.id];return{...e,keyStr:(t==null?void 0:t.keyStr)===void 0?e.keyStr:t.keyStr,enabled:(t==null?void 0:t.enabled)===void 0?e.enabled:t.enabled,params:(t==null?void 0:t.params)||e.params}}),window.addEventListener(`keydown`,$.onKeyDown.bind($),{capture:!0}),window.addEventListener(`keyup`,$.onKeyUp.bind($),{capture:!0})},save:()=>{let e={};$.shortcuts.forEach(t=>{e[t.id]={keyStr:t.keyStr,enabled:t.enabled,params:t.params}}),localStorage.setItem(`forge:shortcuts`,JSON.stringify(e))},get:e=>$.shortcuts.find(t=>t.id===e),update:(e,t)=>{let n=$.get(e);n&&(Object.assign(n,t),$.save())},_isFocusedOnInput:()=>{let e=document.activeElement;for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable)},_hasSelection:()=>{var e;if(!Q.visible)return!1;let t=((e=window.getSelection())==null?void 0:e.toString())||``;if(!t){let e=document.getElementById(`forge-mvmz-host`);e&&e.shadowRoot&&e.shadowRoot.getSelection&&(t=e.shadowRoot.getSelection().toString()||``)}return t.trim().length>0},onKeyDown:e=>{if(!$._isFocusedOnInput()&&!$._hasSelection()){if(e.repeat){let t=!1;for(let e of $.activeShortcutIds){let n=$.get(e);n&&n.onRepeat&&(n.onRepeat(n.params),t=!0)}t&&(e.preventDefault(),e.stopPropagation());return}$.currentKey.add(window.__dazedKeyCode(e)),$.currentKey.adjustCombiningKey(e),$.processTransitions(e)}},onKeyUp:e=>{$._isFocusedOnInput()||($.currentKey.remove(window.__dazedKeyCode(e)),$.currentKey.adjustCombiningKey(e),$.processTransitions(e))},processTransitions:e=>{let t=new Set;for(let e of $.shortcuts)if(!(!e.enabled||!e.keyStr))try{let n=Yc.fromString(e.keyStr),r=!1;r=e.combiningKeyAlone?$.currentKey.contains(n):n.equals($.currentKey),r&&t.add(e.id)}catch(t){console.error(`[FORGE] Error parsing keyStr for ${e.id}:`,t)}let n=Array.from($.activeShortcutIds);for(let e of n)if(!t.has(e)){let t=$.get(e);if(t){var r;(r=t.onLeave)==null||r.call(t,t.params)}$.activeShortcutIds.delete(e)}let i=!1;for(let e of t)if(!$.activeShortcutIds.has(e)){let t=$.get(e);if(t){var a;(a=t.onEnter)==null||a.call(t,t.params),$.activeShortcutIds.add(e),i=!0}}i&&e.type===`keydown`&&(e.preventDefault(),e.stopPropagation())}},Xc=I({inactiveOpacity:80,autoOpen:!1,rememberPosition:!0,favorites:{},showLauncher:!0,quickSaveSlot:1}),Zc={load:()=>{try{let e=localStorage.getItem(`forge:config`);if(e){let t=JSON.parse(e);typeof t.inactiveOpacity==`number`&&(Xc.inactiveOpacity=t.inactiveOpacity),typeof t.autoOpen==`boolean`&&(Xc.autoOpen=t.autoOpen),typeof t.rememberPosition==`boolean`&&(Xc.rememberPosition=t.rememberPosition),t.favorites&&typeof t.favorites==`object`&&(Xc.favorites=t.favorites),typeof t.showLauncher==`boolean`&&(Xc.showLauncher=t.showLauncher),typeof t.quickSaveSlot==`number`&&(Xc.quickSaveSlot=t.quickSaveSlot)}}catch(e){}},save:()=>{localStorage.setItem(`forge:config`,JSON.stringify({inactiveOpacity:Xc.inactiveOpacity,autoOpen:Xc.autoOpen,rememberPosition:Xc.rememberPosition,favorites:Xc.favorites,showLauncher:Xc.showLauncher,quickSaveSlot:Xc.quickSaveSlot}))},toggleFavorite:(e,t)=>{Xc.favorites[e]||(Xc.favorites[e]=[]);let n=Xc.favorites[e].indexOf(t);n===-1?Xc.favorites[e].push(t):Xc.favorites[e].splice(n,1),Zc.save()},isFavorite:(e,t)=>{var n;return((n=Xc.favorites[e])==null?void 0:n.includes(t))||!1},resetAll:()=>{confirm(`Are you sure you want to reset all Forge settings, locks, and saved data? This cannot be undone.`)&&(localStorage.clear(),window.location.reload())}},Qc=I({entries:[]}),$c=!1,el=1,tl={install:()=>{if(!$c&&!(typeof window>`u`)&&!window.__FORGE_LOGS__){if(window.__FORGE_LOGS__=!0,window.Game_Message&&window.Game_Message.prototype.add){let e=window.Game_Message.prototype.add;window.Game_Message.prototype.add=function(t){e.call(this,t);let n=``;typeof this.speakerName==`function`&&(n=this.speakerName()||``),tl.addEntry(n,t)}}$c=!0}},addEntry:(e,t)=>{let n=t;if(n=n.replace(/\\\\/g,`\x1B`),n=n.replace(/\\x1b/g,`\x1B`),n=n.replace(/\\V\[(\d+)\]/gi,(e,t)=>window.$gameVariables?String(window.$gameVariables.value(parseInt(t))):``),n=n.replace(/\\N\[(\d+)\]/gi,(e,t)=>{var n;return window.$gameActors&&((n=window.$gameActors.actor(parseInt(t)))==null?void 0:n.name())||``}),n=n.replace(/\\P\[(\d+)\]/gi,(e,t)=>{let n=(window.$gameParty?window.$gameParty.members():[])[parseInt(t)-1];return n?n.name():``}),n=n.replace(/\\G/gi,()=>window.TextManager?window.TextManager.currencyUnit:``),n=n.replace(/\x1bC\[\d+\]/gi,``),n=n.replace(/\x1bI\[\d+\]/gi,``),n=n.replace(/\x1b[\\{\\}\.\|!><\^]/g,``),n=n.replace(/\x1b[A-Z]\[.*?\]/gi,``),n=n.replace(/\x1b/g,``),!e){let t=n.match(/^\\n<([^>]+)>/i);t&&(e=t[1],n=n.replace(/^\\n<([^>]+)>/i,``))}if(n=n.replace(/\n/g,` `),n=n.replace(/\s+/g,` `),n=n.trim(),!n)return;let r=Date.now(),i=Qc.entries[Qc.entries.length-1];i&&i.speaker===e&&r-i.timestamp<100?(i.text+=` ${n}`,i.timestamp=r):Qc.entries.push({id:el++,speaker:e,text:n,timestamp:r})},clear:()=>{Qc.entries=[]}},nl=[{id:`toggle_ui`,name:`Toggle Cheat UI`,desc:`Show/Hide the cheat panel`,keyStr:`f8`,enabled:!0,required:!0,onEnter:()=>Q.visible=!Q.visible},{id:`toggle_save_recall`,name:`Toggle Save Locations Tab`,desc:`Open/close panel on Bookmarks`,keyStr:`Ctrl M`,enabled:!0,onEnter:()=>{Q.visible=!0,Q.activeTab=Ic.Map}},{id:`quick_save`,name:`Quick Save`,desc:`Quick save to configured slot`,keyStr:`Ctrl S`,enabled:!0,onEnter:()=>q.scene.quickSave(Xc.quickSaveSlot)},{id:`quick_load`,name:`Quick Load`,desc:`Quick load from configured slot`,keyStr:`Ctrl Q`,enabled:!0,onEnter:()=>q.scene.quickLoad(Xc.quickSaveSlot)},{id:`open_save_scene`,name:`Open Save Scene`,desc:`Push or pop Save scene`,keyStr:`Ctrl [`,enabled:!0,onEnter:()=>q.scene.toggleSaveScene()},{id:`open_load_scene`,name:`Open Load Scene`,desc:`Push or pop Load scene`,keyStr:`Ctrl ]`,enabled:!0,onEnter:()=>q.scene.toggleLoadScene()},{id:`goto_title`,name:`Go to Title`,desc:`Return to title screen`,keyStr:`Ctrl T`,enabled:!0,onEnter:()=>q.scene.gotoTitle()},{id:`force_victory`,name:`Force Victory`,desc:`Force battle victory`,keyStr:`Ctrl V`,enabled:!0,onEnter:()=>q.battle.forceVictory()},{id:`force_defeat`,name:`Force Defeat`,desc:`Force battle defeat`,keyStr:`Ctrl D`,enabled:!0,onEnter:()=>q.battle.forceDefeat()},{id:`force_escape`,name:`Force Escape`,desc:`Force battle escape`,keyStr:`Ctrl E`,enabled:!0,onEnter:()=>q.battle.forceEscape()},{id:`toggle_noclip`,name:`Toggle Noclip`,desc:`Walk through walls`,keyStr:`Alt W`,enabled:!0,onEnter:()=>X.setNoclip(!Y.noclip)},{id:`enemy_wound`,name:`Enemies HP to 1`,desc:`Wound all active enemies`,keyStr:`Alt 1`,enabled:!0,onEnter:()=>q.battle.changeAllEnemyHealth(1)},{id:`enemy_recovery`,name:`Recover Enemies`,desc:`Fully recover enemies`,keyStr:`Alt 0`,enabled:!0,onEnter:()=>q.battle.recoverAllEnemy()},{id:`party_wound`,name:`Party HP to 1`,desc:`Wound all party members`,keyStr:`Alt 2`,enabled:!0,onEnter:()=>q.battle.changeAllPartyHealth(1)},{id:`party_recovery`,name:`Recover Party`,desc:`Fully recover party members`,keyStr:`Alt 9`,enabled:!0,onEnter:()=>q.battle.recoverAllParty()},{id:`trigger_encounter`,name:`Trigger Encounter`,desc:`Next step triggers random battle`,keyStr:``,enabled:!0,onEnter:()=>{window.$gamePlayer&&(window.$gamePlayer._encounterCount=0)}},{id:`speed_hold`,name:`Speed Hold Key`,desc:`Hold to fast forward game`,keyStr:`Ctrl`,enabled:!0,combiningKeyAlone:!0,onEnter:()=>Wc.startSpeedHold(),onLeave:()=>Wc.stopSpeedHold()},{id:`skip_message`,name:`Skip Message Key`,desc:`Hold to skip dialogs`,keyStr:``,enabled:!0,combiningKeyAlone:!0,onEnter:()=>Wc.setMessageSkip(!0),onLeave:()=>Wc.setMessageSkip(!1)},{id:`open_dev_tool`,name:`Open Dev Tools`,desc:`Show Nw.js developer tools`,keyStr:`F12`,enabled:!0,onEnter:()=>q.system.openDevTool()}],rl=W(`<div class="absolute right-0 bottom-0 h-4 w-4 cursor-nwse-resize" role="presentation"></div>`);function il(e,t){var n=rl();U(`mousedown`,n,function(...e){var n;(n=t.onmousedown)==null||n.apply(this,e)}),G(e,n)}Wa([`mousedown`]);var al=W(`<button class="bg-accent hover:brightness-110 shadow-2xl pointer-events-auto fixed flex h-11 w-11 cursor-pointer items-center justify-center rounded-full border-0 text-white transition z-2147482999 opacity-90 hover:opacity-100" title="Toggle Forge Panel"><!></button>`);function ol(e,t){Mt(t,!0);let n=P(0),r=P(0);Ws(()=>{try{let e=JSON.parse(localStorage.getItem(`forge:launcherPos`)||`null`);e?(F(n,e.x,!0),F(r,e.y,!0)):(F(n,(window.innerWidth||800)-56),F(r,(window.innerHeight||600)-56))}catch(e){F(n,100),F(r,100)}});let i=P(!1),a=P(0),o=P(0),s=P(0),c=P(0),l=P(!1),u=e=>{if(!H(i))return;e.stopPropagation(),e.preventDefault();let t=e.clientX-H(a),u=e.clientY-H(o);Math.abs(t)+Math.abs(u)>3&&F(l,!0),F(n,Math.max(4,Math.min(window.innerWidth-46,H(s)+t)),!0),F(r,Math.max(4,Math.min(window.innerHeight-46,H(c)+u)),!0)},d=e=>{H(i)&&(e.stopPropagation(),e.preventDefault()),F(i,!1),window.removeEventListener(`mousemove`,u,!0),window.removeEventListener(`mouseup`,d,!0);try{localStorage.setItem(`forge:launcherPos`,JSON.stringify({x:H(n),y:H(r)}))}catch(e){}setTimeout(()=>{F(l,!1)},0)},f=e=>{e.preventDefault(),F(i,!0),F(l,!1),F(a,e.clientX,!0),F(o,e.clientY,!0),F(s,H(n),!0),F(c,H(r),!0),window.addEventListener(`mousemove`,u,!0),window.addEventListener(`mouseup`,d,!0)},p=()=>{H(l)||(Q.visible=!Q.visible)};var m=eo(),h=_i(m),g=e=>{var t=al();Ac(L(t),{size:20}),D(t),z(()=>{var e,i;return Xo(t,`left: ${(e=H(n))==null?``:e}px; top: ${(i=H(r))==null?``:i}px;`)}),U(`mousedown`,t,e=>{e.stopPropagation(),f(e)}),U(`click`,t,e=>{e.stopPropagation(),p()}),G(e,t)};mo(h,e=>{Xc.showLauncher&&e(g)}),G(e,m),Nt()}Wa([`mousedown`,`click`]);var sl=W(`<div class="w-full"><!></div>`),cl=W(`<div class="absolute inset-0 flex items-center justify-center text-gray-500">Nothing here</div>`),ll=W(`<div class="relative h-full w-full overflow-y-auto"><div class="w-full"><div class="absolute top-0 left-0 w-full"></div></div> <!></div>`);function ul(e,t){Mt(t,!0);let n=Hs(t,`items`,19,()=>[]),r=Hs(t,`itemHeight`,3,32),i=Hs(t,`containerHeight`,3,400),a=P(0),o=P(void 0),s=Wn(()=>n().length*r()),c=Wn(()=>Math.floor(H(a)/r())),l=Wn(()=>Math.min(n().length-1,H(c)+Math.ceil(i()/r())+2)),u=Wn(()=>n().slice(H(c),H(l)+1).map((e,t)=>({...e,_index:H(c)+t}))),d=e=>{F(a,e.target.scrollTop,!0)};var f={resetScroll:()=>{H(o)&&(H(o).scrollTop=0)},scrollToBottom:()=>{H(o)&&(H(o).scrollTop=H(o).scrollHeight)},scrollToIndex:e=>{setTimeout(()=>{H(o)&&(F(a,e*r()),H(o).scrollTop=e*r())},100)}},p=ll(),m=L(p),h=L(m);yo(h,21,()=>H(u),e=>e.id,(e,n)=>{var i=sl();Eo(L(i),()=>t.itemTemplate,()=>H(n),()=>H(n)._index),D(i),z(()=>{var e;return Xo(i,`height: ${(e=r())==null?``:e}px;`)}),G(e,i)}),D(h),D(m);var g=R(m,2),_=e=>{G(e,cl())};return mo(g,e=>{n().length===0&&e(_)}),D(p),Ps(p,e=>F(o,e),()=>H(o)),z(()=>{var e;Xo(m,`height: ${(e=H(s))==null?``:e}px;`),Xo(h,`transform: translateY(${H(c)*r()}px);`)}),Ua(`scroll`,p,d),G(e,p),Nt(f)}var dl=W(`<div class="inline-flex items-center overflow-hidden rounded border border-border bg-bg text-sm shrink-0 h-8 w-32"><button class="flex items-center justify-center w-8 h-full border-r border-border text-gray-500 hover:text-white hover:bg-border/30 transition-colors shrink-0 select-none" aria-label="Decrease">-</button> <input type="text" class="w-full min-w-0 flex-1 bg-transparent text-center text-white outline-none text-sm"/> <button class="flex items-center justify-center w-8 h-full border-l border-border text-gray-500 hover:text-white hover:bg-border/30 transition-colors shrink-0 select-none" aria-label="Increase">+</button></div>`);function fl(e,t){Mt(t,!0);let n=Hs(t,`value`,15,0),r=Hs(t,`min`,19,()=>-1/0),i=Hs(t,`max`,3,1/0),a=P(I(String(n())));Mi(()=>{F(a,String(n()),!0)});let o=()=>{var e;let o=parseFloat(H(a));isNaN(o)&&(o=n()),o=Math.max(r(),Math.min(i(),o)),n(o),F(a,String(o),!0),(e=t.onchange)==null||e.call(t,n())},s=(e,o)=>{var s;o.shiftKey&&(e*=10);let c=n()+e;c=Math.max(r(),Math.min(i(),c)),n(c),F(a,String(c),!0),(s=t.onchange)==null||s.call(t,n())},c=e=>{e.stopPropagation(),e.key===`Enter`?(o(),e.target.blur()):e.key===`Escape`&&(F(a,String(n()),!0),e.target.blur())};var l=dl(),u=L(l),d=R(u,2);us(d);var f=R(d,2);D(l),U(`click`,u,e=>s(-1,e)),Ua(`blur`,d,o),U(`keydown`,d,c),Cs(d,()=>H(a),e=>F(a,e)),U(`click`,f,e=>s(1,e)),G(e,l),Nt()}Wa([`click`,`keydown`]);var pl=W(`<button><!></button>`);function ml(e,t){Mt(t,!0);let n=Hs(t,`locked`,3,!1);var r=pl(),i=L(r),a=e=>{uc(e,{size:14})},o=e=>{cc(e,{size:14})};mo(i,e=>{n()?e(a):e(o,-1)}),D(r),z(()=>{Jo(r,1,`flex h-6 w-6 shrink-0 items-center justify-center rounded transition-colors focus:outline-none ${n()?`bg-frozen/20 text-frozen hover:bg-frozen/30`:`hover:bg-border text-gray-500 hover:text-gray-300`}`),ps(r,`title`,n()?`Unfreeze`:`Freeze`),ps(r,`aria-label`,n()?`Unfreeze state`:`Freeze state`)}),U(`click`,r,()=>{var e;return(e=t.ontoggle)==null?void 0:e.call(t,!n())}),G(e,r),Nt()}Wa([`click`]);var hl=W(`<select class="border-border bg-bg2 h-8 w-32 rounded border px-3 text-sm focus:outline-none"><option>True</option><option>False</option></select>`),gl=W(`<input type="text" class="border-border bg-bg2 focus:bg-border/30 h-8 w-32 rounded border px-3 text-sm focus:outline-none"/>`),_l=W(`<div><div class="w-12 shrink-0 font-mono text-xs text-gray-500 select-text cursor-text"> </div> <div class="flex flex-1 flex-col justify-center truncate pr-4"><div class="truncate font-semibold text-sm text-white select-text cursor-text"> </div></div> <div class="flex shrink-0 items-center space-x-3"><button title="Pin to top"><!></button> <button class="border-border bg-bg hover:bg-border/50 text-gray-400 rounded border w-10 py-0.5 text-[10px] font-bold uppercase transition-colors shrink-0 text-center" title="Toggle Type Override"> </button> <!> <div class="ml-2 flex items-center"><!></div></div></div>`),vl=W(`<div class="flex h-full flex-col"><div class="mb-4 flex items-center justify-between"><input type="text" placeholder="Search variables (ID or name)..." class="border-border bg-bg focus:border-accent flex-1 mr-3 rounded border px-3 py-1.5 text-sm transition-colors focus:outline-none"/> <div class="text-sm text-gray-500"> </div></div> <div class="border-border bg-bg relative flex-1 overflow-hidden rounded-lg border"><!></div></div>`);function yl(e,t){Mt(t,!0);let n=P(I([])),r=P(I([])),i=P(``),a=P(void 0);Mi(()=>{if(Q.targetVarId!==null&&H(a)&&H(r).length>0){let e=H(r).findIndex(e=>e.id===Q.targetVarId);e!==-1&&H(a).scrollToIndex(e),Q.targetVarId=null}});let o,s=P(!1),c=new Set,l=I({}),u=()=>{if(!H(i).trim())c=new Set(H(n).map(e=>e.id));else{let e=H(i).trim().toLowerCase(),t=H(n).filter(t=>String(t.id)===e||t.name.toLowerCase().includes(e)||t.value!==void 0&&t.value!==null&&String(t.value).toLowerCase().includes(e));c=new Set(t.map(e=>e.id))}},d=()=>{F(r,H(n).filter(e=>c.has(e.id)).sort((e,t)=>{let n=Zc.isFavorite(`variables`,e.id),r=Zc.isFavorite(`variables`,t.id);return n&&!r?-1:!n&&r?1:e.id-t.id}),!0)},f=()=>{F(n,q.vars.list(),!0),u(),d()},p=e=>{F(i,e.target.value,!0),clearTimeout(o),o=setTimeout(()=>{u(),d()},300)};Ws(()=>{f();let e=setInterval(()=>{H(s)||(F(n,q.vars.list(),!0),d())},1e3);return()=>clearInterval(e)});let h=(e,t)=>{q.vars.set(e,t),Y.vars.has(e)&&X.freezeVar(e,!0);let r=H(n).find(t=>t.id===e);r&&(r.value=t)};var g=vl(),_=L(g),v=L(_);us(v);var y=R(v,2),b=L(y);D(y),D(_);var x=R(_,2);Ps(ul(L(x),{get items(){return H(r)},itemHeight:36,itemTemplate:(e,t=m)=>{let r=Wn(()=>l[t().id]||typeof t().value);var i=_l(),a=L(i),o=L(a,!0);D(a);var c=R(a,2),u=L(c),f=L(u,!0);D(u),D(c);var p=R(c,2),g=L(p),_=L(g);{let e=Wn(()=>Zc.isFavorite(`variables`,t().id)?`fill-current`:``);bc(_,{size:16,get class(){return H(e)}})}D(g);var v=R(g,2),y=L(v,!0);D(v);var b=R(v,2),x=e=>{{let n=Wn(()=>Number(t().value)||0);fl(e,{get value(){return H(n)},onchange:e=>h(t().id,e)})}},S=e=>{var n=hl(),r=L(n);r.value=r.__value=`true`;var i=R(r);i.value=i.__value=`false`,D(n);var a;Qo(n),z(()=>{a!==(a=t().value?`true`:`false`)&&(n.value=n.__value=t().value?`true`:`false`,Zo(n,t().value?`true`:`false`))}),U(`change`,n,e=>h(t().id,e.currentTarget.value===`true`)),G(e,n)},ee=e=>{var n=gl();us(n),z(e=>ds(n,e),[()=>String(t().value===void 0||t().value===null?``:t().value)]),Ua(`blur`,n,e=>h(t().id,e.currentTarget.value)),U(`keydown`,n,e=>{e.stopPropagation(),e.key===`Enter`&&e.currentTarget.blur()}),G(e,n)};mo(b,e=>{H(r)===`number`?e(x):H(r)===`boolean`?e(S,1):e(ee,-1)});var C=R(b,2),w=L(C);{let e=Wn(()=>Y.vars.has(t().id));ml(w,{get locked(){return H(e)},ontoggle:e=>{X.freezeVar(t().id,e),F(n,[...H(n)],!0),d()}})}D(C),D(p),D(i),z((e,n,a)=>{Jo(i,1,`border-border/50 hover:bg-border/30 flex h-full items-center border-b px-4 transition-colors ${e==null?``:e}`),K(o,n),ps(u,`title`,t().name),K(f,t().name),Jo(g,1,`mr-2 flex items-center justify-center transition-colors ${a==null?``:a}`),K(y,H(r)===`number`?`NUM`:H(r)===`string`?`STR`:`BOOL`)},[()=>Y.vars.has(t().id)?`border-l-frozen border-l-4 pl-3`:``,()=>t().id.toString().padStart(4,`0`),()=>Zc.isFavorite(`variables`,t().id)?`text-yellow-400 hover:text-yellow-300`:`text-gray-600 hover:text-gray-400`]),U(`focusin`,p,()=>F(s,!0)),U(`focusout`,p,()=>F(s,!1)),U(`click`,g,()=>{Zc.toggleFavorite(`variables`,t().id),d()}),U(`click`,v,()=>{(l[t().id]||typeof t().value)===`number`?l[t().id]=`string`:l[t().id]=`number`}),G(e,i)},$$slots:{itemTemplate:!0}}),e=>F(a,e,!0),()=>H(a)),D(x),D(g),z(()=>{var e;ds(v,H(i)),K(b,`${(e=H(r).length)==null?``:e} items`)}),U(`input`,v,p),G(e,g),Nt()}Wa([`input`,`focusin`,`focusout`,`click`,`change`,`keydown`]);var bl=W(`<button aria-label="Toggle"><span></span></button>`);function xl(e,t){Mt(t,!0);let n=Hs(t,`value`,15,!1),r=()=>{var e;n(!n()),(e=t.onchange)==null||e.call(t,n())};var i=bl(),a=L(i);D(i),z(()=>{Jo(i,1,`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${n()?`bg-ok`:`bg-[#3a3f4d]`}`),Jo(a,1,`absolute top-[4px] h-4 w-4 rounded-full bg-white shadow transition-all ${n()?`left-[24px]`:`left-[4px]`}`)}),U(`click`,i,r),G(e,i),Nt()}Wa([`click`]);var Sl=W(`<div><div class="w-12 shrink-0 font-mono text-xs text-gray-500 select-text cursor-text"> </div> <div class="flex-1 min-w-0 pr-4"><div> </div></div> <div class="flex shrink-0 items-center space-x-4" role="presentation"><button title="Pin to top"><!></button> <!> <div class="flex items-center"><!></div></div></div>`),Cl=W(`<div class="flex h-full flex-col"><div class="mb-4 flex items-center justify-between"><input type="text" placeholder="Search switches (ID or name)..." class="border-border bg-bg focus:border-accent flex-1 mr-3 rounded border px-3 py-1.5 text-sm transition-colors focus:outline-none"/> <div class="flex items-center space-x-2"><button class="bg-border hover:bg-border/80 rounded px-3 py-1 text-sm transition-colors font-medium text-white">All ON</button> <button class="bg-border hover:bg-border/80 rounded px-3 py-1 text-sm transition-colors font-medium text-white">All OFF</button> <div class="ml-2 text-sm text-gray-500"> </div></div></div> <div class="border-border bg-bg relative flex-1 overflow-hidden rounded-lg border"><!></div></div>`);function wl(e,t){Mt(t,!0);let n=P(I([])),r=P(I([])),i=P(``),a=P(void 0);Mi(()=>{if(Q.targetSwitchId!==null&&H(a)&&H(r).length>0){let e=H(r).findIndex(e=>e.id===Q.targetSwitchId);e!==-1&&H(a).scrollToIndex(e),Q.targetSwitchId=null}});let o,s=P(!1),c=new Set,l=()=>{if(!H(i).trim())c=new Set(H(n).map(e=>e.id));else{let e=H(i).trim().toLowerCase(),t=H(n).filter(t=>String(t.id)===e||t.name.toLowerCase().includes(e)||(t.value?`true`:`false`).includes(e));c=new Set(t.map(e=>e.id))}},u=()=>{F(r,H(n).filter(e=>c.has(e.id)).sort((e,t)=>{let n=Zc.isFavorite(`switches`,e.id),r=Zc.isFavorite(`switches`,t.id);return n&&!r?-1:!n&&r?1:e.id-t.id}),!0)},d=()=>{F(n,q.switches.list(),!0),l(),u()},f=e=>{F(i,e.target.value,!0),clearTimeout(o),o=setTimeout(()=>{l(),u()},300)};Ws(()=>{d();let e=setInterval(()=>{H(s)||(F(n,q.switches.list(),!0),u())},1e3);return()=>clearInterval(e)});let p=(e,t)=>{q.switches.set(e,t),Y.switches.has(e)&&X.freezeSwitch(e,!0);let r=H(n).find(t=>t.id===e);r&&(r.value=t)},h=e=>{H(r).forEach(t=>p(t.id,e)),d(),zc.show(`All filtered switches turned ${e?`ON`:`OFF`}`,`success`)};var g=Cl(),_=L(g),v=L(_);us(v);var y=R(v,2),b=L(y),x=R(b,2),S=R(x,2),ee=L(S);D(S),D(y),D(_);var C=R(_,2);Ps(ul(L(C),{get items(){return H(r)},itemHeight:36,itemTemplate:(e,t=m)=>{var r=Sl(),i=L(r),a=L(i,!0);D(i);var o=R(i,2),c=L(o),l=L(c,!0);D(c),D(o);var d=R(o,2),f=L(d),h=L(f);{let e=Wn(()=>Zc.isFavorite(`switches`,t().id)?`fill-current`:``);bc(h,{size:16,get class(){return H(e)}})}D(f);var g=R(f,2);xl(g,{get value(){return t().value},onchange:e=>p(t().id,e)});var _=R(g,2),v=L(_);{let e=Wn(()=>Y.switches.has(t().id));ml(v,{get locked(){return H(e)},ontoggle:e=>{X.freezeSwitch(t().id,e),F(n,[...H(n)],!0),u()}})}D(_),D(d),D(r),z((e,n,i)=>{Jo(r,1,`border-border/50 hover:bg-border/30 flex h-full items-center border-b px-4 transition-colors ${e==null?``:e}`),K(a,n),Jo(c,1,`truncate text-sm select-text cursor-text ${t().value?`text-white font-bold`:`text-gray-400`}`),K(l,t().name),Jo(f,1,`flex items-center justify-center transition-colors ${i==null?``:i}`)},[()=>Y.switches.has(t().id)?`border-l-frozen border-l-4 pl-3`:``,()=>t().id.toString().padStart(4,`0`),()=>Zc.isFavorite(`switches`,t().id)?`text-yellow-400 hover:text-yellow-300`:`text-gray-600 hover:text-gray-400`]),Ua(`mouseenter`,d,()=>F(s,!0)),Ua(`mouseleave`,d,()=>F(s,!1)),U(`click`,f,()=>{Zc.toggleFavorite(`switches`,t().id),u()}),G(e,r)},$$slots:{itemTemplate:!0}}),e=>F(a,e,!0),()=>H(a)),D(C),D(g),z(()=>{var e;ds(v,H(i)),K(ee,`${(e=H(r).length)==null?``:e} items`)}),U(`input`,v,f),U(`click`,b,()=>h(!0)),U(`click`,x,()=>h(!1)),G(e,g),Nt()}Wa([`input`,`click`]);var Tl=W(`<div class="truncate text-xs text-gray-500 select-text cursor-text"> </div>`),El=W(`<div><div class="w-12 font-mono text-xs text-gray-500 select-text cursor-text"> </div> <div class="flex flex-1 flex-col justify-center truncate pr-4"><div class="truncate font-semibold text-sm text-white select-text cursor-text"> </div> <!></div> <div class="flex shrink-0 items-center space-x-3.5"><button title="Pin to top"><!></button> <!> <div class="ml-2 flex items-center"><!></div></div></div>`),Dl=W(`<div class="flex h-full flex-col"><div class="mb-4 flex items-center justify-between"><div class="flex space-x-1.5"><button>Items</button> <button>Weapons</button> <button>Armors</button></div> <input type="text" placeholder="Search..." class="border-border bg-bg focus:border-accent flex-1 min-w-0 ml-3 rounded border px-3 py-1.5 text-sm transition-colors focus:outline-none"/></div> <div class="border-border bg-bg relative flex-1 overflow-hidden rounded-lg border"><!></div></div>`);function Ol(e,t){Mt(t,!0);let n=P(I([])),r=P(I([])),i=P(``),a=P(void 0);Mi(()=>{if(Q.targetItemKey!==null&&H(a)){let[e,t]=Q.targetItemKey.split(`:`);if(e===H(o)){if(H(r).length>0){let e=H(r).findIndex(e=>e.id===parseInt(t,10));e!==-1&&H(a).scrollToIndex(e),Q.targetItemKey=null}}else p(e)}});let o=P(I(Fc.Item)),s,c=P(!1),l=new Set,u=()=>{if(!H(i).trim())l=new Set(H(n).map(e=>e.id));else{let e=H(i).trim().toLowerCase(),t=H(n).filter(t=>String(t.id)===e||t.name.toLowerCase().includes(e)||String(t.count).includes(e)||t.description&&t.description.toLowerCase().includes(e));l=new Set(t.map(e=>e.id))}},d=()=>{let e=H(o)===Fc.Item?`items`:H(o)===Fc.Weapon?`weapons`:`armors`;F(r,H(n).filter(e=>l.has(e.id)).sort((t,n)=>{let r=Zc.isFavorite(e,t.id),i=Zc.isFavorite(e,n.id);return r&&!i?-1:!r&&i?1:t.id-n.id}),!0)},f=()=>{F(n,q.inv.list(H(o)),!0),u(),d()},p=e=>{F(o,e,!0),f(),H(a)&&H(a).resetScroll()},h=e=>{F(i,e.target.value,!0),clearTimeout(s),s=setTimeout(()=>{u(),d()},300)};Ws(()=>{f();let e=setInterval(()=>{H(c)||(F(n,q.inv.list(H(o)),!0),d())},1e3);return()=>clearInterval(e)});let g=(e,t)=>{q.inv.setCount(H(o),e,t),Y.items.has(`${H(o)}:${e}`)&&X.freezeItem(H(o),e,!0)};var _=Dl(),v=L(_),y=L(v),b=L(y),x=R(b,2),S=R(x,2);D(y);var ee=R(y,2);us(ee),D(v);var C=R(v,2);Ps(ul(L(C),{get items(){return H(r)},itemHeight:48,itemTemplate:(e,t=m)=>{var r=El(),i=L(r),a=L(i,!0);D(i);var s=R(i,2),l=L(s),u=L(l,!0);D(l);var f=R(l,2),p=e=>{var n=Tl(),r=L(n,!0);D(n),z((e,t)=>{ps(n,`title`,e),K(r,t)},[()=>t().description.replace(/\n/g,` `),()=>t().description.replace(/\n/g,` `)]),G(e,n)};mo(f,e=>{t().description&&e(p)}),D(s);var h=R(s,2),_=L(h),v=L(_);{let e=Wn(()=>Zc.isFavorite(H(o)===Fc.Item?`items`:H(o)===Fc.Weapon?`weapons`:`armors`,t().id)?`fill-current`:``);bc(v,{size:16,get class(){return H(e)}})}D(_);var y=R(_,2);{let e=Wn(()=>q.inv.maxStack(H(o),t().id));fl(y,{get value(){return t().count},min:0,get max(){return H(e)},onchange:e=>g(t().id,e)})}var b=R(y,2),x=L(b);{let e=Wn(()=>Y.items.has(`${H(o)}:${t().id}`));ml(x,{get locked(){return H(e)},ontoggle:e=>{X.freezeItem(H(o),t().id,e),F(n,[...H(n)],!0),d()}})}D(b),D(h),D(r),z((e,n,i)=>{Jo(r,1,`border-border/50 hover:bg-border/30 flex h-full items-center border-b px-4 transition-colors ${e==null?``:e}`),K(a,n),ps(l,`title`,t().name),K(u,t().name),Jo(_,1,`mr-1 flex items-center justify-center transition-colors ${i==null?``:i}`)},[()=>Y.items.has(`${H(o)}:${t().id}`)?`border-l-frozen border-l-4 pl-3`:``,()=>t().id.toString().padStart(4,`0`),()=>Zc.isFavorite(H(o)===Fc.Item?`items`:H(o)===Fc.Weapon?`weapons`:`armors`,t().id)?`text-yellow-400 hover:text-yellow-300`:`text-gray-600 hover:text-gray-400`]),U(`focusin`,h,()=>F(c,!0)),U(`focusout`,h,()=>F(c,!1)),U(`click`,_,()=>{let e=H(o)===Fc.Item?`items`:H(o)===Fc.Weapon?`weapons`:`armors`;Zc.toggleFavorite(e,t().id),d()}),G(e,r)},$$slots:{itemTemplate:!0}}),e=>F(a,e,!0),()=>H(a)),D(C),D(_),z(()=>{Jo(b,1,`rounded px-3 py-1.5 text-sm font-semibold transition-colors ${H(o)===Fc.Item?`bg-accent text-white`:`bg-border hover:bg-border/80 text-gray-300`}`),Jo(x,1,`rounded px-3 py-1.5 text-sm font-semibold transition-colors ${H(o)===Fc.Weapon?`bg-accent text-white`:`bg-border hover:bg-border/80 text-gray-300`}`),Jo(S,1,`rounded px-3 py-1.5 text-sm font-semibold transition-colors ${H(o)===Fc.Armor?`bg-accent text-white`:`bg-border hover:bg-border/80 text-gray-300`}`),ds(ee,H(i))}),U(`click`,b,()=>p(Fc.Item)),U(`click`,x,()=>p(Fc.Weapon)),U(`click`,S,()=>p(Fc.Armor)),U(`input`,ee,h),G(e,_),Nt()}Wa([`click`,`input`,`focusin`,`focusout`]);var kl=W(`<span class="bg-ok h-2 w-2 rounded-full shrink-0" title="In Party"></span>`),Al=W(`<button><div class="flex items-center space-x-2 truncate"><!> <span class="truncate select-text cursor-text"> </span></div> <span class="text-xs text-gray-500 font-mono select-text cursor-text"> </span></button>`),jl=W(`<div class="flex items-center justify-between text-sm"><span class="text-sm text-gray-300 font-medium"> </span> <div class="flex items-center space-x-2"><!> <!></div></div>`),Ml=W(`<div class="flex items-center justify-between px-4 py-2 hover:bg-border/30"><span class="text-sm text-gray-300 font-medium"> </span> <button> </button></div>`),Nl=W(`<div class="p-3 text-center text-sm text-gray-500">No skills in database.</div>`),Pl=W(`<button class="rounded bg-danger/20 px-2 py-1 text-xs font-semibold text-danger hover:bg-danger/30 transition-colors">Clear All States</button>`),Fl=W(`<div class="flex items-center space-x-1 rounded-full bg-border/50 px-3 py-1 text-sm text-white"><span> </span> <button class="hover:text-danger ml-1 font-bold text-gray-400 transition-colors" title="Remove State">&times;</button></div>`),Il=W(`<span class="text-sm text-gray-500">No active states.</span>`),Ll=W(`<option> </option>`),Rl=W(`<div class="mb-4 flex items-center justify-between border-b border-border pb-2"><div><h2 class="text-lg font-bold text-white leading-tight select-text cursor-text"> </h2> <p class="text-xs text-gray-400 select-text cursor-text"> </p></div> <div class="flex space-x-2"><button class="bg-border hover:bg-border/80 rounded px-3 py-1.5 text-xs font-semibold text-white transition-colors">Recover All</button> <button> </button></div></div> <div class="grid grid-cols-[repeat(auto-fit,minmax(260px,1fr))] gap-4"><div class="border-border bg-bg2 rounded-lg border p-4 space-y-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Core Status</h3> <div class="flex items-center justify-between text-sm" id="stat-level"><span class="text-sm text-gray-300 font-medium">Level</span> <div class="flex items-center space-x-2"><!> <!></div></div> <div class="flex items-center justify-between text-sm" id="stat-exp"><span class="text-sm text-gray-300 font-medium">EXP</span> <div class="flex items-center space-x-2"><!> <!></div></div> <div class="flex items-center justify-between text-sm" id="stat-hp"><span class="text-sm text-gray-300 font-medium">HP</span> <div class="flex items-center space-x-2"><!> <!></div></div> <div class="flex items-center justify-between text-sm" id="stat-mp"><span class="text-sm text-gray-300 font-medium">MP</span> <div class="flex items-center space-x-2"><!> <!></div></div> <div class="flex items-center justify-between text-sm" id="stat-tp"><span class="text-sm text-gray-300 font-medium">TP</span> <div class="flex items-center space-x-2"><!> <!></div></div></div> <div class="border-border bg-bg2 rounded-lg border p-4 space-y-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Parameters</h3> <!></div></div> <div class="border-border bg-bg2 mt-4 rounded-lg border p-4"><div class="mb-2.5 flex items-center justify-between border-b border-border/50 pb-1.5"><h3 class="text-[#7ba4ff] text-sm font-bold uppercase tracking-wider">Skills</h3> <input type="text" placeholder="Filter..." class="border-border bg-bg h-7 w-40 rounded border px-2 text-xs focus:outline-none"/></div> <div class="max-h-48 overflow-y-auto rounded border border-border divide-y divide-border bg-bg"></div></div> <div class="border-border bg-bg2 mt-4 rounded-lg border p-4"><div class="mb-2.5 flex items-center justify-between border-b border-border/50 pb-1.5"><h3 class="text-[#7ba4ff] text-sm font-bold uppercase tracking-wider">States</h3> <div class="flex items-center space-x-2"><input type="text" placeholder="Filter..." class="border-border bg-bg h-7 w-40 rounded border px-2 text-xs focus:outline-none"/> <!></div></div> <div class="mb-3 flex flex-wrap gap-2"></div> <div class="flex items-center space-x-2"><select class="border-border bg-bg min-w-0 flex-1 rounded border px-3 h-8 text-sm focus:outline-none"><option disabled="" selected="">Select a state to apply...</option><!></select> <button class="bg-accent hover:bg-accent/80 rounded px-4 h-8 flex items-center justify-center text-sm font-semibold text-white transition-colors disabled:opacity-50">Add State</button></div></div>`,1),zl=W(`<div class="flex h-full items-center justify-center text-sm text-gray-500">Start a game or select an actor to edit stats.</div>`),Bl=W(`<div class="flex h-full min-h-0 w-full overflow-hidden"><div class="border-border flex w-48 shrink-0 flex-col border-r pr-2"><div class="mb-2 text-xs font-bold text-gray-500 uppercase tracking-wider">Actors</div> <div class="flex-1 overflow-y-auto space-y-1 pr-1"></div></div> <div class="flex-1 overflow-y-auto pl-4 pr-1"><!></div></div>`);function Vl(e,t){Mt(t,!0);let n=P(I([])),r=P(null),i=P(null),a=P(null),o=P(``),s=P(``);Mi(()=>{Q.targetActorId!==null&&H(n).length>0&&(F(r,Q.targetActorId,!0),Q.targetActorId=null,Q.targetActorStat=null,c())});let c=()=>{F(n,J.list(),!0),H(r)===null&&H(n).length>0&&F(r,H(n)[0].id,!0),H(r)!==null&&F(i,J.get(H(r)),!0)};Ws(()=>{c();let e=setInterval(()=>{c()},1e3);return()=>clearInterval(e)});let l=e=>{F(r,e,!0),F(i,J.get(e),!0)},u=(e,t)=>{H(r)!==null&&(e===`hp`?J.setHp(H(r),t):e===`mp`?J.setMp(H(r),t):e===`tp`&&J.setTp(H(r),t),Y.stats.has(`${H(r)}:${e}`)&&X.freezeStat(H(r),e,!0),F(i,J.get(H(r)),!0))},d=(e,t)=>{H(r)!==null&&(J.setParam(H(r),e,t),F(i,J.get(H(r)),!0))},f=()=>{H(r)===null||!H(i)||(H(i).inParty?J.removeFromParty(H(r)):J.addToParty(H(r)),c())},p=(e,t)=>{H(r)!==null&&(t?J.forgetSkill(H(r),e):J.learnSkill(H(r),e),F(i,J.get(H(r)),!0))},m={[Lc.MHP]:`Max HP`,[Lc.MMP]:`Max MP`,[Lc.ATK]:`Attack`,[Lc.DEF]:`Defense`,[Lc.MAT]:`M. Attack`,[Lc.MDF]:`M. Defense`,[Lc.AGI]:`Agility`,[Lc.LUK]:`Luck`};var h=Bl(),g=L(h),_=R(L(g),2);yo(_,21,()=>H(n),ho,(e,t)=>{var n=Al(),i=L(n),a=L(i),o=e=>{G(e,kl())};mo(a,e=>{H(t).inParty&&e(o)});var s=R(a,2),c=L(s,!0);D(s),D(i);var u=R(i,2),d=L(u);D(u),D(n),z(()=>{var e;ps(n,`id`,`actor-btn-${H(t).id}`),Jo(n,1,`flex w-full items-center justify-between rounded px-2.5 py-2 text-left text-sm transition-colors ${H(r)===H(t).id?`bg-accent text-white font-semibold`:`hover:bg-border/50 text-gray-300`}`),K(c,H(t).name),K(d,`Lv.${(e=H(t).level)==null?``:e}`)}),U(`click`,n,()=>l(H(t).id)),G(e,n)}),D(_),D(g);var v=R(g,2),y=L(v),b=e=>{var t,n=Rl(),l=_i(n),h=L(l),g=L(h),_=L(g,!0);D(g);var v=R(g,2),y=L(v);D(v),D(h);var b=R(h,2),x=L(b),S=R(x,2),ee=L(S,!0);D(S),D(b),D(l);var C=R(l,2),w=L(C),te=R(L(w),2),ne=R(L(te),2),re=L(ne);fl(re,{get value(){return H(i).level},min:1,max:99,onchange:e=>{H(r)!==null&&(J.setLevel(H(r),e),Y.stats.has(`${H(r)}:level`)&&X.freezeStat(H(r),`level`,!0),F(i,J.get(H(r)),!0),c())}});var ie=R(re,2);{let e=Wn(()=>Y.stats.has(`${H(r)}:level`));ml(ie,{get locked(){return H(e)},ontoggle:e=>{H(r)!==null&&(X.freezeStat(H(r),`level`,e),F(i,J.get(H(r)),!0))}})}D(ne),D(te);var ae=R(te,2),oe=R(L(ae),2),se=L(oe);fl(se,{get value(){return H(i).exp},min:0,onchange:e=>{H(r)!==null&&(J.setExp(H(r),e),Y.stats.has(`${H(r)}:exp`)&&X.freezeStat(H(r),`exp`,!0),F(i,J.get(H(r)),!0),c())}});var ce=R(se,2);{let e=Wn(()=>Y.stats.has(`${H(r)}:exp`));ml(ce,{get locked(){return H(e)},ontoggle:e=>{H(r)!==null&&(X.freezeStat(H(r),`exp`,e),F(i,J.get(H(r)),!0))}})}D(oe),D(ae);var le=R(ae,2),ue=R(L(le),2),de=L(ue);fl(de,{get value(){return H(i).hp},min:0,get max(){return H(i).mhp},onchange:e=>u(`hp`,e)});var fe=R(de,2);{let e=Wn(()=>Y.stats.has(`${H(r)}:hp`));ml(fe,{get locked(){return H(e)},ontoggle:e=>{H(r)!==null&&(X.freezeStat(H(r),`hp`,e),F(i,J.get(H(r)),!0))}})}D(ue),D(le);var pe=R(le,2),me=R(L(pe),2),he=L(me);fl(he,{get value(){return H(i).mp},min:0,get max(){return H(i).mmp},onchange:e=>u(`mp`,e)});var ge=R(he,2);{let e=Wn(()=>Y.stats.has(`${H(r)}:mp`));ml(ge,{get locked(){return H(e)},ontoggle:e=>{H(r)!==null&&(X.freezeStat(H(r),`mp`,e),F(i,J.get(H(r)),!0))}})}D(me),D(pe);var _e=R(pe,2),ve=R(L(_e),2),ye=L(ve);fl(ye,{get value(){return H(i).tp},min:0,get max(){return H(i).mtp},onchange:e=>u(`tp`,e)});var be=R(ye,2);{let e=Wn(()=>Y.stats.has(`${H(r)}:tp`));ml(be,{get locked(){return H(e)},ontoggle:e=>{H(r)!==null&&(X.freezeStat(H(r),`tp`,e),F(i,J.get(H(r)),!0))}})}D(ve),D(_e),D(w);var xe=R(w,2);yo(R(L(xe),2),17,()=>H(i).params,e=>e.id,(e,t)=>{var n=jl(),a=L(n),o=L(a,!0);D(a);var s=R(a,2),c=L(s);fl(c,{get value(){return H(t).value},min:1,onchange:e=>{d(H(t).id,e),Y.stats.has(`${H(r)}:param_${H(t).id}`)&&X.freezeStat(H(r),`param_${H(t).id}`,!0)}});var l=R(c,2);{let e=Wn(()=>Y.stats.has(`${H(r)}:param_${H(t).id}`));ml(l,{get locked(){return H(e)},ontoggle:e=>{H(r)!==null&&(X.freezeStat(H(r),`param_${H(t).id}`,e),F(i,J.get(H(r)),!0))}})}D(s),D(n),z(()=>{ps(n,`id`,`stat-param_${H(t).id}`),K(o,m[H(t).id]||`Stat`)}),G(e,n)}),D(xe),D(C);var Se=R(C,2),Ce=L(Se),we=R(L(Ce),2);us(we),D(Ce);var Te=R(Ce,2);yo(Te,21,()=>H(i).skills.filter(e=>!H(o).trim()||e.name.toLowerCase().includes(H(o).trim().toLowerCase())||e.id.toString().includes(H(o).trim())),e=>e.id,(e,t)=>{var n=Ml(),r=L(n),i=L(r);D(r);var a=R(r,2),o=L(a,!0);D(a),D(n),z(e=>{var n;K(i,`${e==null?``:e}: ${(n=H(t).name)==null?``:n}`),Jo(a,1,`rounded border px-3 py-1 text-xs font-semibold transition-colors ${H(t).learned?`border-danger/30 text-danger bg-danger/10 hover:bg-danger/20`:`border-accent/30 text-accent bg-accent/10 hover:bg-accent/20`}`),K(o,H(t).learned?`Forget`:`Learn`)},[()=>H(t).id.toString().padStart(3,`0`)]),U(`click`,a,()=>p(H(t).id,H(t).learned)),G(e,n)},e=>{G(e,Nl())}),D(Te),D(Se);var Ee=R(Se,2),De=L(Ee),Oe=R(L(De),2),ke=L(Oe);us(ke);var Ae=R(ke,2),je=e=>{var t=Pl();U(`click`,t,()=>{H(r)!==null&&(J.clearStates(H(r)),F(i,J.get(H(r)),!0))}),G(e,t)};mo(Ae,e=>{H(i).states.length>0&&e(je)}),D(Oe),D(De);var Me=R(De,2);yo(Me,21,()=>H(i).states,ho,(e,t)=>{var n=Fl(),a=L(n),o=L(a,!0);D(a);var s=R(a,2);D(n),z(()=>K(o,H(t).name)),U(`click`,s,()=>{H(r)!==null&&(J.removeState(H(r),H(t).id),F(i,J.get(H(r)),!0))}),G(e,n)},e=>{G(e,Il())}),D(Me);var Ne=R(Me,2),Pe=L(Ne),Fe=L(Pe);Fe.value=(t=Fe.__value=null)!=null&&t!==void 0?t:``,yo(R(Fe),17,()=>J.listStates().filter(e=>!H(s).trim()||e.name.toLowerCase().includes(H(s).trim().toLowerCase())||e.id.toString().includes(H(s).trim())),ho,(e,t)=>{var n=Ll(),r=L(n);D(n);var i={};z(e=>{var a;if(K(r,`${e==null?``:e}: ${(a=H(t).name)==null?``:a}`),i!==(i=H(t).id)){var o;n.value=(o=n.__value=H(t).id)==null?``:o}},[()=>H(t).id.toString().padStart(3,`0`)]),G(e,n)}),D(Pe);var Ie=R(Pe,2);D(Ne),D(Ee),z(()=>{var e;K(_,H(i).name),K(y,`Actor ID: ${(e=H(i).id)==null?``:e}`),Jo(S,1,`rounded border px-3 py-1.5 text-xs font-semibold transition-colors ${H(i).inParty?`border-danger/30 bg-danger/20 text-danger hover:bg-danger/30`:`border-ok/30 bg-ok/20 text-ok hover:bg-ok/30`}`),K(ee,H(i).inParty?`Remove Party`:`Add Party`),Ie.disabled=H(a)===null}),U(`click`,x,()=>{H(r)!==null&&(J.recover(H(r)),F(i,J.get(H(r)),!0))}),U(`click`,S,f),Cs(we,()=>H(o),e=>F(o,e)),Cs(ke,()=>H(s),e=>F(s,e)),$o(Pe,()=>H(a),e=>F(a,e)),U(`click`,Ie,()=>{H(r)!==null&&H(a)!==null&&(J.addState(H(r),H(a)),F(i,J.get(H(r)),!0),F(a,null))}),G(e,n)},x=e=>{G(e,zl())};mo(y,e=>{H(i)?e(b):e(x,-1)}),D(v),D(h),G(e,h),Nt()}Wa([`click`]);function Hl(e){let t=e-1;return t*t*t+1}function Ul(e,{from:t,to:n},r={}){var{delay:i=0,duration:a=e=>Math.sqrt(e)*120,easing:o=Hl}=r,s=getComputedStyle(e),c=s.transform===`none`?``:s.transform,[l,u]=s.transformOrigin.split(` `).map(parseFloat);l/=e.clientWidth,u/=e.clientHeight;var d=Wl(e),f=e.clientWidth/n.width/d,p=e.clientHeight/n.height/d,m=t.left+t.width*l,h=t.top+t.height*u,g=n.left+n.width*l,_=n.top+n.height*u,v=(m-g)*f,y=(h-_)*p,b=t.width/n.width,x=t.height/n.height;return{delay:i,duration:typeof a==`function`?a(Math.sqrt(v*v+y*y)):a,easing:o,css:(e,t)=>`transform: ${c} translate(${t*v}px, ${t*y}px) scale(${e+t*b}, ${e+t*x});`}}function Wl(e){if(`currentCSSZoom`in e)return e.currentCSSZoom;for(var t=e,n=1;t!==null;)n*=+getComputedStyle(t).zoom,t=t.parentElement;return n}var Gl=W(`<span class="text-[9px] text-gray-500 font-mono bg-bg2 px-1 rounded opacity-50 group-hover:opacity-100 transition-opacity whitespace-nowrap ml-1"> </span>`),Kl=W(`<button class="bg-bg hover:bg-border/50 border-border text-gray-300 rounded border py-1.5 px-2 text-xs font-semibold transition-colors text-left flex justify-between items-center group"><span class="truncate"> </span> <!></button>`),ql=W(`<div><h4 class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2"> </h4> <div class="grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))] gap-2"></div></div>`),Jl=W(`<div class="text-[10px] text-gray-500">Configure the hold key in the Keys panel.</div>`),Yl=W(`<div class="text-orange-400 text-[10px]">Warning: Game is permanently sped up. Turn this back on to require holding a key.</div>`),Xl=W(`<button> </button>`),Zl=W(`<div class="border-border bg-bg rounded border p-2.5 space-y-2"><div class="flex items-center justify-between text-xs font-bold text-white"><span> </span></div> <div class="grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] gap-2 text-xs"><div class="flex flex-col space-y-1"><span class="text-gray-400 font-medium uppercase tracking-wider text-[10px]"> </span> <!></div> <div class="flex flex-col space-y-1"><span class="text-gray-400 font-medium uppercase tracking-wider text-[10px]"> </span> <!></div> <div class="flex flex-col space-y-1"><span class="text-gray-400 font-medium uppercase tracking-wider text-[10px]"> </span> <!></div></div></div>`),Ql=W(`<div class="border-border bg-bg2 rounded-lg border p-3"><h3 class="border-border/50 text-danger mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Active Enemies</h3> <div class="space-y-3"></div></div>`),$l=W(`<span class="border-accent bg-accent/20 text-accent ml-2 rounded border px-1.5 py-0.5 text-[9px] font-black tracking-widest leading-none relative top-[-0.5px]">LEAD</span>`),eu=W(`<div role="listitem"><div><button type="button" title="Drag to reorder party" draggable="true"><span class="flex items-center space-x-2"><span class="text-gray-500">⋮⋮</span> <span class="flex items-center"> <!></span></span> <span class="text-[10px] text-gray-500 font-mono"> </span></button> <div class="grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] gap-2 text-xs"><div class="flex flex-col space-y-1"><span class="text-gray-400 font-medium uppercase tracking-wider text-[10px]"> </span> <!></div> <div class="flex flex-col space-y-1"><span class="text-gray-400 font-medium uppercase tracking-wider text-[10px]"> </span> <!></div> <div class="flex flex-col space-y-1"><span class="text-gray-400 font-medium uppercase tracking-wider text-[10px]"> </span> <!></div></div></div></div>`),tu=W(`<div class="py-3 text-center text-xs text-gray-500">No active party members found (start/load a game).</div>`),nu=W(`<div class="h-full space-y-3 overflow-y-auto pr-1"><div class="border-border bg-bg2 rounded-lg border p-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Quick Actions</h3> <div class="space-y-4"></div></div> <div class="grid grid-cols-[repeat(auto-fit,minmax(300px,1fr))] gap-3"><div class="border-border bg-bg2 rounded-lg border p-3 space-y-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Party Resources</h3> <div class="flex items-center justify-between text-xs"><span class="text-gray-300">Gold</span> <div class="flex items-center space-x-1.5"><!> <!></div></div> <div class="flex items-center justify-between text-xs"><span class="text-gray-300">Steps</span> <span class="bg-bg text-text-dim rounded border border-border px-2 py-0.5 font-mono text-xs font-semibold select-text cursor-text"> </span></div> <div class="flex items-center justify-between text-xs"><span class="text-gray-300">Playtime</span> <span class="bg-bg text-text-dim rounded border border-border px-2 py-0.5 font-mono text-xs font-semibold select-text cursor-text"> </span></div></div> <div class="border-border bg-bg2 rounded-lg border p-3 space-y-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Battle Settings</h3> <div class="space-y-2"><div class="flex items-center justify-between text-xs"><span class="text-gray-300">God Mode</span> <!></div> <div class="flex items-center justify-between text-xs"><span class="text-gray-300">One-Hit Kill</span> <!></div> <div class="flex items-center justify-between text-xs"><span class="text-gray-300">Disable Encounters</span> <!></div></div></div></div> <div class="border-border bg-bg2 rounded-lg border p-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Movement</h3> <div class="space-y-4 pt-1"><div class="flex items-center justify-between text-xs"><span class="text-gray-300 font-medium">Noclip (Walk Through Walls)</span> <!></div> <div class="flex items-center justify-between text-xs"><span class="text-gray-300 font-medium">Move Speed</span> <!></div></div></div> <div class="border-border bg-bg2 rounded-lg border p-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Game Speed</h3> <div class="space-y-3"><div class="space-y-1"><div class="flex items-center justify-between text-xs"><span class="font-medium text-gray-300">Hold Key to Fast Forward</span> <!></div> <!></div> <div class="flex items-center justify-between text-xs"><span class="font-medium text-gray-300">Speed Multiplier</span> <div class="flex items-center space-x-1.5"></div></div></div></div> <!> <div class="border-border bg-bg2 rounded-lg border p-3" role="presentation"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Party Members Status</h3> <div class="space-y-3" role="list"></div></div></div>`);function ru(e,t){Mt(t,!0);let n=P(0),r=P(0),i=P(0),a=P(4),o=P(!1),s=P(I([])),c=P(I([])),l=[{title:`System & Menus`,actions:[`quick_save`,`quick_load`,`open_save_scene`,`open_load_scene`,`goto_title`]},{title:`Battle Actions`,actions:[`force_victory`,`force_defeat`,`force_escape`,`trigger_encounter`]},{title:`Health Controls`,actions:[`party_recovery`,`party_wound`,`enemy_recovery`,`enemy_wound`]}],u=()=>{F(n,q.gold.get(),!0),F(r,q.party.steps(),!0),F(i,q.party.playtime(),!0),window.$gamePlayer&&F(a,window.$gamePlayer._moveSpeed||4,!0),F(o,!!(window.SceneManager&&window.SceneManager._scene&&window.SceneManager._scene.constructor.name===`Scene_Battle`)),H(o)&&window.$gameTroop?F(s,window.$gameTroop.members().map(e=>({ref:e,name:e.name(),hp:e.hp,mhp:e.mhp,mp:e.mp,mmp:e.mmp,tp:e.tp,maxTp:e.maxTp()})),!0):F(s,[],!0),window.$gameParty?F(c,window.$gameParty.members().map(e=>({ref:e,id:e.actorId(),name:e.name(),level:typeof e.level==`function`?e.level():e._level||1,hp:e.hp,mhp:e.mhp,mp:e.mp,mmp:e.mmp,tp:e.tp,maxTp:e.maxTp()})),!0):F(c,[],!0)};Ws(()=>{u();let e=setInterval(u,1e3);return()=>clearInterval(e)});let d=e=>{q.gold.set(e),Y.gold!==null&&X.freezeGold(!0),F(n,q.gold.get(),!0)},f=e=>{let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return`${t.toString().padStart(2,`0`)}:${n.toString().padStart(2,`0`)}:${r.toString().padStart(2,`0`)}`},p=(e,t)=>{e.ref.setHp(t),u()},m=(e,t)=>{e.ref.setMp(t),u()},h=(e,t)=>{e.ref.setTp?e.ref.setTp(t):e.ref.tp=t,u()},g=P(null),_=(e,t)=>{e!==t&&window.$gameParty&&typeof window.$gameParty.swapOrder==`function`&&(window.$gameParty.swapOrder(e,t),u())};var v=nu(),y=L(v),b=R(L(y),2);yo(b,21,()=>l,ho,(e,t)=>{var n=ql(),r=L(n),i=L(r,!0);D(r);var a=R(r,2);yo(a,21,()=>H(t).actions,ho,(e,t)=>{let n=Wn(()=>nl.find(e=>e.id===H(t)));var r=eo(),i=_i(r),a=e=>{var t=Kl(),r=L(t),i=L(r,!0);D(r);var a=R(r,2),o=e=>{var t=Gl(),r=L(t,!0);D(t),z(e=>K(r,e),[()=>{var e;return Yc.fromString(((e=$.get(H(n).id))==null?void 0:e.keyStr)||``).asDisplayString()}]),G(e,t)},s=Wn(()=>{var e;return(e=$.get(H(n).id))==null?void 0:e.keyStr});mo(a,e=>{H(s)&&e(o)}),D(t),z(()=>K(i,H(n).name)),U(`click`,t,()=>{var e,t;(e=(t=H(n)).onEnter)==null||e.call(t),u()}),G(e,t)};mo(i,e=>{H(n)&&e(a)}),G(e,r)}),D(a),D(n),z(()=>K(i,H(t).title)),G(e,n)}),D(b),D(y);var x=R(y,2),S=L(x),ee=R(L(S),2),C=R(L(ee),2),w=L(C);fl(w,{get value(){return H(n)},min:0,max:99999999,onchange:d});var te=R(w,2);{let e=Wn(()=>Y.gold!==null);ml(te,{get locked(){return H(e)},ontoggle:e=>{X.freezeGold(e),u()}})}D(C),D(ee);var ne=R(ee,2),re=R(L(ne),2),ie=L(re,!0);D(re),D(ne);var ae=R(ne,2),oe=R(L(ae),2),se=L(oe,!0);D(oe),D(ae),D(S);var ce=R(S,2),le=R(L(ce),2),ue=L(le);xl(R(L(ue),2),{get value(){return Z.god},onchange:e=>Wc.setGod(e)}),D(ue);var de=R(ue,2);xl(R(L(de),2),{get value(){return Z.ohko},onchange:e=>Wc.setOhko(e)}),D(de);var fe=R(de,2);xl(R(L(fe),2),{get value(){return Z.noEncounter},onchange:e=>Wc.setNoEncounter(e)}),D(fe),D(le),D(ce),D(x);var pe=R(x,2),me=R(L(pe),2),he=L(me);xl(R(L(he),2),{get value(){return Y.noclip},onchange:e=>X.setNoclip(e)}),D(he);var ge=R(he,2);fl(R(L(ge),2),{get value(){return H(a)},min:1,max:8,onchange:e=>q.map.speed(e)}),D(ge),D(me),D(pe);var _e=R(pe,2),ve=R(L(_e),2),ye=L(ve),be=L(ye);xl(R(L(be),2),{get value(){return Z.speedUseKey},onchange:e=>{Wc.setSpeedUseKey(e),e?Wc.setSpeed(1):Wc.setSpeed(Z.speedBoost)}}),D(be);var xe=R(be,2),Se=e=>{G(e,Jl())},Ce=e=>{G(e,Yl())};mo(xe,e=>{Z.speedUseKey?e(Se):e(Ce,-1)}),D(ye);var we=R(ye,2),Te=R(L(we),2);yo(Te,20,()=>[.5,1,2,3,5,8],ho,(e,t)=>{var n=Xl(),r=L(n);D(n),z(()=>{Jo(n,1,`border-border h-7 w-9 rounded border text-xs transition-colors ${Z.speedBoost===t?`border-accent bg-accent text-white font-semibold`:`bg-bg hover:bg-border/50 text-gray-300`}`),K(r,`${t==null?``:t}x`)}),U(`click`,n,()=>{Wc.setSpeedBoost(t),Z.speedUseKey||Wc.setSpeed(t)}),G(e,n)}),D(Te),D(we),D(ve),D(_e);var Ee=R(_e,2),De=e=>{var t=Ql(),n=R(L(t),2);yo(n,21,()=>H(s),ho,(e,t)=>{var n=Zl(),r=L(n),i=L(r),a=L(i,!0);D(i),D(r);var o=R(r,2),s=L(o),c=L(s),l=L(c);D(c),fl(R(c,2),{get value(){return H(t).hp},min:0,get max(){return H(t).mhp},onchange:e=>p(H(t),e)}),D(s);var u=R(s,2),d=L(u),f=L(d);D(d),fl(R(d,2),{get value(){return H(t).mp},min:0,get max(){return H(t).mmp},onchange:e=>m(H(t),e)}),D(u);var g=R(u,2),_=L(g),v=L(_);D(_),fl(R(_,2),{get value(){return H(t).tp},min:0,get max(){return H(t).maxTp},onchange:e=>h(H(t),e)}),D(g),D(o),D(n),z(()=>{var e,n,r,i,o;K(a,H(t).name),K(l,`HP (${(e=H(t).hp)==null?``:e}/${(n=H(t).mhp)==null?``:n})`),K(f,`MP (${(r=H(t).mp)==null?``:r}/${(i=H(t).mmp)==null?``:i})`),K(v,`TP (${(o=H(t).tp)==null?``:o})`)}),G(e,n)}),D(n),D(t),G(e,t)};mo(Ee,e=>{H(o)&&H(s).length>0&&e(De)});var Oe=R(Ee,2),ke=R(L(Oe),2);yo(ke,31,()=>H(c),e=>e.id,(e,t,n)=>{var r=eu(),i=L(r),a=L(i),o=L(a),s=R(L(o),2),c=L(s),l=R(c),u=e=>{G(e,$l())};mo(l,e=>{H(n)===0&&e(u)}),D(s),D(o);var d=R(o,2),f=L(d);D(d),D(a);var v=R(a,2),y=L(v),b=L(y),x=L(b);D(b),fl(R(b,2),{get value(){return H(t).hp},min:0,get max(){return H(t).mhp},onchange:e=>p(H(t),e)}),D(y);var S=R(y,2),ee=L(S),C=L(ee);D(ee),fl(R(ee,2),{get value(){return H(t).mp},min:0,get max(){return H(t).mmp},onchange:e=>m(H(t),e)}),D(S);var w=R(S,2),te=L(w),ne=L(te);D(te),fl(R(te,2),{get value(){return H(t).tp},min:0,get max(){return H(t).maxTp},onchange:e=>h(H(t),e)}),D(w),D(v),D(i),D(r),z(()=>{var e,o,s,l,u,d,p;Jo(r,1,`rounded p-2.5 transition-all duration-200 ${H(g)===H(n)?`border border-dashed border-accent/50 bg-accent/5`:`border border-border bg-bg`}`),Jo(i,1,`space-y-2 ${H(g)===H(n)?`invisible`:``}`),Jo(a,1,`flex w-full items-center justify-between pb-2 text-xs font-bold text-white ${H(g)===null?`cursor-grab active:cursor-grabbing`:``}`),K(c,`${(e=H(t).name)==null?``:e} `),K(f,`Lv.${(o=H(t).level)==null?``:o}`),K(x,`HP (${(s=H(t).hp)==null?``:s}/${(l=H(t).mhp)==null?``:l})`),K(C,`MP (${(u=H(t).mp)==null?``:u}/${(d=H(t).mmp)==null?``:d})`),K(ne,`TP (${(p=H(t).tp)==null?``:p})`)}),Ua(`dragenter`,r,e=>e.preventDefault()),Ua(`dragover`,r,e=>{if(e.preventDefault(),H(g)!==null&&H(g)!==H(n)){let t=e.currentTarget.getBoundingClientRect(),r=t.top+t.height/2;if(H(g)<H(n)&&e.clientY<r||H(g)>H(n)&&e.clientY>r)return;_(H(g),H(n)),F(g,H(n),!0)}}),Ua(`dragstart`,a,e=>{if(e.dataTransfer){e.dataTransfer.effectAllowed=`move`;let t=e.currentTarget.closest(`[role="listitem"]`);t&&e.dataTransfer.setDragImage(t,20,20)}setTimeout(()=>{F(g,H(n),!0)},0)}),Ua(`dragend`,a,()=>{F(g,null)}),Io(r,()=>Ul,()=>({duration:250})),G(e,r)},e=>{G(e,tu())}),D(ke),D(Oe),D(v),z(e=>{K(ie,H(r)),K(se,e)},[()=>f(H(i))]),Ua(`dragenter`,Oe,e=>e.preventDefault()),Ua(`dragover`,Oe,e=>e.preventDefault()),Ua(`dragenter`,ke,e=>e.preventDefault()),Ua(`dragover`,ke,e=>e.preventDefault()),G(e,v),Nt()}Wa([`click`]);var iu=W(`<option> </option>`),au=W(`<div class="p-4 text-center text-sm text-gray-500">No saved locations yet.</div>`),ou=W(`<div class="border-border/50 hover:bg-border/30 flex items-center justify-between border-b p-3"><div><div class="font-semibold text-sm text-white"> </div> <div class="text-xs text-gray-500"> </div></div> <div class="flex space-x-2"><button class="border-accent/30 bg-accent/20 text-accent hover:bg-accent/30 rounded border px-3 py-1 text-sm font-medium transition-colors">Teleport</button> <button class="border-danger/30 bg-danger/20 text-danger hover:bg-danger/30 flex h-7 w-7 items-center justify-center rounded border transition-colors" title="Remove location" aria-label="Remove location"><!></button></div></div>`),su=W(`<div class="space-y-3 pr-1"><div class="border-border bg-bg2 rounded-lg border p-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Teleport</h3> <div class="mb-3 text-sm text-gray-400 font-medium select-text cursor-text"> </div> <div class="space-y-3"><div><div class="mb-1 flex items-center justify-between"><label for="target-map-select" class="block text-xs text-gray-400 font-medium uppercase tracking-wider">Target Map</label> <input type="text" placeholder="Filter..." class="border-border bg-bg h-7 w-40 rounded border px-2 text-xs focus:outline-none"/></div> <select id="target-map-select" class="border-border bg-bg w-full rounded border px-3 py-1.5 text-sm focus:outline-none"></select></div> <div><div class="mb-1 flex items-center justify-between"><label for="event-teleport-select" class="block text-xs text-gray-400 font-medium uppercase tracking-wider">Point of Interest (POI)</label> <input type="text" placeholder="Filter..." class="border-border bg-bg h-7 w-40 rounded border px-2 text-xs focus:outline-none"/></div> <select id="event-teleport-select" class="border-border bg-bg w-full rounded border px-3 py-1.5 text-sm focus:outline-none"><option disabled="">-- Select a POI --</option><!></select></div> <div class="flex space-x-2"><div class="flex-1"><label for="target-x-input" class="mb-1 block text-xs text-gray-400 font-medium uppercase tracking-wider">X</label> <input id="target-x-input" type="number" class="border-border bg-bg w-full rounded border px-3 py-1.5 text-sm focus:outline-none"/></div> <div class="flex-1"><label for="target-y-input" class="mb-1 block text-xs text-gray-400 font-medium uppercase tracking-wider">Y</label> <input id="target-y-input" type="number" class="border-border bg-bg w-full rounded border px-3 py-1.5 text-sm focus:outline-none"/></div></div> <button class="bg-accent hover:bg-accent/85 mt-2 w-full rounded py-2 text-sm font-semibold text-white transition-colors">Teleport Now</button></div></div> <div class="border-border bg-bg2 flex flex-col rounded-lg border p-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Saved Locations</h3> <div class="mb-4 flex space-x-2"><input type="text" placeholder="Name for current location..." class="border-border bg-bg flex-1 rounded border px-3 py-1.5 text-sm focus:outline-none"/> <button class="border-ok/30 bg-ok/20 text-ok hover:bg-ok/30 rounded border px-4 py-1.5 text-sm font-semibold transition-colors">Save Current</button></div> <div class="border-border bg-bg rounded border"><!></div></div></div>`);function cu(e,t){Mt(t,!0);let n=P(I({mapId:0,x:0,y:0,dir:0})),r=P(I([])),i=P(0),a=P(0),o=P(0),s=P(I([])),c=P(``),l=P(``),u=P(``);Mi(()=>{H(o)>0&&q.map.loadMapEvents(H(o)).then(e=>{F(s,e,!0),e.find(e=>e.id.toString()===H(c))||F(c,``)})});let d=P(I([])),f=P(``),p=()=>{let e=q.map.current();e&&(F(n,e,!0),F(o,H(o)||e.mapId,!0),F(i,e.x,!0),F(a,e.y,!0)),F(r,q.map.list(),!0);try{let e=localStorage.getItem(`forge:locations`);e&&F(d,JSON.parse(e),!0)}catch(e){}};Ws(()=>{p();let e=setInterval(()=>{let e=q.map.current();e&&(e.mapId!==H(n).mapId||e.x!==H(n).x||e.y!==H(n).y)&&F(n,e,!0)},1e3);return()=>clearInterval(e)});let m=()=>{q.map.teleport(H(o),H(i),H(a),0,0)},h=()=>{let e=q.map.current();if(!e)return;let t=H(r).find(t=>t.id===e.mapId);F(d,[...H(d),{id:Date.now().toString(),name:H(f)||`Saved Location`,mapId:e.mapId,mapName:t?t.name:`Map ${e.mapId}`,x:e.x,y:e.y}],!0),F(f,``),localStorage.setItem(`forge:locations`,JSON.stringify(H(d)))},g=e=>{F(d,H(d).filter(t=>t.id!==e),!0),localStorage.setItem(`forge:locations`,JSON.stringify(H(d)))},_=e=>{q.map.teleport(e.mapId,e.x,e.y,0,0)};var v=su(),y=L(v),b=R(L(y),2),x=L(b);D(b);var S=R(b,2),ee=L(S),C=L(ee),w=R(L(C),2);us(w),D(C);var te=R(C,2);yo(te,21,()=>H(r).filter(e=>!H(l).trim()||e.name.toLowerCase().includes(H(l).trim().toLowerCase())||e.id.toString().includes(H(l).trim())),ho,(e,t)=>{var r=iu(),i=L(r);D(r);var a={};z(e=>{var o;if(K(i,`${H(t).id===H(n).mapId?`[CURRENT] `:``}${e==null?``:e}: ${(o=H(t).name)==null?``:o}`),a!==(a=H(t).id)){var s;r.value=(s=r.__value=H(t).id)==null?``:s}},[()=>H(t).id.toString().padStart(3,`0`)]),G(e,r)}),D(te),D(ee);var ne=R(ee,2),re=L(ne),ie=R(L(re),2);us(ie),D(re);var ae=R(re,2),oe=L(ae);oe.value=oe.__value=``,yo(R(oe),17,()=>H(s).filter(e=>!H(u).trim()||e.name.toLowerCase().includes(H(u).trim().toLowerCase())||e.id.toString().includes(H(u).trim())),ho,(e,t)=>{var n=iu(),r=L(n);D(n);var i={};z(()=>{var e,a,o;if(K(r,`${(e=H(t).name)==null?``:e} (X:${(a=H(t).x)==null?``:a}, Y:${(o=H(t).y)==null?``:o})`),i!==(i=H(t).id)){var s;n.value=(s=n.__value=H(t).id)==null?``:s}}),G(e,n)}),D(ae),D(ne);var se=R(ne,2),ce=L(se),le=R(L(ce),2);us(le),D(ce);var ue=R(ce,2),de=R(L(ue),2);us(de),D(ue),D(se);var fe=R(se,2);D(S),D(y);var pe=R(y,2),me=R(L(pe),2),he=L(me);us(he);var ge=R(he,2);D(me);var _e=R(me,2),ve=L(_e),ye=e=>{G(e,au())},be=e=>{var t=eo();yo(_i(t),17,()=>H(d),e=>e.id,(e,t)=>{var n=ou(),r=L(n),i=L(r),a=L(i,!0);D(i);var o=R(i,2),s=L(o);D(o),D(r);var c=R(r,2),l=L(c),u=R(l,2);Ec(L(u),{size:14}),D(u),D(c),D(n),z(()=>{var e,n,r,i;K(a,H(t).name),K(s,`${(e=H(t).mapName)==null?``:e} (Map ${(n=H(t).mapId)==null?``:n}) • X:${(r=H(t).x)==null?``:r} Y:${(i=H(t).y)==null?``:i}`)}),U(`click`,l,()=>_(H(t))),U(`click`,u,()=>g(H(t).id)),G(e,n)}),G(e,t)};mo(ve,e=>{H(d).length===0?e(ye):e(be,-1)}),D(_e),D(pe),D(v),z(()=>{var e,t,r;return K(x,`Current: Map ${(e=H(n).mapId)==null?``:e} (${(t=H(n).x)==null?``:t}, ${(r=H(n).y)==null?``:r})`)}),Cs(w,()=>H(l),e=>F(l,e)),$o(te,()=>H(o),e=>F(o,e)),Cs(ie,()=>H(u),e=>F(u,e)),U(`change`,ae,e=>{let t=parseInt(e.target.value);if(isNaN(t))return;let n=H(s).find(e=>e.id===t);n&&(F(i,n.x,!0),F(a,n.y,!0))}),$o(ae,()=>H(c),e=>F(c,e)),Cs(le,()=>H(i),e=>F(i,e)),Cs(de,()=>H(a),e=>F(a,e)),U(`click`,fe,m),U(`keydown`,he,e=>{e.stopPropagation(),e.key===`Enter`&&h()}),Cs(he,()=>H(f),e=>F(f,e)),U(`click`,ge,h),G(e,v),Nt()}Wa([`change`,`click`,`keydown`]);var lu=W(`<button class="bg-danger hover:bg-danger/80 rounded px-3 py-1.5 text-xs font-semibold text-white transition-colors">Confirm?</button> <button class="bg-border hover:bg-border/80 rounded px-3 py-1.5 text-xs font-semibold text-gray-300 transition-colors">Cancel</button>`,1),uu=W(`<button class="border-accent/30 bg-accent/10 text-accent hover:bg-accent/20 rounded border px-3.5 py-1 text-xs font-semibold transition-colors">Run</button>`),du=W(`<div class="border-border/50 hover:bg-border/30 flex h-full items-center justify-between border-b px-4 transition-colors"><div class="flex items-center space-x-3 truncate"><span class="w-12 font-mono text-xs text-gray-500 select-text cursor-text"> </span> <span class="flex-1 truncate font-semibold text-sm text-white select-text cursor-text"> </span></div> <div class="flex shrink-0 items-center space-x-3"><button title="Pin to top"><!></button> <div class="flex shrink-0 items-center space-x-2"><!></div></div></div>`),fu=W(`<div class="flex h-full flex-col"><div class="mb-4 flex items-center justify-between"><input type="text" placeholder="Search common events (ID or name)..." class="border-border bg-bg focus:border-accent flex-1 mr-3 rounded border px-3 py-1.5 text-sm transition-colors focus:outline-none"/> <div class="text-sm text-gray-500"> </div></div> <div class="border-border bg-bg relative flex-1 overflow-hidden rounded-lg border"><!></div></div>`);function pu(e,t){Mt(t,!0);let n=P(I([])),r=P(I([])),i=P(``),a=P(null),o,s=()=>{let e=H(n);if(H(i).trim()){let t=H(i).trim().toLowerCase();e=H(n).filter(e=>String(e.id)===t||e.name.toLowerCase().includes(t))}F(r,e.sort((e,t)=>{let n=Zc.isFavorite(`commonEvents`,e.id),r=Zc.isFavorite(`commonEvents`,t.id);return n&&!r?-1:!n&&r?1:e.id-t.id}),!0)},c=()=>{F(n,q.commonev.list(),!0),s()},l=e=>{F(i,e.target.value,!0),s()};Ws(()=>{c()});let u=e=>{H(a)===e?(q.commonev.run(e),F(a,null),clearTimeout(o)):(F(a,e,!0),clearTimeout(o),o=setTimeout(()=>{H(a)===e&&F(a,null)},3e3))},d=()=>{F(a,null),clearTimeout(o)};var f=fu(),p=L(f),h=L(p);us(h);var g=R(h,2),_=L(g);D(g),D(p);var v=R(p,2);ul(L(v),{get items(){return H(r)},itemHeight:38,itemTemplate:(e,t=m)=>{var n=du(),r=L(n),i=L(r),o=L(i,!0);D(i);var c=R(i,2),l=L(c,!0);D(c),D(r);var f=R(r,2),p=L(f),h=L(p);{let e=Wn(()=>Zc.isFavorite(`commonEvents`,t().id)?`fill-current`:``);bc(h,{size:16,get class(){return H(e)}})}D(p);var g=R(p,2),_=L(g),v=e=>{var n=lu(),r=_i(n),i=R(r,2);U(`click`,r,()=>u(t().id)),U(`click`,i,d),G(e,n)},y=e=>{var n=uu();U(`click`,n,()=>u(t().id)),G(e,n)};mo(_,e=>{H(a)===t().id?e(v):e(y,-1)}),D(g),D(f),D(n),z((e,n)=>{K(o,e),ps(c,`title`,t().name),K(l,t().name),Jo(p,1,`mr-2 flex items-center justify-center transition-colors ${n==null?``:n}`)},[()=>t().id.toString().padStart(4,`0`),()=>Zc.isFavorite(`commonEvents`,t().id)?`text-yellow-400 hover:text-yellow-300`:`text-gray-600 hover:text-gray-400`]),U(`click`,p,()=>{Zc.toggleFavorite(`commonEvents`,t().id),s()}),G(e,n)},$$slots:{itemTemplate:!0}}),D(v),D(f),z(()=>{var e;ds(h,H(i)),K(_,`${(e=H(r).length)==null?``:e} items`)}),U(`input`,h,l),G(e,f),Nt()}Wa([`input`,`click`]);var mu=W(`<button class="bg-danger hover:bg-danger/80 rounded px-2.5 py-1 text-xs font-semibold text-white transition-colors">Unfreeze All</button>`),hu=W(`<div role="button" tabindex="0" class="group flex w-full items-center justify-between px-3 py-1.5 hover:bg-border/50 transition-colors text-left focus:outline-none cursor-pointer"><div class="flex items-center space-x-3 truncate"><span> </span> <span class="truncate text-xs text-white group-hover:text-accent transition-colors"> </span></div> <div class="flex shrink-0 items-center space-x-2.5"><span class="font-mono text-xs font-semibold text-frozen"> </span> <button class="hover:bg-border/80 rounded px-2 py-0.5 text-xs font-medium text-gray-400 hover:text-white transition-colors">Unfreeze</button></div></div>`),gu=W(`<div class="flex h-full items-center justify-center text-xs text-gray-500 p-4 text-center">No active data locks. Use the lock icon on variables, switches, items, or stats to freeze their value.</div>`),_u=W(`<div class="flex h-full flex-col"><div class="mb-2 flex items-center justify-between"><div class="text-xs text-gray-500 font-medium"> </div> <!></div> <div class="border-border bg-bg flex-1 overflow-y-auto rounded-lg border divide-y divide-border/50"></div></div>`);function vu(e,t){Mt(t,!0);let n=P(I([])),r=()=>{F(n,X.summary(),!0)};Ws(()=>{r();let e=setInterval(r,1e3);return()=>clearInterval(e)});let i=e=>{if(e.type===`var`)X.freezeVar(e.id,!1);else if(e.type===`switch`)X.freezeSwitch(e.id,!1);else if(e.type===`item`){let[t,n]=e.key.split(`:`);X.freezeItem(t,parseInt(n,10),!1)}else if(e.type===`stat`||e.type===`param`){let[t,n]=e.key.split(`:`);X.freezeStat(parseInt(t,10),n,!1)}else e.type===`gold`&&X.freezeGold(!1);r()},a=e=>{if(e.type===`var`)Q.targetVarId=e.id,Q.activeTab=Ic.Vars;else if(e.type===`switch`)Q.targetSwitchId=e.id,Q.activeTab=Ic.Switches;else if(e.type===`item`)Q.targetItemKey=e.key,Q.activeTab=Ic.Inv;else if(e.type===`gold`)Q.activeTab=Ic.General;else if(e.type===`stat`||e.type===`param`){let[t,n]=e.key.split(`:`);Q.targetActorId=parseInt(t,10),Q.targetActorStat=n,Q.activeTab=Ic.Actors}},o=()=>{X.clearAll(),r()},s=e=>e===`var`?`VAR`:e===`switch`?`SW`:e===`item`?`ITEM`:e===`stat`?`STAT`:e===`param`?`PARAM`:e===`gold`?`GOLD`:`LOCK`,c=e=>e===`var`?`border-accent/30 bg-accent/10 text-accent`:e===`switch`?`border-ok/30 bg-ok/10 text-ok`:e===`item`?`border-warn/30 bg-warn/10 text-warn`:e===`stat`?`border-danger/30 bg-danger/10 text-danger`:e===`param`?`border-fuchsia-500/30 bg-fuchsia-500/10 text-fuchsia-500`:e===`gold`?`border-yellow-500/30 bg-yellow-500/10 text-yellow-500`:`border-gray-500/30 bg-gray-500/10 text-gray-400`;var l=_u(),u=L(l),d=L(u),f=L(d);D(d);var p=R(d,2),m=e=>{var t=mu();U(`click`,t,o),G(e,t)};mo(p,e=>{H(n).length>0&&e(m)}),D(u);var h=R(u,2);yo(h,21,()=>H(n),ho,(e,t)=>{var n=hu(),r=L(n),o=L(r),l=L(o,!0);D(o);var u=R(o,2),d=L(u,!0);D(u),D(r);var f=R(r,2),p=L(f),m=L(p,!0);D(p);var h=R(p,2);D(f),D(n),z((e,n)=>{Jo(o,1,`rounded border px-1.5 py-0.5 text-[10px] font-bold font-mono tracking-wide ${e==null?``:e}`),K(l,n),ps(u,`title`,H(t).label),K(d,H(t).label),K(m,typeof H(t).value==`boolean`?H(t).value?`ON`:`OFF`:H(t).value)},[()=>c(H(t).type),()=>s(H(t).type)]),U(`keydown`,n,e=>e.key===`Enter`&&a(H(t))),U(`click`,n,()=>a(H(t))),U(`click`,h,e=>{e.stopPropagation(),i(H(t))}),G(e,n)},e=>{G(e,gu())}),D(h),D(l),z(()=>{var e;return K(f,`${(e=H(n).length)==null?``:e} active locks`)}),G(e,l),Nt()}Wa([`click`,`keydown`]);var yu=W(`<div class="border-accent/50 bg-accent/20 text-accent flex h-8 flex-1 animate-pulse cursor-pointer items-center justify-center rounded border text-sm font-medium">Press a key...</div>`),bu=W(`<button> </button>`),xu=W(`<button class="hover:text-danger ml-1 flex h-8 w-8 items-center justify-center text-gray-500" title="Clear shortcut" aria-label="Clear shortcut"><!></button>`),Su=W(`<div class="flex items-center"><!> <!></div>`);function Cu(e,t){Mt(t,!0);let n=Hs(t,`value`,15,``),r=Hs(t,`required`,3,!1),i=Hs(t,`combiningKeyAlone`,3,!1),a=P(!1),o=()=>{F(a,!0);let e=e=>{var a;e.preventDefault(),e.stopPropagation();let o=Yc.fromEvent(e);o.isCombiningKey()&&!i()||(n(o.asString()),(a=t.onchange)==null||a.call(t,n()),r())},r=()=>{F(a,!1),window.removeEventListener(`keydown`,e,{capture:!0})};window.addEventListener(`keydown`,e,{capture:!0}),setTimeout(()=>{window.addEventListener(`click`,r,{capture:!0,once:!0})},100)},s=e=>{if(!e)return`None`;try{return Yc.fromString(e).asDisplayString()}catch(t){return e}};var c=Su(),l=L(c),u=e=>{G(e,yu())},d=e=>{var t=bu(),r=L(t,!0);D(t),z(e=>{Jo(t,1,`border-border bg-bg2 hover:bg-border/50 flex h-8 flex-1 items-center rounded border px-3 text-sm font-medium transition-colors ${n()?`text-white`:`text-gray-500`}`),K(r,e)},[()=>s(n())]),U(`click`,t,o),G(e,t)};mo(l,e=>{H(a)?e(u):e(d,-1)});var f=R(l,2),p=e=>{var r=xu();Mc(L(r),{size:14}),D(r),U(`click`,r,()=>{var e;n(``),(e=t.onchange)==null||e.call(t,n())}),G(e,r)};mo(f,e=>{!r()&&n()&&!H(a)&&e(p)}),D(c),G(e,c),Nt()}Wa([`click`]);var wu=W(`<div class="border-border/50 hover:bg-border/30 flex items-center border-b p-3"><div class="flex-1 pr-4"><div> </div> <div class="text-xs text-gray-400 leading-normal"> </div></div> <div class="mr-4 w-48 shrink-0"><!></div> <div class="flex w-12 shrink-0 items-center justify-center"><!></div></div>`),Tu=W(`<div class="flex h-full flex-col"><div class="mb-4 flex items-center justify-between"><input type="text" placeholder="Search keys (name, description, shortcut)..." class="border-border bg-bg focus:border-accent flex-1 mr-3 rounded border px-3 py-1.5 text-sm transition-colors focus:outline-none"/> <button class="border-danger/30 bg-danger/20 text-danger hover:bg-danger/30 rounded border px-3 py-1.5 text-sm font-semibold transition-colors shrink-0">Restore Defaults</button></div> <div class="border-border bg-bg flex-1 overflow-y-auto rounded-lg border"></div></div>`);function Eu(e,t){Mt(t,!0);let n=P(I([])),r=P(``),i=P(I([])),a=()=>{if(!H(r).trim())F(i,H(n),!0);else{let e=H(r).trim().toLowerCase();F(i,H(n).filter(t=>t.name.toLowerCase().includes(e)||t.desc.toLowerCase().includes(e)||t.keyStr.toLowerCase().includes(e)),!0)}},o=()=>{F(n,$.shortcuts.map(e=>({...e})),!0),a()};Ws(()=>{o()});let s=e=>{F(r,e.target.value,!0),a()},c=(e,t)=>{$.update(e,{keyStr:t}),o()},l=(e,t)=>{$.update(e,{enabled:t}),o()},u=()=>{localStorage.removeItem(`forge:shortcuts`),zc.show(`Defaults restored. Please reload the game.`,`success`)};var d=Tu(),f=L(d),p=L(f);us(p);var m=R(p,2);D(f);var h=R(f,2);yo(h,21,()=>H(i),e=>e.id,(e,t)=>{var n=wu(),r=L(n),i=L(r),a=L(i,!0);D(i);var o=R(i,2),s=L(o,!0);D(o),D(r);var u=R(r,2),d=L(u);{let e=Wn(()=>H(t).id===`speed_hold`||H(t).id===`skip_message`);Cu(d,{get value(){return H(t).keyStr},get required(){return H(t).required},get combiningKeyAlone(){return H(e)},onchange:e=>c(H(t).id,e)})}D(u);var f=R(u,2);xl(L(f),{get value(){return H(t).enabled},onchange:e=>l(H(t).id,e)}),D(f),D(n),z(()=>{Jo(i,1,`font-semibold text-sm ${H(t).enabled?`text-white`:`text-gray-500`}`),K(a,H(t).name),K(s,H(t).desc)}),G(e,n)}),D(h),D(d),z(()=>ds(p,H(r))),U(`input`,p,s),U(`click`,m,u),G(e,d),Nt()}Wa([`input`,`click`]),yt();var Du=Ls(()=>Xc),Ou=W(`<div class="h-full space-y-3 overflow-y-auto pr-1"><div class="border-border bg-bg2 rounded-lg border p-3 space-y-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">UI Preferences</h3> <div class="flex items-center justify-between text-xs"><div><div class="font-medium text-gray-300">Inactive Opacity</div> <div class="text-[10px] text-gray-500">Controls how transparent the panel becomes when the mouse leaves.</div></div> <div class="flex items-center space-x-2"><!></div></div> <div class="flex items-center justify-between text-xs pt-1"><div><div class="font-medium text-gray-300">Remember Window Position</div> <div class="text-[10px] text-gray-500">Save the exact window dimensions and position between game boots.</div></div> <!></div> <div class="flex items-center justify-between text-xs pt-1"><div><div class="font-medium text-gray-300">Auto-Open on Boot</div> <div class="text-[10px] text-gray-500">Automatically display the Forge panel when the game finishes loading.</div></div> <!></div> <div class="flex items-center justify-between text-xs pt-1"><div><div class="font-medium text-gray-300">Show Launcher Icon</div> <div class="text-[10px] text-gray-500">Display a draggable icon to open the panel without a shortcut.</div></div> <!></div></div> <div class="border-border bg-bg2 rounded-lg border p-3 space-y-3"><h3 class="border-border/50 text-[#7ba4ff] mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Gameplay</h3> <div class="flex items-center justify-between text-xs"><div><div class="font-medium text-gray-300">Quick Save / Load Slot</div> <div class="text-[10px] text-gray-500">The save file slot used by the Quick Save and Quick Load shortcuts.</div></div> <div class="flex items-center space-x-2"><!></div></div></div> <div class="border-border bg-bg2 rounded-lg border p-3 space-y-3"><h3 class="border-border/50 text-danger mb-2.5 border-b pb-1.5 text-sm font-bold uppercase tracking-wider">Data Management</h3> <div class="flex items-center justify-between text-xs"><div><div class="font-medium text-gray-300">Factory Reset</div> <div class="text-[10px] text-gray-500">Wipes all Forge settings, locks, and saved layout data.</div></div> <button class="bg-danger hover:bg-danger/80 rounded px-3 py-1.5 font-bold text-white transition-colors">Reset Everything</button></div></div></div>`);function ku(e,t){Mt(t,!1);let n=()=>Zc.save();Fs();var r=Ou(),i=L(r),a=R(L(i),2),o=R(L(a),2);fl(L(o),{get value(){return Du().inactiveOpacity},min:10,max:100,onchange:e=>{Du(Du().inactiveOpacity=e),n()}}),D(o),D(a);var s=R(a,2);xl(R(L(s),2),{onchange:()=>n(),get value(){return Du().rememberPosition},set value(e){Du(Du().rememberPosition=e)},$$legacy:!0}),D(s);var c=R(s,2);xl(R(L(c),2),{onchange:()=>n(),get value(){return Du().autoOpen},set value(e){Du(Du().autoOpen=e)},$$legacy:!0}),D(c);var l=R(c,2);xl(R(L(l),2),{onchange:()=>n(),get value(){return Du().showLauncher},set value(e){Du(Du().showLauncher=e)},$$legacy:!0}),D(l),D(i);var u=R(i,2),d=R(L(u),2),f=R(L(d),2);fl(L(f),{get value(){return Du().quickSaveSlot},min:1,max:20,onchange:e=>{Du(Du().quickSaveSlot=e),n()}}),D(f),D(d),D(u);var p=R(u,2),m=R(L(p),2),h=R(L(m),2);D(m),D(p),D(r),U(`click`,h,()=>Zc.resetAll()),G(e,r),Nt()}Wa([`click`]);var Au=W(`<div class="flex h-full flex-col items-center justify-center space-y-2 text-gray-500"><!> <span class="text-xs">No logs recorded yet.</span></div>`),ju=W(`<span class="text-[#7ba4ff] font-bold text-sm"> </span>`),Mu=W(`<span class="font-bold text-gray-400">Narrator / Unknown</span>`),Nu=W(`<div class="border-border/50 h-full border-b pb-2 flex flex-col px-1 select-text"><div class="mb-1 flex items-center justify-between text-xs text-gray-500 shrink-0"><!> <span> </span></div> <div class="whitespace-pre-wrap break-words text-sm leading-relaxed text-gray-300 overflow-y-auto pr-1 flex-1"> </div></div>`),Pu=W(`<div class="flex h-full flex-col"><div class="border-border bg-bg2 flex-1 flex flex-col rounded-lg border p-3 overflow-hidden"><div class="border-border/50 mb-2.5 flex items-center justify-between border-b pb-1.5 shrink-0"><h3 class="text-[#7ba4ff] m-0 text-sm font-bold uppercase tracking-wider">Game Dialogue Logs</h3> <button class="hover:bg-[#2a2d3a] text-danger hover:text-red-400 flex items-center space-x-1 rounded px-2 py-1 text-xs transition-colors" title="Clear Logs"><!> <span class="font-bold">CLEAR</span></button></div> <div class="flex-1 relative overflow-hidden"><!></div></div></div>`);function Fu(e,t){Mt(t,!0);let n=P(void 0),r=e=>{let t=new Date(e);return`${t.getHours().toString().padStart(2,`0`)}:${t.getMinutes().toString().padStart(2,`0`)}:${t.getSeconds().toString().padStart(2,`0`)}`};Mi(()=>{Qc.entries.length&&setTimeout(()=>{var e,t;H(n)&&((e=(t=H(n)).scrollToBottom)==null||e.call(t))},10)});var i=Pu(),a=L(i),o=L(a),s=R(L(o),2);wc(L(s),{size:14}),ut(2),D(s),D(o);var c=R(o,2),l=L(c),u=e=>{var t=Au();mc(L(t),{size:32,class:`opacity-50`}),ut(2),D(t),G(e,t)},d=e=>{Ps(ul(e,{get items(){return Qc.entries},itemHeight:80,containerHeight:400,itemTemplate:(e,t=m)=>{var n=Nu(),i=L(n),a=L(i),o=e=>{var n=ju(),r=L(n,!0);D(n),z(()=>K(r,t().speaker)),G(e,n)},s=e=>{G(e,Mu())};mo(a,e=>{t().speaker?e(o):e(s,-1)});var c=R(a,2),l=L(c,!0);D(c),D(i);var u=R(i,2),d=L(u,!0);D(u),D(n),z(e=>{K(l,e),K(d,t().text)},[()=>r(t().timestamp)]),G(e,n)},$$slots:{itemTemplate:!0}}),e=>F(n,e,!0),()=>H(n))};mo(l,e=>{Qc.entries.length===0?e(u):e(d,-1)}),D(c),D(a),D(i),U(`click`,s,()=>tl.clear()),G(e,i),Nt()}Wa([`click`]);var Iu=W(`<button><!> <span> </span></button>`),Lu=W(`<div role="presentation" class="border-border bg-bg2 text-text pointer-events-auto fixed flex rounded-lg border shadow-2xl overflow-hidden font-sans z-2147483000 transition-opacity duration-200"><div class="w-32 bg-[#1a1d24] border-r border-[#2a2d3a] flex flex-col shrink-0 select-none"><div class="border-b border-[#2a2d3a] flex h-12 shrink-0 cursor-move items-center space-x-2 px-4 font-bold" role="presentation"><span class="select-none pointer-events-none text-sm font-bold tracking-wider text-white first-letter:text-[#7ba4ff]">Forge</span></div> <div class="flex-1 overflow-y-auto p-2 space-y-1"></div> <div class="p-3 text-[10px] text-gray-500 border-t border-[#2a2d3a] flex justify-between items-center shrink-0"><span class="truncate"></span></div></div> <div class="flex-1 flex flex-col min-w-0 bg-[#13151a]"><div class="bg-[#1a1d24] flex h-12 shrink-0 cursor-move items-center justify-between border-b border-[#2a2d3a] px-4 select-none" role="presentation"><div class="text-base font-bold tracking-wider uppercase text-white"> </div> <button class="hover:bg-[#2a2d3a] flex h-6 w-6 items-center justify-center rounded text-gray-400 hover:text-white transition-colors" title="Close cheat UI" aria-label="Close cheat UI"><!></button></div> <div class="flex-1 overflow-hidden p-5 overflow-y-auto"><!></div></div> <!></div>`),Ru=W(`<div class="flex items-center px-3 py-2 rounded shadow-lg border text-white font-semibold transition-all pointer-events-auto"><div class="w-1.5 h-1.5 rounded-full mr-2 shrink-0"></div> <div class="flex-1 truncate"> </div></div>`),zu=W(`<!> <div class="fixed top-4 left-4 z-2147483647 flex flex-col space-y-2 pointer-events-none select-none font-sans text-xs"></div> <!>`,1);function Bu(e,t){Mt(t,!0),Mi(()=>{let e=document.getElementById(`forge-mvmz-host`);if(!e)return;let t=!1,n=()=>{t=!1},r=[`mousedown`,`mousemove`,`mouseup`,`click`,`dblclick`,`pointerdown`,`pointermove`,`pointerup`,`contextmenu`,`wheel`,`touchstart`,`touchmove`,`touchend`,`keydown`,`keyup`],i=e=>{(e.type===`mousedown`||e.type===`pointerdown`||e.type===`touchstart`)&&(t=!0);let n=e.type===`mousemove`||e.type===`pointermove`||e.type===`touchmove`,r=e.type===`mouseup`||e.type===`pointerup`||e.type===`touchend`;if(n){let n=!1;if(`buttons`in e?n=e.buttons>0:`touches`in e&&(n=e.touches.length>0),n&&!t)return}r&&!t||e.stopPropagation()};if(window.addEventListener(`mouseup`,n,{capture:!0}),window.addEventListener(`pointerup`,n,{capture:!0}),window.addEventListener(`touchend`,n,{capture:!0}),Q.visible)for(let t of r)e.addEventListener(t,i,!1);else for(let t of r)e.removeEventListener(t,i,!1);return()=>{window.removeEventListener(`mouseup`,n,{capture:!0}),window.removeEventListener(`pointerup`,n,{capture:!0}),window.removeEventListener(`touchend`,n,{capture:!0});for(let t of r)e.removeEventListener(t,i,!1)}});let n=[{id:Ic.General,label:`General`},{id:Ic.Vars,label:`Variables`},{id:Ic.Switches,label:`Switches`},{id:Ic.Inv,label:`Inventory`},{id:Ic.Actors,label:`Actors`},{id:Ic.Map,label:`Map`},{id:Ic.CommonEv,label:`Events`},{id:Ic.Locks,label:`Locks`},{id:Ic.Logs,label:`Logs`},{id:Ic.Shortcuts,label:`Keys`},{id:Ic.Settings,label:`Settings`}],r=P(0),i=P(0),a=P(840),o=P(520),s=P(!1);Ws(()=>{Zc.load(),X.install(),Wc.install(),tl.install(),$.init(nl);try{let e=JSON.parse(localStorage.getItem(`forge:panel`)||`null`);e&&Xc.rememberPosition?(F(r,e.x,!0),F(i,e.y,!0),F(a,e.w,!0),F(o,e.h,!0)):typeof window<`u`&&(F(r,0),F(i,0),F(a,Math.min(840,window.innerWidth||840),!0),F(o,Math.min(520,window.innerHeight||520),!0));let t=localStorage.getItem(`forge:lastTab`);t&&Object.values(Ic).includes(t)&&(Q.activeTab=t)}catch(e){}Xc.autoOpen&&!Q.visible&&(Q.visible=!0)});let c=()=>{Xc.rememberPosition&&localStorage.setItem(`forge:panel`,JSON.stringify({x:H(r),y:H(i),w:H(a),h:H(o)})),localStorage.setItem(`forge:lastTab`,Q.activeTab)},l=P(!1),u=P(0),d=P(0),f=P(0),p=P(0),m=e=>{H(l)&&(F(r,Math.max(0,Math.min(window.innerWidth-H(a),H(f)+e.clientX-H(u))),!0),F(i,Math.max(0,Math.min(window.innerHeight-H(o),H(p)+e.clientY-H(d))),!0))},h=()=>{F(l,!1),window.removeEventListener(`mousemove`,m,!0),window.removeEventListener(`mouseup`,h,!0),c()},g=e=>{e.target.closest(`button, input, select`)||(F(l,!0),F(u,e.clientX,!0),F(d,e.clientY,!0),F(f,H(r),!0),F(p,H(i),!0),window.addEventListener(`mousemove`,m,!0),window.addEventListener(`mouseup`,h,!0))},_=P(!1),v=P(0),y=P(0),b=e=>{H(_)&&(F(a,Math.max(560,Math.min(window.innerWidth-H(r),H(v)+e.clientX-H(u))),!0),F(o,Math.max(360,Math.min(window.innerHeight-H(i),H(y)+e.clientY-H(d))),!0))},x=()=>{F(_,!1),window.removeEventListener(`mousemove`,b,!0),window.removeEventListener(`mouseup`,x,!0),c()},S=e=>{F(_,!0),F(u,e.clientX,!0),F(d,e.clientY,!0),F(v,H(a),!0),F(y,H(o),!0),window.addEventListener(`mousemove`,b,!0),window.addEventListener(`mouseup`,x,!0),e.stopPropagation()};var ee=zu(),C=_i(ee),w=e=>{var t=Lu(),u=L(t),d=L(u),f=R(d,2);yo(f,21,()=>n,ho,(e,t)=>{var n=Iu(),r=L(n),i=e=>{Ac(e,{size:14})},a=e=>{ic(e,{size:14})},o=e=>{Sc(e,{size:14})},s=e=>{gc(e,{size:14})},l=e=>{Oc(e,{size:14})},u=e=>{fc(e,{size:14})},d=e=>{Pc(e,{size:14})},f=e=>{uc(e,{size:14})},p=e=>{mc(e,{size:14})},m=e=>{oc(e,{size:14})},h=e=>{vc(e,{size:14})};mo(r,e=>{H(t).id===`general`?e(i):H(t).id===`vars`?e(a,1):H(t).id===`switches`?e(o,2):H(t).id===`inv`?e(s,3):H(t).id===`actors`?e(l,4):H(t).id===`map`?e(u,5):H(t).id===`commonev`?e(d,6):H(t).id===`locks`?e(f,7):H(t).id===`logs`?e(p,8):H(t).id===`shortcuts`?e(m,9):H(t).id===`settings`&&e(h,10)});var g=R(r,2),_=L(g,!0);D(g),D(n),z(()=>{Jo(n,1,`w-full text-left rounded px-3 py-2 text-xs font-semibold transition-all flex items-center space-x-2.5 focus:outline-none ${Q.activeTab===H(t).id?`bg-[#7ba4ff]/10 text-[#7ba4ff] shadow-sm`:`text-gray-400 hover:bg-[#2a2d3a] hover:text-gray-200`}`),K(_,H(t).label)}),U(`click`,n,()=>{var e;Q.activeTab=H(t).id,(e=window.getSelection())==null||e.removeAllRanges(),c()}),G(e,n)}),D(f);var p=R(f,2),m=L(p);ps(m,`title`,`1.0.0`),m.textContent=`1.0.0`,D(p),D(u);var h=R(u,2),v=L(h),y=L(v),b=L(y,!0);D(y);var x=R(y,2);Mc(L(x),{size:14}),D(x),D(v);var ee=R(v,2),C=L(ee),w=e=>{yl(e,{})},te=e=>{wl(e,{})},ne=e=>{Ol(e,{})},re=e=>{Vl(e,{})},ie=e=>{ru(e,{})},ae=e=>{cu(e,{})},oe=e=>{pu(e,{})},se=e=>{vu(e,{})},ce=e=>{Fu(e,{})},le=e=>{Eu(e,{})},ue=e=>{ku(e,{})};mo(C,e=>{Q.activeTab===Ic.Vars?e(w):Q.activeTab===Ic.Switches?e(te,1):Q.activeTab===Ic.Inv?e(ne,2):Q.activeTab===Ic.Actors?e(re,3):Q.activeTab===Ic.General?e(ie,4):Q.activeTab===Ic.Map?e(ae,5):Q.activeTab===Ic.CommonEv?e(oe,6):Q.activeTab===Ic.Locks?e(se,7):Q.activeTab===Ic.Logs?e(ce,8):Q.activeTab===Ic.Shortcuts?e(le,9):Q.activeTab===Ic.Settings&&e(ue,10)}),D(ee),D(h),il(R(h,2),{onmousedown:S}),D(t),z(e=>{var n,c,u,d;Xo(t,`opacity: ${H(l)||H(_)||H(s)?1:Xc.inactiveOpacity/100}; left: ${(n=H(r))==null?``:n}px; top: ${(c=H(i))==null?``:c}px; width: ${(u=H(a))==null?``:u}px; height: ${(d=H(o))==null?``:d}px; background: #13151a; color: #d4d8e3;`),K(b,e)},[()=>{var e;return((e=n.find(e=>e.id===Q.activeTab))==null?void 0:e.label)||``}]),Ua(`mouseenter`,t,()=>F(s,!0)),Ua(`mouseleave`,t,()=>F(s,!1)),U(`mousedown`,d,g),U(`mousedown`,v,g),U(`click`,x,()=>Q.visible=!1),G(e,t)};mo(C,e=>{Q.visible&&e(w)});var te=R(C,2);yo(te,21,()=>zc.toasts,e=>e.id,(e,t)=>{var n=Ru(),r=L(n),i=R(r,2),a=L(i,!0);D(i),D(n),z(()=>{Xo(n,`background: #1a1d24; border-color: ${H(t).type===`success`?`#10b981`:H(t).type===`warn`?`#fb923c`:H(t).type===`error`?`#ef4444`:`#6366f1`}; opacity: 0.95; min-width: 160px; max-width: 320px;`),Xo(r,`background: ${H(t).type===`success`?`#10b981`:H(t).type===`warn`?`#fb923c`:H(t).type===`error`?`#ef4444`:`#6366f1`};`),K(a,H(t).message)}),G(e,n)}),D(te),ol(R(te,2),{}),G(e,ee),Nt()}Wa([`mousedown`,`click`]);var Vu=`forge-mvmz-host`,Hu=document.getElementById(Vu);Hu||(Hu=document.createElement(`div`),Hu.id=Vu,Hu.style.position=`fixed`,Hu.style.top=`0`,Hu.style.left=`0`,Hu.style.width=`100vw`,Hu.style.height=`100vh`,Hu.style.pointerEvents=`none`,Hu.style.zIndex=`2147483647`,document.body.appendChild(Hu));var Uu=document.createElement(`style`);Uu.textContent=`#${Vu} { z-index: 2147483647 !important; }`,document.head.appendChild(Uu);var Wu=null,Gu;typeof Hu.attachShadow==`function`?(Wu=Hu.attachShadow({mode:`open`}),Gu=Wu,setTimeout(()=>{for(let e of document.head.querySelectorAll(`style`)){let t=e.textContent||``;if(t.includes(`tailwind`)||t.includes(`--color-bg`)){let e=document.createElement(`style`);e.textContent=t,Wu.appendChild(e)}}},0)):(Gu=Hu,setTimeout(()=>{for(let e of document.head.querySelectorAll(`style`)){let t=e.textContent||``;if(t.includes(`tailwind`)||t.includes(`--color-bg`)){let e=document.createElement(`style`);e.textContent=t,document.head.appendChild(e)}}},0));var Ku=document.createElement(`div`);Ku.style.pointerEvents=`none`,Ku.style.width=`100%`,Ku.style.height=`100%`,Gu.appendChild(Ku);try{to(Bu,{target:Ku})}catch(e){console.error(`[FORGE] Error mounting Svelte App:`,e)}if(window.Input!==void 0&&window.Input._onKeyDown){let e=window.Input._onKeyDown;window.Input._onKeyDown=function(t){let n=t.composedPath&&t.composedPath()[0]||t.target;Hu.contains(n)||e.call(this,t)}}if(window.Input!==void 0&&window.Input._onKeyUp){let e=window.Input._onKeyUp;window.Input._onKeyUp=function(t){let n=t.composedPath&&t.composedPath()[0]||t.target;Hu.contains(n)||e.call(this,t)}}})();