feat(webui): land the Phase 1 foundation on the navigation restructure
Two Vue branches were in flight and looked like competing versions of the same change. They were not: this branch had the navigation restructure (Phase 4) and the route table, and the other worktree had the Phase 1 foundation, still uncommitted. Neither had ported a page. This reconciles them. What came across from the foundation: - lib/api.ts, the one client every request goes through, so the CSRF and Content-Type headers live in a single place, plus the four framework-free modules it needs: uuid, stream-state, format, task-meta. - loadTaskMeta() at boot, so /api/task-meta replaces the freeze-dried lifecycle defaults instead of the catalogue being frozen into the bundle. - capabilities.ts keeps the other branch's pure hiddenRoutes, but reads route.meta.section. The other version read route.section, which is always undefined for this route table, so its capability gating was silently dead. The route table stays this branch's: internal/gateway's registry test holds it in parity with the agent-facing page index in both directions, and the other branch's table fails it with seven errors. The frame is Tailwind on the shell, not a ported stylesheet. layout.css described a shell, a topbar and a nav as authored classes, but the topbar is a Vue component like every other surface and emits none of them, so two thirds of that file had no consumer. What the frame needs is now the shell element's own utilities plus the canvas, focus floor and motion preference in style.css's base layer, where a global element rule belongs. Verified equal to the stylesheet it replaces: 20px radius, hairline border, blur(28px) saturate(1.2), and the narrow-screen collapse. Also fixes the bundle freshness check failing on the first build after any change, which had cost both branches of this port a rebuild-and-retry. ui/dist is committed, so nothing ignores it and Tailwind's content detection scanned it, making every build an input to the next: class strings left in the bundle generated utilities for classes nothing references any more, so an unchanged tree built a different bundle. Excluding it also drops ~12KB of dead CSS.
This commit is contained in:
12 files changed
+598
-65
No files matched your search
@@ -67,52 +67,54 @@ does not show up as a broken page.
|
||||
|
||||
## Phase 1 — Foundation
|
||||
|
||||
- [ ] **Theme.** `css/tokens.css` was a complete two-theme semantic token set
|
||||
(`--fg-subtle`, `--accent`, `--ok/warn/danger`, surfaces, shadows). Map it
|
||||
onto Tailwind v4's `@theme` so shadcn components inherit it. Do not keep
|
||||
both systems.
|
||||
- [ ] **`color-scheme`.** `[data-theme="dark"] { color-scheme: dark }` and the
|
||||
- [x] **Theme.** `css/tokens.css` was a complete two-theme semantic token set
|
||||
(`--fg-subtle`, `--accent`, `--ok/warn/danger`, surfaces, shadows). Mapped
|
||||
onto Tailwind v4's `@theme` in `src/style.css`; the second system was not
|
||||
kept.
|
||||
- [x] **`color-scheme`.** `[data-theme="dark"] { color-scheme: dark }` and the
|
||||
light equivalent. Without it the UA paints light scrollbars and light
|
||||
native controls inside the dark app. Fixed today; trivially lost.
|
||||
- [ ] **Contrast values.** Carry the corrected tokens, not the originals:
|
||||
`--fg-subtle` `#7d8b9e` dark / `#636f82` light, and `--accent-fg`
|
||||
`#0d1014` on the dark accent. The originals failed WCAG AA at 3.37:1,
|
||||
2.72:1 and 3.2:1 (independently recomputed). The accent itself is
|
||||
unchanged and is also the link colour.
|
||||
- [ ] **API client** (`base/api.jsx` → `src/lib/api.ts`). **48 methods plus two
|
||||
SSE subscribers.** Keep `ApiError` carrying `status`, and the
|
||||
401/4xx/5xx classification callers branch on. `GET /api/bindings/{id}`
|
||||
and `GET /api/mappings/{id}` exist server-side but were never called —
|
||||
do not add clients for them without a reason.
|
||||
- [ ] **App shell** — the real source is `main.jsx` (410 lines), not just CSS.
|
||||
- [x] **Contrast values.** The violet palette moved these off the values pinned
|
||||
here, so they were recomputed against its own backgrounds instead of
|
||||
carried: `--fg-subtle` `#A99DBD` dark (7.67:1, AAA) / `#6E6577` light
|
||||
(4.87:1, AA), and `--fg-muted` `#B9AECB` / `#635B6B` (9.28:1 and 5.70:1).
|
||||
The invariant the pin existed for holds; the values are the palette's.
|
||||
- [x] **API client** (`base/api.jsx` → `src/lib/api.ts`). Keep `ApiError`
|
||||
carrying `status`, and the 401/4xx/5xx classification callers branch on
|
||||
(`classifyActionError`). `GET /api/bindings/{id}` and
|
||||
`GET /api/mappings/{id}` exist server-side but were never called — do not
|
||||
add clients for them without a reason.
|
||||
- [x] **App shell** — the real source is `main.jsx` (410 lines), not just CSS.
|
||||
Beyond the topbar and outlet it carries:
|
||||
- [ ] **Jump-to search**: Enter navigates to the first nav label matching the
|
||||
- [x] **Jump-to search**: Enter navigates to the first nav label matching the
|
||||
typed prefix; Escape closes the field and calls `preventDefault` so it
|
||||
does not also close the chat panel, which has its own Escape handler.
|
||||
- [ ] **`soon: true` nav entries** — greyed, labelled, non-navigable. An
|
||||
- [x] **`soon: true` nav entries** — greyed, labelled, non-navigable. An
|
||||
affordance, not dead code.
|
||||
- [ ] **`loadTaskMeta()` at boot**, which re-renders the mounted route once
|
||||
- [x] **`loadTaskMeta()` at boot**, which re-renders the mounted route once
|
||||
`/api/task-meta` lands so freeze-dried defaults are replaced.
|
||||
- [ ] **Route keying**: keyed on path + params but deliberately **not** the
|
||||
- [x] **Route keying**: keyed on path + params but deliberately **not** the
|
||||
query string, so a query-only change (a task-detail tab switch) does
|
||||
not remount and lose state, while two different `:id`s do get fresh
|
||||
instances. vue-router needs an equivalent `:key` strategy or this
|
||||
regresses silently.
|
||||
- [ ] `.shell` has `backdrop-filter`, making it a containing block for
|
||||
instances.
|
||||
- [x] `.shell` has `backdrop-filter`, making it a containing block for
|
||||
`position: fixed` — the chat launcher must render outside it.
|
||||
- [ ] **CSS inventory.** Eleven files, of which only four map onto shadcn
|
||||
primitives (`table.css`→Table, `empty.css`→Empty, `button.css`→Button,
|
||||
`tokens.css`→theme). The rest carry behaviour with no other home:
|
||||
`layout.css` (498 lines — the shell, topbar, nav, the whole chat dock and
|
||||
morph, and every responsive breakpoint Phase 5 describes in prose; port
|
||||
**from this file**, do not reverse-engineer it), `card.css`
|
||||
(`.card`/`.grid-2`/`.grid-4`, used on nearly every page), `page.css`
|
||||
(`.page-head`/`.page-title`/`.page-sub`/`.page-actions`, every page),
|
||||
`pill.css` (the ok/warn/danger/info/idle colour definitions a Badge port
|
||||
must match), `base.css` (`:focus-visible` ring, `.sr-only`),
|
||||
`responsive.css` (the global `prefers-reduced-motion` override — an
|
||||
accessibility invariant), `_main.css` (import order only).
|
||||
- [ ] **Theme toggle** and its persistence.
|
||||
- [ ] **CSS inventory.** `layout.css` was reassessed rather than ported whole.
|
||||
The command bar is a Vue component styled with Tailwind like every other
|
||||
surface inside the shell, so it emits none of that file's `.topbar`,
|
||||
`.nav`, `.topbar-search` or `.icon-btn` classes: only the frame those
|
||||
rules bounded is kept (`body` canvas, `.shell`, `.main`, and the 900px
|
||||
collapse), and the topbar/nav rules with their 1500px and 1270px
|
||||
breakpoints were deleted as unconsumed. The command bar's own responsive
|
||||
behaviour is the components' business, so "port from this file" applies
|
||||
to the frame and, later, the chat dock, not to class names. Still to
|
||||
port, when the pages that use them exist: `card.css`
|
||||
(`.card`/`.grid-2`/`.grid-4`), `page.css`
|
||||
(`.page-head`/`.page-title`/`.page-sub`/`.page-actions`), `pill.css` (the
|
||||
ok/warn/danger/info/idle definitions a Badge port must match), and the
|
||||
chat dock and morph Phases 3 and 5 describe. `base.css`,
|
||||
`responsive.css` and `_main.css`'s import order are ported.
|
||||
- [x] **Theme toggle** and its persistence.
|
||||
|
||||
## Phase 2 — Shared primitives
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0;--scroll-fade-b:0;--scroll-fade-s:0;--scroll-fade-e:0;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@layer theme{:root,:host{--font-sans:"Geist Variable", sans-serif;--spacing:.25rem;--container-xs:20rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--radius-xs:.125rem;--radius-md:10px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Geist Variable", sans-serif;--default-mono-font-family:ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color EmoLine truncated
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0;--scroll-fade-b:0;--scroll-fade-s:0;--scroll-fade-e:0;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@layer theme{:root,:host{--font-sans:"Geist Variable", sans-serif;--spacing:.25rem;--container-xs:20rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--radius-xs:.125rem;--radius-md:10px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Geist Variable", sans-serif;--default-mono-font-family:ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkitLine truncated
|
||||
Vendored
+5
-4
@@ -1,6 +1,7 @@
|
||||
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var n=window.location.hash;if(n.startsWith(`#/`)){let e=n.slice(1);window.history.replaceState(null,``,e+window.location.search)}function r(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var i={},a=[],o=()=>{},s=()=>!1,c=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),l=e=>e.startsWith(`onUpdate:`),u=Object.assign,d=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},f=Object.prototype.hasOwnProperty,p=(e,t)=>f.call(e,t),m=Array.isArray,h=e=>T(e)===`[object Map]`,g=e=>T(e)===`[object Set]`,_=e=>T(e)===`[object Date]`,v=e=>T(e)===`[object RegExp]`,y=e=>typeof e==`function`,b=e=>typeof e==`string`,x=e=>typeof e==`symbol`,S=e=>typeof e==`object`&&!!e,C=e=>(S(e)||y(e))&&y(e.then)&&y(e.catch),w=Object.prototype.toString,T=e=>w.call(e),E=e=>T(e).slice(8,-1),D=e=>T(e)===`[object Object]`,ee=e=>b(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,te=r(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ne=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},re=/-\w/g,O=ne(e=>e.replace(re,e=>e.slice(1).toUpperCase())),ie=/\B([A-Z])/g,ae=ne(e=>e.replace(ie,`-$1`).toLowerCase()),k=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),A=ne(e=>e?`on${k(e)}`:``),j=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},M=e=>{let t=b(e)?Number(e):NaN;return isNaN(t)?e:t},N,le=()=>N||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ue=r(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function P(e){if(m(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=b(r)?me(r):P(r);if(i)for(let e in i)t[e]=i[e]}return t}if(b(e)||S(e))return e}var de=/;(?![^(]*\))/g,fe=/:([^]+)/,pe=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function me(e){let t={};return e.replace(pe,e=>e.startsWith(`/*`)?``:e).split(de).forEach(e=>{if(e){let n=e.split(fe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function he(e){let t=``;if(b(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){let r=he(e[n]);r&&(t+=r+` `)}else if(S(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ge(e){if(!e)return null;let{class:t,style:n}=e;return t&&!b(t)&&(e.class=he(t)),n&&(e.style=P(n)),e}var _e=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ve=r(_e);_e+``;function ye(e){return!!e||e===``}function be(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=we(e[i],t[i],n);return r}function xe(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&we(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Se(e,t,n){let r=h(e),i=h(t);if(r||i||(r=g(e),i=g(t),r||i))return r&&i?xe(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!we(e[r],t[r],n))return!1}return String(e)===String(t)}function Ce(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function we(e,t,n){if(e===t)return!0;let r=_(e),i=_(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=x(e),i=x(t),r||i?e===t:(r=m(e),i=m(t),r||i?r&&i?Ce(e,t,n,be):!1:(r=S(e),i=S(t),r||i?!r||!i?!1:Ce(e,t,n,Se):String(e)===String(t))))}function Te(e,t){return e.findIndex(e=>we(e,t))}var Ee=e=>!!(e&&e.__v_isRef===!0),De=e=>b(e)?e:e==null?``:m(e)||S(e)&&(e.toString===w||!y(e.toString))?Ee(e)?De(e.value):JSON.stringify(e,Oe,2):String(e),Oe=(e,t)=>Ee(t)?Oe(e,t.value):h(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ke(t,r)+` =>`]=n,e),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ke(e))}:x(t)?ke(t):S(Line truncated
|
||||
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var n=window.location.hash;if(n.startsWith(`#/`)){let e=n.slice(1);window.history.replaceState(null,``,e+window.location.search)}function r(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var i={},a=[],o=()=>{},s=()=>!1,c=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),l=e=>e.startsWith(`onUpdate:`),u=Object.assign,d=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},f=Object.prototype.hasOwnProperty,p=(e,t)=>f.call(e,t),m=Array.isArray,h=e=>T(e)===`[object Map]`,g=e=>T(e)===`[object Set]`,_=e=>T(e)===`[object Date]`,v=e=>T(e)===`[object RegExp]`,y=e=>typeof e==`function`,b=e=>typeof e==`string`,x=e=>typeof e==`symbol`,S=e=>typeof e==`object`&&!!e,C=e=>(S(e)||y(e))&&y(e.then)&&y(e.catch),w=Object.prototype.toString,T=e=>w.call(e),E=e=>T(e).slice(8,-1),D=e=>T(e)===`[object Object]`,ee=e=>b(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,te=r(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ne=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},re=/-\w/g,O=ne(e=>e.replace(re,e=>e.slice(1).toUpperCase())),ie=/\B([A-Z])/g,ae=ne(e=>e.replace(ie,`-$1`).toLowerCase()),k=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),A=ne(e=>e?`on${k(e)}`:``),j=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},M=e=>{let t=b(e)?Number(e):NaN;return isNaN(t)?e:t},le,ue=()=>le||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},de=r(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function N(e){if(m(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=b(r)?he(r):N(r);if(i)for(let e in i)t[e]=i[e]}return t}if(b(e)||S(e))return e}var fe=/;(?![^(]*\))/g,pe=/:([^]+)/,me=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function he(e){let t={};return e.replace(me,e=>e.startsWith(`/*`)?``:e).split(fe).forEach(e=>{if(e){let n=e.split(pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ge(e){let t=``;if(b(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){let r=ge(e[n]);r&&(t+=r+` `)}else if(S(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function _e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!b(t)&&(e.class=ge(t)),n&&(e.style=N(n)),e}var ve=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ye=r(ve);ve+``;function be(e){return!!e||e===``}function xe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Te(e[i],t[i],n);return r}function Se(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Te(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ce(e,t,n){let r=h(e),i=h(t);if(r||i||(r=g(e),i=g(t),r||i))return r&&i?Se(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Te(e[r],t[r],n))return!1}return String(e)===String(t)}function we(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Te(e,t,n){if(e===t)return!0;let r=_(e),i=_(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=x(e),i=x(t),r||i?e===t:(r=m(e),i=m(t),r||i?r&&i?we(e,t,n,xe):!1:(r=S(e),i=S(t),r||i?!r||!i?!1:we(e,t,n,Ce):String(e)===String(t))))}function Ee(e,t){return e.findIndex(e=>Te(e,t))}var De=e=>!!(e&&e.__v_isRef===!0),Oe=e=>b(e)?e:e==null?``:m(e)||S(e)&&(e.toString===w||!y(e.toString))?De(e)?Oe(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>De(t)?ke(e,t.value):h(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:x(t)?Ae(t):Line truncated
|
||||
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
|
||||
`)&&(bi(e,0)||ui(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||c(a)&&!te(a)||a[0]===`.`||t&&!te(a)||u&&u.includes(a)){if(_i(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&en(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&As(x,n,t),h&&hr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ts(()=>{x&&As(x,n,t),l&&g.enter(e),h&&hr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Ds(d[t]),g=h.type===as;e?(g&&!u&&t+1<p&&Ds(d[t+1]).type===as&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,bi(r,1)||ui()),n(null,h,r,null,o,s,pi(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&mi(f)&&f.data===`]`?a(t.anchor=f):(ui(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(Si(e,t)||ui(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,pi(d),c),r&&(r.vnode.el=t.el,mo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&mi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var gi=new Set([`src`,`srcset`,`href`,`poster`]);function _i(e,t,n){return gi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var vi=`data-allow-mismatch`,yi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function bi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(vi);)e=e.parentElement;return xi(e&&e.getAttribute(vi),t)}function xi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(yi[t])}}function Si(e,t){return bi(e.parentElement,1)||Ci(e)||wi(t)}function Ci(e){return e.nodeType===1&&xi(e.getAttribute(vi),1)}function wi({props:e}){let t=e&&e[vi];return typeof t==`string`&&xi(t,1)}var Ti=le().requestIdleCallback||(e=>setTimeout(e,1)),Ei=le().cancelIdleCallback||(e=>clearTimeout(e)),Di=(e=1e4)=>t=>{let n=Ti(t,{timeout:e});return()=>Ei(n)};function Oi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var ki=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Oi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ai=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},ji=(e=[])=>(t,n)=>{b(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Mi(e,t){if(mi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(mi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ni=e=>!!e.type.__asyncLoader;function Pi(e){y(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return H({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Mi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Ps;if(ri(e),u)return()=>Fi(u,e);let t=t=>{l=null,Vn(t,e,13,!r)};if(s&&e.suspense||Vs)return p().then(t=>()=>Fi(t,e)).catch(e=>(t(e),()=>r?K(r,{error:e}):null));let a=R(!1),c=R(),d=R(!!i),f,m;return Qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ii(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Fi(u,e);if(c.value&&r)return K(r,{error:c.value});if(n&&
Line truncated
|
||||
`))),e[Hl]=zl(i);let a=r||i.props&&i.props.type===`number`;ol(e,t?`change`:`input`,t=>{t.target.composing||e[Hl](Wl(e.value,n,a))}),(n||a)&&ol(e,`change`,()=>{e.value=Wl(e.value,n,a)}),t||(ol(e,`compositionstart`,Bl),ol(e,`compositionend`,Vl),ol(e,`change`,Vl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Ul];delete e[Ul],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Hl](Wl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Hl]=zl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Kl={deep:!0,created(e,t,n){e[Hl]=zl(n),ol(e,`change`,()=>{let t=e._modelValue,n=Ql(e),r=e.checked,i=e[Hl];if(m(t)){let e=Te(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(g(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i($l(e,r))})},mounted:ql,beforeUpdate(e,t,n){e[Hl]=zl(n),ql(e,t,n)}};function ql(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(m(t))i=Te(t,r.props.value)>-1;else if(g(t))i=t.has(r.props.value);else{if(t===n)return;i=we(t,$l(e,!0))}e.checked!==i&&(e.checked=i)}var Jl={created(e,{value:t},n){e.checked=we(t,n.props.value),e[Hl]=zl(n),ol(e,`change`,()=>{e[Hl](Ql(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Hl]=zl(r),t!==n&&(e.checked=we(t,r.props.value))}},Yl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ol(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(Ql(e)):Ql(e)),r=e.multiple,i=r?g(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?m(i)?t.slice():t:i];try{e[Hl](i)}finally{Xn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Hl]=zl(r)},mounted(e,{value:t}){Zl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Hl]=zl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Xl(t,n[1],n[0]))&&Zl(e,t)}};function Xl(e,t,n){if(!n||m(e))return we(e,t);if(g(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Zl(e,t){let n=e.multiple,r=m(t);if(!n||r||g(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Ql(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Te(t,o)>-1}else a.selected=t.has(o)}else if(we(Ql(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ql(e){return`_value`in e?e._value:e.value}function $l(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var eu={created(e,t,n){nu(e,t,n,null,`created`)},mounted(e,t,n){nu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){nu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){nu(e,t,n,r,`updated`)}};function tu(e,t){switch(e){case`SELECT`:return Yl;case`TEXTAREA`:return Gl;default:switch(t){case`checkbox`:return Kl;case`radio`:return Jl;default:return Gl}}}function nu(e,t,n,r,i){let a=tu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function ru(){Gl.getSSRProps=({value:e})=>({value:e}),Jl.getSSRProps=({value:e},t)=>{if(t.props&&we(t.props.value,e))return{checked:!0}},Kl.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&Te(e,t.props.value)>-1)return{checked:!0}}else if(g(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},eu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=tu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var iu=[`ctrl`,`shift`,`alt`,`meta`],au={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)=>iu.some(n=>e[`${n}Key`]&&!t.includes(n))},ou=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=au[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},su={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},cu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=ae(n.key);if(t.some(e=>e===r||su[e]===r))return e(n)}))},lu=u({patchProp:vl},vc),uu,du=!1;function fu(){return uu||=Po(lu)}function pu(){return uu=du?uu:Fo(lu),du=!0,uu}var mu=((...e)=>{fu().render(...e)}),hu=((...e)=>{pu().hydrate(...e)}),gu=((...e)=>{let t=fu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=yu(e);if(!r)return;let i=t._component;!y(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,vu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),_u=((
Line truncated
|
||||
`)&&(xi(e,0)||di(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||c(a)&&!te(a)||a[0]===`.`||t&&!te(a)||u&&u.includes(a)){if(vi(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&tn(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&js(x,n,t),h&&gr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ns(()=>{x&&js(x,n,t),l&&g.enter(e),h&&gr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Os(d[t]),g=h.type===os;e?(g&&!u&&t+1<p&&Os(d[t+1]).type===os&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,xi(r,1)||di()),n(null,h,r,null,o,s,mi(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&hi(f)&&f.data===`]`?a(t.anchor=f):(di(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(Ci(e,t)||di(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,mi(d),c),r&&(r.vnode.el=t.el,ho(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&hi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var _i=new Set([`src`,`srcset`,`href`,`poster`]);function vi(e,t,n){return _i.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var yi=`data-allow-mismatch`,bi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function xi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(yi);)e=e.parentElement;return Si(e&&e.getAttribute(yi),t)}function Si(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(bi[t])}}function Ci(e,t){return xi(e.parentElement,1)||wi(e)||Ti(t)}function wi(e){return e.nodeType===1&&Si(e.getAttribute(yi),1)}function Ti({props:e}){let t=e&&e[yi];return typeof t==`string`&&Si(t,1)}var Ei=ue().requestIdleCallback||(e=>setTimeout(e,1)),Di=ue().cancelIdleCallback||(e=>clearTimeout(e)),Oi=(e=1e4)=>t=>{let n=Ei(t,{timeout:e});return()=>Di(n)};function ki(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Ai=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(ki(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},ji=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Mi=(e=[])=>(t,n)=>{b(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Ni(e,t){if(hi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(hi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Pi=e=>!!e.type.__asyncLoader;function Fi(e){y(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return V({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Ni(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Fs;if(ii(e),u)return()=>Ii(u,e);let t=t=>{l=null,Hn(t,e,13,!r)};if(s&&e.suspense||Hs)return p().then(t=>()=>Ii(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=L(!1),c=L(),d=L(!!i),f,m;return $i(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Li(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Ii(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&&
Line truncated
|
||||
`))),e[Ul]=Bl(i);let a=r||i.props&&i.props.type===`number`;sl(e,t?`change`:`input`,t=>{t.target.composing||e[Ul](Gl(e.value,n,a))}),(n||a)&&sl(e,`change`,()=>{e.value=Gl(e.value,n,a)}),t||(sl(e,`compositionstart`,Vl),sl(e,`compositionend`,Hl),sl(e,`change`,Hl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Wl];delete e[Wl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Ul](Gl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Ul]=Bl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ql={deep:!0,created(e,t,n){e[Ul]=Bl(n),sl(e,`change`,()=>{let t=e._modelValue,n=$l(e),r=e.checked,i=e[Ul];if(m(t)){let e=Ee(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(g(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(eu(e,r))})},mounted:Jl,beforeUpdate(e,t,n){e[Ul]=Bl(n),Jl(e,t,n)}};function Jl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(m(t))i=Ee(t,r.props.value)>-1;else if(g(t))i=t.has(r.props.value);else{if(t===n)return;i=Te(t,eu(e,!0))}e.checked!==i&&(e.checked=i)}var Yl={created(e,{value:t},n){e.checked=Te(t,n.props.value),e[Ul]=Bl(n),sl(e,`change`,()=>{e[Ul]($l(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Ul]=Bl(r),t!==n&&(e.checked=Te(t,r.props.value))}},Xl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,sl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce($l(e)):$l(e)),r=e.multiple,i=r?g(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?m(i)?t.slice():t:i];try{e[Ul](i)}finally{Zn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Ul]=Bl(r)},mounted(e,{value:t}){Ql(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ul]=Bl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Zl(t,n[1],n[0]))&&Ql(e,t)}};function Zl(e,t,n){if(!n||m(e))return Te(e,t);if(g(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Ql(e,t){let n=e.multiple,r=m(t);if(!n||r||g(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=$l(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ee(t,o)>-1}else a.selected=t.has(o)}else if(Te($l(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function $l(e){return`_value`in e?e._value:e.value}function eu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var tu={created(e,t,n){ru(e,t,n,null,`created`)},mounted(e,t,n){ru(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ru(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ru(e,t,n,r,`updated`)}};function nu(e,t){switch(e){case`SELECT`:return Xl;case`TEXTAREA`:return Kl;default:switch(t){case`checkbox`:return ql;case`radio`:return Yl;default:return Kl}}}function ru(e,t,n,r,i){let a=nu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function iu(){Kl.getSSRProps=({value:e})=>({value:e}),Yl.getSSRProps=({value:e},t)=>{if(t.props&&Te(t.props.value,e))return{checked:!0}},ql.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&Ee(e,t.props.value)>-1)return{checked:!0}}else if(g(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},tu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=nu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var au=[`ctrl`,`shift`,`alt`,`meta`],ou={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)=>au.some(n=>e[`${n}Key`]&&!t.includes(n))},su=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=ou[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},cu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},lu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=ae(n.key);if(t.some(e=>e===r||cu[e]===r))return e(n)}))},uu=u({patchProp:yl},yc),du,fu=!1;function pu(){return du||=Fo(uu)}function mu(){return du=fu?du:Io(uu),fu=!0,du}var hu=((...e)=>{pu().render(...e)}),gu=((...e)=>{mu().hydrate(...e)}),_u=((...e)=>{let t=pu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=bu(e);if(!r)return;let i=t._component;!y(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,yu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),vu=((
Line truncated
|
||||
`)].join(`
|
||||
`))}return()=>i.value||r.value||o.value?tc(t.default({present:o.value})[0],{ref:e=>{let t=ep(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),nm=H({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=sp(n.default()),r=e.findIndex(e=>e.type!==os);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?q(t,i.props):t,o=Cs({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),rm=[`area`,`img`,`input`],im=H({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&rm.includes(r)?()=>tc(r,t):r===`template`?()=>tc(nm,t,{default:n.default}):()=>tc(e.as,t,{default:n.default})}});function am(){let e=R();return{primitiveElement:e,currentElement:J(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:ep(e))}}var om=`dismissableLayer.pointerDownOutside`,sm=`dismissableLayer.focusOutside`;function cm(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function lm(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=R(!1),a=R(()=>{});return xr(o=>{if(!Bf||!fn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(cm(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Ff(om,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{fn(n)&&(i.value=!0)}}}function um(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=R(!1);return xr(a=>{if(!Bf||!fn(n))return;let o=async n=>{if(!t?.value)return;await Xn(),await Xn();let r=n.target;t.value&&r&&!cm(t.value,r)&&n.target&&!i.value&&Ff(sm,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{fn(n)&&(i.value=!0)},onBlurCapture:()=>{fn(n)&&(i.value=!1)}}}var dm=H({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=X(),o=J(()=>a.value?.ownerDocument??globalThis.document),s=J(()=>pp.layersRoot),c=J(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=J(()=>pp.layersWithOutsidePointerEventsDisabled.size>0),u=J(()=>{let e=Array.from(s.value),[t]=[...pp.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=lm(async e=>{let t=[...pp.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await Xn(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=um(e=>{let t=[...pp.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ip(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),V([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{e&&n&&t&&(pp.layersWithOutsidePointerEventsDisabled.size===0&&(pp.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),pp.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{pp.layersWithOutsidePointerEventsDisabled.delete(e),pp.layersWithOutsidePointerEventsDisabled.size===0&&!If(pp.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=pp.originalBodyPointerEvents)}))},{immediate:!0}),V([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),xr(e=>{e(()=>{a.value&&(s.value.delete(a.value),pp.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(W(),G(z(im),{ref:z(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:P({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:z(f).onFocusCapture,onBlurCapture:z(f).onBlurCapture,onPointerdownCapture:z(d).onPointerDownCapture},{default:B(()=>[U(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),fm=zf(()=>R([]));function pm(){let e=fm();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=mm(e.value,t),e.value.unshift(t)},remove(t){e.value=mm(
Line truncated
|
||||
`))}return()=>i.value||r.value||o.value?nc(t.default({present:o.value})[0],{ref:e=>{let t=tp(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),rm=V({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=cp(n.default()),r=e.findIndex(e=>e.type!==ss);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?K(t,i.props):t,o=ws({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),im=[`area`,`img`,`input`],am=V({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&im.includes(r)?()=>nc(r,t):r===`template`?()=>nc(rm,t,{default:n.default}):()=>nc(e.as,t,{default:n.default})}});function om(){let e=L();return{primitiveElement:e,currentElement:q(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:tp(e))}}var sm=`dismissableLayer.pointerDownOutside`,cm=`dismissableLayer.focusOutside`;function lm(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function um(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=L(!1),a=L(()=>{});return Sr(o=>{if(!Vf||!pn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(lm(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){If(sm,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{pn(n)&&(i.value=!0)}}}function dm(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=L(!1);return Sr(a=>{if(!Vf||!pn(n))return;let o=async n=>{if(!t?.value)return;await Zn(),await Zn();let r=n.target;t.value&&r&&!lm(t.value,r)&&n.target&&!i.value&&If(cm,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{pn(n)&&(i.value=!0)},onBlurCapture:()=>{pn(n)&&(i.value=!1)}}}var fm=V({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Y(),o=q(()=>a.value?.ownerDocument??globalThis.document),s=q(()=>mp.layersRoot),c=q(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=q(()=>mp.layersWithOutsidePointerEventsDisabled.size>0),u=q(()=>{let e=Array.from(s.value),[t]=[...mp.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=um(async e=>{let t=[...mp.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await Zn(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=dm(e=>{let t=[...mp.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ap(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),B([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{e&&n&&t&&(mp.layersWithOutsidePointerEventsDisabled.size===0&&(mp.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),mp.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{mp.layersWithOutsidePointerEventsDisabled.delete(e),mp.layersWithOutsidePointerEventsDisabled.size===0&&!Lf(mp.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=mp.originalBodyPointerEvents)}))},{immediate:!0}),B([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),Sr(e=>{e(()=>{a.value&&(s.value.delete(a.value),mp.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(U(),W(R(am),{ref:R(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:N({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:R(f).onFocusCapture,onBlurCapture:R(f).onBlurCapture,onPointerdownCapture:R(d).onPointerDownCapture},{default:z(()=>[H(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),pm=Bf(()=>L([]));function mm(){let e=pm();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=hm(e.value,t),e.value.unshift(t)},remove(t){e.value=hm(
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var cx=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};async function lx(e,t){let n=await fetch(e,t);if(!n.ok)throw new cx(await sx(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=ax,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await lx(e,s);return a?await c.json():void 0}var ux={summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+ox(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+ox(t)),taskAction:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),version:()=>$(`/api/version`),configUpdate:e=>$(`/api/config`,{method:`PATCH`,body:{updates:e}}),configRepoUpdate:(e,t,n,r)=>$(`/api/config/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:{field:n,value:r}}),configReset:e=>$(`/api/config/reset`,{method:`POST`,body:{key:e}}),logs:e=>$(`/api/logs`+ox(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+ox(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),captures:e=>$(`/api/captures`+ox({limit:e})),mappings:()=>$(`/api/mappings`),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>$(`/api/bindings`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),chatSessions:()=>$(`/api/chat/sessions`),chatMessages:e=>$(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>$(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>$(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>$(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:ix(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>$(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatUpdate:()=>$(`/api/chat/update`),chatUpdateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),chatUpdateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:12e4}),chatDangerous:()=>$(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>$(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>$(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>lx(`/api/chat/stream`,{method:`POST`,headers:{Accept:`text/event-stream`,"Content-Type":`application/json`,"X-Archie-CSRF":`1`},body:JSON.stringify(e),signal:t.signal})},dx=L([]);function fx(e,t){return e?t.filter(t=>typeof t.meta?.section==`string`&&e[t.meta.section]===!1).map(e=>e.path):[]}async function px(){try{dx.value=fx((await ux.capabilities())?.sections,Yy)}catch{}}var mx=[{id:`queued`,label:`Queued`,kind:`idle`},{id:`running`,label:`Working`,kind:`info`},{id:`waiting_human`,label:`Waiting for you`,kind:`warn`,needs_you:!0},{id:`pr_open`,label:`In review`,kind:`ok`},{id:`merged`,label:`Merged`,kind:`ok`},{id:`parked`,label:`Parked`,kind:`warn`,needs_you:!0},{id:`dead`,label:`Stopped (too many retries)`,kind:`danger`},{id:`rejected`,label:`Rejected`,kind:`danger`},{id:`closed_wont_do`,label:`Won't do`,kind:`idle`}],hx=[{id:`cancel`,label:`Cancel`,kind:`quiet`,confirm:`Cancel "{title}"? This closes the forge issue.`},{id:`stop`,label:`Stop`,kind:`primary`,confirm:`Stop "{title}"? Recoverable work will remain parked.`},{id:`approve`,label:`Approve`,kind:`primary`},{id:`reject`,label:`Reject`,kind:`quiet`,confirm:`Reject "{title}"? This closes the forge issue.`},{id:`retry`,label:`Retry`,kind:`primary`},{id:`abandon`,label:`Abandon`,kind:`quiet`,confirm:`Abandon "{title}"? This closes the forge
Line truncated
|
||||
+39
-11
@@ -4,24 +4,52 @@ import { onMounted } from "vue";
|
||||
import Topbar from "@/components/topbar/Topbar.vue";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { hidden, loadCapabilities } from "@/lib/capabilities";
|
||||
import { loadTaskMeta } from "@/lib/task-meta";
|
||||
|
||||
onMounted(() => {
|
||||
// Asked for once, after the shell is up: the nav paints immediately and
|
||||
// loses the entries this process cannot back a moment later, rather than
|
||||
// holding the page behind a request. A failed read hides nothing.
|
||||
void loadCapabilities();
|
||||
|
||||
// The lifecycle vocabulary -- status labels, pill severity, "needs you"
|
||||
// grouping, and the operator actions -- is served by /api/task-meta. Asked
|
||||
// for once, after the shell is up: the freeze-dried defaults paint
|
||||
// immediately and this replaces them, so a catalogue change on the server
|
||||
// reaches the browser without a UI release. loadTaskMeta never throws (a
|
||||
// failed read keeps the defaults), so it needs no catch here.
|
||||
void loadTaskMeta();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TooltipProvider :delay-duration="350">
|
||||
<Topbar :hidden="hidden" />
|
||||
<main class="min-h-[calc(100svh-3.5rem)]">
|
||||
<!--
|
||||
Keyed on the path and its parameters but not the query: a query-only
|
||||
change is an entry state, so the page keeps the operator's filters,
|
||||
while two different :id values get fresh instances.
|
||||
-->
|
||||
<RouterView v-slot="{ Component, route }">
|
||||
<component :is="Component" :key="route.path" />
|
||||
</RouterView>
|
||||
</main>
|
||||
<!--
|
||||
One contained, rounded surface floating on the canvas `body` carries:
|
||||
framing the workspace gives the panels an edge to sit against, and lets
|
||||
the light behind read through rather than stopping at the first opaque
|
||||
card. The frame is a desktop affordance, so at the narrow breakpoint it
|
||||
goes edge to edge instead of insetting a rounded card on a phone.
|
||||
|
||||
`backdrop-filter` makes this a containing block for `position: fixed`,
|
||||
so the chat launcher has to render outside this element.
|
||||
-->
|
||||
<div
|
||||
class="flex min-h-[calc(100vh-2rem)] flex-col overflow-hidden rounded-xl border border-[var(--hairline)] bg-[var(--workspace)] shadow-[var(--shadow-workspace)] backdrop-blur-[28px] backdrop-saturate-[1.2] max-[900px]:min-h-screen max-[900px]:rounded-none max-[900px]:border-0 max-[900px]:shadow-none"
|
||||
>
|
||||
<Topbar :hidden="hidden" />
|
||||
<main class="w-full flex-1 overflow-x-hidden p-8 max-[900px]:p-4">
|
||||
<!--
|
||||
Keyed on the path and its parameters but not the query: a query-only
|
||||
change is an entry state, so the page keeps the operator's filters,
|
||||
while two different :id values get fresh instances -- without that
|
||||
the second id diffs the first one in place and the previous task's
|
||||
open tab stays open on the next (W11).
|
||||
-->
|
||||
<RouterView v-slot="{ Component, route }">
|
||||
<component :is="Component" :key="route.path" />
|
||||
</RouterView>
|
||||
</main>
|
||||
</div>
|
||||
</TooltipProvider>
|
||||
</template>
|
||||
@@ -0,0 +1,246 @@
|
||||
// Single place that knows how to talk to archied. Every feature folder goes
|
||||
// through api.* below, and every api.* method goes through send(), so the CSRF
|
||||
// header, the Content-Type, the request timeout, and the error shape live in
|
||||
// this one file.
|
||||
import { streamStateFor, type StreamState } from "./stream-state";
|
||||
import { randomUUID } from "./uuid";
|
||||
|
||||
// DEFAULT_TIMEOUT_MS bounds a request so a daemon that accepts the connection
|
||||
// but never answers cannot leave the UI in a loading state with no way back.
|
||||
// The retry affordances rely on fetch settling, so bound it.
|
||||
const DEFAULT_TIMEOUT_MS = 15000;
|
||||
|
||||
/** Query values are omitted when empty, so the server sees an absent filter. */
|
||||
export type QueryParams = Record<string, string | number | null | undefined>;
|
||||
|
||||
/** Opaque payloads are passed through unchanged; the server owns their shape. */
|
||||
export type Payload = Record<string, unknown>;
|
||||
|
||||
// qs builds a query string, omitting empty values so the server sees an
|
||||
// absent filter rather than an empty one.
|
||||
function qs(params?: QueryParams): string {
|
||||
const q = new URLSearchParams();
|
||||
for (const [k, v] of Object.entries(params || {})) {
|
||||
if (v !== "" && v != null) q.set(k, String(v));
|
||||
}
|
||||
const s = q.toString();
|
||||
return s ? `?${s}` : "";
|
||||
}
|
||||
|
||||
// errorMessage prefers what the server actually said. archied answers these
|
||||
// with http.Error, i.e. a plain-text reason -- "task is not awaiting
|
||||
// approval", "max retries reached (3/3)", "Content-Type must be
|
||||
// application/json" -- and discarding it in favour of "409 Conflict" throws
|
||||
// away the only part an operator can act on.
|
||||
async function errorMessage(res: Response): Promise<string> {
|
||||
try {
|
||||
const body = (await res.text()).trim();
|
||||
if (body) return body.split("\n")[0].slice(0, 200);
|
||||
} catch {
|
||||
// Body already consumed or unreadable; fall through to the status.
|
||||
}
|
||||
return `${res.status} ${res.statusText}`;
|
||||
}
|
||||
|
||||
export class ApiError extends Error {
|
||||
status: number;
|
||||
|
||||
constructor(message: string, status: number) {
|
||||
super(message);
|
||||
this.name = "ApiError";
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
|
||||
/** How a failed operator action should render. */
|
||||
export type ActionErrorKind = "session-expired" | "refused" | "broken";
|
||||
|
||||
// classifyActionError turns a failed operator action into a rendering
|
||||
// decision. archied's own handlers already return distinguishable status
|
||||
// codes for a refused mutation (400/403/409/415 -- bad input, missing CSRF,
|
||||
// cross-origin, conflicting state, a body that is not JSON) versus a broken
|
||||
// one (5xx, or no status at all when fetch itself failed -- network drop,
|
||||
// timeout); 401 additionally means the session -- archied's own token cookie,
|
||||
// or an upstream forward-auth proxy sitting in front of it -- has expired
|
||||
// rather than that the action was rejected or the daemon is unwell.
|
||||
export function classifyActionError(err: unknown): { kind: ActionErrorKind; message: string } {
|
||||
const status = err instanceof ApiError ? err.status : undefined;
|
||||
const message = err instanceof Error && err.message ? err.message : "Action failed";
|
||||
if (status === 401) return { kind: "session-expired", message };
|
||||
if (status !== undefined && status >= 400 && status < 500) return { kind: "refused", message };
|
||||
return { kind: "broken", message };
|
||||
}
|
||||
|
||||
// send is the only fetch() in the dashboard. It converts a non-ok response
|
||||
// into an ApiError carrying the server's own explanation and a usable status,
|
||||
// and hands the raw Response back so the streaming caller can read the body
|
||||
// itself.
|
||||
async function send(path: string, init: RequestInit): Promise<Response> {
|
||||
const res = await fetch(path, init);
|
||||
if (!res.ok) throw new ApiError(await errorMessage(res), res.status);
|
||||
return res;
|
||||
}
|
||||
|
||||
interface RequestOptions {
|
||||
method?: string;
|
||||
body?: unknown;
|
||||
timeoutMs?: number;
|
||||
parse?: boolean;
|
||||
}
|
||||
|
||||
// request performs a JSON request. Every mutating method must declare a JSON
|
||||
// body: archied's handlers run authorizeTaskMutation first, and it answers 415
|
||||
// unless Content-Type is application/json -- including for a mutation that has
|
||||
// no body to send, because that requirement is what makes a simple cross-origin
|
||||
// form post inexpressible. Sending the header on every mutation, rather than
|
||||
// only where a payload happens to exist, is what keeps a bodyless DELETE or
|
||||
// approve from being refused.
|
||||
async function request<T = unknown>(path: string, opts: RequestOptions = {}): Promise<T> {
|
||||
const { method = "GET", body, timeoutMs = DEFAULT_TIMEOUT_MS, parse = true } = opts;
|
||||
const headers: Record<string, string> = { Accept: "application/json" };
|
||||
const init: RequestInit = { method, headers, signal: AbortSignal.timeout(timeoutMs) };
|
||||
if (method !== "GET") {
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["X-Archie-CSRF"] = "1";
|
||||
}
|
||||
if (body !== undefined) init.body = JSON.stringify(body);
|
||||
|
||||
const res = await send(path, init);
|
||||
return (parse ? await res.json() : undefined) as T;
|
||||
}
|
||||
|
||||
export const api = {
|
||||
summary: <T = unknown>() => request<T>("/api/summary"),
|
||||
tasks: <T = unknown>() => request<T>("/api/tasks"),
|
||||
taskMeta: <T = unknown>() => request<T>("/api/task-meta"),
|
||||
task: <T = unknown>(id: string) => request<T>(`/api/tasks/${encodeURIComponent(id)}`),
|
||||
taskAttempts: <T = unknown>(id: string) => request<T>(`/api/tasks/${encodeURIComponent(id)}/attempts`),
|
||||
taskChanges: <T = unknown>(id: string, params?: QueryParams) =>
|
||||
request<T>(`/api/tasks/${encodeURIComponent(id)}/changes` + qs(params)),
|
||||
taskDebug: <T = unknown>(id: string, params?: QueryParams) =>
|
||||
request<T>(`/api/tasks/${encodeURIComponent(id)}/debug` + qs(params)),
|
||||
taskAction: <T = unknown>(id: string, action: string) =>
|
||||
request<T>(`/api/tasks/${encodeURIComponent(id)}/action`, { method: "POST", body: { action } }),
|
||||
setup: <T = unknown>() => request<T>("/api/setup"),
|
||||
capabilities: <T = unknown>() => request<T>("/api/capabilities"),
|
||||
workflows: <T = unknown>() => request<T>("/api/workflows"),
|
||||
workRequest: <T = unknown>(workRequest: Payload) => request<T>("/api/work-requests", { method: "POST", body: workRequest }),
|
||||
skills: <T = unknown>() => request<T>("/api/skills"),
|
||||
channels: <T = unknown>() => request<T>("/api/channels"),
|
||||
curators: <T = unknown>() => request<T>("/api/curators"),
|
||||
channelReload: <T = unknown>(id: string) =>
|
||||
request<T>(`/api/channels/${encodeURIComponent(id)}/reload`, { method: "POST", body: {} }),
|
||||
config: <T = unknown>() => request<T>("/api/config"),
|
||||
version: <T = unknown>() => request<T>("/api/version"),
|
||||
configUpdate: <T = unknown>(updates: Payload) => request<T>("/api/config", { method: "PATCH", body: { updates } }),
|
||||
configRepoUpdate: <T = unknown>(owner: string, name: string, field: string, value: unknown) =>
|
||||
request<T>(`/api/config/repos/${encodeURIComponent(owner)}/${encodeURIComponent(name)}`, {
|
||||
method: "PATCH",
|
||||
body: { field, value },
|
||||
}),
|
||||
configReset: <T = unknown>(key: string) => request<T>("/api/config/reset", { method: "POST", body: { key } }),
|
||||
logs: <T = unknown>(params?: QueryParams) => request<T>("/api/logs" + qs(params)),
|
||||
taskLogs: <T = unknown>(id: string, params?: QueryParams) =>
|
||||
request<T>(`/api/tasks/${encodeURIComponent(id)}/logs` + qs(params)),
|
||||
// A download is a navigation, not a fetch: the browser must own the
|
||||
// Content-Disposition filename and stream the body to disk rather than hold
|
||||
// a whole log in memory. The URL builder is the client-side contract, and
|
||||
// log-row keeps it beside the panel that uses it.
|
||||
taskLogDownloadURL: (id: string, attempt?: number | null) =>
|
||||
`/api/tasks/${encodeURIComponent(id)}/logs/download` + (attempt == null ? "" : `?attempt=${attempt}`),
|
||||
captures: <T = unknown>(limit?: number) => request<T>("/api/captures" + qs({ limit })),
|
||||
mappings: <T = unknown>() => request<T>("/api/mappings"),
|
||||
mappingCreate: <T = unknown>(mapping: Payload) => request<T>("/api/mappings", { method: "POST", body: mapping }),
|
||||
mappingUpdate: <T = unknown>(id: string, mapping: Payload) =>
|
||||
request<T>(`/api/mappings/${encodeURIComponent(id)}`, { method: "PATCH", body: mapping }),
|
||||
// A delete answers 204, so there is no body to parse.
|
||||
mappingDelete: (id: string) => request<void>(`/api/mappings/${encodeURIComponent(id)}`, { method: "DELETE", parse: false }),
|
||||
mappingPreview: <T = unknown>(captureId: string, fields: unknown) =>
|
||||
request<T>("/api/mappings/preview", { method: "POST", body: { capture_id: captureId, fields } }),
|
||||
bindings: <T = unknown>() => request<T>("/api/bindings"),
|
||||
bindingCreate: <T = unknown>(binding: Payload) => request<T>("/api/bindings", { method: "POST", body: binding }),
|
||||
bindingUpdate: <T = unknown>(id: string, binding: Payload) =>
|
||||
request<T>(`/api/bindings/${encodeURIComponent(id)}`, { method: "PATCH", body: binding }),
|
||||
bindingDelete: (id: string) => request<void>(`/api/bindings/${encodeURIComponent(id)}`, { method: "DELETE", parse: false }),
|
||||
bindingApprove: <T = unknown>(id: string) => request<T>(`/api/bindings/${encodeURIComponent(id)}/approve`, { method: "POST" }),
|
||||
chatSessions: <T = unknown>() => request<T>("/api/chat/sessions"),
|
||||
chatMessages: <T = unknown>(id: string) => request<T>(`/api/chat/sessions/${encodeURIComponent(id)}/messages`),
|
||||
chatTurns: <T = unknown>(id: string) => request<T>(`/api/chat/sessions/${encodeURIComponent(id)}/turns`),
|
||||
chatCancel: <T = unknown>(sessionID: string) => request<T>("/api/chat/cancel", { method: "POST", body: { session_id: sessionID } }),
|
||||
// The page the operator was on when they asked, so a chat answer can be
|
||||
// about what they were looking at. History routing makes that the pathname.
|
||||
chatMessage: <T = unknown>(channelID: string, text: string) =>
|
||||
request<T>("/api/chat/message", {
|
||||
method: "POST",
|
||||
body: {
|
||||
channel_id: channelID,
|
||||
source_id: randomUUID(),
|
||||
text,
|
||||
page: location.pathname + location.search || "/",
|
||||
},
|
||||
}),
|
||||
chatPersona: <T = unknown>(sessionID: string, name: string) =>
|
||||
request<T>("/api/chat/persona", { method: "POST", body: { session_id: sessionID, name } }),
|
||||
chatUpdate: <T = unknown>() => request<T>("/api/chat/update"),
|
||||
chatUpdateDefer: <T = unknown>(snapshot: unknown) => request<T>("/api/chat/update/defer", { method: "POST", body: { snapshot } }),
|
||||
// Installing restarts archied, so it is allowed far longer than a normal
|
||||
// request before the UI gives up.
|
||||
chatUpdateInstall: <T = unknown>(snapshot: unknown) =>
|
||||
request<T>("/api/chat/update/install", { method: "POST", body: { snapshot }, timeoutMs: 120000 }),
|
||||
chatDangerous: <T = unknown>() => request<T>("/api/chat/dangerous"),
|
||||
chatDangerousRequest: <T = unknown>(kind: string, spec: unknown) =>
|
||||
request<T>(`/api/chat/dangerous/${encodeURIComponent(kind)}`, { method: "POST", body: { spec } }),
|
||||
chatDangerousDecision: <T = unknown>(id: string, decision: string) =>
|
||||
request<T>(`/api/chat/dangerous/${encodeURIComponent(id)}/decision`, { method: "POST", body: { decision } }),
|
||||
// A server-sent event stream cannot be parsed as JSON and outlives a normal
|
||||
// request, so the caller owns the abort controller and the timeout, and
|
||||
// reads the body itself. Only the URL, headers, and failure shape are shared.
|
||||
chatStream: (payload: unknown, opts: { signal?: AbortSignal } = {}) =>
|
||||
send("/api/chat/stream", {
|
||||
method: "POST",
|
||||
headers: { Accept: "text/event-stream", "Content-Type": "application/json", "X-Archie-CSRF": "1" },
|
||||
body: JSON.stringify(payload),
|
||||
signal: opts.signal,
|
||||
}),
|
||||
};
|
||||
|
||||
/**
|
||||
* Subscribe to archied's event stream. Returns an unsubscribe function.
|
||||
* Reconnection is the browser's job via EventSource, but a closed stream is
|
||||
* surfaced to the caller so the UI can show it rather than silently freezing.
|
||||
*/
|
||||
export function subscribeEvents(
|
||||
onEvent: (event: unknown) => void,
|
||||
onStateChange?: (state: StreamState) => void,
|
||||
): () => void {
|
||||
const src = new EventSource("/events");
|
||||
src.onopen = () => onStateChange?.("live");
|
||||
src.onerror = () => onStateChange?.("reconnecting");
|
||||
src.onmessage = (e) => {
|
||||
try {
|
||||
onEvent(JSON.parse(e.data));
|
||||
} catch {
|
||||
/* a malformed frame should not kill the stream */
|
||||
}
|
||||
};
|
||||
return () => src.close();
|
||||
}
|
||||
|
||||
export function subscribeLogs(
|
||||
onEntry: (entry: unknown) => void,
|
||||
onStateChange?: (state: StreamState) => void,
|
||||
): () => void {
|
||||
const src = new EventSource("/api/logs/stream");
|
||||
src.onopen = () => onStateChange?.("live");
|
||||
// onerror fires both for a drop the browser will retry and for one it has
|
||||
// given up on; readyState is what tells them apart.
|
||||
src.onerror = () => onStateChange?.(streamStateFor(src.readyState));
|
||||
src.onmessage = (event) => {
|
||||
try {
|
||||
onEntry(JSON.parse(event.data));
|
||||
} catch {
|
||||
/* malformed log frame */
|
||||
}
|
||||
};
|
||||
return () => src.close();
|
||||
}
|
||||
+26
-13
@@ -1,24 +1,39 @@
|
||||
// Which dashboard sections the serving process can actually back.
|
||||
//
|
||||
// From the UI cutover the dashboard is served by more than one composition,
|
||||
// and a section with nothing behind it still answers -- an empty list, a
|
||||
// "disabled" marker, a 501 -- which the browser cannot tell from a quiet
|
||||
// deployment. GET /api/capabilities says which sections are backed here, and
|
||||
// the nav drops the rest.
|
||||
import { ref } from "vue";
|
||||
|
||||
import { api } from "@/lib/api";
|
||||
import { routes } from "@/router";
|
||||
|
||||
/** The `sections` map GET /api/capabilities returns. */
|
||||
export type CapabilitySections = Record<string, boolean>;
|
||||
|
||||
interface RouteMeta {
|
||||
section?: string;
|
||||
/**
|
||||
* The route fields hiddenRoutes reads. The section lives under `meta` because
|
||||
* the route table is an untyped literal: internal/gateway's registry test
|
||||
* parses `const routes = [` and one route per line out of the source, so it
|
||||
* cannot carry a type annotation.
|
||||
*/
|
||||
export interface SectionedRoute {
|
||||
path: string;
|
||||
meta?: { section?: string };
|
||||
}
|
||||
|
||||
/** hidden lists the route paths this composition cannot serve. */
|
||||
export const hidden = ref<string[]>([]);
|
||||
|
||||
function hiddenFor(sections: CapabilitySections | undefined): string[] {
|
||||
// hiddenRoutes returns the paths whose section the server reported it cannot
|
||||
// serve. An unreported section stays visible: a page that says "unavailable"
|
||||
// is recoverable, a navigation entry that silently vanished is not, so an
|
||||
// older server or a failed capabilities read shows everything.
|
||||
export function hiddenRoutes(sections: CapabilitySections | null | undefined, table: SectionedRoute[]): string[] {
|
||||
if (!sections) return [];
|
||||
return (routes as Array<{ path: string; meta?: RouteMeta }>)
|
||||
.filter((route) => {
|
||||
const section = route.meta?.section;
|
||||
return typeof section === "string" && sections[section] === false;
|
||||
})
|
||||
.map((route) => route.path);
|
||||
return table.filter((r) => typeof r.meta?.section === "string" && sections[r.meta.section] === false).map((r) => r.path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -28,10 +43,8 @@ function hiddenFor(sections: CapabilitySections | undefined): string[] {
|
||||
*/
|
||||
export async function loadCapabilities(): Promise<void> {
|
||||
try {
|
||||
const response = await fetch("/api/capabilities", { headers: { Accept: "application/json" } });
|
||||
if (!response.ok) return;
|
||||
const body = (await response.json()) as { sections?: CapabilitySections } | null;
|
||||
hidden.value = hiddenFor(body?.sections);
|
||||
const body = await api.capabilities<{ sections?: CapabilitySections } | null>();
|
||||
hidden.value = hiddenRoutes(body?.sections, routes as SectionedRoute[]);
|
||||
} catch {
|
||||
// Offline or an older server: every section stays visible.
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Display formatting shared across the dashboard pages. Pure functions: no
|
||||
* DOM, no framework.
|
||||
*/
|
||||
|
||||
/** Humanised relative time: "2 min ago". Raw timestamps make people do maths. */
|
||||
export function ago(value: string | number | Date | null | undefined): string {
|
||||
if (!value) return "—";
|
||||
const then = value instanceof Date ? value : new Date(value);
|
||||
const secs = Math.floor((Date.now() - then.getTime()) / 1000);
|
||||
if (!Number.isFinite(secs)) return "—";
|
||||
if (secs < 45) return "just now";
|
||||
const units: Array<[string, number]> = [
|
||||
["min", 60],
|
||||
["hr", 3600],
|
||||
["day", 86400],
|
||||
["wk", 604800],
|
||||
];
|
||||
let label = "min";
|
||||
let size = 60;
|
||||
for (const [l, s] of units) {
|
||||
if (secs >= s) [label, size] = [l, s];
|
||||
}
|
||||
const n = Math.floor(secs / size);
|
||||
return `${n} ${label}${n === 1 ? "" : "s"} ago`;
|
||||
}
|
||||
|
||||
/** Compact number: 2_400_000 -> "2.4M". Long digit strings do not scan. */
|
||||
export function compact(n: number | null | undefined): string {
|
||||
if (n == null || Number.isNaN(n)) return "—";
|
||||
return new Intl.NumberFormat(undefined, { notation: "compact", maximumFractionDigits: 1 }).format(n);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// What an EventSource error actually means.
|
||||
//
|
||||
// EventSource fires onerror both for a dropped connection it will retry and
|
||||
// for one it has given up on. Reporting "reconnecting" for both left the logs
|
||||
// page showing a permanent amber "reconnecting" pill against a stream that had
|
||||
// stopped for good, next to text claiming live logs were still arriving
|
||||
// (archie-core-c5bz).
|
||||
//
|
||||
// readyState is the difference: CONNECTING means a retry is scheduled, CLOSED
|
||||
// means the browser will not try again.
|
||||
|
||||
/** The state the UI reports for an event stream. */
|
||||
export type StreamState = "live" | "reconnecting" | "unavailable";
|
||||
|
||||
/**
|
||||
* streamStateFor maps an EventSource readyState to the state the UI reports:
|
||||
* "live", "reconnecting", or "unavailable".
|
||||
*/
|
||||
export function streamStateFor(readyState: number): StreamState {
|
||||
// Numeric literals rather than EventSource.* so this is testable without one.
|
||||
if (readyState === 0) return "reconnecting";
|
||||
if (readyState === 1) return "live";
|
||||
return "unavailable";
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
// Central lifecycle vocabulary for the dashboard. The backend is the source of
|
||||
// truth: /api/task-meta returns the statuses (label, pill severity, "needs you"
|
||||
// grouping) and operator actions (label, button variant, confirm prompt). This
|
||||
// module fetches that catalog and exposes the accessors the rest of the UI
|
||||
// reads, so no surface keeps a hand-synced copy of the vocabulary.
|
||||
//
|
||||
// The defaults below are a freeze-dried snapshot that render immediately and
|
||||
// keep working when archied is unreachable; loadTaskMeta() replaces them with
|
||||
// the live catalog as soon as it arrives. They must match the backend catalog
|
||||
// so drawing the page never flashes a stale label.
|
||||
//
|
||||
// loadTaskMeta() is called once at boot by main.ts. The catalog is held in
|
||||
// refs, so a late-arriving catalog re-renders whatever already read it; there
|
||||
// is no separate "re-render the mounted route" step the way the Preact shell
|
||||
// needed one.
|
||||
//
|
||||
// The dashboard draws a line here between two kinds of vocabulary. Anything
|
||||
// that is *presentation* -- a status's label, pill severity and "needs you"
|
||||
// grouping, or a control's label and confirm prompt -- is served, because the
|
||||
// server owns the words as well as the ids.
|
||||
import { computed, shallowRef } from "vue";
|
||||
|
||||
import { api } from "./api";
|
||||
|
||||
/** A lifecycle status as the server describes it. */
|
||||
export interface StatusMeta {
|
||||
id: string;
|
||||
label: string;
|
||||
kind: string;
|
||||
needs_you?: boolean;
|
||||
}
|
||||
|
||||
/** An operator control as the server describes it. */
|
||||
export interface ActionMeta {
|
||||
id: string;
|
||||
label: string;
|
||||
kind: string;
|
||||
confirm?: string;
|
||||
}
|
||||
|
||||
const DEFAULT_STATUSES: StatusMeta[] = [
|
||||
{ id: "queued", label: "Queued", kind: "idle" },
|
||||
{ id: "running", label: "Working", kind: "info" },
|
||||
{ id: "waiting_human", label: "Waiting for you", kind: "warn", needs_you: true },
|
||||
{ id: "pr_open", label: "In review", kind: "ok" },
|
||||
{ id: "merged", label: "Merged", kind: "ok" },
|
||||
{ id: "parked", label: "Parked", kind: "warn", needs_you: true },
|
||||
{ id: "dead", label: "Stopped (too many retries)", kind: "danger" },
|
||||
{ id: "rejected", label: "Rejected", kind: "danger" },
|
||||
{ id: "closed_wont_do", label: "Won't do", kind: "idle" },
|
||||
];
|
||||
|
||||
const DEFAULT_ACTIONS: ActionMeta[] = [
|
||||
{ id: "cancel", label: "Cancel", kind: "quiet", confirm: `Cancel "{title}"? This closes the forge issue.` },
|
||||
{ id: "stop", label: "Stop", kind: "primary", confirm: `Stop "{title}"? Recoverable work will remain parked.` },
|
||||
{ id: "approve", label: "Approve", kind: "primary" },
|
||||
{ id: "reject", label: "Reject", kind: "quiet", confirm: `Reject "{title}"? This closes the forge issue.` },
|
||||
{ id: "retry", label: "Retry", kind: "primary" },
|
||||
{ id: "abandon", label: "Abandon", kind: "quiet", confirm: `Abandon "{title}"? This closes the forge issue.` },
|
||||
{ id: "archive", label: "Archive", kind: "quiet", confirm: `Archive the local record for "{title}"?` },
|
||||
{ id: "open_pr", label: "Open PR", kind: "link" },
|
||||
{ id: "open_issue", label: "Open issue", kind: "link" },
|
||||
];
|
||||
|
||||
const statuses = shallowRef<StatusMeta[]>([...DEFAULT_STATUSES]);
|
||||
const actions = shallowRef<ActionMeta[]>([...DEFAULT_ACTIONS]);
|
||||
|
||||
const statusById = computed(() => new Map(statuses.value.map((s) => [s.id, s])));
|
||||
const actionById = computed(() => new Map(actions.value.map((a) => [a.id, a])));
|
||||
|
||||
// loadTaskMeta upgrades the dashboard from the server catalog. It never throws:
|
||||
// a failed fetch keeps the defaults so the UI still renders.
|
||||
export async function loadTaskMeta(): Promise<void> {
|
||||
try {
|
||||
const data = await api.taskMeta<{ statuses?: StatusMeta[]; actions?: ActionMeta[] } | null>();
|
||||
if (Array.isArray(data?.statuses)) statuses.value = data.statuses;
|
||||
if (Array.isArray(data?.actions)) actions.value = data.actions;
|
||||
} catch {
|
||||
// archied unreachable or not yet serving this route; keep the defaults.
|
||||
}
|
||||
}
|
||||
|
||||
/** statusLabel is the human-readable name for a lifecycle status. */
|
||||
export function statusLabel(id: string): string {
|
||||
return statusById.value.get(id)?.label || id || "Unknown";
|
||||
}
|
||||
|
||||
/** statusKind is the pill severity token (idle, info, ok, warn, danger). */
|
||||
export function statusKind(id: string): string {
|
||||
return statusById.value.get(id)?.kind || "idle";
|
||||
}
|
||||
|
||||
/** statusList returns every known lifecycle status in display order. */
|
||||
export function statusList(): StatusMeta[] {
|
||||
return statuses.value;
|
||||
}
|
||||
|
||||
/** statusIds returns every known lifecycle status id, in display order. */
|
||||
export function statusIds(): string[] {
|
||||
return statuses.value.map((s) => s.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* attentionStatusIds is the set of statuses that count toward the "Needs you"
|
||||
* filter (work that is waiting on a human).
|
||||
*/
|
||||
export function attentionStatusIds(): Set<string> {
|
||||
return new Set(statuses.value.filter((s) => s.needs_you).map((s) => s.id));
|
||||
}
|
||||
|
||||
/**
|
||||
* actionFor returns the presentation metadata for an operator control, or null
|
||||
* if the backend has never seen it.
|
||||
*/
|
||||
export function actionFor(id: string): ActionMeta | null {
|
||||
return actionById.value.get(id) || null;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* randomUUID keeps client-generated identifiers working on HTTP deployments.
|
||||
* crypto.randomUUID is restricted to secure contexts, while getRandomValues
|
||||
* remains available on the older browsers and plain-HTTP origins Archie
|
||||
* supports.
|
||||
*/
|
||||
export function randomUUID(cryptoAPI: Crypto | undefined = globalThis.crypto): string {
|
||||
if (typeof cryptoAPI?.randomUUID === "function") return cryptoAPI.randomUUID();
|
||||
|
||||
const bytes = new Uint8Array(16);
|
||||
if (typeof cryptoAPI?.getRandomValues === "function") {
|
||||
cryptoAPI.getRandomValues(bytes);
|
||||
} else {
|
||||
for (let index = 0; index < bytes.length; index += 1) {
|
||||
bytes[index] = Math.floor(Math.random() * 256);
|
||||
}
|
||||
}
|
||||
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
||||
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
||||
const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
|
||||
return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
||||
}
|
||||
@@ -4,6 +4,9 @@ import { createApp } from "vue";
|
||||
|
||||
import App from "./App.vue";
|
||||
import router from "./router";
|
||||
// One stylesheet: the design tokens, and the element defaults that have no
|
||||
// component to live in (the canvas, the focus floor, the motion preference).
|
||||
// Everything else is Tailwind on the component that owns it.
|
||||
import "./style.css";
|
||||
|
||||
createApp(App).use(router).mount("#app");
|
||||
@@ -4,6 +4,14 @@
|
||||
@import "tw-animate-css";
|
||||
@import "shadcn-vue/tailwind.css";
|
||||
|
||||
/* ui/dist is committed, so nothing ignores it and Tailwind's automatic content
|
||||
detection scans it. That makes every build an input to the next one: class
|
||||
strings left in the committed bundle generate utilities for classes nothing
|
||||
references any more, so rebuilding an unchanged tree produced a different
|
||||
bundle and tools/uidist.sh's freshness check failed on the first build after
|
||||
every change. The bundle is generated, never a source. */
|
||||
@source not "../dist";
|
||||
|
||||
/* The theme is an attribute on <html>, not a class, so the inline script in
|
||||
index.html can set it before the first paint and a reload does not flash the
|
||||
wrong palette. */
|
||||
@@ -220,5 +228,42 @@
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
@apply font-sans;
|
||||
/* The luminous canvas the shell floats on. Large, off-axis and
|
||||
low-frequency, so it lights the workspace rather than competing with
|
||||
it, and fixed so the surface above reads as glass rather than a
|
||||
scrolling image. The padding is the margin the frame sits inside. */
|
||||
background:
|
||||
radial-gradient(70rem 40rem at 8% -10%, var(--wash-a), transparent 62%),
|
||||
radial-gradient(56rem 34rem at 92% 4%, var(--wash-b), transparent 58%),
|
||||
radial-gradient(48rem 30rem at 50% 108%, var(--wash-c), transparent 60%),
|
||||
var(--background);
|
||||
background-attachment: fixed;
|
||||
padding: 1rem;
|
||||
}
|
||||
/* The focus floor. A component may style its own focus state; this
|
||||
guarantees that nothing is ever focused and invisible for a keyboard
|
||||
user. `:focus-visible` rather than `:focus` so a mouse click does not
|
||||
draw a ring around what was clicked. */
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
/* The frame is a desktop affordance: below this width the workspace goes
|
||||
edge to edge, because a rounded card inset on a phone wastes the only
|
||||
axis that matters. */
|
||||
@media (max-width: 900px) {
|
||||
body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
/* An accessibility invariant, not a nicety: nothing animates for someone
|
||||
who has asked it not to. */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user