From b2f06101172ad71b99a3215f706c6757659fbd02 Mon Sep 17 00:00:00 2001 From: Nitin Goyal Date: Mon, 23 Nov 2026 19:56:21 +0530 Subject: [PATCH 1/3] build: stop committing the admin UI bundle; build it in CI, Docker and releases The built admin UI (internal/admin/ui, about 600 KB) was committed so a plain go build had it, which made nearly every UI change conflict with the next. It is now ignored, except internal/admin/ui/.keep (restored by web/public/.keep on each build) so go:embed still compiles. - Dockerfile: a node:24 stage builds the UI, copied in before go build. - GoReleaser: make web in the before hooks. - CI: the console's own Go job (like the org go-ci workflow, same pinned golangci-lint) builds the UI first; the stale-bundle check is gone. - Makefile: build, test, test-db and lint build the UI when it's missing. - A binary built without the UI starts and serves a page saying how to build it, instead of panicking; the admin tests say to run make web. Co-Authored-By: Claude Opus 5.5 --- .dockerignore | 2 + .github/workflows/ci.yml | 32 +- .gitignore | 4 + .goreleaser.yaml | 2 + AGENTS.md | 8 +- Dockerfile | 9 + Makefile | 16 +- README.md | 6 +- internal/admin/handlers.go | 13 +- internal/admin/main_test.go | 17 + internal/admin/ui/.keep | 0 internal/admin/ui/assets/favicon.svg | 5 - internal/admin/ui/assets/index-CeCgkiRQ.js | 335 -------------------- internal/admin/ui/assets/index-CkmRsLYX.css | 1 - internal/admin/ui/assets/theme.js | 15 - internal/admin/ui/index.html | 18 -- web/public/.keep | 0 17 files changed, 85 insertions(+), 398 deletions(-) create mode 100644 internal/admin/main_test.go create mode 100644 internal/admin/ui/.keep delete mode 100644 internal/admin/ui/assets/favicon.svg delete mode 100644 internal/admin/ui/assets/index-CeCgkiRQ.js delete mode 100644 internal/admin/ui/assets/index-CkmRsLYX.css delete mode 100644 internal/admin/ui/assets/theme.js delete mode 100644 internal/admin/ui/index.html create mode 100644 web/public/.keep diff --git a/.dockerignore b/.dockerignore index fd2f3e6..2a876c3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,3 +7,5 @@ dist/ *.pem console.yaml web/node_modules/ +internal/admin/ui/assets/ +internal/admin/ui/index.html diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 633d3da..1045225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,24 +7,34 @@ on: branches: [ "main" ] jobs: + # Like the org's go-ci workflow, with the admin UI built first: it isn't + # committed, and the binary (and the admin tests) embed it. ci: - uses: divmora/.github/.github/workflows/go-ci.yml@main - with: - go-version: '1.27' - - # The admin UI's build output is committed (the binary embeds it), so - # check it type-checks and matches web/src. - web: + name: Code Quality & Tests runs-on: ubuntu-latest permissions: contents: read + env: + # renovate: datasource=github-releases depName=golangci/golangci-lint + GOLANGCI_LINT_VERSION: v2.15.0 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: node-version: '24' cache: npm cache-dependency-path: web/package-lock.json - - run: make web - - name: Committed build is up to date - run: git diff --exit-code -- internal/admin/ui || (echo "::error::run 'make web' and commit internal/admin/ui" && exit 1) + - name: Build the admin UI (type-checks it too) + run: make web + - uses: actions/setup-go@v7 + with: + go-version: '1.27' + cache: true + - name: Run Linters + uses: golangci/golangci-lint-action@v9 + with: + version: ${{ env.GOLANGCI_LINT_VERSION }} + install-mode: goinstall + args: --timeout=5m + - name: Run Unit Tests + run: go test ./... -v diff --git a/.gitignore b/.gitignore index b9875c8..7a1d63b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,7 @@ coverage.html *.kubeconfig web/node_modules/ web/dist/ +# The admin UI is built from web/ (make web) and embedded at build time; +# only the placeholder that keeps go:embed compiling is committed. +/internal/admin/ui/* +!/internal/admin/ui/.keep diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3952909..fd1ddfa 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -6,6 +6,8 @@ before: hooks: - go mod tidy - go mod verify + # The admin UI isn't committed: build it so the binaries embed it. + - make web builds: - id: console diff --git a/AGENTS.md b/AGENTS.md index 1d147ff..29d2b3f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,9 +19,10 @@ internal/settings/ runtime settings: config file seeds the database, admin pa internal/server/ webhooks (GitHub, GitLab, Bitbucket), command parsing, queue + history, jobs.go (targets, per-job config/secrets), status dashboard internal/admin/ OIDC sign-in (code flow + PKCE + nonce), DB sessions, CSRF, admin JSON API; - embeds ui/ (the built admin app, committed so `go build` needs no Node) + embeds ui/ (the built admin app; not committed: only ui/.keep is, and a + build without it serves a "UI not built" page) web/ admin app source: React + TypeScript + Vite. `make web` builds it into - internal/admin/ui; CI fails if the committed build is stale + internal/admin/ui; the Dockerfile, GoReleaser (before hook) and CI build it internal/store/ PostgreSQL: repos, overrides, jobs + results, sessions, audit, model profiles, settings; migrations under an advisory lock. storetest/ = fake ``` @@ -97,7 +98,8 @@ Changing this contract means changing the bot's CLI too; keep them in step. ## Admin UI React + TypeScript + Vite, styled with **Tailwind CSS v4 and shadcn/ui** (Radix primitives, Lucide -icons). Change `web/src`, run `make web`, commit both `web/` and `internal/admin/ui`. +icons). Change `web/src` and run `make web` to see it in a local build; commit only `web/` +(`internal/admin/ui` is ignored, except `.keep`, which `web/public/.keep` restores on each build). - `web/src/components/ui/` holds shadcn components (`npx shadcn@ add `). After adding one, check its imports: utilities come from `@/lib/utils`. The CLI has written `from "cn"` and diff --git a/Dockerfile b/Dockerfile index 52f3994..9885410 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,14 @@ # can bump it. FROM ghcr.io/divmora/code-review-bot:0.5.0 AS bot +# The admin UI (web/) is built here and embedded by the Go build below. +FROM --platform=$BUILDPLATFORM node:24-bookworm-slim AS web +WORKDIR /src/web +COPY web/package.json web/package-lock.json ./ +RUN npm ci --no-audit --no-fund +COPY web/ ./ +RUN npm run build + FROM --platform=$BUILDPLATFORM golang:1.27-bookworm AS builder ARG TARGETOS ARG TARGETARCH @@ -13,6 +21,7 @@ WORKDIR /src COPY go.mod go.sum ./ RUN go mod download COPY . . +COPY --from=web /src/internal/admin/ui ./internal/admin/ui RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ go build -trimpath -ldflags "-s -w -X github.com/divmora/code-review-console/internal/version.Version=${VERSION}" \ -o /out/code-review-console ./cmd/console diff --git a/Makefile b/Makefile index d81aa84..de5f249 100644 --- a/Makefile +++ b/Makefile @@ -7,25 +7,31 @@ LDFLAGS := -s -w -X github.com/divmora/code-review-console/internal/version.Vers BOT_DIR ?= ../code-review-bot # Admin UI: web/ (React + Vite) builds into internal/admin/ui, which the -# binary embeds. The build output is committed so `go build` alone works. +# binary embeds. The build output isn't committed: build, test and lint +# build it first when it's missing (`make web` rebuilds it after changes). +UI_INDEX := internal/admin/ui/index.html + web: @cd web && npm ci --no-audit --no-fund && npm run build +$(UI_INDEX): + @$(MAKE) --no-print-directory web + # Vite dev server on :5173, proxying the API to a console on :8080. web-dev: @cd web && npm run dev -build: +build: $(UI_INDEX) @go build -trimpath -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/console clean: @rm -rf bin/ dist/ coverage.out coverage.html -test: +test: $(UI_INDEX) @go test -race ./... # PostgreSQL integration tests against a throwaway container. -test-db: +test-db: $(UI_INDEX) @docker run -d --rm --name crc-test-pg -e POSTGRES_PASSWORD=test -e POSTGRES_DB=console -p 127.0.0.1:55434:5432 postgres:17 >/dev/null @until docker exec crc-test-pg pg_isready -U postgres -q; do sleep 1; done @CODEREVIEW_TEST_DATABASE_URL=postgres://postgres:test@127.0.0.1:55434/console go test -race -count=1 ./... ; s=$$?; docker stop crc-test-pg >/dev/null; exit $$s @@ -39,7 +45,7 @@ test-e2e: fmt: @gofmt -w . -lint: +lint: $(UI_INDEX) @golangci-lint run ./... || go vet ./... docker-build: diff --git a/README.md b/README.md index a42f562..0f0a0b6 100644 --- a/README.md +++ b/README.md @@ -125,10 +125,10 @@ Provider keys and cloud credentials (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEM ## Development ```bash -make build # bin/code-review-console -make web # rebuild the admin UI (web/ → internal/admin/ui, commit the result) +make build # bin/code-review-console (builds the admin UI first if it's missing; needs Node.js) +make web # rebuild the admin UI (web/ → internal/admin/ui, embedded; not committed) make web-dev # admin UI dev server on :5173, proxying to a console on :8080 -make test # unit tests +make test # unit tests (the admin tests need the built UI; make builds it) make test-db # + PostgreSQL integration tests (Docker) make test-e2e # + end-to-end with the real codereview CLI (local + docker executors) ``` diff --git a/internal/admin/handlers.go b/internal/admin/handlers.go index 9a7e80d..f298ce9 100644 --- a/internal/admin/handlers.go +++ b/internal/admin/handlers.go @@ -31,7 +31,9 @@ import ( "github.com/divmora/code-review-console/internal/version" ) -// ui is the admin single-page app, built from web/ by `make web`. +// ui is the admin single-page app, built from web/ by `make web` before +// `go build` (the Dockerfile, GoReleaser and CI do). It isn't committed: +// a fresh checkout has only ui/.keep, and the panel then says to build it. // //go:embed all:ui var uiFS embed.FS @@ -66,11 +68,18 @@ func (f filesOnly) Open(name string) (fs.File, error) { func mustRead(name string) []byte { b, err := uiFS.ReadFile(name) if err != nil { - panic("admin UI not built: " + err.Error() + " (run make web)") + return uiMissing } return b } +// uiMissing is served for the panel when the binary was built without the +// admin UI (go build from a checkout, before make web). +var uiMissing = []byte(`Admin UI not built +

The admin UI isn't in this build

This binary was built without the admin panel's web app. +Run make web (needs Node.js) and then make build, or use a release binary or the Docker image. +The API and webhooks work without it.

`) + // uiCSP allows only the app's own files: no inline scripts or styles. const uiCSP = "default-src 'none'; script-src 'self'; style-src 'self'; connect-src 'self'; img-src 'self' data:; base-uri 'none'; form-action 'none'; frame-ancestors 'none'" diff --git a/internal/admin/main_test.go b/internal/admin/main_test.go new file mode 100644 index 0000000..9401af0 --- /dev/null +++ b/internal/admin/main_test.go @@ -0,0 +1,17 @@ +package admin + +import ( + "fmt" + "os" + "testing" +) + +// The admin tests serve the real UI, which isn't committed: say how to +// build it instead of failing test by test. +func TestMain(m *testing.M) { + if _, err := uiFS.ReadFile("ui/index.html"); err != nil { + fmt.Fprintln(os.Stderr, "admin tests need the admin UI: run `make web` (or `make test`) first") + os.Exit(1) + } + os.Exit(m.Run()) +} diff --git a/internal/admin/ui/.keep b/internal/admin/ui/.keep new file mode 100644 index 0000000..e69de29 diff --git a/internal/admin/ui/assets/favicon.svg b/internal/admin/ui/assets/favicon.svg deleted file mode 100644 index d4b7f29..0000000 --- a/internal/admin/ui/assets/favicon.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/internal/admin/ui/assets/index-CeCgkiRQ.js b/internal/admin/ui/assets/index-CeCgkiRQ.js deleted file mode 100644 index d051186..0000000 --- a/internal/admin/ui/assets/index-CeCgkiRQ.js +++ /dev/null @@ -1,335 +0,0 @@ -var Sm=t=>{throw TypeError(t)};var _m=(t,o,s)=>o.has(t)||Sm("Cannot "+s);var kt=(t,o,s)=>(_m(t,o,"read from private field"),s?s.call(t):o.get(t)),Nm=(t,o,s)=>o.has(t)?Sm("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(t):o.set(t,s),yu=(t,o,s,a)=>(_m(t,o,"write to private field"),a?a.call(t,s):o.set(t,s),s);function Nb(t,o){for(var s=0;sa[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(l){if(l.ep)return;l.ep=!0;const u=s(l);fetch(l.href,u)}})();function Eb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wu={exports:{}},ri={},bu={exports:{}},De={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Em;function Rb(){if(Em)return De;Em=1;var t=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),x=Symbol.iterator;function C(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,b={};function j(O,G,ue){this.props=O,this.context=G,this.refs=b,this.updater=ue||y}j.prototype.isReactComponent={},j.prototype.setState=function(O,G){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,G,"setState")},j.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function S(){}S.prototype=j.prototype;function R(O,G,ue){this.props=O,this.context=G,this.refs=b,this.updater=ue||y}var N=R.prototype=new S;N.constructor=R,_(N,j.prototype),N.isPureReactComponent=!0;var E=Array.isArray,P=Object.prototype.hasOwnProperty,L={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function A(O,G,ue){var we,I={},K=null,ge=null;if(G!=null)for(we in G.ref!==void 0&&(ge=G.ref),G.key!==void 0&&(K=""+G.key),G)P.call(G,we)&&!F.hasOwnProperty(we)&&(I[we]=G[we]);var Ce=arguments.length-2;if(Ce===1)I.children=ue;else if(1>>1,G=H[O];if(0>>1;Ol(I,$))Kl(ge,I)?(H[O]=ge,H[K]=$,O=K):(H[O]=I,H[we]=$,O=we);else if(Kl(ge,$))H[O]=ge,H[K]=$,O=K;else break e}}return J}function l(H,J){var $=H.sortIndex-J.sortIndex;return $!==0?$:H.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var g=[],v=[],w=1,x=null,C=3,y=!1,_=!1,b=!1,j=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(H){for(var J=s(v);J!==null;){if(J.callback===null)a(v);else if(J.startTime<=H)a(v),J.sortIndex=J.expirationTime,o(g,J);else break;J=s(v)}}function E(H){if(b=!1,N(H),!_)if(s(g)!==null)_=!0,ae(P);else{var J=s(v);J!==null&&oe(E,J.startTime-H)}}function P(H,J){_=!1,b&&(b=!1,S(A),A=-1),y=!0;var $=C;try{for(N(J),x=s(g);x!==null&&(!(x.expirationTime>J)||H&&!z());){var O=x.callback;if(typeof O=="function"){x.callback=null,C=x.priorityLevel;var G=O(x.expirationTime<=J);J=t.unstable_now(),typeof G=="function"?x.callback=G:x===s(g)&&a(g),N(J)}else a(g);x=s(g)}if(x!==null)var ue=!0;else{var we=s(v);we!==null&&oe(E,we.startTime-J),ue=!1}return ue}finally{x=null,C=$,y=!1}}var L=!1,F=null,A=-1,q=5,B=-1;function z(){return!(t.unstable_now()-BH||125O?(H.sortIndex=$,o(v,H),s(g)===null&&H===s(v)&&(b?(S(A),A=-1):b=!0,oe(E,$-O))):(H.sortIndex=G,o(g,H),_||y||(_=!0,ae(P))),H},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(H){var J=C;return function(){var $=C;C=J;try{return H.apply(this,arguments)}finally{C=$}}}})(Cu)),Cu}var Om;function Mb(){return Om||(Om=1,ku.exports=Ob()),ku.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Mm;function Ab(){if(Mm)return Ft;Mm=1;var t=Sd(),o=Mb();function s(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,v=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,w={},x={};function C(e){return g.call(x,e)?!0:g.call(w,e)?!1:v.test(e)?x[e]=!0:(w[e]=!0,!1)}function y(e,n,i,c){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _(e,n,i,c){if(n===null||typeof n>"u"||y(e,n,i,c))return!0;if(c)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function b(e,n,i,c,f,p,k){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=f,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=k}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){j[e]=new b(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];j[n]=new b(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){j[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){j[e]=new b(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){j[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){j[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){j[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){j[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){j[e]=new b(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function R(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(S,R);j[n]=new b(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(S,R);j[n]=new b(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(S,R);j[n]=new b(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){j[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),j.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){j[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function N(e,n,i,c){var f=j.hasOwnProperty(n)?j[n]:null;(f!==null?f.type!==0:c||!(2T||f[k]!==p[T]){var D=` -`+f[k].replace(" at new "," at ");return e.displayName&&D.includes("")&&(D=D.replace("",e.displayName)),D}while(1<=k&&0<=T);break}}}finally{ue=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?G(e):""}function I(e){switch(e.tag){case 5:return G(e.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return e=we(e.type,!1),e;case 11:return e=we(e.type.render,!1),e;case 1:return e=we(e.type,!0),e;default:return""}}function K(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case F:return"Fragment";case L:return"Portal";case q:return"Profiler";case A:return"StrictMode";case se:return"Suspense";case he:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case z:return(e.displayName||"Context")+".Consumer";case B:return(e._context.displayName||"Context")+".Provider";case Z:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ye:return n=e.displayName||null,n!==null?n:K(e.type)||"Memo";case ae:n=e._payload,e=e._init;try{return K(e(n))}catch{}}return null}function ge(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(n);case 8:return n===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function Ce(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function be(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ye(e){var n=be(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,p=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(k){c=""+k,p.call(this,k)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(k){c=""+k},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ct(e){e._valueTracker||(e._valueTracker=Ye(e))}function Bt(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),c="";return e&&(c=be(e)?e.checked?"true":"false":e.value),e=c,e!==i?(n.setValue(e),!0):!1}function yt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ut(e,n){var i=n.checked;return $({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function gr(e,n){var i=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;i=Ce(n.value!=null?n.value:i),e._wrapperState={initialChecked:c,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Un(e,n){n=n.checked,n!=null&&N(e,"checked",n,!1)}function wt(e,n){Un(e,n);var i=Ce(n.value),c=n.type;if(i!=null)c==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?xs(e,n.type,i):n.hasOwnProperty("defaultValue")&&xs(e,n.type,Ce(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Ci(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function xs(e,n,i){(n!=="number"||yt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var no=Array.isArray;function vr(e,n,i,c){if(e=e.options,n){n={};for(var f=0;f"+n.valueOf().toString()+"",n=Si.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function ys(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var ws={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Tw=["Webkit","ms","Moz","O"];Object.keys(ws).forEach(function(e){Tw.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),ws[n]=ws[e]})});function $f(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||ws.hasOwnProperty(e)&&ws[e]?(""+n).trim():n+"px"}function Uf(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var c=i.indexOf("--")===0,f=$f(i,n[i],c);i==="float"&&(i="cssFloat"),c?e.setProperty(i,f):e[i]=f}}var Dw=$({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Tl(e,n){if(n){if(Dw[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(s(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(s(61))}if(n.style!=null&&typeof n.style!="object")throw Error(s(62))}}function Dl(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ol=null;function Ml(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Al=null,Eo=null,Ro=null;function Bf(e){if(e=Bs(e)){if(typeof Al!="function")throw Error(s(280));var n=e.stateNode;n&&(n=qi(n),Al(e.stateNode,e.type,n))}}function Wf(e){Eo?Ro?Ro.push(e):Ro=[e]:Eo=e}function Vf(){if(Eo){var e=Eo,n=Ro;if(Ro=Eo=null,Bf(e),n)for(e=0;e>>=0,e===0?32:31-(Ww(e)/Vw|0)|0}var Pi=64,Ti=4194304;function Cs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Di(e,n){var i=e.pendingLanes;if(i===0)return 0;var c=0,f=e.suspendedLanes,p=e.pingedLanes,k=i&268435455;if(k!==0){var T=k&~f;T!==0?c=Cs(T):(p&=k,p!==0&&(c=Cs(p)))}else k=i&~f,k!==0?c=Cs(k):p!==0&&(c=Cs(p));if(c===0)return 0;if(n!==0&&n!==c&&(n&f)===0&&(f=c&-c,p=n&-n,f>=p||f===16&&(p&4194240)!==0))return n;if((c&4)!==0&&(c|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=c;0i;i++)n.push(e);return n}function Ss(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-dn(n),e[n]=i}function qw(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var c=e.eventTimes;for(e=e.expirationTimes;0=Os),xh=" ",yh=!1;function wh(e,n){switch(e){case"keyup":return j0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Do=!1;function C0(e,n){switch(e){case"compositionend":return bh(n);case"keypress":return n.which!==32?null:(yh=!0,xh);case"textInput":return e=n.data,e===xh&&yh?null:e;default:return null}}function S0(e,n){if(Do)return e==="compositionend"||!Zl&&wh(e,n)?(e=fh(),Ii=Kl=kr=null,Do=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:i,offset:n-e};e=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Eh(i)}}function Ph(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Ph(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Th(){for(var e=window,n=yt();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=yt(e.document)}return n}function nc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function M0(e){var n=Th(),i=e.focusedElem,c=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&Ph(i.ownerDocument.documentElement,i)){if(c!==null&&nc(i)){if(n=c.start,e=c.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var f=i.textContent.length,p=Math.min(c.start,f);c=c.end===void 0?p:Math.min(c.end,f),!e.extend&&p>c&&(f=c,c=p,p=f),f=Rh(i,p);var k=Rh(i,c);f&&k&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==k.node||e.focusOffset!==k.offset)&&(n=n.createRange(),n.setStart(f.node,f.offset),e.removeAllRanges(),p>c?(e.addRange(n),e.extend(k.node,k.offset)):(n.setEnd(k.node,k.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i=document.documentMode,Oo=null,rc=null,Is=null,oc=!1;function Dh(e,n,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;oc||Oo==null||Oo!==yt(c)||(c=Oo,"selectionStart"in c&&nc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Is&&Ls(Is,c)||(Is=c,c=Hi(rc,"onSelect"),0zo||(e.current=gc[zo],gc[zo]=null,zo--)}function Fe(e,n){zo++,gc[zo]=e.current,e.current=n}var Nr={},St=_r(Nr),Mt=_r(!1),so=Nr;function Fo(e,n){var i=e.type.contextTypes;if(!i)return Nr;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var f={},p;for(p in i)f[p]=n[p];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=f),f}function At(e){return e=e.childContextTypes,e!=null}function Yi(){We(Mt),We(St)}function Kh(e,n,i){if(St.current!==Nr)throw Error(s(168));Fe(St,n),Fe(Mt,i)}function qh(e,n,i){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return i;c=c.getChildContext();for(var f in c)if(!(f in n))throw Error(s(108,ge(e)||"Unknown",f));return $({},i,c)}function Qi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Nr,so=St.current,Fe(St,e),Fe(Mt,Mt.current),!0}function Yh(e,n,i){var c=e.stateNode;if(!c)throw Error(s(169));i?(e=qh(e,n,so),c.__reactInternalMemoizedMergedChildContext=e,We(Mt),We(St),Fe(St,e)):We(Mt),Fe(Mt,i)}var Wn=null,Xi=!1,vc=!1;function Qh(e){Wn===null?Wn=[e]:Wn.push(e)}function G0(e){Xi=!0,Qh(e)}function Er(){if(!vc&&Wn!==null){vc=!0;var e=0,n=Ie;try{var i=Wn;for(Ie=1;e>=k,f-=k,Vn=1<<32-dn(n)+f|i<Ee?(vt=_e,_e=null):vt=_e.sibling;var Ae=Y(U,_e,W[Ee],te);if(Ae===null){_e===null&&(_e=vt);break}e&&_e&&Ae.alternate===null&&n(U,_e),M=p(Ae,M,Ee),Se===null?xe=Ae:Se.sibling=Ae,Se=Ae,_e=vt}if(Ee===W.length)return i(U,_e),Ve&&ao(U,Ee),xe;if(_e===null){for(;EeEe?(vt=_e,_e=null):vt=_e.sibling;var Ir=Y(U,_e,Ae.value,te);if(Ir===null){_e===null&&(_e=vt);break}e&&_e&&Ir.alternate===null&&n(U,_e),M=p(Ir,M,Ee),Se===null?xe=Ir:Se.sibling=Ir,Se=Ir,_e=vt}if(Ae.done)return i(U,_e),Ve&&ao(U,Ee),xe;if(_e===null){for(;!Ae.done;Ee++,Ae=W.next())Ae=X(U,Ae.value,te),Ae!==null&&(M=p(Ae,M,Ee),Se===null?xe=Ae:Se.sibling=Ae,Se=Ae);return Ve&&ao(U,Ee),xe}for(_e=c(U,_e);!Ae.done;Ee++,Ae=W.next())Ae=le(_e,U,Ee,Ae.value,te),Ae!==null&&(e&&Ae.alternate!==null&&_e.delete(Ae.key===null?Ee:Ae.key),M=p(Ae,M,Ee),Se===null?xe=Ae:Se.sibling=Ae,Se=Ae);return e&&_e.forEach(function(_b){return n(U,_b)}),Ve&&ao(U,Ee),xe}function nt(U,M,W,te){if(typeof W=="object"&&W!==null&&W.type===F&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case P:e:{for(var xe=W.key,Se=M;Se!==null;){if(Se.key===xe){if(xe=W.type,xe===F){if(Se.tag===7){i(U,Se.sibling),M=f(Se,W.props.children),M.return=U,U=M;break e}}else if(Se.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===ae&&np(xe)===Se.type){i(U,Se.sibling),M=f(Se,W.props),M.ref=Ws(U,Se,W),M.return=U,U=M;break e}i(U,Se);break}else n(U,Se);Se=Se.sibling}W.type===F?(M=go(W.props.children,U.mode,te,W.key),M.return=U,U=M):(te=Sa(W.type,W.key,W.props,null,U.mode,te),te.ref=Ws(U,M,W),te.return=U,U=te)}return k(U);case L:e:{for(Se=W.key;M!==null;){if(M.key===Se)if(M.tag===4&&M.stateNode.containerInfo===W.containerInfo&&M.stateNode.implementation===W.implementation){i(U,M.sibling),M=f(M,W.children||[]),M.return=U,U=M;break e}else{i(U,M);break}else n(U,M);M=M.sibling}M=pu(W,U.mode,te),M.return=U,U=M}return k(U);case ae:return Se=W._init,nt(U,M,Se(W._payload),te)}if(no(W))return pe(U,M,W,te);if(J(W))return me(U,M,W,te);ta(U,W)}return typeof W=="string"&&W!==""||typeof W=="number"?(W=""+W,M!==null&&M.tag===6?(i(U,M.sibling),M=f(M,W),M.return=U,U=M):(i(U,M),M=hu(W,U.mode,te),M.return=U,U=M),k(U)):i(U,M)}return nt}var Wo=rp(!0),op=rp(!1),na=_r(null),ra=null,Vo=null,kc=null;function Cc(){kc=Vo=ra=null}function Sc(e){var n=na.current;We(na),e._currentValue=n}function _c(e,n,i){for(;e!==null;){var c=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),e===i)break;e=e.return}}function Ho(e,n){ra=e,kc=Vo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Lt=!0),e.firstContext=null)}function en(e){var n=e._currentValue;if(kc!==e)if(e={context:e,memoizedValue:n,next:null},Vo===null){if(ra===null)throw Error(s(308));Vo=e,ra.dependencies={lanes:0,firstContext:e}}else Vo=Vo.next=e;return n}var lo=null;function Nc(e){lo===null?lo=[e]:lo.push(e)}function sp(e,n,i,c){var f=n.interleaved;return f===null?(i.next=i,Nc(n)):(i.next=f.next,f.next=i),n.interleaved=i,Gn(e,c)}function Gn(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Rr=!1;function Ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ip(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Pr(e,n,i){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(Me&2)!==0){var f=c.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),c.pending=n,Gn(e,i)}return f=c.interleaved,f===null?(n.next=n,Nc(c)):(n.next=f.next,f.next=n),c.interleaved=n,Gn(e,i)}function oa(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Bl(e,i)}}function ap(e,n){var i=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var f=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var k={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?f=p=k:p=p.next=k,i=i.next}while(i!==null);p===null?f=p=n:p=p.next=n}else f=p=n;i={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:c.shared,effects:c.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function sa(e,n,i,c){var f=e.updateQueue;Rr=!1;var p=f.firstBaseUpdate,k=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var D=T,V=D.next;D.next=null,k===null?p=V:k.next=V,k=D;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,T=Q.lastBaseUpdate,T!==k&&(T===null?Q.firstBaseUpdate=V:T.next=V,Q.lastBaseUpdate=D))}if(p!==null){var X=f.baseState;k=0,Q=V=D=null,T=p;do{var Y=T.lane,le=T.eventTime;if((c&Y)===Y){Q!==null&&(Q=Q.next={eventTime:le,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var pe=e,me=T;switch(Y=n,le=i,me.tag){case 1:if(pe=me.payload,typeof pe=="function"){X=pe.call(le,X,Y);break e}X=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=me.payload,Y=typeof pe=="function"?pe.call(le,X,Y):pe,Y==null)break e;X=$({},X,Y);break e;case 2:Rr=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,Y=f.effects,Y===null?f.effects=[T]:Y.push(T))}else le={eventTime:le,lane:Y,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Q===null?(V=Q=le,D=X):Q=Q.next=le,k|=Y;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;Y=T,T=Y.next,Y.next=null,f.lastBaseUpdate=Y,f.shared.pending=null}}while(!0);if(Q===null&&(D=X),f.baseState=D,f.firstBaseUpdate=V,f.lastBaseUpdate=Q,n=f.shared.interleaved,n!==null){f=n;do k|=f.lane,f=f.next;while(f!==n)}else p===null&&(f.shared.lanes=0);fo|=k,e.lanes=k,e.memoizedState=X}}function lp(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;ni?i:4,e(!0);var c=Oc.transition;Oc.transition={};try{e(!1),n()}finally{Ie=i,Oc.transition=c}}function Np(){return tn().memoizedState}function Q0(e,n,i){var c=Mr(e);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},Ep(e))Rp(n,i);else if(i=sp(e,n,i,c),i!==null){var f=Ot();vn(i,e,c,f),Pp(i,n,c)}}function X0(e,n,i){var c=Mr(e),f={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(Ep(e))Rp(n,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var k=n.lastRenderedState,T=p(k,i);if(f.hasEagerState=!0,f.eagerState=T,fn(T,k)){var D=n.interleaved;D===null?(f.next=f,Nc(n)):(f.next=D.next,D.next=f),n.interleaved=f;return}}catch{}finally{}i=sp(e,n,f,c),i!==null&&(f=Ot(),vn(i,e,c,f),Pp(i,n,c))}}function Ep(e){var n=e.alternate;return e===Xe||n!==null&&n===Xe}function Rp(e,n){Ks=la=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Pp(e,n,i){if((i&4194240)!==0){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Bl(e,i)}}var da={readContext:en,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useInsertionEffect:_t,useLayoutEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useMutableSource:_t,useSyncExternalStore:_t,useId:_t,unstable_isNewReconciler:!1},J0={readContext:en,useCallback:function(e,n){return Nn().memoizedState=[e,n===void 0?null:n],e},useContext:en,useEffect:yp,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,ca(4194308,4,jp.bind(null,n,e),i)},useLayoutEffect:function(e,n){return ca(4194308,4,e,n)},useInsertionEffect:function(e,n){return ca(4,2,e,n)},useMemo:function(e,n){var i=Nn();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var c=Nn();return n=i!==void 0?i(n):n,c.memoizedState=c.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},c.queue=e,e=e.dispatch=Q0.bind(null,Xe,e),[c.memoizedState,e]},useRef:function(e){var n=Nn();return e={current:e},n.memoizedState=e},useState:vp,useDebugValue:$c,useDeferredValue:function(e){return Nn().memoizedState=e},useTransition:function(){var e=vp(!1),n=e[0];return e=Y0.bind(null,e[1]),Nn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var c=Xe,f=Nn();if(Ve){if(i===void 0)throw Error(s(407));i=i()}else{if(i=n(),gt===null)throw Error(s(349));(uo&30)!==0||fp(c,n,i)}f.memoizedState=i;var p={value:i,getSnapshot:n};return f.queue=p,yp(pp.bind(null,c,p,e),[e]),c.flags|=2048,Qs(9,hp.bind(null,c,p,i,n),void 0,null),i},useId:function(){var e=Nn(),n=gt.identifierPrefix;if(Ve){var i=Hn,c=Vn;i=(c&~(1<<32-dn(c)-1)).toString(32)+i,n=":"+n+"R"+i,i=qs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof c.is=="string"?e=k.createElement(i,{is:c.is}):(e=k.createElement(i),i==="select"&&(k=e,c.multiple?k.multiple=!0:c.size&&(k.size=c.size))):e=k.createElementNS(e,i),e[Sn]=n,e[Us]=c,Qp(e,n,!1,!1),n.stateNode=e;e:{switch(k=Dl(i,c),i){case"dialog":Be("cancel",e),Be("close",e),f=c;break;case"iframe":case"object":case"embed":Be("load",e),f=c;break;case"video":case"audio":for(f=0;fQo&&(n.flags|=128,c=!0,Xs(p,!1),n.lanes=4194304)}else{if(!c)if(e=ia(k),e!==null){if(n.flags|=128,c=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),Xs(p,!0),p.tail===null&&p.tailMode==="hidden"&&!k.alternate&&!Ve)return Nt(n),null}else 2*tt()-p.renderingStartTime>Qo&&i!==1073741824&&(n.flags|=128,c=!0,Xs(p,!1),n.lanes=4194304);p.isBackwards?(k.sibling=n.child,n.child=k):(i=p.last,i!==null?i.sibling=k:n.child=k,p.last=k)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=tt(),n.sibling=null,i=Qe.current,Fe(Qe,c?i&1|2:i&1),n):(Nt(n),null);case 22:case 23:return uu(),c=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==c&&(n.flags|=8192),c&&(n.mode&1)!==0?(Gt&1073741824)!==0&&(Nt(n),n.subtreeFlags&6&&(n.flags|=8192)):Nt(n),null;case 24:return null;case 25:return null}throw Error(s(156,n.tag))}function ib(e,n){switch(yc(n),n.tag){case 1:return At(n.type)&&Yi(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Go(),We(Mt),We(St),Dc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Pc(n),null;case 13:if(We(Qe),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Bo()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return We(Qe),null;case 4:return Go(),null;case 10:return Sc(n.type._context),null;case 22:case 23:return uu(),null;case 24:return null;default:return null}}var ma=!1,Et=!1,ab=typeof WeakSet=="function"?WeakSet:Set,de=null;function qo(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(c){et(e,n,c)}else i.current=null}function Jc(e,n,i){try{i()}catch(c){et(e,n,c)}}var Zp=!1;function lb(e,n){if(uc=Ai,e=Th(),nc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var f=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var k=0,T=-1,D=-1,V=0,Q=0,X=e,Y=null;t:for(;;){for(var le;X!==i||f!==0&&X.nodeType!==3||(T=k+f),X!==p||c!==0&&X.nodeType!==3||(D=k+c),X.nodeType===3&&(k+=X.nodeValue.length),(le=X.firstChild)!==null;)Y=X,X=le;for(;;){if(X===e)break t;if(Y===i&&++V===f&&(T=k),Y===p&&++Q===c&&(D=k),(le=X.nextSibling)!==null)break;X=Y,Y=X.parentNode}X=le}i=T===-1||D===-1?null:{start:T,end:D}}else i=null}i=i||{start:0,end:0}}else i=null;for(dc={focusedElem:e,selectionRange:i},Ai=!1,de=n;de!==null;)if(n=de,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,de=e;else for(;de!==null;){n=de;try{var pe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var me=pe.memoizedProps,nt=pe.memoizedState,U=n.stateNode,M=U.getSnapshotBeforeUpdate(n.elementType===n.type?me:pn(n.type,me),nt);U.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var W=n.stateNode.containerInfo;W.nodeType===1?W.textContent="":W.nodeType===9&&W.documentElement&&W.removeChild(W.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(te){et(n,n.return,te)}if(e=n.sibling,e!==null){e.return=n.return,de=e;break}de=n.return}return pe=Zp,Zp=!1,pe}function Js(e,n,i){var c=n.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&e)===e){var p=f.destroy;f.destroy=void 0,p!==void 0&&Jc(n,i,p)}f=f.next}while(f!==c)}}function ga(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var c=i.create;i.destroy=c()}i=i.next}while(i!==n)}}function Zc(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function em(e){var n=e.alternate;n!==null&&(e.alternate=null,em(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Sn],delete n[Us],delete n[mc],delete n[V0],delete n[H0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function tm(e){return e.tag===5||e.tag===3||e.tag===4}function nm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function eu(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Ki));else if(c!==4&&(e=e.child,e!==null))for(eu(e,n,i),e=e.sibling;e!==null;)eu(e,n,i),e=e.sibling}function tu(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(c!==4&&(e=e.child,e!==null))for(tu(e,n,i),e=e.sibling;e!==null;)tu(e,n,i),e=e.sibling}var bt=null,mn=!1;function Tr(e,n,i){for(i=i.child;i!==null;)rm(e,n,i),i=i.sibling}function rm(e,n,i){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(Ri,i)}catch{}switch(i.tag){case 5:Et||qo(i,n);case 6:var c=bt,f=mn;bt=null,Tr(e,n,i),bt=c,mn=f,bt!==null&&(mn?(e=bt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):bt.removeChild(i.stateNode));break;case 18:bt!==null&&(mn?(e=bt,i=i.stateNode,e.nodeType===8?pc(e.parentNode,i):e.nodeType===1&&pc(e,i),Ps(e)):pc(bt,i.stateNode));break;case 4:c=bt,f=mn,bt=i.stateNode.containerInfo,mn=!0,Tr(e,n,i),bt=c,mn=f;break;case 0:case 11:case 14:case 15:if(!Et&&(c=i.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){f=c=c.next;do{var p=f,k=p.destroy;p=p.tag,k!==void 0&&((p&2)!==0||(p&4)!==0)&&Jc(i,n,k),f=f.next}while(f!==c)}Tr(e,n,i);break;case 1:if(!Et&&(qo(i,n),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(T){et(i,n,T)}Tr(e,n,i);break;case 21:Tr(e,n,i);break;case 22:i.mode&1?(Et=(c=Et)||i.memoizedState!==null,Tr(e,n,i),Et=c):Tr(e,n,i);break;default:Tr(e,n,i)}}function om(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new ab),n.forEach(function(c){var f=vb.bind(null,e,c);i.has(c)||(i.add(c),c.then(f,f))})}}function gn(e,n){var i=n.deletions;if(i!==null)for(var c=0;cf&&(f=k),c&=~p}if(c=f,c=tt()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*ub(c/1960))-c,10e?16:e,Or===null)var c=!1;else{if(e=Or,Or=null,ba=0,(Me&6)!==0)throw Error(s(331));var f=Me;for(Me|=4,de=e.current;de!==null;){var p=de,k=p.child;if((de.flags&16)!==0){var T=p.deletions;if(T!==null){for(var D=0;Dtt()-ou?po(e,0):ru|=i),zt(e,n)}function vm(e,n){n===0&&((e.mode&1)===0?n=1:(n=Ti,Ti<<=1,(Ti&130023424)===0&&(Ti=4194304)));var i=Ot();e=Gn(e,n),e!==null&&(Ss(e,n,i),zt(e,i))}function gb(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),vm(e,i)}function vb(e,n){var i=0;switch(e.tag){case 13:var c=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:c=e.stateNode;break;default:throw Error(s(314))}c!==null&&c.delete(n),vm(e,i)}var xm;xm=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||Mt.current)Lt=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return Lt=!1,ob(e,n,i);Lt=(e.flags&131072)!==0}else Lt=!1,Ve&&(n.flags&1048576)!==0&&Xh(n,Zi,n.index);switch(n.lanes=0,n.tag){case 2:var c=n.type;pa(e,n),e=n.pendingProps;var f=Fo(n,St.current);Ho(n,i),f=Ac(null,n,c,e,f,i);var p=Lc();return n.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,At(c)?(p=!0,Qi(n)):p=!1,n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Ec(n),f.updater=fa,n.stateNode=f,f._reactInternals=n,Bc(n,c,e,i),n=Gc(null,n,c,!0,p,i)):(n.tag=0,Ve&&p&&xc(n),Dt(null,n,f,i),n=n.child),n;case 16:c=n.elementType;e:{switch(pa(e,n),e=n.pendingProps,f=c._init,c=f(c._payload),n.type=c,f=n.tag=yb(c),e=pn(c,e),f){case 0:n=Hc(null,n,c,e,i);break e;case 1:n=Vp(null,n,c,e,i);break e;case 11:n=Fp(null,n,c,e,i);break e;case 14:n=$p(null,n,c,pn(c.type,e),i);break e}throw Error(s(306,c,""))}return n;case 0:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:pn(c,f),Hc(e,n,c,f,i);case 1:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:pn(c,f),Vp(e,n,c,f,i);case 3:e:{if(Hp(n),e===null)throw Error(s(387));c=n.pendingProps,p=n.memoizedState,f=p.element,ip(e,n),sa(n,c,null,i);var k=n.memoizedState;if(c=k.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){f=Ko(Error(s(423)),n),n=Gp(e,n,c,i,f);break e}else if(c!==f){f=Ko(Error(s(424)),n),n=Gp(e,n,c,i,f);break e}else for(Ht=Sr(n.stateNode.containerInfo.firstChild),Vt=n,Ve=!0,hn=null,i=op(n,null,c,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Bo(),c===f){n=qn(e,n,i);break e}Dt(e,n,c,i)}n=n.child}return n;case 5:return cp(n),e===null&&bc(n),c=n.type,f=n.pendingProps,p=e!==null?e.memoizedProps:null,k=f.children,fc(c,f)?k=null:p!==null&&fc(c,p)&&(n.flags|=32),Wp(e,n),Dt(e,n,k,i),n.child;case 6:return e===null&&bc(n),null;case 13:return Kp(e,n,i);case 4:return Rc(n,n.stateNode.containerInfo),c=n.pendingProps,e===null?n.child=Wo(n,null,c,i):Dt(e,n,c,i),n.child;case 11:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:pn(c,f),Fp(e,n,c,f,i);case 7:return Dt(e,n,n.pendingProps,i),n.child;case 8:return Dt(e,n,n.pendingProps.children,i),n.child;case 12:return Dt(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(c=n.type._context,f=n.pendingProps,p=n.memoizedProps,k=f.value,Fe(na,c._currentValue),c._currentValue=k,p!==null)if(fn(p.value,k)){if(p.children===f.children&&!Mt.current){n=qn(e,n,i);break e}}else for(p=n.child,p!==null&&(p.return=n);p!==null;){var T=p.dependencies;if(T!==null){k=p.child;for(var D=T.firstContext;D!==null;){if(D.context===c){if(p.tag===1){D=Kn(-1,i&-i),D.tag=2;var V=p.updateQueue;if(V!==null){V=V.shared;var Q=V.pending;Q===null?D.next=D:(D.next=Q.next,Q.next=D),V.pending=D}}p.lanes|=i,D=p.alternate,D!==null&&(D.lanes|=i),_c(p.return,i,n),T.lanes|=i;break}D=D.next}}else if(p.tag===10)k=p.type===n.type?null:p.child;else if(p.tag===18){if(k=p.return,k===null)throw Error(s(341));k.lanes|=i,T=k.alternate,T!==null&&(T.lanes|=i),_c(k,i,n),k=p.sibling}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===n){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}Dt(e,n,f.children,i),n=n.child}return n;case 9:return f=n.type,c=n.pendingProps.children,Ho(n,i),f=en(f),c=c(f),n.flags|=1,Dt(e,n,c,i),n.child;case 14:return c=n.type,f=pn(c,n.pendingProps),f=pn(c.type,f),$p(e,n,c,f,i);case 15:return Up(e,n,n.type,n.pendingProps,i);case 17:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:pn(c,f),pa(e,n),n.tag=1,At(c)?(e=!0,Qi(n)):e=!1,Ho(n,i),Dp(n,c,f),Bc(n,c,f,i),Gc(null,n,c,!0,e,i);case 19:return Yp(e,n,i);case 22:return Bp(e,n,i)}throw Error(s(156,n.tag))};function ym(e,n){return Jf(e,n)}function xb(e,n,i,c){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,n,i,c){return new xb(e,n,i,c)}function fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yb(e){if(typeof e=="function")return fu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Z)return 11;if(e===ye)return 14}return 2}function Lr(e,n){var i=e.alternate;return i===null?(i=rn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Sa(e,n,i,c,f,p){var k=2;if(c=e,typeof e=="function")fu(e)&&(k=1);else if(typeof e=="string")k=5;else e:switch(e){case F:return go(i.children,f,p,n);case A:k=8,f|=8;break;case q:return e=rn(12,i,n,f|2),e.elementType=q,e.lanes=p,e;case se:return e=rn(13,i,n,f),e.elementType=se,e.lanes=p,e;case he:return e=rn(19,i,n,f),e.elementType=he,e.lanes=p,e;case oe:return _a(i,f,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B:k=10;break e;case z:k=9;break e;case Z:k=11;break e;case ye:k=14;break e;case ae:k=16,c=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return n=rn(k,i,n,f),n.elementType=e,n.type=c,n.lanes=p,n}function go(e,n,i,c){return e=rn(7,e,c,n),e.lanes=i,e}function _a(e,n,i,c){return e=rn(22,e,c,n),e.elementType=oe,e.lanes=i,e.stateNode={isHidden:!1},e}function hu(e,n,i){return e=rn(6,e,null,n),e.lanes=i,e}function pu(e,n,i){return n=rn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function wb(e,n,i,c,f){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ul(0),this.expirationTimes=Ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ul(0),this.identifierPrefix=c,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function mu(e,n,i,c,f,p,k,T,D){return e=new wb(e,n,i,T,D),n===1?(n=1,p===!0&&(n|=8)):n=0,p=rn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:c,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ec(p),e}function bb(e,n,i){var c=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(o){console.error(o)}}return t(),ju.exports=Ab(),ju.exports}var Lm;function Lb(){if(Lm)return Oa;Lm=1;var t=Hg();return Oa.createRoot=t.createRoot,Oa.hydrateRoot=t.hydrateRoot,Oa}var Ib=Lb(),_d=Hg();/** - * @remix-run/router v1.23.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ci(){return ci=Object.assign?Object.assign.bind():function(t){for(var o=1;o"u")throw new Error(o)}function Gg(t,o){if(!t){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function Fb(){return Math.random().toString(36).substr(2,8)}function zm(t,o){return{usr:t.state,key:t.key,idx:o}}function qu(t,o,s,a){return s===void 0&&(s=null),ci({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof o=="string"?ds(o):o,{state:s,key:o&&o.key||a||Fb()})}function Ja(t){let{pathname:o="/",search:s="",hash:a=""}=t;return s&&s!=="?"&&(o+=s.charAt(0)==="?"?s:"?"+s),a&&a!=="#"&&(o+=a.charAt(0)==="#"?a:"#"+a),o}function ds(t){let o={};if(t){let s=t.indexOf("#");s>=0&&(o.hash=t.substr(s),t=t.substr(0,s));let a=t.indexOf("?");a>=0&&(o.search=t.substr(a),t=t.substr(0,a)),t&&(o.pathname=t)}return o}function $b(t,o,s,a){a===void 0&&(a={});let{window:l=document.defaultView,v5Compat:u=!1}=a,d=l.history,h=Br.Pop,g=null,v=w();v==null&&(v=0,d.replaceState(ci({},d.state,{idx:v}),""));function w(){return(d.state||{idx:null}).idx}function x(){h=Br.Pop;let j=w(),S=j==null?null:j-v;v=j,g&&g({action:h,location:b.location,delta:S})}function C(j,S){h=Br.Push;let R=qu(b.location,j,S);v=w()+1;let N=zm(R,v),E=b.createHref(R);try{d.pushState(N,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(E)}u&&g&&g({action:h,location:b.location,delta:1})}function y(j,S){h=Br.Replace;let R=qu(b.location,j,S);v=w();let N=zm(R,v),E=b.createHref(R);d.replaceState(N,"",E),u&&g&&g({action:h,location:b.location,delta:0})}function _(j){let S=l.location.origin!=="null"?l.location.origin:l.location.href,R=typeof j=="string"?j:Ja(j);return R=R.replace(/ $/,"%20"),Je(S,"No window.location.(origin|href) available to create URL for href: "+R),new URL(R,S)}let b={get action(){return h},get location(){return t(l,d)},listen(j){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(Im,x),g=j,()=>{l.removeEventListener(Im,x),g=null}},createHref(j){return o(l,j)},createURL:_,encodeLocation(j){let S=_(j);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:C,replace:y,go(j){return d.go(j)}};return b}var Fm;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Fm||(Fm={}));function Ub(t,o,s){return s===void 0&&(s="/"),Bb(t,o,s)}function Bb(t,o,s,a){let l=typeof o=="string"?ds(o):o,u=cs(l.pathname||"/",s);if(u==null)return null;let d=Kg(t);Wb(d);let h=null;for(let g=0;h==null&&g{let g={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};g.relativePath.startsWith("/")&&(Je(g.relativePath.startsWith(a),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(a.length));let v=Wr([a,g.relativePath]),w=s.concat(g);u.children&&u.children.length>0&&(Je(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+v+'".')),Kg(u.children,o,w,v)),!(u.path==null&&!u.index)&&o.push({path:v,score:Qb(v,u.index),routesMeta:w})};return t.forEach((u,d)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))l(u,d);else for(let g of qg(u.path))l(u,d,g)}),o}function qg(t){let o=t.split("/");if(o.length===0)return[];let[s,...a]=o,l=s.endsWith("?"),u=s.replace(/\?$/,"");if(a.length===0)return l?[u,""]:[u];let d=qg(a.join("/")),h=[];return h.push(...d.map(g=>g===""?u:[u,g].join("/"))),l&&h.push(...d),h.map(g=>t.startsWith("/")&&g===""?"/":g)}function Wb(t){t.sort((o,s)=>o.score!==s.score?s.score-o.score:Xb(o.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}const Vb=/^:[\w-]+$/,Hb=3,Gb=2,Kb=1,qb=10,Yb=-2,$m=t=>t==="*";function Qb(t,o){let s=t.split("/"),a=s.length;return s.some($m)&&(a+=Yb),o&&(a+=Gb),s.filter(l=>!$m(l)).reduce((l,u)=>l+(Vb.test(u)?Hb:u===""?Kb:qb),a)}function Xb(t,o){return t.length===o.length&&t.slice(0,-1).every((a,l)=>a===o[l])?t[t.length-1]-o[o.length-1]:0}function Jb(t,o,s){let{routesMeta:a}=t,l={},u="/",d=[];for(let h=0;h{let{paramName:C,isOptional:y}=w;if(C==="*"){let b=h[x]||"";d=u.slice(0,u.length-b.length).replace(/(.)\/+$/,"$1")}const _=h[x];return y&&!_?v[C]=void 0:v[C]=(_||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:d,pattern:t}}function Zb(t,o,s){o===void 0&&(o=!1),s===void 0&&(s=!0),Gg(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let a=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,h,g)=>(a.push({paramName:h,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(a.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,o?void 0:"i"),a]}function ej(t){try{return t.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return Gg(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+o+").")),t}}function cs(t,o){if(o==="/")return t;if(!t.toLowerCase().startsWith(o.toLowerCase()))return null;let s=o.endsWith("/")?o.length-1:o.length,a=t.charAt(s);return a&&a!=="/"?null:t.slice(s)||"/"}function tj(t,o){o===void 0&&(o="/");let{pathname:s,search:a="",hash:l=""}=typeof t=="string"?ds(t):t;return{pathname:s?s.startsWith("/")?s:nj(s,o):o,search:sj(a),hash:ij(l)}}function nj(t,o){let s=o.replace(/\/+$/,"").split("/");return t.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function Su(t,o,s,a){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+o+"` field ["+JSON.stringify(a)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function rj(t){return t.filter((o,s)=>s===0||o.route.path&&o.route.path.length>0)}function Nd(t,o){let s=rj(t);return o?s.map((a,l)=>l===s.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function Ed(t,o,s,a){a===void 0&&(a=!1);let l;typeof t=="string"?l=ds(t):(l=ci({},t),Je(!l.pathname||!l.pathname.includes("?"),Su("?","pathname","search",l)),Je(!l.pathname||!l.pathname.includes("#"),Su("#","pathname","hash",l)),Je(!l.search||!l.search.includes("#"),Su("#","search","hash",l)));let u=t===""||l.pathname==="",d=u?"/":l.pathname,h;if(d==null)h=s;else{let x=o.length-1;if(!a&&d.startsWith("..")){let C=d.split("/");for(;C[0]==="..";)C.shift(),x-=1;l.pathname=C.join("/")}h=x>=0?o[x]:"/"}let g=tj(l,h),v=d&&d!=="/"&&d.endsWith("/"),w=(u||d===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(v||w)&&(g.pathname+="/"),g}const Wr=t=>t.join("/").replace(/\/\/+/g,"/"),oj=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),sj=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,ij=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function aj(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Yg=["post","put","patch","delete"];new Set(Yg);const lj=["get",...Yg];new Set(lj);/** - * React Router v6.30.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ui(){return ui=Object.assign?Object.assign.bind():function(t){for(var o=1;o{h.current=!0}),m.useCallback(function(v,w){if(w===void 0&&(w={}),!h.current)return;if(typeof v=="number"){a.go(v);return}let x=Ed(v,JSON.parse(d),u,w.relative==="path");t==null&&o!=="/"&&(x.pathname=x.pathname==="/"?o:Wr([o,x.pathname])),(w.replace?a.replace:a.push)(x,w.state,w)},[o,a,d,u,t])}function fl(t,o){let{relative:s}=o===void 0?{}:o,{future:a}=m.useContext(cr),{matches:l}=m.useContext(Xr),{pathname:u}=In(),d=JSON.stringify(Nd(l,a.v7_relativeSplatPath));return m.useMemo(()=>Ed(t,JSON.parse(d),u,s==="path"),[t,d,u,s])}function dj(t,o){return fj(t,o)}function fj(t,o,s,a){fs()||Je(!1);let{navigator:l}=m.useContext(cr),{matches:u}=m.useContext(Xr),d=u[u.length-1],h=d?d.params:{};d&&d.pathname;let g=d?d.pathnameBase:"/";d&&d.route;let v=In(),w;if(o){var x;let j=typeof o=="string"?ds(o):o;g==="/"||(x=j.pathname)!=null&&x.startsWith(g)||Je(!1),w=j}else w=v;let C=w.pathname||"/",y=C;if(g!=="/"){let j=g.replace(/^\//,"").split("/");y="/"+C.replace(/^\//,"").split("/").slice(j.length).join("/")}let _=Ub(t,{pathname:y}),b=vj(_&&_.map(j=>Object.assign({},j,{params:Object.assign({},h,j.params),pathname:Wr([g,l.encodeLocation?l.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?g:Wr([g,l.encodeLocation?l.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),u,s,a);return o&&b?m.createElement(dl.Provider,{value:{location:ui({pathname:"/",search:"",hash:"",state:null,key:"default"},w),navigationType:Br.Pop}},b):b}function hj(){let t=bj(),o=aj(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),s=t instanceof Error?t.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},o),s?m.createElement("pre",{style:l},s):null,null)}const pj=m.createElement(hj,null);class mj extends m.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,s){return s.location!==o.location||s.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:s.error,location:s.location,revalidation:o.revalidation||s.revalidation}}componentDidCatch(o,s){console.error("React Router caught the following error during render",o,s)}render(){return this.state.error!==void 0?m.createElement(Xr.Provider,{value:this.props.routeContext},m.createElement(Xg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function gj(t){let{routeContext:o,match:s,children:a}=t,l=m.useContext(ul);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),m.createElement(Xr.Provider,{value:o},a)}function vj(t,o,s,a){var l;if(o===void 0&&(o=[]),s===void 0&&(s=null),a===void 0&&(a=null),t==null){var u;if(!s)return null;if(s.errors)t=s.matches;else if((u=a)!=null&&u.v7_partialHydration&&o.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let d=t,h=(l=s)==null?void 0:l.errors;if(h!=null){let w=d.findIndex(x=>x.route.id&&(h==null?void 0:h[x.route.id])!==void 0);w>=0||Je(!1),d=d.slice(0,Math.min(d.length,w+1))}let g=!1,v=-1;if(s&&a&&a.v7_partialHydration)for(let w=0;w=0?d=d.slice(0,v+1):d=[d[0]];break}}}return d.reduceRight((w,x,C)=>{let y,_=!1,b=null,j=null;s&&(y=h&&x.route.id?h[x.route.id]:void 0,b=x.route.errorElement||pj,g&&(v<0&&C===0?(kj("route-fallback"),_=!0,j=null):v===C&&(_=!0,j=x.route.hydrateFallbackElement||null)));let S=o.concat(d.slice(0,C+1)),R=()=>{let N;return y?N=b:_?N=j:x.route.Component?N=m.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=w,m.createElement(gj,{match:x,routeContext:{outlet:w,matches:S,isDataRoute:s!=null},children:N})};return s&&(x.route.ErrorBoundary||x.route.errorElement||C===0)?m.createElement(mj,{location:s.location,revalidation:s.revalidation,component:b,error:y,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):R()},null)}var Zg=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(Zg||{}),ev=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(ev||{});function xj(t){let o=m.useContext(ul);return o||Je(!1),o}function yj(t){let o=m.useContext(Qg);return o||Je(!1),o}function wj(t){let o=m.useContext(Xr);return o||Je(!1),o}function tv(t){let o=wj(),s=o.matches[o.matches.length-1];return s.route.id||Je(!1),s.route.id}function bj(){var t;let o=m.useContext(Xg),s=yj(),a=tv();return o!==void 0?o:(t=s.errors)==null?void 0:t[a]}function jj(){let{router:t}=xj(Zg.UseNavigateStable),o=tv(ev.UseNavigateStable),s=m.useRef(!1);return Jg(()=>{s.current=!0}),m.useCallback(function(l,u){u===void 0&&(u={}),s.current&&(typeof l=="number"?t.navigate(l):t.navigate(l,ui({fromRouteId:o},u)))},[t,o])}const Um={};function kj(t,o,s){Um[t]||(Um[t]=!0)}function Cj(t,o){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Sj(t){let{to:o,replace:s,state:a,relative:l}=t;fs()||Je(!1);let{future:u,static:d}=m.useContext(cr),{matches:h}=m.useContext(Xr),{pathname:g}=In(),v=Rd(),w=Ed(o,Nd(h,u.v7_relativeSplatPath),g,l==="path"),x=JSON.stringify(w);return m.useEffect(()=>v(JSON.parse(x),{replace:s,state:a,relative:l}),[v,x,l,s,a]),null}function li(t){Je(!1)}function _j(t){let{basename:o="/",children:s=null,location:a,navigationType:l=Br.Pop,navigator:u,static:d=!1,future:h}=t;fs()&&Je(!1);let g=o.replace(/^\/*/,"/"),v=m.useMemo(()=>({basename:g,navigator:u,static:d,future:ui({v7_relativeSplatPath:!1},h)}),[g,h,u,d]);typeof a=="string"&&(a=ds(a));let{pathname:w="/",search:x="",hash:C="",state:y=null,key:_="default"}=a,b=m.useMemo(()=>{let j=cs(w,g);return j==null?null:{location:{pathname:j,search:x,hash:C,state:y,key:_},navigationType:l}},[g,w,x,C,y,_,l]);return b==null?null:m.createElement(cr.Provider,{value:v},m.createElement(dl.Provider,{children:s,value:b}))}function Nj(t){let{children:o,location:s}=t;return dj(Qu(o),s)}new Promise(()=>{});function Qu(t,o){o===void 0&&(o=[]);let s=[];return m.Children.forEach(t,(a,l)=>{if(!m.isValidElement(a))return;let u=[...o,l];if(a.type===m.Fragment){s.push.apply(s,Qu(a.props.children,u));return}a.type!==li&&Je(!1),!a.props.index||!a.props.children||Je(!1);let d={id:a.props.id||u.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(d.children=Qu(a.props.children,u)),s.push(d)}),s}/** - * React Router DOM v6.30.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Za(){return Za=Object.assign?Object.assign.bind():function(t){for(var o=1;o=0)&&(s[l]=t[l]);return s}function Ej(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Rj(t,o){return t.button===0&&(!o||o==="_self")&&!Ej(t)}function Xu(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((o,s)=>{let a=t[s];return o.concat(Array.isArray(a)?a.map(l=>[s,l]):[[s,a]])},[]))}function Pj(t,o){let s=Xu(t);return o&&o.forEach((a,l)=>{s.has(l)||o.getAll(l).forEach(u=>{s.append(l,u)})}),s}const Tj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Dj=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Oj="6";try{window.__reactRouterVersion=Oj}catch{}const Mj=m.createContext({isTransitioning:!1}),Aj="startTransition",Bm=Qr[Aj];function Lj(t){let{basename:o,children:s,future:a,window:l}=t,u=m.useRef();u.current==null&&(u.current=zb({window:l,v5Compat:!0}));let d=u.current,[h,g]=m.useState({action:d.action,location:d.location}),{v7_startTransition:v}=a||{},w=m.useCallback(x=>{v&&Bm?Bm(()=>g(x)):g(x)},[g,v]);return m.useLayoutEffect(()=>d.listen(w),[d,w]),m.useEffect(()=>Cj(a),[a]),m.createElement(_j,{basename:o,children:s,location:h.location,navigationType:h.action,navigator:d,future:a})}const Ij=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yt=m.forwardRef(function(o,s){let{onClick:a,relative:l,reloadDocument:u,replace:d,state:h,target:g,to:v,preventScrollReset:w,viewTransition:x}=o,C=nv(o,Tj),{basename:y}=m.useContext(cr),_,b=!1;if(typeof v=="string"&&zj.test(v)&&(_=v,Ij))try{let N=new URL(window.location.href),E=v.startsWith("//")?new URL(N.protocol+v):new URL(v),P=cs(E.pathname,y);E.origin===N.origin&&P!=null?v=P+E.search+E.hash:b=!0}catch{}let j=cj(v,{relative:l}),S=Uj(v,{replace:d,state:h,target:g,preventScrollReset:w,relative:l,viewTransition:x});function R(N){a&&a(N),N.defaultPrevented||S(N)}return m.createElement("a",Za({},C,{href:_||j,onClick:b||u?a:R,ref:s,target:g}))}),Fj=m.forwardRef(function(o,s){let{"aria-current":a="page",caseSensitive:l=!1,className:u="",end:d=!1,style:h,to:g,viewTransition:v,children:w}=o,x=nv(o,Dj),C=fl(g,{relative:x.relative}),y=In(),_=m.useContext(Qg),{navigator:b,basename:j}=m.useContext(cr),S=_!=null&&Wj(C)&&v===!0,R=b.encodeLocation?b.encodeLocation(C).pathname:C.pathname,N=y.pathname,E=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;l||(N=N.toLowerCase(),E=E?E.toLowerCase():null,R=R.toLowerCase()),E&&j&&(E=cs(E,j)||E);const P=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let L=N===R||!d&&N.startsWith(R)&&N.charAt(P)==="/",F=E!=null&&(E===R||!d&&E.startsWith(R)&&E.charAt(R.length)==="/"),A={isActive:L,isPending:F,isTransitioning:S},q=L?a:void 0,B;typeof u=="function"?B=u(A):B=[u,L?"active":null,F?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let z=typeof h=="function"?h(A):h;return m.createElement(Yt,Za({},x,{"aria-current":q,className:B,ref:s,style:z,to:g,viewTransition:v}),typeof w=="function"?w(A):w)});var Ju;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Ju||(Ju={}));var Wm;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Wm||(Wm={}));function $j(t){let o=m.useContext(ul);return o||Je(!1),o}function Uj(t,o){let{target:s,replace:a,state:l,preventScrollReset:u,relative:d,viewTransition:h}=o===void 0?{}:o,g=Rd(),v=In(),w=fl(t,{relative:d});return m.useCallback(x=>{if(Rj(x,s)){x.preventDefault();let C=a!==void 0?a:Ja(v)===Ja(w);g(t,{replace:C,state:l,preventScrollReset:u,relative:d,viewTransition:h})}},[v,g,w,a,l,s,t,u,d,h])}function Bj(t){let o=m.useRef(Xu(t)),s=m.useRef(!1),a=In(),l=m.useMemo(()=>Pj(a.search,s.current?null:o.current),[a.search]),u=Rd(),d=m.useCallback((h,g)=>{const v=Xu(typeof h=="function"?h(l):h);s.current=!0,u("?"+v,g)},[u,l]);return[l,d]}function Wj(t,o){o===void 0&&(o={});let s=m.useContext(Mj);s==null&&Je(!1);let{basename:a}=$j(Ju.useViewTransitionState),l=fl(t,{relative:o.relative});if(!s.isTransitioning)return!1;let u=cs(s.currentLocation.pathname,a)||s.currentLocation.pathname,d=cs(s.nextLocation.pathname,a)||s.nextLocation.pathname;return Yu(l.pathname,d)!=null||Yu(l.pathname,u)!=null}var Zu,Vj=function(t){Zu=t},Hj=function(){if(Zu)return Zu;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gj=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */function Kj(t,o,s=[]){if(o==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Gj(t),size:24,node:o,...s.length>0?{aliases:s}:{}}}/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qj=t=>{let o="",s=!1;for(const a of t){if(a==="-"||a==="_"||a<=" "){s=o.length>0;continue}o.length===0?o+=a.toLowerCase():o+=s?a.toUpperCase():a,s=!1}return o};/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yj=t=>{const o=qj(t);return o.charAt(0).toUpperCase()+o.slice(1)};/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ed=(...t)=>t.filter((o,s,a)=>!!o&&o.trim()!==""&&a.indexOf(o)===s).join(" ").trim();/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */function _u(t){return t!=null}function Qj(t,o={}){var C,y;const s=o.attributeNames??{},a=_=>s[_]??_,l=t.size??t.width??vo.width,u=t.size??t.height??vo.height,d=((C=t.aliases)==null?void 0:C.filter(_=>typeof _=="string"&&_.trim()!=="").map(_=>`lucide-${_}`))??[],h=[...t.name?[`lucide-${t.name}`]:[],...d],g=((y=o.className)==null?void 0:y.split(" ").filter(Boolean))??[],v=o.includeDefaultClasses===!1?ed(...g):ed("lucide",...h,...g),w=o.absoluteStrokeWidth?Number(o.strokeWidth??vo["stroke-width"])*Number(t.size??t.width??vo.width)/Number(o.size??o.width??vo.width):o.strokeWidth??vo["stroke-width"];return["svg",{...Object.entries(vo).reduce((_,[b,j])=>(_[a(b)]=j,_),{}),..."color"in o&&o.color&&{[a("stroke")]:o.color},..."size"in o&&_u(o.size)&&{[a("width")]:o.size,[a("height")]:o.size},..."width"in o&&_u(o.width)&&{[a("width")]:o.width},..."height"in o&&_u(o.height)&&{[a("height")]:o.height},[a("stroke-width")]:w,...v&&{[a("class")]:v},[a("viewBox")]:`0 0 ${l} ${u}`,...o.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in o&&o.attributes},t.node.map(_=>{const[b,j,S]=_,R=o.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...j}:j;return S?[b,R,S]:[b,R]})]}/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */function Xj(t,o={}){return Qj(t,{...o,attributeNames:{...o.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jj=t=>{for(const o in t)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},Zj=m.createContext({}),ek=()=>m.useContext(Zj),tk=m.forwardRef(({color:t,size:o,width:s,height:a,strokeWidth:l,absoluteStrokeWidth:u,nonScalingStroke:d,className:h="",children:g,iconNode:v=[],icon:w={node:v,aliases:[],size:24},...x},C)=>{const{size:y=24,strokeWidth:_=2,absoluteStrokeWidth:b=!1,nonScalingStroke:j=!1,color:S="currentColor",className:R=""}=ek()??{},N=!!g||Jj(x),[E,P,L=[]]=Xj(w,{color:t??S,width:s??o??y,height:a??o??y,strokeWidth:l??_,absoluteStrokeWidth:u??b,nonScalingStroke:d??j,className:ed(R,h),hasA11yProp:N,attributes:x});return m.createElement(E,{ref:C,...P},[...L.map(([F,A])=>m.createElement(F,A)),...Array.isArray(g)?g:[g]])});/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */function Oe(t,o=[],s=[]){const a=typeof t=="string"?Kj(t,o,s):t,l=m.forwardRef(({className:u,...d},h)=>m.createElement(tk,{ref:h,icon:a,className:u,...d}));return a.name&&(l.displayName=Yj(a.name)),l}/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rv={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};rv.node;const nk=Oe(rv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ov={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};ov.node;const rk=Oe(ov);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sv={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};sv.node;const ok=Oe(sv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iv={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};iv.node;const sk=Oe(iv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const av={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};av.node;const hl=Oe(av);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lv={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};lv.node;const ik=Oe(lv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cv={name:"circle-exclamation-point",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle","circle-alert"]};cv.node;const uv=Oe(cv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dv={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};dv.node;const fv=Oe(dv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hv={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};hv.node;const ak=Oe(hv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pv={name:"container",size:24,node:[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]]};pv.node;const lk=Oe(pv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mv={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};mv.node;const ck=Oe(mv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gv={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};gv.node;const vv=Oe(gv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xv={name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]};xv.node;const uk=Oe(xv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yv={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};yv.node;const wv=Oe(yv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bv={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};bv.node;const dk=Oe(bv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jv={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};jv.node;const kv=Oe(jv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Cv={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};Cv.node;const fk=Oe(Cv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sv={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};Sv.node;const hk=Oe(Sv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _v={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};_v.node;const pk=Oe(_v);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Nv={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};Nv.node;const mk=Oe(Nv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ev={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};Ev.node;const gk=Oe(Ev);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rv={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};Rv.node;const vk=Oe(Rv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pv={name:"plug",size:24,node:[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]};Pv.node;const xk=Oe(Pv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tv={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Tv.node;const hs=Oe(Tv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dv={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};Dv.node;const Ov=Oe(Dv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mv={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};Mv.node;const yk=Oe(Mv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Av={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};Av.node;const wk=Oe(Av);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lv={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};Lv.node;const pl=Oe(Lv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Iv={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};Iv.node;const bk=Oe(Iv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zv={name:"settings-2",size:24,node:[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]};zv.node;const jk=Oe(zv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fv={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};Fv.node;const kk=Oe(Fv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $v={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};$v.node;const Ck=Oe($v);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uv={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};Uv.node;const Sk=Oe(Uv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bv={name:"webhook",size:24,node:[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]};Bv.node;const Wv=Oe(Bv);/** - * @license lucide-react v1.68.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vv={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Vv.node;const Pd=Oe(Vv);let Hv="";function _k(t){Hv=t}class Nu extends Error{constructor(o,s){super(o),this.status=s}}async function gi(t,o,s,a=!1){const l={};a&&(l["X-Background"]="1"),t!=="GET"&&(l["X-CSRF-Token"]=Hv),s!==void 0&&(l["Content-Type"]="application/json");const u=await fetch(o,{method:t,headers:l,cache:"no-store",body:s===void 0?void 0:JSON.stringify(s)});if(u.status===401)throw location.href="/admin/login?next="+encodeURIComponent(location.pathname),new Nu("signed out",401);const d=await u.json().catch(()=>({}));if(!u.ok)throw new Nu(d&&d.error||"HTTP "+u.status,u.status);if(u.status===202&&d&&d.pending)throw window.dispatchEvent(new CustomEvent("crc-notice",{detail:d.message})),window.dispatchEvent(new Event("crc-pending")),new Nu("",202);return d}const Ke=t=>gi("GET",t),Nk=t=>gi("GET",t,void 0,!0),Qt=(t,o)=>gi("POST",t,o),bn=(t,o)=>gi("PUT",t,o),Co=t=>gi("DELETE",t);function td(t){const o=new URLSearchParams;for(const[a,l]of Object.entries(t))l!=null&&l!==""&&o.set(a,String(l));const s=o.toString();return s?"?"+s:""}function Vr(t){if(!t||t.startsWith("0001-"))return"never";const o=Math.round((Date.now()-new Date(t).getTime())/1e3);return o<60?"just now":o<3600?Math.floor(o/60)+"m ago":o<86400?Math.floor(o/3600)+"h ago":Math.floor(o/86400)+"d ago"}function $e(t){return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e4?Math.round(t/1e3)+"k":t>=1e3?(t/1e3).toFixed(1)+"k":String(t)}function nd(t){if(!t)return"—";const o=Math.round(t/1e3);return o<60?o+"s":Math.floor(o/60)+"m "+o%60+"s"}const Gv=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric"}),Ek=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}),Rk=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function Pk(t){const o=new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(s=>s.type==="timeZoneName");return o?o.value:""}function di(t){const o=typeof t=="string"?new Date(t):t;return isNaN(o.getTime())?"":Gv.format(o)}const Tk=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}),Dk=new Intl.DateTimeFormat("en-GB",{month:"short",year:"numeric",timeZone:"UTC"});function Ok(t){const o=new Date(t);return isNaN(o.getTime())?"":Tk.format(o)}function Mk(t){const o=new Date(t);return isNaN(o.getTime())?"":Dk.format(o)}function Kr(t,o=!1){const s=typeof t=="string"?new Date(t):t;return isNaN(s.getTime())?"":Gv.format(s)+", "+(o?Rk:Ek).format(s)+" "+Pk(s)}function ml(t){const o=typeof t=="string"?new Date(t):t;return isNaN(o.getTime())?"":o.toISOString().replace("T"," ").replace(/\.\d+Z$/," UTC")}function Vm(t){return Kr(t)}function Kv(t){var o,s,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(o=0;o{const s=new Array(t.length+o.length);for(let a=0;a({classGroupId:t,validator:o}),Yv=(t=new Map,o=null,s)=>({nextPart:t,validators:o,classGroupId:s}),el="-",Hm=[],Ik="arbitrary..",zk=t=>{const o=$k(t),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return Fk(d);const h=d.split(el),g=h[0]===""&&h.length>1?1:0;return Qv(h,g,o)},getConflictingClassGroupIds:(d,h)=>{if(h){const g=a[d],v=s[d];return g?v?Ak(v,g):g:v||Hm}return s[d]||Hm}}},Qv=(t,o,s)=>{if(t.length-o===0)return s.classGroupId;const l=t[o],u=s.nextPart.get(l);if(u){const v=Qv(t,o+1,u);if(v)return v}const d=s.validators;if(d===null)return;const h=o===0?t.join(el):t.slice(o).join(el),g=d.length;for(let v=0;vt.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=t.slice(1,-1),s=o.indexOf(":"),a=o.slice(0,s);return a?Ik+a:void 0})(),$k=t=>{const{theme:o,classGroups:s}=t;return Uk(s,o)},Uk=(t,o)=>{const s=Yv();for(const a in t){const l=t[a];Td(l,s,a,o)}return s},Td=(t,o,s,a)=>{const l=t.length;for(let u=0;u{if(typeof t=="string"){Wk(t,o,s);return}if(typeof t=="function"){Vk(t,o,s,a);return}Hk(t,o,s,a)},Wk=(t,o,s)=>{const a=t===""?o:Xv(o,t);a.classGroupId=s},Vk=(t,o,s,a)=>{if(Gk(t)){Td(t(a),o,s,a);return}o.validators===null&&(o.validators=[]),o.validators.push(Lk(s,t))},Hk=(t,o,s,a)=>{const l=Object.entries(t),u=l.length;for(let d=0;d{let s=t;const a=o.split(el),l=a.length;for(let u=0;u"isThemeGetter"in t&&t.isThemeGetter===!0,Kk=t=>{if(t<1)return{get:()=>{},set:()=>{}};let o=0,s=Object.create(null),a=Object.create(null);const l=(u,d)=>{s[u]=d,o++,o>t&&(o=0,a=s,s=Object.create(null))};return{get(u){let d=s[u];if(d!==void 0)return d;if((d=a[u])!==void 0)return l(u,d),d},set(u,d){u in s?s[u]=d:l(u,d)}}},rd="!",Gm=":",qk=[],Km=(t,o,s,a,l)=>({modifiers:t,hasImportantModifier:o,baseClassName:s,maybePostfixModifierPosition:a,isExternal:l}),Yk=t=>{const{prefix:o,experimentalParseClassName:s}=t;let a=l=>{const u=[];let d=0,h=0,g=0,v;const w=l.length;for(let b=0;bg?v-g:void 0;return Km(u,y,C,_)};if(o){const l=o+Gm,u=a;a=d=>d.startsWith(l)?u(d.slice(l.length)):Km(qk,!1,d,void 0,!0)}if(s){const l=a;a=u=>s({className:u,parseClassName:l})}return a},Qk=t=>{const o=new Map;return t.orderSensitiveModifiers.forEach((s,a)=>{o.set(s,1e6+a)}),s=>{const a=[];let l=[];for(let u=0;u0&&(l.sort(),a.push(...l),l=[]),a.push(d)):l.push(d)}return l.length>0&&(l.sort(),a.push(...l)),a}},Xk=t=>({cache:Kk(t.cacheSize),parseClassName:Yk(t),sortModifiers:Qk(t),postfixLookupClassGroupIds:Jk(t),...zk(t)}),Jk=t=>{const o=Object.create(null),s=t.postfixLookupClassGroups;if(s)for(let a=0;a{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:u,postfixLookupClassGroupIds:d}=o,h=[],g=t.trim().split(Zk);let v="";for(let w=g.length-1;w>=0;w-=1){const x=g[w],{isExternal:C,modifiers:y,hasImportantModifier:_,baseClassName:b,maybePostfixModifierPosition:j}=s(x);if(C){v=x+(v.length>0?" "+v:v);continue}let S=!!j,R;if(S){const F=b.substring(0,j);R=a(F);const A=R&&d[R]?a(b):void 0;A&&A!==R&&(R=A,S=!1)}else R=a(b);if(!R){if(!S){v=x+(v.length>0?" "+v:v);continue}if(R=a(b),!R){v=x+(v.length>0?" "+v:v);continue}S=!1}const N=y.length===0?"":y.length===1?y[0]:u(y).join(":"),E=_?N+rd:N,P=E+R;if(h.indexOf(P)>-1)continue;h.push(P);const L=l(R,S);for(let F=0;F0?" "+v:v)}return v},t1=(...t)=>{let o=0,s,a,l="";for(;o{if(typeof t=="string")return t;let o,s="";for(let a=0;a{let s,a,l,u;const d=g=>{const v=o.reduce((w,x)=>x(w),t());return s=Xk(v),a=s.cache.get,l=s.cache.set,u=h,h(g)},h=g=>{const v=a(g);if(v)return v;const w=e1(g,s);return l(g,w),w};return u=d,(...g)=>u(t1(...g))},r1=[],ht=t=>{const o=s=>s[t]||r1;return o.isThemeGetter=!0,o.themeKey=t,o},Zv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,o1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,s1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,a1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,l1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zr=t=>o1.test(t),Te=t=>!!t&&!Number.isNaN(Number(t)),Rn=t=>!!t&&Number.isInteger(Number(t)),Eu=t=>t.endsWith("%")&&Te(t.slice(0,-1)),Qn=t=>s1.test(t),tx=()=>!0,u1=t=>i1.test(t)&&!a1.test(t),Dd=()=>!1,d1=t=>l1.test(t),f1=t=>c1.test(t),h1=t=>!ce(t)&&!fe(t),p1=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),m1=t=>Jr(t,ox,Dd),ce=t=>Zv.test(t),xo=t=>Jr(t,sx,u1),qm=t=>Jr(t,k1,Te),g1=t=>Jr(t,ax,tx),v1=t=>Jr(t,ix,Dd),Ym=t=>Jr(t,nx,Dd),x1=t=>Jr(t,rx,f1),Ma=t=>Jr(t,lx,d1),fe=t=>ex.test(t),oi=t=>So(t,sx),y1=t=>So(t,ix),Qm=t=>So(t,nx),w1=t=>So(t,ox),b1=t=>So(t,rx),Aa=t=>So(t,lx,!0),j1=t=>So(t,ax,!0),Jr=(t,o,s)=>{const a=Zv.exec(t);return a?a[1]?o(a[1]):s(a[2]):!1},So=(t,o,s=!1)=>{const a=ex.exec(t);return a?a[1]?o(a[1]):s:!1},nx=t=>t==="position"||t==="percentage",rx=t=>t==="image"||t==="url",ox=t=>t==="length"||t==="size"||t==="bg-size",sx=t=>t==="length",k1=t=>t==="number",ix=t=>t==="family-name",ax=t=>t==="number"||t==="weight",lx=t=>t==="shadow",C1=()=>{const t=ht("color"),o=ht("font"),s=ht("text"),a=ht("font-weight"),l=ht("tracking"),u=ht("leading"),d=ht("breakpoint"),h=ht("container"),g=ht("spacing"),v=ht("radius"),w=ht("shadow"),x=ht("inset-shadow"),C=ht("text-shadow"),y=ht("drop-shadow"),_=ht("blur"),b=ht("perspective"),j=ht("aspect"),S=ht("ease"),R=ht("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...E(),fe,ce],L=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],A=()=>[fe,ce,g],q=()=>[zr,"full","auto",...A()],B=()=>[Rn,"none","subgrid",fe,ce],z=()=>["auto",{span:["full",Rn,fe,ce]},Rn,fe,ce],Z=()=>[Rn,"auto",fe,ce],se=()=>["auto","min","max","fr",fe,ce],he=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ye=()=>["start","end","center","stretch","center-safe","end-safe"],ae=()=>["auto",...A()],oe=()=>[zr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],H=()=>[h,zr,"screen","full","dvw","lvw","svw","min","max","fit",...A()],J=()=>[zr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],$=()=>[t,fe,ce],O=()=>[...E(),Qm,Ym,{position:[fe,ce]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",w1,m1,{size:[fe,ce]}],we=()=>[Eu,oi,xo],I=()=>["","none","full",v,fe,ce],K=()=>["",Te,oi,xo],ge=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[Te,Eu,Qm,Ym],Ye=()=>["","none",_,fe,ce],Ct=()=>["none",Te,fe,ce],Bt=()=>["none",Te,fe,ce],yt=()=>[Te,fe,ce],ut=()=>[zr,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Qn],breakpoint:[Qn],color:[tx],container:[Qn],"drop-shadow":[Qn],ease:["in","out","in-out"],font:[h1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Qn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Qn],shadow:[Qn],spacing:["px",Te],text:[Qn],"text-shadow":[Qn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zr,ce,fe,j]}],container:["container"],"container-type":[{"@container":["","normal","size",fe,ce]}],"container-named":[p1],columns:[{columns:[Te,"auto",ce,fe,h]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{"inset-s":q(),start:q()}],end:[{"inset-e":q(),end:q()}],"inset-bs":[{"inset-bs":q()}],"inset-be":[{"inset-be":q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[Rn,"auto",fe,ce]}],basis:[{basis:[zr,"full","auto",h,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,zr,"auto","initial","none",ce]}],grow:[{grow:["",Te,fe,ce]}],shrink:[{shrink:["",Te,fe,ce]}],order:[{order:[Rn,"first","last","none",fe,ce]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...he(),"normal"]}],"justify-items":[{"justify-items":[...ye(),"normal"]}],"justify-self":[{"justify-self":["auto",...ye()]}],"align-content":[{content:["normal",...he()]}],"align-items":[{items:[...ye(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ye(),{baseline:["","last"]}]}],"place-content":[{"place-content":he()}],"place-items":[{"place-items":[...ye(),"baseline"]}],"place-self":[{"place-self":["auto",...ye()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mbs:[{mbs:ae()}],mbe:[{mbe:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[h,"screen",...oe()]}],"min-w":[{"min-w":[h,"screen","none",...oe()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh","none",...oe()]}],"font-size":[{text:["base",s,oi,xo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,j1,g1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Eu,ce]}],"font-family":[{font:[y1,v1,o]}],"font-features":[{"font-features":[ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,fe,ce]}],"line-clamp":[{"line-clamp":[Te,"none",fe,qm]}],leading:[{leading:["none",u,...A()]}],"list-image":[{"list-image":["none",fe,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",fe,xo]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Te,"auto",fe,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[Rn,fe,ce]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Rn,fe,ce],radial:["",fe,ce],conic:["",Rn,fe,ce]},b1,x1]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:we()}],"gradient-via-pos":[{via:we()}],"gradient-to-pos":[{to:we()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-bs":[{"border-bs":K()}],"border-w-be":[{"border-be":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,fe,ce]}],"outline-w":[{outline:["",Te,oi,xo]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","inner","none",w,Aa,Ma]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",x,Aa,Ma]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Te,xo]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",C,Aa,Ma]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Te,fe,ce]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[fe,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,ce]}],filter:[{filter:["","none",fe,ce]}],blur:[{blur:Ye()}],brightness:[{brightness:[Te,fe,ce]}],contrast:[{contrast:[Te,fe,ce]}],"drop-shadow":[{"drop-shadow":["","none",y,Aa,Ma]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Te,fe,ce]}],"hue-rotate":[{"hue-rotate":[Te,fe,ce]}],invert:[{invert:["",Te,fe,ce]}],saturate:[{saturate:[Te,fe,ce]}],sepia:[{sepia:["",Te,fe,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,ce]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[Te,fe,ce]}],"backdrop-contrast":[{"backdrop-contrast":[Te,fe,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,fe,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,fe,ce]}],"backdrop-invert":[{"backdrop-invert":["",Te,fe,ce]}],"backdrop-opacity":[{"backdrop-opacity":[Te,fe,ce]}],"backdrop-saturate":[{"backdrop-saturate":[Te,fe,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,fe,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",fe,ce]}],ease:[{ease:["linear","initial",S,fe,ce]}],delay:[{delay:[Te,fe,ce]}],animate:[{animate:["none",R,fe,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,fe,ce]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Ct()}],"rotate-x":[{"rotate-x":Ct()}],"rotate-y":[{"rotate-y":Ct()}],"rotate-z":[{"rotate-z":Ct()}],scale:[{scale:Bt()}],"scale-x":[{"scale-x":Bt()}],"scale-y":[{"scale-y":Bt()}],"scale-z":[{"scale-z":Bt()}],"scale-3d":["scale-3d"],skew:[{skew:yt()}],"skew-x":[{"skew-x":yt()}],"skew-y":[{"skew-y":yt()}],transform:[{transform:[fe,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ut()}],"translate-x":[{"translate-x":ut()}],"translate-y":[{"translate-y":ut()}],"translate-z":[{"translate-z":ut()}],"translate-none":["translate-none"],zoom:[{zoom:[Rn,fe,ce]}],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":$()}],"scrollbar-track-color":[{"scrollbar-track":$()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,ce]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Te,oi,xo,qm]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},S1=n1(C1);function ie(...t){return S1(qv(t))}const Xm=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Jm=qv,gl=(t,o)=>s=>{var a;if((o==null?void 0:o.variants)==null)return Jm(t,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:l,defaultVariants:u}=o,d=Object.keys(l).map(v=>{const w=s==null?void 0:s[v],x=u==null?void 0:u[v];if(w===null)return null;const C=Xm(w)||Xm(x);return l[v][C]}),h=s&&Object.entries(s).reduce((v,w)=>{let[x,C]=w;return C===void 0||(v[x]=C),v},{}),g=o==null||(a=o.compoundVariants)===null||a===void 0?void 0:a.reduce((v,w)=>{let{class:x,className:C,...y}=w;return Object.entries(y).every(_=>{let[b,j]=_;return Array.isArray(j)?j.includes({...u,...h}[b]):{...u,...h}[b]===j})?[...v,x,C]:v},[]);return Jm(t,d,g,s==null?void 0:s.class,s==null?void 0:s.className)},_1=gl("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Zn({className:t,variant:o,...s}){return r.jsx("div",{"data-slot":"alert",role:"alert",className:ie(_1({variant:o}),t),...s})}function cx({className:t,...o}){return r.jsx("div",{"data-slot":"alert-title",className:ie("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...o})}function er({className:t,...o}){return r.jsx("div",{"data-slot":"alert-description",className:ie("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",t),...o})}var N1=Object.defineProperty,Od=(t,o)=>N1(t,"name",{value:o,configurable:!0});function od(t,o){if(typeof t=="function")return t(o);t!=null&&(t.current=o)}Od(od,"setRef");function ux(...t){return o=>{let s=!1;const a=t.map(l=>{const u=od(l,o);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let l=0;lE1(t,"name",{value:o,configurable:!0});function or(t){const o=m.forwardRef((s,a)=>{let{children:l,...u}=s,d=null,h=!1;const g=[];l=vx(l),m.Children.forEach(l,C=>{var y;if(mx(C)){h=!0;const _=C;let b="child"in _.props?_.props.child:_.props.children;for(;Ad(b)&&typeof tl=="function";)b=tl(b._payload);d=R1(_,b),g.push((y=d==null?void 0:d.props)==null?void 0:y.children)}else g.push(C)}),d?d=m.cloneElement(d,void 0,g):!h&&m.Children.count(l)===1&&m.isValidElement(l)&&(d=l);const v=d?px(d):void 0,w=ze(a,v);if(!d){if(l||l===0)throw new Error(h?D1(t):T1(t));return l}const x=hx(u,d.props??{});return d.type!==m.Fragment&&(x.ref=a?w:v),m.cloneElement(d,x)});return o.displayName=`${t}.Slot`,o}Xt(or,"createSlot");var Md=or("Slot"),dx=Symbol.for("radix.slottable");function fx(t){const o=Xt(s=>"child"in s?s.children(s.child):s.children,"Slottable");return o.displayName=`${t}.Slottable`,o.__radixId=dx,o}Xt(fx,"createSlottable");var R1=Xt((t,o)=>"child"in t.props?m.isValidElement(o)?m.cloneElement(o,void 0,t.props.children(o.props.children)):null:m.isValidElement(o)?o:null,"getSlottableElementFromSlottable");function hx(t,o){const s={...o};for(const a in o){const l=t[a],u=o[a];/^on[A-Z]/.test(a)?l&&u?s[a]=(...h)=>{const g=u(...h);return l(...h),g}:l&&(s[a]=l):a==="style"?s[a]={...l,...u}:a==="className"?s[a]=[l,u].filter(Boolean).join(" "):a==="aria-describedby"&&(s[a]=xx(u,l))}return{...t,...s}}Xt(hx,"mergeProps");function px(t){var a,l;let o=(a=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:a.get,s=o&&"isReactWarning"in o&&o.isReactWarning;return s?t.ref:(o=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,s=o&&"isReactWarning"in o&&o.isReactWarning,s?t.props.ref:t.props.ref||t.ref)}Xt(px,"getElementRef");function mx(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===dx}Xt(mx,"isSlottable");var P1=Symbol.for("react.lazy");function Ad(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===P1&&"_payload"in t&&gx(t._payload)}Xt(Ad,"isLazyComponent");function gx(t){return typeof t=="object"&&t!==null&&"then"in t}Xt(gx,"isPromiseLike");function vx(t){let o=t;for(;Ad(o)&&typeof tl=="function";)o=tl(o._payload);return o}Xt(vx,"useUnwrappedLazy");function xx(...t){const o=new Set;for(const s of t)if(typeof s=="string")for(const a of String(s).trim().split(/\s+/))a&&o.add(a);return o.size>0?Array.from(o).join(" "):void 0}Xt(xx,"concatAriaDescribedby");var T1=Xt(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),D1=Xt(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),tl=Qr[" use ".trim().toString()],O1=Object.defineProperty,M1=(t,o)=>O1(t,"name",{value:o,configurable:!0}),A1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=A1.reduce((t,o)=>{const s=or(`Primitive.${o}`),a=m.forwardRef((l,u)=>{const{asChild:d,...h}=l,g=d?s:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(g,{...h,ref:u})});return a.displayName=`Primitive.${o}`,{...t,[o]:a}},{});function Ld(t,o){t&&_d.flushSync(()=>t.dispatchEvent(o))}M1(Ld,"dispatchDiscreteCustomEvent");var L1=Object.defineProperty,I1=(t,o)=>L1(t,"name",{value:o,configurable:!0}),z1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),F1=m.forwardRef(I1(function(o,s){return r.jsx(Ue.span,{...o,ref:s,style:{...z1,...o.style}})},"VisuallyHidden")),$1=Object.defineProperty,on=(t,o)=>$1(t,"name",{value:o,configurable:!0});function U1(t,o){const s=m.createContext(o);s.displayName=t+"Context";const a=on(u=>{const{children:d,...h}=u,g=m.useMemo(()=>h,Object.values(h));return r.jsx(s.Provider,{value:g,children:d})},"Provider");a.displayName=t+"Provider";function l(u,d={}){const{optional:h=!1}=d,g=m.useContext(s);if(g)return g;if(o!==void 0)return o;if(!h)throw new Error(`\`${u}\` must be used within \`${t}\``)}return on(l,"useContext"),[a,l]}on(U1,"createContext");function jn(t,o=[]){let s=[];function a(u,d){const h=m.createContext(d);h.displayName=u+"Context";const g=s.length;s=[...s,d];const v=on(x=>{var S;const{scope:C,children:y,..._}=x,b=((S=C==null?void 0:C[t])==null?void 0:S[g])||h,j=m.useMemo(()=>_,Object.values(_));return r.jsx(b.Provider,{value:j,children:y})},"Provider");v.displayName=u+"Provider";function w(x,C,y={}){var S;const{optional:_=!1}=y,b=((S=C==null?void 0:C[t])==null?void 0:S[g])||h,j=m.useContext(b);if(j)return j;if(d!==void 0)return d;if(!_)throw new Error(`\`${x}\` must be used within \`${u}\``)}return on(w,"useContext"),[v,w]}on(a,"createContext");const l=on(()=>{const u=s.map(d=>m.createContext(d));return on(function(h){const g=(h==null?void 0:h[t])||u;return m.useMemo(()=>({[`__scope${t}`]:{...h,[t]:g}}),[h,g])},"useScope")},"createScope");return l.scopeName=t,[a,yx(l,...o)]}on(jn,"createContextScope");function yx(...t){const o=t[0];if(t.length===1)return o;const s=on(()=>{const a=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return on(function(u){const d=a.reduce((h,{useScope:g,scopeName:v})=>{const x=g(u)[`__scope${v}`];return{...h,...x}},{});return m.useMemo(()=>({[`__scope${o.scopeName}`]:d}),[d])},"useComposedScopes")},"createScope");return s.scopeName=o.scopeName,s}on(yx,"composeContextScopes");var Rt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},B1=Object.defineProperty,pt=(t,o)=>B1(t,"name",{value:o,configurable:!0});function Id(t){const o=t+"CollectionProvider",[s,a]=jn(o),[l,u]=s(o,{collectionRef:{current:null},itemMap:new Map}),d=pt(b=>{const{scope:j,children:S}=b,R=m.useRef(null),N=m.useRef(new Map).current;return r.jsx(l,{scope:j,itemMap:N,collectionRef:R,children:S})},"CollectionProvider");d.displayName=o;const h=t+"CollectionSlot",g=or(h),v=m.forwardRef((b,j)=>{const{scope:S,children:R}=b,N=u(h,S),E=ze(j,N.collectionRef);return r.jsx(g,{ref:E,children:R})});v.displayName=h;const w=t+"CollectionItemSlot",x="data-radix-collection-item",C=or(w),y=m.forwardRef((b,j)=>{const{scope:S,children:R,...N}=b,E=m.useRef(null),P=ze(j,E),L=u(w,S);return m.useEffect(()=>(L.itemMap.set(E,{ref:E,...N}),()=>void L.itemMap.delete(E))),r.jsx(C,{[x]:"",ref:P,children:R})});y.displayName=w;function _(b){const j=u(t+"CollectionConsumer",b);return m.useCallback(()=>{const R=j.collectionRef.current;if(!R)return[];const N=Array.from(R.querySelectorAll(`[${x}]`));return Array.from(j.itemMap.values()).sort((L,F)=>N.indexOf(L.ref.current)-N.indexOf(F.ref.current))},[j.collectionRef,j.itemMap])}return pt(_,"useCollection"),[{Provider:d,Slot:v,ItemSlot:y},_,a]}pt(Id,"createCollection");var Zm=new WeakMap,rt,Kt,La=(Kt=class extends Map{constructor(s){super(s);Nm(this,rt);yu(this,rt,[...super.keys()]),Zm.set(this,!0)}set(s,a){return Zm.get(this)&&!this.has(s)&&kt(this,rt).push(s),super.set(s,a),this}insert(s,a,l){const u=this.has(a),d=u?this.size:this.size+1,h=zd(s),g=h>=0?Math.min(h,d-1):Math.max(d+h,0);if(u?kt(this,rt).indexOf(a)===g:g===this.size)return this.set(a,l),this;const v=kt(this,rt).filter(x=>x!==a);v.splice(g,0,a);const w=v.map(x=>[x,x===a?l:this.get(x)]);this.clear();for(const[x,C]of w)this.set(x,C);return this}with(s,a,l){const u=new Kt(this);return u.insert(s,a,l),u}before(s){const a=kt(this,rt).indexOf(s)-1;if(!(a<0))return this.entryAt(a)}setBefore(s,a,l){const u=kt(this,rt).indexOf(s);if(u===-1)return this;const d=kt(this,rt).indexOf(a),h=d!==-1&&d=this.size&&(u=this.size-1),this.at(u)}keyFrom(s,a){const l=this.indexOf(s);if(l===-1)return;let u=l+a;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(s,a){let l=0;for(const u of this){if(Reflect.apply(s,a,[u,l,this]))return u;l++}}findIndex(s,a){let l=0;for(const u of this){if(Reflect.apply(s,a,[u,l,this]))return l;l++}return-1}filter(s,a){const l=[];let u=0;for(const d of this)Reflect.apply(s,a,[d,u,this])&&l.push(d),u++;return new Kt(l)}map(s,a){const l=[];let u=0;for(const d of this)l.push([d[0],Reflect.apply(s,a,[d,u,this])]),u++;return new Kt(l)}reduce(...s){const[a,l]=s,u=s.length>1;if(!u&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let d=0,h=l;for(const g of this)d===0&&!u?h=g:h=Reflect.apply(a,this,[h,g,d,this]),d++;return h}reduceRight(...s){const[a,l]=s,u=s.length>1;if(!u&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let d=l;for(let h=this.size-1;h>=0;h--){const g=this.entryAt(h);h===this.size-1&&!u?d=g:d=Reflect.apply(a,this,[d,g,h,this])}return d}sort(s){if(typeof s!="function")throw new TypeError("OrderedDict.sort requires a compare function");const a=[...this.entries()].sort(s);this.clear();for(const[l,u]of a)this.set(l,u);return this}toSorted(s){if(typeof s!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const a=[...this.entries()].sort(s);return new Kt(a)}toReversed(){const s=new Kt;for(let a=this.size-1;a>=0;a--){const l=this.keyAt(a),u=this.get(l);s.set(l,u)}return s}toSpliced(...s){const a=[...this.entries()];return a.splice(...s),new Kt(a)}slice(s,a){const l=new Kt;for(const u of kt(this,rt).slice(s,a))l.set(u,this.get(u));return l}every(s,a){let l=0;for(const u of this){if(!Reflect.apply(s,a,[u,l,this]))return!1;l++}return!0}some(s,a){let l=0;for(const u of this){if(Reflect.apply(s,a,[u,l,this]))return!0;l++}return!1}},rt=new WeakMap,pt(Kt,"OrderedDict"),Kt);function Ha(t,o){if("at"in Array.prototype)return Array.prototype.at.call(t,o);const s=wx(t,o);return s===-1?void 0:t[s]}pt(Ha,"at");function wx(t,o){const s=t.length,a=zd(o),l=a>=0?a:s+a;return l<0||l>=s?-1:l}pt(wx,"toSafeIndex");function zd(t){return t!==t||t===0?0:Math.trunc(t)}pt(zd,"toSafeInteger");function W1(t){const o=t+"CollectionProvider",[s,a]=jn(o),[l,u]=s(o);l.displayName=t+"CollectionStableContextProvider";const[d,h]=s(o);d.displayName=t+"CollectionStatefulContextProvider";const g=pt(({state:L,...F})=>L?r.jsx(w,{...F,state:L}):r.jsx(v,{...F}),"CollectionProvider");g.displayName=o;const v=pt(L=>{const F=R();return r.jsx(w,{...L,state:F})},"CollectionInit");v.displayName=t+"CollectionInit";const w=pt(L=>{const{scope:F,children:A,state:q}=L,B=m.useRef(null),[z,Z]=m.useState(null),se=ze(B,Z),[he,ye]=q,ae=m.useRef(new La),oe=m.useCallback(()=>{const H=ae.current;return kx(H)||H.sort(Ga),H},[]);return m.useEffect(()=>{if(!z)return;const H=Cx(()=>{ye(J=>{const $=J.toSorted(Ga);return $.some(([G],ue)=>J.keyAt(ue)!==G)?$:J})});return H.observe(z,{childList:!0,subtree:!0}),()=>{H.disconnect()}},[z,ye]),r.jsx(l,{scope:F,collectionElementRef:se,collectionElementRefObject:B,getCollection:oe,setCollection:ye,registryRef:ae,children:r.jsx(d,{scope:F,collectionElement:z,collection:he,children:A})})},"CollectionProviderImpl");w.displayName=t+"CollectionProviderImpl";const x=t+"CollectionSlot",C=or(x),y=m.forwardRef((L,F)=>{const{scope:A,children:q}=L,B=u(x,A),z=ze(F,B.collectionElementRef);return r.jsx(C,{ref:z,children:q})});y.displayName=x;const _=t+"CollectionItemSlot",b="data-radix-collection-item",j=or(_),S=m.forwardRef((L,F)=>{const{scope:A,children:q,...B}=L,z=m.useRef(null),Z=u(_,A),{setCollection:se,registryRef:he}=Z,ye=m.useRef(B);bx(ye.current,B)||(ye.current=B);const ae=ye.current,oe=m.useCallback($=>{const O=he.current;$?O.set($,{...ye.current,element:$}):z.current&&O.delete(z.current)},[he]),H=ze(F,oe,z);Rt(()=>{const $=z.current,O=he.current;$&&O.has($)&&O.set($,{...ae,element:$})},[ae,he]);const J=m.useRef(null);return m.useEffect(()=>{const $=z.current,O=J.current;((O==null?void 0:O.element)??null)===$&&(!$||(O==null?void 0:O.itemData)===ae)||(J.current=$?{element:$,itemData:ae}:null,se(G=>{const ue=new La(G);return O&&O.element!==$&&ue.delete(O.element),$&&ue.set($,{...ae,element:$}),ue.sort(Ga)}))}),m.useEffect(()=>()=>{const $=J.current;J.current=null,$&&se(O=>{if(!O.has($.element))return O;const G=new La(O);return G.delete($.element),G})},[se]),r.jsx(j,{[b]:"",ref:H,children:q})});S.displayName=_;function R(){return m.useState(new La)}pt(R,"useInitCollection");function N(L){const{collection:F}=h(t+"CollectionConsumer",L);return F}pt(N,"useCollection");function E(L){const{getCollection:F}=u(t+"CollectionConsumer",L);return F}return pt(E,"useGetCollection"),[{Provider:g,Slot:y,ItemSlot:S},{createCollectionScope:a,useCollection:N,useGetCollection:E,useInitCollection:R}]}pt(W1,"createCollection");function bx(t,o){if(t===o)return!0;if(typeof t!="object"||typeof o!="object"||t==null||o==null)return!1;const s=Object.keys(t),a=Object.keys(o);if(s.length!==a.length)return!1;for(const l of s)if(!Object.prototype.hasOwnProperty.call(o,l)||t[l]!==o[l])return!1;return!0}pt(bx,"shallowEqual");function jx(t,o){return!!(o.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}pt(jx,"isElementPreceding");function kx(t){let o;for(const s of t.keys()){if(o){const a=o.compareDocumentPosition(s);if(!(a&Node.DOCUMENT_POSITION_DISCONNECTED)&&a&Node.DOCUMENT_POSITION_PRECEDING)return!1}o=s}return!0}pt(kx,"isInDocumentOrder");function Ga(t,o){return!t[1].element||!o[1].element?0:jx(t[1].element,o[1].element)?-1:1}pt(Ga,"sortByDocumentPosition");function Cx(t){return new MutationObserver(s=>{for(const a of s)if(a.type==="childList"){t();return}})}pt(Cx,"getChildListObserver");var V1=Object.defineProperty,ps=(t,o)=>V1(t,"name",{value:o,configurable:!0}),Sx=!!(typeof window<"u"&&window.document&&window.document.createElement);function Pe(t,o,{checkForDefaultPrevented:s=!0}={}){return ps(function(l){if(t==null||t(l),s===!1||!l||!l.defaultPrevented)return o==null?void 0:o(l)},"handleEvent")}ps(Pe,"composeEventHandlers");function H1(t){var o;if(!Sx)throw new Error("Cannot access window outside of the DOM");return((o=t==null?void 0:t.ownerDocument)==null?void 0:o.defaultView)??window}ps(H1,"getOwnerWindow");function sd(t){if(!Sx)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}ps(sd,"getOwnerDocument");function _x(t,o=!1){const{activeElement:s}=sd(t);if(!(s!=null&&s.nodeName))return null;if(Nx(s)&&s.contentDocument)return _x(s.contentDocument.body,o);if(o){const a=s.getAttribute("aria-activedescendant");if(a){const l=sd(s).getElementById(a);if(l)return l}}return s}ps(_x,"getActiveElement");function Nx(t){return t.tagName==="IFRAME"}ps(Nx,"isFrame");var G1=Object.defineProperty,K1=(t,o)=>G1(t,"name",{value:o,configurable:!0}),eg=Qr[" useEffectEvent ".trim().toString()],tg=Qr[" useInsertionEffect ".trim().toString()];function Ex(t){if(typeof eg=="function")return eg(t);const o=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof tg=="function"?tg(()=>{o.current=t}):Rt(()=>{o.current=t}),m.useMemo(()=>((...s)=>{var a;return(a=o.current)==null?void 0:a.call(o,...s)}),[])}K1(Ex,"useEffectEvent");var q1=Object.defineProperty,vi=(t,o)=>q1(t,"name",{value:o,configurable:!0}),Y1=Qr[" useInsertionEffect ".trim().toString()]||Rt;function ms({prop:t,defaultProp:o,onChange:s=vi(()=>{},"onChange"),caller:a}){const[l,u,d]=Rx({defaultProp:o,onChange:s}),h=t!==void 0,g=h?t:l,v=m.useCallback(w=>{var x;if(h){const C=Px(w)?w(t):w;C!==t&&((x=d.current)==null||x.call(d,C))}else u(w)},[h,t,u,d]);return[g,v]}vi(ms,"useControllableState");function Rx({defaultProp:t,onChange:o}){const[s,a]=m.useState(t),l=m.useRef(s),u=m.useRef(o);return Y1(()=>{u.current=o},[o]),m.useEffect(()=>{var d;l.current!==s&&((d=u.current)==null||d.call(u,s),l.current=s)},[s,l]),[s,a,u]}vi(Rx,"useUncontrolledState");function Px(t){return typeof t=="function"}vi(Px,"isFunction");var ng=Symbol("RADIX:SYNC_STATE");function Q1(t,o,s,a){const{prop:l,defaultProp:u,onChange:d,caller:h}=o,g=l!==void 0,v=Ex(d),w=[{...s,state:u}];a&&w.push(a);const[x,C]=m.useReducer((j,S)=>{if(S.type===ng)return{...j,state:S.state};const R=t(j,S);return g&&!Object.is(R.state,j.state)&&v(R.state),R},...w),y=x.state,_=m.useRef(y);m.useEffect(()=>{_.current!==y&&(_.current=y,g||v(y))},[y,_,g]);const b=m.useMemo(()=>l!==void 0?{...x,state:l}:x,[x,l]);return m.useEffect(()=>{g&&!Object.is(l,x.state)&&C({type:ng,state:l})},[l,x.state,g]),[b,C]}vi(Q1,"useControllableStateReducer");var X1=Object.defineProperty,sr=(t,o)=>X1(t,"name",{value:o,configurable:!0});function Tx(t,o){return m.useReducer((s,a)=>o[s][a]??s,t)}sr(Tx,"useStateMachine");var ur=sr(t=>{const{present:o,children:s}=t,a=Dx(o),l=typeof s=="function"?s({present:a.isPresent}):m.Children.only(s),u=Ox(a.ref,Mx(l));return typeof s=="function"||a.isPresent?m.cloneElement(l,{ref:u}):null},"Presence");function Dx(t){const[o,s]=m.useState(),a=m.useRef(null),l=m.useRef(t),u=m.useRef("none"),d=m.useRef(void 0),h=t?"mounted":"unmounted",[g,v]=Tx(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{g==="mounted"?(u.current=d.current??os(a.current),d.current=void 0):u.current="none"},[g]),Rt(()=>{const w=a.current,x=l.current;if(x!==t){const y=u.current,_=os(w);t?(d.current=_,v("MOUNT")):_==="none"||(w==null?void 0:w.display)==="none"?v("UNMOUNT"):v(x&&y!==_?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,v]),Rt(()=>{if(o){let w;const x=o.ownerDocument.defaultView??window,C=sr(_=>{const j=os(a.current).includes(CSS.escape(_.animationName));if(_.target===o&&j&&(v("ANIMATION_END"),!l.current)){const S=o.style.animationFillMode;o.style.animationFillMode="forwards",w=x.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=S)})}},"handleAnimationEnd"),y=sr(_=>{_.target===o&&(u.current=os(a.current))},"handleAnimationStart");return o.addEventListener("animationstart",y),o.addEventListener("animationcancel",C),o.addEventListener("animationend",C),()=>{x.clearTimeout(w),o.removeEventListener("animationstart",y),o.removeEventListener("animationcancel",C),o.removeEventListener("animationend",C)}}else v("ANIMATION_END")},[o,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:m.useCallback(w=>{if(w){const x=getComputedStyle(w);a.current=x,d.current=os(x)}else a.current=null;s(w)},[])}}sr(Dx,"usePresence");function id(t,o){if(typeof t=="function")return t(o);t!=null&&(t.current=o)}sr(id,"setRef");function Ox(...t){const o=m.useRef(t);return o.current=t,m.useCallback(s=>{const a=o.current;let l=!1;const u=a.map(d=>{const h=id(d,s);return!l&&typeof h=="function"&&(l=!0),h});if(l)return()=>{for(let d=0;dJ1(t,"name",{value:o,configurable:!0}),eC=Qr[" useId ".trim().toString()]||(()=>{}),tC=0;function Hr(t){const[o,s]=m.useState(eC());return Rt(()=>{t||s(a=>a??String(tC++))},[t]),t||(o?`radix-${o}`:"")}Z1(Hr,"useId");var nC=Object.defineProperty,rC=(t,o)=>nC(t,"name",{value:o,configurable:!0}),oC={LTR:"ltr"},sC=m.createContext(void 0);function Fd(t){const o=m.useContext(sC);return t||o||oC.LTR}rC(Fd,"useDirection");var iC=Object.defineProperty,aC=(t,o)=>iC(t,"name",{value:o,configurable:!0}),rg=Qr[" useInsertionEffect ".trim().toString()];function Mn(t){const o=m.useRef(t);return typeof rg=="function"?rg(()=>{o.current=t}):Rt(()=>{o.current=t}),m.useMemo(()=>((...s)=>{var a;return(a=o.current)==null?void 0:a.call(o,...s)}),[])}aC(Mn,"useCallbackRef");var lC=Object.defineProperty,xt=(t,o)=>lC(t,"name",{value:o,configurable:!0}),ad="dismissableLayer.update",cC="dismissableLayer.pointerDownOutside",uC="dismissableLayer.focusOutside",og,Ax=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),$d=m.forwardRef(xt(function(o,s){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:l=!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:g,onDismiss:v,...w}=o,x=m.useContext(Ax),[C,y]=m.useState(null),_=(C==null?void 0:C.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=m.useState({}),j=ze(s,y),S=Array.from(x.layers),[R]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),N=R?S.indexOf(R):-1,E=C?S.indexOf(C):-1,P=x.layersWithOutsidePointerEventsDisabled.size>0,L=E>=N,F=m.useRef(!1),A=Ix(Z=>{d==null||d(Z),g==null||g(Z),Z.defaultPrevented||v==null||v()},{ownerDocument:_,deferPointerDownOutside:l,isDeferredPointerDownOutsideRef:F,dismissableSurfaces:x.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(Z=>{if(!(Z instanceof Node))return!1;const se=[...x.branches].some(he=>he.contains(Z));return L&&!se},[x.branches,L])}),q=zx(Z=>{if(l&&F.current)return;const se=Z.target;[...x.branches].some(ye=>ye.contains(se))||(h==null||h(Z),g==null||g(Z),Z.defaultPrevented||v==null||v())},_),B=C?E===S.length-1:!1,z=Mn(Z=>{Z.key==="Escape"&&(u==null||u(Z),!Z.defaultPrevented&&v&&(Z.preventDefault(),v()))});return m.useEffect(()=>{if(B)return _.addEventListener("keydown",z,{capture:!0}),()=>_.removeEventListener("keydown",z,{capture:!0})},[_,B,z]),m.useEffect(()=>{if(C)return a&&(x.layersWithOutsidePointerEventsDisabled.size===0&&(og=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(C)),x.layers.add(C),ld(),()=>{a&&(x.layersWithOutsidePointerEventsDisabled.delete(C),x.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=og))}},[C,_,a,x]),m.useEffect(()=>()=>{C&&(x.layers.delete(C),x.layersWithOutsidePointerEventsDisabled.delete(C),ld())},[C,x]),m.useEffect(()=>{const Z=xt(()=>b({}),"handleUpdate");return document.addEventListener(ad,Z),()=>document.removeEventListener(ad,Z)},[]),r.jsx(Ue.div,{...w,ref:j,style:{pointerEvents:P?L?"auto":"none":void 0,...o.style},onFocusCapture:Pe(o.onFocusCapture,q.onFocusCapture),onBlurCapture:Pe(o.onBlurCapture,q.onBlurCapture),onPointerDownCapture:Pe(o.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function Lx(){const t=m.useContext(Ax),[o,s]=m.useState(null);return m.useEffect(()=>{if(o)return t.dismissableSurfaces.add(o),()=>{t.dismissableSurfaces.delete(o)}},[o,t.dismissableSurfaces]),s}xt(Lx,"useDismissableLayerSurface");var dC=xt(()=>!0,"IS_TRUE");function Ix(t,o){const{ownerDocument:s=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:l,dismissableSurfaces:u,shouldHandlePointerDownOutside:d=dC}=o,h=Mn(t),g=m.useRef(!1),v=m.useRef(!1),w=m.useRef(new Map),x=m.useRef(()=>{});return m.useEffect(()=>{function C(){v.current=!1,l.current=!1,w.current.clear()}xt(C,"resetOutsideInteraction");function y(){return Array.from(w.current.values()).some(Boolean)}xt(y,"isOutsideInteractionIntercepted");function _(N){if(!v.current)return;const E=N.target;E instanceof Node&&[...u].some(L=>L.contains(E))||w.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{v.current&&x.current()},0)}xt(_,"handleInteractionCapture");function b(N){v.current&&w.current.set(N.type,!1)}xt(b,"handleInteractionBubble");const j=xt(N=>{if(N.target&&!g.current){let E=function(){s.removeEventListener("click",x.current);const L=y();C(),L||Ud(cC,h,P,{discrete:!0})};if(xt(E,"handleAndDispatchPointerDownOutsideEvent"),!d(N.target)){s.removeEventListener("click",x.current),C(),g.current=!1;return}const P={originalEvent:N};v.current=!0,l.current=a&&N.button===0,w.current.clear(),!a||N.button!==0?E():(s.removeEventListener("click",x.current),x.current=E,s.addEventListener("click",x.current,{once:!0}))}else s.removeEventListener("click",x.current),C();g.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const N of S)s.addEventListener(N,_,!0),s.addEventListener(N,b);const R=window.setTimeout(()=>{s.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(R),s.removeEventListener("pointerdown",j),s.removeEventListener("click",x.current);for(const N of S)s.removeEventListener(N,_,!0),s.removeEventListener(N,b)}},[s,h,a,l,u,d]),{onPointerDownCapture:xt(()=>g.current=!0,"onPointerDownCapture")}}xt(Ix,"usePointerDownOutside");function zx(t,o=globalThis==null?void 0:globalThis.document){const s=Mn(t),a=m.useRef(!1);return m.useEffect(()=>{const l=xt(u=>{u.target&&!a.current&&Ud(uC,s,{originalEvent:u},{discrete:!1})},"handleFocus");return o.addEventListener("focusin",l),()=>o.removeEventListener("focusin",l)},[o,s]),{onFocusCapture:xt(()=>a.current=!0,"onFocusCapture"),onBlurCapture:xt(()=>a.current=!1,"onBlurCapture")}}xt(zx,"useFocusOutside");function ld(){const t=new CustomEvent(ad);document.dispatchEvent(t)}xt(ld,"dispatchUpdate");function Ud(t,o,s,{discrete:a}){const l=s.originalEvent.target,u=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:s});o&&l.addEventListener(t,o,{once:!0}),a?Ld(l,u):l.dispatchEvent(u)}xt(Ud,"handleAndDispatchCustomEvent");var fC=Object.defineProperty,st=(t,o)=>fC(t,"name",{value:o,configurable:!0}),Ru="focusScope.autoFocusOnMount",Pu="focusScope.autoFocusOnUnmount",sg={bubbles:!1,cancelable:!0},Fx=m.forwardRef(st(function(o,s){const{loop:a=!1,trapped:l=!1,branches:u,onMountAutoFocus:d,onUnmountAutoFocus:h,...g}=o,[v,w]=m.useState(null),x=Mn(d),C=Mn(h),y=m.useRef(null),_=ze(s,w),b=m.useRef(u);m.useEffect(()=>{b.current=u});const j=m.useCallback(N=>{var E;return N?v!=null&&v.contains(N)?!0:!!((E=b.current)!=null&&E.some(P=>P.contains(N))):!1},[v]),S=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(l){let N=function(F){if(S.paused||!v)return;const A=F.target;j(A)?y.current=A:Jn(y.current,{select:!0})},E=function(F){if(S.paused||!v)return;const A=F.relatedTarget;A!==null&&(j(A)||Jn(y.current,{select:!0}))},P=function(F){if(document.activeElement===document.body)for(const q of F)q.removedNodes.length>0&&Jn(v)};st(N,"handleFocusIn"),st(E,"handleFocusOut"),st(P,"handleMutations"),document.addEventListener("focusin",N),document.addEventListener("focusout",E);const L=new MutationObserver(P);return v&&L.observe(v,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",E),L.disconnect()}}},[l,v,S.paused,j]),m.useEffect(()=>{if(v){ig.add(S);const N=document.activeElement;if(!v.contains(N)){const P=new CustomEvent(Ru,sg);v.addEventListener(Ru,x),v.dispatchEvent(P),P.defaultPrevented||(Ux(Gx(Hd(v)),{select:!0}),document.activeElement===N&&Jn(v))}return()=>{v.removeEventListener(Ru,x);const P=v.ownerDocument,L=CustomEvent;setTimeout(()=>{const F=new L(Pu,sg);v.addEventListener(Pu,C),v.dispatchEvent(F),F.defaultPrevented||Jn(N??P.body,{select:!0}),v.removeEventListener(Pu,C),ig.remove(S)},0)}}},[v,x,C,S]);const R=m.useCallback(N=>{if(!a&&!l||S.paused)return;const E=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,P=document.activeElement;if(E&&P){const L=N.currentTarget,[F,A]=Bx(L);F&&A?!N.shiftKey&&P===A?(N.preventDefault(),a&&Jn(F,{select:!0})):N.shiftKey&&P===F&&(N.preventDefault(),a&&Jn(A,{select:!0})):P===L&&N.preventDefault()}},[a,l,S.paused]);return r.jsx(Ue.div,{tabIndex:-1,...g,ref:_,onKeyDown:R})},"FocusScope")),$x=m.createContext(null);function Bd({registry:t,children:o}){return t?r.jsx($x.Provider,{value:t,children:o}):o}st(Bd,"FocusScopeBranchProvider");function Wd(){const[t,o]=m.useState([]),s=m.useMemo(()=>({add:st(a=>o(l=>l.includes(a)?l:[...l,a]),"add"),remove:st(a=>o(l=>l.filter(u=>u!==a)),"remove")}),[]);return{nodes:t,registry:s}}st(Wd,"useFocusScopeBranchRegistry");function Vd(t){const o=m.useContext($x);m.useEffect(()=>{if(!(!t||!o))return o.add(t),()=>o.remove(t)},[t,o])}st(Vd,"useFocusScopeBranch");function Ux(t,{select:o=!1}={}){const s=document.activeElement;for(const a of t)if(Jn(a,{select:o}),document.activeElement!==s)return}st(Ux,"focusFirst");function Bx(t){const o=Hd(t),s=cd(o,t),a=cd(o.reverse(),t);return[s,a]}st(Bx,"getTabbableEdges");function Hd(t){const o=[],a=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:st(l=>{const u=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||u?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)o.push(a.currentNode);return o}st(Hd,"getTabbableCandidates");function cd(t,o){const s=typeof o.checkVisibility=="function"&&o.checkVisibility({checkVisibilityCSS:!0});for(const a of t)if(!(s?!a.checkVisibility({checkVisibilityCSS:!0}):Wx(a,{upTo:o})))return a}st(cd,"findVisible");function Wx(t,{upTo:o}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(o!==void 0&&t===o)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}st(Wx,"isHidden");function Vx(t){return t.tagName==="INPUT"&&typeof t.select=="function"}st(Vx,"isSelectableInput");function Jn(t,{select:o=!1}={}){if(t&&t.focus){const a=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==a&&Vx(t)&&o&&t.select()}}st(Jn,"focus");var ig=Hx();function Hx(){let t=[];return{add(o){const s=t[0];o!==s&&(s==null||s.pause()),t=ud(t,o),t.unshift(o)},remove(o){var s;t=ud(t,o),(s=t[0])==null||s.resume()}}}st(Hx,"createFocusScopesStack");function ud(t,o){const s=[...t],a=s.indexOf(o);return a!==-1&&s.splice(a,1),s}st(ud,"arrayRemove");function Gx(t){return t.filter(o=>o.tagName!=="A")}st(Gx,"removeLinks");var hC=Object.defineProperty,pC=(t,o)=>hC(t,"name",{value:o,configurable:!0}),Gd=m.forwardRef(pC(function(o,s){var g;const{container:a,...l}=o,[u,d]=m.useState(!1);Rt(()=>d(!0),[]);const h=a||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return h?_d.createPortal(r.jsx(Ue.div,{...l,ref:s}),h):null},"Portal")),mC=Object.defineProperty,Kd=(t,o)=>mC(t,"name",{value:o,configurable:!0}),Ia=0,Pn=null;function gC(t){return vl(),t.children}Kd(gC,"FocusGuards");function vl(){m.useEffect(()=>{Pn||(Pn={start:dd(),end:dd()});const{start:t,end:o}=Pn;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==o&&document.body.insertAdjacentElement("beforeend",o),Ia++,()=>{Ia===1&&(Pn==null||Pn.start.remove(),Pn==null||Pn.end.remove(),Pn=null),Ia=Math.max(0,Ia-1)}},[])}Kd(vl,"useFocusGuards");function dd(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Kd(dd,"createFocusGuard");var Dn=function(){return Dn=Object.assign||function(o){for(var s,a=1,l=arguments.length;a"u")return DC;var o=OC(t),s=document.documentElement.clientWidth,a=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,a-s+o[2]-o[0])}},AC=Qx(),is="data-scroll-locked",LC=function(t,o,s,a){var l=t.left,u=t.top,d=t.right,h=t.gap;return s===void 0&&(s="margin"),` - .`.concat(xC,` { - overflow: hidden `).concat(a,`; - padding-right: `).concat(h,"px ").concat(a,`; - } - body[`).concat(is,`] { - overflow: hidden `).concat(a,`; - overscroll-behavior: contain; - `).concat([o&&"position: relative ".concat(a,";"),s==="margin"&&` - padding-left: `.concat(l,`px; - padding-top: `).concat(u,`px; - padding-right: `).concat(d,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(h,"px ").concat(a,`; - `),s==="padding"&&"padding-right: ".concat(h,"px ").concat(a,";")].filter(Boolean).join(""),` - } - - .`).concat(Ka,` { - right: `).concat(h,"px ").concat(a,`; - } - - .`).concat(qa,` { - margin-right: `).concat(h,"px ").concat(a,`; - } - - .`).concat(Ka," .").concat(Ka,` { - right: 0 `).concat(a,`; - } - - .`).concat(qa," .").concat(qa,` { - margin-right: 0 `).concat(a,`; - } - - body[`).concat(is,`] { - `).concat(yC,": ").concat(h,`px; - } -`)},lg=function(){var t=parseInt(document.body.getAttribute(is)||"0",10);return isFinite(t)?t:0},IC=function(){m.useEffect(function(){return document.body.setAttribute(is,(lg()+1).toString()),function(){var t=lg()-1;t<=0?document.body.removeAttribute(is):document.body.setAttribute(is,t.toString())}},[])},zC=function(t){var o=t.noRelative,s=t.noImportant,a=t.gapMode,l=a===void 0?"margin":a;IC();var u=m.useMemo(function(){return MC(l)},[l]);return m.createElement(AC,{styles:LC(u,!o,l,s?"":"!important")})},fd=!1;if(typeof window<"u")try{var za=Object.defineProperty({},"passive",{get:function(){return fd=!0,!0}});window.addEventListener("test",za,za),window.removeEventListener("test",za,za)}catch{fd=!1}var Jo=fd?{passive:!1}:!1,FC=function(t){return t.tagName==="TEXTAREA"},Xx=function(t,o){if(!(t instanceof Element))return!1;var s=window.getComputedStyle(t);return s[o]!=="hidden"&&!(s.overflowY===s.overflowX&&!FC(t)&&s[o]==="visible")},$C=function(t){return Xx(t,"overflowY")},UC=function(t){return Xx(t,"overflowX")},cg=function(t,o){var s=o.ownerDocument,a=o;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=Jx(t,a);if(l){var u=Zx(t,a),d=u[1],h=u[2];if(d>h)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},BC=function(t){var o=t.scrollTop,s=t.scrollHeight,a=t.clientHeight;return[o,s,a]},WC=function(t){var o=t.scrollLeft,s=t.scrollWidth,a=t.clientWidth;return[o,s,a]},Jx=function(t,o){return t==="v"?$C(o):UC(o)},Zx=function(t,o){return t==="v"?BC(o):WC(o)},VC=function(t,o){return t==="h"&&o==="rtl"?-1:1},HC=function(t,o,s,a,l){var u=VC(t,window.getComputedStyle(o).direction),d=u*a,h=s.target,g=o.contains(h),v=!1,w=d>0,x=0,C=0;do{if(!h)break;var y=Zx(t,h),_=y[0],b=y[1],j=y[2],S=b-j-u*_;(_||S)&&Jx(t,h)&&(x+=S,C+=_);var R=h.parentNode;h=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!g&&h!==document.body||g&&(o.contains(h)||o===h));return(w&&Math.abs(x)<1||!w&&Math.abs(C)<1)&&(v=!0),v},Fa=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},ug=function(t){return[t.deltaX,t.deltaY]},dg=function(t){return t&&"current"in t?t.current:t},GC=function(t,o){return t[0]===o[0]&&t[1]===o[1]},KC=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},qC=0,Zo=[];function YC(t){var o=m.useRef([]),s=m.useRef([0,0]),a=m.useRef(),l=m.useState(qC++)[0],u=m.useState(Qx)[0],d=m.useRef(t);m.useEffect(function(){d.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var b=vC([t.lockRef.current],(t.shards||[]).map(dg),!0).filter(Boolean);return b.forEach(function(j){return j.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),b.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var h=m.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!d.current.allowPinchZoom;var S=Fa(b),R=s.current,N="deltaX"in b?b.deltaX:R[0]-S[0],E="deltaY"in b?b.deltaY:R[1]-S[1],P,L=b.target,F=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in b&&F==="h"&&L.type==="range")return!1;var A=window.getSelection(),q=A&&A.anchorNode,B=q?q===L||q.contains(L):!1;if(B)return!1;var z=cg(F,L);if(!z)return!0;if(z?P=F:(P=F==="v"?"h":"v",z=cg(F,L)),!z)return!1;if(!a.current&&"changedTouches"in b&&(N||E)&&(a.current=P),!P)return!0;var Z=a.current||P;return HC(Z,j,b,Z==="h"?N:E)},[]),g=m.useCallback(function(b){var j=b;if(!(!Zo.length||Zo[Zo.length-1]!==u)){var S="deltaY"in j?ug(j):Fa(j),R=o.current.filter(function(P){return P.name===j.type&&(P.target===j.target||j.target===P.shadowParent)&&GC(P.delta,S)})[0];if(R&&R.should){j.cancelable&&j.preventDefault();return}if(!R){var N=(d.current.shards||[]).map(dg).filter(Boolean).filter(function(P){return P.contains(j.target)}),E=N.length>0?h(j,N[0]):!d.current.noIsolation;E&&j.cancelable&&j.preventDefault()}}},[]),v=m.useCallback(function(b,j,S,R){var N={name:b,delta:j,target:S,should:R,shadowParent:QC(S)};o.current.push(N),setTimeout(function(){o.current=o.current.filter(function(E){return E!==N})},1)},[]),w=m.useCallback(function(b){s.current=Fa(b),a.current=void 0},[]),x=m.useCallback(function(b){v(b.type,ug(b),b.target,h(b,t.lockRef.current))},[]),C=m.useCallback(function(b){v(b.type,Fa(b),b.target,h(b,t.lockRef.current))},[]);m.useEffect(function(){return Zo.push(u),t.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:C}),document.addEventListener("wheel",g,Jo),document.addEventListener("touchmove",g,Jo),document.addEventListener("touchstart",w,Jo),function(){Zo=Zo.filter(function(b){return b!==u}),document.removeEventListener("wheel",g,Jo),document.removeEventListener("touchmove",g,Jo),document.removeEventListener("touchstart",w,Jo)}},[]);var y=t.removeScrollBar,_=t.inert;return m.createElement(m.Fragment,null,_?m.createElement(u,{styles:KC(l)}):null,y?m.createElement(zC,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function QC(t){for(var o=null;t!==null;)t instanceof ShadowRoot&&(o=t.host,t=t.host),t=t.parentNode;return o}const XC=_C(Yx,YC);var qd=m.forwardRef(function(t,o){return m.createElement(xl,Dn({},t,{ref:o,sideCar:XC}))});qd.classNames=xl.classNames;var JC=function(t){if(typeof document>"u")return null;var o=Array.isArray(t)?t[0]:t;return o.ownerDocument.body},es=new WeakMap,$a=new WeakMap,Ua={},Mu=0,ey=function(t){return t&&(t.host||ey(t.parentNode))},ZC=function(t,o){return o.map(function(s){if(t.contains(s))return s;var a=ey(s);return a&&t.contains(a)?a:(console.error("aria-hidden",s,"in not contained inside",t,". Doing nothing"),null)}).filter(function(s){return!!s})},eS=function(t,o,s,a){var l=ZC(o,Array.isArray(t)?t:[t]);Ua[s]||(Ua[s]=new WeakMap);var u=Ua[s],d=[],h=new Set,g=new Set(l),v=function(x){!x||h.has(x)||(h.add(x),v(x.parentNode))};l.forEach(v);var w=function(x){!x||g.has(x)||Array.prototype.forEach.call(x.children,function(C){if(h.has(C))w(C);else try{var y=C.getAttribute(a),_=y!==null&&y!=="false",b=(es.get(C)||0)+1,j=(u.get(C)||0)+1;es.set(C,b),u.set(C,j),d.push(C),b===1&&_&&$a.set(C,!0),j===1&&C.setAttribute(s,"true"),_||C.setAttribute(a,"true")}catch(S){console.error("aria-hidden: cannot operate on ",C,S)}})};return w(o),h.clear(),Mu++,function(){d.forEach(function(x){var C=es.get(x)-1,y=u.get(x)-1;es.set(x,C),u.set(x,y),C||($a.has(x)||x.removeAttribute(a),$a.delete(x)),y||x.removeAttribute(s)}),Mu--,Mu||(es=new WeakMap,es=new WeakMap,$a=new WeakMap,Ua={})}},ty=function(t,o,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),l=JC(t);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),eS(a,l,s,"aria-hidden")):function(){return null}},tS=Object.defineProperty,Ut=(t,o)=>tS(t,"name",{value:o,configurable:!0}),Yd="Dialog",[ny,ry]=jn(Yd),[nS,kn]=ny(Yd),Qd=Ut(t=>{const{__scopeDialog:o,children:s,open:a,defaultOpen:l,onOpenChange:u,modal:d=!0}=t,h=m.useRef(null),g=m.useRef(null),{nodes:v,registry:w}=Wd(),[x,C]=ms({prop:a,defaultProp:l??!1,onChange:u,caller:Yd}),[y,_]=m.useState(0),[b,j]=m.useState(0);return r.jsx(nS,{scope:o,triggerRef:h,contentRef:g,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),titlePresent:y>0,descriptionPresent:b>0,setTitleCount:_,setDescriptionCount:j,open:x,onOpenChange:C,onOpenToggle:m.useCallback(()=>C(S=>!S),[C]),modal:d,branchNodes:v,branchRegistry:w,children:s})},"Dialog"),rS="DialogTrigger",oS=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=kn(rS,a),d=ze(s,u.triggerRef);return r.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":yl(u.open),...l,ref:d,onClick:Pe(o.onClick,u.onOpenToggle)})},"DialogTrigger")),oy="DialogPortal",[sS,sy]=ny(oy,{forceMount:void 0}),Xd=Ut(t=>{const{__scopeDialog:o,forceMount:s,children:a,container:l}=t,u=kn(oy,o);return r.jsx(sS,{scope:o,forceMount:s,children:m.Children.map(a,d=>r.jsx(ur,{present:s||u.open,children:r.jsx(Gd,{asChild:!0,container:l,children:d})}))})},"DialogPortal"),hd="DialogOverlay",Jd=m.forwardRef(Ut(function(o,s){const a=sy(hd,o.__scopeDialog),{forceMount:l=a.forceMount,...u}=o,d=kn(hd,o.__scopeDialog);return d.modal?r.jsx(ur,{present:l||d.open,children:r.jsx(aS,{...u,ref:s})}):null},"DialogOverlay")),iS=or("DialogOverlay.RemoveScroll"),aS=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=kn(hd,a),d=Lx(),h=ze(s,d);return r.jsx(qd,{as:iS,allowPinchZoom:!0,shards:m.useMemo(()=>[u.contentRef,...u.branchNodes.map(g=>({current:g}))],[u.contentRef,u.branchNodes]),children:r.jsx(Ue.div,{"data-state":yl(u.open),...l,ref:h,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),fi="DialogContent",Zd=m.forwardRef(Ut(function(o,s){const a=sy(fi,o.__scopeDialog),{forceMount:l=a.forceMount,...u}=o,d=kn(fi,o.__scopeDialog);return r.jsx(ur,{present:l||d.open,children:d.modal?r.jsx(lS,{...u,ref:s}):r.jsx(cS,{...u,ref:s})})},"DialogContent")),lS=m.forwardRef(Ut(function(o,s){const a=kn(fi,o.__scopeDialog),l=m.useRef(null),u=ze(s,a.contentRef,l);return m.useEffect(()=>{const d=l.current;if(d)return ty(d)},[]),r.jsx(iy,{...o,ref:u,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Pe(o.onCloseAutoFocus,d=>{var h;d.preventDefault(),(h=a.triggerRef.current)==null||h.focus()}),onPointerDownOutside:Pe(o.onPointerDownOutside,d=>{const h=d.detail.originalEvent,g=h.button===0&&h.ctrlKey===!0;(h.button===2||g)&&d.preventDefault()}),onFocusOutside:Pe(o.onFocusOutside,d=>d.preventDefault())})},"DialogContentModal")),cS=m.forwardRef(Ut(function(o,s){const a=kn(fi,o.__scopeDialog),l=m.useRef(!1),u=m.useRef(!1);return r.jsx(iy,{...o,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var h,g;(h=o.onCloseAutoFocus)==null||h.call(o,d),d.defaultPrevented||(l.current||(g=a.triggerRef.current)==null||g.focus(),d.preventDefault()),l.current=!1,u.current=!1},onInteractOutside:d=>{var v,w;(v=o.onInteractOutside)==null||v.call(o,d),d.defaultPrevented||(l.current=!0,d.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const h=d.target;((w=a.triggerRef.current)==null?void 0:w.contains(h))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&u.current&&d.preventDefault()}})},"DialogContentNonModal")),iy=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:d,"aria-describedby":h,children:g,...v}=o,w=kn(fi,a);return vl(),r.jsx(Bd,{registry:w.branchRegistry,children:r.jsx(Fx,{asChild:!0,loop:!0,trapped:l,branches:w.branchNodes,onMountAutoFocus:u,onUnmountAutoFocus:d,children:r.jsx($d,{role:"dialog",id:w.contentId,"aria-labelledby":w.titlePresent?w.titleId:void 0,"aria-describedby":w.descriptionPresent?ay(h,w.descriptionId):h,"data-state":yl(w.open),...v,ref:s,deferPointerDownOutside:!0,onDismiss:()=>w.onOpenChange(!1),children:g})})})},"DialogContentImpl")),ef=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=kn("DialogTitle",a),{setTitleCount:d}=u;return Rt(()=>(d(h=>h+1),()=>d(h=>h-1)),[d]),r.jsx(Ue.h2,{id:u.titleId,...l,ref:s})},"DialogTitle")),tf=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=kn("DialogDescription",a),{setDescriptionCount:d}=u;return Rt(()=>(d(h=>h+1),()=>d(h=>h-1)),[d]),r.jsx(Ue.p,{id:u.descriptionId,...l,ref:s})},"DialogDescription")),uS="DialogClose",xi=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=kn(uS,a);return r.jsx(Ue.button,{type:"button",...l,ref:s,onClick:Pe(o.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function ay(...t){const o=new Set;for(const s of t)if(typeof s=="string")for(const a of String(s).trim().split(/\s+/))a&&o.add(a);return o.size>0?Array.from(o).join(" "):void 0}Ut(ay,"concatAriaDescribedby");function yl(t){return t?"open":"closed"}Ut(yl,"getState");var dS=Object.defineProperty,dr=(t,o)=>dS(t,"name",{value:o,configurable:!0}),fS="AlertDialog",[hS,MR]=jn(fS,[ry]),fr=ry(),pS=dr(t=>{const{__scopeAlertDialog:o,...s}=t,a=fr(o);return r.jsx(Qd,{...a,...s,modal:!0})},"AlertDialog");m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(oS,{...u,...l,ref:s})},"AlertDialogTrigger"));var mS=dr(t=>{const{__scopeAlertDialog:o,...s}=t,a=fr(o);return r.jsx(Xd,{...a,...s})},"AlertDialogPortal"),gS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(Jd,{...u,...l,ref:s})},"AlertDialogOverlay")),vS="AlertDialogContent",[xS,yS]=hS(vS),wS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,children:l,...u}=o,d=fr(a),h=m.useRef(null),g=ze(s,h),v=m.useRef(null);return r.jsx(xS,{scope:a,cancelRef:v,children:r.jsx(Zd,{role:"alertdialog",...d,...u,ref:g,onOpenAutoFocus:Pe(u.onOpenAutoFocus,w=>{var x;w.preventDefault(),(x=v.current)==null||x.focus({preventScroll:!0})}),onPointerDownOutside:w=>w.preventDefault(),onInteractOutside:w=>w.preventDefault(),children:l})})},"AlertDialogContent")),bS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(ef,{...u,...l,ref:s})},"AlertDialogTitle")),jS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(tf,{...u,...l,ref:s})},"AlertDialogDescription")),kS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(xi,{...u,...l,ref:s})},"AlertDialogAction")),CS="AlertDialogCancel",SS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,{cancelRef:u}=yS(CS,a),d=fr(a),h=ze(s,u);return r.jsx(xi,{...d,...l,ref:h})},"AlertDialogCancel")),_S=Object.defineProperty,NS=(t,o)=>_S(t,"name",{value:o,configurable:!0});function nf(t){const[o,s]=m.useState(void 0);return Rt(()=>{if(t){s({width:t.offsetWidth,height:t.offsetHeight});let a=0;const l=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const d=u[0];window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{let h,g;if("borderBoxSize"in d){const v=d.borderBoxSize,w=Array.isArray(v)?v[0]:v;h=w.inlineSize,g=w.blockSize}else h=t.offsetWidth,g=t.offsetHeight;s({width:h,height:g})})});return l.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(a),l.unobserve(t)}}else s(void 0)},[t]),o}NS(nf,"useSize");var ES=Object.defineProperty,ir=(t,o)=>ES(t,"name",{value:o,configurable:!0}),rf="Checkbox",[RS,AR]=jn(rf),[PS,of]=RS(rf);function ly(t){const{__scopeCheckbox:o,checked:s,children:a,defaultChecked:l,disabled:u,form:d,name:h,onCheckedChange:g,required:v,value:w="on",internal_do_not_use_render:x}=t,[C,y]=ms({prop:s,defaultProp:l??!1,onChange:g,caller:rf}),[_,b]=m.useState(null),[j,S]=m.useState(null),[R,N]=m.useState(null),E=_?!!d||!!_.closest("form"):!0,P={checked:C,disabled:u,setChecked:y,control:_,setControl:b,name:h,form:d,value:w,userClick:R,onUserClick:N,required:v,defaultChecked:sn(l)?!1:l,isFormControl:E,bubbleInput:j,setBubbleInput:S};return r.jsx(PS,{scope:o,...P,children:cy(x)?x(P):a})}ir(ly,"CheckboxProvider");var TS="CheckboxTrigger",DS=m.forwardRef(ir(function({__scopeCheckbox:o,onKeyDown:s,onClick:a,...l},u){const{control:d,value:h,disabled:g,checked:v,required:w,setControl:x,setChecked:C,onUserClick:y,isFormControl:_,bubbleInput:b}=of(TS,o),j=ze(u,x),S=m.useRef(v);return m.useEffect(()=>{const R=d==null?void 0:d.form;if(R){const N=ir(()=>C(S.current),"reset");return R.addEventListener("reset",N),()=>R.removeEventListener("reset",N)}},[d,C]),r.jsx(Ue.button,{type:"button",role:"checkbox","aria-checked":sn(v)?"mixed":v,"aria-required":w,"data-state":sf(v),"data-disabled":g?"":void 0,disabled:g,value:h,...l,ref:j,onKeyDown:Pe(s,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Pe(a,R=>{const N=R.isPropagationStopped();y({requestedChecked:sn(v)?!0:!v,hasConsumerStoppedPropagation:N}),C(E=>sn(E)?!0:!E),b&&_&&(N||R.stopPropagation())})})},"CheckboxTrigger")),OS=m.forwardRef(ir(function(o,s){const{__scopeCheckbox:a,name:l,checked:u,defaultChecked:d,required:h,disabled:g,value:v,onCheckedChange:w,form:x,...C}=o;return r.jsx(ly,{__scopeCheckbox:a,checked:u,defaultChecked:d,disabled:g,required:h,onCheckedChange:w,name:l,form:x,value:v,internal_do_not_use_render:({isFormControl:y})=>r.jsxs(r.Fragment,{children:[r.jsx(DS,{...C,ref:s,__scopeCheckbox:a}),y&&r.jsx(IS,{__scopeCheckbox:a})]})})},"Checkbox")),MS="CheckboxIndicator",AS=m.forwardRef(ir(function(o,s){const{__scopeCheckbox:a,forceMount:l,...u}=o,d=of(MS,a);return r.jsx(ur,{present:l||sn(d.checked)||d.checked===!0,children:r.jsx(Ue.span,{"data-state":sf(d.checked),"data-disabled":d.disabled?"":void 0,...u,ref:s,style:{pointerEvents:"none",...o.style}})})},"CheckboxIndicator")),LS="CheckboxBubbleInput",IS=m.forwardRef(ir(function({__scopeCheckbox:o,onClick:s,...a},l){const{control:u,userClick:d,checked:h,defaultChecked:g,required:v,disabled:w,name:x,value:C,form:y,bubbleInput:_,setBubbleInput:b}=of(LS,o),j=ze(l,b),S=nf(u),R=m.useRef(!1),N=m.useRef(h),E=m.useRef(d),P=m.useRef(null);m.useEffect(()=>{const F=_;if(!F)return;const A=window.HTMLInputElement.prototype,B=Object.getOwnPropertyDescriptor(A,"checked").set;if(!B)return;const z=N.current!==h;N.current=h;const Z=d!==null&&d!==E.current;if(E.current=d,Z)P.current=z?null:d,z&&(F.indeterminate=sn(h),B.call(F,sn(h)?!1:h)),F.dispatchEvent(new Event("click",{bubbles:!d.hasConsumerStoppedPropagation}));else if(z){const se=P.current;P.current=null;const he=(se==null?void 0:se.requestedChecked)===h;R.current=!0,F.indeterminate=sn(h),B.call(F,sn(h)?!1:h),F.dispatchEvent(new Event("click",{bubbles:!(he&&se.hasConsumerStoppedPropagation)})),R.current=!1}},[_,h,d]);const L=m.useRef(sn(h)?!1:h);return r.jsx(Ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??L.current,required:v,disabled:w,name:x,value:C,form:y,...a,tabIndex:-1,ref:j,onClick:Pe(s,F=>{R.current&&F.stopPropagation()}),style:{...a.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function cy(t){return typeof t=="function"}ir(cy,"isFunction");function sn(t){return t==="indeterminate"}ir(sn,"isIndeterminate");function sf(t){return sn(t)?"indeterminate":t?"checked":"unchecked"}ir(sf,"getState");const zS=["top","right","bottom","left"],qr=Math.min,tr=Math.max,nl=Math.round,Ba=Math.floor,nr=t=>({x:t,y:t}),FS={left:"right",right:"left",bottom:"top",top:"bottom"};function uy(t,o,s){return tr(t,qr(o,s))}function ar(t,o){return typeof t=="function"?t(o):t}function Yr(t){return t.split("-")[0]}function gs(t){return t.split("-")[1]}function af(t){return t==="x"?"y":"x"}function lf(t){return t==="y"?"height":"width"}function On(t){const o=t[0];return o==="t"||o==="b"?"y":"x"}function cf(t){return af(On(t))}function $S(t,o,s){s===void 0&&(s=!1);const a=gs(t),l=cf(t),u=lf(l);let d=l==="x"?a===(s?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[u]>o.floating[u]&&(d=rl(d)),[d,rl(d)]}function US(t){const o=rl(t);return[pd(t),o,pd(o)]}function pd(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const fg=["left","right"],hg=["right","left"],BS=["top","bottom"],WS=["bottom","top"];function VS(t,o,s){switch(t){case"top":case"bottom":return s?o?hg:fg:o?fg:hg;case"left":case"right":return o?BS:WS;default:return[]}}function HS(t,o,s,a){const l=gs(t);let u=VS(Yr(t),s==="start",a);return l&&(u=u.map(d=>d+"-"+l),o&&(u=u.concat(u.map(pd)))),u}function rl(t){const o=Yr(t);return FS[o]+t.slice(o.length)}function GS(t){var o,s,a,l;return{top:(o=t.top)!=null?o:0,right:(s=t.right)!=null?s:0,bottom:(a=t.bottom)!=null?a:0,left:(l=t.left)!=null?l:0}}function dy(t){return typeof t!="number"?GS(t):{top:t,right:t,bottom:t,left:t}}function ol(t){const{x:o,y:s,width:a,height:l}=t;return{width:a,height:l,top:s,left:o,right:o+a,bottom:s+l,x:o,y:s}}function pg(t,o,s){let{reference:a,floating:l}=t;const u=On(o),d=cf(o),h=lf(d),g=Yr(o),v=u==="y",w=a.x+a.width/2-l.width/2,x=a.y+a.height/2-l.height/2,C=a[h]/2-l[h]/2;let y;switch(g){case"top":y={x:w,y:a.y-l.height};break;case"bottom":y={x:w,y:a.y+a.height};break;case"right":y={x:a.x+a.width,y:x};break;case"left":y={x:a.x-l.width,y:x};break;default:y={x:a.x,y:a.y}}const _=gs(o);return _&&(y[d]+=C*(_==="end"?1:-1)*(s&&v?-1:1)),y}async function KS(t,o){var s;o===void 0&&(o={});const{x:a,y:l,platform:u,rects:d,elements:h,strategy:g}=t,{boundary:v="clippingAncestors",rootBoundary:w="viewport",elementContext:x="floating",altBoundary:C=!1,padding:y=0}=ar(o,t),_=dy(y),j=h[C?x==="floating"?"reference":"floating":x],S=ol(await u.getClippingRect({element:(s=await(u.isElement==null?void 0:u.isElement(j)))==null||s?j:j.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(h.floating)),boundary:v,rootBoundary:w,strategy:g})),R=x==="floating"?{x:a,y:l,width:d.floating.width,height:d.floating.height}:d.reference,N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h.floating)),E=await(u.isElement==null?void 0:u.isElement(N))&&await(u.getScale==null?void 0:u.getScale(N))||{x:1,y:1},P=ol(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:R,offsetParent:N,strategy:g}):R);return{top:(S.top-P.top+_.top)/E.y,bottom:(P.bottom-S.bottom+_.bottom)/E.y,left:(S.left-P.left+_.left)/E.x,right:(P.right-S.right+_.right)/E.x}}const qS=50,YS=async(t,o,s)=>{const{placement:a="bottom",strategy:l="absolute",middleware:u=[],platform:d}=s,h=d.detectOverflow?d:{...d,detectOverflow:KS},g=await(d.isRTL==null?void 0:d.isRTL(o));let v=await d.getElementRects({reference:t,floating:o,strategy:l}),{x:w,y:x}=pg(v,a,g),C=a,y=0;const _={};for(let b=0;b({name:"arrow",options:t,async fn(o){const{x:s,y:a,placement:l,rects:u,platform:d,elements:h,middlewareData:g}=o,{element:v,padding:w=0}=ar(t,o)||{};if(v==null)return{};const x=dy(w),C={x:s,y:a},y=cf(l),_=lf(y),b=await d.getDimensions(v),j=y==="y",S=j?"top":"left",R=j?"bottom":"right",N=j?"clientHeight":"clientWidth",E=u.reference[_]+u.reference[y]-C[y]-u.floating[_],P=C[y]-u.reference[y],L=await(d.getOffsetParent==null?void 0:d.getOffsetParent(v));let F=L?L[N]:0;(!F||!await(d.isElement==null?void 0:d.isElement(L)))&&(F=h.floating[N]||u.floating[_]);const A=E/2-P/2,q=F/2-b[_]/2-1,B=qr(x[S],q),z=qr(x[R],q),Z=F-b[_]-z,se=F/2-b[_]/2+A,he=uy(B,se,Z),ye=!g.arrow&&gs(l)!=null&&se!==he&&u.reference[_]/2-(sehe<=0)){var z,Z;const he=(((z=u.flip)==null?void 0:z.index)||0)+1,ye=F[he];if(ye&&(!(x==="alignment"?R!==On(ye):!1)||B.every(H=>On(H.placement)===R?H.overflows[0]>0:!0)))return{data:{index:he,overflows:B},reset:{placement:ye}};let ae=(Z=B.filter(oe=>oe.overflows[0]<=0).sort((oe,H)=>oe.overflows[1]-H.overflows[1])[0])==null?void 0:Z.placement;if(!ae)switch(y){case"bestFit":{var se;const oe=(se=B.filter(H=>{if(L){const J=On(H.placement);return J===R||J==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(J=>J>0).reduce((J,$)=>J+$,0)]).sort((H,J)=>H[1]-J[1])[0])==null?void 0:se[0];oe&&(ae=oe);break}case"initialPlacement":ae=h;break}if(l!==ae)return{reset:{placement:ae}}}return{}}}};function mg(t,o){return{top:t.top-o.height,right:t.right-o.width,bottom:t.bottom-o.height,left:t.left-o.width}}function gg(t){return zS.some(o=>t[o]>=0)}const JS=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(o){const{rects:s,platform:a}=o,{strategy:l="referenceHidden",...u}=ar(t,o);switch(l){case"referenceHidden":{const d=await a.detectOverflow(o,{...u,elementContext:"reference"}),h=mg(d,s.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:gg(h)}}}case"escaped":{const d=await a.detectOverflow(o,{...u,altBoundary:!0}),h=mg(d,s.floating);return{data:{escapedOffsets:h,escaped:gg(h)}}}default:return{}}}}},fy=new Set(["left","top"]);async function ZS(t,o){const{placement:s,platform:a,elements:l}=t,u=await(a.isRTL==null?void 0:a.isRTL(l.floating)),d=Yr(s),h=gs(s),g=On(s)==="y",v=fy.has(d)?-1:1,w=u&&g?-1:1,x=ar(o,t);let{mainAxis:C,crossAxis:y,alignmentAxis:_}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return h&&typeof _=="number"&&(y=h==="end"?_*-1:_),g?{x:y*w,y:C*v}:{x:C*v,y:y*w}}const e_=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var s,a;const{x:l,y:u,placement:d,middlewareData:h}=o,g=await ZS(o,t);return d===((s=h.offset)==null?void 0:s.placement)&&(a=h.arrow)!=null&&a.alignmentOffset?{}:{x:l+g.x,y:u+g.y,data:{...g,placement:d}}}}},t_=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){const{x:s,y:a,placement:l,platform:u}=o,{mainAxis:d=!0,crossAxis:h=!1,limiter:g={fn:R=>{let{x:N,y:E}=R;return{x:N,y:E}}},...v}=ar(t,o),w={x:s,y:a},x=await u.detectOverflow(o,v),C=On(l),y=af(C);let _=w[y],b=w[C];const j=(R,N)=>uy(N+x[R==="y"?"top":"left"],N,N-x[R==="y"?"bottom":"right"]);d&&(_=j(y,_)),h&&(b=j(C,b));const S=g.fn({...o,[y]:_,[C]:b});return{...S,data:{x:S.x-s,y:S.y-a,enabled:{[y]:d,[C]:h}}}}}},n_=function(t){return t===void 0&&(t={}),{options:t,fn(o){var s,a;const{x:l,y:u,placement:d,rects:h,middlewareData:g}=o,{offset:v=0,mainAxis:w=!0,crossAxis:x=!0}=ar(t,o),C={x:l,y:u},y=On(d),_=af(y);let b=C[_],j=C[y];const S=ar(v,o),R=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(s=S.mainAxis)!=null?s:0,crossAxis:(a=S.crossAxis)!=null?a:0};if(w){const P=_==="y"?"height":"width",L=h.reference[_]-h.floating[P]+R.mainAxis,F=h.reference[_]+h.reference[P]-R.mainAxis;bF&&(b=F)}if(x){var N,E;const P=_==="y"?"width":"height",L=fy.has(Yr(d)),F=h.reference[y]-h.floating[P]+(L&&((N=g.offset)==null?void 0:N[y])||0)+(L?0:R.crossAxis),A=h.reference[y]+h.reference[P]+(L?0:((E=g.offset)==null?void 0:E[y])||0)-(L?R.crossAxis:0);jA&&(j=A)}return{[_]:b,[y]:j}}}},r_=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(o){const{placement:s,rects:a,platform:l,elements:u}=o,{apply:d=()=>{},...h}=ar(t,o),g=await l.detectOverflow(o,h),v=Yr(s),w=gs(s),x=On(s)==="y",{width:C,height:y}=a.floating;let _,b;v==="top"||v==="bottom"?(_=v,b=w===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(b=v,_=w==="end"?"top":"bottom");const j=y-g.top-g.bottom,S=C-g.left-g.right,R=qr(y-g[_],j),N=qr(C-g[b],S),E=o.middlewareData.shift,P=!E;let L=R,F=N;E!=null&&E.enabled.x&&(F=S),E!=null&&E.enabled.y&&(L=j),P&&!w&&(x?F=C-2*tr(g.left,g.right):L=y-2*tr(g.top,g.bottom)),await d({...o,availableWidth:F,availableHeight:L});const A=await l.getDimensions(u.floating);return C!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function wl(){return typeof window<"u"}function vs(t){return hy(t)?(t.nodeName||"").toLowerCase():"#document"}function $t(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function hr(t){var o;return(o=(hy(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function hy(t){return wl()?t instanceof Node||t instanceof $t(t).Node:!1}function An(t){return wl()?t instanceof Element||t instanceof $t(t).Element:!1}function Zr(t){return wl()?t instanceof HTMLElement||t instanceof $t(t).HTMLElement:!1}function vg(t){return!wl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $t(t).ShadowRoot}function bl(t){const{overflow:o,overflowX:s,overflowY:a,display:l}=Ln(t);return/auto|scroll|overlay|hidden|clip/.test(o+a+s)&&l!=="inline"&&l!=="contents"}function o_(t){return/^(table|td|th)$/.test(vs(t))}function jl(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const s_=/transform|translate|scale|rotate|perspective|filter/,i_=/paint|layout|strict|content/,yo=t=>!!t&&t!=="none";let Au;function uf(t){const o=An(t)?Ln(t):t;return yo(o.transform)||yo(o.translate)||yo(o.scale)||yo(o.rotate)||yo(o.perspective)||!df()&&(yo(o.backdropFilter)||yo(o.filter))||s_.test(o.willChange||"")||i_.test(o.contain||"")}function a_(t){let o=bo(t);for(;Zr(o)&&!hi(o);){if(uf(o))return o;if(jl(o))return null;o=bo(o)}return null}function df(){return Au==null&&(Au=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Au}function hi(t){return/^(html|body|#document)$/.test(vs(t))}function Ln(t){return $t(t).getComputedStyle(t)}function kl(t){return An(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function bo(t){if(vs(t)==="html")return t;const o=t.assignedSlot||t.parentNode||vg(t)&&t.host||hr(t);return vg(o)?o.host:o}function py(t){const o=bo(t);return hi(o)?(t.ownerDocument||t).body:Zr(o)&&bl(o)?o:py(o)}function pi(t,o,s){var a;o===void 0&&(o=[]),s===void 0&&(s=!0);const l=py(t),u=l===((a=t.ownerDocument)==null?void 0:a.body),d=$t(l);if(u){const h=md(d);return o.concat(d,d.visualViewport||[],bl(l)?l:[],h&&s?pi(h):[])}else return o.concat(l,pi(l,[],s))}function md(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function my(t){const o=Ln(t);let s=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const l=Zr(t),u=l?t.offsetWidth:s,d=l?t.offsetHeight:a,h=nl(s)!==u||nl(a)!==d;return h&&(s=u,a=d),{width:s,height:a,$:h}}function ff(t){return An(t)?t:t.contextElement}function as(t){const o=ff(t);if(!Zr(o))return nr(1);const s=o.getBoundingClientRect(),{width:a,height:l,$:u}=my(o);let d=(u?nl(s.width):s.width)/a,h=(u?nl(s.height):s.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!h||!Number.isFinite(h))&&(h=1),{x:d,y:h}}const l_=nr(0);function gy(t){const o=$t(t);return!df()||!o.visualViewport?l_:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function c_(t,o,s){return o===void 0&&(o=!1),!!s&&o&&s===$t(t)}function jo(t,o,s,a){o===void 0&&(o=!1),s===void 0&&(s=!1);const l=t.getBoundingClientRect(),u=ff(t);let d=nr(1);o&&(a?An(a)&&(d=as(a)):d=as(t));const h=c_(u,s,a)?gy(u):nr(0);let g=(l.left+h.x)/d.x,v=(l.top+h.y)/d.y,w=l.width/d.x,x=l.height/d.y;if(u&&a){const C=$t(u),y=An(a)?$t(a):a;let _=C,b=md(_);for(;b&&y!==_;){const j=as(b),S=b.getBoundingClientRect(),R=Ln(b),N=S.left+(b.clientLeft+parseFloat(R.paddingLeft))*j.x,E=S.top+(b.clientTop+parseFloat(R.paddingTop))*j.y;g*=j.x,v*=j.y,w*=j.x,x*=j.y,g+=N,v+=E,_=$t(b),b=md(_)}}return ol({width:w,height:x,x:g,y:v})}function Cl(t,o){const s=kl(t).scrollLeft;return o?o.left+s:jo(hr(t)).left+s}function vy(t,o){const s=t.getBoundingClientRect(),a=s.left+o.scrollLeft-Cl(t,s),l=s.top+o.scrollTop;return{x:a,y:l}}function u_(t){let{elements:o,rect:s,offsetParent:a,strategy:l}=t;const u=l==="fixed",d=hr(a),h=o?jl(o.floating):!1;if(a===d||h&&u)return s;let g={scrollLeft:0,scrollTop:0},v=nr(1);const w=nr(0),x=Zr(a);if((x||!u)&&((vs(a)!=="body"||bl(d))&&(g=kl(a)),x)){const y=jo(a);v=as(a),w.x=y.x+a.clientLeft,w.y=y.y+a.clientTop}const C=d&&!x&&!u?vy(d,g):nr(0);return{width:s.width*v.x,height:s.height*v.y,x:s.x*v.x-g.scrollLeft*v.x+w.x+C.x,y:s.y*v.y-g.scrollTop*v.y+w.y+C.y}}function d_(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function f_(t){const o=kl(t),s=t.ownerDocument.body,a=tr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=tr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let u=-o.scrollLeft+Cl(t);const d=-o.scrollTop;return Ln(s).direction==="rtl"&&(u+=tr(t.clientWidth,s.clientWidth)-a),{width:a,height:l,x:u,y:d}}const h_=25;function p_(t,o,s){s===void 0&&(s="viewport");const a=s==="layoutViewport",l=$t(t),u=hr(t),d=l.visualViewport;let h=u.clientWidth,g=u.clientHeight,v=0,w=0;if(d){const C=!df()||o==="fixed";a?C||(v=-d.offsetLeft,w=-d.offsetTop):(h=d.width,g=d.height,C&&(v=d.offsetLeft,w=d.offsetTop))}if(Cl(u)<=0){const C=u.ownerDocument,y=C.body,_=getComputedStyle(y),b=C.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,j=Math.abs(u.clientWidth-y.clientWidth-b),S=getComputedStyle(u).scrollbarGutter==="stable both-edges"?j/2:j;S<=h_&&(h-=S)}return{width:h,height:g,x:v,y:w}}function m_(t,o){const s=jo(t,!0,o==="fixed"),a=s.top+t.clientTop,l=s.left+t.clientLeft,u=as(t),d=t.clientWidth*u.x,h=t.clientHeight*u.y,g=l*u.x,v=a*u.y;return{width:d,height:h,x:g,y:v}}function xg(t,o,s){let a;if(o==="viewport"||o==="layoutViewport")a=p_(t,s,o);else if(o==="document")a=f_(hr(t));else if(An(o))a=m_(o,s);else{const l=gy(t);a={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return ol(a)}function g_(t,o){const s=o.get(t);if(s)return s;let a=pi(t,[],!1).filter(h=>An(h)&&vs(h)!=="body"),l=null;const u=Ln(t).position==="fixed";let d=u?bo(t):t;for(;An(d)&&!hi(d);){const h=Ln(d),g=uf(d),v=l?l.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&h.position==="static")?a=a.filter(x=>x!==d):l=h,d=bo(d)}return o.set(t,a),a}function v_(t){let{element:o,boundary:s,rootBoundary:a,strategy:l}=t;const d=[...s==="clippingAncestors"?jl(o)?[]:g_(o,this._c):[].concat(s),a],h=xg(o,d[0],l);let g=h.top,v=h.right,w=h.bottom,x=h.left;for(let C=1;C{h(!1,1e-7)},1e3)}F=!1}try{a=new IntersectionObserver(A,{...L,root:u.ownerDocument})}catch{a=new IntersectionObserver(A,L)}a.observe(t)}const g=$t(t),v=()=>h(s);return g.addEventListener("resize",v),h(!0),()=>{g.removeEventListener("resize",v),d()}}function C_(t,o,s,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=a,v=ff(t),w=l||u?[...v?pi(v):[],...o?pi(o):[]]:[];w.forEach(S=>{l&&S.addEventListener("scroll",s),u&&S.addEventListener("resize",s)});const x=v&&h?k_(v,s,u):null;let C=-1,y=null;d&&(y=new ResizeObserver(S=>{let[R]=S;R&&R.target===v&&y&&o&&(y.unobserve(o),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(o)})),s()}),v&&!g&&y.observe(v),o&&y.observe(o));let _,b=g?jo(t):null;g&&j();function j(){const S=jo(t);b&&!yy(b,S)&&s(),b=S,_=requestAnimationFrame(j)}return s(),()=>{var S;w.forEach(R=>{l&&R.removeEventListener("scroll",s),u&&R.removeEventListener("resize",s)}),x==null||x(),(S=y)==null||S.disconnect(),y=null,g&&cancelAnimationFrame(_)}}const S_=e_,__=t_,N_=XS,E_=r_,R_=JS,wg=QS,P_=n_,T_=(t,o,s)=>{const a=new Map,l=s??{},u={...j_,...l.platform,_c:a};return YS(t,o,{...l,platform:u})};var D_=typeof document<"u",O_=function(){},Ya=D_?m.useLayoutEffect:O_;function sl(t,o){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(typeof t=="function"&&t.toString()===o.toString())return!0;let s,a,l;if(t&&o&&typeof t=="object"){if(Array.isArray(t)){if(s=t.length,s!==o.length)return!1;for(a=s;a--!==0;)if(!sl(t[a],o[a]))return!1;return!0}if(l=Object.keys(t),s=l.length,s!==Object.keys(o).length)return!1;for(a=s;a--!==0;)if(!{}.hasOwnProperty.call(o,l[a]))return!1;for(a=s;a--!==0;){const u=l[a];if(!(u==="_owner"&&t.$$typeof)&&!sl(t[u],o[u]))return!1}return!0}return t!==t&&o!==o}function wy(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function bg(t,o){const s=wy(t);return Math.round(o*s)/s}function Iu(t){const o=m.useRef(t);return Ya(()=>{o.current=t}),o}function M_(t){t===void 0&&(t={});const{placement:o="bottom",strategy:s="absolute",middleware:a=[],platform:l,elements:{reference:u,floating:d}={},transform:h=!0,whileElementsMounted:g,open:v}=t,[w,x]=m.useState({x:0,y:0,strategy:s,placement:o,middlewareData:{},isPositioned:!1}),[C,y]=m.useState(a);sl(C,a)||y(a);const[_,b]=m.useState(null),[j,S]=m.useState(null),R=m.useCallback(H=>{H!==L.current&&(L.current=H,b(H))},[]),N=m.useCallback(H=>{H!==F.current&&(F.current=H,S(H))},[]),E=u||_,P=d||j,L=m.useRef(null),F=m.useRef(null),A=m.useRef(w),q=g!=null,B=Iu(g),z=Iu(l),Z=Iu(v),se=m.useCallback(()=>{if(!L.current||!F.current)return;const H={placement:o,strategy:s,middleware:C};z.current&&(H.platform=z.current),T_(L.current,F.current,H).then(J=>{const $={...J,isPositioned:Z.current!==!1};he.current&&!sl(A.current,$)&&(A.current=$,_d.flushSync(()=>{x($)}))})},[C,o,s,z,Z]);Ya(()=>{v===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,x(H=>({...H,isPositioned:!1})))},[v]);const he=m.useRef(!1);Ya(()=>(he.current=!0,()=>{he.current=!1}),[]),Ya(()=>{if(E&&(L.current=E),P&&(F.current=P),E&&P){if(B.current)return B.current(E,P,se);se()}},[E,P,se,B,q]);const ye=m.useMemo(()=>({reference:L,floating:F,setReference:R,setFloating:N}),[R,N]),ae=m.useMemo(()=>({reference:E,floating:P}),[E,P]),oe=m.useMemo(()=>{const H={position:s,left:0,top:0};if(!ae.floating)return H;const J=bg(ae.floating,w.x),$=bg(ae.floating,w.y);return h?{...H,transform:"translate("+J+"px, "+$+"px)",...wy(ae.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:J,top:$}},[s,h,ae.floating,w.x,w.y]);return m.useMemo(()=>({...w,update:se,refs:ye,elements:ae,floatingStyles:oe}),[w,se,ye,ae,oe])}const A_=t=>{function o(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:t,fn(s){const{element:a,padding:l}=typeof t=="function"?t(s):t;return a&&o(a)?a.current!=null?wg({element:a.current,padding:l}).fn(s):{}:a?wg({element:a,padding:l}).fn(s):{}}}},L_=(t,o)=>{const s=S_(t);return{name:s.name,fn:s.fn,options:[t,o]}},I_=(t,o)=>{const s=__(t);return{name:s.name,fn:s.fn,options:[t,o]}},z_=(t,o)=>({fn:P_(t).fn,options:[t,o]}),F_=(t,o)=>{const s=N_(t);return{name:s.name,fn:s.fn,options:[t,o]}},$_=(t,o)=>{const s=E_(t);return{name:s.name,fn:s.fn,options:[t,o]}},U_=(t,o)=>{const s=R_(t);return{name:s.name,fn:s.fn,options:[t,o]}},B_=(t,o)=>{const s=A_(t);return{name:s.name,fn:s.fn,options:[t,o]}};var W_=Object.defineProperty,V_=(t,o)=>W_(t,"name",{value:o,configurable:!0}),H_=m.forwardRef(V_(function(o,s){const{children:a,width:l=10,height:u=5,...d}=o;return r.jsx(Ue.svg,{...d,ref:s,width:l,height:u,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:o.asChild?a:r.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),G_=Object.defineProperty,rr=(t,o)=>G_(t,"name",{value:o,configurable:!0}),jg={Partial:"partial"},kg={Optimized:"optimized",Always:"always"},by="Popper",[jy,Sl]=jn(by),[K_,ky]=jy(by),Cy=rr(t=>{const{__scopePopper:o,children:s}=t,[a,l]=m.useState(null),[u,d]=m.useState(void 0);return r.jsx(K_,{scope:o,anchor:a,onAnchorChange:l,placementState:u,setPlacementState:d,children:s})},"Popper"),q_="PopperAnchor",Sy=m.forwardRef(rr(function(o,s){const{__scopePopper:a,virtualRef:l,...u}=o,d=ky(q_,a),h=m.useRef(null),g=d.onAnchorChange,v=m.useCallback(b=>{h.current=b,b&&g(b)},[g]),w=ze(s,v),x=m.useRef(null);m.useEffect(()=>{if(!l)return;const b=x.current;x.current=l.current,b!==x.current&&g(x.current)});const C=d.placementState&&_l(d.placementState),y=C==null?void 0:C[0],_=C==null?void 0:C[1];return l?null:r.jsx(Ue.div,{"data-radix-popper-side":y,"data-radix-popper-align":_,...u,ref:w})},"PopperAnchor")),_y="PopperContent",[Y_,Q_]=jy(_y),Ny=m.forwardRef(rr(function(o,s){var be,Ye,Ct,Bt,yt,ut,gr;const{__scopePopper:a,side:l="bottom",sideOffset:u=0,align:d="center",alignOffset:h=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:w=[],collisionPadding:x=0,sticky:C=jg.Partial,hideWhenDetached:y=!1,updatePositionStrategy:_=kg.Optimized,onPlaced:b,...j}=o,S=ky(_y,a),[R,N]=m.useState(null),E=ze(s,N),[P,L]=m.useState(null),F=nf(P),A=(F==null?void 0:F.width)??0,q=(F==null?void 0:F.height)??0,B=l+(d!=="center"?"-"+d:""),z=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},Z=Array.isArray(w)?w:[w],se=Z.length>0,he={padding:z,boundary:Z.filter(Ey),altBoundary:se},{refs:ye,floatingStyles:ae,placement:oe,isPositioned:H,middlewareData:J}=M_({strategy:"fixed",placement:B,whileElementsMounted:rr((...Un)=>C_(...Un,{animationFrame:_===kg.Always}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[L_({mainAxis:u+q,alignmentAxis:h}),v&&I_({mainAxis:!0,crossAxis:!1,...C===jg.Partial?{limiter:z_()}:{},...he}),v&&F_({...he}),$_({...he,apply:rr(({elements:Un,rects:wt,availableWidth:Ci,availableHeight:xs})=>{const{width:no,height:vr}=wt.reference,xr=Un.floating.style;xr.setProperty("--radix-popper-available-width",`${Ci}px`),xr.setProperty("--radix-popper-available-height",`${xs}px`),xr.setProperty("--radix-popper-anchor-width",`${no}px`),xr.setProperty("--radix-popper-anchor-height",`${vr}px`)},"apply")}),P&&B_({element:P,padding:g}),eN({arrowWidth:A,arrowHeight:q}),y&&U_(se?{strategy:"referenceHidden",...he}:{strategy:"referenceHidden",padding:he.padding,altBoundary:he.altBoundary})]}),$=S.setPlacementState;Rt(()=>($(oe),()=>{$(void 0)}),[oe,$]);const[O,G]=_l(oe),ue=Mn(b);Rt(()=>{H&&(ue==null||ue())},[H,ue]);const we=(be=J.arrow)==null?void 0:be.x,I=(Ye=J.arrow)==null?void 0:Ye.y,K=((Ct=J.arrow)==null?void 0:Ct.centerOffset)!==0,[ge,Ce]=m.useState();return Rt(()=>{R&&Ce(window.getComputedStyle(R).zIndex)},[R]),r.jsx("div",{ref:ye.setFloating,"data-radix-popper-content-wrapper":"",style:{...ae,transform:H?ae.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Bt=J.transformOrigin)==null?void 0:Bt.x,(yt=J.transformOrigin)==null?void 0:yt.y].join(" "),...((ut=J.hide)==null?void 0:ut.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:o.dir,children:r.jsx(Y_,{scope:a,placedSide:O,placedAlign:G,onArrowChange:L,arrowX:we,arrowY:I,shouldHideArrow:K,children:r.jsx(Ue.div,{"data-side":O,"data-align":G,...j,ref:E,style:{...j.style,animation:H?(gr=j.style)==null?void 0:gr.animation:"none"}})})})},"PopperContent")),X_="PopperArrow",J_={top:"bottom",right:"left",bottom:"top",left:"right"},Z_=m.forwardRef(rr(function(o,s){const{__scopePopper:a,...l}=o,u=Q_(X_,a),d=J_[u.placedSide];return r.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:r.jsx(H_,{...l,ref:s,style:{...l.style,display:"block"}})})},"PopperArrow"));function Ey(t){return t!==null}rr(Ey,"isNotNull");var eN=rr(t=>({name:"transformOrigin",options:t,fn(o){var j,S,R;const{placement:s,rects:a,middlewareData:l}=o,d=((j=l.arrow)==null?void 0:j.centerOffset)!==0,h=d?0:t.arrowWidth,g=d?0:t.arrowHeight,[v,w]=_l(s),x={start:"0%",center:"50%",end:"100%"}[w],C=(((S=l.arrow)==null?void 0:S.x)??0)+h/2,y=(((R=l.arrow)==null?void 0:R.y)??0)+g/2;let _="",b="";return v==="bottom"?(_=d?x:`${C}px`,b=`${-g}px`):v==="top"?(_=d?x:`${C}px`,b=`${a.floating.height+g}px`):v==="right"?(_=`${-g}px`,b=d?x:`${y}px`):v==="left"&&(_=`${a.floating.width+g}px`,b=d?x:`${y}px`),{data:{x:_,y:b}}}}),"transformOrigin");function _l(t){const[o,s="center"]=t.split("-");return[o,s]}rr(_l,"getSideAndAlignFromPlacement");var tN=Object.defineProperty,hf=(t,o)=>tN(t,"name",{value:o,configurable:!0}),zu=!1;function Ry(){const[t,o]=m.useState(zu);return m.useEffect(()=>{zu||(zu=!0,o(!0))},[]),t}hf(Ry,"useIsHydrated");var Py=Qr[" useSyncExternalStore ".trim().toString()];function Ty(){return()=>{}}hf(Ty,"subscribe");function Dy(){return Py(Ty,()=>!0,()=>!1)}hf(Dy,"useIsHydratedModern");var nN=typeof Py=="function"?Dy:Ry,rN=Object.defineProperty,_o=(t,o)=>rN(t,"name",{value:o,configurable:!0}),Fu="rovingFocusGroup.onEntryFocus",oN={bubbles:!1,cancelable:!0},Nl="RovingFocusGroup",[gd,Oy,sN]=Id(Nl),[iN,My]=jn(Nl,[sN]),Cg={Vertical:"vertical",Horizontal:"horizontal"},aN={RTL:"rtl"},[lN,cN]=iN(Nl),uN=m.forwardRef(_o(function(o,s){return r.jsx(gd.Provider,{scope:o.__scopeRovingFocusGroup,children:r.jsx(gd.Slot,{scope:o.__scopeRovingFocusGroup,children:r.jsx(dN,{...o,ref:s})})})},"RovingFocusGroup")),dN=m.forwardRef(_o(function(o,s){const{__scopeRovingFocusGroup:a,orientation:l,loop:u=!1,dir:d,currentTabStopId:h,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:w,preventScrollOnEntryFocus:x=!1,...C}=o,y=m.useRef(null),_=ze(s,y),b=Fd(d),[j,S]=ms({prop:h,defaultProp:g??null,onChange:v,caller:Nl}),[R,N]=m.useState(!1),E=Mn(w),P=Oy(a),L=m.useRef(!1),[F,A]=m.useState(0);return m.useEffect(()=>{const q=y.current;if(q)return q.addEventListener(Fu,E),()=>q.removeEventListener(Fu,E)},[E]),r.jsx(lN,{scope:a,orientation:l,dir:b,loop:u,currentTabStopId:j,onItemFocus:m.useCallback(q=>S(q),[S]),onItemShiftTab:m.useCallback(()=>N(!0),[]),onFocusableItemAdd:m.useCallback(()=>A(q=>q+1),[]),onFocusableItemRemove:m.useCallback(()=>A(q=>q-1),[]),children:r.jsx(Ue.div,{tabIndex:R||F===0?-1:0,"data-orientation":l,...C,ref:_,style:{outline:"none",...o.style},onMouseDown:Pe(o.onMouseDown,()=>{L.current=!0}),onFocus:Pe(o.onFocus,q=>{const B=!L.current;if(q.target===q.currentTarget&&B&&!R){const z=new CustomEvent(Fu,oN);if(q.currentTarget.dispatchEvent(z),!z.defaultPrevented){const Z=P().filter(oe=>oe.focusable),se=Z.find(oe=>oe.active),he=Z.find(oe=>oe.id===j),ae=[se,he,...Z].filter(Boolean).map(oe=>oe.ref.current);pf(ae,x)}}L.current=!1}),onBlur:Pe(o.onBlur,()=>N(!1))})})},"RovingFocusGroupImpl")),fN="RovingFocusGroupItem",hN=m.forwardRef(_o(function(o,s){const{__scopeRovingFocusGroup:a,focusable:l=!0,active:u=!1,tabStopId:d,children:h,...g}=o,v=Hr(),w=d||v,x=cN(fN,a),C=x.currentTabStopId===w,y=Oy(a),{onFocusableItemAdd:_,onFocusableItemRemove:b,currentTabStopId:j}=x,S=nN();return Rt(()=>{if(!(!S||!l))return _(),()=>b()},[S,l,_,b]),m.useEffect(()=>{if(!(S||!l))return _(),()=>b()},[S,l,_,b]),r.jsx(gd.ItemSlot,{scope:a,id:w,focusable:l,active:u,children:r.jsx(Ue.span,{tabIndex:C?0:-1,"data-orientation":x.orientation,...g,ref:s,onMouseDown:Pe(o.onMouseDown,R=>{l?x.onItemFocus(w):R.preventDefault()}),onFocus:Pe(o.onFocus,()=>x.onItemFocus(w)),onKeyDown:Pe(o.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){x.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const N=Ly(R,x.orientation,x.dir);if(N!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let P=y().filter(L=>L.focusable).map(L=>L.ref.current);if(N==="last")P.reverse();else if(N==="prev"||N==="next"){N==="prev"&&P.reverse();const L=P.indexOf(R.currentTarget);P=x.loop?Iy(P,L+1):P.slice(L+1)}setTimeout(()=>pf(P))}}),children:typeof h=="function"?h({isCurrentTabStop:C,hasTabStop:j!=null}):h})})},"RovingFocusGroupItem")),pN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ay(t,o){return o!==aN.RTL?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}_o(Ay,"getDirectionAwareKey");function Ly(t,o,s){const a=Ay(t.key,s);if(!(o===Cg.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(o===Cg.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return pN[a]}_o(Ly,"getFocusIntent");function pf(t,o=!1){const s=document.activeElement;for(const a of t)if(a===s||(a.focus({preventScroll:o}),document.activeElement!==s))return}_o(pf,"focusFirst");function Iy(t,o){return t.map((s,a)=>t[(o+a)%t.length])}_o(Iy,"wrapArray");var mN=Object.defineProperty,Le=(t,o)=>mN(t,"name",{value:o,configurable:!0}),gN=["Enter"," "],vN=["ArrowDown","PageUp","Home"],zy=["ArrowUp","PageDown","End"],xN=[...vN,...zy],El="Menu",[vd,yN,wN]=Id(El),[No,Fy]=jn(El,[wN,Sl,My]),mf=Sl(),$y=My(),[bN,yi]=No(El),[jN,gf]=No(El),kN=Le(t=>{const{__scopeMenu:o,open:s=!1,children:a,dir:l,onOpenChange:u,modal:d=!0}=t,h=mf(o),[g,v]=m.useState(null),w=m.useRef(!1),x=Mn(u),C=Fd(l);return m.useEffect(()=>{const y=Le(()=>{w.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},"handleKeyDown"),_=Le(()=>w.current=!1,"handlePointer");return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),m.useEffect(()=>{if(!s)return;const y=Le(()=>x(!1),"handleBlur");return window.addEventListener("blur",y),()=>window.removeEventListener("blur",y)},[s,x]),r.jsx(Cy,{...h,children:r.jsx(bN,{scope:o,open:s,onOpenChange:x,content:g,onContentChange:v,children:r.jsx(jN,{scope:o,onClose:m.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:w,dir:C,modal:d,children:a})})})},"Menu"),CN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,...l}=o,u=mf(a);return r.jsx(Sy,{...u,...l,ref:s})},"MenuAnchor")),Uy="MenuPortal",[SN,_N]=No(Uy,{forceMount:void 0}),NN=Le(t=>{const{__scopeMenu:o,forceMount:s,children:a,container:l}=t,u=yi(Uy,o);return r.jsx(SN,{scope:o,forceMount:s,children:r.jsx(ur,{present:s||u.open,children:r.jsx(Gd,{asChild:!0,container:l,children:a})})})},"MenuPortal"),Gr="MenuContent",[EN,By]=No(Gr),RN=m.forwardRef(Le(function(o,s){const a=_N(Gr,o.__scopeMenu),{forceMount:l=a.forceMount,...u}=o,d=yi(Gr,o.__scopeMenu),h=gf(Gr,o.__scopeMenu);return r.jsx(vd.Provider,{scope:o.__scopeMenu,children:r.jsx(ur,{present:l||d.open,children:r.jsx(vd.Slot,{scope:o.__scopeMenu,children:h.modal?r.jsx(PN,{...u,ref:s}):r.jsx(TN,{...u,ref:s})})})})},"MenuContent")),PN=m.forwardRef(Le(function(o,s){const a=yi(Gr,o.__scopeMenu),l=m.useRef(null),u=ze(s,l);return m.useEffect(()=>{const d=l.current;if(d)return ty(d)},[]),r.jsx(Wy,{...o,ref:u,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:Pe(o.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})},"MenuRootContentModal")),TN=m.forwardRef(Le(function(o,s){const a=yi(Gr,o.__scopeMenu);return r.jsx(Wy,{...o,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})},"MenuRootContentNonModal")),DN=or("MenuContent.ScrollLock"),Wy=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,loop:l=!1,trapFocus:u,onOpenAutoFocus:d,onCloseAutoFocus:h,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:w,onPointerDownOutside:x,onFocusOutside:C,onInteractOutside:y,onDismiss:_,disableOutsideScroll:b,...j}=o,S=yi(Gr,a),R=gf(Gr,a),N=mf(a),E=$y(a),P=yN(a),[L,F]=m.useState(null),A=m.useRef(null),[q,B]=m.useState(null);Vd(q);const{nodes:z,registry:Z}=Wd(),se=!!(u||b),he=ze(s,A,S.onContentChange,B),ye=m.useRef(0),ae=m.useRef(""),oe=m.useRef(0),H=m.useRef(null),J=m.useRef("right"),$=m.useRef(0),O=m.useMemo(()=>b?[A,...z.map(K=>({current:K}))]:[],[A,z,b]),G=b?qd:m.Fragment,ue=b?{as:DN,allowPinchZoom:!0,shards:O}:void 0,we=Le(K=>{var gr,Un;const ge=ae.current+K,Ce=P().filter(wt=>!wt.disabled),be=document.activeElement,Ye=(gr=Ce.find(wt=>wt.ref.current===be))==null?void 0:gr.textValue,Ct=Ce.map(wt=>wt.textValue),Bt=qy(Ct,ge,Ye),yt=(Un=Ce.find(wt=>wt.textValue===Bt))==null?void 0:Un.ref.current;function ut(wt){ae.current=wt,window.clearTimeout(ye.current),wt!==""&&(ye.current=window.setTimeout(()=>ut(""),1e3))}Le(ut,"updateSearch"),ut(ge),yt&&setTimeout(()=>yt.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(ye.current),[]),vl();const I=m.useCallback(K=>{var Ce,be;return J.current===((Ce=H.current)==null?void 0:Ce.side)&&Qy(K,(be=H.current)==null?void 0:be.area)},[]);return r.jsx(EN,{scope:a,searchRef:ae,onItemEnter:m.useCallback(K=>{I(K)&&K.preventDefault()},[I]),onItemLeave:m.useCallback(K=>{var ge;I(K)||((ge=A.current)==null||ge.focus(),F(null))},[I]),onTriggerLeave:m.useCallback(K=>{I(K)&&K.preventDefault()},[I]),pointerGraceTimerRef:oe,onPointerGraceIntentChange:m.useCallback(K=>{H.current=K},[]),children:r.jsx(Bd,{registry:se?Z:null,children:r.jsx(G,{...ue,children:r.jsx(Fx,{asChild:!0,trapped:u,branches:z,onMountAutoFocus:Pe(d,K=>{var ge;K.preventDefault(),(ge=A.current)==null||ge.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:r.jsx($d,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:w,onPointerDownOutside:x,onFocusOutside:C,onInteractOutside:y,onDismiss:_,children:r.jsx(uN,{asChild:!0,...E,dir:R.dir,orientation:"vertical",loop:l,currentTabStopId:L,onCurrentTabStopIdChange:F,onEntryFocus:Pe(v,K=>{R.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(Ny,{role:"menu","aria-orientation":"vertical","data-state":Hy(S.open),"data-radix-menu-content":"",dir:R.dir,...N,...j,ref:he,style:{outline:"none",...j.style},onKeyDown:Pe(j.onKeyDown,K=>{const Ce=K.target.closest("[data-radix-menu-content]")===K.currentTarget,be=K.ctrlKey||K.altKey||K.metaKey,Ye=K.key.length===1;Ce&&(K.key==="Tab"&&K.preventDefault(),!be&&Ye&&we(K.key));const Ct=A.current;if(K.target!==Ct||!xN.includes(K.key))return;K.preventDefault();const yt=P().filter(ut=>!ut.disabled).map(ut=>ut.ref.current);zy.includes(K.key)&&yt.reverse(),Gy(yt)}),onBlur:Pe(o.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(ye.current),ae.current="")}),onPointerMove:Pe(o.onPointerMove,il(K=>{const ge=K.target,Ce=$.current!==K.clientX;if(K.currentTarget.contains(ge)&&Ce){const be=K.clientX>$.current?"right":"left";J.current=be,$.current=K.clientX}}))})})})})})})})},"MenuContentImpl")),ON=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,...l}=o;return r.jsx(Ue.div,{role:"group",...l,ref:s})},"MenuGroup")),MN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,...l}=o;return r.jsx(Ue.div,{...l,ref:s})},"MenuLabel")),xd="MenuItem",Sg="menu.itemSelect",AN=m.forwardRef(Le(function(o,s){const{disabled:a=!1,onSelect:l,...u}=o,d=m.useRef(null),h=gf(xd,o.__scopeMenu),g=By(xd,o.__scopeMenu),v=ze(s,d),w=m.useRef(!1),x=Le(()=>{const C=d.current;if(!a&&C){const y=new CustomEvent(Sg,{bubbles:!0,cancelable:!0});C.addEventListener(Sg,_=>l==null?void 0:l(_),{once:!0}),Ld(C,y),y.defaultPrevented?w.current=!1:h.onClose()}},"handleSelect");return r.jsx(LN,{...u,ref:v,disabled:a,onClick:Pe(o.onClick,x),onPointerDown:C=>{var y;(y=o.onPointerDown)==null||y.call(o,C),w.current=!0},onPointerUp:Pe(o.onPointerUp,C=>{var y;w.current||(y=C.currentTarget)==null||y.click()}),onKeyDown:Pe(o.onKeyDown,C=>{a||C.target!==C.currentTarget||g.searchRef.current!==""&&C.key===" "||gN.includes(C.key)&&(C.currentTarget.click(),C.preventDefault())})})},"MenuItem")),LN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,disabled:l=!1,textValue:u,...d}=o,h=By(xd,a),g=$y(a),v=m.useRef(null),w=ze(s,v),[x,C]=m.useState(!1),[y,_]=m.useState("");return m.useEffect(()=>{const b=v.current;b&&_((b.textContent??"").trim())},[d.children]),r.jsx(vd.ItemSlot,{scope:a,disabled:l,textValue:u??y,children:r.jsx(hN,{asChild:!0,...g,focusable:!l,children:r.jsx(Ue.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":l||void 0,"data-disabled":l?"":void 0,...d,ref:w,onPointerMove:Pe(o.onPointerMove,il(b=>{l?h.onItemLeave(b):(h.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(o.onPointerLeave,il(b=>h.onItemLeave(b))),onFocus:Pe(o.onFocus,()=>C(!0)),onBlur:Pe(o.onBlur,()=>C(!1))})})})},"MenuItemImpl")),IN="MenuRadioGroup",[zN,FN]=No(IN,{value:void 0,onValueChange:Le(()=>{},"onValueChange")}),$N=m.forwardRef(Le(function(o,s){const{value:a,onValueChange:l,...u}=o,d=Mn(l);return r.jsx(zN,{scope:o.__scopeMenu,value:a,onValueChange:d,children:r.jsx(ON,{...u,ref:s})})},"MenuRadioGroup")),UN="MenuRadioItem",BN=m.forwardRef(Le(function(o,s){const{value:a,...l}=o,u=FN(UN,o.__scopeMenu),d=a===u.value;return r.jsx(WN,{scope:o.__scopeMenu,checked:d,children:r.jsx(AN,{role:"menuitemradio","aria-checked":d,...l,ref:s,"data-state":xf(d),onSelect:Pe(l.onSelect,()=>{var h;return(h=u.onValueChange)==null?void 0:h.call(u,a)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Vy="MenuItemIndicator",[WN,VN]=No(Vy,{checked:!1}),HN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,forceMount:l,...u}=o,d=VN(Vy,a);return r.jsx(ur,{present:l||vf(d.checked)||d.checked===!0,children:r.jsx(Ue.span,{...u,ref:s,"data-state":xf(d.checked)})})},"MenuItemIndicator")),GN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,...l}=o;return r.jsx(Ue.div,{role:"separator","aria-orientation":"horizontal",...l,ref:s})},"MenuSeparator")),KN="MenuSub",[LR,IR]=No(KN);function Hy(t){return t?"open":"closed"}Le(Hy,"getOpenState");function vf(t){return t==="indeterminate"}Le(vf,"isIndeterminate");function xf(t){return vf(t)?"indeterminate":t?"checked":"unchecked"}Le(xf,"getCheckedState");function Gy(t){const o=document.activeElement;for(const s of t)if(s===o||(s.focus(),document.activeElement!==o))return}Le(Gy,"focusFirst");function Ky(t,o){return t.map((s,a)=>t[(o+a)%t.length])}Le(Ky,"wrapArray");function qy(t,o,s){const l=o.length>1&&Array.from(o).every(v=>v===o[0])?o[0]:o,u=s?t.indexOf(s):-1;let d=Ky(t,Math.max(u,0));l.length===1&&(d=d.filter(v=>v!==s));const g=d.find(v=>v.toLowerCase().startsWith(l.toLowerCase()));return g!==s?g:void 0}Le(qy,"getNextMatch");function Yy(t,o){const{x:s,y:a}=t;let l=!1;for(let u=0,d=o.length-1;ua!=C>a&&s<(x-v)*(a-w)/(C-w)+v&&(l=!l)}return l}Le(Yy,"isPointInPolygon");function Qy(t,o){if(!o)return!1;const s={x:t.clientX,y:t.clientY};return Yy(s,o)}Le(Qy,"isPointerInGraceArea");function il(t){return o=>o.pointerType==="mouse"?t(o):void 0}Le(il,"whenMouse");var qN=Object.defineProperty,pr=(t,o)=>qN(t,"name",{value:o,configurable:!0}),yf="DropdownMenu",[YN,zR]=jn(yf,[Fy]),mr=Fy(),[QN,Xy]=YN(yf),XN=pr(t=>{const{__scopeDropdownMenu:o,children:s,dir:a,open:l,defaultOpen:u,onOpenChange:d,modal:h=!0}=t,g=mr(o),v=m.useRef(null),[w,x]=ms({prop:l,defaultProp:u??!1,onChange:d,caller:yf});return r.jsx(QN,{scope:o,triggerId:Hr(),triggerRef:v,contentId:Hr(),open:w,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(C=>!C),[x]),modal:h,children:r.jsx(kN,{...g,open:w,onOpenChange:x,dir:a,modal:h,children:s})})},"DropdownMenu"),JN="DropdownMenuTrigger",ZN=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,disabled:l=!1,...u}=o,d=Xy(JN,a),h=mr(a),g=ze(s,d.triggerRef);return r.jsx(CN,{asChild:!0,...h,children:r.jsx(Ue.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":l?"":void 0,disabled:l,...u,ref:g,onPointerDown:Pe(o.onPointerDown,v=>{!l&&v.button===0&&v.ctrlKey===!1&&(d.onOpenToggle(),d.open||v.preventDefault())}),onKeyDown:Pe(o.onKeyDown,v=>{l||(["Enter"," "].includes(v.key)&&d.onOpenToggle(),v.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),eE=pr(t=>{const{__scopeDropdownMenu:o,...s}=t,a=mr(o);return r.jsx(NN,{...a,...s})},"DropdownMenuPortal"),tE="DropdownMenuContent",nE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=Xy(tE,a),d=mr(a),h=m.useRef(!1);return r.jsx(RN,{id:u.contentId,"aria-labelledby":u.triggerId,...d,...l,ref:s,onCloseAutoFocus:Pe(o.onCloseAutoFocus,g=>{var v;h.current||(v=u.triggerRef.current)==null||v.focus(),h.current=!1,g.preventDefault()}),onInteractOutside:Pe(o.onInteractOutside,g=>{const v=g.detail.originalEvent,w=v.button===0&&v.ctrlKey===!0,x=v.button===2||w;(!u.modal||x)&&(h.current=!0)}),style:{...o.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),rE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx(MN,{...u,...l,ref:s})},"DropdownMenuLabel")),oE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx($N,{...u,...l,ref:s})},"DropdownMenuRadioGroup")),sE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx(BN,{...u,...l,ref:s})},"DropdownMenuRadioItem")),iE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx(HN,{...u,...l,ref:s})},"DropdownMenuItemIndicator")),aE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx(GN,{...u,...l,ref:s})},"DropdownMenuSeparator")),lE=Object.defineProperty,cE=(t,o)=>lE(t,"name",{value:o,configurable:!0}),uE=m.forwardRef(cE(function(o,s){return r.jsx(Ue.label,{...o,ref:s,onMouseDown:a=>{var u;a.target.closest("button, input, select, textarea")||((u=o.onMouseDown)==null||u.call(o,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}})},"Label")),dE=Object.defineProperty,Jy=(t,o)=>dE(t,"name",{value:o,configurable:!0}),wf={Horizontal:"horizontal",Vertical:"vertical"},_g=wf.Horizontal,fE=Object.values(wf),hE=m.forwardRef(Jy(function(o,s){const{decorative:a,orientation:l=_g,...u}=o,d=Zy(l)?l:_g,h=d===wf.Vertical?d:void 0,g=a?{role:"none"}:{"aria-orientation":h,role:"separator"};return r.jsx(Ue.div,{"data-orientation":d,...g,...u,ref:s})},"Separator"));function Zy(t){return fE.includes(t)}Jy(Zy,"isValidOrientation");var pE=Object.defineProperty,it=(t,o)=>pE(t,"name",{value:o,configurable:!0}),[bf,FR]=jn("Tooltip",[Sl]),Rl=Sl(),mE="TooltipProvider",gE=700,yd="tooltip.open",[vE,jf]=bf(mE),xE=it(t=>{const{__scopeTooltip:o,delayDuration:s=gE,skipDelayDuration:a=300,disableHoverableContent:l=!1,children:u}=t,d=m.useRef(!0),h=m.useRef(!1),g=m.useRef(0);return m.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),r.jsx(vE,{scope:o,isOpenDelayedRef:d,delayDuration:s,onOpen:m.useCallback(()=>{a<=0||(window.clearTimeout(g.current),d.current=!1)},[a]),onClose:m.useCallback(()=>{a<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.current=!0,a))},[a]),isPointerInTransitRef:h,onPointerInTransitChange:m.useCallback(v=>{h.current=v},[]),disableHoverableContent:l,children:u})},"TooltipProvider"),wd="Tooltip",[yE,wi]=bf(wd),wE=it(t=>{const{__scopeTooltip:o,children:s,open:a,defaultOpen:l,onOpenChange:u,disableHoverableContent:d,delayDuration:h}=t,g=jf(wd,t.__scopeTooltip),v=Rl(o),[w,x]=m.useState(null),[C,y]=m.useState(void 0),_=Hr(),b=m.useRef(0),j=d??g.disableHoverableContent,S=h??g.delayDuration,R=m.useRef(!1),[N,E]=ms({prop:a,defaultProp:l??!1,onChange:it(B=>{B?(g.onOpen(),document.dispatchEvent(new CustomEvent(yd))):g.onClose(),u==null||u(B)},"onChange"),caller:wd}),P=m.useMemo(()=>N?R.current?"delayed-open":"instant-open":"closed",[N]),L=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,R.current=!1,E(!0)},[E]),F=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E(!1)},[E]),A=m.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{R.current=!0,E(!0),b.current=0},S)},[S,E]);m.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const q=C??_;return r.jsx(Cy,{...v,children:r.jsx(yE,{scope:o,contentId:q,setContentId:y,open:N,stateAttribute:P,trigger:w,onTriggerChange:x,onTriggerEnter:m.useCallback(()=>{g.isOpenDelayedRef.current?A():L()},[g.isOpenDelayedRef,A,L]),onTriggerLeave:m.useCallback(()=>{j?F():(window.clearTimeout(b.current),b.current=0)},[F,j]),onOpen:L,onClose:F,disableHoverableContent:j,children:s})})},"Tooltip"),Ng="TooltipTrigger",bE=m.forwardRef(it(function(o,s){const{__scopeTooltip:a,"aria-describedby":l,...u}=o,d=wi(Ng,a),h=jf(Ng,a),g=Rl(a),v=m.useRef(null),w=ze(s,v,d.onTriggerChange),x=m.useRef(!1),C=m.useRef(!1),y=m.useCallback(()=>x.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),r.jsx(Sy,{asChild:!0,...g,children:r.jsx(Ue.button,{"aria-describedby":d.open?lw(l,d.contentId):l,"data-state":d.stateAttribute,...u,ref:w,onPointerMove:Pe(o.onPointerMove,_=>{_.pointerType!=="touch"&&!C.current&&!h.isPointerInTransitRef.current&&(d.onTriggerEnter(),C.current=!0)}),onPointerLeave:Pe(o.onPointerLeave,()=>{d.onTriggerLeave(),C.current=!1}),onPointerDown:Pe(o.onPointerDown,()=>{d.open&&d.onClose(),x.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:Pe(o.onFocus,()=>{x.current||d.onOpen()}),onBlur:Pe(o.onBlur,d.onClose),onClick:Pe(o.onClick,d.onClose)})})},"TooltipTrigger")),ew="TooltipPortal",[jE,kE]=bf(ew,{forceMount:void 0}),CE=it(t=>{const{__scopeTooltip:o,forceMount:s,children:a,container:l}=t,u=wi(ew,o);return r.jsx(jE,{scope:o,forceMount:s,children:r.jsx(ur,{present:s||u.open,children:r.jsx(Gd,{asChild:!0,container:l,children:a})})})},"TooltipPortal"),mi="TooltipContent",SE=m.forwardRef(it(function(o,s){const a=kE(mi,o.__scopeTooltip),{forceMount:l=a.forceMount,side:u="top",...d}=o,h=wi(mi,o.__scopeTooltip);return r.jsx(ur,{present:l||h.open,children:h.disableHoverableContent?r.jsx(tw,{side:u,...d,ref:s}):r.jsx(_E,{side:u,...d,ref:s})})},"TooltipContent")),_E=m.forwardRef(it(function(o,s){const a=wi(mi,o.__scopeTooltip),l=jf(mi,o.__scopeTooltip),u=m.useRef(null),d=ze(s,u),[h,g]=m.useState(null),{trigger:v,onClose:w}=a,x=u.current,{onPointerInTransitChange:C}=l,y=m.useCallback(()=>{g(null),C(!1)},[C]),_=m.useCallback((b,j)=>{const S=b.currentTarget,R={x:b.clientX,y:b.clientY},N=nw(R,S.getBoundingClientRect()),E=rw(R,N),P=ow(j.getBoundingClientRect()),L=iw([...E,...P]);g(L),C(!0)},[C]);return m.useEffect(()=>()=>y(),[y]),m.useEffect(()=>{if(v&&x){const b=it(S=>_(S,x),"handleTriggerLeave"),j=it(S=>_(S,v),"handleContentLeave");return v.addEventListener("pointerleave",b),x.addEventListener("pointerleave",j),()=>{v.removeEventListener("pointerleave",b),x.removeEventListener("pointerleave",j)}}},[v,x,_,y]),m.useEffect(()=>{if(h){const b=it(j=>{const S=j.target,R={x:j.clientX,y:j.clientY},N=(v==null?void 0:v.contains(S))||(x==null?void 0:x.contains(S)),E=!sw(R,h);N?y():E&&(y(),w())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[v,x,h,w,y]),r.jsx(tw,{...o,ref:d})},"TooltipContentHoverable")),NE=fx("TooltipContent"),tw=m.forwardRef(it(function(o,s){const{__scopeTooltip:a,children:l,"aria-label":u,id:d,onEscapeKeyDown:h,onPointerDownOutside:g,...v}=o,w=wi(mi,a),x=Rl(a),{onClose:C}=w,[y,_]=m.useState(null),b=ze(s,_);Vd(y),m.useEffect(()=>(document.addEventListener(yd,C),()=>document.removeEventListener(yd,C)),[C]),m.useEffect(()=>{if(w.trigger){const S=it(R=>{R.target instanceof Node&&R.target.contains(w.trigger)&&C()},"handleScroll");return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[w.trigger,C]);const{setContentId:j}=w;return Rt(()=>(j(d),()=>{j(void 0)}),[d,j]),r.jsx($d,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:S=>S.preventDefault(),onDismiss:C,children:r.jsxs(Ny,{"data-state":w.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:w.contentId,...x,...v,ref:b,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[r.jsx(NE,{children:l}),u?r.jsx(F1,{id:w.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl")),EE=m.forwardRef(it(function(o,s){const{__scopeTooltip:a,...l}=o,u=Rl(a);return r.jsx(Z_,{...u,...l,ref:s})},"TooltipArrow"));function nw(t,o){const s=Math.abs(o.top-t.y),a=Math.abs(o.bottom-t.y),l=Math.abs(o.right-t.x),u=Math.abs(o.left-t.x);switch(Math.min(s,a,l,u)){case u:return"left";case l:return"right";case s:return"top";case a:return"bottom";default:throw new Error("unreachable")}}it(nw,"getExitSideFromRect");function rw(t,o,s=5){const a=[];switch(o){case"top":a.push({x:t.x-s,y:t.y+s},{x:t.x+s,y:t.y+s});break;case"bottom":a.push({x:t.x-s,y:t.y-s},{x:t.x+s,y:t.y-s});break;case"left":a.push({x:t.x+s,y:t.y-s},{x:t.x+s,y:t.y+s});break;case"right":a.push({x:t.x-s,y:t.y-s},{x:t.x-s,y:t.y+s});break}return a}it(rw,"getPaddedExitPoints");function ow(t){const{top:o,right:s,bottom:a,left:l}=t;return[{x:l,y:o},{x:s,y:o},{x:s,y:a},{x:l,y:a}]}it(ow,"getPointsFromRect");function sw(t,o){const{x:s,y:a}=t;let l=!1;for(let u=0,d=o.length-1;ua!=C>a&&s<(x-v)*(a-w)/(C-w)+v&&(l=!l)}return l}it(sw,"isPointInPolygon");function iw(t){const o=t.slice();return o.sort((s,a)=>s.xa.x?1:s.ya.y?1:0),aw(o)}it(iw,"getHull");function aw(t){if(t.length<=1)return t.slice();const o=[];for(let a=0;a=2;){const u=o[o.length-1],d=o[o.length-2];if((u.x-d.x)*(l.y-d.y)>=(u.y-d.y)*(l.x-d.x))o.pop();else break}o.push(l)}o.pop();const s=[];for(let a=t.length-1;a>=0;a--){const l=t[a];for(;s.length>=2;){const u=s[s.length-1],d=s[s.length-2];if((u.x-d.x)*(l.y-d.y)>=(u.y-d.y)*(l.x-d.x))s.pop();else break}s.push(l)}return s.pop(),o.length===1&&s.length===1&&o[0].x===s[0].x&&o[0].y===s[0].y?o:o.concat(s)}it(aw,"getHullPresorted");function lw(...t){const o=new Set;for(const s of t)if(typeof s=="string")for(const a of String(s).trim().split(/\s+/))a&&o.add(a);return o.size>0?Array.from(o).join(" "):void 0}it(lw,"concatAriaDescribedby");const RE=gl("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function re({className:t,variant:o="default",size:s="default",asChild:a=!1,...l}){const u=a?Md:"button";return r.jsx(u,{"data-slot":"button","data-variant":o,"data-size":s,className:ie(RE({variant:o,size:s,className:t})),...l})}function PE({...t}){return r.jsx(pS,{"data-slot":"alert-dialog",...t})}function TE({...t}){return r.jsx(mS,{"data-slot":"alert-dialog-portal",...t})}function DE({className:t,...o}){return r.jsx(gS,{"data-slot":"alert-dialog-overlay",className:ie("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...o})}function OE({className:t,size:o="default",...s}){return r.jsxs(TE,{children:[r.jsx(DE,{}),r.jsx(wS,{"data-slot":"alert-dialog-content","data-size":o,className:ie("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",t),...s})]})}function ME({className:t,...o}){return r.jsx("div",{"data-slot":"alert-dialog-header",className:ie("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...o})}function AE({className:t,...o}){return r.jsx("div",{"data-slot":"alert-dialog-footer",className:ie("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...o})}function LE({className:t,...o}){return r.jsx(bS,{"data-slot":"alert-dialog-title",className:ie("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...o})}function IE({className:t,...o}){return r.jsx(jS,{"data-slot":"alert-dialog-description",className:ie("text-sm text-muted-foreground",t),...o})}function zE({className:t,variant:o="default",size:s="default",...a}){return r.jsx(re,{variant:o,size:s,asChild:!0,children:r.jsx(kS,{"data-slot":"alert-dialog-action",className:ie(t),...a})})}function FE({className:t,variant:o="outline",size:s="default",...a}){return r.jsx(re,{variant:o,size:s,asChild:!0,children:r.jsx(SS,{"data-slot":"alert-dialog-cancel",className:ie(t),...a})})}const $E=gl("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Tt({className:t,variant:o="default",asChild:s=!1,...a}){const l=s?Md:"span";return r.jsx(l,{"data-slot":"badge","data-variant":o,className:ie($E({variant:o}),t),...a})}function ve({className:t,type:o,...s}){return r.jsx("input",{type:o,"data-slot":"input",className:ie("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...s})}function cw({className:t,...o}){return r.jsx(uE,{"data-slot":"label",className:ie("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...o})}function lt({className:t,...o}){return r.jsx("div",{"data-slot":"card",className:ie("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...o})}function cn({className:t,...o}){return r.jsx("div",{"data-slot":"card-header",className:ie("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...o})}function yn({className:t,...o}){return r.jsx("div",{"data-slot":"card-title",className:ie("leading-none font-semibold",t),...o})}function wn({className:t,...o}){return r.jsx("div",{"data-slot":"card-description",className:ie("text-sm text-muted-foreground",t),...o})}function Pt({className:t,...o}){return r.jsx("div",{"data-slot":"card-content",className:ie("px-6",t),...o})}function uw({className:t,...o}){return r.jsx("div",{"data-slot":"card-footer",className:ie("flex items-center px-6 [.border-t]:pt-6",t),...o})}function dw({...t}){return r.jsx(Qd,{"data-slot":"sheet",...t})}function UE({...t}){return r.jsx(Xd,{"data-slot":"sheet-portal",...t})}function BE({className:t,...o}){return r.jsx(Jd,{"data-slot":"sheet-overlay",className:ie("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...o})}function fw({className:t,children:o,side:s="right",showCloseButton:a=!0,...l}){return r.jsxs(UE,{children:[r.jsx(BE,{}),r.jsxs(Zd,{"data-slot":"sheet-content",className:ie("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",s==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",s==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",s==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",s==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",t),...l,children:[o,a&&r.jsxs(xi,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[r.jsx(Pd,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function hw({className:t,...o}){return r.jsx("div",{"data-slot":"sheet-header",className:ie("flex flex-col gap-1.5 p-4",t),...o})}function pw({className:t,...o}){return r.jsx(ef,{"data-slot":"sheet-title",className:ie("font-semibold text-foreground",t),...o})}function mw({className:t,...o}){return r.jsx(tf,{"data-slot":"sheet-description",className:ie("text-sm text-muted-foreground",t),...o})}function an({className:t,...o}){return r.jsx("textarea",{"data-slot":"textarea",className:ie("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...o})}const gw=m.createContext(()=>{}),Ze=()=>m.useContext(gw);function WE({children:t}){const[o,s]=m.useState(null),a=m.useRef(),l=m.useCallback((u,d=!1)=>{u&&(s(h=>({msg:u,err:d,n:((h==null?void 0:h.n)??0)+1})),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s(null),u.length>80?7e3:4e3))},[]);return m.useEffect(()=>{const u=d=>l(String(d.detail||""));return window.addEventListener("crc-notice",u),()=>window.removeEventListener("crc-notice",u)},[l]),r.jsxs(gw.Provider,{value:l,children:[t,r.jsx("div",{"aria-live":"polite",className:"pointer-events-none fixed right-4 bottom-4 left-4 z-50 flex justify-end sm:left-auto",children:o&&r.jsxs("div",{id:"toast",role:"status",className:ie("pointer-events-auto flex max-w-md items-start gap-2 rounded-lg border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-lg animate-in fade-in slide-in-from-bottom-2",o.err&&"border-destructive/40"),children:[o.err?r.jsx(uv,{className:"mt-0.5 size-4 shrink-0 text-destructive"}):r.jsx(ik,{className:"mt-0.5 size-4 shrink-0 text-success"}),r.jsx("span",{children:o.msg})]},o.n)})]})}const Ne=t=>t instanceof Error?t.message:String(t),vw=m.createContext(async()=>!1),eo=()=>m.useContext(vw);function VE({children:t}){const[o,s]=m.useState(null),a=m.useRef(),l=m.useCallback(d=>(s(d),new Promise(h=>a.current=h)),[]),u=d=>{var h;(h=a.current)==null||h.call(a,d),s(null)};return r.jsxs(vw.Provider,{value:l,children:[t,r.jsx(PE,{open:!!o,onOpenChange:d=>!d&&u(!1),children:r.jsxs(OE,{children:[r.jsxs(ME,{children:[r.jsx(LE,{children:o==null?void 0:o.title}),(o==null?void 0:o.description)&&r.jsx(IE,{children:o.description})]}),r.jsxs(AE,{children:[r.jsx(FE,{onClick:()=>u(!1),children:"Cancel"}),r.jsx(zE,{className:ie((o==null?void 0:o.danger)&&"bg-destructive text-white hover:bg-destructive/90"),onClick:()=>u(!0),children:(o==null?void 0:o.action)??"Continue"})]})]})})]})}const xw=m.createContext(null),to=()=>m.useContext(xw),yw=m.createContext(()=>{}),bi=()=>m.useContext(yw),al={hosts:"Multiple code hosts and bot identities",rules:"Group and pattern rules",learnings:"Team learnings",executors:"Docker and Kubernetes executors",budgets:"Token budgets",metrics:"Metrics and long history",audit:"Audit log",branch_sync:"Branch-sync skip",sso_rules:"SSO domain and group rules"};function qt(t){return to().license.features.includes(t)}function ji({feature:t,children:o}){return r.jsxs(Zn,{role:"note",className:"locked border-dashed border-primary/60",children:[r.jsx(kv,{className:"text-primary"}),r.jsxs(cx,{className:"flex items-center gap-2",children:[al[t],r.jsx(Tt,{variant:"secondary",children:"licensed"})]}),r.jsx(er,{children:r.jsxs("p",{children:[o??"This is part of the licensed Divmora console."," ",r.jsx(Yt,{className:"font-medium text-primary underline-offset-4 hover:underline",to:"/license",children:"Install a license"})," ","or contact"," ",r.jsx("a",{className:"font-medium text-primary underline-offset-4 hover:underline",href:"mailto:licensing@divmora.com",children:"licensing@divmora.com"}),"."]})})]})}function Qa({feature:t}){return qt(t)?null:r.jsxs("span",{className:"locknote block text-xs leading-snug text-warning",children:[r.jsx(kv,{className:"mr-1 inline size-3 align-[-2px]"}),"Needs a license with ",al[t].toLowerCase()," ·"," ",r.jsx(Yt,{to:"/license",className:"underline underline-offset-2",children:"License"})]})}function un({children:t,className:o}){return r.jsx(lt,{className:ie("gap-0 overflow-hidden py-0",o),children:t})}function ko({open:t,onClose:o,title:s,description:a,children:l,wide:u}){return r.jsx(dw,{open:t,onOpenChange:d=>!d&&o(),children:r.jsxs(fw,{className:ie("w-full gap-0 overflow-y-auto sm:max-w-xl",u&&"sm:max-w-3xl"),children:[r.jsxs(hw,{className:"border-b pr-10",children:[r.jsx(pw,{children:s}),a&&r.jsx(mw,{children:a})]}),r.jsx("div",{className:"p-4",children:l})]})})}function lr({children:t,className:o}){return r.jsx("div",{className:ie("flex flex-wrap items-center gap-2",o),children:t})}function He({children:t,className:o}){return r.jsx("p",{className:ie("max-w-4xl text-sm leading-relaxed text-muted-foreground",o),children:t})}function qe({children:t}){return r.jsx("div",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:t})}function ee({label:t,children:o,hint:s,className:a}){return r.jsxs("div",{className:ie("grid content-start gap-1.5",a),children:[r.jsx(cw,{className:"text-xs font-medium text-muted-foreground",children:t}),o,s]})}function Ge({children:t,className:o}){return r.jsx("div",{className:ie("grid gap-4 sm:grid-cols-2 lg:grid-cols-3",o),children:t})}function Re({className:t,...o}){return r.jsx("select",{className:ie("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none transition-[color,box-shadow] dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",t),...o})}const HE={on:"border-transparent bg-success-soft text-success",off:"border-transparent bg-danger-soft text-destructive",idle:"border-transparent bg-muted text-muted-foreground",warn:"border-transparent bg-warning-soft text-warning"};function at({kind:t,children:o}){return r.jsx(Tt,{className:ie("state",t,HE[t]),children:o})}function bd({items:t,empty:o}){return t.length?r.jsx("span",{className:"flex flex-wrap gap-1",children:t.map(s=>r.jsx(Tt,{variant:"outline",className:"chip font-normal text-muted-foreground",children:s},s))}):r.jsx("span",{className:"text-sm text-muted-foreground",children:o??"defaults"})}function ne({children:t,className:o,title:s}){return r.jsx("div",{title:s,className:ie("mt-0.5 text-xs text-muted-foreground",o),children:t})}function ww(t={}){const o=[];return t.profile&&o.push(t.profile),t.max_comments&&o.push("max "+t.max_comments),t.min_severity&&o.push("≥ "+t.min_severity),t.model&&o.push("model "+t.model),t.auto_review===!1&&o.push("auto review off"),t.auto_review===!0&&o.push("auto review on"),t.drafts===!0&&o.push("drafts"),t.instructions&&o.push("instructions"),o}function ll({value:t,onChange:o,on:s,off:a,inherit:l="Inherit",label:u,disabled:d}){const h=t==null?"":String(t);return r.jsxs(Re,{"aria-label":u,value:h,disabled:d,onChange:g=>o(g.target.value===""?null:g.target.value==="true"),children:[r.jsx("option",{value:"",children:l}),r.jsx("option",{value:"true",children:s}),r.jsx("option",{value:"false",children:a})]})}function kf({value:t,onSave:o,onCancel:s,extra:a,inheritModel:l="Server default",saveLabel:u="Save settings",danger:d}){const h=to(),g=t??{},[v,w]=m.useState(g.profile??""),[x,C]=m.useState(g.max_comments?String(g.max_comments):""),[y,_]=m.useState(g.min_severity??""),[b,j]=m.useState(g.model??""),[S,R]=m.useState(g.auto_review??null),[N,E]=m.useState(g.drafts??null),[P,L]=m.useState(g.instructions??""),F=()=>{const A={};v&&(A.profile=v),x&&(A.max_comments=parseInt(x,10)),y&&(A.min_severity=y),b&&(A.model=b),S!==null&&(A.auto_review=S),N!==null&&(A.drafts=N),P.trim()&&(A.instructions=P.trim()),o(A)};return r.jsxs("div",{className:"grid gap-5",children:[a,r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Review profile",children:r.jsxs(Re,{value:v,onChange:A=>w(A.target.value),children:[r.jsx("option",{value:"",children:"Inherit"}),r.jsx("option",{value:"chill",children:"Chill"}),r.jsx("option",{value:"balanced",children:"Balanced"}),r.jsx("option",{value:"assertive",children:"Assertive"})]})}),r.jsx(ee,{label:"Max inline comments",children:r.jsx(ve,{type:"number",min:0,max:200,value:x,placeholder:"Inherit",onChange:A=>C(A.target.value)})}),r.jsx(ee,{label:"Minimum severity",children:r.jsxs(Re,{value:y,onChange:A=>_(A.target.value),children:[r.jsx("option",{value:"",children:"Inherit"}),r.jsx("option",{value:"critical",children:"Critical"}),r.jsx("option",{value:"major",children:"Major"}),r.jsx("option",{value:"minor",children:"Minor"}),r.jsx("option",{value:"nitpick",children:"Nitpick"})]})}),r.jsx(ee,{label:"Model profile",children:r.jsxs(Re,{value:b,onChange:A=>j(A.target.value),children:[r.jsx("option",{value:"",children:l}),h.profiles.map(A=>r.jsx("option",{value:A,children:A},A))]})}),r.jsx(ee,{label:"Auto review on push",children:r.jsx(ll,{value:S,onChange:R,on:"On",off:"Off"})}),r.jsx(ee,{label:"Review draft PRs",children:r.jsx(ll,{value:N,onChange:E,on:"On",off:"Off"})})]}),r.jsx(ee,{label:"Extra review instructions",children:r.jsx(an,{rows:4,maxLength:8e3,placeholder:"Appended to the repository's own instructions",value:P,onChange:A=>L(A.target.value)})}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(re,{onClick:F,children:u}),s&&r.jsx(re,{variant:"outline",onClick:s,children:"Cancel"}),r.jsx("span",{className:"flex-1"}),d]})]})}function bw(t){if(!t)return"";const o=/Edg\//.test(t)?"Edge":/OPR\//.test(t)?"Opera":/Firefox\//.test(t)?"Firefox":/Chrome\//.test(t)?"Chrome":/Safari\//.test(t)?"Safari":"",s=/Android/.test(t)?"Android":/iPhone|iPad/.test(t)?"iOS":/Windows/.test(t)?"Windows":/Mac OS X|Macintosh/.test(t)?"macOS":/Linux/.test(t)?"Linux":"";return o?s?o+" on "+s:o:t.length>40?t.slice(0,40)+"…":t}let jd=class extends m.Component{constructor(){super(...arguments),this.state={}}static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o){console.error(`${this.props.name} failed to render`,o)}render(){return this.state.error?r.jsxs(Zn,{variant:"destructive",children:[r.jsx(uv,{}),r.jsxs(cx,{children:[this.props.name," could not be shown"]}),r.jsxs(er,{children:[this.state.error.message,". Reload the page; if it happens again, report it with the browser console output."]})]}):this.props.children}};function GE({...t}){return r.jsx(XN,{"data-slot":"dropdown-menu",...t})}function KE({...t}){return r.jsx(ZN,{"data-slot":"dropdown-menu-trigger",...t})}function qE({className:t,sideOffset:o=4,...s}){return r.jsx(eE,{children:r.jsx(nE,{"data-slot":"dropdown-menu-content",sideOffset:o,className:ie("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",t),...s})})}function YE({...t}){return r.jsx(oE,{"data-slot":"dropdown-menu-radio-group",...t})}function $u({className:t,children:o,...s}){return r.jsxs(sE,{"data-slot":"dropdown-menu-radio-item",className:ie("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[r.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:r.jsx(iE,{children:r.jsx(fv,{className:"size-2 fill-current"})})}),o]})}function QE({className:t,inset:o,...s}){return r.jsx(rE,{"data-slot":"dropdown-menu-label","data-inset":o,className:ie("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...s})}function XE({className:t,...o}){return r.jsx(aE,{"data-slot":"dropdown-menu-separator",className:ie("-mx-1 my-1 h-px bg-border",t),...o})}function ls({className:t,orientation:o="horizontal",decorative:s=!0,...a}){return r.jsx(hE,{"data-slot":"separator",decorative:s,orientation:o,className:ie("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...a})}const Uu=768;function JE(){const[t,o]=m.useState(void 0);return m.useEffect(()=>{const s=window.matchMedia(`(max-width: ${Uu-1}px)`),a=()=>{o(window.innerWidths.removeEventListener("change",a)},[]),!!t}function jw({delayDuration:t=0,...o}){return r.jsx(xE,{"data-slot":"tooltip-provider",delayDuration:t,...o})}function ZE({...t}){return r.jsx(wE,{"data-slot":"tooltip",...t})}function e2({...t}){return r.jsx(bE,{"data-slot":"tooltip-trigger",...t})}function t2({className:t,sideOffset:o=0,children:s,...a}){return r.jsx(CE,{children:r.jsxs(SE,{"data-slot":"tooltip-content",sideOffset:o,className:ie("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",t),...a,children:[s,r.jsx(EE,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const n2="sidebar_state",r2=3600*24*7,o2="16rem",s2="18rem",i2="3rem",a2="b",kw=m.createContext(null);function ki(){const t=m.useContext(kw);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function l2({defaultOpen:t=!0,open:o,onOpenChange:s,className:a,style:l,children:u,...d}){const h=JE(),[g,v]=m.useState(!1),[w,x]=m.useState(t),C=o??w,y=m.useCallback(S=>{const R=typeof S=="function"?S(C):S;s?s(R):x(R),document.cookie=`${n2}=${R}; path=/; max-age=${r2}`},[s,C]),_=m.useCallback(()=>h?v(S=>!S):y(S=>!S),[h,y,v]);m.useEffect(()=>{const S=R=>{R.key===a2&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),_())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[_]);const b=C?"expanded":"collapsed",j=m.useMemo(()=>({state:b,open:C,setOpen:y,isMobile:h,openMobile:g,setOpenMobile:v,toggleSidebar:_}),[b,C,y,h,g,v,_]);return r.jsx(kw.Provider,{value:j,children:r.jsx(jw,{delayDuration:0,children:r.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":o2,"--sidebar-width-icon":i2,...l},className:ie("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...d,children:u})})})}function c2({side:t="left",variant:o="sidebar",collapsible:s="offcanvas",className:a,children:l,...u}){const{isMobile:d,state:h,openMobile:g,setOpenMobile:v}=ki();return s==="none"?r.jsx("div",{"data-slot":"sidebar",className:ie("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...u,children:l}):d?r.jsx(dw,{open:g,onOpenChange:v,...u,children:r.jsxs(fw,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":s2},side:t,children:[r.jsxs(hw,{className:"sr-only",children:[r.jsx(pw,{children:"Sidebar"}),r.jsx(mw,{children:"Displays the mobile sidebar."})]}),r.jsx("div",{className:"flex h-full w-full flex-col",children:l})]})}):r.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?s:"","data-variant":o,"data-side":t,"data-slot":"sidebar",children:[r.jsx("div",{"data-slot":"sidebar-gap",className:ie("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",o==="floating"||o==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),r.jsx("div",{"data-slot":"sidebar-container",className:ie("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",o==="floating"||o==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...u,children:r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:l})})]})}function u2({className:t,onClick:o,...s}){const{toggleSidebar:a}=ki();return r.jsxs(re,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ie("size-7",t),onClick:l=>{o==null||o(l),a()},...s,children:[r.jsx(gk,{}),r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function d2({className:t,...o}){const{toggleSidebar:s}=ki();return r.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:ie("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...o})}function f2({className:t,...o}){return r.jsx("main",{"data-slot":"sidebar-inset",className:ie("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...o})}function h2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ie("flex flex-col gap-2 p-2",t),...o})}function p2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ie("flex flex-col gap-2 p-2",t),...o})}function m2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ie("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...o})}function g2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ie("relative flex w-full min-w-0 flex-col p-2",t),...o})}function v2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ie("w-full text-sm",t),...o})}function Eg({className:t,...o}){return r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ie("flex w-full min-w-0 flex-col gap-1",t),...o})}function Rg({className:t,...o}){return r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ie("group/menu-item relative",t),...o})}const x2=gl("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Pg({asChild:t=!1,isActive:o=!1,variant:s="default",size:a="default",tooltip:l,className:u,...d}){const h=t?Md:"button",{isMobile:g,state:v}=ki(),w=r.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":o,className:ie(x2({variant:s,size:a}),u),...d});return l?(typeof l=="string"&&(l={children:l}),r.jsxs(ZE,{children:[r.jsx(e2,{asChild:!0,children:w}),r.jsx(t2,{side:"right",align:"center",hidden:v!=="collapsed"||g,...l})]})):w}function Bu({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:ie("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...o})}function y2({className:t,title:o}){return r.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",className:ie("size-8 shrink-0",t),role:o?"img":void 0,"aria-hidden":o?void 0:!0,children:[o&&r.jsx("title",{children:o}),r.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"6.5",className:"fill-[#0F172A] stroke-[#0F172A] dark:fill-[#1E293B] dark:stroke-[#334155]"}),r.jsx("path",{d:"M10 10 5 16l5 6M22 10l5 6-5 6",stroke:"#60A5FA",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"m12 16.5 3 3 5.5-7",stroke:"#FFFFFF",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}const Cw=[["done","Reviewed","--st-done"],["skipped","Skipped","--st-skip"],["failed","Failed","--st-fail"]];function Cf(t){const o=[],s={};t.points.forEach(h=>s[new Date(h.bucket).toISOString()]=h);const a=new Date(t.to),l=new Date(t.from);if(t.granularity==="month"){let h=new Date(Date.UTC(l.getUTCFullYear(),l.getUTCMonth(),1));for(;htypeof t[o]=="number"?t[o]:0;function kd({points:t,granularity:o,series:s,label:a}){const l=!!s,u=s??Cw,d=m.useRef(null),[h,g]=m.useState(900),[v,w]=m.useState(null);m.useEffect(()=>{const B=d.current;if(!B)return;const z=new ResizeObserver(()=>g(Math.max(320,B.clientWidth||900)));return z.observe(B),()=>z.disconnect()},[]);const x=h,C=200,y=34,_=8,b=8,j=24;let S=0;t.forEach(B=>S=Math.max(S,u.reduce((z,[Z])=>z+ts(B,Z),0)));const R=S<=4?4:Math.pow(10,Math.floor(Math.log10(S))),N=Math.ceil(S/R)*R||4,E=(x-y-_)/Math.max(1,t.length),P=Math.min(24,Math.max(2,E*.7)),L=B=>b+(C-b-j)*(1-B/N),F=Math.ceil(t.length/Math.max(2,Math.floor((x-y-_)/70))),A=v!==null?t[v]:null,q=v!==null?Math.min(x-170,Math.max(0,y+E*v+E/2+12)):0;return r.jsxs("div",{className:"chart relative w-full",ref:d,children:[r.jsxs("svg",{className:"block h-auto w-full",viewBox:`0 0 ${x} ${C}`,role:"img","aria-label":a??`Jobs per ${o}: reviewed, skipped and failed`,children:[t.map((B,z)=>r.jsx("rect",{x:y+E*z,y:b,width:E,height:C-b-j,fill:v===z?"var(--muted)":"transparent",fillOpacity:.5,tabIndex:0,onMouseEnter:()=>w(z),onMouseLeave:()=>w(null),onFocus:()=>w(z),onBlur:()=>w(null)},"h"+z)),[0,N/2,N].map(B=>r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:y,x2:x-_,y1:L(B),y2:L(B),stroke:"var(--grid)",strokeWidth:1}),r.jsx("text",{x:y-6,y:L(B)+4,textAnchor:"end",fontSize:11,fill:"var(--muted-foreground)",children:$e(B)})]},"g"+B)),t.map((B,z)=>{const Z=y+E*z+(E-P)/2,se=u.map(([ye,,ae])=>[ts(B,ye),ae]).filter(([ye])=>ye>0);let he=0;return r.jsxs("g",{pointerEvents:"none",children:[se.map(([ye,ae],oe)=>{let H=L(he+ye);const J=L(he)-(oe>0?2:0);J-H<1&&(H=J-1);const $=oe===se.length-1?Math.min(4,P/2,J-H):0;he+=ye;const O=`M${Z},${J}V${H+$}Q${Z},${H} ${Z+$},${H}H${Z+P-$}Q${Z+P},${H} ${Z+P},${H+$}V${J}Z`;return r.jsx("path",{d:O,fill:`var(${ae})`},oe)}),z%F===0&&r.jsx("text",{x:y+E*z+E/2,y:C-j+16,textAnchor:"middle",fontSize:11,fill:"var(--muted-foreground)",children:cl(B.bucket,o)})]},"b"+z)}),r.jsx("line",{x1:y,x2:x-_,y1:C-j,y2:C-j,stroke:"var(--grid)",strokeWidth:1,pointerEvents:"none"})]}),r.jsx("div",{className:"tip pointer-events-none absolute z-10 w-40 rounded-md border bg-popover p-2.5 text-xs text-popover-foreground shadow-md [&>div]:flex [&>div]:justify-between [&>div]:gap-3 [&>div>span:first-child]:text-muted-foreground "+(A?"show block":"hidden"),id:"mTip",ref:B=>B&&(B.style.left=q+"px",B.style.top="28px"),children:A&&r.jsxs(r.Fragment,{children:[r.jsx("b",{className:"mb-1 block font-semibold",children:cl(A.bucket,o,!0)}),u.map(([B,z])=>r.jsxs("div",{children:[r.jsx("span",{children:z}),r.jsx("span",{children:ts(A,B)})]},B)),!l&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("span",{children:"Comments"}),r.jsx("span",{children:ts(A,"comments")})]}),r.jsxs("div",{children:[r.jsx("span",{children:"Tokens"}),r.jsx("span",{children:$e(ts(A,"tokens_in")+ts(A,"tokens_out"))})]})]})]})})]})}const ln=[["quality","Quality","--sc-quality"],["security","Security","--sc-security"],["maintainability","Maintainability","--sc-maintainability"]];function us(t,o){const s=t.scored||0;return s?(t[o+"_sum"]||0)/s:null}function w2(t){return t>=80?"bg-success-soft text-success":t>=50?"bg-warning-soft text-warning":"bg-danger-soft text-destructive"}function Sw({s:t,className:o}){return t?r.jsx("span",{className:ie("inline-flex gap-1",o),children:ln.map(([s,a])=>r.jsxs("span",{title:`${a} ${t[s]}`,className:ie("inline-flex min-w-9 items-center justify-center rounded px-1.5 py-0.5 text-xs font-medium tabular-nums",w2(t[s])),children:[r.jsx("span",{className:"mr-0.5 opacity-70",children:a[0]}),t[s]]},s))}):r.jsx("span",{className:"text-xs text-muted-foreground",children:"–"})}function _w(t,o,s,a){let l="",u=!1;return t.forEach((d,h)=>{const g=us(d,o);if(g===null){u=!1;return}l+=(u?"L":"M")+s(h).toFixed(1)+","+a(g).toFixed(1),u=!0}),l}function b2({points:t,label:o}){if(t.filter(d=>d.scored).length<2)return r.jsx("span",{className:"text-xs text-muted-foreground",children:"–"});const l=d=>t.length<2?96/2:2+92*d/(t.length-1),u=d=>2+20*(1-d/100);return r.jsx("svg",{width:96,height:24,viewBox:"0 0 96 24",role:"img","aria-label":o,className:"block",children:ln.map(([d,,h])=>{const g=_w(t,d,l,u);return g.includes("L")?r.jsx("path",{d:g,fill:"none",stroke:`var(${h})`,strokeWidth:1.5,strokeLinejoin:"round"},d):null})})}function Sf({points:t,granularity:o}){const s=m.useRef(null),[a,l]=m.useState(900),[u,d]=m.useState(null);m.useEffect(()=>{const N=s.current;if(!N)return;const E=new ResizeObserver(()=>l(Math.max(320,N.clientWidth||900)));return E.observe(N),()=>E.disconnect()},[]);const h=a,g=160,v=34,w=8,x=8,C=24,y=(h-v-w)/Math.max(1,t.length),_=N=>v+y*N+y/2,b=N=>x+(g-x-C)*(1-N/100),j=Math.ceil(t.length/Math.max(2,Math.floor((h-v-w)/70))),S=u!==null?t[u]:null,R=u!==null?Math.min(h-170,Math.max(0,_(u)+12)):0;return r.jsxs("div",{className:"relative w-full",ref:s,children:[r.jsxs("svg",{className:"block h-auto w-full",viewBox:`0 0 ${h} ${g}`,role:"img","aria-label":`Average review scores per ${o}`,children:[t.map((N,E)=>r.jsx("rect",{x:v+y*E,y:x,width:y,height:g-x-C,fill:u===E?"var(--muted)":"transparent",fillOpacity:.5,tabIndex:0,onMouseEnter:()=>d(E),onMouseLeave:()=>d(null),onFocus:()=>d(E),onBlur:()=>d(null)},"h"+E)),[0,50,80,100].map(N=>r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:v,x2:h-w,y1:b(N),y2:b(N),stroke:"var(--grid)",strokeWidth:1,strokeDasharray:N===50||N===80?"3 3":void 0}),r.jsx("text",{x:v-6,y:b(N)+4,textAnchor:"end",fontSize:11,fill:"var(--muted-foreground)",children:N})]},"g"+N)),ln.map(([N,,E])=>r.jsxs("g",{pointerEvents:"none",children:[r.jsx("path",{d:_w(t,N,_,b),fill:"none",stroke:`var(${E})`,strokeWidth:2,strokeLinejoin:"round"}),t.map((P,L)=>{const F=us(P,N);return F===null?null:r.jsx("circle",{cx:_(L),cy:b(F),r:u===L?3.5:2,fill:`var(${E})`},L)})]},N)),t.map((N,E)=>E%j===0?r.jsx("text",{x:_(E),y:g-C+16,textAnchor:"middle",fontSize:11,fill:"var(--muted-foreground)",pointerEvents:"none",children:cl(N.bucket,o)},"t"+E):null)]}),r.jsx("div",{className:"pointer-events-none absolute z-10 w-40 rounded-md border bg-popover p-2.5 text-xs text-popover-foreground shadow-md [&>div]:flex [&>div]:justify-between [&>div]:gap-3 [&>div>span:first-child]:text-muted-foreground "+(S?"block":"hidden"),ref:N=>N&&(N.style.left=R+"px",N.style.top="20px"),children:S&&r.jsxs(r.Fragment,{children:[r.jsx("b",{className:"mb-1 block font-semibold",children:cl(S.bucket,o,!0)}),ln.map(([N,E])=>{const P=us(S,N);return r.jsxs("div",{children:[r.jsx("span",{children:E}),r.jsx("span",{children:P===null?"–":Math.round(P)})]},N)}),r.jsxs("div",{children:[r.jsx("span",{children:"Scored reviews"}),r.jsx("span",{children:S.scored||0})]})]})})]})}function _f({values:t}){return r.jsx("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:ln.map(([o,s,a])=>r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-0.5 w-3 rounded-sm",ref:l=>l==null?void 0:l.style.setProperty("background",`var(${a})`)}),s,t&&t[o]!=null?" "+Math.round(t[o]):""]},o))})}function Nf({...t}){return r.jsx(Qd,{"data-slot":"dialog",...t})}function j2({...t}){return r.jsx(Xd,{"data-slot":"dialog-portal",...t})}function k2({className:t,...o}){return r.jsx(Jd,{"data-slot":"dialog-overlay",className:ie("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...o})}function Ef({className:t,children:o,showCloseButton:s=!0,...a}){return r.jsxs(j2,{"data-slot":"dialog-portal",children:[r.jsx(k2,{}),r.jsxs(Zd,{"data-slot":"dialog-content",className:ie("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",t),...a,children:[o,s&&r.jsxs(xi,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[r.jsx(Pd,{}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Rf({className:t,...o}){return r.jsx("div",{"data-slot":"dialog-header",className:ie("flex flex-col gap-2 text-center sm:text-left",t),...o})}function Pf({className:t,showCloseButton:o=!1,children:s,...a}){return r.jsxs("div",{"data-slot":"dialog-footer",className:ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a,children:[s,o&&r.jsx(xi,{asChild:!0,children:r.jsx(re,{variant:"outline",children:"Close"})})]})}function Tf({className:t,...o}){return r.jsx(ef,{"data-slot":"dialog-title",className:ie("text-lg leading-none font-semibold",t),...o})}function Df({className:t,...o}){return r.jsx(tf,{"data-slot":"dialog-description",className:ie("text-sm text-muted-foreground",t),...o})}function zn({className:t,...o}){return r.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:r.jsx("table",{"data-slot":"table",className:ie("w-full caption-bottom text-sm",t),...o})})}function Fn({className:t,...o}){return r.jsx("thead",{"data-slot":"table-header",className:ie("[&_tr]:border-b",t),...o})}function $n({className:t,...o}){return r.jsx("tbody",{"data-slot":"table-body",className:ie("[&_tr:last-child]:border-0",t),...o})}function ct({className:t,...o}){return r.jsx("tr",{"data-slot":"table-row",className:ie("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),...o})}function je({className:t,...o}){return r.jsx("th",{"data-slot":"table-head",className:ie("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...o})}function ke({className:t,...o}){return r.jsx("td",{"data-slot":"table-cell",className:ie("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...o})}function C2(t,o,s){const a={};s.forEach(d=>a[new Date(d.bucket).toISOString().slice(0,10)]=d);const l=[],u=new Date(t).getTime();for(let d=0;d{const h=new URLSearchParams({platform:t.platform,host:t.host,repo:t.path,granularity:o==="30d"?"day":"month"});o==="all"&&h.set("from","2000-01-01"),Ke("/admin/api/metrics?"+h.toString()).then(l).catch(()=>l(null))},[t.id,o]);let u=a?Cf(a):[];o==="all"&&(u=u.slice(Math.max(0,u.findIndex(h=>h.scored))));const d=u.reduce((h,g)=>({bucket:"",scored:(h.scored||0)+(g.scored||0),quality_sum:(h.quality_sum||0)+(g.quality_sum||0),security_sum:(h.security_sum||0)+(g.security_sum||0),maintainability_sum:(h.maintainability_sum||0)+(g.maintainability_sum||0)}),{bucket:""});return r.jsxs("div",{className:"mb-6 grid gap-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:"Review scores"}),r.jsx("span",{className:"flex-1"}),r.jsxs(Re,{className:"w-auto","aria-label":"Period",value:o,onChange:h=>s(h.target.value),children:[r.jsx("option",{value:"30d",children:"Last 30 days"}),r.jsx("option",{value:"12m",children:"Last 12 months"}),r.jsx("option",{value:"all",children:"All history"})]})]}),a?d.scored?r.jsxs(r.Fragment,{children:[r.jsx(_f,{values:Object.fromEntries(ln.map(([h])=>[h,us(d,h)]))}),r.jsx(Sf,{points:u,granularity:a.granularity}),r.jsxs(ne,{children:[d.scored," scored reviews; the numbers above are the period's averages."]})]}):r.jsx(ne,{children:"No scored reviews in this period."}):r.jsx(ne,{children:"Loading…"})]})}function N2(){const t=to(),o=Ze(),s=eo(),[a,l]=m.useState(null),[u,d]=m.useState(""),[h,g]=m.useState("all"),[v,w]=m.useState(null),[x,C]=m.useState(!1),[y,_]=m.useState({platform:"github",host:"",path:"",mode:"enabled"}),b=()=>Ke("/admin/api/repos").then(l).catch(B=>o(Ne(B),!0));m.useEffect(()=>{b()},[]);const j=qt("metrics"),[S,R]=m.useState(null);m.useEffect(()=>{j&&Ke("/admin/api/repos/scores?days=30").then(B=>R({since:B.since,days:B.days,by:Object.fromEntries(B.repos.map(z=>[z.platform+"|"+z.host+"|"+z.repo,z]))})).catch(()=>{})},[j]);const N=B=>S==null?void 0:S.by[B.platform+"|"+B.host.toLowerCase()+"|"+B.path.toLowerCase()],E=(B,z,Z)=>bn("/admin/api/repos/"+B.id,{mode:z,settings:Z}).then(se=>(l(he=>(he||[]).map(ye=>ye.id===se.id?se:ye)),o(se.path+": reviews "+(se.effective.enabled?"on":"off")+" ("+se.effective.source+")"),se)),P=()=>Qt("/admin/api/repos",{...y,host:y.host.trim(),path:y.path.trim()}).then(B=>{l(z=>(z||[]).filter(Z=>Z.id!==B.id).concat([B])),_({...y,path:""}),C(!1),o("Added "+B.path)}).catch(B=>o(Ne(B),!0)),L=async B=>{await s({title:"Remove "+B.path+"?",description:"It reappears, set to Inherit, if it sends another webhook.",action:"Remove",danger:!0})&&Co("/admin/api/repos/"+B.id).then(()=>{l(z=>(z||[]).filter(Z=>Z.id!==B.id)),w(null),o("Removed "+B.path)}).catch(z=>o(Ne(z),!0))},F=(a||[]).filter(B=>h==="on"&&!B.effective.enabled||h==="off"&&B.effective.enabled?!1:!u||(B.host+"/"+B.path).toLowerCase().includes(u.toLowerCase())),A=(a||[]).filter(B=>B.effective.enabled).length,q=(a==null?void 0:a.find(B=>B.id===v))??null;return r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(lr,{children:[r.jsxs("div",{className:"relative w-full sm:w-64",children:[r.jsx(pl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),r.jsx(ve,{type:"search",className:"pl-8",placeholder:"Filter repositories","aria-label":"Filter repositories",value:u,onChange:B=>d(B.target.value)})]}),r.jsxs(Re,{className:"w-auto","aria-label":"Show",value:h,onChange:B=>g(B.target.value),children:[r.jsx("option",{value:"all",children:"All"}),r.jsx("option",{value:"on",children:"Reviewed"}),r.jsx("option",{value:"off",children:"Not reviewed"})]}),r.jsx("span",{className:"text-sm text-muted-foreground",children:a&&A+" reviewed · "+(a.length-A)+" not reviewed"}),r.jsx("span",{className:"flex-1"}),r.jsxs(re,{variant:"outline",onClick:()=>C(!0),children:[r.jsx(hs,{})," Add repository"]})]}),r.jsx(un,{children:a?F.length?r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"Reviews"}),r.jsx(je,{children:"Repository"}),r.jsx(je,{children:"Last webhook"}),j&&r.jsx(je,{children:"Scores · 30 days"}),r.jsx(je,{children:"Effective settings"}),r.jsx(je,{children:"Last changed"}),r.jsx(je,{})]})}),r.jsx($n,{children:F.map(B=>{const z=B.effective,Z=[z.require_reviewer&&"reviewer required",z.skip_branch_sync&&"skips branch syncs",z.score_labels&&"score labels",z.commit_status&&"commit status",z.approve&&"approves when it passes"].filter(Boolean);return r.jsxs(ct,{children:[r.jsxs(ke,{className:"w-44 pl-4 align-top whitespace-normal",children:[r.jsxs(Re,{"aria-label":"Reviews for "+B.path,value:B.mode,onChange:se=>E(B,se.target.value,B.settings||{}).catch(he=>o(Ne(he),!0)),children:[r.jsx("option",{value:"inherit",children:"Inherit"}),r.jsx("option",{value:"enabled",children:"Enabled"}),r.jsx("option",{value:"disabled",children:"Disabled"})]}),r.jsx("div",{className:"mt-1.5",children:r.jsx(at,{kind:z.enabled?"on":"off",children:z.enabled?"Reviewed":"Not reviewed"})}),r.jsx(ne,{children:S2(z)}),Z.length>0&&r.jsx(ne,{children:Z.join(" · ")})]}),r.jsxs(ke,{className:"align-top",children:[r.jsx("div",{className:"font-medium",children:B.path}),r.jsxs(ne,{children:[B.platform," · ",B.host]})]}),r.jsx(ke,{className:"align-top text-muted-foreground",children:Vr(B.last_seen)}),j&&r.jsx(ke,{className:"align-top",children:(()=>{const se=N(B);return se?r.jsxs("div",{className:"grid gap-1",children:[r.jsx(Sw,{s:se.latest}),r.jsx(b2,{points:C2(S.since,S.days,se.trend),label:"Daily average scores of "+B.path+", last 30 days"}),r.jsxs(ne,{children:["latest: #",se.number," · ",Vr(se.at)]})]}):r.jsx(ne,{children:"No scored review yet"})})()}),r.jsxs(ke,{className:"align-top whitespace-normal",children:[r.jsx(bd,{items:ww(z.settings)}),(z.rules||[]).length>0&&JSON.stringify(z.settings)!==JSON.stringify(B.settings||{})&&r.jsx(ne,{children:"includes rule settings"})]}),r.jsx(ke,{className:"align-top text-muted-foreground",children:B.updated_by?B.updated_by+" · "+Vr(B.updated_at):"—"}),r.jsx(ke,{className:"pr-4 text-right align-top",children:r.jsxs(re,{variant:"ghost",size:"sm",onClick:()=>w(B.id),children:[r.jsx(jk,{})," Settings"]})})]},B.id)})})]}):r.jsx(qe,{children:a.length?"No repositories match.":"No repositories yet. They appear when they send their first webhook, or add one above."}):r.jsx(qe,{children:"Loading…"})}),r.jsxs(He,{children:["Repositories appear here automatically when they send their first webhook, set to ",r.jsx("b",{children:"Inherit"}),": they follow the most specific group or pattern rule, and otherwise the default (",t.allowlist?"not reviewed, because the allowlist is on":"reviewed, because the allowlist is off","). Choosing Enabled or Disabled here overrides every rule. Settings here override the rules' settings and the repository's own ",r.jsx("code",{children:".codereview.yaml"}),"."]}),t.require_reviewer&&r.jsxs(He,{children:[r.jsx("b",{children:"Reviewer required:"})," even in an enabled repository, a merge request is reviewed only when the bot user is one of its reviewers. Adding the bot as a reviewer starts a review; ",r.jsx("code",{children:"@bot review"})," comments still work."]}),r.jsxs(ko,{open:!!q,onClose:()=>w(null),title:(q==null?void 0:q.path)??"",description:q?`${q.platform} · ${q.host} · review settings for this repository`:void 0,children:[q&&j&&r.jsx(_2,{repo:q},q.id),q&&r.jsx(kf,{value:q.settings,onSave:B=>E(q,q.mode,B).then(()=>w(null)).catch(z=>o(Ne(z),!0)),onCancel:()=>w(null),danger:r.jsx(re,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>L(q),children:"Remove"})},q.id)]}),r.jsx(Nf,{open:x,onOpenChange:C,children:r.jsxs(Ef,{className:"sm:max-w-lg",children:[r.jsxs(Rf,{children:[r.jsx(Tf,{children:"Add repository"}),r.jsx(Df,{children:"Repositories also appear by themselves when they send their first webhook."})]}),r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Platform",children:r.jsxs(Re,{value:y.platform,onChange:B=>_({...y,platform:B.target.value}),children:[r.jsx("option",{value:"github",children:"GitHub"}),r.jsx("option",{value:"gitlab",children:"GitLab"})]})}),r.jsx(ee,{label:"Host",children:r.jsx(ve,{placeholder:"github.com",value:y.host,onChange:B=>_({...y,host:B.target.value})})}),r.jsx(ee,{label:"Repository path",className:"sm:col-span-2",children:r.jsx(ve,{placeholder:"owner/repo or group/sub/project",value:y.path,onChange:B=>_({...y,path:B.target.value})})}),r.jsx(ee,{label:"Reviews",children:r.jsxs(Re,{value:y.mode,onChange:B=>_({...y,mode:B.target.value}),children:[r.jsx("option",{value:"enabled",children:"Enabled"}),r.jsx("option",{value:"disabled",children:"Disabled"}),r.jsx("option",{value:"inherit",children:"Inherit from rules"})]})})]}),r.jsxs(Pf,{children:[r.jsx(re,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),r.jsx(re,{onClick:P,children:"Add"})]})]})})]})}function Of(t){const[o,s]=Bj(),a=o.toString(),l=m.useMemo(()=>{const d={...t};for(const h of Object.keys(t)){const g=o.get(h);g!==null&&(d[h]=g)}return d},[a]),u=m.useCallback(d=>s(h=>{const g=new URLSearchParams(h);for(const[v,w]of Object.entries(d))w===void 0||w===""||w===t[v]?g.delete(v):g.set(v,w);return g},{replace:!0}),[s]);return[l,u]}function E2({className:t,...o}){return r.jsx(OS,{"data-slot":"checkbox",className:ie("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",t),...o,children:r.jsx(AS,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:r.jsx(hl,{className:"size-3.5"})})})}const R2={critical:"off",major:"warn",minor:"idle",nitpick:"idle"};function P2({job:t,onRerun:o}){const s=Ze(),[a,l]=m.useState(null);if(m.useEffect(()=>{Ke("/admin/api/reviews/"+t.id).then(l).catch(h=>s(Ne(h),!0))},[t.id]),!a)return r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"});let u=null;try{u=a.result?typeof a.result=="string"?JSON.parse(a.result):a.result:null}catch{u=null}const d=u==null?void 0:u.verification;return r.jsxs("div",{className:"grid gap-5 text-sm",children:[a.error&&r.jsxs("div",{className:"rounded-md border border-destructive/40 bg-danger-soft p-3",children:[r.jsx("div",{className:"mb-1 font-medium text-destructive",children:"Error"}),r.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap text-destructive",children:a.error})]}),u?r.jsxs(r.Fragment,{children:[u.summary&&r.jsxs("div",{children:[r.jsx("h3",{className:"mb-1 font-semibold",children:"Summary"}),r.jsx("p",{className:"leading-relaxed text-muted-foreground",children:u.summary})]}),u.scores&&r.jsx("div",{className:"grid grid-cols-3 gap-2",children:["quality","security","maintainability"].map(h=>r.jsxs("div",{className:"rounded-md border p-2.5",children:[r.jsx("div",{className:"text-lg font-semibold",children:u.scores[h]}),r.jsx("div",{className:"text-xs text-muted-foreground capitalize",children:h})]},h))}),r.jsxs("div",{children:[r.jsx("h3",{className:"mb-2 font-semibold",children:(u.findings||[]).length?`Findings (${u.findings.length})`:"No findings"}),r.jsx("div",{className:"grid gap-2",children:(u.findings||[]).map((h,g)=>r.jsxs("div",{className:"finding rounded-md border p-3",children:[r.jsx("div",{className:"font-medium",children:(h.kind==="question"?"❓ ":"")+h.title}),r.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx(at,{kind:R2[h.severity]??"idle",children:h.severity}),r.jsx(Tt,{variant:"outline",className:"font-normal",children:h.category}),r.jsxs("span",{className:"font-mono",children:[h.path,":",h.end_line]})]})]},g))})]}),u.approval&&r.jsxs("p",{className:"text-muted-foreground",children:["Approval: ",r.jsx("span",{className:"text-foreground",children:{approved:"approved",already_approved:"already approved",withdrawn:"withdrawn",not_approved:"not approved",unchanged:"left as it was",failed:"failed"}[u.approval]||u.approval}),u.approval_reason?" — "+u.approval_reason:""]}),(d==null?void 0:d.ran)&&r.jsxs("p",{className:"text-muted-foreground",children:["Verification (",d.model,"): ",d.confirmed||0," confirmed · ",d.false_positives||0," removed · ",d.questions||0," questions"]}),((d==null?void 0:d.removed)||[]).length>0&&r.jsx("div",{className:"grid gap-1.5",children:d.removed.map((h,g)=>r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Removed: ",r.jsx("span",{className:"text-foreground",children:h.title})," — ",h.reason]},"r"+g))})]}):!a.error&&r.jsx("p",{className:"text-muted-foreground",children:a.note||"No review result stored for this job."}),r.jsx(ls,{}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Model ",a.model||"—"," · ",a.comments," comments · ",a.files," files"]}),t.kind.includes("review")&&r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(re,{variant:"outline",onClick:()=>o(!1),children:"Re-run (new changes)"}),r.jsx(re,{variant:"outline",onClick:()=>o(!0),children:"Re-run full review"})]})]})}const T2=["bug","security","performance","reliability","maintainability","style","docs","tests"],Tg=["host","repo","state","kind","trigger","from","to","score_kind","score_below","severity","category"],D2={host:"",repo:"",state:"",kind:"",trigger:"",from:"",to:"",score_kind:"",score_below:"",severity:"",category:"",sort:"",granularity:"day",review:""};function O2(){const t=Ze(),[o,s]=Of(D2),a=o.granularity,l=I=>s({granularity:I}),u=m.useMemo(()=>Object.fromEntries(Tg.map(I=>[I,o[I]])),Tg.map(I=>o[I])),d=I=>s(I),h=o.sort,g=I=>s({sort:I}),v=o.review?Number(o.review):null,w=I=>s({review:I?String(I):""}),[x,C]=m.useState(null),[y,_]=m.useState([]),[b,j]=m.useState(o.repo),[S,R]=m.useState(null),[N,E]=m.useState(!1),[P,L]=m.useState(null),[F,A]=m.useState(""),[q,B]=m.useState(!1);m.useEffect(()=>{Ke("/admin/api/hosts").then(I=>_(I.hosts||[])).catch(()=>{})},[]);const z=qt("metrics"),Z=to();m.useEffect(()=>{z&&Ke("/admin/api/metrics"+td({granularity:a,host:u.host})).then(C).catch(I=>t(Ne(I),!0))},[a,u.host,z]),m.useEffect(()=>{const I=window.setTimeout(()=>d({repo:b.trim()}),300);return()=>window.clearTimeout(I)},[b]),m.useEffect(()=>{o.repo!==b.trim()&&j(o.repo)},[o.repo]),m.useEffect(()=>{!v||!S||S.some(I=>I.id===v)||(P==null?void 0:P.id)===v||Ke("/admin/api/reviews/"+v).then(L).catch(I=>t(Ne(I),!0))},[v,S]);const se=I=>Ke("/admin/api/reviews"+td({limit:100,...u,before:I})).then(K=>{R(ge=>I?(ge||[]).concat(K.reviews):K.reviews),E(K.reviews.length>=100)}).catch(K=>t(Ne(K),!0));m.useEffect(()=>{se()},[u]);const he=()=>{if(!F.trim())return t("Paste a pull request or merge request URL",!0);Qt("/admin/api/reviews",{url:F.trim(),full:q}).then(I=>{A(""),t("Queued "+I.pr+" — it appears here when it finishes")}).catch(I=>t(Ne(I),!0))},ye=(I,K)=>Qt(`/admin/api/reviews/${I.id}/rerun`,{full:K}).then(ge=>t("Queued "+ge.pr)).catch(ge=>t(Ne(ge),!0)),ae=x?Cf(x):[],oe={jobs:0,done:0,skipped:0,failed:0,comments:0,tokens_in:0,tokens_out:0,duration_ms:0,scored:0,quality_sum:0,security_sum:0,maintainability_sum:0};ae.forEach(I=>Object.keys(oe).forEach(K=>oe[K]+=I[K]||0));const H=oe.done+oe.failed,J=[["Jobs",$e(oe.jobs)],["Reviewed",$e(oe.done)],["Skipped",$e(oe.skipped)],["Failed",$e(oe.failed)+(H?" · "+Math.round(100*oe.failed/H)+"%":"")],["Comments posted",$e(oe.comments)],["Tokens in / out",$e(oe.tokens_in)+" / "+$e(oe.tokens_out)],["Avg time",nd(H?oe.duration_ms/Math.max(1,oe.jobs):0)],["Tokens today (UTC)",$e((x==null?void 0:x.today_tokens)||0)+(x!=null&&x.daily_token_budget?" of "+$e(x.daily_token_budget):"")]],$=Object.fromEntries(ln.map(([I])=>[I,us({bucket:"",...oe},I)]));oe.scored&&J.push(["Avg scores (Q / S / M)",ln.map(([I])=>Math.round($[I]||0)).join(" / ")],["Scored reviews",$e(oe.scored)]);const O=I=>I.scores?Math.min(I.scores.quality,I.scores.security,I.scores.maintainability):101,G=!S||!h?S:[...S].sort((I,K)=>{var ge,Ce;return h==="lowest"?O(I)-O(K):(((ge=I.scores)==null?void 0:ge[h])??101)-(((Ce=K.scores)==null?void 0:Ce[h])??101)}),ue=I=>K=>d({[I]:K.target.value}),we=(S==null?void 0:S.find(I=>I.id===v))??((P==null?void 0:P.id)===v?P:null);return r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(lr,{children:[z&&r.jsxs(Re,{className:"w-auto","aria-label":"Period",value:a,onChange:I=>l(I.target.value),children:[r.jsx("option",{value:"hour",children:"Last 48 hours"}),r.jsx("option",{value:"day",children:"Last 30 days"}),r.jsx("option",{value:"month",children:"Last 12 months"})]}),r.jsx("span",{className:"flex-1"}),r.jsx(ve,{type:"url",className:"rn-url w-full sm:w-80",placeholder:"Paste a PR/MR URL to review it now","aria-label":"Pull request URL",value:F,onChange:I=>A(I.target.value),onKeyDown:I=>I.key==="Enter"&&he()}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(E2,{id:"rnFull",checked:q,onCheckedChange:I=>B(I===!0)}),r.jsx(cw,{htmlFor:"rnFull",className:"text-sm font-normal text-muted-foreground",children:"Full"})]}),r.jsxs(re,{onClick:he,children:[r.jsx(vk,{})," Review now"]})]}),!z&&r.jsxs(ji,{feature:"metrics",children:["Totals, charts and token use, and history kept longer than ",Z.free_retention_days," days, are part of the licensed console. Every review is listed below."]}),z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"tiles grid grid-cols-2 gap-3 md:grid-cols-4",children:J.map(([I,K])=>r.jsx(lt,{className:"tile gap-1 py-4",children:r.jsxs(Pt,{className:"px-4",children:[r.jsx("div",{className:"text-xl font-semibold tabular-nums",children:K}),r.jsx("div",{className:"text-xs text-muted-foreground",children:I})]})},I))}),r.jsx(lt,{className:"py-4",children:r.jsxs(Pt,{className:"grid gap-3 px-4",children:[r.jsx("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:Cw.map(([I,K,ge])=>r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"size-2.5 rounded-sm",ref:Ce=>Ce==null?void 0:Ce.style.setProperty("background",`var(${ge})`)}),K," ",$e(oe[I]||0)]},I))}),x&&r.jsx(kd,{points:ae,granularity:x.granularity})]})}),oe.scored>0&&x&&r.jsx(lt,{className:"py-4",children:r.jsxs(Pt,{className:"grid gap-3 px-4",children:[r.jsx(_f,{values:$}),r.jsx(Sf,{points:ae,granularity:x.granularity}),r.jsxs(ne,{children:["Average scores of the reviews in each ",x.granularity,". Dashed lines at 80 and 50 are the bands of the score labels."]})]})})]}),r.jsxs(lr,{children:[r.jsxs(Re,{className:"w-auto","aria-label":"Host",value:u.host,onChange:ue("host"),children:[r.jsx("option",{value:"",children:"All hosts"}),y.map(I=>r.jsx("option",{value:I.host,children:I.name},I.host))]}),r.jsxs("div",{className:"relative w-full sm:w-52",children:[r.jsx(pl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),r.jsx(ve,{type:"search",className:"pl-8",placeholder:"Repository","aria-label":"Repository",value:b,onChange:I=>j(I.target.value)})]}),r.jsxs(Re,{className:"w-auto","aria-label":"State",value:u.state,onChange:ue("state"),children:[r.jsx("option",{value:"",children:"Any state"}),r.jsx("option",{value:"done",children:"Done"}),r.jsx("option",{value:"skipped",children:"Skipped"}),r.jsx("option",{value:"failed",children:"Failed"})]}),r.jsxs(Re,{className:"w-auto","aria-label":"Kind",value:u.kind,onChange:ue("kind"),children:[r.jsx("option",{value:"",children:"Any kind"}),r.jsx("option",{value:"review",children:"Review"}),r.jsx("option",{value:"full review",children:"Full review"}),r.jsx("option",{value:"answer",children:"Answer"}),r.jsx("option",{value:"help",children:"Help"}),r.jsx("option",{value:"learn",children:"Learn"}),r.jsx("option",{value:"remember",children:"Remember"})]}),r.jsxs(Re,{className:"w-auto","aria-label":"Trigger",value:u.trigger,onChange:ue("trigger"),children:[r.jsx("option",{value:"",children:"Any trigger"}),r.jsx("option",{value:"push",children:"Push"}),r.jsx("option",{value:"command",children:"Command"}),r.jsx("option",{value:"reply",children:"Reply"}),r.jsx("option",{value:"ui",children:"Admin panel"})]}),r.jsx(ve,{type:"date",className:"w-auto","aria-label":"From",value:u.from,onChange:ue("from")}),r.jsx(ve,{type:"date",className:"w-auto","aria-label":"To",value:u.to,onChange:ue("to")}),r.jsxs(Re,{className:"w-auto","aria-label":"Finding severity",value:u.severity,onChange:ue("severity"),children:[r.jsx("option",{value:"",children:"Any findings"}),r.jsx("option",{value:"any",children:"With findings"}),r.jsx("option",{value:"critical",children:"Critical finding"}),r.jsx("option",{value:"major",children:"Major finding"}),r.jsx("option",{value:"minor",children:"Minor finding"}),r.jsx("option",{value:"nitpick",children:"Nitpick"})]}),r.jsxs(Re,{className:"w-auto","aria-label":"Finding category",value:u.category,onChange:ue("category"),children:[r.jsx("option",{value:"",children:"Any category"}),Array.from(new Set([...T2,...u.category?[u.category]:[]])).map(I=>r.jsx("option",{value:I,className:"capitalize",children:I[0].toUpperCase()+I.slice(1)},I))]}),r.jsxs(Re,{className:"w-auto","aria-label":"Score",value:u.score_kind,onChange:ue("score_kind"),children:[r.jsx("option",{value:"",children:"Any score"}),r.jsx("option",{value:"any",children:"Lowest score"}),ln.map(([I,K])=>r.jsx("option",{value:I,children:K},I))]}),u.score_kind&&r.jsxs(Re,{className:"w-auto","aria-label":"Score below",value:u.score_below,onChange:ue("score_below"),children:[r.jsx("option",{value:"",children:"at any value"}),r.jsx("option",{value:"50",children:"below 50"}),r.jsx("option",{value:"60",children:"below 60"}),r.jsx("option",{value:"70",children:"below 70"}),r.jsx("option",{value:"80",children:"below 80"}),r.jsx("option",{value:"90",children:"below 90"})]}),r.jsxs(Re,{className:"w-auto","aria-label":"Sort",value:h,onChange:I=>g(I.target.value),children:[r.jsx("option",{value:"",children:"Newest first"}),r.jsx("option",{value:"lowest",children:"Lowest score first"}),ln.map(([I,K])=>r.jsxs("option",{value:I,children:["Lowest ",K.toLowerCase()," first"]},I))]})]}),r.jsx(un,{children:S?!G||!G.length?r.jsx(qe,{children:"No reviews match."}):r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"Finished"}),r.jsx(je,{children:"Pull request"}),r.jsx(je,{children:"Job"}),r.jsx(je,{children:"State"}),r.jsx(je,{children:"Scores"}),r.jsx(je,{className:"text-right",children:"Comments / files"}),r.jsx(je,{className:"text-right",children:"Tokens in / out"}),r.jsx(je,{className:"text-right",children:"Took"}),r.jsx(je,{})]})}),r.jsx($n,{children:G.map(I=>{const K=I.started&&!I.started.startsWith("0001-")?new Date(I.finished).getTime()-new Date(I.started).getTime():0;return r.jsxs(ct,{className:"cursor-pointer",onClick:()=>w(I.id),children:[r.jsx(ke,{className:"pl-4 text-muted-foreground",title:Kr(I.finished,!0)+" · "+ml(I.finished),children:Vr(I.finished)}),r.jsxs(ke,{children:[r.jsx("div",{className:"font-medium",children:I.url?r.jsxs("a",{className:"inline-flex items-center gap-1 hover:underline",href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:ge=>ge.stopPropagation(),children:[I.repo," #",I.number," ",r.jsx(vv,{className:"size-3 text-muted-foreground"})]}):`${I.repo} #${I.number}`}),r.jsxs(ne,{children:[I.platform," · ",I.host]})]}),r.jsxs(ke,{children:[r.jsx("div",{children:I.kind}),r.jsx(ne,{children:I.trigger+(I.requested_by?" · "+I.requested_by:"")})]}),r.jsxs(ke,{className:"max-w-64 whitespace-normal",children:[r.jsx(at,{kind:I.state==="done"?"on":I.state==="failed"?"off":"idle",children:I.state}),(I.error||I.note)&&r.jsx(ne,{className:"line-clamp-2",children:I.error?I.error.slice(0,120):I.note})]}),r.jsx(ke,{children:r.jsx(Sw,{s:I.scores})}),r.jsxs(ke,{className:"text-right tabular-nums",children:[I.comments," / ",I.files]}),r.jsxs(ke,{className:"text-right text-muted-foreground tabular-nums",children:[$e(I.tokens_in)," / ",$e(I.tokens_out)]}),r.jsx(ke,{className:"text-right text-muted-foreground tabular-nums",children:nd(K)}),r.jsx(ke,{className:"pr-4 text-right",children:r.jsx(re,{variant:"ghost",size:"sm",onClick:ge=>(ge.stopPropagation(),w(I.id)),children:"Details"})})]},I.id)})})]}):r.jsx(qe,{children:"Loading…"})}),N&&r.jsx("div",{children:r.jsx(re,{variant:"outline",onClick:()=>S&&se(S[S.length-1].id),children:"Load older"})}),r.jsx(He,{children:"Every finished review, answer, help and learning job. Charts read hourly, daily and monthly rollups that are updated as each job finishes. Reviews are kept for the retention set in Settings; hourly detail for 3 days, daily and monthly totals for good. Scores (quality, security, maintainability, 1 to 100) come from the review; sorting by score orders the reviews loaded so far, and the score filter searches all of them."}),r.jsx(ko,{wide:!0,open:!!we,onClose:()=>w(null),title:we?`${we.repo} #${we.number}`:"",description:we?`${we.kind} · ${we.trigger} · ${we.state} · ${Vr(we.finished)}`:void 0,children:we&&r.jsx(P2,{job:we,onRerun:I=>ye(we,I)},we.id)})]})}const M2={reply:"from a reply",command:"@bot remember",manual:"added here"};function A2({l:t,onSave:o,onCancel:s,onDelete:a}){const[l,u]=m.useState(t.scope),[d,h]=m.useState(t.path),[g,v]=m.useState(t.text);return r.jsxs("div",{className:"grid gap-4",children:[r.jsx(ee,{label:"Applies to",children:r.jsx(ve,{value:l,placeholder:"empty = whole host · group · group/repo",onChange:w=>u(w.target.value)})}),r.jsx(ee,{label:"Only files matching",children:r.jsx(ve,{value:d,placeholder:"optional glob",onChange:w=>h(w.target.value)})}),r.jsx(ee,{label:"Learning",children:r.jsx(an,{rows:5,maxLength:600,value:g,onChange:w=>v(w.target.value)})}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(re,{onClick:()=>o({scope:l.trim(),path:d.trim(),text:g.trim()}),children:"Save"}),r.jsx(re,{variant:"outline",onClick:s,children:"Cancel"}),r.jsx("span",{className:"flex-1"}),r.jsx(re,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:a,children:"Delete"})]})]})}function L2(){const t=Ze(),o=eo(),s=qt("learnings"),[a,l]=m.useState(null),[u,d]=m.useState(""),[h,g]=m.useState(""),[v,w]=m.useState(null),[x,C]=m.useState(!1),[y,_]=m.useState({platform:"gitlab",host:"",scope:"",path:"",text:""});m.useEffect(()=>{Ke("/admin/api/learnings").then(P=>l(P.learnings||[])).catch(P=>t(Ne(P),!0))},[]);const b=(P,L)=>bn("/admin/api/learnings/"+P.id,{scope:P.scope,text:P.text,path:P.path,status:P.status,...L}).then(F=>(l(A=>(A||[]).map(q=>q.id===F.id?F:q)),F)),j=()=>Qt("/admin/api/learnings",y).then(P=>{l(L=>(L||[]).concat([P])),_({...y,text:""}),C(!1),t("Learning added")}).catch(P=>t(Ne(P),!0)),S=async P=>{await o({title:"Delete this learning?",description:P.text,action:"Delete",danger:!0})&&Co("/admin/api/learnings/"+P.id).then(()=>{l(L=>(L||[]).filter(F=>F.id!==P.id)),w(null),t("Deleted")}).catch(L=>t(Ne(L),!0))},R={active:0,pending:0,disabled:0};(a||[]).forEach(P=>R[P.status]+=1);const N=(a||[]).filter(P=>(!h||P.status===h)&&(!u||(P.text+" "+P.scope+" "+P.host+" "+P.path).toLowerCase().includes(u.toLowerCase()))),E=(a==null?void 0:a.find(P=>P.id===v))??null;return r.jsxs("section",{className:"grid gap-4",children:[!s&&r.jsxs(ji,{feature:"learnings",children:["Capturing team decisions from review replies, ",r.jsx("code",{children:"@bot remember"}),", and applying them to reviews are part of the licensed console. Without a license nothing new is learned and existing learnings are not applied."]}),r.jsxs(lr,{children:[r.jsxs("div",{className:"relative w-full sm:w-64",children:[r.jsx(pl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),r.jsx(ve,{type:"search",className:"pl-8",placeholder:"Search learnings","aria-label":"Search learnings",value:u,onChange:P=>d(P.target.value)})]}),r.jsxs(Re,{className:"w-auto","aria-label":"Status",value:h,onChange:P=>g(P.target.value),children:[r.jsx("option",{value:"",children:"Any status"}),r.jsx("option",{value:"active",children:"Active"}),r.jsx("option",{value:"pending",children:"Waiting for approval"}),r.jsx("option",{value:"disabled",children:"Disabled"})]}),r.jsx("span",{className:"text-sm text-muted-foreground",children:a&&`${R.active} active · ${R.pending} waiting · ${R.disabled} disabled`}),r.jsx("span",{className:"flex-1"}),s&&r.jsxs(re,{variant:"outline",onClick:()=>C(!0),children:[r.jsx(hs,{})," Add learning"]})]}),r.jsx(un,{children:a?N.length?r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"Applies to"}),r.jsx(je,{children:"Learning"}),r.jsx(je,{children:"Status"}),r.jsx(je,{children:"Source"}),r.jsx(je,{})]})}),r.jsx($n,{children:N.map(P=>r.jsxs(ct,{children:[r.jsxs(ke,{className:"pl-4 align-top",children:[r.jsx("div",{children:P.scope?r.jsx("code",{children:P.scope}):r.jsx("b",{children:"Whole host"})}),r.jsxs(ne,{children:[P.platform," · ",P.host]})]}),r.jsxs(ke,{className:"min-w-64 align-top whitespace-normal",children:[r.jsx("div",{children:P.text}),P.path&&r.jsxs(Tt,{variant:"outline",className:"mt-1 font-normal text-muted-foreground",children:["files: ",P.path]})]}),r.jsx(ke,{className:"w-36 align-top",children:r.jsxs(Re,{"aria-label":"Status",value:P.status,disabled:!s,onChange:L=>b(P,{status:L.target.value}).then(F=>t("Learning "+F.status)).catch(F=>t(Ne(F),!0)),children:[r.jsx("option",{value:"active",children:"Active"}),r.jsx("option",{value:"pending",children:"Waiting"}),r.jsx("option",{value:"disabled",children:"Disabled"})]})}),r.jsxs(ke,{className:"align-top text-muted-foreground",children:[r.jsx("div",{children:(M2[P.source]||P.source)+(P.source_author?" · "+P.source_author:"")+(P.source_role?" ("+P.source_role+")":"")}),P.source_url&&r.jsxs("a",{className:"inline-flex items-center gap-1 text-xs hover:text-foreground hover:underline",href:P.source_url,target:"_blank",rel:"noopener noreferrer",children:["open PR ",r.jsx(vv,{className:"size-3"})]}),r.jsx(ne,{children:Vr(P.updated_at)})]}),r.jsx(ke,{className:"pr-4 text-right align-top",children:s?r.jsx(re,{variant:"ghost",size:"sm",onClick:()=>w(P.id),children:"Edit"}):r.jsx(re,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>S(P),children:"Delete"})})]},P.id))})]}):r.jsx(qe,{children:a.length?"No learnings match.":"No learnings yet. Reply to one of the bot's comments with a team decision, or use @bot remember."}):r.jsx(qe,{children:"Loading…"})}),r.jsxs(He,{children:["Learnings are team decisions from review discussions. When someone replies to one of the bot's comments, the bot reacts 👀, asks the model whether the reply states a rule for future reviews, and if so saves it here (✅ on GitLab, 🎉 on GitHub). ",r.jsx("code",{children:"@bot remember "})," saves one directly. Each starts scoped to its repository; widen ",r.jsx("b",{children:"Applies to"})," to a group or the whole host so one standard covers many repositories. Matching active learnings go with every review: the reviewer follows them and the verifier drops findings they rule out."]}),r.jsx(ko,{open:!!E,onClose:()=>w(null),title:"Edit learning",description:E?`${E.platform} · ${E.host}`:void 0,children:E&&r.jsx(A2,{l:E,onCancel:()=>w(null),onDelete:()=>S(E),onSave:P=>b(E,P).then(()=>{w(null),t("Saved")}).catch(L=>t(Ne(L),!0))},E.id)}),r.jsx(Nf,{open:x,onOpenChange:C,children:r.jsxs(Ef,{className:"sm:max-w-xl",children:[r.jsxs(Rf,{children:[r.jsx(Tf,{children:"Add learning"}),r.jsx(Df,{children:"A rule future reviews should follow."})]}),r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Platform",children:r.jsxs(Re,{value:y.platform,onChange:P=>_({...y,platform:P.target.value}),children:[r.jsx("option",{value:"gitlab",children:"GitLab"}),r.jsx("option",{value:"github",children:"GitHub"}),r.jsx("option",{value:"bitbucket",children:"Bitbucket"})]})}),r.jsx(ee,{label:"Host",children:r.jsx(ve,{placeholder:"gitlab.example.com",value:y.host,onChange:P=>_({...y,host:P.target.value})})}),r.jsx(ee,{label:"Applies to",children:r.jsx(ve,{placeholder:"empty = whole host · group · group/repo",value:y.scope,onChange:P=>_({...y,scope:P.target.value})})}),r.jsx(ee,{label:"Only files matching",children:r.jsx(ve,{placeholder:"optional glob, e.g. api/legacy/**",value:y.path,onChange:P=>_({...y,path:P.target.value})})})]}),r.jsx(ee,{label:"Learning",children:r.jsx(an,{rows:4,maxLength:600,placeholder:"e.g. Account numbers are compared without leading zeros on purpose.",value:y.text,onChange:P=>_({...y,text:P.target.value})})}),r.jsxs(Pf,{children:[r.jsx(re,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),r.jsx(re,{onClick:j,children:"Add learning"})]})]})})]})}const I2={github:"GitHub",gitlab:"GitLab",bitbucket:"Bitbucket"},z2={github:"https://api.github.com",gitlab:"https://gitlab.com",bitbucket:"https://api.bitbucket.org/2.0"};function si({label:t,set:o,multi:s,help:a,value:l,onChange:u}){const d=o?"Set ✓ — leave blank to keep":"";return r.jsx(ee,{label:t+(a?" — "+a:""),children:s?r.jsx(an,{rows:3,className:"font-mono text-xs",placeholder:d,autoComplete:"off",spellCheck:!1,value:l,onChange:h=>u(h.target.value)}):r.jsx(ve,{type:"password",placeholder:d,autoComplete:"new-password",value:l,onChange:h=>u(h.target.value)})})}function Nw({text:t,label:o="Copy"}){const s=Ze(),[a,l]=m.useState(!1),u=()=>navigator.clipboard.writeText(t).then(()=>{l(!0),setTimeout(()=>l(!1),1500)}).catch(()=>s("Copy failed: select the text and copy it",!0));return r.jsxs(re,{variant:"ghost",size:"sm",onClick:u,"aria-label":o,children:[a?r.jsx(hl,{}):r.jsx(ck,{})," ",o]})}function Ew({secret:t,platform:o,onDone:s}){const a=o==="gitlab"?"GitLab's Secret token field":"the webhook's Secret field";return r.jsxs("div",{className:"grid gap-2 rounded-lg border border-warning/40 bg-warning-soft p-3",children:[r.jsx("div",{className:"text-sm font-medium",children:"Copy the secret now: it is not shown again."}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs",children:t}),r.jsx(Nw,{text:t})]}),r.jsxs(ne,{children:["Paste it into ",a,", together with the URL."]}),r.jsx("div",{children:r.jsx(re,{size:"sm",variant:"outline",onClick:s,children:"I've copied it"})})]})}function F2({hook:t,platform:o,onChanged:s}){const a=Ze(),l=eo(),[u,d]=m.useState(""),[h,g]=m.useState(t.name),[v,w]=m.useState(""),x=(_,b)=>bn("/admin/api/webhooks/"+t.id,_).then(j=>{a(b),j.secret&&d(j.secret),s()}).catch(j=>a(Ne(j),!0)),C=async()=>{await l({title:"Replace the secret of "+t.name+"?",description:"Deliveries signed with the old secret are rejected until you paste the new one into the code host.",action:"Replace secret",danger:!0})&&x({regenerate_secret:!0},"New secret for "+t.name)},y=async()=>{await l({title:"Delete "+t.name+"?",description:"Its URL stops working at once. Remove the webhook from the code host too.",action:"Delete webhook",danger:!0})&&Co("/admin/api/webhooks/"+t.id).then(()=>{a("Deleted "+t.name),s()}).catch(_=>a(Ne(_),!0))};return r.jsxs("div",{className:"grid gap-3 rounded-lg border p-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(ve,{className:"h-8 max-w-64",value:h,onChange:_=>g(_.target.value),onBlur:()=>h.trim()!==t.name&&x({name:h},"Renamed")}),r.jsx(at,{kind:t.enabled?"on":"idle",children:t.enabled?"Enabled":"Disabled"}),o==="gitlab"&&t.accepts&&r.jsxs(Tt,{variant:"outline",className:t.accepts==="signature"?"font-normal text-muted-foreground":"font-normal text-warning",title:"What this webhook accepts",children:["accepts: ",t.accepts]}),r.jsx("span",{className:"flex-1"}),r.jsx(re,{variant:"ghost",size:"sm",onClick:()=>x({enabled:!t.enabled},t.enabled?"Disabled "+t.name:"Enabled "+t.name),children:t.enabled?"Disable":"Enable"}),r.jsx(re,{variant:"ghost",size:"sm",onClick:C,children:"New secret"}),r.jsx(re,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:y,children:"Delete"})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("code",{className:"hosturl min-w-0 flex-1 break-all",children:t.url}),r.jsx(Nw,{text:t.url,label:"Copy URL"})]}),u&&r.jsx(Ew,{secret:u,platform:o,onDone:()=>d("")}),o==="gitlab"&&r.jsx(ee,{label:"Signing token (whsec_…) — GitLab 19.0+, "+(t.secrets.signing_tokens?"set ✓, paste to replace":"optional: copy it from the webhook in GitLab"),children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx(ve,{type:"password",autoComplete:"off",value:v,placeholder:t.secrets.signing_tokens?"Set ✓":"",onChange:_=>w(_.target.value)}),r.jsx(re,{variant:"outline",size:"sm",disabled:!v.trim(),onClick:()=>x({signing_tokens:[v.trim()]},"Saved signing token").then(()=>w("")),children:"Save"}),t.secrets.signing_tokens>0&&r.jsx(re,{variant:"ghost",size:"sm",onClick:()=>x({signing_tokens:[]},"Removed signing token"),children:"Remove"})]})}),o==="gitlab"&&t.secrets.signing_tokens>0&&r.jsx(ee,{label:"Unsigned deliveries with the secret token",hint:r.jsx(ne,{children:"With a signing token, only signed deliveries are accepted, so the old secret token alone can't be used to send events. Accept both only while hooks still send unsigned events."}),children:r.jsxs(Re,{className:"max-w-sm",value:String(!!t.accept_secret_token),onChange:_=>x({accept_secret_token:_.target.value==="true"},_.target.value==="true"?"Also accepting the secret token":"Signed deliveries only"),children:[r.jsx("option",{value:"false",children:"Reject (signed deliveries only)"}),r.jsx("option",{value:"true",children:"Accept too (while migrating)"})]})}),r.jsxs(ne,{children:["Added ",di(t.created_at),t.created_by?" by "+t.created_by:""]})]})}function $2({text:t}){return r.jsx("div",{role:"status",className:"rounded-lg border border-warning/40 bg-warning-soft p-3 text-sm text-warning",children:t})}function U2({host:t,managed:o,onChanged:s}){const a=Ze(),[l,u]=m.useState(""),[d,h]=m.useState(null),g=()=>Qt(`/admin/api/hosts/${t.id}/webhooks`,{name:l.trim()}).then(v=>{u(""),h({id:v.webhook.id,secret:v.secret}),a("Added "+v.webhook.name),s()}).catch(v=>a(Ne(v),!0));return r.jsxs("div",{className:"grid gap-6",children:[t.comment_warning&&r.jsx($2,{text:t.comment_warning}),o&&r.jsxs(ss,{title:"Add a webhook",children:[r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(ve,{className:"max-w-80",value:l,placeholder:t.platform==="gitlab"?"e.g. the group it's for":"e.g. where it's set up",onChange:v=>u(v.target.value)}),r.jsxs(re,{onClick:g,children:[r.jsx(hs,{})," Add webhook"]})]}),r.jsxs(ne,{children:["The console generates a URL and a secret. Set the code host's webhook to them, with these events: ",t.events.join(", "),".",t.platform==="gitlab"&&" A system hook alone isn't enough: it doesn't send comments, so @bot commands need a group or project webhook with Comments."]})]}),r.jsx(ss,{title:`Webhooks (${t.webhooks.length})`,children:t.webhooks.length?t.webhooks.map(v=>r.jsxs("div",{className:"grid gap-2",children:[(d==null?void 0:d.id)===v.id&&r.jsx(Ew,{secret:d.secret,platform:t.platform,onDone:()=>h(null)}),r.jsx(F2,{hook:v,platform:t.platform,onChanged:s})]},v.id)):r.jsxs(ne,{children:["No webhooks yet",o?": add one above.":"."]})})]})}function ss({title:t,children:o}){return r.jsxs("div",{className:"grid gap-3",children:[r.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:t}),o]})}function B2({host:t,onSaved:o,onCancel:s}){const a=Ze(),l=qt("hosts"),u=(t==null?void 0:t.settings)??{},d=(t==null?void 0:t.secrets)??{token:!1,app_private_key:!1,api_token:!1},[h,g]=m.useState((t==null?void 0:t.platform)??"gitlab"),[v,w]=m.useState({base:(t==null?void 0:t.base_url)??"",name:(t==null?void 0:t.name)??"",enabled:t?t.enabled:!0,token:"",appID:u.app_id?String(u.app_id):"",appKey:"",email:u.email??"",apiToken:"",reqSig:!!u.require_signature,skipTLS:!!u.skip_tls_verify,bot:u.bot_name??"",reviewer:u.reviewer??""}),x=y=>_=>w({...v,[y]:typeof _=="object"&&(_!=null&&_.target)?_.target.value:_}),C=()=>{const y={platform:h,base_url:v.base.trim(),name:v.name.trim(),enabled:v.enabled,settings:{bot_name:v.bot.trim(),reviewer:v.reviewer.trim()}};h==="github"&&(y.settings.app_id=parseInt(v.appID||"0",10)),h==="gitlab"&&Object.assign(y.settings,{skip_tls_verify:v.skipTLS,require_signature:v.reqSig}),h==="bitbucket"&&(y.settings.email=v.email.trim()),v.token.trim()&&(y.token=v.token.trim()),v.appKey.trim()&&(y.app_private_key=v.appKey),v.apiToken.trim()&&(y.api_token=v.apiToken.trim()),(t?bn("/admin/api/hosts/"+t.id,y):Qt("/admin/api/hosts",y)).then(_=>{a("Saved "+_.name),o(_)}).catch(_=>a(Ne(_),!0))};return r.jsxs("div",{className:"grid gap-6",children:[r.jsx(ss,{title:"Host",children:r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Platform",children:r.jsxs(Re,{id:"hPlat",value:h,disabled:!!t,onChange:y=>g(y.target.value),children:[r.jsx("option",{value:"gitlab",children:"GitLab"}),r.jsx("option",{value:"github",children:"GitHub"}),r.jsx("option",{value:"bitbucket",children:"Bitbucket Cloud"})]})}),r.jsx(ee,{label:"Status",children:r.jsxs(Re,{value:String(v.enabled),onChange:y=>w({...v,enabled:y.target.value==="true"}),children:[r.jsx("option",{value:"true",children:"Enabled"}),r.jsx("option",{value:"false",children:"Disabled"})]})}),r.jsx(ee,{label:h==="gitlab"?"Instance URL":"API URL",children:r.jsx(ve,{value:v.base,placeholder:z2[h],onChange:x("base")})}),r.jsx(ee,{label:"Name",children:r.jsx(ve,{value:v.name,placeholder:"shown in the console",onChange:x("name")})})]})}),r.jsx(ls,{}),r.jsx(ss,{title:"API access",children:r.jsxs("div",{className:"grid gap-4",children:[h==="github"&&r.jsxs(r.Fragment,{children:[r.jsx(si,{label:"Token",help:"or use a GitHub App below",set:d.token,value:v.token,onChange:x("token")}),r.jsx(ee,{label:"GitHub App ID",children:r.jsx(ve,{type:"number",value:v.appID,onChange:x("appID")})}),r.jsx(si,{label:"GitHub App private key (PEM)",set:d.app_private_key,multi:!0,value:v.appKey,onChange:x("appKey")})]}),h==="gitlab"&&r.jsxs(r.Fragment,{children:[r.jsx(si,{label:"Access token (api scope)",set:d.token,value:v.token,onChange:x("token")}),r.jsx(ee,{label:"TLS",children:r.jsxs(Re,{value:String(v.skipTLS),onChange:y=>w({...v,skipTLS:y.target.value==="true"}),children:[r.jsx("option",{value:"false",children:"Verify certificates"}),r.jsx("option",{value:"true",children:"Skip verification (self-signed)"})]})})]}),h==="bitbucket"&&r.jsxs(r.Fragment,{children:[r.jsx(si,{label:"Access token",help:"repository or workspace token",set:d.token,value:v.token,onChange:x("token")}),r.jsx(ee,{label:"Account email",children:r.jsx(ve,{value:v.email,placeholder:"with an API token instead",onChange:x("email")})}),r.jsx(si,{label:"Atlassian API token",set:d.api_token,value:v.apiToken,onChange:x("apiToken")})]})]})}),r.jsx(ls,{}),h==="gitlab"&&r.jsxs(r.Fragment,{children:[r.jsxs(ss,{title:"Webhooks",children:[r.jsx(ne,{children:"Each webhook has its own URL and secrets: add them under Manage webhooks once the host is saved."}),r.jsx(ee,{label:"Unsigned deliveries (every webhook of this host)",hint:r.jsx(ne,{children:"A webhook with its own signing token rejects unsigned deliveries either way, unless it is set to accept both."}),children:r.jsxs(Re,{value:String(v.reqSig),onChange:y=>w({...v,reqSig:y.target.value==="true"}),children:[r.jsx("option",{value:"false",children:"Accept with a secret token (unless the webhook has a signing token)"}),r.jsx("option",{value:"true",children:"Reject everywhere (signed deliveries only)"})]})})]}),r.jsx(ls,{})]}),r.jsx(ss,{title:"Bot identity",children:r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Mention name",hint:r.jsx(Qa,{feature:"hosts"}),children:r.jsx(ve,{value:v.bot,placeholder:"default: the token's user",disabled:!l&&!v.bot,onChange:x("bot")})}),r.jsx(ee,{label:"Reviewer username",children:r.jsx(ve,{value:v.reviewer,placeholder:"default: the token's user",disabled:!l&&!v.reviewer,onChange:x("reviewer")})})]})}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(re,{onClick:C,children:t?"Save host":"Add host"}),r.jsx(re,{variant:"outline",onClick:s,children:"Cancel"})]})]})}function W2(){const t=Ze(),o=eo(),s=qt("hosts"),[a,l]=m.useState(null),[u,d]=m.useState(null),[h,g]=m.useState(null),[v,w]=m.useState({}),x=()=>Ke("/admin/api/hosts").then(l).catch(S=>t(Ne(S),!0));m.useEffect(()=>{x()},[]);const C=S=>{w(R=>({...R,[S.id]:{ok:!1,pending:!0}})),Qt(`/admin/api/hosts/${S.id}/test`).then(R=>w(N=>({...N,[S.id]:R}))).catch(R=>w(N=>({...N,[S.id]:{ok:!1,summary:"Check failed",message:Ne(R)}})))},y=async S=>{await o({title:"Delete "+S.name+"?",description:"Webhooks from it will be rejected and its stored tokens removed.",action:"Delete host",danger:!0})&&Co("/admin/api/hosts/"+S.id).then(()=>{t("Deleted "+S.name),x()}).catch(R=>t(Ne(R),!0))},_=(a==null?void 0:a.mode)==="database",b=u?(a==null?void 0:a.hosts.find(S=>S.id===u))??null:null,j=h?(a==null?void 0:a.hosts.find(S=>S.id===h))??null:null;return r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(lr,{children:[r.jsxs("span",{className:"text-sm text-muted-foreground",children:[a&&(_?"Managed here; stored encrypted in the database.":`Hosts come from the config file (read-only). Set ${a.key_env||"CODEREVIEW_CONSOLE_SECRET_KEY"} to manage them here.`),a&&!s&&" Free: one host per platform."]}),r.jsx("span",{className:"flex-1"}),_&&r.jsxs(re,{variant:"outline",onClick:()=>d(0),children:[r.jsx(hs,{})," Add host"]})]}),r.jsx(un,{children:a?a.hosts.length?r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"Host"}),r.jsx(je,{children:"Credentials"}),r.jsx(je,{children:"Webhooks"}),r.jsx(je,{children:"Check"}),r.jsx(je,{})]})}),r.jsx($n,{children:a.hosts.map(S=>{const R=S.secrets,N=[R.token&&"token set",S.settings.app_id&&`App ${S.settings.app_id}${R.app_private_key?", key set":" (no key)"}`,R.api_token&&"API token set"].filter(Boolean),E=v[S.id]||S.check;return r.jsxs(ct,{children:[r.jsxs(ke,{className:"pl-4 align-top",children:[r.jsx("div",{className:"font-medium",children:S.name}),r.jsxs(ne,{children:[I2[S.platform]," · ",S.host]}),r.jsx("div",{className:"mt-1.5",children:S.licensed?r.jsx(at,{kind:S.enabled?"on":"idle",children:S.enabled?"Enabled":"Disabled"}):r.jsx(at,{kind:"warn",children:"Inactive: needs a license"})}),S.enabled&&r.jsx(V2,{e:S.token_expiry})]}),r.jsxs(ke,{className:"align-top whitespace-normal",children:[r.jsx("div",{className:"flex flex-wrap gap-1",children:N.map(P=>r.jsx(Tt,{variant:"outline",className:"font-normal text-muted-foreground",children:P},P))}),r.jsxs(ne,{children:["mention: ",S.settings.bot_name?"@"+S.settings.bot_name:"token user",S.settings.reviewer?" · reviewer: "+S.settings.reviewer:""]})]}),r.jsxs(ke,{className:"max-w-80 align-top whitespace-normal",children:[S.webhooks.length?r.jsx("div",{className:"grid gap-0.5 text-sm",children:S.webhooks.map(P=>r.jsx("div",{className:P.enabled?"":"text-muted-foreground line-through",children:P.name},P.id))}):r.jsx(ne,{children:"None yet"}),S.comment_warning&&r.jsx("div",{className:"mt-1.5",children:r.jsx(at,{kind:"warn",children:"No comment events"})}),r.jsxs(re,{variant:"link",size:"sm",className:"h-auto px-0",onClick:()=>g(S.id),children:[r.jsx(Wv,{})," ",_?"Manage webhooks":"Show URLs"]})]}),r.jsx(ke,{className:"w-56 max-w-56 align-top whitespace-normal",children:r.jsx(H2,{t:E})}),r.jsx(ke,{className:"pr-4 text-right align-top",children:r.jsxs("div",{className:"flex justify-end gap-1",children:[r.jsxs(re,{variant:"ghost",size:"sm",onClick:()=>C(S),children:[r.jsx(xk,{})," Test"]}),_&&r.jsxs(r.Fragment,{children:[r.jsx(re,{variant:"ghost",size:"sm",onClick:()=>d(S.id),children:"Edit"}),r.jsx(re,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>y(S),children:"Delete"})]})]})})]},S.id)})})]}):r.jsx(qe,{children:"No code hosts yet. Add GitHub, GitLab or Bitbucket."}):r.jsx(qe,{children:"Loading…"})}),r.jsxs(He,{children:["Each host is a GitHub (github.com or Enterprise), GitLab (gitlab.com or self-managed) or Bitbucket Cloud account the console reviews for. Tokens and webhook secrets are encrypted with ",r.jsx("code",{children:"CODEREVIEW_CONSOLE_SECRET_KEY"})," before they are stored and are never shown again: leave a secret blank to keep it. Under ",r.jsx("b",{children:"Manage webhooks"}),", add one webhook per hook you set up (a GitLab system hook, each group hook): each gets its own URL and secret, so one can be replaced or removed without touching the others."]}),r.jsx(ko,{open:j!==null,onClose:()=>g(null),title:j?"Webhooks: "+j.name:"",description:"Each webhook has its own URL and secret.",wide:!0,children:j&&r.jsx(U2,{host:j,managed:_,onChanged:x},j.id)}),r.jsx(ko,{open:u!==null,onClose:()=>d(null),title:b?"Edit "+b.name:"New host",description:"Credentials are encrypted before they are stored.",children:u!==null&&r.jsx(B2,{host:b,onCancel:()=>d(null),onSaved:S=>{d(null),x().then(()=>C(S))}},u)})]})}function V2({e:t}){if(!t)return null;if(t.error)return r.jsxs(ne,{className:"text-destructive",children:["Token: ",t.error]});if(!t.known)return null;if(!t.expires)return r.jsx(ne,{children:"Token never expires"});const o=new Date(t.expires),s=Math.ceil((o.getTime()-Date.now())/864e5),a=di(o);return s<=0?r.jsx("div",{className:"mt-1",children:r.jsxs(at,{kind:"warn",children:["Token expired ",a]})}):s<=14?r.jsx("div",{className:"mt-1",children:r.jsxs(at,{kind:"warn",children:["Token expires in ",s," ",s===1?"day":"days"]})}):r.jsxs(ne,{children:["Token expires ",a]})}function H2({t}){const[o,s]=m.useState(!1);if(!t)return r.jsx(ne,{children:"Not tested"});if(t.pending)return r.jsx("span",{className:"text-sm text-muted-foreground",children:"testing…"});const a=t.summary||(t.ok?"OK":"Check failed");return r.jsxs("div",{className:"grid min-w-0 gap-1",title:t.message,children:[r.jsx("div",{children:r.jsx(at,{kind:t.ok?"on":"off",children:a})}),t.at&&r.jsx(ne,{children:Kr(t.at)}),t.message&&t.message!==a&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"w-fit text-xs text-muted-foreground underline-offset-2 hover:underline",onClick:()=>s(!o),children:o?"Hide details":"Details"}),o&&r.jsx("div",{className:"text-xs break-words text-muted-foreground",children:t.message})]})]})}const Cd=[["enabled","Reviews","Enabled","Disabled"],["require_reviewer","Reviewer required","On","Off"],["skip_branch_sync","Branch syncs","Skip","Review"],["score_labels","Score labels","On","Off"],["commit_status","Commit status","On","Off"],["approve","Approve MRs","On","Off"]],ii=t=>t.pattern||"Whole host";function G2({rule:t,onSave:o,onDelete:s}){const[a,l]=m.useState(()=>Object.fromEntries(Cd.map(([u])=>[u,t[u]??null])));return r.jsx(kf,{value:t.settings,inheritModel:"Inherit",onSave:u=>o({...a,settings:u}),danger:r.jsx(re,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:s,children:"Delete rule"}),extra:r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-3",children:[r.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:"Settings for this level"}),r.jsx(Ge,{className:"lg:grid-cols-2",children:Cd.map(([u,d,h,g])=>r.jsx(ee,{label:d,children:r.jsx(ll,{value:a[u],on:h,off:g,onChange:v=>l({...a,[u]:v})})},u))})]}),r.jsx(ls,{}),r.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:"Review settings"})]})})}function K2(){const t=Ze(),o=eo(),s=qt("rules"),[a,l]=m.useState(null),[u,d]=m.useState([]),[h,g]=m.useState(null),[v,w]=m.useState(!1),[x,C]=m.useState({platform:"gitlab",host:"",pattern:"",enabled:null}),y=()=>Ke("/admin/api/repos").then(E=>d(E||[]));m.useEffect(()=>{Ke("/admin/api/rules").then(E=>l(E||[])).catch(E=>t(Ne(E),!0)),y().catch(()=>{})},[]);const _=E=>{const P=E.pattern?E.pattern:"host "+E.host;return u.filter(L=>(L.effective.rules||[]).includes(P)&&L.platform===E.platform&&L.host===E.host).length},b=()=>{const E={platform:x.platform,host:x.host.trim(),pattern:x.pattern.trim()};x.enabled!==null&&(E.enabled=x.enabled),Qt("/admin/api/rules",E).then(P=>(l(L=>(L||[]).filter(F=>F.id!==P.id).concat([P])),C({...x,pattern:""}),w(!1),g(P.id),t("Saved rule "+ii(P)+" — set its options"),y())).catch(P=>t(Ne(P),!0))},j=(E,P)=>bn("/admin/api/rules/"+E.id,P).then(L=>(l(F=>(F||[]).map(A=>A.id===L.id?L:A)),g(null),t("Saved "+ii(L)),y())).catch(L=>t(Ne(L),!0)),S=async E=>{await o({title:"Delete the rule for "+ii(E)+"?",description:"On "+E.host+". Repositories fall back to the level above.",action:"Delete rule",danger:!0})&&Co("/admin/api/rules/"+E.id).then(()=>(l(P=>(P||[]).filter(L=>L.id!==E.id)),g(null),t("Deleted rule "+ii(E)),y())).catch(P=>t(Ne(P),!0))},R=(a||[]).slice().sort((E,P)=>(E.platform+E.host).localeCompare(P.platform+P.host)||(E.pattern?1:0)-(P.pattern?1:0)||E.pattern.localeCompare(P.pattern)),N=(a==null?void 0:a.find(E=>E.id===h))??null;return r.jsxs("section",{className:"grid gap-4",children:[!s&&r.jsx(ji,{feature:"rules",children:"Settings for a whole host, a group or a name pattern are part of the licensed console. Without a license, repositories follow the global settings and their own mode; any rules below are kept but ignored."}),r.jsxs(lr,{children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:"Settings for a whole host, or for a group, organisation or name pattern on a host."}),r.jsx("span",{className:"flex-1"}),s&&r.jsxs(re,{variant:"outline",onClick:()=>w(!0),children:[r.jsx(hs,{})," Add rule"]})]}),r.jsx(un,{children:a?a.length?r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"Scope"}),r.jsx(je,{children:"Sets"}),r.jsx(je,{children:"Covers"}),r.jsx(je,{children:"Last changed"}),r.jsx(je,{})]})}),r.jsx($n,{children:R.map(E=>{const P=_(E),L=Cd.filter(([F])=>E[F]!==null&&E[F]!==void 0).map(([F,A,q,B])=>A+": "+(E[F]?q:B));return r.jsxs(ct,{children:[r.jsxs(ke,{className:"pl-4 align-top",children:[r.jsx("div",{children:E.pattern?r.jsx("code",{children:E.pattern}):r.jsx("b",{children:"Whole host"})}),r.jsxs(ne,{children:[E.platform," · ",E.host]})]}),r.jsxs(ke,{className:"align-top whitespace-normal",children:[r.jsx(bd,{items:L,empty:"inherits everything"}),r.jsx("div",{className:"mt-1",children:r.jsx(bd,{items:ww(E.settings)})})]}),r.jsx(ke,{className:"align-top text-muted-foreground",children:P+(P===1?" known repository":" known repositories")}),r.jsx(ke,{className:"align-top text-muted-foreground",children:E.updated_by?E.updated_by+" · "+Vr(E.updated_at):"—"}),r.jsx(ke,{className:"pr-4 text-right align-top",children:s?r.jsx(re,{variant:"ghost",size:"sm",onClick:()=>g(E.id),children:"Edit"}):r.jsx(re,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>S(E),children:"Delete"})})]},E.id)})})]}):r.jsx(qe,{children:"No rules yet. Add one for a whole host, a group or a name pattern."}):r.jsx(qe,{children:"Loading…"})}),r.jsxs(He,{children:["Levels, broadest first: ",r.jsx("b",{children:"Settings"})," (everything) → ",r.jsx("b",{children:"whole host"})," (empty pattern) → ",r.jsx("b",{children:"group or owner"})," (",r.jsx("code",{children:"acme"}),", ",r.jsx("code",{children:"acme/platform"}),", subgroups included) or ",r.jsx("b",{children:"pattern"})," (",r.jsx("code",{children:"acme/svc-*"}),"; ",r.jsx("code",{children:"*"})," stays within one level) → ",r.jsx("b",{children:"repository"}),". For each setting the most specific level that sets it wins; ",r.jsx("b",{children:"Inherit"}),' means "use the level above". Review settings add up the same way. Hosts are separate: a rule for ',r.jsx("code",{children:"acme"})," on one host never touches ",r.jsx("code",{children:"acme"})," on another."]}),r.jsx(ko,{open:!!N,onClose:()=>g(null),title:N?ii(N):"",description:N?`${N.platform} · ${N.host}`:void 0,children:N&&r.jsx(G2,{rule:N,onSave:E=>j(N,E),onDelete:()=>S(N)},N.id)}),r.jsx(Nf,{open:v,onOpenChange:w,children:r.jsxs(Ef,{className:"sm:max-w-lg",children:[r.jsxs(Rf,{children:[r.jsx(Tf,{children:"Add rule"}),r.jsx(Df,{children:"After adding it, set its options."})]}),r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Platform",children:r.jsxs(Re,{value:x.platform,onChange:E=>C({...x,platform:E.target.value}),children:[r.jsx("option",{value:"gitlab",children:"GitLab"}),r.jsx("option",{value:"github",children:"GitHub"})]})}),r.jsx(ee,{label:"Host",children:r.jsx(ve,{placeholder:"gitlab.com",value:x.host,onChange:E=>C({...x,host:E.target.value})})}),r.jsx(ee,{label:"Group, owner or pattern",className:"sm:col-span-2",children:r.jsx(ve,{placeholder:"empty = whole host · acme · acme/svc-*",value:x.pattern,onChange:E=>C({...x,pattern:E.target.value})})}),r.jsx(ee,{label:"Reviews",children:r.jsx(ll,{value:x.enabled,on:"Enabled",off:"Disabled",onChange:E=>C({...x,enabled:E})})})]}),r.jsxs(Pf,{children:[r.jsx(re,{variant:"outline",onClick:()=>w(!1),children:"Cancel"}),r.jsx(re,{onClick:b,children:"Add rule"})]})]})})]})}const Dg=["queued","ignored","duplicate","rejected","error"],q2=t=>({queued:"on",rejected:"off",error:"off"})[t]||"idle";function Y2(){const t=Ze(),[o,s]=m.useState(null),[a,l]=m.useState({}),[u,d]=m.useState(!1),[h,g]=Of({project:"",outcome:""}),[v,w]=m.useState(h.project),x=h.outcome,C=j=>g({outcome:j}),[y,_]=m.useState({});m.useEffect(()=>{Ke("/admin/api/hosts").then(j=>_(Object.fromEntries(j.hosts.flatMap(S=>(S.webhooks||[]).map(R=>[R.id,R.name]))))).catch(()=>{})},[]);const b=j=>{const S=j&&(o!=null&&o.length)?o[o.length-1].id:void 0;Ke("/admin/api/webhooks"+td({limit:100,project:v.trim(),outcome:x,before:S})).then(R=>{s(N=>j?(N||[]).concat(R.events):R.events),l(R.counts_24h||{}),d(R.events.length>=100)}).catch(R=>t(Ne(R),!0))};return m.useEffect(()=>{const j=window.setTimeout(()=>(b(),g({project:v.trim()})),v?250:0);return()=>window.clearTimeout(j)},[v,x]),m.useEffect(()=>{h.project!==v.trim()&&w(h.project)},[h.project]),r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(lr,{children:[r.jsxs("div",{className:"relative w-full sm:w-64",children:[r.jsx(pl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),r.jsx(ve,{type:"search",className:"pl-8",placeholder:"Filter by project","aria-label":"Filter webhooks by project",value:v,onChange:j=>w(j.target.value)})]}),r.jsxs(Re,{className:"w-auto","aria-label":"Outcome",value:x,onChange:j=>C(j.target.value),children:[r.jsx("option",{value:"",children:"All outcomes"}),Dg.map(j=>r.jsx("option",{value:j,children:j[0].toUpperCase()+j.slice(1)},j))]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["Last 24 h: ",Dg.map(j=>(a[j]||0)+" "+j).join(" · ")]}),r.jsx("span",{className:"flex-1"}),r.jsxs(re,{variant:"outline",onClick:()=>b(),children:[r.jsx(Ov,{})," Refresh"]})]}),r.jsx(un,{children:o?o.length?r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"When"}),r.jsx(je,{children:"Project"}),r.jsx(je,{children:"Event"}),r.jsx(je,{children:"Outcome"}),r.jsx(je,{children:"Reason"}),r.jsx(je,{className:"pr-4",children:"Via"})]})}),r.jsx($n,{children:o.map(j=>{const S=[j.kind||j.event,j.action].filter(Boolean).join(" · ")+(j.number?" · !"+j.number:"");return r.jsxs(ct,{children:[r.jsx(ke,{className:"pl-4 align-top text-muted-foreground",title:Kr(j.received_at,!0)+" · "+ml(j.received_at),children:Vr(j.received_at)}),r.jsxs(ke,{className:"align-top",children:[r.jsx("div",{className:"font-medium",children:j.project||"—"}),r.jsx(ne,{children:j.platform+(j.host?" · "+j.host:"")})]}),r.jsxs(ke,{className:"align-top",children:[r.jsx("div",{children:S||"—"}),r.jsx(ne,{children:j.event+(j.sender?" · by "+j.sender:"")})]}),r.jsx(ke,{className:"align-top",children:r.jsx(at,{kind:q2(j.outcome),children:j.outcome})}),r.jsx(ke,{className:"reason min-w-64 align-top text-sm whitespace-normal text-muted-foreground",children:j.reason}),r.jsxs(ke,{className:"pr-4 align-top text-muted-foreground",children:[r.jsx("div",{children:j.endpoint?y[j.endpoint]||"unknown webhook":"shared URL (removed)"}),r.jsxs(ne,{className:j.auth==="token-unsigned"?"text-warning":"",title:j.auth==="token-unsigned"?"Accepted by the secret token although a signing token is set: the delivery wasn't signed":void 0,children:[j.auth==="token-unsigned"?"secret token, not signed":j.auth,j.source_ip?" · from "+j.source_ip:""]})]})]},j.id)})})]}):r.jsx(qe,{children:"No webhook deliveries match."}):r.jsx(qe,{children:"Loading…"})}),u&&r.jsx("div",{children:r.jsx(re,{variant:"outline",onClick:()=>b(!0),children:"Load older"})}),r.jsxs(He,{children:["Every webhook delivery and what the console did with it. ",r.jsx("b",{children:"Ignored"})," is normal for events that should not start a review (approvals, label or reviewer changes, edits without new commits) and for repositories that are not enabled. ",r.jsx("b",{children:"Rejected"})," means the signature or token did not match. History is kept for the days set in Settings (14 by default)."]})]})}function ai({title:t,description:o,children:s}){return r.jsxs(lt,{children:[r.jsxs(cn,{children:[r.jsx(yn,{className:"h2",children:t}),o&&r.jsx(wn,{children:o})]}),r.jsx(Pt,{children:s})]})}function Xn({label:t,value:o,onChange:s,hint:a,placeholder:l,min:u,max:d}){return r.jsx(ee,{label:t,hint:a,children:r.jsx(ve,{type:"number",min:u,max:d,placeholder:l,value:o||"",onChange:h=>s(parseInt(h.target.value||"0",10))})})}function Q2(t,o,s){return t==="public"?"Anyone who can reach the console's URL sees it. Hide repository names unless that is intended.":t==="token"?s||!o?"Set a token first: without one, only admins can open it.":"Admins at /admin/dashboard, and anyone with the token at /dashboard.":"Admins open it at /admin/dashboard (the sidebar link). /dashboard sends everyone else to sign in."}function Og(t,o){const s=new URL(location.origin),a=["- job_name: code-review-console"," scheme: "+s.protocol.replace(":","")," metrics_path: /metrics"," static_configs:",' - targets: ["'+s.host+'"]'];return t==="token"&&a.push(" authorization:"," credentials: "+(o||"")),a.join(` -`)}function Mg(t){return location.origin+"/dashboard?token="+encodeURIComponent(t)}const X2=1440*60*1e3;function J2({v:t,clearing:o,replacing:s}){if(o)return r.jsx(ne,{children:"The token is removed when you save."});if(s)return r.jsx(ne,{children:"The new token replaces the current one when you save; the old link stops working."});if(!t.dashboard_token_set)return r.jsx(ne,{children:"No token."});if(t.dashboard_token_expired)return r.jsx(at,{kind:"warn",children:"Expired: generate a new token"});if(!t.dashboard_token_expires)return r.jsx(at,{kind:"on",children:"Set, never expires"});const a=new Date(t.dashboard_token_expires),l=di(a);return a.getTime()-Date.now()<7*X2?r.jsxs(at,{kind:"warn",children:["Expires soon: ",l]}):r.jsxs(at,{kind:"on",children:["Set, expires ",l]})}function Ag(){const t=new Uint8Array(16);return crypto.getRandomValues(t),Array.from(t,o=>o.toString(16).padStart(2,"0")).join("")}function Z2(){const t=Ze(),o=to(),[s,a]=m.useState(null),[l,u]=m.useState(""),[d,h]=m.useState(""),[g,v]=m.useState(""),[w,x]=m.useState(!1),[C,y]=m.useState(90),[_,b]=m.useState(!1),[j,S]=m.useState(""),[R,N]=m.useState(!1),[E,P]=m.useState(!1),L=z=>{const Z={...z,extra_env:z.extra_env??[],engine:z.engine??{},env_set:z.env_set??{}};a(Z),u(Z.extra_env.join(", ")),h(Z.engine.defaults?JSON.stringify(Z.engine.defaults,null,2):""),v(""),x(!1),b(!1),S(""),N(!1),P(!1)};if(m.useEffect(()=>{Ke("/admin/api/tuning").then(L).catch(z=>t(Ne(z),!0))},[]),!s)return r.jsx(qe,{children:"Loading…"});const F=z=>Z=>a({...s,[z]:Z}),A=z=>Z=>a({...s,engine:{...s.engine,[z]:Z}}),q=async()=>{let z;if(d.trim())try{z=JSON.parse(d)}catch{t("Repository defaults: not valid JSON",!0);return}const Z={...s,engine:{...s.engine,defaults:z},extra_env:l.split(/[\s,]+/).map(se=>se.trim()).filter(Boolean),dashboard_token:g,clear_dashboard_token:w,dashboard_token_valid_days:C,metrics_token:j,clear_metrics_token:R};try{L(await bn("/admin/api/tuning",Z)),t("Settings saved")}catch(se){t(Ne(se),!0)}},B=s.engine.verify===void 0||s.engine.verify===null?"":String(s.engine.verify);return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(ai,{title:"Queue",description:"How many reviews run at once and how long they may take. Changes apply at once; running reviews finish with their old timeout.",children:r.jsxs(Ge,{className:"lg:grid-cols-3",children:[r.jsx(Xn,{label:"Reviews at once",min:1,max:64,value:s.workers,onChange:F("workers"),hint:r.jsx(ne,{children:"Each one is a container or pod with the Executor page's resources."})}),r.jsx(Xn,{label:"Waiting reviews (queue size)",min:1,max:1e4,value:s.queue_size,onChange:F("queue_size"),hint:r.jsx(ne,{children:"More webhooks get HTTP 503 and the code host retries."})}),r.jsx(ee,{label:"Review timeout",hint:r.jsx(ne,{children:"Between 1m and 6h."}),children:r.jsx(ve,{value:s.job_timeout,placeholder:"20m",onChange:z=>F("job_timeout")(z.target.value)})}),r.jsx(ee,{label:"Wait after a push",hint:r.jsx(ne,{children:"Pushes within this time become one review. 0s reviews at once."}),children:r.jsx(ve,{value:s.debounce,placeholder:"30s",onChange:z=>F("debounce")(z.target.value)})}),r.jsx(Xn,{label:"Jobs on the dashboard",min:10,max:5e3,value:s.history,onChange:F("history")})]})}),r.jsx(ai,{title:"Review engine",description:"The codereview CLI's review settings. Leave a field empty for the CLI's default.",children:r.jsxs(Ge,{className:"lg:grid-cols-3",children:[r.jsx(Xn,{label:"Model calls at once, per review",placeholder:"4",min:0,max:32,value:s.engine.concurrency,onChange:A("concurrency")}),r.jsx(Xn,{label:"Tokens per model call",placeholder:"40000",min:0,value:s.engine.batch_tokens,onChange:A("batch_tokens")}),r.jsx(Xn,{label:"Skip reviews with more files than",placeholder:"150",min:0,value:s.engine.max_files,onChange:A("max_files")}),r.jsx(Xn,{label:"Send whole files up to (lines)",placeholder:"800",min:0,value:s.engine.full_file_max_lines,onChange:A("full_file_max_lines")}),r.jsx(Xn,{label:"Context lines around changes",placeholder:"60",min:0,value:s.engine.context_lines,onChange:A("context_lines")}),r.jsx(Xn,{label:"Review passes",placeholder:"1",min:0,max:3,value:s.engine.passes,onChange:A("passes"),hint:r.jsx(ne,{children:"2 or 3 catch more, for one more model call each."})}),r.jsx(ee,{label:"Verification pass",children:r.jsxs(Re,{value:B,onChange:z=>A("verify")(z.target.value===""?null:z.target.value==="true"),children:[r.jsx("option",{value:"",children:"CLI default (on)"}),r.jsx("option",{value:"true",children:"On"}),r.jsx("option",{value:"false",children:"Off"})]})}),r.jsx(ee,{label:"Verification model",children:r.jsxs(Re,{value:s.engine.verify_model||"",onChange:z=>A("verify_model")(z.target.value),children:[r.jsx("option",{value:"",children:"The review model"}),s.engine.verify_model&&!o.profiles.includes(s.engine.verify_model)&&r.jsx("option",{value:s.engine.verify_model,children:s.engine.verify_model}),o.profiles.map(z=>r.jsx("option",{value:z,children:z},z))]})}),r.jsx(ee,{label:"The verifier may drop",children:r.jsxs(Re,{value:s.engine.verify_can_drop||"",onChange:z=>A("verify_can_drop")(z.target.value),children:[r.jsx("option",{value:"",children:"CLI default (confident)"}),r.jsx("option",{value:"confident",children:"Minor findings, and major ones it is sure are wrong"}),r.jsx("option",{value:"minor",children:"Only minor and nitpick findings"}),r.jsx("option",{value:"all",children:"Anything it disputes"})]})}),r.jsx(ee,{label:"The verifier may add findings",children:r.jsxs(Re,{value:String(!!s.engine.verify_can_add),onChange:z=>A("verify_can_add")(z.target.value==="true"),children:[r.jsx("option",{value:"false",children:"No"}),r.jsx("option",{value:"true",children:"Yes"})]})}),r.jsx(ee,{label:"Repository config file",children:r.jsx(ve,{placeholder:".codereview.yaml",value:s.engine.repo_config_file||"",onChange:z=>A("repo_config_file")(z.target.value)})}),r.jsx(ee,{label:"Repositories may pick a model",children:r.jsxs(Re,{value:String(s.allow_repo_model),onChange:z=>F("allow_repo_model")(z.target.value==="true"),children:[r.jsx("option",{value:"false",children:"No"}),r.jsx("option",{value:"true",children:"Yes, with model: in their config file"})]})}),r.jsx(ee,{label:"Repository defaults (JSON)",className:"lg:col-span-3",hint:r.jsx(ne,{children:"Keys of a repository config file (language, path_filters, path_instructions, guidelines, high_level_summary…), applied under each repository's own file. The profile, comment limit and severity are under Default review settings."}),children:r.jsx(an,{rows:4,spellCheck:!1,className:"font-mono text-xs",placeholder:'{"language": "English", "path_filters": ["!**/*.lock"]}',value:d,onChange:z=>h(z.target.value)})})]})}),r.jsx(ai,{title:"Bot and review jobs",children:r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Default bot name",hint:r.jsx(ne,{children:"The mention handle (@name review) for hosts that set none. Empty: each host's token user."}),children:r.jsx(ve,{placeholder:"codereview",value:s.bot_name||"",onChange:z=>F("bot_name")(z.target.value)})}),r.jsx(ee,{label:"Extra environment variables for reviews",hint:r.jsxs("span",{className:"grid gap-1",children:[r.jsx(ne,{children:"Names of the console's variables to pass to every review (model key variables are passed already). The console's own secrets can't be passed."}),s.extra_env.length>0&&r.jsx("span",{className:"flex flex-wrap gap-1.5",children:s.extra_env.map(z=>r.jsxs(at,{kind:s.env_set[z]?"on":"warn",children:[z,s.env_set[z]?"":": not set"]},z))})]}),children:r.jsx(ve,{placeholder:"MY_PROXY_CA, SSL_CERT_DIR",value:l,onChange:z=>u(z.target.value)})})]})}),r.jsx(ai,{title:"Status dashboard access",description:"The status dashboard shows every running and recent review, with repository names unless they are hidden under Status dashboard above.",children:r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Who can open it",hint:r.jsx(ne,{children:Q2(s.dashboard_access,s.dashboard_token_set||!!g,w)}),children:r.jsxs(Re,{value:s.dashboard_access,onChange:z=>F("dashboard_access")(z.target.value),children:[r.jsx("option",{value:"admins",children:"Signed-in admins only"}),r.jsx("option",{value:"token",children:"Admins, and anyone with the token"}),r.jsx("option",{value:"public",children:"Anyone who can reach the console"})]})}),r.jsx(ee,{label:"Dashboard token",hint:r.jsx(ne,{children:"For screens and people without an admin sign-in: /dashboard?token=… or a Bearer header. Stored hashed and never shown again."}),children:r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(ve,{className:"max-w-sm font-mono",placeholder:s.dashboard_token_set?"Set (leave empty to keep it)":"Not set",value:g,onChange:z=>{v(z.target.value),x(!1),b(!1)}}),r.jsx(re,{variant:"outline",onClick:()=>{v(Ag()),x(!1),b(!1)},children:"Generate"}),s.dashboard_token_set&&r.jsx(re,{variant:"ghost",className:"text-destructive",onClick:()=>{v(""),x(!0)},disabled:w,children:w?"Removed on save":"Remove"})]}),r.jsx(J2,{v:s,clearing:w,replacing:!!g})]})}),g&&r.jsxs(r.Fragment,{children:[r.jsx(ee,{label:"New token valid for",hint:r.jsx(ne,{children:"Counted from when you save. After that the link stops working until a new token is generated."}),children:r.jsxs(Re,{value:String(C),onChange:z=>y(parseInt(z.target.value,10)),children:[r.jsx("option",{value:"7",children:"7 days"}),r.jsx("option",{value:"30",children:"30 days"}),r.jsx("option",{value:"90",children:"90 days"}),r.jsx("option",{value:"365",children:"1 year"}),r.jsx("option",{value:"0",children:"Never expires"})]})}),r.jsx(ee,{label:"Link to share",hint:r.jsx(ne,{className:"text-warning",children:"Copy it now: once saved, the token can't be shown again."}),children:r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(ve,{readOnly:!0,className:"font-mono text-xs",value:Mg(g),onFocus:z=>z.target.select()}),r.jsx(re,{variant:"outline",onClick:()=>{var z;(z=navigator.clipboard)==null||z.writeText(Mg(g)).then(()=>b(!0),()=>t("Copy failed: select the link and copy it",!0))},children:_?"Copied":"Copy link"})]})})]})]})}),r.jsx(ai,{title:"Prometheus metrics",description:"/metrics in the Prometheus text format: queue, reviews by kind and result, durations, tokens, webhooks by outcome, and when the license and host tokens expire. No repository names.",children:r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Who can read /metrics",hint:r.jsx(ne,{children:s.metrics_access==="public"?"Anyone who can reach the console's URL. Fine on a private network the scraper shares.":s.metrics_access==="token"?"Scrapers send the token as a bearer token.":"Off: /metrics answers 404."}),children:r.jsxs(Re,{value:s.metrics_access,onChange:z=>F("metrics_access")(z.target.value),children:[r.jsx("option",{value:"off",children:"Off"}),r.jsx("option",{value:"token",children:"Scrapers with the token"}),r.jsx("option",{value:"public",children:"Anyone who can reach the console"})]})}),r.jsx(ee,{label:"Metrics token",hint:r.jsx(ne,{children:R?"Removed when you save.":j?"Replaces the current token when you save.":s.metrics_token_set?"Set. Stored hashed and never shown again.":"No token."}),children:r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(ve,{className:"max-w-sm font-mono",placeholder:s.metrics_token_set?"Set (leave empty to keep it)":"Not set",value:j,onChange:z=>{S(z.target.value),N(!1),P(!1)}}),r.jsx(re,{variant:"outline",onClick:()=>{S(Ag()),N(!1),P(!1)},children:"Generate"}),s.metrics_token_set&&r.jsx(re,{variant:"ghost",className:"text-destructive",onClick:()=>{S(""),N(!0)},disabled:R,children:R?"Removed on save":"Remove"})]})}),s.metrics_access!=="off"&&r.jsx(ee,{label:"Prometheus scrape config",className:"lg:col-span-2",hint:j?r.jsx(ne,{className:"text-warning",children:"Copy it now: once saved, the token can't be shown again."}):r.jsx(ne,{children:"Generate a token to fill it in."}),children:r.jsxs("div",{className:"grid gap-2",children:[r.jsx(an,{readOnly:!0,rows:s.metrics_access==="token"?7:5,className:"font-mono text-xs",value:Og(s.metrics_access,j),onFocus:z=>z.target.select()}),r.jsx("div",{children:r.jsx(re,{variant:"outline",size:"sm",onClick:()=>{var z;(z=navigator.clipboard)==null||z.writeText(Og(s.metrics_access,j)).then(()=>P(!0),()=>t("Copy failed: select the text and copy it",!0))},children:E?"Copied":"Copy"})})]})})]})}),r.jsx(lt,{className:"py-4",children:r.jsxs(uw,{className:"flex flex-wrap items-center gap-3",children:[r.jsx(re,{onClick:q,children:"Save queue and review settings"}),r.jsx(He,{children:"Applies to the next review, without a restart."})]})})]})}const Wu=t=>Kr(t),eR={allowlist:"Repositories no rule matches",require_reviewer:"Who asks for a review",skip_branch_sync:"Branch syncs",sync_source_branches:"Also treat these source branches as syncs",score_labels:"Score labels",commit_status:"Commit status",approve:"Approve merge requests",approve_block:"Findings that block approval",approve_min_score:"Lowest score to approve",approve_withdraw:"When a later review doesn't pass",command_access:"Who can run review and question commands",learnings_enabled:"Learn from replies to the bot",learnings_auto_activate:"New learnings",daily_token_budget:"Daily tokens, all repositories",repo_daily_token_budget:"Daily tokens, per repository",review_retention_days:"Keep reviews",webhook_retention_days:"Keep webhook deliveries",dashboard_enabled:"Dashboard",hide_repos:"Repository names",dashboard_title:"Dashboard title",session_idle_minutes:"Sign out after inactivity"};function tR(){const t=Ze(),o=eo(),[s,a]=m.useState(null);m.useEffect(()=>{Ke("/admin/api/sessions").then(a).catch(h=>t(Ne(h),!0))},[]);const l=async h=>{if(h.current){if(!await o({title:"Sign yourself out?",description:"This is the session you are using now.",action:"Sign out"}))return;Qt("/admin/logout").finally(()=>location.href="/admin/login");return}if(await o({title:"Sign out "+(h.name||h.email)+"?",description:"They can sign in again if the sign-in rules still allow them.",action:"Sign out",danger:!0}))try{a(await Co("/admin/api/sessions/"+h.id)),t("Signed out "+h.email)}catch(g){t(Ne(g),!0)}},u=async()=>{if(await o({title:"Sign out everyone else?",description:"Every other admin session ends now. Use it after removing someone from the sign-in rules or if a session may be compromised.",action:"Sign out others",danger:!0}))try{a(await Qt("/admin/api/sessions/end-others")),t("Signed out every other session")}catch(h){t(Ne(h),!0)}},d=s?s.filter(h=>!h.current).length:0;return r.jsxs(lt,{className:"gap-0 overflow-hidden pb-0",children:[r.jsxs(cn,{className:"pb-4",children:[r.jsx(yn,{className:"h2",children:"Signed-in admins"}),r.jsx(wn,{children:"Every request is checked against the current sign-in rules, so someone removed from them is signed out at once. Group changes at the identity provider apply when the session ends (session_ttl) or here."}),d>0&&r.jsx("div",{children:r.jsx(re,{variant:"outline",size:"sm",onClick:u,children:"Sign out everyone else"})})]}),s?r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-6",children:"Admin"}),r.jsx(je,{children:"From"}),r.jsx(je,{children:"Signed in"}),r.jsx(je,{children:"Last active"}),r.jsx(je,{children:"Expires"}),r.jsx(je,{})]})}),r.jsx($n,{children:s.map(h=>r.jsxs(ct,{children:[r.jsxs(ke,{className:"pl-6",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[r.jsx("span",{className:"font-medium",children:h.name||h.email}),h.current&&r.jsx(Tt,{variant:"secondary",children:"you, this browser"})]}),h.name&&r.jsx(ne,{children:h.email})]}),r.jsxs(ke,{children:[r.jsx("div",{className:"font-mono text-xs",children:h.ip||"—"}),h.user_agent&&r.jsx(ne,{title:h.user_agent,children:bw(h.user_agent)})]}),r.jsx(ke,{children:Wu(h.created)}),r.jsx(ke,{children:h.last_seen?Wu(h.last_seen):"—"}),r.jsx(ke,{children:Wu(h.expires)}),r.jsx(ke,{className:"pr-6 text-right",children:r.jsx(re,{size:"sm",variant:"ghost",className:h.current?"":"text-destructive",onClick:()=>l(h),children:"Sign out"})})]},h.id))})]}):r.jsx(qe,{children:"Loading…"})]})}function xn({label:t,value:o,onChange:s,yes:a,no:l,disabled:u,note:d}){return r.jsx(ee,{label:t,hint:d,children:r.jsxs(Re,{value:String(o),disabled:u,onChange:h=>s(h.target.value==="true"),children:[r.jsx("option",{value:"true",children:a}),r.jsx("option",{value:"false",children:l})]})})}function ns({label:t,value:o,onChange:s,note:a,...l}){return r.jsx(ee,{label:t,hint:a,children:r.jsx(ve,{type:"number",value:o||"",...l,onChange:u=>s(parseInt(u.target.value||"0",10))})})}function Fr({title:t,description:o,children:s}){return r.jsxs(lt,{children:[r.jsxs(cn,{children:[r.jsx(yn,{className:"h2",children:t}),o&&r.jsx(wn,{children:o})]}),r.jsx(Pt,{children:s})]})}function nR(){const t=Ze(),o=bi(),s=to(),a={learnings:qt("learnings"),budgets:qt("budgets"),sync:qt("branch_sync"),metrics:qt("metrics")},[l,u]=m.useState(null),[d,h]=m.useState(null),[g,v]=m.useState(""),[w,x]=m.useState(0),C=j=>{u(j),h(j),v((j.sync_source_branches||[]).join(", "))};if(m.useEffect(()=>{Ke("/admin/api/settings").then(C).catch(j=>t(Ne(j),!0))},[]),!l||!d)return r.jsx(qe,{children:"Loading…"});const y=j=>S=>h({...d,[j]:S}),_=j=>{const{source:S,...R}={...d,review_defaults:j,dashboard_title:d.dashboard_title.trim(),sync_source_branches:g.split(",").map(N=>N.trim()).filter(Boolean)};bn("/admin/api/settings",R).then(N=>{C(N),x(E=>E+1),o(),t("Settings saved")}).catch(N=>t(Ne(N),!0))},b=Object.keys(l.source||{}).filter(j=>l.source[j]==="config").map(j=>eR[j]||j.replace(/_/g," "));return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(Fr,{title:"Repository access",description:"Which repositories are reviewed, and when.",children:r.jsxs(Ge,{children:[r.jsx(xn,{label:"Repositories no rule matches",value:d.allowlist,onChange:y("allowlist"),yes:"Not reviewed (allowlist on)",no:"Reviewed (allowlist off)"}),r.jsx(xn,{label:"Who asks for a review",value:d.require_reviewer,onChange:y("require_reviewer"),yes:"Only when the bot is a reviewer",no:"Any opened MR or push"}),r.jsx(xn,{label:"Branch syncs (source is the default branch)",value:d.skip_branch_sync,onChange:y("skip_branch_sync"),yes:"Skip",no:"Review",disabled:!a.sync,note:r.jsx(Qa,{feature:"branch_sync"})}),r.jsx(ee,{label:"Also treat these source branches as syncs",children:r.jsx(ve,{placeholder:"develop, release/*",value:g,disabled:!a.sync,onChange:j=>v(j.target.value)})}),r.jsx(xn,{label:"Score labels on MRs/PRs",value:d.score_labels,onChange:y("score_labels"),yes:"On",no:"Off"}),r.jsx(xn,{label:"Commit status on the reviewed commit",value:d.commit_status,onChange:y("commit_status"),yes:"On",no:"Off"}),r.jsx(ee,{label:"Who can run review and question commands",hint:r.jsx(He,{className:"text-xs",children:"Commands that run the model spend tokens. Write access means GitLab Developer or higher, GitHub write or above, Bitbucket write or admin (the Bitbucket token needs admin on the repository to check). @bot help works for everyone, and each person is limited to a few commands an hour."}),children:r.jsxs(Re,{value:d.command_access||"write",onChange:j=>y("command_access")(j.target.value),children:[r.jsx("option",{value:"write",children:"People who can push to the repository"}),r.jsx("option",{value:"anyone",children:"Anyone who can comment"})]})})]})}),r.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[r.jsxs(Fr,{title:"Approve merge requests",description:"The bot approves a merge request whose review passes, as its token's user (or the GitHub App). Rules can turn this on or off for groups and repositories. Needs code-review-bot 0.5 or later on the Executor page.",children:[r.jsxs(Ge,{children:[r.jsx(xn,{label:"Approve when the review passes",value:d.approve,onChange:y("approve"),yes:"On",no:"Off"}),r.jsx(ee,{label:"Findings that block approval",hint:r.jsx(He,{className:"text-xs",children:"New findings, ones beyond the comment limit and ones still open from an earlier review all count; questions don't."}),children:r.jsxs(Re,{value:d.approve_block||"major",onChange:j=>y("approve_block")(j.target.value),children:[r.jsx("option",{value:"critical",children:"Critical"}),r.jsx("option",{value:"major",children:"Major or critical"}),r.jsx("option",{value:"minor",children:"Minor or above"}),r.jsx("option",{value:"nitpick",children:"Any finding (nitpicks too)"}),r.jsx("option",{value:"none",children:"None: approve whatever it found"})]})}),r.jsx(ns,{label:"Lowest score to approve",value:d.approve_min_score,onChange:y("approve_min_score"),min:0,max:100,placeholder:"0",note:r.jsx(He,{className:"text-xs",children:"Every score (quality, security, maintainability) must be at least this. 0 ignores the scores."})}),r.jsx(xn,{label:"When a later review doesn't pass",value:d.approve_withdraw,onChange:y("approve_withdraw"),yes:"Withdraw the bot's approval",no:"Leave it"})]}),r.jsx(He,{className:"text-xs",children:"A partial or too-large review leaves the approval as it is. GitLab: the bot's user must be allowed to approve. GitHub: withdrawing dismisses the bot's review, which branch protection may restrict."})]}),r.jsx(Fr,{title:"Learnings",children:r.jsxs(Ge,{children:[r.jsx(xn,{label:"Learn from replies to the bot",value:d.learnings_enabled,onChange:y("learnings_enabled"),yes:"On",no:"Off",disabled:!a.learnings,note:r.jsx(Qa,{feature:"learnings"})}),r.jsx(xn,{label:"New learnings",value:d.learnings_auto_activate,onChange:y("learnings_auto_activate"),yes:"Apply at once",no:"Wait for an admin's approval",disabled:!a.learnings,note:r.jsx(He,{className:"text-xs",children:"Even when set to apply at once, a learning only applies right away if its author can push to the repository (GitLab Developer or higher, GitHub write or above). Anyone else's waits for approval, and so does every learning from Bitbucket."})})]})}),r.jsxs(Fr,{title:"Budgets",description:'Input plus output tokens of finished jobs in the current UTC day. When a budget is used up, automatic reviews and chat commands wait until the next day; "Review now" and re-runs from this panel still run.',children:[r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ns,{label:"Daily tokens, all repositories",min:0,step:1e4,placeholder:"0 = no limit",value:d.daily_token_budget,onChange:y("daily_token_budget"),disabled:!a.budgets,note:r.jsx(Qa,{feature:"budgets"})}),r.jsx(ns,{label:"Daily tokens per repository",min:0,step:1e4,placeholder:"0 = no limit",value:d.repo_daily_token_budget,onChange:y("repo_daily_token_budget"),disabled:!a.budgets})]}),a.budgets&&!d.daily_token_budget&&!d.repo_daily_token_budget&&r.jsx(He,{className:"text-warning",children:"No daily limit is set: reviews and commands spend tokens without a cap. Set a budget to bound what a busy day, or misuse, can cost."})]}),r.jsx(Fr,{title:"History",children:r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ns,{label:"Keep reviews (days)",min:1,max:3650,value:d.review_retention_days,onChange:y("review_retention_days"),note:!a.metrics&&d.review_retention_days>s.free_retention_days?r.jsxs("span",{className:"locknote text-xs text-warning",children:["Without a license with metrics and long history, reviews are kept ",s.free_retention_days," days."]}):null}),r.jsx(ns,{label:"Keep webhook deliveries (days)",min:1,max:3650,value:d.webhook_retention_days,onChange:y("webhook_retention_days")})]})}),r.jsx(Fr,{title:"Admin sessions",description:"Every admin session also ends after session_ttl (12 hours by default), whatever happens.",children:r.jsx(Ge,{children:r.jsx(ns,{label:"Sign out after inactivity (minutes)",min:0,max:1440,placeholder:"0 = never",value:d.session_idle_minutes,onChange:y("session_idle_minutes"),note:r.jsx(He,{className:"text-xs",children:"A session that makes no request for this long is signed out, so a browser left open on a shared machine doesn't keep admin rights. The panel's own refreshes (Setup, the dashboard) don't count as activity. 5 to 1440, or 0 for never."})})})}),r.jsx(Fr,{title:"Status dashboard",description:"Who can open it is set under Status dashboard access, further down.",children:r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(xn,{label:"Dashboard",value:d.dashboard_enabled,onChange:y("dashboard_enabled"),yes:"On",no:"Off"}),r.jsx(xn,{label:"Repository names",value:!d.hide_repos,onChange:j=>y("hide_repos")(!j),yes:"Shown",no:"Hidden"}),r.jsx(ee,{label:"Title",className:"sm:col-span-2",children:r.jsx(ve,{maxLength:120,value:d.dashboard_title,onChange:j=>y("dashboard_title")(j.target.value)})})]})})]}),r.jsx(lt,{className:"py-4",children:r.jsxs(uw,{className:"flex flex-wrap items-center gap-3",children:[r.jsx(re,{onClick:()=>_(l.review_defaults),children:"Save settings"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:b.length?"Showing defaults for: "+b.join("; ")+". Save to keep them.":""})]})}),r.jsx(Fr,{title:"Default review settings",description:"Apply to every repository. Group and pattern rules, then repository settings, override them.",children:r.jsx(kf,{value:l.review_defaults,onSave:_,saveLabel:"Save default review settings"},w)}),r.jsx(jd,{name:"Queue, review engine and access settings",children:r.jsx(Z2,{})}),r.jsx(jd,{name:"Sign-in sessions",children:r.jsx(tR,{})}),r.jsx(He,{children:"These settings are kept in the database and apply without a restart. Every change is in the audit log."})]})}const Wa={actor:"",action:"",target:"",q:"",from:"",to:""},rR=["login","login.denied","logout","session.*","session.ended","session.revoke","setting.put","host.*","host.put","host.delete","webhook.*","webhook.put","webhook.delete","repo.*","rule.*","learning.*","model.*","audit.export"];function $r(t,o){const s=new URLSearchParams;for(const[a,l]of Object.entries(t))l.trim()&&s.set(a,l.trim());return o&&s.set("before",String(o)),s.toString()}function Xa(t,o="",s={}){if(t&&typeof t=="object"&&!Array.isArray(t)){for(const[a,l]of Object.entries(t))Xa(l,o?o+"."+a:a,s);!Object.keys(t).length&&o&&(s[o]="{}")}else o&&(s[o]=t===void 0?"":typeof t=="string"?t:JSON.stringify(t));return s}const oR=t=>{const[o,s]=t.split(":");return o.replace(/_/g," ")+" "+(s||"changed")};function Rw({detail:t}){const[o,s]=m.useState(!1),a=t&&typeof t=="object"?t:{},l="before"in a||"after"in a,u=Array.isArray(a.secrets_changed)?a.secrets_changed:[];let d=[],h="";if(l){const g=Xa(a.before),v=Xa(a.after);a.before==null&&"after"in a&&(h="created"),"after"in a||(h="deleted");for(const w of Array.from(new Set([...Object.keys(g),...Object.keys(v)])).sort())g[w]!==v[w]&&d.push({key:w,old:a.before==null?void 0:g[w],now:"after"in a?v[w]:void 0})}else d=Object.entries(Xa(t)).map(([g,v])=>({key:g,now:v}));return r.jsxs("div",{className:"grid gap-1 text-xs",children:[h&&r.jsx("span",{className:"text-muted-foreground",children:h}),d.length===0&&!u.length&&!h&&r.jsx("span",{className:"text-muted-foreground",children:l?"no visible change":"—"}),d.slice(0,20).map(g=>r.jsxs("div",{className:"break-all",children:[r.jsx("span",{className:"font-medium",children:g.key}),": ",g.old!==void 0&&r.jsx("span",{className:"text-destructive line-through",children:g.old||"∅"}),g.old!==void 0&&g.now!==void 0&&" → ",g.now!==void 0&&r.jsx("span",{className:l?"text-success":"",children:g.now||"∅"})]},g.key)),d.length>20&&r.jsxs("span",{className:"text-muted-foreground",children:["and ",d.length-20," more (see raw)"]}),u.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1",children:u.map(g=>r.jsx(Tt,{variant:"outline",className:"font-normal",children:oR(g)},g))}),r.jsx("div",{children:r.jsx("button",{type:"button",className:"text-muted-foreground underline-offset-2 hover:underline",onClick:()=>s(!o),children:o?"Hide raw":"Raw"})}),o&&r.jsx("pre",{className:"max-h-60 overflow-auto rounded-md bg-muted p-2 font-mono whitespace-pre-wrap break-all",children:JSON.stringify(t,null,2)})]})}function sR(){const t=Ze(),o=qt("audit"),[s,a]=Of(Wa),[l,u]=m.useState(s),[d,h]=m.useState(null),[g,v]=m.useState(0),[w,x]=m.useState(!1),C=(S,R)=>{x(!0),Ke("/admin/api/audit?"+$r(S,R)).then(N=>{h(E=>R&&E?[...E,...N.entries]:N.entries),v(N.next)}).catch(N=>t(Ne(N),!0)).finally(()=>x(!1))};if(m.useEffect(()=>{o&&(u(s),C(s))},[o,$r(s)]),!o)return r.jsx("section",{children:r.jsx(ji,{feature:"audit",children:"Every admin change is still recorded; viewing the audit log is part of the licensed console."})});const y=S=>R=>u({...l,[S]:R.target.value}),_=S=>{S==null||S.preventDefault();const R=Object.fromEntries(Object.entries(l).map(([N,E])=>[N,E.trim()]));$r(R)===$r(s)?C(R):a(R)},b=()=>{u(Wa),$r(s)?a(Wa):C(Wa)},j=S=>"/admin/api/audit/export?"+$r(s)+($r(s)?"&":"")+"format="+S;return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(un,{children:r.jsxs("form",{onSubmit:_,className:"grid gap-3 p-4 sm:grid-cols-2 lg:grid-cols-6",children:[r.jsx(ee,{label:"Who",children:r.jsx(ve,{placeholder:"email",value:l.actor,onChange:y("actor")})}),r.jsxs(ee,{label:"Action",children:[r.jsx(ve,{list:"audit-actions",placeholder:"host.* or login.denied",value:l.action,onChange:y("action")}),r.jsx("datalist",{id:"audit-actions",children:rR.map(S=>r.jsx("option",{value:S},S))})]}),r.jsx(ee,{label:"Target",children:r.jsx(ve,{placeholder:"gitlab:group/project",value:l.target,onChange:y("target")})}),r.jsx(ee,{label:"Search",children:r.jsx(ve,{placeholder:"in targets and details",value:l.q,onChange:y("q")})}),r.jsx(ee,{label:"From",children:r.jsx(ve,{type:"date",value:l.from,onChange:y("from")})}),r.jsx(ee,{label:"To",children:r.jsx(ve,{type:"date",value:l.to,onChange:y("to")})}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2 lg:col-span-6",children:[r.jsx(re,{type:"submit",children:"Apply"}),r.jsx(re,{type:"button",variant:"ghost",onClick:b,children:"Clear"}),r.jsx("span",{className:"flex-1"}),r.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:r.jsx("a",{href:j("csv"),children:"Export CSV"})}),r.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:r.jsx("a",{href:j("jsonl"),children:"Export JSON Lines"})})]})]})}),r.jsxs(un,{children:[d?d.length?r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"When"}),r.jsx(je,{children:"Who"}),r.jsx(je,{children:"Action"}),r.jsx(je,{children:"Target"}),r.jsx(je,{className:"pr-4",children:"Changes"})]})}),r.jsx($n,{children:d.map(S=>r.jsxs(ct,{children:[r.jsx(ke,{className:"pl-4 align-top whitespace-nowrap text-muted-foreground",title:ml(S.at),children:Kr(S.at,!0)}),r.jsxs(ke,{className:"align-top",children:[S.actor,S.ip&&r.jsxs(ne,{title:S.user_agent,children:[S.ip,S.user_agent?" · "+bw(S.user_agent):""]})]}),r.jsx(ke,{className:"align-top",children:r.jsx("code",{children:S.action})}),r.jsx(ke,{className:"max-w-56 align-top break-all whitespace-normal",children:S.target}),r.jsx(ke,{className:"max-w-xl min-w-64 pr-4 align-top whitespace-normal",children:r.jsx(Rw,{detail:S.detail})})]},S.id))})]}):r.jsx(qe,{children:$r(s)?"Nothing matches these filters.":"No admin activity yet."}):r.jsx(qe,{children:"Loading…"}),g>0&&r.jsx("div",{className:"flex justify-center p-3",children:r.jsx(re,{variant:"outline",disabled:w,onClick:()=>C(s,g),children:w?"Loading…":"Older entries"})})]})]})}const iR=t=>t==="applied"?"on":t==="pending"?"warn":t==="failed"?"off":"idle";function aR(){const t=Ze(),o=to(),s=bi(),[a,l]=m.useState("pending"),[u,d]=m.useState(null),[h,g]=m.useState({}),[v,w]=m.useState(null),x=o.role==="admin",C=(b=a)=>Ke("/admin/api/approvals"+(b==="all"?"":"?status="+b)).then(d).catch(j=>t(Ne(j),!0));m.useEffect(()=>{C()},[a]);const y=async(b,j)=>{var S,R;try{const N=await Qt(`/admin/api/approvals/${b.id}/${j}`,j==="reject"?{reason:h[b.id]||""}:void 0);if(j==="approve"){const E=(S=N.request)==null?void 0:S.status;t(E==="applied"?"Applied: "+b.summary:"Failed: "+(((R=N.request)==null?void 0:R.result)||""),E!=="applied"),E==="applied"&&N.response&&JSON.stringify(N.response).includes('"secret"')&&w({summary:b.summary,response:N.response})}else t(j==="reject"?"Rejected":"Cancelled");C(),s()}catch(N){t(Ne(N),!0)}},_=(u||[]).filter(b=>x||b.requested_by===o.email);return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(He,{children:x?"Operators change repositories, rules and learnings and run reviews directly. Their other changes (code hosts, webhooks, settings, models, the executor, the license) wait here. Approving runs the change as the operator, with the same checks, and the audit log names both of you. Requests expire after 7 days.":"Changes to code hosts, webhooks, settings, models, the executor and the license wait for an admin. Your requests are listed here; they expire after 7 days."}),v&&r.jsx(un,{children:r.jsxs("div",{className:"grid gap-2 p-4",children:[r.jsxs("div",{className:"font-medium",children:[v.summary,": copy the new secret now, it isn't shown again"]}),r.jsx("pre",{className:"max-h-60 overflow-auto rounded-md bg-muted p-2 font-mono text-xs whitespace-pre-wrap break-all",children:JSON.stringify(v.response,null,2)}),r.jsx("div",{children:r.jsx(re,{variant:"outline",size:"sm",onClick:()=>w(null),children:"Done"})})]})}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs(Re,{className:"w-48",value:a,onChange:b=>l(b.target.value),children:[r.jsx("option",{value:"pending",children:"Waiting"}),r.jsx("option",{value:"all",children:"All requests"})]})}),r.jsx(un,{children:u?_.length?r.jsx("ul",{className:"divide-y",children:_.map(b=>r.jsxs("li",{className:"grid gap-2 p-4 md:grid-cols-[1fr_minmax(16rem,28rem)]",children:[r.jsxs("div",{className:"grid gap-1",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("span",{className:"font-medium",children:b.summary}),r.jsx(at,{kind:iR(b.status),children:b.status==="pending"?"waiting":b.status})]}),r.jsxs(ne,{children:["asked by ",b.requested_by," · ",r.jsx("span",{title:ml(b.requested_at),children:Kr(b.requested_at)}),b.decided_by&&b.status!=="pending"&&r.jsxs(r.Fragment,{children:[" · ",b.status," by ",b.decided_by,b.decided_at?" "+Kr(b.decided_at):""]})]}),b.result&&b.status!=="applied"&&r.jsx(ne,{className:b.status==="failed"?"text-destructive":"",children:b.result}),b.status==="pending"&&r.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[x&&r.jsx(re,{size:"sm",onClick:()=>y(b,"approve"),children:"Approve"}),x&&r.jsxs(r.Fragment,{children:[r.jsx(ve,{className:"h-8 max-w-60",placeholder:"Reason (optional)",value:h[b.id]||"",onChange:j=>g({...h,[b.id]:j.target.value})}),r.jsx(re,{size:"sm",variant:"outline",onClick:()=>y(b,"reject"),children:"Reject"})]}),b.requested_by===o.email&&r.jsx(re,{size:"sm",variant:"ghost",onClick:()=>y(b,"cancel"),children:"Cancel request"})]})]}),r.jsx("div",{className:"min-w-0",children:r.jsx(Rw,{detail:b.preview})})]},b.id))}):r.jsx(qe,{children:a==="pending"?"Nothing waits for approval.":"No requests yet."}):r.jsx(qe,{children:"Loading…"})})]})}const lR={none:["Free core","idle"],active:["Active","on"],grace:["Expired — grace period","warn"],expired:["Expired","off"],invalid:["Not valid","off"]};function cR(){const t=to(),o=bi(),s=Ze(),a=eo(),l=t.license,[u,d]=m.useState(""),[h,g]=lR[l.state],v=x=>bn("/admin/api/license",{key:x}).then(()=>{d(""),o(),s(x?"License installed":"License removed")}).catch(C=>s(Ne(C),!0)),w=async()=>{await a({title:"Remove the license?",description:"Paid features turn off at once.",action:"Remove license",danger:!0})&&v("")};return r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(lt,{children:[r.jsx(cn,{children:r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(at,{kind:g,children:h}),l.customer&&r.jsxs("span",{className:"text-sm",children:[r.jsx("b",{children:l.customer})," · ",l.plan]}),r.jsx("span",{className:"flex-1"}),l.expires_at&&r.jsxs("span",{className:"text-sm text-muted-foreground",children:["expires ",Vm(l.expires_at)]})]})}),r.jsxs(Pt,{className:"grid gap-4",children:[l.error&&r.jsx(Zn,{variant:"destructive",className:"banner bad",children:r.jsx(er,{children:l.error})}),l.state==="grace"&&r.jsx(Zn,{className:"banner border-warning/40 bg-warning-soft",children:r.jsxs(er,{className:"text-warning",children:["The license has expired. Paid features keep working until ",Vm(l.grace_until),"; renew it to keep them."]})}),r.jsxs("div",{children:[r.jsx("h2",{className:"h2 mb-3 text-sm font-semibold",children:"Features"}),r.jsx("ul",{className:"feats grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:Object.keys(al).map(x=>{const C=l.features.includes(x);return r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"flex size-5 items-center justify-center rounded-full "+(C?"bg-success-soft text-success":"bg-muted text-muted-foreground"),children:C?r.jsx(hl,{className:"size-3"}):r.jsx(hk,{className:"size-3"})}),r.jsx("span",{className:C?"":"text-muted-foreground",children:al[x]}),r.jsx("span",{className:"sr-only",children:C?"on":"off"})]},x)})})]}),r.jsxs(He,{children:["Free without a license: reviews for one GitHub, GitLab and Bitbucket host each, the local executor, repository on/off, ",r.jsx("code",{children:"@bot"})," commands, review history for ",t.free_retention_days," days, the status dashboard and admin sign-in by email."]})]})]}),r.jsxs(lt,{children:[r.jsxs(cn,{children:[r.jsxs(yn,{className:"flex items-center gap-2",children:[r.jsx(wv,{className:"size-4"}),l.state==="none"?"Install a license":"Replace the license"]}),r.jsx(wn,{children:"Keys are verified offline; the console never calls home."})]}),r.jsx(Pt,{className:"grid gap-4",children:l.managed?r.jsx("p",{className:"text-sm text-muted-foreground",children:l.source==="env"?r.jsxs(r.Fragment,{children:["This license comes from ",r.jsx("code",{children:"CODEREVIEW_CONSOLE_LICENSE"}),", which overrides the one managed here. Remove the variable and restart to manage the license here."]}):r.jsxs(r.Fragment,{children:["This license comes from ",r.jsx("code",{children:"license.file"})," because the console has no database. With ",r.jsx("code",{children:"database.url"})," set, the key is copied into the database and managed here."]})}):r.jsxs(r.Fragment,{children:[r.jsx(ee,{label:"License key",children:r.jsx(an,{className:"key min-h-28 font-mono text-xs",placeholder:"DIV1.… or the -----BEGIN DIVMORA LICENSE KEY----- block",autoComplete:"off",spellCheck:!1,value:u,onChange:x=>d(x.target.value)})}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(re,{disabled:!u.trim(),onClick:()=>v(u.trim()),children:"Install"}),l.source==="database"&&r.jsx(re,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:w,children:"Remove license"})]}),r.jsx(He,{children:"A pasted key is stored in the database and applies at once, except the executor, which is chosen when the console starts."})]})})]}),r.jsxs(He,{children:["Every use of a paid feature needs a license from Divmora, in development, CI and production alike. For a license or a trial, contact"," ",r.jsx("a",{className:"text-primary underline-offset-4 hover:underline",href:"mailto:licensing@divmora.com",children:"licensing@divmora.com"}),"."]})]})}const uR={openai:"OPENAI_API_KEY",anthropic:"ANTHROPIC_API_KEY",gemini:"GEMINI_API_KEY",bedrock:"",azure:"AZURE_OPENAI_API_KEY",ollama:"",openrouter:"OPENROUTER_API_KEY",groq:"GROQ_API_KEY",deepseek:"DEEPSEEK_API_KEY",mistral:"MISTRAL_API_KEY",xai:"XAI_API_KEY",together:"TOGETHER_API_KEY",litellm:"LITELLM_API_KEY","openai-compatible":"OPENAI_COMPATIBLE_API_KEY"},Lg=t=>t==="azure"||t==="openai-compatible",Tn=t=>typeof t=="string"?t:t==null?"":String(t),dR=["provider","model","api_key_env","base_url","region","timeout"];function fR({profile:t,providers:o,onSaved:s,onCancel:a}){const l=Ze(),u=()=>{const y=(t==null?void 0:t.config)??{};return{name:(t==null?void 0:t.name)??"",provider:Tn(y.provider)||"anthropic",model:Tn(y.model),api_key_env:Tn(y.api_key_env),base_url:Tn(y.base_url),region:Tn(y.region),timeout:Tn(y.timeout)}},[d,h]=m.useState(u),[g,v]=m.useState(!1),w=y=>_=>h({...d,[y]:_.target.value}),x=async()=>{const y={...(t==null?void 0:t.config)??{}};for(const _ of dR)y[_]=d[_].trim();v(!0);try{s(await bn("/admin/api/models/"+encodeURIComponent(d.name.trim()),{config:y})),l("Saved "+d.name.trim())}catch(_){l(Ne(_),!0)}finally{v(!1)}},C=uR[d.provider];return r.jsxs("div",{className:"grid gap-4",children:[r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Name",hint:r.jsx(ne,{children:"Repositories and the default refer to it by this name. Lowercase, e.g. claude or fast."}),children:r.jsx(ve,{value:d.name,onChange:w("name"),disabled:!!t,placeholder:"claude",autoFocus:!t})}),r.jsx(ee,{label:"Provider",children:r.jsx(Re,{value:d.provider,onChange:w("provider"),children:o.map(y=>r.jsx("option",{value:y,children:y},y))})}),r.jsx(ee,{label:"Model",className:"lg:col-span-2",hint:r.jsxs(ne,{children:["The provider's model ID",d.provider==="bedrock"?" or inference profile ID":"","."]}),children:r.jsx(ve,{value:d.model,onChange:w("model"),placeholder:d.provider==="ollama"?"qwen2.5-coder:14b":""})}),C!==""&&r.jsx(ee,{label:"API key: environment variable",className:"lg:col-span-2",hint:r.jsxs(ne,{children:["The console never stores API keys. Set the key in this environment variable of the console (for example in its Kubernetes Secret) and restart it once; the console passes it to review jobs. Empty means ",C,"."]}),children:r.jsx(ve,{value:d.api_key_env,onChange:w("api_key_env"),placeholder:C,spellCheck:!1})}),r.jsx(ee,{label:Lg(d.provider)?"Base URL":"Base URL (optional)",className:"lg:col-span-2",hint:r.jsx(ne,{children:Lg(d.provider)?"Required for this provider.":"Only for a proxy or a self-hosted endpoint."}),children:r.jsx(ve,{value:d.base_url,onChange:w("base_url"),placeholder:"https://",spellCheck:!1})}),d.provider==="bedrock"&&r.jsx(ee,{label:"AWS region",hint:r.jsx(ne,{children:"Credentials come from the AWS chain (IRSA, instance role, env)."}),children:r.jsx(ve,{value:d.region,onChange:w("region"),placeholder:"us-east-1"})}),r.jsx(ee,{label:"Timeout (optional)",hint:r.jsx(ne,{children:"Per request, e.g. 2m or 10m for slow local models."}),children:r.jsx(ve,{value:d.timeout,onChange:w("timeout"),placeholder:"default"})})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(re,{onClick:x,disabled:g||!d.name.trim()||!d.model.trim(),children:t?"Save profile":"Add profile"}),r.jsx(re,{variant:"outline",onClick:a,children:"Cancel"})]})]})}function hR({p:t}){return t.key_env?r.jsxs("span",{className:"grid gap-1",children:[r.jsx("code",{className:"text-xs",children:t.key_env}),t.key_set?r.jsx(at,{kind:"on",children:"set"}):r.jsx(at,{kind:"warn",children:"not set in the console"})]}):r.jsx("span",{className:"text-sm text-muted-foreground",children:"none needed"})}function pR({v:t,onSaved:o}){const s=Ze(),[a,l]=m.useState(t.default),[u,d]=m.useState(t.fallback),[h,g]=m.useState("");m.useEffect(()=>{l(t.default),d(t.fallback)},[t.default,t.fallback.join(",")]);const v=t.profiles.map(y=>y.name),w=v.filter(y=>y!==a&&!u.includes(y)),x=a!==t.default||u.join(",")!==t.fallback.join(","),C=async()=>{try{o(await bn("/admin/api/model-choice",{default:a,fallback:u.filter(y=>y!==a)})),s("Default model saved")}catch(y){s(Ne(y),!0)}};return r.jsxs(lt,{children:[r.jsxs(cn,{children:[r.jsx(yn,{className:"h2",children:"Default model"}),r.jsx(wn,{children:"Reviews use the default unless a repository picks another profile. When it fails, the fallbacks are tried in order."})]}),r.jsxs(Pt,{className:"grid gap-4",children:[r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Default",children:r.jsxs(Re,{value:v.includes(a)?a:"",onChange:y=>l(y.target.value),children:[r.jsx("option",{value:"",disabled:!0,children:"Choose a profile"}),v.map(y=>r.jsx("option",{value:y,children:y},y))]})}),r.jsx(ee,{label:"Fallbacks, in order",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[u.map((y,_)=>r.jsxs(Tt,{variant:"secondary",className:"gap-1",children:[_+1,". ",y,r.jsx("button",{type:"button","aria-label":"Remove "+y,className:"rounded-sm hover:text-destructive",onClick:()=>d(u.filter(b=>b!==y)),children:r.jsx(Pd,{className:"size-3"})})]},y)),w.length>0&&r.jsxs(Re,{className:"h-8 w-auto",value:h,onChange:y=>{y.target.value&&d([...u,y.target.value]),g("")},"aria-label":"Add a fallback",children:[r.jsx("option",{value:"",children:u.length?"Add another…":"Add a fallback…"}),w.map(y=>r.jsx("option",{value:y,children:y},y))]}),!u.length&&!w.length&&r.jsx("span",{className:"text-sm text-muted-foreground",children:"add another profile to use one"})]})})]}),r.jsx("div",{children:r.jsx(re,{onClick:C,disabled:!x||!v.includes(a),children:"Save default"})})]})]})}function mR(){const t=Ze(),o=eo(),s=bi(),[a,l]=m.useState(null),[u,d]=m.useState(null),h=()=>Ke("/admin/api/models").then(l).catch(x=>t(Ne(x),!0));m.useEffect(()=>{h()},[]);const g=x=>{l(x),d(null),s()},v=async x=>{if(await o({title:"Delete "+x.name+"?",description:"Repositories can't pick it any more.",action:"Delete profile",danger:!0}))try{g(await Co("/admin/api/models/"+encodeURIComponent(x.name))),t("Deleted "+x.name)}catch(C){t(Ne(C),!0)}};if(!a)return r.jsx(qe,{children:"Loading…"});const w=u===null?"":u==="new"?"Add a model profile":"Edit "+u.name;return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(lr,{children:r.jsxs(re,{onClick:()=>d("new"),children:[r.jsx(hs,{})," Add profile"]})}),r.jsx(un,{children:a.profiles.length===0?r.jsx(qe,{children:"No model profiles yet. Add one to start reviewing."}):r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"Profile"}),r.jsx(je,{children:"Provider and model"}),r.jsx(je,{children:"API key"}),r.jsx(je,{})]})}),r.jsx($n,{children:a.profiles.map(x=>r.jsxs(ct,{children:[r.jsxs(ke,{className:"pl-4 align-top",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[r.jsx("span",{className:"font-medium",children:x.name}),x.name===a.default&&r.jsx(Tt,{children:"default"}),a.fallback.includes(x.name)&&r.jsxs(Tt,{variant:"secondary",children:["fallback ",a.fallback.indexOf(x.name)+1]})]}),r.jsxs(ne,{children:["by ",x.updated_by||"—"]})]}),r.jsxs(ke,{className:"align-top whitespace-normal",children:[r.jsxs("code",{className:"text-xs",children:[Tn(x.config.provider),":",Tn(x.config.model)]}),!!x.config.base_url&&r.jsx(ne,{children:Tn(x.config.base_url)}),!!x.config.region&&r.jsx(ne,{children:Tn(x.config.region)})]}),r.jsx(ke,{className:"align-top",children:r.jsx(hR,{p:x})}),r.jsx(ke,{className:"pr-4 text-right align-top",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(re,{size:"sm",variant:"outline",onClick:()=>d(x),children:"Edit"}),r.jsx(re,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>v(x),children:"Delete"})]})})]},x.name))})]})}),a.profiles.length>0&&r.jsx(pR,{v:a,onSaved:g}),r.jsx(He,{children:"API keys are never stored in the console: each profile names an environment variable of the console that holds its key, and the console hands that key to each review job."}),r.jsx(ko,{open:u!==null,onClose:()=>d(null),title:w,description:"A provider, a model and where its API key comes from.",children:u!==null&&r.jsx(fR,{profile:u==="new"?null:u,providers:a.providers,onSaved:g,onCancel:()=>d(null)},u==="new"?"new":u.name)})]})}const Vu=t=>Object.entries(t??{}).map(([o,s])=>o+"="+s).join(` -`);function Hu(t,o){const s={};for(const a of o.split(` -`)){const l=a.trim();if(!l)continue;const u=l.indexOf("=");if(u<=0)throw new Error(t+": write each entry as key=value ("+l+")");s[l.slice(0,u).trim()]=l.slice(u+1).trim()}return s}const Ig=t=>t&&Object.keys(t).length?JSON.stringify(t,null,2):"";function zg(t,o,s){if(!o.trim())return;let a;try{a=JSON.parse(o)}catch{throw new Error(t+" is not valid JSON")}if(s?!Array.isArray(a):typeof a!="object"||a===null||Array.isArray(a))throw new Error(t+(s?" must be a JSON list":" must be a JSON object"));return a}const gR={binary:"Binary",network:"Docker network",namespace:"Namespace",service_account:"Service account",automount_service_account_token:"Kubernetes API token in pods",cluster:"Cluster connection",env:"Passed-through env vars"},vR={local:"Local",docker:"Docker",kubernetes:"Kubernetes"};function Fg(t){const o=t.ca_bundle??{};return{version:t.version??"",cpu:t.cpu??"",memory:t.memory??"",ttl:t.ttl??"",priority:t.priority_class_name??"",storage:t.ephemeral_storage??"",tmp:t.tmp_size_limit??"",nodeSelector:Vu(t.node_selector),labels:Vu(t.pod_labels),annotations:Vu(t.pod_annotations),tolerations:Ig(t.tolerations),affinity:Ig(t.affinity),caKind:o.config_map?"config_map":o.secret?"secret":"",caName:o.config_map||o.secret||"",caKey:o.key??""}}function xR(t){return{version:t.version.trim(),cpu:t.cpu.trim(),memory:t.memory.trim(),ttl:t.ttl.trim(),priority_class_name:t.priority.trim(),ephemeral_storage:t.storage.trim(),tmp_size_limit:t.tmp.trim(),node_selector:Hu("Node selector",t.nodeSelector),pod_labels:Hu("Pod labels",t.labels),pod_annotations:Hu("Pod annotations",t.annotations),tolerations:zg("Tolerations",t.tolerations,!0),affinity:zg("Affinity",t.affinity,!1),ca_bundle:t.caKind?{[t.caKind]:t.caName.trim(),key:t.caKey.trim()}:{}}}const Gu="__other__";function yR({v:t,version:o,custom:s}){const a=/^v?\d+\.\d+\.\d+$/.test(o)?o.replace(/^v/,""):"";return r.jsxs(ne,{children:[t.tags.length>0?s?"A tag, a sha256: digest, or both to pin it (0.5.0@sha256:…). ":"Versions found in the image repository. ":t.tags_error?"Couldn't list the versions in the image repository ("+t.tags_error+"), so type one: a tag, a sha256: digest, or both (0.5.0@sha256:…). ":"A tag, a sha256: digest, or both to pin it (0.5.0@sha256:…). ","The console needs code-review-bot ",t.min_cli_version," or later. Now running ",r.jsx("code",{className:"break-all",children:t.image}),".",a&&r.jsxs(r.Fragment,{children:[" ",r.jsxs("a",{className:"underline underline-offset-2",href:"https://github.com/divmora/code-review-bot/releases/tag/v"+a,target:"_blank",rel:"noreferrer",children:["Release notes for ",a]})]})]})}function wR(){const t=Ze(),[o,s]=m.useState(null),[a,l]=m.useState(null),[u,d]=m.useState(!1),[h,g]=m.useState(!1),v=b=>{s(b),l(Fg(b.settings)),g(!b.tags.includes(b.settings.version))};if(m.useEffect(()=>{Ke("/admin/api/executor").then(v).catch(b=>t(Ne(b),!0))},[]),!o||!a)return r.jsx(qe,{children:"Loading…"});const w=b=>j=>l({...a,[b]:j.target.value}),x=o.type==="kubernetes",C=JSON.stringify(a)!==JSON.stringify(Fg(o.settings)),y=async()=>{let b;try{b=xR(a)}catch(j){t(Ne(j),!0);return}d(!0);try{v(await bn("/admin/api/executor",b)),t("Saved: the next review uses these settings")}catch(j){t(Ne(j),!0)}finally{d(!1)}},_=Object.entries(o.fixed);return r.jsxs("section",{className:"grid max-w-4xl gap-4",children:[r.jsxs(lt,{children:[r.jsxs(cn,{children:[r.jsxs(yn,{className:"h2 flex flex-wrap items-center gap-2",children:["Reviews run with ",vR[o.type]??o.type,!o.licensed&&r.jsx(Tt,{variant:"destructive",children:"paused: needs a license"})]}),r.jsx(wn,{children:o.type==="local"?"Each review runs the codereview binary on the console host. There is nothing to change here; switching to Docker or Kubernetes is done in the config file.":"Where reviews run and what they can reach is set in the config file (below, read-only). The settings further down are managed here and apply to the next review, without a restart."})]}),(_.length>0||o.image_repo)&&r.jsx(Pt,{children:r.jsxs("dl",{className:"grid gap-x-6 gap-y-2 text-sm sm:grid-cols-[max-content_1fr]",children:[o.image_repo&&r.jsxs(r.Fragment,{children:[r.jsx("dt",{className:"text-muted-foreground",children:"Image repository"}),r.jsx("dd",{children:r.jsx("code",{className:"text-xs break-all",children:o.image_repo})})]}),_.map(([b,j])=>r.jsxs("div",{className:"contents",children:[r.jsx("dt",{className:"text-muted-foreground",children:gR[b]??b}),r.jsx("dd",{children:b==="env"||b==="service_account"||b==="namespace"?r.jsx("code",{className:"text-xs break-all",children:j}):j})]},b))]})})]}),o.editable&&r.jsxs(lt,{children:[r.jsxs(cn,{children:[r.jsxs(yn,{className:"h2",children:["Review ",x?"pods":"containers"]}),r.jsx(wn,{children:o.source==="config"?"Not saved yet: showing the starting values; saving stores them in the console.":"Saved in the console."})]}),r.jsxs(Pt,{className:"grid gap-5",children:[r.jsxs(Ge,{children:[r.jsx(ee,{label:"Version",className:"lg:col-span-3",hint:r.jsx(yR,{v:o,version:a.version,custom:h}),children:r.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[r.jsxs("code",{className:"hidden shrink truncate text-xs text-muted-foreground sm:block",children:[o.image_repo,a.version.startsWith("sha256:")?"@":":"]}),o.tags.length>0&&r.jsxs(Re,{"aria-label":"Version",className:"w-auto min-w-36",value:h?Gu:a.version,onChange:b=>{b.target.value===Gu?g(!0):(g(!1),l({...a,version:b.target.value}))},children:[o.tags.map((b,j)=>r.jsxs("option",{value:b,children:[b,j===0?" (newest)":"",b===o.settings.version?" (current)":""]},b)),r.jsx("option",{value:Gu,children:"Other: tag or digest…"})]}),(h||o.tags.length===0)&&r.jsx(ve,{value:a.version,onChange:w("version"),placeholder:"0.5.0",spellCheck:!1,"aria-label":o.tags.length?"Other version":"Version",className:"sm:max-w-64"})]})}),r.jsx(ee,{label:"CPU",hint:r.jsxs(ne,{children:[x?"Request and limit, e.g. 500m or 1.":"docker --cpus, e.g. 1.5."," Empty = no limit."]}),children:r.jsx(ve,{value:a.cpu,onChange:w("cpu"),placeholder:x?"500m":"1"})}),r.jsx(ee,{label:"Memory",hint:r.jsxs(ne,{children:[x?"Request and limit, e.g. 1Gi.":"docker --memory, e.g. 2g."," Empty = no limit."]}),children:r.jsx(ve,{value:a.memory,onChange:w("memory"),placeholder:x?"1Gi":"2g"})}),x&&r.jsx(ee,{label:"Disk (ephemeral storage)",hint:r.jsx(ne,{children:"Request and limit for the pod's local disk, /tmp included. Empty = 2Gi; none = no limit."}),children:r.jsx(ve,{value:a.storage,onChange:w("storage"),placeholder:"2Gi"})}),x&&r.jsx(ee,{label:"/tmp size",hint:r.jsx(ne,{children:"A review writing more is evicted instead of filling the node's disk. Empty = 1Gi; none = no limit."}),children:r.jsx(ve,{value:a.tmp,onChange:w("tmp"),placeholder:"1Gi"})}),x&&r.jsx(ee,{label:"Keep finished jobs for",hint:r.jsx(ne,{children:"For debugging with kubectl, e.g. 10m or 1h."}),children:r.jsx(ve,{value:a.ttl,onChange:w("ttl"),placeholder:"10m"})})]}),x&&r.jsxs(r.Fragment,{children:[r.jsxs(Ge,{className:"lg:grid-cols-2",children:[r.jsx(ee,{label:"Node selector",hint:r.jsx(ne,{children:"One key=value per line."}),children:r.jsx(an,{rows:3,value:a.nodeSelector,onChange:w("nodeSelector"),placeholder:"workload=batch",spellCheck:!1,className:"font-mono text-xs"})}),r.jsx(ee,{label:"Priority class",hint:r.jsx(ne,{children:"An existing PriorityClass, e.g. for low-priority batch work."}),children:r.jsx(ve,{value:a.priority,onChange:w("priority"),placeholder:"batch-low"})}),r.jsx(ee,{label:"Pod labels",hint:r.jsx(ne,{children:"key=value per line. The console's own labels win on a clash."}),children:r.jsx(an,{rows:3,value:a.labels,onChange:w("labels"),placeholder:"team=platform",spellCheck:!1,className:"font-mono text-xs"})}),r.jsx(ee,{label:"Pod annotations",hint:r.jsx(ne,{children:"key=value per line, e.g. karpenter.sh/do-not-disrupt=true."}),children:r.jsx(an,{rows:3,value:a.annotations,onChange:w("annotations"),spellCheck:!1,className:"font-mono text-xs"})}),r.jsx(ee,{label:"Tolerations (JSON)",hint:r.jsx(ne,{children:"A list in the Kubernetes format."}),children:r.jsx(an,{rows:5,value:a.tolerations,onChange:w("tolerations"),placeholder:'[{"key": "spot", "operator": "Exists", "effect": "NoSchedule"}]',spellCheck:!1,className:"font-mono text-xs"})}),r.jsx(ee,{label:"Affinity (JSON)",hint:r.jsx(ne,{children:"An object in the Kubernetes format (nodeAffinity, podAntiAffinity…)."}),children:r.jsx(an,{rows:5,value:a.affinity,onChange:w("affinity"),placeholder:'{"nodeAffinity": {…}}',spellCheck:!1,className:"font-mono text-xs"})})]}),r.jsxs(Ge,{children:[r.jsx(ee,{label:"Extra CA certificates",hint:r.jsx(ne,{children:"For a code host or model endpoint behind a private CA. Trusted in addition to the system CAs."}),children:r.jsxs(Re,{value:a.caKind,onChange:w("caKind"),children:[r.jsx("option",{value:"",children:"None"}),r.jsx("option",{value:"config_map",children:"From a ConfigMap"}),r.jsx("option",{value:"secret",children:"From a Secret"})]})}),a.caKind&&r.jsxs(r.Fragment,{children:[r.jsx(ee,{label:a.caKind==="secret"?"Secret name":"ConfigMap name",hint:r.jsxs(ne,{children:["In the ",o.fixed.namespace," namespace."]}),children:r.jsx(ve,{value:a.caName,onChange:w("caName"),placeholder:"corp-ca"})}),r.jsx(ee,{label:"Key",hint:r.jsx(ne,{children:"The PEM file inside it."}),children:r.jsx(ve,{value:a.caKey,onChange:w("caKey"),placeholder:"ca.crt"})})]})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(re,{onClick:y,disabled:u||!C&&o.source==="console",children:"Save settings"}),C&&r.jsx(re,{variant:"outline",onClick:()=>v(o),children:"Discard changes"})]})]})]}),r.jsx(He,{children:"The executor type, the image repository, the cluster connection, namespace and service account stay in the config file: they decide what review jobs, which carry the code host tokens and model keys, can reach. Changing them needs a restart."})]})}const bR={"/license":"Open License","/hosts":"Open Code hosts","/webhooks":"Open Webhooks","/models":"Open Models","/settings":"Open Settings","/repositories":"Open Repositories","/reviews":"Open Reviews"};function jR(){const t=Ze(),o=bi(),[s,a]=m.useState(null),l=m.useRef(""),u=(g=!1)=>(g?Nk:Ke)("/admin/api/setup").then(v=>{a(v);const w=v.done+"/"+v.complete;l.current!==w&&(l.current!==""&&o(),l.current=w)}).catch(v=>t(Ne(v),!0));if(m.useEffect(()=>{u();const g=window.setInterval(()=>u(!0),15e3);return()=>window.clearInterval(g)},[]),!s)return r.jsx(qe,{children:"Loading…"});const d=s.steps.find(g=>!g.done&&!g.optional),h=s.total?Math.round(s.done/s.total*100):100;return r.jsxs("section",{className:"grid max-w-3xl gap-4",children:[r.jsxs(lt,{children:[r.jsxs(cn,{children:[r.jsx(yn,{className:"h2",children:s.complete?"All set":"Get your first review"}),r.jsx(wn,{children:s.complete?"Everything needed for reviews is in place. This page stays here for when you add more.":`${s.done} of ${s.total} required steps done${s.steps.some(g=>g.optional)?" (optional steps aren't counted)":""}. Each step is checked against what is configured right now.`})]}),r.jsxs(Pt,{className:"grid gap-3",children:[r.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-muted",role:"progressbar","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Setup progress",children:r.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:h+"%"}})}),r.jsx("div",{children:r.jsxs(re,{variant:"outline",size:"sm",onClick:()=>u(),children:[r.jsx(Ov,{})," Check again"]})})]})]}),r.jsx("ol",{className:"grid gap-3",children:s.steps.map((g,v)=>{const w=(d==null?void 0:d.id)===g.id;return r.jsx("li",{children:r.jsx(lt,{className:ie("gap-3 py-4",w&&"border-primary ring-1 ring-primary/40"),children:r.jsxs(Pt,{className:"flex gap-3 px-4",children:[r.jsx("div",{className:ie("mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",g.done&&g.warning?"border-warning bg-warning-soft text-warning":g.done?"border-success bg-success-soft text-success":w?"border-primary text-primary":"text-muted-foreground"),"aria-hidden":!0,children:g.done?r.jsx(hl,{className:"size-4"}):w?v+1:r.jsx(fv,{className:"size-3"})}),r.jsxs("div",{className:"grid min-w-0 flex-1 gap-1.5",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("span",{className:"font-medium",children:g.title}),g.optional&&r.jsx(Tt,{variant:"outline",className:"font-normal text-muted-foreground",children:"optional"}),w&&r.jsx(Tt,{children:"next"}),r.jsx("span",{className:"sr-only",children:g.done?"done":"not done"})]}),g.warning&&r.jsx("div",{className:"text-sm text-warning",children:g.warning}),g.detail&&r.jsx("div",{className:ie("text-sm",g.done&&!g.warning?"text-success":g.done?"text-muted-foreground":/rejected|failed|expired|not valid|won't work|not set/.test(g.detail)?"text-destructive":"text-muted-foreground"),children:g.detail}),(!g.done||w)&&r.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:g.help}),g.link&&!g.done&&r.jsx("div",{children:r.jsx(re,{asChild:!0,size:"sm",variant:w?"default":"outline",children:r.jsxs(Yt,{to:g.link,children:[bR[g.link]||"Open"," ",r.jsx(nk,{})]})})})]})]})})},g.id)})}),r.jsx(He,{children:"Steps update on their own every 15 seconds while this page is open, so you can set up the webhook on the code host and watch it turn green."})]})}const Va=[["critical","Critical","--st-fail"],["major","Major","--warning"],["minor","Minor","--sc-quality"],["nitpick","Nitpick","--st-skip"],["other","Other","--muted-foreground"]],$g=[["30d","Last 30 days"],["90d","Last 90 days"],["365d","Last 12 months"],["all","All history"]];function wo(t,o){const s=new URLSearchParams(o);return t.range!=="all"&&(s.set("from",t.from.slice(0,10)),s.set("to",new Date(new Date(t.to).getTime()-864e5).toISOString().slice(0,10))),"/reviews?"+s.toString()}function Ur({value:t,label:o,sub:s,to:a}){const l=r.jsxs(Pt,{className:"px-4",children:[r.jsx("div",{className:"text-xl font-semibold tabular-nums",children:t}),r.jsx("div",{className:"text-xs text-muted-foreground",children:o}),s&&r.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:s})]});return r.jsx(lt,{className:"tile gap-1 py-4"+(a?" transition-colors hover:border-primary/50 hover:bg-accent/40":""),children:a?r.jsx(Yt,{to:a,className:"rounded-xl focus-visible:outline-2 focus-visible:outline-ring","aria-label":`${o}: ${t} (open in Reviews)`,children:l}):l})}function rs({title:t,description:o,children:s}){return r.jsxs(lt,{className:"py-4",children:[r.jsxs(cn,{className:"px-4",children:[r.jsx(yn,{className:"h2",children:t}),o&&r.jsx(wn,{children:o})]}),r.jsx(Pt,{className:"grid gap-3 px-4",children:s})]})}function Ug({items:t}){return r.jsx("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:t.map(([o,s,a])=>r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"size-2.5 rounded-sm",ref:l=>l==null?void 0:l.style.setProperty("background",`var(${a})`)}),s]},o))})}function Bg({rows:t,unit:o,link:s}){return t.length?r.jsx(un,{children:r.jsxs(zn,{children:[r.jsx(Fn,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"Repository"}),r.jsx(je,{className:"pr-4 text-right",children:o})]})}),r.jsx($n,{children:t.map(a=>r.jsxs(ct,{children:[r.jsxs(ke,{className:"pl-4",children:[r.jsx(Yt,{to:s(a),className:"font-medium underline-offset-2 hover:underline",children:a.repo}),r.jsxs(ne,{children:[a.platform," · ",a.host]})]}),r.jsx(ke,{className:"pr-4 text-right tabular-nums",children:$e(a.count)})]},`${a.platform}|${a.host}|${a.repo}`))})]})}):r.jsx(ne,{children:"Nothing in this period."})}function Wg({rows:t}){const o=Math.max(1,...t.map(([,s])=>s));return t.some(([,s])=>s>0)?r.jsx("div",{className:"grid gap-1.5",children:t.map(([s,a,l,u])=>r.jsxs("div",{className:"grid grid-cols-[8rem_1fr_3.5rem] items-center gap-2 text-sm",children:[u&&a>0?r.jsx(Yt,{to:u,className:"truncate capitalize underline-offset-2 hover:underline",children:s}):r.jsx("span",{className:"truncate capitalize",children:s}),r.jsx("span",{className:"h-2 rounded-sm bg-muted",children:r.jsx("span",{className:"block h-2 rounded-sm",ref:d=>d&&(d.style.width=100*a/o+"%",d.style.background=`var(${l||"--primary"})`)})}),r.jsx("span",{className:"text-right text-muted-foreground tabular-nums",children:$e(a)})]},s))}):r.jsx(ne,{children:"No findings in this period."})}function kR(){var C;const t=Ze(),o=qt("metrics"),[s,a]=m.useState("30d"),[l,u]=m.useState(null);m.useEffect(()=>{u(null),Ke("/admin/api/impact?range="+s).then(u).catch(y=>t(Ne(y),!0))},[s]);const d=l?Cf({granularity:l.granularity,from:l.from,to:l.to,points:l.trend.map(y=>({bucket:y.bucket,reviews:y.reviews,...y.findings,scored:y.scored,quality_sum:y.quality_sum,security_sum:y.security_sum,maintainability_sum:y.maintainability_sum}))}):[],h=(l==null?void 0:l.range)==="all"?d.slice(Math.max(0,d.findIndex(y=>y.reviews))):d,g=l?Object.fromEntries(ln.map(([y])=>[y,us({bucket:"",...l},y)])):{},v=((C=$g.find(([y])=>y===s))==null?void 0:C[0])??"30d",w=y=>"/admin/api/impact/export?"+new URLSearchParams({range:v,format:y}).toString(),x=l?Va.filter(([y])=>l.by_severity[y]).map(([y,_])=>`${$e(l.by_severity[y])} ${_.toLowerCase()}`).join(" · "):"";return r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(lr,{children:[r.jsx(Re,{className:"w-auto","aria-label":"Period",value:s,onChange:y=>a(y.target.value),children:$g.map(([y,_])=>r.jsxs("option",{value:y,disabled:!o&&y!=="30d",children:[_,!o&&y!=="30d"?" (licensed)":""]},y))}),l&&r.jsx("span",{className:"text-sm text-muted-foreground",children:CR(l)}),r.jsx("span",{className:"flex-1"}),o&&r.jsxs(r.Fragment,{children:[r.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:r.jsx("a",{href:w("csv"),children:"Export CSV"})}),r.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:r.jsx("a",{href:w("json"),children:"Export JSON"})})]})]}),l?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"tiles grid grid-cols-2 gap-3 md:grid-cols-4",children:[r.jsx(Ur,{value:$e(l.prs_reviewed),label:"Merge requests reviewed",sub:$e(l.review_runs)+" review runs",to:wo(l,{state:"done"})}),r.jsx(Ur,{value:$e(l.findings),label:"Findings raised",sub:x||void 0,to:l.findings?wo(l,{severity:"any"}):void 0}),r.jsx(Ur,{value:$e(l.security_findings),label:"Security findings caught",sub:"before merge, in review",to:l.security_findings?wo(l,{category:"security"}):void 0}),r.jsx(Ur,{value:l.first_reviews?nd(l.median_first_review_ms):"–",label:"Median time to first review",sub:l.first_reviews?"from the webhook, "+$e(l.first_reviews)+" merge requests":void 0}),r.jsx(Ur,{value:$e(l.active_repos),label:"Active repositories"}),r.jsx(Ur,{value:$e(l.comments),label:"Comments posted"}),r.jsx(Ur,{value:l.scored?ln.map(([y])=>Math.round(g[y]||0)).join(" / "):"–",label:"Avg scores (Q / S / M)",sub:l.scored?$e(l.scored)+" scored reviews":void 0}),r.jsx(Ur,{value:"–",label:"Findings acted on",sub:"not tracked yet"})]}),o?r.jsxs(r.Fragment,{children:[r.jsxs(rs,{title:"Reviews and findings",description:`Review runs and findings per ${l.granularity}.`,children:[r.jsx(Ug,{items:[["reviews","Review runs","--st-done"]]}),r.jsx(kd,{points:h,granularity:l.granularity,series:[["reviews","Review runs","--st-done"]],label:`Review runs per ${l.granularity}`}),r.jsx(Ug,{items:Va}),r.jsx(kd,{points:h,granularity:l.granularity,series:Va,label:`Findings per ${l.granularity}, by severity`})]}),l.scored>0&&r.jsxs(rs,{title:"Average scores",description:"Dashed lines at 80 and 50 are the bands of the score labels.",children:[r.jsx(_f,{values:g}),r.jsx(Sf,{points:h,granularity:l.granularity})]}),r.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[r.jsx(rs,{title:"Findings by severity",children:r.jsx(Wg,{rows:Va.map(([y,_,b])=>[_,l.by_severity[y]||0,b,y==="other"?void 0:wo(l,{severity:y})])})}),r.jsx(rs,{title:"Findings by category",children:r.jsx(Wg,{rows:l.by_category.map(y=>[y.category||"other",y.count,void 0,y.category&&y.category!=="other"?wo(l,{category:y.category}):void 0])})}),r.jsx(rs,{title:"Top repositories by reviews",children:r.jsx(Bg,{rows:l.top_by_reviews,unit:"Review runs",link:y=>wo(l,{host:y.host||"",repo:y.repo||"",state:"done"})})}),r.jsx(rs,{title:"Top repositories by findings",children:r.jsx(Bg,{rows:l.top_by_findings,unit:"Findings",link:y=>wo(l,{host:y.host||"",repo:y.repo||"",severity:"any"})})})]})]}):r.jsx(ji,{feature:"metrics",children:"Longer periods, trends, breakdowns by repository and category, and the CSV/JSON export are part of the licensed console. The numbers above cover the last 30 days."})]}):r.jsx(qe,{children:"Loading…"}),r.jsx(He,{children:"Read from this console's own database; nothing leaves the installation. Findings are what reviews reported (questions aren't counted). Time to first review runs from the webhook to the first review's comments, including the wait after a push. Findings acted on (fixed or resolved versus dismissed) needs signals from the code host and isn't tracked yet. Periods are whole UTC days or months; reviews stored before this version are counted from their saved results."})]})}function CR(t){if(t.range==="all")return"Everything recorded (UTC)";const o=t.granularity==="month"?Mk:Ok;return o(t.from)+" – "+o(t.through)+" (UTC)"}const Mf=[{path:"setup",title:"Setup",icon:yk,el:r.jsx(jR,{})},{path:"repositories",title:"Repositories",icon:uk,el:r.jsx(N2,{})},{path:"reviews",title:"Reviews",icon:sk,el:r.jsx(O2,{})},{path:"impact",title:"Impact",icon:Sk,el:r.jsx(kR,{})},{path:"learnings",title:"Learnings",icon:rk,el:r.jsx(L2,{}),paid:"learnings"},{path:"hosts",title:"Code hosts",icon:bk,el:r.jsx(W2,{})},{path:"models",title:"Models",icon:ok,el:r.jsx(mR,{})},{path:"executor",title:"Executor",icon:lk,el:r.jsx(wR,{})},{path:"rules",title:"Rules",icon:dk,el:r.jsx(K2,{}),paid:"rules"},{path:"webhooks",title:"Webhooks",icon:Wv,el:r.jsx(Y2,{})},{path:"settings",title:"Settings",icon:kk,el:r.jsx(nR,{})},{path:"approvals",title:"Approvals",icon:ak,el:r.jsx(aR,{})},{path:"audit",title:"Audit log",icon:wk,el:r.jsx(sR,{}),paid:"audit"},{path:"license",title:"License",icon:wv,el:r.jsx(cR,{})}];function SR({me:t}){const o=t.expiry_warnings||[];if(!o.length)return null;const s=o.some(a=>a.severity==="bad");return r.jsx(Zn,{role:"status",variant:s?"destructive":"default",className:s?"banner bad":"banner border-warning/40 bg-warning-soft text-warning",children:r.jsx(er,{className:s?"":"text-warning",children:o.map(a=>r.jsxs("p",{children:[a.message," ",r.jsx(Yt,{className:"font-semibold underline underline-offset-2",to:a.kind==="license"?"/license":"/hosts",children:a.kind==="license"?"License":"Code hosts"})]},a.kind+(a.host_id||"")))})})}function _R({me:t}){const o=t.license;return t.reviews_paused?r.jsx(Zn,{role:"status",variant:"destructive",className:"banner bad",children:r.jsx(er,{children:r.jsxs("p",{children:[t.reviews_paused[0].toUpperCase()+t.reviews_paused.slice(1),"."," ",r.jsx(Yt,{className:"font-semibold underline underline-offset-2",to:"/license",children:"Add a license"})]})})}):o.state==="grace"?r.jsx(Zn,{role:"status",className:"banner border-warning/40 bg-warning-soft text-warning",children:r.jsx(er,{className:"text-warning",children:r.jsxs("p",{children:["The Divmora license expired on ",di(o.expires_at),". Paid features stop on ",di(o.grace_until),"."," ",r.jsx(Yt,{className:"font-semibold underline underline-offset-2",to:"/license",children:"Renew"})]})})}):o.state==="expired"||o.state==="invalid"?r.jsx(Zn,{role:"status",variant:"destructive",className:"banner bad",children:r.jsx(er,{children:r.jsxs("p",{children:[o.state==="expired"?"The Divmora license has expired":"The Divmora license is not valid",": paid features are off."," ",r.jsx(Yt,{className:"font-semibold underline underline-offset-2",to:"/license",children:"License"})]})})}):null}function NR(){const[t,o]=m.useState(()=>{try{return localStorage.getItem("crc-theme")||"system"}catch{return"system"}}),s=l=>{o(l);try{localStorage.setItem("crc-theme",l)}catch{}const u=window.__crcApplyTheme;u?u():document.documentElement.classList.toggle("dark",l==="dark")},a=t==="light"?Ck:t==="dark"?mk:pk;return r.jsxs(GE,{children:[r.jsx(KE,{asChild:!0,children:r.jsx(re,{variant:"ghost",size:"icon",id:"theme","aria-label":"Theme",children:r.jsx(a,{})})}),r.jsxs(qE,{align:"end",children:[r.jsx(QE,{children:"Theme"}),r.jsx(XE,{}),r.jsxs(YE,{value:t,onValueChange:s,children:[r.jsx($u,{value:"system",children:"System"}),r.jsx($u,{value:"light",children:"Light"}),r.jsx($u,{value:"dark",children:"Dark"})]})]})]})}function Pw(t){return Mf.find(o=>t.startsWith("/"+o.path))}function ER({me:t}){const o=In(),{setOpenMobile:s}=ki(),a=()=>Qt("/admin/logout").finally(()=>location.href="/admin/login");return r.jsxs(c2,{collapsible:"icon",children:[r.jsx(h2,{children:r.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[r.jsx(y2,{}),r.jsxs("div",{className:"grid leading-tight group-data-[collapsible=icon]:hidden",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:"Code review"}),r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Divmora console"})]})]})}),r.jsx(m2,{children:r.jsx(g2,{children:r.jsx(v2,{children:r.jsx(Eg,{className:"side","aria-label":"Sections",children:Mf.filter(l=>l.path!=="approvals"||t.role==="operator"||t.role==="admin"&&(t.license.features.includes("sso_rules")||!!t.pending_approvals)).map(l=>{var h;const u=l.paid&&!t.license.features.includes(l.paid),d=((h=Pw(o.pathname))==null?void 0:h.path)===l.path;return r.jsxs(Rg,{children:[r.jsx(Pg,{asChild:!0,isActive:d,tooltip:l.title,children:r.jsxs(Fj,{to:"/"+l.path,className:d?"on":"",onClick:()=>s(!1),children:[r.jsx(l.icon,{}),r.jsx("span",{children:l.title})]})}),l.path==="setup"&&t.setup&&!t.setup.complete&&r.jsx(Bu,{className:"text-[10px] font-normal text-muted-foreground",title:"Setup steps done",children:r.jsxs("span",{title:`${t.setup.done} of ${t.setup.total} required setup steps done`,children:[t.setup.done,"/",t.setup.total]})}),l.path==="approvals"&&!!t.pending_approvals&&r.jsx(Bu,{className:"text-[10px]",title:t.pending_approvals+" waiting for approval",children:t.pending_approvals}),u&&r.jsx(Bu,{className:"paid text-[10px] font-normal text-muted-foreground",title:"Needs a license",children:"licensed"})]},l.path)})})})})}),r.jsxs(p2,{children:[r.jsxs("div",{className:"grid gap-1 px-2 pb-1 text-xs text-muted-foreground group-data-[collapsible=icon]:hidden",children:[r.jsxs("span",{className:"truncate",children:["Signed in as ",t.name||t.email]}),r.jsx("a",{className:"underline-offset-2 hover:text-foreground hover:underline",href:"/admin/dashboard",children:"Status dashboard"}),t.version&&r.jsxs("span",{children:["Version ",t.version]})]}),r.jsx(Eg,{children:r.jsx(Rg,{children:r.jsxs(Pg,{id:"logout",onClick:a,tooltip:"Sign out",children:[r.jsx(fk,{}),r.jsx("span",{children:"Sign out"})]})})})]}),r.jsx(d2,{})]})}function RR(){const t=In();return r.jsxs(lt,{className:"max-w-xl",children:[r.jsxs(cn,{children:[r.jsx(yn,{className:"h2",children:"Page not found"}),r.jsxs(wn,{children:["There is no ",r.jsxs("code",{children:["/admin",t.pathname]})," page. Pick a section in the sidebar, or go to the start."]})]}),r.jsx(Pt,{children:r.jsx(re,{asChild:!0,children:r.jsx(Yt,{to:"/",children:"Go to the start"})})})]})}function PR(){const t=()=>Qt("/admin/logout").finally(()=>location.href="/admin/login");return r.jsxs(lt,{className:"max-w-xl",children:[r.jsxs(cn,{children:[r.jsx(yn,{className:"h2",children:"Sign out?"}),r.jsx(wn,{children:"You'll need to sign in again to use the admin panel."})]}),r.jsxs(Pt,{className:"flex gap-2",children:[r.jsx(re,{onClick:t,children:"Sign out"}),r.jsx(re,{asChild:!0,variant:"outline",children:r.jsx(Yt,{to:"/",children:"Stay signed in"})})]})]})}function TR({me:t}){const o=In(),s=Pw(o.pathname),a=(s==null?void 0:s.title)??(o.pathname==="/logout"?"Sign out":"Page not found");return m.useEffect(()=>{document.title=a+" · Code review admin"},[a]),r.jsxs("header",{className:"sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 border-b bg-background/80 px-4 backdrop-blur",children:[r.jsx(u2,{className:"-ml-1"}),r.jsx(ls,{orientation:"vertical",className:"mr-1 data-[orientation=vertical]:h-4"}),r.jsx("h1",{id:"pageTitle",className:"text-base font-semibold",children:a}),(s==null?void 0:s.paid)&&!t.license.features.includes(s.paid)&&r.jsx(Tt,{variant:"secondary",children:"licensed"}),r.jsx("span",{className:"flex-1"}),r.jsx(NR,{})]})}function DR(){const[t,o]=m.useState(null),[s,a]=m.useState(""),l=()=>Ke("/admin/api/me").then(u=>{_k(u.csrf),o(u)}).catch(u=>a(String(u.message||u)));return m.useEffect(()=>{l();const u=()=>l();return window.addEventListener("crc-pending",u),()=>window.removeEventListener("crc-pending",u)},[]),t?r.jsx(xw.Provider,{value:t,children:r.jsx(yw.Provider,{value:l,children:r.jsx(jw,{delayDuration:300,children:r.jsx(WE,{children:r.jsx(VE,{children:r.jsxs(l2,{children:[r.jsx(ER,{me:t}),r.jsxs(f2,{className:"min-w-0",children:[r.jsx(TR,{me:t}),r.jsxs("div",{className:"mx-auto grid w-full max-w-7xl gap-4 p-4 md:p-6",children:[r.jsx(_R,{me:t}),r.jsx(SR,{me:t}),t.role==="viewer"&&r.jsx(Zn,{role:"status",className:"banner",children:r.jsx(er,{children:"You have read-only access: you can see every page, and changes are refused. Ask an admin to change something."})}),r.jsxs(Nj,{children:[r.jsx(li,{path:"/",element:r.jsx(Sj,{to:t.setup&&!t.setup.complete?"/setup":"/repositories",replace:!0})}),Mf.map(u=>r.jsx(li,{path:"/"+u.path,element:r.jsx(jd,{name:u.title,children:u.el},u.path)},u.path)),r.jsx(li,{path:"/logout",element:r.jsx(PR,{})}),r.jsx(li,{path:"*",element:r.jsx(RR,{})})]})]})]})]})})})})})}):r.jsx("div",{className:"grid min-h-svh place-items-center text-sm text-muted-foreground",children:s||"Loading…"})}var Vg;const Ku=(Vg=document.querySelector('meta[name="csp-nonce"]'))==null?void 0:Vg.content;Ku&&!Ku.startsWith("__")&&Vj(Ku);Ib.createRoot(document.getElementById("root")).render(r.jsx(m.StrictMode,{children:r.jsx(Lj,{basename:"/admin",children:r.jsx(DR,{})})})); diff --git a/internal/admin/ui/assets/index-CkmRsLYX.css b/internal/admin/ui/assets/index-CkmRsLYX.css deleted file mode 100644 index e4fe26e..0000000 --- a/internal/admin/ui/assets/index-CkmRsLYX.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--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-ease: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}}}@layer theme{:root,:host{--font-sans:-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-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-3xl:48rem;--container-4xl:56rem;--container-7xl:80rem;--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: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xs:.125rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@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%;-moz-tab-size:4;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]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01"}code{background-color:var(--muted);padding-inline:var(--spacing);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);border-radius:.25rem;font-size:.85em}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-4{top:calc(var(--spacing) * 4)}.top-\[50\%\]{top:50%}.right-0{right:0}.right-1{right:var(--spacing)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-4{left:calc(var(--spacing) * 4)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3\.5{margin-inline:calc(var(--spacing) * 3.5)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:var(--spacing)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.h-0\.5{height:calc(var(--spacing) * .5)}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-60{max-height:calc(var(--spacing) * 60)}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-svh{min-height:100svh}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-3{width:calc(var(--spacing) * 3)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-56{max-width:calc(var(--spacing) * 56)}.max-w-60{max-width:calc(var(--spacing) * 60)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-80{max-width:calc(var(--spacing) * 80)}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-36{min-width:calc(var(--spacing) * 36)}.min-w-64{min-width:calc(var(--spacing) * 64)}.min-w-\[8rem\]{min-width:8rem}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-cols-\[8rem_1fr_3\.5rem\]{grid-template-columns:8rem 1fr 3.5rem}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.place-items-center{place-items:center}.content-start{align-content:flex-start}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-items-start{justify-items:start}.gap-0{gap:0}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[4px\]{border-radius:4px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border{border-color:var(--border)}.border-destructive\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/40{border-color:color-mix(in oklab,var(--destructive) 40%,transparent)}}.border-input{border-color:var(--input)}.border-primary,.border-primary\/60{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.border-primary\/60{border-color:color-mix(in oklab,var(--primary) 60%,transparent)}}.border-sidebar-border{border-color:var(--sidebar-border)}.border-success{border-color:var(--success)}.border-transparent{border-color:#0000}.border-warning,.border-warning\/40{border-color:var(--warning)}@supports (color:color-mix(in lab,red,red)){.border-warning\/40{border-color:color-mix(in oklab,var(--warning) 40%,transparent)}}.bg-accent{background-color:var(--accent)}.bg-background,.bg-background\/80{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/80{background-color:color-mix(in oklab,var(--background) 80%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-danger-soft{background-color:var(--danger-soft)}.bg-destructive{background-color:var(--destructive)}.bg-foreground{background-color:var(--foreground)}.bg-muted,.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-success-soft{background-color:var(--success-soft)}.bg-transparent{background-color:#0000}.bg-warning-soft{background-color:var(--warning-soft)}.fill-\[\#0F172A\]{fill:#0f172a}.fill-current{fill:currentColor}.fill-foreground{fill:var(--foreground)}.stroke-\[\#0F172A\]{stroke:#0f172a}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0{padding-block:0}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-0{padding-bottom:0}.pb-1{padding-bottom:var(--spacing)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-\[-2px\]{vertical-align:-2px}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground) 70%,transparent)}}.text-success{color:var(--success)}.text-warning{color:var(--warning)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-70{opacity:.7}.shadow-\[0_0_0_1px_var\(--sidebar-border\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--sidebar-border));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-primary\/40{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.ring-primary\/40{--tw-ring-color:color-mix(in oklab, var(--primary) 40%, transparent)}}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.fade-in{--tw-enter-opacity:0}.paused{animation-play-state:paused}.running{animation-play-state:running}.slide-in-from-bottom-2{--tw-enter-translate-y:calc(2*var(--spacing))}:is(:where(.group\/menu-item):focus-within .group-focus-within\/menu-item\:opacity-100){opacity:1}@media(hover:hover){:is(:where(.group\/menu-item):hover .group-hover\/menu-item\:opacity-100){opacity:1}}:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) .group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8){padding-right:calc(var(--spacing) * 8)}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8){margin-top:calc(var(--spacing) * -8)}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden){display:none}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:size-8\!){width:calc(var(--spacing) * 8)!important;height:calc(var(--spacing) * 8)!important}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\)){width:var(--sidebar-width-icon)}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\)\]){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing) * 4)))}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing) * 4)) + 2px)}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden){overflow:hidden}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:p-0\!){padding:0!important}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:p-2\!){padding:calc(var(--spacing) * 2)!important}:is(:where(.group)[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0){opacity:0}:is(:where(.group)[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]){right:calc(var(--sidebar-width) * -1)}:is(:where(.group)[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]){left:calc(var(--sidebar-width) * -1)}:is(:where(.group)[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0){width:0}:is(:where(.group)[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0){--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}:is(:where(.group)[data-disabled=true] .group-data-\[disabled\=true\]\:pointer-events-none){pointer-events:none}:is(:where(.group)[data-disabled=true] .group-data-\[disabled\=true\]\:opacity-50){opacity:.5}:is(:where(.group)[data-side=left] .group-data-\[side\=left\]\:-right-4){right:calc(var(--spacing) * -4)}:is(:where(.group)[data-side=left] .group-data-\[side\=left\]\:border-r){border-right-style:var(--tw-border-style);border-right-width:1px}:is(:where(.group)[data-side=right] .group-data-\[side\=right\]\:left-0){left:0}:is(:where(.group)[data-side=right] .group-data-\[side\=right\]\:rotate-180){rotate:180deg}:is(:where(.group)[data-side=right] .group-data-\[side\=right\]\:border-l){border-left-style:var(--tw-border-style);border-left-width:1px}:is(:where(.group\/alert-dialog-content)[data-size=sm] .group-data-\[size\=sm\]\/alert-dialog-content\:grid){display:grid}:is(:where(.group\/alert-dialog-content)[data-size=sm] .group-data-\[size\=sm\]\/alert-dialog-content\:grid-cols-2){grid-template-columns:repeat(2,minmax(0,1fr))}:is(:where(.group)[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg){border-radius:var(--radius)}:is(:where(.group)[data-variant=floating] .group-data-\[variant\=floating\]\:border){border-style:var(--tw-border-style);border-width:1px}:is(:where(.group)[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border){border-color:var(--sidebar-border)}:is(:where(.group)[data-variant=floating] .group-data-\[variant\=floating\]\:shadow-sm){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){:is(:where(.peer\/menu-button):hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground){color:var(--sidebar-accent-foreground)}}:is(:where(.peer):disabled~.peer-disabled\:cursor-not-allowed){cursor:not-allowed}:is(:where(.peer):disabled~.peer-disabled\:opacity-50){opacity:.5}:is(:where(.peer\/menu-button)[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground){color:var(--sidebar-accent-foreground)}:is(:where(.peer\/menu-button)[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5){top:calc(var(--spacing) * 1.5)}:is(:where(.peer\/menu-button)[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5){top:calc(var(--spacing) * 2.5)}:is(:where(.peer\/menu-button)[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1){top:var(--spacing)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}:is(:where(.group)[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full):after{content:var(--tw-content);left:100%}@media(hover:hover){.hover\:border-primary\/50:hover{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/50:hover{border-color:color-mix(in oklab,var(--primary) 50%,transparent)}}.hover\:bg-accent:hover,.hover\:bg-accent\/40:hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent\/40:hover{background-color:color-mix(in oklab,var(--accent) 40%,transparent)}}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-destructive:hover{color:var(--destructive)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_var\(--sidebar-accent\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--sidebar-accent));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(:where(.group)[data-collapsible=offcanvas] .hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset, ) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.has-data-\[slot\=alert-dialog-media\]\:grid-rows-\[auto_auto_1fr\]:has([data-slot=alert-dialog-media]){grid-template-rows:auto auto 1fr}.has-data-\[slot\=alert-dialog-media\]\:gap-x-6:has([data-slot=alert-dialog-media]){column-gap:calc(var(--spacing) * 6)}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-1\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-4[data-orientation=vertical]{height:calc(var(--spacing) * 4)}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=sm\]\:max-w-xs[data-size=sm]{max-width:var(--container-xs)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}@media(hover:hover){.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}@media(min-width:40rem){.sm\:left-auto{left:auto}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:w-52{width:calc(var(--spacing) * 52)}.sm\:w-64{width:calc(var(--spacing) * 64)}.sm\:w-80{width:calc(var(--spacing) * 80)}.sm\:max-w-3xl{max-width:var(--container-3xl)}.sm\:max-w-64{max-width:calc(var(--spacing) * 64)}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[max-content_1fr\]{grid-template-columns:max-content 1fr}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}:is(:where(.group\/alert-dialog-content)[data-size=default] .sm\:group-data-\[size\=default\]\/alert-dialog-content\:row-span-2){grid-row:span 2/span 2}:is(:where(.group\/alert-dialog-content)[data-size=default] .sm\:group-data-\[size\=default\]\/alert-dialog-content\:place-items-start){place-items:start}:is(:where(.group\/alert-dialog-content)[data-size=default] .sm\:group-data-\[size\=default\]\/alert-dialog-content\:text-left){text-align:left}:is(:where(.group\/alert-dialog-content):has([data-slot=alert-dialog-media]) :is(:where(.group\/alert-dialog-content)[data-size=default] .sm\:group-data-\[size\=default\]\/alert-dialog-content\:group-has-data-\[slot\=alert-dialog-media\]\/alert-dialog-content\:col-start-2)){grid-column-start:2}:is(:where(.group\/alert-dialog-content)[data-size=default] .sm\:group-data-\[size\=default\]\/alert-dialog-content\:has-data-\[slot\=alert-dialog-media\]\:grid-rows-\[auto_1fr\]):has([data-slot=alert-dialog-media]){grid-template-rows:auto 1fr}.data-\[size\=default\]\:sm\:max-w-lg[data-size=default]{max-width:var(--container-lg)}}@media(min-width:48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-\[1fr_minmax\(16rem\,28rem\)\]{grid-template-columns:1fr minmax(16rem,28rem)}.md\:p-6{padding:calc(var(--spacing) * 6)}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:opacity-0{opacity:0}:is(:where(.peer)[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2){margin:calc(var(--spacing) * 2)}:is(:where(.peer)[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0){margin-left:0}:is(:where(.peer)[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl){border-radius:calc(var(--radius) + 4px)}:is(:where(.peer)[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow-sm){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(:where(.peer)[data-state=collapsed]~:is(:where(.peer)[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2)){margin-left:calc(var(--spacing) * 2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media(min-width:64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:fill-\[\#1E293B\]:is(.dark *){fill:#1e293b}.dark\:stroke-\[\#334155\]:is(.dark *){stroke:#334155}@media(hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-destructive\![data-variant=destructive]>*):is(svg){color:var(--destructive)!important}:is(.\*\:\[svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-8>*):is(svg:not([class*=size-])){width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>div\]\:flex>div{display:flex}.\[\&\>div\]\:justify-between>div{justify-content:space-between}.\[\&\>div\]\:gap-3>div{gap:calc(var(--spacing) * 3)}.\[\&\>div\>span\:first-child\]\:text-muted-foreground>div>span:first-child{color:var(--muted-foreground)}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentColor}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing) * -2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing) * -2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}@media(hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary) 90%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}a.\[a\&\]\:hover\:underline:hover{text-decoration-line:underline}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(98.5% .002 286);--foreground:oklch(21% .01 286);--card:oklch(100% 0 0);--card-foreground:oklch(21% .01 286);--popover:oklch(100% 0 0);--popover-foreground:oklch(21% .01 286);--primary:oklch(51% .2 280);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(96% .005 286);--secondary-foreground:oklch(21% .01 286);--muted:oklch(96% .005 286);--muted-foreground:oklch(50% .015 286);--accent:oklch(95.5% .012 283);--accent-foreground:oklch(21% .01 286);--destructive:oklch(56% .2 27);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(91% .006 286);--input:oklch(91% .006 286);--ring:oklch(51% .2 280);--success:oklch(55% .13 152);--success-soft:oklch(95% .04 152);--warning:oklch(60% .13 70);--warning-soft:oklch(96% .05 85);--danger-soft:oklch(95% .035 27);--sidebar:oklch(100% 0 0);--sidebar-foreground:oklch(21% .01 286);--sidebar-primary:oklch(51% .2 280);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(96% .005 286);--sidebar-accent-foreground:oklch(21% .01 286);--sidebar-border:oklch(91% .006 286);--sidebar-ring:oklch(51% .2 280);--st-done:#0ca30c;--st-skip:#9a9aa6;--st-fail:#d03b3b;--sc-quality:#4f5bd5;--sc-security:#0e8a8a;--sc-maintainability:#b5621b;--grid:oklch(91% .006 286)}.dark{--background:oklch(17% .006 286);--foreground:oklch(95% .004 286);--card:oklch(20.5% .008 286);--card-foreground:oklch(95% .004 286);--popover:oklch(20.5% .008 286);--popover-foreground:oklch(95% .004 286);--primary:oklch(70% .15 283);--primary-foreground:oklch(17% .006 286);--secondary:oklch(26% .01 286);--secondary-foreground:oklch(95% .004 286);--muted:oklch(26% .01 286);--muted-foreground:oklch(70% .015 286);--accent:oklch(27% .02 283);--accent-foreground:oklch(95% .004 286);--destructive:oklch(68% .17 25);--destructive-foreground:oklch(17% .006 286);--border:oklch(30% .01 286);--input:oklch(32% .01 286);--ring:oklch(70% .15 283);--success:oklch(75% .14 152);--success-soft:oklch(30% .05 152);--warning:oklch(80% .13 80);--warning-soft:oklch(32% .05 80);--danger-soft:oklch(30% .06 27);--sidebar:oklch(19% .007 286);--sidebar-foreground:oklch(95% .004 286);--sidebar-primary:oklch(70% .15 283);--sidebar-primary-foreground:oklch(17% .006 286);--sidebar-accent:oklch(26% .01 286);--sidebar-accent-foreground:oklch(95% .004 286);--sidebar-border:oklch(30% .01 286);--sidebar-ring:oklch(70% .15 283);--st-skip:#6b6b76;--sc-quality:#9aa2ff;--sc-security:#45c9c9;--sc-maintainability:#e9a25e;--grid:oklch(30% .01 286)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} diff --git a/internal/admin/ui/assets/theme.js b/internal/admin/ui/assets/theme.js deleted file mode 100644 index bf6477d..0000000 --- a/internal/admin/ui/assets/theme.js +++ /dev/null @@ -1,15 +0,0 @@ -// Apply the saved theme before the page paints: "light", "dark", or -// "system" (default), which follows the OS and updates when it changes. -(function () { - var mq = window.matchMedia("(prefers-color-scheme: dark)"); - function choice() { - try { return localStorage.getItem("crc-theme") || "system"; } catch (e) { return "system"; } - } - function apply() { - var t = choice(); - document.documentElement.classList.toggle("dark", t === "dark" || (t === "system" && mq.matches)); - } - apply(); - mq.addEventListener("change", apply); - window.__crcApplyTheme = apply; -})(); diff --git a/internal/admin/ui/index.html b/internal/admin/ui/index.html deleted file mode 100644 index 0a633cb..0000000 --- a/internal/admin/ui/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -Code review admin - - - - - - - - - -
- - diff --git a/web/public/.keep b/web/public/.keep new file mode 100644 index 0000000..e69de29 From beec2912742d86b4b4141d6e4a6437b59506f2cf Mon Sep 17 00:00:00 2001 From: Nitin Goyal Date: Mon, 23 Nov 2026 20:44:10 +0530 Subject: [PATCH 2/3] ci: drop the Docker workflow's duplicate Go checks The org docker-publish workflow's Go quality job ran lint and tests without building the admin UI, which is no longer committed, so the admin tests failed there. ci.yml runs the same lint and tests with the UI built on every PR and push; the image build runs when the quality job is skipped. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/docker-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 42e4df4..59f2483 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -21,7 +21,9 @@ jobs: ci-cd: uses: divmora/.github/.github/workflows/docker-publish.yml@main with: - enable-go-quality: true + # Lint and tests run in ci.yml, which builds the admin UI first (it + # isn't committed); this workflow's own Go job can't, so it's off. + enable-go-quality: false go-version: '1.27' sha: ${{ inputs.sha || '' }} tag_name: ${{ inputs.tag_name || '' }} From fe38b9de9bf3a867c7421a29e537d8282fb95ace Mon Sep 17 00:00:00 2001 From: Nitin Goyal Date: Mon, 23 Nov 2026 20:52:07 +0530 Subject: [PATCH 3/3] ci: use the shared workflows' pre-build step instead of an own job Back to divmora/.github's go-ci.yml and docker-publish.yml, which now take node-version, node-cache-dependency-path and pre-build-command (divmora/.github#25): make web runs before lint and tests in both. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 38 ++++++---------------------- .github/workflows/docker-publish.yml | 8 +++--- 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1045225..4fdd7a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,34 +7,12 @@ on: branches: [ "main" ] jobs: - # Like the org's go-ci workflow, with the admin UI built first: it isn't - # committed, and the binary (and the admin tests) embed it. + # The admin UI isn't committed; the binary and the admin tests embed it, + # so it's built (and type-checked) before lint and tests. ci: - name: Code Quality & Tests - runs-on: ubuntu-latest - permissions: - contents: read - env: - # renovate: datasource=github-releases depName=golangci/golangci-lint - GOLANGCI_LINT_VERSION: v2.15.0 - steps: - - uses: actions/checkout@v7 - - uses: actions/setup-node@v4 - with: - node-version: '24' - cache: npm - cache-dependency-path: web/package-lock.json - - name: Build the admin UI (type-checks it too) - run: make web - - uses: actions/setup-go@v7 - with: - go-version: '1.27' - cache: true - - name: Run Linters - uses: golangci/golangci-lint-action@v9 - with: - version: ${{ env.GOLANGCI_LINT_VERSION }} - install-mode: goinstall - args: --timeout=5m - - name: Run Unit Tests - run: go test ./... -v + uses: divmora/.github/.github/workflows/go-ci.yml@main + with: + go-version: '1.27' + node-version: '24' + node-cache-dependency-path: web/package-lock.json + pre-build-command: make web diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 59f2483..b2175b0 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -21,9 +21,11 @@ jobs: ci-cd: uses: divmora/.github/.github/workflows/docker-publish.yml@main with: - # Lint and tests run in ci.yml, which builds the admin UI first (it - # isn't committed); this workflow's own Go job can't, so it's off. - enable-go-quality: false + enable-go-quality: true + # The admin UI isn't committed: build it before lint and tests. + node-version: '24' + node-cache-dependency-path: web/package-lock.json + pre-build-command: make web go-version: '1.27' sha: ${{ inputs.sha || '' }} tag_name: ${{ inputs.tag_name || '' }}