From 2b38268d26ef82cac62244e2cdfe7d622eabc3ce Mon Sep 17 00:00:00 2001 From: Wenner Lucas <138150733+wennerl77@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:52:51 -0300 Subject: [PATCH 1/6] build: Suprimir multi-stage builds pesados em perfis leves (closes #416) --- Makefile | 31 ++++++++++++++++------- docker-compose.dev.yml | 8 ++++-- docker-compose.yml | 8 +++--- docker/strip_builders.py | 53 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 15 deletions(-) create mode 100755 docker/strip_builders.py diff --git a/Makefile b/Makefile index 8d286414..23250f50 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,18 @@ # MicroHelium Makefile # Docker commands for development and production -.PHONY: help build up down restart logs shell migrate seed fresh test lint format deploy rollback smoke +.PHONY: help build check-buildx up down restart logs shell migrate seed fresh test lint format deploy rollback smoke + +# Toolchain profile for compilers (maratona = ~2.1 GB, scripting = ~2.3 GB, funcional = ~4.5 GB, completo = ~9.4 GB) +JUDGE_PROFILE ?= maratona # Default target help: @echo "MicroHelium Docker Commands" @echo "" @echo "Setup:" - @echo " make setup - Initial project setup" - @echo " make build - Build Docker images" + @echo " make setup [JUDGE_PROFILE=...] - Initial project setup (default: maratona, ~2.1 GB vs ~9.4 GB do completo)" + @echo " make build [JUDGE_PROFILE=...] - Build Docker images (profiles: maratona, scripting, funcional, completo)" @echo " make up - Start all containers" @echo " make down - Stop all containers" @echo " make restart - Restart all containers" @@ -66,8 +69,18 @@ setup: build @echo "" @echo "Setup complete! Access the application at http://localhost:8000" -build: - @docker compose build +check-buildx: + @docker buildx version >/dev/null 2>&1 || (echo "ERRO: docker-buildx nao encontrado. Instale com: sudo pacman -S docker-buildx (ou equivalente na sua distribuicao)." && exit 1) + +build: check-buildx + @if [ "$(JUDGE_PROFILE)" = "maratona" ] || [ "$(JUDGE_PROFILE)" = "minimal" ]; then \ + echo "⚙️ Perfil leve detectado: Omitindo compiladores pesados (Portugol, Scratch, Prolog)..."; \ + python3 docker/strip_builders.py; \ + DOCKERFILE_APP=Dockerfile.slim DOCKERFILE_DEV=Dockerfile.dev.slim DOCKERFILE_JUDGE=Dockerfile.judge.slim JUDGE_PROFILE=$(JUDGE_PROFILE) docker compose build; \ + rm -f Dockerfile.slim Dockerfile.dev.slim Dockerfile.judge.slim; \ + else \ + JUDGE_PROFILE=$(JUDGE_PROFILE) docker compose build; \ + fi up: @docker compose up -d @@ -206,8 +219,8 @@ npm-build: IMAGE_TAG ?= prod PROD_COMPOSE = docker compose -f docker-compose.yml -f docker-compose.prod.yml -prod: - @IMAGE_TAG=$(IMAGE_TAG) $(PROD_COMPOSE) build +prod: check-buildx + @IMAGE_TAG=$(IMAGE_TAG) JUDGE_PROFILE=$(JUDGE_PROFILE) $(PROD_COMPOSE) build prod-up: @IMAGE_TAG=$(IMAGE_TAG) $(PROD_COMPOSE) up -d @@ -229,9 +242,9 @@ prod-down: # re-running `git rev-parse` on every one of the several references below. DEPLOY_TAG := $(shell git rev-parse --short HEAD) -deploy: +deploy: check-buildx @echo "Building images tagged $(DEPLOY_TAG)..." - @IMAGE_TAG=$(DEPLOY_TAG) $(PROD_COMPOSE) build app autojudge + @IMAGE_TAG=$(DEPLOY_TAG) JUDGE_PROFILE=$(JUDGE_PROFILE) $(PROD_COMPOSE) build app autojudge @echo "Promoting $(DEPLOY_TAG) to :prod..." @docker tag microhelium-app:$(DEPLOY_TAG) microhelium-app:prod @docker tag microhelium-judge:$(DEPLOY_TAG) microhelium-judge:prod diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 595790d9..7a0711e3 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -3,7 +3,9 @@ services: app: build: context: . - dockerfile: Dockerfile.dev + dockerfile: ${DOCKERFILE_DEV:-Dockerfile.dev} + args: + JUDGE_PROFILE: ${JUDGE_PROFILE:-maratona} container_name: microhelium-app restart: unless-stopped working_dir: /var/www/html @@ -22,7 +24,9 @@ services: queue: build: context: . - dockerfile: Dockerfile.dev + dockerfile: ${DOCKERFILE_DEV:-Dockerfile.dev} + args: + JUDGE_PROFILE: ${JUDGE_PROFILE:-maratona} container_name: microhelium-queue restart: unless-stopped working_dir: /var/www/html diff --git a/docker-compose.yml b/docker-compose.yml index 0354a595..b1d714a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: app: build: context: . - dockerfile: Dockerfile + dockerfile: ${DOCKERFILE_APP:-Dockerfile} image: microhelium-app:${IMAGE_TAG:-latest} container_name: microhelium-app restart: unless-stopped @@ -81,7 +81,7 @@ services: queue: build: context: . - dockerfile: Dockerfile + dockerfile: ${DOCKERFILE_APP:-Dockerfile} image: microhelium-app:${IMAGE_TAG:-latest} # No container_name: docker-compose.prod.yml scales this service to # multiple replicas, which Compose rejects when a fixed name is set @@ -112,7 +112,7 @@ services: scheduler: build: context: . - dockerfile: Dockerfile + dockerfile: ${DOCKERFILE_APP:-Dockerfile} image: microhelium-app:${IMAGE_TAG:-latest} container_name: microhelium-scheduler restart: unless-stopped @@ -135,7 +135,7 @@ services: autojudge: build: context: . - dockerfile: Dockerfile.judge + dockerfile: ${DOCKERFILE_JUDGE:-Dockerfile.judge} image: microhelium-judge:${IMAGE_TAG:-latest} container_name: microhelium-autojudge restart: unless-stopped diff --git a/docker/strip_builders.py b/docker/strip_builders.py new file mode 100755 index 00000000..5631fef8 --- /dev/null +++ b/docker/strip_builders.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +import sys +import re + +def strip_builders(filepath, outpath): + with open(filepath, 'r') as f: + content = f.read() + + # Remove the heavy builders that are not needed for maratona/minimal profile. + # Note: we use regex to match blocks that start with FROM and end before the next FROM or a major section. + + # 1. Remove portugol-studio-builder + content = re.sub(r'FROM eclipse-temurin:11-jdk AS portugol-studio-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) + + # 2. Remove scratch-run-builder + content = re.sub(r'FROM node:\d+-alpine AS scratch-run-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) + + # 3. Remove gprolog-builder + content = re.sub(r'FROM php:\d+\.\d+-.*?-alpine AS gprolog-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) + + # 4. Remove swipl-builder + content = re.sub(r'FROM php:\d+\.\d+-.*?-alpine AS swipl-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) + + # 5. Remove gportugol-builder + content = re.sub(r'FROM php:\d+\.\d+-.*?-alpine AS gportugol-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) + + # Now remove the COPY --from lines for these builders + content = re.sub(r'COPY --from=portugol-studio-builder[^\n]*\n', '', content) + content = re.sub(r'COPY --from=scratch-run-builder[^\n]*\n', '', content) + content = re.sub(r'COPY --from=gprolog-builder[^\n]*\n', '', content) + content = re.sub(r'COPY --from=swipl-builder[^\n]*\n', '', content) + content = re.sub(r'COPY --from=gportugol-builder[^\n]*\n', '', content) + + # Optionally, we could remove the RUN commands that set them up, but just removing COPY breaks the buildkit dependency tree, + # which is the main goal. To prevent the RUN from failing because the files are missing, we should comment them out or remove them. + # We will remove blocks between # SWI-Prolog and the next blank line or major comment. + content = re.sub(r'# SWI-Prolog \(issue #305, Lote D\).*?rm -f /tmp/fumaca\.pl\n', '', content, flags=re.DOTALL) + content = re.sub(r'# GNU Prolog \(issue #305, Lote D\).*?rm -rf /tmp/fumaca-gprolog\n', '', content, flags=re.DOTALL) + content = re.sub(r'# G-Portugol \(issue #296\).*?rm -rf /tmp/fumaca-gportugol\n', '', content, flags=re.DOTALL) + content = re.sub(r'# Scratch \(issue #268\).*?chmod 755 /usr/local/bin/scratch-run.*?\n', '', content, flags=re.DOTALL) + content = re.sub(r'# Portugol Studio \(issue #269.*?\).*?rm -rf /tmp/fumaca-portugol\n', '', content, flags=re.DOTALL) + + # For dev without headers: + content = re.sub(r'RUN set -eux; \\\n\s+printf \'#!/bin/sh\\nexec /opt/swipl/bin/swipl.*?\n', '', content, flags=re.DOTALL) + content = re.sub(r'RUN set -eux; \\\n\s+printf \'#!/bin/sh\\nPATH="/opt/gprolog/bin.*?rm -rf /tmp/fumaca-gprolog\n', '', content, flags=re.DOTALL) + + with open(outpath, 'w') as f: + f.write(content) + +if __name__ == '__main__': + strip_builders('Dockerfile', 'Dockerfile.slim') + strip_builders('Dockerfile.dev', 'Dockerfile.dev.slim') + strip_builders('Dockerfile.judge', 'Dockerfile.judge.slim') From cb4f3a5caf27ea519fe0b379c8e8ee38b5088410 Mon Sep 17 00:00:00 2001 From: Wenner Lucas <138150733+wennerl77@users.noreply.github.com> Date: Tue, 6 Oct 2026 00:08:49 -0300 Subject: [PATCH 2/6] fix(docker): pass JUDGE_PROFILE arg to docker-compose.yml builds --- Dockerfile | 27 ++++++++++++++++++--------- docker-compose.yml | 8 ++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 51dc2322..fad11a69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -219,7 +219,10 @@ WORKDIR /var/www/html # imagem e construida tambem por parceiros. # # Esta lista tem de acompanhar a do Dockerfile.judge. -RUN apk add --no-cache \ +ARG JUDGE_PROFILE=completo +ENV JUDGE_PROFILE=${JUDGE_PROFILE} +COPY --chmod=755 docker/judge/perfil/ /usr/local/share/juiz-perfil/ +RUN /usr/local/share/juiz-perfil/perfil apk-add --no-cache \ git \ curl \ wget \ @@ -333,7 +336,8 @@ COPY --chmod=755 docker/judge/bin/ /usr/local/bin/ # TypeScript (npx tsc, used by the "TypeScript (Node 24)" language) ARG TYPESCRIPT_VERSION=7.0.2 -RUN npm install -g "typescript@${TYPESCRIPT_VERSION}" +RUN /usr/local/share/juiz-perfil/perfil inclui npm:typescript || exit 0; \ + npm install -g "typescript@${TYPESCRIPT_VERSION}" # Kotlin has no Alpine package; JetBrains only ships it as a GitHub release # zip. This is the same install method used by every other Kotlin judge @@ -355,7 +359,8 @@ RUN npm install -g "typescript@${TYPESCRIPT_VERSION}" # existia neste arquivo (o JPlag, mais abaixo); faltava aplicar aos vizinhos. ARG KOTLIN_VERSION=2.4.20 ARG KOTLIN_SHA256=59e9ca74c7904ef2c122b12114937673ccce68de820a663f0ed66ccf8799e0b7 -RUN wget -q "https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip" -O /tmp/kotlin.zip \ +RUN /usr/local/share/juiz-perfil/perfil inclui download:KOTLIN || exit 0; \ + wget -q "https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip" -O /tmp/kotlin.zip \ && echo "${KOTLIN_SHA256} /tmp/kotlin.zip" | sha256sum -c - \ && unzip -q /tmp/kotlin.zip -d /opt \ && rm /tmp/kotlin.zip \ @@ -384,16 +389,17 @@ RUN wget -q "https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VER ARG FPC_VERSION=3.2.2 ARG FPC_SHA256_AARCH64=b39470f9b6b5b82f50fc8680a5da37d2834f2129c65c24c5628a80894d565451 ARG FPC_SHA256_X86_64=5adac308a5534b6a76446d8311fc340747cbb7edeaacfe6b651493ff3fe31e83 -RUN set -eu; \ +RUN /usr/local/share/juiz-perfil/perfil inclui download:FPC || exit 0; \ + set -eu; \ arch="$(apk --print-arch)"; \ case "$arch" in \ - x86_64) fpc_arch=x86_64-linux; fpc_bin=ppcx64; fpc_sha256="${FPC_SHA256_X86_64}" ;; \ - aarch64) fpc_arch=aarch64-linux; fpc_bin=ppca64; fpc_sha256="${FPC_SHA256_AARCH64}" ;; \ + x86_64) fpc_arch=x86_64-linux; fpc_bin=ppcx64; fpc_sha256="${FPC_SHA256_X86_64}"; fpc_mirror="https://distfiles.gentoo.org/distfiles/61/fpc-${FPC_VERSION}.x86_64-linux.tar" ;; \ + aarch64) fpc_arch=aarch64-linux; fpc_bin=ppca64; fpc_sha256="${FPC_SHA256_AARCH64}"; fpc_mirror="https://distfiles.gentoo.org/distfiles/cd/fpc-${FPC_VERSION}.aarch64-linux.tar" ;; \ *) echo "Unsupported arch for FPC: $arch" >&2; exit 1 ;; \ esac; \ - url="https://sourceforge.net/projects/freepascal/files/Linux/${FPC_VERSION}/fpc-${FPC_VERSION}.${fpc_arch}.tar/download"; \ + sf_url="https://sourceforge.net/projects/freepascal/files/Linux/${FPC_VERSION}/fpc-${FPC_VERSION}.${fpc_arch}.tar/download"; \ tries=0; \ - until wget -q "$url" -O /tmp/fpc.tar \ + until { wget -q "$fpc_mirror" -O /tmp/fpc.tar || wget -q "$sf_url" -O /tmp/fpc.tar; } \ && echo "${fpc_sha256} /tmp/fpc.tar" | sha256sum -c -; do \ tries=$((tries + 1)); \ [ "$tries" -ge 6 ] && { echo "FPC ${FPC_VERSION} (${fpc_arch}): $tries tentativas sem bater o SHA-256 fixado" >&2; exit 1; }; \ @@ -419,6 +425,7 @@ RUN set -eu; \ ARG SCALA_VERSION=3.3.8 ARG SCALA_SHA256=777423024bb2b4c2b33e18f9c28da7cea117b39478b9bb6811baf7b1a1cf22a7 RUN set -eux; \ + /usr/local/share/juiz-perfil/perfil inclui download:SCALA || exit 0; \ wget -q "https://github.com/scala/scala3/releases/download/${SCALA_VERSION}/scala3-${SCALA_VERSION}.zip" -O /tmp/scala.zip; \ echo "${SCALA_SHA256} /tmp/scala.zip" | sha256sum -c -; \ unzip -q /tmp/scala.zip -d /opt; \ @@ -438,6 +445,7 @@ RUN set -eux; \ ARG GROOVY_VERSION=4.0.33 ARG GROOVY_SHA256=395a69a81d5e9915d360d630663c1d98534c9dec134cb267798e49370855d93d RUN set -eux; \ + /usr/local/share/juiz-perfil/perfil inclui download:GROOVY || exit 0; \ wget -q "https://archive.apache.org/dist/groovy/${GROOVY_VERSION}/distribution/apache-groovy-binary-${GROOVY_VERSION}.zip" -O /tmp/groovy.zip; \ echo "${GROOVY_SHA256} /tmp/groovy.zip" | sha256sum -c -; \ unzip -q /tmp/groovy.zip -d /opt; \ @@ -458,6 +466,7 @@ ARG DART_VERSION=3.13.4 ARG DART_SHA256_AARCH64=1d545609bdf9da6fb5e68fbd96a599e2836e44ee64379991bd4493ee764d2fdb ARG DART_SHA256_X86_64=6487a10df5eab890d746d14a55f4c70bec3c1c0633f51804eb504cbc0fc395bb RUN set -eux; \ + /usr/local/share/juiz-perfil/perfil inclui download:DART || exit 0; \ arch="$(apk --print-arch)"; \ case "$arch" in \ aarch64) dart_arch=arm64; dart_sha256="${DART_SHA256_AARCH64}" ;; \ @@ -583,7 +592,7 @@ RUN set -eux; \ COPY --from=scratch-run-builder /src/dist/index.js /opt/scratch-run/index.js RUN printf '#!/bin/sh\nexec node /opt/scratch-run/index.js "$@"\n' > /usr/local/bin/scratch-run \ && chmod 755 /usr/local/bin/scratch-run \ - && echo 'x' | scratch-run --version + && if /usr/local/share/juiz-perfil/perfil inclui apk:nodejs; then echo 'x' | scratch-run --version; fi # Portugol Studio (issue #269, parte A). # diff --git a/docker-compose.yml b/docker-compose.yml index b1d714a3..2f666655 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,8 @@ services: build: context: . dockerfile: ${DOCKERFILE_APP:-Dockerfile} + args: + JUDGE_PROFILE: ${JUDGE_PROFILE:-completo} image: microhelium-app:${IMAGE_TAG:-latest} container_name: microhelium-app restart: unless-stopped @@ -82,6 +84,8 @@ services: build: context: . dockerfile: ${DOCKERFILE_APP:-Dockerfile} + args: + JUDGE_PROFILE: ${JUDGE_PROFILE:-completo} image: microhelium-app:${IMAGE_TAG:-latest} # No container_name: docker-compose.prod.yml scales this service to # multiple replicas, which Compose rejects when a fixed name is set @@ -113,6 +117,8 @@ services: build: context: . dockerfile: ${DOCKERFILE_APP:-Dockerfile} + args: + JUDGE_PROFILE: ${JUDGE_PROFILE:-completo} image: microhelium-app:${IMAGE_TAG:-latest} container_name: microhelium-scheduler restart: unless-stopped @@ -136,6 +142,8 @@ services: build: context: . dockerfile: ${DOCKERFILE_JUDGE:-Dockerfile.judge} + args: + JUDGE_PROFILE: ${JUDGE_PROFILE:-completo} image: microhelium-judge:${IMAGE_TAG:-latest} container_name: microhelium-autojudge restart: unless-stopped From 71815a1ab4654d5a13cfc27b9306307e751f80fc Mon Sep 17 00:00:00 2001 From: Wenner Lucas <138150733+wennerl77@users.noreply.github.com> Date: Tue, 6 Oct 2026 00:09:04 -0300 Subject: [PATCH 3/6] feat(docker): robustly strip builders based on JUDGE_PROFILE --- docker/strip_builders.py | 89 +++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/docker/strip_builders.py b/docker/strip_builders.py index 5631fef8..50f4b50c 100755 --- a/docker/strip_builders.py +++ b/docker/strip_builders.py @@ -1,51 +1,56 @@ -#!/usr/bin/env python3 import sys -import re def strip_builders(filepath, outpath): with open(filepath, 'r') as f: - content = f.read() + lines = f.readlines() + + out = [] + i = 0 + while i < len(lines): + line = lines[i] + + # Strip the builder stages at the top + if line.startswith("FROM ") and any(x in line for x in [ + "AS portugol-studio-builder", "AS scratch-run-builder", + "AS gprolog-builder", "AS swipl-builder", "AS gportugol-builder"]): + while i < len(lines): + i += 1 + if i < len(lines) and (lines[i].startswith("FROM ") or lines[i].startswith("# MicroHelium") or lines[i].startswith("# ----------------")): + break + continue + + # Strip the COPY lines + if line.startswith("COPY --from=") and any(x in line for x in [ + "portugol-studio-builder", "scratch-run-builder", + "gprolog-builder", "swipl-builder", "gportugol-builder"]): + i += 1 + continue + + # Buffer and check RUN lines + if line.startswith("RUN "): + run_block = [line] + j = i + while j < len(lines) and lines[j].rstrip().endswith("\\"): + j += 1 + if j < len(lines): + run_block.append(lines[j]) + + full_run = "".join(run_block) + if any(k in full_run for k in [ + "scratch-run/index.js", + "/opt/swipl/bin/swipl", + "/opt/gprolog/bin/gplc", + "fumaca-gportugol", + "ExecutaPortugol" + ]): + i = j + 1 + continue + + out.append(line) + i += 1 - # Remove the heavy builders that are not needed for maratona/minimal profile. - # Note: we use regex to match blocks that start with FROM and end before the next FROM or a major section. - - # 1. Remove portugol-studio-builder - content = re.sub(r'FROM eclipse-temurin:11-jdk AS portugol-studio-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) - - # 2. Remove scratch-run-builder - content = re.sub(r'FROM node:\d+-alpine AS scratch-run-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) - - # 3. Remove gprolog-builder - content = re.sub(r'FROM php:\d+\.\d+-.*?-alpine AS gprolog-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) - - # 4. Remove swipl-builder - content = re.sub(r'FROM php:\d+\.\d+-.*?-alpine AS swipl-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) - - # 5. Remove gportugol-builder - content = re.sub(r'FROM php:\d+\.\d+-.*?-alpine AS gportugol-builder.*?((?=FROM )|(?=# MicroHelium))', '', content, flags=re.DOTALL) - - # Now remove the COPY --from lines for these builders - content = re.sub(r'COPY --from=portugol-studio-builder[^\n]*\n', '', content) - content = re.sub(r'COPY --from=scratch-run-builder[^\n]*\n', '', content) - content = re.sub(r'COPY --from=gprolog-builder[^\n]*\n', '', content) - content = re.sub(r'COPY --from=swipl-builder[^\n]*\n', '', content) - content = re.sub(r'COPY --from=gportugol-builder[^\n]*\n', '', content) - - # Optionally, we could remove the RUN commands that set them up, but just removing COPY breaks the buildkit dependency tree, - # which is the main goal. To prevent the RUN from failing because the files are missing, we should comment them out or remove them. - # We will remove blocks between # SWI-Prolog and the next blank line or major comment. - content = re.sub(r'# SWI-Prolog \(issue #305, Lote D\).*?rm -f /tmp/fumaca\.pl\n', '', content, flags=re.DOTALL) - content = re.sub(r'# GNU Prolog \(issue #305, Lote D\).*?rm -rf /tmp/fumaca-gprolog\n', '', content, flags=re.DOTALL) - content = re.sub(r'# G-Portugol \(issue #296\).*?rm -rf /tmp/fumaca-gportugol\n', '', content, flags=re.DOTALL) - content = re.sub(r'# Scratch \(issue #268\).*?chmod 755 /usr/local/bin/scratch-run.*?\n', '', content, flags=re.DOTALL) - content = re.sub(r'# Portugol Studio \(issue #269.*?\).*?rm -rf /tmp/fumaca-portugol\n', '', content, flags=re.DOTALL) - - # For dev without headers: - content = re.sub(r'RUN set -eux; \\\n\s+printf \'#!/bin/sh\\nexec /opt/swipl/bin/swipl.*?\n', '', content, flags=re.DOTALL) - content = re.sub(r'RUN set -eux; \\\n\s+printf \'#!/bin/sh\\nPATH="/opt/gprolog/bin.*?rm -rf /tmp/fumaca-gprolog\n', '', content, flags=re.DOTALL) - with open(outpath, 'w') as f: - f.write(content) + f.writelines(out) if __name__ == '__main__': strip_builders('Dockerfile', 'Dockerfile.slim') From eac1cdd7c2e04ca23e33724d0213546cc883bf0a Mon Sep 17 00:00:00 2001 From: Wenner Lucas <138150733+wennerl77@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:59:26 -0300 Subject: [PATCH 4/6] feat(seeders): allow customizing default admin credentials via .env --- .env.example | 7 +++++++ database/seeders/DatabaseSeeder.php | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 6b7a45ac..f24c4a64 100644 --- a/.env.example +++ b/.env.example @@ -91,3 +91,10 @@ JUDGING_ALERTS_QUEUE_DEPTH=20 # /backend/users, `teams:import` e a conta gerenciada do #47 continuam sendo # os caminhos. REGISTRATION_OPEN=true + + +# Credenciais do usuário administrador padrão criado durante a seed inicial do banco de dados. +# Caso modifique aqui, o comando 'make setup' ou 'php artisan db:seed' criará o admin com essas credenciais. +DEFAULT_ADMIN_USERNAME=admin +DEFAULT_ADMIN_EMAIL=admin@microhelium.local +DEFAULT_ADMIN_PASSWORD=admin123 diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 12550db2..233318ef 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -92,11 +92,11 @@ public function run(): void $this->seedDemoProblems($contest); User::firstOrCreate( - ['username' => 'admin'], + ['username' => env('DEFAULT_ADMIN_USERNAME', 'admin')], [ 'fullname' => 'Administrator', - 'email' => 'admin@microhelium.local', - 'password' => Hash::make('admin123'), + 'email' => env('DEFAULT_ADMIN_EMAIL', 'admin@microhelium.local'), + 'password' => Hash::make(env('DEFAULT_ADMIN_PASSWORD', 'admin123')), 'user_type' => User::TYPE_ADMIN, 'contest_id' => $contest->id, 'is_enabled' => true, From 89348059a4c03cc7692674098694bd0a60d82467 Mon Sep 17 00:00:00 2001 From: Wenner Lucas <138150733+wennerl77@users.noreply.github.com> Date: Thu, 15 Oct 2026 15:22:51 -0300 Subject: [PATCH 5/6] fix(docker,ui): add privileged/cap_add to queue and scheduler, fix mobile sidebar transition and update build assets --- docker-compose.yml | 6 ++ package-lock.json | 11 +-- .../build/assets/BankGovernance-rpqeAdxf.js | 1 + .../build/assets/BankGovernance-wsGOSw_t.js | 1 - ...r-BA0LLbT3.js => FeaturePager-DkN6l5V8.js} | 2 +- public/build/assets/FeatureState-Ceer7rtj.js | 1 - public/build/assets/FeatureState-DoiXEL_p.js | 1 + ...ror-P7Uk3ge_.js => FieldError-DRbrcIPQ.js} | 2 +- public/build/assets/JudgeHistory-D4ix9-I6.js | 1 - public/build/assets/JudgeHistory-Peu7eUVE.js | 1 + public/build/assets/JudgeMachines-BWvQGcui.js | 1 - public/build/assets/JudgeMachines-CUq9WJuF.js | 1 + public/build/assets/JudgingHealth-BFLke4Uw.js | 1 + public/build/assets/JudgingHealth-DJhJbX3n.js | 1 - .../build/assets/ManagedAccounts-BttOxjSP.js | 1 + .../build/assets/ManagedAccounts-Dld1r1cH.js | 1 - public/build/assets/Organizations-DEXUy4yp.js | 1 - public/build/assets/Organizations-ZJYPGGTa.js | 1 + public/build/assets/Practice-BMALsMzu.js | 1 + public/build/assets/Practice-DbH0N8cO.js | 1 - public/build/assets/ReportChart-CEHmWQ8G.js | 3 + public/build/assets/ReportChart-jiaGIq-w.js | 3 - public/build/assets/Similarity-CKnBsn3m.js | 1 - public/build/assets/Similarity-D66HiKHn.js | 1 + public/build/assets/SiteReport-BPt0LEjY.js | 1 - public/build/assets/SiteReport-CwR53OTD.js | 1 + public/build/assets/Webcast-FU6IU83R.js | 1 - public/build/assets/Webcast-HR2rhgOU.js | 1 + public/build/assets/app-B8gaJnTP.js | 2 + public/build/assets/app-CGCaKTrw.css | 2 - public/build/assets/app-CPK8-4qW.css | 2 + public/build/assets/app-DKg3nD5E.js | 2 - public/build/assets/mount-BGyYdYPD.js | 2 - public/build/assets/mount-CHGo764q.js | 2 + public/build/manifest.json | 92 +++++++++---------- resources/css/app.css | 2 +- 36 files changed, 76 insertions(+), 79 deletions(-) create mode 100644 public/build/assets/BankGovernance-rpqeAdxf.js delete mode 100644 public/build/assets/BankGovernance-wsGOSw_t.js rename public/build/assets/{FeaturePager-BA0LLbT3.js => FeaturePager-DkN6l5V8.js} (50%) delete mode 100644 public/build/assets/FeatureState-Ceer7rtj.js create mode 100644 public/build/assets/FeatureState-DoiXEL_p.js rename public/build/assets/{FieldError-P7Uk3ge_.js => FieldError-DRbrcIPQ.js} (57%) delete mode 100644 public/build/assets/JudgeHistory-D4ix9-I6.js create mode 100644 public/build/assets/JudgeHistory-Peu7eUVE.js delete mode 100644 public/build/assets/JudgeMachines-BWvQGcui.js create mode 100644 public/build/assets/JudgeMachines-CUq9WJuF.js create mode 100644 public/build/assets/JudgingHealth-BFLke4Uw.js delete mode 100644 public/build/assets/JudgingHealth-DJhJbX3n.js create mode 100644 public/build/assets/ManagedAccounts-BttOxjSP.js delete mode 100644 public/build/assets/ManagedAccounts-Dld1r1cH.js delete mode 100644 public/build/assets/Organizations-DEXUy4yp.js create mode 100644 public/build/assets/Organizations-ZJYPGGTa.js create mode 100644 public/build/assets/Practice-BMALsMzu.js delete mode 100644 public/build/assets/Practice-DbH0N8cO.js create mode 100644 public/build/assets/ReportChart-CEHmWQ8G.js delete mode 100644 public/build/assets/ReportChart-jiaGIq-w.js delete mode 100644 public/build/assets/Similarity-CKnBsn3m.js create mode 100644 public/build/assets/Similarity-D66HiKHn.js delete mode 100644 public/build/assets/SiteReport-BPt0LEjY.js create mode 100644 public/build/assets/SiteReport-CwR53OTD.js delete mode 100644 public/build/assets/Webcast-FU6IU83R.js create mode 100644 public/build/assets/Webcast-HR2rhgOU.js create mode 100644 public/build/assets/app-B8gaJnTP.js delete mode 100644 public/build/assets/app-CGCaKTrw.css create mode 100644 public/build/assets/app-CPK8-4qW.css delete mode 100644 public/build/assets/app-DKg3nD5E.js delete mode 100644 public/build/assets/mount-BGyYdYPD.js create mode 100644 public/build/assets/mount-CHGo764q.js diff --git a/docker-compose.yml b/docker-compose.yml index 2f666655..34ac266d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -111,6 +111,9 @@ services: - app - db - redis + privileged: true + cap_add: + - SYS_PTRACE # Scheduler (Cron) scheduler: @@ -136,6 +139,9 @@ services: depends_on: - app - db + privileged: true + cap_add: + - SYS_PTRACE # Auto-Judge Worker autojudge: diff --git a/package-lock.json b/package-lock.json index 390ee25f..3027e0ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -262,7 +262,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=20.19.0" }, @@ -311,7 +310,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=20.19.0" } @@ -1323,7 +1321,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.11.20", "caniuse-lite": "^1.0.30001810", @@ -2005,7 +2002,6 @@ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -2035,7 +2031,6 @@ "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "playwright-core": "cli.js" }, @@ -2062,7 +2057,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.18", "picocolors": "^1.1.1", @@ -2320,8 +2314,7 @@ "version": "4.3.3", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.3.tgz", "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/tailwindcss-animate": { "version": "1.0.7", @@ -2461,7 +2454,6 @@ "integrity": "sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.5", @@ -2824,7 +2816,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.42.tgz", "integrity": "sha512-4RyHQTbQvOPs3MfvUO1Sg0YRrKNnA0mAVtvpd12Tg1fKDN7OHBUl1IqSn8zGJjK9nI3NkNp8cgTpVrSZC5TTcA==", "license": "MIT", - "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.42", "@vue/compiler-sfc": "3.5.42", diff --git a/public/build/assets/BankGovernance-rpqeAdxf.js b/public/build/assets/BankGovernance-rpqeAdxf.js new file mode 100644 index 00000000..9a36d2a1 --- /dev/null +++ b/public/build/assets/BankGovernance-rpqeAdxf.js @@ -0,0 +1 @@ +import{D as e,S as t,T as n,a as r,b as i,c as a,d as o,f as s,g as ee,h as c,i as te,l,m as u,o as d,p as f,s as ne,u as p,w as m,x as h,y as g}from"./app-B8gaJnTP.js";import{n as re,o as ie,t as ae}from"./FeatureState-DoiXEL_p.js";import{t as oe}from"./FeaturePager-DkN6l5V8.js";import{t as _}from"./FieldError-DRbrcIPQ.js";var se={class:`feature-stack`},ce=[`value`],le=[`disabled`],ue={key:0,class:`surface feature-panel`},de={id:`bank-edit-title`,tabindex:`-1`},fe=[`disabled`,`aria-invalid`],pe=[`value`],me=[`disabled`,`aria-invalid`],he={class:`feature-fieldset feature-wide`},ge={id:`outcomes-help`,class:`feature-help`},_e={key:0,class:`feature-message`},ve={key:1,class:`feature-help`,role:`status`},ye={key:2,class:`feature-help`},be=[`disabled`,`aria-invalid`],v={class:`feature-outcomes`},y={key:0,class:`feature-help`},b=[`id`,`value`,`disabled`],x=[`for`],S={class:`feature-help`},C={class:`feature-actions feature-wide`},w=[`disabled`],T=[`disabled`],E={class:`surface feature-panel`},D={key:0,class:`feature-empty`},O={class:`feature-heading`},k={class:`feature-badge`},A={key:0,class:`feature-help`},j={class:`feature-tags`,"aria-label":`Etiquetas`},M={key:0,class:`feature-help`},N={key:1,class:`feature-tags`,"aria-label":`Habilidades de currículo`},xe=[`title`],Se=[`disabled`,`onClick`],P={class:`sr-only`},Ce={class:`feature-help`},we={key:3,class:`feature-message`},Te={class:`feature-actions`},Ee=[`disabled`,`onClick`],De=[`disabled`],Oe=[`disabled`,`onClick`],ke={class:`sr-only`},Ae={__name:`BankGovernance`,setup(Ae){let{data:F,loading:I,error:je,busy:L,notice:Me,actionError:R,load:z,filter:B,act:V,query:H}=re(`/api/frontend/bank-governance`),U=m(null),W=m(H.organization_id||``),G=m(H.q||``),K=m(null),q=m(``),J=m(``),Y=m(null),X=m(``),Z=m([]),Q=m(``),$=p(()=>{let e=Q.value.trim().toLowerCase();return(Y.value||[]).map(t=>({...t,outcomes:t.outcomes.filter(t=>!e||Z.value.includes(t.id)||[t.code,t.text,t.stage,t.axis].some(t=>(t||``).toLowerCase().includes(e)))})).filter(e=>e.outcomes.length)});async function Ne(){if(!Y.value){X.value=``;try{Y.value=(await ie(`/api/frontend/curricula`)).frameworks}catch(e){X.value=e.message}}}async function Pe(e){K.value=e,q.value=e.owning_org_id??``,J.value=e.tags.join(`, `),Z.value=(e.outcomes||[]).map(e=>e.id),Q.value=``,R.value=null,Ne(),await ee(),document.getElementById(`bank-edit-title`)?.focus()}async function Fe(e){await V(`/api/frontend/bank-governance/${encodeURIComponent(K.value.id)}`,{owning_org_id:q.value||null,tags:[...new Set(J.value.split(`,`).map(e=>e.trim()).filter(Boolean))],...Y.value?{outcome_ids:Z.value}:{},version:K.value.version},`Organização do problema atualizada.`,`PATCH`,e.target)&&(K.value=null,await z())}async function Ie(e){await V(`/api/frontend/bank-governance/${encodeURIComponent(e.id)}/practice`,{published:e.practice_status!==`published`,version:e.version},e.practice_status===`published`?`Problema retirado da biblioteca. O histórico foi preservado.`:`Problema publicado no Treino Livre.`)&&(U.value=null,await z())}return h(()=>H.organization_id,e=>{W.value=e||``}),h(()=>H.q,e=>{G.value=e||``}),(ee,p)=>(g(),f(`div`,se,[p[26]||=o(`div`,{class:`feature-message`},[o(`strong`,null,`Responsabilidade e assunto são informações diferentes.`),u(` A organização proprietária define quem pode editar. Etiquetas ajudam a encontrar problemas e não concedem acesso.`)],-1),c(ae,{loading:n(I),error:n(je),stale:!!n(F),busy:n(L),notice:n(Me),"action-error":n(R),onRetry:p[0]||=e=>n(z)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),n(F)?(g(),f(l,{key:0},[o(`form`,{class:`surface feature-panel feature-search`,role:`search`,onSubmit:p[3]||=a(e=>{K.value=null,n(B)({q:G.value,organization_id:W.value,page:1})},[`prevent`])},[o(`label`,null,[p[12]||=u(`Buscar no banco`,-1),t(o(`input`,{"onUpdate:modelValue":p[1]||=e=>G.value=e,name:`q`,type:`search`,maxlength:`100`,placeholder:`Nome ou etiqueta…`},null,512),[[d,G.value]])]),o(`label`,null,[p[15]||=u(`Organização proprietária`,-1),t(o(`select`,{"onUpdate:modelValue":p[2]||=e=>W.value=e,name:`organization_id`},[p[13]||=o(`option`,{value:``},`Todas`,-1),p[14]||=o(`option`,{value:`unassigned`},`Sem organização`,-1),(g(!0),f(l,null,i(n(F).organizations,t=>(g(),f(`option`,{key:t.id,value:t.id},e(t.name),9,ce))),128))],512),[[r,W.value]])]),o(`button`,{class:`button-primary`,disabled:n(L)||n(I)},`Filtrar`,8,le)],32),K.value?(g(),f(`section`,ue,[o(`h2`,de,`Organizar: `+e(K.value.name),1),o(`form`,{class:`feature-form`,onSubmit:a(Fe,[`prevent`])},[o(`label`,null,[p[17]||=u(`Organização proprietária`,-1),t(o(`select`,{"onUpdate:modelValue":p[4]||=e=>q.value=e,name:`owning_org_id`,disabled:n(L)||!K.value.capabilities?.can_transfer,"aria-describedby":`owner-help owning_org_id-error`,"aria-invalid":!!n(R)?.errors?.owning_org_id},[p[16]||=o(`option`,{value:``},`Sem organização`,-1),(g(!0),f(l,null,i(n(F).organizations,t=>(g(),f(`option`,{key:t.id,value:t.id},e(t.name),9,pe))),128))],8,fe),[[r,q.value]]),p[18]||=o(`small`,{id:`owner-help`},`Trocar a organização muda quem pode editar este problema.`,-1),c(_,{error:n(R),name:`owning_org_id`},null,8,[`error`])]),o(`label`,null,[p[19]||=u(`Etiquetas`,-1),t(o(`input`,{"onUpdate:modelValue":p[5]||=e=>J.value=e,name:`tags`,maxlength:`500`,disabled:n(L),"aria-describedby":`tags-help tags-error`,"aria-invalid":!!n(R)?.errors?.tags},null,8,me),[[d,J.value]]),p[20]||=o(`small`,{id:`tags-help`},`Separe por vírgulas. Exemplo: grafos, programação dinâmica.`,-1),c(_,{error:n(R),name:`tags`},null,8,[`error`])]),o(`fieldset`,he,[p[22]||=o(`legend`,null,`Habilidades de currículo`,-1),o(`p`,ge,`Marque as habilidades de currículo oficial que este problema exercita. `+e(Z.value.length)+` selecionada(s).`,1),X.value?(g(),f(`p`,_e,`Não foi possível carregar os currículos: `+e(X.value)+` As habilidades atuais serão mantidas ao salvar.`,1)):Y.value?Y.value.length?(g(),f(l,{key:3},[o(`label`,null,[p[21]||=u(`Buscar habilidade`,-1),t(o(`input`,{"onUpdate:modelValue":p[6]||=e=>Q.value=e,name:`outcome_ids`,type:`search`,maxlength:`100`,placeholder:`Código, texto ou etapa…`,disabled:n(L),onKeydown:p[7]||=ne(a(()=>{},[`prevent`]),[`enter`]),"aria-describedby":`outcomes-help outcome_ids-error`,"aria-invalid":!!n(R)?.errors?.outcome_ids},null,40,be),[[d,Q.value]])]),o(`div`,v,[$.value.length?s(``,!0):(g(),f(`p`,y,`Nenhuma habilidade corresponde à busca.`)),(g(!0),f(l,null,i($.value,r=>(g(),f(`section`,{key:r.id},[o(`h3`,null,e(r.name),1),(g(!0),f(l,null,i(r.outcomes,r=>(g(),f(`div`,{key:r.id,class:`feature-check`},[t(o(`input`,{id:`outcome-${r.id}`,"onUpdate:modelValue":p[8]||=e=>Z.value=e,type:`checkbox`,value:r.id,disabled:n(L)},null,8,b),[[te,Z.value]]),o(`label`,{for:`outcome-${r.id}`},[o(`strong`,null,e(r.code),1),u(` `+e(r.text)+` `,1),o(`span`,S,`(`+e([r.stage,r.axis].filter(Boolean).join(` · `))+`)`,1)],8,x)]))),128))]))),128))]),c(_,{error:n(R),name:`outcome_ids`},null,8,[`error`])],64)):(g(),f(`p`,ye,`Nenhum currículo foi importado nesta instalação.`)):(g(),f(`p`,ve,`Carregando currículos…`))]),o(`div`,C,[o(`button`,{class:`button-primary`,disabled:n(L)||n(I)},`Salvar organização`,8,w),o(`button`,{type:`button`,class:`button-secondary`,disabled:n(L),onClick:p[9]||=e=>{K.value=null,R.value=null}},`Cancelar`,8,T)])],32)])):s(``,!0),o(`section`,E,[p[25]||=o(`h2`,null,`Problemas do banco`,-1),n(F).items?.length?s(``,!0):(g(),f(`p`,D,`Nenhum problema corresponde aos filtros.`)),(g(!0),f(l,null,i(n(F).items,t=>(g(),f(`article`,{key:t.id,class:`feature-record`},[o(`div`,O,[o(`h3`,null,e(t.name),1),o(`span`,k,e(t.capabilities?.can_edit?`Você pode editar`:`Somente leitura`),1)]),o(`p`,null,[p[23]||=o(`strong`,null,`Organização:`,-1),u(` `+e(t.organization_name||`Sem organização atribuída`),1)]),t.owning_org_id?s(``,!0):(g(),f(`p`,A,`Problema legado. A atribuição é feita pela administração.`)),o(`div`,j,[(g(!0),f(l,null,i(t.tags,t=>(g(),f(`span`,{key:t,class:`feature-badge`},e(t),1))),128)),t.tags.length?s(``,!0):(g(),f(`span`,M,`Sem etiquetas`))]),t.outcomes?.length?(g(),f(`div`,N,[(g(!0),f(l,null,i(t.outcomes,t=>(g(),f(`span`,{key:t.id,class:`feature-badge`,title:t.text},e(t.code),9,xe))),128))])):s(``,!0),t.capabilities?.can_edit?(g(),f(`button`,{key:2,type:`button`,class:`button-secondary`,disabled:n(L),onClick:e=>Pe(t)},[p[24]||=u(`Organizar`,-1),o(`span`,P,e(t.name),1)],8,Se)):s(``,!0),o(`p`,Ce,`Treino Livre: `+e(t.practice_status===`published`?`Publicado`:`Não publicado`),1),U.value===t.id?(g(),f(`div`,we,[o(`p`,null,e(t.practice_status===`published`?`Retirar este problema da biblioteca? Os envios anteriores serão preservados.`:`Publicar uma cópia deste problema para treino? O enunciado ficará acessível fora da competição.`),1),o(`div`,Te,[o(`button`,{type:`button`,class:`button-primary`,disabled:n(L),onClick:e=>Ie(t)},`Confirmar `+e(t.practice_status===`published`?`retirada`:`publicação`),9,Ee),o(`button`,{type:`button`,class:`button-secondary`,disabled:n(L),onClick:p[10]||=e=>U.value=null},`Cancelar`,8,De)])])):t.capabilities?.can_publish?(g(),f(`button`,{key:4,type:`button`,class:`button-secondary`,disabled:n(L),onClick:e=>U.value=t.id},[u(e(t.practice_status===`published`?`Retirar do treino`:`Publicar para treino`),1),o(`span`,ke,e(t.name),1)],8,Oe)):s(``,!0)]))),128)),c(oe,{meta:n(F).meta,loading:n(I)||n(L),onPage:p[11]||=e=>{K.value=null,n(B)({page:e})}},null,8,[`meta`,`loading`])])],64)):s(``,!0)]))}};export{Ae as default}; \ No newline at end of file diff --git a/public/build/assets/BankGovernance-wsGOSw_t.js b/public/build/assets/BankGovernance-wsGOSw_t.js deleted file mode 100644 index 30fed043..00000000 --- a/public/build/assets/BankGovernance-wsGOSw_t.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,a as i,b as a,d as o,f as s,i as c,l,m as u,o as d,p as f,s as p,u as m,v as h,y as g}from"./app-DKg3nD5E.js";import{n as ee,t as _}from"./FeatureState-Ceer7rtj.js";import{t as v}from"./FeaturePager-BA0LLbT3.js";import{t as y}from"./FieldError-P7Uk3ge_.js";var te={class:`feature-stack`},ne=[`value`],re=[`disabled`],b={key:0,class:`surface feature-panel`},ie={id:`bank-edit-title`,tabindex:`-1`},ae=[`disabled`,`aria-invalid`],x=[`value`],S=[`disabled`,`aria-invalid`],oe={class:`feature-actions feature-wide`},se=[`disabled`],ce=[`disabled`],le={class:`surface feature-panel`},ue={key:0,class:`feature-empty`},C={class:`feature-heading`},w={class:`feature-badge`},T={key:0,class:`feature-help`},E={class:`feature-tags`,"aria-label":`Etiquetas`},D={key:0,class:`feature-help`},O=[`disabled`,`onClick`],k={class:`sr-only`},A={class:`feature-help`},j={key:2,class:`feature-message`},M={class:`feature-actions`},N=[`disabled`,`onClick`],P=[`disabled`],F=[`disabled`,`onClick`],I={class:`sr-only`},L={__name:`BankGovernance`,setup(L){let{data:R,loading:z,error:B,busy:V,notice:H,actionError:U,load:W,filter:G,act:K,query:q}=ee(`/api/frontend/bank-governance`),J=t(null),Y=t(q.organization_id||``),X=t(q.q||``),Z=t(null),Q=t(``),$=t(``);async function de(e){Z.value=e,Q.value=e.owning_org_id??``,$.value=e.tags.join(`, `),U.value=null,await u(),document.getElementById(`bank-edit-title`)?.focus()}async function fe(e){await K(`/api/frontend/bank-governance/${encodeURIComponent(Z.value.id)}`,{owning_org_id:Q.value||null,tags:[...new Set($.value.split(`,`).map(e=>e.trim()).filter(Boolean))],version:Z.value.version},`Organização do problema atualizada.`,`PATCH`,e.target)&&(Z.value=null,await W())}async function pe(e){await K(`/api/frontend/bank-governance/${encodeURIComponent(e.id)}/practice`,{published:e.practice_status!==`published`,version:e.version},e.practice_status===`published`?`Problema retirado da biblioteca. O histórico foi preservado.`:`Problema publicado no Treino Livre.`)&&(J.value=null,await W())}return g(()=>q.organization_id,e=>{Y.value=e||``}),g(()=>q.q,e=>{X.value=e||``}),(t,u)=>(r(),o(`div`,te,[u[21]||=l(`div`,{class:`feature-message`},[l(`strong`,null,`Responsabilidade e assunto são informações diferentes.`),s(` A organização proprietária define quem pode editar. Etiquetas ajudam a encontrar problemas e não concedem acesso.`)],-1),f(_,{loading:e(z),error:e(B),stale:!!e(R),busy:e(V),notice:e(H),"action-error":e(U),onRetry:u[0]||=t=>e(W)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),e(R)?(r(),o(p,{key:0},[l(`form`,{class:`surface feature-panel feature-search`,role:`search`,onSubmit:u[3]||=d(t=>{Z.value=null,e(G)({q:X.value,organization_id:Y.value,page:1})},[`prevent`])},[l(`label`,null,[u[9]||=s(`Buscar no banco`,-1),a(l(`input`,{"onUpdate:modelValue":u[1]||=e=>X.value=e,name:`q`,type:`search`,maxlength:`100`,placeholder:`Nome ou etiqueta…`},null,512),[[i,X.value]])]),l(`label`,null,[u[12]||=s(`Organização proprietária`,-1),a(l(`select`,{"onUpdate:modelValue":u[2]||=e=>Y.value=e,name:`organization_id`},[u[10]||=l(`option`,{value:``},`Todas`,-1),u[11]||=l(`option`,{value:`unassigned`},`Sem organização`,-1),(r(!0),o(p,null,h(e(R).organizations,e=>(r(),o(`option`,{key:e.id,value:e.id},n(e.name),9,ne))),128))],512),[[c,Y.value]])]),l(`button`,{class:`button-primary`,disabled:e(V)||e(z)},`Filtrar`,8,re)],32),Z.value?(r(),o(`section`,b,[l(`h2`,ie,`Organizar: `+n(Z.value.name),1),l(`form`,{class:`feature-form`,onSubmit:d(fe,[`prevent`])},[l(`label`,null,[u[14]||=s(`Organização proprietária`,-1),a(l(`select`,{"onUpdate:modelValue":u[4]||=e=>Q.value=e,name:`owning_org_id`,disabled:e(V)||!Z.value.capabilities?.can_transfer,"aria-describedby":`owner-help owning_org_id-error`,"aria-invalid":!!e(U)?.errors?.owning_org_id},[u[13]||=l(`option`,{value:``},`Sem organização`,-1),(r(!0),o(p,null,h(e(R).organizations,e=>(r(),o(`option`,{key:e.id,value:e.id},n(e.name),9,x))),128))],8,ae),[[c,Q.value]]),u[15]||=l(`small`,{id:`owner-help`},`Trocar a organização muda quem pode editar este problema.`,-1),f(y,{error:e(U),name:`owning_org_id`},null,8,[`error`])]),l(`label`,null,[u[16]||=s(`Etiquetas`,-1),a(l(`input`,{"onUpdate:modelValue":u[5]||=e=>$.value=e,name:`tags`,maxlength:`500`,disabled:e(V),"aria-describedby":`tags-help tags-error`,"aria-invalid":!!e(U)?.errors?.tags},null,8,S),[[i,$.value]]),u[17]||=l(`small`,{id:`tags-help`},`Separe por vírgulas. Exemplo: grafos, programação dinâmica.`,-1),f(y,{error:e(U),name:`tags`},null,8,[`error`])]),l(`div`,oe,[l(`button`,{class:`button-primary`,disabled:e(V)||e(z)},`Salvar organização`,8,se),l(`button`,{type:`button`,class:`button-secondary`,disabled:e(V),onClick:u[6]||=e=>{Z.value=null,U.value=null}},`Cancelar`,8,ce)])],32)])):m(``,!0),l(`section`,le,[u[20]||=l(`h2`,null,`Problemas do banco`,-1),e(R).items?.length?m(``,!0):(r(),o(`p`,ue,`Nenhum problema corresponde aos filtros.`)),(r(!0),o(p,null,h(e(R).items,t=>(r(),o(`article`,{key:t.id,class:`feature-record`},[l(`div`,C,[l(`h3`,null,n(t.name),1),l(`span`,w,n(t.capabilities?.can_edit?`Você pode editar`:`Somente leitura`),1)]),l(`p`,null,[u[18]||=l(`strong`,null,`Organização:`,-1),s(` `+n(t.organization_name||`Sem organização atribuída`),1)]),t.owning_org_id?m(``,!0):(r(),o(`p`,T,`Problema legado. A atribuição é feita pela administração.`)),l(`div`,E,[(r(!0),o(p,null,h(t.tags,e=>(r(),o(`span`,{key:e,class:`feature-badge`},n(e),1))),128)),t.tags.length?m(``,!0):(r(),o(`span`,D,`Sem etiquetas`))]),t.capabilities?.can_edit?(r(),o(`button`,{key:1,type:`button`,class:`button-secondary`,disabled:e(V),onClick:e=>de(t)},[u[19]||=s(`Organizar`,-1),l(`span`,k,n(t.name),1)],8,O)):m(``,!0),l(`p`,A,`Treino Livre: `+n(t.practice_status===`published`?`Publicado`:`Não publicado`),1),J.value===t.id?(r(),o(`div`,j,[l(`p`,null,n(t.practice_status===`published`?`Retirar este problema da biblioteca? Os envios anteriores serão preservados.`:`Publicar uma cópia deste problema para treino? O enunciado ficará acessível fora da competição.`),1),l(`div`,M,[l(`button`,{type:`button`,class:`button-primary`,disabled:e(V),onClick:e=>pe(t)},`Confirmar `+n(t.practice_status===`published`?`retirada`:`publicação`),9,N),l(`button`,{type:`button`,class:`button-secondary`,disabled:e(V),onClick:u[7]||=e=>J.value=null},`Cancelar`,8,P)])])):t.capabilities?.can_publish?(r(),o(`button`,{key:3,type:`button`,class:`button-secondary`,disabled:e(V),onClick:e=>J.value=t.id},[s(n(t.practice_status===`published`?`Retirar do treino`:`Publicar para treino`),1),l(`span`,I,n(t.name),1)],8,F)):m(``,!0)]))),128)),f(v,{meta:e(R).meta,loading:e(z)||e(V),onPage:u[8]||=t=>{Z.value=null,e(G)({page:t})}},null,8,[`meta`,`loading`])])],64)):m(``,!0)]))}};export{L as default}; \ No newline at end of file diff --git a/public/build/assets/FeaturePager-BA0LLbT3.js b/public/build/assets/FeaturePager-DkN6l5V8.js similarity index 50% rename from public/build/assets/FeaturePager-BA0LLbT3.js rename to public/build/assets/FeaturePager-DkN6l5V8.js index ad097f37..dd8609ae 100644 --- a/public/build/assets/FeaturePager-BA0LLbT3.js +++ b/public/build/assets/FeaturePager-DkN6l5V8.js @@ -1 +1 @@ -import{T as e,_ as t,d as n,l as r,u as i}from"./app-DKg3nD5E.js";var a={key:0,"aria-label":`Paginação`,class:`feature-actions`},o=[`disabled`],s={role:`status`},c=[`disabled`],l={__name:`FeaturePager`,props:{meta:Object,loading:Boolean},emits:[`page`],setup(l){return(u,d)=>l.meta&&l.meta.last_page>1?(t(),n(`nav`,a,[r(`button`,{type:`button`,class:`button-secondary`,disabled:l.loading||l.meta.current_page<=1,onClick:d[0]||=e=>u.$emit(`page`,l.meta.current_page-1)},`Anterior`,8,o),r(`span`,s,`Página `+e(l.meta.current_page)+` de `+e(l.meta.last_page),1),r(`button`,{type:`button`,class:`button-secondary`,disabled:l.loading||l.meta.current_page>=l.meta.last_page,onClick:d[1]||=e=>u.$emit(`page`,l.meta.current_page+1)},`Próxima`,8,c)])):i(``,!0)}};export{l as t}; \ No newline at end of file +import{D as e,d as t,f as n,p as r,y as i}from"./app-B8gaJnTP.js";var a={key:0,"aria-label":`Paginação`,class:`feature-actions`},o=[`disabled`],s={role:`status`},c=[`disabled`],l={__name:`FeaturePager`,props:{meta:Object,loading:Boolean},emits:[`page`],setup(l){return(u,d)=>l.meta&&l.meta.last_page>1?(i(),r(`nav`,a,[t(`button`,{type:`button`,class:`button-secondary`,disabled:l.loading||l.meta.current_page<=1,onClick:d[0]||=e=>u.$emit(`page`,l.meta.current_page-1)},`Anterior`,8,o),t(`span`,s,`Página `+e(l.meta.current_page)+` de `+e(l.meta.last_page),1),t(`button`,{type:`button`,class:`button-secondary`,disabled:l.loading||l.meta.current_page>=l.meta.last_page,onClick:d[1]||=e=>u.$emit(`page`,l.meta.current_page+1)},`Próxima`,8,c)])):n(``,!0)}};export{l as t}; \ No newline at end of file diff --git a/public/build/assets/FeatureState-Ceer7rtj.js b/public/build/assets/FeatureState-Ceer7rtj.js deleted file mode 100644 index 87ccf0ea..00000000 --- a/public/build/assets/FeatureState-Ceer7rtj.js +++ /dev/null @@ -1 +0,0 @@ -import{S as e,T as t,_ as n,d as r,g as i,h as a,l as o,m as s,s as c,u as l,v as u,x as d}from"./app-DKg3nD5E.js";var f=class extends Error{constructor(e,t=0,n={}){super(e),this.status=t,this.errors=n}};function p(e){return typeof e!=`string`||!e.startsWith(`/`)||e.startsWith(`//`)||/[\\\r\n]/.test(e)?null:e}async function m(e,{method:t=`GET`,body:n,signal:r,key:i}={}){if(!p(e))throw new f(`Endereço inválido. Atualize a página.`);let a=new AbortController,o=()=>a.abort();r?.addEventListener(`abort`,o,{once:!0}),r?.aborted&&a.abort();let s=setTimeout(o,2e4);try{let r=await fetch(e,{method:t,credentials:`same-origin`,signal:a.signal,headers:{Accept:`application/json`,"X-Requested-With":`XMLHttpRequest`,...n?{"Content-Type":`application/json`}:{},...t===`GET`?{}:{"X-CSRF-TOKEN":document.querySelector(`meta[name="csrf-token"]`)?.content||``},...i?{"Idempotency-Key":i}:{}},...n?{body:JSON.stringify(n)}:{}}),o=r.headers.get(`content-type`)?.includes(`application/json`)?await r.json():null;if(!r.ok||!o||r.redirected)throw new f({401:`Sua sessão terminou. Entre novamente para continuar.`,419:`Sua sessão expirou. Atualize a página antes de tentar novamente.`,403:`Seu perfil não tem acesso a estes dados. Consulte a organização.`,404:`Este recurso ainda não está disponível ou não foi encontrado.`,409:`Os dados mudaram ou esta operação já está em andamento. Atualize antes de continuar.`,422:`Revise os campos indicados e tente novamente.`,429:`Muitas solicitações. Aguarde um momento antes de tentar novamente.`,503:`Este recurso está temporariamente indisponível. Tente novamente mais tarde.`}[r.redirected?401:r.status]||`Não foi possível concluir a solicitação. Tente novamente.`,r.redirected?401:r.status,o?.errors||{});if(!o.data||typeof o.data!=`object`)throw new f(`A resposta está incompleta. Tente atualizar a página.`);return o.data}catch(e){throw e instanceof f||r?.aborted?e:new f(e.name===`AbortError`?`O servidor demorou para responder. Verifique o estado antes de tentar novamente.`:`Não foi possível conectar. Verifique sua conexão e tente novamente.`)}finally{clearTimeout(s),r?.removeEventListener(`abort`,o)}}var h=e=>e&&Number.isFinite(new Date(e).getTime())?new Intl.DateTimeFormat(`pt-BR`,{dateStyle:`short`,timeStyle:`short`}).format(new Date(e)):`Ainda não registrada`,g=e=>e==null?`Sem dados`:`${new Intl.NumberFormat(`pt-BR`,{maximumFractionDigits:1}).format(e)}%`;function _(t){let n=e(null),r=e(!1),o=e(null),c=e(!1),l=e(``),u=e(null),f,p=!0,h,g=new URLSearchParams(location.search),_=d(Object.fromEntries([...g].filter(([e])=>[`q`,`page`,`contest_id`,`organization_id`,`status`,`site_id`,`judge_id`].includes(e))));async function v(e=_){f?.abort();let i=f=new AbortController;r.value=!0,o.value=null;try{let r=new URLSearchParams(Object.entries(e).filter(([,e])=>e!==``&&e!=null)),a=await m(`${t}${r.size?`?${r}`:``}`,{signal:i.signal});p&&i===f&&(n.value=a)}catch(e){!i.signal.aborted&&p&&i===f&&(o.value=e,[401,403].includes(e.status)&&(n.value=null))}finally{i===f&&p&&(r.value=!1)}}function y(e){Object.assign(_,e);let t=new URL(location.href);return Object.entries(_).forEach(([e,n])=>n===``||n==null?t.searchParams.delete(e):t.searchParams.set(e,n)),t.href!==location.href&&history.pushState(history.state,``,t),v()}async function b(e,t,n,i=`POST`,a){if(c.value||r.value||o.value)return null;c.value=!0,l.value=``,u.value=null;try{let r=JSON.stringify([e,i,t]);h?.signature!==r&&(h={signature:r,key:crypto.randomUUID()});let a=await m(e,{method:i,body:t,key:h.key});return h=null,p&&(l.value=n),a}catch(e){if(p){u.value=e,c.value=!1,e.status===422&&(h=null),await s();let t=Object.keys(e.errors||{})[0];(t&&a?.elements.namedItem(t)||document.querySelector(`[data-feature-action-error]`))?.focus()}return null}finally{c.value=!1}}function x(){let e=new URLSearchParams(location.search);Object.keys(_).forEach(e=>delete _[e]);for(let t of[`q`,`page`,`contest_id`,`organization_id`,`status`,`site_id`,`judge_id`])e.has(t)&&(_[t]=e.get(t));v()}return i(()=>{v(),window.addEventListener(`popstate`,x)}),a(()=>{p=!1,f?.abort(),window.removeEventListener(`popstate`,x)}),{data:n,loading:r,error:o,busy:c,notice:l,actionError:u,query:_,load:v,filter:y,act:b}}var v={key:0,role:`status`,class:`feature-message`},y={key:1,class:`surface feature-empty`,role:`alert`},b={key:0},x={key:1,href:`/login`,class:`button-primary`},S={key:4,href:`/ajuda`,class:`button-secondary`},C={key:2,"data-feature-action-error":``,tabindex:`-1`,class:`feature-message feature-error`,role:`alert`},w={key:0},T={key:1,href:`/login`,class:`button-secondary`},E={key:3,href:`/ajuda`,class:`button-secondary`},D={key:4},O={key:3,role:`status`,class:`feature-message`},k={key:4,role:`status`,class:`feature-message feature-success`},A={__name:`FeatureState`,props:{loading:Boolean,stale:Boolean,error:Object,busy:Boolean,notice:String,actionError:Object},emits:[`retry`],setup(e){let i=()=>location.reload();return(a,s)=>(n(),r(c,null,[e.loading?(n(),r(`p`,v,`Carregando informações…`)):l(``,!0),e.error?(n(),r(`div`,y,[o(`h2`,null,t(e.error.status===403?`Acesso restrito`:`Não foi possível carregar`),1),o(`p`,null,t(e.error.message),1),e.stale?(n(),r(`p`,b,`As informações abaixo são da última consulta concluída. Atualize antes de realizar uma ação.`)):l(``,!0),e.error.status===401?(n(),r(`a`,x,`Entrar novamente`)):e.error.status===419?(n(),r(`button`,{key:2,type:`button`,class:`button-secondary`,onClick:i},`Atualizar sessão`)):e.error.status===403?(n(),r(`a`,S,`Consultar ajuda`)):(n(),r(`button`,{key:3,class:`button-secondary`,type:`button`,onClick:s[0]||=e=>a.$emit(`retry`)},`Tentar novamente`))])):l(``,!0),e.actionError?(n(),r(`div`,C,[o(`p`,null,t(e.actionError.message),1),[401,419].includes(e.actionError.status)?(n(),r(`p`,w,`Copie seu texto antes de sair desta página para recuperar a sessão.`)):l(``,!0),e.actionError.status===401?(n(),r(`a`,T,`Entrar novamente`)):e.actionError.status===419?(n(),r(`button`,{key:2,type:`button`,class:`button-secondary`,onClick:i},`Atualizar sessão`)):e.actionError.status===403?(n(),r(`a`,E,`Consultar permissões`)):l(``,!0),Object.keys(e.actionError.errors||{}).length?(n(),r(`ul`,D,[(n(!0),r(c,null,u(e.actionError.errors,(e,i)=>(n(),r(`li`,{key:i},t(Array.isArray(e)?e.join(` `):e),1))),128))])):l(``,!0)])):l(``,!0),e.busy?(n(),r(`p`,O,`Enviando… Aguarde a confirmação.`)):l(``,!0),e.notice?(n(),r(`p`,k,t(e.notice),1)):l(``,!0)],64))}};export{g as a,p as i,_ as n,m as o,h as r,A as t}; \ No newline at end of file diff --git a/public/build/assets/FeatureState-DoiXEL_p.js b/public/build/assets/FeatureState-DoiXEL_p.js new file mode 100644 index 00000000..954e2458 --- /dev/null +++ b/public/build/assets/FeatureState-DoiXEL_p.js @@ -0,0 +1 @@ +import{C as e,D as t,_ as n,b as r,d as i,f as a,g as o,l as s,p as c,v as l,w as u,y as d}from"./app-B8gaJnTP.js";var f=class extends Error{constructor(e,t=0,n={}){super(e),this.status=t,this.errors=n}};function p(e){return typeof e!=`string`||!e.startsWith(`/`)||e.startsWith(`//`)||/[\\\r\n]/.test(e)?null:e}async function m(e,{method:t=`GET`,body:n,signal:r,key:i}={}){if(!p(e))throw new f(`Endereço inválido. Atualize a página.`);let a=new AbortController,o=()=>a.abort();r?.addEventListener(`abort`,o,{once:!0}),r?.aborted&&a.abort();let s=setTimeout(o,2e4),c=typeof FormData<`u`&&n instanceof FormData;try{let r=await fetch(e,{method:t,credentials:`same-origin`,signal:a.signal,headers:{Accept:`application/json`,"X-Requested-With":`XMLHttpRequest`,...n&&!c?{"Content-Type":`application/json`}:{},...t===`GET`?{}:{"X-CSRF-TOKEN":document.querySelector(`meta[name="csrf-token"]`)?.content||``},...i?{"Idempotency-Key":i}:{}},...n?{body:c?n:JSON.stringify(n)}:{}}),o=r.headers.get(`content-type`)?.includes(`application/json`)?await r.json():null;if(!r.ok||!o||r.redirected)throw new f({401:`Sua sessão terminou. Entre novamente para continuar.`,419:`Sua sessão expirou. Atualize a página antes de tentar novamente.`,403:`Seu perfil não tem acesso a estes dados. Consulte a organização.`,404:`Este recurso ainda não está disponível ou não foi encontrado.`,409:`Os dados mudaram ou esta operação já está em andamento. Atualize antes de continuar.`,422:`Revise os campos indicados e tente novamente.`,429:`Muitas solicitações. Aguarde um momento antes de tentar novamente.`,503:`Este recurso está temporariamente indisponível. Tente novamente mais tarde.`}[r.redirected?401:r.status]||`Não foi possível concluir a solicitação. Tente novamente.`,r.redirected?401:r.status,o?.errors||{});if(!o.data||typeof o.data!=`object`)throw new f(`A resposta está incompleta. Tente atualizar a página.`);return o.data}catch(e){throw e instanceof f||r?.aborted?e:new f(e.name===`AbortError`?`O servidor demorou para responder. Verifique o estado antes de tentar novamente.`:`Não foi possível conectar. Verifique sua conexão e tente novamente.`)}finally{clearTimeout(s),r?.removeEventListener(`abort`,o)}}var h=e=>e&&Number.isFinite(new Date(e).getTime())?new Intl.DateTimeFormat(`pt-BR`,{dateStyle:`short`,timeStyle:`short`}).format(new Date(e)):`Ainda não registrada`,g=e=>e==null?`Sem dados`:`${new Intl.NumberFormat(`pt-BR`,{maximumFractionDigits:1}).format(e)}%`;function _(t){let r=u(null),i=u(!1),a=u(null),s=u(!1),c=u(``),d=u(null),f,p=!0,h,g=new URLSearchParams(location.search),_=e(Object.fromEntries([...g].filter(([e])=>[`q`,`page`,`contest_id`,`organization_id`,`status`,`site_id`,`judge_id`,`skill`].includes(e))));async function v(e=_){f?.abort();let n=f=new AbortController;i.value=!0,a.value=null;try{let i=new URLSearchParams(Object.entries(e).filter(([,e])=>e!==``&&e!=null)),a=await m(`${t}${i.size?`?${i}`:``}`,{signal:n.signal});p&&n===f&&(r.value=a)}catch(e){!n.signal.aborted&&p&&n===f&&(a.value=e,[401,403].includes(e.status)&&(r.value=null))}finally{n===f&&p&&(i.value=!1)}}function y(e){Object.assign(_,e);let t=new URL(location.href);return Object.entries(_).forEach(([e,n])=>n===``||n==null?t.searchParams.delete(e):t.searchParams.set(e,n)),t.href!==location.href&&history.pushState(history.state,``,t),v()}async function b(e,t,n,r=`POST`,l){if(s.value||i.value||a.value)return null;s.value=!0,c.value=``,d.value=null;try{let i=typeof FormData<`u`&&t instanceof FormData?[...t.entries()].map(([e,t])=>[e,typeof t==`string`?t:[t.name,t.size,t.lastModified]]):t,a=JSON.stringify([e,r,i]);h?.signature!==a&&(h={signature:a,key:crypto.randomUUID()});let o=await m(e,{method:r,body:t,key:h.key});return h=null,p&&(c.value=n),o}catch(e){if(p){d.value=e,s.value=!1,e.status===422&&(h=null),await o();let t=Object.keys(e.errors||{})[0];(t&&l?.elements.namedItem(t)||document.querySelector(`[data-feature-action-error]`))?.focus()}return null}finally{s.value=!1}}function x(){let e=new URLSearchParams(location.search);Object.keys(_).forEach(e=>delete _[e]);for(let t of[`q`,`page`,`contest_id`,`organization_id`,`status`,`site_id`,`judge_id`,`skill`])e.has(t)&&(_[t]=e.get(t));v()}return l(()=>{v(),window.addEventListener(`popstate`,x)}),n(()=>{p=!1,f?.abort(),window.removeEventListener(`popstate`,x)}),{data:r,loading:i,error:a,busy:s,notice:c,actionError:d,query:_,load:v,filter:y,act:b}}var v={key:0,role:`status`,class:`feature-message`},y={key:1,class:`surface feature-empty`,role:`alert`},b={key:0},x={key:1,href:`/login`,class:`button-primary`},S={key:4,href:`/ajuda`,class:`button-secondary`},C={key:2,"data-feature-action-error":``,tabindex:`-1`,class:`feature-message feature-error`,role:`alert`},w={key:0},T={key:1,href:`/login`,class:`button-secondary`},E={key:3,href:`/ajuda`,class:`button-secondary`},D={key:4},O={key:3,role:`status`,class:`feature-message`},k={key:4,role:`status`,class:`feature-message feature-success`},A={__name:`FeatureState`,props:{loading:Boolean,stale:Boolean,error:Object,busy:Boolean,notice:String,actionError:Object},emits:[`retry`],setup(e){let n=()=>location.reload();return(o,l)=>(d(),c(s,null,[e.loading?(d(),c(`p`,v,`Carregando informações…`)):a(``,!0),e.error?(d(),c(`div`,y,[i(`h2`,null,t(e.error.status===403?`Acesso restrito`:`Não foi possível carregar`),1),i(`p`,null,t(e.error.message),1),e.stale?(d(),c(`p`,b,`As informações abaixo são da última consulta concluída. Atualize antes de realizar uma ação.`)):a(``,!0),e.error.status===401?(d(),c(`a`,x,`Entrar novamente`)):e.error.status===419?(d(),c(`button`,{key:2,type:`button`,class:`button-secondary`,onClick:n},`Atualizar sessão`)):e.error.status===403?(d(),c(`a`,S,`Consultar ajuda`)):(d(),c(`button`,{key:3,class:`button-secondary`,type:`button`,onClick:l[0]||=e=>o.$emit(`retry`)},`Tentar novamente`))])):a(``,!0),e.actionError?(d(),c(`div`,C,[i(`p`,null,t(e.actionError.message),1),[401,419].includes(e.actionError.status)?(d(),c(`p`,w,`Copie seu texto antes de sair desta página para recuperar a sessão.`)):a(``,!0),e.actionError.status===401?(d(),c(`a`,T,`Entrar novamente`)):e.actionError.status===419?(d(),c(`button`,{key:2,type:`button`,class:`button-secondary`,onClick:n},`Atualizar sessão`)):e.actionError.status===403?(d(),c(`a`,E,`Consultar permissões`)):a(``,!0),Object.keys(e.actionError.errors||{}).length?(d(),c(`ul`,D,[(d(!0),c(s,null,r(e.actionError.errors,(e,n)=>(d(),c(`li`,{key:n},t(Array.isArray(e)?e.join(` `):e),1))),128))])):a(``,!0)])):a(``,!0),e.busy?(d(),c(`p`,O,`Enviando… Aguarde a confirmação.`)):a(``,!0),e.notice?(d(),c(`p`,k,t(e.notice),1)):a(``,!0)],64))}};export{g as a,p as i,_ as n,m as o,h as r,A as t}; \ No newline at end of file diff --git a/public/build/assets/FieldError-P7Uk3ge_.js b/public/build/assets/FieldError-DRbrcIPQ.js similarity index 57% rename from public/build/assets/FieldError-P7Uk3ge_.js rename to public/build/assets/FieldError-DRbrcIPQ.js index 4caedc46..f63cf005 100644 --- a/public/build/assets/FieldError-P7Uk3ge_.js +++ b/public/build/assets/FieldError-DRbrcIPQ.js @@ -1 +1 @@ -import{T as e,_ as t,d as n}from"./app-DKg3nD5E.js";var r=[`hidden`,`id`],i={__name:`FieldError`,props:{error:Object,name:String},setup(i){return(a,o)=>(t(),n(`p`,{hidden:!i.error?.errors?.[i.name],id:`${i.name}-error`,class:`field-error`},e(i.error?.errors?.[i.name]?.join(` `)),9,r))}};export{i as t}; \ No newline at end of file +import{D as e,p as t,y as n}from"./app-B8gaJnTP.js";var r=[`hidden`,`id`],i={__name:`FieldError`,props:{error:Object,name:String},setup(i){return(a,o)=>(n(),t(`p`,{hidden:!i.error?.errors?.[i.name],id:`${i.name}-error`,class:`field-error`},e(i.error?.errors?.[i.name]?.join(` `)),9,r))}};export{i as t}; \ No newline at end of file diff --git a/public/build/assets/JudgeHistory-D4ix9-I6.js b/public/build/assets/JudgeHistory-D4ix9-I6.js deleted file mode 100644 index b6a40e99..00000000 --- a/public/build/assets/JudgeHistory-D4ix9-I6.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,b as i,c as a,d as o,f as s,i as c,l,o as u,p as d,s as f,u as p,v as m,w as h,y as g}from"./app-DKg3nD5E.js";import{i as _,n as v,t as y}from"./FeatureState-Ceer7rtj.js";import{t as b}from"./FeaturePager-BA0LLbT3.js";import{t as x}from"./ReportChart-jiaGIq-w.js";var ee={class:`feature-stack`},S={class:`feature-message`},C={class:`feature-help`},w={class:`feature-metrics`},T={class:`surface stat-card`},E={class:`surface stat-card`},D={class:`surface stat-card`},O={class:`surface stat-card`},k={class:`surface feature-panel`},A={key:0,class:`feature-empty`},j={class:`table-scroll`},M={class:`report-table`},N={scope:`row`},P={class:`surface feature-panel`},F=[`value`],I=[`disabled`],te=[`disabled`],L={key:0,class:`feature-empty`},R={key:1,class:`table-scroll`},z={class:`report-table`},B={scope:`row`},V=[`href`],H={key:1},U={__name:`JudgeHistory`,setup(U){let{data:W,loading:G,error:K,query:q,load:J,filter:Y}=v(`/api/frontend/reports/judge-history`),X=t(q.judge_id||``);g(()=>q.judge_id,e=>{X.value=e||``});let Z=e=>{if(e==null)return`Sem dados`;if(e<60)return`${e} s`;let t=Math.floor(e/60);return t<60?`${t} min`:`${Math.floor(t/60)} h ${t%60} min`},Q=a(()=>W.value?.judges??[]),$=a(()=>({labels:Q.value.map(e=>e.name),datasets:[{label:`Aceitas`,data:Q.value.map(e=>e.accepted),token:`--color-success`},{label:`Não aceitas`,data:Q.value.map(e=>e.rejected),token:`--color-destructive`}]}));return(t,a)=>(r(),o(`div`,ee,[d(y,{loading:e(G),error:e(K),stale:!!e(W),onRetry:a[0]||=t=>e(J)()},null,8,[`loading`,`error`,`stale`]),e(W)?(r(),o(f,{key:0},[l(`div`,S,[l(`strong`,null,n(e(W).contest?.name),1),a[5]||=s(` — histórico de julgamento. `,-1),l(`p`,C,` Apenas julgamentos feitos por uma pessoa aparecem na lista. Os `+n(e(W).summary?.automatic??0)+` julgamentos automáticos são contados à parte: eles não têm juiz responsável, e somá-los a alguém faria o total dessa pessoa mentir. `,1)]),l(`dl`,w,[l(`div`,T,[a[6]||=l(`dt`,null,`Julgamentos`,-1),l(`dd`,null,n(e(W).summary?.judged??`—`),1)]),l(`div`,E,[a[7]||=l(`dt`,null,`Por pessoa`,-1),l(`dd`,null,n(e(W).summary?.manual??`—`),1)]),l(`div`,D,[a[8]||=l(`dt`,null,`Automáticos`,-1),l(`dd`,null,n(e(W).summary?.automatic??`—`),1)]),l(`div`,O,[a[9]||=l(`dt`,null,`Juízes ativos`,-1),l(`dd`,null,n(e(W).summary?.judges??`—`),1)])]),l(`section`,k,[a[12]||=l(`h2`,null,`Por juiz`,-1),Q.value.length?(r(),o(f,{key:1},[d(x,{type:`bar`,title:`Julgamentos por juiz`,summary:`Quantos vereditos cada juiz deu, separados entre aceitas e não aceitas.`,"unit-label":`Juiz`,labels:$.value.labels,datasets:$.value.datasets},null,8,[`labels`,`datasets`]),l(`div`,j,[l(`table`,M,[a[11]||=l(`thead`,null,[l(`tr`,null,[l(`th`,{scope:`col`},`Juiz`),l(`th`,{scope:`col`},`Julgamentos`),l(`th`,{scope:`col`},`Aceitas`),l(`th`,{scope:`col`},`Não aceitas`),l(`th`,{scope:`col`},`Espera mediana`)])],-1),l(`tbody`,null,[(r(!0),o(f,null,m(Q.value,e=>(r(),o(`tr`,{key:e.judge_id},[l(`th`,N,n(e.name),1),l(`td`,null,n(e.judged),1),l(`td`,null,n(e.accepted),1),l(`td`,null,n(e.rejected),1),l(`td`,null,n(Z(e.median_delay_seconds)),1)]))),128))])])])],64)):(r(),o(`div`,A,[...a[10]||=[l(`h3`,null,`Nenhum julgamento manual registrado`,-1),l(`p`,null,`Enquanto o julgamento automático der conta, esta lista fica vazia.`,-1)]]))]),l(`section`,P,[a[17]||=l(`h2`,null,`Julgamentos`,-1),l(`form`,{class:`feature-search`,onSubmit:a[3]||=u(t=>e(Y)({judge_id:X.value,page:1}),[`prevent`])},[l(`label`,null,[a[14]||=s(`Juiz `,-1),i(l(`select`,{"onUpdate:modelValue":a[1]||=e=>X.value=e,name:`judge_id`},[a[13]||=l(`option`,{value:``},`Todos`,-1),(r(!0),o(f,null,m(Q.value,e=>(r(),o(`option`,{key:e.judge_id,value:e.judge_id},n(e.name),9,F))),128))],512),[[c,X.value]])]),l(`button`,{class:`button-primary`,disabled:e(G)},`Aplicar filtro`,8,I),l(`button`,{type:`button`,class:`button-secondary`,disabled:e(G),onClick:a[2]||=t=>e(J)()},`Atualizar`,8,te)],32),e(W).items?.length?(r(),o(`div`,R,[l(`table`,z,[a[16]||=l(`thead`,null,[l(`tr`,null,[l(`th`,{scope:`col`},`Envio`),l(`th`,{scope:`col`},`Problema`),l(`th`,{scope:`col`},`Equipe`),l(`th`,{scope:`col`},`Sede`),l(`th`,{scope:`col`},`Veredito`),l(`th`,{scope:`col`},`Juiz`),l(`th`,{scope:`col`},`Espera`)])],-1),l(`tbody`,null,[(r(!0),o(f,null,m(e(W).items,t=>(r(),o(`tr`,{key:t.run_id},[l(`th`,B,[e(_)(t.detail_url)?(r(),o(`a`,{key:0,href:e(_)(t.detail_url)},`#`+n(t.run_number),9,V)):(r(),o(`span`,H,`#`+n(t.run_number),1))]),l(`td`,null,n(t.problem),1),l(`td`,null,n(t.team),1),l(`td`,null,n(t.site),1),l(`td`,null,[l(`span`,{class:h([`feature-badge`,t.is_accepted?`feature-success`:`feature-error`])},n(t.verdict_short)+` — `+n(t.verdict),3)]),l(`td`,null,n(t.judge),1),l(`td`,null,n(Z(t.delay_seconds)),1)]))),128))])])])):(r(),o(`div`,L,[...a[15]||=[l(`h3`,null,`Nenhum julgamento neste recorte`,-1),l(`p`,null,`Ajuste o filtro de juiz ou atualize a página.`,-1)]])),d(b,{meta:e(W).meta,loading:e(G),onPage:a[4]||=t=>e(Y)({page:t})},null,8,[`meta`,`loading`])])],64)):p(``,!0)]))}};export{U as default}; \ No newline at end of file diff --git a/public/build/assets/JudgeHistory-Peu7eUVE.js b/public/build/assets/JudgeHistory-Peu7eUVE.js new file mode 100644 index 00000000..ff75502a --- /dev/null +++ b/public/build/assets/JudgeHistory-Peu7eUVE.js @@ -0,0 +1 @@ +import{D as e,E as t,S as n,T as r,a as i,b as a,c as o,d as s,f as c,h as l,l as u,m as d,p as f,u as p,w as m,x as ee,y as h}from"./app-B8gaJnTP.js";import{i as g,n as _,t as v}from"./FeatureState-DoiXEL_p.js";import{t as y}from"./FeaturePager-DkN6l5V8.js";import{t as b}from"./ReportChart-CEHmWQ8G.js";var x={class:`feature-stack`},te={class:`feature-message`},S={class:`feature-help`},C={class:`feature-metrics`},w={class:`surface stat-card`},T={class:`surface stat-card`},E={class:`surface stat-card`},D={class:`surface stat-card`},O={class:`surface feature-panel`},k={key:0,class:`feature-empty`},A={class:`table-scroll`},j={class:`report-table`},M={scope:`row`},N={class:`surface feature-panel`},P=[`value`],F=[`disabled`],I=[`disabled`],L={key:0,class:`feature-empty`},R={key:1,class:`table-scroll`},z={class:`report-table`},B={scope:`row`},V=[`href`],H={key:1},U={__name:`JudgeHistory`,setup(U){let{data:W,loading:G,error:K,query:q,load:J,filter:Y}=_(`/api/frontend/reports/judge-history`),X=m(q.judge_id||``);ee(()=>q.judge_id,e=>{X.value=e||``});let Z=e=>{if(e==null)return`Sem dados`;if(e<60)return`${e} s`;let t=Math.floor(e/60);return t<60?`${t} min`:`${Math.floor(t/60)} h ${t%60} min`},Q=p(()=>W.value?.judges??[]),$=p(()=>({labels:Q.value.map(e=>e.name),datasets:[{label:`Aceitas`,data:Q.value.map(e=>e.accepted),token:`--color-success`},{label:`Não aceitas`,data:Q.value.map(e=>e.rejected),token:`--color-destructive`}]}));return(p,m)=>(h(),f(`div`,x,[l(v,{loading:r(G),error:r(K),stale:!!r(W),onRetry:m[0]||=e=>r(J)()},null,8,[`loading`,`error`,`stale`]),r(W)?(h(),f(u,{key:0},[s(`div`,te,[s(`strong`,null,e(r(W).contest?.name),1),m[5]||=d(` — histórico de julgamento. `,-1),s(`p`,S,` Apenas julgamentos feitos por uma pessoa aparecem na lista. Os `+e(r(W).summary?.automatic??0)+` julgamentos automáticos são contados à parte: eles não têm juiz responsável, e somá-los a alguém faria o total dessa pessoa mentir. `,1)]),s(`dl`,C,[s(`div`,w,[m[6]||=s(`dt`,null,`Julgamentos`,-1),s(`dd`,null,e(r(W).summary?.judged??`—`),1)]),s(`div`,T,[m[7]||=s(`dt`,null,`Por pessoa`,-1),s(`dd`,null,e(r(W).summary?.manual??`—`),1)]),s(`div`,E,[m[8]||=s(`dt`,null,`Automáticos`,-1),s(`dd`,null,e(r(W).summary?.automatic??`—`),1)]),s(`div`,D,[m[9]||=s(`dt`,null,`Juízes ativos`,-1),s(`dd`,null,e(r(W).summary?.judges??`—`),1)])]),s(`section`,O,[m[12]||=s(`h2`,null,`Por juiz`,-1),Q.value.length?(h(),f(u,{key:1},[l(b,{type:`bar`,title:`Julgamentos por juiz`,summary:`Quantos vereditos cada juiz deu, separados entre aceitas e não aceitas.`,"unit-label":`Juiz`,labels:$.value.labels,datasets:$.value.datasets},null,8,[`labels`,`datasets`]),s(`div`,A,[s(`table`,j,[m[11]||=s(`thead`,null,[s(`tr`,null,[s(`th`,{scope:`col`},`Juiz`),s(`th`,{scope:`col`},`Julgamentos`),s(`th`,{scope:`col`},`Aceitas`),s(`th`,{scope:`col`},`Não aceitas`),s(`th`,{scope:`col`},`Espera mediana`)])],-1),s(`tbody`,null,[(h(!0),f(u,null,a(Q.value,t=>(h(),f(`tr`,{key:t.judge_id},[s(`th`,M,e(t.name),1),s(`td`,null,e(t.judged),1),s(`td`,null,e(t.accepted),1),s(`td`,null,e(t.rejected),1),s(`td`,null,e(Z(t.median_delay_seconds)),1)]))),128))])])])],64)):(h(),f(`div`,k,[...m[10]||=[s(`h3`,null,`Nenhum julgamento manual registrado`,-1),s(`p`,null,`Enquanto o julgamento automático der conta, esta lista fica vazia.`,-1)]]))]),s(`section`,N,[m[17]||=s(`h2`,null,`Julgamentos`,-1),s(`form`,{class:`feature-search`,onSubmit:m[3]||=o(e=>r(Y)({judge_id:X.value,page:1}),[`prevent`])},[s(`label`,null,[m[14]||=d(`Juiz `,-1),n(s(`select`,{"onUpdate:modelValue":m[1]||=e=>X.value=e,name:`judge_id`},[m[13]||=s(`option`,{value:``},`Todos`,-1),(h(!0),f(u,null,a(Q.value,t=>(h(),f(`option`,{key:t.judge_id,value:t.judge_id},e(t.name),9,P))),128))],512),[[i,X.value]])]),s(`button`,{class:`button-primary`,disabled:r(G)},`Aplicar filtro`,8,F),s(`button`,{type:`button`,class:`button-secondary`,disabled:r(G),onClick:m[2]||=e=>r(J)()},`Atualizar`,8,I)],32),r(W).items?.length?(h(),f(`div`,R,[s(`table`,z,[m[16]||=s(`thead`,null,[s(`tr`,null,[s(`th`,{scope:`col`},`Envio`),s(`th`,{scope:`col`},`Problema`),s(`th`,{scope:`col`},`Equipe`),s(`th`,{scope:`col`},`Sede`),s(`th`,{scope:`col`},`Veredito`),s(`th`,{scope:`col`},`Juiz`),s(`th`,{scope:`col`},`Espera`)])],-1),s(`tbody`,null,[(h(!0),f(u,null,a(r(W).items,n=>(h(),f(`tr`,{key:n.run_id},[s(`th`,B,[r(g)(n.detail_url)?(h(),f(`a`,{key:0,href:r(g)(n.detail_url)},`#`+e(n.run_number),9,V)):(h(),f(`span`,H,`#`+e(n.run_number),1))]),s(`td`,null,e(n.problem),1),s(`td`,null,e(n.team),1),s(`td`,null,e(n.site),1),s(`td`,null,[s(`span`,{class:t([`feature-badge`,n.is_accepted?`feature-success`:`feature-error`])},e(n.verdict_short)+` — `+e(n.verdict),3)]),s(`td`,null,e(n.judge),1),s(`td`,null,e(Z(n.delay_seconds)),1)]))),128))])])])):(h(),f(`div`,L,[...m[15]||=[s(`h3`,null,`Nenhum julgamento neste recorte`,-1),s(`p`,null,`Ajuste o filtro de juiz ou atualize a página.`,-1)]])),l(y,{meta:r(W).meta,loading:r(G),onPage:m[4]||=e=>r(Y)({page:e})},null,8,[`meta`,`loading`])])],64)):c(``,!0)]))}};export{U as default}; \ No newline at end of file diff --git a/public/build/assets/JudgeMachines-BWvQGcui.js b/public/build/assets/JudgeMachines-BWvQGcui.js deleted file mode 100644 index b0523911..00000000 --- a/public/build/assets/JudgeMachines-BWvQGcui.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,a as ee,b as te,c as i,d as a,f as o,g as ne,l as s,o as re,p as ie,s as c,u as l,v as u,w as d}from"./app-DKg3nD5E.js";import{n as f,o as p,r as ae,t as oe}from"./FeatureState-Ceer7rtj.js";var se={class:`feature-stack`},ce={class:`feature-metrics`},le={class:`surface stat-card`},ue={class:`surface stat-card`},de={class:`surface stat-card`},fe={key:0,class:`surface feature-panel`},pe=[`disabled`],m={key:0,class:`feature-message feature-success`},h={class:`feature-secret`},g=[`value`],_={class:`surface feature-panel`},v={class:`feature-search`},y=[`disabled`],b={class:`feature-help`},x={key:0,class:`feature-empty`},S={class:`feature-heading`},C={class:`feature-details`},w={class:`feature-help`},T={key:0,class:`feature-help`},E=[`disabled`,`onClick`],D={class:`feature-message`},O=[`disabled`,`onClick`],k=[`disabled`],A=[`disabled`,`onClick`],j={class:`surface feature-panel`},M={key:0,class:`feature-message feature-error`,role:`alert`},N={key:0,class:`feature-empty`},P={key:0,class:`feature-help`},F={key:1,class:`feature-message feature-error`,role:`alert`},I={key:1,class:`feature-table`},me={key:0,class:`feature-badge feature-error`},L={key:2,class:`feature-help`},R={key:3,class:`feature-details`},z={class:`feature-sublist`},he={key:2,class:`feature-message`,role:`status`},ge={__name:`JudgeMachines`,setup(ge){let{data:B,loading:V,error:_e,busy:H,notice:ve,actionError:ye,load:U,act:W}=f(`/api/frontend/judgehosts`),G=t(``),K=t(null),q=t(null),J=t(null),Y=t(null),X=t(!1),be=i(()=>{let e=Y.value?.coverage;return!!e&&e.accepted>0&&e.measured===0});function xe(e){return e&&typeof e.divergence==`number`&&typeof e.fastest_ms==`number`&&typeof e.slowest_ms==`number`&&Array.isArray(e.per_host)}async function Z(){X.value=!1;try{let e=await p(`/api/frontend/judgehosts/calibration`);if(typeof e?.threshold!=`number`||!Array.isArray(e.items)){Y.value=null,X.value=!0;return}Y.value={...e,items:e.items.filter(xe)}}catch{Y.value=null,X.value=!0}}ne(Z);let Se=e=>B.value?.items?.find(t=>t.id===e)?.name??`#${e}`,Q={judging:{label:`Julgando`,tone:`feature-success`},idle:{label:`Ociosa`,tone:``},stale:{label:`Sem resposta`,tone:`feature-error`},disabled:{label:`Desligada`,tone:``},never_seen:{label:`Nunca registrou`,tone:``}};async function Ce(){K.value=null;let e=await W(`/api/frontend/judgehosts`,{name:G.value},`Credencial emitida.`,`POST`,J.value);e&&(K.value=e.token,G.value=``,await U())}async function $(e,t){await W(`/api/frontend/judgehosts/${e.id}`,{enabled:t},t?`Maquina religada.`:`Maquina desligada.`,`PATCH`)&&(q.value=null,K.value=null,await U())}return(t,i)=>(r(),a(`div`,se,[ie(oe,{loading:e(V),error:e(_e),stale:!!e(B),busy:e(H),notice:e(ve),"action-error":e(ye),onRetry:i[0]||=t=>e(U)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),e(B)?(r(),a(c,{key:0},[s(`dl`,ce,[s(`div`,le,[i[8]||=s(`dt`,null,`Máquinas`,-1),s(`dd`,null,n(e(B).meta?.total??`—`),1)]),s(`div`,ue,[i[9]||=s(`dt`,null,`Habilitadas`,-1),s(`dd`,null,n(e(B).meta?.enabled??`—`),1)]),s(`div`,de,[i[10]||=s(`dt`,null,`Julgando agora`,-1),s(`dd`,null,n(e(B).meta?.judging??`—`),1)]),s(`div`,{class:d([`surface stat-card`,{"feature-error":e(B).meta?.stale>0}])},[i[11]||=s(`dt`,null,`Sem resposta`,-1),s(`dd`,null,n(e(B).meta?.stale??`—`),1)],2)]),e(B).capabilities?.can_manage_judges?(r(),a(`section`,fe,[i[15]||=s(`h2`,null,`Emitir credencial de máquina`,-1),i[16]||=s(`p`,{class:`feature-help`},[o(`O equivalente ao `),s(`code`,null,`php artisan judgehost:create`),o(`, sem precisar de shell no servidor. O token aparece uma única vez.`)],-1),s(`form`,{ref_key:`form`,ref:J,class:`feature-search`,onSubmit:i[2]||=re(e=>Ce(),[`prevent`])},[s(`label`,null,[i[12]||=o(`Nome da máquina`,-1),te(s(`input`,{"onUpdate:modelValue":i[1]||=e=>G.value=e,name:`name`,maxlength:`100`,required:``,autocomplete:`off`,placeholder:`sala-3`},null,512),[[ee,G.value]])]),s(`button`,{class:`button-primary`,disabled:e(H)||!G.value.trim()},`Emitir credencial`,8,pe)],544),K.value?(r(),a(`div`,m,[s(`label`,h,[i[13]||=o(`Token da nova máquina`,-1),s(`input`,{value:K.value,readonly:``,autocomplete:`off`,spellcheck:`false`,"aria-describedby":`token-help`,onFocus:i[3]||=e=>e.target.select()},null,40,g)]),i[14]||=s(`p`,{id:`token-help`},[o(`Selecione e copie para um local seguro. Ele não será exibido novamente: o servidor guarda apenas o sha256. Configure `),s(`code`,null,`JUDGEHOST_TOKEN`),o(` na máquina com este valor.`)],-1),s(`button`,{type:`button`,class:`button-secondary`,onClick:i[4]||=e=>K.value=null},`Já guardei, ocultar token`)])):l(``,!0)])):l(``,!0),s(`section`,_,[s(`div`,v,[s(`button`,{type:`button`,class:`button-secondary`,disabled:e(V),onClick:i[5]||=t=>e(U)()},`Atualizar`,8,y),s(`p`,b,`Uma máquina é dada como sem resposta após `+n(e(B).meta?.stale_after_seconds??`—`)+` s — três vezes o intervalo com que um agente ocioso pede trabalho. O lease de um run é de `+n(e(B).meta?.lease_seconds??`—`)+` s.`,1)]),e(B).items?.length?l(``,!0):(r(),a(`div`,x,[...i[17]||=[s(`h2`,null,`Nenhuma máquina registrada`,-1),s(`p`,null,[o(`Emita uma credencial acima e configure `),s(`code`,null,`JUDGEHOST_SERVER`),o(` e `),s(`code`,null,`JUDGEHOST_TOKEN`),o(` na máquina que vai julgar.`)],-1)]])),(r(!0),a(c,null,u(e(B).items,t=>(r(),a(`article`,{key:t.id,class:`feature-record`},[s(`div`,S,[s(`h2`,null,n(t.name),1),s(`span`,{class:d([`feature-badge`,Q[t.state]?.tone])},n(Q[t.state]?.label||t.state),3)]),s(`dl`,C,[s(`div`,null,[i[18]||=s(`dt`,null,`Última vez vista`,-1),s(`dd`,null,n(e(ae)(t.last_seen_at)),1)]),s(`div`,null,[i[19]||=s(`dt`,null,`CPUs`,-1),s(`dd`,null,n(t.cpu_count??`Não informado`),1)]),s(`div`,null,[i[20]||=s(`dt`,null,`Memória`,-1),s(`dd`,null,n(t.memory_mb?`${t.memory_mb} MB`:`Não informada`),1)])]),s(`p`,w,[t.declares_languages?(r(),a(c,{key:0},[o(`Linguagens declaradas: `+n(t.languages.join(`, `)),1)],64)):(r(),a(c,{key:1},[o(`Não declarou linguagens — a fila trata isso como “julga qualquer uma”. Agentes anteriores ao #117 se comportam assim.`)],64))]),t.holding?.length?(r(),a(`p`,T,[i[21]||=o(` Segurando agora: `,-1),(r(!0),a(c,null,u(t.holding,e=>(r(),a(c,{key:e.run_id},[o(`#`+n(e.run_number??e.run_id)+` (`+n(e.problem||`?`)+`) há `+n(e.seconds_held)+` s. `,1)],64))),128))])):l(``,!0),e(B).capabilities?.can_manage_judges?(r(),a(c,{key:1},[t.enabled?q.value===t.id?(r(),a(c,{key:1},[s(`p`,D,` Desligar “`+n(t.name)+`” devolve à fila `+n(t.holding?.length||`os`)+` `+n(t.holding?.length===1?`run que ela segura`:`runs que ela segura`)+`, para outra máquina julgar em seguida. A credencial continua válida: religar não exige reinstalar nada. `,1),s(`button`,{type:`button`,class:`button-primary`,disabled:e(H),onClick:e=>$(t,!1)},`Confirmar desligamento`,8,O),s(`button`,{type:`button`,class:`button-secondary`,disabled:e(H),onClick:i[6]||=e=>q.value=null},`Cancelar`,8,k)],64)):(r(),a(`button`,{key:2,type:`button`,class:`button-secondary`,disabled:e(H),onClick:e=>q.value=t.id},`Desligar máquina`,8,A)):(r(),a(`button`,{key:0,type:`button`,class:`button-secondary`,disabled:e(H),onClick:e=>$(t,!0)},`Religar máquina`,8,E))],64)):l(``,!0)]))),128))]),s(`section`,j,[i[31]||=s(`h2`,null,`Comparação entre máquinas`,-1),i[32]||=s(`p`,{class:`feature-help`},[o(` Medido nos envios `),s(`strong`,null,`aceitos`),o(` que a prova já produziu — a mesma solução, julgada em máquinas diferentes. Isto `),s(`strong`,null,`não altera vereditos`),o(`: serve para decidir se as máquinas podem julgar a mesma prova. `)],-1),X.value?(r(),a(`p`,M,[i[22]||=o(` Não foi possível carregar a comparação. `,-1),s(`button`,{type:`button`,class:`button-secondary`,onClick:i[7]||=e=>Z()},`Tentar de novo`)])):Y.value?(r(),a(c,{key:1},[Y.value.items?.length?(r(),a(`table`,I,[i[28]||=s(`caption`,{class:`sr-only`},`Divergência de tempo entre máquinas, por problema e linguagem`,-1),i[29]||=s(`thead`,null,[s(`tr`,null,[s(`th`,{scope:`col`},`Problema`),s(`th`,{scope:`col`},`Linguagem`),s(`th`,{scope:`col`},`Amostras`),s(`th`,{scope:`col`},`Mais rápida`),s(`th`,{scope:`col`},`Mais lenta`),s(`th`,{scope:`col`},`Divergência`)])],-1),s(`tbody`,null,[(r(!0),a(c,null,u(Y.value.items,e=>(r(),a(`tr`,{key:`${e.problem_id}:${e.language_id}`,class:d({"feature-error":e.divergence>=Y.value.threshold})},[s(`td`,null,n(e.problem??`—`),1),s(`td`,null,n(e.language??`—`),1),s(`td`,null,n(e.samples),1),s(`td`,null,n((e.fastest_ms/1e3).toFixed(2))+` s`,1),s(`td`,null,n((e.slowest_ms/1e3).toFixed(2))+` s`,1),s(`td`,null,[o(n(e.divergence.toFixed(2))+`× `,1),e.divergence>=Y.value.threshold?(r(),a(`span`,me,` acima do limiar `)):l(``,!0)])],2))),128))])])):(r(),a(`div`,N,[i[26]||=s(`h3`,null,`Ainda não há o que comparar`,-1),i[27]||=s(`p`,null,[o(` Uma comparação precisa do mesmo problema e linguagem julgados em `),s(`strong`,null,`duas máquinas diferentes`),o(`, com veredito aceito. Enquanto isso não acontecer, não há medição — o que `),s(`em`,null,`não`),o(` quer dizer que as máquinas sejam equivalentes. `)],-1),Y.value.coverage?(r(),a(`p`,P,[i[23]||=o(` Nesta prova: `,-1),s(`strong`,null,n(Y.value.coverage.accepted),1),o(` `+n(Y.value.coverage.accepted===1?`envio aceito`:`envios aceitos`)+`, `,1),s(`strong`,null,n(Y.value.coverage.measured),1),i[24]||=o(` com medição de tempo, em `,-1),s(`strong`,null,n(Y.value.coverage.hosts_measured),1),o(` `+n(Y.value.coverage.hosts_measured===1?`máquina`:`máquinas`)+`. `,1)])):l(``,!0),be.value?(r(),a(`p`,F,[...i[25]||=[o(` Há envios aceitos e `,-1),s(`strong`,null,`nenhum`,-1),o(` com medição de tempo. Isso não é ausência de divergência — é ausência de dado, e impede a comparação. Verifique se as máquinas que julgaram estão reportando os tempos medidos. `,-1)]])):l(``,!0)])),Y.value.items?.length?(r(),a(`p`,L,` Acima de `+n(Y.value.threshold)+`× o mesmo limite de tempo começa a significar coisas diferentes em máquinas diferentes, e a equipe passa a receber TLE ou AC conforme a máquina que pegou o envio. A mediana é usada para que um engasgo isolado não decida o julgamento sobre uma máquina. `,1)):l(``,!0),Y.value.items?.length?(r(),a(`details`,R,[i[30]||=s(`summary`,null,`Tempo por máquina`,-1),s(`ul`,z,[(r(!0),a(c,null,u(Y.value.items,e=>(r(),a(`li`,{key:`d-${e.problem_id}:${e.language_id}`},[o(n(e.problem??`—`)+` / `+n(e.language??`—`)+`: `,1),(r(!0),a(c,null,u(e.per_host,e=>(r(),a(c,{key:e.judgehost_id},[o(n(Se(e.judgehost_id))+` `+n((e.median_cpu_ms/1e3).toFixed(2))+` s · `,1)],64))),128))]))),128))])])):l(``,!0)],64)):(r(),a(`p`,he,`Carregando comparação…`))])],64)):l(``,!0)]))}};export{ge as default}; \ No newline at end of file diff --git a/public/build/assets/JudgeMachines-CUq9WJuF.js b/public/build/assets/JudgeMachines-CUq9WJuF.js new file mode 100644 index 00000000..b8c7ae08 --- /dev/null +++ b/public/build/assets/JudgeMachines-CUq9WJuF.js @@ -0,0 +1 @@ +import{D as e,E as t,S as n,T as r,b as i,c as ee,d as a,f as o,h as te,l as s,m as c,o as ne,p as l,u as re,v as u,w as d,y as f}from"./app-B8gaJnTP.js";import{n as ie,o as ae,r as p,t as m}from"./FeatureState-DoiXEL_p.js";var oe={class:`feature-stack`},se={class:`feature-metrics`},ce={class:`surface stat-card`},le={class:`surface stat-card`},ue={class:`surface stat-card`},de={key:0,class:`surface feature-panel`},fe=[`disabled`],pe={key:0,class:`feature-message feature-success`},h={class:`feature-secret`},g=[`value`],_={class:`surface feature-panel`},v={class:`feature-search`},y=[`disabled`],b={class:`feature-help`},x={key:0,class:`feature-empty`},S={class:`feature-heading`},C={class:`feature-details`},w={class:`feature-help`},T={key:0,class:`feature-help`},E=[`disabled`,`onClick`],D={class:`feature-message`},O=[`disabled`,`onClick`],k=[`disabled`],A=[`disabled`,`onClick`],j={class:`surface feature-panel`},M={key:0,class:`feature-message feature-error`,role:`alert`},N={key:0,class:`feature-empty`},P={key:0,class:`feature-help`},F={key:1,class:`feature-message feature-error`,role:`alert`},I={key:1,class:`feature-table`},L={key:0,class:`feature-badge feature-error`},me={key:2,class:`feature-help`},R={key:3,class:`feature-details`},z={class:`feature-sublist`},he={key:2,class:`feature-message`,role:`status`},ge={__name:`JudgeMachines`,setup(ge){let{data:B,loading:V,error:_e,busy:H,notice:ve,actionError:ye,load:U,act:W}=ie(`/api/frontend/judgehosts`),G=d(``),K=d(null),q=d(null),J=d(null),Y=d(null),X=d(!1),be=re(()=>{let e=Y.value?.coverage;return!!e&&e.accepted>0&&e.measured===0});function xe(e){return e&&typeof e.divergence==`number`&&typeof e.fastest_ms==`number`&&typeof e.slowest_ms==`number`&&Array.isArray(e.per_host)}async function Z(){X.value=!1;try{let e=await ae(`/api/frontend/judgehosts/calibration`);if(typeof e?.threshold!=`number`||!Array.isArray(e.items)){Y.value=null,X.value=!0;return}Y.value={...e,items:e.items.filter(xe)}}catch{Y.value=null,X.value=!0}}u(Z);let Se=e=>B.value?.items?.find(t=>t.id===e)?.name??`#${e}`,Ce=e=>(e.languages??[]).map(t=>e.language_versions?.[t]?`${t} ${e.language_versions[t]}`:t).join(`, `),Q={judging:{label:`Julgando`,tone:`feature-success`},idle:{label:`Ociosa`,tone:``},stale:{label:`Sem resposta`,tone:`feature-error`},disabled:{label:`Desligada`,tone:``},never_seen:{label:`Nunca registrou`,tone:``}};async function we(){K.value=null;let e=await W(`/api/frontend/judgehosts`,{name:G.value},`Credencial emitida.`,`POST`,J.value);e&&(K.value=e.token,G.value=``,await U())}async function $(e,t){await W(`/api/frontend/judgehosts/${e.id}`,{enabled:t},t?`Maquina religada.`:`Maquina desligada.`,`PATCH`)&&(q.value=null,K.value=null,await U())}return(re,u)=>(f(),l(`div`,oe,[te(m,{loading:r(V),error:r(_e),stale:!!r(B),busy:r(H),notice:r(ve),"action-error":r(ye),onRetry:u[0]||=e=>r(U)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),r(B)?(f(),l(s,{key:0},[a(`dl`,se,[a(`div`,ce,[u[8]||=a(`dt`,null,`Máquinas`,-1),a(`dd`,null,e(r(B).meta?.total??`—`),1)]),a(`div`,le,[u[9]||=a(`dt`,null,`Habilitadas`,-1),a(`dd`,null,e(r(B).meta?.enabled??`—`),1)]),a(`div`,ue,[u[10]||=a(`dt`,null,`Julgando agora`,-1),a(`dd`,null,e(r(B).meta?.judging??`—`),1)]),a(`div`,{class:t([`surface stat-card`,{"feature-error":r(B).meta?.stale>0}])},[u[11]||=a(`dt`,null,`Sem resposta`,-1),a(`dd`,null,e(r(B).meta?.stale??`—`),1)],2)]),r(B).capabilities?.can_manage_judges?(f(),l(`section`,de,[u[15]||=a(`h2`,null,`Emitir credencial de máquina`,-1),u[16]||=a(`p`,{class:`feature-help`},[c(`O equivalente ao `),a(`code`,null,`php artisan judgehost:create`),c(`, sem precisar de shell no servidor. O token aparece uma única vez.`)],-1),a(`form`,{ref_key:`form`,ref:J,class:`feature-search`,onSubmit:u[2]||=ee(e=>we(),[`prevent`])},[a(`label`,null,[u[12]||=c(`Nome da máquina`,-1),n(a(`input`,{"onUpdate:modelValue":u[1]||=e=>G.value=e,name:`name`,maxlength:`100`,required:``,autocomplete:`off`,placeholder:`sala-3`},null,512),[[ne,G.value]])]),a(`button`,{class:`button-primary`,disabled:r(H)||!G.value.trim()},`Emitir credencial`,8,fe)],544),K.value?(f(),l(`div`,pe,[a(`label`,h,[u[13]||=c(`Token da nova máquina`,-1),a(`input`,{value:K.value,readonly:``,autocomplete:`off`,spellcheck:`false`,"aria-describedby":`token-help`,onFocus:u[3]||=e=>e.target.select()},null,40,g)]),u[14]||=a(`p`,{id:`token-help`},[c(`Selecione e copie para um local seguro. Ele não será exibido novamente: o servidor guarda apenas o sha256. Configure `),a(`code`,null,`JUDGEHOST_TOKEN`),c(` na máquina com este valor.`)],-1),a(`button`,{type:`button`,class:`button-secondary`,onClick:u[4]||=e=>K.value=null},`Já guardei, ocultar token`)])):o(``,!0)])):o(``,!0),a(`section`,_,[a(`div`,v,[a(`button`,{type:`button`,class:`button-secondary`,disabled:r(V),onClick:u[5]||=e=>r(U)()},`Atualizar`,8,y),a(`p`,b,`Uma máquina é dada como sem resposta após `+e(r(B).meta?.stale_after_seconds??`—`)+` s — três vezes o intervalo com que um agente ocioso pede trabalho. O lease de um run é de `+e(r(B).meta?.lease_seconds??`—`)+` s.`,1)]),r(B).items?.length?o(``,!0):(f(),l(`div`,x,[...u[17]||=[a(`h2`,null,`Nenhuma máquina registrada`,-1),a(`p`,null,[c(`Emita uma credencial acima e configure `),a(`code`,null,`JUDGEHOST_SERVER`),c(` e `),a(`code`,null,`JUDGEHOST_TOKEN`),c(` na máquina que vai julgar.`)],-1)]])),(f(!0),l(s,null,i(r(B).items,n=>(f(),l(`article`,{key:n.id,class:`feature-record`},[a(`div`,S,[a(`h2`,null,e(n.name),1),a(`span`,{class:t([`feature-badge`,Q[n.state]?.tone])},e(Q[n.state]?.label||n.state),3)]),a(`dl`,C,[a(`div`,null,[u[18]||=a(`dt`,null,`Última vez vista`,-1),a(`dd`,null,e(r(p)(n.last_seen_at)),1)]),a(`div`,null,[u[19]||=a(`dt`,null,`CPUs`,-1),a(`dd`,null,e(n.cpu_count??`Não informado`),1)]),a(`div`,null,[u[20]||=a(`dt`,null,`Memória`,-1),a(`dd`,null,e(n.memory_mb?`${n.memory_mb} MB`:`Não informada`),1)])]),a(`p`,w,[n.declares_languages?(f(),l(s,{key:0},[c(`Linguagens declaradas: `+e(Ce(n)),1)],64)):(f(),l(s,{key:1},[c(`Não declarou linguagens — a fila trata isso como “julga qualquer uma”. Agentes anteriores ao #117 se comportam assim.`)],64))]),n.holding?.length?(f(),l(`p`,T,[u[21]||=c(` Segurando agora: `,-1),(f(!0),l(s,null,i(n.holding,t=>(f(),l(s,{key:t.run_id},[c(`#`+e(t.run_number??t.run_id)+` (`+e(t.problem||`?`)+`) há `+e(t.seconds_held)+` s. `,1)],64))),128))])):o(``,!0),r(B).capabilities?.can_manage_judges?(f(),l(s,{key:1},[n.enabled?q.value===n.id?(f(),l(s,{key:1},[a(`p`,D,` Desligar “`+e(n.name)+`” devolve à fila `+e(n.holding?.length||`os`)+` `+e(n.holding?.length===1?`run que ela segura`:`runs que ela segura`)+`, para outra máquina julgar em seguida. A credencial continua válida: religar não exige reinstalar nada. `,1),a(`button`,{type:`button`,class:`button-primary`,disabled:r(H),onClick:e=>$(n,!1)},`Confirmar desligamento`,8,O),a(`button`,{type:`button`,class:`button-secondary`,disabled:r(H),onClick:u[6]||=e=>q.value=null},`Cancelar`,8,k)],64)):(f(),l(`button`,{key:2,type:`button`,class:`button-secondary`,disabled:r(H),onClick:e=>q.value=n.id},`Desligar máquina`,8,A)):(f(),l(`button`,{key:0,type:`button`,class:`button-secondary`,disabled:r(H),onClick:e=>$(n,!0)},`Religar máquina`,8,E))],64)):o(``,!0)]))),128))]),a(`section`,j,[u[31]||=a(`h2`,null,`Comparação entre máquinas`,-1),u[32]||=a(`p`,{class:`feature-help`},[c(` Medido nos envios `),a(`strong`,null,`aceitos`),c(` que a prova já produziu — a mesma solução, julgada em máquinas diferentes. Isto `),a(`strong`,null,`não altera vereditos`),c(`: serve para decidir se as máquinas podem julgar a mesma prova. `)],-1),X.value?(f(),l(`p`,M,[u[22]||=c(` Não foi possível carregar a comparação. `,-1),a(`button`,{type:`button`,class:`button-secondary`,onClick:u[7]||=e=>Z()},`Tentar de novo`)])):Y.value?(f(),l(s,{key:1},[Y.value.items?.length?(f(),l(`table`,I,[u[28]||=a(`caption`,{class:`sr-only`},`Divergência de tempo entre máquinas, por problema e linguagem`,-1),u[29]||=a(`thead`,null,[a(`tr`,null,[a(`th`,{scope:`col`},`Problema`),a(`th`,{scope:`col`},`Linguagem`),a(`th`,{scope:`col`},`Amostras`),a(`th`,{scope:`col`},`Mais rápida`),a(`th`,{scope:`col`},`Mais lenta`),a(`th`,{scope:`col`},`Divergência`)])],-1),a(`tbody`,null,[(f(!0),l(s,null,i(Y.value.items,n=>(f(),l(`tr`,{key:`${n.problem_id}:${n.language_id}`,class:t({"feature-error":n.divergence>=Y.value.threshold})},[a(`td`,null,e(n.problem??`—`),1),a(`td`,null,e(n.language??`—`),1),a(`td`,null,e(n.samples),1),a(`td`,null,e((n.fastest_ms/1e3).toFixed(2))+` s`,1),a(`td`,null,e((n.slowest_ms/1e3).toFixed(2))+` s`,1),a(`td`,null,[c(e(n.divergence.toFixed(2))+`× `,1),n.divergence>=Y.value.threshold?(f(),l(`span`,L,` acima do limiar `)):o(``,!0)])],2))),128))])])):(f(),l(`div`,N,[u[26]||=a(`h3`,null,`Ainda não há o que comparar`,-1),u[27]||=a(`p`,null,[c(` Uma comparação precisa do mesmo problema e linguagem julgados em `),a(`strong`,null,`duas máquinas diferentes`),c(`, com veredito aceito. Enquanto isso não acontecer, não há medição — o que `),a(`em`,null,`não`),c(` quer dizer que as máquinas sejam equivalentes. `)],-1),Y.value.coverage?(f(),l(`p`,P,[u[23]||=c(` Nesta prova: `,-1),a(`strong`,null,e(Y.value.coverage.accepted),1),c(` `+e(Y.value.coverage.accepted===1?`envio aceito`:`envios aceitos`)+`, `,1),a(`strong`,null,e(Y.value.coverage.measured),1),u[24]||=c(` com medição de tempo, em `,-1),a(`strong`,null,e(Y.value.coverage.hosts_measured),1),c(` `+e(Y.value.coverage.hosts_measured===1?`máquina`:`máquinas`)+`. `,1)])):o(``,!0),be.value?(f(),l(`p`,F,[...u[25]||=[c(` Há envios aceitos e `,-1),a(`strong`,null,`nenhum`,-1),c(` com medição de tempo. Isso não é ausência de divergência — é ausência de dado, e impede a comparação. Verifique se as máquinas que julgaram estão reportando os tempos medidos. `,-1)]])):o(``,!0)])),Y.value.items?.length?(f(),l(`p`,me,` Acima de `+e(Y.value.threshold)+`× o mesmo limite de tempo começa a significar coisas diferentes em máquinas diferentes, e a equipe passa a receber TLE ou AC conforme a máquina que pegou o envio. A mediana é usada para que um engasgo isolado não decida o julgamento sobre uma máquina. `,1)):o(``,!0),Y.value.items?.length?(f(),l(`details`,R,[u[30]||=a(`summary`,null,`Tempo por máquina`,-1),a(`ul`,z,[(f(!0),l(s,null,i(Y.value.items,t=>(f(),l(`li`,{key:`d-${t.problem_id}:${t.language_id}`},[c(e(t.problem??`—`)+` / `+e(t.language??`—`)+`: `,1),(f(!0),l(s,null,i(t.per_host,t=>(f(),l(s,{key:t.judgehost_id},[c(e(Se(t.judgehost_id))+` `+e((t.median_cpu_ms/1e3).toFixed(2))+` s · `,1)],64))),128))]))),128))])])):o(``,!0)],64)):(f(),l(`p`,he,`Carregando comparação…`))])],64)):o(``,!0)]))}};export{ge as default}; \ No newline at end of file diff --git a/public/build/assets/JudgingHealth-BFLke4Uw.js b/public/build/assets/JudgingHealth-BFLke4Uw.js new file mode 100644 index 00000000..b5ffd6fa --- /dev/null +++ b/public/build/assets/JudgingHealth-BFLke4Uw.js @@ -0,0 +1 @@ +import{D as e,E as t,S as n,T as r,a as i,b as a,c as o,d as s,f as c,h as l,l as u,m as d,p as f,w as p,x as m,y as h}from"./app-B8gaJnTP.js";import{i as g,n as _,r as v,t as y}from"./FeatureState-DoiXEL_p.js";import{t as b}from"./FeaturePager-DkN6l5V8.js";var x={class:`feature-stack`},S={class:`feature-message`},C={class:`feature-help`},w={class:`feature-metrics`},T={class:`surface stat-card`},E={class:`surface stat-card`},D={class:`surface stat-card`},O={class:`surface stat-card`},k={class:`surface feature-panel`},A=[`value`],j=[`disabled`],M=[`disabled`],N={class:`feature-help`},P={key:0,class:`feature-empty`},F={class:`feature-heading`},I={class:`feature-help`},L={class:`feature-details`},R={key:0},z=[`href`],B={__name:`JudgingHealth`,setup(B){let{data:V,loading:H,error:U,query:W,load:G,filter:K}=_(`/api/frontend/judging-health`),q=p(W.status||``),J={overdue:`Atrasada`,retrying:`Retentativa em andamento`,recovered:`Recuperada`,failed:`Erro no julgamento`,pending:`Aguardando`,judging:`Em avaliação`};return m(()=>W.status,e=>{q.value=e||``}),(p,m)=>(h(),f(`div`,x,[l(y,{loading:r(H),error:r(U),stale:!!r(V),onRetry:m[0]||=e=>r(G)()},null,8,[`loading`,`error`,`stale`]),r(V)?(h(),f(u,{key:0},[s(`div`,S,[s(`strong`,null,e(r(V).watchdog?.enabled?`Recuperação automática ativa.`:`Recuperação automática indisponível.`),1),d(` `+e(r(V).watchdog?.enabled?`Envios sem atividade podem receber uma nova tentativa. O limite é uma retentativa por envio.`:`Acompanhe os envios pendentes com a organização.`),1),s(`p`,C,`Última verificação: `+e(r(v)(r(V).watchdog?.last_checked_at)),1)]),s(`dl`,w,[s(`div`,T,[m[5]||=s(`dt`,null,`Atrasadas`,-1),s(`dd`,null,e(r(V).summary?.overdue??`—`),1)]),s(`div`,E,[m[6]||=s(`dt`,null,`Em retentativa`,-1),s(`dd`,null,e(r(V).summary?.retrying??`—`),1)]),s(`div`,D,[m[7]||=s(`dt`,null,`Recuperadas`,-1),s(`dd`,null,e(r(V).summary?.recovered??`—`),1)]),s(`div`,O,[m[8]||=s(`dt`,null,`Erros no julgamento`,-1),s(`dd`,null,e(r(V).summary?.failed??`—`),1)])]),s(`section`,k,[s(`form`,{class:`feature-search`,onSubmit:m[3]||=o(e=>r(K)({status:q.value,page:1}),[`prevent`])},[s(`label`,null,[m[10]||=d(`Situação`,-1),n(s(`select`,{"onUpdate:modelValue":m[1]||=e=>q.value=e,name:`status`},[m[9]||=s(`option`,{value:``},`Todas`,-1),(h(),f(u,null,a(J,(t,n)=>s(`option`,{key:n,value:n},e(t),9,A)),64))],512),[[i,q.value]])]),s(`button`,{class:`button-primary`,disabled:r(H)},`Aplicar filtro`,8,j),s(`button`,{type:`button`,class:`button-secondary`,disabled:r(H),onClick:m[2]||=e=>r(G)()},`Atualizar`,8,M)],32),s(`p`,N,`Atualizado em `+e(r(v)(r(V).generated_at))+`. Os totais representam os envios do escopo autorizado.`,1),r(V).items?.length?c(``,!0):(h(),f(`div`,P,[...m[11]||=[s(`h2`,null,`Nenhum envio nesta situação`,-1),s(`p`,null,`Novos eventos aparecerão aqui após a próxima atualização.`,-1)]])),(h(!0),f(u,null,a(r(V).items,n=>(h(),f(`article`,{key:n.id,class:`feature-record`},[s(`div`,F,[s(`h2`,null,`Envio #`+e(n.id)+` · `+e(n.problem_name),1),s(`span`,{class:t([`feature-badge`,{"feature-error":n.recovery_status===`failed`,"feature-success":n.recovery_status===`recovered`}])},e(J[n.recovery_status]||`Estado desconhecido`),3)]),s(`p`,I,e(n.team_name)+` · `+e(n.site_name)+` · Limite de espera: `+e(n.max_wait_seconds)+` s`,1),s(`dl`,L,[s(`div`,null,[m[12]||=s(`dt`,null,`Última atividade`,-1),s(`dd`,null,e(r(v)(n.last_activity_at)),1)]),s(`div`,null,[m[13]||=s(`dt`,null,`Retentativas`,-1),s(`dd`,null,e(n.retry_count)+` de 1`,1)]),s(`div`,null,[m[14]||=s(`dt`,null,`Próxima verificação`,-1),s(`dd`,null,e(r(v)(n.next_check_at)),1)])]),n.message?(h(),f(`p`,R,e(n.message),1)):c(``,!0),r(g)(n.detail_url)?(h(),f(`a`,{key:1,href:r(g)(n.detail_url),class:`button-secondary`},`Ver envio #`+e(n.id),9,z)):c(``,!0)]))),128)),l(b,{meta:r(V).meta,loading:r(H),onPage:m[4]||=e=>r(K)({page:e})},null,8,[`meta`,`loading`])])],64)):c(``,!0)]))}};export{B as default}; \ No newline at end of file diff --git a/public/build/assets/JudgingHealth-DJhJbX3n.js b/public/build/assets/JudgingHealth-DJhJbX3n.js deleted file mode 100644 index e278375b..00000000 --- a/public/build/assets/JudgingHealth-DJhJbX3n.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,b as i,d as a,f as o,i as s,l as c,o as l,p as u,s as d,u as f,v as p,w as m,y as h}from"./app-DKg3nD5E.js";import{i as g,n as _,r as v,t as y}from"./FeatureState-Ceer7rtj.js";import{t as b}from"./FeaturePager-BA0LLbT3.js";var x={class:`feature-stack`},S={class:`feature-message`},C={class:`feature-help`},w={class:`feature-metrics`},T={class:`surface stat-card`},E={class:`surface stat-card`},D={class:`surface stat-card`},O={class:`surface stat-card`},k={class:`surface feature-panel`},A=[`value`],j=[`disabled`],M=[`disabled`],N={class:`feature-help`},P={key:0,class:`feature-empty`},F={class:`feature-heading`},I={class:`feature-help`},L={class:`feature-details`},R={key:0},z=[`href`],B={__name:`JudgingHealth`,setup(B){let{data:V,loading:H,error:U,query:W,load:G,filter:K}=_(`/api/frontend/judging-health`),q=t(W.status||``),J={overdue:`Atrasada`,retrying:`Retentativa em andamento`,recovered:`Recuperada`,failed:`Erro no julgamento`,pending:`Aguardando`,judging:`Em avaliação`};return h(()=>W.status,e=>{q.value=e||``}),(t,h)=>(r(),a(`div`,x,[u(y,{loading:e(H),error:e(U),stale:!!e(V),onRetry:h[0]||=t=>e(G)()},null,8,[`loading`,`error`,`stale`]),e(V)?(r(),a(d,{key:0},[c(`div`,S,[c(`strong`,null,n(e(V).watchdog?.enabled?`Recuperação automática ativa.`:`Recuperação automática indisponível.`),1),o(` `+n(e(V).watchdog?.enabled?`Envios sem atividade podem receber uma nova tentativa. O limite é uma retentativa por envio.`:`Acompanhe os envios pendentes com a organização.`),1),c(`p`,C,`Última verificação: `+n(e(v)(e(V).watchdog?.last_checked_at)),1)]),c(`dl`,w,[c(`div`,T,[h[5]||=c(`dt`,null,`Atrasadas`,-1),c(`dd`,null,n(e(V).summary?.overdue??`—`),1)]),c(`div`,E,[h[6]||=c(`dt`,null,`Em retentativa`,-1),c(`dd`,null,n(e(V).summary?.retrying??`—`),1)]),c(`div`,D,[h[7]||=c(`dt`,null,`Recuperadas`,-1),c(`dd`,null,n(e(V).summary?.recovered??`—`),1)]),c(`div`,O,[h[8]||=c(`dt`,null,`Erros no julgamento`,-1),c(`dd`,null,n(e(V).summary?.failed??`—`),1)])]),c(`section`,k,[c(`form`,{class:`feature-search`,onSubmit:h[3]||=l(t=>e(K)({status:q.value,page:1}),[`prevent`])},[c(`label`,null,[h[10]||=o(`Situação`,-1),i(c(`select`,{"onUpdate:modelValue":h[1]||=e=>q.value=e,name:`status`},[h[9]||=c(`option`,{value:``},`Todas`,-1),(r(),a(d,null,p(J,(e,t)=>c(`option`,{key:t,value:t},n(e),9,A)),64))],512),[[s,q.value]])]),c(`button`,{class:`button-primary`,disabled:e(H)},`Aplicar filtro`,8,j),c(`button`,{type:`button`,class:`button-secondary`,disabled:e(H),onClick:h[2]||=t=>e(G)()},`Atualizar`,8,M)],32),c(`p`,N,`Atualizado em `+n(e(v)(e(V).generated_at))+`. Os totais representam os envios do escopo autorizado.`,1),e(V).items?.length?f(``,!0):(r(),a(`div`,P,[...h[11]||=[c(`h2`,null,`Nenhum envio nesta situação`,-1),c(`p`,null,`Novos eventos aparecerão aqui após a próxima atualização.`,-1)]])),(r(!0),a(d,null,p(e(V).items,t=>(r(),a(`article`,{key:t.id,class:`feature-record`},[c(`div`,F,[c(`h2`,null,`Envio #`+n(t.id)+` · `+n(t.problem_name),1),c(`span`,{class:m([`feature-badge`,{"feature-error":t.recovery_status===`failed`,"feature-success":t.recovery_status===`recovered`}])},n(J[t.recovery_status]||`Estado desconhecido`),3)]),c(`p`,I,n(t.team_name)+` · `+n(t.site_name)+` · Limite de espera: `+n(t.max_wait_seconds)+` s`,1),c(`dl`,L,[c(`div`,null,[h[12]||=c(`dt`,null,`Última atividade`,-1),c(`dd`,null,n(e(v)(t.last_activity_at)),1)]),c(`div`,null,[h[13]||=c(`dt`,null,`Retentativas`,-1),c(`dd`,null,n(t.retry_count)+` de 1`,1)]),c(`div`,null,[h[14]||=c(`dt`,null,`Próxima verificação`,-1),c(`dd`,null,n(e(v)(t.next_check_at)),1)])]),t.message?(r(),a(`p`,R,n(t.message),1)):f(``,!0),e(g)(t.detail_url)?(r(),a(`a`,{key:1,href:e(g)(t.detail_url),class:`button-secondary`},`Ver envio #`+n(t.id),9,z)):f(``,!0)]))),128)),u(b,{meta:e(V).meta,loading:e(H),onPage:h[4]||=t=>e(K)({page:t})},null,8,[`meta`,`loading`])])],64)):f(``,!0)]))}};export{B as default}; \ No newline at end of file diff --git a/public/build/assets/ManagedAccounts-BttOxjSP.js b/public/build/assets/ManagedAccounts-BttOxjSP.js new file mode 100644 index 00000000..f298d7e8 --- /dev/null +++ b/public/build/assets/ManagedAccounts-BttOxjSP.js @@ -0,0 +1 @@ +import{D as e,S as t,T as n,a as r,b as i,c as a,d as o,f as s,h as c,l,m as u,o as d,p as f,w as p,x as m,y as h}from"./app-B8gaJnTP.js";import{i as g,n as _,t as v}from"./FeatureState-DoiXEL_p.js";import{t as y}from"./FeaturePager-DkN6l5V8.js";import{t as b}from"./FieldError-DRbrcIPQ.js";var ee={class:`feature-stack`},x={key:0,class:`feature-message feature-success`},te={class:`feature-secret`},ne=[`value`],re={key:0,class:`surface feature-panel`},ie=[`disabled`,`aria-invalid`],ae=[`disabled`,`aria-invalid`],S=[`disabled`,`aria-invalid`],C=[`disabled`,`aria-invalid`],w=[`value`],T=[`disabled`,`aria-invalid`],E=[`value`],D={class:`feature-actions feature-wide`},O=[`disabled`],k={class:`surface feature-panel`},A=[`disabled`],j={key:0,class:`feature-empty`},M={class:`feature-heading`},N={class:`feature-badge`},P={class:`feature-help`},F={class:`feature-details`},I={__name:`ManagedAccounts`,setup(I){let{data:L,loading:R,error:z,busy:B,notice:V,actionError:H,load:U,filter:W,act:G,query:K}=_(`/api/frontend/managed-accounts`),q=p(null),J=p(K.q||``),Y=p(``),X=p(``),Z=p(``),Q=p(``),$=p(``);async function oe(e){q.value=null;let t=await G(`/api/frontend/managed-accounts`,{fullname:Y.value,username:X.value,birthdate:Z.value||null,contest_id:Q.value,site_id:$.value},`Conta gerenciada criada. A organização deve entregar o acesso pelo canal institucional.`,`POST`,e.target);t&&(q.value=g(t.activation_url)?new URL(t.activation_url,location.origin).href:null,Y.value=``,X.value=``,Z.value=``,await U())}return m(()=>K.q,e=>{J.value=e||``}),(p,m)=>(h(),f(`div`,ee,[m[28]||=o(`div`,{class:`feature-message`},[o(`strong`,null,`Privacidade desde o cadastro.`),u(` Contas gerenciadas começam privadas. Datas de nascimento ficam restritas à administração; não aparecem na biblioteca nem no histórico público.`)],-1),c(v,{loading:n(R),error:n(z),stale:!!n(L),busy:n(B),notice:n(V),"action-error":n(H),onRetry:m[0]||=e=>n(U)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),q.value?(h(),f(`div`,x,[o(`label`,te,[m[12]||=u(`Link de ativação da conta`,-1),o(`input`,{value:q.value,readonly:``,autocomplete:`off`,onFocus:m[1]||=e=>e.target.select()},null,40,ne)]),m[13]||=o(`p`,null,`Entregue este link apenas ao participante pelo canal institucional. Ele é de uso único.`,-1),o(`button`,{type:`button`,class:`button-secondary`,onClick:m[2]||=e=>q.value=null},`Já entreguei, ocultar link`)])):s(``,!0),n(L)?(h(),f(l,{key:1},[n(L).capabilities?.can_create?(h(),f(`section`,re,[m[22]||=o(`h2`,null,`Criar conta gerenciada`,-1),m[23]||=o(`p`,{class:`feature-help`},`Use os dados fornecidos à organização. Não é necessário vincular uma conta externa.`,-1),o(`form`,{class:`feature-form`,onSubmit:a(oe,[`prevent`])},[o(`label`,null,[m[14]||=u(`Nome completo`,-1),t(o(`input`,{"onUpdate:modelValue":m[3]||=e=>Y.value=e,name:`fullname`,required:``,maxlength:`255`,autocomplete:`off`,disabled:n(B),"aria-invalid":!!n(H)?.errors?.fullname,"aria-describedby":`fullname-error`},null,8,ie),[[d,Y.value]]),c(b,{error:n(H),name:`fullname`},null,8,[`error`])]),o(`label`,null,[m[15]||=u(`Nome de usuário`,-1),t(o(`input`,{"onUpdate:modelValue":m[4]||=e=>X.value=e,name:`username`,required:``,maxlength:`80`,autocomplete:`off`,autocapitalize:`none`,spellcheck:`false`,disabled:n(B),"aria-invalid":!!n(H)?.errors?.username,"aria-describedby":`username-error`},null,8,ae),[[d,X.value]]),c(b,{error:n(H),name:`username`},null,8,[`error`])]),o(`label`,null,[m[16]||=u(`Data de nascimento (opcional)`,-1),t(o(`input`,{"onUpdate:modelValue":m[5]||=e=>Z.value=e,name:`birthdate`,type:`date`,disabled:n(B),"aria-invalid":!!n(H)?.errors?.birthdate,"aria-describedby":`birthdate-help birthdate-error`},null,8,S),[[d,Z.value]]),m[17]||=o(`small`,{id:`birthdate-help`},`Sem data informada, a conta permanece privada até revisão da organização.`,-1),c(b,{error:n(H),name:`birthdate`},null,8,[`error`])]),o(`label`,null,[m[19]||=u(`Competição`,-1),t(o(`select`,{"onUpdate:modelValue":m[6]||=e=>Q.value=e,name:`contest_id`,required:``,disabled:n(B),onChange:m[7]||=e=>$.value=``,"aria-invalid":!!n(H)?.errors?.contest_id,"aria-describedby":`contest_id-error`},[m[18]||=o(`option`,{value:``},`Selecione a competição`,-1),(h(!0),f(l,null,i(n(L).contests,t=>(h(),f(`option`,{key:t.id,value:t.id},e(t.name),9,w))),128))],40,C),[[r,Q.value]]),c(b,{error:n(H),name:`contest_id`},null,8,[`error`])]),o(`label`,null,[m[21]||=u(`Local de participação`,-1),t(o(`select`,{"onUpdate:modelValue":m[8]||=e=>$.value=e,name:`site_id`,required:``,disabled:n(B)||!Q.value,"aria-invalid":!!n(H)?.errors?.site_id,"aria-describedby":`site_id-error`},[m[20]||=o(`option`,{value:``},`Selecione o local`,-1),(h(!0),f(l,null,i(n(L).contests.find(e=>String(e.id)===String(Q.value))?.sites||[],t=>(h(),f(`option`,{key:t.id,value:t.id},e(t.name),9,E))),128))],8,T),[[r,$.value]]),c(b,{error:n(H),name:`site_id`},null,8,[`error`])]),o(`div`,D,[o(`button`,{class:`button-primary`,disabled:n(B)||n(R)},`Criar conta privada`,8,O)])],32)])):s(``,!0),o(`section`,k,[m[27]||=o(`h2`,null,`Contas e restrições`,-1),o(`form`,{class:`feature-search`,role:`search`,onSubmit:m[10]||=a(e=>n(W)({q:J.value,page:1}),[`prevent`])},[o(`label`,null,[m[24]||=u(`Buscar por nome ou usuário`,-1),t(o(`input`,{"onUpdate:modelValue":m[9]||=e=>J.value=e,name:`q`,type:`search`,maxlength:`100`},null,512),[[d,J.value]])]),o(`button`,{class:`button-secondary`,disabled:n(B)||n(R)},`Buscar contas`,8,A)],32),n(L).items?.length?s(``,!0):(h(),f(`p`,j,`Nenhuma conta gerenciada encontrada.`)),(h(!0),f(l,null,i(n(L).items,t=>(h(),f(`article`,{key:t.id,class:`feature-record`},[o(`div`,M,[o(`h3`,null,e(t.fullname),1),o(`span`,N,e(t.privacy_locked?`Privacidade protegida`:`Restrição etária liberada`),1)]),o(`p`,P,e(t.username)+` · `+e(t.contest_name)+` · `+e(t.site_name),1),o(`dl`,F,[o(`div`,null,[m[25]||=o(`dt`,null,`Visibilidade`,-1),o(`dd`,null,e(t.visibility===`public`?`Pública`:`Privada`),1)]),o(`div`,null,[m[26]||=o(`dt`,null,`Contas externas`,-1),o(`dd`,null,e(t.external_linking_allowed?`Vinculação permitida`:`Vinculação bloqueada`),1)])]),o(`p`,null,e(t.privacy_reason),1)]))),128)),c(y,{meta:n(L).meta,loading:n(R)||n(B),onPage:m[11]||=e=>n(W)({page:e})},null,8,[`meta`,`loading`])])],64)):s(``,!0)]))}};export{I as default}; \ No newline at end of file diff --git a/public/build/assets/ManagedAccounts-Dld1r1cH.js b/public/build/assets/ManagedAccounts-Dld1r1cH.js deleted file mode 100644 index b40096f0..00000000 --- a/public/build/assets/ManagedAccounts-Dld1r1cH.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,a as i,b as a,d as o,f as s,i as c,l,o as u,p as d,s as f,u as p,v as m,y as h}from"./app-DKg3nD5E.js";import{i as g,n as _,t as v}from"./FeatureState-Ceer7rtj.js";import{t as y}from"./FeaturePager-BA0LLbT3.js";import{t as b}from"./FieldError-P7Uk3ge_.js";var ee={class:`feature-stack`},x={key:0,class:`feature-message feature-success`},te={class:`feature-secret`},ne=[`value`],re={key:0,class:`surface feature-panel`},ie=[`disabled`,`aria-invalid`],ae=[`disabled`,`aria-invalid`],S=[`disabled`,`aria-invalid`],C=[`disabled`,`aria-invalid`],w=[`value`],T=[`disabled`,`aria-invalid`],E=[`value`],D={class:`feature-actions feature-wide`},O=[`disabled`],k={class:`surface feature-panel`},A=[`disabled`],j={key:0,class:`feature-empty`},M={class:`feature-heading`},N={class:`feature-badge`},P={class:`feature-help`},F={class:`feature-details`},I={__name:`ManagedAccounts`,setup(I){let{data:L,loading:R,error:z,busy:B,notice:V,actionError:H,load:U,filter:W,act:G,query:K}=_(`/api/frontend/managed-accounts`),q=t(null),J=t(K.q||``),Y=t(``),X=t(``),Z=t(``),Q=t(``),$=t(``);async function oe(e){q.value=null;let t=await G(`/api/frontend/managed-accounts`,{fullname:Y.value,username:X.value,birthdate:Z.value||null,contest_id:Q.value,site_id:$.value},`Conta gerenciada criada. A organização deve entregar o acesso pelo canal institucional.`,`POST`,e.target);t&&(q.value=g(t.activation_url)?new URL(t.activation_url,location.origin).href:null,Y.value=``,X.value=``,Z.value=``,await U())}return h(()=>K.q,e=>{J.value=e||``}),(t,h)=>(r(),o(`div`,ee,[h[28]||=l(`div`,{class:`feature-message`},[l(`strong`,null,`Privacidade desde o cadastro.`),s(` Contas gerenciadas começam privadas. Datas de nascimento ficam restritas à administração; não aparecem na biblioteca nem no histórico público.`)],-1),d(v,{loading:e(R),error:e(z),stale:!!e(L),busy:e(B),notice:e(V),"action-error":e(H),onRetry:h[0]||=t=>e(U)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),q.value?(r(),o(`div`,x,[l(`label`,te,[h[12]||=s(`Link de ativação da conta`,-1),l(`input`,{value:q.value,readonly:``,autocomplete:`off`,onFocus:h[1]||=e=>e.target.select()},null,40,ne)]),h[13]||=l(`p`,null,`Entregue este link apenas ao participante pelo canal institucional. Ele é de uso único.`,-1),l(`button`,{type:`button`,class:`button-secondary`,onClick:h[2]||=e=>q.value=null},`Já entreguei, ocultar link`)])):p(``,!0),e(L)?(r(),o(f,{key:1},[e(L).capabilities?.can_create?(r(),o(`section`,re,[h[22]||=l(`h2`,null,`Criar conta gerenciada`,-1),h[23]||=l(`p`,{class:`feature-help`},`Use os dados fornecidos à organização. Não é necessário vincular uma conta externa.`,-1),l(`form`,{class:`feature-form`,onSubmit:u(oe,[`prevent`])},[l(`label`,null,[h[14]||=s(`Nome completo`,-1),a(l(`input`,{"onUpdate:modelValue":h[3]||=e=>Y.value=e,name:`fullname`,required:``,maxlength:`255`,autocomplete:`off`,disabled:e(B),"aria-invalid":!!e(H)?.errors?.fullname,"aria-describedby":`fullname-error`},null,8,ie),[[i,Y.value]]),d(b,{error:e(H),name:`fullname`},null,8,[`error`])]),l(`label`,null,[h[15]||=s(`Nome de usuário`,-1),a(l(`input`,{"onUpdate:modelValue":h[4]||=e=>X.value=e,name:`username`,required:``,maxlength:`80`,autocomplete:`off`,autocapitalize:`none`,spellcheck:`false`,disabled:e(B),"aria-invalid":!!e(H)?.errors?.username,"aria-describedby":`username-error`},null,8,ae),[[i,X.value]]),d(b,{error:e(H),name:`username`},null,8,[`error`])]),l(`label`,null,[h[16]||=s(`Data de nascimento (opcional)`,-1),a(l(`input`,{"onUpdate:modelValue":h[5]||=e=>Z.value=e,name:`birthdate`,type:`date`,disabled:e(B),"aria-invalid":!!e(H)?.errors?.birthdate,"aria-describedby":`birthdate-help birthdate-error`},null,8,S),[[i,Z.value]]),h[17]||=l(`small`,{id:`birthdate-help`},`Sem data informada, a conta permanece privada até revisão da organização.`,-1),d(b,{error:e(H),name:`birthdate`},null,8,[`error`])]),l(`label`,null,[h[19]||=s(`Competição`,-1),a(l(`select`,{"onUpdate:modelValue":h[6]||=e=>Q.value=e,name:`contest_id`,required:``,disabled:e(B),onChange:h[7]||=e=>$.value=``,"aria-invalid":!!e(H)?.errors?.contest_id,"aria-describedby":`contest_id-error`},[h[18]||=l(`option`,{value:``},`Selecione a competição`,-1),(r(!0),o(f,null,m(e(L).contests,e=>(r(),o(`option`,{key:e.id,value:e.id},n(e.name),9,w))),128))],40,C),[[c,Q.value]]),d(b,{error:e(H),name:`contest_id`},null,8,[`error`])]),l(`label`,null,[h[21]||=s(`Local de participação`,-1),a(l(`select`,{"onUpdate:modelValue":h[8]||=e=>$.value=e,name:`site_id`,required:``,disabled:e(B)||!Q.value,"aria-invalid":!!e(H)?.errors?.site_id,"aria-describedby":`site_id-error`},[h[20]||=l(`option`,{value:``},`Selecione o local`,-1),(r(!0),o(f,null,m(e(L).contests.find(e=>String(e.id)===String(Q.value))?.sites||[],e=>(r(),o(`option`,{key:e.id,value:e.id},n(e.name),9,E))),128))],8,T),[[c,$.value]]),d(b,{error:e(H),name:`site_id`},null,8,[`error`])]),l(`div`,D,[l(`button`,{class:`button-primary`,disabled:e(B)||e(R)},`Criar conta privada`,8,O)])],32)])):p(``,!0),l(`section`,k,[h[27]||=l(`h2`,null,`Contas e restrições`,-1),l(`form`,{class:`feature-search`,role:`search`,onSubmit:h[10]||=u(t=>e(W)({q:J.value,page:1}),[`prevent`])},[l(`label`,null,[h[24]||=s(`Buscar por nome ou usuário`,-1),a(l(`input`,{"onUpdate:modelValue":h[9]||=e=>J.value=e,name:`q`,type:`search`,maxlength:`100`},null,512),[[i,J.value]])]),l(`button`,{class:`button-secondary`,disabled:e(B)||e(R)},`Buscar contas`,8,A)],32),e(L).items?.length?p(``,!0):(r(),o(`p`,j,`Nenhuma conta gerenciada encontrada.`)),(r(!0),o(f,null,m(e(L).items,e=>(r(),o(`article`,{key:e.id,class:`feature-record`},[l(`div`,M,[l(`h3`,null,n(e.fullname),1),l(`span`,N,n(e.privacy_locked?`Privacidade protegida`:`Restrição etária liberada`),1)]),l(`p`,P,n(e.username)+` · `+n(e.contest_name)+` · `+n(e.site_name),1),l(`dl`,F,[l(`div`,null,[h[25]||=l(`dt`,null,`Visibilidade`,-1),l(`dd`,null,n(e.visibility===`public`?`Pública`:`Privada`),1)]),l(`div`,null,[h[26]||=l(`dt`,null,`Contas externas`,-1),l(`dd`,null,n(e.external_linking_allowed?`Vinculação permitida`:`Vinculação bloqueada`),1)])]),l(`p`,null,n(e.privacy_reason),1)]))),128)),d(y,{meta:e(L).meta,loading:e(R)||e(B),onPage:h[11]||=t=>e(W)({page:t})},null,8,[`meta`,`loading`])])],64)):p(``,!0)]))}};export{I as default}; \ No newline at end of file diff --git a/public/build/assets/Organizations-DEXUy4yp.js b/public/build/assets/Organizations-DEXUy4yp.js deleted file mode 100644 index f3b05fbd..00000000 --- a/public/build/assets/Organizations-DEXUy4yp.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as c,l,o as u,p as d,s as f,u as p,v as m}from"./app-DKg3nD5E.js";import{n as ee,t as h}from"./FeatureState-Ceer7rtj.js";import{t as g}from"./FieldError-P7Uk3ge_.js";var _={class:`feature-stack`},te={class:`feature-metrics`},ne={class:`surface stat-card`},re={class:`surface stat-card`},ie={class:`surface stat-card`},ae={class:`feature-field`},oe=[`disabled`],se={key:0,class:`surface feature-empty`},ce={key:1,class:`feature-list`},le={class:`feature-row-head`},ue={key:0,class:`feature-badge`},de={class:`feature-hint`},fe=[`onSubmit`],pe=[`for`],me=[`id`],v=[`disabled`],y=[`aria-label`],b={class:`feature-hint`},x=[`disabled`,`onClick`],S={key:2,class:`feature-row-actions`},C=[`onClick`],w=[`onClick`],T=[`disabled`,`onClick`],E={class:`feature-details`},D={key:0,class:`feature-hint`},O={key:1,class:`feature-sublist`},k={key:0,class:`feature-confirm-inline`},A=[`disabled`,`onClick`],j=[`onClick`],M={class:`sr-only`},N=[`onSubmit`],P=[`for`],F=[`id`],I=[`disabled`],L=[`onClick`],he={__name:`Organizations`,setup(he){let{data:R,loading:ge,error:_e,busy:z,notice:ve,actionError:B,load:V,act:H}=ee(`/api/frontend/organizations`),U=t(``),W=t(null),G=t(null),K=t(``),q=t(null),J=t(null),Y=t(``),X=t(null),Z=t(null),Q=o(()=>R.value?.organizations??[]),ye=o(()=>Q.value.filter(e=>!e.archived).length),be=o(()=>Q.value.filter(e=>e.archived).length);async function xe(){await H(`/api/frontend/organizations`,{name:U.value},`Organização criada.`,`POST`,W.value)&&(U.value=``,await V())}async function Se(e){await H(`/api/frontend/organizations/${e.id}`,{name:K.value},`Nome atualizado.`,`PATCH`)&&(G.value=null,K.value=``,await V())}async function $(e,t){await H(`/api/frontend/organizations/${e.id}`,{archived:t},t?`Organização arquivada.`:`Organização reaberta.`,`PATCH`)&&(q.value=null,await V())}async function Ce(e){await H(`/api/frontend/organizations/${e.id}/members`,{user_id:Number(Y.value)},`Membro adicionado.`,`POST`,X.value)&&(J.value=null,Y.value=``,await V())}async function we(e,t){await H(`/api/frontend/organizations/${e.id}/members/${t.user_id}`,null,`Membro removido.`,`DELETE`)&&(Z.value=null,await V())}return(t,o)=>(r(),s(`div`,_,[d(h,{loading:e(ge),error:e(_e),stale:!!e(R),busy:e(z),notice:e(ve),"action-error":e(B),onRetry:o[0]||=t=>e(V)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),e(R)?(r(),s(f,{key:0},[l(`dl`,te,[l(`div`,ne,[o[8]||=l(`dt`,null,`Organizações`,-1),l(`dd`,null,n(Q.value.length),1)]),l(`div`,re,[o[9]||=l(`dt`,null,`Ativas`,-1),l(`dd`,null,n(ye.value),1)]),l(`div`,ie,[o[10]||=l(`dt`,null,`Arquivadas`,-1),l(`dd`,null,n(be.value),1)])]),l(`form`,{ref_key:`formCriar`,ref:W,class:`surface feature-form`,onSubmit:u(xe,[`prevent`])},[o[12]||=l(`h2`,null,`Nova organização`,-1),o[13]||=l(`p`,{class:`feature-hint`},[c(` Uma organização é a instituição dona de problemas no banco. Quem for `),l(`strong`,null,`editor`),c(` dela pode editar os problemas dela. `)],-1),l(`div`,ae,[o[11]||=l(`label`,{for:`org-nome`},`Nome`,-1),a(l(`input`,{id:`org-nome`,"onUpdate:modelValue":o[1]||=e=>U.value=e,name:`name`,type:`text`,maxlength:`120`,required:``,autocomplete:`organization`},null,512),[[i,U.value]]),d(g,{errors:e(B)?.errors,field:`name`},null,8,[`errors`])]),l(`button`,{type:`submit`,class:`button-primary`,disabled:e(z)||!U.value.trim()},`Criar organização`,8,oe)],544),Q.value.length?(r(),s(`ul`,ce,[(r(!0),s(f,null,m(Q.value,t=>(r(),s(`li`,{key:t.id,class:`surface feature-row`},[l(`div`,le,[l(`h3`,null,[c(n(t.name)+` `,1),t.archived?(r(),s(`span`,ue,`Arquivada`)):p(``,!0)]),l(`p`,de,n(t.problem_count)+` problema(s) no banco · `+n(t.members.length)+` membro(s) `,1)]),G.value===t.id?(r(),s(`form`,{key:0,class:`feature-inline-form`,onSubmit:u(e=>Se(t),[`prevent`])},[l(`label`,{for:`renomear-${t.id}`,class:`sr-only`},`Novo nome de `+n(t.name),9,pe),a(l(`input`,{id:`renomear-${t.id}`,"onUpdate:modelValue":o[2]||=e=>K.value=e,name:`name`,type:`text`,maxlength:`120`,required:``},null,8,me),[[i,K.value]]),l(`button`,{type:`submit`,class:`button-primary`,disabled:e(z)},`Salvar`,8,v),l(`button`,{type:`button`,class:`button-secondary`,onClick:o[3]||=e=>G.value=null},`Cancelar`),d(g,{errors:e(B)?.errors,field:`name`},null,8,[`errors`])],40,fe)):q.value===t.id?(r(),s(`div`,{key:1,class:`feature-confirm`,role:`group`,"aria-label":`Confirmar arquivamento de ${t.name}`},[l(`p`,null,[o[15]||=c(` Arquivar `,-1),l(`strong`,null,n(t.name),1),o[16]||=c(` tira ela do seletor de proprietário: nenhum problema novo poderá ser atribuído a ela. `,-1)]),l(`p`,b,` Os `+n(t.problem_count)+` problema(s) dela continuam sendo dela, e os membros continuam podendo editá-los. Dá para reabrir depois. `,1),l(`button`,{type:`button`,class:`button-primary`,disabled:e(z),onClick:e=>$(t,!0)},`Arquivar`,8,x),l(`button`,{type:`button`,class:`button-secondary`,onClick:o[4]||=e=>q.value=null},`Cancelar`)],8,y)):(r(),s(`div`,S,[l(`button`,{type:`button`,class:`button-secondary`,onClick:e=>{G.value=t.id,K.value=t.name}},`Renomear`,8,C),t.archived?(r(),s(`button`,{key:1,type:`button`,class:`button-secondary`,disabled:e(z),onClick:e=>$(t,!1)},`Reabrir`,8,T)):(r(),s(`button`,{key:0,type:`button`,class:`button-secondary`,onClick:e=>q.value=t.id},`Arquivar`,8,w))])),l(`details`,E,[l(`summary`,null,`Membros (`+n(t.members.length)+`)`,1),t.members.length?(r(),s(`ul`,O,[(r(!0),s(f,null,m(t.members,i=>(r(),s(`li`,{key:i.user_id},[l(`span`,null,[c(n(i.name)+` `,1),l(`em`,null,`(`+n(i.role)+`)`,1)]),Z.value===`${t.id}:${i.user_id}`?(r(),s(`span`,k,[c(` Remover o acesso de `+n(i.name)+`? `,1),l(`button`,{type:`button`,class:`button-primary`,disabled:e(z),onClick:e=>we(t,i)},`Remover`,8,A),l(`button`,{type:`button`,class:`button-secondary`,onClick:o[5]||=e=>Z.value=null},`Cancelar`)])):(r(),s(`button`,{key:1,type:`button`,class:`button-secondary`,onClick:e=>Z.value=`${t.id}:${i.user_id}`},[o[17]||=c(` Remover`,-1),l(`span`,M,n(i.name)+` de `+n(t.name),1)],8,j))]))),128))])):(r(),s(`p`,D,` Sem membros. Ninguém além de administradores pode editar os problemas desta organização. `)),J.value===t.id?(r(),s(`form`,{key:2,ref_for:!0,ref_key:`formMembro`,ref:X,class:`feature-inline-form`,onSubmit:u(e=>Ce(t),[`prevent`])},[l(`label`,{for:`membro-${t.id}`},`Identificador da conta`,8,P),a(l(`input`,{id:`membro-${t.id}`,"onUpdate:modelValue":o[6]||=e=>Y.value=e,name:`user_id`,type:`number`,min:`1`,required:``},null,8,F),[[i,Y.value]]),l(`button`,{type:`submit`,class:`button-primary`,disabled:e(z)},`Adicionar como editor`,8,I),l(`button`,{type:`button`,class:`button-secondary`,onClick:o[7]||=e=>J.value=null},`Cancelar`),d(g,{errors:e(B)?.errors,field:`user_id`},null,8,[`errors`])],40,N)):(r(),s(`button`,{key:3,type:`button`,class:`button-secondary`,onClick:e=>J.value=t.id},`Adicionar membro`,8,L))])]))),128))])):(r(),s(`div`,se,[...o[14]||=[l(`h2`,null,`Nenhuma organização ainda`,-1),l(`p`,null,`Enquanto não houver nenhuma, o seletor de proprietário na governança do banco fica vazio e os problemas ficam sem dono.`,-1)]]))],64)):p(``,!0)]))}};export{he as default}; \ No newline at end of file diff --git a/public/build/assets/Organizations-ZJYPGGTa.js b/public/build/assets/Organizations-ZJYPGGTa.js new file mode 100644 index 00000000..5d67e62c --- /dev/null +++ b/public/build/assets/Organizations-ZJYPGGTa.js @@ -0,0 +1 @@ +import{D as e,S as t,T as n,b as r,c as i,d as a,f as o,h as s,l as c,m as l,o as u,p as d,u as f,w as p,y as m}from"./app-B8gaJnTP.js";import{n as ee,t as h}from"./FeatureState-DoiXEL_p.js";import{t as g}from"./FieldError-DRbrcIPQ.js";var _={class:`feature-stack`},te={class:`feature-metrics`},ne={class:`surface stat-card`},re={class:`surface stat-card`},ie={class:`surface stat-card`},ae={class:`feature-field`},oe=[`disabled`],se={key:0,class:`surface feature-empty`},ce={key:1,class:`feature-list`},le={class:`feature-row-head`},ue={key:0,class:`feature-badge`},de={class:`feature-hint`},fe=[`onSubmit`],pe=[`for`],me=[`id`],v=[`disabled`],y=[`aria-label`],b={class:`feature-hint`},x=[`disabled`,`onClick`],S={key:2,class:`feature-row-actions`},C=[`onClick`],w=[`onClick`],T=[`disabled`,`onClick`],E={class:`feature-details`},D={key:0,class:`feature-hint`},O={key:1,class:`feature-sublist`},k={key:0,class:`feature-confirm-inline`},A=[`disabled`,`onClick`],j=[`onClick`],M={class:`sr-only`},N=[`onSubmit`],P=[`for`],F=[`id`],I=[`disabled`],L=[`onClick`],he={__name:`Organizations`,setup(he){let{data:R,loading:ge,error:_e,busy:z,notice:ve,actionError:B,load:V,act:H}=ee(`/api/frontend/organizations`),U=p(``),W=p(null),G=p(null),K=p(``),q=p(null),J=p(null),Y=p(``),X=p(null),Z=p(null),Q=f(()=>R.value?.organizations??[]),ye=f(()=>Q.value.filter(e=>!e.archived).length),be=f(()=>Q.value.filter(e=>e.archived).length);async function xe(){await H(`/api/frontend/organizations`,{name:U.value},`Organização criada.`,`POST`,W.value)&&(U.value=``,await V())}async function Se(e){await H(`/api/frontend/organizations/${e.id}`,{name:K.value},`Nome atualizado.`,`PATCH`)&&(G.value=null,K.value=``,await V())}async function $(e,t){await H(`/api/frontend/organizations/${e.id}`,{archived:t},t?`Organização arquivada.`:`Organização reaberta.`,`PATCH`)&&(q.value=null,await V())}async function Ce(e){await H(`/api/frontend/organizations/${e.id}/members`,{user_id:Number(Y.value)},`Membro adicionado.`,`POST`,X.value)&&(J.value=null,Y.value=``,await V())}async function we(e,t){await H(`/api/frontend/organizations/${e.id}/members/${t.user_id}`,null,`Membro removido.`,`DELETE`)&&(Z.value=null,await V())}return(f,p)=>(m(),d(`div`,_,[s(h,{loading:n(ge),error:n(_e),stale:!!n(R),busy:n(z),notice:n(ve),"action-error":n(B),onRetry:p[0]||=e=>n(V)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),n(R)?(m(),d(c,{key:0},[a(`dl`,te,[a(`div`,ne,[p[8]||=a(`dt`,null,`Organizações`,-1),a(`dd`,null,e(Q.value.length),1)]),a(`div`,re,[p[9]||=a(`dt`,null,`Ativas`,-1),a(`dd`,null,e(ye.value),1)]),a(`div`,ie,[p[10]||=a(`dt`,null,`Arquivadas`,-1),a(`dd`,null,e(be.value),1)])]),a(`form`,{ref_key:`formCriar`,ref:W,class:`surface feature-form`,onSubmit:i(xe,[`prevent`])},[p[12]||=a(`h2`,null,`Nova organização`,-1),p[13]||=a(`p`,{class:`feature-hint`},[l(` Uma organização é a instituição dona de problemas no banco. Quem for `),a(`strong`,null,`editor`),l(` dela pode editar os problemas dela. `)],-1),a(`div`,ae,[p[11]||=a(`label`,{for:`org-nome`},`Nome`,-1),t(a(`input`,{id:`org-nome`,"onUpdate:modelValue":p[1]||=e=>U.value=e,name:`name`,type:`text`,maxlength:`120`,required:``,autocomplete:`organization`},null,512),[[u,U.value]]),s(g,{errors:n(B)?.errors,field:`name`},null,8,[`errors`])]),a(`button`,{type:`submit`,class:`button-primary`,disabled:n(z)||!U.value.trim()},`Criar organização`,8,oe)],544),Q.value.length?(m(),d(`ul`,ce,[(m(!0),d(c,null,r(Q.value,f=>(m(),d(`li`,{key:f.id,class:`surface feature-row`},[a(`div`,le,[a(`h3`,null,[l(e(f.name)+` `,1),f.archived?(m(),d(`span`,ue,`Arquivada`)):o(``,!0)]),a(`p`,de,e(f.problem_count)+` problema(s) no banco · `+e(f.members.length)+` membro(s) `,1)]),G.value===f.id?(m(),d(`form`,{key:0,class:`feature-inline-form`,onSubmit:i(e=>Se(f),[`prevent`])},[a(`label`,{for:`renomear-${f.id}`,class:`sr-only`},`Novo nome de `+e(f.name),9,pe),t(a(`input`,{id:`renomear-${f.id}`,"onUpdate:modelValue":p[2]||=e=>K.value=e,name:`name`,type:`text`,maxlength:`120`,required:``},null,8,me),[[u,K.value]]),a(`button`,{type:`submit`,class:`button-primary`,disabled:n(z)},`Salvar`,8,v),a(`button`,{type:`button`,class:`button-secondary`,onClick:p[3]||=e=>G.value=null},`Cancelar`),s(g,{errors:n(B)?.errors,field:`name`},null,8,[`errors`])],40,fe)):q.value===f.id?(m(),d(`div`,{key:1,class:`feature-confirm`,role:`group`,"aria-label":`Confirmar arquivamento de ${f.name}`},[a(`p`,null,[p[15]||=l(` Arquivar `,-1),a(`strong`,null,e(f.name),1),p[16]||=l(` tira ela do seletor de proprietário: nenhum problema novo poderá ser atribuído a ela. `,-1)]),a(`p`,b,` Os `+e(f.problem_count)+` problema(s) dela continuam sendo dela, e os membros continuam podendo editá-los. Dá para reabrir depois. `,1),a(`button`,{type:`button`,class:`button-primary`,disabled:n(z),onClick:e=>$(f,!0)},`Arquivar`,8,x),a(`button`,{type:`button`,class:`button-secondary`,onClick:p[4]||=e=>q.value=null},`Cancelar`)],8,y)):(m(),d(`div`,S,[a(`button`,{type:`button`,class:`button-secondary`,onClick:e=>{G.value=f.id,K.value=f.name}},`Renomear`,8,C),f.archived?(m(),d(`button`,{key:1,type:`button`,class:`button-secondary`,disabled:n(z),onClick:e=>$(f,!1)},`Reabrir`,8,T)):(m(),d(`button`,{key:0,type:`button`,class:`button-secondary`,onClick:e=>q.value=f.id},`Arquivar`,8,w))])),a(`details`,E,[a(`summary`,null,`Membros (`+e(f.members.length)+`)`,1),f.members.length?(m(),d(`ul`,O,[(m(!0),d(c,null,r(f.members,t=>(m(),d(`li`,{key:t.user_id},[a(`span`,null,[l(e(t.name)+` `,1),a(`em`,null,`(`+e(t.role)+`)`,1)]),Z.value===`${f.id}:${t.user_id}`?(m(),d(`span`,k,[l(` Remover o acesso de `+e(t.name)+`? `,1),a(`button`,{type:`button`,class:`button-primary`,disabled:n(z),onClick:e=>we(f,t)},`Remover`,8,A),a(`button`,{type:`button`,class:`button-secondary`,onClick:p[5]||=e=>Z.value=null},`Cancelar`)])):(m(),d(`button`,{key:1,type:`button`,class:`button-secondary`,onClick:e=>Z.value=`${f.id}:${t.user_id}`},[p[17]||=l(` Remover`,-1),a(`span`,M,e(t.name)+` de `+e(f.name),1)],8,j))]))),128))])):(m(),d(`p`,D,` Sem membros. Ninguém além de administradores pode editar os problemas desta organização. `)),J.value===f.id?(m(),d(`form`,{key:2,ref_for:!0,ref_key:`formMembro`,ref:X,class:`feature-inline-form`,onSubmit:i(e=>Ce(f),[`prevent`])},[a(`label`,{for:`membro-${f.id}`},`Identificador da conta`,8,P),t(a(`input`,{id:`membro-${f.id}`,"onUpdate:modelValue":p[6]||=e=>Y.value=e,name:`user_id`,type:`number`,min:`1`,required:``},null,8,F),[[u,Y.value]]),a(`button`,{type:`submit`,class:`button-primary`,disabled:n(z)},`Adicionar como editor`,8,I),a(`button`,{type:`button`,class:`button-secondary`,onClick:p[7]||=e=>J.value=null},`Cancelar`),s(g,{errors:n(B)?.errors,field:`user_id`},null,8,[`errors`])],40,N)):(m(),d(`button`,{key:3,type:`button`,class:`button-secondary`,onClick:e=>J.value=f.id},`Adicionar membro`,8,L))])]))),128))])):(m(),d(`div`,se,[...p[14]||=[a(`h2`,null,`Nenhuma organização ainda`,-1),a(`p`,null,`Enquanto não houver nenhuma, o seletor de proprietário na governança do banco fica vazio e os problemas ficam sem dono.`,-1)]]))],64)):o(``,!0)]))}};export{he as default}; \ No newline at end of file diff --git a/public/build/assets/Practice-BMALsMzu.js b/public/build/assets/Practice-BMALsMzu.js new file mode 100644 index 00000000..907eb76a --- /dev/null +++ b/public/build/assets/Practice-BMALsMzu.js @@ -0,0 +1 @@ +import{D as e,E as t,S as n,T as r,_ as ee,a as te,b as i,c as a,d as o,f as s,h as c,l,m as u,n as d,o as f,p,u as m,w as h,x as ne,y as g}from"./app-B8gaJnTP.js";import{i as _,n as re,r as ie,t as ae}from"./FeatureState-DoiXEL_p.js";import{t as v}from"./FeaturePager-DkN6l5V8.js";import{t as y}from"./FieldError-DRbrcIPQ.js";var oe={class:`feature-stack`},se={class:`feature-actions`,"aria-label":`Treino Livre`},ce=[`aria-current`],le=[`aria-current`],ue=[`disabled`],de=[`disabled`],fe={key:0,class:`feature-message`},pe=[`disabled`],me={role:`status`,class:`feature-help`},he={key:1,class:`surface feature-empty`},ge={class:`feature-grid`},_e={class:`feature-heading`},ve={class:`eyebrow`},ye={class:`feature-badge`},be=[`href`],xe={class:`feature-help`},b={class:`feature-tags`},x={key:0,class:`feature-tags`,"aria-label":`Habilidades de currículo`},S=[`href`],C={class:`feature-help`},w=[`href`],T={class:`sr-only`},E={class:`feature-heading`},D=[`disabled`],O={key:0,class:`surface feature-empty`},k={key:1,class:`surface feature-panel`},A={class:`feature-heading`},j={class:`feature-help`},M={key:0},Se=[`href`],Ce={class:`surface feature-panel feature-statement`},we={class:`eyebrow`},Te={class:`feature-help`},Ee={class:`feature-prose`},De={key:0},Oe=[`href`],ke={class:`feature-help`},Ae={class:`feature-grid`},je={class:`surface feature-panel`},Me={key:0,id:`source-help`,class:`feature-help`},Ne={key:1,id:`source-help`,class:`feature-help`},Pe=[`disabled`,`aria-invalid`],Fe=[`value`],Ie={class:`feature-wide`},Le=[`accept`,`disabled`,`aria-invalid`],Re={class:`feature-help feature-wide`},N={class:`feature-wide`},ze=[`disabled`,`aria-invalid`],Be={class:`feature-help feature-wide`},Ve={class:`feature-actions feature-wide`},He=[`disabled`],Ue={key:3,class:`feature-message`},We={key:0,href:`/login`,class:`feature-link`},P={__name:`Practice`,props:{mode:{default:`library`},problemId:String},setup(P){let F=P,I=F.mode===`history`?`/api/frontend/practice/history`:F.mode===`problem`?`/api/frontend/practice/problems/${encodeURIComponent(F.problemId)}`:`/api/frontend/practice/problems`,{data:L,loading:R,error:z,busy:B,notice:Ge,actionError:V,load:H,filter:U,act:W,query:G}=re(I),K=h(G.q||``),q=h(``),J=h(``),Y=h(``),Ke=m(()=>new TextEncoder().encode(J.value).length),X=m(()=>J.value!==Y.value&&J.value.length>0),qe=d(()=>X.value);ee(qe);let Je={AC:`Aceita`,WA:`Resposta incorreta`,TLE:`Tempo excedido`,MLE:`Memória excedida`,CE:`Erro de compilação`,RE:`Erro de execução`,RTE:`Erro de execução`,PE:`Erro de apresentação`,CS:`Erro no julgamento`,pending:`Na fila`,judging:`Em avaliação`,retrying:`Retentativa em andamento`},Z=h(null),Q=m(()=>L.value?.problem?.languages?.find(e=>String(e.id)===String(q.value))),$=m(()=>Q.value?.source_kind===`file`);function Ye(e){Z.value=e.target.files?.[0]||null}async function Xe(e){let t=L.value.problem.max_source_bytes,n=t=>{V.value={message:`Revise o arquivo antes de enviar.`,errors:{source_file:[t]}},e.target.elements.source_file?.focus()};if(!Z.value)return n(`Escolha o arquivo ${Q.value.accept} do seu projeto.`);if(Z.value.size>t)return n(`O arquivo tem ${Z.value.size} bytes; o limite é ${t}.`);let r=new FormData;r.append(`language_id`,String(q.value)),r.append(`source_file`,Z.value,Z.value.name),await W(`${I}/runs`,r,`Projeto recebido. Consulte o histórico para acompanhar o julgamento.`,`POST`,e.target)}async function Ze(e){if($.value)return Xe(e);if(new TextEncoder().encode(J.value).length>L.value.problem.max_source_bytes){V.value={message:`O código ultrapassa o tamanho permitido.`,errors:{source:[`Reduza o código antes de enviar.`]}},e.target.elements.source.focus();return}let t=J.value;await W(`${I}/runs`,{language_id:q.value,source:J.value},`Solução recebida. Consulte o histórico para acompanhar o julgamento.`,`POST`,e.target)&&(Y.value=t)}return ne(()=>G.q,e=>{K.value=e||``}),(ee,d)=>(g(),p(`div`,oe,[o(`nav`,se,[o(`a`,{href:`/practice`,class:`button-secondary`,"aria-current":P.mode===`library`?`page`:void 0},`Biblioteca`,8,ce),o(`a`,{href:`/practice/history`,class:`button-secondary`,"aria-current":P.mode===`history`?`page`:void 0},`Meu histórico`,8,le)]),c(ae,{loading:r(R),error:r(z),stale:!!r(L),busy:r(B),notice:r(Ge),"action-error":r(V),onRetry:d[0]||=e=>r(H)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),r(L)?(g(),p(l,{key:0},[P.mode===`library`?(g(),p(l,{key:0},[d[16]||=o(`div`,{class:`feature-message`},`Pratique no seu ritmo. Os envios de treino não alteram o placar das competições.`,-1),o(`form`,{class:`surface feature-panel feature-search`,role:`search`,onSubmit:d[3]||=a(e=>r(U)({q:K.value,page:1}),[`prevent`])},[o(`label`,null,[d[10]||=u(`Buscar problemas`,-1),n(o(`input`,{"onUpdate:modelValue":d[1]||=e=>K.value=e,type:`search`,name:`q`,maxlength:`100`,placeholder:`Nome ou etiqueta…`},null,512),[[f,K.value]])]),o(`button`,{class:`button-primary`,disabled:r(R)},`Buscar`,8,ue),o(`button`,{type:`button`,class:`button-secondary`,disabled:r(R),onClick:d[2]||=e=>{K.value=``,r(U)({q:``,page:1})}},`Limpar`,8,de)],32),r(G).skill?(g(),p(`p`,fe,[d[11]||=u(`Mostrando problemas associados à habilidade `,-1),o(`strong`,null,e(r(G).skill),1),d[12]||=u(`. `,-1),o(`button`,{type:`button`,class:`button-secondary`,disabled:r(R),onClick:d[4]||=e=>r(U)({skill:``,page:1})},`Remover filtro de habilidade`,8,pe)])):s(``,!0),o(`p`,me,e(r(L).meta?.total??r(L).items?.length??0)+` problemas encontrados`,1),r(L).items?.length?s(``,!0):(g(),p(`div`,he,[d[13]||=o(`h2`,null,`Nenhum problema encontrado`,-1),o(`p`,null,e(r(G).q||r(G).skill?`Tente outro termo ou limpe a busca.`:`Os problemas aparecerão aqui quando a organização publicar a biblioteca.`),1)])),o(`div`,ge,[(g(!0),p(l,null,i(r(L).items,t=>(g(),p(`article`,{key:t.id,class:`surface feature-panel feature-problem`},[o(`div`,_e,[o(`span`,ve,e(t.short_name),1),o(`span`,ye,e(t.solved?`Resolvido`:`Para praticar`),1)]),o(`h2`,null,[o(`a`,{href:`/practice/problems/${encodeURIComponent(t.id)}`},e(t.name),9,be)]),o(`p`,xe,e(t.summary),1),o(`div`,b,[(g(!0),p(l,null,i(t.tags,t=>(g(),p(`span`,{key:t,class:`feature-badge`},e(t),1))),128))]),t.skills?.length?(g(),p(`div`,x,[(g(!0),p(l,null,i(t.skills,t=>(g(),p(`a`,{key:t,href:`/practice?skill=${encodeURIComponent(t)}`,class:`feature-badge`},[u(e(t),1),d[14]||=o(`span`,{class:`sr-only`},`: ver problemas desta habilidade`,-1)],8,S))),128))])):s(``,!0),o(`p`,C,e(t.stats?`${t.stats.solved_count} de ${t.stats.participant_count} participantes resolveram`:`Estatísticas ainda indisponíveis`),1),o(`a`,{href:`/practice/problems/${encodeURIComponent(t.id)}`,class:`button-secondary`},[d[15]||=u(`Abrir problema`,-1),o(`span`,T,`: `+e(t.name),1)],8,w)]))),128))]),c(v,{meta:r(L).meta,loading:r(R),onPage:d[5]||=e=>r(U)({page:e})},null,8,[`meta`,`loading`])],64)):P.mode===`history`?(g(),p(l,{key:1},[o(`div`,E,[d[17]||=o(`p`,{class:`feature-help`},`Este histórico é visível apenas para você e para a organização autorizada.`,-1),o(`button`,{type:`button`,class:`button-secondary`,disabled:r(R),onClick:d[6]||=e=>r(H)()},`Atualizar envios`,8,D)]),r(L).items?.length?(g(),p(`div`,k,[(g(!0),p(l,null,i(r(L).items,n=>(g(),p(`article`,{key:n.id,class:`feature-record`},[o(`div`,A,[o(`h2`,null,e(n.problem_name),1),o(`span`,{class:t([`feature-badge`,{"feature-success":n.verdict===`AC`}])},e(Je[n.verdict||n.status]||`Resultado indisponível`),3)]),o(`p`,j,`Envio #`+e(n.id)+` · `+e(n.language_name)+` · `+e(r(ie)(n.created_at)),1),n.recovery_message?(g(),p(`p`,M,e(n.recovery_message),1)):s(``,!0),r(_)(n.detail_url)?(g(),p(`a`,{key:1,href:r(_)(n.detail_url),class:`button-secondary`},`Ver envio #`+e(n.id),9,Se)):s(``,!0)]))),128))])):(g(),p(`div`,O,[...d[18]||=[o(`h2`,null,`Seu primeiro treino começa na biblioteca`,-1),o(`p`,null,`Escolha um problema e envie uma solução para acompanhar seu progresso aqui.`,-1),o(`a`,{href:`/practice`,class:`button-primary`},`Explorar problemas`,-1)]])),c(v,{meta:r(L).meta,loading:r(R),onPage:d[7]||=e=>r(U)({page:e})},null,8,[`meta`,`loading`])],64)):r(L).problem?(g(),p(l,{key:2},[o(`article`,Ce,[o(`p`,we,e(r(L).problem.short_name),1),o(`h2`,null,e(r(L).problem.name),1),o(`p`,Te,`Tempo: `+e(r(L).problem.time_limit_ms)+` ms · Memória: `+e(r(L).problem.memory_limit_mb)+` MB`,1),o(`div`,Ee,e(r(L).problem.statement),1),r(L).problem.skills?.length?(g(),p(`section`,De,[d[20]||=o(`h3`,null,`Habilidades de currículo`,-1),o(`ul`,null,[(g(!0),p(l,null,i(r(L).problem.skills,t=>(g(),p(`li`,{key:t.id},[o(`a`,{href:`/practice?skill=${encodeURIComponent(t.code)}`,class:`feature-badge`},[u(e(t.code),1),d[19]||=o(`span`,{class:`sr-only`},`: ver problemas desta habilidade`,-1)],8,Oe),u(` `+e(t.text)+` `,1),o(`span`,ke,`(`+e([t.framework.name,t.stage,t.axis].filter(Boolean).join(` · `))+`)`,1)]))),128))])])):s(``,!0),(g(!0),p(l,null,i(r(L).problem.examples,(t,n)=>(g(),p(`section`,{key:n},[o(`h3`,null,`Exemplo `+e(n+1),1),o(`div`,Ae,[o(`div`,null,[d[21]||=o(`h4`,null,`Entrada`,-1),o(`pre`,null,e(t.input),1)]),o(`div`,null,[d[22]||=o(`h4`,null,`Saída`,-1),o(`pre`,null,e(t.output),1)])])]))),128))]),o(`section`,je,[d[28]||=o(`h2`,null,`Enviar solução`,-1),$.value?(g(),p(`p`,Me,`Envie o arquivo `+e(Q.value.accept)+` do seu projeto, salvo pelo editor. Limite de `+e(r(L).problem.max_source_bytes)+` bytes.`,1)):(g(),p(`p`,Ne,`Cole seu código. Limite de `+e(r(L).problem.max_source_bytes)+` bytes. Seu texto será preservado nesta página se o envio falhar. Copie o código para guardá-lo antes de fechar a aba.`,1)),r(L).capabilities?.can_submit?(g(),p(`form`,{key:2,class:`feature-form`,onSubmit:a(Ze,[`prevent`])},[o(`label`,null,[d[24]||=u(`Linguagem`,-1),n(o(`select`,{"onUpdate:modelValue":d[8]||=e=>q.value=e,name:`language_id`,required:``,disabled:r(B),"aria-invalid":!!r(V)?.errors?.language_id,"aria-describedby":`language_id-error`},[d[23]||=o(`option`,{value:``},`Selecione uma linguagem`,-1),(g(!0),p(l,null,i(r(L).problem.languages,t=>(g(),p(`option`,{key:t.id,value:t.id},e(t.name),9,Fe))),128))],8,Pe),[[te,q.value]]),c(y,{error:r(V),name:`language_id`},null,8,[`error`])]),$.value?(g(),p(l,{key:0},[o(`label`,Ie,[d[25]||=u(`Arquivo do projeto`,-1),o(`input`,{type:`file`,name:`source_file`,required:``,accept:Q.value.accept,disabled:r(B),"aria-describedby":`source-help source_file-error`,"aria-invalid":!!r(V)?.errors?.source_file,onChange:Ye},null,40,Le),c(y,{error:r(V),name:`source_file`},null,8,[`error`])]),o(`p`,Re,e(Z.value?`${Z.value.name} · ${Z.value.size} de ${r(L).problem.max_source_bytes} bytes`:`Nenhum arquivo escolhido`),1)],64)):(g(),p(l,{key:1},[o(`label`,N,[d[26]||=u(`Código-fonte`,-1),n(o(`textarea`,{"onUpdate:modelValue":d[9]||=e=>J.value=e,name:`source`,required:``,rows:`14`,spellcheck:`false`,autocapitalize:`none`,autocomplete:`off`,disabled:r(B),"aria-describedby":`source-help source-error`,"aria-invalid":!!r(V)?.errors?.source},null,8,ze),[[f,J.value]]),c(y,{error:r(V),name:`source`},null,8,[`error`])]),o(`p`,Be,e(Ke.value)+` de `+e(r(L).problem.max_source_bytes)+` bytes · `+e(X.value?`Alterações ainda não enviadas`:`Nenhuma alteração pendente`),1)],64)),o(`div`,Ve,[o(`button`,{class:`button-primary`,disabled:r(B)||r(R)||!!r(z)},`Enviar para julgamento`,8,He),d[27]||=o(`a`,{href:`/practice/history`,class:`button-secondary`},`Acompanhar meus envios`,-1)])],32)):(g(),p(`p`,Ue,[u(e(r(L).submit_unavailable_reason||`O envio não está disponível para sua conta neste problema.`)+` `,1),r(L).capabilities?.requires_login?(g(),p(`a`,We,`Entrar na conta`)):s(``,!0)]))])],64)):s(``,!0)],64)):s(``,!0)]))}};export{P as default}; \ No newline at end of file diff --git a/public/build/assets/Practice-DbH0N8cO.js b/public/build/assets/Practice-DbH0N8cO.js deleted file mode 100644 index a5d12abd..00000000 --- a/public/build/assets/Practice-DbH0N8cO.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as c,h as ee,i as te,l,n as ne,o as u,p as d,s as f,u as p,v as m,w as re,y as ie}from"./app-DKg3nD5E.js";import{i as h,n as ae,r as oe,t as se}from"./FeatureState-Ceer7rtj.js";import{t as g}from"./FeaturePager-BA0LLbT3.js";import{t as _}from"./FieldError-P7Uk3ge_.js";var ce={class:`feature-stack`},le={class:`feature-actions`,"aria-label":`Treino Livre`},ue=[`aria-current`],de=[`aria-current`],fe=[`disabled`],pe=[`disabled`],me={role:`status`,class:`feature-help`},he={key:0,class:`surface feature-empty`},ge={class:`feature-grid`},_e={class:`feature-heading`},v={class:`eyebrow`},y={class:`feature-badge`},b=[`href`],x={class:`feature-help`},S={class:`feature-tags`},C={class:`feature-help`},w=[`href`],T={class:`sr-only`},E={class:`feature-heading`},D=[`disabled`],O={key:0,class:`surface feature-empty`},k={key:1,class:`surface feature-panel`},A={class:`feature-heading`},j={class:`feature-help`},M={key:0},N=[`href`],P={class:`surface feature-panel feature-statement`},F={class:`eyebrow`},I={class:`feature-help`},ve={class:`feature-prose`},ye={class:`feature-grid`},be={class:`surface feature-panel`},xe={id:`source-help`,class:`feature-help`},Se=[`disabled`,`aria-invalid`],Ce=[`value`],L={class:`feature-wide`},we=[`disabled`,`aria-invalid`],Te={class:`feature-help feature-wide`},Ee={class:`feature-actions feature-wide`},De=[`disabled`],Oe={key:1,class:`feature-message`},ke={key:0,href:`/login`,class:`feature-link`},R={__name:`Practice`,props:{mode:{default:`library`},problemId:String},setup(R){let z=R,B=z.mode===`history`?`/api/frontend/practice/history`:z.mode===`problem`?`/api/frontend/practice/problems/${encodeURIComponent(z.problemId)}`:`/api/frontend/practice/problems`,{data:V,loading:H,error:U,busy:W,notice:Ae,actionError:G,load:K,filter:q,act:je,query:J}=ae(B),Y=t(J.q||``),X=t(``),Z=t(``),Q=t(``),Me=o(()=>new TextEncoder().encode(Z.value).length),$=o(()=>Z.value!==Q.value&&Z.value.length>0),Ne=ne(()=>$.value);ee(Ne);let Pe={AC:`Aceita`,WA:`Resposta incorreta`,TLE:`Tempo excedido`,MLE:`Memória excedida`,CE:`Erro de compilação`,RE:`Erro de execução`,RTE:`Erro de execução`,PE:`Erro de apresentação`,CS:`Erro no julgamento`,pending:`Na fila`,judging:`Em avaliação`,retrying:`Retentativa em andamento`};async function Fe(e){if(new TextEncoder().encode(Z.value).length>V.value.problem.max_source_bytes){G.value={message:`O código ultrapassa o tamanho permitido.`,errors:{source:[`Reduza o código antes de enviar.`]}},e.target.elements.source.focus();return}let t=Z.value;await je(`${B}/runs`,{language_id:X.value,source:Z.value},`Solução recebida. Consulte o histórico para acompanhar o julgamento.`,`POST`,e.target)&&(Q.value=t)}return ie(()=>J.q,e=>{Y.value=e||``}),(t,o)=>(r(),s(`div`,ce,[l(`nav`,le,[l(`a`,{href:`/practice`,class:`button-secondary`,"aria-current":R.mode===`library`?`page`:void 0},`Biblioteca`,8,ue),l(`a`,{href:`/practice/history`,class:`button-secondary`,"aria-current":R.mode===`history`?`page`:void 0},`Meu histórico`,8,de)]),d(se,{loading:e(H),error:e(U),stale:!!e(V),busy:e(W),notice:e(Ae),"action-error":e(G),onRetry:o[0]||=t=>e(K)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),e(V)?(r(),s(f,{key:0},[R.mode===`library`?(r(),s(f,{key:0},[o[12]||=l(`div`,{class:`feature-message`},`Pratique no seu ritmo. Os envios de treino não alteram o placar das competições.`,-1),l(`form`,{class:`surface feature-panel feature-search`,role:`search`,onSubmit:o[3]||=u(t=>e(q)({q:Y.value,page:1}),[`prevent`])},[l(`label`,null,[o[9]||=c(`Buscar problemas`,-1),a(l(`input`,{"onUpdate:modelValue":o[1]||=e=>Y.value=e,type:`search`,name:`q`,maxlength:`100`,placeholder:`Nome ou etiqueta…`},null,512),[[i,Y.value]])]),l(`button`,{class:`button-primary`,disabled:e(H)},`Buscar`,8,fe),l(`button`,{type:`button`,class:`button-secondary`,disabled:e(H),onClick:o[2]||=t=>{Y.value=``,e(q)({q:``,page:1})}},`Limpar`,8,pe)],32),l(`p`,me,n(e(V).meta?.total??e(V).items?.length??0)+` problemas encontrados`,1),e(V).items?.length?p(``,!0):(r(),s(`div`,he,[o[10]||=l(`h2`,null,`Nenhum problema encontrado`,-1),l(`p`,null,n(e(J).q?`Tente outro termo ou limpe a busca.`:`Os problemas aparecerão aqui quando a organização publicar a biblioteca.`),1)])),l(`div`,ge,[(r(!0),s(f,null,m(e(V).items,e=>(r(),s(`article`,{key:e.id,class:`surface feature-panel feature-problem`},[l(`div`,_e,[l(`span`,v,n(e.short_name),1),l(`span`,y,n(e.solved?`Resolvido`:`Para praticar`),1)]),l(`h2`,null,[l(`a`,{href:`/practice/problems/${encodeURIComponent(e.id)}`},n(e.name),9,b)]),l(`p`,x,n(e.summary),1),l(`div`,S,[(r(!0),s(f,null,m(e.tags,e=>(r(),s(`span`,{key:e,class:`feature-badge`},n(e),1))),128))]),l(`p`,C,n(e.stats?`${e.stats.solved_count} de ${e.stats.participant_count} participantes resolveram`:`Estatísticas ainda indisponíveis`),1),l(`a`,{href:`/practice/problems/${encodeURIComponent(e.id)}`,class:`button-secondary`},[o[11]||=c(`Abrir problema`,-1),l(`span`,T,`: `+n(e.name),1)],8,w)]))),128))]),d(g,{meta:e(V).meta,loading:e(H),onPage:o[4]||=t=>e(q)({page:t})},null,8,[`meta`,`loading`])],64)):R.mode===`history`?(r(),s(f,{key:1},[l(`div`,E,[o[13]||=l(`p`,{class:`feature-help`},`Este histórico é visível apenas para você e para a organização autorizada.`,-1),l(`button`,{type:`button`,class:`button-secondary`,disabled:e(H),onClick:o[5]||=t=>e(K)()},`Atualizar envios`,8,D)]),e(V).items?.length?(r(),s(`div`,k,[(r(!0),s(f,null,m(e(V).items,t=>(r(),s(`article`,{key:t.id,class:`feature-record`},[l(`div`,A,[l(`h2`,null,n(t.problem_name),1),l(`span`,{class:re([`feature-badge`,{"feature-success":t.verdict===`AC`}])},n(Pe[t.verdict||t.status]||`Resultado indisponível`),3)]),l(`p`,j,`Envio #`+n(t.id)+` · `+n(t.language_name)+` · `+n(e(oe)(t.created_at)),1),t.recovery_message?(r(),s(`p`,M,n(t.recovery_message),1)):p(``,!0),e(h)(t.detail_url)?(r(),s(`a`,{key:1,href:e(h)(t.detail_url),class:`button-secondary`},`Ver envio #`+n(t.id),9,N)):p(``,!0)]))),128))])):(r(),s(`div`,O,[...o[14]||=[l(`h2`,null,`Seu primeiro treino começa na biblioteca`,-1),l(`p`,null,`Escolha um problema e envie uma solução para acompanhar seu progresso aqui.`,-1),l(`a`,{href:`/practice`,class:`button-primary`},`Explorar problemas`,-1)]])),d(g,{meta:e(V).meta,loading:e(H),onPage:o[6]||=t=>e(q)({page:t})},null,8,[`meta`,`loading`])],64)):e(V).problem?(r(),s(f,{key:2},[l(`article`,P,[l(`p`,F,n(e(V).problem.short_name),1),l(`h2`,null,n(e(V).problem.name),1),l(`p`,I,`Tempo: `+n(e(V).problem.time_limit_ms)+` ms · Memória: `+n(e(V).problem.memory_limit_mb)+` MB`,1),l(`div`,ve,n(e(V).problem.statement),1),(r(!0),s(f,null,m(e(V).problem.examples,(e,t)=>(r(),s(`section`,{key:t},[l(`h3`,null,`Exemplo `+n(t+1),1),l(`div`,ye,[l(`div`,null,[o[15]||=l(`h4`,null,`Entrada`,-1),l(`pre`,null,n(e.input),1)]),l(`div`,null,[o[16]||=l(`h4`,null,`Saída`,-1),l(`pre`,null,n(e.output),1)])])]))),128))]),l(`section`,be,[o[21]||=l(`h2`,null,`Enviar solução`,-1),l(`p`,xe,`Cole seu código. Limite de `+n(e(V).problem.max_source_bytes)+` bytes. Seu texto será preservado nesta página se o envio falhar. Copie o código para guardá-lo antes de fechar a aba.`,1),e(V).capabilities?.can_submit?(r(),s(`form`,{key:0,class:`feature-form`,onSubmit:u(Fe,[`prevent`])},[l(`label`,null,[o[18]||=c(`Linguagem`,-1),a(l(`select`,{"onUpdate:modelValue":o[7]||=e=>X.value=e,name:`language_id`,required:``,disabled:e(W),"aria-invalid":!!e(G)?.errors?.language_id,"aria-describedby":`language_id-error`},[o[17]||=l(`option`,{value:``},`Selecione uma linguagem`,-1),(r(!0),s(f,null,m(e(V).problem.languages,e=>(r(),s(`option`,{key:e.id,value:e.id},n(e.name),9,Ce))),128))],8,Se),[[te,X.value]]),d(_,{error:e(G),name:`language_id`},null,8,[`error`])]),l(`label`,L,[o[19]||=c(`Código-fonte`,-1),a(l(`textarea`,{"onUpdate:modelValue":o[8]||=e=>Z.value=e,name:`source`,required:``,rows:`14`,spellcheck:`false`,autocapitalize:`none`,autocomplete:`off`,disabled:e(W),"aria-describedby":`source-help source-error`,"aria-invalid":!!e(G)?.errors?.source},null,8,we),[[i,Z.value]]),d(_,{error:e(G),name:`source`},null,8,[`error`])]),l(`p`,Te,n(Me.value)+` de `+n(e(V).problem.max_source_bytes)+` bytes · `+n($.value?`Alterações ainda não enviadas`:`Nenhuma alteração pendente`),1),l(`div`,Ee,[l(`button`,{class:`button-primary`,disabled:e(W)||e(H)||!!e(U)},`Enviar para julgamento`,8,De),o[20]||=l(`a`,{href:`/practice/history`,class:`button-secondary`},`Acompanhar meus envios`,-1)])],32)):(r(),s(`p`,Oe,[c(n(e(V).submit_unavailable_reason||`O envio não está disponível para sua conta neste problema.`)+` `,1),e(V).capabilities?.requires_login?(r(),s(`a`,ke,`Entrar na conta`)):p(``,!0)]))])],64)):p(``,!0)],64)):p(``,!0)]))}};export{R as default}; \ No newline at end of file diff --git a/public/build/assets/ReportChart-CEHmWQ8G.js b/public/build/assets/ReportChart-CEHmWQ8G.js new file mode 100644 index 00000000..435db9a2 --- /dev/null +++ b/public/build/assets/ReportChart-CEHmWQ8G.js @@ -0,0 +1,3 @@ +import{D as e,_ as t,b as n,d as r,f as i,l as a,p as o,v as s,w as c,x as l,y as u}from"./app-B8gaJnTP.js";function d(e){return e+.5|0}var f=(e,t,n)=>Math.max(Math.min(e,n),t);function p(e){return f(d(e*2.55),0,255)}function m(e){return f(d(e*255),0,255)}function h(e){return f(d(e/2.55)/100,0,1)}function g(e){return f(d(e*100),0,100)}var _={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},v=[...`0123456789ABCDEF`],y=e=>v[e&15],b=e=>v[(e&240)>>4]+v[e&15],x=e=>(e&240)>>4==(e&15),S=e=>x(e.r)&&x(e.g)&&x(e.b)&&x(e.a);function C(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&_[e[1]]*17,g:255&_[e[2]]*17,b:255&_[e[3]]*17,a:t===5?_[e[4]]*17:255}:(t===7||t===9)&&(n={r:_[e[1]]<<4|_[e[2]],g:_[e[3]]<<4|_[e[4]],b:_[e[5]]<<4|_[e[6]],a:t===9?_[e[7]]<<4|_[e[8]]:255})),n}var w=(e,t)=>e<255?t(e):``;function T(e){var t=S(e)?y:b;return e?`#`+t(e.r)+t(e.g)+t(e.b)+w(e.a,t):void 0}var E=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function D(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function ee(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function O(e,t,n){let r=D(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function te(e,t,n,r,i){return e===i?(t-n)/r+(t.5?l/(2-i-a):l/(i+a),s=te(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function re(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(m)}function ie(e,t,n){return re(D,e,t,n)}function ae(e,t,n){return re(O,e,t,n)}function oe(e,t,n){return re(ee,e,t,n)}function se(e){return(e%360+360)%360}function ce(e){let t=E.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?p(+t[5]):m(+t[5]));let i=se(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?ae(i,a,o):t[1]===`hsv`?oe(i,a,o):ie(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function le(e,t){var n=ne(e);n[0]=se(n[0]+t),n=ie(n),e.r=n[0],e.g=n[1],e.b=n[2]}function ue(e){if(!e)return;let t=ne(e),n=t[0],r=g(t[1]),i=g(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${h(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var de={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},fe={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function pe(){let e={},t=Object.keys(fe),n=Object.keys(de),r,i,a,o,s;for(r=0;r>16&255,a>>8&255,a&255]}return e}var me;function he(e){me||(me=pe(),me.transparent=[0,0,0,0]);let t=me[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var ge=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _e(e){let t=ge.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?p(e):f(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?p(r):f(r,0,255)),i=255&(t[4]?p(i):f(i,0,255)),a=255&(t[6]?p(a):f(a,0,255)),{r,g:i,b:a,a:n}}}function ve(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${h(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var ye=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,be=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function xe(e,t,n){let r=be(h(e.r)),i=be(h(e.g)),a=be(h(e.b));return{r:m(ye(r+n*(be(h(t.r))-r))),g:m(ye(i+n*(be(h(t.g))-i))),b:m(ye(a+n*(be(h(t.b))-a))),a:e.a+n*(t.a-e.a)}}function Se(e,t,n){if(e){let r=ne(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=ie(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function Ce(e,t){return e&&Object.assign(t||{},e)}function we(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=m(e[3]))):(t=Ce(e,{r:0,g:0,b:0,a:1}),t.a=m(t.a)),t}function Te(e){return e.charAt(0)===`r`?_e(e):ce(e)}var Ee=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=we(t):n===`string`&&(r=C(t)||he(t)||Te(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=Ce(this._rgb);return e&&(e.a=h(e.a)),e}set rgb(e){this._rgb=we(e)}rgbString(){return this._valid?ve(this._rgb):void 0}hexString(){return this._valid?T(this._rgb):void 0}hslString(){return this._valid?ue(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=xe(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=m(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=d(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Se(this._rgb,2,e),this}darken(e){return Se(this._rgb,2,-e),this}saturate(e){return Se(this._rgb,1,e),this}desaturate(e){return Se(this._rgb,1,-e),this}rotate(e){return le(this._rgb,e),this}};function k(){}var De=(()=>{let e=0;return()=>e++})();function A(e){return e==null}function j(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function M(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function N(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function P(e,t){return N(e)?e:t}function F(e,t){return e===void 0?t:e}var Oe=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,ke=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function I(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function L(e,t,n,r){let i,a,o;if(j(e)){if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function Re(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function ze(e){let t=Re(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Be(e,t){return(Le[t]||(Le[t]=ze(t)))(e)}function Ve(e){return e.charAt(0).toUpperCase()+e.slice(1)}var He=e=>e!==void 0,Ue=e=>typeof e==`function`,We=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Ge(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var R=Math.PI,z=2*R,Ke=z+R,qe=1/0,Je=R/180,B=R/2,Ye=R/4,Xe=R*2/3,Ze=Math.log10,V=Math.sign;function Qe(e,t,n){return Math.abs(e-t)e-t).pop(),t}function tt(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function nt(e){return!tt(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function rt(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function it(e,t,n){let r,i,a;for(r=0,i=e.length;rc&&l=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function pt(e,t,n){n||=(n=>e[n]1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var mt=(e,t,n,r)=>pt(e,n,r?r=>{let i=e[r][t];return ie[r][t]pt(e,n,r=>e[r][t]>=n);function gt(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{let n=`_onData`+Ve(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function yt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(_t.forEach(t=>{delete e[t]}),delete e._chartjs)}function bt(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var xt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function St(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,xt.call(window,()=>{r=!1,e.apply(t,n)}))}}function Ct(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var wt=e=>e===`start`?`left`:e===`end`?`right`:`center`,Tt=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2;function Et(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(mt(c,u,d).lo,n?r:mt(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!A(e[s.axis]));i-=Math.max(0,e)}i=W(i,0,r-1)}if(m){let e=Math.max(mt(c,o.axis,f,!0).hi+1,n?0:mt(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!A(e[s.axis]));e+=Math.max(0,t)}a=W(e,i,r)-i}else a=r-i}return{start:i,count:a}}function Dt(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Ot=e=>e===0||e===1,kt=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*z/n)),At=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*z/n)+1,jt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*B)+1,easeOutSine:e=>Math.sin(e*B),easeInOutSine:e=>-.5*(Math.cos(R*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Ot(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Ot(e)?e:kt(e,.075,.3),easeOutElastic:e=>Ot(e)?e:At(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Ot(e)?e:e<.5?.5*kt(e*2,t,n):.5+.5*At(e*2-1,t,n)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return--e*e*(2.70158*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-jt.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?jt.easeInBounce(e*2)*.5:jt.easeOutBounce(e*2-1)*.5+.5};function Mt(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function Nt(e){return Mt(e)?e:new Ee(e)}function Pt(e){return Mt(e)?e:new Ee(e).saturate(.5).darken(.1).hexString()}var Ft=[`x`,`y`,`borderWidth`,`radius`,`tension`],It=[`color`,`borderColor`,`backgroundColor`];function Lt(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:It},numbers:{type:`number`,properties:Ft}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Rt(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var zt=new Map;function Bt(e,t){t||={};let n=e+JSON.stringify(t),r=zt.get(n);return r||(r=new Intl.NumberFormat(e,t),zt.set(n,r)),r}function Vt(e,t,n){return Bt(t,n).format(e)}var Ht={values(e){return j(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Ut(e,n)}let o=Ze(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Vt(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ze(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Ht.numeric.call(this,e,t,n):``}};function Ut(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Wt={formatters:Ht};function Gt(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Wt.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Kt=Object.create(null),qt=Object.create(null);function Jt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;te.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>Pt(t.backgroundColor),this.hoverBorderColor=(e,t)=>Pt(t.borderColor),this.hoverColor=(e,t)=>Pt(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Yt(this,e,t)}get(e){return Jt(this,e)}describe(e,t){return Yt(qt,e,t)}override(e,t){return Yt(Kt,e,t)}route(e,t,n,r){let i=Jt(this,e),a=Jt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return M(e)?Object.assign({},t,e):F(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Lt,Rt,Gt]);function Xt(e){return!e||A(e.size)||A(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Zt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Qt(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function K(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,cn(e,a),c=0;c+e||0;function _n(e,t){let n={},r=M(t),i=r?Object.keys(t):t,a=M(e)?r?n=>F(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=gn(a(e));return n}function vn(e){return _n(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function yn(e){return _n(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function q(e){let t=vn(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(e,t){e||={},t||=G.font;let n=F(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=F(e.style,t.style);r&&!(``+r).match(mn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:F(e.family,t.family),lineHeight:hn(F(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:F(e.weight,t.weight),string:``};return i.string=Xt(i),i}function bn(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;an&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function Sn(e,t){return Object.assign(Object.create(e),t)}function Cn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=zn(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>Cn([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return On(n,r,()=>Rn(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Bn(e).includes(t)},ownKeys(e){return Bn(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function wn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Tn(e,r),setContext:t=>wn(e,t,n,r),override:i=>wn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return On(e,t,()=>kn(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function Tn(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ue(n)?n:()=>n,isIndexable:Ue(r)?r:()=>r}}var En=(e,t)=>e?e+Ve(t):t,Dn=(e,t)=>M(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function On(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function kn(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Ue(s)&&o.isScriptable(t)&&(s=An(t,s,e,n)),j(s)&&s.length&&(s=jn(t,s,e,o.isIndexable)),Dn(t,s)&&(s=wn(s,i,a&&a[t],o)),s}function An(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),Dn(e,c)&&(c=Fn(i._scopes,i,e,c)),c}function jn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(M(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Fn(r,i,e,c);t.push(wn(n,a,o&&o[e],s))}}return t}function Mn(e,t,n){return Ue(e)?e(t,n):e}var Nn=(e,t)=>e===!0?t:typeof e==`string`?Be(t,e):void 0;function Pn(e,t,n,r,i){for(let a of t){let t=Nn(n,a);if(t){e.add(t);let a=Mn(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Fn(e,t,n,r){let i=t._rootScopes,a=Mn(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=In(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=In(s,o,a,c,r),c===null)?!1:Cn(Array.from(s),[``],i,a,()=>Ln(t,n,r))}function In(e,t,n,r,i){for(;n;)n=Pn(e,t,n,r,i);return n}function Ln(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return j(i)&&M(n)?n:i||{}}function Rn(e,t,n,r){let i;for(let a of t)if(i=zn(En(a,e),n),i!==void 0)return Dn(e,i)?Fn(n,r,e,i):i}function zn(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Bn(e){let t=e._keys;return t||=e._keys=Vn(e._scopes),t}function Vn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var Hn=2**-52||1e-14,Un=(e,t)=>te===`x`?`y`:`x`;function Gn(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=ct(a,i),c=ct(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Kn(e,t,n){let r=e.length,i,a,o,s,c,l=Un(e,0);for(let u=0;u!e.skip)),t.cubicInterpolationMode===`monotone`)Jn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;ae.ownerDocument.defaultView.getComputedStyle(e,null);function nr(e,t){return tr(e).getPropertyValue(t)}var rr=[`top`,`right`,`bottom`,`left`];function ir(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=rr[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var ar=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function or(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(ar(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function sr(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=tr(n),a=i.boxSizing===`border-box`,o=ir(i,`padding`),s=ir(i,`border`,`width`),{x:c,y:l,box:u}=or(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function cr(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&$n(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=tr(a),s=ir(o,`border`,`width`),c=ir(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=er(o.maxWidth,a,`clientWidth`),i=er(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||qe,maxHeight:i||qe}}var lr=e=>Math.round(e*10)/10;function ur(e,t,n,r){let i=tr(e),a=ir(i,`margin`),o=er(i.maxWidth,e,`clientWidth`)||qe,s=er(i.maxHeight,e,`clientHeight`)||qe,c=cr(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=ir(i,`border`,`width`),t=ir(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=lr(Math.min(l,o,c.maxWidth)),u=lr(Math.min(u,s,c.maxHeight)),l&&!u&&(u=lr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=lr(Math.floor(u*r))),{width:l,height:u}}function dr(e,t,n){let r=t||1,i=lr(e.height*r),a=lr(e.width*r);e.height=lr(e.height),e.width=lr(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var fr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Qn()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function pr(e,t){let n=nr(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function mr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function hr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function gr(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=mr(e,i,n),s=mr(i,a,n),c=mr(a,t,n);return mr(mr(o,s,n),mr(s,c,n),n)}var _r=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},vr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function yr(e,t,n){return e?_r(t,n):vr()}function br(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function xr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function Sr(e){return e===`angle`?{between:ut,compare:lt,normalize:U}:{between:ft,compare:(e,t)=>e-t,normalize:e=>e}}function Cr({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function wr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=Sr(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;fc(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(Cr({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(Cr({start:g,end:d,loop:f,count:o,style:p})),m}function Er(e,t){let n=[],r=e.segments;for(let i=0;ii&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function Or(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function kr(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=Dr(n,i,a,r);return r===!0?Ar(e,[{start:o,end:s,loop:a}],n,t):Ar(e,Or(n,o,sr({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,xt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Lr=`transparent`,Rr={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=Nt(e||Lr),i=r.valid&&Nt(t||Lr);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},zr=class{constructor(e,t,n,r){let i=t[n];r=bn([e.to,r,i,e.from]);let a=bn([e.from,i,r]);this._active=!0,this._fn=e.fn||Rr[e.type||typeof a],this._easing=jt[e.easing]||jt.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=bn([e.to,t,r,e.from]),this._from=bn([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e{let i=e[r];if(!M(i))return;let a={};for(let e of t)a[e]=i[e];(j(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Hr(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Vr(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u){if(d&&u.active()){u.update(d,l,o);continue}u.cancel()}if(!d||!d.duration){e[c]=l;continue}i[c]=u=new zr(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Y.add(this._chart,n),!0}};function Vr(e,t){let n=[],r=Object.keys(t);for(let t=0;t0||!n&&t<0)return i.index}return null}function ei(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Xr(a,o,r),d=t.length,f;for(let e=0;en[e].axis===t).shift()}function ni(e,t){return Sn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function ri(e,t,n){return Sn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function ii(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var ai=e=>e===`reset`||e===`none`,oi=(e,t)=>t?e:Object.assign({},e),si=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Kr(n,!0),values:null},ci=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Yr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&ii(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=F(n.xAxisID,ti(e,`x`)),a=t.yAxisID=F(n.yAxisID,ti(e,`y`)),o=t.rAxisID=F(n.rAxisID,ti(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&yt(this._data,this),e._stacked&&ii(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(M(t)){let e=this._cachedMeta;this._data=Jr(t,e)}else if(n!==t){if(n){yt(n,this);let e=this._cachedMeta;ii(e),e._parsed=[]}t&&Object.isExtensible(t)&&vt(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Yr(t.vScale,t),t.stack!==n.stack&&(r=!0,ii(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(ei(this,t._parsed),t._stacked=Yr(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length||n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=j(r[e])?this.parseArrayData(n,r,e,t):M(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]t||u=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r=0&&ethis.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(oi(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Br(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||ai(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){ai(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!ai(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;oe-t))}return e._cache.$bar}function ui(e){let t=e.iScale,n=li(t,e.type),r=t._length,i,a,o,s,c=()=>{o!==32767&&o!==-32768&&(He(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i0?i[e-1]:null,s=eMath.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function mi(e,t,n,r){return j(e)?pi(e,t,n,r):t[n.axis]=n.parse(e,r),t}function hi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l=n?1:-1):V(e)}function vi(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.basee.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(A(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[F(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;iut(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>ut(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(B,u,f),_=m(R,l,d),v=m(R+B,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Ei=class extends ci{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(M(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Be(n[t],e)}let a,o;for(a=e,o=e+t;a0&&!isNaN(e)?Math.abs(e)/t*z:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Vt(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r0&&this.getParsed(t-1);for(let n=0;n=_){v.skip=!0;continue}let b=this.getParsed(n),x=A(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};function Oi(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var ki={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Oi()}parse(){return Oi()}format(){return Oi()}add(){return Oi()}diff(){return Oi()}startOf(){return Oi()}endOf(){return Oi()}}};function Ai(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ht:mt;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!A(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!A(e[t.axis]));r.hi+=Math.max(0,o)}return r}if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function ji(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Ri={evaluateInteractionItems:ji,modes:{index(e,t,n,r){let i=sr(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Ni(e,i,a,r,o):Ii(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=sr(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Ni(e,i,a,r,o):Ii(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;ee.pos===t)}function Vi(e,t){return e.filter(e=>zi.indexOf(e.pos)===-1&&e.box.axis===t)}function Hi(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Ui(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;ne.box.fullSize),!0),r=Hi(Bi(t,`left`),!0),i=Hi(Bi(t,`right`)),a=Hi(Bi(t,`top`),!0),o=Hi(Bi(t,`bottom`)),s=Vi(t,`x`),c=Vi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Bi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function qi(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Ji(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Yi(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!M(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Ji(o,a.getPadding());let s=Math.max(0,t.outerWidth-qi(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-qi(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function Xi(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Zi(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Qi(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Ji(f,q(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Gi(c.concat(l),d);Qi(s.fullSize,p,d,m),Qi(c,p,d,m),Qi(l,p,d,m)&&Qi(c,p,d,m),Xi(p),ea(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,ea(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},L(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},na=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},ra=class extends na{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},ia=`$chartjs`,aa={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},oa=e=>e===null||e===``;function sa(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[ia]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,oa(i)){let t=pr(e,`width`);t!==void 0&&(e.width=t)}if(oa(r)){if(e.style.height===``)e.height=e.width/(t||2);else{let t=pr(e,`height`);t!==void 0&&(e.height=t)}}return e}var ca=fr?{passive:!0}:!1;function la(e,t,n){e&&e.addEventListener(t,n,ca)}function ua(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ca)}function da(e,t){let n=aa[e.type]||e.type,{x:r,y:i}=sr(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function fa(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function pa(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=fa(n.addedNodes,r),t&&=!fa(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function ma(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=fa(n.removedNodes,r),t&&=!fa(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var ha=new Map,ga=0;function _a(){let e=window.devicePixelRatio;e!==ga&&(ga=e,ha.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function va(e,t){ha.size||window.addEventListener(`resize`,_a),ha.set(e,t)}function ya(e){ha.delete(e),ha.size||window.removeEventListener(`resize`,_a)}function ba(e,t,n){let r=e.canvas,i=r&&$n(r);if(!i)return;let a=St((e,t)=>{let r=i.clientWidth;n(e,t),r{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;(n!==0||r!==0)&&a(n,r)});return o.observe(i),va(e,a),o}function xa(e,t,n){n&&n.disconnect(),t===`resize`&&ya(e)}function Sa(e,t,n){let r=e.canvas,i=St(t=>{e.ctx!==null&&n(da(t,e))},e);return la(r,t,i),i}var Ca=class extends na{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(sa(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[ia])return!1;let n=t[ia].initial;[`height`,`width`].forEach(e=>{let r=n[e];A(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[ia],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:pa,detach:ma,resize:ba}[t]||Sa)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:xa,detach:xa,resize:xa}[t]||ua)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return ur(e,t,n,r)}isAttached(e){let t=e&&$n(e);return!!(t&&t.isConnected)}};function wa(e){return!Qn()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?ra:Ca}var Ta=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return nt(this.x)&&nt(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Ea(e,t){let n=e.options.ticks,r=Da(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?ka(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Aa(t,l,a,o/i),l;let u=Oa(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(ja(t,l,u,A(r)?0:s-r,s),e=0,n=o-1;ei)return t}return Math.max(i,1)}function ka(e){let t=[],n,r;for(n=0,r=e.length;ne===`left`?`right`:e===`right`?`left`:e,Pa=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Fa=(e,t)=>Math.min(t||e,e);function Ia(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;ao+s)))return c}function Ra(e,t){L(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;in?n:t,n=r&&t>n?t:n,{min:P(t,P(n,t)),max:P(n,P(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=W(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-za(e.grid)-t.padding-Ba(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=at(Math.min(Math.asin(W((l.highest.height+6)/o,-1,1)),Math.asin(W(s/c,-1,1))-Math.asin(W(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ba(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=za(i)+a):(e.height=this.maxHeight,e.width=za(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=H(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){I(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return dt(this._alignToPixels?$t(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&eo*r?o/n:s/r:s*r0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=za(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return $t(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(M(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(M(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=F(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_0&&(a-=r/2)}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-H(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);G.route(a,i,c,s)})}function Ya(e){return`id`in e&&`defaults`in e}var X=new class{constructor(){this.controllers=new Ka(ci,`datasets`,!0),this.elements=new Ka(Ta,`elements`),this.plugins=new Ka(Object,`plugins`),this.scales=new Ka(Ga,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):L(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Ve(e);I(n[`before`+r],[],n),t[e](n),I(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;te.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Za(e){let t={},n=[],r=Object.keys(X.plugins.items);for(let e=0;e1&&io(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function so(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function co(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return so(e,`x`,n[0])||so(e,`y`,n[0])}return{}}function lo(e,t){let n=Kt[e.type]||{scales:{}},r=t.scales||{},i=to(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!M(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=oo(t,o,co(t,e),G.scales[o.type]),c=ro(s,i),l=n.scales||{};a[t]=Fe(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||to(i,t),s=(Kt[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=no(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Fe(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Fe(t,[G.scales[t.type],G.scale])}),a}function uo(e){let t=e.options||={};t.plugins=F(t.plugins,{}),t.scales=lo(e,t)}function fo(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function po(e){return e||={},e.data=fo(e.data),uo(e),e}var mo=new Map,ho=new Set;function go(e,t){let n=mo.get(e);return n||(n=t(),mo.set(e,n),ho.add(n)),n}var _o=(e,t,n)=>{let r=Be(t,n);r!==void 0&&e.add(r)},vo=class{constructor(e){this._config=po(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=fo(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),uo(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return go(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return go(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return go(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return go(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>_o(s,e,t))),t.forEach(e=>_o(s,r,e)),t.forEach(e=>_o(s,Kt[i]||{},e)),t.forEach(e=>_o(s,G,e)),t.forEach(e=>_o(s,qt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),ho.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Kt[t]||{},G.datasets[t]||{},{type:t},G,qt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=yo(this._resolverCache,e,r),s=a;if(xo(a,t)){i.$shared=!1,n=Ue(n)?n():n;let t=this.createResolver(e,n,o);s=wn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=yo(this._resolverCache,e,n);return M(t)?wn(i,t,void 0,r):i}};function yo(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:Cn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var bo=e=>M(e)&&Object.getOwnPropertyNames(e).some(t=>Ue(e[t]));function xo(e,t){let{isScriptable:n,isIndexable:r}=Tn(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Ue(o)||bo(o))||a&&j(o))return!0}return!1}var So=`4.5.1`,Co=[`top`,`bottom`,`left`,`right`,`chartArea`];function wo(e,t){return e===`top`||e===`bottom`||Co.indexOf(e)===-1&&t===`x`}function To(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Eo(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),I(n&&n.onComplete,[e],t)}function Do(e){let t=e.chart,n=t.options.animation;I(n&&n.onProgress,[e],t)}function Oo(e){return Qn()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var ko={},Ao=e=>{let t=Oo(e);return Object.values(ko).filter(e=>e.canvas===t).pop()};function jo(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Mo(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var No=class{static defaults=G;static instances=ko;static overrides=Kt;static registry=X;static version=So;static getChart=Ao;static register(...e){X.add(...e),Po()}static unregister(...e){X.remove(...e),Po()}constructor(e,t){let n=this.config=new vo(t),r=Oo(e),i=Ao(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(wa(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=De(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Xa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ct(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],ko[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Y.listen(this,`complete`,Eo),Y.listen(this,`progress`,Do),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return A(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return X}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():dr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return en(this.canvas,this.ctx),this}stop(){return Y.stop(this),this}resize(e,t){Y.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,dr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),I(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){L(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=oo(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),L(i,t=>{let i=t.options,a=i.id,o=oo(a,i),s=F(i.type,t.dtype);(i.position===void 0||wo(i.position,o)!==wo(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(X.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),L(r,(e,t)=>{e||delete n[t]}),L(n,e=>{ta.configure(this,e,e.options),ta.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;et.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(To(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){L(this.scales,e=>{ta.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!We(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)jo(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;ee.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;ta.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],L(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Ir(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&rn(t,r),e.controller.draw(),r&&an(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return K(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Ri.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=Sn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);He(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Y.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};L(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){L(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},L(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});Ae(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Ge(e),c=Mo(e,this._lastEvent,n,s);n&&(this._lastEvent=null,I(i.onHover,[e,o,this],this),s&&I(i.onClick,[e,o,this],this));let l=!Ae(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Po(){return L(No.instances,e=>e._plugins.invalidate())}function Fo(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,U(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,U(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*U(r-n));if(u===`round`)e.arc(i,a,t,n-R/2,r+R/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+R/2)+i,c=-o*Math.sin(n+R/2)+a,l=o*Math.cos(r+R/2)+i,u=o*Math.sin(r+R/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Io(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+B,r-B),e.closePath(),e.clip()}function Lo(e){return _n(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Ro(e,t,n,r){let i=Lo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return W(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:W(i.innerStart,0,o),innerEnd:W(i.innerEnd,0,o)}}function zo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Bo(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/R)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Ro(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,O=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=zo(C,T,o,s);e.arc(t.x,t.y,y,T,_+B)}let n=zo(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=zo(D,O,o,s);e.arc(t.x,t.y,x,_+B,O+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=zo(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-B)}let i=zo(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=zo(S,w,o,s);e.arc(t.x,t.y,v,g-B,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Vo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Bo(e,t,n,r,c,i);for(let t=0;t=R&&p===0&&u!==`miter`&&Fo(e,t,h),a||(Bo(e,t,n,r,h,i),e.stroke())}var Uo=class extends Ta{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=st(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=F(l,o-a),f=ut(r,a,o)&&a!==o,p=d>=z||f,m=ft(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>z?Math.floor(n/z):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(R,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Vo(e,this,s,i,a),Ho(e,this,s,i,a),e.restore()}};function Wo(e,t,n=t){e.lineCap=F(n.borderCapStyle,t.borderCapStyle),e.setLineDash(F(n.borderDash,t.borderDash)),e.lineDashOffset=F(n.borderDashOffset,t.borderDashOffset),e.lineJoin=F(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=F(n.borderWidth,t.borderWidth),e.strokeStyle=F(n.borderColor,t.borderColor)}function Go(e,t,n){e.lineTo(n.x,n.y)}function Ko(e){return e.stepped?on:e.tension||e.cubicInterpolationMode===`monotone`?sn:Go}function qo(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=is&&a>s;return{count:r,start:c,loop:t.loop,ilen:l(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(ng&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Xo(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Yo:Jo}function Zo(e){return e.stepped?hr:e.tension||e.cubicInterpolationMode===`monotone`?gr:mr}function Qo(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Wo(e,t.options),e.stroke(i)}function $o(e,t,n,r){let{segments:i,options:a}=t,o=Xo(t);for(let s of i)Wo(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var es=typeof Path2D==`function`;function ts(e,t,n,r){es&&!t.options.segment?Qo(e,t,n,r):$o(e,t,n,r)}var ns=class extends Ta{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Zn(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=kr(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=Er(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=Zo(n),c,l;for(c=0,l=a.length;c{t=vs(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function vs(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function ys(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function bs(e,t){let n=[],r=!1;return j(e)?(r=!0,n=e):n=_s(e,t),n.length?new ns({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function xs(e){return e&&e.fill!==!1}function Ss(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!N(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function Cs(e,t,n){let r=Ds(e);if(M(r))return!isNaN(r.value)&&r;let i=parseFloat(r);return N(i)&&Math.floor(i)===i?ws(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function ws(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Ts(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:M(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Es(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:M(e)?e.value:t.getBaseValue(),r}function Ds(e){let t=e.options,n=t.fill,r=F(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function Os(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=ks(t,n);s.push(bs({x:null,y:t.bottom},r));for(let e=0;e=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Rs(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;xs(n)&&Rs(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;xs(r)&&n.drawTime===`beforeDatasetDraw`&&Rs(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Ks={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;te+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a-1?e.split(` +`):e}function Js(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Ys(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=J(t.bodyFont),l=J(t.titleFont),u=J(t.footerFont),d=a.length,f=i.length,p=r.length,m=q(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,L(e.title,y),n.font=c.string,L(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,L(r,e=>{L(e.before,y),L(e.lines,y),L(e.after,y)}),v=0,n.font=u.string,L(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function Xs(e,t){let{y:n,height:r}=t;return ne.height-r/2?`bottom`:`center`}function Zs(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function Qs(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),Zs(l,e,t,n)&&(l=`center`),l}function $s(e,t,n){let r=n.yAlign||t.yAlign||Xs(e,n);return{xAlign:n.xAlign||t.xAlign||Qs(e,t,n,r),yAlign:r}}function ec(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function tc(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:r-=t===`bottom`?i+n:i/2,r}function nc(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=yn(o),m=ec(t,s),h=tc(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:W(m,0,r.width-t.width),y:W(h,0,r.height-t.height)}}function rc(e,t,n){let r=q(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function ic(e){return Z([],qs(e))}function ac(e,t,n){return Sn(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function oc(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var sc={beforeTitle:k,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex{let t={before:[],lines:[],after:[]},i=oc(n,e);Z(t.before,qs(Q(i,`beforeLabel`,this,e))),Z(t.lines,Q(i,`label`,this,e)),Z(t.after,qs(Q(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return ic(Q(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Q(n,`beforeFooter`,this,e),i=Q(n,`footer`,this,e),a=Q(n,`afterFooter`,this,e),o=[];return o=Z(o,qs(r)),o=Z(o,qs(i)),o=Z(o,qs(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;se.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),L(o,t=>{let n=oc(e.callbacks,t);r.push(Q(n,`labelColor`,this,t)),i.push(Q(n,`labelPointStyle`,this,t)),a.push(Q(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=Ks[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=Ys(this,n),o=Object.assign({},e,t),s=$s(this.chart,n,o),c=nc(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=yn(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=yr(n.rtl,this.x,this.width);for(e.x=rc(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=J(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;se!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,fn(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),fn(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=J(n.bodyFont),d=u.lineHeight,f=0,p=yr(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=rc(this,h,n),t.fillStyle=n.bodyColor,L(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=Ks[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=Ys(this,e),o=Object.assign({},n,this._size),s=$s(t,e,o),c=nc(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=q(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),br(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),xr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!Ae(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!Ae(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=Ks[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},lc={id:`tooltip`,_element:cc,positioners:Ks,afterInit(e,t,n){n&&(e.tooltip=new cc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:sc},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},uc=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function dc(e,t,n,r){let i=e.indexOf(t);return i===-1?uc(e,t,n,r):i===e.lastIndexOf(t)?i:n}var fc=(e,t)=>e===null?null:W(Math.round(e),0,t);function pc(e){let t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function hc(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!A(a),_=!A(o),v=!A(c),y=(h-m)/(u+1),b=$e((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=$e(w*b/p/f)*f),A(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&rt((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Qe(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(ot(b),ot(S));x=10**(A(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),So)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Qe(n[n.length-1].value,o,gc(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function gc(e,t,{horizontal:n,minRotation:r}){let i=H(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var _c=class extends Ga{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return A(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=V(r),t=V(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=hc({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&it(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Vt(e,this.chart.options.locale,this.options.ticks.format)}},vc=class extends _c{static id=`linear`;static defaults={ticks:{callback:Wt.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=N(e)?e:0,this.max=N(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=H(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},yc=e=>Math.floor(Ze(e)),bc=(e,t)=>10**(yc(e)+t);function xc(e){return e/10**yc(e)==1}function Sc(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Cc(e,t){let n=yc(t-e);for(;Sc(e,t,n)>10;)n++;for(;Sc(e,t,n)<10;)n--;return Math.min(n,yc(e))}function wc(e,{min:t,max:n}){t=P(e.min,t);let r=[],i=yc(t),a=Cc(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=P(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=P(e.max,f);return r.push({value:p,major:xc(p),significand:d}),r}(class extends Ga{static id=`logarithmic`;static defaults={ticks:{callback:Wt.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=_c.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return N(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=N(e)?Math.max(0,e):null,this.max=N(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!N(this._userMin)&&(this.min=e===bc(this.min,0)?bc(this.min,-1):bc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(bc(n,-1)),a(bc(r,1)))),n<=0&&i(bc(r,-1)),r<=0&&a(bc(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=wc({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&it(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Vt(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Ze(e),this._valueRange=Ze(this.max)-Ze(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ze(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function Tc(e){let t=e.ticks;if(t.display&&e.display){let e=q(t.backdropPadding);return F(t.font&&t.font.size,G.font.size)+e.height}return 0}function Ec(e,t,n){return n=j(n)?n:[n],{w:Qt(e,t.string,n),h:n.length*t.lineHeight}}function Dc(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function Oc(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?R/a:0;for(let c=0;ct.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.startt.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Ac(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(at(U(c.angle+B))),u=Fc(c.y,s.h,l),d=Nc(l),f=Pc(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function jc(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(K({x:n,y:r},t)||K({x:n,y:a},t)||K({x:i,y:r},t)||K({x:i,y:a},t))}function Mc(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Tc(a)/2,additionalAngle:o?R/i:0},l;for(let a=0;a270||n<90)&&(e-=t),e}function Ic(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!A(s)){let n=yn(t.borderRadius),c=q(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),fn(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function Lc(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));Ic(n,a,t);let o=J(a.font),{x:s,y:c,textAlign:l}=t;dn(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function Rc(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,z);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a{let n=I(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Oc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=z/(this._pointLabels.length||1),n=this.options.startAngle||0;return U(e*t+H(n))}getDistanceFromCenterForValue(e){if(A(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(A(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);zc(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;a&&i&&(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=J(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=q(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}dn(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var Vc={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},$=Object.keys(Vc);function Hc(e,t){return e-t}function Uc(e,t){if(A(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),N(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(nt(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function Wc(e,t,n,r){let i=$.length;for(let a=$.indexOf(e);a=$.indexOf(n);a--){let n=$[a];if(Vc[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return $[n?$.indexOf(n):0]}function Kc(e){for(let t=$.indexOf(e)+1,n=$.length;t=t?n[r]:n[i];e[a]=!0}}function Jc(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function Yc(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=W(t,0,a),n=W(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||Wc(i.minUnit,t,n,this._getLabelCapacity(t)),o=F(r.ticks.stepSize,1),s=a===`week`&&i.isoWeekday,c=nt(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return I(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=mt(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=mt(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends Xc{static id=`timeseries`;static defaults=Xc.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Zc(t,this.min),this._tableRange=Zc(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;ae-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Zc(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Zc(this._table,n*this._tableRange+this._minPos,!0)}});var Qc={class:`report-chart`},$c={key:0,class:`feature-help`},el={class:`report-chart-canvas`},tl=[`aria-label`],nl={class:`report-chart-data`},rl={class:`table-scroll`},il={scope:`col`},al={scope:`row`},ol={__name:`ReportChart`,props:{title:{type:String,required:!0},summary:{type:String,default:``},type:{type:String,default:`bar`},labels:{type:Array,default:()=>[]},datasets:{type:Array,default:()=>[]},unitLabel:{type:String,default:`Valor`}},setup(d){No.register(Uo,wi,ms,mc,Ei,Gs,Di,ns,vc,is,lc);let f=d,p=c(null),m=null,h=null,g=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim()||`#0f766e`,_=[`--color-primary`,`--color-success`,`--color-destructive`,`--color-warning`,`--color-info`];function v(){return f.datasets.map((e,t)=>g(e.token||_[t%_.length]))}function y(){return f.labels.map((e,t)=>g(_[t%_.length]))}function b(){let e=v(),t=g(`--color-border`),n=g(`--color-muted-foreground`);return{type:f.type,data:{labels:f.labels,datasets:f.datasets.map((t,n)=>({label:t.label,data:t.data,borderColor:f.type===`doughnut`?g(`--color-card`):e[n],backgroundColor:f.type===`doughnut`?y():e[n],fill:f.type!==`line`&&void 0,tension:f.type===`line`?.25:void 0,borderWidth:f.type===`line`?2:1,pointRadius:f.type===`line`?2:void 0}))},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{enabled:!0}},animation:!1,scales:f.type===`doughnut`?void 0:{x:{grid:{color:t},ticks:{color:n}},y:{beginAtZero:!0,grid:{color:t},ticks:{color:n,precision:0}}}}}}function x(){if(p.value){m?.destroy(),m=null;try{m=new No(p.value,b())}catch{m=null}}}return s(()=>{x(),h=new MutationObserver(x),h.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]})}),t(()=>{h?.disconnect(),m?.destroy(),m=null}),l(()=>[f.labels,f.datasets,f.type],x,{deep:!0}),(t,s)=>(u(),o(`figure`,Qc,[r(`figcaption`,null,[r(`h3`,null,e(d.title),1),d.summary?(u(),o(`p`,$c,e(d.summary),1)):i(``,!0)]),r(`div`,el,[r(`canvas`,{ref_key:`canvas`,ref:p,role:`img`,"aria-label":d.summary||d.title},null,8,tl)]),r(`details`,nl,[s[0]||=r(`summary`,null,`Ver dados em tabela`,-1),r(`div`,rl,[r(`table`,null,[r(`thead`,null,[r(`tr`,null,[r(`th`,il,e(d.unitLabel),1),(u(!0),o(a,null,n(d.datasets,t=>(u(),o(`th`,{key:t.label,scope:`col`},e(t.label),1))),128))])]),r(`tbody`,null,[(u(!0),o(a,null,n(d.labels,(t,i)=>(u(),o(`tr`,{key:t},[r(`th`,al,e(t),1),(u(!0),o(a,null,n(d.datasets,t=>(u(),o(`td`,{key:t.label},e(t.data[i]??0),1))),128))]))),128))])])])])]))}};export{ol as t}; \ No newline at end of file diff --git a/public/build/assets/ReportChart-jiaGIq-w.js b/public/build/assets/ReportChart-jiaGIq-w.js deleted file mode 100644 index 2b173791..00000000 --- a/public/build/assets/ReportChart-jiaGIq-w.js +++ /dev/null @@ -1,3 +0,0 @@ -import{S as e,T as t,_ as n,d as r,g as i,h as a,l as o,s,u as c,v as l,y as u}from"./app-DKg3nD5E.js";function d(e){return e+.5|0}var f=(e,t,n)=>Math.max(Math.min(e,n),t);function p(e){return f(d(e*2.55),0,255)}function m(e){return f(d(e*255),0,255)}function h(e){return f(d(e/2.55)/100,0,1)}function g(e){return f(d(e*100),0,100)}var _={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},v=[...`0123456789ABCDEF`],y=e=>v[e&15],b=e=>v[(e&240)>>4]+v[e&15],x=e=>(e&240)>>4==(e&15),S=e=>x(e.r)&&x(e.g)&&x(e.b)&&x(e.a);function C(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&_[e[1]]*17,g:255&_[e[2]]*17,b:255&_[e[3]]*17,a:t===5?_[e[4]]*17:255}:(t===7||t===9)&&(n={r:_[e[1]]<<4|_[e[2]],g:_[e[3]]<<4|_[e[4]],b:_[e[5]]<<4|_[e[6]],a:t===9?_[e[7]]<<4|_[e[8]]:255})),n}var w=(e,t)=>e<255?t(e):``;function T(e){var t=S(e)?y:b;return e?`#`+t(e.r)+t(e.g)+t(e.b)+w(e.a,t):void 0}var E=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function D(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function ee(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function O(e,t,n){let r=D(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function te(e,t,n,r,i){return e===i?(t-n)/r+(t.5?l/(2-i-a):l/(i+a),s=te(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function re(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(m)}function ie(e,t,n){return re(D,e,t,n)}function ae(e,t,n){return re(O,e,t,n)}function oe(e,t,n){return re(ee,e,t,n)}function se(e){return(e%360+360)%360}function ce(e){let t=E.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?p(+t[5]):m(+t[5]));let i=se(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?ae(i,a,o):t[1]===`hsv`?oe(i,a,o):ie(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function le(e,t){var n=ne(e);n[0]=se(n[0]+t),n=ie(n),e.r=n[0],e.g=n[1],e.b=n[2]}function ue(e){if(!e)return;let t=ne(e),n=t[0],r=g(t[1]),i=g(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${h(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var de={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},fe={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function pe(){let e={},t=Object.keys(fe),n=Object.keys(de),r,i,a,o,s;for(r=0;r>16&255,a>>8&255,a&255]}return e}var me;function he(e){me||(me=pe(),me.transparent=[0,0,0,0]);let t=me[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var ge=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _e(e){let t=ge.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?p(e):f(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?p(r):f(r,0,255)),i=255&(t[4]?p(i):f(i,0,255)),a=255&(t[6]?p(a):f(a,0,255)),{r,g:i,b:a,a:n}}}function ve(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${h(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var ye=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,be=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function xe(e,t,n){let r=be(h(e.r)),i=be(h(e.g)),a=be(h(e.b));return{r:m(ye(r+n*(be(h(t.r))-r))),g:m(ye(i+n*(be(h(t.g))-i))),b:m(ye(a+n*(be(h(t.b))-a))),a:e.a+n*(t.a-e.a)}}function Se(e,t,n){if(e){let r=ne(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=ie(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function Ce(e,t){return e&&Object.assign(t||{},e)}function we(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=m(e[3]))):(t=Ce(e,{r:0,g:0,b:0,a:1}),t.a=m(t.a)),t}function Te(e){return e.charAt(0)===`r`?_e(e):ce(e)}var Ee=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=we(t):n===`string`&&(r=C(t)||he(t)||Te(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=Ce(this._rgb);return e&&(e.a=h(e.a)),e}set rgb(e){this._rgb=we(e)}rgbString(){return this._valid?ve(this._rgb):void 0}hexString(){return this._valid?T(this._rgb):void 0}hslString(){return this._valid?ue(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=xe(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=m(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=d(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Se(this._rgb,2,e),this}darken(e){return Se(this._rgb,2,-e),this}saturate(e){return Se(this._rgb,1,e),this}desaturate(e){return Se(this._rgb,1,-e),this}rotate(e){return le(this._rgb,e),this}};function k(){}var De=(()=>{let e=0;return()=>e++})();function A(e){return e==null}function j(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function M(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function N(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function P(e,t){return N(e)?e:t}function F(e,t){return e===void 0?t:e}var Oe=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,ke=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function I(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function L(e,t,n,r){let i,a,o;if(j(e)){if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function Re(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function ze(e){let t=Re(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Be(e,t){return(Le[t]||(Le[t]=ze(t)))(e)}function Ve(e){return e.charAt(0).toUpperCase()+e.slice(1)}var He=e=>e!==void 0,Ue=e=>typeof e==`function`,We=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Ge(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var R=Math.PI,z=2*R,Ke=z+R,qe=1/0,Je=R/180,B=R/2,Ye=R/4,Xe=R*2/3,Ze=Math.log10,V=Math.sign;function Qe(e,t,n){return Math.abs(e-t)e-t).pop(),t}function tt(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function nt(e){return!tt(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function rt(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function it(e,t,n){let r,i,a;for(r=0,i=e.length;rc&&l=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function pt(e,t,n){n||=(n=>e[n]1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var mt=(e,t,n,r)=>pt(e,n,r?r=>{let i=e[r][t];return ie[r][t]pt(e,n,r=>e[r][t]>=n);function gt(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{let n=`_onData`+Ve(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function yt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(_t.forEach(t=>{delete e[t]}),delete e._chartjs)}function bt(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var xt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function St(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,xt.call(window,()=>{r=!1,e.apply(t,n)}))}}function Ct(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var wt=e=>e===`start`?`left`:e===`end`?`right`:`center`,Tt=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2;function Et(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(mt(c,u,d).lo,n?r:mt(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!A(e[s.axis]));i-=Math.max(0,e)}i=W(i,0,r-1)}if(m){let e=Math.max(mt(c,o.axis,f,!0).hi+1,n?0:mt(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!A(e[s.axis]));e+=Math.max(0,t)}a=W(e,i,r)-i}else a=r-i}return{start:i,count:a}}function Dt(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Ot=e=>e===0||e===1,kt=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*z/n)),At=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*z/n)+1,jt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*B)+1,easeOutSine:e=>Math.sin(e*B),easeInOutSine:e=>-.5*(Math.cos(R*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Ot(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Ot(e)?e:kt(e,.075,.3),easeOutElastic:e=>Ot(e)?e:At(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Ot(e)?e:e<.5?.5*kt(e*2,t,n):.5+.5*At(e*2-1,t,n)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return--e*e*(2.70158*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-jt.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?jt.easeInBounce(e*2)*.5:jt.easeOutBounce(e*2-1)*.5+.5};function Mt(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function Nt(e){return Mt(e)?e:new Ee(e)}function Pt(e){return Mt(e)?e:new Ee(e).saturate(.5).darken(.1).hexString()}var Ft=[`x`,`y`,`borderWidth`,`radius`,`tension`],It=[`color`,`borderColor`,`backgroundColor`];function Lt(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:It},numbers:{type:`number`,properties:Ft}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Rt(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var zt=new Map;function Bt(e,t){t||={};let n=e+JSON.stringify(t),r=zt.get(n);return r||(r=new Intl.NumberFormat(e,t),zt.set(n,r)),r}function Vt(e,t,n){return Bt(t,n).format(e)}var Ht={values(e){return j(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Ut(e,n)}let o=Ze(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Vt(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ze(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Ht.numeric.call(this,e,t,n):``}};function Ut(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Wt={formatters:Ht};function Gt(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Wt.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Kt=Object.create(null),qt=Object.create(null);function Jt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;te.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>Pt(t.backgroundColor),this.hoverBorderColor=(e,t)=>Pt(t.borderColor),this.hoverColor=(e,t)=>Pt(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Yt(this,e,t)}get(e){return Jt(this,e)}describe(e,t){return Yt(qt,e,t)}override(e,t){return Yt(Kt,e,t)}route(e,t,n,r){let i=Jt(this,e),a=Jt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return M(e)?Object.assign({},t,e):F(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Lt,Rt,Gt]);function Xt(e){return!e||A(e.size)||A(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Zt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Qt(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function K(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,cn(e,a),c=0;c+e||0;function _n(e,t){let n={},r=M(t),i=r?Object.keys(t):t,a=M(e)?r?n=>F(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=gn(a(e));return n}function vn(e){return _n(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function yn(e){return _n(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function q(e){let t=vn(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(e,t){e||={},t||=G.font;let n=F(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=F(e.style,t.style);r&&!(``+r).match(mn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:F(e.family,t.family),lineHeight:hn(F(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:F(e.weight,t.weight),string:``};return i.string=Xt(i),i}function bn(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;an&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function Sn(e,t){return Object.assign(Object.create(e),t)}function Cn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=zn(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>Cn([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return On(n,r,()=>Rn(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Bn(e).includes(t)},ownKeys(e){return Bn(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function wn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Tn(e,r),setContext:t=>wn(e,t,n,r),override:i=>wn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return On(e,t,()=>kn(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function Tn(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ue(n)?n:()=>n,isIndexable:Ue(r)?r:()=>r}}var En=(e,t)=>e?e+Ve(t):t,Dn=(e,t)=>M(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function On(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function kn(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Ue(s)&&o.isScriptable(t)&&(s=An(t,s,e,n)),j(s)&&s.length&&(s=jn(t,s,e,o.isIndexable)),Dn(t,s)&&(s=wn(s,i,a&&a[t],o)),s}function An(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),Dn(e,c)&&(c=Fn(i._scopes,i,e,c)),c}function jn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(M(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Fn(r,i,e,c);t.push(wn(n,a,o&&o[e],s))}}return t}function Mn(e,t,n){return Ue(e)?e(t,n):e}var Nn=(e,t)=>e===!0?t:typeof e==`string`?Be(t,e):void 0;function Pn(e,t,n,r,i){for(let a of t){let t=Nn(n,a);if(t){e.add(t);let a=Mn(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Fn(e,t,n,r){let i=t._rootScopes,a=Mn(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=In(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=In(s,o,a,c,r),c===null)?!1:Cn(Array.from(s),[``],i,a,()=>Ln(t,n,r))}function In(e,t,n,r,i){for(;n;)n=Pn(e,t,n,r,i);return n}function Ln(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return j(i)&&M(n)?n:i||{}}function Rn(e,t,n,r){let i;for(let a of t)if(i=zn(En(a,e),n),i!==void 0)return Dn(e,i)?Fn(n,r,e,i):i}function zn(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Bn(e){let t=e._keys;return t||=e._keys=Vn(e._scopes),t}function Vn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var Hn=2**-52||1e-14,Un=(e,t)=>te===`x`?`y`:`x`;function Gn(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=ct(a,i),c=ct(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Kn(e,t,n){let r=e.length,i,a,o,s,c,l=Un(e,0);for(let u=0;u!e.skip)),t.cubicInterpolationMode===`monotone`)Jn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;ae.ownerDocument.defaultView.getComputedStyle(e,null);function nr(e,t){return tr(e).getPropertyValue(t)}var rr=[`top`,`right`,`bottom`,`left`];function ir(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=rr[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var ar=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function or(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(ar(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function sr(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=tr(n),a=i.boxSizing===`border-box`,o=ir(i,`padding`),s=ir(i,`border`,`width`),{x:c,y:l,box:u}=or(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function cr(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&$n(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=tr(a),s=ir(o,`border`,`width`),c=ir(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=er(o.maxWidth,a,`clientWidth`),i=er(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||qe,maxHeight:i||qe}}var lr=e=>Math.round(e*10)/10;function ur(e,t,n,r){let i=tr(e),a=ir(i,`margin`),o=er(i.maxWidth,e,`clientWidth`)||qe,s=er(i.maxHeight,e,`clientHeight`)||qe,c=cr(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=ir(i,`border`,`width`),t=ir(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=lr(Math.min(l,o,c.maxWidth)),u=lr(Math.min(u,s,c.maxHeight)),l&&!u&&(u=lr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=lr(Math.floor(u*r))),{width:l,height:u}}function dr(e,t,n){let r=t||1,i=lr(e.height*r),a=lr(e.width*r);e.height=lr(e.height),e.width=lr(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var fr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Qn()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function pr(e,t){let n=nr(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function mr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function hr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function gr(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=mr(e,i,n),s=mr(i,a,n),c=mr(a,t,n);return mr(mr(o,s,n),mr(s,c,n),n)}var _r=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},vr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function yr(e,t,n){return e?_r(t,n):vr()}function br(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function xr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function Sr(e){return e===`angle`?{between:ut,compare:lt,normalize:U}:{between:ft,compare:(e,t)=>e-t,normalize:e=>e}}function Cr({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function wr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=Sr(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;fc(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(Cr({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(Cr({start:g,end:d,loop:f,count:o,style:p})),m}function Er(e,t){let n=[],r=e.segments;for(let i=0;ii&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function Or(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function kr(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=Dr(n,i,a,r);return r===!0?Ar(e,[{start:o,end:s,loop:a}],n,t):Ar(e,Or(n,o,sr({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,xt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Lr=`transparent`,Rr={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=Nt(e||Lr),i=r.valid&&Nt(t||Lr);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},zr=class{constructor(e,t,n,r){let i=t[n];r=bn([e.to,r,i,e.from]);let a=bn([e.from,i,r]);this._active=!0,this._fn=e.fn||Rr[e.type||typeof a],this._easing=jt[e.easing]||jt.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=bn([e.to,t,r,e.from]),this._from=bn([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e{let i=e[r];if(!M(i))return;let a={};for(let e of t)a[e]=i[e];(j(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Hr(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Vr(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u){if(d&&u.active()){u.update(d,l,o);continue}u.cancel()}if(!d||!d.duration){e[c]=l;continue}i[c]=u=new zr(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Y.add(this._chart,n),!0}};function Vr(e,t){let n=[],r=Object.keys(t);for(let t=0;t0||!n&&t<0)return i.index}return null}function ei(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Xr(a,o,r),d=t.length,f;for(let e=0;en[e].axis===t).shift()}function ni(e,t){return Sn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function ri(e,t,n){return Sn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function ii(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var ai=e=>e===`reset`||e===`none`,oi=(e,t)=>t?e:Object.assign({},e),si=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Kr(n,!0),values:null},ci=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Yr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&ii(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=F(n.xAxisID,ti(e,`x`)),a=t.yAxisID=F(n.yAxisID,ti(e,`y`)),o=t.rAxisID=F(n.rAxisID,ti(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&yt(this._data,this),e._stacked&&ii(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(M(t)){let e=this._cachedMeta;this._data=Jr(t,e)}else if(n!==t){if(n){yt(n,this);let e=this._cachedMeta;ii(e),e._parsed=[]}t&&Object.isExtensible(t)&&vt(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Yr(t.vScale,t),t.stack!==n.stack&&(r=!0,ii(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(ei(this,t._parsed),t._stacked=Yr(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length||n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=j(r[e])?this.parseArrayData(n,r,e,t):M(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]t||u=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r=0&&ethis.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(oi(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Br(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||ai(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){ai(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!ai(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;oe-t))}return e._cache.$bar}function ui(e){let t=e.iScale,n=li(t,e.type),r=t._length,i,a,o,s,c=()=>{o!==32767&&o!==-32768&&(He(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i0?i[e-1]:null,s=eMath.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function mi(e,t,n,r){return j(e)?pi(e,t,n,r):t[n.axis]=n.parse(e,r),t}function hi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l=n?1:-1):V(e)}function vi(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.basee.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(A(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[F(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;iut(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>ut(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(B,u,f),_=m(R,l,d),v=m(R+B,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Ei=class extends ci{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(M(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Be(n[t],e)}let a,o;for(a=e,o=e+t;a0&&!isNaN(e)?Math.abs(e)/t*z:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Vt(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r0&&this.getParsed(t-1);for(let n=0;n=_){v.skip=!0;continue}let b=this.getParsed(n),x=A(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};function Oi(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var ki={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Oi()}parse(){return Oi()}format(){return Oi()}add(){return Oi()}diff(){return Oi()}startOf(){return Oi()}endOf(){return Oi()}}};function Ai(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ht:mt;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!A(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!A(e[t.axis]));r.hi+=Math.max(0,o)}return r}if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function ji(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Ri={evaluateInteractionItems:ji,modes:{index(e,t,n,r){let i=sr(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Ni(e,i,a,r,o):Ii(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=sr(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Ni(e,i,a,r,o):Ii(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;ee.pos===t)}function Vi(e,t){return e.filter(e=>zi.indexOf(e.pos)===-1&&e.box.axis===t)}function Hi(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Ui(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;ne.box.fullSize),!0),r=Hi(Bi(t,`left`),!0),i=Hi(Bi(t,`right`)),a=Hi(Bi(t,`top`),!0),o=Hi(Bi(t,`bottom`)),s=Vi(t,`x`),c=Vi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Bi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function qi(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Ji(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Yi(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!M(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Ji(o,a.getPadding());let s=Math.max(0,t.outerWidth-qi(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-qi(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function Xi(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Zi(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Qi(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Ji(f,q(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Gi(c.concat(l),d);Qi(s.fullSize,p,d,m),Qi(c,p,d,m),Qi(l,p,d,m)&&Qi(c,p,d,m),Xi(p),ea(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,ea(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},L(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},na=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},ra=class extends na{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},ia=`$chartjs`,aa={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},oa=e=>e===null||e===``;function sa(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[ia]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,oa(i)){let t=pr(e,`width`);t!==void 0&&(e.width=t)}if(oa(r)){if(e.style.height===``)e.height=e.width/(t||2);else{let t=pr(e,`height`);t!==void 0&&(e.height=t)}}return e}var ca=fr?{passive:!0}:!1;function la(e,t,n){e&&e.addEventListener(t,n,ca)}function ua(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ca)}function da(e,t){let n=aa[e.type]||e.type,{x:r,y:i}=sr(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function fa(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function pa(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=fa(n.addedNodes,r),t&&=!fa(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function ma(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=fa(n.removedNodes,r),t&&=!fa(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var ha=new Map,ga=0;function _a(){let e=window.devicePixelRatio;e!==ga&&(ga=e,ha.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function va(e,t){ha.size||window.addEventListener(`resize`,_a),ha.set(e,t)}function ya(e){ha.delete(e),ha.size||window.removeEventListener(`resize`,_a)}function ba(e,t,n){let r=e.canvas,i=r&&$n(r);if(!i)return;let a=St((e,t)=>{let r=i.clientWidth;n(e,t),r{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;(n!==0||r!==0)&&a(n,r)});return o.observe(i),va(e,a),o}function xa(e,t,n){n&&n.disconnect(),t===`resize`&&ya(e)}function Sa(e,t,n){let r=e.canvas,i=St(t=>{e.ctx!==null&&n(da(t,e))},e);return la(r,t,i),i}var Ca=class extends na{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(sa(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[ia])return!1;let n=t[ia].initial;[`height`,`width`].forEach(e=>{let r=n[e];A(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[ia],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:pa,detach:ma,resize:ba}[t]||Sa)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:xa,detach:xa,resize:xa}[t]||ua)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return ur(e,t,n,r)}isAttached(e){let t=e&&$n(e);return!!(t&&t.isConnected)}};function wa(e){return!Qn()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?ra:Ca}var Ta=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return nt(this.x)&&nt(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Ea(e,t){let n=e.options.ticks,r=Da(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?ka(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Aa(t,l,a,o/i),l;let u=Oa(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(ja(t,l,u,A(r)?0:s-r,s),e=0,n=o-1;ei)return t}return Math.max(i,1)}function ka(e){let t=[],n,r;for(n=0,r=e.length;ne===`left`?`right`:e===`right`?`left`:e,Pa=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Fa=(e,t)=>Math.min(t||e,e);function Ia(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;ao+s)))return c}function Ra(e,t){L(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;in?n:t,n=r&&t>n?t:n,{min:P(t,P(n,t)),max:P(n,P(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=W(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-za(e.grid)-t.padding-Ba(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=at(Math.min(Math.asin(W((l.highest.height+6)/o,-1,1)),Math.asin(W(s/c,-1,1))-Math.asin(W(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ba(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=za(i)+a):(e.height=this.maxHeight,e.width=za(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=H(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){I(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return dt(this._alignToPixels?$t(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&eo*r?o/n:s/r:s*r0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=za(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return $t(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(M(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(M(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=F(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_0&&(a-=r/2)}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-H(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);G.route(a,i,c,s)})}function Ya(e){return`id`in e&&`defaults`in e}var X=new class{constructor(){this.controllers=new Ka(ci,`datasets`,!0),this.elements=new Ka(Ta,`elements`),this.plugins=new Ka(Object,`plugins`),this.scales=new Ka(Ga,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):L(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Ve(e);I(n[`before`+r],[],n),t[e](n),I(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;te.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Za(e){let t={},n=[],r=Object.keys(X.plugins.items);for(let e=0;e1&&io(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function so(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function co(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return so(e,`x`,n[0])||so(e,`y`,n[0])}return{}}function lo(e,t){let n=Kt[e.type]||{scales:{}},r=t.scales||{},i=to(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!M(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=oo(t,o,co(t,e),G.scales[o.type]),c=ro(s,i),l=n.scales||{};a[t]=Fe(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||to(i,t),s=(Kt[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=no(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Fe(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Fe(t,[G.scales[t.type],G.scale])}),a}function uo(e){let t=e.options||={};t.plugins=F(t.plugins,{}),t.scales=lo(e,t)}function fo(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function po(e){return e||={},e.data=fo(e.data),uo(e),e}var mo=new Map,ho=new Set;function go(e,t){let n=mo.get(e);return n||(n=t(),mo.set(e,n),ho.add(n)),n}var _o=(e,t,n)=>{let r=Be(t,n);r!==void 0&&e.add(r)},vo=class{constructor(e){this._config=po(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=fo(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),uo(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return go(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return go(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return go(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return go(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>_o(s,e,t))),t.forEach(e=>_o(s,r,e)),t.forEach(e=>_o(s,Kt[i]||{},e)),t.forEach(e=>_o(s,G,e)),t.forEach(e=>_o(s,qt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),ho.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Kt[t]||{},G.datasets[t]||{},{type:t},G,qt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=yo(this._resolverCache,e,r),s=a;if(xo(a,t)){i.$shared=!1,n=Ue(n)?n():n;let t=this.createResolver(e,n,o);s=wn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=yo(this._resolverCache,e,n);return M(t)?wn(i,t,void 0,r):i}};function yo(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:Cn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var bo=e=>M(e)&&Object.getOwnPropertyNames(e).some(t=>Ue(e[t]));function xo(e,t){let{isScriptable:n,isIndexable:r}=Tn(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Ue(o)||bo(o))||a&&j(o))return!0}return!1}var So=`4.5.1`,Co=[`top`,`bottom`,`left`,`right`,`chartArea`];function wo(e,t){return e===`top`||e===`bottom`||Co.indexOf(e)===-1&&t===`x`}function To(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Eo(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),I(n&&n.onComplete,[e],t)}function Do(e){let t=e.chart,n=t.options.animation;I(n&&n.onProgress,[e],t)}function Oo(e){return Qn()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var ko={},Ao=e=>{let t=Oo(e);return Object.values(ko).filter(e=>e.canvas===t).pop()};function jo(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Mo(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var No=class{static defaults=G;static instances=ko;static overrides=Kt;static registry=X;static version=So;static getChart=Ao;static register(...e){X.add(...e),Po()}static unregister(...e){X.remove(...e),Po()}constructor(e,t){let n=this.config=new vo(t),r=Oo(e),i=Ao(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(wa(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=De(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Xa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ct(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],ko[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Y.listen(this,`complete`,Eo),Y.listen(this,`progress`,Do),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return A(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return X}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():dr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return en(this.canvas,this.ctx),this}stop(){return Y.stop(this),this}resize(e,t){Y.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,dr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),I(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){L(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=oo(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),L(i,t=>{let i=t.options,a=i.id,o=oo(a,i),s=F(i.type,t.dtype);(i.position===void 0||wo(i.position,o)!==wo(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(X.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),L(r,(e,t)=>{e||delete n[t]}),L(n,e=>{ta.configure(this,e,e.options),ta.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;et.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(To(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){L(this.scales,e=>{ta.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!We(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)jo(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;ee.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;ta.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],L(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Ir(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&rn(t,r),e.controller.draw(),r&&an(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return K(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Ri.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=Sn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);He(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Y.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};L(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){L(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},L(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});Ae(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Ge(e),c=Mo(e,this._lastEvent,n,s);n&&(this._lastEvent=null,I(i.onHover,[e,o,this],this),s&&I(i.onClick,[e,o,this],this));let l=!Ae(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Po(){return L(No.instances,e=>e._plugins.invalidate())}function Fo(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,U(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,U(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*U(r-n));if(u===`round`)e.arc(i,a,t,n-R/2,r+R/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+R/2)+i,c=-o*Math.sin(n+R/2)+a,l=o*Math.cos(r+R/2)+i,u=o*Math.sin(r+R/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Io(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+B,r-B),e.closePath(),e.clip()}function Lo(e){return _n(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Ro(e,t,n,r){let i=Lo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return W(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:W(i.innerStart,0,o),innerEnd:W(i.innerEnd,0,o)}}function zo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Bo(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/R)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Ro(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,O=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=zo(C,T,o,s);e.arc(t.x,t.y,y,T,_+B)}let n=zo(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=zo(D,O,o,s);e.arc(t.x,t.y,x,_+B,O+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=zo(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-B)}let i=zo(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=zo(S,w,o,s);e.arc(t.x,t.y,v,g-B,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Vo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Bo(e,t,n,r,c,i);for(let t=0;t=R&&p===0&&u!==`miter`&&Fo(e,t,h),a||(Bo(e,t,n,r,h,i),e.stroke())}var Uo=class extends Ta{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=st(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=F(l,o-a),f=ut(r,a,o)&&a!==o,p=d>=z||f,m=ft(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>z?Math.floor(n/z):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(R,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Vo(e,this,s,i,a),Ho(e,this,s,i,a),e.restore()}};function Wo(e,t,n=t){e.lineCap=F(n.borderCapStyle,t.borderCapStyle),e.setLineDash(F(n.borderDash,t.borderDash)),e.lineDashOffset=F(n.borderDashOffset,t.borderDashOffset),e.lineJoin=F(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=F(n.borderWidth,t.borderWidth),e.strokeStyle=F(n.borderColor,t.borderColor)}function Go(e,t,n){e.lineTo(n.x,n.y)}function Ko(e){return e.stepped?on:e.tension||e.cubicInterpolationMode===`monotone`?sn:Go}function qo(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=is&&a>s;return{count:r,start:c,loop:t.loop,ilen:l(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(ng&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Xo(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Yo:Jo}function Zo(e){return e.stepped?hr:e.tension||e.cubicInterpolationMode===`monotone`?gr:mr}function Qo(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Wo(e,t.options),e.stroke(i)}function $o(e,t,n,r){let{segments:i,options:a}=t,o=Xo(t);for(let s of i)Wo(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var es=typeof Path2D==`function`;function ts(e,t,n,r){es&&!t.options.segment?Qo(e,t,n,r):$o(e,t,n,r)}var ns=class extends Ta{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Zn(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=kr(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=Er(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=Zo(n),c,l;for(c=0,l=a.length;c{t=vs(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function vs(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function ys(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function bs(e,t){let n=[],r=!1;return j(e)?(r=!0,n=e):n=_s(e,t),n.length?new ns({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function xs(e){return e&&e.fill!==!1}function Ss(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!N(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function Cs(e,t,n){let r=Ds(e);if(M(r))return!isNaN(r.value)&&r;let i=parseFloat(r);return N(i)&&Math.floor(i)===i?ws(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function ws(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Ts(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:M(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Es(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:M(e)?e.value:t.getBaseValue(),r}function Ds(e){let t=e.options,n=t.fill,r=F(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function Os(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=ks(t,n);s.push(bs({x:null,y:t.bottom},r));for(let e=0;e=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Rs(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;xs(n)&&Rs(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;xs(r)&&n.drawTime===`beforeDatasetDraw`&&Rs(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Ks={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;te+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a-1?e.split(` -`):e}function Js(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Ys(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=J(t.bodyFont),l=J(t.titleFont),u=J(t.footerFont),d=a.length,f=i.length,p=r.length,m=q(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,L(e.title,y),n.font=c.string,L(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,L(r,e=>{L(e.before,y),L(e.lines,y),L(e.after,y)}),v=0,n.font=u.string,L(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function Xs(e,t){let{y:n,height:r}=t;return ne.height-r/2?`bottom`:`center`}function Zs(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function Qs(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),Zs(l,e,t,n)&&(l=`center`),l}function $s(e,t,n){let r=n.yAlign||t.yAlign||Xs(e,n);return{xAlign:n.xAlign||t.xAlign||Qs(e,t,n,r),yAlign:r}}function ec(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function tc(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:r-=t===`bottom`?i+n:i/2,r}function nc(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=yn(o),m=ec(t,s),h=tc(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:W(m,0,r.width-t.width),y:W(h,0,r.height-t.height)}}function rc(e,t,n){let r=q(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function ic(e){return Z([],qs(e))}function ac(e,t,n){return Sn(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function oc(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var sc={beforeTitle:k,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex{let t={before:[],lines:[],after:[]},i=oc(n,e);Z(t.before,qs(Q(i,`beforeLabel`,this,e))),Z(t.lines,Q(i,`label`,this,e)),Z(t.after,qs(Q(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return ic(Q(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Q(n,`beforeFooter`,this,e),i=Q(n,`footer`,this,e),a=Q(n,`afterFooter`,this,e),o=[];return o=Z(o,qs(r)),o=Z(o,qs(i)),o=Z(o,qs(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;se.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),L(o,t=>{let n=oc(e.callbacks,t);r.push(Q(n,`labelColor`,this,t)),i.push(Q(n,`labelPointStyle`,this,t)),a.push(Q(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=Ks[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=Ys(this,n),o=Object.assign({},e,t),s=$s(this.chart,n,o),c=nc(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=yn(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=yr(n.rtl,this.x,this.width);for(e.x=rc(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=J(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;se!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,fn(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),fn(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=J(n.bodyFont),d=u.lineHeight,f=0,p=yr(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=rc(this,h,n),t.fillStyle=n.bodyColor,L(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=Ks[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=Ys(this,e),o=Object.assign({},n,this._size),s=$s(t,e,o),c=nc(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=q(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),br(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),xr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!Ae(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!Ae(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=Ks[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},lc={id:`tooltip`,_element:cc,positioners:Ks,afterInit(e,t,n){n&&(e.tooltip=new cc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:sc},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},uc=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function dc(e,t,n,r){let i=e.indexOf(t);return i===-1?uc(e,t,n,r):i===e.lastIndexOf(t)?i:n}var fc=(e,t)=>e===null?null:W(Math.round(e),0,t);function pc(e){let t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function hc(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!A(a),_=!A(o),v=!A(c),y=(h-m)/(u+1),b=$e((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=$e(w*b/p/f)*f),A(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&rt((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Qe(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(ot(b),ot(S));x=10**(A(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),So)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Qe(n[n.length-1].value,o,gc(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function gc(e,t,{horizontal:n,minRotation:r}){let i=H(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var _c=class extends Ga{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return A(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=V(r),t=V(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=hc({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&it(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Vt(e,this.chart.options.locale,this.options.ticks.format)}},vc=class extends _c{static id=`linear`;static defaults={ticks:{callback:Wt.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=N(e)?e:0,this.max=N(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=H(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},yc=e=>Math.floor(Ze(e)),bc=(e,t)=>10**(yc(e)+t);function xc(e){return e/10**yc(e)==1}function Sc(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Cc(e,t){let n=yc(t-e);for(;Sc(e,t,n)>10;)n++;for(;Sc(e,t,n)<10;)n--;return Math.min(n,yc(e))}function wc(e,{min:t,max:n}){t=P(e.min,t);let r=[],i=yc(t),a=Cc(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=P(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=P(e.max,f);return r.push({value:p,major:xc(p),significand:d}),r}(class extends Ga{static id=`logarithmic`;static defaults={ticks:{callback:Wt.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=_c.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return N(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=N(e)?Math.max(0,e):null,this.max=N(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!N(this._userMin)&&(this.min=e===bc(this.min,0)?bc(this.min,-1):bc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(bc(n,-1)),a(bc(r,1)))),n<=0&&i(bc(r,-1)),r<=0&&a(bc(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=wc({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&it(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Vt(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Ze(e),this._valueRange=Ze(this.max)-Ze(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ze(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function Tc(e){let t=e.ticks;if(t.display&&e.display){let e=q(t.backdropPadding);return F(t.font&&t.font.size,G.font.size)+e.height}return 0}function Ec(e,t,n){return n=j(n)?n:[n],{w:Qt(e,t.string,n),h:n.length*t.lineHeight}}function Dc(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function Oc(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?R/a:0;for(let c=0;ct.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.startt.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Ac(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(at(U(c.angle+B))),u=Fc(c.y,s.h,l),d=Nc(l),f=Pc(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function jc(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(K({x:n,y:r},t)||K({x:n,y:a},t)||K({x:i,y:r},t)||K({x:i,y:a},t))}function Mc(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Tc(a)/2,additionalAngle:o?R/i:0},l;for(let a=0;a270||n<90)&&(e-=t),e}function Ic(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!A(s)){let n=yn(t.borderRadius),c=q(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),fn(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function Lc(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));Ic(n,a,t);let o=J(a.font),{x:s,y:c,textAlign:l}=t;dn(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function Rc(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,z);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a{let n=I(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Oc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=z/(this._pointLabels.length||1),n=this.options.startAngle||0;return U(e*t+H(n))}getDistanceFromCenterForValue(e){if(A(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(A(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);zc(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;a&&i&&(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=J(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=q(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}dn(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var Vc={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},$=Object.keys(Vc);function Hc(e,t){return e-t}function Uc(e,t){if(A(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),N(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(nt(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function Wc(e,t,n,r){let i=$.length;for(let a=$.indexOf(e);a=$.indexOf(n);a--){let n=$[a];if(Vc[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return $[n?$.indexOf(n):0]}function Kc(e){for(let t=$.indexOf(e)+1,n=$.length;t=t?n[r]:n[i];e[a]=!0}}function Jc(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function Yc(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=W(t,0,a),n=W(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||Wc(i.minUnit,t,n,this._getLabelCapacity(t)),o=F(r.ticks.stepSize,1),s=a===`week`&&i.isoWeekday,c=nt(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return I(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=mt(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=mt(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends Xc{static id=`timeseries`;static defaults=Xc.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Zc(t,this.min),this._tableRange=Zc(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;ae-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Zc(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Zc(this._table,n*this._tableRange+this._minPos,!0)}});var Qc={class:`report-chart`},$c={key:0,class:`feature-help`},el={class:`report-chart-canvas`},tl=[`aria-label`],nl={class:`report-chart-data`},rl={class:`table-scroll`},il={scope:`col`},al={scope:`row`},ol={__name:`ReportChart`,props:{title:{type:String,required:!0},summary:{type:String,default:``},type:{type:String,default:`bar`},labels:{type:Array,default:()=>[]},datasets:{type:Array,default:()=>[]},unitLabel:{type:String,default:`Valor`}},setup(d){No.register(Uo,wi,ms,mc,Ei,Gs,Di,ns,vc,is,lc);let f=d,p=e(null),m=null,h=null,g=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim()||`#0f766e`,_=[`--color-primary`,`--color-success`,`--color-destructive`,`--color-warning`,`--color-info`];function v(){return f.datasets.map((e,t)=>g(e.token||_[t%_.length]))}function y(){return f.labels.map((e,t)=>g(_[t%_.length]))}function b(){let e=v(),t=g(`--color-border`),n=g(`--color-muted-foreground`);return{type:f.type,data:{labels:f.labels,datasets:f.datasets.map((t,n)=>({label:t.label,data:t.data,borderColor:f.type===`doughnut`?g(`--color-card`):e[n],backgroundColor:f.type===`doughnut`?y():e[n],fill:f.type!==`line`&&void 0,tension:f.type===`line`?.25:void 0,borderWidth:f.type===`line`?2:1,pointRadius:f.type===`line`?2:void 0}))},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{enabled:!0}},animation:!1,scales:f.type===`doughnut`?void 0:{x:{grid:{color:t},ticks:{color:n}},y:{beginAtZero:!0,grid:{color:t},ticks:{color:n,precision:0}}}}}}function x(){if(p.value){m?.destroy(),m=null;try{m=new No(p.value,b())}catch{m=null}}}return i(()=>{x(),h=new MutationObserver(x),h.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]})}),a(()=>{h?.disconnect(),m?.destroy(),m=null}),u(()=>[f.labels,f.datasets,f.type],x,{deep:!0}),(e,i)=>(n(),r(`figure`,Qc,[o(`figcaption`,null,[o(`h3`,null,t(d.title),1),d.summary?(n(),r(`p`,$c,t(d.summary),1)):c(``,!0)]),o(`div`,el,[o(`canvas`,{ref_key:`canvas`,ref:p,role:`img`,"aria-label":d.summary||d.title},null,8,tl)]),o(`details`,nl,[i[0]||=o(`summary`,null,`Ver dados em tabela`,-1),o(`div`,rl,[o(`table`,null,[o(`thead`,null,[o(`tr`,null,[o(`th`,il,t(d.unitLabel),1),(n(!0),r(s,null,l(d.datasets,e=>(n(),r(`th`,{key:e.label,scope:`col`},t(e.label),1))),128))])]),o(`tbody`,null,[(n(!0),r(s,null,l(d.labels,(e,i)=>(n(),r(`tr`,{key:e},[o(`th`,al,t(e),1),(n(!0),r(s,null,l(d.datasets,e=>(n(),r(`td`,{key:e.label},t(e.data[i]??0),1))),128))]))),128))])])])])]))}};export{ol as t}; \ No newline at end of file diff --git a/public/build/assets/Similarity-CKnBsn3m.js b/public/build/assets/Similarity-CKnBsn3m.js deleted file mode 100644 index 56c3b717..00000000 --- a/public/build/assets/Similarity-CKnBsn3m.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as c,i as l,l as u,o as d,p as f,s as p,u as m,v as h}from"./app-DKg3nD5E.js";import{a as g,i as _,n as v,r as y,t as b}from"./FeatureState-Ceer7rtj.js";import{t as x}from"./FeaturePager-BA0LLbT3.js";import{t as S}from"./FieldError-P7Uk3ge_.js";var C={class:`feature-stack`},ee={class:`surface feature-panel`},te=[`disabled`,`aria-invalid`],w=[`value`],T=[`disabled`,`aria-invalid`],E=[`value`],D=[`disabled`,`aria-invalid`],O=[`disabled`],k={key:0,class:`feature-help`},A={class:`surface feature-panel`},j={class:`feature-heading`},M=[`disabled`],N={key:0,class:`feature-empty`},P={class:`feature-heading`},F={class:`feature-badge`},I={class:`feature-help`},L={key:0,class:`feature-error`},R={key:1,role:`status`},z={key:2,class:`feature-help`},ne=[`href`],B=[`href`],V={__name:`Similarity`,setup(V){let{data:H,loading:U,error:W,busy:G,notice:K,actionError:q,load:J,filter:Y,act:X}=v(`/api/frontend/similarity`),Z=t(``),Q=t(``),$=t(80),re=o(()=>H.value?.problems?.find(e=>String(e.id)===String(Z.value))?.languages||[]),ie={queued:`Na fila`,running:`Em análise`,completed:`Concluída`,failed:`Falhou`};async function ae(e){await X(`/api/frontend/similarity/checks`,{problem_id:Z.value,language_id:Q.value,threshold:Number($.value)},`Análise solicitada. Atualize a lista para acompanhar.`,`POST`,e.target)&&await J()}return(t,o)=>(r(),s(`div`,C,[o[17]||=u(`div`,{class:`feature-message`},[u(`strong`,null,`Compare com contexto.`),c(` Similaridade é um indício para revisão humana. O resultado não aplica penalidades automaticamente.`)],-1),f(b,{loading:e(U),error:e(W),stale:!!e(H),busy:e(G),notice:e(K),"action-error":e(q),onRetry:o[0]||=t=>e(J)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),e(H)?(r(),s(p,{key:0},[u(`section`,ee,[o[13]||=u(`h2`,null,`Nova análise`,-1),o[14]||=u(`p`,{class:`feature-help`},`Compara a última solução aceita de cada equipe, no mesmo problema e linguagem.`,-1),u(`form`,{class:`feature-form`,onSubmit:d(ae,[`prevent`])},[u(`label`,null,[o[8]||=c(`Problema`,-1),a(u(`select`,{"onUpdate:modelValue":o[1]||=e=>Z.value=e,name:`problem_id`,required:``,disabled:e(G),"aria-invalid":!!e(q)?.errors?.problem_id,"aria-describedby":`problem_id-error`,onChange:o[2]||=e=>Q.value=``},[o[7]||=u(`option`,{value:``},`Selecione um problema`,-1),(r(!0),s(p,null,h(e(H).problems,e=>(r(),s(`option`,{key:e.id,value:e.id},n(e.contest_name)+` · `+n(e.name),9,w))),128))],40,te),[[l,Z.value]]),f(S,{error:e(q),name:`problem_id`},null,8,[`error`])]),u(`label`,null,[o[10]||=c(`Linguagem`,-1),a(u(`select`,{"onUpdate:modelValue":o[3]||=e=>Q.value=e,name:`language_id`,required:``,disabled:!Z.value||e(G),"aria-invalid":!!e(q)?.errors?.language_id,"aria-describedby":`language_id-error`},[o[9]||=u(`option`,{value:``},`Selecione uma linguagem`,-1),(r(!0),s(p,null,h(re.value,e=>(r(),s(`option`,{key:e.id,value:e.id},n(e.name),9,E))),128))],8,T),[[l,Q.value]]),f(S,{error:e(q),name:`language_id`},null,8,[`error`])]),u(`label`,null,[o[11]||=c(`Similaridade mínima (%)`,-1),a(u(`input`,{"onUpdate:modelValue":o[4]||=e=>$.value=e,name:`threshold`,type:`number`,required:``,min:`0`,max:`100`,step:`1`,disabled:e(G),"aria-describedby":`threshold-help threshold-error`,"aria-invalid":!!e(q)?.errors?.threshold},null,8,D),[[i,$.value]]),o[12]||=u(`small`,{id:`threshold-help`},`Exibe pares a partir deste percentual.`,-1),f(S,{error:e(q),name:`threshold`},null,8,[`error`])]),u(`button`,{class:`button-primary`,disabled:e(G)||e(U)||!e(H).capabilities?.can_start||!Q.value},`Solicitar análise`,8,O)],32),e(H).capabilities?.can_start?m(``,!0):(r(),s(`p`,k,`Seu perfil não pode solicitar novas análises.`))]),u(`section`,A,[u(`div`,j,[o[15]||=u(`h2`,null,`Análises e resultados`,-1),u(`button`,{type:`button`,class:`button-secondary`,disabled:e(U)||e(G),onClick:o[5]||=t=>e(J)()},`Atualizar resultados`,8,M)]),e(H).items?.length?m(``,!0):(r(),s(`p`,N,`Nenhuma análise solicitada. Escolha um problema para começar.`)),(r(!0),s(p,null,h(e(H).items,t=>(r(),s(`article`,{key:t.id,class:`feature-record`},[u(`div`,P,[u(`h3`,null,n(t.problem_name)+` · `+n(t.language_name),1),u(`span`,F,n(ie[t.status]||`Estado desconhecido`),1)]),u(`p`,I,n(t.team_count)+` equipes · Solicitada em `+n(e(y)(t.created_at))+` · Limite `+n(e(g)(t.threshold)),1),t.status===`failed`?(r(),s(`p`,L,n(t.error_message||`Não foi possível analisar este conjunto. Solicite uma nova análise.`),1)):m(``,!0),t.status===`queued`||t.status===`running`?(r(),s(`p`,R,`A análise continua em segundo plano. Você pode sair desta página.`)):m(``,!0),t.status===`completed`&&!t.pairs?.length?(r(),s(`p`,z,`Nenhum par acima do limite nesta análise.`)):m(``,!0),(r(!0),s(p,null,h(t.pairs,t=>(r(),s(`div`,{key:t.id,class:`feature-pair`},[u(`div`,null,[u(`strong`,null,n(e(g)(t.similarity_score)),1),o[16]||=u(`p`,{class:`feature-help`},`Similaridade média`,-1)]),e(_)(t.source_a_url)?(r(),s(`a`,{key:0,href:e(_)(t.source_a_url),class:`button-secondary`},n(t.team_a)+` · Ver código #`+n(t.run_id_a),9,ne)):m(``,!0),e(_)(t.source_b_url)?(r(),s(`a`,{key:1,href:e(_)(t.source_b_url),class:`button-secondary`},n(t.team_b)+` · Ver código #`+n(t.run_id_b),9,B)):m(``,!0)]))),128))]))),128)),f(x,{meta:e(H).meta,loading:e(U),onPage:o[6]||=t=>e(Y)({page:t})},null,8,[`meta`,`loading`])])],64)):m(``,!0)]))}};export{V as default}; \ No newline at end of file diff --git a/public/build/assets/Similarity-D66HiKHn.js b/public/build/assets/Similarity-D66HiKHn.js new file mode 100644 index 00000000..5ed4d821 --- /dev/null +++ b/public/build/assets/Similarity-D66HiKHn.js @@ -0,0 +1 @@ +import{D as e,S as t,T as n,a as r,b as i,c as a,d as o,f as s,h as c,l,m as u,o as d,p as f,u as p,w as m,y as h}from"./app-B8gaJnTP.js";import{a as g,i as _,n as v,r as y,t as b}from"./FeatureState-DoiXEL_p.js";import{t as x}from"./FeaturePager-DkN6l5V8.js";import{t as S}from"./FieldError-DRbrcIPQ.js";var ee={class:`feature-stack`},te={class:`surface feature-panel`},C=[`disabled`,`aria-invalid`],w=[`value`],T=[`disabled`,`aria-invalid`],E=[`value`],D=[`disabled`,`aria-invalid`],O=[`disabled`],k={key:0,class:`feature-help`},A={class:`surface feature-panel`},j={class:`feature-heading`},M=[`disabled`],N={key:0,class:`feature-empty`},P={class:`feature-heading`},F={class:`feature-badge`},I={class:`feature-help`},L={key:0,class:`feature-error`},R={key:1,role:`status`},ne={key:2,class:`feature-help`},z=[`href`],B=[`href`],V={__name:`Similarity`,setup(V){let{data:H,loading:U,error:W,busy:G,notice:K,actionError:q,load:J,filter:Y,act:X}=v(`/api/frontend/similarity`),Z=m(``),Q=m(``),$=m(80),re=p(()=>H.value?.problems?.find(e=>String(e.id)===String(Z.value))?.languages||[]),ie={queued:`Na fila`,running:`Em análise`,completed:`Concluída`,failed:`Falhou`};async function ae(e){await X(`/api/frontend/similarity/checks`,{problem_id:Z.value,language_id:Q.value,threshold:Number($.value)},`Análise solicitada. Atualize a lista para acompanhar.`,`POST`,e.target)&&await J()}return(p,m)=>(h(),f(`div`,ee,[m[17]||=o(`div`,{class:`feature-message`},[o(`strong`,null,`Compare com contexto.`),u(` Similaridade é um indício para revisão humana. O resultado não aplica penalidades automaticamente.`)],-1),c(b,{loading:n(U),error:n(W),stale:!!n(H),busy:n(G),notice:n(K),"action-error":n(q),onRetry:m[0]||=e=>n(J)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),n(H)?(h(),f(l,{key:0},[o(`section`,te,[m[13]||=o(`h2`,null,`Nova análise`,-1),m[14]||=o(`p`,{class:`feature-help`},`Compara a última solução aceita de cada equipe, no mesmo problema e linguagem.`,-1),o(`form`,{class:`feature-form`,onSubmit:a(ae,[`prevent`])},[o(`label`,null,[m[8]||=u(`Problema`,-1),t(o(`select`,{"onUpdate:modelValue":m[1]||=e=>Z.value=e,name:`problem_id`,required:``,disabled:n(G),"aria-invalid":!!n(q)?.errors?.problem_id,"aria-describedby":`problem_id-error`,onChange:m[2]||=e=>Q.value=``},[m[7]||=o(`option`,{value:``},`Selecione um problema`,-1),(h(!0),f(l,null,i(n(H).problems,t=>(h(),f(`option`,{key:t.id,value:t.id},e(t.contest_name)+` · `+e(t.name),9,w))),128))],40,C),[[r,Z.value]]),c(S,{error:n(q),name:`problem_id`},null,8,[`error`])]),o(`label`,null,[m[10]||=u(`Linguagem`,-1),t(o(`select`,{"onUpdate:modelValue":m[3]||=e=>Q.value=e,name:`language_id`,required:``,disabled:!Z.value||n(G),"aria-invalid":!!n(q)?.errors?.language_id,"aria-describedby":`language_id-error`},[m[9]||=o(`option`,{value:``},`Selecione uma linguagem`,-1),(h(!0),f(l,null,i(re.value,t=>(h(),f(`option`,{key:t.id,value:t.id},e(t.name),9,E))),128))],8,T),[[r,Q.value]]),c(S,{error:n(q),name:`language_id`},null,8,[`error`])]),o(`label`,null,[m[11]||=u(`Similaridade mínima (%)`,-1),t(o(`input`,{"onUpdate:modelValue":m[4]||=e=>$.value=e,name:`threshold`,type:`number`,required:``,min:`0`,max:`100`,step:`1`,disabled:n(G),"aria-describedby":`threshold-help threshold-error`,"aria-invalid":!!n(q)?.errors?.threshold},null,8,D),[[d,$.value]]),m[12]||=o(`small`,{id:`threshold-help`},`Exibe pares a partir deste percentual.`,-1),c(S,{error:n(q),name:`threshold`},null,8,[`error`])]),o(`button`,{class:`button-primary`,disabled:n(G)||n(U)||!n(H).capabilities?.can_start||!Q.value},`Solicitar análise`,8,O)],32),n(H).capabilities?.can_start?s(``,!0):(h(),f(`p`,k,`Seu perfil não pode solicitar novas análises.`))]),o(`section`,A,[o(`div`,j,[m[15]||=o(`h2`,null,`Análises e resultados`,-1),o(`button`,{type:`button`,class:`button-secondary`,disabled:n(U)||n(G),onClick:m[5]||=e=>n(J)()},`Atualizar resultados`,8,M)]),n(H).items?.length?s(``,!0):(h(),f(`p`,N,`Nenhuma análise solicitada. Escolha um problema para começar.`)),(h(!0),f(l,null,i(n(H).items,t=>(h(),f(`article`,{key:t.id,class:`feature-record`},[o(`div`,P,[o(`h3`,null,e(t.problem_name)+` · `+e(t.language_name),1),o(`span`,F,e(ie[t.status]||`Estado desconhecido`),1)]),o(`p`,I,e(t.team_count)+` equipes · Solicitada em `+e(n(y)(t.created_at))+` · Limite `+e(n(g)(t.threshold)),1),t.status===`failed`?(h(),f(`p`,L,e(t.error_message||`Não foi possível analisar este conjunto. Solicite uma nova análise.`),1)):s(``,!0),t.status===`queued`||t.status===`running`?(h(),f(`p`,R,`A análise continua em segundo plano. Você pode sair desta página.`)):s(``,!0),t.status===`completed`&&!t.pairs?.length?(h(),f(`p`,ne,`Nenhum par acima do limite nesta análise.`)):s(``,!0),(h(!0),f(l,null,i(t.pairs,t=>(h(),f(`div`,{key:t.id,class:`feature-pair`},[o(`div`,null,[o(`strong`,null,e(n(g)(t.similarity_score)),1),m[16]||=o(`p`,{class:`feature-help`},`Similaridade média`,-1)]),n(_)(t.source_a_url)?(h(),f(`a`,{key:0,href:n(_)(t.source_a_url),class:`button-secondary`},e(t.team_a)+` · Ver código #`+e(t.run_id_a),9,z)):s(``,!0),n(_)(t.source_b_url)?(h(),f(`a`,{key:1,href:n(_)(t.source_b_url),class:`button-secondary`},e(t.team_b)+` · Ver código #`+e(t.run_id_b),9,B)):s(``,!0)]))),128))]))),128)),c(x,{meta:n(H).meta,loading:n(U),onPage:m[6]||=e=>n(Y)({page:e})},null,8,[`meta`,`loading`])])],64)):s(``,!0)]))}};export{V as default}; \ No newline at end of file diff --git a/public/build/assets/SiteReport-BPt0LEjY.js b/public/build/assets/SiteReport-BPt0LEjY.js deleted file mode 100644 index 40004dca..00000000 --- a/public/build/assets/SiteReport-BPt0LEjY.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,b as i,c as a,d as o,f as s,i as c,l,o as ee,p as u,s as d,u as f,v as p,y as te}from"./app-DKg3nD5E.js";import{n as ne,r as re,t as m}from"./FeatureState-Ceer7rtj.js";import{t as h}from"./ReportChart-jiaGIq-w.js";var g={class:`feature-stack`},_={class:`feature-message`},v={class:`feature-help`},y={class:`feature-metrics`},b={class:`surface stat-card`},ie={class:`surface stat-card`},ae={class:`surface stat-card`},oe={class:`surface stat-card`},se={class:`surface feature-panel`},ce=[`disabled`],le={key:0,value:``},x=[`value`],S=[`disabled`],C=[`disabled`],w={key:0,class:`feature-help`},T={class:`surface feature-panel`},E={class:`surface feature-panel`},D={class:`table-scroll`},O={class:`report-table`},k={scope:`row`},A={class:`surface feature-panel`},j={class:`surface feature-panel`},M={class:`feature-help`},N={class:`surface feature-panel`},P={__name:`SiteReport`,setup(P){let{data:F,loading:I,error:L,query:R,load:z,filter:B}=ne(`/api/frontend/reports/site`),V=t(R.site_id||``);te(()=>R.site_id,e=>{V.value=e||``});let H=e=>{if(e==null)return`Sem dados`;if(e<60)return`${e} s`;let t=Math.floor(e/60);return t<60?`${t} min`:`${Math.floor(t/60)} h ${t%60} min`},U=e=>e==null?`Sem dados`:`${new Intl.NumberFormat(`pt-BR`,{maximumFractionDigits:1}).format(e)}%`,W=a(()=>F.value?.verdicts??[]),G=a(()=>F.value?.problems??[]),K=a(()=>F.value?.timeline??[]),q=a(()=>F.value?.judging_delay??[]),J=a(()=>F.value?.solved_distribution??[]),Y=a(()=>({labels:W.value.map(e=>`${e.short_name} — ${e.name}`),datasets:[{label:`Submissões`,data:W.value.map(e=>e.total)}]})),X=a(()=>({labels:G.value.map(e=>e.short_name),datasets:[{label:`Submissões`,data:G.value.map(e=>e.submissions),token:`--color-info`},{label:`Times que resolveram`,data:G.value.map(e=>e.solved_teams),token:`--color-success`}]})),Z=a(()=>({labels:K.value.map(e=>`${e.minute} min`),datasets:[{label:`Submissões`,data:K.value.map(e=>e.submissions),token:`--color-primary`},{label:`Aceitas`,data:K.value.map(e=>e.accepted),token:`--color-success`}]})),Q=a(()=>({labels:q.value.map(e=>e.label),datasets:[{label:`Julgamentos`,data:q.value.map(e=>e.total),token:`--color-warning`}]})),$=a(()=>({labels:J.value.map(e=>`${e.solved}`),datasets:[{label:`Times`,data:J.value.map(e=>e.teams),token:`--color-primary`}]}));return(t,a)=>(r(),o(`div`,g,[u(m,{loading:e(I),error:e(L),stale:!!e(F),onRetry:a[0]||=t=>e(z)()},null,8,[`loading`,`error`,`stale`]),e(F)?(r(),o(d,{key:0},[l(`div`,_,[l(`strong`,null,n(e(F).scope?.site_name||`Todas as sedes`),1),s(` — `+n(e(F).contest?.name)+`. `,1),l(`p`,v,[s(` Atualizado em `+n(e(re)(e(F).generated_at))+`. `,1),e(F).contest?.is_frozen?(r(),o(d,{key:0},[a[4]||=s(` O placar público está congelado; este relatório `,-1),a[5]||=l(`strong`,null,`não`,-1),a[6]||=s(` está. Ele é material da organização e não deve ser projetado nem repassado às equipes antes do descongelamento. `,-1)],64)):(r(),o(d,{key:1},[s(`Este relatório mostra os dados sem congelamento.`)],64))])]),l(`dl`,y,[l(`div`,b,[a[7]||=l(`dt`,null,`Submissões`,-1),l(`dd`,null,n(e(F).summary?.submissions??`—`),1)]),l(`div`,ie,[a[8]||=l(`dt`,null,`Na fila`,-1),l(`dd`,null,n(e(F).summary?.pending??`—`),1)]),l(`div`,ae,[a[9]||=l(`dt`,null,`Aceitas`,-1),l(`dd`,null,n(U(e(F).summary?.acceptance_rate)),1)]),l(`div`,oe,[a[10]||=l(`dt`,null,`Julgamento (mediana)`,-1),l(`dd`,null,n(H(e(F).summary?.median_delay_seconds)),1)])]),l(`section`,se,[a[12]||=l(`h2`,null,`Recorte`,-1),l(`form`,{class:`feature-search`,onSubmit:a[3]||=ee(t=>e(B)({site_id:V.value}),[`prevent`])},[l(`label`,null,[a[11]||=s(`Sede `,-1),i(l(`select`,{"onUpdate:modelValue":a[1]||=e=>V.value=e,name:`site_id`,disabled:!e(F).scope?.can_choose_site},[e(F).scope?.can_choose_site?(r(),o(`option`,le,`Todas as sedes`)):f(``,!0),(r(!0),o(d,null,p(e(F).scope?.sites||[],e=>(r(),o(`option`,{key:e.id,value:e.id},n(e.name),9,x))),128))],8,ce),[[c,V.value]])]),l(`button`,{class:`button-primary`,disabled:e(I)},`Aplicar`,8,S),l(`button`,{type:`button`,class:`button-secondary`,disabled:e(I),onClick:a[2]||=t=>e(z)()},`Atualizar`,8,C)],32),e(F).scope?.can_choose_site?f(``,!0):(r(),o(`p`,w,` Sua conta está vinculada a uma sede, então este relatório cobre apenas ela. `))]),l(`section`,T,[a[13]||=l(`h2`,null,`Submissões ao longo da prova`,-1),a[14]||=l(`p`,{class:`feature-help`},` Faixas de 15 minutos desde o início. Uma curva que sobe sem que as aceitas acompanhem costuma ser fila de julgamento, não dificuldade do problema. `,-1),u(h,{type:`line`,title:`Submissões por faixa de 15 minutos`,summary:`Total de submissões e de submissões aceitas, por faixa de 15 minutos da prova.`,"unit-label":`Minuto da prova`,labels:Z.value.labels,datasets:Z.value.datasets},null,8,[`labels`,`datasets`])]),l(`section`,E,[a[16]||=l(`h2`,null,`Problemas`,-1),u(h,{type:`bar`,title:`Submissões e acertos por problema`,summary:`Quantas submissões cada problema recebeu e quantos times o resolveram.`,"unit-label":`Problema`,labels:X.value.labels,datasets:X.value.datasets},null,8,[`labels`,`datasets`]),l(`div`,D,[l(`table`,O,[a[15]||=l(`thead`,null,[l(`tr`,null,[l(`th`,{scope:`col`},`Problema`),l(`th`,{scope:`col`},`Submissões`),l(`th`,{scope:`col`},`Aceitas`),l(`th`,{scope:`col`},`Times que resolveram`),l(`th`,{scope:`col`},`Primeiro acerto`)])],-1),l(`tbody`,null,[(r(!0),o(d,null,p(G.value,e=>(r(),o(`tr`,{key:e.problem_id},[l(`th`,k,n(e.short_name)+` — `+n(e.name),1),l(`td`,null,n(e.submissions),1),l(`td`,null,n(e.accepted),1),l(`td`,null,n(e.solved_teams),1),l(`td`,null,n(e.first_solve_minute==null?`Ninguém resolveu`:`${e.first_solve_minute} min`),1)]))),128))])])])]),l(`section`,A,[a[17]||=l(`h2`,null,`Vereditos`,-1),u(h,{type:`doughnut`,title:`Distribuição de vereditos`,summary:`Quantas submissões receberam cada veredito, incluindo as que ainda aguardam julgamento.`,"unit-label":`Veredito`,labels:Y.value.labels,datasets:Y.value.datasets},null,8,[`labels`,`datasets`])]),l(`section`,j,[a[18]||=l(`h2`,null,`Tempo de julgamento`,-1),l(`p`,M,` Intervalo entre o envio e o veredito, medido no relógio da prova. Máximo observado: `+n(H(e(F).summary?.max_delay_seconds))+`. `,1),u(h,{type:`bar`,title:`Julgamentos por faixa de espera`,summary:`Quantos julgamentos ficaram em cada faixa de espera entre o envio e o veredito.`,"unit-label":`Faixa de espera`,labels:Q.value.labels,datasets:Q.value.datasets},null,8,[`labels`,`datasets`])]),l(`section`,N,[a[19]||=l(`h2`,null,`Problemas resolvidos por time`,-1),u(h,{type:`bar`,title:`Times por quantidade de problemas resolvidos`,summary:`Quantos times terminaram com cada quantidade de problemas resolvidos.`,"unit-label":`Problemas resolvidos`,labels:$.value.labels,datasets:$.value.datasets},null,8,[`labels`,`datasets`])])],64)):f(``,!0)]))}};export{P as default}; \ No newline at end of file diff --git a/public/build/assets/SiteReport-CwR53OTD.js b/public/build/assets/SiteReport-CwR53OTD.js new file mode 100644 index 00000000..906fa743 --- /dev/null +++ b/public/build/assets/SiteReport-CwR53OTD.js @@ -0,0 +1 @@ +import{D as e,S as t,T as n,a as r,b as i,c as a,d as o,f as s,h as c,l,m as u,p as d,u as f,w as p,x as m,y as h}from"./app-B8gaJnTP.js";import{n as ee,r as te,t as ne}from"./FeatureState-DoiXEL_p.js";import{t as g}from"./ReportChart-CEHmWQ8G.js";var _={class:`feature-stack`},v={class:`feature-message`},y={class:`feature-help`},b={class:`feature-metrics`},x={class:`surface stat-card`},S={class:`surface stat-card`},re={class:`surface stat-card`},ie={class:`surface stat-card`},ae={class:`surface feature-panel`},oe=[`disabled`],se={key:0,value:``},ce=[`value`],C=[`disabled`],w=[`disabled`],T={key:0,class:`feature-help`},E={class:`surface feature-panel`},D={class:`surface feature-panel`},O={class:`table-scroll`},k={class:`report-table`},A={scope:`row`},j={class:`surface feature-panel`},M={class:`surface feature-panel`},N={class:`feature-help`},P={class:`surface feature-panel`},F={__name:`SiteReport`,setup(F){let{data:I,loading:L,error:le,query:R,load:z,filter:B}=ee(`/api/frontend/reports/site`),V=p(R.site_id||``);m(()=>R.site_id,e=>{V.value=e||``});let H=e=>{if(e==null)return`Sem dados`;if(e<60)return`${e} s`;let t=Math.floor(e/60);return t<60?`${t} min`:`${Math.floor(t/60)} h ${t%60} min`},U=e=>e==null?`Sem dados`:`${new Intl.NumberFormat(`pt-BR`,{maximumFractionDigits:1}).format(e)}%`,W=f(()=>I.value?.verdicts??[]),G=f(()=>I.value?.problems??[]),K=f(()=>I.value?.timeline??[]),q=f(()=>I.value?.judging_delay??[]),J=f(()=>I.value?.solved_distribution??[]),Y=f(()=>({labels:W.value.map(e=>`${e.short_name} — ${e.name}`),datasets:[{label:`Submissões`,data:W.value.map(e=>e.total)}]})),X=f(()=>({labels:G.value.map(e=>e.short_name),datasets:[{label:`Submissões`,data:G.value.map(e=>e.submissions),token:`--color-info`},{label:`Times que resolveram`,data:G.value.map(e=>e.solved_teams),token:`--color-success`}]})),Z=f(()=>({labels:K.value.map(e=>`${e.minute} min`),datasets:[{label:`Submissões`,data:K.value.map(e=>e.submissions),token:`--color-primary`},{label:`Aceitas`,data:K.value.map(e=>e.accepted),token:`--color-success`}]})),Q=f(()=>({labels:q.value.map(e=>e.label),datasets:[{label:`Julgamentos`,data:q.value.map(e=>e.total),token:`--color-warning`}]})),$=f(()=>({labels:J.value.map(e=>`${e.solved}`),datasets:[{label:`Times`,data:J.value.map(e=>e.teams),token:`--color-primary`}]}));return(f,p)=>(h(),d(`div`,_,[c(ne,{loading:n(L),error:n(le),stale:!!n(I),onRetry:p[0]||=e=>n(z)()},null,8,[`loading`,`error`,`stale`]),n(I)?(h(),d(l,{key:0},[o(`div`,v,[o(`strong`,null,e(n(I).scope?.site_name||`Todas as sedes`),1),u(` — `+e(n(I).contest?.name)+`. `,1),o(`p`,y,[u(` Atualizado em `+e(n(te)(n(I).generated_at))+`. `,1),n(I).contest?.is_frozen?(h(),d(l,{key:0},[p[4]||=u(` O placar público está congelado; este relatório `,-1),p[5]||=o(`strong`,null,`não`,-1),p[6]||=u(` está. Ele é material da organização e não deve ser projetado nem repassado às equipes antes do descongelamento. `,-1)],64)):(h(),d(l,{key:1},[u(`Este relatório mostra os dados sem congelamento.`)],64))])]),o(`dl`,b,[o(`div`,x,[p[7]||=o(`dt`,null,`Submissões`,-1),o(`dd`,null,e(n(I).summary?.submissions??`—`),1)]),o(`div`,S,[p[8]||=o(`dt`,null,`Na fila`,-1),o(`dd`,null,e(n(I).summary?.pending??`—`),1)]),o(`div`,re,[p[9]||=o(`dt`,null,`Aceitas`,-1),o(`dd`,null,e(U(n(I).summary?.acceptance_rate)),1)]),o(`div`,ie,[p[10]||=o(`dt`,null,`Julgamento (mediana)`,-1),o(`dd`,null,e(H(n(I).summary?.median_delay_seconds)),1)])]),o(`section`,ae,[p[12]||=o(`h2`,null,`Recorte`,-1),o(`form`,{class:`feature-search`,onSubmit:p[3]||=a(e=>n(B)({site_id:V.value}),[`prevent`])},[o(`label`,null,[p[11]||=u(`Sede `,-1),t(o(`select`,{"onUpdate:modelValue":p[1]||=e=>V.value=e,name:`site_id`,disabled:!n(I).scope?.can_choose_site},[n(I).scope?.can_choose_site?(h(),d(`option`,se,`Todas as sedes`)):s(``,!0),(h(!0),d(l,null,i(n(I).scope?.sites||[],t=>(h(),d(`option`,{key:t.id,value:t.id},e(t.name),9,ce))),128))],8,oe),[[r,V.value]])]),o(`button`,{class:`button-primary`,disabled:n(L)},`Aplicar`,8,C),o(`button`,{type:`button`,class:`button-secondary`,disabled:n(L),onClick:p[2]||=e=>n(z)()},`Atualizar`,8,w)],32),n(I).scope?.can_choose_site?s(``,!0):(h(),d(`p`,T,` Sua conta está vinculada a uma sede, então este relatório cobre apenas ela. `))]),o(`section`,E,[p[13]||=o(`h2`,null,`Submissões ao longo da prova`,-1),p[14]||=o(`p`,{class:`feature-help`},` Faixas de 15 minutos desde o início. Uma curva que sobe sem que as aceitas acompanhem costuma ser fila de julgamento, não dificuldade do problema. `,-1),c(g,{type:`line`,title:`Submissões por faixa de 15 minutos`,summary:`Total de submissões e de submissões aceitas, por faixa de 15 minutos da prova.`,"unit-label":`Minuto da prova`,labels:Z.value.labels,datasets:Z.value.datasets},null,8,[`labels`,`datasets`])]),o(`section`,D,[p[16]||=o(`h2`,null,`Problemas`,-1),c(g,{type:`bar`,title:`Submissões e acertos por problema`,summary:`Quantas submissões cada problema recebeu e quantos times o resolveram.`,"unit-label":`Problema`,labels:X.value.labels,datasets:X.value.datasets},null,8,[`labels`,`datasets`]),o(`div`,O,[o(`table`,k,[p[15]||=o(`thead`,null,[o(`tr`,null,[o(`th`,{scope:`col`},`Problema`),o(`th`,{scope:`col`},`Submissões`),o(`th`,{scope:`col`},`Aceitas`),o(`th`,{scope:`col`},`Times que resolveram`),o(`th`,{scope:`col`},`Primeiro acerto`)])],-1),o(`tbody`,null,[(h(!0),d(l,null,i(G.value,t=>(h(),d(`tr`,{key:t.problem_id},[o(`th`,A,e(t.short_name)+` — `+e(t.name),1),o(`td`,null,e(t.submissions),1),o(`td`,null,e(t.accepted),1),o(`td`,null,e(t.solved_teams),1),o(`td`,null,e(t.first_solve_minute==null?`Ninguém resolveu`:`${t.first_solve_minute} min`),1)]))),128))])])])]),o(`section`,j,[p[17]||=o(`h2`,null,`Vereditos`,-1),c(g,{type:`doughnut`,title:`Distribuição de vereditos`,summary:`Quantas submissões receberam cada veredito, incluindo as que ainda aguardam julgamento.`,"unit-label":`Veredito`,labels:Y.value.labels,datasets:Y.value.datasets},null,8,[`labels`,`datasets`])]),o(`section`,M,[p[18]||=o(`h2`,null,`Tempo de julgamento`,-1),o(`p`,N,` Intervalo entre o envio e o veredito, medido no relógio da prova. Máximo observado: `+e(H(n(I).summary?.max_delay_seconds))+`. `,1),c(g,{type:`bar`,title:`Julgamentos por faixa de espera`,summary:`Quantos julgamentos ficaram em cada faixa de espera entre o envio e o veredito.`,"unit-label":`Faixa de espera`,labels:Q.value.labels,datasets:Q.value.datasets},null,8,[`labels`,`datasets`])]),o(`section`,P,[p[19]||=o(`h2`,null,`Problemas resolvidos por time`,-1),c(g,{type:`bar`,title:`Times por quantidade de problemas resolvidos`,summary:`Quantos times terminaram com cada quantidade de problemas resolvidos.`,"unit-label":`Problemas resolvidos`,labels:$.value.labels,datasets:$.value.datasets},null,8,[`labels`,`datasets`])])],64)):s(``,!0)]))}};export{F as default}; \ No newline at end of file diff --git a/public/build/assets/Webcast-FU6IU83R.js b/public/build/assets/Webcast-FU6IU83R.js deleted file mode 100644 index c693babb..00000000 --- a/public/build/assets/Webcast-FU6IU83R.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,S as t,T as n,_ as r,a as i,b as a,d as o,f as s,i as ee,l as c,o as l,p as u,s as d,u as f,v as p,y as m}from"./app-DKg3nD5E.js";import{i as h,n as g,r as _,t as te}from"./FeatureState-Ceer7rtj.js";import{t as ne}from"./FeaturePager-BA0LLbT3.js";import{t as v}from"./FieldError-P7Uk3ge_.js";var re={class:`feature-stack`},ie=[`value`],y=[`disabled`],b={class:`surface feature-panel`},x={class:`feature-heading`},S=[`href`],ae={key:1,class:`feature-help`},oe={class:`surface feature-panel`},se=[`disabled`,`aria-invalid`],ce=[`disabled`,`aria-invalid`],le=[`disabled`],C={key:1,class:`feature-message feature-success`},w={class:`feature-secret`},T=[`value`],E={class:`surface feature-panel`},D={class:`feature-heading`},O=[`disabled`],k={key:0,class:`feature-empty`},A={class:`feature-heading`},j={class:`feature-badge`},M={class:`feature-help`},N={key:0,class:`feature-message`},P={class:`feature-actions`},F=[`disabled`,`onClick`],I=[`disabled`],L=[`disabled`,`onClick`],ue={class:`sr-only`},R={__name:`Webcast`,setup(R){let{data:z,loading:B,error:V,busy:H,notice:U,actionError:W,query:G,load:K,filter:q,act:J}=g(`/api/frontend/webcast`),Y=t(G.contest_id||``),X=t(``),Z=t(``),Q=t(null),$=t(null);async function de(){Q.value=null,$.value=null,await q({contest_id:Y.value,page:1})}async function fe(e){Q.value=null;let t=await J(`/api/frontend/webcast/credentials`,{contest_id:z.value.contest.id,label:X.value,expires_at:new Date(Z.value).toISOString()},`Credencial criada. Guarde o segredo antes de sair desta página.`,`POST`,e.target);t&&(Q.value=t.secret,X.value=``,await K())}async function pe(e){await J(`/api/frontend/webcast/credentials/${encodeURIComponent(e)}`,void 0,`Credencial revogada. Ela não permite mais acessar a transmissão.`,`DELETE`)&&($.value=null,Q.value=null,await K())}return m(()=>G.contest_id,e=>{Y.value=e||``}),(t,m)=>(r(),o(`div`,re,[m[21]||=c(`div`,{class:`feature-message`},[c(`strong`,null,`Placar completo para a premiação.`),s(` Quem recebe uma credencial pode ver resultados após o congelamento. Compartilhe apenas com a equipe responsável pela cerimônia.`)],-1),u(te,{loading:e(B),error:e(V),stale:!!e(z),busy:e(H),notice:e(U),"action-error":e(W),onRetry:m[0]||=t=>e(K)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),e(z)?(r(),o(d,{key:0},[c(`form`,{class:`surface feature-panel feature-search`,onSubmit:l(de,[`prevent`])},[c(`label`,null,[m[10]||=s(`Competição`,-1),a(c(`select`,{"onUpdate:modelValue":m[1]||=e=>Y.value=e,name:`contest_id`,required:``},[m[9]||=c(`option`,{value:``},`Selecione uma competição`,-1),(r(!0),o(d,null,p(e(z).contests,e=>(r(),o(`option`,{key:e.id,value:e.id},n(e.name),9,ie))),128))],512),[[ee,Y.value]])]),c(`button`,{class:`button-primary`,disabled:e(B)||e(H)},`Abrir transmissão`,8,y)],32),e(z).contest?(r(),o(d,{key:0},[c(`section`,b,[c(`div`,x,[c(`div`,null,[m[11]||=c(`p`,{class:`eyebrow`},`TRANSMISSÃO`,-1),c(`h2`,null,n(e(z).contest.name),1)]),m[12]||=c(`span`,{class:`feature-badge`},`Placar sem congelamento`,-1)]),e(z).capabilities?.can_export&&e(h)(e(z).export_url)?(r(),o(`a`,{key:0,href:e(h)(e(z).export_url),class:`button-primary`},`Baixar webcast ZIP`,8,S)):(r(),o(`p`,ae,`A exportação não está disponível para esta competição.`))]),c(`section`,oe,[m[17]||=c(`h2`,null,`Nova credencial`,-1),m[18]||=c(`p`,{class:`feature-help`},`O segredo será exibido uma única vez. Defina um nome reconhecível e uma data de validade.`,-1),e(z).capabilities?.can_manage_credentials?(r(),o(`form`,{key:0,class:`feature-form`,onSubmit:l(fe,[`prevent`])},[c(`label`,null,[m[13]||=s(`Nome da credencial`,-1),a(c(`input`,{"onUpdate:modelValue":m[2]||=e=>X.value=e,name:`label`,required:``,maxlength:`80`,disabled:e(H),"aria-invalid":!!e(W)?.errors?.label,"aria-describedby":`label-error`},null,8,se),[[i,X.value]]),u(v,{error:e(W),name:`label`},null,8,[`error`])]),c(`label`,null,[m[14]||=s(`Validade (seu horário local)`,-1),a(c(`input`,{"onUpdate:modelValue":m[3]||=e=>Z.value=e,name:`expires_at`,type:`datetime-local`,required:``,disabled:e(H),"aria-invalid":!!e(W)?.errors?.expires_at,"aria-describedby":`expires_at-error`},null,8,ce),[[i,Z.value]]),u(v,{error:e(W),name:`expires_at`},null,8,[`error`])]),c(`button`,{class:`button-primary`,disabled:e(H)||e(B)},`Gerar credencial`,8,le)],32)):f(``,!0),Q.value?(r(),o(`div`,C,[c(`label`,w,[m[15]||=s(`Segredo da nova credencial`,-1),c(`input`,{value:Q.value,readonly:``,autocomplete:`off`,spellcheck:`false`,"aria-describedby":`secret-help`,onFocus:m[4]||=e=>e.target.select()},null,40,T)]),m[16]||=c(`p`,{id:`secret-help`},`Selecione e copie para um local seguro. Ele não será exibido novamente.`,-1),c(`button`,{type:`button`,class:`button-secondary`,onClick:m[5]||=e=>Q.value=null},`Já guardei, ocultar segredo`)])):f(``,!0)]),c(`section`,E,[c(`div`,D,[m[19]||=c(`h2`,null,`Credenciais emitidas`,-1),c(`button`,{type:`button`,class:`button-secondary`,disabled:e(B)||e(H),onClick:m[6]||=t=>e(K)()},`Atualizar credenciais`,8,O)]),e(z).items?.length?f(``,!0):(r(),o(`p`,k,`Nenhuma credencial emitida para esta competição.`)),(r(!0),o(d,null,p(e(z).items,t=>(r(),o(`article`,{key:t.id,class:`feature-record`},[c(`div`,A,[c(`h3`,null,n(t.label),1),c(`span`,j,n({active:`Ativa`,expired:`Expirada`,revoked:`Revogada`}[t.status]||`Indisponível`),1)]),c(`p`,M,`Validade: `+n(e(_)(t.expires_at))+` · Último acesso: `+n(e(_)(t.last_used_at)),1),$.value===t.id?(r(),o(`div`,N,[c(`p`,null,`Revogar “`+n(t.label)+`”? A transmissão que usa esta credencial perderá acesso imediatamente.`,1),c(`div`,P,[c(`button`,{type:`button`,class:`button-danger`,disabled:e(H),onClick:e=>pe(t.id)},`Confirmar revogação`,8,F),c(`button`,{type:`button`,class:`button-secondary`,disabled:e(H),onClick:m[7]||=e=>$.value=null},`Cancelar`,8,I)])])):t.status===`active`&&e(z).capabilities?.can_manage_credentials?(r(),o(`button`,{key:1,type:`button`,class:`button-secondary`,disabled:e(H),onClick:e=>$.value=t.id},[m[20]||=s(`Revogar`,-1),c(`span`,ue,n(t.label),1)],8,L)):f(``,!0)]))),128)),u(ne,{meta:e(z).meta,loading:e(B),onPage:m[8]||=t=>{Q.value=null,e(q)({page:t})}},null,8,[`meta`,`loading`])])],64)):f(``,!0)],64)):f(``,!0)]))}};export{R as default}; \ No newline at end of file diff --git a/public/build/assets/Webcast-HR2rhgOU.js b/public/build/assets/Webcast-HR2rhgOU.js new file mode 100644 index 00000000..74bd351a --- /dev/null +++ b/public/build/assets/Webcast-HR2rhgOU.js @@ -0,0 +1 @@ +import{D as e,S as t,T as n,a as r,b as i,c as a,d as o,f as s,h as c,l,m as u,o as d,p as f,w as p,x as m,y as h}from"./app-B8gaJnTP.js";import{i as g,n as _,r as v,t as y}from"./FeatureState-DoiXEL_p.js";import{t as b}from"./FeaturePager-DkN6l5V8.js";import{t as x}from"./FieldError-DRbrcIPQ.js";var ee={class:`feature-stack`},te=[`value`],ne=[`disabled`],re={class:`surface feature-panel`},ie={class:`feature-heading`},ae=[`href`],oe={key:1,class:`feature-help`},se={class:`surface feature-panel`},ce=[`disabled`,`aria-invalid`],le=[`disabled`,`aria-invalid`],S=[`disabled`],C={key:1,class:`feature-message feature-success`},w={class:`feature-secret`},T=[`value`],E={class:`surface feature-panel`},D={class:`feature-heading`},O=[`disabled`],k={key:0,class:`feature-empty`},A={class:`feature-heading`},j={class:`feature-badge`},M={class:`feature-help`},N={key:0,class:`feature-message`},P={class:`feature-actions`},F=[`disabled`,`onClick`],I=[`disabled`],L=[`disabled`,`onClick`],ue={class:`sr-only`},R={__name:`Webcast`,setup(R){let{data:z,loading:B,error:V,busy:H,notice:U,actionError:W,query:G,load:K,filter:q,act:J}=_(`/api/frontend/webcast`),Y=p(G.contest_id||``),X=p(``),Z=p(``),Q=p(null),$=p(null);async function de(){Q.value=null,$.value=null,await q({contest_id:Y.value,page:1})}async function fe(e){Q.value=null;let t=await J(`/api/frontend/webcast/credentials`,{contest_id:z.value.contest.id,label:X.value,expires_at:new Date(Z.value).toISOString()},`Credencial criada. Guarde o segredo antes de sair desta página.`,`POST`,e.target);t&&(Q.value=t.secret,X.value=``,await K())}async function pe(e){await J(`/api/frontend/webcast/credentials/${encodeURIComponent(e)}`,void 0,`Credencial revogada. Ela não permite mais acessar a transmissão.`,`DELETE`)&&($.value=null,Q.value=null,await K())}return m(()=>G.contest_id,e=>{Y.value=e||``}),(p,m)=>(h(),f(`div`,ee,[m[21]||=o(`div`,{class:`feature-message`},[o(`strong`,null,`Placar completo para a premiação.`),u(` Quem recebe uma credencial pode ver resultados após o congelamento. Compartilhe apenas com a equipe responsável pela cerimônia.`)],-1),c(y,{loading:n(B),error:n(V),stale:!!n(z),busy:n(H),notice:n(U),"action-error":n(W),onRetry:m[0]||=e=>n(K)()},null,8,[`loading`,`error`,`stale`,`busy`,`notice`,`action-error`]),n(z)?(h(),f(l,{key:0},[o(`form`,{class:`surface feature-panel feature-search`,onSubmit:a(de,[`prevent`])},[o(`label`,null,[m[10]||=u(`Competição`,-1),t(o(`select`,{"onUpdate:modelValue":m[1]||=e=>Y.value=e,name:`contest_id`,required:``},[m[9]||=o(`option`,{value:``},`Selecione uma competição`,-1),(h(!0),f(l,null,i(n(z).contests,t=>(h(),f(`option`,{key:t.id,value:t.id},e(t.name),9,te))),128))],512),[[r,Y.value]])]),o(`button`,{class:`button-primary`,disabled:n(B)||n(H)},`Abrir transmissão`,8,ne)],32),n(z).contest?(h(),f(l,{key:0},[o(`section`,re,[o(`div`,ie,[o(`div`,null,[m[11]||=o(`p`,{class:`eyebrow`},`TRANSMISSÃO`,-1),o(`h2`,null,e(n(z).contest.name),1)]),m[12]||=o(`span`,{class:`feature-badge`},`Placar sem congelamento`,-1)]),n(z).capabilities?.can_export&&n(g)(n(z).export_url)?(h(),f(`a`,{key:0,href:n(g)(n(z).export_url),class:`button-primary`},`Baixar webcast ZIP`,8,ae)):(h(),f(`p`,oe,`A exportação não está disponível para esta competição.`))]),o(`section`,se,[m[17]||=o(`h2`,null,`Nova credencial`,-1),m[18]||=o(`p`,{class:`feature-help`},`O segredo será exibido uma única vez. Defina um nome reconhecível e uma data de validade.`,-1),n(z).capabilities?.can_manage_credentials?(h(),f(`form`,{key:0,class:`feature-form`,onSubmit:a(fe,[`prevent`])},[o(`label`,null,[m[13]||=u(`Nome da credencial`,-1),t(o(`input`,{"onUpdate:modelValue":m[2]||=e=>X.value=e,name:`label`,required:``,maxlength:`80`,disabled:n(H),"aria-invalid":!!n(W)?.errors?.label,"aria-describedby":`label-error`},null,8,ce),[[d,X.value]]),c(x,{error:n(W),name:`label`},null,8,[`error`])]),o(`label`,null,[m[14]||=u(`Validade (seu horário local)`,-1),t(o(`input`,{"onUpdate:modelValue":m[3]||=e=>Z.value=e,name:`expires_at`,type:`datetime-local`,required:``,disabled:n(H),"aria-invalid":!!n(W)?.errors?.expires_at,"aria-describedby":`expires_at-error`},null,8,le),[[d,Z.value]]),c(x,{error:n(W),name:`expires_at`},null,8,[`error`])]),o(`button`,{class:`button-primary`,disabled:n(H)||n(B)},`Gerar credencial`,8,S)],32)):s(``,!0),Q.value?(h(),f(`div`,C,[o(`label`,w,[m[15]||=u(`Segredo da nova credencial`,-1),o(`input`,{value:Q.value,readonly:``,autocomplete:`off`,spellcheck:`false`,"aria-describedby":`secret-help`,onFocus:m[4]||=e=>e.target.select()},null,40,T)]),m[16]||=o(`p`,{id:`secret-help`},`Selecione e copie para um local seguro. Ele não será exibido novamente.`,-1),o(`button`,{type:`button`,class:`button-secondary`,onClick:m[5]||=e=>Q.value=null},`Já guardei, ocultar segredo`)])):s(``,!0)]),o(`section`,E,[o(`div`,D,[m[19]||=o(`h2`,null,`Credenciais emitidas`,-1),o(`button`,{type:`button`,class:`button-secondary`,disabled:n(B)||n(H),onClick:m[6]||=e=>n(K)()},`Atualizar credenciais`,8,O)]),n(z).items?.length?s(``,!0):(h(),f(`p`,k,`Nenhuma credencial emitida para esta competição.`)),(h(!0),f(l,null,i(n(z).items,t=>(h(),f(`article`,{key:t.id,class:`feature-record`},[o(`div`,A,[o(`h3`,null,e(t.label),1),o(`span`,j,e({active:`Ativa`,expired:`Expirada`,revoked:`Revogada`}[t.status]||`Indisponível`),1)]),o(`p`,M,`Validade: `+e(n(v)(t.expires_at))+` · Último acesso: `+e(n(v)(t.last_used_at)),1),$.value===t.id?(h(),f(`div`,N,[o(`p`,null,`Revogar “`+e(t.label)+`”? A transmissão que usa esta credencial perderá acesso imediatamente.`,1),o(`div`,P,[o(`button`,{type:`button`,class:`button-danger`,disabled:n(H),onClick:e=>pe(t.id)},`Confirmar revogação`,8,F),o(`button`,{type:`button`,class:`button-secondary`,disabled:n(H),onClick:m[7]||=e=>$.value=null},`Cancelar`,8,I)])])):t.status===`active`&&n(z).capabilities?.can_manage_credentials?(h(),f(`button`,{key:1,type:`button`,class:`button-secondary`,disabled:n(H),onClick:e=>$.value=t.id},[m[20]||=u(`Revogar`,-1),o(`span`,ue,e(t.label),1)],8,L)):s(``,!0)]))),128)),c(b,{meta:n(z).meta,loading:n(B),onPage:m[8]||=e=>{Q.value=null,n(q)({page:e})}},null,8,[`meta`,`loading`])])],64)):s(``,!0)],64)):s(``,!0)]))}};export{R as default}; \ No newline at end of file diff --git a/public/build/assets/app-B8gaJnTP.js b/public/build/assets/app-B8gaJnTP.js new file mode 100644 index 00000000..56a4c3c0 --- /dev/null +++ b/public/build/assets/app-B8gaJnTP.js @@ -0,0 +1,2 @@ +function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),S=e=>x(e).slice(8,-1),C=e=>x(e)===`[object Object]`,w=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ee=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),te=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ne=/-\w/g,T=te(e=>e.replace(ne,e=>e.slice(1).toUpperCase())),re=/\B([A-Z])/g,E=te(e=>e.replace(re,`-$1`).toLowerCase()),ie=te(e=>e.charAt(0).toUpperCase()+e.slice(1)),ae=te(e=>e?`on${ie(e)}`:``),D=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},se=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ce,le=()=>ce||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function ue(e){if(d(e)){let t={};for(let n=0;n{if(e){let n=e.split(fe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function k(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;nA(e,t))}var xe=e=>!!(e&&e.__v_isRef===!0),j=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?xe(e)?j(e.value):JSON.stringify(e,Se,2):String(e),Se=(e,t)=>xe(t)?Se(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ce(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ce(e))}:_(t)?Ce(t):v(t)&&!d(t)&&!C(t)?String(t):t,Ce=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,M,we=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&M&&(M.active?(this.parent=M,this.index=(M.scopes||(M.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e0&&--this._on===0){if(M===this)M=this.prevScope;else{let e=M;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(Ae){let e=Ae;for(Ae=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;ke;){let t=ke;for(ke=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Pe(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Fe(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Re(r),ze(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Ie(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Le(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Le(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===We)||(e.globalVersion=We,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ie(e))))return;e.flags|=2;let t=e.dep,n=N,r=P;N=e,P=!0;try{Pe(e);let n=e.fn(e._value);(t.version===0||D(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{N=n,P=r,Fe(e),e.flags&=-3}}function Re(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Re(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ze(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var P=!0,Be=[];function Ve(){Be.push(P),P=!1}function He(){let e=Be.pop();P=e===void 0||e}function Ue(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=N;N=void 0;try{t()}finally{N=e}}}var We=0,Ge=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Ke=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!N||!P||N===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==N)t=this.activeLink=new Ge(N,this),N.deps?(t.prevDep=N.depsTail,N.depsTail.nextDep=t,N.depsTail=t):N.deps=N.depsTail=t,qe(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=N.depsTail,t.nextDep=void 0,N.depsTail.nextDep=t,N.depsTail=t,N.deps===t&&(N.deps=e)}return t}trigger(e){this.version++,We++,this.notify(e)}notify(e){Me();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ne()}}};function qe(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)qe(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Je=new WeakMap,Ye=Symbol(``),Xe=Symbol(``),Ze=Symbol(``);function F(e,t,n){if(P&&N){let t=Je.get(e);t||Je.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Ke),r.map=t,r.key=n),r.track()}}function Qe(e,t,n,r,i,a){let o=Je.get(e);if(!o){We++;return}let s=e=>{e&&e.trigger()};if(Me(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&w(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Ze||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Ze)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(Ye)),f(e)&&s(o.get(Xe)));break;case`delete`:i||(s(o.get(Ye)),f(e)&&s(o.get(Xe)));break;case`set`:f(e)&&s(o.get(Ye))}}Ne()}function $e(e){let t=R(e);return t===e?t:(F(t,`iterate`,Ze),L(e)?t:t.map(z))}function et(e){return F(e=R(e),`iterate`,Ze),e}function I(e,t){return It(e)?zt(Ft(e)?z(t):t):z(t)}var tt={__proto__:null,[Symbol.iterator](){return nt(this,Symbol.iterator,e=>I(this,e))},concat(...e){return $e(this).concat(...e.map(e=>d(e)?$e(e):e))},entries(){return nt(this,`entries`,e=>(e[1]=I(this,e[1]),e))},every(e,t){return it(this,`every`,e,t,void 0,arguments)},filter(e,t){return it(this,`filter`,e,t,e=>e.map(e=>I(this,e)),arguments)},find(e,t){return it(this,`find`,e,t,e=>I(this,e),arguments)},findIndex(e,t){return it(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return it(this,`findLast`,e,t,e=>I(this,e),arguments)},findLastIndex(e,t){return it(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return it(this,`forEach`,e,t,void 0,arguments)},includes(...e){return ot(this,`includes`,e)},indexOf(...e){return ot(this,`indexOf`,e)},join(e){return $e(this).join(e)},lastIndexOf(...e){return ot(this,`lastIndexOf`,e)},map(e,t){return it(this,`map`,e,t,void 0,arguments)},pop(){return st(this,`pop`)},push(...e){return st(this,`push`,e)},reduce(e,...t){return at(this,`reduce`,e,t)},reduceRight(e,...t){return at(this,`reduceRight`,e,t)},shift(){return st(this,`shift`)},some(e,t){return it(this,`some`,e,t,void 0,arguments)},splice(...e){return st(this,`splice`,e)},toReversed(){return $e(this).toReversed()},toSorted(e){return $e(this).toSorted(e)},toSpliced(...e){return $e(this).toSpliced(...e)},unshift(...e){return st(this,`unshift`,e)},values(){return nt(this,`values`,e=>I(this,e))}};function nt(e,t,n){let r=et(e),i=r[t]();return r!==e&&!L(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var rt=Array.prototype;function it(e,t,n,r,i,a){let o=et(e),s=o!==e&&!L(e),c=o[t];if(c!==rt[t]){let t=c.apply(e,a);return s?z(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,I(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function at(e,t,n,r){let i=et(e),a=i!==e&&!L(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=I(e,t)),n.call(this,t,I(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?I(e,c):c}function ot(e,t,n){let r=R(e);F(r,`iterate`,Ze);let i=r[t](...n);return(i===-1||i===!1)&&Lt(n[0])?(n[0]=R(n[0]),r[t](...n)):i}function st(e,t,n=[]){Ve(),Me();let r=R(e)[t].apply(e,n);return Ne(),He(),r}var ct=e(`__proto__,__v_isRef,__isVue`),lt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function ut(e){_(e)||(e=String(e));let t=R(this);return F(t,`has`,e),t.hasOwnProperty(e)}var dt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?kt:Ot:i?Dt:Et).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=tt[t]))return e;if(t===`hasOwnProperty`)return ut}let o=Reflect.get(e,t,B(e)?e:n);if((_(t)?lt.has(t):ct(t))||(r||F(e,`get`,t),i))return o;if(B(o)){let e=a&&w(t)?o:o.value;return r&&v(e)?Nt(e):e}return v(o)?r?Nt(o):jt(o):o}},ft=class extends dt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&w(t);if(!this._isShallow){let e=It(i);if(!L(n)&&!It(n)&&(i=R(i),n=R(n)),!a&&B(i)&&!B(n))return e||(i.value=n),!0}let o=a?Number(t)e,vt=e=>Reflect.getPrototypeOf(e);function yt(e,t,n){return function(...r){let i=this.__v_raw,a=R(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?_t:t?zt:z;return!t&&F(a,`iterate`,l?Xe:Ye),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function bt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function xt(e,t){let n={get(n){let r=this.__v_raw,i=R(r),a=R(n);e||(D(n,a)&&F(i,`get`,n),F(i,`get`,a));let{has:o}=vt(i),s=t?_t:e?zt:z;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&F(R(t),`iterate`,Ye),t.size},has(t){let n=this.__v_raw,r=R(n),i=R(t);return e||(D(t,i)&&F(r,`has`,t),F(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=R(a),s=t?_t:e?zt:z;return!e&&F(o,`iterate`,Ye),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:bt(`add`),set:bt(`set`),delete:bt(`delete`),clear:bt(`clear`)}:{add(e){let n=R(this),r=vt(n),i=R(e),a=!t&&!L(e)&&!It(e)?i:e;return r.has.call(n,a)||D(e,a)&&r.has.call(n,e)||D(i,a)&&r.has.call(n,i)||(n.add(a),Qe(n,`add`,a,a)),this},set(e,n){!t&&!L(n)&&!It(n)&&(n=R(n));let r=R(this),{has:i,get:a}=vt(r),o=i.call(r,e);o||=(e=R(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?D(n,s)&&Qe(r,`set`,e,n,s):Qe(r,`add`,e,n),this},delete(e){let t=R(this),{has:n,get:r}=vt(t),i=n.call(t,e);i||=(e=R(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Qe(t,`delete`,e,void 0,a),o},clear(){let e=R(this),t=e.size!==0,n=e.clear();return t&&Qe(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=yt(r,e,t)}),n}function St(e,t){let n=xt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(u(n,r)&&r in t?n:t,r,i)}var Ct={get:St(!1,!1)},wt={get:St(!1,!0)},Tt={get:St(!0,!1)},Et=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,kt=new WeakMap;function At(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function jt(e){return It(e)?e:Pt(e,!1,mt,Ct,Et)}function Mt(e){return Pt(e,!1,gt,wt,Dt)}function Nt(e){return Pt(e,!0,ht,Tt,Ot)}function Pt(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=At(S(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Ft(e){return It(e)?Ft(e.__v_raw):!!(e&&e.__v_isReactive)}function It(e){return!!(e&&e.__v_isReadonly)}function L(e){return!!(e&&e.__v_isShallow)}function Lt(e){return e?!!e.__v_raw:!1}function R(e){let t=e&&e.__v_raw;return t?R(t):e}function Rt(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&O(e,`__v_skip`,!0),e}var z=e=>v(e)?jt(e):e,zt=e=>v(e)?Nt(e):e;function B(e){return e?e.__v_isRef===!0:!1}function Bt(e){return Vt(e,!1)}function Vt(e,t){return B(e)?e:new Ht(e,t)}var Ht=class{constructor(e,t){this.dep=new Ke,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:R(e),this._value=t?e:z(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||L(e)||It(e);e=n?e:R(e),D(e,t)&&(this._rawValue=e,this._value=n?e:z(e),this.dep.trigger())}};function Ut(e){return B(e)?e.value:e}var Wt={get:(e,t,n)=>t===`__v_raw`?e:Ut(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return B(i)&&!B(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Gt(e){return Ft(e)?e:new Proxy(e,Wt)}var Kt=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ke(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=We-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&N!==this)return je(this,!0),!0}get value(){let e=this.dep.track();return Le(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function qt(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new Kt(r,i,n)}var Jt={},Yt=new WeakMap,Xt=void 0;function Zt(e,t=!1,n=Xt){if(n){let t=Yt.get(n);t||Yt.set(n,t=[]),t.push(e)}}function Qt(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f}=i,p=e=>o?e:L(e)||o===!1||o===0?$t(e,1):$t(e),m,g,_,v,y=!1,b=!1;if(B(e)?(g=()=>e.value,y=L(e)):Ft(e)?(g=()=>p(e),y=!0):d(e)?(b=!0,y=e.some(e=>Ft(e)||L(e)),g=()=>e.map(e=>{if(B(e))return e.value;if(Ft(e))return p(e);if(h(e))return f?f(e,2):e()})):g=h(e)?n?f?()=>f(e,2):e:()=>{if(_){Ve();try{_()}finally{He()}}let t=Xt;Xt=m;try{return f?f(e,3,[v]):e(v)}finally{Xt=t}}:r,n&&o){let e=g,t=o===!0?1/0:o;g=()=>$t(e(),t)}let x=Te(),S=()=>{m.stop(),x&&x.active&&c(x.effects,m)};if(s&&n){let e=n;n=(...t)=>{let n=e(...t);return S(),n}}let C=b?Array(e.length).fill(Jt):Jt,w=e=>{if(m.flags&1&&(m.dirty||e)){if(n){let t=m.run();if(e||o||y||(b?t.some((e,t)=>D(e,C[t])):D(t,C))){_&&_();let e=Xt;Xt=m;try{let e=[t,C===Jt?void 0:b&&C[0]===Jt?[]:C,v];C=t,f?f(n,3,e):n(...e)}finally{Xt=e}}}else m.run()}};return u&&u(w),m=new De(g),m.scheduler=l?()=>l(w,!1):w,v=e=>Zt(e,!1,m),_=m.onStop=()=>{let e=Yt.get(m);if(e){if(f)f(e,4);else for(let t of e)t();Yt.delete(m)}},n?a?w(!0):C=m.run():l?l(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function $t(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,B(e))$t(e.value,t,n);else if(d(e))for(let r=0;r{$t(e,t,n)});else if(C(e)){for(let r in e)$t(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&$t(e[r],t,n)}return e}function en(e,t,n,r){try{return r?e(...r):e()}catch(e){tn(e,t,n)}}function V(e,t,n,r){if(h(e)){let i=en(e,t,n,r);return i&&y(i)&&i.catch(e=>{tn(e,t,n)}),i}if(d(e)){let i=[];for(let a=0;a>>1,i=H[r],a=gn(i);a=gn(n)?H.push(e):H.splice(un(t),0,e),e.flags|=1,fn()}}function fn(){cn||=sn.then(_n)}function pn(e){if(!d(e))an&&e.id===-1?an.splice(on+1,0,e):e.flags&1||(rn.push(e),e.flags|=1);else for(let t=0;tgn(e)-gn(t));if(rn.length=0,an){for(let t=0;te.id==null?e.flags&2?-1:1/0:e.id;function _n(e){try{for(U=0;U{r._d&&Ei(-1);let i=yn(t),a=Ci.length,o;try{o=e(...n)}finally{for(let e=Ci.length;e>a;e--)wi();yn(i),r._d&&Ei(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function xn(e,n){if(W===null)return e;let r=aa(W),i=e.dirs||=[];for(let e=0;e1)return n&&h(t)?t.call(r&&r.proxy):t}}var Tn=Symbol.for(`v-scx`),En=()=>wn(Tn);function Dn(e,t,n){return On(e,t,n)}function On(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(Qi){if(c===`sync`){let e=En();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=$;u.call=(e,t,n)=>V(e,p,t,n);let m=!1;c===`post`?u.scheduler=e=>{K(e,p&&p.suspense)}:c!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():dn(e)}),u.augmentJob=e=>{n&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=Qt(e,n,u);return Qi&&(f?f.push(h):d&&h()),h}function kn(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?An(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=Yi(this),s=On(i,a.bind(r),n);return o(),s}function An(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;ee.__isTeleport,Nn=Symbol(`_leaveCb`);function Pn(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==xi){t=n;break}}return t}function Fn(e){if(!Wn(e))return Mn(e.type)&&e.children?Pn(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&h(n.default))return n.default()}}function In(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;In(Mn(n.type)&&Fn(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ln(e,t){return h(e)?s({name:e.name},t,{setup:e}):e}function Rn(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function zn(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Bn=new WeakMap;function Vn(e,n,r,a,o=!1){if(d(e)){e.forEach((e,t)=>Vn(e,n&&(d(n)?n[t]:n),r,a,o));return}if(Un(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&Vn(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?aa(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=R(v),b=v===t?i:e=>!zn(_,e)&&u(y,e),x=(e,t)=>!(t&&zn(_,t));if(m!=null&&m!==p){if(Hn(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(B(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))en(p,f,12,[l,_]);else{let t=g(p),n=B(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),Bn.delete(e)};t.id=-1,Bn.set(e,t),K(t,r)}else Hn(e),i()}}}function Hn(e){let t=Bn.get(e);t&&(t.flags|=8,Bn.delete(e))}le().requestIdleCallback,le().cancelIdleCallback;var Un=e=>!!e.type.__asyncLoader,Wn=e=>e.type.__isKeepAlive;function Gn(e,t){qn(e,`a`,t)}function Kn(e,t){qn(e,`da`,t)}function qn(e,t,n=$){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Yn(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Wn(e.parent.vnode)&&Jn(r,t,n,e),e=e.parent}}function Jn(e,t,n,r){let i=Yn(t,e,r,!0);nr(()=>{c(r[t],i)},n)}function Yn(e,t,n=$,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Ve();let i=Yi(n),a=V(t,n,e,r);return i(),He(),a};return r?i.unshift(a):i.push(a),a}}var Xn=e=>(t,n=$)=>{(!Qi||e===`sp`)&&Yn(e,(...e)=>t(...e),n)},Zn=Xn(`bm`),Qn=Xn(`m`),$n=Xn(`bu`),er=Xn(`u`),tr=Xn(`bum`),nr=Xn(`um`),rr=Xn(`sp`),ir=Xn(`rtg`),ar=Xn(`rtc`);function or(e,t=$){Yn(`ec`,e,t)}var sr=Symbol.for(`v-ndc`);function cr(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&Ft(e),r=!1,s=!1;n&&(r=!L(e),s=It(e),e=et(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;re?Zi(e)?aa(e):lr(e.parent):null,ur=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lr(e.parent),$root:e=>lr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>yr(e),$forceUpdate:e=>e.f||=()=>{dn(e.update)},$nextTick:e=>e.n||=ln.bind(e.proxy),$watch:e=>kn.bind(e)}),dr=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),fr={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(dr(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else mr&&(s[n]=0)}let d=ur[n],f,p;if(d)return n===`$attrs`&&F(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return dr(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||dr(n,c)||u(o,c)||u(i,c)||u(ur,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function pr(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var mr=!0;function hr(e){let t=yr(e),n=e.proxy,i=e.ctx;mr=!1,t.beforeCreate&&_r(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:ee,renderTracked:te,renderTriggered:ne,errorCaptured:T,serverPrefetch:re,expose:E,inheritAttrs:ie,components:ae,directives:D,filters:oe}=t;if(u&&gr(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=jt(t))}if(mr=!0,o)for(let e in o){let t=o[e],a=sa({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)vr(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{Cn(t,e[t])})}f&&_r(f,e,`c`);function O(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(O(Zn,p),O(Qn,m),O($n,g),O(er,_),O(Gn,y),O(Kn,b),O(or,T),O(ar,te),O(ir,ne),O(tr,S),O(nr,w),O(rr,re),d(E)){if(E.length){let t=e.exposed||={};E.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}ee&&e.render===r&&(e.render=ee),ie!=null&&(e.inheritAttrs=ie),ae&&(e.components=ae),D&&(e.directives=D),re&&Rn(e)}function gr(e,t,n=r){d(e)&&(e=wr(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?wn(r.from||n,r.default,!0):wn(r.from||n):wn(r),B(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function _r(e,t,n){V(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function vr(e,t,n,r){let i=r.includes(`.`)?An(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&Dn(i,n)}else if(h(e))Dn(i,e.bind(n));else if(v(e)){if(d(e))e.forEach(e=>vr(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&Dn(i,r,e)}}}function yr(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>br(c,e,o,!0)),br(c,t,o)),v(t)&&a.set(t,c),c}function br(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&br(e,a,n,!0),i&&i.forEach(t=>br(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=xr[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var xr={data:Sr,props:Er,emits:Er,methods:Tr,computed:Tr,beforeCreate:G,created:G,beforeMount:G,mounted:G,beforeUpdate:G,updated:G,beforeDestroy:G,beforeUnmount:G,destroyed:G,unmounted:G,activated:G,deactivated:G,errorCaptured:G,serverPrefetch:G,components:Tr,directives:Tr,watch:Dr,provide:Sr,inject:Cr};function Sr(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function Cr(e,t){return Tr(wr(e),wr(t))}function wr(e){if(d(e)){let t={};for(let n=0;nt===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${T(t)}Modifiers`]||e[`${E(t)}Modifiers`];function Nr(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&Mr(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=a.map(se)));let c,l=i[c=ae(n)]||i[c=ae(T(n))];!l&&o&&(l=i[c=ae(E(n))]),l&&V(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,V(u,e,6,a)}}var Pr=new WeakMap;function Fr(e,t,n=!1){let r=n?Pr:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=Fr(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function Ir(e,t){return!e||!a(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,E(t))||u(e,t))}function Lr(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=yn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Z(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Z(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:Rr(c)}}catch(t){Ci.length=0,tn(t,e,1),v=X(xi)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=zr(y,a)),b=Li(b,y,!1,!0))}return n.dirs&&(b=Li(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&In(Mn(b.type)&&Fn(b)||b,n.transition),v=b,yn(_),v}var Rr=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},zr=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Br(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Vr(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(Wr),Kr=e=>Object.getPrototypeOf(e)===Wr;function qr(e,t,n,r=!1){let i={},a=Gr();e.propsDefaults=Object.create(null),Yr(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Mt(i):e.type.props?i:a,e.attrs=a}function Jr(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=R(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{p=!0;let[t,n]=Qr(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,ti=e=>d(e)?e.map(Z):[Z(e)],ni=(e,t,n)=>{if(t._n)return t;let r=bn((...e)=>ti(t(...e)),n);return r._c=!1,r},ri=(e,t,n)=>{let r=e._ctx;for(let n in e){if(ei(n))continue;let i=e[n];if(h(i))t[n]=ni(n,i,r);else if(i!=null){let e=ti(i);t[n]=()=>e}}},ii=(e,t)=>{let n=ti(t);e.slots.default=()=>n},ai=(e,t,n)=>{for(let r in t)(n||!ei(r))&&(e[r]=t[r])},oi=(e,t,n)=>{let r=e.slots=Gr();if(e.vnode.shapeFlag&32){let e=t._;e?(ai(r,t,n),n&&O(r,`_`,e,!0)):ri(t,r)}else t&&ii(e,t)},si=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:ai(a,n,r):(o=!n.$stable,ri(n,a)),s=n}else n&&(ii(e,n),s={default:1});if(o)for(let e in a)!ei(e)&&s[e]==null&&delete a[e]},K=yi;function ci(e){return li(e)}function li(e,i){let a=le();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!ji(e,t)&&(r=ye(e),k(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case bi:y(e,t,n,r);break;case xi:b(e,t,n,r);break;case Si:e??x(t,n,r,o);break;case q:ae(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?D(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,xe)}u!=null&&i?Vn(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Vn(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)te(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),re(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},te=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&T(e.children,d,null,r,i,ui(e,a),s,u),_&&Sn(e,null,r,`created`),ne(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!ee(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Q(f,r,e)}_&&Sn(e,null,r,`beforeMount`);let v=fi(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&K(()=>{try{f&&Q(f,r,e),v&&g.enter(d),_&&Sn(e,null,r,`mounted`)}finally{}},i)},ne=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&di(r,!1),(g=h.onVnodeBeforeUpdate)&&Q(g,r,n,e),f&&Sn(n,e,r,`beforeUpdate`),r&&di(r,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?E(e.dynamicChildren,d,l,r,i,ui(n,a),o):s||de(e,n,l,null,r,i,ui(n,a),o,!1),u>0){if(u&16)ie(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t{g&&Q(g,r,n,e),f&&Sn(n,e,r,`updated`)},i)},E=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(n!==r){if(n!==t)for(let t in n)!ee(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(ee(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},ae=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),T(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(E(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&pi(e,t,!0)):de(e,t,n,f,i,a,s,c,l)},D=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):O(t,n,r,i,a,o,c):se(e,t,c)},O=(e,t,n,r,i,a,o)=>{let s=e.component=Gi(e,r,i);if(Wn(e)&&(s.ctx.renderer=xe),$i(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ce,o),!e.el){let r=s.subTree=X(xi);b(null,r,t,n),e.placeholder=r.el}}else ce(s,e,t,n,i,a,o)},se=(e,t,n)=>{let r=t.component=e.component;if(Br(e,t,n)){if(r.asyncDep&&!r.asyncResolved){ue(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},ce=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=hi(e);if(n){t&&(t.el=c.el,ue(e,t,o)),n.asyncDep.then(()=>{K(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;di(e,!1),t?(t.el=c.el,ue(e,t,o)):t=c,n&&oe(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Q(d,s,t,c),di(e,!0);let f=Lr(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),ye(p),e,i,a),t.el=f.el,u===null&&Ur(e,f.el),r&&K(r,i),(d=t.props&&t.props.onVnodeUpdated)&&K(()=>Q(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Un(t);if(di(e,!1),l&&oe(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Q(o,d,t),di(e,!0),s&&Se){let t=()=>{e.subTree=Lr(e),Se(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Lr(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&K(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;K(()=>Q(o,d,e),i)}(t.shapeFlag&256||d&&Un(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&K(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new De(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>dn(u),di(e,!0),l()},ue=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Jr(e,t.props,r,n),si(e,t.children,n),Ve(),mn(e),He()},de=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){pe(l,d,n,r,i,a,o,s,c);return}if(f&256){fe(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&ve(l,i,a),d!==l&&p(n,d)):u&16?m&16?pe(l,d,n,r,i,a,o,s,c):ve(l,i,a,!0):(u&8&&p(n,``),m&16&&T(d,n,r,i,a,o,s,c))},fe=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p=0;for(;pd?ve(e,a,o,!0,!1,f):T(t,r,i,a,o,s,c,l,f)},pe=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?Bi(t[u]):Z(t[u]);if(ji(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?Bi(t[p]):Z(t[p]);if(ji(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=ep)for(;u<=f;)k(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Bi(t[u]):Z(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){k(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&ji(n,t[_])){i=_;break}i===void 0?k(n,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let w=x?mi(C):n;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){me(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,xe);return}if(c===q){o(a,t,n);for(let e=0;el.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Nn];a._isLeaving&&a[Nn](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},k=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Ve(),Vn(s,null,n,e,!0),He()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Un(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Q(_,t,e),u&6)_e(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Sn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,xe,r):l&&!l.hasOnce&&(a!==q||d>0&&d&64)?ve(l,t,n,!1,!0):(a===q&&d&384||!i&&u&16)&&ve(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&K(()=>{_&&Q(_,t,e),h&&Sn(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===q){ge(n,r);return}if(t===Si){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},ge=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},_e=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;gi(c),gi(l),r&&oe(r),i.stop(),a&&(a.flags|=8,k(o,e,t,n)),s&&K(s,t),K(()=>{e.isUnmounted=!0},t)},ve=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return ye(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[jn];return n?h(n):t},A=!1,be=(e,t,n)=>{let r;e==null?t._vnode&&(k(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,A||=(A=!0,mn(r),hn(),!1)},xe={p:v,um:k,m:me,r:he,mt:O,mc:T,pc:de,pbc:E,n:ye,o:e},j,Se;return i&&([j,Se]=i(xe)),{render:be,hydrate:j,createApp:Ar(be,j)}}function ui({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function di({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function fi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function pi(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function hi(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:hi(t)}function gi(e){if(e)for(let t=0;te.__isSuspense;function yi(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):pn(e)}var q=Symbol.for(`v-fgt`),bi=Symbol.for(`v-txt`),xi=Symbol.for(`v-cmt`),Si=Symbol.for(`v-stc`),Ci=[],J=null;function Y(e=!1){Ci.push(J=e?null:[])}function wi(){Ci.pop(),J=Ci[Ci.length-1]||null}var Ti=1;function Ei(e,t=!1){Ti+=e,e<0&&J&&t&&(J.hasOnce=!0)}function Di(e){return e.dynamicChildren=Ti>0?J||n:null,wi(),Ti>0&&J&&J.push(e),e}function Oi(e,t,n,r,i,a){return Di(Pi(e,t,n,r,i,a,!0))}function ki(e,t,n,r,i){return Di(X(e,t,n,r,i,!0))}function Ai(e){return e?e.__v_isVNode===!0:!1}function ji(e,t){return e.type===t.type&&e.key===t.key}var Mi=({key:e})=>e??null,Ni=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||B(e)||h(e)?{i:W,r:e,k:t,f:!!n}:e);function Pi(e,t=null,n=null,r=0,i=null,a=e===q?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Mi(t),ref:t&&Ni(t),scopeId:vn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:W};return s?(Vi(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),Ti>0&&!o&&J&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&J.push(c),c}var X=Fi;function Fi(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===sr)&&(e=xi),Ai(e)){let r=Li(e,t,!0);return n&&Vi(r,n),Ti>0&&!a&&J&&(r.shapeFlag&6?J[J.indexOf(e)]=r:J.push(r)),r.patchFlag=-2,r}if(oa(e)&&(e=e.__vccOpts),t){t=Ii(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=k(e)),v(n)&&(Lt(n)&&!d(n)&&(n=s({},n)),t.style=ue(n))}let o=g(e)?1:vi(e)?128:Mn(e)?64:v(e)?4:h(e)?2:0;return Pi(e,t,n,r,i,o,a,!0)}function Ii(e){return e?Lt(e)||Kr(e)?s({},e):e:null}function Li(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Hi(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Mi(l),ref:t&&t.ref?n&&a?d(a)?a.concat(Ni(t)):[a,Ni(t)]:Ni(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==q?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Li(e.ssContent),ssFallback:e.ssFallback&&Li(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&In(u,c.clone(u)),u}function Ri(e=` `,t=0){return X(bi,null,e,t)}function zi(e=``,t=!1){return t?(Y(),ki(xi,null,e)):X(xi,null,e)}function Z(e){return e==null||typeof e==`boolean`?X(xi):d(e)?X(q,null,e.slice()):Ai(e)?Bi(e):X(bi,null,String(e))}function Bi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Li(e)}function Vi(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Vi(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Kr(t)?t._ctx=W:r===3&&W&&(W.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(h(t)){if(r&65){Vi(e,{default:t});return}t={default:t,_ctx:W},n=32}else t=String(t),r&64?(n=16,t=[Ri(t)]):n=8;e.children=t,e.shapeFlag|=n}function Hi(...e){let t={};for(let n=0;n$||W,qi,Ji;{let e=le(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};qi=t(`__VUE_INSTANCE_SETTERS__`,e=>$=e),Ji=t(`__VUE_SSR_SETTERS__`,e=>Qi=e)}var Yi=e=>{let t=$;return qi(e),e.scope.on(),()=>{e.scope.off(),qi(t)}},Xi=()=>{$&&$.scope.off(),qi(null)};function Zi(e){return e.vnode.shapeFlag&4}var Qi=!1;function $i(e,t=!1,n=!1){t&&Ji(t);let{props:r,children:i}=e.vnode,a=Zi(e);qr(e,r,a,t),oi(e,i,n||t);let o=a?ea(e,t):void 0;return t&&Ji(!1),o}function ea(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,fr);let{setup:r}=n;if(r){Ve();let n=e.setupContext=r.length>1?ia(e):null,i=Yi(e),a=en(r,e,0,[e.props,n]),o=y(a);if(He(),i(),(o||e.sp)&&!Un(e)&&Rn(e),o){if(a.then(Xi,Xi),t)return a.then(n=>{Ji(!0);try{ta(e,n,t)}finally{Ji(!1)}}).catch(t=>{tn(t,e,0)});e.asyncDep=a}else ta(e,a,t)}else na(e,t)}function ta(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=Gt(t)),na(e,n)}function na(e,t,n){let i=e.type;e.render||=i.render||r;{let t=Yi(e);Ve();try{hr(e)}finally{He(),t()}}}var ra={get(e,t){return F(e,`get`,``),e[t]}};function ia(e){return{attrs:new Proxy(e.attrs,ra),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function aa(e){return e.exposed?e.exposeProxy||=new Proxy(Gt(Rt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ur)return ur[n](e)},has(e,t){return t in e||t in ur}}):e.proxy}function oa(e){return h(e)&&`__vccOpts`in e}var sa=(e,t)=>qt(e,t,Qi);function ca(e,t,n){try{Ei(-1);let r=arguments.length;return r===2?v(t)&&!d(t)?Ai(t)?X(e,null,[t]):X(e,t):X(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ai(n)&&(n=[n]),X(e,t,n))}finally{Ei(1)}}var la=`3.5.42`,ua=void 0,da=typeof window<`u`&&window.trustedTypes;if(da)try{ua=da.createPolicy(`vue`,{createHTML:e=>e})}catch{}var fa=ua?e=>ua.createHTML(e):e=>e,pa=`http://www.w3.org/2000/svg`,ma=`http://www.w3.org/1998/Math/MathML`,ha=typeof document<`u`?document:null,ga=ha&&ha.createElement(`template`),_a={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?ha.createElementNS(pa,e):t===`mathml`?ha.createElementNS(ma,e):n?ha.createElement(e,{is:n}):ha.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>ha.createTextNode(e),createComment:e=>ha.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ha.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{ga.innerHTML=fa(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=ga.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},va=Symbol(`_vtc`);function ya(e,t,n){let r=e[va];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var ba=Symbol(`_vod`),xa=Symbol(`_vsh`),Sa=Symbol(``),Ca=/(?:^|;)\s*display\s*:/;function wa(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t){if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ea(r,t,``)}else for(let e in t)n[e]??Ea(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Ea(r,i,``):Aa(e,i,!g(t)&&t?t[i]:void 0,o)||Ea(r,i,o)}}else if(i){if(t!==n){let e=r[Sa];e&&(n+=`;`+e),r.cssText=n,a=Ca.test(n)}}else t&&e.removeAttribute(`style`);ba in e&&(e[ba]=a?r.display:``,e[xa]&&(r.display=`none`))}var Ta=/\s*!important$/;function Ea(e,t,n){if(d(n))n.forEach(n=>Ea(e,t,n));else if(n??=``,t.startsWith(`--`))Ta.test(n)?e.setProperty(t,n.replace(Ta,``),`important`):e.setProperty(t,n);else{let r=ka(e,t);Ta.test(n)?e.setProperty(E(r),n.replace(Ta,``),`important`):e[r]=n}}var Da=[`Webkit`,`Moz`,`ms`],Oa={};function ka(e,t){let n=Oa[t];if(n)return n;let r=T(t);if(r!==`filter`&&r in e)return Oa[t]=r;r=ie(r);for(let n=0;nVa||=(Ha.then(()=>Va=0),Date.now());function Wa(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(d(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;ne.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ka=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?ya(e,r,c):t===`style`?wa(e,n,r):a(t)?o(t)||La(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):qa(e,t,r,c))?(Na(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Ma(e,t,r,c,s,t!==`value`)):e._isVueCE&&(Ja(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?Na(e,T(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Ma(e,t,r,c))};function qa(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Ga(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Ga(t)&&g(n)?!1:t in e}function Ja(e,t){let n=e._def.props;if(!n)return!1;let r=T(t);return Array.isArray(n)?n.some(e=>T(e)===r):Object.keys(n).some(e=>T(e)===r)}var Ya=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return d(t)?e=>oe(t,e):t};function Xa(e){e.target.composing=!0}function Za(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Qa=Symbol(`_assign`),$a=Symbol(`_initialValue`);function eo(e,t,n){return t&&(e=e.trim()),n&&(e=se(e)),e}var to={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[$a]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[$a]=e.defaultValue.replace(/\r\n?/g,` +`))),e[Qa]=Ya(i);let a=r||i.props&&i.props.type===`number`;Pa(e,t?`change`:`input`,t=>{t.target.composing||e[Qa](eo(e.value,n,a))}),(n||a)&&Pa(e,`change`,()=>{e.value=eo(e.value,n,a)}),t||(Pa(e,`compositionstart`,Xa),Pa(e,`compositionend`,Za),Pa(e,`change`,Za))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[$a];delete e[$a],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Qa](eo(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Qa]=Ya(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?se(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},no={deep:!0,created(e,t,n){e[Qa]=Ya(n),Pa(e,`change`,()=>{let t=e._modelValue,n=so(e),r=e.checked,i=e[Qa];if(d(t)){let e=be(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(p(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(co(e,r))})},mounted:ro,beforeUpdate(e,t,n){e[Qa]=Ya(n),ro(e,t,n)}};function ro(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(d(t))i=be(t,r.props.value)>-1;else if(p(t))i=t.has(r.props.value);else{if(t===n)return;i=A(t,co(e,!0))}e.checked!==i&&(e.checked=i)}var io={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Pa(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?se(so(e)):so(e)),r=e.multiple,i=r?p(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?d(i)?t.slice():t:i];try{e[Qa](i)}finally{ln(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Qa]=Ya(r)},mounted(e,{value:t}){oo(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Qa]=Ya(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!ao(t,n[1],n[0]))&&oo(e,t)}};function ao(e,t,n){if(!n||d(e))return A(e,t);if(p(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function oo(e,t){let n=e.multiple,r=d(t);if(!n||r||p(t)){for(let i=0,a=e.options.length;iString(e)===String(o)):be(t,o)>-1}else a.selected=t.has(o)}else if(A(so(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function so(e){return`_value`in e?e._value:e.value}function co(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var lo=[`ctrl`,`shift`,`alt`,`meta`],uo={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>lo.some(n=>e[`${n}Key`]&&!t.includes(n))},fo=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=E(n.key);if(t.some(e=>e===r||po[e]===r))return e(n)}))},ho=s({patchProp:Ka},_a),go;function _o(){return go||=ci(ho)}var vo=((...e)=>{let t=_o().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=bo(e);if(!r)return;let i=t._component;!h(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,yo(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function yo(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function bo(e){return g(e)?document.querySelector(e):e}function xo(){document.querySelectorAll(`[data-canned-answer]`).forEach(e=>{e.addEventListener(`click`,()=>{let t=e.form?.elements.namedItem(`answer`);t&&(t.value=e.dataset.cannedAnswer,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus())})});let e=[...document.querySelectorAll(`form[data-confirm]`)];if(!e.length)return;let t=document.createElement(`dialog`);t.className=`confirm-dialog`,t.setAttribute(`aria-labelledby`,`action-confirm-title`),t.setAttribute(`aria-describedby`,`action-confirm-description`),t.innerHTML=`

Confirmar ação

`,document.body.append(t);let[n,r]=t.querySelectorAll(`button`),i,a=new WeakSet;n.addEventListener(`click`,()=>t.close()),t.addEventListener(`close`,()=>{let e=i?.submitter;i=null,e?.focus()}),r.addEventListener(`click`,()=>{let e=i;e&&(t.close(),a.add(e.form),e.form.requestSubmit(e.submitter||void 0))}),e.forEach(e=>e.addEventListener(`submit`,n=>{n.defaultPrevented||a.delete(e)||(n.preventDefault(),i={form:e,submitter:n.submitter},t.querySelector(`p`).textContent=e.dataset.confirm,t.showModal())}))}var So=e=>[...e.querySelectorAll(`a[href], button, input, select, textarea, [tabindex="0"]`)].filter(e=>!e.disabled&&!e.closest(`[inert]`)&&e.getClientRects().length);function Co(e){let t=new Map,n=e;for(;n.parentElement;){for(let e of n.parentElement.children)e!==n&&![`SCRIPT`,`STYLE`,`LINK`].includes(e.tagName)&&(t.set(e,e.inert),e.inert=!0);if(n=n.parentElement,n===document.body)break}return()=>t.forEach((e,t)=>{t.inert=e})}function wo(){let e=null,t=()=>{},n=null,r=``,i=[...document.querySelectorAll(`[data-dialog], [id$="Modal"]`)],a=i=>{let a=!i.classList.contains(`hidden`);a&&e!==i?(e?e.classList.add(`hidden`):(n=document.activeElement,r=document.body.style.overflow),t(),e=i,t=Co(i),document.body.style.overflow=`hidden`,(i.querySelector(`[aria-invalid="true"]`)||i.querySelector(`[data-dialog-initial-focus]`)||So(i)[0]||i).focus()):!a&&e===i&&(e=null,t(),document.body.style.overflow=r,n?.isConnected&&!n.closest(`[inert]`)&&n.focus())};return i.forEach(e=>{e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.tabIndex=-1;let t=e.querySelector(`h2, h3`);t&&(t.id||=`${e.id}-title`,e.setAttribute(`aria-labelledby`,t.id)),e.querySelectorAll(`button`).forEach(e=>{!e.textContent.trim()&&!e.getAttribute(`aria-label`)&&e.setAttribute(`aria-label`,`Fechar janela`)}),new MutationObserver(()=>a(e)).observe(e,{attributes:!0,attributeFilter:[`class`]}),a(e)}),document.querySelectorAll(`[data-dialog-open], [data-dialog-close]`).forEach(e=>{let t=document.getElementById(e.dataset.dialogOpen||e.dataset.dialogClose);t&&(e.dataset.dialogOpen&&(e.setAttribute(`aria-haspopup`,`dialog`),e.setAttribute(`aria-controls`,t.id)),e.addEventListener(`click`,()=>{t.classList.toggle(`hidden`,!!e.dataset.dialogClose),e.dataset.dialogClose&&t.classList.remove(`flex`),a(t)}))}),document.addEventListener(`keydown`,t=>{if(e){if(t.key===`Escape`)t.preventDefault(),t.stopImmediatePropagation(),e.classList.add(`hidden`),e.classList.remove(`flex`),a(e);else if(t.key===`Tab`){let n=So(e),r=n[0],i=n.at(-1);r?t.shiftKey&&(document.activeElement===r||!e.contains(document.activeElement))?(t.preventDefault(),i.focus()):!t.shiftKey&&(document.activeElement===i||!e.contains(document.activeElement))&&(t.preventDefault(),r.focus()):(t.preventDefault(),e.focus())}}},!0),document.addEventListener(`focusin`,t=>{e&&!e.contains(t.target)&&(So(e)[0]||e).focus()}),{open(e){e.classList.remove(`hidden`),a(e)}}}function To(e){let t=t=>{e()&&(t.preventDefault(),t.returnValue=``)};return window.addEventListener(`beforeunload`,t),()=>window.removeEventListener(`beforeunload`,t)}function Eo(e=document){let t=new Map;for(let n of e.querySelectorAll(`[data-draft-field]`)){let e=n.closest(`form`);e&&t.set(e,[...t.get(e)??[],n])}let n=[];for(let[e,r]of t){let t=!1;n.push(To(()=>!t&&r.some(e=>e.value.trim()!==``))),e.addEventListener(`submit`,()=>{t=!0}),window.addEventListener(`pageshow`,e=>{e.persisted&&(t=!1)})}return n}var Do=e=>[...e.elements].filter(e=>e.willValidate),Oo=e=>e.getAttribute(`aria-labelledby`)?.split(/\s+/).map(e=>document.getElementById(e)?.textContent.trim()).filter(Boolean).join(` `),ko=e=>(Oo(e)||e.labels?.[0]?.textContent.trim()||``).replace(/\s*\*$/,``)||e.name;function Ao(e){let t=e.validity;return t.valueMissing?e.type===`checkbox`?`Selecione esta opção para continuar.`:`Preencha o campo ${ko(e)}.`:t.typeMismatch&&e.type===`email`?`Informe um e-mail válido, como nome@exemplo.com.`:t.rangeUnderflow?`Informe um valor maior ou igual a ${e.min}.`:t.rangeOverflow?`Informe um valor menor ou igual a ${e.max}.`:t.tooShort?`Use pelo menos ${e.minLength} caracteres.`:e.validationMessage}function jo(e,t){if(!e.id){let t=`field-${e.name.replace(/[^a-z0-9_-]/gi,`-`)||`input`}`,n=t,r=1;for(;document.getElementById(n);)n=`${t}-${r++}`;e.id=n}let n=`${e.id}-error`,r=document.getElementById(n);r||(r=document.createElement(`p`),r.id=n,r.className=`field-error`,e.insertAdjacentElement(`afterend`,r)),r.textContent=t,e.setAttribute(`aria-invalid`,`true`),e.setAttribute(`aria-describedby`,[...new Set([...(e.getAttribute(`aria-describedby`)||``).split(` `).filter(Boolean),n])].join(` `))}function Mo(e){let t=`${e.id}-error`;document.getElementById(t)?.remove(),e.removeAttribute(`aria-invalid`);let n=(e.getAttribute(`aria-describedby`)||``).split(` `).filter(e=>e&&e!==t);n.length?e.setAttribute(`aria-describedby`,n.join(` `)):e.removeAttribute(`aria-describedby`)}function No(e){document.querySelectorAll(`[data-error-summary]`).forEach(t=>{let n,r=t.dataset.formKey?[...document.forms].find(e=>e.dataset.formKey===t.dataset.formKey):document;if(t.querySelectorAll(`[data-error-field]`).forEach(t=>{let i=[...r?.querySelectorAll(`input[name],select[name],textarea[name]`)||[]].find(e=>e.name===t.dataset.errorField||e.name===`${t.dataset.errorField}[]`);if(!i)return;jo(i,t.textContent.trim());let a=document.createElement(`a`);a.href=`#${i.id}`,a.textContent=t.textContent,a.addEventListener(`click`,t=>{t.preventDefault();let n=i.closest(`[role=dialog]`);n&&e.open(n),i.dispatchEvent(new CustomEvent(`reveal-field`,{bubbles:!0})),i.focus()}),t.replaceChildren(a),n||=i}),n){let t=n.closest(`[role=dialog]`);t&&e.open(t),n.dispatchEvent(new CustomEvent(`reveal-field`,{bubbles:!0})),n.focus()}else t.focus()});let t=new Map;document.querySelectorAll(`form[method="POST"], form[method="post"]`).forEach(e=>{e.id!==`wizardForm`&&(e.noValidate=!0),e.addEventListener(`input`,e=>{e.target.getAttribute(`aria-invalid`)===`true`&&Mo(e.target)}),e.addEventListener(`submit`,n=>{if(t.has(e)){n.preventDefault();return}if(n.defaultPrevented)return;let r=Do(e).filter(e=>!e.validity.valid);if(r.length){n.preventDefault(),r.forEach(e=>jo(e,Ao(e))),r[0].dispatchEvent(new CustomEvent(`reveal-field`,{bubbles:!0})),r[0].focus();return}queueMicrotask(()=>{if(n.defaultPrevented)return;let r=n.submitter,i=r?.innerHTML,a=document.createElement(`p`);a.className=`form-progress`,a.setAttribute(`role`,`status`),a.textContent=`Enviando… Aguarde a confirmação.`,e.insertAdjacentElement(`afterend`,a),e.setAttribute(`aria-busy`,`true`),r&&(r.setAttribute(`aria-disabled`,`true`),r.textContent=`Enviando…`),t.set(e,()=>{e.removeAttribute(`aria-busy`),a.remove(),r&&(r.innerHTML=i,r.removeAttribute(`aria-disabled`))})})})}),window.addEventListener(`pageshow`,()=>{t.forEach(e=>e()),t.clear()})}function Po(){let e=document.getElementById(`wizardForm`);if(!e)return;let t=1;function n(e){document.getElementById(`wizard-status`).textContent=`Etapa ${e} de 5`,document.querySelectorAll(`.wizard-step`).forEach(e=>e.classList.add(`hidden`)),document.getElementById(`step`+e).classList.remove(`hidden`);for(let t=1;t<=5;t++){let n=document.getElementById(`step`+t+`-indicator`),r=n.nextElementSibling;n.setAttribute(`aria-label`,`Etapa ${t}${t