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..4fdd7a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,24 +7,12 @@ on: branches: [ "main" ] jobs: + # 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: 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: - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - - 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) + 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 42e4df4..b2175b0 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -22,6 +22,10 @@ jobs: uses: divmora/.github/.github/workflows/docker-publish.yml@main with: 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 || '' }} 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 04b9e8d..f12dfe9 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 4456bbe..bd7b5ac 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-CAok3XFa.js b/internal/admin/ui/assets/index-CAok3XFa.js deleted file mode 100644 index 2f3a628..0000000 --- a/internal/admin/ui/assets/index-CAok3XFa.js +++ /dev/null @@ -1,335 +0,0 @@ -var Tm=t=>{throw TypeError(t)};var Om=(t,o,s)=>o.has(t)||Tm("Cannot "+s);var kt=(t,o,s)=>(Om(t,o,"read from private field"),s?s.call(t):o.get(t)),Dm=(t,o,s)=>o.has(t)?Tm("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(t):o.set(t,s),bu=(t,o,s,a)=>(Om(t,o,"write to private field"),a?a.call(t,s):o.set(t,s),s);function L0(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 I0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ju={exports:{}},oi={},ku={exports:{}},Oe={};/** - * @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 Mm;function z0(){if(Mm)return Oe;Mm=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"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.iterator;function k(D){return D===null||typeof D!="object"?null:(D=x&&D[x]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,b={};function C(D,K,de){this.props=D,this.context=K,this.refs=b,this.updater=de||w}C.prototype.isReactComponent={},C.prototype.setState=function(D,K){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,K,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=C.prototype;function R(D,K,de){this.props=D,this.context=K,this.refs=b,this.updater=de||w}var N=R.prototype=new S;N.constructor=R,_(N,C.prototype),N.isPureReactComponent=!0;var E=Array.isArray,P=Object.prototype.hasOwnProperty,M={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function U(D,K,de){var we,L={},q=null,ve=null;if(K!=null)for(we in K.ref!==void 0&&(ve=K.ref),K.key!==void 0&&(q=""+K.key),K)P.call(K,we)&&!F.hasOwnProperty(we)&&(L[we]=K[we]);var Ce=arguments.length-2;if(Ce===1)L.children=de;else if(1>>1,K=V[D];if(0>>1;Dl(L,z))ql(ve,L)?(V[D]=ve,V[q]=z,D=q):(V[D]=L,V[we]=z,D=we);else if(ql(ve,z))V[D]=ve,V[q]=z,D=q;else break e}}return ee}function l(V,ee){var z=V.sortIndex-ee.sortIndex;return z!==0?z:V.id-ee.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 v=[],g=[],y=1,x=null,k=3,w=!1,_=!1,b=!1,C=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(V){for(var ee=s(g);ee!==null;){if(ee.callback===null)a(g);else if(ee.startTime<=V)a(g),ee.sortIndex=ee.expirationTime,o(v,ee);else break;ee=s(g)}}function E(V){if(b=!1,N(V),!_)if(s(v)!==null)_=!0,le(P);else{var ee=s(g);ee!==null&&ie(E,ee.startTime-V)}}function P(V,ee){_=!1,b&&(b=!1,S(U),U=-1),w=!0;var z=k;try{for(N(ee),x=s(v);x!==null&&(!(x.expirationTime>ee)||V&&!G());){var D=x.callback;if(typeof D=="function"){x.callback=null,k=x.priorityLevel;var K=D(x.expirationTime<=ee);ee=t.unstable_now(),typeof K=="function"?x.callback=K:x===s(v)&&a(v),N(ee)}else a(v);x=s(v)}if(x!==null)var de=!0;else{var we=s(g);we!==null&&ie(E,we.startTime-ee),de=!1}return de}finally{x=null,k=z,w=!1}}var M=!1,F=null,U=-1,Y=5,I=-1;function G(){return!(t.unstable_now()-IV||125D?(V.sortIndex=z,o(g,V),s(v)===null&&V===s(g)&&(b?(S(U),U=-1):b=!0,ie(E,z-D))):(V.sortIndex=K,o(v,V),_||w||(_=!0,le(P))),V},t.unstable_shouldYield=G,t.unstable_wrapCallback=function(V){var ee=k;return function(){var z=k;k=ee;try{return V.apply(this,arguments)}finally{k=z}}}})(_u)),_u}var Fm;function W0(){return Fm||(Fm=1,Su.exports=B0()),Su.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 $m;function V0(){if($m)return Ft;$m=1;var t=Rd(),o=W0();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"),v=Object.prototype.hasOwnProperty,g=/^[: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]*$/,y={},x={};function k(e){return v.call(x,e)?!0:v.call(y,e)?!1:g.test(e)?x[e]=!0:(y[e]=!0,!1)}function w(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"||w(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,j){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=j}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){C[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];C[n]=new b(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){C[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){C[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){C[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){C[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){C[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){C[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){C[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);C[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);C[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);C[n]=new b(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){C[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),C.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){C[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function N(e,n,i,c){var f=C.hasOwnProperty(n)?C[n]:null;(f!==null?f.type!==0:c||!(2T||f[j]!==p[T]){var O=` -`+f[j].replace(" at new "," at ");return e.displayName&&O.includes("")&&(O=O.replace("",e.displayName)),O}while(1<=j&&0<=T);break}}}finally{de=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?K(e):""}function L(e){switch(e.tag){case 5:return K(e.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("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 q(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 M:return"Portal";case Y:return"Profiler";case U:return"StrictMode";case X:return"Suspense";case H:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case G:return(e.displayName||"Context")+".Consumer";case I:return(e._context.displayName||"Context")+".Provider";case re:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return n=e.displayName||null,n!==null?n:q(e.type)||"Memo";case le:n=e._payload,e=e._init;try{return q(e(n))}catch{}}return null}function ve(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 q(n);case 8:return n===U?"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(j){c=""+j,p.call(this,j)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(j){c=""+j},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 z({},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 Wn(e,n){n=n.checked,n!=null&&N(e,"checked",n,!1)}function wt(e,n){Wn(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")?ys(e,n.type,i):n.hasOwnProperty("defaultValue")&&ys(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 ys(e,n,i){(n!=="number"||yt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var ro=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 ws(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var bs={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},$w=["Webkit","ms","Moz","O"];Object.keys(bs).forEach(function(e){$w.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),bs[n]=bs[e]})});function Gf(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||bs.hasOwnProperty(e)&&bs[e]?(""+n).trim():n+"px"}function Kf(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var c=i.indexOf("--")===0,f=Gf(i,n[i],c);i==="float"&&(i="cssFloat"),c?e.setProperty(i,f):e[i]=f}}var Uw=z({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 Dl(e,n){if(n){if(Uw[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 Ml(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 Al=null;function Ll(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Il=null,Ro=null,Po=null;function qf(e){if(e=Ws(e)){if(typeof Il!="function")throw Error(s(280));var n=e.stateNode;n&&(n=qi(n),Il(e.stateNode,e.type,n))}}function Yf(e){Ro?Po?Po.push(e):Po=[e]:Ro=e}function Qf(){if(Ro){var e=Ro,n=Po;if(Po=Ro=null,qf(e),n)for(e=0;e>>=0,e===0?32:31-(Jw(e)/Zw|0)|0}var Pi=64,Ti=4194304;function Ss(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 Oi(e,n){var i=e.pendingLanes;if(i===0)return 0;var c=0,f=e.suspendedLanes,p=e.pingedLanes,j=i&268435455;if(j!==0){var T=j&~f;T!==0?c=Ss(T):(p&=j,p!==0&&(c=Ss(p)))}else j=i&~f,j!==0?c=Ss(j):p!==0&&(c=Ss(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 _s(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-hn(n),e[n]=i}function rb(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=Ms),Ch=" ",Sh=!1;function _h(e,n){switch(e){case"keyup":return Tb.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Do=!1;function Db(e,n){switch(e){case"compositionend":return Nh(n);case"keypress":return n.which!==32?null:(Sh=!0,Ch);case"textInput":return e=n.data,e===Ch&&Sh?null:e;default:return null}}function Mb(e,n){if(Do)return e==="compositionend"||!tc&&_h(e,n)?(e=xh(),Ii=Yl=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=Mh(i)}}function Lh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Lh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Ih(){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 oc(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 Wb(e){var n=Ih(),i=e.focusedElem,c=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&Lh(i.ownerDocument.documentElement,i)){if(c!==null&&oc(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=Ah(i,p);var j=Ah(i,c);f&&j&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==j.node||e.focusOffset!==j.offset)&&(n=n.createRange(),n.setStart(f.node,f.offset),e.removeAllRanges(),p>c?(e.addRange(n),e.extend(j.node,j.offset)):(n.setEnd(j.node,j.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,Mo=null,sc=null,zs=null,ic=!1;function zh(e,n,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ic||Mo==null||Mo!==yt(c)||(c=Mo,"selectionStart"in c&&oc(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}),zs&&Is(zs,c)||(zs=c,c=Hi(sc,"onSelect"),0Fo||(e.current=xc[Fo],xc[Fo]=null,Fo--)}function $e(e,n){Fo++,xc[Fo]=e.current,e.current=n}var Nr={},St=_r(Nr),Mt=_r(!1),io=Nr;function $o(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 Zh(e,n,i){if(St.current!==Nr)throw Error(s(168));$e(St,n),$e(Mt,i)}function ep(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,ve(e)||"Unknown",f));return z({},i,c)}function Qi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Nr,io=St.current,$e(St,e),$e(Mt,Mt.current),!0}function tp(e,n,i){var c=e.stateNode;if(!c)throw Error(s(169));i?(e=ep(e,n,io),c.__reactInternalMemoizedMergedChildContext=e,We(Mt),We(St),$e(St,e)):We(Mt),$e(Mt,i)}var Hn=null,Xi=!1,yc=!1;function np(e){Hn===null?Hn=[e]:Hn.push(e)}function t0(e){Xi=!0,np(e)}function Er(){if(!yc&&Hn!==null){yc=!0;var e=0,n=Ie;try{var i=Hn;for(Ie=1;e>=j,f-=j,Gn=1<<32-hn(n)+f|i<Re?(vt=_e,_e=null):vt=_e.sibling;var Ae=Q($,_e,B[Re],ne);if(Ae===null){_e===null&&(_e=vt);break}e&&_e&&Ae.alternate===null&&n($,_e),A=p(Ae,A,Re),Se===null?ye=Ae:Se.sibling=Ae,Se=Ae,_e=vt}if(Re===B.length)return i($,_e),He&&lo($,Re),ye;if(_e===null){for(;ReRe?(vt=_e,_e=null):vt=_e.sibling;var Ir=Q($,_e,Ae.value,ne);if(Ir===null){_e===null&&(_e=vt);break}e&&_e&&Ir.alternate===null&&n($,_e),A=p(Ir,A,Re),Se===null?ye=Ir:Se.sibling=Ir,Se=Ir,_e=vt}if(Ae.done)return i($,_e),He&&lo($,Re),ye;if(_e===null){for(;!Ae.done;Re++,Ae=B.next())Ae=Z($,Ae.value,ne),Ae!==null&&(A=p(Ae,A,Re),Se===null?ye=Ae:Se.sibling=Ae,Se=Ae);return He&&lo($,Re),ye}for(_e=c($,_e);!Ae.done;Re++,Ae=B.next())Ae=ue(_e,$,Re,Ae.value,ne),Ae!==null&&(e&&Ae.alternate!==null&&_e.delete(Ae.key===null?Re:Ae.key),A=p(Ae,A,Re),Se===null?ye=Ae:Se.sibling=Ae,Se=Ae);return e&&_e.forEach(function(A0){return n($,A0)}),He&&lo($,Re),ye}function rt($,A,B,ne){if(typeof B=="object"&&B!==null&&B.type===F&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case P:e:{for(var ye=B.key,Se=A;Se!==null;){if(Se.key===ye){if(ye=B.type,ye===F){if(Se.tag===7){i($,Se.sibling),A=f(Se,B.props.children),A.return=$,$=A;break e}}else if(Se.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===le&&lp(ye)===Se.type){i($,Se.sibling),A=f(Se,B.props),A.ref=Vs($,Se,B),A.return=$,$=A;break e}i($,Se);break}else n($,Se);Se=Se.sibling}B.type===F?(A=vo(B.props.children,$.mode,ne,B.key),A.return=$,$=A):(ne=Sa(B.type,B.key,B.props,null,$.mode,ne),ne.ref=Vs($,A,B),ne.return=$,$=ne)}return j($);case M:e:{for(Se=B.key;A!==null;){if(A.key===Se)if(A.tag===4&&A.stateNode.containerInfo===B.containerInfo&&A.stateNode.implementation===B.implementation){i($,A.sibling),A=f(A,B.children||[]),A.return=$,$=A;break e}else{i($,A);break}else n($,A);A=A.sibling}A=gu(B,$.mode,ne),A.return=$,$=A}return j($);case le:return Se=B._init,rt($,A,Se(B._payload),ne)}if(ro(B))return me($,A,B,ne);if(ee(B))return ge($,A,B,ne);ta($,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,A!==null&&A.tag===6?(i($,A.sibling),A=f(A,B),A.return=$,$=A):(i($,A),A=mu(B,$.mode,ne),A.return=$,$=A),j($)):i($,A)}return rt}var Vo=cp(!0),up=cp(!1),na=_r(null),ra=null,Ho=null,Sc=null;function _c(){Sc=Ho=ra=null}function Nc(e){var n=na.current;We(na),e._currentValue=n}function Ec(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 Go(e,n){ra=e,Sc=Ho=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Lt=!0),e.firstContext=null)}function tn(e){var n=e._currentValue;if(Sc!==e)if(e={context:e,memoizedValue:n,next:null},Ho===null){if(ra===null)throw Error(s(308));Ho=e,ra.dependencies={lanes:0,firstContext:e}}else Ho=Ho.next=e;return n}var co=null;function Rc(e){co===null?co=[e]:co.push(e)}function dp(e,n,i,c){var f=n.interleaved;return f===null?(i.next=i,Rc(n)):(i.next=f.next,f.next=i),n.interleaved=i,qn(e,c)}function qn(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 Pc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fp(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 Yn(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,qn(e,i)}return f=c.interleaved,f===null?(n.next=n,Rc(c)):(n.next=f.next,f.next=n),c.interleaved=n,qn(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,Vl(e,i)}}function hp(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 j={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?f=p=j:p=p.next=j,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,j=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var O=T,W=O.next;O.next=null,j===null?p=W:j.next=W,j=O;var J=e.alternate;J!==null&&(J=J.updateQueue,T=J.lastBaseUpdate,T!==j&&(T===null?J.firstBaseUpdate=W:T.next=W,J.lastBaseUpdate=O))}if(p!==null){var Z=f.baseState;j=0,J=W=O=null,T=p;do{var Q=T.lane,ue=T.eventTime;if((c&Q)===Q){J!==null&&(J=J.next={eventTime:ue,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var me=e,ge=T;switch(Q=n,ue=i,ge.tag){case 1:if(me=ge.payload,typeof me=="function"){Z=me.call(ue,Z,Q);break e}Z=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ge.payload,Q=typeof me=="function"?me.call(ue,Z,Q):me,Q==null)break e;Z=z({},Z,Q);break e;case 2:Rr=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,Q=f.effects,Q===null?f.effects=[T]:Q.push(T))}else ue={eventTime:ue,lane:Q,tag:T.tag,payload:T.payload,callback:T.callback,next:null},J===null?(W=J=ue,O=Z):J=J.next=ue,j|=Q;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;Q=T,T=Q.next,Q.next=null,f.lastBaseUpdate=Q,f.shared.pending=null}}while(!0);if(J===null&&(O=Z),f.baseState=O,f.firstBaseUpdate=W,f.lastBaseUpdate=J,n=f.shared.interleaved,n!==null){f=n;do j|=f.lane,f=f.next;while(f!==n)}else p===null&&(f.shared.lanes=0);ho|=j,e.lanes=j,e.memoizedState=Z}}function pp(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;ni?i:4,e(!0);var c=Ac.transition;Ac.transition={};try{e(!1),n()}finally{Ie=i,Ac.transition=c}}function Dp(){return nn().memoizedState}function s0(e,n,i){var c=Mr(e);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},Mp(e))Ap(n,i);else if(i=dp(e,n,i,c),i!==null){var f=Dt();yn(i,e,c,f),Lp(i,n,c)}}function i0(e,n,i){var c=Mr(e),f={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(Mp(e))Ap(n,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var j=n.lastRenderedState,T=p(j,i);if(f.hasEagerState=!0,f.eagerState=T,pn(T,j)){var O=n.interleaved;O===null?(f.next=f,Rc(n)):(f.next=O.next,O.next=f),n.interleaved=f;return}}catch{}finally{}i=dp(e,n,f,c),i!==null&&(f=Dt(),yn(i,e,c,f),Lp(i,n,c))}}function Mp(e){var n=e.alternate;return e===Xe||n!==null&&n===Xe}function Ap(e,n){qs=la=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Lp(e,n,i){if((i&4194240)!==0){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Vl(e,i)}}var da={readContext:tn,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},a0={readContext:tn,useCallback:function(e,n){return Nn().memoizedState=[e,n===void 0?null:n],e},useContext:tn,useEffect:Sp,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,ca(4194308,4,Ep.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=s0.bind(null,Xe,e),[c.memoizedState,e]},useRef:function(e){var n=Nn();return e={current:e},n.memoizedState=e},useState:kp,useDebugValue:Bc,useDeferredValue:function(e){return Nn().memoizedState=e},useTransition:function(){var e=kp(!1),n=e[0];return e=o0.bind(null,e[1]),Nn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var c=Xe,f=Nn();if(He){if(i===void 0)throw Error(s(407));i=i()}else{if(i=n(),gt===null)throw Error(s(349));(fo&30)!==0||xp(c,n,i)}f.memoizedState=i;var p={value:i,getSnapshot:n};return f.queue=p,Sp(wp.bind(null,c,p,e),[e]),c.flags|=2048,Xs(9,yp.bind(null,c,p,i,n),void 0,null),i},useId:function(){var e=Nn(),n=gt.identifierPrefix;if(He){var i=Kn,c=Gn;i=(c&~(1<<32-hn(c)-1)).toString(32)+i,n=":"+n+"R"+i,i=Ys++,0<\/script>",e=e.removeChild(e.firstChild)):typeof c.is=="string"?e=j.createElement(i,{is:c.is}):(e=j.createElement(i),i==="select"&&(j=e,c.multiple?j.multiple=!0:c.size&&(j.size=c.size))):e=j.createElementNS(e,i),e[Sn]=n,e[Bs]=c,nm(e,n,!1,!1),n.stateNode=e;e:{switch(j=Ml(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;fXo&&(n.flags|=128,c=!0,Js(p,!1),n.lanes=4194304)}else{if(!c)if(e=ia(j),e!==null){if(n.flags|=128,c=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),Js(p,!0),p.tail===null&&p.tailMode==="hidden"&&!j.alternate&&!He)return Nt(n),null}else 2*nt()-p.renderingStartTime>Xo&&i!==1073741824&&(n.flags|=128,c=!0,Js(p,!1),n.lanes=4194304);p.isBackwards?(j.sibling=n.child,n.child=j):(i=p.last,i!==null?i.sibling=j:n.child=j,p.last=j)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=nt(),n.sibling=null,i=Qe.current,$e(Qe,c?i&1|2:i&1),n):(Nt(n),null);case 22:case 23:return fu(),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 m0(e,n){switch(bc(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 Ko(),We(Mt),We(St),Mc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Oc(n),null;case 13:if(We(Qe),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Wo()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return We(Qe),null;case 4:return Ko(),null;case 10:return Nc(n.type._context),null;case 22:case 23:return fu(),null;case 24:return null;default:return null}}var ma=!1,Et=!1,g0=typeof WeakSet=="function"?WeakSet:Set,he=null;function Yo(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(c){tt(e,n,c)}else i.current=null}function eu(e,n,i){try{i()}catch(c){tt(e,n,c)}}var sm=!1;function v0(e,n){if(fc=Ai,e=Ih(),oc(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 j=0,T=-1,O=-1,W=0,J=0,Z=e,Q=null;t:for(;;){for(var ue;Z!==i||f!==0&&Z.nodeType!==3||(T=j+f),Z!==p||c!==0&&Z.nodeType!==3||(O=j+c),Z.nodeType===3&&(j+=Z.nodeValue.length),(ue=Z.firstChild)!==null;)Q=Z,Z=ue;for(;;){if(Z===e)break t;if(Q===i&&++W===f&&(T=j),Q===p&&++J===c&&(O=j),(ue=Z.nextSibling)!==null)break;Z=Q,Q=Z.parentNode}Z=ue}i=T===-1||O===-1?null:{start:T,end:O}}else i=null}i=i||{start:0,end:0}}else i=null;for(hc={focusedElem:e,selectionRange:i},Ai=!1,he=n;he!==null;)if(n=he,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,he=e;else for(;he!==null;){n=he;try{var me=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(me!==null){var ge=me.memoizedProps,rt=me.memoizedState,$=n.stateNode,A=$.getSnapshotBeforeUpdate(n.elementType===n.type?ge:gn(n.type,ge),rt);$.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var B=n.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ne){tt(n,n.return,ne)}if(e=n.sibling,e!==null){e.return=n.return,he=e;break}he=n.return}return me=sm,sm=!1,me}function Zs(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&&eu(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 tu(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 im(e){var n=e.alternate;n!==null&&(e.alternate=null,im(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Sn],delete n[Bs],delete n[vc],delete n[Zb],delete n[e0])),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 am(e){return e.tag===5||e.tag===3||e.tag===4}function lm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||am(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 nu(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(nu(e,n,i),e=e.sibling;e!==null;)nu(e,n,i),e=e.sibling}function ru(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(ru(e,n,i),e=e.sibling;e!==null;)ru(e,n,i),e=e.sibling}var bt=null,vn=!1;function Tr(e,n,i){for(i=i.child;i!==null;)cm(e,n,i),i=i.sibling}function cm(e,n,i){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(Ri,i)}catch{}switch(i.tag){case 5:Et||Yo(i,n);case 6:var c=bt,f=vn;bt=null,Tr(e,n,i),bt=c,vn=f,bt!==null&&(vn?(e=bt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):bt.removeChild(i.stateNode));break;case 18:bt!==null&&(vn?(e=bt,i=i.stateNode,e.nodeType===8?gc(e.parentNode,i):e.nodeType===1&&gc(e,i),Ts(e)):gc(bt,i.stateNode));break;case 4:c=bt,f=vn,bt=i.stateNode.containerInfo,vn=!0,Tr(e,n,i),bt=c,vn=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,j=p.destroy;p=p.tag,j!==void 0&&((p&2)!==0||(p&4)!==0)&&eu(i,n,j),f=f.next}while(f!==c)}Tr(e,n,i);break;case 1:if(!Et&&(Yo(i,n),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(T){tt(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 um(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new g0),n.forEach(function(c){var f=_0.bind(null,e,c);i.has(c)||(i.add(c),c.then(f,f))})}}function xn(e,n){var i=n.deletions;if(i!==null)for(var c=0;cf&&(f=j),c&=~p}if(c=f,c=nt()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*y0(c/1960))-c,10e?16:e,Dr===null)var c=!1;else{if(e=Dr,Dr=null,ba=0,(Me&6)!==0)throw Error(s(331));var f=Me;for(Me|=4,he=e.current;he!==null;){var p=he,j=p.child;if((he.flags&16)!==0){var T=p.deletions;if(T!==null){for(var O=0;Ont()-iu?mo(e,0):su|=i),zt(e,n)}function km(e,n){n===0&&((e.mode&1)===0?n=1:(n=Ti,Ti<<=1,(Ti&130023424)===0&&(Ti=4194304)));var i=Dt();e=qn(e,n),e!==null&&(_s(e,n,i),zt(e,i))}function S0(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),km(e,i)}function _0(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),km(e,i)}var Cm;Cm=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,h0(e,n,i);Lt=(e.flags&131072)!==0}else Lt=!1,He&&(n.flags&1048576)!==0&&rp(n,Zi,n.index);switch(n.lanes=0,n.tag){case 2:var c=n.type;pa(e,n),e=n.pendingProps;var f=$o(n,St.current);Go(n,i),f=Ic(null,n,c,e,f,i);var p=zc();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,Pc(n),f.updater=fa,n.stateNode=f,f._reactInternals=n,Vc(n,c,e,i),n=qc(null,n,c,!0,p,i)):(n.tag=0,He&&p&&wc(n),Ot(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=E0(c),e=gn(c,e),f){case 0:n=Kc(null,n,c,e,i);break e;case 1:n=Qp(null,n,c,e,i);break e;case 11:n=Hp(null,n,c,e,i);break e;case 14:n=Gp(null,n,c,gn(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:gn(c,f),Kc(e,n,c,f,i);case 1:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:gn(c,f),Qp(e,n,c,f,i);case 3:e:{if(Xp(n),e===null)throw Error(s(387));c=n.pendingProps,p=n.memoizedState,f=p.element,fp(e,n),sa(n,c,null,i);var j=n.memoizedState;if(c=j.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:j.cache,pendingSuspenseBoundaries:j.pendingSuspenseBoundaries,transitions:j.transitions},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){f=qo(Error(s(423)),n),n=Jp(e,n,c,i,f);break e}else if(c!==f){f=qo(Error(s(424)),n),n=Jp(e,n,c,i,f);break e}else for(Ht=Sr(n.stateNode.containerInfo.firstChild),Vt=n,He=!0,mn=null,i=up(n,null,c,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Wo(),c===f){n=Qn(e,n,i);break e}Ot(e,n,c,i)}n=n.child}return n;case 5:return mp(n),e===null&&kc(n),c=n.type,f=n.pendingProps,p=e!==null?e.memoizedProps:null,j=f.children,pc(c,f)?j=null:p!==null&&pc(c,p)&&(n.flags|=32),Yp(e,n),Ot(e,n,j,i),n.child;case 6:return e===null&&kc(n),null;case 13:return Zp(e,n,i);case 4:return Tc(n,n.stateNode.containerInfo),c=n.pendingProps,e===null?n.child=Vo(n,null,c,i):Ot(e,n,c,i),n.child;case 11:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:gn(c,f),Hp(e,n,c,f,i);case 7:return Ot(e,n,n.pendingProps,i),n.child;case 8:return Ot(e,n,n.pendingProps.children,i),n.child;case 12:return Ot(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(c=n.type._context,f=n.pendingProps,p=n.memoizedProps,j=f.value,$e(na,c._currentValue),c._currentValue=j,p!==null)if(pn(p.value,j)){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){j=p.child;for(var O=T.firstContext;O!==null;){if(O.context===c){if(p.tag===1){O=Yn(-1,i&-i),O.tag=2;var W=p.updateQueue;if(W!==null){W=W.shared;var J=W.pending;J===null?O.next=O:(O.next=J.next,J.next=O),W.pending=O}}p.lanes|=i,O=p.alternate,O!==null&&(O.lanes|=i),Ec(p.return,i,n),T.lanes|=i;break}O=O.next}}else if(p.tag===10)j=p.type===n.type?null:p.child;else if(p.tag===18){if(j=p.return,j===null)throw Error(s(341));j.lanes|=i,T=j.alternate,T!==null&&(T.lanes|=i),Ec(j,i,n),j=p.sibling}else j=p.child;if(j!==null)j.return=p;else for(j=p;j!==null;){if(j===n){j=null;break}if(p=j.sibling,p!==null){p.return=j.return,j=p;break}j=j.return}p=j}Ot(e,n,f.children,i),n=n.child}return n;case 9:return f=n.type,c=n.pendingProps.children,Go(n,i),f=tn(f),c=c(f),n.flags|=1,Ot(e,n,c,i),n.child;case 14:return c=n.type,f=gn(c,n.pendingProps),f=gn(c.type,f),Gp(e,n,c,f,i);case 15:return Kp(e,n,n.type,n.pendingProps,i);case 17:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:gn(c,f),pa(e,n),n.tag=1,At(c)?(e=!0,Qi(n)):e=!1,Go(n,i),zp(n,c,f),Vc(n,c,f,i),qc(null,n,c,!0,e,i);case 19:return tm(e,n,i);case 22:return qp(e,n,i)}throw Error(s(156,n.tag))};function Sm(e,n){return oh(e,n)}function N0(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 on(e,n,i,c){return new N0(e,n,i,c)}function pu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function E0(e){if(typeof e=="function")return pu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===re)return 11;if(e===ce)return 14}return 2}function Lr(e,n){var i=e.alternate;return i===null?(i=on(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 j=2;if(c=e,typeof e=="function")pu(e)&&(j=1);else if(typeof e=="string")j=5;else e:switch(e){case F:return vo(i.children,f,p,n);case U:j=8,f|=8;break;case Y:return e=on(12,i,n,f|2),e.elementType=Y,e.lanes=p,e;case X:return e=on(13,i,n,f),e.elementType=X,e.lanes=p,e;case H:return e=on(19,i,n,f),e.elementType=H,e.lanes=p,e;case ie:return _a(i,f,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:j=10;break e;case G:j=9;break e;case re:j=11;break e;case ce:j=14;break e;case le:j=16,c=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return n=on(j,i,n,f),n.elementType=e,n.type=c,n.lanes=p,n}function vo(e,n,i,c){return e=on(7,e,c,n),e.lanes=i,e}function _a(e,n,i,c){return e=on(22,e,c,n),e.elementType=ie,e.lanes=i,e.stateNode={isHidden:!1},e}function mu(e,n,i){return e=on(6,e,null,n),e.lanes=i,e}function gu(e,n,i){return n=on(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function R0(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=Wl(0),this.expirationTimes=Wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wl(0),this.identifierPrefix=c,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function vu(e,n,i,c,f,p,j,T,O){return e=new R0(e,n,i,T,O),n===1?(n=1,p===!0&&(n|=8)):n=0,p=on(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:c,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pc(p),e}function P0(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(),Cu.exports=V0(),Cu.exports}var Bm;function H0(){if(Bm)return Da;Bm=1;var t=ev();return Da.createRoot=t.createRoot,Da.hydrateRoot=t.hydrateRoot,Da}var G0=H0(),Pd=ev();/** - * @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 tv(t,o){if(!t){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function q0(){return Math.random().toString(36).substr(2,8)}function Vm(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"?fs(o):o,{state:s,key:o&&o.key||a||q0()})}function Za(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 fs(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 Y0(t,o,s,a){a===void 0&&(a={});let{window:l=document.defaultView,v5Compat:u=!1}=a,d=l.history,h=Wr.Pop,v=null,g=y();g==null&&(g=0,d.replaceState(ci({},d.state,{idx:g}),""));function y(){return(d.state||{idx:null}).idx}function x(){h=Wr.Pop;let C=y(),S=C==null?null:C-g;g=C,v&&v({action:h,location:b.location,delta:S})}function k(C,S){h=Wr.Push;let R=Qu(b.location,C,S);g=y()+1;let N=Vm(R,g),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&&v&&v({action:h,location:b.location,delta:1})}function w(C,S){h=Wr.Replace;let R=Qu(b.location,C,S);g=y();let N=Vm(R,g),E=b.createHref(R);d.replaceState(N,"",E),u&&v&&v({action:h,location:b.location,delta:0})}function _(C){let S=l.location.origin!=="null"?l.location.origin:l.location.href,R=typeof C=="string"?C:Za(C);return R=R.replace(/ $/,"%20"),Ze(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(C){if(v)throw new Error("A history only accepts one active listener");return l.addEventListener(Wm,x),v=C,()=>{l.removeEventListener(Wm,x),v=null}},createHref(C){return o(l,C)},createURL:_,encodeLocation(C){let S=_(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:k,replace:w,go(C){return d.go(C)}};return b}var Hm;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Hm||(Hm={}));function Q0(t,o,s){return s===void 0&&(s="/"),X0(t,o,s)}function X0(t,o,s,a){let l=typeof o=="string"?fs(o):o,u=us(l.pathname||"/",s);if(u==null)return null;let d=nv(t);J0(d);let h=null;for(let v=0;h==null&&v{let v={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};v.relativePath.startsWith("/")&&(Ze(v.relativePath.startsWith(a),'Absolute route path "'+v.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),v.relativePath=v.relativePath.slice(a.length));let g=Vr([a,v.relativePath]),y=s.concat(v);u.children&&u.children.length>0&&(Ze(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),nv(u.children,o,y,g)),!(u.path==null&&!u.index)&&o.push({path:g,score:sj(g,u.index),routesMeta:y})};return t.forEach((u,d)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))l(u,d);else for(let v of rv(u.path))l(u,d,v)}),o}function rv(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=rv(a.join("/")),h=[];return h.push(...d.map(v=>v===""?u:[u,v].join("/"))),l&&h.push(...d),h.map(v=>t.startsWith("/")&&v===""?"/":v)}function J0(t){t.sort((o,s)=>o.score!==s.score?s.score-o.score:ij(o.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}const Z0=/^:[\w-]+$/,ej=3,tj=2,nj=1,rj=10,oj=-2,Gm=t=>t==="*";function sj(t,o){let s=t.split("/"),a=s.length;return s.some(Gm)&&(a+=oj),o&&(a+=tj),s.filter(l=>!Gm(l)).reduce((l,u)=>l+(Z0.test(u)?ej:u===""?nj:rj),a)}function ij(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 aj(t,o,s){let{routesMeta:a}=t,l={},u="/",d=[];for(let h=0;h{let{paramName:k,isOptional:w}=y;if(k==="*"){let b=h[x]||"";d=u.slice(0,u.length-b.length).replace(/(.)\/+$/,"$1")}const _=h[x];return w&&!_?g[k]=void 0:g[k]=(_||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:t}}function lj(t,o,s){o===void 0&&(o=!1),s===void 0&&(s=!0),tv(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,v)=>(a.push({paramName:h,isOptional:v!=null}),v?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(a.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,o?void 0:"i"),a]}function cj(t){try{return t.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return tv(!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 us(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 uj(t,o){o===void 0&&(o="/");let{pathname:s,search:a="",hash:l=""}=typeof t=="string"?fs(t):t;return{pathname:s?s.startsWith("/")?s:dj(s,o):o,search:pj(a),hash:mj(l)}}function dj(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 Nu(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 fj(t){return t.filter((o,s)=>s===0||o.route.path&&o.route.path.length>0)}function Td(t,o){let s=fj(t);return o?s.map((a,l)=>l===s.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function Od(t,o,s,a){a===void 0&&(a=!1);let l;typeof t=="string"?l=fs(t):(l=ci({},t),Ze(!l.pathname||!l.pathname.includes("?"),Nu("?","pathname","search",l)),Ze(!l.pathname||!l.pathname.includes("#"),Nu("#","pathname","hash",l)),Ze(!l.search||!l.search.includes("#"),Nu("#","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 k=d.split("/");for(;k[0]==="..";)k.shift(),x-=1;l.pathname=k.join("/")}h=x>=0?o[x]:"/"}let v=uj(l,h),g=d&&d!=="/"&&d.endsWith("/"),y=(u||d===".")&&s.endsWith("/");return!v.pathname.endsWith("/")&&(g||y)&&(v.pathname+="/"),v}const Vr=t=>t.join("/").replace(/\/\/+/g,"/"),hj=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),pj=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,mj=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function gj(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const ov=["post","put","patch","delete"];new Set(ov);const vj=["get",...ov];new Set(vj);/** - * 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(g,y){if(y===void 0&&(y={}),!h.current)return;if(typeof g=="number"){a.go(g);return}let x=Od(g,JSON.parse(d),u,y.relative==="path");t==null&&o!=="/"&&(x.pathname=x.pathname==="/"?o:Vr([o,x.pathname])),(y.replace?a.replace:a.push)(x,y.state,y)},[o,a,d,u,t])}function pl(t,o){let{relative:s}=o===void 0?{}:o,{future:a}=m.useContext(cr),{matches:l}=m.useContext(Jr),{pathname:u}=Fn(),d=JSON.stringify(Td(l,a.v7_relativeSplatPath));return m.useMemo(()=>Od(t,JSON.parse(d),u,s==="path"),[t,d,u,s])}function wj(t,o){return bj(t,o)}function bj(t,o,s,a){hs()||Ze(!1);let{navigator:l}=m.useContext(cr),{matches:u}=m.useContext(Jr),d=u[u.length-1],h=d?d.params:{};d&&d.pathname;let v=d?d.pathnameBase:"/";d&&d.route;let g=Fn(),y;if(o){var x;let C=typeof o=="string"?fs(o):o;v==="/"||(x=C.pathname)!=null&&x.startsWith(v)||Ze(!1),y=C}else y=g;let k=y.pathname||"/",w=k;if(v!=="/"){let C=v.replace(/^\//,"").split("/");w="/"+k.replace(/^\//,"").split("/").slice(C.length).join("/")}let _=Q0(t,{pathname:w}),b=_j(_&&_.map(C=>Object.assign({},C,{params:Object.assign({},h,C.params),pathname:Vr([v,l.encodeLocation?l.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?v:Vr([v,l.encodeLocation?l.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),u,s,a);return o&&b?m.createElement(hl.Provider,{value:{location:ui({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:Wr.Pop}},b):b}function jj(){let t=Pj(),o=gj(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 kj=m.createElement(jj,null);class Cj 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(Jr.Provider,{value:this.props.routeContext},m.createElement(iv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Sj(t){let{routeContext:o,match:s,children:a}=t,l=m.useContext(fl);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),m.createElement(Jr.Provider,{value:o},a)}function _j(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 y=d.findIndex(x=>x.route.id&&(h==null?void 0:h[x.route.id])!==void 0);y>=0||Ze(!1),d=d.slice(0,Math.min(d.length,y+1))}let v=!1,g=-1;if(s&&a&&a.v7_partialHydration)for(let y=0;y=0?d=d.slice(0,g+1):d=[d[0]];break}}}return d.reduceRight((y,x,k)=>{let w,_=!1,b=null,C=null;s&&(w=h&&x.route.id?h[x.route.id]:void 0,b=x.route.errorElement||kj,v&&(g<0&&k===0?(Oj("route-fallback"),_=!0,C=null):g===k&&(_=!0,C=x.route.hydrateFallbackElement||null)));let S=o.concat(d.slice(0,k+1)),R=()=>{let N;return w?N=b:_?N=C:x.route.Component?N=m.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=y,m.createElement(Sj,{match:x,routeContext:{outlet:y,matches:S,isDataRoute:s!=null},children:N})};return s&&(x.route.ErrorBoundary||x.route.errorElement||k===0)?m.createElement(Cj,{location:s.location,revalidation:s.revalidation,component:b,error:w,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):R()},null)}var lv=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(lv||{}),cv=(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})(cv||{});function Nj(t){let o=m.useContext(fl);return o||Ze(!1),o}function Ej(t){let o=m.useContext(sv);return o||Ze(!1),o}function Rj(t){let o=m.useContext(Jr);return o||Ze(!1),o}function uv(t){let o=Rj(),s=o.matches[o.matches.length-1];return s.route.id||Ze(!1),s.route.id}function Pj(){var t;let o=m.useContext(iv),s=Ej(),a=uv();return o!==void 0?o:(t=s.errors)==null?void 0:t[a]}function Tj(){let{router:t}=Nj(lv.UseNavigateStable),o=uv(cv.UseNavigateStable),s=m.useRef(!1);return av(()=>{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 Km={};function Oj(t,o,s){Km[t]||(Km[t]=!0)}function Dj(t,o){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function qm(t){let{to:o,replace:s,state:a,relative:l}=t;hs()||Ze(!1);let{future:u,static:d}=m.useContext(cr),{matches:h}=m.useContext(Jr),{pathname:v}=Fn(),g=Dd(),y=Od(o,Td(h,u.v7_relativeSplatPath),v,l==="path"),x=JSON.stringify(y);return m.useEffect(()=>g(JSON.parse(x),{replace:s,state:a,relative:l}),[g,x,l,s,a]),null}function bo(t){Ze(!1)}function Mj(t){let{basename:o="/",children:s=null,location:a,navigationType:l=Wr.Pop,navigator:u,static:d=!1,future:h}=t;hs()&&Ze(!1);let v=o.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:v,navigator:u,static:d,future:ui({v7_relativeSplatPath:!1},h)}),[v,h,u,d]);typeof a=="string"&&(a=fs(a));let{pathname:y="/",search:x="",hash:k="",state:w=null,key:_="default"}=a,b=m.useMemo(()=>{let C=us(y,v);return C==null?null:{location:{pathname:C,search:x,hash:k,state:w,key:_},navigationType:l}},[v,y,x,k,w,_,l]);return b==null?null:m.createElement(cr.Provider,{value:g},m.createElement(hl.Provider,{children:s,value:b}))}function Aj(t){let{children:o,location:s}=t;return wj(Ju(o),s)}new Promise(()=>{});function Ju(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,Ju(a.props.children,u));return}a.type!==bo&&Ze(!1),!a.props.index||!a.props.children||Ze(!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=Ju(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 el(){return el=Object.assign?Object.assign.bind():function(t){for(var o=1;o=0)&&(s[l]=t[l]);return s}function Lj(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Ij(t,o){return t.button===0&&(!o||o==="_self")&&!Lj(t)}function Zu(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 zj(t,o){let s=Zu(t);return o&&o.forEach((a,l)=>{s.has(l)||o.getAll(l).forEach(u=>{s.append(l,u)})}),s}const Fj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],$j=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Uj="6";try{window.__reactRouterVersion=Uj}catch{}const Bj=m.createContext({isTransitioning:!1}),Wj="startTransition",Ym=Xr[Wj];function Vj(t){let{basename:o,children:s,future:a,window:l}=t,u=m.useRef();u.current==null&&(u.current=K0({window:l,v5Compat:!0}));let d=u.current,[h,v]=m.useState({action:d.action,location:d.location}),{v7_startTransition:g}=a||{},y=m.useCallback(x=>{g&&Ym?Ym(()=>v(x)):v(x)},[v,g]);return m.useLayoutEffect(()=>d.listen(y),[d,y]),m.useEffect(()=>Dj(a),[a]),m.createElement(Mj,{basename:o,children:s,location:h.location,navigationType:h.action,navigator:d,future:a})}const Hj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yt=m.forwardRef(function(o,s){let{onClick:a,relative:l,reloadDocument:u,replace:d,state:h,target:v,to:g,preventScrollReset:y,viewTransition:x}=o,k=dv(o,Fj),{basename:w}=m.useContext(cr),_,b=!1;if(typeof g=="string"&&Gj.test(g)&&(_=g,Hj))try{let N=new URL(window.location.href),E=g.startsWith("//")?new URL(N.protocol+g):new URL(g),P=us(E.pathname,w);E.origin===N.origin&&P!=null?g=P+E.search+E.hash:b=!0}catch{}let C=xj(g,{relative:l}),S=Yj(g,{replace:d,state:h,target:v,preventScrollReset:y,relative:l,viewTransition:x});function R(N){a&&a(N),N.defaultPrevented||S(N)}return m.createElement("a",el({},k,{href:_||C,onClick:b||u?a:R,ref:s,target:v}))}),Kj=m.forwardRef(function(o,s){let{"aria-current":a="page",caseSensitive:l=!1,className:u="",end:d=!1,style:h,to:v,viewTransition:g,children:y}=o,x=dv(o,$j),k=pl(v,{relative:x.relative}),w=Fn(),_=m.useContext(sv),{navigator:b,basename:C}=m.useContext(cr),S=_!=null&&Xj(k)&&g===!0,R=b.encodeLocation?b.encodeLocation(k).pathname:k.pathname,N=w.pathname,E=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;l||(N=N.toLowerCase(),E=E?E.toLowerCase():null,R=R.toLowerCase()),E&&C&&(E=us(E,C)||E);const P=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let M=N===R||!d&&N.startsWith(R)&&N.charAt(P)==="/",F=E!=null&&(E===R||!d&&E.startsWith(R)&&E.charAt(R.length)==="/"),U={isActive:M,isPending:F,isTransitioning:S},Y=M?a:void 0,I;typeof u=="function"?I=u(U):I=[u,M?"active":null,F?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let G=typeof h=="function"?h(U):h;return m.createElement(Yt,el({},x,{"aria-current":Y,className:I,ref:s,style:G,to:v,viewTransition:g}),typeof y=="function"?y(U):y)});var ed;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(ed||(ed={}));var Qm;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Qm||(Qm={}));function qj(t){let o=m.useContext(fl);return o||Ze(!1),o}function Yj(t,o){let{target:s,replace:a,state:l,preventScrollReset:u,relative:d,viewTransition:h}=o===void 0?{}:o,v=Dd(),g=Fn(),y=pl(t,{relative:d});return m.useCallback(x=>{if(Ij(x,s)){x.preventDefault();let k=a!==void 0?a:Za(g)===Za(y);v(t,{replace:k,state:l,preventScrollReset:u,relative:d,viewTransition:h})}},[g,v,y,a,l,s,t,u,d,h])}function Qj(t){let o=m.useRef(Zu(t)),s=m.useRef(!1),a=Fn(),l=m.useMemo(()=>zj(a.search,s.current?null:o.current),[a.search]),u=Dd(),d=m.useCallback((h,v)=>{const g=Zu(typeof h=="function"?h(l):h);s.current=!0,u("?"+g,v)},[u,l]);return[l,d]}function Xj(t,o){o===void 0&&(o={});let s=m.useContext(Bj);s==null&&Ze(!1);let{basename:a}=qj(ed.useViewTransitionState),l=pl(t,{relative:o.relative});if(!s.isTransitioning)return!1;let u=us(s.currentLocation.pathname,a)||s.currentLocation.pathname,d=us(s.nextLocation.pathname,a)||s.nextLocation.pathname;return Xu(l.pathname,d)!=null||Xu(l.pathname,u)!=null}var td,Jj=function(t){td=t},Zj=function(){if(td)return td;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 ek=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 tk(t,o,s=[]){if(o==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ek(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 nk=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 rk=t=>{const o=nk(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 nd=(...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 xo={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 Eu(t){return t!=null}function ok(t,o={}){var k,w;const s=o.attributeNames??{},a=_=>s[_]??_,l=t.size??t.width??xo.width,u=t.size??t.height??xo.height,d=((k=t.aliases)==null?void 0:k.filter(_=>typeof _=="string"&&_.trim()!=="").map(_=>`lucide-${_}`))??[],h=[...t.name?[`lucide-${t.name}`]:[],...d],v=((w=o.className)==null?void 0:w.split(" ").filter(Boolean))??[],g=o.includeDefaultClasses===!1?nd(...v):nd("lucide",...h,...v),y=o.absoluteStrokeWidth?Number(o.strokeWidth??xo["stroke-width"])*Number(t.size??t.width??xo.width)/Number(o.size??o.width??xo.width):o.strokeWidth??xo["stroke-width"];return["svg",{...Object.entries(xo).reduce((_,[b,C])=>(_[a(b)]=C,_),{}),..."color"in o&&o.color&&{[a("stroke")]:o.color},..."size"in o&&Eu(o.size)&&{[a("width")]:o.size,[a("height")]:o.size},..."width"in o&&Eu(o.width)&&{[a("width")]:o.width},..."height"in o&&Eu(o.height)&&{[a("height")]:o.height},[a("stroke-width")]:y,...g&&{[a("class")]:g},[a("viewBox")]:`0 0 ${l} ${u}`,...o.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in o&&o.attributes},t.node.map(_=>{const[b,C,S]=_,R=o.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...C}:C;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 sk(t,o={}){return ok(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 ik=t=>{for(const o in t)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},ak=m.createContext({}),lk=()=>m.useContext(ak),ck=m.forwardRef(({color:t,size:o,width:s,height:a,strokeWidth:l,absoluteStrokeWidth:u,nonScalingStroke:d,className:h="",children:v,iconNode:g=[],icon:y={node:g,aliases:[],size:24},...x},k)=>{const{size:w=24,strokeWidth:_=2,absoluteStrokeWidth:b=!1,nonScalingStroke:C=!1,color:S="currentColor",className:R=""}=lk()??{},N=!!v||ik(x),[E,P,M=[]]=sk(y,{color:t??S,width:s??o??w,height:a??o??w,strokeWidth:l??_,absoluteStrokeWidth:u??b,nonScalingStroke:d??C,className:nd(R,h),hasA11yProp:N,attributes:x});return m.createElement(E,{ref:k,...P},[...M.map(([F,U])=>m.createElement(F,U)),...Array.isArray(v)?v:[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. - */function De(t,o=[],s=[]){const a=typeof t=="string"?tk(t,o,s):t,l=m.forwardRef(({className:u,...d},h)=>m.createElement(ck,{ref:h,icon:a,className:u,...d}));return a.name&&(l.displayName=rk(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 fv={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};fv.node;const uk=De(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 hv={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"}]]};hv.node;const dk=De(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:"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"}]]};pv.node;const fk=De(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:"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"]};mv.node;const hk=De(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:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};gv.node;const ml=De(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 vv={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"]};vv.node;const pk=De(vv);/** - * @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:"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"]};xv.node;const yv=De(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 wv={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};wv.node;const bv=De(wv);/** - * @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:"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"}]]};jv.node;const mk=De(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 kv={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"}]]};kv.node;const gk=De(kv);/** - * @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:"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"}]]};Cv.node;const vk=De(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:"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"}]]};Sv.node;const _v=De(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 Nv={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"}]]};Nv.node;const xk=De(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:"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"}]]};Ev.node;const Rv=De(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 Pv={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"}]]};Pv.node;const yk=De(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:"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"}]]};Tv.node;const Ov=De(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:"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"}]]};Dv.node;const wk=De(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:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};Mv.node;const bk=De(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:"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"}]]};Av.node;const jk=De(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:"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"}]]};Lv.node;const kk=De(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:"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"]};Iv.node;const Ck=De(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:"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"}]]};zv.node;const Sk=De(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:"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"}]]};Fv.node;const _k=De(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:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};$v.node;const ps=De($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:"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"}]]};Uv.node;const Bv=De(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 Wv={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"}]]};Wv.node;const Nk=De(Wv);/** - * @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:"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"}]]};Vv.node;const Ek=De(Vv);/** - * @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:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};Hv.node;const gl=De(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 Gv={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"}]]};Gv.node;const Rk=De(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 Kv={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"}]]};Kv.node;const Pk=De(Kv);/** - * @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 qv={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"}]]};qv.node;const Tk=De(qv);/** - * @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:"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"}]]};Yv.node;const Ok=De(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 Qv={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"}]]};Qv.node;const Dk=De(Qv);/** - * @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:"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"}]]};Xv.node;const Jv=De(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 Zv={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Zv.node;const Md=De(Zv);function ex(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;otypeof t=="boolean"?`${t}`:t===0?"0":t,Jm=tx,vl=(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(g=>{const y=s==null?void 0:s[g],x=u==null?void 0:u[g];if(y===null)return null;const k=Xm(y)||Xm(x);return l[g][k]}),h=s&&Object.entries(s).reduce((g,y)=>{let[x,k]=y;return k===void 0||(g[x]=k),g},{}),v=o==null||(a=o.compoundVariants)===null||a===void 0?void 0:a.reduce((g,y)=>{let{class:x,className:k,...w}=y;return Object.entries(w).every(_=>{let[b,C]=_;return Array.isArray(C)?C.includes({...u,...h}[b]):{...u,...h}[b]===C})?[...g,x,k]:g},[]);return Jm(t,d,v,s==null?void 0:s.class,s==null?void 0:s.className)},Mk=(t,o)=>{const s=new Array(t.length+o.length);for(let a=0;a({classGroupId:t,validator:o}),nx=(t=new Map,o=null,s)=>({nextPart:t,validators:o,classGroupId:s}),tl="-",Zm=[],Lk="arbitrary..",Ik=t=>{const o=Fk(t),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return zk(d);const h=d.split(tl),v=h[0]===""&&h.length>1?1:0;return rx(h,v,o)},getConflictingClassGroupIds:(d,h)=>{if(h){const v=a[d],g=s[d];return v?g?Mk(g,v):v:g||Zm}return s[d]||Zm}}},rx=(t,o,s)=>{if(t.length-o===0)return s.classGroupId;const l=t[o],u=s.nextPart.get(l);if(u){const g=rx(t,o+1,u);if(g)return g}const d=s.validators;if(d===null)return;const h=o===0?t.join(tl):t.slice(o).join(tl),v=d.length;for(let g=0;gt.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=t.slice(1,-1),s=o.indexOf(":"),a=o.slice(0,s);return a?Lk+a:void 0})(),Fk=t=>{const{theme:o,classGroups:s}=t;return $k(s,o)},$k=(t,o)=>{const s=nx();for(const a in t){const l=t[a];Ad(l,s,a,o)}return s},Ad=(t,o,s,a)=>{const l=t.length;for(let u=0;u{if(typeof t=="string"){Bk(t,o,s);return}if(typeof t=="function"){Wk(t,o,s,a);return}Vk(t,o,s,a)},Bk=(t,o,s)=>{const a=t===""?o:ox(o,t);a.classGroupId=s},Wk=(t,o,s,a)=>{if(Hk(t)){Ad(t(a),o,s,a);return}o.validators===null&&(o.validators=[]),o.validators.push(Ak(s,t))},Vk=(t,o,s,a)=>{const l=Object.entries(t),u=l.length;for(let d=0;d{let s=t;const a=o.split(tl),l=a.length;for(let u=0;u"isThemeGetter"in t&&t.isThemeGetter===!0,Gk=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="!",eg=":",Kk=[],tg=(t,o,s,a,l)=>({modifiers:t,hasImportantModifier:o,baseClassName:s,maybePostfixModifierPosition:a,isExternal:l}),qk=t=>{const{prefix:o,experimentalParseClassName:s}=t;let a=l=>{const u=[];let d=0,h=0,v=0,g;const y=l.length;for(let b=0;bv?g-v:void 0;return tg(u,w,k,_)};if(o){const l=o+eg,u=a;a=d=>d.startsWith(l)?u(d.slice(l.length)):tg(Kk,!1,d,void 0,!0)}if(s){const l=a;a=u=>s({className:u,parseClassName:l})}return a},Yk=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}},Qk=t=>({cache:Gk(t.cacheSize),parseClassName:qk(t),sortModifiers:Yk(t),postfixLookupClassGroupIds:Xk(t),...Ik(t)}),Xk=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=[],v=t.trim().split(Jk);let g="";for(let y=v.length-1;y>=0;y-=1){const x=v[y],{isExternal:k,modifiers:w,hasImportantModifier:_,baseClassName:b,maybePostfixModifierPosition:C}=s(x);if(k){g=x+(g.length>0?" "+g:g);continue}let S=!!C,R;if(S){const F=b.substring(0,C);R=a(F);const U=R&&d[R]?a(b):void 0;U&&U!==R&&(R=U,S=!1)}else R=a(b);if(!R){if(!S){g=x+(g.length>0?" "+g:g);continue}if(R=a(b),!R){g=x+(g.length>0?" "+g:g);continue}S=!1}const N=w.length===0?"":w.length===1?w[0]:u(w).join(":"),E=_?N+rd:N,P=E+R;if(h.indexOf(P)>-1)continue;h.push(P);const M=l(R,S);for(let F=0;F0?" "+g:g)}return g},e1=(...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=v=>{const g=o.reduce((y,x)=>x(y),t());return s=Qk(g),a=s.cache.get,l=s.cache.set,u=h,h(v)},h=v=>{const g=a(v);if(g)return g;const y=Zk(v,s);return l(v,y),y};return u=d,(...v)=>u(e1(...v))},n1=[],ht=t=>{const o=s=>s[t]||n1;return o.isThemeGetter=!0,o.themeKey=t,o},ix=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ax=/^\((?:(\w[\w-]*):)?(.+)\)$/i,r1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,o1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s1=/\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$/,i1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,a1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,l1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zr=t=>r1.test(t),Te=t=>!!t&&!Number.isNaN(Number(t)),Rn=t=>!!t&&Number.isInteger(Number(t)),Ru=t=>t.endsWith("%")&&Te(t.slice(0,-1)),Jn=t=>o1.test(t),lx=()=>!0,c1=t=>s1.test(t)&&!i1.test(t),Ld=()=>!1,u1=t=>a1.test(t),d1=t=>l1.test(t),f1=t=>!fe(t)&&!pe(t),h1=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)),p1=t=>Zr(t,dx,Ld),fe=t=>ix.test(t),yo=t=>Zr(t,fx,c1),ng=t=>Zr(t,j1,Te),m1=t=>Zr(t,px,lx),g1=t=>Zr(t,hx,Ld),rg=t=>Zr(t,cx,Ld),v1=t=>Zr(t,ux,d1),Ma=t=>Zr(t,mx,u1),pe=t=>ax.test(t),si=t=>So(t,fx),x1=t=>So(t,hx),og=t=>So(t,cx),y1=t=>So(t,dx),w1=t=>So(t,ux),Aa=t=>So(t,mx,!0),b1=t=>So(t,px,!0),Zr=(t,o,s)=>{const a=ix.exec(t);return a?a[1]?o(a[1]):s(a[2]):!1},So=(t,o,s=!1)=>{const a=ax.exec(t);return a?a[1]?o(a[1]):s:!1},cx=t=>t==="position"||t==="percentage",ux=t=>t==="image"||t==="url",dx=t=>t==="length"||t==="size"||t==="bg-size",fx=t=>t==="length",j1=t=>t==="number",hx=t=>t==="family-name",px=t=>t==="number"||t==="weight",mx=t=>t==="shadow",k1=()=>{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"),v=ht("spacing"),g=ht("radius"),y=ht("shadow"),x=ht("inset-shadow"),k=ht("text-shadow"),w=ht("drop-shadow"),_=ht("blur"),b=ht("perspective"),C=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(),pe,fe],M=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],U=()=>[pe,fe,v],Y=()=>[zr,"full","auto",...U()],I=()=>[Rn,"none","subgrid",pe,fe],G=()=>["auto",{span:["full",Rn,pe,fe]},Rn,pe,fe],re=()=>[Rn,"auto",pe,fe],X=()=>["auto","min","max","fr",pe,fe],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],le=()=>["auto",...U()],ie=()=>[zr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],V=()=>[h,zr,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ee=()=>[zr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],z=()=>[t,pe,fe],D=()=>[...E(),og,rg,{position:[pe,fe]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",y1,p1,{size:[pe,fe]}],we=()=>[Ru,si,yo],L=()=>["","none","full",g,pe,fe],q=()=>["",Te,si,yo],ve=()=>["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,Ru,og,rg],Ye=()=>["","none",_,pe,fe],Ct=()=>["none",Te,pe,fe],Bt=()=>["none",Te,pe,fe],yt=()=>[Te,pe,fe],ut=()=>[zr,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jn],breakpoint:[Jn],color:[lx],container:[Jn],"drop-shadow":[Jn],ease:["in","out","in-out"],font:[f1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jn],shadow:[Jn],spacing:["px",Te],text:[Jn],"text-shadow":[Jn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zr,fe,pe,C]}],container:["container"],"container-type":[{"@container":["","normal","size",pe,fe]}],"container-named":[h1],columns:[{columns:[Te,"auto",fe,pe,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:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[Rn,"auto",pe,fe]}],basis:[{basis:[zr,"full","auto",h,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,zr,"auto","initial","none",fe]}],grow:[{grow:["",Te,pe,fe]}],shrink:[{shrink:["",Te,pe,fe]}],order:[{order:[Rn,"first","last","none",pe,fe]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:le()}],mx:[{mx:le()}],my:[{my:le()}],ms:[{ms:le()}],me:[{me:le()}],mbs:[{mbs:le()}],mbe:[{mbe:le()}],mt:[{mt:le()}],mr:[{mr:le()}],mb:[{mb:le()}],ml:[{ml:le()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ie()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[h,"screen",...ie()]}],"min-w":[{"min-w":[h,"screen","none",...ie()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...ie()]}],h:[{h:["screen","lh",...ie()]}],"min-h":[{"min-h":["screen","lh","none",...ie()]}],"max-h":[{"max-h":["screen","lh","none",...ie()]}],"font-size":[{text:["base",s,si,yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,b1,m1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ru,fe]}],"font-family":[{font:[x1,g1,o]}],"font-features":[{"font-features":[fe]}],"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,pe,fe]}],"line-clamp":[{"line-clamp":[Te,"none",pe,ng]}],leading:[{leading:["none",u,...U()]}],"list-image":[{"list-image":["none",pe,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",pe,yo]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Te,"auto",pe,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[Rn,pe,fe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,fe]}],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",pe,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Rn,pe,fe],radial:["",pe,fe],conic:["",Rn,pe,fe]},w1,v1]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:we()}],"gradient-via-pos":[{via:we()}],"gradient-to-pos":[{to:we()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,pe,fe]}],"outline-w":[{outline:["",Te,si,yo]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","inner","none",y,Aa,Ma]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",x,Aa,Ma]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Te,yo]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",k,Aa,Ma]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Te,pe,fe]}],"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":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"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":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"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":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"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":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"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":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"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":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"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":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[pe,fe]}],"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":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,fe]}],filter:[{filter:["","none",pe,fe]}],blur:[{blur:Ye()}],brightness:[{brightness:[Te,pe,fe]}],contrast:[{contrast:[Te,pe,fe]}],"drop-shadow":[{"drop-shadow":["","none",w,Aa,Ma]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Te,pe,fe]}],"hue-rotate":[{"hue-rotate":[Te,pe,fe]}],invert:[{invert:["",Te,pe,fe]}],saturate:[{saturate:[Te,pe,fe]}],sepia:[{sepia:["",Te,pe,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,fe]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[Te,pe,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Te,pe,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,pe,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,pe,fe]}],"backdrop-invert":[{"backdrop-invert":["",Te,pe,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Te,pe,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Te,pe,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,pe,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",pe,fe]}],ease:[{ease:["linear","initial",S,pe,fe]}],delay:[{delay:[Te,pe,fe]}],animate:[{animate:["none",R,pe,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,pe,fe]}],"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:[pe,fe,"","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,pe,fe]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",pe,fe]}],"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":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",pe,fe]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Te,si,yo,ng]}],stroke:[{stroke:["none",...z()]}],"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"]}},C1=t1(k1);function ae(...t){return C1(tx(t))}var S1=Object.defineProperty,Id=(t,o)=>S1(t,"name",{value:o,configurable:!0});function od(t,o){if(typeof t=="function")return t(o);t!=null&&(t.current=o)}Id(od,"setRef");function gx(...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;l_1(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 v=[];l=kx(l),m.Children.forEach(l,k=>{var w;if(bx(k)){h=!0;const _=k;let b="child"in _.props?_.props.child:_.props.children;for(;Fd(b)&&typeof nl=="function";)b=nl(b._payload);d=N1(_,b),v.push((w=d==null?void 0:d.props)==null?void 0:w.children)}else v.push(k)}),d?d=m.cloneElement(d,void 0,v):!h&&m.Children.count(l)===1&&m.isValidElement(l)&&(d=l);const g=d?wx(d):void 0,y=Fe(a,g);if(!d){if(l||l===0)throw new Error(h?P1(t):R1(t));return l}const x=yx(u,d.props??{});return d.type!==m.Fragment&&(x.ref=a?y:g),m.cloneElement(d,x)});return o.displayName=`${t}.Slot`,o}Jt(or,"createSlot");var zd=or("Slot"),vx=Symbol.for("radix.slottable");function xx(t){const o=Jt(s=>"child"in s?s.children(s.child):s.children,"Slottable");return o.displayName=`${t}.Slottable`,o.__radixId=vx,o}Jt(xx,"createSlottable");var N1=Jt((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 yx(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 v=u(...h);return l(...h),v}:l&&(s[a]=l):a==="style"?s[a]={...l,...u}:a==="className"?s[a]=[l,u].filter(Boolean).join(" "):a==="aria-describedby"&&(s[a]=Cx(u,l))}return{...t,...s}}Jt(yx,"mergeProps");function wx(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)}Jt(wx,"getElementRef");function bx(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===vx}Jt(bx,"isSlottable");var E1=Symbol.for("react.lazy");function Fd(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===E1&&"_payload"in t&&jx(t._payload)}Jt(Fd,"isLazyComponent");function jx(t){return typeof t=="object"&&t!==null&&"then"in t}Jt(jx,"isPromiseLike");function kx(t){let o=t;for(;Fd(o)&&typeof nl=="function";)o=nl(o._payload);return o}Jt(kx,"useUnwrappedLazy");function Cx(...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}Jt(Cx,"concatAriaDescribedby");var R1=Jt(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),P1=Jt(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),nl=Xr[" use ".trim().toString()],T1=Object.defineProperty,O1=(t,o)=>T1(t,"name",{value:o,configurable:!0}),D1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=D1.reduce((t,o)=>{const s=or(`Primitive.${o}`),a=m.forwardRef((l,u)=>{const{asChild:d,...h}=l,v=d?s:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(v,{...h,ref:u})});return a.displayName=`Primitive.${o}`,{...t,[o]:a}},{});function $d(t,o){t&&Pd.flushSync(()=>t.dispatchEvent(o))}O1($d,"dispatchDiscreteCustomEvent");var M1=Object.defineProperty,A1=(t,o)=>M1(t,"name",{value:o,configurable:!0}),L1=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"}),I1=m.forwardRef(A1(function(o,s){return r.jsx(Ue.span,{...o,ref:s,style:{...L1,...o.style}})},"VisuallyHidden")),z1=Object.defineProperty,sn=(t,o)=>z1(t,"name",{value:o,configurable:!0});function F1(t,o){const s=m.createContext(o);s.displayName=t+"Context";const a=sn(u=>{const{children:d,...h}=u,v=m.useMemo(()=>h,Object.values(h));return r.jsx(s.Provider,{value:v,children:d})},"Provider");a.displayName=t+"Provider";function l(u,d={}){const{optional:h=!1}=d,v=m.useContext(s);if(v)return v;if(o!==void 0)return o;if(!h)throw new Error(`\`${u}\` must be used within \`${t}\``)}return sn(l,"useContext"),[a,l]}sn(F1,"createContext");function bn(t,o=[]){let s=[];function a(u,d){const h=m.createContext(d);h.displayName=u+"Context";const v=s.length;s=[...s,d];const g=sn(x=>{var S;const{scope:k,children:w,..._}=x,b=((S=k==null?void 0:k[t])==null?void 0:S[v])||h,C=m.useMemo(()=>_,Object.values(_));return r.jsx(b.Provider,{value:C,children:w})},"Provider");g.displayName=u+"Provider";function y(x,k,w={}){var S;const{optional:_=!1}=w,b=((S=k==null?void 0:k[t])==null?void 0:S[v])||h,C=m.useContext(b);if(C)return C;if(d!==void 0)return d;if(!_)throw new Error(`\`${x}\` must be used within \`${u}\``)}return sn(y,"useContext"),[g,y]}sn(a,"createContext");const l=sn(()=>{const u=s.map(d=>m.createContext(d));return sn(function(h){const v=(h==null?void 0:h[t])||u;return m.useMemo(()=>({[`__scope${t}`]:{...h,[t]:v}}),[h,v])},"useScope")},"createScope");return l.scopeName=t,[a,Sx(l,...o)]}sn(bn,"createContextScope");function Sx(...t){const o=t[0];if(t.length===1)return o;const s=sn(()=>{const a=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return sn(function(u){const d=a.reduce((h,{useScope:v,scopeName:g})=>{const x=v(u)[`__scope${g}`];return{...h,...x}},{});return m.useMemo(()=>({[`__scope${o.scopeName}`]:d}),[d])},"useComposedScopes")},"createScope");return s.scopeName=o.scopeName,s}sn(Sx,"composeContextScopes");var Rt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},$1=Object.defineProperty,pt=(t,o)=>$1(t,"name",{value:o,configurable:!0});function Ud(t){const o=t+"CollectionProvider",[s,a]=bn(o),[l,u]=s(o,{collectionRef:{current:null},itemMap:new Map}),d=pt(b=>{const{scope:C,children:S}=b,R=m.useRef(null),N=m.useRef(new Map).current;return r.jsx(l,{scope:C,itemMap:N,collectionRef:R,children:S})},"CollectionProvider");d.displayName=o;const h=t+"CollectionSlot",v=or(h),g=m.forwardRef((b,C)=>{const{scope:S,children:R}=b,N=u(h,S),E=Fe(C,N.collectionRef);return r.jsx(v,{ref:E,children:R})});g.displayName=h;const y=t+"CollectionItemSlot",x="data-radix-collection-item",k=or(y),w=m.forwardRef((b,C)=>{const{scope:S,children:R,...N}=b,E=m.useRef(null),P=Fe(C,E),M=u(y,S);return m.useEffect(()=>(M.itemMap.set(E,{ref:E,...N}),()=>void M.itemMap.delete(E))),r.jsx(k,{[x]:"",ref:P,children:R})});w.displayName=y;function _(b){const C=u(t+"CollectionConsumer",b);return m.useCallback(()=>{const R=C.collectionRef.current;if(!R)return[];const N=Array.from(R.querySelectorAll(`[${x}]`));return Array.from(C.itemMap.values()).sort((M,F)=>N.indexOf(M.ref.current)-N.indexOf(F.ref.current))},[C.collectionRef,C.itemMap])}return pt(_,"useCollection"),[{Provider:d,Slot:g,ItemSlot:w},_,a]}pt(Ud,"createCollection");var sg=new WeakMap,ot,Kt,La=(Kt=class extends Map{constructor(s){super(s);Dm(this,ot);bu(this,ot,[...super.keys()]),sg.set(this,!0)}set(s,a){return sg.get(this)&&!this.has(s)&&kt(this,ot).push(s),super.set(s,a),this}insert(s,a,l){const u=this.has(a),d=u?this.size:this.size+1,h=Bd(s),v=h>=0?Math.min(h,d-1):Math.max(d+h,0);if(u?kt(this,ot).indexOf(a)===v:v===this.size)return this.set(a,l),this;const g=kt(this,ot).filter(x=>x!==a);g.splice(v,0,a);const y=g.map(x=>[x,x===a?l:this.get(x)]);this.clear();for(const[x,k]of y)this.set(x,k);return this}with(s,a,l){const u=new Kt(this);return u.insert(s,a,l),u}before(s){const a=kt(this,ot).indexOf(s)-1;if(!(a<0))return this.entryAt(a)}setBefore(s,a,l){const u=kt(this,ot).indexOf(s);if(u===-1)return this;const d=kt(this,ot).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 v of this)d===0&&!u?h=v:h=Reflect.apply(a,this,[h,v,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 v=this.entryAt(h);h===this.size-1&&!u?d=v:d=Reflect.apply(a,this,[d,v,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,ot).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}},ot=new WeakMap,pt(Kt,"OrderedDict"),Kt);function Ga(t,o){if("at"in Array.prototype)return Array.prototype.at.call(t,o);const s=_x(t,o);return s===-1?void 0:t[s]}pt(Ga,"at");function _x(t,o){const s=t.length,a=Bd(o),l=a>=0?a:s+a;return l<0||l>=s?-1:l}pt(_x,"toSafeIndex");function Bd(t){return t!==t||t===0?0:Math.trunc(t)}pt(Bd,"toSafeInteger");function U1(t){const o=t+"CollectionProvider",[s,a]=bn(o),[l,u]=s(o);l.displayName=t+"CollectionStableContextProvider";const[d,h]=s(o);d.displayName=t+"CollectionStatefulContextProvider";const v=pt(({state:M,...F})=>M?r.jsx(y,{...F,state:M}):r.jsx(g,{...F}),"CollectionProvider");v.displayName=o;const g=pt(M=>{const F=R();return r.jsx(y,{...M,state:F})},"CollectionInit");g.displayName=t+"CollectionInit";const y=pt(M=>{const{scope:F,children:U,state:Y}=M,I=m.useRef(null),[G,re]=m.useState(null),X=Fe(I,re),[H,ce]=Y,le=m.useRef(new La),ie=m.useCallback(()=>{const V=le.current;return Rx(V)||V.sort(Ka),V},[]);return m.useEffect(()=>{if(!G)return;const V=Px(()=>{ce(ee=>{const z=ee.toSorted(Ka);return z.some(([K],de)=>ee.keyAt(de)!==K)?z:ee})});return V.observe(G,{childList:!0,subtree:!0}),()=>{V.disconnect()}},[G,ce]),r.jsx(l,{scope:F,collectionElementRef:X,collectionElementRefObject:I,getCollection:ie,setCollection:ce,registryRef:le,children:r.jsx(d,{scope:F,collectionElement:G,collection:H,children:U})})},"CollectionProviderImpl");y.displayName=t+"CollectionProviderImpl";const x=t+"CollectionSlot",k=or(x),w=m.forwardRef((M,F)=>{const{scope:U,children:Y}=M,I=u(x,U),G=Fe(F,I.collectionElementRef);return r.jsx(k,{ref:G,children:Y})});w.displayName=x;const _=t+"CollectionItemSlot",b="data-radix-collection-item",C=or(_),S=m.forwardRef((M,F)=>{const{scope:U,children:Y,...I}=M,G=m.useRef(null),re=u(_,U),{setCollection:X,registryRef:H}=re,ce=m.useRef(I);Nx(ce.current,I)||(ce.current=I);const le=ce.current,ie=m.useCallback(z=>{const D=H.current;z?D.set(z,{...ce.current,element:z}):G.current&&D.delete(G.current)},[H]),V=Fe(F,ie,G);Rt(()=>{const z=G.current,D=H.current;z&&D.has(z)&&D.set(z,{...le,element:z})},[le,H]);const ee=m.useRef(null);return m.useEffect(()=>{const z=G.current,D=ee.current;((D==null?void 0:D.element)??null)===z&&(!z||(D==null?void 0:D.itemData)===le)||(ee.current=z?{element:z,itemData:le}:null,X(K=>{const de=new La(K);return D&&D.element!==z&&de.delete(D.element),z&&de.set(z,{...le,element:z}),de.sort(Ka)}))}),m.useEffect(()=>()=>{const z=ee.current;ee.current=null,z&&X(D=>{if(!D.has(z.element))return D;const K=new La(D);return K.delete(z.element),K})},[X]),r.jsx(C,{[b]:"",ref:V,children:Y})});S.displayName=_;function R(){return m.useState(new La)}pt(R,"useInitCollection");function N(M){const{collection:F}=h(t+"CollectionConsumer",M);return F}pt(N,"useCollection");function E(M){const{getCollection:F}=u(t+"CollectionConsumer",M);return F}return pt(E,"useGetCollection"),[{Provider:v,Slot:w,ItemSlot:S},{createCollectionScope:a,useCollection:N,useGetCollection:E,useInitCollection:R}]}pt(U1,"createCollection");function Nx(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(Nx,"shallowEqual");function Ex(t,o){return!!(o.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}pt(Ex,"isElementPreceding");function Rx(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(Rx,"isInDocumentOrder");function Ka(t,o){return!t[1].element||!o[1].element?0:Ex(t[1].element,o[1].element)?-1:1}pt(Ka,"sortByDocumentPosition");function Px(t){return new MutationObserver(s=>{for(const a of s)if(a.type==="childList"){t();return}})}pt(Px,"getChildListObserver");var B1=Object.defineProperty,ms=(t,o)=>B1(t,"name",{value:o,configurable:!0}),Tx=!!(typeof window<"u"&&window.document&&window.document.createElement);function Pe(t,o,{checkForDefaultPrevented:s=!0}={}){return ms(function(l){if(t==null||t(l),s===!1||!l||!l.defaultPrevented)return o==null?void 0:o(l)},"handleEvent")}ms(Pe,"composeEventHandlers");function W1(t){var o;if(!Tx)throw new Error("Cannot access window outside of the DOM");return((o=t==null?void 0:t.ownerDocument)==null?void 0:o.defaultView)??window}ms(W1,"getOwnerWindow");function sd(t){if(!Tx)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}ms(sd,"getOwnerDocument");function Ox(t,o=!1){const{activeElement:s}=sd(t);if(!(s!=null&&s.nodeName))return null;if(Dx(s)&&s.contentDocument)return Ox(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}ms(Ox,"getActiveElement");function Dx(t){return t.tagName==="IFRAME"}ms(Dx,"isFrame");var V1=Object.defineProperty,H1=(t,o)=>V1(t,"name",{value:o,configurable:!0}),ig=Xr[" useEffectEvent ".trim().toString()],ag=Xr[" useInsertionEffect ".trim().toString()];function Mx(t){if(typeof ig=="function")return ig(t);const o=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof ag=="function"?ag(()=>{o.current=t}):Rt(()=>{o.current=t}),m.useMemo(()=>((...s)=>{var a;return(a=o.current)==null?void 0:a.call(o,...s)}),[])}H1(Mx,"useEffectEvent");var G1=Object.defineProperty,gi=(t,o)=>G1(t,"name",{value:o,configurable:!0}),K1=Xr[" useInsertionEffect ".trim().toString()]||Rt;function gs({prop:t,defaultProp:o,onChange:s=gi(()=>{},"onChange"),caller:a}){const[l,u,d]=Ax({defaultProp:o,onChange:s}),h=t!==void 0,v=h?t:l,g=m.useCallback(y=>{var x;if(h){const k=Lx(y)?y(t):y;k!==t&&((x=d.current)==null||x.call(d,k))}else u(y)},[h,t,u,d]);return[v,g]}gi(gs,"useControllableState");function Ax({defaultProp:t,onChange:o}){const[s,a]=m.useState(t),l=m.useRef(s),u=m.useRef(o);return K1(()=>{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]}gi(Ax,"useUncontrolledState");function Lx(t){return typeof t=="function"}gi(Lx,"isFunction");var lg=Symbol("RADIX:SYNC_STATE");function q1(t,o,s,a){const{prop:l,defaultProp:u,onChange:d,caller:h}=o,v=l!==void 0,g=Mx(d),y=[{...s,state:u}];a&&y.push(a);const[x,k]=m.useReducer((C,S)=>{if(S.type===lg)return{...C,state:S.state};const R=t(C,S);return v&&!Object.is(R.state,C.state)&&g(R.state),R},...y),w=x.state,_=m.useRef(w);m.useEffect(()=>{_.current!==w&&(_.current=w,v||g(w))},[w,_,v]);const b=m.useMemo(()=>l!==void 0?{...x,state:l}:x,[x,l]);return m.useEffect(()=>{v&&!Object.is(l,x.state)&&k({type:lg,state:l})},[l,x.state,v]),[b,k]}gi(q1,"useControllableStateReducer");var Y1=Object.defineProperty,sr=(t,o)=>Y1(t,"name",{value:o,configurable:!0});function Ix(t,o){return m.useReducer((s,a)=>o[s][a]??s,t)}sr(Ix,"useStateMachine");var ur=sr(t=>{const{present:o,children:s}=t,a=zx(o),l=typeof s=="function"?s({present:a.isPresent}):m.Children.only(s),u=Fx(a.ref,$x(l));return typeof s=="function"||a.isPresent?m.cloneElement(l,{ref:u}):null},"Presence");function zx(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",[v,g]=Ix(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{v==="mounted"?(u.current=d.current??ss(a.current),d.current=void 0):u.current="none"},[v]),Rt(()=>{const y=a.current,x=l.current;if(x!==t){const w=u.current,_=ss(y);t?(d.current=_,g("MOUNT")):_==="none"||(y==null?void 0:y.display)==="none"?g("UNMOUNT"):g(x&&w!==_?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,g]),Rt(()=>{if(o){let y;const x=o.ownerDocument.defaultView??window,k=sr(_=>{const C=ss(a.current).includes(CSS.escape(_.animationName));if(_.target===o&&C&&(g("ANIMATION_END"),!l.current)){const S=o.style.animationFillMode;o.style.animationFillMode="forwards",y=x.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=S)})}},"handleAnimationEnd"),w=sr(_=>{_.target===o&&(u.current=ss(a.current))},"handleAnimationStart");return o.addEventListener("animationstart",w),o.addEventListener("animationcancel",k),o.addEventListener("animationend",k),()=>{x.clearTimeout(y),o.removeEventListener("animationstart",w),o.removeEventListener("animationcancel",k),o.removeEventListener("animationend",k)}}else g("ANIMATION_END")},[o,g]),{isPresent:["mounted","unmountSuspended"].includes(v),ref:m.useCallback(y=>{if(y){const x=getComputedStyle(y);a.current=x,d.current=ss(x)}else a.current=null;s(y)},[])}}sr(zx,"usePresence");function id(t,o){if(typeof t=="function")return t(o);t!=null&&(t.current=o)}sr(id,"setRef");function Fx(...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;dQ1(t,"name",{value:o,configurable:!0}),J1=Xr[" useId ".trim().toString()]||(()=>{}),Z1=0;function Hr(t){const[o,s]=m.useState(J1());return Rt(()=>{t||s(a=>a??String(Z1++))},[t]),t||(o?`radix-${o}`:"")}X1(Hr,"useId");var eC=Object.defineProperty,tC=(t,o)=>eC(t,"name",{value:o,configurable:!0}),nC={LTR:"ltr"},rC=m.createContext(void 0);function Wd(t){const o=m.useContext(rC);return t||o||nC.LTR}tC(Wd,"useDirection");var oC=Object.defineProperty,sC=(t,o)=>oC(t,"name",{value:o,configurable:!0}),cg=Xr[" useInsertionEffect ".trim().toString()];function Ln(t){const o=m.useRef(t);return typeof cg=="function"?cg(()=>{o.current=t}):Rt(()=>{o.current=t}),m.useMemo(()=>((...s)=>{var a;return(a=o.current)==null?void 0:a.call(o,...s)}),[])}sC(Ln,"useCallbackRef");var iC=Object.defineProperty,xt=(t,o)=>iC(t,"name",{value:o,configurable:!0}),ad="dismissableLayer.update",aC="dismissableLayer.pointerDownOutside",lC="dismissableLayer.focusOutside",ug,Ux=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Vd=m.forwardRef(xt(function(o,s){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:l=!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:v,onDismiss:g,...y}=o,x=m.useContext(Ux),[k,w]=m.useState(null),_=(k==null?void 0:k.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=m.useState({}),C=Fe(s,w),S=Array.from(x.layers),[R]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),N=R?S.indexOf(R):-1,E=k?S.indexOf(k):-1,P=x.layersWithOutsidePointerEventsDisabled.size>0,M=E>=N,F=m.useRef(!1),U=Wx(re=>{d==null||d(re),v==null||v(re),re.defaultPrevented||g==null||g()},{ownerDocument:_,deferPointerDownOutside:l,isDeferredPointerDownOutsideRef:F,dismissableSurfaces:x.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(re=>{if(!(re instanceof Node))return!1;const X=[...x.branches].some(H=>H.contains(re));return M&&!X},[x.branches,M])}),Y=Vx(re=>{if(l&&F.current)return;const X=re.target;[...x.branches].some(ce=>ce.contains(X))||(h==null||h(re),v==null||v(re),re.defaultPrevented||g==null||g())},_),I=k?E===S.length-1:!1,G=Ln(re=>{re.key==="Escape"&&(u==null||u(re),!re.defaultPrevented&&g&&(re.preventDefault(),g()))});return m.useEffect(()=>{if(I)return _.addEventListener("keydown",G,{capture:!0}),()=>_.removeEventListener("keydown",G,{capture:!0})},[_,I,G]),m.useEffect(()=>{if(k)return a&&(x.layersWithOutsidePointerEventsDisabled.size===0&&(ug=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(k)),x.layers.add(k),ld(),()=>{a&&(x.layersWithOutsidePointerEventsDisabled.delete(k),x.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=ug))}},[k,_,a,x]),m.useEffect(()=>()=>{k&&(x.layers.delete(k),x.layersWithOutsidePointerEventsDisabled.delete(k),ld())},[k,x]),m.useEffect(()=>{const re=xt(()=>b({}),"handleUpdate");return document.addEventListener(ad,re),()=>document.removeEventListener(ad,re)},[]),r.jsx(Ue.div,{...y,ref:C,style:{pointerEvents:P?M?"auto":"none":void 0,...o.style},onFocusCapture:Pe(o.onFocusCapture,Y.onFocusCapture),onBlurCapture:Pe(o.onBlurCapture,Y.onBlurCapture),onPointerDownCapture:Pe(o.onPointerDownCapture,U.onPointerDownCapture)})},"DismissableLayer"));function Bx(){const t=m.useContext(Ux),[o,s]=m.useState(null);return m.useEffect(()=>{if(o)return t.dismissableSurfaces.add(o),()=>{t.dismissableSurfaces.delete(o)}},[o,t.dismissableSurfaces]),s}xt(Bx,"useDismissableLayerSurface");var cC=xt(()=>!0,"IS_TRUE");function Wx(t,o){const{ownerDocument:s=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:l,dismissableSurfaces:u,shouldHandlePointerDownOutside:d=cC}=o,h=Ln(t),v=m.useRef(!1),g=m.useRef(!1),y=m.useRef(new Map),x=m.useRef(()=>{});return m.useEffect(()=>{function k(){g.current=!1,l.current=!1,y.current.clear()}xt(k,"resetOutsideInteraction");function w(){return Array.from(y.current.values()).some(Boolean)}xt(w,"isOutsideInteractionIntercepted");function _(N){if(!g.current)return;const E=N.target;E instanceof Node&&[...u].some(M=>M.contains(E))||y.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{g.current&&x.current()},0)}xt(_,"handleInteractionCapture");function b(N){g.current&&y.current.set(N.type,!1)}xt(b,"handleInteractionBubble");const C=xt(N=>{if(N.target&&!v.current){let E=function(){s.removeEventListener("click",x.current);const M=w();k(),M||Hd(aC,h,P,{discrete:!0})};if(xt(E,"handleAndDispatchPointerDownOutsideEvent"),!d(N.target)){s.removeEventListener("click",x.current),k(),v.current=!1;return}const P={originalEvent:N};g.current=!0,l.current=a&&N.button===0,y.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),k();v.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",C)},0);return()=>{window.clearTimeout(R),s.removeEventListener("pointerdown",C),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(()=>v.current=!0,"onPointerDownCapture")}}xt(Wx,"usePointerDownOutside");function Vx(t,o=globalThis==null?void 0:globalThis.document){const s=Ln(t),a=m.useRef(!1);return m.useEffect(()=>{const l=xt(u=>{u.target&&!a.current&&Hd(lC,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(Vx,"useFocusOutside");function ld(){const t=new CustomEvent(ad);document.dispatchEvent(t)}xt(ld,"dispatchUpdate");function Hd(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?$d(l,u):l.dispatchEvent(u)}xt(Hd,"handleAndDispatchCustomEvent");var uC=Object.defineProperty,at=(t,o)=>uC(t,"name",{value:o,configurable:!0}),Pu="focusScope.autoFocusOnMount",Tu="focusScope.autoFocusOnUnmount",dg={bubbles:!1,cancelable:!0},Hx=m.forwardRef(at(function(o,s){const{loop:a=!1,trapped:l=!1,branches:u,onMountAutoFocus:d,onUnmountAutoFocus:h,...v}=o,[g,y]=m.useState(null),x=Ln(d),k=Ln(h),w=m.useRef(null),_=Fe(s,y),b=m.useRef(u);m.useEffect(()=>{b.current=u});const C=m.useCallback(N=>{var E;return N?g!=null&&g.contains(N)?!0:!!((E=b.current)!=null&&E.some(P=>P.contains(N))):!1},[g]),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||!g)return;const U=F.target;C(U)?w.current=U:er(w.current,{select:!0})},E=function(F){if(S.paused||!g)return;const U=F.relatedTarget;U!==null&&(C(U)||er(w.current,{select:!0}))},P=function(F){if(document.activeElement===document.body)for(const Y of F)Y.removedNodes.length>0&&er(g)};at(N,"handleFocusIn"),at(E,"handleFocusOut"),at(P,"handleMutations"),document.addEventListener("focusin",N),document.addEventListener("focusout",E);const M=new MutationObserver(P);return g&&M.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",E),M.disconnect()}}},[l,g,S.paused,C]),m.useEffect(()=>{if(g){fg.add(S);const N=document.activeElement;if(!g.contains(N)){const P=new CustomEvent(Pu,dg);g.addEventListener(Pu,x),g.dispatchEvent(P),P.defaultPrevented||(Kx(Jx(Yd(g)),{select:!0}),document.activeElement===N&&er(g))}return()=>{g.removeEventListener(Pu,x);const P=g.ownerDocument,M=CustomEvent;setTimeout(()=>{const F=new M(Tu,dg);g.addEventListener(Tu,k),g.dispatchEvent(F),F.defaultPrevented||er(N??P.body,{select:!0}),g.removeEventListener(Tu,k),fg.remove(S)},0)}}},[g,x,k,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 M=N.currentTarget,[F,U]=qx(M);F&&U?!N.shiftKey&&P===U?(N.preventDefault(),a&&er(F,{select:!0})):N.shiftKey&&P===F&&(N.preventDefault(),a&&er(U,{select:!0})):P===M&&N.preventDefault()}},[a,l,S.paused]);return r.jsx(Ue.div,{tabIndex:-1,...v,ref:_,onKeyDown:R})},"FocusScope")),Gx=m.createContext(null);function Gd({registry:t,children:o}){return t?r.jsx(Gx.Provider,{value:t,children:o}):o}at(Gd,"FocusScopeBranchProvider");function Kd(){const[t,o]=m.useState([]),s=m.useMemo(()=>({add:at(a=>o(l=>l.includes(a)?l:[...l,a]),"add"),remove:at(a=>o(l=>l.filter(u=>u!==a)),"remove")}),[]);return{nodes:t,registry:s}}at(Kd,"useFocusScopeBranchRegistry");function qd(t){const o=m.useContext(Gx);m.useEffect(()=>{if(!(!t||!o))return o.add(t),()=>o.remove(t)},[t,o])}at(qd,"useFocusScopeBranch");function Kx(t,{select:o=!1}={}){const s=document.activeElement;for(const a of t)if(er(a,{select:o}),document.activeElement!==s)return}at(Kx,"focusFirst");function qx(t){const o=Yd(t),s=cd(o,t),a=cd(o.reverse(),t);return[s,a]}at(qx,"getTabbableEdges");function Yd(t){const o=[],a=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:at(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}at(Yd,"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}):Yx(a,{upTo:o})))return a}at(cd,"findVisible");function Yx(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}at(Yx,"isHidden");function Qx(t){return t.tagName==="INPUT"&&typeof t.select=="function"}at(Qx,"isSelectableInput");function er(t,{select:o=!1}={}){if(t&&t.focus){const a=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==a&&Qx(t)&&o&&t.select()}}at(er,"focus");var fg=Xx();function Xx(){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()}}}at(Xx,"createFocusScopesStack");function ud(t,o){const s=[...t],a=s.indexOf(o);return a!==-1&&s.splice(a,1),s}at(ud,"arrayRemove");function Jx(t){return t.filter(o=>o.tagName!=="A")}at(Jx,"removeLinks");var dC=Object.defineProperty,fC=(t,o)=>dC(t,"name",{value:o,configurable:!0}),Qd=m.forwardRef(fC(function(o,s){var v;const{container:a,...l}=o,[u,d]=m.useState(!1);Rt(()=>d(!0),[]);const h=a||u&&((v=globalThis==null?void 0:globalThis.document)==null?void 0:v.body);return h?Pd.createPortal(r.jsx(Ue.div,{...l,ref:s}),h):null},"Portal")),hC=Object.defineProperty,Xd=(t,o)=>hC(t,"name",{value:o,configurable:!0}),Ia=0,Pn=null;function pC(t){return xl(),t.children}Xd(pC,"FocusGuards");function xl(){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)}},[])}Xd(xl,"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}Xd(dd,"createFocusGuard");var On=function(){return On=Object.assign||function(o){for(var s,a=1,l=arguments.length;a"u")return PC;var o=TC(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])}},DC=ny(),as="data-scroll-locked",MC=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(gC,` { - overflow: hidden `).concat(a,`; - padding-right: `).concat(h,"px ").concat(a,`; - } - body[`).concat(as,`] { - 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(qa,` { - right: `).concat(h,"px ").concat(a,`; - } - - .`).concat(Ya,` { - margin-right: `).concat(h,"px ").concat(a,`; - } - - .`).concat(qa," .").concat(qa,` { - right: 0 `).concat(a,`; - } - - .`).concat(Ya," .").concat(Ya,` { - margin-right: 0 `).concat(a,`; - } - - body[`).concat(as,`] { - `).concat(vC,": ").concat(h,`px; - } -`)},pg=function(){var t=parseInt(document.body.getAttribute(as)||"0",10);return isFinite(t)?t:0},AC=function(){m.useEffect(function(){return document.body.setAttribute(as,(pg()+1).toString()),function(){var t=pg()-1;t<=0?document.body.removeAttribute(as):document.body.setAttribute(as,t.toString())}},[])},LC=function(t){var o=t.noRelative,s=t.noImportant,a=t.gapMode,l=a===void 0?"margin":a;AC();var u=m.useMemo(function(){return OC(l)},[l]);return m.createElement(DC,{styles:MC(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 Zo=fd?{passive:!1}:!1,IC=function(t){return t.tagName==="TEXTAREA"},ry=function(t,o){if(!(t instanceof Element))return!1;var s=window.getComputedStyle(t);return s[o]!=="hidden"&&!(s.overflowY===s.overflowX&&!IC(t)&&s[o]==="visible")},zC=function(t){return ry(t,"overflowY")},FC=function(t){return ry(t,"overflowX")},mg=function(t,o){var s=o.ownerDocument,a=o;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=oy(t,a);if(l){var u=sy(t,a),d=u[1],h=u[2];if(d>h)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},$C=function(t){var o=t.scrollTop,s=t.scrollHeight,a=t.clientHeight;return[o,s,a]},UC=function(t){var o=t.scrollLeft,s=t.scrollWidth,a=t.clientWidth;return[o,s,a]},oy=function(t,o){return t==="v"?zC(o):FC(o)},sy=function(t,o){return t==="v"?$C(o):UC(o)},BC=function(t,o){return t==="h"&&o==="rtl"?-1:1},WC=function(t,o,s,a,l){var u=BC(t,window.getComputedStyle(o).direction),d=u*a,h=s.target,v=o.contains(h),g=!1,y=d>0,x=0,k=0;do{if(!h)break;var w=sy(t,h),_=w[0],b=w[1],C=w[2],S=b-C-u*_;(_||S)&&oy(t,h)&&(x+=S,k+=_);var R=h.parentNode;h=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!v&&h!==document.body||v&&(o.contains(h)||o===h));return(y&&Math.abs(x)<1||!y&&Math.abs(k)<1)&&(g=!0),g},Fa=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},gg=function(t){return[t.deltaX,t.deltaY]},vg=function(t){return t&&"current"in t?t.current:t},VC=function(t,o){return t[0]===o[0]&&t[1]===o[1]},HC=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},GC=0,es=[];function KC(t){var o=m.useRef([]),s=m.useRef([0,0]),a=m.useRef(),l=m.useState(GC++)[0],u=m.useState(ny)[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=mC([t.lockRef.current],(t.shards||[]).map(vg),!0).filter(Boolean);return b.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),b.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var h=m.useCallback(function(b,C){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,M=b.target,F=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in b&&F==="h"&&M.type==="range")return!1;var U=window.getSelection(),Y=U&&U.anchorNode,I=Y?Y===M||Y.contains(M):!1;if(I)return!1;var G=mg(F,M);if(!G)return!0;if(G?P=F:(P=F==="v"?"h":"v",G=mg(F,M)),!G)return!1;if(!a.current&&"changedTouches"in b&&(N||E)&&(a.current=P),!P)return!0;var re=a.current||P;return WC(re,C,b,re==="h"?N:E)},[]),v=m.useCallback(function(b){var C=b;if(!(!es.length||es[es.length-1]!==u)){var S="deltaY"in C?gg(C):Fa(C),R=o.current.filter(function(P){return P.name===C.type&&(P.target===C.target||C.target===P.shadowParent)&&VC(P.delta,S)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var N=(d.current.shards||[]).map(vg).filter(Boolean).filter(function(P){return P.contains(C.target)}),E=N.length>0?h(C,N[0]):!d.current.noIsolation;E&&C.cancelable&&C.preventDefault()}}},[]),g=m.useCallback(function(b,C,S,R){var N={name:b,delta:C,target:S,should:R,shadowParent:qC(S)};o.current.push(N),setTimeout(function(){o.current=o.current.filter(function(E){return E!==N})},1)},[]),y=m.useCallback(function(b){s.current=Fa(b),a.current=void 0},[]),x=m.useCallback(function(b){g(b.type,gg(b),b.target,h(b,t.lockRef.current))},[]),k=m.useCallback(function(b){g(b.type,Fa(b),b.target,h(b,t.lockRef.current))},[]);m.useEffect(function(){return es.push(u),t.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:k}),document.addEventListener("wheel",v,Zo),document.addEventListener("touchmove",v,Zo),document.addEventListener("touchstart",y,Zo),function(){es=es.filter(function(b){return b!==u}),document.removeEventListener("wheel",v,Zo),document.removeEventListener("touchmove",v,Zo),document.removeEventListener("touchstart",y,Zo)}},[]);var w=t.removeScrollBar,_=t.inert;return m.createElement(m.Fragment,null,_?m.createElement(u,{styles:HC(l)}):null,w?m.createElement(LC,{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 YC=CC(ty,KC);var Jd=m.forwardRef(function(t,o){return m.createElement(yl,On({},t,{ref:o,sideCar:YC}))});Jd.classNames=yl.classNames;var QC=function(t){if(typeof document>"u")return null;var o=Array.isArray(t)?t[0]:t;return o.ownerDocument.body},ts=new WeakMap,$a=new WeakMap,Ua={},Au=0,iy=function(t){return t&&(t.host||iy(t.parentNode))},XC=function(t,o){return o.map(function(s){if(t.contains(s))return s;var a=iy(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})},JC=function(t,o,s,a){var l=XC(o,Array.isArray(t)?t:[t]);Ua[s]||(Ua[s]=new WeakMap);var u=Ua[s],d=[],h=new Set,v=new Set(l),g=function(x){!x||h.has(x)||(h.add(x),g(x.parentNode))};l.forEach(g);var y=function(x){!x||v.has(x)||Array.prototype.forEach.call(x.children,function(k){if(h.has(k))y(k);else try{var w=k.getAttribute(a),_=w!==null&&w!=="false",b=(ts.get(k)||0)+1,C=(u.get(k)||0)+1;ts.set(k,b),u.set(k,C),d.push(k),b===1&&_&&$a.set(k,!0),C===1&&k.setAttribute(s,"true"),_||k.setAttribute(a,"true")}catch(S){console.error("aria-hidden: cannot operate on ",k,S)}})};return y(o),h.clear(),Au++,function(){d.forEach(function(x){var k=ts.get(x)-1,w=u.get(x)-1;ts.set(x,k),u.set(x,w),k||($a.has(x)||x.removeAttribute(a),$a.delete(x)),w||x.removeAttribute(s)}),Au--,Au||(ts=new WeakMap,ts=new WeakMap,$a=new WeakMap,Ua={})}},ay=function(t,o,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),l=QC(t);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),JC(a,l,s,"aria-hidden")):function(){return null}},ZC=Object.defineProperty,Ut=(t,o)=>ZC(t,"name",{value:o,configurable:!0}),Zd="Dialog",[ly,cy]=bn(Zd),[eS,jn]=ly(Zd),ef=Ut(t=>{const{__scopeDialog:o,children:s,open:a,defaultOpen:l,onOpenChange:u,modal:d=!0}=t,h=m.useRef(null),v=m.useRef(null),{nodes:g,registry:y}=Kd(),[x,k]=gs({prop:a,defaultProp:l??!1,onChange:u,caller:Zd}),[w,_]=m.useState(0),[b,C]=m.useState(0);return r.jsx(eS,{scope:o,triggerRef:h,contentRef:v,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),titlePresent:w>0,descriptionPresent:b>0,setTitleCount:_,setDescriptionCount:C,open:x,onOpenChange:k,onOpenToggle:m.useCallback(()=>k(S=>!S),[k]),modal:d,branchNodes:g,branchRegistry:y,children:s})},"Dialog"),tS="DialogTrigger",nS=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=jn(tS,a),d=Fe(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":wl(u.open),...l,ref:d,onClick:Pe(o.onClick,u.onOpenToggle)})},"DialogTrigger")),uy="DialogPortal",[rS,dy]=ly(uy,{forceMount:void 0}),tf=Ut(t=>{const{__scopeDialog:o,forceMount:s,children:a,container:l}=t,u=jn(uy,o);return r.jsx(rS,{scope:o,forceMount:s,children:m.Children.map(a,d=>r.jsx(ur,{present:s||u.open,children:r.jsx(Qd,{asChild:!0,container:l,children:d})}))})},"DialogPortal"),hd="DialogOverlay",nf=m.forwardRef(Ut(function(o,s){const a=dy(hd,o.__scopeDialog),{forceMount:l=a.forceMount,...u}=o,d=jn(hd,o.__scopeDialog);return d.modal?r.jsx(ur,{present:l||d.open,children:r.jsx(sS,{...u,ref:s})}):null},"DialogOverlay")),oS=or("DialogOverlay.RemoveScroll"),sS=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=jn(hd,a),d=Bx(),h=Fe(s,d);return r.jsx(Jd,{as:oS,allowPinchZoom:!0,shards:m.useMemo(()=>[u.contentRef,...u.branchNodes.map(v=>({current:v}))],[u.contentRef,u.branchNodes]),children:r.jsx(Ue.div,{"data-state":wl(u.open),...l,ref:h,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),di="DialogContent",rf=m.forwardRef(Ut(function(o,s){const a=dy(di,o.__scopeDialog),{forceMount:l=a.forceMount,...u}=o,d=jn(di,o.__scopeDialog);return r.jsx(ur,{present:l||d.open,children:d.modal?r.jsx(iS,{...u,ref:s}):r.jsx(aS,{...u,ref:s})})},"DialogContent")),iS=m.forwardRef(Ut(function(o,s){const a=jn(di,o.__scopeDialog),l=m.useRef(null),u=Fe(s,a.contentRef,l);return m.useEffect(()=>{const d=l.current;if(d)return ay(d)},[]),r.jsx(fy,{...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,v=h.button===0&&h.ctrlKey===!0;(h.button===2||v)&&d.preventDefault()}),onFocusOutside:Pe(o.onFocusOutside,d=>d.preventDefault())})},"DialogContentModal")),aS=m.forwardRef(Ut(function(o,s){const a=jn(di,o.__scopeDialog),l=m.useRef(!1),u=m.useRef(!1);return r.jsx(fy,{...o,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var h,v;(h=o.onCloseAutoFocus)==null||h.call(o,d),d.defaultPrevented||(l.current||(v=a.triggerRef.current)==null||v.focus(),d.preventDefault()),l.current=!1,u.current=!1},onInteractOutside:d=>{var g,y;(g=o.onInteractOutside)==null||g.call(o,d),d.defaultPrevented||(l.current=!0,d.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const h=d.target;((y=a.triggerRef.current)==null?void 0:y.contains(h))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&u.current&&d.preventDefault()}})},"DialogContentNonModal")),fy=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:d,"aria-describedby":h,children:v,...g}=o,y=jn(di,a);return xl(),r.jsx(Gd,{registry:y.branchRegistry,children:r.jsx(Hx,{asChild:!0,loop:!0,trapped:l,branches:y.branchNodes,onMountAutoFocus:u,onUnmountAutoFocus:d,children:r.jsx(Vd,{role:"dialog",id:y.contentId,"aria-labelledby":y.titlePresent?y.titleId:void 0,"aria-describedby":y.descriptionPresent?hy(h,y.descriptionId):h,"data-state":wl(y.open),...g,ref:s,deferPointerDownOutside:!0,onDismiss:()=>y.onOpenChange(!1),children:v})})})},"DialogContentImpl")),of=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=jn("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")),sf=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=jn("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")),lS="DialogClose",vi=m.forwardRef(Ut(function(o,s){const{__scopeDialog:a,...l}=o,u=jn(lS,a);return r.jsx(Ue.button,{type:"button",...l,ref:s,onClick:Pe(o.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function hy(...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(hy,"concatAriaDescribedby");function wl(t){return t?"open":"closed"}Ut(wl,"getState");var cS=Object.defineProperty,dr=(t,o)=>cS(t,"name",{value:o,configurable:!0}),uS="AlertDialog",[dS,HR]=bn(uS,[cy]),fr=cy(),fS=dr(t=>{const{__scopeAlertDialog:o,...s}=t,a=fr(o);return r.jsx(ef,{...a,...s,modal:!0})},"AlertDialog");m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(nS,{...u,...l,ref:s})},"AlertDialogTrigger"));var hS=dr(t=>{const{__scopeAlertDialog:o,...s}=t,a=fr(o);return r.jsx(tf,{...a,...s})},"AlertDialogPortal"),pS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(nf,{...u,...l,ref:s})},"AlertDialogOverlay")),mS="AlertDialogContent",[gS,vS]=dS(mS),xS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,children:l,...u}=o,d=fr(a),h=m.useRef(null),v=Fe(s,h),g=m.useRef(null);return r.jsx(gS,{scope:a,cancelRef:g,children:r.jsx(rf,{role:"alertdialog",...d,...u,ref:v,onOpenAutoFocus:Pe(u.onOpenAutoFocus,y=>{var x;y.preventDefault(),(x=g.current)==null||x.focus({preventScroll:!0})}),onPointerDownOutside:y=>y.preventDefault(),onInteractOutside:y=>y.preventDefault(),children:l})})},"AlertDialogContent")),yS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(of,{...u,...l,ref:s})},"AlertDialogTitle")),wS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(sf,{...u,...l,ref:s})},"AlertDialogDescription")),bS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,u=fr(a);return r.jsx(vi,{...u,...l,ref:s})},"AlertDialogAction")),jS="AlertDialogCancel",kS=m.forwardRef(dr(function(o,s){const{__scopeAlertDialog:a,...l}=o,{cancelRef:u}=vS(jS,a),d=fr(a),h=Fe(s,u);return r.jsx(vi,{...d,...l,ref:h})},"AlertDialogCancel")),CS=Object.defineProperty,SS=(t,o)=>CS(t,"name",{value:o,configurable:!0});function af(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,v;if("borderBoxSize"in d){const g=d.borderBoxSize,y=Array.isArray(g)?g[0]:g;h=y.inlineSize,v=y.blockSize}else h=t.offsetWidth,v=t.offsetHeight;s({width:h,height:v})})});return l.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(a),l.unobserve(t)}}else s(void 0)},[t]),o}SS(af,"useSize");var _S=Object.defineProperty,ir=(t,o)=>_S(t,"name",{value:o,configurable:!0}),lf="Checkbox",[NS,GR]=bn(lf),[ES,cf]=NS(lf);function py(t){const{__scopeCheckbox:o,checked:s,children:a,defaultChecked:l,disabled:u,form:d,name:h,onCheckedChange:v,required:g,value:y="on",internal_do_not_use_render:x}=t,[k,w]=gs({prop:s,defaultProp:l??!1,onChange:v,caller:lf}),[_,b]=m.useState(null),[C,S]=m.useState(null),[R,N]=m.useState(null),E=_?!!d||!!_.closest("form"):!0,P={checked:k,disabled:u,setChecked:w,control:_,setControl:b,name:h,form:d,value:y,userClick:R,onUserClick:N,required:g,defaultChecked:an(l)?!1:l,isFormControl:E,bubbleInput:C,setBubbleInput:S};return r.jsx(ES,{scope:o,...P,children:my(x)?x(P):a})}ir(py,"CheckboxProvider");var RS="CheckboxTrigger",PS=m.forwardRef(ir(function({__scopeCheckbox:o,onKeyDown:s,onClick:a,...l},u){const{control:d,value:h,disabled:v,checked:g,required:y,setControl:x,setChecked:k,onUserClick:w,isFormControl:_,bubbleInput:b}=cf(RS,o),C=Fe(u,x),S=m.useRef(g);return m.useEffect(()=>{const R=d==null?void 0:d.form;if(R){const N=ir(()=>k(S.current),"reset");return R.addEventListener("reset",N),()=>R.removeEventListener("reset",N)}},[d,k]),r.jsx(Ue.button,{type:"button",role:"checkbox","aria-checked":an(g)?"mixed":g,"aria-required":y,"data-state":uf(g),"data-disabled":v?"":void 0,disabled:v,value:h,...l,ref:C,onKeyDown:Pe(s,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Pe(a,R=>{const N=R.isPropagationStopped();w({requestedChecked:an(g)?!0:!g,hasConsumerStoppedPropagation:N}),k(E=>an(E)?!0:!E),b&&_&&(N||R.stopPropagation())})})},"CheckboxTrigger")),TS=m.forwardRef(ir(function(o,s){const{__scopeCheckbox:a,name:l,checked:u,defaultChecked:d,required:h,disabled:v,value:g,onCheckedChange:y,form:x,...k}=o;return r.jsx(py,{__scopeCheckbox:a,checked:u,defaultChecked:d,disabled:v,required:h,onCheckedChange:y,name:l,form:x,value:g,internal_do_not_use_render:({isFormControl:w})=>r.jsxs(r.Fragment,{children:[r.jsx(PS,{...k,ref:s,__scopeCheckbox:a}),w&&r.jsx(AS,{__scopeCheckbox:a})]})})},"Checkbox")),OS="CheckboxIndicator",DS=m.forwardRef(ir(function(o,s){const{__scopeCheckbox:a,forceMount:l,...u}=o,d=cf(OS,a);return r.jsx(ur,{present:l||an(d.checked)||d.checked===!0,children:r.jsx(Ue.span,{"data-state":uf(d.checked),"data-disabled":d.disabled?"":void 0,...u,ref:s,style:{pointerEvents:"none",...o.style}})})},"CheckboxIndicator")),MS="CheckboxBubbleInput",AS=m.forwardRef(ir(function({__scopeCheckbox:o,onClick:s,...a},l){const{control:u,userClick:d,checked:h,defaultChecked:v,required:g,disabled:y,name:x,value:k,form:w,bubbleInput:_,setBubbleInput:b}=cf(MS,o),C=Fe(l,b),S=af(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 U=window.HTMLInputElement.prototype,I=Object.getOwnPropertyDescriptor(U,"checked").set;if(!I)return;const G=N.current!==h;N.current=h;const re=d!==null&&d!==E.current;if(E.current=d,re)P.current=G?null:d,G&&(F.indeterminate=an(h),I.call(F,an(h)?!1:h)),F.dispatchEvent(new Event("click",{bubbles:!d.hasConsumerStoppedPropagation}));else if(G){const X=P.current;P.current=null;const H=(X==null?void 0:X.requestedChecked)===h;R.current=!0,F.indeterminate=an(h),I.call(F,an(h)?!1:h),F.dispatchEvent(new Event("click",{bubbles:!(H&&X.hasConsumerStoppedPropagation)})),R.current=!1}},[_,h,d]);const M=m.useRef(an(h)?!1:h);return r.jsx(Ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??M.current,required:g,disabled:y,name:x,value:k,form:w,...a,tabIndex:-1,ref:C,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 my(t){return typeof t=="function"}ir(my,"isFunction");function an(t){return t==="indeterminate"}ir(an,"isIndeterminate");function uf(t){return an(t)?"indeterminate":t?"checked":"unchecked"}ir(uf,"getState");const LS=["top","right","bottom","left"],qr=Math.min,tr=Math.max,rl=Math.round,Ba=Math.floor,nr=t=>({x:t,y:t}),IS={left:"right",right:"left",bottom:"top",top:"bottom"};function gy(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 vs(t){return t.split("-")[1]}function df(t){return t==="x"?"y":"x"}function ff(t){return t==="y"?"height":"width"}function Dn(t){const o=t[0];return o==="t"||o==="b"?"y":"x"}function hf(t){return df(Dn(t))}function zS(t,o,s){s===void 0&&(s=!1);const a=vs(t),l=hf(t),u=ff(l);let d=l==="x"?a===(s?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[u]>o.floating[u]&&(d=ol(d)),[d,ol(d)]}function FS(t){const o=ol(t);return[pd(t),o,pd(o)]}function pd(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const xg=["left","right"],yg=["right","left"],$S=["top","bottom"],US=["bottom","top"];function BS(t,o,s){switch(t){case"top":case"bottom":return s?o?yg:xg:o?xg:yg;case"left":case"right":return o?$S:US;default:return[]}}function WS(t,o,s,a){const l=vs(t);let u=BS(Yr(t),s==="start",a);return l&&(u=u.map(d=>d+"-"+l),o&&(u=u.concat(u.map(pd)))),u}function ol(t){const o=Yr(t);return IS[o]+t.slice(o.length)}function VS(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 vy(t){return typeof t!="number"?VS(t):{top:t,right:t,bottom:t,left:t}}function sl(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 wg(t,o,s){let{reference:a,floating:l}=t;const u=Dn(o),d=hf(o),h=ff(d),v=Yr(o),g=u==="y",y=a.x+a.width/2-l.width/2,x=a.y+a.height/2-l.height/2,k=a[h]/2-l[h]/2;let w;switch(v){case"top":w={x:y,y:a.y-l.height};break;case"bottom":w={x:y,y:a.y+a.height};break;case"right":w={x:a.x+a.width,y:x};break;case"left":w={x:a.x-l.width,y:x};break;default:w={x:a.x,y:a.y}}const _=vs(o);return _&&(w[d]+=k*(_==="end"?1:-1)*(s&&g?-1:1)),w}async function HS(t,o){var s;o===void 0&&(o={});const{x:a,y:l,platform:u,rects:d,elements:h,strategy:v}=t,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:x="floating",altBoundary:k=!1,padding:w=0}=ar(o,t),_=vy(w),C=h[k?x==="floating"?"reference":"floating":x],S=sl(await u.getClippingRect({element:(s=await(u.isElement==null?void 0:u.isElement(C)))==null||s?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(h.floating)),boundary:g,rootBoundary:y,strategy:v})),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=sl(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:R,offsetParent:N,strategy:v}):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 GS=50,KS=async(t,o,s)=>{const{placement:a="bottom",strategy:l="absolute",middleware:u=[],platform:d}=s,h=d.detectOverflow?d:{...d,detectOverflow:HS},v=await(d.isRTL==null?void 0:d.isRTL(o));let g=await d.getElementRects({reference:t,floating:o,strategy:l}),{x:y,y:x}=wg(g,a,v),k=a,w=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:v}=o,{element:g,padding:y=0}=ar(t,o)||{};if(g==null)return{};const x=vy(y),k={x:s,y:a},w=hf(l),_=ff(w),b=await d.getDimensions(g),C=w==="y",S=C?"top":"left",R=C?"bottom":"right",N=C?"clientHeight":"clientWidth",E=u.reference[_]+u.reference[w]-k[w]-u.floating[_],P=k[w]-u.reference[w],M=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g));let F=M?M[N]:0;(!F||!await(d.isElement==null?void 0:d.isElement(M)))&&(F=h.floating[N]||u.floating[_]);const U=E/2-P/2,Y=F/2-b[_]/2-1,I=qr(x[S],Y),G=qr(x[R],Y),re=F-b[_]-G,X=F/2-b[_]/2+U,H=gy(I,X,re),ce=!v.arrow&&vs(l)!=null&&X!==H&&u.reference[_]/2-(XH<=0)){var G,re;const H=(((G=u.flip)==null?void 0:G.index)||0)+1,ce=F[H];if(ce&&(!(x==="alignment"?R!==Dn(ce):!1)||I.every(V=>Dn(V.placement)===R?V.overflows[0]>0:!0)))return{data:{index:H,overflows:I},reset:{placement:ce}};let le=(re=I.filter(ie=>ie.overflows[0]<=0).sort((ie,V)=>ie.overflows[1]-V.overflows[1])[0])==null?void 0:re.placement;if(!le)switch(w){case"bestFit":{var X;const ie=(X=I.filter(V=>{if(M){const ee=Dn(V.placement);return ee===R||ee==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ee=>ee>0).reduce((ee,z)=>ee+z,0)]).sort((V,ee)=>V[1]-ee[1])[0])==null?void 0:X[0];ie&&(le=ie);break}case"initialPlacement":le=h;break}if(l!==le)return{reset:{placement:le}}}return{}}}};function bg(t,o){return{top:t.top-o.height,right:t.right-o.width,bottom:t.bottom-o.height,left:t.left-o.width}}function jg(t){return LS.some(o=>t[o]>=0)}const QS=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=bg(d,s.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:jg(h)}}}case"escaped":{const d=await a.detectOverflow(o,{...u,altBoundary:!0}),h=bg(d,s.floating);return{data:{escapedOffsets:h,escaped:jg(h)}}}default:return{}}}}},xy=new Set(["left","top"]);async function XS(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=vs(s),v=Dn(s)==="y",g=xy.has(d)?-1:1,y=u&&v?-1:1,x=ar(o,t);let{mainAxis:k,crossAxis:w,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"&&(w=h==="end"?_*-1:_),v?{x:w*y,y:k*g}:{x:k*g,y:w*y}}const JS=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,v=await XS(o,t);return d===((s=h.offset)==null?void 0:s.placement)&&(a=h.arrow)!=null&&a.alignmentOffset?{}:{x:l+v.x,y:u+v.y,data:{...v,placement:d}}}}},ZS=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:v={fn:R=>{let{x:N,y:E}=R;return{x:N,y:E}}},...g}=ar(t,o),y={x:s,y:a},x=await u.detectOverflow(o,g),k=Dn(l),w=df(k);let _=y[w],b=y[k];const C=(R,N)=>gy(N+x[R==="y"?"top":"left"],N,N-x[R==="y"?"bottom":"right"]);d&&(_=C(w,_)),h&&(b=C(k,b));const S=v.fn({...o,[w]:_,[k]:b});return{...S,data:{x:S.x-s,y:S.y-a,enabled:{[w]:d,[k]:h}}}}}},e_=function(t){return t===void 0&&(t={}),{options:t,fn(o){var s,a;const{x:l,y:u,placement:d,rects:h,middlewareData:v}=o,{offset:g=0,mainAxis:y=!0,crossAxis:x=!0}=ar(t,o),k={x:l,y:u},w=Dn(d),_=df(w);let b=k[_],C=k[w];const S=ar(g,o),R=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(s=S.mainAxis)!=null?s:0,crossAxis:(a=S.crossAxis)!=null?a:0};if(y){const P=_==="y"?"height":"width",M=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",M=xy.has(Yr(d)),F=h.reference[w]-h.floating[P]+(M&&((N=v.offset)==null?void 0:N[w])||0)+(M?0:R.crossAxis),U=h.reference[w]+h.reference[P]+(M?0:((E=v.offset)==null?void 0:E[w])||0)-(M?R.crossAxis:0);CU&&(C=U)}return{[_]:b,[w]:C}}}},t_=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),v=await l.detectOverflow(o,h),g=Yr(s),y=vs(s),x=Dn(s)==="y",{width:k,height:w}=a.floating;let _,b;g==="top"||g==="bottom"?(_=g,b=y===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(b=g,_=y==="end"?"top":"bottom");const C=w-v.top-v.bottom,S=k-v.left-v.right,R=qr(w-v[_],C),N=qr(k-v[b],S),E=o.middlewareData.shift,P=!E;let M=R,F=N;E!=null&&E.enabled.x&&(F=S),E!=null&&E.enabled.y&&(M=C),P&&!y&&(x?F=k-2*tr(v.left,v.right):M=w-2*tr(v.top,v.bottom)),await d({...o,availableWidth:F,availableHeight:M});const U=await l.getDimensions(u.floating);return k!==U.width||w!==U.height?{reset:{rects:!0}}:{}}}};function bl(){return typeof window<"u"}function xs(t){return yy(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=(yy(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function yy(t){return bl()?t instanceof Node||t instanceof $t(t).Node:!1}function In(t){return bl()?t instanceof Element||t instanceof $t(t).Element:!1}function eo(t){return bl()?t instanceof HTMLElement||t instanceof $t(t).HTMLElement:!1}function kg(t){return!bl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $t(t).ShadowRoot}function jl(t){const{overflow:o,overflowX:s,overflowY:a,display:l}=zn(t);return/auto|scroll|overlay|hidden|clip/.test(o+a+s)&&l!=="inline"&&l!=="contents"}function n_(t){return/^(table|td|th)$/.test(xs(t))}function kl(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const r_=/transform|translate|scale|rotate|perspective|filter/,o_=/paint|layout|strict|content/,wo=t=>!!t&&t!=="none";let Lu;function pf(t){const o=In(t)?zn(t):t;return wo(o.transform)||wo(o.translate)||wo(o.scale)||wo(o.rotate)||wo(o.perspective)||!mf()&&(wo(o.backdropFilter)||wo(o.filter))||r_.test(o.willChange||"")||o_.test(o.contain||"")}function s_(t){let o=jo(t);for(;eo(o)&&!fi(o);){if(pf(o))return o;if(kl(o))return null;o=jo(o)}return null}function mf(){return Lu==null&&(Lu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Lu}function fi(t){return/^(html|body|#document)$/.test(xs(t))}function zn(t){return $t(t).getComputedStyle(t)}function Cl(t){return In(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function jo(t){if(xs(t)==="html")return t;const o=t.assignedSlot||t.parentNode||kg(t)&&t.host||hr(t);return kg(o)?o.host:o}function wy(t){const o=jo(t);return fi(o)?(t.ownerDocument||t).body:eo(o)&&jl(o)?o:wy(o)}function hi(t,o,s){var a;o===void 0&&(o=[]),s===void 0&&(s=!0);const l=wy(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||[],jl(l)?l:[],h&&s?hi(h):[])}else return o.concat(l,hi(l,[],s))}function md(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function by(t){const o=zn(t);let s=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const l=eo(t),u=l?t.offsetWidth:s,d=l?t.offsetHeight:a,h=rl(s)!==u||rl(a)!==d;return h&&(s=u,a=d),{width:s,height:a,$:h}}function gf(t){return In(t)?t:t.contextElement}function ls(t){const o=gf(t);if(!eo(o))return nr(1);const s=o.getBoundingClientRect(),{width:a,height:l,$:u}=by(o);let d=(u?rl(s.width):s.width)/a,h=(u?rl(s.height):s.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!h||!Number.isFinite(h))&&(h=1),{x:d,y:h}}const i_=nr(0);function jy(t){const o=$t(t);return!mf()||!o.visualViewport?i_:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function a_(t,o,s){return o===void 0&&(o=!1),!!s&&o&&s===$t(t)}function ko(t,o,s,a){o===void 0&&(o=!1),s===void 0&&(s=!1);const l=t.getBoundingClientRect(),u=gf(t);let d=nr(1);o&&(a?In(a)&&(d=ls(a)):d=ls(t));const h=a_(u,s,a)?jy(u):nr(0);let v=(l.left+h.x)/d.x,g=(l.top+h.y)/d.y,y=l.width/d.x,x=l.height/d.y;if(u&&a){const k=$t(u),w=In(a)?$t(a):a;let _=k,b=md(_);for(;b&&w!==_;){const C=ls(b),S=b.getBoundingClientRect(),R=zn(b),N=S.left+(b.clientLeft+parseFloat(R.paddingLeft))*C.x,E=S.top+(b.clientTop+parseFloat(R.paddingTop))*C.y;v*=C.x,g*=C.y,y*=C.x,x*=C.y,v+=N,g+=E,_=$t(b),b=md(_)}}return sl({width:y,height:x,x:v,y:g})}function Sl(t,o){const s=Cl(t).scrollLeft;return o?o.left+s:ko(hr(t)).left+s}function ky(t,o){const s=t.getBoundingClientRect(),a=s.left+o.scrollLeft-Sl(t,s),l=s.top+o.scrollTop;return{x:a,y:l}}function l_(t){let{elements:o,rect:s,offsetParent:a,strategy:l}=t;const u=l==="fixed",d=hr(a),h=o?kl(o.floating):!1;if(a===d||h&&u)return s;let v={scrollLeft:0,scrollTop:0},g=nr(1);const y=nr(0),x=eo(a);if((x||!u)&&((xs(a)!=="body"||jl(d))&&(v=Cl(a)),x)){const w=ko(a);g=ls(a),y.x=w.x+a.clientLeft,y.y=w.y+a.clientTop}const k=d&&!x&&!u?ky(d,v):nr(0);return{width:s.width*g.x,height:s.height*g.y,x:s.x*g.x-v.scrollLeft*g.x+y.x+k.x,y:s.y*g.y-v.scrollTop*g.y+y.y+k.y}}function c_(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function u_(t){const o=Cl(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+Sl(t);const d=-o.scrollTop;return zn(s).direction==="rtl"&&(u+=tr(t.clientWidth,s.clientWidth)-a),{width:a,height:l,x:u,y:d}}const d_=25;function f_(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,v=u.clientHeight,g=0,y=0;if(d){const k=!mf()||o==="fixed";a?k||(g=-d.offsetLeft,y=-d.offsetTop):(h=d.width,v=d.height,k&&(g=d.offsetLeft,y=d.offsetTop))}if(Sl(u)<=0){const k=u.ownerDocument,w=k.body,_=getComputedStyle(w),b=k.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,C=Math.abs(u.clientWidth-w.clientWidth-b),S=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;S<=d_&&(h-=S)}return{width:h,height:v,x:g,y}}function h_(t,o){const s=ko(t,!0,o==="fixed"),a=s.top+t.clientTop,l=s.left+t.clientLeft,u=ls(t),d=t.clientWidth*u.x,h=t.clientHeight*u.y,v=l*u.x,g=a*u.y;return{width:d,height:h,x:v,y:g}}function Cg(t,o,s){let a;if(o==="viewport"||o==="layoutViewport")a=f_(t,s,o);else if(o==="document")a=u_(hr(t));else if(In(o))a=h_(o,s);else{const l=jy(t);a={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return sl(a)}function p_(t,o){const s=o.get(t);if(s)return s;let a=hi(t,[],!1).filter(h=>In(h)&&xs(h)!=="body"),l=null;const u=zn(t).position==="fixed";let d=u?jo(t):t;for(;In(d)&&!fi(d);){const h=zn(d),v=pf(d),g=l?l.position:u?"fixed":"";!v&&(g==="fixed"||g==="absolute"&&h.position==="static")?a=a.filter(x=>x!==d):l=h,d=jo(d)}return o.set(t,a),a}function m_(t){let{element:o,boundary:s,rootBoundary:a,strategy:l}=t;const d=[...s==="clippingAncestors"?kl(o)?[]:p_(o,this._c):[].concat(s),a],h=Cg(o,d[0],l);let v=h.top,g=h.right,y=h.bottom,x=h.left;for(let k=1;k{h(!1,1e-7)},1e3)}F=!1}try{a=new IntersectionObserver(U,{...M,root:u.ownerDocument})}catch{a=new IntersectionObserver(U,M)}a.observe(t)}const v=$t(t),g=()=>h(s);return v.addEventListener("resize",g),h(!0),()=>{v.removeEventListener("resize",g),d()}}function j_(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:v=!1}=a,g=gf(t),y=l||u?[...g?hi(g):[],...o?hi(o):[]]:[];y.forEach(S=>{l&&S.addEventListener("scroll",s),u&&S.addEventListener("resize",s)});const x=g&&h?b_(g,s,u):null;let k=-1,w=null;d&&(w=new ResizeObserver(S=>{let[R]=S;R&&R.target===g&&w&&o&&(w.unobserve(o),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var N;(N=w)==null||N.observe(o)})),s()}),g&&!v&&w.observe(g),o&&w.observe(o));let _,b=v?ko(t):null;v&&C();function C(){const S=ko(t);b&&!Sy(b,S)&&s(),b=S,_=requestAnimationFrame(C)}return s(),()=>{var S;y.forEach(R=>{l&&R.removeEventListener("scroll",s),u&&R.removeEventListener("resize",s)}),x==null||x(),(S=w)==null||S.disconnect(),w=null,v&&cancelAnimationFrame(_)}}const k_=JS,C_=ZS,S_=YS,__=t_,N_=QS,_g=qS,E_=e_,R_=(t,o,s)=>{const a=new Map,l=s??{},u={...w_,...l.platform,_c:a};return KS(t,o,{...l,platform:u})};var P_=typeof document<"u",T_=function(){},Qa=P_?m.useLayoutEffect:T_;function il(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(!il(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)&&!il(t[u],o[u]))return!1}return!0}return t!==t&&o!==o}function _y(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ng(t,o){const s=_y(t);return Math.round(o*s)/s}function zu(t){const o=m.useRef(t);return Qa(()=>{o.current=t}),o}function O_(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:v,open:g}=t,[y,x]=m.useState({x:0,y:0,strategy:s,placement:o,middlewareData:{},isPositioned:!1}),[k,w]=m.useState(a);il(k,a)||w(a);const[_,b]=m.useState(null),[C,S]=m.useState(null),R=m.useCallback(V=>{V!==M.current&&(M.current=V,b(V))},[]),N=m.useCallback(V=>{V!==F.current&&(F.current=V,S(V))},[]),E=u||_,P=d||C,M=m.useRef(null),F=m.useRef(null),U=m.useRef(y),Y=v!=null,I=zu(v),G=zu(l),re=zu(g),X=m.useCallback(()=>{if(!M.current||!F.current)return;const V={placement:o,strategy:s,middleware:k};G.current&&(V.platform=G.current),R_(M.current,F.current,V).then(ee=>{const z={...ee,isPositioned:re.current!==!1};H.current&&!il(U.current,z)&&(U.current=z,Pd.flushSync(()=>{x(z)}))})},[k,o,s,G,re]);Qa(()=>{g===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,x(V=>({...V,isPositioned:!1})))},[g]);const H=m.useRef(!1);Qa(()=>(H.current=!0,()=>{H.current=!1}),[]),Qa(()=>{if(E&&(M.current=E),P&&(F.current=P),E&&P){if(I.current)return I.current(E,P,X);X()}},[E,P,X,I,Y]);const ce=m.useMemo(()=>({reference:M,floating:F,setReference:R,setFloating:N}),[R,N]),le=m.useMemo(()=>({reference:E,floating:P}),[E,P]),ie=m.useMemo(()=>{const V={position:s,left:0,top:0};if(!le.floating)return V;const ee=Ng(le.floating,y.x),z=Ng(le.floating,y.y);return h?{...V,transform:"translate("+ee+"px, "+z+"px)",..._y(le.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ee,top:z}},[s,h,le.floating,y.x,y.y]);return m.useMemo(()=>({...y,update:X,refs:ce,elements:le,floatingStyles:ie}),[y,X,ce,le,ie])}const D_=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?_g({element:a.current,padding:l}).fn(s):{}:a?_g({element:a,padding:l}).fn(s):{}}}},M_=(t,o)=>{const s=k_(t);return{name:s.name,fn:s.fn,options:[t,o]}},A_=(t,o)=>{const s=C_(t);return{name:s.name,fn:s.fn,options:[t,o]}},L_=(t,o)=>({fn:E_(t).fn,options:[t,o]}),I_=(t,o)=>{const s=S_(t);return{name:s.name,fn:s.fn,options:[t,o]}},z_=(t,o)=>{const s=__(t);return{name:s.name,fn:s.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=D_(t);return{name:s.name,fn:s.fn,options:[t,o]}};var U_=Object.defineProperty,B_=(t,o)=>U_(t,"name",{value:o,configurable:!0}),W_=m.forwardRef(B_(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")),V_=Object.defineProperty,rr=(t,o)=>V_(t,"name",{value:o,configurable:!0}),Eg={Partial:"partial"},Rg={Optimized:"optimized",Always:"always"},Ny="Popper",[Ey,_l]=bn(Ny),[H_,Ry]=Ey(Ny),Py=rr(t=>{const{__scopePopper:o,children:s}=t,[a,l]=m.useState(null),[u,d]=m.useState(void 0);return r.jsx(H_,{scope:o,anchor:a,onAnchorChange:l,placementState:u,setPlacementState:d,children:s})},"Popper"),G_="PopperAnchor",Ty=m.forwardRef(rr(function(o,s){const{__scopePopper:a,virtualRef:l,...u}=o,d=Ry(G_,a),h=m.useRef(null),v=d.onAnchorChange,g=m.useCallback(b=>{h.current=b,b&&v(b)},[v]),y=Fe(s,g),x=m.useRef(null);m.useEffect(()=>{if(!l)return;const b=x.current;x.current=l.current,b!==x.current&&v(x.current)});const k=d.placementState&&Nl(d.placementState),w=k==null?void 0:k[0],_=k==null?void 0:k[1];return l?null:r.jsx(Ue.div,{"data-radix-popper-side":w,"data-radix-popper-align":_,...u,ref:y})},"PopperAnchor")),Oy="PopperContent",[K_,q_]=Ey(Oy),Dy=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:v=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:x=0,sticky:k=Eg.Partial,hideWhenDetached:w=!1,updatePositionStrategy:_=Rg.Optimized,onPlaced:b,...C}=o,S=Ry(Oy,a),[R,N]=m.useState(null),E=Fe(s,N),[P,M]=m.useState(null),F=af(P),U=(F==null?void 0:F.width)??0,Y=(F==null?void 0:F.height)??0,I=l+(d!=="center"?"-"+d:""),G=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},re=Array.isArray(y)?y:[y],X=re.length>0,H={padding:G,boundary:re.filter(My),altBoundary:X},{refs:ce,floatingStyles:le,placement:ie,isPositioned:V,middlewareData:ee}=O_({strategy:"fixed",placement:I,whileElementsMounted:rr((...Wn)=>j_(...Wn,{animationFrame:_===Rg.Always}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[M_({mainAxis:u+Y,alignmentAxis:h}),g&&A_({mainAxis:!0,crossAxis:!1,...k===Eg.Partial?{limiter:L_()}:{},...H}),g&&I_({...H}),z_({...H,apply:rr(({elements:Wn,rects:wt,availableWidth:Ci,availableHeight:ys})=>{const{width:ro,height:vr}=wt.reference,xr=Wn.floating.style;xr.setProperty("--radix-popper-available-width",`${Ci}px`),xr.setProperty("--radix-popper-available-height",`${ys}px`),xr.setProperty("--radix-popper-anchor-width",`${ro}px`),xr.setProperty("--radix-popper-anchor-height",`${vr}px`)},"apply")}),P&&$_({element:P,padding:v}),J_({arrowWidth:U,arrowHeight:Y}),w&&F_(X?{strategy:"referenceHidden",...H}:{strategy:"referenceHidden",padding:H.padding,altBoundary:H.altBoundary})]}),z=S.setPlacementState;Rt(()=>(z(ie),()=>{z(void 0)}),[ie,z]);const[D,K]=Nl(ie),de=Ln(b);Rt(()=>{V&&(de==null||de())},[V,de]);const we=(be=ee.arrow)==null?void 0:be.x,L=(Ye=ee.arrow)==null?void 0:Ye.y,q=((Ct=ee.arrow)==null?void 0:Ct.centerOffset)!==0,[ve,Ce]=m.useState();return Rt(()=>{R&&Ce(window.getComputedStyle(R).zIndex)},[R]),r.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:V?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(Bt=ee.transformOrigin)==null?void 0:Bt.x,(yt=ee.transformOrigin)==null?void 0:yt.y].join(" "),...((ut=ee.hide)==null?void 0:ut.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:o.dir,children:r.jsx(K_,{scope:a,placedSide:D,placedAlign:K,onArrowChange:M,arrowX:we,arrowY:L,shouldHideArrow:q,children:r.jsx(Ue.div,{"data-side":D,"data-align":K,...C,ref:E,style:{...C.style,animation:V?(gr=C.style)==null?void 0:gr.animation:"none"}})})})},"PopperContent")),Y_="PopperArrow",Q_={top:"bottom",right:"left",bottom:"top",left:"right"},X_=m.forwardRef(rr(function(o,s){const{__scopePopper:a,...l}=o,u=q_(Y_,a),d=Q_[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(W_,{...l,ref:s,style:{...l.style,display:"block"}})})},"PopperArrow"));function My(t){return t!==null}rr(My,"isNotNull");var J_=rr(t=>({name:"transformOrigin",options:t,fn(o){var C,S,R;const{placement:s,rects:a,middlewareData:l}=o,d=((C=l.arrow)==null?void 0:C.centerOffset)!==0,h=d?0:t.arrowWidth,v=d?0:t.arrowHeight,[g,y]=Nl(s),x={start:"0%",center:"50%",end:"100%"}[y],k=(((S=l.arrow)==null?void 0:S.x)??0)+h/2,w=(((R=l.arrow)==null?void 0:R.y)??0)+v/2;let _="",b="";return g==="bottom"?(_=d?x:`${k}px`,b=`${-v}px`):g==="top"?(_=d?x:`${k}px`,b=`${a.floating.height+v}px`):g==="right"?(_=`${-v}px`,b=d?x:`${w}px`):g==="left"&&(_=`${a.floating.width+v}px`,b=d?x:`${w}px`),{data:{x:_,y:b}}}}),"transformOrigin");function Nl(t){const[o,s="center"]=t.split("-");return[o,s]}rr(Nl,"getSideAndAlignFromPlacement");var Z_=Object.defineProperty,vf=(t,o)=>Z_(t,"name",{value:o,configurable:!0}),Fu=!1;function Ay(){const[t,o]=m.useState(Fu);return m.useEffect(()=>{Fu||(Fu=!0,o(!0))},[]),t}vf(Ay,"useIsHydrated");var Ly=Xr[" useSyncExternalStore ".trim().toString()];function Iy(){return()=>{}}vf(Iy,"subscribe");function zy(){return Ly(Iy,()=>!0,()=>!1)}vf(zy,"useIsHydratedModern");var eN=typeof Ly=="function"?zy:Ay,tN=Object.defineProperty,_o=(t,o)=>tN(t,"name",{value:o,configurable:!0}),$u="rovingFocusGroup.onEntryFocus",nN={bubbles:!1,cancelable:!0},El="RovingFocusGroup",[gd,Fy,rN]=Ud(El),[oN,$y]=bn(El,[rN]),Pg={Vertical:"vertical",Horizontal:"horizontal"},sN={RTL:"rtl"},[iN,aN]=oN(El),lN=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(cN,{...o,ref:s})})})},"RovingFocusGroup")),cN=m.forwardRef(_o(function(o,s){const{__scopeRovingFocusGroup:a,orientation:l,loop:u=!1,dir:d,currentTabStopId:h,defaultCurrentTabStopId:v,onCurrentTabStopIdChange:g,onEntryFocus:y,preventScrollOnEntryFocus:x=!1,...k}=o,w=m.useRef(null),_=Fe(s,w),b=Wd(d),[C,S]=gs({prop:h,defaultProp:v??null,onChange:g,caller:El}),[R,N]=m.useState(!1),E=Ln(y),P=Fy(a),M=m.useRef(!1),[F,U]=m.useState(0);return m.useEffect(()=>{const Y=w.current;if(Y)return Y.addEventListener($u,E),()=>Y.removeEventListener($u,E)},[E]),r.jsx(iN,{scope:a,orientation:l,dir:b,loop:u,currentTabStopId:C,onItemFocus:m.useCallback(Y=>S(Y),[S]),onItemShiftTab:m.useCallback(()=>N(!0),[]),onFocusableItemAdd:m.useCallback(()=>U(Y=>Y+1),[]),onFocusableItemRemove:m.useCallback(()=>U(Y=>Y-1),[]),children:r.jsx(Ue.div,{tabIndex:R||F===0?-1:0,"data-orientation":l,...k,ref:_,style:{outline:"none",...o.style},onMouseDown:Pe(o.onMouseDown,()=>{M.current=!0}),onFocus:Pe(o.onFocus,Y=>{const I=!M.current;if(Y.target===Y.currentTarget&&I&&!R){const G=new CustomEvent($u,nN);if(Y.currentTarget.dispatchEvent(G),!G.defaultPrevented){const re=P().filter(ie=>ie.focusable),X=re.find(ie=>ie.active),H=re.find(ie=>ie.id===C),le=[X,H,...re].filter(Boolean).map(ie=>ie.ref.current);xf(le,x)}}M.current=!1}),onBlur:Pe(o.onBlur,()=>N(!1))})})},"RovingFocusGroupImpl")),uN="RovingFocusGroupItem",dN=m.forwardRef(_o(function(o,s){const{__scopeRovingFocusGroup:a,focusable:l=!0,active:u=!1,tabStopId:d,children:h,...v}=o,g=Hr(),y=d||g,x=aN(uN,a),k=x.currentTabStopId===y,w=Fy(a),{onFocusableItemAdd:_,onFocusableItemRemove:b,currentTabStopId:C}=x,S=eN();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:y,focusable:l,active:u,children:r.jsx(Ue.span,{tabIndex:k?0:-1,"data-orientation":x.orientation,...v,ref:s,onMouseDown:Pe(o.onMouseDown,R=>{l?x.onItemFocus(y):R.preventDefault()}),onFocus:Pe(o.onFocus,()=>x.onItemFocus(y)),onKeyDown:Pe(o.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){x.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const N=By(R,x.orientation,x.dir);if(N!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let P=w().filter(M=>M.focusable).map(M=>M.ref.current);if(N==="last")P.reverse();else if(N==="prev"||N==="next"){N==="prev"&&P.reverse();const M=P.indexOf(R.currentTarget);P=x.loop?Wy(P,M+1):P.slice(M+1)}setTimeout(()=>xf(P))}}),children:typeof h=="function"?h({isCurrentTabStop:k,hasTabStop:C!=null}):h})})},"RovingFocusGroupItem")),fN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uy(t,o){return o!==sN.RTL?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}_o(Uy,"getDirectionAwareKey");function By(t,o,s){const a=Uy(t.key,s);if(!(o===Pg.Vertical&&["ArrowLeft","ArrowRight"].includes(a))&&!(o===Pg.Horizontal&&["ArrowUp","ArrowDown"].includes(a)))return fN[a]}_o(By,"getFocusIntent");function xf(t,o=!1){const s=document.activeElement;for(const a of t)if(a===s||(a.focus({preventScroll:o}),document.activeElement!==s))return}_o(xf,"focusFirst");function Wy(t,o){return t.map((s,a)=>t[(o+a)%t.length])}_o(Wy,"wrapArray");var hN=Object.defineProperty,Le=(t,o)=>hN(t,"name",{value:o,configurable:!0}),pN=["Enter"," "],mN=["ArrowDown","PageUp","Home"],Vy=["ArrowUp","PageDown","End"],gN=[...mN,...Vy],Rl="Menu",[vd,vN,xN]=Ud(Rl),[No,Hy]=bn(Rl,[xN,_l,$y]),yf=_l(),Gy=$y(),[yN,xi]=No(Rl),[wN,wf]=No(Rl),bN=Le(t=>{const{__scopeMenu:o,open:s=!1,children:a,dir:l,onOpenChange:u,modal:d=!0}=t,h=yf(o),[v,g]=m.useState(null),y=m.useRef(!1),x=Ln(u),k=Wd(l);return m.useEffect(()=>{const w=Le(()=>{y.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},"handleKeyDown"),_=Le(()=>y.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),m.useEffect(()=>{if(!s)return;const w=Le(()=>x(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[s,x]),r.jsx(Py,{...h,children:r.jsx(yN,{scope:o,open:s,onOpenChange:x,content:v,onContentChange:g,children:r.jsx(wN,{scope:o,onClose:m.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:y,dir:k,modal:d,children:a})})})},"Menu"),jN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,...l}=o,u=yf(a);return r.jsx(Ty,{...u,...l,ref:s})},"MenuAnchor")),Ky="MenuPortal",[kN,CN]=No(Ky,{forceMount:void 0}),SN=Le(t=>{const{__scopeMenu:o,forceMount:s,children:a,container:l}=t,u=xi(Ky,o);return r.jsx(kN,{scope:o,forceMount:s,children:r.jsx(ur,{present:s||u.open,children:r.jsx(Qd,{asChild:!0,container:l,children:a})})})},"MenuPortal"),Gr="MenuContent",[_N,qy]=No(Gr),NN=m.forwardRef(Le(function(o,s){const a=CN(Gr,o.__scopeMenu),{forceMount:l=a.forceMount,...u}=o,d=xi(Gr,o.__scopeMenu),h=wf(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(EN,{...u,ref:s}):r.jsx(RN,{...u,ref:s})})})})},"MenuContent")),EN=m.forwardRef(Le(function(o,s){const a=xi(Gr,o.__scopeMenu),l=m.useRef(null),u=Fe(s,l);return m.useEffect(()=>{const d=l.current;if(d)return ay(d)},[]),r.jsx(Yy,{...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")),RN=m.forwardRef(Le(function(o,s){const a=xi(Gr,o.__scopeMenu);return r.jsx(Yy,{...o,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})},"MenuRootContentNonModal")),PN=or("MenuContent.ScrollLock"),Yy=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,loop:l=!1,trapFocus:u,onOpenAutoFocus:d,onCloseAutoFocus:h,disableOutsidePointerEvents:v,onEntryFocus:g,onEscapeKeyDown:y,onPointerDownOutside:x,onFocusOutside:k,onInteractOutside:w,onDismiss:_,disableOutsideScroll:b,...C}=o,S=xi(Gr,a),R=wf(Gr,a),N=yf(a),E=Gy(a),P=vN(a),[M,F]=m.useState(null),U=m.useRef(null),[Y,I]=m.useState(null);qd(Y);const{nodes:G,registry:re}=Kd(),X=!!(u||b),H=Fe(s,U,S.onContentChange,I),ce=m.useRef(0),le=m.useRef(""),ie=m.useRef(0),V=m.useRef(null),ee=m.useRef("right"),z=m.useRef(0),D=m.useMemo(()=>b?[U,...G.map(q=>({current:q}))]:[],[U,G,b]),K=b?Jd:m.Fragment,de=b?{as:PN,allowPinchZoom:!0,shards:D}:void 0,we=Le(q=>{var gr,Wn;const ve=le.current+q,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=ew(Ct,ve,Ye),yt=(Wn=Ce.find(wt=>wt.textValue===Bt))==null?void 0:Wn.ref.current;function ut(wt){le.current=wt,window.clearTimeout(ce.current),wt!==""&&(ce.current=window.setTimeout(()=>ut(""),1e3))}Le(ut,"updateSearch"),ut(ve),yt&&setTimeout(()=>yt.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(ce.current),[]),xl();const L=m.useCallback(q=>{var Ce,be;return ee.current===((Ce=V.current)==null?void 0:Ce.side)&&nw(q,(be=V.current)==null?void 0:be.area)},[]);return r.jsx(_N,{scope:a,searchRef:le,onItemEnter:m.useCallback(q=>{L(q)&&q.preventDefault()},[L]),onItemLeave:m.useCallback(q=>{var ve;L(q)||((ve=U.current)==null||ve.focus(),F(null))},[L]),onTriggerLeave:m.useCallback(q=>{L(q)&&q.preventDefault()},[L]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:m.useCallback(q=>{V.current=q},[]),children:r.jsx(Gd,{registry:X?re:null,children:r.jsx(K,{...de,children:r.jsx(Hx,{asChild:!0,trapped:u,branches:G,onMountAutoFocus:Pe(d,q=>{var ve;q.preventDefault(),(ve=U.current)==null||ve.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:r.jsx(Vd,{asChild:!0,disableOutsidePointerEvents:v,onEscapeKeyDown:y,onPointerDownOutside:x,onFocusOutside:k,onInteractOutside:w,onDismiss:_,children:r.jsx(lN,{asChild:!0,...E,dir:R.dir,orientation:"vertical",loop:l,currentTabStopId:M,onCurrentTabStopIdChange:F,onEntryFocus:Pe(g,q=>{R.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(Dy,{role:"menu","aria-orientation":"vertical","data-state":Xy(S.open),"data-radix-menu-content":"",dir:R.dir,...N,...C,ref:H,style:{outline:"none",...C.style},onKeyDown:Pe(C.onKeyDown,q=>{const Ce=q.target.closest("[data-radix-menu-content]")===q.currentTarget,be=q.ctrlKey||q.altKey||q.metaKey,Ye=q.key.length===1;Ce&&(q.key==="Tab"&&q.preventDefault(),!be&&Ye&&we(q.key));const Ct=U.current;if(q.target!==Ct||!gN.includes(q.key))return;q.preventDefault();const yt=P().filter(ut=>!ut.disabled).map(ut=>ut.ref.current);Vy.includes(q.key)&&yt.reverse(),Jy(yt)}),onBlur:Pe(o.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(ce.current),le.current="")}),onPointerMove:Pe(o.onPointerMove,al(q=>{const ve=q.target,Ce=z.current!==q.clientX;if(q.currentTarget.contains(ve)&&Ce){const be=q.clientX>z.current?"right":"left";ee.current=be,z.current=q.clientX}}))})})})})})})})},"MenuContentImpl")),TN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,...l}=o;return r.jsx(Ue.div,{role:"group",...l,ref:s})},"MenuGroup")),ON=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,...l}=o;return r.jsx(Ue.div,{...l,ref:s})},"MenuLabel")),xd="MenuItem",Tg="menu.itemSelect",DN=m.forwardRef(Le(function(o,s){const{disabled:a=!1,onSelect:l,...u}=o,d=m.useRef(null),h=wf(xd,o.__scopeMenu),v=qy(xd,o.__scopeMenu),g=Fe(s,d),y=m.useRef(!1),x=Le(()=>{const k=d.current;if(!a&&k){const w=new CustomEvent(Tg,{bubbles:!0,cancelable:!0});k.addEventListener(Tg,_=>l==null?void 0:l(_),{once:!0}),$d(k,w),w.defaultPrevented?y.current=!1:h.onClose()}},"handleSelect");return r.jsx(MN,{...u,ref:g,disabled:a,onClick:Pe(o.onClick,x),onPointerDown:k=>{var w;(w=o.onPointerDown)==null||w.call(o,k),y.current=!0},onPointerUp:Pe(o.onPointerUp,k=>{var w;y.current||(w=k.currentTarget)==null||w.click()}),onKeyDown:Pe(o.onKeyDown,k=>{a||k.target!==k.currentTarget||v.searchRef.current!==""&&k.key===" "||pN.includes(k.key)&&(k.currentTarget.click(),k.preventDefault())})})},"MenuItem")),MN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,disabled:l=!1,textValue:u,...d}=o,h=qy(xd,a),v=Gy(a),g=m.useRef(null),y=Fe(s,g),[x,k]=m.useState(!1),[w,_]=m.useState("");return m.useEffect(()=>{const b=g.current;b&&_((b.textContent??"").trim())},[d.children]),r.jsx(vd.ItemSlot,{scope:a,disabled:l,textValue:u??w,children:r.jsx(dN,{asChild:!0,...v,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:y,onPointerMove:Pe(o.onPointerMove,al(b=>{l?h.onItemLeave(b):(h.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(o.onPointerLeave,al(b=>h.onItemLeave(b))),onFocus:Pe(o.onFocus,()=>k(!0)),onBlur:Pe(o.onBlur,()=>k(!1))})})})},"MenuItemImpl")),AN="MenuRadioGroup",[LN,IN]=No(AN,{value:void 0,onValueChange:Le(()=>{},"onValueChange")}),zN=m.forwardRef(Le(function(o,s){const{value:a,onValueChange:l,...u}=o,d=Ln(l);return r.jsx(LN,{scope:o.__scopeMenu,value:a,onValueChange:d,children:r.jsx(TN,{...u,ref:s})})},"MenuRadioGroup")),FN="MenuRadioItem",$N=m.forwardRef(Le(function(o,s){const{value:a,...l}=o,u=IN(FN,o.__scopeMenu),d=a===u.value;return r.jsx(UN,{scope:o.__scopeMenu,checked:d,children:r.jsx(DN,{role:"menuitemradio","aria-checked":d,...l,ref:s,"data-state":jf(d),onSelect:Pe(l.onSelect,()=>{var h;return(h=u.onValueChange)==null?void 0:h.call(u,a)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Qy="MenuItemIndicator",[UN,BN]=No(Qy,{checked:!1}),WN=m.forwardRef(Le(function(o,s){const{__scopeMenu:a,forceMount:l,...u}=o,d=BN(Qy,a);return r.jsx(ur,{present:l||bf(d.checked)||d.checked===!0,children:r.jsx(Ue.span,{...u,ref:s,"data-state":jf(d.checked)})})},"MenuItemIndicator")),VN=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")),HN="MenuSub",[KR,qR]=No(HN);function Xy(t){return t?"open":"closed"}Le(Xy,"getOpenState");function bf(t){return t==="indeterminate"}Le(bf,"isIndeterminate");function jf(t){return bf(t)?"indeterminate":t?"checked":"unchecked"}Le(jf,"getCheckedState");function Jy(t){const o=document.activeElement;for(const s of t)if(s===o||(s.focus(),document.activeElement!==o))return}Le(Jy,"focusFirst");function Zy(t,o){return t.map((s,a)=>t[(o+a)%t.length])}Le(Zy,"wrapArray");function ew(t,o,s){const l=o.length>1&&Array.from(o).every(g=>g===o[0])?o[0]:o,u=s?t.indexOf(s):-1;let d=Zy(t,Math.max(u,0));l.length===1&&(d=d.filter(g=>g!==s));const v=d.find(g=>g.toLowerCase().startsWith(l.toLowerCase()));return v!==s?v:void 0}Le(ew,"getNextMatch");function tw(t,o){const{x:s,y:a}=t;let l=!1;for(let u=0,d=o.length-1;ua!=k>a&&s<(x-g)*(a-y)/(k-y)+g&&(l=!l)}return l}Le(tw,"isPointInPolygon");function nw(t,o){if(!o)return!1;const s={x:t.clientX,y:t.clientY};return tw(s,o)}Le(nw,"isPointerInGraceArea");function al(t){return o=>o.pointerType==="mouse"?t(o):void 0}Le(al,"whenMouse");var GN=Object.defineProperty,pr=(t,o)=>GN(t,"name",{value:o,configurable:!0}),kf="DropdownMenu",[KN,YR]=bn(kf,[Hy]),mr=Hy(),[qN,rw]=KN(kf),YN=pr(t=>{const{__scopeDropdownMenu:o,children:s,dir:a,open:l,defaultOpen:u,onOpenChange:d,modal:h=!0}=t,v=mr(o),g=m.useRef(null),[y,x]=gs({prop:l,defaultProp:u??!1,onChange:d,caller:kf});return r.jsx(qN,{scope:o,triggerId:Hr(),triggerRef:g,contentId:Hr(),open:y,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(k=>!k),[x]),modal:h,children:r.jsx(bN,{...v,open:y,onOpenChange:x,dir:a,modal:h,children:s})})},"DropdownMenu"),QN="DropdownMenuTrigger",XN=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,disabled:l=!1,...u}=o,d=rw(QN,a),h=mr(a),v=Fe(s,d.triggerRef);return r.jsx(jN,{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:v,onPointerDown:Pe(o.onPointerDown,g=>{!l&&g.button===0&&g.ctrlKey===!1&&(d.onOpenToggle(),d.open||g.preventDefault())}),onKeyDown:Pe(o.onKeyDown,g=>{l||(["Enter"," "].includes(g.key)&&d.onOpenToggle(),g.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})},"DropdownMenuTrigger")),JN=pr(t=>{const{__scopeDropdownMenu:o,...s}=t,a=mr(o);return r.jsx(SN,{...a,...s})},"DropdownMenuPortal"),ZN="DropdownMenuContent",eE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=rw(ZN,a),d=mr(a),h=m.useRef(!1);return r.jsx(NN,{id:u.contentId,"aria-labelledby":u.triggerId,...d,...l,ref:s,onCloseAutoFocus:Pe(o.onCloseAutoFocus,v=>{var g;h.current||(g=u.triggerRef.current)==null||g.focus(),h.current=!1,v.preventDefault()}),onInteractOutside:Pe(o.onInteractOutside,v=>{const g=v.detail.originalEvent,y=g.button===0&&g.ctrlKey===!0,x=g.button===2||y;(!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")),tE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx(ON,{...u,...l,ref:s})},"DropdownMenuLabel")),nE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx(zN,{...u,...l,ref:s})},"DropdownMenuRadioGroup")),rE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx($N,{...u,...l,ref:s})},"DropdownMenuRadioItem")),oE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx(WN,{...u,...l,ref:s})},"DropdownMenuItemIndicator")),sE=m.forwardRef(pr(function(o,s){const{__scopeDropdownMenu:a,...l}=o,u=mr(a);return r.jsx(VN,{...u,...l,ref:s})},"DropdownMenuSeparator")),iE=Object.defineProperty,aE=(t,o)=>iE(t,"name",{value:o,configurable:!0}),lE=m.forwardRef(aE(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")),cE=Object.defineProperty,ow=(t,o)=>cE(t,"name",{value:o,configurable:!0}),Cf={Horizontal:"horizontal",Vertical:"vertical"},Og=Cf.Horizontal,uE=Object.values(Cf),dE=m.forwardRef(ow(function(o,s){const{decorative:a,orientation:l=Og,...u}=o,d=sw(l)?l:Og,h=d===Cf.Vertical?d:void 0,v=a?{role:"none"}:{"aria-orientation":h,role:"separator"};return r.jsx(Ue.div,{"data-orientation":d,...v,...u,ref:s})},"Separator"));function sw(t){return uE.includes(t)}ow(sw,"isValidOrientation");var fE=Object.defineProperty,lt=(t,o)=>fE(t,"name",{value:o,configurable:!0}),[Sf,QR]=bn("Tooltip",[_l]),Pl=_l(),hE="TooltipProvider",pE=700,yd="tooltip.open",[mE,_f]=Sf(hE),gE=lt(t=>{const{__scopeTooltip:o,delayDuration:s=pE,skipDelayDuration:a=300,disableHoverableContent:l=!1,children:u}=t,d=m.useRef(!0),h=m.useRef(!1),v=m.useRef(0);return m.useEffect(()=>{const g=v.current;return()=>window.clearTimeout(g)},[]),r.jsx(mE,{scope:o,isOpenDelayedRef:d,delayDuration:s,onOpen:m.useCallback(()=>{a<=0||(window.clearTimeout(v.current),d.current=!1)},[a]),onClose:m.useCallback(()=>{a<=0||(window.clearTimeout(v.current),v.current=window.setTimeout(()=>d.current=!0,a))},[a]),isPointerInTransitRef:h,onPointerInTransitChange:m.useCallback(g=>{h.current=g},[]),disableHoverableContent:l,children:u})},"TooltipProvider"),wd="Tooltip",[vE,yi]=Sf(wd),xE=lt(t=>{const{__scopeTooltip:o,children:s,open:a,defaultOpen:l,onOpenChange:u,disableHoverableContent:d,delayDuration:h}=t,v=_f(wd,t.__scopeTooltip),g=Pl(o),[y,x]=m.useState(null),[k,w]=m.useState(void 0),_=Hr(),b=m.useRef(0),C=d??v.disableHoverableContent,S=h??v.delayDuration,R=m.useRef(!1),[N,E]=gs({prop:a,defaultProp:l??!1,onChange:lt(I=>{I?(v.onOpen(),document.dispatchEvent(new CustomEvent(yd))):v.onClose(),u==null||u(I)},"onChange"),caller:wd}),P=m.useMemo(()=>N?R.current?"delayed-open":"instant-open":"closed",[N]),M=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]),U=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 Y=k??_;return r.jsx(Py,{...g,children:r.jsx(vE,{scope:o,contentId:Y,setContentId:w,open:N,stateAttribute:P,trigger:y,onTriggerChange:x,onTriggerEnter:m.useCallback(()=>{v.isOpenDelayedRef.current?U():M()},[v.isOpenDelayedRef,U,M]),onTriggerLeave:m.useCallback(()=>{C?F():(window.clearTimeout(b.current),b.current=0)},[F,C]),onOpen:M,onClose:F,disableHoverableContent:C,children:s})})},"Tooltip"),Dg="TooltipTrigger",yE=m.forwardRef(lt(function(o,s){const{__scopeTooltip:a,"aria-describedby":l,...u}=o,d=yi(Dg,a),h=_f(Dg,a),v=Pl(a),g=m.useRef(null),y=Fe(s,g,d.onTriggerChange),x=m.useRef(!1),k=m.useRef(!1),w=m.useCallback(()=>x.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",w),[w]),r.jsx(Ty,{asChild:!0,...v,children:r.jsx(Ue.button,{"aria-describedby":d.open?pw(l,d.contentId):l,"data-state":d.stateAttribute,...u,ref:y,onPointerMove:Pe(o.onPointerMove,_=>{_.pointerType!=="touch"&&!k.current&&!h.isPointerInTransitRef.current&&(d.onTriggerEnter(),k.current=!0)}),onPointerLeave:Pe(o.onPointerLeave,()=>{d.onTriggerLeave(),k.current=!1}),onPointerDown:Pe(o.onPointerDown,()=>{d.open&&d.onClose(),x.current=!0,document.addEventListener("pointerup",w,{once:!0})}),onFocus:Pe(o.onFocus,()=>{x.current||d.onOpen()}),onBlur:Pe(o.onBlur,d.onClose),onClick:Pe(o.onClick,d.onClose)})})},"TooltipTrigger")),iw="TooltipPortal",[wE,bE]=Sf(iw,{forceMount:void 0}),jE=lt(t=>{const{__scopeTooltip:o,forceMount:s,children:a,container:l}=t,u=yi(iw,o);return r.jsx(wE,{scope:o,forceMount:s,children:r.jsx(ur,{present:s||u.open,children:r.jsx(Qd,{asChild:!0,container:l,children:a})})})},"TooltipPortal"),pi="TooltipContent",kE=m.forwardRef(lt(function(o,s){const a=bE(pi,o.__scopeTooltip),{forceMount:l=a.forceMount,side:u="top",...d}=o,h=yi(pi,o.__scopeTooltip);return r.jsx(ur,{present:l||h.open,children:h.disableHoverableContent?r.jsx(aw,{side:u,...d,ref:s}):r.jsx(CE,{side:u,...d,ref:s})})},"TooltipContent")),CE=m.forwardRef(lt(function(o,s){const a=yi(pi,o.__scopeTooltip),l=_f(pi,o.__scopeTooltip),u=m.useRef(null),d=Fe(s,u),[h,v]=m.useState(null),{trigger:g,onClose:y}=a,x=u.current,{onPointerInTransitChange:k}=l,w=m.useCallback(()=>{v(null),k(!1)},[k]),_=m.useCallback((b,C)=>{const S=b.currentTarget,R={x:b.clientX,y:b.clientY},N=lw(R,S.getBoundingClientRect()),E=cw(R,N),P=uw(C.getBoundingClientRect()),M=fw([...E,...P]);v(M),k(!0)},[k]);return m.useEffect(()=>()=>w(),[w]),m.useEffect(()=>{if(g&&x){const b=lt(S=>_(S,x),"handleTriggerLeave"),C=lt(S=>_(S,g),"handleContentLeave");return g.addEventListener("pointerleave",b),x.addEventListener("pointerleave",C),()=>{g.removeEventListener("pointerleave",b),x.removeEventListener("pointerleave",C)}}},[g,x,_,w]),m.useEffect(()=>{if(h){const b=lt(C=>{const S=C.target,R={x:C.clientX,y:C.clientY},N=(g==null?void 0:g.contains(S))||(x==null?void 0:x.contains(S)),E=!dw(R,h);N?w():E&&(w(),y())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[g,x,h,y,w]),r.jsx(aw,{...o,ref:d})},"TooltipContentHoverable")),SE=xx("TooltipContent"),aw=m.forwardRef(lt(function(o,s){const{__scopeTooltip:a,children:l,"aria-label":u,id:d,onEscapeKeyDown:h,onPointerDownOutside:v,...g}=o,y=yi(pi,a),x=Pl(a),{onClose:k}=y,[w,_]=m.useState(null),b=Fe(s,_);qd(w),m.useEffect(()=>(document.addEventListener(yd,k),()=>document.removeEventListener(yd,k)),[k]),m.useEffect(()=>{if(y.trigger){const S=lt(R=>{R.target instanceof Node&&R.target.contains(y.trigger)&&k()},"handleScroll");return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[y.trigger,k]);const{setContentId:C}=y;return Rt(()=>(C(d),()=>{C(void 0)}),[d,C]),r.jsx(Vd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:S=>S.preventDefault(),onDismiss:k,children:r.jsxs(Dy,{"data-state":y.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:y.contentId,...x,...g,ref:b,style:{...g.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(SE,{children:l}),u?r.jsx(I1,{id:y.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl")),_E=m.forwardRef(lt(function(o,s){const{__scopeTooltip:a,...l}=o,u=Pl(a);return r.jsx(X_,{...u,...l,ref:s})},"TooltipArrow"));function lw(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")}}lt(lw,"getExitSideFromRect");function cw(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}lt(cw,"getPaddedExitPoints");function uw(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}]}lt(uw,"getPointsFromRect");function dw(t,o){const{x:s,y:a}=t;let l=!1;for(let u=0,d=o.length-1;ua!=k>a&&s<(x-g)*(a-y)/(k-y)+g&&(l=!l)}return l}lt(dw,"isPointInPolygon");function fw(t){const o=t.slice();return o.sort((s,a)=>s.xa.x?1:s.ya.y?1:0),hw(o)}lt(fw,"getHull");function hw(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)}lt(hw,"getHullPresorted");function pw(...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}lt(pw,"concatAriaDescribedby");const NE=vl("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 oe({className:t,variant:o="default",size:s="default",asChild:a=!1,...l}){const u=a?zd:"button";return r.jsx(u,{"data-slot":"button","data-variant":o,"data-size":s,className:ae(NE({variant:o,size:s,className:t})),...l})}const ll=new Map,bd=new Set,Uu=()=>bd.forEach(t=>t()),jd=()=>ll.size>0;function Nf(t,o){const s=m.useRef(o);s.current=o;const a=!!o&&o.count>0;m.useEffect(()=>{if(a)return ll.set(t,{get label(){var l;return((l=s.current)==null?void 0:l.label)??""},get count(){var l;return((l=s.current)==null?void 0:l.count)??0},save:()=>{var l;return(l=s.current)==null?void 0:l.save()},discard:()=>{var l;return(l=s.current)==null?void 0:l.discard()}}),Uu(),()=>{ll.delete(t),Uu()}},[t,a]),m.useEffect(()=>{a&&Uu()},[a,o==null?void 0:o.count])}const Mg="You have unsaved changes. Leave this page and lose them?";function EE(){const[,t]=m.useState(0);m.useEffect(()=>{const s=()=>t(a=>a+1);return bd.add(s),()=>{bd.delete(s)}},[]),m.useEffect(()=>{const s=l=>{jd()&&(l.preventDefault(),l.returnValue=Mg)},a=l=>{var h,v;if(!jd()||l.defaultPrevented||l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey)return;const u=(v=(h=l.target)==null?void 0:h.closest)==null?void 0:v.call(h,"a[href]");if(!u||u.target==="_blank"||u.hasAttribute("download"))return;const d=new URL(u.href,location.href);d.origin!==location.origin||d.pathname===location.pathname&&d.search===location.search||window.confirm(Mg)||(l.preventDefault(),l.stopPropagation())};return window.addEventListener("beforeunload",s),document.addEventListener("click",a,!0),()=>{window.removeEventListener("beforeunload",s),document.removeEventListener("click",a,!0)}},[]);const o=[...ll.entries()];return o.length?r.jsx("div",{role:"region","aria-label":"Unsaved changes",className:"sticky bottom-0 z-20 border-t bg-background/95 px-4 py-3 shadow-[0_-4px_12px_rgb(0_0_0/0.06)] backdrop-blur md:px-6",children:r.jsx("div",{className:"mx-auto grid w-full max-w-7xl gap-2",children:o.map(([s,a])=>r.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[r.jsx("span",{className:"size-2 shrink-0 rounded-full bg-warning","aria-hidden":!0}),r.jsxs("span",{className:"font-medium",children:[a.label,":"]}),r.jsxs("span",{className:"text-muted-foreground",children:[a.count," unsaved change",a.count===1?"":"s"]}),r.jsx("span",{className:"flex-1"}),r.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>a.discard(),children:"Discard"}),r.jsx(oe,{size:"sm",onClick:()=>a.save(),children:"Save"})]},s))})}):null}function RE({show:t}){return t?r.jsx("span",{className:"ml-2 rounded-md bg-warning/15 px-1.5 py-0.5 align-middle text-xs font-medium text-warning",children:"Unsaved"}):null}function Ef(t,o,s){return(s??Array.from(new Set([...Object.keys(t),...Object.keys(o)]))).filter(l=>JSON.stringify(t[l]??null)!==JSON.stringify(o[l]??null)).length}let mw="";function Ag(t){mw=t}class Wa extends Error{constructor(o,s){super(o),this.status=s}}async function wi(t,o,s,a=!1){const l={};a&&(l["X-Background"]="1"),t!=="GET"&&(l["X-CSRF-Token"]=mw),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 t!=="GET"||jd()?(window.dispatchEvent(new Event("crc-signed-out")),new Wa("Your session ended: sign in again to save. Your changes are kept on this page.",401)):(location.href="/admin/login?next="+encodeURIComponent(location.pathname+location.search),new Wa("signed out",401));const d=await u.json().catch(()=>({}));if(!u.ok)throw new Wa(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 Wa("",202);return d}const Ve=t=>wi("GET",t),PE=t=>wi("GET",t,void 0,!0),Qt=(t,o)=>wi("POST",t,o),kn=(t,o)=>wi("PUT",t,o),Eo=t=>wi("DELETE",t);function kd(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 Kr(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 ze(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 Cd(t){if(!t)return"—";const o=Math.round(t/1e3);return o<60?o+"s":Math.floor(o/60)+"m "+o%60+"s"}const gw=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric"}),TE=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}),OE=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function DE(t){const o=new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(s=>s.type==="timeZoneName");return o?o.value:""}function mi(t){const o=typeof t=="string"?new Date(t):t;return isNaN(o.getTime())?"":gw.format(o)}const ME=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}),AE=new Intl.DateTimeFormat("en-GB",{month:"short",year:"numeric",timeZone:"UTC"});function LE(t){const o=new Date(t);return isNaN(o.getTime())?"":ME.format(o)}function IE(t){const o=new Date(t);return isNaN(o.getTime())?"":AE.format(o)}function Qr(t,o=!1){const s=typeof t=="string"?new Date(t):t;return isNaN(s.getTime())?"":gw.format(s)+", "+(o?OE:TE).format(s)+" "+DE(s)}function Tl(t){const o=typeof t=="string"?new Date(t):t;return isNaN(o.getTime())?"":o.toISOString().replace("T"," ").replace(/\.\d+Z$/," UTC")}function Lg(t){return Qr(t)}const zE=vl("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 Mn({className:t,variant:o,...s}){return r.jsx("div",{"data-slot":"alert",role:"alert",className:ae(zE({variant:o}),t),...s})}function vw({className:t,...o}){return r.jsx("div",{"data-slot":"alert-title",className:ae("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...o})}function An({className:t,...o}){return r.jsx("div",{"data-slot":"alert-description",className:ae("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",t),...o})}function FE({...t}){return r.jsx(fS,{"data-slot":"alert-dialog",...t})}function $E({...t}){return r.jsx(hS,{"data-slot":"alert-dialog-portal",...t})}function UE({className:t,...o}){return r.jsx(pS,{"data-slot":"alert-dialog-overlay",className:ae("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 BE({className:t,size:o="default",...s}){return r.jsxs($E,{children:[r.jsx(UE,{}),r.jsx(xS,{"data-slot":"alert-dialog-content","data-size":o,className:ae("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 WE({className:t,...o}){return r.jsx("div",{"data-slot":"alert-dialog-header",className:ae("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 VE({className:t,...o}){return r.jsx("div",{"data-slot":"alert-dialog-footer",className:ae("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 HE({className:t,...o}){return r.jsx(yS,{"data-slot":"alert-dialog-title",className:ae("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 GE({className:t,...o}){return r.jsx(wS,{"data-slot":"alert-dialog-description",className:ae("text-sm text-muted-foreground",t),...o})}function KE({className:t,variant:o="default",size:s="default",...a}){return r.jsx(oe,{variant:o,size:s,asChild:!0,children:r.jsx(bS,{"data-slot":"alert-dialog-action",className:ae(t),...a})})}function qE({className:t,variant:o="outline",size:s="default",...a}){return r.jsx(oe,{variant:o,size:s,asChild:!0,children:r.jsx(kS,{"data-slot":"alert-dialog-cancel",className:ae(t),...a})})}const YE=vl("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?zd:"span";return r.jsx(l,{"data-slot":"badge","data-variant":o,className:ae(YE({variant:o}),t),...a})}function xe({className:t,type:o,...s}){return r.jsx("input",{type:o,"data-slot":"input",className:ae("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 xw({className:t,...o}){return r.jsx(lE,{"data-slot":"label",className:ae("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 st({className:t,...o}){return r.jsx("div",{"data-slot":"card",className:ae("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...o})}function Xt({className:t,...o}){return r.jsx("div",{"data-slot":"card-header",className:ae("@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 un({className:t,...o}){return r.jsx("div",{"data-slot":"card-title",className:ae("leading-none font-semibold",t),...o})}function dn({className:t,...o}){return r.jsx("div",{"data-slot":"card-description",className:ae("text-sm text-muted-foreground",t),...o})}function Pt({className:t,...o}){return r.jsx("div",{"data-slot":"card-content",className:ae("px-6",t),...o})}function yw({className:t,...o}){return r.jsx("div",{"data-slot":"card-footer",className:ae("flex items-center px-6 [.border-t]:pt-6",t),...o})}function ww({...t}){return r.jsx(ef,{"data-slot":"sheet",...t})}function QE({...t}){return r.jsx(tf,{"data-slot":"sheet-portal",...t})}function XE({className:t,...o}){return r.jsx(nf,{"data-slot":"sheet-overlay",className:ae("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 bw({className:t,children:o,side:s="right",showCloseButton:a=!0,...l}){return r.jsxs(QE,{children:[r.jsx(XE,{}),r.jsxs(rf,{"data-slot":"sheet-content",className:ae("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(vi,{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(Md,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function jw({className:t,...o}){return r.jsx("div",{"data-slot":"sheet-header",className:ae("flex flex-col gap-1.5 p-4",t),...o})}function kw({className:t,...o}){return r.jsx(of,{"data-slot":"sheet-title",className:ae("font-semibold text-foreground",t),...o})}function Cw({className:t,...o}){return r.jsx(sf,{"data-slot":"sheet-description",className:ae("text-sm text-muted-foreground",t),...o})}function ln({className:t,...o}){return r.jsx("textarea",{"data-slot":"textarea",className:ae("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 Sw=m.createContext(()=>{}),et=()=>m.useContext(Sw);function JE({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(Sw.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:ae("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(yv,{className:"mt-0.5 size-4 shrink-0 text-destructive"}):r.jsx(pk,{className:"mt-0.5 size-4 shrink-0 text-success"}),r.jsx("span",{children:o.msg})]},o.n)})]})}const Ee=t=>t instanceof Error?t.message:String(t),_w=m.createContext(async()=>!1),to=()=>m.useContext(_w);function ZE({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(_w.Provider,{value:l,children:[t,r.jsx(FE,{open:!!o,onOpenChange:d=>!d&&u(!1),children:r.jsxs(BE,{children:[r.jsxs(WE,{children:[r.jsx(HE,{children:o==null?void 0:o.title}),(o==null?void 0:o.description)&&r.jsx(GE,{children:o.description})]}),r.jsxs(VE,{children:[r.jsx(qE,{onClick:()=>u(!1),children:"Cancel"}),r.jsx(KE,{className:ae((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 Nw=m.createContext(null),no=()=>m.useContext(Nw),Ew=m.createContext(()=>{}),bi=()=>m.useContext(Ew),cl={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 no().license.features.includes(t)}function ji({feature:t,children:o}){return r.jsxs(Mn,{role:"note",className:"locked border-dashed border-primary/60",children:[r.jsx(Ov,{className:"text-primary"}),r.jsxs(vw,{className:"flex items-center gap-2",children:[cl[t],r.jsx(Tt,{variant:"secondary",children:"licensed"})]}),r.jsx(An,{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 Xa({feature:t}){return qt(t)?null:r.jsxs("span",{className:"locknote block text-xs leading-snug text-warning",children:[r.jsx(Ov,{className:"mr-1 inline size-3 align-[-2px]"}),"Needs a license with ",cl[t].toLowerCase()," ·"," ",r.jsx(Yt,{to:"/license",className:"underline underline-offset-2",children:"License"})]})}function fn({children:t,className:o}){return r.jsx(st,{className:ae("gap-0 overflow-hidden py-0",o),children:t})}function Co({open:t,onClose:o,title:s,description:a,children:l,wide:u}){return r.jsx(ww,{open:t,onOpenChange:d=>!d&&o(),children:r.jsxs(bw,{className:ae("w-full gap-0 overflow-y-auto sm:max-w-xl",u&&"sm:max-w-3xl"),children:[r.jsxs(jw,{className:"border-b pr-10",children:[r.jsx(kw,{children:s}),a&&r.jsx(Cw,{children:a})]}),r.jsx("div",{className:"p-4",children:l})]})})}function lr({children:t,className:o}){return r.jsx("div",{className:ae("flex flex-wrap items-center gap-2",o),children:t})}function Ge({children:t,className:o}){return r.jsx("p",{className:ae("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 te({label:t,children:o,hint:s,className:a}){return r.jsxs("div",{className:ae("grid content-start gap-1.5",a),children:[r.jsx(xw,{className:"text-xs font-medium text-muted-foreground",children:t}),o,s]})}function Ke({children:t,className:o}){return r.jsx("div",{className:ae("grid gap-4 sm:grid-cols-2 lg:grid-cols-3",o),children:t})}function Ne({className:t,...o}){return r.jsx("select",{className:ae("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 e2={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 Je({kind:t,children:o,className:s,title:a}){return r.jsx(Tt,{className:ae("state",t,e2[t],s),title:a,children:o})}function Sd({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 se({children:t,className:o,title:s}){return r.jsx("div",{title:s,className:ae("mt-0.5 text-xs text-muted-foreground",o),children:t})}function Rw(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 ul({value:t,onChange:o,on:s,off:a,inherit:l="Inherit",label:u,disabled:d}){const h=t==null?"":String(t);return r.jsxs(Ne,{"aria-label":u,value:h,disabled:d,onChange:v=>o(v.target.value===""?null:v.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 Rf({value:t,onSave:o,onCancel:s,extra:a,inheritModel:l="Server default",saveLabel:u="Save settings",danger:d,unsaved:h}){var re;const v=no(),g=t??{},[y,x]=m.useState(g.profile??""),[k,w]=m.useState(g.max_comments?String(g.max_comments):""),[_,b]=m.useState(g.min_severity??""),[C,S]=m.useState(g.model??""),[R,N]=m.useState(g.auto_review??null),[E,P]=m.useState(g.drafts??null),[M,F]=m.useState(g.instructions??""),U=()=>{const X={};return y&&(X.profile=y),k&&(X.max_comments=parseInt(k,10)),_&&(X.min_severity=_),C&&(X.model=C),R!==null&&(X.auto_review=R),E!==null&&(X.drafts=E),M.trim()&&(X.instructions=M.trim()),X},Y=()=>o(U()),I={...g.profile?{profile:g.profile}:{},...g.max_comments?{max_comments:g.max_comments}:{},...g.min_severity?{min_severity:g.min_severity}:{},...g.model?{model:g.model}:{},...g.auto_review!=null?{auto_review:g.auto_review}:{},...g.drafts!=null?{drafts:g.drafts}:{},...(re=g.instructions)!=null&&re.trim()?{instructions:g.instructions.trim()}:{}},G=()=>{x(g.profile??""),w(g.max_comments?String(g.max_comments):""),b(g.min_severity??""),S(g.model??""),N(g.auto_review??null),P(g.drafts??null),F(g.instructions??"")};return Nf("editor:"+(h||""),h?{label:h,count:Ef(U(),I,["profile","max_comments","min_severity","model","auto_review","drafts","instructions"]),save:Y,discard:G}:null),r.jsxs("div",{className:"grid gap-5",children:[a,r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Review profile",children:r.jsxs(Ne,{value:y,onChange:X=>x(X.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(te,{label:"Max inline comments",children:r.jsx(xe,{type:"number",min:0,max:200,value:k,placeholder:"Inherit",onChange:X=>w(X.target.value)})}),r.jsx(te,{label:"Minimum severity",children:r.jsxs(Ne,{value:_,onChange:X=>b(X.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(te,{label:"Model profile",children:r.jsxs(Ne,{value:C,onChange:X=>S(X.target.value),children:[r.jsx("option",{value:"",children:l}),v.profiles.map(X=>r.jsx("option",{value:X,children:X},X))]})}),r.jsx(te,{label:"Auto review on push",children:r.jsx(ul,{value:R,onChange:N,on:"On",off:"Off"})}),r.jsx(te,{label:"Review draft PRs",children:r.jsx(ul,{value:E,onChange:P,on:"On",off:"Off"})})]}),r.jsx(te,{label:"Extra review instructions",children:r.jsx(ln,{rows:4,maxLength:8e3,placeholder:"Appended to the repository's own instructions",value:M,onChange:X=>F(X.target.value)})}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(oe,{onClick:Y,children:u}),s&&r.jsx(oe,{variant:"outline",onClick:s,children:"Cancel"}),r.jsx("span",{className:"flex-1"}),d]})]})}function Pw(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 _d=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(Mn,{variant:"destructive",children:[r.jsx(yv,{}),r.jsxs(vw,{children:[this.props.name," could not be shown"]}),r.jsxs(An,{children:[this.state.error.message,". Reload the page; if it happens again, report it with the browser console output."]})]}):this.props.children}};function t2({...t}){return r.jsx(YN,{"data-slot":"dropdown-menu",...t})}function n2({...t}){return r.jsx(XN,{"data-slot":"dropdown-menu-trigger",...t})}function r2({className:t,sideOffset:o=4,...s}){return r.jsx(JN,{children:r.jsx(eE,{"data-slot":"dropdown-menu-content",sideOffset:o,className:ae("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 o2({...t}){return r.jsx(nE,{"data-slot":"dropdown-menu-radio-group",...t})}function Bu({className:t,children:o,...s}){return r.jsxs(rE,{"data-slot":"dropdown-menu-radio-item",className:ae("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(oE,{children:r.jsx(bv,{className:"size-2 fill-current"})})}),o]})}function s2({className:t,inset:o,...s}){return r.jsx(tE,{"data-slot":"dropdown-menu-label","data-inset":o,className:ae("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...s})}function i2({className:t,...o}){return r.jsx(sE,{"data-slot":"dropdown-menu-separator",className:ae("-mx-1 my-1 h-px bg-border",t),...o})}function cs({className:t,orientation:o="horizontal",decorative:s=!0,...a}){return r.jsx(dE,{"data-slot":"separator",decorative:s,orientation:o,className:ae("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 Wu=768;function a2(){const[t,o]=m.useState(void 0);return m.useEffect(()=>{const s=window.matchMedia(`(max-width: ${Wu-1}px)`),a=()=>{o(window.innerWidths.removeEventListener("change",a)},[]),!!t}function Tw({delayDuration:t=0,...o}){return r.jsx(gE,{"data-slot":"tooltip-provider",delayDuration:t,...o})}function l2({...t}){return r.jsx(xE,{"data-slot":"tooltip",...t})}function c2({...t}){return r.jsx(yE,{"data-slot":"tooltip-trigger",...t})}function u2({className:t,sideOffset:o=0,children:s,...a}){return r.jsx(jE,{children:r.jsxs(kE,{"data-slot":"tooltip-content",sideOffset:o,className:ae("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(_E,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const d2="sidebar_state",f2=3600*24*7,h2="16rem",p2="18rem",m2="3rem",g2="b",Ow=m.createContext(null);function ki(){const t=m.useContext(Ow);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function v2({defaultOpen:t=!0,open:o,onOpenChange:s,className:a,style:l,children:u,...d}){const h=a2(),[v,g]=m.useState(!1),[y,x]=m.useState(t),k=o??y,w=m.useCallback(S=>{const R=typeof S=="function"?S(k):S;s?s(R):x(R),document.cookie=`${d2}=${R}; path=/; max-age=${f2}`},[s,k]),_=m.useCallback(()=>h?g(S=>!S):w(S=>!S),[h,w,g]);m.useEffect(()=>{const S=R=>{R.key===g2&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),_())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[_]);const b=k?"expanded":"collapsed",C=m.useMemo(()=>({state:b,open:k,setOpen:w,isMobile:h,openMobile:v,setOpenMobile:g,toggleSidebar:_}),[b,k,w,h,v,g,_]);return r.jsx(Ow.Provider,{value:C,children:r.jsx(Tw,{delayDuration:0,children:r.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":h2,"--sidebar-width-icon":m2,...l},className:ae("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...d,children:u})})})}function x2({side:t="left",variant:o="sidebar",collapsible:s="offcanvas",className:a,children:l,...u}){const{isMobile:d,state:h,openMobile:v,setOpenMobile:g}=ki();return s==="none"?r.jsx("div",{"data-slot":"sidebar",className:ae("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...u,children:l}):d?r.jsx(ww,{open:v,onOpenChange:g,...u,children:r.jsxs(bw,{"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":p2},side:t,children:[r.jsxs(jw,{className:"sr-only",children:[r.jsx(kw,{children:"Sidebar"}),r.jsx(Cw,{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:ae("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:ae("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 y2({className:t,onClick:o,...s}){const{toggleSidebar:a}=ki();return r.jsxs(oe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ae("size-7",t),onClick:l=>{o==null||o(l),a()},...s,children:[r.jsx(Ck,{}),r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function w2({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:ae("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 b2({className:t,...o}){return r.jsx("main",{"data-slot":"sidebar-inset",className:ae("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 j2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ae("flex flex-col gap-2 p-2",t),...o})}function k2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ae("flex flex-col gap-2 p-2",t),...o})}function C2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ae("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...o})}function S2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ae("relative flex w-full min-w-0 flex-col p-2",t),...o})}function _2({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ae("w-full text-sm",t),...o})}function Ig({className:t,...o}){return r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ae("flex w-full min-w-0 flex-col gap-1",t),...o})}function zg({className:t,...o}){return r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ae("group/menu-item relative",t),...o})}const N2=vl("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 Fg({asChild:t=!1,isActive:o=!1,variant:s="default",size:a="default",tooltip:l,className:u,...d}){const h=t?zd:"button",{isMobile:v,state:g}=ki(),y=r.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":o,className:ae(N2({variant:s,size:a}),u),...d});return l?(typeof l=="string"&&(l={children:l}),r.jsxs(l2,{children:[r.jsx(c2,{asChild:!0,children:y}),r.jsx(u2,{side:"right",align:"center",hidden:g!=="collapsed"||v,...l})]})):y}function Vu({className:t,...o}){return r.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:ae("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 E2({className:t,title:o}){return r.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",className:ae("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 Dw=[["done","Reviewed","--st-done"],["skipped","Skipped","--st-skip"],["failed","Failed","--st-fail"]];function Pf(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 Nd({points:t,granularity:o,series:s,label:a}){const l=!!s,u=s??Dw,d=m.useRef(null),[h,v]=m.useState(900),[g,y]=m.useState(null);m.useEffect(()=>{const I=d.current;if(!I)return;const G=new ResizeObserver(()=>v(Math.max(320,I.clientWidth||900)));return G.observe(I),()=>G.disconnect()},[]);const x=h,k=200,w=34,_=8,b=8,C=24;let S=0;t.forEach(I=>S=Math.max(S,u.reduce((G,[re])=>G+ns(I,re),0)));const R=S<=4?4:Math.pow(10,Math.floor(Math.log10(S))),N=Math.ceil(S/R)*R||4,E=(x-w-_)/Math.max(1,t.length),P=Math.min(24,Math.max(2,E*.7)),M=I=>b+(k-b-C)*(1-I/N),F=Math.ceil(t.length/Math.max(2,Math.floor((x-w-_)/70))),U=g!==null?t[g]:null,Y=g!==null?Math.min(x-170,Math.max(0,w+E*g+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} ${k}`,role:"img","aria-label":a??`Jobs per ${o}: reviewed, skipped and failed`,children:[t.map((I,G)=>r.jsx("rect",{x:w+E*G,y:b,width:E,height:k-b-C,fill:g===G?"var(--muted)":"transparent",fillOpacity:.5,tabIndex:0,onMouseEnter:()=>y(G),onMouseLeave:()=>y(null),onFocus:()=>y(G),onBlur:()=>y(null)},"h"+G)),[0,N/2,N].map(I=>r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:w,x2:x-_,y1:M(I),y2:M(I),stroke:"var(--grid)",strokeWidth:1}),r.jsx("text",{x:w-6,y:M(I)+4,textAnchor:"end",fontSize:11,fill:"var(--muted-foreground)",children:ze(I)})]},"g"+I)),t.map((I,G)=>{const re=w+E*G+(E-P)/2,X=u.map(([ce,,le])=>[ns(I,ce),le]).filter(([ce])=>ce>0);let H=0;return r.jsxs("g",{pointerEvents:"none",children:[X.map(([ce,le],ie)=>{let V=M(H+ce);const ee=M(H)-(ie>0?2:0);ee-V<1&&(V=ee-1);const z=ie===X.length-1?Math.min(4,P/2,ee-V):0;H+=ce;const D=`M${re},${ee}V${V+z}Q${re},${V} ${re+z},${V}H${re+P-z}Q${re+P},${V} ${re+P},${V+z}V${ee}Z`;return r.jsx("path",{d:D,fill:`var(${le})`},ie)}),G%F===0&&r.jsx("text",{x:w+E*G+E/2,y:k-C+16,textAnchor:"middle",fontSize:11,fill:"var(--muted-foreground)",children:dl(I.bucket,o)})]},"b"+G)}),r.jsx("line",{x1:w,x2:x-_,y1:k-C,y2:k-C,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 "+(U?"show block":"hidden"),id:"mTip",ref:I=>I&&(I.style.left=Y+"px",I.style.top="28px"),children:U&&r.jsxs(r.Fragment,{children:[r.jsx("b",{className:"mb-1 block font-semibold",children:dl(U.bucket,o,!0)}),u.map(([I,G])=>r.jsxs("div",{children:[r.jsx("span",{children:G}),r.jsx("span",{children:ns(U,I)})]},I)),!l&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("span",{children:"Comments"}),r.jsx("span",{children:ns(U,"comments")})]}),r.jsxs("div",{children:[r.jsx("span",{children:"Tokens"}),r.jsx("span",{children:ze(ns(U,"tokens_in")+ns(U,"tokens_out"))})]})]})]})})]})}const cn=[["quality","Quality","--sc-quality"],["security","Security","--sc-security"],["maintainability","Maintainability","--sc-maintainability"]];function ds(t,o){const s=t.scored||0;return s?(t[o+"_sum"]||0)/s:null}function R2(t){return t>=80?"bg-success-soft text-success":t>=50?"bg-warning-soft text-warning":"bg-danger-soft text-destructive"}function Mw({s:t,className:o}){return t?r.jsx("span",{className:ae("inline-flex gap-1",o),children:cn.map(([s,a])=>r.jsxs("span",{title:`${a} ${t[s]}`,className:ae("inline-flex min-w-9 items-center justify-center rounded px-1.5 py-0.5 text-xs font-medium tabular-nums",R2(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 Aw(t,o,s,a){let l="",u=!1;return t.forEach((d,h)=>{const v=ds(d,o);if(v===null){u=!1;return}l+=(u?"L":"M")+s(h).toFixed(1)+","+a(v).toFixed(1),u=!0}),l}function P2({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:cn.map(([d,,h])=>{const v=Aw(t,d,l,u);return v.includes("L")?r.jsx("path",{d:v,fill:"none",stroke:`var(${h})`,strokeWidth:1.5,strokeLinejoin:"round"},d):null})})}function Tf({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,v=160,g=34,y=8,x=8,k=24,w=(h-g-y)/Math.max(1,t.length),_=N=>g+w*N+w/2,b=N=>x+(v-x-k)*(1-N/100),C=Math.ceil(t.length/Math.max(2,Math.floor((h-g-y)/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} ${v}`,role:"img","aria-label":`Average review scores per ${o}`,children:[t.map((N,E)=>r.jsx("rect",{x:g+w*E,y:x,width:w,height:v-x-k,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:g,x2:h-y,y1:b(N),y2:b(N),stroke:"var(--grid)",strokeWidth:1,strokeDasharray:N===50||N===80?"3 3":void 0}),r.jsx("text",{x:g-6,y:b(N)+4,textAnchor:"end",fontSize:11,fill:"var(--muted-foreground)",children:N})]},"g"+N)),cn.map(([N,,E])=>r.jsxs("g",{pointerEvents:"none",children:[r.jsx("path",{d:Aw(t,N,_,b),fill:"none",stroke:`var(${E})`,strokeWidth:2,strokeLinejoin:"round"}),t.map((P,M)=>{const F=ds(P,N);return F===null?null:r.jsx("circle",{cx:_(M),cy:b(F),r:u===M?3.5:2,fill:`var(${E})`},M)})]},N)),t.map((N,E)=>E%C===0?r.jsx("text",{x:_(E),y:v-k+16,textAnchor:"middle",fontSize:11,fill:"var(--muted-foreground)",pointerEvents:"none",children:dl(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:dl(S.bucket,o,!0)}),cn.map(([N,E])=>{const P=ds(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 Of({values:t}){return r.jsx("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:cn.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 Df({...t}){return r.jsx(ef,{"data-slot":"dialog",...t})}function T2({...t}){return r.jsx(tf,{"data-slot":"dialog-portal",...t})}function O2({className:t,...o}){return r.jsx(nf,{"data-slot":"dialog-overlay",className:ae("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 Mf({className:t,children:o,showCloseButton:s=!0,...a}){return r.jsxs(T2,{"data-slot":"dialog-portal",children:[r.jsx(O2,{}),r.jsxs(rf,{"data-slot":"dialog-content",className:ae("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(vi,{"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(Md,{}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Af({className:t,...o}){return r.jsx("div",{"data-slot":"dialog-header",className:ae("flex flex-col gap-2 text-center sm:text-left",t),...o})}function Lf({className:t,showCloseButton:o=!1,children:s,...a}){return r.jsxs("div",{"data-slot":"dialog-footer",className:ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a,children:[s,o&&r.jsx(vi,{asChild:!0,children:r.jsx(oe,{variant:"outline",children:"Close"})})]})}function If({className:t,...o}){return r.jsx(of,{"data-slot":"dialog-title",className:ae("text-lg leading-none font-semibold",t),...o})}function zf({className:t,...o}){return r.jsx(sf,{"data-slot":"dialog-description",className:ae("text-sm text-muted-foreground",t),...o})}function $n({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:ae("w-full caption-bottom text-sm",t),...o})})}function Un({className:t,...o}){return r.jsx("thead",{"data-slot":"table-header",className:ae("[&_tr]:border-b",t),...o})}function Bn({className:t,...o}){return r.jsx("tbody",{"data-slot":"table-body",className:ae("[&_tr:last-child]:border-0",t),...o})}function ct({className:t,...o}){return r.jsx("tr",{"data-slot":"table-row",className:ae("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:ae("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:ae("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...o})}function D2(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"),Ve("/admin/api/metrics?"+h.toString()).then(l).catch(()=>l(null))},[t.id,o]);let u=a?Pf(a):[];o==="all"&&(u=u.slice(Math.max(0,u.findIndex(h=>h.scored))));const d=u.reduce((h,v)=>({bucket:"",scored:(h.scored||0)+(v.scored||0),quality_sum:(h.quality_sum||0)+(v.quality_sum||0),security_sum:(h.security_sum||0)+(v.security_sum||0),maintainability_sum:(h.maintainability_sum||0)+(v.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(Ne,{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(Of,{values:Object.fromEntries(cn.map(([h])=>[h,ds(d,h)]))}),r.jsx(Tf,{points:u,granularity:a.granularity}),r.jsxs(se,{children:[d.scored," scored reviews; the numbers above are the period's averages."]})]}):r.jsx(se,{children:"No scored reviews in this period."}):r.jsx(se,{children:"Loading…"})]})}function L2(){const t=no(),o=et(),s=to(),[a,l]=m.useState(null),[u,d]=m.useState(""),[h,v]=m.useState("all"),[g,y]=m.useState(null),[x,k]=m.useState(!1),[w,_]=m.useState({platform:"github",host:"",path:"",mode:"enabled"}),b=()=>Ve("/admin/api/repos").then(l).catch(I=>o(Ee(I),!0));m.useEffect(()=>{b()},[]);const C=qt("metrics"),[S,R]=m.useState(null);m.useEffect(()=>{C&&Ve("/admin/api/repos/scores?days=30").then(I=>R({since:I.since,days:I.days,by:Object.fromEntries(I.repos.map(G=>[G.platform+"|"+G.host+"|"+G.repo,G]))})).catch(()=>{})},[C]);const N=I=>S==null?void 0:S.by[I.platform+"|"+I.host.toLowerCase()+"|"+I.path.toLowerCase()],E=(I,G,re)=>kn("/admin/api/repos/"+I.id,{mode:G,settings:re}).then(X=>(l(H=>(H||[]).map(ce=>ce.id===X.id?X:ce)),o(X.path+": reviews "+(X.effective.enabled?"on":"off")+" ("+X.effective.source+")"),X)),P=()=>Qt("/admin/api/repos",{...w,host:w.host.trim(),path:w.path.trim()}).then(I=>{l(G=>(G||[]).filter(re=>re.id!==I.id).concat([I])),_({...w,path:""}),k(!1),o("Added "+I.path)}).catch(I=>o(Ee(I),!0)),M=async I=>{await s({title:"Remove "+I.path+"?",description:"It reappears, set to Inherit, if it sends another webhook.",action:"Remove",danger:!0})&&Eo("/admin/api/repos/"+I.id).then(()=>{l(G=>(G||[]).filter(re=>re.id!==I.id)),y(null),o("Removed "+I.path)}).catch(G=>o(Ee(G),!0))},F=(a||[]).filter(I=>h==="on"&&!I.effective.enabled||h==="off"&&I.effective.enabled?!1:!u||(I.host+"/"+I.path).toLowerCase().includes(u.toLowerCase())),U=(a||[]).filter(I=>I.effective.enabled).length,Y=(a==null?void 0:a.find(I=>I.id===g))??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(gl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),r.jsx(xe,{type:"search",className:"pl-8",placeholder:"Filter repositories","aria-label":"Filter repositories",value:u,onChange:I=>d(I.target.value)})]}),r.jsxs(Ne,{className:"w-auto","aria-label":"Show",value:h,onChange:I=>v(I.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&&U+" reviewed · "+(a.length-U)+" not reviewed"}),r.jsx("span",{className:"flex-1"}),r.jsxs(oe,{variant:"outline",onClick:()=>k(!0),children:[r.jsx(ps,{})," Add repository"]})]}),r.jsx(fn,{children:a?F.length?r.jsxs($n,{children:[r.jsx(Un,{children:r.jsxs(ct,{children:[r.jsx(je,{className:"pl-4",children:"Reviews"}),r.jsx(je,{children:"Repository"}),r.jsx(je,{children:"Last webhook"}),C&&r.jsx(je,{children:"Scores · 30 days"}),r.jsx(je,{children:"Effective settings"}),r.jsx(je,{children:"Last changed"}),r.jsx(je,{})]})}),r.jsx(Bn,{children:F.map(I=>{const G=I.effective,re=[G.require_reviewer&&"reviewer required",G.skip_branch_sync&&"skips branch syncs",G.score_labels&&"score labels",G.commit_status&&"commit status",G.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(Ne,{"aria-label":"Reviews for "+I.path,value:I.mode,onChange:X=>E(I,X.target.value,I.settings||{}).catch(H=>o(Ee(H),!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(Je,{kind:G.enabled?"on":"off",children:G.enabled?"Reviewed":"Not reviewed"})}),r.jsx(se,{children:M2(G)}),re.length>0&&r.jsx(se,{children:re.join(" · ")})]}),r.jsxs(ke,{className:"align-top",children:[r.jsx("div",{className:"font-medium",children:I.path}),r.jsxs(se,{children:[I.platform," · ",I.host]})]}),r.jsx(ke,{className:"align-top text-muted-foreground",children:Kr(I.last_seen)}),C&&r.jsx(ke,{className:"align-top",children:(()=>{const X=N(I);return X?r.jsxs("div",{className:"grid gap-1",children:[r.jsx(Mw,{s:X.latest}),r.jsx(P2,{points:D2(S.since,S.days,X.trend),label:"Daily average scores of "+I.path+", last 30 days"}),r.jsxs(se,{children:["latest: #",X.number," · ",Kr(X.at)]})]}):r.jsx(se,{children:"No scored review yet"})})()}),r.jsxs(ke,{className:"align-top whitespace-normal",children:[r.jsx(Sd,{items:Rw(G.settings)}),(G.rules||[]).length>0&&JSON.stringify(G.settings)!==JSON.stringify(I.settings||{})&&r.jsx(se,{children:"includes rule settings"})]}),r.jsx(ke,{className:"align-top text-muted-foreground",children:I.updated_by?I.updated_by+" · "+Kr(I.updated_at):"—"}),r.jsx(ke,{className:"pr-4 text-right align-top",children:r.jsxs(oe,{variant:"ghost",size:"sm",onClick:()=>y(I.id),children:[r.jsx(Pk,{})," Settings"]})})]},I.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(Ge,{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(Ge,{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(Co,{open:!!Y,onClose:()=>y(null),title:(Y==null?void 0:Y.path)??"",description:Y?`${Y.platform} · ${Y.host} · review settings for this repository`:void 0,children:[Y&&C&&r.jsx(A2,{repo:Y},Y.id),Y&&r.jsx(Rf,{value:Y.settings,onSave:I=>E(Y,Y.mode,I).then(()=>y(null)).catch(G=>o(Ee(G),!0)),onCancel:()=>y(null),danger:r.jsx(oe,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>M(Y),children:"Remove"})},Y.id)]}),r.jsx(Df,{open:x,onOpenChange:k,children:r.jsxs(Mf,{className:"sm:max-w-lg",children:[r.jsxs(Af,{children:[r.jsx(If,{children:"Add repository"}),r.jsx(zf,{children:"Repositories also appear by themselves when they send their first webhook."})]}),r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Platform",children:r.jsxs(Ne,{value:w.platform,onChange:I=>_({...w,platform:I.target.value}),children:[r.jsx("option",{value:"github",children:"GitHub"}),r.jsx("option",{value:"gitlab",children:"GitLab"})]})}),r.jsx(te,{label:"Host",children:r.jsx(xe,{placeholder:"github.com",value:w.host,onChange:I=>_({...w,host:I.target.value})})}),r.jsx(te,{label:"Repository path",className:"sm:col-span-2",children:r.jsx(xe,{placeholder:"owner/repo or group/sub/project",value:w.path,onChange:I=>_({...w,path:I.target.value})})}),r.jsx(te,{label:"Reviews",children:r.jsxs(Ne,{value:w.mode,onChange:I=>_({...w,mode:I.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(Lf,{children:[r.jsx(oe,{variant:"outline",onClick:()=>k(!1),children:"Cancel"}),r.jsx(oe,{onClick:P,children:"Add"})]})]})})]})}function Ff(t){const[o,s]=Qj(),a=o.toString(),l=m.useMemo(()=>{const d={...t};for(const h of Object.keys(t)){const v=o.get(h);v!==null&&(d[h]=v)}return d},[a]),u=m.useCallback(d=>s(h=>{const v=new URLSearchParams(h);for(const[g,y]of Object.entries(d))y===void 0||y===""||y===t[g]?v.delete(g):v.set(g,y);return v},{replace:!0}),[s]);return[l,u]}function I2({className:t,...o}){return r.jsx(TS,{"data-slot":"checkbox",className:ae("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(DS,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:r.jsx(ml,{className:"size-3.5"})})})}function z2({a:t}){return t==="approved"||t==="already_approved"?r.jsx(Je,{kind:"on",className:"ml-1",title:t==="approved"?"The bot approved the merge request":"The bot had already approved this head",children:"✓ approved"}):t==="withdrawn"?r.jsx(Je,{kind:"warn",className:"ml-1",title:"The bot withdrew its approval",children:"approval withdrawn"}):t==="failed"?r.jsx(Je,{kind:"off",className:"ml-1",title:"The code host refused the approval",children:"approval failed"}):null}const F2={critical:"off",major:"warn",minor:"idle",nitpick:"idle"};function $2({job:t,onRerun:o}){const s=et(),[a,l]=m.useState(null);if(m.useEffect(()=>{Ve("/admin/api/reviews/"+t.id).then(l).catch(h=>s(Ee(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,v)=>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(Je,{kind:F2[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]})]})]},v))})]}),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,v)=>r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Removed: ",r.jsx("span",{className:"text-foreground",children:h.title})," — ",h.reason]},"r"+v))})]}):!a.error&&r.jsx("p",{className:"text-muted-foreground",children:a.note||"No review result stored for this job."}),r.jsx(cs,{}),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(oe,{variant:"outline",onClick:()=>o(!1),children:"Re-run (new changes)"}),r.jsx(oe,{variant:"outline",onClick:()=>o(!0),children:"Re-run full review"})]})]})}const U2=["bug","security","performance","reliability","maintainability","style","docs","tests"],$g=["host","repo","state","kind","trigger","from","to","score_kind","score_below","severity","category","approval"],B2={host:"",repo:"",state:"",kind:"",trigger:"",from:"",to:"",score_kind:"",score_below:"",severity:"",category:"",approval:"",sort:"",granularity:"day",review:""};function W2(){const t=et(),[o,s]=Ff(B2),a=o.granularity,l=L=>s({granularity:L}),u=m.useMemo(()=>Object.fromEntries($g.map(L=>[L,o[L]])),$g.map(L=>o[L])),d=L=>s(L),h=o.sort,v=L=>s({sort:L}),g=o.review?Number(o.review):null,y=L=>s({review:L?String(L):""}),[x,k]=m.useState(null),[w,_]=m.useState([]),[b,C]=m.useState(o.repo),[S,R]=m.useState(null),[N,E]=m.useState(!1),[P,M]=m.useState(null),[F,U]=m.useState(""),[Y,I]=m.useState(!1);m.useEffect(()=>{Ve("/admin/api/hosts").then(L=>_(L.hosts||[])).catch(()=>{})},[]);const G=qt("metrics"),re=no();m.useEffect(()=>{G&&Ve("/admin/api/metrics"+kd({granularity:a,host:u.host})).then(k).catch(L=>t(Ee(L),!0))},[a,u.host,G]),m.useEffect(()=>{const L=window.setTimeout(()=>d({repo:b.trim()}),300);return()=>window.clearTimeout(L)},[b]),m.useEffect(()=>{o.repo!==b.trim()&&C(o.repo)},[o.repo]),m.useEffect(()=>{!g||!S||S.some(L=>L.id===g)||(P==null?void 0:P.id)===g||Ve("/admin/api/reviews/"+g).then(M).catch(L=>t(Ee(L),!0))},[g,S]);const X=L=>Ve("/admin/api/reviews"+kd({limit:100,...u,before:L})).then(q=>{R(ve=>L?(ve||[]).concat(q.reviews):q.reviews),E(q.reviews.length>=100)}).catch(q=>t(Ee(q),!0));m.useEffect(()=>{X()},[u]);const H=()=>{if(!F.trim())return t("Paste a pull request or merge request URL",!0);Qt("/admin/api/reviews",{url:F.trim(),full:Y}).then(L=>{U(""),t("Queued "+L.pr+" — it appears here when it finishes")}).catch(L=>t(Ee(L),!0))},ce=(L,q)=>Qt(`/admin/api/reviews/${L.id}/rerun`,{full:q}).then(ve=>t("Queued "+ve.pr)).catch(ve=>t(Ee(ve),!0)),le=x?Pf(x):[],ie={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};le.forEach(L=>Object.keys(ie).forEach(q=>ie[q]+=L[q]||0));const V=ie.done+ie.failed,ee=[["Jobs",ze(ie.jobs)],["Reviewed",ze(ie.done)],["Skipped",ze(ie.skipped)],["Failed",ze(ie.failed)+(V?" · "+Math.round(100*ie.failed/V)+"%":"")],["Comments posted",ze(ie.comments)],["Tokens in / out",ze(ie.tokens_in)+" / "+ze(ie.tokens_out)],["Avg time",Cd(V?ie.duration_ms/Math.max(1,ie.jobs):0)],["Tokens today (UTC)",ze((x==null?void 0:x.today_tokens)||0)+(x!=null&&x.daily_token_budget?" of "+ze(x.daily_token_budget):"")]],z=Object.fromEntries(cn.map(([L])=>[L,ds({bucket:"",...ie},L)]));ie.scored&&ee.push(["Avg scores (Q / S / M)",cn.map(([L])=>Math.round(z[L]||0)).join(" / ")],["Scored reviews",ze(ie.scored)]);const D=L=>L.scores?Math.min(L.scores.quality,L.scores.security,L.scores.maintainability):101,K=!S||!h?S:[...S].sort((L,q)=>{var ve,Ce;return h==="lowest"?D(L)-D(q):(((ve=L.scores)==null?void 0:ve[h])??101)-(((Ce=q.scores)==null?void 0:Ce[h])??101)}),de=L=>q=>d({[L]:q.target.value}),we=(S==null?void 0:S.find(L=>L.id===g))??((P==null?void 0:P.id)===g?P:null);return r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(lr,{children:[G&&r.jsxs(Ne,{className:"w-auto","aria-label":"Period",value:a,onChange:L=>l(L.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(xe,{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:L=>U(L.target.value),onKeyDown:L=>L.key==="Enter"&&H()}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(I2,{id:"rnFull",checked:Y,onCheckedChange:L=>I(L===!0)}),r.jsx(xw,{htmlFor:"rnFull",className:"text-sm font-normal text-muted-foreground",children:"Full"})]}),r.jsxs(oe,{onClick:H,children:[r.jsx(Sk,{})," Review now"]})]}),!G&&r.jsxs(ji,{feature:"metrics",children:["Totals, charts and token use, and history kept longer than ",re.free_retention_days," days, are part of the licensed console. Every review is listed below."]}),G&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"tiles grid grid-cols-2 gap-3 md:grid-cols-4",children:ee.map(([L,q])=>r.jsx(st,{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:q}),r.jsx("div",{className:"text-xs text-muted-foreground",children:L})]})},L))}),r.jsx(st,{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:Dw.map(([L,q,ve])=>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(${ve})`)}),q," ",ze(ie[L]||0)]},L))}),x&&r.jsx(Nd,{points:le,granularity:x.granularity})]})}),ie.scored>0&&x&&r.jsx(st,{className:"py-4",children:r.jsxs(Pt,{className:"grid gap-3 px-4",children:[r.jsx(Of,{values:z}),r.jsx(Tf,{points:le,granularity:x.granularity}),r.jsxs(se,{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(Ne,{className:"w-auto","aria-label":"Host",value:u.host,onChange:de("host"),children:[r.jsx("option",{value:"",children:"All hosts"}),w.map(L=>r.jsx("option",{value:L.host,children:L.name},L.host))]}),r.jsxs("div",{className:"relative w-full sm:w-52",children:[r.jsx(gl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),r.jsx(xe,{type:"search",className:"pl-8",placeholder:"Repository","aria-label":"Repository",value:b,onChange:L=>C(L.target.value)})]}),r.jsxs(Ne,{className:"w-auto","aria-label":"State",value:u.state,onChange:de("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(Ne,{className:"w-auto","aria-label":"Kind",value:u.kind,onChange:de("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(Ne,{className:"w-auto","aria-label":"Trigger",value:u.trigger,onChange:de("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(xe,{type:"date",className:"w-auto","aria-label":"From",value:u.from,onChange:de("from")}),r.jsx(xe,{type:"date",className:"w-auto","aria-label":"To",value:u.to,onChange:de("to")}),r.jsxs(Ne,{className:"w-auto","aria-label":"Merge request approval",value:u.approval,onChange:de("approval"),children:[r.jsx("option",{value:"",children:"Any approval"}),r.jsx("option",{value:"approved",children:"Approved by the bot"}),r.jsx("option",{value:"already_approved",children:"Already approved"}),r.jsx("option",{value:"withdrawn",children:"Approval withdrawn"}),r.jsx("option",{value:"not_approved",children:"Not approved"}),r.jsx("option",{value:"failed",children:"Approval failed"})]}),r.jsxs(Ne,{className:"w-auto","aria-label":"Finding severity",value:u.severity,onChange:de("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(Ne,{className:"w-auto","aria-label":"Finding category",value:u.category,onChange:de("category"),children:[r.jsx("option",{value:"",children:"Any category"}),Array.from(new Set([...U2,...u.category?[u.category]:[]])).map(L=>r.jsx("option",{value:L,className:"capitalize",children:L[0].toUpperCase()+L.slice(1)},L))]}),r.jsxs(Ne,{className:"w-auto","aria-label":"Score",value:u.score_kind,onChange:de("score_kind"),children:[r.jsx("option",{value:"",children:"Any score"}),r.jsx("option",{value:"any",children:"Lowest score"}),cn.map(([L,q])=>r.jsx("option",{value:L,children:q},L))]}),u.score_kind&&r.jsxs(Ne,{className:"w-auto","aria-label":"Score below",value:u.score_below,onChange:de("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(Ne,{className:"w-auto","aria-label":"Sort",value:h,onChange:L=>v(L.target.value),children:[r.jsx("option",{value:"",children:"Newest first"}),r.jsx("option",{value:"lowest",children:"Lowest score first"}),cn.map(([L,q])=>r.jsxs("option",{value:L,children:["Lowest ",q.toLowerCase()," first"]},L))]})]}),r.jsx(fn,{children:S?!K||!K.length?r.jsx(qe,{children:"No reviews match."}):r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{children:K.map(L=>{const q=L.started&&!L.started.startsWith("0001-")?new Date(L.finished).getTime()-new Date(L.started).getTime():0;return r.jsxs(ct,{className:"cursor-pointer",onClick:()=>y(L.id),children:[r.jsx(ke,{className:"pl-4 text-muted-foreground",title:Qr(L.finished,!0)+" · "+Tl(L.finished),children:Kr(L.finished)}),r.jsxs(ke,{children:[r.jsx("div",{className:"font-medium",children:L.url?r.jsxs("a",{className:"inline-flex items-center gap-1 hover:underline",href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:ve=>ve.stopPropagation(),children:[L.repo," #",L.number," ",r.jsx(_v,{className:"size-3 text-muted-foreground"})]}):`${L.repo} #${L.number}`}),r.jsxs(se,{children:[L.platform," · ",L.host]})]}),r.jsxs(ke,{children:[r.jsx("div",{children:L.kind}),r.jsx(se,{children:L.trigger+(L.requested_by?" · "+L.requested_by:"")})]}),r.jsxs(ke,{className:"max-w-64 whitespace-normal",children:[r.jsx(Je,{kind:L.state==="done"?"on":L.state==="failed"?"off":"idle",children:L.state}),r.jsx(z2,{a:L.approval}),(L.error||L.note)&&r.jsx(se,{className:"line-clamp-2",children:L.error?L.error.slice(0,120):L.note})]}),r.jsx(ke,{children:r.jsx(Mw,{s:L.scores})}),r.jsxs(ke,{className:"text-right tabular-nums",children:[L.comments," / ",L.files]}),r.jsxs(ke,{className:"text-right text-muted-foreground tabular-nums",children:[ze(L.tokens_in)," / ",ze(L.tokens_out)]}),r.jsx(ke,{className:"text-right text-muted-foreground tabular-nums",children:Cd(q)}),r.jsx(ke,{className:"pr-4 text-right",children:r.jsx(oe,{variant:"ghost",size:"sm",onClick:ve=>(ve.stopPropagation(),y(L.id)),children:"Details"})})]},L.id)})})]}):r.jsx(qe,{children:"Loading…"})}),N&&r.jsx("div",{children:r.jsx(oe,{variant:"outline",onClick:()=>S&&X(S[S.length-1].id),children:"Load older"})}),r.jsx(Ge,{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(Co,{wide:!0,open:!!we,onClose:()=>y(null),title:we?`${we.repo} #${we.number}`:"",description:we?`${we.kind} · ${we.trigger} · ${we.state} · ${Kr(we.finished)}`:void 0,children:we&&r.jsx($2,{job:we,onRerun:L=>ce(we,L)},we.id)})]})}const V2={reply:"from a reply",command:"@bot remember",manual:"added here"};function H2({l:t,onSave:o,onCancel:s,onDelete:a}){const[l,u]=m.useState(t.scope),[d,h]=m.useState(t.path),[v,g]=m.useState(t.text);return r.jsxs("div",{className:"grid gap-4",children:[r.jsx(te,{label:"Applies to",children:r.jsx(xe,{value:l,placeholder:"empty = whole host · group · group/repo",onChange:y=>u(y.target.value)})}),r.jsx(te,{label:"Only files matching",children:r.jsx(xe,{value:d,placeholder:"optional glob",onChange:y=>h(y.target.value)})}),r.jsx(te,{label:"Learning",children:r.jsx(ln,{rows:5,maxLength:600,value:v,onChange:y=>g(y.target.value)})}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(oe,{onClick:()=>o({scope:l.trim(),path:d.trim(),text:v.trim()}),children:"Save"}),r.jsx(oe,{variant:"outline",onClick:s,children:"Cancel"}),r.jsx("span",{className:"flex-1"}),r.jsx(oe,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:a,children:"Delete"})]})]})}function G2(){const t=et(),o=to(),s=qt("learnings"),[a,l]=m.useState(null),[u,d]=m.useState(""),[h,v]=m.useState(""),[g,y]=m.useState(null),[x,k]=m.useState(!1),[w,_]=m.useState({platform:"gitlab",host:"",scope:"",path:"",text:""});m.useEffect(()=>{Ve("/admin/api/learnings").then(P=>l(P.learnings||[])).catch(P=>t(Ee(P),!0))},[]);const b=(P,M)=>kn("/admin/api/learnings/"+P.id,{scope:P.scope,text:P.text,path:P.path,status:P.status,...M}).then(F=>(l(U=>(U||[]).map(Y=>Y.id===F.id?F:Y)),F)),C=()=>Qt("/admin/api/learnings",w).then(P=>{l(M=>(M||[]).concat([P])),_({...w,text:""}),k(!1),t("Learning added")}).catch(P=>t(Ee(P),!0)),S=async P=>{await o({title:"Delete this learning?",description:P.text,action:"Delete",danger:!0})&&Eo("/admin/api/learnings/"+P.id).then(()=>{l(M=>(M||[]).filter(F=>F.id!==P.id)),y(null),t("Deleted")}).catch(M=>t(Ee(M),!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===g))??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(gl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),r.jsx(xe,{type:"search",className:"pl-8",placeholder:"Search learnings","aria-label":"Search learnings",value:u,onChange:P=>d(P.target.value)})]}),r.jsxs(Ne,{className:"w-auto","aria-label":"Status",value:h,onChange:P=>v(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(oe,{variant:"outline",onClick:()=>k(!0),children:[r.jsx(ps,{})," Add learning"]})]}),r.jsx(fn,{children:a?N.length?r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{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(se,{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(Ne,{"aria-label":"Status",value:P.status,disabled:!s,onChange:M=>b(P,{status:M.target.value}).then(F=>t("Learning "+F.status)).catch(F=>t(Ee(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:(V2[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(_v,{className:"size-3"})]}),r.jsx(se,{children:Kr(P.updated_at)})]}),r.jsx(ke,{className:"pr-4 text-right align-top",children:s?r.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>y(P.id),children:"Edit"}):r.jsx(oe,{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(Ge,{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(Co,{open:!!E,onClose:()=>y(null),title:"Edit learning",description:E?`${E.platform} · ${E.host}`:void 0,children:E&&r.jsx(H2,{l:E,onCancel:()=>y(null),onDelete:()=>S(E),onSave:P=>b(E,P).then(()=>{y(null),t("Saved")}).catch(M=>t(Ee(M),!0))},E.id)}),r.jsx(Df,{open:x,onOpenChange:k,children:r.jsxs(Mf,{className:"sm:max-w-xl",children:[r.jsxs(Af,{children:[r.jsx(If,{children:"Add learning"}),r.jsx(zf,{children:"A rule future reviews should follow."})]}),r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Platform",children:r.jsxs(Ne,{value:w.platform,onChange:P=>_({...w,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(te,{label:"Host",children:r.jsx(xe,{placeholder:"gitlab.example.com",value:w.host,onChange:P=>_({...w,host:P.target.value})})}),r.jsx(te,{label:"Applies to",children:r.jsx(xe,{placeholder:"empty = whole host · group · group/repo",value:w.scope,onChange:P=>_({...w,scope:P.target.value})})}),r.jsx(te,{label:"Only files matching",children:r.jsx(xe,{placeholder:"optional glob, e.g. api/legacy/**",value:w.path,onChange:P=>_({...w,path:P.target.value})})})]}),r.jsx(te,{label:"Learning",children:r.jsx(ln,{rows:4,maxLength:600,placeholder:"e.g. Account numbers are compared without leading zeros on purpose.",value:w.text,onChange:P=>_({...w,text:P.target.value})})}),r.jsxs(Lf,{children:[r.jsx(oe,{variant:"outline",onClick:()=>k(!1),children:"Cancel"}),r.jsx(oe,{onClick:C,children:"Add learning"})]})]})})]})}const K2={github:"GitHub",gitlab:"GitLab",bitbucket:"Bitbucket"},q2={github:"https://api.github.com",gitlab:"https://gitlab.com",bitbucket:"https://api.bitbucket.org/2.0"};function ii({label:t,set:o,multi:s,help:a,value:l,onChange:u}){const d=o?"Set ✓ — leave blank to keep":"";return r.jsx(te,{label:t+(a?" — "+a:""),children:s?r.jsx(ln,{rows:3,className:"font-mono text-xs",placeholder:d,autoComplete:"off",spellCheck:!1,value:l,onChange:h=>u(h.target.value)}):r.jsx(xe,{type:"password",placeholder:d,autoComplete:"new-password",value:l,onChange:h=>u(h.target.value)})})}function Lw({text:t,label:o="Copy"}){const s=et(),[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(oe,{variant:"ghost",size:"sm",onClick:u,"aria-label":o,children:[a?r.jsx(ml,{}):r.jsx(vk,{})," ",o]})}function Iw({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(Lw,{text:t})]}),r.jsxs(se,{children:["Paste it into ",a,", together with the URL."]}),r.jsx("div",{children:r.jsx(oe,{size:"sm",variant:"outline",onClick:s,children:"I've copied it"})})]})}function Y2({hook:t,platform:o,onChanged:s}){const a=et(),l=to(),[u,d]=m.useState(""),[h,v]=m.useState(t.name),[g,y]=m.useState(""),x=(_,b)=>kn("/admin/api/webhooks/"+t.id,_).then(C=>{a(b),C.secret&&d(C.secret),s()}).catch(C=>a(Ee(C),!0)),k=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)},w=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})&&Eo("/admin/api/webhooks/"+t.id).then(()=>{a("Deleted "+t.name),s()}).catch(_=>a(Ee(_),!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(xe,{className:"h-8 max-w-64",value:h,onChange:_=>v(_.target.value),onBlur:()=>h.trim()!==t.name&&x({name:h},"Renamed")}),r.jsx(Je,{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(oe,{variant:"ghost",size:"sm",onClick:()=>x({enabled:!t.enabled},t.enabled?"Disabled "+t.name:"Enabled "+t.name),children:t.enabled?"Disable":"Enable"}),r.jsx(oe,{variant:"ghost",size:"sm",onClick:k,children:"New secret"}),r.jsx(oe,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:w,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(Lw,{text:t.url,label:"Copy URL"})]}),u&&r.jsx(Iw,{secret:u,platform:o,onDone:()=>d("")}),o==="gitlab"&&r.jsx(te,{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(xe,{type:"password",autoComplete:"off",value:g,placeholder:t.secrets.signing_tokens?"Set ✓":"",onChange:_=>y(_.target.value)}),r.jsx(oe,{variant:"outline",size:"sm",disabled:!g.trim(),onClick:()=>x({signing_tokens:[g.trim()]},"Saved signing token").then(()=>y("")),children:"Save"}),t.secrets.signing_tokens>0&&r.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>x({signing_tokens:[]},"Removed signing token"),children:"Remove"})]})}),o==="gitlab"&&t.secrets.signing_tokens>0&&r.jsx(te,{label:"Unsigned deliveries with the secret token",hint:r.jsx(se,{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(Ne,{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(se,{children:["Added ",mi(t.created_at),t.created_by?" by "+t.created_by:""]})]})}function Q2({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 X2({host:t,managed:o,onChanged:s}){const a=et(),[l,u]=m.useState(""),[d,h]=m.useState(null),v=()=>Qt(`/admin/api/hosts/${t.id}/webhooks`,{name:l.trim()}).then(g=>{u(""),h({id:g.webhook.id,secret:g.secret}),a("Added "+g.webhook.name),s()}).catch(g=>a(Ee(g),!0));return r.jsxs("div",{className:"grid gap-6",children:[t.comment_warning&&r.jsx(Q2,{text:t.comment_warning}),o&&r.jsxs(is,{title:"Add a webhook",children:[r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(xe,{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:g=>u(g.target.value)}),r.jsxs(oe,{onClick:v,children:[r.jsx(ps,{})," Add webhook"]})]}),r.jsxs(se,{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(is,{title:`Webhooks (${t.webhooks.length})`,children:t.webhooks.length?t.webhooks.map(g=>r.jsxs("div",{className:"grid gap-2",children:[(d==null?void 0:d.id)===g.id&&r.jsx(Iw,{secret:d.secret,platform:t.platform,onDone:()=>h(null)}),r.jsx(Y2,{hook:g,platform:t.platform,onChanged:s})]},g.id)):r.jsxs(se,{children:["No webhooks yet",o?": add one above.":"."]})})]})}function is({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 J2({host:t,onSaved:o,onCancel:s}){const a=et(),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,v]=m.useState((t==null?void 0:t.platform)??"gitlab"),[g,y]=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=w=>_=>y({...g,[w]:typeof _=="object"&&(_!=null&&_.target)?_.target.value:_}),k=()=>{const w={platform:h,base_url:g.base.trim(),name:g.name.trim(),enabled:g.enabled,settings:{bot_name:g.bot.trim(),reviewer:g.reviewer.trim()}};h==="github"&&(w.settings.app_id=parseInt(g.appID||"0",10)),h==="gitlab"&&Object.assign(w.settings,{skip_tls_verify:g.skipTLS,require_signature:g.reqSig}),h==="bitbucket"&&(w.settings.email=g.email.trim()),g.token.trim()&&(w.token=g.token.trim()),g.appKey.trim()&&(w.app_private_key=g.appKey),g.apiToken.trim()&&(w.api_token=g.apiToken.trim()),(t?kn("/admin/api/hosts/"+t.id,w):Qt("/admin/api/hosts",w)).then(_=>{a("Saved "+_.name),o(_)}).catch(_=>a(Ee(_),!0))};return r.jsxs("div",{className:"grid gap-6",children:[r.jsx(is,{title:"Host",children:r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Platform",children:r.jsxs(Ne,{id:"hPlat",value:h,disabled:!!t,onChange:w=>v(w.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(te,{label:"Status",children:r.jsxs(Ne,{value:String(g.enabled),onChange:w=>y({...g,enabled:w.target.value==="true"}),children:[r.jsx("option",{value:"true",children:"Enabled"}),r.jsx("option",{value:"false",children:"Disabled"})]})}),r.jsx(te,{label:h==="gitlab"?"Instance URL":"API URL",children:r.jsx(xe,{value:g.base,placeholder:q2[h],onChange:x("base")})}),r.jsx(te,{label:"Name",children:r.jsx(xe,{value:g.name,placeholder:"shown in the console",onChange:x("name")})})]})}),r.jsx(cs,{}),r.jsx(is,{title:"API access",children:r.jsxs("div",{className:"grid gap-4",children:[h==="github"&&r.jsxs(r.Fragment,{children:[r.jsx(ii,{label:"Token",help:"or use a GitHub App below",set:d.token,value:g.token,onChange:x("token")}),r.jsx(te,{label:"GitHub App ID",children:r.jsx(xe,{type:"number",value:g.appID,onChange:x("appID")})}),r.jsx(ii,{label:"GitHub App private key (PEM)",set:d.app_private_key,multi:!0,value:g.appKey,onChange:x("appKey")})]}),h==="gitlab"&&r.jsxs(r.Fragment,{children:[r.jsx(ii,{label:"Access token (api scope)",set:d.token,value:g.token,onChange:x("token")}),r.jsx(te,{label:"TLS",children:r.jsxs(Ne,{value:String(g.skipTLS),onChange:w=>y({...g,skipTLS:w.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(ii,{label:"Access token",help:"repository or workspace token",set:d.token,value:g.token,onChange:x("token")}),r.jsx(te,{label:"Account email",children:r.jsx(xe,{value:g.email,placeholder:"with an API token instead",onChange:x("email")})}),r.jsx(ii,{label:"Atlassian API token",set:d.api_token,value:g.apiToken,onChange:x("apiToken")})]})]})}),r.jsx(cs,{}),h==="gitlab"&&r.jsxs(r.Fragment,{children:[r.jsxs(is,{title:"Webhooks",children:[r.jsx(se,{children:"Each webhook has its own URL and secrets: add them under Manage webhooks once the host is saved."}),r.jsx(te,{label:"Unsigned deliveries (every webhook of this host)",hint:r.jsx(se,{children:"A webhook with its own signing token rejects unsigned deliveries either way, unless it is set to accept both."}),children:r.jsxs(Ne,{value:String(g.reqSig),onChange:w=>y({...g,reqSig:w.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(cs,{})]}),r.jsx(is,{title:"Bot identity",children:r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Mention name",hint:r.jsx(Xa,{feature:"hosts"}),children:r.jsx(xe,{value:g.bot,placeholder:"default: the token's user",disabled:!l&&!g.bot,onChange:x("bot")})}),r.jsx(te,{label:"Reviewer username",children:r.jsx(xe,{value:g.reviewer,placeholder:"default: the token's user",disabled:!l&&!g.reviewer,onChange:x("reviewer")})})]})}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(oe,{onClick:k,children:t?"Save host":"Add host"}),r.jsx(oe,{variant:"outline",onClick:s,children:"Cancel"})]})]})}function Z2(){const t=et(),o=to(),s=qt("hosts"),[a,l]=m.useState(null),[u,d]=m.useState(null),[h,v]=m.useState(null),[g,y]=m.useState({}),x=()=>Ve("/admin/api/hosts").then(l).catch(S=>t(Ee(S),!0));m.useEffect(()=>{x()},[]);const k=S=>{y(R=>({...R,[S.id]:{ok:!1,pending:!0}})),Qt(`/admin/api/hosts/${S.id}/test`).then(R=>y(N=>({...N,[S.id]:R}))).catch(R=>y(N=>({...N,[S.id]:{ok:!1,summary:"Check failed",message:Ee(R)}})))},w=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})&&Eo("/admin/api/hosts/"+S.id).then(()=>{t("Deleted "+S.name),x()}).catch(R=>t(Ee(R),!0))},_=(a==null?void 0:a.mode)==="database",b=u?(a==null?void 0:a.hosts.find(S=>S.id===u))??null:null,C=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(oe,{variant:"outline",onClick:()=>d(0),children:[r.jsx(ps,{})," Add host"]})]}),r.jsx(fn,{children:a?a.hosts.length?r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{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=g[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(se,{children:[K2[S.platform]," · ",S.host]}),r.jsx("div",{className:"mt-1.5",children:S.licensed?r.jsx(Je,{kind:S.enabled?"on":"idle",children:S.enabled?"Enabled":"Disabled"}):r.jsx(Je,{kind:"warn",children:"Inactive: needs a license"})}),S.enabled&&r.jsx(eR,{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(se,{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(se,{children:"None yet"}),S.comment_warning&&r.jsx("div",{className:"mt-1.5",children:r.jsx(Je,{kind:"warn",children:"No comment events"})}),r.jsxs(oe,{variant:"link",size:"sm",className:"h-auto px-0",onClick:()=>v(S.id),children:[r.jsx(Jv,{})," ",_?"Manage webhooks":"Show URLs"]})]}),r.jsx(ke,{className:"w-56 max-w-56 align-top whitespace-normal",children:r.jsx(tR,{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(oe,{variant:"ghost",size:"sm",onClick:()=>k(S),children:[r.jsx(_k,{})," Test"]}),_&&r.jsxs(r.Fragment,{children:[r.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>d(S.id),children:"Edit"}),r.jsx(oe,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>w(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(Ge,{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(Co,{open:C!==null,onClose:()=>v(null),title:C?"Webhooks: "+C.name:"",description:"Each webhook has its own URL and secret.",wide:!0,children:C&&r.jsx(X2,{host:C,managed:_,onChanged:x},C.id)}),r.jsx(Co,{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(J2,{host:b,onCancel:()=>d(null),onSaved:S=>{d(null),x().then(()=>k(S))}},u)})]})}function eR({e:t}){if(!t)return null;if(t.error)return r.jsxs(se,{className:"text-destructive",children:["Token: ",t.error]});if(!t.known)return null;if(!t.expires)return r.jsx(se,{children:"Token never expires"});const o=new Date(t.expires),s=Math.ceil((o.getTime()-Date.now())/864e5),a=mi(o);return s<=0?r.jsx("div",{className:"mt-1",children:r.jsxs(Je,{kind:"warn",children:["Token expired ",a]})}):s<=14?r.jsx("div",{className:"mt-1",children:r.jsxs(Je,{kind:"warn",children:["Token expires in ",s," ",s===1?"day":"days"]})}):r.jsxs(se,{children:["Token expires ",a]})}function tR({t}){const[o,s]=m.useState(!1);if(!t)return r.jsx(se,{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(Je,{kind:t.ok?"on":"off",children:a})}),t.at&&r.jsx(se,{children:Qr(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 Ed=[["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"]],ai=t=>t.pattern||"Whole host";function nR({rule:t,onSave:o,onDelete:s}){const[a,l]=m.useState(()=>Object.fromEntries(Ed.map(([u])=>[u,t[u]??null])));return r.jsx(Rf,{value:t.settings,inheritModel:"Inherit",onSave:u=>o({...a,settings:u}),danger:r.jsx(oe,{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(Ke,{className:"lg:grid-cols-2",children:Ed.map(([u,d,h,v])=>r.jsx(te,{label:d,children:r.jsx(ul,{value:a[u],on:h,off:v,onChange:g=>l({...a,[u]:g})})},u))})]}),r.jsx(cs,{}),r.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:"Review settings"})]})})}function rR(){const t=et(),o=to(),s=qt("rules"),[a,l]=m.useState(null),[u,d]=m.useState([]),[h,v]=m.useState(null),[g,y]=m.useState(!1),[x,k]=m.useState({platform:"gitlab",host:"",pattern:"",enabled:null}),w=()=>Ve("/admin/api/repos").then(E=>d(E||[]));m.useEffect(()=>{Ve("/admin/api/rules").then(E=>l(E||[])).catch(E=>t(Ee(E),!0)),w().catch(()=>{})},[]);const _=E=>{const P=E.pattern?E.pattern:"host "+E.host;return u.filter(M=>(M.effective.rules||[]).includes(P)&&M.platform===E.platform&&M.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(M=>(M||[]).filter(F=>F.id!==P.id).concat([P])),k({...x,pattern:""}),y(!1),v(P.id),t("Saved rule "+ai(P)+" — set its options"),w())).catch(P=>t(Ee(P),!0))},C=(E,P)=>kn("/admin/api/rules/"+E.id,P).then(M=>(l(F=>(F||[]).map(U=>U.id===M.id?M:U)),v(null),t("Saved "+ai(M)),w())).catch(M=>t(Ee(M),!0)),S=async E=>{await o({title:"Delete the rule for "+ai(E)+"?",description:"On "+E.host+". Repositories fall back to the level above.",action:"Delete rule",danger:!0})&&Eo("/admin/api/rules/"+E.id).then(()=>(l(P=>(P||[]).filter(M=>M.id!==E.id)),v(null),t("Deleted rule "+ai(E)),w())).catch(P=>t(Ee(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(oe,{variant:"outline",onClick:()=>y(!0),children:[r.jsx(ps,{})," Add rule"]})]}),r.jsx(fn,{children:a?a.length?r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{children:R.map(E=>{const P=_(E),M=Ed.filter(([F])=>E[F]!==null&&E[F]!==void 0).map(([F,U,Y,I])=>U+": "+(E[F]?Y:I));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(se,{children:[E.platform," · ",E.host]})]}),r.jsxs(ke,{className:"align-top whitespace-normal",children:[r.jsx(Sd,{items:M,empty:"inherits everything"}),r.jsx("div",{className:"mt-1",children:r.jsx(Sd,{items:Rw(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+" · "+Kr(E.updated_at):"—"}),r.jsx(ke,{className:"pr-4 text-right align-top",children:s?r.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>v(E.id),children:"Edit"}):r.jsx(oe,{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(Ge,{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(Co,{open:!!N,onClose:()=>v(null),title:N?ai(N):"",description:N?`${N.platform} · ${N.host}`:void 0,children:N&&r.jsx(nR,{rule:N,onSave:E=>C(N,E),onDelete:()=>S(N)},N.id)}),r.jsx(Df,{open:g,onOpenChange:y,children:r.jsxs(Mf,{className:"sm:max-w-lg",children:[r.jsxs(Af,{children:[r.jsx(If,{children:"Add rule"}),r.jsx(zf,{children:"After adding it, set its options."})]}),r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Platform",children:r.jsxs(Ne,{value:x.platform,onChange:E=>k({...x,platform:E.target.value}),children:[r.jsx("option",{value:"gitlab",children:"GitLab"}),r.jsx("option",{value:"github",children:"GitHub"})]})}),r.jsx(te,{label:"Host",children:r.jsx(xe,{placeholder:"gitlab.com",value:x.host,onChange:E=>k({...x,host:E.target.value})})}),r.jsx(te,{label:"Group, owner or pattern",className:"sm:col-span-2",children:r.jsx(xe,{placeholder:"empty = whole host · acme · acme/svc-*",value:x.pattern,onChange:E=>k({...x,pattern:E.target.value})})}),r.jsx(te,{label:"Reviews",children:r.jsx(ul,{value:x.enabled,on:"Enabled",off:"Disabled",onChange:E=>k({...x,enabled:E})})})]}),r.jsxs(Lf,{children:[r.jsx(oe,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),r.jsx(oe,{onClick:b,children:"Add rule"})]})]})})]})}const Ug=["queued","ignored","duplicate","rejected","error"],oR=t=>({queued:"on",rejected:"off",error:"off"})[t]||"idle";function sR(){const t=et(),[o,s]=m.useState(null),[a,l]=m.useState({}),[u,d]=m.useState(!1),[h,v]=Ff({project:"",outcome:""}),[g,y]=m.useState(h.project),x=h.outcome,k=C=>v({outcome:C}),[w,_]=m.useState({});m.useEffect(()=>{Ve("/admin/api/hosts").then(C=>_(Object.fromEntries(C.hosts.flatMap(S=>(S.webhooks||[]).map(R=>[R.id,R.name]))))).catch(()=>{})},[]);const b=C=>{const S=C&&(o!=null&&o.length)?o[o.length-1].id:void 0;Ve("/admin/api/webhooks"+kd({limit:100,project:g.trim(),outcome:x,before:S})).then(R=>{s(N=>C?(N||[]).concat(R.events):R.events),l(R.counts_24h||{}),d(R.events.length>=100)}).catch(R=>t(Ee(R),!0))};return m.useEffect(()=>{const C=window.setTimeout(()=>(b(),v({project:g.trim()})),g?250:0);return()=>window.clearTimeout(C)},[g,x]),m.useEffect(()=>{h.project!==g.trim()&&y(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(gl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),r.jsx(xe,{type:"search",className:"pl-8",placeholder:"Filter by project","aria-label":"Filter webhooks by project",value:g,onChange:C=>y(C.target.value)})]}),r.jsxs(Ne,{className:"w-auto","aria-label":"Outcome",value:x,onChange:C=>k(C.target.value),children:[r.jsx("option",{value:"",children:"All outcomes"}),Ug.map(C=>r.jsx("option",{value:C,children:C[0].toUpperCase()+C.slice(1)},C))]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["Last 24 h: ",Ug.map(C=>(a[C]||0)+" "+C).join(" · ")]}),r.jsx("span",{className:"flex-1"}),r.jsxs(oe,{variant:"outline",onClick:()=>b(),children:[r.jsx(Bv,{})," Refresh"]})]}),r.jsx(fn,{children:o?o.length?r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{children:o.map(C=>{const S=[C.kind||C.event,C.action].filter(Boolean).join(" · ")+(C.number?" · !"+C.number:"");return r.jsxs(ct,{children:[r.jsx(ke,{className:"pl-4 align-top text-muted-foreground",title:Qr(C.received_at,!0)+" · "+Tl(C.received_at),children:Kr(C.received_at)}),r.jsxs(ke,{className:"align-top",children:[r.jsx("div",{className:"font-medium",children:C.project||"—"}),r.jsx(se,{children:C.platform+(C.host?" · "+C.host:"")})]}),r.jsxs(ke,{className:"align-top",children:[r.jsx("div",{children:S||"—"}),r.jsx(se,{children:C.event+(C.sender?" · by "+C.sender:"")})]}),r.jsx(ke,{className:"align-top",children:r.jsx(Je,{kind:oR(C.outcome),children:C.outcome})}),r.jsx(ke,{className:"reason min-w-64 align-top text-sm whitespace-normal text-muted-foreground",children:C.reason}),r.jsxs(ke,{className:"pr-4 align-top text-muted-foreground",children:[r.jsx("div",{children:C.endpoint?w[C.endpoint]||"unknown webhook":"shared URL (removed)"}),r.jsxs(se,{className:C.auth==="token-unsigned"?"text-warning":"",title:C.auth==="token-unsigned"?"Accepted by the secret token although a signing token is set: the delivery wasn't signed":void 0,children:[C.auth==="token-unsigned"?"secret token, not signed":C.auth,C.source_ip?" · from "+C.source_ip:""]})]})]},C.id)})})]}):r.jsx(qe,{children:"No webhook deliveries match."}):r.jsx(qe,{children:"Loading…"})}),u&&r.jsx("div",{children:r.jsx(oe,{variant:"outline",onClick:()=>b(!0),children:"Load older"})}),r.jsxs(Ge,{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 li({title:t,description:o,children:s}){return r.jsxs(st,{children:[r.jsxs(Xt,{children:[r.jsx(un,{className:"h2",children:t}),o&&r.jsx(dn,{children:o})]}),r.jsx(Pt,{children:s})]})}function Zn({label:t,value:o,onChange:s,hint:a,placeholder:l,min:u,max:d}){return r.jsx(te,{label:t,hint:a,children:r.jsx(xe,{type:"number",min:u,max:d,placeholder:l,value:o||"",onChange:h=>s(parseInt(h.target.value||"0",10))})})}function iR(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 Bg(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 Wg(t){return location.origin+"/dashboard?token="+encodeURIComponent(t)}const aR=1440*60*1e3;function lR({v:t,clearing:o,replacing:s}){if(o)return r.jsx(se,{children:"The token is removed when you save."});if(s)return r.jsx(se,{children:"The new token replaces the current one when you save; the old link stops working."});if(!t.dashboard_token_set)return r.jsx(se,{children:"No token."});if(t.dashboard_token_expired)return r.jsx(Je,{kind:"warn",children:"Expired: generate a new token"});if(!t.dashboard_token_expires)return r.jsx(Je,{kind:"on",children:"Set, never expires"});const a=new Date(t.dashboard_token_expires),l=mi(a);return a.getTime()-Date.now()<7*aR?r.jsxs(Je,{kind:"warn",children:["Expires soon: ",l]}):r.jsxs(Je,{kind:"on",children:["Set, expires ",l]})}function Vg(){const t=new Uint8Array(16);return crypto.getRandomValues(t),Array.from(t,o=>o.toString(16).padStart(2,"0")).join("")}function cR(){const t=et(),o=no(),[s,a]=m.useState(null),[l,u]=m.useState(""),[d,h]=m.useState(""),[v,g]=m.useState(""),[y,x]=m.useState(!1),[k,w]=m.useState(90),[_,b]=m.useState(!1),[C,S]=m.useState(""),[R,N]=m.useState(!1),[E,P]=m.useState(!1),[M,F]=m.useState(null),U=H=>{const ce={...H,extra_env:H.extra_env??[],engine:H.engine??{},env_set:H.env_set??{}};a(ce),F(ce),u(ce.extra_env.join(", ")),h(ce.engine.defaults?JSON.stringify(ce.engine.defaults,null,2):""),g(""),x(!1),b(!1),S(""),N(!1),P(!1)};m.useEffect(()=>{Ve("/admin/api/tuning").then(U).catch(H=>t(Ee(H),!0))},[]);let Y=0;if(s&&M&&(Y=Ef({...s,extra_env:[],engine:{...s.engine,defaults:void 0}},{...M,extra_env:[],engine:{...M.engine,defaults:void 0}}),l!==M.extra_env.join(", ")&&Y++,d!==(M.engine.defaults?JSON.stringify(M.engine.defaults,null,2):"")&&Y++,(v||y)&&Y++,(C||R)&&Y++),Nf("tuning",{label:"Queue, review engine and access",count:Y,save:()=>re(),discard:()=>M&&U(M)}),!s)return r.jsx(qe,{children:"Loading…"});const I=H=>ce=>a({...s,[H]:ce}),G=H=>ce=>a({...s,engine:{...s.engine,[H]:ce}});async function re(){if(!s)return;let H;if(d.trim())try{H=JSON.parse(d)}catch{t("Repository defaults: not valid JSON",!0);return}const ce={...s,engine:{...s.engine,defaults:H},extra_env:l.split(/[\s,]+/).map(le=>le.trim()).filter(Boolean),dashboard_token:v,clear_dashboard_token:y,dashboard_token_valid_days:k,metrics_token:C,clear_metrics_token:R};try{U(await kn("/admin/api/tuning",ce)),t("Settings saved")}catch(le){t(Ee(le),!0)}}const X=s.engine.verify===void 0||s.engine.verify===null?"":String(s.engine.verify);return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(li,{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(Ke,{className:"lg:grid-cols-3",children:[r.jsx(Zn,{label:"Reviews at once",min:1,max:64,value:s.workers,onChange:I("workers"),hint:r.jsx(se,{children:"Each one is a container or pod with the Executor page's resources."})}),r.jsx(Zn,{label:"Waiting reviews (queue size)",min:1,max:1e4,value:s.queue_size,onChange:I("queue_size"),hint:r.jsx(se,{children:"More webhooks get HTTP 503 and the code host retries."})}),r.jsx(te,{label:"Review timeout",hint:r.jsx(se,{children:"Between 1m and 6h."}),children:r.jsx(xe,{value:s.job_timeout,placeholder:"20m",onChange:H=>I("job_timeout")(H.target.value)})}),r.jsx(te,{label:"Wait after a push",hint:r.jsx(se,{children:"Pushes within this time become one review. 0s reviews at once."}),children:r.jsx(xe,{value:s.debounce,placeholder:"30s",onChange:H=>I("debounce")(H.target.value)})}),r.jsx(Zn,{label:"Jobs on the dashboard",min:10,max:5e3,value:s.history,onChange:I("history")})]})}),r.jsx(li,{title:"Review engine",description:"The codereview CLI's review settings. Leave a field empty for the CLI's default.",children:r.jsxs(Ke,{className:"lg:grid-cols-3",children:[r.jsx(Zn,{label:"Model calls at once, per review",placeholder:"4",min:0,max:32,value:s.engine.concurrency,onChange:G("concurrency")}),r.jsx(Zn,{label:"Tokens per model call",placeholder:"40000",min:0,value:s.engine.batch_tokens,onChange:G("batch_tokens")}),r.jsx(Zn,{label:"Skip reviews with more files than",placeholder:"150",min:0,value:s.engine.max_files,onChange:G("max_files")}),r.jsx(Zn,{label:"Send whole files up to (lines)",placeholder:"800",min:0,value:s.engine.full_file_max_lines,onChange:G("full_file_max_lines")}),r.jsx(Zn,{label:"Context lines around changes",placeholder:"60",min:0,value:s.engine.context_lines,onChange:G("context_lines")}),r.jsx(Zn,{label:"Review passes",placeholder:"1",min:0,max:3,value:s.engine.passes,onChange:G("passes"),hint:r.jsx(se,{children:"2 or 3 catch more, for one more model call each."})}),r.jsx(te,{label:"Verification pass",children:r.jsxs(Ne,{value:X,onChange:H=>G("verify")(H.target.value===""?null:H.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(te,{label:"Verification model",children:r.jsxs(Ne,{value:s.engine.verify_model||"",onChange:H=>G("verify_model")(H.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(H=>r.jsx("option",{value:H,children:H},H))]})}),r.jsx(te,{label:"The verifier may drop",children:r.jsxs(Ne,{value:s.engine.verify_can_drop||"",onChange:H=>G("verify_can_drop")(H.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(te,{label:"The verifier may add findings",children:r.jsxs(Ne,{value:String(!!s.engine.verify_can_add),onChange:H=>G("verify_can_add")(H.target.value==="true"),children:[r.jsx("option",{value:"false",children:"No"}),r.jsx("option",{value:"true",children:"Yes"})]})}),r.jsx(te,{label:"Repository config file",children:r.jsx(xe,{placeholder:".codereview.yaml",value:s.engine.repo_config_file||"",onChange:H=>G("repo_config_file")(H.target.value)})}),r.jsx(te,{label:"Repositories may pick a model",children:r.jsxs(Ne,{value:String(s.allow_repo_model),onChange:H=>I("allow_repo_model")(H.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(te,{label:"Repository defaults (JSON)",className:"lg:col-span-3",hint:r.jsx(se,{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(ln,{rows:4,spellCheck:!1,className:"font-mono text-xs",placeholder:'{"language": "English", "path_filters": ["!**/*.lock"]}',value:d,onChange:H=>h(H.target.value)})})]})}),r.jsx(li,{title:"Bot and review jobs",children:r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Default bot name",hint:r.jsx(se,{children:"The mention handle (@name review) for hosts that set none. Empty: each host's token user."}),children:r.jsx(xe,{placeholder:"codereview",value:s.bot_name||"",onChange:H=>I("bot_name")(H.target.value)})}),r.jsx(te,{label:"Extra environment variables for reviews",hint:r.jsxs("span",{className:"grid gap-1",children:[r.jsx(se,{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(H=>r.jsxs(Je,{kind:s.env_set[H]?"on":"warn",children:[H,s.env_set[H]?"":": not set"]},H))})]}),children:r.jsx(xe,{placeholder:"MY_PROXY_CA, SSL_CERT_DIR",value:l,onChange:H=>u(H.target.value)})})]})}),r.jsx(li,{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(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Who can open it",hint:r.jsx(se,{children:iR(s.dashboard_access,s.dashboard_token_set||!!v,y)}),children:r.jsxs(Ne,{value:s.dashboard_access,onChange:H=>I("dashboard_access")(H.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(te,{label:"Dashboard token",hint:r.jsx(se,{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(xe,{className:"max-w-sm font-mono",placeholder:s.dashboard_token_set?"Set (leave empty to keep it)":"Not set",value:v,onChange:H=>{g(H.target.value),x(!1),b(!1)}}),r.jsx(oe,{variant:"outline",onClick:()=>{g(Vg()),x(!1),b(!1)},children:"Generate"}),s.dashboard_token_set&&r.jsx(oe,{variant:"ghost",className:"text-destructive",onClick:()=>{g(""),x(!0)},disabled:y,children:y?"Removed on save":"Remove"})]}),r.jsx(lR,{v:s,clearing:y,replacing:!!v})]})}),v&&r.jsxs(r.Fragment,{children:[r.jsx(te,{label:"New token valid for",hint:r.jsx(se,{children:"Counted from when you save. After that the link stops working until a new token is generated."}),children:r.jsxs(Ne,{value:String(k),onChange:H=>w(parseInt(H.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(te,{label:"Link to share",hint:r.jsx(se,{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(xe,{readOnly:!0,className:"font-mono text-xs",value:Wg(v),onFocus:H=>H.target.select()}),r.jsx(oe,{variant:"outline",onClick:()=>{var H;(H=navigator.clipboard)==null||H.writeText(Wg(v)).then(()=>b(!0),()=>t("Copy failed: select the link and copy it",!0))},children:_?"Copied":"Copy link"})]})})]})]})}),r.jsx(li,{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(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Who can read /metrics",hint:r.jsx(se,{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(Ne,{value:s.metrics_access,onChange:H=>I("metrics_access")(H.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(te,{label:"Metrics token",hint:r.jsx(se,{children:R?"Removed when you save.":C?"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(xe,{className:"max-w-sm font-mono",placeholder:s.metrics_token_set?"Set (leave empty to keep it)":"Not set",value:C,onChange:H=>{S(H.target.value),N(!1),P(!1)}}),r.jsx(oe,{variant:"outline",onClick:()=>{S(Vg()),N(!1),P(!1)},children:"Generate"}),s.metrics_token_set&&r.jsx(oe,{variant:"ghost",className:"text-destructive",onClick:()=>{S(""),N(!0)},disabled:R,children:R?"Removed on save":"Remove"})]})}),s.metrics_access!=="off"&&r.jsx(te,{label:"Prometheus scrape config",className:"lg:col-span-2",hint:C?r.jsx(se,{className:"text-warning",children:"Copy it now: once saved, the token can't be shown again."}):r.jsx(se,{children:"Generate a token to fill it in."}),children:r.jsxs("div",{className:"grid gap-2",children:[r.jsx(ln,{readOnly:!0,rows:s.metrics_access==="token"?7:5,className:"font-mono text-xs",value:Bg(s.metrics_access,C),onFocus:H=>H.target.select()}),r.jsx("div",{children:r.jsx(oe,{variant:"outline",size:"sm",onClick:()=>{var H;(H=navigator.clipboard)==null||H.writeText(Bg(s.metrics_access,C)).then(()=>P(!0),()=>t("Copy failed: select the text and copy it",!0))},children:E?"Copied":"Copy"})})]})})]})}),r.jsx(st,{className:"py-4",children:r.jsxs(yw,{className:"flex flex-wrap items-center gap-3",children:[r.jsx(oe,{onClick:re,children:"Save queue and review settings"}),r.jsx(Ge,{children:"Applies to the next review, without a restart."})]})})]})}const Hu=t=>Qr(t),uR={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 dR(){const t=et(),o=to(),[s,a]=m.useState(null);m.useEffect(()=>{Ve("/admin/api/sessions").then(a).catch(h=>t(Ee(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 Eo("/admin/api/sessions/"+h.id)),t("Signed out "+h.email)}catch(v){t(Ee(v),!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(Ee(h),!0)}},d=s?s.filter(h=>!h.current).length:0;return r.jsxs(st,{className:"gap-0 overflow-hidden pb-0",children:[r.jsxs(Xt,{className:"pb-4",children:[r.jsx(un,{className:"h2",children:"Signed-in admins"}),r.jsx(dn,{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(oe,{variant:"outline",size:"sm",onClick:u,children:"Sign out everyone else"})})]}),s?r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{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(se,{children:h.email})]}),r.jsxs(ke,{children:[r.jsx("div",{className:"font-mono text-xs",children:h.ip||"—"}),h.user_agent&&r.jsx(se,{title:h.user_agent,children:Pw(h.user_agent)})]}),r.jsx(ke,{children:Hu(h.created)}),r.jsx(ke,{children:h.last_seen?Hu(h.last_seen):"—"}),r.jsx(ke,{children:Hu(h.expires)}),r.jsx(ke,{className:"pr-6 text-right",children:r.jsx(oe,{size:"sm",variant:"ghost",className:h.current?"":"text-destructive",onClick:()=>l(h),children:"Sign out"})})]},h.id))})]}):r.jsx(qe,{children:"Loading…"})]})}function wn({label:t,value:o,onChange:s,yes:a,no:l,disabled:u,note:d}){return r.jsx(te,{label:t,hint:d,children:r.jsxs(Ne,{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 rs({label:t,value:o,onChange:s,note:a,...l}){return r.jsx(te,{label:t,hint:a,children:r.jsx(xe,{type:"number",value:o||"",...l,onChange:u=>s(parseInt(u.target.value||"0",10))})})}function Fr({title:t,description:o,children:s,unsaved:a=!1}){return r.jsxs(st,{className:a?"border-warning/60":void 0,children:[r.jsxs(Xt,{children:[r.jsxs(un,{className:"h2",children:[t,r.jsx(RE,{show:a})]}),o&&r.jsx(dn,{children:o})]}),r.jsx(Pt,{children:s})]})}function fR(){const t=et(),o=bi(),s=no(),a={learnings:qt("learnings"),budgets:qt("budgets"),sync:qt("branch_sync"),metrics:qt("metrics")},[l,u]=m.useState(null),[d,h]=m.useState(null),[v,g]=m.useState(""),[y,x]=m.useState(0),k=N=>{u(N),h(N),g((N.sync_source_branches||[]).join(", "))};m.useEffect(()=>{Ve("/admin/api/settings").then(k).catch(N=>t(Ee(N),!0))},[]);const _=(()=>{if(!l||!d)return{};const N={};for(const E of Object.keys(d))E!=="source"&&E!=="review_defaults"&&E!=="sync_source_branches"&&Ef(d,l,[E])&&(N[E]=!0);return v.split(",").map(E=>E.trim()).filter(Boolean).join(",")!==(l.sync_source_branches||[]).join(",")&&(N.sync_source_branches=!0),N})(),b=(...N)=>N.some(E=>_[E]),C=N=>{if(!l||!d)return;const{source:E,...P}={...d,review_defaults:N??l.review_defaults,dashboard_title:d.dashboard_title.trim(),sync_source_branches:v.split(",").map(M=>M.trim()).filter(Boolean)};return kn("/admin/api/settings",P).then(M=>{k(M),x(F=>F+1),o(),t("Settings saved")}).catch(M=>t(Ee(M),!0))};if(Nf("settings",{label:"Settings",count:Object.keys(_).length,save:()=>C(),discard:()=>l&&k(l)}),!l||!d)return r.jsx(qe,{children:"Loading…"});const S=N=>E=>h({...d,[N]:E}),R=Object.keys(l.source||{}).filter(N=>l.source[N]==="config").map(N=>uR[N]||N.replace(/_/g," "));return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(Fr,{title:"Repository access",unsaved:b("allowlist","require_reviewer","skip_branch_sync","sync_source_branches","score_labels","commit_status","command_access"),description:"Which repositories are reviewed, and when.",children:r.jsxs(Ke,{children:[r.jsx(wn,{label:"Repositories no rule matches",value:d.allowlist,onChange:S("allowlist"),yes:"Not reviewed (allowlist on)",no:"Reviewed (allowlist off)"}),r.jsx(wn,{label:"Who asks for a review",value:d.require_reviewer,onChange:S("require_reviewer"),yes:"Only when the bot is a reviewer",no:"Any opened MR or push"}),r.jsx(wn,{label:"Branch syncs (source is the default branch)",value:d.skip_branch_sync,onChange:S("skip_branch_sync"),yes:"Skip",no:"Review",disabled:!a.sync,note:r.jsx(Xa,{feature:"branch_sync"})}),r.jsx(te,{label:"Also treat these source branches as syncs",children:r.jsx(xe,{placeholder:"develop, release/*",value:v,disabled:!a.sync,onChange:N=>g(N.target.value)})}),r.jsx(wn,{label:"Score labels on MRs/PRs",value:d.score_labels,onChange:S("score_labels"),yes:"On",no:"Off"}),r.jsx(wn,{label:"Commit status on the reviewed commit",value:d.commit_status,onChange:S("commit_status"),yes:"On",no:"Off"}),r.jsx(te,{label:"Who can run review and question commands",hint:r.jsx(Ge,{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(Ne,{value:d.command_access||"write",onChange:N=>S("command_access")(N.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",unsaved:b("approve","approve_block","approve_min_score","approve_withdraw"),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(Ke,{children:[r.jsx(wn,{label:"Approve when the review passes",value:d.approve,onChange:S("approve"),yes:"On",no:"Off"}),r.jsx(te,{label:"Findings that block approval",hint:r.jsx(Ge,{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(Ne,{value:d.approve_block||"major",onChange:N=>S("approve_block")(N.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(rs,{label:"Lowest score to approve",value:d.approve_min_score,onChange:S("approve_min_score"),min:0,max:100,placeholder:"0",note:r.jsx(Ge,{className:"text-xs",children:"Every score (quality, security, maintainability) must be at least this. 0 ignores the scores."})}),r.jsx(wn,{label:"When a later review doesn't pass",value:d.approve_withdraw,onChange:S("approve_withdraw"),yes:"Withdraw the bot's approval",no:"Leave it"})]}),r.jsx(Ge,{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",unsaved:b("learnings_enabled","learnings_auto_activate"),children:r.jsxs(Ke,{children:[r.jsx(wn,{label:"Learn from replies to the bot",value:d.learnings_enabled,onChange:S("learnings_enabled"),yes:"On",no:"Off",disabled:!a.learnings,note:r.jsx(Xa,{feature:"learnings"})}),r.jsx(wn,{label:"New learnings",value:d.learnings_auto_activate,onChange:S("learnings_auto_activate"),yes:"Apply at once",no:"Wait for an admin's approval",disabled:!a.learnings,note:r.jsx(Ge,{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",unsaved:b("daily_token_budget","repo_daily_token_budget"),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(Ke,{className:"lg:grid-cols-2",children:[r.jsx(rs,{label:"Daily tokens, all repositories",min:0,step:1e4,placeholder:"0 = no limit",value:d.daily_token_budget,onChange:S("daily_token_budget"),disabled:!a.budgets,note:r.jsx(Xa,{feature:"budgets"})}),r.jsx(rs,{label:"Daily tokens per repository",min:0,step:1e4,placeholder:"0 = no limit",value:d.repo_daily_token_budget,onChange:S("repo_daily_token_budget"),disabled:!a.budgets})]}),a.budgets&&!d.daily_token_budget&&!d.repo_daily_token_budget&&r.jsx(Ge,{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",unsaved:b("review_retention_days","webhook_retention_days"),children:r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(rs,{label:"Keep reviews (days)",min:1,max:3650,value:d.review_retention_days,onChange:S("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(rs,{label:"Keep webhook deliveries (days)",min:1,max:3650,value:d.webhook_retention_days,onChange:S("webhook_retention_days")})]})}),r.jsx(Fr,{title:"Admin sessions",unsaved:b("session_idle_minutes"),description:"Every admin session also ends after session_ttl (12 hours by default), whatever happens.",children:r.jsx(Ke,{children:r.jsx(rs,{label:"Sign out after inactivity (minutes)",min:0,max:1440,placeholder:"0 = never",value:d.session_idle_minutes,onChange:S("session_idle_minutes"),note:r.jsx(Ge,{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",unsaved:b("dashboard_enabled","hide_repos","dashboard_title"),description:"Who can open it is set under Status dashboard access, further down.",children:r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(wn,{label:"Dashboard",value:d.dashboard_enabled,onChange:S("dashboard_enabled"),yes:"On",no:"Off"}),r.jsx(wn,{label:"Repository names",value:!d.hide_repos,onChange:N=>S("hide_repos")(!N),yes:"Shown",no:"Hidden"}),r.jsx(te,{label:"Title",className:"sm:col-span-2",children:r.jsx(xe,{maxLength:120,value:d.dashboard_title,onChange:N=>S("dashboard_title")(N.target.value)})})]})})]}),r.jsx(st,{className:"py-4",children:r.jsxs(yw,{className:"flex flex-wrap items-center gap-3",children:[r.jsx(oe,{onClick:()=>C(),children:"Save settings"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[Object.keys(_).length?"The cards marked Unsaved have changes; the bar at the bottom of the window saves them too. ":"",R.length?"Showing defaults for: "+R.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(Rf,{value:l.review_defaults,onSave:C,saveLabel:"Save default review settings",unsaved:"Default review settings"},y)}),r.jsx(_d,{name:"Queue, review engine and access settings",children:r.jsx(cR,{})}),r.jsx(_d,{name:"Sign-in sessions",children:r.jsx(dR,{})}),r.jsx(Ge,{children:"These settings are kept in the database and apply without a restart. Every change is in the audit log."})]})}const Va={actor:"",action:"",target:"",q:"",from:"",to:""},hR=["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 Ja(t,o="",s={}){if(t&&typeof t=="object"&&!Array.isArray(t)){for(const[a,l]of Object.entries(t))Ja(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 pR=t=>{const[o,s]=t.split(":");return o.replace(/_/g," ")+" "+(s||"changed")};function zw({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 v=Ja(a.before),g=Ja(a.after);a.before==null&&"after"in a&&(h="created"),"after"in a||(h="deleted");for(const y of Array.from(new Set([...Object.keys(v),...Object.keys(g)])).sort())v[y]!==g[y]&&d.push({key:y,old:a.before==null?void 0:v[y],now:"after"in a?g[y]:void 0})}else d=Object.entries(Ja(t)).map(([v,g])=>({key:v,now:g}));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(v=>r.jsxs("div",{className:"break-all",children:[r.jsx("span",{className:"font-medium",children:v.key}),": ",v.old!==void 0&&r.jsx("span",{className:"text-destructive line-through",children:v.old||"∅"}),v.old!==void 0&&v.now!==void 0&&" → ",v.now!==void 0&&r.jsx("span",{className:l?"text-success":"",children:v.now||"∅"})]},v.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(v=>r.jsx(Tt,{variant:"outline",className:"font-normal",children:pR(v)},v))}),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 mR(){const t=et(),o=qt("audit"),[s,a]=Ff(Va),[l,u]=m.useState(s),[d,h]=m.useState(null),[v,g]=m.useState(0),[y,x]=m.useState(!1),k=(S,R)=>{x(!0),Ve("/admin/api/audit?"+$r(S,R)).then(N=>{h(E=>R&&E?[...E,...N.entries]:N.entries),g(N.next)}).catch(N=>t(Ee(N),!0)).finally(()=>x(!1))};if(m.useEffect(()=>{o&&(u(s),k(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 w=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)?k(R):a(R)},b=()=>{u(Va),$r(s)?a(Va):k(Va)},C=S=>"/admin/api/audit/export?"+$r(s)+($r(s)?"&":"")+"format="+S;return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(fn,{children:r.jsxs("form",{onSubmit:_,className:"grid gap-3 p-4 sm:grid-cols-2 lg:grid-cols-6",children:[r.jsx(te,{label:"Who",children:r.jsx(xe,{placeholder:"email",value:l.actor,onChange:w("actor")})}),r.jsxs(te,{label:"Action",children:[r.jsx(xe,{list:"audit-actions",placeholder:"host.* or login.denied",value:l.action,onChange:w("action")}),r.jsx("datalist",{id:"audit-actions",children:hR.map(S=>r.jsx("option",{value:S},S))})]}),r.jsx(te,{label:"Target",children:r.jsx(xe,{placeholder:"gitlab:group/project",value:l.target,onChange:w("target")})}),r.jsx(te,{label:"Search",children:r.jsx(xe,{placeholder:"in targets and details",value:l.q,onChange:w("q")})}),r.jsx(te,{label:"From",children:r.jsx(xe,{type:"date",value:l.from,onChange:w("from")})}),r.jsx(te,{label:"To",children:r.jsx(xe,{type:"date",value:l.to,onChange:w("to")})}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2 lg:col-span-6",children:[r.jsx(oe,{type:"submit",children:"Apply"}),r.jsx(oe,{type:"button",variant:"ghost",onClick:b,children:"Clear"}),r.jsx("span",{className:"flex-1"}),r.jsx(oe,{asChild:!0,variant:"outline",size:"sm",children:r.jsx("a",{href:C("csv"),children:"Export CSV"})}),r.jsx(oe,{asChild:!0,variant:"outline",size:"sm",children:r.jsx("a",{href:C("jsonl"),children:"Export JSON Lines"})})]})]})}),r.jsxs(fn,{children:[d?d.length?r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{children:d.map(S=>r.jsxs(ct,{children:[r.jsx(ke,{className:"pl-4 align-top whitespace-nowrap text-muted-foreground",title:Tl(S.at),children:Qr(S.at,!0)}),r.jsxs(ke,{className:"align-top",children:[S.actor,S.ip&&r.jsxs(se,{title:S.user_agent,children:[S.ip,S.user_agent?" · "+Pw(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(zw,{detail:S.detail})})]},S.id))})]}):r.jsx(qe,{children:$r(s)?"Nothing matches these filters.":"No admin activity yet."}):r.jsx(qe,{children:"Loading…"}),v>0&&r.jsx("div",{className:"flex justify-center p-3",children:r.jsx(oe,{variant:"outline",disabled:y,onClick:()=>k(s,v),children:y?"Loading…":"Older entries"})})]})]})}const gR=t=>t==="applied"?"on":t==="pending"?"warn":t==="failed"?"off":"idle";function vR(){const t=et(),o=no(),s=bi(),[a,l]=m.useState("pending"),[u,d]=m.useState(null),[h,v]=m.useState({}),[g,y]=m.useState(null),x=o.role==="admin",k=(b=a)=>Ve("/admin/api/approvals"+(b==="all"?"":"?status="+b)).then(d).catch(C=>t(Ee(C),!0));m.useEffect(()=>{k()},[a]);const w=async(b,C)=>{var S,R;try{const N=await Qt(`/admin/api/approvals/${b.id}/${C}`,C==="reject"?{reason:h[b.id]||""}:void 0);if(C==="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"')&&y({summary:b.summary,response:N.response})}else t(C==="reject"?"Rejected":"Cancelled");k(),s()}catch(N){t(Ee(N),!0)}},_=(u||[]).filter(b=>x||b.requested_by===o.email);return r.jsxs("section",{className:"grid gap-4",children:[r.jsx(Ge,{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 for an admin. Approving runs the change as the operator, with the same checks, and the audit log names both of you. Requests expire after 7 days. Merge requests the bot approved are marked on Reviews.":"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."}),g&&r.jsx(fn,{children:r.jsxs("div",{className:"grid gap-2 p-4",children:[r.jsxs("div",{className:"font-medium",children:[g.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(g.response,null,2)}),r.jsx("div",{children:r.jsx(oe,{variant:"outline",size:"sm",onClick:()=>y(null),children:"Done"})})]})}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs(Ne,{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(fn,{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(Je,{kind:gR(b.status),children:b.status==="pending"?"waiting":b.status})]}),r.jsxs(se,{children:["asked by ",b.requested_by," · ",r.jsx("span",{title:Tl(b.requested_at),children:Qr(b.requested_at)}),b.decided_by&&b.status!=="pending"&&r.jsxs(r.Fragment,{children:[" · ",b.status," by ",b.decided_by,b.decided_at?" "+Qr(b.decided_at):""]})]}),b.result&&b.status!=="applied"&&r.jsx(se,{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(oe,{size:"sm",onClick:()=>w(b,"approve"),children:"Approve"}),x&&r.jsxs(r.Fragment,{children:[r.jsx(xe,{className:"h-8 max-w-60",placeholder:"Reason (optional)",value:h[b.id]||"",onChange:C=>v({...h,[b.id]:C.target.value})}),r.jsx(oe,{size:"sm",variant:"outline",onClick:()=>w(b,"reject"),children:"Reject"})]}),b.requested_by===o.email&&r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>w(b,"cancel"),children:"Cancel request"})]})]}),r.jsx("div",{className:"min-w-0",children:r.jsx(zw,{detail:b.preview})})]},b.id))}):r.jsx(qe,{children:a==="pending"?"No change requests wait for an admin.":"No requests yet."}):r.jsx(qe,{children:"Loading…"})})]})}const xR={none:["Free core","idle"],active:["Active","on"],grace:["Expired — grace period","warn"],expired:["Expired","off"],invalid:["Not valid","off"]};function yR(){const t=no(),o=bi(),s=et(),a=to(),l=t.license,[u,d]=m.useState(""),[h,v]=xR[l.state],g=x=>kn("/admin/api/license",{key:x}).then(()=>{d(""),o(),s(x?"License installed":"License removed")}).catch(k=>s(Ee(k),!0)),y=async()=>{await a({title:"Remove the license?",description:"Paid features turn off at once.",action:"Remove license",danger:!0})&&g("")};return r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(st,{children:[r.jsx(Xt,{children:r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(Je,{kind:v,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 ",Lg(l.expires_at)]})]})}),r.jsxs(Pt,{className:"grid gap-4",children:[l.error&&r.jsx(Mn,{variant:"destructive",className:"banner bad",children:r.jsx(An,{children:l.error})}),l.state==="grace"&&r.jsx(Mn,{className:"banner border-warning/40 bg-warning-soft",children:r.jsxs(An,{className:"text-warning",children:["The license has expired. Paid features keep working until ",Lg(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(cl).map(x=>{const k=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 "+(k?"bg-success-soft text-success":"bg-muted text-muted-foreground"),children:k?r.jsx(ml,{className:"size-3"}):r.jsx(bk,{className:"size-3"})}),r.jsx("span",{className:k?"":"text-muted-foreground",children:cl[x]}),r.jsx("span",{className:"sr-only",children:k?"on":"off"})]},x)})})]}),r.jsxs(Ge,{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(st,{children:[r.jsxs(Xt,{children:[r.jsxs(un,{className:"flex items-center gap-2",children:[r.jsx(Rv,{className:"size-4"}),l.state==="none"?"Install a license":"Replace the license"]}),r.jsx(dn,{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(te,{label:"License key",children:r.jsx(ln,{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(oe,{disabled:!u.trim(),onClick:()=>g(u.trim()),children:"Install"}),l.source==="database"&&r.jsx(oe,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:y,children:"Remove license"})]}),r.jsx(Ge,{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(Ge,{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 wR={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"},Hg=t=>t==="azure"||t==="openai-compatible",Tn=t=>typeof t=="string"?t:t==null?"":String(t),bR=["provider","model","api_key_env","base_url","region","timeout"];function jR({profile:t,providers:o,onSaved:s,onCancel:a}){const l=et(),u=()=>{const w=(t==null?void 0:t.config)??{};return{name:(t==null?void 0:t.name)??"",provider:Tn(w.provider)||"anthropic",model:Tn(w.model),api_key_env:Tn(w.api_key_env),base_url:Tn(w.base_url),region:Tn(w.region),timeout:Tn(w.timeout)}},[d,h]=m.useState(u),[v,g]=m.useState(!1),y=w=>_=>h({...d,[w]:_.target.value}),x=async()=>{const w={...(t==null?void 0:t.config)??{}};for(const _ of bR)w[_]=d[_].trim();g(!0);try{s(await kn("/admin/api/models/"+encodeURIComponent(d.name.trim()),{config:w})),l("Saved "+d.name.trim())}catch(_){l(Ee(_),!0)}finally{g(!1)}},k=wR[d.provider];return r.jsxs("div",{className:"grid gap-4",children:[r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Name",hint:r.jsx(se,{children:"Repositories and the default refer to it by this name. Lowercase, e.g. claude or fast."}),children:r.jsx(xe,{value:d.name,onChange:y("name"),disabled:!!t,placeholder:"claude",autoFocus:!t})}),r.jsx(te,{label:"Provider",children:r.jsx(Ne,{value:d.provider,onChange:y("provider"),children:o.map(w=>r.jsx("option",{value:w,children:w},w))})}),r.jsx(te,{label:"Model",className:"lg:col-span-2",hint:r.jsxs(se,{children:["The provider's model ID",d.provider==="bedrock"?" or inference profile ID":"","."]}),children:r.jsx(xe,{value:d.model,onChange:y("model"),placeholder:d.provider==="ollama"?"qwen2.5-coder:14b":""})}),k!==""&&r.jsx(te,{label:"API key: environment variable",className:"lg:col-span-2",hint:r.jsxs(se,{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 ",k,"."]}),children:r.jsx(xe,{value:d.api_key_env,onChange:y("api_key_env"),placeholder:k,spellCheck:!1})}),r.jsx(te,{label:Hg(d.provider)?"Base URL":"Base URL (optional)",className:"lg:col-span-2",hint:r.jsx(se,{children:Hg(d.provider)?"Required for this provider.":"Only for a proxy or a self-hosted endpoint."}),children:r.jsx(xe,{value:d.base_url,onChange:y("base_url"),placeholder:"https://",spellCheck:!1})}),d.provider==="bedrock"&&r.jsx(te,{label:"AWS region",hint:r.jsx(se,{children:"Credentials come from the AWS chain (IRSA, instance role, env)."}),children:r.jsx(xe,{value:d.region,onChange:y("region"),placeholder:"us-east-1"})}),r.jsx(te,{label:"Timeout (optional)",hint:r.jsx(se,{children:"Per request, e.g. 2m or 10m for slow local models."}),children:r.jsx(xe,{value:d.timeout,onChange:y("timeout"),placeholder:"default"})})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(oe,{onClick:x,disabled:v||!d.name.trim()||!d.model.trim(),children:t?"Save profile":"Add profile"}),r.jsx(oe,{variant:"outline",onClick:a,children:"Cancel"})]})]})}function kR({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(Je,{kind:"on",children:"set"}):r.jsx(Je,{kind:"warn",children:"not set in the console"})]}):r.jsx("span",{className:"text-sm text-muted-foreground",children:"none needed"})}function CR({v:t,onSaved:o}){const s=et(),[a,l]=m.useState(t.default),[u,d]=m.useState(t.fallback),[h,v]=m.useState("");m.useEffect(()=>{l(t.default),d(t.fallback)},[t.default,t.fallback.join(",")]);const g=t.profiles.map(w=>w.name),y=g.filter(w=>w!==a&&!u.includes(w)),x=a!==t.default||u.join(",")!==t.fallback.join(","),k=async()=>{try{o(await kn("/admin/api/model-choice",{default:a,fallback:u.filter(w=>w!==a)})),s("Default model saved")}catch(w){s(Ee(w),!0)}};return r.jsxs(st,{children:[r.jsxs(Xt,{children:[r.jsx(un,{className:"h2",children:"Default model"}),r.jsx(dn,{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(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Default",children:r.jsxs(Ne,{value:g.includes(a)?a:"",onChange:w=>l(w.target.value),children:[r.jsx("option",{value:"",disabled:!0,children:"Choose a profile"}),g.map(w=>r.jsx("option",{value:w,children:w},w))]})}),r.jsx(te,{label:"Fallbacks, in order",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[u.map((w,_)=>r.jsxs(Tt,{variant:"secondary",className:"gap-1",children:[_+1,". ",w,r.jsx("button",{type:"button","aria-label":"Remove "+w,className:"rounded-sm hover:text-destructive",onClick:()=>d(u.filter(b=>b!==w)),children:r.jsx(Md,{className:"size-3"})})]},w)),y.length>0&&r.jsxs(Ne,{className:"h-8 w-auto",value:h,onChange:w=>{w.target.value&&d([...u,w.target.value]),v("")},"aria-label":"Add a fallback",children:[r.jsx("option",{value:"",children:u.length?"Add another…":"Add a fallback…"}),y.map(w=>r.jsx("option",{value:w,children:w},w))]}),!u.length&&!y.length&&r.jsx("span",{className:"text-sm text-muted-foreground",children:"add another profile to use one"})]})})]}),r.jsx("div",{children:r.jsx(oe,{onClick:k,disabled:!x||!g.includes(a),children:"Save default"})})]})]})}function SR(){const t=et(),o=to(),s=bi(),[a,l]=m.useState(null),[u,d]=m.useState(null),h=()=>Ve("/admin/api/models").then(l).catch(x=>t(Ee(x),!0));m.useEffect(()=>{h()},[]);const v=x=>{l(x),d(null),s()},g=async x=>{if(await o({title:"Delete "+x.name+"?",description:"Repositories can't pick it any more.",action:"Delete profile",danger:!0}))try{v(await Eo("/admin/api/models/"+encodeURIComponent(x.name))),t("Deleted "+x.name)}catch(k){t(Ee(k),!0)}};if(!a)return r.jsx(qe,{children:"Loading…"});const y=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(oe,{onClick:()=>d("new"),children:[r.jsx(ps,{})," Add profile"]})}),r.jsx(fn,{children:a.profiles.length===0?r.jsx(qe,{children:"No model profiles yet. Add one to start reviewing."}):r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{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(se,{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(se,{children:Tn(x.config.base_url)}),!!x.config.region&&r.jsx(se,{children:Tn(x.config.region)})]}),r.jsx(ke,{className:"align-top",children:r.jsx(kR,{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(oe,{size:"sm",variant:"outline",onClick:()=>d(x),children:"Edit"}),r.jsx(oe,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>g(x),children:"Delete"})]})})]},x.name))})]})}),a.profiles.length>0&&r.jsx(CR,{v:a,onSaved:v}),r.jsx(Ge,{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(Co,{open:u!==null,onClose:()=>d(null),title:y,description:"A provider, a model and where its API key comes from.",children:u!==null&&r.jsx(jR,{profile:u==="new"?null:u,providers:a.providers,onSaved:v,onCancel:()=>d(null)},u==="new"?"new":u.name)})]})}const Gu=t=>Object.entries(t??{}).map(([o,s])=>o+"="+s).join(` -`);function Ku(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 Gg=t=>t&&Object.keys(t).length?JSON.stringify(t,null,2):"";function Kg(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 _R={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"},NR={local:"Local",docker:"Docker",kubernetes:"Kubernetes"};function qg(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:Gu(t.node_selector),labels:Gu(t.pod_labels),annotations:Gu(t.pod_annotations),tolerations:Gg(t.tolerations),affinity:Gg(t.affinity),caKind:o.config_map?"config_map":o.secret?"secret":"",caName:o.config_map||o.secret||"",caKey:o.key??""}}function ER(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:Ku("Node selector",t.nodeSelector),pod_labels:Ku("Pod labels",t.labels),pod_annotations:Ku("Pod annotations",t.annotations),tolerations:Kg("Tolerations",t.tolerations,!0),affinity:Kg("Affinity",t.affinity,!1),ca_bundle:t.caKind?{[t.caKind]:t.caName.trim(),key:t.caKey.trim()}:{}}}const qu="__other__";function RR({v:t,version:o,custom:s}){const a=/^v?\d+\.\d+\.\d+$/.test(o)?o.replace(/^v/,""):"";return r.jsxs(se,{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 PR(){const t=et(),[o,s]=m.useState(null),[a,l]=m.useState(null),[u,d]=m.useState(!1),[h,v]=m.useState(!1),g=b=>{s(b),l(qg(b.settings)),v(!b.tags.includes(b.settings.version))};if(m.useEffect(()=>{Ve("/admin/api/executor").then(g).catch(b=>t(Ee(b),!0))},[]),!o||!a)return r.jsx(qe,{children:"Loading…"});const y=b=>C=>l({...a,[b]:C.target.value}),x=o.type==="kubernetes",k=JSON.stringify(a)!==JSON.stringify(qg(o.settings)),w=async()=>{let b;try{b=ER(a)}catch(C){t(Ee(C),!0);return}d(!0);try{g(await kn("/admin/api/executor",b)),t("Saved: the next review uses these settings")}catch(C){t(Ee(C),!0)}finally{d(!1)}},_=Object.entries(o.fixed);return r.jsxs("section",{className:"grid max-w-4xl gap-4",children:[r.jsxs(st,{children:[r.jsxs(Xt,{children:[r.jsxs(un,{className:"h2 flex flex-wrap items-center gap-2",children:["Reviews run with ",NR[o.type]??o.type,!o.licensed&&r.jsx(Tt,{variant:"destructive",children:"paused: needs a license"})]}),r.jsx(dn,{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,C])=>r.jsxs("div",{className:"contents",children:[r.jsx("dt",{className:"text-muted-foreground",children:_R[b]??b}),r.jsx("dd",{children:b==="env"||b==="service_account"||b==="namespace"?r.jsx("code",{className:"text-xs break-all",children:C}):C})]},b))]})})]}),o.editable&&r.jsxs(st,{children:[r.jsxs(Xt,{children:[r.jsxs(un,{className:"h2",children:["Review ",x?"pods":"containers"]}),r.jsx(dn,{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(Ke,{children:[r.jsx(te,{label:"Version",className:"lg:col-span-3",hint:r.jsx(RR,{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(Ne,{"aria-label":"Version",className:"w-auto min-w-36",value:h?qu:a.version,onChange:b=>{b.target.value===qu?v(!0):(v(!1),l({...a,version:b.target.value}))},children:[o.tags.map((b,C)=>r.jsxs("option",{value:b,children:[b,C===0?" (newest)":"",b===o.settings.version?" (current)":""]},b)),r.jsx("option",{value:qu,children:"Other: tag or digest…"})]}),(h||o.tags.length===0)&&r.jsx(xe,{value:a.version,onChange:y("version"),placeholder:"0.5.0",spellCheck:!1,"aria-label":o.tags.length?"Other version":"Version",className:"sm:max-w-64"})]})}),r.jsx(te,{label:"CPU",hint:r.jsxs(se,{children:[x?"Request and limit, e.g. 500m or 1.":"docker --cpus, e.g. 1.5."," Empty = no limit."]}),children:r.jsx(xe,{value:a.cpu,onChange:y("cpu"),placeholder:x?"500m":"1"})}),r.jsx(te,{label:"Memory",hint:r.jsxs(se,{children:[x?"Request and limit, e.g. 1Gi.":"docker --memory, e.g. 2g."," Empty = no limit."]}),children:r.jsx(xe,{value:a.memory,onChange:y("memory"),placeholder:x?"1Gi":"2g"})}),x&&r.jsx(te,{label:"Disk (ephemeral storage)",hint:r.jsx(se,{children:"Request and limit for the pod's local disk, /tmp included. Empty = 2Gi; none = no limit."}),children:r.jsx(xe,{value:a.storage,onChange:y("storage"),placeholder:"2Gi"})}),x&&r.jsx(te,{label:"/tmp size",hint:r.jsx(se,{children:"A review writing more is evicted instead of filling the node's disk. Empty = 1Gi; none = no limit."}),children:r.jsx(xe,{value:a.tmp,onChange:y("tmp"),placeholder:"1Gi"})}),x&&r.jsx(te,{label:"Keep finished jobs for",hint:r.jsx(se,{children:"For debugging with kubectl, e.g. 10m or 1h."}),children:r.jsx(xe,{value:a.ttl,onChange:y("ttl"),placeholder:"10m"})})]}),x&&r.jsxs(r.Fragment,{children:[r.jsxs(Ke,{className:"lg:grid-cols-2",children:[r.jsx(te,{label:"Node selector",hint:r.jsx(se,{children:"One key=value per line."}),children:r.jsx(ln,{rows:3,value:a.nodeSelector,onChange:y("nodeSelector"),placeholder:"workload=batch",spellCheck:!1,className:"font-mono text-xs"})}),r.jsx(te,{label:"Priority class",hint:r.jsx(se,{children:"An existing PriorityClass, e.g. for low-priority batch work."}),children:r.jsx(xe,{value:a.priority,onChange:y("priority"),placeholder:"batch-low"})}),r.jsx(te,{label:"Pod labels",hint:r.jsx(se,{children:"key=value per line. The console's own labels win on a clash."}),children:r.jsx(ln,{rows:3,value:a.labels,onChange:y("labels"),placeholder:"team=platform",spellCheck:!1,className:"font-mono text-xs"})}),r.jsx(te,{label:"Pod annotations",hint:r.jsx(se,{children:"key=value per line, e.g. karpenter.sh/do-not-disrupt=true."}),children:r.jsx(ln,{rows:3,value:a.annotations,onChange:y("annotations"),spellCheck:!1,className:"font-mono text-xs"})}),r.jsx(te,{label:"Tolerations (JSON)",hint:r.jsx(se,{children:"A list in the Kubernetes format."}),children:r.jsx(ln,{rows:5,value:a.tolerations,onChange:y("tolerations"),placeholder:'[{"key": "spot", "operator": "Exists", "effect": "NoSchedule"}]',spellCheck:!1,className:"font-mono text-xs"})}),r.jsx(te,{label:"Affinity (JSON)",hint:r.jsx(se,{children:"An object in the Kubernetes format (nodeAffinity, podAntiAffinity…)."}),children:r.jsx(ln,{rows:5,value:a.affinity,onChange:y("affinity"),placeholder:'{"nodeAffinity": {…}}',spellCheck:!1,className:"font-mono text-xs"})})]}),r.jsxs(Ke,{children:[r.jsx(te,{label:"Extra CA certificates",hint:r.jsx(se,{children:"For a code host or model endpoint behind a private CA. Trusted in addition to the system CAs."}),children:r.jsxs(Ne,{value:a.caKind,onChange:y("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(te,{label:a.caKind==="secret"?"Secret name":"ConfigMap name",hint:r.jsxs(se,{children:["In the ",o.fixed.namespace," namespace."]}),children:r.jsx(xe,{value:a.caName,onChange:y("caName"),placeholder:"corp-ca"})}),r.jsx(te,{label:"Key",hint:r.jsx(se,{children:"The PEM file inside it."}),children:r.jsx(xe,{value:a.caKey,onChange:y("caKey"),placeholder:"ca.crt"})})]})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(oe,{onClick:w,disabled:u||!k&&o.source==="console",children:"Save settings"}),k&&r.jsx(oe,{variant:"outline",onClick:()=>g(o),children:"Discard changes"})]})]})]}),r.jsx(Ge,{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 TR={"/license":"Open License","/hosts":"Open Code hosts","/webhooks":"Open Webhooks","/models":"Open Models","/settings":"Open Settings","/repositories":"Open Repositories","/reviews":"Open Reviews"};function OR(){const t=et(),o=bi(),[s,a]=m.useState(null),l=m.useRef(""),u=(v=!1)=>(v?PE:Ve)("/admin/api/setup").then(g=>{a(g);const y=g.done+"/"+g.complete;l.current!==y&&(l.current!==""&&o(),l.current=y)}).catch(g=>t(Ee(g),!0));if(m.useEffect(()=>{u();const v=window.setInterval(()=>u(!0),15e3);return()=>window.clearInterval(v)},[]),!s)return r.jsx(qe,{children:"Loading…"});const d=s.steps.find(v=>!v.done&&!v.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(st,{children:[r.jsxs(Xt,{children:[r.jsx(un,{className:"h2",children:s.complete?"All set":"Get your first review"}),r.jsx(dn,{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(v=>v.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(oe,{variant:"outline",size:"sm",onClick:()=>u(),children:[r.jsx(Bv,{})," Check again"]})})]})]}),r.jsx("ol",{className:"grid gap-3",children:s.steps.map((v,g)=>{const y=(d==null?void 0:d.id)===v.id;return r.jsx("li",{children:r.jsx(st,{className:ae("gap-3 py-4",y&&"border-primary ring-1 ring-primary/40"),children:r.jsxs(Pt,{className:"flex gap-3 px-4",children:[r.jsx("div",{className:ae("mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",v.done&&v.warning?"border-warning bg-warning-soft text-warning":v.done?"border-success bg-success-soft text-success":y?"border-primary text-primary":"text-muted-foreground"),"aria-hidden":!0,children:v.done?r.jsx(ml,{className:"size-4"}):y?g+1:r.jsx(bv,{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:v.title}),v.optional&&r.jsx(Tt,{variant:"outline",className:"font-normal text-muted-foreground",children:"optional"}),y&&r.jsx(Tt,{children:"next"}),r.jsx("span",{className:"sr-only",children:v.done?"done":"not done"})]}),v.warning&&r.jsx("div",{className:"text-sm text-warning",children:v.warning}),v.detail&&r.jsx("div",{className:ae("text-sm",v.done&&!v.warning?"text-success":v.done?"text-muted-foreground":/rejected|failed|expired|not valid|won't work|not set/.test(v.detail)?"text-destructive":"text-muted-foreground"),children:v.detail}),(!v.done||y)&&r.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:v.help}),v.link&&!v.done&&r.jsx("div",{children:r.jsx(oe,{asChild:!0,size:"sm",variant:y?"default":"outline",children:r.jsxs(Yt,{to:v.link,children:[TR[v.link]||"Open"," ",r.jsx(uk,{})]})})})]})]})})},v.id)})}),r.jsx(Ge,{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 Ha=[["critical","Critical","--st-fail"],["major","Major","--warning"],["minor","Minor","--sc-quality"],["nitpick","Nitpick","--st-skip"],["other","Other","--muted-foreground"]],Yg=[["30d","Last 30 days"],["90d","Last 90 days"],["365d","Last 12 months"],["all","All history"]];function Ur(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 Br({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(st,{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 os({title:t,description:o,children:s}){return r.jsxs(st,{className:"py-4",children:[r.jsxs(Xt,{className:"px-4",children:[r.jsx(un,{className:"h2",children:t}),o&&r.jsx(dn,{children:o})]}),r.jsx(Pt,{className:"grid gap-3 px-4",children:s})]})}function Qg({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 Xg({rows:t,unit:o,link:s}){return t.length?r.jsx(fn,{children:r.jsxs($n,{children:[r.jsx(Un,{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(Bn,{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(se,{children:[a.platform," · ",a.host]})]}),r.jsx(ke,{className:"pr-4 text-right tabular-nums",children:ze(a.count)})]},`${a.platform}|${a.host}|${a.repo}`))})]})}):r.jsx(se,{children:"Nothing in this period."})}function Jg({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:ze(a)})]},s))}):r.jsx(se,{children:"No findings in this period."})}function DR(){var k;const t=et(),o=qt("metrics"),[s,a]=m.useState("30d"),[l,u]=m.useState(null);m.useEffect(()=>{u(null),Ve("/admin/api/impact?range="+s).then(u).catch(w=>t(Ee(w),!0))},[s]);const d=l?Pf({granularity:l.granularity,from:l.from,to:l.to,points:l.trend.map(w=>({bucket:w.bucket,reviews:w.reviews,...w.findings,scored:w.scored,quality_sum:w.quality_sum,security_sum:w.security_sum,maintainability_sum:w.maintainability_sum}))}):[],h=(l==null?void 0:l.range)==="all"?d.slice(Math.max(0,d.findIndex(w=>w.reviews))):d,v=l?Object.fromEntries(cn.map(([w])=>[w,ds({bucket:"",...l},w)])):{},g=((k=Yg.find(([w])=>w===s))==null?void 0:k[0])??"30d",y=w=>"/admin/api/impact/export?"+new URLSearchParams({range:g,format:w}).toString(),x=l?Ha.filter(([w])=>l.by_severity[w]).map(([w,_])=>`${ze(l.by_severity[w])} ${_.toLowerCase()}`).join(" · "):"";return r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(lr,{children:[r.jsx(Ne,{className:"w-auto","aria-label":"Period",value:s,onChange:w=>a(w.target.value),children:Yg.map(([w,_])=>r.jsxs("option",{value:w,disabled:!o&&w!=="30d",children:[_,!o&&w!=="30d"?" (licensed)":""]},w))}),l&&r.jsx("span",{className:"text-sm text-muted-foreground",children:MR(l)}),r.jsx("span",{className:"flex-1"}),o&&r.jsxs(r.Fragment,{children:[r.jsx(oe,{asChild:!0,variant:"outline",size:"sm",children:r.jsx("a",{href:y("csv"),children:"Export CSV"})}),r.jsx(oe,{asChild:!0,variant:"outline",size:"sm",children:r.jsx("a",{href:y("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(Br,{value:ze(l.prs_reviewed),label:"Merge requests reviewed",sub:ze(l.review_runs)+" review runs",to:Ur(l,{state:"done"})}),r.jsx(Br,{value:ze(l.findings),label:"Findings raised",sub:x||void 0,to:l.findings?Ur(l,{severity:"any"}):void 0}),r.jsx(Br,{value:ze(l.security_findings),label:"Security findings caught",sub:"before merge, in review",to:l.security_findings?Ur(l,{category:"security"}):void 0}),r.jsx(Br,{value:l.first_reviews?Cd(l.median_first_review_ms):"–",label:"Median time to first review",sub:l.first_reviews?"from the webhook, "+ze(l.first_reviews)+" merge requests":void 0}),r.jsx(Br,{value:ze(l.active_repos),label:"Active repositories"}),r.jsx(Br,{value:ze(l.comments),label:"Comments posted"}),r.jsx(Br,{value:l.scored?cn.map(([w])=>Math.round(v[w]||0)).join(" / "):"–",label:"Avg scores (Q / S / M)",sub:l.scored?ze(l.scored)+" scored reviews":void 0}),r.jsx(Br,{value:ze(l.approvals||0),label:"Approvals by the bot",sub:"merge requests approved on the code host",to:l.approvals?Ur(l,{approval:"approved"}):void 0})]}),o?r.jsxs(r.Fragment,{children:[r.jsxs(os,{title:"Reviews and findings",description:`Review runs and findings per ${l.granularity}.`,children:[r.jsx(Qg,{items:[["reviews","Review runs","--st-done"]]}),r.jsx(Nd,{points:h,granularity:l.granularity,series:[["reviews","Review runs","--st-done"]],label:`Review runs per ${l.granularity}`}),r.jsx(Qg,{items:Ha}),r.jsx(Nd,{points:h,granularity:l.granularity,series:Ha,label:`Findings per ${l.granularity}, by severity`})]}),l.scored>0&&r.jsxs(os,{title:"Average scores",description:"Dashed lines at 80 and 50 are the bands of the score labels.",children:[r.jsx(Of,{values:v}),r.jsx(Tf,{points:h,granularity:l.granularity})]}),r.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[r.jsx(os,{title:"Findings by severity",children:r.jsx(Jg,{rows:Ha.map(([w,_,b])=>[_,l.by_severity[w]||0,b,w==="other"?void 0:Ur(l,{severity:w})])})}),r.jsx(os,{title:"Findings by category",children:r.jsx(Jg,{rows:l.by_category.map(w=>[w.category||"other",w.count,void 0,w.category&&w.category!=="other"?Ur(l,{category:w.category}):void 0])})}),r.jsx(os,{title:"Top repositories by reviews",children:r.jsx(Xg,{rows:l.top_by_reviews,unit:"Review runs",link:w=>Ur(l,{host:w.host||"",repo:w.repo||"",state:"done"})})}),r.jsx(os,{title:"Top repositories by findings",children:r.jsx(Xg,{rows:l.top_by_findings,unit:"Findings",link:w=>Ur(l,{host:w.host||"",repo:w.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(Ge,{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 MR(t){if(t.range==="all")return"Everything recorded (UTC)";const o=t.granularity==="month"?IE:LE;return o(t.from)+" – "+o(t.through)+" (UTC)"}const $f=[{path:"setup",title:"Setup",icon:Nk,el:r.jsx(OR,{})},{path:"repositories",title:"Repositories",icon:xk,el:r.jsx(L2,{})},{path:"reviews",title:"Reviews",icon:hk,el:r.jsx(W2,{})},{path:"impact",title:"Impact",icon:Dk,el:r.jsx(DR,{})},{path:"learnings",title:"Learnings",icon:dk,el:r.jsx(G2,{}),paid:"learnings"},{path:"hosts",title:"Code hosts",icon:Rk,el:r.jsx(Z2,{})},{path:"models",title:"Models",icon:fk,el:r.jsx(SR,{})},{path:"executor",title:"Executor",icon:gk,el:r.jsx(PR,{})},{path:"rules",title:"Rules",icon:yk,el:r.jsx(rR,{}),paid:"rules"},{path:"webhooks",title:"Webhooks",icon:Jv,el:r.jsx(sR,{})},{path:"settings",title:"Settings",icon:Tk,el:r.jsx(fR,{})},{path:"change-requests",title:"Change requests",icon:mk,el:r.jsx(vR,{})},{path:"audit",title:"Audit log",icon:Ek,el:r.jsx(mR,{}),paid:"audit"},{path:"license",title:"License",icon:Rv,el:r.jsx(yR,{})}];function AR({me:t}){const o=t.expiry_warnings||[];if(!o.length)return null;const s=o.some(a=>a.severity==="bad");return r.jsx(Mn,{role:"status",variant:s?"destructive":"default",className:s?"banner bad":"banner border-warning/40 bg-warning-soft text-warning",children:r.jsx(An,{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 LR({me:t}){const o=t.license;return t.reviews_paused?r.jsx(Mn,{role:"status",variant:"destructive",className:"banner bad",children:r.jsx(An,{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(Mn,{role:"status",className:"banner border-warning/40 bg-warning-soft text-warning",children:r.jsx(An,{className:"text-warning",children:r.jsxs("p",{children:["The Divmora license expired on ",mi(o.expires_at),". Paid features stop on ",mi(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(Mn,{role:"status",variant:"destructive",className:"banner bad",children:r.jsx(An,{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 IR(){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"?Ok:t==="dark"?kk:jk;return r.jsxs(t2,{children:[r.jsx(n2,{asChild:!0,children:r.jsx(oe,{variant:"ghost",size:"icon",id:"theme","aria-label":"Theme",children:r.jsx(a,{})})}),r.jsxs(r2,{align:"end",children:[r.jsx(s2,{children:"Theme"}),r.jsx(i2,{}),r.jsxs(o2,{value:t,onValueChange:s,children:[r.jsx(Bu,{value:"system",children:"System"}),r.jsx(Bu,{value:"light",children:"Light"}),r.jsx(Bu,{value:"dark",children:"Dark"})]})]})]})}function Fw(t){return $f.find(o=>t.startsWith("/"+o.path))}function zR({me:t}){const o=Fn(),{setOpenMobile:s}=ki(),a=()=>Qt("/admin/logout").finally(()=>location.href="/admin/login");return r.jsxs(x2,{collapsible:"icon",children:[r.jsx(j2,{children:r.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[r.jsx(E2,{}),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(C2,{children:r.jsx(S2,{children:r.jsx(_2,{children:r.jsx(Ig,{className:"side","aria-label":"Sections",children:$f.filter(l=>l.path!=="change-requests"||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=Fw(o.pathname))==null?void 0:h.path)===l.path;return r.jsxs(zg,{children:[r.jsx(Fg,{asChild:!0,isActive:d,tooltip:l.title,children:r.jsxs(Kj,{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(Vu,{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==="change-requests"&&!!t.pending_approvals&&r.jsx(Vu,{className:"text-[10px]",title:t.pending_approvals+" waiting for an admin",children:t.pending_approvals}),u&&r.jsx(Vu,{className:"paid text-[10px] font-normal text-muted-foreground",title:"Needs a license",children:"licensed"})]},l.path)})})})})}),r.jsxs(k2,{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(Ig,{children:r.jsx(zg,{children:r.jsxs(Fg,{id:"logout",onClick:a,tooltip:"Sign out",children:[r.jsx(wk,{}),r.jsx("span",{children:"Sign out"})]})})})]}),r.jsx(w2,{})]})}function FR(){const t=Fn();return r.jsxs(st,{className:"max-w-xl",children:[r.jsxs(Xt,{children:[r.jsx(un,{className:"h2",children:"Page not found"}),r.jsxs(dn,{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(oe,{asChild:!0,children:r.jsx(Yt,{to:"/",children:"Go to the start"})})})]})}function $R(){const t=()=>Qt("/admin/logout").finally(()=>location.href="/admin/login");return r.jsxs(st,{className:"max-w-xl",children:[r.jsxs(Xt,{children:[r.jsx(un,{className:"h2",children:"Sign out?"}),r.jsx(dn,{children:"You'll need to sign in again to use the admin panel."})]}),r.jsxs(Pt,{className:"flex gap-2",children:[r.jsx(oe,{onClick:t,children:"Sign out"}),r.jsx(oe,{asChild:!0,variant:"outline",children:r.jsx(Yt,{to:"/",children:"Stay signed in"})})]})]})}function UR(){return r.jsx(st,{className:"max-w-xl",children:r.jsxs(Xt,{children:[r.jsx(un,{className:"h2",children:"You're signed in again"}),r.jsx(dn,{children:"Close this tab and go back to the page with your changes, then save them."})]})})}function BR({me:t}){const o=Fn(),s=Fw(o.pathname),a=(s==null?void 0:s.title)??(o.pathname==="/logout"?"Sign out":o.pathname==="/signed-in"?"Signed in":"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(y2,{className:"-ml-1"}),r.jsx(cs,{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(IR,{})]})}function WR(){const[t,o]=m.useState(null),[s,a]=m.useState(""),l=()=>Ve("/admin/api/me").then(h=>{Ag(h.csrf),o(h)}).catch(h=>a(String(h.message||h))),[u,d]=m.useState(!1);return m.useEffect(()=>{l();const h=()=>l(),v=()=>d(!0);return window.addEventListener("crc-pending",h),window.addEventListener("crc-signed-out",v),()=>{window.removeEventListener("crc-pending",h),window.removeEventListener("crc-signed-out",v)}},[]),m.useEffect(()=>{if(!u)return;const h=()=>Ve("/admin/api/me").then(v=>{Ag(v.csrf),o(v),d(!1)}).catch(()=>{});return window.addEventListener("focus",h),()=>window.removeEventListener("focus",h)},[u]),t?r.jsx(Nw.Provider,{value:t,children:r.jsx(Ew.Provider,{value:l,children:r.jsx(Tw,{delayDuration:300,children:r.jsx(JE,{children:r.jsx(ZE,{children:r.jsxs(v2,{children:[r.jsx(zR,{me:t}),r.jsxs(b2,{className:"min-w-0",children:[r.jsx(BR,{me:t}),r.jsxs("div",{className:"mx-auto grid w-full max-w-7xl gap-4 p-4 md:p-6",children:[u&&r.jsx(Mn,{role:"alert",className:"banner border-warning/60",children:r.jsxs(An,{className:"flex flex-wrap items-center gap-3",children:[r.jsx("span",{children:"Your session ended. Sign in again in a new tab, then come back here and save: your changes are kept on this page."}),r.jsx(oe,{size:"sm",variant:"outline",asChild:!0,children:r.jsx("a",{href:"/admin/login?next="+encodeURIComponent("/admin/signed-in"),target:"_blank",rel:"noopener",children:"Sign in in a new tab"})})]})}),r.jsx(LR,{me:t}),r.jsx(AR,{me:t}),t.role==="viewer"&&r.jsx(Mn,{role:"status",className:"banner",children:r.jsx(An,{children:"You have read-only access: you can see every page, and changes are refused. Ask an admin to change something."})}),r.jsxs(Aj,{children:[r.jsx(bo,{path:"/",element:r.jsx(qm,{to:t.setup&&!t.setup.complete?"/setup":"/repositories",replace:!0})}),$f.map(h=>r.jsx(bo,{path:"/"+h.path,element:r.jsx(_d,{name:h.title,children:h.el},h.path)},h.path)),r.jsx(bo,{path:"/approvals",element:r.jsx(qm,{to:"/change-requests",replace:!0})}),r.jsx(bo,{path:"/logout",element:r.jsx($R,{})}),r.jsx(bo,{path:"/signed-in",element:r.jsx(UR,{})}),r.jsx(bo,{path:"*",element:r.jsx(FR,{})})]})]}),r.jsx(EE,{})]})]})})})})})}):r.jsx("div",{className:"grid min-h-svh place-items-center text-sm text-muted-foreground",children:s||"Loading…"})}var Zg;const Yu=(Zg=document.querySelector('meta[name="csp-nonce"]'))==null?void 0:Zg.content;Yu&&!Yu.startsWith("__")&&Jj(Yu);G0.createRoot(document.getElementById("root")).render(r.jsx(m.StrictMode,{children:r.jsx(Vj,{basename:"/admin",children:r.jsx(WR,{})})})); diff --git a/internal/admin/ui/assets/index-EyWbtRr3.css b/internal/admin/ui/assets/index-EyWbtRr3.css deleted file mode 100644 index 33b63ee..0000000 --- a/internal/admin/ui/assets/index-EyWbtRr3.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-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.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)}}.border-warning\/60{border-color:var(--warning)}@supports (color:color-mix(in lab,red,red)){.border-warning\/60{border-color:color-mix(in oklab,var(--warning) 60%,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-background\/95{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/95{background-color:color-mix(in oklab,var(--background) 95%,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{background-color:var(--warning)}.bg-warning-soft{background-color:var(--warning-soft)}.bg-warning\/15{background-color:var(--warning)}@supports (color:color-mix(in lab,red,red)){.bg-warning\/15{background-color:color-mix(in oklab,var(--warning) 15%,transparent)}}.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_-4px_12px_rgb\(0_0_0\/0\.06\)\]{--tw-shadow:0 -4px 12px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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\:px-6{padding-inline: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 ac6d323..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