@macrulez/mediatoolz 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,8 +30,8 @@ and lives in its own package since devtoolz 0.5.0.
30
30
  sync: `--cache` skips unchanged images, `--update --prune` merges into
31
31
  the existing file, `--check` fails with exit code 1 when it is stale
32
32
  (made for CI). `--dry-run` writes nothing and shows the result as a
33
- table instead. Uses the native `sharp` library, which mediatoolz
34
- offers to install on first use — see Requirements.
33
+ table instead. Uses the native `sharp` library, which comes
34
+ with the package — see Requirements.
35
35
  - **`image-batch`** — produces resized, converted and recompressed versions
36
36
  of raster images in bulk, by rules kept in a reusable **config** or given
37
37
  as flags: `widths`, `heights`, `size`, `longEdge` / `shortEdge` (the same for
@@ -87,13 +87,13 @@ supports `--json` for machine-readable output.
87
87
  ## Requirements
88
88
 
89
89
  - Node.js 20+
90
- - The [`sharp`](https://sharp.pixelplumbing.com) image library. It ships
91
- prebuilt binaries for the common platforms and is not installed with
92
- mediatoolz — the first run of either command offers to install it into
93
- `~/.mediatoolz/deps` (`-y` / `--yes` agrees up front, which is also what
94
- you want in CI; without a terminal and without `--yes` the command stops
95
- and says so). A `sharp` you already have installed alongside mediatoolz
96
- is used as-is.
90
+ - The [`sharp`](https://sharp.pixelplumbing.com) image library comes with
91
+ the package: npm picks its prebuilt binary for your platform during the
92
+ install, so there is nothing to set up. Only if that binary is missing
93
+ (an install with `--omit=optional`, an unsupported platform) does the
94
+ first run offer to install `sharp` into `~/.mediatoolz/deps` (`-y` /
95
+ `--yes` agrees up front, which is also what you want in CI; without a
96
+ terminal and without `--yes` the command stops and says so).
97
97
 
98
98
  ## Installation
99
99
 
@@ -1 +1 @@
1
- .seg[data-v-56d7f4ee]{display:inline-flex;align-self:flex-start;flex-wrap:wrap;padding:3px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2)}.seg__btn[data-v-56d7f4ee]{padding:5px 12px;border:0;border-radius:6px;background:transparent;color:var(--muted);cursor:pointer}.seg__btn[data-v-56d7f4ee]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.seg__btn--on[data-v-56d7f4ee]{background:var(--surface);color:var(--text);font-weight:600;box-shadow:var(--shadow)}.view[data-v-1e694fea]{display:flex;flex-direction:column;gap:16px}.block[data-v-1e694fea]{display:flex;flex-direction:column;gap:12px;padding:18px}.head[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px}.small[data-v-1e694fea]{font-size:12px}.list[data-v-1e694fea]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.item[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:9px}.item__main[data-v-1e694fea]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:260px}.item__path[data-v-1e694fea]{color:var(--muted);font-size:11px;word-break:break-all}.item__actions[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.custom[data-v-1e694fea]{display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--border)}.custom h3[data-v-1e694fea]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted);text-transform:uppercase}.pathrow[data-v-1e694fea]{display:flex;flex-wrap:wrap;gap:8px}.pathrow .input[data-v-1e694fea]{flex:1;min-width:220px;font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px}.actions[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:center;gap:12px}.chips[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.chip[data-v-1e694fea]{padding:2px 10px;border-radius:999px;background:var(--surface-2);font-size:12px;white-space:nowrap}.chip--good[data-v-1e694fea]{background:color-mix(in srgb,var(--ok) 18%,transparent);color:var(--ok)}.chip--warn[data-v-1e694fea]{background:var(--warn-soft);color:var(--warn)}.chip--bad[data-v-1e694fea]{background:var(--danger-soft);color:var(--danger)}.rows[data-v-1e694fea]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.row[data-v-1e694fea]{display:flex;align-items:center;gap:12px;padding:8px;border:1px solid var(--border);border-radius:9px}.row__thumb[data-v-1e694fea]{flex:none;width:64px;height:64px;border-radius:6px;background:var(--surface-2);object-fit:cover}.row__text[data-v-1e694fea]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.row__name[data-v-1e694fea]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row__message[data-v-1e694fea]{color:var(--danger)}.sharpen[data-v-1d132e3d]{display:flex;flex-direction:column;gap:12px}.grid[data-v-1d132e3d]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}.hint[data-v-1d132e3d]{align-self:end;font-size:12px}.link[data-v-1d132e3d]{align-self:flex-start;padding:0;border:0;background:transparent;color:var(--accent);cursor:pointer}.link[data-v-1d132e3d]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.recipe[data-v-6d67983e]{display:flex;flex-direction:column;gap:16px}.group[data-v-6d67983e]{display:flex;flex-direction:column;gap:10px}.group h4[data-v-6d67983e]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted);text-transform:uppercase;margin:0}.grid[data-v-6d67983e]{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}.small[data-v-6d67983e]{font-size:12px}.input--bad[data-v-6d67983e]{border-color:var(--danger)}.pills[data-v-6d67983e]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.pill[data-v-6d67983e]{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);font-size:12px;cursor:pointer}.pill input[data-v-6d67983e]{display:none}.pill--on[data-v-6d67983e]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);font-weight:600}.pill--button[data-v-6d67983e]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace}.pill--button[data-v-6d67983e]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.link[data-v-6d67983e]{align-self:flex-start;padding:0;border:0;background:transparent;color:var(--accent);cursor:pointer}.link[data-v-6d67983e]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.block[data-v-5992429e]{display:flex;flex-direction:column;gap:16px;padding:18px}.head[data-v-5992429e]{display:flex;align-items:center;justify-content:space-between;gap:12px}.grid[data-v-5992429e]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.small[data-v-5992429e]{font-size:12px}.recipes[data-v-5992429e]{display:flex;flex-direction:column;gap:8px}.panel[data-v-5992429e]{border:1px solid var(--border);border-radius:9px}.panel--open[data-v-5992429e]{border-color:var(--accent)}.panel__head[data-v-5992429e]{display:flex;align-items:center;gap:8px;padding:4px 8px 4px 12px}.panel__title[data-v-5992429e]{display:flex;flex-direction:column;gap:0;flex:1;min-width:0;padding:8px 0;border:0;background:transparent;text-align:left;cursor:pointer}.panel__title[data-v-5992429e]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.panel__title .small[data-v-5992429e]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.panel__actions[data-v-5992429e]{display:flex;flex-wrap:wrap;align-items:center;gap:2px;flex:none}.panel__body[data-v-5992429e]{padding:12px 16px 16px;border-top:1px solid var(--border)}.panel summary[data-v-5992429e]{padding:12px;cursor:pointer;font-weight:600}details.panel>.panel__body[data-v-5992429e]{border-top:1px solid var(--border)}.json[data-v-5992429e]{min-height:420px;padding:12px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2);font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px;resize:vertical;tab-size:2}.json[data-v-5992429e]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.check-panel[data-v-5992429e]{padding:10px 14px;border-radius:9px}.check-panel--ok[data-v-5992429e]{background:color-mix(in srgb,var(--ok) 14%,transparent)}.check-panel--bad[data-v-5992429e]{background:var(--danger-soft);color:var(--danger)}.lines[data-v-5992429e]{margin:8px 0 0;font-size:12px;white-space:pre-wrap}.actions[data-v-5992429e]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.view[data-v-5b011a56]{display:flex;flex-direction:column;gap:16px}.block[data-v-5b011a56]{display:flex;flex-direction:column;gap:12px;padding:18px}.head[data-v-5b011a56]{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px}.list[data-v-5b011a56]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.item[data-v-5b011a56]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:9px}.item__main[data-v-5b011a56]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:260px}.item__title[data-v-5b011a56]{display:flex;align-items:center;gap:8px}.item__path[data-v-5b011a56]{color:var(--muted);font-size:11px;word-break:break-all}.item__error[data-v-5b011a56]{color:var(--danger);font-size:12px}.item__actions[data-v-5b011a56]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.tag[data-v-5b011a56]{padding:1px 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);font-size:11px}.block[data-v-56eb5236]{display:flex;flex-direction:column;gap:12px;padding:18px}.head[data-v-56eb5236]{display:flex;align-items:center;justify-content:space-between;gap:12px}.small[data-v-56eb5236]{font-size:12px}.chips[data-v-56eb5236]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.chip[data-v-56eb5236]{padding:2px 10px;border-radius:999px;background:var(--surface-2);font-size:12px;white-space:nowrap}.chip--good[data-v-56eb5236]{background:color-mix(in srgb,var(--ok) 18%,transparent);color:var(--ok)}.chip--bad[data-v-56eb5236]{background:var(--danger-soft);color:var(--danger)}.errors[data-v-56eb5236]{margin:0;padding:10px 14px 10px 28px;border-radius:10px;background:var(--danger-soft);color:var(--danger)}.rows[data-v-56eb5236]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.row[data-v-56eb5236]{display:flex;align-items:center;gap:12px;padding:8px;border:1px solid var(--border);border-radius:9px}.row__thumb[data-v-56eb5236]{flex:none;width:64px;height:64px;border-radius:6px;background:var(--surface-2);object-fit:cover}.row__thumb--empty[data-v-56eb5236]{display:grid;place-items:center;font-size:11px}.row__text[data-v-56eb5236]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.row__name[data-v-56eb5236]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row__message[data-v-56eb5236]{color:var(--danger)}.row__sizes[data-v-56eb5236]{display:flex;align-items:baseline;gap:6px;flex:none;font-size:12px}.row__delta[data-v-56eb5236]{color:var(--muted)}.row__delta--down[data-v-56eb5236]{color:var(--ok)}@media(max-width:760px){.row[data-v-56eb5236]{flex-wrap:wrap}.row__text[data-v-56eb5236]{flex-basis:60%}}.link[data-v-56eb5236]{padding:0;border:0;background:transparent;color:var(--accent);cursor:pointer;text-decoration:underline}.more[data-v-56eb5236]{display:flex;flex-wrap:wrap;align-items:center;gap:8px;justify-content:center}.view[data-v-017cd3fb]{display:flex;flex-direction:column;gap:16px}.block[data-v-017cd3fb]{display:flex;flex-direction:column;gap:14px;padding:18px}.head[data-v-017cd3fb]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}.group[data-v-017cd3fb]{display:flex;flex-direction:column;gap:10px}.group h3[data-v-017cd3fb]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted);text-transform:uppercase}.grid[data-v-017cd3fb]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.narrow[data-v-017cd3fb]{max-width:320px}.small[data-v-017cd3fb]{font-size:12px}.pathrow[data-v-017cd3fb]{display:flex;gap:8px}.pathrow .input[data-v-017cd3fb]{flex:1;font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px}.pills[data-v-017cd3fb]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.pill[data-v-017cd3fb]{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);font-size:12px;cursor:pointer}.pill input[data-v-017cd3fb]{display:none}.pill--on[data-v-017cd3fb]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);font-weight:600}.pill--button[data-v-017cd3fb]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace}.pill--button[data-v-017cd3fb]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.runbar[data-v-017cd3fb]{display:flex;flex-wrap:wrap;align-items:center;gap:14px}.link[data-v-017cd3fb]{align-self:flex-start;padding:0;border:0;background:transparent;color:var(--accent);cursor:pointer}.link[data-v-017cd3fb]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.progress[data-v-017cd3fb]{height:8px;overflow:hidden;border-radius:999px;background:var(--surface-2)}.progress__bar[data-v-017cd3fb]{height:100%;background:var(--accent);transition:width .15s}.compare[data-v-0ee1b3e3]{display:flex;flex-direction:column;gap:8px}.compare__scroll[data-v-0ee1b3e3]{overflow:auto;border-radius:9px;background:var(--surface-2);max-height:70vh}.compare__stage[data-v-0ee1b3e3]{position:relative;width:fit-content;margin:0 auto;line-height:0}.compare__img[data-v-0ee1b3e3]{display:block;max-width:none}.compare__img--top[data-v-0ee1b3e3]{position:absolute;inset:0}.compare__line[data-v-0ee1b3e3]{position:absolute;top:0;bottom:0;width:2px;background:var(--accent);pointer-events:none}.compare__tag[data-v-0ee1b3e3]{position:absolute;top:8px;padding:2px 8px;border-radius:6px;background:#0009;color:#fff;font-size:11px;line-height:1.4}.compare__tag--left[data-v-0ee1b3e3]{left:8px}.compare__tag--right[data-v-0ee1b3e3]{right:8px}.compare__range[data-v-0ee1b3e3]{width:100%}.block[data-v-6a65364c]{display:flex;flex-direction:column;gap:16px;padding:18px}.head[data-v-6a65364c]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}.grid[data-v-6a65364c]{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}.wide[data-v-6a65364c]{grid-column:1/-1}.small[data-v-6a65364c]{font-size:12px}.preview[data-v-6a65364c]{display:flex;flex-direction:column;gap:12px}.previewbar[data-v-6a65364c]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.inline[data-v-6a65364c]{flex-direction:row;align-items:center}.narrow[data-v-6a65364c]{width:90px}.actions[data-v-6a65364c]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.view[data-v-519b182c]{display:flex;flex-direction:column;gap:16px}.block[data-v-519b182c]{display:flex;flex-direction:column;gap:12px;padding:18px}.head[data-v-519b182c]{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px}.list[data-v-519b182c]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.item[data-v-519b182c]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:9px}.item__main[data-v-519b182c]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:260px}.item__title[data-v-519b182c]{display:flex;align-items:center;gap:8px}.item__facts[data-v-519b182c]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px}.item__error[data-v-519b182c]{color:var(--danger);font-size:12px}.item__actions[data-v-519b182c]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.tag[data-v-519b182c]{padding:1px 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);font-size:11px}.tag--builtin[data-v-519b182c]{background:var(--accent-soft);color:var(--accent)}.page[data-v-91e8f81e]{display:flex;flex-direction:column;gap:16px;padding:28px 28px 60px}@media(max-width:760px){.page[data-v-91e8f81e]{padding:18px 14px 40px}}.page__head p[data-v-91e8f81e]{margin-top:4px}.context[data-v-91e8f81e]{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;font-size:12px}.context code[data-v-91e8f81e]{padding:2px 8px;border-radius:6px;background:var(--surface-2);word-break:break-all}
1
+ .seg[data-v-56d7f4ee]{display:inline-flex;align-self:flex-start;flex-wrap:wrap;padding:3px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2)}.seg__btn[data-v-56d7f4ee]{padding:5px 12px;border:0;border-radius:6px;background:transparent;color:var(--muted);cursor:pointer}.seg__btn[data-v-56d7f4ee]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.seg__btn--on[data-v-56d7f4ee]{background:var(--surface);color:var(--text);font-weight:600;box-shadow:var(--shadow)}.view[data-v-1e694fea]{display:flex;flex-direction:column;gap:16px}.block[data-v-1e694fea]{display:flex;flex-direction:column;gap:12px;padding:18px}.head[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px}.small[data-v-1e694fea]{font-size:12px}.list[data-v-1e694fea]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.item[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:9px}.item__main[data-v-1e694fea]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:260px}.item__path[data-v-1e694fea]{color:var(--muted);font-size:11px;word-break:break-all}.item__actions[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.custom[data-v-1e694fea]{display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--border)}.custom h3[data-v-1e694fea]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted);text-transform:uppercase}.pathrow[data-v-1e694fea]{display:flex;flex-wrap:wrap;gap:8px}.pathrow .input[data-v-1e694fea]{flex:1;min-width:220px;font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px}.actions[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:center;gap:12px}.chips[data-v-1e694fea]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.chip[data-v-1e694fea]{padding:2px 10px;border-radius:999px;background:var(--surface-2);font-size:12px;white-space:nowrap}.chip--good[data-v-1e694fea]{background:color-mix(in srgb,var(--ok) 18%,transparent);color:var(--ok)}.chip--warn[data-v-1e694fea]{background:var(--warn-soft);color:var(--warn)}.chip--bad[data-v-1e694fea]{background:var(--danger-soft);color:var(--danger)}.rows[data-v-1e694fea]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.row[data-v-1e694fea]{display:flex;align-items:center;gap:12px;padding:8px;border:1px solid var(--border);border-radius:9px}.row__thumb[data-v-1e694fea]{flex:none;width:64px;height:64px;border-radius:6px;background:var(--surface-2);object-fit:cover}.row__text[data-v-1e694fea]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.row__name[data-v-1e694fea]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row__message[data-v-1e694fea]{color:var(--danger)}.sharpen[data-v-1d132e3d]{display:flex;flex-direction:column;gap:12px}.grid[data-v-1d132e3d]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}.hint[data-v-1d132e3d]{align-self:end;font-size:12px}.link[data-v-1d132e3d]{align-self:flex-start;padding:0;border:0;background:transparent;color:var(--accent);cursor:pointer}.link[data-v-1d132e3d]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.recipe[data-v-6d67983e]{display:flex;flex-direction:column;gap:16px}.group[data-v-6d67983e]{display:flex;flex-direction:column;gap:10px}.group h4[data-v-6d67983e]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted);text-transform:uppercase;margin:0}.grid[data-v-6d67983e]{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}.small[data-v-6d67983e]{font-size:12px}.input--bad[data-v-6d67983e]{border-color:var(--danger)}.pills[data-v-6d67983e]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.pill[data-v-6d67983e]{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);font-size:12px;cursor:pointer}.pill input[data-v-6d67983e]{display:none}.pill--on[data-v-6d67983e]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);font-weight:600}.pill--button[data-v-6d67983e]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace}.pill--button[data-v-6d67983e]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.link[data-v-6d67983e]{align-self:flex-start;padding:0;border:0;background:transparent;color:var(--accent);cursor:pointer}.link[data-v-6d67983e]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.block[data-v-5992429e]{display:flex;flex-direction:column;gap:16px;padding:18px}.head[data-v-5992429e]{display:flex;align-items:center;justify-content:space-between;gap:12px}.grid[data-v-5992429e]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.small[data-v-5992429e]{font-size:12px}.recipes[data-v-5992429e]{display:flex;flex-direction:column;gap:8px}.panel[data-v-5992429e]{border:1px solid var(--border);border-radius:9px}.panel--open[data-v-5992429e]{border-color:var(--accent)}.panel__head[data-v-5992429e]{display:flex;align-items:center;gap:8px;padding:4px 8px 4px 12px}.panel__title[data-v-5992429e]{display:flex;flex-direction:column;gap:0;flex:1;min-width:0;padding:8px 0;border:0;background:transparent;text-align:left;cursor:pointer}.panel__title[data-v-5992429e]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.panel__title .small[data-v-5992429e]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.panel__actions[data-v-5992429e]{display:flex;flex-wrap:wrap;align-items:center;gap:2px;flex:none}.panel__body[data-v-5992429e]{padding:12px 16px 16px;border-top:1px solid var(--border)}.panel summary[data-v-5992429e]{padding:12px;cursor:pointer;font-weight:600}details.panel>.panel__body[data-v-5992429e]{border-top:1px solid var(--border)}.json[data-v-5992429e]{min-height:420px;padding:12px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2);font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px;resize:vertical;tab-size:2}.json[data-v-5992429e]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.check-panel[data-v-5992429e]{padding:10px 14px;border-radius:9px}.check-panel--ok[data-v-5992429e]{background:color-mix(in srgb,var(--ok) 14%,transparent)}.check-panel--bad[data-v-5992429e]{background:var(--danger-soft);color:var(--danger)}.lines[data-v-5992429e]{margin:8px 0 0;font-size:12px;white-space:pre-wrap}.actions[data-v-5992429e]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.view[data-v-5b011a56]{display:flex;flex-direction:column;gap:16px}.block[data-v-5b011a56]{display:flex;flex-direction:column;gap:12px;padding:18px}.head[data-v-5b011a56]{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px}.list[data-v-5b011a56]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.item[data-v-5b011a56]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:9px}.item__main[data-v-5b011a56]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:260px}.item__title[data-v-5b011a56]{display:flex;align-items:center;gap:8px}.item__path[data-v-5b011a56]{color:var(--muted);font-size:11px;word-break:break-all}.item__error[data-v-5b011a56]{color:var(--danger);font-size:12px}.item__actions[data-v-5b011a56]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.tag[data-v-5b011a56]{padding:1px 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);font-size:11px}.block[data-v-56eb5236]{display:flex;flex-direction:column;gap:12px;padding:18px}.head[data-v-56eb5236]{display:flex;align-items:center;justify-content:space-between;gap:12px}.small[data-v-56eb5236]{font-size:12px}.chips[data-v-56eb5236]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.chip[data-v-56eb5236]{padding:2px 10px;border-radius:999px;background:var(--surface-2);font-size:12px;white-space:nowrap}.chip--good[data-v-56eb5236]{background:color-mix(in srgb,var(--ok) 18%,transparent);color:var(--ok)}.chip--bad[data-v-56eb5236]{background:var(--danger-soft);color:var(--danger)}.errors[data-v-56eb5236]{margin:0;padding:10px 14px 10px 28px;border-radius:10px;background:var(--danger-soft);color:var(--danger)}.rows[data-v-56eb5236]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.row[data-v-56eb5236]{display:flex;align-items:center;gap:12px;padding:8px;border:1px solid var(--border);border-radius:9px}.row__thumb[data-v-56eb5236]{flex:none;width:64px;height:64px;border-radius:6px;background:var(--surface-2);object-fit:cover}.row__thumb--empty[data-v-56eb5236]{display:grid;place-items:center;font-size:11px}.row__text[data-v-56eb5236]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.row__name[data-v-56eb5236]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row__message[data-v-56eb5236]{color:var(--danger)}.row__sizes[data-v-56eb5236]{display:flex;align-items:baseline;gap:6px;flex:none;font-size:12px}.row__delta[data-v-56eb5236]{color:var(--muted)}.row__delta--down[data-v-56eb5236]{color:var(--ok)}@media(max-width:760px){.row[data-v-56eb5236]{flex-wrap:wrap}.row__text[data-v-56eb5236]{flex-basis:60%}}.link[data-v-56eb5236]{padding:0;border:0;background:transparent;color:var(--accent);cursor:pointer;text-decoration:underline}.more[data-v-56eb5236]{display:flex;flex-wrap:wrap;align-items:center;gap:8px;justify-content:center}.view[data-v-9442c7be]{display:flex;flex-direction:column;gap:16px}.block[data-v-9442c7be]{display:flex;flex-direction:column;gap:14px;padding:18px}.head[data-v-9442c7be]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}.group[data-v-9442c7be]{display:flex;flex-direction:column;gap:10px}.group h3[data-v-9442c7be]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted);text-transform:uppercase}.grid[data-v-9442c7be]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.narrow[data-v-9442c7be]{max-width:320px}.small[data-v-9442c7be]{font-size:12px}.pathrow[data-v-9442c7be]{display:flex;gap:8px}.pathrow .input[data-v-9442c7be]{flex:1;font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px}.pills[data-v-9442c7be]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.pill[data-v-9442c7be]{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);font-size:12px;cursor:pointer}.pill input[data-v-9442c7be]{display:none}.pill--on[data-v-9442c7be]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);font-weight:600}.pill--button[data-v-9442c7be]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace}.pill--button[data-v-9442c7be]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.runbar[data-v-9442c7be]{display:flex;flex-wrap:wrap;align-items:center;gap:14px}.link[data-v-9442c7be]{align-self:flex-start;padding:0;border:0;background:transparent;color:var(--accent);cursor:pointer}.link[data-v-9442c7be]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.progress[data-v-9442c7be]{height:8px;overflow:hidden;border-radius:999px;background:var(--surface-2)}.progress__bar[data-v-9442c7be]{height:100%;background:var(--accent);transition:width .15s}.compare[data-v-0ee1b3e3]{display:flex;flex-direction:column;gap:8px}.compare__scroll[data-v-0ee1b3e3]{overflow:auto;border-radius:9px;background:var(--surface-2);max-height:70vh}.compare__stage[data-v-0ee1b3e3]{position:relative;width:fit-content;margin:0 auto;line-height:0}.compare__img[data-v-0ee1b3e3]{display:block;max-width:none}.compare__img--top[data-v-0ee1b3e3]{position:absolute;inset:0}.compare__line[data-v-0ee1b3e3]{position:absolute;top:0;bottom:0;width:2px;background:var(--accent);pointer-events:none}.compare__tag[data-v-0ee1b3e3]{position:absolute;top:8px;padding:2px 8px;border-radius:6px;background:#0009;color:#fff;font-size:11px;line-height:1.4}.compare__tag--left[data-v-0ee1b3e3]{left:8px}.compare__tag--right[data-v-0ee1b3e3]{right:8px}.compare__range[data-v-0ee1b3e3]{width:100%}.block[data-v-6a65364c]{display:flex;flex-direction:column;gap:16px;padding:18px}.head[data-v-6a65364c]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}.grid[data-v-6a65364c]{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}.wide[data-v-6a65364c]{grid-column:1/-1}.small[data-v-6a65364c]{font-size:12px}.preview[data-v-6a65364c]{display:flex;flex-direction:column;gap:12px}.previewbar[data-v-6a65364c]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.inline[data-v-6a65364c]{flex-direction:row;align-items:center}.narrow[data-v-6a65364c]{width:90px}.actions[data-v-6a65364c]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.view[data-v-519b182c]{display:flex;flex-direction:column;gap:16px}.block[data-v-519b182c]{display:flex;flex-direction:column;gap:12px;padding:18px}.head[data-v-519b182c]{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px}.list[data-v-519b182c]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.item[data-v-519b182c]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:9px}.item__main[data-v-519b182c]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:260px}.item__title[data-v-519b182c]{display:flex;align-items:center;gap:8px}.item__facts[data-v-519b182c]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px}.item__error[data-v-519b182c]{color:var(--danger);font-size:12px}.item__actions[data-v-519b182c]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.tag[data-v-519b182c]{padding:1px 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);font-size:11px}.tag--builtin[data-v-519b182c]{background:var(--accent-soft);color:var(--accent)}.page[data-v-91e8f81e]{display:flex;flex-direction:column;gap:16px;padding:28px 28px 60px}@media(max-width:760px){.page[data-v-91e8f81e]{padding:18px 14px 40px}}.page__head p[data-v-91e8f81e]{margin-top:4px}.context[data-v-91e8f81e]{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;font-size:12px}.context code[data-v-91e8f81e]{padding:2px 8px;border-radius:6px;background:var(--surface-2);word-break:break-all}
@@ -1,4 +1,4 @@
1
- import{d as oe,D as De,b as t,e as s,F as V,g as L,x as ne,t as a,E as Me,_ as ie,o as pe,f as e,k as d,l as E,u as Q,G as ce,H as et,y as R,z as se,j as q,m as Z,I as fe,i as be,p as ae,r as c,c as T,v as Y,J as tt,K as he,w as ye,a as Ve,A as ve,C as Le,n as Se,B as st,L as Ae}from"./index-yiehSw5D.js";import{F as xe,S as lt}from"./SourcePicker-Db0dG6zc.js";const at=["aria-label"],nt=["aria-checked","title","onClick"],ot=oe({__name:"UiSegmented",props:Me({options:{},label:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const b=De(n,"modelValue");return(i,f)=>(t(),s("div",{class:"seg",role:"radiogroup","aria-label":n.label},[(t(!0),s(V,null,L(n.options,v=>(t(),s("button",{key:v.value,class:ne(["seg__btn",{"seg__btn--on":b.value===v.value}]),role:"radio","aria-checked":b.value===v.value,title:v.hint,onClick:N=>b.value=v.value},a(v.label),11,nt))),128))],8,at))}}),ge=ie(ot,[["__scopeId","data-v-56d7f4ee"]]),it={class:"view"},ut={key:0,class:"card block"},rt={key:0,class:"notice"},dt={key:1,class:"notice notice--error"},ct={key:2,class:"muted"},vt={class:"list"},pt={class:"item__main"},mt={class:"muted"},ft=["title"],gt={class:"item__actions"},ht=["onClick"],bt=["onClick"],yt={class:"custom"},kt=["disabled"],$t={key:1,class:"card block"},_t={class:"head"},wt={class:"muted"},Ct={class:"item__path"},St={key:0,class:"notice"},Vt={key:1,class:"notice notice--error"},xt={class:"chips"},Et={key:2,class:"notice notice--warn"},zt={class:"actions"},At=["disabled"],Nt={key:0,class:"check"},Bt={class:"rows"},Ot=["src"],jt=["src"],Tt={class:"row__text"},Ut=["title"],It={class:"muted small"},Dt={key:0,class:"small row__message"},Mt={key:3,class:"actions"},Lt={key:4,class:"muted small"},Ne="mediatoolz-ui.open-backup",Ce=30,Rt=oe({__name:"BackupsView",props:{cwd:{}},setup(n){const b={restored:"restored","would-restore":"can be restored",modified:"changed since","missing-backup":"copy missing","damaged-backup":"copy damaged",error:"error"},i=c(""),f=c([]),v=c(),N=c(""),y=c(""),z=c(!1),U=c(!1),I=c(Ce),D=c(""),B=c(!1),S=T(()=>{const x=v.value?.counts;return x?x.modified+x["missing-backup"]+x["damaged-backup"]+x.error:0}),h=T(()=>v.value?.counts["would-restore"]??0),m=T(()=>v.value?.entries.slice(0,I.value)??[]);function r(x){const C=new Date(x);return Number.isNaN(C.getTime())?x:C.toLocaleString()}function _(x){return x==="would-restore"||x==="restored"?"good":x==="modified"?"warn":"bad"}function $(x){N.value=x instanceof Error?x.message:String(x)}async function F(){try{const x=await Y.get("/api/image-batch/backups");i.value=x.root,f.value=x.backups}catch(x){$(x)}}async function J(x){N.value="",y.value="",U.value=!1,I.value=Ce;try{v.value=await Y.get(`/api/image-batch/backup?dir=${encodeURIComponent(x)}`)}catch(C){v.value=void 0,$(C)}}function K(x){const C=x?.[0]??D.value;B.value=!1,C.trim()!==""&&(D.value=C,J(C))}async function M(){const x=v.value;if(!x)return;const C=U.value?x.files:h.value;if(window.confirm(`Put back ${C} original file${C===1?"":"s"} from this backup?`+(U.value?" Files changed after the replacement will be overwritten too.":""))){z.value=!0;try{const P=await Y.post("/api/image-batch/backup/restore",{dir:x.dir,force:U.value});y.value=`Restored ${P.counts.restored} file${P.counts.restored===1?"":"s"}.`,await J(x.dir)}catch(P){$(P)}finally{z.value=!1}}}async function te(x){if(window.confirm("Delete this backup for good? The saved originals cannot be recovered afterwards."))try{await Y.post("/api/image-batch/backup/delete",{dir:x}),y.value="The backup was deleted.",v.value?.dir===x&&(v.value=void 0),await F()}catch(C){$(C)}}return pe(async()=>{await F();try{const x=localStorage.getItem(Ne);x&&(localStorage.removeItem(Ne),await J(x))}catch{v.value=void 0}}),(x,C)=>(t(),s("div",it,[v.value?(t(),s("section",$t,[e("div",_t,[e("div",null,[e("h2",null,"Backup of "+a(r(v.value.createdAt)),1),e("p",wt,a(v.value.files)+" file"+a(v.value.files===1?"":"s")+" · "+a(Q(ce)(v.value.bytesBefore))+" originals, "+a(Q(ce)(v.value.bytesAfter))+" after the replacement ",1),e("code",Ct,a(v.value.dir),1)]),e("button",{class:"btn btn--ghost",onClick:C[3]||(C[3]=A=>(v.value=void 0,F()))},[q(Z,{name:"close",size:16}),C[15]||(C[15]=E(" Back to the list ",-1))])]),y.value?(t(),s("p",St,a(y.value),1)):d("",!0),N.value?(t(),s("p",Vt,a(N.value),1)):d("",!0),e("div",xt,[(t(!0),s(V,null,L(v.value.counts,(A,P)=>R((t(),s("span",{key:P,class:ne(["chip",`chip--${_(P)}`])},a(A)+" "+a(b[P]),3)),[[tt,A>0]])),128))]),v.value.counts.modified?(t(),s("p",Et,a(v.value.counts.modified)+" file"+a(v.value.counts.modified===1?" was":"s were")+" changed after the replacement. They are left alone unless you tick the box below. ",1)):d("",!0),e("div",zt,[e("button",{class:"btn btn--primary",disabled:z.value||h.value===0&&!U.value,onClick:M}," Restore "+a(U.value?"everything":`${h.value} file${h.value===1?"":"s"}`),9,At),v.value.counts.modified?(t(),s("label",Nt,[R(e("input",{"onUpdate:modelValue":C[4]||(C[4]=A=>U.value=A),type:"checkbox"},null,512),[[fe,U.value]]),C[16]||(C[16]=E(" Overwrite files that changed since ",-1))])):d("",!0),e("button",{class:"btn btn--danger",onClick:C[5]||(C[5]=A=>te(v.value.dir))},"Delete this backup")]),e("ul",Bt,[(t(!0),s(V,null,L(m.value,A=>(t(),s("li",{key:A.path,class:"row"},[e("img",{class:"row__thumb",loading:"lazy",alt:"Original",src:Q(be)(A.backup,120)},null,8,Ot),C[17]||(C[17]=e("span",{class:"row__arrow muted"},"⇄",-1)),e("img",{class:"row__thumb",loading:"lazy",alt:"Now",src:Q(be)(A.path,120)},null,8,jt),e("div",Tt,[e("span",{class:"row__name",title:A.path},a(A.path),9,Ut),e("span",It," original "+a(Q(ce)(A.bytesBefore))+" · replaced with "+a(Q(ce)(A.bytesAfter)),1),A.message?(t(),s("span",Dt,a(A.message),1)):d("",!0)]),e("span",{class:ne(["chip",`chip--${_(A.status)}`])},a(b[A.status]),3)]))),128))]),v.value&&I.value<v.value.entries.length?(t(),s("div",Mt,[e("button",{class:"btn",onClick:C[6]||(C[6]=A=>I.value+=Ce)}," Show more ("+a(v.value.entries.length-I.value)+" left) ",1),e("button",{class:"btn",onClick:C[7]||(C[7]=A=>I.value=v.value.entries.length)}," Show all ("+a(v.value.entries.length)+") ",1)])):d("",!0),S.value?(t(),s("p",Lt," The left picture is the saved original, the right one is the file as it is now on disk. ")):d("",!0)])):(t(),s("section",ut,[C[14]||(C[14]=e("div",{class:"head"},[e("div",null,[e("h2",null,"Backups"),e("p",{class:"muted"}," “Replace the originals” copies each file here first, so a replacement can be undone. ")])],-1)),y.value?(t(),s("p",rt,a(y.value),1)):d("",!0),N.value?(t(),s("p",dt,a(N.value),1)):d("",!0),f.value.length===0?(t(),s("p",ct,[C[9]||(C[9]=E(" No backups in ",-1)),e("code",null,a(i.value),1),C[10]||(C[10]=E(" yet. ",-1))])):d("",!0),e("ul",vt,[(t(!0),s(V,null,L(f.value,A=>(t(),s("li",{key:A.dir,class:"item"},[e("div",pt,[e("strong",null,a(r(A.createdAt)),1),e("span",mt,a(A.files)+" file"+a(A.files===1?"":"s")+" · "+a(Q(ce)(A.bytesBefore))+" → "+a(Q(ce)(A.bytesAfter)),1),e("code",{class:"item__path",title:A.dir},a(A.dir),9,ft)]),e("div",gt,[e("button",{class:"btn btn--small",onClick:P=>J(A.dir)},"Open",8,ht),e("button",{class:"btn btn--small btn--danger",onClick:P=>te(A.dir)},"Delete",8,bt)])]))),128))]),e("div",yt,[C[12]||(C[12]=e("h3",null,"Another backup folder",-1)),C[13]||(C[13]=e("p",{class:"muted small"},[E(" If you chose your own backup folder, pick the dated folder inside it (the one with a "),e("code",null,"journal.json"),E("). ")],-1)),e("form",{class:"pathrow",onSubmit:C[2]||(C[2]=et(A=>K(),["prevent"]))},[R(e("input",{"onUpdate:modelValue":C[0]||(C[0]=A=>D.value=A),class:"input",spellcheck:"false",placeholder:"Path to the dated backup folder"},null,512),[[se,D.value]]),e("button",{class:"btn",type:"button",onClick:C[1]||(C[1]=A=>B.value=!0)},[q(Z,{name:"folder",size:16}),C[11]||(C[11]=E(" Browse ",-1))]),e("button",{class:"btn btn--primary",type:"submit",disabled:D.value.trim()===""}," Open ",8,kt)],32)])])),B.value?(t(),ae(xe,{key:2,start:n.cwd,mode:"folder",title:"Choose the backup folder",onClose:C[8]||(C[8]=A=>B.value=!1),onConfirm:K},null,8,["start"])):d("",!0)]))}}),Ft=ie(Rt,[["__scopeId","data-v-1e694fea"]]),ke=Symbol("image-batch-navigate"),Ee=Symbol("image-batch-project"),Re={cwd:"",name:"this project",home:""};function Pt(n,b){const i=n.split(/[\\/]/).filter(Boolean);return{cwd:n,home:b,name:i[i.length-1]??n}}const qt={class:"sharpen"},Jt={key:0,class:"grid"},Kt={class:"field"},Ht=["value"],Wt=["value"],Gt={key:1,class:"hint muted"},Qt={class:"grid"},Yt={class:"field"},Zt=["value"],Xt=["value"],es={class:"field"},ts=["value"],ss=["value"],ls={key:0,class:"grid"},as={class:"muted"},ns=["value","onInput"],os=oe({__name:"SharpenSettings",props:Me({options:{},manage:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const b=n,i=he(ke,()=>{}),f=De(n,"modelValue"),v=c([]),N=c(!1),y=T(()=>v.value.filter(S=>!S.error)),z=T(()=>v.value.find(S=>S.name===f.value.preset));function U(S){const h=S.fields??{};return Object.entries(h).map(([m,r])=>`${m} ${r}`).join(", ")}function I(S){f.value={...f.value,mode:S},S==="preset"&&!f.value.preset&&y.value[0]&&(f.value={...f.value,mode:S,preset:y.value[0].name})}function D(S,h){f.value={...f.value,fine:{...f.value.fine,[S]:h}}}function B(S){const h=b.options.sharpen.fine.find(m=>m.key===S);return h?`${h.range[0]}–${h.range[1]}`:""}return pe(async()=>{try{v.value=await Y.get("/api/image-batch/sharpen-presets")}catch{v.value=[]}}),(S,h)=>(t(),s("div",qt,[q(ge,{"model-value":f.value.mode,label:"Sharpening",options:[{value:"none",label:"None"},{value:"preset",label:"Saved preset"},{value:"custom",label:"Custom"}],"onUpdate:modelValue":I},null,8,["model-value"]),f.value.mode==="preset"?(t(),s("div",Jt,[e("label",Kt,[h[5]||(h[5]=e("span",null,"Preset",-1)),e("select",{class:"select",value:f.value.preset,onChange:h[0]||(h[0]=m=>f.value={...f.value,preset:m.target.value})},[(t(!0),s(V,null,L(y.value,m=>(t(),s("option",{key:m.name,value:m.name},a(m.name)+" · "+a(m.scope),9,Wt))),128))],40,Ht)]),n.manage?(t(),s("button",{key:0,class:"link",onClick:h[1]||(h[1]=m=>Q(i)("sharpen"))},"Manage presets")):d("",!0),z.value?(t(),s("p",Gt,[z.value.description?(t(),s(V,{key:0},[E(a(z.value.description)+" — ",1)],64)):d("",!0),E(" "+a(U(z.value)),1)])):d("",!0)])):d("",!0),f.value.mode==="custom"?(t(),s(V,{key:1},[e("div",Qt,[e("label",Yt,[h[6]||(h[6]=e("span",null,"Sharpen for",-1)),e("select",{class:"select",value:f.value.for,onChange:h[2]||(h[2]=m=>f.value={...f.value,for:m.target.value})},[(t(!0),s(V,null,L(n.options.sharpen.targets,m=>(t(),s("option",{key:m,value:m},a(m),9,Xt))),128))],40,Zt)]),e("label",es,[h[7]||(h[7]=e("span",null,"Amount",-1)),e("select",{class:"select",value:f.value.amount,onChange:h[3]||(h[3]=m=>f.value={...f.value,amount:m.target.value})},[(t(!0),s(V,null,L(n.options.sharpen.amounts,m=>(t(),s("option",{key:m,value:m},a(m),9,ss))),128))],40,ts)])]),e("button",{class:"link",onClick:h[4]||(h[4]=m=>N.value=!N.value)},a(N.value?"Hide":"Show")+" fine settings ",1),N.value?(t(),s("div",ls,[(t(!0),s(V,null,L(n.options.sharpen.fine,m=>(t(),s("label",{key:m.key,class:"field"},[e("span",null,[E(a(m.key)+" ",1),e("small",as,"("+a(B(m.key))+")",1)]),e("input",{class:"input",inputmode:"decimal",placeholder:"table value",value:f.value.fine[m.key],onInput:r=>D(m.key,r.target.value)},null,40,ns)]))),128))])):d("",!0)],64)):d("",!0)]))}}),Fe=ie(os,[["__scopeId","data-v-1d132e3d"]]);function Pe(){return{mode:"none",preset:"",for:"screen",amount:"standard",fine:{radius:"",flat:"",jagged:"",threshold:""}}}function is(n){if(n.mode==="none")return;if(n.mode==="preset")return n.preset?{preset:n.preset}:void 0;const b={for:n.for,amount:n.amount};for(const[i,f]of Object.entries(n.fine))f.trim()!==""&&(b[i]=Number(f));return b}const qe=["widths","heights","size","longEdge","shortEdge","megapixels","percent"],us={widths:[800,1600],heights:[600],size:"1920x1080",longEdge:[1600],shortEdge:[1080],megapixels:[2],percent:[50]};function rs(n,b,i){const f={...n};return i===void 0||i===""||Array.isArray(i)&&i.length===0||typeof i=="number"&&Number.isNaN(i)?delete f[b]:f[b]=i,f}function ds(n){for(const b of qe)if(n[b]!==void 0)return b;return"original"}function cs(n,b){const i={...n};for(const f of qe)delete i[f];return delete i.matchOrientation,b!=="original"&&(i[b]=us[b]),i}function vs(n,b){if(b==="original")return"";const i=n[b];return Array.isArray(i)?i.join(", "):String(i??"")}function ps(n){const b=n.split(/[,\s]+/).filter(Boolean);if(b.length===0)return[];const i=b.map(Number);return i.some(f=>!Number.isFinite(f))?void 0:i}function Be(n){const b=Pe();if(n==null)return{state:b,lossy:!1};if(typeof n=="string")return{state:{...b,mode:"preset",preset:n},lossy:!1};if(typeof n!="object"||Array.isArray(n))return{state:b,lossy:!0};const i=n;if(typeof i.preset=="string")return Object.keys(i).filter(N=>N!=="preset").length===0?{state:{...b,mode:"preset",preset:i.preset},lossy:!1}:{state:{...b,mode:"preset",preset:i.preset},lossy:!0};const f={...b,mode:"custom"};typeof i.for=="string"&&(f.for=i.for),typeof i.amount=="string"&&(f.amount=i.amount);for(const v of["radius","flat","jagged","threshold"])i[v]!==void 0&&(f.fine[v]=String(i[v]));return{state:f,lossy:!1}}function Oe(n){if(n.mode==="none")return;if(n.mode==="preset")return n.preset||void 0;const b={for:n.for,amount:n.amount};for(const[i,f]of Object.entries(n.fine))f.trim()!==""&&(b[i]=Number(f));return b}function ms(){return{name:"New config",outputs:[{id:"responsive",widths:[400,800,1200],formats:["webp","jpg"],quality:"high"}]}}function fs(n){return{id:`recipe-${n}`,widths:[800],formats:["webp"],quality:"high"}}const gs={class:"recipe"},hs={key:0,class:"grid"},bs={class:"field"},ys=["value"],ks={key:0,class:"field"},$s=["value"],_s=["value"],ws={class:"group"},Cs={class:"grid"},Ss={class:"field"},Vs=["value"],xs=["value"],Es={key:0,class:"field"},zs=["value"],As={key:1,class:"field"},Ns=["value"],Bs={key:2,class:"field"},Os=["value"],js=["value"],Ts={key:0,class:"check"},Us=["checked"],Is={class:"group"},Ds={key:0,class:"notice notice--warn"},Ms={key:1,class:"pills"},Ls=["checked","onChange"],Rs={key:0,class:"muted small"},Fs={class:"grid"},Ps={key:0,class:"field"},qs=["value"],Js=["value"],Ks={key:1,class:"field"},Hs=["value"],Ws={key:2,class:"notice notice--warn"},Gs={class:"field"},Qs=["value"],Ys={class:"group"},Zs=["value","placeholder"],Xs={class:"pills"},el=["onClick"],tl={class:"group"},sl={key:0,class:"notice notice--warn"},ll={class:"group"},al={key:0,class:"grid"},nl=["value","onChange"],ol=["value"],il=["value","onChange"],ul={class:"field"},rl=["value"],dl={class:"field"},cl=["value"],vl=oe({__name:"RecipeForm",props:{modelValue:{},options:{},presetNames:{},isDefaults:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:b}){const i=n,f=b,v={original:"Keep the original size",widths:"By width (px)",heights:"By height (px)",size:"Fit into a box",longEdge:"By the long side (px)",shortEdge:"By the short side (px)",megapixels:"By area (megapixels)",percent:"By percentage"},N=[{key:"metadata",label:"Metadata",options:["strip","keep","keep-icc"]},{key:"rotate",label:"Rotate (degrees)",options:["90","180","270"]}],y=[{key:"withoutEnlargement",label:"Never enlarge"},{key:"autoOrient",label:"Turn by EXIF orientation"},{key:"grayscale",label:"Grayscale"},{key:"flip",label:"Flip vertically"},{key:"flop",label:"Mirror horizontally"}],z=c(""),U=c(!1),I=c(!1),D=c(!1),B=c(Be(i.modelValue.sharpen).state),S=T(()=>ds(i.modelValue)),h=T(()=>Array.isArray(i.modelValue.formats)?i.modelValue.formats:void 0),m=T(()=>i.modelValue.formats!==void 0&&h.value===void 0),r=T(()=>i.modelValue.quality),_=T(()=>r.value!==void 0&&typeof r.value=="object"),$=T(()=>{const k=r.value;return k===void 0?"":typeof k=="number"?"custom":String(k)}),F=T(()=>typeof i.modelValue.name=="string"?i.modelValue.name:""),J=T(()=>i.modelValue.maxBytes===void 0?"":String(i.modelValue.maxBytes)),K=T(()=>{const k=i.modelValue.sharpen;return k!==void 0&&typeof k!="string"&&typeof k!="object"});function M(k,l){f("update:modelValue",rs(i.modelValue,k,l))}function te(){z.value=vs(i.modelValue,S.value),U.value=!1}ye(S,te,{immediate:!0}),ye(()=>i.modelValue.sharpen,k=>{const l=Be(k);D.value=l.lossy,JSON.stringify(Oe(B.value))!==JSON.stringify(k)&&(B.value=l.state)},{immediate:!0});function x(k){f("update:modelValue",cs(i.modelValue,k.target.value))}function C(k){z.value=k;const l=ps(k);U.value=l===void 0,l&&l.length>0&&S.value!=="original"&&S.value!=="size"&&M(S.value,l)}function A(k){const l=h.value??[];M("formats",l.includes(k)?l.filter(u=>u!==k):[...l,k])}function P(k){k===""?M("quality",void 0):k==="custom"?M("quality",82):M("quality",k)}function le(k){const l=k.trim();l===""?M("maxBytes",void 0):M("maxBytes",/^\d+$/.test(l)?Number(l):l)}function re(k){B.value=k,M("sharpen",Oe(k))}function ue(k){const l=i.modelValue[k];return l===void 0?"":String(l)}function ee(k,l){M(k,l===""?void 0:l==="true")}function de(k){M("name",(F.value||"{dir}/{name}")+"{"+k+"}")}function X(k){return"{"+k+"}"}return(k,l)=>(t(),s("div",gs,[n.isDefaults?d("",!0):(t(),s("div",hs,[e("label",bs,[l[13]||(l[13]=e("span",null,"Recipe name",-1)),e("input",{class:"input",spellcheck:"false",value:String(n.modelValue.id??""),onInput:l[0]||(l[0]=u=>M("id",u.target.value))},null,40,ys)]),n.presetNames&&n.presetNames.length?(t(),s("label",ks,[l[15]||(l[15]=e("span",null,"Based on preset",-1)),e("select",{class:"select",value:String(n.modelValue.preset??""),onChange:l[1]||(l[1]=u=>M("preset",u.target.value))},[l[14]||(l[14]=e("option",{value:""},"None",-1)),(t(!0),s(V,null,L(n.presetNames,u=>(t(),s("option",{key:u,value:u},a(u),9,_s))),128))],40,$s)])):d("",!0)])),e("div",ws,[l[21]||(l[21]=e("h4",null,"Size",-1)),e("div",Cs,[e("label",Ss,[l[16]||(l[16]=e("span",null,"Method",-1)),e("select",{class:"select",value:S.value,onChange:x},[(t(!0),s(V,null,L(n.options.sizeMethods,u=>(t(),s("option",{key:u,value:u},a(v[u]),9,xs))),128))],40,Vs)]),S.value==="size"?(t(),s("label",Es,[l[17]||(l[17]=e("span",null,"Box (width × height)",-1)),e("input",{class:"input",spellcheck:"false",value:String(n.modelValue.size??""),onInput:l[2]||(l[2]=u=>M("size",u.target.value))},null,40,zs)])):S.value!=="original"?(t(),s("label",As,[l[18]||(l[18]=e("span",null,"Values (comma-separated)",-1)),e("input",{class:ne(["input",{"input--bad":U.value}]),spellcheck:"false",value:z.value,onInput:l[3]||(l[3]=u=>C(u.target.value))},null,42,Ns)])):d("",!0),S.value==="size"?(t(),s("label",Bs,[l[19]||(l[19]=e("span",null,"How it fills the box",-1)),e("select",{class:"select",value:String(n.modelValue.fit??"inside"),onChange:l[4]||(l[4]=u=>M("fit",u.target.value))},[(t(!0),s(V,null,L(n.options.fitModes,u=>(t(),s("option",{key:u,value:u},a(u),9,js))),128))],40,Os)])):d("",!0)]),S.value==="size"?(t(),s("label",Ts,[e("input",{type:"checkbox",checked:n.modelValue.matchOrientation===!0,onChange:l[5]||(l[5]=u=>M("matchOrientation",u.target.checked||void 0))},null,40,Us),l[20]||(l[20]=E(" Turn the box around for portrait images ",-1))])):d("",!0)]),e("div",Is,[l[27]||(l[27]=e("h4",null,"Formats and quality",-1)),m.value?(t(),s("p",Ds," The formats of this recipe are set in a form the editor cannot show. Use the JSON tab. ")):(t(),s("div",Ms,[(t(!0),s(V,null,L(n.options.formats,u=>(t(),s("label",{key:u,class:ne(["pill",{"pill--on":h.value?.includes(u)}])},[e("input",{type:"checkbox",checked:h.value?.includes(u),onChange:H=>A(u)},null,40,Ls),E(" "+a(u),1)],2))),128)),h.value?d("",!0):(t(),s("span",Rs,"none chosen — inherited from the defaults"))])),e("div",Fs,[_.value?d("",!0):(t(),s("label",Ps,[l[24]||(l[24]=e("span",null,"Quality",-1)),e("select",{class:"select",value:$.value,onChange:l[6]||(l[6]=u=>P(u.target.value))},[l[22]||(l[22]=e("option",{value:""},"Default (high)",-1)),(t(!0),s(V,null,L(n.options.qualityLevels,u=>(t(),s("option",{key:u,value:u},a(u),9,Js))),128)),l[23]||(l[23]=e("option",{value:"custom"},"A number…",-1))],40,qs)])),$.value==="custom"?(t(),s("label",Ks,[l[25]||(l[25]=e("span",null,"Quality (1–100)",-1)),e("input",{class:"input",inputmode:"numeric",value:String(n.modelValue.quality),onInput:l[7]||(l[7]=u=>M("quality",Number(u.target.value)))},null,40,Hs)])):d("",!0),_.value?(t(),s("p",Ws," Quality is set per format here. Use the JSON tab to change it. ")):d("",!0),e("label",Gs,[l[26]||(l[26]=e("span",null,"Largest file size",-1)),e("input",{class:"input",spellcheck:"false",placeholder:"e.g. 200KB (optional)",value:J.value,onInput:l[8]||(l[8]=u=>le(u.target.value))},null,40,Qs)])])]),e("div",Ys,[l[28]||(l[28]=e("h4",null,"File names",-1)),e("input",{class:"input",spellcheck:"false",value:F.value,placeholder:n.options.defaultTemplates[S.value],"aria-label":"File name template",onInput:l[9]||(l[9]=u=>M("name",u.target.value))},null,40,Zs),e("div",Xs,[(t(!0),s(V,null,L(n.options.templateVariables,u=>(t(),s("button",{key:u,class:"pill pill--button",onClick:H=>de(u)},a(X(u)),9,el))),128))])]),e("div",tl,[l[29]||(l[29]=e("h4",null,"Sharpening",-1)),D.value||K.value?(t(),s("p",sl," This sharpening combines a preset with extra values. Use the JSON tab to edit it. ")):(t(),ae(Fe,{key:1,"model-value":B.value,options:n.options,"onUpdate:modelValue":re},null,8,["model-value","options"]))]),e("div",ll,[e("button",{class:"link",onClick:l[10]||(l[10]=u=>I.value=!I.value)},a(I.value?"Hide":"Show")+" advanced settings ",1),I.value?(t(),s("div",al,[(t(),s(V,null,L(N,u=>e("label",{key:u.key,class:"field"},[e("span",null,a(u.label),1),e("select",{class:"select",value:u.key==="rotate"?String(n.modelValue.rotate??""):String(n.modelValue[u.key]??""),onChange:H=>M(u.key,u.key==="rotate"&&H.target.value?Number(H.target.value):H.target.value)},[l[30]||(l[30]=e("option",{value:""},"Default",-1)),(t(!0),s(V,null,L(u.options,H=>(t(),s("option",{key:H,value:H},a(H),9,ol))),128))],40,nl)])),64)),(t(),s(V,null,L(y,u=>e("label",{key:u.key,class:"field"},[e("span",null,a(u.label),1),e("select",{class:"select",value:ue(u.key),onChange:H=>ee(u.key,H.target.value)},[...l[31]||(l[31]=[e("option",{value:""},"Default",-1),e("option",{value:"true"},"Yes",-1),e("option",{value:"false"},"No",-1)])],40,il)])),64)),e("label",ul,[l[32]||(l[32]=e("span",null,"Blur (sigma)",-1)),e("input",{class:"input",inputmode:"decimal",value:n.modelValue.blur===void 0?"":String(n.modelValue.blur),onInput:l[11]||(l[11]=u=>M("blur",u.target.value===""?void 0:Number(u.target.value)))},null,40,rl)]),e("label",dl,[l[33]||(l[33]=e("span",null,"Background (#rrggbb)",-1)),e("input",{class:"input",spellcheck:"false",value:String(n.modelValue.background??""),onInput:l[12]||(l[12]=u=>M("background",u.target.value))},null,40,cl)])])):d("",!0)])]))}}),je=ie(vl,[["__scopeId","data-v-6d67983e"]]),pl={class:"card block"},ml={class:"head"},fl={key:0,class:"muted"},gl={class:"grid"},hl={class:"field"},bl={class:"field"},yl={value:"project"},kl={class:"field"},$l=["value"],_l={class:"field"},wl=["value"],Cl={key:0,class:"notice"},Sl={class:"panel"},Vl={class:"panel__body"},xl={class:"recipes"},El={class:"panel__head"},zl=["onClick"],Al={class:"muted small"},Nl={class:"panel__actions"},Bl=["disabled","onClick"],Ol=["disabled","onClick"],jl=["onClick"],Tl=["onClick"],Ul={key:0,class:"panel__body"},Il=["value"],Dl={key:0,class:"notice notice--error"},Ml={key:0,class:"lines"},Ll={key:3,class:"notice notice--error"},Rl={class:"actions"},Fl=["disabled"],Pl=oe({__name:"ConfigEditor",props:{options:{},initial:{},copyOf:{}},emits:["saved","cancel"],setup(n,{emit:b}){const i=n,f=b,v=he(Ee,Re),N=c(i.initial!==void 0),y=c(i.copyOf?structuredClone(i.copyOf.raw):ms()),z=c(i.initial?i.initial.name:i.copyOf?`${i.copyOf.name}-copy`:""),U=c(i.initial?.scope??"project"),I=c("form"),D=c(""),B=c(""),S=c(),h=c(""),m=c(!1),r=c(0);let _;const $=T(()=>Array.isArray(y.value.outputs)?y.value.outputs:[]),F=T(()=>y.value.defaults&&typeof y.value.defaults=="object"?y.value.defaults:{}),J=T(()=>y.value.presets&&typeof y.value.presets=="object"?Object.keys(y.value.presets):[]),K=T(()=>{const w=[];return J.value.length&&w.push(`${J.value.length} preset(s)`),Array.isArray(y.value.match)&&y.value.match.length&&w.push(`${y.value.match.length} rule(s)`),y.value.placeholders&&w.push("placeholders"),w}),M=T(()=>(S.value?.lines??[]).join(`
1
+ import{d as oe,D as De,b as t,e as s,F as V,g as L,x as ne,t as a,E as Me,_ as ie,o as pe,f as e,k as d,l as E,u as Q,G as ce,H as et,y as R,z as se,j as q,m as Z,I as fe,i as be,p as ae,r as c,c as T,v as Y,J as tt,K as he,w as ye,a as Ve,A as ve,C as Le,n as Se,B as st,L as Ae}from"./index-Dzvs2f2Q.js";import{F as xe,S as lt}from"./SourcePicker-eKj_VZzO.js";const at=["aria-label"],nt=["aria-checked","title","onClick"],ot=oe({__name:"UiSegmented",props:Me({options:{},label:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const b=De(n,"modelValue");return(i,f)=>(t(),s("div",{class:"seg",role:"radiogroup","aria-label":n.label},[(t(!0),s(V,null,L(n.options,v=>(t(),s("button",{key:v.value,class:ne(["seg__btn",{"seg__btn--on":b.value===v.value}]),role:"radio","aria-checked":b.value===v.value,title:v.hint,onClick:N=>b.value=v.value},a(v.label),11,nt))),128))],8,at))}}),ge=ie(ot,[["__scopeId","data-v-56d7f4ee"]]),it={class:"view"},ut={key:0,class:"card block"},rt={key:0,class:"notice"},dt={key:1,class:"notice notice--error"},ct={key:2,class:"muted"},vt={class:"list"},pt={class:"item__main"},mt={class:"muted"},ft=["title"],gt={class:"item__actions"},ht=["onClick"],bt=["onClick"],yt={class:"custom"},kt=["disabled"],$t={key:1,class:"card block"},_t={class:"head"},wt={class:"muted"},Ct={class:"item__path"},St={key:0,class:"notice"},Vt={key:1,class:"notice notice--error"},xt={class:"chips"},Et={key:2,class:"notice notice--warn"},zt={class:"actions"},At=["disabled"],Nt={key:0,class:"check"},Bt={class:"rows"},Ot=["src"],jt=["src"],Tt={class:"row__text"},Ut=["title"],It={class:"muted small"},Dt={key:0,class:"small row__message"},Mt={key:3,class:"actions"},Lt={key:4,class:"muted small"},Ne="mediatoolz-ui.open-backup",Ce=30,Rt=oe({__name:"BackupsView",props:{cwd:{}},setup(n){const b={restored:"restored","would-restore":"can be restored",modified:"changed since","missing-backup":"copy missing","damaged-backup":"copy damaged",error:"error"},i=c(""),f=c([]),v=c(),N=c(""),y=c(""),z=c(!1),U=c(!1),I=c(Ce),D=c(""),B=c(!1),S=T(()=>{const x=v.value?.counts;return x?x.modified+x["missing-backup"]+x["damaged-backup"]+x.error:0}),h=T(()=>v.value?.counts["would-restore"]??0),m=T(()=>v.value?.entries.slice(0,I.value)??[]);function r(x){const C=new Date(x);return Number.isNaN(C.getTime())?x:C.toLocaleString()}function _(x){return x==="would-restore"||x==="restored"?"good":x==="modified"?"warn":"bad"}function $(x){N.value=x instanceof Error?x.message:String(x)}async function F(){try{const x=await Y.get("/api/image-batch/backups");i.value=x.root,f.value=x.backups}catch(x){$(x)}}async function J(x){N.value="",y.value="",U.value=!1,I.value=Ce;try{v.value=await Y.get(`/api/image-batch/backup?dir=${encodeURIComponent(x)}`)}catch(C){v.value=void 0,$(C)}}function K(x){const C=x?.[0]??D.value;B.value=!1,C.trim()!==""&&(D.value=C,J(C))}async function M(){const x=v.value;if(!x)return;const C=U.value?x.files:h.value;if(window.confirm(`Put back ${C} original file${C===1?"":"s"} from this backup?`+(U.value?" Files changed after the replacement will be overwritten too.":""))){z.value=!0;try{const P=await Y.post("/api/image-batch/backup/restore",{dir:x.dir,force:U.value});y.value=`Restored ${P.counts.restored} file${P.counts.restored===1?"":"s"}.`,await J(x.dir)}catch(P){$(P)}finally{z.value=!1}}}async function te(x){if(window.confirm("Delete this backup for good? The saved originals cannot be recovered afterwards."))try{await Y.post("/api/image-batch/backup/delete",{dir:x}),y.value="The backup was deleted.",v.value?.dir===x&&(v.value=void 0),await F()}catch(C){$(C)}}return pe(async()=>{await F();try{const x=localStorage.getItem(Ne);x&&(localStorage.removeItem(Ne),await J(x))}catch{v.value=void 0}}),(x,C)=>(t(),s("div",it,[v.value?(t(),s("section",$t,[e("div",_t,[e("div",null,[e("h2",null,"Backup of "+a(r(v.value.createdAt)),1),e("p",wt,a(v.value.files)+" file"+a(v.value.files===1?"":"s")+" · "+a(Q(ce)(v.value.bytesBefore))+" originals, "+a(Q(ce)(v.value.bytesAfter))+" after the replacement ",1),e("code",Ct,a(v.value.dir),1)]),e("button",{class:"btn btn--ghost",onClick:C[3]||(C[3]=A=>(v.value=void 0,F()))},[q(Z,{name:"close",size:16}),C[15]||(C[15]=E(" Back to the list ",-1))])]),y.value?(t(),s("p",St,a(y.value),1)):d("",!0),N.value?(t(),s("p",Vt,a(N.value),1)):d("",!0),e("div",xt,[(t(!0),s(V,null,L(v.value.counts,(A,P)=>R((t(),s("span",{key:P,class:ne(["chip",`chip--${_(P)}`])},a(A)+" "+a(b[P]),3)),[[tt,A>0]])),128))]),v.value.counts.modified?(t(),s("p",Et,a(v.value.counts.modified)+" file"+a(v.value.counts.modified===1?" was":"s were")+" changed after the replacement. They are left alone unless you tick the box below. ",1)):d("",!0),e("div",zt,[e("button",{class:"btn btn--primary",disabled:z.value||h.value===0&&!U.value,onClick:M}," Restore "+a(U.value?"everything":`${h.value} file${h.value===1?"":"s"}`),9,At),v.value.counts.modified?(t(),s("label",Nt,[R(e("input",{"onUpdate:modelValue":C[4]||(C[4]=A=>U.value=A),type:"checkbox"},null,512),[[fe,U.value]]),C[16]||(C[16]=E(" Overwrite files that changed since ",-1))])):d("",!0),e("button",{class:"btn btn--danger",onClick:C[5]||(C[5]=A=>te(v.value.dir))},"Delete this backup")]),e("ul",Bt,[(t(!0),s(V,null,L(m.value,A=>(t(),s("li",{key:A.path,class:"row"},[e("img",{class:"row__thumb",loading:"lazy",alt:"Original",src:Q(be)(A.backup,120)},null,8,Ot),C[17]||(C[17]=e("span",{class:"row__arrow muted"},"⇄",-1)),e("img",{class:"row__thumb",loading:"lazy",alt:"Now",src:Q(be)(A.path,120)},null,8,jt),e("div",Tt,[e("span",{class:"row__name",title:A.path},a(A.path),9,Ut),e("span",It," original "+a(Q(ce)(A.bytesBefore))+" · replaced with "+a(Q(ce)(A.bytesAfter)),1),A.message?(t(),s("span",Dt,a(A.message),1)):d("",!0)]),e("span",{class:ne(["chip",`chip--${_(A.status)}`])},a(b[A.status]),3)]))),128))]),v.value&&I.value<v.value.entries.length?(t(),s("div",Mt,[e("button",{class:"btn",onClick:C[6]||(C[6]=A=>I.value+=Ce)}," Show more ("+a(v.value.entries.length-I.value)+" left) ",1),e("button",{class:"btn",onClick:C[7]||(C[7]=A=>I.value=v.value.entries.length)}," Show all ("+a(v.value.entries.length)+") ",1)])):d("",!0),S.value?(t(),s("p",Lt," The left picture is the saved original, the right one is the file as it is now on disk. ")):d("",!0)])):(t(),s("section",ut,[C[14]||(C[14]=e("div",{class:"head"},[e("div",null,[e("h2",null,"Backups"),e("p",{class:"muted"}," “Replace the originals” copies each file here first, so a replacement can be undone. ")])],-1)),y.value?(t(),s("p",rt,a(y.value),1)):d("",!0),N.value?(t(),s("p",dt,a(N.value),1)):d("",!0),f.value.length===0?(t(),s("p",ct,[C[9]||(C[9]=E(" No backups in ",-1)),e("code",null,a(i.value),1),C[10]||(C[10]=E(" yet. ",-1))])):d("",!0),e("ul",vt,[(t(!0),s(V,null,L(f.value,A=>(t(),s("li",{key:A.dir,class:"item"},[e("div",pt,[e("strong",null,a(r(A.createdAt)),1),e("span",mt,a(A.files)+" file"+a(A.files===1?"":"s")+" · "+a(Q(ce)(A.bytesBefore))+" → "+a(Q(ce)(A.bytesAfter)),1),e("code",{class:"item__path",title:A.dir},a(A.dir),9,ft)]),e("div",gt,[e("button",{class:"btn btn--small",onClick:P=>J(A.dir)},"Open",8,ht),e("button",{class:"btn btn--small btn--danger",onClick:P=>te(A.dir)},"Delete",8,bt)])]))),128))]),e("div",yt,[C[12]||(C[12]=e("h3",null,"Another backup folder",-1)),C[13]||(C[13]=e("p",{class:"muted small"},[E(" If you chose your own backup folder, pick the dated folder inside it (the one with a "),e("code",null,"journal.json"),E("). ")],-1)),e("form",{class:"pathrow",onSubmit:C[2]||(C[2]=et(A=>K(),["prevent"]))},[R(e("input",{"onUpdate:modelValue":C[0]||(C[0]=A=>D.value=A),class:"input",spellcheck:"false",placeholder:"Path to the dated backup folder"},null,512),[[se,D.value]]),e("button",{class:"btn",type:"button",onClick:C[1]||(C[1]=A=>B.value=!0)},[q(Z,{name:"folder",size:16}),C[11]||(C[11]=E(" Browse ",-1))]),e("button",{class:"btn btn--primary",type:"submit",disabled:D.value.trim()===""}," Open ",8,kt)],32)])])),B.value?(t(),ae(xe,{key:2,start:n.cwd,mode:"folder",title:"Choose the backup folder",onClose:C[8]||(C[8]=A=>B.value=!1),onConfirm:K},null,8,["start"])):d("",!0)]))}}),Ft=ie(Rt,[["__scopeId","data-v-1e694fea"]]),ke=Symbol("image-batch-navigate"),Ee=Symbol("image-batch-project"),Re={cwd:"",name:"this project",home:""};function Pt(n,b){const i=n.split(/[\\/]/).filter(Boolean);return{cwd:n,home:b,name:i[i.length-1]??n}}const qt={class:"sharpen"},Jt={key:0,class:"grid"},Kt={class:"field"},Ht=["value"],Wt=["value"],Gt={key:1,class:"hint muted"},Qt={class:"grid"},Yt={class:"field"},Zt=["value"],Xt=["value"],es={class:"field"},ts=["value"],ss=["value"],ls={key:0,class:"grid"},as={class:"muted"},ns=["value","onInput"],os=oe({__name:"SharpenSettings",props:Me({options:{},manage:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const b=n,i=he(ke,()=>{}),f=De(n,"modelValue"),v=c([]),N=c(!1),y=T(()=>v.value.filter(S=>!S.error)),z=T(()=>v.value.find(S=>S.name===f.value.preset));function U(S){const h=S.fields??{};return Object.entries(h).map(([m,r])=>`${m} ${r}`).join(", ")}function I(S){f.value={...f.value,mode:S},S==="preset"&&!f.value.preset&&y.value[0]&&(f.value={...f.value,mode:S,preset:y.value[0].name})}function D(S,h){f.value={...f.value,fine:{...f.value.fine,[S]:h}}}function B(S){const h=b.options.sharpen.fine.find(m=>m.key===S);return h?`${h.range[0]}–${h.range[1]}`:""}return pe(async()=>{try{v.value=await Y.get("/api/image-batch/sharpen-presets")}catch{v.value=[]}}),(S,h)=>(t(),s("div",qt,[q(ge,{"model-value":f.value.mode,label:"Sharpening",options:[{value:"none",label:"None"},{value:"preset",label:"Saved preset"},{value:"custom",label:"Custom"}],"onUpdate:modelValue":I},null,8,["model-value"]),f.value.mode==="preset"?(t(),s("div",Jt,[e("label",Kt,[h[5]||(h[5]=e("span",null,"Preset",-1)),e("select",{class:"select",value:f.value.preset,onChange:h[0]||(h[0]=m=>f.value={...f.value,preset:m.target.value})},[(t(!0),s(V,null,L(y.value,m=>(t(),s("option",{key:m.name,value:m.name},a(m.name)+" · "+a(m.scope),9,Wt))),128))],40,Ht)]),n.manage?(t(),s("button",{key:0,class:"link",onClick:h[1]||(h[1]=m=>Q(i)("sharpen"))},"Manage presets")):d("",!0),z.value?(t(),s("p",Gt,[z.value.description?(t(),s(V,{key:0},[E(a(z.value.description)+" — ",1)],64)):d("",!0),E(" "+a(U(z.value)),1)])):d("",!0)])):d("",!0),f.value.mode==="custom"?(t(),s(V,{key:1},[e("div",Qt,[e("label",Yt,[h[6]||(h[6]=e("span",null,"Sharpen for",-1)),e("select",{class:"select",value:f.value.for,onChange:h[2]||(h[2]=m=>f.value={...f.value,for:m.target.value})},[(t(!0),s(V,null,L(n.options.sharpen.targets,m=>(t(),s("option",{key:m,value:m},a(m),9,Xt))),128))],40,Zt)]),e("label",es,[h[7]||(h[7]=e("span",null,"Amount",-1)),e("select",{class:"select",value:f.value.amount,onChange:h[3]||(h[3]=m=>f.value={...f.value,amount:m.target.value})},[(t(!0),s(V,null,L(n.options.sharpen.amounts,m=>(t(),s("option",{key:m,value:m},a(m),9,ss))),128))],40,ts)])]),e("button",{class:"link",onClick:h[4]||(h[4]=m=>N.value=!N.value)},a(N.value?"Hide":"Show")+" fine settings ",1),N.value?(t(),s("div",ls,[(t(!0),s(V,null,L(n.options.sharpen.fine,m=>(t(),s("label",{key:m.key,class:"field"},[e("span",null,[E(a(m.key)+" ",1),e("small",as,"("+a(B(m.key))+")",1)]),e("input",{class:"input",inputmode:"decimal",placeholder:"table value",value:f.value.fine[m.key],onInput:r=>D(m.key,r.target.value)},null,40,ns)]))),128))])):d("",!0)],64)):d("",!0)]))}}),Fe=ie(os,[["__scopeId","data-v-1d132e3d"]]);function Pe(){return{mode:"none",preset:"",for:"screen",amount:"standard",fine:{radius:"",flat:"",jagged:"",threshold:""}}}function is(n){if(n.mode==="none")return;if(n.mode==="preset")return n.preset?{preset:n.preset}:void 0;const b={for:n.for,amount:n.amount};for(const[i,f]of Object.entries(n.fine))f.trim()!==""&&(b[i]=Number(f));return b}const qe=["widths","heights","size","longEdge","shortEdge","megapixels","percent"],us={widths:[800,1600],heights:[600],size:"1920x1080",longEdge:[1600],shortEdge:[1080],megapixels:[2],percent:[50]};function rs(n,b,i){const f={...n};return i===void 0||i===""||Array.isArray(i)&&i.length===0||typeof i=="number"&&Number.isNaN(i)?delete f[b]:f[b]=i,f}function ds(n){for(const b of qe)if(n[b]!==void 0)return b;return"original"}function cs(n,b){const i={...n};for(const f of qe)delete i[f];return delete i.matchOrientation,b!=="original"&&(i[b]=us[b]),i}function vs(n,b){if(b==="original")return"";const i=n[b];return Array.isArray(i)?i.join(", "):String(i??"")}function ps(n){const b=n.split(/[,\s]+/).filter(Boolean);if(b.length===0)return[];const i=b.map(Number);return i.some(f=>!Number.isFinite(f))?void 0:i}function Be(n){const b=Pe();if(n==null)return{state:b,lossy:!1};if(typeof n=="string")return{state:{...b,mode:"preset",preset:n},lossy:!1};if(typeof n!="object"||Array.isArray(n))return{state:b,lossy:!0};const i=n;if(typeof i.preset=="string")return Object.keys(i).filter(N=>N!=="preset").length===0?{state:{...b,mode:"preset",preset:i.preset},lossy:!1}:{state:{...b,mode:"preset",preset:i.preset},lossy:!0};const f={...b,mode:"custom"};typeof i.for=="string"&&(f.for=i.for),typeof i.amount=="string"&&(f.amount=i.amount);for(const v of["radius","flat","jagged","threshold"])i[v]!==void 0&&(f.fine[v]=String(i[v]));return{state:f,lossy:!1}}function Oe(n){if(n.mode==="none")return;if(n.mode==="preset")return n.preset||void 0;const b={for:n.for,amount:n.amount};for(const[i,f]of Object.entries(n.fine))f.trim()!==""&&(b[i]=Number(f));return b}function ms(){return{name:"New config",outputs:[{id:"responsive",widths:[400,800,1200],formats:["webp","jpg"],quality:"high"}]}}function fs(n){return{id:`recipe-${n}`,widths:[800],formats:["webp"],quality:"high"}}const gs={class:"recipe"},hs={key:0,class:"grid"},bs={class:"field"},ys=["value"],ks={key:0,class:"field"},$s=["value"],_s=["value"],ws={class:"group"},Cs={class:"grid"},Ss={class:"field"},Vs=["value"],xs=["value"],Es={key:0,class:"field"},zs=["value"],As={key:1,class:"field"},Ns=["value"],Bs={key:2,class:"field"},Os=["value"],js=["value"],Ts={key:0,class:"check"},Us=["checked"],Is={class:"group"},Ds={key:0,class:"notice notice--warn"},Ms={key:1,class:"pills"},Ls=["checked","onChange"],Rs={key:0,class:"muted small"},Fs={class:"grid"},Ps={key:0,class:"field"},qs=["value"],Js=["value"],Ks={key:1,class:"field"},Hs=["value"],Ws={key:2,class:"notice notice--warn"},Gs={class:"field"},Qs=["value"],Ys={class:"group"},Zs=["value","placeholder"],Xs={class:"pills"},el=["onClick"],tl={class:"group"},sl={key:0,class:"notice notice--warn"},ll={class:"group"},al={key:0,class:"grid"},nl=["value","onChange"],ol=["value"],il=["value","onChange"],ul={class:"field"},rl=["value"],dl={class:"field"},cl=["value"],vl=oe({__name:"RecipeForm",props:{modelValue:{},options:{},presetNames:{},isDefaults:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:b}){const i=n,f=b,v={original:"Keep the original size",widths:"By width (px)",heights:"By height (px)",size:"Fit into a box",longEdge:"By the long side (px)",shortEdge:"By the short side (px)",megapixels:"By area (megapixels)",percent:"By percentage"},N=[{key:"metadata",label:"Metadata",options:["strip","keep","keep-icc"]},{key:"rotate",label:"Rotate (degrees)",options:["90","180","270"]}],y=[{key:"withoutEnlargement",label:"Never enlarge"},{key:"autoOrient",label:"Turn by EXIF orientation"},{key:"grayscale",label:"Grayscale"},{key:"flip",label:"Flip vertically"},{key:"flop",label:"Mirror horizontally"}],z=c(""),U=c(!1),I=c(!1),D=c(!1),B=c(Be(i.modelValue.sharpen).state),S=T(()=>ds(i.modelValue)),h=T(()=>Array.isArray(i.modelValue.formats)?i.modelValue.formats:void 0),m=T(()=>i.modelValue.formats!==void 0&&h.value===void 0),r=T(()=>i.modelValue.quality),_=T(()=>r.value!==void 0&&typeof r.value=="object"),$=T(()=>{const k=r.value;return k===void 0?"":typeof k=="number"?"custom":String(k)}),F=T(()=>typeof i.modelValue.name=="string"?i.modelValue.name:""),J=T(()=>i.modelValue.maxBytes===void 0?"":String(i.modelValue.maxBytes)),K=T(()=>{const k=i.modelValue.sharpen;return k!==void 0&&typeof k!="string"&&typeof k!="object"});function M(k,l){f("update:modelValue",rs(i.modelValue,k,l))}function te(){z.value=vs(i.modelValue,S.value),U.value=!1}ye(S,te,{immediate:!0}),ye(()=>i.modelValue.sharpen,k=>{const l=Be(k);D.value=l.lossy,JSON.stringify(Oe(B.value))!==JSON.stringify(k)&&(B.value=l.state)},{immediate:!0});function x(k){f("update:modelValue",cs(i.modelValue,k.target.value))}function C(k){z.value=k;const l=ps(k);U.value=l===void 0,l&&l.length>0&&S.value!=="original"&&S.value!=="size"&&M(S.value,l)}function A(k){const l=h.value??[];M("formats",l.includes(k)?l.filter(u=>u!==k):[...l,k])}function P(k){k===""?M("quality",void 0):k==="custom"?M("quality",82):M("quality",k)}function le(k){const l=k.trim();l===""?M("maxBytes",void 0):M("maxBytes",/^\d+$/.test(l)?Number(l):l)}function re(k){B.value=k,M("sharpen",Oe(k))}function ue(k){const l=i.modelValue[k];return l===void 0?"":String(l)}function ee(k,l){M(k,l===""?void 0:l==="true")}function de(k){M("name",(F.value||"{dir}/{name}")+"{"+k+"}")}function X(k){return"{"+k+"}"}return(k,l)=>(t(),s("div",gs,[n.isDefaults?d("",!0):(t(),s("div",hs,[e("label",bs,[l[13]||(l[13]=e("span",null,"Recipe name",-1)),e("input",{class:"input",spellcheck:"false",value:String(n.modelValue.id??""),onInput:l[0]||(l[0]=u=>M("id",u.target.value))},null,40,ys)]),n.presetNames&&n.presetNames.length?(t(),s("label",ks,[l[15]||(l[15]=e("span",null,"Based on preset",-1)),e("select",{class:"select",value:String(n.modelValue.preset??""),onChange:l[1]||(l[1]=u=>M("preset",u.target.value))},[l[14]||(l[14]=e("option",{value:""},"None",-1)),(t(!0),s(V,null,L(n.presetNames,u=>(t(),s("option",{key:u,value:u},a(u),9,_s))),128))],40,$s)])):d("",!0)])),e("div",ws,[l[21]||(l[21]=e("h4",null,"Size",-1)),e("div",Cs,[e("label",Ss,[l[16]||(l[16]=e("span",null,"Method",-1)),e("select",{class:"select",value:S.value,onChange:x},[(t(!0),s(V,null,L(n.options.sizeMethods,u=>(t(),s("option",{key:u,value:u},a(v[u]),9,xs))),128))],40,Vs)]),S.value==="size"?(t(),s("label",Es,[l[17]||(l[17]=e("span",null,"Box (width × height)",-1)),e("input",{class:"input",spellcheck:"false",value:String(n.modelValue.size??""),onInput:l[2]||(l[2]=u=>M("size",u.target.value))},null,40,zs)])):S.value!=="original"?(t(),s("label",As,[l[18]||(l[18]=e("span",null,"Values (comma-separated)",-1)),e("input",{class:ne(["input",{"input--bad":U.value}]),spellcheck:"false",value:z.value,onInput:l[3]||(l[3]=u=>C(u.target.value))},null,42,Ns)])):d("",!0),S.value==="size"?(t(),s("label",Bs,[l[19]||(l[19]=e("span",null,"How it fills the box",-1)),e("select",{class:"select",value:String(n.modelValue.fit??"inside"),onChange:l[4]||(l[4]=u=>M("fit",u.target.value))},[(t(!0),s(V,null,L(n.options.fitModes,u=>(t(),s("option",{key:u,value:u},a(u),9,js))),128))],40,Os)])):d("",!0)]),S.value==="size"?(t(),s("label",Ts,[e("input",{type:"checkbox",checked:n.modelValue.matchOrientation===!0,onChange:l[5]||(l[5]=u=>M("matchOrientation",u.target.checked||void 0))},null,40,Us),l[20]||(l[20]=E(" Turn the box around for portrait images ",-1))])):d("",!0)]),e("div",Is,[l[27]||(l[27]=e("h4",null,"Formats and quality",-1)),m.value?(t(),s("p",Ds," The formats of this recipe are set in a form the editor cannot show. Use the JSON tab. ")):(t(),s("div",Ms,[(t(!0),s(V,null,L(n.options.formats,u=>(t(),s("label",{key:u,class:ne(["pill",{"pill--on":h.value?.includes(u)}])},[e("input",{type:"checkbox",checked:h.value?.includes(u),onChange:H=>A(u)},null,40,Ls),E(" "+a(u),1)],2))),128)),h.value?d("",!0):(t(),s("span",Rs,"none chosen — inherited from the defaults"))])),e("div",Fs,[_.value?d("",!0):(t(),s("label",Ps,[l[24]||(l[24]=e("span",null,"Quality",-1)),e("select",{class:"select",value:$.value,onChange:l[6]||(l[6]=u=>P(u.target.value))},[l[22]||(l[22]=e("option",{value:""},"Default (high)",-1)),(t(!0),s(V,null,L(n.options.qualityLevels,u=>(t(),s("option",{key:u,value:u},a(u),9,Js))),128)),l[23]||(l[23]=e("option",{value:"custom"},"A number…",-1))],40,qs)])),$.value==="custom"?(t(),s("label",Ks,[l[25]||(l[25]=e("span",null,"Quality (1–100)",-1)),e("input",{class:"input",inputmode:"numeric",value:String(n.modelValue.quality),onInput:l[7]||(l[7]=u=>M("quality",Number(u.target.value)))},null,40,Hs)])):d("",!0),_.value?(t(),s("p",Ws," Quality is set per format here. Use the JSON tab to change it. ")):d("",!0),e("label",Gs,[l[26]||(l[26]=e("span",null,"Largest file size",-1)),e("input",{class:"input",spellcheck:"false",placeholder:"e.g. 200KB (optional)",value:J.value,onInput:l[8]||(l[8]=u=>le(u.target.value))},null,40,Qs)])])]),e("div",Ys,[l[28]||(l[28]=e("h4",null,"File names",-1)),e("input",{class:"input",spellcheck:"false",value:F.value,placeholder:n.options.defaultTemplates[S.value],"aria-label":"File name template",onInput:l[9]||(l[9]=u=>M("name",u.target.value))},null,40,Zs),e("div",Xs,[(t(!0),s(V,null,L(n.options.templateVariables,u=>(t(),s("button",{key:u,class:"pill pill--button",onClick:H=>de(u)},a(X(u)),9,el))),128))])]),e("div",tl,[l[29]||(l[29]=e("h4",null,"Sharpening",-1)),D.value||K.value?(t(),s("p",sl," This sharpening combines a preset with extra values. Use the JSON tab to edit it. ")):(t(),ae(Fe,{key:1,"model-value":B.value,options:n.options,"onUpdate:modelValue":re},null,8,["model-value","options"]))]),e("div",ll,[e("button",{class:"link",onClick:l[10]||(l[10]=u=>I.value=!I.value)},a(I.value?"Hide":"Show")+" advanced settings ",1),I.value?(t(),s("div",al,[(t(),s(V,null,L(N,u=>e("label",{key:u.key,class:"field"},[e("span",null,a(u.label),1),e("select",{class:"select",value:u.key==="rotate"?String(n.modelValue.rotate??""):String(n.modelValue[u.key]??""),onChange:H=>M(u.key,u.key==="rotate"&&H.target.value?Number(H.target.value):H.target.value)},[l[30]||(l[30]=e("option",{value:""},"Default",-1)),(t(!0),s(V,null,L(u.options,H=>(t(),s("option",{key:H,value:H},a(H),9,ol))),128))],40,nl)])),64)),(t(),s(V,null,L(y,u=>e("label",{key:u.key,class:"field"},[e("span",null,a(u.label),1),e("select",{class:"select",value:ue(u.key),onChange:H=>ee(u.key,H.target.value)},[...l[31]||(l[31]=[e("option",{value:""},"Default",-1),e("option",{value:"true"},"Yes",-1),e("option",{value:"false"},"No",-1)])],40,il)])),64)),e("label",ul,[l[32]||(l[32]=e("span",null,"Blur (sigma)",-1)),e("input",{class:"input",inputmode:"decimal",value:n.modelValue.blur===void 0?"":String(n.modelValue.blur),onInput:l[11]||(l[11]=u=>M("blur",u.target.value===""?void 0:Number(u.target.value)))},null,40,rl)]),e("label",dl,[l[33]||(l[33]=e("span",null,"Background (#rrggbb)",-1)),e("input",{class:"input",spellcheck:"false",value:String(n.modelValue.background??""),onInput:l[12]||(l[12]=u=>M("background",u.target.value))},null,40,cl)])])):d("",!0)])]))}}),je=ie(vl,[["__scopeId","data-v-6d67983e"]]),pl={class:"card block"},ml={class:"head"},fl={key:0,class:"muted"},gl={class:"grid"},hl={class:"field"},bl={class:"field"},yl={value:"project"},kl={class:"field"},$l=["value"],_l={class:"field"},wl=["value"],Cl={key:0,class:"notice"},Sl={class:"panel"},Vl={class:"panel__body"},xl={class:"recipes"},El={class:"panel__head"},zl=["onClick"],Al={class:"muted small"},Nl={class:"panel__actions"},Bl=["disabled","onClick"],Ol=["disabled","onClick"],jl=["onClick"],Tl=["onClick"],Ul={key:0,class:"panel__body"},Il=["value"],Dl={key:0,class:"notice notice--error"},Ml={key:0,class:"lines"},Ll={key:3,class:"notice notice--error"},Rl={class:"actions"},Fl=["disabled"],Pl=oe({__name:"ConfigEditor",props:{options:{},initial:{},copyOf:{}},emits:["saved","cancel"],setup(n,{emit:b}){const i=n,f=b,v=he(Ee,Re),N=c(i.initial!==void 0),y=c(i.copyOf?structuredClone(i.copyOf.raw):ms()),z=c(i.initial?i.initial.name:i.copyOf?`${i.copyOf.name}-copy`:""),U=c(i.initial?.scope??"project"),I=c("form"),D=c(""),B=c(""),S=c(),h=c(""),m=c(!1),r=c(0);let _;const $=T(()=>Array.isArray(y.value.outputs)?y.value.outputs:[]),F=T(()=>y.value.defaults&&typeof y.value.defaults=="object"?y.value.defaults:{}),J=T(()=>y.value.presets&&typeof y.value.presets=="object"?Object.keys(y.value.presets):[]),K=T(()=>{const w=[];return J.value.length&&w.push(`${J.value.length} preset(s)`),Array.isArray(y.value.match)&&y.value.match.length&&w.push(`${y.value.match.length} rule(s)`),y.value.placeholders&&w.push("placeholders"),w}),M=T(()=>(S.value?.lines??[]).join(`
2
2
  `)),te=T(()=>!m.value&&z.value.trim()!==""&&S.value?.ok===!0&&B.value==="");function x(w){y.value=w}function C(w,g){const j={...y.value};g.trim()===""?delete j[w]:j[w]=g,x(j)}function A(w){const g={...y.value};Object.keys(w).length===0?delete g.defaults:g.defaults=w,x(g)}function P(w,g){const j=[...$.value];j[w]=g,x({...y.value,outputs:j})}function le(){x({...y.value,outputs:[...$.value,fs($.value.length+1)]}),r.value=$.value.length}function re(w){x({...y.value,outputs:$.value.filter((g,j)=>j!==w)}),r.value=Math.max(0,r.value-1)}function ue(w){const g=structuredClone($.value[w]??{});typeof g.id=="string"&&(g.id=`${g.id}-copy`);const j=[...$.value];j.splice(w+1,0,g),x({...y.value,outputs:j}),r.value=w+1}function ee(w,g){const j=w+g;if(j<0||j>=$.value.length)return;const W=[...$.value],[G]=W.splice(w,1);W.splice(j,0,G),x({...y.value,outputs:W}),r.value=j}function de(w,g){return typeof w.id=="string"&&w.id?w.id:`Recipe ${g+1}`}function X(w){const g=[];for(const j of["widths","heights","longEdge","shortEdge","megapixels","percent"])Array.isArray(w[j])&&g.push(`${j} ${w[j].join(", ")}`);return typeof w.size=="string"&&g.push(`box ${w.size}`),Array.isArray(w.formats)&&g.push(w.formats.join("/")),g.join(" · ")}function k(w){D.value=w;try{const g=JSON.parse(w);if(g===null||typeof g!="object"||Array.isArray(g)){B.value="A config is a JSON object.";return}B.value="",y.value=g}catch(g){B.value=g instanceof Error?g.message:String(g)}}function l(w){if(w==="json"){D.value=JSON.stringify(y.value,null,2),B.value="",I.value="json";return}B.value||(I.value="form")}async function u(){try{S.value=await Y.post("/api/image-batch/config/validate",{raw:y.value})}catch(w){S.value={ok:!1,error:w instanceof Error?w.message:String(w)}}}ye(y,()=>{clearTimeout(_),_=setTimeout(()=>{u()},350)},{deep:!0});async function H(w=!1){m.value=!0,h.value="";try{await Y.post("/api/image-batch/config/save",{name:z.value,scope:U.value,raw:y.value,overwrite:w,...i.initial?{originalName:i.initial.name,originalScope:i.initial.scope}:{}}),f("saved",z.value)}catch(g){if(g instanceof Le&&g.status===409&&g.body.exists===!0){if(window.confirm(`${g.message}. Replace it?`)){await H(!0);return}}else h.value=g instanceof Error?g.message:String(g)}finally{m.value=!1}}return pe(async()=>{if(i.initial)try{const w=await Y.get(`/api/image-batch/config?name=${encodeURIComponent(i.initial.name)}&scope=${i.initial.scope}`);y.value=w.raw}catch(w){h.value=w instanceof Error?w.message:String(w)}finally{N.value=!1}u()}),Ve(()=>clearTimeout(_)),(w,g)=>(t(),s("section",pl,[e("div",ml,[e("h2",null,a(n.initial?`Edit ${n.initial.name}`:n.copyOf?"Copy of a config":"New config"),1),e("button",{class:"btn btn--ghost",onClick:g[0]||(g[0]=j=>f("cancel"))},[q(Z,{name:"close",size:16}),g[8]||(g[8]=E(" Close ",-1))])]),N.value?(t(),s("p",fl,"Loading…")):(t(),s(V,{key:1},[e("div",gl,[e("label",hl,[g[9]||(g[9]=e("span",null,"File name",-1)),R(e("input",{"onUpdate:modelValue":g[1]||(g[1]=j=>z.value=j),class:"input",spellcheck:"false",placeholder:"web"},null,512),[[se,z.value]])]),e("label",bl,[g[11]||(g[11]=e("span",null,"Where to keep it",-1)),R(e("select",{"onUpdate:modelValue":g[2]||(g[2]=j=>U.value=j),class:"select"},[e("option",yl,"This project ("+a(Q(v).name)+")",1),g[10]||(g[10]=e("option",{value:"global"},"All projects (your home folder)",-1))],512),[[ve,U.value]])]),e("label",kl,[g[12]||(g[12]=e("span",null,"Title",-1)),e("input",{class:"input",value:String(y.value.name??""),onInput:g[3]||(g[3]=j=>C("name",j.target.value))},null,40,$l)]),e("label",_l,[g[13]||(g[13]=e("span",null,"Description",-1)),e("input",{class:"input",value:String(y.value.description??""),onInput:g[4]||(g[4]=j=>C("description",j.target.value))},null,40,wl)])]),q(ge,{"model-value":I.value,label:"Editor mode",options:[{value:"form",label:"Form"},{value:"json",label:"JSON"}],"onUpdate:modelValue":l},null,8,["model-value"]),I.value==="form"?(t(),s(V,{key:0},[K.value.length?(t(),s("p",Cl," This config also has "+a(K.value.join(", "))+". They are kept as they are; edit them in the JSON tab. ",1)):d("",!0),e("details",Sl,[g[14]||(g[14]=e("summary",null,"Defaults for every recipe",-1)),e("div",Vl,[q(je,{"model-value":F.value,options:n.options,"preset-names":J.value,"is-defaults":"","onUpdate:modelValue":A},null,8,["model-value","options","preset-names"])])]),e("div",xl,[(t(!0),s(V,null,L($.value,(j,W)=>(t(),s("div",{key:W,class:ne(["panel",{"panel--open":r.value===W}])},[e("div",El,[e("button",{class:"panel__title",onClick:G=>r.value=r.value===W?-1:W},[e("strong",null,a(de(j,W)),1),e("span",Al,a(X(j)),1)],8,zl),e("div",Nl,[e("button",{class:"btn btn--ghost btn--small",disabled:W===0,"aria-label":"Move up",onClick:G=>ee(W,-1)},[q(Z,{name:"up",size:14})],8,Bl),e("button",{class:"btn btn--ghost btn--small",disabled:W===$.value.length-1,"aria-label":"Move down",onClick:G=>ee(W,1)},[q(Z,{name:"down",size:14})],8,Ol),e("button",{class:"btn btn--ghost btn--small","aria-label":"Duplicate recipe",onClick:G=>ue(W)},[q(Z,{name:"copy",size:14})],8,jl),e("button",{class:"btn btn--ghost btn--small btn--danger","aria-label":"Remove recipe",onClick:G=>re(W)},[q(Z,{name:"close",size:14})],8,Tl)])]),r.value===W?(t(),s("div",Ul,[q(je,{"model-value":j,options:n.options,"preset-names":J.value,"onUpdate:modelValue":G=>P(W,G)},null,8,["model-value","options","preset-names","onUpdate:modelValue"])])):d("",!0)],2))),128))]),e("button",{class:"btn",onClick:le},[q(Z,{name:"plus",size:16}),g[15]||(g[15]=E(" Add a recipe",-1))])],64)):(t(),s(V,{key:1},[e("textarea",{class:"json",spellcheck:"false",value:D.value,"aria-label":"Config JSON",onInput:g[5]||(g[5]=j=>k(j.target.value))},null,40,Il),B.value?(t(),s("p",Dl,a(B.value),1)):d("",!0)],64)),S.value?(t(),s("div",{key:2,class:ne(["check-panel",S.value.ok?"check-panel--ok":"check-panel--bad"]),role:"status"},[S.value.ok?(t(),s(V,{key:0},[g[16]||(g[16]=e("strong",null,"The config is valid.",-1)),S.value.lines?.length?(t(),s("pre",Ml,a(M.value),1)):d("",!0)],64)):(t(),s(V,{key:1},[E(a(S.value.error),1)],64))],2)):d("",!0),h.value?(t(),s("p",Ll,a(h.value),1)):d("",!0),e("div",Rl,[e("button",{class:"btn btn--primary",disabled:!te.value,onClick:g[6]||(g[6]=j=>H(!1))},[q(Z,{name:"save",size:15}),g[17]||(g[17]=E(" Save config ",-1))],8,Fl),e("button",{class:"btn",onClick:g[7]||(g[7]=j=>f("cancel"))},"Cancel")])],64))]))}}),ql=ie(Pl,[["__scopeId","data-v-5992429e"]]),Jl={class:"view"},Kl={key:1,class:"card block"},Hl={class:"head"},Wl={key:0,class:"notice"},Gl={key:1,class:"notice notice--error"},Ql={key:2,class:"muted"},Yl={class:"list"},Zl={class:"item__main"},Xl={class:"item__title"},ea={class:"tag"},ta={key:0,class:"tag"},sa={key:0,class:"item__error"},la={key:1,class:"muted"},aa=["title"],na={class:"item__actions"},oa=["onClick"],ia=["onClick"],ua=["onClick"],ra=oe({__name:"ConfigsView",props:{options:{}},setup(n){const b=c([]),i=c(""),f=c(""),v=c("list"),N=c(),y=c();async function z(){try{b.value=await Y.get("/api/image-batch/configs")}catch(h){i.value=h instanceof Error?h.message:String(h)}}function U(){N.value=void 0,y.value=void 0,v.value="edit"}function I(h){N.value=h,y.value=void 0,v.value="edit"}async function D(h){try{const m=await Y.get(`/api/image-batch/config?name=${encodeURIComponent(h.name)}&scope=${h.scope}`);N.value=void 0,y.value={name:h.name,raw:m.raw},v.value="edit"}catch(m){i.value=m instanceof Error?m.message:String(m)}}async function B(h){if(window.confirm(`Delete the config “${h.name}”? A .bak copy is kept next to it.`))try{await Y.post("/api/image-batch/config/delete",{name:h.name,scope:h.scope}),f.value=`Deleted ${h.name}.`,await z()}catch(m){i.value=m instanceof Error?m.message:String(m)}}async function S(h){v.value="list",f.value=`Saved ${h}.`,await z()}return pe(z),(h,m)=>(t(),s("div",Jl,[v.value==="edit"?(t(),ae(ql,{key:0,options:n.options,initial:N.value?{name:N.value.name,scope:N.value.scope}:void 0,"copy-of":y.value,onSaved:S,onCancel:m[0]||(m[0]=r=>v.value="list")},null,8,["options","initial","copy-of"])):(t(),s("section",Kl,[e("div",Hl,[m[2]||(m[2]=e("div",null,[e("h2",null,"Configs"),e("p",{class:"muted"}," A config is a reusable set of rules: sizes, formats, quality, names, sharpening. Apply it to any folder from the Convert tab. ")],-1)),e("button",{class:"btn btn--primary",onClick:U},[q(Z,{name:"plus",size:16}),m[1]||(m[1]=E(" New config ",-1))])]),f.value?(t(),s("p",Wl,a(f.value),1)):d("",!0),i.value?(t(),s("p",Gl,a(i.value),1)):d("",!0),b.value.length===0&&!i.value?(t(),s("p",Ql," No configs yet. Create the first one, or use quick settings on the Convert tab. ")):d("",!0),e("ul",Yl,[(t(!0),s(V,null,L(b.value,r=>(t(),s("li",{key:r.scope+r.name+r.path,class:"item"},[e("div",Zl,[e("div",Xl,[e("strong",null,a(r.name),1),e("span",ea,a(r.scope),1),r.kind!=="json"?(t(),s("span",ta,"."+a(r.kind),1)):d("",!0)]),r.error?(t(),s("p",sa,a(r.error),1)):(t(),s("p",la,[r.title?(t(),s(V,{key:0},[E(a(r.title)+" — ",1)],64)):d("",!0),E(" "+a(r.recipes)+" recipe"+a(r.recipes===1?"":"s")+" ",1),r.rules?(t(),s(V,{key:1},[E(", "+a(r.rules)+" rule"+a(r.rules===1?"":"s"),1)],64)):d("",!0),r.description?(t(),s(V,{key:2},[E(" · "+a(r.description),1)],64)):d("",!0)])),e("code",{class:"item__path",title:r.path},a(r.path),9,aa)]),e("div",na,[r.editable?(t(),s("button",{key:0,class:"btn btn--small",onClick:_=>I(r)},"Edit",8,oa)):d("",!0),r.editable&&!r.error?(t(),s("button",{key:1,class:"btn btn--small",onClick:_=>D(r)}," Duplicate ",8,ia)):d("",!0),e("button",{class:"btn btn--small btn--danger",onClick:_=>B(r)},"Delete",8,ua)])]))),128))])]))]))}}),da=ie(ra,[["__scopeId","data-v-5b011a56"]]),ca={class:"card block"},va={class:"head"},pa={class:"muted"},ma={class:"chips"},fa={key:0,class:"chip"},ga={key:1,class:"chip chip--good"},ha={key:0,class:"notice"},ba={key:1,class:"notice"},ya={key:2,class:"muted small"},ka={key:3,class:"muted small"},$a={key:4,class:"errors"},_a={class:"rows"},wa=["src"],Ca=["src"],Sa={key:1,class:"row__thumb row__thumb--empty muted"},Va={class:"row__text"},xa=["title"],Ea={class:"muted small"},za={key:0,class:"small row__message"},Aa={class:"row__sizes"},Na={key:0},Ba={key:1,class:"muted"},Oa={key:2},ja={key:5,class:"more"},Te=30,Ta=oe({__name:"BatchResults",props:{report:{}},setup(n){const b=n,i=he(ke,()=>{});function f(){try{b.report.backupDir&&localStorage.setItem("mediatoolz-ui.open-backup",b.report.backupDir)}catch{i("backups");return}i("backups")}const v=c(Te),N={written:"written","up-to-date":"up to date",skipped:"skipped",conflict:"conflict","would-write":"would write","would-overwrite":"would overwrite",replaced:"replaced",kept:"kept original","already-processed":"already processed","would-replace":"would replace","would-keep":"would keep",error:"error"},y=new Set(["written","replaced","up-to-date"]),z=new Set(["error","conflict"]),U=new Set(["written","replaced","up-to-date","skipped","kept"]),I=T(()=>Object.entries(b.report.counts).filter(([,r])=>r>0)),D=T(()=>{const{bytesIn:r,bytesOut:_}=b.report;if(!(b.report.dryRun||r<=0||_<=0))return{bytes:r-_,percent:Math.round((1-_/r)*100)}}),B=T(()=>b.report.results.slice(0,v.value));function S(r){return y.has(r)?"good":z.has(r)?"bad":"neutral"}function h(r){if(r.before===void 0||r.bytes===void 0||r.before<=0)return"";const _=Math.round((r.bytes/r.before-1)*100);return`${_>0?"+":""}${_}%`}function m(r){return!b.report.dryRun&&U.has(r.status)&&r.status!=="skipped"}return(r,_)=>(t(),s("section",ca,[e("div",va,[e("h2",null,a(n.report.dryRun?"Plan":"Result"),1),e("span",pa,[E(a(n.report.results.length)+" file"+a(n.report.results.length===1?"":"s")+" ",1),n.report.configLabel?(t(),s(V,{key:0},[E(" · config "+a(n.report.configLabel),1)],64)):d("",!0)])]),e("div",ma,[(t(!0),s(V,null,L(I.value,([$,F])=>(t(),s("span",{key:$,class:ne(["chip",`chip--${S($)}`])},a(F)+" "+a(N[$]),3))),128)),n.report.deduped?(t(),s("span",fa,a(n.report.deduped)+" merged (same result)",1)):d("",!0),D.value?(t(),s("span",ga,[E(" saved "+a(Q(ce)(Math.max(D.value.bytes,0)))+" ",1),D.value.percent>0?(t(),s(V,{key:0},[E("(−"+a(D.value.percent)+"%)",1)],64)):d("",!0)])):d("",!0)]),n.report.dryRun?(t(),s("p",ha," This is a preview: nothing was written. Press “Convert” to do it. ")):d("",!0),n.report.backupDir&&!n.report.dryRun?(t(),s("p",ba,[_[2]||(_[2]=E(" Originals were copied to ",-1)),e("code",null,a(n.report.backupDir),1),_[3]||(_[3]=E(" first. ",-1)),e("button",{class:"link",onClick:f},"View or restore this backup")])):d("",!0),n.report.derived.length?(t(),s("p",ya,a(n.report.derived.length)+" earlier result"+a(n.report.derived.length===1?" was":"s were")+" not treated as sources. ",1)):d("",!0),n.report.vectors.length?(t(),s("p",ka,a(n.report.vectors.length)+" SVG file"+a(n.report.vectors.length===1?" was":"s were")+" left out of the replacement. ",1)):d("",!0),n.report.failures.length?(t(),s("ul",$a,[(t(!0),s(V,null,L(n.report.failures,$=>(t(),s("li",{key:$.file},[e("code",null,a($.file),1),E(" — "+a($.message),1)]))),128))])):d("",!0),e("ul",_a,[(t(!0),s(V,null,L(B.value,$=>(t(),s("li",{key:`${$.sourceAbs}|${$.outputAbs}|${$.recipe}`,class:"row"},[e("img",{class:"row__thumb",loading:"lazy",alt:"",src:Q(be)($.sourceAbs,120)},null,8,wa),_[4]||(_[4]=e("span",{class:"row__arrow muted"},"→",-1)),m($)?(t(),s("img",{key:0,class:"row__thumb",loading:"lazy",alt:"",src:Q(be)($.outputAbs,120)},null,8,Ca)):(t(),s("span",Sa,a(n.report.dryRun?"plan":"—"),1)),e("div",Va,[e("span",{class:"row__name",title:$.outputAbs},a($.output),9,xa),e("span",Ea,[E(" from "+a($.source)+" · "+a($.width)+"×"+a($.height)+" · "+a($.format)+" ",1),$.recipe?(t(),s(V,{key:0},[E(" · "+a($.recipe),1)],64)):d("",!0)]),$.message?(t(),s("span",za,a($.message),1)):d("",!0)]),e("div",Aa,[$.before!==void 0?(t(),s("span",Na,a(Q(ce)($.before)),1)):d("",!0),$.before!==void 0&&$.bytes!==void 0?(t(),s("span",Ba,"→")):d("",!0),$.bytes!==void 0?(t(),s("strong",Oa,a(Q(ce)($.bytes)),1)):d("",!0),h($)?(t(),s("span",{key:3,class:ne(["row__delta",{"row__delta--down":h($).startsWith("-")}])},a(h($)),3)):d("",!0)]),e("span",{class:ne(["chip",`chip--${S($.status)}`])},a(N[$.status]),3)]))),128))]),v.value<n.report.results.length?(t(),s("div",ja,[e("button",{class:"btn",onClick:_[0]||(_[0]=$=>v.value+=Te)}," Show more ("+a(n.report.results.length-v.value)+" left) ",1),e("button",{class:"btn",onClick:_[1]||(_[1]=$=>v.value=n.report.results.length)}," Show all ("+a(n.report.results.length)+") ",1)])):d("",!0)]))}}),Ua=ie(Ta,[["__scopeId","data-v-56eb5236"]]),Ia={class:"view"},Da={key:0,class:"notice notice--warn"},Ma={class:"card block"},La={class:"pathrow"},Ra={class:"check"},Fa={key:1,class:"muted"},Pa={class:"check"},qa={class:"check"},Ja={key:3,class:"field narrow"},Ka={class:"card block"},Ha={class:"head"},Wa={key:0,class:"muted"},Ga={class:"field narrow"},Qa=["value","disabled"],Ya={key:0,class:"muted"},Za={class:"group"},Xa={class:"check"},en={key:0,class:"muted small"},tn={key:1,class:"grid"},sn={class:"field"},ln=["value"],an={key:0,class:"field"},nn={key:1,class:"field"},on=["placeholder"],un={key:2,class:"field"},rn=["value"],dn={key:2,class:"check"},cn={key:3,class:"muted small"},vn={class:"group"},pn={key:0,class:"muted small"},mn={key:1,class:"pills"},fn=["checked","onChange"],gn={class:"grid"},hn={class:"field"},bn=["value"],yn={key:0,class:"field"},kn={class:"field"},$n={key:0,class:"group"},_n=["placeholder"],wn={class:"pills"},Cn=["onClick"],Sn={class:"muted small"},Vn={class:"group"},xn={class:"runbar"},En=["disabled"],zn=["disabled"],An={key:0,class:"muted"},Nn={key:1,class:"card block",role:"status"},Bn={class:"progress"},On={class:"muted"},jn={key:2,class:"notice notice--error"},Tn=oe({__name:"ConvertView",props:{cwd:{},options:{}},setup(n){const b=n,i=he(ke,()=>{}),f={original:"Keep the original size",widths:"By width (px)",heights:"By height (px)",size:"Fit into a box",longEdge:"By the long side (px)",shortEdge:"By the short side (px)",megapixels:"By area (megapixels)",percent:"By percentage"},v={original:"",widths:"e.g. 400, 800, 1200 — one file per size",heights:"e.g. 300, 600",size:"",longEdge:"e.g. 1600 — the same for landscape and portrait",shortEdge:"e.g. 1080",megapixels:"e.g. 2, 0.5",percent:"e.g. 50, 25"},N={name:"photo",ext:"jpg",orig:"photo.jpg",dir:"trips/2026",format:"webp",width:"800",height:"600",size:"800x600",long:"800",short:"600",mp:"0.48",percent:"50",scale:"2",index:"001",hash:"a1b2c3d4",date:"2026-10-08"},y=T(()=>b.options),z=c([]),U=c([]),I=c(!0),D=c(0),B=c("out"),S=c(""),h=c(!1),m=c("skip"),r=c(!0),_=c(!0),$=c(!1),F=c("quick"),J=c(""),K=c(!1),M=c("widths"),te=c("800, 1600"),x=c("1920x1080"),C=c("inside"),A=c(!1),P=c(["webp"]),le=c(""),re=c("82"),ue=c(""),ee=c(""),de=c(Pe()),X=c("idle"),k=c({done:0,total:0}),l=c(""),u=c();let H;const w=T(()=>K.value?M.value:"original"),g=T(()=>(y.value?.sizeMethods??[]).filter(O=>O!=="original")),j=T(()=>b.cwd.includes("\\")?"\\":"/"),W=T(()=>l.value.toLowerCase().includes("sharp")),G=T(()=>z.value.find(O=>O.name===J.value)),Je=T(()=>k.value.total>0?Math.round(k.value.done/k.value.total*100):0),$e=T(()=>y.value?.defaultTemplates[w.value]??"{dir}/{name}.{format}"),Ke=T(()=>(ee.value.trim()||$e.value).replace(/\{([a-zA-Z]+)(?::(\d+))?\}/g,(o,p)=>N[p]??`{${p}}`)),_e=T(()=>U.value.length===0?"Add at least one folder or image.":D.value===0&&U.value.length>0?"No images found in the added sources.":B.value==="out"&&S.value.trim()===""?"Choose the folder for the results.":F.value==="config"&&J.value===""?"Choose a saved config.":F.value==="quick"&&B.value!=="replace"&&P.value.length===0?"Pick at least one format.":""),ze=T(()=>_e.value===""&&X.value!=="running");function He(O){D.value=O?.total.files??0,U.value.length>0&&O===void 0&&(D.value=1)}function We(O){P.value=P.value.includes(O)?P.value.filter(o=>o!==O):[...P.value,O]}function Ge(O){return"{"+O+"}"}function Qe(O){S.value=O[0]??S.value,$.value=!1}function Ye(O){ee.value=(ee.value||$e.value)+`{${O}}`}function Ze(){const O=U.value[0];if(S.value!==""||!O)return;const o=O.replace(/[\\/]+$/,"");S.value=`${o}${j.value}converted`}function Xe(){const O={sizeMethod:w.value};w.value==="size"?(O.box=x.value,O.fit=C.value,O.matchOrientation=A.value):w.value!=="original"&&(O.values=te.value.split(/[,\s]+/).filter(Boolean).map(Number)),O.formats=B.value==="replace"?["original"]:P.value,le.value==="custom"?O.quality=Number(re.value):le.value&&(O.quality=le.value),ue.value.trim()&&(O.maxBytes=ue.value.trim()),B.value!=="replace"&&ee.value.trim()&&(O.name=ee.value.trim());const o=is(de.value);return o&&(O.sharpen=o),O}async function we(O,o=!1){if(!(!O&&B.value==="replace"&&!window.confirm(`This rewrites ${D.value} original file${D.value===1?"":"s"} in place.`+(r.value?" The originals are copied to a backup folder first.":" No backup will be made.")+`
3
3
 
4
- Continue?`))){H?.(),X.value="running",l.value="",u.value=void 0,k.value={done:0,total:0};try{const{jobId:p}=await Y.post("/api/image-batch/run",{paths:U.value,recursive:I.value,placement:B.value,out:S.value,flat:h.value,overwrite:m.value,backup:r.value,onlyIfSmaller:_.value,config:F.value==="config"?J.value:void 0,settings:F.value==="quick"?Xe():void 0,dryRun:O,installSharp:o});H=st(p,{onProgress:me=>{k.value=me},onDone:me=>{u.value=me,X.value="done"},onFailed:me=>{l.value=me,X.value="failed"}})}catch(p){l.value=p instanceof Error?p.message:String(p),X.value="failed"}}}return pe(async()=>{try{z.value=await Y.get("/api/image-batch/configs")}catch(O){l.value=O instanceof Error?O.message:String(O),X.value="failed"}}),Ve(()=>H?.()),(O,o)=>(t(),s("div",Ia,[y.value&&!y.value.sharp?(t(),s("div",Da," The sharp image library is not installed yet. Previews are limited, and the first run will offer to install it. ")):d("",!0),q(lt,{sources:U.value,"onUpdate:sources":o[0]||(o[0]=p=>U.value=p),recursive:I.value,"onUpdate:recursive":o[1]||(o[1]=p=>I.value=p),"scan-url":"/api/image-batch/scan",start:n.cwd,onScanned:He},null,8,["sources","recursive","start"]),e("section",Ma,[o[35]||(o[35]=e("h2",null,"Where the results go",-1)),q(ge,{modelValue:B.value,"onUpdate:modelValue":[o[2]||(o[2]=p=>B.value=p),Ze],label:"Placement",options:[{value:"out",label:"A separate folder",hint:"the sources are not touched"},{value:"beside",label:"Next to each original",hint:"new files beside the sources"},{value:"replace",label:"Replace the originals",hint:"rewrites the files, with a backup"}]},null,8,["modelValue"]),B.value==="out"?(t(),s(V,{key:0},[e("div",La,[R(e("input",{"onUpdate:modelValue":o[3]||(o[3]=p=>S.value=p),class:"input",spellcheck:"false",placeholder:"Folder for the results","aria-label":"Folder for the results"},null,512),[[se,S.value]]),e("button",{class:"btn",onClick:o[4]||(o[4]=p=>$.value=!0)},[q(Z,{name:"folder",size:16}),o[28]||(o[28]=E(" Browse ",-1))])]),e("label",Ra,[R(e("input",{"onUpdate:modelValue":o[5]||(o[5]=p=>h.value=p),type:"checkbox"},null,512),[[fe,h.value]]),o[29]||(o[29]=E(" Put everything in one folder (no subfolders) ",-1))])],64)):B.value==="beside"?(t(),s("p",Fa," Each result is written next to its original, with the size or format in the name. ")):(t(),s(V,{key:2},[o[32]||(o[32]=e("p",{class:"notice notice--warn"}," Each original is overwritten with its converted version, keeping its own format. Use the preview first. ",-1)),e("label",Pa,[R(e("input",{"onUpdate:modelValue":o[6]||(o[6]=p=>r.value=p),type:"checkbox"},null,512),[[fe,r.value]]),o[30]||(o[30]=E(" Copy the originals to a backup folder first",-1))]),e("label",qa,[R(e("input",{"onUpdate:modelValue":o[7]||(o[7]=p=>_.value=p),type:"checkbox"},null,512),[[fe,_.value]]),o[31]||(o[31]=E(" Replace a file only when the result is smaller ",-1))])],64)),B.value!=="replace"?(t(),s("label",Ja,[o[34]||(o[34]=e("span",null,"If a result already exists",-1)),R(e("select",{"onUpdate:modelValue":o[8]||(o[8]=p=>m.value=p),class:"select"},[...o[33]||(o[33]=[e("option",{value:"skip"},"Skip it",-1),e("option",{value:"overwrite"},"Overwrite it",-1),e("option",{value:"error"},"Stop and report it",-1)])],512),[[ve,m.value]])])):d("",!0)]),e("section",Ka,[e("div",Ha,[o[36]||(o[36]=e("h2",null,"What to do",-1)),q(ge,{modelValue:F.value,"onUpdate:modelValue":o[9]||(o[9]=p=>F.value=p),label:"Settings source",options:[{value:"quick",label:"Quick settings"},{value:"config",label:"Saved config"}]},null,8,["modelValue"])]),F.value==="config"?(t(),s(V,{key:0},[z.value.length===0?(t(),s("p",Wa,[o[37]||(o[37]=E(" No configs yet. ",-1)),e("button",{class:"link",onClick:o[10]||(o[10]=p=>Q(i)("configs"))},"Create the first one"),o[38]||(o[38]=E(" or use quick settings. ",-1))])):(t(),s(V,{key:1},[e("label",Ga,[o[40]||(o[40]=e("span",null,"Config",-1)),R(e("select",{"onUpdate:modelValue":o[11]||(o[11]=p=>J.value=p),class:"select"},[o[39]||(o[39]=e("option",{value:"",disabled:""},"Choose a config…",-1)),(t(!0),s(V,null,L(z.value,p=>(t(),s("option",{key:p.name+p.scope,value:p.name,disabled:!!p.error},a(p.name)+" · "+a(p.scope),9,Qa))),128))],512),[[ve,J.value]])]),e("button",{class:"link",onClick:o[12]||(o[12]=p=>Q(i)("configs"))},"Manage configs"),G.value?(t(),s("p",Ya,[G.value.title?(t(),s(V,{key:0},[E(a(G.value.title)+" — ",1)],64)):d("",!0),E(" "+a(G.value.recipes)+" recipe"+a(G.value.recipes===1?"":"s")+" ",1),G.value.rules?(t(),s(V,{key:1},[E(", "+a(G.value.rules)+" rule"+a(G.value.rules===1?"":"s"),1)],64)):d("",!0),G.value.description?(t(),s(V,{key:2},[E(" · "+a(G.value.description),1)],64)):d("",!0)])):d("",!0)],64))],64)):y.value?(t(),s(V,{key:1},[e("div",Za,[o[47]||(o[47]=e("h3",null,"Size",-1)),e("label",Xa,[R(e("input",{"onUpdate:modelValue":o[13]||(o[13]=p=>K.value=p),type:"checkbox"},null,512),[[fe,K.value]]),o[41]||(o[41]=E(" Resize the images ",-1))]),K.value?d("",!0):(t(),s("p",en," The size does not change: the images are only converted to the chosen format. ")),K.value?(t(),s("div",tn,[e("label",sn,[o[42]||(o[42]=e("span",null,"Method",-1)),R(e("select",{"onUpdate:modelValue":o[14]||(o[14]=p=>M.value=p),class:"select"},[(t(!0),s(V,null,L(g.value,p=>(t(),s("option",{key:p,value:p},a(f[p]),9,ln))),128))],512),[[ve,M.value]])]),K.value&&w.value==="size"?(t(),s("label",an,[o[43]||(o[43]=e("span",null,"Box (width × height)",-1)),R(e("input",{"onUpdate:modelValue":o[15]||(o[15]=p=>x.value=p),class:"input",spellcheck:"false",placeholder:"1920x1080"},null,512),[[se,x.value]])])):K.value?(t(),s("label",nn,[o[44]||(o[44]=e("span",null,"Values",-1)),R(e("input",{"onUpdate:modelValue":o[16]||(o[16]=p=>te.value=p),class:"input",spellcheck:"false",placeholder:v[w.value]},null,8,on),[[se,te.value]])])):d("",!0),K.value&&w.value==="size"?(t(),s("label",un,[o[45]||(o[45]=e("span",null,"How it fills the box",-1)),R(e("select",{"onUpdate:modelValue":o[17]||(o[17]=p=>C.value=p),class:"select"},[(t(!0),s(V,null,L(y.value.fitModes,p=>(t(),s("option",{key:p,value:p},a(p),9,rn))),128))],512),[[ve,C.value]])])):d("",!0)])):d("",!0),w.value==="size"?(t(),s("label",dn,[R(e("input",{"onUpdate:modelValue":o[18]||(o[18]=p=>A.value=p),type:"checkbox"},null,512),[[fe,A.value]]),o[46]||(o[46]=E(" Turn the box around for portrait images ",-1))])):K.value&&v[w.value]?(t(),s("p",cn,a(v[w.value])+". Images are never enlarged. ",1)):d("",!0)]),e("div",vn,[o[53]||(o[53]=e("h3",null,"Formats",-1)),B.value==="replace"?(t(),s("p",pn," Each file keeps its own format when the originals are replaced. ")):(t(),s("div",mn,[(t(!0),s(V,null,L(y.value.formats,p=>(t(),s("label",{key:p,class:ne(["pill",{"pill--on":P.value.includes(p)}])},[e("input",{type:"checkbox",checked:P.value.includes(p),onChange:me=>We(p)},null,40,fn),E(" "+a(p),1)],2))),128))])),e("div",gn,[e("label",hn,[o[50]||(o[50]=e("span",null,"Quality",-1)),R(e("select",{"onUpdate:modelValue":o[19]||(o[19]=p=>le.value=p),class:"select"},[o[48]||(o[48]=e("option",{value:""},"Default (high)",-1)),(t(!0),s(V,null,L(y.value.qualityLevels,p=>(t(),s("option",{key:p,value:p},a(p),9,bn))),128)),o[49]||(o[49]=e("option",{value:"custom"},"A number…",-1))],512),[[ve,le.value]])]),le.value==="custom"?(t(),s("label",yn,[o[51]||(o[51]=e("span",null,"Quality (1–100)",-1)),R(e("input",{"onUpdate:modelValue":o[20]||(o[20]=p=>re.value=p),class:"input",inputmode:"numeric"},null,512),[[se,re.value]])])):d("",!0),e("label",kn,[o[52]||(o[52]=e("span",null,"Largest file size",-1)),R(e("input",{"onUpdate:modelValue":o[21]||(o[21]=p=>ue.value=p),class:"input",spellcheck:"false",placeholder:"e.g. 200KB (optional)"},null,512),[[se,ue.value]])])])]),B.value!=="replace"?(t(),s("div",$n,[o[55]||(o[55]=e("h3",null,"File names",-1)),R(e("input",{"onUpdate:modelValue":o[22]||(o[22]=p=>ee.value=p),class:"input",spellcheck:"false",placeholder:$e.value,"aria-label":"File name template"},null,8,_n),[[se,ee.value]]),e("div",wn,[(t(!0),s(V,null,L(y.value.templateVariables,p=>(t(),s("button",{key:p,class:"pill pill--button",onClick:me=>Ye(p)},a(Ge(p)),9,Cn))),128))]),e("p",Sn,[o[54]||(o[54]=E(" Example: ",-1)),e("code",null,a(Ke.value),1),ee.value.trim()?d("",!0):(t(),s(V,{key:0},[E(" (the default for this size method)")],64))])])):d("",!0),e("div",Vn,[o[56]||(o[56]=e("h3",null,"Sharpening",-1)),q(Fe,{modelValue:de.value,"onUpdate:modelValue":o[23]||(o[23]=p=>de.value=p),options:y.value,manage:""},null,8,["modelValue","options"])])],64)):d("",!0)]),e("div",xn,[e("button",{class:"btn",disabled:!ze.value,onClick:o[24]||(o[24]=p=>we(!0))},"Preview",8,En),e("button",{class:"btn btn--primary",disabled:!ze.value,onClick:o[25]||(o[25]=p=>we(!1))},[q(Z,{name:"play",size:15}),E(" "+a(X.value==="running"?"Working…":"Convert"),1)],8,zn),_e.value?(t(),s("span",An,a(_e.value),1)):d("",!0)]),X.value==="running"?(t(),s("div",Nn,[e("div",Bn,[e("div",{class:"progress__bar",style:Se({width:`${Je.value}%`})},null,4)]),e("span",On,a(k.value.done)+" of "+a(k.value.total||"…")+" files",1)])):d("",!0),X.value==="failed"?(t(),s("div",jn,[e("p",null,a(l.value),1),W.value?(t(),s("button",{key:0,class:"btn btn--small",onClick:o[26]||(o[26]=p=>we(!1,!0))}," Install sharp and retry ")):d("",!0)])):d("",!0),u.value?(t(),ae(Ua,{key:3,report:u.value},null,8,["report"])):d("",!0),$.value?(t(),ae(xe,{key:4,start:S.value||U.value[0]||n.cwd,mode:"folder",title:"Choose the folder for the results",onClose:o[27]||(o[27]=p=>$.value=!1),onConfirm:Qe},null,8,["start"])):d("",!0)]))}}),Un=ie(Tn,[["__scopeId","data-v-017cd3fb"]]),In=["aria-busy"],Dn={class:"compare__scroll"},Mn={class:"compare__stage"},Ln=["src"],Rn=["src"],Fn={class:"compare__tag compare__tag--left"},Pn={class:"compare__tag compare__tag--right"},qn=oe({__name:"UiCompare",props:{before:{},after:{},beforeLabel:{},afterLabel:{}},setup(n){const b=c(50),i=c(!0);return(f,v)=>(t(),s("div",{class:"compare","aria-busy":i.value},[e("div",Dn,[e("div",Mn,[e("img",{class:"compare__img",alt:"Before",src:n.before,onLoad:v[0]||(v[0]=N=>i.value=!1)},null,40,Ln),e("img",{class:"compare__img compare__img--top",alt:"After",src:n.after,style:Se({clipPath:`inset(0 0 0 ${b.value}%)`})},null,12,Rn),e("span",{class:"compare__line",style:Se({left:`${b.value}%`})},null,4),e("span",Fn,a(n.beforeLabel??"Before"),1),e("span",Pn,a(n.afterLabel??"After"),1)])]),R(e("input",{"onUpdate:modelValue":v[1]||(v[1]=N=>b.value=N),class:"compare__range",type:"range",min:"0",max:"100","aria-label":"Comparison position"},null,512),[[se,b.value,void 0,{number:!0}]])],8,In))}}),Jn=ie(qn,[["__scopeId","data-v-0ee1b3e3"]]),Kn={class:"card block"},Hn={class:"head"},Wn={class:"grid"},Gn={class:"field"},Qn={class:"field"},Yn={value:"project"},Zn={class:"field wide"},Xn={class:"grid"},eo={class:"field"},to=["value"],so={class:"field"},lo=["value"],ao={class:"grid"},no={class:"muted"},oo=["onUpdate:modelValue"],io={key:0,class:"notice notice--error"},uo={key:1,class:"muted small"},ro={class:"preview"},co={class:"head"},vo={class:"previewbar"},po={class:"field inline"},mo={key:0,class:"muted"},fo={key:2,class:"muted small"},go={key:2,class:"notice notice--error"},ho={class:"actions"},bo=["disabled"],Ue="mediatoolz-ui.sharpen-sample",yo=oe({__name:"SharpenEditor",props:{options:{},cwd:{},initial:{},copyOf:{}},emits:["saved","cancel"],setup(n,{emit:b}){const i=n,f=b,v=he(Ee,Re),N=["radius","flat","jagged","threshold"];function y(){return i.initial??i.copyOf}function z(k){const l=y()?.fields?.[k];return l===void 0?"":String(l)}const U=T(()=>i.initial!==void 0),I=c(i.initial?i.initial.name:i.copyOf?.name??""),D=c(i.initial&&i.initial.scope!=="built-in"?i.initial.scope:"project"),B=c(y()?.description??""),S=c(String(y()?.fields?.for??"")),h=c(String(y()?.fields?.amount??"")),m=c({radius:z("radius"),flat:z("flat"),jagged:z("jagged"),threshold:z("threshold")}),r=c(""),_=c("800"),$=c(!1),F=c(),J=c(""),K=c(""),M=c(!1),te=c("");let x;const C=T(()=>Object.fromEntries(i.options.sharpen.fine.map(k=>[k.key,k.range])));function A(){const k={};S.value&&(k.for=S.value),h.value&&(k.amount=h.value);for(const l of N)m.value[l].trim()!==""&&(k[l]=Number(m.value[l]));return k}function P(k){const l=new URLSearchParams({path:r.value,width:_.value||"800"});if(k){l.set("sharpen","1");for(const[u,H]of Object.entries(A()))l.set(u,String(H))}return`/api/image-batch/sharpen-preview?${l.toString()}&v=${te.value}`}const le=T(()=>r.value?P(!1):""),re=T(()=>r.value?P(!0):"");async function ue(){try{const k=await Y.post("/api/image-batch/sharpen-preset/params",{fields:A()});F.value=k.params,J.value=""}catch(k){F.value=void 0,J.value=k instanceof Error?k.message:String(k)}te.value=JSON.stringify(A())+_.value}function ee(){clearTimeout(x),x=setTimeout(()=>{ue()},300)}ye([S,h,m,_],ee,{deep:!0});function de(k){r.value=k[0]??"",$.value=!1;try{localStorage.setItem(Ue,r.value)}catch{r.value=k[0]??""}}async function X(k=!1){M.value=!0,K.value="";try{await Y.post("/api/image-batch/sharpen-preset/save",{name:I.value,scope:D.value,description:B.value,fields:A(),overwrite:k,...i.initial?{originalName:i.initial.name,originalScope:i.initial.scope}:{}}),f("saved",I.value)}catch(l){if(l instanceof Le&&l.status===409){if(window.confirm(`${l.message}. Replace it?`)){await X(!0);return}}else K.value=l instanceof Error?l.message:String(l)}finally{M.value=!1}}return pe(()=>{try{r.value=localStorage.getItem(Ue)??""}catch{r.value=""}ue()}),Ve(()=>clearTimeout(x)),(k,l)=>(t(),s("section",Kn,[e("div",Hn,[e("h2",null,a(U.value?"Edit preset":n.copyOf?"Copy of a built-in preset":"New sharpening preset"),1),e("button",{class:"btn btn--ghost",onClick:l[0]||(l[0]=u=>f("cancel"))},[q(Z,{name:"close",size:16}),l[11]||(l[11]=E(" Close ",-1))])]),e("div",Wn,[e("label",Gn,[l[12]||(l[12]=e("span",null,"Name",-1)),R(e("input",{"onUpdate:modelValue":l[1]||(l[1]=u=>I.value=u),class:"input",spellcheck:"false",placeholder:"web-crisp"},null,512),[[se,I.value]])]),e("label",Qn,[l[14]||(l[14]=e("span",null,"Where to keep it",-1)),R(e("select",{"onUpdate:modelValue":l[2]||(l[2]=u=>D.value=u),class:"select"},[e("option",Yn,"This project ("+a(Q(v).name)+")",1),l[13]||(l[13]=e("option",{value:"global"},"All projects (your home folder)",-1))],512),[[ve,D.value]])]),e("label",Zn,[l[15]||(l[15]=e("span",null,"Note (optional)",-1)),R(e("input",{"onUpdate:modelValue":l[3]||(l[3]=u=>B.value=u),class:"input",placeholder:"What it is for"},null,512),[[se,B.value]])])]),e("div",Xn,[e("label",eo,[l[17]||(l[17]=e("span",null,"Sharpen for",-1)),R(e("select",{"onUpdate:modelValue":l[4]||(l[4]=u=>S.value=u),class:"select"},[l[16]||(l[16]=e("option",{value:""},"Default (screen)",-1)),(t(!0),s(V,null,L(n.options.sharpen.targets,u=>(t(),s("option",{key:u,value:u},a(u),9,to))),128))],512),[[ve,S.value]])]),e("label",so,[l[19]||(l[19]=e("span",null,"Amount",-1)),R(e("select",{"onUpdate:modelValue":l[5]||(l[5]=u=>h.value=u),class:"select"},[l[18]||(l[18]=e("option",{value:""},"Default (standard)",-1)),(t(!0),s(V,null,L(n.options.sharpen.amounts,u=>(t(),s("option",{key:u,value:u},a(u),9,lo))),128))],512),[[ve,h.value]])])]),e("div",ao,[(t(),s(V,null,L(N,u=>e("label",{key:u,class:"field"},[e("span",null,[E(a(u)+" ",1),e("small",no,"("+a(C.value[u]?.[0])+"–"+a(C.value[u]?.[1])+")",1)]),R(e("input",{"onUpdate:modelValue":H=>m.value[u]=H,class:"input",inputmode:"decimal",placeholder:"value from the table"},null,8,oo),[[se,m.value[u]]])])),64))]),J.value?(t(),s("p",io,a(J.value),1)):F.value?(t(),s("p",uo,[E(" sharp receives: sigma "+a(F.value.sigma)+", flat "+a(F.value.m1)+", jagged "+a(F.value.m2),1),F.value.x1!==void 0?(t(),s(V,{key:0},[E(", threshold "+a(F.value.x1),1)],64)):d("",!0)])):d("",!0),e("div",ro,[e("div",co,[l[21]||(l[21]=e("h3",null,"Preview",-1)),e("div",vo,[e("label",po,[l[20]||(l[20]=e("span",null,"Width",-1)),R(e("input",{"onUpdate:modelValue":l[6]||(l[6]=u=>_.value=u),class:"input narrow",inputmode:"numeric","aria-label":"Preview width"},null,512),[[se,_.value]])]),e("button",{class:"btn btn--small",onClick:l[7]||(l[7]=u=>$.value=!0)},[q(Z,{name:"image",size:15}),E(" "+a(r.value?"Change image":"Choose an image"),1)])])]),r.value?J.value?d("",!0):(t(),ae(Jn,{key:r.value,before:le.value,after:re.value,"before-label":"Without sharpening","after-label":"Sharpened"},null,8,["before","after"])):(t(),s("p",mo," Pick any photo to see the preset applied at the output size. Drag the slider to compare. ")),r.value?(t(),s("p",fo,a(r.value)+" — resized to "+a(_.value||800)+" px wide, then sharpened, as it would be at the output size. ",1)):d("",!0)]),K.value?(t(),s("p",go,a(K.value),1)):d("",!0),e("div",ho,[e("button",{class:"btn btn--primary",disabled:M.value||I.value.trim()==="",onClick:l[8]||(l[8]=u=>X(!1))},[q(Z,{name:"save",size:15}),l[22]||(l[22]=E(" Save preset ",-1))],8,bo),e("button",{class:"btn",onClick:l[9]||(l[9]=u=>f("cancel"))},"Cancel")]),$.value?(t(),ae(xe,{key:3,start:r.value?r.value.replace(/[\\/][^\\/]*$/,""):n.cwd,mode:"image",onClose:l[10]||(l[10]=u=>$.value=!1),onConfirm:de},null,8,["start"])):d("",!0)]))}}),ko=ie(yo,[["__scopeId","data-v-6a65364c"]]),$o={class:"view"},_o={key:1,class:"card block"},wo={class:"head"},Co={key:0,class:"notice"},So={key:1,class:"notice notice--error"},Vo={class:"list"},xo={class:"item__main"},Eo={class:"item__title"},zo={key:0,class:"item__error"},Ao={key:0,class:"muted"},No={class:"item__facts"},Bo={key:0,class:"muted"},Oo={class:"item__actions"},jo=["onClick"],To=["onClick"],Uo=["onClick"],Io=oe({__name:"SharpenView",props:{options:{},cwd:{}},setup(n){const b=c([]),i=c(""),f=c(""),v=c("list"),N=c(),y=c();async function z(){try{b.value=await Y.get("/api/image-batch/sharpen-presets")}catch(m){i.value=m instanceof Error?m.message:String(m)}}function U(){N.value=void 0,y.value=void 0,v.value="edit"}function I(m){N.value=m,y.value=void 0,v.value="edit"}function D(m){N.value=void 0,y.value=m,v.value="edit"}async function B(m){if(window.confirm(`Delete the preset “${m.name}”? A .bak copy is kept next to it.`))try{await Y.post("/api/image-batch/sharpen-preset/delete",{name:m.name,scope:m.scope}),f.value=`Deleted ${m.name}.`,await z()}catch(r){i.value=r instanceof Error?r.message:String(r)}}async function S(m){v.value="list",f.value=`Saved ${m}.`,await z()}function h(m){return Object.entries(m.fields??{}).map(([r,_])=>`${r} ${_}`).join(" · ")}return pe(z),(m,r)=>(t(),s("div",$o,[v.value==="edit"?(t(),ae(ko,{key:0,options:n.options,cwd:n.cwd,initial:N.value,"copy-of":y.value,onSaved:S,onCancel:r[0]||(r[0]=_=>v.value="list")},null,8,["options","cwd","initial","copy-of"])):(t(),s("section",_o,[e("div",wo,[r[2]||(r[2]=e("div",null,[e("h2",null,"Sharpening presets"),e("p",{class:"muted"}," Save a set of sharpening values once and use it by name in any config or run. ")],-1)),e("button",{class:"btn btn--primary",onClick:U},[q(Z,{name:"plus",size:16}),r[1]||(r[1]=E(" New preset ",-1))])]),f.value?(t(),s("p",Co,a(f.value),1)):d("",!0),i.value?(t(),s("p",So,a(i.value),1)):d("",!0),e("ul",Vo,[(t(!0),s(V,null,L(b.value,_=>(t(),s("li",{key:_.scope+_.name,class:"item"},[e("div",xo,[e("div",Eo,[e("strong",null,a(_.name),1),e("span",{class:ne(["tag",{"tag--builtin":_.scope==="built-in"}])},a(_.scope),3)]),_.error?(t(),s("p",zo,a(_.error),1)):(t(),s(V,{key:1},[_.description?(t(),s("p",Ao,a(_.description),1)):d("",!0),e("p",No,[E(a(h(_))+" ",1),_.params?(t(),s("span",Bo," — sigma "+a(_.params.sigma)+", flat "+a(_.params.m1)+", jagged "+a(_.params.m2),1)):d("",!0)])],64))]),e("div",Oo,[_.scope!=="built-in"&&!_.error?(t(),s("button",{key:0,class:"btn btn--small",onClick:$=>I(_)}," Edit ",8,jo)):d("",!0),_.error?d("",!0):(t(),s("button",{key:1,class:"btn btn--small",onClick:$=>D(_)},a(_.scope==="built-in"?"Copy to my presets":"Duplicate"),9,To)),_.scope!=="built-in"?(t(),s("button",{key:2,class:"btn btn--small btn--danger",onClick:$=>B(_)}," Delete ",8,Uo)):d("",!0)])]))),128))])]))]))}}),Do=ie(Io,[["__scopeId","data-v-519b182c"]]),Mo={class:"page"},Lo={class:"page__head"},Ro={class:"muted"},Fo=["title"],Po={key:0,class:"notice notice--error"},Ie="mediatoolz-ui.image-batch-tab",qo=oe({__name:"ImageBatchPage",props:{module:{},status:{}},setup(n){const b=n;function i(){try{const z=localStorage.getItem(Ie);if(z==="convert"||z==="configs"||z==="sharpen"||z==="backups")return z}catch{return"convert"}return"convert"}const f=c(i()),v=c(),N=c("");function y(z){f.value=z;try{localStorage.setItem(Ie,z)}catch{f.value=z}}return Ae(ke,y),Ae(Ee,T(()=>Pt(b.status?.cwd??"",b.status?.home??"")).value),pe(async()=>{try{v.value=await Y.get("/api/image-batch/options")}catch(z){N.value=z instanceof Error?z.message:String(z)}}),(z,U)=>(t(),s("div",Mo,[e("header",Lo,[e("h1",null,a(n.module.title),1),e("p",Ro,a(n.module.description),1),n.status?.cwd?(t(),s("p",{key:0,class:"context",title:`Everything marked “This project” lives in ${n.status.cwd}`},[q(Z,{name:"folder",size:15}),U[0]||(U[0]=e("span",{class:"muted"},"Project folder",-1)),e("code",null,a(n.status.cwd),1)],8,Fo)):d("",!0)]),q(ge,{"model-value":f.value,label:"Image Batch sections",options:[{value:"convert",label:"Convert"},{value:"configs",label:"Configs"},{value:"sharpen",label:"Sharpening"},{value:"backups",label:"Backups"}],"onUpdate:modelValue":y},null,8,["model-value"]),N.value?(t(),s("p",Po,a(N.value),1)):v.value?(t(),s(V,{key:1},[f.value==="convert"?(t(),ae(Un,{key:0,cwd:b.status?.cwd??"",options:v.value},null,8,["cwd","options"])):f.value==="configs"?(t(),ae(da,{key:1,options:v.value},null,8,["options"])):f.value==="sharpen"?(t(),ae(Do,{key:2,options:v.value,cwd:b.status?.cwd??""},null,8,["options","cwd"])):(t(),ae(Ft,{key:3,cwd:b.status?.cwd??""},null,8,["cwd"]))],64)):d("",!0)]))}}),Ho=ie(qo,[["__scopeId","data-v-91e8f81e"]]);export{Ho as default};
4
+ Continue?`))){H?.(),X.value="running",l.value="",u.value=void 0,k.value={done:0,total:0};try{const{jobId:p}=await Y.post("/api/image-batch/run",{paths:U.value,recursive:I.value,placement:B.value,out:S.value,flat:h.value,overwrite:m.value,backup:r.value,onlyIfSmaller:_.value,config:F.value==="config"?J.value:void 0,settings:F.value==="quick"?Xe():void 0,dryRun:O,installSharp:o});H=st(p,{onProgress:me=>{k.value=me},onDone:me=>{u.value=me,X.value="done"},onFailed:me=>{l.value=me,X.value="failed"}})}catch(p){l.value=p instanceof Error?p.message:String(p),X.value="failed"}}}return pe(async()=>{try{z.value=await Y.get("/api/image-batch/configs")}catch(O){l.value=O instanceof Error?O.message:String(O),X.value="failed"}}),Ve(()=>H?.()),(O,o)=>(t(),s("div",Ia,[y.value&&!y.value.sharp?(t(),s("div",Da," The sharp image library could not be loaded. Previews are limited, and the first run will offer to install it again. ")):d("",!0),q(lt,{sources:U.value,"onUpdate:sources":o[0]||(o[0]=p=>U.value=p),recursive:I.value,"onUpdate:recursive":o[1]||(o[1]=p=>I.value=p),"scan-url":"/api/image-batch/scan",start:n.cwd,onScanned:He},null,8,["sources","recursive","start"]),e("section",Ma,[o[35]||(o[35]=e("h2",null,"Where the results go",-1)),q(ge,{modelValue:B.value,"onUpdate:modelValue":[o[2]||(o[2]=p=>B.value=p),Ze],label:"Placement",options:[{value:"out",label:"A separate folder",hint:"the sources are not touched"},{value:"beside",label:"Next to each original",hint:"new files beside the sources"},{value:"replace",label:"Replace the originals",hint:"rewrites the files, with a backup"}]},null,8,["modelValue"]),B.value==="out"?(t(),s(V,{key:0},[e("div",La,[R(e("input",{"onUpdate:modelValue":o[3]||(o[3]=p=>S.value=p),class:"input",spellcheck:"false",placeholder:"Folder for the results","aria-label":"Folder for the results"},null,512),[[se,S.value]]),e("button",{class:"btn",onClick:o[4]||(o[4]=p=>$.value=!0)},[q(Z,{name:"folder",size:16}),o[28]||(o[28]=E(" Browse ",-1))])]),e("label",Ra,[R(e("input",{"onUpdate:modelValue":o[5]||(o[5]=p=>h.value=p),type:"checkbox"},null,512),[[fe,h.value]]),o[29]||(o[29]=E(" Put everything in one folder (no subfolders) ",-1))])],64)):B.value==="beside"?(t(),s("p",Fa," Each result is written next to its original, with the size or format in the name. ")):(t(),s(V,{key:2},[o[32]||(o[32]=e("p",{class:"notice notice--warn"}," Each original is overwritten with its converted version, keeping its own format. Use the preview first. ",-1)),e("label",Pa,[R(e("input",{"onUpdate:modelValue":o[6]||(o[6]=p=>r.value=p),type:"checkbox"},null,512),[[fe,r.value]]),o[30]||(o[30]=E(" Copy the originals to a backup folder first",-1))]),e("label",qa,[R(e("input",{"onUpdate:modelValue":o[7]||(o[7]=p=>_.value=p),type:"checkbox"},null,512),[[fe,_.value]]),o[31]||(o[31]=E(" Replace a file only when the result is smaller ",-1))])],64)),B.value!=="replace"?(t(),s("label",Ja,[o[34]||(o[34]=e("span",null,"If a result already exists",-1)),R(e("select",{"onUpdate:modelValue":o[8]||(o[8]=p=>m.value=p),class:"select"},[...o[33]||(o[33]=[e("option",{value:"skip"},"Skip it",-1),e("option",{value:"overwrite"},"Overwrite it",-1),e("option",{value:"error"},"Stop and report it",-1)])],512),[[ve,m.value]])])):d("",!0)]),e("section",Ka,[e("div",Ha,[o[36]||(o[36]=e("h2",null,"What to do",-1)),q(ge,{modelValue:F.value,"onUpdate:modelValue":o[9]||(o[9]=p=>F.value=p),label:"Settings source",options:[{value:"quick",label:"Quick settings"},{value:"config",label:"Saved config"}]},null,8,["modelValue"])]),F.value==="config"?(t(),s(V,{key:0},[z.value.length===0?(t(),s("p",Wa,[o[37]||(o[37]=E(" No configs yet. ",-1)),e("button",{class:"link",onClick:o[10]||(o[10]=p=>Q(i)("configs"))},"Create the first one"),o[38]||(o[38]=E(" or use quick settings. ",-1))])):(t(),s(V,{key:1},[e("label",Ga,[o[40]||(o[40]=e("span",null,"Config",-1)),R(e("select",{"onUpdate:modelValue":o[11]||(o[11]=p=>J.value=p),class:"select"},[o[39]||(o[39]=e("option",{value:"",disabled:""},"Choose a config…",-1)),(t(!0),s(V,null,L(z.value,p=>(t(),s("option",{key:p.name+p.scope,value:p.name,disabled:!!p.error},a(p.name)+" · "+a(p.scope),9,Qa))),128))],512),[[ve,J.value]])]),e("button",{class:"link",onClick:o[12]||(o[12]=p=>Q(i)("configs"))},"Manage configs"),G.value?(t(),s("p",Ya,[G.value.title?(t(),s(V,{key:0},[E(a(G.value.title)+" — ",1)],64)):d("",!0),E(" "+a(G.value.recipes)+" recipe"+a(G.value.recipes===1?"":"s")+" ",1),G.value.rules?(t(),s(V,{key:1},[E(", "+a(G.value.rules)+" rule"+a(G.value.rules===1?"":"s"),1)],64)):d("",!0),G.value.description?(t(),s(V,{key:2},[E(" · "+a(G.value.description),1)],64)):d("",!0)])):d("",!0)],64))],64)):y.value?(t(),s(V,{key:1},[e("div",Za,[o[47]||(o[47]=e("h3",null,"Size",-1)),e("label",Xa,[R(e("input",{"onUpdate:modelValue":o[13]||(o[13]=p=>K.value=p),type:"checkbox"},null,512),[[fe,K.value]]),o[41]||(o[41]=E(" Resize the images ",-1))]),K.value?d("",!0):(t(),s("p",en," The size does not change: the images are only converted to the chosen format. ")),K.value?(t(),s("div",tn,[e("label",sn,[o[42]||(o[42]=e("span",null,"Method",-1)),R(e("select",{"onUpdate:modelValue":o[14]||(o[14]=p=>M.value=p),class:"select"},[(t(!0),s(V,null,L(g.value,p=>(t(),s("option",{key:p,value:p},a(f[p]),9,ln))),128))],512),[[ve,M.value]])]),K.value&&w.value==="size"?(t(),s("label",an,[o[43]||(o[43]=e("span",null,"Box (width × height)",-1)),R(e("input",{"onUpdate:modelValue":o[15]||(o[15]=p=>x.value=p),class:"input",spellcheck:"false",placeholder:"1920x1080"},null,512),[[se,x.value]])])):K.value?(t(),s("label",nn,[o[44]||(o[44]=e("span",null,"Values",-1)),R(e("input",{"onUpdate:modelValue":o[16]||(o[16]=p=>te.value=p),class:"input",spellcheck:"false",placeholder:v[w.value]},null,8,on),[[se,te.value]])])):d("",!0),K.value&&w.value==="size"?(t(),s("label",un,[o[45]||(o[45]=e("span",null,"How it fills the box",-1)),R(e("select",{"onUpdate:modelValue":o[17]||(o[17]=p=>C.value=p),class:"select"},[(t(!0),s(V,null,L(y.value.fitModes,p=>(t(),s("option",{key:p,value:p},a(p),9,rn))),128))],512),[[ve,C.value]])])):d("",!0)])):d("",!0),w.value==="size"?(t(),s("label",dn,[R(e("input",{"onUpdate:modelValue":o[18]||(o[18]=p=>A.value=p),type:"checkbox"},null,512),[[fe,A.value]]),o[46]||(o[46]=E(" Turn the box around for portrait images ",-1))])):K.value&&v[w.value]?(t(),s("p",cn,a(v[w.value])+". Images are never enlarged. ",1)):d("",!0)]),e("div",vn,[o[53]||(o[53]=e("h3",null,"Formats",-1)),B.value==="replace"?(t(),s("p",pn," Each file keeps its own format when the originals are replaced. ")):(t(),s("div",mn,[(t(!0),s(V,null,L(y.value.formats,p=>(t(),s("label",{key:p,class:ne(["pill",{"pill--on":P.value.includes(p)}])},[e("input",{type:"checkbox",checked:P.value.includes(p),onChange:me=>We(p)},null,40,fn),E(" "+a(p),1)],2))),128))])),e("div",gn,[e("label",hn,[o[50]||(o[50]=e("span",null,"Quality",-1)),R(e("select",{"onUpdate:modelValue":o[19]||(o[19]=p=>le.value=p),class:"select"},[o[48]||(o[48]=e("option",{value:""},"Default (high)",-1)),(t(!0),s(V,null,L(y.value.qualityLevels,p=>(t(),s("option",{key:p,value:p},a(p),9,bn))),128)),o[49]||(o[49]=e("option",{value:"custom"},"A number…",-1))],512),[[ve,le.value]])]),le.value==="custom"?(t(),s("label",yn,[o[51]||(o[51]=e("span",null,"Quality (1–100)",-1)),R(e("input",{"onUpdate:modelValue":o[20]||(o[20]=p=>re.value=p),class:"input",inputmode:"numeric"},null,512),[[se,re.value]])])):d("",!0),e("label",kn,[o[52]||(o[52]=e("span",null,"Largest file size",-1)),R(e("input",{"onUpdate:modelValue":o[21]||(o[21]=p=>ue.value=p),class:"input",spellcheck:"false",placeholder:"e.g. 200KB (optional)"},null,512),[[se,ue.value]])])])]),B.value!=="replace"?(t(),s("div",$n,[o[55]||(o[55]=e("h3",null,"File names",-1)),R(e("input",{"onUpdate:modelValue":o[22]||(o[22]=p=>ee.value=p),class:"input",spellcheck:"false",placeholder:$e.value,"aria-label":"File name template"},null,8,_n),[[se,ee.value]]),e("div",wn,[(t(!0),s(V,null,L(y.value.templateVariables,p=>(t(),s("button",{key:p,class:"pill pill--button",onClick:me=>Ye(p)},a(Ge(p)),9,Cn))),128))]),e("p",Sn,[o[54]||(o[54]=E(" Example: ",-1)),e("code",null,a(Ke.value),1),ee.value.trim()?d("",!0):(t(),s(V,{key:0},[E(" (the default for this size method)")],64))])])):d("",!0),e("div",Vn,[o[56]||(o[56]=e("h3",null,"Sharpening",-1)),q(Fe,{modelValue:de.value,"onUpdate:modelValue":o[23]||(o[23]=p=>de.value=p),options:y.value,manage:""},null,8,["modelValue","options"])])],64)):d("",!0)]),e("div",xn,[e("button",{class:"btn",disabled:!ze.value,onClick:o[24]||(o[24]=p=>we(!0))},"Preview",8,En),e("button",{class:"btn btn--primary",disabled:!ze.value,onClick:o[25]||(o[25]=p=>we(!1))},[q(Z,{name:"play",size:15}),E(" "+a(X.value==="running"?"Working…":"Convert"),1)],8,zn),_e.value?(t(),s("span",An,a(_e.value),1)):d("",!0)]),X.value==="running"?(t(),s("div",Nn,[e("div",Bn,[e("div",{class:"progress__bar",style:Se({width:`${Je.value}%`})},null,4)]),e("span",On,a(k.value.done)+" of "+a(k.value.total||"…")+" files",1)])):d("",!0),X.value==="failed"?(t(),s("div",jn,[e("p",null,a(l.value),1),W.value?(t(),s("button",{key:0,class:"btn btn--small",onClick:o[26]||(o[26]=p=>we(!1,!0))}," Install sharp and retry ")):d("",!0)])):d("",!0),u.value?(t(),ae(Ua,{key:3,report:u.value},null,8,["report"])):d("",!0),$.value?(t(),ae(xe,{key:4,start:S.value||U.value[0]||n.cwd,mode:"folder",title:"Choose the folder for the results",onClose:o[27]||(o[27]=p=>$.value=!1),onConfirm:Qe},null,8,["start"])):d("",!0)]))}}),Un=ie(Tn,[["__scopeId","data-v-9442c7be"]]),In=["aria-busy"],Dn={class:"compare__scroll"},Mn={class:"compare__stage"},Ln=["src"],Rn=["src"],Fn={class:"compare__tag compare__tag--left"},Pn={class:"compare__tag compare__tag--right"},qn=oe({__name:"UiCompare",props:{before:{},after:{},beforeLabel:{},afterLabel:{}},setup(n){const b=c(50),i=c(!0);return(f,v)=>(t(),s("div",{class:"compare","aria-busy":i.value},[e("div",Dn,[e("div",Mn,[e("img",{class:"compare__img",alt:"Before",src:n.before,onLoad:v[0]||(v[0]=N=>i.value=!1)},null,40,Ln),e("img",{class:"compare__img compare__img--top",alt:"After",src:n.after,style:Se({clipPath:`inset(0 0 0 ${b.value}%)`})},null,12,Rn),e("span",{class:"compare__line",style:Se({left:`${b.value}%`})},null,4),e("span",Fn,a(n.beforeLabel??"Before"),1),e("span",Pn,a(n.afterLabel??"After"),1)])]),R(e("input",{"onUpdate:modelValue":v[1]||(v[1]=N=>b.value=N),class:"compare__range",type:"range",min:"0",max:"100","aria-label":"Comparison position"},null,512),[[se,b.value,void 0,{number:!0}]])],8,In))}}),Jn=ie(qn,[["__scopeId","data-v-0ee1b3e3"]]),Kn={class:"card block"},Hn={class:"head"},Wn={class:"grid"},Gn={class:"field"},Qn={class:"field"},Yn={value:"project"},Zn={class:"field wide"},Xn={class:"grid"},eo={class:"field"},to=["value"],so={class:"field"},lo=["value"],ao={class:"grid"},no={class:"muted"},oo=["onUpdate:modelValue"],io={key:0,class:"notice notice--error"},uo={key:1,class:"muted small"},ro={class:"preview"},co={class:"head"},vo={class:"previewbar"},po={class:"field inline"},mo={key:0,class:"muted"},fo={key:2,class:"muted small"},go={key:2,class:"notice notice--error"},ho={class:"actions"},bo=["disabled"],Ue="mediatoolz-ui.sharpen-sample",yo=oe({__name:"SharpenEditor",props:{options:{},cwd:{},initial:{},copyOf:{}},emits:["saved","cancel"],setup(n,{emit:b}){const i=n,f=b,v=he(Ee,Re),N=["radius","flat","jagged","threshold"];function y(){return i.initial??i.copyOf}function z(k){const l=y()?.fields?.[k];return l===void 0?"":String(l)}const U=T(()=>i.initial!==void 0),I=c(i.initial?i.initial.name:i.copyOf?.name??""),D=c(i.initial&&i.initial.scope!=="built-in"?i.initial.scope:"project"),B=c(y()?.description??""),S=c(String(y()?.fields?.for??"")),h=c(String(y()?.fields?.amount??"")),m=c({radius:z("radius"),flat:z("flat"),jagged:z("jagged"),threshold:z("threshold")}),r=c(""),_=c("800"),$=c(!1),F=c(),J=c(""),K=c(""),M=c(!1),te=c("");let x;const C=T(()=>Object.fromEntries(i.options.sharpen.fine.map(k=>[k.key,k.range])));function A(){const k={};S.value&&(k.for=S.value),h.value&&(k.amount=h.value);for(const l of N)m.value[l].trim()!==""&&(k[l]=Number(m.value[l]));return k}function P(k){const l=new URLSearchParams({path:r.value,width:_.value||"800"});if(k){l.set("sharpen","1");for(const[u,H]of Object.entries(A()))l.set(u,String(H))}return`/api/image-batch/sharpen-preview?${l.toString()}&v=${te.value}`}const le=T(()=>r.value?P(!1):""),re=T(()=>r.value?P(!0):"");async function ue(){try{const k=await Y.post("/api/image-batch/sharpen-preset/params",{fields:A()});F.value=k.params,J.value=""}catch(k){F.value=void 0,J.value=k instanceof Error?k.message:String(k)}te.value=JSON.stringify(A())+_.value}function ee(){clearTimeout(x),x=setTimeout(()=>{ue()},300)}ye([S,h,m,_],ee,{deep:!0});function de(k){r.value=k[0]??"",$.value=!1;try{localStorage.setItem(Ue,r.value)}catch{r.value=k[0]??""}}async function X(k=!1){M.value=!0,K.value="";try{await Y.post("/api/image-batch/sharpen-preset/save",{name:I.value,scope:D.value,description:B.value,fields:A(),overwrite:k,...i.initial?{originalName:i.initial.name,originalScope:i.initial.scope}:{}}),f("saved",I.value)}catch(l){if(l instanceof Le&&l.status===409){if(window.confirm(`${l.message}. Replace it?`)){await X(!0);return}}else K.value=l instanceof Error?l.message:String(l)}finally{M.value=!1}}return pe(()=>{try{r.value=localStorage.getItem(Ue)??""}catch{r.value=""}ue()}),Ve(()=>clearTimeout(x)),(k,l)=>(t(),s("section",Kn,[e("div",Hn,[e("h2",null,a(U.value?"Edit preset":n.copyOf?"Copy of a built-in preset":"New sharpening preset"),1),e("button",{class:"btn btn--ghost",onClick:l[0]||(l[0]=u=>f("cancel"))},[q(Z,{name:"close",size:16}),l[11]||(l[11]=E(" Close ",-1))])]),e("div",Wn,[e("label",Gn,[l[12]||(l[12]=e("span",null,"Name",-1)),R(e("input",{"onUpdate:modelValue":l[1]||(l[1]=u=>I.value=u),class:"input",spellcheck:"false",placeholder:"web-crisp"},null,512),[[se,I.value]])]),e("label",Qn,[l[14]||(l[14]=e("span",null,"Where to keep it",-1)),R(e("select",{"onUpdate:modelValue":l[2]||(l[2]=u=>D.value=u),class:"select"},[e("option",Yn,"This project ("+a(Q(v).name)+")",1),l[13]||(l[13]=e("option",{value:"global"},"All projects (your home folder)",-1))],512),[[ve,D.value]])]),e("label",Zn,[l[15]||(l[15]=e("span",null,"Note (optional)",-1)),R(e("input",{"onUpdate:modelValue":l[3]||(l[3]=u=>B.value=u),class:"input",placeholder:"What it is for"},null,512),[[se,B.value]])])]),e("div",Xn,[e("label",eo,[l[17]||(l[17]=e("span",null,"Sharpen for",-1)),R(e("select",{"onUpdate:modelValue":l[4]||(l[4]=u=>S.value=u),class:"select"},[l[16]||(l[16]=e("option",{value:""},"Default (screen)",-1)),(t(!0),s(V,null,L(n.options.sharpen.targets,u=>(t(),s("option",{key:u,value:u},a(u),9,to))),128))],512),[[ve,S.value]])]),e("label",so,[l[19]||(l[19]=e("span",null,"Amount",-1)),R(e("select",{"onUpdate:modelValue":l[5]||(l[5]=u=>h.value=u),class:"select"},[l[18]||(l[18]=e("option",{value:""},"Default (standard)",-1)),(t(!0),s(V,null,L(n.options.sharpen.amounts,u=>(t(),s("option",{key:u,value:u},a(u),9,lo))),128))],512),[[ve,h.value]])])]),e("div",ao,[(t(),s(V,null,L(N,u=>e("label",{key:u,class:"field"},[e("span",null,[E(a(u)+" ",1),e("small",no,"("+a(C.value[u]?.[0])+"–"+a(C.value[u]?.[1])+")",1)]),R(e("input",{"onUpdate:modelValue":H=>m.value[u]=H,class:"input",inputmode:"decimal",placeholder:"value from the table"},null,8,oo),[[se,m.value[u]]])])),64))]),J.value?(t(),s("p",io,a(J.value),1)):F.value?(t(),s("p",uo,[E(" sharp receives: sigma "+a(F.value.sigma)+", flat "+a(F.value.m1)+", jagged "+a(F.value.m2),1),F.value.x1!==void 0?(t(),s(V,{key:0},[E(", threshold "+a(F.value.x1),1)],64)):d("",!0)])):d("",!0),e("div",ro,[e("div",co,[l[21]||(l[21]=e("h3",null,"Preview",-1)),e("div",vo,[e("label",po,[l[20]||(l[20]=e("span",null,"Width",-1)),R(e("input",{"onUpdate:modelValue":l[6]||(l[6]=u=>_.value=u),class:"input narrow",inputmode:"numeric","aria-label":"Preview width"},null,512),[[se,_.value]])]),e("button",{class:"btn btn--small",onClick:l[7]||(l[7]=u=>$.value=!0)},[q(Z,{name:"image",size:15}),E(" "+a(r.value?"Change image":"Choose an image"),1)])])]),r.value?J.value?d("",!0):(t(),ae(Jn,{key:r.value,before:le.value,after:re.value,"before-label":"Without sharpening","after-label":"Sharpened"},null,8,["before","after"])):(t(),s("p",mo," Pick any photo to see the preset applied at the output size. Drag the slider to compare. ")),r.value?(t(),s("p",fo,a(r.value)+" — resized to "+a(_.value||800)+" px wide, then sharpened, as it would be at the output size. ",1)):d("",!0)]),K.value?(t(),s("p",go,a(K.value),1)):d("",!0),e("div",ho,[e("button",{class:"btn btn--primary",disabled:M.value||I.value.trim()==="",onClick:l[8]||(l[8]=u=>X(!1))},[q(Z,{name:"save",size:15}),l[22]||(l[22]=E(" Save preset ",-1))],8,bo),e("button",{class:"btn",onClick:l[9]||(l[9]=u=>f("cancel"))},"Cancel")]),$.value?(t(),ae(xe,{key:3,start:r.value?r.value.replace(/[\\/][^\\/]*$/,""):n.cwd,mode:"image",onClose:l[10]||(l[10]=u=>$.value=!1),onConfirm:de},null,8,["start"])):d("",!0)]))}}),ko=ie(yo,[["__scopeId","data-v-6a65364c"]]),$o={class:"view"},_o={key:1,class:"card block"},wo={class:"head"},Co={key:0,class:"notice"},So={key:1,class:"notice notice--error"},Vo={class:"list"},xo={class:"item__main"},Eo={class:"item__title"},zo={key:0,class:"item__error"},Ao={key:0,class:"muted"},No={class:"item__facts"},Bo={key:0,class:"muted"},Oo={class:"item__actions"},jo=["onClick"],To=["onClick"],Uo=["onClick"],Io=oe({__name:"SharpenView",props:{options:{},cwd:{}},setup(n){const b=c([]),i=c(""),f=c(""),v=c("list"),N=c(),y=c();async function z(){try{b.value=await Y.get("/api/image-batch/sharpen-presets")}catch(m){i.value=m instanceof Error?m.message:String(m)}}function U(){N.value=void 0,y.value=void 0,v.value="edit"}function I(m){N.value=m,y.value=void 0,v.value="edit"}function D(m){N.value=void 0,y.value=m,v.value="edit"}async function B(m){if(window.confirm(`Delete the preset “${m.name}”? A .bak copy is kept next to it.`))try{await Y.post("/api/image-batch/sharpen-preset/delete",{name:m.name,scope:m.scope}),f.value=`Deleted ${m.name}.`,await z()}catch(r){i.value=r instanceof Error?r.message:String(r)}}async function S(m){v.value="list",f.value=`Saved ${m}.`,await z()}function h(m){return Object.entries(m.fields??{}).map(([r,_])=>`${r} ${_}`).join(" · ")}return pe(z),(m,r)=>(t(),s("div",$o,[v.value==="edit"?(t(),ae(ko,{key:0,options:n.options,cwd:n.cwd,initial:N.value,"copy-of":y.value,onSaved:S,onCancel:r[0]||(r[0]=_=>v.value="list")},null,8,["options","cwd","initial","copy-of"])):(t(),s("section",_o,[e("div",wo,[r[2]||(r[2]=e("div",null,[e("h2",null,"Sharpening presets"),e("p",{class:"muted"}," Save a set of sharpening values once and use it by name in any config or run. ")],-1)),e("button",{class:"btn btn--primary",onClick:U},[q(Z,{name:"plus",size:16}),r[1]||(r[1]=E(" New preset ",-1))])]),f.value?(t(),s("p",Co,a(f.value),1)):d("",!0),i.value?(t(),s("p",So,a(i.value),1)):d("",!0),e("ul",Vo,[(t(!0),s(V,null,L(b.value,_=>(t(),s("li",{key:_.scope+_.name,class:"item"},[e("div",xo,[e("div",Eo,[e("strong",null,a(_.name),1),e("span",{class:ne(["tag",{"tag--builtin":_.scope==="built-in"}])},a(_.scope),3)]),_.error?(t(),s("p",zo,a(_.error),1)):(t(),s(V,{key:1},[_.description?(t(),s("p",Ao,a(_.description),1)):d("",!0),e("p",No,[E(a(h(_))+" ",1),_.params?(t(),s("span",Bo," — sigma "+a(_.params.sigma)+", flat "+a(_.params.m1)+", jagged "+a(_.params.m2),1)):d("",!0)])],64))]),e("div",Oo,[_.scope!=="built-in"&&!_.error?(t(),s("button",{key:0,class:"btn btn--small",onClick:$=>I(_)}," Edit ",8,jo)):d("",!0),_.error?d("",!0):(t(),s("button",{key:1,class:"btn btn--small",onClick:$=>D(_)},a(_.scope==="built-in"?"Copy to my presets":"Duplicate"),9,To)),_.scope!=="built-in"?(t(),s("button",{key:2,class:"btn btn--small btn--danger",onClick:$=>B(_)}," Delete ",8,Uo)):d("",!0)])]))),128))])]))]))}}),Do=ie(Io,[["__scopeId","data-v-519b182c"]]),Mo={class:"page"},Lo={class:"page__head"},Ro={class:"muted"},Fo=["title"],Po={key:0,class:"notice notice--error"},Ie="mediatoolz-ui.image-batch-tab",qo=oe({__name:"ImageBatchPage",props:{module:{},status:{}},setup(n){const b=n;function i(){try{const z=localStorage.getItem(Ie);if(z==="convert"||z==="configs"||z==="sharpen"||z==="backups")return z}catch{return"convert"}return"convert"}const f=c(i()),v=c(),N=c("");function y(z){f.value=z;try{localStorage.setItem(Ie,z)}catch{f.value=z}}return Ae(ke,y),Ae(Ee,T(()=>Pt(b.status?.cwd??"",b.status?.home??"")).value),pe(async()=>{try{v.value=await Y.get("/api/image-batch/options")}catch(z){N.value=z instanceof Error?z.message:String(z)}}),(z,U)=>(t(),s("div",Mo,[e("header",Lo,[e("h1",null,a(n.module.title),1),e("p",Ro,a(n.module.description),1),n.status?.cwd?(t(),s("p",{key:0,class:"context",title:`Everything marked “This project” lives in ${n.status.cwd}`},[q(Z,{name:"folder",size:15}),U[0]||(U[0]=e("span",{class:"muted"},"Project folder",-1)),e("code",null,a(n.status.cwd),1)],8,Fo)):d("",!0)]),q(ge,{"model-value":f.value,label:"Image Batch sections",options:[{value:"convert",label:"Convert"},{value:"configs",label:"Configs"},{value:"sharpen",label:"Sharpening"},{value:"backups",label:"Backups"}],"onUpdate:modelValue":y},null,8,["model-value"]),N.value?(t(),s("p",Po,a(N.value),1)):v.value?(t(),s(V,{key:1},[f.value==="convert"?(t(),ae(Un,{key:0,cwd:b.status?.cwd??"",options:v.value},null,8,["cwd","options"])):f.value==="configs"?(t(),ae(da,{key:1,options:v.value},null,8,["options"])):f.value==="sharpen"?(t(),ae(Do,{key:2,options:v.value,cwd:b.status?.cwd??""},null,8,["options","cwd"])):(t(),ae(Ft,{key:3,cwd:b.status?.cwd??""},null,8,["cwd"]))],64)):d("",!0)]))}}),Ho=ie(qo,[["__scopeId","data-v-91e8f81e"]]);export{Ho as default};
@@ -1 +1 @@
1
- import{d as ke,s as Xe,o as Ce,w as Ve,a as Ge,h as Me,r as L,c as G,b as x,e as M,_ as $e,f,n as me,u as pe,i as rt,F as oe,g as de,j as J,t as I,k as O,l as le,m as fe,p as it,q as He,v as Le,x as Re,y as ye,z as Oe,A as Ye,B as yt,C as gt}from"./index-yiehSw5D.js";import{U as bt,S as wt}from"./SourcePicker-Db0dG6zc.js";function _t(e,t,a,n){if(e==="auto")return Math.max(1,Math.floor((t+n)/(a+n)));if(typeof e=="number")return Math.max(1,Math.floor(e));const o=Object.keys(e).filter(c=>c!=="default").map(Number).sort((c,m)=>c-m);for(const c of o)if(t<=c)return Math.max(1,Math.floor(e[c]));return Math.max(1,Math.floor(e.default))}function kt(e,t,a){return Math.max(0,(e-(t-1)*a)/t)}function xt(e,t){return t!==void 0?Math.max(1,Math.floor(t)):e===void 0||e==="auto"?2:typeof e=="number"?Math.max(1,Math.floor(e)):Math.max(1,Math.floor(e.default))}function Mt(e,t,a,n="balanced"){const o=Math.max(1,Math.floor(t)||1),c=new Array(o).fill(0),m=[];let r=0;for(const $ of e){const y=Math.min(Math.max(1,Math.floor($.span)||1),o);let v;if(n==="ordered")v=r+y<=o?r:0,r=v+y,r>=o&&(r=0);else{let b=0,_=1/0;for(let i=0;i<=o-y;i++){let p=0;for(let A=i;A<i+y;A++)p=Math.max(p,c[A]);p<_&&(_=p,b=i)}v=b}let d=0;for(let b=v;b<v+y;b++)d=Math.max(d,c[b]);m.push({id:$.id,laneIndex:v,span:y,mainPos:d});const S=d+$.mainSize+a;for(let b=v;b<v+y;b++)c[b]=S}const w=m.length?Math.max(0,Math.max(...c)-a):0;return{items:m,totalMainSize:w}}function St(e){const t=new Set;let a=!1;function n(){a||(a=!0,requestAnimationFrame(()=>{a=!1,e()}))}const o=typeof ResizeObserver>"u"?null:new ResizeObserver(n);return{observe(c){t.has(c)||(t.add(c),o?.observe(c))},unobserveAll(){for(const c of t)o?.unobserve(c);t.clear()},scheduleNow:n,destroy(){o?.disconnect(),t.clear()}}}var Ct=240,Je=16,Ze=600,$t=250,It="cubic-bezier(0.2, 0, 0, 1)";function Te(e){return typeof e.el=="function"?e.el():e.el??null}function zt(e){return(e instanceof HTMLImageElement?[e]:Array.from(e.querySelectorAll("img"))).filter(a=>!a.complete)}function At(e,t={}){const a=t.direction??"vertical",n=t.minLaneSize??Ct,o=t.placement??"balanced",c=typeof t.gap=="number"?t.gap:t.gap?.main??Je,m=typeof t.gap=="number"?t.gap:t.gap?.cross??Je,r=a==="horizontal"?t.rows??"auto":t.columns??"auto",w=!!t.virtualize,$=typeof t.virtualize=="object"?t.virtualize.overscan??Ze:Ze,y=t.scrollContainer??(a==="vertical"?"window":"self"),v=t.estimateSize,d=t.animate??!0,S=t.transitionDuration??$t,b=t.transitionEasing??It,_=`transform ${S}ms ${b}, opacity ${S}ms ${b}`;e.style.position="relative",d&&(e.style.setProperty("--mk-transition-duration",`${S}ms`),e.style.setProperty("--mk-transition-easing",b));let i=null;a==="horizontal"?(e.style.overflowX="auto",e.style.overflowY="hidden",i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.width="1px",i.style.height="1px",i.style.visibility="hidden",i.style.pointerEvents="none",e.appendChild(i)):e.style.overflowX="clip";const p=new Map;let A=[],R=[],N=[];const T=new Map,B=new WeakSet;let re=!1,Z=null;const ne=new Map;function ie(l,h){for(const g of ne.get(l)??[])g(h)}const V=St(s);function F(){V.scheduleNow()}const Q=w?y==="window"?window:y==="self"?e:y:null;Q?.addEventListener("scroll",F,{passive:!0});function ee(){return A.map((l,h)=>({id:l,key:p.get(l)?.order??h})).sort((l,h)=>l.key-h.key).map(l=>l.id)}function W(){V.unobserveAll(),V.observe(e);for(const l of A){const h=Te(p.get(l));h&&V.observe(h)}}function q(l){if(!d)return;const h=p.get(l),g=h?Te(h):null;g&&(g.classList.add("mk-item-leave"),g.style.transition=_,g.style.opacity="0")}function K(l){const h=g=>{g.target===l&&(l.style.willChange="auto",l.classList.remove("mk-item-moving"),l.removeEventListener("transitionend",h))};l.style.willChange="transform",l.addEventListener("transitionend",h)}function D(l,h,g){const P=`translate(${h}px, ${g}px)`;return l.style.transform===""?d?(l.style.transition="none",l.style.transform=P,l.style.opacity="0",l.classList.add("mk-item-enter"),!0):(l.style.transform=P,!1):(l.style.transform===P||(d&&(l.style.transition=_,l.classList.add("mk-item-moving"),K(l)),l.style.transform=P),!1)}function z(){if(y==="self"){const C=a==="vertical"?e.scrollTop:e.scrollLeft,j=a==="vertical"?e.clientHeight:e.clientWidth;return[C-$,C+j+$]}const l=e.getBoundingClientRect(),h=a==="vertical"?l.top:l.left;let g,P;if(y==="window")g=0,P=a==="vertical"?window.innerHeight:window.innerWidth;else{const C=y.getBoundingClientRect();g=a==="vertical"?C.top:C.left,P=a==="vertical"?y.clientHeight:y.clientWidth}return[g-h-$,g+P-h+$]}function u(l,h){if(w&&l.estimatedSize!==void 0)return l.estimatedSize;if(l.aspectRatio)return a==="vertical"?h/l.aspectRatio:h*l.aspectRatio;if(!w)return;if(v)return v(l);re||(re=!0,console.warn("[masonry-kit] `virtualize` is on but an item has no `estimatedSize`, no `aspectRatio`, and `estimateSize` returned nothing — falling back to a guessed size. Set one of these for accurate initial positions."));const g=[...T.values()];return g.length>0?g.reduce((P,C)=>P+C,0)/g.length:h}function s(){const l=e.getBoundingClientRect(),h=a==="vertical"?l.width:l.height,g=_t(r,h,n,m),P=kt(h,g,m),C=ee().filter(E=>E!==Z),j=new Map,U=new Map,te=new Map;for(const E of C){const ue=p.get(E),ve=a==="vertical"?ue.colSpan??1:ue.rowSpan??1,se=Math.min(Math.max(1,Math.floor(ve)||1),g);U.set(E,se);const H=se*P+(se-1)*m;te.set(E,H);const X=Te(ue);X&&(j.set(E,X),X.style.position="absolute",X.style.top="0",X.style.left="0",a==="vertical"?X.style.width=`${H}px`:X.style.height=`${H}px`)}const he=new Map,qe=[];for(const E of C){const ue=p.get(E),ve=te.get(E),se=j.get(E);let H;if(se){const X=zt(se);if(X.length===0){const ae=a==="vertical"?se.getBoundingClientRect().height:se.getBoundingClientRect().width;ae>0&&(H=ae,T.set(E,ae))}else for(const ae of X)B.has(ae)||(B.add(ae),ae.addEventListener("load",s,{once:!0}),ae.addEventListener("error",s,{once:!0}))}H===void 0&&(H=T.get(E)),H===void 0&&(H=u(ue,ve)),H!==void 0&&(he.set(E,H),qe.push({id:E,span:U.get(E),mainSize:H}))}const{items:mt,totalMainSize:Ke}=Mt(qe,g,c,o),Ie=w?z():null,ze=[],Ae=[],xe=[];for(const E of mt){const ue=te.get(E.id),ve=he.get(E.id),se=E.laneIndex*(P+m),H=a==="vertical"?se:E.mainPos,X=a==="vertical"?E.mainPos:se,ae=a==="vertical"?ue:ve,pt=a==="vertical"?ve:ue,Ee=j.get(E.id);Ee&&D(Ee,H,X)&&xe.push(Ee),ze.push({id:E.id,x:H,y:X,width:ae,height:pt}),(!Ie||E.mainPos+ve>=Ie[0]&&E.mainPos<=Ie[1])&&Ae.push(E.id)}if(a==="vertical"?e.style.height=`${Ke}px`:i&&(i.style.transform=`translate(${Ke}px, 0)`),xe.length>0){xe[0].offsetHeight;for(const E of xe)E.style.transition=_,E.style.opacity="1",K(E)}R=ze,N=Ae,ie("layout",{items:ze,visibleIds:Ae})}function k(l){const h=new Set(l.map(g=>g.id));for(const g of A)h.has(g)||(q(g),T.delete(g));p.clear(),A=l.map(g=>g.id);for(const g of l)p.set(g.id,g);W()}return V.observe(e),{setItems(l){k(l),s()},updateItem(l,h){const g=p.get(l);g&&(p.set(l,{...g,...h}),W(),s())},addItem(l,h){p.set(l.id,l),h===void 0||h>=A.length?A.push(l.id):A.splice(h,0,l.id),W(),s()},removeItem(l){q(l),p.delete(l),A=A.filter(h=>h!==l),T.delete(l),W(),s()},relayout:s,getLayout(){return[...R]},getVisibleIds(){return[...N]},setDragging(l){Z!==l&&(Z=l,s())},on(l,h){ne.has(l)||ne.set(l,new Set);const g=ne.get(l);return g.add(h),()=>g.delete(h)},destroy(){V.destroy(),Q?.removeEventListener("scroll",F),i?.remove(),p.clear(),A=[],R=[],N=[],T.clear(),Z=null,ne.clear()}}}function ut(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||typeof Node<"u"&&(e instanceof Node||t instanceof Node))return!1;const a=Object.keys(e),n=Object.keys(t);return a.length!==n.length?!1:a.every(o=>ut(e[o],t[o]))}function Et(e,t){if(e===t)return!0;const a=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of a)if(!ut(e[n],t[n]))return!1;return!0}var ce={},Qe=new WeakMap,Lt=0;function Y(e){if(e.id!==void 0)return e.id;let t=Qe.get(e);return t===void 0&&(t=`mk-auto-${++Lt}`,Qe.set(e,t)),t}var Rt=0,et={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"},Ot=ke({name:"MasonryGrid",props:{items:{type:Array,required:!0},options:{type:Object,default:()=>({})},sortable:{type:Boolean,default:!1}},emits:["layout","reorder"],setup(e,{slots:t,emit:a}){const n=`mk-${++Rt}`,o=L(null),c=new Map,m=new Map;let r=null,w=null,$=null,y=null,v=!1;const d=Xe(e.options.virtualize?new Set:null),S=L(!1),b=Xe(new Map),_=new Map;let i=new Set;const p=G(()=>{const s=d.value===null?e.items:e.items.filter(h=>d.value.has(Y(h)));if(b.value.size===0)return s;const k=new Set(s.map(h=>Y(h))),l=[...b.value.values()].filter(h=>!k.has(Y(h)));return l.length===0?s:[...s,...l]});function A(s,k){if(s.size!==k.size)return!1;for(const l of s)if(!k.has(l))return!1;return!0}function R(){return e.options.animate??ce.animate??!0}function N(){return e.options.transitionDuration??ce.transitionDuration??250}function T(){const s=e.options.gap??ce.gap;return typeof s=="number"?{main:s,cross:s}:{main:s?.main??16,cross:s?.cross??16}}function B(){const k=(e.options.direction??ce.direction)==="horizontal"?e.options.rows??ce.rows:e.options.columns??ce.columns;return xt(k,e.options.ssrColumns??ce.ssrColumns)}function re(s){const k=new Set(s.map(h=>Y(h)));for(const h of s)_.set(Y(h),h);let l=null;for(const h of i){if(k.has(h)||b.value.has(h)||!c.get(h)||!R())continue;const g=_.get(h);g&&(l??(l=new Map(b.value)),l.set(h,g),setTimeout(()=>{const P=new Map(b.value);P.delete(h),b.value=P,_.delete(h)},N()))}l&&(b.value=l),i=k}function Z(){if(!r)return;const s=e.items.map(k=>{const l=Y(k);return{id:l,el:c.get(l),colSpan:k.colSpan,rowSpan:k.rowSpan,aspectRatio:k.aspectRatio,estimatedSize:k.estimatedSize,order:k.order}});r.setItems(s)}function ne(){v||(v=!0,queueMicrotask(()=>{v=!1,Z()}))}function ie(s){let k=m.get(s);return k||(k=l=>{l!==c.get(s)&&(l?c.set(s,l):(c.delete(s),m.delete(s)),ne())},m.set(s,k),k)}function V(){if(o.value){d.value=e.options.virtualize?new Set:null,i=new Set(e.items.map(s=>Y(s))),_.clear();for(const s of e.items)_.set(Y(s),s);r=At(o.value,{...ce,...e.options}),w=r.on("layout",s=>{if(S.value=!0,a("layout",s.items),e.options.virtualize){const k=new Set(s.visibleIds);(!d.value||!A(d.value,k))&&(d.value=k)}}),Z()}}const F=L(null),Q=L(""),ee=`${n}-instructions`,W=`${n}-live`;function q(s){Q.value=s}function K(s,k){return`item ${k.findIndex(h=>Y(h)===s)+1} of ${k.length}`}let D=null;function z(s,k,l){const h=s.findIndex(C=>Y(C)===k);if(h===-1)return s;const g=[...s],[P]=g.splice(h,1);return g.splice(Math.max(0,Math.min(l,g.length)),0,P),g}function u(s,k){if(!e.sortable||!r)return;const l=Y(k);if(s.key===" "||s.key==="Enter"){s.preventDefault(),F.value===l?(F.value=null,D=null,r.setDragging(null),q(`Dropped ${K(l,e.items)}.`)):F.value===null&&(F.value=l,D=e.items,r.setDragging(l),q(`Picked up ${K(l,e.items)}. Use arrow keys to move, space to drop, escape to cancel.`));return}if(F.value!==l)return;if(s.key==="Escape"){s.preventDefault(),F.value=null,r.setDragging(null),D&&a("reorder",D),D=null,q("Reordering cancelled.");return}const h=e.options.direction==="horizontal",g=h?"ArrowRight":"ArrowDown",P=h?"ArrowLeft":"ArrowUp";if(s.key!==g&&s.key!==P)return;s.preventDefault();const C=e.items.findIndex(he=>Y(he)===l),j=s.key===g?1:-1,U=C+j;if(U<0||U>=e.items.length)return;const te=z(e.items,l,U);a("reorder",te),q(`Moved to ${K(l,te)}.`)}return Ce(()=>{!o.value||typeof window>"u"||(V(),$=Ve(()=>e.items,s=>{re(s),Z()},{deep:!0}),y=Ve(()=>e.options,(s,k)=>{Et(s,k)||(w?.(),r?.destroy(),V())},{deep:!0}))}),Ge(()=>{$?.(),y?.(),w?.(),r?.destroy()}),()=>Me("div",{ref:o,class:"mk-grid",style:S.value?{}:{columns:B(),columnGap:`${T().cross}px`}},[...p.value.map(s=>{const k=Y(s),l=b.value.has(k),h=e.sortable?{tabindex:0,role:"button","aria-roledescription":"Reorderable item","aria-describedby":ee,"aria-pressed":F.value===k?"true":"false",onKeydown:g=>u(g,s)}:{};return Me("div",{key:k,class:"mk-item",style:{...S.value?{}:{breakInside:"avoid",marginBottom:`${T().main}px`},...l?{pointerEvents:"none"}:{}},ref:ie(k),...h},t.item?.({item:s}))}),e.sortable?Me("span",{id:ee,style:et},"Press space or enter to pick up this item. While picked up, use the arrow keys to move it, space or enter to drop it, or escape to cancel."):null,e.sortable?Me("span",{id:W,role:"status","aria-live":"polite",style:et},Q.value):null])}});function ct(e=1200){const t=L("");async function a(n,o){try{await navigator.clipboard.writeText(o),t.value=n,setTimeout(()=>{t.value===n&&(t.value="")},e)}catch{t.value=""}}return{copied:t,copy:a}}const Tt={key:1,class:"canvas canvas--bad",title:"Could not decode this hash"},Pt=ke({__name:"PlaceholderCanvas",props:{rgba:{}},setup(e){const t=e,a=L();function n(){const o=a.value;if(!o||!t.rgba)return;o.width=t.rgba.width,o.height=t.rgba.height;const c=o.getContext("2d");if(!c)return;const m=c.createImageData(t.rgba.width,t.rgba.height);m.data.set(t.rgba.data),c.putImageData(m,0,0)}return Ce(n),Ve(()=>t.rgba,n),(o,c)=>e.rgba?(x(),M("canvas",{key:0,ref_key:"canvas",ref:a,class:"canvas"},null,512)):(x(),M("div",Tt,"?"))}}),dt=$e(Pt,[["__scopeId","data-v-af1c304e"]]);var Nt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],ge=e=>{let t=0;for(let a=0;a<e.length;a++){let n=e[a],o=Nt.indexOf(n);t=t*83+o}return t},Pe=e=>{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Ne=e=>{let t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.trunc(t*12.92*255+.5):Math.trunc((1.055*Math.pow(t,.4166666666666667)-.055)*255+.5)},jt=e=>e<0?-1:1,je=(e,t)=>jt(e)*Math.pow(Math.abs(e),t),tt=class extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}},Dt=e=>{if(!e||e.length<6)throw new tt("The blurhash string must be at least 6 characters");let t=ge(e[0]),a=Math.floor(t/9)+1,n=t%9+1;if(e.length!==4+2*n*a)throw new tt(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*n*a}`)},Ut=e=>{let t=e>>16,a=e>>8&255,n=e&255;return[Pe(t),Pe(a),Pe(n)]},Bt=(e,t)=>{let a=Math.floor(e/361),n=Math.floor(e/19)%19,o=e%19;return[je((a-9)/9,2)*t,je((n-9)/9,2)*t,je((o-9)/9,2)*t]},Ft=(e,t,a,n)=>{Dt(e),n=n|1;let o=ge(e[0]),c=Math.floor(o/9)+1,m=o%9+1,r=(ge(e[1])+1)/166,w=new Array(m*c);for(let v=0;v<w.length;v++)if(v===0){let d=ge(e.substring(2,6));w[v]=Ut(d)}else{let d=ge(e.substring(4+v*2,6+v*2));w[v]=Bt(d,r*n)}let $=t*4,y=new Uint8ClampedArray($*a);for(let v=0;v<a;v++)for(let d=0;d<t;d++){let S=0,b=0,_=0;for(let R=0;R<c;R++)for(let N=0;N<m;N++){let T=Math.cos(Math.PI*d*N/t)*Math.cos(Math.PI*v*R/a),B=w[N+R*m];S+=B[0]*T,b+=B[1]*T,_+=B[2]*T}let i=Ne(S),p=Ne(b),A=Ne(_);y[4*d+0+v*$]=i,y[4*d+1+v*$]=p,y[4*d+2+v*$]=A,y[4*d+3+v*$]=255}return y},Vt=Ft;const nt=new Map;function st(e,t){const a=e*4096+t;let n=nt.get(a);if(!n){n=new Float64Array(e*t);for(let o=0;o<e;o++)for(let c=0;c<t;c++)n[o*t+c]=Math.cos(Math.PI*o*(c+.5)/t);nt.set(a,n)}return n}function Ht(e,t,a,n,o,c,m){const r=st(a,o),w=st(n,c),$=new Float64Array(a);for(let y=0;y<c;y++){for(let v=0;v<a;v++){let d=0;for(let S=0;S<n;S++){const b=e[S*t+v];b!==0&&(d+=b*w[S*c+y])}$[v]=d}for(let v=0;v<o;v++){let d=0;for(let S=0;S<a;S++)d+=$[S]*r[S*o+v];m[y*o+v]=d}}}var we=class extends Error{constructor(e,t){super(t?`${e}: ${t}`:e),this.name="PlaceholderError",this.code=e}};const Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",ft=new Int8Array(128).fill(-1);for(let e=0;e<64;e++)ft[Gt.charCodeAt(e)]=e;function Wt(e){const t=e.length;if(t%4===1)throw new we("InvalidLength");const a=new Uint8Array(Math.floor(t*6/8));let n=0,o=0,c=0;for(let m=0;m<t;m++){const r=e.charCodeAt(m),w=r<128?ft[r]:-1;if(w<0)throw new we("InvalidCharacter");n=n<<6|w,o+=6,o>=8&&(o-=8,a[c++]=n>>o&255,n&=(1<<o)-1)}return a}function qt(e){return typeof e=="string"?Wt(e):e}var ht=class{constructor(e,t=0){this.bytes=e,this.pos=t*8,this.end=e.length*8}bit(){if(this.pos>=this.end)return 0;const e=this.pos++;return this.bytes[e>>3]>>7-(e&7)&1}bits(e){let t=0;for(let a=0;a<e;a++)t=t<<1|this.bit();return t>>>0}};function Kt(e,t){let a=0;for(;e.bit()===1;)a++;const n=a*(1<<t)+(t>0?e.bits(t):0);return n&1?-((n+1)/2):n/2}function Xt(e){return e?9:7}function Yt(e){return Math.pow(2,(e-32)/8)}function Jt(e,t){return e>=1?[t,Math.max(1,Math.round(t/e))]:[Math.max(1,Math.round(t*e)),t]}function Zt(e){if(e.length<7||e.length>1024)throw new we("InvalidLength");const t=new ht(e);if(t.bits(2)!==0)throw new we("UnsupportedVersion");const a=t.bit()===1;if(a&&e.length<9)throw new we("InvalidLength");const n={aspectCode:t.bits(6),alpha:a,Lx:t.bits(3)+1,Ly:t.bits(3)+1,Cx:t.bits(2)+1,Cy:t.bits(2)+1,Ax:1,Ay:1,dc:[0,0,0,0],scale:[0,0,0,0],k:[0,0,0,0]};for(let o=0;o<3;o++)n.dc[o]=t.bits(6);for(let o=0;o<3;o++)n.scale[o]=t.bits(4);for(let o=0;o<3;o++)n.k[o]=t.bits(2);return t.bit(),a&&(n.dc[3]=t.bits(5),n.Ax=t.bits(2)+1,n.Ay=t.bits(2)+1,n.scale[3]=t.bits(4),n.k[3]=t.bits(2)),n}const _e={qmaxL:7,qmaxC:3,smaxL:.64,smaxC:.32,reconOffset:0};function Qt(e){return e===0?_e.qmaxL:_e.qmaxC}function en(e,t,a,n){return 2*(e*n+t*a)<3*a*n}function We(e,t){return t===0?[e.Lx,e.Ly]:t===3?[e.Ax,e.Ay]:[e.Cx,e.Cy]}function tn(e){const t=[],a=e.alpha?[0,1,2,3]:[0,1,2];for(const n of a){const[o,c]=We(e,n);for(let m=0;m<c;m++)for(let r=0;r<o;r++)r===0&&m===0||!en(r,m,o,c)||t.push({ch:n,i:r,j:m,nx:o,ny:c,qmax:Qt(n)})}return t.sort((n,o)=>{const c=n.i*n.i*n.ny*n.ny+n.j*n.j*n.nx*n.nx,m=n.nx*n.nx*n.ny*n.ny,r=o.i*o.i*o.ny*o.ny+o.j*o.j*o.nx*o.nx,w=c*(o.nx*o.nx*o.ny*o.ny)-r*m;return w!==0?w:n.ch!==o.ch?n.ch-o.ch:n.j!==o.j?n.j-o.j:n.i-o.i}),t}function Se(e,t,a){return e<t?t:e>a?a:e}function nn(e,t){return e===0?t/63:e===3?t/31:t*.64/63-.32}const sn=Array.from({length:16},(e,t)=>Math.pow(2,-(15-t)/3));function an(e,t){return(e===1||e===2?_e.smaxC:_e.smaxL)*sn[t]}function on(e,t,a){if(e===0)return 0;const n=(Math.abs(e)-_e.reconOffset)/a,o=t*n*n;return e<0?-o:o}function ln(e){return e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}function De(e,t,a,n){const o=e+.3963377774*t+.2158037573*a,c=e-.1055613458*t-.0638541728*a,m=e-.0894841775*t-1.291485548*a,r=o*o*o,w=c*c*c,$=m*m*m;n[0]=4.0767416621*r-3.3077115913*w+.2309699292*$,n[1]=-1.2684380046*r+2.6097574011*w-.3413193965*$,n[2]=-.0041960863*r-.7034186147*w+1.707614701*$}const Ue=-5e-4,Be=1.0005,at=[0,0,0];function ot(e){return e[0]>=Ue&&e[0]<=Be&&e[1]>=Ue&&e[1]<=Be&&e[2]>=Ue&&e[2]<=Be}function rn(e,t,a,n){if(De(e,t,a,n),!ot(n)){let o=0,c=1;for(let m=0;m<8;m++){const r=(o+c)/2;De(e,t*r,a*r,at),ot(at)?o=r:c=r}De(e,t*o,a*o,n)}for(let o=0;o<3;o++)n[o]=n[o]<0?0:n[o]>1?1:n[o]}function un(e,t){const a=t,n=t.alpha?[0,1,2,3]:[0,1,2],o=[];for(const r of n){const[w,$]=We(a,r),y=new Float64Array(w*$);y[0]=nn(r,t.dc[r]),o[r]=y}const c=n.map(r=>an(r,t.scale[r])),m=new ht(e,Xt(t.alpha));for(const r of tn(a)){let w=Kt(m,t.k[r.ch]);w=w>r.qmax?r.qmax:w<-r.qmax?-r.qmax:w,o[r.ch][r.j*r.nx+r.i]=on(w,c[r.ch],r.qmax)}return o}function cn(e,t={}){const a=qt(e),n=Zt(a),o=Math.round(Se(t.size??32,4,128)),c=t.dither??!0,[m,r]=Jt(Yt(n.aspectCode),o),w=un(a,n),$=n,y=m*r,v=[];for(let b=0;b<w.length;b++){const[_,i]=We($,b),p=new Float64Array(y);Ht(w[b],_,_,i,m,r,p),v.push(p)}const d=new Uint8ClampedArray(y*4),S=[0,0,0];for(let b=0;b<r;b++)for(let _=0;_<m;_++){const i=b*m+_;rn(Se(v[0][i],0,1),v[1][i],v[2][i],S);const p=c?lt(52.9829189*lt(.06711056*_+.00583715*b)):.5,A=i*4;for(let R=0;R<3;R++){const N=ln(S[R])*255;d[A+R]=Se(Math.floor(N+p),0,255)}d[A+3]=n.alpha?Math.round(Se(v[3][i],0,1)*255):255}return{width:m,height:r,data:d}}function lt(e){return e-Math.floor(e)}function dn(e){let{PI:t,min:a,max:n,cos:o,round:c}=Math,m=e[0]|e[1]<<8|e[2]<<16,r=e[3]|e[4]<<8,w=(m&63)/63,$=(m>>6&63)/31.5-1,y=(m>>12&63)/31.5-1,v=(m>>18&31)/31,d=m>>23,S=(r>>3&63)/63,b=(r>>9&63)/63,_=r>>15,i=n(3,_?d?5:7:r&7),p=n(3,_?r&7:d?5:7),A=d?(e[5]&15)/15:1,R=(e[5]>>4)/15,N=d?6:5,T=0,B=(K,D,z)=>{let u=[];for(let s=0;s<D;s++)for(let k=s?0:1;k*D<K*(D-s);k++)u.push(((e[N+(T>>1)]>>((T++&1)<<2)&15)/7.5-1)*z);return u},re=B(i,p,v),Z=B(3,3,S*1.25),ne=B(3,3,b*1.25),ie=d&&B(5,5,R),V=fn(e),F=c(V>1?32:32*V),Q=c(V>1?32/V:32),ee=new Uint8Array(F*Q*4),W=[],q=[];for(let K=0,D=0;K<Q;K++)for(let z=0;z<F;z++,D+=4){let u=w,s=$,k=y,l=A;for(let C=0,j=n(i,d?5:3);C<j;C++)W[C]=o(t/F*(z+.5)*C);for(let C=0,j=n(p,d?5:3);C<j;C++)q[C]=o(t/Q*(K+.5)*C);for(let C=0,j=0;C<p;C++)for(let U=C?0:1,te=q[C]*2;U*p<i*(p-C);U++,j++)u+=re[j]*W[U]*te;for(let C=0,j=0;C<3;C++)for(let U=C?0:1,te=q[C]*2;U<3-C;U++,j++){let he=W[U]*te;s+=Z[j]*he,k+=ne[j]*he}if(d)for(let C=0,j=0;C<5;C++)for(let U=C?0:1,te=q[C]*2;U<5-C;U++,j++)l+=ie[j]*W[U]*te;let h=u-2/3*s,g=(3*u-h+k)/2,P=g-k;ee[D]=n(0,255*a(1,g)),ee[D+1]=n(0,255*a(1,P)),ee[D+2]=n(0,255*a(1,h)),ee[D+3]=n(0,255*a(1,l))}return{w:F,h:Q,rgba:ee}}function fn(e){let t=e[3],a=e[2]&128,n=e[4]&128,o=n?a?5:7:t&7,c=n?t&7:a?5:7;return o/c}const be=32;function hn(e,t,a){const n=t>0&&a>0?t/a:1,o=n>=1?be:Math.max(1,Math.round(be*n)),c=n>=1?Math.max(1,Math.round(be/n)):be;try{return{width:o,height:c,data:Vt(e,o,c)}}catch{return null}}function vn(e){try{const t=atob(e),a=Uint8Array.from(t,o=>o.charCodeAt(0)),n=dn(a);return{width:n.w,height:n.h,data:new Uint8ClampedArray(n.rgba)}}catch{return null}}function mn(e){try{const t=cn(e,{size:be});return{width:t.width,height:t.height,data:new Uint8ClampedArray(t.data)}}catch{return null}}function vt(e,t,a,n){return e==="blurhash"?hn(t,a,n):e==="thumbhash"?vn(t):mn(t)}const pn={class:"item card"},yn=["aria-label"],gn=["alt","src"],bn={class:"strip__label"},wn=["src"],_n={class:"meta"},kn=["title"],xn={class:"muted"},Mn={class:"hashes"},Sn={class:"hashes__key"},Cn=["title"],$n=["aria-label","onClick"],In=ke({__name:"ResultCard",props:{entry:{}},emits:["open"],setup(e,{emit:t}){const a=e,n=t,o=["hazehash","blurhash","thumbhash"],{copied:c,copy:m}=ct(),r=G(()=>{const{width:y,height:v}=a.entry;return y>0&&v>0?Math.min(Math.max(y/v,.5),2):1}),w=G(()=>o.filter(y=>a.entry[y]!==void 0).map(y=>({type:y,rgba:vt(y,a.entry[y],a.entry.width,a.entry.height)}))),$=G(()=>{const y=[];for(const v of["hazehash","blurhash","thumbhash","color"]){const d=a.entry[v];d!==void 0&&y.push({key:v,value:d})}return y});return(y,v)=>(x(),M("article",pn,[f("button",{class:"item__open","aria-label":`Open ${e.entry.file}`,onClick:v[0]||(v[0]=d=>n("open"))},[f("span",{class:"shots",style:me({aspectRatio:String(r.value)})},[f("img",{class:"shot",loading:"lazy",alt:e.entry.file,src:pe(rt)(e.entry.path,480)},null,8,gn)],4),w.value.length>0?(x(),M("span",{key:0,class:"strip",style:me({aspectRatio:String(r.value*w.value.length)})},[(x(!0),M(oe,null,de(w.value,d=>(x(),M("span",{key:d.type,class:"strip__cell"},[J(dt,{rgba:d.rgba},null,8,["rgba"]),f("span",bn,I(d.type),1)]))),128))],4)):O("",!0),e.entry.preview?(x(),M("img",{key:1,class:"preview",alt:"Tiny preview",src:e.entry.preview},null,8,wn)):O("",!0)],8,yn),f("div",_n,[f("strong",{class:"meta__name",title:e.entry.path},I(e.entry.file),9,kn),f("span",xn,I(e.entry.width)+"×"+I(e.entry.height),1)]),f("ul",Mn,[(x(!0),M(oe,null,de($.value,d=>(x(),M("li",{key:d.key},[f("span",Sn,[d.key==="color"?(x(),M("span",{key:0,class:"swatch",style:me({background:d.value})},null,4)):O("",!0),le(" "+I(d.key),1)]),f("code",{class:"hashes__value",title:d.value},I(d.value),9,Cn),f("button",{class:"btn btn--ghost btn--small","aria-label":`Copy ${d.key}`,onClick:S=>pe(m)(d.key,d.value)},[J(fe,{name:pe(c)===d.key?"check":"copy",size:14},null,8,["name"])],8,$n)]))),128))])]))}}),zn=$e(In,[["__scopeId","data-v-ede0ed45"]]),An={class:"muted counter"},En=["disabled"],Ln=["disabled"],Rn={class:"scroll"},On={class:"stage"},Tn=["alt","src"],Pn={key:0,class:"compare"},Nn={key:0,class:"compare__item"},jn=["src"],Dn={class:"facts"},Un={class:"facts__row"},Bn={class:"facts__mono"},Fn={class:"facts__row"},Vn={class:"facts__mono facts__hash"},Hn=["aria-label","onClick"],Gn=ke({__name:"ResultModal",props:{entries:{},index:{}},emits:["close","update:index"],setup(e,{emit:t}){const a=e,n=t,o=["hazehash","blurhash","thumbhash"],{copied:c,copy:m}=ct(),r=G(()=>a.entries[a.index]),w=G(()=>a.index>0),$=G(()=>a.index<a.entries.length-1),y=G(()=>{const{width:_,height:i}=r.value;return _>0&&i>0?_/i:1}),v=G(()=>o.filter(_=>r.value[_]!==void 0).map(_=>({type:_,rgba:vt(_,r.value[_],r.value.width,r.value.height)}))),d=G(()=>{const _=[];for(const i of["hazehash","blurhash","thumbhash","color"]){const p=r.value[i];p!==void 0&&_.push({key:i,value:p})}return _});function S(_){const i=a.index+_;i>=0&&i<a.entries.length&&n("update:index",i)}function b(_){_.target instanceof HTMLInputElement||(_.key==="ArrowLeft"&&S(-1),_.key==="ArrowRight"&&S(1))}return Ce(()=>window.addEventListener("keydown",b)),Ge(()=>window.removeEventListener("keydown",b)),(_,i)=>(x(),it(bt,{title:r.value.file,width:"1040px",onClose:i[2]||(i[2]=p=>n("close"))},{actions:He(()=>[f("span",An,I(e.index+1)+" / "+I(e.entries.length),1),f("button",{class:"btn btn--small",disabled:!w.value,"aria-label":"Previous image",onClick:i[0]||(i[0]=p=>S(-1))},[J(fe,{name:"left",size:15})],8,En),f("button",{class:"btn btn--small",disabled:!$.value,"aria-label":"Next image",onClick:i[1]||(i[1]=p=>S(1))},[J(fe,{name:"right",size:15})],8,Ln)]),default:He(()=>[f("div",Rn,[f("div",On,[(x(),M("img",{key:r.value.path,class:"stage__img",alt:r.value.file,src:pe(rt)(r.value.path,1600)},null,8,Tn))]),v.value.length?(x(),M("div",Pn,[(x(!0),M(oe,null,de(v.value,p=>(x(),M("figure",{key:p.type,class:"compare__item"},[f("div",{class:"compare__frame",style:me({aspectRatio:String(y.value)})},[J(dt,{rgba:p.rgba},null,8,["rgba"])],4),f("figcaption",null,I(p.type),1)]))),128)),r.value.preview?(x(),M("figure",Nn,[f("div",{class:"compare__frame",style:me({aspectRatio:String(y.value)})},[f("img",{class:"compare__preview",alt:"Tiny preview",src:r.value.preview},null,8,jn)],4),i[3]||(i[3]=f("figcaption",null,"preview",-1))])):O("",!0)])):O("",!0),f("dl",Dn,[f("div",Un,[i[4]||(i[4]=f("dt",null,"File",-1)),f("dd",Bn,I(r.value.path),1)]),f("div",Fn,[i[5]||(i[5]=f("dt",null,"Size",-1)),f("dd",null,I(r.value.width)+" × "+I(r.value.height)+" px",1)]),(x(!0),M(oe,null,de(d.value,p=>(x(),M("div",{key:p.key,class:"facts__row"},[f("dt",null,[p.key==="color"?(x(),M("span",{key:0,class:"swatch",style:me({background:p.value})},null,4)):O("",!0),le(" "+I(p.key),1)]),f("dd",Vn,I(p.value),1),f("button",{class:"btn btn--ghost btn--small","aria-label":`Copy ${p.key}`,onClick:A=>pe(m)(p.key,p.value)},[J(fe,{name:pe(c)===p.key?"check":"copy",size:14},null,8,["name"])],8,Hn)]))),128))])])]),_:1},8,["title"]))}}),Wn=$e(Gn,[["__scopeId","data-v-4cbae639"]]),qn={class:"page"},Kn={class:"page__head"},Xn={class:"muted"},Yn={key:0,class:"notice notice--warn"},Jn={class:"card block"},Zn={class:"types"},Qn=["checked","onChange"],es={class:"type__title"},ts={class:"type__text muted"},ns={class:"grid"},ss={key:0,class:"field"},as=["min","max"],os={key:1,class:"field"},ls=["value"],rs={class:"field"},is=["value"],us={key:2,class:"field"},cs={class:"runbar"},ds=["disabled"],fs={key:0,class:"muted"},hs={key:1,class:"muted"},vs={key:1,class:"card block",role:"status"},ms={class:"progress"},ps={class:"muted"},ys={key:0},gs={key:2,class:"notice notice--error"},bs={key:3,class:"card block"},ws={class:"block__head"},_s={class:"muted"},ks={key:0},xs={key:1},Ms={key:0,class:"errors"},Ss={class:"tabs",role:"tablist"},Cs=["aria-selected"],$s=["aria-selected"],Is={key:0,class:"muted"},zs={key:1,class:"more"},As={class:"outbar"},Es=["disabled"],Ls={key:0,class:"muted"},Rs={class:"output"},Fe=48,Os=ke({__name:"ImageHashPage",props:{module:{},status:{}},setup(e){const t={columns:"auto",minLaneSize:250,gap:14},a=["auto","3x3","4x3","4x4","5x4","6x4","8x6"],n={json:"json",plain:"txt",csv:"csv",ts:"ts",js:"js"},o=L(),c=L([]),m=L(!0),r=L(["hazehash","color"]),w=L(28),$=L("auto"),y=L("json"),v=L("imageHashes"),d=L(null),S=L("idle"),b=L({done:0,total:0,cached:0}),_=L(""),i=L(),p=L("gallery"),A=L(Fe),R=L(""),N=L(""),T=L(!1);let B;const re=G(()=>_.value.toLowerCase().includes("sharp")),Z=G(()=>c.value.length>0&&r.value.length>0&&S.value!=="running"),ne=G(()=>b.value.total>0?Math.round(b.value.done/b.value.total*100):0),ie=G(()=>i.value?.entries.slice(0,A.value)??[]),V=G(()=>ie.value.map((z,u)=>({id:z.path,position:u})));function F(z){return ie.value[Number(z.position)]}function Q(z){r.value=r.value.includes(z)?r.value.filter(u=>u!==z):[...r.value,z]}function ee(z,u){const s=z.includes("\\")?"\\":"/";return`${z}${z.endsWith(s)?"":s}image-hashes.${n[u]??"txt"}`}async function W(z=!1){B?.(),S.value="running",_.value="",i.value=void 0,N.value="",b.value={done:0,total:0,cached:0},A.value=Fe,d.value=null;try{const{jobId:u}=await Le.post("/api/image-hash/run",{paths:c.value,recursive:m.value,types:r.value,components:$.value,budget:w.value,format:y.value,exportName:v.value,installSharp:z});B=yt(u,{onProgress:s=>{b.value=s},onDone:s=>{i.value=s,S.value="done",p.value="gallery",R.value=ee(s.base,s.format)},onFailed:s=>{_.value=s,S.value="failed"}})}catch(u){_.value=u instanceof Error?u.message:String(u),S.value="failed"}}async function q(){if(i.value?.output)try{await navigator.clipboard.writeText(i.value.output),T.value=!0,setTimeout(()=>T.value=!1,1200)}catch{T.value=!1}}function K(){const z=i.value?.output;if(!z)return;const u=new Blob([z],{type:"text/plain;charset=utf-8"}),s=document.createElement("a");s.href=URL.createObjectURL(u),s.download=`image-hashes.${n[i.value?.format??"json"]??"txt"}`,s.click(),URL.revokeObjectURL(s.href)}async function D(z=!1){if(i.value?.output){N.value="";try{const u=await Le.post("/api/image-hash/save",{path:R.value,content:i.value.output,overwrite:z});N.value=`Saved to ${u.path}`}catch(u){if(u instanceof gt&&u.status===409){window.confirm(`${u.message}. Replace it?`)&&await D(!0);return}N.value=u instanceof Error?u.message:String(u)}}}return Ce(async()=>{try{o.value=await Le.get("/api/image-hash/options"),w.value=o.value.budget.default,$.value=o.value.components.auto?"auto":o.value.components.default,v.value=o.value.exportName}catch(z){_.value=z instanceof Error?z.message:String(z),S.value="failed"}}),Ge(()=>{B?.()}),(z,u)=>(x(),M("div",qn,[f("header",Kn,[f("h1",null,I(e.module.title),1),f("p",Xn,I(e.module.description),1)]),o.value&&!o.value.sharp?(x(),M("div",Yn," The sharp image library is not installed yet. Previews are limited, and the first run will offer to install it. ")):O("",!0),J(wt,{sources:c.value,"onUpdate:sources":u[0]||(u[0]=s=>c.value=s),recursive:m.value,"onUpdate:recursive":u[1]||(u[1]=s=>m.value=s),"scan-url":"/api/image-hash/scan",start:e.status?.cwd??""},null,8,["sources","recursive","start"]),f("section",Jn,[u[19]||(u[19]=f("h2",null,"Placeholders",-1)),f("div",Zn,[(x(!0),M(oe,null,de(o.value?.types,s=>(x(),M("label",{key:s.id,class:Re(["type",{"type--on":r.value.includes(s.id)}])},[f("input",{type:"checkbox",checked:r.value.includes(s.id),onChange:k=>Q(s.id)},null,40,Qn),f("span",es,I(s.title),1),f("span",ts,I(s.description),1)],2))),128))]),f("div",ns,[r.value.includes("hazehash")?(x(),M("label",ss,[f("span",null,"Hazehash size: "+I(w.value)+" bytes",1),ye(f("input",{"onUpdate:modelValue":u[2]||(u[2]=s=>w.value=s),type:"range",min:o.value?.budget.min,max:o.value?.budget.max},null,8,as),[[Oe,w.value,void 0,{number:!0}]])])):O("",!0),r.value.includes("blurhash")?(x(),M("label",os,[u[16]||(u[16]=f("span",null,"Blurhash components",-1)),ye(f("select",{"onUpdate:modelValue":u[3]||(u[3]=s=>$.value=s),class:"select"},[(x(),M(oe,null,de(a,s=>f("option",{key:s,value:s},I(s==="auto"?"auto (by aspect ratio)":s),9,ls)),64))],512),[[Ye,$.value]])])):O("",!0),f("label",rs,[u[17]||(u[17]=f("span",null,"Output format",-1)),ye(f("select",{"onUpdate:modelValue":u[4]||(u[4]=s=>y.value=s),class:"select"},[(x(!0),M(oe,null,de(o.value?.formats,s=>(x(),M("option",{key:s,value:s},I(s),9,is))),128))],512),[[Ye,y.value]])]),y.value==="ts"||y.value==="js"?(x(),M("label",us,[u[18]||(u[18]=f("span",null,"Export name",-1)),ye(f("input",{"onUpdate:modelValue":u[5]||(u[5]=s=>v.value=s),class:"input",spellcheck:"false"},null,512),[[Oe,v.value]])])):O("",!0)])]),f("div",cs,[f("button",{class:"btn btn--primary",disabled:!Z.value,onClick:u[6]||(u[6]=s=>W(!1))},[J(fe,{name:"play",size:15}),le(" "+I(S.value==="running"?"Working…":"Compute hashes"),1)],8,ds),c.value.length===0?(x(),M("span",fs,"Add at least one folder or image.")):r.value.length===0?(x(),M("span",hs,"Pick at least one placeholder.")):O("",!0)]),S.value==="running"?(x(),M("div",vs,[f("div",ms,[f("div",{class:"progress__bar",style:me({width:`${ne.value}%`})},null,4)]),f("span",ps,[le(I(b.value.done)+" of "+I(b.value.total||"…")+" images",1),b.value.cached?(x(),M("span",ys," · "+I(b.value.cached)+" from cache",1)):O("",!0)])])):O("",!0),S.value==="failed"?(x(),M("div",gs,[f("p",null,I(_.value),1),re.value?(x(),M("button",{key:0,class:"btn btn--small",onClick:u[7]||(u[7]=s=>W(!0))}," Install sharp and retry ")):O("",!0)])):O("",!0),i.value?(x(),M("section",bs,[f("div",ws,[u[20]||(u[20]=f("h2",null,"Result",-1)),f("span",_s,[le(I(i.value.entries.length)+" image"+I(i.value.entries.length===1?"":"s")+" ",1),i.value.cached?(x(),M("span",ks,"· "+I(i.value.cached)+" cached",1)):O("",!0),i.value.errors.length?(x(),M("span",xs,"· "+I(i.value.errors.length)+" failed",1)):O("",!0)])]),i.value.errors.length?(x(),M("ul",Ms,[(x(!0),M(oe,null,de(i.value.errors,s=>(x(),M("li",{key:s.file},[f("code",null,I(s.file),1),le(" — "+I(s.message),1)]))),128))])):O("",!0),f("div",Ss,[f("button",{class:Re(["tab",{"tab--on":p.value==="gallery"}]),role:"tab","aria-selected":p.value==="gallery",onClick:u[8]||(u[8]=s=>p.value="gallery")}," Gallery ",10,Cs),f("button",{class:Re(["tab",{"tab--on":p.value==="output"}]),role:"tab","aria-selected":p.value==="output",onClick:u[9]||(u[9]=s=>p.value="output")}," Output ("+I(i.value.format)+") ",11,$s)]),p.value==="gallery"?(x(),M(oe,{key:1},[i.value.entries.length===0?(x(),M("p",Is,"No images were found.")):O("",!0),J(pe(Ot),{class:"gallery",items:V.value,options:t},{item:He(({item:s})=>[J(zn,{entry:F(s),onOpen:k=>d.value=Number(s.position)},null,8,["entry","onOpen"])]),_:1},8,["items"]),A.value<i.value.entries.length?(x(),M("div",zs,[f("button",{class:"btn",onClick:u[10]||(u[10]=s=>A.value+=Fe)}," Show more ("+I(i.value.entries.length-A.value)+" left) ",1),f("button",{class:"btn",onClick:u[11]||(u[11]=s=>A.value=i.value.entries.length)}," Show all ("+I(i.value.entries.length)+") ",1)])):O("",!0)],64)):(x(),M(oe,{key:2},[f("div",As,[f("button",{class:"btn btn--small",onClick:q},[J(fe,{name:T.value?"check":"copy",size:15},null,8,["name"]),le(" "+I(T.value?"Copied":"Copy"),1)]),f("button",{class:"btn btn--small",onClick:K},[J(fe,{name:"download",size:15}),u[21]||(u[21]=le(" Download ",-1))]),ye(f("input",{"onUpdate:modelValue":u[12]||(u[12]=s=>R.value=s),class:"input outbar__path",spellcheck:"false","aria-label":"File to write"},null,512),[[Oe,R.value]]),f("button",{class:"btn btn--small",disabled:R.value.trim()==="",onClick:u[13]||(u[13]=s=>D(!1))},[J(fe,{name:"save",size:15}),u[22]||(u[22]=le(" Write to file ",-1))],8,Es)]),N.value?(x(),M("p",Ls,I(N.value),1)):O("",!0),f("pre",Rs,I(i.value.output),1)],64))])):O("",!0),i.value&&d.value!==null?(x(),it(Wn,{key:4,index:d.value,"onUpdate:index":u[14]||(u[14]=s=>d.value=s),entries:i.value.entries,onClose:u[15]||(u[15]=s=>d.value=null)},null,8,["index","entries"])):O("",!0)]))}}),Ns=$e(Os,[["__scopeId","data-v-8acfc1cb"]]);export{Ns as default};
1
+ import{d as ke,s as Xe,o as Ce,w as Ve,a as Ge,h as Me,r as L,c as G,b as x,e as M,_ as $e,f,n as me,u as pe,i as rt,F as oe,g as de,j as J,t as I,k as O,l as le,m as fe,p as it,q as He,v as Le,x as Re,y as ye,z as Oe,A as Ye,B as yt,C as gt}from"./index-Dzvs2f2Q.js";import{U as bt,S as wt}from"./SourcePicker-eKj_VZzO.js";function _t(e,t,a,n){if(e==="auto")return Math.max(1,Math.floor((t+n)/(a+n)));if(typeof e=="number")return Math.max(1,Math.floor(e));const o=Object.keys(e).filter(c=>c!=="default").map(Number).sort((c,m)=>c-m);for(const c of o)if(t<=c)return Math.max(1,Math.floor(e[c]));return Math.max(1,Math.floor(e.default))}function kt(e,t,a){return Math.max(0,(e-(t-1)*a)/t)}function xt(e,t){return t!==void 0?Math.max(1,Math.floor(t)):e===void 0||e==="auto"?2:typeof e=="number"?Math.max(1,Math.floor(e)):Math.max(1,Math.floor(e.default))}function Mt(e,t,a,n="balanced"){const o=Math.max(1,Math.floor(t)||1),c=new Array(o).fill(0),m=[];let r=0;for(const $ of e){const y=Math.min(Math.max(1,Math.floor($.span)||1),o);let v;if(n==="ordered")v=r+y<=o?r:0,r=v+y,r>=o&&(r=0);else{let b=0,_=1/0;for(let i=0;i<=o-y;i++){let p=0;for(let A=i;A<i+y;A++)p=Math.max(p,c[A]);p<_&&(_=p,b=i)}v=b}let d=0;for(let b=v;b<v+y;b++)d=Math.max(d,c[b]);m.push({id:$.id,laneIndex:v,span:y,mainPos:d});const S=d+$.mainSize+a;for(let b=v;b<v+y;b++)c[b]=S}const w=m.length?Math.max(0,Math.max(...c)-a):0;return{items:m,totalMainSize:w}}function St(e){const t=new Set;let a=!1;function n(){a||(a=!0,requestAnimationFrame(()=>{a=!1,e()}))}const o=typeof ResizeObserver>"u"?null:new ResizeObserver(n);return{observe(c){t.has(c)||(t.add(c),o?.observe(c))},unobserveAll(){for(const c of t)o?.unobserve(c);t.clear()},scheduleNow:n,destroy(){o?.disconnect(),t.clear()}}}var Ct=240,Je=16,Ze=600,$t=250,It="cubic-bezier(0.2, 0, 0, 1)";function Te(e){return typeof e.el=="function"?e.el():e.el??null}function zt(e){return(e instanceof HTMLImageElement?[e]:Array.from(e.querySelectorAll("img"))).filter(a=>!a.complete)}function At(e,t={}){const a=t.direction??"vertical",n=t.minLaneSize??Ct,o=t.placement??"balanced",c=typeof t.gap=="number"?t.gap:t.gap?.main??Je,m=typeof t.gap=="number"?t.gap:t.gap?.cross??Je,r=a==="horizontal"?t.rows??"auto":t.columns??"auto",w=!!t.virtualize,$=typeof t.virtualize=="object"?t.virtualize.overscan??Ze:Ze,y=t.scrollContainer??(a==="vertical"?"window":"self"),v=t.estimateSize,d=t.animate??!0,S=t.transitionDuration??$t,b=t.transitionEasing??It,_=`transform ${S}ms ${b}, opacity ${S}ms ${b}`;e.style.position="relative",d&&(e.style.setProperty("--mk-transition-duration",`${S}ms`),e.style.setProperty("--mk-transition-easing",b));let i=null;a==="horizontal"?(e.style.overflowX="auto",e.style.overflowY="hidden",i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.width="1px",i.style.height="1px",i.style.visibility="hidden",i.style.pointerEvents="none",e.appendChild(i)):e.style.overflowX="clip";const p=new Map;let A=[],R=[],N=[];const T=new Map,B=new WeakSet;let re=!1,Z=null;const ne=new Map;function ie(l,h){for(const g of ne.get(l)??[])g(h)}const V=St(s);function F(){V.scheduleNow()}const Q=w?y==="window"?window:y==="self"?e:y:null;Q?.addEventListener("scroll",F,{passive:!0});function ee(){return A.map((l,h)=>({id:l,key:p.get(l)?.order??h})).sort((l,h)=>l.key-h.key).map(l=>l.id)}function W(){V.unobserveAll(),V.observe(e);for(const l of A){const h=Te(p.get(l));h&&V.observe(h)}}function q(l){if(!d)return;const h=p.get(l),g=h?Te(h):null;g&&(g.classList.add("mk-item-leave"),g.style.transition=_,g.style.opacity="0")}function K(l){const h=g=>{g.target===l&&(l.style.willChange="auto",l.classList.remove("mk-item-moving"),l.removeEventListener("transitionend",h))};l.style.willChange="transform",l.addEventListener("transitionend",h)}function D(l,h,g){const P=`translate(${h}px, ${g}px)`;return l.style.transform===""?d?(l.style.transition="none",l.style.transform=P,l.style.opacity="0",l.classList.add("mk-item-enter"),!0):(l.style.transform=P,!1):(l.style.transform===P||(d&&(l.style.transition=_,l.classList.add("mk-item-moving"),K(l)),l.style.transform=P),!1)}function z(){if(y==="self"){const C=a==="vertical"?e.scrollTop:e.scrollLeft,j=a==="vertical"?e.clientHeight:e.clientWidth;return[C-$,C+j+$]}const l=e.getBoundingClientRect(),h=a==="vertical"?l.top:l.left;let g,P;if(y==="window")g=0,P=a==="vertical"?window.innerHeight:window.innerWidth;else{const C=y.getBoundingClientRect();g=a==="vertical"?C.top:C.left,P=a==="vertical"?y.clientHeight:y.clientWidth}return[g-h-$,g+P-h+$]}function u(l,h){if(w&&l.estimatedSize!==void 0)return l.estimatedSize;if(l.aspectRatio)return a==="vertical"?h/l.aspectRatio:h*l.aspectRatio;if(!w)return;if(v)return v(l);re||(re=!0,console.warn("[masonry-kit] `virtualize` is on but an item has no `estimatedSize`, no `aspectRatio`, and `estimateSize` returned nothing — falling back to a guessed size. Set one of these for accurate initial positions."));const g=[...T.values()];return g.length>0?g.reduce((P,C)=>P+C,0)/g.length:h}function s(){const l=e.getBoundingClientRect(),h=a==="vertical"?l.width:l.height,g=_t(r,h,n,m),P=kt(h,g,m),C=ee().filter(E=>E!==Z),j=new Map,U=new Map,te=new Map;for(const E of C){const ue=p.get(E),ve=a==="vertical"?ue.colSpan??1:ue.rowSpan??1,se=Math.min(Math.max(1,Math.floor(ve)||1),g);U.set(E,se);const H=se*P+(se-1)*m;te.set(E,H);const X=Te(ue);X&&(j.set(E,X),X.style.position="absolute",X.style.top="0",X.style.left="0",a==="vertical"?X.style.width=`${H}px`:X.style.height=`${H}px`)}const he=new Map,qe=[];for(const E of C){const ue=p.get(E),ve=te.get(E),se=j.get(E);let H;if(se){const X=zt(se);if(X.length===0){const ae=a==="vertical"?se.getBoundingClientRect().height:se.getBoundingClientRect().width;ae>0&&(H=ae,T.set(E,ae))}else for(const ae of X)B.has(ae)||(B.add(ae),ae.addEventListener("load",s,{once:!0}),ae.addEventListener("error",s,{once:!0}))}H===void 0&&(H=T.get(E)),H===void 0&&(H=u(ue,ve)),H!==void 0&&(he.set(E,H),qe.push({id:E,span:U.get(E),mainSize:H}))}const{items:mt,totalMainSize:Ke}=Mt(qe,g,c,o),Ie=w?z():null,ze=[],Ae=[],xe=[];for(const E of mt){const ue=te.get(E.id),ve=he.get(E.id),se=E.laneIndex*(P+m),H=a==="vertical"?se:E.mainPos,X=a==="vertical"?E.mainPos:se,ae=a==="vertical"?ue:ve,pt=a==="vertical"?ve:ue,Ee=j.get(E.id);Ee&&D(Ee,H,X)&&xe.push(Ee),ze.push({id:E.id,x:H,y:X,width:ae,height:pt}),(!Ie||E.mainPos+ve>=Ie[0]&&E.mainPos<=Ie[1])&&Ae.push(E.id)}if(a==="vertical"?e.style.height=`${Ke}px`:i&&(i.style.transform=`translate(${Ke}px, 0)`),xe.length>0){xe[0].offsetHeight;for(const E of xe)E.style.transition=_,E.style.opacity="1",K(E)}R=ze,N=Ae,ie("layout",{items:ze,visibleIds:Ae})}function k(l){const h=new Set(l.map(g=>g.id));for(const g of A)h.has(g)||(q(g),T.delete(g));p.clear(),A=l.map(g=>g.id);for(const g of l)p.set(g.id,g);W()}return V.observe(e),{setItems(l){k(l),s()},updateItem(l,h){const g=p.get(l);g&&(p.set(l,{...g,...h}),W(),s())},addItem(l,h){p.set(l.id,l),h===void 0||h>=A.length?A.push(l.id):A.splice(h,0,l.id),W(),s()},removeItem(l){q(l),p.delete(l),A=A.filter(h=>h!==l),T.delete(l),W(),s()},relayout:s,getLayout(){return[...R]},getVisibleIds(){return[...N]},setDragging(l){Z!==l&&(Z=l,s())},on(l,h){ne.has(l)||ne.set(l,new Set);const g=ne.get(l);return g.add(h),()=>g.delete(h)},destroy(){V.destroy(),Q?.removeEventListener("scroll",F),i?.remove(),p.clear(),A=[],R=[],N=[],T.clear(),Z=null,ne.clear()}}}function ut(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||typeof Node<"u"&&(e instanceof Node||t instanceof Node))return!1;const a=Object.keys(e),n=Object.keys(t);return a.length!==n.length?!1:a.every(o=>ut(e[o],t[o]))}function Et(e,t){if(e===t)return!0;const a=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of a)if(!ut(e[n],t[n]))return!1;return!0}var ce={},Qe=new WeakMap,Lt=0;function Y(e){if(e.id!==void 0)return e.id;let t=Qe.get(e);return t===void 0&&(t=`mk-auto-${++Lt}`,Qe.set(e,t)),t}var Rt=0,et={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"},Ot=ke({name:"MasonryGrid",props:{items:{type:Array,required:!0},options:{type:Object,default:()=>({})},sortable:{type:Boolean,default:!1}},emits:["layout","reorder"],setup(e,{slots:t,emit:a}){const n=`mk-${++Rt}`,o=L(null),c=new Map,m=new Map;let r=null,w=null,$=null,y=null,v=!1;const d=Xe(e.options.virtualize?new Set:null),S=L(!1),b=Xe(new Map),_=new Map;let i=new Set;const p=G(()=>{const s=d.value===null?e.items:e.items.filter(h=>d.value.has(Y(h)));if(b.value.size===0)return s;const k=new Set(s.map(h=>Y(h))),l=[...b.value.values()].filter(h=>!k.has(Y(h)));return l.length===0?s:[...s,...l]});function A(s,k){if(s.size!==k.size)return!1;for(const l of s)if(!k.has(l))return!1;return!0}function R(){return e.options.animate??ce.animate??!0}function N(){return e.options.transitionDuration??ce.transitionDuration??250}function T(){const s=e.options.gap??ce.gap;return typeof s=="number"?{main:s,cross:s}:{main:s?.main??16,cross:s?.cross??16}}function B(){const k=(e.options.direction??ce.direction)==="horizontal"?e.options.rows??ce.rows:e.options.columns??ce.columns;return xt(k,e.options.ssrColumns??ce.ssrColumns)}function re(s){const k=new Set(s.map(h=>Y(h)));for(const h of s)_.set(Y(h),h);let l=null;for(const h of i){if(k.has(h)||b.value.has(h)||!c.get(h)||!R())continue;const g=_.get(h);g&&(l??(l=new Map(b.value)),l.set(h,g),setTimeout(()=>{const P=new Map(b.value);P.delete(h),b.value=P,_.delete(h)},N()))}l&&(b.value=l),i=k}function Z(){if(!r)return;const s=e.items.map(k=>{const l=Y(k);return{id:l,el:c.get(l),colSpan:k.colSpan,rowSpan:k.rowSpan,aspectRatio:k.aspectRatio,estimatedSize:k.estimatedSize,order:k.order}});r.setItems(s)}function ne(){v||(v=!0,queueMicrotask(()=>{v=!1,Z()}))}function ie(s){let k=m.get(s);return k||(k=l=>{l!==c.get(s)&&(l?c.set(s,l):(c.delete(s),m.delete(s)),ne())},m.set(s,k),k)}function V(){if(o.value){d.value=e.options.virtualize?new Set:null,i=new Set(e.items.map(s=>Y(s))),_.clear();for(const s of e.items)_.set(Y(s),s);r=At(o.value,{...ce,...e.options}),w=r.on("layout",s=>{if(S.value=!0,a("layout",s.items),e.options.virtualize){const k=new Set(s.visibleIds);(!d.value||!A(d.value,k))&&(d.value=k)}}),Z()}}const F=L(null),Q=L(""),ee=`${n}-instructions`,W=`${n}-live`;function q(s){Q.value=s}function K(s,k){return`item ${k.findIndex(h=>Y(h)===s)+1} of ${k.length}`}let D=null;function z(s,k,l){const h=s.findIndex(C=>Y(C)===k);if(h===-1)return s;const g=[...s],[P]=g.splice(h,1);return g.splice(Math.max(0,Math.min(l,g.length)),0,P),g}function u(s,k){if(!e.sortable||!r)return;const l=Y(k);if(s.key===" "||s.key==="Enter"){s.preventDefault(),F.value===l?(F.value=null,D=null,r.setDragging(null),q(`Dropped ${K(l,e.items)}.`)):F.value===null&&(F.value=l,D=e.items,r.setDragging(l),q(`Picked up ${K(l,e.items)}. Use arrow keys to move, space to drop, escape to cancel.`));return}if(F.value!==l)return;if(s.key==="Escape"){s.preventDefault(),F.value=null,r.setDragging(null),D&&a("reorder",D),D=null,q("Reordering cancelled.");return}const h=e.options.direction==="horizontal",g=h?"ArrowRight":"ArrowDown",P=h?"ArrowLeft":"ArrowUp";if(s.key!==g&&s.key!==P)return;s.preventDefault();const C=e.items.findIndex(he=>Y(he)===l),j=s.key===g?1:-1,U=C+j;if(U<0||U>=e.items.length)return;const te=z(e.items,l,U);a("reorder",te),q(`Moved to ${K(l,te)}.`)}return Ce(()=>{!o.value||typeof window>"u"||(V(),$=Ve(()=>e.items,s=>{re(s),Z()},{deep:!0}),y=Ve(()=>e.options,(s,k)=>{Et(s,k)||(w?.(),r?.destroy(),V())},{deep:!0}))}),Ge(()=>{$?.(),y?.(),w?.(),r?.destroy()}),()=>Me("div",{ref:o,class:"mk-grid",style:S.value?{}:{columns:B(),columnGap:`${T().cross}px`}},[...p.value.map(s=>{const k=Y(s),l=b.value.has(k),h=e.sortable?{tabindex:0,role:"button","aria-roledescription":"Reorderable item","aria-describedby":ee,"aria-pressed":F.value===k?"true":"false",onKeydown:g=>u(g,s)}:{};return Me("div",{key:k,class:"mk-item",style:{...S.value?{}:{breakInside:"avoid",marginBottom:`${T().main}px`},...l?{pointerEvents:"none"}:{}},ref:ie(k),...h},t.item?.({item:s}))}),e.sortable?Me("span",{id:ee,style:et},"Press space or enter to pick up this item. While picked up, use the arrow keys to move it, space or enter to drop it, or escape to cancel."):null,e.sortable?Me("span",{id:W,role:"status","aria-live":"polite",style:et},Q.value):null])}});function ct(e=1200){const t=L("");async function a(n,o){try{await navigator.clipboard.writeText(o),t.value=n,setTimeout(()=>{t.value===n&&(t.value="")},e)}catch{t.value=""}}return{copied:t,copy:a}}const Tt={key:1,class:"canvas canvas--bad",title:"Could not decode this hash"},Pt=ke({__name:"PlaceholderCanvas",props:{rgba:{}},setup(e){const t=e,a=L();function n(){const o=a.value;if(!o||!t.rgba)return;o.width=t.rgba.width,o.height=t.rgba.height;const c=o.getContext("2d");if(!c)return;const m=c.createImageData(t.rgba.width,t.rgba.height);m.data.set(t.rgba.data),c.putImageData(m,0,0)}return Ce(n),Ve(()=>t.rgba,n),(o,c)=>e.rgba?(x(),M("canvas",{key:0,ref_key:"canvas",ref:a,class:"canvas"},null,512)):(x(),M("div",Tt,"?"))}}),dt=$e(Pt,[["__scopeId","data-v-af1c304e"]]);var Nt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],ge=e=>{let t=0;for(let a=0;a<e.length;a++){let n=e[a],o=Nt.indexOf(n);t=t*83+o}return t},Pe=e=>{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Ne=e=>{let t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.trunc(t*12.92*255+.5):Math.trunc((1.055*Math.pow(t,.4166666666666667)-.055)*255+.5)},jt=e=>e<0?-1:1,je=(e,t)=>jt(e)*Math.pow(Math.abs(e),t),tt=class extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}},Dt=e=>{if(!e||e.length<6)throw new tt("The blurhash string must be at least 6 characters");let t=ge(e[0]),a=Math.floor(t/9)+1,n=t%9+1;if(e.length!==4+2*n*a)throw new tt(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*n*a}`)},Ut=e=>{let t=e>>16,a=e>>8&255,n=e&255;return[Pe(t),Pe(a),Pe(n)]},Bt=(e,t)=>{let a=Math.floor(e/361),n=Math.floor(e/19)%19,o=e%19;return[je((a-9)/9,2)*t,je((n-9)/9,2)*t,je((o-9)/9,2)*t]},Ft=(e,t,a,n)=>{Dt(e),n=n|1;let o=ge(e[0]),c=Math.floor(o/9)+1,m=o%9+1,r=(ge(e[1])+1)/166,w=new Array(m*c);for(let v=0;v<w.length;v++)if(v===0){let d=ge(e.substring(2,6));w[v]=Ut(d)}else{let d=ge(e.substring(4+v*2,6+v*2));w[v]=Bt(d,r*n)}let $=t*4,y=new Uint8ClampedArray($*a);for(let v=0;v<a;v++)for(let d=0;d<t;d++){let S=0,b=0,_=0;for(let R=0;R<c;R++)for(let N=0;N<m;N++){let T=Math.cos(Math.PI*d*N/t)*Math.cos(Math.PI*v*R/a),B=w[N+R*m];S+=B[0]*T,b+=B[1]*T,_+=B[2]*T}let i=Ne(S),p=Ne(b),A=Ne(_);y[4*d+0+v*$]=i,y[4*d+1+v*$]=p,y[4*d+2+v*$]=A,y[4*d+3+v*$]=255}return y},Vt=Ft;const nt=new Map;function st(e,t){const a=e*4096+t;let n=nt.get(a);if(!n){n=new Float64Array(e*t);for(let o=0;o<e;o++)for(let c=0;c<t;c++)n[o*t+c]=Math.cos(Math.PI*o*(c+.5)/t);nt.set(a,n)}return n}function Ht(e,t,a,n,o,c,m){const r=st(a,o),w=st(n,c),$=new Float64Array(a);for(let y=0;y<c;y++){for(let v=0;v<a;v++){let d=0;for(let S=0;S<n;S++){const b=e[S*t+v];b!==0&&(d+=b*w[S*c+y])}$[v]=d}for(let v=0;v<o;v++){let d=0;for(let S=0;S<a;S++)d+=$[S]*r[S*o+v];m[y*o+v]=d}}}var we=class extends Error{constructor(e,t){super(t?`${e}: ${t}`:e),this.name="PlaceholderError",this.code=e}};const Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",ft=new Int8Array(128).fill(-1);for(let e=0;e<64;e++)ft[Gt.charCodeAt(e)]=e;function Wt(e){const t=e.length;if(t%4===1)throw new we("InvalidLength");const a=new Uint8Array(Math.floor(t*6/8));let n=0,o=0,c=0;for(let m=0;m<t;m++){const r=e.charCodeAt(m),w=r<128?ft[r]:-1;if(w<0)throw new we("InvalidCharacter");n=n<<6|w,o+=6,o>=8&&(o-=8,a[c++]=n>>o&255,n&=(1<<o)-1)}return a}function qt(e){return typeof e=="string"?Wt(e):e}var ht=class{constructor(e,t=0){this.bytes=e,this.pos=t*8,this.end=e.length*8}bit(){if(this.pos>=this.end)return 0;const e=this.pos++;return this.bytes[e>>3]>>7-(e&7)&1}bits(e){let t=0;for(let a=0;a<e;a++)t=t<<1|this.bit();return t>>>0}};function Kt(e,t){let a=0;for(;e.bit()===1;)a++;const n=a*(1<<t)+(t>0?e.bits(t):0);return n&1?-((n+1)/2):n/2}function Xt(e){return e?9:7}function Yt(e){return Math.pow(2,(e-32)/8)}function Jt(e,t){return e>=1?[t,Math.max(1,Math.round(t/e))]:[Math.max(1,Math.round(t*e)),t]}function Zt(e){if(e.length<7||e.length>1024)throw new we("InvalidLength");const t=new ht(e);if(t.bits(2)!==0)throw new we("UnsupportedVersion");const a=t.bit()===1;if(a&&e.length<9)throw new we("InvalidLength");const n={aspectCode:t.bits(6),alpha:a,Lx:t.bits(3)+1,Ly:t.bits(3)+1,Cx:t.bits(2)+1,Cy:t.bits(2)+1,Ax:1,Ay:1,dc:[0,0,0,0],scale:[0,0,0,0],k:[0,0,0,0]};for(let o=0;o<3;o++)n.dc[o]=t.bits(6);for(let o=0;o<3;o++)n.scale[o]=t.bits(4);for(let o=0;o<3;o++)n.k[o]=t.bits(2);return t.bit(),a&&(n.dc[3]=t.bits(5),n.Ax=t.bits(2)+1,n.Ay=t.bits(2)+1,n.scale[3]=t.bits(4),n.k[3]=t.bits(2)),n}const _e={qmaxL:7,qmaxC:3,smaxL:.64,smaxC:.32,reconOffset:0};function Qt(e){return e===0?_e.qmaxL:_e.qmaxC}function en(e,t,a,n){return 2*(e*n+t*a)<3*a*n}function We(e,t){return t===0?[e.Lx,e.Ly]:t===3?[e.Ax,e.Ay]:[e.Cx,e.Cy]}function tn(e){const t=[],a=e.alpha?[0,1,2,3]:[0,1,2];for(const n of a){const[o,c]=We(e,n);for(let m=0;m<c;m++)for(let r=0;r<o;r++)r===0&&m===0||!en(r,m,o,c)||t.push({ch:n,i:r,j:m,nx:o,ny:c,qmax:Qt(n)})}return t.sort((n,o)=>{const c=n.i*n.i*n.ny*n.ny+n.j*n.j*n.nx*n.nx,m=n.nx*n.nx*n.ny*n.ny,r=o.i*o.i*o.ny*o.ny+o.j*o.j*o.nx*o.nx,w=c*(o.nx*o.nx*o.ny*o.ny)-r*m;return w!==0?w:n.ch!==o.ch?n.ch-o.ch:n.j!==o.j?n.j-o.j:n.i-o.i}),t}function Se(e,t,a){return e<t?t:e>a?a:e}function nn(e,t){return e===0?t/63:e===3?t/31:t*.64/63-.32}const sn=Array.from({length:16},(e,t)=>Math.pow(2,-(15-t)/3));function an(e,t){return(e===1||e===2?_e.smaxC:_e.smaxL)*sn[t]}function on(e,t,a){if(e===0)return 0;const n=(Math.abs(e)-_e.reconOffset)/a,o=t*n*n;return e<0?-o:o}function ln(e){return e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}function De(e,t,a,n){const o=e+.3963377774*t+.2158037573*a,c=e-.1055613458*t-.0638541728*a,m=e-.0894841775*t-1.291485548*a,r=o*o*o,w=c*c*c,$=m*m*m;n[0]=4.0767416621*r-3.3077115913*w+.2309699292*$,n[1]=-1.2684380046*r+2.6097574011*w-.3413193965*$,n[2]=-.0041960863*r-.7034186147*w+1.707614701*$}const Ue=-5e-4,Be=1.0005,at=[0,0,0];function ot(e){return e[0]>=Ue&&e[0]<=Be&&e[1]>=Ue&&e[1]<=Be&&e[2]>=Ue&&e[2]<=Be}function rn(e,t,a,n){if(De(e,t,a,n),!ot(n)){let o=0,c=1;for(let m=0;m<8;m++){const r=(o+c)/2;De(e,t*r,a*r,at),ot(at)?o=r:c=r}De(e,t*o,a*o,n)}for(let o=0;o<3;o++)n[o]=n[o]<0?0:n[o]>1?1:n[o]}function un(e,t){const a=t,n=t.alpha?[0,1,2,3]:[0,1,2],o=[];for(const r of n){const[w,$]=We(a,r),y=new Float64Array(w*$);y[0]=nn(r,t.dc[r]),o[r]=y}const c=n.map(r=>an(r,t.scale[r])),m=new ht(e,Xt(t.alpha));for(const r of tn(a)){let w=Kt(m,t.k[r.ch]);w=w>r.qmax?r.qmax:w<-r.qmax?-r.qmax:w,o[r.ch][r.j*r.nx+r.i]=on(w,c[r.ch],r.qmax)}return o}function cn(e,t={}){const a=qt(e),n=Zt(a),o=Math.round(Se(t.size??32,4,128)),c=t.dither??!0,[m,r]=Jt(Yt(n.aspectCode),o),w=un(a,n),$=n,y=m*r,v=[];for(let b=0;b<w.length;b++){const[_,i]=We($,b),p=new Float64Array(y);Ht(w[b],_,_,i,m,r,p),v.push(p)}const d=new Uint8ClampedArray(y*4),S=[0,0,0];for(let b=0;b<r;b++)for(let _=0;_<m;_++){const i=b*m+_;rn(Se(v[0][i],0,1),v[1][i],v[2][i],S);const p=c?lt(52.9829189*lt(.06711056*_+.00583715*b)):.5,A=i*4;for(let R=0;R<3;R++){const N=ln(S[R])*255;d[A+R]=Se(Math.floor(N+p),0,255)}d[A+3]=n.alpha?Math.round(Se(v[3][i],0,1)*255):255}return{width:m,height:r,data:d}}function lt(e){return e-Math.floor(e)}function dn(e){let{PI:t,min:a,max:n,cos:o,round:c}=Math,m=e[0]|e[1]<<8|e[2]<<16,r=e[3]|e[4]<<8,w=(m&63)/63,$=(m>>6&63)/31.5-1,y=(m>>12&63)/31.5-1,v=(m>>18&31)/31,d=m>>23,S=(r>>3&63)/63,b=(r>>9&63)/63,_=r>>15,i=n(3,_?d?5:7:r&7),p=n(3,_?r&7:d?5:7),A=d?(e[5]&15)/15:1,R=(e[5]>>4)/15,N=d?6:5,T=0,B=(K,D,z)=>{let u=[];for(let s=0;s<D;s++)for(let k=s?0:1;k*D<K*(D-s);k++)u.push(((e[N+(T>>1)]>>((T++&1)<<2)&15)/7.5-1)*z);return u},re=B(i,p,v),Z=B(3,3,S*1.25),ne=B(3,3,b*1.25),ie=d&&B(5,5,R),V=fn(e),F=c(V>1?32:32*V),Q=c(V>1?32/V:32),ee=new Uint8Array(F*Q*4),W=[],q=[];for(let K=0,D=0;K<Q;K++)for(let z=0;z<F;z++,D+=4){let u=w,s=$,k=y,l=A;for(let C=0,j=n(i,d?5:3);C<j;C++)W[C]=o(t/F*(z+.5)*C);for(let C=0,j=n(p,d?5:3);C<j;C++)q[C]=o(t/Q*(K+.5)*C);for(let C=0,j=0;C<p;C++)for(let U=C?0:1,te=q[C]*2;U*p<i*(p-C);U++,j++)u+=re[j]*W[U]*te;for(let C=0,j=0;C<3;C++)for(let U=C?0:1,te=q[C]*2;U<3-C;U++,j++){let he=W[U]*te;s+=Z[j]*he,k+=ne[j]*he}if(d)for(let C=0,j=0;C<5;C++)for(let U=C?0:1,te=q[C]*2;U<5-C;U++,j++)l+=ie[j]*W[U]*te;let h=u-2/3*s,g=(3*u-h+k)/2,P=g-k;ee[D]=n(0,255*a(1,g)),ee[D+1]=n(0,255*a(1,P)),ee[D+2]=n(0,255*a(1,h)),ee[D+3]=n(0,255*a(1,l))}return{w:F,h:Q,rgba:ee}}function fn(e){let t=e[3],a=e[2]&128,n=e[4]&128,o=n?a?5:7:t&7,c=n?t&7:a?5:7;return o/c}const be=32;function hn(e,t,a){const n=t>0&&a>0?t/a:1,o=n>=1?be:Math.max(1,Math.round(be*n)),c=n>=1?Math.max(1,Math.round(be/n)):be;try{return{width:o,height:c,data:Vt(e,o,c)}}catch{return null}}function vn(e){try{const t=atob(e),a=Uint8Array.from(t,o=>o.charCodeAt(0)),n=dn(a);return{width:n.w,height:n.h,data:new Uint8ClampedArray(n.rgba)}}catch{return null}}function mn(e){try{const t=cn(e,{size:be});return{width:t.width,height:t.height,data:new Uint8ClampedArray(t.data)}}catch{return null}}function vt(e,t,a,n){return e==="blurhash"?hn(t,a,n):e==="thumbhash"?vn(t):mn(t)}const pn={class:"item card"},yn=["aria-label"],gn=["alt","src"],bn={class:"strip__label"},wn=["src"],_n={class:"meta"},kn=["title"],xn={class:"muted"},Mn={class:"hashes"},Sn={class:"hashes__key"},Cn=["title"],$n=["aria-label","onClick"],In=ke({__name:"ResultCard",props:{entry:{}},emits:["open"],setup(e,{emit:t}){const a=e,n=t,o=["hazehash","blurhash","thumbhash"],{copied:c,copy:m}=ct(),r=G(()=>{const{width:y,height:v}=a.entry;return y>0&&v>0?Math.min(Math.max(y/v,.5),2):1}),w=G(()=>o.filter(y=>a.entry[y]!==void 0).map(y=>({type:y,rgba:vt(y,a.entry[y],a.entry.width,a.entry.height)}))),$=G(()=>{const y=[];for(const v of["hazehash","blurhash","thumbhash","color"]){const d=a.entry[v];d!==void 0&&y.push({key:v,value:d})}return y});return(y,v)=>(x(),M("article",pn,[f("button",{class:"item__open","aria-label":`Open ${e.entry.file}`,onClick:v[0]||(v[0]=d=>n("open"))},[f("span",{class:"shots",style:me({aspectRatio:String(r.value)})},[f("img",{class:"shot",loading:"lazy",alt:e.entry.file,src:pe(rt)(e.entry.path,480)},null,8,gn)],4),w.value.length>0?(x(),M("span",{key:0,class:"strip",style:me({aspectRatio:String(r.value*w.value.length)})},[(x(!0),M(oe,null,de(w.value,d=>(x(),M("span",{key:d.type,class:"strip__cell"},[J(dt,{rgba:d.rgba},null,8,["rgba"]),f("span",bn,I(d.type),1)]))),128))],4)):O("",!0),e.entry.preview?(x(),M("img",{key:1,class:"preview",alt:"Tiny preview",src:e.entry.preview},null,8,wn)):O("",!0)],8,yn),f("div",_n,[f("strong",{class:"meta__name",title:e.entry.path},I(e.entry.file),9,kn),f("span",xn,I(e.entry.width)+"×"+I(e.entry.height),1)]),f("ul",Mn,[(x(!0),M(oe,null,de($.value,d=>(x(),M("li",{key:d.key},[f("span",Sn,[d.key==="color"?(x(),M("span",{key:0,class:"swatch",style:me({background:d.value})},null,4)):O("",!0),le(" "+I(d.key),1)]),f("code",{class:"hashes__value",title:d.value},I(d.value),9,Cn),f("button",{class:"btn btn--ghost btn--small","aria-label":`Copy ${d.key}`,onClick:S=>pe(m)(d.key,d.value)},[J(fe,{name:pe(c)===d.key?"check":"copy",size:14},null,8,["name"])],8,$n)]))),128))])]))}}),zn=$e(In,[["__scopeId","data-v-ede0ed45"]]),An={class:"muted counter"},En=["disabled"],Ln=["disabled"],Rn={class:"scroll"},On={class:"stage"},Tn=["alt","src"],Pn={key:0,class:"compare"},Nn={key:0,class:"compare__item"},jn=["src"],Dn={class:"facts"},Un={class:"facts__row"},Bn={class:"facts__mono"},Fn={class:"facts__row"},Vn={class:"facts__mono facts__hash"},Hn=["aria-label","onClick"],Gn=ke({__name:"ResultModal",props:{entries:{},index:{}},emits:["close","update:index"],setup(e,{emit:t}){const a=e,n=t,o=["hazehash","blurhash","thumbhash"],{copied:c,copy:m}=ct(),r=G(()=>a.entries[a.index]),w=G(()=>a.index>0),$=G(()=>a.index<a.entries.length-1),y=G(()=>{const{width:_,height:i}=r.value;return _>0&&i>0?_/i:1}),v=G(()=>o.filter(_=>r.value[_]!==void 0).map(_=>({type:_,rgba:vt(_,r.value[_],r.value.width,r.value.height)}))),d=G(()=>{const _=[];for(const i of["hazehash","blurhash","thumbhash","color"]){const p=r.value[i];p!==void 0&&_.push({key:i,value:p})}return _});function S(_){const i=a.index+_;i>=0&&i<a.entries.length&&n("update:index",i)}function b(_){_.target instanceof HTMLInputElement||(_.key==="ArrowLeft"&&S(-1),_.key==="ArrowRight"&&S(1))}return Ce(()=>window.addEventListener("keydown",b)),Ge(()=>window.removeEventListener("keydown",b)),(_,i)=>(x(),it(bt,{title:r.value.file,width:"1040px",onClose:i[2]||(i[2]=p=>n("close"))},{actions:He(()=>[f("span",An,I(e.index+1)+" / "+I(e.entries.length),1),f("button",{class:"btn btn--small",disabled:!w.value,"aria-label":"Previous image",onClick:i[0]||(i[0]=p=>S(-1))},[J(fe,{name:"left",size:15})],8,En),f("button",{class:"btn btn--small",disabled:!$.value,"aria-label":"Next image",onClick:i[1]||(i[1]=p=>S(1))},[J(fe,{name:"right",size:15})],8,Ln)]),default:He(()=>[f("div",Rn,[f("div",On,[(x(),M("img",{key:r.value.path,class:"stage__img",alt:r.value.file,src:pe(rt)(r.value.path,1600)},null,8,Tn))]),v.value.length?(x(),M("div",Pn,[(x(!0),M(oe,null,de(v.value,p=>(x(),M("figure",{key:p.type,class:"compare__item"},[f("div",{class:"compare__frame",style:me({aspectRatio:String(y.value)})},[J(dt,{rgba:p.rgba},null,8,["rgba"])],4),f("figcaption",null,I(p.type),1)]))),128)),r.value.preview?(x(),M("figure",Nn,[f("div",{class:"compare__frame",style:me({aspectRatio:String(y.value)})},[f("img",{class:"compare__preview",alt:"Tiny preview",src:r.value.preview},null,8,jn)],4),i[3]||(i[3]=f("figcaption",null,"preview",-1))])):O("",!0)])):O("",!0),f("dl",Dn,[f("div",Un,[i[4]||(i[4]=f("dt",null,"File",-1)),f("dd",Bn,I(r.value.path),1)]),f("div",Fn,[i[5]||(i[5]=f("dt",null,"Size",-1)),f("dd",null,I(r.value.width)+" × "+I(r.value.height)+" px",1)]),(x(!0),M(oe,null,de(d.value,p=>(x(),M("div",{key:p.key,class:"facts__row"},[f("dt",null,[p.key==="color"?(x(),M("span",{key:0,class:"swatch",style:me({background:p.value})},null,4)):O("",!0),le(" "+I(p.key),1)]),f("dd",Vn,I(p.value),1),f("button",{class:"btn btn--ghost btn--small","aria-label":`Copy ${p.key}`,onClick:A=>pe(m)(p.key,p.value)},[J(fe,{name:pe(c)===p.key?"check":"copy",size:14},null,8,["name"])],8,Hn)]))),128))])])]),_:1},8,["title"]))}}),Wn=$e(Gn,[["__scopeId","data-v-4cbae639"]]),qn={class:"page"},Kn={class:"page__head"},Xn={class:"muted"},Yn={key:0,class:"notice notice--warn"},Jn={class:"card block"},Zn={class:"types"},Qn=["checked","onChange"],es={class:"type__title"},ts={class:"type__text muted"},ns={class:"grid"},ss={key:0,class:"field"},as=["min","max"],os={key:1,class:"field"},ls=["value"],rs={class:"field"},is=["value"],us={key:2,class:"field"},cs={class:"runbar"},ds=["disabled"],fs={key:0,class:"muted"},hs={key:1,class:"muted"},vs={key:1,class:"card block",role:"status"},ms={class:"progress"},ps={class:"muted"},ys={key:0},gs={key:2,class:"notice notice--error"},bs={key:3,class:"card block"},ws={class:"block__head"},_s={class:"muted"},ks={key:0},xs={key:1},Ms={key:0,class:"errors"},Ss={class:"tabs",role:"tablist"},Cs=["aria-selected"],$s=["aria-selected"],Is={key:0,class:"muted"},zs={key:1,class:"more"},As={class:"outbar"},Es=["disabled"],Ls={key:0,class:"muted"},Rs={class:"output"},Fe=48,Os=ke({__name:"ImageHashPage",props:{module:{},status:{}},setup(e){const t={columns:"auto",minLaneSize:250,gap:14},a=["auto","3x3","4x3","4x4","5x4","6x4","8x6"],n={json:"json",plain:"txt",csv:"csv",ts:"ts",js:"js"},o=L(),c=L([]),m=L(!0),r=L(["hazehash","color"]),w=L(28),$=L("auto"),y=L("json"),v=L("imageHashes"),d=L(null),S=L("idle"),b=L({done:0,total:0,cached:0}),_=L(""),i=L(),p=L("gallery"),A=L(Fe),R=L(""),N=L(""),T=L(!1);let B;const re=G(()=>_.value.toLowerCase().includes("sharp")),Z=G(()=>c.value.length>0&&r.value.length>0&&S.value!=="running"),ne=G(()=>b.value.total>0?Math.round(b.value.done/b.value.total*100):0),ie=G(()=>i.value?.entries.slice(0,A.value)??[]),V=G(()=>ie.value.map((z,u)=>({id:z.path,position:u})));function F(z){return ie.value[Number(z.position)]}function Q(z){r.value=r.value.includes(z)?r.value.filter(u=>u!==z):[...r.value,z]}function ee(z,u){const s=z.includes("\\")?"\\":"/";return`${z}${z.endsWith(s)?"":s}image-hashes.${n[u]??"txt"}`}async function W(z=!1){B?.(),S.value="running",_.value="",i.value=void 0,N.value="",b.value={done:0,total:0,cached:0},A.value=Fe,d.value=null;try{const{jobId:u}=await Le.post("/api/image-hash/run",{paths:c.value,recursive:m.value,types:r.value,components:$.value,budget:w.value,format:y.value,exportName:v.value,installSharp:z});B=yt(u,{onProgress:s=>{b.value=s},onDone:s=>{i.value=s,S.value="done",p.value="gallery",R.value=ee(s.base,s.format)},onFailed:s=>{_.value=s,S.value="failed"}})}catch(u){_.value=u instanceof Error?u.message:String(u),S.value="failed"}}async function q(){if(i.value?.output)try{await navigator.clipboard.writeText(i.value.output),T.value=!0,setTimeout(()=>T.value=!1,1200)}catch{T.value=!1}}function K(){const z=i.value?.output;if(!z)return;const u=new Blob([z],{type:"text/plain;charset=utf-8"}),s=document.createElement("a");s.href=URL.createObjectURL(u),s.download=`image-hashes.${n[i.value?.format??"json"]??"txt"}`,s.click(),URL.revokeObjectURL(s.href)}async function D(z=!1){if(i.value?.output){N.value="";try{const u=await Le.post("/api/image-hash/save",{path:R.value,content:i.value.output,overwrite:z});N.value=`Saved to ${u.path}`}catch(u){if(u instanceof gt&&u.status===409){window.confirm(`${u.message}. Replace it?`)&&await D(!0);return}N.value=u instanceof Error?u.message:String(u)}}}return Ce(async()=>{try{o.value=await Le.get("/api/image-hash/options"),w.value=o.value.budget.default,$.value=o.value.components.auto?"auto":o.value.components.default,v.value=o.value.exportName}catch(z){_.value=z instanceof Error?z.message:String(z),S.value="failed"}}),Ge(()=>{B?.()}),(z,u)=>(x(),M("div",qn,[f("header",Kn,[f("h1",null,I(e.module.title),1),f("p",Xn,I(e.module.description),1)]),o.value&&!o.value.sharp?(x(),M("div",Yn," The sharp image library could not be loaded. Previews are limited, and the first run will offer to install it again. ")):O("",!0),J(wt,{sources:c.value,"onUpdate:sources":u[0]||(u[0]=s=>c.value=s),recursive:m.value,"onUpdate:recursive":u[1]||(u[1]=s=>m.value=s),"scan-url":"/api/image-hash/scan",start:e.status?.cwd??""},null,8,["sources","recursive","start"]),f("section",Jn,[u[19]||(u[19]=f("h2",null,"Placeholders",-1)),f("div",Zn,[(x(!0),M(oe,null,de(o.value?.types,s=>(x(),M("label",{key:s.id,class:Re(["type",{"type--on":r.value.includes(s.id)}])},[f("input",{type:"checkbox",checked:r.value.includes(s.id),onChange:k=>Q(s.id)},null,40,Qn),f("span",es,I(s.title),1),f("span",ts,I(s.description),1)],2))),128))]),f("div",ns,[r.value.includes("hazehash")?(x(),M("label",ss,[f("span",null,"Hazehash size: "+I(w.value)+" bytes",1),ye(f("input",{"onUpdate:modelValue":u[2]||(u[2]=s=>w.value=s),type:"range",min:o.value?.budget.min,max:o.value?.budget.max},null,8,as),[[Oe,w.value,void 0,{number:!0}]])])):O("",!0),r.value.includes("blurhash")?(x(),M("label",os,[u[16]||(u[16]=f("span",null,"Blurhash components",-1)),ye(f("select",{"onUpdate:modelValue":u[3]||(u[3]=s=>$.value=s),class:"select"},[(x(),M(oe,null,de(a,s=>f("option",{key:s,value:s},I(s==="auto"?"auto (by aspect ratio)":s),9,ls)),64))],512),[[Ye,$.value]])])):O("",!0),f("label",rs,[u[17]||(u[17]=f("span",null,"Output format",-1)),ye(f("select",{"onUpdate:modelValue":u[4]||(u[4]=s=>y.value=s),class:"select"},[(x(!0),M(oe,null,de(o.value?.formats,s=>(x(),M("option",{key:s,value:s},I(s),9,is))),128))],512),[[Ye,y.value]])]),y.value==="ts"||y.value==="js"?(x(),M("label",us,[u[18]||(u[18]=f("span",null,"Export name",-1)),ye(f("input",{"onUpdate:modelValue":u[5]||(u[5]=s=>v.value=s),class:"input",spellcheck:"false"},null,512),[[Oe,v.value]])])):O("",!0)])]),f("div",cs,[f("button",{class:"btn btn--primary",disabled:!Z.value,onClick:u[6]||(u[6]=s=>W(!1))},[J(fe,{name:"play",size:15}),le(" "+I(S.value==="running"?"Working…":"Compute hashes"),1)],8,ds),c.value.length===0?(x(),M("span",fs,"Add at least one folder or image.")):r.value.length===0?(x(),M("span",hs,"Pick at least one placeholder.")):O("",!0)]),S.value==="running"?(x(),M("div",vs,[f("div",ms,[f("div",{class:"progress__bar",style:me({width:`${ne.value}%`})},null,4)]),f("span",ps,[le(I(b.value.done)+" of "+I(b.value.total||"…")+" images",1),b.value.cached?(x(),M("span",ys," · "+I(b.value.cached)+" from cache",1)):O("",!0)])])):O("",!0),S.value==="failed"?(x(),M("div",gs,[f("p",null,I(_.value),1),re.value?(x(),M("button",{key:0,class:"btn btn--small",onClick:u[7]||(u[7]=s=>W(!0))}," Install sharp and retry ")):O("",!0)])):O("",!0),i.value?(x(),M("section",bs,[f("div",ws,[u[20]||(u[20]=f("h2",null,"Result",-1)),f("span",_s,[le(I(i.value.entries.length)+" image"+I(i.value.entries.length===1?"":"s")+" ",1),i.value.cached?(x(),M("span",ks,"· "+I(i.value.cached)+" cached",1)):O("",!0),i.value.errors.length?(x(),M("span",xs,"· "+I(i.value.errors.length)+" failed",1)):O("",!0)])]),i.value.errors.length?(x(),M("ul",Ms,[(x(!0),M(oe,null,de(i.value.errors,s=>(x(),M("li",{key:s.file},[f("code",null,I(s.file),1),le(" — "+I(s.message),1)]))),128))])):O("",!0),f("div",Ss,[f("button",{class:Re(["tab",{"tab--on":p.value==="gallery"}]),role:"tab","aria-selected":p.value==="gallery",onClick:u[8]||(u[8]=s=>p.value="gallery")}," Gallery ",10,Cs),f("button",{class:Re(["tab",{"tab--on":p.value==="output"}]),role:"tab","aria-selected":p.value==="output",onClick:u[9]||(u[9]=s=>p.value="output")}," Output ("+I(i.value.format)+") ",11,$s)]),p.value==="gallery"?(x(),M(oe,{key:1},[i.value.entries.length===0?(x(),M("p",Is,"No images were found.")):O("",!0),J(pe(Ot),{class:"gallery",items:V.value,options:t},{item:He(({item:s})=>[J(zn,{entry:F(s),onOpen:k=>d.value=Number(s.position)},null,8,["entry","onOpen"])]),_:1},8,["items"]),A.value<i.value.entries.length?(x(),M("div",zs,[f("button",{class:"btn",onClick:u[10]||(u[10]=s=>A.value+=Fe)}," Show more ("+I(i.value.entries.length-A.value)+" left) ",1),f("button",{class:"btn",onClick:u[11]||(u[11]=s=>A.value=i.value.entries.length)}," Show all ("+I(i.value.entries.length)+") ",1)])):O("",!0)],64)):(x(),M(oe,{key:2},[f("div",As,[f("button",{class:"btn btn--small",onClick:q},[J(fe,{name:T.value?"check":"copy",size:15},null,8,["name"]),le(" "+I(T.value?"Copied":"Copy"),1)]),f("button",{class:"btn btn--small",onClick:K},[J(fe,{name:"download",size:15}),u[21]||(u[21]=le(" Download ",-1))]),ye(f("input",{"onUpdate:modelValue":u[12]||(u[12]=s=>R.value=s),class:"input outbar__path",spellcheck:"false","aria-label":"File to write"},null,512),[[Oe,R.value]]),f("button",{class:"btn btn--small",disabled:R.value.trim()==="",onClick:u[13]||(u[13]=s=>D(!1))},[J(fe,{name:"save",size:15}),u[22]||(u[22]=le(" Write to file ",-1))],8,Es)]),N.value?(x(),M("p",Ls,I(N.value),1)):O("",!0),f("pre",Rs,I(i.value.output),1)],64))])):O("",!0),i.value&&d.value!==null?(x(),it(Wn,{key:4,index:d.value,"onUpdate:index":u[14]||(u[14]=s=>d.value=s),entries:i.value.entries,onClose:u[15]||(u[15]=s=>d.value=null)},null,8,["index","entries"])):O("",!0)]))}}),Ns=$e(Os,[["__scopeId","data-v-00df68b7"]]);export{Ns as default};
@@ -1 +1 @@
1
- .canvas[data-v-af1c304e]{display:block;width:100%;height:100%;object-fit:cover;background:var(--surface-2)}.canvas--bad[data-v-af1c304e]{display:grid;place-items:center;color:var(--danger)}.item[data-v-ede0ed45]{display:flex;flex-direction:column;gap:10px;padding:10px;min-width:0}.item__open[data-v-ede0ed45]{display:flex;flex-direction:column;gap:10px;padding:0;border:0;background:transparent;text-align:left;cursor:zoom-in}.item__open[data-v-ede0ed45]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.shots[data-v-ede0ed45]{display:block;overflow:hidden;border-radius:8px;background:var(--surface-2)}.shot[data-v-ede0ed45]{display:block;width:100%;height:100%;object-fit:cover;transition:transform .15s}.item__open:hover .shot[data-v-ede0ed45]{transform:scale(1.02)}.strip[data-v-ede0ed45]{display:flex;overflow:hidden;border-radius:8px}.strip__cell[data-v-ede0ed45]{position:relative;flex:1}.strip__label[data-v-ede0ed45]{position:absolute;left:4px;bottom:3px;padding:0 5px;border-radius:4px;background:#0000008c;color:#fff;font-size:10px}.preview[data-v-ede0ed45]{width:100%;border-radius:8px}.meta[data-v-ede0ed45]{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.meta__name[data-v-ede0ed45]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hashes[data-v-ede0ed45]{display:flex;flex-direction:column;gap:2px;margin:0;padding:0;list-style:none}.hashes li[data-v-ede0ed45]{display:flex;align-items:center;gap:8px}.hashes__key[data-v-ede0ed45]{display:flex;align-items:center;gap:6px;flex:none;width:84px;color:var(--muted);font-size:12px}.hashes__value[data-v-ede0ed45]{flex:1;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.swatch[data-v-ede0ed45]{display:inline-block;width:12px;height:12px;border:1px solid var(--border);border-radius:4px}.counter[data-v-4cbae639]{font-size:12px}.scroll[data-v-4cbae639]{display:flex;flex-direction:column;gap:16px;padding:16px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--border) transparent}.stage[data-v-4cbae639]{display:flex;align-items:center;justify-content:center;padding:12px;border-radius:9px;background:repeating-conic-gradient(var(--surface-2) 0% 25%,transparent 0% 50%) 50%/20px 20px}.stage__img[data-v-4cbae639]{display:block;max-width:100%;max-height:56vh;border-radius:6px;object-fit:contain}.compare[data-v-4cbae639]{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.compare__item[data-v-4cbae639]{display:flex;flex-direction:column;gap:6px;margin:0}.compare__item figcaption[data-v-4cbae639]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted);text-transform:uppercase}.compare__frame[data-v-4cbae639]{overflow:hidden;border-radius:9px;background:var(--surface-2)}.compare__preview[data-v-4cbae639]{display:block;width:100%;height:100%;object-fit:cover}.facts[data-v-4cbae639]{display:flex;flex-direction:column;gap:4px;margin:0}.facts__row[data-v-4cbae639]{display:flex;align-items:center;gap:12px;min-height:32px}.facts dt[data-v-4cbae639]{display:flex;align-items:center;gap:6px;flex:none;width:96px;color:var(--muted);font-size:12px}.facts dd[data-v-4cbae639]{flex:1;min-width:0;margin:0}.facts__mono[data-v-4cbae639]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px;word-break:break-all}.swatch[data-v-4cbae639]{display:inline-block;width:12px;height:12px;border:1px solid var(--border);border-radius:4px}.page[data-v-8acfc1cb]{display:flex;flex-direction:column;gap:16px;padding:28px 28px 60px}@media(max-width:760px){.page[data-v-8acfc1cb]{padding:18px 14px 40px}}.page__head p[data-v-8acfc1cb]{margin-top:4px}.block[data-v-8acfc1cb]{display:flex;flex-direction:column;gap:14px;padding:18px}.block__head[data-v-8acfc1cb]{display:flex;align-items:center;justify-content:space-between;gap:12px}.types[data-v-8acfc1cb]{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px}.type[data-v-8acfc1cb]{display:grid;grid-template-columns:auto 1fr;column-gap:10px;row-gap:2px;padding:12px;border:1px solid var(--border);border-radius:10px;cursor:pointer}.type--on[data-v-8acfc1cb]{border-color:var(--accent);background:var(--accent-soft)}.type input[data-v-8acfc1cb]{grid-row:1/3;margin-top:3px}.type__title[data-v-8acfc1cb]{font-weight:600}.type__text[data-v-8acfc1cb]{font-size:12px}.grid[data-v-8acfc1cb]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.runbar[data-v-8acfc1cb]{display:flex;align-items:center;gap:14px}.progress[data-v-8acfc1cb]{height:8px;overflow:hidden;border-radius:999px;background:var(--surface-2)}.progress__bar[data-v-8acfc1cb]{height:100%;background:var(--accent);transition:width .15s}.errors[data-v-8acfc1cb]{margin:0;padding:10px 14px 10px 28px;border-radius:10px;background:var(--danger-soft);color:var(--danger)}.tabs[data-v-8acfc1cb]{display:flex;gap:4px;border-bottom:1px solid var(--border)}.tab[data-v-8acfc1cb]{padding:8px 14px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);cursor:pointer}.tab[data-v-8acfc1cb]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.tab--on[data-v-8acfc1cb]{border-bottom-color:var(--accent);color:var(--text);font-weight:600}.gallery[data-v-8acfc1cb]{width:100%}.more[data-v-8acfc1cb]{display:flex;flex-wrap:wrap;align-items:center;gap:8px;justify-content:center}.outbar[data-v-8acfc1cb]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.outbar__path[data-v-8acfc1cb]{flex:1;min-width:220px;height:28px;font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px}.output[data-v-8acfc1cb]{max-height:420px;margin:0;padding:14px;border-radius:10px;background:var(--surface-2);font-size:12px;white-space:pre-wrap;word-break:break-all;overflow:auto}
1
+ .canvas[data-v-af1c304e]{display:block;width:100%;height:100%;object-fit:cover;background:var(--surface-2)}.canvas--bad[data-v-af1c304e]{display:grid;place-items:center;color:var(--danger)}.item[data-v-ede0ed45]{display:flex;flex-direction:column;gap:10px;padding:10px;min-width:0}.item__open[data-v-ede0ed45]{display:flex;flex-direction:column;gap:10px;padding:0;border:0;background:transparent;text-align:left;cursor:zoom-in}.item__open[data-v-ede0ed45]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.shots[data-v-ede0ed45]{display:block;overflow:hidden;border-radius:8px;background:var(--surface-2)}.shot[data-v-ede0ed45]{display:block;width:100%;height:100%;object-fit:cover;transition:transform .15s}.item__open:hover .shot[data-v-ede0ed45]{transform:scale(1.02)}.strip[data-v-ede0ed45]{display:flex;overflow:hidden;border-radius:8px}.strip__cell[data-v-ede0ed45]{position:relative;flex:1}.strip__label[data-v-ede0ed45]{position:absolute;left:4px;bottom:3px;padding:0 5px;border-radius:4px;background:#0000008c;color:#fff;font-size:10px}.preview[data-v-ede0ed45]{width:100%;border-radius:8px}.meta[data-v-ede0ed45]{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.meta__name[data-v-ede0ed45]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hashes[data-v-ede0ed45]{display:flex;flex-direction:column;gap:2px;margin:0;padding:0;list-style:none}.hashes li[data-v-ede0ed45]{display:flex;align-items:center;gap:8px}.hashes__key[data-v-ede0ed45]{display:flex;align-items:center;gap:6px;flex:none;width:84px;color:var(--muted);font-size:12px}.hashes__value[data-v-ede0ed45]{flex:1;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.swatch[data-v-ede0ed45]{display:inline-block;width:12px;height:12px;border:1px solid var(--border);border-radius:4px}.counter[data-v-4cbae639]{font-size:12px}.scroll[data-v-4cbae639]{display:flex;flex-direction:column;gap:16px;padding:16px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--border) transparent}.stage[data-v-4cbae639]{display:flex;align-items:center;justify-content:center;padding:12px;border-radius:9px;background:repeating-conic-gradient(var(--surface-2) 0% 25%,transparent 0% 50%) 50%/20px 20px}.stage__img[data-v-4cbae639]{display:block;max-width:100%;max-height:56vh;border-radius:6px;object-fit:contain}.compare[data-v-4cbae639]{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.compare__item[data-v-4cbae639]{display:flex;flex-direction:column;gap:6px;margin:0}.compare__item figcaption[data-v-4cbae639]{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--muted);text-transform:uppercase}.compare__frame[data-v-4cbae639]{overflow:hidden;border-radius:9px;background:var(--surface-2)}.compare__preview[data-v-4cbae639]{display:block;width:100%;height:100%;object-fit:cover}.facts[data-v-4cbae639]{display:flex;flex-direction:column;gap:4px;margin:0}.facts__row[data-v-4cbae639]{display:flex;align-items:center;gap:12px;min-height:32px}.facts dt[data-v-4cbae639]{display:flex;align-items:center;gap:6px;flex:none;width:96px;color:var(--muted);font-size:12px}.facts dd[data-v-4cbae639]{flex:1;min-width:0;margin:0}.facts__mono[data-v-4cbae639]{font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px;word-break:break-all}.swatch[data-v-4cbae639]{display:inline-block;width:12px;height:12px;border:1px solid var(--border);border-radius:4px}.page[data-v-00df68b7]{display:flex;flex-direction:column;gap:16px;padding:28px 28px 60px}@media(max-width:760px){.page[data-v-00df68b7]{padding:18px 14px 40px}}.page__head p[data-v-00df68b7]{margin-top:4px}.block[data-v-00df68b7]{display:flex;flex-direction:column;gap:14px;padding:18px}.block__head[data-v-00df68b7]{display:flex;align-items:center;justify-content:space-between;gap:12px}.types[data-v-00df68b7]{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px}.type[data-v-00df68b7]{display:grid;grid-template-columns:auto 1fr;column-gap:10px;row-gap:2px;padding:12px;border:1px solid var(--border);border-radius:10px;cursor:pointer}.type--on[data-v-00df68b7]{border-color:var(--accent);background:var(--accent-soft)}.type input[data-v-00df68b7]{grid-row:1/3;margin-top:3px}.type__title[data-v-00df68b7]{font-weight:600}.type__text[data-v-00df68b7]{font-size:12px}.grid[data-v-00df68b7]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.runbar[data-v-00df68b7]{display:flex;align-items:center;gap:14px}.progress[data-v-00df68b7]{height:8px;overflow:hidden;border-radius:999px;background:var(--surface-2)}.progress__bar[data-v-00df68b7]{height:100%;background:var(--accent);transition:width .15s}.errors[data-v-00df68b7]{margin:0;padding:10px 14px 10px 28px;border-radius:10px;background:var(--danger-soft);color:var(--danger)}.tabs[data-v-00df68b7]{display:flex;gap:4px;border-bottom:1px solid var(--border)}.tab[data-v-00df68b7]{padding:8px 14px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);cursor:pointer}.tab[data-v-00df68b7]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.tab--on[data-v-00df68b7]{border-bottom-color:var(--accent);color:var(--text);font-weight:600}.gallery[data-v-00df68b7]{width:100%}.more[data-v-00df68b7]{display:flex;flex-wrap:wrap;align-items:center;gap:8px;justify-content:center}.outbar[data-v-00df68b7]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.outbar__path[data-v-00df68b7]{flex:1;min-width:220px;height:28px;font-family:ui-monospace,Cascadia Code,SF Mono,Menlo,Consolas,monospace;font-size:12px}.output[data-v-00df68b7]{max-height:420px;margin:0;padding:14px;border-radius:10px;background:var(--surface-2);font-size:12px;white-space:pre-wrap;word-break:break-all;overflow:auto}
@@ -1 +1 @@
1
- import{d as W,o as K,a as O,b as o,e as n,H as J,f as a,t as v,M as E,j as S,m as z,k as h,n as te,x as B,r as _,_ as q,p as Q,q as R,l as C,F as M,g as A,y as D,z as se,I as X,u as P,i as le,G as H,c as N,v as Y,N as oe,D as j,w as ae,E as G}from"./index-yiehSw5D.js";const ne=["aria-label"],ie={class:"dialog__head"},ue={class:"dialog__title"},de={class:"dialog__body"},re={key:0,class:"dialog__foot"},ce=W({__name:"UiModal",props:{title:{},width:{default:"820px"},fixedHeight:{type:Boolean,default:!1}},emits:["close"],setup(c,{emit:U}){const p=c,r=U,s=_();function k(f){f.key==="Escape"&&r("close")}return K(()=>{window.addEventListener("keydown",k),document.body.style.overflow="hidden",s.value?.focus()}),O(()=>{window.removeEventListener("keydown",k),document.body.style.overflow=""}),(f,i)=>(o(),n("div",{class:"overlay",onMousedown:i[1]||(i[1]=J(b=>r("close"),["self"]))},[a("div",{ref_key:"dialog",ref:s,class:B(["dialog",{"dialog--fixed":p.fixedHeight}]),style:te({"--dialog-width":p.width}),role:"dialog","aria-modal":"true","aria-label":p.title,tabindex:"-1"},[a("header",ie,[a("h2",ue,v(p.title),1),E(f.$slots,"actions",{},void 0),a("button",{class:"btn btn--ghost btn--small","aria-label":"Close",onClick:i[0]||(i[0]=b=>r("close"))},[S(z,{name:"close"})])]),a("div",de,[E(f.$slots,"default",{},void 0)]),f.$slots.footer?(o(),n("footer",re,[E(f.$slots,"footer",{},void 0)])):h("",!0)],14,ne)],32))}}),ve=q(ce,[["__scopeId","data-v-e779e4b0"]]),fe={class:"bar"},me=["disabled"],be=["value"],he=["value"],pe={class:"check muted"},ke={key:0,class:"notice notice--error notice-inset"},ge=["aria-busy"],_e={key:0,class:"muted empty"},ye=["checked","aria-label","onChange"],$e=["onClick"],we={key:0,class:"row__icon"},Ce=["src"],xe={class:"row__name"},Se={key:2,class:"muted"},ze={key:1,class:"muted empty"},Me={class:"muted"},Ue=["disabled"],Be=["disabled"],Ie=W({__name:"FolderBrowser",props:{start:{},mode:{default:"sources"},title:{default:""}},emits:["close","confirm"],setup(c,{emit:U}){const p=c,r=U,s=_(),k=_(p.start),f=_(!1),i=_(!1),b=_(""),g=_(new Set),$=_(),y=new Map,x=N(()=>s.value?.path.includes("\\")?"\\":"/"),I=N(()=>(s.value?.entries??[]).filter(u=>p.mode!=="folder"||u.kind==="dir")),T=N(()=>s.value?.entries.filter(u=>u.kind==="image").length??0);function w(u){const e=s.value?.path??"";return e.endsWith(x.value)?e+u:e+x.value+u}function V(u,e){const t=e.endsWith("\\")||e.endsWith("/")?e:e+x.value;return u!==e&&u.startsWith(t)}async function l(u){const e=s.value?.path;e!==void 0&&y.set(e,$.value?.scrollTop??0),i.value=!0,b.value="";try{const t=await Y.get(`/api/fs/list?path=${encodeURIComponent(u)}&hidden=${f.value?1:0}`);s.value=t,k.value=t.path;for(const F of[...y.keys()])V(F,t.path)&&y.delete(F);await oe(),$.value?.scrollTo({top:y.get(t.path)??0})}catch(t){b.value=t instanceof Error?t.message:String(t)}finally{i.value=!1}}function d(u){u.kind==="dir"&&l(w(u.name))}function m(u){const e=w(u.name),t=new Set(g.value);t.has(e)?t.delete(e):t.add(e),g.value=t}function L(u){u.kind==="dir"?d(u):p.mode==="image"?r("confirm",[w(u.name)]):m(u)}function Z(){s.value&&r("confirm",[s.value.path])}function ee(){r("confirm",[...g.value])}return K(()=>{l(p.start)}),(u,e)=>(o(),Q(ve,{title:c.title||(c.mode==="folder"?"Choose a folder":c.mode==="image"?"Choose an image":"Add folders or images"),"fixed-height":"",onClose:e[8]||(e[8]=t=>r("close"))},{footer:R(()=>[a("span",Me,v(T.value)+" image"+v(T.value===1?"":"s")+" here",1),e[13]||(e[13]=a("span",{class:"spacer"},null,-1)),c.mode!=="image"?(o(),n("button",{key:0,class:B(["btn",{"btn--primary":c.mode==="folder"}]),disabled:!s.value,onClick:Z},v(c.mode==="folder"?"Use this folder":"Add this folder"),11,Ue)):h("",!0),c.mode==="sources"?(o(),n("button",{key:1,class:"btn btn--primary",disabled:g.value.size===0,onClick:ee}," Add "+v(g.value.size)+" selected ",9,Be)):h("",!0)]),default:R(()=>[a("div",fe,[a("button",{class:"btn btn--small",disabled:!s.value?.parent,title:"Parent folder",onClick:e[0]||(e[0]=t=>s.value?.parent&&l(s.value.parent))},[S(z,{name:"up",size:15}),e[9]||(e[9]=C(" Up ",-1))],8,me),a("button",{class:"btn btn--small",title:"Home folder",onClick:e[1]||(e[1]=t=>s.value&&l(s.value.home))},[S(z,{name:"home",size:15}),e[10]||(e[10]=C(" Home ",-1))]),a("button",{class:"btn btn--small",title:"Start folder",onClick:e[2]||(e[2]=t=>s.value&&l(s.value.cwd))}," Start folder "),(s.value?.roots.length??0)>1?(o(),n("select",{key:0,class:"select bar__roots",value:s.value?.root,"aria-label":"Drive",onChange:e[3]||(e[3]=t=>l(t.target.value))},[(o(!0),n(M,null,A(s.value?.roots,t=>(o(),n("option",{key:t,value:t},v(t),9,he))),128))],40,be)):h("",!0),a("form",{class:"bar__path",onSubmit:e[5]||(e[5]=J(t=>l(k.value),["prevent"]))},[D(a("input",{"onUpdate:modelValue":e[4]||(e[4]=t=>k.value=t),class:"input",spellcheck:"false","aria-label":"Folder path"},null,512),[[se,k.value]]),e[11]||(e[11]=a("button",{class:"btn btn--small",type:"submit"},"Go",-1))],32),a("label",pe,[D(a("input",{"onUpdate:modelValue":e[6]||(e[6]=t=>f.value=t),type:"checkbox",onChange:e[7]||(e[7]=t=>s.value&&l(s.value.path))},null,544),[[X,f.value]]),e[12]||(e[12]=C(" Hidden ",-1))])]),b.value?(o(),n("div",ke,v(b.value),1)):h("",!0),a("div",{ref_key:"list",ref:$,class:"list","aria-busy":i.value},[s.value&&I.value.length===0?(o(),n("div",_e," This folder has no subfolders or images. ")):h("",!0),(o(!0),n(M,null,A(I.value,t=>(o(),n("div",{key:t.name,class:B(["row",{"row--picked":g.value.has(w(t.name))}])},[c.mode==="sources"?(o(),n("input",{key:0,type:"checkbox",checked:g.value.has(w(t.name)),"aria-label":`Select ${t.name}`,onChange:F=>m(t)},null,40,ye)):h("",!0),a("button",{class:"row__main",onClick:F=>L(t)},[t.kind==="dir"?(o(),n("span",we,[S(z,{name:"folder"})])):(o(),n("img",{key:1,class:"row__thumb",loading:"lazy",alt:"",src:P(le)(w(t.name),96)},null,8,Ce)),a("span",xe,v(t.name),1),t.size!==void 0?(o(),n("span",Se,v(P(H)(t.size)),1)):h("",!0)],8,$e)],2))),128)),s.value?.truncated?(o(),n("div",ze,"Only the first entries are shown.")):h("",!0)],8,ge)]),_:1},8,["title"]))}}),Te=q(Ie,[["__scopeId","data-v-1908c9a0"]]),Fe={class:"card block"},He={class:"block__head"},Ve={key:0,class:"muted"},Ee={key:1,class:"sources"},Ne=["title"],Ae={class:"source__stats"},De=["aria-label","onClick"],Pe={class:"check"},We={key:0,class:"muted"},qe=W({__name:"SourcePicker",props:G({scanUrl:{},start:{},title:{}},{sources:{required:!0},sourcesModifiers:{},recursive:{type:Boolean,required:!0},recursiveModifiers:{}}),emits:G(["scanned"],["update:sources","update:recursive"]),setup(c,{emit:U}){const p=c,r=j(c,"sources"),s=j(c,"recursive"),k=U,f=_(!1),i=_(),b=_(!1);let g,$=0;function y(l,d){return`${l} ${d}${l===1?"":"s"}`}function x(l){return i.value?.sources.find(d=>d.path===l)}function I(l){return l?l.exists?l.kind==="file"?H(l.bytes):l.files===0?"no images":`${y(l.files,"image")} · ${y(l.folders,"folder")} · ${H(l.bytes)}`:"not found":b.value?"…":""}function T(l){r.value=[...new Set([...r.value,...l])],f.value=!1}function w(l){r.value=r.value.filter(d=>d!==l)}function V(){if(clearTimeout(g),r.value.length===0){i.value=void 0,b.value=!1,k("scanned",void 0);return}b.value=!0,g=setTimeout(async()=>{const l=++$;try{const d=await Y.post(p.scanUrl,{paths:r.value,recursive:s.value});l===$&&(i.value=d,k("scanned",d))}catch{l===$&&(i.value=void 0,k("scanned",void 0))}finally{l===$&&(b.value=!1)}},200)}return ae([r,s],V,{deep:!0,immediate:!0}),O(()=>clearTimeout(g)),(l,d)=>(o(),n("section",Fe,[a("div",He,[a("h2",null,v(c.title??"Images"),1),a("button",{class:"btn",onClick:d[0]||(d[0]=m=>f.value=!0)},[S(z,{name:"plus",size:16}),d[3]||(d[3]=C(" Add folder or images ",-1))])]),r.value.length===0?(o(),n("p",Ve," Add the folders and images to process. Subfolders are included when the box below is ticked. ")):(o(),n("ul",Ee,[(o(!0),n(M,null,A(r.value,m=>(o(),n("li",{key:m,class:B(["source",{"source--bad":x(m)?.exists===!1}])},[S(z,{name:x(m)?.kind==="file"?"image":"folder",size:16},null,8,["name"]),a("span",{class:"source__path",title:m},v(m),9,Ne),a("span",Ae,v(I(x(m))),1),a("button",{class:"source__x","aria-label":`Remove ${m}`,onClick:L=>w(m)},[S(z,{name:"close",size:14})],8,De)],2))),128))])),a("label",Pe,[D(a("input",{"onUpdate:modelValue":d[1]||(d[1]=m=>s.value=m),type:"checkbox"},null,512),[[X,s.value]]),d[4]||(d[4]=C(" Include subfolders",-1))]),r.value.length>0?(o(),n("p",{key:2,class:B(["summary",{"summary--warn":i.value&&i.value.total.files===0}]),role:"status"},[b.value&&!i.value?(o(),n(M,{key:0},[C("Counting images…")],64)):i.value&&i.value.total.files===0?(o(),n(M,{key:1},[C(" No images found. Check the paths"+v(s.value?"":' or tick "Include subfolders"')+". ",1)],64)):i.value?(o(),n(M,{key:2},[a("strong",null,v(y(i.value.total.files,"image")),1),C(" in "+v(y(i.value.total.folders,"folder"))+" · "+v(P(H)(i.value.total.bytes))+" ",1),b.value?(o(),n("span",We,"· updating…")):h("",!0)],64)):h("",!0)],2)):h("",!0),f.value?(o(),Q(Te,{key:3,start:r.value[0]??c.start,onClose:d[2]||(d[2]=m=>f.value=!1),onConfirm:T},null,8,["start"])):h("",!0)]))}}),Re=q(qe,[["__scopeId","data-v-f42c443b"]]);export{Te as F,Re as S,ve as U};
1
+ import{d as W,o as K,a as O,b as o,e as n,H as J,f as a,t as v,M as E,j as S,m as z,k as h,n as te,x as B,r as _,_ as q,p as Q,q as R,l as C,F as M,g as A,y as D,z as se,I as X,u as P,i as le,G as H,c as N,v as Y,N as oe,D as j,w as ae,E as G}from"./index-Dzvs2f2Q.js";const ne=["aria-label"],ie={class:"dialog__head"},ue={class:"dialog__title"},de={class:"dialog__body"},re={key:0,class:"dialog__foot"},ce=W({__name:"UiModal",props:{title:{},width:{default:"820px"},fixedHeight:{type:Boolean,default:!1}},emits:["close"],setup(c,{emit:U}){const p=c,r=U,s=_();function k(f){f.key==="Escape"&&r("close")}return K(()=>{window.addEventListener("keydown",k),document.body.style.overflow="hidden",s.value?.focus()}),O(()=>{window.removeEventListener("keydown",k),document.body.style.overflow=""}),(f,i)=>(o(),n("div",{class:"overlay",onMousedown:i[1]||(i[1]=J(b=>r("close"),["self"]))},[a("div",{ref_key:"dialog",ref:s,class:B(["dialog",{"dialog--fixed":p.fixedHeight}]),style:te({"--dialog-width":p.width}),role:"dialog","aria-modal":"true","aria-label":p.title,tabindex:"-1"},[a("header",ie,[a("h2",ue,v(p.title),1),E(f.$slots,"actions",{},void 0),a("button",{class:"btn btn--ghost btn--small","aria-label":"Close",onClick:i[0]||(i[0]=b=>r("close"))},[S(z,{name:"close"})])]),a("div",de,[E(f.$slots,"default",{},void 0)]),f.$slots.footer?(o(),n("footer",re,[E(f.$slots,"footer",{},void 0)])):h("",!0)],14,ne)],32))}}),ve=q(ce,[["__scopeId","data-v-e779e4b0"]]),fe={class:"bar"},me=["disabled"],be=["value"],he=["value"],pe={class:"check muted"},ke={key:0,class:"notice notice--error notice-inset"},ge=["aria-busy"],_e={key:0,class:"muted empty"},ye=["checked","aria-label","onChange"],$e=["onClick"],we={key:0,class:"row__icon"},Ce=["src"],xe={class:"row__name"},Se={key:2,class:"muted"},ze={key:1,class:"muted empty"},Me={class:"muted"},Ue=["disabled"],Be=["disabled"],Ie=W({__name:"FolderBrowser",props:{start:{},mode:{default:"sources"},title:{default:""}},emits:["close","confirm"],setup(c,{emit:U}){const p=c,r=U,s=_(),k=_(p.start),f=_(!1),i=_(!1),b=_(""),g=_(new Set),$=_(),y=new Map,x=N(()=>s.value?.path.includes("\\")?"\\":"/"),I=N(()=>(s.value?.entries??[]).filter(u=>p.mode!=="folder"||u.kind==="dir")),T=N(()=>s.value?.entries.filter(u=>u.kind==="image").length??0);function w(u){const e=s.value?.path??"";return e.endsWith(x.value)?e+u:e+x.value+u}function V(u,e){const t=e.endsWith("\\")||e.endsWith("/")?e:e+x.value;return u!==e&&u.startsWith(t)}async function l(u){const e=s.value?.path;e!==void 0&&y.set(e,$.value?.scrollTop??0),i.value=!0,b.value="";try{const t=await Y.get(`/api/fs/list?path=${encodeURIComponent(u)}&hidden=${f.value?1:0}`);s.value=t,k.value=t.path;for(const F of[...y.keys()])V(F,t.path)&&y.delete(F);await oe(),$.value?.scrollTo({top:y.get(t.path)??0})}catch(t){b.value=t instanceof Error?t.message:String(t)}finally{i.value=!1}}function d(u){u.kind==="dir"&&l(w(u.name))}function m(u){const e=w(u.name),t=new Set(g.value);t.has(e)?t.delete(e):t.add(e),g.value=t}function L(u){u.kind==="dir"?d(u):p.mode==="image"?r("confirm",[w(u.name)]):m(u)}function Z(){s.value&&r("confirm",[s.value.path])}function ee(){r("confirm",[...g.value])}return K(()=>{l(p.start)}),(u,e)=>(o(),Q(ve,{title:c.title||(c.mode==="folder"?"Choose a folder":c.mode==="image"?"Choose an image":"Add folders or images"),"fixed-height":"",onClose:e[8]||(e[8]=t=>r("close"))},{footer:R(()=>[a("span",Me,v(T.value)+" image"+v(T.value===1?"":"s")+" here",1),e[13]||(e[13]=a("span",{class:"spacer"},null,-1)),c.mode!=="image"?(o(),n("button",{key:0,class:B(["btn",{"btn--primary":c.mode==="folder"}]),disabled:!s.value,onClick:Z},v(c.mode==="folder"?"Use this folder":"Add this folder"),11,Ue)):h("",!0),c.mode==="sources"?(o(),n("button",{key:1,class:"btn btn--primary",disabled:g.value.size===0,onClick:ee}," Add "+v(g.value.size)+" selected ",9,Be)):h("",!0)]),default:R(()=>[a("div",fe,[a("button",{class:"btn btn--small",disabled:!s.value?.parent,title:"Parent folder",onClick:e[0]||(e[0]=t=>s.value?.parent&&l(s.value.parent))},[S(z,{name:"up",size:15}),e[9]||(e[9]=C(" Up ",-1))],8,me),a("button",{class:"btn btn--small",title:"Home folder",onClick:e[1]||(e[1]=t=>s.value&&l(s.value.home))},[S(z,{name:"home",size:15}),e[10]||(e[10]=C(" Home ",-1))]),a("button",{class:"btn btn--small",title:"Start folder",onClick:e[2]||(e[2]=t=>s.value&&l(s.value.cwd))}," Start folder "),(s.value?.roots.length??0)>1?(o(),n("select",{key:0,class:"select bar__roots",value:s.value?.root,"aria-label":"Drive",onChange:e[3]||(e[3]=t=>l(t.target.value))},[(o(!0),n(M,null,A(s.value?.roots,t=>(o(),n("option",{key:t,value:t},v(t),9,he))),128))],40,be)):h("",!0),a("form",{class:"bar__path",onSubmit:e[5]||(e[5]=J(t=>l(k.value),["prevent"]))},[D(a("input",{"onUpdate:modelValue":e[4]||(e[4]=t=>k.value=t),class:"input",spellcheck:"false","aria-label":"Folder path"},null,512),[[se,k.value]]),e[11]||(e[11]=a("button",{class:"btn btn--small",type:"submit"},"Go",-1))],32),a("label",pe,[D(a("input",{"onUpdate:modelValue":e[6]||(e[6]=t=>f.value=t),type:"checkbox",onChange:e[7]||(e[7]=t=>s.value&&l(s.value.path))},null,544),[[X,f.value]]),e[12]||(e[12]=C(" Hidden ",-1))])]),b.value?(o(),n("div",ke,v(b.value),1)):h("",!0),a("div",{ref_key:"list",ref:$,class:"list","aria-busy":i.value},[s.value&&I.value.length===0?(o(),n("div",_e," This folder has no subfolders or images. ")):h("",!0),(o(!0),n(M,null,A(I.value,t=>(o(),n("div",{key:t.name,class:B(["row",{"row--picked":g.value.has(w(t.name))}])},[c.mode==="sources"?(o(),n("input",{key:0,type:"checkbox",checked:g.value.has(w(t.name)),"aria-label":`Select ${t.name}`,onChange:F=>m(t)},null,40,ye)):h("",!0),a("button",{class:"row__main",onClick:F=>L(t)},[t.kind==="dir"?(o(),n("span",we,[S(z,{name:"folder"})])):(o(),n("img",{key:1,class:"row__thumb",loading:"lazy",alt:"",src:P(le)(w(t.name),96)},null,8,Ce)),a("span",xe,v(t.name),1),t.size!==void 0?(o(),n("span",Se,v(P(H)(t.size)),1)):h("",!0)],8,$e)],2))),128)),s.value?.truncated?(o(),n("div",ze,"Only the first entries are shown.")):h("",!0)],8,ge)]),_:1},8,["title"]))}}),Te=q(Ie,[["__scopeId","data-v-1908c9a0"]]),Fe={class:"card block"},He={class:"block__head"},Ve={key:0,class:"muted"},Ee={key:1,class:"sources"},Ne=["title"],Ae={class:"source__stats"},De=["aria-label","onClick"],Pe={class:"check"},We={key:0,class:"muted"},qe=W({__name:"SourcePicker",props:G({scanUrl:{},start:{},title:{}},{sources:{required:!0},sourcesModifiers:{},recursive:{type:Boolean,required:!0},recursiveModifiers:{}}),emits:G(["scanned"],["update:sources","update:recursive"]),setup(c,{emit:U}){const p=c,r=j(c,"sources"),s=j(c,"recursive"),k=U,f=_(!1),i=_(),b=_(!1);let g,$=0;function y(l,d){return`${l} ${d}${l===1?"":"s"}`}function x(l){return i.value?.sources.find(d=>d.path===l)}function I(l){return l?l.exists?l.kind==="file"?H(l.bytes):l.files===0?"no images":`${y(l.files,"image")} · ${y(l.folders,"folder")} · ${H(l.bytes)}`:"not found":b.value?"…":""}function T(l){r.value=[...new Set([...r.value,...l])],f.value=!1}function w(l){r.value=r.value.filter(d=>d!==l)}function V(){if(clearTimeout(g),r.value.length===0){i.value=void 0,b.value=!1,k("scanned",void 0);return}b.value=!0,g=setTimeout(async()=>{const l=++$;try{const d=await Y.post(p.scanUrl,{paths:r.value,recursive:s.value});l===$&&(i.value=d,k("scanned",d))}catch{l===$&&(i.value=void 0,k("scanned",void 0))}finally{l===$&&(b.value=!1)}},200)}return ae([r,s],V,{deep:!0,immediate:!0}),O(()=>clearTimeout(g)),(l,d)=>(o(),n("section",Fe,[a("div",He,[a("h2",null,v(c.title??"Images"),1),a("button",{class:"btn",onClick:d[0]||(d[0]=m=>f.value=!0)},[S(z,{name:"plus",size:16}),d[3]||(d[3]=C(" Add folder or images ",-1))])]),r.value.length===0?(o(),n("p",Ve," Add the folders and images to process. Subfolders are included when the box below is ticked. ")):(o(),n("ul",Ee,[(o(!0),n(M,null,A(r.value,m=>(o(),n("li",{key:m,class:B(["source",{"source--bad":x(m)?.exists===!1}])},[S(z,{name:x(m)?.kind==="file"?"image":"folder",size:16},null,8,["name"]),a("span",{class:"source__path",title:m},v(m),9,Ne),a("span",Ae,v(I(x(m))),1),a("button",{class:"source__x","aria-label":`Remove ${m}`,onClick:L=>w(m)},[S(z,{name:"close",size:14})],8,De)],2))),128))])),a("label",Pe,[D(a("input",{"onUpdate:modelValue":d[1]||(d[1]=m=>s.value=m),type:"checkbox"},null,512),[[X,s.value]]),d[4]||(d[4]=C(" Include subfolders",-1))]),r.value.length>0?(o(),n("p",{key:2,class:B(["summary",{"summary--warn":i.value&&i.value.total.files===0}]),role:"status"},[b.value&&!i.value?(o(),n(M,{key:0},[C("Counting images…")],64)):i.value&&i.value.total.files===0?(o(),n(M,{key:1},[C(" No images found. Check the paths"+v(s.value?"":' or tick "Include subfolders"')+". ",1)],64)):i.value?(o(),n(M,{key:2},[a("strong",null,v(y(i.value.total.files,"image")),1),C(" in "+v(y(i.value.total.folders,"folder"))+" · "+v(P(H)(i.value.total.bytes))+" ",1),b.value?(o(),n("span",We,"· updating…")):h("",!0)],64)):h("",!0)],2)):h("",!0),f.value?(o(),Q(Te,{key:3,start:r.value[0]??c.start,onClose:d[2]||(d[2]=m=>f.value=!1),onConfirm:T},null,8,["start"])):h("",!0)]))}}),Re=q(qe,[["__scopeId","data-v-f42c443b"]]);export{Te as F,Re as S,ve as U};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ImageHashPage-DjIlDPu-.js","assets/SourcePicker-Db0dG6zc.js","assets/SourcePicker-D8aZjDwP.css","assets/ImageHashPage-D0xZlLGw.css","assets/ImageBatchPage-D3f4z6YA.js","assets/ImageBatchPage-DwaunraE.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ImageHashPage-DpyJdByU.js","assets/SourcePicker-eKj_VZzO.js","assets/SourcePicker-D8aZjDwP.css","assets/ImageHashPage-chcY_Dzm.css","assets/ImageBatchPage-DVaFnQY8.js","assets/ImageBatchPage-CY5Zbg4t.css"])))=>i.map(i=>d[i]);
2
2
  (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function ns(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $={},it=[],Re=()=>{},dr=()=>!1,gn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),mn=e=>e.startsWith("onUpdate:"),X=Object.assign,ss=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ti=Object.prototype.hasOwnProperty,U=(e,t)=>Ti.call(e,t),A=Array.isArray,Ge=e=>$t(e)==="[object Map]",Ue=e=>$t(e)==="[object Set]",As=e=>$t(e)==="[object Date]",R=e=>typeof e=="function",J=e=>typeof e=="string",be=e=>typeof e=="symbol",K=e=>e!==null&&typeof e=="object",hr=e=>(K(e)||R(e))&&R(e.then)&&R(e.catch),pr=Object.prototype.toString,$t=e=>pr.call(e),Mi=e=>$t(e).slice(8,-1),gr=e=>$t(e)==="[object Object]",rs=e=>J(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Tt=ns(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),_n=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Oi=/-\w/g,re=_n(e=>e.replace(Oi,t=>t.slice(1).toUpperCase())),Ai=/\B([A-Z])/g,Ze=_n(e=>e.replace(Ai,"-$1").toLowerCase()),yn=_n(e=>e.charAt(0).toUpperCase()+e.slice(1)),Rn=_n(e=>e?`on${yn(e)}`:""),ee=(e,t)=>!Object.is(e,t),Qt=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},mr=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},bn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Ps;const vn=()=>Ps||(Ps=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function is(e){if(A(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=J(s)?Fi(s):is(s);if(r)for(const i in r)t[i]=r[i]}return t}else if(J(e)||K(e))return e}const Pi=/;(?![^(]*\))/g,Ii=/:([^]+)/,Ri=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Fi(e){const t={};return e.replace(Ri,n=>n.startsWith("/*")?"":n).split(Pi).forEach(n=>{if(n){const s=n.split(Ii);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function xn(e){let t="";if(J(e))t=e;else if(A(e))for(let n=0;n<e.length;n++){const s=xn(e[n]);s&&(t+=s+" ")}else if(K(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Vi="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ni=ns(Vi);function _r(e){return!!e||e===""}function Di(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let r=0;s&&r<e.length;r++)s=Ke(e[r],t[r],n);return s}function Is(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),r=new Uint8Array(s.length);for(const i of e){let o=-1;for(let l=0;l<s.length;l++)if(!r[l]&&Ke(i,s[l],n)){o=l;break}if(o<0)return!1;r[o]=1}return!0}function Li(e,t,n){let s=Ge(e),r=Ge(t);if(s||r||(s=Ue(e),r=Ue(t),s||r))return s&&r?Is(e,t,n):!1;const i=Object.keys(e).length,o=Object.keys(t).length;if(i!==o)return!1;for(const l in e){const c=e.hasOwnProperty(l),d=t.hasOwnProperty(l);if(c&&!d||!c&&d||!Ke(e[l],t[l],n))return!1}return String(e)===String(t)}function Rs(e,t,n,s){n||(n=[new Map,new Map]);const[r,i]=n;if(r.has(e)||i.has(t))return r.get(e)===t&&i.get(t)===e;r.set(e,t),i.set(t,e);const o=s(e,t,n);return r.delete(e),i.delete(t),o}function Ke(e,t,n){if(e===t)return!0;let s=As(e),r=As(t);return s||r?s&&r?e.getTime()===t.getTime():!1:(s=be(e),r=be(t),s||r?e===t:(s=A(e),r=A(t),s||r?s&&r?Rs(e,t,n,Di):!1:(s=K(e),r=K(t),s||r?!s||!r?!1:Rs(e,t,n,Li):String(e)===String(t))))}function os(e,t){return e.findIndex(n=>Ke(n,t))}const yr=e=>!!(e&&e.__v_isRef===!0),en=e=>J(e)?e:e==null?"":A(e)||K(e)&&(e.toString===pr||!R(e.toString))?yr(e)?en(e.value):JSON.stringify(e,br,2):String(e),br=(e,t)=>yr(t)?br(e,t.value):Ge(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[Fn(s,i)+" =>"]=r,n),{})}:Ue(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Fn(n))}:be(t)?Fn(t):K(t)&&!A(t)&&!gr(t)?String(t):t,Fn=(e,t="")=>{var n;return be(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let Q;class $i{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Q&&(Q.active?(this.parent=Q,this.index=(Q.scopes||(Q.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Q;try{return Q=this,t()}finally{Q=n}}}on(){++this._on===1&&(this.prevScope=Q,Q=this)}off(){if(this._on>0&&--this._on===0){if(Q===this)Q=this.prevScope;else{let t=Q;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const r=this.scopes.slice();for(n=0,s=r.length;n<s;n++)r[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Hi(){return Q}let q;const Vn=new WeakSet;class vr{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Q&&(Q.active?Q.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Vn.has(this)&&(Vn.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Sr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Fs(this),wr(this);const t=q,n=ye;q=this,ye=!0;try{return this.fn()}finally{Cr(this),q=t,ye=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)fs(t);this.deps=this.depsTail=void 0,Fs(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Vn.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){qn(this)&&this.run()}get dirty(){return qn(this)}}let xr=0,Mt,Ot;function Sr(e,t=!1){if(e.flags|=8,t){e.next=Ot,Ot=e;return}e.next=Mt,Mt=e}function ls(){xr++}function cs(){if(--xr>0)return;if(Ot){let t=Ot;for(Ot=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Mt;){let t=Mt;for(Mt=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function wr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Cr(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),fs(s),ji(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function qn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Er(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Er(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===It)||(e.globalVersion=It,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!qn(e))))return;e.flags|=2;const t=e.dep,n=q,s=ye;q=e,ye=!0;try{wr(e);const r=e.fn(e._value);(t.version===0||ee(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{q=n,ye=s,Cr(e),e.flags&=-3}}function fs(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)fs(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ji(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ye=!0;const Tr=[];function Be(){Tr.push(ye),ye=!1}function We(){const e=Tr.pop();ye=e===void 0?!0:e}function Fs(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=q;q=void 0;try{t()}finally{q=n}}}let It=0;class Ui{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Sn{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!q||!ye||q===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==q)n=this.activeLink=new Ui(q,this),q.deps?(n.prevDep=q.depsTail,q.depsTail.nextDep=n,q.depsTail=n):q.deps=q.depsTail=n,Mr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=q.depsTail,n.nextDep=void 0,q.depsTail.nextDep=n,q.depsTail=n,q.deps===n&&(q.deps=s)}return n}trigger(t){this.version++,It++,this.notify(t)}notify(t){ls();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{cs()}}}function Mr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Mr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const kn=new WeakMap,ot=Symbol(""),Jn=Symbol(""),Rt=Symbol("");function se(e,t,n){if(ye&&q){let s=kn.get(e);s||kn.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Sn),r.map=s,r.key=n),r.track()}}function $e(e,t,n,s,r,i){const o=kn.get(e);if(!o){It++;return}const l=c=>{c&&c.trigger()};if(ls(),t==="clear")o.forEach(l);else{const c=A(e),d=c&&rs(n);if(c&&n==="length"){const u=Number(s);o.forEach((p,b)=>{(b==="length"||b===Rt||!be(b)&&b>=u)&&l(p)})}else switch((n!==void 0||o.has(void 0))&&l(o.get(n)),d&&l(o.get(Rt)),t){case"add":c?d&&l(o.get("length")):(l(o.get(ot)),Ge(e)&&l(o.get(Jn)));break;case"delete":c||(l(o.get(ot)),Ge(e)&&l(o.get(Jn)));break;case"set":Ge(e)&&l(o.get(ot));break}}cs()}function lt(e){const t=j(e);return t===e||(se(t,"iterate",Rt),ge(e))?t:Fe(e)?Ye(e)?t.map(n=>Xe(me(n))):t.map(Xe):t.map(me)}function wn(e){return se(e=j(e),"iterate",Rt),e}function Ae(e,t){return Fe(e)?Xe(Ye(e)?me(t):t):me(t)}const Ki={__proto__:null,[Symbol.iterator](){return Nn(this,Symbol.iterator,e=>Ae(this,e))},concat(...e){return lt(this).concat(...e.map(t=>A(t)?lt(t):t))},entries(){return Nn(this,"entries",e=>(e[1]=Ae(this,e[1]),e))},every(e,t){return Ne(this,"every",e,t,void 0,arguments)},filter(e,t){return Ne(this,"filter",e,t,n=>n.map(s=>Ae(this,s)),arguments)},find(e,t){return Ne(this,"find",e,t,n=>Ae(this,n),arguments)},findIndex(e,t){return Ne(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ne(this,"findLast",e,t,n=>Ae(this,n),arguments)},findLastIndex(e,t){return Ne(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ne(this,"forEach",e,t,void 0,arguments)},includes(...e){return Dn(this,"includes",e)},indexOf(...e){return Dn(this,"indexOf",e)},join(e){return lt(this).join(e)},lastIndexOf(...e){return Dn(this,"lastIndexOf",e)},map(e,t){return Ne(this,"map",e,t,void 0,arguments)},pop(){return vt(this,"pop")},push(...e){return vt(this,"push",e)},reduce(e,...t){return Vs(this,"reduce",e,t)},reduceRight(e,...t){return Vs(this,"reduceRight",e,t)},shift(){return vt(this,"shift")},some(e,t){return Ne(this,"some",e,t,void 0,arguments)},splice(...e){return vt(this,"splice",e)},toReversed(){return lt(this).toReversed()},toSorted(e){return lt(this).toSorted(e)},toSpliced(...e){return lt(this).toSpliced(...e)},unshift(...e){return vt(this,"unshift",e)},values(){return Nn(this,"values",e=>Ae(this,e))}};function Nn(e,t,n){const s=wn(e),r=s[t]();return s!==e&&!ge(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Bi=Array.prototype;function Ne(e,t,n,s,r,i){const o=wn(e),l=o!==e&&!ge(e),c=o[t];if(c!==Bi[t]){const p=c.apply(e,i);return l?me(p):p}let d=n;o!==e&&(l?d=function(p,b){return n.call(this,Ae(e,p),b,e)}:n.length>2&&(d=function(p,b){return n.call(this,p,b,e)}));const u=c.call(o,d,s);return l&&r?r(u):u}function Vs(e,t,n,s){const r=wn(e),i=r!==e&&!ge(e);let o=n,l=!1;r!==e&&(i?(l=s.length===0,o=function(d,u,p){return l&&(l=!1,d=Ae(e,d)),n.call(this,d,Ae(e,u),p,e)}):n.length>3&&(o=function(d,u,p){return n.call(this,d,u,p,e)}));const c=r[t](o,...s);return l?Ae(e,c):c}function Dn(e,t,n){const s=j(e);se(s,"iterate",Rt);const r=s[t](...n);return(r===-1||r===!1)&&hs(n[0])?(n[0]=j(n[0]),s[t](...n)):r}function vt(e,t,n=[]){Be(),ls();const s=j(e)[t].apply(e,n);return cs(),We(),s}const Wi=ns("__proto__,__v_isRef,__isVue"),Or=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(be));function zi(e){be(e)||(e=String(e));const t=j(this);return se(t,"has",e),t.hasOwnProperty(e)}class Ar{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?to:Fr:i?Rr:Ir).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=A(t);if(!r){let c;if(o&&(c=Ki[n]))return c;if(n==="hasOwnProperty")return zi}const l=Reflect.get(t,n,ie(t)?t:s);if((be(n)?Or.has(n):Wi(n))||(r||se(t,"get",n),i))return l;if(ie(l)){const c=o&&rs(n)?l:l.value;return r&&K(c)?Yn(c):c}return K(l)?r?Yn(l):as(l):l}}class Pr extends Ar{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=A(t)&&rs(n);if(!this._isShallow){const d=Fe(i);if(!ge(s)&&!Fe(s)&&(i=j(i),s=j(s)),!o&&ie(i)&&!ie(s))return d||(i.value=s),!0}const l=o?Number(n)<t.length:U(t,n),c=Reflect.set(t,n,s,ie(t)?t:r);return t===j(r)&&c&&(l?ee(s,i)&&$e(t,"set",n,s):$e(t,"add",n,s)),c}deleteProperty(t,n){const s=U(t,n);t[n];const r=Reflect.deleteProperty(t,n);return r&&s&&$e(t,"delete",n,void 0),r}has(t,n){const s=Reflect.has(t,n);return(!be(n)||!Or.has(n))&&se(t,"has",n),s}ownKeys(t){return se(t,"iterate",A(t)?"length":ot),Reflect.ownKeys(t)}}class qi extends Ar{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const ki=new Pr,Ji=new qi,Gi=new Pr(!0);const Gn=e=>e,kt=e=>Reflect.getPrototypeOf(e);function Yi(e,t,n){return function(...s){const r=this.__v_raw,i=j(r),o=Ge(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,d=r[e](...s),u=n?Gn:t?Xe:me;return!t&&se(i,"iterate",c?Jn:ot),X(Object.create(d),{next(){const{value:p,done:b}=d.next();return b?{value:p,done:b}:{value:l?[u(p[0]),u(p[1])]:u(p),done:b}}})}}function Jt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Xi(e,t){const n={get(r){const i=this.__v_raw,o=j(i),l=j(r);e||(ee(r,l)&&se(o,"get",r),se(o,"get",l));const{has:c}=kt(o),d=t?Gn:e?Xe:me;if(c.call(o,r))return d(i.get(r));if(c.call(o,l))return d(i.get(l));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&se(j(r),"iterate",ot),r.size},has(r){const i=this.__v_raw,o=j(i),l=j(r);return e||(ee(r,l)&&se(o,"has",r),se(o,"has",l)),r===l?i.has(r):i.has(r)||i.has(l)},forEach(r,i){const o=this,l=o.__v_raw,c=j(l),d=t?Gn:e?Xe:me;return!e&&se(c,"iterate",ot),l.forEach((u,p)=>r.call(i,d(u),d(p),o))}};return X(n,e?{add:Jt("add"),set:Jt("set"),delete:Jt("delete"),clear:Jt("clear")}:{add(r){const i=j(this),o=kt(i),l=j(r),c=!t&&!ge(r)&&!Fe(r)?l:r;return o.has.call(i,c)||ee(r,c)&&o.has.call(i,r)||ee(l,c)&&o.has.call(i,l)||(i.add(c),$e(i,"add",c,c)),this},set(r,i){!t&&!ge(i)&&!Fe(i)&&(i=j(i));const o=j(this),{has:l,get:c}=kt(o);let d=l.call(o,r);d||(r=j(r),d=l.call(o,r));const u=c.call(o,r);return o.set(r,i),d?ee(i,u)&&$e(o,"set",r,i):$e(o,"add",r,i),this},delete(r){const i=j(this),{has:o,get:l}=kt(i);let c=o.call(i,r);c||(r=j(r),c=o.call(i,r)),l&&l.call(i,r);const d=i.delete(r);return c&&$e(i,"delete",r,void 0),d},clear(){const r=j(this),i=r.size!==0,o=r.clear();return i&&$e(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Yi(r,e,t)}),n}function us(e,t){const n=Xi(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(U(n,r)&&r in s?n:s,r,i)}const Zi={get:us(!1,!1)},Qi={get:us(!1,!0)},eo={get:us(!0,!1)};const Ir=new WeakMap,Rr=new WeakMap,Fr=new WeakMap,to=new WeakMap;function no(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function as(e){return Fe(e)?e:ds(e,!1,ki,Zi,Ir)}function so(e){return ds(e,!1,Gi,Qi,Rr)}function Yn(e){return ds(e,!0,Ji,eo,Fr)}function ds(e,t,n,s,r){if(!K(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=r.get(e);if(i)return i;const o=no(Mi(e));if(o===0)return e;const l=new Proxy(e,o===2?s:n);return r.set(e,l),l}function Ye(e){return Fe(e)?Ye(e.__v_raw):!!(e&&e.__v_isReactive)}function Fe(e){return!!(e&&e.__v_isReadonly)}function ge(e){return!!(e&&e.__v_isShallow)}function hs(e){return e?!!e.__v_raw:!1}function j(e){const t=e&&e.__v_raw;return t?j(t):e}function ro(e){return!U(e,"__v_skip")&&Object.isExtensible(e)&&mr(e,"__v_skip",!0),e}const me=e=>K(e)?as(e):e,Xe=e=>K(e)?Yn(e):e;function ie(e){return e?e.__v_isRef===!0:!1}function ft(e){return Vr(e,!1)}function Ec(e){return Vr(e,!0)}function Vr(e,t){return ie(e)?e:new io(e,t)}class io{constructor(t,n){this.dep=new Sn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:j(t),this._value=n?t:me(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||ge(t)||Fe(t);t=s?t:j(t),ee(t,n)&&(this._rawValue=t,this._value=s?t:me(t),this.dep.trigger())}}function Nr(e){return ie(e)?e.value:e}const oo={get:(e,t,n)=>t==="__v_raw"?e:Nr(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return ie(r)&&!ie(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Dr(e){return Ye(e)?e:new Proxy(e,oo)}class lo{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Sn,{get:s,set:r}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=r}get value(){return this._value=this._get()}set value(t){this._set(t)}}function co(e){return new lo(e)}class fo{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Sn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=It-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&q!==this)return Sr(this,!0),!0}get value(){const t=this.dep.track();return Er(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function uo(e,t,n=!1){let s,r;return R(e)?s=e:(s=e.get,r=e.set),new fo(s,r,n)}const Gt={},sn=new WeakMap;let rt;function ao(e,t=!1,n=rt){if(n){let s=sn.get(n);s||sn.set(n,s=[]),s.push(e)}}function ho(e,t,n=$){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:l,call:c}=n,d=M=>r?M:ge(M)||r===!1||r===0?He(M,1):He(M);let u,p,b,C,T=!1,S=!1;if(ie(e)?(p=()=>e.value,T=ge(e)):Ye(e)?(p=()=>d(e),T=!0):A(e)?(S=!0,T=e.some(M=>Ye(M)||ge(M)),p=()=>e.map(M=>{if(ie(M))return M.value;if(Ye(M))return d(M);if(R(M))return c?c(M,2):M()})):R(e)?t?p=c?()=>c(e,2):e:p=()=>{if(b){Be();try{b()}finally{We()}}const M=rt;rt=u;try{return c?c(e,3,[C]):e(C)}finally{rt=M}}:p=Re,t&&r){const M=p,N=r===!0?1/0:r;p=()=>He(M(),N)}const H=Hi(),D=()=>{u.stop(),H&&H.active&&ss(H.effects,u)};if(i&&t){const M=t;t=(...N)=>{const pe=M(...N);return D(),pe}}let F=S?new Array(e.length).fill(Gt):Gt;const V=M=>{if(!(!(u.flags&1)||!u.dirty&&!M))if(t){const N=u.run();if(M||r||T||(S?N.some((pe,xe)=>ee(pe,F[xe])):ee(N,F))){b&&b();const pe=rt;rt=u;try{const xe=[N,F===Gt?void 0:S&&F[0]===Gt?[]:F,C];F=N,c?c(t,3,xe):t(...xe)}finally{rt=pe}}}else u.run()};return l&&l(V),u=new vr(p),u.scheduler=o?()=>o(V,!1):V,C=M=>ao(M,!1,u),b=u.onStop=()=>{const M=sn.get(u);if(M){if(c)c(M,4);else for(const N of M)N();sn.delete(u)}},t?s?V(!0):F=u.run():o?o(V.bind(null,!0),!0):u.run(),D.pause=u.pause.bind(u),D.resume=u.resume.bind(u),D.stop=D,D}function He(e,t=1/0,n){if(t<=0||!K(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ie(e))He(e.value,t,n);else if(A(e))for(let s=0;s<e.length;s++)He(e[s],t,n);else if(Ue(e)||Ge(e))e.forEach(s=>{He(s,t,n)});else if(gr(e)){for(const s in e)He(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&He(e[s],t,n)}return e}function Ht(e,t,n,s){try{return s?e(...s):e()}catch(r){jt(r,t,n)}}function ve(e,t,n,s){if(R(e)){const r=Ht(e,t,n,s);return r&&hr(r)&&r.catch(i=>{jt(i,t,n)}),r}if(A(e)){const r=[];for(let i=0;i<e.length;i++)r.push(ve(e[i],t,n,s));return r}}function jt(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||$;if(t){let l=t.parent;const c=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let p=0;p<u.length;p++)if(u[p](e,c,d)===!1)return}l=l.parent}if(i){Be(),Ht(i,null,10,[e,c,d]),We();return}}po(e,n,r,s,o)}function po(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}const ce=[];let Te=-1;const ut=[];let ke=null,ct=0;const Lr=Promise.resolve();let rn=null;function $r(e){const t=rn||Lr;return e?t.then(this?e.bind(this):e):t}function go(e){let t=Te+1,n=ce.length;for(;t<n;){const s=t+n>>>1,r=ce[s],i=Ft(r);i<e||i===e&&r.flags&2?t=s+1:n=s}return t}function ps(e){if(!(e.flags&1)){const t=Ft(e),n=ce[ce.length-1];!n||!(e.flags&2)&&t>=Ft(n)?ce.push(e):ce.splice(go(t),0,e),e.flags|=1,Hr()}}function Hr(){rn||(rn=Lr.then(Ur))}function mo(e){if(!A(e))ke&&e.id===-1?ke.splice(ct+1,0,e):e.flags&1||(ut.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)ut.push(e[t]);Hr()}function Ns(e,t,n=Te+1){for(;n<ce.length;n++){const s=ce[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;ce.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function jr(e){if(ut.length){const t=[...new Set(ut)].sort((n,s)=>Ft(n)-Ft(s));if(ut.length=0,ke){for(let n=0;n<t.length;n++)ke.push(t[n]);return}for(ke=t,ct=0;ct<ke.length;ct++){const n=ke[ct];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}ke=null,ct=0}}const Ft=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ur(e){try{for(Te=0;Te<ce.length;Te++){const t=ce[Te];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ht(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Te<ce.length;Te++){const t=ce[Te];t&&(t.flags&=-2)}Te=-1,ce.length=0,jr(),rn=null,(ce.length||ut.length)&&Ur()}}let ne=null,Kr=null;function on(e){const t=ne;return ne=e,Kr=e&&e.type.__scopeId||null,t}function _o(e,t=ne,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&un(-1);const i=on(t),o=je.length;let l;try{l=e(...r)}finally{for(let c=je.length;c>o;c--)Ss();on(i),s._d&&un(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function Tc(e,t){if(ne===null)return e;const n=An(ne),s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[i,o,l,c=$]=t[r];i&&(R(i)&&(i={mounted:i,updated:i}),i.deep&&He(o),s.push({dir:i,instance:n,value:o,oldValue:void 0,arg:l,modifiers:c}))}return e}function nt(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;o<r.length;o++){const l=r[o];i&&(l.oldValue=i[o].value);let c=l.dir[s];c&&(Be(),ve(c,n,8,[e.el,l,e,t]),We())}}function yo(e,t){if(te){let n=te.provides;const s=te.parent&&te.parent.provides;s===n&&(n=te.provides=Object.create(s)),n[e]=t}}function tn(e,t,n=!1){const s=_i();if(s||dt){let r=dt?dt._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&R(t)?t.call(s&&s.proxy):t}}const bo=Symbol.for("v-scx"),vo=()=>tn(bo);function xo(e,t){return gs(e,null,{flush:"sync"})}function Ln(e,t,n){return gs(e,t,n)}function gs(e,t,n=$){const{immediate:s,deep:r,flush:i,once:o}=n,l=X({},n),c=t&&s||!t&&i!=="post";let d;if(pt){if(i==="sync"){const C=vo();d=C.__watcherHandles||(C.__watcherHandles=[])}else if(!c){const C=()=>{};return C.stop=Re,C.resume=Re,C.pause=Re,C}}const u=te;l.call=(C,T,S)=>ve(C,u,T,S);let p=!1;i==="post"?l.scheduler=C=>{fe(C,u&&u.suspense)}:i!=="sync"&&(p=!0,l.scheduler=(C,T)=>{T?C():ps(C)}),l.augmentJob=C=>{t&&(C.flags|=4),p&&(C.flags|=2,u&&(C.id=u.uid,C.i=u))};const b=ho(e,t,l);return pt&&(d?d.push(b):c&&b()),b}function So(e,t,n){const s=this.proxy,r=J(e)?e.includes(".")?Br(s,e):()=>s[e]:e.bind(s,s);let i;R(t)?i=t:(i=t.handler,n=t);const o=Ut(this),l=gs(r,i.bind(s),n);return o(),l}function Br(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r<n.length&&s;r++)s=s[n[r]];return s}}const wo=Symbol("_vte"),Cn=e=>e.__isTeleport,$n=Symbol("_leaveCb");function Co(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ve){t=n;break}}return t}function Wr(e){if(!En(e))return Cn(e.type)&&e.children?Co(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&R(n.default))return n.default()}}function ms(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ms(Cn(n.type)&&Wr(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _s(e,t){return R(e)?X({name:e.name},t,{setup:e}):e}function ys(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ds(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ln=new WeakMap;function At(e,t,n,s,r=!1){if(A(e)){e.forEach((S,H)=>At(S,t&&(A(t)?t[H]:t),n,s,r));return}if(at(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&At(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?An(s.component):s.el,o=r?null:i,{i:l,r:c}=e,d=t&&t.r,u=l.refs===$?l.refs={}:l.refs,p=l.setupState,b=j(p),C=p===$?dr:S=>Ds(u,S)?!1:U(b,S),T=(S,H)=>!(H&&Ds(u,H));if(d!=null&&d!==c){if(Ls(t),J(d))u[d]=null,C(d)&&(p[d]=null);else if(ie(d)){const S=t;T(d,S.k)&&(d.value=null),S.k&&(u[S.k]=null)}}if(R(c))Ht(c,l,12,[o,u]);else{const S=J(c),H=ie(c);if(S||H){const D=()=>{if(e.f){const F=S?C(c)?p[c]:u[c]:T()||!e.k?c.value:u[e.k];if(r)A(F)&&ss(F,i);else if(A(F))F.includes(i)||F.push(i);else if(S)u[c]=[i],C(c)&&(p[c]=u[c]);else{const V=[i];T(c,e.k)&&(c.value=V),e.k&&(u[e.k]=V)}}else S?(u[c]=o,C(c)&&(p[c]=o)):H&&(T(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){const F=()=>{D(),ln.delete(e)};F.id=-1,ln.set(e,F),fe(F,n)}else Ls(e),D()}}}function Ls(e){const t=ln.get(e);t&&(t.flags|=8,ln.delete(e))}const $s=e=>e.nodeType===8;vn().requestIdleCallback;vn().cancelIdleCallback;function Eo(e,t){if($s(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if($s(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const at=e=>!!e.type.__asyncLoader;function Hs(e){R(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:r=200,hydrate:i,timeout:o,suspensible:l=!0,onError:c}=e;let d=null,u,p=0;const b=()=>(p++,d=null,C()),C=()=>{let T;return d||(T=d=t().catch(S=>{if(S=S instanceof Error?S:new Error(String(S)),c)return new Promise((H,D)=>{c(S,()=>H(b()),()=>D(S),p+1)});throw S}).then(S=>T!==d&&d?d:(S&&(S.__esModule||S[Symbol.toStringTag]==="Module")&&(S=S.default),u=S,S)))};return _s({name:"AsyncComponentWrapper",__asyncLoader:C,__asyncHydrate(T,S,H){const D=T.isConnected;let F=!1;(S.bu||(S.bu=[])).push(()=>F=!0);const V=()=>{F||!T.parentNode||D&&!T.isConnected||H()},M=i?()=>{const N=i(V,pe=>Eo(T,pe));N&&(S.bum||(S.bum=[])).push(N)}:V;u?M():C().then(()=>!S.isUnmounted&&M())},get __asyncResolved(){return u},setup(){const T=te;if(ys(T),u)return()=>Yt(u,T);const S=N=>{d=null,jt(N,T,13,!s)};if(l&&T.suspense||pt)return C().then(N=>()=>Yt(N,T)).catch(N=>(S(N),()=>s?Y(s,{error:N}):null));const H=ft(!1),D=ft(),F=ft(!!r);let V,M;return bs(()=>{V!=null&&clearTimeout(V),M!=null&&clearTimeout(M)}),r&&(M=setTimeout(()=>{T.isUnmounted||(F.value=!1)},r)),o!=null&&(V=setTimeout(()=>{if(!T.isUnmounted&&!H.value&&!D.value){const N=new Error(`Async component timed out after ${o}ms.`);S(N),D.value=N}},o)),C().then(()=>{T.isUnmounted||(H.value=!0,T.parent&&En(T.parent.vnode)&&T.parent.update())}).catch(N=>{if(T.isUnmounted){d=null;return}S(N),D.value=N}),()=>{if(H.value&&u)return Yt(u,T);if(D.value&&s)return Y(s,{error:D.value});if(n&&!F.value)return Yt(n,T)}}})}function Yt(e,t){const{ref:n,props:s,children:r,ce:i}=t.vnode,o=Y(e,s,r);return o.ref=n,o.ce=i,delete t.vnode.ce,o}const En=e=>e.type.__isKeepAlive;function To(e,t){zr(e,"a",t)}function Mo(e,t){zr(e,"da",t)}function zr(e,t,n=te){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Tn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)En(r.parent.vnode)&&Oo(s,t,n,r),r=r.parent}}function Oo(e,t,n,s){const r=Tn(t,e,s,!0);bs(()=>{ss(s[t],r)},n)}function Tn(e,t,n=te,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Be();const l=Ut(n),c=ve(t,n,e,o);return l(),We(),c});return s?r.unshift(i):r.push(i),i}}const ze=e=>(t,n=te)=>{(!pt||e==="sp")&&Tn(e,(...s)=>t(...s),n)},Ao=ze("bm"),qr=ze("m"),Po=ze("bu"),Io=ze("u"),kr=ze("bum"),bs=ze("um"),Ro=ze("sp"),Fo=ze("rtg"),Vo=ze("rtc");function No(e,t=te){Tn("ec",e,t)}const Do="components",Jr=Symbol.for("v-ndc");function Lo(e){return J(e)?$o(Do,e,!1)||e:e||Jr}function $o(e,t,n=!0,s=!1){const r=ne||te;if(r){const i=r.type;{const l=xl(i,!1);if(l&&(l===t||l===re(t)||l===yn(re(t))))return i}const o=js(r[e]||i[e],t)||js(r.appContext[e],t);return!o&&s?i:o}}function js(e,t){return e&&(e[t]||e[re(t)]||e[yn(re(t))])}function Gr(e,t,n,s){let r;const i=n,o=A(e);if(o||J(e)){const l=o&&Ye(e);let c=!1,d=!1;l&&(c=!ge(e),d=Fe(e),e=wn(e)),r=new Array(e.length);for(let u=0,p=e.length;u<p;u++)r[u]=t(c?d?Xe(me(e[u])):me(e[u]):e[u],u,void 0,i)}else if(typeof e=="number"){r=new Array(e);for(let l=0;l<e;l++)r[l]=t(l+1,l,void 0,i)}else if(K(e))if(e[Symbol.iterator])r=Array.from(e,(l,c)=>t(l,c,void 0,i));else{const l=Object.keys(e);r=new Array(l.length);for(let c=0,d=l.length;c<d;c++){const u=l[c];r[c]=t(e[u],u,c,i)}}else r=[];return r}function Mc(e,t,n,s,r,i){if(n==null&&(n={}),ne.ce||ne.parent&&at(ne.parent)&&ne.parent.ce){const d=n,u=Object.keys(d).length>0;return t!=="default"&&(d.name=t),ue(),an(ae,null,[Y("slot",d,s)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);const l=je.length;ue();let c;try{const d=o&&Yr(o(n)),u=n.key||i||d&&d.key;c=an(ae,{key:(u&&!be(u)?u:`_${t}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&e._===1?64:-2)}catch(d){for(let u=je.length;u>l;u--)Ss();throw d}finally{o&&o._c&&(o._d=!0)}return c}function Yr(e){return e.some(t=>Nt(t)?!(t.type===Ve||t.type===ae&&!Yr(t.children)):!0)?e:null}const Xn=e=>e?yi(e)?An(e):Xn(e.parent):null,Pt=X(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Xn(e.parent),$root:e=>Xn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Zr(e),$forceUpdate:e=>e.f||(e.f=()=>{ps(e.update)}),$nextTick:e=>e.n||(e.n=$r.bind(e.proxy)),$watch:e=>So.bind(e)}),Hn=(e,t)=>e!==$&&!e.__isScriptSetup&&U(e,t),Ho={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;if(t[0]!=="$"){const b=o[t];if(b!==void 0)switch(b){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(Hn(s,t))return o[t]=1,s[t];if(r!==$&&U(r,t))return o[t]=2,r[t];if(U(i,t))return o[t]=3,i[t];if(n!==$&&U(n,t))return o[t]=4,n[t];Zn&&(o[t]=0)}}const d=Pt[t];let u,p;if(d)return t==="$attrs"&&se(e.attrs,"get",""),d(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==$&&U(n,t))return o[t]=4,n[t];if(p=c.config.globalProperties,U(p,t))return p[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return Hn(r,t)?(r[t]=n,!0):s!==$&&U(s,t)?(s[t]=n,!0):U(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,props:i,type:o}},l){let c;return!!(n[l]||e!==$&&l[0]!=="$"&&U(e,l)||Hn(t,l)||U(i,l)||U(s,l)||U(Pt,l)||U(r.config.globalProperties,l)||(c=o.__cssModules)&&c[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:U(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function cn(e){return A(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Oc(e,t){return!e||!t?e||t:A(e)&&A(t)?e.concat(t):X({},cn(e),cn(t))}let Zn=!0;function jo(e){const t=Zr(e),n=e.proxy,s=e.ctx;Zn=!1,t.beforeCreate&&Us(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:d,created:u,beforeMount:p,mounted:b,beforeUpdate:C,updated:T,activated:S,deactivated:H,beforeDestroy:D,beforeUnmount:F,destroyed:V,unmounted:M,render:N,renderTracked:pe,renderTriggered:xe,errorCaptured:qe,serverPrefetch:Kt,expose:Qe,inheritAttrs:mt,components:Bt,directives:Wt,filters:Pn}=t;if(d&&Uo(d,s,null),o)for(const k in o){const z=o[k];R(z)&&(s[k]=z.bind(n))}if(r){const k=r.call(n,n);K(k)&&(e.data=as(k))}if(Zn=!0,i)for(const k in i){const z=i[k],et=R(z)?z.bind(n,n):R(z.get)?z.get.bind(n,n):Re,zt=!R(z)&&R(z.set)?z.set.bind(n):Re,tt=Ct({get:et,set:zt});Object.defineProperty(s,k,{enumerable:!0,configurable:!0,get:()=>tt.value,set:_e=>tt.value=_e})}if(l)for(const k in l)Xr(l[k],s,n,k);if(c){const k=R(c)?c.call(n):c;Reflect.ownKeys(k).forEach(z=>{yo(z,k[z])})}u&&Us(u,e,"c");function oe(k,z){A(z)?z.forEach(et=>k(et.bind(n))):z&&k(z.bind(n))}if(oe(Ao,p),oe(qr,b),oe(Po,C),oe(Io,T),oe(To,S),oe(Mo,H),oe(No,qe),oe(Vo,pe),oe(Fo,xe),oe(kr,F),oe(bs,M),oe(Ro,Kt),A(Qe))if(Qe.length){const k=e.exposed||(e.exposed={});Qe.forEach(z=>{Object.defineProperty(k,z,{get:()=>n[z],set:et=>n[z]=et,enumerable:!0})})}else e.exposed||(e.exposed={});N&&e.render===Re&&(e.render=N),mt!=null&&(e.inheritAttrs=mt),Bt&&(e.components=Bt),Wt&&(e.directives=Wt),Kt&&ys(e)}function Uo(e,t,n=Re){A(e)&&(e=Qn(e));for(const s in e){const r=e[s];let i;K(r)?"default"in r?i=tn(r.from||s,r.default,!0):i=tn(r.from||s):i=tn(r),ie(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function Us(e,t,n){ve(A(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Xr(e,t,n,s){let r=s.includes(".")?Br(n,s):()=>n[s];if(J(e)){const i=t[e];R(i)&&Ln(r,i)}else if(R(e))Ln(r,e.bind(n));else if(K(e))if(A(e))e.forEach(i=>Xr(i,t,n,s));else{const i=R(e.handler)?e.handler.bind(n):t[e.handler];R(i)&&Ln(r,i,e)}}function Zr(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(d=>fn(c,d,o,!0)),fn(c,t,o)),K(t)&&i.set(t,c),c}function fn(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&fn(e,i,n,!0),r&&r.forEach(o=>fn(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=Ko[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const Ko={data:Ks,props:Bs,emits:Bs,methods:wt,computed:wt,beforeCreate:le,created:le,beforeMount:le,mounted:le,beforeUpdate:le,updated:le,beforeDestroy:le,beforeUnmount:le,destroyed:le,unmounted:le,activated:le,deactivated:le,errorCaptured:le,serverPrefetch:le,components:wt,directives:wt,watch:Wo,provide:Ks,inject:Bo};function Ks(e,t){return t?e?function(){return X(R(e)?e.call(this,this):e,R(t)?t.call(this,this):t)}:t:e}function Bo(e,t){return wt(Qn(e),Qn(t))}function Qn(e){if(A(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function le(e,t){return e?[...new Set([].concat(e,t))]:t}function wt(e,t){return e?X(Object.create(null),e,t):t}function Bs(e,t){return e?A(e)&&A(t)?[...new Set([...e,...t])]:X(Object.create(null),cn(e),cn(t??{})):t}function Wo(e,t){if(!e)return t;if(!t)return e;const n=X(Object.create(null),e);for(const s in t)n[s]=le(e[s],t[s]);return n}function Qr(){return{app:null,config:{isNativeTag:dr,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let zo=0;function qo(e,t){return function(s,r=null){R(s)||(s=X({},s)),r!=null&&!K(r)&&(r=null);const i=Qr(),o=new WeakSet,l=[];let c=!1;const d=i.app={_uid:zo++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:wl,get config(){return i.config},set config(u){},use(u,...p){return o.has(u)||(u&&R(u.install)?(o.add(u),u.install(d,...p)):R(u)&&(o.add(u),u(d,...p))),d},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),d},component(u,p){return p?(i.components[u]=p,d):i.components[u]},directive(u,p){return p?(i.directives[u]=p,d):i.directives[u]},mount(u,p,b){if(!c){const C=d._ceVNode||Y(s,r);return C.appContext=i,b===!0?b="svg":b===!1&&(b=void 0),e(C,u,b),c=!0,d._container=u,u.__vue_app__=d,An(C.component)}},onUnmount(u){l.push(u)},unmount(){c&&(ve(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(u,p){return i.provides[u]=p,d},runWithContext(u){const p=dt;dt=d;try{return u()}finally{dt=p}}};return d}}let dt=null;function Ac(e,t,n=$){const s=_i(),r=re(t),i=Ze(t),o=ei(e,r),l=co((c,d)=>{let u,p=$,b;return xo(()=>{const C=e[r];ee(u,C)&&(u=C,d())}),{get(){return c(),n.get?n.get(u):u},set(C){const T=n.set?n.set(C):C;if(!ee(T,u)&&!(p!==$&&ee(C,p)))return;const S=s.vnode.props,H=!!(S&&(t in S||r in S||i in S)&&(`onUpdate:${t}`in S||`onUpdate:${r}`in S||`onUpdate:${i}`in S));H||(u=C,d()),s.emit(`update:${t}`,T),ee(C,p)&&(ee(C,T)&&!ee(T,b)||H&&p!==$&&!ee(T,u))&&d(),p=C,b=T}}});return l[Symbol.iterator]=()=>{let c=0;return{next(){return c<2?{value:c++?o||$:l,done:!1}:{done:!0}}}},l}const ei=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${re(t)}Modifiers`]||e[`${Ze(t)}Modifiers`];function ko(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||$;let r=n;const i=t.startsWith("update:"),o=i&&ei(s,t.slice(7));o&&(o.trim&&(r=n.map(u=>J(u)?u.trim():u)),o.number&&(r=r.map(bn)));let l,c=s[l=Rn(t)]||s[l=Rn(re(t))];!c&&i&&(c=s[l=Rn(Ze(t))]),c&&ve(c,e,6,r);const d=s[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ve(d,e,6,r)}}const Jo=new WeakMap;function ti(e,t,n=!1){const s=n?Jo:t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!R(e)){const c=d=>{const u=ti(d,t,!0);u&&(l=!0,X(o,u))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(K(e)&&s.set(e,null),null):(A(i)?i.forEach(c=>o[c]=null):X(o,i),K(e)&&s.set(e,o),o)}function Mn(e,t){return!e||!gn(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),U(e,t[0].toLowerCase()+t.slice(1))||U(e,Ze(t))||U(e,t))}function Ws(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:c,render:d,renderCache:u,props:p,data:b,setupState:C,ctx:T,inheritAttrs:S}=e,H=on(e);let D,F;try{if(n.shapeFlag&4){const M=r||s,N=M;D=Pe(d.call(N,M,u,p,C,b,T)),F=l}else{const M=t;D=Pe(M.length>1?M(p,{attrs:l,slots:o,emit:c}):M(p,null)),F=t.props?l:Go(l)}}catch(M){je.length=0,jt(M,e,1),D=Y(Ve)}let V=D;if(F&&S!==!1){const M=Object.keys(F),{shapeFlag:N}=V;M.length&&N&7&&(i&&M.some(mn)&&(F=Yo(F,i)),V=ht(V,F,!1,!0))}if(n.dirs&&(V=ht(V,null,!1,!0),V.dirs=V.dirs?V.dirs.concat(n.dirs):n.dirs),n.transition){const M=Cn(V.type)&&Wr(V)||V;ms(M,n.transition)}return D=V,on(H),D}const Go=e=>{let t;for(const n in e)(n==="class"||n==="style"||gn(n))&&((t||(t={}))[n]=e[n]);return t},Yo=(e,t)=>{const n={};for(const s in e)(!mn(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Xo(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,d=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?zs(s,o,d):!!o;if(c&8){const u=t.dynamicProps;for(let p=0;p<u.length;p++){const b=u[p];if(ni(o,s,b)&&!Mn(d,b))return!0}}}else return(r||l)&&(!l||!l.$stable)?!0:s===o?!1:s?o?zs(s,o,d):!0:!!o;return!1}function zs(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const i=s[r];if(ni(t,e,i)&&!Mn(n,i))return!0}return!1}function ni(e,t,n){const s=e[n],r=t[n];return n==="style"&&K(s)&&K(r)?!Ke(s,r):s!==r}function Zo({vnode:e,parent:t,suspense:n},s){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.suspense.vnode.el=r.el=s,e=r),r===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const si={},ri=()=>Object.create(si),ii=e=>Object.getPrototypeOf(e)===si;function Qo(e,t,n,s=!1){const r={},i=ri();e.propsDefaults=Object.create(null),oi(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:so(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function el(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=j(r),[c]=e.propsOptions;let d=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let p=0;p<u.length;p++){let b=u[p];if(Mn(e.emitsOptions,b))continue;const C=t[b];if(c)if(U(i,b))C!==i[b]&&(i[b]=C,d=!0);else{const T=re(b);r[T]=es(c,l,T,C,e,!1)}else C!==i[b]&&(i[b]=C,d=!0)}}}else{oi(e,t,r,i)&&(d=!0);let u;for(const p in l)(!t||!U(t,p)&&((u=Ze(p))===p||!U(t,u)))&&(c?n&&(n[p]!==void 0||n[u]!==void 0)&&(r[p]=es(c,l,p,void 0,e,!0)):delete r[p]);if(i!==l)for(const p in i)(!t||!U(t,p))&&(delete i[p],d=!0)}d&&$e(e.attrs,"set","")}function oi(e,t,n,s){const[r,i]=e.propsOptions;let o=!1,l;if(t)for(let c in t){if(Tt(c))continue;const d=t[c];let u;r&&U(r,u=re(c))?!i||!i.includes(u)?n[u]=d:(l||(l={}))[u]=d:Mn(e.emitsOptions,c)||(!(c in s)||d!==s[c])&&(s[c]=d,o=!0)}if(i){const c=j(n),d=l||$;for(let u=0;u<i.length;u++){const p=i[u];n[p]=es(r,c,p,d[p],e,!U(d,p))}}return o}function es(e,t,n,s,r,i){const o=e[n];if(o!=null){const l=U(o,"default");if(l&&s===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&R(c)){const{propsDefaults:d}=r;if(n in d)s=d[n];else{const u=Ut(r);s=d[n]=c.call(null,t),u()}}else s=c;r.ce&&r.ce._setProp(n,s)}o[0]&&(i&&!l?s=!1:o[1]&&(s===""||s===Ze(n))&&(s=!0))}return s}const tl=new WeakMap;function li(e,t,n=!1){const s=n?tl:t.propsCache,r=s.get(e);if(r)return r;const i=e.props,o={},l=[];let c=!1;if(!R(e)){const u=p=>{c=!0;const[b,C]=li(p,t,!0);X(o,b),C&&l.push(...C)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!c)return K(e)&&s.set(e,it),it;if(A(i))for(let u=0;u<i.length;u++){const p=re(i[u]);qs(p)&&(o[p]=$)}else if(i)for(const u in i){const p=re(u);if(qs(p)){const b=i[u],C=o[p]=A(b)||R(b)?{type:b}:X({},b),T=C.type;let S=!1,H=!0;if(A(T))for(let D=0;D<T.length;++D){const F=T[D],V=R(F)&&F.name;if(V==="Boolean"){S=!0;break}else V==="String"&&(H=!1)}else S=R(T)&&T.name==="Boolean";C[0]=S,C[1]=H,(S||U(C,"default"))&&l.push(p)}}const d=[o,l];return K(e)&&s.set(e,d),d}function qs(e){return e[0]!=="$"&&!Tt(e)}const vs=e=>e==="_"||e==="_ctx"||e==="$stable",xs=e=>A(e)?e.map(Pe):[Pe(e)],nl=(e,t,n)=>{if(t._n)return t;const s=_o((...r)=>xs(t(...r)),n);return s._c=!1,s},ci=(e,t,n)=>{const s=e._ctx;for(const r in e){if(vs(r))continue;const i=e[r];if(R(i))t[r]=nl(r,i,s);else if(i!=null){const o=xs(i);t[r]=()=>o}}},fi=(e,t)=>{const n=xs(t);e.slots.default=()=>n},ui=(e,t,n)=>{for(const s in t)(n||!vs(s))&&(e[s]=t[s])},sl=(e,t,n)=>{const s=e.slots=ri();if(e.vnode.shapeFlag&32){const r=t._;r?(ui(s,t,n),n&&mr(s,"_",r,!0)):ci(t,s)}else t&&fi(e,t)},rl=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=$;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:ui(r,t,n):(i=!t.$stable,ci(t,r)),o=t}else t&&(fi(e,t),o={default:1});if(i)for(const l in r)!vs(l)&&o[l]==null&&delete r[l]},fe=fl;function il(e){return ol(e)}function ol(e,t){const n=vn();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:d,setElementText:u,parentNode:p,nextSibling:b,setScopeId:C=Re,insertStaticContent:T}=e,S=(f,a,h,y=null,g=null,_=null,w=void 0,x=null,v=!!a.dynamicChildren)=>{if(f===a)return;f&&!xt(f,a)&&(y=qt(f),_e(f,g,_,!0),f=null),a.patchFlag===-2&&(v=!1,a.dynamicChildren=null),a.dynamicChildren&&f&&f.dynamicChildren&&f.dynamicChildren.hasOnce&&(a.dynamicChildren===it&&(a.dynamicChildren=[]),a.dynamicChildren.hasOnce=!0);const{type:m,ref:P,shapeFlag:E}=a;switch(m){case On:H(f,a,h,y);break;case Ve:D(f,a,h,y);break;case Un:f==null&&F(a,h,y,w);break;case ae:Bt(f,a,h,y,g,_,w,x,v);break;default:E&1?N(f,a,h,y,g,_,w,x,v):E&6?Wt(f,a,h,y,g,_,w,x,v):(E&64||E&128)&&m.process(f,a,h,y,g,_,w,x,v,yt)}P!=null&&g?At(P,f&&f.ref,_,a||f,!a):P==null&&f&&f.ref!=null&&At(f.ref,null,_,f,!0)},H=(f,a,h,y)=>{if(f==null)s(a.el=l(a.children),h,y);else{const g=a.el=f.el;a.children!==f.children&&d(g,a.children)}},D=(f,a,h,y)=>{f==null?s(a.el=c(a.children||""),h,y):a.el=f.el},F=(f,a,h,y)=>{[f.el,f.anchor]=T(f.children,a,h,y,f.el,f.anchor)},V=({el:f,anchor:a},h,y)=>{let g;for(;f&&f!==a;)g=b(f),s(f,h,y),f=g;s(a,h,y)},M=({el:f,anchor:a})=>{let h;for(;f&&f!==a;)h=b(f),r(f),f=h;r(a)},N=(f,a,h,y,g,_,w,x,v)=>{if(a.type==="svg"?w="svg":a.type==="math"&&(w="mathml"),f==null)pe(a,h,y,g,_,w,x,v);else{const m=f.el&&f.el._isVueCE?f.el:null;try{m&&m._beginPatch(),Kt(f,a,g,_,w,x,v)}finally{m&&m._endPatch()}}},pe=(f,a,h,y,g,_,w,x)=>{let v,m;const{props:P,shapeFlag:E,transition:O,dirs:I}=f;if(v=f.el=o(f.type,_,P&&P.is,P),E&8?u(v,f.children):E&16&&qe(f.children,v,null,y,g,jn(f,_),w,x),I&&nt(f,null,y,"created"),xe(v,f,f.scopeId,w,y),P){for(const W in P)W!=="value"&&!Tt(W)&&i(v,W,null,P[W],_,y);"value"in P&&i(v,"value",null,P.value,_),(m=P.onVnodeBeforeMount)&&Ee(m,y,f)}I&&nt(f,null,y,"beforeMount");const L=ll(g,O);L&&O.beforeEnter(v),s(v,a,h),((m=P&&P.onVnodeMounted)||L||I)&&fe(()=>{m&&Ee(m,y,f),L&&O.enter(v),I&&nt(f,null,y,"mounted")},g)},xe=(f,a,h,y,g)=>{if(h&&C(f,h),y)for(let _=0;_<y.length;_++)C(f,y[_]);if(g){let _=g.subTree;if(a===_||pi(_.type)&&(_.ssContent===a||_.ssFallback===a)){const w=g.vnode;xe(f,w,w.scopeId,w.slotScopeIds,g.parent)}}},qe=(f,a,h,y,g,_,w,x,v=0)=>{for(let m=v;m<f.length;m++){const P=f[m]=x?Le(f[m]):Pe(f[m]);S(null,P,a,h,y,g,_,w,x)}},Kt=(f,a,h,y,g,_,w)=>{const x=a.el=f.el;let{patchFlag:v,dynamicChildren:m,dirs:P}=a;v|=f.patchFlag&16;const E=f.props||$,O=a.props||$;let I;if(h&&st(h,!1),(I=O.onVnodeBeforeUpdate)&&Ee(I,h,a,f),P&&nt(a,f,h,"beforeUpdate"),h&&st(h,!0),m&&(!f.dynamicChildren||f.dynamicChildren.length!==m.length)&&(v=0,w=!1,m=null),(E.innerHTML&&O.innerHTML==null||E.textContent&&O.textContent==null)&&u(x,""),m?Qe(f.dynamicChildren,m,x,h,y,jn(a,g),_):w||z(f,a,x,null,h,y,jn(a,g),_,!1),v>0){if(v&16)mt(x,E,O,h,g);else if(v&2&&E.class!==O.class&&i(x,"class",null,O.class,g),v&4&&i(x,"style",E.style,O.style,g),v&8){const L=a.dynamicProps;for(let W=0;W<L.length;W++){const B=L[W],G=E[B],Z=O[B];(Z!==G||B==="value")&&i(x,B,G,Z,g,h)}}v&1&&f.children!==a.children&&u(x,a.children)}else!w&&m==null&&mt(x,E,O,h,g);((I=O.onVnodeUpdated)||P)&&fe(()=>{I&&Ee(I,h,a,f),P&&nt(a,f,h,"updated")},y)},Qe=(f,a,h,y,g,_,w)=>{for(let x=0;x<a.length;x++){const v=f[x],m=a[x],P=v.el&&(v.type===ae||!xt(v,m)||v.shapeFlag&198)?p(v.el):h;S(v,m,P,null,y,g,_,w,!0)}},mt=(f,a,h,y,g)=>{if(a!==h){if(a!==$)for(const _ in a)!Tt(_)&&!(_ in h)&&i(f,_,a[_],null,g,y);for(const _ in h){if(Tt(_))continue;const w=h[_],x=a[_];w!==x&&_!=="value"&&i(f,_,x,w,g,y)}"value"in h&&i(f,"value",a.value,h.value,g)}},Bt=(f,a,h,y,g,_,w,x,v)=>{const m=a.el=f?f.el:l(""),P=a.anchor=f?f.anchor:l("");let{patchFlag:E,dynamicChildren:O,slotScopeIds:I}=a;I&&(x=x?x.concat(I):I),f==null?(s(m,h,y),s(P,h,y),qe(a.children||[],h,P,g,_,w,x,v)):E>0&&E&64&&O&&f.dynamicChildren&&f.dynamicChildren.length===O.length?(Qe(f.dynamicChildren,O,h,g,_,w,x),(a.key!=null||g&&a===g.subTree)&&ai(f,a,!0)):z(f,a,h,P,g,_,w,x,v)},Wt=(f,a,h,y,g,_,w,x,v)=>{a.slotScopeIds=x,f==null?a.shapeFlag&512?g.ctx.activate(a,h,y,w,v):Pn(a,h,y,g,_,w,v):ws(f,a,v)},Pn=(f,a,h,y,g,_,w)=>{const x=f.component=ml(f,y,g);if(En(f)&&(x.ctx.renderer=yt),_l(x,!1,w),x.asyncDep){if(g&&g.registerDep(x,oe,w),!f.el){const v=x.subTree=Y(Ve);D(null,v,a,h),f.placeholder=v.el}}else oe(x,f,a,h,g,_,w)},ws=(f,a,h)=>{const y=a.component=f.component;if(Xo(f,a,h))if(y.asyncDep&&!y.asyncResolved){a.el=f.el,k(y,a,h);return}else y.next=a,y.update();else a.el=f.el,y.vnode=a},oe=(f,a,h,y,g,_,w)=>{const x=()=>{if(f.isMounted){let{next:E,bu:O,u:I,parent:L,vnode:W}=f;{const we=di(f);if(we){E&&(E.el=W.el,k(f,E,w)),we.asyncDep.then(()=>{fe(()=>{f.isUnmounted||m()},g)});return}}let B=E,G;st(f,!1),E?(E.el=W.el,k(f,E,w)):E=W,O&&Qt(O),(G=E.props&&E.props.onVnodeBeforeUpdate)&&Ee(G,L,E,W),st(f,!0);const Z=Ws(f),Se=f.subTree;f.subTree=Z,S(Se,Z,p(Se.el),qt(Se),f,g,_),E.el=Z.el,B===null&&Zo(f,Z.el),I&&fe(I,g),(G=E.props&&E.props.onVnodeUpdated)&&fe(()=>Ee(G,L,E,W),g)}else{let E;const{el:O,props:I}=a,{bm:L,m:W,parent:B,root:G,type:Z}=f,Se=at(a);st(f,!1),L&&Qt(L),!Se&&(E=I&&I.onVnodeBeforeMount)&&Ee(E,B,a),st(f,!0);{G.ce&&G.ce._hasShadowRoot()&&G.ce._injectChildStyle(Z,f.parent?f.parent.type:void 0);const we=f.subTree=Ws(f);S(null,we,h,y,f,g,_),a.el=we.el}if(W&&fe(W,g),!Se&&(E=I&&I.onVnodeMounted)){const we=a;fe(()=>Ee(E,B,we),g)}(a.shapeFlag&256||B&&at(B.vnode)&&B.vnode.shapeFlag&256)&&f.a&&fe(f.a,g),f.isMounted=!0,a=h=y=null}};f.scope.on();const v=f.effect=new vr(x);f.scope.off();const m=f.update=v.run.bind(v),P=f.job=v.runIfDirty.bind(v);P.i=f,P.id=f.uid,v.scheduler=()=>ps(P),st(f,!0),m()},k=(f,a,h)=>{a.component=f;const y=f.vnode.props;f.vnode=a,f.next=null,el(f,a.props,y,h),rl(f,a.children,h),Be(),Ns(f),We()},z=(f,a,h,y,g,_,w,x,v=!1)=>{const m=f&&f.children,P=f?f.shapeFlag:0,E=a.children,{patchFlag:O,shapeFlag:I}=a;if(O>0){if(O&128){zt(m,E,h,y,g,_,w,x,v);return}else if(O&256){et(m,E,h,y,g,_,w,x,v);return}}I&8?(P&16&&_t(m,g,_),E!==m&&u(h,E)):P&16?I&16?zt(m,E,h,y,g,_,w,x,v):_t(m,g,_,!0):(P&8&&u(h,""),I&16&&qe(E,h,y,g,_,w,x,v))},et=(f,a,h,y,g,_,w,x,v)=>{f=f||it,a=a||it;const m=f.length,P=a.length,E=Math.min(m,P);let O;for(O=0;O<E;O++){const I=a[O]=v?Le(a[O]):Pe(a[O]);S(f[O],I,h,null,g,_,w,x,v)}m>P?_t(f,g,_,!0,!1,E):qe(a,h,y,g,_,w,x,v,E)},zt=(f,a,h,y,g,_,w,x,v)=>{let m=0;const P=a.length;let E=f.length-1,O=P-1;for(;m<=E&&m<=O;){const I=f[m],L=a[m]=v?Le(a[m]):Pe(a[m]);if(xt(I,L))S(I,L,h,null,g,_,w,x,v);else break;m++}for(;m<=E&&m<=O;){const I=f[E],L=a[O]=v?Le(a[O]):Pe(a[O]);if(xt(I,L))S(I,L,h,null,g,_,w,x,v);else break;E--,O--}if(m>E){if(m<=O){const I=O+1,L=I<P?a[I].el:y;for(;m<=O;)S(null,a[m]=v?Le(a[m]):Pe(a[m]),h,L,g,_,w,x,v),m++}}else if(m>O)for(;m<=E;)_e(f[m],g,_,!0),m++;else{const I=m,L=m,W=new Map;for(m=L;m<=O;m++){const de=a[m]=v?Le(a[m]):Pe(a[m]);de.key!=null&&W.set(de.key,m)}let B,G=0;const Z=O-L+1;let Se=!1,we=0;const bt=new Array(Z);for(m=0;m<Z;m++)bt[m]=0;for(m=I;m<=E;m++){const de=f[m];if(G>=Z){_e(de,g,_,!0);continue}let Ce;if(de.key!=null)Ce=W.get(de.key);else for(B=L;B<=O;B++)if(bt[B-L]===0&&xt(de,a[B])){Ce=B;break}Ce===void 0?_e(de,g,_,!0):(bt[Ce-L]=m+1,Ce>=we?we=Ce:Se=!0,S(de,a[Ce],h,null,g,_,w,x,v),G++)}const Ts=Se?cl(bt):it;for(B=Ts.length-1,m=Z-1;m>=0;m--){const de=L+m,Ce=a[de],Ms=a[de+1],Os=de+1<P?Ms.el||hi(Ms):y;bt[m]===0?S(null,Ce,h,Os,g,_,w,x,v):Se&&(B<0||m!==Ts[B]?tt(Ce,h,Os,2):B--)}}},tt=(f,a,h,y,g=null)=>{const{el:_,type:w,transition:x,children:v,shapeFlag:m}=f;if(m&6){tt(f.component.subTree,a,h,y);return}if(m&128){f.suspense.move(a,h,y);return}if(m&64){w.move(f,a,h,yt);return}if(w===ae){s(_,a,h);for(let E=0;E<v.length;E++)tt(v[E],a,h,y);s(f.anchor,a,h);return}if(w===Un){V(f,a,h);return}if(y!==2&&m&1&&x)if(y===0)x.persisted&&!_[$n]?s(_,a,h):(x.beforeEnter(_),s(_,a,h),fe(()=>x.enter(_),g));else{const{leave:E,delayLeave:O,afterLeave:I}=x,L=()=>{f.ctx.isUnmounted?r(_):s(_,a,h)},W=()=>{const B=_._isLeaving||!!_[$n];_._isLeaving&&_[$n](!0),x.persisted&&!B?L():E(_,()=>{L(),I&&I()})};O?O(_,L,W):W()}else s(_,a,h)},_e=(f,a,h,y=!1,g=!1)=>{const{type:_,props:w,ref:x,children:v,dynamicChildren:m,shapeFlag:P,patchFlag:E,dirs:O,cacheIndex:I,memo:L}=f;if((E===-2||m&&m.hasOnce)&&(g=!1),x!=null&&(Be(),At(x,null,h,f,!0),We()),I!=null&&(!f.ctx||f.ctx===a)&&(a.renderCache[I]=void 0),P&256){a.ctx.deactivate(f);return}const W=P&1&&O,B=!at(f);let G;if(B&&(G=w&&w.onVnodeBeforeUnmount)&&Ee(G,a,f),P&6)Ei(f.component,h,y);else{if(P&128){f.suspense.unmount(h,y);return}W&&nt(f,null,a,"beforeUnmount"),P&64?f.type.remove(f,a,h,yt,y):m&&!m.hasOnce&&(_!==ae||E>0&&E&64)?_t(m,a,h,!1,!0):(_===ae&&E&384||!g&&P&16)&&_t(v,a,h),y&&Cs(f)}const Z=L!=null&&I==null;(B&&(G=w&&w.onVnodeUnmounted)||W||Z)&&fe(()=>{G&&Ee(G,a,f),W&&nt(f,null,a,"unmounted"),Z&&(f.el=null)},h)},Cs=f=>{const{type:a,el:h,anchor:y,transition:g}=f;if(a===ae){Ci(h,y);return}if(a===Un){M(f),g&&!g.persisted&&g.afterLeave&&g.afterLeave();return}const _=()=>{r(h),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(f.shapeFlag&1&&g&&!g.persisted){const{leave:w,delayLeave:x}=g,v=()=>w(h,_);x?x(f.el,_,v):v()}else _()},Ci=(f,a)=>{let h;for(;f!==a;)h=b(f),r(f),f=h;r(a)},Ei=(f,a,h)=>{const{bum:y,scope:g,job:_,subTree:w,um:x,m:v,a:m}=f;ks(v),ks(m),y&&Qt(y),g.stop(),_?(_.flags|=8,_e(w,f,a,h)):f.vnode.el&&w&&(w.transition=f.vnode.transition,_e(w,f,a,h)),x&&fe(x,a),fe(()=>{f.isUnmounted=!0},a)},_t=(f,a,h,y=!1,g=!1,_=0)=>{for(let w=_;w<f.length;w++)_e(f[w],a,h,y,g)},qt=f=>{if(f.shapeFlag&6)return qt(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const a=b(f.anchor||f.el),h=a&&a[wo];return h?b(h):a};let In=!1;const Es=(f,a,h)=>{let y;f==null?a._vnode&&(_e(a._vnode,null,null,!0),y=a._vnode.component):S(a._vnode||null,f,a,null,null,null,h),a._vnode=f,In||(In=!0,Ns(y),jr(),In=!1)},yt={p:S,um:_e,m:tt,r:Cs,mt:Pn,mc:qe,pc:z,pbc:Qe,n:qt,o:e};return{render:Es,hydrate:void 0,createApp:qo(Es)}}function jn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function st({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ll(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ai(e,t,n=!1){const s=e.children,r=t.children;if(A(s)&&A(r))for(let i=0;i<s.length;i++){const o=s[i];let l=r[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=r[i]=Le(r[i]),l.el=o.el),!n&&l.patchFlag!==-2&&ai(o,l)),l.type===On&&(l.patchFlag===-1&&(l=r[i]=Le(l)),l.el=o.el),l.type===Ve&&!l.el&&(l.el=o.el)}}function cl(e){const t=e.slice(),n=[0];let s,r,i,o,l;const c=e.length;for(s=0;s<c;s++){const d=e[s];if(d!==0){if(r=n[n.length-1],e[r]<d){t[s]=r,n.push(s);continue}for(i=0,o=n.length-1;i<o;)l=i+o>>1,e[n[l]]<d?i=l+1:o=l;d<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function di(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:di(t)}function ks(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function hi(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?hi(t.subTree):null}const pi=e=>e.__isSuspense;function fl(e,t){t&&t.pendingBranch?A(e)?t.effects.push(...e):t.effects.push(e):mo(e)}const ae=Symbol.for("v-fgt"),On=Symbol.for("v-txt"),Ve=Symbol.for("v-cmt"),Un=Symbol.for("v-stc"),je=[];let he=null;function ue(e=!1){je.push(he=e?null:[])}function Ss(){je.pop(),he=je[je.length-1]||null}let Vt=1;function un(e,t=!1){Vt+=e,e<0&&he&&t&&(he.hasOnce=!0)}function gi(e){return e.dynamicChildren=Vt>0?he||it:null,Ss(),Vt>0&&he&&he.push(e),e}function Oe(e,t,n,s,r,i){return gi(Me(e,t,n,s,r,i,!0))}function an(e,t,n,s,r){return gi(Y(e,t,n,s,r,!0))}function Nt(e){return e?e.__v_isVNode===!0:!1}function xt(e,t){return e.type===t.type&&e.key===t.key}const mi=({key:e})=>e??null,nn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?J(e)||ie(e)||R(e)?{i:ne,r:e,k:t,f:!!n}:e:null);function Me(e,t=null,n=null,s=0,r=null,i=e===ae?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mi(t),ref:t&&nn(t),scopeId:Kr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ne};return l?(dn(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=J(n)?8:16),Vt>0&&!o&&he&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&he.push(c),c}const Y=ul;function ul(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Jr)&&(e=Ve),Nt(e)){const l=ht(e,t,!0);return n&&dn(l,n),Vt>0&&!i&&he&&(l.shapeFlag&6?he[he.indexOf(e)]=l:he.push(l)),l.patchFlag=-2,l}if(Sl(e)&&(e=e.__vccOpts),t){t=al(t);let{class:l,style:c}=t;l&&!J(l)&&(t.class=xn(l)),K(c)&&(hs(c)&&!A(c)&&(c=X({},c)),t.style=is(c))}const o=J(e)?1:pi(e)?128:Cn(e)?64:K(e)?4:R(e)?2:0;return Me(e,t,n,s,r,o,i,!0)}function al(e){return e?hs(e)||ii(e)?X({},e):e:null}function ht(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:c}=e,d=t?hl(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&mi(d),ref:t&&t.ref?n&&i?A(i)?i.concat(nn(t)):[i,nn(t)]:nn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ae?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ht(e.ssContent),ssFallback:e.ssFallback&&ht(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&s&&ms(u,c.clone(u)),u}function dl(e=" ",t=0){return Y(On,null,e,t)}function Kn(e="",t=!1){return t?(ue(),an(Ve,null,e)):Y(Ve,null,e)}function Pe(e){return e==null||typeof e=="boolean"?Y(Ve):A(e)?Y(ae,null,e.slice()):Nt(e)?Le(e):Y(On,null,String(e))}function Le(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ht(e)}function dn(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(A(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),dn(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!ii(t)?t._ctx=ne:r===3&&ne&&(ne.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(R(t)){if(s&65){dn(e,{default:t});return}t={default:t,_ctx:ne},n=32}else t=String(t),s&64?(n=16,t=[dl(t)]):n=8;e.children=t,e.shapeFlag|=n}function hl(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=xn([t.class,s.class]));else if(r==="style")t.style=is([t.style,s.style]);else if(gn(r)){const i=t[r],o=s[r];o&&i!==o&&!(A(i)&&i.includes(o))?t[r]=i?[].concat(i,o):o:o==null&&i==null&&!mn(r)&&(t[r]=o)}else r!==""&&(t[r]=s[r])}return t}function Ee(e,t,n,s=null){ve(e,t,7,[n,s])}const pl=Qr();let gl=0;function ml(e,t,n){const s=e.type,r=(t?t.appContext:e.appContext)||pl,i={uid:gl++,vnode:e,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new $i(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:li(s,r),emitsOptions:ti(s,r),emit:null,emitted:null,propsDefaults:$,inheritAttrs:s.inheritAttrs,ctx:$,data:$,props:$,attrs:$,slots:$,refs:$,setupState:$,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=ko.bind(null,i),e.ce&&e.ce(i),i}let te=null;const _i=()=>te||ne;let hn,Dt;{const e=vn(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};hn=t("__VUE_INSTANCE_SETTERS__",n=>te=n),Dt=t("__VUE_SSR_SETTERS__",n=>pt=n)}const Ut=e=>{const t=te;return hn(e),e.scope.on(),()=>{e.scope.off(),hn(t)}},Js=()=>{te&&te.scope.off(),hn(null)};function yi(e){return e.vnode.shapeFlag&4}let pt=!1;function _l(e,t=!1,n=!1){t&&Dt(t);const{props:s,children:r}=e.vnode,i=yi(e);Qo(e,s,i,t),sl(e,r,n||t);const o=i?yl(e,t):void 0;return t&&Dt(!1),o}function yl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ho);const{setup:s}=n;if(s){Be();const r=e.setupContext=s.length>1?vl(e):null,i=Ut(e),o=Ht(s,e,0,[e.props,r]),l=hr(o);if(We(),i(),(l||e.sp)&&!at(e)&&ys(e),l){if(o.then(Js,Js),t)return o.then(c=>{Dt(!0);try{Gs(e,c,t)}finally{Dt(!1)}}).catch(c=>{jt(c,e,0)});e.asyncDep=o}else Gs(e,o)}else bi(e)}function Gs(e,t,n){R(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:K(t)&&(e.setupState=Dr(t)),bi(e)}function bi(e,t,n){const s=e.type;e.render||(e.render=s.render||Re);{const r=Ut(e);Be();try{jo(e)}finally{We(),r()}}}const bl={get(e,t){return se(e,"get",""),e[t]}};function vl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,bl),slots:e.slots,emit:e.emit,expose:t}}function An(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Dr(ro(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Pt)return Pt[n](e)},has(t,n){return n in t||n in Pt}})):e.proxy}function xl(e,t=!0){return R(e)?e.displayName||e.name:e.name||t&&e.__name}function Sl(e){return R(e)&&"__vccOpts"in e}const Ct=(e,t)=>uo(e,t,pt);function Pc(e,t,n){try{un(-1);const s=arguments.length;return s===2?K(t)&&!A(t)?Nt(t)?Y(e,null,[t]):Y(e,t):Y(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Nt(n)&&(n=[n]),Y(e,t,n))}finally{un(1)}}const wl="3.5.43";let ts;const Ys=typeof window<"u"&&window.trustedTypes;if(Ys)try{ts=Ys.createPolicy("vue",{createHTML:e=>e})}catch{}const vi=ts?e=>ts.createHTML(e):e=>e,Cl="http://www.w3.org/2000/svg",El="http://www.w3.org/1998/Math/MathML",De=typeof document<"u"?document:null,Xs=De&&De.createElement("template"),Tl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?De.createElementNS(Cl,e):t==="mathml"?De.createElementNS(El,e):n?De.createElement(e,{is:n}):De.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>De.createTextNode(e),createComment:e=>De.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>De.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{Xs.innerHTML=vi(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Xs.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ml=Symbol("_vtc");function Ol(e,t,n){const s=e[Ml];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const pn=Symbol("_vod"),xi=Symbol("_vsh"),Ic={name:"show",beforeMount(e,{value:t},{transition:n}){e[pn]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):St(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),St(e,!0),s.enter(e)):s.leave(e,()=>{St(e,!1)}):St(e,t))},beforeUnmount(e,{value:t}){St(e,t)}};function St(e,t){e.style.display=t?e[pn]:"none",e[xi]=!t}const Al=Symbol(""),Pl=/(?:^|;)\s*display\s*:/;function Il(e,t,n){const s=e.style,r=J(n);let i=!1;if(n&&!r){if(t)if(J(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&Et(s,l,"")}else for(const o in t)n[o]==null&&Et(s,o,"");for(const o in n){o==="display"&&(i=!0);const l=n[o];l!=null?Fl(e,o,!J(t)&&t?t[o]:void 0,l)||Et(s,o,l):Et(s,o,"")}}else if(r){if(t!==n){const o=s[Al];o&&(n+=";"+o),s.cssText=n,i=Pl.test(n)}}else t&&e.removeAttribute("style");pn in e&&(e[pn]=i?s.display:"",e[xi]&&(s.display="none"))}const Xt=/\s*!important$/;function Et(e,t,n){if(A(n))n.forEach(s=>Et(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))Xt.test(n)?e.setProperty(t,n.replace(Xt,""),"important"):e.setProperty(t,n);else{const s=Rl(e,t);Xt.test(n)?e.setProperty(Ze(s),n.replace(Xt,""),"important"):e[s]=n}}const Zs=["Webkit","Moz","ms"],Bn={};function Rl(e,t){const n=Bn[t];if(n)return n;let s=re(t);if(s!=="filter"&&s in e)return Bn[t]=s;s=yn(s);for(let r=0;r<Zs.length;r++){const i=Zs[r]+s;if(i in e)return Bn[t]=i}return t}function Fl(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&J(s)&&n===s}const Qs="http://www.w3.org/1999/xlink";function er(e,t,n,s,r,i=Ni(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Qs,t.slice(6,t.length)):e.setAttributeNS(Qs,t,n):n==null||i&&!_r(n)?e.removeAttribute(t):e.setAttribute(t,i?"":be(n)?String(n):n)}function tr(e,t,n,s,r){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?vi(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(l!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=_r(n):n==null&&l==="string"?(n="",o=!0):l==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(r||t)}function Je(e,t,n,s){e.addEventListener(t,n,s)}function Vl(e,t,n,s){e.removeEventListener(t,n,s)}const nr=Symbol("_vei");function Nl(e,t,n,s,r=null){const i=e[nr]||(e[nr]={}),o=i[t];if(s&&o)o.value=s;else{const[l,c]=$l(t);if(s){const d=i[t]=Ul(s,r);Je(e,l,d,c)}else o&&(Vl(e,l,o,c),i[t]=void 0)}}const Dl=/(Once|Passive|Capture)$/,Ll=/^on:?(?:Once|Passive|Capture)$/;function $l(e){let t,n;for(;(n=e.match(Dl))&&!Ll.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Ze(e.slice(2)),t]}let Wn=0;const Hl=Promise.resolve(),jl=()=>Wn||(Hl.then(()=>Wn=0),Wn=Date.now());function Ul(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const r=n.value;if(A(r)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const o=r.slice(),l=[s];for(let c=0;c<o.length&&!s._stopped;c++){const d=o[c];d&&ve(d,t,5,l)}}else ve(r,t,5,[s])};return n.value=e,n.attached=jl(),n}const sr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Kl=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?Ol(e,s,o):t==="style"?Il(e,n,s):gn(t)?mn(t)||Nl(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Bl(e,t,s,o))?(tr(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&er(e,t,s,o,i,t!=="value")):e._isVueCE&&(Wl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!J(s)))?tr(e,re(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),er(e,t,s,o))};function Bl(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&sr(t)&&R(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return sr(t)&&J(n)?!1:t in e}function Wl(e,t){const n=e._def.props;if(!n)return!1;const s=re(t);return Array.isArray(n)?n.some(r=>re(r)===s):Object.keys(n).some(r=>re(r)===s)}const gt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return A(t)?n=>Qt(t,n):t};function zl(e){e.target.composing=!0}function rr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ie=Symbol("_assign"),Zt=Symbol("_initialValue");function zn(e,t,n){return t&&(e=e.trim()),n&&(e=bn(e)),e}const Rc={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e.parentNode&&(e.type==="text"?e[Zt]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Zt]=e.defaultValue.replace(/\r\n?/g,`
3
- `))),e[Ie]=gt(r);const i=s||r.props&&r.props.type==="number";Je(e,t?"change":"input",o=>{o.target.composing||e[Ie](zn(e.value,n,i))}),(n||i)&&Je(e,"change",()=>{e.value=zn(e.value,n,i)}),t||(Je(e,"compositionstart",zl),Je(e,"compositionend",rr),Je(e,"change",rr))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const r=t??"",i=e[Zt];delete e[Zt],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[Ie](zn(e.value,n,s)):e.value=r},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[Ie]=gt(o),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?bn(e.value):e.value,c=t??"";if(l===c)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===c)||(e.value=c)}},Fc={deep:!0,created(e,t,n){e[Ie]=gt(n),Je(e,"change",()=>{const s=e._modelValue,r=Lt(e),i=e.checked,o=e[Ie];if(A(s)){const l=os(s,r),c=l!==-1;if(i&&!c)o(s.concat(r));else if(!i&&c){const d=[...s];d.splice(l,1),o(d)}}else if(Ue(s)){const l=new Set(s);i?l.add(r):l.delete(r),o(l)}else o(Si(e,i))})},mounted:ir,beforeUpdate(e,t,n){e[Ie]=gt(n),ir(e,t,n)}};function ir(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(A(t))r=os(t,s.props.value)>-1;else if(Ue(t))r=t.has(s.props.value);else{if(t===n)return;r=Ke(t,Si(e,!0))}e.checked!==r&&(e.checked=r)}const Vc={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Je(e,"change",()=>{const r=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>n?bn(Lt(c)):Lt(c)),i=e.multiple,o=i?Ue(e._modelValue)?new Set(r):r:r[0],l=e._pendingValue=[i,i?A(o)?r.slice():r:o];try{e[Ie](o)}finally{$r(()=>{e._pendingValue===l&&(e._pendingValue=void 0)})}}),e[Ie]=gt(s)},mounted(e,{value:t}){or(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ie]=gt(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!ql(t,n[1],n[0]))&&or(e,t)}};function ql(e,t,n){if(!n||A(e))return Ke(e,t);if(Ue(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function or(e,t){const n=e.multiple,s=A(t);if(!(n&&!s&&!Ue(t))){for(let r=0,i=e.options.length;r<i;r++){const o=e.options[r],l=Lt(o);if(n)if(s){const c=typeof l;c==="string"||c==="number"?o.selected=t.some(d=>String(d)===String(l)):o.selected=os(t,l)>-1}else o.selected=t.has(l);else if(Ke(Lt(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Lt(e){return"_value"in e?e._value:e.value}function Si(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const kl=["ctrl","shift","alt","meta"],Jl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>kl.some(n=>e[`${n}Key`]&&!t.includes(n))},Nc=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((r,...i)=>{for(let o=0;o<t.length;o++){const l=Jl[t[o]];if(l&&l(r,t))return}return e(r,...i)}))},Gl=X({patchProp:Kl},Tl);let lr;function Yl(){return lr||(lr=il(Gl))}const Xl=((...e)=>{const t=Yl().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Ql(s);if(!r)return;const i=t._component;!R(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,Zl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function Zl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ql(e){return J(e)?document.querySelector(e):e}class ec extends Error{status;body;constructor(t,n,s={}){super(n),this.status=t,this.body=s}}async function cr(e,t,n){const s=await fetch(t,{method:e,headers:n===void 0?{}:{"Content-Type":"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}}),r=await s.text();let i={};try{i=r===""?{}:JSON.parse(r)}catch{i={error:r}}if(!s.ok){const o=typeof i.error=="string"?i.error:`The request failed (${s.status})`;throw new ec(s.status,o,i)}return i}const tc={get:e=>cr("GET",e),post:(e,t)=>cr("POST",e,t)};function Dc(e,t){return`/api/fs/image?path=${encodeURIComponent(e)}&size=${t}`}function Lc(e,t){const n=new EventSource(`/api/jobs/${encodeURIComponent(e)}/events`);let s=!1;const r=()=>{s=!0,n.close()};return n.addEventListener("progress",i=>{t.onProgress?.(JSON.parse(i.data))}),n.addEventListener("done",i=>{r(),t.onDone(JSON.parse(i.data))}),n.addEventListener("failed",i=>{r(),t.onFailed(JSON.parse(i.data).message)}),n.onerror=()=>{s||(r(),t.onFailed("The connection to mediatoolz ui was lost."))},r}function $c(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const nc=["width","height"],sc=["d"],fr=_s({__name:"Icon",props:{name:{},size:{}},setup(e){const t=e,n={image:["M4 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z","M8.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","m20 15-4.5-4.5L6 20"],layers:["m12 3 9 5-9 5-9-5z","m3 13 9 5 9-5","m3 17.5 9 5 9-5"],folder:["M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"],up:["m12 19V5","m5 12 7-7 7 7"],trash:["M4 7h16","M9 7V4h6v3","M6 7l1 13h10l1-13","M10 11v6","M14 11v6"],search:["M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14z","m20 20-4-4"],down:["m12 5v14","m5 12 7 7 7-7"],left:["m15 5-7 7 7 7"],right:["m9 5 7 7-7 7"],plus:["M12 5v14","M5 12h14"],close:["M6 6l12 12","M18 6 6 18"],copy:["M9 9h10v10H9z","M5 15V5h10"],save:["M5 4h11l3 3v13H5z","M8 4v5h7V4","M8 20v-6h8v6"],download:["M12 4v11","m7 11 5 5 5-5","M5 20h14"],play:["m7 4 13 8-13 8z"],check:["m5 12 5 5 9-10"],home:["m3 11 9-8 9 8","M5 10v10h14V10"],external:["M14 4h6v6","M20 4 11 13","M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"]};return(s,r)=>(ue(),Oe("svg",{width:t.size??18,height:t.size??18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[(ue(!0),Oe(ae,null,Gr(n[t.name]??[],i=>(ue(),Oe("path",{key:i,d:i},null,8,sc))),128))],8,nc))}}),rc="modulepreload",ic=function(e){return"/"+e},ur={},ar=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let c=function(d){return Promise.all(d.map(u=>Promise.resolve(u).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");r=c(n.map(d=>{if(d=ic(d),d in ur)return;ur[d]=!0;const u=d.endsWith(".css"),p=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const b=document.createElement("link");if(b.rel=u?"stylesheet":rc,u||(b.as="script"),b.crossOrigin="",b.href=d,l&&b.setAttribute("nonce",l),document.head.appendChild(b),u)return new Promise((C,T)=>{b.addEventListener("load",C),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},wi={"image-hash":{icon:"image",component:Hs(()=>ar(()=>import("./ImageHashPage-DjIlDPu-.js"),__vite__mapDeps([0,1,2,3])))},"image-batch":{icon:"layers",component:Hs(()=>ar(()=>import("./ImageBatchPage-D3f4z6YA.js"),__vite__mapDeps([4,1,2,5])))}},oc={};function lc(e){return wi[e]?.icon??oc[e]??"layers"}const cc={class:"shell"},fc={class:"sidebar"},uc={class:"brand"},ac={class:"brand__mark"},dc={class:"menu","aria-label":"Modules"},hc=["disabled","aria-current","onClick"],pc={class:"menu__title"},gc={key:0,class:"menu__badge"},mc={class:"sidebar__foot"},_c={key:0},yc={class:"main"},bc={key:0,class:"notice notice--error page-pad"},vc={key:2,class:"muted page-pad"},xc=_s({__name:"App",setup(e){const t=ft(),n=ft(""),s=ft(window.location.hash),r=Ct(()=>t.value?.modules??[]),i=Ct(()=>{const u=s.value.replace(/^#\/?/,""),p=r.value.find(b=>b.id===u);return p?p.id:r.value.find(b=>b.status==="available")?.id??""}),o=Ct(()=>r.value.find(u=>u.id===i.value)),l=Ct(()=>wi[i.value]);function c(){s.value=window.location.hash}function d(u){u.status==="available"&&(window.location.hash=`#/${u.id}`)}return qr(async()=>{window.addEventListener("hashchange",c);try{t.value=await tc.get("/api/status")}catch(u){n.value=u instanceof Error?u.message:String(u)}}),kr(()=>window.removeEventListener("hashchange",c)),(u,p)=>(ue(),Oe("div",cc,[Me("aside",fc,[Me("div",uc,[Me("span",ac,[Y(fr,{name:"layers",size:16})]),p[0]||(p[0]=Me("span",{class:"brand__name"},"mediatoolz",-1))]),Me("nav",dc,[(ue(!0),Oe(ae,null,Gr(r.value,b=>(ue(),Oe("button",{key:b.id,class:xn(["menu__item",{"menu__item--active":b.id===i.value,"menu__item--planned":b.status!=="available"}]),disabled:b.status!=="available","aria-current":b.id===i.value?"page":void 0,onClick:C=>d(b)},[Y(fr,{name:Nr(lc)(b.id)},null,8,["name"]),Me("span",pc,en(b.title),1),b.status!=="available"?(ue(),Oe("span",gc,"soon")):Kn("",!0)],10,hc))),128))]),Me("div",mc,[t.value?(ue(),Oe("span",_c,"v"+en(t.value.version),1)):Kn("",!0)])]),Me("main",yc,[n.value?(ue(),Oe("div",bc,en(n.value),1)):o.value&&l.value?(ue(),an(Lo(l.value.component),{key:o.value.id,module:o.value,status:t.value},null,8,["module","status"])):t.value?(ue(),Oe("div",vc,"Pick a module on the left.")):Kn("",!0)])]))}}),Sc=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},wc=Sc(xc,[["__scopeId","data-v-cf6dcf06"]]);Xl(wc).mount("#app");export{Vc as A,Lc as B,ec as C,Ac as D,Oc as E,ae as F,$c as G,Nc as H,Fc as I,Ic as J,tn as K,yo as L,Mc as M,$r as N,Sc as _,kr as a,ue as b,Ct as c,_s as d,Oe as e,Me as f,Gr as g,Pc as h,Dc as i,Y as j,Kn as k,dl as l,fr as m,is as n,qr as o,an as p,_o as q,ft as r,Ec as s,en as t,Nr as u,tc as v,Ln as w,xn as x,Tc as y,Rc as z};
3
+ `))),e[Ie]=gt(r);const i=s||r.props&&r.props.type==="number";Je(e,t?"change":"input",o=>{o.target.composing||e[Ie](zn(e.value,n,i))}),(n||i)&&Je(e,"change",()=>{e.value=zn(e.value,n,i)}),t||(Je(e,"compositionstart",zl),Je(e,"compositionend",rr),Je(e,"change",rr))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const r=t??"",i=e[Zt];delete e[Zt],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[Ie](zn(e.value,n,s)):e.value=r},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[Ie]=gt(o),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?bn(e.value):e.value,c=t??"";if(l===c)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===c)||(e.value=c)}},Fc={deep:!0,created(e,t,n){e[Ie]=gt(n),Je(e,"change",()=>{const s=e._modelValue,r=Lt(e),i=e.checked,o=e[Ie];if(A(s)){const l=os(s,r),c=l!==-1;if(i&&!c)o(s.concat(r));else if(!i&&c){const d=[...s];d.splice(l,1),o(d)}}else if(Ue(s)){const l=new Set(s);i?l.add(r):l.delete(r),o(l)}else o(Si(e,i))})},mounted:ir,beforeUpdate(e,t,n){e[Ie]=gt(n),ir(e,t,n)}};function ir(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(A(t))r=os(t,s.props.value)>-1;else if(Ue(t))r=t.has(s.props.value);else{if(t===n)return;r=Ke(t,Si(e,!0))}e.checked!==r&&(e.checked=r)}const Vc={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Je(e,"change",()=>{const r=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>n?bn(Lt(c)):Lt(c)),i=e.multiple,o=i?Ue(e._modelValue)?new Set(r):r:r[0],l=e._pendingValue=[i,i?A(o)?r.slice():r:o];try{e[Ie](o)}finally{$r(()=>{e._pendingValue===l&&(e._pendingValue=void 0)})}}),e[Ie]=gt(s)},mounted(e,{value:t}){or(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ie]=gt(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!ql(t,n[1],n[0]))&&or(e,t)}};function ql(e,t,n){if(!n||A(e))return Ke(e,t);if(Ue(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function or(e,t){const n=e.multiple,s=A(t);if(!(n&&!s&&!Ue(t))){for(let r=0,i=e.options.length;r<i;r++){const o=e.options[r],l=Lt(o);if(n)if(s){const c=typeof l;c==="string"||c==="number"?o.selected=t.some(d=>String(d)===String(l)):o.selected=os(t,l)>-1}else o.selected=t.has(l);else if(Ke(Lt(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Lt(e){return"_value"in e?e._value:e.value}function Si(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const kl=["ctrl","shift","alt","meta"],Jl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>kl.some(n=>e[`${n}Key`]&&!t.includes(n))},Nc=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((r,...i)=>{for(let o=0;o<t.length;o++){const l=Jl[t[o]];if(l&&l(r,t))return}return e(r,...i)}))},Gl=X({patchProp:Kl},Tl);let lr;function Yl(){return lr||(lr=il(Gl))}const Xl=((...e)=>{const t=Yl().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Ql(s);if(!r)return;const i=t._component;!R(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,Zl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function Zl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ql(e){return J(e)?document.querySelector(e):e}class ec extends Error{status;body;constructor(t,n,s={}){super(n),this.status=t,this.body=s}}async function cr(e,t,n){const s=await fetch(t,{method:e,headers:n===void 0?{}:{"Content-Type":"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}}),r=await s.text();let i={};try{i=r===""?{}:JSON.parse(r)}catch{i={error:r}}if(!s.ok){const o=typeof i.error=="string"?i.error:`The request failed (${s.status})`;throw new ec(s.status,o,i)}return i}const tc={get:e=>cr("GET",e),post:(e,t)=>cr("POST",e,t)};function Dc(e,t){return`/api/fs/image?path=${encodeURIComponent(e)}&size=${t}`}function Lc(e,t){const n=new EventSource(`/api/jobs/${encodeURIComponent(e)}/events`);let s=!1;const r=()=>{s=!0,n.close()};return n.addEventListener("progress",i=>{t.onProgress?.(JSON.parse(i.data))}),n.addEventListener("done",i=>{r(),t.onDone(JSON.parse(i.data))}),n.addEventListener("failed",i=>{r(),t.onFailed(JSON.parse(i.data).message)}),n.onerror=()=>{s||(r(),t.onFailed("The connection to mediatoolz ui was lost."))},r}function $c(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const nc=["width","height"],sc=["d"],fr=_s({__name:"Icon",props:{name:{},size:{}},setup(e){const t=e,n={image:["M4 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z","M8.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","m20 15-4.5-4.5L6 20"],layers:["m12 3 9 5-9 5-9-5z","m3 13 9 5 9-5","m3 17.5 9 5 9-5"],folder:["M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"],up:["m12 19V5","m5 12 7-7 7 7"],trash:["M4 7h16","M9 7V4h6v3","M6 7l1 13h10l1-13","M10 11v6","M14 11v6"],search:["M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14z","m20 20-4-4"],down:["m12 5v14","m5 12 7 7 7-7"],left:["m15 5-7 7 7 7"],right:["m9 5 7 7-7 7"],plus:["M12 5v14","M5 12h14"],close:["M6 6l12 12","M18 6 6 18"],copy:["M9 9h10v10H9z","M5 15V5h10"],save:["M5 4h11l3 3v13H5z","M8 4v5h7V4","M8 20v-6h8v6"],download:["M12 4v11","m7 11 5 5 5-5","M5 20h14"],play:["m7 4 13 8-13 8z"],check:["m5 12 5 5 9-10"],home:["m3 11 9-8 9 8","M5 10v10h14V10"],external:["M14 4h6v6","M20 4 11 13","M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"]};return(s,r)=>(ue(),Oe("svg",{width:t.size??18,height:t.size??18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[(ue(!0),Oe(ae,null,Gr(n[t.name]??[],i=>(ue(),Oe("path",{key:i,d:i},null,8,sc))),128))],8,nc))}}),rc="modulepreload",ic=function(e){return"/"+e},ur={},ar=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let c=function(d){return Promise.all(d.map(u=>Promise.resolve(u).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");r=c(n.map(d=>{if(d=ic(d),d in ur)return;ur[d]=!0;const u=d.endsWith(".css"),p=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const b=document.createElement("link");if(b.rel=u?"stylesheet":rc,u||(b.as="script"),b.crossOrigin="",b.href=d,l&&b.setAttribute("nonce",l),document.head.appendChild(b),u)return new Promise((C,T)=>{b.addEventListener("load",C),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},wi={"image-hash":{icon:"image",component:Hs(()=>ar(()=>import("./ImageHashPage-DpyJdByU.js"),__vite__mapDeps([0,1,2,3])))},"image-batch":{icon:"layers",component:Hs(()=>ar(()=>import("./ImageBatchPage-DVaFnQY8.js"),__vite__mapDeps([4,1,2,5])))}},oc={};function lc(e){return wi[e]?.icon??oc[e]??"layers"}const cc={class:"shell"},fc={class:"sidebar"},uc={class:"brand"},ac={class:"brand__mark"},dc={class:"menu","aria-label":"Modules"},hc=["disabled","aria-current","onClick"],pc={class:"menu__title"},gc={key:0,class:"menu__badge"},mc={class:"sidebar__foot"},_c={key:0},yc={class:"main"},bc={key:0,class:"notice notice--error page-pad"},vc={key:2,class:"muted page-pad"},xc=_s({__name:"App",setup(e){const t=ft(),n=ft(""),s=ft(window.location.hash),r=Ct(()=>t.value?.modules??[]),i=Ct(()=>{const u=s.value.replace(/^#\/?/,""),p=r.value.find(b=>b.id===u);return p?p.id:r.value.find(b=>b.status==="available")?.id??""}),o=Ct(()=>r.value.find(u=>u.id===i.value)),l=Ct(()=>wi[i.value]);function c(){s.value=window.location.hash}function d(u){u.status==="available"&&(window.location.hash=`#/${u.id}`)}return qr(async()=>{window.addEventListener("hashchange",c);try{t.value=await tc.get("/api/status")}catch(u){n.value=u instanceof Error?u.message:String(u)}}),kr(()=>window.removeEventListener("hashchange",c)),(u,p)=>(ue(),Oe("div",cc,[Me("aside",fc,[Me("div",uc,[Me("span",ac,[Y(fr,{name:"layers",size:16})]),p[0]||(p[0]=Me("span",{class:"brand__name"},"mediatoolz",-1))]),Me("nav",dc,[(ue(!0),Oe(ae,null,Gr(r.value,b=>(ue(),Oe("button",{key:b.id,class:xn(["menu__item",{"menu__item--active":b.id===i.value,"menu__item--planned":b.status!=="available"}]),disabled:b.status!=="available","aria-current":b.id===i.value?"page":void 0,onClick:C=>d(b)},[Y(fr,{name:Nr(lc)(b.id)},null,8,["name"]),Me("span",pc,en(b.title),1),b.status!=="available"?(ue(),Oe("span",gc,"soon")):Kn("",!0)],10,hc))),128))]),Me("div",mc,[t.value?(ue(),Oe("span",_c,"v"+en(t.value.version),1)):Kn("",!0)])]),Me("main",yc,[n.value?(ue(),Oe("div",bc,en(n.value),1)):o.value&&l.value?(ue(),an(Lo(l.value.component),{key:o.value.id,module:o.value,status:t.value},null,8,["module","status"])):t.value?(ue(),Oe("div",vc,"Pick a module on the left.")):Kn("",!0)])]))}}),Sc=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},wc=Sc(xc,[["__scopeId","data-v-cf6dcf06"]]);Xl(wc).mount("#app");export{Vc as A,Lc as B,ec as C,Ac as D,Oc as E,ae as F,$c as G,Nc as H,Fc as I,Ic as J,tn as K,yo as L,Mc as M,$r as N,Sc as _,kr as a,ue as b,Ct as c,_s as d,Oe as e,Me as f,Gr as g,Pc as h,Dc as i,Y as j,Kn as k,dl as l,fr as m,is as n,qr as o,an as p,_o as q,ft as r,Ec as s,en as t,Nr as u,tc as v,Ln as w,xn as x,Tc as y,Rc as z};
@@ -8,7 +8,7 @@
8
8
  rel="icon"
9
9
  href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%23496cff'/%3E%3Cpath d='M9 11l-4 5 4 5M23 11l4 5-4 5M18 8l-4 16' stroke='white' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"
10
10
  />
11
- <script type="module" crossorigin src="/assets/index-yiehSw5D.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-Dzvs2f2Q.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-D1s-23_t.css">
13
13
  </head>
14
14
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@macrulez/mediatoolz",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A small toolbox of CLI commands for images — resize, convert and recompress them in bulk by rules, and generate hazehash, blurhash and thumbhash placeholders",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -59,6 +59,7 @@
59
59
  "commander": "^13.1.0",
60
60
  "hazehash": "^0.1.1",
61
61
  "ignore": "^6.0.2",
62
+ "sharp": "^0.35.5",
62
63
  "thumbhash": "^0.1.1"
63
64
  },
64
65
  "devDependencies": {
@@ -71,7 +72,6 @@
71
72
  "globals": "^17.13.0",
72
73
  "prettier": "^3.9.8",
73
74
  "sass": "^1.105.1",
74
- "sharp": "^0.35.5",
75
75
  "shiki": "^4.5.0",
76
76
  "tsx": "^4.19.2",
77
77
  "typescript": "^5.7.3",